26 Jul, 2012

1 commit


20 Jul, 2012

15 commits

  • Now that scsi registers its async scan work with the async subsystem,
    wait_for_device_probe() is sufficient for ensuring all scanning is
    complete.

    [jejb: fix merge problems with eea03c20ae38 Make wait_for_device_probe() also do scsi_complete_async_scans()]
    Signed-off-by: Dan Williams
    Tested-by: Eldad Zack
    Signed-off-by: James Bottomley

    Dan Williams
     
  • Make use of USB quirk method to identify such HDD while reading
    the cache status in sd_probe(). If cache quirk is present for
    the HDD, lets assume that cache is enabled and make WCE bit
    equal to 1.

    Signed-off-by: Namjae Jeon
    Signed-off-by: Pankaj Kumar
    Signed-off-by: Amit Sahrawat
    Signed-off-by: James Bottomley

    Namjae Jeon
     
  • 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
     
  • When recovering failed eh-cmnds let the lldd attempt an abort via
    scsi_abort_eh_cmnd before escalating.

    Reviewed-by: Jacek Danecki
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • The strategy handlers may be called in places that are problematic for
    libsas (i.e. sata resets outside of domain revalidation filtering /
    libata link recovery), or problematic for userspace (non-blocking ioctl
    to sleeping reset functions). However, these routines are also called
    for eh escalations and recovery of scsi_eh_prep_cmnd(), so permit them
    as long as we are running in the host's error handler, otherwise arrange
    for them to be triggered in eh_context.

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

    Dan Williams
     
  • When managing shost->host_eh_scheduled libata assumes that there is a
    1:1 shost-to-ata_port relationship. libsas creates a 1:N relationship
    so it needs to manage host_eh_scheduled cumulatively at the host level.
    The sched_eh and end_eh port port ops allow libsas to track when domain
    devices enter/leave the "eh-pending" state under ha->lock (previously
    named ha->state_lock, but it is no longer just a lock for ha->state
    changes).

    Since host_eh_scheduled indicates eh without backing commands pinning
    the device it can be deallocated at any time. Move the taking of the
    domain_device reference under the port_lock to guarantee that the
    ata_port stays around for the duration of eh.

    Reviewed-by: Jacek Danecki
    Acked-by: Jeff Garzik
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • Introduce scsi_dh_attached_handler_name() to retrieve the name of the
    scsi_dh that is attached to the scsi_device associated with the provided
    request queue. Returns NULL if a scsi_dh is not attached.

    Also, fix scsi_dh_{attach,detach} function header comments to document
    @q rather than @sdev.

    Signed-off-by: Mike Snitzer
    Tested-by: Babu Moger
    Reviewed-by: Chandra Seetharaman
    Acked-by: Hannes Reinecke
    Signed-off-by: James Bottomley

    Mike Snitzer
     
  • During alua transitions, an array can return transitioning
    status in response to rtpg requests. These requests get
    retried for a maximum of 60 seconds by default before timing
    out. Sometimes this timeout isn't sufficient to allow the
    array to complete the transition. T10-spc4 addresses this
    under 'Report Target Port Groups' command.

    This update retrieves the timeout value from the storage
    array if available and retries the transitioning rtpgs
    for up to the 'implied transitioning timeout' value

    Signed-off-by: Rob Evers
    Reviewed-by: Babu Moger
    Signed-off-by: James Bottomley

    Rob Evers
     
  • This has scsi_internal_device_unblock/scsi_target_unblock take
    the new state to set the devices as an argument instead of
    always setting to running. The patch also converts users of these
    functions.

    This allows the FC and iSCSI class to transition devices from blocked
    to transport-offline, so that when fast_io_fail/replacement_timeout
    has fired we do not set the devices back to running. Instead, we
    set them to SDEV_TRANSPORT_OFFLINE.

    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Mike Christie
     
  • This patch adds a new state SDEV_TRANSPORT_OFFLINE. It will
    be used by transport classes to offline devices for cases like
    when the fast_io_fail/recovery_tmo fires. In those cases we
    want all IO to fail, and we have not yet escalated to dev_loss_tmo
    behavior where we are removing the devices.

    Currently to handle this state, transport classes are setting
    the scsi_device's state to running, setting their internal
    session/port structs state to something that indicates failed,
    and then failing IO from some transport check in the queuecommand.

    The reason for the new value is so that users can distinguish
    between a device failure that is a result of a transport problem
    vs the wide range of errors that devices get offlined for
    when a scsi command times out and we offline the devices there.
    It also fixes the confusion as to why the transport class is
    failing IO, but has set the device state from blocked to running.

    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Mike Christie
     
  • Updates newly added stats from fc_get_host_stats,
    added new function fc_exch_update_stats to
    update exches related stats from fc_exch.c
    by going thru internal ema_list elements.

    Signed-off-by: Vasu Dev
    Acked-by : Robert Love
    Tested-by: Ross Brattain
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • Adds stats to track FCP pkt and frame alloc
    failure.

    Signed-off-by: Vasu Dev
    Acked-by : Robert Love
    Tested-by: Ross Brattain
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • The libfc is used by fcoe but fcoe agnostic,
    and therefore should not have any fcoe references.

    So renaming fcoe_dev_stats from libfc as its for fc_stats.
    After that libfc is fcoe string free except some strings for
    Open-FCoE.org.

    Signed-off-by: Vasu Dev
    Acked-by : Robert Love
    Tested-by: Ross Brattain
    Acked-by: Bhanu Prakash Gollapudi
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • The libfc provides more flexibility and with that
    we can monitor some more FC specific stats for
    FC exches or FCP error cases, this patch add
    such new FC stats.

    The patch adds *only* FC specific new stats to
    existing fc_host attribute container.

    Added stats names are self explanatory as
    existing FC stats already has, however anyway
    still added commentary along their definition
    to describe them.

    Signed-off-by: Vasu Dev
    Acked-by : Robert Love
    Tested-by: Ross Brattain
    Signed-off-by: James Bottomley

    Vasu Dev
     

