Re: Issue in sas_ex_discover_dev() for multiple level of SAS expanders in a domain

John Garry
2024-05-08T07:49:24Z

On 08/05/2024 01:59, Li, Eric (Honggang) wrote:
>>> Call to sas_ex_join_wide_port() makes the rest PHYs associated with that existing port
>> (making it become wideport) and set up sysfs between the PHY and port. > Set
>> PHY_STATE_DISCOVERED would make the rest PHYs not being scanned/discovered again
>> (as this wide port is already scanned).
>>
>> If you can just confirm that re-adding the code to set phy_state = DISCOVERED is good
>> enough to see the SAS disks again, then this can be further discussed. >>
> OK. I will work on that and keep you updated.

I expect a flow like this for scanning of the downstream expander:

sas_discover_new(struct domain_device *dev [upstream expander], int
phy_id_a) -> sas_ex_discover_devices(single = -1) ->
sas_ex_discover_dev(phy_id_b) for each phy in @dev non-vacant and
non-discovered -> sas_ex_discover_expander( [downstream expander]) for
first phy scanned which belongs to downstream expander.

And following that we have continue to scan phys in
sas_ex_discover_devices(single = -1) -> sas_ex_discover_dev(phy_id_b) ->
sas_ex_join_wide_port() -> for each non-vacant and non-discovered phy
in phy_id_b which matches that downstream expander.

Can you see why this does not actually work/occur?

Thanks,
John