03 Sep, 2013

25 commits


26 Aug, 2013

15 commits

  • section Signed-off-by: John Kacur

    On a 3.6-rt (real-time patch) kernel we are seeing the following BUG
    However, it appears to be relevant for non-realtime (mainline) as well.

    [ 49.688847] hpsa 0000:03:00.0: hpsa0: at IRQ 67 using DAC
    [ 49.749928] scsi0 : hpsa
    [ 49.784437] BUG: using smp_processor_id() in preemptible [00000000
    00000000] code: kworker/u:0/6
    [ 49.784465] caller is enqueue_cmd_and_start_io+0x5a/0x100 [hpsa]
    [ 49.784468] Pid: 6, comm: kworker/u:0 Not tainted
    3.6.11.5-rt37.52.el6rt.x86_64.debug #1
    [ 49.784471] Call Trace:
    [ 49.784512] [] debug_smp_processor_id+0x123/0x150
    [ 49.784520] [] enqueue_cmd_and_start_io+0x5a/0x100
    [hpsa]
    [ 49.784529] []
    hpsa_scsi_do_simple_cmd_core+0xeb/0x110 [hpsa]
    [ 49.784537] [] ? swiotlb_dma_mapping_error+0x18/0x30
    [ 49.784544] [] ? swiotlb_dma_mapping_error+0x18/0x30
    [ 49.784553] []
    hpsa_scsi_do_simple_cmd_with_retry+0x91/0x280 [hpsa]
    [ 49.784562] []
    hpsa_scsi_do_report_luns.clone.2+0xd8/0x130 [hpsa]
    [ 49.784571] []
    hpsa_gather_lun_info.clone.3+0x3a/0x1a0 [hpsa]
    [ 49.784580] [] hpsa_update_scsi_devices+0x11f/0x4f0
    [hpsa]
    [ 49.784592] [] ? sub_preempt_count+0xa9/0xe0
    [ 49.784601] [] hpsa_scan_start+0xfd/0x150 [hpsa]
    [ 49.784613] [] ? rt_spin_lock_slowunlock+0x78/0x90
    [ 49.784626] [] do_scsi_scan_host+0x37/0xa0
    [ 49.784632] [] do_scan_async+0x1a/0x30
    [ 49.784643] [] async_run_entry_fn+0x9b/0x1d0
    [ 49.784655] [] process_one_work+0x1f2/0x620
    [ 49.784661] [] ? process_one_work+0x180/0x620
    [ 49.784668] [] ? worker_thread+0x5e/0x3a0
    [ 49.784674] [] ? async_schedule+0x20/0x20
    [ 49.784681] [] worker_thread+0x133/0x3a0
    [ 49.784688] [] ? manage_workers+0x190/0x190
    [ 49.784696] [] kthread+0xa6/0xb0
    [ 49.784707] [] kernel_thread_helper+0x4/0x10
    [ 49.784715] [] ? finish_task_switch+0x8c/0x110
    [ 49.784721] [] ? _raw_spin_unlock_irq+0x3b/0x70
    [ 49.784727] [] ? retint_restore_args+0xe/0xe
    [ 49.784734] [] ? kthreadd+0x1e0/0x1e0
    [ 49.784739] [] ? gs_change+0xb/0xb

    -------------------

    This is caused by
    enqueue_cmd_and_start_io()->
    set_performant_mode()->
    smp_processor_id()
    Which if you have debugging enabled calls debug_processor_id() and triggers the warning.

    The code here is
    c->Header.ReplyQueue = smp_processor_id() % h->nreply_queues;

    Since it is not critical that the code complete on the same processor,
    but the cpu is a hint used in generating the ReplyQueue and will still work if
    the cpu migrates or is preempted, it is safe to use the raw_smp_processor_id()
    to surpress the false positve warning.

    Signed-off-by: John Kacur
    Acked-by: Stephen Cameron
    Signed-off-by: James Bottomley

    John Kacur
     
  • To run discovery over iSER we need to advertize the CAP_TEXT_NEGO capability
    towards user space. Also need to make sure the login RX buffer is posted when
    SendTargets TEXT PDUs are sent. For that end, we use a setting of the
    ISCSI_PARAM_DISCOVERY_SESS iscsi param as an indication that this is
    discovery session.

    Signed-off-by: Or Gerlitz
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Or Gerlitz
     
  • PCI core will initialize device MSI/MSI-X capability in
    pci_msi_init_pci_dev(). So device driver should use
    pci_dev->msi_cap/msix_cap to determine whether the device
    support MSI/MSI-X instead of using
    pci_find_capability(pci_dev, PCI_CAP_ID_MSI/MSIX).
    Access to PCIe device config space again will consume more time.

    Signed-off-by: Yijing Wang
    Acked-by: lindar_liu
    Signed-off-by: James Bottomley

    Yijing Wang
     
  • Signed-off-by: Anandkumar.Santhanam@pmcs.com
    Signed-off-by: James Bottomley

    Anand Kumar Santhanam
     
  • If mpt3sas_base_map_resources takes an early error path then its
    counterpart, mpt3sas_base_free_resources needs to be careful about
    cleaning up:

    1 - _base_mask_interrupts and _base_make_ioc_ready require memory
    mapped I/O registers, make sure that this is true.

    2 - _base_free_irq iterates over the adapter's reply_queue_list, so
    move this list head initialization out of _base_enable_msix to
    _scsih_probe so this will always be safe.

    3 - check that the controller PCI device and its BARs have been
    enabled before disabling them.

    Signed-off-by: Joe Lawrence
    Acked-by: Sreekanth Reddy
    Signed-off-by: James Bottomley

    Joe Lawrence
     
  • If mpt2sas_base_map_resources takes an early error path then its
    counterpart, mpt2sas_base_free_resources needs to be careful about
    cleaning up:

    1 - _base_mask_interrupts and _base_make_ioc_ready require memory
    mapped I/O registers, make sure that this is true.

    2 - _base_free_irq iterates over the adapter's reply_queue_list, so
    move this list head initialization out of _base_enable_msix to
    _scsih_probe so this will always be safe.

    3 - check that the controller PCI device and its BARs have been
    enabled before disabling them.

    Signed-off-by: Joe Lawrence
    Acked-by: Sreekanth Reddy
    Signed-off-by: James Bottomley

    Joe Lawrence
     
  • Generate a uevent when the following Unit Attention ASC/ASCQ
    codes are received:

    2A/01 MODE PARAMETERS CHANGED
    2A/09 CAPACITY DATA HAS CHANGED
    38/07 THIN PROVISIONING SOFT THRESHOLD REACHED
    3F/03 INQUIRY DATA HAS CHANGED
    3F/0E REPORTED LUNS DATA HAS CHANGED

    Log kernel messages when the following Unit Attention ASC/ASCQ
    codes are received that are not as specific as those above:

    2A/xx PARAMETERS CHANGED
    3F/xx TARGET OPERATING CONDITIONS HAVE CHANGED

    Added logic to set expecting_lun_change for other LUNs on the target
    after REPORTED LUNS DATA HAS CHANGED is received, so that duplicate
    uevents are not generated, and clear expecting_lun_change when a
    REPORT LUNS command completes, in accordance with the SPC-3
    specification regarding reporting of the 3F 0E ASC/ASCQ UA.

    [jejb: remove SPC3 test in scsi_report_lun_change and some docbook fixes and
    unused variable fix, both reported by Fengguang Wu]
    Signed-off-by: Ewan D. Milne
    Signed-off-by: James Bottomley

    Ewan D. Milne
     
  • Signed-off-by: James Smart
    Signed-off-by: James Bottomley

    James Smart
     
  • Add the appropriate definitions and table entries for new adapter support.

    Signed-off-by: Wen Xiong
    Signed-off-by: James Bottomley

    wenxiong@linux.vnet.ibm.com
     
  • Signed-off-by: Tomas Henzl
    Acked-by: Stephen M. Cameron
    Signed-off-by: James Bottomley

    Tomas Henzl
     
  • When the driver calls scsi_done and after that frees it's internal
    preallocated memory it can happen that a new job is enqueud before
    the memory is freed. The allocation fails and the message
    "cmd_alloc returned NULL" is shown.
    Patch below fixes it by moving cmd->scsi_done after cmd_free.

    Signed-off-by: Tomas Henzl
    Acked-by: Stephen M. Cameron
    Signed-off-by: James Bottomley

    Tomas Henzl
     
  • It seems the "phy_index++;" have been placed in wrong place, without it
    the while circle up will do a infinite loop.

    Signed-off-by: Xinghai Yu
    Acked-by: Lukasz Dorau
    Signed-off-by: James Bottomley

    Xinghai Yu
     
  • devm_ioremap_resource does sanity checks on the given resource. No need to
    duplicate this in the driver.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Santosh Y
    Signed-off-by: James Bottomley

    Wolfram Sang
     
  • There is a error message within devm_ioremap_resource
    already, so remove the dev_err call to avoid redundant
    error message.

    Signed-off-by: Wei Yongjun
    Signed-off-by: Santosh Y
    Signed-off-by: James Bottomley

    Wei Yongjun
     
  • scsi_remove_host() sends SYNCHRONIZE CACHE commands for write cache
    enabled scsi disk devices. So stopping controller working shouldn't
    be done before scsi_remove_host().

    Signed-off-by: Akinobu Mita
    Signed-off-by: Santosh Y
    Signed-off-by: James Bottomley

    Akinobu Mita