Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2491700imm; Mon, 24 Sep 2018 05:24:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ1ro0uEsUUfiO5EH3uTF4MoSZabujP7TFIYQeQ7GYi8GxxFUFqHAZpFRiQHexZ7IMdQVjf X-Received: by 2002:a62:76d8:: with SMTP id r207-v6mr1927751pfc.216.1537791867255; Mon, 24 Sep 2018 05:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537791867; cv=none; d=google.com; s=arc-20160816; b=Y3CXTFUp8Xw0e0FBT8zn6h+7MF0uN+gtG8Oc3lkw7VuhH9aHG+OD/JA0xDqFlBWSAi UwA7xJxToT9Z0H5kfZnAbFD2ugW8AIzUMiskn8N0q06Ume96T+Hr/GFQw1VN8lwIaufG 9ltb+ECIWVL7KTwmon8Pa136Boo444mksThcxOxmtCWW9YTmDYSD5f8bR7I48lZjrMdW bZL++DwLYOc7XgEUF5C9Wd+qUa8Nyiz8Z13Im4TREyoNXb5LDWOcaZ5nWwnLK7VugVJr gUCwtUIQLU1vOyRowvVALzzBLyMfSOiCfigGg/MTvoQJ+6nUKERtdIZi4I3sGygUGhrY xA9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=u40wNNPq+iYn2ImuDIv0J3CbTqN3SHNHAF6ZXnB93qs=; b=G9gJgvsXefMmI6XzbVoe77ML7b5v07ACY+zRSwIRVc1ssH3QtX65X139PrQJyFRbJ1 snurLOvOJVi2z8ErAh+nlhcB+6yaea3M6GckIQUCHDKyjz7T5jC42gSo98sVMh2XUbxq bmHnLzQOzv+ywYOxCPKpuzwfAqHJM0271mEOdkQWrdBYGHR6bEiIL1npaC4IgtuRFgTZ siKkDQZ2wuVrEQocdSKfJf6RGVyAXAg/ejLf7rl/fxKK6DsfHmBy+/pPpYETlWi7FT/b vWhEnPjPBpmNBSXLD6qCTbzIqqYTdSDDtBDRJjz0YDaAMKnTFnK5D0gtnP7Wn7JQor1f u5pA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z21-v6si28455314pgu.163.2018.09.24.05.24.10; Mon, 24 Sep 2018 05:24:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732385AbeIXSZB (ORCPT + 99 others); Mon, 24 Sep 2018 14:25:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56602 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728622AbeIXSZB (ORCPT ); Mon, 24 Sep 2018 14:25:01 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5C0B8107E; Mon, 24 Sep 2018 12:23:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Laurentiu Tudor , Ulf Hansson , Sasha Levin Subject: [PATCH 4.14 130/173] mmc: sdhci-of-esdhc: set proper dma mask for ls104x chips Date: Mon, 24 Sep 2018 13:52:44 +0200 Message-Id: <20180924113125.364151352@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113114.334025954@linuxfoundation.org> References: <20180924113114.334025954@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Laurentiu Tudor [ Upstream commit 5552d7ad596c3fea953f40fef74170ce0760c04d ] SDHCI controller in ls1043a and ls1046a generate 40-bit wide addresses when doing DMA. Make sure that the corresponding dma mask is correctly configured. Context: when enabling smmu on these chips the following problem is encountered: 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. Signed-off-by: Laurentiu Tudor Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-of-esdhc.c | 6 ++++++ 1 file changed, 6 insertions(+) --- 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(str 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;