Commit fffb08b3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes from James Bottomley:
 "Two small fixes, both in drivers: ipr and ufs"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: ipr: Fix softlockup when rescanning devices in petitboot
  scsi: ufs: Fix possible unclocked access to auto hibern8 timer register
parents b0ea262a 394b6171
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -9950,6 +9950,7 @@ static void ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
	ioa_cfg->max_devs_supported = ipr_max_devs;

	if (ioa_cfg->sis64) {
		host->max_channel = IPR_MAX_SIS64_BUSES;
		host->max_id = IPR_MAX_SIS64_TARGETS_PER_BUS;
		host->max_lun = IPR_MAX_SIS64_LUNS_PER_TARGET;
		if (ipr_max_devs > IPR_MAX_SIS64_DEVS)
@@ -9958,6 +9959,7 @@ static void ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
					   + ((sizeof(struct ipr_config_table_entry64)
					       * ioa_cfg->max_devs_supported)));
	} else {
		host->max_channel = IPR_VSET_BUS;
		host->max_id = IPR_MAX_NUM_TARGETS_PER_BUS;
		host->max_lun = IPR_MAX_NUM_LUNS_PER_TARGET;
		if (ipr_max_devs > IPR_MAX_PHYSICAL_DEVS)
@@ -9967,7 +9969,6 @@ static void ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
					       * ioa_cfg->max_devs_supported)));
	}

	host->max_channel = IPR_VSET_BUS;
	host->unique_id = host->host_no;
	host->max_cmd_len = IPR_MAX_CDB_LEN;
	host->can_queue = ioa_cfg->max_cmds;
+1 −0
Original line number Diff line number Diff line
@@ -1300,6 +1300,7 @@ struct ipr_resource_entry {
#define IPR_ARRAY_VIRTUAL_BUS			0x1
#define IPR_VSET_VIRTUAL_BUS			0x2
#define IPR_IOAFP_VIRTUAL_BUS			0x3
#define IPR_MAX_SIS64_BUSES			0x4

#define IPR_GET_RES_PHYS_LOC(res) \
	(((res)->bus << 24) | ((res)->target << 8) | (res)->lun)
+14 −7
Original line number Diff line number Diff line
@@ -3884,18 +3884,25 @@ EXPORT_SYMBOL_GPL(ufshcd_uic_hibern8_exit);
void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
{
	unsigned long flags;
	bool update = false;

	if (!(hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT))
	if (!ufshcd_is_auto_hibern8_supported(hba))
		return;

	spin_lock_irqsave(hba->host->host_lock, flags);
	if (hba->ahit == ahit)
		goto out_unlock;
	if (hba->ahit != ahit) {
		hba->ahit = ahit;
	if (!pm_runtime_suspended(hba->dev))
		ufshcd_writel(hba, hba->ahit, REG_AUTO_HIBERNATE_IDLE_TIMER);
out_unlock:
		update = true;
	}
	spin_unlock_irqrestore(hba->host->host_lock, flags);

	if (update && !pm_runtime_suspended(hba->dev)) {
		pm_runtime_get_sync(hba->dev);
		ufshcd_hold(hba, false);
		ufshcd_auto_hibern8_enable(hba);
		ufshcd_release(hba);
		pm_runtime_put(hba->dev);
	}
}
EXPORT_SYMBOL_GPL(ufshcd_auto_hibern8_update);