public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: "Li, Eric (Honggang)" <Eric.H.Li@Dell.com>,
	Jason Yan <yanaijie@huawei.com>,
	"james.bottomley@hansenpartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: Issue in sas_ex_discover_dev() for multiple level of SAS expanders in a domain
Date: Tue, 7 May 2024 10:17:22 +0100	[thread overview]
Message-ID: <7081399f-d4e8-4af9-9cff-2bcb1e4c6064@oracle.com> (raw)
In-Reply-To: <PH0PR19MB5411390C5A29A953CAA70062C4E42@PH0PR19MB5411.namprd19.prod.outlook.com>

On 07/05/2024 09:44, Li, Eric (Honggang) wrote:
> Resend this email.
> 
>> -----Original Message-----
>> From: Li, Eric (Honggang)
>> Sent: Monday, May 6, 2024 9:50 AM
>> To: John Garry <john.g.garry@oracle.com>; Jason Yan <yanaijie@huawei.com>;
>> james.bottomley@hansenpartnership.com; Martin K . Petersen <martin.petersen@oracle.com>
>> Cc: linux-scsi@vger.kernel.org
>> Subject: RE: Issue in sas_ex_discover_dev() for multiple level of SAS expanders in a domain
>>
>>> -----Original Message-----
>>> From: John Garry <john.g.garry@oracle.com>
>>> Sent: Friday, May 3, 2024 4:33 PM
>>> To: Li, Eric (Honggang) <Eric.H.Li@Dell.com>; Jason Yan
>>> <yanaijie@huawei.com>; james.bottomley@hansenpartnership.com; Martin K
>>> . Petersen <martin.petersen@oracle.com>
>>> Cc: linux-scsi@vger.kernel.org
>>> Subject: Re: Issue in sas_ex_discover_dev() for multiple level of SAS
>>> expanders in a domain
>>>
>>>
>>> [EXTERNAL EMAIL]
>>>
>>> On 03/05/2024 04:15, Li, Eric (Honggang) wrote:
>>>> John,
>>>>
>>>> I agree that the call to sas_ex_join_wide_port() is not mandatory.
>>>> In fact, some logic here is similar to that function. We don't need
>>>> to do it again.
>>>> But just updating the phy_state may not be enough. I suppose you
>>>> still need to add that PHY into the corresponding wide port by
>>>> calling
>>>> sas_port_add_phy() and update phy->port.
>>>> Just updating the phy_state may avoid the port disabled in this
>>>> issue, but other missing piece of work may cause other issues.
>>>>
>>>
>>> If you check the commit in which that call to sas_ex_join_wide_port()
>>> was originally added - 19252de - it was added together with the
>>> comment "Due to races, the phy might not get added to the wide port,
>>> so we add the phy to the wide port here". However the code to set phy_state =
>> PHY_STATE_DISCOVERED already existed before that commit.
>>>
>>> When all that code was removed in a1b6fb947f923, I am just wondering
>>> if we have kept the phy_state = PHY_STATE_DISCOVERED code.
>>>
>>> Anyway, would we really join a wideport with the downstream expander?
>>> I would just assume that we would be creating a new wideport, and a
>>> subsequent scanned phy would be added to it.
>>
>> [Eric: ] I don't think the code removed in a1b6fb947f923 is the right way to fix this issue.
>> It just happened avoiding this issue occurring.

Sure, I don't particularly like it as a fix either. But first I would 
like to get your setup working again to verify that only this needs 
fixing. Indeed something else may be broken since a1b6fb947f923. In 
addition, if we need to backport a fix, I would only like to backport a 
fix for real known broken topologies, and not theoretical issues not 
experienced.

But what exact setup do you have? I am confused, as you seem to be 
talking about your setup being broken, but then other setup may also 
being broken, but you don't have access to another setup. What is the 
other setup?



>> I think the root cause of this issue is the order of function calls to
>> sas_dev_present_in_domain() and sas_ex_join_wide_port().
>> My concern here is whether or not we still need to configure routing on the parent SAS
>> expander before calling sas_ex_join_wide_port().
>> This part of logic is not present previously and I don't have environment to test this.
>>
>> Back to your question, I believe we do need to join a wideport to downstream expander.
>> Changing the phy_state to PHY_STATE_DISCOVERED will skip scanning those PHYs,

I would have thought that re-adding the code removed in a1b6fb947f923 to 
set PHY_STATE_DISCOVERED would only affect the first phy scanned in that 
wideport. Other phys scanned would have it set through calls to 
sas_ex_join_wide_port()

> by
>> not calling the function sas_ex_discover_dev() to subsequential PHYs within this port (so
>> this issue wouldn’t hit). But those PHYs are not associated with a SAS port. This may trigger
>> other issues (for example, any change count changed on that PHY, or SAS topology in sysfs,
>> etc.)
>>ok, this can be considered more when I understand exactly what you have 
and what else you think may be broken.

Thanks,
John




  reply	other threads:[~2024-05-07  9:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24  8:59 Issue in sas_ex_discover_dev() for multiple level of SAS expanders in a domain Li, Eric (Honggang)
2024-04-24 10:46 ` John Garry
2024-04-25  2:57   ` Jason Yan
2024-04-25  5:03     ` Li, Eric (Honggang)
2024-04-30 14:22       ` Li, Eric (Honggang)
2024-05-01 14:23         ` John Garry
2024-05-03  3:15           ` Li, Eric (Honggang)
2024-05-03  8:33             ` John Garry
2024-05-06  1:49               ` Li, Eric (Honggang)
2024-05-07  8:03                 ` John Garry
2024-05-07  8:44                 ` Li, Eric (Honggang)
2024-05-07  9:17                   ` John Garry [this message]
2024-05-07 11:17                     ` Li, Eric (Honggang)
2024-05-07 15:14                       ` John Garry
2024-05-08  0:59                         ` Li, Eric (Honggang)
2024-05-08  7:48                           ` John Garry
2024-05-08  8:29                             ` Li, Eric (Honggang)
2024-05-09  3:52                               ` Jason Yan
2024-05-11  3:41                               ` Jason Yan
2024-05-14  9:23                                 ` Li, Eric (Honggang)
2025-06-10 13:05                                   ` Li, Eric (Honggang)
2025-06-10 13:33                                     ` Jason Yan

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=7081399f-d4e8-4af9-9cff-2bcb1e4c6064@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=Eric.H.Li@Dell.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=yanaijie@huawei.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