Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 11 Feb 2007 19:44:25 +0000 (11:44 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 11 Feb 2007 19:44:25 +0000 (11:44 -0800)
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (97 commits)
  [SCSI] zfcp: removed wrong comment
  [SCSI] zfcp: use of uninitialized variable
  [SCSI] zfcp: Invalid locking order
  [SCSI] aic79xx: use dma_get_required_mask()
  [SCSI] aic79xx: fix bracket mismatch in unused macro
  [SCSI] BusLogic: Replace 'boolean' by 'bool'
  [SCSI] advansys: clean up warnings
  [SCSI] 53c7xx: brackets fix in uncompiled code
  [SCSI] nsp_cs: remove old scsi code
  [SCSI] aic79xx: make ahd_match_scb() static
  [SCSI] DAC960: kmalloc->kzalloc/Casting cleanups
  [SCSI] scsi_kmap_atomic_sg(): check that local irqs are disabled
  [SCSI] Buslogic: local_irq_disable() is redundant after local_irq_save()
  [SCSI] aic94xx: update for v28 firmware
  [SCSI] scsi_error: Fix lost EH commands
  [SCSI] aic94xx: Add default bus reset handler
  [SCSI] aic94xx: Remove TMF result code munging
  [SCSI] libsas: Add an LU reset mechanism to the error handler
  [SCSI] libsas: Don't BUG when connecting two expanders via wide port
  [SCSI] st: fix Tape dies if wrong block size used, bug 7919
  ...

1  2 
drivers/block/DAC960.c
drivers/scsi/53c7xx.c
drivers/scsi/scsi_lib.c
include/scsi/libsas.h

diff --combined drivers/block/DAC960.c
index 6ad28dfb146908ec490b1c3657e70dcca75604b8,7c72f104567e78c3e1ee12be9321bce04a54071f..7b2fa3d8f61c0522b0bb6ff07c2e4de6199b31c3
@@@ -177,7 -177,7 +177,7 @@@ static void DAC960_AnnounceDriver(DAC96
    DAC960_Failure prints a standardized error message, and then returns false.
  */
  
 -static boolean DAC960_Failure(DAC960_Controller_T *Controller,
 +static bool DAC960_Failure(DAC960_Controller_T *Controller,
                              unsigned char *ErrorMessage)
  {
    DAC960_Error("While configuring DAC960 PCI RAID Controller at\n",
    that are passed in.
   */
  
 -static boolean init_dma_loaf(struct pci_dev *dev, struct dma_loaf *loaf,
 +static bool init_dma_loaf(struct pci_dev *dev, struct dma_loaf *loaf,
                                                                 size_t len)
  {
        void *cpu_addr;
@@@ -250,7 -250,7 +250,7 @@@ static void free_dma_loaf(struct pci_de
    failure.
  */
  
 -static boolean DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller)
 +static bool DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller)
  {
    int CommandAllocationLength, CommandAllocationGroupSize;
    int CommandsRemaining = 0, CommandIdentifier, CommandGroupByteCount;
@@@ -790,7 -790,7 +790,7 @@@ static void DAC960_ExecuteCommand(DAC96
    on failure.
  */
  
 -static boolean DAC960_V1_ExecuteType3(DAC960_Controller_T *Controller,
 +static bool DAC960_V1_ExecuteType3(DAC960_Controller_T *Controller,
                                      DAC960_V1_CommandOpcode_T CommandOpcode,
                                      dma_addr_t DataDMA)
  {
    on failure.
  */
  
 -static boolean DAC960_V1_ExecuteType3B(DAC960_Controller_T *Controller,
 +static bool DAC960_V1_ExecuteType3B(DAC960_Controller_T *Controller,
                                       DAC960_V1_CommandOpcode_T CommandOpcode,
                                       unsigned char CommandOpcode2,
                                       dma_addr_t DataDMA)
    on failure.
  */
  
 -static boolean DAC960_V1_ExecuteType3D(DAC960_Controller_T *Controller,
 +static bool DAC960_V1_ExecuteType3D(DAC960_Controller_T *Controller,
                                       DAC960_V1_CommandOpcode_T CommandOpcode,
                                       unsigned char Channel,
                                       unsigned char TargetID,
    Return data in The controller's HealthStatusBuffer, which is dma-able memory
  */
  
 -static boolean DAC960_V2_GeneralInfo(DAC960_Controller_T *Controller)
 +static bool DAC960_V2_GeneralInfo(DAC960_Controller_T *Controller)
  {
    DAC960_Command_T *Command = DAC960_AllocateCommand(Controller);
    DAC960_V2_CommandMailbox_T *CommandMailbox = &Command->V2.CommandMailbox;
    memory buffer.
  */
  
 -static boolean DAC960_V2_NewControllerInfo(DAC960_Controller_T *Controller)
 +static bool DAC960_V2_NewControllerInfo(DAC960_Controller_T *Controller)
  {
    DAC960_Command_T *Command = DAC960_AllocateCommand(Controller);
    DAC960_V2_CommandMailbox_T *CommandMailbox = &Command->V2.CommandMailbox;
    Data is returned in the controller's V2.NewLogicalDeviceInformation
  */
  
 -static boolean DAC960_V2_NewLogicalDeviceInfo(DAC960_Controller_T *Controller,
 +static bool DAC960_V2_NewLogicalDeviceInfo(DAC960_Controller_T *Controller,
                                           unsigned short LogicalDeviceNumber)
  {
    DAC960_Command_T *Command = DAC960_AllocateCommand(Controller);
  
  */
  
 -static boolean DAC960_V2_NewPhysicalDeviceInfo(DAC960_Controller_T *Controller,
 +static bool DAC960_V2_NewPhysicalDeviceInfo(DAC960_Controller_T *Controller,
                                            unsigned char Channel,
                                            unsigned char TargetID,
                                            unsigned char LogicalUnit)
@@@ -1082,7 -1082,7 +1082,7 @@@ static void DAC960_V2_ConstructNewUnitS
    memory buffer.
  */
  
 -static boolean DAC960_V2_NewInquiryUnitSerialNumber(DAC960_Controller_T *Controller,
 +static bool DAC960_V2_NewInquiryUnitSerialNumber(DAC960_Controller_T *Controller,
                        int Channel, int TargetID, int LogicalUnit)
  {
        DAC960_Command_T *Command;
    success and false on failure.
  */
  
 -static boolean DAC960_V2_DeviceOperation(DAC960_Controller_T *Controller,
 +static bool DAC960_V2_DeviceOperation(DAC960_Controller_T *Controller,
                                         DAC960_V2_IOCTL_Opcode_T IOCTL_Opcode,
                                         DAC960_V2_OperationDevice_T
                                           OperationDevice)
    other dma mapped memory.
  */
  
 -static boolean DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T
 +static bool DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T
                                                      *Controller)
  {
    void __iomem *ControllerBaseAddress = Controller->BaseAddress;
@@@ -1348,7 -1348,7 +1348,7 @@@ skip_mailboxes
    the structures that are contained in that region.
  */
  
 -static boolean DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T
 +static bool DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T
                                                      *Controller)
  {
    void __iomem *ControllerBaseAddress = Controller->BaseAddress;
    Controller->BounceBufferLimit = DAC690_V2_PciDmaMask;
  
    /* This is a temporary dma mapping, used only in the scope of this function */
-   CommandMailbox =
-         (DAC960_V2_CommandMailbox_T *)pci_alloc_consistent( PCI_Device,
+   CommandMailbox = pci_alloc_consistent(PCI_Device,
                sizeof(DAC960_V2_CommandMailbox_T), &CommandMailboxDMA);
    if (CommandMailbox == NULL)
          return false;
    from DAC960 V1 Firmware Controllers and initializes the Controller structure.
  */
  
 -static boolean DAC960_V1_ReadControllerConfiguration(DAC960_Controller_T
 +static bool DAC960_V1_ReadControllerConfiguration(DAC960_Controller_T
                                                     *Controller)
  {
    DAC960_V1_Enquiry2_T *Enquiry2;
    from DAC960 V2 Firmware Controllers and initializes the Controller structure.
  */
  
 -static boolean DAC960_V2_ReadControllerConfiguration(DAC960_Controller_T
 +static bool DAC960_V2_ReadControllerConfiguration(DAC960_Controller_T
                                                     *Controller)
  {
    DAC960_V2_ControllerInfo_T *ControllerInfo =
        if (NewLogicalDeviceInfo->LogicalDeviceState !=
          DAC960_V2_LogicalDevice_Offline)
        Controller->LogicalDriveInitiallyAccessible[LogicalDeviceNumber] = true;
-       LogicalDeviceInfo = (DAC960_V2_LogicalDeviceInfo_T *)
-       kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T), GFP_ATOMIC);
+       LogicalDeviceInfo = kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T),
+                                  GFP_ATOMIC);
        if (LogicalDeviceInfo == NULL)
        return DAC960_Failure(Controller, "LOGICAL DEVICE ALLOCATION");
        Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] =
    for Controller.
  */
  
 -static boolean DAC960_ReportControllerConfiguration(DAC960_Controller_T
 +static bool DAC960_ReportControllerConfiguration(DAC960_Controller_T
                                                    *Controller)
  {
    DAC960_Info("Configuring Mylex %s PCI RAID Controller\n",
    Controller.
  */
  
 -static boolean DAC960_V1_ReadDeviceConfiguration(DAC960_Controller_T
 +static bool DAC960_V1_ReadDeviceConfiguration(DAC960_Controller_T
                                                 *Controller)
  {
    struct dma_loaf local_dma;
    device connected to Controller.
  */
  
 -static boolean DAC960_V2_ReadDeviceConfiguration(DAC960_Controller_T
 +static bool DAC960_V2_ReadDeviceConfiguration(DAC960_Controller_T
                                                 *Controller)
  {
    unsigned char Channel = 0, TargetID = 0, LogicalUnit = 0;
        if (!DAC960_V2_NewPhysicalDeviceInfo(Controller, Channel, TargetID, LogicalUnit))
          break;
  
-       PhysicalDeviceInfo = (DAC960_V2_PhysicalDeviceInfo_T *)
-               kmalloc(sizeof(DAC960_V2_PhysicalDeviceInfo_T), GFP_ATOMIC);
+       PhysicalDeviceInfo = kmalloc(sizeof(DAC960_V2_PhysicalDeviceInfo_T),
+                                   GFP_ATOMIC);
        if (PhysicalDeviceInfo == NULL)
                return DAC960_Failure(Controller, "PHYSICAL DEVICE ALLOCATION");
        Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex] =
        memcpy(PhysicalDeviceInfo, NewPhysicalDeviceInfo,
                sizeof(DAC960_V2_PhysicalDeviceInfo_T));
  
-       InquiryUnitSerialNumber = (DAC960_SCSI_Inquiry_UnitSerialNumber_T *)
-       kmalloc(sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T), GFP_ATOMIC);
+       InquiryUnitSerialNumber = kmalloc(
+             sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T), GFP_ATOMIC);
        if (InquiryUnitSerialNumber == NULL) {
        kfree(PhysicalDeviceInfo);
        return DAC960_Failure(Controller, "SERIAL NUMBER ALLOCATION");
@@@ -2219,7 -2218,7 +2218,7 @@@ static void DAC960_SanitizeInquiryData(
    Information for DAC960 V1 Firmware Controllers.
  */
  
 -static boolean DAC960_V1_ReportDeviceConfiguration(DAC960_Controller_T
 +static bool DAC960_V1_ReportDeviceConfiguration(DAC960_Controller_T
                                                   *Controller)
  {
    int LogicalDriveNumber, Channel, TargetID;
    Information for DAC960 V2 Firmware Controllers.
  */
  
 -static boolean DAC960_V2_ReportDeviceConfiguration(DAC960_Controller_T
 +static bool DAC960_V2_ReportDeviceConfiguration(DAC960_Controller_T
                                                   *Controller)
  {
    int PhysicalDeviceIndex, LogicalDriveNumber;
    associated with Controller.
  */
  
 -static boolean DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller)
 +static bool DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller)
  {
    int MajorNumber = DAC960_MAJOR + Controller->ControllerNumber;
    int n;
@@@ -2582,7 -2581,7 +2581,7 @@@ static void DAC960_ComputeGenericDiskIn
    It returns true for fatal errors and false otherwise.
  */
  
 -static boolean DAC960_ReportErrorStatus(DAC960_Controller_T *Controller,
 +static bool DAC960_ReportErrorStatus(DAC960_Controller_T *Controller,
                                        unsigned char ErrorStatus,
                                        unsigned char Parameter0,
                                        unsigned char Parameter1)
@@@ -3048,7 -3047,7 +3047,7 @@@ Failure
    DAC960_InitializeController initializes Controller.
  */
  
 -static boolean 
 +static bool 
  DAC960_InitializeController(DAC960_Controller_T *Controller)
  {
    if (DAC960_ReadControllerConfiguration(Controller) &&
@@@ -3445,8 -3444,8 +3444,8 @@@ static void DAC960_RequestFunction(stru
    individual Buffer.
  */
  
 -static inline boolean DAC960_ProcessCompletedRequest(DAC960_Command_T *Command,
 -                                               boolean SuccessfulIO)
 +static inline bool DAC960_ProcessCompletedRequest(DAC960_Command_T *Command,
 +                                               bool SuccessfulIO)
  {
        struct request *Request = Command->Request;
        int UpToDate;
@@@ -3572,7 -3571,7 +3571,7 @@@ static void DAC960_V1_ProcessCompletedC
    else if (CommandType == DAC960_ReadRetryCommand ||
           CommandType == DAC960_WriteRetryCommand)
      {
 -      boolean normal_completion;
 +      bool normal_completion;
  #ifdef FORCE_RETRY_FAILURE_DEBUG
        static int retry_count = 1;
  #endif
@@@ -4659,7 -4658,7 +4658,7 @@@ static void DAC960_V2_ProcessCompletedC
    else if (CommandType == DAC960_ReadRetryCommand ||
           CommandType == DAC960_WriteRetryCommand)
      {
 -      boolean normal_completion;
 +      bool normal_completion;
  
  #ifdef FORCE_RETRY_FAILURE_DEBUG
        static int retry_count = 1;
              PhysicalDevice.LogicalUnit = NewLogicalDeviceInfo->LogicalUnit;
              Controller->V2.LogicalDriveToVirtualDevice[LogicalDeviceNumber] =
                PhysicalDevice;
-             LogicalDeviceInfo = (DAC960_V2_LogicalDeviceInfo_T *)
-               kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T), GFP_ATOMIC);
+             LogicalDeviceInfo = kmalloc(sizeof(DAC960_V2_LogicalDeviceInfo_T),
+                                         GFP_ATOMIC);
              Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] =
                LogicalDeviceInfo;
              DAC960_Critical("Logical Drive %d (/dev/rd/c%dd%d) "
@@@ -5632,7 -5631,7 +5631,7 @@@ static void DAC960_MonitoringTimerFunct
        &Controller->V2.ControllerInformation;
        unsigned int StatusChangeCounter =
        Controller->V2.HealthStatusBuffer->StatusChangeCounter;
 -      boolean ForceMonitoringCommand = false;
 +      bool ForceMonitoringCommand = false;
        if (time_after(jiffies, Controller->SecondaryMonitoringTime
          + DAC960_SecondaryMonitoringInterval))
        {
    necessary.  It returns true if there is enough room and false otherwise.
  */
  
 -static boolean DAC960_CheckStatusBuffer(DAC960_Controller_T *Controller,
 +static bool DAC960_CheckStatusBuffer(DAC960_Controller_T *Controller,
                                        unsigned int ByteCount)
  {
    unsigned char *NewStatusBuffer;
        unsigned int NewStatusBufferLength = DAC960_InitialStatusBufferSize;
        while (NewStatusBufferLength < ByteCount)
        NewStatusBufferLength *= 2;
-       Controller->CombinedStatusBuffer =
-       (unsigned char *) kmalloc(NewStatusBufferLength, GFP_ATOMIC);
+       Controller->CombinedStatusBuffer = kmalloc(NewStatusBufferLength,
+                                                 GFP_ATOMIC);
        if (Controller->CombinedStatusBuffer == NULL) return false;
        Controller->CombinedStatusBufferLength = NewStatusBufferLength;
        return true;
      }
-   NewStatusBuffer = (unsigned char *)
-     kmalloc(2 * Controller->CombinedStatusBufferLength, GFP_ATOMIC);
+   NewStatusBuffer = kmalloc(2 * Controller->CombinedStatusBufferLength,
+                            GFP_ATOMIC);
    if (NewStatusBuffer == NULL)
      {
        DAC960_Warning("Unable to expand Combined Status Buffer - Truncating\n",
@@@ -5744,7 -5743,7 +5743,7 @@@ static void DAC960_Message(DAC960_Messa
                           ...)
  {
    static unsigned char Buffer[DAC960_LineBufferSize];
 -  static boolean BeginningOfLine = true;
 +  static bool BeginningOfLine = true;
    va_list Arguments;
    int Length = 0;
    va_start(Arguments, Controller);
    Channel and TargetID and returns true on success and false on failure.
  */
  
 -static boolean DAC960_ParsePhysicalDevice(DAC960_Controller_T *Controller,
 +static bool DAC960_ParsePhysicalDevice(DAC960_Controller_T *Controller,
                                          char *UserCommandString,
                                          unsigned char *Channel,
                                          unsigned char *TargetID)
    returns true on success and false on failure.
  */
  
 -static boolean DAC960_ParseLogicalDrive(DAC960_Controller_T *Controller,
 +static bool DAC960_ParseLogicalDrive(DAC960_Controller_T *Controller,
                                        char *UserCommandString,
                                        unsigned char *LogicalDriveNumber)
  {
@@@ -5951,7 -5950,7 +5950,7 @@@ static void DAC960_V1_SetDeviceState(DA
    Controllers.
  */
  
 -static boolean DAC960_V1_ExecuteUserCommand(DAC960_Controller_T *Controller,
 +static bool DAC960_V1_ExecuteUserCommand(DAC960_Controller_T *Controller,
                                            unsigned char *UserCommand)
  {
    DAC960_Command_T *Command;
@@@ -6166,7 -6165,7 +6165,7 @@@ failure
    on failure.
  */
  
 -static boolean DAC960_V2_TranslatePhysicalDevice(DAC960_Command_T *Command,
 +static bool DAC960_V2_TranslatePhysicalDevice(DAC960_Command_T *Command,
                                                 unsigned char Channel,
                                                 unsigned char TargetID,
                                                 unsigned short
    Controllers.
  */
  
 -static boolean DAC960_V2_ExecuteUserCommand(DAC960_Controller_T *Controller,
 +static bool DAC960_V2_ExecuteUserCommand(DAC960_Controller_T *Controller,
                                            unsigned char *UserCommand)
  {
    DAC960_Command_T *Command;
diff --combined drivers/scsi/53c7xx.c
index 9c37943108792af5723ff0a394dee6888ea26571,b432fd20dad2dc239d3f6045d4c18b303eec3f32..93b41f45638a92411e7719c6c368bbcc7a0d86cf
@@@ -3099,6 -3099,7 +3099,6 @@@ allocate_cmd (Scsi_Cmnd *cmd) 
          real = get_zeroed_page(GFP_ATOMIC);
          if (real == 0)
                return NULL;
 -        memset((void *)real, 0, 4096);
          cache_push(virt_to_phys((void *)real), 4096);
          cache_clear(virt_to_phys((void *)real), 4096);
          kernel_set_cachemode((void *)real, 4096, IOMAP_NOCACHE_SER);
@@@ -4399,7 -4400,7 +4399,7 @@@ abort_connected (struct Scsi_Host *host
   * account the current synchronous offset) 
   */
  
-     sstat = (NCR53c8x0_read8 (SSTAT2_REG);
+     sstat = NCR53c8x0_read8 (SSTAT2_REG);
      offset = OFFSET (sstat & SSTAT2_FF_MASK) >> SSTAT2_FF_SHIFT;
      phase = sstat & SSTAT2_PHASE_MASK;
  
@@@ -5422,7 -5423,7 +5422,7 @@@ insn_to_offset (Scsi_Cmnd *cmd, u32 *in
                     --buffers, offset += segment->length, ++segment)
  #if 0
                    printk("scsi%d: comparing 0x%p to 0x%p\n", 
-                       cmd->device->host->host_no, saved, page_address(segment->page+segment->offset);
+                       cmd->device->host->host_no, saved, page_address(segment->page+segment->offset));
  #else
                    ;
  #endif
diff --combined drivers/scsi/scsi_lib.c
index a1cd6e6a292aa887216837b77b6f2dc744b1a12f,0f9b6c2754177e44026b925440f52cfd85de73ac..9f7482d0b59489e7efccc347a8b7ce33208b4cdb
@@@ -388,9 -388,10 +388,9 @@@ int scsi_execute_async(struct scsi_devi
        int err = 0;
        int write = (data_direction == DMA_TO_DEVICE);
  
 -      sioc = kmem_cache_alloc(scsi_io_context_cache, gfp);
 +      sioc = kmem_cache_zalloc(scsi_io_context_cache, gfp);
        if (!sioc)
                return DRIVER_ERROR << 24;
 -      memset(sioc, 0, sizeof(*sioc));
  
        req = blk_get_request(sdev->request_queue, write, gfp);
        if (!req)
@@@ -1399,7 -1400,7 +1399,7 @@@ static void scsi_softirq_done(struct re
                        scsi_finish_command(cmd);
                        break;
                case NEEDS_RETRY:
-                       scsi_retry_command(cmd);
+                       scsi_queue_insert(cmd, SCSI_MLQUEUE_EH_RETRY);
                        break;
                case ADD_TO_MLQUEUE:
                        scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);
@@@ -2249,6 -2250,8 +2249,8 @@@ void *scsi_kmap_atomic_sg(struct scatte
        size_t sg_len = 0, len_complete = 0;
        struct page *page;
  
+       WARN_ON(!irqs_disabled());
        for (i = 0; i < sg_count; i++) {
                len_complete = sg_len; /* Complete sg-entries */
                sg_len += sg[i].length;
diff --combined include/scsi/libsas.h
index 0689e004a281e3b2fdcc7f8e1d5d6770b9b63180,8516ba68cc959a83a5e09e7a5142d921f3cd2dd9..ad0182ef7809bba62450e4788dfb658fd601ce8d
@@@ -323,12 -323,20 +323,20 @@@ struct sas_ha_event 
        struct sas_ha_struct *ha;
  };
  
+ enum sas_ha_state {
+       SAS_HA_REGISTERED,
+       SAS_HA_UNREGISTERED
+ };
  struct sas_ha_struct {
  /* private: */
        spinlock_t       event_lock;
        struct sas_ha_event ha_events[HA_NUM_EVENTS];
        unsigned long    pending;
  
+       enum sas_ha_state state;
+       spinlock_t        state_lock;
        struct scsi_core core;
  
  /* public: */
@@@ -553,14 -561,16 +561,15 @@@ struct sas_task 
  #define SAS_TASK_STATE_PENDING      1
  #define SAS_TASK_STATE_DONE         2
  #define SAS_TASK_STATE_ABORTED      4
- #define SAS_TASK_INITIATOR_ABORTED  8
+ #define SAS_TASK_NEED_DEV_RESET     8
+ #define SAS_TASK_AT_INITIATOR       16
  
  static inline struct sas_task *sas_alloc_task(gfp_t flags)
  {
        extern struct kmem_cache *sas_task_cache;
 -      struct sas_task *task = kmem_cache_alloc(sas_task_cache, flags);
 +      struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags);
  
        if (task) {
 -              memset(task, 0, sizeof(*task));
                INIT_LIST_HEAD(&task->list);
                spin_lock_init(&task->task_state_lock);
                task->task_state_flags = SAS_TASK_STATE_PENDING;
@@@ -612,6 -622,9 +621,9 @@@ struct sas_domain_function_template 
  extern int sas_register_ha(struct sas_ha_struct *);
  extern int sas_unregister_ha(struct sas_ha_struct *);
  
+ int sas_set_phy_speed(struct sas_phy *phy,
+                     struct sas_phy_linkrates *rates);
+ int sas_phy_enable(struct sas_phy *phy, int enabled);
  int sas_phy_reset(struct sas_phy *phy, int hard_reset);
  extern int sas_queuecommand(struct scsi_cmnd *,
                     void (*scsi_done)(struct scsi_cmnd *));
@@@ -645,6 -658,9 +657,9 @@@ void sas_unregister_dev(struct domain_d
  
  void sas_init_dev(struct domain_device *);
  
- void sas_task_abort(struct work_struct *);
+ void sas_task_abort(struct sas_task *);
+ int __sas_task_abort(struct sas_task *);
+ int sas_eh_device_reset_handler(struct scsi_cmnd *cmd);
+ int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd);
  
  #endif /* _SASLIB_H_ */