1. 08 8月, 2017 1 次提交
  2. 06 8月, 2017 1 次提交
  3. 04 8月, 2017 1 次提交
  4. 03 8月, 2017 6 次提交
    • S
      mmc: block: bypass the queue even if usage is present for hotplug · 7c84b8b4
      Shawn Lin 提交于
      The commit 304419d8 ("mmc: core: Allocate per-request data using the
      block layer core") refactored mechanism of queue handling caused
      mmc_init_request() can be called just after mmc_cleanup_queue() caused null
      pointer dereference.
      
      Another commit bbdc74dc ("mmc: block: Prevent new req entering queue
      after its cleanup") tried to fix the problem. However it actually miss one
      corner case.
      
      We could still reproduce the issue mentioned with these steps:
      (1) insert a SD card and mount it
      (2) hotplug it, so it will leave md->usage still be counted
      (3) reboot the system which will sync data and umount the card
      
      [Unable to handle kernel NULL pointer dereference at virtual address
      00000000
      [user pgtable: 4k pages, 48-bit VAs, pgd = ffff80007bab3000
      [[0000000000000000] *pgd=000000007a828003, *pud=0000000078dce003,
      *pmd=000000007aab6003, *pte=0000000000000000
      [Internal error: Oops: 96000007 [#1] PREEMPT SMP
      [Modules linked in:
      [CPU: 3 PID: 3507 Comm: umount Tainted: G        W
      4.13.0-rc1-next-20170720-00012-g9d9bf45 #33
      [Hardware name: Firefly-RK3399 Board (DT)
      [task: ffff80007a1de200 task.stack: ffff80007a01c000
      [PC is at mmc_init_request+0x14/0xc4
      [LR is at alloc_request_size+0x4c/0x74
      [pc : [<ffff0000087d7150>] lr : [<ffff000008378fe0>] pstate: 600001c5
      [sp : ffff80007a01f8f0
      
      ....
      
      [[<ffff0000087d7150>] mmc_init_request+0x14/0xc4
      [[<ffff000008378fe0>] alloc_request_size+0x4c/0x74
      [[<ffff00000817ac28>] mempool_create_node+0xb8/0x17c
      [[<ffff00000837aadc>] blk_init_rl+0x9c/0x120
      [[<ffff000008396580>] blkg_alloc+0x110/0x234
      [[<ffff000008396ac8>] blkg_create+0x424/0x468
      [[<ffff00000839877c>] blkg_lookup_create+0xd8/0x14c
      [[<ffff0000083796bc>] generic_make_request_checks+0x368/0x3b0
      [[<ffff00000837b050>] generic_make_request+0x1c/0x240
      
      So mmc_blk_put wouldn't calling blk_cleanup_queue which actually the
      QUEUE_FLAG_DYING and QUEUE_FLAG_BYPASS should stay. Block core expect
      blk_queue_bypass_{start, end} internally to bypass/drain the queue before
      actually dying the queue, so it didn't expose API to set the queue bypass.
      I think we should set QUEUE_FLAG_BYPASS whenever queue is removed, although
      the md->usage is still counted, as no dispatch queue could be found then.
      
      Fixes: 304419d8 ("mmc: core: Allocate per-request data using the block layer core")
      Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      7c84b8b4
    • L
      mmc: sdhci-of-at91: force card detect value for non removable devices · 7a1e3f14
      Ludovic Desroches 提交于
      When the device is non removable, the card detect signal is often used
      for another purpose i.e. muxed to another SoC peripheral or used as a
      GPIO. It could lead to wrong behaviors depending the default value of
      this signal if not muxed to the SDHCI controller.
      
      Fixes: bb5f8ea4 ("mmc: sdhci-of-at91: introduce driver for the Atmel SDMMC")
      Signed-off-by: NLudovic Desroches <ludovic.desroches@microchip.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      7a1e3f14
    • A
      isdn/i4l: fix buffer overflow · 9f5af546
      Annie Cherkaev 提交于
      This fixes a potential buffer overflow in isdn_net.c caused by an
      unbounded strcpy.
      
      [ ISDN seems to be effectively unmaintained, and the I4L driver in
        particular is long deprecated, but in case somebody uses this..
          - Linus ]
      Signed-off-by: NJiten Thakkar <jitenmt@gmail.com>
      Signed-off-by: NAnnie Cherkaev <annie.cherk@gmail.com>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9f5af546
    • T
      clk: keystone: sci-clk: Fix sci_clk_get · f54d2cd3
      Tero Kristo 提交于
      Currently a bug in the sci_clk_get implementation causes it to always
      return a clock belonging to the last device in the static list of clock
      data. This is due to a bug in the init code that causes the array
      used by sci_clk_get to only be populated with the clocks for the last
      device, as each device overwrites the entire array with its own clocks.
      
      Fix this by calculating the actual number of clocks for the SoC, and
      allocating the whole array in one go. Also, we don't need the handle
      to the init data array anymore after doing this, instead we can
      just compare the dev_id / clk_id against the registered clocks and
      use binary search for speed.
      Signed-off-by: NTero Kristo <t-kristo@ti.com>
      Reported-by: NDave Gerlach <d-gerlach@ti.com>
      Fixes: b745c079 ("clk: keystone: Add sci-clk driver support")
      Cc: Nishanth Menon <nm@ti.com>
      Tested-by: NFranklin Cooper <fcooper@ti.com>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      f54d2cd3
    • F
      drm/amdgpu: Use list_del_init in amdgpu_mn_unregister · 68c9793d
      Felix Kuehling 提交于
      Otherwise bo->shadow_list (which is aliased by bo->mn_list) will not
      appear empty in amdgpu_ttm_bo_destroy and cause an oops when freeing
      former userptr BOs.
      Signed-off-by: NFelix Kuehling <Felix.Kuehling@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      68c9793d
    • J
      drm/amdgpu: Fix undue fallthroughs in golden registers initialization · 5694785c
      Jean Delvare 提交于
      As I was staring at the si_init_golden_registers code, I noticed that
      the Pitcairn initialization silently falls through the Cape Verde
      initialization, and the Oland initialization falls through the Hainan
      initialization. However there is no comment stating that this is
      intentional, and the radeon driver doesn't have any such fallthrough,
      so I suspect this is not supposed to happen.
      Signed-off-by: NJean Delvare <jdelvare@suse.de>
      Fixes: 62a37553 ("drm/amdgpu: add si implementation v10")
      Cc: Ken Wang <Qingqing.Wang@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Marek Olšák" <maraeo@gmail.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: Flora Cui <Flora.Cui@amd.com>
      Reviewed-by: NMarek Olšák <marek.olsak@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      5694785c
  5. 02 8月, 2017 2 次提交
  6. 01 8月, 2017 14 次提交
  7. 31 7月, 2017 4 次提交
  8. 30 7月, 2017 5 次提交
  9. 28 7月, 2017 6 次提交
    • J
      lightnvm: pblk: advance bio according to lba index · 75cb8e93
      Javier González 提交于
      When a lba either hits the cache or corresponds to an empty entry in the
      L2P table, we need to advance the bio according to the position in which
      the lba is located. Otherwise, we will copy data in the wrong page, thus
      causing data corruption for the application.
      
      In case of a cache hit, we assumed that bio->bi_iter.bi_idx would
      contain the correct index, but this is no necessarily true. Instead, use
      the local bio advance counter and iterator. This guarantees that lbas
      hitting the cache are copied into the right bv_page.
      
      In case of an empty L2P entry, we omitted to advance the bio. In the
      cases when the same I/O also contains a cache hit, data corresponding
      to this lba will be copied to the wrong bv_page. Fix this by advancing
      the bio as we do in the case of a cache hit.
      
      Fixes: a4bd217b lightnvm: physical block device (pblk) target
      Signed-off-by: NJavier González <javier@javigon.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      75cb8e93
    • A
      phy: bcm-ns-usb3: fix MDIO_BUS dependency · 245db3c3
      Arnd Bergmann 提交于
      The driver attempts to 'select MDIO_DEVICE', but the code
      is actually a loadable module when PHYLIB=m:
      
      drivers/phy/broadcom/phy-bcm-ns-usb3.o: In function `bcm_ns_usb3_mdiodev_phy_write':
      phy-bcm-ns-usb3.c:(.text.bcm_ns_usb3_mdiodev_phy_write+0x28): undefined reference to `mdiobus_write'
      drivers/phy/broadcom/phy-bcm-ns-usb3.o: In function `bcm_ns_usb3_module_exit':
      phy-bcm-ns-usb3.c:(.exit.text+0x18): undefined reference to `mdio_driver_unregister'
      drivers/phy/broadcom/phy-bcm-ns-usb3.o: In function `bcm_ns_usb3_module_init':
      phy-bcm-ns-usb3.c:(.init.text+0x18): undefined reference to `mdio_driver_register'
      phy-bcm-ns-usb3.c:(.init.text+0x38): undefined reference to `mdio_driver_unregister'
      
      Using 'depends on MDIO_BUS' instead will avoid the link error.
      
      Fixes: af850e14 ("phy: bcm-ns-usb3: add MDIO driver using proper bus layer")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      245db3c3
    • A
      net: phy: rework Kconfig settings for MDIO_BUS · 4c3464a8
      Arnd Bergmann 提交于
      I still see build errors in randconfig builds and have had this
      patch for a while to locally work around it:
      
      drivers/built-in.o: In function `xgene_mdio_probe':
      mux-core.c:(.text+0x352154): undefined reference to `of_mdiobus_register'
      mux-core.c:(.text+0x352168): undefined reference to `mdiobus_free'
      mux-core.c:(.text+0x3521c0): undefined reference to `mdiobus_alloc_size'
      
      The idea is that CONFIG_MDIO_BUS now reflects whether the mdio_bus
      code is built-in or a module, and other drivers that use the core
      code can simply depend on that, instead of having a complex
      dependency line.
      
      Fixes: 90eff909 ("net: phy: Allow splitting MDIO bus/device support from PHYs")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4c3464a8
    • R
      cpufreq: intel_pstate: Drop ->get from intel_pstate structure · 22baebd4
      Rafael J. Wysocki 提交于
      The ->get callback in the intel_pstate structure was mostly there
      for the scaling_cur_freq sysfs attribute to work, but after commit
      f8475cef (x86: use common aperfmperf_khz_on_cpu() to calculate
      KHz using APERF/MPERF) that attribute uses arch_freq_get_on_cpu()
      provided by the x86 arch code on all processors supported by
      intel_pstate, so it doesn't need the ->get callback from the
      driver any more.
      
      Moreover, the very presence of the ->get callback in the intel_pstate
      structure causes the cpuinfo_cur_freq attribute to be present when
      intel_pstate operates in the active mode, which is bogus, because
      the role of that attribute is to return the current CPU frequency
      as seen by the hardware.  For intel_pstate, though, this is just an
      average frequency and not really current, but computed for the
      previous sampling interval (the actual current frequency may be
      way different at the point this value is obtained by reading from
      cpuinfo_cur_freq), and after commit 82b4e03e (intel_pstate: skip
      scheduler hook when in "performance" mode) the value in
      cpuinfo_cur_freq may be stale or just 0, depending on the driver's
      operation mode.  In fact, however, on the hardware supported by
      intel_pstate there is no way to read the current CPU frequency
      from it, so the cpuinfo_cur_freq attribute should not be present
      at all when this driver is in use.
      
      For this reason, drop intel_pstate_get() and clear the ->get
      callback pointer pointing to it, so that the cpuinfo_cur_freq is
      not present for intel_pstate in the active mode any more.
      
      Fixes: 82b4e03e (intel_pstate: skip scheduler hook when in "performance" mode)
      Reported-by: NHuaisheng Ye <yehs1@lenovo.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      22baebd4
    • M
      drm/i915: Fix bad comparison in skl_compute_plane_wm. · e9ba4032
      Maarten Lankhorst 提交于
      ddb_allocation && ddb_allocation / blocks_per_line >= 1 is the same
      as ddb_allocation >= blocks_per_line, so use the latter to simplify
      this.
      
      This fixes the following compiler warning:
      
      drivers/gpu/drm/i915/intel_pm.c:4467]: (warning) Comparison of a
      boolean expression with an integer other than 0 or 1.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Fixes: d555cb58 ("drm/i915/skl+: use linetime latency if ddb size is not available")
      Cc: "Mahesh Kumar" <mahesh1.kumar@intel.com>
      Reported-by: NDavid Binderman <dcb314@hotmail.com>
      Cc: David Binderman <dcb314@hotmail.com>
      Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.13-rc1+
      Reviewed-by: NMahesh Kumar <mahesh1.kumar@intel.com>
      (cherry picked from commit 54d20ed1)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170717111355.4523-1-maarten.lankhorst@linux.intel.comSigned-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      e9ba4032
    • C
      drm/i915: Force CPU synchronisation even if userspace requests ASYNC · 7b98da66
      Chris Wilson 提交于
      The goal here was to minimise doing any thing or any check inside the
      kernel that was not strictly required. For a userspace that assumes
      complete control over the cache domains, the kernel is usually using
      outdated information and may trigger clflushes where none were
      required.
      
      However, swapping is a situation where userspace has no knowledge of the
      domain transfer, and will leave the object in the CPU cache. The kernel
      must flush this out to the backing storage prior to use with the GPU. As
      we use an asynchronous task tracked by an implicit fence for this, we
      also need to cancel the ASYNC flag on the object so that the object will
      wait for the clflush to complete before being executed. This also absolves
      userspace of the responsibility imposed by commit 77ae9957 ("drm/i915:
      Enable userspace to opt-out of implicit fencing") that its needed to ensure
      that the object was out of the CPU cache prior to use on the GPU.
      
      Fixes: 77ae9957 ("drm/i915: Enable userspace to opt-out of implicit fencing")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101571Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: NJason Ekstrand <jason@jlekstrand.net>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170721145037.25105-5-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      (cherry picked from commit 0f46daa1)
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7b98da66