Skip to content

Commit 6764c31

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: "Six small fixes. Five are obvious and in drivers. The last one is a core fix to remove the host lock acquisition and release, caused by a dynamic check of host_busy, in the error handling loop which has been reported to cause lockups" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: storvsc: Fix ring buffer size calculation scsi: core: Move scsi_host_busy() out of host lock for waking up EH handler scsi: MAINTAINERS: Update ibmvscsi_tgt maintainer scsi: initio: Remove redundant variable 'rb' scsi: virtio_scsi: Remove duplicate check if queue is broken scsi: isci: Fix an error code problem in isci_io_request_build()
2 parents 1bbb19b + f4469f3 commit 6764c31

File tree

8 files changed

+16
-17
lines changed

8 files changed

+16
-17
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10283,7 +10283,7 @@ F: drivers/scsi/ibmvscsi/ibmvscsi*
1028310283
F: include/scsi/viosrp.h
1028410284

1028510285
IBM Power Virtual SCSI Device Target Driver
10286-
M: Michael Cyr <mikecyr@linux.ibm.com>
10286+
M: Tyrel Datwyler <tyreld@linux.ibm.com>
1028710287
1028810288
1028910289
S: Supported

drivers/scsi/initio.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ static u16 initio_se2_rd(unsigned long base, u8 addr)
371371
*/
372372
static void initio_se2_wr(unsigned long base, u8 addr, u16 val)
373373
{
374-
u8 rb;
375374
u8 instr;
376375
int i;
377376

@@ -400,7 +399,7 @@ static void initio_se2_wr(unsigned long base, u8 addr, u16 val)
400399
udelay(30);
401400
outb(SE2CS, base + TUL_NVRAM); /* -CLK */
402401
udelay(30);
403-
if ((rb = inb(base + TUL_NVRAM)) & SE2DI)
402+
if (inb(base + TUL_NVRAM) & SE2DI)
404403
break; /* write complete */
405404
}
406405
outb(0, base + TUL_NVRAM); /* -CS */

drivers/scsi/isci/request.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3387,7 +3387,7 @@ static enum sci_status isci_io_request_build(struct isci_host *ihost,
33873387
return SCI_FAILURE;
33883388
}
33893389

3390-
return SCI_SUCCESS;
3390+
return status;
33913391
}
33923392

33933393
static struct isci_request *isci_request_from_tag(struct isci_host *ihost, u16 tag)

drivers/scsi/scsi_error.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd);
6161
static enum scsi_disposition scsi_try_to_abort_cmd(const struct scsi_host_template *,
6262
struct scsi_cmnd *);
6363

