[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <73854744-03ef-2c5c-a5d6-284f004a5497@quicinc.com>
Date: Wed, 14 Jun 2023 09:55:10 +0530
From: Prashanth K <quic_prashk@...cinc.com>
To: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Matthias Brugger <matthias.bgg@...il.com>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v7] usb: common: usb-conn-gpio: Set last role to unknown
before initial detection
On 13-06-23 04:40 pm, Heikki Krogerus wrote:
> Hi,
>
> On Wed, May 31, 2023 at 08:11:14PM +0530, Prashanth K wrote:
>> Currently if we bootup a device without cable connected, then
>> usb-conn-gpio won't call set_role() since last_role is same as
>> current role. This happens because during probe last_role gets
>> initialised to zero.
>>
>> To avoid this, added a new constant in enum usb_role, last_role
>> is set to USB_ROLE_UNKNOWN before performing initial detection.
>
> So why can't you fix this by just always setting the role
> unconditionally to USB_ROLE_NONE in your probe function before the
> initial detection?
>
Hi Heikki, thats exactly what we are doing here.
+ /* Set last role to unknown before performing the initial detection */
+ info->last_role = USB_ROLE_UNKNOWN;
+
/* Perform initial detection */
usb_conn_queue_dwork(info, 0);
Thanks,
Prashanth K
Powered by blists - more mailing lists