]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
authorLinus Torvalds <torvalds@g5.osdl.org>
Thu, 5 Oct 2006 01:57:35 +0000 (18:57 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 5 Oct 2006 01:57:35 +0000 (18:57 -0700)
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (54 commits)
  [SCSI] Initial Commit of qla4xxx
  [SCSI] raid class: handle component-add errors
  [SCSI] SCSI megaraid_sas: handle thrown errors
  [SCSI] SCSI aic94xx: handle sysfs errors
  [SCSI] SCSI st: fix error handling in module init, sysfs
  [SCSI] SCSI sd: fix module init/exit error handling
  [SCSI] SCSI osst: add error handling to module init, sysfs
  [SCSI] scsi: remove hosts.h
  [SCSI] scsi: Scsi_Cmnd convertion in aic7xxx_old.c
  [SCSI] megaraid_sas: sets ioctl timeout and updates version,changelog
  [SCSI] megaraid_sas: adds tasklet for cmd completion
  [SCSI] megaraid_sas: prints pending cmds before setting hw_crit_error
  [SCSI] megaraid_sas: function pointer for disable interrupt
  [SCSI] megaraid_sas: frame count optimization
  [SCSI] megaraid_sas: FW transition and q size changes
  [SCSI] qla2xxx: Update version number to 8.01.07-k2.
  [SCSI] qla2xxx: Stall mid-layer error handlers while rport is blocked.
  [SCSI] qla2xxx: Add MODULE_FIRMWARE tags.
  [SCSI] qla2xxx: Add support for host port state FC transport attribute.
  [SCSI] qla2xxx: Add support for fabric name FC transport attribute.
  ...

1  2 
drivers/scsi/Kconfig
drivers/scsi/aic7xxx_old.c
drivers/scsi/aic94xx/aic94xx_init.c
drivers/scsi/qla1280.c
drivers/scsi/scsi.c
drivers/scsi/scsi_lib.c
drivers/scsi/sd.c

diff --combined drivers/scsi/Kconfig
index c6dfb6fa13bf4192583a52556867374d570374ec,3ff5ec8f0d3178a8c2f0818adae57a5c6a64c639..9540eb8efdcbfc5b6db2051470bf9a203112fe59
@@@ -3,13 -3,11 +3,13 @@@ menu "SCSI device support
  config RAID_ATTRS
        tristate "RAID Transport Class"
        default n
 +      depends on BLOCK
        ---help---
          Provides RAID
  
  config SCSI
        tristate "SCSI device support"
 +      depends on BLOCK
        ---help---
          If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
          any other SCSI device under Linux, say Y and make sure that you know
@@@ -40,10 -38,10 +40,10 @@@ config SCSI_PROC_F
        default y
        ---help---
          This option enables support for the various files in
 -        /proc/scsi.  In Linux 2.6 this has been superceeded by
 +        /proc/scsi.  In Linux 2.6 this has been superseded by
          files in sysfs but many legacy applications rely on this.
  
 -        If unusure say Y.
 +        If unsure say Y.
  
  comment "SCSI support type (disk, tape, CD-ROM)"
        depends on SCSI
@@@ -85,7 -83,7 +85,7 @@@ config CHR_DEV_OSS
        tristate "SCSI OnStream SC-x0 tape support"
        depends on SCSI
        ---help---
 -        The OnStream SC-x0 SCSI tape drives can not be driven by the
 +        The OnStream SC-x0 SCSI tape drives cannot be driven by the
          standard st driver, but instead need this special osst driver and
          use the  /dev/osstX char device nodes (major 206).  Via usb-storage
          and ide-scsi, you may be able to drive the USB-x0 and DI-x0 drives
@@@ -1016,7 -1014,7 +1016,7 @@@ config SCSI_SYM53C8XX_MMI
  
  config SCSI_IPR
        tristate "IBM Power Linux RAID adapter support"
-       depends on PCI && SCSI
+       depends on PCI && SCSI && ATA
        select FW_LOADER
        ---help---
          This driver supports the IBM Power Linux family RAID adapters.
@@@ -1246,6 -1244,7 +1246,7 @@@ config SCSI_QLOGICPT
          module will be called qlogicpti.
  
  source "drivers/scsi/qla2xxx/Kconfig"
+ source "drivers/scsi/qla4xxx/Kconfig"
  
  config SCSI_LPFC
        tristate "Emulex LightPulse Fibre Channel Support"
@@@ -1262,8 -1261,8 +1263,8 @@@ config SCSI_SEAGAT
          These are 8-bit SCSI controllers; the ST-01 is also supported by
          this driver.  It is explained in section 3.9 of the SCSI-HOWTO,
          available from <http://www.tldp.org/docs.html#howto>.  If it
-         doesn't work out of the box, you may have to change some settings in
-         <file:drivers/scsi/seagate.h>.
+         doesn't work out of the box, you may have to change some macros at
+         compiletime, which are described in <file:drivers/scsi/seagate.c>.
  
          To compile this driver as a module, choose M here: the
          module will be called seagate.
index 10353379a0741e5f4f4f784ad230c4cba6249192,c1766cc2bbc85b5c901d670a99e2dbdad2a64b68..3eae8062a02ec56b511d944ebfecfbad71b5868a
@@@ -780,24 -780,26 +780,26 @@@ typedef enum 
  } ahc_bugs;
  
  struct aic7xxx_scb {
-         struct aic7xxx_hwscb  *hscb;          /* corresponding hardware scb */
-         Scsi_Cmnd             *cmd;              /* Scsi_Cmnd for this scb */
-         struct aic7xxx_scb    *q_next;        /* next scb in queue */
-         volatile scb_flag_type flags;         /* current state of scb */
-         struct hw_scatterlist *sg_list;       /* SG list in adapter format */
-         unsigned char          tag_action;
-         unsigned char          sg_count;
-         unsigned char          *sense_cmd;    /*
-                                                * Allocate 6 characters for
-                                                * sense command.
-                                                */
-       unsigned char          *cmnd;
-         unsigned int           sg_length; /* We init this during buildscb so we
-                                            * don't have to calculate anything
-                                            * during underflow/overflow/stat code
-                                            */
-         void                  *kmalloc_ptr;
-       struct aic7xxx_scb_dma *scb_dma;
+       struct aic7xxx_hwscb    *hscb;          /* corresponding hardware scb */
+       struct scsi_cmnd        *cmd;           /* scsi_cmnd for this scb */
+       struct aic7xxx_scb      *q_next;        /* next scb in queue */
+       volatile scb_flag_type  flags;          /* current state of scb */
+       struct hw_scatterlist   *sg_list;       /* SG list in adapter format */
+       unsigned char           tag_action;
+       unsigned char           sg_count;
+       unsigned char           *sense_cmd;     /*
+                                                * Allocate 6 characters for
+                                                * sense command.
+                                                */
+       unsigned char           *cmnd;
+       unsigned int            sg_length;      /*
+                                                * We init this during
+                                                * buildscb so we don't have
+                                                * to calculate anything during
+                                                * underflow/overflow/stat code
+                                                */
+       void                    *kmalloc_ptr;
+       struct aic7xxx_scb_dma  *scb_dma;
  };
  
  /*
@@@ -918,79 -920,77 +920,77 @@@ struct aic7xxx_host 
     * We are grouping things here....first, items that get either read or
     * written with nearly every interrupt
     */
