21 Jun, 2010

3 commits

  • The problem:

    A target-like userspace driver, e.g. AV/C target or SBP-2/3 target,
    needs to be able to act as responder and requester. In the latter role,
    it needs to send requests to nods from which it received requests. This
    is currently impossible because fw_cdev_event_request lacks information
    about sender node ID.
    Reported-by: Jay Fenlason

    Libffado + libraw1394 + firewire-core is currently unable to drive two
    or more audio devices on the same bus.
    Reported-by: Arnold Krille

    This is because libffado requires destination node ID of FCP requests
    and sender node ID of FCP responses to match. It even prohibits
    libffado from working with a bus on which libraw1394 opens a /dev/fw* as
    default ioctl device that does not correspond with the audio device.
    This is because libraw1394 does not receive the sender node ID from the
    kernel.

    Moreover, fw_cdev_event_request makes it impossible to tell unicast and
    broadcast write requests apart.

    The fix:

    Add a replacement of struct fw_cdev_event_request request, boringly
    called struct fw_cdev_event_request2. The new event will be sent to a
    userspace client instead of the old one if the client claims
    compatibility with ABI version 4 or later.

    libraw1394 needs to be extended to make use of the new event, in order
    to properly support libffado and other FCP or address range mapping
    users who require correct sender node IDs.

    Further notes:

    While we are at it, change back the range of possible values of
    fw_cdev_event_request.tcode to 0x0...0xb like in ABI version

    Stefan Richter
     
  • libraw1394 v2.0.0...v2.0.5 takes FW_CDEV_VERSION from an externally
    installed header file and uses it to declare its own implementation
    level in FW_CDEV_IOC_GET_INFO. This is wrong; it should set the real
    version for which it was actually written.

    If we add features to the kernel ABI that require the kernel to check
    a client's implementation level, we can not trust the client version if
    it was set from FW_CDEV_VERSION.

    Hence freeze FW_CDEV_VERSION at the current value (no damage has been
    done yet), clearly document FW_CDEV_VERSION as a dummy version and what
    clients are expected to do with fw_cdev_get_info.version, and use a new
    defined constant (which is not placed into the exported header file) as
    kernel implementation level.

    Note, in order to check in client program source code which features are
    present in an externally installed linux/firewire-cdev.h, use
    preprocessor directives like
    #ifdef FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE
    or
    #ifdef FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED
    instead of a check of FW_CDEV_VERSION.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • void (*fw_address_callback_t)(..., int speed, ...) is the speed that a
    remote node chose to transmit a request to us. In case of split
    transactions, firewire-core will transmit the response at that speed.

    Upper layer drivers on the other hand (firewire-net, -sbp2, firedtv, and
    userspace drivers) cannot do anything useful with that speed datum,
    except log it for debug purposes. But data that is merely potentially
    (not even actually) used for debug purposes does not belong into the API.

    Signed-off-by: Stefan Richter

    Stefan Richter
     

19 Jun, 2010

2 commits

  • Push the maintenance of STATE_CLEAR/SET.abdicate down into the card
    driver. This way, the read/write_csr_reg driver method works uniformly
    across all CSR offsets.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • by feature variables in the fw_card struct. The hook appeared to be an
    unnecessary abstraction in the card driver interface.

    Cleaner would be to pass those feature flags as arguments to
    fw_card_initialize() or fw_card_add(), but the FairnessControl register
    is in the SCLK domain and may therefore not be accessible while Link
    Power Status is off, i.e. before the card->driver->enable call from
    fw_card_add().

    Signed-off-by: Stefan Richter

    Stefan Richter
     

10 Jun, 2010

4 commits


19 May, 2010

1 commit

  • Using a single timeout for all transaction that need to be flushed does
    not work if the submission of new transactions can defer the timeout
    indefinitely into the future. We need to have timeouts that do not
    change due to other transactions; the simplest way to do this is with a
    separate timer for each transaction.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Stefan Richter (+ one lockdep annotation)

    Clemens Ladisch
     

20 Apr, 2010

1 commit

  • Clemens Ladisch pointed out that
    - BIB_IMC is not named like the field is called in the standard,
    - readers of the code may get worried about the magic 0x0c0083c0,
    - a CSR_NODE_CAPABILITIES key is there in the header but not put to
    good use.

    So let's rename BIB_IMC, add a defined constant for Node_Capabilities
    and a comment which reassures people that somebody thought about it and
    they don't have to (or if they still do, tell them where they have to
    look for confirmation), and prune our incomplete and arbitrary set of
    defined constants of CSR key IDs. And there is a nother magic number,
    that of Bus_Information_Block.Bus_Name, to be defined and commented.

    Signed-off-by: Stefan Richter

    Stefan Richter
     

