Skip to content

Commit

Permalink
dwc_otg: Avoid the use of align_buf for short packets
Browse files Browse the repository at this point in the history
Recent kernels (from 6.5) fail to boot on Pi0-3.

This has been tracked down to the call to:
ret = usb_get_std_status(hdev, USB_RECIP_DEVICE, 0, &hubstatus);

returning garbage in hubstatus (it gets the uninitialised contents of
a kmalloc buffer that is not overwritten as expected).

As we don't have strong evidence that this code path has ever worked,
and it is causing a clear problem currently, lets disable it to
allow wider use of newer kernels.

Signed-off-by: Dom Cobley <[email protected]>
  • Loading branch information
popcornmix committed Dec 8, 2023
1 parent 8bbbe1c commit 257b207
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/host/dwc_otg/dwc_otg_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,8 +1339,10 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh)
* buffer.
*/
wLength = ((uint16_t *)urb->setup_packet)[3];
#if 0
if (hc->ep_is_in && wLength < 4)
ptr = hc->xfer_buff;
#endif

hc->data_pid_start = qtd->data_toggle;
break;
Expand Down

0 comments on commit 257b207

Please sign in to comment.