Skip to content

Commit bb19237

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: "Thirty-three fixes, I'm afraid. Essentially the build up from the last couple of weeks while I've been dealling with Linux Plumbers conference infrastructure issues. It's mostly the usual assortment of spelling fixes and minor corrections. The only core relevant changes are to the sd driver to reduce the spin up message spew and fix a small memory leak on the freeing path" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (33 commits) scsi: ses: Retry failed Send/Receive Diagnostic commands scsi: target: Fix spelling mistake "CONFLIFT" -> "CONFLICT" scsi: lpfc: Fix gcc -Wstringop-overread warning, again scsi: lpfc: Use correct scnprintf() limit scsi: lpfc: Fix sprintf() overflow in lpfc_display_fpin_wwpn() scsi: core: Remove 'current_tag' scsi: acornscsi: Remove tagged queuing vestiges scsi: fas216: Kill scmd->tag scsi: qla2xxx: Restore initiator in dual mode scsi: ufs: core: Unbreak the reset handler scsi: sd_zbc: Support disks with more than 2**32 logical blocks scsi: ufs: core: Revert "scsi: ufs: Synchronize SCSI and UFS error handling" scsi: bsg: Fix device unregistration scsi: sd: Make sd_spinup_disk() less noisy scsi: ufs: ufs-pci: Fix Intel LKF link stability scsi: mpt3sas: Clean up some inconsistent indenting scsi: megaraid: Clean up some inconsistent indenting scsi: sr: Fix spelling mistake "does'nt" -> "doesn't" scsi: Remove SCSI CDROM MAINTAINERS entry scsi: megaraid: Fix Coccinelle warning ...
2 parents f6f360a + fbdac19 commit bb19237

35 files changed

+288
-300
lines changed

MAINTAINERS

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16650,13 +16650,6 @@ M: Lubomir Rintel <[email protected]>
1665016650
S: Supported
1665116651
F: drivers/char/pcmcia/scr24x_cs.c
1665216652

16653-
SCSI CDROM DRIVER
16654-
M: Jens Axboe <[email protected]>
16655-
16656-
S: Maintained
16657-
W: http://www.kernel.dk
16658-
F: drivers/scsi/sr*
16659-
1666016653
SCSI RDMA PROTOCOL (SRP) INITIATOR
1666116654
M: Bart Van Assche <[email protected]>
1666216655

block/bsg.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,20 @@ static const struct file_operations bsg_fops = {
165165
.llseek = default_llseek,
166166
};
167167

168+
static void bsg_device_release(struct device *dev)
169+
{
170+
struct bsg_device *bd = container_of(dev, struct bsg_device, device);
171+
172+
ida_simple_remove(&bsg_minor_ida, MINOR(bd->device.devt));
173+
kfree(bd);
174+
}
175+
168176
void bsg_unregister_queue(struct bsg_device *bd)
169177
{
170178
if (bd->queue->kobj.sd)
171179
sysfs_remove_link(&bd->queue->kobj, "bsg");
172180
cdev_device_del(&bd->cdev, &bd->device);
173-
ida_simple_remove(&bsg_minor_ida, MINOR(bd->device.devt));
174-
kfree(bd);
181+
put_device(&bd->device);
175182
}
176183
EXPORT_SYMBOL_GPL(bsg_unregister_queue);
177184

