You are not logged in.

#1 2017-11-02 14:40:19

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 107

[SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

Hi,
I have reported this bug for kernel 4.13.x: https://bugs.archlinux.org/task/56094

The real problem is the mouse doesn't work well. The screen never turns off (energy saving) because the mouse (or the keyboard) seems to be always active. And if I watch a video on YouTube, Netflix,... the controls are never hidden for the same reason.

The kernel 4.12.x works well.

I've asked for help to debug the error in linux-usb@vger.kernel.org mailing list and this is an answer:

If the problem started when upgrading the kernel from 4.12.x to 4.13.x
then I'd start looking there. As Greg said, git bisect is the best way
to find which change caused this regression.

second best way is to show me xhci traces of the this.
xhci traces can be taken with:

mount -t debugfs none /sys/kernel/debug
echo 81920 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/xhci-hcd/enable
< do whatever is needed to trigger issue>
then send me content of /sys/kernel/debug/tracing/trace

The trace is this: https://pastebin.com/apt56yGe

But now, how can I obtain a "git bisect" of that module from 4.12 to 4.13 Arch kernel?
Thanks.
Regards.

Last edited by j1simon (2017-11-10 08:18:54)

Offline

#2 2017-11-06 02:13:43

GenkiSky
Member
Registered: 2017-04-04
Posts: 82
Website

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

The "git bisect" they are referring to is to find which git commit of the kernel introduces the regression. See: https://wiki.archlinux.org/index.php/Bisecting_bugs

Offline

#3 2017-11-06 04:21:29

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 6,104

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

Post the information you have to the bug report first. If that's enough, great. If not, do the git bisect. Depending partly on your hardware, partly on luck and partly on other factors, this is not a trivial thing to do time-wise.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Corporation Wireless 8265 / 8275 | US keyboard with Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2017-11-06 14:45:50

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 107

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

ok, I have followed the guide https://wiki.archlinux.org/index.php/Bisecting_bugs :

$ git clone https://github.com/torvalds/linux
$ git bisect good v4.12
$ git bisect bad v4.13
Bisecting: 7028 revisions left to test after this (roughly 13 steps)
[ac7b75966c9c86426b55fe1c50ae148aa4571075] Merge tag 'pinctrl-v4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

And now? How can I see/send the changes  between 2 versions?

Offline

#5 2017-11-06 16:35:58

loqs
Member
Registered: 2014-03-06
Posts: 9,097

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

You are now at Bisecting_bugs#Bisecting
Rebuild and install that commit check if the issue is present report the result to git repeat the process until git informs you it has found the bad commit.
Edit:
more detailed instructions

$ cd /tmp/
$ git clone git://git.archlinux.org/svntogit/packages.git --single-branch --branch "packages/linux"
$ cd packages/
$ git log --grep=4.12
$ git checkout 062ffc628f04c0a12aa430cba27f05d74d7cc541 #commit id of the last of the 4.12 release discovered from the above log
$ cat repos/core-x86_64/PKGBUILD #check if the PKGBUILD in core is the one we want if not check testing then check trunk
$ cd #change to a directory to hold the build ditecyory
$ cp -r /tmp/packages/repos/core-x86_64/ linux-git #copy PKGBUILD to a separate direcorty to build in substitute repos/core-x86-64 for directory containing the correct PKGBUILD found previously
$ cd linux-git

Modified PKGBUILD from linux-git copy this over the PKGBUILD in linux-git

# Maintainer: Boohbah <boohbah at gmail.com>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
# Contributor: Jonathan Chan <jyc@fastmail.fm>
# Contributor: misc <tastky@gmail.com>
# Contributor: NextHendrix <cjones12 at sheffield.ac.uk>

pkgbase=linux-git
_srcname=linux
pkgver=0
pkgrel=1
arch=('i686' 'x86_64')
url="https://www.kernel.org/"
license=('GPL2')
makedepends=('kmod' 'inetutils' 'bc' 'libelf')
options=('!strip')
source=('git+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git#tag=vW.X'
        #'git+https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git#tag=vW.X.Y'
        # the main kernel config files
        'config.i686' 'config.x86_64'
        # pacman hook for initramfs regeneration
        '90-linux.hook'
        # standard config files for mkinitcpio ramdisk
        'linux.preset')

sha256sums=('SKIP')

_kernelname=${pkgbase#linux}

pkgver() {
  cd ${_srcname}

  git describe --long | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g;s/\.rc/rc/'
}

prepare() {
  cd ${_srcname}

  cp -Tf ../config.${CARCH} .config

  # set localversion to git commit
  sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-${pkgver##*.}\"|g" ./.config
  sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config

  # don't run depmod on 'make install'. We'll do this ourselves in packaging
#  git tracks scripts/depmod.sh so do not change it when using the existing source dir for bisection
#  sed -i '2iexit 0' scripts/depmod.sh

  # get kernel version
  make prepare

  # load configuration
  # Configure the kernel. Replace the line below with one of your choice.
  #make menuconfig # CLI menu for configuration
  #make nconfig # new CLI menu for configuration
  #make xconfig # X-based configuration
  #make oldconfig # using old config from previous kernel version
  make olddefconfig # old config from previous kernel, defaults for new options
  # ... or manually edit .config
}

build() {
  cd ${_srcname}

  make ${MAKEFLAGS} LOCALVERSION= bzImage modules
}

_package() {
  pkgdesc="The Linux kernel and modules (git version)"
  depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
  optdepends=('crda: to set the correct wireless channels of your country')
  provides=('linux')
  backup=("etc/mkinitcpio.d/${pkgbase}.preset")
  install=linux.install

  cd ${_srcname}

  KARCH=x86

  # get kernel version
  _kernver="$(make LOCALVERSION= kernelrelease)"
  _basekernel=${_kernver%%-*}
  _basekernel=${_basekernel%.*}

  mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
  make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
  cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"

  # set correct depmod command for install
  sed -e "s|%PKGBASE%|${pkgbase}|g;s|%KERNVER%|${_kernver}|g" \
    "${startdir}/${install}" > "${startdir}/${install}.pkg"
  true && install=${install}.pkg

  # install mkinitcpio preset file for kernel
  sed "s|%PKGBASE%|${pkgbase}|g" ../linux.preset |
    install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"

  # install pacman hook for initramfs regeneration
  sed "s|%PKGBASE%|${pkgbase}|g" ../90-linux.hook |
    install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook"

  # remove build and source links
  rm "${pkgdir}"/lib/modules/${_kernver}/{source,build}

  # remove the firmware
  rm -r "${pkgdir}/lib/firmware"

  # make room for external modules
  ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"

  # add real version for building modules and running depmod from post_install/upgrade
  echo "${_kernver}" |
    install -Dm644 /dev/stdin "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"

  # Now we call depmod...
  depmod -b "${pkgdir}" -F System.map "${_kernver}"

  # move module tree /lib -> /usr/lib
  mv -t "${pkgdir}/usr" "${pkgdir}/lib"

  # add vmlinux
  install -Dm644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"

  # add System.map
  install -D -m644 System.map "${pkgdir}/boot/System.map-${_kernver}"
}

_package-headers() {
  pkgdesc="Header files and scripts for building modules for Linux kernel (git version)"
  provides=('linux-headers')

  cd ${_srcname}
  local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"

  install -Dt "${_builddir}" -m644 Makefile .config Module.symvers
  install -Dt "${_builddir}/kernel" -m644 kernel/Makefile

  mkdir "${_builddir}/.tmp_versions"

  cp -t "${_builddir}" -a include scripts

  install -Dt "${_builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile
  install -Dt "${_builddir}/arch/${KARCH}/kernel" -m644 arch/${KARCH}/kernel/asm-offsets.s

  if [[ ${CARCH} = i686 ]]; then
    install -t "${_builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile_32.cpu
  fi

  cp -t "${_builddir}/arch/${KARCH}" -a arch/${KARCH}/include

  install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
  install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h

  # http://bugs.archlinux.org/task/9912
  install -Dt "${_builddir}/drivers/media/dvb-core" -m644 drivers/media/dvb-core/*.h

  # http://bugs.archlinux.org/task/13146
  install -Dt "${_builddir}/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/lgdt330x.h
  install -Dt "${_builddir}/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h

  # http://bugs.archlinux.org/task/20402
  install -Dt "${_builddir}/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
  install -Dt "${_builddir}/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
  install -Dt "${_builddir}/drivers/media/tuners" -m644 drivers/media/tuners/*.h

  # add xfs and shmem for aufs building
  mkdir -p "${_builddir}"/{fs/xfs,mm}

  # copy in Kconfig files
  find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \;

  # add objtool for external module building and enabled VALIDATION_STACK option
  if [[ -e tools/objtool/objtool ]]; then
    install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool
  fi

  # remove unneeded architectures
  local _arch
  for _arch in "${_builddir}"/arch/*/; do
    if [[ ${_arch} != */${KARCH}/ ]]; then
      rm -r "${_arch}"
    fi
  done

  # remove files already in linux-docs package
  rm -r "${_builddir}/Documentation"

  # Fix permissions
  chmod -R u=rwX,go=rX "${_builddir}"

  # strip scripts directory
  local _binary _strip
  while read -rd '' _binary; do
    case "$(file -bi "${_binary}")" in
      *application/x-sharedlib*)  _strip="${STRIP_SHARED}"   ;; # Libraries (.so)
      *application/x-archive*)    _strip="${STRIP_STATIC}"   ;; # Libraries (.a)
      *application/x-executable*) _strip="${STRIP_BINARIES}" ;; # Binaries
      *) continue ;;
    esac
    /usr/bin/strip ${_strip} "${_binary}"
  done < <(find "${_builddir}/scripts" -type f -perm -u+w -print0 2>/dev/null)
}

