From patchwork Thu Oct 31 15:00:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 840023 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 13E5A19DF4F 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=1730386842; cv=none; b=GyU5hW3JMQG3hN1q8hA06PSXWL0pCgtiNL6SyVgieWNMSLeKNVHLCE0+/t3QjIIH4YmW5XhExIWpW3ixlQGhXxYcJiKdZppKorXLQrAB4JKLnO6qmYRzXTKuRGW3IAwsfJv3G7+zY8LoxrfcqHIJ5MIHGidoFB0n3JgXQ2O+WRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386842; c=relaxed/simple; bh=iiVF9AZs4yPH5IC0Sz8HHtFFUAcwFKXXFknN+nFLjSM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LIsRSNuGS0QVZ6TvtreyIMEmOJbkzEmBQUuWnUSYBC74r9PPRoQe8mKsBzBpPaG6MuNpFfkPDY+3aaYd3jolF+QaFfbyuNcOxgcCHEr5b/xrA7AUT967PtVFhuCYOFvgRhVLo4dLJrS+CmPUW+2rbMrZTp9ERg3wI1IjeOWQv3U= 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-4315eeb2601so10988945e9.2 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=AyE3YmgzagE2zjE2I1sWc1fPqEAUosnlOAPx9pK/ZT1xgaK5161RWBdD1cfyc7wGsa EO6CcvMBMAtq12oGXEuxF33PChO+eYbHYw2NU54ISAQIr1MTeD7LSA1QyQBOVZdRws4H qmSctdYWUML79OW8q7gJQkew3JPZkIRTXjliVF4oSaPaXXLtL9UCcZZA2Qyv6MBAYDiH Ms+F0n2FI85L2roZ31HdRwBa0hPUsi37kE541y9J2wirG8XWpGQ+JOrco4NsXXTx6tZ8 4bpTahjQJoDNRdxCAp+LG83EszsFlq5mA0EFtojodeOqa8bRQaOJzbNednFDvJaW+WhY EqdA== X-Forwarded-Encrypted: i=1; AJvYcCWj+vfNBlj4uEWTRmUcoox0yhTX7BODll47v0Zoe7Eavsfo1EH1l8R+A6vNroVVl26IpoG9/e6LzdaHMNCT+BL8xg==@vger.kernel.org X-Gm-Message-State: AOJu0Yy/thOAKfsLGCN49BR7LY9pHM5L02+tX/a5nhlUYBQGWSyWXeKi he2dOTz4eY9GdfI91KpOp37aep76aq7Q5uBkwpL2R0/Lu03wdccxZhV55NFgYK8= 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-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 exynos_ufs *ufs) exynos_ufs_ctrl_clkstop(ufs, false); } -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 = ufs->drv_data->uic_attr; @@ -2036,7 +2031,6 @@ static const struct exynos_ufs_drv_data exynos_ufs_drvs = { EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX | EXYNOS_UFS_OPT_SKIP_CONNECTION_ESTAB | EXYNOS_UFS_OPT_USE_SW_HIBERN8_TIMER, - .drv_init = exynos7_ufs_drv_init, .pre_link = exynos7_ufs_pre_link, .post_link = exynos7_ufs_post_link, .pre_pwr_change = exynos7_ufs_pre_pwr_change, From patchwork Thu Oct 31 15:00:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 840022 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 2DC861A3BDA for ; Thu, 31 Oct 2024 15:00:43 +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=1730386845; cv=none; b=OB4gg7RZWbC8j5rTnotrpwKdZctaDC9mGclO8OUtwt2384SV7+gpuNnKWm91K8swjAtnnw3HiqHlsWjniw9Ky3wWepva5PHooFiHh0J/Y/2vp/J91BZHr6ojMs50Y3kWCMCHrr9vXKeYJakD4h2cjb0jnuRH8iAS4A1KEtTj9z0= 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.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="MAoPwGM6" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-37d63a79bb6so714680f8f.0 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=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=juVgbXlkYQvjx2TYEt06VSOcIdhC8+WtVosC48C5bjmuBQGAtXL5NqVoayBp7clmDu QGkB90qRDpe96GUWep3rXF3/m6qfwbVDf6MQPkQ/TbUK6VlnB7zfU+n2PpuXNkHVOPin 3EATXtfm3OvKBU7E6jIBIbNnjPTHOj8aCEpFao7brTOX1aIq0Q3+v5u6J1YTMJ96Gt4z 0DYSUgqQ5xWst5YiH06GpSKhjtGeQGs7AS2hlnFA/04+2/FpZC8s5DTrMFDtpqjzjGYa KwiFatzhXcqsWy1f4qphFhNOF4fw0/9SUlFimv8CaKHZwYHE0lnNocuxWGtwMkXE18X2 hnTA== X-Forwarded-Encrypted: i=1; AJvYcCXpKtdHRKXQTWAHyOMmxJhqryPOVYU46M4v398zix91cgnGgSJUbBfZMVsJr50vOBffyY62rfAsZirLHCsiEQyGoQ==@vger.kernel.org X-Gm-Message-State: AOJu0YzCAKfg+ocPd9RuOq0mS/O2+evy1jcs/l671AeT4homengzkBLo Mzrzh6oUey9L/cs7XozaQj1nUb7m1Hb12NSE/+HGXtPvLggvlEhY2WyeGbjsMrE= 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-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 (Tudor) --- 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); } +#define UFS_HW_VER_MAJOR_MASK GENMASK(15, 8) + +static u32 exynos_ufs_get_hs_gear(struct ufs_hba *hba) +{ + u8 major; + + major = FIELD_GET(UFS_HW_VER_MAJOR_MASK, hba->ufs_version); + + if (major >= 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, ufshcd_init_host_params(&host_params); + /* This driver only support symmetric gear setting e.g. hs_tx_gear == hs_rx_gear */ + host_params.hs_tx_gear = exynos_ufs_get_hs_gear(hba); + host_params.hs_rx_gear = exynos_ufs_get_hs_gear(hba); + ret = ufshcd_negotiate_pwr_params(&host_params, dev_max_params, dev_req_params); if (ret) { pr_err("%s: failed to determine capabilities\n", __func__); From patchwork Thu Oct 31 15:00:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 840021 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 1DA681AF4EA for ; Thu, 31 Oct 2024 15:00:44 +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=1730386847; cv=none; b=F+gMIZiH0MDR9doMveswngMtBbmBiyzv7e2jrNWd+/V4wb08D2Hy1pXJhErJuFWjiQsBEuhPoPxjWB8CP7YgSIzuA+2wYlrHXnq9/LEujcdW19/4O2eQqBCDrLVeygjZjNaWGLRFW72TMsuPO6Yt5cEr+YcdABcTfp38VD8YKLs= 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=stRWUVNt; 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="stRWUVNt" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4315f24a6bbso8105995e9.1 for ; Thu, 31 Oct 2024 08:00:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386843; x=1730991643; 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=stRWUVNtj92h6JuBdL2twBG59p0sbG907JY5I6oDD9EnQn8C4KjvIv0BASLSOf8hME ECLumJpwbGt0LcNl1WaxD5BU3WxAFReEKmp9c/VfO62PGozLSMPaqhCZBpT3mJNfxcmV dKtSouMpzFjur2WGto6RPQuQ3czC5MkWdx7bx8QioNmD8G4iFdmass7oqOw3xGzHfddT YoY5okkbA9xZquVZyN/2VuKoo5NKibnnBdpW3dMeQCIz5ShbhA/hDbG9sCUb6M88OX5x 3ku0nNo4cH7EWnZvSM4zAO3rE6sN5GPA6NDMFnuEx1QM/5qxPNOc84M9bHe07ZqqY2TI 4Aqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386843; x=1730991643; 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=X2dW2FOK0amM5bj/yzBKi9E51ybLyJNWdScoO5p6k/I8UceGhRoFiBs3Rwd6nbW36m Lvb2Xu+ALDWslIkRrxY1TSLV82RcVRhB7zO55HnfXS3c3q1DAOIeGysu8hjFfVUywtc1 gqYjyRqEpdtCAEAi1eyALABOIqG+NJqXUzGeOoWRnCKgVfB08I+hevjrdBXE780lyCNm RU/0JEvtNoyeFuIVYvvH0gQkH5LQJjthdpOkFKOQqDl/ZyU3HtmHo3VHE7D+1oNM5Vku sLAYDBJEwdA7pHiYRpAQQjsb4J2DNSemXkx8EOaHERNx9bNi0/6d3Lt/9fMyOS9J0ar1 vh/g== X-Forwarded-Encrypted: i=1; AJvYcCWg9sQh7QeHsBLxfBRJU9yLARiXRO6kOxSjBOEFKID7G/wmJQ/4hTOMkVlW6zvhKwubrlRVvgebdFN3B7F21Rk0wA==@vger.kernel.org X-Gm-Message-State: AOJu0YzuCCB40Vc+tJO/Gpefv/NfZeCYVglfKE8YZYGw51yoK0j0Y6xr 0/kMuGTltG6uVQR6KrV/eqJaHG/ggZ/+DLJMa/UsR7k9StdTH7142R6AC4sS9Qg= 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-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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_drvs = { UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR | UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL | UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING, - .opts = EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL | - EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR | + .opts = EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR | EXYNOS_UFS_OPT_UFSPR_SECURE | EXYNOS_UFS_OPT_TIMER_TICK_SELECT, .drv_init = exynosauto_ufs_drv_init, From patchwork Thu Oct 31 15:00:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 840019 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 EAB811BD03F for ; Thu, 31 Oct 2024 15:00:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386854; cv=none; b=oQdsgZGWSYk1mwOaXGbShYr8YGxHNU7yigN5Px/WBXI12y1ADpGO4E9JvdsAxcuWucoWQFqfYuAIMLCDBTFSeSUfgTyMfxkOOvVX5o9HhequmgZQpVZj1iUxdX+l5aou8ON9MImSODRJcuMunh/fUhqVJwfNhF4ycPtRrNA/ORc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386854; c=relaxed/simple; bh=ObJIfaZjIKHh2LbJ+suNUf2iHwIx5ihpEmFxKcO6q9c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a/+oiquCSxsKrZiMBiwL1MTFzEKaD4FjJJPxvZ/0XI0BNrDCAbmM/oxqZmLchsuRhvDqOsxnO8z+s/iNF47w0x2fvO7tt6wMu+tnjl0Cr+k1TAzZ7/K+6YNA30LiGIX2xe1ElvR0bjZ7jqjXXcrcdGpR4o5dmBQLn8ppnqta4rM= 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=Lq8uVEcA; arc=none smtp.client-ip=209.85.208.170 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="Lq8uVEcA" Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2fb599aac99so9278731fa.1 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=EGlRIDiWOIW/oUdNVyUFBt1pPENWr+qbw5BPnPtDdZA=; b=Lq8uVEcAXOSLAgjGkH2DEZcfJB0trq358MH9DKZEZAfoueU2Xk94ntbcAXnBR9m+Tg QxTO7l+kOHTz/iSHTbc08gKTncF0Bw67Y74ji1KBZcvVCoMBkRybHpTwnQS83Vq5ewfW R0K/WxWt9NHKrPyt5vwPZEKK7fN43m4jcJ9pNrXeZI4gF7nlEdTb5QMK9AtKIEeoeJsY +Iuycf+S79TryUQgzIjHGPfzHwD7rXnlqzzkDzzLuR60j/QOoj+L4t5Vuc0I0n2qA5T4 Y19ycdU10VLPeyn5xShjdNJt/MP5ah9amL/a2IZ4d7q4xu6N0CxfXmXrZIJTV23ixn1S VjEw== 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=EGlRIDiWOIW/oUdNVyUFBt1pPENWr+qbw5BPnPtDdZA=; b=iTibbKfgypulUY+hdb5hSXZpfh65J5qcfgqO/TeRz2hocXsM8/fVsH9aM9HfeucYXu 8jezmrqYro8Yg2d42QICdUr4n/7OuewjFEmBS6BaGVi6Kyu597o/E72hUA7kcoO37R4o SczyGGbYmY5qF8ky5FIyOxeqktZsO3cXw3U0fGHewSLs7X4FfQPNT4pxgIGI9ZGqM5zu 5drQYQNN2oEUtALdbDtpszP0DjY/EaAqp+lICfXgPlMs2z2mU+zLceMCz/IDzJPvALL7 v245Lu8gRBpFXufbJjGeaULOmyQ0+h5u2Dv0lthRq7WdxP+eW/2uShDZZVf3Qmo2wq7/ GziA== X-Forwarded-Encrypted: i=1; AJvYcCWtDLdNZ6S8zBrEjKrOZIBCQVZCByoeHOQQRsn/ZWLn4NICS6AR9JXyXoZRY7oIDGWCX8XpMtxu39J6XUZ+grw6Mw==@vger.kernel.org X-Gm-Message-State: AOJu0YxehqXyNa7CAmtqZDOvLIiUMq74jHiHorYWxkHsS/PdPrEuGiUY 60r/w6TKfwBr/1BKx+XzbvYt+uRDVxzx6SAY/Vh663ykiFAeMph02u4XYuV7Cz0= 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-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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_drvs = { static struct exynos_ufs_uic_attr gs101_uic_attr = { .tx_trailingclks = 0xff, - .tx_dif_p_nsec = 3000000, /* unit: ns */ - .tx_dif_n_nsec = 1000000, /* unit: ns */ - .tx_high_z_cnt_nsec = 20000, /* unit: ns */ - .tx_base_unit_nsec = 100000, /* unit: ns */ - .tx_gran_unit_nsec = 4000, /* unit: ns */ - .tx_sleep_cnt = 1000, /* unit: ns */ - .tx_min_activatetime = 0xa, - .rx_filler_enable = 0x2, - .rx_dif_p_nsec = 1000000, /* unit: ns */ - .rx_hibern8_wait_nsec = 4000000, /* unit: ns */ - .rx_base_unit_nsec = 100000, /* unit: ns */ - .rx_gran_unit_nsec = 4000, /* unit: ns */ - .rx_sleep_cnt = 1280, /* unit: ns */ - .rx_stall_cnt = 320, /* unit: ns */ - .rx_hs_g1_sync_len_cap = SYNC_LEN_COARSE(0xf), - .rx_hs_g2_sync_len_cap = SYNC_LEN_COARSE(0xf), - .rx_hs_g3_sync_len_cap = SYNC_LEN_COARSE(0xf), - .rx_hs_g1_prep_sync_len_cap = PREP_LEN(0xf), - .rx_hs_g2_prep_sync_len_cap = PREP_LEN(0xf), - .rx_hs_g3_prep_sync_len_cap = PREP_LEN(0xf), .pa_dbg_opt_suite1_val = 0x90913C1C, .pa_dbg_opt_suite1_off = PA_GS101_DBG_OPTION_SUITE1, .pa_dbg_opt_suite2_val = 0xE01C115F, From patchwork Thu Oct 31 15:00:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 840020 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 4E9661BCA02 for ; Thu, 31 Oct 2024 15:00:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386852; cv=none; b=e1KHQweNq+lY+hp0n8NQVjzSBbjlArIC1OWClro8cIcrk/tN8KfbgY8FpLj/rxfDMZEHSn1gEWXjTzzYb1S5V/lenXbS18TuEgb8pw2wk9z/dmvMupNhz/pCmVhBiTrQJmgKiN4g7M348uyQlURxoCeys3qAl/1KrzAb/jLSj5M= 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.46 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-f46.google.com with SMTP id 5b1f17b1804b1-431ac30d379so8707355e9.1 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=LZ78BO/ry8Mg+f8S4Ubgw0ENsFMh2BTlv4iGn50JLX6wDmXGYVqr0IhybSmytY99+G kD9yKFgACWEzh2GA790a3R1H08tzcqBMKE0WuNCBk1VvbmaEgPuNn76b8IchY8txJZSf hr/ajQucHLLa6xQJkg99ukYbgjX+WPH2KWSasZXXvTHBHfSQZb7ZwNi46LLmVAcNM5aJ PYobV60JO4TjBUFOQ4aLL23sZh7xlN11zqkkO4/SfvDer4X+rjTGuXl9wSmqFe/CcanZ 9PJaQBRxSQipUgFyRh9v3cFp85ReJzxjXEIeBPTrNsq0hM9Z8LBH2DOf1vT8WwTLz8iL 6leA== X-Forwarded-Encrypted: i=1; AJvYcCUuj6HuXUF8kSDUl937EkkMiGTERexro1PwWbdLlQxqNQPcryrHWYqma6HDKP4AOK39tqlM36UYVW4+oeBTO7CbNQ==@vger.kernel.org X-Gm-Message-State: AOJu0YyEhj5ccMC47WBrupTLdkjCeMgi3tFmm2BWZNBVdN12i9J3fQ/h cFmisXxj7ge4hyqRox/6mPAJywtb/DtcBdDOOoI85AEGiaCpOfajZTJ/nJPj2BA= 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-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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) static int exynosauto_ufs_drv_init(struct exynos_ufs *ufs) { - struct exynos_ufs_uic_attr *attr = 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 *ufs) UFS_SHARABLE, UFS_SHARABLE); } - attr->tx_dif_p_nsec = 3200000; - return 0; } From patchwork Thu Oct 31 15:00:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 840018 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.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 B03791C1AD0 for ; Thu, 31 Oct 2024 15:00:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386857; cv=none; b=ihb5qvsebsdHeECv3saPmqMdL1+uT02IGDdNM+VtZaqBazAi2O9CjBZDzZmvR9hssgyqyvUgD+rCE3dxEWQWokwpTS0oMG47YF2Pu4Zl751/MTsFbEZ7q41uJtD6nOYzBwjmIUyIrLR27VN0N9f40A9RuYN/TKGDRoEX/0rU68c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730386857; c=relaxed/simple; bh=DNXiPZZOPqqCGRsSUrJuQXwDPghQpinVVwrMRAUyp2s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qO1LaoyLtBQLzNgen8uT1jbtaYwZGiftRjDxaBIYjcyE6bf5ZkyxjXMB8pdOsbanvf7eE/VxrVdhn6cGchy3XVRk/eFfRibWfW7NZqKPXyn5hfqDs/z/iJPhr5tGxvKiHvA0vDmtqror6jnNMk9DD0kttUQmvMX6f5rbUqXCcFA= 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=sdvWC8Nk; arc=none smtp.client-ip=209.85.221.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="sdvWC8Nk" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-37d41894a32so613160f8f.1 for ; Thu, 31 Oct 2024 08:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730386853; x=1730991653; 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=sdvWC8NkIoevImTc1EFGJE5IZZtGUhp2is6TFJM6yLca5JjPKkDwi0wYISBdlAGGLO 9WFriredKimceZ9OcQIZqp8o0VeCQ0LJa7ceopJUlJzgoo/UHMgQRSMFClQwukOoouN0 hSh3woxKYCWF35bnEk3dnGJvUw3E4ezaFa040Fb1nRxJHCmd5JxLQUthiAmtu0lNi2wQ ccaGmGL0A1FbF/lfwSkkaMCH6h8UVkwrg6ScsqLx/GjBZ/9/fTM6OUh/eQFn1CzykjEE 3RDC+Kpd6G7izxAk8ayAOIs63ZU5VJMJOfQHo6UJQ4nJxV6NzzzbX6Z800WJIqfIAw14 QVhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730386853; x=1730991653; 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=H1kAP+VFCls6iVKdZ74S8WT/g7GqIXt96xmYcGEUdUZOZdTAHt73s0XDaa+RZ4wccJ REOs+zxrUnmRlyOWxtoD8raTwJqtcPZ5hZjkJ1a2LdpuJWztRMkJc4rlwiRyLMUCLpAJ QSQRLGWOm0sUKOVGlhdTglyg6VndwogfxuRzOeBIO/ES/jifsrOrlgCnNQaCL+AnjbDs b1scGc7GeHJW6evn/pJp4Img22hc3dpmJrsWnqwjRA05QPDoNFjw7LR1Dwg7ndFPc1au gXHiB+hAF5KwbOewlvza7g7YD5zdI3UzZ3ZxWYWhgModwM6tlOahrGJ/gAdD/7T5Fo63 INJg== X-Forwarded-Encrypted: i=1; AJvYcCVZXovxD/gHmpFM8o1mTPNPIKsHm8eQfgVJJoF4KqwbOSW5HXeyOmj1CFi9tdJHRkr1QDztO3HZVlc/lCmSTymqcA==@vger.kernel.org X-Gm-Message-State: AOJu0YyPU3+2R7IdPu0J06s18cBRFarg3S7oJe7GQfMJO+CDSuiApqok kDhmeQiyPTX0cpK8LYxi9C/91yH+CPfHjd0TeeCUNtApLsiEb3+ReTM1jMywjZY= 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-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 = ufs->hba; + u32 reg; /* Enable WriteBooster */ hba->caps |= UFSHCD_CAP_WB_EN; + /* set ACG to be controlled by UFS_ACG_DISABLE */ + reg = 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); } From patchwork Thu Oct 31 15:00:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 840017 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 245BB1C9EC7 for ; Thu, 31 Oct 2024 15:00:57 +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=1730386860; cv=none; b=Kh+T0c1Y137PMrnTi0F9Ha74zM8t6gj5Qnu2AQ25Ca435OikKSdxT7+qgHgqLkCvPuwabtevAgW4lEk0qdtGEoUAQyARv3XqxE7VBiZ0v0lWAsMTtNKL8bd9UqYBpxEl1Bvgc6yijGv4XvCTMAFYo9pivsiPdpau6Squ2u9taw8= 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.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="GajoBQrn" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4315e62afe0so9074475e9.1 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=IcVOZ9zUFPVC4sMsRE93qz4Cygh4CefJn1f79rSvyAqtuDW9My2QhEdfD9Z6rGtB5f bih/WocNRk+k5eBi1EaQQd0nTtqD04TcTgk0COgniM3n+m5ABKIAYZsnVZIYuqltVkQ7 YcYNx+ZvlSTHUbTqdgZbm4lToxj2D0fa3nvPwhtJufn1hrbztMnNtOVUqdQYoV4efgF4 +EUGn7Y00jeVSVaZW14Ya7WM+OU0j4EncsC7kVKeVoX1CiM4tD/kxuiPvFz4TjftndY1 L0ZJR4q7fi6nWjPz0lsF13jqT2uPmssdkBOkHED37Q5Jc3izMSJnyRFZ3c/Tzbu3Waai wGAw== X-Forwarded-Encrypted: i=1; AJvYcCV9G+tHUWIgp4p7+XeJEadrMRomG/+WicPeV8c5PLEvVhucZ1BBdy6K9UkRtqZ0pux7aNLptfSPsBFO0Mw/Z2Xa9w==@vger.kernel.org X-Gm-Message-State: AOJu0YwFaz92LmPzSHu1FtsYiYh83Pb4QhDp/QcdX2YhtPuUEIz8V5D1 3SBJfVfmb8SXmOlu0L0HCVwSD1+W92PIRT88Vgwy3JEmfdYKFX13QoGoRlRpW7I= 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-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 |= UFSHCD_CAP_WB_EN; + /* Enable clock gating and hibern8 */ + hba->caps |= UFSHCD_CAP_CLK_GATING | UFSHCD_CAP_HIBERN8_WITH_CLK_GATING; + /* set ACG to be controlled by UFS_ACG_DISABLE */ reg = 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 = ufshcd_get_variant(hba); - if (cmd == UIC_CMD_DME_HIBER_EXIT) { - u32 cur_mode = 0; - u32 pwrmode; - - if (ufshcd_is_hs_mode(&ufs->dev_req_params)) - pwrmode = FAST_MODE; - else - pwrmode = SLOW_MODE; - - ufshcd_dme_get(hba, UIC_ARG_MIB(PA_PWRMODE), &cur_mode); - if (cur_mode != (pwrmode << 4 | pwrmode)) { - dev_warn(hba->dev, "%s: power mode change\n", __func__); - hba->pwr_info.pwr_rx = (cur_mode >> 4) & 0xf; - hba->pwr_info.pwr_tx = 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 == UIC_CMD_DME_HIBER_ENTER) { + if (cmd == UIC_CMD_DME_HIBER_ENTER) { ufs->entry_hibern8_t = ktime_get(); exynos_ufs_gate_clks(ufs); if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL)