linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG/RFC] SDHCI_QUIRK_NO_MULTIBLOCK for i.MX35/25
@ 2013-11-15  9:15 Steffen Trumtrar
  2013-12-02  8:58 ` Steffen Trumtrar
  2013-12-17 11:43 ` Dong Aisheng
  0 siblings, 2 replies; 5+ messages in thread
From: Steffen Trumtrar @ 2013-11-15  9:15 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball

Hi!


1 Actual Use-Case
=================

  I have a SDIO card with a Marvell 8787, that works fine on an i.MX53
  with the drivers/net/wireless/mwifiex/sdio.c driver. On an i.MX35
  however the loading of the firmware errors out on the very first
  single-block transfer with 1024 bytes payload.


2 Reason for failure
====================

  sdhci defines SDHCI_QUIRK_NO_MULTIBLOCK to completely disable
  multi-block transfers for a host. The max_blk_count is simply set to 1
  to achieve this. Currently only i.MX35 and i.MX25 seem to be the only
  users of that quirk.  The quirk is used to fix an errata on these
  SoCs, that says, that "CMD12 abort operation does not abort data
  transfer on AHB". (ENGcm07207)

  So, this is a problem regarding only SD and not SDIO.  On this special
  SDIO card, it looks like multi-block transfer has to be used for
  anything >16 bytes. Removing the quirk fixes the firmware loading
  error. The device is detected successfully after loading and can
  connect to an AP.


3 Question
==========

  And here comes the question: What would be the correct approach to fix
  that and differentiate those two cases, so that we can use multi-block
  transfers with CMD53 but not with CMD25(?!) ?

  1a. As I see no other users of that quirk, it might be okay to rename
      it, to better reflect the actual problem it fixes (broken CMD12 or
      something).

  1b. When the host knows with what it deals with (SDIO or SD) set the
      max_blk_count according to the quirk. And only in the SD case, that is.

  or

  2. Introduce a max_blk_count_sd and max_blk_count_sdio and use them
     everywhere. Seems rather invasive and over the top.

  or

  3. something better.


Regards,
Steffen

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG/RFC] SDHCI_QUIRK_NO_MULTIBLOCK for i.MX35/25
  2013-11-15  9:15 [BUG/RFC] SDHCI_QUIRK_NO_MULTIBLOCK for i.MX35/25 Steffen Trumtrar
@ 2013-12-02  8:58 ` Steffen Trumtrar
  2013-12-17  9:28   ` Steffen Trumtrar
  2013-12-17 11:43 ` Dong Aisheng
  1 sibling, 1 reply; 5+ messages in thread
From: Steffen Trumtrar @ 2013-12-02  8:58 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball

On Fri, Nov 15, 2013 at 10:15:37AM +0100, Steffen Trumtrar wrote:
> Hi!
> 
> 
> 1 Actual Use-Case
> =================
> 
>   I have a SDIO card with a Marvell 8787, that works fine on an i.MX53
>   with the drivers/net/wireless/mwifiex/sdio.c driver. On an i.MX35
>   however the loading of the firmware errors out on the very first
>   single-block transfer with 1024 bytes payload.
> 
> 
> 2 Reason for failure
> ====================
> 
>   sdhci defines SDHCI_QUIRK_NO_MULTIBLOCK to completely disable
>   multi-block transfers for a host. The max_blk_count is simply set to 1
>   to achieve this. Currently only i.MX35 and i.MX25 seem to be the only
>   users of that quirk.  The quirk is used to fix an errata on these
>   SoCs, that says, that "CMD12 abort operation does not abort data
>   transfer on AHB". (ENGcm07207)
> 
>   So, this is a problem regarding only SD and not SDIO.  On this special
>   SDIO card, it looks like multi-block transfer has to be used for
>   anything >16 bytes. Removing the quirk fixes the firmware loading
>   error. The device is detected successfully after loading and can
>   connect to an AP.
> 
> 
> 3 Question
> ==========
> 
>   And here comes the question: What would be the correct approach to fix
>   that and differentiate those two cases, so that we can use multi-block
>   transfers with CMD53 but not with CMD25(?!) ?
> 
>   1a. As I see no other users of that quirk, it might be okay to rename
>       it, to better reflect the actual problem it fixes (broken CMD12 or
>       something).
> 
>   1b. When the host knows with what it deals with (SDIO or SD) set the
>       max_blk_count according to the quirk. And only in the SD case, that is.
> 
>   or
> 
>   2. Introduce a max_blk_count_sd and max_blk_count_sdio and use them
>      everywhere. Seems rather invasive and over the top.
> 
>   or
> 
>   3. something better.
> 
> 

Ping...

Regards,
Steffen


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG/RFC] SDHCI_QUIRK_NO_MULTIBLOCK for i.MX35/25
  2013-12-02  8:58 ` Steffen Trumtrar
