1. 26 Oct, 2010 1 commit
    • Boaz Harrosh's avatar
      [SCSI] libosd: Support for scatter gather write/read commands · e96e72c4
      Boaz Harrosh authored
      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: default avatarJohn Chandy <john.chandy@uconn.edu>
      Signed-off-by: default avatarBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      e96e72c4
  2. 25 Oct, 2010 1 commit
    • Bhanu Prakash Gollapudi's avatar
      [SCSI] libfc: Do not let disc work cancel itself · c531b9b4
      Bhanu Prakash Gollapudi authored
      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: default avatarBhanu Prakash Gollapudi <bprakash@broadcom.com>
      Acked-by: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      c531b9b4
  3. 22 Oct, 2010 3 commits
    • Michal Nazarewicz's avatar
      USB: gadget: storage: reuse definitions from scsi.h header file · 0a6a717c
      Michal Nazarewicz authored
      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: default avatarMichal Nazarewicz <mina86@mina86.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: James Bottomley <James.Bottomley@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0a6a717c
    • Hans de Goede's avatar
      scsi/sd: add a no_read_capacity_16 scsi_device flag · 5ce524bd
      Hans de Goede authored
      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: default avatarHans 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: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5ce524bd
    • Hans de Goede's avatar
      scsi/sr: add no_read_disc_info scsi_device flag · 8e04d805
      Hans de Goede authored
      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: default avatarHans 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: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8e04d805
  4. 08 Oct, 2010 1 commit
  5. 07 Oct, 2010 1 commit
  6. 10 Sep, 2010 2 commits
    • Martin K. Petersen's avatar
      block/scsi: Provide a limit on the number of integrity segments · 13f05c8d
      Martin K. Petersen authored
      Some controllers have a hardware limit on the number of protection
      information scatter-gather list segments they can handle.
      
      Introduce a max_integrity_segments limit in the block layer and provide
      a new scsi_host_template setting that allows HBA drivers to provide a
      value suitable for the hardware.
      
      Add support for honoring the integrity segment limit when merging both
      bios and requests.
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarJens Axboe <axboe@carl.home.kernel.dk>
      13f05c8d
    • Tejun Heo's avatar
      block: remove spurious uses of REQ_HARDBARRIER · 9cbbdca4
      Tejun Heo authored
      REQ_HARDBARRIER is deprecated.  Remove spurious uses in the following
      users.  Please note that other than osdblk, all other uses were
      already spurious before deprecation.
      
      * osdblk: osdblk_rq_fn() won't receive any request with
        REQ_HARDBARRIER set.  Remove the test for it.
      
      * pktcdvd: use of REQ_HARDBARRIER in pkt_generic_packet() doesn't mean
        anything.  Removed.
      
      * aic7xxx_old: Setting MSG_ORDERED_Q_TAG on REQ_HARDBARRIER is
        spurious.  Removed.
      
      * sas_scsi_host: Setting TASK_ATTR_ORDERED on REQ_HARDBARRIER is
        spurious.  Removed.
      
      * scsi_tcq: The ordered tag path wasn't being used anyway.  Removed.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarBoaz Harrosh <bharrosh@panasas.com>
      Cc: James Bottomley <James.Bottomley@suse.de>
      Cc: Peter Osterlund <petero2@telia.com>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      9cbbdca4
  7. 05 Sep, 2010 1 commit
  8. 11 Aug, 2010 1 commit
  9. 28 Jul, 2010 21 commits
  10. 27 Jul, 2010 4 commits
    • Joe Eykholt's avatar
      [SCSI] libfc: fix indefinite rport restart · f034260d
      Joe Eykholt authored
      Remote ports were restarting indefinitely after getting
      rejects in PRLI.
      
      Fix by adding a counter of restarts and limiting that with
      the port login retry limit as well.
      Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      f034260d
    • Joe Eykholt's avatar
      [SCSI] libfc: Fix remote port restart problem · 4b2164d4
      Joe Eykholt authored
      This patch somewhat combines two fixes to remote port handing in libfc.
      
      The first problem was that rport work could be queued on a deleted
      and freed rport.  This is handled by not resetting rdata->event
      ton NONE if the rdata is about to be deleted.
      
      However, that fix led to the second problem, described by
      Bhanu Gollapudi, as follows:
      > Here is the sequence of events. T1 is first LOGO receive thread, T2 is
      > fc_rport_work() scheduled by T1 and T3 is second LOGO receive thread and
      > T4 is fc_rport_work scheduled by T3.
      >
      > 1. (T1)Received 1st LOGO in state Ready
      > 2. (T1)Delete port & enter to RESTART state.
      > 3. (T1)schdule event_work, since event is RPORT_EV_NONE.
      > 4. (T1)set event = RPORT_EV_LOGO
      > 5. (T1)Enter RESTART state as disc_id is set.
      > 6. (T2)remember to PLOGI, and set event = RPORT_EV_NONE
      > 6. (T3)Received 2nd LOGO
      > 7. (T3)Delete Port & enter to RESTART state.
      > 8. (T3)schedule event_work, since event is RPORT_EV_NONE.
      > 9. (T3)Enter RESTART state as disc_id is set.
      > 9. (T3)set event = RPORT_EV_LOGO
      > 10.(T2)work restart, enter PLOGI state and issues PLOGI
      > 11.(T4)Since state is not RESTART anymore, restart is not set, and the
      > event is not reset to RPORT_EV_NONE. (current event is RPORT_EV_LOGO).
      > 12. Now, PLOGI succeeds and fc_rport_enter_ready() will not schedule
      > event_work, and hence the rport will never be created, eventually losing
      > the target after dev_loss_tmo.
      
      So, the problem here is that we were tracking the desire for
      the rport be restarted by state RESTART, which was otherwise
      equivalent to DELETE.  A contributing factor is that we dropped
      the lock between steps 6 and 10 in thread T2, which allows the
      state to change, and we didn't completely re-evaluate then.
      
      This is hopefully corrected by the following minor redesign:
      
      Simplify the rport restart logic by making the decision to
      restart after deleting the transport rport.  That decision
      is based on a new STARTED flag that indicates fc_rport_login()
      has been called and fc_rport_logoff() has not been called
      since then.  This replaces the need for the RESTART state.
      
      Only restart if the rdata is still in DELETED state
      and only if it still has the STARTED flag set.
      
      Also now, since we clear the event code much later in the
      work thread, allow for the possibility that the rport may
      have become READY again via incoming PLOGI, and if so,
      queue another event to handle that.
      
      In the problem scenario, the second LOGO received will
      cause the LOGO event to occur again.
      Reported-by: default avatarBhanu Gollapudi <bprakash@broadcom.com>
      Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      4b2164d4
    • Bhanu Prakash Gollapudi's avatar
      [SCSI] libfc: Handle unsolicited PRLO request · f8fc6c2c
      Bhanu Prakash Gollapudi authored
      Resubmitting after incorporating Joe's review comment.
      
      Unsolicited PRLO request is now handled by sending LS_ACC,
      and then relogin to the remote port if an N-port login
      session exists for that remote port.
      
      Note that this patch should be applied on top of Joe Eykholt's
      "Fix remote port restart problem" patch.
      Signed-off-by: default avatarBhanu Prakash Gollapudi <bprakash@broadcom.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      f8fc6c2c
    • Joe Eykholt's avatar
      [SCSI] fcoe: clean up TBD comments in FCoE prototype header · 5d4a2e29
      Joe Eykholt authored
      Some old comments in fc_fcoe.h say TBD long after the
      standard has been passed by T11.  Clean them up.
      Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      5d4a2e29
  11. 02 Jun, 2010 1 commit
  12. 16 May, 2010 2 commits
  13. 02 May, 2010 1 commit