08 Jul, 2012

2 commits

  • fill_result_tf() grabs the taskfile flags from the originating qc which
    sas_ata_qc_fill_rtf() promptly overwrites. The presence of an
    ata_taskfile in the sata_device makes it tempting to just copy the full
    contents in sas_ata_qc_fill_rtf(). However, libata really only wants
    the fis contents and expects the other portions of the taskfile to not
    be touched by ->qc_fill_rtf. To that end store a fis buffer in the
    sata_device and use ata_tf_from_fis() like every other ->qc_fill_rtf()
    implementation.

    Cc:
    Reported-by: Praveen Murali
    Tested-by: Praveen Murali
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     
  • Avoid crashing if the private_data pointer happens to be NULL. This has
    been seen sometimes when a host reset happens, notably when there are
    many LUNs:

    host3: Assigned Port ID 0c1601
    scsi host3: libfc: Host reset succeeded on port (0c1601)
    BUG: unable to handle kernel NULL pointer dereference at 0000000000000350
    IP: [] scsi_send_eh_cmnd+0x58/0x3a0

    Process scsi_eh_3 (pid: 4144, threadinfo ffff88030920c000, task ffff880326b160c0)
    Stack:
    000000010372e6ba 0000000000000282 000027100920dca0 ffffffffa0038ee0
    0000000000000000 0000000000030003 ffff88030920dc80 ffff88030920dc80
    00000002000e0000 0000000a00004000 ffff8803242f7760 ffff88031326ed80
    Call Trace:
    [] ? lock_timer_base+0x70/0x70
    [] scsi_eh_tur+0x3e/0xc0
    [] scsi_eh_test_devices+0x76/0x170
    [] scsi_eh_host_reset+0x85/0x160
    [] scsi_eh_ready_devs+0x91/0x110
    [] scsi_unjam_host+0xed/0x1f0
    [] scsi_error_handler+0x1a8/0x200
    [] ? scsi_unjam_host+0x1f0/0x1f0
    [] kthread+0x9e/0xb0
    [] kernel_thread_helper+0x4/0x10
    [] ? kthread_freezable_should_stop+0x70/0x70
    [] ? gs_change+0x13/0x13
    Code: 25 28 00 00 00 48 89 45 c8 31 c0 48 8b 87 80 00 00 00 48 8d b5 60 ff ff ff 89 d1 48 89 fb 41 89 d6 4c 89 fa 48 8b 80 b8 00 00 00
    8b 80 50 03 00 00 48 8b 00 48 89 85 38 ff ff ff 48 8b 07 4c
    RIP [] scsi_send_eh_cmnd+0x58/0x3a0
    RSP
    CR2: 0000000000000350

    Signed-off-by: Mark Rustad
    Tested-by: Marcus Dennis
    Cc:
    Signed-off-by: James Bottomley

    Mark Rustad
     

