linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
	Bart Van Assche <bvanassche@acm.org>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-arm-msm@vger.kernel.org,
	Asutosh Das <asutoshd@codeaurora.org>,
	Avri Altman <avri.altman@wdc.com>, Can Guo <cang@codeaurora.org>,
	linux-mediatek@lists.infradead.org,
	Alim Akhtar <alim.akhtar@samsung.com>,
	linux-scsi@vger.kernel.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Stanley Chu <stanley.chu@mediatek.com>,
	linux-arm-kernel@lists.infradead.org,
	Bean Huo <beanhuo@micron.com>
Subject: [PATCH AUTOSEL 5.4 327/459] scsi: ufs: pass device information to apply_dev_quirks
Date: Fri, 14 Feb 2020 10:59:37 -0500	[thread overview]
Message-ID: <20200214160149.11681-327-sashal@kernel.org> (raw)
In-Reply-To: <20200214160149.11681-1-sashal@kernel.org>

From: Stanley Chu <stanley.chu@mediatek.com>

[ Upstream commit c40ad6b7fcd35bc4d36db820c7737e1aa18d5d41 ]

Pass UFS device information to vendor-specific variant callback
"apply_dev_quirks" because some platform vendors need to know such
information to apply special handling or quirks in specific devices.

At the same time, modify existing vendor implementations according to the
new interface for those vendor drivers which will be built-in or built as a
module alone with UFS core driver.

[mkp: clarified commit desc]

Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Asutosh Das <asutoshd@codeaurora.org>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Can Guo <cang@codeaurora.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://lore.kernel.org/r/1578726707-6596-2-git-send-email-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/ufs/ufs-qcom.c | 3 ++-
 drivers/scsi/ufs/ufshcd.c   | 8 ++++----
 drivers/scsi/ufs/ufshcd.h   | 7 ++++---
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index a5b71487a2065..411ef60b2c145 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -905,7 +905,8 @@ static int ufs_qcom_quirk_host_pa_saveconfigtime(struct ufs_hba *hba)
 	return err;
 }
 
-static int ufs_qcom_apply_dev_quirks(struct ufs_hba *hba)
+static int ufs_qcom_apply_dev_quirks(struct ufs_hba *hba,
+				     struct ufs_dev_desc *card)
 {
 	int err = 0;
 
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 6b5ec4bbcdb02..d9ea0ae4f374f 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6721,7 +6721,8 @@ static int ufshcd_quirk_tune_host_pa_tactivate(struct ufs_hba *hba)
 	return ret;
 }
 
-static void ufshcd_tune_unipro_params(struct ufs_hba *hba)
+static void ufshcd_tune_unipro_params(struct ufs_hba *hba,
+				      struct ufs_dev_desc *card)
 {
 	if (ufshcd_is_unipro_pa_params_tuning_req(hba)) {
 		ufshcd_tune_pa_tactivate(hba);
@@ -6735,7 +6736,7 @@ static void ufshcd_tune_unipro_params(struct ufs_hba *hba)
 	if (hba->dev_quirks & UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE)
 		ufshcd_quirk_tune_host_pa_tactivate(hba);
 
-	ufshcd_vops_apply_dev_quirks(hba);
+	ufshcd_vops_apply_dev_quirks(hba, card);
 }
 
 static void ufshcd_clear_dbg_ufs_stats(struct ufs_hba *hba)
@@ -6898,10 +6899,9 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
 	}
 
 	ufs_fixup_device_setup(hba, &card);
+	ufshcd_tune_unipro_params(hba, &card);
 	ufs_put_device_desc(&card);
 
