1. 18 12月, 2019 3 次提交
  2. 19 6月, 2019 1 次提交
  3. 06 5月, 2019 1 次提交
    • P
      mmc: core: fix possible use after free of host · 8e1943af
      Pan Bian 提交于
      In the function mmc_alloc_host, the function put_device is called to
      release allocated resources when mmc_gpio_alloc fails. Finally, the
      function pointed by host->class_dev.class->dev_release (i.e.,
      mmc_host_classdev_release) is used to release resources including the
      host structure. However, after put_device, host is used and released
      again. Resulting in a use-after-free bug.
      
      Fixes: 1ed21719 ("mmc: core: fix error path in mmc_host_alloc")
      Signed-off-by: NPan Bian <bianpan2016@163.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      8e1943af
  4. 29 4月, 2019 1 次提交
  5. 25 2月, 2019 3 次提交
  6. 11 1月, 2019 1 次提交
    • M
      mmc: core: don't override the CD GPIO level when "cd-inverted" is set · e3e4767b
      Martin Blumenstingl 提交于
      Since commit 89a5e15b ("gpio/mmc/of: Respect polarity in the device
      tree") gpiolib-of parses the "cd-gpios" property and flips the polarity
      if "cd-inverted" is also set. This results in the "cd-inverted" property
      being evaluated twice, which effectively makes it a no-op:
      - first in drivers/gpio/gpiolib-of.c (of_xlate_and_get_gpiod_flags) when
        setting up the CD GPIO
      - then again in drivers/mmc/core/slot-gpio.c (mmc_gpio_get_cd) when
        reading the CD GPIO value at runtime
      
      On boards which are using device-tree with the "cd-inverted" property
      being set any inserted card are not detected anymore. This is due to the
      MMC core treating the CD GPIO with the wrong polarity.
      
      Disable "override_cd_active_level" for the card detection GPIO which is
      parsed using mmc_of_parse. This fixes SD card detection on the boards
      which are currently using the "cd-inverted" device-tree property (tested
      on Meson8b Odroid-C1 and Meson8b EC-100).
      
      This does not remove the CD GPIO inversion logic from the MMC core
      because there's at least one driver (sdhci-pci-core for Intel BayTrail
      based boards) which still passes "override_cd_active_level = true" to
      mmc_gpiod_request_cd(). Due to lack of hardware for testing this is left
      untouched.
      In the future the GPIO inversion logic for both, card and read-only
      detection can be removed once no driver is using it anymore.
      
      Fixes: 89a5e15b ("gpio/mmc/of: Respect polarity in the device tree")
      Signed-off-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Tested-by: NAnand Moon <linux.amoon@gmail.com>
      Tested-by: NLoys Ollivier <loys.ollivier@gmail.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      e3e4767b
  7. 27 9月, 2018 1 次提交
  8. 29 5月, 2018 1 次提交
  9. 21 5月, 2018 1 次提交
    • S
      mmc: core: add tunable delay waiting for power to be stable · 6d796c68
      Shawn Lin 提交于
      The hard-coded 10ms delay in mmc_power_up came from
      commit 79bccc5a ("mmc: increase power up delay"), which said "The TI
      controller on Toshiba Tecra M5 needs more time to power up or the cards
      will init incorrectly or not at all." But it's too engineering solution
      for a special board but force all platforms to wait for that long time,
      especially painful for mmc_power_up for eMMC when booting.
      
      However, it's added since 2009, and we can't tell if other platforms
      benefit from it. But in practise, the modern hardware are most likely to
      have a stable power supply with 1ms after setting it for no matter PMIC
      or discrete power. And more importnatly, most regulators implement the
      callback of ->set_voltage_time_sel() for regulator core to wait for
      specific period of time for the power supply to be stable, which means
      once regulator_set_voltage_* return, the power should reach the the
      minimum voltage that works for initialization. Of course, if there
      are some other ways for host to power the card, we should allow them
      to argue a suitable delay as well.
      
      With this patch, we could assign the delay from firmware, or we could
      assigne it via ->set_ios() callback from host drivers.
      Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      6d796c68
  10. 03 5月, 2018 1 次提交
  11. 11 12月, 2017 2 次提交
  12. 22 11月, 2017 1 次提交
    • K
      treewide: setup_timer() -> timer_setup() · e99e88a9
      Kees Cook 提交于
      This converts all remaining cases of the old setup_timer() API into using
      timer_setup(), where the callback argument is the structure already
      holding the struct timer_list. These should have no behavioral changes,
      since they just change which pointer is passed into the callback with
      the same available pointers after conversion. It handles the following
      examples, in addition to some other variations.
      
      Casting from unsigned long:
      
          void my_callback(unsigned long data)
          {
              struct something *ptr = (struct something *)data;
          ...
          }
          ...
          setup_timer(&ptr->my_timer, my_callback, ptr);
      
      and forced object casts:
      
          void my_callback(struct something *ptr)
          {
          ...
          }
          ...
          setup_timer(&ptr->my_timer, my_callback, (unsigned long)ptr);
      
      become:
      
          void my_callback(struct timer_list *t)
          {
              struct something *ptr = from_timer(ptr, t, my_timer);
          ...
          }
          ...
          timer_setup(&ptr->my_timer, my_callback, 0);
      
      Direct function assignments:
      
          void my_callback(unsigned long data)
          {
              struct something *ptr = (struct something *)data;
          ...
          }
          ...
          ptr->my_timer.function = my_callback;
      
      have a temporary cast added, along with converting the args:
      
          void my_callback(struct timer_list *t)
          {
              struct something *ptr = from_timer(ptr, t, my_timer);
          ...
          }
          ...
          ptr->my_timer.function = (TIMER_FUNC_TYPE)my_callback;
      
      And finally, callbacks without a data assignment:
      
          void my_callback(unsigned long data)
          {
          ...
          }
          ...
          setup_timer(&ptr->my_timer, my_callback, 0);
      
      have their argument renamed to verify they're unused during conversion:
      
          void my_callback(struct timer_list *unused)
          {
          ...
          }
          ...
          timer_setup(&ptr->my_timer, my_callback, 0);
      
      The conversion is done with the following Coccinelle script:
      
      spatch --very-quiet --all-includes --include-headers \
      	-I ./arch/x86/include -I ./arch/x86/include/generated \
      	-I ./include -I ./arch/x86/include/uapi \
      	-I ./arch/x86/include/generated/uapi -I ./include/uapi \
      	-I ./include/generated/uapi --include ./include/linux/kconfig.h \
      	--dir . \
      	--cocci-file ~/src/data/timer_setup.cocci
      
      @fix_address_of@
      expression e;
      @@
      
       setup_timer(
      -&(e)
      +&e
       , ...)
      
      // Update any raw setup_timer() usages that have a NULL callback, but
      // would otherwise match change_timer_function_usage, since the latter
      // will update all function assignments done in the face of a NULL
      // function initialization in setup_timer().
      @change_timer_function_usage_NULL@
      expression _E;
      identifier _timer;
      type _cast_data;
      @@
      
      (
      -setup_timer(&_E->_timer, NULL, _E);
      +timer_setup(&_E->_timer, NULL, 0);
      |
      -setup_timer(&_E->_timer, NULL, (_cast_data)_E);
      +timer_setup(&_E->_timer, NULL, 0);
      |
      -setup_timer(&_E._timer, NULL, &_E);
      +timer_setup(&_E._timer, NULL, 0);
      |
      -setup_timer(&_E._timer, NULL, (_cast_data)&_E);
      +timer_setup(&_E._timer, NULL, 0);
      )
      
      @change_timer_function_usage@
      expression _E;
      identifier _timer;
      struct timer_list _stl;
      identifier _callback;
      type _cast_func, _cast_data;
      @@
      
      (
      -setup_timer(&_E->_timer, _callback, _E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, &_callback, _E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, _callback, (_cast_data)_E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, &_callback, (_cast_data)_E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, (_cast_func)_callback, _E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, (_cast_func)&_callback, _E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, (_cast_func)_callback, (_cast_data)_E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, (_cast_func)&_callback, (_cast_data)_E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E._timer, _callback, (_cast_data)_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, _callback, (_cast_data)&_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, &_callback, (_cast_data)_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, &_callback, (_cast_data)&_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)&_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)&_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
       _E->_timer@_stl.function = _callback;
      |
       _E->_timer@_stl.function = &_callback;
      |
       _E->_timer@_stl.function = (_cast_func)_callback;
      |
       _E->_timer@_stl.function = (_cast_func)&_callback;
      |
       _E._timer@_stl.function = _callback;
      |
       _E._timer@_stl.function = &_callback;
      |
       _E._timer@_stl.function = (_cast_func)_callback;
      |
       _E._timer@_stl.function = (_cast_func)&_callback;
      )
      
      // callback(unsigned long arg)
      @change_callback_handle_cast
       depends on change_timer_function_usage@
      identifier change_timer_function_usage._callback;
      identifier change_timer_function_usage._timer;
      type _origtype;
      identifier _origarg;
      type _handletype;
      identifier _handle;
      @@
      
       void _callback(
      -_origtype _origarg
      +struct timer_list *t
       )
       {
      (
      	... when != _origarg
      	_handletype *_handle =
      -(_handletype *)_origarg;
      +from_timer(_handle, t, _timer);
      	... when != _origarg
      |
      	... when != _origarg
      	_handletype *_handle =
      -(void *)_origarg;
      +from_timer(_handle, t, _timer);
      	... when != _origarg
      |
      	... when != _origarg
      	_handletype *_handle;
      	... when != _handle
      	_handle =
      -(_handletype *)_origarg;
      +from_timer(_handle, t, _timer);
      	... when != _origarg
      |
      	... when != _origarg
      	_handletype *_handle;
      	... when != _handle
      	_handle =
      -(void *)_origarg;
      +from_timer(_handle, t, _timer);
      	... when != _origarg
      )
       }
      
      // callback(unsigned long arg) without existing variable
      @change_callback_handle_cast_no_arg
       depends on change_timer_function_usage &&
                           !change_callback_handle_cast@
      identifier change_timer_function_usage._callback;
      identifier change_timer_function_usage._timer;
      type _origtype;
      identifier _origarg;
      type _handletype;
      @@
      
       void _callback(
      -_origtype _origarg
      +struct timer_list *t
       )
       {
      +	_handletype *_origarg = from_timer(_origarg, t, _timer);
      +
      	... when != _origarg
      -	(_handletype *)_origarg
      +	_origarg
      	... when != _origarg
       }
      
      // Avoid already converted callbacks.
      @match_callback_converted
       depends on change_timer_function_usage &&
                  !change_callback_handle_cast &&
      	    !change_callback_handle_cast_no_arg@
      identifier change_timer_function_usage._callback;
      identifier t;
      @@
      
       void _callback(struct timer_list *t)
       { ... }
      
      // callback(struct something *handle)
      @change_callback_handle_arg
       depends on change_timer_function_usage &&
      	    !match_callback_converted &&
                  !change_callback_handle_cast &&
                  !change_callback_handle_cast_no_arg@
      identifier change_timer_function_usage._callback;
      identifier change_timer_function_usage._timer;
      type _handletype;
      identifier _handle;
      @@
      
       void _callback(
      -_handletype *_handle
      +struct timer_list *t
       )
       {
      +	_handletype *_handle = from_timer(_handle, t, _timer);
      	...
       }
      
      // If change_callback_handle_arg ran on an empty function, remove
      // the added handler.
      @unchange_callback_handle_arg
       depends on change_timer_function_usage &&
      	    change_callback_handle_arg@
      identifier change_timer_function_usage._callback;
      identifier change_timer_function_usage._timer;
      type _handletype;
      identifier _handle;
      identifier t;
      @@
      
       void _callback(struct timer_list *t)
       {
      -	_handletype *_handle = from_timer(_handle, t, _timer);
       }
      
      // We only want to refactor the setup_timer() data argument if we've found
      // the matching callback. This undoes changes in change_timer_function_usage.
      @unchange_timer_function_usage
       depends on change_timer_function_usage &&
                  !change_callback_handle_cast &&
                  !change_callback_handle_cast_no_arg &&
      	    !change_callback_handle_arg@
      expression change_timer_function_usage._E;
      identifier change_timer_function_usage._timer;
      identifier change_timer_function_usage._callback;
      type change_timer_function_usage._cast_data;
      @@
      
      (
      -timer_setup(&_E->_timer, _callback, 0);
      +setup_timer(&_E->_timer, _callback, (_cast_data)_E);
      |
      -timer_setup(&_E._timer, _callback, 0);
      +setup_timer(&_E._timer, _callback, (_cast_data)&_E);
      )
      
      // If we fixed a callback from a .function assignment, fix the
      // assignment cast now.
      @change_timer_function_assignment
       depends on change_timer_function_usage &&
                  (change_callback_handle_cast ||
                   change_callback_handle_cast_no_arg ||
                   change_callback_handle_arg)@
      expression change_timer_function_usage._E;
      identifier change_timer_function_usage._timer;
      identifier change_timer_function_usage._callback;
      type _cast_func;
      typedef TIMER_FUNC_TYPE;
      @@
      
      (
       _E->_timer.function =
      -_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E->_timer.function =
      -&_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E->_timer.function =
      -(_cast_func)_callback;
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E->_timer.function =
      -(_cast_func)&_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E._timer.function =
      -_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E._timer.function =
      -&_callback;
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E._timer.function =
      -(_cast_func)_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E._timer.function =
      -(_cast_func)&_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      )
      
      // Sometimes timer functions are called directly. Replace matched args.
      @change_timer_function_calls
       depends on change_timer_function_usage &&
                  (change_callback_handle_cast ||
                   change_callback_handle_cast_no_arg ||
                   change_callback_handle_arg)@
      expression _E;
      identifier change_timer_function_usage._timer;
      identifier change_timer_function_usage._callback;
      type _cast_data;
      @@
      
       _callback(
      (
      -(_cast_data)_E
      +&_E->_timer
      |
      -(_cast_data)&_E
      +&_E._timer
      |
      -_E
      +&_E->_timer
      )
       )
      
      // If a timer has been configured without a data argument, it can be
      // converted without regard to the callback argument, since it is unused.
      @match_timer_function_unused_data@
      expression _E;
      identifier _timer;
      identifier _callback;
      @@
      
      (
      -setup_timer(&_E->_timer, _callback, 0);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, _callback, 0L);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, _callback, 0UL);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E._timer, _callback, 0);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, _callback, 0L);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, _callback, 0UL);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_timer, _callback, 0);
      +timer_setup(&_timer, _callback, 0);
      |
      -setup_timer(&_timer, _callback, 0L);
      +timer_setup(&_timer, _callback, 0);
      |
      -setup_timer(&_timer, _callback, 0UL);
      +timer_setup(&_timer, _callback, 0);
      |
      -setup_timer(_timer, _callback, 0);
      +timer_setup(_timer, _callback, 0);
      |
      -setup_timer(_timer, _callback, 0L);
      +timer_setup(_timer, _callback, 0);
      |
      -setup_timer(_timer, _callback, 0UL);
      +timer_setup(_timer, _callback, 0);
      )
      
      @change_callback_unused_data
       depends on match_timer_function_unused_data@
      identifier match_timer_function_unused_data._callback;
      type _origtype;
      identifier _origarg;
      @@
      
       void _callback(
      -_origtype _origarg
      +struct timer_list *unused
       )
       {
      	... when != _origarg
       }
      Signed-off-by: NKees Cook <keescook@chromium.org>
      e99e88a9
  13. 30 10月, 2017 2 次提交
  14. 30 8月, 2017 1 次提交
  15. 20 6月, 2017 2 次提交
    • D
      mmc: core: Use device_property_read instead of of_property_read · 73a47a9b
      David Woods 提交于
      Using the device_property interfaces allows mmc drivers to work
      on platforms which run on either device tree or ACPI.
      Signed-off-by: NDavid Woods <dwoods@mellanox.com>
      Reviewed-by: NChris Metcalf <cmetcalf@mellanox.com>
      Cc: stable@vger.linux.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      73a47a9b
    • U
      mmc: sdio: Add API to manage SDIO IRQs from a workqueue · 68269660
      Ulf Hansson 提交于
      For hosts not supporting MMC_CAP2_SDIO_IRQ_NOTHREAD but MMC_CAP_SDIO_IRQ,
      the SDIO IRQs are processed from a dedicated kernel thread. For these
      cases, the host calls mmc_signal_sdio_irq() from its ISR to signal a new
      SDIO IRQ.
      
      Signaling an SDIO IRQ makes the host's ->enable_sdio_irq() callback to be
      invoked to temporary disable the IRQs, before the kernel thread is woken up
      to process it. When processing of the IRQs are completed, they are
      re-enabled by the kernel thread, again via invoking the host's
      ->enable_sdio_irq().
      
      The observation from this, is that the execution path is being unnecessary
      complex, as the host driver already knows that it needs to temporary
      disable the IRQs before signaling a new one. Moreover, replacing the kernel
      thread with a work/workqueue would not only greatly simplify the code, but
      also make it more robust.
      
      To address the above problems, let's continue to build upon the support for
      MMC_CAP2_SDIO_IRQ_NOTHREAD, as it already implements SDIO IRQs to be
      processed without using the clumsy kernel thread and without the ping-pong
      calls of the host's ->enable_sdio_irq() callback for each processed IRQ.
      
      Therefore, let's add new API sdio_signal_irq(), which enables hosts to
      signal/process SDIO IRQs by using a work/workqueue, rather than using the
      kernel thread.
      
      Add also a new host callback ->ack_sdio_irq(), which the work invokes when
      the SDIO IRQs have been processed. This informs the host about when it
      shall re-enable the SDIO IRQs. Potentially, we could re-use the existing
      ->enable_sdio_irq() callback instead of adding a new one, however it has
      turned out that it's more convenient for hosts to get this information via
      a separate callback.
      
      Hosts that wants to use this new method to signal/process SDIO IRQs, must
      enable MMC_CAP2_SDIO_IRQ_NOTHREAD and implement the ->ack_sdio_irq()
      callback.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NDouglas Anderson <dianders@chromium.org>
      68269660
  16. 13 2月, 2017 3 次提交
  17. 25 7月, 2016 2 次提交
  18. 17 5月, 2016 1 次提交
    • A
      mmc: core: Add a facility to "pause" re-tuning · 7ff27609
      Adrian Hunter 提交于
      Re-tuning is not possible when switched to the RPMB
      partition.  However re-tuning should not be needed
      if re-tuning is done immediately before switching,
      a small set of operations is done, and then we
      immediately switch back to the main partition.
      
      To ensure that re-tuning can't be done for a short
      while, add a facility to "pause" re-tuning.
      
      The existing facility to hold / release re-tuning
      is used but it also flags re-tuning as needed to cause
      re-tuning before the next command (which will be the
      switch to RPMB).
      
      We also need to "unpause" in the recovery path, which
      is catered for by adding it to mmc_retune_disable().
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      7ff27609
  19. 02 5月, 2016 1 次提交
  20. 05 4月, 2016 1 次提交
    • K
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov 提交于
      PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
      ago with promise that one day it will be possible to implement page
      cache with bigger chunks than PAGE_SIZE.
      
      This promise never materialized.  And unlikely will.
      
      We have many places where PAGE_CACHE_SIZE assumed to be equal to
      PAGE_SIZE.  And it's constant source of confusion on whether
      PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
      especially on the border between fs and mm.
      
      Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
      breakage to be doable.
      
      Let's stop pretending that pages in page cache are special.  They are
      not.
      
      The changes are pretty straight-forward:
      
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
      
       - page_cache_get() -> get_page();
      
       - page_cache_release() -> put_page();
      
      This patch contains automated changes generated with coccinelle using
      script below.  For some reason, coccinelle doesn't patch header files.
      I've called spatch for them manually.
      
      The only adjustment after coccinelle is revert of changes to
      PAGE_CAHCE_ALIGN definition: we are going to drop it later.
      
      There are few places in the code where coccinelle didn't reach.  I'll
      fix them manually in a separate patch.  Comments and documentation also
      will be addressed with the separate patch.
      
      virtual patch
      
      @@
      expression E;
      @@
      - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      expression E;
      @@
      - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      @@
      - PAGE_CACHE_SHIFT
      + PAGE_SHIFT
      
      @@
      @@
      - PAGE_CACHE_SIZE
      + PAGE_SIZE
      
      @@
      @@
      - PAGE_CACHE_MASK
      + PAGE_MASK
      
      @@
      expression E;
      @@
      - PAGE_CACHE_ALIGN(E)
      + PAGE_ALIGN(E)
      
      @@
      expression E;
      @@
      - page_cache_get(E)
      + get_page(E)
      
      @@
      expression E;
      @@
      - page_cache_release(E)
      + put_page(E)
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      09cbfeaf
  21. 29 2月, 2016 1 次提交
  22. 22 12月, 2015 2 次提交
  23. 27 10月, 2015 1 次提交
  24. 26 10月, 2015 1 次提交
    • U
      mmc: core: Remove MMC_CLKGATE · 9eadcc05
      Ulf Hansson 提交于
      MMC_CLKGATE was once invented to save power by gating the bus clock at
      request inactivity. At that time it served its purpose. The modern way to
      deal with power saving for these scenarios, is by using runtime PM.
      
      Nowadays, several host drivers have deployed runtime PM, but for those
      that haven't and which still cares power saving at request inactivity,
      it's certainly time to deploy runtime PM as it has been around for several
      years now.
      
      To simplify code to mmc core and thus decrease maintenance efforts, this
      patch removes all code related to MMC_CLKGATE.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      9eadcc05
  25. 29 9月, 2015 1 次提交
  26. 27 8月, 2015 1 次提交
  27. 01 6月, 2015 3 次提交
    • L
      mmc: dt: Allow to specify that no write protect signal is present · 19f44246
      Lars-Peter Clausen 提交于
      Allow to specify in the device-tree that no physical write-protect signal
      is connected to a particular instance of a MMC controller. Setting the
      property will cause the core will assume that the SD card is always
      read-write.
      
      The name for the new property is 'disable-wp' and was chosen based on the
      property with the same function from the Synopsys designware mobile storage
      host controller DT bindings specification.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
      Cc: Kumar Gala <galak@codeaurora.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      19f44246
    • A
      mmc: core: Add support for HS400 re-tuning · 6376f69d
      Adrian Hunter 提交于
      HS400 re-tuning must be done in HS200 mode. Add
      the ability to switch from HS400 mode to HS200
      mode before re-tuning and switch back to HS400
      after re-tuning.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      6376f69d
    • A
      mmc: host: Add facility to support re-tuning · dfa13ebb
      Adrian Hunter 提交于
      Currently, there is core support for tuning during
      initialization. There can also be a need to re-tune
      periodically (e.g. sdhci) or to re-tune after the
      host controller is powered off (e.g. after PM
      runtime suspend / resume) or to re-tune in response
      to CRC errors.
      
      The main requirements for re-tuning are:
        - ability to enable / disable re-tuning
        - ability to flag that re-tuning is needed
        - ability to re-tune before any request
        - ability to hold off re-tuning if the card is busy
        - ability to hold off re-tuning if re-tuning is in
        progress
        - ability to run a re-tuning timer
      
      To support those requirements 7 members are added to struct
      mmc_host:
      
        unsigned int		can_retune:1;	/* re-tuning can be used */
        unsigned int		doing_retune:1;	/* re-tuning in progress */
        unsigned int		retune_now:1;   /* do re-tuning at next req */
        int			need_retune;	/* re-tuning is needed */
        int			hold_retune;	/* hold off re-tuning */
        unsigned int		retune_period;  /* re-tuning period in secs */
        struct timer_list	retune_timer;	/* for periodic re-tuning */
      
      need_retune is an integer so it can be set without needing
      synchronization. hold_retune is a integer to allow nesting.
      
      Various simple functions are provided to set / clear those
      variables.
      
      Subsequent patches take those functions into use.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      dfa13ebb