29 Jun, 2012

2 commits


23 Jun, 2012

1 commit

  • Several bug reports have been received recently for USB mass-storage
    devices that don't handle READ CAPACITY(16) commands properly. They
    report bogus sizes, in some cases becoming unusable as a result.

    The bugs were triggered by commit
    09b6b51b0b6c1b9bb61815baf205e4d74c89ff04 (SCSI & usb-storage: add
    flags for VPD pages and REPORT LUNS), which caused usb-storage to stop
    overriding the SCSI level reported by devices. By default, the sd
    driver will try READ CAPACITY(16) first for any device whose level is
    above SCSI_SPC_2.

    It seems likely that any device large enough to require the use of
    READ CAPACITY(16) (i.e., 2 TB or more) would be able to handle READ
    CAPACITY(10) commands properly. Indeed, I don't know of any devices
    that don't handle READ CAPACITY(10) properly.

    Therefore this patch (as1559) adds a new flag telling the sd driver
    to try READ CAPACITY(10) before READ CAPACITY(16), and sets this flag
    for every USB mass-storage device. If a device really is larger than
    2 TB, sd will fall back to READ CAPACITY(16) just as it used to.

    This fixes Bugzilla #43391.

    Signed-off-by: Alan Stern
    Acked-by: Hans de Goede
    CC: "James E.J. Bottomley"
    CC: Matthew Dharm
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

23 May, 2012

3 commits

  • This patch has the SW FCoE driver and the bnx2fc
    driver make use of the new fcoe_sysfs API added
    earlier in this patch series.

    After this patch a fcoe_ctlr_device is allocated with
    private data in this order.

    +------------------+ +------------------+
    | fcoe_ctlr_device | | fcoe_ctlr_device |
    +------------------+ +------------------+
    | fcoe_ctlr | | fcoe_ctlr |
    +------------------+ +------------------+
    | fcoe_interface | | bnx2fc_interface |
    +------------------+ +------------------+

    libfcoe also takes part in this new model since it
    discovers and manages fcoe_fcf instances. The memory
    allocation is different for FCFs. I didn't want to
    impact libfcoe's fcoe_fcf processing, so this patch
    creates fcoe_fcf_device instances for each discovered
    fcoe_fcf. The two are paired using a (void * priv)
    member of the fcoe_ctlr_device. This allows libfcoe
    to continue maintaining its list of fcoe_fcf instances
    and simply attaches and detaches them from existing
    or new fcoe_fcf_device instances.

    Signed-off-by: Robert Love
    Tested-by: Ross Brattain
    Signed-off-by: James Bottomley

    Robert Love
     
  • This patch adds a 'fcoe bus' infrastructure to the kernel
    that is driven by changes to libfcoe which allow LLDs to
    present FIP (FCoE Initialization Protocol) discovered
    entities and their attributes to user space via sysfs.

    This patch adds the following APIs-

    fcoe_ctlr_device_add
    fcoe_ctlr_device_delete
    fcoe_fcf_device_add
    fcoe_fcf_device_delete

    They allow the LLD to expose the FCoE ENode Controller
    and any discovered FCFs (Fibre Channel Forwarders, e.g.
    FCoE switches) to the user. Each of these new devices
    has their own bus_type so that they are grouped together
    for easy lookup from a user space application. Each
    new class has an attribute_group to expose attributes
    for any created instances. The attributes are-

    fcoe_ctlr_device
    * fcf_dev_loss_tmo
    * lesb_link_fail
    * lesb_vlink_fail
    * lesb_miss_fka
    * lesb_symb_err
    * lesb_err_block
    * lesb_fcs_error

    fcoe_fcf_device
    * fabric_name
    * switch_name
    * priority
    * selected
    * fc_map
    * vfid
    * mac
    * fka_peroid
    * fabric_state
    * dev_loss_tmo

    A device loss infrastructre similar to the FC Transport's
    is also added by this patch. It is nice to have so that a
    link flapping adapter doesn't continually advance the count
    used to identify the discovered FCF. FCFs will exist in a
    "Disconnected" state until either the timer expires or the
    FCF is rediscovered and becomes "Connected."

    This patch generates a few checkpatch.pl WARNINGS that
    I'm not sure what to do about. They're macros modeled
    around the FC Transport attribute building macros, which
    have the same 'feature' where the caller can ommit a cast
    in the argument list and no cast occurs in the code. I'm
    not sure how to keep the code condensed while keeping the
    macros. Any advice would be appreciated.

    Signed-off-by: Robert Love
    Tested-by: Ross Brattain
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: James Bottomley

    Robert Love
     
  • Currently the fcoe_ctlr associated with an interface is allocated
    as a member of struct fcoe_interface. This causes problems when
    attempting to use the new fcoe_sysfs APIs which allow us to allocate
    the fcoe_interface as private data to the fcoe_ctlr_device instance.
    The problem is that libfcoe wants to be able use pointer math to find a
    fcoe_ctlr's fcoe_ctlr_device as well as finding a fcoe_ctlr_device's
    assocated fcoe_ctlr. To do this we need to allocate the
    fcoe_ctlr_device, with private data for the LLD. The private data
    contains the fcoe_ctlr and its private data is the fcoe_interface.
    This patch only allocates the fcoe_interface with the fcoe_ctlr, the
    fcoe_ctlr_device will be added in a later patch, which will complete
    the below diagram-

    +------------------+
    | fcoe_ctlr_device |
    +------------------+
    | fcoe_ctlr |
    +------------------+
    | fcoe_interface |
    +------------------+

    This prep work will allow us to go from a fcoe_ctlr_device instance
    to its fcoe_ctlr as well as from a fcoe_ctlr to its fcoe_ctlr_device
    once the fcoe_sysfs API is in use (later patches in this series).

    Signed-off-by: Robert Love
    Tested-by: Ross Brattain
    Signed-off-by: James Bottomley

    Robert Love
     