10 Apr, 2010

2 commits


25 Feb, 2010

4 commits

  • This code was no longer used since 2.6.33, "firewire: ohci: always use
    packet-per-buffer mode for isochronous reception" commit 090699c0. If
    anybody needs this code in the future for special purposes, it can be
    brought back in. But it must not be re-enabled by default; drivers
    (kernelspace or userspace drivers) should only get this mode if they
    explicitly request it.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • so that clients can detect whether the FW_CDEV_IOC_GET_CYCLE_TIMER ioctl
    is reliable (on all tested controllers, especially the widely used VIA
    controllers, also NEC controllers, see commits b677532b and 1c1517ef).

    Also add a comment on the 2.6.32 iso xmit enhancement and on dual-buffer
    IR having been disabled in 2.6.33.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • The system time from CLOCK_REALTIME is not monotonic, hence problematic
    for the main user of the FW_CDEV_IOC_GET_CYCLE_TIMER ioctl. This issue
    exists in its successor ABI, i.e. raw1394, too.
    http://subversion.ffado.org/ticket/242

    We now offer an alternative ioctl which lets the caller choose between
    CLOCK_REALTIME, CLOCK_MONOTONIC, and CLOCK_MONOTONIC_RAW as source of
    the local time, very similar to the clock_gettime libc function. The
    format of the local time return value matches that of clock_gettime
    (seconds and nanoseconds, instead of a single microseconds value from
    the existing ioctl).

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • Signed-off-by: Stefan Richter

    Stefan Richter
     

23 Feb, 2010

1 commit

  • This reverts commit fb1e75389bd06fd5987e9cda1b4e0305c782f854.

    "Benjamin S." reports that the patch in question
    causes a big drop in sequential throughput for him, dropping from
    200MB/sec down to only 70MB/sec.

    Needs to be investigated more fully, for now lets just revert the
    offending commit.

    Conflicts:

    include/linux/blkdev.h

    Signed-off-by: Jens Axboe

    Jens Axboe
     

21 Feb, 2010

1 commit


20 Feb, 2010

1 commit


19 Feb, 2010

2 commits


18 Feb, 2010

1 commit

  • Most laptops have keys that are intended to toggle all device state, not
    just wifi. These are currently generally mapped to KEY_WLAN. As a result,
    rfkill will only kill or enable wifi in response to the key press. This
    confuses users and can make it difficult for them to enable bluetooth
    and wwan devices.

    This patch adds a new keycode, KEY_RFKILL. It indicates that the system
    should toggle the state of all rfkillable devices.

    Signed-off-by: Matthew Garrett
    Acked-by: Marcel Holtmann
    Signed-off-by: Dmitry Torokhov

    Matthew Garrett
     

17 Feb, 2010

1 commit

  • This patch fixes following sparse warnings:

    include/linux/kfifo.h:127:25: warning: Using plain integer as NULL pointer
    kernel/kfifo.c:83:21: warning: Using plain integer as NULL pointer

    Signed-off-by: Anton Vorontsov
    Acked-by: Stefani Seibold
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     

16 Feb, 2010

1 commit


07 Feb, 2010

2 commits

  • ima_path_check actually deals with files! call it ima_file_check instead.

    Signed-off-by: Eric Paris
    Acked-by: Mimi Zohar
    Signed-off-by: Al Viro

    Mimi Zohar
     
  • The "Untangling ima mess, part 2 with counters" patch messed
    up the counters. Based on conversations with Al Viro, this patch
    streamlines ima_path_check() by removing the counter maintaince.
    The counters are now updated independently, from measuring the file,
    in __dentry_open() and alloc_file() by calling ima_counts_get().
    ima_path_check() is called from nfsd and do_filp_open().
    It also did not measure all files that should have been measured.
    Reason: ima_path_check() got bogus value passed as mask.
    [AV: mea culpa]
    [AV: add missing nfsd bits]

    Signed-off-by: Mimi Zohar
    Signed-off-by: Al Viro

    Mimi Zohar
     

05 Feb, 2010

3 commits


04 Feb, 2010