-	ufshcd_tune_unipro_params(hba);
-
 	/* UFS device is also active now */
 	ufshcd_set_ufs_dev_active(hba);
 	ufshcd_force_reset_auto_bkops(hba);
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 089013b758a19..5260e594e0b95 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -322,7 +322,7 @@ struct ufs_hba_variant_ops {
 	void	(*setup_task_mgmt)(struct ufs_hba *, int, u8);
 	void    (*hibern8_notify)(struct ufs_hba *, enum uic_cmd_dme,
 					enum ufs_notify_change_status);
-	int	(*apply_dev_quirks)(struct ufs_hba *);
+	int	(*apply_dev_quirks)(struct ufs_hba *, struct ufs_dev_desc *);
 	int     (*suspend)(struct ufs_hba *, enum ufs_pm_op);
 	int     (*resume)(struct ufs_hba *, enum ufs_pm_op);
 	void	(*dbg_register_dump)(struct ufs_hba *hba);
@@ -1047,10 +1047,11 @@ static inline void ufshcd_vops_hibern8_notify(struct ufs_hba *hba,
 		return hba->vops->hibern8_notify(hba, cmd, status);
 }
 
-static inline int ufshcd_vops_apply_dev_quirks(struct ufs_hba *hba)
+static inline int ufshcd_vops_apply_dev_quirks(struct ufs_hba *hba,
+					       struct ufs_dev_desc *card)
 {
 	if (hba->vops && hba->vops->apply_dev_quirks)
-		return hba->vops->apply_dev_quirks(hba);
+		return hba->vops->apply_dev_quirks(hba, card);
 	return 0;
 }
 
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-02-14 16:35 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200214160149.11681-1-sashal@kernel.org>
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 009/459] soc: fsl: qe: change return type of cpm_muram_alloc() to s32 Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 013/459] crypto: testmgr - don't try to decrypt uninitialized buffers Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 015/459] media: meson: add missing allocation failure check on new_buf Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 016/459] clk: meson: g12a: fix missing uart2 in regmap table Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 017/459] clk: meson: pll: Fix by 0 division in __pll_params_to_rate() Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 037/459] media: sun4i-csi: Deal with DRAM offset Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 038/459] media: sun4i-csi: Fix data sampling polarity handling Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 040/459] media: sun4i-csi: Fix [HV]sync " Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 041/459] clk: at91: sam9x60: fix programmable clock prescaler Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 043/459] clk: meson: meson8b: make the CCF use the glitch-free mali mux Sasha Levin
2020-02-14 15:55 ` [PATCH AUTOSEL 5.4 050/459] arm64: dts: marvell: clearfog-gt-8k: fix switch cpu port node Sasha Levin
2020-02-14 15:55 ` [PATCH AUTOSEL 5.4 064/459] arm64: cpufeature: Fix the type of no FP/SIMD capability Sasha Levin
2020-02-14 15:55 ` [PATCH AUTOSEL 5.4 069/459] clocksource/drivers/bcm2835_timer: Fix memory leak of timer Sasha Levin
2020-02-14 15:55 ` [PATCH AUTOSEL 5.4 079/459] scsi: ufs: Fix ufshcd_probe_hba() reture value in case ufshcd_scsi_add_wlus() fails Sasha Levin
2020-02-14 15:55 ` [PATCH AUTOSEL 5.4 090/459] ARM: 8952/1: Disable kmemleak on XIP kernels Sasha Levin
2020-02-14 15:55 ` [PATCH AUTOSEL 5.4 097/459] drivers: watchdog: stm32_iwdg: set WDOG_HW_RUNNING at probe Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 148/459] arm64: dts: rockchip: Fix NanoPC-T4 cooling maps Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 150/459] arm64: dts: uDPU: fix broken ethernet Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 159/459] arm64: dts: allwinner: H6: Add PMU mode Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 160/459] arm64: dts: allwinner: H5: Add PMU node Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 161/459] arm: dts: allwinner: H3: " Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 163/459] ARM: dts: at91: Reenable UART TX pull-ups Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 171/459] clk: imx: Add correct failure handling for clk based helpers Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 172/459] ARM: exynos_defconfig: Bring back explicitly wanted options Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 173/459] ARM: dts: imx6: rdu2: Disable WP for USDHC2 and USDHC3 Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 174/459] ARM: dts: imx6: rdu2: Limit USBH1 to Full Speed Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 177/459] PCI: iproc: Apply quirk_paxc_bridge() for module as well as built-in Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 190/459] ARM: OMAP2+: pdata-quirks: add PRM data for reset support Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 191/459] ARM: OMAP2+: Add workaround for DRA7 DSP MStandby errata i879 Sasha Levin
2020-02-14 18:32   ` Suman Anna
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 192/459] ARM: OMAP2+: use separate IOMMU pdata to fix DRA7 IPU1 boot Sasha Levin
2020-02-14 18:33   ` Suman Anna
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 195/459] Revert "tty/serial: atmel: fix out of range clock divider handling" Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 212/459] drm/mediatek: handle events when enabling/disabling crtc Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 226/459] dmaengine: imx-sdma: Fix memory leak Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 232/459] PM / devfreq: exynos-ppmu: Fix excessive stack usage Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 237/459] reset: uniphier: Add SCSSI reset control for each channel Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 241/459] clk: sunxi-ng: add mux and pll notifiers for A64 CPU clock Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 244/459] clk: uniphier: Add SCSSI clock gate for each channel Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 261/459] ARM: dts: meson8: use the actual frequency for the GPU's 182.1MHz OPP Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 262/459] ARM: dts: meson8b: use the actual frequency for the GPU's 364MHz OPP Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 263/459] soc: fsl: qe: remove set but not used variable 'mm_gc' Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 265/459] crypto: atmel-sha - fix error handling when setting hmac key Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 267/459] ARM: dts: stm32: Add power-supply for DSI panel on stm32f469-disco Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 270/459] drm/mediatek: Add gamma property according to hardware capability Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 271/459] iommu/arm-smmu-v3: Populate VMID field for CMDQ_OP_TLBI_NH_VA Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 277/459] ARM: dts: at91: sama5d3: fix maximum peripheral clock rates Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 278/459] ARM: dts: at91: sama5d3: define clock rate range for tcb1 Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 281/459] ARM: at91: pm: use SAM9X60 PMC's compatible Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 282/459] ARM: at91: pm: use of_device_id array to find the proper shdwc node Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 288/459] arm64: dts: rockchip: fix dwmmc clock name for px30 Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 289/459] arm64: dts: rockchip: add reg property to brcmf sub-nodes Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 290/459] ARM: dts: rockchip: add reg property to brcmf sub node for rk3188-bqedison2qc Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 292/459] ASoC: atmel: fix build error with CONFIG_SND_ATMEL_SOC_DMA=m Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 299/459] misc: xilinx_sdfec: fix xsdfec_poll()'s return type Sasha Levin
2020-02-15 20:52   ` Dragan Cvetic
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 305/459] arm64: cpufeature: Set the FP/SIMD compat HWCAP bits properly Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 306/459] arm64: ptrace: nofpsimd: Fail FP/SIMD regset operations Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 317/459] perf/imx_ddr: Fix cpu hotplug state cleanup Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 322/459] iommu/arm-smmu-v3: Use WRITE_ONCE() when changing validity of an STE Sasha Levin
2020-02-14 15:59 ` Sasha Levin [this message]
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 328/459] scsi: ufs-mediatek: add apply_dev_quirks variant operation Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 334/459] arm64: lse: fix LSE atomics with LLVM's integrated assembler Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 335/459] arm64: fix alternatives " Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 342/459] arm64: dts: ti: k3-j721e-main: Add missing power-domains for smmu Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 347/459] ACPI/IORT: Fix 'Number of IDs' handling in iort_id_map() Sasha Levin
2020-02-14 16:00 ` [PATCH AUTOSEL 5.4 402/459] ARM: 8949/1: mm: mark free_memmap as __init Sasha Levin
2020-02-14 16:00 ` [PATCH AUTOSEL 5.4 403/459] ARM: 8951/1: Fix Kexec compilation issue Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200214160149.11681-327-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=stanley.chu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).