From patchwork Mon Dec 5 10:08:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 631494 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE256C63703 for ; Mon, 5 Dec 2022 10:10:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230168AbiLEKKe (ORCPT ); Mon, 5 Dec 2022 05:10:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbiLEKKc (ORCPT ); Mon, 5 Dec 2022 05:10:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02738183B5; Mon, 5 Dec 2022 02:10:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A7865B80E60; Mon, 5 Dec 2022 10:10:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55EF1C433B5; Mon, 5 Dec 2022 10:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670235029; bh=YMlE6nWRDtF//ri9V9yKEVsMMR4A33b7UQugBFmOK7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s8AB7kPviA+CsoLJTDlHHp0Ikx1yznlxLrVS43pQzT6D0sdKkbEiZSEJUKp1LxALF xhXyEboNzeqWBEGRw9vJNejXBVR8/WZdHC33robFiJkSzYiaPTj8SzOMURYnpByu8I SWBJzKWg97UAmcJcIkpgL7IJ3KGxVw6IpAbpW5a3dra0dft/XyFwV8fGfM0LpnAZ5/ gfG80lxdQQGyksTrtMAVZ6qGR5VnFztHvu10tvT/pGaUNfiG+16Nkhc1XxJU8ekw4k 0OIUa/GHTE12Wx95wkPARz7k6WL+ny+ZN01swZZnzc5VBx1misR6YMTe+6MMZPClFi BpPO/wLhiUXvQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1p28Qk-0007c8-AI; Mon, 05 Dec 2022 11:10:34 +0100 From: Johan Hovold To: Bjorn Andersson , Alim Akhtar , Avri Altman Cc: Andy Gross , Konrad Dybcio , Bart Van Assche , Rob Herring , Krzysztof Kozlowski , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 1/2] dt-bindings: ufs: qcom: allow 'dma-coherent' property Date: Mon, 5 Dec 2022 11:08:36 +0100 Message-Id: <20221205100837.29212-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221205100837.29212-1-johan+linaro@kernel.org> References: <20221205100837.29212-1-johan+linaro@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org UFS controllers may be cache coherent and must be marked as such in the devicetree to avoid data corruption. This is specifically needed on recent Qualcomm platforms like SC8280XP. Signed-off-by: Johan Hovold Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/ufs/qcom,ufs.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml b/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml index f2d6298d926c..1f1d286749c0 100644 --- a/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml @@ -44,6 +44,8 @@ properties: minItems: 8 maxItems: 11 + dma-coherent: true + interconnects: minItems: 2 maxItems: 2 From patchwork Mon Dec 5 10:08:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 631268 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FD34C4321E for ; Mon, 5 Dec 2022 10:10:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbiLEKKf (ORCPT ); Mon, 5 Dec 2022 05:10:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbiLEKKc (ORCPT ); Mon, 5 Dec 2022 05:10:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01E60183B4; Mon, 5 Dec 2022 02:10:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9A900B80E5E; Mon, 5 Dec 2022 10:10:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F25AC433D6; Mon, 5 Dec 2022 10:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670235029; bh=IEH5+SklrZeRvcXZ7x5oYjnP26+lXJJ2RNphQwvxjSM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=it3VXqPNUYO6b3CpFHhBT/sPrSRTn45NGpy3vOHKBgv70rhrrMK10Yb/M6oPvTUsV xIZTgKbm4BoDhrygucNiU+qxsJzo34op+S9z0SHdqA15Zy4JQx0zJrK37jcjOWwVbl i2R4p8MtGE7lQD2lQAPsAdx8j1Nc55kfSSzQ3hztdmwfMH+o/hvdh9bM51mwudHxi/ F8XqCAFNW+rJd4Yivw2TPNZbY60iEIg/ZRDbM+QutZcFhczQrn7OSIBroVEfE9kkF3 uO5T6rAzwrY1R6Ysp3uWGPpUUYGuyLgeBsQ32eW5xnlQEhrmxYNOwUK/PV9wSqdCTj eruE5i/wBahBw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1p28Qk-0007cA-DB; Mon, 05 Dec 2022 11:10:34 +0100 From: Johan Hovold To: Bjorn Andersson , Alim Akhtar , Avri Altman Cc: Andy Gross , Konrad Dybcio , Bart Van Assche , Rob Herring , Krzysztof Kozlowski , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 2/2] arm64: dts: qcom: sc8280xp: fix UFS DMA coherency Date: Mon, 5 Dec 2022 11:08:37 +0100 Message-Id: <20221205100837.29212-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221205100837.29212-1-johan+linaro@kernel.org> References: <20221205100837.29212-1-johan+linaro@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The SC8280XP UFS controllers are cache coherent and must be marked as such in the devicetree to avoid potential data corruption. Fixes: 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform") Cc: stable@vger.kernel.org # 6.0 Signed-off-by: Johan Hovold Reviewed-by: Konrad Dybcio Reviewed-by: Manivannan Sadhasivam --- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi index c4947c563099..23d1f51527aa 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi +++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi @@ -1430,6 +1430,7 @@ ufs_mem_hc: ufs@1d84000 { required-opps = <&rpmhpd_opp_nom>; iommus = <&apps_smmu 0xe0 0x0>; + dma-coherent; clocks = <&gcc GCC_UFS_PHY_AXI_CLK>, <&gcc GCC_AGGRE_UFS_PHY_AXI_CLK>, @@ -1491,6 +1492,7 @@ ufs_card_hc: ufs@1da4000 { power-domains = <&gcc UFS_CARD_GDSC>; iommus = <&apps_smmu 0x4a0 0x0>; + dma-coherent; clocks = <&gcc GCC_UFS_CARD_AXI_CLK>, <&gcc GCC_AGGRE_UFS_CARD_AXI_CLK>,