21 May, 2012

1 commit

  • isci update for 3.5

    1/ Rework remote-node-context (RNC) handling for proper management of
    the silicon state machine in error handling and hot-plug conditions.
    Further details below, suffice to say if the RNC is mismanaged the
    silicon state machines may lock up.

    2/ Refactor the initialization code to be reused for suspend/resume support

    3/ Miscellaneous bug fixes to address discovery issues and hardware
    compatibility.

    RNC rework details from Jeff Skirvin:

    In the controller, devices as they appear on a SAS domain (or
    direct-attached SATA devices) are represented by memory structures known
    as "Remote Node Contexts" (RNCs). These structures are transferred from
    main memory to the controller using a set of register commands; these
    commands include setting up the context ("posting"), removing the
    context ("invalidating"), and commands to control the scheduling of
    commands and connections to that remote device ("suspensions" and
    "resumptions"). There is a similar path to control RNC scheduling from
    the protocol engine, which interprets the results of command and data
    transmission and reception.

    In general, the controller chooses among non-suspended RNCs to find one
    that has work requiring scheduling the transmission of command and data
    frames to a target. Likewise, when a target tries to return data back
    to the initiator, the state of the RNC is used by the controller to
    determine how to treat the incoming request. As an example, if the RNC
    is in the state "TX/RX Suspended", incoming SSP connection requests from
    the target will be rejected by the controller hardware. When an RNC is
    "TX Suspended", it will not be selected by the controller hardware to
    start outgoing command or data operations (with certain priority-based
    exceptions).

    As mentioned above, there are two sources for management of the RNC
    states: commands from driver software, and the result of transmission
    and reception conditions of commands and data signaled by the controller
    hardware. As an example of the latter, if an outgoing SSP command ends
    with a OPEN_REJECT(BAD_DESTINATION) status, the RNC state will
    transition to the "TX Suspended" state, and this is signaled by the
    controller hardware in the status to the completion of the pending
    command as well as signaled in a controller hardware event. Examples of
    the former are included in the patch changelogs.

    Driver software is required to suspend the RNC in a "TX/RX Suspended"
    condition before any outstanding commands can be terminated. Failure to
    guarantee this can lead to a complete hardware hang condition. Earlier
    versions of the driver software did not guarantee that an RNC was
    correctly managed before I/O termination, and so operated in an unsafe
    way.

    Further, the driver performed unnecessary contortions to preserve the
    remote device command state and so was more complicated than it needed
    to be. A simplifying driver assumption is that once an I/O has entered
    the error handler path without having completed in the target, the
    requirement on the driver is that all use of the sas_task must end.
    Beyond that, recovery of operation is dependent on libsas and other
    components to reset, rediscover and reconfigure the device before normal
    operation can restart. In the driver, this simplifying assumption meant
    that the RNC management could be reduced to entry into the suspended
    state, terminating the targeted I/O request, and resuming the RNC as
    needed for device-specific management such as an SSP Abort Task or LUN
    Reset Management request.

    James Bottomley
     

