1. 24 11月, 2013 1 次提交
    • K
      block: Kill bio_segments()/bi_vcnt usage · 458b76ed
      Kent Overstreet 提交于
      When we start sharing biovecs, keeping bi_vcnt accurate for splits is
      going to be error prone - and unnecessary, if we refactor some code.
      
      So bio_segments() has to go - but most of the existing users just needed
      to know if the bio had multiple segments, which is easier - add a
      bio_multiple_segments() for them.
      
      (Two of the current uses of bio_segments() are going to go away in a
      couple patches, but the current implementation of bio_segments() is
      unsafe as soon as we start doing driver conversions for immutable
      biovecs - so implement a dumb version for bisectability, it'll go away
      in a couple patches)
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
      Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
      Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
      458b76ed
  2. 10 5月, 2013 1 次提交
    • J
      [SCSI] sas: unify the pointlessly separated enums sas_dev_type and sas_device_type · aa9f8328
      James Bottomley 提交于
      These enums have been separate since the dawn of SAS, mainly because the
      latter is a procotol only enum and the former includes additional state
      for libsas.  The dichotomy causes endless confusion about which one you
      should use where and leads to pointless warnings like this:
      
      drivers/scsi/mvsas/mv_sas.c: In function 'mvs_update_phyinfo':
      drivers/scsi/mvsas/mv_sas.c:1162:34: warning: comparison between 'enum sas_device_type' and 'enum sas_dev_type' [-Wenum-compare]
      
      Fix by eliminating one of them.  The one kept is effectively the sas.h
      one, but call it sas_device_type and make sure the enums are all
      properly namespaced with the SAS_ prefix.
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      aa9f8328
  3. 06 4月, 2013 2 次提交
  4. 24 3月, 2013 1 次提交
    • K
      block: Remove some unnecessary bi_vcnt usage · 2f477877
      Kent Overstreet 提交于
      More prep work for immutable bvecs/effecient bio splitting - usage of
      bi_vcnt has to be auditing, so getting rid of all the unnecessary usage
      makes that easier.
      
      Plus, bio_segments() is really what this code wanted, as it respects the
      current value of bi_idx.
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      CC: Jens Axboe <axboe@kernel.dk>
      CC: Eric Moore <Eric.Moore@lsi.com>
      CC: "James E.J. Bottomley" <JBottomley@parallels.com>
      CC: linux-scsi@vger.kernel.org
      2f477877
  5. 19 11月, 2012 1 次提交
  6. 20 7月, 2012 4 次提交
  7. 23 4月, 2012 5 次提交
    • D
      [SCSI] libsas: fix false positive 'device attached' conditions · 7d1d8651
      Dan Williams 提交于
      Normalize phy->attached_sas_addr to return a zero-address in the case
      when device-type == NO_DEVICE or the linkrate is invalid to handle
      expanders that put non-zero sas addresses in the discovery response:
      
       sas: ex 5001b4da000f903f phy02:U:0 attached: 0100000000000000 (no device)
       sas: ex 5001b4da000f903f phy01:U:0 attached: 0100000000000000 (no device)
       sas: ex 5001b4da000f903f phy03:U:0 attached: 0100000000000000 (no device)
       sas: ex 5001b4da000f903f phy00:U:0 attached: 0100000000000000 (no device)
      Reported-by: NAndrzej Jakowski <andrzej.jakowski@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      7d1d8651
    • D
      [SCSI] libsas, libata: fix start of life for a sas ata_port · b2024459
      Dan Williams 提交于
      This changes the ordering of initialization and probing events from:
        1/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
        2/ allocate ata_port and schedule port probe in DISCE_PROBE
      ...to:
        1/ allocate ata_port in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
        2/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
        3/ schedule port probe in DISCE_PROBE
      
      This ordering prevents PHYE_SIGNAL_LOSS_EVENTS from sneaking in to
      destrory ata devices before they have been fully initialized:
      
        BUG: unable to handle kernel paging request at 0000000000003b10
        IP: [<ffffffffa0053d7e>] sas_ata_end_eh+0x12/0x5e [libsas]
        ...
        [<ffffffffa004d1af>] sas_unregister_common_dev+0x78/0xc9 [libsas]
        [<ffffffffa004d4d4>] sas_unregister_dev+0x4f/0xad [libsas]
        [<ffffffffa004d5b1>] sas_unregister_domain_devices+0x7f/0xbf [libsas]
        [<ffffffffa004c487>] sas_deform_port+0x61/0x1b8 [libsas]
        [<ffffffffa004bed0>] sas_phye_loss_of_signal+0x29/0x2b [libsas]
      
      ...and kills the awkward "sata domain_device briefly existing in the
      domain without an ata_port" state.
      Reported-by: NMichal Kosciowski <michal.kosciowski@intel.com>
      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>
      b2024459
    • D
      [SCSI] libsas: fix ata_eh clobbering ex_phys via smp_ata_check_ready · 0f3fce5c
      Dan Williams 提交于
      The check_ready implementation in the expander-attached ata device case
      polls on sas_ex_phy_discover().  The effect is that the ex_phy fields
      (critically ->attached_sas_addr) can change.  When ata_eh ends and
      libsas comes along to revalidate the domain
      sas_unregister_devs_sas_addr() can fail to lookup devices to remove, or
      fail to re-add an ata device that ata_eh marked as disabled.  So change
      the code to skip the sas_address and change count updates when ata_eh is
      active.
      
      Cc: Jack Wang <jack_wang@usish.com>
      Tested-by: NMaciej Patelczyk <maciej.patelczyk@intel.com>
      Tested-by: NBartek Nowakowski <bartek.nowakowski@intel.com>
      Tested-by: NJacek Danecki <jacek.danecki@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      0f3fce5c
    • D
      [SCSI] libsas: unify domain_device sas_rphy lifetimes · 9487669f
      Dan Williams 提交于
      Since the domain_device can out live the scsi_target we need the rphy to
      follow suit otherwise we run into issues like:
      
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
        IP: [<ffffffffa011561b>] sas_ata_printk+0x43/0x6f [libsas]
        PGD 0
        Oops: 0000 [#1] SMP
        CPU 1
        Modules linked in: ses enclosure isci libsas scsi_transport_sas fuse sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf microcode pcspkr igb joydev iTCO_wdt ioatdma iTCO_vendor_support i2c_i801 i2c_core dca wmi hed ipv6 pata_acpi ata_generic [last unloaded: scsi_wait_scan]
      
        Pid: 129, comm: kworker/u:3 Not tainted 3.3.0-rc5-isci+ #1 Intel Corporation SandyBridge Platform/To be filled by O.E.M.
        RIP: 0010:[<ffffffffa011561b>] [<ffffffffa011561b>] sas_ata_printk+0x43/0x6f [libsas]
        RSP: 0018:ffff88042232dd70 EFLAGS: 00010282
        RAX: 0000000000000000 RBX: ffff8804283165b8 RCX: ffff88042232dda0
        RDX: ffff88042232dd78 RSI: ffff8804283165b8 RDI: ffffffffa01188d7
        RBP: ffff88042232ddd0 R08: ffff880388454000 R09: ffff8803edfde1f8
        R10: ffff8803edfde1f8 R11: ffff8803edfde1f8 R12: ffff880428316750
        R13: ffff880388454000 R14: ffff8803f88b31d0 R15: ffff8803f8b21d50
        FS: 0000000000000000(0000) GS:ffff88042ee20000(0000) knlGS:0000000000000000
        CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
        CR2: 0000000000000050 CR3: 0000000001a05000 CR4: 00000000000406e0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
        Process kworker/u:3 (pid: 129, threadinfo ffff88042232c000, task ffff88042230c920)
        Stack:
        0000000000000000 ffff880400000018 ffff88042232dde0 ffff88042232dda0
        ffffffffa01188c4 ffff88042ee93af0 ffff88042232ddb0 ffffffff8100e047
        ffff88042232de10 ffff880420e5a2c8 ffff8803f8b21d50 ffff8803edfde1f8
        Call Trace:
        [<ffffffff8100e047>] ? load_TLS+0xb/0xf
        [<ffffffffa01156ad>] async_sas_ata_eh+0x66/0x95 [libsas]
        [<ffffffff810655e1>] async_run_entry_fn+0x9e/0x131
      Reported-by: NTom Jackson <thomas.p.jackson@intel.com>
      Tested-by: NTom Jackson <thomas.p.jackson@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      9487669f
    • T
      [SCSI] libsas: fix sas_find_bcast_phy() in the presence of 'vacant' phys · 1699490d
      Thomas Jackson 提交于
      If an expander reports 'PHY VACANT' for a phy index prior to the one
      that generated a BCN libsas fails rediscovery.  Since a vacant phy is
      defined as a valid phy index that will never have an attached device
      just continue the search.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NThomas Jackson <thomas.p.jackson@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      1699490d
  8. 01 3月, 2012 9 次提交
  9. 20 2月, 2012 6 次提交
  10. 16 10月, 2011 1 次提交
  11. 03 10月, 2011 3 次提交
    • 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
    • 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
    • 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
  12. 22 9月, 2011 1 次提交
    • 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
  13. 27 7月, 2011 1 次提交
  14. 31 3月, 2011 1 次提交
  15. 01 3月, 2011 1 次提交
  16. 12 10月, 2010 1 次提交
  17. 09 10月, 2010 1 次提交