Skip to content

Commit 84d891d

Browse files
author
James Bottomley
committed
Merge ../scsi-rc-fixes-2.6
Conflicts: include/scsi/scsi_devinfo.h Same number for two BLIST flags: BLIST_MAX_512 and BLIST_ATTACH_PQ3 Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2 parents 5bb0b55 + 7676f83 commit 84d891d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1098
-13269
lines changed

block/scsi_ioctl.c

Lines changed: 72 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -350,16 +350,51 @@ static int sg_io(struct file *file, request_queue_t *q,
350350
return ret;
351351
}
352352

353+
/**
354+
* sg_scsi_ioctl -- handle deprecated SCSI_IOCTL_SEND_COMMAND ioctl
355+
* @file: file this ioctl operates on (optional)
356+
* @q: request queue to send scsi commands down
357+
* @disk: gendisk to operate on (option)
358+
* @sic: userspace structure describing the command to perform
359+
*
360+
* Send down the scsi command described by @sic to the device below
361+
* the request queue @q. If @file is non-NULL it's used to perform
362+
* fine-grained permission checks that allow users to send down
363+
* non-destructive SCSI commands. If the caller has a struct gendisk
364+
* available it should be passed in as @disk to allow the low level
365+
* driver to use the information contained in it. A non-NULL @disk
366+
* is only allowed if the caller knows that the low level driver doesn't
367+
* need it (e.g. in the scsi subsystem).
368+
*
369+
* Notes:
370+
* - This interface is deprecated - users should use the SG_IO
371+
* interface instead, as this is a more flexible approach to
372+
* performing SCSI commands on a device.
373+
* - The SCSI command length is determined by examining the 1st byte
374+
* of the given command. There is no way to override this.
375+
* - Data transfers are limited to PAGE_SIZE
376+
* - The length (x + y) must be at least OMAX_SB_LEN bytes long to
377+
* accommodate the sense buffer when an error occurs.
378+
* The sense buffer is truncated to OMAX_SB_LEN (16) bytes so that
379+
* old code will not be surprised.
380+
* - If a Unix error occurs (e.g. ENOMEM) then the user will receive
381+
* a negative return and the Unix error code in 'errno'.
382+
* If the SCSI command succeeds then 0 is returned.
383+
* Positive numbers returned are the compacted SCSI error codes (4
384+
* bytes in one int) where the lowest byte is the SCSI status.
385+
*/
353386
#define OMAX_SB_LEN 16 /* For backward compatibility */
354-
355-
static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
356-
struct gendisk *bd_disk, Scsi_Ioctl_Command __user *sic)
387+
int sg_scsi_ioctl(struct file *file, struct request_queue *q,
388+
struct gendisk *disk, struct scsi_ioctl_command __user *sic)
357389
{
358390
struct request *rq;
359391
int err;
360392
unsigned int in_len, out_len, bytes, opcode, cmdlen;
361393
char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE];
362394

395+
if (!sic)
396+
return -EINVAL;
397+
363398
/*
364399
* get in an out lengths, verify they don't exceed a page worth of data
365400
*/
@@ -393,45 +428,53 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
393428
if (copy_from_user(rq->cmd, sic->data, cmdlen))
394429
goto error;
395430

396-
if (copy_from_user(buffer, sic->data + cmdlen, in_len))
431+
if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len))
397432
goto error;
398433

399434
err = verify_command(file, rq->cmd);
400435
if (err)
401436
goto error;
402437