18 May, 2012

1 commit


25 Apr, 2012

1 commit


23 Apr, 2012

2 commits

  • 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: [] sas_ata_end_eh+0x12/0x5e [libsas]
    ...
    [] sas_unregister_common_dev+0x78/0xc9 [libsas]
    [] sas_unregister_dev+0x4f/0xad [libsas]
    [] sas_unregister_domain_devices+0x7f/0xbf [libsas]
    [] sas_deform_port+0x61/0x1b8 [libsas]
    [] 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: Michal Kosciowski
    Signed-off-by: Dan Williams
    Acked-by: Jeff Garzik
    Signed-off-by: James Bottomley

    Dan Williams
     
  • 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: [] process_one_work+0x2e/0x338

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

    Dan Williams
     

16 Apr, 2012

1 commit

  • Commit 18a4d0a22ed6 ("[SCSI] Handle disk devices which can not process
    medium access commands") introduced a bug in which we would attempt to
    dereference the scsi driver even when the device had no ULD attached.

    Ensure that a driver is registered and make the driver accessor function
    more resilient to errors during device discovery.

    Reported-by: Elric Fu
    Reported-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Linus Torvalds

    Martin K. Petersen
     

01 Apr, 2012

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is primarily another round of driver updates (lpfc, bfa, fcoe,
    ipr) plus a new ufshcd driver. There shouldn't be anything
    controversial in here (The final deletion of scsi proc_ops which
    caused some build breakage has been held over until the next merge
    window to give us more time to stabilise it).

    I'm afraid, with me moving continents at exactly the wrong time,
    anything submitted after the merge window opened has been held over to
    the next merge window."

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (63 commits)
    [SCSI] ipr: Driver version 2.5.3
    [SCSI] ipr: Increase alignment boundary of command blocks
    [SCSI] ipr: Increase max concurrent oustanding commands
    [SCSI] ipr: Remove unnecessary memory barriers
    [SCSI] ipr: Remove unnecessary interrupt clearing on new adapters
    [SCSI] ipr: Fix target id allocation re-use problem
    [SCSI] atp870u, mpt2sas, qla4xxx use pci_dev->revision
    [SCSI] fcoe: Drop the rtnl_mutex before calling fcoe_ctlr_link_up
    [SCSI] bfa: Update the driver version to 3.0.23.0
    [SCSI] bfa: BSG and User interface fixes.
    [SCSI] bfa: Fix to avoid vport delete hang on request queue full scenario.
    [SCSI] bfa: Move service parameter programming logic into firmware.
    [SCSI] bfa: Revised Fabric Assigned Address(FAA) feature implementation.
    [SCSI] bfa: Flash controller IOC pll init fixes.
    [SCSI] bfa: Serialize the IOC hw semaphore unlock logic.
    [SCSI] bfa: Modify ISR to process pending completions
    [SCSI] bfa: Add fc host issue lip support
    [SCSI] mpt2sas: remove extraneous sas_log_info messages
    [SCSI] libfc: fcoe_transport_create fails in single-CPU environment
    [SCSI] fcoe: reduce contention for fcoe_rx_list lock [v2]
    ...

    Linus Torvalds
     

28 Mar, 2012

1 commit

  • Some switch implementations (eg., HP virtual connect FlexFabric) send two MAC
    descriptors in FIP FLOGI response, with first MAC descriptor (granted_mac) used
    as FPMA, and the second one (fcoe_mac) used as destination address for
    sending/receiving FCoE packets. fip_mac continues to be used for FIP traffic.
    This patch introduces fcoe_mac in fcoe_fcf structure. For regular switches,
    both fcoe_mac and fip_mac will be the same. For the switches that send
    additional MAC descriptor, fcoe_mac is updated.

    Signed-off-by: Bhanu Prakash Gollapudi
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     

27 Mar, 2012

2 commits


25 Mar, 2012

2 commits

  • Pull avoidance patches from Paul Gortmaker:
    "Nearly every subsystem has some kind of header with a proto like:

    void foo(struct device *dev);

    and yet there is no reason for most of these guys to care about the
    sub fields within the device struct. This allows us to significantly
    reduce the scope of headers including headers. For this instance, a
    reduction of about 40% is achieved by replacing the include with the
    simple fact that the device is some kind of a struct.

    Unlike the much larger module.h cleanup, this one is simply two
    commits. One to fix the implicit users, and then one
    to delete the device.h includes from the linux/include/ dir wherever
    possible."

    * tag 'device-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
    device.h: audit and cleanup users in main include dir
    device.h: cleanup users outside of linux/include (C files)

    Linus Torvalds
     
  • Pull cleanup from Paul Gortmaker:
    "The changes shown here are to unify linux's BUG support under the one
    file. Due to historical reasons, we have some BUG code
    in bug.h and some in kernel.h -- i.e. the support for BUILD_BUG in
    linux/kernel.h predates the addition of linux/bug.h, but old code in
    kernel.h wasn't moved to bug.h at that time. As a band-aid, kernel.h
    was including to pseudo link them.

    This has caused confusion[1] and general yuck/WTF[2] reactions. Here
    is an example that violates the principle of least surprise:

    CC lib/string.o
    lib/string.c: In function 'strlcat':
    lib/string.c:225:2: error: implicit declaration of function 'BUILD_BUG_ON'
    make[2]: *** [lib/string.o] Error 1
    $
    $ grep linux/bug.h lib/string.c
    #include
    $

    We've included for the BUG infrastructure and yet we
    still get a compile fail! [We've not kernel.h for BUILD_BUG_ON.] Ugh -
    very confusing for someone who is new to kernel development.

    With the above in mind, the goals of this changeset are:

    1) find and fix any include/*.h files that were relying on the
    implicit presence of BUG code.
    2) find and fix any C files that were consuming kernel.h and hence
    relying on implicitly getting some/all BUG code.
    3) Move the BUG related code living in kernel.h to
    4) remove the asm/bug.h from kernel.h to finally break the chain.

    During development, the order was more like 3-4, build-test, 1-2. But
    to ensure that git history for bisect doesn't get needless build
    failures introduced, the commits have been reorderd to fix the problem
    areas in advance.

    [1] https://lkml.org/lkml/2012/1/3/90
    [2] https://lkml.org/lkml/2012/1/17/414"

    Fix up conflicts (new radeon file, reiserfs header cleanups) as per Paul
    and linux-next.

    * tag 'bug-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
    kernel.h: doesn't explicitly use bug.h, so don't include it.
    bug: consolidate BUILD_BUG_ON with other bug code
    BUG: headers with BUG/BUG_ON etc. need linux/bug.h
    bug.h: add include of it to various implicit C users
    lib: fix implicit users of kernel.h for TAINT_WARN
    spinlock: macroize assert_spin_locked to avoid bug.h dependency
    x86: relocate get/set debugreg fcns to include/asm/debugreg.

    Linus Torvalds
     

24 Mar, 2012

1 commit

  • This addresses some header check warnings. DRM headers which include
    "drm.h" have been excluded, as they indirectly include types.h.

    Signed-off-by: Bobby Powers
    Cc: Chris Ball
    Cc: Dave Airlie
    Cc: James Bottomley
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bobby Powers
     

23 Mar, 2012

2 commits

  • SCSI updates from James Bottomley:
    "The update includes the usual assortment of driver updates (lpfc,
    qla2xxx, qla4xxx, bfa, bnx2fc, bnx2i, isci, fcoe, hpsa) plus a huge
    amount of infrastructure work in the SAS library and transport class
    as well as an iSCSI update. There's also a new SCSI based virtio
    driver."

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (177 commits)
    [SCSI] qla4xxx: Update driver version to 5.02.00-k15
    [SCSI] qla4xxx: trivial cleanup
    [SCSI] qla4xxx: Fix sparse warning
    [SCSI] qla4xxx: Add support for multiple session per host.
    [SCSI] qla4xxx: Export CHAP index as sysfs attribute
    [SCSI] scsi_transport: Export CHAP index as sysfs attribute
    [SCSI] qla4xxx: Add support to display CHAP list and delete CHAP entry
    [SCSI] iscsi_transport: Add support to display CHAP list and delete CHAP entry
    [SCSI] pm8001: fix endian issue with code optimization.
    [SCSI] pm8001: Fix possible racing condition.
    [SCSI] pm8001: Fix bogus interrupt state flag issue.
    [SCSI] ipr: update PCI ID definitions for new adapters
    [SCSI] qla2xxx: handle default case in qla2x00_request_firmware()
    [SCSI] isci: improvements in driver unloading routine
    [SCSI] isci: improve phy event warnings
    [SCSI] isci: debug, provide state-enum-to-string conversions
    [SCSI] scsi_transport_sas: 'enable' phys on reset
    [SCSI] libsas: don't recover end devices attached to disabled phys
    [SCSI] libsas: fixup target_port_protocols for expanders that don't report sata
    [SCSI] libsas: set attached device type and target protocols for local phys
    ...

    Linus Torvalds
     
  • Pull SCSI target updates from Nicholas Bellinger:
    "This contains the usual set of updates and bugfixes to target-core +
    existing fabric module code, along with a handful of the patches
    destined for v3.3 stable.

    It also contains the necessary target-core infrastructure pieces
    required to run using tcm_qla2xxx.ko WWPNs with the new Qlogic Fibre
    Channel fabric module currently queued in target-pending/for-next-merge,
    and coming for round 2.

    The highlights for this series include:

    - Add target_submit_tmr() helper function for fabric task management
    (andy)
    - Convert tcm_fc to use target_submit_tmr() (andy)
    - Replace target core various cmd flags with a transport state (hch)
    - Convert loopback to use workqueue submission (hch)
    - Convert target core to use array_zalloc for tpg_lun_list (joern)
    - Convert target core to use array_zalloc for device_list (joern)
    - Add target core support for TMR_ABORT_TASK (nab)
    - Add target core se_sess->sess_kref + get/put helpers (nab)
    - Add target core se_node_acl->acl_kref for ->acl_free_comp usage
    (nab)
    - Convert iscsi-target to use target_put_session + sess_kref (nab)
    - Fix tcm_fc fc_exch memory leak in ft_send_resp_status (nab)
    - Fix ib_srpt srpt_handle_cmd send_ioctx->ioctx_kref leak on
    exception (nab)
    - Fix target core up handling of short INQUIRY buffers (roland)
    - Untangle target-core front-end and back-end meanings of max_sectors
    attribute (roland)
    - Set loopback residual field for SCSI commands (roland)
    - Fix target-core 16-bit target ports for SET TARGET PORT GROUPS
    emulation (roland)

    Thanks again to Andy, Christoph, Joern, Roland, and everyone who has
    contributed this round!"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (64 commits)
    ib_srpt: Fix srpt_handle_cmd send_ioctx->ioctx_kref leak on exception
    loopback: Fix transport_generic_allocate_tasks error handling
    iscsi-target: remove improper externs
    iscsi-target: Remove unused variables in iscsi_target_parameters.c
    target: remove obvious warnings
    target: Use array_zalloc for device_list
    target: Use array_zalloc for tpg_lun_list
    target: Fix sense code for unsupported SERVICE ACTION IN
    target: Remove hack to make READ CAPACITY(10) lie if thin provisioning is enabled
    target: Bump core version to v4.1.0-rc2-ml + fabric versions
    tcm_fc: Fix fc_exch memory leak in ft_send_resp_status
    target: Drop unused legacy target_core_fabric_ops API callers
    iscsi-target: Convert to use target_put_session + sess_kref
    target: Convert se_node_acl->acl_group removal to use ->acl_kref
    target: Add se_node_acl->acl_kref for ->acl_free_comp usage
    target: Add se_node_acl->acl_free_comp for NodeACL release path
    target: Add se_sess->sess_kref + get/put helpers
    target: Convert session_lock to irqsave
    target: Fix typo in drivers/target
    iscsi-target: Fix dynamic -> explict NodeACL pointer reference
    ...

    Linus Torvalds
     

16 Mar, 2012

1 commit

  • The header includes a lot of stuff, and
    it in turn gets a lot of use just for the basic "struct device"
    which appears so often.

    Clean up the users as follows:

    1) For those headers only needing "struct device" as a pointer
    in fcn args, replace the include with exactly that.

    2) For headers not really using anything from device.h, simply
    delete the include altogether.

    3) For headers relying on getting device.h implicitly before
    being included themselves, now explicitly include device.h

    4) For files in which doing #1 or #2 uncovers an implicit
    dependency on some other header, fix by explicitly adding
    the required header(s).

    Any C files that were implicitly relying on device.h to be
    present have already been dealt with in advance.

    Total removals from #1 and #2: 51. Total additions coming
    from #3: 9. Total other implicit dependencies from #4: 7.

    As of 3.3-rc1, there were 110, so a net removal of 42 gives
    about a 38% reduction in device.h presence in include/*

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker