From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A481C28CC1 for ; Sat, 1 Jun 2019 13:23:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A42727336 for ; Sat, 1 Jun 2019 13:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559395418; bh=9r1puFqb8kXnbp2vr3hFIXYft/uYYN/xujmq0taN2EU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dms9uLP+5PLCnD7nU4/0echntUk3wx/536BGLa8Z/eIja44DypzSEM6b9nH6p/ErG lWuT+7SWVXXu6ATTgoSsS2HYA26TWXKvphaiMx78Ut7L/nroWwbIlHruRQN1oXbw3q SERmQrMpoGNSm9Kx2VA+MusACpzYkF2lxSsmt54I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728391AbfFANXh (ORCPT ); Sat, 1 Jun 2019 09:23:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:53538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727979AbfFANXf (ORCPT ); Sat, 1 Jun 2019 09:23:35 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 687B524C2E; Sat, 1 Jun 2019 13:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559395415; bh=9r1puFqb8kXnbp2vr3hFIXYft/uYYN/xujmq0taN2EU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mTKXP9qsGr5/a1LyFfQRK0qCwttUoP6QzeYE6g8pqFrWwBHz2UZU6r8P2Iu4eCE+g 2TKWzyKujCp3fAbF6krkFxkIgC52WK33SOC9GgvDuUzJs1jDWZl6GmWlOtFHv7vZwC OyfokcC6sRpYAxCSiDynXgpgFGAUfAhmAZxNgDP8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ludovic Barre , Ulf Hansson , Sasha Levin , linux-mmc@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 050/141] mmc: mmci: Prevent polling for busy detection in IRQ context Date: Sat, 1 Jun 2019 09:20:26 -0400 Message-Id: <20190601132158.25821-50-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190601132158.25821-1-sashal@kernel.org> References: <20190601132158.25821-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ludovic Barre [ Upstream commit 8520ce1e17799b220ff421d4f39438c9c572ade3 ] The IRQ handler, mmci_irq(), loops until all status bits have been cleared. However, the status bit signaling busy in variant->busy_detect_flag, may be set even if busy detection isn't monitored for the current request. This may be the case for the CMD11 when switching the I/O voltage, which leads to that mmci_irq() busy loops in IRQ context. Fix this problem, by clearing the status bit for busy, before continuing to validate the condition for the loop. This is safe, because the busy status detection has already been taken care of by mmci_cmd_irq(). Signed-off-by: Ludovic Barre Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/mmci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 1841d250e9e2c..eb1a65cb878f0 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1295,9 +1295,10 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) } /* - * Don't poll for busy completion in irq context. + * Busy detection has been handled by mmci_cmd_irq() above. + * Clear the status bit to prevent polling in IRQ context. */ - if (host->variant->busy_detect && host->busy_status) + if (host->variant->busy_detect_flag) status &= ~host->variant->busy_detect_flag; ret = 1; -- 2.20.1