-   volatile long            flags;
-   ahc_feature              features;         /* chip features */
-   unsigned long            base;             /* card base address */
-   volatile unsigned char  __iomem *maddr;            /* memory mapped address */
-   unsigned long            isr_count;        /* Interrupt count */
-   unsigned long            spurious_int;
-   scb_data_type           *scb_data;
-   struct aic7xxx_cmd_queue {
-     Scsi_Cmnd *head;
-     Scsi_Cmnd *tail;
-   } completeq;
+       volatile long   flags;
+       ahc_feature     features;       /* chip features */
+       unsigned long   base;           /* card base address */
+       volatile unsigned char  __iomem *maddr; /* memory mapped address */
+       unsigned long   isr_count;      /* Interrupt count */
+       unsigned long   spurious_int;
+       scb_data_type   *scb_data;
+       struct aic7xxx_cmd_queue {
+               struct scsi_cmnd *head;
+               struct scsi_cmnd *tail;
+       } completeq;
  
-   /*
-    * Things read/written on nearly every entry into aic7xxx_queue()
-    */
-   volatile scb_queue_type  waiting_scbs;
-   unsigned char            unpause;          /* unpause value for HCNTRL */
-   unsigned char            pause;            /* pause value for HCNTRL */
-   volatile unsigned char   qoutfifonext;
-   volatile unsigned char   activescbs;       /* active scbs */
-   volatile unsigned char   max_activescbs;
-   volatile unsigned char   qinfifonext;
-   volatile unsigned char  *untagged_scbs;
-   volatile unsigned char  *qoutfifo;
-   volatile unsigned char  *qinfifo;
-   unsigned char            dev_last_queue_full[MAX_TARGETS];
-   unsigned char            dev_last_queue_full_count[MAX_TARGETS];
-   unsigned short         ultraenb;         /* Gets downloaded to card as a
-                                               bitmap */
-   unsigned short         discenable;       /* Gets downloaded to card as a
-                                               bitmap */
-   transinfo_type           user[MAX_TARGETS];
-   unsigned char            msg_buf[13];      /* The message for the target */
-   unsigned char            msg_type;
+       /*
+       * Things read/written on nearly every entry into aic7xxx_queue()
+       */
+       volatile scb_queue_type waiting_scbs;
+       unsigned char   unpause;        /* unpause value for HCNTRL */
+       unsigned char   pause;          /* pause value for HCNTRL */
+       volatile unsigned char  qoutfifonext;
+       volatile unsigned char  activescbs;     /* active scbs */
+       volatile unsigned char  max_activescbs;
+       volatile unsigned char  qinfifonext;
+       volatile unsigned char  *untagged_scbs;
+       volatile unsigned char  *qoutfifo;
+       volatile unsigned char  *qinfifo;
+       unsigned char   dev_last_queue_full[MAX_TARGETS];
+       unsigned char   dev_last_queue_full_count[MAX_TARGETS];
+       unsigned short  ultraenb; /* Gets downloaded to card as a bitmap */
+       unsigned short  discenable; /* Gets downloaded to card as a bitmap */
+       transinfo_type  user[MAX_TARGETS];
+       unsigned char   msg_buf[13];    /* The message for the target */
+       unsigned char   msg_type;
  #define MSG_TYPE_NONE              0x00
  #define MSG_TYPE_INITIATOR_MSGOUT  0x01
  #define MSG_TYPE_INITIATOR_MSGIN   0x02
