10 May, 2016

2 commits


25 Mar, 2015

1 commit


20 Mar, 2015

1 commit

  • SAS controller has its own tag allocation, which doesn't directly match to ATA
    tag, so SAS and SATA have different code path for ata tags. Originally we use
    port->scsi_host (98bd4be1) to destinguish SAS controller, but libsas set
    ->scsi_host too, so we can't use it for the destinguish, we add a new flag for
    this purpose.

    Without this patch, the following oops can happen because scsi-mq uses
    a host-wide tag map shared among all devices with some integer tag
    values >= ATA_MAX_QUEUE. These unexpectedly high tag values cause
    __ata_qc_from_tag() to return NULL, which is then dereferenced in
    ata_qc_new_init().

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
    IP: [] ata_qc_new_init+0x3e/0x120
    PGD 32adf0067 PUD 32adf1067 PMD 0
    Oops: 0002 [#1] SMP DEBUG_PAGEALLOC
    Modules linked in: iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi igb
    i2c_algo_bit ptp pps_core pm80xx libsas scsi_transport_sas sg coretemp
    eeprom w83795 i2c_i801
    CPU: 4 PID: 1450 Comm: cydiskbench Not tainted 4.0.0-rc3 #1
    Hardware name: Supermicro X8DTH-i/6/iF/6F/X8DTH, BIOS 2.1b 05/04/12
    task: ffff8800ba86d500 ti: ffff88032a064000 task.ti: ffff88032a064000
    RIP: 0010:[] [] ata_qc_new_init+0x3e/0x120
    RSP: 0018:ffff88032a067858 EFLAGS: 00010046
    RAX: 0000000000000000 RBX: ffff8800ba0d2230 RCX: 000000000000002a
    RDX: ffffffff80505ae0 RSI: 0000000000000020 RDI: ffff8800ba0d2230
    RBP: ffff88032a067868 R08: 0000000000000201 R09: 0000000000000001
    R10: 0000000000000000 R11: 0000000000000000 R12: ffff8800ba0d0000
    R13: ffff8800ba0d2230 R14: ffffffff80505ae0 R15: ffff8800ba0d0000
    FS: 0000000041223950(0063) GS:ffff88033e480000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 0000000000000058 CR3: 000000032a0a3000 CR4: 00000000000006e0
    Stack:
    ffff880329eee758 ffff880329eee758 ffff88032a0678a8 ffffffff80502dad
    ffff8800ba167978 ffff880329eee758 ffff88032bf9c520 ffff8800ba167978
    ffff88032bf9c520 ffff88032bf9a290 ffff88032a0678b8 ffffffff80506909
    Call Trace:
    [] ata_scsi_translate+0x3d/0x1b0
    [] ata_sas_queuecmd+0x149/0x2a0
    [] sas_queuecommand+0xa0/0x1f0 [libsas]
    [] scsi_dispatch_cmd+0xd4/0x1a0
    [] scsi_queue_rq+0x66f/0x7f0
    [] __blk_mq_run_hw_queue+0x208/0x3f0
    [] blk_mq_run_hw_queue+0x88/0xc0
    [] blk_mq_insert_request+0xc4/0x130
    [] blk_execute_rq_nowait+0x73/0x160
    [] sg_common_write+0x3da/0x720 [sg]
    [] sg_new_write+0x250/0x360 [sg]
    [] sg_write+0x13b/0x450 [sg]
    [] vfs_write+0xd1/0x1b0
    [] SyS_write+0x54/0xc0
    [] system_call_fastpath+0x12/0x17

    tj: updated description.

    Fixes: 12cb5ce101ab ("libata: use blk taging")
    Reported-and-tested-by: Tony Battersby
    Signed-off-by: Shaohua Li
    Signed-off-by: Tejun Heo

    Shaohua Li
     

07 Mar, 2015

1 commit

  • This crash was reported:

    [ 366.947370] sd 3:0:1:0: [sdb] Spinning up disk....
    [ 368.804046] BUG: unable to handle kernel NULL pointer dereference at (null)
    [ 368.804072] IP: [] __mutex_lock_common.isra.7+0x9c/0x15b
    [ 368.804098] PGD 0
    [ 368.804114] Oops: 0002 [#1] SMP
    [ 368.804143] CPU 1
    [ 368.804151] Modules linked in: sg netconsole s3g(PO) uinput joydev hid_multitouch usbhid hid snd_hda_codec_via cpufreq_userspace cpufreq_powersave cpufreq_stats uhci_hcd cpufreq_conservative snd_hda_intel snd_hda_codec snd_hwdep snd_pcm sdhci_pci snd_page_alloc sdhci snd_timer snd psmouse evdev serio_raw pcspkr soundcore xhci_hcd shpchp s3g_drm(O) mvsas mmc_core ahci libahci drm i2c_core acpi_cpufreq mperf video processor button thermal_sys dm_dmirror exfat_fs exfat_core dm_zcache dm_mod padlock_aes aes_generic padlock_sha iscsi_target_mod target_core_mod configfs sswipe libsas libata scsi_transport_sas picdev via_cputemp hwmon_vid fuse parport_pc ppdev lp parport autofs4 ext4 crc16 mbcache jbd2 sd_mod crc_t10dif usb_storage scsi_mod ehci_hcd usbcore usb_common
    [ 368.804749]
    [ 368.804764] Pid: 392, comm: kworker/u:3 Tainted: P W O 3.4.87-logicube-ng.22 #1 To be filled by O.E.M. To be filled by O.E.M./EPIA-M920
    [ 368.804802] RIP: 0010:[] [] __mutex_lock_common.isra.7+0x9c/0x15b
    [ 368.804827] RSP: 0018:ffff880117001cc0 EFLAGS: 00010246
    [ 368.804842] RAX: 0000000000000000 RBX: ffff8801185030d0 RCX: ffff88008edcb420
    [ 368.804857] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff8801185030d4
    [ 368.804873] RBP: ffff8801181531c0 R08: 0000000000000020 R09: 00000000fffffffe
    [ 368.804885] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801185030d4
    [ 368.804899] R13: 0000000000000002 R14: ffff880117001fd8 R15: ffff8801185030d8
    [ 368.804916] FS: 0000000000000000(0000) GS:ffff88011fc80000(0000) knlGS:0000000000000000
    [ 368.804931] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [ 368.804946] CR2: 0000000000000000 CR3: 000000000160b000 CR4: 00000000000006e0
    [ 368.804962] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [ 368.804978] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [ 368.804995] Process kworker/u:3 (pid: 392, threadinfo ffff880117000000, task ffff8801181531c0)
    [ 368.805009] Stack:
    [ 368.805017] ffff8801185030d8 0000000000000000 ffffffff8161ddf0 ffffffff81056f7c
    [ 368.805062] 000000000000b503 ffff8801185030d0 ffff880118503000 0000000000000000
    [ 368.805100] ffff8801185030d0 ffff8801188b8000 ffff88008edcb420 ffffffff813583ac
    [ 368.805135] Call Trace:
    [ 368.805153] [] ? up+0xb/0x33
    [ 368.805168] [] ? mutex_lock+0x16/0x25
    [ 368.805194] [] ? smp_execute_task+0x4e/0x222 [libsas]
    [ 368.805217] [] ? sas_find_bcast_dev+0x3c/0x15d [libsas]
    [ 368.805240] [] ? sas_find_bcast_dev+0x6f/0x15d [libsas]
    [ 368.805264] [] ? sas_ex_revalidate_domain+0x37/0x2ec [libsas]
    [ 368.805280] [] ? printk+0x43/0x48
    [ 368.805296] [] ? _raw_spin_unlock_irqrestore+0xc/0xd
    [ 368.805318] [] ? sas_revalidate_domain+0x85/0xb6 [libsas]
    [ 368.805336] [] ? process_one_work+0x151/0x27c
    [ 368.805351] [] ? worker_thread+0xbb/0x152
    [ 368.805366] [] ? manage_workers.isra.29+0x163/0x163
    [ 368.805382] [] ? kthread+0x79/0x81
    [ 368.805399] [] ? kernel_thread_helper+0x4/0x10
    [ 368.805416] [] ? kthread_flush_work_fn+0x9/0x9
    [ 368.805431] [] ? gs_change+0x13/0x13
    [ 368.805442] Code: 83 7d 30 63 7e 04 f3 90 eb ab 4c 8d 63 04 4c 8d 7b 08 4c 89 e7 e8 fa 15 00 00 48 8b 43 10 4c 89 3c 24 48 89 63 10 48 89 44 24 08 89 20 83 c8 ff 48 89 6c 24 10 87 03 ff c8 74 35 4d 89 ee 41
    [ 368.805851] RIP [] __mutex_lock_common.isra.7+0x9c/0x15b
    [ 368.805877] RSP
    [ 368.805886] CR2: 0000000000000000
    [ 368.805899] ---[ end trace b720682065d8f4cc ]---

    It's directly caused by 89d3cf6 [SCSI] libsas: add mutex for SMP task
    execution, but shows a deeper cause: expander functions expect to be able to
    cast to and treat domain devices as expanders. The correct fix is to only do
    expander discover when we know we've got an expander device to avoid wrongly
    casting a non-expander device.

    Reported-by: Praveen Murali
    Tested-by: Praveen Murali
    Cc: stable@vger.kernel.org
    Signed-off-by: James Bottomley

    James Bottomley
     

18 Dec, 2014

1 commit


12 Dec, 2014

1 commit

  • Pull libata changes from Tejun Heo:
    "The only interesting piece is the support for shingled drives. The
    changes in libata layer are minimal. All it does is identifying the
    new class of device and report upwards accordingly"

    * 'for-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
    libata: Remove FIXME comment in atapi_request_sense()
    sata_rcar: Document deprecated "renesas,rcar-sata"
    sata_rcar: Add clocks to sata_rcar bindings
    ahci_sunxi: Make AHCI_HFLAG_NO_PMP flag configurable with a module option
    libata-scsi: Update SATL for ZAC drives
    libata: Implement ATA_DEV_ZAC
    libsas: use ata_dev_classify()

    Linus Torvalds
     

04 Dec, 2014

1 commit

  • Since we got rid of ordered tag support in 2010 the prime use case of
    switching on and off ordered tags has been obsolete. The other function
    of enabling/disabling tagging entirely has only been correctly implemented
    by the 53c700 driver and isn't generally useful.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Bart Van Assche
    Reviewed-by: Martin K. Petersen

    Christoph Hellwig
     

27 Nov, 2014

1 commit

  • The task_collector mode (or "latency_injector", (C) Dan Willians) is an
    optional I/O path in libsas that queues up scsi commands instead of
    directly sending it to the hardware. It generall increases latencies
    to in the optiomal case slightly reduce mmio traffic to the hardware.

    Only the obsolete aic94xx driver and the mvsas driver allowed to use
    it without recompiling the kernel, and most drivers didn't support it
    at all.

    Remove the giant blob of code to allow better optimizations for scsi-mq
    in the future.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Acked-by: Dan Williams

    Christoph Hellwig
     

24 Nov, 2014

2 commits

  • Drop the now unused reason argument from the ->change_queue_depth method.
    Also add a return value to scsi_adjust_queue_depth, and rename it to
    scsi_change_queue_depth now that it can be used as the default
    ->change_queue_depth implementation.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Hannes Reinecke

    Christoph Hellwig
     
  • All drivers use the implementation for ramping the queue up and down, so
    instead of overloading the change_queue_depth method call the
    implementation diretly if the driver opts into it by setting the
    track_queue_depth flag in the host template.

    Note that a few drivers validated the new queue depth in their
    change_queue_depth method, but as we never go over the queue depth
    set during slave_configure or the sysfs file this isn't nessecary
    and can safely be removed.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Venkatesh Srinivas

    Christoph Hellwig
     

12 Nov, 2014

3 commits

  • Now that we also get proper values in cmd->request->tag for untagged
    commands, there is no need to force tagged_supported to on in drivers
    that need host-wide tags.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Hannes Reinecke

    Christoph Hellwig
     
  • Remove the tagged argument from scsi_adjust_queue_depth, and just let it
    handle the queue depth. For most drivers those two are fairly separate,
    given that most modern drivers don't care about the SCSI "tagged" status
    of a command at all, and many old drivers allow queuing of multiple
    untagged commands in the driver.

    Instead we start out with the ->simple_tags flag set before calling
    ->slave_configure, which is how all drivers actually looking at
    ->simple_tags except for one worke anyway. The one other case looks
    broken, but I've kept the behavior as-is for now.

    Except for that we only change ->simple_tags from the ->change_queue_type,
    and when rejecting a tag message in a single driver, so keeping this
    churn out of scsi_adjust_queue_depth is a clear win.

    Now that the usage of scsi_adjust_queue_depth is more obvious we can
    also remove all the trivial instances in ->slave_alloc or ->slave_configure
    that just set it to the cmd_per_lun default.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Martin K. Petersen

    Christoph Hellwig
     
  • Allow a driver to ask for block layer tags by setting .use_blk_tags in the
    host template, in which case it will always see a valid value in
    request->tag, similar to the behavior when using blk-mq. This means even
    SCSI "untagged" commands will now have a tag, which is especially useful
    when using a host-wide tag map.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Hannes Reinecke

    Christoph Hellwig
     

06 Nov, 2014

1 commit

  • Use the ata device class from libata in libsas instead of checking
    the supported command set and switch to using ata_dev_classify()
    instead of our own method.

    Cc: Tejun Heo
    Cc: Dan Williams
    Acked-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Tejun Heo

    Hannes Reinecke
     

25 Jul, 2014

1 commit

  • Avoid taking the host-wide host_lock to check the per-host queue limit.
    Instead we do an atomic_inc_return early on to grab our slot in the queue,
    and if necessary decrement it after finishing all checks.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Webb Scales
    Acked-by: Jens Axboe
    Tested-by: Bart Van Assche
    Tested-by: Robert Elliott

    Christoph Hellwig
     

18 Jul, 2014

1 commit

  • The SCSI standard defines 64-bit values for LUNs, and large arrays
    employing large or hierarchical LUN numbers become more and more
    common.

    So update the linux SCSI stack to use 64-bit LUN numbers.

    Signed-off-by: Hannes Reinecke
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Ewan Milne
    Signed-off-by: Christoph Hellwig

    Hannes Reinecke
     

02 Apr, 2014

1 commit

  • Pull first round of SCSI updates from James Bottomley:
    "This patch consists of the usual driver updates (megaraid_sas,
    scsi_debug, qla2xxx, qla4xxx, lpfc, bnx2fc, be2iscsi, hpsa, ipr) plus
    an assortment of minor fixes and the first precursors of SCSI-MQ (the
    code path simplifications) and the bug fix for the USB oops on remove
    (which involves an infrastructure change, so is sent via the main tree
    with a delayed backport after a cycle in which it is shown to
    introduce no new bugs)"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (196 commits)
    [SCSI] sd: Quiesce mode sense error messages
    [SCSI] add support for per-host cmd pools
    [SCSI] simplify command allocation and freeing a bit
    [SCSI] megaraid: simplify internal command handling
    [SCSI] ses: Use vpd information from scsi_device
    [SCSI] Add EVPD page 0x83 and 0x80 to sysfs
    [SCSI] Return VPD page length in scsi_vpd_inquiry()
    [SCSI] scsi_sysfs: Implement 'is_visible' callback
    [SCSI] hpsa: update driver version to 3.4.4-1
    [SCSI] hpsa: fix bad endif placement in RAID 5 mapper code
    [SCSI] qla2xxx: Fix build errors related to invalid print fields on some architectures.
    [SCSI] bfa: Replace large udelay() with mdelay()
    [SCSI] vmw_pvscsi: Some improvements in pvscsi driver.
    [SCSI] vmw_pvscsi: Add support for I/O requests coalescing.
    [SCSI] vmw_pvscsi: Fix pvscsi_abort() function.
    [SCSI] remove deprecated IRQF_DISABLED from SCSI
    [SCSI] bfa: Updating Maintainers email ids
    [SCSI] ipr: Add new CCIN definition for Grand Canyon support
    [SCSI] ipr: Format HCAM overlay ID 0x21
    [SCSI] ipr: Use pci_enable_msi_range() and pci_enable_msix_range()
    ...

    Linus Torvalds
     

19 Mar, 2014

1 commit

  • Tejun says:
    "At least for libata, worrying about suspend/resume failures don't make
    whole lot of sense. If suspend failed, just proceed with suspend. If
    the device can't be woken up afterwards, that's that. There isn't
    anything we could have done differently anyway. The same for resume, if
    spinup fails, the device is dud and the following commands will invoke
    EH actions and will eventually fail. Again, there really isn't any
    *choice* to make. Just making sure the errors are handled gracefully
    (ie. don't crash) and the following commands are handled correctly
    should be enough."

    The only libata user that actually cares about the result from a suspend
    operation is libsas. However, it only cares about whether queuing a new
    operation collides with an in-flight one. All libsas does with the
    error is retry, but we can just let libata wait for the previous
    operation before continuing.

    Other cleanups include:
    1/ Unifying all ata port pm operations on an ata_port_pm_ prefix
    2/ Marking all ata port pm helper routines as returning void, only
    ata_port_pm_ entry points need to fake a 0 return value.
    3/ Killing ata_port_{suspend|resume}_common() in favor of calling
    ata_port_request_pm() directly
    4/ Killing the wrappers that just do a to_ata_port() conversion
    5/ Clearly marking the entry points that do async operations with an
    _async suffix.

    Reference: http://marc.info/?l=linux-scsi&m=138995409532286&w=2

    Cc: Phillip Susi
    Cc: Alan Stern
    Suggested-by: Tejun Heo
    Signed-off-by: Todd Brandt
    Signed-off-by: Dan Williams
    Signed-off-by: Tejun Heo

    Dan Williams
     

16 Mar, 2014

1 commit

  • libsas sometimes short circuits timeouts to force commands into error
    recovery. It is misleading to log that the command timed-out in
    sas_scsi_timed_out() when in fact it was just queued for error handling.
    It's also redundant in the case of a true timeout as libata eh will
    detect and report timeouts via it's AC_ERR_TIMEOUT facility.

    Given that some environments consider "timeout" errors to be indicative
    of impending device failure demote the sas_scsi_timed_out() timeout
    message to be disabled by default. This parallels ata_scsi_timed_out().

    [jejb: checkpatch fix]
    Reported-by: Xun Ni
    Tested-by: Nelson Cheng
    Acked-by: Lukasz Dorau
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     

01 Jan, 2014

1 commit

  • Needed to bring blk-mq uptodate, since changes have been going in
    since for-3.14/core was established.

    Fixup merge issues related to the immutable biovec changes.

    Signed-off-by: Jens Axboe

    Conflicts:
    block/blk-flush.c
    fs/btrfs/check-integrity.c
    fs/btrfs/extent_io.c
    fs/btrfs/scrub.c
    fs/logfs/dev_bdev.c

    Jens Axboe
     

27 Nov, 2013

1 commit

  • Since commit 110dd8f19df5 "[SCSI] libsas: fix scr_read/write users and
    update the libata documentation" we have been passing pmp=1 and is_cmd=0
    to ata_tf_to_fis(). Praveen reports that eSATA attached drives do not
    discover correctly. His investigation found that the BIOS was passing
    pmp=0 while Linux was passing pmp=1 and failing to discover the drives.
    Update libsas to follow the libata example of pulling the pmp setting
    from the ata_link and correct is_cmd to be 1 since all tf's submitted
    through ->qc_issue are commands. Presumably libsas lldds do not care
    about is_cmd as they have sideband mechanisms to perform link
    management.

    http://marc.info/?l=linux-scsi&m=138179681726990

    [jejb: checkpatch fix]
    Signed-off-by: Dan Williams
    Reported-by: Praveen Murali
    Tested-by: Praveen Murali
    Cc: stable@vger.kernel.org
    Signed-off-by: James Bottomley

    Dan Williams
     

24 Nov, 2013

1 commit

  • 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: Kent Overstreet
    Cc: Jens Axboe
    Cc: Neil Brown
    Cc: Nagalakshmi Nandigama
    Cc: Sreekanth Reddy
    Cc: "James E.J. Bottomley"

    Kent Overstreet
     

05 Jun, 2013

1 commit

  • Remove the arbitrary expectation in libsas that all SCSI commands are 16 bytes
    or less. Instead do all copies via cmd->cmd_len (and use a pointer to this in
    the libsas task instead of a copy). Note that this still doesn't enable > 16
    byte CDB support in the underlying drivers because their internal format has
    to be fixed and the wire format of > 16 byte CDBs according to the SAS spec is
    different. the libsas drivers (isci, aic94xx, mvsas and pm8xxx are all
    updated for this change.

    Cc: Lukasz Dorau
    Cc: Maciej Patelczyk
    Cc: Dave Jiang
    Cc: Jack Wang
    Cc: Lindar Liu
    Cc: Xiangliang Yu
    Signed-off-by: James Bottomley

    James Bottomley
     

10 May, 2013

2 commits

  • Signed-off-by: James Bottomley

    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: James Bottomley

    James Bottomley
     

09 May, 2013

1 commit

  • Pull block core updates from Jens Axboe:

    - Major bit is Kents prep work for immutable bio vecs.

    - Stable candidate fix for a scheduling-while-atomic in the queue
    bypass operation.

    - Fix for the hang on exceeded rq->datalen 32-bit unsigned when merging
    discard bios.

    - Tejuns changes to convert the writeback thread pool to the generic
    workqueue mechanism.

    - Runtime PM framework, SCSI patches exists on top of these in James'
    tree.

    - A few random fixes.

    * 'for-3.10/core' of git://git.kernel.dk/linux-block: (40 commits)
    relay: move remove_buf_file inside relay_close_buf
    partitions/efi.c: replace useless kzalloc's by kmalloc's
    fs/block_dev.c: fix iov_shorten() criteria in blkdev_aio_read()
    block: fix max discard sectors limit
    blkcg: fix "scheduling while atomic" in blk_queue_bypass_start
    Documentation: cfq-iosched: update documentation help for cfq tunables
    writeback: expose the bdi_wq workqueue
    writeback: replace custom worker pool implementation with unbound workqueue
    writeback: remove unused bdi_pending_list
    aoe: Fix unitialized var usage
    bio-integrity: Add explicit field for owner of bip_buf
    block: Add an explicit bio flag for bios that own their bvec
    block: Add bio_alloc_pages()
    block: Convert some code to bio_for_each_segment_all()
    block: Add bio_for_each_segment_all()
    bounce: Refactor __blk_queue_bounce to not use bi_io_vec
    raid1: use bio_copy_data()
    pktcdvd: Use bio_reset() in disabled code to kill bi_idx usage
    pktcdvd: use bio_copy_data()
    block: Add bio_copy_data()
    ...

    Linus Torvalds
     

06 Apr, 2013

2 commits

  • If a result of the SMP discover function is PHY VACANT,
    the content of discover response structure (dr) is not valid.
    It sometimes happens that dr->attached_sas_addr can contain
    even SAS address of other phy. In such case an invalid phy
    is created, what causes NULL pointer dereference during
    destruction of expander's phys.

    So if a result of SMP function is PHY VACANT, the content of discover
    response structure (dr) must not be copied to phy structure.

    This patch fixes the following bug:

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000030
    IP: [] sysfs_find_dirent+0x12/0x90
    Call Trace:
    [] sysfs_get_dirent+0x35/0x80
    [] sysfs_unmerge_group+0x1e/0xb0
    [] dpm_sysfs_remove+0x24/0x90
    [] device_del+0x44/0x1d0
    [] sas_rphy_delete+0x9/0x20 [scsi_transport_sas]
    [] sas_destruct_devices+0xe6/0x110 [libsas]
    [] process_one_work+0x16c/0x350
    [] worker_thread+0x17a/0x410
    [] kthread+0x96/0xa0
    [] kernel_thread_helper+0x4/0x10

    Signed-off-by: Lukasz Dorau
    Signed-off-by: Pawel Baldysiak
    Reviewed-by: Maciej Patelczyk
    Cc:
    Signed-off-by: James Bottomley

    Lukasz Dorau
     
  • In fact the disc_resp buffer will be overwrite by smp response, so we never
    found this typo, correct it by using the right one.

    Signed-off-by: John Gong
    Signed-off-by: Jack Wang
    Signed-off-by: James Bottomley

    John Gong
     

24 Mar, 2013

1 commit

  • 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: Kent Overstreet
    CC: Jens Axboe
    CC: Eric Moore
    CC: "James E.J. Bottomley"
    CC: linux-scsi@vger.kernel.org

    Kent Overstreet
     

19 Nov, 2012

1 commit


24 Aug, 2012

2 commits

  • libsas and ipr pass flags to ata_host_init that are meant for the port.

    ata_host flags:
    ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */
    ATA_HOST_STARTED = (1 << 1), /* Host started */
    ATA_HOST_PARALLEL_SCAN = (1 << 2), /* Ports on this host can be scanned in parallel */
    ATA_HOST_IGNORE_ATA = (1 << 3), /* Ignore ATA devices on this host. */

    flags passed by libsas:
    ATA_FLAG_SATA = (1 << 1),
    ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */
    ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */

    The only one that aliases is ATA_HOST_STARTED which is a 'don't care' in
    the libsas and ipr cases since ata_hosts from these sources are not
    registered with libata.

    Reported-by: Hannes Reinecke
    Signed-off-by: Dan Williams
    Acked-by: Brian King
    Acked-by: Jeff Garzik
    Signed-off-by: James Bottomley

    Dan Williams
     
  • libsas power management routines to suspend and recover the sas domain
    based on a model where the lldd is allowed and expected to be
    "forgetful".

    sas_suspend_ha - disable event processing allowing the lldd to take down
    links without concern for causing hotplug events.
    Regardless of whether the lldd actually posts link down
    messages libsas notifies the lldd that all
    domain_devices are gone.

    sas_prep_resume_ha - on the way back up before the lldd starts link
    training clean out any spurious events that were
    generated on the way down, and re-enable event
    processing

    sas_resume_ha - after the lldd has started and decided that all phys
    have posted link-up events this routine is called to let
    libsas start it's own timeout of any phys that did not
    resume. After the timeout an lldd can cancel the
    phy teardown by posting a link-up event.

    Storage for ex_change_count (u16) and phy_change_count (u8) are changed
    to int so they can be set to -1 to indicate 'invalidated'.

    Signed-off-by: Dan Williams
    Reviewed-by: Jacek Danecki
    Tested-by: Maciej Patelczyk
    Acked-by: Alan Stern
    Signed-off-by: James Bottomley

    Dan Williams
     

20 Jul, 2012

7 commits

  • This is in preparation for teaching async_synchronize_full() to sync all
    pending async work, and not just on the async_running domain. This
    conversion is functionally equivalent, just embedding the existing list
    in a new async_domain type.

    The .registered attribute is used in a later patch to distinguish
    between domains that want to be flushed by async_synchronize_full()
    versus those that only expect async_synchronize_{full|cookie}_domain to
    be used for flushing.

    [jejb: add async.h to scsi_priv.h for struct async_domain]
    Signed-off-by: Dan Williams
    Acked-by: Arjan van de Ven
    Acked-by: Mark Brown
    Tested-by: Eldad Zack
    Signed-off-by: James Bottomley

    Dan Williams
     
  • The timer and the completion are only used for slow path tasks (smp, and
    lldd tmfs), yet we incur the allocation space and cpu setup time for
    every fast path task.

    Cc: Xiangliang Yu
    Acked-by: Jack Wang
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • On the way to add a new sata_device field, noticed that libsas is
    carrying port multiplier infrastructure that is explicitly disabled by
    sas_discover_sata(). The aic94xx touches the unused port_no, so leave
    that field in case there was some use for it.

    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • commit 198439e4 [SCSI] libsas: do not set res = 0 in sas_ex_discover_dev()
    commit 19252de6 [SCSI] libsas: fix wide port hotplug issues

    The above commits seem to have confused the return value of
    sas_ex_discover_dev which is non-zero on failure and
    sas_ex_join_wide_port which just indicates short circuiting discovery on
    already established ports. The result is random discovery failures
    depending on configuration.

    Calls to sas_ex_join_wide_port are the source of the trouble as its
    return value is errantly assigned to 'res'. Convert it to bool and stop
    returning its result up the stack.

    Cc:
    Tested-by: Dan Melnic
    Reported-by: Dan Melnic
    Signed-off-by: Dan Williams
    Reviewed-by: Jack Wang
    Signed-off-by: James Bottomley

    Dan Williams
     
  • Continue running revalidation until no more broadcast devices are
    discovered. Fixes cases where re-discovery completes too early in a
    domain with multiple expanders with pending re-discovery events.
    Servicing BCNs can get backed up behind error recovery.

    Cc:
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • The discovery function "sas_rediscover_dev" had two bugs: 1) it did
    not pay attention to the return status from the SMP task execution;
    2) the stack variable used for the returned SAS address was compared
    against 0 without being initialized.

    Signed-off-by: Jeff Skirvin
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Jeff Skirvin
     
  • sas_eh_bus_reset_handler() amounts to sas_phy_reset() without
    notification of the reset to the lldd. If this is triggered from
    eh-cmnd recovery there may be sas_tasks for the lldd to terminate, so
    ->lldd_I_T_nexus_reset is warranted.

    Cc: Xiangliang Yu
    Cc: Luben Tuikov
    Cc: Jack Wang
    Reviewed-by: Jacek Danecki
    [jacek: modify pm8001_I_T_nexus_reset to return -ENODEV]
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams