From patchwork Wed Oct 19 21:54:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 13012362 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57575C4332F for ; Wed, 19 Oct 2022 21:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=I72piLTkYVU/DYQpg2Km81dvpCdsDNo37c3wL7gaO+U=; b=F9Mk6AHazz7/vt q4I3o+73Y4wqXEcjBdQJoB64dBZ/YDmGIT8QtvVQ4cW+O9o/f2c/Oi/hpbAA8eI0gAtSw1pboMQnQ e8fNW0i4J0W745Cuwhxjp1UJeiqBKBmLpm+vUeBNNyA+b56f026vYYjwvuqyZKCg6PQjnacB8ct1T cSv6jRzPXTP1OJ+qA1KxbJzkTLUxjLoscuda6vJKDJmyJoOJBu67Pq94n3T7slMSERkVQfkT6oE5R fQTT2EYJrBennrxV3h1BStkpPeLp5XbekkWiWAUw6L8oME7LXXBBPts6htvYvPDGrTjBSDfYDf9+c JZZ+dQ9151g+28LbVQhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olH1j-005MMH-6U; Wed, 19 Oct 2022 21:55:03 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olH1g-005MKt-0n for linux-arm-kernel@lists.infradead.org; Wed, 19 Oct 2022 21:55:01 +0000 Received: by mail-pl1-x634.google.com with SMTP id u6so1013395plq.12 for ; Wed, 19 Oct 2022 14:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=05Yhwd9QPD5U+FfDA5cFl5dFoWfVBmAtYbeU1FfXhQQ=; b=RlE9kMd6/h7DZpQA0UZZUbHxAWdsUbnFk4ak9VTjYUYSh3bvURpBYXFirqHjFvWrMT ojyv6vjPWnXelssHEILiKkmUXn/+N4ZiEjL5bO5xVhXm9YYbwSgv27FlqXci758TQ8e+ 9Rj+LydUeesYL8+PHub5wTR26vhTRYfMNZv38= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=05Yhwd9QPD5U+FfDA5cFl5dFoWfVBmAtYbeU1FfXhQQ=; b=auPvLjN0enJmGqB5yO61mUCpBsEVHIiU1b/s5UPwBh+lwlVotl5boosiBJ3QgJUkFn yoxSlAl8KR/VKoRf3aRN7t9KQPiou9Tmg82ej5GkU7XWOG8kLDZL5w+mYXRh5NQpXsb1 Svxifnat1HiWT6OlP2qdQXvKQPdFu1VjSE+3F45/oZQZetKWHHXHMl3joalWzRQPBrcg DpgRU4hS+UvwtsjwcFR0VmEaFEoAi0tMgFcR1D6NpfG9Q/Dq64z6m+Ss6IkDBr94dJkj v/6tZjONde9p6NTltnB7/Dt1kibHSggrJjkKcyILRbRL2ZkFrir6nQvdO73fTTDEaYK/ 3gHw== X-Gm-Message-State: ACrzQf3QHO+Tn/BBTYe+ZOAJDkzGoU5FG35Ydt7Cx4pcEd4FbI6u3dBV bgFGPXnxKQtdnbIVYFh1pN+0hQ== X-Google-Smtp-Source: AMsMyM4raOXbgvOGGU+muWqEUI30i6PzZGo+EeKJNqFRBBCvQvSSZ71PmbDc1I5gzJpIorA0Ms5Lcw== X-Received: by 2002:a17:903:48e:b0:17e:ea4a:394e with SMTP id jj14-20020a170903048e00b0017eea4a394emr10258223plb.48.1666216498114; Wed, 19 Oct 2022 14:54:58 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:57b7:1f0e:44d1:f252]) by smtp.gmail.com with UTF8SMTPSA id d7-20020a170902654700b0017c3776634dsm11254233pln.32.2022.10.19.14.54.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 14:54:57 -0700 (PDT) From: Brian Norris To: Ulf Hansson Cc: Shawn Lin , Shawn Guo , Fabio Estevam , Haibo Chen , Broadcom internal kernel review list , NXP Linux Team , Pengutronix Kernel Team , Florian Fainelli , Michal Simek , Faiz Abbas , linux-mmc@vger.kernel.org, Jonathan Hunter , Al Cooper , linux-arm-kernel@lists.infradead.org, Sowjanya Komatineni , linux-kernel@vger.kernel.org, Thierry Reding , Adrian Hunter , Sascha Hauer , Brian Norris Subject: [PATCH v2 0/7] mmc: sdhci controllers: Fix SDHCI_RESET_ALL for CQHCI Date: Wed, 19 Oct 2022 14:54:33 -0700 Message-Id: <20221019215440.277643-1-briannorris@chromium.org> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221019_145500_113866_6E431DA5 X-CRM114-Status: GOOD ( 17.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a series of nearly identical fixes for several SDHCI host drivers. Patch #2 (for sdhci-of-arasan; plus its dependency in patch #1) is the only one I've tested, and I wrote it due to a bug described there. I then noticed that several other drivers do the same thing, and that commit df57d73276b8 ("mmc: sdhci-pci: Fix SDHCI_RESET_ALL for CQHCI for Intel GLK-based controllers") points out the likely-repeated bug. Thus, I include additional patches (compile-tested only) that apply similar fixes to the other drivers which call cqhci_init() but not cqhci_deactivate(). They contain appropriate disclaimers and the relevant parties are CC'd. I would suggest only merging them if you get some kind of ACK from people familiar with the relevant hardware. Notably, I do *not* patch drivers/mmc/host/mtk-sd.c although it uses CQHCI, because it doesn't seem to be an SDHCI-based controller, and so even if it has a similar bug, it's not clear to me how to patch it. - Brian Changes in v2: - Rely on cqhci_deactivate() to safely handle (ignore) not-yet-initialized CQE support Brian Norris (7): mmc: cqhci: Handle deactivate() when not yet initialized mmc: sdhci-of-arasan: Fix SDHCI_RESET_ALL for CQHCI mmc: sdhci-brcmstb: Fix SDHCI_RESET_ALL for CQHCI mms: sdhci-esdhc-imx: Fix SDHCI_RESET_ALL for CQHCI mmc: sdhci-tegra: Fix SDHCI_RESET_ALL for CQHCI mmc: sdhci_am654: Fix SDHCI_RESET_ALL for CQHCI mmc: sdhci-pci-*: Drop redundant ->cqe_private check drivers/mmc/host/cqhci-core.c | 2 +- drivers/mmc/host/sdhci-brcmstb.c | 3 +++ drivers/mmc/host/sdhci-esdhc-imx.c | 3 +++ drivers/mmc/host/sdhci-of-arasan.c | 3 +++ drivers/mmc/host/sdhci-pci-core.c | 3 +-- drivers/mmc/host/sdhci-pci-gli.c | 3 +-- drivers/mmc/host/sdhci-tegra.c | 3 +++ drivers/mmc/host/sdhci_am654.c | 3 +++ 8 files changed, 18 insertions(+), 5 deletions(-)