[PATCH v2 03/10] usb/msd: Improved handling of mass storage reset

Nicholas Piggin posted 10 patches 4 days, 16 hours ago
[PATCH v2 03/10] usb/msd: Improved handling of mass storage reset
Posted by Nicholas Piggin 4 days, 16 hours ago
The mass storage reset request handling does not reset in-flight
SCSI requests or USB MSD packets. Implement this by calling the
device reset handler which should take care of everything.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 hw/usb/dev-storage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 87c22476f6b..c7c36ac80fa 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -359,7 +359,7 @@ static void usb_msd_handle_control(USBDevice *dev, USBPacket *p,
         /* Class specific requests.  */
     case ClassInterfaceOutRequest | MassStorageReset:
         /* Reset state ready for the next CBW.  */
-        s->mode = USB_MSDM_CBW;
+        usb_msd_handle_reset(dev);
         break;
     case ClassInterfaceRequest | GetMaxLun:
         maxlun = 0;
-- 
2.47.1
Re: [PATCH v2 03/10] usb/msd: Improved handling of mass storage reset
Posted by Philippe Mathieu-Daudé 4 days, 13 hours ago
On 11/4/25 10:04, Nicholas Piggin wrote:
> The mass storage reset request handling does not reset in-flight
> SCSI requests or USB MSD packets. Implement this by calling the
> device reset handler which should take care of everything.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>   hw/usb/dev-storage.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>