Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp664070imm; Wed, 4 Jul 2018 03:57:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeEW/KrmduyLt09L9PLRm3xPTM1DN/hlbGkA4qwJnT5mDgTHVebOEUtzTTi8dnZT05VPBuO X-Received: by 2002:a17:902:1566:: with SMTP id b35-v6mr1632099plh.107.1530701832221; Wed, 04 Jul 2018 03:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530701832; cv=none; d=google.com; s=arc-20160816; b=k4idM5gtFGDFbooug8uOJII66ZUqvkDlbsf6zZY2aw1e5Q3cjhWI2pRPOD2xOkTQU2 3czZz5jzRyJ5q20GADaNlhtwk9eaHTWPz+amJVKfHMErfLNs94pUuaSIv2FqxEZ+yXGP XSEusR3acnuphxRveOFT+q63KwTSmn8sEVOFFeV9nD+iYMnU6aesnmPpSTu4QkgzP2Lg 7bUy406qDQE92L5QqBzg6o9nT72T6RB4TIxa0VbAXRSaMn8kintURAS4HzQ1l8xAH2KG 1AvxTUDIe8n1v5B+vSrsQcbqU1qTKF3fTiIcz5xtR8VmmbPQ5pnDBNkSErQ7vJHrVRST 78Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=idZcDPcHbrIcruHjRrabKpauhW7c6DimOqrdu2e4TBY=; b=Jwz1gMkKZYqqMxx/TAVyjjUTimc6Ffw/Fkr3pThV6lhCe91mkCAmZ2UE8HKXsdM/3H lVClEa+FziQcQ9c8G1MQKqY94hCivtAnZ8LCnzFngMtt0xsesqJ5W0lXzgDn/xlxOchU DvaJ9h8bov6QFEG7T4bRoOm7LPzgjBJgtUahR5vzm6TZQbO3rDuvpBB/ivnEyfANr4Ka YLwiimQyPX2k4yyfXR3z4HDF7dErPgU/8WHCyTLwF7eo9AG7KS1hEPl5vyk5gsi68xSw u4eR/BdZNUz8Rd2tYxrjiYccsweq/JvnnEXYIRmco1WGDgUBWzNpPpyTlSFADdWEVKKz KytQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FxqSoiek; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11-v6si3193523pla.184.2018.07.04.03.56.57; Wed, 04 Jul 2018 03:57:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FxqSoiek; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933071AbeGDKzD (ORCPT + 99 others); Wed, 4 Jul 2018 06:55:03 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:54557 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932548AbeGDKzB (ORCPT ); Wed, 4 Jul 2018 06:55:01 -0400 Received: by mail-it0-f67.google.com with SMTP id s7-v6so7243957itb.4 for ; Wed, 04 Jul 2018 03:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=idZcDPcHbrIcruHjRrabKpauhW7c6DimOqrdu2e4TBY=; b=FxqSoiekacTbzjV2W3i8bDwQylZVAc7qudbHkxakPb3BZCeaLAfB/M1MZHm93LIxOG sfinRSwlfgvN+NmHi+khR2R6bhlkmlX+nHPlkKqY0EUmz/CpSQT6ZRSjm0CMJnGgINAi 0VF6viaTImp9QNkD4mKBRuDBKlHQph6tbOruo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=idZcDPcHbrIcruHjRrabKpauhW7c6DimOqrdu2e4TBY=; b=PmSRJffFp4vFk6IsbjWrK1coqHAXh0mmg7CTnQVuWBroRJ3Frm1R6F4ZsH5zw8E3sl VPL7pyyPNnFu84/YmjRY/yIMkJw/IlzOIW87rCIK/x0bQiIaAW9+oFJFFeIH143M3zsl f+Evv9DEAZz4PuOFXVT2Xo1O2NEuX35/6e50RadLDqm9w0qHjzvTS/IcGolkX2vatsJt GC7qr1Bga9/oUdqCyaURuIzQAVRw57Jo6w06M6kZ24POvYZEy4vgFnCiRhdx3DzrIlyC ciXK2HdJTujPwxlONLYDCDqr4yna2N6n2UOBxIiCdawC2DHicC3mwyofnhxJtm9XTxe5 /dYA== X-Gm-Message-State: APt69E1Qt3w1uGVxD1XLsYLJL73o2egHjRWKGoluIyqusHSR9e+/1Nw1 6yVQU17YF0NLMK/tMwjmuGMN9x56y2rLKk1OJ8Y2OQ== X-Received: by 2002:a24:1c09:: with SMTP id c9-v6mr1416034itc.38.1530701701066; Wed, 04 Jul 2018 03:55:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:818f:0:0:0:0:0 with HTTP; Wed, 4 Jul 2018 03:55:00 -0700 (PDT) In-Reply-To: <61a16c6b-9158-17ea-51f9-2ee5b85ccb78@nxp.com> References: <20180628084509.19646-1-laurentiu.tudor@nxp.com> <61a16c6b-9158-17ea-51f9-2ee5b85ccb78@nxp.com> From: Ulf Hansson Date: Wed, 4 Jul 2018 12:55:00 +0200 Message-ID: Subject: Re: [PATCH] mmc: sdhci-of-esdhc: set proper dma mask for ls104x chips To: Laurentiu Tudor Cc: Adrian Hunter , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , "Y.b. Lu" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3 July 2018 at 13:15, Laurentiu Tudor wrote: > Hi Uffe, > > On 02.07.2018 17:37, Ulf Hansson wrote: >> On 28 June 2018 at 10:45, Laurentiu Tudor wrote: >>> SDHCI controller in ls1043a and ls1046a generate 40-bit wide addresses >>> when doing DMA. Make sure that the corresponding dma mask is correctly >>> configured. >>> >>> Signed-off-by: Laurentiu Tudor >> >> Thanks, applied for next! > > Thanks for picking this up! > I just realized that maybe I should have provided some context around > this patch. I'm working on enabling smmu on these chips and encountered > the following problem: the smmu input address size is 48 bits so the dma > mappings for sdhci end up 48-bit wide. However, on these chips sdhci > only use 40-bits of that address size when doing dma. > So you end up with a 48-bit address translation in smmu but the device > generates transactions with clipped 40-bit addresses, thus smmu context > faults are triggered. Setting up the correct dma mask fixes this situation. That's perfect data for the changelog. Care to send a v2, then I re-place the one I have just applied! Kind regards Uffe > > --- > Best Regards, Laurentiu > >> >>> --- >>> drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c >>> index 4ffa6b173a21..8332f56e6c0d 100644 >>> --- a/drivers/mmc/host/sdhci-of-esdhc.c >>> +++ b/drivers/mmc/host/sdhci-of-esdhc.c >>> @@ -22,6 +22,7 @@ >>> #include >>> #include >>> #include >>> +#include >>> #include >>> #include "sdhci-pltfm.h" >>> #include "sdhci-esdhc.h" >>> @@ -427,6 +428,11 @@ static void esdhc_of_adma_workaround(struct sdhci_host *host, u32 intmask) >>> static int esdhc_of_enable_dma(struct sdhci_host *host) >>> { >>> u32 value; >>> + struct device *dev = mmc_dev(host->mmc); >>> + >>> + if (of_device_is_compatible(dev->of_node, "fsl,ls1043a-esdhc") || >>> + of_device_is_compatible(dev->of_node, "fsl,ls1046a-esdhc")) >>> + dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40)); >>> >>> value = sdhci_readl(host, ESDHC_DMA_SYSCTL); >>> value |= ESDHC_DMA_SNOOP; >>> -- >>> 2.17.1 >>>