Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753388AbbHCKXx (ORCPT ); Mon, 3 Aug 2015 06:23:53 -0400 Received: from mail-bn1on0139.outbound.protection.outlook.com ([157.56.110.139]:35011 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751904AbbHCKXj (ORCPT ); Mon, 3 Aug 2015 06:23:39 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; Date: Mon, 3 Aug 2015 18:14:26 +0800 From: Dong Aisheng To: Russell King - ARM Linux CC: Haibo Chen , , , , , , , , , , , , , , , Subject: Re: [PATCH v3 5/6] mmc: sdhci-esdhc-imx: config watermark level and burst length Message-ID: <20150803101423.GA24870@shlinux1.ap.freescale.net> References: <1438160637-28061-1-git-send-email-haibo.chen@freescale.com> <1438160637-28061-6-git-send-email-haibo.chen@freescale.com> <20150731145140.GE27806@shlinux1.ap.freescale.net> <20150731151345.GX7557@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20150731151345.GX7557@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.20 (2009-06-14) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD051;1:C2BliscuLUDfHxSBT85GjbP1JsoizNERsfHH3eQOlvRzf9+WzDMD3tLCvZGo6bn98BnQXKkGdTlrrvv5NA1rDPiq+VBYWoWp8fZOee0AetOytk4geUD9DTZwPNaiq046jGpvp4zLD8jNp2tz6jok7fZapv8sXT1BPiXIDwn+hU/5/fpjbYAMbNnvs1ezgZMBsVYxYKxGbdf5b5E0MUx3eHXT5AlC5oX/j48FVPFibqxpjm+iKc0C3daTQxzWOjrmepoxRyoJbyhpRL6B2tgXj2be9lJTfooM0UZQupqJHhJvyogScNN65ijRJYYaZMPcrNj4hZwynx1X5fsRRmN17A== X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(24454002)(19580395003)(19580405001)(85426001)(83506001)(87936001)(5003600100002)(189998001)(93886004)(6806004)(77156002)(62966003)(47776003)(230783001)(86362001)(97756001)(50466002)(46102003)(33656002)(104016003)(76176999)(54356999)(106466001)(50986999)(105606002)(110136002)(5001960100002)(92566002)(2950100001)(77096005)(4001350100001)(23726002)(46406003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0301MB1307;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1307;2:wOu77XhoGdG+NidspBvEvkofOZ/ZK4xlfUV4Su8VaYLacC0FJH6rlH9LKj7GYd7rVWX7dRUwPGkC2sXlOPnwhNzQipXowvM1FvXlYm9EVJrRqO52iN1Bd2Zd6+8v4HTXHa4PUkJAggvIMwMU3YFZc0LMw2udzJxbaBx/UiPs7NM=;3:l9bZ02lQKYtRPqpuwKcOl+VEQyYxvfHVnclH3HMHlQq2kwNEJt4CDCJxc9dx1k6FVwuiKny5giT8oB7l9pqhXXNx310S3Vpp0HaEggfGg/ahWI8EKalF2hLWhH1o2KIWCN2kTrIS5ADvPLr6Bxap1R3Kq06zsXb2MEDlHlmiqGRk/HvQYXIZRwh5bNCG+Y8o04PmNV4bxoxI2suNQK/4FWnt8AqxWHydcZ/LdFhscSk=;25:drqJ1bOCLz5CWVRC3LG0cl6YF0dht5U8L6d2/NU+3GG7V8xL7xJXLne8xxTK251qHsDDreSyW/VSz8fhb9rB7msetYUoMVz8as0XuAmDSYr0gqUACxQqolHcV8bSQYzQJ4CqWtSw8n8RUOPF+mBbooBtaRSGuPriIX0VfcdHIwsXcaGS6PB1GEKYwAEFyndZFdfm42DXsOEsqjxqthzzSaY/RLjdBbeDrY6x93woPdHY6mb6syOYFfs0yj3qaFRxQjtc5GhlF+nKiR0rbHRBPg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1307; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1307;20:H8ohF7p+src1ckOmfxrqvUgLLdPKFBR/eT9X4Ifb4OIkye2y38pFOO1PunIO/SLxVadm0EqR1I63YpQGZYlq2tHvaF/4lQIDpxWZtkbSqHm/gIkFyRiy3b0ETQyjfxeF+T5LGd4yUSwECCBSyxqETXrnitiBfwRTzr+wRp2J5BvBdrVhXB1zPlHNzNmwMIbiuxq0rT5VVcfu2rUEQ4iYDeyKtHNe8Z6yLBD+apx175tTwtUAXW3LfRKsJBCEjUBKYyUgXM9/iBGDy900ViZjWMR6zLZYN+baNth902jKvPAUnwo3WKKtwdIPWqjJ1Qywnhk4UwA9Wj0Qp3k6yTRDA1giyOkI4MRvhAtGGWyxBW8=;4:3Wh4JtkaVvjEivkS03Wa/ZW7JBD0w10YloDUjbFdxJ3iDbPq0e+Q6EhgneB7qXOSDqymV3+EcIQyi+vNfTIJpEyys2EAHBSU31+SzQJtParzHVmfkoOlaZtjGTn8YgOjbvrRuKRE4MxyUmhQECBjRbCn7xDLOjNFP1SuLnV+gpFOkRRFlb4o/ryrkEKYHBDHdkA0AN1xC7sIae8VoksZ1aUzMkyKUuYX33Dg5K7V+D3In13tlC2paTvdVpADgTPe+Aq57hDHZMTfio+KHl+XApSphsrfoFWvbp33qp9EeZM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:CY1PR0301MB1307;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1307; X-Forefront-PRVS: 0657D528EC X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB1307;23:iyiV4LVgI2lHLKysRkGvH0vl0KkJRaR81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YvK2WdG3FBvd6XJTQ99vPUjjkDisIavN0pU?= =?us-ascii?Q?viCz7LWK7ADH4fLKtXgKvBHi15KtgrxOOs6Iw81JhG6EmA9hOz+R/8SFAHgx?= =?us-ascii?Q?8Jl7ZPvwa86N4ClDwc2tptXqm?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1307;5:S+Oo1NVUh0fKqKVQhmuER/R8kDLjIHE8zWuQVWktSCZxH4g+J06+B3AhPn0RTxwW/TzQTKWLTfF/O8ULK96of4FnXmNvb5ZywpZaLyuzABWGGHuzohv6MmGNHUIEe082ApWdscdcctFuyg92SjxK+A==;24:URP41i3X2qTiaD/rHxYgzX3m91NYDdrxnY3Ebxxqg8w6MSAsOi61iPW170qq2B+aOD/eu361TSVey9CuYQ5nImJCg7y/CzrLOguLXpiZEv4=;20:boDr3R/ZPAbGi/UbWgbBJ7/i2QTrxiGZhiSlizRvX4dBqKrr3xujSAHQD/vsMJoEanu4EzbwRcDH1AAR/ECk0w== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2015 10:23:35.2069 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1307 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5259 Lines: 125 On Fri, Jul 31, 2015 at 04:13:45PM +0100, Russell King - ARM Linux wrote: > On Fri, Jul 31, 2015 at 10:51:41PM +0800, Dong Aisheng wrote: > > On Wed, Jul 29, 2015 at 05:03:56PM +0800, Haibo Chen wrote: > > > i.MX7D support eMMC HS400 mode, this mode can run in 8 bit,200MHZ > > > DDR mode. So the I/O speed improve a lot compare to SD3.0 > > > > > > The default burst length is 8, if we don't change this value, in > > > HS400 mode, when we do eMMC read operation, we can find that the > > > clock signal will stop for a period of time. This means the speed > > > of data moving on AHB bus is slower than I/O speed. So we should > > > improve the speed of data moving on AHB bus. > > > > > > For imx7d usdhc, this patch set the burst length as 16, and set > > > watermark level as 64. The test result is the clock signal has > > > no stop during the eMMC HS400 operation. For other imx usdhc, remain > > > the default value: burst length as 8, watermark level as 16. > > > > > > Signed-off-by: Haibo Chen > > > --- > > > drivers/mmc/host/sdhci-esdhc-imx.c | 11 ++++++++++- > > > 1 file changed, 10 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c > > > index 158f93b..37d0095 100644 > > > --- a/drivers/mmc/host/sdhci-esdhc-imx.c > > > +++ b/drivers/mmc/host/sdhci-esdhc-imx.c > > > @@ -239,6 +239,11 @@ static inline int is_imx6q_usdhc(struct pltfm_imx_data *data) > > > return data->socdata == &usdhc_imx6q_data; > > > } > > > > > > +static inline int is_imx7d_usdhc(struct pltfm_imx_data *data) > > > +{ > > > + return data->socdata == &usdhc_imx7d_data; > > > +} > > > > Can we using flag to check instead of adding more is_imx_usdhc()? > > No, not more flags. Do the job properly and parameterise the differences. > Hi Russell, Thanks for the review. I mean using the exist flag to do like: if (imx_data->socdata->flags & ESDHC_FLAG_SUP_HS400) writel(0x10401040, host->ioaddr + ESDHC_WTMK_LVL); else writel(0x08100810, host->ioaddr + ESDHC_WTMK_LVL); Not adding another new flag. ESDHC_FLAG_SUP_HS400 represents the new feature support of HS400 which is already added in patch [PATCH v3 1/6] mmc: sdhci-esdhc-imx: add imx7d support and support HS400 > > > static inline int esdhc_is_usdhc(struct pltfm_imx_data *data) > > > { > > > return !!(data->socdata->flags & ESDHC_FLAG_USDHC); > > > @@ -1145,7 +1150,11 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) > > > * to something insane. Change it back here. > > > */ > > > if (esdhc_is_usdhc(imx_data)) { > > > - writel(0x08100810, host->ioaddr + ESDHC_WTMK_LVL); > > > + if (is_imx7d_usdhc(imx_data)) > > > + writel(0x10401040, host->ioaddr + ESDHC_WTMK_LVL); > > > + else > > > + writel(0x08100810, host->ioaddr + ESDHC_WTMK_LVL); > > So the value to be written to this register should come from the > driver data, which is already used as a struct esdhc_soc_data to > extrapolate out the differences. > > Going down the flag path will lead you to an even more of a stinking > shitpile than sdhci already is - if another version of the SoC requires > a different value there, what are you going to do? Add yet another > flag for the next value? What are you going to do when you have 16 > different values? Use 16 different flags? Clearly that path is insane. > I understand your concern for the potential bad situation. Here the watermark level setting of mx7d is dependant on the new feature of HS400, so it seems make senese to use that flag to set value and does not need adding new flag. Actually that is the current approach for uSDHC driver to distinguish the difference between register offset/settings by checking feature flags. e.g. ESDHC_FLAG_USDHC, ESDHC_FLAG_STD_TUNING, ESDHC_FLAG_HS200 and etc. This approach can save us a lot more flags for SoC checking for common feature part. And up till now, things seem good. If really new SoC comes while it requires a different value, if it's feature dependant, we may still use feature flag for it. If not, probably a quirk may be needed if it's IP limitation. If it's normal situation and such situation happened too many in the future, we may choose to parameterise all these normal feature independent settings into esdhc_soc_data to avoid adding meaningless flags. e.g. static struct esdhc_soc_data usdhc_imx6sx_data = { .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200, .wml = 32, }; static struct esdhc_soc_data usdhc_imx7d_data = { .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200, .wml = 64, }; But currently i still did not see such urgent requirement to do it for only water mark level settings. Regards Dong Aisheng > -- > FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up > according to speedtest.net. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/