Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5960522rdb; Thu, 14 Dec 2023 04:56:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRIq8o/74DRSV8cEeLh/u/5y8wkAzQgvm49aJhSH+O7fV4F1e+4eBfzE/nNJXUOnd7lYRV X-Received: by 2002:a05:6a20:e113:b0:192:d3c:4165 with SMTP id kr19-20020a056a20e11300b001920d3c4165mr1447337pzb.114.1702558563922; Thu, 14 Dec 2023 04:56:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702558563; cv=none; d=google.com; s=arc-20160816; b=OoXgIX8eqr6RQ5p06p/nix4EJlEJ/Hpa5wpQPjoVSHyzg0Oknkw/uSZ8Pi+21qmyyM kWQeVHbk3mVPxD/3Gdm8kp60+SpHa+8EpnEl0kEb0GLTBlIg6CKVb3SVi6MoqiYsVr9D JBJUklfUmSoqRvJPbL0sox8jJtft/hg36Jsnj9LxjXtk0E1IhnSQcf4hfHQlYsWIJ7I/ mTMEm+cMZDuycKpKUBnOssZ/LrFFn7Bb6Fpe9HKUXQY2MFFrFH+GHkAxdyShKz7XKuIt 4Ype/ef3C4PqpYYpayoang4eskJuxvB65ToerYn70b+m7Em9gVYCex/ap3oicG/DdSsU 1WdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZYvEigRoKhZbgGLuv/4wRFyGkLXXYVjXdCoJrdge4oY=; fh=EjCLXcaDmfWtpxu+bwEYx6VMQuFxbU2oaYQrEkC9mzU=; b=EkRehd6S28f1qiDTrpipTDz+NLHuuGqq1PPnQloFT3P+i+oTV7r4CoyV7IBvmDSE+a Jql7Q+KEd0SF0Y5IrlvXa/rXESPqxKBgJv7QI0mxyBALlgFAnV7mDEj8GllHtjyGKhPt XfUjzUjh3pNPkMw5apTqzckPtpLwvofJMy0bsojvucKvIBH1/H1bdoX6QoYHDR64+6DL SiHTCqCI2uCHRKYjXlRTu2NewnlRy8hDj4lL0IFFFpcy7O786h8cUS84QVaJpHaKBL32 6CVzgnpzm5FhvMqRSQ4p3q8w/IUq1lTqZn0ZYn01vJwlfFEfb0tZEH1bMrVyFnGWjecH uHMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sqi3qwLl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id fa16-20020a056a002d1000b006cddd78a8f1si11244351pfb.27.2023.12.14.04.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 04:56:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sqi3qwLl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 8100F822E57B; Thu, 14 Dec 2023 04:56:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573157AbjLNMzi (ORCPT + 99 others); Thu, 14 Dec 2023 07:55:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573145AbjLNMzh (ORCPT ); Thu, 14 Dec 2023 07:55:37 -0500 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE88C113 for ; Thu, 14 Dec 2023 04:55:43 -0800 (PST) Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-425e58bd4c8so16487921cf.3 for ; Thu, 14 Dec 2023 04:55:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702558543; x=1703163343; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZYvEigRoKhZbgGLuv/4wRFyGkLXXYVjXdCoJrdge4oY=; b=Sqi3qwLlbp9FeKdI8GmTTRhMRTWkZp9S19FW4xUBP6+ZaUbH1O+R0Lmo4ayjaOpsHr VlwnVZBNQCtyzgu/xLlxjmKZTnTyBUfmgRNsjwIhNTlsqDAtGt3oT+IemsSoXbWm+pxn xevbT7swASnyBLZBUQK6u+2QSjwpVNauCD3iJx0DxGwaDrbR0ehQ+7VEA2XPSI3+dQz9 zMzpqNHStUnbBItYmEcghuBzlrQyweXyJYMoz2IaqrC3dXtlr2FeqExB5UmEMFzfF8kZ 5zDHu9wOHsjNYkFUfDAmnsqg6Yma/H29Kx6zb9xhBIeLFnaMYYLUP/vv64xSwVpQ0eXd NFZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702558543; x=1703163343; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZYvEigRoKhZbgGLuv/4wRFyGkLXXYVjXdCoJrdge4oY=; b=uGKzJc4e9NgBGllQF50fhM14AVDa8z4OZ1l7Ss/Hr8n/bc9CvAtAdZ6+8IuhZeeBcT Ah9uYDI8/Tci5Ty3tpAonQ9VtP91TFsSVA7UBozot7YST4vHfCjyXCPAZhQi8ROKOdNi iZJh/UrcYS01QQTbwF5NwLOYcYppoTJFUiz8JaLBx4av91idu8kCcUrNGa786tIpG3/L Umov9X0nPtxgTl68ODH0nCBSrlyXTscsMmxQ9mEOS063eUwf2/04ORQ5Fn2/4WM4tcby BCQcLgpvJiDF9N3p8B7/joy47I3u7RkWK8wFSdFun2f75ruKh+0YF3wY1qAYxnyDCnhN XjPg== X-Gm-Message-State: AOJu0Yxkcn1cpvJZNtbMXTwnALYhuMaYze1QbxwIQS6N5YFdg7SGU6kn NV/C3tb6qsXM39OoQ6e/uUXZ X-Received: by 2002:ac8:5fce:0:b0:423:77aa:163b with SMTP id k14-20020ac85fce000000b0042377aa163bmr11944057qta.51.1702558542823; Thu, 14 Dec 2023 04:55:42 -0800 (PST) Received: from localhost.localdomain ([117.216.120.87]) by smtp.gmail.com with ESMTPSA id hj1-20020a05622a620100b0042601b60861sm302377qtb.26.2023.12.14.04.55.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 04:55:42 -0800 (PST) From: Manivannan Sadhasivam To: andersson@kernel.org, konrad.dybcio@linaro.org, jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Andrew Halaney Subject: [PATCH] scsi: ufs: qcom: Fix ESI vector mask Date: Thu, 14 Dec 2023 18:25:32 +0530 Message-Id: <20231214125532.55109-1-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 14 Dec 2023 04:56:01 -0800 (PST) While cleaning up the code to use ufshcd_rmwl() helper, the ESI vector mask was changed incorrectly. Fix it and also define a proper macro for the value together with FIELD_PREP(). Reported-by: Andrew Halaney Fixes: 0e9f4375db1c ("scsi: ufs: qcom: Use ufshcd_rmwl() where applicable") Signed-off-by: Manivannan Sadhasivam --- drivers/ufs/host/ufs-qcom.c | 4 +++- drivers/ufs/host/ufs-qcom.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index d5cca5d3a98f..9fd8d737edea 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -1744,7 +1744,9 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba) } else { if (host->hw_ver.major == 6 && host->hw_ver.minor == 0 && host->hw_ver.step == 0) - ufshcd_rmwl(hba, ESI_VEC_MASK, 0x1f00, REG_UFS_CFG3); + ufshcd_rmwl(hba, ESI_VEC_MASK, + FIELD_PREP(ESI_VEC_MASK, MAX_ESI_VEC - 1), + REG_UFS_CFG3); ufshcd_mcq_enable_esi(hba); } diff --git a/drivers/ufs/host/ufs-qcom.h b/drivers/ufs/host/ufs-qcom.h index 9026fe243307..9dd9a391ebb7 100644 --- a/drivers/ufs/host/ufs-qcom.h +++ b/drivers/ufs/host/ufs-qcom.h @@ -15,6 +15,7 @@ #define HBRN8_POLL_TOUT_MS 100 #define DEFAULT_CLK_RATE_HZ 1000000 #define MAX_SUPP_MAC 64 +#define MAX_ESI_VEC 32 #define UFS_HW_VER_MAJOR_MASK GENMASK(31, 28) #define UFS_HW_VER_MINOR_MASK GENMASK(27, 16) base-commit: ed340d13aa1db6773667ed4bf907738df203fbda -- 2.25.1