Skip to content

Commit

Permalink
scsi: hisi_sas: Set a port invalid only if there are no devices attac…
Browse files Browse the repository at this point in the history
…hed when refreshing port id

Currently the driver sets the port invalid if one phy in the port is not
enabled, which may cause issues in expander situation. In directly attached
situation, if phy up doesn't occur in time when refreshing port id, the
port is incorrectly set to invalid which will also cause disk lost.

Therefore set a port invalid only if there are no devices attached to the
port.

Signed-off-by: Yihang Li <liyihang9@huawei.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Link: https://lore.kernel.org/r/1672805000-141102-3-git-send-email-chenxiang66@hisilicon.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Yihang Li authored and martinkpetersen committed Jan 12, 2023
1 parent 037b480 commit f58c897
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/hisi_sas/hisi_sas_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ static void hisi_sas_refresh_port_id(struct hisi_hba *hisi_hba)
device->linkrate = phy->sas_phy.linkrate;

hisi_hba->hw->setup_itct(hisi_hba, sas_dev);
} else
} else if (!port->port_attached)
port->id = 0xff;
}
}
Expand Down

0 comments on commit f58c897

Please sign in to comment.