_package-docs() {
  pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel (git version)"
  provides=('linux-docs')

  cd ${_srcname}
  local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"

  mkdir -p "${_builddir}"
  cp -t "${_builddir}" -a Documentation

  # Fix permissions
  chmod -R u=rwX,go=rX "${_builddir}"
}

pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
for _p in ${pkgname[@]}; do
  eval "package_${_p}() {
    $(declare -f "_package${_p#${pkgbase}}")
    _package${_p#${pkgbase}}
  }"
done

# vim:set ts=8 sts=2 sw=2 et:

set the tag on line 17 to v4.12 in this case
I also recomend setting Makepkg#MAKEFLAGS to use all cores to reduce build time

$ updpkgsums update the checksums for the config files for v4.12 obtained earlier
$ makepkg -rsi #build and instal the package version that should work

Check that version does not have the issue

$ cd linux-git/src/linux
$ git bisect start
$ git bisect good
$ git bisect checkout v4.13
$ cd ../..
$ makepkg -rsie

Check that version does have the issue

$ cd linux-git/src/linux
$ git bisect bad
$ cd ../..
$ makepkg -rsie

Check if the version selected by git bisect has the issue or not repeat the above block substituting good or bad to inform git of the status of that commit until git locates the first bad commit.

Last edited by loqs (2017-11-06 20:56:11)

