mbox series

[RFC,0/3] mmc: refactor RPMB block count handling

Message ID 20181120230832.1840-1-wsa+renesas@sang-engineering.com (mailing list archive)
Headers show
Series mmc: refactor RPMB block count handling | expand

Message

Wolfram Sang Nov. 20, 2018, 11:08 p.m. UTC
On Renesas R-Car SDHI hardware, we sometimes had timeouts accessing the RPMB.
This is because AutoCMD23/12 features needs a properly filled sbc to work
correctly. But RPMB sends an individual CMD23. I could have fixed the driver
but after some research concluded that fixing the core seems the proper thing
to do. I also added some sanity checking while here. Please let me know what
you think.

Tested on a R-Car M3-N. No timeouts showed up anymore. I'll try to improve the
testing, though, to check if I can make the occasional timeouts from before
more reproducible. And then confirm that this patchset improves the situation :)

Wolfram Sang (3):
  mmc: core: validate user input for RPMB block count
  mmc: core: use mrq->sbc when sending CMD23 for RPMB
  mmc: core: remove obsolete mmc_set_blockcount() function

 drivers/mmc/core/block.c | 14 +++++++++-----
 drivers/mmc/core/core.c  | 14 --------------
 drivers/mmc/core/core.h  |  2 --
 3 files changed, 9 insertions(+), 21 deletions(-)

Comments

Ulf Hansson Nov. 21, 2018, 12:31 a.m. UTC | #1
+ Avri, Clément (due to recent related discussions)

On 21 November 2018 at 00:08, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> On Renesas R-Car SDHI hardware, we sometimes had timeouts accessing the RPMB.
> This is because AutoCMD23/12 features needs a properly filled sbc to work
> correctly. But RPMB sends an individual CMD23. I could have fixed the driver
> but after some research concluded that fixing the core seems the proper thing
> to do. I also added some sanity checking while here. Please let me know what
> you think.
>
> Tested on a R-Car M3-N. No timeouts showed up anymore. I'll try to improve the
> testing, though, to check if I can make the occasional timeouts from before
> more reproducible. And then confirm that this patchset improves the situation :)
>
> Wolfram Sang (3):
>   mmc: core: validate user input for RPMB block count
>   mmc: core: use mrq->sbc when sending CMD23 for RPMB
>   mmc: core: remove obsolete mmc_set_blockcount() function
>
>  drivers/mmc/core/block.c | 14 +++++++++-----
>  drivers/mmc/core/core.c  | 14 --------------
>  drivers/mmc/core/core.h  |  2 --
>  3 files changed, 9 insertions(+), 21 deletions(-)
>
> --
> 2.11.0
>

These changes makes perfect sense to me! I give it a day or two to
allow people to comment/test, then I will queue them up.

Perhaps we should add a suggested by tag from Clément for patch2, as
he kind of suggested this change already [1].

Kind regards
Uffe

[1]
https://patchwork.kernel.org/patch/10645847/
Wolfram Sang Nov. 21, 2018, 2:35 a.m. UTC | #2
On Wed, Nov 21, 2018 at 01:31:35AM +0100, Ulf Hansson wrote:
> + Avri, Clément (due to recent related discussions)

Thanks!

> Perhaps we should add a suggested by tag from Clément for patch2, as
> he kind of suggested this change already [1].

No strong opinion on that, but technically my inspiration for patch 2
was Hayakawa-san. Add it as you see fit...
Clément Péron Nov. 22, 2018, 10:35 a.m. UTC | #3
Hi Wolfram,

On Wed, 21 Nov 2018 at 03:35, Wolfram Sang <wsa@the-dreams.de> wrote:
>dispositifs
> On Wed, Nov 21, 2018 at 01:31:35AM +0100, Ulf Hansson wrote:
> > + Avri, Clément (due to recent related discussions)
>
> Thanks!
>
> > Perhaps we should add a suggested by tag from Clément for patch2, as
> > he kind of suggested this change already [1].
>
> No strong opinion on that, but technically my inspiration for patch 2
> was Hayakawa-san. Add it as you see fit...

Fine for me, so don't add it.
Let me just a day to test it.

Thanks,
Clement
Clément Péron Nov. 24, 2018, 2:26 p.m. UTC | #4
Hi

On Thu, 22 Nov 2018 at 11:35, Clément Péron <peron.clem@gmail.com> wrote:
>
> Hi Wolfram,
>
> On Wed, 21 Nov 2018 at 03:35, Wolfram Sang <wsa@the-dreams.de> wrote:
> >dispositifs
> > On Wed, Nov 21, 2018 at 01:31:35AM +0100, Ulf Hansson wrote:
> > > + Avri, Clément (due to recent related discussions)
> >
> > Thanks!
> >
> > > Perhaps we should add a suggested by tag from Clément for patch2, as
> > > he kind of suggested this change already [1].
> >
> > No strong opinion on that, but technically my inspiration for patch 2
> > was Hayakawa-san. Add it as you see fit...
>
> Fine for me, so don't add it.
> Let me just a day to test it.

Tested fine with SDHCI Iproc controller on 4.9.137 and 4.19.2 with
Auto-CMD12 enable.
But there is something, it's not working not introduce with this patch on 4.14

Regards,
Clement

>
> Thanks,
> Clement
Wolfram Sang Nov. 24, 2018, 9:37 p.m. UTC | #5
> Tested fine with SDHCI Iproc controller on 4.9.137 and 4.19.2 with
> Auto-CMD12 enable.
> But there is something, it's not working not introduce with this patch on 4.14

I didn't get the last sentence. Could you explain in more detail?
Clément Péron Nov. 25, 2018, 10:11 p.m. UTC | #6
On Sat, 24 Nov 2018 at 22:37, Wolfram Sang <wsa@the-dreams.de> wrote:
>
>
> > Tested fine with SDHCI Iproc controller on 4.9.137 and 4.19.2 with
> > Auto-CMD12 enable.
> > But there is something, it's not working not introduce with this patch on 4.14
>
> I didn't get the last sentence. Could you explain in more detail?

Just want to point that RPMB with Iproc controller don't work on 4.14
but it's not due to your patch.

But it's fix the issue on 4.9 and 4.19.

Regards,
Clement
Wolfram Sang Nov. 26, 2018, 9:38 a.m. UTC | #7
> Just want to point that RPMB with Iproc controller don't work on 4.14
> but it's not due to your patch.

Thanks, now I got it!