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

Simon Glass sjg at chromium.org
Mon Oct 16 23:54:45 CEST 2023


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 ?

>         struct blk_bounce_buffer *bbstate =
>                 container_of(state, struct blk_bounce_buffer, state);
>         struct udevice *dev = bbstate->dev;
> @@ -441,7 +441,7 @@ long blk_read(struct udevice *dev, lbaint_t start, lbaint_t blkcnt, void *buf)
>                           start, blkcnt, desc->blksz, buf))
>                 return blkcnt;
>
> -       if (IS_ENABLED(CONFIG_BOUNCE_BUFFER)) {
> +       if (IS_ENABLED(CONFIG_BOUNCE_BUFFER) && !IS_ENABLED(CONFIG_RKMTD)) {
>                 struct blk_bounce_buffer bbstate = { .dev = dev };
>                 int ret;
>
> @@ -478,7 +478,7 @@ long blk_write(struct udevice *dev, lbaint_t start, lbaint_t blkcnt,
>
>         blkcache_invalidate(desc->uclass_id, desc->devnum);
>
> -       if (IS_ENABLED(CONFIG_BOUNCE_BUFFER)) {
> +       if (IS_ENABLED(CONFIG_BOUNCE_BUFFER) && !IS_ENABLED(CONFIG_RKMTD)) {
>                 struct blk_bounce_buffer bbstate = { .dev = dev };
>                 int ret;
>
> --
> 2.39.2
>

Regards,
Simon


More information about the U-Boot mailing list