438+
/* default. possible overriden later */
439+
rq->retries = 5;
440+
403441
switch (opcode) {
404-
case SEND_DIAGNOSTIC:
405-
case FORMAT_UNIT:
406-
rq->timeout = FORMAT_UNIT_TIMEOUT;
407-
break;
408-
case START_STOP:
409-
rq->timeout = START_STOP_TIMEOUT;
410-
break;
411-
case MOVE_MEDIUM:
412-
rq->timeout = MOVE_MEDIUM_TIMEOUT;
413-
break;
414-
case READ_ELEMENT_STATUS:
415-
rq->timeout = READ_ELEMENT_STATUS_TIMEOUT;
416-
break;
417-
case READ_DEFECT_DATA:
418-
rq->timeout = READ_DEFECT_DATA_TIMEOUT;
419-
break;
420-
default:
421-
rq->timeout = BLK_DEFAULT_TIMEOUT;
422-
break;
442+
case SEND_DIAGNOSTIC:
443+
case FORMAT_UNIT:
444+
rq->timeout = FORMAT_UNIT_TIMEOUT;
445+
rq->retries = 1;
446+
break;
447+
case START_STOP:
448+
rq->timeout = START_STOP_TIMEOUT;
449+
break;
450+
case MOVE_MEDIUM:
451+
rq->timeout = MOVE_MEDIUM_TIMEOUT;
452+
break;
453+
case READ_ELEMENT_STATUS:
454+
rq->timeout = READ_ELEMENT_STATUS_TIMEOUT;
455+
break;
456+
case READ_DEFECT_DATA:
457+
rq->timeout = READ_DEFECT_DATA_TIMEOUT;
458+
rq->retries = 1;
459+
break;
460+
default:
461+
rq->timeout = BLK_DEFAULT_TIMEOUT;
462+
break;
463+
}
464+
465+
if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, __GFP_WAIT)) {
466+
err = DRIVER_ERROR << 24;
467+
goto out;
423468
}
424469

425470
memset(sense, 0, sizeof(sense));
426471
rq->sense = sense;
427472
rq->sense_len = 0;
428-
429-
rq->data = buffer;
430-
rq->data_len = bytes;
431473
rq->flags |= REQ_BLOCK_PC;
432-
rq->retries = 0;
433474

434-
blk_execute_rq(q, bd_disk, rq, 0);
475+
blk_execute_rq(q, disk, rq, 0);
476+
477+
out:
435478
err = rq->errors & 0xff; /* only 8 bit SCSI status */
436479
if (err) {
437480
if (rq->sense_len && rq->sense) {
@@ -450,7 +493,7 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
450493
blk_put_request(rq);
451494
return err;
452495
}
453-
496+
EXPORT_SYMBOL_GPL(sg_scsi_ioctl);
454497

455498
/* Send basic block requests */
456499
static int __blk_send_generic(request_queue_t *q, struct gendisk *bd_disk, int cmd, int data)

drivers/message/fusion/mptsas.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,15 @@ mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure,
366366
static int
367367
mptsas_slave_configure(struct scsi_device *sdev)
368368
{
369-
sas_read_port_mode_page(sdev);
369+
struct Scsi_Host *host = sdev->host;
370+
MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata;
371+
372+
/*
373+
* RAID volumes placed beyond the last expected port.
374+
* Ignore sending sas mode pages in that case..
375+
*/
376+
if (sdev->channel < hd->ioc->num_ports)
377+
sas_read_port_mode_page(sdev);
370378

371379
return mptscsih_slave_configure(sdev);
372380
}

drivers/scsi/3w-9xxx.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
2.26.02.005 - Fix use_sg == 0 mapping on systems with 4GB or higher.
6666
2.26.02.006 - Fix 9550SX pchip reset timeout.
6767
Add big endian support.
68+
2.26.02.007 - Disable local interrupts during kmap/unmap_atomic().
6869
*/
6970

7071
#include <linux/module.h>
@@ -88,7 +89,7 @@
8889
#include "3w-9xxx.h"
8990

9091
/* Globals */
91-
#define TW_DRIVER_VERSION "2.26.02.006"
92+
#define TW_DRIVER_VERSION "2.26.02.007"
9293
static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT];
9394
static unsigned int twa_device_extension_count;
9495
static int twa_major = -1;
@@ -1942,9 +1943,13 @@ static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int re
19421943
}
19431944
if (tw_dev->srb[request_id]->use_sg == 1) {
19441945
struct scatterlist *sg = (struct scatterlist *)tw_dev->srb[request_id]->request_buffer;
1945-
char *buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
1946+
char *buf;
1947+
unsigned long flags = 0;
1948+
local_irq_save(flags);
1949+
buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
19461950
memcpy(buf, tw_dev->generic_buffer_virt[request_id], sg->length);
19471951
kunmap_atomic(buf - sg->offset, KM_IRQ0);
1952+
local_irq_restore(flags);
19481953
}
19491954
}
19501955
} /* End twa_scsiop_execute_scsi_complete() */

