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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 46F8EC433F5 for ; Thu, 7 Apr 2022 07:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rS5Ioq7elhZMfprfd5jvYVj77nYnA6nQAkep7rkwTT4=; b=YyCIxEXLFhW4UX Q8+FwIPGyId7Mm6cNVxdGbaikKA6CSJ7UkQRky6YiIAHSmtRqk3hirusiShAH5ZLAM1ztD4+omc8+ 1eR+USMn5DLJBBzLIUYz2vNaLY2T82g24fgIMnzZS02I2MjFdO3HiqjG/F9xojoAYHuGavsp5qWhQ kklC6PTzOYKdwNNCCgQFQsK0rVxx1JTaS6nTGe8uOfm+q+BzF+MTcC1nQl6ZB2US6t05yox+/6f3W N5ye/uOGFXZls0ERLOIyku4QbQnmaSuuL3J+nFbT5O59Mvb1JShqhNNIxto5yf1tvsG3pIYfrtR9g 3Q46MJ2JuAIjv+x+fiWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncMKr-009rGG-Lw; Thu, 07 Apr 2022 07:13:41 +0000 Received: from mga05.intel.com ([192.55.52.43]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncMKl-009rEQ-9N for linux-arm-kernel@lists.infradead.org; Thu, 07 Apr 2022 07:13:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649315615; x=1680851615; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=BkzCxsE5hBRJs6P4NUF4QW7/C/WzYFq9gmdY1yy7Lls=; b=XXiMgoxPMT5meEsfgeHmVGQbKAU3EzKFZ01QMxfa2/Ef3Oodxiom1ixm ACdwWfX0m6lZLbAstKAjxOEN/EDCF6q9DpXc0y9Ql70lnLzXQn/KNib/Z D4UeHowKuA7yqtPrbe4MSS2rlmbQmR7JeYrkkwgqne5hHW1H1OGWCtViJ wOiEzpIJznT7FLOftCurmPSHej/t5Wne/UaKbbkNGUPVSFGGOVM+o2oJi mL0fGVRbXZDihLd7nNYUc89VN10615PvPXgwDdKLW+DJCPcTL4n1yqk7b H3jaFd0i5TfioeBbCRoq/ctvklqIqYeZ+tgPiQEcyKTt9HIPV6rfmZ9rW w==; X-IronPort-AV: E=McAfee;i="6200,9189,10309"; a="347689717" X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="347689717" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 00:13:34 -0700 X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="549897306" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.40.48]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 00:13:26 -0700 Message-ID: <3c8e94e1-fb8e-0d8f-4e79-b8313a1da5cb@intel.com> Date: Thu, 7 Apr 2022 10:13:21 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.7.0 Subject: Re: [PATCH 09/11] mmc: sdhci-cadence: Add Pensando Elba SoC support Content-Language: en-US To: Arnd Bergmann , Brad Larson Cc: Linux ARM , Linus Walleij , Bartosz Golaszewski , Mark Brown , Serge Semin , Ulf Hansson , Olof Johansson , dac2@pensando.io, "open list:GPIO SUBSYSTEM" , linux-spi , linux-mmc , DTML , Linux Kernel Mailing List References: <20220406233648.21644-1-brad@pensando.io> <20220406233648.21644-10-brad@pensando.io> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220407_001335_437662_AAFA4E1D X-CRM114-Status: GOOD ( 21.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 07/04/2022 9.45, Arnd Bergmann wrote: > On Thu, Apr 7, 2022 at 1:36 AM Brad Larson wrote: >> @@ -350,7 +461,7 @@ static void sdhci_cdns_hs400_enhanced_strobe(struct mmc_host *mmc, >> static int sdhci_cdns_probe(struct platform_device *pdev) >> { >> struct sdhci_host *host; >> - const struct sdhci_pltfm_data *data; >> + const struct sdhci_cdns_drv_data *data; >> struct sdhci_pltfm_host *pltfm_host; >> struct sdhci_cdns_priv *priv; >> struct clk *clk; >> @@ -369,10 +480,10 @@ static int sdhci_cdns_probe(struct platform_device *pdev) >> >> data = of_device_get_match_data(dev); >> if (!data) >> - data = &sdhci_cdns_pltfm_data; >> + data = &sdhci_cdns_drv_data; >> >> nr_phy_params = sdhci_cdns_phy_param_count(dev->of_node); >> - host = sdhci_pltfm_init(pdev, data, >> + host = sdhci_pltfm_init(pdev, &data->pltfm_data, >> struct_size(priv, phy_params, nr_phy_params)); >> if (IS_ERR(host)) { >> ret = PTR_ERR(host); >> @@ -389,6 +500,11 @@ static int sdhci_cdns_probe(struct platform_device *pdev) >> host->ioaddr += SDHCI_CDNS_SRS_BASE; >> host->mmc_host_ops.hs400_enhanced_strobe = >> sdhci_cdns_hs400_enhanced_strobe; >> + if (data->init) { >> + ret = data->init(pdev); >> + if (ret) >> + goto free; >> + } >> sdhci_enable_v4_mode(host); >> __sdhci_read_caps(host, &version, NULL, NULL); > > I'm not sure about the abstraction here. The approach of having a single > driver with some platform specific quirks like you do here works fine if the > differences between hardware implementations are fairly minor, but if there > are a larger number of variants, or the differences become too big, the > better approach is to have separate top-level driver instances that call > into a more generic driver, continuing the call chain > > elba_drv_init() > -> sdhci_cdns_probe() > -> sdhci_pltfm_init() > -> sdhci_add_host() > -> mmc_add_host() > > with each one being a more specific version of the one below it. > At the moment, it doesn't quite require having a custom driver, > but I fear that it it would get hard to rework if it continues to grow > other front-ends. It may be better to do the abstraction right away, > even if the elba driver becomes rather trivial. > > Ulf, any preferences? > What is the relationship between cadence and pensando elba? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel