From patchwork Wed Nov 2 07:26:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 9408657 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4017560234 for ; Wed, 2 Nov 2016 07:27:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F3CC297F5 for ; Wed, 2 Nov 2016 07:27:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23FE129C27; Wed, 2 Nov 2016 07:27:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4ADC297F5 for ; Wed, 2 Nov 2016 07:27:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752580AbcKBH1T (ORCPT ); Wed, 2 Nov 2016 03:27:19 -0400 Received: from lucky1.263xmail.com ([211.157.147.135]:44516 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751680AbcKBH1S (ORCPT ); Wed, 2 Nov 2016 03:27:18 -0400 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.239]) by lucky1.263xmail.com (Postfix) with ESMTP id DF1AFAAB; Wed, 2 Nov 2016 15:27:12 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED4: 1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 7637A3AB; Wed, 2 Nov 2016 15:27:12 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: ulf.hansson@linaro.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 21471T10SBH; Wed, 02 Nov 2016 15:27:12 +0800 (CST) From: Shawn Lin To: Ulf Hansson Cc: linux-mmc@vger.kernel.org, Shawn Lin Subject: [PATCH 7/8] mmc: queue: remove BUG_ON for bounce_sg Date: Wed, 2 Nov 2016 15:26:49 +0800 Message-Id: <1478071609-12941-1-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1478071440-12689-1-git-send-email-shawn.lin@rock-chips.com> References: <1478071440-12689-1-git-send-email-shawn.lin@rock-chips.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP bounce_sg for mqrq_cur and mqrq_pre are proper allocated when initializing the queue and will not be freed before explicitly cleaning the queue. So from the code itself it should be quite confident to remove this check. If that BUG_ON take effects, it is mostly likely the memory is randomly oopsing. Signed-off-by: Shawn Lin --- drivers/mmc/card/queue.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index 8037f73..6c8978a 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c @@ -505,8 +505,6 @@ unsigned int mmc_queue_map_sg(struct mmc_queue *mq, struct mmc_queue_req *mqrq) return blk_rq_map_sg(mq->queue, mqrq->req, mqrq->sg); } - BUG_ON(!mqrq->bounce_sg); - if (mmc_packed_cmd(cmd_type)) sg_len = mmc_queue_packed_map_sg(mq, mqrq->packed, mqrq->bounce_sg, cmd_type);