scsi: ufs: core: check asymmetric connected lanes

Performance problems may occur if there is a problem with the asymmetric
connected lane such as h/w failure.  Currently, only check connected
lane for rx/tx is checked if it is not 0.  But it should also be checked
if it is asymmetrically connected.

Signed-off-by: SEO HOYOUNG <hy50.seo@samsung.com>
Link: https://lore.kernel.org/r/e82b4b65b5f6501a687c624dd06e5c362e160f32.1728544727.git.hy50.seo@samsung.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
SEO HOYOUNG 2024-10-10 16:52:28 +09:00 committed by Martin K. Petersen
parent a3517717c3
commit 10c58d7eea

View File

@ -4535,6 +4535,14 @@ static int ufshcd_get_max_pwr_mode(struct ufs_hba *hba)
return -EINVAL;
}
if (pwr_info->lane_rx != pwr_info->lane_tx) {
dev_err(hba->dev, "%s: asymmetric connected lanes. rx=%d, tx=%d\n",
__func__,
pwr_info->lane_rx,
pwr_info->lane_tx);
return -EINVAL;
}
/*
* First, get the maximum gears of HS speed.
* If a zero value, it means there is no HSGEAR capability.