03 Apr, 2015

15 commits


01 Apr, 2015

1 commit

  • …/chanwoo/extcon into char-misc-next

    Chanwoo writes:

    Update extcon for v4.1

    This patchset include two new extcon driver and fix minor issue of extcon
    driver.

    Detailed description for patchset:
    1. new extcon-max77843.c and extcon-usb-gpio.c extcon driver
    - extcon-max77843.c driver support the MAXIM MAX77843 MUIC (Micor-USB Interface
    Controller) device which handles the various external connectors such as TA/USB
    /USB-HOST/JIG and so on.
    - extcon-usb-gpio.c driver support the USB and USB-HOST cable detection by
    using the GPIO pin which is connected to USB ID pin. This GPIO pin updates the
    USB cable states.

    2. Rename the filename of extcon core driver and add missing locking mechanism
    - Rename the previous extcon-class driver.c as extcon.c because '-class'
    postfix is not necessary word.
    - extcon core driver (extcon.c) used the raw_notifier_chain. It must be
    protected by locking mechanism to avoid the list changing while
    extcon_update_state() is executed.

    3. Fix minor issue of extcon drviers
    - Fix cable name by using the capital letter instead of small letter on
    extcon-max77693.c driver.
    - Clean-up code of extcon-arizona.c to detect headphone cable.
    - Fix the wrong return type and variable type on extcon-max77843.c.
    - Fix the checkpatch warning of all extcon drivers.

    Greg Kroah-Hartman
     

27 Mar, 2015

7 commits

  • Add a driver for the NAND/External Memory Controller (NEMC) on JZ4780
    and later SoCs.

    The primary function of this driver is to configure parameters, such
    as timings, for external memory devices using data supplied in the
    device tree. Devices connected to the NEMC are represented in the DT
    as children of the NEMC node, the driver uses optional properties
    specified in these child nodes to configure the parameters of each
    bank.

    Signed-off-by: Alex Smith
    Signed-off-by: Zubair Lutfullah Kakakhel
    Signed-off-by: Greg Kroah-Hartman

    Alex Smith
     
  • Add device tree bindings for the NAND/External Memory Controller (NEMC)
    on Ingenic JZ4780

    Signed-off-by: Alex Smith
    Signed-off-by: Zubair Lutfullah Kakakhel
    Signed-off-by: Greg Kroah-Hartman

    Alex Smith
     
  • Qualcomm PMIC Arbiter version-2 changes from version-1 are:

    - Some different register offsets.
    - New channel register space, one per PMIC peripheral (ppid).
    All tx traffic uses these channels.
    - New observer register space. All rx trafic uses this space.
    - Different command format for spmi command registers.

    Reviewed-by: Sagar Dharia
    Signed-off-by: Gilad Avidov
    Tested-by: Ivan T. Ivanov
    Signed-off-by: Greg Kroah-Hartman

    Gilad Avidov
     
  • According to spmi spec a slave powers up into startup state and then
    transitions into active state. Thus, the wakeup command is not required
    before calling the slave's probe. The wakeup command is only needed for
    slaves that are in sleep state after receiving the sleep command.

    Cc: galak@codeaurora.org
    Reviewed-by: Stephen Boyd
    Reviewed-by: Sagar Dharia
    Acked-by: Josh Cartwright
    Signed-off-by: Gilad Avidov
    Tested-by: Ivan T. Ivanov
    Signed-off-by: Greg Kroah-Hartman

    Gilad Avidov
     
  • I take over the maintainship from Voice.

    Signed-off-by: Nicolas Ferre
    Cc: Mark Brown
    Cc: Arnd Bergmann
    Acked-by: Bo Shen
    Signed-off-by: Greg Kroah-Hartman

    Nicolas Ferre
     
  • Don't wait after sending request for offers to the host. This wait is
    unnecessary and simply adds 5 seconds to the boot time.

    Signed-off-by: K. Y. Srinivasan
    Cc:
    Signed-off-by: Greg Kroah-Hartman

    K. Y. Srinivasan
     
  • of_device_id is always used as const.
    (See driver.of_match_table and open firmware functions)

    Signed-off-by: Fabian Frederick
    Signed-off-by: Greg Kroah-Hartman

    Fabian Frederick
     

