1. 24 3月, 2011 1 次提交
    • K
      [SCSI] ses: Avoid kernel panic when lun 0 is not mapped · d1e12de8
      Krishnasamy, Somasundaram 提交于
      During device discovery, scsi mid layer sends INQUIRY command to LUN
      0. If the LUN 0 is not mapped to host, it creates a temporary
      scsi_device with LUN id 0 and sends REPORT_LUNS command to it. After
      the REPORT_LUNS succeeds, it walks through the LUN table and adds each
      LUN found to sysfs. At the end of REPORT_LUNS lun table scan, it will
      delete the temporary scsi_device of LUN 0.
      
      When scsi devices are added to sysfs, it calls add_dev function of all
      the registered class interfaces. If ses driver has been registered,
      ses_intf_add() of ses module will be called. This function calls
      scsi_device_enclosure() to check the inquiry data for EncServ
      bit. Since inquiry was not allocated for temporary LUN 0 scsi_device,
      it will cause NULL pointer exception.
      
      To fix the problem, sdev->inquiry is checked for NULL before reading it.
      Signed-off-by: NSomasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
      Signed-off-by: NBabu Moger <babu.moger@lsi.com>
      Cc: stable@kernel.org
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      d1e12de8
  2. 02 3月, 2011 1 次提交
    • J
      libsas: convert to libata new error handler · 00dd4998
      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>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      00dd4998
  3. 01 3月, 2011 2 次提交
  4. 26 2月, 2011 1 次提交
  5. 25 2月, 2011 5 次提交
  6. 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
  7. 13 2月, 2011 9 次提交
  8. 25 1月, 2011 2 次提交
  9. 31 12月, 2010 2 次提交
  10. 22 12月, 2010 6 次提交
  11. 17 12月, 2010 1 次提交
    • T
      sr: implement sr_check_events() · 93aae17a
      Tejun Heo 提交于
      Replace sr_media_change() with sr_check_events().  It normally only
      uses GET_EVENT_STATUS_NOTIFICATION to check both media change and
      eject request.  If @clearing includes DISK_EVENT_MEDIA_CHANGE, it
      issues TUR and compares whether media presence has changed.  The SCSI
      specific media change uevent is kept for compatibility.
      
      sr_media_change() was doing both media change check and revalidation.
      The revalidation part is split into sr_block_revalidate_disk().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      93aae17a
  12. 17 11月, 2010 1 次提交
    • J
      SCSI host lock push-down · f281233d
      Jeff Garzik 提交于
      Move the mid-layer's ->queuecommand() invocation from being locked
      with the host lock to being unlocked to facilitate speeding up the
      critical path for drivers who don't need this lock taken anyway.
      
      The patch below presents a simple SCSI host lock push-down as an
      equivalent transformation.  No locking or other behavior should change
      with this patch.  All existing bugs and locking orders are preserved.
      
      Additionally, add one parameter to queuecommand,
      	struct Scsi_Host *
      and remove one parameter from queuecommand,
      	void (*done)(struct scsi_cmnd *)
      
      Scsi_Host* is a convenient pointer that most host drivers need anyway,
      and 'done' is redundant to struct scsi_cmnd->scsi_done.
      
      Minimal code disturbance was attempted with this change.  Most drivers
      needed only two one-line modifications for their host lock push-down.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      Acked-by: NJames Bottomley <James.Bottomley@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f281233d
  13. 02 11月, 2010 1 次提交
  14. 26 10月, 2010 3 次提交
    • B
      [SCSI] libosd: write/read_sg_kern API · 6dd1d8a7
      Boaz Harrosh 提交于
      This is a trivial addition to the SG API that can receive kernel
      pointers. It is only used by the out-of-tree test module. So
      it's immediate need is questionable. For maintenance ease it might
      just get in, as it's very small.
      
      John.
      do you need this in the Kernel, or is it only for osd_ktest.ko?
      Signed-off-by: NJohn A. Chandy <john.chandy@uconn.edu>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      6dd1d8a7
    • B
      [SCSI] libosd: Support for scatter gather write/read commands · e96e72c4
      Boaz Harrosh 提交于
      This patch adds the Scatter-Gather (sg) API to libosd.
      Scatter-gather enables a write/read of multiple none-contiguous
      areas of an object, in a single call. The extents may overlap
      and/or be in any order.
      
      The Scatter-Gather list is sent to the target in what is called
      a "cdb continuation segment". This is yet another possible segment
      in the osd-out-buffer. It is unlike all other segments in that it
      sits before the actual "data" segment (which until now was always
      first), and that it is signed by itself and not part of the data
      buffer. This is because the cdb-continuation-segment is considered
      a spill-over of the CDB data, and is therefor signed under
      OSD_SEC_CAPKEY and higher.
      
      TODO: A new osd_finalize_request_ex version should be supplied so
      the @caps received on the network also contains a size parameter
      and can be spilled over into the "cdb continuation segment".
      
      Thanks to John Chandy <john.chandy@uconn.edu> for the original
      code, and investigations. And the implementation of SG support
      in the osd-target.
      Original-coded-by: NJohn Chandy <john.chandy@uconn.edu>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      e96e72c4
    • B
      [SCSI] libfc: Do not let disc work cancel itself · c531b9b4
      Bhanu Prakash Gollapudi 提交于
      When number of NPIV ports created are greater than the xids
      allocated per pool -- for eg., creating 255 NPIV ports on a
      system with nr_cpu_ids of 32, with each pool containing 128
      xids -- and then generating a link event - for eg.,
      shutdown/no shutdown -- on the switch port causes the hang
      with the following stack trace.
      
      Call Trace:
      schedule_timeout+0x19d/0x230
      wait_for_common+0xc0/0x170
      __cancel_work_timer+0xcf/0x1b0
      fc_disc_stop+0x16/0x30 [libfc]
      fc_lport_reset_locked+0x47/0x90 [libfc]
      fc_lport_enter_reset+0x67/0xe0 [libfc]
      fc_lport_disc_callback+0xbc/0xe0 [libfc]
      fc_disc_done+0xa8/0xf0 [libfc]
      fc_disc_timeout+0x29/0x40 [libfc]
      run_workqueue+0xb8/0x140
      worker_thread+0x96/0x110
      kthread+0x96/0xa0
      child_rip+0xa/0x20
      
      Fix is to not cancel the disc_work if discovery is already
      stopped, thus allowing lport state machine to restart and try
      discovery again.
      Signed-off-by: NBhanu Prakash Gollapudi <bprakash@broadcom.com>
      Acked-by: NJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      c531b9b4
  15. 23 10月, 2010 4 次提交
    • D
      IB/srp: Implement SRP_CRED_REQ and SRP_AER_REQ · bb12588a
      David Dillow 提交于
      This patch adds support for SRP_CRED_REQ to avoid a lockup by targets
      that use that mechanism to return credits to the initiator. This
      prevents a lockup observed in the field where we would never add the
      credits from the SRP_CRED_REQ to our current count, and would therefore
      never send another command to the target.
      
      Minimal support for SRP_AER_REQ is also added, as these messages can
      also be used to convey additional credits to the initiator.
      
      Based upon extensive debugging and code by Bart Van Assche and a bug
      report by Chris Worley.
      Signed-off-by: NDavid Dillow <dillowda@ornl.gov>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      bb12588a
    • M
      USB: gadget: storage: reuse definitions from scsi.h header file · 0a6a717c
      Michal Nazarewicz 提交于
      This commit changes storage_common.h, file_storage.c and
      f_mass_storage.c to use definitions of SCSI commands from
      scsi/scsi.h file instead of redefining the commands in
      storage_common.c.
      
      scsi/scsi.h header file was missing READ_FORMAT_CAPACITIES and
      READ_HEADER so this commit also add those to the header.
      Signed-off-by: NMichal Nazarewicz <mina86@mina86.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: James Bottomley <James.Bottomley@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0a6a717c
    • H
      scsi/sd: add a no_read_capacity_16 scsi_device flag · 5ce524bd
      Hans de Goede 提交于
      I seem to have a knack for digging up buggy usb devices which don't work
      with Linux, and I'm crazy enough to try to make them work.  So this time a
      friend of mine asked me to get an mp4 player (an mp3 player which can play
      videos on a small screen) to work with Linux.
      
      It is based on the well known rockbox chipset for which we already have an
      unusual devs entries to work around some of its bugs.  But this model
      comes with an additional twist.
      
      This model chokes on read_capacity_16 calls.  Now normally we don't make
      those calls, but this model comes with an sdcard slot and when there is no
      card in there (and shipped from the factory there is none), it reports a
      size of 0.  However this time the programmers actually got the
      read_capacity_10 response right!  So they substract one from the size as
      stored internally in the mp3 player before reporting it back, resulting in
      an answer of ...  0xffffffff sectors, causing sd.c to try a
      read_capacity_16, on which the device crashes.
      
      This patch adds a flag to scsi_device to indicate that a a device cannot
      handle read_capacity_16, and when this flag is set if a device reports an
      lba of 0xffffffff as answer to a read_capacity_10, assumes it tries to
      report a size of 0.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5ce524bd
    • H
      scsi/sr: add no_read_disc_info scsi_device flag · 8e04d805
      Hans de Goede 提交于
      Some USB devices emulate a usb-mass-storage attached (scsi) cdrom device,
      usually this fake cdrom contains the windows software for the device.
      While working on supporting Appotech ax3003 based photoframes, which do
      this I discovered that they will go of into lala land when ever they see a
      READ_DISC_INFO scsi command.
      
      Thus this patch adds a scsi_device flag (which can then be set by the
      usb-storage driver through an unsual-devs entry), to indicate this, and
      makes the sr driver honor this flag.
      
      I know this sucks, but as discussed on linux-scsi list there is no other
      way to make this device work properly.
      
      Looking at usb traces made under windows, windows never sends a
      READ_DISC_INFO during normal interactions with a usb cdrom device.  So as
      this cdrom emulation thingie becomes more common we might see more of this
      problem.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8e04d805