usb: cdc-acm: handle unlinked urb in acm read callback
Subsystems (3)
PATCH v2 1/1 usb: cdc-acm: handle unlinked urb in acm read callback
In current acm driver, the bulk-in callback function ignores the URBs unlinked in usb core.
This causes unexpected data loss in some cases. For example, runtime suspend entry will unlinked all urbs and set urb->status to -ENOENT even those urbs might have data not processed yet. Hence, data loss occurs.
This patch lets bulk-in callback function handle unlinked urbs to avoid data loss.
--- drivers/usb/class/cdc-acm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/class/cdc-acm.c +2 -1
@@ -428,7 +428,8 @@ static void acm_read_bulk_callback(struct urb *urb)set_bit (rb->index, &acm->read_urbs_free);dev_dbg (&acm->data->dev,"%s - non-zero urb status: %d\n" , __func__, status); -return ; +if ((status != -ENOENT ) || (urb->actual_length ==0 )) +return ; }usb_mark_last_busy (acm->dev);
Signature · 1 line
2.1.4
Greg Kroah-Hartman
maintainerQuoted 11 lines · Lu Baolu
In current acm driver, the bulk-in callback function ignores the URBs unlinked in usb core.
This causes unexpected data loss in some cases. For example, runtime suspend entry will unlinked all urbs and set
urb->statusto-ENOENTeven those urbs might have data not processed yet. Hence, data loss occurs.This patch lets bulk-in callback function handle unlinked urbs to avoid data loss.
Quoted 7 lines
Signed-off-by Tang Jian Qiang <[email protected]>Signed-off-by Lu Baolu <[email protected]>Acked-by Oliver Neukum <[email protected]>--- drivers/usb/class/cdc-acm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
What changed in v2?
Please always document that below the --- line.
Quoted 19 lines · Greg Kroah-Hartman
Quoted 11 lines · Lu Baolu
In current acm driver, the bulk-in callback function ignores the URBs unlinked in usb core.
This causes unexpected data loss in some cases. For example, runtime suspend entry will unlinked all urbs and set
urb->statusto-ENOENTeven those urbs might have data not processed yet. Hence, data loss occurs.This patch lets bulk-in callback function handle unlinked urbs to avoid data loss.
Quoted 7 lines
Signed-off-by Tang Jian Qiang <[email protected]>Signed-off-by Lu Baolu <[email protected]>Acked-by Oliver Neukum <[email protected]>--- drivers/usb/class/cdc-acm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 3 lines
What changed in v2?
Please always document that below the --- line.
Thank you for the reminding.
I will send a new version of patch with change logs.
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html