11 Jan, 2012

1 commit

  • Stacking driver queue limits are typically bounded exclusively by the
    capabilities of the low level devices, not by the stacking driver
    itself.

    This patch introduces blk_set_stacking_limits() which has more liberal
    metrics than the default queue limits function. This allows us to
    inherit topology parameters from bottom devices without manually
    tweaking the default limits in each driver prior to calling the stacking
    function.

    Since there is now a clear distinction between stacking and low-level
    devices, blk_set_default_limits() has been modified to carry the more
    conservative values that we used to manually set in
    blk_queue_make_request().

    Signed-off-by: Martin K. Petersen
    Acked-by: Mike Snitzer
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

14 Dec, 2011

2 commits

  • * blk_get_queue() is peculiar in that it returns 0 on success and 1 on
    failure instead of 0 / -errno or boolean. Update it such that it
    returns %true on success and %false on failure.

    * Make sure the caller checks for the return value.

    * Separate out __blk_get_queue() which doesn't check whether @q is
    dead and put it in blk.h. This will be used later.

    This patch doesn't introduce any functional changes.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • The only user left for blk_insert_request() is sx8 and it can be
    trivially switched to use blk_execute_rq_nowait() - special requests
    aren't included in io stat and sx8 doesn't use block layer tagging.
    Switch sx8 and kill blk_insert_requeset().

    This patch doesn't introduce any functional difference.

    Only compile tested.

    Signed-off-by: Tejun Heo
    Acked-by: Jeff Garzik
    Signed-off-by: Jens Axboe

    Tejun Heo
     

10 Dec, 2011

3 commits


09 Dec, 2011

6 commits


08 Dec, 2011

