linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Michael Reeves" <michael.reeves077@gmail.com>
Cc: robh@kernel.org, dmitry.torokhov@gmail.com,
	linux-input@vger.kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v2 07/10] HID: apple: Add support for DockChannel HID keyboards
Date: Fri, 18 Sep 2026 11:18:05 +0000	[thread overview]
Message-ID: <20260918111805.76D861F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260918-apple-mtp-keyboard-final-v2-7-a5c685e50b60@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] hid-apple: custom match callback ignores HID_QUIRK_IGNORE_SPECIAL_DRIVER
--

commit f42c7195001b107355d17e77d99321b92d3f7aad
Author: Michael Reeves <michael.reeves077@gmail.com>
Subject: HID: apple: Add support for DockChannel HID keyboards

This commit adds support for DockChannel HID keyboards to the hid-apple
driver. It introduces a custom match callback to register devices based
on their host bus and specific HID group. The keyboard is then mapped
to the modern Magic Keyboard function-key table.

> diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
> --- a/drivers/hid/hid-apple.c
> +++ b/drivers/hid/hid-apple.c
[ ... ]
> @@ -1019,6 +1029,17 @@ static void apple_remove(struct hid_device *hdev)
>  	hid_hw_stop(hdev);
>  }
>  
> +static bool apple_match(struct hid_device *hdev, bool ignore_special_driver)
> +{
> +	if (ignore_special_driver)
> +		return false;
> +
> +	if (hdev->group == HID_GROUP_APPLE_DOCKCHANNEL)
> +		return apple_is_dockchannel_keyboard(hdev);
> +
> +	return true;

[Severity: Medium]
Does this code need to explicitly check for the device-specific quirk
hdev->quirks & HID_QUIRK_IGNORE_SPECIAL_DRIVER before returning true?

Returning true unconditionally for other Apple devices bypasses the HID
core's default safety enforcement. The hid-apple driver will bind to matching
Apple devices even if a user or a HID-BPF program has set the
HID_QUIRK_IGNORE_SPECIAL_DRIVER quirk.

This breaks driver fallback to hid-generic and prevents HID-BPF from taking
over the device via the standard quirk override mechanism.

> +}
> +
[ ... ]
> @@ -1248,6 +1272,7 @@ MODULE_DEVICE_TABLE(hid, apple_devices);
>  static struct hid_driver apple_driver = {
>  	.name = "apple",
>  	.id_table = apple_devices,
> +	.match = apple_match,
>  	.report_fixup = apple_report_fixup,
>  	.probe = apple_probe,
>  	.remove = apple_remove,

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260918-apple-mtp-keyboard-final-v2-0-a5c685e50b60@gmail.com?part=7

  reply	other threads:[~2026-09-18 11:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 11:06 [PATCH v2 00/10] Add support for Apple Silicon DockChannel internal keyboards Michael Reeves via B4 Relay
2026-09-18 11:06 ` [PATCH v2 01/10] dt-bindings: mailbox: apple: Add M3 ASC mailbox compatibles Michael Reeves via B4 Relay
2026-09-18 11:06 ` [PATCH v2 02/10] dt-bindings: mailbox: apple: Add DockChannel mailbox Michael Reeves via B4 Relay
2026-09-18 11:06 ` [PATCH v2 03/10] dt-bindings: iommu: apple,dart: Add M3 compatibles Michael Reeves via B4 Relay
2026-09-18 11:06 ` [PATCH v2 04/10] dt-bindings: input: apple: Add DockChannel HID transport Michael Reeves via B4 Relay
2026-09-18 11:15   ` sashiko-bot
2026-09-18 11:06 ` [PATCH v2 05/10] mailbox: apple: Add DockChannel FIFO controller Michael Reeves via B4 Relay
2026-09-18 11:19   ` sashiko-bot
2026-09-18 13:07   ` Yureka Lilian
2026-09-18 11:06 ` [PATCH v2 06/10] soc: apple: rtkit: Add tracekit endpoint Michael Reeves via B4 Relay
2026-09-18 11:06 ` [PATCH v2 07/10] HID: apple: Add support for DockChannel HID keyboards Michael Reeves via B4 Relay
2026-09-18 11:18   ` sashiko-bot [this message]
2026-09-18 11:06 ` [PATCH v2 08/10] HID: apple: Add DockChannel HID transport driver Michael Reeves via B4 Relay
2026-09-18 11:19   ` sashiko-bot
2026-09-18 11:06 ` [PATCH v2 09/10] arm64: dts: apple: Add MTP DockChannel HID nodes Michael Reeves via B4 Relay
2026-09-18 11:06 ` [PATCH v2 10/10] arm64: dts: apple: Enable DockChannel HID on M2 and M3 laptops Michael Reeves via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260918111805.76D861F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=michael.reeves077@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).