From patchwork Wed Oct 19 21:54:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 5862 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp554916wrs; Wed, 19 Oct 2022 15:04:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6eJaOy7VyqdbIeZu/oKsSBHLrgYQAc7KYdCj54c1FUKOq36GWwXM/isfl1wPJtAckSjCYT X-Received: by 2002:a17:90b:1f86:b0:205:d3d0:1931 with SMTP id so6-20020a17090b1f8600b00205d3d01931mr12276209pjb.211.1666217041440; Wed, 19 Oct 2022 15:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666217041; cv=none; d=google.com; s=arc-20160816; b=fHJTxqsWz2I+kqGAEeYl+PCl/uQBdtpJl036QQWipxUUUPzGuPvxshmLGzwwKoO9LZ dUmnt4KRNdnct5qG1MTsMDNU07KS9KR+nGl6V6ycDM+fKM885cjmwPzs+iTXU3nOpNks +grsMH4cnQCsWzCw6vPJHFtQoWeY6RQxrE5Ne05biEm7UtVvf/zi4qQLvfNvXzf4Ol1O 6wY0TZAjqd5PqfB4E7xXuWJB/4yP9Il9zN/gQaBQ+WnRhfWpQJymmJ3BTwSgGBTsdLiT M9U45FbqbyofY64ulVj9DrUAh74MqOWqw+RtGG6nCaQe1BHqecJ+KFMgjuZxuv9wjNhH EZAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IbNbprVwcMSh5axZvXvg/6/Lf17+C73zGfmFV0q4APA=; b=tIHmB2CCjcySk1KudSUK+TosQIAmXVuCt2U1+eOvJbZ1u6p5NIh1k6IXF0GACIsKhF 08+ed7i0kEoHeQ43M1fhrAnrAZj0OJqpWhaTUC2GrkfSYaZ5g5xQjoT2193JnFk8nlD8 Xspxl7Ena0DxiR9NhkeaakWJt/3LjgfZ1ujuTvZP6uz18j4epVCbeXmgzdxeoehxUgBE nApkFyWtsvCdi4E0IcPtnVwsbiXX1sREp8v+tFJ09bsvnXiuqQFrw5fuu2zVHS3iUkPH uy4pCoWpTlTH5hzejws9ql7XGW7ocabgK9B1fwxgmltb6OD6qk7AYfrxAc8+rbJ59owv EBrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jtc5lQ40; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n126-20020a634084000000b0045ecb2679f1si19345474pga.45.2022.10.19.15.03.25; Wed, 19 Oct 2022 15:04:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jtc5lQ40; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231354AbiJSVzQ (ORCPT + 99 others); Wed, 19 Oct 2022 17:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230104AbiJSVzE (ORCPT ); Wed, 19 Oct 2022 17:55:04 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1CC6108276 for ; Wed, 19 Oct 2022 14:55:01 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id pb15so1158207pjb.5 for ; Wed, 19 Oct 2022 14:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IbNbprVwcMSh5axZvXvg/6/Lf17+C73zGfmFV0q4APA=; b=jtc5lQ401QtVqG1hgM5C8nhqiLVLg/sUDSKTS1D2u8U8fBBwlC0CdcdAz0f5osiCdj 2xjAgzGdyS3CHjlU1Sk4hXJybQubvQjcO7XWn3h9H8+wa4RBvF1yedA6C43RCQURquc8 1Kx+U/fZ4Czw7qxoo3ox60jKt3Bdk8T81A02Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IbNbprVwcMSh5axZvXvg/6/Lf17+C73zGfmFV0q4APA=; b=qnQjPwy//NR7k19rybBsfbuuWJ3jNY5t6iNQgyeaVzD6qw/wLfGRTcs1dFXsW+VfIL RdSfb4IPJHeeSVUxWE+I/6zdUq6erA4KSu0fuD5U1yKWzFXWhLBO85BfYitPYz6yK4qH NAXDwf1Eey7+MZma2Vg44xyuoifIqI7uXAy9FImjRiCImrRaUeKqU4MbJhYwGurzdETL OzyJZCF2z7lL0+n7WcX9I1ExBb519QQL+DyMPEEum1NX2uyFL3b3hKD1jQgj0c2+R01E JC4GIA+CCr7l8sGREVTLOCLrNDWZPoinjvmy1bDZxkYYxt89dXem/DHGjLjH1XRtv0LA 8eMw== X-Gm-Message-State: ACrzQf0ZpzjIJcNR/3UlxIAXSGRbzGlzQLf5WqAk6b/AlLx2CAM3NaX5 CpcBQFik5tdDv0VtfMIumHBeaA== X-Received: by 2002:a17:902:bd46:b0:17e:8ee5:7b61 with SMTP id b6-20020a170902bd4600b0017e8ee57b61mr10878542plx.44.1666216501002; Wed, 19 Oct 2022 14:55:01 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:57b7:1f0e:44d1:f252]) by smtp.gmail.com with UTF8SMTPSA id q13-20020a170902f34d00b0017680faa1a8sm11113715ple.112.2022.10.19.14.54.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 14:55:00 -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 , stable@vger.kernel.org Subject: [PATCH v2 1/7] mmc: cqhci: Handle deactivate() when not yet initialized Date: Wed, 19 Oct 2022 14:54:34 -0700 Message-Id: <20221019145246.v2.1.Ie85faa09432bfe1b0890d8c24ff95e17f3097317@changeid> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221019215440.277643-1-briannorris@chromium.org> References: <20221019215440.277643-1-briannorris@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747155200605511996?= X-GMAIL-MSGID: =?utf-8?q?1747155200605511996?= Several SDHCI drivers need to deactivate command queueing in their reset hook (see sdhci_cqhci_reset() / sdhci-pci-core.c, for example), and several more are coming. Such drivers also tend to initialize CQHCI support after they've already performed one or more resets. Rather than rely on careful ordering of cqhci_init() within the host setup and reset sequence, let's do a simple NULL check -- deactivating a non-initialized CQHCI instance is harmless. This is an important prerequisite patch for several SDHCI controller bugfixes that follow. Cc: Signed-off-by: Brian Norris --- Changes in v2: - New in v2 drivers/mmc/host/cqhci-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c index b3d7d6d8d654..1fa1d24abb2e 100644 --- a/drivers/mmc/host/cqhci-core.c +++ b/drivers/mmc/host/cqhci-core.c @@ -315,7 +315,7 @@ int cqhci_deactivate(struct mmc_host *mmc) { struct cqhci_host *cq_host = mmc->cqe_private; - if (cq_host->enabled && cq_host->activated) + if (cq_host && cq_host->enabled && cq_host->activated) __cqhci_disable(cq_host); return 0; From patchwork Wed Oct 19 21:54:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 5857 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp553336wrs; Wed, 19 Oct 2022 15:01:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6aXszu8qI+zH/n9EdshWM3HYneETGLQAcxwSUoZWZTwtD7jc7xvv32BoRjDPFL8SdSo3q3 X-Received: by 2002:a63:4307:0:b0:464:a24d:8201 with SMTP id q7-20020a634307000000b00464a24d8201mr9112981pga.116.1666216873596; Wed, 19 Oct 2022 15:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666216873; cv=none; d=google.com; s=arc-20160816; b=VW9vvmlgqevSCkMejEiDit61A9jR7SWeVn/jnmTNu8vuS2/2N1joW95jIGakevMw4n atb3RtyGiOUPFamYIO3SJObcS3vQyt+gL0WSphZkGKGf3yKGrwbSVxdqBwOUQD084jWS QZsr4NCYaAeEYIZwC41e9ZqK038p8Nv2t8xl7HEqMLDZdIuUrSXWCLGTdR4OIhpJVDnT R66mXvJxL36JmrNNM6WtROgQdMLIp3hIlex/mlRSPayx3Ry8sC9M6JZpdbi0BYZ4hz3M Yz5Ry8R3PWbVvpz9wLnKvGm4x75nVM9eGxYxGE9k013O/06pDYBkGl9TXoI9vY+VyZvV 0eQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wM2IDLgue12Ad+DXG6n65QaMf2Usako+kvEgT4ayRuw=; b=rdsmEjS8odIhPiwZL/QXakr1U1e5yXEyaV/CVK7AsYV5vHwmkIEpoQ/EVEMwDzbqiz gnueDgAdiU8WIQrnaG0GDhygZhRlAcw4HmSk/Wz6DTN51fQf21g5qT2Sgc2bzyg+eUyb CBhWm9umEwJxGsegsCjmpgowuTA/tk3ddu8yLKpm/jRwa6mxzTTlbrL30RZ5A8RsZNim N/wgdQcQn5p5VIQF4v/Fc12tjwZVxaTlXXWFUSFiAR7shZk1A+Xc4EGV3K7CE5qxiVVC J5jBognzUZim0Hj5k3IRteE1kVPsxtHDy7BZLo2ULn6y/7xKeG8JnQbAwh+gAub2aQXb a0RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=P9xh6e4a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020a170903210d00b0017c735783e5si16542622ple.31.2022.10.19.15.00.59; Wed, 19 Oct 2022 15:01:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=P9xh6e4a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231304AbiJSVzU (ORCPT + 99 others); Wed, 19 Oct 2022 17:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231239AbiJSVzP (ORCPT ); Wed, 19 Oct 2022 17:55:15 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74F12129761 for ; Wed, 19 Oct 2022 14:55:04 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id fw14so18057772pjb.3 for ; Wed, 19 Oct 2022 14:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wM2IDLgue12Ad+DXG6n65QaMf2Usako+kvEgT4ayRuw=; b=P9xh6e4apUo13+Bt+rHIp6EuqJMIiUwXM/U5iOlFltsDzYC4M2zMfANe3ac58Df+ky UYxhWgd939/1ubf4zs5WLE0o2W9F3CORrm8/JKY4Or2z15NzJ0BGgH+C6pR3U37vL1UK /KY+ka3bAw4D0/6GDa+0iz80u3IAPzKerGtKQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wM2IDLgue12Ad+DXG6n65QaMf2Usako+kvEgT4ayRuw=; b=5BMCV2tqRW40MhqANKpts5k2r2jqdADzIuGOM71Ut3JDJbB9u6r+JQAV4XE73xF4yp uM+ejgP5rBs6++JK+4SJiGelGWGBVZJjKnf6egOpOXmZCAJoIPhj7y910DgfiOlVgPZv CN1usjuccL6pcAfGVR644pobsy2tvWhAqyf4aKcz4vtGhvxPs9Mcavw+tn4Q3T83JJF/ 57TGgAmcQ8SwZ8q7TscufK4KQYvD6sAFVACN9Zu0lAy+82fjQsSYTp0RKJpsgcf05hTD tx2nuDP6joiAdf7np8K8H5cSEiWz4TploU+k2ILbxnn/fo0hI6Cvu2KxKy7UFt9RE1jA HWVg== X-Gm-Message-State: ACrzQf0R58d6u0kDnjAItGyrRlzCaAlb/M8F/A6eqRD/CXwzIOFqO8t4 aFFSGQZ2JjRGLc/bgrEUw3ZB7w== X-Received: by 2002:a17:902:b402:b0:179:e5b0:96d3 with SMTP id x2-20020a170902b40200b00179e5b096d3mr10441531plr.142.1666216503892; Wed, 19 Oct 2022 14:55:03 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:57b7:1f0e:44d1:f252]) by smtp.gmail.com with UTF8SMTPSA id z28-20020aa7949c000000b0052d4b0d0c74sm11831033pfk.70.2022.10.19.14.55.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 14:55:03 -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 , stable@vger.kernel.org Subject: [PATCH v2 2/7] mmc: sdhci-of-arasan: Fix SDHCI_RESET_ALL for CQHCI Date: Wed, 19 Oct 2022 14:54:35 -0700 Message-Id: <20221019145246.v2.2.I29f6a2189e84e35ad89c1833793dca9e36c64297@changeid> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221019215440.277643-1-briannorris@chromium.org> References: <20221019215440.277643-1-briannorris@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747155024565372091?= X-GMAIL-MSGID: =?utf-8?q?1747155024565372091?= SDHCI_RESET_ALL resets will reset the hardware CQE state, but we aren't tracking that properly in software. When out of sync, we may trigger various timeouts. It's not typical to perform resets while CQE is enabled, but one particular case I hit commonly enough: mmc_suspend() -> mmc_power_off(). Typically we will eventually deactivate CQE (cqhci_suspend() -> cqhci_deactivate()), but that's not guaranteed -- in particular, if we perform a partial (e.g., interrupted) system suspend. The same bug was already found and fixed for two other drivers, in v5.7 and v5.9: 5cf583f1fb9c mmc: sdhci-msm: Deactivate CQE during SDHC reset df57d73276b8 mmc: sdhci-pci: Fix SDHCI_RESET_ALL for CQHCI for Intel GLK-based controllers The latter is especially prescient, saying "other drivers using CQHCI might benefit from a similar change, if they also have CQHCI reset by SDHCI_RESET_ALL." So like these other patches, deactivate CQHCI when resetting the controller. Fixes: 84362d79f436 ("mmc: sdhci-of-arasan: Add CQHCI support for arasan,sdhci-5.1") Cc: Signed-off-by: Brian Norris --- Changes in v2: - Rely on cqhci_deactivate() to safely handle (ignore) not-yet-initialized CQE support drivers/mmc/host/sdhci-of-arasan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 3997cad1f793..b30f0d6baf5b 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -366,6 +366,9 @@ static void sdhci_arasan_reset(struct sdhci_host *host, u8 mask) struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host); + if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL)) + cqhci_deactivate(host->mmc); + sdhci_reset(host, mask); if (sdhci_arasan->quirks & SDHCI_ARASAN_QUIRK_FORCE_CDTEST) { From patchwork Wed Oct 19 21:54:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 5863 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp554920wrs; Wed, 19 Oct 2022 15:04:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6OeNPXNqZQHou0sRgB2T4IySvAL+ncEuBZMQWeO2fP9fPw06AFjE1tgL3Jqz+WwqtlS/2r X-Received: by 2002:a63:2b41:0:b0:46e:9364:eb07 with SMTP id r62-20020a632b41000000b0046e9364eb07mr885659pgr.46.1666217041812; Wed, 19 Oct 2022 15:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666217041; cv=none; d=google.com; s=arc-20160816; b=1CTIszk7iPKq8cmOMKwGD2yFezj+/0ljQUutT2eiZtl0bM2ZyaUm+lkInJ4L5o/nR/ F15aH9qvTMqRUnkQvVe8ivGh7/zhFRhaP/TDHfvEOFdlK1QreOysh+OYiCYRSFpY6hYM 2P71J1QMyC1EPh3ljfNAp4Ne5V79ghWkE7cz8JFkOV+PjNQJb7+HNDtTPW7vsmlJTWkv 1YQd/mK9m+mF3OynRWmE18nrGrvGzA2hLSkGgIt2aGs9UkZEROswAoNPwBCuPnq6JXPj K9phAXKPIGrq61yeFn+Cg0JZv+4yyI1SUh9QucNkTkfXIfpPTh6OifLCDq0pp2P20t8N QdWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0aSPJogmlylX7KM1RJ0D1MDbzbxw24/coSip2lgP3l8=; b=mErmjYA2PiGUKk9UUU6xMnzJtQWgg3YZQ7ggm9+n9fbafosOOid/XWmP56T+qdP7WZ A8k1FY5Z0FgSoUvaFRK6us4cFbZP+I79NZXmsXNLA7Q6wZo/u4KAXxjC0l13UbXcRDK0 eFAGUCND8FyTU3kHgF9mvvRn40vhiiotgMDgLAHqX0V2HGyVfhrjCUU3e8mlM8c9yNni uvh9qDKBbOjFrnlYvw3EHohYfBLquuFUFH3h+yZSP1WQy+NGXjVDVcQ5VmP0O2ls3Hzt +UIJlWOqJnaxuFS3tbe9oGLfR1FaXhwdLeKb6l/8jP+LcDrtRmUZKw5fnx/SBuJLNQC1 iTvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FfeJSmTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n18-20020a170902e55200b0016d9c8479b5si22308532plf.344.2022.10.19.15.03.25; Wed, 19 Oct 2022 15:04:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FfeJSmTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231373AbiJSVzY (ORCPT + 99 others); Wed, 19 Oct 2022 17:55:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231299AbiJSVzP (ORCPT ); Wed, 19 Oct 2022 17:55:15 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31C4037FA0 for ; Wed, 19 Oct 2022 14:55:07 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id 10so18576454pli.0 for ; Wed, 19 Oct 2022 14:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0aSPJogmlylX7KM1RJ0D1MDbzbxw24/coSip2lgP3l8=; b=FfeJSmTDi68H718jGTkL3Qo1tO+F4L+j54/kcb1cwGvPvCRoxWbXgrlkIzP8z1mliR GZ3uqYlcUUjHj9i+2kUHXcKMhvofvcwCX0imm1RPyUM1cBAIEklypYsyDLGlghvh/Th5 ePYBz8C0cLy280KU4RVy6tzul8GnmJ1Y48fYA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0aSPJogmlylX7KM1RJ0D1MDbzbxw24/coSip2lgP3l8=; b=bwIuI7iuN+g1T5lvQfRQBU9iTwD27Y0N35jm+Ge+RQ8LbJxknq8BXGiBXlu7l0mjjD HIeXfxzAph6tL9q2WDUrKLWKtyty0ZvmYiiAnSpr+s5JsXDRC4iGe8ijhFr8MqZdRIwV ZJw3l5zsZS+fqZln1DVJPwQtwOlYD99b5BRXZqTi9fJDrVB1sKbccwZWmGqS76Un4ik5 16n+bA5bMYIl9JoftBBablMnUr9dGG2WdY7NPM/+IaOrn7zSpf627L+ywwyXAuwg5v+s hPw/agQwuBx69F95EoblNnZz+B3u0wFPXmCeQ9PoAaWRlyDiUAvfeWdXc3cHKoFWL6as 7cfg== X-Gm-Message-State: ACrzQf2dh8mLrbv51TIDB1FB3rxw4ykOLbGkVEWeZ412ZYOKlKzJ4eqA LRumdVigTP5M1xunsL+QWLXCQw== X-Received: by 2002:a17:902:9048:b0:17f:93a5:4638 with SMTP id w8-20020a170902904800b0017f93a54638mr10696224plz.108.1666216506540; Wed, 19 Oct 2022 14:55:06 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:57b7:1f0e:44d1:f252]) by smtp.gmail.com with UTF8SMTPSA id s13-20020aa78bcd000000b00543a098a6ffsm11792418pfd.212.2022.10.19.14.55.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 14:55:06 -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 3/7] mmc: sdhci-brcmstb: Fix SDHCI_RESET_ALL for CQHCI Date: Wed, 19 Oct 2022 14:54:36 -0700 Message-Id: <20221019145246.v2.3.I6a715feab6d01f760455865e968ecf0d85036018@changeid> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221019215440.277643-1-briannorris@chromium.org> References: <20221019215440.277643-1-briannorris@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747155200599686105?= X-GMAIL-MSGID: =?utf-8?q?1747155200599686105?= [[ NOTE: this is completely untested by the author, but included solely because, as noted in commit df57d73276b8 ("mmc: sdhci-pci: Fix SDHCI_RESET_ALL for CQHCI for Intel GLK-based controllers"), "other drivers using CQHCI might benefit from a similar change, if they also have CQHCI reset by SDHCI_RESET_ALL." We've now seen the same bug on at least MSM, Arasan, and Intel hardware. ]] SDHCI_RESET_ALL resets will reset the hardware CQE state, but we aren't tracking that properly in software. When out of sync, we may trigger various timeouts. It's not typical to perform resets while CQE is enabled, but this may occur in some suspend or error recovery scenarios. Fixes: d46ba2d17f90 ("mmc: sdhci-brcmstb: Add support for Command Queuing (CQE)") Signed-off-by: Brian Norris --- Changes in v2: - Rely on cqhci_deactivate() to handle NULL cqe_private, instead of moving around CQE capability flags drivers/mmc/host/sdhci-brcmstb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c index aff36a933ebe..d479ca39c987 100644 --- a/drivers/mmc/host/sdhci-brcmstb.c +++ b/drivers/mmc/host/sdhci-brcmstb.c @@ -55,6 +55,9 @@ static void brcmstb_reset(struct sdhci_host *host, u8 mask) struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_brcmstb_priv *priv = sdhci_pltfm_priv(pltfm_host); + if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL)) + cqhci_deactivate(host->mmc); + sdhci_reset(host, mask); /* Reset will clear this, so re-enable it */ From patchwork Wed Oct 19 21:54:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 5861 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp554779wrs; Wed, 19 Oct 2022 15:03:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6bKRwbgSZ9kRJJy+S6id/8MW3hflb3cTZz6fBLIIsHxJBc3SnCh3UWBjTisBqcMGuJA6a0 X-Received: by 2002:a63:1326:0:b0:439:40b5:77cc with SMTP id i38-20020a631326000000b0043940b577ccmr9217297pgl.473.1666217023724; Wed, 19 Oct 2022 15:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666217023; cv=none; d=google.com; s=arc-20160816; b=XOczaOS8cjOhO1b8cgyEJqpnxeIFQaEDjfLSdNpsdeTUzlKSp52chRSWKrM+FGu5Fc IYiADGpTeGIQ7G5fQ53/bWrxCGLJcAElQ+wxWTXtLgGnQXMS700DQL2v1kvFxTNg5qAs LbuqiaUDYGRvOY0uq1Z2b7lfcXXPsI7N79Mc2827f0Dun9qT8o4wXtAsGg/FwILVvgdZ RqAkmC/YlJr4CCt6pl8BlR3PY4KFKgvavNEl3dpeYxEogl1f+M/XxedKT/TbzxPzR/Ws v/GhhMBvY9WZgJ7dm0VPYjeD6GUTSdGhcRlwCWrewGaaAHiWz6PxeQo0KQUFv/RTSJLO 6w0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Wydu2mgXy/Ti5pZeMNO0oB2V13SqCsRFUj9VGtENhPc=; b=FMrMgYML8kylmnYIiPFR9Gf83hfxJGUd2+FqoRZAQBtcMm8U1eoBrjxvuy8J8NMDZE Y7LwmaqiYcsfNAPiRSa88DMcKzhxaKWMiJtXRl6lTPPvSap86oK6e11Zkpsbj9BcBFOV 78scsxIV8soJrCSuF/IfLTmqQbtQamdl8GAfYth6U4Qh6r7z7ZZhc02LWdxNe6u2+NCZ HHdd70rwY4tHP+TyuSZJBXlaDZ+ArunJvGSNWEEXoA5q7rKpeNBRi6VC9VE69Iq1/RX7 SPL7C/xvYBB7cfFH5CPEAcDGHJWp1zGuAblCBSQJ25zIs3vvjtXNXGl+ZZSgSLxpG4vs J+gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ChDSlokP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 38-20020a630d66000000b004616889d5c2si20927927pgn.495.2022.10.19.15.03.08; Wed, 19 Oct 2022 15:03:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ChDSlokP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231610AbiJSVzt (ORCPT + 99 others); Wed, 19 Oct 2022 17:55:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231387AbiJSVzX (ORCPT ); Wed, 19 Oct 2022 17:55:23 -0400 Received: from mail-oa1-x30.google.com (mail-oa1-x30.google.com [IPv6:2001:4860:4864:20::30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC47116CA66 for ; Wed, 19 Oct 2022 14:55:20 -0700 (PDT) Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-132af5e5543so22327887fac.8 for ; Wed, 19 Oct 2022 14:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Wydu2mgXy/Ti5pZeMNO0oB2V13SqCsRFUj9VGtENhPc=; b=ChDSlokPNsjy2o/57nhAg7mfMjZkGB61uN8KGokp5uFWwk9gAqAvvQdsKuPhhf4Er9 wmKVQHHL8CkIAihTw0hRaEFTwdI+sSmSvrHn8I7fE03IUF48Nd0r5X/3gjaqFYEsNSKg 5Er7iJ8I6HnyOcMvqA10t1iAAiUYMokHH21IE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wydu2mgXy/Ti5pZeMNO0oB2V13SqCsRFUj9VGtENhPc=; b=rJYPR0iwDSbox8fylZTbUxMg/kzAMKlqsBo5CoAjhLaYcECLXQY/VccJTO6q8GHD/+ 0KwDWTMhPGsQ+mWu/yk9Oz1xXfZxcJK5qkCXDzLEebex1N6RXCYkSblw0fIZYaRFqXUk 7oqA561P7Y1Uyhgp0H53cv1D2+HtTiyBl4kEhSSlnIETNewPBKWiwZtk8kFS3I/yoO22 52YgcGB/vBH4wABw6XbPhJ45YYS5g8eu4r0n42ivhzTRyMu/yP/y7hH3N7o5c4H/U/B8 xAKj5rEOeW+SSIhd8oOx3Fy4Xa9zUO87lWZVHPUR5Fu3HjhJAihxgv/VUiNrO79czn3L rlag== X-Gm-Message-State: ACrzQf1GAMicMBptYrN0rAkXUeCn6KmFKBpvDnZK179o/oxl+eX12GDQ B+UPH55Y8YHYDM0j9iW96IZn1nUT+yisYQ== X-Received: by 2002:a17:90a:c782:b0:202:c73e:5488 with SMTP id gn2-20020a17090ac78200b00202c73e5488mr47000873pjb.202.1666216509347; Wed, 19 Oct 2022 14:55:09 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:57b7:1f0e:44d1:f252]) by smtp.gmail.com with UTF8SMTPSA id l10-20020a170903244a00b0017f637b3e87sm11258807pls.279.2022.10.19.14.55.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 14:55:08 -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 4/7] mms: sdhci-esdhc-imx: Fix SDHCI_RESET_ALL for CQHCI Date: Wed, 19 Oct 2022 14:54:37 -0700 Message-Id: <20221019145246.v2.4.I7d01f9ad11bacdc9213dee61b7918982aea39115@changeid> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221019215440.277643-1-briannorris@chromium.org> References: <20221019215440.277643-1-briannorris@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747155182103866098?= X-GMAIL-MSGID: =?utf-8?q?1747155182103866098?= [[ NOTE: this is completely untested by the author, but included solely because, as noted in commit df57d73276b8 ("mmc: sdhci-pci: Fix SDHCI_RESET_ALL for CQHCI for Intel GLK-based controllers"), "other drivers using CQHCI might benefit from a similar change, if they also have CQHCI reset by SDHCI_RESET_ALL." We've now seen the same bug on at least MSM, Arasan, and Intel hardware. ]] SDHCI_RESET_ALL resets will reset the hardware CQE state, but we aren't tracking that properly in software. When out of sync, we may trigger various timeouts. It's not typical to perform resets while CQE is enabled, but this may occur in some suspend or error recovery scenarios. Fixes: bb6e358169bf ("mmc: sdhci-esdhc-imx: add CMDQ support") Signed-off-by: Brian Norris Reviewed-by: Haibo Chen --- Changes in v2: - Drop unnecessary ESDHC_FLAG_CQHCI check drivers/mmc/host/sdhci-esdhc-imx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 55981b0f0b10..c07df7b71b22 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1288,6 +1288,9 @@ static void esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned timing) static void esdhc_reset(struct sdhci_host *host, u8 mask) { + if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL)) + cqhci_deactivate(host->mmc); + sdhci_reset(host, mask); sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); From patchwork Wed Oct 19 21:54:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 5860 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp554740wrs; Wed, 19 Oct 2022 15:03:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5v5QJSRuq6+lDH94Y5J5oEQF3Sgq/7AKyD+CoNFZKtAWKPPRDACZd0pRp2EzyzCeMbb0n+ X-Received: by 2002:a17:902:d4c5:b0:183:6e51:503 with SMTP id o5-20020a170902d4c500b001836e510503mr10540804plg.84.1666217019978; Wed, 19 Oct 2022 15:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666217019; cv=none; d=google.com; s=arc-20160816; b=aBCASnbMPhEDFtmIiDZOHe2SAW1/8DsTh7oLwv3Oqhc4jQjpLwgTLDYhENgDjKb9Om UqUV7E0iHCgMHsDVcOMB2mPe8lAddtjiKJr6B+2yU6BRokYHPA5nauudzJjsgjrhxBvU bZRGeyEGz5Ll8I1k29c903oThvM7CROLtKSFSiJ44SseiPmzjxX/a75klOcEfRh7Y2YZ kUz/WHOyqIQ+X9xwp8bB8hZZtnFKhmOjtTE2PBT0DX4aLUhmlkD0W7HAEMGZ15yja5JA avSMbsWGKoLGjcMis6IcwI/64gextokIaIpXlCSaC0XoeNzuw653w4n0dZFQWdbAZkki wb+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NYKDq3nQvcWGiMSg+hxeuum9J23X3dmFHWVwl7YaDYc=; b=I6RXRaKtmDkw9t72Q905KL7A7xHh9vVenU4sbBlsqwU73u0zPONLU/Gp/cP4cpf13J //a3PPSRAT255kJkrHm+JjIq7m+ewFY4JfEBntvfJGRFRf6oW86KGjK52i+D96WYdMc1 i7mS5EHc9qZaEbJQoKe6KUOAkEtM9hEC2TL3F5K55Q3Nzw+TbE9eEJT7V5InuOLjYDsI XWjb+iS87zbiEKToiiSFnE2FAO5yqCYT7M/cX7Zl8Rfd4Z8/lrOJQJshn4gtc4vTGi6p RBtIa3+MvCFrwBeDolEtB3VxXAXAAmPKES2QBkNkY8ocNUmStghZi/1sJ9LRbvsPeSYZ gktQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CfYbZ+nJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r27-20020a63441b000000b0045497c0ba94si19071594pga.635.2022.10.19.15.02.58; Wed, 19 Oct 2022 15:03:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CfYbZ+nJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231461AbiJSVzc (ORCPT + 99 others); Wed, 19 Oct 2022 17:55:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231394AbiJSVzS (ORCPT ); Wed, 19 Oct 2022 17:55:18 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D837150F8D for ; Wed, 19 Oct 2022 14:55:13 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d24so18523848pls.4 for ; Wed, 19 Oct 2022 14:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NYKDq3nQvcWGiMSg+hxeuum9J23X3dmFHWVwl7YaDYc=; b=CfYbZ+nJXXk7KoFnE1sVg2XDbJnWj3hQVyrHcC6PGar9i+6OAIY/BwhB1o8E++95Wq lxcU180XOgaqUAVgRDa9NNPFTsOvZ+KK189p0I1A1jg1II+X4whI4JV1qME/yqC+qRqb x4ksvICFtNq8gEHVfGwf9KMw/70IcLQL2C1ok= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NYKDq3nQvcWGiMSg+hxeuum9J23X3dmFHWVwl7YaDYc=; b=1CrrvkqRuRCtMR6TE3NensWrHwpF9Zy1256w7yCNzCVZrMIlumkaAbo/um/PfkrMm7 n7u+zhVLALBvqoEl7Cf3Of/tTFm3DMU72XTd5QK/BxdjPT80vf7ccubRj15lbEyyTquG vz2/dxDp6XjZER8lvU+9GIQPA6BIDA5grLdmRGcTnCQTJawj4c8Dp+bjk8+tgQa/bIrc nznHQmc/PfSAcOwmIw8VQrJAihg6P7/K2BWYa7U2wzy6TVkUGuwbZ6y2KT10VKN1Mw40 gnljjiV/pWl5rIR5QNL+5J3hVhbCPyVTwvMe07VuVX2YqbB5iSoOr+xTiWHdRy+SiC9P gcWQ== X-Gm-Message-State: ACrzQf1iasRBHeAmAGrNNAWGvc3M6mvPlm/sH0fBdoKFTngL+JzrTib/ o8w1QfT+tI0Jpr3NUYw+Iht/Cg== X-Received: by 2002:a17:902:82ca:b0:185:75d:ee2c with SMTP id u10-20020a17090282ca00b00185075dee2cmr10547061plz.145.1666216512060; Wed, 19 Oct 2022 14:55:12 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:57b7:1f0e:44d1:f252]) by smtp.gmail.com with UTF8SMTPSA id w14-20020a17090a5e0e00b0020ad53b5883sm422006pjf.14.2022.10.19.14.55.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 14:55:11 -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 5/7] mmc: sdhci-tegra: Fix SDHCI_RESET_ALL for CQHCI Date: Wed, 19 Oct 2022 14:54:38 -0700 Message-Id: <20221019145246.v2.5.I418c9eaaf754880fcd2698113e8c3ef821a944d7@changeid> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221019215440.277643-1-briannorris@chromium.org> References: <20221019215440.277643-1-briannorris@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747155178352052143?= X-GMAIL-MSGID: =?utf-8?q?1747155178352052143?= [[ NOTE: this is completely untested by the author, but included solely because, as noted in commit df57d73276b8 ("mmc: sdhci-pci: Fix SDHCI_RESET_ALL for CQHCI for Intel GLK-based controllers"), "other drivers using CQHCI might benefit from a similar change, if they also have CQHCI reset by SDHCI_RESET_ALL." We've now seen the same bug on at least MSM, Arasan, and Intel hardware. ]] SDHCI_RESET_ALL resets will reset the hardware CQE state, but we aren't tracking that properly in software. When out of sync, we may trigger various timeouts. It's not typical to perform resets while CQE is enabled, but this may occur in some suspend or error recovery scenarios. Fixes: 3c4019f97978 ("mmc: tegra: HW Command Queue Support for Tegra SDMMC") Signed-off-by: Brian Norris --- Changes in v2: - Drop unnecessary 'enable_hwcq' check drivers/mmc/host/sdhci-tegra.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index 413925bce0ca..0a80335a42ec 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -367,6 +367,9 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask) const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data; u32 misc_ctrl, clk_ctrl, pad_ctrl; + if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL)) + cqhci_deactivate(host->mmc); + sdhci_reset(host, mask); if (!(mask & SDHCI_RESET_ALL)) From patchwork Wed Oct 19 21:54:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 5859 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp554738wrs; Wed, 19 Oct 2022 15:03:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7EAw8ekTGGDHzPSxsot/+B9F5usJMb3Am70RNtxxeaGIWxRGaD09gxKLfmgt8XE3f+Fb9H X-Received: by 2002:a17:90b:1b47:b0:20d:cdf2:c02e with SMTP id nv7-20020a17090b1b4700b0020dcdf2c02emr12166472pjb.233.1666217020014; Wed, 19 Oct 2022 15:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666217020; cv=none; d=google.com; s=arc-20160816; b=AJHPQZrBo/XG/lamgspp4ypTmHAndtXQT0dYosFvXPB7bGCqu65XbCNq4/0aV+BeYj 4z0pNnNxsIzEaV7escOAp6KXxuKCOLICPa031r2uSX0rChJOWJ+ppRjtZh8J2UB3RaG+ j6LDnGbMg3mZqAP7Lih5WC8nzo9uAZY5sZ6ruwxHkXip7bRXgxyJMtsNtvZu3J9fLzYA DCcYBYbC2iHhMz2qzFLynC37PJGnVJYcP15q2nrh3unGKQAZun3Ki95vjIf+LdKkTXK6 rc0uhdScEMXU35JlK4ob3m+rTgx76Oa5PiB5fy5RD5bsjsrLb2sm0ZGVQJ+P+aZjDCbY 5p0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mdWjXp1yQqqnWhAF+f3RrVqI4HKKxf+i6fXlj1bwLGc=; b=VTlktAB4aoKW08OlHCam+j5xqWqU7ROoHk18/11PQs30XBFvvR8LXzHNkO96QU/k7e 6smXttSQZfHB3NJJC5NilCt4mRDrdWHn+WY/psh4VRwadeFPK+Uugv0dpJL0g9KdfBfw zgWrYaptGl/OY/J1OF7jWjOj3HmFnuMKarVtAiWSHkT/AJAWI4LvNkNdGgLxtPiGWPSJ S9n22MEoaNmsaQx8qKag3ZNC11jbtrKEjqNDWz6BUEuSZzs5og1oLjeCTww+Ni/DhH/H OE/EBVwfmks9HjA5FIbWZCC6wr++ZEdmrrczeHbkwJd5GLBLtbq5UIbhAC9yhOqilToG /n9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dsorLnZ6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 8-20020a631948000000b00462ed110adbsi21163545pgz.316.2022.10.19.15.03.01; Wed, 19 Oct 2022 15:03:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dsorLnZ6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230506AbiJSVzj (ORCPT + 99 others); Wed, 19 Oct 2022 17:55:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231435AbiJSVzT (ORCPT ); Wed, 19 Oct 2022 17:55:19 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E32E162508 for ; Wed, 19 Oct 2022 14:55:16 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id l6so17476432pgu.7 for ; Wed, 19 Oct 2022 14:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mdWjXp1yQqqnWhAF+f3RrVqI4HKKxf+i6fXlj1bwLGc=; b=dsorLnZ6g7l46LRyLdlp2vDy2D5bxCKpUlzS+ILZbL2KnQEvI9+bHKJsmLlMd5z939 vFlptL1Scv3wg1kkesMKClNuMREJqrHJ2b1uLX9NPxSkw4qQzeJLAYCuENPkiEgsu5qq +DWF967Wz8uWOX1fu5humVdZ0fo80sExLbdRI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mdWjXp1yQqqnWhAF+f3RrVqI4HKKxf+i6fXlj1bwLGc=; b=5n4+EbqzN2tQNNfZEOqmA32XSC0XTs7YuhDQHAo2O3RiPpNVRLb9py4AtJJM0HuzDp tTGWxt7A4rRNee30GLc0oF8ELdHkWpswQCVCHT/z3Olmv0mPiXRceYobfefyunhrxP0w i7PjKynqKZHDhzqqw88IGeFgn5rz2zPM6815LDz64Cr5KXUrnYOzaV8bIz5Yp6Ynh0Ku 4xHI7RiRChN/qLUJ5Rb4ygXI75NwNiE4Shi/T+nBfqT7z7hoUbfGQfSm4pPEKcKeA/Js Nk+BQrjYjcaImoR4rTcqoegJuPqqJgeZ6dGBzFt8dmQ8jR0FCcu96AgjHacbHNQ+eyHZ tTnw== X-Gm-Message-State: ACrzQf3Wu3Z2lTeLo7LMP10VL2Zm1qHI5wYghfVGg8pbwS0RoCZFeA1P Gk8DziavpDDNkyHxoSB4czGJzg== X-Received: by 2002:a05:6a00:408c:b0:565:fc2c:8c71 with SMTP id bw12-20020a056a00408c00b00565fc2c8c71mr10838457pfb.82.1666216514655; Wed, 19 Oct 2022 14:55:14 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:57b7:1f0e:44d1:f252]) by smtp.gmail.com with UTF8SMTPSA id c4-20020a633504000000b0043be67b6304sm10453631pga.0.2022.10.19.14.55.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 14:55:14 -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 6/7] mmc: sdhci_am654: Fix SDHCI_RESET_ALL for CQHCI Date: Wed, 19 Oct 2022 14:54:39 -0700 Message-Id: <20221019145246.v2.6.I35ca9d6220ba48304438b992a76647ca8e5b126f@changeid> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221019215440.277643-1-briannorris@chromium.org> References: <20221019215440.277643-1-briannorris@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747155178251754889?= X-GMAIL-MSGID: =?utf-8?q?1747155178251754889?= [[ NOTE: this is completely untested by the author, but included solely because, as noted in commit df57d73276b8 ("mmc: sdhci-pci: Fix SDHCI_RESET_ALL for CQHCI for Intel GLK-based controllers"), "other drivers using CQHCI might benefit from a similar change, if they also have CQHCI reset by SDHCI_RESET_ALL." We've now seen the same bug on at least MSM, Arasan, and Intel hardware. ]] SDHCI_RESET_ALL resets will reset the hardware CQE state, but we aren't tracking that properly in software. When out of sync, we may trigger various timeouts. It's not typical to perform resets while CQE is enabled, but this may occur in some suspend or error recovery scenarios. Fixes: f545702b74f9 ("mmc: sdhci_am654: Add Support for Command Queuing Engine to J721E") Signed-off-by: Brian Norris --- (no changes since v1) drivers/mmc/host/sdhci_am654.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c index 8f1023480e12..187a21086791 100644 --- a/drivers/mmc/host/sdhci_am654.c +++ b/drivers/mmc/host/sdhci_am654.c @@ -378,6 +378,9 @@ static void sdhci_am654_reset(struct sdhci_host *host, u8 mask) struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host); + if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL)) + cqhci_deactivate(host->mmc); + sdhci_reset(host, mask); if (sdhci_am654->quirks & SDHCI_AM654_QUIRK_FORCE_CDTEST) { From patchwork Wed Oct 19 21:54:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 5858 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp554739wrs; Wed, 19 Oct 2022 15:03:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75CSlL3QTw4gzmDYG8mlsEbuQqtf6rPyVkf/F0qaUm8gfQIRH7UVDg3U0CAAdSM/I+NFri X-Received: by 2002:a17:903:2346:b0:183:3e95:6f5d with SMTP id c6-20020a170903234600b001833e956f5dmr10711612plh.165.1666217020017; Wed, 19 Oct 2022 15:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666217020; cv=none; d=google.com; s=arc-20160816; b=Z1gd+ypo6LsHID47NTDYphCqKanQcAONNE3StIXfFqjKa7apSZbqGvSW9B9DIgNbdb 7u0EBOsVBKhBM+Ws6apSARKgeK05XBjuoWFJh63Y4cngtNLH1AHvPdMgvECbcIAXO/wK TmL+hse3/TRKxgHj5X4IHoBH68Q/IoCltNKvEqUxALDL09OSWUULI6vITH2DaQCnYhYP aWL5CohrYWxv9oMsUvan4nKc7reGcIUmPQdJN8tBUWkHJRrw6KKk9ingLd92XETx9GHc UBJiDLkwQdrNPDyzEljmb53EPss1xT+UAEL2HRc/LEyorAH/h0jpYAkUdqsvGBW6x+F9 5Lig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V8XIt+LggyNBDoRO5DPqQzHUIRS3Q64oYXaRetbeVDU=; b=C24VAwWG5PfMUV48nSfQbaXtzcdBV3135CSWhHaE/5mjwM5DwFmm4uzNI1kegYr5A+ NO5mQ/JVz509XFE/oQ1m5H5jYlbkP1eGw0JJ+1Fklg0U14qdwh4s4x6Gb7sk6cXqT+tv xO8xV89of8LwIaRi9/i7Cv+kGtft3yGEp6af+sZlSzyFfmr62tNFzp7HH6eb7uFi4Uo/ 6hgGhvbEsbivr2SvyGmrpgmt3z/NumZWuplYwAN3eWOmDLrTq8f0dZ0IW+DLF8Gr5mQh OgF2Sg2DzF4HkOyCIloWk85KE9sc2Hbigu6coEANQo/Hnidpa3meiJD16OcDmc2xmJQb KLWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ONOmRF0m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 77-20020a630050000000b00460b572d264si19206185pga.579.2022.10.19.15.03.04; Wed, 19 Oct 2022 15:03:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ONOmRF0m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231558AbiJSVzp (ORCPT + 99 others); Wed, 19 Oct 2022 17:55:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231302AbiJSVzW (ORCPT ); Wed, 19 Oct 2022 17:55:22 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E53D61FFA2 for ; Wed, 19 Oct 2022 14:55:17 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id q10-20020a17090a304a00b0020b1d5f6975so1258200pjl.0 for ; Wed, 19 Oct 2022 14:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V8XIt+LggyNBDoRO5DPqQzHUIRS3Q64oYXaRetbeVDU=; b=ONOmRF0mDJlMUUgoZfpOOcJhHDL43tb1DR59Cn86BKCS9C+k1S/KxZwH6mZiMrJ+kU Ottj80CTOFsteLCq01PVaE/3uKcb90AUR5vyhlIznDrj6/+XeVgkPIWwOQsJiu39aLtQ 4JpFsES+9Qe7QYXOq8gf+kAgwQasVt69wrtgc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V8XIt+LggyNBDoRO5DPqQzHUIRS3Q64oYXaRetbeVDU=; b=c4n+1AqjOoetcJ+kPO1QyTZGm9uwSEDpowLGe/mo+1S+lYoNngQgHjeZkGoWbwO8Q4 74JNQXRwAmMqWf2vmKN0+A1ims88t9V2GeOp58M4tbcLOlhAjrK4nRMqjjjSAnZa7C7q 9HkO80Q5YmSG2ybyqEkTjeBufpF/kGn7DVh/2h1+cDR5GmkfRIHyznIXi41tO6jB5b5E ZRMBXXu7Zd60LgUYe3h1a/LWj15Fj0nfv1ZI6s/7kbLziM8vMNaDP2hHwEoh658B2n7a GTPQ/vPpF+Djpd/t3apLDX2r8RrmT3o9EM/SXl0Mtq7KlLdCqohadQIdWa2Tkzek0N4j djvQ== X-Gm-Message-State: ACrzQf2Zi3nJGNEnogE0tyqbQi6Ex6NJYqYQZxIo8ZlYxEwjp6N9nDCc s3Rv9vyAM5Fy2hz9XaUkwZT9Qw== X-Received: by 2002:a17:90b:4d0d:b0:1fb:a86d:e752 with SMTP id mw13-20020a17090b4d0d00b001fba86de752mr12030955pjb.120.1666216517374; Wed, 19 Oct 2022 14:55:17 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:57b7:1f0e:44d1:f252]) by smtp.gmail.com with UTF8SMTPSA id h12-20020a170902680c00b00178bd916c64sm11161877plk.265.2022.10.19.14.55.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 14:55:16 -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 7/7] mmc: sdhci-pci-*: Drop redundant ->cqe_private check Date: Wed, 19 Oct 2022 14:54:40 -0700 Message-Id: <20221019145246.v2.7.Ia91f031f5f770af7bd2ff3e28b398f277606d970@changeid> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221019215440.277643-1-briannorris@chromium.org> References: <20221019215440.277643-1-briannorris@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747155178234318691?= X-GMAIL-MSGID: =?utf-8?q?1747155178234318691?= An earlier patch ("mmc: cqhci: Handle deactivate() when not yet initialized") makes these redundant. I keep these as a separate patch, since the earlier patch is a prerequisite to some important bugfixes that need to be backported via linux-stable. Signed-off-by: Brian Norris --- Changes in v2: - New in v2 drivers/mmc/host/sdhci-pci-core.c | 3 +-- drivers/mmc/host/sdhci-pci-gli.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index 169b84761041..63d62a9228d7 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -236,8 +236,7 @@ static void sdhci_pci_dumpregs(struct mmc_host *mmc) static void sdhci_cqhci_reset(struct sdhci_host *host, u8 mask) { - if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL) && - host->mmc->cqe_private) + if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL)) cqhci_deactivate(host->mmc); sdhci_reset(host, mask); } diff --git a/drivers/mmc/host/sdhci-pci-gli.c b/drivers/mmc/host/sdhci-pci-gli.c index 4d509f656188..5a13fe961620 100644 --- a/drivers/mmc/host/sdhci-pci-gli.c +++ b/drivers/mmc/host/sdhci-pci-gli.c @@ -924,8 +924,7 @@ static int gl9763e_add_host(struct sdhci_pci_slot *slot) static void sdhci_gl9763e_reset(struct sdhci_host *host, u8 mask) { - if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL) && - host->mmc->cqe_private) + if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL)) cqhci_deactivate(host->mmc); sdhci_reset(host, mask); }