01 Jun, 2015

5 commits

  • parport subsystem starts using the device-model. Drivers using the
    device-model has to define devmodel as true and should register the
    device with parport using parport_register_dev_model().

    Tested-by: Jean Delvare
    Tested-by: Alan Cox
    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Greg Kroah-Hartman

    Sudip Mukherjee
     
  • Static variables are initialised to 0 by GCC.
    Fixes the following checkpatch error:
    ERROR: do not initialise statics to 0 or NULL
    FILE: drivers/char/pcmcia/synclink_cs.c:440:
    static bool break_on_load = 0;

    Signed-off-by: Shailendra Verma
    Signed-off-by: Greg Kroah-Hartman

    Shailendra Verma
     
  • Memory notifiers are being executed in a sequential order and when one of
    them fails returning something different from NOTIFY_OK the remainder of
    the notification chain is not being executed. When a memory block is being
    onlined in online_pages() we do memory_notify(MEM_GOING_ONLINE, ) and if
    one of the notifiers in the chain fails we end up doing
    memory_notify(MEM_CANCEL_ONLINE, ) so it is possible for a notifier to see
    MEM_CANCEL_ONLINE without seeing the corresponding MEM_GOING_ONLINE event.
    E.g. when CONFIG_KASAN is enabled the kasan_mem_notifier() is being used
    to prevent memory hotplug, it returns NOTIFY_BAD for all MEM_GOING_ONLINE
    events. As kasan_mem_notifier() comes before the hv_memory_notifier() in
    the notification chain we don't see the MEM_GOING_ONLINE event and we do
    not take the ha_region_mutex. We, however, see the MEM_CANCEL_ONLINE event
    and unconditionally try to release the lock, the following is observed:

    [ 110.850927] =====================================
    [ 110.850927] [ BUG: bad unlock balance detected! ]
    [ 110.850927] 4.1.0-rc3_bugxxxxxxx_test_xxxx #595 Not tainted
    [ 110.850927] -------------------------------------
    [ 110.850927] systemd-udevd/920 is trying to release lock
    (&dm_device.ha_region_mutex) at:
    [ 110.850927] [] mutex_unlock+0xe/0x10
    [ 110.850927] but there are no more locks to release!

    At the same time we can have the ha_region_mutex taken when we get the
    MEM_CANCEL_ONLINE event in case one of the memory notifiers after the
    hv_memory_notifier() in the notification chain failed so we need to add
    the mutex_is_locked() check. In case of MEM_ONLINE we are always supposed
    to have the mutex locked.

    Signed-off-by: Vitaly Kuznetsov

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

    Vitaly Kuznetsov
     
  • Add support for Windows 10.

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

    Keith Mange
     
  • On attempt to register a dynamic minor misc device its minor number is
    updated to a virtual minor number prior to device_create() call,
    however on error path misc->minor == MISC_DYNAMIC_MINOR is not
    restored.

    Following the rule of thumb that a function returning an error must
    not change the state of the caller, assign MISC_DYNAMIC_MINOR back.

    The problem is met in a sutuation, when subsys_initcall(misc_init) is
    not yet called and misc_class is not created, but misc_register()
    modifies statically defined ".minor = MISC_DYNAMIC_MINOR", therefore
    implicitly changing the client's logic on next attempt (e.g. retrying
    from deferred list) to register a misc device, whose minor number is
    converted from dynamic to some unknown static one.

    Signed-off-by: Vladimir Zapolskiy
    Signed-off-by: Greg Kroah-Hartman

    Vladimir Zapolskiy
     

31 May, 2015

