<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/scsi/libsas/sas_expander.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-05-30T07:44:22Z</updated>
<entry>
<title>scsi: libsas: Fix the failure of adding phy with zero-address to port</title>
<updated>2024-05-30T07:44:22Z</updated>
<author>
<name>Xingui Yang</name>
<email>yangxingui@huawei.com</email>
</author>
<published>2024-03-12T14:11:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=17e42338cc13fb925c9ce2e5fbff03b3c036317e'/>
<id>urn:sha1:17e42338cc13fb925c9ce2e5fbff03b3c036317e</id>
<content type='text'>
[ Upstream commit 06036a0a5db34642c5dbe22021a767141f010b7a ]

As of commit 7d1d86518118 ("[SCSI] libsas: fix false positive 'device
attached' conditions"), reset the phy-&gt;entacted_sas_addr address to a
zero-address when the link rate is less than 1.5G.

Currently we find that when a new device is attached, and the link rate is
less than 1.5G, but the device type is not NO_DEVICE, for example: the link
rate is SAS_PHY_RESET_IN_PROGRESS and the device type is stp. After setting
the phy-&gt;entacted_sas_addr address to the zero address, the port will
continue to be created for the phy with the zero-address, and other phys
with the zero-address will be tried to be added to the new port:

[562240.051197] sas: ex 500e004aaaaaaa1f phy19:U:0 attached: 0000000000000000 (no device)
// phy19 is deleted but still on the parent port's phy_list
[562240.062536] sas: ex 500e004aaaaaaa1f phy0 new device attached
[562240.062616] sas: ex 500e004aaaaaaa1f phy00:U:5 attached: 0000000000000000 (stp)
[562240.062680] port-7:7:0: trying to add phy phy-7:7:19 fails: it's already part of another port

Therefore, it should be the same as sas_get_phy_attached_dev(). Only when
device_type is SAS_PHY_UNUSED, sas_address is set to the 0 address.

Fixes: 7d1d86518118 ("[SCSI] libsas: fix false positive 'device attached' conditions")
Signed-off-by: Xingui Yang &lt;yangxingui@huawei.com&gt;
Link: https://lore.kernel.org/r/20240312141103.31358-5-yangxingui@huawei.com
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: libsas: Align SMP request allocation to ARCH_DMA_MINALIGN</title>
<updated>2024-04-02T01:34:23Z</updated>
<author>
<name>Yihang Li</name>
<email>liyihang9@huawei.com</email>
</author>
<published>2024-03-28T09:06:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e675a4fd6d1f8990d3bed5dada3d20edfa000423'/>
<id>urn:sha1:e675a4fd6d1f8990d3bed5dada3d20edfa000423</id>
<content type='text'>
This series [1] reduced the kmalloc() minimum alignment on arm64 to 8 bytes
(from 128). In libsas, this will cause SMP requests to be 8-byte aligned
through kmalloc() allocation. However, for hisi_sas hardware, all command
addresses must be 16-byte-aligned. Otherwise, the commands fail to be
executed.

ARCH_DMA_MINALIGN represents the minimum (static) alignment for safe DMA
operations, so use ARCH_DMA_MINALIGN as the alignment for SMP request.

Link: https://lkml.kernel.org/r/20230612153201.554742-1-catalin.marinas@arm.com [1]
Signed-off-by: Yihang Li &lt;liyihang9@huawei.com&gt;
Link: https://lore.kernel.org/r/20240328090626.621147-1-liyihang9@huawei.com
Reviewed-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Reviewed-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: libsas: Fix disk not being scanned in after being removed</title>
<updated>2024-03-10T22:02:54Z</updated>
<author>
<name>Xingui Yang</name>
<email>yangxingui@huawei.com</email>
</author>
<published>2024-03-07T14:14:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8e68a458bcf5b5cb9c3624598bae28f08251601f'/>
<id>urn:sha1:8e68a458bcf5b5cb9c3624598bae28f08251601f</id>
<content type='text'>
As of commit d8649fc1c5e4 ("scsi: libsas: Do discovery on empty PHY to
update PHY info"), do discovery will send a new SMP_DISCOVER and update
phy-&gt;phy_change_count. We found that if the disk is reconnected and phy
change_count changes at this time, the disk scanning process will not be
triggered.

Therefore, call sas_set_ex_phy() to update the PHY info with the results of
the last query. And because the previous phy info will be used when calling
sas_unregister_devs_sas_addr(), sas_unregister_devs_sas_addr() should be
called before sas_set_ex_phy().

Fixes: d8649fc1c5e4 ("scsi: libsas: Do discovery on empty PHY to update PHY info")
Signed-off-by: Xingui Yang &lt;yangxingui@huawei.com&gt;
Link: https://lore.kernel.org/r/20240307141413.48049-3-yangxingui@huawei.com
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: libsas: Add a helper sas_get_sas_addr_and_dev_type()</title>
<updated>2024-03-10T22:02:53Z</updated>
<author>
<name>Xingui Yang</name>
<email>yangxingui@huawei.com</email>
</author>
<published>2024-03-07T14:14:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a57345279fd311ba679b8083feb0eec5272c7729'/>
<id>urn:sha1:a57345279fd311ba679b8083feb0eec5272c7729</id>
<content type='text'>
Add a helper to get attached_sas_addr and device type from disc_resp.

Suggested-by: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Xingui Yang &lt;yangxingui@huawei.com&gt;
Link: https://lore.kernel.org/r/20240307141413.48049-2-yangxingui@huawei.com
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: libsas: Delete struct scsi_core</title>
<updated>2023-08-21T21:50:58Z</updated>
<author>
<name>John Garry</name>
<email>john.g.garry@oracle.com</email>
</author>
<published>2023-08-15T11:51:50Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1136a0225d0582c4464fa37e3a91ed4b19b8745e'/>
<id>urn:sha1:1136a0225d0582c4464fa37e3a91ed4b19b8745e</id>
<content type='text'>
Since commit 79855d178557 ("libsas: remove task_collector mode"), struct
scsi_core only contains a reference to the shost. struct scsi_core is only
used in sas_ha_struct.core, so delete scsi_core and replace with a
reference to the shost there.

Signed-off-by: John Garry &lt;john.g.garry@oracle.com&gt;
Link: https://lore.kernel.org/r/20230815115156.343535-5-john.g.garry@oracle.com
Reviewed-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Reviewed-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: libsas: factor out sas_check_fanout_expander_topo()</title>
<updated>2023-05-08T11:16:18Z</updated>
<author>
<name>Jason Yan</name>
<email>yanaijie@huawei.com</email>
</author>
<published>2023-04-21T09:37:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cf3cd61e76607801081adc35ae288b90921e6097'/>
<id>urn:sha1:cf3cd61e76607801081adc35ae288b90921e6097</id>
<content type='text'>
To be consistent with sas_check_edge_expander_topo(), factor out
sas_check_fanout_expander_topo(). And remove the comment since we are not
spilling over 80 colums now.

Signed-off-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Link: https://lore.kernel.org/r/20230421093744.1583609-4-yanaijie@huawei.com
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: libsas: Remove an empty branch in sas_check_parent_topology()</title>
<updated>2023-05-08T11:16:18Z</updated>
<author>
<name>Jason Yan</name>
<email>yanaijie@huawei.com</email>
</author>
<published>2023-04-21T09:37:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ba9be7e70e15dd75375131826f4b8a484efec4d0'/>
<id>urn:sha1:ba9be7e70e15dd75375131826f4b8a484efec4d0</id>
<content type='text'>
There is an empty "all good" branch in sas_check_parent_topology(). We can
reverse the test statement and remove the empty branch.

Moreover, factor out a helper sas_check_edge_expander_topo() to make the
code more readable.

Signed-off-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Link: https://lore.kernel.org/r/20230421093744.1583609-3-yanaijie@huawei.com
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: libsas: Simplify sas_check_eeds()</title>
<updated>2023-05-08T11:16:18Z</updated>
<author>
<name>Jason Yan</name>
<email>yanaijie@huawei.com</email>
</author>
<published>2023-04-21T09:37:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e3be011e828037be60fc91fa2d1791f9ee612a46'/>
<id>urn:sha1:e3be011e828037be60fc91fa2d1791f9ee612a46</id>
<content type='text'>
In sas_check_eeds() there is an empty branch. We can reverse the test
expression and then remove the empty branch. Also the test expression is a
little bit complex so it deserves an individual function. And make the
continuing prototype lines indented after the opening parenthesis to follow
the standard coding style.

Signed-off-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Link: https://lore.kernel.org/r/20230421093744.1583609-2-yanaijie@huawei.com
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: libsas: Factor out sas_ex_add_dev()</title>
<updated>2022-12-30T16:59:11Z</updated>
<author>
<name>Jason Yan</name>
<email>yanaijie@huawei.com</email>
</author>
<published>2022-12-14T13:38:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5d39b77c33b19089351f74a524fbb828c7d8ba81'/>
<id>urn:sha1:5d39b77c33b19089351f74a524fbb828c7d8ba81</id>
<content type='text'>
Factor out sas_ex_add_dev() to be consistent with sas_ata_add_dev() and
unify the error handling.

Cc: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: libsas: Factor out sas_ata_add_dev()</title>
<updated>2022-12-30T16:59:11Z</updated>
<author>
<name>Jason Yan</name>
<email>yanaijie@huawei.com</email>
</author>
<published>2022-12-14T13:38:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7cc7646b4b24430437e0cff104fadeafd470a7ce'/>
<id>urn:sha1:7cc7646b4b24430437e0cff104fadeafd470a7ce</id>
<content type='text'>
Factor out sas_ata_add_dev() and put it in sas_ata.c since it is a SATA
related interface. Also follow the standard coding style to define an
inline empty function when CONFIG_SCSI_SAS_ATA is not enabled.

Cc: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