@ 2013-12-17  9:28   ` Steffen Trumtrar
  0 siblings, 0 replies; 5+ messages in thread
From: Steffen Trumtrar @ 2013-12-17  9:28 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball

On Mon, Dec 02, 2013 at 09:58:06AM +0100, Steffen Trumtrar wrote:
> On Fri, Nov 15, 2013 at 10:15:37AM +0100, Steffen Trumtrar wrote:
> > Hi!
> > 
> > 
> > 1 Actual Use-Case
> > =================
> > 
> >   I have a SDIO card with a Marvell 8787, that works fine on an i.MX53
> >   with the drivers/net/wireless/mwifiex/sdio.c driver. On an i.MX35
> >   however the loading of the firmware errors out on the very first
> >   single-block transfer with 1024 bytes payload.
> > 
> > 
> > 2 Reason for failure
> > ====================
> > 
> >   sdhci defines SDHCI_QUIRK_NO_MULTIBLOCK to completely disable
> >   multi-block transfers for a host. The max_blk_count is simply set to 1
> >   to achieve this. Currently only i.MX35 and i.MX25 seem to be the only
> >   users of that quirk.  The quirk is used to fix an errata on these
> >   SoCs, that says, that "CMD12 abort operation does not abort data
> >   transfer on AHB". (ENGcm07207)
> > 
> >   So, this is a problem regarding only SD and not SDIO.  On this special
> >   SDIO card, it looks like multi-block transfer has to be used for
> >   anything >16 bytes. Removing the quirk fixes the firmware loading
> >   error. The device is detected successfully after loading and can
> >   connect to an AP.
> > 
> > 
> > 3 Question
> > ==========
> > 
> >   And here comes the question: What would be the correct approach to fix
> >   that and differentiate those two cases, so that we can use multi-block
> >   transfers with CMD53 but not with CMD25(?!) ?
> > 
> >   1a. As I see no other users of that quirk, it might be okay to rename
> >       it, to better reflect the actual problem it fixes (broken CMD12 or
> >       something).
> > 
> >   1b. When the host knows with what it deals with (SDIO or SD) set the
> >       max_blk_count according to the quirk. And only in the SD case, that is.
> > 
> >   or
> > 
> >   2. Introduce a max_blk_count_sd and max_blk_count_sdio and use them
> >      everywhere. Seems rather invasive and over the top.
> > 
> >   or
> > 
> >   3. something better.
> > 
> > 
> 
> Ping...
> 

Ping ping ...

Regards,
Steffen

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG/RFC] SDHCI_QUIRK_NO_MULTIBLOCK for i.MX35/25
  2013-11-15  9:15 [BUG/RFC] SDHCI_QUIRK_NO_MULTIBLOCK for i.MX35/25 Steffen Trumtrar
  2013-12-02  8:58 ` Steffen Trumtrar
@ 2013-12-17 11:43 ` Dong Aisheng
  2014-01-20 10:33   ` Steffen Trumtrar
  1 sibling, 1 reply; 5+ messages in thread
From: Dong Aisheng @ 2013-12-17 11:43 UTC (permalink / raw)
  To: Steffen Trumtrar; +Cc: linux-mmc@vger.kernel.org, Chris Ball

Hi Steffen,

On Fri, Nov 15, 2013 at 5:15 PM, Steffen Trumtrar
<s.trumtrar@pengutronix.de> wrote:
> Hi!
>
>
> 1 Actual Use-Case
> =================
>
>   I have a SDIO card with a Marvell 8787, that works fine on an i.MX53
>   with the drivers/net/wireless/mwifiex/sdio.c driver. On an i.MX35
>   however the loading of the firmware errors out on the very first
>   single-block transfer with 1024 bytes payload.
>
>
> 2 Reason for failure
> ====================
>
>   sdhci defines SDHCI_QUIRK_NO_MULTIBLOCK to completely disable
>   multi-block transfers for a host. The max_blk_count is simply set to 1
>   to achieve this. Currently only i.MX35 and i.MX25 seem to be the only
>   users of that quirk.  The quirk is used to fix an errata on these
>   SoCs, that says, that "CMD12 abort operation does not abort data
>   transfer on AHB". (ENGcm07207)
>
>   So, this is a problem regarding only SD and not SDIO.  On this special
>   SDIO card, it looks like multi-block transfer has to be used for
>   anything >16 bytes. Removing the quirk fixes the firmware loading
>   error. The device is detected successfully after loading and can
>   connect to an AP.
>
>
> 3 Question
> ==========
>
>   And here comes the question: What would be the correct approach to fix
>   that and differentiate those two cases, so that we can use multi-block
>   transfers with CMD53 but not with CMD25(?!) ?
>
>   1a. As I see no other users of that quirk, it might be okay to rename
>       it, to better reflect the actual problem it fixes (broken CMD12 or
>       something).
>
>   1b. When the host knows with what it deals with (SDIO or SD) set the
>       max_blk_count according to the quirk. And only in the SD case, that is.
>
>   or
>
>   2. Introduce a max_blk_count_sd and max_blk_count_sdio and use them
>      everywhere. Seems rather invasive and over the top.
>
>   or
>
>   3. something better.
>