25 Mar, 2015

17 commits

  • The seq_printf return value, because it's frequently misused,
    will eventually be converted to void.

    See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
    seq_has_overflowed() and make public")

    Signed-off-by: Joe Perches
    Acked-by: Guenter Roeck
    Signed-off-by: Greg Kroah-Hartman

    Joe Perches
     
  • of_device_id is always used as const.
    (See driver.of_match_table and open firmware functions)

    Signed-off-by: Fabian Frederick
    Signed-off-by: Greg Kroah-Hartman

    Fabian Frederick
     
  • of_device_id is always used as const.
    (See driver.of_match_table and open firmware functions)

    Signed-off-by: Fabian Frederick
    Signed-off-by: Greg Kroah-Hartman

    Fabian Frederick
     
  • Handle the case when the write to the ringbuffer fails. In this case,
    unconditionally signal the host. Since we may have deferred signalling
    the host based on the kick_q parameter, signalling the host
    unconditionally in this case deals with the issue.

    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    K. Y. Srinivasan
     
  • Export the vmbus_sendpacket_pagebuffer_ctl() interface. This export will be
    used by the netvsc driver.

    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    K. Y. Srinivasan
     
  • If freeze fails, vss_operate will re-enter itself to thaw. But it forgets
    to call endmntent() before it recalls setmntent() again.

    Signed-off-by: Vaughan Cao
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vaughan Cao
     
  • When a channel has been rescinded, the close operation is a noop.
    Restructure the code so we deal with the rescind condition after
    we properly cleanup the channel. I would like to thank
    Dexuan Cui for observing this problem.
    The current code leaks memory when the channel is rescinded.

    The current char-next branch is broken and this patch fixes
    the bug.

    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    K. Y. Srinivasan
     
  • Without this patch, hv_fcopy_daemon's hv_copy_data() -> pwrite()
    will fail for >2GB file offset.

    The current char-next branch is broken and this patch fixes
    the bug.

    Signed-off-by: Alex Ng
    Signed-off-by: Dexuan Cui
    Cc: K. Y. Srinivasan
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     
  • The indenting makes it clear that there were curly braces intended here.

    Fixes: 2dd37cb81580 ('Drivers: hv: vmbus: Handle both rescind and offer messages in the same context')
    Signed-off-by: Dan Carpenter
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • HV_CRASH_CTL_CRASH_NOTIFY is a 64 bit number. Depending on the usage context,
    the value may be truncated. This patch is in response from the following
    email from Wu Fengguang :

    From: Wu Fengguang
    Subject: [char-misc:char-misc-testing 25/45] drivers/hv/vmbus_drv.c:67:9: sparse:
    constant 0x8000000000000000 is so big it is unsigned long

    tree: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-testing
    head: b3de8e3719e582f3182bb504295e4a8e43c8c96f
    commit: 96c1d0581d00f7abe033350edb021a9d947d8d81 [25/45] Drivers: hv: vmbus: Add support for VMBus panic notifier handler
    reproduce:
    # apt-get install sparse
    git checkout 96c1d0581d00f7abe033350edb021a9d947d8d81
    make ARCH=x86_64 allmodconfig
    make C=1 CF=-D__CHECK_ENDIAN__

    sparse warnings: (new ones prefixed by >>)

    drivers/hv/vmbus_drv.c:67:9: sparse: constant 0x8000000000000000 is so big it is unsigned long
    ...

    Signed-off-by: Nick Meier
    Reported-by: Wu Fengguang
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Nick Meier
     
  • Memory blocks can be onlined in random order. When this order is not natural
    some memory pages are not onlined because of the redundant check in
    hv_online_page().

    Here is a real world scenario:
    1) Host tries to hot-add the following (process_hot_add):
    pg_start=rg_start=0x48000, pfn_cnt=111616, rg_size=262144

    2) This results in adding 4 memory blocks:
    [ 109.057866] init_memory_mapping: [mem 0x48000000-0x4fffffff]
    [ 114.102698] init_memory_mapping: [mem 0x50000000-0x57ffffff]
    [ 119.168039] init_memory_mapping: [mem 0x58000000-0x5fffffff]
    [ 124.233053] init_memory_mapping: [mem 0x60000000-0x67ffffff]
    The last one is incomplete but we have special has->covered_end_pfn counter to
    avoid onlining non-backed frames and hv_bring_pgs_online() function to bring
    them online later on.

    3) Now we have 4 offline memory blocks: /sys/devices/system/memory/memory9-12
    $ for f in /sys/devices/system/memory/memory*/state; do echo $f `cat $f`; done | grep -v onlin
    /sys/devices/system/memory/memory10/state offline
    /sys/devices/system/memory/memory11/state offline
    /sys/devices/system/memory/memory12/state offline
    /sys/devices/system/memory/memory9/state offline

    4) We bring them online in non-natural order:
    $grep MemTotal /proc/meminfo
    MemTotal: 966348 kB
    $echo online > /sys/devices/system/memory/memory12/state && grep MemTotal /proc/meminfo
    MemTotal: 1019596 kB
    $echo online > /sys/devices/system/memory/memory11/state && grep MemTotal /proc/meminfo
    MemTotal: 1150668 kB
    $echo online > /sys/devices/system/memory/memory9/state && grep MemTotal /proc/meminfo
    MemTotal: 1150668 kB

    As you can see memory9 block gives us zero additional memory. We can also
    observe a huge discrepancy between host- and guest-reported memory sizes.

    The root cause of the issue is the redundant pg >= covered_start_pfn check (and
    covered_start_pfn advancing) in hv_online_page(). When upper memory block in
    being onlined before the lower one (memory12 and memory11 in the above case) we
    advance the covered_start_pfn pointer and all memory9 pages do not pass the
    check. If the assumption that host always gives us requests in sequential order
    and pg_start always equals rg_start when the first request for the new HA
    region is received (that's the case in my testing) is correct than we can get
    rid of covered_start_pfn and pg >= start_pfn check in hv_online_page() is
    sufficient.

    The current char-next branch is broken and this patch fixes
    the bug.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     
  • When add_memory() fails the following BUG is observed:
    [ 743.646107] hv_balloon: hot_add memory failed error is -17
    [ 743.679973]
    [ 743.680930] =====================================
    [ 743.680930] [ BUG: bad unlock balance detected! ]
    [ 743.680930] 3.19.0-rc5_bug1131426+ #552 Not tainted
    [ 743.680930] -------------------------------------
    [ 743.680930] kworker/0:2/255 is trying to release lock (&dm_device.ha_region_mutex) at:
    [ 743.680930] [] mutex_unlock+0xe/0x10
    [ 743.680930] but there are no more locks to release!

    This happens as we don't acquire ha_region_mutex and hot_add_req() expects us
    to as it does unconditional mutex_unlock(). Acquire the lock on the error path.

    The current char-next branch is broken and this patch fixes
    the bug.

    Signed-off-by: Vitaly Kuznetsov
    Acked-by: Jason Wang
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     
  • This patch is a continuation of the rescind handling cleanup work. We cannot
    block in the global message handling work context especially if we are blocking
    waiting for the host to wake us up. I would like to thank
    Dexuan Cui for observing this problem.

    The current char-next branch is broken and this patch fixes
    the bug.

    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    K. Y. Srinivasan
     
  • Use the new group field of struct miscdevice for managing the sysfs
    entries instead of manually adding/removing via device_create_file()
    and device_remove_file(). This simplifies the code a lot and fixes
    the possible races.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • Add groups field to struct miscdevice for passing the attribute groups
    at device creation. In this way, the driver can avoid the manual call
    of device_create_file() after the device registration, which is
    basically a racy operation, in addition to the reduction of manual
    device_remove_file() calls.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • return type of wait_for_completion_timeout is unsigned long not int. The
    rc variable is renamed timeout to reflect its use and the type adjusted to
    unsigned long.

    Signed-off-by: Nicholas Mc Guire
    Acked-by: Sudeep Dutt
    Signed-off-by: Greg Kroah-Hartman

    Nicholas Mc Guire
     
  • return type of wait_for_completion_timeout is unsigned long not int. The
    rc variable is renamed timeout to reflect its use and the type adjusted to
    unsigned long.

    Signed-off-by: Nicholas Mc Guire
    Signed-off-by: Greg Kroah-Hartman

    Nicholas Mc Guire