mbox series

[0/2] mmc: core: Implement support for cache ctrl for SD cards

Message ID 20210506145829.198823-1-ulf.hansson@linaro.org
Headers show
Series mmc: core: Implement support for cache ctrl for SD cards | expand

Message

Ulf Hansson May 6, 2021, 2:58 p.m. UTC
In the SD spec v6.x the SD function extension registers for performance
enhancements were introduced. As a part of this an optional internal cache on
the SD card can be used to improve performance.

To let the SD card use the cache, the host needs to enable it and take care of
flushing of the cache. This series implement support for this.

Note that, there are no HW updates needed for the host to support this feature.
This has been tested on 64GB Sandisk Extreme PRO UHS-I A2 card.

The series is based upon another recently posted series [1] that added support
for poweroff notification.

Tests and reviews are of course greatly appreciated!

Kind regards
Ulf Hansson

[1]
https://patchwork.kernel.org/project/linux-mmc/list/?series=476933

Ulf Hansson (2):
  mmc: core: Move eMMC cache flushing to a new bus_ops callback
  mmc: core: Add support for cache ctrl for SD cards

 drivers/mmc/core/block.c   |  2 +-
 drivers/mmc/core/core.h    |  9 ++++
 drivers/mmc/core/mmc.c     | 25 +++++++++-
 drivers/mmc/core/mmc_ops.c | 22 +--------
 drivers/mmc/core/mmc_ops.h |  2 +-
 drivers/mmc/core/sd.c      | 98 ++++++++++++++++++++++++++++++++++++++
 include/linux/mmc/card.h   |  1 +
 7 files changed, 134 insertions(+), 25 deletions(-)

-- 
2.25.1

Comments

Avri Altman May 10, 2021, 7:39 a.m. UTC | #1
> In the SD spec v6.x the SD function extension registers for performance

> enhancements were introduced. As a part of this an optional internal cache

> on

> the SD card can be used to improve performance.

Just to verify that you are aware of that:
In addition to the extension Registers that were defined in the physical core spec,
there was a separate document that was released that suggest a common OS API's to those registers.
It is called "SD specification part A5, SD Extensions API specification".

Thanks,
Avri
Ulf Hansson May 10, 2021, 9:44 a.m. UTC | #2
On Mon, 10 May 2021 at 09:40, Avri Altman <Avri.Altman@wdc.com> wrote:
>

> > In the SD spec v6.x the SD function extension registers for performance

> > enhancements were introduced. As a part of this an optional internal cache

> > on

> > the SD card can be used to improve performance.

> Just to verify that you are aware of that:

> In addition to the extension Registers that were defined in the physical core spec,

> there was a separate document that was released that suggest a common OS API's to those registers.

> It is called "SD specification part A5, SD Extensions API specification".


Thanks for the pointer!

I did have a very brief look at this. The conclusion I made is that
this is way over designed to enable support for features like cache
and poweroff notification. However, there may be other use cases that
could benefit from a user space library, along the lines of the SD
Extensions API, but I can't really tell.

Do you have an interest around this that you can share?

Thanks for reviewing!

Kind regards
Uffe
Avri Altman May 10, 2021, 10:12 a.m. UTC | #3
> On Mon, 10 May 2021 at 09:40, Avri Altman <Avri.Altman@wdc.com> wrote:

> >

> > > In the SD spec v6.x the SD function extension registers for performance

> > > enhancements were introduced. As a part of this an optional internal

> cache

> > > on

> > > the SD card can be used to improve performance.

> > Just to verify that you are aware of that:

> > In addition to the extension Registers that were defined in the physical

> core spec,

> > there was a separate document that was released that suggest a common

> OS API's to those registers.

> > It is called "SD specification part A5, SD Extensions API specification".

> 

> Thanks for the pointer!

> 

> I did have a very brief look at this. The conclusion I made is that

> this is way over designed to enable support for features like cache

> and poweroff notification. However, there may be other use cases that

> could benefit from a user space library, along the lines of the SD

> Extensions API, but I can't really tell.

> 

> Do you have an interest around this that you can share?

Not at the moment. Still thinking about this.

Thanks,
Avri

> 

> Thanks for reviewing!

> 

> Kind regards

> Uffe