Running out of SDHCI quirk space (Re: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver)

2010-08-12 Thread Matt Fleming
On Tue, Aug 03, 2010 at 04:43:46PM -0700, Andrew Morton wrote:
 On Tue, 3 Aug 2010 11:11:10 +0800
 Roy Zang tie-fei.z...@freescale.com wrote:
 
  --- a/drivers/mmc/host/sdhci.h
  +++ b/drivers/mmc/host/sdhci.h
  @@ -240,6 +240,8 @@ struct sdhci_host {
   #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN  (125)
   /* Controller cannot support End Attribute in NOP ADMA descriptor */
   #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC  (126)
  +/* Controller uses Auto CMD12 command to stop the transfer */
  +#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (127)
 
 This becomes 129 in my tree.
 
 We're about to run out.  What happens then?

I've been wondering for a while now if many of the quirks should be
hidden behind function pointers. While we could of course extend the
quirk space, I think that's kinda missing the point that quirks are
being used too liberally. Take SDHCI_QUIRK_SINGLE_POWER_WRITE in
drivers/mmc/host/sdhci.c:sdhci_set_power(). Really, that quirk should
probably be hidden inside a set_power() function in the sdhci_ops
structure.

I'm gonna have a go at trying to remove some of the quirks that don't
make sense being quirks. I'll post the series when I'm done.

Does anyone think that this approach is crazy?
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-10 Thread Zang Roy-R61911
 

 -Original Message-
 From: glik...@secretlab.ca [mailto:glik...@secretlab.ca] On 
 Behalf Of Grant Likely
 Sent: Thursday, August 05, 2010 9:03 AM
 To: Zang Roy-R61911
 Cc: linux-...@vger.kernel.org; linuxppc-...@ozlabs.org; 
 a...@linux-foundation.org
 Subject: Re: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for 
 eSDHC driver
 
 On Mon, Aug 2, 2010 at 9:11 PM, Roy Zang 
 tie-fei.z...@freescale.com wrote:
  From: Jerry Huang chang-ming.hu...@freescale.com
 
  Add auto CMD12 command support for eSDHC driver.
  This is needed by P4080 and P1022 for block read/write.
  Manual asynchronous CMD12 abort operation causes protocol 
 violations on
  these silicons.
 
  Signed-off-by: Jerry Huang chang-ming.hu...@freescale.com
  Signed-off-by: Roy Zang tie-fei.z...@freescale.com
  ---
   drivers/mmc/host/sdhci-of-core.c |    4 
   drivers/mmc/host/sdhci.c         |   14 --
   drivers/mmc/host/sdhci.h         |    2 ++
   3 files changed, 18 insertions(+), 2 deletions(-)
 
  diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
  index c6d1bd8..a92566e 100644
  --- a/drivers/mmc/host/sdhci.c
  +++ b/drivers/mmc/host/sdhci.c
  @@ -817,8 +817,12 @@ static void 
 sdhci_set_transfer_mode(struct sdhci_host *host,
         WARN_ON(!host-data);
 
         mode = SDHCI_TRNS_BLK_CNT_EN;
  -       if (data-blocks  1)
  -               mode |= SDHCI_TRNS_MULTI;
  +       if (data-blocks  1) {
  +               if (host-quirks  
 SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
  +                       mode |= SDHCI_TRNS_MULTI | 
 SDHCI_TRNS_ACMD12;
  +               else
  +                       mode |= SDHCI_TRNS_MULTI;
 
 nit:
 +   mode |= SDHCI_TRNS_MULTI;
 +   if (host-quirks  SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
 +   mode |= SDHCI_TRNS_ACMD12;
 
 Clearer, no?
It is clear.
Thanks.
Roy

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-10 Thread Zang Roy-R61911
 

 -Original Message-
 From: Anton Vorontsov [mailto:cbouatmai...@gmail.com] 
 Sent: Tuesday, August 10, 2010 1:44 AM
 To: Grant Likely
 Cc: Zang Roy-R61911; linuxppc-...@ozlabs.org; 
 a...@linux-foundation.org; linux-...@vger.kernel.org
 Subject: Re: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for 
 eSDHC driver
 
 On Wed, Aug 04, 2010 at 07:02:56PM -0600, Grant Likely wrote:
  On Mon, Aug 2, 2010 at 9:11 PM, Roy Zang 
 tie-fei.z...@freescale.com wrote:
   From: Jerry Huang chang-ming.hu...@freescale.com
  
   Add auto CMD12 command support for eSDHC driver.
   This is needed by P4080 and P1022 for block read/write.
   Manual asynchronous CMD12 abort operation causes protocol 
 violations on
   these silicons.
  
   Signed-off-by: Jerry Huang chang-ming.hu...@freescale.com
   Signed-off-by: Roy Zang tie-fei.z...@freescale.com
   ---
    drivers/mmc/host/sdhci-of-core.c |    4 
    drivers/mmc/host/sdhci.c         |   14 --
    drivers/mmc/host/sdhci.h         |    2 ++
    3 files changed, 18 insertions(+), 2 deletions(-)
  
   diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
   index c6d1bd8..a92566e 100644
   --- a/drivers/mmc/host/sdhci.c
   +++ b/drivers/mmc/host/sdhci.c
   @@ -817,8 +817,12 @@ static void 
 sdhci_set_transfer_mode(struct sdhci_host *host,
          WARN_ON(!host-data);
  
          mode = SDHCI_TRNS_BLK_CNT_EN;
   -       if (data-blocks  1)
   -               mode |= SDHCI_TRNS_MULTI;
   +       if (data-blocks  1) {
   +               if (host-quirks  
 SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
   +                       mode |= SDHCI_TRNS_MULTI | 
 SDHCI_TRNS_ACMD12;
   +               else
   +                       mode |= SDHCI_TRNS_MULTI;
  
  nit:
  +   mode |= SDHCI_TRNS_MULTI;
  +   if (host-quirks  
 SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
  +   mode |= SDHCI_TRNS_ACMD12;
  
  Clearer, no?
 
 Much clearer. I would prefer the nit incorporated.
Agree.

 
 Another nit:
 
  @@ -154,6 +154,10 @@ static int __devinit 
 sdhci_of_probe(struct of_device *ofdev,
  host-ops = sdhci_of_data-ops;
  }
  
  +   if (of_get_property(np, sdhci,auto-cmd12, NULL))
  +   host-quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
  +
  +  
 
 ^^ No need for the two empty lines.
Agree.
 
 if (of_get_property(np, sdhci,1-bit-only, NULL))
 
 Though, technically the patch looks OK, feel free to add my
 
   Acked-by: Anton Vorontsov cbouatmai...@gmail.com
I send a new patch to fix the nip. you are Cced.
Thanks.
Roy

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-10 Thread Zang Roy-R61911
 

 -Original Message-
 From: Michał Mirosław [mailto:mir...@gmail.com] 
 Sent: Tuesday, August 10, 2010 2:25 AM
 To: Zang Roy-R61911
 Cc: linux-...@vger.kernel.org; linuxppc-...@ozlabs.org; 
 a...@linux-foundation.org
 Subject: Re: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for 
 eSDHC driver
 
 2010/8/3 Roy Zang tie-fei.z...@freescale.com:
 [...]
  @@ -240,6 +240,8 @@ struct sdhci_host {
   #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN              (125)
   /* Controller cannot support End Attribute in NOP ADMA 
 descriptor */
   #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC              (126)
  +/* Controller uses Auto CMD12 command to stop the transfer */
  +#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12             (127)
 
         int                     irq;            /* Device IRQ */
         void __iomem *          ioaddr;         /* Mapped address */
 
 Just a cosmetic hint: I suggest SDHCI_QUIRK_MULTIBLOCK_READ_AUTO_CMD12
 or something for the quirk name, because ACMD12 part might be confused
 with MMC/SD App CMD 12 (CMD55+CMD12 combo) if/whenever that gets used.
Thanks for the suggestion.
There are several ACMD12 needed to be updated.
Send a new patch to update it.
Roy

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-09 Thread Anton Vorontsov
On Wed, Aug 04, 2010 at 07:02:56PM -0600, Grant Likely wrote:
 On Mon, Aug 2, 2010 at 9:11 PM, Roy Zang tie-fei.z...@freescale.com wrote:
  From: Jerry Huang chang-ming.hu...@freescale.com
 
  Add auto CMD12 command support for eSDHC driver.
  This is needed by P4080 and P1022 for block read/write.
  Manual asynchronous CMD12 abort operation causes protocol violations on
  these silicons.
 
  Signed-off-by: Jerry Huang chang-ming.hu...@freescale.com
  Signed-off-by: Roy Zang tie-fei.z...@freescale.com
  ---
   drivers/mmc/host/sdhci-of-core.c |    4 
   drivers/mmc/host/sdhci.c         |   14 --
   drivers/mmc/host/sdhci.h         |    2 ++
   3 files changed, 18 insertions(+), 2 deletions(-)
 
  diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
  index c6d1bd8..a92566e 100644
  --- a/drivers/mmc/host/sdhci.c
  +++ b/drivers/mmc/host/sdhci.c
  @@ -817,8 +817,12 @@ static void sdhci_set_transfer_mode(struct sdhci_host 
  *host,
         WARN_ON(!host-data);
 
         mode = SDHCI_TRNS_BLK_CNT_EN;
  -       if (data-blocks  1)
  -               mode |= SDHCI_TRNS_MULTI;
  +       if (data-blocks  1) {
  +               if (host-quirks  SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
  +                       mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_ACMD12;
  +               else
  +                       mode |= SDHCI_TRNS_MULTI;
 
 nit:
 +   mode |= SDHCI_TRNS_MULTI;
 +   if (host-quirks  SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
 +   mode |= SDHCI_TRNS_ACMD12;
 
 Clearer, no?

Much clearer. I would prefer the nit incorporated.

Another nit:

 @@ -154,6 +154,10 @@ static int __devinit sdhci_of_probe(struct of_device 
 *ofdev,
 host-ops = sdhci_of_data-ops;
 }
 
 +   if (of_get_property(np, sdhci,auto-cmd12, NULL))
 +   host-quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
 +
 +  

^^ No need for the two empty lines.

if (of_get_property(np, sdhci,1-bit-only, NULL))

Though, technically the patch looks OK, feel free to add my

  Acked-by: Anton Vorontsov cbouatmai...@gmail.com

on the next resend (if any).

Thanks Roy!

-- 
Anton Vorontsov
email: cbouatmai...@gmail.com
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-09 Thread Michał Mirosław
2010/8/3 Roy Zang tie-fei.z...@freescale.com:
[...]
 @@ -240,6 +240,8 @@ struct sdhci_host {
  #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN              (125)
  /* Controller cannot support End Attribute in NOP ADMA descriptor */
  #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC              (126)
 +/* Controller uses Auto CMD12 command to stop the transfer */
 +#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12             (127)

        int                     irq;            /* Device IRQ */
        void __iomem *          ioaddr;         /* Mapped address */

Just a cosmetic hint: I suggest SDHCI_QUIRK_MULTIBLOCK_READ_AUTO_CMD12
or something for the quirk name, because ACMD12 part might be confused
with MMC/SD App CMD 12 (CMD55+CMD12 combo) if/whenever that gets used.

Best Regards,
Michał Mirosław
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-08 Thread Grant Likely
On Wed, Aug 4, 2010 at 8:14 PM, Zang Roy-R61911 r61...@freescale.com wrote:
  diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
  index c6d1bd8..a92566e 100644
  --- a/drivers/mmc/host/sdhci.c
  +++ b/drivers/mmc/host/sdhci.c
  @@ -817,8 +817,12 @@ static void
 sdhci_set_transfer_mode(struct sdhci_host *host,
         WARN_ON(!host-data);
 
         mode = SDHCI_TRNS_BLK_CNT_EN;
  -       if (data-blocks  1)
  -               mode |= SDHCI_TRNS_MULTI;
  +       if (data-blocks  1) {
  +               if (host-quirks 
 SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
  +                       mode |= SDHCI_TRNS_MULTI |
 SDHCI_TRNS_ACMD12;
  +               else
  +                       mode |= SDHCI_TRNS_MULTI;

 nit:
 +               mode |= SDHCI_TRNS_MULTI;
 +               if (host-quirks  SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
 +                       mode |= SDHCI_TRNS_ACMD12;

 Clearer, no?
 why?

Shorter lines, fewer lines, and the SDHCI_TRNS_MULTI is more obviously
unconditional.  But as I said, it is a nitpick.

g.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-04 Thread Grant Likely
On Mon, Aug 2, 2010 at 9:11 PM, Roy Zang tie-fei.z...@freescale.com wrote:
 From: Jerry Huang chang-ming.hu...@freescale.com

 Add auto CMD12 command support for eSDHC driver.
 This is needed by P4080 and P1022 for block read/write.
 Manual asynchronous CMD12 abort operation causes protocol violations on
 these silicons.

 Signed-off-by: Jerry Huang chang-ming.hu...@freescale.com
 Signed-off-by: Roy Zang tie-fei.z...@freescale.com
 ---
  drivers/mmc/host/sdhci-of-core.c |    4 
  drivers/mmc/host/sdhci.c         |   14 --
  drivers/mmc/host/sdhci.h         |    2 ++
  3 files changed, 18 insertions(+), 2 deletions(-)

 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
 index c6d1bd8..a92566e 100644
 --- a/drivers/mmc/host/sdhci.c
 +++ b/drivers/mmc/host/sdhci.c
 @@ -817,8 +817,12 @@ static void sdhci_set_transfer_mode(struct sdhci_host 
 *host,
        WARN_ON(!host-data);

        mode = SDHCI_TRNS_BLK_CNT_EN;
 -       if (data-blocks  1)
 -               mode |= SDHCI_TRNS_MULTI;
 +       if (data-blocks  1) {
 +               if (host-quirks  SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
 +                       mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_ACMD12;
 +               else
 +                       mode |= SDHCI_TRNS_MULTI;

nit:
+   mode |= SDHCI_TRNS_MULTI;
+   if (host-quirks  SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
+   mode |= SDHCI_TRNS_ACMD12;

Clearer, no?

 +       }
        if (data-flags  MMC_DATA_READ)
                mode |= SDHCI_TRNS_READ;
        if (host-flags  SDHCI_REQ_USE_DMA)
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-04 Thread Zang Roy-R61911
 

 -Original Message-
 From: glik...@secretlab.ca [mailto:glik...@secretlab.ca] On 
 Behalf Of Grant Likely
 Sent: Thursday, August 05, 2010 9:03 AM
 To: Zang Roy-R61911
 Cc: linux-...@vger.kernel.org; linuxppc-...@ozlabs.org; 
 a...@linux-foundation.org
 Subject: Re: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for 
 eSDHC driver
 
 On Mon, Aug 2, 2010 at 9:11 PM, Roy Zang 
 tie-fei.z...@freescale.com wrote:
  From: Jerry Huang chang-ming.hu...@freescale.com
 
  Add auto CMD12 command support for eSDHC driver.
  This is needed by P4080 and P1022 for block read/write.
  Manual asynchronous CMD12 abort operation causes protocol 
 violations on
  these silicons.
 
  Signed-off-by: Jerry Huang chang-ming.hu...@freescale.com
  Signed-off-by: Roy Zang tie-fei.z...@freescale.com
  ---
   drivers/mmc/host/sdhci-of-core.c |    4 
   drivers/mmc/host/sdhci.c         |   14 --
   drivers/mmc/host/sdhci.h         |    2 ++
   3 files changed, 18 insertions(+), 2 deletions(-)
 
  diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
  index c6d1bd8..a92566e 100644
  --- a/drivers/mmc/host/sdhci.c
  +++ b/drivers/mmc/host/sdhci.c
  @@ -817,8 +817,12 @@ static void 
 sdhci_set_transfer_mode(struct sdhci_host *host,
         WARN_ON(!host-data);
 
         mode = SDHCI_TRNS_BLK_CNT_EN;
  -       if (data-blocks  1)
  -               mode |= SDHCI_TRNS_MULTI;
  +       if (data-blocks  1) {
  +               if (host-quirks  
 SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
  +                       mode |= SDHCI_TRNS_MULTI | 
 SDHCI_TRNS_ACMD12;
  +               else
  +                       mode |= SDHCI_TRNS_MULTI;
 
 nit:
 +   mode |= SDHCI_TRNS_MULTI;
 +   if (host-quirks  SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
 +   mode |= SDHCI_TRNS_ACMD12;
 
 Clearer, no?
why?
Roy

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-03 Thread Andrew Morton
On Tue, 3 Aug 2010 11:11:10 +0800
Roy Zang tie-fei.z...@freescale.com wrote:

 --- a/drivers/mmc/host/sdhci.h
 +++ b/drivers/mmc/host/sdhci.h
 @@ -240,6 +240,8 @@ struct sdhci_host {
  #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN(125)
  /* Controller cannot support End Attribute in NOP ADMA descriptor */
  #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC(126)
 +/* Controller uses Auto CMD12 command to stop the transfer */
 +#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12   (127)

This becomes 129 in my tree.

We're about to run out.  What happens then?
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-03 Thread Zang Roy-R61911
 

 -Original Message-
 From: Andrew Morton [mailto:a...@linux-foundation.org] 
 Sent: Wednesday, August 04, 2010 7:44 AM
 To: Zang Roy-R61911
 Cc: linux-...@vger.kernel.org; linuxppc-...@ozlabs.org
 Subject: Re: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for 
 eSDHC driver
 
 On Tue, 3 Aug 2010 11:11:10 +0800
 Roy Zang tie-fei.z...@freescale.com wrote:
 
  --- a/drivers/mmc/host/sdhci.h
  +++ b/drivers/mmc/host/sdhci.h
  @@ -240,6 +240,8 @@ struct sdhci_host {
   #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN  (125)
   /* Controller cannot support End Attribute in NOP ADMA 
 descriptor */
   #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC  (126)
  +/* Controller uses Auto CMD12 command to stop the transfer */
  +#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (127)
 
 This becomes 129 in my tree.
It also works.
 
 We're about to run out.  
:-(
What happens then?
Rewrite the code to extend some bits, I suppose.
Roy

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-02 Thread Roy Zang
From: Jerry Huang chang-ming.hu...@freescale.com

Add auto CMD12 command support for eSDHC driver.
This is needed by P4080 and P1022 for block read/write.
Manual asynchronous CMD12 abort operation causes protocol violations on
these silicons.

Signed-off-by: Jerry Huang chang-ming.hu...@freescale.com
Signed-off-by: Roy Zang tie-fei.z...@freescale.com
---
 drivers/mmc/host/sdhci-of-core.c |4 
 drivers/mmc/host/sdhci.c |   14 --
 drivers/mmc/host/sdhci.h |2 ++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-core.c b/drivers/mmc/host/sdhci-of-core.c
index a2e9820..dd1bdd1 100644
--- a/drivers/mmc/host/sdhci-of-core.c
+++ b/drivers/mmc/host/sdhci-of-core.c
@@ -154,6 +154,10 @@ static int __devinit sdhci_of_probe(struct of_device 
*ofdev,
host-ops = sdhci_of_data-ops;
}
 
+   if (of_get_property(np, sdhci,auto-cmd12, NULL))
+   host-quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
+
+
if (of_get_property(np, sdhci,1-bit-only, NULL))
host-quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
 
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index c6d1bd8..a92566e 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -817,8 +817,12 @@ static void sdhci_set_transfer_mode(struct sdhci_host 
*host,
WARN_ON(!host-data);
 
mode = SDHCI_TRNS_BLK_CNT_EN;
-   if (data-blocks  1)
-   mode |= SDHCI_TRNS_MULTI;
+   if (data-blocks  1) {
+   if (host-quirks  SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
+   mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_ACMD12;
+   else
+   mode |= SDHCI_TRNS_MULTI;
+   }
if (data-flags  MMC_DATA_READ)
mode |= SDHCI_TRNS_READ;
if (host-flags  SDHCI_REQ_USE_DMA)
@@ -1108,6 +1112,12 @@ static void sdhci_request(struct mmc_host *mmc, struct 
mmc_request *mrq)
 #ifndef SDHCI_USE_LEDS_CLASS
sdhci_activate_led(host);
 #endif
+   if (host-quirks  SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) {
+   if (mrq-stop) {
+   mrq-data-stop = NULL;
+   mrq-stop = NULL;
+   }
+   }
 
host-mrq = mrq;
 
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index c846813..8fb088c 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -240,6 +240,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN  (125)
 /* Controller cannot support End Attribute in NOP ADMA descriptor */
 #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC  (126)
+/* Controller uses Auto CMD12 command to stop the transfer */
+#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (127)
 
int irq;/* Device IRQ */
void __iomem *  ioaddr; /* Mapped address */
-- 
1.5.6.5


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev