Skip to contentSkip to conversation

Patch "scsi: libsas: initialize sas_phy status according to response of DISCOVER" has been added to the 4.15-stable tree

PATCH [email protected] 1 participant 1 message Apr 9, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

scsi: libsas: initialize sas_phy status according to response of DISCOVER

to the 4.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
scsi-libsas-initialize-sas_phy-status-according-to-response-of-discover.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Mon Apr 9 10:16:32 CEST 2018

From: chenxiang <[email protected]>
Date: Thu, 4 Jan 2018 21:04:33 +0800
Subject: scsi: libsas: initialize sas_phy status according to response of DISCOVER

From: chenxiang <[email protected]>

[ Upstream commit affc67788fe5dfffad5cda3d461db5cf2b2ff2b0 ]

The status of SAS PHY is in sas_phy->enabled. There is an issue that the status of a remote SAS PHY may be initialized incorrectly: if disable remote SAS PHY through sysfs interface (such as echo 0 > /sys/class/sas_phy/phy-1:0:0/enable), then reboot the system, and we will find the status of remote SAS PHY which is disabled before is 1 (cat /sys/class/sas_phy/phy-1:0:0/enable). But actually the status of remote SAS PHY is disabled and the device attached is not found.

In SAS protocol, NEGOTIATED LOGICAL LINK RATE field of DISCOVER response is 0x1 when remote SAS PHY is disabled. So initialize sas_phy->enabled according to the value of NEGOTIATED LOGICAL LINK RATE field.

---
 drivers/scsi/libsas/sas_expander.c |    1 +
 1 file changed, 1 insertion(+)
drivers/scsi/libsas/sas_expander.c +1 -0
@@ -293,6 +293,7 @@ static void sas_set_ex_phy(struct domain
 	phy->phy->minimum_linkrate = dr->pmin_linkrate;
 	phy->phy->maximum_linkrate = dr->pmax_linkrate;
 	phy->phy->negotiated_linkrate = phy->linkrate;
+	phy->phy->enabled = (phy->linkrate != SAS_PHY_DISABLED);
 
  skip:
 	if (new_phy)

Patches currently in stable-queue which might be from [email protected] are

queue-4.15/scsi-libsas-initialize-sas_phy-status-according-to-response-of-discover.patch queue-4.15/scsi-libsas-fix-error-when-getting-phy-events.patch queue-4.15/scsi-libsas-fix-memory-leak-in-sas_smp_get_phy_events.patch