Commit 84d891d6 authored by James Bottomley's avatar James Bottomley
Browse files

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: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parents 5bb0b55a 7676f83a
Loading
Loading
Loading
Loading
+72 −29
Original line number Diff line number Diff line
@@ -350,16 +350,51 @@ out:
	return ret;
}

/**
 * sg_scsi_ioctl  --  handle deprecated SCSI_IOCTL_SEND_COMMAND ioctl
 * @file:	file this ioctl operates on (optional)
 * @q:		request queue to send scsi commands down
 * @disk:	gendisk to operate on (option)
 * @sic:	userspace structure describing the command to perform
 *
 * Send down the scsi command described by @sic to the device below
 * the request queue @q.  If @file is non-NULL it's used to perform
 * fine-grained permission checks that allow users to send down
 * non-destructive SCSI commands.  If the caller has a struct gendisk
 * available it should be passed in as @disk to allow the low level
 * driver to use the information contained in it.  A non-NULL @disk
 * is only allowed if the caller knows that the low level driver doesn't
 * need it (e.g. in the scsi subsystem).
 *
 * Notes:
 *   -  This interface is deprecated - users should use the SG_IO
 *      interface instead, as this is a more flexible approach to
 *      performing SCSI commands on a device.
 *   -  The SCSI command length is determined by examining the 1st byte
 *      of the given command. There is no way to override this.
 *   -  Data transfers are limited to PAGE_SIZE
 *   -  The length (x + y) must be at least OMAX_SB_LEN bytes long to
 *      accommodate the sense buffer when an error occurs.
 *      The sense buffer is truncated to OMAX_SB_LEN (16) bytes so that
 *      old code will not be surprised.
 *   -  If a Unix error occurs (e.g. ENOMEM) then the user will receive
 *      a negative return and the Unix error code in 'errno'.
 *      If the SCSI command succeeds then 0 is returned.
 *      Positive numbers returned are the compacted SCSI error codes (4
 *      bytes in one int) where the lowest byte is the SCSI status.
 */
#define OMAX_SB_LEN 16          /* For backward compatibility */

static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
			 struct gendisk *bd_disk, Scsi_Ioctl_Command __user *sic)
int sg_scsi_ioctl(struct file *file, struct request_queue *q,
		  struct gendisk *disk, struct scsi_ioctl_command __user *sic)
{
	struct request *rq;
	int err;
	unsigned int in_len, out_len, bytes, opcode, cmdlen;
	char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE];

	if (!sic)
		return -EINVAL;

	/*
	 * get in an out lengths, verify they don't exceed a page worth of data
	 */
@@ -393,17 +428,21 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
	if (copy_from_user(rq->cmd, sic->data, cmdlen))
		goto error;

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

	err = verify_command(file, rq->cmd);
	if (err)
		goto error;

	/* default.  possible overriden later */
	rq->retries = 5;

	switch (opcode) {
	case SEND_DIAGNOSTIC:
	case FORMAT_UNIT:
		rq->timeout = FORMAT_UNIT_TIMEOUT;
		rq->retries = 1;
		break;
	case START_STOP:
		rq->timeout = START_STOP_TIMEOUT;
@@ -416,22 +455,26 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
		break;
	case READ_DEFECT_DATA:
		rq->timeout = READ_DEFECT_DATA_TIMEOUT;
		rq->retries = 1;
		break;
	default:
		rq->timeout = BLK_DEFAULT_TIMEOUT;
		break;
	}

	if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, __GFP_WAIT)) {
		err = DRIVER_ERROR << 24;
		goto out;
	}

	memset(sense, 0, sizeof(sense));
	rq->sense = sense;
	rq->sense_len = 0;

	rq->data = buffer;
	rq->data_len = bytes;
	rq->flags |= REQ_BLOCK_PC;
	rq->retries = 0;

	blk_execute_rq(q, bd_disk, rq, 0);
	blk_execute_rq(q, disk, rq, 0);

