[Kernel-packages] [Bug 1763594] Re: xhci hangs; reset results in NULL pointer dereference

2018-07-22 Thread Claudius Thomas
Verified this on a Thinkpad X230 with lastest Ubuntu 18.04/Linux Mint 19 kernel 
and Archlinux (4.17.8-1-ARCH).
For me, however, the symtoms are a bit different:

After boot and after device being removed, devices are not recognized
anymore wehn plugged in.

"xhci_hcd :00:14.0: HC died; cleaning up" is in the logs.

sudo bash -c 'cd /sys/bus/pci/drivers/xhci_hcd; for d in :??:??.? ; do echo 
-n "$d" > unbind; echo -n "$d" > bind; done'
fixes this - but only once.

Kernel parameters 'pci=nomsi iommu=soft' do not fix this (iommu=soft is default 
anyways).
However, "usbcore.autosuspend=-1" does seem to fix the issue.

Haven't had the chance to try out the new kernel so far...

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-oem in Ubuntu.
https://bugs.launchpad.net/bugs/1763594

Title:
  xhci hangs; reset results in NULL pointer dereference

Status in HWE Next:
  New
Status in linux package in Ubuntu:
  Incomplete
Status in linux-oem package in Ubuntu:
  Confirmed
Status in linux source package in Bionic:
  Incomplete
Status in linux-oem source package in Bionic:
  Fix Released
Status in linux package in Arch Linux:
  New

Bug description:
  ===SRU Justification===
  [Impact]
  xHC stops to work after some time. This happens when the xHC gets
  runtime resumed/suspended constantly.

  [Test]
  User reports this backport fixes the issue.

  [Fix]
  In addition to check EINT, also check ports' status.

  [Regression Potential]
  Low. It fixes a known bug and it's in -stable.

  ===Original Bug Report===

  Now and then, my xhci bus will hang, resulting in these kinds of
  messages in dmesg:

  [252220.002102] xhci_hcd :00:14.0: xHC is not running.
  [252220.037491] xhci_hcd :00:14.0: xHCI host controller not responding, 
assume dead
  [252220.037500] xhci_hcd :00:14.0: HC died; cleaning up
  [252220.133794] usb 1-2: USB disconnect, device number 2
  [252220.135042] usb 1-7: USB disconnect, device number 3
  [252220.137455] usb 1-8: USB disconnect, device number 4
  [252220.243317] usb 1-9: USB disconnect, device number 5

  Usually, I can fix this bij resetting the bus by calling a script
  reset-xhci:

  for xhci in /sys/bus/pci/drivers/?hci_hcd ; do
    cd $xhci
    echo Resetting devices from $xhci...
    for i in :??:??.? ; do
  echo -n "$i" > unbind
  echo -n "$i" > bind
    done
  done

  But doing this today resulted in a kernel bug:

  [252243.401814] xhci_hcd :00:14.0: remove, state 4
  [252243.401887] usb usb2: USB disconnect, device number 1
  [252243.470365] xhci_hcd :00:14.0: USB bus 2 deregistered
  [252243.470378] xhci_hcd :00:14.0: remove, state 4
  [252243.470383] usb usb1: USB disconnect, device number 1
  [252243.470831] xhci_hcd :00:14.0: Host halt failed, -19
  [252243.470837] xhci_hcd :00:14.0: Host not accessible, reset failed.
  [252243.475918] xhci_hcd :00:14.0: USB bus 1 deregistered
  [252243.475938] [ cut here ]
  [252243.475939] xhci_hcd :00:14.0: disabling already-disabled device
  [252243.475951] WARNING: CPU: 2 PID: 1787 at 
/build/linux-bdpCf2/linux-4.15.0/drivers/pci/pci.c:1642 
pci_disable_device+0x9c/0xc0
  [252243.475951] Modules linked in: cpuid snd_seq_dummy usb_storage 
hid_generic hidp ip6t_REJECT nf_reject_ipv6 ip6table_nat nf_nat_ipv6 
ip6table_mangle xt_hashlimit ip6table_raw nf_conntrack_ipv6 nf_defrag_ipv6 
nf_log_ipv6 xt_recent xt_comment ipt_REJECT nf_reject_ipv4 xt_mark 
iptable_mangle xt_tcpudp xt_CT iptable_raw xt_multiport xt_NFLOG nfnetlink_log 
nf_log_ipv4 nf_log_common xt_LOG nf_conntrack_sane nf_conntrack_netlink 
nfnetlink nf_nat_tftp nf_nat_snmp_basic nf_conntrack_snmp nf_nat_sip 
nf_nat_pptp nf_nat_proto_gre nf_nat_irc nf_nat_h323 nf_nat_ftp nf_nat_amanda 
nf_conntrack_tftp nf_conntrack_sip nf_conntrack_pptp nf_conntrack_proto_gre 
nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_irc 
nf_conntrack_h323 nf_conntrack_ftp ts_kmp nf_conntrack_amanda ipt_MASQUERADE 
nf_nat_masquerade_ipv4
  [252243.475984]  xfrm_user xfrm_algo iptable_nat nf_conntrack_ipv4 
nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype xt_conntrack nf_nat nf_conntrack 
br_netfilter aufs vhost_net vhost tap ccm rfcomm bridge stp llc devlink 
ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter msr cmac bnep 
binfmt_misc snd_hda_codec_hdmi nls_iso8859_1 arc4 snd_soc_skl 
snd_hda_codec_realtek snd_soc_skl_ipc snd_hda_ext_core snd_hda_codec_generic 
snd_soc_sst_dsp snd_soc_sst_ipc snd_soc_acpi snd_soc_core snd_compress ac97_bus 
snd_pcm_dmaengine snd_hda_intel dell_laptop dell_smbios_smm dcdbas 
snd_hda_codec dell_smm_hwmon snd_hda_core snd_hwdep snd_pcm intel_rapl 
snd_seq_midi snd_seq_midi_event x86_pkg_temp_thermal intel_powerclamp coretemp 
snd_rawmidi kvm_intel kvm btusb irqbypass intel_cstate intel_rapl_perf snd_seq 
btrtl
  [252243.476023]  iwlmvm btbcm btintel mac80211 hid_multitouch uvcvideo joydev 
input_leds 

[Kernel-packages] [Bug 1763594] Re: xhci hangs; reset results in NULL pointer dereference

2018-07-21 Thread Claudius Thomas
** Tags added: kernel-bug-exists-upstream

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-oem in Ubuntu.
https://bugs.launchpad.net/bugs/1763594

Title:
  xhci hangs; reset results in NULL pointer dereference

Status in HWE Next:
  New
Status in linux package in Ubuntu:
  Incomplete
Status in linux-oem package in Ubuntu:
  Confirmed
Status in linux source package in Bionic:
  Incomplete
Status in linux-oem source package in Bionic:
  Fix Released
Status in linux package in Arch Linux:
  New

Bug description:
  ===SRU Justification===
  [Impact]
  xHC stops to work after some time. This happens when the xHC gets
  runtime resumed/suspended constantly.

  [Test]
  User reports this backport fixes the issue.

  [Fix]
  In addition to check EINT, also check ports' status.

  [Regression Potential]
  Low. It fixes a known bug and it's in -stable.

  ===Original Bug Report===

  Now and then, my xhci bus will hang, resulting in these kinds of
  messages in dmesg:

  [252220.002102] xhci_hcd :00:14.0: xHC is not running.
  [252220.037491] xhci_hcd :00:14.0: xHCI host controller not responding, 
assume dead
  [252220.037500] xhci_hcd :00:14.0: HC died; cleaning up
  [252220.133794] usb 1-2: USB disconnect, device number 2
  [252220.135042] usb 1-7: USB disconnect, device number 3
  [252220.137455] usb 1-8: USB disconnect, device number 4
  [252220.243317] usb 1-9: USB disconnect, device number 5

  Usually, I can fix this bij resetting the bus by calling a script
  reset-xhci:

  for xhci in /sys/bus/pci/drivers/?hci_hcd ; do
    cd $xhci
    echo Resetting devices from $xhci...
    for i in :??:??.? ; do
  echo -n "$i" > unbind
  echo -n "$i" > bind
    done
  done

  But doing this today resulted in a kernel bug:

  [252243.401814] xhci_hcd :00:14.0: remove, state 4
  [252243.401887] usb usb2: USB disconnect, device number 1
  [252243.470365] xhci_hcd :00:14.0: USB bus 2 deregistered
  [252243.470378] xhci_hcd :00:14.0: remove, state 4
  [252243.470383] usb usb1: USB disconnect, device number 1
  [252243.470831] xhci_hcd :00:14.0: Host halt failed, -19
  [252243.470837] xhci_hcd :00:14.0: Host not accessible, reset failed.
  [252243.475918] xhci_hcd :00:14.0: USB bus 1 deregistered
  [252243.475938] [ cut here ]
  [252243.475939] xhci_hcd :00:14.0: disabling already-disabled device
  [252243.475951] WARNING: CPU: 2 PID: 1787 at 
/build/linux-bdpCf2/linux-4.15.0/drivers/pci/pci.c:1642 
pci_disable_device+0x9c/0xc0
  [252243.475951] Modules linked in: cpuid snd_seq_dummy usb_storage 
