mt76x0u: Probing issues on Raspberry Pi 3 B+
Quoted 21 lines · Stefan Wahren
Hi,
Quoted 19 lines
Stanislaw Gruszka <[email protected]> hat am 18. Februar 2019 um 14:52 geschrieben:
Quoted 2 lines · Stefan Wahren
this is a misunderstanding. The warning is about memory alignment to 32 bit addresses, not about page alignment. This is a typical ARM restriction. Maybe we need to make sure in mt76 that the DMA buffer needs to be aligned. But it's also possible that the warning isn't the root cause of our problem.
I see, it needs 4 bytes alignment . There is already dwc2 code checks that and allocate new buffer if the alignment is not right:
dwc2_alloc_dma_aligned_buffer(), but it does nothing ifurb->sgis not NULL. I thought mt76usb already provide aligned buffers, but looks it does not for one TX special case, which are PROBE REQUEST frames. Other frames are aligned by inserting L2 header pad. One solution for this would be just submit urb with NULL sg (same as Lorenzo's patches do, but still allocating buffers viabuf->sg), but I think, you have right, we should provide 4 bytes aligned buffers by default as other DMA hardware may require that. I'm attaching yet another patch to test, which fix up alignment for PROBE REQUEST frames.
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Attached patch should fix this, plese test, thanks in advance.
i saw Felix decided to use Lorenzo's approach.
The patches 1,3,5 applied on today's next fixed only the warning and wifi is still broken (authentication timeout).
Here are the logs for
multi_v7_defconfig:
https://gist.github.com/lategoodbye/0a7c5cea7dbf25d0de7944c05d229d79
It would be interesting why urb->num_sgs = 0 & urb->sg cause the troubles. This is how usb_sg_init() submit urbs for sg_tablesize = 0 controllers. So either are there are some requirement on urb->sg mapped via dma_map_page() (which mt76usb does not meet) not needed for urb->transfer_buffer mapped via dma_map_single() or there is something wrong in dwc2 with sg and this driver will not work with urb_sg_init() as well. I don't have hardware to investigate this and don't want to bother you with more patches.
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
Anyway i tested the following patch combinations against next with the same results as 1,2,3 (no wifi, alignment warning):
1,3
1,2,3,4I noticed on my setup that patch 4 can cause troubles, but still device is workable here on my PC machines.
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Btw i can confirm a regression was introduced after 4.19, because in 4.19 there was no firmware timeout but even no working wifi:
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
You ment 'no working wifi' or 'working wifi'?
Wifi is broken in 4.19, 4.20, 5.0 and next. It only worked with Lorenzo's SG avoid patches so far. Btw the regression (firmware timeout) started in 4.20. I also tested it today.
That somewhat strange because 4.19 mt76x0u does not use SG. On 4.19 there is phy calibration bug fixed in 4.19.5:
Sorry for being inprecise. I was talking about the branches not the exact tags. I tested 4.19.23 without luck.
In github link you provided someone report mt76x0u working on 4.19 with dwc_otg with disabled FIQ irq, so perhaps this is due to bug in dwc2 fixed in -next but not backported to 4.19.
Quoted 1 line
Many thanks anyway
Thanks for testing!
Stanislaw