From patchwork Thu Oct 10 07:52:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SEO HOYOUNG X-Patchwork-Id: 13829709 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 076921F9406 for ; Thu, 10 Oct 2024 07:42:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728546155; cv=none; b=oo80fnL2CkHITS5AwGYbbqWKRKslCDnU63jdwAjiRfKc+JBAl0/Lfef8qXaDfcmimSU4Bt2V4N5zU/1vrRhMld+AexB3GVR3D1xejHejiG8ojTdysNlrmoYzEcpv5Fvf+kj8BIfwdCg7w7Az2j6FNwmx7g4sEfw/ucUYRVdeGEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728546155; c=relaxed/simple; bh=WTtjtG47vymHfMOTZHiAGXAiV8ozOqMHl1YVg0JFja8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=pUPDES0TWgSa+q8L1Y8kHBHXI0Motz/648Z2yAm6HqCpxMlPecOb1J14S/Z/IilHqlYti+0VYMFnVfhEbrR/1Ui5TNwdNEYSa3v59c17u+j0DqcCQ1SzW13aeLDXwCkZW91BBKI9CzGozQqa7k5Y7CmXJH3cLCL+/SWPX8+IDUs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=BUzUcLh7; arc=none smtp.client-ip=203.254.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="BUzUcLh7" Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20241010074230epoutp04b72a257fca0dc4da78bf9a70de5cc843~9B5Druq3y2066120661epoutp04N for ; Thu, 10 Oct 2024 07:42:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20241010074230epoutp04b72a257fca0dc4da78bf9a70de5cc843~9B5Druq3y2066120661epoutp04N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1728546151; bh=RUnIJ9K+YQ0p0ZcKfT070l16YRpaY6+jaXV37dAh/TY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BUzUcLh7X15eaLtUc1OnMGqtyZn1J1uvmZUCZr8Q3CXsJy3ihXhW4an8Yu1BhpYyt PjGG2e8UoboAdOC2+E19jd0k1/m45iBMQU4Rhdtn37MHBFun5bOpjIi3S+nwd1sFQB 55kvsC0i/JtsiDK1ERueMXXTsCXZ7T1cXdLHuX00= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20241010074230epcas2p2fb966134b612c96d455b45a68a9bc639~9B5DUnjhC2794227942epcas2p2Y; Thu, 10 Oct 2024 07:42:30 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.68]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4XPMD55Nn6z4x9Py; Thu, 10 Oct 2024 07:42:29 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id D3.33.09776.56587076; Thu, 10 Oct 2024 16:42:29 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20241010074229epcas2p31ecc33731a96be7958cdd93908a1ce86~9B5CEiaNl3202132021epcas2p39; Thu, 10 Oct 2024 07:42:29 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241010074229epsmtrp1f6956eac7e1c699b95675d828e9a8a49~9B5CDek_80182601826epsmtrp1X; Thu, 10 Oct 2024 07:42:29 +0000 (GMT) X-AuditID: b6c32a47-d53fa70000002630-e2-6707856566ef Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 44.55.08227.56587076; Thu, 10 Oct 2024 16:42:29 +0900 (KST) Received: from rack03.dsn.sec.samsung.com (unknown [10.229.95.126]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241010074228epsmtip2c8730b7f4dd4d673d12d86dc231b3010~9B5B0Hrfi1861218612epsmtip2m; Thu, 10 Oct 2024 07:42:28 +0000 (GMT) From: SEO HOYOUNG To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com, martin.petersen@oracle.com, beanhuo@micron.com, bvanassche@acm.org, kwangwon.min@samsung.com, kwmad.kim@samsung.com, sh425.lee@samsung.com, quic_nguyenb@quicinc.com, cpgs@samsung.com, h10.kim@samsung.com, grant.jung@samsung.com, junwoo80.lee@samsung.com, wkon.kim@samsung.com Cc: SEO HOYOUNG Subject: [PATCH v3 1/2] scsi: ufs: core: check asymmetric connected lanes Date: Thu, 10 Oct 2024 16:52:28 +0900 Message-Id: X-Mailer: git-send-email 2.26.0 In-Reply-To: Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01TfUwbZRzOe3dcD0zJrd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7qf7b9HOxuO9C3L5Or6uJKt2GH5zYXizpsmvF756UfbdcdpF7+4bzGJ CtjNxnRt7dVzq6OSbujYz+5qm5Oyw8WzT/PK7yUzrdfMbynbzHnv2iIzfeslcxK5nAV//jRe fZWz7HDyrVs997e2nviWsS1ngvyq5uO26yU0exr6xaoijCxFjk17JDy9YfIGQyarnoZgJZbi jERDLeai4kQAVDbNax0DAAA= X-CMS-MailID: 20241010074229epcas2p31ecc33731a96be7958cdd93908a1ce86 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-CPGSPASS: Y DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20241010074229epcas2p31ecc33731a96be7958cdd93908a1ce86 References: 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 Reviewed-by: Bart Van Assche --- drivers/ufs/core/ufshcd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 24a32e2fd75e..387eec6f19ef 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -4540,6 +4540,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.