22 Sep, 2011

6 commits

  • Hardware Spinlock devices usually contain numerous locks (known
    devices today support between 32 to 256 locks).

    Originally hwspinlock core required drivers to register (and later,
    when needed, unregister) each lock separately.

    That worked, but required hwspinlocks drivers to do a bit extra work
    when they were probed/removed.

    This patch changes hwspin_lock_{un}register() to allow a bank of
    hwspinlocks to be {un}registered in a single invocation.

    A new 'struct hwspinlock_device', which contains an array of 'struct
    hwspinlock's is now being passed to the core upon registration (so
    instead of wrapping each struct hwspinlock, a priv member has been added
    to allow drivers to piggyback their private data with each hwspinlock).

    While at it, several per-lock members were moved to be per-device:
    1. struct device *dev
    2. struct hwspinlock_ops *ops

    In addition, now that the array of locks is handled by the core,
    there's no reason to maintain a per-lock 'int id' member: the id of the
    lock anyway equals to its index in the bank's array plus the bank's
    base_id.
    Remove this per-lock id member too, and instead use a simple pointers
    arithmetic to derive it.

    As a result of this change, hwspinlocks drivers are now simpler and smaller
    (about %20 code reduction) and the memory footprint of the hwspinlock
    framework is reduced.

    Signed-off-by: Ohad Ben-Cohen

    Ohad Ben-Cohen
     
  • Since we're using non-atomic radix tree allocations, we
    should be protecting the tree using a mutex and not a
    spinlock.

    Non-atomic allocations and process context locking is good enough,
    as the tree is manipulated only when locks are registered/
    unregistered/requested/freed.

    The locks themselves are still protected by spinlocks of course,
    and mutexes are not involved in the locking/unlocking paths.

    Cc:
    Signed-off-by: Juan Gutierrez
    [ohad@wizery.com: rewrite the commit log, #include mutex.h, add minor
    commentary]
    [ohad@wizery.com: update register/unregister parts in hwspinlock.txt]
    Signed-off-by: Ohad Ben-Cohen

    Juan Gutierrez
     
  • hwspinlock devices provide system-wide hardware locks that are used
    by remote processors that have no other way to achieve synchronization.

    To achieve that, each physical lock must have a system-wide id number
    that is agreed upon, otherwise remote processors can't possibly assume
    they're using the same hardware lock.

    Usually boards have a single hwspinlock device, which provides several
    hwspinlocks, and in this case, they can be trivially numbered 0 to
    (num-of-locks - 1).

    In case boards have several hwspinlocks devices, a different base id
    should be used for each hwspinlock device (they can't all use 0 as
    a starting id!).

    While this is certainly not common, it's just plain wrong to just
    silently use 0 as a base id whenever the hwspinlock driver is probed.

    This patch provides a hwspinlock_pdata structure, that boards can use
    to set a different base id for each of the hwspinlock devices they may
    have, and demonstrates how to use it with the omap hwspinlock driver.

    While we're at it, make sure the hwspinlock core prints an explicit
    error message in case an hwspinlock is registered with an id number
    that already exists; this will help users catch such base id issues.

    Reported-by: Arnd Bergmann
    Signed-off-by: Ohad Ben-Cohen
    Acked-by: Tony Lindgren

    Ohad Ben-Cohen
     
  • Instead of allocating every hwspinlock separately, allocate
    them all in one shot.

    This both simplifies the driver and helps achieving better
    slab utilization.

    Reported-by: Arnd Bergmann
    Signed-off-by: Ohad Ben-Cohen

    Ohad Ben-Cohen
     
  • Use struct device_driver's owner member instead of asking drivers to
    explicitly pass the owner again.

    This simplifies drivers and also save some memory, since there's no
    point now in maintaining a separate owner pointer per hwspinlock.

    Signed-off-by: Ohad Ben-Cohen

    Ohad Ben-Cohen
     
  • Simplify hwspinlock's Kconfig by making the global CONFIG_HWSPINLOCK
    entry invisible; users will just select it when needed.

    This also prepares the ground for adding hwspinlock support for other
    platforms (the 'depends on ARCH_OMAP4' was rather hideous, and while
    we're at it, a dedicated menu is added).

    Signed-off-by: Ohad Ben-Cohen

    Ohad Ben-Cohen
     

13 Sep, 2011

1 commit

  • * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    drm: Remove duplicate "return" statement
    drm/nv04/crtc: Bail out if FB is not bound to crtc
    drm/nouveau: fix nv04_sgdma_bind on non-"4kB pages" archs
    drm/nouveau: properly handle allocation failure in nouveau_sgdma_populate
    drm/nouveau: fix oops on pre-semaphore hardware
    drm/nv50/crtc: Bail out if FB is not bound to crtc
    drm/radeon/kms: fix DP detect and EDID fetch for DP bridges

    Linus Torvalds
     

12 Sep, 2011

1 commit

  • * 'v4l_for_linus' of git://linuxtv.org/mchehab/for_linus:
    [media] vp7045: fix buffer setup
    [media] nuvoton-cir: simplify raw IR sample handling
    [media] [Resend] viacam: Don't explode if pci_find_bus() returns NULL
    [media] v4l2: Fix documentation of the codec device controls
    [media] gspca - sonixj: Fix the darkness of sensor om6802 in 320x240
    [media] gspca - sonixj: Fix wrong register mask for sensor om6802
    [media] gspca - ov519: Fix LED inversion of some ov519 webcams
    [media] pwc: precedence bug in pwc_init_controls()

    Linus Torvalds
     

11 Sep, 2011

11 commits

  • dvb_usb_device_init calls the frontend_attach method of this driver which
    uses vp7045_usb_ob. In order to have a buffer ready in vp7045_usb_op, it has to
    be allocated before that happens.

    Luckily we can use the whole private data as the buffer as it gets separately
    allocated on the heap via kzalloc in dvb_usb_device_init and is thus apt for
    use via usb_control_msg.

    This fixes a
    BUG: unable to handle kernel paging request at 0000000000001e78

    reported by Tino Keitel and diagnosed by Dan Carpenter.

    Cc: stable@kernel.org # For v3.0 and upper
    Tested-by: Tino Keitel
    Signed-off-by: Florian Mickler
    Signed-off-by: Mauro Carvalho Chehab

    Florian Mickler
     
  • The nuvoton-cir driver was storing up consecutive pulse-pulse and
    space-space samples internally, for no good reason, since
    ir_raw_event_store_with_filter() already merges back to back like
    samples types for us. This should also fix a regression introduced late
    in 3.0 that related to a timeout change, which actually becomes correct
    when coupled with this change. Tested with RC6 and RC5 on my own
    nuvoton-cir hardware atop vanilla 3.0.0, after verifying quirky
    behavior in 3.0 due to the timeout change.

    Reported-by: Stephan Raue
    CC: Stephan Raue
    CC: stable@vger.kernel.org
    Signed-off-by: Jarod Wilson
    Signed-off-by: Mauro Carvalho Chehab

    Jarod Wilson
     
  • In the unlikely case that pci_find_bus() should return NULL
    viacam_serial_is_enabled() is going to dereference a NULL pointer and
    blow up. Better safe than sorry, so be defensive and check the
    pointer.

    Signed-off-by: Jesper Juhl
    Acked-by: Jonathan Corbet
    Signed-off-by: Mauro Carvalho Chehab

    Jesper Juhl
     
  • The images are clearer with a lower bridge clock.

    Signed-off-by: Jean-François Moine
    Signed-off-by: Mauro Carvalho Chehab

    Jean-François Moine
     
  • The bug was introduced by git commit 0e4d413af1a9d, giving very dark images.

    Signed-off-by: Luiz Carlos Ramos
    Signed-off-by: Jean-François Moine
    Signed-off-by: Mauro Carvalho Chehab

    Luiz Carlos Ramos
     
  • The list of the webcams which have LED inversion was rebuild scanning
    ms-win .inf files.

    Signed-off-by: Jean-François Moine
    Signed-off-by: Mauro Carvalho Chehab

    Jean-François Moine
     
  • '!' has higher precedence than '&' so we need parenthesis here.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Hans de Goede
    Signed-off-by: Mauro Carvalho Chehab

    Dan Carpenter
     
  • When CONFIG_NET is disabled, SCSI_QLA_ISCSI selects SCSI_ISCSI_ATTRS,
    which uses network interfaces, so the build fails with multiple errors:

    warning: (ISCSI_TCP && SCSI_CXGB3_ISCSI && SCSI_CXGB4_ISCSI && SCSI_QLA_ISCSI && INFINIBAND_ISER) selects SCSI_ISCSI_ATTRS which has unmet direct dependencies (SCSI && NET)

    ERROR: "skb_trim" [drivers/scsi/scsi_transport_iscsi.ko] undefined!
    ERROR: "netlink_kernel_create" [drivers/scsi/scsi_transport_iscsi.ko] undefined!
    ERROR: "netlink_kernel_release" [drivers/scsi/scsi_transport_iscsi.ko] undefined!
    ...

    so make SCSI_QLA_ISCSI also depend on NET to prevent the build errors.

    Signed-off-by: Randy Dunlap
    Cc: Ravi Anand
    Cc: Vikas Chaudhary
    Cc: iscsi-driver@qlogic.com
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • * 'fixes' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm:
    ARM: 7088/1: entry: fix wrong parameter name used in do_thumb_abort
    ARM: 7080/1: l2x0: make sure I&D are not locked down on init
    ARM: 7081/1: mach-integrator: fix the clocksource
    NET: am79c961: fix race in link status code
    ARM: 7067/1: mm: keep significant bits in pfn_valid

    Linus Torvalds
     
  • Since backlight_types[] isn't modified, let's declare it const. That
    was probably the intention of the author of commit bb7ca747f8d6
    ("backlight: add backlight type"), via which the "const char const *"
    construct was introduced. The duplicate const was detected by sparse.

    Signed-off-by: Bart Van Assche
    Cc: Matthew Garrett
    Cc: Richard Purdie
    Cc: Florian Tobias Schandinat
    Cc: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bart Van Assche
     
  • * 'for-linus' of git://neil.brown.name/md:
    md: Fix handling for devices from 2TB to 4TB in 0.90 metadata.
    md/raid1,10: Remove use-after-free bug in make_request.
    md/raid10: unify handling of write completion.
    Avoid dereferencing a 'request_queue' after last close.

    Linus Torvalds
     

10 Sep, 2011

6 commits

  • 0.90 metadata uses an unsigned 32bit number to count the number of
    kilobytes used from each device.
    This should allow up to 4TB per device.
    However we multiply this by 2 (to get sectors) before casting to a
    larger type, so sizes above 2TB get truncated.

    Also we allow rdev->sectors to be larger than 4TB, so it is possible
    for the array to be resized larger than the metadata can handle.
    So make sure rdev->sectors never exceeds 4TB when 0.90 metadata is in
    used.

    Also the sanity check at the end of super_90_load should include level
    1 as it used ->size too. (RAID0 and Linear don't use ->size at all).

    Reported-by: Pim Zandbergen
    Cc: stable@kernel.org
    Signed-off-by: NeilBrown

    NeilBrown
     
  • A single request to RAID1 or RAID10 might result in multiple
    requests if there are known bad blocks that need to be avoided.

    To detect if we need to submit another write request we test:
    if (sectors_handled < (bio->bi_size >> 9)) {

    However this is after we call **_write_done() so the 'bio' no longer
    belongs to us - the writes could have completed and the bio freed.

    So move the **_write_done call until after the test against
    bio->bi_size.

    This addresses https://bugzilla.kernel.org/show_bug.cgi?id=41862

    Reported-by: Bruno Wolff III
    Tested-by: Bruno Wolff III
    Signed-off-by: NeilBrown

    NeilBrown
     
  • A write can complete at two different places:
    1/ when the last member-device write completes, through
    raid10_end_write_request
    2/ in make_request() when we remove the initial bias from ->remaining.

    These two should do exactly the same thing and the comment says they
    do, but they don't.

    So factor the correct code out into a function and call it in both
    places. This makes the code much more similar to RAID1.

    The difference is only significant if there is an error, and they
    usually take a while, so it is unlikely that there will be an error
    already when make_request is completing, so this is unlikely to cause
    real problems.

    Signed-off-by: NeilBrown

    NeilBrown
     
  • Modifying the Maximum Read Request Size to 0 (value of 128Bytes) has
    massive negative ramifications on some devices. Without knowing which
    devices have this issue, do not modify from the default value when
    walking the PCI-E bus in pcie_bus_safe mode. Also, make pcie_bus_safe
    the default procedure.

    Tested-by: Sven Schnelle
    Tested-by: Simon Kirby
    Tested-by: Stephen M. Cameron
    Reported-and-tested-by: Eric Dumazet
    Reported-and-tested-by: Niels Ole Salscheider
    References: https://bugzilla.kernel.org/show_bug.cgi?id=42162
    Signed-off-by: Jon Mason
    Acked-by: Jesse Barnes
    Signed-off-by: Linus Torvalds

    Jon Mason
     
  • Commit b03e7495a862 ("PCI: Set PCI-E Max Payload Size on fabric")
    introduced a potential NULL pointer dereference in calls to
    pcie_bus_configure_settings due to attempts to access pci_bus self
    variables when the self pointer is NULL.

    To correct this, verify that the self pointer in pci_bus is non-NULL
    before dereferencing it.

    Reported-by: Stanislaw Gruszka
    Signed-off-by: Shyam Iyer
    Signed-off-by: Jon Mason
    Acked-by: Jesse Barnes
    Signed-off-by: Linus Torvalds

    Shyam Iyer
     
  • * 'for-linus' of git://dev.laptop.org/users/cjb/mmc:
    mmc: sdhci-s3c: Fix mmc card I/O problem
    mmc: sd: UHS-I bus speed should be set last in UHS initialization
    mmc: sdhi: initialise mmc_data->flags before use
    mmc: core: use non-reentrant workqueue for clock gating
    mmc: core: prevent aggressive clock gating racing with ios updates
    mmc: rename mmc_host_clk_{ungate|gate} to mmc_host_clk_{hold|release}
    mmc: sdhci-esdhc-imx: add missing inclusion of linux/module.h

    Linus Torvalds
     

09 Sep, 2011

12 commits


08 Sep, 2011

2 commits


07 Sep, 2011

1 commit