1. 25 Apr, 2012 1 commit
  2. 23 Apr, 2012 8 commits
    • Dan Williams's avatar
      [SCSI] Revert "[SCSI] libsas: fix sas port naming" · b4698d88
      Dan Williams authored
      This reverts commit a692b0ee.
      
      Tom reports:
      
      [    8.741033] ------------[ cut here ]------------
      [    8.741038] WARNING: at fs/sysfs/dir.c:508 sysfs_add_one+0xc1/0xf0()
      [    8.741040] Hardware name: To Be Filled By O.E.M.
      [    8.741041] sysfs: cannot create duplicate filename
      
      ...and missing 2 out of 4 drives connected to mvsas.  Commit a692b0ee
      made the assumption that all the phy ids an lldd registers to libsas are
      unique.  However, in the "multi-chip" case mvsas does a rather annoying
      duplication of phy ids in the array passed to libsas.  So, for example,
      chip0 has phy0-3 at ha phy index 0-3 and chip1 has its phy0-3 at ha phy
      index 4-7.  The more natural model would be to create a scsi_host (and
      sas_ha) per chip (controller), but for now revert the naming fix which
      unfortunately means dealing with unpredictable end-device names for a
      bit longer.
      
      Cc: Xiangliang Yu <yuxiangl@marvell.com>
      Cc: Patrick Thomson <patrick.s.thomson@intel.com>
      Reported-by: default avatarTom Rini <trini@ti.com>
      Tested-by: default avatarTom Rini <trini@ti.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      b4698d88
    • Dan Williams's avatar
      [SCSI] libsas: fix false positive 'device attached' conditions · 7d1d8651
      Dan Williams authored
      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: default avatarAndrzej Jakowski <andrzej.jakowski@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      7d1d8651
    • Dan Williams's avatar
      [SCSI] libsas, libata: fix start of life for a sas ata_port · b2024459
      Dan Williams authored
      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: default avatarMichal Kosciowski <michal.kosciowski@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      b2024459
    • Dan Williams's avatar
      [SCSI] libsas: fix ata_eh clobbering ex_phys via smp_ata_check_ready · 0f3fce5c
      Dan Williams authored
      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: default avatarMaciej Patelczyk <maciej.patelczyk@intel.com>
      Tested-by: default avatarBartek Nowakowski <bartek.nowakowski@intel.com>
      Tested-by: default avatarJacek Danecki <jacek.danecki@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      0f3fce5c
    • Dan Williams's avatar
      [SCSI] libsas: unify domain_device sas_rphy lifetimes · 9487669f
      Dan Williams authored
      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: default avatarTom Jackson <thomas.p.jackson@intel.com>
      Tested-by: default avatarTom Jackson <thomas.p.jackson@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      9487669f
    • Dan Williams's avatar
      [SCSI] libsas: fix sas_get_port_device regression · ec236e52
      Dan Williams authored
      Commit 899fcf40 "[SCSI] libsas: set attached device type and target
      protocols for local phys" setup 'phy' to be dereferenced after
      list_for_each_entry(phy, &port->phy_list, port_phy_el) (i.e. phy ==
      &port->phy_list) resulting in reports like:
      
        BUG: unable to handle kernel NULL pointer dereference at 00000000000002b0
        IP: [<ffffffffa00ce948>] sas_discover_domain+0x29e/0x4fb [libsas]
      
      ...fix by deferring sas_phy_set_target() to the end of
      sas_get_port_device().
      Reported-by: default avatarTom Jackson <thomas.p.jackson@intel.com>
      Tested-by: default avatarTom Jackson <thomas.p.jackson@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      ec236e52
    • Thomas Jackson's avatar
      [SCSI] libsas: fix sas_find_bcast_phy() in the presence of 'vacant' phys · 1699490d
      Thomas Jackson authored
      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: default avatarThomas Jackson <thomas.p.jackson@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      1699490d
    • Dan Williams's avatar
      [SCSI] libsas: introduce sas_work to fix sas_drain_work vs sas_queue_work · 22b9153f
      Dan Williams authored
      When requeuing work to a draining workqueue the last work instance may
      not be idle, so sas_queue_work() must not touch work->entry.  Introduce
      sas_work with a drain_node list_head to have a private list for
      collecting work deferred due to drain collision.
      
      Fixes reports like:
        BUG: unable to handle kernel NULL pointer dereference at           (null)
        IP: [<ffffffff810410d4>] process_one_work+0x2e/0x338
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      22b9153f
  3. 22 Apr, 2012 2 commits
  4. 19 Apr, 2012 20 commits
  5. 18 Apr, 2012 9 commits