public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
To: Adrian Hunter
	<adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: nsekhar-l0cyMroinI0@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC PATCH 1/7] mmc: sdhci: Add quirk to indicate no CRC stripping in MMC_RSP_136
Date: Thu, 17 Aug 2017 10:50:38 +0530	[thread overview]
Message-ID: <e7592ed0-dda2-6850-098e-7c6bba69df40@ti.com> (raw)
In-Reply-To: <872c7194-3d48-47e5-6396-7189bf841a42-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Hi Adrian,

On Tuesday 15 August 2017 12:57 PM, Adrian Hunter wrote:
> On 07/08/17 19:01, Kishon Vijay Abraham I wrote:
>> TI's implementation of sdhci controller used in DRA7 SoC's doesn't
>> strip CRC in responses with length 136 bits. Add quirk to indicate
>> the controller does not strip CRC in MMC_RSP_136. If this quirk is
>> set sdhci library shouldn't shift the response present in
>> SDHCI_RESPONSE register.
>>
>> Signed-off-by: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
>> ---
>>  drivers/mmc/host/sdhci.c | 27 +++++++++++++++++++--------
>>  drivers/mmc/host/sdhci.h |  2 ++
>>  2 files changed, 21 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index ecd0d4350e8a..ece3751d2a25 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -1182,14 +1182,25 @@ static void sdhci_finish_command(struct sdhci_host *host)
>>  
>>  	if (cmd->flags & MMC_RSP_PRESENT) {
>>  		if (cmd->flags & MMC_RSP_136) {
>> -			/* CRC is stripped so we need to do some shifting. */
>> -			for (i = 0;i < 4;i++) {
>> -				cmd->resp[i] = sdhci_readl(host,
>> -					SDHCI_RESPONSE + (3-i)*4) << 8;
>> -				if (i != 3)
>> -					cmd->resp[i] |=
>> -						sdhci_readb(host,
>> -						SDHCI_RESPONSE + (3-i)*4-1);
>> +			if (!(host->quirks2 & SDHCI_QUIRK2_NO_CRC_STRIPPING)) {
> 
> This is about the 136-bit response so let's put that in the quirk name.  How about SDHCI_QUIRK2_RSP_136_HAS_CRC

Since omap seems to be the only platform that doesn't have CRC, I prefer adding
SDHCI_QUIRK2_RSP_136_NO_CRC. That way we can add the quirk only in sdhci-omap
instead of all the existing sdhci drivers.

> 
>> +				/*
>> +				 * CRC is stripped so we need to do some
>> +				 * shifting.
>> +				 */
>> +				for (i = 0; i < 4; i++) {
>> +					cmd->resp[i] =
>> +						sdhci_readl(host, SDHCI_RESPONSE
>> +							    + (3 - i) * 4) << 8;
>> +					if (i != 3)
>> +						cmd->resp[i] |=
>> +						sdhci_readb(host, SDHCI_RESPONSE
>> +							    + (3 - i) * 4 - 1);
>> +				}
>> +			} else {
>> +				for (i = 0; i < 4; i++)
>> +					cmd->resp[i] =
>> +					sdhci_readl(host, SDHCI_RESPONSE +
>> +						    (3 - i) * 4);
>>  			}
> 
> This is all very jammed up against the 80 column margin.  Please make a new patch to separate it into a new function sdhci_read_rsp_136() and then another patch to add the quirk.
> i.e. completely untested!

Sure. Thanks for the patch.

Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-08-17  5:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07 16:01 [RFC PATCH 0/7] mmc: Add OMAP SDHCI driver Kishon Vijay Abraham I
2017-08-07 16:01 ` [RFC PATCH 1/7] mmc: sdhci: Add quirk to indicate no CRC stripping in MMC_RSP_136 Kishon Vijay Abraham I
2017-08-15  7:27   ` Adrian Hunter
     [not found]     ` <872c7194-3d48-47e5-6396-7189bf841a42-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-17  5:20       ` Kishon Vijay Abraham I [this message]
2017-08-17  6:31         ` Adrian Hunter
2017-08-17  7:40           ` Kishon Vijay Abraham I
2017-08-07 16:01 ` [RFC PATCH 2/7] mmc: sdhci: Add quirk to indicate controller supports ADMA2 Kishon Vijay Abraham I
2017-08-15  7:33   ` Adrian Hunter
     [not found]     ` <dab59f32-5774-8b97-0391-222be30dea16-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-17  5:30       ` Kishon Vijay Abraham I
2017-08-07 16:01 ` [RFC PATCH 3/7] mmc: sdhci: Add callback to set bus mode Kishon Vijay Abraham I
2017-08-15  7:38   ` Adrian Hunter
2017-08-17  5:31     ` Kishon Vijay Abraham I
2017-08-07 16:01 ` [RFC PATCH 4/7] mmc: sdhci: Add quirk to indicate broken POWER_CONTROL Kishon Vijay Abraham I
     [not found]   ` <20170807160142.12134-5-kishon-l0cyMroinI0@public.gmane.org>
2017-08-15  7:41     ` Adrian Hunter
2017-08-17  5:32       ` Kishon Vijay Abraham I
2017-08-07 16:01 ` [RFC PATCH 5/7] dt-bindings: ti-omap-hsmmc: Document new compatible for sdhci omap Kishon Vijay Abraham I
     [not found]   ` <20170807160142.12134-6-kishon-l0cyMroinI0@public.gmane.org>
2017-08-09 22:12     ` Tony Lindgren
     [not found]       ` <20170809221222.GK3934-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-08-17  5:43         ` Kishon Vijay Abraham I
2017-08-17 16:05           ` Tony Lindgren
2017-08-07 16:01 ` [RFC PATCH 6/7] mmc: sdhci-omap: Add OMAP SDHCI driver Kishon Vijay Abraham I
     [not found]   ` <20170807160142.12134-7-kishon-l0cyMroinI0@public.gmane.org>
2017-08-15  8:22     ` Adrian Hunter
2017-08-17  5:57       ` Kishon Vijay Abraham I
2017-08-17  6:43         ` Adrian Hunter
2017-08-17  7:59           ` Kishon Vijay Abraham I
2017-08-17  8:23             ` Adrian Hunter
2017-08-20 11:03               ` Kishon Vijay Abraham I
2017-08-07 16:01 ` [RFC PATCH 7/7] MAINTAINERS: Add TI OMAP SDHCI Maintainer Kishon Vijay Abraham I

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e7592ed0-dda2-6850-098e-7c6bba69df40@ti.com \
    --to=kishon-l0cymroini0@public.gmane.org \
    --cc=adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nsekhar-l0cyMroinI0@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox