From: Yureka Lilian <yureka@cyberchaos.dev>
To: Michael Reeves <michael.reeves077@gmail.com>,
Yureka Lilian <yureka@cyberchaos.dev>
Cc: Sven Peter <sven@kernel.org>, Janne Grunau <j@jannau.net>,
Neal Gompa <neal@gompa.dev>,
Jassi Brar <jassisinghbrar@gmail.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Hector Martin <marcan@marcan.st>,
"Joerg Roedel (AMD)" <joro@8bytes.org>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
iommu@lists.linux.dev, linux-input@vger.kernel.org
Subject: Re: [PATCH 08/10] HID: apple: Add DockChannel HID transport driver
Date: Sat, 1 Aug 2026 23:56:20 +0200 [thread overview]
Message-ID: <03eb4c22-045e-470e-8259-ebf9b1cfe2ed@cyberchaos.dev> (raw)
In-Reply-To: <CANpmGNs3s2yLw05jkpZ9mscQNZ9JvfbqEgyW8V=cMD29aU8c2A@mail.gmail.com>
On 7/1/26 16:32, Michael Reeves wrote:
> Hi Yureka,
>
> Thank you for the review and the feedback.
>
> On Tue, Jun 30, 2026 at 11:21 PM Yureka Lilian <yureka@cyberchaos.dev> wrote:
> [...]
>>> + strscpy(hid->uniq, dchid->serial, sizeof(hid->uniq));
>> If the keyboard appeared before stm, dchip->serial might be uninitialized.
> Yes, true, thank you for picking this up!
> [...]
>>> + /*
>>> + * Prefer to enable STM first, since it provides device IDs. Some
>>> + * firmware versions do not expose STM, so let the keyboard start
>>> + * without it.
>>> + */
>>> + if (iface->dchid->id_ready || !strcmp(iface->name, "stm") ||
>>> + !strcmp(iface->name, "keyboard"))
>> I specifically asked for a mechanism to let the keyboard probe even on
>> devices which do not expose/have stm. Thanks for adding that!
>> However, I think this might need some more sophisticated mechanism to
>> decide whether the stm is still going to appear after the keyboard, or
>> not at all. I'm not sure if there is a way to tell this at this point,
>> or we need to add a timeout for the stm to appearing, which needs to
>> expire before we create the other interfaces with fake serials.
>>
> I do not think there is a way to tell at this point, unfortunately.
>
> I think the best way to resolve this would be to implement a delayed work
> item that is scheduled during probe. If STM appears and initalises before
> the timer (I'm not sure how long it should be right now, I will prototype and
> experiment) we cancel the delayed work, get the real serial, and spin up
> the keyboard. If the timeout expires without seeing the STM interface, we
> assume the platform does not have one, mark id_ready as true, and
> proceed to init the keyboard.
I see three ways forward (no specific order):
1) Implement the timeout as you described.
2) Use the approach that always waits for the stm to appear, and is
proven to work well on the M2 devices targeted by this series. A
different behavior that does not wait for the stm / determines the
serials using other means can be added at a later point in the same
driver but with a different compatible string.
3) Add an stm subnode (like the downstream Asahi device trees have for
their dockchannel-mtp nodes [1]) which indicates whether the stm is
present. Check for the existence of this subnode to decide whether to
wait for the stm or add the HID devices with fake serials. Support for
other methods of retrieving the serials can be added later and indicated
by other subnodes.
I would appreciate feedback from all of you on which of these options we
should move forward with.
>
> I will work on this and experiment to see if it's the best solution or
> if there's
> any others as well as to find the ideal timeout, and submit as part of v2.
> [...]
>
> Thanks again,
> Michael
Thanks,
- Yureka
Link:
https://github.com/AsahiLinux/linux/blob/asahi-7.1.5-2/arch/arm64/boot/dts/apple/t8112-j413.dts#L260
[1]
next prev parent reply other threads:[~2026-08-01 21:56 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 12:54 [PATCH 00/10] Add support for Apple Silicon DockChannel internal keyboards Michael Reeves via B4 Relay
2026-06-30 12:54 ` [PATCH 01/10] dt-bindings: mailbox: Add Apple t8122 ASC mailbox Michael Reeves via B4 Relay
2026-06-30 17:05 ` Conor Dooley
2026-06-30 12:54 ` [PATCH 02/10] dt-bindings: mailbox: apple: Add DockChannel mailbox Michael Reeves via B4 Relay
2026-06-30 17:07 ` Conor Dooley
2026-07-01 14:35 ` Michael Reeves
2026-06-30 12:54 ` [PATCH 03/10] dt-bindings: iommu: apple,dart: Add t8122 compatible Michael Reeves via B4 Relay
2026-06-30 17:07 ` Conor Dooley
2026-06-30 12:54 ` [PATCH 04/10] dt-bindings: input: apple: Add DockChannel HID transport Michael Reeves via B4 Relay
2026-06-30 13:10 ` sashiko-bot
2026-06-30 17:08 ` Conor Dooley
2026-07-01 14:36 ` Michael Reeves
2026-06-30 12:54 ` [PATCH 05/10] mailbox: apple: Add DockChannel FIFO controller Michael Reeves via B4 Relay
2026-07-04 20:14 ` Yureka Lilian
2026-07-07 13:42 ` Michael Reeves
2026-06-30 12:54 ` [PATCH 06/10] soc: apple: rtkit: Add tracekit endpoint Michael Reeves via B4 Relay
2026-06-30 12:54 ` [PATCH 07/10] HID: apple: Add support for DockChannel HID keyboards Michael Reeves via B4 Relay
2026-06-30 13:41 ` Sasha Finkelstein
2026-07-01 14:01 ` Michael Reeves
2026-06-30 13:43 ` sashiko-bot
2026-06-30 12:54 ` [PATCH 08/10] HID: apple: Add DockChannel HID transport driver Michael Reeves via B4 Relay
2026-06-30 13:21 ` Yureka Lilian
2026-07-01 14:32 ` Michael Reeves
2026-08-01 21:56 ` Yureka Lilian [this message]
2026-06-30 13:58 ` sashiko-bot
2026-07-02 19:32 ` Julian Braha
2026-07-07 13:37 ` Michael Reeves
2026-06-30 12:54 ` [PATCH 09/10] arm64: dts: apple: Add MTP DockChannel HID nodes Michael Reeves via B4 Relay
2026-06-30 12:54 ` [PATCH 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=03eb4c22-045e-470e-8259-ebf9b1cfe2ed@cyberchaos.dev \
--to=yureka@cyberchaos.dev \
--cc=asahi@lists.linux.dev \
--cc=bentiss@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=iommu@lists.linux.dev \
--cc=j@jannau.net \
--cc=jassisinghbrar@gmail.com \
--cc=jikos@kernel.org \
--cc=joro@8bytes.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcan@marcan.st \
--cc=michael.reeves077@gmail.com \
--cc=neal@gompa.dev \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=sven@kernel.org \
--cc=will@kernel.org \
/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