1. 20 2月, 2012 6 次提交
  2. 01 11月, 2011 1 次提交
  3. 16 10月, 2011 1 次提交
  4. 03 10月, 2011 7 次提交
    • M
      [SCSI] libsas: fix panic when single phy is disabled on a wide port · a73914c3
      Mark Salyzyn 提交于
      When a wide port is being utilized to a target, if one disables only one
      of the
      phys, we get an OS crash:
      
      BUG: unable to handle kernel NULL pointer dereference at
      0000000000000238
      IP: [<ffffffff814ca9b1>] mutex_lock+0x21/0x50
      PGD 4103f5067 PUD 41dba9067 PMD 0
      Oops: 0002 [#1] SMP
      last sysfs file: /sys/bus/pci/slots/5/address
      CPU 0
      Modules linked in: pm8001(U) ses enclosure fuse nfsd exportfs autofs4
      ipmi_devintf ipmi_si ipmi_msghandler nfs lockd fscache nfs_acl
      auth_rpcgss 8021q fcoe libfcoe garp libfc scsi_transport_fc stp scsi_tgt
      llc sunrpc cpufreq_ondemand acpi_cpufreq freq_table ipv6 sr_mod cdrom
      dm_mirror dm_region_hash dm_log uinput sg i2c_i801 i2c_core iTCO_wdt
      iTCO_vendor_support e1000e mlx4_ib ib_mad ib_core mlx4_en mlx4_core ext3
      jbd mbcache sd_mod crc_t10dif usb_storage ata_generic pata_acpi ata_piix
      libsas(U) scsi_transport_sas dm_mod [last unloaded: pm8001]
      
      Modules linked in: pm8001(U) ses enclosure fuse nfsd exportfs autofs4
      ipmi_devintf ipmi_si ipmi_msghandler nfs lockd fscache nfs_acl
      auth_rpcgss 8021q fcoe libfcoe garp libfc scsi_transport_fc stp scsi_tgt
      llc sunrpc cpufreq_ondemand acpi_cpufreq freq_table ipv6 sr_mod cdrom
      dm_mirror dm_region_hash dm_log uinput sg i2c_i801 i2c_core iTCO_wdt
      iTCO_vendor_support e1000e mlx4_ib ib_mad ib_core mlx4_en mlx4_core ext3
      jbd mbcache sd_mod crc_t10dif usb_storage ata_generic pata_acpi ata_piix
      libsas(U) scsi_transport_sas dm_mod [last unloaded: pm8001]
      Pid: 5146, comm: scsi_wq_5 Not tainted
      2.6.32-71.29.1.el6.lustre.7.x86_64 #1 Storage Server
      RIP: 0010:[<ffffffff814ca9b1>]  [<ffffffff814ca9b1>]
      mutex_lock+0x21/0x50
      RSP: 0018:ffff8803e4e33d30  EFLAGS: 00010246
      RAX: 0000000000000000 RBX: 0000000000000238 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: ffff8803e664c800 RDI: 0000000000000238
      RBP: ffff8803e4e33d40 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
      R13: 0000000000000238 R14: ffff88041acb7200 R15: ffff88041c51ada0
      FS:  0000000000000000(0000) GS:ffff880028200000(0000)
      knlGS:0000000000000000
      CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
      CR2: 0000000000000238 CR3: 0000000410143000 CR4: 00000000000006f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process scsi_wq_5 (pid: 5146, threadinfo ffff8803e4e32000, task
      ffff8803e4e294a0)
      Stack:
       ffff8803e664c800 0000000000000000 ffff8803e4e33d70 ffffffffa001f06e
      <0> ffff8803e4e33d60 ffff88041c51ada0 ffff88041acb7200 ffff88041bc0aa00
      <0> ffff8803e4e33d90 ffffffffa0032b6c 0000000000000014 ffff88041acb7200
      Call Trace:
       [<ffffffffa001f06e>] sas_port_delete_phy+0x2e/0xa0 [scsi_transport_sas]
       [<ffffffffa0032b6c>] sas_unregister_devs_sas_addr+0xac/0xe0 [libsas]
       [<ffffffffa0034914>] sas_ex_revalidate_domain+0x204/0x330 [libsas]
       [<ffffffffa00307f0>] ? sas_revalidate_domain+0x0/0x90 [libsas]
       [<ffffffffa0030855>] sas_revalidate_domain+0x65/0x90 [libsas]
       [<ffffffff8108c7d0>] worker_thread+0x170/0x2a0
       [<ffffffff81091ea0>] ? autoremove_wake_function+0x0/0x40
       [<ffffffff8108c660>] ? worker_thread+0x0/0x2a0
       [<ffffffff81091b36>] kthread+0x96/0xa0
       [<ffffffff810141ca>] child_rip+0xa/0x20
       [<ffffffff81091aa0>] ? kthread+0x0/0xa0
       [<ffffffff810141c0>] ? child_rip+0x0/0x20
      Code: ff ff 85 c0 75 ed eb d6 66 90 55 48 89 e5 48 83 ec 10 48 89 1c 24
      4c 89 64 24 08 0f 1f 44 00 00 48 89 fb e8 92 f4 ff ff 48 89 df <f0> ff
      0f 79 05 e8 25 00 00 00 65 48 8b 04 25 08 cc 00 00 48 2d
      RIP  [<ffffffff814ca9b1>] mutex_lock+0x21/0x50
       RSP <ffff8803e4e33d30>
      CR2: 0000000000000238
      
      The following patch is admittedly a band-aid, and does not solve the
      root cause, but it still is a good candidate for hardening as a pointer
      check before reference.
      Signed-off-by: NMark Salyzyn <mark_salyzyn@us.xyratex.com>
      Tested-by: NJack Wang <jack_wang@usish.com>
      Cc: stable@kernel.org
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      a73914c3
    • D
      [SCSI] isci: export phy events via ->lldd_control_phy() · ac013ed1
      Dan Williams 提交于
      Allow the sas-transport-class to update events for local phys via a new
      PHY_FUNC_GET_EVENTS command to ->lldd_control_phy().  Fixup drivers that
      are not prepared for new enum phy_func values, and unify
      ->lldd_control_phy() error codes.
      
      These are the SAS defined phy events that are reported in a
      smp-report-phy-error-log command:
       * /sys/class/sas_phy/<phyX>/invalid_dword_count
       * /sys/class/sas_phy/<phyX>/running_disparity_error_count
       * /sys/class/sas_phy/<phyX>/loss_of_dword_sync_count
       * /sys/class/sas_phy/<phyX>/phy_reset_problem_count
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      ac013ed1
    • D
      [SCSI] isci: atapi support · b50102d3
      Dan Williams 提交于
      Based on original implementation from Jiangbi Liu and Maciej Trela.
      
      ATAPI transfers happen in two-to-three stages.  The two stage atapi
      commands are those that include a dma data transfer.  The data transfer
      portion of these operations is handled by the hardware packet-dma
      acceleration.  The three-stage commands do not have a data transfer and
      are handled without hardware assistance in raw frame mode.
      
      stage1: transmit host-to-device fis to notify the device of an incoming
      atapi cdb.  Upon reception of the pio-setup-fis repost the task_context
      to perform the dma transfer of the cdb+data (go to stage3), or repost
      the task_context to transmit the cdb as a raw frame (go to stage 2).
      
      stage2: wait for hardware notification of the cdb transmission and then
      go to stage 3.
      
      stage3: wait for the arrival of the terminating device-to-host fis and
      terminate the command.
      
      To keep the implementation simple we only support ATAPI packet-dma
      protocol (for commands with data) to avoid needing to handle the data
      transfer manually (like we do for SATA-PIO).  This may affect
      compatibility for a small number of devices (see
      ATA_HORKAGE_ATAPI_MOD16_DMA).
      
      If the data-transfer underruns, or encounters an error the
      device-to-host fis is expected to arrive in the unsolicited frame queue
      to pass to libata for disposition.  However, in the DONE_UNEXP_FIS (data
      underrun) case it appears we need to craft a response.  In the
      DONE_REG_ERR case we do receive the UF and propagate it to libsas.
      Signed-off-by: NMaciej Trela <maciej.trela@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      b50102d3
    • J
      [SCSI] libsas: set sas_address and device type of rphy · bb041a0e
      Jack Wang 提交于
      Libsas forget to set the sas_address and device type of rphy lead to file
      under /sys/class/sas_x show wrong value, fix that.
      Signed-off-by: NJack Wang <jack_wang@usish.com>
      Tested-by: NCrystal Yu <crystal_yu@usish.com>
      Cc: stable@kernel.org
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      bb041a0e
    • D
      [SCSI] libsas: dynamic queue depth · 97a1420d
      Dan Williams 提交于
      The queue-depth for libsas-attached devices initializes to 32 and can
      only be increased manually via sysfs to a max of 64, while mpt2sas
      attached devices initialize to 254 and dynamically float via the
      midlayer ->change_queue_depth interface.
      
      No performance regression was observed with this change on the isci
      driver.
      Tested-by: NDave Jiang <dave.jiang@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      97a1420d
    • D
      [SCSI] libsas,libata: fix ->change_queue_{depth|type} for sata devices · f6e67035
      Dan Williams 提交于
      Pass queue_depth change requests to libata, and prevent queue_type
      changes for ATA devices.
      
      Otherwise:
      1/ we do not honor the libata specific restrictions on the queue depth
      2/ libsas drivers that do not set sdev->tagged_supported are unable to
         change the queue_depth of ata devices via sysfs
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Acked-by: NJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      f6e67035
    • L
      [SCSI] libsas: Allow expander T-T attachments · ffaac8f4
      Luben Tuikov 提交于
      Allow expander table-to-table attachments for
      expanders that support it.
      Signed-off-by: NLuben Tuikov <ltuikov@yahoo.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      ffaac8f4
  5. 22 9月, 2011 2 次提交
    • D
      [SCSI] libsas: sgpio write support · 8ec6552f
      Dan Williams 提交于
      Add SFF-8485 v0.7 / SAS-1 smp-write-gpio register support to libsas.
      Defer SAS-2 support unless/until it defines an sgpio interface.
      
      Minimum implementation needed to get the lights blinking.
      try_test_sas_gpio_gp_bit() provides a common method to parse the
      incoming write data (raw bitstream), and the to_sas_gpio_gp_bit() helper
      routine can be used as a basis for the set/clear operations for the
      'read' implementation.  Host implementations parse as many bits
      (ODx.[012]) as are locally supported and report the number of registers
      successfully written.  If the submitted data overruns the internal
      number of registers available report the write as a success with the
      number of bytes remaining reported in ->resid_len.
      
      Example (assuming an active backplane) set the "identify" pattern for
      the first 21 devices:
      
      smp_write_gpio --count=2 --data=92,49,24,92,24,92,49,24 -t 4 --index=1 /dev/bsg/sas_hostX
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      8ec6552f
    • M
      [SCSI] libsas: fix failure to revalidate domain for anything but the first expander child. · 24926dad
      Mark Salyzyn 提交于
      In an enclosure model where there are chaining expanders to a large body
      of storage, it was discovered that libsas, responding to a broadcast
      event change, would only revalidate the domain of first child expander
      in the list.
      
      The issue is that the pointer value to the discovered source device was
      used to break out of the loop, rather than the content of the pointer.
      
      This still remains non-compliant as the revalidate domain code is
      supposed to loop through all child expanders, and not stop at the first
      one it finds that reports a change count. However, the design of this
      routine does not allow multiple device discoveries and that would be a
      more complicated set of patches reserved for another day. We are fixing
      the glaring bug rather than refactoring the code.
      Signed-off-by: NMark Salyzyn <msalyzyn@us.xyratex.com>
      Cc: stable@kernel.org
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      24926dad
  6. 31 8月, 2011 3 次提交
  7. 27 8月, 2011 1 次提交
  8. 27 7月, 2011 1 次提交
  9. 27 5月, 2011 3 次提交
    • D
      [SCSI] libsas: Add option for SATA soft reset · 1ca1e43e
      Dave Jiang 提交于
      This allows a libsas driver to optionally provide a soft reset handler
      for libata to drive.  The isci driver allows software to control the
      assertion/deassertion of SRST.
      
      [jejb: checkpatch.pl fixes]
      Signed-off-by: NDave Jiang <dave.jiang@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <jbottomley@parallels.com>
      1ca1e43e
    • D
      [SCSI] libsas: check dev->gone before submitting sata i/o · 3673f4bf
      Dan Williams 提交于
      Head off doomed-to-fail i/o in sas_queuecommand before sending it down
      the ata path.
      
      Before:
      sd 7:0:0:0: [sdd] Synchronizing SCSI cache
      ata8: no sense translation for status: 0x00
      ata8: translated ATA stat/err 0x00/00 to SCSI SK/ASC/ASCQ 0xb/00/00
      ata8.00: device reported invalid CHS sector 0
      ata8: status=0x00 { }
      ata8: no sense translation for status: 0x00
      ata8: translated ATA stat/err 0x00/00 to SCSI SK/ASC/ASCQ 0xb/00/00
      ata8.00: device reported invalid CHS sector 0
      ata8: status=0x00 { }
      ata8: no sense translation for status: 0x00
      ata8: translated ATA stat/err 0x00/00 to SCSI SK/ASC/ASCQ 0xb/00/00
      ata8.00: device reported invalid CHS sector 0
      ata8: status=0x00 { }
      sd 7:0:0:0: [sdd]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
      sd 7:0:0:0: [sdd]  Sense Key : Aborted Command [current] [descriptor]
      sd 7:0:0:0: [sdd]  Add. Sense: No additional sense information
      sd 7:0:0:0: [sdd] Stopping disk
      
      After:
      sd 9:0:0:0: [sdd] Synchronizing SCSI cache
      sd 9:0:0:0: [sdd]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
      sd 9:0:0:0: [sdd] Stopping disk
      sd 9:0:0:0: [sdd] START_STOP FAILED
      sd 9:0:0:0: [sdd]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
      
      This is a cosmetic change as sata i/o can still leak to a gone device,
      but this addresses the nominal hotplug case when releasing the target.
      Acked-by: NJack Wang <jack_wang@usish.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <jbottomley@parallels.com>
      3673f4bf
    • D
      [SCSI] libsas: fix/amend device gone notification in sas_deform_port() · 90f1e10d
      Dan Williams 提交于
      Commit 56dd2c06 "libsas: Don't issue commands to devices that have been
      hot-removed" edited Darrick's original patch to remove setting 'gone' in
      the sas_deform_port() path because that prevented scsi sync cache
      commands from being issued when the driver was unloaded.  However, this
      allows true device gone notifications (as signaled port phy events) to
      trigger sync cache commands to devices that are known to be unreachable.
      
      Teach libsas which sas_deform_port() invocations are likely device gone
      events.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <jbottomley@parallels.com>
      90f1e10d
  10. 25 5月, 2011 1 次提交
  11. 31 3月, 2011 1 次提交
  12. 17 3月, 2011 1 次提交
  13. 15 3月, 2011 1 次提交
    • J
      [SCSI] libsas: fix ata list corruption issue · a82058a7
      James Bottomley 提交于
      I think this stems from a misunderstanding of how the ata error handler
      works.  ata_scsi_cmd_error_handler() gets called with a passed in list
      of commands to handle.  However, that list may still not be empty when
      it exits.  The command ata_scsi_port_error_handler() must be called
      (which takes no list) before the list will be completely emptied.  This
      bites the sas error handler because the two are called from different
      functions and the original list has gone out of scope before
      ata_scsi_port_error_handler() is called. leading to some commands
      dangling on bare stack, which is a potential memory corruption issue.
      Fix this by manually deleting all outstanding commands from the on-stack
      list before it goes out of scope.
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      a82058a7
  14. 02 3月, 2011 5 次提交
  15. 01 3月, 2011 1 次提交
  16. 14 2月, 2011 1 次提交
    • J
      [SCSI] libsas: convert to libata new error handler · c299190b
      James Bottomley 提交于
      The conversion is quite complex given that the libata new error
      handler has to be hooked into the current libsas timeout and error
      handling.  The way this is done is to process all the failed commands
      via libsas first, but if they have no underlying sas task (and they're
      on a sata device) assume they are destined for the libata error
      handler and send them accordingly.
      
      Finally, activate the port recovery of the libata error handler for
      each port known to the host.  This is somewhat suboptimal, since that
      port may not need recovering, but given the current architecture of
      the libata error handler, it's the only way; and the spurious
      activation is harmless.
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      c299190b
  17. 25 1月, 2011 4 次提交