mt76x0u: Probing issues on Raspberry Pi 3 B+
Quoted 16 lines · Lorenzo Bianconi
Review
Quoted 11 lines
(quoted diff) +11
-0+ usb_fill_bulk_urb(buf->urb, udev, pipe, NULL, buf->len, complete_fn, + context); + + if (udev->bus->sg_tablesize > 0) { + buf->urb->num_sgs = buf->num_sgs; + } else { + WARN_ON_ONCE(buf->num_sgs != 1); + /* See usb_sg_init() */ + buf->urb->num_sgs = 0; + if (!PageHighMem(sg_page(buf->urb->sg))) + buf->urb->transfer_buffer = sg_virt(buf->urb->sg);please correct me if I am wrong but doing so we will use
transfer_bufferfor 95% of the use cases, right? If so why not keep it simple and always use it whensg_tablesizeis 0 (avoiding SG I/O)?
Quoted 2 lines
Btw this is what I proposed with the RFC series actually :) (always use
transfer_bufferin the usb 2.0 case)
Because this way we do not change allocation method (use SG allocation) what is simpler IMHO than having two buffer allocation methods.
And this way we do not hide problems with SG allocation and test it.
Additionally this patch address actual bug: using wrong urb->num_sgs and can be easier to backport to older releases than 4 patch series.
Stanislaw