out:
	err = rq->errors & 0xff;	/* only 8 bit SCSI status */
	if (err) {
		if (rq->sense_len && rq->sense) {
@@ -450,7 +493,7 @@ error:
	blk_put_request(rq);
	return err;
}

EXPORT_SYMBOL_GPL(sg_scsi_ioctl);

/* Send basic block requests */
static int __blk_send_generic(request_queue_t *q, struct gendisk *bd_disk, int cmd, int data)
+9 −1
Original line number Diff line number Diff line
@@ -366,6 +366,14 @@ mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure,
static int
mptsas_slave_configure(struct scsi_device *sdev)
{
	struct Scsi_Host	*host = sdev->host;
	MPT_SCSI_HOST		*hd = (MPT_SCSI_HOST *)host->hostdata;

	/*
	 * RAID volumes placed beyond the last expected port.
	 * Ignore sending sas mode pages in that case..
	 */
	if (sdev->channel < hd->ioc->num_ports)
		sas_read_port_mode_page(sdev);

	return mptscsih_slave_configure(sdev);
+7 −2
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@
   2.26.02.005 - Fix use_sg == 0 mapping on systems with 4GB or higher.
   2.26.02.006 - Fix 9550SX pchip reset timeout.
                 Add big endian support.
   2.26.02.007 - Disable local interrupts during kmap/unmap_atomic().
*/

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

/* Globals */
#define TW_DRIVER_VERSION "2.26.02.006"
#define TW_DRIVER_VERSION "2.26.02.007"
static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT];
static unsigned int twa_device_extension_count;
static int twa_major = -1;
@@ -1942,9 +1943,13 @@ static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int re
		}
		if (tw_dev->srb[request_id]->use_sg == 1) {
			struct scatterlist *sg = (struct scatterlist *)tw_dev->srb[request_id]->request_buffer;
			char *buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
			char *buf;
			unsigned long flags = 0;
			local_irq_save(flags);
			buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
			memcpy(buf, tw_dev->generic_buffer_virt[request_id], sg->length);
			kunmap_atomic(buf - sg->offset, KM_IRQ0);
			local_irq_restore(flags);
		}
	}
} /* End twa_scsiop_execute_scsi_complete() */
+8 −16
Original line number Diff line number Diff line
@@ -1079,7 +1079,7 @@ config SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
	  memory using PCI DAC cycles.

config SCSI_SYM53C8XX_DEFAULT_TAGS
	int "default tagged command queue depth"
	int "Default tagged command queue depth"
	depends on SCSI_SYM53C8XX_2
	default "16"
	help
@@ -1090,7 +1090,7 @@ config SCSI_SYM53C8XX_DEFAULT_TAGS
	  exceed CONFIG_SCSI_SYM53C8XX_MAX_TAGS.

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

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

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

config SCSI_QLOGIC_FC
	tristate "Qlogic ISP FC SCSI support"
	depends on PCI && SCSI
	help
	  This is a driver for the QLogic ISP2100 SCSI-FCP host adapter.

	  To compile this driver as a module, choose M here: the
	  module will be called qlogicfc.

config SCSI_QLOGIC_FC_FIRMWARE
	bool "Include loadable firmware in driver"
	depends on SCSI_QLOGIC_FC
+0 −1
Original line number Diff line number Diff line
@@ -78,7 +78,6 @@ obj-$(CONFIG_SCSI_NCR_Q720) += NCR_Q720_mod.o
obj-$(CONFIG_SCSI_SYM53C416)	+= sym53c416.o
obj-$(CONFIG_SCSI_QLOGIC_FAS)	+= qlogicfas408.o	qlogicfas.o
obj-$(CONFIG_PCMCIA_QLOGIC)	+= qlogicfas408.o
obj-$(CONFIG_SCSI_QLOGIC_FC)	+= qlogicfc.o 
obj-$(CONFIG_SCSI_QLOGIC_1280)	+= qla1280.o 
obj-$(CONFIG_SCSI_QLA_FC)	+= qla2xxx/
obj-$(CONFIG_SCSI_LPFC)		+= lpfc/
Loading