Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2091064ybp; Thu, 10 Oct 2019 02:02:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrF/codOWvyJo30gXaImcDlIT/wLbx644hzTjwcLBC78Sx9qB3Zocja0Rmw2ng88dlgQ4+ X-Received: by 2002:a05:6402:6c9:: with SMTP id n9mr6852414edy.190.1570698138671; Thu, 10 Oct 2019 02:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570698138; cv=none; d=google.com; s=arc-20160816; b=ZivmZHpXAmzEJIod7bSOEFYdHcKtsXgGZcybiQBX76ermy4kB1dVMO8HS7geD2kDTd t8Pp50XK+wF2aPj7MyHuwMZCTOvz4gG+aDJvg6piMIJwye+8tU8gYdEB9YyhRKg8cr/B VHYm2hn06igDJLEnh8As8JBSnZzlxFlCTjzUsH2XKRrmED6CokEVAlXp7VPN7szZqFgV oEhMIM20tM8+iPc+UKss99NrEyBkloNzAhCJ9nl9lHHaDcFfSViOHp0F1+YcDnYfIyId UbJhomULXNf1rwye5AcGNQECc7o//+KqQt57TD8sxEVVNTyJiDI/TdO70sQonODOu78C L+1w== 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:dkim-signature; bh=pj2Og9RUvxs7ydx98bzKT4JvY5Ow/cVWBLCOEUlBDSQ=; b=PgaGrtpBWIsGp4XK0tqd5G7/ustJFfpZQ/YT+komQ8hotpVKYIwFJjG4qtkNyO5PIU SI3BqDuhJGguKJ87b12d/g24L/8k4I3819fnFrvJSbMk59S5fZ0qiw/auWV5lqvZ/tTi i887DDOjCOGPZ8cVRsMIHv4pKgE8UmRnBH76LDD8+6HSgVo7xf4ohLN1r5Ej5PFyrb5n ZTuYzt0woqW7IsTsxorA5fjAMrndsOZTmq/VDDY6Tic3TAhJqfEz19YezUbsIvxI93Tm /H8SoMr1UU21nZRfhS/UT9/SgZT00LJS57bAAc3+fNeupY+3YvxZ+k4cryml2DWCckmc 3+qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rKXObDom; 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 v27si2686230ejb.182.2019.10.10.02.01.55; Thu, 10 Oct 2019 02:02:18 -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=@kernel.org header.s=default header.b=rKXObDom; 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 S2388238AbfJJIlC (ORCPT + 99 others); Thu, 10 Oct 2019 04:41:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:45242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388235AbfJJIlA (ORCPT ); Thu, 10 Oct 2019 04:41:00 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B52EF21D6C; Thu, 10 Oct 2019 08:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696860; bh=yCL7vknIl3cVtddlPXzUFN41K9u1QH75+TsucXHQe44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rKXObDomHbv/hqSfksqmeUsSTCN7llShLlpKgb2mgWcZIYHm4tCeyoh90zx1JNDNX GEQhe+rx0lizlyb1fvhJvx1bCR5fJ0p7TDBlfN711A4rMPZKv0MAbbKtxd2ipOAs4S Cr80mUTzoJtVCGfbi+t85RTQXNzE98kHcrWtAGLQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Nicolin Chen , Thierry Reding , Ulf Hansson Subject: [PATCH 5.3 077/148] mmc: sdhci: Let drivers define their DMA mask Date: Thu, 10 Oct 2019 10:35:38 +0200 Message-Id: <20191010083616.016416989@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Adrian Hunter commit 4ee7dde4c777f14cb0f98dd201491bf6cc15899b upstream. Add host operation ->set_dma_mask() so that drivers can define their own DMA masks. Signed-off-by: Adrian Hunter Tested-by: Nicolin Chen Signed-off-by: Thierry Reding Cc: stable@vger.kernel.org # v4.15 + Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci.c | 12 ++++-------- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 5 insertions(+), 8 deletions(-) --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3763,18 +3763,14 @@ int sdhci_setup_host(struct sdhci_host * host->flags &= ~SDHCI_USE_ADMA; } - /* - * It is assumed that a 64-bit capable device has set a 64-bit DMA mask - * and *must* do 64-bit DMA. A driver has the opportunity to change - * that during the first call to ->enable_dma(). Similarly - * SDHCI_QUIRK2_BROKEN_64_BIT_DMA must be left to the drivers to - * implement. - */ if (sdhci_can_64bit_dma(host)) host->flags |= SDHCI_USE_64_BIT_DMA; if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) { - ret = sdhci_set_dma_mask(host); + if (host->ops->set_dma_mask) + ret = host->ops->set_dma_mask(host); + else + ret = sdhci_set_dma_mask(host); if (!ret && host->ops->enable_dma) ret = host->ops->enable_dma(host); --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -622,6 +622,7 @@ struct sdhci_ops { u32 (*irq)(struct sdhci_host *host, u32 intmask); + int (*set_dma_mask)(struct sdhci_host *host); int (*enable_dma)(struct sdhci_host *host); unsigned int (*get_max_clock)(struct sdhci_host *host); unsigned int (*get_min_clock)(struct sdhci_host *host);