1. 29 8月, 2017 18 次提交
  2. 13 8月, 2017 1 次提交
  3. 11 8月, 2017 15 次提交
    • A
      iommu/arm-smmu: fix null-pointer dereference in arm_smmu_add_device · a7990c64
      Artem Savkov 提交于
      Commit c54451a5 "iommu/arm-smmu: Fix the error path in arm_smmu_add_device"
      removed fwspec assignment in legacy_binding path as redundant which is
      wrong. It needs to be updated after fwspec initialisation in
      arm_smmu_register_legacy_master() as it is dereferenced later. Without
      this there is a NULL-pointer dereference panic during boot on some hosts.
      Signed-off-by: NArtem Savkov <asavkov@redhat.com>
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      a7990c64
    • L
      xen/events: Fix interrupt lost during irq_disable and irq_enable · 020db9d3
      Liu Shuo 提交于
      Here is a device has xen-pirq-MSI interrupt. Dom0 might lost interrupt
      during driver irq_disable/irq_enable. Here is the scenario,
       1. irq_disable -> disable_dynirq -> mask_evtchn(irq channel)
       2. dev interrupt raised by HW and Xen mark its evtchn as pending
       3. irq_enable -> startup_pirq -> eoi_pirq ->
          clear_evtchn(channel of irq) -> clear pending status
       4. consume_one_event process the irq event without pending bit assert
          which result in interrupt lost once
       5. No HW interrupt raising anymore.
      
      Now use enable_dynirq for enable_pirq of xen_pirq_chip to remove
      eoi_pirq when irq_enable.
      Signed-off-by: NLiu Shuo <shuo.a.liu@intel.com>
      Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: NJuergen Gross <jgross@suse.com>
      020db9d3
    • J
      xen: avoid deadlock in xenbus · 529871bb
      Juergen Gross 提交于
      When starting the xenwatch thread a theoretical deadlock situation is
      possible:
      
      xs_init() contains:
      
          task = kthread_run(xenwatch_thread, NULL, "xenwatch");
          if (IS_ERR(task))
              return PTR_ERR(task);
          xenwatch_pid = task->pid;
      
      And xenwatch_thread() does:
      
          mutex_lock(&xenwatch_mutex);
          ...
          event->handle->callback();
          ...
          mutex_unlock(&xenwatch_mutex);
      
      The callback could call unregister_xenbus_watch() which does:
      
          ...
          if (current->pid != xenwatch_pid)
              mutex_lock(&xenwatch_mutex);
          ...
      
      In case a watch is firing before xenwatch_pid could be set and the
      callback of that watch unregisters a watch, then a self-deadlock would
      occur.
      
      Avoid this by setting xenwatch_pid in xenwatch_thread().
      Signed-off-by: NJuergen Gross <jgross@suse.com>
      Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: NJuergen Gross <jgross@suse.com>
      529871bb
    • M
      zram: rework copy of compressor name in comp_algorithm_store() · f357e345
      Matthias Kaehlcke 提交于
      comp_algorithm_store() passes the size of the source buffer to strlcpy()
      instead of the destination buffer size.  Make it explicit that the two
      buffers have the same size and use strcpy() instead of strlcpy().  The
      latter can be done safely since the function ensures that the string in
      the source buffer is terminated.
      
      Link: http://lkml.kernel.org/r/20170803163350.45245-1-mka@chromium.orgSigned-off-by: NMatthias Kaehlcke <mka@chromium.org>
      Reviewed-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f357e345
    • M
      thunderbolt: Do not enumerate more ports from DROM than the controller has · 1cd65d17
      Mika Westerberg 提交于
      Some Alpine Ridge LP DROMs (there might be others) erroneusly list more
      ports than the controller actually has. Most probably because DROM of
      the full Dual/Single port Thunderbolt controller was reused for LP
      version. The current DROM parser does not check the upper bound thus it
      leads to crash when sw->ports[] is accessed over bounds:
      
       BUG: unable to handle kernel NULL pointer dereference at 00000000000002ec
       IP: tb_drom_read+0x383/0x890 [thunderbolt]
       PGD 0
       P4D 0
       Oops: 0000 [#1] SMP
       CPU: 3 PID: 12248 Comm: systemd-udevd Not tainted 4.13.0-rc1-next-20170719 #1
       Hardware name: LENOVO 20HF000YGE/20HF000YGE, BIOS N1WET32W (1.11 ) 05/23/2017
       task: ffff8a293e4bcd80 task.stack: ffffa698027a8000
       RIP: 0010:tb_drom_read+0x383/0x890 [thunderbolt]
       RSP: 0018:ffffa698027ab990 EFLAGS: 00010246
       RAX: 0000000000000000 RBX: ffff8a2940af7800 RCX: 0000000000000000
       RDX: ffff8a2940ebb400 RSI: 0000000000000000 RDI: ffffa698027ab9a0
       RBP: ffffa698027ab9d0 R08: 0000000000000001 R09: 0000000000000002
       R10: ffff8a2940ebb5b0 R11: 0000000000000000 R12: ffff8a293bfa968c
       R13: 000000000000002c R14: 0000000000000056 R15: 0000000000000056
       FS:  00007f0a945a38c0(0000) GS:ffff8a2961580000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 00000000000002ec CR3: 000000043e785000 CR4: 00000000003606e0
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
       Call Trace:
        tb_switch_add+0x9d/0x730 [thunderbolt]
        ? tb_switch_alloc+0x3cd/0x4d0 [thunderbolt]
        icm_start+0x5a/0xa0 [thunderbolt]
        tb_domain_add+0xc3/0xf0 [thunderbolt]
        nhi_probe+0x19e/0x310 [thunderbolt]
        local_pci_probe+0x42/0xa0
        pci_device_probe+0x18d/0x1a0
        driver_probe_device+0x2ff/0x450
        __driver_attach+0xa4/0xe0
        ? driver_probe_device+0x450/0x450
        bus_for_each_dev+0x6e/0xb0
        driver_attach+0x1e/0x20
        bus_add_driver+0x1d0/0x270
        ? 0xffffffffc0bbb000
        driver_register+0x60/0xe0
        ? 0xffffffffc0bbb000
        __pci_register_driver+0x4c/0x50
        nhi_init+0x28/0x1000 [thunderbolt]
        do_one_initcall+0x50/0x190
        ? __vunmap+0x81/0xb0
        ? _cond_resched+0x1a/0x50
        ? kmem_cache_alloc_trace+0x15f/0x1c0
        ? do_init_module+0x27/0x1e9
        do_init_module+0x5f/0x1e9
        load_module+0x24e7/0x2a60
        ? vfs_read+0x115/0x130
        SYSC_finit_module+0xfc/0x120
        ? SYSC_finit_module+0xfc/0x120
        SyS_finit_module+0xe/0x10
        do_syscall_64+0x67/0x170
        entry_SYSCALL64_slow_path+0x25/0x25
      
      Fix this by making sure we only enumerate DROM port entries the hardware
      actually has.
      Reported-by: NChristian Kellner <ckellner@redhat.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: NLukas Wunner <lukas@wunner.de>
      Tested-by: NChristian Kellner <ckellner@redhat.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1cd65d17
    • A
      mei: exclude device from suspend direct complete optimization · 557909e1
      Alexander Usyskin 提交于
      MEI device performs link reset during system suspend sequence.
      The link reset cannot be performed while device is in
      runtime suspend state. The resume sequence is bypassed with
      suspend direct complete optimization,so the optimization should be
      disabled for mei devices.
      
      Fixes:
       [  192.940537] Restarting tasks ...
       [  192.940610] PGI is not set
       [  192.940619] ------------[ cut here ]------------ [  192.940623]
       WARNING: CPU: 0
       me.c:653 mei_me_pg_exit_sync+0x351/0x360 [  192.940624] Modules
       linked
       in:
       [  192.940627] CPU: 0 PID: 1661 Comm: kworker/0:3 Not tainted
       4.13.0-rc2+
       #2 [  192.940628] Hardware name: Dell Inc. XPS 13 9343/0TM99H, BIOS
       A11
       12/08/2016 [  192.940630] Workqueue: pm pm_runtime_work <snip> [
       192.940642] Call Trace:
       [  192.940646]  ? pci_pme_active+0x1de/0x1f0 [  192.940649]  ?
       pci_restore_standard_config+0x50/0x50
       [  192.940651]  ? kfree+0x172/0x190
       [  192.940653]  ? kfree+0x172/0x190
       [  192.940655]  ? pci_restore_standard_config+0x50/0x50
       [  192.940663]  mei_me_pm_runtime_resume+0x3f/0xc0
       [  192.940665]  pci_pm_runtime_resume+0x7a/0xa0 [  192.940667]
       __rpm_callback+0xb9/0x1e0 [  192.940668]  ?
       preempt_count_add+0x6d/0xc0 [  192.940670]  rpm_callback+0x24/0x90 [
       192.940672]  ? pci_restore_standard_config+0x50/0x50
       [  192.940674]  rpm_resume+0x4e8/0x800 [  192.940676]
       pm_runtime_work+0x55/0xb0 [  192.940678]
       process_one_work+0x184/0x3e0 [  192.940680]
       worker_thread+0x4d/0x3a0 [ 192.940681]  ?
       preempt_count_sub+0x9b/0x100 [  192.940683]
       kthread+0x122/0x140 [  192.940684]  ? process_one_work+0x3e0/0x3e0 [
       192.940685]  ? __kthread_create_on_node+0x1a0/0x1a0
       [  192.940688]  ret_from_fork+0x27/0x40 [  192.940690] Code: 96 3a
       9e ff 48 8b 7d 98 e8 cd 21 58 00 83 bb bc 01 00 00
       04 0f 85 40 fe ff ff e9 41 fe ff ff 48 c7 c7 5f 04 99 96 e8 93 6b 9f
       ff <0f> ff e9 5d fd ff ff e8 33 fe 99 ff 0f 1f 00 0f 1f 44 00 00 55
       [  192.940719] ---[ end trace
       a86955597774ead8 ]--- [  192.942540] done.
      Suggested-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reported-by: NDominik Brodowski <linux@dominikbrodowski.net>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NAlexander Usyskin <alexander.usyskin@intel.com>
      Signed-off-by: NTomas Winkler <tomas.winkler@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      557909e1
    • L
      firmware: avoid invalid fallback aborts by using killable wait · 260d9f2f
      Luis R. Rodriguez 提交于
      Commit 0cb64249 ("firmware_loader: abort request if wait_for_completion
      is interrupted") added via 4.0 added support to abort the fallback mechanism
      when a signal was detected and wait_for_completion_interruptible() returned
      -ERESTARTSYS -- for instance when a user hits CTRL-C. The abort was overly
      *too* effective.
      
      When a child process terminates (successful or not) the signal SIGCHLD can
      be sent to the parent process which ran the child in the background and
      later triggered a sync request for firmware through a sysfs interface which
      relies on the fallback mechanism. This signal in turn can be recieved by the
      interruptible wait we constructed on firmware_class and detects it as an
      abort *before* userspace could get a chance to write the firmware. Upon
      failure -EAGAIN is returned, so userspace is also kept in the dark about
      exactly what happened.
      
      We can reproduce the issue with the fw_fallback.sh selftest:
      
      Before this patch:
      $ sudo tools/testing/selftests/firmware/fw_fallback.sh
      ...
      tools/testing/selftests/firmware/fw_fallback.sh: error - sync firmware request cancelled due to SIGCHLD
      
      After this patch:
      $ sudo tools/testing/selftests/firmware/fw_fallback.sh
      ...
      tools/testing/selftests/firmware/fw_fallback.sh: SIGCHLD on sync ignored as expected
      
      Fix this by making the wait killable -- only killable by SIGKILL (kill -9).
      We loose the ability to allow userspace to cancel a write with CTRL-C
      (SIGINT), however its been decided the compromise to require SIGKILL is
      worth the gains.
      
      Chances of this issue occuring are low due to the number of drivers upstream
      exclusively relying on the fallback mechanism for firmware (2 drivers),
      however this is observed in the field with custom drivers with sysfs
      triggers to load firmware. Only distributions relying on the fallback
      mechanism are impacted as well. An example reported issue was on Android,
      as follows:
      
      1) Android init (pid=1) fork()s (say pid=42) [this child process is totally
         unrelated to firmware loading, it could be sleep 2; for all we care ]
      2) Android init (pid=1) does a write() on a (driver custom) sysfs file which
         ends up calling request_firmware() kernel side
      3) The firmware loading fallback mechanism is used, the request is sent to
         userspace and pid 1 waits in the kernel on wait_*
      4) before firmware loading completes pid 42 dies (for any reason, even
         normal termination)
      5) Kernel delivers SIGCHLD to pid=1 to tell it a child has died, which
         causes -ERESTARTSYS to be returned from wait_*
      6) The kernel's wait aborts and return -EAGAIN for the
         request_firmware() caller.
      
      Cc: stable <stable@vger.kernel.org> # 4.0
      Fixes: 0cb64249 ("firmware_loader: abort request if wait_for_completion is interrupted")
      Suggested-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Suggested-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Tested-by: NMartin Fuzzey <mfuzzey@parkeon.com>
      Reported-by: NMartin Fuzzey <mfuzzey@parkeon.com>
      Signed-off-by: NLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      260d9f2f
    • L
      firmware: fix batched requests - send wake up on failure on direct lookups · 90d41e74
      Luis R. Rodriguez 提交于
      Fix batched requests from waiting forever on failure.
      
      The firmware API batched requests feature has been broken since the API call
      request_firmware_direct() was introduced on commit bba3a87e ("firmware:
      Introduce request_firmware_direct()"), added on v3.14 *iff* the firmware
      being requested was not present in *certain kernel builds* [0].
      
      When no firmware is found the worker which goes on to finish never informs
      waiters queued up of this, so any batched request will stall in what seems
      to be forever (MAX_SCHEDULE_TIMEOUT). Sadly, a reboot will also stall, as
      the reboot notifier was only designed to kill custom fallback workers. The
      issue seems to the user as a type of soft lockup, what *actually* happens
      underneath the hood is a wait call which never completes as we failed to
      issue a completion on error.
      
      For device drivers with optional firmware schemes (ie, Intel iwlwifi, or
      Netronome -- even though it uses request_firmware() and not
      request_firmware_direct()), this could mean that when you boot a system with
      multiple cards the firmware will seem to never load on the system, or that
      the card is just not responsive even the driver initialization. Due to
      differences in scheduling possible this should not always trigger --
      one would need to to ensure that multiple requests are in place at the
      right time for this to work, also release_firmware() must not be called
      prior to any other incoming request. The complexity may not be worth
      supporting batched requests in the future given the wait mechanism is
      only used also for the fallback mechanism. We'll keep it for now and
      just fix it.
      
      Its reported that at least with the Intel WiFi cards on one system this
      issue was creeping up 50% of the boots [0].
      
      Before this commit batched requests testing revealed:
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=n
      CONFIG_FW_LOADER_USER_HELPER=y
      
      Most common Linux distribution setup.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     FAIL                OK
      request_firmware_direct()              FAIL                OK
      request_firmware_nowait(uevent=true)   FAIL                OK
      request_firmware_nowait(uevent=false)  FAIL                OK
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=n
      CONFIG_FW_LOADER_USER_HELPER=n
      
      Only possible if CONFIG_DELL_RBU=n and CONFIG_LEDS_LP55XX_COMMON=n, rare.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     FAIL                OK
      request_firmware_direct()              FAIL                OK
      request_firmware_nowait(uevent=true)   FAIL                OK
      request_firmware_nowait(uevent=false)  FAIL                OK
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
      CONFIG_FW_LOADER_USER_HELPER=y
      
      Google Android setup.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     OK                  OK
      request_firmware_direct()              FAIL                OK
      request_firmware_nowait(uevent=true)   OK                  OK
      request_firmware_nowait(uevent=false)  OK                  OK
      ============================================================================
      
      Ater this commit batched testing results:
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=n
      CONFIG_FW_LOADER_USER_HELPER=y
      
      Most common Linux distribution setup.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     OK                  OK
      request_firmware_direct()              OK                  OK
      request_firmware_nowait(uevent=true)   OK                  OK
      request_firmware_nowait(uevent=false)  OK                  OK
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=n
      CONFIG_FW_LOADER_USER_HELPER=n
      
      Only possible if CONFIG_DELL_RBU=n and CONFIG_LEDS_LP55XX_COMMON=n, rare.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     OK                  OK
      request_firmware_direct()              OK                  OK
      request_firmware_nowait(uevent=true)   OK                  OK
      request_firmware_nowait(uevent=false)  OK                  OK
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
      CONFIG_FW_LOADER_USER_HELPER=y
      
      Google Android setup.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     OK                  OK
      request_firmware_direct()              OK                  OK
      request_firmware_nowait(uevent=true)   OK                  OK
      request_firmware_nowait(uevent=false)  OK                  OK
      ============================================================================
      
      [0] https://bugzilla.kernel.org/show_bug.cgi?id=195477
      
      Cc: stable <stable@vger.kernel.org> # v3.14
      Fixes: bba3a87e ("firmware: Introduce request_firmware_direct()"
      Reported-by: NNicolas <nbroeking@me.com>
      Reported-by: NJohn Ewalt  <jewalt@lgsinnovations.com>
      Reported-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      90d41e74
    • L
      firmware: fix batched requests - wake all waiters · e44565f6
      Luis R. Rodriguez 提交于
      The firmware cache mechanism serves two purposes, the secondary purpose is
      not well documented nor understood. This fixes a regression with the
      secondary purpose of the firmware cache mechanism: batched requests on
      successful lookups. Without this fix *any* time a batched request is
      triggered, secondary requests for which the batched request mechanism
      was designed for will seem to last forver and seem to never return.
      This issue is present for all kernel builds possible, and a hard reset
      is required.
      
      The firmware cache is used for:
      
      1) Addressing races with file lookups during the suspend/resume cycle
         by keeping firmware in memory during the suspend/resume cycle
      
      2) Batched requests for the same file rely only on work from the first file
         lookup, which keeps the firmware in memory until the last
         release_firmware() is called
      
      Batched requests *only* take effect if secondary requests come in prior to
      the first user calling release_firmware(). The devres name used for the
      internal firmware cache is used as a hint other pending requests are
      ongoing, the firmware buffer data is kept in memory until the last user of
      the buffer calls release_firmware(), therefore serializing requests and
      delaying the release until all requests are done.
      
      Batched requests wait for a wakup or signal so we can rely on the first file
      fetch to write to the pending secondary requests. Commit 5b029624
      ("firmware: do not use fw_lock for fw_state protection") ported the firmware
      API to use swait, and in doing so failed to convert complete_all() to
      swake_up_all() -- it used swake_up(), loosing the ability for *some* batched
      requests to take effect.
      
      We *could* fix this by just using swake_up_all() *but* swait is now known
      to be very special use case, so its best to just move away from it. So we
      just go back to using completions as before commit 5b029624 ("firmware:
      do not use fw_lock for fw_state protection") given this was using
      complete_all().
      
      Without this fix it has been reported plugging in two Intel 6260 Wifi cards
      on a system will end up enumerating the two devices only 50% of the time
      [0]. The ported swake_up() should have actually handled the case with two
      devices, however, *if more than two cards are used* the swake_up() would
      not have sufficed. This change is only part of the required fixes for
      batched requests. Another fix is provided in the next patch.
      
      This particular change should fix the cases where more than three requests
      with the same firmware name is used, otherwise batched requests will wait
      for MAX_SCHEDULE_TIMEOUT and just timeout eventually.
      
      Below is a summary of tests triggering batched requests on different
      kernel builds.
      
      Before this patch:
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=n
      CONFIG_FW_LOADER_USER_HELPER=y
      
      Most common Linux distribution setup.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     FAIL                FAIL
      request_firmware_direct()              FAIL                FAIL
      request_firmware_nowait(uevent=true)   FAIL                FAIL
      request_firmware_nowait(uevent=false)  FAIL                FAIL
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=n
      CONFIG_FW_LOADER_USER_HELPER=n
      
      Only possible if CONFIG_DELL_RBU=n and CONFIG_LEDS_LP55XX_COMMON=n, rare.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     FAIL                FAIL
      request_firmware_direct()              FAIL                FAIL
      request_firmware_nowait(uevent=true)   FAIL                FAIL
      request_firmware_nowait(uevent=false)  FAIL                FAIL
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
      CONFIG_FW_LOADER_USER_HELPER=y
      
      Google Android setup.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     FAIL                FAIL
      request_firmware_direct()              FAIL                FAIL
      request_firmware_nowait(uevent=true)   FAIL                FAIL
      request_firmware_nowait(uevent=false)  FAIL                FAIL
      ============================================================================
      
      After this patch:
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=n
      CONFIG_FW_LOADER_USER_HELPER=y
      
      Most common Linux distribution setup.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     FAIL                OK
      request_firmware_direct()              FAIL                OK
      request_firmware_nowait(uevent=true)   FAIL                OK
      request_firmware_nowait(uevent=false)  FAIL                OK
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=n
      CONFIG_FW_LOADER_USER_HELPER=n
      
      Only possible if CONFIG_DELL_RBU=n and CONFIG_LEDS_LP55XX_COMMON=n, rare.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     FAIL                OK
      request_firmware_direct()              FAIL                OK
      request_firmware_nowait(uevent=true)   FAIL                OK
      request_firmware_nowait(uevent=false)  FAIL                OK
      ============================================================================
      CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
      CONFIG_FW_LOADER_USER_HELPER=y
      
      Google Android setup.
      
      API-type                               no-firmware-found   firmware-found
      ----------------------------------------------------------------------
      request_firmware()                     OK                  OK
      request_firmware_direct()              FAIL                OK
      request_firmware_nowait(uevent=true)   OK                  OK
      request_firmware_nowait(uevent=false)  OK                  OK
      ============================================================================
      
      [0] https://bugzilla.kernel.org/show_bug.cgi?id=195477
      
      CC: <stable@vger.kernel.org>    [4.10+]
      Cc: Ming Lei <ming.lei@redhat.com>
      Fixes: 5b029624 ("firmware: do not use fw_lock for fw_state protection")
      Reported-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e44565f6
    • G
      USB: serial: pl2303: add new ATEN device id · 3b6bcd3d
      Greg Kroah-Hartman 提交于
      This adds a new ATEN device id for a new pl2303-based device.
      Reported-by: NPeter Kuo <PeterKuo@aten.com.tw>
      Cc: stable <stable@vger.kernel.org>
      Cc: Johan Hovold <johan@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3b6bcd3d
    • K
      usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter · 7496cfe5
      Kai-Heng Feng 提交于
      Moshi USB to Ethernet Adapter internally uses a Genesys Logic hub to
      connect to Realtek r8153.
      
      The Realtek r8153 ethernet does not work on the internal hub, no-lpm quirk
      can make it work.
      
      Since another r8153 dongle at my hand does not have the issue, so add
      the quirk to the Genesys Logic hub instead.
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7496cfe5
    • A
      USB: Check for dropped connection before switching to full speed · 94c43b98
      Alan Stern 提交于
      Some buggy USB disk adapters disconnect and reconnect multiple times
      during the enumeration procedure.  This may lead to a device
      connecting at full speed instead of high speed, because when the USB
      stack sees that a device isn't able to enumerate at high speed, it
      tries to hand the connection over to a full-speed companion
      controller.
      
      The logic for doing this is careful to check that the device is still
      connected.  But this check is inadequate if the device disconnects and
      reconnects before the check is done.  The symptom is that a device
      works, but much more slowly than it is capable of operating.
      
      The situation was made worse recently by commit 22547c4c ("usb:
      hub: Wait for connection to be reestablished after port reset"), which
      increases the delay following a reset before a disconnect is
      recognized, thus giving the device more time to reconnect.
      
      This patch makes the check more robust.  If the device was
      disconnected at any time during enumeration, we will now skip the
      full-speed handover.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: NZdenek Kabelac <zkabelac@redhat.com>
      Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      94c43b98
    • S
      usb:xhci:Add quirk for Certain failing HP keyboard on reset after resume · e788787e
      Sandeep Singh 提交于
      Certain HP keyboards would keep inputting a character automatically which
      is the wake-up key after S3 resume
      
      On some AMD platforms USB host fails to respond (by holding resume-K) to
      USB device (an HP keyboard) resume request within 1ms (TURSM) and ensures
      that resume is signaled for at least 20 ms (TDRSMDN), which is defined in
      USB 2.0 spec. The result is that the keyboard is out of function.
      
      In SNPS USB design, the host responds to the resume request only after
      system gets back to S0 and the host gets to functional after the internal
      HW restore operation that is more than 1 second after the initial resume
      request from the USB device.
      
      As a workaround for specific keyboard ID(HP Keyboards), applying port reset
      after resume when the keyboard is plugged in.
      Signed-off-by: NSandeep Singh <Sandeep.Singh@amd.com>
      Signed-off-by: NShyam Sundar S K <Shyam-sundar.S-k@amd.com>
      cc: Nehal Shah <Nehal-bakulchandra.Shah@amd.com>
      Reviewed-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e788787e
    • K
      nvme: fix directive command numd calculation · a082b426
      Kwan (Hingkwan) Huen-SSI 提交于
      The numd field of directive receive command takes number of dwords to
      transfer. This fix has the correct calculation for numd.
      Signed-off-by: NKwan (Hingkwan) Huen-SSI <kwan.huen@samsung.com>
      Reviewed-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      a082b426
    • K
      nvme: fix nvme reset command timeout handling · 634b8325
      Keith Busch 提交于
      We need to return an error if a timeout occurs on any NVMe command during
      initialization. Without this, the nvme reset work will be stuck. A timeout
      will have a negative error code, meaning we need to stop initializing
      the controller. All postitive returns mean the controller is still usable.
      
      bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196325Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Cc: Martin Peres <martin.peres@intel.com>
      [jth consolidated cleanup path ]
      Signed-off-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      634b8325
  4. 10 8月, 2017 6 次提交
    • M
      nvme-pci: fix CMB sysfs file removal in reset path · 1c78f773
      Max Gurtovoy 提交于
      Currently we create the sysfs entry even if we fail mapping
      it. In that case, the unmapping will not remove the sysfs created
      file. There is no good reason to create a sysfs entry for a non
      working CMB and show his characteristics.
      
      Fixes: f63572df ("nvme: unmap CMB and remove sysfs file in reset path")
      Signed-off-by: NMax Gurtovoy <maxg@mellanox.com>
      Reviewed-by: NStephen Bates <sbates@raithlin.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      1c78f773
    • J
      lpfc: support nvmet_fc defer_rcv callback · 50738420
      James Smart 提交于
      Currently, calls to nvmet_fc_rcv_fcp_req() always copied the
      FC-NVME cmd iu to a temporary buffer before returning, allowing
      the driver to immediately repost the buffer to the hardware.
      
      To address timing conditions on queue element structures vs async
      command reception, the nvmet_fc transport occasionally may need to
      hold on to the command iu buffer for a short period. In these cases,
      the nvmet_fc_rcv_fcp_req() will return a special return code
      (-EOVERFLOW). In these cases, the LLDD must delay until the new
      defer_rcv lldd callback is called before recycling the buffer back
      to the hw.
      
      This patch adds support for the new nvmet_fc transport defer_rcv
      callback and recognition of the new error code when passing commands
      to the transport.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      50738420
    • J
      nvmet_fc: add defer_req callback for deferment of cmd buffer return · 0fb228d3
      James Smart 提交于
      At queue creation, the transport allocates a local job struct
      (struct nvmet_fc_fcp_iod) for each possible element of the queue.
      When a new CMD is received from the wire, a jobs struct is allocated
      from the queue and then used for the duration of the command.
      The job struct contains buffer space for the wire command iu. Thus,
      upon allocation of the job struct, the cmd iu buffer is copied to
      the job struct and the LLDD may immediately free/reuse the CMD IU
      buffer passed in the call.
      
      However, in some circumstances, due to the packetized nature of FC
      and the api of the FC LLDD which may issue a hw command to send the
      wire response, but the LLDD may not get the hw completion for the
      command and upcall the nvmet_fc layer before a new command may be
      asynchronously received on the wire. In other words, its possible
      for the initiator to get the response from the wire, thus believe a
      command slot free, and send a new command iu. The new command iu
      may be received by the LLDD and passed to the transport before the
      LLDD had serviced the hw completion and made the teardown calls for
      the original job struct. As such, there is no available job struct
      available for the new io. E.g. it appears like the host sent more
      queue elements than the queue size. It didn't based on it's
      understanding.
      
      Rather than treat this as a hard connection failure queue the new
      request until the job struct does free up. As the buffer isn't
      copied as there's no job struct, a special return value must be
      returned to the LLDD to signify to hold off on recycling the cmd
      iu buffer.  And later, when a job struct is allocated and the
      buffer copied, a new LLDD callback is introduced to notify the
      LLDD and allow it to recycle it's command iu buffer.
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      0fb228d3
    • M
      nvme: strip trailing 0-bytes in wwid_show · 758f3735
      Martin Wilck 提交于
      Some broken controllers (such as earlier Linux targets) pad model or
      serial fields with 0-bytes rather than spaces. The NVMe spec disallows
      0 bytes in "ASCII" fields.  Thus strip trailing 0-bytes, too. Also make
      sure that we get no underflow for pathological input.
      Signed-off-by: NMartin Wilck <mwilck@suse.com>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      758f3735
    • G
      geneve: maximum value of VNI cannot be used · 04db70d9
      Girish Moodalbail 提交于
      Geneve's Virtual Network Identifier (VNI) is 24 bit long, so the range
      of values for it would be from 0 to 16777215 (2^24 -1).  However, one
      cannot create a geneve device with VNI set to 16777215. This patch fixes
      this issue.
      Signed-off-by: NGirish Moodalbail <girish.moodalbail@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      04db70d9
    • F
      net: systemport: Fix software statistics for SYSTEMPORT Lite · 50ddfbaf
      Florian Fainelli 提交于
      With SYSTEMPORT Lite we have holes in our statistics layout that make us
      skip over the hardware MIB counters, bcm_sysport_get_stats() was not
      taking that into account resulting in reporting 0 for all SW-maintained
      statistics, fix this by skipping accordingly.
      
      Fixes: 44a4524c ("net: systemport: Add support for SYSTEMPORT Lite")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      50ddfbaf