Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp493157imp; Thu, 21 Feb 2019 05:40:35 -0800 (PST) X-Google-Smtp-Source: AHgI3IZFC47bq/5Cbw1+I+1OGdS8krdUiBvLuwiSQQlaCxTCWDqC2BuTpUMTd67abn/NpidMZLTG X-Received: by 2002:a17:902:264:: with SMTP id 91mr43111053plc.108.1550756435725; Thu, 21 Feb 2019 05:40:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550756435; cv=none; d=google.com; s=arc-20160816; b=t6kx83EIyP7RzuvnOaRFvijdfAY48OoRYvDDYWnd1gvgiDPU+cU5Ib+02h19U+0LEv aq9ntHvupMhLwhLdHSCJT8aR5Wy8czWfO3wO4n4F6NhqbbygpMiUdd2kk48FfUBBSYrc c9oLil44LskLYP6mJMapk3sjHguOkrr7DBExufkaNfA4C4qT54OyFA1BRAIlWFXu3tWn C4x3Z5tajxpduTNTDVE0EB7BE9UYkQHoa/w/oa4nYDCN32AnvbS1YfPlJKb7moSy6tk0 x+6eVI1acv6ajR21u1tqconWvBJVPcUA52rso8+Tm5lebxrULnHSd4uR2r5gN7XHasYV c2CQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=dDmzhkQh/PJEehkORJKKknNdwn6kppVr3EqZuCLGFoY=; b=q00wR3M8GC8O5p2+ujpFP0LzSzejURQUeMo33NxFqRrcBrsVngo8Y5bEBWJGTKOnOo tXq8bNChb/UnPkVu3bjMWFRhduDlJKb/Kt5tZs8qibsVetmBJa2DiLbtBghVMUQUQi+O pPN5AAI7KsTRly3+k2B977BNq8FXX5/9IhtWCEXRA+JIjE3rQNG0YwTOwQdAr5ZOAtXh uqrR3aL7jfHqka3LevA1rewD900Zlk010tXh1DCSvIUFRODSDILdlVT7EEqgLJAD1OoO hrLMhYykU1E5K5VpLFRRBpqnJyncqPg0OgHfDtxWttGDokTZnCC77X8ZgUyQpt3zkoFd pcwQ== 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 bg8si2508743plb.109.2019.02.21.05.40.20; Thu, 21 Feb 2019 05:40:35 -0800 (PST) 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 S1728030AbfBUNi6 (ORCPT + 99 others); Thu, 21 Feb 2019 08:38:58 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:30535 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725385AbfBUNi6 (ORCPT ); Thu, 21 Feb 2019 08:38:58 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1LDasPF017996; Thu, 21 Feb 2019 14:38:39 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2qsbm9cqy5-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 21 Feb 2019 14:38:39 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6689A3D; Thu, 21 Feb 2019 13:38:38 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node1.st.com [10.75.127.16]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 23CAC4DEA; Thu, 21 Feb 2019 13:38:38 +0000 (GMT) Received: from [10.48.0.237] (10.75.127.47) by SFHDAG6NODE1.st.com (10.75.127.16) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 21 Feb 2019 14:38:37 +0100 Subject: Re: [PATCH 0/2] mmc: mmci: add quirk property to add stm32 transfer mode To: Russell King - ARM Linux admin CC: , Ulf Hansson , Alexandre Torgue , , , Rob Herring , , Maxime Coquelin , , References: <1550743851-13588-1-git-send-email-ludovic.Barre@st.com> <20190221102739.cc37au6elqu6gvfe@shell.armlinux.org.uk> <20190221103049.tspc5igoe6wmt3jd@shell.armlinux.org.uk> From: Ludovic BARRE Message-ID: Date: Thu, 21 Feb 2019 14:38:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190221103049.tspc5igoe6wmt3jd@shell.armlinux.org.uk> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG5NODE1.st.com (10.75.127.13) To SFHDAG6NODE1.st.com (10.75.127.16) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-21_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi Russell & Ulf On 2/21/19 11:30 AM, Russell King - ARM Linux admin wrote: > On Thu, Feb 21, 2019 at 10:27:39AM +0000, Russell King - ARM Linux admin wrote: >> On Thu, Feb 21, 2019 at 11:10:49AM +0100, Ludovic Barre wrote: >>> From: Ludovic Barre >>> >>> This patch series introduces a bitmap of hardware quirks that require >>> some special action. This should reduce the number of boolean >>> into variant structure. >>> And adds quirk bit to define sdmmc specific transfer modes. >> >> Please find some other way to deal with these differences. As far as >> I'm concerned, introducing a quirk bitmask such as what was done in >> sdhci is a complete disaster and leads to long-term maintanability >> problems. >> >> We already have a way to deal with variants in mmci. > > ... to finish what I was saying ... > > and I think that: > > if (variant->blksz_datactrl16) > datactrl = variant->datactrl_dpsm_enable | (data->blksz << 16); > else if (variant->blksz_datactrl4) > datactrl = variant->datactrl_dpsm_enable | (data->blksz << 4); > else > datactrl = variant->datactrl_dpsm_enable | blksz_bits << 4; > > ought to become a variant function call which returns the appropriate > datactrl value. This would shrink the amount of variant testing in this > path, and also means that going forward we aren't facing an endlessly > increasing number of tests here. For blksz_datactrl case: We could create an inline function for datactrl16 and blksz_datactrl4 which returns the appropriate datactrl value (specific for ux500v2 and qcom). This function could be register in mmci_host_ops structure. in mmci_start_data function we could call a common function which call a hook if defined. int mmci_dblksz(struct mmci_host *host) { if (host->ops && host->ops->dblksz) return host->ops->dblk(host); /* default data block size definition */ blksz_bits = ffs(data->blksz) - 1; return blksz_bits << 4; } what do you think about it? After, I'm afraid to multiply callback function in mmci_host_ops. For stm32 transfer mode: ditto, a callback function or I keep a boolean? BR Ludo > >> >>> >>> Ludovic Barre (2): >>> mmc: mmci: introduce a quirks property into variant struct >>> mmc: mmci: add quirk property to add stm32 transfer mode >>> >>> drivers/mmc/host/mmci.c | 11 +++++++++++ >>> drivers/mmc/host/mmci.h | 9 +++++++++ >>> 2 files changed, 20 insertions(+) >>> >>> -- >>> 2.7.4 >>> >>> >>> _______________________________________________ >>> linux-arm-kernel mailing list >>> linux-arm-kernel@lists.infradead.org >>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >>> >> >> -- >> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ >> FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up >> According to speedtest.net: 11.9Mbps down 500kbps up >> >> _______________________________________________ >> linux-arm-kernel mailing list >> linux-arm-kernel@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >> >