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=-8.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 8C300C31E4B for ; Thu, 13 Jun 2019 16:18:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B90920644 for ; Thu, 13 Jun 2019 16:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560442706; bh=Pr0OKV+vNmFOWLJsWKtStxn11AlVOWFE4I2lYa1OZyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kDTp1Trw3g8D0uoQH5tSf6gdGgmasdHw9yl8aZU7EOCu7OSqOblBj6jDtsYPYRRG4 /XxtBTUwAkyHg4GlPbqfS/G3YKLbVl1wOpkBZkrjsodQub90ek3DIkfOuiiGXQBXPk RrG8+k5ErIlxo30Iipo5H4IPODDPMHcd+jqqY818= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727347AbfFMQSZ (ORCPT ); Thu, 13 Jun 2019 12:18:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:57838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731115AbfFMIkX (ORCPT ); Thu, 13 Jun 2019 04:40:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0A49721473; Thu, 13 Jun 2019 08:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560415222; bh=Pr0OKV+vNmFOWLJsWKtStxn11AlVOWFE4I2lYa1OZyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZnBQBL8ENIU9bLKKFvPHmG/BIFPVfcZ3ioyM4ZLNx62mDukNjjyVmotVQpyqaob4/ w8+NaEMH2uA61qtkqjF5y2XFRTKW2mFwWqUgNG7Z8FFRtP4kb43dmXverFQRoH6WaG +gRjVpfNTQgufa2C9H5xv5U3eVE5b9vMazSCOlKo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ludovic Barre , Ulf Hansson , Sasha Levin Subject: [PATCH 4.19 048/118] mmc: mmci: Prevent polling for busy detection in IRQ context Date: Thu, 13 Jun 2019 10:33:06 +0200 Message-Id: <20190613075646.591338044@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190613075643.642092651@linuxfoundation.org> References: <20190613075643.642092651@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ 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 1841d250e9e2..eb1a65cb878f 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