Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2227207imm; Thu, 7 Jun 2018 07:22:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIwRVEUAat8g+LpSuwcghRU3SUHUYO6yAc7JzEXIV/qFZ4HzFiklduepaT3oUD3pzERFAuB X-Received: by 2002:a62:8d5:: with SMTP id 82-v6mr2027365pfi.154.1528381329664; Thu, 07 Jun 2018 07:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528381329; cv=none; d=google.com; s=arc-20160816; b=qZdTrbozU3zMsjSp3tpgjwvuvt+CIppgCAdIGJXT5O2aHHRbNuux4y3HNCWUfDdIxx pFTWF/tdDhmuppKSRYyreC6oIq0M3L3y54xGov3mrLD/vOTwq7FohC3r+dYy9CMA0jOc MRUc2WAuCZ4OovPAhD3/uTiY2EGC5g2YaueTV1KFhh5SfYPMAoqriKP3za6hZkwZ2G61 gbm9zTiS7G/ZcX+9C2ZpXWIkl0KgIhOIqZ6nPRZhCgrQibkz+IKI2kC1jt2IlsXkryFj 8lmxJcamOKOKvyOL6Y7xzO1tRY53xuwFKn/+OsViObvNa2hB8frmmyn2Qx/j/CTn1Uf1 bkRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=05UBReKRl2A3Wb5qnCTZULl7Tc8ToMEWrqDscJxgi+U=; b=LBLcqXoF1054OFU9fvinze6nwi7kIVYbkdd/xQ9toNvQzb3WAfONNJ43CHcmBoPky0 ngz/eCBTbCWesmAwkLYAxJLFaVXPgmruhDQO10n7c2AnGcDZ+HFe4Ur/Ehfwyj2wkEW6 iU9m4p2/+fHC8zSu0eBwAsJHmvm4+yhRBgHwCgch/rNs6kdHpi+j+tJUUKHuOKJxqveS cb/ra5bwvmOLmetXXJ5uPN6kpQzywPeJsWmIzt+T9+cEcEq0RygT9u8zlLFX+MYjw6m0 HwCNb9Ijhjn5LfJk2nHKyTn+TJCu5M5n9JCYweQms5lhyByzOUDPZsoILG0IhGKHV48s t+2w== 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 r67-v6si13706963pfr.134.2018.06.07.07.21.54; Thu, 07 Jun 2018 07:22:09 -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 S933477AbeFGOT0 (ORCPT + 99 others); Thu, 7 Jun 2018 10:19:26 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:39516 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933091AbeFGOJN (ORCPT ); Thu, 7 Jun 2018 10:09:13 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbD-0005Zi-BG; Thu, 07 Jun 2018 15:09:11 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvbA-00039b-Bj; Thu, 07 Jun 2018 15:09:08 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Ulf Hansson" , "Adrian Hunter" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 299/410] mmc: sdhci: Allow override of mmc host operations In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Adrian Hunter commit bf60e592a1af4d6f65dd54593250183f14360eed upstream. In the past, fixes for specific hardware devices were implemented in sdhci using quirks. That approach is no longer accepted because the growing number of quirks was starting to make the code difficult to understand and maintain. One alternative to quirks, is to allow drivers to override the default mmc host operations. This patch makes it easy to do that, and it is needed for a subsequent bug fix, for which separate patches are provided. Signed-off-by: Adrian Hunter Signed-off-by: Ulf Hansson [bwh: Backported to 3.16: adjust filename, context] Signed-off-by: Ben Hutchings --- drivers/mmc/host/sdhci.c | 3 ++- include/linux/mmc/sdhci.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2781,6 +2781,8 @@ struct sdhci_host *sdhci_alloc_host(stru host = mmc_priv(mmc); host->mmc = mmc; + host->mmc_host_ops = sdhci_ops; + mmc->ops = &host->mmc_host_ops; return host; } @@ -2939,7 +2941,6 @@ int sdhci_add_host(struct sdhci_host *ho /* * Set host parameters. */ - mmc->ops = &sdhci_ops; mmc->f_max = host->max_clk; if (host->ops->get_min_clock) mmc->f_min = host->ops->get_min_clock(host); --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -109,6 +109,7 @@ struct sdhci_host { /* Internal data */ struct mmc_host *mmc; /* MMC structure */ + struct mmc_host_ops mmc_host_ops; /* MMC host ops */ u64 dma_mask; /* custom DMA mask */ #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)