There's an .init_card callback which is called in mmc_sdio_init_card.
That means we can know current card is SDIO, then you can try to
update the max_blk_count there.

Regards
Dong Aisheng
>
> Regards,
> Steffen
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG/RFC] SDHCI_QUIRK_NO_MULTIBLOCK for i.MX35/25
  2013-12-17 11:43 ` Dong Aisheng
@ 2014-01-20 10:33   ` Steffen Trumtrar
  0 siblings, 0 replies; 5+ messages in thread
From: Steffen Trumtrar @ 2014-01-20 10:33 UTC (permalink / raw)
  To: Dong Aisheng; +Cc: linux-mmc@vger.kernel.org, Chris Ball

Hi Dong,

On Tue, Dec 17, 2013 at 07:43:26PM +0800, Dong Aisheng wrote:
> Hi Steffen,
> 
> On Fri, Nov 15, 2013 at 5:15 PM, Steffen Trumtrar
> <s.trumtrar@pengutronix.de> wrote:
> > Hi!
> >
> >
> > 1 Actual Use-Case
> > =================
> >
> >   I have a SDIO card with a Marvell 8787, that works fine on an i.MX53
> >   with the drivers/net/wireless/mwifiex/sdio.c driver. On an i.MX35
> >   however the loading of the firmware errors out on the very first
> >   single-block transfer with 1024 bytes payload.
> >
> >
> > 2 Reason for failure
> > ====================
> >
> >   sdhci defines SDHCI_QUIRK_NO_MULTIBLOCK to completely disable
> >   multi-block transfers for a host. The max_blk_count is simply set to 1
> >   to achieve this. Currently only i.MX35 and i.MX25 seem to be the only
> >   users of that quirk.  The quirk is used to fix an errata on these
> >   SoCs, that says, that "CMD12 abort operation does not abort data
> >   transfer on AHB". (ENGcm07207)
> >
> >   So, this is a problem regarding only SD and not SDIO.  On this special
> >   SDIO card, it looks like multi-block transfer has to be used for
> >   anything >16 bytes. Removing the quirk fixes the firmware loading
> >   error. The device is detected successfully after loading and can
> >   connect to an AP.
> >
> >
> > 3 Question
> > ==========
> >
> >   And here comes the question: What would be the correct approach to fix
> >   that and differentiate those two cases, so that we can use multi-block
> >   transfers with CMD53 but not with CMD25(?!) ?
> >
> >   1a. As I see no other users of that quirk, it might be okay to rename
> >       it, to better reflect the actual problem it fixes (broken CMD12 or
> >       something).
> >
> >   1b. When the host knows with what it deals with (SDIO or SD) set the
> >       max_blk_count according to the quirk. And only in the SD case, that is.
> >
> >   or
> >
> >   2. Introduce a max_blk_count_sd and max_blk_count_sdio and use them
> >      everywhere. Seems rather invasive and over the top.
> >
> >   or
> >
> >   3. something better.
> >
> 
> There's an .init_card callback which is called in mmc_sdio_init_card.
> That means we can know current card is SDIO, then you can try to
> update the max_blk_count there.
> 

>From what I can see, this seems to be the correct approach.
So, leave the quirk and in the sdio-case write a different max_blk_count ?!

Any objections to that ?

Steffen

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-20 10:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-15  9:15 [BUG/RFC] SDHCI_QUIRK_NO_MULTIBLOCK for i.MX35/25 Steffen Trumtrar
2013-12-02  8:58 ` Steffen Trumtrar
2013-12-17  9:28   ` Steffen Trumtrar
2013-12-17 11:43 ` Dong Aisheng
2014-01-20 10:33   ` Steffen Trumtrar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).