@@ -193,19 +200,21 @@ struct bsg_device *bsg_register_queue(struct request_queue *q,
193200
if (ret < 0) {
194201
if (ret == -ENOSPC)
195202
dev_err(parent, "bsg: too many bsg devices\n");
196-
goto out_kfree;
203+
kfree(bd);
204+
return ERR_PTR(ret);
197205
}
198206
bd->device.devt = MKDEV(bsg_major, ret);
199207
bd->device.class = bsg_class;
200208
bd->device.parent = parent;
209+
bd->device.release = bsg_device_release;
201210
dev_set_name(&bd->device, "%s", name);
202211
device_initialize(&bd->device);
203212

204213
cdev_init(&bd->cdev, &bsg_fops);
205214
bd->cdev.owner = THIS_MODULE;
206215
ret = cdev_device_add(&bd->cdev, &bd->device);
207216
if (ret)
208-
goto out_ida_remove;
217+
goto out_put_device;
209218

210219
if (q->kobj.sd) {
211220
ret = sysfs_create_link(&q->kobj, &bd->device.kobj, "bsg");
@@ -217,10 +226,8 @@ struct bsg_device *bsg_register_queue(struct request_queue *q,
217226

218227
out_device_del:
219228
cdev_device_del(&bd->cdev, &bd->device);
220-
out_ida_remove:
221-
ida_simple_remove(&bsg_minor_ida, MINOR(bd->device.devt));
222-
out_kfree:
223-
kfree(bd);
229+
out_put_device:
230+
put_device(&bd->device);
224231
return ERR_PTR(ret);
225232
}
226233
EXPORT_SYMBOL_GPL(bsg_register_queue);

drivers/scsi/arm/Kconfig

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ config SCSI_ACORNSCSI_3
1010
This enables support for the Acorn SCSI card (aka30). If you have an
1111
Acorn system with one of these, say Y. If unsure, say N.
1212

13-
config SCSI_ACORNSCSI_TAGGED_QUEUE
14-
bool "Support SCSI 2 Tagged queueing"
15-
depends on SCSI_ACORNSCSI_3
16-
help
17-
Say Y here to enable tagged queuing support on the Acorn SCSI card.
18-
19-
This is a feature of SCSI-2 which improves performance: the host
20-
adapter can send several SCSI commands to a device's queue even if
21-
previous commands haven't finished yet. Some SCSI devices don't
22-
implement this properly, so the safe answer is N.
23-
2413
config SCSI_ACORNSCSI_SYNC
2514
bool "Support SCSI 2 Synchronous Transfers"
2615
depends on SCSI_ACORNSCSI_3

drivers/scsi/arm/acornscsi.c

Lines changed: 22 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,8 @@
5252
* You can tell if you have a device that supports tagged queueing my
5353
* cating (eg) /proc/scsi/acornscsi/0 and see if the SCSI revision is reported
5454
* as '2 TAG'.
55-
*
56-
* Also note that CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE is normally set in the config
57-
* scripts, but disabled here. Once debugged, remove the #undef, otherwise to debug,
58-
* comment out the undef.
5955
*/
60-
#undef CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE
56+
6157
/*
6258
* SCSI-II Synchronous transfer support.
6359
*
@@ -171,7 +167,7 @@ static void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp,
171167
unsigned int result);
172168
static int acornscsi_reconnect_finish(AS_Host *host);
173169
static void acornscsi_dma_cleanup(AS_Host *host);
174-
static void acornscsi_abortcmd(AS_Host *host, unsigned char tag);
170+
static void acornscsi_abortcmd(AS_Host *host);
175171

176172
/* ====================================================================================
177173
* Miscellaneous
@@ -741,17 +737,6 @@ intr_ret_t acornscsi_kick(AS_Host *host)
741737
#endif
742738

743739
if (from_queue) {
744-
#ifdef CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE
745-
/*
746-
* tagged queueing - allocate a new tag to this command
747-
*/
748-
if (SCpnt->device->simple_tags) {
749-
SCpnt->device->current_tag += 1;
750-
if (SCpnt->device->current_tag == 0)
751-
SCpnt->device->current_tag = 1;
752-
SCpnt->tag = SCpnt->device->current_tag;
753-
} else
754-
#endif
755740
set_bit(SCpnt->device->id * 8 +
756741
(u8)(SCpnt->device->lun & 0x07), host->busyluns);
757742

@@ -1192,7 +1177,7 @@ void acornscsi_dma_intr(AS_Host *host)
11921177
* the device recognises the attention.
11931178
*/
11941179
if (dmac_read(host, DMAC_STATUS) & STATUS_RQ0) {
1195-
acornscsi_abortcmd(host, host->SCpnt->tag);
1180+
acornscsi_abortcmd(host);
11961181

11971182
dmac_write(host, DMAC_TXCNTLO, 0);
11981183
dmac_write(host, DMAC_TXCNTHI, 0);
@@ -1560,23 +1545,6 @@ void acornscsi_message(AS_Host *host)
15601545
acornscsi_sbic_issuecmd(host, CMND_ASSERTATN);
15611546

15621547
switch (host->scsi.last_message) {
1563-
#ifdef CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE
1564-
case HEAD_OF_QUEUE_TAG:
1565-
case ORDERED_QUEUE_TAG:
1566-
case SIMPLE_QUEUE_TAG:
1567-
/*
1568-
* ANSI standard says: (Section SCSI-2 Rev. 10c Sect 5.6.17)
1569-
* If a target does not implement tagged queuing and a queue tag
1570-
* message is received, it shall respond with a MESSAGE REJECT
1571-
* message and accept the I/O process as if it were untagged.
1572-
*/
1573-
printk(KERN_NOTICE "scsi%d.%c: disabling tagged queueing\n",
1574-
host->host->host_no, acornscsi_target(host));
1575-
host->SCpnt->device->simple_tags = 0;
1576-
set_bit(host->SCpnt->device->id * 8 +
1577-
(u8)(host->SCpnt->device->lun & 0x7), host->busyluns);
1578-
break;
1579-
#endif
15801548
case EXTENDED_MESSAGE | (EXTENDED_SDTR << 8):
15811549
/*
15821550
* Target can't handle synchronous transfers
@@ -1687,24 +1655,11 @@ void acornscsi_buildmessages(AS_Host *host)
16871655
#if 0
16881656
/* does the device need the current command aborted */
16891657
if (cmd_aborted) {
1690-
acornscsi_abortcmd(host->SCpnt->tag);
1658+
acornscsi_abortcmd(host);
16911659
return;
16921660
}
16931661
#endif
16941662

1695-
#ifdef CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE
1696-
if (host->SCpnt->tag) {
1697-
unsigned int tag_type;
1698-
1699-
if (host->SCpnt->cmnd[0] == REQUEST_SENSE ||
1700-
host->SCpnt->cmnd[0] == TEST_UNIT_READY ||
1701-
host->SCpnt->cmnd[0] == INQUIRY)
1702-
tag_type = HEAD_OF_QUEUE_TAG;
1703-
else
1704-
tag_type = SIMPLE_QUEUE_TAG;
1705-
msgqueue_addmsg(&host->scsi.msgs, 2, tag_type, host->SCpnt->tag);
1706-
}
1707-
#endif
17081663

17091664
#ifdef CONFIG_SCSI_ACORNSCSI_SYNC
17101665
if (host->device[host->SCpnt->device->id].sync_state == SYNC_NEGOCIATE) {
@@ -1798,7 +1753,7 @@ int acornscsi_reconnect(AS_Host *host)
17981753
"to reconnect with\n",
17991754
host->host->host_no, '0' + target);
18001755
acornscsi_dumplog(host, target);
1801-
acornscsi_abortcmd(host, 0);
1756+
acornscsi_abortcmd(host);
18021757
if (host->SCpnt) {
18031758
queue_add_cmd_tail(&host->queues.disconnected, host->SCpnt);
18041759
host->SCpnt = NULL;
@@ -1821,7 +1776,7 @@ int acornscsi_reconnect_finish(AS_Host *host)
18211776
host->scsi.disconnectable = 0;
18221777
if (host->SCpnt->device->id == host->scsi.reconnected.target &&
18231778
host->SCpnt->device->lun == host->scsi.reconnected.lun &&
1824-
host->SCpnt->tag == host->scsi.reconnected.tag) {
1779+
scsi_cmd_to_tag(host->SCpnt) == host->scsi.reconnected.tag) {
18251780
#if (DEBUG & (DEBUG_QUEUES|DEBUG_DISCON))
18261781
DBG(host->SCpnt, printk("scsi%d.%c: reconnected",
18271782
host->host->host_no, acornscsi_target(host)));
@@ -1848,7 +1803,7 @@ int acornscsi_reconnect_finish(AS_Host *host)
18481803
}
18491804

18501805
if (!host->SCpnt)
1851-
acornscsi_abortcmd(host, host->scsi.reconnected.tag);
1806+
acornscsi_abortcmd(host);
18521807
else {
18531808
/*
18541809
* Restore data pointer from SAVED pointers.
@@ -1889,21 +1844,15 @@ void acornscsi_disconnect_unexpected(AS_Host *host)
18891844
* Function: void acornscsi_abortcmd(AS_host *host, unsigned char tag)
18901845
* Purpose : abort a currently executing command
18911846
* Params : host - host with connected command to abort
1892-
* tag - tag to abort
18931847
*/
18941848
static
1895-
void acornscsi_abortcmd(AS_Host *host, unsigned char tag)
1849+
void acornscsi_abortcmd(AS_Host *host)
18961850
{
18971851
host->scsi.phase = PHASE_ABORTED;
18981852
sbic_arm_write(host, SBIC_CMND, CMND_ASSERTATN);
18991853

19001854
msgqueue_flush(&host->scsi.msgs);
1901-
#ifdef CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE
1902-
if (tag)
1903-
msgqueue_addmsg(&host->scsi.msgs, 2, ABORT_TAG, tag);
1904-
else
1905-
#endif
1906-
msgqueue_addmsg(&host->scsi.msgs, 1, ABORT);
1855+
msgqueue_addmsg(&host->scsi.msgs, 1, ABORT);
19071856
}
19081857

19091858
/* ==========================================================================================
@@ -1993,7 +1942,7 @@ intr_ret_t acornscsi_sbicintr(AS_Host *host, int in_irq)
19931942
printk(KERN_ERR "scsi%d.%c: PHASE_CONNECTING, SSR %02X?\n",
19941943
host->host->host_no, acornscsi_target(host), ssr);
19951944
acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8);
1996-
acornscsi_abortcmd(host, host->SCpnt->tag);
1945+
acornscsi_abortcmd(host);
19971946
}
19981947
return INTR_PROCESSING;
19991948

@@ -2029,7 +1978,7 @@ intr_ret_t acornscsi_sbicintr(AS_Host *host, int in_irq)
20291978
printk(KERN_ERR "scsi%d.%c: PHASE_CONNECTED, SSR %02X?\n",
20301979
host->host->host_no, acornscsi_target(host), ssr);
20311980
acornscsi_dumplog(host, host->SCpnt ? host->SCpnt->device->id : 8);
2032-
acornscsi_abortcmd(host, host->SCpnt->tag);
1981+
acornscsi_abortcmd(host);
20331982
}
20341983
return INTR_PROCESSING;
20351984

@@ -2075,20 +2024,20 @@ intr_ret_t acornscsi_sbicintr(AS_Host *host, int in_irq)
20752024
case 0x18: /* -> PHASE_DATAOUT */
20762025
/* COMMAND -> DATA OUT */
20772026
if (host->scsi.SCp.sent_command != host->SCpnt->cmd_len)
2078-
acornscsi_abortcmd(host, host->SCpnt->tag);
2027+
acornscsi_abortcmd(host);
20792028
acornscsi_dma_setup(host, DMA_OUT);
20802029
if (!acornscsi_starttransfer(host))
2081-
acornscsi_abortcmd(host, host->SCpnt->tag);
2030+
acornscsi_abortcmd(host);
20822031
host->scsi.phase = PHASE_DATAOUT;
20832032
return INTR_IDLE;
20842033

20852034
case 0x19: /* -> PHASE_DATAIN */
20862035
/* COMMAND -> DATA IN */
20872036
if (host->scsi.SCp.sent_command != host->SCpnt->cmd_len)
2088-
acornscsi_abortcmd(host, host->SCpnt->tag);
2037+
acornscsi_abortcmd(host);
20892038
acornscsi_dma_setup(host, DMA_IN);
20902039
if (!acornscsi_starttransfer(host))
2091-
acornscsi_abortcmd(host, host->SCpnt->tag);
2040+
acornscsi_abortcmd(host);
20922041
host->scsi.phase = PHASE_DATAIN;
20932042
return INTR_IDLE;
20942043

@@ -2156,7 +2105,7 @@ intr_ret_t acornscsi_sbicintr(AS_Host *host, int in_irq)
21562105
/* MESSAGE IN -> DATA OUT */
21572106
acornscsi_dma_setup(host, DMA_OUT);
21582107
if (!acornscsi_starttransfer(host))
2159-
acornscsi_abortcmd(host, host->SCpnt->tag);
2108+
acornscsi_abortcmd(host);
21602109
host->scsi.phase = PHASE_DATAOUT;
21612110
return INTR_IDLE;
21622111

@@ -2165,7 +2114,7 @@ intr_ret_t acornscsi_sbicintr(AS_Host *host, int in_irq)
21652114
/* MESSAGE IN -> DATA IN */
21662115
acornscsi_dma_setup(host, DMA_IN);
21672116
if (!acornscsi_starttransfer(host))
2168-
acornscsi_abortcmd(host, host->SCpnt->tag);
2117+
acornscsi_abortcmd(host);
21692118
host->scsi.phase = PHASE_DATAIN;
21702119
return INTR_IDLE;
21712120

@@ -2206,7 +2155,7 @@ intr_ret_t acornscsi_sbicintr(AS_Host *host, int in_irq)
22062155
switch (ssr) {
22072156
case 0x19: /* -> PHASE_DATAIN */
22082157
case 0x89: /* -> PHASE_DATAIN */
2209-
acornscsi_abortcmd(host, host->SCpnt->tag);
2158+
acornscsi_abortcmd(host);
22102159
return INTR_IDLE;
22112160

22122161
case 0x1b: /* -> PHASE_STATUSIN */
@@ -2255,7 +2204,7 @@ intr_ret_t acornscsi_sbicintr(AS_Host *host, int in_irq)
22552204
switch (ssr) {
22562205
case 0x18: /* -> PHASE_DATAOUT */
22572206
case 0x88: /* -> PHASE_DATAOUT */
2258-
acornscsi_abortcmd(host, host->SCpnt->tag);
2207+
acornscsi_abortcmd(host);
22592208
return INTR_IDLE;
22602209

22612210
case 0x1b: /* -> PHASE_STATUSIN */
@@ -2482,7 +2431,6 @@ static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt,
24822431
SCpnt->scsi_done = done;
24832432
SCpnt->host_scribble = NULL;
24842433
SCpnt->result = 0;
2485-
SCpnt->tag = 0;
24862434
SCpnt->SCp.phase = (int)acornscsi_datadirection(SCpnt->cmnd[0]);
24872435
SCpnt->SCp.sent_command = 0;
24882436
SCpnt->SCp.scsi_xferred = 0;
@@ -2581,7 +2529,7 @@ static enum res_abort acornscsi_do_abort(AS_Host *host, struct scsi_cmnd *SCpnt)
25812529
break;
25822530

25832531
default:
2584-
acornscsi_abortcmd(host, host->SCpnt->tag);
2532+
acornscsi_abortcmd(host);
25852533
res = res_snooze;
25862534
}
25872535
local_irq_restore(flags);
@@ -2747,9 +2695,6 @@ char *acornscsi_info(struct Scsi_Host *host)
27472695
#ifdef CONFIG_SCSI_ACORNSCSI_SYNC
27482696
" SYNC"
27492697
#endif
2750-
#ifdef CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE
2751-
" TAG"
2752-
#endif
27532698
#if (DEBUG & DEBUG_NO_WRITE)
27542699
" NOWRITE (" __stringify(NO_WRITE) ")"
27552700
#endif
@@ -2770,9 +2715,6 @@ static int acornscsi_show_info(struct seq_file *m, struct Scsi_Host *instance)
27702715
#ifdef CONFIG_SCSI_ACORNSCSI_SYNC
27712716
" SYNC"
27722717
#endif
2773-
#ifdef CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE
2774-
" TAG"
2775-
#endif
27762718
#if (DEBUG & DEBUG_NO_WRITE)
27772719
" NOWRITE (" __stringify(NO_WRITE) ")"
27782720
#endif
@@ -2827,9 +2769,8 @@ static int acornscsi_show_info(struct seq_file *m, struct Scsi_Host *instance)
28272769
seq_printf(m, "Device/Lun TaggedQ Sync\n");
28282770
seq_printf(m, " %d/%llu ", scd->id, scd->lun);
28292771
if (scd->tagged_supported)
2830-
seq_printf(m, "%3sabled(%3d) ",
2831-
scd->simple_tags ? "en" : "dis",
2832-
scd->current_tag);
2772+
seq_printf(m, "%3sabled ",
2773+
scd->simple_tags ? "en" : "dis");
28332774
else
28342775
seq_printf(m, "unsupported ");
28352776

0 commit comments

Comments
 (0)