Re: [PATCH v3 08/13] usb: hub: Power on connected M.2 E-key connectors with power sequencing API
From: Bartosz Golaszewski
Date: Fri Jul 03 2026 - 09:27:51 EST
On Fri, 3 Jul 2026 14:58:56 +0200, Chen-Yu Tsai <wenst@xxxxxxxxxxxx> said:
> On Fri, Jul 3, 2026 at 8:41 PM Bartosz Golaszewski <brgl@xxxxxxxxxx> wrote:
>>
>> So this is only needed to not have to track the state in a separate field?
>
> Correct. Reading the field is not the problem. Updating it is, as the
> fields are packed bitfields, and Sashiko suggested that locking would
> be needed, though it may have been for the peer port, which has since
> been removed.
>
I'm not sure if it is. The user controlls the handle. We could argue, it's up
to them to provide synchroniztion. We only assign the target and pwrseq fields
once in pwrseq_match_device() and only change the powered_on field later with
pwrseq_power_on/off(). Unless the user does something weird, we should be
alright. Maybe a small note in the kernel doc would be in order.
Thanks,
Bartosz