[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0fd2cff2-176e-419d-9e11-a98150266fee@oss.qualcomm.com>
Date: Mon, 9 Feb 2026 09:37:22 -0800
From: Elson Serrao <elson.serrao@....qualcomm.com>
To: Konrad Dybcio <konrad.dybcio@....qualcomm.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley
<conor+dt@...nel.org>,
Souradeep Chowdhury <quic_schowdhu@...cinc.com>
Cc: linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 6/9] usb: misc: qcom_eud: add host mode coordination
On 2/4/2026 5:29 AM, Konrad Dybcio wrote:
> On 1/27/26 12:38 AM, Elson Serrao wrote:
>> EUD functions by presenting itself as a USB device to the host PC for
>> debugging, making it incompatible in USB host mode configurations.
>> Enabling EUD, when in host mode can also cause the USB controller to
>> misbehave as the EUD hub can only have one upstream facing port.
>
> Perhaps that's a silly idea, but would the device itself see
> the debug hub, being able to essentially self-debug in a way?
>
This isn’t supported by the current hardware topology.
When EUD is enabled, it enumerates as a USB device to an external host via its
upstream-facing port, while the SoC USB controller sits behind the hub’s
downstream-facing port. As a result, the controller cannot enumerate or
interact with the EUD device itself, and host mode is mutually exclusive with
EUD debug on this path.
Thanks
Elson
> [...]
>
>> @@ -162,32 +165,66 @@ static ssize_t enable_store(struct device *dev,
>> const char *buf, size_t count)
>> {
>> struct eud_chip *chip = dev_get_drvdata(dev);
>> + struct eud_path *path;
>> bool enable;
>> int ret;
>>
>> if (kstrtobool(buf, &enable))
>> return -EINVAL;
>>
>> + mutex_lock(&chip->state_lock);
>
> If you use guard(mutex)(&chip->state-lock), you can waive all these
> conditional mutex_unlock additions
>
>> +
>> /* Skip operation if already in desired state */
>> - if (chip->enabled == enable)
>> + if (chip->enabled == enable) {
>> + mutex_unlock(&chip->state_lock);
>> return count;
>> + }
>> +
>> + /*
>> + * Handle double-disable scenario: User is disabling EUD that was already
>> + * disabled due to host mode. Since the hardware is already disabled, we
>> + * only need to clear the host-disabled flag to prevent unwanted re-enabling
>> + * when exiting host mode. This respects the user's explicit disable request.
>> + */
>> + if (!enable && chip->eud_disabled_for_host) {
>> + chip->eud_disabled_for_host = false;
>> + chip->enabled = false;
>> + mutex_unlock(&chip->state_lock);
>> + return count;
>> + }
>>
>> if (enable) {
>> + /*
>> + * EUD functions by presenting itself as a USB device to the host PC for
>> + * debugging, making it incompatible in USB host mode configuration.
>> + * Prevent enabling EUD in this configuration to avoid hardware conflicts.
>> + */
>> + path = chip->paths[chip->port_idx];
>> + if (path && path->curr_role == USB_ROLE_HOST) {
>> + dev_err(chip->dev, "EUD not usable in host mode configuration\n");
>
> "in USB host mode"?
>
> [...]
>
>> + /*
>> + * EUD must be disabled when USB operates in host mode. EUD functions by
>> + * presenting itself as a USB device to the host PC for debugging, making
>> + * it incompatible in host mode configuration.
> ^ with
>
> Otherwise the logic looks good, I think this may be desired default
> behavior (so that the user doesn't have to constantly keep re-enabling
> EUD)
>
> Konrad
Powered by blists - more mailing lists