Skip to content

Commit c25b24f

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley: "Final round of fixes that came in too late to send in the first request. It's nine bug fixes and one version update (because of a bug fix) and one set of PCI ID additions. There's one bug fix in the core which is really a one liner (except that an additional sdev pointer was added for convenience) and the rest are in drivers" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: target: core: Add TMF to tmr_list handling scsi: core: Kick the requeue list after inserting when flushing scsi: fnic: unlock on error path in fnic_queuecommand() scsi: fcoe: Fix unsigned comparison with zero in store_ctlr_mode() scsi: mpi3mr: Fix mpi3mr_fw.c kernel-doc warnings scsi: smartpqi: Bump driver version to 2.1.26-030 scsi: smartpqi: Fix logical volume rescan race condition scsi: smartpqi: Add new controller PCI IDs scsi: ufs: qcom: Remove unnecessary goto statement from ufs_qcom_config_esi() scsi: ufs: core: Remove the ufshcd_hba_exit() call from ufshcd_async_scan() scsi: ufs: core: Simplify power management during async scan
2 parents 1255148 + 83ab681 commit c25b24f

File tree

10 files changed

+103
-39
lines changed

10 files changed

+103
-39
lines changed

drivers/scsi/fcoe/fcoe_sysfs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ static ssize_t store_ctlr_mode(struct device *dev,
263263
const char *buf, size_t count)
264264
{
265265
struct fcoe_ctlr_device *ctlr = dev_to_ctlr(dev);
266+
int res;
266267

267268
if (count > FCOE_MAX_MODENAME_LEN)
268269
return -EINVAL;
@@ -279,12 +280,13 @@ static ssize_t store_ctlr_mode(struct device *dev,
279280
return -ENOTSUPP;
280281
}
281282

282-
ctlr->mode = sysfs_match_string(fip_conn_type_names, buf);
283-
if (ctlr->mode < 0 || ctlr->mode == FIP_CONN_TYPE_UNKNOWN) {
283+
res = sysfs_match_string(fip_conn_type_names, buf);
284+
if (res < 0 || res == FIP_CONN_TYPE_UNKNOWN) {
284285
LIBFCOE_SYSFS_DBG(ctlr, "Unknown mode %s provided.\n",
285286
buf);
286287
return -EINVAL;
287288
}
289+
ctlr->mode = res;
288290

289291
ctlr->f->set_fcoe_ctlr_mode(ctlr);
290292
LIBFCOE_SYSFS_DBG(ctlr, "Mode changed to %s.\n", buf);

drivers/scsi/fnic/fnic_scsi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
546546
if (fnic->sw_copy_wq[hwq].io_req_table[blk_mq_unique_tag_to_tag(mqtag)] != NULL) {
547547
WARN(1, "fnic<%d>: %s: hwq: %d tag 0x%x already exists\n",
548548
fnic->fnic_num, __func__, hwq, blk_mq_unique_tag_to_tag(mqtag));
549+
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
549550
return SCSI_MLQUEUE_HOST_BUSY;
550551
}
551552

drivers/scsi/mpi3mr/mpi3mr_fw.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ int mpi3mr_process_admin_reply_q(struct mpi3mr_ioc *mrioc)
475475
* @op_reply_q: op_reply_qinfo object
476476
* @reply_ci: operational reply descriptor's queue consumer index
477477
*
478-
* Returns reply descriptor frame address
478+
* Returns: reply descriptor frame address
479479
*/
480480
static inline struct mpi3_default_reply_descriptor *
481481
mpi3mr_get_reply_desc(struct op_reply_qinfo *op_reply_q, u32 reply_ci)
@@ -1063,7 +1063,6 @@ enum mpi3mr_iocstate mpi3mr_get_iocstate(struct mpi3mr_ioc *mrioc)
10631063
* @mrioc: Adapter instance reference
10641064
*
10651065
* Free the DMA memory allocated for IOCTL handling purpose.
1066-
10671066
*
10681067
* Return: None
10691068
*/
@@ -1106,7 +1105,6 @@ static void mpi3mr_free_ioctl_dma_memory(struct mpi3mr_ioc *mrioc)
11061105
/**
11071106
* mpi3mr_alloc_ioctl_dma_memory - Alloc memory for ioctl dma
11081107
* @mrioc: Adapter instance reference
1109-
11101108
*
11111109
* This function allocates dmaable memory required to handle the
11121110
* application issued MPI3 IOCTL requests.
@@ -1241,7 +1239,7 @@ static int mpi3mr_issue_and_process_mur(struct mpi3mr_ioc *mrioc,
12411239
* during reset/resume
12421240
* @mrioc: Adapter instance reference
12431241
*
1244-
* Return zero if the new IOCFacts parameters value is compatible with
1242+
* Return: zero if the new IOCFacts parameters value is compatible with
12451243
* older values else return -EPERM
12461244
*/
12471245
static int

drivers/scsi/scsi_error.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,15 +2197,18 @@ void scsi_eh_flush_done_q(struct list_head *done_q)
21972197
struct scsi_cmnd *scmd, *next;
21982198

21992199
list_for_each_entry_safe(scmd, next, done_q, eh_entry) {
2200+
struct scsi_device *sdev = scmd->device;
2201+
22002202
list_del_init(&scmd->eh_entry);
2201-
if (scsi_device_online(scmd->device) &&
2202-
!scsi_noretry_cmd(scmd) && scsi_cmd_retry_allowed(scmd) &&
2203-
scsi_eh_should_retry_cmd(scmd)) {
2203+
if (scsi_device_online(sdev) && !scsi_noretry_cmd(scmd) &&
2204+
scsi_cmd_retry_allowed(scmd) &&
2205+
scsi_eh_should_retry_cmd(scmd)) {
22042206
SCSI_LOG_ERROR_RECOVERY(3,
22052207
scmd_printk(KERN_INFO, scmd,
22062208
"%s: flush retry cmd\n",
22072209
current->comm));
22082210
scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
2211+
blk_mq_kick_requeue_list(sdev->request_queue);
22092212
} else {
22102213
/*
22112214
* If just we got sense for the device (called

drivers/scsi/smartpqi/smartpqi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,6 @@ struct pqi_ctrl_info {
13471347
bool controller_online;
13481348
bool block_requests;
13491349
bool scan_blocked;
1350-
u8 logical_volume_rescan_needed : 1;
13511350
u8 inbound_spanning_supported : 1;
13521351
u8 outbound_spanning_supported : 1;
13531352
u8 pqi_mode_enabled : 1;

drivers/scsi/smartpqi/smartpqi_init.c

Lines changed: 79 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
#define BUILD_TIMESTAMP
3434
#endif
3535

36-
#define DRIVER_VERSION "2.1.24-046"
36+
#define DRIVER_VERSION "2.1.26-030"
3737
#define DRIVER_MAJOR 2
3838
#define DRIVER_MINOR 1
39-
#define DRIVER_RELEASE 24
40-
#define DRIVER_REVISION 46
39+
#define DRIVER_RELEASE 26
40+
#define DRIVER_REVISION 30
4141

4242
#define DRIVER_NAME "Microchip SmartPQI Driver (v" \
4343
DRIVER_VERSION BUILD_TIMESTAMP ")"
@@ -2093,8 +2093,6 @@ static void pqi_scsi_update_device(struct pqi_ctrl_info *ctrl_info,
20932093
if (existing_device->devtype == TYPE_DISK) {
20942094
existing_device->raid_level = new_device->raid_level;
20952095
existing_device->volume_status = new_device->volume_status;
2096-
if (ctrl_info->logical_volume_rescan_needed)
2097-
existing_device->rescan = true;
20982096
memset(existing_device->next_bypass_group, 0, sizeof(existing_device->next_bypass_group));
20992097
if (!pqi_raid_maps_equal(existing_device->raid_map, new_device->raid_map)) {
21002098
kfree(existing_device->raid_map);
@@ -2164,6 +2162,20 @@ static inline void pqi_init_device_tmf_work(struct pqi_scsi_dev *device)
21642162
INIT_WORK(&tmf_work->work_struct, pqi_tmf_worker);
21652163
}
21662164

2165+
static inline bool pqi_volume_rescan_needed(struct pqi_scsi_dev *device)
2166+
{
2167+
if (pqi_device_in_remove(device))
2168+
return false;
2169+
2170+
if (device->sdev == NULL)
2171+
return false;
2172+
2173+
if (!scsi_device_online(device->sdev))
2174+
return false;
2175+
2176+
return device->rescan;
2177+
}
2178+
21672179
static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info,
21682180
struct pqi_scsi_dev *new_device_list[], unsigned int num_new_devices)
21692181
{
@@ -2284,9 +2296,13 @@ static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info,
22842296
if (device->sdev && device->queue_depth != device->advertised_queue_depth) {
22852297
device->advertised_queue_depth = device->queue_depth;
22862298
scsi_change_queue_depth(device->sdev, device->advertised_queue_depth);
2287-
if (device->rescan) {
2288-
scsi_rescan_device(device->sdev);
2299+
spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags);
2300+
if (pqi_volume_rescan_needed(device)) {
22892301
device->rescan = false;
2302+
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
2303+
scsi_rescan_device(device->sdev);
2304+
} else {
2305+
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
22902306
}
22912307
}
22922308
}
@@ -2308,8 +2324,6 @@ static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info,
23082324
}
23092325
}
23102326

2311-
ctrl_info->logical_volume_rescan_needed = false;
2312-
23132327
}
23142328

23152329
static inline bool pqi_is_supported_device(struct pqi_scsi_dev *device)
@@ -3702,6 +3716,21 @@ static bool pqi_ofa_process_event(struct pqi_ctrl_info *ctrl_info,
37023716
return ack_event;
37033717
}
37043718

3719+
static void pqi_mark_volumes_for_rescan(struct pqi_ctrl_info *ctrl_info)
3720+
{
3721+
unsigned long flags;
3722+
struct pqi_scsi_dev *device;
3723+
3724+
spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags);
3725+
3726+
list_for_each_entry(device, &ctrl_info->scsi_device_list, scsi_device_list_entry) {
3727+
if (pqi_is_logical_device(device) && device->devtype == TYPE_DISK)
3728+
device->rescan = true;
3729+
}
3730+
3731+
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
3732+
}
3733+
37053734
static void pqi_disable_raid_bypass(struct pqi_ctrl_info *ctrl_info)
37063735
{
37073736
unsigned long flags;
@@ -3742,7 +3771,7 @@ static void pqi_event_worker(struct work_struct *work)
37423771
ack_event = true;
37433772
rescan_needed = true;
37443773
if (event->event_type == PQI_EVENT_TYPE_LOGICAL_DEVICE)
3745-
ctrl_info->logical_volume_rescan_needed = true;
3774+
pqi_mark_volumes_for_rescan(ctrl_info);
37463775
else if (event->event_type == PQI_EVENT_TYPE_AIO_STATE_CHANGE)
37473776
pqi_disable_raid_bypass(ctrl_info);
37483777
}
@@ -10142,6 +10171,18 @@ static const struct pci_device_id pqi_pci_id_table[] = {
1014210171
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
1014310172
0x1014, 0x0718)
1014410173
},
10174+
{
10175+
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
10176+
0x1137, 0x02f8)
10177+
},
10178+
{
10179+
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
10180+
0x1137, 0x02f9)
10181+
},
10182+
{
10183+
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
10184+
0x1137, 0x02fa)
10185+
},
1014510186
{
1014610187
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
1014710188
0x1e93, 0x1000)
@@ -10198,6 +10239,34 @@ static const struct pci_device_id pqi_pci_id_table[] = {
1019810239
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
1019910240
0x1f51, 0x100a)
1020010241
},
10242+
{
10243+
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
10244+
0x1f51, 0x100e)
10245+
},
10246+
{
10247+
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
10248+
0x1f51, 0x100f)
10249+
},
10250+
{
10251+
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
10252+
0x1f51, 0x1010)
10253+
},
10254+
{
10255+
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
10256+
0x1f51, 0x1011)
10257+
},
10258+
{
10259+
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
10260+
0x1f51, 0x1043)
10261+
},
10262+
{
10263+
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
10264+
0x1f51, 0x1044)
10265+
},
10266+
{
10267+
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
10268+
0x1f51, 0x1045)
10269+
},
1020110270
{
1020210271
PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
1020310272
PCI_ANY_ID, PCI_ANY_ID)

drivers/target/target_core_device.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd)
147147
struct se_session *se_sess = se_cmd->se_sess;
148148
struct se_node_acl *nacl = se_sess->se_node_acl;
149149
struct se_tmr_req *se_tmr = se_cmd->se_tmr_req;
150-
unsigned long flags;
151150

152151
rcu_read_lock();
153152
deve = target_nacl_find_deve(nacl, se_cmd->orig_fe_lun);
@@ -178,10 +177,6 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd)
178177
se_cmd->se_dev = rcu_dereference_raw(se_lun->lun_se_dev);
179178
se_tmr->tmr_dev = rcu_dereference_raw(se_lun->lun_se_dev);
180179

181-
spin_lock_irqsave(&se_tmr->tmr_dev->se_tmr_lock, flags);
182-
list_add_tail(&se_tmr->tmr_list, &se_tmr->tmr_dev->dev_tmr_list);
183-
spin_unlock_irqrestore(&se_tmr->tmr_dev->se_tmr_lock, flags);
184-
185180
return 0;
186181
}
187182
EXPORT_SYMBOL(transport_lookup_tmr_lun);

drivers/target/target_core_transport.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3629,6 +3629,10 @@ int transport_generic_handle_tmr(
36293629
unsigned long flags;
36303630
bool aborted = false;
36313631

3632+
spin_lock_irqsave(&cmd->se_dev->se_tmr_lock, flags);
3633+
list_add_tail(&cmd->se_tmr_req->tmr_list, &cmd->se_dev->dev_tmr_list);
3634+
spin_unlock_irqrestore(&cmd->se_dev->se_tmr_lock, flags);
3635+
36323636
spin_lock_irqsave(&cmd->t_state_lock, flags);
36333637
if (cmd->transport_state & CMD_T_ABORTED) {
36343638
aborted = true;

drivers/ufs/core/ufshcd.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8725,7 +8725,6 @@ static int ufshcd_add_lus(struct ufs_hba *hba)
87258725

87268726
ufs_bsg_probe(hba);
87278727
scsi_scan_host(hba->host);
8728-
pm_runtime_put_sync(hba->dev);
87298728

87308729
out:
87318730
return ret;
@@ -8994,15 +8993,12 @@ static void ufshcd_async_scan(void *data, async_cookie_t cookie)
89948993

89958994
/* Probe and add UFS logical units */
89968995
ret = ufshcd_add_lus(hba);
8996+
89978997
out:
8998-
/*
8999-
* If we failed to initialize the device or the device is not
9000-
* present, turn off the power/clocks etc.
9001-
*/
9002-
if (ret) {
9003-
pm_runtime_put_sync(hba->dev);
9004-
ufshcd_hba_exit(hba);
9005-
}
8998+
pm_runtime_put_sync(hba->dev);
8999+
9000+
if (ret)
9001+
dev_err(hba->dev, "%s failed: %d\n", __func__, ret);
90069002
}
90079003

90089004
static enum scsi_timeout_action ufshcd_eh_timed_out(struct scsi_cmnd *scmd)

drivers/ufs/host/ufs-qcom.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
17161716
ufs_qcom_write_msi_msg);
17171717
if (ret) {
17181718
dev_err(hba->dev, "Failed to request Platform MSI %d\n", ret);
1719-
goto out;
1719+
return ret;
17201720
}
17211721

17221722
msi_lock_descs(hba->dev);
@@ -1750,11 +1750,8 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
17501750
FIELD_PREP(ESI_VEC_MASK, MAX_ESI_VEC - 1),
17511751
REG_UFS_CFG3);
17521752
ufshcd_mcq_enable_esi(hba);
1753-
}
1754-
1755-
out:
1756-
if (!ret)
17571753
host->esi_enabled = true;
1754+
}
17581755

17591756
return ret;
17601757
}

0 commit comments

Comments
 (0)