Offline

#6 2017-11-09 12:21:18

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 107

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

The problem is in Arch Linux (and derivatives) exclusively. It fails too with Manjaro but no with OpenSuse Tumbleweed.

Offline

#7 2017-11-09 14:18:57

loqs
Member
Registered: 2014-03-06
Posts: 9,097

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

j1simon wrote:

The problem is in Arch Linux (and derivatives) exclusively. It fails too with Manjaro but no with OpenSuse Tumbleweed.

The only patch the linux package applies to the the 4.13 source tarball is the stable patch.
How does an unspecified version the kernel of another distro with unknown config differences and unknown patches not being affected mean the issue is not an upstream issue?
How is your git bisection progressing?

Offline

#8 2017-11-09 16:38:02

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 107

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

loqs wrote:
j1simon wrote:

The problem is in Arch Linux (and derivatives) exclusively. It fails too with Manjaro but no with OpenSuse Tumbleweed.

The only patch the linux package applies to the the 4.13 source tarball is the stable patch.
How does an unspecified version the kernel of another distro with unknown config differences and unknown patches not being affected mean the issue is not an upstream issue?
How is your git bisection progressing?

The technical department of the store where I bought my computer has done those tests with OpenSUSE, Arch and Manjaro. All new installations on a PC like mine and with the 4.13 kernel. And Arch and Manjaro have failed.
In an email response from linux-usb@vger.kernel.org to my problem, after looking the trace:

...
The mouse is however constantly responding with 15 bytes of data,
as if it's constantly moving, sending data.

Not sure how HID devices normally behave, but my guess is that they would
respond with a NAK to the interrupt transfer if no data is pending.
....

