09 Dec, 2011

5 commits


08 Dec, 2011

5 commits

  • * '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
     
  • 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

26 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
     
  • IO commands with a TRANSFER LENGTH of 0 are not an error; for example,
    for READ (10) and WRITE (10), SBC-3 says:

    A TRANSFER LENGTH field set to zero specifies that no logical blocks
    shall be read. This condition shall not be considered an error.

    In case we have nothing to do, just complete the command with good status.

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

    Roland Dreier
     
  • The semantic patch that makes this change is available
    in scripts/coccinelle/api/memdup.cocci.

    Signed-off-by: Thomas Meyer
    Signed-off-by: Nicholas Bellinger

    Thomas Meyer
     
  • This patch sets the missing ISCSI_FLAG_CMD_FINAL bit in
    iscsit_send_task_mgt_rsp() for a struct iscsi_tm_rsp PDU.

    This usage is hardcoded for all TM response PDUs in RFC-3720
    section 10.6.

    Reported-by: whucecil
    Cc: stable@kernel.org
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • This patch fixes iscsi-target handling of underflow where residual data is
    causing an OOPs by using the incorrect iscsi_cmd_t->data_length initially
    assigned in iscsit_allocate_se_cmd(). It resets iscsi_cmd_t->data_length
    from se_cmd_t->data_length after transport_generic_allocate_tasks()
    has been invoked in iscsit_handle_scsi_cmd() RX context, and converts
    iscsi_cmd->residual_count usage to access iscsi_cmd->se_cmd.residual_count
    to get the proper residual count set by target-core.

    Reported-by:
    Cc: Christoph Hellwig
    Cc: Andy Grover
    Cc: stable@kernel.org
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • This patch changes transport_generic_map_mem_to_cmd() to reject SCSI data
    overflow and to send exception status with CHECK_CONDITION + TCM_INVALID_CDB_FIELD
    for fabrics that are passing a pre-populated struct scatterlist (eg: tcm_loop
    and iscsi-target) being mapped into se_cmd->t_data_sg and se_cmd->t_data_nents.

    This addresses an OOPs where transport_allocate_data_tasks() would walk
    the incorrect post OVERFLOW cmd->data_length value beyond the end of
    the passed scatterlist.

    Cc: Christoph Hellwig
    Cc: Andy Grover
    Cc: stable@kernel.org
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • And use a SCF_BIDI flag instead.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • And use a SCF_FUA flag instead.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • We never walk ordered_cmd_list in the se_device, so remove all code related
    to supporting it.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • We already have a perfectly valid se_device pointer in the command, so
    remove the mostly useless duplicates.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • This patch removes config_item_name() informational usage of
    TFO->free_wwn() treewide in loopback, tcm_fc, ib_srpt and
    tcm_vhost module code.

    Using v4 target_core_fabric_configfs.c logic, a fabric call for
    config_item_name() in TFO->drop_wwn() context returns NULL as
    target_fabric_drop_wwn() invoking config_item_put() ->
    config_group_put() will release fabric_port->port_wwn.wwn_group
    before the last config_item_put() -> TFO->drop_wwn() is
    invoked.

    Reported-by: Bart Van Assche
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • Signed-off-by: Roland Dreier
    Signed-off-by: Nicholas Bellinger

    Roland Dreier
     
  • While testing ib_srpt I noticed that the target system became
    rather unresponsive during intensive I/O. The patch below made
    my target system responsive again during I/O without decreasing
    performance.

    Signed-off-by: Bart Van Assche
    Signed-off-by: Nicholas Bellinger

    Bart Van Assche
     
  • This patch adds missing kfree() for an allocation in iscsi_login_zero_tsih_s1()
    code, and make transport_init_session() check for IS_ERR() returns.

    Reported-by: Dan Carpenter
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     
  • This patch removes legacy usage of PYX_TRANSPORT_* return codes in a number
    of locations and addresses cases where transport_generic_request_failure()
    was returning the incorrect sense upon CHECK_CONDITION status after the
    v3.1 converson to use errno return codes.

    This includes the conversion of transport_generic_request_failure() to
    process cmd->scsi_sense_reason and handle extra TCM_RESERVATION_CONFLICT
    before calling transport_send_check_condition_and_sense() to queue up
    response status. It also drops PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES legacy
    usgae, and returns TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE w/ a response
    for these cases.

    transport_generic_allocate_tasks(), transport_generic_new_cmd(), backend
    SCF_SCSI_DATA_SG_IO_CDB ->do_task(), and emulated ->execute_task() have
    all been updated to set se_cmd->scsi_sense_reason and return errno codes
    universally upon failure. This includes cmd->scsi_sense_reason assignment
    in target_core_alua.c, target_core_pr.c and target_core_cdb.c emulation code.

    Finally it updates fabric modules to remove the legacy usage, and for
    TFO->new_cmd_map() callers forwards return values outside of fabric code.
    iscsi-target has also been updated to remove a handful of special cases
    related to the cleanup and signaling QUEUE_FULL handling w/ ft_write_pending()

    (v2: Drop extra SCF_SCSI_CDB_EXCEPTION check during failure from
    transport_generic_new_cmd, and re-add missing task->task_error_status
    assignment in transport_complete_task)

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

    Nicholas Bellinger
     
  • Commit ded19addf9c937d83b9bfb4d73a836732569041b ('pasemic_mac*: Move
    the PA Semi driver') inadvertently split pasemi_mac into two separate
    modules with unresolved symbols. Change it back into a single module.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • The original message in netback_init was 'kthread_run() fails', which should be
    'kthread_create() fails'.

    Signed-off-by: Wei Liu
    Acked-by: Ian Campbell
    Signed-off-by: David S. Miller

    Wei Liu