2 commits

  • The value we get from the low byte of the ATA_ID_SECTOR_SIZE word is not not
    a plain multiple, but the log of it, so fix the helper to give the correct
    answer. Without this we'll get an incorrect minimal I/O size in the block
    limits VPD page for 4k sector drives.

    Also change the return value of ata_id_logical_per_physical_sectors to u16
    for the unlikely case of very large logical sectors.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jeff Garzik

    Christoph Hellwig
     
  • Change 'bp_len' type to __u64 to make it work across archs as
    the s390 architecture watch point length can be upto 2^64.

    reference:
    http://lkml.org/lkml/2010/1/25/212

    This is an ABI change that is not backward compatible with
    the previous hardware breakpoint info layout integrated in this
    development cycle, a rebuilt of perf tools is necessary for
    versions based on 2.6.33-rc1 - 2.6.33-rc6 to work with a
    kernel based on this patch.

    Signed-off-by: Mahesh Salgaonkar
    Acked-by: Peter Zijlstra
    Cc: Ananth N Mavinakayanahalli
    Cc: "K. Prasad"
    Cc: Maneesh Soni
    Cc: Heiko Carstens
    Cc: Martin
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Mahesh Salgaonkar
     

03 Feb, 2010

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (23 commits)
    connector: Delete buggy notification code.
    be2net: use eq-id to calculate cev-isr reg offset
    Bluetooth: Use the control channel for raw HID reports
    Bluetooth: Add DFU driver for Atheros Bluetooth chipset AR3011
    Bluetooth: Redo checks in IRQ handler for shared IRQ support
    Bluetooth: Fix memory leak in L2CAP
    Bluetooth: Remove double free of SKB pointer in L2CAP
    cdc_ether: Partially revert "usbnet: Set link down initially ..."
    be2net: Fix memset() arg ordering.
    bonding: bond_open error return value
    ixgbe: if ixgbe_copy_dcb_cfg is going to fail learn about it early
    ixgbe: set the correct DCB bit for pg tx settings
    igbvf: fix issue w/ mapped_as_page being left set after unmap
    drivers/net: ks8851_mll ethernet network driver
    be2net: Bug fix to support newer generation of BE ASIC
    starfire: clean up properly if firmware loading fails
    mac80211: fix NULL pointer dereference when ftrace is enabled
    netfilter: ctnetlink: fix expectation mask dump
    ipv6: conntrack: Add member of user to nf_ct_frag6_queue structure
    ath9k: fix eeprom INI values override for 2GHz-only cards
    ...

    Linus Torvalds
     
  • On Tue, Feb 02, 2010 at 02:57:14PM -0800, Greg KH (gregkh@suse.de) wrote:
    > > There are at least two ways to fix it: using a big cannon and a small
    > > one. The former way is to disable notification registration, since it is
    > > not used by anyone at all. Second way is to check whether calling
    > > process is root and its destination group is -1 (kind of priveledged
    > > one) before command is dispatched to workqueue.
    >
    > Well if no one is using it, removing it makes the most sense, right?
    >
    > No objection from me, care to make up a patch either way for this?

    Getting it is not used, let's drop support for notifications about
    (un)registered events from connector.
    Another option was to check credentials on receiving, but we can always
    restore it without bugs if needed, but genetlink has a wider code base
    and none complained, that userspace can not get notification when some
    other clients were (un)registered.

    Kudos for Sebastian Krahmer , who found a bug in the
    code.

    Signed-off-by: Evgeniy Polyakov
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Evgeniy Polyakov
     

02 Feb, 2010

2 commits

  • …/git/tip/linux-2.6-tip

    * 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    perf, hw_breakpoint, kgdb: Do not take mutex for kernel debugger
    x86, hw_breakpoints, kgdb: Fix kgdb to use hw_breakpoint API
    hw_breakpoints: Release the bp slot if arch_validate_hwbkpt_settings() fails.
    perf: Ignore perf.data.old
    perf report: Fix segmentation fault when running with '-g none'

    Linus Torvalds
     
  • * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
    powerpc: TIF_ABI_PENDING bit removal
    powerpc/pseries: Fix xics build without CONFIG_SMP
    powerpc/4xx: Add pcix type 1 transactions
    powerpc/pci: Add missing call to header fixup
    powerpc/pci: Add missing hookup to pci_slot
    powerpc/pci: Add calls to set_pcie_port_type() and set_pcie_hotplug_bridge()
    powerpc/40x: Update the PowerPC 40x board defconfigs
    powerpc/44x: Update PowerPC 44x board defconfigs

    Linus Torvalds
     

01 Feb, 2010

