[PATCH v4 4/8] rockchip: block: blk-uclass: disable bounce buffer support for rkmtd

Simon Glass sjg at chromium.org
Wed Oct 18 05:31:10 CEST 2023


Hi Johan,

On Tue, 17 Oct 2023 at 06:44, Johan Jonker <jbx6244 at gmail.com> wrote:
>
>
>
> On 10/16/23 23:54, Simon Glass wrote:
> > Hi Johan,
> >
> > On Sun, 15 Oct 2023 at 16:33, Johan Jonker <jbx6244 at gmail.com> wrote:
> >>
> >> Disable bounce buffer support for rkmtd.
> >>
> >> Signed-off-by: Johan Jonker <jbx6244 at gmail.com>
> >> Reviewed-by: Kever Yang <kever.yang at rock-chips.com>
> >> ---
> >>
> >> Changed V3:
> >>   New patch
> >> ---
> >>  drivers/block/blk-uclass.c | 6 +++---
> >>  1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
> >> index 30ad5bbb0024..ac1b43d757d8 100644
> >> --- a/drivers/block/blk-uclass.c
> >> +++ b/drivers/block/blk-uclass.c
> >> @@ -415,7 +415,7 @@ struct blk_bounce_buffer {
> >>
> >>  static int blk_buffer_aligned(struct bounce_buffer *state)
> >>  {
> >> -#if IS_ENABLED(CONFIG_BOUNCE_BUFFER)
> >> +#if IS_ENABLED(CONFIG_BOUNCE_BUFFER) && !IS_ENABLED(CONFIG_RKMTD)
> >
>
> > We should not have arch-specific code in a generic file. Can you make
> > BOUNCE_BUFFER depend on !RKMTD ?
>
> Hi Simon, Marek,
>
> No that doesn't work that way.
>
> On Rockchip mainline boards MMC_DW is always our boot device BOOT_DEVICE_MMCx.
> Therefore BOUNCE_BUFFER is also standard enabled.
>
> The solution in this patch below is wrong as it assumes that if BOUNCE_BUFFER is enabled it must be used all over the place.
>
> blk: Add bounce buffer support to read/write operations
> https://source.denx.de/u-boot/u-boot/-/commit/75191f75bce45f3b9aff607c88f17778d3805c61
>
> All implementations of bounce_buffer_start and bounce_buffer_start_extalign are located in the individual drivers
>
> https://elixir.bootlin.com/u-boot/latest/C/ident/bounce_buffer_start
> https://elixir.bootlin.com/u-boot/latest/C/ident/bounce_buffer_start_extalign
>
> The use of a bounce_buffer in block devices should only be allowed if needed.
> Lack of "ops->buffer_aligned" does not prevent the creation of a bounce_buffer and is not a good selector yet.
>
>         if (ops->buffer_aligned)
>                 return ops->buffer_aligned(dev, state);
>
> Current blk_ops has no option to communicate the needed resources.
> Please advise how to select the creation of a bounce buffer per device or other solution.

OK, I thought you might say that. So what about a flag in blk_desc
which you can set for this driver, after the block device is created?

[..]

Regards,
Simon


More information about the U-Boot mailing list