From nobody Wed Nov 27 14:28:45 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 D197B191F70 for ; Wed, 9 Oct 2024 11:21:52 +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=1728472915; cv=none; b=WeI+ndJFfOpOgZcho4TUmXLgpF8I8zgQRku6yOuiggGuj68sJZRzQYEhuUOa4LTSV6KgH1lVtK3+uvUTFIQCKFVKmP6f47LyfMHzMT+dDZdTK2hxutopAkjlOF/ejvbtWXrshI98+ThoMC1tukvUDMV2jlqumGEL6GCxDITyzGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472915; c=relaxed/simple; bh=hDzFSe1lRi4yyuPHSIaucwMqr2mLXU7tOlTPgv8XUzo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YRIF8Mbd6+qBYLrwv6l7ZaWPvdIFNEWaC59GarSHIkBf7BLl4V09IzR8JgUvKwMB2FRcn7tMN2kdWux8rkMG5pwUYIxhJ/w9aAKevBL55J0vxFNZ3QbBz/gluFxO1OXp81lbiDunEZjd1lTQus6nyjjVdYtZx78LmrroKd5mJoY= 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=bNnL24xU; 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="bNnL24xU" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-42ca4e0299eso59920125e9.2 for ; Wed, 09 Oct 2024 04:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728472911; x=1729077711; 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=ghtUYLBlSjf3IggEwHExig2CKcpoS8dsJVFld1RzVuU=; b=bNnL24xUF+gpLihMlmHw7IUZziKucfwCEJ1OvruipQ+p+WQ0tCe5xMA6UP3zi0ptx5 XTlw6h7d0HQBGFcJ5qqIryMpDt7WleHdfQ8YaN3mGy7+UEcqcfJPCNM8oDEtUOU1sNt/ fmS+NxZkOkKsIgQJZDsYJBkg+a8mnQFQfhxMA/tzdGt1yggopRmy1KOeIYSgp+9ZH+zx PzjmYoFGaTTVEVrrIFy1Ghkm4t1aM02WVZYwOXzs0Sve5fXFCoTJB/9nXRt03FbaT2wz Gaicrk5LbZOoiDdGzY+5n59zPtqwhkXDYN57wRTTZJHpMMQqcxro03nfl2ObAdNmtCku bUyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728472911; x=1729077711; 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=ghtUYLBlSjf3IggEwHExig2CKcpoS8dsJVFld1RzVuU=; b=YeLh5T/8tWXbb6VEc98A0Fl4WR3YaKzsWYYnFDg4JTzj8ndPMyCIC4r8puOPl4k+SZ +Q9BUuwhyFEnapFN/xKZ60b3/1SDb++26pQ9iD8SqwNWuqKaLvFqPRRlU6ycP59dHoRg GDxQi+bwsuTgQJRnAsRxa28haslqMhnHVNHzIecx58+4AecExHbwfuebXzPlyoT3HBNn qZUboIjwE37JvKQ7sjco1uSzWqsxeOUOaE+aHwk7fVBvSyqg23UsNXF1ngsClTE4jUQf kEnuoWMrQ/Ade5mWNAaK7kVPDghGa0R9dWUnT1Z/BpCS+3YHwEKH5iQdbh4wA0a6xCwK sQLQ== X-Forwarded-Encrypted: i=1; AJvYcCVMhuzyi2197cdvYuu45A500hUGxASWOQz32iT4Zx7xQdmYBmY1vGf55lBc8AMzFafceGnhg7NlfmUTKzM=@vger.kernel.org X-Gm-Message-State: AOJu0YwwojY167JhOzuwIRnAUSPg7d2y/iNv/OpZ8YNT6/I4azg8zOl+ quKNl5kT1KpvYUbPo4fNzcsK9PWe4eUkxcp8dL4JV3zLbiGdvatcnvuW5q0TsjI= X-Google-Smtp-Source: AGHT+IEJX2RjpFeLUHsr4Qx7o7zdf3TWL+5xxAUSFTySxWEYnSA6UXjwYDBXPN59NyQNksavaCy8pQ== X-Received: by 2002:a05:600c:3544:b0:42f:7c9e:1f96 with SMTP id 5b1f17b1804b1-430ccf091a7mr14596575e9.1.1728472911183; Wed, 09 Oct 2024 04:21:51 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4310c3dcdcbsm12331445e9.0.2024.10.09.04.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 04:21:49 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, 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, Peter Griffin Subject: [PATCH 1/7] scsi: ufs: exynos: Allow UFS Gear 4 Date: Wed, 9 Oct 2024 12:21:35 +0100 Message-ID: <20241009112141.1771087-2-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241009112141.1771087-1-peter.griffin@linaro.org> References: <20241009112141.1771087-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 --- 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.rc0.187.ge670bccf7e-goog From nobody Wed Nov 27 14:28:45 2024 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 7A75F1922E4 for ; Wed, 9 Oct 2024 11:21:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472916; cv=none; b=jKgDDNgMA9C89oK5OWS+xazVowR3serKkXuFxWqiZjYPruFUF5XncQcbzuqv4SMrICT01lNEB3SnCjP0CrU0WZWCkOMxwlnzmmflIlDJXqV7uP+vSPEw+PmStALZ74TOLkJjQAce0211yMdlKoFMceZpeWYFpaXZiD51O5i78IU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472916; c=relaxed/simple; bh=U2N6z2wH72kLC/ElVe24RfJtkaCecDBL0/+mf8cDWuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lav3d0nIa0c6EJQC4QE3w5EzVHR2LzJcdLA0O5q8o1vYD8oDOuZje/1eSxt7gfI8QS7mRvbSdwtblnVs05Wg4NzQ6nLdc/DROW6FYeyZL42qdAnVmiWJuJzbZQ5kDEXTWWHR2pgw/7nOG/Z30bh6I4kh9YoEFuxhk+ZofPpuNFI= 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=t3pys5/1; arc=none smtp.client-ip=209.85.128.45 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="t3pys5/1" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-43111cff9d3so4343855e9.1 for ; Wed, 09 Oct 2024 04:21:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728472913; x=1729077713; 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=0G5+DGHRH9uKXySVvDG2zjq1MsEuwXbycCIn4qhJYMw=; b=t3pys5/1uuPu+UHCRAG07KCBO/jn9j6LPcd8CbXD3xjJx7sLX1ExVvewkFHZYPy7oo lz8XoUqjo+RQSScLvZSLsCWYcjlIas7ax7Jz6u/0slG5nggd5fK/GLEF1rAfIT/+Pxnz 9EKcg/bOb+KqxJJRsWZZKqh8vywMxVA5AcV+cOP27XXlXfVnHx06ZPIeir986zyU0gBI kw0/hi/ZOqLNORwT0k6GVEE2SYhkt69tdLYJa7MqCX6tPX49mUOtXelPZLj6hu8P5uHN RCUgYtj2qCmrPyAYe4CSUjeUPXvd6OXFrZQogv2YSRqMTmY1DEmQeLHNmO/6cfu2wKpZ dELA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728472913; x=1729077713; 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=0G5+DGHRH9uKXySVvDG2zjq1MsEuwXbycCIn4qhJYMw=; b=Fnzmra7XoSaJYMm5cp00gUDw3xreWMcQZ+LKoKeZ426gvTOJeZrG6J7oO6tktgNIGU vnbwqQLzAB5AV45nC/SKfskJitJcqktc42Wc7oic1R+SE7FSwVNFTkgq743HwRWaQrNA 85Ya0H5deFg4PMDl1vqR2+/0cbEwI8/BJswPZrStce8bOngcFDgDyQrRHdtoSuDWCe/t L9QUqX/fXT6T+4ZCI8dD81xKCYfB22pEp4IWNxUvT2TO4dQP59kIymuJuiw3ls4N2RYM pOLA2y/lKA7r6S8KFxLbVG8r4QUYJElEQ4mPpVQ/yXg92aT0TkZAxG0IDDu5cLanFA5G UoCw== X-Forwarded-Encrypted: i=1; AJvYcCXjzE3LrNbK9I6TLOFAt6qlK+z/Xl6NASbbHBXDy+AUudi9+r1FBxV1Y9JH1zTqiqzWykwctSMZjo33aOg=@vger.kernel.org X-Gm-Message-State: AOJu0YyXf7mQaQY6UCO3lhNhTjVWFuuRvNe5RusLR+8eqGM9AG1PTlCf fZTQM5pXkJPlpxh5NjYBY6DwWnt4zJumliQ6+vuyX5BDL9nLQTORm92HsH4rLVI= X-Google-Smtp-Source: AGHT+IGDUkReqvpDILvzLlsGK2Z3Cg76lYE/cf1NIlvq1mdgxLrmdCkneJKzCCHIFSebONF2UDAWJQ== X-Received: by 2002:a05:600c:1ca7:b0:42c:de2f:da27 with SMTP id 5b1f17b1804b1-430ccf0859fmr13666665e9.2.1728472912789; Wed, 09 Oct 2024 04:21:52 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4310c3dcdcbsm12331445e9.0.2024.10.09.04.21.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 04:21: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, Peter Griffin Subject: [PATCH 2/7] scsi: ufs: exynos: add check inside exynos_ufs_config_smu() Date: Wed, 9 Oct 2024 12:21:36 +0100 Message-ID: <20241009112141.1771087-3-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241009112141.1771087-1-peter.griffin@linaro.org> References: <20241009112141.1771087-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 --- 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.rc0.187.ge670bccf7e-goog From nobody Wed Nov 27 14:28:45 2024 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.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 E6911192590 for ; Wed, 9 Oct 2024 11:21:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472917; cv=none; b=YZCl4v5AAtrD/ZSX76c5epjJJgCVP8h0hok0XRiqaPvgxgF4qX1BWpUd5q1Ohb2vQYS3A/kS0s+8oJMJniQzdJSY26DPb03CCSOx61qG0mn9tg7bfYubeZNb5khxC/EC663dNSdR1PM0cc1B0lDtzOZMd7qDFlWv3Vxa1kAu5pE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472917; c=relaxed/simple; bh=V1Ebg28xAJMkAH3vygTav0+GVnN5eEH442ZJFTo8Z9U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HTnmSnB4bekMlcD8PhGUJTYaG3LgVHVNcobRfyQjKM6mlJw8Z4fHqCjd2NeoAudV6r/2z0SSCMKxC/0/OhMHg38LYrd0AK/gLMXVuMVgCYqNWhD61+pPjx6CjaX3eviO6a7ueT7x8hjVLz9zAo2Vxkv0uuggvNtHquCVGmkEzWk= 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=DO2Ojuj0; arc=none smtp.client-ip=209.85.221.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="DO2Ojuj0" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-37ccebd7f0dso4359373f8f.1 for ; Wed, 09 Oct 2024 04:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728472914; x=1729077714; 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=LGYLAi4JF+h9/4Hxj8IqsekpEDYHXMIX8LJHajmfJfQ=; b=DO2Ojuj0dao6MyKQXmXDhTTqLYBCHZDd2zuVMxWnSafY0uF+sRJFJxnar8sUrZwz4A XI5vuuRSC0T0pJgy9CScXzg0EHPtyESHmgezpBJ1yRmXjuFKWg1J5fgo68rne3p0Ixdo CMZnQIEtTxbNmB2nHYDzVYhJXWnUkCwaLZnPrQs46A41RlWAQlHyME2H/vOOnDobGpVq UZJ0sYt3qREPkpYJzTGmFzp/3rT7bYmQifY/0+9JMe2QOPr0Bh73vFbD2Drr5ZoklgkV FwU9b4GISmIgEbuhkGC9+DfdTDnQogNAA6cDItHOUvFzSEKLnxfOh/IeGhWmYp/L6LQc w9Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728472914; x=1729077714; 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=LGYLAi4JF+h9/4Hxj8IqsekpEDYHXMIX8LJHajmfJfQ=; b=VZzlPEo1AIKVAs6yJcktwco1zvNK0lO7Ljmw0bkPsgJKuCyOiHPDumdYLXFDJdQYqh SMXLtXoil0EQ3lT0shYTV0vck6owh4gpHxsPbKurmjef9iXKgDQ4AXYl5T23+j0+eUQu X8seHvV0xQR2PBNYj+pcNxXVBNjOrC+MJx36o+bUat9DE7sgQibBedyCezBKFmK/s78o IBPdtCP/OChcJIXrBlBKTO7G5To1aIfRkrrOmdM1+9x8rg0/Oot/Ac3eqFlMLF2UCmx0 wxZVPoYVvvuM6SUdt9WeunS+7sN23shXZXbYxJr+mqH0JqfuroGMMmzx33YfxHnXIaD1 jKhw== X-Forwarded-Encrypted: i=1; AJvYcCUbtq+VRj8SYgrEuoVeZuakcHAsnSpO+x+aCRLCM0FWpeLmuCftAcheeR+zx1hQIsy+B6qChugvokpBX1w=@vger.kernel.org X-Gm-Message-State: AOJu0YxXMcMmJA9TKIj2zKHxS4Be/jNHtZB1zcGH3+666mAWZVpX9FOR /VrA30I2gOmIaN6aU2alGRMOHN6gViVfMj5NpkWf06RUtzqKFdjZvrgVM8dNd3M= X-Google-Smtp-Source: AGHT+IGdWtb+G4uTKWkGy+SLP7YhXIty2nIIk9lA4K60gde3ICkfsbfdSfZOvGEFpFCgPGCfowuJqw== X-Received: by 2002:a5d:5e0b:0:b0:37d:3e8b:846f with SMTP id ffacd0b85a97d-37d3e8b84c9mr844904f8f.24.1728472914307; Wed, 09 Oct 2024 04:21:54 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4310c3dcdcbsm12331445e9.0.2024.10.09.04.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 04:21: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, Peter Griffin Subject: [PATCH 3/7] scsi: ufs: exynos: gs101: remove EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL Date: Wed, 9 Oct 2024 12:21:37 +0100 Message-ID: <20241009112141.1771087-4-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241009112141.1771087-1-peter.griffin@linaro.org> References: <20241009112141.1771087-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 --- 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.rc0.187.ge670bccf7e-goog From nobody Wed Nov 27 14:28:45 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 BFA65192B88 for ; Wed, 9 Oct 2024 11:21:57 +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=1728472919; cv=none; b=UqCOjeqS/Ts3VLU2r5jyr176ttTOPugyy69rwuMo+qK+NrUFhVYLzvGZ2SzBWZ/uWZMHeJGBrmYnwaeKXnCcOH7QElYag9jRXe6ZA3YuTr9966jgEOtIsL2uqH59+J0FUoWN/ZXDqPKWrBNB0vQkCujIVYzqm4kdg7J4qY07ZVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472919; c=relaxed/simple; bh=yvSPo+u1rV9HCdDx8VvGiSquc9UOwDhjQSc6U8bRi3c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hWcP9BDlHBYjjtvqRVPhvqRTEMNkt6tghNIUiSKGQZCuIanrOv+0nXP0EmXdITdUflAAZKZE1fB5yB/WkVN02gNTu6z6bSoCxHVeODcYfs+OAjuLNevgoHlbbrdtMlONJma+hwuBcqPRqzLNcTzxto/O7m0bDDRRlZBye1hA7/A= 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=hJJJtK2T; 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="hJJJtK2T" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-43111cff9d3so4344205e9.1 for ; Wed, 09 Oct 2024 04:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728472916; x=1729077716; 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=pX3tu4r0T8hfLp3m76HchWclu4+8PXIAtD51r7i7hmo=; b=hJJJtK2ToIINMmy7T5IzRmvKFZ8vJ0bLHloukDrCxJqYjErmVZVRvsOUZQOxmBfIVu P1aSYQx83VAY6T0LQVR9+O9NcL+gMw9KPPpKiVP7QyxyQTNN1TyKOwQ0Ozkf81QL2Ql1 YmOcFQO1Br33DnhTJxf8m+oz37pQsxy1Z37Y0y/NYYFuNHKWHLBuPh5Y9VUDwNoeveTs gerPXzPW80+8JiuvNddfxAuYcROH8pGfR4VhL2Ogk/lmtT8MhToFbJjLw02edmiUIDvV u9dfy3GGEA6qQ1j906eQ1E0ldBGO8/l5FAju0ha9rTIpL9EFuzKfjoWiUiWZG6hzUmpg UOmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728472916; x=1729077716; 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=pX3tu4r0T8hfLp3m76HchWclu4+8PXIAtD51r7i7hmo=; b=RFsKnzAQLJUZQMsEZLlhVROdI5mR6N+G0OUpfXzVKIHvgBmKH7LntWRhXBsn8nE48S 5A0pVPx69VRcHyxD56ukgBlvCc1TdeYc8FwN+1yhSx6jAzaRWzu0whQyY0vBjWrwHIgL hrdEe90H54qR7l2UcPsfEi9HjFDM8PnrS7DHUnYmLc5GdAFDPlfeMhbgpnE9kfa4ukxE h6fVK1Gi0jPuFIt8ZZRPg6fAw16dnnK0THouutZ0tn0HRJk5JoaKYOF62uoCuQ/ztdl8 TdC+uIfDMcU8IU5T6zPVd7oyF85aLYCgMhrLdCb+qACPuCToQb2HGY9xVhLKm6enYut/ jeJQ== X-Forwarded-Encrypted: i=1; AJvYcCVmuuq9WUkf/dDgapNwdY/uEC+yo3SwDYdrCA9JQ++j2Qo/er+RkGy8dYAMXJQxb8jC7zSTk+wC+YbBeMg=@vger.kernel.org X-Gm-Message-State: AOJu0YwU03HDwY8kG6Rw770Fc3BjywmZQ9bx1BcHHDuyf4VMOK7ZZ1JP Om2kuLzAg5pk5uYRfqGickDFNh4V+6B3vr2CHwmMrE1kPtztZqcr/qEFwpckDnI= X-Google-Smtp-Source: AGHT+IFlZ/wsuxYNG5Un8P/i6V6t9CA6cih0ZKz2NoHn5swbiS3uEf9ML/RKj5myS1RUufBKpr7pTA== X-Received: by 2002:a05:600c:3b12:b0:42b:afe3:e9f4 with SMTP id 5b1f17b1804b1-430ccf08948mr14280075e9.3.1728472916015; Wed, 09 Oct 2024 04:21:56 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4310c3dcdcbsm12331445e9.0.2024.10.09.04.21.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 04:21: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, Peter Griffin Subject: [PATCH 4/7] scsi: ufs: exynos: Add EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR check Date: Wed, 9 Oct 2024 12:21:38 +0100 Message-ID: <20241009112141.1771087-5-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241009112141.1771087-1-peter.griffin@linaro.org> References: <20241009112141.1771087-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.rc0.187.ge670bccf7e-goog From nobody Wed Nov 27 14:28:45 2024 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C1A7192D95 for ; Wed, 9 Oct 2024 11:21:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472921; cv=none; b=E3gyYdaDKA/1q/dS5FJvL1DE42aU89fWLaBR1ml4rhx4beWs+bOaER7je82bo1wL5OlZe8ZNPKM+STjNkPGfSNI9DpEsBgGVLkU1ZNA2EiZoOp6H6O9bZlHn09WuQ9V0gbw3SxG6d9l66Z7pGrA9VUoZhsjyCPPpmEJzv2eqtv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472921; c=relaxed/simple; bh=C68am3iNWJR/rEFnqne67c0Zba3n0Keq3E55e13RfNI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XCam3mlOLRVjpCVfmXZLl+pJB9vwF5NFOHn34bbYwVh3cMfoF8r68NgsyAMmxRnYTkpPIEjMZdt3Yv8oRoU+GQMoLFtfxN/h174y2PZpZ8uBAtyg3agVSIfYYdgXwUCYI8XZWhXZnCzCUuUbaTi94TubQRMhEhbd85swtM5wYFE= 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=yTS38Eru; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yTS38Eru" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42cde6b5094so67887315e9.3 for ; Wed, 09 Oct 2024 04:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728472917; x=1729077717; 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=9yc2bquJWnC0TuLEtllIK7qV555Ljs382cn6kxswI5k=; b=yTS38Eru7AFKuuEvVyBK5885GwsC9/wIRE4ZvNrZ+1IvjjowphVw+xeMYg/VjZYddw oO8TFXo5OF1t4XPSAZPG3u7GXTSSSGwtPaDyUZxIMdIQNHekXydwDRV0hW4a3DNBL7l3 8cRCPiQPHTOL8ItAqEaZpvBPSiS1oGEcQk7/H6wyxgpV2vdIxMpMzv+j+QeBsOT/XmMI jlsxfObYCNFot2/D+HH8QbMpanJDQ7YaZKkoJ+D/ekvULjzPVFdWXbsBV4XO7nshxZAZ vFb4N21uWFb6CoM3eKA9kPNN7Let/GkyGVPwDZ9ZKMmu93exXzCzgKLf32ebwPxsRyEV du2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728472917; x=1729077717; 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=9yc2bquJWnC0TuLEtllIK7qV555Ljs382cn6kxswI5k=; b=thdHRYhnbYLPEHUKDjmoiQvyW4Ho1qTG4thQ6IX9rgyw3LPN/tN0eJlmXCsfoFeZeM U+SO3ZkMth/HSaulyRHIv6yYB3c2FykwoLtSUtWAlzmnOvEF/jQIOxQMoHIXgj+DJo3O bwkREKwCWbXl+Z7i9a16B36/YmCgLRAXFyOjR5b5RxfJk9oqzdhec+a4WqPz9oAy5Tmt Wt8O0t1/6+IAsgxl6CR6XrYyV89YK0hPB+v5DE++5RvftiGxzEoAAP8RKv4I08DK2zN9 4pK+1s4PD1TU23pIabHoT9dFMUDr2fmzUQIG6Ylp9eaW3lOi+xmwtjn/NVQEkpLAFxQe htGw== X-Forwarded-Encrypted: i=1; AJvYcCXpWAv7CdYMGNk2kw6KKV8e3vG3P97FfbUzNqyATo4ilrOw12gMwSvYqSObXcTpIQ/R3+8kMtSxMG4O+/U=@vger.kernel.org X-Gm-Message-State: AOJu0YyFcavZD8m9Y5qzDzWaxgKRn43HQ/1P5aXhC8wVBISiKgLRD4S8 g7+NU956jVclOjw+6mfrgMwHYIbJzDJ1j7eDBQoN2seA3t0EQZYXOv5bg3LA6Zw= X-Google-Smtp-Source: AGHT+IGVIzAhsUABVyJOyEwZGVXwYpzikVWau3b/o+ECvGcy7vkekMhISm+whoMp+we4FD4krW7kMg== X-Received: by 2002:a05:600c:45d1:b0:42c:a905:9384 with SMTP id 5b1f17b1804b1-430ccf4affemr14524345e9.20.1728472917542; Wed, 09 Oct 2024 04:21:57 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4310c3dcdcbsm12331445e9.0.2024.10.09.04.21.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 04:21:57 -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, Peter Griffin Subject: [PATCH 5/7] scsi: ufs: exynos: gs101: remove unused phy attribute fields Date: Wed, 9 Oct 2024 12:21:39 +0100 Message-ID: <20241009112141.1771087-6-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241009112141.1771087-1-peter.griffin@linaro.org> References: <20241009112141.1771087-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 --- 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.rc0.187.ge670bccf7e-goog From nobody Wed Nov 27 14:28:45 2024 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA823193432 for ; Wed, 9 Oct 2024 11:22:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472923; cv=none; b=b6BA/kLY8oXISqXPF0/xtkvG11wbWHaRn0zsrsXPVQjWm9XKGqEdjcWX9ERRoxfjmd6Fu/5n06niI9rUC/vcTIi8xSOYjmWmWWZ0LrwYe6rwRggo82ygnTDTNYmKewbKzBKM7TPdDZ4k7fGf/S9Un2Ixpl6XwsqkQbb9XgGQnd8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472923; c=relaxed/simple; bh=JxNG6eDRQStONM4tz52v0Ck91QG+AO2DWVUc9ANCsYQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X1McxOt4EiERakBTcbxCM7JC0GG+jK51qC/FXHbhSI24n8TaOILT9vC7Uvq/LmJ2dM1YGYpLYE5OGx1WhMaKvs55SPiQqjNFBHGifGrTm5G6q4eZCk7JFn2GCATqoGhny2Wn8d8Ybaz7uBJGVFTBWDfguL9PlsubOCDEf9sxjEM= 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=nIvYHbmL; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nIvYHbmL" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-430f6bc9ca6so5362285e9.2 for ; Wed, 09 Oct 2024 04:22:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728472919; x=1729077719; 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=2DpEnA3YplEcQFI6shVCtQMIfbctSRU8+HvPgo32UcY=; b=nIvYHbmLfZgeRoYnHLkBTeImPy14vEevv0QP7RkkwhOXCB8s4qH18Fc39DtzEjNLBl I7NG22DlWetJq6E5CzfvPpstkCLGdLFSJ1JA1Yp27fWIi/wddvVUkClD/SovTnVsGzFG Iqlf5j2E2zZsojo3SkoNHr+AtK6PrfccKtDHAvsDvs/z8FEsVrYoJmbEJU5BORWduXB0 9ZEkJbpFj+Uor+/+SKx3KK9UH+welIL4EhUo3vI6QHECtx+4i2LeF5NR9b/v8j5cYpiH w2Ii4tqJMQBv9I0O3h85MiD1YRcaY7zSe+kGczQn8AjOeEb98CdkbTGigikj++THgdaq +mWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728472919; x=1729077719; 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=2DpEnA3YplEcQFI6shVCtQMIfbctSRU8+HvPgo32UcY=; b=hzBGYPs4exeqC7uG31FH72geiVxiPz2uIQ0skzptH6ETLHtocwTI/KymqUxd3Ulxcs MxC68JH2sivwTdhzz0b57cSMAp6ZjItRPu/2hdquNIC+D6sciNDA/86VM/RqjQtXdrPW MWCt1dm5qTHphlu+kVVdG3fr7r289bL6gy1xcDTKt/aN0Z3sEOShUpTBAeIcTfZuiTnn Ky3k4ufR6ZkY67vHY4SE4vSD0/z/kFHQDjTME8eIMhZ9bXFcqGY2AeFU2rn7ii++mmRI UD3TGc631F/Uhlw6IJBwinEemwd0bZOk+91k+a37npM5Tx8kUZdgO/2FV8ZPgYtWL4z/ 4CBQ== X-Forwarded-Encrypted: i=1; AJvYcCV6KTmaAY/I8t0mv7LKdSlZOAn16RTjucpd0vLh1/g48neY7j9YLiJiD3gCycQqR8FJF/hiwfeUEdP/Qjc=@vger.kernel.org X-Gm-Message-State: AOJu0Yws541cO15sw0BbRuVIxMtiBsPy371B2oYOt8UyUei60Cb7GQQs DK2mbQ7Z8+h4s/m+hMm8tCKsCQCT2peo5CMQBnDqCss2OgAOKOkfN+68jyy0Gac= X-Google-Smtp-Source: AGHT+IGuNlqf0UjHLa+gCSHuJwmN6aEEWrwupvo8fc+pj3U1PFfl1qX4v/XDeaScMudS3KJA7vTNzg== X-Received: by 2002:a05:600c:4f48:b0:42c:bae0:f065 with SMTP id 5b1f17b1804b1-430ccf041a5mr15501335e9.5.1728472919068; Wed, 09 Oct 2024 04:21:59 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4310c3dcdcbsm12331445e9.0.2024.10.09.04.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 04:21: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, Peter Griffin Subject: [PATCH 6/7] scsi: ufs: exynos: remove tx_dif_p_nsec from exynosauto_ufs_drv_init() Date: Wed, 9 Oct 2024 12:21:40 +0100 Message-ID: <20241009112141.1771087-7-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241009112141.1771087-1-peter.griffin@linaro.org> References: <20241009112141.1771087-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 --- 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.rc0.187.ge670bccf7e-goog From nobody Wed Nov 27 14:28:45 2024 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.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 6544D194C86 for ; Wed, 9 Oct 2024 11:22:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472924; cv=none; b=i5vrWc0oida+c2tRGxQ86dS2DYiAvTWAvj/RxZKepjxYgt93Arij5i6b2eRSZRLHXs/XFFSnz+i3U27u+XsQVT/LW5CO/gyJEI9TAvMoZk3p1owS384DqrgqDt8QqiKrSlY2HF4gLwxqLGHR3eNt5ia6kpFbCAP8YOu5sWeGZxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728472924; c=relaxed/simple; bh=9hGmvhSuxE/y9EVLKnI2683ms8TQVTCHDHwmHY9N2cU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=thuze0Hiy8JHBa+aM4Z/AjO4vFE+rYwrc+0qMAiS5wi52AkCGbc+CVUdtKl2DwXU8DJUS2SK2B0xDj7H5zs5t/1okwKu5AqxeaUhD209nRJ2nHVICreSy+LoFlxG8lyBNRrj4bn2FFAw6VZlO4b6m9kaL0d2ih0u++vLSjIzPd4= 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=oxNBtmbj; arc=none smtp.client-ip=209.85.128.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="oxNBtmbj" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4305413aec9so16234415e9.2 for ; Wed, 09 Oct 2024 04:22:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728472921; x=1729077721; 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=W1Fwj3/79g+NY6+faRKtNgwsGaf+fSmMjnCj8KQUGTo=; b=oxNBtmbjtjUdTD2TyW4q7YlYkvbTt8TKhL6jvGhck22U+ByMZ85HlGZ/jECGgkPzt7 ysoUpWXVAKKIF4+YwBfoerZnze5xuHPA9IbgGpeaot91dmMfoa1md0KcfnszbyM0VdV2 KxcIeEgz9rJANYdI5OupdoXQ4my0sY0CPUueDcSmpjI3EBXU2mRK/YaGLgdyM4utNL9i mNwml9B4RFoTFW+uhtkBSCCFte1dPK+HV5UmV8wu6PqRgbsoNM0Dybmdj8X6X0xVGk7I ZRV8GioDAOSW8mMMEETe3eZorQbk/XGbX/G8PUdkLSHE73QVjkBfuH0nV4u2NSGme3fT eY+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728472921; x=1729077721; 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=W1Fwj3/79g+NY6+faRKtNgwsGaf+fSmMjnCj8KQUGTo=; b=DjjnVcQTo/Ay8o+iZd3YET7AKs7av+zSyH7g/tAvOij1erpcl2VypHwCxHJNiNvCUz Ij8VfjPIf2C8on1WFLebyoEkdxlAJOF3rdAtvchSja3UQtnLEUSVo9bmLnS4sF+RUdKC flB1F6Orf8td8ygIzY4wsAu79hl2CeFT7BdxnFJswwjDEoje5QLwkBNuwGynvyAHN3n/ Gs/0YA7DIsX32fq+6apDKYZF+vFWnl8bOnR6dI25k8vK3RbWOYGULJMqVaaqi5JyNU1Z X3YuXcc+DQW4bfB5+VMDxqE3HGlu6dQnk0uFQOItW0JTrGBFviLuBTMx9Wpy9EviIuZN P4LA== X-Forwarded-Encrypted: i=1; AJvYcCWqWrMHYmsfBP+O1KcVFBUh6ewX+NXoYYnbG0w5T2gbbN9Pr7BtLf0UD/BdCrZyM1CDtD5eqFAIO0EdeVo=@vger.kernel.org X-Gm-Message-State: AOJu0YxX26AdFMWuWA17AvKbQRvoVL7tFgINi6KHVl9ATgKBFY9ch2AP 97ipvPoV8zKe3OXb2HOHAF/BsJ/KKoABDCa/E79YZnaWbBMDT1zFCkp/iT1NkR8= X-Google-Smtp-Source: AGHT+IGhYNO9ZBnMSQoh0ZgHAq4d+L9zcAuCJO5c+hulGqbv+vwl+vbBiaHCglEGvUH+mq9MA+vOBw== X-Received: by 2002:a05:600c:4ec7:b0:42c:d74b:eb26 with SMTP id 5b1f17b1804b1-430ccf48471mr16078145e9.21.1728472920765; Wed, 09 Oct 2024 04:22:00 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4310c3dcdcbsm12331445e9.0.2024.10.09.04.21.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 04:22: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, Peter Griffin Subject: [PATCH 7/7] scsi: ufs: exynos: add gs101_ufs_drv_init() hook and enable WriteBooster Date: Wed, 9 Oct 2024 12:21:41 +0100 Message-ID: <20241009112141.1771087-8-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241009112141.1771087-1-peter.griffin@linaro.org> References: <20241009112141.1771087-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 --- 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..b0ccff7ca3fb 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 device *dev, 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(dev, ufs); +} + +static int exynosauto_ufs_drv_init(struct device *dev, struct exynos_ufs *= ufs) +{ + return exynos_ufs_shareability(dev, 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.rc0.187.ge670bccf7e-goog