Skip to contentSkip to conversation

mt76: handle protocol error to proper deinit rx_tasklet

PATCH In review Eduardo Abinader 3 participants 7 messages Nov 23, 2018 – Nov 26, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mt76: handle protocol error to proper deinit rx_tasklet

During removal of usb dongle, noticed many unhandled rx urb below. This this patch, make it possible and early completion of the rx tasklet.

mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
...

---
 drivers/net/wireless/mediatek/mt76/usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/usb.c +1 -0
index 5f0faf07c346..dc33df9cd155 100644
@@ -446,6 +446,7 @@ static void mt76u_complete_rx(struct urb *urb)
 	case -ECONNRESET:
 	case -ESHUTDOWN:
 	case -ENOENT:
+	case -EPROTO:
 		return;
 	default:
 		dev_err(dev->dev, "rx urb failed: %d\n", urb->status);
Signature · 1 line
2.19.1
#1 lore raw
Quoted 9 lines

During removal of usb dongle, noticed many unhandled rx urb below. This this patch, make it possible and early completion of the rx tasklet.

mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
...

Hi Eduardo,

I think EPROTO is a more general error (it is not strictly related to device removal)
and it could happen even during normal operation. In this case I guess we should reinsert the urb to usb-core.

Regards,
Lorenzo

Quoted 21 lines
---
 drivers/net/wireless/mediatek/mt76/usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/usb.c +1 -1
index 5f0faf07c346..dc33df9cd155 100644
@@ -446,6 +446,7 @@ static void mt76u_complete_rx(struct urb *urb)
        case -ECONNRESET:
        case -ESHUTDOWN:
        case -ENOENT:
+       case -EPROTO:
                return;
        default:
                dev_err(dev->dev, "rx urb failed: %d\n", urb->status);
--

2.19.1

#2 lore raw
Quoted 8 lines · Lorenzo Bianconi
Quoted 8 lines

During removal of usb dongle, noticed many unhandled rx urb below. This this patch, make it possible and early completion of the rx tasklet.

mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71

If problem here is just printing errors, I think we are ok. If problem is some hung or infinity loop, it should be fixed.

Quoted 6 lines

Hi Eduardo,

I think EPROTO is a more general error (it is not strictly related to device removal)
and it could happen even during normal operation. In this case I guess we should reinsert the urb to usb-core.

Some (out of tree) usb host drivers returns EPROTO all the time in some error conditions. On rt2x00 resubmitting urb resulted in infinity loop:
https://marc.info/?t=153375128700002&r=1&w=2

Fix I proposed for that was counting EPROTO errors and mark device as removed if 10 of them happened in row:
https://marc.info/?l=linux-wireless&m=153441755529960&w=2

Thanks
Stanislaw

#3 lore raw
Quoted 21 lines · Stanislaw Gruszka
Quoted 8 lines · Lorenzo Bianconi
Quoted 8 lines

During removal of usb dongle, noticed many unhandled rx urb below. This this patch, make it possible and early completion of the rx tasklet.

mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71
mt76x2u 1-3.4.3.1.2:1.0: rx urb failed: -71

If problem here is just printing errors, I think we are ok. If problem is some hung or infinity loop, it should be fixed.

Quoted 6 lines

Hi Eduardo,

I think EPROTO is a more general error (it is not strictly related to device removal)
and it could happen even during normal operation. In this case I guess we should reinsert the urb to usb-core.

Quoted 8 lines

Some (out of tree) usb host drivers returns EPROTO all the time in some error conditions. On rt2x00 resubmitting urb resulted in infinity loop:
https://marc.info/?t=153375128700002&r=1&w=2

Fix I proposed for that was counting EPROTO errors and mark device as removed if 10 of them happened in row:
https://marc.info/?l=linux-wireless&m=153441755529960&w=2

Thanks for the feedback, guys.

Would it be ok for you if I respin the patch with the suggested approach by Stanislaw?

Regards,
Eduardo

Quoted 3 lines

Thanks
Stanislaw

#4 lore raw
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

During removal of usb dongle, noticed many unhandled rx urb below. This this patch, make it possible and early completion of the rx tasklet.

[...]

Quoted 12 lines
Quoted 12 lines
Quoted 6 lines

Hi Eduardo,

I think EPROTO is a more general error (it is not strictly related to device removal)
and it could happen even during normal operation. In this case I guess we should reinsert the urb to usb-core.

Some (out of tree) usb host drivers returns EPROTO all the time in some error conditions. On rt2x00 resubmitting urb resulted in infinity loop:
https://marc.info/?t=153375128700002&r=1&w=2

Quoted 8 lines
Quoted 3 lines

Fix I proposed for that was counting EPROTO errors and mark device as removed if 10 of them happened in row:
https://marc.info/?l=linux-wireless&m=153441755529960&w=2

Thanks for the feedback, guys.

Would it be ok for you if I respin the patch with the suggested approach by Stanislaw?

Hi Eduardo,

AFAIU the -EPROTO error is reported only during device removal or just sporadically
(you have never experienced any infinity loop). Is it correct? If so I guess we do not need to develop any intrusive workaround since it is just an annoying log message

Regards,
Lorenzo

Quoted 6 lines

Regards,
Eduardo

Quoted 3 lines

Thanks
Stanislaw

#5 lore raw
Quoted 28 lines · Lorenzo Bianconi
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

During removal of usb dongle, noticed many unhandled rx urb below. This this patch, make it possible and early completion of the rx tasklet.

[...]

Quoted 12 lines
Quoted 12 lines
Quoted 6 lines

Hi Eduardo,

I think EPROTO is a more general error (it is not strictly related to device removal)
and it could happen even during normal operation. In this case I guess we should reinsert the urb to usb-core.

Some (out of tree) usb host drivers returns EPROTO all the time in some error conditions. On rt2x00 resubmitting urb resulted in infinity loop:
https://marc.info/?t=153375128700002&r=1&w=2

Quoted 8 lines
Quoted 3 lines

Fix I proposed for that was counting EPROTO errors and mark device as removed if 10 of them happened in row:
https://marc.info/?l=linux-wireless&m=153441755529960&w=2

Thanks for the feedback, guys.

Would it be ok for you if I respin the patch with the suggested approach by Stanislaw?

Quoted 8 lines

Hi Eduardo,

AFAIU the -EPROTO error is reported only during device removal or just sporadically
(you have never experienced any infinity loop). Is it correct? If so I guess we do not need to develop any intrusive workaround since it is just an annoying log message

It is reported only during device removal as I've been seen with my comfast dongle.
The device removal does not lead to an infinity loop, but there's a bouncing around 100 urb failed msgs...

Thanks,
Eduardo

Quoted 9 lines

Regards,
Lorenzo

Quoted 6 lines

Regards,
Eduardo

Quoted 3 lines

Thanks
Stanislaw

#6 lore raw
Quoted 2 lines

On Mon, 26 Nov 2018 at 22:31, Lorenzo Bianconi
<[email protected]> wrote:

[...]

Quoted 9 lines
Quoted 8 lines

Hi Eduardo,

AFAIU the -EPROTO error is reported only during device removal or just sporadically
(you have never experienced any infinity loop). Is it correct? If so I guess we do not need to develop any intrusive workaround since it is just an annoying log message

Quoted 5 lines

It is reported only during device removal as I've been seen with my comfast dongle.
The device removal does not lead to an infinity loop, but there's a bouncing around 100 urb failed msgs...

Thx for the clarification Eduardo. So is it better to mute all -EPROTO errors or tolerate these annoying messages during dongle removal? I would prefer the second choice since would be useful to know if the controller reports that kind of errors.

Regards,
Lorenzo

Quoted 12 lines

Thanks,
Eduardo

Quoted 9 lines

Regards,
Lorenzo

Quoted 6 lines

Regards,
Eduardo

Quoted 3 lines

Thanks
Stanislaw