0

I am upgrading the kernel on a platform using an ARM SOC (AT91SAM9G25) from 3.2 to 4.4. This is a sysv system. The previous 3.2 works fine, but when booting the 4.4 kernel, it hangs after the exec of /sbin/init. I can specify 'init=/bin/sh' on the U-Boot bootargs and it successfully execs the shell (I get a shell prompt). From there, things look proper; I can mount /proc, verify that the rootfs is mounted, bring up a NIC interface, etc.

I have successfully performed this upgrade on a different platform running a different ARM SOC (AT91SAM9G45). I compared the kernel configs between this working other platform and the one that hangs. The only differences are those related to the different SOCs. Kernel configuration differences follow:

300,301c300,301
< CONFIG_PLATFORM_SLK1=y
< # CONFIG_PLATFORM_SLK2 is not set
---
> # CONFIG_PLATFORM_SLK1 is not set
> CONFIG_PLATFORM_SLK2=y
421c421
< CONFIG_ARM_APPENDED_DTB_FILE="arch/arm/boot/dts/slk1.dtb"
---
> CONFIG_ARM_APPENDED_DTB_FILE="arch/arm/boot/dts/slk2.dtb"
1061c1061
< # CONFIG_MTD_M25P80 is not set
---
> CONFIG_MTD_M25P80=y
1311,1314c1311
< CONFIG_NET_VENDOR_MICREL=y
< # CONFIG_KS8842 is not set
< # CONFIG_KS8851 is not set
< # CONFIG_KS8851_MLL is not set
---
> # CONFIG_NET_VENDOR_MICREL is not set
2414c2411,2450
< # CONFIG_USB_GADGET is not set
---
> CONFIG_USB_GADGET=y
> # CONFIG_USB_GADGET_DEBUG is not set
> # CONFIG_USB_GADGET_DEBUG_FILES is not set
> # CONFIG_USB_GADGET_DEBUG_FS is not set
> CONFIG_USB_GADGET_VBUS_DRAW=2
> CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
> 
> #
> # USB Peripheral Controller
> #
> # CONFIG_USB_AT91 is not set
> CONFIG_USB_ATMEL_USBA=y
> # CONFIG_USB_FUSB300 is not set
> # CONFIG_USB_FOTG210_UDC is not set
> # CONFIG_USB_GR_UDC is not set
> # CONFIG_USB_R8A66597 is not set
> # CONFIG_USB_PXA27X is not set
> # CONFIG_USB_MV_UDC is not set
> # CONFIG_USB_MV_U3D is not set
> # CONFIG_USB_M66592 is not set
> # CONFIG_USB_BDC_UDC is not set
> # CONFIG_USB_NET2272 is not set
> # CONFIG_USB_GADGET_XILINX is not set
> # CONFIG_USB_DUMMY_HCD is not set
> # CONFIG_USB_CONFIGFS is not set
> # CONFIG_USB_ZERO is not set
> # CONFIG_USB_AUDIO is not set
> # CONFIG_USB_ETH is not set
> # CONFIG_USB_G_NCM is not set
> # CONFIG_USB_GADGETFS is not set
> # CONFIG_USB_FUNCTIONFS is not set
> # CONFIG_USB_MASS_STORAGE is not set
> # CONFIG_USB_G_SERIAL is not set
> # CONFIG_USB_MIDI_GADGET is not set
> # CONFIG_USB_G_PRINTER is not set
> # CONFIG_USB_CDC_COMPOSITE is not set
> # CONFIG_USB_G_ACM_MS is not set
> # CONFIG_USB_G_MULTI is not set
> # CONFIG_USB_G_HID is not set
> # CONFIG_USB_G_DBGP is not set
2584,2585c2620,2621
< # CONFIG_RTC_DRV_AT91RM9200 is not set
< CONFIG_RTC_DRV_AT91SAM9=y
---
> CONFIG_RTC_DRV_AT91RM9200=y
> # CONFIG_RTC_DRV_AT91SAM9 is not set
2599c2635
< # CONFIG_AT_HDMAC is not set
---
> CONFIG_AT_HDMAC=y
3058c3094
< CONFIG_DEBUG_UART_PHYS=0xffffee00
---
> CONFIG_DEBUG_UART_PHYS=0xfffff200

If I boot to a shell (with init=/bin/sh), I can run '/sbin/init -i' and the system boots normally (init has a PID other than 1). However, 'exec /sbin/init' or 'exec /sbin/init -i' hang.

Any ideas on how to figure out where init is hung?

  • 1
    please add to the question hw used and modifications to configurations done. – Rui F Ribeiro Jul 17 '17 at 20:48
0

I think I have found the cause of this kernel hang. The atmel_serial driver is disabling the UART transmitter when init closes the console device (/dev/console). The next printk from the kernel then hangs, busy waiting for the THR to be empty. This bug has been fixed in the upstream 4.4-at91 branch (https://github.com/linux4sam/linux-at91/commit/0a1757cfa5ba3b46f6ee7a74ddb7a5c0bd5d7c2f)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.