hid_generic hidp ip6t_REJECT nf_reject_ipv6 ip6table_nat nf_nat_ipv6 
ip6table_mangle xt_hashlimit ip6table_raw nf_conntrack_ipv6 nf_defrag_ipv6 
nf_log_ipv6 xt_recent xt_comment ipt_REJECT nf_reject_ipv4 xt_mark 
iptable_mangle xt_tcpudp xt_CT iptable_raw xt_multiport xt_NFLOG nfnetlink_log 
nf_log_ipv4 nf_log_common xt_LOG nf_conntrack_sane nf_conntrack_netlink 
nfnetlink nf_nat_tftp nf_nat_snmp_basic nf_conntrack_snmp nf_nat_sip 
nf_nat_pptp nf_nat_proto_gre nf_nat_irc nf_nat_h323 nf_nat_ftp nf_nat_amanda 
nf_conntrack_tftp nf_conntrack_sip nf_conntrack_pptp nf_conntrack_proto_gre 
nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_irc 
nf_conntrack_h323 nf_conntrack_ftp ts_kmp nf_conntrack_amanda ipt_MASQUERADE 
nf_nat_masquerade_ipv4
  [252243.475984]  xfrm_user xfrm_algo iptable_nat nf_conntrack_ipv4 
nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype xt_conntrack nf_nat nf_conntrack 
br_netfilter aufs vhost_net vhost tap ccm rfcomm bridge stp llc devlink 
ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter msr cmac bnep 
binfmt_misc snd_hda_codec_hdmi nls_iso8859_1 arc4 snd_soc_skl 
snd_hda_codec_realtek snd_soc_skl_ipc snd_hda_ext_core snd_hda_codec_generic 
snd_soc_sst_dsp snd_soc_sst_ipc snd_soc_acpi snd_soc_core snd_compress ac97_bus 
snd_pcm_dmaengine snd_hda_intel dell_laptop dell_smbios_smm dcdbas 
snd_hda_codec dell_smm_hwmon snd_hda_core snd_hwdep snd_pcm intel_rapl 
snd_seq_midi snd_seq_midi_event x86_pkg_temp_thermal intel_powerclamp coretemp 
snd_rawmidi kvm_intel kvm btusb irqbypass intel_cstate intel_rapl_perf snd_seq 
btrtl
  [252243.476023]  iwlmvm btbcm btintel mac80211 hid_multitouch uvcvideo joydev 
input_leds dell_smbios_wmi snd_seq_device dell_wmi bluetooth serio_raw 
snd_timer videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 dell_smbios 
videobuf2_core iwlwifi sparse_keymap ecdh_generic snd wmi_bmof 
dell_wmi_descriptor videodev cfg80211 media soundcore rtsx_pci_ms memstick 
shpchp mei_me mei processor_thermal_device intel_pch_thermal intel_soc_dts_iosf 
int3400_thermal acpi_thermal_rel dell_rbtn mac_hid acpi_pad int3403_thermal 
int340x_thermal_zone tpm_crb sch_fq_codel cuse parport_pc ppdev nfsd lp parport 
auth_rpcgss nfs_acl lockd grace sunrpc ip_tables x_tables autofs4 btrfs 
zstd_compress algif_skcipher af_alg dm_crypt raid10 raid456 

[Kernel-packages] [Bug 1763594] Re: xhci hangs; reset results in NULL pointer dereference

2018-07-21 Thread Claudius Thomas
** Also affects: linux (Arch Linux)
   Importance: Undecided
   Status: New

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-oem in Ubuntu.
https://bugs.launchpad.net/bugs/1763594

Title:
  xhci hangs; reset results in NULL pointer dereference

Status in HWE Next:
  New
Status in linux package in Ubuntu:
  Incomplete
Status in linux-oem package in Ubuntu:
  Confirmed
Status in linux source package in Bionic:
  Incomplete
Status in linux-oem source package in Bionic:
  Fix Released
Status in linux package in Arch Linux:
  New

Bug description:
  ===SRU Justification===
  [Impact]
  xHC stops to work after some time. This happens when the xHC gets
  runtime resumed/suspended constantly.

  [Test]
  User reports this backport fixes the issue.

  [Fix]
  In addition to check EINT, also check ports' status.

  [Regression Potential]
  Low. It fixes a known bug and it's in -stable.

  ===Original Bug Report===

  Now and then, my xhci bus will hang, resulting in these kinds of
  messages in dmesg:

  [252220.002102] xhci_hcd :00:14.0: xHC is not running.
  [252220.037491] xhci_hcd :00:14.0: xHCI host controller not responding, 
