Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4182974ybp; Mon, 14 Oct 2019 00:08:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTkoAiryZcaAoJoJs2w+cyF9em1ApjhvjQJuBgiWWqd4haTzU3nD4qysR7vitF2Ou9C513 X-Received: by 2002:a50:ed0b:: with SMTP id j11mr27062793eds.50.1571036930313; Mon, 14 Oct 2019 00:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571036930; cv=none; d=google.com; s=arc-20160816; b=BTbmFIoHJimZ5xounUQcUpHXafYgja0SfY565q34pHuPWGoc3rwyubtI9MU6jV7ffr zye36A9C+jyR8dmbmWwi/GdruTLrPRs5u9LrtHVIzoCuyH4Aov+ecfZ1woIbRQzZrK8F 3ZIpOPAvP4Sqyx3w3MNSGl8DapoMjvUd2UQ70AOZr+vMAylM3GMc2G1Qxvkgy81H8y1O YFxDyUW5mdD495McluEIfiV67nZbn2lUnil8b+/NlLTv0VA1dFeKqfN3U7HecPkVRJ3p nDX1pSdu3jPCEW1IPPRtDzAONwx97WGMDBtOo5IOT7+YKRyXVQC0oNTaZy2R7HMNzqfI yvdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xcDj/VFQ6KKNr9HZ7H5PSlKT512A8eXxxKSGyEaX09w=; b=s19o32XCDFbiJrd/ZR/ra9VkSfE+VTcpB+93YVlJFkJ/AuLV2ERjxip6q9A0v5Nu8i c6FTHCU+BNC0gmKh83BrdviYNQTi2A7IKhCpvdfG0BOT2TYYzsikUP8oMAhy6IITuk4h 1GWc+48Awz8ZGjDBe2iPjK5GuC4NKAau+8P1VoiQVT1XIeN6tHvpV8O/FNLO/07nBT7Y lbIngFopdRy5RokTCn/10J86U+GvBD+07FsFpMkoZIE5MbaRloOL5p7VJs241bVxvRux lyer1KuCaJyE6Fe7UXncaPKQsEbaw5FOTJ94vh3bsgxdk+UYmu772+EoOYP90GUrPpkU Y5tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JboMloqv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y50si11760191edd.237.2019.10.14.00.08.27; Mon, 14 Oct 2019 00:08:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JboMloqv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730207AbfJNHIJ (ORCPT + 99 others); Mon, 14 Oct 2019 03:08:09 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:30362 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730076AbfJNHIJ (ORCPT ); Mon, 14 Oct 2019 03:08:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571036887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xcDj/VFQ6KKNr9HZ7H5PSlKT512A8eXxxKSGyEaX09w=; b=JboMloqvqPQteW7hiX40e4sKFpNeQZxFKBozOAoeW2tyjwRqsgGZxAIdO7Ccint+dWWR7S tZN4JiUPGa+QX8XOE7b+D0JvEmWG1XUfNPJBVQiCsM4raiIRE9KjE2WPTWwfHr6dmPmzib PPsUTHGl27XYiiIPqK0VE2Gf0SwFs64= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-206-QRKzzIZ4M8mAgx8iRBMjFA-1; Mon, 14 Oct 2019 03:08:03 -0400 Received: by mail-qk1-f200.google.com with SMTP id x77so16117947qka.11 for ; Mon, 14 Oct 2019 00:08:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=xcDj/VFQ6KKNr9HZ7H5PSlKT512A8eXxxKSGyEaX09w=; b=DEgFsqnboHTn4eS2uoJOq12OuE+pb327NRhmwYwGAYfEVCvvuRw4Em+V2IjcSUR9ry 2W1x4TRqsjBgy3M5ZwFC/IawvHgWmqgMvy+J5JVrVJDvzRBhSiAoeJBhCVYsJlsNeB8l h1S2sEa/hgOSmY0E9zLsFAHgHSHw4H4v0tIL8NDRGF0IgiHnVyfg8kICu3nnlL2lsYL2 Is9fRRsu+A5lc681N+g8lA1YmBeK3ZOanSSIRMj/sdBvzfy+HsLF+WGSNr7SWsqPNT4s BUrIMjOCdb2ReWQ/oOCny3k3AJchB15jX9+uysmpLI9gsmswR9Bp9YqnhbrLBp5WDNbJ cNlQ== X-Gm-Message-State: APjAAAW3eNkx8LaRzyHehj4kiBKC4LRTu0nVNT+8nIR95bGA+y6Lp3j1 8lGjbIiMmTO5ACnaq9qfQWxbXvtDMisuU0E/KggYsvBnzgMSsNgEL5eDAXaryYPLtCx0KDHIfUm hjj9X3KQDO8I4aWen3LjWcF2kJ6H47xz1FvdUFXLP X-Received: by 2002:a0c:8eca:: with SMTP id y10mr16311528qvb.138.1571036882965; Mon, 14 Oct 2019 00:08:02 -0700 (PDT) X-Received: by 2002:a0c:8eca:: with SMTP id y10mr16311505qvb.138.1571036882508; Mon, 14 Oct 2019 00:08:02 -0700 (PDT) MIME-Version: 1.0 References: <201910140950.uA9aSUlt%lkp@intel.com> In-Reply-To: From: Benjamin Tissoires Date: Mon, 14 Oct 2019 09:07:50 +0200 Message-ID: Subject: Re: [PATCH v5 1/2] HID: logitech: Add MX Master over Bluetooth To: Mazin Rezk Cc: kbuild test robot , "kbuild-all@lists.01.org" , "linux-input@vger.kernel.org" , "jikos@kernel.org" , "linux-kernel@vger.kernel.org" , =?UTF-8?Q?Filipe_La=C3=ADns?= X-MC-Unique: QRKzzIZ4M8mAgx8iRBMjFA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey, On Mon, Oct 14, 2019 at 6:35 AM Mazin Rezk wrote: > > On Sunday, October 13, 2019 9:28 PM, kbuild test robot wr= ote: > > > Hi Mazin, > > > > Thank you for the patch! Perhaps something to improve: > > > > [auto build test WARNING on linus/master] > > [cannot apply to v5.4-rc2 next-20191010] > > [if your patch is applied to the wrong git tree, please drop us a note = to help > > improve the system. BTW, we also suggest to use '--base' option to spec= ify the > > base tree in git format-patch, please see https://stackoverflow.com/a/3= 7406982] > > > > url: https://github.com/0day-ci/linux/commits/Mazin-Rezk/HID-logitech-A= dd-MX-Master-over-Bluetooth/20191014-071534 > > config: mips-allmodconfig (attached as .config) > > compiler: mips-linux-gcc (GCC) 7.4.0 > > reproduce: > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make= .cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # save the attached .config to linux build tree > > GCC_VERSION=3D7.4.0 make.cross ARCH=3Dmips > > > > If you fix the issue, kindly add following tag > > Reported-by: kbuild test robot lkp@intel.com > > > > All warnings (new ones prefixed by >>): > > > > In file included from include/linux/ioport.h:15:0, > > from include/linux/device.h:15, > > from drivers/hid/hid-logitech-hidpp.c:13: > > drivers/hid/hid-logitech-hidpp.c: In function 'hidpp_send_rap_command_s= ync': > > > > > > include/linux/bits.h:8:26: warning: left shift count >=3D width of = type [-Wshift-count-overflow] > > > > #define BIT(nr) (UL(1) << (nr)) > > ^ > > > > > > > > drivers/hid/hid-logitech-hidpp.c:74:43: note: in expansion of macro= 'BIT' > > > > #define HIDPP_QUIRK_MISSING_SHORT_REPORTS BIT(32) > > ^~~ > > > > > > > > drivers/hid/hid-logitech-hidpp.c:347:26: note: in expansion of macr= o 'HIDPP_QUIRK_MISSING_SHORT_REPORTS' > > > > if (hidpp_dev->quirks & HIDPP_QUIRK_MISSING_SHORT_REPORTS && > > > > ^ > > > > > > drivers/hid/hid-logitech-hidpp.c: In function 'hidpp_validate_device': > > > > > > include/linux/bits.h:8:26: warning: left shift count >=3D width of = type [-Wshift-count-overflow] > > > > #define BIT(nr) (UL(1) << (nr)) > > ^ > > > > > > > > drivers/hid/hid-logitech-hidpp.c:74:43: note: in expansion of macro= 'BIT' > > > > #define HIDPP_QUIRK_MISSING_SHORT_REPORTS BIT(32) > > ^~~ > > > > > > drivers/hid/hid-logitech-hidpp.c:3496:22: note: in expansion of macro '= HIDPP_QUIRK_MISSING_SHORT_REPORTS' > > if (hidpp->quirks & HIDPP_QUIRK_MISSING_SHORT_REPORTS) > > > > ^ > > > > > > drivers/hid/hid-logitech-hidpp.c: At top level: > > > > > > include/linux/bits.h:8:26: warning: left shift count >=3D width of = type [-Wshift-count-overflow] > > > > #define BIT(nr) (UL(1) << (nr)) > > ^ > > > > > > > > drivers/hid/hid-logitech-hidpp.c:74:43: note: in expansion of macro= 'BIT' > > > > #define HIDPP_QUIRK_MISSING_SHORT_REPORTS BIT(32) > > ^~~ > > > > > > drivers/hid/hid-logitech-hidpp.c:85:40: note: in expansion of macro 'HI= DPP_QUIRK_MISSING_SHORT_REPORTS' > > #define HIDPP_QUIRK_CLASS_BLUETOOTH_LE HIDPP_QUIRK_MISSING_SHORT_REPORT= S > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > > > drivers/hid/hid-logitech-hidpp.c:3794:5: note: in expansion of macr= o 'HIDPP_QUIRK_CLASS_BLUETOOTH_LE' > > > > HIDPP_QUIRK_CLASS_BLUETOOTH_LE }, > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > > > > > include/linux/bits.h:8:26: warning: left shift count >=3D width of = type [-Wshift-count-overflow] > > > > #define BIT(nr) (UL(1) << (nr)) > > ^ > > > > > > > > drivers/hid/hid-logitech-hidpp.c:74:43: note: in expansion of macro= 'BIT' > > > > #define HIDPP_QUIRK_MISSING_SHORT_REPORTS BIT(32) > > ^~~ > > > > > > drivers/hid/hid-logitech-hidpp.c:85:40: note: in expansion of macro 'HI= DPP_QUIRK_MISSING_SHORT_REPORTS' > > #define HIDPP_QUIRK_CLASS_BLUETOOTH_LE HIDPP_QUIRK_MISSING_SHORT_REPORT= S > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > drivers/hid/hid-logitech-hidpp.c:3797:5: note: in expansion of macro 'H= IDPP_QUIRK_CLASS_BLUETOOTH_LE' > > HIDPP_QUIRK_CLASS_BLUETOOTH_LE }, > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > -----------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------- > > > > In file included from include/linux/ioport.h:15:0, > > from include/linux/device.h:15, > > from drivers//hid/hid-logitech-hidpp.c:13: > > drivers//hid/hid-logitech-hidpp.c: In function 'hidpp_send_rap_command_= sync': > > > > > > include/linux/bits.h:8:26: warning: left shift count >=3D width of = type [-Wshift-count-overflow] > > > > #define BIT(nr) (UL(1) << (nr)) > > ^ > > > > > > drivers//hid/hid-logitech-hidpp.c:74:43: note: in expansion of macro 'B= IT' > > #define HIDPP_QUIRK_MISSING_SHORT_REPORTS BIT(32) > > ^~~ > > drivers//hid/hid-logitech-hidpp.c:347:26: note: in expansion of macro '= HIDPP_QUIRK_MISSING_SHORT_REPORTS' > > if (hidpp_dev->quirks & HIDPP_QUIRK_MISSING_SHORT_REPORTS && > > > > ^ > > > > > > drivers//hid/hid-logitech-hidpp.c: In function 'hidpp_validate_device': > > > > > > include/linux/bits.h:8:26: warning: left shift count >=3D width of = type [-Wshift-count-overflow] > > > > #define BIT(nr) (UL(1) << (nr)) > > ^ > > > > > > drivers//hid/hid-logitech-hidpp.c:74:43: note: in expansion of macro 'B= IT' > > #define HIDPP_QUIRK_MISSING_SHORT_REPORTS BIT(32) > > ^~~ > > drivers//hid/hid-logitech-hidpp.c:3496:22: note: in expansion of macro = 'HIDPP_QUIRK_MISSING_SHORT_REPORTS' > > if (hidpp->quirks & HIDPP_QUIRK_MISSING_SHORT_REPORTS) > > > > ^ > > > > > > drivers//hid/hid-logitech-hidpp.c: At top level: > > > > > > include/linux/bits.h:8:26: warning: left shift count >=3D width of = type [-Wshift-count-overflow] > > > > #define BIT(nr) (UL(1) << (nr)) > > ^ > > > > > > drivers//hid/hid-logitech-hidpp.c:74:43: note: in expansion of macro 'B= IT' > > #define HIDPP_QUIRK_MISSING_SHORT_REPORTS BIT(32) > > ^~~ > > drivers//hid/hid-logitech-hidpp.c:85:40: note: in expansion of macro 'H= IDPP_QUIRK_MISSING_SHORT_REPORTS' > > #define HIDPP_QUIRK_CLASS_BLUETOOTH_LE HIDPP_QUIRK_MISSING_SHORT_REPORT= S > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > drivers//hid/hid-logitech-hidpp.c:3794:5: note: in expansion of macro '= HIDPP_QUIRK_CLASS_BLUETOOTH_LE' > > HIDPP_QUIRK_CLASS_BLUETOOTH_LE }, > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > > > include/linux/bits.h:8:26: warning: left shift count >=3D width of = type [-Wshift-count-overflow] > > > > #define BIT(nr) (UL(1) << (nr)) > > ^ > > > > > > drivers//hid/hid-logitech-hidpp.c:74:43: note: in expansion of macro 'B= IT' > > #define HIDPP_QUIRK_MISSING_SHORT_REPORTS BIT(32) > > ^~~ > > drivers//hid/hid-logitech-hidpp.c:85:40: note: in expansion of macro 'H= IDPP_QUIRK_MISSING_SHORT_REPORTS' > > #define HIDPP_QUIRK_CLASS_BLUETOOTH_LE HIDPP_QUIRK_MISSING_SHORT_REPORT= S > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > drivers//hid/hid-logitech-hidpp.c:3797:5: note: in expansion of macro '= HIDPP_QUIRK_CLASS_BLUETOOTH_LE' > > HIDPP_QUIRK_CLASS_BLUETOOTH_LE }, > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > vim +/BIT +74 drivers/hid/hid-logitech-hidpp.c > > > > 12 > > > > > 13 #include > > > > 14 #include > > > > 15 #include > > > > 16 #include > > > > 17 #include > > > > 18 #include > > > > 19 #include > > > > 20 #include > > > > 21 #include > > > > 22 #include > > > > 23 #include > > > > 24 #include > > > > 25 #include > > > > 26 #include > > > > 27 #include "usbhid/usbhid.h" > > 28 #include "hid-ids.h" > > 29 > > 30 MODULE_LICENSE("GPL"); > > 31 MODULE_AUTHOR("Benjamin Tissoires "); > > > > 32 MODULE_AUTHOR("Nestor Lopez Casado "); > > > > 33 > > 34 static bool disable_raw_mode; > > 35 module_param(disable_raw_mode, bool, 0644); > > 36 MODULE_PARM_DESC(disable_raw_mode, > > 37 "Disable Raw mode reporting for touchpads and kee= p firmware gestures."); > > 38 > > 39 static bool disable_tap_to_click; > > 40 module_param(disable_tap_to_click, bool, 0644); > > 41 MODULE_PARM_DESC(disable_tap_to_click, > > 42 "Disable Tap-To-Click mode reporting for touchpad= s (only on the K400 currently)."); > > 43 > > 44 #define REPORT_ID_HIDPP_SHORT 0x10 > > 45 #define REPORT_ID_HIDPP_LONG 0x11 > > 46 #define REPORT_ID_HIDPP_VERY_LONG 0x12 > > 47 > > 48 #define HIDPP_REPORT_SHORT_LENGTH 7 > > 49 #define HIDPP_REPORT_LONG_LENGTH 20 > > 50 #define HIDPP_REPORT_VERY_LONG_MAX_LENGTH 64 > > 51 > > 52 #define HIDPP_SUB_ID_CONSUMER_VENDOR_KEYS 0x03 > > 53 #define HIDPP_SUB_ID_ROLLER 0x05 > > 54 #define HIDPP_SUB_ID_MOUSE_EXTRA_BTNS 0x06 > > 55 > > 56 #define HIDPP_QUIRK_CLASS_WTP BIT(0) > > 57 #define HIDPP_QUIRK_CLASS_M560 BIT(1) > > 58 #define HIDPP_QUIRK_CLASS_K400 BIT(2) > > 59 #define HIDPP_QUIRK_CLASS_G920 BIT(3) > > 60 #define HIDPP_QUIRK_CLASS_K750 BIT(4) > > 61 > > 62 /* bits 2..20 are reserved for classes */ > > 63 /* #define HIDPP_QUIRK_CONNECT_EVENTS BIT(21) d= isabled */ > > 64 #define HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS BIT(22) > > 65 #define HIDPP_QUIRK_NO_HIDINPUT BIT(23) > > 66 #define HIDPP_QUIRK_FORCE_OUTPUT_REPORTS BIT(24) > > 67 #define HIDPP_QUIRK_UNIFYING BIT(25) > > 68 #define HIDPP_QUIRK_HI_RES_SCROLL_1P0 BIT(26) > > 69 #define HIDPP_QUIRK_HI_RES_SCROLL_X2120 BIT(27) > > 70 #define HIDPP_QUIRK_HI_RES_SCROLL_X2121 BIT(28) > > 71 #define HIDPP_QUIRK_HIDPP_WHEELS BIT(29) > > 72 #define HIDPP_QUIRK_HIDPP_EXTRA_MOUSE_BTNS BIT(30) > > 73 #define HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS BIT(31) > > > > > > > 74 #define HIDPP_QUIRK_MISSING_SHORT_REPORTS BIT(32) > > > > 75 > > > > > > -- > > > > 0-DAY kernel test infrastructure Open Source Technology Center > > https://lists.01.org/pipermail/kbuild-all Intel Corporation > > > It seems that I overlooked that quirks is an unsigned long and is 32-bit > on some architectures. I feel like it's possible to change driver_data > and quirks to unsigned long long but it seems like such an unnecessarily > large change. Yep, which is why I told you to use 0x20 and 0x1f :) > > Since we've already reached the 32-bit limit for quirks, is it possible > that we could change how many bits are reserved for classes? yes, we can simply change the reserved range, this is just a comment after = all. > > Also, could bit 21 be reused for HIDPP_QUIRK_MISSING_SHORT_REPORTS? unfortunately no. This is theoretically kernel API, as you can have a script that binds a driver and sets a custom quirk for it (by writing to the sysfs new_id). So if one is marked as "reserved", resuing it might break someone's device though really unlikely. I'd rather shrink the number of classes than reusing one quirk already used= . Cheers, Benjamin