Skip to content

Commit a79d5c7

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Four small fixes, all in drivers. They're all one or two lines except for the ufs one, but that's a simple revert of a previous feature" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: iscsi_tcp: Check that sock is valid before iscsi_set_param() scsi: qla2xxx: Fix memory leak in qla2x00_probe_one() scsi: mpi3mr: Handle soft reset in progress fault code (0xF002) scsi: Revert "scsi: ufs: core: Initialize devfreq synchronously"
2 parents da0af3c + 48b19b7 commit a79d5c7

File tree

5 files changed

+19
-35
lines changed

5 files changed

+19
-35
lines changed

drivers/scsi/iscsi_tcp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,13 +771,12 @@ static int iscsi_sw_tcp_conn_set_param(struct iscsi_cls_conn *cls_conn,
771771
iscsi_set_param(cls_conn, param, buf, buflen);
772772
break;
773773
case ISCSI_PARAM_DATADGST_EN:
774-
iscsi_set_param(cls_conn, param, buf, buflen);
775-
776774
mutex_lock(&tcp_sw_conn->sock_lock);
777775
if (!tcp_sw_conn->sock) {
778776
mutex_unlock(&tcp_sw_conn->sock_lock);
779777
return -ENOTCONN;
780778
}
779+
iscsi_set_param(cls_conn, param, buf, buflen);
781780
tcp_sw_conn->sendpage = conn->datadgst_en ?
782781
sock_no_sendpage : tcp_sw_conn->sock->ops->sendpage;
783782
mutex_unlock(&tcp_sw_conn->sock_lock);

drivers/scsi/mpi3mr/mpi3mr_fw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,7 @@ static void mpi3mr_watchdog_work(struct work_struct *work)
25262526
mrioc->unrecoverable = 1;
25272527
goto schedule_work;
25282528
case MPI3_SYSIF_FAULT_CODE_SOFT_RESET_IN_PROGRESS:
2529-
return;
2529+
goto schedule_work;
25302530
case MPI3_SYSIF_FAULT_CODE_CI_ACTIVATION_RESET:
25312531
reset_reason = MPI3MR_RESET_FROM_CIACTIV_FAULT;
25322532
break;

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3617,6 +3617,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
36173617
probe_failed:
36183618
qla_enode_stop(base_vha);
36193619
qla_edb_stop(base_vha);
3620+
vfree(base_vha->scan.l);
36203621
if (base_vha->gnl.l) {
36213622
dma_free_coherent(&ha->pdev->dev, base_vha->gnl.size,
36223623
base_vha->gnl.l, base_vha->gnl.ldma);

drivers/ufs/core/ufshcd.c

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,13 +1409,6 @@ static int ufshcd_devfreq_target(struct device *dev,
14091409
struct ufs_clk_info *clki;
14101410
unsigned long irq_flags;
14111411

1412-
/*
1413-
* Skip devfreq if UFS initialization is not finished.
1414-
* Otherwise ufs could be in a inconsistent state.
1415-
*/
1416-
if (!smp_load_acquire(&hba->logical_unit_scan_finished))
1417-
return 0;
1418-
14191412
if (!ufshcd_is_clkscaling_supported(hba))
14201413
return -EINVAL;
14211414

@@ -8399,6 +8392,22 @@ static int ufshcd_add_lus(struct ufs_hba *hba)
83998392
if (ret)
84008393
goto out;
84018394

8395+
/* Initialize devfreq after UFS device is detected */
8396+
if (ufshcd_is_clkscaling_supported(hba)) {
8397+
memcpy(&hba->clk_scaling.saved_pwr_info.info,
8398+
&hba->pwr_info,
8399+
sizeof(struct ufs_pa_layer_attr));
8400+
hba->clk_scaling.saved_pwr_info.is_valid = true;
8401+
hba->clk_scaling.is_allowed = true;
8402+
8403+
ret = ufshcd_devfreq_init(hba);
8404+
if (ret)
8405+
goto out;
8406+
8407+
hba->clk_scaling.is_enabled = true;
8408+
ufshcd_init_clk_scaling_sysfs(hba);
8409+
}
8410+
84028411
ufs_bsg_probe(hba);
84038412
ufshpb_init(hba);
84048413
scsi_scan_host(hba->host);
@@ -8670,12 +8679,6 @@ static void ufshcd_async_scan(void *data, async_cookie_t cookie)
86708679
if (ret) {
86718680
pm_runtime_put_sync(hba->dev);
86728681
ufshcd_hba_exit(hba);
8673-
} else {
8674-
/*
8675-
* Make sure that when reader code sees UFS initialization has finished,
8676-
* all initialization steps have really been executed.
8677-
*/
8678-
smp_store_release(&hba->logical_unit_scan_finished, true);
86798682
}
86808683
}
86818684

@@ -10316,30 +10319,12 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
1031610319
*/
1031710320
ufshcd_set_ufs_dev_active(hba);
1031810321

10319-
/* Initialize devfreq */
10320-
if (ufshcd_is_clkscaling_supported(hba)) {
10321-
memcpy(&hba->clk_scaling.saved_pwr_info.info,
10322-
&hba->pwr_info,
10323-
sizeof(struct ufs_pa_layer_attr));
10324-
hba->clk_scaling.saved_pwr_info.is_valid = true;
10325-
hba->clk_scaling.is_allowed = true;
10326-
10327-
err = ufshcd_devfreq_init(hba);
10328-
if (err)
10329-
goto rpm_put_sync;
10330-
10331-
hba->clk_scaling.is_enabled = true;
10332-
ufshcd_init_clk_scaling_sysfs(hba);
10333-
}
10334-
1033510322
async_schedule(ufshcd_async_scan, hba);
1033610323
ufs_sysfs_add_nodes(hba->dev);
1033710324

1033810325
device_enable_async_suspend(dev);
1033910326
return 0;
1034010327

10341-
rpm_put_sync:
10342-
pm_runtime_put_sync(dev);
1034310328
free_tmf_queue:
1034410329
blk_mq_destroy_queue(hba->tmf_queue);
1034510330
blk_put_queue(hba->tmf_queue);

include/ufs/ufshcd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,6 @@ struct ufs_hba {
979979
struct completion *uic_async_done;
980980

981981
enum ufshcd_state ufshcd_state;
982-
bool logical_unit_scan_finished;
983982
u32 eh_flags;
984983
u32 intr_mask;
985984
u16 ee_ctrl_mask;

0 commit comments

Comments
 (0)