assume dead
  [252220.037500] xhci_hcd :00:14.0: HC died; cleaning up
  [252220.133794] usb 1-2: USB disconnect, device number 2
  [252220.135042] usb 1-7: USB disconnect, device number 3
  [252220.137455] usb 1-8: USB disconnect, device number 4
  [252220.243317] usb 1-9: USB disconnect, device number 5

  Usually, I can fix this bij resetting the bus by calling a script
  reset-xhci:

  for xhci in /sys/bus/pci/drivers/?hci_hcd ; do
    cd $xhci
    echo Resetting devices from $xhci...
    for i in :??:??.? ; do
  echo -n "$i" > unbind
  echo -n "$i" > bind
    done
  done

  But doing this today resulted in a kernel bug:

  [252243.401814] xhci_hcd :00:14.0: remove, state 4
  [252243.401887] usb usb2: USB disconnect, device number 1
  [252243.470365] xhci_hcd :00:14.0: USB bus 2 deregistered
  [252243.470378] xhci_hcd :00:14.0: remove, state 4
  [252243.470383] usb usb1: USB disconnect, device number 1
  [252243.470831] xhci_hcd :00:14.0: Host halt failed, -19
  [252243.470837] xhci_hcd :00:14.0: Host not accessible, reset failed.
  [252243.475918] xhci_hcd :00:14.0: USB bus 1 deregistered
  [252243.475938] [ cut here ]
  [252243.475939] xhci_hcd :00:14.0: disabling already-disabled device
  [252243.475951] WARNING: CPU: 2 PID: 1787 at 
/build/linux-bdpCf2/linux-4.15.0/drivers/pci/pci.c:1642 
pci_disable_device+0x9c/0xc0
  [252243.475951] Modules linked in: cpuid snd_seq_dummy usb_storage 
hid_generic hidp ip6t_REJECT nf_reject_ipv6 ip6table_nat nf_nat_ipv6 
ip6table_mangle xt_hashlimit ip6table_raw nf_conntrack_ipv6 nf_defrag_ipv6 
nf_log_ipv6 xt_recent xt_comment ipt_REJECT nf_reject_ipv4 xt_mark 
iptable_mangle xt_tcpudp xt_CT iptable_raw xt_multiport xt_NFLOG nfnetlink_log 
nf_log_ipv4 nf_log_common xt_LOG nf_conntrack_sane nf_conntrack_netlink 
nfnetlink nf_nat_tftp nf_nat_snmp_basic nf_conntrack_snmp nf_nat_sip 
nf_nat_pptp nf_nat_proto_gre nf_nat_irc nf_nat_h323 nf_nat_ftp nf_nat_amanda 
nf_conntrack_tftp nf_conntrack_sip nf_conntrack_pptp nf_conntrack_proto_gre 
nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_irc 
nf_conntrack_h323 nf_conntrack_ftp ts_kmp nf_conntrack_amanda ipt_MASQUERADE 
nf_nat_masquerade_ipv4
  [252243.475984]  xfrm_user xfrm_algo iptable_nat nf_conntrack_ipv4 
nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype xt_conntrack nf_nat nf_conntrack 
br_netfilter aufs vhost_net vhost tap ccm rfcomm bridge stp llc devlink 
ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter msr cmac bnep 
binfmt_misc snd_hda_codec_hdmi nls_iso8859_1 arc4 snd_soc_skl 
snd_hda_codec_realtek snd_soc_skl_ipc snd_hda_ext_core snd_hda_codec_generic 
snd_soc_sst_dsp snd_soc_sst_ipc snd_soc_acpi snd_soc_core snd_compress ac97_bus 
snd_pcm_dmaengine snd_hda_intel dell_laptop dell_smbios_smm dcdbas 
snd_hda_codec dell_smm_hwmon snd_hda_core snd_hwdep snd_pcm intel_rapl 
snd_seq_midi snd_seq_midi_event x86_pkg_temp_thermal intel_powerclamp coretemp 
snd_rawmidi kvm_intel kvm btusb irqbypass intel_cstate intel_rapl_perf snd_seq 
btrtl
  [252243.476023]  iwlmvm btbcm btintel mac80211 hid_multitouch uvcvideo joydev 
input_leds dell_smbios_wmi snd_seq_device dell_wmi bluetooth serio_raw 
snd_timer videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 dell_smbios 
videobuf2_core iwlwifi sparse_keymap ecdh_generic snd wmi_bmof 
dell_wmi_descriptor videodev cfg80211 media soundcore rtsx_pci_ms memstick 
shpchp mei_me mei processor_thermal_device intel_pch_thermal intel_soc_dts_iosf 
int3400_thermal acpi_thermal_rel dell_rbtn mac_hid acpi_pad int3403_thermal 
int340x_thermal_zone tpm_crb sch_fq_codel cuse parport_pc ppdev nfsd lp parport 
auth_rpcgss nfs_acl lockd grace sunrpc ip_tables x_tables autofs4 btrfs 
zstd_compress algif_skcipher af_alg