linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sanjay R Mehta <sanmehta@amd.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
	Sanjay R Mehta <Sanju.Mehta@amd.com>
Cc: andreas.noever@gmail.com, michael.jamet@intel.com,
	bhelgaas@google.com, YehezkelShB@gmail.com,
	Basavaraj.Natikar@amd.com, linux-usb@vger.kernel.org,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH 3/4] thunderbolt: Fix adapter init handling during switch add
Date: Tue, 3 Aug 2021 00:23:44 +0530	[thread overview]
Message-ID: <6da505a4-abad-ab8b-7706-17f83a35ff41@amd.com> (raw)
In-Reply-To: <YQgOj7elfCp7l4OO@lahna>



On 8/2/2021 8:56 PM, Mika Westerberg wrote:
> [CAUTION: External Email]
> 
> On Mon, Aug 02, 2021 at 07:58:19AM -0500, Sanjay R Mehta wrote:
>> From: Sanjay R Mehta <sanju.mehta@amd.com>
>>
>> Adapter0 (Port0) is the control adapter on the AMD USB4 host router.
>> As per USB4 spec in "Section 1.8", Control Adapters do not
>> have an Adapter Configuration Space".
>>
>> The read requests on Adapter0 time's out and driver initialization fails.
>>
>> Hence Disabling the Adapter in case of read-request timeout and continuing
>> the driver init.
>>
>> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
>> Signed-off-by: Sanjay R Mehta <sanju.mehta@amd.com>
>> ---
>>  drivers/thunderbolt/switch.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
>> index 83b1ef3..effbfe4 100644
>> --- a/drivers/thunderbolt/switch.c
>> +++ b/drivers/thunderbolt/switch.c
>> @@ -2747,8 +2747,9 @@ int tb_switch_add(struct tb_switch *sw)
>>                       }
>>                       ret = tb_init_port(&sw->ports[i]);
>>                       if (ret) {
>> +                             sw->ports[i].disabled = true;
>>                               dev_err(&sw->dev, "failed to initialize port %d\n", i);
>> -                             return ret;
>> +                             continue;
> 
> Instead of this, would it work if we start the loop at 1? In case of the
> control adapter (0) tb_port_init() does not do anything useful anyway
> and it actually would simplify that function too if we get rid of the
> special casing.
> 
Hi Mika,

If we start loop from 1, it will work for host router
but this will skip port (0) on device router which may be valid port.

Yes, as you said, for host router adapter (0) we can skip tb_port_init().

Will send the changes accordingly.

Thanks,
Sanjay

>>                       }
>>               }
>>
>> --
>> 2.7.4

  reply	other threads:[~2021-08-02 18:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 12:58 [PATCH 0/4] Add support for AMD USB4 and bug fixes Sanjay R Mehta
2021-08-02 12:58 ` [PATCH 1/4] PCI: Add AMD USB4 host router device IDs Sanjay R Mehta
2021-08-02 15:12   ` Mika Westerberg
2021-08-02 18:09     ` Sanjay R Mehta
2021-08-03  9:45       ` Mika Westerberg
2021-08-03 12:26         ` Sanjay R Mehta
2021-08-02 12:58 ` [PATCH 2/4] thunderbolt: Handle INTR when Disable ISR auto clear bit set Sanjay R Mehta
2021-08-02 15:22   ` Mika Westerberg
2021-08-02 18:15     ` Sanjay R Mehta
2021-08-02 12:58 ` [PATCH 3/4] thunderbolt: Fix adapter init handling during switch add Sanjay R Mehta
2021-08-02 15:26   ` Mika Westerberg
2021-08-02 18:53     ` Sanjay R Mehta [this message]
2021-08-03  9:05       ` Mika Westerberg
2021-08-03 12:29         ` Sanjay R Mehta
2021-08-02 12:58 ` [PATCH 4/4] thunderbolt: Fix port linking by checking all adapters Sanjay R Mehta
2021-08-02 15:10 ` [PATCH 0/4] Add support for AMD USB4 and bug fixes Mika Westerberg

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=6da505a4-abad-ab8b-7706-17f83a35ff41@amd.com \
    --to=sanmehta@amd.com \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=Sanju.Mehta@amd.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michael.jamet@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    /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).