]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: ufs: core: check asymmetric connected lanes
authorSEO HOYOUNG <hy50.seo@samsung.com>
Thu, 10 Oct 2024 07:52:28 +0000 (16:52 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Oct 2024 18:37:38 +0000 (14:37 -0400)
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>
drivers/ufs/core/ufshcd.c

index 9e6d008f4ea4a94c5575f6dd8d121253611e46c7..945253eb590ee787db881611b5b8ed33ef0b7d8d 100644 (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.