From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90E6DC4CEC4 for ; Mon, 23 Sep 2019 16:00:29 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 603992089F for ; Mon, 23 Sep 2019 16:00:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GxtLgb9B" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 603992089F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5ZHZH3v9udp+XyEOt7mbr6uwqlwWEaA0jYfWl8oYRrA=; b=GxtLgb9B/tdBP8 hWNRGUVe/NTZbx1lrBjhSO+mmJr1ZD+8I7HsBqdx76QKQS0A+E0yxAz4OYOkevnSMIoLEgFu7Ita+ qSHxFeKYlo1MrUN7yDJCZ1kxSDg7l7tD8J2PunuPpkGsnPezeX6bJP236diGW/4hnC2LNYzZUSmEp 65cagRWNcGVWxbzOIJEs2uHwpRfQaxN7V46BWeyzPms9SUH7KLBERCD7YvR1dAepO79rU2ekB0tlw a0GCKRme+epZyGndZoBCyo7058mxA/7cLqg2IAwITyALvstBhWsI2Sbl75EMEFH2vt/AzvNxP0ivP I6HmOL12ISIrmD3WxDKw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCQlC-0004sr-Ix; Mon, 23 Sep 2019 16:00:22 +0000 Received: from mail-ot1-f68.google.com ([209.85.210.68]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCQl8-0004sI-RN for linux-arm-kernel@lists.infradead.org; Mon, 23 Sep 2019 16:00:20 +0000 Received: by mail-ot1-f68.google.com with SMTP id o44so4113407ota.10 for ; Mon, 23 Sep 2019 09:00:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fMf30JzA7hKObE9R0byNtMQ8HAHmHVRxMKBzO0OruG4=; b=Tz/KrY+zRsj6jRuTGvN0uAC+2rLBpfq/40Ui1fe4H2/8i2AOIoPEFjcbL8Mtdrokzc dV3ZZMJ1TCsECiCNiP2ybI0MZG7uNBSPaQ0+7MtTL3/juIEeFrYyhvAqcN9zvNHPpbP8 7aO+8K4Ql5hAcbTZQOh/sNf6QIqjUE9YqEO9k715sSguZ8gDgokVbqzRxJ5CmRe89cWE CI/NbVgdTMDGaUOdeKYiwWDasUAmsfldAriOGNSuq8XQmfO2htRg7Zt+BK8EGjjftGsU 2t3Kxq7ir5EtAaIajBgWoQsz80DKE8/puNmWRlgCsU1AWoCdr8e3AvwXmWSBIjpqaEzm F5Iw== X-Gm-Message-State: APjAAAXdOtPSAW96MZ+jW9JsFJB3g68v9RCIOdXMGHcN0Ny/WDh7BwLG 1PW/CwcyjCnuoxR4vSr+rbBb4d/+iaI= X-Google-Smtp-Source: APXvYqwgUT6wqoG5V8fmHRScHIUJh0ifwci6NeHpTkZ37Dho1yZBOEtKrw4Gs6Cv8QjrDOlQ7yYc+w== X-Received: by 2002:a05:6830:20c6:: with SMTP id z6mr462382otq.191.1569254417040; Mon, 23 Sep 2019 09:00:17 -0700 (PDT) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com. [209.85.210.49]) by smtp.gmail.com with ESMTPSA id z14sm1240457oic.13.2019.09.23.09.00.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Sep 2019 09:00:16 -0700 (PDT) Received: by mail-ot1-f49.google.com with SMTP id g25so12616345otl.0 for ; Mon, 23 Sep 2019 09:00:15 -0700 (PDT) X-Received: by 2002:a05:6830:454:: with SMTP id d20mr471097otc.63.1569254415765; Mon, 23 Sep 2019 09:00:15 -0700 (PDT) MIME-Version: 1.0 References: <20190922102341.GO25745@shell.armlinux.org.uk> In-Reply-To: From: Li Yang Date: Mon, 23 Sep 2019 11:00:07 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/3] arm64: dts: mark lx2160a esdhc controllers dma coherent To: Russell King X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190923_090018_889246_06364533 X-CRM114-Status: GOOD ( 19.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , dann frazier , Will Deacon , Nicolin Chen , Rob Herring , "Y.b. Lu" , Shawn Guo , Robin Murphy , Christoph Hellwig , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Sep 22, 2019 at 2:26 PM Russell King wrote: > > The LX2160A esdhc controllers are setup by the driver to be DMA > coherent, but without marking them as such in DT, Linux thinks they > are not. This can lead to random sporadic DMA errors, even to the > extent of preventing boot, such as: > > mmc0: ADMA error > mmc0: sdhci: ============ SDHCI REGISTER DUMP =========== > mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00002202 > mmc0: sdhci: Blk size: 0x00000008 | Blk cnt: 0x00000001 > mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013 > mmc0: sdhci: Present: 0x01f50008 | Host ctl: 0x00000038 > mmc0: sdhci: Power: 0x00000003 | Blk gap: 0x00000000 > mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x000040d8 > mmc0: sdhci: Timeout: 0x00000003 | Int stat: 0x00000001 > mmc0: sdhci: Int enab: 0x037f108f | Sig enab: 0x037f108b > mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00002202 > mmc0: sdhci: Caps: 0x35fa0000 | Caps_1: 0x0000af00 > mmc0: sdhci: Cmd: 0x0000333a | Max curr: 0x00000000 > mmc0: sdhci: Resp[0]: 0x00000920 | Resp[1]: 0x001d8a33 > mmc0: sdhci: Resp[2]: 0x325b5900 | Resp[3]: 0x3f400e00 > mmc0: sdhci: Host ctl2: 0x00000000 > mmc0: sdhci: ADMA Err: 0x00000009 | ADMA Ptr: 0x000000236d43820c > mmc0: sdhci: ============================================ > mmc0: error -5 whilst initialising SD card > > These are caused by the device's descriptor fetch hitting speculatively > loaded CPU cache lines that the CPU does not see through the normal, > non-cacheable DMA coherent mapping that it uses for non-coherent > devices. > > DT and the device must agree wrt whether the device is DMA coherent or > not. > > Signed-off-by: Russell King Acked-by: Li Yang > --- > arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi > index 36b153e3da47..508af23edef0 100644 > --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi > +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi > @@ -593,6 +593,7 @@ > reg = <0x0 0x2140000 0x0 0x10000>; > interrupts = <0 28 0x4>; /* Level high type */ > clocks = <&clockgen 4 1>; > + dma-coherent; > voltage-ranges = <1800 1800 3300 3300>; > sdhci,auto-cmd12; > little-endian; > @@ -605,6 +606,7 @@ > reg = <0x0 0x2150000 0x0 0x10000>; > interrupts = <0 63 0x4>; /* Level high type */ > clocks = <&clockgen 4 1>; > + dma-coherent; > voltage-ranges = <1800 1800 3300 3300>; > sdhci,auto-cmd12; > broken-cd; > -- > 2.7.4 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel