Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

64 bit Kernel compile issue #3885

Closed
Dark-Sky opened this issue Oct 6, 2020 · 7 comments
Closed

64 bit Kernel compile issue #3885

Dark-Sky opened this issue Oct 6, 2020 · 7 comments

Comments

@Dark-Sky
Copy link

Dark-Sky commented Oct 6, 2020

I would change the title to reflect the kernel version but I can not see how to.

I get a compile error trying to compile 64 bit for the pi3 for kernel 5.4.69.

Compiler: aarch64-linux-gnu-gcc (GCC) 10.2.0 cross compiler
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcmrpi3_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-

  CC      drivers/usb/dwc2/core_intr.o
  LD [M]  drivers/staging/wlan-ng/prism2_usb.o
  CC      drivers/video/fbdev/core/bitblit.o
drivers/usb/dwc2/core_intr.c: In function 'dwc2_handle_usb_suspend_intr':
drivers/usb/dwc2/core_intr.c:545:31: error: 'struct dwc2_hsotg' has no member named 'gadget'
  545 |    usb_gadget_set_state(&hsotg->gadget, USB_STATE_NOTATTACHED);
      |                               ^~
make[3]: *** [scripts/Makefile.build:266: drivers/usb/dwc2/core_intr.o] Error 1
make[2]: *** [scripts/Makefile.build:500: drivers/usb/dwc2] Error 2
make[1]: *** [scripts/Makefile.build:500: drivers/usb] Error 2
make[1]: *** Waiting for unfinished jobs....

I have compiled 32bit kernels for the pi1-pi4 and they did ok. I have not gotten to the 64bit pi4 kernel yet so I do not know how it will go.

@pelwell
Copy link
Contributor

pelwell commented Oct 6, 2020

Unfortunately a recently merged patch (#3151) breaks the gadget abstraction by adding references to gadget-specific state into the mainline code. I tried replacing the original call_gadget(hsotg, suspend); with call_gadget(hsotg, disconnect); (which also sets lx_state to DWC2_L3 and sets the gadget state to USB_STATE_NOTATTACHED), but that didn't recover when the device was reconnected.

Any ideas, @sn00pster and @mdevaev?

pelwell added a commit that referenced this issue Oct 6, 2020
This reverts commit c397485.

See: #3885

Signed-off-by: Phil Elwell <[email protected]>
@pelwell
Copy link
Contributor

pelwell commented Oct 6, 2020

I've reverted c397485 in the meantime.

@Dark-Sky
Copy link
Author

Dark-Sky commented Oct 6, 2020

Thanks @pelwell That fixed my issue here.

I will leave it up to you to close this issue as it looks like other related things are going on.

@mdevaev
Copy link
Contributor

mdevaev commented Oct 6, 2020

@pelwell Thank you for letting me know about the revert. I've skimmed the code and maybe (I haven't tested it yet, I'll do it in the next few hours) that the correct way is to use dwc2_hsotg_disconnect():

void dwc2_hsotg_disconnect(struct dwc2_hsotg *hsotg)

As far as I can see, this function sets DWC2_L3, switches the state to USB_STATE_NOTATTACHED, but also additionally calls call_gadget() and kills requests to the device. This is probably how it should work. But I'm not a USB expert.

@fizzyade (@sn00pster), why did you remove call_gadget() in your patch #3151, and not add it by changing DWC2_L3 and USB_STATE_NOTATTACHED? Also why not dwc2_hsotg_disconnect()?

@mdevaev
Copy link
Contributor

mdevaev commented Oct 7, 2020

Continued here to avoid offtop

popcornmix added a commit to raspberrypi/firmware that referenced this issue Oct 7, 2020
kernel: configs: Add MEMCG_SWAP support initially disabled
See: raspberrypi/linux#3886

kernel: configs: Restore SND_PCM_OSS=m
See: raspberrypi/linux#3883

kernel: overlays: Add sd3078 to the i2c-rtc overlay
kernel: configs: Add CONFIG_RTC_DRV_SD3078=m
See: raspberrypi/linux#3881

kernel: Revert usb/dwc2: Set correct state on gadget disconnect
See: raspberrypi/linux#3885
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Oct 7, 2020
kernel: configs: Add MEMCG_SWAP support initially disabled
See: raspberrypi/linux#3886

kernel: configs: Restore SND_PCM_OSS=m
See: raspberrypi/linux#3883

kernel: overlays: Add sd3078 to the i2c-rtc overlay
kernel: configs: Add CONFIG_RTC_DRV_SD3078=m
See: raspberrypi/linux#3881

kernel: Revert usb/dwc2: Set correct state on gadget disconnect
See: raspberrypi/linux#3885
pelwell added a commit that referenced this issue Oct 8, 2020
This reverts commit c397485.

See: #3885

Signed-off-by: Phil Elwell <[email protected]>
kraj pushed a commit to YoeDistro/meta-raspberrypi that referenced this issue Oct 8, 2020
agherzan pushed a commit to agherzan/meta-raspberrypi that referenced this issue Oct 9, 2020
@hvenev
Copy link
Contributor

hvenev commented Oct 10, 2020

Can you also revert this in 5.8?

pelwell added a commit that referenced this issue Oct 10, 2020
This reverts commit c397485.

See: #3885

Signed-off-by: Phil Elwell <[email protected]>
@pelwell
Copy link
Contributor

pelwell commented Oct 10, 2020

That's done, but once 5.9 goes final I wouldn't expect rpi-5.8.y to be maintained much longer.

popcornmix pushed a commit that referenced this issue Oct 12, 2020
popcornmix pushed a commit that referenced this issue Oct 16, 2020
popcornmix pushed a commit that referenced this issue Oct 19, 2020
popcornmix pushed a commit that referenced this issue Oct 19, 2020
agherzan pushed a commit to agherzan/meta-raspberrypi that referenced this issue Oct 21, 2020
popcornmix pushed a commit that referenced this issue Oct 29, 2020
shr-project added a commit to shr-project/meta-raspberrypi that referenced this issue Nov 3, 2020
agherzan pushed a commit to agherzan/meta-raspberrypi that referenced this issue Nov 3, 2020
popcornmix pushed a commit that referenced this issue Nov 4, 2020
popcornmix pushed a commit that referenced this issue Nov 4, 2020
agherzan pushed a commit to agherzan/meta-raspberrypi that referenced this issue Nov 4, 2020
popcornmix pushed a commit that referenced this issue Nov 9, 2020
popcornmix pushed a commit that referenced this issue Nov 17, 2020
popcornmix pushed a commit that referenced this issue Nov 23, 2020
popcornmix pushed a commit that referenced this issue Nov 30, 2020
popcornmix pushed a commit that referenced this issue Dec 7, 2020
popcornmix pushed a commit that referenced this issue Dec 14, 2020
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 22, 2024
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants