mt76x0u: Probing issues on Raspberry Pi 3 B+
Quoted 11 lines · Alan Stern
Quoted 8 lines · Stanislaw Gruszka
It would be interesting why
urb->num_sgs= 0 &urb->sgcause the troubles. This is howusb_sg_init()submit urbs forsg_tablesize= 0 controllers. So either are there are some requirement onurb->sgmapped viadma_map_page()(which mt76usb does not meet) not needed forurb->transfer_buffermapped viadma_map_single()or there is something wrong in dwc2 with sg and this driver will not work withurb_sg_init()as well. I don't have hardware to investigate this and don't want to bother you with more patches.
Quoted 3 lines
urb->sg!= NULL andurb->num_sgs== 0 means that the transfer buffer must fit into a single page, which is pointed to by the first element of the scatterlist.
I asked about that in other thread
https://lore.kernel.org/linux-wireless/[email protected]/
the answer was it is weird but valid. However I think do dma_map_page() on buffer not fit in the single page is asking for troubles. I just posted patch that should fix this for mt76usb.
Quoted 3 lines
But now that I look at the code in
usb_sg_init(), it seems odd that the !use_sg case doesn't increment sg during each loop iteration. I don't see how that could possibly work -- it looks like a bug!
Looks for me that this is done via for_each_sg(sg, sg, io->entries, i) loop.
Stanislaw