From nobody Mon Nov 25 17:27:58 2024 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 D18E11632F3 for ; Fri, 25 Oct 2024 13:14:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862092; cv=none; b=baC990ZdX985a7YUGCpxqHlPaJhc+P70UN60UiN7kAOElh/F9HFvCYled5EEkMYNFG7fk4Ci2EZyJ/XygdELpNUfzzwMp8gTZerulW4blcLb8gYrm7HC16knBDZTyTYW8BkY5TqZp/P4q9V+Jtt2Oa9BZKdA8N/XAsGD2XgllqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862092; c=relaxed/simple; bh=XQJlYvZ6vjn/TYO+WTDp4FMJOckllIU+bQgG44hsbCY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F215NuWkMPfJ2yQi4wo94ruqPpsfmIqzBQlZFHR9INatgW9pLWotnKJtTTFcZeCQeEe+xOgDNvGhKDbddj8VU1zgPBLjZPaCQZ/PoLVrJ9lZlG4Qy8/gehRD4CNzZkDuZWzytdESz2q0xUYZBl8btHwRDmXKOfeNnQMHp7uNxmQ= 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=HjrK8CEF; arc=none smtp.client-ip=209.85.128.48 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="HjrK8CEF" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-431688d5127so20037975e9.0 for ; Fri, 25 Oct 2024 06:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729862089; x=1730466889; 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=mphjevL2wKBjhbt7qb95YXVF8X2HJNmvgdrJOySayeQ=; b=HjrK8CEFsT7+nAKDWnRBRB2T6DBSkrHLSjY/jqMzO3BzpbnjiWnfFjJYc8SerbXt8H BSP6bKWlOHvnOR8HHaRMYEDfJATtFBP9butVVIm6K/ASn0ta2qL6htUkAbyDvFmngLEy zVfhw2IRJog21N851OCsroQLPwUkqL14BUbE1ZpMZvPMES6VZ/jR4iqu/d/WJcoBAGEU UfS+MMQEdusjlNs9kdpf8VyZq55diapcuuJikVexH9R6sB2dya333DE955Zgx1P85nxC kyAfNtFSs6Mrp1ZaWa6pGex2mLx1FcsJCZg/LUED58WYlrlW4rNDCLkzlgfNObkjNfKF J3xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729862089; x=1730466889; 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=mphjevL2wKBjhbt7qb95YXVF8X2HJNmvgdrJOySayeQ=; b=B74tdGELrKQH6Dzk+Yl71/IXd3DX7+brVDPgwjxKSyTYMQRmVYzeA/FsE6MCmuSiWM p1OO5MRl0O2EjpkRe35mXb8QTZsHJ4KZqvZGdK1jxa4uMxYPabT9gpJA19iAuXtegAG4 gEM9A7+zcLyXZ/fNf/TZT8OZ38k9NFA1Td8ElVuTq69e/PLBix2y9y/X2Gm5VRIw9jo2 LyXvQ5sJ8i0QBVBwakduJhZciZaYLEOtSGPAOyMEtI2xOqFi1mbdD6VECDBGw3Xos9Cx PQwsdAzewPTiiBxA7EPGFxJMKKZkVdlOQriWlFsxnNp0tG66i/+C/CKH0iOv6jfPdYpD uNwg== X-Forwarded-Encrypted: i=1; AJvYcCXaY2hNWH3Hsi1fS7Io7MmO/p8LWwaxEx5UlXyEh3AkOrAUiZHezVxmo4umFR4lDgswdjh/q5bjQA7yX4U=@vger.kernel.org X-Gm-Message-State: AOJu0YwcOKgdsYdOMGOjk4o/H/UGmS/aRfARMZfTlvd3Hq1WM1aiae8e vkWDP2MhaQ1sZrOX3tWdt22I67frdw9M8vY/ws2A64gI6+1Cf71GYCuQGdA1d8E= X-Google-Smtp-Source: AGHT+IEoUmmF2a29+b6OYTb4dbCjEKsfEZfPzHCBO3Ytnq8YsVvh+s+5uHtHvSiBw8IREAZ9aiGHMw== X-Received: by 2002:a05:600c:468f:b0:42c:a6da:a149 with SMTP id 5b1f17b1804b1-4318c73a46amr48990985e9.25.1729862089150; Fri, 25 Oct 2024 06:14:49 -0700 (PDT) Received: from gpeter-l.lan ([145.224.67.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b58b6bdsm47616685e9.45.2024.10.25.06.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:14: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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, ebiggers@kernel.org, Peter Griffin Subject: [PATCH v2 01/11] scsi: ufs: exynos: Allow UFS Gear 4 Date: Fri, 25 Oct 2024 14:14:32 +0100 Message-ID: <20241025131442.112862-2-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241025131442.112862-1-peter.griffin@linaro.org> References: <20241025131442.112862-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 --- drivers/ufs/host/ufs-exynos.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 9ec318ef52bf..e25de4b86ac0 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -771,6 +771,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) @@ -787,6 +802,8 @@ static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba, } =20 ufshcd_init_host_params(&host_params); + /* This driver only support symmetric gear setting e.g. hs_tx_gear =3D=3D= hs_rx_gear */ + host_params.hs_tx_gear =3D host_params.hs_rx_gear =3D exynos_ufs_get_hs_g= ear(hba); =20 ret =3D ufshcd_negotiate_pwr_params(&host_params, dev_max_params, dev_req= _params); if (ret) { --=20 2.47.0.163.g1226f6d8fa-goog From nobody Mon Nov 25 17:27:58 2024 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (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 62E301632F8 for ; Fri, 25 Oct 2024 13:14:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862096; cv=none; b=PKD+P25Erq3rRIHcpaYEIGMWz5b+GFqcHVOeDZq9PtlB21txyLTalNMCDVbMF7xtKbcRx6IOoc2poL6brD+VpwIU3UBfvmQUNnGk9nHLaQ4gJE41ULy5Rf9qNx6NfVVGV4cGR1y9Jb3FgQVphr4POepuKcVg3ZFaWNauBk3Glxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862096; c=relaxed/simple; bh=52vVF03lgySM2/6ZOOgdrHinb/FvQUa3VHWIhQleV78=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D9JmaGuyw8uhbpr3EnKOBhvC6YK4rE9JQxx6bAXv28OwS4aCPbc4Y07x4Gw4Grd/vGERxDl4Sxd1u+DoyXZa9Ae/b5whrKnysUW/NoEgvNgtnQEaPlzCdl/3JyRI2/PaPYJLZ+/viRWg+cWLhuXcPv8Pe/Noe9Lt+S7r/7Fe5MI= 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=hlwMn1FE; arc=none smtp.client-ip=209.85.167.51 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="hlwMn1FE" Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-5366fd6fdf1so2853809e87.0 for ; Fri, 25 Oct 2024 06:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729862091; x=1730466891; 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=9ndmeeqYmXUmeG3ahgXNOhxMW6zZzHIs2RxYCsW225E=; b=hlwMn1FEuu+VB5I4KfJGcr3MEbBntU4wVZfTEKhUt5CZrxCdZnbpF0bHS87A5k2zE/ NUfr3cVPYQn5DBtWh+oQFc/PGQj8mdBHajlfLesxWjXETEr5hhp0xMMcPV6SGbWTG/qO pKpkVa/IhwAEjdQEtBfV5IA79a2BUuCewn45yO3I8dUN+B/d6y0zYHbhdEblUffkLWWQ LFGM++8uYVaU+CV7N4wrXjRtUoWCIbpl1nMoQuY2pRwPCk0h8FSOYGOLDJxnaUgLxE+N Qo6mrjd3a3XIuk2FAHhfAwVT5LGuPC1blLLPGJIzd2i/koQMguUi6WYR72z04q8bN3DT P2FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729862091; x=1730466891; 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=9ndmeeqYmXUmeG3ahgXNOhxMW6zZzHIs2RxYCsW225E=; b=bv/K2hF4RFPKoUs5XK84lT8a+V1SYvM8cT6QKdnUNVyFiW6FcAkcdirA1qFu0P1GsA OPEmg6xIuDNOg3zh9yuBgFpHJkKLGACiHaWJvFXfJQAh6ofgtkIJp9efT2Bfe3rYGPuI d8ywYWrq6HZpJQZM1vhqS86rgRLwsoa/UJXvy6bLWQRW6YcfRjgkOS6pAgTAQr/hEdVe o+roap0PJpeW+rHpZNYyUsFGLTM4PbzdL5MiDQ3/yzGjeKg2qRhrBq8GzTtXDYRhYTYH 3DzxEj6EzwT74h73+8xeCdhAqJk02GOvjMpLDvq/PZDuV+S5WO0QGIDaiXj8ZAM5kjnu bSFg== X-Forwarded-Encrypted: i=1; AJvYcCU2J4AhSRtJ2UXmSnvzCcetHV/ss26MuOWb0/urV6+mEYCRjzypWorTX7k5isOyMr64elIsQshckS2OKlU=@vger.kernel.org X-Gm-Message-State: AOJu0YzEa8Th1EV3d7DWxJXr8oRS512UH3ooK8Wf9bFI+C3Qi39M7xac 7BMjv/G+B5aWUSYHRQRmez92uhS7MXa6/bDlkxX+3KR5EqaIw/sZ3JH3j2QkUaI= X-Google-Smtp-Source: AGHT+IGqC8HKU9NrjiBFGdut1et0Yr+WYmeKxlnHqZ/w+vIyRSTfXiYFfbHCJ6h5jr2qgVPoi7F9Wg== X-Received: by 2002:a05:6512:6c3:b0:539:e279:b3da with SMTP id 2adb3069b0e04-53b23df5806mr3664939e87.18.1729862091324; Fri, 25 Oct 2024 06:14:51 -0700 (PDT) Received: from gpeter-l.lan ([145.224.67.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b58b6bdsm47616685e9.45.2024.10.25.06.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:14:50 -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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, ebiggers@kernel.org, Peter Griffin Subject: [PATCH v2 02/11] scsi: ufs: exynos: add check inside exynos_ufs_config_smu() Date: Fri, 25 Oct 2024 14:14:33 +0100 Message-ID: <20241025131442.112862-3-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241025131442.112862-1-peter.griffin@linaro.org> References: <20241025131442.112862-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 which will cause a serror. Fixes: d11e0a318df8 ("scsi: ufs: exynos: Add support for Tensor gs101 SoC") Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- 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 e25de4b86ac0..939d08bce545 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -724,6 +724,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 */ @@ -1457,8 +1460,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 Mon Nov 25 17:27:58 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 6BFBB200BA4 for ; Fri, 25 Oct 2024 13:14:54 +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=1729862096; cv=none; b=SnQp2a7+Jp078NvwmEc+qbIzoEs0DctGNLT7PgHCXFjLUgicfgfbSVJ0adDYJyexz+KvG+/Y8HudpptcvktUbwDDABZR3ImUCmw2vv+oCbcRyaziSZ1j4wQIgSFYDPxx0hLVgcfxZ9Uf+x8uCJ+mcAk3EXEUvrVrqXEDh0a4Ptw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862096; c=relaxed/simple; bh=nFcIrt+JzS+rRiCV4wugLYxatuBOei3DlyFR1BxfoD4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mg0Axp/72FSmGdLayIWUNcxkeGNqL4rKy8Jcgmp42xH3LP5LPFygrj8F+ZIPOJKeg4FMrEqKf6wkBjtvy6+7wkg/yyTNiLVEjnMNQKf3e8nLSMeo3XRDWNvtHND2zjKSTcuqLfJq3vNGYGxgCAw/C7ctu4zmyL9uRhB180s1mDU= 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=otZykFAg; 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="otZykFAg" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4314c4cb752so20214545e9.2 for ; Fri, 25 Oct 2024 06:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729862093; x=1730466893; 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=yQgS5nIosT9WP+28fCSlQ/AHJVYYLIctL5rlsevVeIM=; b=otZykFAgvcNLkshp9T1l8FpU8O3Fqi97fRx55xX4FWFftCB1M1iuMq1t+1KAqmUwrW IlM24mxxkOs18fS/v7KMXCRZX9ZeIcqxEvFBl4v+fqwljohaXKNxdnVmD/XpYWJB6FmG y2dnoUhyR/XBY5q3OFsKvsycIOMpZaDSCgTPosiwXNsxujfBIQ7A0uD7b3nRFGnszBhv U2C+kY0qiuCg7CJ/Dzy9HMgwyyRLY6wi5x0a7EhygvcjXn7q8PBEzrrhM+Y+hl6M89Xl ciZoKNOXgejNLK/25dyA1kr/nfRw1w+GWbayLkGLUUifrRPOHEvzh57IjvHFP1ibbs3Z pLoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729862093; x=1730466893; 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=yQgS5nIosT9WP+28fCSlQ/AHJVYYLIctL5rlsevVeIM=; b=QviYGj4VhUfptwcFfqpchHgMoPq0xmTbzR0B2LRRKbYxoIRFPi2JKUzJ2wQ1rlY38Y daPibE2DP1Oe4KHK2hq6z82i2iSHlAWpYVwVmK9qhEUIYFtPhT8N+serDBilwYczYw6t h8Q8je539LOTVMgPd6ko8ZtHQWkZqEWxwo+snC+UJKCz8FDEwE3Lq4IeLn7/orwRB2GD ja61q0vHLDQ1QcrF9SG/bOUIBbCV+WsEBJsbKGtEwE9KQXDOYBEYse7klgU48XYYIfZ4 ay2auqaVmESsOWrNvV9m/JY58MtzM55IqWzJJcuZQseaDo7ZvrY3zUjT7OG5WbJHGfln qj3A== X-Forwarded-Encrypted: i=1; AJvYcCUHnxX0Zpgm4u9/b7z4cCeP/INRX6TZuoUNVlBgKCgX0B0a7rYXODwG+W8m58ZK+GGuerOjtpMxhPD4Tg4=@vger.kernel.org X-Gm-Message-State: AOJu0YxfgZknkSfzj89Dl5RBe+a3n607d/Y53dV8WdtkJotYSmUumfJI vIVzjs8N0dLDi27myziMvRzHIcIMbTfab9LyYJtR/CZrYrwL3O1R9/ne4A1LlM8= X-Google-Smtp-Source: AGHT+IFu6kZDvdli2L18ry096b5sZipxK9OsOWeDSxbyTNiVEAO1GAWmUbs/6CZi5Y3noCEY1ICL6w== X-Received: by 2002:a05:600c:3543:b0:431:6153:a246 with SMTP id 5b1f17b1804b1-4318414a3d9mr88410625e9.13.1729862092697; Fri, 25 Oct 2024 06:14:52 -0700 (PDT) Received: from gpeter-l.lan ([145.224.67.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b58b6bdsm47616685e9.45.2024.10.25.06.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:14: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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, ebiggers@kernel.org, Peter Griffin Subject: [PATCH v2 03/11] scsi: ufs: exynos: gs101: remove EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL Date: Fri, 25 Oct 2024 14:14:34 +0100 Message-ID: <20241025131442.112862-4-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241025131442.112862-1-peter.griffin@linaro.org> References: <20241025131442.112862-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" This flag is not required for gs101 SoC. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- 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 939d08bce545..d685d3e93ea1 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -2142,8 +2142,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 Mon Nov 25 17:27:58 2024 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.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 F077B1F7552 for ; Fri, 25 Oct 2024 13:14:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862099; cv=none; b=sOQW/NT+qTmno3IVvNGOug9uxRbACGDpRZZySXL8XouNqR3TVY8uW5VRTzwohpTMZZ0cb9jcV48U0TYUV7GB8nIhhbMuaw0ioJR3b/g/MMsV+lKdt/8IQebSVXwyVF5tMMsCs4YK6BSBDS8BgJMPMgJJldES6I0HCgCXWe/aHgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862099; c=relaxed/simple; bh=p3g/8Z+J2ecDwNAbeCRrJL+kfRSjnRzkTSKppiTWOGE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N/hRRaVkTs7j/qrJteSLL8rgXFPvajEsomggkE8JNDyD4Il6NlsEJjIMHKDYnamaq6FcIE9I8wQqX6NcDFkqpPVnjwr694nLjUEWz13oN6fbAiIhUMRcABZ6+vqu+wTfEV9lmqaEqkn1gHls/9BliuamNltFNUrRzv6yybq/64o= 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=Usum0fAE; arc=none smtp.client-ip=209.85.167.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="Usum0fAE" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-539e5c15fd3so1954858e87.3 for ; Fri, 25 Oct 2024 06:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729862094; x=1730466894; 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=cdoImO6OFfTM2Lw/aicaT3K93cFHqPSr98CjhrJS+DM=; b=Usum0fAEfnAwg3DRH7UdAGsJxPATtqGNJdUYbE4dijh2ZeJf8cDpLpQv+6JWlOSyCQ UhDh90QmUyoZ3lp9dmn8m1RkrIo+fsi9Mi3AAHZag24g7vGzTD7TEGl3GIM4BNpklFH2 QidgeNUrhsFjot4Y9paoZWveLi500zWezYN7pZZgeko2Vst2rK7Htm+FatRFZhHocI/v l6TaYsPBGU6EqeO/z8shvLwRyzSJ0ERMqAsEGPFBQ1/qOsgPciwD6dmPut4iSFSDrGKA 4jl4adjswJ63QyOimLourBwYo3rp8IRd7PlhhKy9gEs9MJkSi9AsJ0nWRfeGh3x6jMty nzhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729862094; x=1730466894; 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=cdoImO6OFfTM2Lw/aicaT3K93cFHqPSr98CjhrJS+DM=; b=DfSloLJ+cE5WBAPQ05HnGtsR0x0tgB6QjckTann8iDt6/EbhMMIY22R8vudg+lO3U9 qsKc0Gg/VfogngcdanOAlh8wNvRM0J+eZphgrHpA7nyJxv1PfdGJs6krBf55r3ZzPRGH ORx4jbJOA81bVBMZijH9FsVJcaq9VT5O8HxQAElgsyB2Saz0ZksEZIUck9oXPgii3899 GtFQuD7WnWVxgykwMC5zeNO+4khebnw/vQdxKKiXU/M0pqzA7q4GcdGeyctQu0dG4u9m eORWSLiK8Id0KJQGX+LY5pED5h8ALcB1yB36zRfP5cLsqOCtNC4QQDzRApYQ74FhphTC DcOQ== X-Forwarded-Encrypted: i=1; AJvYcCXKiBobXbx8MsiN6TL1uBryrGGYsZFAA7eEqTNmt9tnfL3/I0l1Tcxyp33bgQ+WZVCPUfNASNIqPGJFFRA=@vger.kernel.org X-Gm-Message-State: AOJu0YxfqpYVpp8zZP8XQeOR5DfcVN+PyrnhxG3SzF4XvNKnWf3xEBlK j49OKjz2y/kdMzZTbNNyQc090qabglZPYDqos15CV8s+xSKyo3I7JD/+TXKMCRo= X-Google-Smtp-Source: AGHT+IHBrQGT9pmxc4oL2n1+HSGkoaeL5c5Y5zzjK0zgLQAj/a//GEezqB7iJbnehPJAIoa5TXY2sg== X-Received: by 2002:a05:6512:1585:b0:52f:d69e:bb38 with SMTP id 2adb3069b0e04-53b23dcd34fmr3409903e87.2.1729862094046; Fri, 25 Oct 2024 06:14:54 -0700 (PDT) Received: from gpeter-l.lan ([145.224.67.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b58b6bdsm47616685e9.45.2024.10.25.06.14.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:14: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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, ebiggers@kernel.org, Peter Griffin Subject: [PATCH v2 04/11] scsi: ufs: exynos: Add EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR check Date: Fri, 25 Oct 2024 14:14:35 +0100 Message-ID: <20241025131442.112862-5-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241025131442.112862-1-peter.griffin@linaro.org> References: <20241025131442.112862-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() and exynos_ufs_config_phy_cap_attr() if 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 --- 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 d685d3e93ea1..a1a2fdcb8a40 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -546,6 +546,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 Mon Nov 25 17:27:58 2024 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.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 3AA3520BB3C for ; Fri, 25 Oct 2024 13:14:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862099; cv=none; b=oKP2RA9ZVUZjUQiToJ0EoAaleYOdvRB3in9WH4nMxr6noW4yAyGRCe+0RkUWJzqsyrABeE97Jo0Tghr51TAquBhNSN/lKhTj7O+HzBwkjykenSmRaudKhRqajVhsgvQq/0L1vagZdx2B+fIjohynJyp6DAoMESmr9EODleOgiBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862099; c=relaxed/simple; bh=5eFNbj8oKYgUwgjCPIPgeqetnx6XevHf8p0h8myP650=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VoFiv4Vbp/BTU4qrYyhLwS1nYRRquJHKLYxgreU27cVvr5WW56vj6/Mzn9oAS6Nnq8fwC/9XsEeetOhRP6v41zgTC+Q6MPLkceVtF5Cqyx60SOOfAaLF06qAbHwKK2YUm5g2B6jKA+cHlazJ2pDdQEX8+ho64EIZync+OZSdtGE= 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=Wy2xOp9f; arc=none smtp.client-ip=209.85.167.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="Wy2xOp9f" Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-539e3f35268so2638934e87.3 for ; Fri, 25 Oct 2024 06:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729862095; x=1730466895; 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=M4p/a/n3EAi1phVyfP45uoVE5rF3xsXeLLa3VUUHv34=; b=Wy2xOp9fUzbZ2W/7xYQjYaryAa6BHnlzKLPu10Vj/amZr2+GNi5PS5/dGNdx/W/AvS 0ncux9kscK4KZWkt2OGnvvgrgdH3SwtO1rKkE6YuTyxr+4CwtH7I94OepIo10cGZTFm0 V86CuToeFFYzZvAhsO7E2/+AOlTlkOJYvo1lJTxotyxg+E2rMCCUjEAVhfqt1Nc7EdfR 0HNc9yyDbd8a3VU99dvfMqZjsJ8aMX3qWAY/0eZqnOvepod8QMepHjE/FhnwsEmXG0Aw Sk0Vh+knbGtI5HnFtCv9M8AwB0KZ13KcjmDKsc8abacLRdTQa3Kj8wDK974nRU8ntHAG byrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729862095; x=1730466895; 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=M4p/a/n3EAi1phVyfP45uoVE5rF3xsXeLLa3VUUHv34=; b=W2Z3I347wv/AK3gutvT+ZS+fODnbIQMXvM82thF2dH/P9W0eQ6yQLjz5MsaZ3k0mFY pITDk61Qm9+r1begoQJY0UEzTioQ31HlpS6f6mnULRuAonlSkhByi5uLiNU36+OVk9m/ 1eiAFeIWTOZ5zJDm/FUIJgZxQL9wAJ7pTiOR8bcpz1vSMuFvge8ToiXbrwAJX0cqVfPZ hOnM4u6Mn3su0Amb0J7NaXvrdpJWgDpldtvvxIRdpfbDQKx8A2C7+Z5rb0BJhisIENlq zE4JK5M4twgEB+oHg1ghYfj7YZI4IhbErU8Xwoto+SOGUjeQLlgyVK1lChq9S+Jq3rax bFgA== X-Forwarded-Encrypted: i=1; AJvYcCX3xylfqovhOw/QqCrb/P9mBC/dbmJ4yGuPRU9rc0ny7G4bZMDW7VJ3tdbvPDDL4sj1pXeEvD+bqFFljjg=@vger.kernel.org X-Gm-Message-State: AOJu0YxLMMmEFmTWcn8UL5opqVt0RmtNrzG0DQqq68P4nliBXL4/6X0h 1YJeESS2gneXYSk+o+Wda7tBttQRqRFYbTlPyCZY47ZTrJc3Ci/s8wAsNL0ZJsE= X-Google-Smtp-Source: AGHT+IF1nqwM65nZ/hmqcna4gL0pzIQdq9UtAly6V9yqCaP7b5l/UQUT68oG19uDiQ23I6pznxiPSw== X-Received: by 2002:a05:6512:234e:b0:535:6cde:5c4d with SMTP id 2adb3069b0e04-53b1a2f1eebmr5293668e87.3.1729862095389; Fri, 25 Oct 2024 06:14:55 -0700 (PDT) Received: from gpeter-l.lan ([145.224.67.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b58b6bdsm47616685e9.45.2024.10.25.06.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:14: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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, ebiggers@kernel.org, Peter Griffin Subject: [PATCH v2 05/11] scsi: ufs: exynos: gs101: remove unused phy attribute fields Date: Fri, 25 Oct 2024 14:14:36 +0100 Message-ID: <20241025131442.112862-6-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241025131442.112862-1-peter.griffin@linaro.org> References: <20241025131442.112862-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 a1a2fdcb8a40..9d668d13fe94 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -2068,26 +2068,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 Mon Nov 25 17:27:58 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 9263120BB5A for ; Fri, 25 Oct 2024 13:14:58 +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=1729862100; cv=none; b=hDhLYpgKZejZ0X44EMsg615yp1AbuKrmR6q2zhfDUUrEuLyoD0Ic/q8tgort/6r/y6e9Uswnn6m2Ts51B/8r3PMnpPy4bof9K+sgUgf9A3f5QLqg3nVdAn/QQMPLXvok9ZeNVFqEYBrOBObhOS/QyNwLwj7oNPnldxejGN0RcIU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862100; c=relaxed/simple; bh=x7XRxl7ysLw3w3rGpNl5xX6v+xyCoZrRF5jieQeGFEc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KyxkfsSX7Ejp0idT76N9suCYRYRr6gY+6SzlUgmNQzVd55MpyhjwuySBQZEPm4dAdKhy4MeqDf8vBtLYQ9z9e8/R3okWpJYg/qcS0FigflJkB/hvyV1yDDAYV2i5UlmUAIXII6s3ua2ReV/0hkxCertGb8eE3zRN9IFdUJYLzKs= 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=cm1KTRXz; 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="cm1KTRXz" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43155abaf0bso20688325e9.0 for ; Fri, 25 Oct 2024 06:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729862097; x=1730466897; 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=cNn15pq7FtlSd8hCdE286On7l4GZ1JdLdzQd70l8fTI=; b=cm1KTRXz5lg838koa+prBNwXYveBj5m3AOdbflgBkOAeuSPsMODLhq+ECxNuT+3jpx TzIXalUL9K60+6fSQonUf9Gfh3pZUfKd/UJs+IzCkLNA9u2sQWTmMv6zpXxByBn/IOXx Cp3MhQ1ZSCblqCspoAGzrkNLKJcyaYvaJ/8H++4hfkAyhFl1z/qyOxzd6DpUUGa+wur8 xN+ErjDP1KbGFG9c1fUpnGkiveN52rO9CKkDCjSW40ASjLa4cJ/u7sp0smF+dQr37zSa 900tmE6qmhbyfQsSeYaSRMxyfiVkvY+ZwTBg4qEkXGu4jaDmdqj77vsL6ruDKK6DuYH6 czZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729862097; x=1730466897; 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=cNn15pq7FtlSd8hCdE286On7l4GZ1JdLdzQd70l8fTI=; b=KWApdRjoG5MgzgIGd/REB7dYR3HCourqlC66vY0vE4E8R1DonxWy0332SmhVfr+usV JXArujsBhUvjGaBZIX3mSA41wCpKcSmLM+aVMjR8/Oi1CwVSzSYYmnqUgfz1krltNF0K kPLNZYx+76kevdXl+jWqD/OZ1C95MilnHxLkxlBTRxzhVL7JL8UsDU1oBzqZ7ClNPdHi 4KyOF+TvsXidax9pjSznoNEOUy84KX2y4z47cwhmwfUi7r9Qer3GrkL8+3fkLiHUQuon A2Vpd/PqsNV001y+mz35buzUUDI2X8wcX0d9jRGLjFmIM//mW3TlsvkmNQCul3eCoAGZ Mqbg== X-Forwarded-Encrypted: i=1; AJvYcCUg92Za66Gm1XHFowjFzx4cAEFlJlqOWhEZ4oNCgcJbYrFgCBodRJhMqlH4mSYzk4qcugXYVNKCdmlAbr8=@vger.kernel.org X-Gm-Message-State: AOJu0Yzno4uY6fNrnclvkjvGajvFLot2uZU/q9WD4m6LHovI9v/jZMRu 8VNyObldczgFMXrwD1fUJ8O1JGvgdBnNHac96I3HnrM6sfOpGMWLdv9W7GFsn64= X-Google-Smtp-Source: AGHT+IGmYuHoaUOEGVL/28LOiMK/A9Q47ttebm2jL0yHOWlag+R8pd+KgV3xQfuxq1xntOnAKAHD4w== X-Received: by 2002:a05:600c:46c4:b0:42a:a6d2:3270 with SMTP id 5b1f17b1804b1-43184224094mr87230815e9.21.1729862096953; Fri, 25 Oct 2024 06:14:56 -0700 (PDT) Received: from gpeter-l.lan ([145.224.67.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b58b6bdsm47616685e9.45.2024.10.25.06.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:14:56 -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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, ebiggers@kernel.org, Peter Griffin Subject: [PATCH v2 06/11] scsi: ufs: exynos: remove tx_dif_p_nsec from exynosauto_ufs_drv_init() Date: Fri, 25 Oct 2024 14:14:37 +0100 Message-ID: <20241025131442.112862-7-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241025131442.112862-1-peter.griffin@linaro.org> References: <20241025131442.112862-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" Firstly exynosauto sets EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR so setting tx_dif_p_nsec has no effect. Secondly this assignment can't get executed as samsung,sysreg dt property is provided in for this platform. Meaning the execution flow will return on regmap_update_bits call above. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- 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 9d668d13fe94..d4e786afbbbc 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -205,8 +205,6 @@ static int exynos7_ufs_drv_init(struct device *dev, str= uct exynos_ufs *ufs) =20 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; - /* IO Coherency setting */ if (ufs->sysreg) { return regmap_update_bits(ufs->sysreg, @@ -214,8 +212,6 @@ static int exynosauto_ufs_drv_init(struct device *dev, = struct exynos_ufs *ufs) UFS_SHARABLE, UFS_SHARABLE); } =20 - attr->tx_dif_p_nsec =3D 3200000; - return 0; } =20 --=20 2.47.0.163.g1226f6d8fa-goog From nobody Mon Nov 25 17:27:58 2024 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.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 42389227371 for ; Fri, 25 Oct 2024 13:15:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862103; cv=none; b=V/BqWLgvddR+ZfAYPZOrRCevr81KOFcaO8fVLjLMfDzinlJIu7sjpRLPj0PEPg/8HxFrlgAaQTQT+4W10C/zgiTniqS6r8ZBToRMEKVlSY9ym+EkOhISTsSU3ElTap3dhRlAt1SAFU8lanqrQAg9LONrkmq5TPyhUrCjA3VEje0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862103; c=relaxed/simple; bh=UMHAH+7d2ubvmat4NPmFpXjrw0W8dqJHnrFUvo9OI4o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z5L4Tj0O+LMmmK4t8VgVPQFebw4NPWXeQ75jKRgRDy/OSeCF0K2+wMCK7EOI25//tw2RQIDw3/VLAMmO+YpVqjanmmBRX4NET6KaPDNLQ1/I5v8MOrWUGAVd7elTu6dyk4Ne7l5jGGJ8/jORIjMIVkn/Y4qgW48AkNHI/DlD3W4= 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=NRPQ0cEp; arc=none smtp.client-ip=209.85.167.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="NRPQ0cEp" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5366fd6fdf1so2854147e87.0 for ; Fri, 25 Oct 2024 06:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729862098; x=1730466898; 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=8mSP0Idfdl9Bddnm7Irkt+YNMMsQJrdvTnch1RJ4UlY=; b=NRPQ0cEp4OpsryTWWGL5cuw3MWDowipQAhe4dDzFYXr6rKK/6b2NzSm9fP1yFi/SA4 mqWk0TdGGaS+GR2a0xiQO0NJKK2TO7IfCUAUKQZct5w3dXrs+Z7ocGesZ8FWxrzV719f mspEQ/G1lD4MMzyyCrnG5jhU7k194s1lhgy+VJNTgQPs7HwmYUu6+odzom+bx/DdK5n5 S9YI0oRbUanpsLoVITWk1jY6sOAxc/8yXDmwjtdx3+ATtYGEqZBOSoN3DpenFtxhNDin O3l67T0TnTinIO/5XBbbUOqU3iJcVfjkfyYDf5BNEinmzLDh0QeyjJ1RlB+IO6sJFauT PXBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729862098; x=1730466898; 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=8mSP0Idfdl9Bddnm7Irkt+YNMMsQJrdvTnch1RJ4UlY=; b=PvIDYRZs6dkEXLpAciUe1Q4SzM6OSWLUNMtErjNZMVqdA7Ywpkntt3INp/4rZvG93Q jnKp3V0Z8u6IWBguzGXtkGOV6l8+nyNec0FYCdUXNZAQ28ztUKa9b3/FtwZQAaG4HmR6 h5QCGF7WW/k1C7jkFWsz5GPv7rBLbh3fCiYeCG0W/vDRWht/D/XV95YCbbzu/chZJlrX o6uZvQ1chQ4vGbUnV3Sn3uu0lTSjW9DDUpTMU2YjPsNdlkeAiaDx7gepvaVrnXzxYc6J XFDMP9JZu0rCoPHG4I73BwYlb5WXz5JVV7ieTSp5PKjWu7PacQSKdbyhHUG3V5GfNHua MZRw== X-Forwarded-Encrypted: i=1; AJvYcCV/H3HI2zA7U2lzo+ajjKq5hA/CpoUACKVH5MHjEkZJcQRYBSVDQmg1iePO2M4p1xAfyeiJ0bM5ux/nIxg=@vger.kernel.org X-Gm-Message-State: AOJu0YzshrjFC1fyM+e/TFt/bikipuJ8uyExIMqdEMAbaTES7hTTtJsG 43NAxwhUXTzi8HLMwd2FWP4vjnE8MDjL5gPyXqMDg3mK3HvBLpgf1bnJKNlous8= X-Google-Smtp-Source: AGHT+IFIjxCtFqGk3E1YIZeIbZDApteEen8rQ8qLd9MWNW7M5VeqNXGVeyRg3HBljC/8CXJKDn+GyA== X-Received: by 2002:ac2:4c55:0:b0:539:fc75:99ae with SMTP id 2adb3069b0e04-53b23e1df9emr3392181e87.31.1729862098342; Fri, 25 Oct 2024 06:14:58 -0700 (PDT) Received: from gpeter-l.lan ([145.224.67.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b58b6bdsm47616685e9.45.2024.10.25.06.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:14:58 -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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, ebiggers@kernel.org, Peter Griffin Subject: [PATCH v2 07/11] scsi: ufs: exynos: add gs101_ufs_drv_init() hook and enable WriteBooster Date: Fri, 25 Oct 2024 14:14:38 +0100 Message-ID: <20241025131442.112862-8-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241025131442.112862-1-peter.griffin@linaro.org> References: <20241025131442.112862-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 --- 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 d4e786afbbbc..40b2563fe011 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -203,7 +203,7 @@ static int exynos7_ufs_drv_init(struct device *dev, str= uct exynos_ufs *ufs) return 0; } =20 -static int exynosauto_ufs_drv_init(struct device *dev, struct exynos_ufs *= ufs) +static int exynos_ufs_shareability(struct exynos_ufs *ufs) { /* IO Coherency setting */ if (ufs->sysreg) { @@ -215,6 +215,21 @@ static int exynosauto_ufs_drv_init(struct device *dev,= struct exynos_ufs *ufs) return 0; } =20 +static int gs101_ufs_drv_init(struct device *dev, 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 device *dev, 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; @@ -2124,7 +2139,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 Mon Nov 25 17:27:58 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 56790231C8F for ; Fri, 25 Oct 2024 13:15:01 +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=1729862103; cv=none; b=tWwNfiHJpKWzdNAQ3Ua32hNsugY7siAY0W9SeLGruAow5n9pb3TWaDj9s7Z/rGkk2T67Lpa3qdwAQH26UzeBlYzioKWdp4V7xsllsmdRk/EueZLZhQhS3PsW7y81Ff1CsEy9g0X6QfFyfKFXOm3OT/XQb7r1QdHJBwCaJo4JgPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862103; c=relaxed/simple; bh=Kbtu/Jwk87kTVLdVAMrWCkkXYYLx9gjrujo0HVB2Blc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I2MRyqwO8Z/xZIKthzfhQ2o+O4n/4ByfOaeF/a9isFpAIl6bPTB0F1WWdpqXhAb8jSWDIwJiLauGSlyGiYTW8pkAziXtDrPjozHnSeu9dA7/uRei4NN7DeQ/wOddb37LJWsb3foLGd5wvaoqed6Ki7QCCx/Vrr7zMip/btM0jwU= 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=wcvBNRsk; 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="wcvBNRsk" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43162cf1eaaso26612025e9.0 for ; Fri, 25 Oct 2024 06:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729862100; x=1730466900; 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=/Db/7vYWfVTvRELCJjsaav3g2wtQjNY/cZ7wO3qNfos=; b=wcvBNRskRcTbVz+u/17RThq3mHMTXmE/xDb7lwfY2yWovzZ81Z/v0WNfhU7UvhgYJH ZaJ+U1mx1DDVbgRSLYLD2PYvPO3Kq5/BkdcPzaetgBZmY3iatG6EzHG77HBCzlS8lj8j Q06o0UGoGshPVT5d9sNdxoxgPRSH02GHGGTllvxZaJXFWtkqecuPM4vrKL9hmTDMS+td x+y8XRAYQ2mqHur1q0Xe6GKOF2uZVy4cGY9YhG7YNUjUeJHzl5UJVOoVuJsZzIpA19mi BuLypD4nHD4+fe3iKY3JrVT6UlNjPUTOM9Ui48Yl0YKwVxuPnDkidrotOZdRC7cfw5T3 iJxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729862100; x=1730466900; 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=/Db/7vYWfVTvRELCJjsaav3g2wtQjNY/cZ7wO3qNfos=; b=DuTNux5xydq29Rp3epknlOPkgzcaRFbRiPo/Pd48eKHimtAqGHLAkxnGjZTZkL6izv 5ShOZxzBV1weXStiSqJXCvPm/28D97CPV/b4VIZ3Lp/9V6fgTfrvzczZ7SebE3F8wwGK tIYbnxgqJKOsLeThVEvthQGoVeibzKj4wx1cAyzeUorum6vnCMhThYosZ87Nr3vPZD/k qLDat++rHIlVGiUxQnkJu0UIV5Z3J64MQn6JTa/AVVdMUMD4jwuTVbllvQb9IbYzeloT 2sQGFpqJDV1U+k8m3L2VooxlYxprM02OYLXP3RxBH4gOb9Ax15M2vZznPP8NnXmTfsDg Q+nw== X-Forwarded-Encrypted: i=1; AJvYcCXvLv3bh1znjbbXSAJSqXqiox8vVCTBPJyh11lyJKwz0SpolYL5N52dYVM0kIPJmkknPxU80oOFcEBDw5w=@vger.kernel.org X-Gm-Message-State: AOJu0Yyhqrn3nrKaRaz5lNutHLT/z51upbzk01OiSZ0bSYBY/6JswqUa 9WiRvzYRUZ1/JdxV9YB3c//fH661fT29zx7hMt0tfmwFNVIYfP9zYRqZl8xo0WE= X-Google-Smtp-Source: AGHT+IGy7gCwHmZzWRjYuJdLjKUklIvRll7qzxjTVKsdjpMsJu9lcX39EllePZe+fyuRleAhBbilyQ== X-Received: by 2002:a5d:4441:0:b0:37c:d1ea:f1ce with SMTP id ffacd0b85a97d-37efcf15f1fmr7504792f8f.25.1729862099741; Fri, 25 Oct 2024 06:14:59 -0700 (PDT) Received: from gpeter-l.lan ([145.224.67.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b58b6bdsm47616685e9.45.2024.10.25.06.14.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:14:59 -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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, ebiggers@kernel.org, Peter Griffin Subject: [PATCH v2 08/11] scsi: ufs: exynos: enable write line unique transactions on gs101 Date: Fri, 25 Oct 2024 14:14:39 +0100 Message-ID: <20241025131442.112862-9-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241025131442.112862-1-peter.griffin@linaro.org> References: <20241025131442.112862-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" Previously just AXIDMA_RWDATA_BURST_LEN[3:0] field was set to 8. 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, both burth length fields need to be 0x3. Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- 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 40b2563fe011..b0cbb147c7a1 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 @@ -1925,6 +1927,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 Mon Nov 25 17:27:58 2024 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 F13F63DAC03 for ; Fri, 25 Oct 2024 13:15:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862105; cv=none; b=i56mzFJzvSd2tgN6+dl+2AausBEATXZ6eO05KNwUODRP8nJjyPjINAFFqsV99spPwh9UV6vgCkdeiJPkkUmUkLeb4FGlweqNMo/ZtLFz8cTg2ZoZU313i37q+C/kH5nhCd1nxgHmVClKqP5NbwtHkmdAPzu7I8NW8rEeJrm8Bjo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862105; c=relaxed/simple; bh=KgknpPj0iOoQwiAH+NqX1OZF6SNzI/a1pt2l/tElo20=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HZFtpRxQLdwGmf8Gx+T1jgcpESHZT9DzI2B/SqbTM8sbqwH0mdDm7Q+qhcO6+7UqUXhxk/o7+yURHyYR4vxhxwtuC5cKI7xFIr9YhMYTrq4+wBGejcpYgWlt4H5tOMdqVDgYQ6aSQ2yavMGeKEM4WPdBbXnTvtaM6cLpQW6lkOE= 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=RXESPEVn; arc=none smtp.client-ip=209.85.128.51 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="RXESPEVn" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4319399a411so5692815e9.2 for ; Fri, 25 Oct 2024 06:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729862101; x=1730466901; 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=hwJALAAeKO6DZ5STVB6W3oZmi4qjYoxF/2Uc+rthKgs=; b=RXESPEVnCDqturQkxU4EWOC1dqwlB1am6qoIjk7u03VDNraJt8fqOn9gXYhr+CVxR+ P9Gnu72DI226tr61oTtjG/EAD29pS9Mam/M5jHutfrsRgigkY5QM+Cg1WLMd2VmH/L2e a5Xp5Lwn6rBBUUyBW2CJFpp24cTvtK3hPCsQuNxTfFF2rMCd7Txll+37a+JmkLGmDo/d Oo/miWICCbIiOkxGHT4NfEX1nCiBSTloDXgR7gYAT0KrTQReUiwL54cTMAYwgTp8XWmN l+F7OA1yaOLNyfVUIGyWfe/mmExlRUmeNb77R/wifw/v8rWELRAwV61rLhvM+HxI/4rV QaNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729862101; x=1730466901; 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=hwJALAAeKO6DZ5STVB6W3oZmi4qjYoxF/2Uc+rthKgs=; b=K7gvA9vjEAuQ1+2njUUUUHHhrmTTz8zQMRzmOewn3fxQSf/qj/3Ex13PlRjLRXPqdG VSsmGfGKZLjNquCMVo1nNilG2PsgylseNLqYaIq2HvJ5cu/spFHmTowiv9xnrkQ6Lfye tMKCgyrq1+oAWeaAJNYfX6IBw5wbVtqQBETCbrD1iiOS630MdJ6+Yb4vn573PkV332wK 7Cjs5HR2Ke/5biVpVa2wCHPePD6Nsp2RLLRxo2JsRob0VKkx1Ddxu8dpxgSfP8hox25l OuFKtbY2lzPAfn23t5UWYGNqnPBA2wbuyGFFQIP7f3hyoFGAyrNu85JK+4wefhD0wjKl zkIA== X-Forwarded-Encrypted: i=1; AJvYcCV7PBV8AYaNeVMUBzQIo/HSVqgZjv0Xt4RajIjrs0X3QywX7v99qzcOb5moeR+Gzacz7AdGu4JZVkhC92k=@vger.kernel.org X-Gm-Message-State: AOJu0Ywff1zYzYZRk13ffq1Vgln0Fic7As/QaPqfnjnn+XcCbpZTS43y AKbQmLZBk3d2Y46MTDwE3KCVhdMdDZWBzSgc0f6kf77l2CGtCFXg7JZoQ9BLbNo= X-Google-Smtp-Source: AGHT+IG93PjcVz+7+9Ks5a4tZOcJmfpGpRSJSrp4oHNgenqx8uAoLySbtv12lhSPEbntHZWJ76vNhQ== X-Received: by 2002:a05:600c:1d8f:b0:431:5bae:c600 with SMTP id 5b1f17b1804b1-4318c780d48mr50376755e9.34.1729862101341; Fri, 25 Oct 2024 06:15:01 -0700 (PDT) Received: from gpeter-l.lan ([145.224.67.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b58b6bdsm47616685e9.45.2024.10.25.06.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:15:00 -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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, ebiggers@kernel.org, Peter Griffin Subject: [PATCH v2 09/11] scsi: ufs: exynos: set ACG to be controlled by UFS_ACG_DISABLE Date: Fri, 25 Oct 2024 14:14:40 +0100 Message-ID: <20241025131442.112862-10-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241025131442.112862-1-peter.griffin@linaro.org> References: <20241025131442.112862-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 help with suspend/resume. 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 b0cbb147c7a1..fa4e61f152c4 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 |\ @@ -220,10 +224,15 @@ static int exynos_ufs_shareability(struct exynos_ufs = *ufs) static int gs101_ufs_drv_init(struct device *dev, 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 Mon Nov 25 17:27:58 2024 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 7988F20F3DF for ; Fri, 25 Oct 2024 13:15:04 +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=1729862106; cv=none; b=GJOJ4tNZteluCz889BdQEMH/1A5pC0iLQ3z5XhFR6+TZX2Q4fqU77Ro/7gIHc5OVCGMXws9AjCsaA8gqnesIAp2TnL3KRS6fiB1g6xH85CF+wVN/8+JLNN1otAR8UrUMns9bR1/PoYovaA3ZwxCxUEMRfQZt3DpXTBRhxltImLw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862106; c=relaxed/simple; bh=F2qnRTR340hKwHQSf4//6eO6VZH4516ssxBM5pftm4Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oPN25INOyx+2ou1ewmVfzHhFoPN3UZZfKDOQWFhOkpCZQsZb+hbNVaCUVbFNuRhWLe9xTYlRWoQCaidj62wjSddfzA35mP29CespmuxeIpNcbY1tkhGvrUYDJpneqqhhVaZoV5wNiKXGBK5/MAgBWO+kmkfB0qliJw1Ku2WuYf4= 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=sFrwdN2I; 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="sFrwdN2I" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-431695fa98bso19836865e9.3 for ; Fri, 25 Oct 2024 06:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729862103; x=1730466903; 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=Ivh7+EYUuihJcPnZHjnVXOeazDxQAc1FZwbuTGARMJo=; b=sFrwdN2IyP3rYPRzWUw82FX+bSNpKhA4mzd+g3WF8t+qBMwV1Hh61iuP6RnZ1nv0C3 HSkSFAFYcEv9/7/oKX7hF3Dg/wLKLmWi9YKvCDKohXrfn25AnKlFiltr654bpFiIEleJ abJpGn5sfu667qaAoUV7mQuDLQ6xEMSR/HQ2TOrxoB28eVewJpXU2AqgC99qoo1b7rjW 2YlfGuPe1mlcWFvj1ASTPbqwqqk7+MBkjCTMk4uRsyYdhyin7ePCOd/3hYX0ewGnCTnC y52ObddhyJWCwgZL+u81OoXiCD2u0N6QTMMfWAGoHdMo8OeDsqjTmJzu4Mw5Cf0Axqpg Q1Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729862103; x=1730466903; 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=Ivh7+EYUuihJcPnZHjnVXOeazDxQAc1FZwbuTGARMJo=; b=fu012VkHSCPoUxGV26bYb03TwMzonQ2CeIXXyUwWyOQiJpzy+TN40/OiVBBkyoPThW y5F1HGbg7vhyWV3fJmJdUAgVtVgY5UO7JVooHl/Sf5f9E1HTo+BQK5lMWV7WdhVjMpTc uUyILsWuwXGjxJkSCCjXEXAaR8KCI5KDrauFdpaiCOCw+VbAq8HVNyg0uj56eGmY19Ce nrsS7zjoAM05tyu9pwI1o9bkpmlb/6ySiugVNxCIQco9y3FTHxpyxd3zzwZ30KtM7QTa tYErYZNTDvSgLmd7R/ff3nju+DDHOLT5g1VDaTH3oOUNus11tsxOD0ETlifbFgSkH5S4 zKHA== X-Forwarded-Encrypted: i=1; AJvYcCW3GO2jjlpERXPbeXEBxDcptgtTfb3zbhFbXEZUA5db1N5+OFm0B+DIaGTijsrSnb20Bzjsb7fqv6rM5Z0=@vger.kernel.org X-Gm-Message-State: AOJu0YyvtYkPQc/On5zaG9Zfbh8+ZKxm3Yx4T8MW/kiylBBqFfPQbhQe 8thCixQwWOGwD6t1OpXOXGCJfs8E1vgUf6U9uV8YVO1EvyfRy6UltrEg/LYItCE= X-Google-Smtp-Source: AGHT+IFHaCs0Brlywx2EDejiKT/SRxUFjAkp/495iouOQYJDyac2EtGgBL2CMBR/7/lJY4x2bivyMQ== X-Received: by 2002:a05:600c:4f88:b0:428:ec2a:8c94 with SMTP id 5b1f17b1804b1-4318c6ea2f0mr54335655e9.10.1729862102813; Fri, 25 Oct 2024 06:15:02 -0700 (PDT) Received: from gpeter-l.lan ([145.224.67.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b58b6bdsm47616685e9.45.2024.10.25.06.15.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:15:02 -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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, ebiggers@kernel.org, Peter Griffin Subject: [PATCH v2 10/11] scsi: ufs: exynos: fix hibern8 notify callbacks Date: Fri, 25 Oct 2024 14:14:41 +0100 Message-ID: <20241025131442.112862-11-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241025131442.112862-1-peter.griffin@linaro.org> References: <20241025131442.112862-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. [1] https://patchwork.kernel.org/project/linux-scsi/patch/001f01d23994$7199= 97c0$54ccc740$@samsung.com/ Signed-off-by: Peter Griffin Reviewed-by: Tudor Ambarus --- --- 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 fa4e61f152c4..3bbb71f7bae7 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -1529,12 +1529,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); @@ -1562,11 +1562,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 @@ -1585,7 +1585,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) @@ -1672,15 +1672,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 Mon Nov 25 17:27:58 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 F1C4E231CB6 for ; Fri, 25 Oct 2024 13:15:05 +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=1729862108; cv=none; b=ZrEWp6G9ORflFSm2OjtlYv0//1GX/ISHJb3pCnaLJDRv+fPfmKmFjRpVM/PeZR7qHtbT7SjqkeAnmJ8+zuRgBM1nipyD4IuejzRgH8Pao62ELC+iZ0UDiLxo5I/5BBkWPDdnubv9nM/LVZL4mOSXTph5zKCu79LGuT2HeTG5hqs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729862108; c=relaxed/simple; bh=k9VgnamHeRSjv5GGKdOvAnnQA43iGAwv8ANgyYMaoCs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jMCfsfLG4F9RcxN4up1XOX2GfN2OIjamBFV3ngFoH/ZoxYPq9kKLWrJr6fxOglkD8g8bkfEaoGfu+mEmLFFYmvTsIoM5EFE9LsrKlPbkhFBFFU4aypeFtRT9o6CRFXUO+X2REpsHMAL0PBTC0jZL0MQMVnCjo/a+kYvDls0IkPM= 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=YLTpqkIN; 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="YLTpqkIN" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-43168d9c6c9so20727315e9.3 for ; Fri, 25 Oct 2024 06:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729862104; x=1730466904; 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=0aTUxFFuuS7q4apCNsR9KGVB+f/W8Symh/UfMC9/XY8=; b=YLTpqkINQl/k0Dmo/dHnkTCtWaDaxrXXf9ErowBdR4zfWFuU/nl86wGe5bfu2QG4IJ dqy2IH85DJxdqO3vp5e/k9NJ+p4TWsKi00I4KManBdi8rg3eqMZ2c+VefxvNoZUWoScR TYNWo/RYe7rRBeVlbqJ3s0tRpFiRh56rvE5RPGDOsaSxBRVV9lIaMVrPTqYbwpZ3S/Z8 ZL0d3he39HeE1rexS6w+jI/YyQq42kNu0SOhoSl0/HtV7oEuEn2dIi2XfA1m7PcC/z/S 23Tb48sCIxLM2mS4s5dyONyaGvIPq6horZas85YREmlEespKBvcgd2mKfBxDY1KwV858 +KQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729862104; x=1730466904; 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=0aTUxFFuuS7q4apCNsR9KGVB+f/W8Symh/UfMC9/XY8=; b=VMMzV+8iyo1LUEis5eeL2zzYHtDsDdcxHmsWoZmK7x/0E6iSV8xJXdhkGTdV8DAdV/ 7W9lMJF/JBrTdEhVNEWOe40h40cyPHLar4+QJN3ls4n8xQv8NtHB8eENPdbyukY9kE9r lBnEE7A6QHNseLgZ594EBolbLE8QwldAGHNaKZ2po71XKDY1gu+47SpjbR80LS2enFu0 mQoD0+cH3g6NUQ9i78Dqs/U9ghrrhiC3KE2N0A1byYL9DUv8iHd3fmv46RE4sEgdjiXP +AGaA4x2Fb5CEcnSA2T5Ar0Z3ZFU5An5TOxmrLCKqiOQ0BacluUFhUe+ho3jIAONXkAz t+kA== X-Forwarded-Encrypted: i=1; AJvYcCWh6w5bXCryxSrskTDYIZ4F6LoIJjQ1Z0CIc6IWIdwtv6D6QnTM+9eRK56B/foJ6KmbuXAT71mbUwGhatk=@vger.kernel.org X-Gm-Message-State: AOJu0YyZN2xVeaN5I6KWKnK/JXGHBGdPulolY0+1woNasmqK3JZu6fSc EJ5GVIqhZKGXUthY3CU6BCZLoQB5FbqA5lqoaHL11jfeScRNO3bBiUWPuElDb3c= X-Google-Smtp-Source: AGHT+IFn4umTFqPxopB2GAJY2aOrR7RfiFspVJ8SdEfcnoO13PLJi0jzfHRWD2Ee5O6gR0xA2R/rxA== X-Received: by 2002:a05:600c:3b2a:b0:42c:af2a:dcf4 with SMTP id 5b1f17b1804b1-4318c754f00mr39202585e9.27.1729862104292; Fri, 25 Oct 2024 06:15:04 -0700 (PDT) Received: from gpeter-l.lan ([145.224.67.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b58b6bdsm47616685e9.45.2024.10.25.06.15.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:15:03 -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, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, ebiggers@kernel.org, Peter Griffin Subject: [PATCH v2 11/11] scsi: ufs: exynos: gs101: enable clock gating with hibern8 Date: Fri, 25 Oct 2024 14:14:42 +0100 Message-ID: <20241025131442.112862-12-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog In-Reply-To: <20241025131442.112862-1-peter.griffin@linaro.org> References: <20241025131442.112862-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 3bbb71f7bae7..7c8195f27bb6 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -229,6 +229,9 @@ static int gs101_ufs_drv_init(struct device *dev, struc= t 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); @@ -1566,26 +1569,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