linux/drivers/scsi/libsas
John Garry d8649fc1c5 scsi: libsas: Do discovery on empty PHY to update PHY info
When we discover the PHY is empty in sas_rediscover_dev(), the PHY
information (like negotiated linkrate) is not updated.

As such, for a user examining sysfs for that PHY, they would see
incorrect values:

root@(none)$ cd /sys/class/sas_phy/phy-0:0:20
root@(none)$ more negotiated_linkrate
3.0 Gbit
root@(none)$ echo 0 > enable
root@(none)$ more negotiated_linkrate
3.0 Gbit

So fix this, simply discover the PHY again, even though we know it's empty;
in the above example, this gives us:

root@(none)$ more negotiated_linkrate
Phy disabled

We must do this after unregistering the device associated with the PHY
(in sas_unregister_devs_sas_addr()).

Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-04-15 18:55:01 -04:00
..
Kconfig scsi: scsi_transport_sas: switch to bsg-lib for SMP passthrough 2017-08-29 21:51:45 -04:00
Makefile scsi: libsas: Drop SAS_DPRINTK() and revise logs levels 2018-11-15 14:37:06 -05:00
sas_ata.c SCSI misc on 20181224 2018-12-28 14:48:06 -08:00
sas_discover.c scsi: libsas: Remove pcidev reference 2018-11-15 14:37:06 -05:00
sas_event.c scsi: libsas: Delete sas_dump.{c, h} 2018-11-15 14:37:05 -05:00
sas_expander.c scsi: libsas: Do discovery on empty PHY to update PHY info 2019-04-15 18:55:01 -04:00
sas_host_smp.c scsi: scsi_transport_sas: switch to bsg-lib for SMP passthrough 2017-08-29 21:51:45 -04:00
sas_init.c scsi: libsas: Stop hardcoding SAS address length 2019-04-15 18:55:00 -04:00
sas_internal.h scsi: libsas: Drop SAS_DPRINTK() and revise logs levels 2018-11-15 14:37:06 -05:00
sas_phy.c scsi: libsas: Drop sas_printk() 2018-11-15 14:37:06 -05:00
sas_port.c scsi: libsas: Inject revalidate event for root port event 2019-04-15 18:55:00 -04:00
sas_scsi_host.c scsi: ata: Use unsigned int for cmd's type in ioctls in scsi_host_template 2019-02-08 17:33:00 -05:00
sas_task.c scsi: libsas: Drop SAS_DPRINTK() and revise logs levels 2018-11-15 14:37:06 -05:00