64-
void scsi_eh_wakeup(struct Scsi_Host *shost)
64+
void scsi_eh_wakeup(struct Scsi_Host *shost, unsigned int busy)
6565
{
6666
lockdep_assert_held(shost->host_lock);
6767

68-
if (scsi_host_busy(shost) == shost->host_failed) {
68+
if (busy == shost->host_failed) {
6969
trace_scsi_eh_wakeup(shost);
7070
wake_up_process(shost->ehandler);
7171
SCSI_LOG_ERROR_RECOVERY(5, shost_printk(KERN_INFO, shost,
@@ -88,7 +88,7 @@ void scsi_schedule_eh(struct Scsi_Host *shost)
8888
if (scsi_host_set_state(shost, SHOST_RECOVERY) == 0 ||
8989
scsi_host_set_state(shost, SHOST_CANCEL_RECOVERY) == 0) {
9090
shost->host_eh_scheduled++;
91-
scsi_eh_wakeup(shost);
91+
scsi_eh_wakeup(shost, scsi_host_busy(shost));
9292
}
9393

9494
spin_unlock_irqrestore(shost->host_lock, flags);
@@ -286,7 +286,7 @@ static void scsi_eh_inc_host_failed(struct rcu_head *head)
286286

287287
spin_lock_irqsave(shost->host_lock, flags);
288288
shost->host_failed++;
289-
scsi_eh_wakeup(shost);
289+
scsi_eh_wakeup(shost, scsi_host_busy(shost));
290290
spin_unlock_irqrestore(shost->host_lock, flags);
291291
}
292292

drivers/scsi/scsi_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static void scsi_dec_host_busy(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
280280
if (unlikely(scsi_host_in_recovery(shost))) {
281281
spin_lock_irqsave(shost->host_lock, flags);
282282
if (shost->host_failed || shost->host_eh_scheduled)
283-
scsi_eh_wakeup(shost);
283+
scsi_eh_wakeup(shost, scsi_host_busy(shost));
284284
spin_unlock_irqrestore(shost->host_lock, flags);
285285
}
286286
rcu_read_unlock();

drivers/scsi/scsi_priv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ extern void scmd_eh_abort_handler(struct work_struct *work);
9292
extern enum blk_eh_timer_return scsi_timeout(struct request *req);
9393
extern int scsi_error_handler(void *host);
9494
extern enum scsi_disposition scsi_decide_disposition(struct scsi_cmnd *cmd);
95-
extern void scsi_eh_wakeup(struct Scsi_Host *shost);
95+
extern void scsi_eh_wakeup(struct Scsi_Host *shost, unsigned int busy);
9696
extern void scsi_eh_scmd_add(struct scsi_cmnd *);
9797
void scsi_eh_ready_devs(struct Scsi_Host *shost,
9898
struct list_head *work_q,

drivers/scsi/storvsc_drv.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ enum storvsc_request_type {
330330
*/
331331

332332
static int storvsc_ringbuffer_size = (128 * 1024);
333+
static int aligned_ringbuffer_size;
333334
static u32 max_outstanding_req_per_channel;
334335
static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth);
335336

@@ -687,8 +688,8 @@ static void handle_sc_creation(struct vmbus_channel *new_sc)
687688
new_sc->next_request_id_callback = storvsc_next_request_id;
688689

689690
ret = vmbus_open(new_sc,
690-
storvsc_ringbuffer_size,
691-
storvsc_ringbuffer_size,
691+
aligned_ringbuffer_size,
692+
aligned_ringbuffer_size,
692693
(void *)&props,
693694
sizeof(struct vmstorage_channel_properties),
694695
storvsc_on_channel_callback, new_sc);
@@ -1973,7 +1974,7 @@ static int storvsc_probe(struct hv_device *device,
19731974
dma_set_min_align_mask(&device->device, HV_HYP_PAGE_SIZE - 1);
19741975

19751976
stor_device->port_number = host->host_no;
1976-
ret = storvsc_connect_to_vsp(device, storvsc_ringbuffer_size, is_fc);
1977+
ret = storvsc_connect_to_vsp(device, aligned_ringbuffer_size, is_fc);
19771978
if (ret)
19781979
goto err_out1;
19791980

@@ -2164,7 +2165,7 @@ static int storvsc_resume(struct hv_device *hv_dev)
21642165
{
21652166
int ret;
21662167

2167-
ret = storvsc_connect_to_vsp(hv_dev, storvsc_ringbuffer_size,
2168+
ret = storvsc_connect_to_vsp(hv_dev, aligned_ringbuffer_size,
21682169
hv_dev_is_fc(hv_dev));
21692170
return ret;
21702171
}
@@ -2198,8 +2199,9 @@ static int __init storvsc_drv_init(void)
21982199
* the ring buffer indices) by the max request size (which is
21992200
* vmbus_channel_packet_multipage_buffer + struct vstor_packet + u64)
22002201
*/
2202+
aligned_ringbuffer_size = VMBUS_RING_SIZE(storvsc_ringbuffer_size);
22012203
max_outstanding_req_per_channel =
2202-
((storvsc_ringbuffer_size - PAGE_SIZE) /
2204+
((aligned_ringbuffer_size - PAGE_SIZE) /
22032205
ALIGN(MAX_MULTIPAGE_BUFFER_PACKET +
22042206
sizeof(struct vstor_packet) + sizeof(u64),
22052207
sizeof(u64)));

drivers/scsi/virtio_scsi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ static void virtscsi_vq_done(struct virtio_scsi *vscsi,
188188
while ((buf = virtqueue_get_buf(vq, &len)) != NULL)
189189
fn(vscsi, buf);
190190

191-
if (unlikely(virtqueue_is_broken(vq)))
192-
break;
193191
} while (!virtqueue_enable_cb(vq));
194192
spin_unlock_irqrestore(&virtscsi_vq->vq_lock, flags);
195193
}

0 commit comments

Comments
 (0)