This is the problem.

I haven't had time to do the "git bisect" yet.

Offline

#9 2017-11-09 17:57:16

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 6,104

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

j1simon wrote:
loqs wrote:
j1simon wrote:

The problem is in Arch Linux (and derivatives) exclusively. It fails too with Manjaro but no with OpenSuse Tumbleweed.

The only patch the linux package applies to the the 4.13 source tarball is the stable patch.
How does an unspecified version the kernel of another distro with unknown config differences and unknown patches not being affected mean the issue is not an upstream issue?
How is your git bisection progressing?

The technical department of the store where I bought my computer has done those tests with OpenSUSE, Arch and Manjaro. All new installations on a PC like mine and with the 4.13 kernel. And Arch and Manjaro have failed.

Which tests?


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Corporation Wireless 8265 / 8275 | US keyboard with Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2017-11-09 18:28:14

loqs
Member
Registered: 2014-03-06
Posts: 9,097

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

Does the system have the module input_polldev loaded?
Edit:
As you are swapping between kernels did you try manjaro's 4.14rc8?
As kernel building can take between minutes and hours depending on available resources and you need two initial builds plus at least thirteen bisect builds
on a slow machine you might need to leave it building overnight add in additional steps for points where the build does not boot etc and worse case
could be between two weeks and a month excluding the possibility a bad enough mistake is made the bisect has to be restarted so the sooner you start
the sooner you can get a result back to upstream.

Last edited by loqs (2017-11-09 21:37:21)

Offline

#11 2017-11-10 07:59:00

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 107

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

cfr wrote:
j1simon wrote:

The technical department of the store where I bought my computer has done those tests with OpenSUSE, Arch and Manjaro. All new installations on a PC like mine and with the 4.13 kernel. And Arch and Manjaro have failed.

Which tests?

Then simply make a new installation on a machine with the same hardware as mine, upgrade the system to the latest "stable" versions and test the mouse/keyboard: The screen never turns off (energy saving) because the mouse/keyboard seems to be always active. The control bar is never hidden when  watch a video on YouTube, Netflix,...  In a terminal emulator with "Scrolling" : "Scroll on keystroke" activated, in a terminal continuously returns to the last line when you scroll.

Searching for "input_polldev" I've found this thread: https://bbs.archlinux.org/viewtopic.php?id=230340
@loqs, I'm going to try this now. Thanks.

Offline

#12 2017-11-10 08:18:37

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 107

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

loqs wrote:

Does the system have the module input_polldev loaded?

Thank you too much. That was the problem. I follow the advice of this thread: https://bbs.archlinux.org/viewtopic.php?id=230340 and now it works well:

$ cat /etc/modprobe.d/input_polldev.conf:
blacklist input_polldev
install input_polldev /bin/false

Offline

#13 2017-11-10 10:35:39

loqs
Member
Registered: 2014-03-06
Posts: 9,097

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

It is a pity the patch for peaq-wmi has not made it into 4.14 especially as this will be a stable series I would suggest reporting your results to linux-usb if you have not already done so.

Offline

#14 2017-11-10 11:11:35

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 107

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

loqs wrote:

It is a pity the patch for peaq-wmi has not made it into 4.14 especially as this will be a stable series I would suggest reporting your results to linux-usb if you have not already done so.

After seeing that the problem was the peaq-wmi module, I decided to make blakclist of that module instead of input_polldev:

$ cat /etc/modprobe.d/peaq_wmi.conf           
blacklist peaq_wmi

It works well too.

Yes, I'd already sent those links and results to linux-usb list.

Offline

#15 2017-11-10 11:34:14

loqs
Member
Registered: 2014-03-06
Posts: 9,097

Re: [SOLVED] xhci_hcd WARN Event TRB for slot 2 ep 8 with no TDs queued?

Looking in http://download.opensuse.org/repositori … ndard/src/ kernel-source-4.13.12-2.1.g9151c66.src.rpm contains patches.fixes.tar.bz2 which contains
platform-x86-peaq-wmi-Add-DMI-check-before-binding the contents of which is the same as https://bugzilla.redhat.com/attachment.cgi?id=1334860
so it is the custom patch fedora and suse are using that allows those kernels to work.

Offline

Board footer

Powered by FluxBB