-   unsigned char            msg_len;          /* Length of message */
-   unsigned char            msg_index;        /* Index into msg_buf array */
+       unsigned char   msg_len;        /* Length of message */
+       unsigned char   msg_index;      /* Index into msg_buf array */
  
  
-   /*
-    * We put the less frequently used host structure items after the more
-    * frequently used items to try and ease the burden on the cache subsystem.
-    * These entries are not *commonly* accessed, whereas the preceding entries
-    * are accessed very often.
-    */
-   unsigned int             irq;              /* IRQ for this adapter */
-   int                      instance;         /* aic7xxx instance number */
-   int                      scsi_id;          /* host adapter SCSI ID */
-   int                      scsi_id_b;        /* channel B for twin adapters */
-   unsigned int             bios_address;
-   int                      board_name_index;
-   unsigned short           bios_control;     /* bios control - SEEPROM */
-   unsigned short           adapter_control;  /* adapter control - SEEPROM */
-   struct pci_dev        *pdev;
-   unsigned char            pci_bus;
-   unsigned char            pci_device_fn;
-   struct seeprom_config    sc;
-   unsigned short           sc_type;
-   unsigned short           sc_size;
-   struct aic7xxx_host     *next;             /* allow for multiple IRQs */
-   struct Scsi_Host        *host;             /* pointer to scsi host */
-   struct list_head       aic_devs;         /* all aic_dev structs on host */
-   int                      host_no;          /* SCSI host number */
-   unsigned long            mbase;            /* I/O memory address */
-   ahc_chip                 chip;             /* chip type */
-   ahc_bugs                 bugs;
-   dma_addr_t             fifo_dma;         /* DMA handle for fifo arrays */
+       /*
+        * We put the less frequently used host structure items
+        * after the more frequently used items to try and ease
+        * the burden on the cache subsystem.
+        * These entries are not *commonly* accessed, whereas
+        * the preceding entries are accessed very often.
+        */
  
+       unsigned int    irq;            /* IRQ for this adapter */
+       int             instance;       /* aic7xxx instance number */
+       int             scsi_id;        /* host adapter SCSI ID */
+       int             scsi_id_b;      /* channel B for twin adapters */
+       unsigned int    bios_address;
+       int             board_name_index;
+       unsigned short  bios_control;           /* bios control - SEEPROM */
+       unsigned short  adapter_control;        /* adapter control - SEEPROM */
+       struct pci_dev  *pdev;
+       unsigned char   pci_bus;
+       unsigned char   pci_device_fn;
+       struct seeprom_config   sc;
+       unsigned short  sc_type;
+       unsigned short  sc_size;
+       struct aic7xxx_host     *next;  /* allow for multiple IRQs */
+       struct Scsi_Host        *host;  /* pointer to scsi host */
+       struct list_head         aic_devs; /* all aic_dev structs on host */
+       int             host_no;        /* SCSI host number */
+       unsigned long   mbase;          /* I/O memory address */
+       ahc_chip        chip;           /* chip type */
+       ahc_bugs        bugs;
+       dma_addr_t      fifo_dma;       /* DMA handle for fifo arrays */
  };
  
  /*
@@@ -1271,7 -1271,7 +1271,7 @@@ static void aic7xxx_set_syncrate(struc
  static void aic7xxx_set_width(struct aic7xxx_host *p, int target, int channel,
                int lun, unsigned int width, unsigned int type,
                struct aic_dev_data *aic_dev);
- static void aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd);
+ static void aic7xxx_panic_abort(struct aic7xxx_host *p, struct scsi_cmnd *cmd);
  static void aic7xxx_print_card(struct aic7xxx_host *p);
  static void aic7xxx_print_scratch_ram(struct aic7xxx_host *p);
  static void aic7xxx_print_sequencer(struct aic7xxx_host *p, int downloaded);
@@@ -2626,7 -2626,7 +2626,7 @@@ aic7xxx_allocate_scb(struct aic7xxx_hos
   *   we're finished.  This function queues the completed commands.
   *-F*************************************************************************/
  static void
