scsi: ufshcd: Move to ufshcd core

Hereon use upstream ufshcd core.

Change-Id: I814921a5a30f27cf6911e9a99c952790888f7e56
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
This commit is contained in:
Asutosh Das 2020-04-15 14:26:01 -07:00
commit 5dcd3204a9
6 changed files with 9 additions and 43 deletions

View file

@ -54,7 +54,7 @@ CONFIG_I2C_RTC6226_QCA=m
CONFIG_SCSI_UFSHCD_QTI=y
CONFIG_SCSI_UFS_BSG=y
CONFIG_MSM_EXT_DISPLAY=y
# CONFIG_SCSI_UFSHCD is not set
CONFIG_SCSI_UFSHCD=y
# CONFIG_RADIO_SI470X is not set
# CONFIG_RADIO_SI4713 is not set
# CONFIG_USB_MR800 is not set

View file

@ -52,7 +52,7 @@ config SCSI_UFSHCD
config SCSI_UFSHCD_QTI
tristate "Universal Flash Storage Controller Driver Core QTI"
depends on SCSI && SCSI_DMA && QGKI && !SCSI_UFSHCD
depends on SCSI && SCSI_DMA && QGKI && SCSI_UFSHCD
select PM_DEVFREQ
select DEVFREQ_GOV_SIMPLE_ONDEMAND
select NLS
@ -171,7 +171,7 @@ config SCSI_UFS_BSG
config SCSI_UFS_CRYPTO
bool "UFS Crypto Engine Support"
depends on (SCSI_UFSHCD || SCSI_UFSHCD_QTI) && BLK_INLINE_ENCRYPTION
depends on SCSI_UFSHCD && BLK_INLINE_ENCRYPTION
help
Enable Crypto Engine Support in UFS.
Enabling this makes it possible for the kernel to use the crypto

View file

@ -11,9 +11,5 @@ obj-$(CONFIG_SCSI_UFSHCD_PCI) += ufshcd-pci.o
obj-$(CONFIG_SCSI_UFSHCD_PLATFORM) += ufshcd-pltfrm.o
obj-$(CONFIG_SCSI_UFS_HISI) += ufs-hisi.o
obj-$(CONFIG_SCSI_UFS_MEDIATEK) += ufs-mediatek.o
obj-$(CONFIG_SCSI_UFSHCD_QTI) += ufshcd-qti-core.o
ufshcd-qti-core-y += ufshcd-qti.o ufs-sysfs.o
ufshcd-qti-core-$(CONFIG_SCSI_UFS_BSG) += ufs_bsg.o
ufshcd-core-$(CONFIG_SCSI_UFS_CRYPTO) += ufshcd-crypto.o
ufshcd-qti-core-$(CONFIG_SCSI_UFS_CRYPTO) += ufshcd-crypto.o
obj-$(CONFIG_SCSI_UFS_CRYPTO_QTI) += ufshcd-crypto-qti.o

View file

@ -8214,7 +8214,8 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
int ret;
ktime_t start = ktime_get();
dev_err(hba->dev, "*** This is %s ***\n", __FILE__);
dev_err(hba->dev, "Using %s: Move to upstream ufs core --\n", __FILE__);
return -EPERM;
ret = ufshcd_link_startup(hba);
if (ret)

View file

@ -7219,6 +7219,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool async)
int ret;
ktime_t start = ktime_get();
dev_err(hba->dev, "*** This is %s ***\n", __FILE__);
ret = ufshcd_link_startup(hba);
if (ret)
goto out;

View file

@ -432,14 +432,13 @@ enum clk_gating_state {
struct ufs_clk_gating {
#ifdef CONFIG_SCSI_UFSHCD_QTI
struct hrtimer gate_hrtimer;
struct work_struct gate_work;
unsigned long delay_ms_pwr_save;
unsigned long delay_ms_perf;
struct device_attribute delay_pwr_save_attr;
struct device_attribute delay_perf_attr;
#else
struct delayed_work gate_work;
#endif
struct delayed_work gate_work;
struct work_struct ungate_work;
enum clk_gating_state state;
unsigned long delay_ms;
@ -513,19 +512,6 @@ struct ufshcd_cmd_log {
u32 seq_num;
};
#define UIC_ERR_REG_HIST_LENGTH 20
/**
* struct ufs_uic_err_reg_hist - keeps history of uic errors
* @pos: index to indicate cyclic buffer position
* @reg: cyclic buffer for registers value
* @tstamp: cyclic buffer for time stamp
*/
struct ufs_uic_err_reg_hist {
int pos;
u32 reg[UIC_ERR_REG_HIST_LENGTH];
ktime_t tstamp[UIC_ERR_REG_HIST_LENGTH];
};
/* UFS Host Controller debug print bitmask */
#define UFSHCD_DBG_PRINT_CLK_FREQ_EN UFS_BIT(0)
#define UFSHCD_DBG_PRINT_UIC_ERR_HIST_EN UFS_BIT(1)
@ -647,21 +633,15 @@ struct ufs_stats {
u32 power_mode_change_cnt;
struct ufshcd_clk_ctx clk_hold;
struct ufshcd_clk_ctx clk_rel;
struct ufs_uic_err_reg_hist pa_err;
struct ufs_uic_err_reg_hist dl_err;
struct ufs_uic_err_reg_hist nl_err;
struct ufs_uic_err_reg_hist tl_err;
struct ufs_uic_err_reg_hist dme_err;
u32 last_intr_status;
ktime_t last_intr_ts;
#else
#endif
/* uic specific errors */
struct ufs_err_reg_hist pa_err;
struct ufs_err_reg_hist dl_err;
struct ufs_err_reg_hist nl_err;
struct ufs_err_reg_hist tl_err;
struct ufs_err_reg_hist dme_err;
#endif
/* fatal errors */
struct ufs_err_reg_hist auto_hibern8_err;
@ -1246,18 +1226,6 @@ void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit);
int ufshcd_hold(struct ufs_hba *hba, bool async);
void ufshcd_release(struct ufs_hba *hba);
#ifdef CONFIG_SCSI_UFSHCD_QTI
void ufshcd_scsi_block_requests(struct ufs_hba *hba);
void ufshcd_scsi_unblock_requests(struct ufs_hba *hba);
int ufshcd_wait_for_doorbell_clr(struct ufs_hba *hba, u64 wait_timeout_us);
int ufshcd_change_power_mode(struct ufs_hba *hba,
struct ufs_pa_layer_attr *pwr_mode);
extern void ufshcd_apply_pm_quirks(struct ufs_hba *hba);
extern int ufshcd_scale_clks(struct ufs_hba *hba, bool scale_up);
extern int ufshcd_read_device_desc(struct ufs_hba *hba, u8 *buf, u32 size);
#endif
int ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
int *desc_length);