You are not logged in.
I've successfully used an IR remote (DVBSky T9580 V3) for the past years to control my HTPC but since kernel 5.1 (tried 5.1.2 and latest 5.1.4) it suddenly stopped working. As soon as I roll back to kernel 5.0.11 the remote works again. I have the latest lirc 0.10.1 installed with additional devinput support (because of https://bugs.archlinux.org/task/58238).
Unfortunately there are no obvious error messages which would explain what's going wrong. Neither
ir-keytable -t
nor
irw
capture any remote button events. I've tried it with both lircd service running and stopped.
Comparing the output of ir-keytable it seems that with kernel 5.1 there was something added (supported and enabled kernel protocols changed).
Kernel 5.0.11
$ sudo ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event17) with:
Name: IR (DVBSky T9580 V3)
Driver: SMI_PCIe, table: rc-dvbsky
LIRC device: /dev/lirc0
Supported kernel protocols:
Enabled kernel protocols:
bus: 1, vendor/product: 4254:5580, version: 0x0001
Repeat delay = 500 ms, repeat period = 125 ms
Kernel 5.1.4
$ sudo ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event17) with:
Name: IR (DVBSky T9580 V3)
Driver: SMI_PCIe, table: rc-dvbsky
LIRC device: /dev/lirc0
Supported kernel protocols: other lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon
Enabled kernel protocols: lirc rc-5
bus: 1, vendor/product: 4254:5580, version: 0x0001
Repeat delay = 500 ms, repeat period = 125 ms
I'm not sure how to further tackle this problem as I couldn't find any error messages. Any suggestions?
Offline
I've created a kernel bug report (https://bugzilla.kernel.org/show_bug.cgi?id=204317) in hopes to get this resolved...
Offline
Hello, I have a similar case with actual kernel 5.10. With kernel 5.9.14 my nec remote and my sony remote on a media-PC worked fine. Sine update to kernel 5.10.4 and later 5.10.5-arch1-1 the scancodes are not more detected well. Module serial_ir loads, but when I check the received codes with
ir-keytable -t
the received sacncode is always 0x00 for each pressed key. Same problem with my media PC. I use a self built receiver, detected as type home-brew.
I have here also a dvbsky remote from a dvbsky S960. When I switch the protocol to rc-5 and test it with
ir-keytable -c -p rc5 -t
then nothing is receiving. I'm sure, no.. I know that with kernel 5.9.14 it was also working well. I'm searching now sind days for a solution, but found no one till yet.
So, I have similat problem as you. Do you have found a solution in the meantime?
By the way, my ir-keytable output is:
$ ir-keytable
/sys/class/rc/rc0/ gefunden mit:
Name: Serial IR type home-brew
Treiber serial_ir
Standardschlüsselcodeabbildung: rc-rc6-mce
Eingabegerät: /dev/input/event13
Linux-Infrarotfernbedienung : /dev/lirc0
unterstützte Kernelprotokolle: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon rc-mm
Aktivierte Kernelprotokolle: lirc rc-5
bus: 25, Anbieter/Produkt: 0001:0001, Version: 0x0100
Wiederholungsverzögerung = 500 ms, Wiederholungsperiode = 125 ms
Offline
Do you have found a solution in the meantime?
Unfortunately no, I'm still stuck on kernel 5.0 to have a working remote... I just quickly tested it again with kernels 5.9.14 and 5.10.6 but no luck...
Keep me posted if you find a solution!
Offline
Somewhat dated instructions to bisect between 5.0 and 5.1 to locate the cause. They may fail due to tool chain changes e.t.c..
If they do fail please post the output from the failure.
The following assumes the base-devel group and git are installed and I recomend enabling Makepkg#Parallel_compilation to reduce build times
$ git clone git://git.archlinux.org/svntogit/packages.git --single-branch --branch "packages/linux"
$ cd packages/trunk
$ git checkout db9609721c9fc71343c17c9e460cc1f613ed1795 #5.0.13.arch1-1
$ cd ../..
$ cp -r packages/trunk linux-git
$ rm -rf packages
$ cd linux-git
# Edit replace the PKGBUILD and 90-linux.hook with the ones below
$ makepkg -rsi #this is to confirm 5.0 as built on your system does not have the issue update bootloader for new kernel if needed
$ cd linux-git/src/linux
$ git checkout v5.1
$ cd ../..
$ makepkg -ersi #this is to confirm 5.1 as built on your system does have the issue select the default option for all prompted options
$ cd linux-git/src/linux/
$ git bisect start
$ git bisect good v5.0
$ git bisect bad v5.1
$ cd ../..
$ makepkg -ersif
$ cd linux-git/src/linux/
$ git bisect $result #substitue good or bad here
$ cd ../..
$ makepkg -ersif #repeat these four lines and test the generated kernel until git has found the bad commit
PKGBUILD
# 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=4.20.r0.g8fe28cb58bcb
pkgrel=1
arch=('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=v5.0'
#'git+https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git#tag=X.X.Y'
'config' # the main kernel config file
'60-linux.hook' # pacman hook for depmod
'90-linux.hook' # pacman hook for initramfs regeneration
'linux.preset' # standard config files for mkinitcpio ramdisk
)
sha256sums=('SKIP'
'5eb7fb6aa90386735e5d8ee9528e82e12ba89875de058ffa4bf0a844ae055d58'
'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
'75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65')
_kernelname=${pkgbase#linux}
: ${_kernelname:=-ARCH}
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 .config
# set localversion to git commit
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
sed -i "s|^.*CONFIG_LOCALVERSION_AUTO.*|CONFIG_LOCALVERSION_AUTO=y|" ./.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 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')
backup=("etc/mkinitcpio.d/${pkgbase}.preset")
install=linux.install
cd ${_srcname}
# get kernel version
_kernver="$(make kernelrelease)"
_kernver=${_kernver%-dirty} #https://bbs.archlinux.org/viewtopic.php?id=236702
_basekernel="$(make kernelversion)"
_basekernel=${_basekernel%.*}
mkdir -p "${pkgdir}"/{boot,usr/lib/modules}
make INSTALL_MOD_PATH="${pkgdir}/usr" modules_install
cp arch/x86/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
# make room for external modules
local _extramodules="extramodules-${_basekernel}${_kernelname}"
ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from hook
echo "${_kernver}" |
install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"
# remove build and source links
rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
# now we call depmod...
depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"
# add vmlinux
install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/build" -m644 vmlinux
# sed expression for following substitutions
local _subst="
s|%PKGBASE%|${pkgbase}|g
s|%KERNVER%|${_kernver}|g
s|%EXTRAMODULES%|${_extramodules}|g
"
# hack to allow specifying an initially nonexisting install file
sed "${_subst}" "${startdir}/${install}" > "${startdir}/${install}.pkg"
true && install=${install}.pkg
# install mkinitcpio preset file
sed "${_subst}" ../linux.preset |
install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
# install pacman hooks
sed "${_subst}" ../60-linux.hook |
install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/60-${pkgbase}.hook"
sed "${_subst}" ../90-linux.hook |
install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook"
}
_package-headers() {
pkgdesc="Header files and scripts for building modules for Linux kernel (git version)"
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/x86" -m644 arch/x86/Makefile
install -Dt "${_builddir}/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
cp -t "${_builddir}/arch/x86" -a arch/x86/include
install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h
# http://bugs.archlinux.org/task/13146
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
install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool
# remove unneeded architectures
local _arch
for _arch in "${_builddir}"/arch/*/; do
[[ ${_arch} == */x86/ ]] && continue
rm -r "${_arch}"
done
# remove files already in linux-docs package
rm -r "${_builddir}/Documentation"
# remove now broken symlinks
find -L "${_builddir}" -type l -printf 'Removing %P\n' -delete
# 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)"
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:
90-linux.hook
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Target = boot/vmlinuz-%PKGBASE%
Target = usr/lib/initcpio/*
[Action]
Description = Updating %PKGBASE% initcpios...
When = PostTransaction
Exec = /usr/bin/mkinitcpio -p %PKGBASE%
Offline
I found that in the new kernel, where it does not work, rc_core was not loaded:
lsmod | grep rc_core
An there was also no /lib/modules/5.10.6-arch1-1-custom/kernel/drivers/media/rc/rc-core.ko.xz
So I compiled the kernel 5.10.6-arch1-1 new. I have seen in the .config, that rc_core is configured with Y... but it is not loading. I changed it to M, that rc_core is compile as an module.
The result was that rc_core is now loading. I tried different remotes and different loaded decoders with no positive effect. Remote-scancodes are not decoded and/or detected by ir-keytable/serial_ir. Something another is reponsible fot the problem... hm..
I have here not three remotes which worked find in the past: a nec, a sony and a rc-5.
So, no solution. It looks for me as a bug in the kernel or some module. At the moment i have no more ideas what I can compare.
Offline
Somewhat dated instructions to bisect between 5.0 and 5.1 to locate the cause. They may fail due to tool chain changes e.t.c..
If they do fail please post the output from the failure.
Thanks for your help! I tried building 5.0.13 but I'm getting the following failure:
/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x20): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [scripts/Makefile.host:99: scripts/dtc/dtc] Error 1
make: *** [Makefile:1238: scripts_dtc] Error 2
==> ERROR: A failure occurred in prepare().
Aborting...
I've also taken a look at the commit of 5.1 and noticed that a new infrared module was added (CONFIG_IR_RCMM_DECODER=m) in commit d706a3e8a2deddc677303b029c5df81378948f75. I'm pretty sure that this could be causing my problems. It is still part of the current kernel according to https://cateee.net/lkddb/web-lkddb/IR_RCMM_DECODER.html.
This (https://github.com/torvalds/linux/commi … 00f490d8ec) seems to be the original commit that added the functionality.
I'm no expert at all with this kernel stuff. What are my options? Can I blacklist the ir-rcmm-decoder? Of course the best solution would be to have the root cause fixed but I'm afraid that is beyond my current skill level...
Offline
You can use lsmod to see if ir-rcmm-decoder is loaded, if it is you could as a test blacklist on the commandline the module.
If you do need to bisect the kernel to locate the cause it looks like an older compiler would be needed. That can be discussed in more detail if needed.
Offline
You can use lsmod to see if ir-rcmm-decoder is loaded, if it is you could as a test blacklist on the commandline the module.
If you do need to bisect the kernel to locate the cause it looks like an older compiler would be needed. That can be discussed in more detail if needed.
Well, I think I need to bisect the kernel as ir-rcmm-decoder is not loaded.
I played around a little with blacklisting kernel modules and interestingly was able to receive events when blacklisting the cec module with kernel 5.9.14. Unfortunately cec seems to be needed by the Intel Graphics i915 kernel module so this is not a solution...
Offline
I checked the following builds on my system
Install gcc9 and gcc9-libs from the ALA as it is no longer packaged, to save building it:
pacman -U https://archive.archlinux.org/packages/g/gcc9-libs/gcc9-libs-9.3.0-4-x86_64.pkg.tar.zst https://archive.archlinux.org/packages/g/gcc9/gcc9-9.3.0-4-x86_64.pkg.tar.zst
Update the PKGBUILD to following
# 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=5.0.r0.g1c163f4c7b3f
pkgrel=1
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL2')
makedepends=('kmod' 'inetutils' 'bc' 'libelf' 'gcc9')
options=('!strip')
source=('git+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git#tag=v5.0'
#'git+https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git#tag=X.X.Y'
'config' # the main kernel config file
'60-linux.hook' # pacman hook for depmod
'90-linux.hook' # pacman hook for initramfs regeneration
'linux.preset' # standard config files for mkinitcpio ramdisk
)
sha256sums=('SKIP'
'5eb7fb6aa90386735e5d8ee9528e82e12ba89875de058ffa4bf0a844ae055d58'
'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
'75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65')
_kernelname=${pkgbase#linux}
: ${_kernelname:=-ARCH}
pkgver() {
cd "${_srcname}"
git describe --long | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g;s/\.rc/rc/'
}
prepare() {
mkdir -p bin
cd bin
ln -s /usr/bin/gcc-9 gcc
cd ..
export PATH="$PWD/bin:$PATH"
cd ${_srcname}
cp -Tf ../config .config
# set localversion to git commit
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
sed -i "s|^.*CONFIG_LOCALVERSION_AUTO.*|CONFIG_LOCALVERSION_AUTO=y|" ./.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() {
export PATH="$PWD/bin:$PATH"
cd ${_srcname}
make 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')
backup=("etc/mkinitcpio.d/${pkgbase}.preset")
install=linux.install
cd ${_srcname}
# get kernel version
_kernver="$(make kernelrelease)"
_kernver=${_kernver%-dirty} #https://bbs.archlinux.org/viewtopic.php?id=236702
_basekernel="$(make kernelversion)"
_basekernel=${_basekernel%.*}
mkdir -p "${pkgdir}"/{boot,usr/lib/modules}
make INSTALL_MOD_PATH="${pkgdir}/usr" modules_install
cp arch/x86/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
# make room for external modules
local _extramodules="extramodules-${_basekernel}${_kernelname}"
ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from hook
echo "${_kernver}" |
install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"
# remove build and source links
rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
# now we call depmod...
depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"
# add vmlinux
install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/build" -m644 vmlinux
# sed expression for following substitutions
local _subst="
s|%PKGBASE%|${pkgbase}|g
s|%KERNVER%|${_kernver}|g
s|%EXTRAMODULES%|${_extramodules}|g
"
# hack to allow specifying an initially nonexisting install file
sed "${_subst}" "${startdir}/${install}" > "${startdir}/${install}.pkg"
true && install=${install}.pkg
# install mkinitcpio preset file
sed "${_subst}" ../linux.preset |
install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
# install pacman hooks
sed "${_subst}" ../60-linux.hook |
install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/60-${pkgbase}.hook"
sed "${_subst}" ../90-linux.hook |
install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook"
}
_package-headers() {
pkgdesc="Header files and scripts for building modules for Linux kernel (git version)"
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/x86" -m644 arch/x86/Makefile
install -Dt "${_builddir}/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
cp -t "${_builddir}/arch/x86" -a arch/x86/include
install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h
# http://bugs.archlinux.org/task/13146
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
install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool
# remove unneeded architectures
local _arch
for _arch in "${_builddir}"/arch/*/; do
[[ ${_arch} == */x86/ ]] && continue
rm -r "${_arch}"
done
# remove files already in linux-docs package
rm -r "${_builddir}/Documentation"
# remove now broken symlinks
find -L "${_builddir}" -type l -printf 'Removing %P\n' -delete
# 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)"
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:
Easiest options then would be:
makepkg -Crsi
Clean the source directory and start over.
Offline
Why should I downgrade gcc and the kernel? Thanks for your tip, but I'm searching for a solution for an actual system.
I already tried a build with rc_core as an module. Scancodes are also not decoded well. IR-receiver is receiving when I press buttons, tested with
$ ir-ctl -r
+9060 # timeout 20465
+567 -546 +565 -561 +556 # timeout 16542
+606 -553 +572 -537 +566 # timeout 16540
+624 -513 +568 -553 +574 # timeout 16000
+579 # timeout 17661
+601 -1660 +582 # timeout 16000
+562 # timeout 17671
+626 -1637 +605 -1666 +544 -1661 +608 -1640 +606 -1666 +567 -1659 +584 -1652 +598 # timeout 16000
+576 -542 +603 # timeout 16000
+621 -557 +543 -540 +587 # timeout 16000
+625 -519 +562 -557 +588 # timeout 16000
+606 -1644 +619 # timeout 16000
+570 # timeout 16000
+612 # timeout 16000
+8999 -2254 +557 # timeout 16000
With ir-ctl -r every key is receifing fine and without delay.
But ir-keytable cannot decode it. I can press a button several times, its is only sometimes getting this, with empty scancode:
$ ir-keytable -t
Ereignisse werden getestet. Bitte drücken Sie STRG-C, um abzubrechen.
1971.008029: Linux-Infrarotfernbedienungsprotokoll(unknown): Scancode = 0x0 wiederholen
1971.008037: Ereignistyp EV_MSC(0x04): Scancode = 0x00
1971.008037: Ereignistyp EV_SYN(0x00).
And every key has the same empty scancode 0x00
Offline
Why should I downgrade gcc and the kernel?
gcc9 is a separate package to gcc so the compiler would not be downgraded. gcc9 is required to build linux 5.0 / 5.1 and that is required to locate the commit between those two points that caused the issue.
Can you reproduce the issue using linux 5.0.11? (You can obtain it from the ALA.)
Offline
obelisk wrote:Why should I downgrade gcc and the kernel?
gcc9 is a separate package to gcc so the compiler would not be downgraded. gcc9 is required to build linux 5.0 / 5.1 and that is required to locate the commit between those two points that caused the issue.
Can you reproduce the issue using linux 5.0.11? (You can obtain it from the ALA.)
I was able to build linux 5.0.13 now but I'm having difficulties actually booting to that kernel since I never had "parallel" kernel installations before... I'm using systemd-boot and trying to figure it out in the meantime but maybe you can help me out once again if you are familiar with it? This is a headless system so I would prefer a bootloader solution where I do not need to attach a keyboard to the system.
EDIT: OK, got it already. Had to change linux and initrd parameters in /boot/loader/entries/arch.conf to point to the linux-git images.
Last edited by lazlev (2021-01-12 22:57:11)
Offline
Got another question. Shouldn't I update the config file to the version from commit d706a3e8a2deddc677303b029c5df81378948f75 (aka 5.1.arch1-1) before building linux tag v5.1?
The follow-up question would then be which config do I use when actually bisecting?
Offline
No keep the config the same. You will be prompted for new config options, pick the default choice. If 5.1 works with this config then the issue is a config change.
Offline
I use another kernel than 5.1:
$ uname -r
5.10.6-arch1-1
...and the modified one, with rc_core compiled as module:
$ uname -r
5.10.6-arch1-1-custom
PS, when you use grub and you build a archlinux *pkg.tar-xz, you can install it with
pacman -U PACKETNAME.pkg.tar.xz
I have here:
$ ls linux-custom-*
linux-custom-5.10.6.arch1-1-x86_64.pkg.tar.xz linux-custom-headers-5.10.6.arch1-1-x86_64.pkg.tar.xz
$ pacman -U linux-custom*
And when it is installed, don't forget to run:
grub-mkconfig -o /boot/grub/grub.cfg
Then, at next boot the "costom" is the first in grub selection list. On second line I have the origianl kernel in extended grub menu for selection, if I want to boot the official archlinux kernel.
Offline
@obelisk perhaps you have a different issue as I understand it, you only started experiencing the issue with 5.10.Y, you do not experience the issue under 5.9.Y while lazlev is.
Offline
No keep the config the same. You will be prompted for new config options, pick the default choice. If 5.1 works with this config then the issue is a config change.
OK, I've confirmed now with the same config from 5.0.13 that kernel tag v5.1 does not work. Before I start bisecting my idea is to narrow the range down a little more by building the v5.1-rcX tags first. Should be fine, right?
Building the kernel on my system takes about an hour, so this will take a while...
Offline
You still need a known good built on your system. If you find v5.1-rc1 is bad it does not save you a bisection step, see below:
git bisect start
git bisect bad v5.1
git bisect good v5.0
Bisecting: 7074 revisions left to test after this (roughly 13 steps)
[b5dd0c658c31b469ccff1b637e5124851e7a4a1c] Merge branch 'akpm' (patches from Andrew)
git bisect bad v5.1-rc1
Bisecting: 5881 revisions left to test after this (roughly 13 steps)
[e266ca36da7de45b64b05698e98e04b578a88888] Merge tag 'staging-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Offline
Found the bad commit!
$ git -C ./src/linux bisect bad
a49a7a4635dea5b799a8f77e227ef5c648fa29ec is the first bad commit
commit a49a7a4635dea5b799a8f77e227ef5c648fa29ec
Author: Patrick Lerda <patrick9876@free.fr>
Date: Wed Jan 23 19:04:20 2019 -0500
media: smipcie: add universal ir capability
smipcie: switch to RC_DRIVER_IR_RAW.
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/pci/smipcie/smipcie-ir.c | 132 +++++++++++----------------------
drivers/media/pci/smipcie/smipcie.h | 1 -
2 files changed, 45 insertions(+), 88 deletions(-)
Offline
As a cross check here is a patch to revert that commit on top of 5.10, the original commit did not revert cleanly. Build tested only.
diff --git a/drivers/media/pci/smipcie/smipcie-ir.c b/drivers/media/pci/smipcie/smipcie-ir.c
index e6b74e161a05..99fa16b28f4b 100644
--- a/drivers/media/pci/smipcie/smipcie-ir.c
+++ b/drivers/media/pci/smipcie/smipcie-ir.c
@@ -7,9 +7,6 @@
#include "smipcie.h"
-#define SMI_SAMPLE_PERIOD 83
-#define SMI_SAMPLE_IDLEMIN (10000 / SMI_SAMPLE_PERIOD)
-
static void smi_ir_enableInterrupt(struct smi_rc *ir)
{
struct smi_dev *dev = ir->dev;
@@ -36,63 +33,114 @@ static void smi_ir_stop(struct smi_rc *ir)
struct smi_dev *dev = ir->dev;
smi_ir_disableInterrupt(ir);
- smi_clear(IR_Init_Reg, rbIRen);
+ smi_clear(IR_Init_Reg, 0x80);
}
-static void smi_raw_process(struct rc_dev *rc_dev, const u8 *buffer,
- const u8 length)
+#define BITS_PER_COMMAND 14
+#define GROUPS_PER_BIT 2
+#define IR_RC5_MIN_BIT 36
+#define IR_RC5_MAX_BIT 52
+static u32 smi_decode_rc5(u8 *pData, u8 size)
{
- struct ir_raw_event rawir = {};
- int cnt;
-
- for (cnt = 0; cnt < length; cnt++) {
- if (buffer[cnt] & 0x7f) {
- rawir.pulse = (buffer[cnt] & 0x80) == 0;
- rawir.duration = ((buffer[cnt] & 0x7f) +
- (rawir.pulse ? 0 : -1)) *
- rc_dev->rx_resolution;
- ir_raw_event_store_with_filter(rc_dev, &rawir);
+ u8 index, current_bit, bit_count;
+ u8 group_array[BITS_PER_COMMAND * GROUPS_PER_BIT + 4];
+ u8 group_index = 0;
+ u32 command = 0xFFFFFFFF;
+
+ group_array[group_index++] = 1;
+
+ for (index = 0; index < size; index++) {
+
+ current_bit = (pData[index] & 0x80) ? 1 : 0;
+ bit_count = pData[index] & 0x7f;
+
+ if ((current_bit == 1) && (bit_count >= 2*IR_RC5_MAX_BIT + 1)) {
+ goto process_code;
+ } else if ((bit_count >= IR_RC5_MIN_BIT) &&
+ (bit_count <= IR_RC5_MAX_BIT)) {
+ group_array[group_index++] = current_bit;
+ } else if ((bit_count > IR_RC5_MAX_BIT) &&
+ (bit_count <= 2*IR_RC5_MAX_BIT)) {
+ group_array[group_index++] = current_bit;
+ group_array[group_index++] = current_bit;
+ } else {
+ goto invalid_timing;
+ }
+ if (group_index >= BITS_PER_COMMAND*GROUPS_PER_BIT)
+ goto process_code;
+
+ if ((group_index == BITS_PER_COMMAND*GROUPS_PER_BIT - 1)
+ && (group_array[group_index-1] == 0)) {
+ group_array[group_index++] = 1;
+ goto process_code;
+ }
+ }
+
+process_code:
+ if (group_index == (BITS_PER_COMMAND*GROUPS_PER_BIT-1))
+ group_array[group_index++] = 1;
+
+ if (group_index == BITS_PER_COMMAND*GROUPS_PER_BIT) {
+ command = 0;
+ for (index = 0; index < (BITS_PER_COMMAND*GROUPS_PER_BIT);
+ index = index + 2) {
+ if ((group_array[index] == 1) &&
+ (group_array[index+1] == 0)) {
+ command |= (1 << (BITS_PER_COMMAND -
+ (index/2) - 1));
+ } else if ((group_array[index] == 0) &&
+ (group_array[index+1] == 1)) {
+ /* */
+ } else {
+ command = 0xFFFFFFFF;
+ goto invalid_timing;
+ }
}
}
+
+invalid_timing:
+ return command;
}
-static void smi_ir_decode(struct smi_rc *ir)
+static void smi_ir_decode(struct work_struct *work)
{
+ struct smi_rc *ir = container_of(work, struct smi_rc, work);
struct smi_dev *dev = ir->dev;
struct rc_dev *rc_dev = ir->rc_dev;
- u32 dwIRControl, dwIRData;
- u8 index, ucIRCount, readLoop;
+ u32 dwIRControl, dwIRData, dwIRCode, scancode;
+ u8 index, ucIRCount, readLoop, rc5_command, rc5_system, toggle;
dwIRControl = smi_read(IR_Init_Reg);
-
if (dwIRControl & rbIRVld) {
ucIRCount = (u8) smi_read(IR_Data_Cnt);
+ if (ucIRCount < 4)
+ goto end_ir_decode;
+
readLoop = ucIRCount/4;
if (ucIRCount % 4)
readLoop += 1;
for (index = 0; index < readLoop; index++) {
- dwIRData = smi_read(IR_DATA_BUFFER_BASE + (index * 4));
+ dwIRData = smi_read(IR_DATA_BUFFER_BASE + (index*4));
ir->irData[index*4 + 0] = (u8)(dwIRData);
ir->irData[index*4 + 1] = (u8)(dwIRData >> 8);
ir->irData[index*4 + 2] = (u8)(dwIRData >> 16);
ir->irData[index*4 + 3] = (u8)(dwIRData >> 24);
}
- smi_raw_process(rc_dev, ir->irData, ucIRCount);
- smi_set(IR_Init_Reg, rbIRVld);
- }
-
- if (dwIRControl & rbIRhighidle) {
- struct ir_raw_event rawir = {};
-
- rawir.pulse = 0;
- rawir.duration = SMI_SAMPLE_PERIOD * SMI_SAMPLE_IDLEMIN;
- ir_raw_event_store_with_filter(rc_dev, &rawir);
- smi_set(IR_Init_Reg, rbIRhighidle);
+ dwIRCode = smi_decode_rc5(ir->irData, ucIRCount);
+
+ if (dwIRCode != 0xFFFFFFFF) {
+ rc5_command = dwIRCode & 0x3F;
+ rc5_system = (dwIRCode & 0x7C0) >> 6;
+ toggle = (dwIRCode & 0x800) ? 1 : 0;
+ scancode = rc5_system << 8 | rc5_command;
+ rc_keydown(rc_dev, RC_PROTO_RC5, scancode, toggle);
+ }
}
-
- ir_raw_event_handle(rc_dev);
+end_ir_decode:
+ smi_set(IR_Init_Reg, 0x04);
+ smi_ir_enableInterrupt(ir);
}
/* ir functions call by main driver.*/
@@ -103,8 +151,7 @@ int smi_ir_irq(struct smi_rc *ir, u32 int_status)
if (int_status & IR_X_INT) {
smi_ir_disableInterrupt(ir);
smi_ir_clearInterrupt(ir);
- smi_ir_decode(ir);
- smi_ir_enableInterrupt(ir);
+ schedule_work(&ir->work);
handled = 1;
}
return handled;
@@ -114,11 +161,9 @@ void smi_ir_start(struct smi_rc *ir)
{
struct smi_dev *dev = ir->dev;
- smi_write(IR_Idle_Cnt_Low,
- (((SMI_SAMPLE_PERIOD - 1) & 0xFFFF) << 16) |
- (SMI_SAMPLE_IDLEMIN & 0xFFFF));
+ smi_write(IR_Idle_Cnt_Low, 0x00140070);
msleep(20);
- smi_set(IR_Init_Reg, rbIRen | rbIRhighidle);
+ smi_set(IR_Init_Reg, 0x90);
smi_ir_enableInterrupt(ir);
}
@@ -129,7 +174,7 @@ int smi_ir_init(struct smi_dev *dev)
struct rc_dev *rc_dev;
struct smi_rc *ir = &dev->ir;
- rc_dev = rc_allocate_device(RC_DRIVER_IR_RAW);
+ rc_dev = rc_allocate_device(RC_DRIVER_SCANCODE);
if (!rc_dev)
return -ENOMEM;
@@ -139,7 +184,6 @@ int smi_ir_init(struct smi_dev *dev)
snprintf(ir->input_phys, sizeof(ir->input_phys), "pci-%s/ir0",
pci_name(dev->pci_dev));
- rc_dev->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER;
rc_dev->driver_name = "SMI_PCIe";
rc_dev->input_phys = ir->input_phys;
rc_dev->device_name = ir->device_name;
@@ -150,12 +194,11 @@ int smi_ir_init(struct smi_dev *dev)
rc_dev->dev.parent = &dev->pci_dev->dev;
rc_dev->map_name = dev->info->rc_map;
- rc_dev->timeout = MS_TO_US(100);
- rc_dev->rx_resolution = SMI_SAMPLE_PERIOD;
ir->rc_dev = rc_dev;
ir->dev = dev;
+ INIT_WORK(&ir->work, smi_ir_decode);
smi_ir_disableInterrupt(ir);
ret = rc_register_device(rc_dev);
diff --git a/drivers/media/pci/smipcie/smipcie.h b/drivers/media/pci/smipcie/smipcie.h
index 2b5e0154814c..d010d7b2953d 100644
--- a/drivers/media/pci/smipcie/smipcie.h
+++ b/drivers/media/pci/smipcie/smipcie.h
@@ -231,6 +231,7 @@ struct smi_rc {
struct rc_dev *rc_dev;
char input_phys[64];
char device_name[64];
+ struct work_struct work;
u8 irData[256];
int users;
Offline
As a cross check here is a patch to revert that commit on top of 5.10, the original commit did not revert cleanly. Build tested only.
Building 5.10 with you patch applied fails with
DEPMOD 5.10.0-git-dirty
ln: failed to create symbolic link '/home/xyz/ABS/linux-git/pkg/linux-git/usr/lib/modules/5.10.0-git/extramodules': No such file or directory
==> ERROR: A failure occurred in package_linux-git().
It's trying to create the symlink in the wrong place...
$ ls -al ./pkg/linux-git/usr/lib/modules/
drwxr-xr-x 3 xyz xyz 4096 Jan 15 22:16 5.10.0-git-dirty
Offline
Edit:
Replaced original suggestion with a simpler fix
Remove the following from the PKGBUILD
# make room for external modules
local _extramodules="extramodules-${_basekernel}${_kernelname}"
ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from hook
echo "${_kernver}" |
install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"
or change that section to
# make room for external modules
local _extramodules="extramodules-${_basekernel}${_kernelname:--ARCH}"
install -dm755 "${pkgdir}/usr/lib/modules/$_kernver/extramodules"
ln -sT "$_kernver/extramodules" "${pkgdir}/usr/lib/modules/$_extramodules"
# add real version for building modules and running depmod from hook
echo "${_kernver}" |
install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_kernver}/extramodules/version"
then
makepkg --repackage to only redo package
Last edited by loqs (2021-01-15 22:14:39)
Offline
Got another "No such file" error from here:
# remove build and source links
rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
I got it working by commenting this line instead:
#_kernver=${_kernver%-dirty} #https://bbs.archlinux.org/viewtopic.php?id=236702
Any drawback to actually having that stuff placed in 5.10.0-git-dirty instead of 5.10.0-git?
Offline
For the headers depends on if you use them. For the modules not as long as the kernel can still find them.
Edit:
I tested applying the patch to the PKGBUILD used for Arch linux for 5.10 which is why i missed producing all these issues.
Last edited by loqs (2021-01-15 23:13:22)
Offline