14 commits

  • Once a device is failed we really want to completely ignore it.
    It should go away soon anyway.

    In particular the presence of bad blocks on it should not cause us to
    block as we won't be trying to write there anyway.

    So as soon as we can check if a device is Faulty, do so and pretend
    that it is already gone if it is Faulty.

    Signed-off-by: NeilBrown

    NeilBrown
     
  • When we mark blocks as bad we need them to be acknowledged by the
    metadata handler promptly.

    For an in-kernel metadata handler that was already being done. But
    for an external metadata handler we need to alert it of the change by
    sending a notification through the sysfs file. This adds that
    notification.

    Signed-off-by: NeilBrown

    NeilBrown
     
  • Once a device is marked Faulty the badblocks - whether acknowledged or
    not - become irrelevant. So they shouldn't cause the device to be
    marked as Blocked.

    Without this patch, a process might write "-blocked" to clear the
    Blocked status, but while that will correctly fail the device, it
    won't remove the apparent 'blocked' status.

    Signed-off-by: NeilBrown

    NeilBrown
     
  • When we are accessing an mddev via sysfs we know that the
    mddev cannot disappear because it has an embedded kobj which
    is refcounted by sysfs.
    And we also take the mddev_lock.
    However this is not enough.

    The final mddev_put could have been called and the
    mddev_delayed_delete is waiting for sysfs to let go so it can destroy
    the kobj and mddev.
    In this state there are a lot of changes that should not be attempted.

    To to guard against this we:
    - initialise mddev->all_mddevs in on last put so the state can be
    easily detected.
    - in md_attr_show and md_attr_store, check ->all_mddevs under
    all_mddevs_lock and mddev_get the mddev if it still appears to
    be active.

    This means that if we get to sysfs as the mddev is being deleted we
    will get -EBUSY.

    rdev_attr_store and rdev_attr_show are similar but already have
    sufficient protection. They check that rdev->mddev still points to
    mddev after taking mddev_lock. As this is cleared before delayed
    removal which can only be requested under the mddev_lock, this
    ensure the rdev and mddev are still alive.

    Signed-off-by: NeilBrown

    NeilBrown
     
  • We like md devices to disappear when they really are not needed.
    However it is not possible to tell from the current state whether it
    is needed or not. We can only tell from recent history of changes.

    In particular immediately after we create an md device it looks very
    similar to immediately after we have finished with it.

    So we always preserve a newly created md device until something
    significant happens. This state is stored in 'hold_active'.

    The normal case is to keep it until an ioctl happens, as that will
    normally either activate it, or explicitly de-activate it. If it
    doesn't then it was probably created by mistake and it is now time to
    get rid of it.

    We can also modify an array via sysfs (instead of via ioctl) and we
    currently treat any change via sysfs like an ioctl as a sign that if
    it now isn't more active, it should be destroyed.
    However this is not appropriate as changes made via sysfs are more
    gradual so we should look for a more definitive change.

    So this patch only clears 'hold_active' from UNTIL_IOCTL to clear when
    the array_state is changed via sysfs. Other changes via sysfs
    are ignored.

    Signed-off-by: NeilBrown

    NeilBrown
     
  • * '3.2-rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (25 commits)
    iscsi-target: Fix hex2bin warn_unused compile message
    target: Don't return an error if disabling unsupported features
    target/rd: fix or rewrite the copy routine
    target/rd: simplify the page/offset computation
    target: remove the unused se_dev_list
    target/file: walk properly over sg list
    target: remove unused struct fields
    target: Fix page length in emulated INQUIRY VPD page 86h
    target: Handle 0 correctly in transport_get_sectors_6()
    target: Don't return an error status for 0-length READ and WRITE
    iscsi-target: Use kmemdup rather than duplicating its implementation
    iscsi-target: Add missing F_BIT for iscsi_tm_rsp
    iscsi-target: Fix residual count hanlding + remove iscsi_cmd->residual_count
    target: Reject SCSI data overflow for fabrics using transport_generic_map_mem_to_cmd
    target: remove the unused t_task_pt_sgl and t_task_pt_sgl_num se_cmd fields
    target: remove the t_tasks_bidi se_cmd field
    target: remove the t_tasks_fua se_cmd field
    target: remove the se_ordered_node se_cmd field
    target: remove the se_obj_ptr and se_orig_obj_ptr se_cmd fields
    target: Drop config_item_name usage in fabric TFO->free_wwn()
    ...

    Linus Torvalds
     
  • * 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    PM / Driver core: leave runtime PM enabled during system shutdown

    Linus Torvalds
     
  • Disabling all runtime PM during system shutdown turns out not to be a
    good idea, because some devices may need to be woken up from a
    low-power state at that time.

    The whole point of disabling runtime PM for system shutdown was to
    prevent untimely runtime-suspend method calls. This patch (as1504)
    accomplishes the same result by incrementing the usage count for each
    device and waiting for ongoing runtime-PM callbacks to finish. This
    is what we already do during system suspend and hibernation, which
    makes sense since the shutdown method is pretty much a legacy analog
    of the pm->poweroff method.

    This fixes a recent regression on some OMAP systems introduced by
    commit af8db1508f2c9f3b6e633e2d2d906c6557c617f9 (PM / driver core:
    disable device's runtime PM during shutdown).

    Reported-and-tested-by: NeilBrown
    Signed-off-by: Alan Stern
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     
  • Fixes:
    The function __devinit spi_gpio_probe() references
    a function __init spi_gpio_alloc.isra.4().
    If spi_gpio_alloc.isra.4 is only used by spi_gpio_probe then
    annotate spi_gpio_alloc.isra.4 with a matching annotation.

    [wsa: fix spi_gpio_request(), too]

    Signed-off-by: Manuel Lauss
    Signed-off-by: Wolfram Sang

    Manuel Lauss
     
  • When spi_fsl_espi is chosen to be built as a module, there is a build
    error because we test only CONFIG_SPI_FSL_ESPI in declaration of
    struct mpc8xxx_spi in drivers/spi/spi_fsl_lib.h. Also some called
    functions are not exported.

    So we forbid CONFIG_SPI_FSL_ESPI to be tristate here.

    The error looks like:
    drivers/spi/spi_fsl_espi.c: In function 'fsl_espi_bufs':
    drivers/spi/spi_fsl_espi.c:232: error: 'struct mpc8xxx_spi' has no member named 'len'
    ...

    Signed-off-by: Jiri Slaby
    Acked-by: Kumar Gala
    Cc: Grant Likely
    Signed-off-by: Wolfram Sang

    Jiri Slaby
     
  • Include linux/module.h to fix below build error:

    CC drivers/spi/spi-nuc900.o
    drivers/spi/spi-nuc900.c:484: error: 'THIS_MODULE' undeclared here (not in a function)
    drivers/spi/spi-nuc900.c:489: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-nuc900.c:489: warning: data definition has no type or storage class
    drivers/spi/spi-nuc900.c:489: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
    drivers/spi/spi-nuc900.c:489: warning: function declaration isn't a prototype
    drivers/spi/spi-nuc900.c:490: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-nuc900.c:490: warning: data definition has no type or storage class
    drivers/spi/spi-nuc900.c:490: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
    drivers/spi/spi-nuc900.c:490: warning: function declaration isn't a prototype
    drivers/spi/spi-nuc900.c:491: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-nuc900.c:491: warning: data definition has no type or storage class
    drivers/spi/spi-nuc900.c:491: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
    drivers/spi/spi-nuc900.c:491: warning: function declaration isn't a prototype
    drivers/spi/spi-nuc900.c:492: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-nuc900.c:492: warning: data definition has no type or storage class
    drivers/spi/spi-nuc900.c:492: warning: type defaults to 'int' in declaration of 'MODULE_ALIAS'
    drivers/spi/spi-nuc900.c:492: warning: function declaration isn't a prototype
    make[2]: *** [drivers/spi/spi-nuc900.o] Error 1
    make[1]: *** [drivers/spi] Error 2
    make: *** [drivers] Error 2

    Signed-off-by: Axel Lin
    Acked-by: Paul Gortmaker
    Signed-off-by: Wolfram Sang

    Axel Lin
     
  • Whithout including 'linux/module.h' spi-ath79 driver fails to compile
    with the these errors:

    drivers/spi/spi-ath79.c:273:12: error: 'THIS_MODULE' undeclared here (not in a function)
    drivers/spi/spi-ath79.c:278:20: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-ath79.c:278:1: warning: data definition has no type or storage class
    drivers/spi/spi-ath79.c:278:1: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
    drivers/spi/spi-ath79.c:278:20: warning: function declaration isn't a prototype
    drivers/spi/spi-ath79.c:279:15: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-ath79.c:279:1: warning: data definition has no type or storage class
    drivers/spi/spi-ath79.c:279:1: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
    drivers/spi/spi-ath79.c:279:15: warning: function declaration isn't a prototype
    drivers/spi/spi-ath79.c:280:16: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-ath79.c:280:1: warning: data definition has no type or storage class
    drivers/spi/spi-ath79.c:280:1: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
    drivers/spi/spi-ath79.c:280:16: warning: function declaration isn't a prototype
    drivers/spi/spi-ath79.c:281:14: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-ath79.c:281:1: warning: data definition has no type or storage class
    drivers/spi/spi-ath79.c:281:1: warning: type defaults to 'int' in declaration of 'MODULE_ALIAS'
    drivers/spi/spi-ath79.c:281:14: warning: function declaration isn't a prototype

    Signed-off-by: Gabor Juhos
    Signed-off-by: Wolfram Sang

    Gabor Juhos
     
  • PPC32/64 defines NO_IRQ to zero, so no problems expected.
    ARM defines NO_IRQ to -1, but OF code relies on IRQ domains support,
    which returns correct ('0') value in 'no irq' case. So everything
    should be fine.

    Other arches might break if some of their OF drivers rely on NO_IRQ
    being not 0. If so, the drivers must be fixed, finally.

    [ Rob Herring points out that microblaze should be fixed, and has posted
    a patch for testing for that. - Linus ]

    Signed-off-by: Anton Vorontsov
    Acked-by: Wolfram Sang
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    vmwgfx: Use kcalloc instead of kzalloc to allocate array
    drm/i915: fix infinite recursion on unbind due to ilk vt-d w/a
    drm/radeon/kms: fix return type for radeon_encoder_get_dp_bridge_encoder_id

    Linus Torvalds
     

07 Dec, 2011

4 commits

  • The advantage of kcalloc is, that will prevent integer overflows which could
    result from the multiplication of number of elements and size and it is also
    a bit nicer to read.

    The semantic patch that makes this change is available
    in https://lkml.org/lkml/2011/11/25/107

    Signed-off-by: Thomas Meyer
    Reviewed-by: Jakob Bornecrantz
    Signed-off-by: Dave Airlie

    Thomas Meyer
     
  • The recursion loop goes retire_requests->unbind->gpu_idle->retire_reqeusts.

    Every time we go through this we need a
    - active object that can be retired
    - and there are no other references to that object than the one from
    the active list, so that it gets unbound and freed immediately.
    Otherwise the recursion stops. So the recursion is only limited by the
    number of objects that fit these requirements sitting in the active list
    any time retire_request is called.

    Issue exercised by tests/gem_unref_active_buffers from i-g-t.

    There's been a decent bikeshed discussion whether it wouldn't be
    better to pass around a flag, but imo this is o.k. for such a limited
    case that only supports a w/a.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42180

    Signed-Off-by: Daniel Vetter
    Reviewed-by: Chris Wilson
    [ickle- we built better bikesheds, but this keeps the rain off for now]
    Tested-by: Dave Airlie
    Signed-off-by: Dave Airlie

    Daniel Vetter
     
  • Seems like something got mis-merged here.

    Noticed by kallisti5 on IRC.

    Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Alex Deucher
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
    net: Silence seq_scale() unused warning
    ipv4:correct description for tcp_max_syn_backlog
    pasemi_mac: Fix building as module
    netback: Fix alert message.
    r8169: fix Rx index race between FIFO overflow recovery and NAPI handler.
    r8169: Rx FIFO overflow fixes.
    ipv4: Fix peer validation on cached lookup.
    ipv4: make sure RTO_ONLINK is saved in routing cache
    iwlwifi: change the default behavior of watchdog timer
    iwlwifi: do not re-configure HT40 after associated
    iwlagn: fix HW crypto for TX-only keys
    Revert "mac80211: clear sta.drv_priv on reconfiguration"
    mac80211: fill rate filter for internal scan requests
    cfg80211: amend regulatory NULL dereference fix
    cfg80211: fix race on init and driver registration

    Linus Torvalds
     

06 Dec, 2011

10 commits

  • The clock_getres() function must return the resolution in the timespec
    argument and return 0 for success.

    Signed-off-by: Thomas Gleixner
    Acked-by: John Stultz
    Cc: stable@kernel.org
    Cc: Richard Cochran

    Thomas Gleixner
     
  • Fix the following compile warning with hex2bin() usage:

    drivers/target/iscsi/iscsi_target_auth.c: In function ‘chap_string_to_hex’:
    drivers/target/iscsi/iscsi_target_auth.c:35: warning: ignoring return value of ‘hex2bin’, declared with attribute warn_unused_result

    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • If an attribute is present (but not yet supported) it should be OK
    to write 0 (a no-op) to the attribute.

    This is an issue because userspace should be able to save and restore all
    set attribute values without error.

    Signed-off-by: Andy Grover
    Signed-off-by: Nicholas Bellinger

    Andy Grover
     
  • So the code assumes that the sg list is only a array while in reality
    loopback SGL memory via scsi_cmnd into target-core may be already
    chained. This patch converts ramdisk code to use sg_miter logic from
    scatterlist.h in order to properly support passthrough SGL usage with
    transport_generic_map_mem_to_cmd() via loopback.

    With this patch the bug goes away. However after umount/mount of the
    device my files are gone. So something is still not right. After looking
    at it for a while I decided to rewrite the that part of the code and now
    things do work for me.

    For reference:
    - http://article.gmane.org/gmane.linux.scsi.target.devel/595
    the sg_next() conversion
    - http://article.gmane.org/gmane.linux.scsi.target.devel/602
    the rewrite of the copy code

    (nab: Fix compile warning in rd_MEMCPY)

    Signed-off-by: Sebastian Andrzej Siewior
    Cc: stable@kernel.org
    Signed-off-by: Nicholas Bellinger

    Sebastian Andrzej Siewior
     
  • Breakout rd_MEMCPY_do_task() usage of do_div() to tmp value during
    rd_request->rd_page assignment.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Nicholas Bellinger

    Sebastian Andrzej Siewior
     
  • Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • This patch changes fileio to use for_each_sg() when walking se_task->task_sg
    memory passed into from loopback LLD struct scsi_cmnd scatterlist memory.

    This addresses an issue where FILEIO backends with loopback where hitting the
    following OOPs with mkfs.ext2:

    |kernel BUG at include/linux/scatterlist.h:97!
    |invalid opcode: 0000 [#1] PREEMPT SMP
    |Modules linked in: sd_mod tcm_loop target_core_stgt scsi_tgt target_core_pscsi target_core_file target_core_iblock target_core_mod configfs scsi_mod
    |
    |Pid: 671, comm: LIO_fileio Not tainted 3.1.0-rc10+ #139 Bochs Bochs
    |EIP: 0060:[] EFLAGS: 00010202 CPU: 0
    |EIP is at fd_do_task+0x396/0x420 [target_core_file]
    | [] __transport_execute_tasks+0xd4/0x190 [target_core_mod]
    | [] transport_execute_tasks+0x3c/0xf0 [target_core_mod]
    |EIP: [] fd_do_task+0x396/0x420 [target_core_file] SS:ESP 0068:dea47e90

    Signed-off-by: Sebastian Andrzej Siewior
    Cc: Christoph Hellwig
    Cc: stable@kernel.org
    Signed-off-by: Nicholas Bellinger

    Sebastian Andrzej Siewior
     
  • Some are never used, some are set but never read, dev_hoq_count is
    incremented and decremented, but never read.

    Signed-off-by: Joern Engel
    Signed-off-by: Nicholas Bellinger

    Jörn Engel
     
  • The LSB of the page length is at offset 3, not 2.

    Signed-off-by: Roland Dreier
    Cc: stable@kernel.org
    Signed-off-by: Nicholas Bellinger

    Roland Dreier
     
  • SBC-3 says:

    A TRANSFER LENGTH field set to zero specifies that 256 logical
    blocks shall be written. Any other value specifies the number
    of logical blocks that shall be written.

    The old code was always just returning the value in the TRANSFER LENGTH
    byte. Fix this to return 256 if the byte is 0.

    Signed-off-by: Roland Dreier
    Cc: stable@kernel.org
    Signed-off-by: Nicholas Bellinger

    Roland Dreier