Subject: Re: bug#35574: bcm5974 touchpad is not recognized as touchpad

From: "pelzflorian (Florian Pelz)" <[email-masked]>
Date: Mon, 27 Apr 2020 02:28:57 +0200

On Mon, Apr 20, 2020 at 05:59:08PM +0200, pelzflorian (Florian Pelz) wrote:
> I will write and test a patch to disable the module in
> %default-extra-linux-options, like the description in linux-5.4.11
> source file drivers/hid/usbhid/Kconfig recommends:

The attached patch disables the usbmouse kernel module in the options
for linux-libre.  Otherwise, as described previously, the bcm5974
touchpad of Macbooks often erroneously gets assigned the usbmouse
kernel module instead of the bcm5974 kernel module.

Other than Macbooks, usbmouse is not used by any of my actual USB mice
and touchpads anyway (they use usbhid).  I cannot know if there are
exotic mice that need usbmouse, but Debian disables the usbmouse
module too and the description in the Linux kernel says about the
usbmouse module:
> This is almost certainly not what you want.  This is mostly
> useful for embedded applications or simple mice.

I tested the patch with linux-libre 5.4 on various x86_64 machines and
I tested 5.4, 4.19 and 4.4 on my Macbook.  I did not wait for
compilation to complete on non-Intel architectures, but I doubt the
patch causes problems.

I suppose this can go directly to master even though it requires the
linux-libre to be rebuilt?

Regards,
Florian
>From d9f9d4c34a8f4d42af3e90789267137d15d60bb9 Mon Sep 17 00:00:00 2001
From: Florian Pelz <[email-masked]>
Date: Mon, 20 Apr 2020 19:03:57 +0200
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Subject: [PATCH] gnu: linux-libre: Disable usbmouse kernel module.

This avoids a race with the bcm5974 kernel module.
Fixes <https://bugs.gnu.org/35574>.

* gnu/packages/linux.scm (%default-extra-linux-options):
Disable CONFIG_USB_MOUSE.
---
 gnu/packages/linux.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 2acbe649f0..5f2f17b31a 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -42,6 +42,7 @@
 ;;; Copyright © 2020 Pierre Neidhardt <[email-masked]>
 ;;; Copyright © 2020 Chris Marusich <[email-masked]>
 ;;; Copyright © 2020 Vincent Legoll <[email-masked]>
+;;; Copyright © 2020 Florian Pelz <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -618,7 +619,9 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
     ("CONFIG_VIRTIO_MMIO" . m)
     ("CONFIG_FUSE_FS" . m)
     ("CONFIG_CIFS" . m)
-    ("CONFIG_9P_FS" . m)))
+    ("CONFIG_9P_FS" . m)
+    ;; These modules cause trouble:
+    ("CONFIG_USB_MOUSE" . #f))) ;see <https://bugs.gnu.org/35574>
 
 (define (config->string options)
   (string-join (map (match-lambda
-- 
2.26.1