From patchwork Mon Oct 24 17:54:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 13017915 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 C6186ECAAA1 for ; Mon, 24 Oct 2022 17:57:46 +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=W2xXe9J6Zq3xyF5h2kFSD5u+/gXNSEAhM6soRcYxfHk=; b=2rVSJ4eeX3h46P fQpDoKVat9BX75cShpkW9TBITzQoGJBAkZa9cfu0djSimino+Ihll7DMpPhZS+EmazRJwYlJuQTZC T4Mc+47cMUghCpn4T4PpM4EqFLyinwuLa5nInnUXprrtDJF6M1LHckPO/8GSwLp9AY570UoUzboWa MbP44lrVRFLK6gxpC3cfxSvBNxLxwGPW+3eXmeEbpGzoiUwiNcViV/QedAHeQiS1p7f16nOBSAlHW tq8uAcuAJK+QGJFdQLnFrG/ZsPPOcqlrT4V7qY0dO4e3ulX/62KzctsJv4Kems2VGugI1x+piMDyh 7+sO9KmasYVF0zroyM8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1on1gM-002YH0-Te; Mon, 24 Oct 2022 17:56:15 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1on1gJ-002YGP-KL for linux-arm-kernel@lists.infradead.org; Mon, 24 Oct 2022 17:56:13 +0000 Received: by mail-pl1-x630.google.com with SMTP id io19so4141999plb.8 for ; Mon, 24 Oct 2022 10:56:10 -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=I4wUfJCplte1+G0mWPV9aexgL/jA5N4Dat7pKZr+Tgc=; b=EXsYa0C60uNhGdEspNoh3iWFaw7LXl1Qtz/v/6RA3nAXmgVTB45Y0Cs+4b/mZHdegE dyRJc/5yn06OQe3TCE8a5/DHQvB2BGRErC6Gf2fMarXGfx6Gq1rWeAymo685l+trGjT1 JHZZosjGut02uUo1aIgDPN3HbNldejPRGdGO8= 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=I4wUfJCplte1+G0mWPV9aexgL/jA5N4Dat7pKZr+Tgc=; b=UyzI/hOg/mEXpwAHCZr1JLmGuGWPXmDXE7Q93JEv4utszLKwvc8sjatIBLmDqOonnh M1gw1wqI+nyZOUQrTHqwoSERjRrSfnhuor6cog9KKYl5s4qGgqY1rbNw6PMcYlJkFmrO nG1pfRKUwJSs4tI422Kx7tSZfgXq0mlmkpcy/n/Pt/ckNAwoZZZGv9aTL+bfjxrLE3Ao BBpnABpeOjzYzS2cvQJfAPdFof3U2oNm2awcAPlOecWDLGehUqc2NSJzzIDDxosIFzDP 82xCRvIdfH356lxJ8MYIlLEEk61M9enBECxIS7umc/P8Q9kp/knbCmTRW1u4jqsebLh5 nO2w== X-Gm-Message-State: ACrzQf2Twrv9glGZxBiSAGmV5m9552Estwldl2ejyfvfqiBTh4eeHAyh ZaSfPgyLDEmOJvEw4MFF6FoM1A== X-Google-Smtp-Source: AMsMyM7ROYfV1N2CFGcOsy94fO7hR1Gm02MWsKlw8jSqt/5VNmn1MzJI6nKhj5d01/InBR08iMMFnw== X-Received: by 2002:a17:902:f687:b0:185:4163:3368 with SMTP id l7-20020a170902f68700b0018541633368mr35234456plg.25.1666634169850; Mon, 24 Oct 2022 10:56:09 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:808b:e2f6:edcf:ccb0]) by smtp.gmail.com with UTF8SMTPSA id l20-20020a656814000000b0043be67b6304sm54917pgt.0.2022.10.24.10.56.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Oct 2022 10:56:09 -0700 (PDT) From: Brian Norris To: Ulf Hansson Cc: Shawn Lin , linux-mmc@vger.kernel.org, Al Cooper , Bjorn Andersson , Sowjanya Komatineni , Broadcom internal kernel review list , Sascha Hauer , Konrad Dybcio , Florian Fainelli , NXP Linux Team , Thierry Reding , Fabio Estevam , Michal Simek , linux-kernel@vger.kernel.org, Shawn Guo , Adrian Hunter , Pengutronix Kernel Team , linux-arm-msm@vger.kernel.org, Haibo Chen , Andy Gross , linux-arm-kernel@lists.infradead.org, Faiz Abbas , Jonathan Hunter , Brian Norris Subject: [PATCH v3 0/7] mmc: sdhci controllers: Fix SDHCI_RESET_ALL for CQHCI Date: Mon, 24 Oct 2022 10:54:54 -0700 Message-Id: <20221024175501.2265400-1-briannorris@chromium.org> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221024_105611_701808_1ADB197B X-CRM114-Status: GOOD ( 17.01 ) 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 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. So the fix is now factored into a separate sdhci_and_cqhci_reset() helper, and it's likely that most/all drivers that support a combo SDHCI/CQHCI controller will want to use it. Thus, I include additional patches (compile-tested only) that apply this helper/fix 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 v3: - Refactor to a "SDHCI and CQHCI" helper -- sdhci_and_cqhci_reset() Changes in v2: - Rely on cqhci_deactivate() to safely handle (ignore) not-yet-initialized CQE support Brian Norris (7): mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI 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-*: Convert drivers to new sdhci_and_cqhci_reset() drivers/mmc/host/sdhci-brcmstb.c | 3 ++- drivers/mmc/host/sdhci-cqhci.h | 25 +++++++++++++++++++++++++ drivers/mmc/host/sdhci-esdhc-imx.c | 3 ++- drivers/mmc/host/sdhci-msm.c | 10 ++-------- drivers/mmc/host/sdhci-of-arasan.c | 3 ++- drivers/mmc/host/sdhci-pci-core.c | 11 ++--------- drivers/mmc/host/sdhci-pci-gli.c | 11 ++--------- drivers/mmc/host/sdhci-tegra.c | 3 ++- drivers/mmc/host/sdhci_am654.c | 3 ++- 9 files changed, 41 insertions(+), 31 deletions(-) create mode 100644 drivers/mmc/host/sdhci-cqhci.h