1 commit

  • When CONFIG_HAVE_UNSTABLE_SCHED_CLOCK is set, sched_clock() gets
    the time from hardware such as the TSC on x86. In this
    configuration kgdb will report a softlock warning message on
    resuming or detaching from a debug session.

    Sequence of events in the problem case:

    1) "cpu sched clock" and "hardware time" are at 100 sec prior
    to a call to kgdb_handle_exception()

    2) Debugger waits in kgdb_handle_exception() for 80 sec and on
    exit the following is called ... touch_softlockup_watchdog() -->
    __raw_get_cpu_var(touch_timestamp) = 0;

    3) "cpu sched clock" = 100s (it was not updated, because the
    interrupt was disabled in kgdb) but the "hardware time" = 180 sec

    4) The first timer interrupt after resuming from
    kgdb_handle_exception updates the watchdog from the "cpu sched clock"

    update_process_times() { ... run_local_timers() -->
    softlockup_tick() --> check (touch_timestamp == 0) (it is "YES"
    here, we have set "touch_timestamp = 0" at kgdb) -->
    __touch_softlockup_watchdog() ***(A)--> reset "touch_timestamp"
    to "get_timestamp()" (Here, the "touch_timestamp" will still be
    set to 100s.) ...

    scheduler_tick() ***(B)--> sched_clock_tick() (update "cpu sched
    clock" to "hardware time" = 180s) ... }

    5) The Second timer interrupt handler appears to have a large
    jump and trips the softlockup warning.

    update_process_times() { ... run_local_timers() -->
    softlockup_tick() --> "cpu sched clock" - "touch_timestamp" =
    180s-100s > 60s --> printk "soft lockup error messages" ... }

    note: ***(A) reset "touch_timestamp" to
    "get_timestamp(this_cpu)"

    Why is "touch_timestamp" 100 sec, instead of 180 sec?

    When CONFIG_HAVE_UNSTABLE_SCHED_CLOCK is set, the call trace of
    get_timestamp() is:

    get_timestamp(this_cpu)
    -->cpu_clock(this_cpu)
    -->sched_clock_cpu(this_cpu)
    -->__update_sched_clock(sched_clock_data, now)

    The __update_sched_clock() function uses the GTOD tick value to
    create a window to normalize the "now" values. So if "now"
    value is too big for sched_clock_data, it will be ignored.

    The fix is to invoke sched_clock_tick() to update "cpu sched
    clock" in order to recover from this state. This is done by
    introducing the function touch_softlockup_watchdog_sync(). This
    allows kgdb to request that the sched clock is updated when the
    watchdog thread runs the first time after a resume from kgdb.

    [yong.zhang0@gmail.com: Use per cpu instead of an array]
    Signed-off-by: Jason Wessel
    Signed-off-by: Dongdong Deng
    Cc: kgdb-bugreport@lists.sourceforge.net
    Cc: peterz@infradead.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Jason Wessel
     

30 Jan, 2010

3 commits

  • This patch fixes the regression in functionality where the
    kernel debugger and the perf API do not nicely share hw
    breakpoint reservations.

    The kernel debugger cannot use any mutex_lock() calls because it
    can start the kernel running from an invalid context.

    A mutex free version of the reservation API needed to get
    created for the kernel debugger to safely update hw breakpoint
    reservations.

    The possibility for a breakpoint reservation to be concurrently
    processed at the time that kgdb interrupts the system is
    improbable. Should this corner case occur the end user is
    warned, and the kernel debugger will prohibit updating the
    hardware breakpoint reservations.

    Any time the kernel debugger reserves a hardware breakpoint it
    will be a system wide reservation.

    Signed-off-by: Jason Wessel
    Acked-by: Frederic Weisbecker
    Cc: kgdb-bugreport@lists.sourceforge.net
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Alan Stern
    Cc: torvalds@linux-foundation.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Jason Wessel
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: update multi-touch protocol documentation
    Input: add the ABS_MT_PRESSURE event
    Input: winbond-cir - remove dmesg spam
    Input: lifebook - add another Lifebook DMI signature
    Input: ad7879 - support auxiliary GPIOs via gpiolib

    Linus Torvalds
     
  • 'flush_old_exec()' is the point of no return when doing an execve(), and
    it is pretty badly misnamed. It doesn't just flush the old executable
    environment, it also starts up the new one.

    Which is very inconvenient for things like setting up the new
    personality, because we want the new personality to affect the starting
    of the new environment, but at the same time we do _not_ want the new
    personality to take effect if flushing the old one fails.

    As a result, the x86-64 '32-bit' personality is actually done using this
    insane "I'm going to change the ABI, but I haven't done it yet" bit
    (TIF_ABI_PENDING), with SET_PERSONALITY() not actually setting the
    personality, but just the "pending" bit, so that "flush_thread()" can do
    the actual personality magic.

    This patch in no way changes any of that insanity, but it does split the
    'flush_old_exec()' function up into a preparatory part that can fail
    (still called flush_old_exec()), and a new part that will actually set
    up the new exec environment (setup_new_exec()). All callers are changed
    to trivially comply with the new world order.

    Signed-off-by: H. Peter Anvin
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Linus Torvalds