1. 04 10月, 2017 3 次提交
    • J
      mmc: meson-gx: fix rx phase reset · 3e2b0af4
      Jerome Brunet 提交于
      Resetting the phase when POWER_ON is set the set_ios() call means that the
      phase is reset almost every time the set_ios() is called, while the
      expected behavior was to reset the phase on a power cycle.
      
      This had gone unnoticed until now because in all mode (except hs400) the
      tuning is done after the last to set_ios(). In such case, the tuning
      result is used anyway.  In HS400, there are a few calls to set_ios() after
      the tuning is done, overwriting the tuning result.
      
      Resetting the phase on POWER_UP instead of POWER_ON solve the problem.
      
      Fixes: d341ca88 ("mmc: meson-gx: rework tuning function")
      Signed-off-by: NJerome Brunet <jbrunet@baylibre.com>
      Reviewed-by: NKevin Hilman <khilman@baylibre.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      3e2b0af4
    • J
      mmc: meson-gx: make sure the clock is rounded down · ca3dcd3f
      Jerome Brunet 提交于
      Using CLK_DIVIDER_ROUND_CLOSEST is unsafe as the mmc clock could be
      rounded to a rate higher the specified rate. Removing this flag ensure
      that, if the rate needs to be rounded, it will be rounded down.
      
      Fixes: 51c5d844 ("MMC: meson: initial support for GX platforms")
      Signed-off-by: NJerome Brunet <jbrunet@baylibre.com>
      Reviewed-by: NKevin Hilman <khilman@baylibre.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      ca3dcd3f
    • L
      mmc: Delete bounce buffer handling · de3ee99b
      Linus Walleij 提交于
      In may, Steven sent a patch deleting the bounce buffer handling
      and the CONFIG_MMC_BLOCK_BOUNCE option.
      
      I chose the less invasive path of making it a runtime config
      option, and we merged that successfully for kernel v4.12.
      
      The code is however just standing in the way and taking up
      space for seemingly no gain on any systems in wide use today.
      
      Pierre says the code was there to improve speed on TI SDHCI
      controllers on certain HP laptops and possibly some Ricoh
      controllers as well. Early SDHCI controllers lacked the
      scatter-gather feature, which made software bounce buffers
      a significant speed boost.
      
      We are clearly talking about the list of SDHCI PCI-based
      MMC/SD card readers found in the pci_ids[] list in
      drivers/mmc/host/sdhci-pci-core.c.
      
      The TI SDHCI derivative is not supported by the upstream
      kernel. This leaves the Ricoh.
      
      What we can however notice is that the x86 defconfigs in the
      kernel did not enable CONFIG_MMC_BLOCK_BOUNCE option, which
      means that any such laptop would have to have a custom
      configured kernel to actually take advantage of this
      bounce buffer speed-up. It simply seems like there was
      a speed optimization for the Ricoh controllers that noone
      was using. (I have not checked the distro defconfigs but
      I am pretty sure the situation is the same there.)
      
      Bounce buffers increased performance on the OMAP HSMMC
      at one point, and was part of the original submission in
      commit a45c6cb8 ("[ARM] 5369/1: omap mmc: Add new
         omap hsmmc controller for 2430 and 34xx, v3")
      
      This optimization was removed in
      commit 0ccd76d4 ("omap_hsmmc: Implement scatter-gather
         emulation")
      which found that scatter-gather emulation provided even
      better performance.
      
      The same was introduced for SDHCI in
      commit 2134a922 ("sdhci: scatter-gather (ADMA) support")
      
      I am pretty positively convinced that software
      scatter-gather emulation will do for any host controller what
      the bounce buffers were doing. Essentially, the bounce buffer
      was a reimplementation of software scatter-gather-emulation in
      the MMC subsystem, and it should be done away with.
      
      Cc: Pierre Ossman <pierre@ossman.eu>
      Cc: Juha Yrjola <juha.yrjola@solidboot.com>
      Cc: Steven J. Hill <Steven.Hill@cavium.com>
      Cc: Shawn Lin <shawn.lin@rock-chips.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Suggested-by: NSteven J. Hill <Steven.Hill@cavium.com>
      Suggested-by: NShawn Lin <shawn.lin@rock-chips.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      de3ee99b
  2. 02 10月, 2017 1 次提交
  3. 22 9月, 2017 2 次提交
  4. 08 9月, 2017 3 次提交
    • J
      mmc: cavium: Fix use-after-free in of_platform_device_destroy · b917c6d1
      Jan Glauber 提交于
      KASAN reported the following:
      
      [   19.338655] ==================================================================
      [   19.345946] BUG: KASAN: use-after-free in of_platform_device_destroy+0x88/0x100
      [   19.345966] Read of size 8 at addr fffffe01aa6f1468 by task systemd-udevd/264
      
      [   19.345983] CPU: 1 PID: 264 Comm: systemd-udevd Not tainted 4.13.0-jang+ #737
      [   19.345989] Hardware name: Cavium ThunderX CN81XX board (DT)
      [   19.345995] Call trace:
      [   19.346013] [<fffffc800808b1b0>] dump_backtrace+0x0/0x368
      [   19.346026] [<fffffc800808b6bc>] show_stack+0x24/0x30
      [   19.346040] [<fffffc8008cbb944>] dump_stack+0xa4/0xc8
      [   19.346057] [<fffffc80082c2870>] print_address_description+0x68/0x258
      [   19.346070] [<fffffc80082c2d70>] kasan_report+0x238/0x2f8
      [   19.346082] [<fffffc80082c14a8>] __asan_load8+0x88/0xb8
      [   19.346098] [<fffffc8008aacee0>] of_platform_device_destroy+0x88/0x100
      [   19.346131] [<fffffc8000e02fa4>] thunder_mmc_probe+0x314/0x550 [thunderx_mmc]
      [   19.346147] [<fffffc800879d560>] pci_device_probe+0x158/0x1f8
      [   19.346162] [<fffffc800886e53c>] driver_probe_device+0x394/0x5f8
      [   19.346174] [<fffffc800886e8f4>] __driver_attach+0x154/0x158
      [   19.346185] [<fffffc800886b12c>] bus_for_each_dev+0xdc/0x140
      [   19.346196] [<fffffc800886d9f8>] driver_attach+0x38/0x48
      [   19.346207] [<fffffc800886d148>] bus_add_driver+0x290/0x3c8
      [   19.346219] [<fffffc800886fc5c>] driver_register+0xbc/0x1a0
      [   19.346232] [<fffffc800879b78c>] __pci_register_driver+0xc4/0xd8
      [   19.346260] [<fffffc8000e80024>] thunder_mmc_driver_init+0x24/0x10000 [thunderx_mmc]
      [   19.346273] [<fffffc8008083a80>] do_one_initcall+0x98/0x1c0
      [   19.346289] [<fffffc8008177b54>] do_init_module+0xe0/0x2cc
      [   19.346303] [<fffffc8008175cf0>] load_module+0x3238/0x35c0
      [   19.346318] [<fffffc8008176438>] SyS_finit_module+0x190/0x1a0
      [   19.346329] [<fffffc80080834a0>] __sys_trace_return+0x0/0x4
      
      This is caused by:
      
        platform_device_register()
         -> platform_device_unregister(to_platform_device(dev))
      	freeing struct device
         -> of_node_clear_flag(dev->of_node, ...)
      	writing to the freed device
      
      The issue is solved by increasing the reference count before calling
      of_platform_device_destroy() so freeing the device is postponed after
      the call.
      
      Fixes: 8fb83b14 ("mmc: cavium: Fix probing race with regulator")
      Signed-off-by: NJan Glauber <jglauber@cavium.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      b917c6d1
    • W
      mmc: host: fix typo after MMC_DEBUG move · b4f146f5
      Wolfram Sang 提交于
      MMC_DEBUG was moved and one letter got strangely capitalized.
      Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      b4f146f5
    • A
      mmc: block: Fix incorrectly initialized requests · 01f5bbd1
      Adrian Hunter 提交于
      mmc_init_request() depends on card->bouncesz so it must be calculated
      before blk_init_allocated_queue() starts allocating requests.
      Reported-by: NSeraphime Kirkovski <kirkseraph@gmail.com>
      Fixes: 304419d8 ("mmc: core: Allocate per-request data using the..")
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: NSeraphime Kirkovski <kirkseraph@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: NPavel Machek <pavel@ucw.cz>
      01f5bbd1
  5. 01 9月, 2017 1 次提交
  6. 31 8月, 2017 1 次提交
  7. 30 8月, 2017 29 次提交