1 commit

  • A previous commit, c93b76b34b4d ("mei: bus: report also uuid in module
    alias") caused a build error as I missed applying a needed patch to add
    some macros to uapi/linux/uuid.h. Instead of those additional macros,
    change the mei code to use the existing uuid structure directly.

    Fixes: c93b76b34b4d
    Cc: Tomas Winkler
    Cc: Samuel Ortiz
    Reported-by: Stephen Rothwell
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

25 May, 2015

34 commits

  • This patch splits CONFIG_I8K compile option to SENSORS_DELL_SMM and CONFIG_I8K.
    Option SENSORS_DELL_SMM is now used to enable compilation of dell-smm-hwmon
    driver and old CONFIG_I8K option to enable /proc/i8k interface in driver.

    So this change allows to compile dell-smm-hwmon driver without legacy /proc/i8k
    interface which is needed only for old Dell Inspirion models or for userspace
    i8kutils package.

    For backward compatibility when CONFIG_I8K is enabled then also SENSORS_DELL_SMM
    is enabled and so driver dell-smm-hwmon (with /proc/i8k) is compiled.

    Signed-off-by: Pali Rohár
    Signed-off-by: Greg Kroah-Hartman

    Pali Rohár
     
  • This commit moves i8k driver to hwmon tree under name dell-smm-hwmon which is
    better name then abbreviation i8k. For backward compatibility is added macro
    MODULE_ALIAS("i8k") so modprobe will load driver also old name i8k. CONFIG_I8K
    compile option was not changed.

    This commit also adds me as maintainer of this new dell-smm-hwmon driver and
    remove Guenter Roeck from list who is implicit maintainer all hwmon drivers.

    Signed-off-by: Pali Rohár
    Signed-off-by: Greg Kroah-Hartman

    Pali Rohár
     
  • My static checker complains that this sprintf() can overflow but really
    it can't. Just silence the warning by using snprintf().

    Signed-off-by: Dan Carpenter
    Reviewed-by: Amit Shah
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • If NO_DMA=y:

    drivers/built-in.o: In function `xilly_of_unmap':
    xillybus_of.c:(.text+0xa860e): undefined reference to `dma_unmap_single'
    drivers/built-in.o: In function `xilly_map_single_of':
    xillybus_of.c:(.text+0xa8668): undefined reference to `dma_map_single'
    xillybus_of.c:(.text+0xa8676): undefined reference to `dma_mapping_error'
    xillybus_of.c:(.text+0xa86ca): undefined reference to `dma_unmap_single'
    drivers/built-in.o: In function `xilly_dma_sync_single_for_device_of':
    xillybus_of.c:(.text+0xa8700): undefined reference to `dma_sync_single_for_cpu'
    drivers/built-in.o: In function `xilly_dma_sync_single_for_cpu_of':
    xillybus_of.c:(.text+0xa8726): undefined reference to `dma_sync_single_for_cpu'

    Signed-off-by: Geert Uytterhoeven
    Acked-by: Eli Billauer
    --
    v2:
    - Add Acked-by, send to char and misc drivers maintainers.
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     
  • Move the close parenthesis.

    Signed-off-by: Joe Perches
    Signed-off-by: Greg Kroah-Hartman

    Joe Perches
     
  • During bootup pcmcia (pccardd) code enforces the following warning
    backtrace:

    do not call blocking ops when !TASK_RUNNING; state=1 set at [] pccardd+0xb8/0x3fc
    Modules linked in:
    CPU: 0 PID: 14 Comm: pccardd Not tainted 4.0.0-rc6+ #11
    Hardware name: Sharp-Collie
    [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
    [] (show_stack) from [] (warn_slowpath_common+0x74/0xac)
    [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x30/0x40)
    [] (warn_slowpath_fmt) from [] (__might_sleep+0x84/0xa0)
    [] (__might_sleep) from [] (mutex_lock_nested+0x24/0x388)
    [] (mutex_lock_nested) from [] (pccardd+0xf8/0x3fc)
    [] (pccardd) from [] (kthread+0xdc/0xfc)
    [] (kthread) from [] (ret_from_fork+0x14/0x2c)
    ---[ end trace fd94911637eed4ba ]---

    This happens due to kthread trying to lock mutex in a TASK_INTERRUPTIBLE
    state. Limit TASK_INTERRUPTIBLE task state to the schedule() call only,
    so that the rest of the code runs in TASK_RUNNING state.

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Eremin-Solenikov
     
  • [um maintainers appear to be vanished]

    I can't prove the case pointed out in
    https://bugzilla.kernel.org/show_bug.cgi?id=82341
    is correct so let us play safe.

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan
     
  • This code is no longer used now that mach-msm has been removed.
    Delete it.

    Cc: David Brown
    Cc: Bryan Huntsman
    Cc: Daniel Walker
    Signed-off-by: Stephen Boyd
    Signed-off-by: Greg Kroah-Hartman

    Stephen Boyd
     
  • Primary channels are distributed evenly across all vcpus we have. When the host
    asks us to create subchannels it usually makes us num_cpus-1 offers and we are
    supposed to distribute the work evenly among the channel itself and all its
    subchannels. Make sure they are all assigned to different vcpus.

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

    Vitaly Kuznetsov
     
  • We need to call init_vp_index() after we added the channel to the appropriate
    list (global or subchannel) to be able to use this information when assigning
    the channel to the particular vcpu. To do so we need to move a couple of
    functions around. The only real change is the init_vp_index() call. This is a
    small refactoring without a functional change.

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

    Vitaly Kuznetsov
     
  • It is unlikely that that host will ask us to close only one subchannel for a
    device but let's be consistent. Do both num_sc++ and num_sc-- with
    channel->lock to be on the safe side.

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

    Vitaly Kuznetsov
     
  • next_oc and num_sc fields of struct vmbus_channel deserve a description. Move
    them closer to sc_list as these fields are related to it.

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

    Vitaly Kuznetsov
     
  • Remove some code duplication, no functional change intended.

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

    Vitaly Kuznetsov
     
  • Explicitly kill tasklets we create on module unload.

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

    Vitaly Kuznetsov
     
  • In case there was an error reported in the response to the CHANNELMSG_OPENCHANNEL
    call we need to do the cleanup as a vmbus_open() user won't be doing it after
    receiving an error. The cleanup should be done on all failure paths. We also need
    to avoid returning open_info->response.open_result.status as the return value as
    all other errors we return from vmbus_open() are -EXXX and vmbus_open() callers
    are not supposed to analyze host error codes.

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

    Vitaly Kuznetsov
     
  • Implement the protocol for tearing down the monitor state established with
    the host.

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

    K. Y. Srinivasan
     
  • Get rid of some unused definitions.

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

    K. Y. Srinivasan
     
  • free_channel() has been invoked in
    vmbus_remove() -> hv_process_channel_removal(), or vmbus_remove() ->
    ... -> vmbus_close_internal() -> hv_process_channel_removal().

    We also change to use list_for_each_entry_safe(), because the entry
    is removed in hv_process_channel_removal().

    This patch fixes a bug in the vmbus unload path.

    Thank Dan Carpenter for finding the issue!

    Signed-off-by: Dexuan Cui
    Reported-by: Dan Carpenter
    Cc: K. Y. Srinivasan
    Cc: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     
  • Commit 96c1d0581d00f7abe033350edb021a9d947d8d81 ("Drivers: hv: vmbus: Add
    support for VMBus panic notifier handler") introduced
    atomic_notifier_chain_register() call on module load. We also need to call
    atomic_notifier_chain_unregister() on module unload as otherwise the following
    crash is observed when we bring hv_vmbus back:

    [ 39.788877] BUG: unable to handle kernel paging request at ffffffffa00078a8
    [ 39.788877] IP: [] notifier_call_chain+0x3f/0x80
    ...
    [ 39.788877] Call Trace:
    [ 39.788877] [] __atomic_notifier_call_chain+0x5d/0x90
    ...
    [ 39.788877] [] ? atomic_notifier_chain_register+0x38/0x70
    [ 39.788877] [] ? atomic_notifier_chain_register+0x17/0x70
    [ 39.788877] [] hv_acpi_init+0x14f/0x1000 [hv_vmbus]
    [ 39.788877] [] do_one_initcall+0xd4/0x210

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

    Vitaly Kuznetsov
     
  • In case we do request_resource() in vmbus_acpi_add() we need to tear it down
    to be able to load the driver again. Otherwise the following crash in observed
    when hv_vmbus unload/load sequence is performed on a Generation2 instance:

    [ 38.165701] BUG: unable to handle kernel paging request at ffffffffa00075a0
    [ 38.166315] IP: [] __request_resource+0x2f/0x50
    [ 38.166315] PGD 1f34067 PUD 1f35063 PMD 3f723067 PTE 0
    [ 38.166315] Oops: 0000 [#1] SMP
    [ 38.166315] Modules linked in: hv_vmbus(+) [last unloaded: hv_vmbus]
    [ 38.166315] CPU: 0 PID: 267 Comm: modprobe Not tainted 3.19.0-rc5_bug923184+ #486
    [ 38.166315] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v1.0 11/26/2012
    [ 38.166315] task: ffff88003f401cb0 ti: ffff88003f60c000 task.ti: ffff88003f60c000
    [ 38.166315] RIP: 0010:[] [] __request_resource+0x2f/0x50
    [ 38.166315] RSP: 0018:ffff88003f60fb58 EFLAGS: 00010286

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

    Vitaly Kuznetsov
     
  • Unify driver registration reporting and move it to debug level as normally daemons write to syslog themselves
    and these kernel messages are useless.

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

    Vitaly Kuznetsov
     
  • Introduce FCOPY_VERSION_1 to support kernel replying to the negotiation
    message with its own version.

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

    Vitaly Kuznetsov
     
  • Introduce VSS_OP_REGISTER1 to support kernel replying to the negotiation
    message with its own version.

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

    Vitaly Kuznetsov
     
  • Use /dev/vmbus/hv_vss instead of netlink.

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

    Vitaly Kuznetsov
     
  • Use /dev/vmbus/hv_kvp instead of netlink.

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

    Vitaly Kuznetsov
     
  • Convert to hv_utils_transport to support both netlink and /dev/vmbus/hv_kvp communication methods.

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

    Vitaly Kuznetsov
     
  • Unify the code with the recently introduced hv_utils_transport. Netlink
    communication is disabled for fcopy.

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

    Vitaly Kuznetsov
     
  • Convert to hv_utils_transport to support both netlink and /dev/vmbus/hv_vss communication methods.

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

    Vitaly Kuznetsov
     
  • The intention is to make KVP/VSS drivers work through misc char devices.
    Introduce an abstraction for kernel/userspace communication to make the
    migration smoother. Transport operational mode (netlink or char device)
    is determined by the first received message. To support driver upgrades
    the switch from netlink to chardev operational mode is supported.

    Every hv_util daemon is supposed to register 2 callbacks:
    1) on_msg() to get notified when the userspace daemon sent a message;
    2) on_reset() to get notified when the userspace daemon drops the connection.

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

    Vitaly Kuznetsov
     
  • Get an additional reference otherwise a crash is observed when hv_utils module is being unloaded while
    fcopy daemon is still running. .owner gives us an additional reference when
    someone holds a descriptor for the device.

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

    Vitaly Kuznetsov
     
  • Switch to using the hvutil_device_state state machine from using 3 different state variables:
    fcopy_transaction.active, opened, and in_hand_shake.

    State transitions are:
    -> HVUTIL_DEVICE_INIT when driver loads or on device release
    -> HVUTIL_READY if the handshake was successful
    -> HVUTIL_HOSTMSG_RECEIVED when there is a non-negotiation message from the host
    -> HVUTIL_USERSPACE_REQ after userspace daemon read the message
    -> HVUTIL_USERSPACE_RECV after/if userspace has replied
    -> HVUTIL_READY after we respond to the host
    -> HVUTIL_DEVICE_DYING on driver unload

    In hv_fcopy_onchannelcallback() process ICMSGTYPE_NEGOTIATE messages even when
    the userspace daemon is disconnected, otherwise we can make the host think
    we don't support FCOPY and disable the service completely.

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

    Vitaly Kuznetsov
     
  • Switch to using the hvutil_device_state state machine from using kvp_transaction.active.

    State transitions are:
    -> HVUTIL_DEVICE_INIT when driver loads or on device release
    -> HVUTIL_READY if the handshake was successful
    -> HVUTIL_HOSTMSG_RECEIVED when there is a non-negotiation message from the host
    -> HVUTIL_USERSPACE_REQ after we sent the message to the userspace daemon
    -> HVUTIL_USERSPACE_RECV after/if the userspace daemon has replied
    -> HVUTIL_READY after we respond to the host
    -> HVUTIL_DEVICE_DYING on driver unload

    In hv_vss_onchannelcallback() process ICMSGTYPE_NEGOTIATE messages even when
    the userspace daemon is disconnected, otherwise we can make the host think
    we don't support VSS and disable the service completely.

    Unfortunately there is no good way we can figure out that the userspace daemon
    has died (unless we start treating all timeouts as such), add a protection
    against processing new VSS_OP_REGISTER messages while being in the middle of a
    transaction (HVUTIL_USERSPACE_REQ or HVUTIL_USERSPACE_RECV state).

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

    Vitaly Kuznetsov
     
  • Switch to using the hvutil_device_state state machine from using 2 different state variables: kvp_transaction.active and
    in_hand_shake.

    State transitions are:
    -> HVUTIL_DEVICE_INIT when driver loads or on device release
    -> HVUTIL_READY if the handshake was successful
    -> HVUTIL_HOSTMSG_RECEIVED when there is a non-negotiation message from the host
    -> HVUTIL_USERSPACE_REQ after we sent the message to the userspace daemon
    -> HVUTIL_USERSPACE_RECV after/if the userspace daemon has replied
    -> HVUTIL_READY after we respond to the host
    -> HVUTIL_DEVICE_DYING on driver unload

    In hv_kvp_onchannelcallback() process ICMSGTYPE_NEGOTIATE messages even when
    the userspace daemon is disconnected, otherwise we can make the host think
    we don't support KVP and disable the service completely.

    Unfortunately there is no good way we can figure out that the userspace daemon
    has died (unless we start treating all timeouts as such). In case the daemon
    restarts we skip the negotiation procedure (so the daemon is supposed to has
    the same version). This behavior is unchanged from in_handshake approach.

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

    Vitaly Kuznetsov
     
  • KVP/VSS/FCOPY drivers work in fully serialized mode: we wait till userspace
    daemon registers, wait for a message from the host, send this message to the
    daemon, get the reply, send it back to host, wait for another message.
    Introduce enum hvutil_device_state to represend this state in all 3 drivers.

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

    Vitaly Kuznetsov