drivers/scsi/Kconfig

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ config SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
10791079
memory using PCI DAC cycles.
10801080

10811081
config SCSI_SYM53C8XX_DEFAULT_TAGS
1082-
int "default tagged command queue depth"
1082+
int "Default tagged command queue depth"
10831083
depends on SCSI_SYM53C8XX_2
10841084
default "16"
10851085
help
@@ -1090,7 +1090,7 @@ config SCSI_SYM53C8XX_DEFAULT_TAGS
10901090
exceed CONFIG_SCSI_SYM53C8XX_MAX_TAGS.
10911091

10921092
config SCSI_SYM53C8XX_MAX_TAGS
1093-
int "maximum number of queued commands"
1093+
int "Maximum number of queued commands"
10941094
depends on SCSI_SYM53C8XX_2
10951095
default "64"
10961096
help
@@ -1099,13 +1099,14 @@ config SCSI_SYM53C8XX_MAX_TAGS
10991099
possible. The driver supports up to 256 queued commands per device.
11001100
This value is used as a compiled-in hard limit.
11011101

1102-
config SCSI_SYM53C8XX_IOMAPPED
1103-
bool "use port IO"
1102+
config SCSI_SYM53C8XX_MMIO
1103+
bool "Use memory mapped IO"
11041104
depends on SCSI_SYM53C8XX_2
1105+
default y
11051106
help
1106-
If you say Y here, the driver will use port IO to access
1107-
the card. This is significantly slower then using memory
1108-
mapped IO. Most people should answer N.
1107+
Memory mapped IO is faster than Port IO. Most people should
1108+
answer Y here, but some machines may have problems. If you have
1109+
to answer N here, please report the problem to the maintainer.
11091110

11101111
config SCSI_IPR
11111112
tristate "IBM Power Linux RAID adapter support"
@@ -1309,15 +1310,6 @@ config SCSI_QLOGIC_FAS
13091310
To compile this driver as a module, choose M here: the
13101311
module will be called qlogicfas.
13111312

1312-
config SCSI_QLOGIC_FC
1313-
tristate "Qlogic ISP FC SCSI support"
1314-
depends on PCI && SCSI
1315-
help
1316-
This is a driver for the QLogic ISP2100 SCSI-FCP host adapter.
1317-
1318-
To compile this driver as a module, choose M here: the
1319-
module will be called qlogicfc.
1320-
13211313
config SCSI_QLOGIC_FC_FIRMWARE
13221314
bool "Include loadable firmware in driver"
13231315
depends on SCSI_QLOGIC_FC

drivers/scsi/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ obj-$(CONFIG_SCSI_NCR_Q720) += NCR_Q720_mod.o
7878
obj-$(CONFIG_SCSI_SYM53C416) += sym53c416.o
7979
obj-$(CONFIG_SCSI_QLOGIC_FAS) += qlogicfas408.o qlogicfas.o
8080
obj-$(CONFIG_PCMCIA_QLOGIC) += qlogicfas408.o
81-
obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o
8281
obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o
8382
obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx/
8483
obj-$(CONFIG_SCSI_LPFC) += lpfc/

0 commit comments

Comments
 (0)