- aic7xxx_queue_cmd_complete(struct aic7xxx_host *p, Scsi_Cmnd *cmd)
+ aic7xxx_queue_cmd_complete(struct aic7xxx_host *p, struct scsi_cmnd *cmd)
  {
    aic7xxx_position(cmd) = SCB_LIST_NULL;
    cmd->host_scribble = (char *)p->completeq.head;
   * Description:
   *   Process the completed command queue.
   *-F*************************************************************************/
- static void
- aic7xxx_done_cmds_complete(struct aic7xxx_host *p)
+ static void aic7xxx_done_cmds_complete(struct aic7xxx_host *p)
  {
-   Scsi_Cmnd *cmd;
-   
-   while (p->completeq.head != NULL)
-   {
-     cmd = p->completeq.head;
-     p->completeq.head = (Scsi_Cmnd *)cmd->host_scribble;
-     cmd->host_scribble = NULL;
-     cmd->scsi_done(cmd);
-   }
+       struct scsi_cmnd *cmd;
+       while (p->completeq.head != NULL) {
+               cmd = p->completeq.head;
+               p->completeq.head = (struct scsi_Cmnd *) cmd->host_scribble;
+               cmd->host_scribble = NULL;
+               cmd->scsi_done(cmd);
+       }
  }
  
  /*+F*************************************************************************
@@@ -2687,11 -2685,11 +2685,11 @@@ aic7xxx_free_scb(struct aic7xxx_host *p
  static void
  aic7xxx_done(struct aic7xxx_host *p, struct aic7xxx_scb *scb)
  {
-   Scsi_Cmnd *cmd = scb->cmd;
-   struct aic_dev_data *aic_dev = cmd->device->hostdata;
-   int tindex = TARGET_INDEX(cmd);
-   struct aic7xxx_scb *scbp;
-   unsigned char queue_depth;
+       struct scsi_cmnd *cmd = scb->cmd;
+       struct aic_dev_data *aic_dev = cmd->device->hostdata;
+       int tindex = TARGET_INDEX(cmd);
+       struct aic7xxx_scb *scbp;
+       unsigned char queue_depth;
  
    if (cmd->use_sg > 1)
    {
        aic_dev->r_total++;
        ptr = aic_dev->r_bins;
      }
 -    if(cmd->device->simple_tags && cmd->request->flags & REQ_HARDBARRIER)
 +    if(cmd->device->simple_tags && cmd->request->cmd_flags & REQ_HARDBARRIER)
      {
        aic_dev->barrier_total++;
        if(scb->tag_action == MSG_ORDERED_Q_TAG)
   *   aic7xxx_run_done_queue
   *
   * Description:
-  *   Calls the aic7xxx_done() for the Scsi_Cmnd of each scb in the
+  *   Calls the aic7xxx_done() for the scsi_cmnd of each scb in the
   *   aborted list, and adds each scb to the free list.  If complete
   *   is TRUE, we also process the commands complete list.
   *-F*************************************************************************/
@@@ -3826,9 -3824,9 +3824,9 @@@ aic7xxx_construct_wdtr(struct aic7xxx_h
  static void
  aic7xxx_calculate_residual (struct aic7xxx_host *p, struct aic7xxx_scb *scb)
  {
-   struct aic7xxx_hwscb *hscb;
-   Scsi_Cmnd *cmd;
-   int actual, i;
+       struct aic7xxx_hwscb *hscb;
+       struct scsi_cmnd *cmd;
+       int actual, i;
  
    cmd = scb->cmd;
    hscb = scb->hscb;
@@@ -4219,20 -4217,20 +4217,20 @@@ aic7xxx_handle_seqint(struct aic7xxx_ho
  
      case BAD_STATUS:
        {
-         unsigned char scb_index;
-         struct aic7xxx_hwscb *hscb;
-         Scsi_Cmnd *cmd;
-         /* The sequencer will notify us when a command has an error that
-          * would be of interest to the kernel.  This allows us to leave
-          * the sequencer running in the common case of command completes
-          * without error.  The sequencer will have DMA'd the SCB back
-          * up to us, so we can reference the drivers SCB array.
-          *
-          * Set the default return value to 0 indicating not to send
-          * sense.  The sense code will change this if needed and this
-          * reduces code duplication.
-          */
+       unsigned char scb_index;
+       struct aic7xxx_hwscb *hscb;
+       struct scsi_cmnd *cmd;
+       /* The sequencer will notify us when a command has an error that
+        * would be of interest to the kernel.  This allows us to leave
+        * the sequencer running in the common case of command completes
+        * without error.  The sequencer will have DMA'd the SCB back
+        * up to us, so we can reference the drivers SCB array.
+        *
+        * Set the default return value to 0 indicating not to send
+        * sense.  The sense code will change this if needed and this
+        * reduces code duplication.
+        */
          aic_outb(p, 0, RETURN_1);
          scb_index = aic_inb(p, SCB_TAG);
          if (scb_index > p->scb_data->numscbs)
@@@ -5800,9 -5798,9 +5798,9 @@@ aic7xxx_handle_scsiint(struct aic7xxx_h
    }
    else if ((status & SELTO) != 0)
    {
-     unsigned char scbptr;
-     unsigned char nextscb;
-     Scsi_Cmnd *cmd;
+       unsigned char scbptr;
+       unsigned char nextscb;
+       struct scsi_cmnd *cmd;
  
      scbptr = aic_inb(p, WAITING_SCBH);
      if (scbptr > p->scb_data->maxhscbs)
      /*
       * Determine the bus phase and queue an appropriate message.
       */
-     char  *phase;
-     Scsi_Cmnd *cmd;
-     unsigned char mesg_out = MSG_NOOP;
-     unsigned char lastphase = aic_inb(p, LASTPHASE);
-     unsigned char sstat2 = aic_inb(p, SSTAT2);
+       char  *phase;
+       struct scsi_cmnd *cmd;
+       unsigned char mesg_out = MSG_NOOP;
+       unsigned char lastphase = aic_inb(p, LASTPHASE);
+       unsigned char sstat2 = aic_inb(p, SSTAT2);
  
      cmd = scb->cmd;
      switch (lastphase)
@@@ -6248,10 -6246,10 +6246,10 @@@ aic7xxx_check_scbs(struct aic7xxx_host 
  static void
  aic7xxx_handle_command_completion_intr(struct aic7xxx_host *p)
  {
-   struct aic7xxx_scb *scb = NULL;
-   struct aic_dev_data *aic_dev;
-   Scsi_Cmnd *cmd;
-   unsigned char scb_index, tindex;
+       struct aic7xxx_scb *scb = NULL;
+       struct aic_dev_data *aic_dev;
+       struct scsi_cmnd *cmd;
+       unsigned char scb_index, tindex;
  
  #ifdef AIC7XXX_VERBOSE_DEBUGGING
    if( (p->isr_count < 16) && (aic7xxx_verbose > 0xffff) )
@@@ -10131,9 -10129,8 +10129,8 @@@ skip_pci_controller
   * Description:
   *   Build a SCB.
   *-F*************************************************************************/
- static void
- aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd,
-     struct aic7xxx_scb *scb)
+ static void aic7xxx_buildscb(struct aic7xxx_host *p, struct scsi_cmnd *cmd,
+                            struct aic7xxx_scb *scb)
  {
    unsigned short mask;
    struct aic7xxx_hwscb *hscb;
      /* We always force TEST_UNIT_READY to untagged */
      if (cmd->cmnd[0] != TEST_UNIT_READY && sdptr->simple_tags)
      {
 -      if (req->flags & REQ_HARDBARRIER)
 +      if (req->cmd_flags & REQ_HARDBARRIER)
        {
        if(sdptr->ordered_tags)
        {
   * Description:
   *   Queue a SCB to the controller.
   *-F*************************************************************************/
- static int
- aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *))
+ static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
  {
    struct aic7xxx_host *p;
    struct aic7xxx_scb *scb;
    }
    scb->cmd = cmd;
  
-   /*
-    * Make sure the Scsi_Cmnd pointer is saved, the struct it points to
-    * is set up properly, and the parity error flag is reset, then send
-    * the SCB to the sequencer and watch the fun begin.
-    */
+       /*
+       * Make sure the scsi_cmnd pointer is saved, the struct it points to
+       * is set up properly, and the parity error flag is reset, then send
+       * the SCB to the sequencer and watch the fun begin.
+       */
    aic7xxx_position(cmd) = scb->hscb->tag;
    cmd->scsi_done = fn;
    cmd->result = DID_OK;
   *   aborted, then we will reset the channel and have all devices renegotiate.
   *   Returns an enumerated type that indicates the status of the operation.
   *-F*************************************************************************/
- static int
- __aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
+ static int __aic7xxx_bus_device_reset(struct scsi_cmnd *cmd)
  {
    struct aic7xxx_host  *p;
    struct aic7xxx_scb   *scb;
      return SUCCESS;
  }
  
- static int
- aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
+ static int aic7xxx_bus_device_reset(struct scsi_cmnd *cmd)
  {
        int rc;
  
   * Description:
   *   Abort the current SCSI command(s).
   *-F*************************************************************************/
- static void
- aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd)
+ static void aic7xxx_panic_abort(struct aic7xxx_host *p, struct scsi_cmnd *cmd)
  {
  
    printk("aic7xxx driver version %s\n", AIC7XXX_C_VERSION);
   * Description:
   *   Abort the current SCSI command(s).
   *-F*************************************************************************/
- static int
- __aic7xxx_abort(Scsi_Cmnd *cmd)
+ static int __aic7xxx_abort(struct scsi_cmnd *cmd)
  {
    struct aic7xxx_scb  *scb = NULL;
    struct aic7xxx_host *p;
@@@ -10813,8 -10805,7 +10805,7 @@@ success
    return SUCCESS;
  }
  
- static int
- aic7xxx_abort(Scsi_Cmnd *cmd)
+ static int aic7xxx_abort(struct scsi_cmnd *cmd)
  {
        int rc;
  
   *   DEVICE RESET message - on the offending target before pulling
   *   the SCSI bus reset line.
   *-F*************************************************************************/
- static int
- aic7xxx_reset(Scsi_Cmnd *cmd)
+ static int aic7xxx_reset(struct scsi_cmnd *cmd)
  {
    struct aic7xxx_scb *scb;
    struct aic7xxx_host *p;
index 734adc9d5206c1f84177a5fadccc197264ffa0c5,57379c929d8772c72f7be86887af688f3cd38f55..99743ca29ca147df75dacd12396be71da90266c9
@@@ -24,6 -24,7 +24,6 @@@
   *
   */
  
 -#include <linux/config.h>
  #include <linux/module.h>
  #include <linux/init.h>
  #include <linux/kernel.h>
@@@ -309,11 -310,29 +309,29 @@@ static ssize_t asd_show_dev_pcba_sn(str
  }
  static DEVICE_ATTR(pcba_sn, S_IRUGO, asd_show_dev_pcba_sn, NULL);
  
- static void asd_create_dev_attrs(struct asd_ha_struct *asd_ha)
+ static int asd_create_dev_attrs(struct asd_ha_struct *asd_ha)
  {
-       device_create_file(&asd_ha->pcidev->dev, &dev_attr_revision);
-       device_create_file(&asd_ha->pcidev->dev, &dev_attr_bios_build);
-       device_create_file(&asd_ha->pcidev->dev, &dev_attr_pcba_sn);
+       int err;
+       err = device_create_file(&asd_ha->pcidev->dev, &dev_attr_revision);
+       if (err)
+               return err;
+       err = device_create_file(&asd_ha->pcidev->dev, &dev_attr_bios_build);
+       if (err)
+               goto err_rev;
+       err = device_create_file(&asd_ha->pcidev->dev, &dev_attr_pcba_sn);
+       if (err)
+               goto err_biosb;
+       return 0;
+ err_biosb:
+       device_remove_file(&asd_ha->pcidev->dev, &dev_attr_bios_build);
+ err_rev:
+       device_remove_file(&asd_ha->pcidev->dev, &dev_attr_revision);
+       return err;
  }
  
  static void asd_remove_dev_attrs(struct asd_ha_struct *asd_ha)
@@@ -645,7 -664,9 +663,9 @@@ static int __devinit asd_pci_probe(stru
        }
        ASD_DPRINTK("escbs posted\n");
  
-       asd_create_dev_attrs(asd_ha);
+       err = asd_create_dev_attrs(asd_ha);
+       if (err)
+               goto Err_dev_attrs;
  
        err = asd_register_sas_ha(asd_ha);
        if (err)
@@@ -668,6 -689,7 +688,7 @@@ Err_en_phys
        asd_unregister_sas_ha(asd_ha);
  Err_reg_sas:
        asd_remove_dev_attrs(asd_ha);
+ Err_dev_attrs:
  Err_escbs:
        asd_disable_ints(asd_ha);
        free_irq(dev->irq, asd_ha);
@@@ -754,9 -776,9 +775,9 @@@ static ssize_t asd_version_show(struct 
  }
  static DRIVER_ATTR(version, S_IRUGO, asd_version_show, NULL);
  
- static void asd_create_driver_attrs(struct device_driver *driver)
+ static int asd_create_driver_attrs(struct device_driver *driver)
  {
-       driver_create_file(driver, &driver_attr_version);
+       return driver_create_file(driver, &driver_attr_version);
  }
  
  static void asd_remove_driver_attrs(struct device_driver *driver)
@@@ -834,10 -856,14 +855,14 @@@ static int __init aic94xx_init(void
        if (err)
                goto out_release_transport;
  
-       asd_create_driver_attrs(&aic94xx_pci_driver.driver);
+       err = asd_create_driver_attrs(&aic94xx_pci_driver.driver);
+       if (err)
+               goto out_unregister_pcidrv;
  
        return err;
  
+  out_unregister_pcidrv:
+       pci_unregister_driver(&aic94xx_pci_driver);
   out_release_transport:
        sas_release_transport(aic94xx_transport_template);
   out_destroy_caches:
diff --combined drivers/scsi/qla1280.c
index 332151e2a0189eb57a529eb4461afc218811a492,bdecde1c515f7c48f71b335fa781c9cbe0f7d4ec..9f33e5946c0d869e03f755bce135926ef74ca1e5
@@@ -813,7 -813,7 +813,7 @@@ qla1280_error_action(struct scsi_cmnd *
        uint16_t data;
        unsigned char *handle;
        int result, i;
 -      DECLARE_COMPLETION(wait);
 +      DECLARE_COMPLETION_ONSTACK(wait);
        struct timer_list timer;
  
        ha = (struct scsi_qla_host *)(CMD_HOST(cmd)->hostdata);
@@@ -2406,7 -2406,7 +2406,7 @@@ qla1280_mailbox_command(struct scsi_qla
        uint16_t *optr, *iptr;
        uint16_t __iomem *mptr;
        uint16_t data;
 -      DECLARE_COMPLETION(wait);
 +      DECLARE_COMPLETION_ONSTACK(wait);
        struct timer_list timer;
  
        ENTER("qla1280_mailbox_command");
@@@ -2862,7 -2862,7 +2862,7 @@@ qla1280_64bit_start_scsi(struct scsi_ql
        memset(((char *)pkt + 8), 0, (REQUEST_ENTRY_SIZE - 8));
  
        /* Set ISP command timeout. */
-       pkt->timeout = cpu_to_le16(30);
+       pkt->timeout = cpu_to_le16(cmd->timeout_per_command/HZ);
  
        /* Set device target ID and LUN */
        pkt->lun = SCSI_LUN_32(cmd);
@@@ -3161,7 -3161,7 +3161,7 @@@ qla1280_32bit_start_scsi(struct scsi_ql
        memset(((char *)pkt + 8), 0, (REQUEST_ENTRY_SIZE - 8));
  
        /* Set ISP command timeout. */
-       pkt->timeout = cpu_to_le16(30);
+       pkt->timeout = cpu_to_le16(cmd->timeout_per_command/HZ);
  
        /* Set device target ID and LUN */
        pkt->lun = SCSI_LUN_32(cmd);
@@@ -4484,7 -4484,7 +4484,7 @@@ qla1280_init(void
                qla1280_setup(qla1280);
  #endif
  
-       return pci_module_init(&qla1280_pci_driver);
+       return pci_register_driver(&qla1280_pci_driver);
  }
  
  static void __exit
diff --combined drivers/scsi/scsi.c
index da95bce907dd3a23257637510bb12e3613bc6a6c,a21642e32c42769e6c396f85ecf0fb617c988e0a..c59f31533ab4d2b0d072ead30c61a4a7ea6b199e
@@@ -128,7 -128,7 +128,7 @@@ const char * scsi_device_type(unsigned 
                return "Well-known LUN   ";
        if (type == 0x1f)
                return "No Device        ";
-       if (type > ARRAY_SIZE(scsi_device_types))
+       if (type >= ARRAY_SIZE(scsi_device_types))
                return "Unknown          ";
        return scsi_device_types[type];
  }
@@@ -592,6 -592,12 +592,6 @@@ int scsi_dispatch_cmd(struct scsi_cmnd 
        return rtn;
  }
  
 -
 -/*
 - * Per-CPU I/O completion queue.
 - */
 -static DEFINE_PER_CPU(struct list_head, scsi_done_q);
 -
  /**
   * scsi_req_abort_cmd -- Request command recovery for the specified command
   * cmd: pointer to the SCSI command of interest
@@@ -1059,7 -1065,7 +1059,7 @@@ int scsi_device_cancel(struct scsi_devi
  
        spin_lock_irqsave(&sdev->list_lock, flags);
        list_for_each_entry(scmd, &sdev->cmd_list, list) {
 -              if (scmd->request && scmd->request->rq_status != RQ_INACTIVE) {
 +              if (scmd->request) {
                        /*
                         * If we are unable to remove the timer, it means
                         * that the command has already timed out or
@@@ -1096,7 -1102,7 +1096,7 @@@ MODULE_PARM_DESC(scsi_logging_level, "
  
  static int __init init_scsi(void)
  {
 -      int error, i;
 +      int error;
  
        error = scsi_init_queue();
        if (error)
        if (error)
                goto cleanup_sysctl;
  
 -      for_each_possible_cpu(i)
 -              INIT_LIST_HEAD(&per_cpu(scsi_done_q, i));
 -
        scsi_netlink_init();
  
        printk(KERN_NOTICE "SCSI subsystem initialized\n");
diff --combined drivers/scsi/scsi_lib.c
index 71084728eb42322462af7a6f0980d627af54e725,8ada93ae34f7f47a8ed17950f04aaa02d0a893ec..743f67ed76400e1433d8f4bbd00d2bf91bd8fbca
@@@ -82,7 -82,7 +82,7 @@@ static void scsi_unprep_request(struct 
  {
        struct scsi_cmnd *cmd = req->special;
  
 -      req->flags &= ~REQ_DONTPREP;
 +      req->cmd_flags &= ~REQ_DONTPREP;
        req->special = NULL;
  
        scsi_put_command(cmd);
@@@ -196,8 -196,7 +196,8 @@@ int scsi_execute(struct scsi_device *sd
        req->sense_len = 0;
        req->retries = retries;
        req->timeout = timeout;
 -      req->flags |= flags | REQ_BLOCK_PC | REQ_SPECIAL | REQ_QUIET;
 +      req->cmd_type = REQ_TYPE_BLOCK_PC;
 +      req->cmd_flags |= flags | REQ_QUIET | REQ_PREEMPT;
  
        /*
         * head injection *required* here otherwise quiesce won't work
@@@ -398,8 -397,7 +398,8 @@@ int scsi_execute_async(struct scsi_devi
        req = blk_get_request(sdev->request_queue, write, gfp);
        if (!req)
                goto free_sense;
 -      req->flags |= REQ_BLOCK_PC | REQ_QUIET;
 +      req->cmd_type = REQ_TYPE_BLOCK_PC;
 +      req->cmd_flags |= REQ_QUIET;
  
        if (use_sg)
                err = scsi_req_map_sg(req, buffer, use_sg, bufflen, gfp);
  free_req:
        blk_put_request(req);
  free_sense:
-       kfree(sioc);
+       kmem_cache_free(scsi_io_context_cache, sioc);
        return DRIVER_ERROR << 24;
  }
  EXPORT_SYMBOL_GPL(scsi_execute_async);
@@@ -935,7 -933,7 +935,7 @@@ void scsi_io_completion(struct scsi_cmn
                                        break;
                                }
                        }
 -                      if (!(req->flags & REQ_QUIET)) {
 +                      if (!(req->cmd_flags & REQ_QUIET)) {
                                scmd_printk(KERN_INFO, cmd,
                                            "Device not ready: ");
                                scsi_print_sense_hdr("", &sshdr);
                        scsi_end_request(cmd, 0, this_count, 1);
                        return;
                case VOLUME_OVERFLOW:
 -                      if (!(req->flags & REQ_QUIET)) {
 +                      if (!(req->cmd_flags & REQ_QUIET)) {
                                scmd_printk(KERN_INFO, cmd,
                                            "Volume overflow, CDB: ");
                                __scsi_print_command(cmd->cmnd);
                return;
        }
        if (result) {
 -              if (!(req->flags & REQ_QUIET)) {
 +              if (!(req->cmd_flags & REQ_QUIET)) {
                        scmd_printk(KERN_INFO, cmd,
                                    "SCSI error: return code = 0x%08x\n",
                                    result);
@@@ -997,7 -995,7 +997,7 @@@ static int scsi_init_io(struct scsi_cmn
        /*
         * if this is a rq->data based REQ_BLOCK_PC, setup for a non-sg xfer
         */
 -      if ((req->flags & REQ_BLOCK_PC) && !req->bio) {
 +      if (blk_pc_request(req) && !req->bio) {
                cmd->request_bufflen = req->data_len;
                cmd->request_buffer = req->data;
                req->buffer = req->data;
@@@ -1141,12 -1139,13 +1141,12 @@@ static int scsi_prep_fn(struct request_
         * these two cases differently.  We differentiate by looking
         * at request->cmd, as this tells us the real story.
         */
 -      if (req->flags & REQ_SPECIAL && req->special) {
 +      if (blk_special_request(req) && req->special)
                cmd = req->special;
 -      } else if (req->flags & (REQ_CMD | REQ_BLOCK_PC)) {
 -
 -              if(unlikely(specials_only) && !(req->flags & REQ_SPECIAL)) {
 -                      if(specials_only == SDEV_QUIESCE ||
 -                                      specials_only == SDEV_BLOCK)
 +      else if (blk_pc_request(req) || blk_fs_request(req)) {
 +              if (unlikely(specials_only) && !(req->cmd_flags & REQ_PREEMPT)){
 +                      if (specials_only == SDEV_QUIESCE ||
 +                          specials_only == SDEV_BLOCK)
                                goto defer;
                        
                        sdev_printk(KERN_ERR, sdev,
                        goto kill;
                }
                        
 -                      
                /*
                 * Now try and find a command block that we can use.
                 */
         * lock.  We hope REQ_STARTED prevents anything untoward from
         * happening now.
         */
 -      if (req->flags & (REQ_CMD | REQ_BLOCK_PC)) {
 +      if (blk_fs_request(req) || blk_pc_request(req)) {
                int ret;
  
                /*
                /*
                 * Initialize the actual SCSI command for this request.
                 */
 -              if (req->flags & REQ_BLOCK_PC) {
 +              if (blk_pc_request(req)) {
                        scsi_setup_blk_pc_cmnd(cmd);
                } else if (req->rq_disk) {
                        struct scsi_driver *drv;
        /*
         * The request is now prepped, no need to come back here
         */
 -      req->flags |= REQ_DONTPREP;
 +      req->cmd_flags |= REQ_DONTPREP;
        return BLKPREP_OK;
  
   defer:
@@@ -1454,9 -1454,8 +1454,9 @@@ static void scsi_request_fn(struct requ
                if (unlikely(cmd == NULL)) {
                        printk(KERN_CRIT "impossible request in %s.\n"
                                         "please mail a stack trace to "
 -                                       "linux-scsi@vger.kernel.org",
 +                                       "linux-scsi@vger.kernel.org\n",
                                         __FUNCTION__);
 +                      blk_dump_rq_flags(req, "foo");
                        BUG();
                }
                spin_lock(shost->host_lock);
diff --combined drivers/scsi/sd.c
index 10bc99c911faf55744dc226f04b4fe84fc210800,7a9d552f50e619b21188c85cbcb7749bd9522ea6..84ff203ffedd77749276358825e488fb6d8cfd9d
@@@ -443,7 -443,8 +443,7 @@@ static int sd_init_command(struct scsi_
                SCpnt->cmnd[0] = READ_6;
                SCpnt->sc_data_direction = DMA_FROM_DEVICE;
        } else {
 -              printk(KERN_ERR "sd: Unknown command %lx\n", rq->flags);
 -/* overkill   panic("Unknown sd command %lx\n", rq->flags); */
 +              printk(KERN_ERR "sd: Unknown command %x\n", rq->cmd_flags);
                return 0;
        }
  
@@@ -839,7 -840,7 +839,7 @@@ static int sd_issue_flush(struct devic
  static void sd_prepare_flush(request_queue_t *q, struct request *rq)
  {
        memset(rq->cmd, 0, sizeof(rq->cmd));
 -      rq->flags |= REQ_BLOCK_PC;
 +      rq->cmd_type = REQ_TYPE_BLOCK_PC;
        rq->timeout = SD_TIMEOUT;
        rq->cmd[0] = SYNCHRONIZE_CACHE;
        rq->cmd_len = 10;
@@@ -1794,7 -1795,7 +1794,7 @@@ static void sd_shutdown(struct device *
   **/
  static int __init init_sd(void)
  {
-       int majors = 0, i;
+       int majors = 0, i, err;
  
        SCSI_LOG_HLQUEUE(3, printk("init_sd: sd driver entry point\n"));
  
        if (!majors)
                return -ENODEV;
  
-       class_register(&sd_disk_class);
+       err = class_register(&sd_disk_class);
+       if (err)
+               goto err_out;
  
-       return scsi_register_driver(&sd_template.gendrv);
+       err = scsi_register_driver(&sd_template.gendrv);
+       if (err)
+               goto err_out_class;
+       return 0;
+ err_out_class:
+       class_unregister(&sd_disk_class);
+ err_out:
+       for (i = 0; i < SD_MAJORS; i++)
+               unregister_blkdev(sd_major(i), "sd");
+       return err;
  }
  
  /**
@@@ -1822,10 -1836,10 +1835,10 @@@ static void __exit exit_sd(void
        SCSI_LOG_HLQUEUE(3, printk("exit_sd: exiting sd driver\n"));
  
        scsi_unregister_driver(&sd_template.gendrv);
+       class_unregister(&sd_disk_class);
        for (i = 0; i < SD_MAJORS; i++)
                unregister_blkdev(sd_major(i), "sd");
-       class_unregister(&sd_disk_class);
  }
  
  module_init(init_sd);