From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13EB019E99C for ; Thu, 31 Oct 2024 15:00:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386843; cv=none; b=SHFE7UeIQyqZwSw3YHm93+G47SJcQaGiGacjmwDIq5dw7dhSUJRd409ZbgjAOPkHeWK19eL2h+NkUdm7mw6XsK5AqzdqSH0kane2Wi17ULUDCfl9zjYPLCoQ0Mhynox/ffnW+OVF7/flyL23z4laynJK3LTqaJnEyDoj/wosLK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386843; c=relaxed/simple; bh=iiVF9AZs4yPH5IC0Sz8HHtFFUAcwFKXXFknN+nFLjSM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OToOLKMGYEu/+/5nTcOw49m21/qhkU64ZNmhO6XLOrb+b6KwuqXPdpClLyZTqS7Jc5Drndqa+HCikUmQzc3e6FfmSKC6OC/QvhUhKwECii2whOCPl7xJ5cIFjHSAhFBhJcWkfZj5GIYWEw88lEyvqI5bcWJJ/boGopGYAEkoNF4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=OJPNgNFB; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="OJPNgNFB" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4316cce103dso10967525e9.3 for ; Thu, 31 Oct 2024 08:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386838; x=1730991638; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EDFhDh5Dsbm8CIbr2G+SLWNj/UFzwMVxtyg6fSq7G5I=; b=OJPNgNFBGZH+5Zs5wIpCida/Zn+vZhjdW62NxS2c1pK2KmlFkoASOJffntuBSA1tYs C/WEtKHHLtYuV9CTs6hEIOfx9dD2gJwbKYV4qcMPtcJLSvkSfkWUvyoYZ7csk3iGFTz5 eAnZX4oAZAI6EOubdFxaQUSTitAbqprnyPDbpWUnnxcwYAiXkF6D0MGEGUbtND4WjYmb nIofs9MCspxUQz54Xj/7O46czchfYzn6naSyliGK4n1dseww5rOzMR8TBN9N/cX3E6zT e6zbn+ztrIKZSCeSDHmSGcCpbVnn9xm6yrpr9aGmyk8xINxPfN041icrRmziqu7sLmIu s67g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386838; x=1730991638; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EDFhDh5Dsbm8CIbr2G+SLWNj/UFzwMVxtyg6fSq7G5I=; b=pXCxZcIapnOFwTzOGPY4oZssPNKwxWpRAu31T1hLb5dkYilsSgh97TYbBEluqjYGYX KBOn1X+g5Ra3l9WpAMAT3ICd99v2iPcIYTSoFHYgJBP71BOHQMVRzMJw5gGtnRfZfL9H niR2w/aBGph9cQsyTDqIj/L5XlmyvuVgPoQhg+KGE6G1b+wzbOZNtpheNCmA0BiJ8aiS Vn767EnsT7GSgoB0r6V6D49c7xh899l+EA60oS15C8S0ZwoMOkhnfN9Ju8UDg8QFETu6 odAp68RzS+/XtFlrDA8FMHoFGvHmrkk6Wlx9OSSaWecquiNrwQ6XQtKiUIDh+v4jmmoA H/ZA== X-Forwarded-Encrypted: i=1; AJvYcCWpdq0heGbwfCOGSnL7YamUauPeS5fSJNaxT7wQvS1FNHplH8XeI/htWlwOS3BAvh/q9pRxojSGPZCV900=@vger.kernel.org X-Gm-Message-State: AOJu0YwAVn/YPBM2nZnRbpBuZEu3jBkCnIKoV/i8I3Kdo8RQQ4LfeHSl zyW4I52X0w1Xo3go5GpQQH5BVW6Wxa8LtoYjrK0Nz2wvD1PmpFJH/4OELni9KTQ= X-Google-Smtp-Source: AGHT+IGql7rcBkBJZy/lkpZXVd8eJAHNb/N13bQ4wyVM/GFRhvhCqwbQi4nJvY1Ydgt8QtXoBjQJgQ== X-Received: by 2002:a7b:c459:0:b0:431:5f8c:ccb9 with SMTP id 5b1f17b1804b1-43283255a2cmr1881175e9.17.1730386837895; Thu, 31 Oct 2024 08:00:37 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:37 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 01/14] scsi: ufs: exynos: remove empty drv_init method Date: Thu, 31 Oct 2024 15:00:20 +0000 Message-ID: <20241031150033.3440894-2-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Tudor Ambarus Remove empty method. When the method is not set, the call is not made, saving a few cycles. Signed-off-by: Tudor Ambarus --- drivers/ufs/host/ufs-exynos.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 9ec318ef52bf..db89ebe48bcd 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -198,11 +198,6 @@ static inline void exynos_ufs_ungate_clks(struct exyno= s_ufs *ufs) exynos_ufs_ctrl_clkstop(ufs, false); } =20 -static int exynos7_ufs_drv_init(struct device *dev, struct exynos_ufs *ufs) -{ - return 0; -} - static int exynosauto_ufs_drv_init(struct device *dev, struct exynos_ufs *= ufs) { struct exynos_ufs_uic_attr *attr =3D ufs->drv_data->uic_attr; @@ -2036,7 +2031,6 @@ static const struct exynos_ufs_drv_data exynos_ufs_dr= vs =3D { EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX | EXYNOS_UFS_OPT_SKIP_CONNECTION_ESTAB | EXYNOS_UFS_OPT_USE_SW_HIBERN8_TIMER, - .drv_init =3D exynos7_ufs_drv_init, .pre_link =3D exynos7_ufs_pre_link, .post_link =3D exynos7_ufs_post_link, .pre_pwr_change =3D exynos7_ufs_pre_pwr_change, --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 586121A08B2 for ; Thu, 31 Oct 2024 15:00:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386843; cv=none; b=WGBBDz//DfKaoIkm2hdTfpsgRaAPn/0LBCw7YlcBU6O1+RfA33uR59vPqj5AnclebTvSY2B9IFKbPBZxjZEfhWHS65DhD6Ylgz4llt0r6xkSHk+K8mq8MjEHNeRAkk50bnFEtbCrmKmLTWvXlXOyYqLLkgpKHRbN3R8rgAfYgNc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386843; c=relaxed/simple; bh=qOf4UUPveJd5YdrdUO1pCl79q1awY5ngMelw6WYeoBs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qSrRQvCHe6xGCRkrPs8xjrQs7gmqymPsFggBqn7Hv2H1XGng7N6g2e6lzQEDjEr1FIFdFMePmhzqztAATk3VRgGOJA46uNgzMMA6j+xIOyaCR2AhXrQd3c+z+bmkYbBqmKaCGUiG8dzDbfWbBqZLnF71fwdMo5mCS+Mfd8BDI6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=KTLDirTS; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KTLDirTS" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-431688d5127so8184855e9.0 for ; Thu, 31 Oct 2024 08:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386839; x=1730991639; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=urpAMkkpNWFIk6PVSyaaYZWs9YFQU6kSEcUKCd3ox2A=; b=KTLDirTSM7pyZ9ml9gmOwxp+MX7Xo5/rx/w62uD7d0QypbBs8HZ9d1I8SLLHE81ugP yefGAzBBliyI67KOGv41mhKMzyKM2xZZ4V9eej7oRiaEQitPws3LiCMYzbCTI6VT7THe L1IC5GKAWoxI6b7bQCOBdu3Zwm33R9YIC03OhS/1H6cS5TdUlcFkM3nd9Owb+p39MA6U q3KZft9kMlIacBE7Ji7NREHWkax5+Q1TeYK086pWd8B1QT5U72IHy562DImnP5kO80hV DIiJYrIIAx0RdCz2CvP6JDiMx1x9FzwUW/VRdGGgf3KdGftq95C3URKpvT8mx8VS+rNH ncuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386839; x=1730991639; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=urpAMkkpNWFIk6PVSyaaYZWs9YFQU6kSEcUKCd3ox2A=; b=mZ9eRnggFCUUEoa5e5dEH2/VQzNR6rfcHp9hdqNUEQqFo0NJofFE2OHlUqqxcmLoGr OqhX5VIHW8gWKHbZxL5lyF0v8ayXaq0PjzmWEbNWlZ74ipTaatNQAkN0CiRhSpC+qlR1 Nki64FbDpHTTTuAnUqmlH5jIjVn2NbMi96q3zBNWV81XkYlXlmKNXScaTBU2PYK1GCq2 +XwaMpNE/fLGhbV1q5YnBXRUe1WIKGmEIlO8OzQBYYvSrjue4jfvoRwQKY9tDF18BRjR 3M97w6VIyieuwJ4mmQgjw9vawbpzOEjZMevIH6Mz/j7VLFoT295W+0ovBtkMcfpdAuKN EDpA== X-Forwarded-Encrypted: i=1; AJvYcCXGsnjrT6Frxgys5YAEur6oORZzRTOfpsxSK3vEmRpelShULLWsPFNCSEjh5Owh6dHeVDdEyyF/5zhlxgE=@vger.kernel.org X-Gm-Message-State: AOJu0YzW7Ejot/ctir8ZxY5z+FfEq4uN0FXTtn0bX4qcXc0AW59ABsLN I6zXN4qjeX5vhNb26UIbdw8JT98MB8/ZbHLGmS4gn86PewlmOyBLJqG47PV//KU= X-Google-Smtp-Source: AGHT+IFTosXWqLxskayZ0wRDzdlL1GztSsFX/UDdCXtOBwG7ObEMDNWxQFLNrN1eK+iWQPCODsvrkQ== X-Received: by 2002:a05:600c:19c8:b0:430:54a4:5b03 with SMTP id 5b1f17b1804b1-4319ac6fad6mr150296415e9.6.1730386839067; Thu, 31 Oct 2024 08:00:39 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:38 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 02/14] scsi: ufs: exynos: remove superfluous function parameter Date: Thu, 31 Oct 2024 15:00:21 +0000 Message-ID: <20241031150033.3440894-3-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Tudor Ambarus The pointer to device can be obtained from ufs->hba->dev, remove superfluous function parameter. Signed-off-by: Tudor Ambarus --- drivers/ufs/host/ufs-exynos.c | 4 ++-- drivers/ufs/host/ufs-exynos.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index db89ebe48bcd..7e381ab1011d 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -198,7 +198,7 @@ static inline void exynos_ufs_ungate_clks(struct exynos= _ufs *ufs) exynos_ufs_ctrl_clkstop(ufs, false); } =20 -static int exynosauto_ufs_drv_init(struct device *dev, struct exynos_ufs *= ufs) +static int exynosauto_ufs_drv_init(struct exynos_ufs *ufs) { struct exynos_ufs_uic_attr *attr =3D ufs->drv_data->uic_attr; =20 @@ -1424,7 +1424,7 @@ static int exynos_ufs_init(struct ufs_hba *hba) exynos_ufs_fmp_init(hba, ufs); =20 if (ufs->drv_data->drv_init) { - ret =3D ufs->drv_data->drv_init(dev, ufs); + ret =3D ufs->drv_data->drv_init(ufs); if (ret) { dev_err(dev, "failed to init drv-data\n"); goto out; diff --git a/drivers/ufs/host/ufs-exynos.h b/drivers/ufs/host/ufs-exynos.h index 1646c4a9bb08..9670dc138d1e 100644 --- a/drivers/ufs/host/ufs-exynos.h +++ b/drivers/ufs/host/ufs-exynos.h @@ -182,7 +182,7 @@ struct exynos_ufs_drv_data { unsigned int quirks; unsigned int opts; /* SoC's specific operations */ - int (*drv_init)(struct device *dev, struct exynos_ufs *ufs); + int (*drv_init)(struct exynos_ufs *ufs); int (*pre_link)(struct exynos_ufs *ufs); int (*post_link)(struct exynos_ufs *ufs); int (*pre_pwr_change)(struct exynos_ufs *ufs, --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 468AC1A42C4 for ; Thu, 31 Oct 2024 15:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386845; cv=none; b=TEx9xWmm6b5HE78aeUpdln17LTaT1OSpOfp0yf0HCK1Gv6eTlguxcM87xQhkKZNjJnSEbSqaThblukthWp/U2v6G2Vor4/V6vXB80urxVX1UWyyDPow7EiXSElGSKO9ycJNIXZpJiStnBuf5JlxCKV0+4AbBeCjxwrZtsCJ/0/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386845; c=relaxed/simple; bh=pDiyAomO3/GYTe+FrPpcIqBq334elIL2TdUV+2JQNqo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZwYwjvReDGU0Qd15ekp490FZ7clUPNSZoNmreLNBFVF0MVfWfnI/qgmyaW9zK2LoDq9PWXuv6hbTABkwqNmLcQ0PeqRoQt2vKN2Zgz5kGftwd++lpikzR4j+TSXHTeOn+W74bPDBsawhCw78rG79pSWVtpOrJjjzSudU4PbqXHU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=MAoPwGM6; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MAoPwGM6" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-37d63a79bb6so714679f8f.0 for ; Thu, 31 Oct 2024 08:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386841; x=1730991641; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=y2Vb0OX4E/WTGDIc/yOnji+pIDApby9HKvJHMTYprvI=; b=MAoPwGM67d3eTdS4i2uXNTIKbyUDmu/Au9Xr4mYJn8tFDMY2hcZWERva92+5mbywcE iFGj3Inv4sxk9doQMvx4slQ9DCMdq6a0AiMIAQqJnscDoei+/IIjTX05Z+DbXZQJk6jy EeNEmpd3GkJ5KM33XayCKJEODrYOSy1vWyvAVLAN9X+5VoJgOG+appz1WSV1BDGNnC70 iINb8t/cTGdbbRYpkASHo/wEe3rnbFQUozs5lFESqfXoiSgdtPgDEWDwaGSK4MQlOCMe ADHO17MY3375MuCZmyr8/uD7ooch5Ei9BgqjBgBEanHBEapI/Be7gDP+WVjSVql8IX2e DqEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386841; x=1730991641; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y2Vb0OX4E/WTGDIc/yOnji+pIDApby9HKvJHMTYprvI=; b=UQ1LwDGIk49XcZ2Z4QK6RAwEGFPoJGLKLHr/k0Xk+Z+whfIzNyWUQjtxMda3/4qp2M ju6ZK3uJLOiqd0kAnBveGTzbILheT1IUH7hTojoG6nsFV56ZsJ0eRDFMO5bSe3t/+9fA CO6ep3aTeYYFiU0rubR8o5JWZERYIm0z+CPN+NGLKyHAA0UZ218VN3mRxeyBYSw7LQoj yclgHHJO2fHSIK2a0m30jps2JnPevITt8oNW3Qpx4H00YZvp7Qc/5m7iOHjctk8wGOXL Oga0OLm6DgINCN2cNqWO3mILVmZm+U+iymk6pFaOFhpqBFl3WZGEpJZpEFLgiV4myCub N0Qg== X-Forwarded-Encrypted: i=1; AJvYcCVr+HU4mc+WPLwb5N2MyJY6DAkW1io1Bn9HrR/l++Ejcmb6oxdCDUBk6muWJYAx/ccmojO0bpIoCT+okoI=@vger.kernel.org X-Gm-Message-State: AOJu0YxeKxIfxfttqXpaZ1Ag/zbWQHU3cLt0B6YJMSG30+7LF267HFnW vmHmAK9XbIA3+OfgZT6Dt8oZZbzlGKe9MnO/e0U4V4kQRNXyddwI2nhb98P4Fys= X-Google-Smtp-Source: AGHT+IGXtCtOp+k+YpkFkrrnLo8FdCOGm8rJP9u1NXSvYnnTVw6wLqsMEn/qZwk48etVCRMN23bvZg== X-Received: by 2002:a05:6000:1a85:b0:37d:4125:5cba with SMTP id ffacd0b85a97d-381be7d8c46mr2818779f8f.32.1730386840477; Thu, 31 Oct 2024 08:00:40 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:40 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin Subject: [PATCH v3 03/14] scsi: ufs: exynos: Allow UFS Gear 4 Date: Thu, 31 Oct 2024 15:00:22 +0000 Message-ID: <20241031150033.3440894-4-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" UFS Gear 4 offers faster speeds, and better power usage so lets enable it. Currently ufshcd_init_host_params() sets UFS_HS_G3 as a default, so even if the device supports G4 we end up negotiating down to G3. For SoCs like gs101 which have a UFS major controller version of 3 or above advertise Gear 4. This then allows a Gear 4 link on Pixel 6. For earlier controller versions keep the current default behaviour of reporting G3. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- v3: Added blank line and split hs_tx_gear/hs_rx_gear into separate lines (T= udor) --- drivers/ufs/host/ufs-exynos.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 7e381ab1011d..33de7ff747a2 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -766,6 +766,21 @@ static void exynos_ufs_config_sync_pattern_mask(struct= exynos_ufs *ufs, exynos_ufs_disable_ov_tm(hba); } =20 +#define UFS_HW_VER_MAJOR_MASK GENMASK(15, 8) + +static u32 exynos_ufs_get_hs_gear(struct ufs_hba *hba) +{ + u8 major; + + major =3D FIELD_GET(UFS_HW_VER_MAJOR_MASK, hba->ufs_version); + + if (major >=3D 3) + return UFS_HS_G4; + + /* Default is HS-G3 */ + return UFS_HS_G3; +} + static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba, struct ufs_pa_layer_attr *dev_max_params, struct ufs_pa_layer_attr *dev_req_params) @@ -783,6 +798,10 @@ static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba, =20 ufshcd_init_host_params(&host_params); =20 + /* This driver only support symmetric gear setting e.g. hs_tx_gear =3D=3D= hs_rx_gear */ + host_params.hs_tx_gear =3D exynos_ufs_get_hs_gear(hba); + host_params.hs_rx_gear =3D exynos_ufs_get_hs_gear(hba); + ret =3D ufshcd_negotiate_pwr_params(&host_params, dev_max_params, dev_req= _params); if (ret) { pr_err("%s: failed to determine capabilities\n", __func__); --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D152C1A7065 for ; Thu, 31 Oct 2024 15:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386846; cv=none; b=j5dYzLYPKDqXyHXtyqDAIqvY65AX0i98yhJ6ed6OYLVZKu8/FdwkuO2SLRsr8gBeYMvHl8zwjzDgpaBVUEnLUvz99vMzzH0EIs6wujK5wdvb823C/sN4/V3k4cnJlcyHAdIzHsLO6KGKmVYdVNk2wXYcC4jf5xrvc6Cj2Lo6GVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386846; c=relaxed/simple; bh=xDtKwqvnqxZAQP4VrzospgjmeLcn8uf+9e8SZLyCgpY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UxbuLEkiNvtN36xfT+zK6nHjoEHKJ+EHST5XEGpZ/xJgvdKANqRnlBwvD6q2xINYmMwI+6Hm3F8DVYp7H5HfZs6nePdvQc3v8UiM3t6vh6HSA2unlE2tjcbtRcgPaOWJmSI8j9ueNwi8M3N4Jz0KL+EAIze7jMm/2mtxCbRbs/w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=RwsHdhjI; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RwsHdhjI" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4315e62afe0so9071195e9.1 for ; Thu, 31 Oct 2024 08:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386842; x=1730991642; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=usrOkYEIhJMHpNEH11NB+5bvhSO9JoP7forJzaG92bc=; b=RwsHdhjIExPULOr8gokrXIL6m3DfiFvnZ/FHMDuA7Z3LVFvC/7zrMMeVVViBi8ieoK 9UcN7MsodWT0pitCRrwixcwafmaVdBFeN3OAj8CMvueOI62BF/32KUoyVM312Y6A+dH4 7jkTLib2OkQV15e894FzYUdqpfx9fF799RPdKQJ/gK3ZTl824CdGiJoM3dnCvYnj3L1D TKuw4CCmzsfSw/Riw55VZBRhQxN92Dr1LzJ9JxnHwsfZLpz6r4GcwE1A3a6szUoUxPDv dhhcMjs0HBgZUpcpRKWV6A4n99uFnfFt2ofLu7NC0Z4O+62zlUYVbjrCLb9T9bXXl5Md 9RSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386842; x=1730991642; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=usrOkYEIhJMHpNEH11NB+5bvhSO9JoP7forJzaG92bc=; b=iiHJX6t/ZYVYEUThtZkBSXLjvEENaQRulty6mvOT6wBCIOAwQwj5nHh45LaJ/sZDcn GFb5mJbGwVsBMSnM6EumR/IRhlWUHSFUiwmGWhSMSTUJEBIpcw92ihLKcMXgaxjNMLBT E+lGqEicE0tz4NRq6AKzcqwWxqrfATaIebYMoj6Lwv5kX8T4LRCz0+Yh7che/RjjhcSr lYLJ956gfnicYzvv+tc+Cw619DuhYve7WNrnN7V1GURyndf35xuOpOHNrN87qKLbtN7X 3nFOuY8guvdItjlg2SkNRFljNarmlE0fdPH2GjcNlRO9a+ElX+oefB1iraEGeq8oxjC8 5mxw== X-Forwarded-Encrypted: i=1; AJvYcCWUnBGmAIgY2jhXCpfTn4nvwkkraxqyKYyYf3j7jWLkgpEBjD013nwSiK1hLSfuRsAddzKfBSF04SuHyY8=@vger.kernel.org X-Gm-Message-State: AOJu0YzpKYpYMUMewZJJ48gLLcUtPOBEw3kpe8kobrNsXnSBocfGogz8 qa9oxh9R4HXfgMFlcnP9KhxAHAy8dCkhjngZ3g9hgwSw2MLHJjOdhtNYzWpH6RPmyBvW7h3ESCr 8mEw= X-Google-Smtp-Source: AGHT+IE2nRqDWcprFbqsyiRnRrZSmdUyGUKgVh+UN0C5kREuaiIMyson1wnaLb7mms/VbQSk1nr2fA== X-Received: by 2002:a05:600c:4a88:b0:431:9397:9ac9 with SMTP id 5b1f17b1804b1-431aa292eb4mr115733635e9.15.1730386842144; Thu, 31 Oct 2024 08:00:42 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:41 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin , stable@vger.kernel.org Subject: [PATCH v3 04/14] scsi: ufs: exynos: add check inside exynos_ufs_config_smu() Date: Thu, 31 Oct 2024 15:00:23 +0000 Message-ID: <20241031150033.3440894-5-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Move the EXYNOS_UFS_OPT_UFSPR_SECURE check inside exynos_ufs_config_smu(). This way all call sites will benefit from the check. This fixes a bug currently in the exynos_ufs_resume() path on gs101 as it calls exynos_ufs_config_smu() and we end up accessing registers that can only be accessed from secure world which results in a serror. Fixes: d11e0a318df8 ("scsi: ufs: exynos: Add support for Tensor gs101 SoC") Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus Cc: stable@vger.kernel.org --- v3: CC stable and be more verbose in commit message (Tudor) --- drivers/ufs/host/ufs-exynos.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 33de7ff747a2..f4454e89040f 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -719,6 +719,9 @@ static void exynos_ufs_config_smu(struct exynos_ufs *uf= s) { u32 reg, val; =20 + if (ufs->opts & EXYNOS_UFS_OPT_UFSPR_SECURE) + return; + exynos_ufs_disable_auto_ctrl_hcc_save(ufs, &val); =20 /* make encryption disabled by default */ @@ -1454,8 +1457,8 @@ static int exynos_ufs_init(struct ufs_hba *hba) if (ret) goto out; exynos_ufs_specify_phy_time_attr(ufs); - if (!(ufs->opts & EXYNOS_UFS_OPT_UFSPR_SECURE)) - exynos_ufs_config_smu(ufs); + + exynos_ufs_config_smu(ufs); =20 hba->host->dma_alignment =3D DATA_UNIT_SIZE - 1; return 0; --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B4DA1AED5C for ; Thu, 31 Oct 2024 15:00:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386847; cv=none; b=bd139LdMOLcmqoSbXb2gpkKWaEQE7glaEE7b62sm59X+0XtRurppQNtAef8vkpEpapZsnZpBY2X+imB1VbzKAl4lJRy9KcaTJy/xJOQegMXHaeJAZYxPg5aFuhqPr9C6/8tg4vpa4Lt7dUDjG/t5s5zKUu5/qKIYsJY5Jtf1yLc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386847; c=relaxed/simple; bh=XQ6lVdO/7PywiTR9Hdfz8GxGAKaSLgkznc4FBkJ+NM8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tCvJwJ5yAqvqSPgeFqNiyQ9daSBweJftTkPMQs2FYPvvU+ntwH+QBJGykaZw4c+QFCFhxKMNDMQ7kbFbzHiZqeKlRi7TpjDdJoH0MP1pKH5D1skoK+1n9h25KUWVILXYAZCE/UaicjgrU3zjxi3KaKoZCElR3Oz9EhJOMfqXBg4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=REi5PMzs; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="REi5PMzs" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4315f24a6bbso8106075e9.1 for ; Thu, 31 Oct 2024 08:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386844; x=1730991644; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=86sA0f6Os+pjSfGkaxQ4yImAusqnRJDENyNfYooIZr8=; b=REi5PMzsTUkrZruNOCMEGAHaD7oq5SZBFqZrNsRBv03+4M5H0BB5bpf9tG9G6iFcVU +zb44qfXNLfQrFUEumAJuhsD7buhlRyIBDsjPVD/x2Gs2N7IGKUUebwpjDuB2jA2Q8BN UTJQ+67GrBRZsNZpDXpn8tyMkooARiY/AwDi4ryzQF8SWx+z53ektiI29lQdDWN2K9qW 6TtivJDuG2QEQTOW7WyxelOxwzubLCZC5s8QQ+FsZzvLVHgoqx1nN9VsGmJVSx9mui/q QPBdcc66v6xABxqTDGSsl+CpKGbme1ngNOZ6XsmFYAU0ZCCI2JDB434axeb82rNuVriv nPqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386844; x=1730991644; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=86sA0f6Os+pjSfGkaxQ4yImAusqnRJDENyNfYooIZr8=; b=TzYI98ruSKH1k+VdaMEdp5O5mzjPqq8cZMmHVZIKSzw22804/tG/zz5Sn5uoNyyn49 m8o+P1JnTecwidhMXGY7RGVn7he2/X6qpUwKW9Y32JThnNL4JofyfW1ZUF9Ep+8hKhUH RJX0MxjfHpESOdOjoO+xH0owuG55kIVtN8vd0nf0FbbSU1qA+579De6gn3SSwbj+6ukL yxVLLobjAc5N6UwvAUhPq7M1anhC1zMk3c9vkHOavvaUoyd3YoOAVdKqzchXYQn36y3V rp7cJU7Bh4KptybXcyRop9qi/+blriVmDRyF/+HRYYVaVaG4dIJTGuewbs8iDl6+5/ov SCfQ== X-Forwarded-Encrypted: i=1; AJvYcCVQsdOu4tTrUNWy9rlQJRnD6SLdiaP5SfRQGQt5VBhShxS1Ch6hlz44Aq5rYBLb6to2mWqiarRWcjzmsUk=@vger.kernel.org X-Gm-Message-State: AOJu0YxvlJln3llTjkP0jcr+69qf3sQ0ovS52VO5IMuCo/3agTDqQ7pk P2Nxiz63WQhglGX96hM0c8DbSdxrPhe0L/kcI4Ma3fcrplUO2lXP4Ql6AzQEOt8= X-Google-Smtp-Source: AGHT+IHBzn01GkaFrVY+fjAehvpLRixtUxLHicSEaRnq3vqepb6mFx2FPf0yhN2kuBANtTE7+uHjZw== X-Received: by 2002:a05:600c:46d4:b0:427:ff3b:7a20 with SMTP id 5b1f17b1804b1-4319ad049a8mr154531185e9.27.1730386843327; Thu, 31 Oct 2024 08:00:43 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:43 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin Subject: [PATCH v3 05/14] scsi: ufs: exynos: gs101: remove EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL Date: Thu, 31 Oct 2024 15:00:24 +0000 Message-ID: <20241031150033.3440894-6-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Auto clk control works fine for gs101, so remove EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL flag. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- v3: Adjust commit message to use imperative (Tudor) --- drivers/ufs/host/ufs-exynos.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index f4454e89040f..2c2fed691b95 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -2138,8 +2138,7 @@ static const struct exynos_ufs_drv_data gs101_ufs_drv= s =3D { UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR | UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL | UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING, - .opts =3D EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL | - EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR | + .opts =3D EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR | EXYNOS_UFS_OPT_UFSPR_SECURE | EXYNOS_UFS_OPT_TIMER_TICK_SELECT, .drv_init =3D exynosauto_ufs_drv_init, --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CB291B6555 for ; Thu, 31 Oct 2024 15:00:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386850; cv=none; b=Rl3quiQiNk9vcnouScnf+eY7UMhxMfm//u6SwpUpT0YEqabVM1izQvuLOpfwynqF9Da580oIswkjxOJ7E2mfB8wBn0EAsZ1rozmt4yv8XFf8KRAXY96QMhpaioSGlu3eSj/b2+bQElGx+rho+FVXJD2qSn8niwWisWewIkZRQ0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386850; c=relaxed/simple; bh=FSTQzgStkDk9VUc+gsKO61mfM9QA+iMwJ9eF0K091kA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N5aOTt3cqmMp/kc9JiEeh1egQj655tjamoqQr34u3gXC14DvVJBNMIesDaZK7QyMnDOdRacxxwjhVn3PWUek92nhBwl1pEOLKjC4zIThA1LFEc1OTLCaGvIq02Fq/as4267wPafyLLqfUfy8vJ7+FXmn5hngRPHaY79jgXqsIWQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jG331kOG; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jG331kOG" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-431481433bdso9176445e9.3 for ; Thu, 31 Oct 2024 08:00:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386845; x=1730991645; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HABtOu8vBnUR430AFYIUSUDi3ELEcFC5jVUmm0tB11Y=; b=jG331kOGlx7cm18wCCreGTLG/dtm9oJFI6eVCYPVG6HfwIOB0dgY9XuOwICZBUJESS XWPUy2Y1XPRsz4qwRUAEnJOSMWe9Od7iC7ahbrD1PznW62WKmevBa+2MI6gtE/hRXiQr 28z4/cpK65ienqBNxDwdXOARtcd+rprysMKvS4f43vX6l7c/EG9R+2Sj0upKinY+HmPN qDhmxXEQaOIy2faNFVVrZ5MufmxeEylrRn1Lu1S7vSK3EcJWqH6cqZCeIF3FHsd/uZz9 WXSU+1q6ng8a008gLYDeW/3t8V01Z2m3c1xOhucW4R5NoHuvmRjPLNDJD0jUeUArn9FV CBEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386845; x=1730991645; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HABtOu8vBnUR430AFYIUSUDi3ELEcFC5jVUmm0tB11Y=; b=HwHyPXocEgKcxT07DmTVe0vjQSWGxngVL9fAGgAEHi1b5yJ728f4Nnv/6tVm2IyAca CQ4mEknlYt1eDM2Uh9XiyOJA9o/uqqFa7fcau6ePVFumngNfRGbJDGBvO/CjYFDo44lq 9EH7X0+BJXCrohdFoD+fKozsN4macHMGtg3cjBtg9vV2xAQncmKK1Raf58FhjEUVaRal c5DKfan+FUbHDlFGfTjiMvRGWSImLF+F1GateQWEDUPXemJJGVtLt9XL41Qs3s3crfH5 6OccSXiDSZPYgTYo73j/mFYQj1FA2SMvGl4Qg5yh35MB9lO7nyMV46bOybNZ8ygKmoEq Xrgw== X-Forwarded-Encrypted: i=1; AJvYcCWozD6xXlIi4DSMB0aKnSUHGWD+Sro8hfYIUcU8M3ekUGbxkV8vyAlQPj3XJYwtqC/GgQ1+aNiFwvIzqSE=@vger.kernel.org X-Gm-Message-State: AOJu0Yzf1Iy0mJshofAu4vxuqCSK6AzKx5UGGqRY6hfxCCCOSwp9ubP3 SCJrwhWqrgGk9SZ7LXKguttFrUioffnE/D+QB2z35/dyAFmqOr3PT9B49m6n0RQ= X-Google-Smtp-Source: AGHT+IHrOUYyAxFC1VJUc6y5oX3ddkyV0eSXyUdqL+WEdAPlUpCNJwf8n2c1O5ZakYFeCDJkSDGQIQ== X-Received: by 2002:a5d:64a1:0:b0:37d:4fe9:b6a7 with SMTP id ffacd0b85a97d-381bea1c1f4mr3210183f8f.36.1730386844715; Thu, 31 Oct 2024 08:00:44 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:44 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin Subject: [PATCH v3 06/14] scsi: ufs: exynos: Add EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR check Date: Thu, 31 Oct 2024 15:00:25 +0000 Message-ID: <20241031150033.3440894-7-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The values calculated in exynos_ufs_specify_phy_time_attr() are only used in exynos_ufs_config_phy_time_attr() which is only called if the EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR flag is not set. Add a check for this flag to exynos_ufs_specify_phy_time_attr() and return for platforms that don't set it. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- v3: update commit message (Tudor) --- drivers/ufs/host/ufs-exynos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 2c2fed691b95..0ac940690a15 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -541,6 +541,9 @@ static void exynos_ufs_specify_phy_time_attr(struct exy= nos_ufs *ufs) struct exynos_ufs_uic_attr *attr =3D ufs->drv_data->uic_attr; struct ufs_phy_time_cfg *t_cfg =3D &ufs->t_cfg; =20 + if (ufs->opts & EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR) + return; + t_cfg->tx_linereset_p =3D exynos_ufs_calc_time_cntr(ufs, attr->tx_dif_p_nsec); t_cfg->tx_linereset_n =3D --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BE191A2C0B for ; Thu, 31 Oct 2024 15:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386850; cv=none; b=oJVHtc79CNidaji6Z2ViiZaOpDL4sC7Iceo2rmi8GKNHABXGIpPxchfHnggDQiKy75d4rKINtKw7bj1GML8bfT4RK0qHbDxtoVUeZ6rCwizKaTFWLfGSa2Dl5lZCWE/Sa6Vnbgtrh9adzk663SE3l9eh6zWVsasnSuINYX7gMHw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386850; c=relaxed/simple; bh=ObJIfaZjIKHh2LbJ+suNUf2iHwIx5ihpEmFxKcO6q9c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E1GDLtSSxjBazktJA5pyWgSlOravN+4R0JKoNUY4p6kT8J+vrAWMqgIXy8IZxPbJGfcCHyPBaWY5L5Y3LZsihhUM64J0Y9Ga1gQL0VnGotJGn35IgI5BtGqXLXg/BuPo+ySZpUJLz8dfId9ZnEBBSDEfNYbDDSW3CoJCEtnxwNc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Iod0Gc1w; arc=none smtp.client-ip=209.85.167.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Iod0Gc1w" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-53a0c160b94so1153781e87.2 for ; Thu, 31 Oct 2024 08:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386846; x=1730991646; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EGlRIDiWOIW/oUdNVyUFBt1pPENWr+qbw5BPnPtDdZA=; b=Iod0Gc1wm9r/tQcEGZhbGPRtblLbczKj7gskXDcJ3XZLbdZld/ihcXeUkSDRT/3HFB 1bWh00Z8fT2bP/irD/TvwZXSxTxyNYUsJrO7VRuWqmYANtoZCSMycbnEvceRqUzWBfn/ LEax47MJ+OIQxdiQL6pnEPdlpNgzEnsiYdfgJwQJ0ugd1t9DUX2xH1FQzNS5knIGU4rH zoT2+0c0g9yBP/4/8ffPeDIt1NJkxZKrs1V0X7FgJK1u1+QQpbcyZScZ13+SNyUnN5+a sF0A9NWYYefZZAOn+3RpTMmlpbUm77/1RfdBfVUBNUl1h47tGExQUcM1mPD0WNQrlhOX 6myA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386846; x=1730991646; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EGlRIDiWOIW/oUdNVyUFBt1pPENWr+qbw5BPnPtDdZA=; b=QGvK21HdqkSqUh9r4xnsmEOQ8y6UQfWBbwN/HMfkTQowaaEQ4yOaaHPzymtuu89/Ot BxEOW6xfcqpOYoHU0ES29itlukrJbj25HJBQdQpgwnyFCsNX8/kp+IOpKN8YT0b2zZs3 A0+hNzrOPTeCmW2Q/a0mA22XilZRB5Pkn0ds71ZBKRS3L0jc/56Or6OikKlCWDVFB596 /dzyMehLnMaMvojmdxaIKSEEhL3FTcVBrRe3uPahRP+e9U6wwaMAIYx9J16YJSs9hpcq mCqHr6UV1WKjeJvGirnwo9lw7re26EHWgjDkS4imLUDV3b24PGZ1FH0jmcd5yqG7CKSU HpTQ== X-Forwarded-Encrypted: i=1; AJvYcCXAZBOTLccVNNmD02aYgXaY7j+v7QVOrYOzVOJvE25SPmohg/Uxo0JGEREfQr1bkpUwG/Z9vwF7Glh5W0M=@vger.kernel.org X-Gm-Message-State: AOJu0YxqvHs5pUbAHYHn8zBeDb0URMEABQ2Q6BLmaKfdXo/64jyp4zeR eRsDcRE6NtjaigJK8SNlOb95Lta99MxTEjwJKQql3MoVO+bpYO+6O/G7QWgEI4Y= X-Google-Smtp-Source: AGHT+IEXzbBlOP0V8hZQy8KaxBb5hcC2ucoOBrtqsnAW7CPkAU8t5qtuC/NhFTjTUjwZ36RRBVibJA== X-Received: by 2002:a05:6512:32ca:b0:539:93e8:7eca with SMTP id 2adb3069b0e04-53d65e02513mr162912e87.35.1730386845937; Thu, 31 Oct 2024 08:00:45 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:45 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin Subject: [PATCH v3 07/14] scsi: ufs: exynos: gs101: remove unused phy attribute fields Date: Thu, 31 Oct 2024 15:00:26 +0000 Message-ID: <20241031150033.3440894-8-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that exynos_ufs_specify_phy_time_attr() checks the appropriate EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR flag. Remove the unused fields in gs101_uic_attr. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- drivers/ufs/host/ufs-exynos.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 0ac940690a15..e477ab86e3c1 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -2064,26 +2064,6 @@ static const struct exynos_ufs_drv_data exynos_ufs_d= rvs =3D { =20 static struct exynos_ufs_uic_attr gs101_uic_attr =3D { .tx_trailingclks =3D 0xff, - .tx_dif_p_nsec =3D 3000000, /* unit: ns */ - .tx_dif_n_nsec =3D 1000000, /* unit: ns */ - .tx_high_z_cnt_nsec =3D 20000, /* unit: ns */ - .tx_base_unit_nsec =3D 100000, /* unit: ns */ - .tx_gran_unit_nsec =3D 4000, /* unit: ns */ - .tx_sleep_cnt =3D 1000, /* unit: ns */ - .tx_min_activatetime =3D 0xa, - .rx_filler_enable =3D 0x2, - .rx_dif_p_nsec =3D 1000000, /* unit: ns */ - .rx_hibern8_wait_nsec =3D 4000000, /* unit: ns */ - .rx_base_unit_nsec =3D 100000, /* unit: ns */ - .rx_gran_unit_nsec =3D 4000, /* unit: ns */ - .rx_sleep_cnt =3D 1280, /* unit: ns */ - .rx_stall_cnt =3D 320, /* unit: ns */ - .rx_hs_g1_sync_len_cap =3D SYNC_LEN_COARSE(0xf), - .rx_hs_g2_sync_len_cap =3D SYNC_LEN_COARSE(0xf), - .rx_hs_g3_sync_len_cap =3D SYNC_LEN_COARSE(0xf), - .rx_hs_g1_prep_sync_len_cap =3D PREP_LEN(0xf), - .rx_hs_g2_prep_sync_len_cap =3D PREP_LEN(0xf), - .rx_hs_g3_prep_sync_len_cap =3D PREP_LEN(0xf), .pa_dbg_opt_suite1_val =3D 0x90913C1C, .pa_dbg_opt_suite1_off =3D PA_GS101_DBG_OPTION_SUITE1, .pa_dbg_opt_suite2_val =3D 0xE01C115F, --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AD351BCA05 for ; Thu, 31 Oct 2024 15:00:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386852; cv=none; b=WmY2SwS9USu7V6iTZwAGGc5uJ/uo6tP//n8McGUZAPfrtEN8aer+g6gX3qzhwO1OtRNrX+/jksFgpJ05lmcU73Rx9/GTqGad5j/u1XCY2eZrZF3Kv3JRxCRZFYEbcakVyNOxyZMCGTKHLiWpGShhaYC/5LeBoEgTKQ6yYwWuu9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386852; c=relaxed/simple; bh=W5vmLTxbqbRWektRkfu8sRg+KXRkgNHrmzi/8ND27KE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nn6824eZ2R3L0XcBqhNlJSZQQY7nNJZLt/uR2aIL/KOy/W4O+tHOTJQ05+TnUiwjQ59Nnl2Po2hj0yfwQxXCaqNmPrOhbzH7tdgOjMDaux+YVLJOTAUVztNhUtKzuIn2pJYirr8VScmAh8VtRZfu1s2aTcpfsXRAJoEZSKcSLWM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=KsoZYNCZ; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KsoZYNCZ" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4316e9f4a40so8648105e9.2 for ; Thu, 31 Oct 2024 08:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386849; x=1730991649; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CdJwrtv6R6hjXktx6QL/5y82lOaBKNXG+b2XzR89bZE=; b=KsoZYNCZgP8wc3K1q2K1VZEbwM4W/gnGpfabkAQkSRXxVExXORzTt0BGnhvqOtk3pG cDHd19p0xHF31ZdUTdlqawR/5FBn10bGGMHXVwQEBiVbL5MKadNJzka+tnCaNTon1VTU TnjL8Oai2klrUpQzPBYj9kcFt39vpezaOxakmvDRXs9Lq7b7ubmyiIgK2DYzhe2+ndoy M4kr8FaVEw7Z1IXqDj7HkDMlblAlLtWb9HvcoXzAPVyLEyNrbnDRA2rAzorSBe8pY7Bq CyQOQrOMUdS5+H7OtP7xJfDzugJ99l3M1HwoJSnyRyRh7aos39SYkGuTRL3zsAZCKN8w eL8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386849; x=1730991649; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CdJwrtv6R6hjXktx6QL/5y82lOaBKNXG+b2XzR89bZE=; b=GoZDrrr0oPi71I+9HXa6PSLpsAM3MQP3MM+Ygv3DRsa+aW6LlxngzujLl4oc1OGQ61 Q4VRn3qysqxr92+vOVVX3UxTgWyzjxAcAOtDeviF9kc/uZtBjTYsk6hVS3o5Fk1jpVkp Zp7Sv2/dvs+LOz/fvmBkdSps1EhniC9tEKBHj7ktUTbTHYkDJWkEkmm65SJAeKe3TvMu NP2enJXtpW7DM9IFaQDoLZgnnldAdks3PU2AKlySA74O5qpGRll7mftuzWeO0uip5PtN 7ansF7PRHXmoj1FO5iLKoNphCP+7lG6LRQtbIaRqfqjy2xYdDVBfdK4rQCUUuVkf5t61 RTHQ== X-Forwarded-Encrypted: i=1; AJvYcCUqyF+HqnTkGTjj/yBCmU4VDyUBYai2E7cBjCixW5qA1KHjy/5wuRCxX+cFNrZ/zN/69VlfY+uKseZ5PQg=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6UM831yQ4C2Doz3bL91RTZr5Uk3LVF2qTKFsrMlyIWAt6Ms5U QS4fs5jcSBe4ynM2YZwvTAPhwX1c0eG98zKu8sDoyz9MFILbOHC+CwfLfeJPHpYQ67wG9z5nISv Lgio= X-Google-Smtp-Source: AGHT+IGte4mqUxYrFCHTiw7rYYrBl9FrCw5E7TjmHzs9HacaVeMVUjhzif1Rg3DaulCZuAOdHbN/KA== X-Received: by 2002:a05:600c:45cd:b0:431:5eeb:2214 with SMTP id 5b1f17b1804b1-4319ad363eamr152298075e9.33.1730386847155; Thu, 31 Oct 2024 08:00:47 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:46 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin Subject: [PATCH v3 08/14] scsi: ufs: exynos: remove tx_dif_p_nsec from exynosauto_ufs_drv_init() Date: Thu, 31 Oct 2024 15:00:27 +0000 Message-ID: <20241031150033.3440894-9-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove the assignment of tx_dif_p_nsec as both users of exynosauto_ufs_drv_init() function (exynosauto and gs101) set the EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR flag meaning that tx_dif_p_nsec has no effect. Additionally both users also set the samsung,sysreg dt property, meaning the execution flow will always return on the regmap_update_bits() call before the assignment. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- v3: update commit message (Tudor) --- drivers/ufs/host/ufs-exynos.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index e477ab86e3c1..378c16d905c1 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -200,8 +200,6 @@ static inline void exynos_ufs_ungate_clks(struct exynos= _ufs *ufs) =20 static int exynosauto_ufs_drv_init(struct exynos_ufs *ufs) { - struct exynos_ufs_uic_attr *attr =3D ufs->drv_data->uic_attr; - /* IO Coherency setting */ if (ufs->sysreg) { return regmap_update_bits(ufs->sysreg, @@ -209,8 +207,6 @@ static int exynosauto_ufs_drv_init(struct exynos_ufs *u= fs) UFS_SHARABLE, UFS_SHARABLE); } =20 - attr->tx_dif_p_nsec =3D 3200000; - return 0; } =20 --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9E451BD008 for ; Thu, 31 Oct 2024 15:00:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386854; cv=none; b=nyHuRIL6QeRcyMsSa+TzCJtqxINddt9bNjM5mGEBv9q5BoGFhssLIdptVShyJoLnVqBesIByHQ2jjqIjai9ovppraLBoADjJjYBuXMbeEY8zxpWSn+hE9xuBEZPffDwQhyiSJlgaeYqa1gN10kGsgE/ibcYNpSHX9GUq6c7OQCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386854; c=relaxed/simple; bh=cgC00Z84GRqTAZwgtEtqtGHvbN1Ns7uMwFdz59+HA28=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LAQFGo/nPykugmbiKADFXEwqYV9MZleBGWfq3DcA+U3xyNuFPYBW8deEpgfj816QLiFokltIGBnz99q7njic95+lOILa8GUfjlaBl3sk0Wm4qPmwssBpdl56VQwe9G04+ITol/r6YNXtchvM7LU6xyfhuvTtQJN37Vspg5TPWLY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=q/rFZrhS; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="q/rFZrhS" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4314b316495so9022515e9.2 for ; Thu, 31 Oct 2024 08:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386849; x=1730991649; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+843px0rCbg1sKJc99pP4x3dOG1mc5oHs0HJIyYuQ44=; b=q/rFZrhSfcwcuHKJtAz4QMBdRxnNFvdnxVCVuQjDCGHhYf7/urQQNvPLSeQkXzoI5N B4gBFcmDIKX2Es299zhIgnXySaNaRO4M4MCU6QqCT/iCzSjcWugD/orFTHLLX9p0Ygrv Dy94Fy5dDpvfWNscJw7EDGV1zfGjDdVbhl4s0C9bMtMTegRS+xKxfvWu7KhH4fRHAMzc TJJe2iZLaPWTeuz6SuNGVTyxp6zF2MF5rJSoDnWYNe2S1rX4Dx7ME+ngONWrdJOFddqB AHavRboyX8vtqYMsbK2tIsHlFyUtZWr9YiOLcggYEC4Ewq+sgFxDaBPflaJRk/ytgT/I bsIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386849; x=1730991649; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+843px0rCbg1sKJc99pP4x3dOG1mc5oHs0HJIyYuQ44=; b=Ihg4fEH4CuiXQUKJk0X196/LEnAoFWcbO+rBhpqaveppv54mEVH8T87eScc37TqPR1 ZiawEOWw5Ov//Ifzq01LAKScG/dDkThGVfGHAKtQyrpTOAsP4ZYMRWR6l3fJMAuGgcAX /Y1PuhP0SNzaFE6chZu5lan+CoJIDEbLQJX5yg5oHC2LiAqi0hSzEjxgiI/rp0Jqg9db tR/5904S93+u3xBjn08PHeQD13rJJjCSMl4D1wW14SNEtVglV77o4PWXESBU1GEQJv8g 3fgoEnWSYgCXZ0s0Iwbt+qn/uUqadZKkQ9Hpqq952I1uuJ+FBMAlcSVaM2quGpHof7c3 PXMA== X-Forwarded-Encrypted: i=1; AJvYcCVCCWWblexOivZKk0/HvNYeMy3FxVHlYL5OORj7Pfn2Czp5QTUYiEPf0AWehOWu7UXy63ScYglirvr92Lo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+LoOchRq0cH4zQ981weBbP1iJmreRZWJqLU80ta7EuVLI2cMt 8iETp47vsKe/i/etOuDVjyY+byQ4FXyd7PVbkUORi1TuaGEZNoOHf5cTB/JVJno= X-Google-Smtp-Source: AGHT+IFz1+UYr4hSStn9sPc2pavAOWRlpkPtO9pHTEtEu9q/PXw/hM8RRdJlrb371+ewLtzLK5Lt6Q== X-Received: by 2002:a05:600c:3587:b0:42c:c401:6d67 with SMTP id 5b1f17b1804b1-4327b6f464amr27709765e9.6.1730386848476; Thu, 31 Oct 2024 08:00:48 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:48 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin Subject: [PATCH v3 09/14] scsi: ufs: exynos: add gs101_ufs_drv_init() hook and enable WriteBooster Date: Thu, 31 Oct 2024 15:00:28 +0000 Message-ID: <20241031150033.3440894-10-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Factor out the common code into a new exynos_ufs_shareability() function and provide a dedicated gs101_drv_init() hook. This allows us to enable WriteBooster capability (UFSHCD_CAP_WB_EN) in a way that doesn't effect other SoCs supported in this driver. WriteBooster improves write speeds by enabling a pseudo SLC cache. Using the `fio seqwrite` test we can achieve speeds of 945MB/s with this feature enabled (until the cache is exhausted) before dropping back to ~260MB/s (which are the speeds we see without the WriteBooster feature enabled). Assuming the UFSHCD_CAP_WB_EN capability is set by the host then WriteBooster can also be enabled and disabled via sysfs so it is possible for the system to only enable it when extra write performance is required. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- v3: update to new drv_init() protoype --- drivers/ufs/host/ufs-exynos.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 378c16d905c1..d59e1933b64e 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -198,7 +198,7 @@ static inline void exynos_ufs_ungate_clks(struct exynos= _ufs *ufs) exynos_ufs_ctrl_clkstop(ufs, false); } =20 -static int exynosauto_ufs_drv_init(struct exynos_ufs *ufs) +static int exynos_ufs_shareability(struct exynos_ufs *ufs) { /* IO Coherency setting */ if (ufs->sysreg) { @@ -210,6 +210,21 @@ static int exynosauto_ufs_drv_init(struct exynos_ufs *= ufs) return 0; } =20 +static int gs101_ufs_drv_init(struct exynos_ufs *ufs) +{ + struct ufs_hba *hba =3D ufs->hba; + + /* Enable WriteBooster */ + hba->caps |=3D UFSHCD_CAP_WB_EN; + + return exynos_ufs_shareability(ufs); +} + +static int exynosauto_ufs_drv_init(struct exynos_ufs *ufs) +{ + return exynos_ufs_shareability(ufs); +} + static int exynosauto_ufs_post_hce_enable(struct exynos_ufs *ufs) { struct ufs_hba *hba =3D ufs->hba; @@ -2120,7 +2135,7 @@ static const struct exynos_ufs_drv_data gs101_ufs_drv= s =3D { .opts =3D EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR | EXYNOS_UFS_OPT_UFSPR_SECURE | EXYNOS_UFS_OPT_TIMER_TICK_SELECT, - .drv_init =3D exynosauto_ufs_drv_init, + .drv_init =3D gs101_ufs_drv_init, .pre_link =3D gs101_ufs_pre_link, .post_link =3D gs101_ufs_post_link, .pre_pwr_change =3D gs101_ufs_pre_pwr_change, --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11EE01BD513 for ; Thu, 31 Oct 2024 15:00:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386854; cv=none; b=pHQpUn8uGJjBzYn4cum4Fxo+AKTP5UHqOZe0muubmIR/NDx6RSxavpyy/1BJQnQ1bDwS9TE786vUj1eiK5KX6dLdW7QyVGtShnhLGw/KiKtaPYP62KfUFbuyDRdDOASTLKiJ+P2C5rCsfUssiIagGs/q/31P49l25eFiMZPaA5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386854; c=relaxed/simple; bh=C/GDm+Nqq9XPeSi8uubYBLyjAJFA9X0IbYKCE8IEprU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tDF87htygsk6WDpWXd3F6kdEXWeppwUghE38KLF+eWCgwWqIS449NyVVBPqOfRoZklBO70D6MT17IHrkwmuyvyvBNFbrcuLcYoTfZHOJ3HdBnHfNLt/4UAdu46SewvFr6UqpWO6YFnXzfk032vycxVfPQ1cgjE8yzJf4juAQHww= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=b9lAh2Dv; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="b9lAh2Dv" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-431ac30d379so8707595e9.1 for ; Thu, 31 Oct 2024 08:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386850; x=1730991650; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/9jgbEBOHttlHnzoEFJvpzWVhBO7kDylk6QvL3iIgjQ=; b=b9lAh2Dv7aEHilnRJ5Tia9ufXC3mUsQaQUSdAfW5tBTZl0r3Qks1s5REyYTGVcxwAf eA/u1sLOKDHh1i3/t/+LWVI9x1ii4xPFkeayVG29Hh1VlAK4iA2MBomaxcO3gXtmTUt5 xpfQkDdlsMCx5AUfHxKqU7Cn4LnKF+f1qNXs9DetXAxj8hIe4KtJzLnES3PPsL/t+LEt DAzUdWFfCuwvlJLAhjMWF0bvGrFH8uy8JqtgVAOQ9BYNrreLG97bZ9ty1XMWy24/X74Z jgiW0zt6Mtb3NF0QZgd1exa0GqirKTDzs7EeTlk3/bHYkQJuaS4Vs2HAro/HQkkaTgGg uudA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386850; x=1730991650; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/9jgbEBOHttlHnzoEFJvpzWVhBO7kDylk6QvL3iIgjQ=; b=Ng1nH1upeemnZ9pukRXB5KTELB1w+NyssLl3iQNSFRd6XitSEPOVuzkPYeudbMQckT XBnJgbeXN5ip1NPfObHiZI4347FSdXW+bbaj5H1sESHlMNhFeXQUoVaqWC9M8zrImN0v IYGjpA6dlPkD7hCJX4+WOyuHUkWi94/pZIiJHNsrK8RFQZYuWhgXpjrBrgev8HrzGrIa mVYRocOTjkqafDVLNl48PBRS5wwlAB8Xda85Tw9yrxIcsANnOR8dyYFJN8Ig/DSX65A0 xvfu4/x/pFv7O61KEbfK+8rZtRE+rDLcc9z2E6Vf94RFvtharJFXssPnx/HCAffwuutx hDFw== X-Forwarded-Encrypted: i=1; AJvYcCWSHLNWpT3AJkFtZRSxBO2xTcgiQWX2/FnFzev6sBfkPgyXzJs9zGTBvwkvNAhrmnm2Sc0TvqIE71ZOM0I=@vger.kernel.org X-Gm-Message-State: AOJu0YzgGlRsbPJiGOlFL3UzXzaIiB0myaWNfDPd/CKpkxUIdHlkqemm +JMiLak8j/qKc6TqVO4T6rTjFh9ZF24zZjFiYwgcPw7w2l9yUG2VA7+79oYPK2U= X-Google-Smtp-Source: AGHT+IGBloKnQyzK042bxpPzzNwKfFJqeBubjE+dIc7DcjDnTJukogo204p6ptQH0HImb9KtmNPitA== X-Received: by 2002:a05:600c:1d1c:b0:431:55bf:fe4 with SMTP id 5b1f17b1804b1-431b17365ffmr107037035e9.24.1730386850219; Thu, 31 Oct 2024 08:00:50 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:49 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin Subject: [PATCH v3 10/14] scsi: ufs: exynos: enable write line unique transactions on gs101 Date: Thu, 31 Oct 2024 15:00:29 +0000 Message-ID: <20241031150033.3440894-11-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently just AXIDMA_RWDATA_BURST_LEN[3:0] field is set to 8 in exynos_ufs_post_link() function. To enable WLU transaction additionally we need to set Write Line Unique enable [31], Write Line Unique Burst Length [30:27] and AXIDMA_RWDATA_BURST_LEN[3:0]. To support WLU transaction on gs101, both burst length fields need to be 0x3. As all other SoCs expect the current value we update this in the gs101_ufs_post_link() specific hook. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- v3: fix typo s/burth/burst typo (Tudor) v3: update commit message (Peter) --- drivers/ufs/host/ufs-exynos.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index d59e1933b64e..78307440107f 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -48,6 +48,8 @@ #define HCI_UNIPRO_APB_CLK_CTRL 0x68 #define UNIPRO_APB_CLK(v, x) (((v) & ~0xF) | ((x) & 0xF)) #define HCI_AXIDMA_RWDATA_BURST_LEN 0x6C +#define WLU_EN BIT(31) +#define WLU_BURST_LEN(x) ((x) << 27 | ((x) & 0xF)) #define HCI_GPIO_OUT 0x70 #define HCI_ERR_EN_PA_LAYER 0x78 #define HCI_ERR_EN_DL_LAYER 0x7C @@ -1922,6 +1924,12 @@ static int gs101_ufs_post_link(struct exynos_ufs *uf= s) { struct ufs_hba *hba =3D ufs->hba; =20 + /* + * Enable Write Line Unique. This field has to be 0x3 + * to support Write Line Unique transaction on gs101. + */ + hci_writel(ufs, WLU_EN | WLU_BURST_LEN(3), HCI_AXIDMA_RWDATA_BURST_LEN); + exynos_ufs_enable_dbg_mode(hba); ufshcd_dme_set(hba, UIC_ARG_MIB(PA_SAVECONFIGTIME), 0x3e8); exynos_ufs_disable_dbg_mode(hba); --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D50E41BE87A for ; Thu, 31 Oct 2024 15:00:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386856; cv=none; b=PHJw/D5Q+hc/zq9TG3LXPCQ+1iONWSpRLpanQGCjy6uhW2PYmxrCsNElG8SIMZ48CoFfG+NvOQ8HvxpZanMN0NfrsbHXbFSpVvyuaHxAVI26lXkxAFWjK+f5V+qvgSjHtneLkzz4EBlKnolnLUDpMpd3KMZoQAED5hxIyKNU7zU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386856; c=relaxed/simple; bh=DNXiPZZOPqqCGRsSUrJuQXwDPghQpinVVwrMRAUyp2s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZVWArKiHDmO2IIoomKIw7hi7d5un3gfNPMKsA3sDLW1GfOI8O9Enb8ep+Q0FNSfypSpmaQDRSoaFAREKC5nlcT4oxLad02gLWwY18Xx6S9/OK11MT5u8CZY3QUmEHBc+M7jBI1BD3wr/5MEW7lFIX6IJIN5cgFMeqJ7v7DSDT24= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=rUj1qxSN; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rUj1qxSN" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-37d4fd00574so679392f8f.0 for ; Thu, 31 Oct 2024 08:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386852; x=1730991652; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4dhr5+lgkwJp/4xdbeZNcQAzRLkNmuREPhlR8Kw0nM4=; b=rUj1qxSNBHbEup9MP2VYlTdX3/000FECbtikzv+E+ylkPhLwzEoDCv7mSMXHqUuIQJ WBmKOba/6DIYKQ/ZdX6+fDKeaYblSwpen45y04VqeZrXXy2xgMzHCwu+Mj0w7REyNond gJi044aH98HgkrFj8kaXsBigoBjtujjzfXwm7ybFG7U495nfPhXRmvlyIeWH9JkPSVTc Fq9BFmbzfXahWDcELSdsLXtUJlLZUFw+hBDgTWewnc5VBJe4SAMymBuIn4mVizG3a/WP Bcp3LxcrH2OEYdGY8OCpCm2BOkdT7ng8qFTGBeAMizyLcGoakJx4N1hS1gTkWVi8sKuD fXLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386852; x=1730991652; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4dhr5+lgkwJp/4xdbeZNcQAzRLkNmuREPhlR8Kw0nM4=; b=HrtyQN084U2PTWxzZn3dgLccv7chwJq+FkJhJY3Yed97VeUu/WDEMhaKK5oDcf05ey ccbL2vxItXd8HbRbFCp7sCpUpwGT8C5/OisyKgp0q9LClaXF0zFLrSQRgWuEc7N6qeSj 6Y19UU69Gz5kAQ9g0YmOlNpKayB+nSWrIIwf6O1cseALhsPj7Qhq6OZxuykjyfguNFf0 c6Z1YvxoDkqrGLu7M8jWcyeVGJ0YagcMxDnLX+BQngJlDfUoqtOgkWRII4kW3CuIuh7F xlCpqFjJUBexL7bH7C9NA8YZPaaMxUUpSa8qi5Y1LXQD26IaI+GygjScqh4w3fdCn2pV sjJg== X-Forwarded-Encrypted: i=1; AJvYcCVb6FOjg7Ir0bHP6qKOvFPAtIllZV3cINrehrvHNV5f+cV/M6ZzGeIb5d+f41Tpk6Q4bjkyTRg2izobyn4=@vger.kernel.org X-Gm-Message-State: AOJu0YxZT0CL+wTTdE6Lxwy3QWOhoj0EwG6wcmkvd0BIQxhgQfgWhrG9 pYfxrgWZyXL05PFhLVIuxmRHtlP3uD9o8an+xYlEZl1AtvJexAo4tJehzn3tlaY= X-Google-Smtp-Source: AGHT+IHKfc7pJ6Zm8piuDfmKaMIbjSaLV4oLGDh35XiuzbNsP65XFtHQ4OrcCPyxEHtqyv/uMEAbZg== X-Received: by 2002:a05:6000:1566:b0:374:cee6:c298 with SMTP id ffacd0b85a97d-381c79e3662mr280380f8f.21.1730386851639; Thu, 31 Oct 2024 08:00:51 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:51 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin Subject: [PATCH v3 11/14] scsi: ufs: exynos: set ACG to be controlled by UFS_ACG_DISABLE Date: Thu, 31 Oct 2024 15:00:30 +0000 Message-ID: <20241031150033.3440894-12-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" HCI_IOP_ACG_DISABLE is an undocumented register in the TRM but the downstream driver sets this register so we follow suit here. The register is already 0 presumed to be set by the bootloader as the comment downstream implies the reset state is 1. So whilst this is a nop currently, it should protect us in case the bootloader behaviour ever changes. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- drivers/ufs/host/ufs-exynos.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 78307440107f..5078210b2a5c 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -76,6 +76,10 @@ #define CLK_CTRL_EN_MASK (REFCLK_CTRL_EN |\ UNIPRO_PCLK_CTRL_EN |\ UNIPRO_MCLK_CTRL_EN) + +#define HCI_IOP_ACG_DISABLE 0x100 +#define HCI_IOP_ACG_DISABLE_EN BIT(0) + /* Device fatal error */ #define DFES_ERR_EN BIT(31) #define DFES_DEF_L2_ERRS (UIC_DATA_LINK_LAYER_ERROR_RX_BUF_OF |\ @@ -215,10 +219,15 @@ static int exynos_ufs_shareability(struct exynos_ufs = *ufs) static int gs101_ufs_drv_init(struct exynos_ufs *ufs) { struct ufs_hba *hba =3D ufs->hba; + u32 reg; =20 /* Enable WriteBooster */ hba->caps |=3D UFSHCD_CAP_WB_EN; =20 + /* set ACG to be controlled by UFS_ACG_DISABLE */ + reg =3D hci_readl(ufs, HCI_IOP_ACG_DISABLE); + hci_writel(ufs, reg & (~HCI_IOP_ACG_DISABLE_EN), HCI_IOP_ACG_DISABLE); + return exynos_ufs_shareability(ufs); } =20 --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47C241BD03F for ; Thu, 31 Oct 2024 15:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386858; cv=none; b=CZeWIcZ2tIOQm+L8dbmBa5nRV3w7jx5ejluWLysI8G/fdGuKbOqzdJQTI0N2THInLemp8rBC8r0KAXVcBhutaGAke3KtvQbd1eCa7S7odgJobOIqu5nSUqc0OkHnksMUAFWybStk/+XOweroBAcETPVJbRaylwLz7S4X3mFtLeM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386858; c=relaxed/simple; bh=fvC24w7gj89Nb012evxg+hZIB/Nm64y6FgjqzdxwzQw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RKQ/ssnyFXlF5gdMj4wPyo3HjV5vov6e3C6TQILEGDN1dVIHtNzTQC3WsavJj+m1Xe4otpMulUFRSeUeVx21GwZioaE4GRY5NNtTjhPwirks2q+wKSJHg6PZxmhGT95mypB4xdGpoPbunr9c3dQHFFgxWbpeRXyCXl3TarOSvfM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gJv1F8s8; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gJv1F8s8" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4315baa51d8so9362255e9.0 for ; Thu, 31 Oct 2024 08:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386854; x=1730991654; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pek064Hz7CIKn8YheYCxRzKFA8nRolzJISWb5PBD7ls=; b=gJv1F8s8XZALYcOj9HUWtkVqlgdfoTIWaTgert6zScmpVZ+zAIKfammFIbzC4YrspO anPW8tIeFe5Dj51JMrsfJwjYKJHx6zvU3WbZdXcFkSVkqgniGUoeD9xhXYz1EK37bzCE K8pRodK2aNAC77QSfVL+4ztG3PQFrQC59iJ5ILJIvDO0caufr0vrLfMNhrIi9APRKufl 7xt9y8rAORyhi52hY+05gPwHMm346lnZpldCjnZy4JppjkoW9mOQGDRDvkVVuxbc2QQF JiUahkVOW+CyH9cVuI7wAMJ38l38Ho5KCyfVaPnvfFv1C9oSAD7jVeoYlT/Utq0wwlXB xsmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386854; x=1730991654; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pek064Hz7CIKn8YheYCxRzKFA8nRolzJISWb5PBD7ls=; b=uGKOckhqhkEYWqKsHx/kulLhjRGWgG3cG8BTMsvXi8C/JUTTzYKDdbHj0ejhWx7xR8 2NNpjtkcqtDEXwHrVXcj3smg5jeeO/wM5AtDVv7a3z3Vk34apgOyg72ACGIb1l+K5rxb EOs+S2gpjwtcOtnP5tulloM2nugsbdKpeHZzDy8noi/VlMFVHBZ7RpwZ5QnyAkw/CPx9 q1GkzCQvi25TObLUkKVdoJWMeCGC2Yg8kJWjBfCzivZDpMA1n9Ws2cF7KDIJJXetaACx vbJsjiL2HPBcEDH4KAMylSgLr7cacYX3NWbHiBjlXCiKDVWXlVU1Q+2O5qaYSEC88eWL Tx7Q== X-Forwarded-Encrypted: i=1; AJvYcCXgPda2ASJWdZbDvfv0YoXXCxi1rmngYGzqQaZFK4AuxwmtNJZqAIQR/lkvrr0GVb+rC8RbJqMaVyZknlM=@vger.kernel.org X-Gm-Message-State: AOJu0YxutF70BOzWauhnwQZR7vjV6CXN4l3Ea4vlnpqRmCWcRAmaZ6cF L6ylaAmOBfkBjGo1oBeT7vZDO1fLGql6efDxan3Iy6LG3ZkBaU1TVTa0z2vdCrc= X-Google-Smtp-Source: AGHT+IFW5CC5JRXdKxYGdEgD1gfJan72KWcvXpNH/k/uV7fOOa8gSAbAZdmjlZXVCXNa52l8mJQzTA== X-Received: by 2002:a05:6000:1a8e:b0:368:37ac:3f95 with SMTP id ffacd0b85a97d-381be7d8f8bmr2977899f8f.31.1730386853121; Thu, 31 Oct 2024 08:00:53 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:52 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin , stable@vger.kernel.org Subject: [PATCH v3 12/14] scsi: ufs: exynos: fix hibern8 notify callbacks Date: Thu, 31 Oct 2024 15:00:31 +0000 Message-ID: <20241031150033.3440894-13-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" v1 of the patch which introduced the ufshcd_vops_hibern8_notify() callback used a bool instead of an enum. In v2 this was updated to an enum based on the review feedback in [1]. ufs-exynos hibernate calls have always been broken upstream as it follows the v1 bool implementation. Link: https://patchwork.kernel.org/project/linux-scsi/patch/001f01d23994$71= 9997c0$54ccc740$@samsung.com/ [1] Fixes: 55f4b1f73631 ("scsi: ufs: ufs-exynos: Add UFS host support for Exyno= s SoCs") Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus Cc: stable@vger.kernel.org --- v3: Added Link tag, and CC stable, and Reviewed-by (Tudor) --- drivers/ufs/host/ufs-exynos.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 5078210b2a5c..9b6c4cfd7665 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -1526,12 +1526,12 @@ static void exynos_ufs_dev_hw_reset(struct ufs_hba = *hba) hci_writel(ufs, 1 << 0, HCI_GPIO_OUT); } =20 -static void exynos_ufs_pre_hibern8(struct ufs_hba *hba, u8 enter) +static void exynos_ufs_pre_hibern8(struct ufs_hba *hba, enum uic_cmd_dme c= md) { struct exynos_ufs *ufs =3D ufshcd_get_variant(hba); struct exynos_ufs_uic_attr *attr =3D ufs->drv_data->uic_attr; =20 - if (!enter) { + if (cmd =3D=3D UIC_CMD_DME_HIBER_EXIT) { if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL) exynos_ufs_disable_auto_ctrl_hcc(ufs); exynos_ufs_ungate_clks(ufs); @@ -1559,11 +1559,11 @@ static void exynos_ufs_pre_hibern8(struct ufs_hba *= hba, u8 enter) } } =20 -static void exynos_ufs_post_hibern8(struct ufs_hba *hba, u8 enter) +static void exynos_ufs_post_hibern8(struct ufs_hba *hba, enum uic_cmd_dme = cmd) { struct exynos_ufs *ufs =3D ufshcd_get_variant(hba); =20 - if (!enter) { + if (cmd =3D=3D UIC_CMD_DME_HIBER_EXIT) { u32 cur_mode =3D 0; u32 pwrmode; =20 @@ -1582,7 +1582,7 @@ static void exynos_ufs_post_hibern8(struct ufs_hba *h= ba, u8 enter) =20 if (!(ufs->opts & EXYNOS_UFS_OPT_SKIP_CONNECTION_ESTAB)) exynos_ufs_establish_connt(ufs); - } else { + } else if (cmd =3D=3D UIC_CMD_DME_HIBER_ENTER) { ufs->entry_hibern8_t =3D ktime_get(); exynos_ufs_gate_clks(ufs); if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL) @@ -1669,15 +1669,15 @@ static int exynos_ufs_pwr_change_notify(struct ufs_= hba *hba, } =20 static void exynos_ufs_hibern8_notify(struct ufs_hba *hba, - enum uic_cmd_dme enter, + enum uic_cmd_dme cmd, enum ufs_notify_change_status notify) { switch ((u8)notify) { case PRE_CHANGE: - exynos_ufs_pre_hibern8(hba, enter); + exynos_ufs_pre_hibern8(hba, cmd); break; case POST_CHANGE: - exynos_ufs_post_hibern8(hba, enter); + exynos_ufs_post_hibern8(hba, cmd); break; } } --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 152491C9EBC for ; Thu, 31 Oct 2024 15:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386860; cv=none; b=HEd9ozOqwCe+Jkz5JpznaPZDlVml1aDH3ZLDm1UmHAqKqgO6cgZeISpjA27d7MSXJG6y+ltu2GoteAN9Zu4ymwIFxc25XOomxTpI2T6+3HMyamV2vPJFqZj0X1xBHoCtpfysoHP9SKuAeICC8S9MdDqSsrJjsXNAULjBQo4PxRs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386860; c=relaxed/simple; bh=5/Nc/N5JqCK0IK8C8Y5crHGB82OXAuUKbGNn5MsIM4E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lftvIgCDSpUArzN4WEQK5TXHs+VAggRJFz61vECLO0Vbm2L/Xduq1WTO5ZhUUwLsFZkj2eQQOj5b/ybJC7Savml6PofLOgDnlvh66wEKO/X4c4LYnvzOaV3wYHdVb/1HauOgnLJ7WS3MmorIjT80Bn716Bgnfp8rb0s1Z7np5r8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=GajoBQrn; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GajoBQrn" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4319399a411so9007275e9.2 for ; Thu, 31 Oct 2024 08:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386856; x=1730991656; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BNj/fO2D5WmaTEfTa8PNOYPo7uMWdpoJlT4sv1Vsh0M=; b=GajoBQrnTQe4R+6dOMSeEm0cXMpCBQyXb95FTxmQ0jokUoC/LC2I1mcWoroaVjVTXd 0c/ShK7JxzjTRMR0yAG6KKUL3r/5Pw9wNlTqEV5aH1ZGYlCL4dxIb2miNls/75ZJcTlK IMkk5ibn3t429z8VgYS7g8LhSTBffeVpmibdJr/bXmfnc1wuGooe1Qs4rFiHVYB2IpAv pe0XYxFm3b6S6OC5ejC/Si70M65E7M6zD1EB1Mrfmq7POFJ2hr58DU+qTXFtUWy9h/0d mRqt49KVyUwHd5yz73jX+OgwEJd+Dm2SP3xgZgWRGYSMUn22wtwG9plNcmq/xkq38G5O r52A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386856; x=1730991656; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BNj/fO2D5WmaTEfTa8PNOYPo7uMWdpoJlT4sv1Vsh0M=; b=EfWziTU4sUoagMUGCo2FAKZGbCEsCpS6F+pf5L9oZiKM7XWtnGlo+JhGs619k2qa07 f4dMqOGScb8y3gesvrknFYVre3r8Yceub/mrCglzCQjuVzT/SttqjOZDXPWXO36nrtU/ jZmHvcMBKtQq6lnDDveT0QF10s1KPZnvPk+tBZLIWn/n5AdsxTKpx0NLePf0nQVao0AB mqU961Y/+1kFyMhTXG+++wyjKwjORgopZrWRxfTazFzVbpT1b86ltXgj00j8IsRwaG9d V7psiQYl0a13vsAKtZSRCDtC41durpk/s08uhEbckc3CGVGshUl889oxgLX+Sg+7I2Qa UaYA== X-Forwarded-Encrypted: i=1; AJvYcCUAezGrcIvozfqEBWIlaLnxUTa5b/kRuBDOpNv+jb1LyDfHdCMZoMLIedYoCVaHRwXavISPH5yAs2/VHsc=@vger.kernel.org X-Gm-Message-State: AOJu0YzHGERnKP1b7kDFna+QX4q8oTug52x/P/bdV3MTD+zMCjMvQjxr edf6ZbD+E5Defg1SaWQxNEgmaBQ0g6M4BsvyU7R40RVCEzYknJKsC1kuo3LiMBY= X-Google-Smtp-Source: AGHT+IFk2eCgQm8YNMTKlqq1iucR50hnkbAH1iMz8u+bWLPGYs3QFvnZ+3u+58W5gWdqPaK2uS9iZg== X-Received: by 2002:a05:600c:4e46:b0:430:52ec:1e2b with SMTP id 5b1f17b1804b1-4319ad2b89emr185435505e9.29.1730386854912; Thu, 31 Oct 2024 08:00:54 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:53 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin Subject: [PATCH v3 13/14] scsi: ufs: exynos: gs101: enable clock gating with hibern8 Date: Thu, 31 Oct 2024 15:00:32 +0000 Message-ID: <20241031150033.3440894-14-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Enable clock gating and hibern8 capabilities for gs101. This leads to a significantly cooler phone when running the upstream kernel. The exynos_ufs_post_hibern8() hook is also updated to remove the UIC_CMD_DME_HIBER_EXIT code path as this causes a hang on gs101. The code path is removed rather than re-factored as no other SoC in ufs-exynos driver sets UFSHCD_CAP_HIBERN8_WITH_CLK_GATING capability. Additionally until the previous commit the hibern8 callbacks were broken anyway as they expected a bool. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- drivers/ufs/host/ufs-exynos.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 9b6c4cfd7665..91827b3e582b 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -224,6 +224,9 @@ static int gs101_ufs_drv_init(struct exynos_ufs *ufs) /* Enable WriteBooster */ hba->caps |=3D UFSHCD_CAP_WB_EN; =20 + /* Enable clock gating and hibern8 */ + hba->caps |=3D UFSHCD_CAP_CLK_GATING | UFSHCD_CAP_HIBERN8_WITH_CLK_GATING; + /* set ACG to be controlled by UFS_ACG_DISABLE */ reg =3D hci_readl(ufs, HCI_IOP_ACG_DISABLE); hci_writel(ufs, reg & (~HCI_IOP_ACG_DISABLE_EN), HCI_IOP_ACG_DISABLE); @@ -1563,26 +1566,7 @@ static void exynos_ufs_post_hibern8(struct ufs_hba *= hba, enum uic_cmd_dme cmd) { struct exynos_ufs *ufs =3D ufshcd_get_variant(hba); =20 - if (cmd =3D=3D UIC_CMD_DME_HIBER_EXIT) { - u32 cur_mode =3D 0; - u32 pwrmode; - - if (ufshcd_is_hs_mode(&ufs->dev_req_params)) - pwrmode =3D FAST_MODE; - else - pwrmode =3D SLOW_MODE; - - ufshcd_dme_get(hba, UIC_ARG_MIB(PA_PWRMODE), &cur_mode); - if (cur_mode !=3D (pwrmode << 4 | pwrmode)) { - dev_warn(hba->dev, "%s: power mode change\n", __func__); - hba->pwr_info.pwr_rx =3D (cur_mode >> 4) & 0xf; - hba->pwr_info.pwr_tx =3D cur_mode & 0xf; - ufshcd_config_pwr_mode(hba, &hba->max_pwr_info.info); - } - - if (!(ufs->opts & EXYNOS_UFS_OPT_SKIP_CONNECTION_ESTAB)) - exynos_ufs_establish_connt(ufs); - } else if (cmd =3D=3D UIC_CMD_DME_HIBER_ENTER) { + if (cmd =3D=3D UIC_CMD_DME_HIBER_ENTER) { ufs->entry_hibern8_t =3D ktime_get(); exynos_ufs_gate_clks(ufs); if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL) --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 23:38:45 2024 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DAC61CB32C for ; Thu, 31 Oct 2024 15:00:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386861; cv=none; b=XppYVCEt+RkaBjpXsJYkrq1LRSZ3CfNY3DMY/zLDUe1/fzj8p//sD0w3cdM/4O3Hy3YFrZZVFuhMEvIN4/uQAfY1+aqiA+a9+5zjpl1G/I5JDYlki+dYTUsCFwkOYFtKcuH3oIrjP8jxsD4fOtrLy+LuoNqHAG3bPlUzGTfoWhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386861; c=relaxed/simple; bh=lZqtMnNH2Ydc3fFDJaYFEhDWQg9TQsu/RuCma6tdH5k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lekctVssY4gzb//GYpkF7ikhLZq8Q9j52zx9kd8/VGsvxOa00oz5oSUBhS+78YfXVcVj0j8Q21X/Wp3WQHvRPDncXWdyZhuwAGlDM3sEoCbBbwv1QRJqkdQJciSJJte1l4MH/6nlAVp1yyhLuAFN7KIaQ0S5cfANZQghQq3xkbI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=USZ8nMKH; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="USZ8nMKH" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-431548bd1b4so8477475e9.3 for ; Thu, 31 Oct 2024 08:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386858; x=1730991658; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5HsH55Dd4lXD8RaepfS+tYZBwCj18S0+Osi4b6XYRas=; b=USZ8nMKHVPtSfzL17p8eo8AhcHkpC+mQckhufvHtRMAl44g079kND2uIQ7SShLLWqK m1oaQGMQ+56CSCyeRJ86EFLvjOmnQ1zhiZUWy0N/B0p4SvF1+AtxetlTXsk6xzCsDcN6 JdfLaMenyuGDXoCSY+C5B1zimC6iQKp90MepbGR0o68QEYCzdzd8pMizq2IxnOszNCh4 qsn2BRyarpQvC5XNBcy+x7MabNjXl/GduErBTGBPwenmOV3Rmp2sUpdsUfqSbf0C9pDc cCVFotih1rX4JBGgVyCnm1mqeOQBC6F1ISS2xjym5C3IknSnEnTCaVQDcmarb5ws+hez cu0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386858; x=1730991658; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5HsH55Dd4lXD8RaepfS+tYZBwCj18S0+Osi4b6XYRas=; b=VDmlnMPkW/gkBZU4gtYX5j4Q77d2YZUHCwaiJmzHV8BQ1QjLauYXs2FchWYAEa9FLc zY4ypVPJIXrjwO5Z1jal5zNndli+pbYVG0vj4S4mLjaF574gghRZp1RKiuiTh/RSNNVM kVW4rpEXyT/rAB6EYJAurUo05atN83igk2bxAntVp+FRczoGmkCbYu4ifh8m1NUYB2p+ Dah7yTD6+uAl9xMIrsShpg47X2iOBoXOOBjzNh9OCVlUhFjbrEuVSzf+5fvWraIRmoLL /JOliNR8h21nN2jphTiXtIe647NfBt0xQbMJL8Q3WTTOvpWGhpBuFMUENgf9yJwCU6ZI XvmA== X-Forwarded-Encrypted: i=1; AJvYcCXLZBMl7IJUZiJdwp1DdOKRERNSA/c43viekDJ8Nk1BERYhzDlUT4VTmxgcYpf/66+cABi30nJ/wc2tYYM=@vger.kernel.org X-Gm-Message-State: AOJu0Yync457k7R+87vT+tODkZvuJd+8Ln6Y//hcM0BHz2zKPcmqS6fr 42cQRU8XJsMD/yfMFV1j4syyOl/JeYqdS8ZZ+TAZLe5DrmpPpNc1a/vnmpyy9Y0= X-Google-Smtp-Source: AGHT+IGnBCp8cTrb3nL5Yu4gI9ybHFIG3eHfaMc7SBxhRN7NF7+XLcEhVXV1Ky/UKTvujdddg7F7rg== X-Received: by 2002:a05:600c:1ca9:b0:431:50cb:2398 with SMTP id 5b1f17b1804b1-4328323f576mr1510895e9.2.1730386856237; Thu, 31 Oct 2024 08:00:56 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8524sm59163225e9.5.2024.10.31.08.00.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:00:55 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, ebiggers@kernel.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin Subject: [PATCH v3 14/14] MAINTAINERS: Update UFS Exynos entry Date: Thu, 31 Oct 2024 15:00:33 +0000 Message-ID: <20241031150033.3440894-15-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241031150033.3440894-1-peter.griffin@linaro.org> References: <20241031150033.3440894-1-peter.griffin@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add myself as a reviewer for ufs-exynos as I'm doing various work in this driver currently for gs101 SoC and would like to help review relevant patches. Additionally add the linux-samsung-soc@vger.kernel.org list as that is relevant to this driver. Signed-off-by: Peter Griffin --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ea8a2227b822..0057faff6239 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -23826,7 +23826,9 @@ F: drivers/ufs/host/*dwc* =20 UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER EXYNOS HOOKS M: Alim Akhtar +R: Peter Griffin L: linux-scsi@vger.kernel.org +L: linux-samsung-soc@vger.kernel.org S: Maintained F: drivers/ufs/host/ufs-exynos* =20 --=20 2.47.0.163.g1226f6d8fa-goog