1. 12 2月, 2013 1 次提交
  2. 29 1月, 2013 2 次提交
    • N
      fcoe: Fix deadlock while deleting FCoE interface with NPIV ports · 94aa743a
      Neerav Parikh 提交于
      This patch fixes following deadlock caused by destroying of
      an FCoE interface with active NPIV ports on that interface.
      
          Call Trace:
          [<ffffffff814b7e88>] schedule+0x64/0x66
          [<ffffffff814b6b4f>] schedule_timeout+0x36/0xe3
          [<ffffffff81070c55>] ? update_curr+0xd6/0x110
          [<ffffffff81071f6b>] ? hrtick_update+0x1b/0x4d
          [<ffffffff81072405>] ? dequeue_task_fair+0x1ca/0x1d9
          [<ffffffff8106a369>] ? need_resched+0x1e/0x28
          [<ffffffff814b7d14>] wait_for_common+0x9b/0xf1
          [<ffffffff8106e7be>] ? try_to_wake_up+0x1e0/0x1e0
          [<ffffffff814b7e22>] wait_for_completion+0x1d/0x1f
          [<ffffffff8105ae82>] flush_workqueue+0x116/0x2a1
          [<ffffffff8105b357>] drain_workqueue+0x66/0x14c
          [<ffffffff8105b8ef>] destroy_workqueue+0x1a/0xcf
          [<ffffffffa009211e>] fc_remove_host+0x154/0x17f [scsi_transport_fc]
          [<ffffffffa00edbb8>] fcoe_if_destroy+0x184/0x1c9 [fcoe]
          [<ffffffffa00edc28>] fcoe_destroy_work+0x2b/0x44 [fcoe]
          [<ffffffff8105a82a>] process_one_work+0x1a8/0x2a4
          [<ffffffffa00edbfd>] ? fcoe_if_destroy+0x1c9/0x1c9 [fcoe]
          [<ffffffff8105c396>] worker_thread+0x1db/0x268
          [<ffffffff810604a3>] ? wake_up_bit+0x2a/0x2a
          [<ffffffff8105c1bb>] ? manage_workers.clone.16+0x1f6/0x1f6
          [<ffffffff8105ffd6>] kthread+0x6f/0x77
          [<ffffffff814c0304>] kernel_thread_helper+0x4/0x10
          [<ffffffff8105ff67>] ? kthread_freezable_should_stop+0x4b/0x4b
      
          Call Trace:
          [<ffffffff814b7e88>] schedule+0x64/0x66
          [<ffffffff814b8041>] schedule_preempt_disabled+0xe/0x10
          [<ffffffff814b70a1>] __mutex_lock_common.clone.5+0x117/0x17a
          [<ffffffff814b7117>] __mutex_lock_slowpath+0x13/0x15
          [<ffffffff814b6f76>] mutex_lock+0x23/0x37
          [<ffffffff8125b890>] ? list_del+0x11/0x30
          [<ffffffffa00edc84>] fcoe_vport_destroy+0x43/0x5f [fcoe]
          [<ffffffffa009130a>] fc_vport_terminate+0x48/0x110 [scsi_transport_fc]
          [<ffffffffa00913ef>] fc_vport_sched_delete+0x1d/0x79 [scsi_transport_fc]
          [<ffffffff8105a82a>] process_one_work+0x1a8/0x2a4
          [<ffffffffa00913d2>] ? fc_vport_terminate+0x110/0x110 [scsi_transport_fc]
          [<ffffffff8105c396>] worker_thread+0x1db/0x268
          [<ffffffff8105c1bb>] ? manage_workers.clone.16+0x1f6/0x1f6
          [<ffffffff8105ffd6>] kthread+0x6f/0x77
          [<ffffffff814c0304>] kernel_thread_helper+0x4/0x10
          [<ffffffff8105ff67>] ? kthread_freezable_should_stop+0x4b/0x4b
          [<ffffffff814c0300>] ? gs_change+0x13/0x13
      
      A prior attempt to fix this issue is posted here:
      http://lists.open-fcoe.org/pipermail/devel/2012-October/012318.html
      or
      http://article.gmane.org/gmane.linux.scsi.open-fcoe.devel/11924
      
      Based on feedback and discussion with Neil Horman it seems that the above patch
      may have a case where the fcoe_vport_destroy() and fcoe_destroy_work() can
      race; hence that patch has been withdrawn with this patch that is trying to
      solve the same problem in a different way.
      
      In the current approach instead of removing the fcoe_config_mutex from the
      vport_delete callback function; I've chosen to delete all the NPIV ports first
      on a given root lport before continuing with the removal of the root lport.
      Signed-off-by: NNeerav Parikh <Neerav.Parikh@intel.com>
      Tested-by: NMarcus Dennis <marcusx.e.dennis@intel.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      94aa743a
    • N
      fcoe: close race on link speed detection in fcoe code · f9184df3
      Neil Horman 提交于
      When creating an fcoe interfce, we call fcoe_link_speed_update before we add the
      lports fcoe interface to the fc_hostlist.  Since network device events like
      NETDEV_CHANGE are only processed if an fcoe interface is found with an
      underlying netdev that matches the netdev of the event.  Since this processing
      in fcoe_device_notification is how link_speed changes get communicated to the
      libfc  code (via fcoe_link_speed_update), we have a race condition - if a
      NETDEV_CHANGE event is sent after the call to fcoe_link_speed_update in
      fcoe_netdev_config, but before we add the interface to the fc_hostlist, we will
      loose the event and attributes like /sys/class/fc_host/hostX/speed will not get
      updated properly.
      
      Fix this by moving the add to the fc_hostlist above the serialized call to
      fcoe_netdev_config, ensuring that we catch netdev envents before we make a
      direct call to fcoe_link_speed_update.
      
      Also use this opportunity to clean up access to the fc_hostlist a bit by
      creating a fcoe_hostlist_del accessor and replacing the cleanup in fcoe_exit to
      use it properly.
      
      Tested by myself successfully
      
      [ Comment over 80 chars broken into multi-line by Robert Love to
        satisfy checkpatch.pl ]
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      Reviewed-by: NYi Zou <yi.zou@intel.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      f9184df3
  3. 15 12月, 2012 12 次提交
  4. 05 12月, 2012 2 次提交
    • R
      libfcoe: Save some memory and optimize name lookups · ef60f674
      Robert Love 提交于
      Instead of creating a structure with an enum and a pointer
      to a string, simply allocate an array of strings and use
      the enum values for the indicies.
      
      This means that we do not need to iterate through the list
      of entries when looking up a string name by its enum key.
      
      This will also help with a latter patch that will add
      more fcoe_sysfs attributes that will also use the
      fcoe_enum_name_search macro. One attribute will also do
      a reverse lookup which requires less code when the
      enum-to-string mappings are organized as this patch makes
      them to be.
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      ef60f674
    • V
      libfc: fix REC handling · 5b97fabd
      Vasu Dev 提交于
      Currently fc_fcp_timeout doesn't check FC_RP_FLAGS_REC_SUPPORTED
      flag first, this prevents REC request ever going out at all
      to the target having REC support. So this patches fixes the
      fc_fcp_timeout by checking FC_RP_FLAGS_REC_SUPPORTED flag first.
      
      The changed order won't cause any issue during clearing
      FC_RP_FLAGS_REC_SUPPORTED on failed IO with target not supporting
      FC_RP_FLAGS_REC_SUPPORTED, since retry on failed IO would succeed.
      Signed-off-by: NVasu Dev <vasu.dev@intel.com>
      Tested-by: NRoss Brattain <ross.b.brattain@intel.com>
      Signed-off-by: NRobert Love <robert.w.love@intel.com>
      5b97fabd
  5. 14 11月, 2012 3 次提交
  6. 13 11月, 2012 1 次提交
  7. 29 10月, 2012 1 次提交
    • D
      qlogicpti: Fix build warning. · f7e8d9f8
      David S. Miller 提交于
      The build warns:
      
      drivers/scsi/qlogicpti.c: In function 'qpti_sbus_probe':
      drivers/scsi/qlogicpti.c:1316:45: warning: passing argument 1 of 'scsi_host_alloc' discards 'const' qualifier from pointer target type [enabled by default]
      include/scsi/scsi_host.h:778:26: note: expected 'struct scsi_host_template *' but argument is of type 'const struct scsi_host_template *'
      
      The problem is that of_device_id->data is a const void pointer.
      
      This is pretty silly in this specific instance, because for all
      matched device IDs we set match->data to the same value,
      &qpti_template.
      
      So just use that directly instead of the unnecessary and improperly
      typed abstraction.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f7e8d9f8
  8. 27 10月, 2012 3 次提交
    • R
      qla2xxx: Update target lookup session tables when a target session changes · c8292d1d
      Roland Dreier 提交于
      It is possible for the target code to change the loop_id or s_id of a
      target session in reaction to an FC fabric change.  However, the
      session structures are stored in tables that are indexed by these two
      keys, and if we just change the session structure but leave the
      pointers to it in the old places in the table, havoc can ensue.  For
      example, a new session might come along that should go in the old slot
      in the table and overwrite the old session pointer.
      
      To handle this, add a new tgt_ops->update_sess() method that also
      updates the "by loop_id" and "by s_id" lookup tables when a session
      changes, so that the keys where a session pointer is stored in these
      tables always matches the keys in the session structure itself.
      
      (nab: Drop unnecessary double inversion with FCF_CONF_COMP_SUPPORTED
            usage)
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Cc: Chad Dupuis <chad.dupuis@qlogic.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c8292d1d
    • R
      tcm_qla2xxx: Format VPD page 83h SCSI name string according to SPC · c046aa0f
      Roland Dreier 提交于
      My draft of SPC-4 says the following about the SCSI name string in
      inquiry VPD page 83h:
      
          The SCSI NAME STRING field starts with either:
      
          a) the four UTF-8 characters 'eui.' concatenated with 16, 24, or
             32 hexadecimal digits (i.e., the UTF-8 characters 0 through 9
             and A through F) for an EUI-64 based identifier (see
             7.8.6.5). The first hexadecimal digit shall be the most
             significant four bits of the first byte (i.e., most significant
             byte) of the EUI-64 based identifier;
          b) the four UTF-8 characters 'naa.' concatenated with 16 or 32
             hexadecimal digits for an NAA identifier (see 7.8.6.6). The
             first hexadecimal digit shall be the most significant four bits
             of the first byte (i.e., most significant byte) of the NAA
             identifier; or
          c) the four UTF-8 characters 'iqn.' concatenated with an iSCSI
             Name for an iSCSI-name based identifier (see iSCSI).
      
      However, the .tpg_get_wwn method for tcm_qla2xxx formats the WWN so
      the SCSI name string looks like "52:4a:93:7d:24:5f:b2:12,t,0x0001".
      This patch corrects the code so that VPD 83h gives a SPC-compliant
      SCSI name string like "naa.524a937d245fb212,t,0x0001" while leavig
      other uses alone (so configfs will still work with ':' separated WWNs).
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Cc: Chad Dupuis <chad.dupuis@qlogic.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c046aa0f
    • N
      qla2xxx: Add missing ->vport_slock while calling qlt_update_vp_map · 29c08cda
      Nicholas Bellinger 提交于
      All other callers of qlt_update_vp_map() already hold ->vport_slock
      while updating the vp target map, so go ahead and add the missing
      ->vport_slock within qla24xx_disable_vp() code.
      
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Cc: Chad Dupuis <chad.dupuis@qlogic.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Roland Dreier <roland@purestorage.com>
      Acked-by: NSaurav Kashyap <saurav.kashyap@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      29c08cda
  9. 10 10月, 2012 2 次提交
    • A
      SCSI: ARM: make fas216_dumpinfo function conditional · 48968177
      Arnd Bergmann 提交于
      The fas216_dumpinfo function is only used by __fas216_checkmagic,
      which is conditionally compiled, so we should put both functions
      inside of the same #ifdef.
      
      Without this patch, building rpc_defconfig results in:
      
      drivers/scsi/arm/fas216.c:182:13: warning: 'fas216_dumpinfo' defined but not used [-Wunused-function]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-scsi@vger.kernel.org
      48968177
    • A
      SCSI: ARM: ncr5380/oak uses no interrupts · ea065f13
      Arnd Bergmann 提交于
      The ncr5380 driver is included by multiple board specific
      drivers, which may or may not use the interrupt handler.
      The oak variant doesn't, and should set the DONT_USE_INTR
      macro.
      
      Without this patch, building rpc_defconfig results in:
      
      drivers/scsi/arm/../NCR5380.c:1160:20: warning: 'oakscsi_intr' defined but not used [-Wunused-function]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-scsi@vger.kernel.org
      ea065f13
  10. 09 10月, 2012 13 次提交