1. 22 4月, 2016 3 次提交
    • J
      regulator: core: Move registration of regulator device · c438b9d0
      Jon Hunter 提交于
      The public functions to acquire a regulator, such as regulator_get(),
      internally look-up the regulator from the list of regulators that have
      been registered with the regulator device class. The registration of
      a new regulator with the regulator device class happens before the
      regulator has been completely setup. Therefore, it is possible that
      the regulator could be acquired before it has been setup successfully.
      To avoid this move the device registration of the regulator to the end
      of the regulator setup and update the error exit path accordingly.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      c438b9d0
    • J
      regulator: core: Clear the supply pointer if enabling fails · 8e5356a7
      Jon Hunter 提交于
      During the resolution of a regulator's supply, we may attempt to enable
      the supply if the regulator itself is already enabled. If enabling the
      supply fails, then we will call _regulator_put() for the supply.
      However, the pointer to the supply has not been cleared for the
      regulator and this will cause a crash if we then unregister the
      regulator and attempt to call regulator_put() a second time for the
      supply. Fix this by clearing the supply pointer if enabling the supply
      after fails when resolving the supply for a regulator.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      8e5356a7
    • J
      regulator: core: Don't terminate supply resolution early · 7ddede6a
      Jon Hunter 提交于
      The function regulator_register_resolve_supply() is called from the
      context of class_for_each_dev() (during the regulator registration) to
      resolve any supplies added. regulator_register_resolve_supply() will
      return an error if a regulator's supply cannot be resolved and this will
      terminate the loop in class_for_each_dev(). This means that we will not
      attempt to resolve any other supplies after one has failed. Hence, this
      may delay the resolution of other regulator supplies until the failing
      one itself can be resolved.
      
      Rather than terminating the loop early, don't return an error code and
      keep attempting to resolve any other supplies for regulators that have
      been registered.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      7ddede6a
  2. 13 4月, 2016 1 次提交
  3. 12 4月, 2016 1 次提交
  4. 31 3月, 2016 1 次提交
    • J
      regulator: Fix deadlock during regulator registration · a2151374
      Jon Hunter 提交于
      Commit 5e3ca2b3 ("regulator: Try to resolve regulators supplies on
      registration") added a call to regulator_resolve_supply() within
      regulator_register() where the regulator_list_mutex is held. This causes
      a deadlock to occur on the Tegra114 Dalmore board when the palmas PMIC
      is registered because regulator_register_resolve_supply() calls
      regulator_dev_lookup() which may try to acquire the regulator_list_mutex
      again.
      
      Fix this by releasing the mutex before calling
      regulator_register_resolve_supply() and update the error exit path to
      ensure the mutex is released on an error.
      
      [Made commit message more legible -- broonie]
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      a2151374
  5. 28 3月, 2016 1 次提交
    • J
      regulator: Try to resolve regulators supplies on registration · 5e3ca2b3
      Javier Martinez Canillas 提交于
      Commit 6261b06d ("regulator: Defer lookup of supply to regulator_get")
      moved the regulator supplies lookup logic from the regulators registration
      to the regulators get time.
      
      Unfortunately, that changed the behavior of the regulator core since now a
      parent supply with a child regulator marked as always-on, won't be enabled
      unless a client driver attempts to get the child regulator during boot.
      
      This patch tries to resolve the parent supply for the already registered
      regulators each time that a new regulator is registered. So the regulators
      that have child regulators marked as always on will be enabled regardless
      if a driver gets the child regulator or not.
      
      That was the behavior before the mentioned commit, since parent supplies
      were looked up at regulator registration time instead of during child get.
      
      Since regulator_resolve_supply() checks for rdev->supply, most of the times
      it will be a no-op. Errors aren't checked to keep the possible out of order
      dependencies which was the motivation for the mentioned commit.
      
      Also, the supply being available will be enforced on regulator get anyways
      in case the resolve fails on regulators registration.
      
      Fixes: 6261b06d ("regulator: Defer lookup of supply to regulator_get")
      Suggested-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: <stable@vger.kernel.org> # 4.1+
      5e3ca2b3
  6. 26 3月, 2016 8 次提交
  7. 25 3月, 2016 3 次提交
  8. 24 3月, 2016 22 次提交
    • H
      hv_netvsc: Fix the order of num_sc_offered decrement · 3f735131
      Haiyang Zhang 提交于
      Reorder the code in netvsc_sc_open(), so num_sc_offered is only decremented
      after vmbus_open() is called. This avoid pontential race of removing device
      before all channels are setup.
      Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Reviewed-by: NK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3f735131
    • O
      Input: sur40 - fix DMA on stack · d314e9e8
      Oliver Neukum 提交于
      During the initialisation the driver uses a buffer on the stack for DMA.
      That violates the cache coherency rules. The fix is to allocate the buffer
      with kmalloc().
      Signed-off-by: NOliver Neukum <ONeukum@suse.com>
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      d314e9e8
    • V
      Input: ati_remote2 - fix crashes on detecting device with invalid descriptor · 950336ba
      Vladis Dronov 提交于
      The ati_remote2 driver expects at least two interfaces with one
      endpoint each. If given malicious descriptor that specify one
      interface or no endpoints, it will crash in the probe function.
      Ensure there is at least two interfaces and one endpoint for each
      interface before using it.
      
      The full disclosure: http://seclists.org/bugtraq/2016/Mar/90Reported-by: NRalf Spenneberg <ralf@spenneberg.net>
      Signed-off-by: NVladis Dronov <vdronov@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      950336ba
    • D
      PM / AVS: rockchip-io: add io selectors and supplies for rk3399 · f447671b
      David Wu 提交于
      This adds the necessary data for handling io voltage domains on the rk3399.
      As interesting tidbit, the rk3399 contains two separate iodomain areas.
      One in the regular General Register Files (GRF) and one in PMUGRF in the
      pmu power domain.
      Signed-off-by: NDavid Wu <david.wu@rock-chips.com>
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Acked-by: NKevin Hilman <khilman@baylibre.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f447671b
    • D
      intel_idle: Support for Intel Xeon Phi Processor x200 Product Family · 281baf7a
      Dasaratharaman Chandramouli 提交于
      Enables "Intel(R) Xeon Phi(TM) Processor x200 Product Family" support,
      formerly code-named KNL. It is based on modified Intel Atom Silvermont
      microarchitecture.
      Signed-off-by: NDasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
      [micah.barany@intel.com: adjusted values of residency and latency]
      Signed-off-by: NMicah Barany <micah.barany@intel.com>
      [hubert.chrzaniuk@intel.com: removed deprecated CPUIDLE_FLAG_TIME_VALID flag]
      Signed-off-by: NHubert Chrzaniuk <hubert.chrzaniuk@intel.com>
      Signed-off-by: NPawel Karczewski <pawel.karczewski@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      281baf7a
    • L
      intel_idle: prevent SKL-H boot failure when C8+C9+C10 enabled · d70e28f5
      Len Brown 提交于
      Some SKL-H configurations require "intel_idle.max_cstate=7" to boot.
      While that is an effective workaround, it disables C10.
      
      This patch detects the problematic configuration,
      and disables C8 and C9, keeping C10 enabled.
      
      Note that enabling SGX in BIOS SETUP can also prevent this issue,
      if the system BIOS provides that option.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=109081
      "Freezes with Intel i7 6700HQ (Skylake), unless intel_idle.max_cstate=7"
      Signed-off-by: NLen Brown <len.brown@intel.com>
      Cc: stable@vger.kernel.org
      d70e28f5
    • H
      hv_netvsc: Fix the array sizes to be max supported channels · 9efc2f7d
      Haiyang Zhang 提交于
      The VRSS_CHANNEL_MAX is the max number of channels supported by Hyper-V
      hosts. We use it for the related array sizes instead of using NR_CPUS,
      which may be set to several thousands.
      This patch reduces possible memory allocation failures.
      Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Reviewed-by: NK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9efc2f7d
    • H
      hv_netvsc: Fix accessing freed memory in netvsc_change_mtu() · d212b463
      Haiyang Zhang 提交于
      struct netvsc_device is freed in rndis_filter_device_remove(). So we save
      the nvdev->num_chn into a temp variable for later usage.
      
      (Please also include this patch into stable branch.)
      Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Reviewed-by: NK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d212b463
    • G
      ppp: take reference on channels netns · 1f461dcd
      Guillaume Nault 提交于
      Let channels hold a reference on their network namespace.
      Some channel types, like ppp_async and ppp_synctty, can have their
      userspace controller running in a different namespace. Therefore they
      can't rely on them to preclude their netns from being removed from
      under them.
      
      ==================================================================
      BUG: KASAN: use-after-free in ppp_unregister_channel+0x372/0x3a0 at
      addr ffff880064e217e0
      Read of size 8 by task syz-executor/11581
      =============================================================================
      BUG net_namespace (Not tainted): kasan: bad access detected
      -----------------------------------------------------------------------------
      
      Disabling lock debugging due to kernel taint
      INFO: Allocated in copy_net_ns+0x6b/0x1a0 age=92569 cpu=3 pid=6906
      [<      none      >] ___slab_alloc+0x4c7/0x500 kernel/mm/slub.c:2440
      [<      none      >] __slab_alloc+0x4c/0x90 kernel/mm/slub.c:2469
      [<     inline     >] slab_alloc_node kernel/mm/slub.c:2532
      [<     inline     >] slab_alloc kernel/mm/slub.c:2574
      [<      none      >] kmem_cache_alloc+0x23a/0x2b0 kernel/mm/slub.c:2579
      [<     inline     >] kmem_cache_zalloc kernel/include/linux/slab.h:597
      [<     inline     >] net_alloc kernel/net/core/net_namespace.c:325
      [<      none      >] copy_net_ns+0x6b/0x1a0 kernel/net/core/net_namespace.c:360
      [<      none      >] create_new_namespaces+0x2f6/0x610 kernel/kernel/nsproxy.c:95
      [<      none      >] copy_namespaces+0x297/0x320 kernel/kernel/nsproxy.c:150
      [<      none      >] copy_process.part.35+0x1bf4/0x5760 kernel/kernel/fork.c:1451
      [<     inline     >] copy_process kernel/kernel/fork.c:1274
      [<      none      >] _do_fork+0x1bc/0xcb0 kernel/kernel/fork.c:1723
      [<     inline     >] SYSC_clone kernel/kernel/fork.c:1832
      [<      none      >] SyS_clone+0x37/0x50 kernel/kernel/fork.c:1826
      [<      none      >] entry_SYSCALL_64_fastpath+0x16/0x7a kernel/arch/x86/entry/entry_64.S:185
      
      INFO: Freed in net_drop_ns+0x67/0x80 age=575 cpu=2 pid=2631
      [<      none      >] __slab_free+0x1fc/0x320 kernel/mm/slub.c:2650
      [<     inline     >] slab_free kernel/mm/slub.c:2805
      [<      none      >] kmem_cache_free+0x2a0/0x330 kernel/mm/slub.c:2814
      [<     inline     >] net_free kernel/net/core/net_namespace.c:341
      [<      none      >] net_drop_ns+0x67/0x80 kernel/net/core/net_namespace.c:348
      [<      none      >] cleanup_net+0x4e5/0x600 kernel/net/core/net_namespace.c:448
      [<      none      >] process_one_work+0x794/0x1440 kernel/kernel/workqueue.c:2036
      [<      none      >] worker_thread+0xdb/0xfc0 kernel/kernel/workqueue.c:2170
      [<      none      >] kthread+0x23f/0x2d0 kernel/drivers/block/aoe/aoecmd.c:1303
      [<      none      >] ret_from_fork+0x3f/0x70 kernel/arch/x86/entry/entry_64.S:468
      INFO: Slab 0xffffea0001938800 objects=3 used=0 fp=0xffff880064e20000
      flags=0x5fffc0000004080
      INFO: Object 0xffff880064e20000 @offset=0 fp=0xffff880064e24200
      
      CPU: 1 PID: 11581 Comm: syz-executor Tainted: G    B           4.4.0+
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
      rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
       00000000ffffffff ffff8800662c7790 ffffffff8292049d ffff88003e36a300
       ffff880064e20000 ffff880064e20000 ffff8800662c77c0 ffffffff816f2054
       ffff88003e36a300 ffffea0001938800 ffff880064e20000 0000000000000000
      Call Trace:
       [<     inline     >] __dump_stack kernel/lib/dump_stack.c:15
       [<ffffffff8292049d>] dump_stack+0x6f/0xa2 kernel/lib/dump_stack.c:50
       [<ffffffff816f2054>] print_trailer+0xf4/0x150 kernel/mm/slub.c:654
       [<ffffffff816f875f>] object_err+0x2f/0x40 kernel/mm/slub.c:661
       [<     inline     >] print_address_description kernel/mm/kasan/report.c:138
       [<ffffffff816fb0c5>] kasan_report_error+0x215/0x530 kernel/mm/kasan/report.c:236
       [<     inline     >] kasan_report kernel/mm/kasan/report.c:259
       [<ffffffff816fb4de>] __asan_report_load8_noabort+0x3e/0x40 kernel/mm/kasan/report.c:280
       [<     inline     >] ? ppp_pernet kernel/include/linux/compiler.h:218
       [<ffffffff83ad71b2>] ? ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
       [<     inline     >] ppp_pernet kernel/include/linux/compiler.h:218
       [<ffffffff83ad71b2>] ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
       [<     inline     >] ? ppp_pernet kernel/drivers/net/ppp/ppp_generic.c:293
       [<ffffffff83ad6f26>] ? ppp_unregister_channel+0xe6/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
       [<ffffffff83ae18f3>] ppp_asynctty_close+0xa3/0x130 kernel/drivers/net/ppp/ppp_async.c:241
       [<ffffffff83ae1850>] ? async_lcp_peek+0x5b0/0x5b0 kernel/drivers/net/ppp/ppp_async.c:1000
       [<ffffffff82c33239>] tty_ldisc_close.isra.1+0x99/0xe0 kernel/drivers/tty/tty_ldisc.c:478
       [<ffffffff82c332c0>] tty_ldisc_kill+0x40/0x170 kernel/drivers/tty/tty_ldisc.c:744
       [<ffffffff82c34943>] tty_ldisc_release+0x1b3/0x260 kernel/drivers/tty/tty_ldisc.c:772
       [<ffffffff82c1ef21>] tty_release+0xac1/0x13e0 kernel/drivers/tty/tty_io.c:1901
       [<ffffffff82c1e460>] ? release_tty+0x320/0x320 kernel/drivers/tty/tty_io.c:1688
       [<ffffffff8174de36>] __fput+0x236/0x780 kernel/fs/file_table.c:208
       [<ffffffff8174e405>] ____fput+0x15/0x20 kernel/fs/file_table.c:244
       [<ffffffff813595ab>] task_work_run+0x16b/0x200 kernel/kernel/task_work.c:115
       [<     inline     >] exit_task_work kernel/include/linux/task_work.h:21
       [<ffffffff81307105>] do_exit+0x8b5/0x2c60 kernel/kernel/exit.c:750
       [<ffffffff813fdd20>] ? debug_check_no_locks_freed+0x290/0x290 kernel/kernel/locking/lockdep.c:4123
       [<ffffffff81306850>] ? mm_update_next_owner+0x6f0/0x6f0 kernel/kernel/exit.c:357
       [<ffffffff813215e6>] ? __dequeue_signal+0x136/0x470 kernel/kernel/signal.c:550
       [<ffffffff8132067b>] ? recalc_sigpending_tsk+0x13b/0x180 kernel/kernel/signal.c:145
       [<ffffffff81309628>] do_group_exit+0x108/0x330 kernel/kernel/exit.c:880
       [<ffffffff8132b9d4>] get_signal+0x5e4/0x14f0 kernel/kernel/signal.c:2307
       [<     inline     >] ? kretprobe_table_lock kernel/kernel/kprobes.c:1113
       [<ffffffff8151d355>] ? kprobe_flush_task+0xb5/0x450 kernel/kernel/kprobes.c:1158
       [<ffffffff8115f7d3>] do_signal+0x83/0x1c90 kernel/arch/x86/kernel/signal.c:712
       [<ffffffff8151d2a0>] ? recycle_rp_inst+0x310/0x310 kernel/include/linux/list.h:655
       [<ffffffff8115f750>] ? setup_sigcontext+0x780/0x780 kernel/arch/x86/kernel/signal.c:165
       [<ffffffff81380864>] ? finish_task_switch+0x424/0x5f0 kernel/kernel/sched/core.c:2692
       [<     inline     >] ? finish_lock_switch kernel/kernel/sched/sched.h:1099
       [<ffffffff81380560>] ? finish_task_switch+0x120/0x5f0 kernel/kernel/sched/core.c:2678
       [<     inline     >] ? context_switch kernel/kernel/sched/core.c:2807
       [<ffffffff85d794e9>] ? __schedule+0x919/0x1bd0 kernel/kernel/sched/core.c:3283
       [<ffffffff81003901>] exit_to_usermode_loop+0xf1/0x1a0 kernel/arch/x86/entry/common.c:247
       [<     inline     >] prepare_exit_to_usermode kernel/arch/x86/entry/common.c:282
       [<ffffffff810062ef>] syscall_return_slowpath+0x19f/0x210 kernel/arch/x86/entry/common.c:344
       [<ffffffff85d88022>] int_ret_from_sys_call+0x25/0x9f kernel/arch/x86/entry/entry_64.S:281
      Memory state around the buggy address:
       ffff880064e21680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ffff880064e21700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      >ffff880064e21780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                             ^
       ffff880064e21800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ffff880064e21880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ==================================================================
      
      Fixes: 273ec51d ("net: ppp_generic - introduce net-namespace functionality v2")
      Reported-by: NBaozeng Ding <sploving1@gmail.com>
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      Reviewed-by: NCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f461dcd
    • V
      net: mediatek: fix checking for NULL instead of IS_ERR() in .probe · 621e49f6
      Vladimir Zapolskiy 提交于
      devm_ioremap_resource() returns ERR_PTR() value on error, it never
      returns NULL, fix it and propagate the returned error upwards.
      
      Fixes: 656e7052 ("net-next: mediatek: add support for MT7623 ethernet")
      Signed-off-by: NVladimir Zapolskiy <vz@mleia.com>
      Reviewed-by: NMatthias Brugger <mbrugger@suse.com>
      Acked-by: NJohn Crispin <blogic@openwrt.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      621e49f6
    • S
      net: phy: at803x: Request 'reset' GPIO only for AT8030 PHY · 9eb13f65
      Sebastian Frias 提交于
      This removes the dependency on GPIOLIB for non faulty PHYs.
      
      Indeed, without this patch, if GPIOLIB is not selected
      devm_gpiod_get_optional() will return -ENOSYS and the driver probe
      call will fail, regardless of the actual PHY hardware.
      
      Out of the 3 PHYs supported by this driver (AT8030, AT8031, AT8035),
      only AT8030 presents the issues that commit 13a56b44 ("net: phy:
      at803x: Add support for hardware reset") attempts to work-around by
      using a 'reset' GPIO line.
      
      Hence, only AT8030 should depend on GPIOLIB operating properly.
      
      Fixes: 13a56b44 ("net: phy: at803x: Add support for hardware reset")
      Signed-off-by: NSebastian Frias <sf84@laposte.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9eb13f65
    • S
      at803x: fix reset handling · d57019d1
      Sergei Shtylyov 提交于
      The driver of course "knows" that the chip's reset signal is active low,
      so  it drives the GPIO to 0  to reset the PHY and to 1 otherwise; however
      all this will only work iff the GPIO  is  specified as active-high in the
      device tree!  I think both the driver and the device trees (if there are
      any -- I was unable to find them) need to be fixed in this case...
      
      Fixes: 13a56b44 ("net: phy: at803x: Add support for hardware reset")
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d57019d1
    • M
      hp-wmi: Remove GPS rfkill support via pre-2009 interface · fffcad87
      Maciej S. Szmigiero 提交于
      GPS rfkill support via pre-2009 WMI interface uses hp_wmi_get_sw_state()
      and hp_wmi_get_hw_state() to query its current hard and soft block state,
      respectively.
      
      In hp_wmi_get_sw_state() a mask is calculated which bit should be checked
      in an int value returned by firmware to get current block state: 0x200 <<
      (r * 8) which with r being 3 for GPS results in overflow and mask of zero.
      The same goes for hp_wmi_get_hw_state().
      
      This effectively means that GPS rfkill on this WMI interface is considered
      always both hard and soft blocked.
      
      Unfortunately, later when rfkill subsystem calls hp_wmi_set_block() to sync
      this block to hardware firmware at least on my old nc6400 gets confused and
      sets both hard and soft blocks on WiFi and BT.
      
      This happens for example on hp-wmi module load.
      
      Since due to overflow described above it is dubious that this ever worked
      correctly and HP laptops with modems having GPS support seem to all have
      been released well past year 2009 let's just remove GPS rfkill support via
      pre-2009 WMI interface.
      Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      fffcad87
    • M
      hp-wmi: fix unregister order in hp_wmi_rfkill_setup() once again · c7805e54
      Maciej S. Szmigiero 提交于
      rfkill registration order in hp_wmi_rfkill_setup() is:
      1) WiFi,
      2) BT,
      3) WWAN,
      5) GPS.
      
      Unregistration when cleaning up on error return should happen in reverse
      order.
      
      This means that: If BT rfkill fails to be allocated we possibly need to
      first unregister WiFi rfkill before destroying it.
      
      The same goes with (WWAN, BT) and (GPS, WWAN) pairs.
      
      Also, if WWAN rfkill fails to register we need to (possibly) unregister BT
      not the GPS one.  And if GPS rfkill fails to register we need to unregister
      WWAN not the BT one.
      
      We never need to unregister GPS rfkill here since if GPS rfkill
      registration succeeds this function returns without error so no cleanup is
      necessary.
      Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      c7805e54
    • M
      dell-wmi: support Dell Inspiron M5110 · aaf3a5e7
      Michał Kępień 提交于
      Similarly to Dell Vostro V131, Dell Inspiron M5110 also requires an
      SMBIOS request to be issued in order for WMI events to be generated and
      does not raise an i8042 interrupt when the Dell Instant Launch hotkey is
      pressed.  However, the event code for that hotkey on this machine is
      0xe029, so add it to the legacy keymap.
      Signed-off-by: NMichał Kępień <kernel@kempniu.pl>
      Tested-by: NDarek Stojaczyk <darek.stojaczyk@gmail.com>
      Reviewed-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      aaf3a5e7
    • M
      dell-wmi: properly process Dell Instant Launch hotkey · 13f5059a
      Michał Kępień 提交于
      On models on which an SMBIOS request needs to be issued in order for WMI
      events to be generated, pressing the Dell Instant Launch hotkey does not
      raise an i8042 interrupt - only a WMI event is generated (0xe025 on Dell
      Vostro V131).  As that WMI event is the only way the kernel will be
      notified about pressing the Dell Instant Launch hotkey on such machines,
      the relevant keymap entry has to be changed to a KE_KEY one.  However,
      the same WMI event should still be ignored on machines which do not
      require an SMBIOS request for enabling WMI, so filter it conditionally
      in dell_wmi_process_key().
      Signed-off-by: NMichał Kępień <kernel@kempniu.pl>
      Reviewed-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      13f5059a
    • M
      dell-wmi: enable receiving WMI events on Dell Vostro V131 · e09c4d5b
      Michał Kępień 提交于
      On some laptop models (e.g. Dell Vostro V131), WMI events are not
      generated until a specific SMBIOS request is issued to register an event
      listener [1].  As there seems to be no ACPI method or SMBIOS request to
      determine without possible side effects whether a given machine needs to
      issue this SMBIOS request in order to receive WMI events, DMI matching
      is used to whitelist the models which need it.
      
      [1] https://lists.us.dell.com/pipermail/libsmbios-devel/2015-July/000612.htmlSigned-off-by: NMichał Kępień <kernel@kempniu.pl>
      Reviewed-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      e09c4d5b
    • M
      dell-smbios: rename dell_smi_error() to dell_smbios_error() · 0db2180f
      Michał Kępień 提交于
      As dell_smi_error() is exported by dell-smbios, its prefix should be
      consistent with other exported symbols, so change function name to
      dell_smbios_error().
      Signed-off-by: NMichał Kępień <kernel@kempniu.pl>
      Reviewed-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      0db2180f
    • M
      dell-laptop: move dell_smi_error() to dell-smbios · e8edf53b
      Michał Kępień 提交于
      The dell_smi_error() method could be used by modules other than
      dell-laptop for convenient translation of SMBIOS request errors into
      errno values.  Thus, move it to dell-smbios.
      Signed-off-by: NMichał Kępień <kernel@kempniu.pl>
      Reviewed-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      e8edf53b
    • J
      ideapad-laptop: Add ideapad Y700 (15) to the no_hw_rfkill DMI list · 4db9675d
      John Dahlstrom 提交于
      Some Lenovo ideapad models lack a physical rfkill switch.
      On Lenovo models ideapad Y700 Touch-15ISK and ideapad Y700-15ISK,
      ideapad-laptop would wrongly report all radios as blocked by
      hardware which caused wireless network connections to fail.
      
      Add these models without an rfkill switch to the no_hw_rfkill list.
      Signed-off-by: NJohn Dahlstrom <jodarom@sdf.org>
      Cc: <stable@vger.kernel.org> # 3.17.x-: 4fa9dabc: ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      4db9675d
    • M
      fujitsu-laptop: Support radio toggle button · b5df36cf
      Michał Kępień 提交于
      Lifebook E734/E744/E754 has a radio toggle button which uses code 0x420.
      Map it to KEY_RFKILL.
      Signed-off-by: NMichał Kępień <kernel@kempniu.pl>
      Acked-by: NJonathan Woithe <jwoithe@just42.net>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      b5df36cf
    • W
      intel-hid: allocate correct amount of memory for private struct · e8b69a51
      Wolfram Sang 提交于
      We want the size of the struct, not of a pointer to it. To be future
      proof, just dereference the pointer to get the desired type.
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      e8b69a51