On 2026-10-28T05:50:48, Ana Bobillo <[email protected]> wrote:
> usb: storage: Refuse a block size the block layer cannot use
>
> usb_stor_get_info() takes the block size from the READ CAPACITY reply of
> the device as it is. Once blk_post_probe() refuses a block size that
> blk_valid_blksz() rejects, at the end of this series, such a device would
> fail to probe there, and usb_stor_probe_device() would stop, skipping the
> other LUNs of the device.
>
> Check the block size where it is read, and treat a LUN reporting one
> that blk_valid_blksz() rejects as unusable, as for a LUN that is not
> ready, saying which LUN is skipped. This also covers the legacy (non-BLK)
> path, which calls part_init() itself.
>
> Add a test where the sandbox flash stick reports an unsupported block
> size.
>
> Signed-off-by: Ana Bobillo <[email protected]>
>
>  arch/sandbox/include/asm/test.h  | 10 ++++++++
>  common/usb_storage.c             |  5 ++++
>  drivers/usb/emul/sandbox_flash.c |  8 +++++++
>  test/dm/usb.c                    | 51 
> ++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 74 insertions(+)

Reviewed-by: Simon Glass <[email protected]>

Reply via email to