Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1272594rwi; Wed, 26 Oct 2022 13:05:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5VgGgF6xnKsqfyXkpX+Vk2uHxk3V2ml36Qd8MpbqofPNt+23KP4ZWxy1sV+zzqCffdBFCF X-Received: by 2002:a17:907:2bd5:b0:76f:591c:466b with SMTP id gv21-20020a1709072bd500b0076f591c466bmr37146546ejc.504.1666814726399; Wed, 26 Oct 2022 13:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666814726; cv=none; d=google.com; s=arc-20160816; b=qRJt7UUmKulWDcDXlwdZax710JbQljPpCEoX5iKjNGjCqNKvIZyxgCj+3yk9ecGLPa sH6oyb1NxQyLj3DiI2DLnj0uTaeW1fyFgi1/fEKuyJZoZHkRGz3vf3FaxAF56NSfEeLD inMaw1MFDBum1aqtVUZmJzEe1IeTETfMUi2J7/cIoUDQ7xNB6/m66cm/Qz8i18ymnuSW 0r2LykIUa9qtXntYhtsUPH3ncMp+Nq4SG3uRLwmlLyJcxz3NO61qAvSTm3eI9i0tKj1C jH6hyqN+Tsmf17ufkbfWLUAnA1p0LO4RtNxw8GCM5ycn1i6uL/Spj9F+JZwFkObNeNah bmRA== 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=uFvAy1Yx9bF2vsbUT1HqGJtHQU9f7u8fB33iw92Qf8Q=; b=hnnWaw6SmX/Gxm+6TQXJcLcpyeCnwGb9ezkq9TL67CTgTkAXpXPMRvKv3f000edfit 1cf+Z7dlbPth5TUp+tUhnme4UgprV7y5X3V6zH7PgVomqcz9aUfsNk9Q8jjAUFwGQ6d5 6igCQBKXnByO/b/IKGRdvOlB8cMbb66kP9bU5nq09Lmkz0HQk3rVoLysv+ul+LSY7tA2 DCXFVykVlZ2zp05hvaLV1cCDxTVMRs15u+S/9AX55+2jE+2ZafZ7uOySHimjsLiDPfbv Bg/d2qmn0t73CnoBvyRIYkfjPbc4YGNN+/XittH6VVTDfpyMfzxMrVnA5/Np8BsQ34Rs Frxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oKBbVUwj; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020a1709062f0a00b007820f00167fsi5114321eji.260.2022.10.26.13.05.00; Wed, 26 Oct 2022 13:05:26 -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=oKBbVUwj; 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 S234792AbiJZTnr (ORCPT + 99 others); Wed, 26 Oct 2022 15:43:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235034AbiJZTnA (ORCPT ); Wed, 26 Oct 2022 15:43:00 -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 EF207108256 for ; Wed, 26 Oct 2022 12:42:42 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id f23so15202682plr.6 for ; Wed, 26 Oct 2022 12:42:42 -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=uFvAy1Yx9bF2vsbUT1HqGJtHQU9f7u8fB33iw92Qf8Q=; b=oKBbVUwj0ewG2ZP2F3fTEFFC5mwv4W+c9kZCqjl7JXd4iDbGJEY0AoQ8UYLEbFN5Ra 0x7RjJ30MNig+oRb1brPsUeEwBwRiuFhggpgiWrCKI86pV0GVPWln+FXhDLy0iIYorOi D2M5OJERgyDjOH1XHcjM7eR7XT3klUoE64Go4= 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=uFvAy1Yx9bF2vsbUT1HqGJtHQU9f7u8fB33iw92Qf8Q=; b=NIELn19pzNK2aJnXCqTArl60az+mRrne8fRkYjP9lFVdqa1Sw42h6oV5JsbZy2f3dB MyuGYodi33OImsoNFuEiWMgWKeTVnO4U2AHcL/d3sqFPiXL0OEwWO4PceOJ+zE3rJ+6y b9TEdBe+6jOCh47p8yjR7fhFKnwG5JUFOAm2bSp+8xuhaMe/h56a4b0J28RXnzqIvqFg wa76j9NpC1qHRVwdYH4AFsUFCro/vLIV9QOtDFNvZyFu/bQGT3Z/tRlf7WDCV2m4G0JC zLU0AfwoMXdS4yZkS1C/8e4W+XIkVPwdXlkog3maHm6F0tc2OKh0qywsksYJVXu6sb16 5Z3Q== X-Gm-Message-State: ACrzQf009WvLbvGmasRht7j/8gkR1Rhrq74//zKReV6/wPdU5cYajk62 HxRF7jFNiQ5rh0aj758nKFq5Tw== X-Received: by 2002:a17:90b:4a02:b0:213:63e7:d0b1 with SMTP id kk2-20020a17090b4a0200b0021363e7d0b1mr2659334pjb.208.1666813362670; Wed, 26 Oct 2022 12:42:42 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:c9e3:74f3:6b2b:135]) by smtp.gmail.com with UTF8SMTPSA id p5-20020a17090ac00500b0020ae09e9724sm1424933pjt.53.2022.10.26.12.42.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Oct 2022 12:42:42 -0700 (PDT) From: Brian Norris To: Ulf Hansson Cc: Shawn Guo , linux-mmc@vger.kernel.org, Adrian Hunter , Shawn Lin , Michal Simek , Sascha Hauer , Bjorn Andersson , Thierry Reding , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Broadcom internal kernel review list , Jonathan Hunter , Andy Gross , Pengutronix Kernel Team , linux-kernel@vger.kernel.org, Konrad Dybcio , Al Cooper , Fabio Estevam , Florian Fainelli , NXP Linux Team , Haibo Chen , Sowjanya Komatineni , Brian Norris Subject: [PATCH v4 6/7] mmc: sdhci_am654: Fix SDHCI_RESET_ALL for CQHCI Date: Wed, 26 Oct 2022 12:42:08 -0700 Message-Id: <20221026124150.v4.6.I35ca9d6220ba48304438b992a76647ca8e5b126f@changeid> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog In-Reply-To: <20221026194209.3758834-1-briannorris@chromium.org> References: <20221026194209.3758834-1-briannorris@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 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,URIBL_BLOCKED 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 [[ 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. Include this fix by way of the new sdhci_and_cqhci_reset() helper. This patch depends on (and should not compile without) the patch entitled "mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI". Fixes: f545702b74f9 ("mmc: sdhci_am654: Add Support for Command Queuing Engine to J721E") Signed-off-by: Brian Norris --- Changes in v4: - Also fix sdhci_am654_ops, sdhci_j721e_8bit_ops - Add dependency notes - Drop bouncing Faiz Abbas address Changes in v3: - Use new SDHCI+CQHCI helper drivers/mmc/host/sdhci_am654.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c index 8f1023480e12..c2333c7acac9 100644 --- a/drivers/mmc/host/sdhci_am654.c +++ b/drivers/mmc/host/sdhci_am654.c @@ -15,6 +15,7 @@ #include #include "cqhci.h" +#include "sdhci-cqhci.h" #include "sdhci-pltfm.h" /* CTL_CFG Registers */ @@ -378,7 +379,7 @@ 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); - sdhci_reset(host, mask); + sdhci_and_cqhci_reset(host, mask); if (sdhci_am654->quirks & SDHCI_AM654_QUIRK_FORCE_CDTEST) { ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); @@ -464,7 +465,7 @@ static struct sdhci_ops sdhci_am654_ops = { .set_clock = sdhci_am654_set_clock, .write_b = sdhci_am654_write_b, .irq = sdhci_am654_cqhci_irq, - .reset = sdhci_reset, + .reset = sdhci_and_cqhci_reset, }; static const struct sdhci_pltfm_data sdhci_am654_pdata = { @@ -494,7 +495,7 @@ static struct sdhci_ops sdhci_j721e_8bit_ops = { .set_clock = sdhci_am654_set_clock, .write_b = sdhci_am654_write_b, .irq = sdhci_am654_cqhci_irq, - .reset = sdhci_reset, + .reset = sdhci_and_cqhci_reset, }; static const struct sdhci_pltfm_data sdhci_j721e_8bit_pdata = { -- 2.38.0.135.g90850a2211-goog