]> Git Repo - linux.git/commitdiff
Merge tag 'pm+acpi-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <[email protected]>
Thu, 11 Dec 2014 05:17:00 +0000 (21:17 -0800)
committerLinus Torvalds <[email protected]>
Thu, 11 Dec 2014 05:17:00 +0000 (21:17 -0800)
Pull ACPI and power management updates from Rafael Wysocki:
 "This time we have some more new material than we used to have during
  the last couple of development cycles.

  The most important part of it to me is the introduction of a unified
  interface for accessing device properties provided by platform
  firmware.  It works with Device Trees and ACPI in a uniform way and
  drivers using it need not worry about where the properties come from
  as long as the platform firmware (either DT or ACPI) makes them
  available.  It covers both devices and "bare" device node objects
  without struct device representation as that turns out to be necessary
  in some cases.  This has been in the works for quite a few months (and
  development cycles) and has been approved by all of the relevant
  maintainers.

  On top of that, some drivers are switched over to the new interface
  (at25, leds-gpio, gpio_keys_polled) and some additional changes are
  made to the core GPIO subsystem to allow device drivers to manipulate
  GPIOs in the "canonical" way on platforms that provide GPIO
  information in their ACPI tables, but don't assign names to GPIO lines
  (in which case the driver needs to do that on the basis of what it
  knows about the device in question).  That also has been approved by
  the GPIO core maintainers and the rfkill driver is now going to use
  it.

  Second is support for hardware P-states in the intel_pstate driver.
  It uses CPUID to detect whether or not the feature is supported by the
  processor in which case it will be enabled by default.  However, it
  can be disabled entirely from the kernel command line if necessary.

  Next is support for a platform firmware interface based on ACPI
  operation regions used by the PMIC (Power Management Integrated
  Circuit) chips on the Intel Baytrail-T and Baytrail-T-CR platforms.
  That interface is used for manipulating power resources and for
  thermal management: sensor temperature reporting, trip point setting
  and so on.

  Also the ACPI core is now going to support the _DEP configuration
  information in a limited way.  Basically, _DEP it supposed to reflect
  off-the-hierarchy dependencies between devices which may be very
  indirect, like when AML for one device accesses locations in an
  operation region handled by another device's driver (usually, the
  device depended on this way is a serial bus or GPIO controller).  The
  support added this time is sufficient to make the ACPI battery driver
  work on Asus T100A, but it is general enough to be able to cover some
  other use cases in the future.

  Finally, we have a new cpufreq driver for the Loongson1B processor.

  In addition to the above, there are fixes and cleanups all over the
  place as usual and a traditional ACPICA update to a recent upstream
  release.

  As far as the fixes go, the ACPI LPSS (Low-power Subsystem) driver for
  Intel platforms should be able to handle power management of the DMA
  engine correctly, the cpufreq-dt driver should interact with the
  thermal subsystem in a better way and the ACPI backlight driver should
  handle some more corner cases, among other things.

  On top of the ACPICA update there are fixes for race conditions in the
  ACPICA's interrupt handling code which might lead to some random and
  strange looking failures on some systems.

  In the cleanups department the most visible part is the series of
  commits targeted at getting rid of the CONFIG_PM_RUNTIME configuration
  option.  That was triggered by a discussion regarding the generic
  power domains code during which we realized that trying to support
  certain combinations of PM config options was painful and not really
  worth it, because nobody would use them in production anyway.  For
  this reason, we decided to make CONFIG_PM_SLEEP select
  CONFIG_PM_RUNTIME and that lead to the conclusion that the latter
  became redundant and CONFIG_PM could be used instead of it.  The
  material here makes that replacement in a major part of the tree, but
  there will be at least one more batch of that in the second part of
  the merge window.

  Specifics:

   - Support for retrieving device properties information from ACPI _DSD
     device configuration objects and a unified device properties
     interface for device drivers (and subsystems) on top of that.  As
     stated above, this works with Device Trees and ACPI and allows
     device drivers to be written in a platform firmware (DT or ACPI)
     agnostic way.  The at25, leds-gpio and gpio_keys_polled drivers are
     now going to use this new interface and the GPIO subsystem is
     additionally modified to allow device drivers to assign names to
     GPIO resources returned by ACPI _CRS objects (in case _DSD is not
     present or does not provide the expected data).  The changes in
     this set are mostly from Mika Westerberg, Rafael J Wysocki, Aaron
     Lu, and Darren Hart with some fixes from others (Fabio Estevam,
     Geert Uytterhoeven).

   - Support for Hardware Managed Performance States (HWP) as described
     in Volume 3, section 14.4, of the Intel SDM in the intel_pstate
     driver.  CPUID is used to detect whether or not the feature is
     supported by the processor.  If supported, it will be enabled
     automatically unless the intel_pstate=no_hwp switch is present in
     the kernel command line.  From Dirk Brandewie.

   - New Intel Broadwell-H ID for intel_pstate (Dirk Brandewie).

   - Support for firmware interface based on ACPI operation regions used
     by the PMIC chips on the Intel Baytrail-T and Baytrail-T-CR
     platforms for power resource control and thermal management (Aaron
     Lu).

   - Limited support for retrieving off-the-hierarchy dependencies
     between devices from ACPI _DEP device configuration objects and
     deferred probing support for the ACPI battery driver based on the
     _DEP information to make that driver work on Asus T100A (Lan
     Tianyu).

   - New cpufreq driver for the Loongson1B processor (Kelvin Cheung).

   - ACPICA update to upstream revision 20141107 which only affects
     tools (Bob Moore).

   - Fixes for race conditions in the ACPICA's interrupt handling code
     and in the ACPI code related to system suspend and resume (Lv Zheng
     and Rafael J Wysocki).

   - ACPI core fix for an RCU-related issue in the ioremap() regions
     management code that slowed down significantly after CPUs had been
     allowed to enter idle states even if they'd had RCU callbakcs
     queued and triggered some problems in certain proprietary graphics
     driver (and elsewhere).  The fix replaces synchronize_rcu() in that
     code with synchronize_rcu_expedited() which makes the issue go
     away.  From Konstantin Khlebnikov.

   - ACPI LPSS (Low-Power Subsystem) driver fix to handle power
     management of the DMA engine included into the LPSS correctly.  The
     problem is that the DMA engine doesn't have ACPI PM support of its
     own and it simply is turned off when the last LPSS device having
     ACPI PM support goes into D3cold.  To work around that, the PM
     domain used by the ACPI LPSS driver is redesigned so at least one
     device with ACPI PM support will be on as long as the DMA engine is
     in use.  From Andy Shevchenko.

   - ACPI backlight driver fix to avoid using it on "Win8-compatible"
     systems where it doesn't work and where it was used by default by
     mistake (Aaron Lu).

   - Assorted minor ACPI core fixes and cleanups from Tomasz Nowicki,
     Sudeep Holla, Huang Rui, Hanjun Guo, Fabian Frederick, and Ashwin
     Chaugule (mostly related to the upcoming ARM64 support).

   - Intel RAPL (Running Average Power Limit) power capping driver fixes
     and improvements including new processor IDs (Jacob Pan).

   - Generic power domains modification to power up domains after
     attaching devices to them to meet the expectations of device
     drivers and bus types assuming devices to be accessible at probe
     time (Ulf Hansson).

   - Preliminary support for controlling device clocks from the generic
     power domains core code and modifications of the ARM/shmobile
     platform to use that feature (Ulf Hansson).

   - Assorted minor fixes and cleanups of the generic power domains core
     code (Ulf Hansson, Geert Uytterhoeven).

   - Assorted minor fixes and cleanups of the device clocks control code
     in the PM core (Geert Uytterhoeven, Grygorii Strashko).

   - Consolidation of device power management Kconfig options by making
     CONFIG_PM_SLEEP select CONFIG_PM_RUNTIME and removing the latter
     which is now redundant (Rafael J Wysocki and Kevin Hilman).  That
     is the first batch of the changes needed for this purpose.

   - Core device runtime power management support code cleanup related
     to the execution of callbacks (Andrzej Hajda).

   - cpuidle ARM support improvements (Lorenzo Pieralisi).

   - cpuidle cleanup related to the CPUIDLE_FLAG_TIME_VALID flag and a
     new MAINTAINERS entry for ARM Exynos cpuidle (Daniel Lezcano and
     Bartlomiej Zolnierkiewicz).

   - New cpufreq driver callback (->ready) to be executed when the
     cpufreq core is ready to use a given policy object and cpufreq-dt
     driver modification to use that callback for cooling device
     registration (Viresh Kumar).

   - cpufreq core fixes and cleanups (Viresh Kumar, Vince Hsu, James
     Geboski, Tomeu Vizoso).

   - Assorted fixes and cleanups in the cpufreq-pcc, intel_pstate,
     cpufreq-dt, pxa2xx cpufreq drivers (Lenny Szubowicz, Ethan Zhao,
     Stefan Wahren, Petr Cvek).

   - OPP (Operating Performance Points) framework modification to allow
     OPPs to be removed too and update of a few cpufreq drivers
     (cpufreq-dt, exynos5440, imx6q, cpufreq) to remove OPPs (added
     during initialization) on driver removal (Viresh Kumar).

   - Hibernation core fixes and cleanups (Tina Ruchandani and Markus
     Elfring).

   - PM Kconfig fix related to CPU power management (Pankaj Dubey).

   - cpupower tool fix (Prarit Bhargava)"

* tag 'pm+acpi-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (120 commits)
  i2c-omap / PM: Drop CONFIG_PM_RUNTIME from i2c-omap.c
  dmaengine / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  tools: cpupower: fix return checks for sysfs_get_idlestate_count()
  drivers: sh / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  e1000e / igb / PM: Eliminate CONFIG_PM_RUNTIME
  MMC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  MFD / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  misc / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  media / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  input / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  leds: leds-gpio: Fix multiple instances registration without 'label' property
  iio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  i2c-hid / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  drm / exynos / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  gpio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  hwrandom / exynos / PM: Use CONFIG_PM in #ifdef
  block / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  USB / PM: Drop CONFIG_PM_RUNTIME from the USB core
  PM: Merge the SET*_RUNTIME_PM_OPS() macros
  ...

19 files changed:
1  2 
Documentation/kernel-parameters.txt
MAINTAINERS
arch/arm/mach-tegra/cpuidle-tegra114.c
arch/arm/plat-orion/gpio.c
arch/x86/include/uapi/asm/msr-index.h
block/blk-core.c
drivers/mfd/axp20x.c
drivers/mmc/core/bus.c
drivers/mmc/host/mmci.c
drivers/mmc/host/sdhci-acpi.c
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/sdhci-pci.c
drivers/mmc/host/sdhci-pxav3.c
drivers/mmc/host/sdhci-s3c.c
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h
drivers/pci/pci-sysfs.c
include/linux/blkdev.h
include/linux/of.h

index 32ba9ea5934ac141a52dde25e86a1a51a9f766f4,5fdf714f40a067a02b35b41c1e56117b4854c72c..eacb2e0397ae3f4e80428ef239d5b28faaf622b3
@@@ -1446,6 -1446,9 +1446,9 @@@ bytes respectively. Such letter suffixe
                       disable
                         Do not enable intel_pstate as the default
                         scaling driver for the supported processors
+                      no_hwp
+                        Do not enable hardware P state control (HWP)
+                        if available.
  
        intremap=       [X86-64, Intel-IOMMU]
                        on      enable Interrupt Remapping (default)
                        timeout < 0: reboot immediately
                        Format: <timeout>
  
 +      panic_on_warn   panic() instead of WARN().  Useful to cause kdump
 +                      on a WARN().
 +
        crash_kexec_post_notifiers
                        Run kdump after running panic-notifiers and dumping
                        kmsg. This only for the users who doubt kdump always
                        quiescent states.  Units are jiffies, minimum
                        value is one, and maximum value is HZ.
  
 +      rcutree.kthread_prio=    [KNL,BOOT]
 +                      Set the SCHED_FIFO priority of the RCU
 +                      per-CPU kthreads (rcuc/N). This value is also
 +                      used for the priority of the RCU boost threads
 +                      (rcub/N). Valid values are 1-99 and the default
 +                      is 1 (the least-favored priority).
 +
        rcutree.rcu_nocb_leader_stride= [KNL]
                        Set the number of NOCB kthread groups, which
                        defaults to the square root of the number of
                        messages.  Disable with a value less than or equal
                        to zero.
  
 +      rcupdate.rcu_self_test= [KNL]
 +                      Run the RCU early boot self tests
 +
 +      rcupdate.rcu_self_test_bh= [KNL]
 +                      Run the RCU bh early boot self tests
 +
 +      rcupdate.rcu_self_test_sched= [KNL]
 +                      Run the RCU sched early boot self tests
 +
        rdinit=         [KNL]
                        Format: <full_path>
                        Run specified binary instead of /init from the ramdisk,
                        are saved.
  
        trace_buf_size=nn[KMG]
 -                      [FTRACE] will set tracing buffer size.
 +                      [FTRACE] will set tracing buffer size on each cpu.
  
        trace_event=[event-list]
                        [FTRACE] Set and start specified trace events in order
diff --combined MAINTAINERS
index 47d64dcaa433f45d70205e72837d9eefb81942a4,c9149a158e385e1d96ba1fe9b64ca54a6371fb13..c8927bc7748e54842826a0181506c6bae3c2c85e
@@@ -861,7 -861,6 +861,7 @@@ W: http://maxim.org.za/at91_26.htm
  W:    http://www.linux4sam.org
  S:    Supported
  F:    arch/arm/mach-at91/
 +F:    include/soc/at91/
  F:    arch/arm/boot/dts/at91*.dts
  F:    arch/arm/boot/dts/at91*.dtsi
  F:    arch/arm/boot/dts/sama*.dts
@@@ -1309,22 -1308,30 +1309,22 @@@ F:   drivers/*/*rockchip
  F:    drivers/*/*/*rockchip*
  F:    sound/soc/rockchip/
  
 -ARM/SAMSUNG ARM ARCHITECTURES
 -M:    Ben Dooks <[email protected]>
 -M:    Kukjin Kim <[email protected]>
 +ARM/SAMSUNG EXYNOS ARM ARCHITECTURES
 +M:    Kukjin Kim <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  L:    [email protected] (moderated for non-subscribers)
 -W:    http://www.fluff.org/ben/linux/
  S:    Maintained
  F:    arch/arm/boot/dts/s3c*
  F:    arch/arm/boot/dts/exynos*
  F:    arch/arm/plat-samsung/
  F:    arch/arm/mach-s3c24*/
  F:    arch/arm/mach-s3c64xx/
 +F:    arch/arm/mach-s5p*/
 +F:    arch/arm/mach-exynos*/
  F:    drivers/*/*s3c2410*
  F:    drivers/*/*/*s3c2410*
  F:    drivers/spi/spi-s3c*
  F:    sound/soc/samsung/*
 -
 -ARM/S5P EXYNOS ARM ARCHITECTURES
 -M:    Kukjin Kim <[email protected]>
 -L:    [email protected] (moderated for non-subscribers)
 -L:    [email protected] (moderated for non-subscribers)
 -S:    Maintained
 -F:    arch/arm/mach-s5p*/
 -F:    arch/arm/mach-exynos*/
  N:    exynos
  
  ARM/SAMSUNG MOBILE MACHINE SUPPORT
@@@ -1374,12 -1381,12 +1374,12 @@@ F:   arch/arm/boot/dts/sh
  F:    arch/arm/configs/ape6evm_defconfig
  F:    arch/arm/configs/armadillo800eva_defconfig
  F:    arch/arm/configs/bockw_defconfig
 -F:    arch/arm/configs/koelsch_defconfig
  F:    arch/arm/configs/kzm9g_defconfig
  F:    arch/arm/configs/lager_defconfig
  F:    arch/arm/configs/mackerel_defconfig
  F:    arch/arm/configs/marzen_defconfig
  F:    arch/arm/configs/shmobile_defconfig
 +F:    arch/arm/include/debug/renesas-scif.S
  F:    arch/arm/mach-shmobile/
  F:    drivers/sh/
  
@@@ -1423,7 -1430,6 +1423,7 @@@ F:      drivers/tty/serial/st-asc.
  F:    drivers/usb/dwc3/dwc3-st.c
  F:    drivers/usb/host/ehci-st.c
  F:    drivers/usb/host/ohci-st.c
 +F:    drivers/ata/ahci_st.c
  
  ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
  M:    Lennert Buytenhek <[email protected]>
@@@ -1497,19 -1503,6 +1497,19 @@@ S:    Maintaine
  F:    drivers/clk/ux500/
  F:    include/linux/platform_data/clk-ux500.h
  
 +ARM/VERSATILE EXPRESS PLATFORM
 +M:    Liviu Dudau <[email protected]>
 +M:    Sudeep Holla <[email protected]>
 +M:    Lorenzo Pieralisi <[email protected]>
 +L:    [email protected] (moderated for non-subscribers)
 +S:    Maintained
 +F:    arch/arm/boot/dts/vexpress*
 +F:    arch/arm/mach-vexpress/
 +F:    */*/vexpress*
 +F:    */*/*/vexpress*
 +F:    drivers/clk/versatile/clk-vexpress-osc.c
 +F:    drivers/clocksource/versatile.c
 +
  ARM/VFP SUPPORT
  M:    Russell King <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
@@@ -2104,13 -2097,10 +2104,13 @@@ F:   arch/arm/include/debug/bcm63xx.
  BROADCOM BCM7XXX ARM ARCHITECTURE
  M:    Marc Carino <[email protected]>
  M:    Brian Norris <[email protected]>
 +M:    Gregory Fong <[email protected]>
 +M:    Florian Fainelli <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-bcm/*brcmstb*
  F:    arch/arm/boot/dts/bcm7*.dts*
 +F:    drivers/bus/brcmstb_gisb.c
  
  BROADCOM TG3 GIGABIT ETHERNET DRIVER
  M:    Prashant Sreedharan <[email protected]>
  S:    Supported
  F:    drivers/scsi/bnx2i/
  
 +BROADCOM CYGNUS/IPROC ARM ARCHITECTURE
 +M:    Ray Jui <[email protected]>
 +M:    Scott Branden <[email protected]>
 +L:    [email protected] (moderated for non-subscribers)
 +L:    [email protected]
 +T:    git git://git.github.com/brcm/linux.git
 +S:    Maintained
 +N:    iproc
 +N:    cygnus
 +N:    bcm9113*
 +N:    bcm9583*
 +N:    bcm583*
 +N:    bcm113*
 +
  BROADCOM KONA GPIO DRIVER
  M:    Ray Jui <[email protected]>
  L:    [email protected]
@@@ -2528,7 -2504,8 +2528,7 @@@ M:      Steve French <[email protected]
  L:    [email protected]
  L:    [email protected] (moderated for non-subscribers)
  W:    http://linux-cifs.samba.org/
 -Q:    http://patchwork.ozlabs.org/project/linux-cifs-client/list/
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
 +T:    git git://git.samba.org/sfrench/cifs-2.6.git
  S:    Supported
  F:    Documentation/filesystems/cifs/
  F:    fs/cifs/
@@@ -2605,7 -2582,7 +2605,7 @@@ L:      [email protected]
  L:    [email protected]
  S:    Maintained
  F:    mm/memcontrol.c
 -F:    mm/page_cgroup.c
 +F:    mm/swap_cgroup.c
  
  CORETEMP HARDWARE MONITORING DRIVER
  M:    Fenghua Yu <[email protected]>
@@@ -2655,6 -2632,16 +2655,16 @@@ T:    git git://git.kernel.org/pub/scm/lin
  S:    Maintained
  F:    drivers/cpuidle/cpuidle-big_little.c
  
+ CPUIDLE DRIVER - ARM EXYNOS
+ M:    Bartlomiej Zolnierkiewicz <[email protected]>
+ M:    Daniel Lezcano <[email protected]>
+ M:    Kukjin Kim <[email protected]>
+ L:    [email protected]
+ L:    [email protected]
+ S:    Supported
+ F:    drivers/cpuidle/cpuidle-exynos.c
+ F:    arch/arm/mach-exynos/pm.c
  CPUIDLE DRIVERS
  M:    Rafael J. Wysocki <[email protected]>
  M:    Daniel Lezcano <[email protected]>
@@@ -2722,7 -2709,7 +2732,7 @@@ F:      drivers/net/wireless/cw1200
  
  CX18 VIDEO4LINUX DRIVER
  M:    Andy Walls <[email protected]>
 -L:    [email protected] (moderated for non-subscribers)
 +L:    [email protected] (subscribers-only)
  L:    [email protected]
  T:    git git://linuxtv.org/media_tree.git
  W:    http://linuxtv.org
@@@ -2885,10 -2872,11 +2895,10 @@@ F:   Documentation/networking/dmfe.tx
  F:    drivers/net/ethernet/dec/tulip/dmfe.c
  
  DC390/AM53C974 SCSI driver
 -M:    Kurt Garloff <[email protected]>
 -W:    http://www.garloff.de/kurt/linux/dc390/
 -M:    Guennadi Liakhovetski <[email protected]>
 +M:    Hannes Reinecke <[email protected]>
 +L:    [email protected]
  S:    Maintained
 -F:    drivers/scsi/tmscsim.*
 +F:    drivers/scsi/am53c974.c
  
  DC395x SCSI driver
  M:    Oliver Neukum <[email protected]>
@@@ -5208,7 -5196,7 +5218,7 @@@ F:      drivers/media/tuners/it913x
  
  IVTV VIDEO4LINUX DRIVER
  M:    Andy Walls <[email protected]>
 -L:    [email protected] (moderated for non-subscribers)
 +L:    [email protected] (subscribers-only)
  L:    [email protected]
  T:    git git://linuxtv.org/media_tree.git
  W:    http://www.ivtvdriver.org
@@@ -6013,13 -6001,10 +6023,13 @@@ W:   http://linuxtv.or
  S:    Odd Fixes
  F:    drivers/media/parport/pms*
  
 -MEGARAID SCSI DRIVERS
 -M:    Neela Syam Kolli <[email protected]>
 +MEGARAID SCSI/SAS DRIVERS
 +M:    Kashyap Desai <[email protected]>
 +M:    Sumit Saxena <[email protected]>
 +M:    Uday Lingala <[email protected]>
 +L:    [email protected]
  L:    [email protected]
 -W:    http://megaraid.lsilogic.com
 +W:    http://www.lsi.com
  S:    Maintained
  F:    Documentation/scsi/megaraid.txt
  F:    drivers/scsi/megaraid.*
@@@ -6330,6 -6315,7 +6340,6 @@@ F:      drivers/scsi/g_NCR5380.
  F:    drivers/scsi/g_NCR5380_mmio.c
  F:    drivers/scsi/mac_scsi.*
  F:    drivers/scsi/pas16.*
 -F:    drivers/scsi/sun3_NCR5380.c
  F:    drivers/scsi/sun3_scsi.*
  F:    drivers/scsi/sun3_scsi_vme.c
  F:    drivers/scsi/t128.*
@@@ -6585,13 -6571,6 +6595,13 @@@ S:    Maintaine
  F:    Documentation/scsi/NinjaSCSI.txt
  F:    drivers/scsi/nsp32*
  
 +NIOS2 ARCHITECTURE
 +M:    Ley Foon Tan <[email protected]>
 +L:    [email protected] (moderated for non-subscribers)
 +T:    git git://git.rocketboards.org/linux-socfpga.git
 +S:    Maintained
 +F:    arch/nios2/
 +
  NTB DRIVER
  M:    Jon Mason <[email protected]>
  M:    Dave Jiang <[email protected]>
  S:    Maintained
  F:    sound/soc/omap/
  
 +OMAP GENERAL PURPOSE MEMORY CONTROLLER SUPPORT
 +M:    Roger Quadros <[email protected]>
 +M:    Tony Lindgren <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/memory/omap-gpmc.c
 +F:    arch/arm/mach-omap2/*gpmc*
 +
  OMAP FRAMEBUFFER SUPPORT
  M:    Tomi Valkeinen <[email protected]>
  L:    [email protected]
@@@ -7086,16 -7057,6 +7096,16 @@@ S:    Maintaine
  F:    Documentation/devicetree/bindings/pci/xgene-pci.txt
  F:    drivers/pci/host/pci-xgene.c
  
 +PCI DRIVER FOR FREESCALE LAYERSCAPE
 +M:    Minghuan Lian <[email protected]>
 +M:    Mingkai Hu <[email protected]>
 +M:    Roy Zang <[email protected]>
 +L:    [email protected]
 +L:    [email protected]
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/pci/host/*layerscape*
 +
  PCI DRIVER FOR IMX6
  M:    Richard Zhu <[email protected]>
  M:    Lucas Stach <[email protected]>
index 425b6c8f0cb03eb7a65c3dda5380f2a0c03ae18c,b30908235d5233a2c35eb9618b5428e4f4b00908..f2b586d7b15dfe7cade115ecca4f785324eb15e0
@@@ -49,7 -49,7 +49,7 @@@ static int tegra114_idle_power_down(str
        call_firmware_op(prepare_idle);
  
        /* Do suspend by ourselves if the firmware does not implement it */
 -      if (call_firmware_op(do_idle) == -ENOSYS)
 +      if (call_firmware_op(do_idle, 0) == -ENOSYS)
                cpu_suspend(0, tegra30_sleep_cpu_secondary_finish);
  
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
@@@ -75,7 -75,6 +75,6 @@@ static struct cpuidle_driver tegra_idle
                        .exit_latency           = 500,
                        .target_residency       = 1000,
                        .power_usage            = 0,
-                       .flags                  = CPUIDLE_FLAG_TIME_VALID,
                        .name                   = "powered-down",
                        .desc                   = "CPU power gated",
                },
index 14f6e647c7394c83e9d708117839f5bc617ed8cc,e53fc8df7e4ea63ab9286c15943b744f3c4ed421..5168a52a17f97637e68d64596f8ffa75f051e2d6
@@@ -306,9 -306,10 +306,10 @@@ EXPORT_SYMBOL(orion_gpio_set_blink)
  
  #define ORION_BLINK_HALF_PERIOD 100 /* ms */
  
- int orion_gpio_led_blink_set(unsigned gpio, int state,
+ int orion_gpio_led_blink_set(struct gpio_desc *desc, int state,
        unsigned long *delay_on, unsigned long *delay_off)
  {
+       unsigned gpio = desc_to_gpio(desc);
  
        if (delay_on && delay_off && !*delay_on && !*delay_off)
                *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
@@@ -505,9 -506,9 +506,9 @@@ static void orion_gpio_unmask_irq(struc
        u32 mask = d->mask;
  
        irq_gc_lock(gc);
 -      reg_val = irq_reg_readl(gc->reg_base + ct->regs.mask);
 +      reg_val = irq_reg_readl(gc, ct->regs.mask);
        reg_val |= mask;
 -      irq_reg_writel(reg_val, gc->reg_base + ct->regs.mask);
 +      irq_reg_writel(gc, reg_val, ct->regs.mask);
        irq_gc_unlock(gc);
  }
  
@@@ -519,9 -520,9 +520,9 @@@ static void orion_gpio_mask_irq(struct 
        u32 reg_val;
  
        irq_gc_lock(gc);
 -      reg_val = irq_reg_readl(gc->reg_base + ct->regs.mask);
 +      reg_val = irq_reg_readl(gc, ct->regs.mask);
        reg_val &= ~mask;
 -      irq_reg_writel(reg_val, gc->reg_base + ct->regs.mask);
 +      irq_reg_writel(gc, reg_val, ct->regs.mask);
        irq_gc_unlock(gc);
  }
  
index 8f02f6990759ba91b7002950b1c738fda7d54533,62838e54947dee12f3bd41b8936dcc7a0af6278f..c8aa65d56027eca717502898daa563b59ba7ca21
  #define MSR_CC6_DEMOTION_POLICY_CONFIG        0x00000668
  #define MSR_MC6_DEMOTION_POLICY_CONFIG        0x00000669
  
+ /* Hardware P state interface */
+ #define MSR_PPERF                     0x0000064e
+ #define MSR_PERF_LIMIT_REASONS                0x0000064f
+ #define MSR_PM_ENABLE                 0x00000770
+ #define MSR_HWP_CAPABILITIES          0x00000771
+ #define MSR_HWP_REQUEST_PKG           0x00000772
+ #define MSR_HWP_INTERRUPT             0x00000773
+ #define MSR_HWP_REQUEST               0x00000774
+ #define MSR_HWP_STATUS                        0x00000777
+ /* CPUID.6.EAX */
+ #define HWP_BASE_BIT                  (1<<7)
+ #define HWP_NOTIFICATIONS_BIT         (1<<8)
+ #define HWP_ACTIVITY_WINDOW_BIT               (1<<9)
+ #define HWP_ENERGY_PERF_PREFERENCE_BIT        (1<<10)
+ #define HWP_PACKAGE_LEVEL_REQUEST_BIT (1<<11)
+ /* IA32_HWP_CAPABILITIES */
+ #define HWP_HIGHEST_PERF(x)           (x & 0xff)
+ #define HWP_GUARANTEED_PERF(x)                ((x & (0xff << 8)) >>8)
+ #define HWP_MOSTEFFICIENT_PERF(x)     ((x & (0xff << 16)) >>16)
+ #define HWP_LOWEST_PERF(x)            ((x & (0xff << 24)) >>24)
+ /* IA32_HWP_REQUEST */
+ #define HWP_MIN_PERF(x)               (x & 0xff)
+ #define HWP_MAX_PERF(x)               ((x & 0xff) << 8)
+ #define HWP_DESIRED_PERF(x)           ((x & 0xff) << 16)
+ #define HWP_ENERGY_PERF_PREFERENCE(x) ((x & 0xff) << 24)
+ #define HWP_ACTIVITY_WINDOW(x)                ((x & 0xff3) << 32)
+ #define HWP_PACKAGE_CONTROL(x)                ((x & 0x1) << 42)
+ /* IA32_HWP_STATUS */
+ #define HWP_GUARANTEED_CHANGE(x)      (x & 0x1)
+ #define HWP_EXCURSION_TO_MINIMUM(x)   (x & 0x4)
+ /* IA32_HWP_INTERRUPT */
+ #define HWP_CHANGE_TO_GUARANTEED_INT(x)       (x & 0x1)
+ #define HWP_EXCURSION_TO_MINIMUM_INT(x)       (x & 0x2)
  #define MSR_AMD64_MC0_MASK            0xc0010044
  
  #define MSR_IA32_MCx_CTL(x)           (MSR_IA32_MC0_CTL + 4*(x))
  #define MSR_AMD64_IBSOP_REG_MASK      ((1UL<<MSR_AMD64_IBSOP_REG_COUNT)-1)
  #define MSR_AMD64_IBSCTL              0xc001103a
  #define MSR_AMD64_IBSBRTARGET         0xc001103b
 +#define MSR_AMD64_IBSOPDATA4          0xc001103d
  #define MSR_AMD64_IBS_REG_COUNT_MAX   8 /* includes MSR_AMD64_IBSBRTARGET */
  
  /* Fam 16h MSRs */
  
  #define MSR_IA32_TEMPERATURE_TARGET   0x000001a2
  
+ #define MSR_MISC_PWR_MGMT             0x000001aa
  #define MSR_IA32_ENERGY_PERF_BIAS     0x000001b0
  #define ENERGY_PERF_BIAS_PERFORMANCE  0
  #define ENERGY_PERF_BIAS_NORMAL               6
diff --combined block/blk-core.c
index 2e7424b42947d414090e03b9b7d81ef24207dc8a,2bb7d9c0f63e5f0ec3e6cf8e9f274fa036fed3d4..ea1c4d0d7a44ea7e353b1edb709883651f4f1109
@@@ -1266,7 -1266,7 +1266,7 @@@ void blk_requeue_request(struct request
        blk_clear_rq_complete(rq);
        trace_block_rq_requeue(q, rq);
  
 -      if (blk_rq_tagged(rq))
 +      if (rq->cmd_flags & REQ_QUEUED)
                blk_queue_end_tag(q, rq);
  
        BUG_ON(blk_queued_rq(rq));
@@@ -1325,7 -1325,7 +1325,7 @@@ void part_round_stats(int cpu, struct h
  }
  EXPORT_SYMBOL_GPL(part_round_stats);
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
  static void blk_pm_put_request(struct request *rq)
  {
        if (rq->q->dev && !(rq->cmd_flags & REQ_PM) && !--rq->q->nr_pending)
@@@ -2134,7 -2134,7 +2134,7 @@@ void blk_account_io_done(struct reques
        }
  }
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
  /*
   * Don't process normal requests when queue is suspended
   * or in the process of suspending/resuming
@@@ -2554,7 -2554,7 +2554,7 @@@ EXPORT_SYMBOL_GPL(blk_unprep_request)
   */
  void blk_finish_request(struct request *req, int error)
  {
 -      if (blk_rq_tagged(req))
 +      if (req->cmd_flags & REQ_QUEUED)
                blk_queue_end_tag(req->q, req);
  
        BUG_ON(blk_queued_rq(req));
@@@ -3159,7 -3159,7 +3159,7 @@@ void blk_finish_plug(struct blk_plug *p
  }
  EXPORT_SYMBOL(blk_finish_plug);
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
  /**
   * blk_pm_runtime_init - Block layer runtime PM initialization routine
   * @q: the queue of the device
diff --combined drivers/mfd/axp20x.c
index c522ee22b1c05eb7530e6e288ed4f5bf9589cfb8,1df18d18834225169910864d81a5283341fd16d2..b1b580a88654f9fd1c70c1e89a85b3ba2d5b6786
@@@ -236,7 -236,7 +236,7 @@@ static const struct i2c_device_id axp20
  };
  MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id);
  
 -static struct acpi_device_id axp20x_acpi_match[] = {
 +static const struct acpi_device_id axp20x_acpi_match[] = {
        {
                .id = "INT33F4",
                .driver_data = AXP288_ID,
@@@ -354,6 -354,9 +354,9 @@@ static struct mfd_cell axp288_cells[] 
                .num_resources = ARRAY_SIZE(axp288_battery_resources),
                .resources = axp288_battery_resources,
        },
+       {
+               .name = "axp288_pmic_acpi",
+       },
  };
  
  static struct axp20x_dev *axp20x_pm_power_off;
diff --combined drivers/mmc/core/bus.c
index 5ca562ccfcf389984122c9432447fc175a5121b2,6c0613d56b77e5d1e5b5670787e2a20391c790f8..86d271148528862a0facaf7721816e078be06904
@@@ -25,6 -25,8 +25,6 @@@
  #include "sdio_cis.h"
  #include "bus.h"
  
 -#define to_mmc_driver(d)      container_of(d, struct mmc_driver, drv)
 -
  static ssize_t type_show(struct device *dev,
        struct device_attribute *attr, char *buf)
  {
@@@ -104,14 -106,33 +104,14 @@@ mmc_bus_uevent(struct device *dev, stru
        return retval;
  }
  
 -static int mmc_bus_probe(struct device *dev)
 -{
 -      struct mmc_driver *drv = to_mmc_driver(dev->driver);
 -      struct mmc_card *card = mmc_dev_to_card(dev);
 -
 -      return drv->probe(card);
 -}
 -
 -static int mmc_bus_remove(struct device *dev)
 -{
 -      struct mmc_driver *drv = to_mmc_driver(dev->driver);
 -      struct mmc_card *card = mmc_dev_to_card(dev);
 -
 -      drv->remove(card);
 -
 -      return 0;
 -}
 -
  static void mmc_bus_shutdown(struct device *dev)
  {
 -      struct mmc_driver *drv = to_mmc_driver(dev->driver);
        struct mmc_card *card = mmc_dev_to_card(dev);
        struct mmc_host *host = card->host;
        int ret;
  
 -      if (dev->driver && drv->shutdown)
 -              drv->shutdown(card);
 +      if (dev->driver && dev->driver->shutdown)
 +              dev->driver->shutdown(dev);
  
        if (host->bus_ops->shutdown) {
                ret = host->bus_ops->shutdown(host);
  #ifdef CONFIG_PM_SLEEP
  static int mmc_bus_suspend(struct device *dev)
  {
 -      struct mmc_driver *drv = to_mmc_driver(dev->driver);
        struct mmc_card *card = mmc_dev_to_card(dev);
        struct mmc_host *host = card->host;
        int ret;
  
 -      if (dev->driver && drv->suspend) {
 -              ret = drv->suspend(card);
 -              if (ret)
 -                      return ret;
 -      }
 +      ret = pm_generic_suspend(dev);
 +      if (ret)
 +              return ret;
  
        ret = host->bus_ops->suspend(host);
        return ret;
  
  static int mmc_bus_resume(struct device *dev)
  {
 -      struct mmc_driver *drv = to_mmc_driver(dev->driver);
        struct mmc_card *card = mmc_dev_to_card(dev);
        struct mmc_host *host = card->host;
        int ret;
                pr_warn("%s: error %d during resume (card was removed?)\n",
                        mmc_hostname(host), ret);
  
 -      if (dev->driver && drv->resume)
 -              ret = drv->resume(card);
 -
 +      ret = pm_generic_resume(dev);
        return ret;
  }
  #endif
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
  static int mmc_runtime_suspend(struct device *dev)
  {
        struct mmc_card *card = mmc_dev_to_card(dev);
@@@ -168,7 -195,7 +168,7 @@@ static int mmc_runtime_resume(struct de
  
        return host->bus_ops->runtime_resume(host);
  }
- #endif /* !CONFIG_PM_RUNTIME */
+ #endif /* !CONFIG_PM */
  
  static const struct dev_pm_ops mmc_bus_pm_ops = {
        SET_RUNTIME_PM_OPS(mmc_runtime_suspend, mmc_runtime_resume, NULL)
@@@ -180,6 -207,8 +180,6 @@@ static struct bus_type mmc_bus_type = 
        .dev_groups     = mmc_dev_groups,
        .match          = mmc_bus_match,
        .uevent         = mmc_bus_uevent,
 -      .probe          = mmc_bus_probe,
 -      .remove         = mmc_bus_remove,
        .shutdown       = mmc_bus_shutdown,
        .pm             = &mmc_bus_pm_ops,
  };
@@@ -198,22 -227,24 +198,22 @@@ void mmc_unregister_bus(void
   *    mmc_register_driver - register a media driver
   *    @drv: MMC media driver
   */
 -int mmc_register_driver(struct mmc_driver *drv)
 +int mmc_register_driver(struct device_driver *drv)
  {
 -      drv->drv.bus = &mmc_bus_type;
 -      return driver_register(&drv->drv);
 +      drv->bus = &mmc_bus_type;
 +      return driver_register(drv);
  }
 -
  EXPORT_SYMBOL(mmc_register_driver);
  
  /**
   *    mmc_unregister_driver - unregister a media driver
   *    @drv: MMC media driver
   */
 -void mmc_unregister_driver(struct mmc_driver *drv)
 +void mmc_unregister_driver(struct device_driver *drv)
  {
 -      drv->drv.bus = &mmc_bus_type;
 -      driver_unregister(&drv->drv);
 +      drv->bus = &mmc_bus_type;
 +      driver_unregister(drv);
  }
 -
  EXPORT_SYMBOL(mmc_unregister_driver);
  
  static void mmc_release_card(struct device *dev)
diff --combined drivers/mmc/host/mmci.c
index 53bf7a4b58394846b3e7031d1d3e461666bcdb93,184ea59afa7e58fd82585be51de5aa3bc437bb94..8232e9a02d407ca96495704fd266f02b5fd6fc8e
@@@ -736,15 -736,8 +736,15 @@@ static void mmci_post_request(struct mm
                        chan = host->dma_tx_channel;
                dmaengine_terminate_all(chan);
  
 +              if (host->dma_desc_current == next->dma_desc)
 +                      host->dma_desc_current = NULL;
 +
 +              if (host->dma_current == next->dma_chan)
 +                      host->dma_current = NULL;
 +
                next->dma_desc = NULL;
                next->dma_chan = NULL;
 +              data->host_cookie = 0;
        }
  }
  
@@@ -1850,7 -1843,7 +1850,7 @@@ static int mmci_runtime_resume(struct d
  static const struct dev_pm_ops mmci_dev_pm_ops = {
        SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
                                pm_runtime_force_resume)
-       SET_PM_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
+       SET_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
  };
  
  static struct amba_id mmci_ids[] = {
index daba49ac12423dfc6e62f8b1d64d9e15340cf56f,a804e8dc57e3631f8d451f90867a216029055460..c01eac7c819624ca970f6a69fa249d5d6299857e
@@@ -76,7 -76,6 +76,7 @@@ struct sdhci_acpi_host 
        const struct sdhci_acpi_slot    *slot;
        struct platform_device          *pdev;
        bool                            use_runtime_pm;
 +      bool                            dma_setup;
  };
  
  static inline bool sdhci_acpi_flag(struct sdhci_acpi_host *c, unsigned int flag)
  
  static int sdhci_acpi_enable_dma(struct sdhci_host *host)
  {
 -      return 0;
 +      struct sdhci_acpi_host *c = sdhci_priv(host);
 +      struct device *dev = &c->pdev->dev;
 +      int err = -1;
 +
 +      if (c->dma_setup)
 +              return 0;
 +
 +      if (host->flags & SDHCI_USE_64_BIT_DMA) {
 +              if (host->quirks2 & SDHCI_QUIRK2_BROKEN_64_BIT_DMA) {
 +                      host->flags &= ~SDHCI_USE_64_BIT_DMA;
 +              } else {
 +                      err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
 +                      if (err)
 +                              dev_warn(dev, "Failed to set 64-bit DMA mask\n");
 +              }
 +      }
 +
 +      if (err)
 +              err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
 +
 +      c->dma_setup = !err;
 +
 +      return err;
  }
  
  static void sdhci_acpi_int_hw_reset(struct sdhci_host *host)
@@@ -203,21 -180,17 +203,21 @@@ static int sdhci_acpi_sd_probe_slot(str
  static const struct sdhci_acpi_slot sdhci_acpi_slot_int_emmc = {
        .chip    = &sdhci_acpi_chip_int,
        .caps    = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE |
 -                 MMC_CAP_HW_RESET | MMC_CAP_1_8V_DDR,
 +                 MMC_CAP_HW_RESET | MMC_CAP_1_8V_DDR |
 +                 MMC_CAP_BUS_WIDTH_TEST | MMC_CAP_WAIT_WHILE_BUSY,
        .caps2   = MMC_CAP2_HC_ERASE_SZ,
        .flags   = SDHCI_ACPI_RUNTIME_PM,
 +      .quirks  = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
        .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | SDHCI_QUIRK2_STOP_WITH_TC,
        .probe_slot     = sdhci_acpi_emmc_probe_slot,
  };
  
  static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = {
 -      .quirks  = SDHCI_QUIRK_BROKEN_CARD_DETECTION,
 +      .quirks  = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
 +                 SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
        .quirks2 = SDHCI_QUIRK2_HOST_OFF_CARD_ON,
 -      .caps    = MMC_CAP_NONREMOVABLE | MMC_CAP_POWER_OFF_CARD,
 +      .caps    = MMC_CAP_NONREMOVABLE | MMC_CAP_POWER_OFF_CARD |
 +                 MMC_CAP_BUS_WIDTH_TEST | MMC_CAP_WAIT_WHILE_BUSY,
        .flags   = SDHCI_ACPI_RUNTIME_PM,
        .pm_caps = MMC_PM_KEEP_POWER,
        .probe_slot     = sdhci_acpi_sdio_probe_slot,
  static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sd = {
        .flags   = SDHCI_ACPI_SD_CD | SDHCI_ACPI_SD_CD_OVERRIDE_LEVEL |
                   SDHCI_ACPI_RUNTIME_PM,
 +      .quirks  = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
        .quirks2 = SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON |
                   SDHCI_QUIRK2_STOP_WITH_TC,
 +      .caps    = MMC_CAP_BUS_WIDTH_TEST | MMC_CAP_WAIT_WHILE_BUSY,
        .probe_slot     = sdhci_acpi_sd_probe_slot,
  };
  
@@@ -334,6 -305,21 +334,6 @@@ static int sdhci_acpi_probe(struct plat
                goto err_free;
        }
  
 -      if (!dev->dma_mask) {
 -              u64 dma_mask;
 -
 -              if (sdhci_readl(host, SDHCI_CAPABILITIES) & SDHCI_CAN_64BIT) {
 -                      /* 64-bit DMA is not supported at present */
 -                      dma_mask = DMA_BIT_MASK(32);
 -              } else {
 -                      dma_mask = DMA_BIT_MASK(32);
 -              }
 -
 -              err = dma_coerce_mask_and_coherent(dev, dma_mask);
 -              if (err)
 -                      goto err_free;
 -      }
 -
        if (c->slot) {
                if (c->slot->probe_slot) {
                        err = c->slot->probe_slot(pdev, hid, uid);
@@@ -430,7 -416,7 +430,7 @@@ static int sdhci_acpi_resume(struct dev
  
  #endif
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
  
  static int sdhci_acpi_runtime_suspend(struct device *dev)
  {
index 12711ab51aed24ecd32d1d967112b65f94bae7b0,cafa10c1089321f6d898e9a1323926094d437845..af1f7c0f95450e94a923146f4d53240b7ba3e821
@@@ -65,6 -65,8 +65,6 @@@
  /* NOTE: the minimum valid tuning start tap for mx6sl is 1 */
  #define ESDHC_TUNING_START_TAP                0x1
  
 -#define ESDHC_TUNING_BLOCK_PATTERN_LEN        64
 -
  /* pinctrl state */
  #define ESDHC_PINCTRL_STATE_100MHZ    "state_100mhz"
  #define ESDHC_PINCTRL_STATE_200MHZ    "state_200mhz"
@@@ -690,6 -692,8 +690,6 @@@ static void esdhc_prepare_tuning(struc
        /* FIXME: delay a bit for card to be ready for next tuning due to errors */
        mdelay(1);
  
 -      /* This is balanced by the runtime put in sdhci_tasklet_finish */
 -      pm_runtime_get_sync(host->mmc->parent);
        reg = readl(host->ioaddr + ESDHC_MIX_CTRL);
        reg |= ESDHC_MIX_CTRL_EXE_TUNE | ESDHC_MIX_CTRL_SMPCLK_SEL |
                        ESDHC_MIX_CTRL_FBCLK_SEL;
                        val, readl(host->ioaddr + ESDHC_TUNE_CTRL_STATUS));
  }
  
 -static void esdhc_request_done(struct mmc_request *mrq)
 -{
 -      complete(&mrq->completion);
 -}
 -
 -static int esdhc_send_tuning_cmd(struct sdhci_host *host, u32 opcode,
 -                               struct scatterlist *sg)
 -{
 -      struct mmc_command cmd = {0};
 -      struct mmc_request mrq = {NULL};
 -      struct mmc_data data = {0};
 -
 -      cmd.opcode = opcode;
 -      cmd.arg = 0;
 -      cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
 -
 -      data.blksz = ESDHC_TUNING_BLOCK_PATTERN_LEN;
 -      data.blocks = 1;
 -      data.flags = MMC_DATA_READ;
 -      data.sg = sg;
 -      data.sg_len = 1;
 -
 -      mrq.cmd = &cmd;
 -      mrq.cmd->mrq = &mrq;
 -      mrq.data = &data;
 -      mrq.data->mrq = &mrq;
 -      mrq.cmd->data = mrq.data;
 -
 -      mrq.done = esdhc_request_done;
 -      init_completion(&(mrq.completion));
 -
 -      spin_lock_irq(&host->lock);
 -      host->mrq = &mrq;
 -
 -      sdhci_send_command(host, mrq.cmd);
 -
 -      spin_unlock_irq(&host->lock);
 -
 -      wait_for_completion(&mrq.completion);
 -
 -      if (cmd.error)
 -              return cmd.error;
 -      if (data.error)
 -              return data.error;
 -
 -      return 0;
 -}
 -
  static void esdhc_post_tuning(struct sdhci_host *host)
  {
        u32 reg;
  
  static int esdhc_executing_tuning(struct sdhci_host *host, u32 opcode)
  {
 -      struct scatterlist sg;
 -      char *tuning_pattern;
        int min, max, avg, ret;
  
 -      tuning_pattern = kmalloc(ESDHC_TUNING_BLOCK_PATTERN_LEN, GFP_KERNEL);
 -      if (!tuning_pattern)
 -              return -ENOMEM;
 -
 -      sg_init_one(&sg, tuning_pattern, ESDHC_TUNING_BLOCK_PATTERN_LEN);
 -
        /* find the mininum delay first which can pass tuning */
        min = ESDHC_TUNE_CTRL_MIN;
        while (min < ESDHC_TUNE_CTRL_MAX) {
                esdhc_prepare_tuning(host, min);
 -              if (!esdhc_send_tuning_cmd(host, opcode, &sg))
 +              if (!mmc_send_tuning(host->mmc))
                        break;
                min += ESDHC_TUNE_CTRL_STEP;
        }
        max = min + ESDHC_TUNE_CTRL_STEP;
        while (max < ESDHC_TUNE_CTRL_MAX) {
                esdhc_prepare_tuning(host, max);
 -              if (esdhc_send_tuning_cmd(host, opcode, &sg)) {
 +              if (mmc_send_tuning(host->mmc)) {
                        max -= ESDHC_TUNE_CTRL_STEP;
                        break;
                }
        /* use average delay to get the best timing */
        avg = (min + max) / 2;
        esdhc_prepare_tuning(host, avg);
 -      ret = esdhc_send_tuning_cmd(host, opcode, &sg);
 +      ret = mmc_send_tuning(host->mmc);
        esdhc_post_tuning(host);
  
 -      kfree(tuning_pattern);
 -
        dev_dbg(mmc_dev(host->mmc), "tunning %s at 0x%x ret %d\n",
                ret ? "failed" : "passed", avg, ret);
  
@@@ -969,8 -1031,11 +969,8 @@@ static int sdhci_esdhc_imx_probe(struc
  
        imx_data->pins_default = pinctrl_lookup_state(imx_data->pinctrl,
                                                PINCTRL_STATE_DEFAULT);
 -      if (IS_ERR(imx_data->pins_default)) {
 -              err = PTR_ERR(imx_data->pins_default);
 -              dev_err(mmc_dev(host->mmc), "could not get default state\n");
 -              goto disable_clk;
 -      }
 +      if (IS_ERR(imx_data->pins_default))
 +              dev_warn(mmc_dev(host->mmc), "could not get default state\n");
  
        host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
  
        }
  
        /* sdr50 and sdr104 needs work on 1.8v signal voltage */
 -      if ((boarddata->support_vsel) && esdhc_is_usdhc(imx_data)) {
 +      if ((boarddata->support_vsel) && esdhc_is_usdhc(imx_data) &&
 +          !IS_ERR(imx_data->pins_default)) {
                imx_data->pins_100mhz = pinctrl_lookup_state(imx_data->pinctrl,
                                                ESDHC_PINCTRL_STATE_100MHZ);
                imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl,
@@@ -1108,7 -1172,7 +1108,7 @@@ static int sdhci_esdhc_imx_remove(struc
        pm_runtime_dont_use_autosuspend(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
  
-       if (!IS_ENABLED(CONFIG_PM_RUNTIME)) {
+       if (!IS_ENABLED(CONFIG_PM)) {
                clk_disable_unprepare(imx_data->clk_per);
                clk_disable_unprepare(imx_data->clk_ipg);
                clk_disable_unprepare(imx_data->clk_ahb);
        return 0;
  }
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
  static int sdhci_esdhc_runtime_suspend(struct device *dev)
  {
        struct sdhci_host *host = dev_get_drvdata(dev);
index 95f73007fccf9288e04b07266996c52516533c2c,de32a09b46d6d3961c1bd02a52b31df172bf6532..03427755b9029b297393d1d43851b4f678f2bbae
@@@ -134,7 -134,7 +134,7 @@@ static int pch_hc_probe_slot(struct sdh
        return 0;
  }
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
  
  static irqreturn_t sdhci_pci_sd_cd(int irq, void *dev_id)
  {
@@@ -269,9 -269,7 +269,9 @@@ static void sdhci_pci_int_hw_reset(stru
  static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot)
  {
        slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE |
 -                               MMC_CAP_HW_RESET | MMC_CAP_1_8V_DDR;
 +                               MMC_CAP_HW_RESET | MMC_CAP_1_8V_DDR |
 +                               MMC_CAP_BUS_WIDTH_TEST |
 +                               MMC_CAP_WAIT_WHILE_BUSY;
        slot->host->mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ;
        slot->hw_reset = sdhci_pci_int_hw_reset;
        if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BSW_EMMC)
  
  static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot)
  {
 -      slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE;
 +      slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE |
 +                               MMC_CAP_BUS_WIDTH_TEST |
 +                               MMC_CAP_WAIT_WHILE_BUSY;
        return 0;
  }
  
  static int byt_sd_probe_slot(struct sdhci_pci_slot *slot)
  {
 +      slot->host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST |
 +                               MMC_CAP_WAIT_WHILE_BUSY;
        slot->cd_con_id = NULL;
        slot->cd_idx = 0;
        slot->cd_override_level = true;
  static const struct sdhci_pci_fixes sdhci_intel_byt_emmc = {
        .allow_runtime_pm = true,
        .probe_slot     = byt_emmc_probe_slot,
 +      .quirks         = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
        .quirks2        = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
                          SDHCI_QUIRK2_STOP_WITH_TC,
  };
  
  static const struct sdhci_pci_fixes sdhci_intel_byt_sdio = {
 +      .quirks         = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
        .quirks2        = SDHCI_QUIRK2_HOST_OFF_CARD_ON |
                        SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
        .allow_runtime_pm = true,
  };
  
  static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
 +      .quirks         = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
        .quirks2        = SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON |
                          SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
                          SDHCI_QUIRK2_STOP_WITH_TC,
@@@ -654,25 -645,6 +654,25 @@@ static const struct sdhci_pci_fixes sdh
        .probe_slot     = rtsx_probe_slot,
  };
  
 +static int amd_probe(struct sdhci_pci_chip *chip)
 +{
 +      struct pci_dev  *smbus_dev;
 +
 +      smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD,
 +                      PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL);
 +
 +      if (smbus_dev && (smbus_dev->revision < 0x51)) {
 +              chip->quirks2 |= SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD;
 +              chip->quirks2 |= SDHCI_QUIRK2_BROKEN_HS200;
 +      }
 +
 +      return 0;
 +}
 +
 +static const struct sdhci_pci_fixes sdhci_amd = {
 +      .probe          = amd_probe,
 +};
 +
  static const struct pci_device_id pci_ids[] = {
        {
                .vendor         = PCI_VENDOR_ID_RICOH,
                .subdevice      = PCI_ANY_ID,
                .driver_data    = (kernel_ulong_t)&sdhci_o2,
        },
 -
 +      {
 +              .vendor         = PCI_VENDOR_ID_AMD,
 +              .device         = PCI_ANY_ID,
 +              .class          = PCI_CLASS_SYSTEM_SDHCI << 8,
 +              .class_mask     = 0xFFFF00,
 +              .subvendor      = PCI_ANY_ID,
 +              .subdevice      = PCI_ANY_ID,
 +              .driver_data    = (kernel_ulong_t)&sdhci_amd,
 +      },
        {       /* Generic SD host controller */
                PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00)
        },
@@@ -1100,7 -1064,7 +1100,7 @@@ static int sdhci_pci_enable_dma(struct 
  {
        struct sdhci_pci_slot *slot;
        struct pci_dev *pdev;
 -      int ret;
 +      int ret = -1;
  
        slot = sdhci_priv(host);
        pdev = slot->chip->pdev;
                        "doesn't fully claim to support it.\n");
        }
  
 -      ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
 +      if (host->flags & SDHCI_USE_64_BIT_DMA) {
 +              if (host->quirks2 & SDHCI_QUIRK2_BROKEN_64_BIT_DMA) {
 +                      host->flags &= ~SDHCI_USE_64_BIT_DMA;
 +              } else {
 +                      ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
 +                      if (ret)
 +                              dev_warn(&pdev->dev, "Failed to set 64-bit DMA mask\n");
 +              }
 +      }
 +      if (ret)
 +              ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
        if (ret)
                return ret;
  
@@@ -1276,15 -1230,6 +1276,6 @@@ static int sdhci_pci_resume(struct devi
        return 0;
  }
  
- #else /* CONFIG_PM */
- #define sdhci_pci_suspend NULL
- #define sdhci_pci_resume NULL
- #endif /* CONFIG_PM */
- #ifdef CONFIG_PM_RUNTIME
  static int sdhci_pci_runtime_suspend(struct device *dev)
  {
        struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
@@@ -1356,7 -1301,12 +1347,12 @@@ static int sdhci_pci_runtime_idle(struc
        return 0;
  }
  
- #endif
+ #else /* CONFIG_PM */
+ #define sdhci_pci_suspend NULL
+ #define sdhci_pci_resume NULL
+ #endif /* CONFIG_PM */
  
  static const struct dev_pm_ops sdhci_pci_pm_ops = {
        .suspend = sdhci_pci_suspend,
index ad0badad0ebc8f4900b646e3a56b0d5b06a8e899,88cf1ef970fea5e88a49972029b53a136e05a8bc..45238871192da1d6553268d82659dce3cc600d68
  #define SDCE_MISC_INT         (1<<2)
  #define SDCE_MISC_INT_EN      (1<<1)
  
 +struct sdhci_pxa {
 +      struct clk *clk_core;
 +      struct clk *clk_io;
 +      u8      power_mode;
 +};
 +
  /*
   * These registers are relative to the second register region, for the
   * MBus bridge.
@@@ -217,7 -211,6 +217,7 @@@ static void pxav3_set_uhs_signaling(str
        case MMC_TIMING_UHS_SDR104:
                ctrl_2 |= SDHCI_CTRL_UHS_SDR104 | SDHCI_CTRL_VDD_180;
                break;
 +      case MMC_TIMING_MMC_DDR52:
        case MMC_TIMING_UHS_DDR50:
                ctrl_2 |= SDHCI_CTRL_UHS_DDR50 | SDHCI_CTRL_VDD_180;
                break;
@@@ -290,7 -283,9 +290,7 @@@ static int sdhci_pxav3_probe(struct pla
        struct sdhci_host *host = NULL;
        struct sdhci_pxa *pxa = NULL;
        const struct of_device_id *match;
 -
        int ret;
 -      struct clk *clk;
  
        pxa = devm_kzalloc(&pdev->dev, sizeof(struct sdhci_pxa), GFP_KERNEL);
        if (!pxa)
        pltfm_host = sdhci_priv(host);
        pltfm_host->priv = pxa;
  
 -      clk = devm_clk_get(dev, NULL);
 -      if (IS_ERR(clk)) {
 +      pxa->clk_io = devm_clk_get(dev, "io");
 +      if (IS_ERR(pxa->clk_io))
 +              pxa->clk_io = devm_clk_get(dev, NULL);
 +      if (IS_ERR(pxa->clk_io)) {
                dev_err(dev, "failed to get io clock\n");
 -              ret = PTR_ERR(clk);
 +              ret = PTR_ERR(pxa->clk_io);
                goto err_clk_get;
        }
 -      pltfm_host->clk = clk;
 -      clk_prepare_enable(clk);
 +      pltfm_host->clk = pxa->clk_io;
 +      clk_prepare_enable(pxa->clk_io);
 +
 +      pxa->clk_core = devm_clk_get(dev, "core");
 +      if (!IS_ERR(pxa->clk_core))
 +              clk_prepare_enable(pxa->clk_core);
  
        /* enable 1/8V DDR capable */
        host->mmc->caps |= MMC_CAP_1_8V_DDR;
@@@ -396,9 -385,7 +396,9 @@@ err_add_host
        pm_runtime_disable(&pdev->dev);
  err_of_parse:
  err_cd_req:
 -      clk_disable_unprepare(clk);
 +      clk_disable_unprepare(pxa->clk_io);
 +      if (!IS_ERR(pxa->clk_core))
 +              clk_disable_unprepare(pxa->clk_core);
  err_clk_get:
  err_mbus_win:
        sdhci_pltfm_free(pdev);
@@@ -409,15 -396,12 +409,15 @@@ static int sdhci_pxav3_remove(struct pl
  {
        struct sdhci_host *host = platform_get_drvdata(pdev);
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 +      struct sdhci_pxa *pxa = pltfm_host->priv;
  
        pm_runtime_get_sync(&pdev->dev);
        sdhci_remove_host(host, 1);
        pm_runtime_disable(&pdev->dev);
  
 -      clk_disable_unprepare(pltfm_host->clk);
 +      clk_disable_unprepare(pxa->clk_io);
 +      if (!IS_ERR(pxa->clk_core))
 +              clk_disable_unprepare(pxa->clk_core);
  
        sdhci_pltfm_free(pdev);
  
@@@ -452,21 -436,20 +452,21 @@@ static int sdhci_pxav3_resume(struct de
  }
  #endif
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
  static int sdhci_pxav3_runtime_suspend(struct device *dev)
  {
        struct sdhci_host *host = dev_get_drvdata(dev);
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 +      struct sdhci_pxa *pxa = pltfm_host->priv;
        unsigned long flags;
  
 -      if (pltfm_host->clk) {
 -              spin_lock_irqsave(&host->lock, flags);
 -              host->runtime_suspended = true;
 -              spin_unlock_irqrestore(&host->lock, flags);
 +      spin_lock_irqsave(&host->lock, flags);
 +      host->runtime_suspended = true;
 +      spin_unlock_irqrestore(&host->lock, flags);
  
 -              clk_disable_unprepare(pltfm_host->clk);
 -      }
 +      clk_disable_unprepare(pxa->clk_io);
 +      if (!IS_ERR(pxa->clk_core))
 +              clk_disable_unprepare(pxa->clk_core);
  
        return 0;
  }
@@@ -475,16 -458,15 +475,16 @@@ static int sdhci_pxav3_runtime_resume(s
  {
        struct sdhci_host *host = dev_get_drvdata(dev);
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 +      struct sdhci_pxa *pxa = pltfm_host->priv;
        unsigned long flags;
  
 -      if (pltfm_host->clk) {
 -              clk_prepare_enable(pltfm_host->clk);
 +      clk_prepare_enable(pxa->clk_io);
 +      if (!IS_ERR(pxa->clk_core))
 +              clk_prepare_enable(pxa->clk_core);
  
 -              spin_lock_irqsave(&host->lock, flags);
 -              host->runtime_suspended = false;
 -              spin_unlock_irqrestore(&host->lock, flags);
 -      }
 +      spin_lock_irqsave(&host->lock, flags);
 +      host->runtime_suspended = false;
 +      spin_unlock_irqrestore(&host->lock, flags);
  
        return 0;
  }
index 4f7a63213b33b524d7491b981cb7c22c4a45c532,fbf50efe628846e8bb786b81e8b94f1223aefb03..c45b8932d8438086f36661b59aac2b74a2dc56f1
@@@ -300,7 -300,6 +300,7 @@@ static void sdhci_cmu_set_clock(struct 
        struct device *dev = &ourhost->pdev->dev;
        unsigned long timeout;
        u16 clk = 0;
 +      int ret;
  
        host->mmc->actual_clock = 0;
  
  
        sdhci_s3c_set_clock(host, clock);
  
 -      clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock);
 +      ret = clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock);
 +      if (ret != 0) {
 +              dev_err(dev, "%s: failed to set clock rate %uHz\n",
 +                      mmc_hostname(host->mmc), clock);
 +              return;
 +      }
  
        clk = SDHCI_CLOCK_INT_EN;
        sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
@@@ -615,7 -609,7 +615,7 @@@ static int sdhci_s3c_probe(struct platf
                goto err_req_regs;
        }
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
        if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL)
                clk_disable_unprepare(sc->clk_io);
  #endif
@@@ -641,7 -635,7 +641,7 @@@ static int sdhci_s3c_remove(struct plat
        if (sc->ext_cd_irq)
                free_irq(sc->ext_cd_irq, sc);
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
        if (sc->pdata->cd_type != S3C_SDHCI_CD_INTERNAL)
                clk_prepare_enable(sc->clk_io);
  #endif
@@@ -673,7 -667,7 +673,7 @@@ static int sdhci_s3c_resume(struct devi
  }
  #endif
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
  static int sdhci_s3c_runtime_suspend(struct device *dev)
  {
        struct sdhci_host *host = dev_get_drvdata(dev);
diff --combined drivers/mmc/host/sdhci.c
index 73de62a58d70b1cb4cad2d12cff72b966f1d25ac,640e82c40ee953b3e436d1338b5b2e7ca245f6ea..cbb245b5853873cbddc2f1a0967c8bcc989ea4e1
@@@ -44,6 -44,8 +44,6 @@@
  
  #define MAX_TUNING_LOOP 40
  
 -#define ADMA_SIZE     ((128 * 2 + 1) * 4)
 -
  static unsigned int debug_quirks = 0;
  static unsigned int debug_quirks2;
  
@@@ -54,7 -56,7 +54,7 @@@ static int sdhci_execute_tuning(struct 
  static void sdhci_tuning_timer(unsigned long data);
  static void sdhci_enable_preset_value(struct sdhci_host *host, bool enable);
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
  static int sdhci_runtime_pm_get(struct sdhci_host *host);
  static int sdhci_runtime_pm_put(struct sdhci_host *host);
  static void sdhci_runtime_pm_bus_on(struct sdhci_host *host);
@@@ -117,17 -119,10 +117,17 @@@ static void sdhci_dumpregs(struct sdhci
        pr_debug(DRIVER_NAME ": Host ctl2: 0x%08x\n",
                sdhci_readw(host, SDHCI_HOST_CONTROL2));
  
 -      if (host->flags & SDHCI_USE_ADMA)
 -              pr_debug(DRIVER_NAME ": ADMA Err: 0x%08x | ADMA Ptr: 0x%08x\n",
 -                     readl(host->ioaddr + SDHCI_ADMA_ERROR),
 -                     readl(host->ioaddr + SDHCI_ADMA_ADDRESS));
 +      if (host->flags & SDHCI_USE_ADMA) {
 +              if (host->flags & SDHCI_USE_64_BIT_DMA)
 +                      pr_debug(DRIVER_NAME ": ADMA Err: 0x%08x | ADMA Ptr: 0x%08x%08x\n",
 +                               readl(host->ioaddr + SDHCI_ADMA_ERROR),
 +                               readl(host->ioaddr + SDHCI_ADMA_ADDRESS_HI),
 +                               readl(host->ioaddr + SDHCI_ADMA_ADDRESS));
 +              else
 +                      pr_debug(DRIVER_NAME ": ADMA Err: 0x%08x | ADMA Ptr: 0x%08x\n",
 +                               readl(host->ioaddr + SDHCI_ADMA_ERROR),
 +                               readl(host->ioaddr + SDHCI_ADMA_ADDRESS));
 +      }
  
        pr_debug(DRIVER_NAME ": ===========================================\n");
  }
@@@ -453,26 -448,18 +453,26 @@@ static void sdhci_kunmap_atomic(void *b
        local_irq_restore(*flags);
  }
  
 -static void sdhci_set_adma_desc(u8 *desc, u32 addr, int len, unsigned cmd)
 +static void sdhci_adma_write_desc(struct sdhci_host *host, void *desc,
 +                                dma_addr_t addr, int len, unsigned cmd)
  {
 -      __le32 *dataddr = (__le32 __force *)(desc + 4);
 -      __le16 *cmdlen = (__le16 __force *)desc;
 +      struct sdhci_adma2_64_desc *dma_desc = desc;
 +
 +      /* 32-bit and 64-bit descriptors have these members in same position */
 +      dma_desc->cmd = cpu_to_le16(cmd);
 +      dma_desc->len = cpu_to_le16(len);
 +      dma_desc->addr_lo = cpu_to_le32((u32)addr);
  
 -      /* SDHCI specification says ADMA descriptors should be 4 byte
 -       * aligned, so using 16 or 32bit operations should be safe. */
 +      if (host->flags & SDHCI_USE_64_BIT_DMA)
 +              dma_desc->addr_hi = cpu_to_le32((u64)addr >> 32);
 +}
  
 -      cmdlen[0] = cpu_to_le16(cmd);
 -      cmdlen[1] = cpu_to_le16(len);
 +static void sdhci_adma_mark_end(void *desc)
 +{
 +      struct sdhci_adma2_64_desc *dma_desc = desc;
  
 -      dataddr[0] = cpu_to_le32(addr);
 +      /* 32-bit and 64-bit descriptors have 'cmd' in same position */
 +      dma_desc->cmd |= cpu_to_le16(ADMA2_END);
  }
  
  static int sdhci_adma_table_pre(struct sdhci_host *host,
  {
        int direction;
  
 -      u8 *desc;
 -      u8 *align;
 +      void *desc;
 +      void *align;
        dma_addr_t addr;
        dma_addr_t align_addr;
        int len, offset;
                direction = DMA_TO_DEVICE;
  
        host->align_addr = dma_map_single(mmc_dev(host->mmc),
 -              host->align_buffer, 128 * 4, direction);
 +              host->align_buffer, host->align_buffer_sz, direction);
        if (dma_mapping_error(mmc_dev(host->mmc), host->align_addr))
                goto fail;
 -      BUG_ON(host->align_addr & 0x3);
 +      BUG_ON(host->align_addr & host->align_mask);
  
        host->sg_count = dma_map_sg(mmc_dev(host->mmc),
                data->sg, data->sg_len, direction);
        if (host->sg_count == 0)
                goto unmap_align;
  
 -      desc = host->adma_desc;
 +      desc = host->adma_table;
        align = host->align_buffer;
  
        align_addr = host->align_addr;
                 * the (up to three) bytes that screw up the
                 * alignment.
                 */
 -              offset = (4 - (addr & 0x3)) & 0x3;
 +              offset = (host->align_sz - (addr & host->align_mask)) &
 +                       host->align_mask;
                if (offset) {
                        if (data->flags & MMC_DATA_WRITE) {
                                buffer = sdhci_kmap_atomic(sg, &flags);
 -                              WARN_ON(((long)buffer & PAGE_MASK) > (PAGE_SIZE - 3));
 +                              WARN_ON(((long)buffer & (PAGE_SIZE - 1)) >
 +                                      (PAGE_SIZE - offset));
                                memcpy(align, buffer, offset);
                                sdhci_kunmap_atomic(buffer, &flags);
                        }
  
                        /* tran, valid */
 -                      sdhci_set_adma_desc(desc, align_addr, offset, 0x21);
 +                      sdhci_adma_write_desc(host, desc, align_addr, offset,
 +                                            ADMA2_TRAN_VALID);
  
                        BUG_ON(offset > 65536);
  
 -                      align += 4;
 -                      align_addr += 4;
 +                      align += host->align_sz;
 +                      align_addr += host->align_sz;
  
 -                      desc += 8;
 +                      desc += host->desc_sz;
  
                        addr += offset;
                        len -= offset;
                BUG_ON(len > 65536);
  
                /* tran, valid */
 -              sdhci_set_adma_desc(desc, addr, len, 0x21);
 -              desc += 8;
 +              sdhci_adma_write_desc(host, desc, addr, len, ADMA2_TRAN_VALID);
 +              desc += host->desc_sz;
  
                /*
                 * If this triggers then we have a calculation bug
                 * somewhere. :/
                 */
 -              WARN_ON((desc - host->adma_desc) > ADMA_SIZE);
 +              WARN_ON((desc - host->adma_table) >= host->adma_table_sz);
        }
  
        if (host->quirks & SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC) {
                /*
                * Mark the last descriptor as the terminating descriptor
                */
 -              if (desc != host->adma_desc) {
 -                      desc -= 8;
 -                      desc[0] |= 0x2; /* end */
 +              if (desc != host->adma_table) {
 +                      desc -= host->desc_sz;
 +                      sdhci_adma_mark_end(desc);
                }
        } else {
                /*
                */
  
                /* nop, end, valid */
 -              sdhci_set_adma_desc(desc, 0, 0, 0x3);
 +              sdhci_adma_write_desc(host, desc, 0, 0, ADMA2_NOP_END_VALID);
        }
  
        /*
         */
        if (data->flags & MMC_DATA_WRITE) {
                dma_sync_single_for_device(mmc_dev(host->mmc),
 -                      host->align_addr, 128 * 4, direction);
 +                      host->align_addr, host->align_buffer_sz, direction);
        }
  
        return 0;
  
  unmap_align:
        dma_unmap_single(mmc_dev(host->mmc), host->align_addr,
 -              128 * 4, direction);
 +              host->align_buffer_sz, direction);
  fail:
        return -EINVAL;
  }
@@@ -608,7 -592,7 +608,7 @@@ static void sdhci_adma_table_post(struc
  
        struct scatterlist *sg;
        int i, size;
 -      u8 *align;
 +      void *align;
        char *buffer;
        unsigned long flags;
        bool has_unaligned;
                direction = DMA_TO_DEVICE;
  
        dma_unmap_single(mmc_dev(host->mmc), host->align_addr,
 -              128 * 4, direction);
 +              host->align_buffer_sz, direction);
  
        /* Do a quick scan of the SG list for any unaligned mappings */
        has_unaligned = false;
        for_each_sg(data->sg, sg, host->sg_count, i)
 -              if (sg_dma_address(sg) & 3) {
 +              if (sg_dma_address(sg) & host->align_mask) {
                        has_unaligned = true;
                        break;
                }
                align = host->align_buffer;
  
                for_each_sg(data->sg, sg, host->sg_count, i) {
 -                      if (sg_dma_address(sg) & 0x3) {
 -                              size = 4 - (sg_dma_address(sg) & 0x3);
 +                      if (sg_dma_address(sg) & host->align_mask) {
 +                              size = host->align_sz -
 +                                     (sg_dma_address(sg) & host->align_mask);
  
                                buffer = sdhci_kmap_atomic(sg, &flags);
 -                              WARN_ON(((long)buffer & PAGE_MASK) > (PAGE_SIZE - 3));
 +                              WARN_ON(((long)buffer & (PAGE_SIZE - 1)) >
 +                                      (PAGE_SIZE - size));
                                memcpy(buffer, align, size);
                                sdhci_kunmap_atomic(buffer, &flags);
  
 -                              align += 4;
 +                              align += host->align_sz;
                        }
                }
        }
@@@ -840,10 -822,6 +840,10 @@@ static void sdhci_prepare_data(struct s
                        } else {
                                sdhci_writel(host, host->adma_addr,
                                        SDHCI_ADMA_ADDRESS);
 +                              if (host->flags & SDHCI_USE_64_BIT_DMA)
 +                                      sdhci_writel(host,
 +                                                   (u64)host->adma_addr >> 32,
 +                                                   SDHCI_ADMA_ADDRESS_HI);
                        }
                } else {
                        int sg_cnt;
                ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
                ctrl &= ~SDHCI_CTRL_DMA_MASK;
                if ((host->flags & SDHCI_REQ_USE_DMA) &&
 -                      (host->flags & SDHCI_USE_ADMA))
 -                      ctrl |= SDHCI_CTRL_ADMA32;
 -              else
 +                      (host->flags & SDHCI_USE_ADMA)) {
 +                      if (host->flags & SDHCI_USE_64_BIT_DMA)
 +                              ctrl |= SDHCI_CTRL_ADMA64;
 +                      else
 +                              ctrl |= SDHCI_CTRL_ADMA32;
 +              } else {
                        ctrl |= SDHCI_CTRL_SDMA;
 +              }
                sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
        }
  
@@@ -915,15 -889,10 +915,15 @@@ static void sdhci_set_transfer_mode(str
        struct mmc_data *data = cmd->data;
  
        if (data == NULL) {
 +              if (host->quirks2 &
 +                      SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD) {
 +                      sdhci_writew(host, 0x0, SDHCI_TRANSFER_MODE);
 +              } else {
                /* clear Auto CMD settings for no data CMDs */
 -              mode = sdhci_readw(host, SDHCI_TRANSFER_MODE);
 -              sdhci_writew(host, mode & ~(SDHCI_TRNS_AUTO_CMD12 |
 +                      mode = sdhci_readw(host, SDHCI_TRANSFER_MODE);
 +                      sdhci_writew(host, mode & ~(SDHCI_TRNS_AUTO_CMD12 |
                                SDHCI_TRNS_AUTO_CMD23), SDHCI_TRANSFER_MODE);
 +              }
                return;
        }
  
@@@ -1148,9 -1117,6 +1148,9 @@@ static u16 sdhci_get_preset_value(struc
        case MMC_TIMING_UHS_DDR50:
                preset = sdhci_readw(host, SDHCI_PRESET_FOR_DDR50);
                break;
 +      case MMC_TIMING_MMC_HS400:
 +              preset = sdhci_readw(host, SDHCI_PRESET_FOR_HS400);
 +              break;
        default:
                pr_warn("%s: Invalid UHS-I mode selected\n",
                        mmc_hostname(host->mmc));
@@@ -1478,8 -1444,6 +1478,8 @@@ void sdhci_set_uhs_signaling(struct sdh
        else if ((timing == MMC_TIMING_UHS_DDR50) ||
                 (timing == MMC_TIMING_MMC_DDR52))
                ctrl_2 |= SDHCI_CTRL_UHS_DDR50;
 +      else if (timing == MMC_TIMING_MMC_HS400)
 +              ctrl_2 |= SDHCI_CTRL_HS400; /* Non-standard */
        sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
  }
  EXPORT_SYMBOL_GPL(sdhci_set_uhs_signaling);
@@@ -1551,8 -1515,7 +1551,8 @@@ static void sdhci_do_set_ios(struct sdh
                u16 clk, ctrl_2;
  
                /* In case of UHS-I modes, set High Speed Enable */
 -              if ((ios->timing == MMC_TIMING_MMC_HS200) ||
 +              if ((ios->timing == MMC_TIMING_MMC_HS400) ||
 +                  (ios->timing == MMC_TIMING_MMC_HS200) ||
                    (ios->timing == MMC_TIMING_MMC_DDR52) ||
                    (ios->timing == MMC_TIMING_UHS_SDR50) ||
                    (ios->timing == MMC_TIMING_UHS_SDR104) ||
@@@ -1899,7 -1862,6 +1899,7 @@@ static int sdhci_execute_tuning(struct 
         * tuning function has to be executed.
         */
        switch (host->timing) {
 +      case MMC_TIMING_MMC_HS400:
        case MMC_TIMING_MMC_HS200:
        case MMC_TIMING_UHS_SDR104:
                break;
@@@ -2182,10 -2144,9 +2182,10 @@@ static void sdhci_tasklet_finish(unsign
         */
        if (!(host->flags & SDHCI_DEVICE_DEAD) &&
            ((mrq->cmd && mrq->cmd->error) ||
 -               (mrq->data && (mrq->data->error ||
 -                (mrq->data->stop && mrq->data->stop->error))) ||
 -                 (host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) {
 +           (mrq->sbc && mrq->sbc->error) ||
 +           (mrq->data && ((mrq->data->error && !mrq->data->stop) ||
 +                          (mrq->data->stop && mrq->data->stop->error))) ||
 +           (host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) {
  
                /* Some controllers need this kick or reset won't work here */
                if (host->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET)
@@@ -2321,36 -2282,32 +2321,36 @@@ static void sdhci_cmd_irq(struct sdhci_
  }
  
  #ifdef CONFIG_MMC_DEBUG
 -static void sdhci_show_adma_error(struct sdhci_host *host)
 +static void sdhci_adma_show_error(struct sdhci_host *host)
  {
        const char *name = mmc_hostname(host->mmc);
 -      u8 *desc = host->adma_desc;
 -      __le32 *dma;
 -      __le16 *len;
 -      u8 attr;
 +      void *desc = host->adma_table;
  
        sdhci_dumpregs(host);
  
        while (true) {
 -              dma = (__le32 *)(desc + 4);
 -              len = (__le16 *)(desc + 2);
 -              attr = *desc;
 -
 -              DBG("%s: %p: DMA 0x%08x, LEN 0x%04x, Attr=0x%02x\n",
 -                  name, desc, le32_to_cpu(*dma), le16_to_cpu(*len), attr);
 +              struct sdhci_adma2_64_desc *dma_desc = desc;
 +
 +              if (host->flags & SDHCI_USE_64_BIT_DMA)
 +                      DBG("%s: %p: DMA 0x%08x%08x, LEN 0x%04x, Attr=0x%02x\n",
 +                          name, desc, le32_to_cpu(dma_desc->addr_hi),
 +                          le32_to_cpu(dma_desc->addr_lo),
 +                          le16_to_cpu(dma_desc->len),
 +                          le16_to_cpu(dma_desc->cmd));
 +              else
 +                      DBG("%s: %p: DMA 0x%08x, LEN 0x%04x, Attr=0x%02x\n",
 +                          name, desc, le32_to_cpu(dma_desc->addr_lo),
 +                          le16_to_cpu(dma_desc->len),
 +                          le16_to_cpu(dma_desc->cmd));
  
 -              desc += 8;
 +              desc += host->desc_sz;
  
 -              if (attr & 2)
 +              if (dma_desc->cmd & cpu_to_le16(ADMA2_END))
                        break;
        }
  }
  #else
 -static void sdhci_show_adma_error(struct sdhci_host *host) { }
 +static void sdhci_adma_show_error(struct sdhci_host *host) { }
  #endif
  
  static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
                host->data->error = -EILSEQ;
        else if (intmask & SDHCI_INT_ADMA_ERROR) {
                pr_err("%s: ADMA error\n", mmc_hostname(host->mmc));
 -              sdhci_show_adma_error(host);
 +              sdhci_adma_show_error(host);
                host->data->error = -EIO;
                if (host->ops->adma_workaround)
                        host->ops->adma_workaround(host, intmask);
@@@ -2697,9 -2654,6 +2697,6 @@@ int sdhci_resume_host(struct sdhci_hos
  }
  
  EXPORT_SYMBOL_GPL(sdhci_resume_host);
- #endif /* CONFIG_PM */
- #ifdef CONFIG_PM_RUNTIME
  
  static int sdhci_runtime_pm_get(struct sdhci_host *host)
  {
@@@ -2800,7 -2754,7 +2797,7 @@@ int sdhci_runtime_resume_host(struct sd
  }
  EXPORT_SYMBOL_GPL(sdhci_runtime_resume_host);
  
- #endif
+ #endif /* CONFIG_PM */
  
  /*****************************************************************************\
   *                                                                           *
@@@ -2892,16 -2846,6 +2889,16 @@@ int sdhci_add_host(struct sdhci_host *h
                host->flags &= ~SDHCI_USE_ADMA;
        }
  
 +      /*
 +       * It is assumed that a 64-bit capable device has set a 64-bit DMA mask
 +       * and *must* do 64-bit DMA.  A driver has the opportunity to change
 +       * that during the first call to ->enable_dma().  Similarly
 +       * SDHCI_QUIRK2_BROKEN_64_BIT_DMA must be left to the drivers to
 +       * implement.
 +       */
 +      if (sdhci_readl(host, SDHCI_CAPABILITIES) & SDHCI_CAN_64BIT)
 +              host->flags |= SDHCI_USE_64_BIT_DMA;
 +
        if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
                if (host->ops->enable_dma) {
                        if (host->ops->enable_dma(host)) {
                }
        }
  
 +      /* SDMA does not support 64-bit DMA */
 +      if (host->flags & SDHCI_USE_64_BIT_DMA)
 +              host->flags &= ~SDHCI_USE_SDMA;
 +
        if (host->flags & SDHCI_USE_ADMA) {
                /*
 -               * We need to allocate descriptors for all sg entries
 -               * (128) and potentially one alignment transfer for
 -               * each of those entries.
 +               * The DMA descriptor table size is calculated as the maximum
 +               * number of segments times 2, to allow for an alignment
 +               * descriptor for each segment, plus 1 for a nop end descriptor,
 +               * all multipled by the descriptor size.
                 */
 -              host->adma_desc = dma_alloc_coherent(mmc_dev(mmc),
 -                                                   ADMA_SIZE, &host->adma_addr,
 -                                                   GFP_KERNEL);
 -              host->align_buffer = kmalloc(128 * 4, GFP_KERNEL);
 -              if (!host->adma_desc || !host->align_buffer) {
 -                      dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
 -                                        host->adma_desc, host->adma_addr);
 +              if (host->flags & SDHCI_USE_64_BIT_DMA) {
 +                      host->adma_table_sz = (SDHCI_MAX_SEGS * 2 + 1) *
 +                                            SDHCI_ADMA2_64_DESC_SZ;
 +                      host->align_buffer_sz = SDHCI_MAX_SEGS *
 +                                              SDHCI_ADMA2_64_ALIGN;
 +                      host->desc_sz = SDHCI_ADMA2_64_DESC_SZ;
 +                      host->align_sz = SDHCI_ADMA2_64_ALIGN;
 +                      host->align_mask = SDHCI_ADMA2_64_ALIGN - 1;
 +              } else {
 +                      host->adma_table_sz = (SDHCI_MAX_SEGS * 2 + 1) *
 +                                            SDHCI_ADMA2_32_DESC_SZ;
 +                      host->align_buffer_sz = SDHCI_MAX_SEGS *
 +                                              SDHCI_ADMA2_32_ALIGN;
 +                      host->desc_sz = SDHCI_ADMA2_32_DESC_SZ;
 +                      host->align_sz = SDHCI_ADMA2_32_ALIGN;
 +                      host->align_mask = SDHCI_ADMA2_32_ALIGN - 1;
 +              }
 +              host->adma_table = dma_alloc_coherent(mmc_dev(mmc),
 +                                                    host->adma_table_sz,
 +                                                    &host->adma_addr,
 +                                                    GFP_KERNEL);
 +              host->align_buffer = kmalloc(host->align_buffer_sz, GFP_KERNEL);
 +              if (!host->adma_table || !host->align_buffer) {
 +                      dma_free_coherent(mmc_dev(mmc), host->adma_table_sz,
 +                                        host->adma_table, host->adma_addr);
                        kfree(host->align_buffer);
                        pr_warn("%s: Unable to allocate ADMA buffers - falling back to standard DMA\n",
                                mmc_hostname(mmc));
                        host->flags &= ~SDHCI_USE_ADMA;
 -                      host->adma_desc = NULL;
 +                      host->adma_table = NULL;
                        host->align_buffer = NULL;
 -              } else if (host->adma_addr & 3) {
 +              } else if (host->adma_addr & host->align_mask) {
                        pr_warn("%s: unable to allocate aligned ADMA descriptor\n",
                                mmc_hostname(mmc));
                        host->flags &= ~SDHCI_USE_ADMA;
 -                      dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
 -                                        host->adma_desc, host->adma_addr);
 +                      dma_free_coherent(mmc_dev(mmc), host->adma_table_sz,
 +                                        host->adma_table, host->adma_addr);
                        kfree(host->align_buffer);
 -                      host->adma_desc = NULL;
 +                      host->adma_table = NULL;
                        host->align_buffer = NULL;
                }
        }
                if (ret) {
                        pr_warn("%s: Failed to enable vqmmc regulator: %d\n",
                                mmc_hostname(mmc), ret);
 -                      mmc->supply.vqmmc = NULL;
 +                      mmc->supply.vqmmc = ERR_PTR(-EINVAL);
                }
        }
  
                /* SD3.0: SDR104 is supported so (for eMMC) the caps2
                 * field can be promoted to support HS200.
                 */
 -              if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200)) {
 +              if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200))
                        mmc->caps2 |= MMC_CAP2_HS200;
 -                      if (IS_ERR(mmc->supply.vqmmc) ||
 -                                      !regulator_is_supported_voltage
 -                                      (mmc->supply.vqmmc, 1100000, 1300000))
 -                              mmc->caps2 &= ~MMC_CAP2_HS200_1_2V_SDR;
 -              }
        } else if (caps[1] & SDHCI_SUPPORT_SDR50)
                mmc->caps |= MMC_CAP_UHS_SDR50;
  
 +      if (host->quirks2 & SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 &&
 +          (caps[1] & SDHCI_SUPPORT_HS400))
 +              mmc->caps2 |= MMC_CAP2_HS400;
 +
 +      if ((mmc->caps2 & MMC_CAP2_HSX00_1_2V) &&
 +          (IS_ERR(mmc->supply.vqmmc) ||
 +           !regulator_is_supported_voltage(mmc->supply.vqmmc, 1100000,
 +                                           1300000)))
 +              mmc->caps2 &= ~MMC_CAP2_HSX00_1_2V;
 +
        if ((caps[1] & SDHCI_SUPPORT_DDR50) &&
                !(host->quirks2 & SDHCI_QUIRK2_BROKEN_DDR50))
                mmc->caps |= MMC_CAP_UHS_DDR50;
         * can do scatter/gather or not.
         */
        if (host->flags & SDHCI_USE_ADMA)
 -              mmc->max_segs = 128;
 +              mmc->max_segs = SDHCI_MAX_SEGS;
        else if (host->flags & SDHCI_USE_SDMA)
                mmc->max_segs = 1;
        else /* PIO */
 -              mmc->max_segs = 128;
 +              mmc->max_segs = SDHCI_MAX_SEGS;
  
        /*
         * Maximum number of sectors in one transfer. Limited by DMA boundary
  
        pr_info("%s: SDHCI controller on %s [%s] using %s\n",
                mmc_hostname(mmc), host->hw_name, dev_name(mmc_dev(mmc)),
 -              (host->flags & SDHCI_USE_ADMA) ? "ADMA" :
 +              (host->flags & SDHCI_USE_ADMA) ?
 +              (host->flags & SDHCI_USE_64_BIT_DMA) ? "ADMA 64-bit" : "ADMA" :
                (host->flags & SDHCI_USE_SDMA) ? "DMA" : "PIO");
  
        sdhci_enable_card_detection(host);
@@@ -3421,15 -3336,18 +3418,15 @@@ void sdhci_remove_host(struct sdhci_hos
  
        tasklet_kill(&host->finish_tasklet);
  
 -      if (!IS_ERR(mmc->supply.vmmc))
 -              regulator_disable(mmc->supply.vmmc);
 -
        if (!IS_ERR(mmc->supply.vqmmc))
                regulator_disable(mmc->supply.vqmmc);
  
 -      if (host->adma_desc)
 -              dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
 -                                host->adma_desc, host->adma_addr);
 +      if (host->adma_table)
 +              dma_free_coherent(mmc_dev(mmc), host->adma_table_sz,
 +                                host->adma_table, host->adma_addr);
        kfree(host->align_buffer);
  
 -      host->adma_desc = NULL;
 +      host->adma_table = NULL;
        host->align_buffer = NULL;
  }
  
diff --combined drivers/mmc/host/sdhci.h
index ddd31cda2370f39ed2a8682c165cffd3da97efb7,912b260f9d2c84c2a3f9c518ff8cf10844937632..41a2c34299ed8be98122439a30710cdf8504d76a
  #define   SDHCI_CTRL_UHS_SDR50                0x0002
  #define   SDHCI_CTRL_UHS_SDR104               0x0003
  #define   SDHCI_CTRL_UHS_DDR50                0x0004
 -#define   SDHCI_CTRL_HS_SDR200                0x0005 /* reserved value in SDIO spec */
 +#define   SDHCI_CTRL_HS400            0x0005 /* Non-standard */
  #define  SDHCI_CTRL_VDD_180           0x0008
  #define  SDHCI_CTRL_DRV_TYPE_MASK     0x0030
  #define   SDHCI_CTRL_DRV_TYPE_B               0x0000
  #define  SDHCI_RETUNING_MODE_SHIFT            14
  #define  SDHCI_CLOCK_MUL_MASK 0x00FF0000
  #define  SDHCI_CLOCK_MUL_SHIFT        16
 +#define  SDHCI_SUPPORT_HS400  0x80000000 /* Non-standard */
  
  #define SDHCI_CAPABILITIES_1  0x44
  
  /* 55-57 reserved */
  
  #define SDHCI_ADMA_ADDRESS    0x58
 +#define SDHCI_ADMA_ADDRESS_HI 0x5C
  
  /* 60-FB reserved */
  
  #define SDHCI_PRESET_FOR_SDR50 0x6A
  #define SDHCI_PRESET_FOR_SDR104        0x6C
  #define SDHCI_PRESET_FOR_DDR50 0x6E
 +#define SDHCI_PRESET_FOR_HS400 0x74 /* Non-standard */
  #define SDHCI_PRESET_DRV_MASK  0xC000
  #define SDHCI_PRESET_DRV_SHIFT  14
  #define SDHCI_PRESET_CLKGEN_SEL_MASK   0x400
  #define SDHCI_DEFAULT_BOUNDARY_SIZE  (512 * 1024)
  #define SDHCI_DEFAULT_BOUNDARY_ARG   (ilog2(SDHCI_DEFAULT_BOUNDARY_SIZE) - 12)
  
 +/* ADMA2 32-bit DMA descriptor size */
 +#define SDHCI_ADMA2_32_DESC_SZ        8
 +
 +/* ADMA2 32-bit DMA alignment */
 +#define SDHCI_ADMA2_32_ALIGN  4
 +
 +/* ADMA2 32-bit descriptor */
 +struct sdhci_adma2_32_desc {
 +      __le16  cmd;
 +      __le16  len;
 +      __le32  addr;
 +}  __packed __aligned(SDHCI_ADMA2_32_ALIGN);
 +
 +/* ADMA2 64-bit DMA descriptor size */
 +#define SDHCI_ADMA2_64_DESC_SZ        12
 +
 +/* ADMA2 64-bit DMA alignment */
 +#define SDHCI_ADMA2_64_ALIGN  8
 +
 +/*
 + * ADMA2 64-bit descriptor. Note 12-byte descriptor can't always be 8-byte
 + * aligned.
 + */
 +struct sdhci_adma2_64_desc {
 +      __le16  cmd;
 +      __le16  len;
 +      __le32  addr_lo;
 +      __le32  addr_hi;
 +}  __packed __aligned(4);
 +
 +#define ADMA2_TRAN_VALID      0x21
 +#define ADMA2_NOP_END_VALID   0x3
 +#define ADMA2_END             0x2
 +
 +/*
 + * Maximum segments assuming a 512KiB maximum requisition size and a minimum
 + * 4KiB page size.
 + */
 +#define SDHCI_MAX_SEGS                128
 +
  struct sdhci_ops {
  #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
        u32             (*read_l)(struct sdhci_host *host, int reg);
@@@ -454,9 -411,6 +454,6 @@@ void sdhci_set_uhs_signaling(struct sdh
  extern int sdhci_suspend_host(struct sdhci_host *host);
  extern int sdhci_resume_host(struct sdhci_host *host);
  extern void sdhci_enable_irq_wakeups(struct sdhci_host *host);
- #endif
- #ifdef CONFIG_PM_RUNTIME
  extern int sdhci_runtime_suspend_host(struct sdhci_host *host);
  extern int sdhci_runtime_resume_host(struct sdhci_host *host);
  #endif
diff --combined drivers/pci/pci-sysfs.c
index a5addbc9c026a1c5c874904879641766b4eac117,5c21e81b7caf351dd7aef16ae9b7bc4c6aba45ec..a62acc443d5bfa42ab82b45696de6f14b26cd75b
@@@ -221,37 -221,12 +221,37 @@@ static ssize_t enable_show(struct devic
  static DEVICE_ATTR_RW(enable);
  
  #ifdef CONFIG_NUMA
 +static ssize_t numa_node_store(struct device *dev,
 +                             struct device_attribute *attr, const char *buf,
 +                             size_t count)
 +{
 +      struct pci_dev *pdev = to_pci_dev(dev);
 +      int node, ret;
 +
 +      if (!capable(CAP_SYS_ADMIN))
 +              return -EPERM;
 +
 +      ret = kstrtoint(buf, 0, &node);
 +      if (ret)
 +              return ret;
 +
 +      if (!node_online(node))
 +              return -EINVAL;
 +
 +      add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
 +      dev_alert(&pdev->dev, FW_BUG "Overriding NUMA node to %d.  Contact your vendor for updates.",
 +                node);
 +
 +      dev->numa_node = node;
 +      return count;
 +}
 +
  static ssize_t numa_node_show(struct device *dev, struct device_attribute *attr,
                              char *buf)
  {
        return sprintf(buf, "%d\n", dev->numa_node);
  }
 -static DEVICE_ATTR_RO(numa_node);
 +static DEVICE_ATTR_RW(numa_node);
  #endif
  
  static ssize_t dma_mask_bits_show(struct device *dev,
@@@ -410,7 -385,7 +410,7 @@@ static ssize_t dev_bus_rescan_store(str
  }
  static DEVICE_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, dev_bus_rescan_store);
  
- #if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI)
+ #if defined(CONFIG_PM) && defined(CONFIG_ACPI)
  static ssize_t d3cold_allowed_store(struct device *dev,
                                    struct device_attribute *attr,
                                    const char *buf, size_t count)
@@@ -591,7 -566,7 +591,7 @@@ static struct attribute *pci_dev_attrs[
        &dev_attr_enable.attr,
        &dev_attr_broken_parity_status.attr,
        &dev_attr_msi_bus.attr,
- #if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI)
+ #if defined(CONFIG_PM) && defined(CONFIG_ACPI)
        &dev_attr_d3cold_allowed.attr,
  #endif
  #ifdef CONFIG_OF
diff --combined include/linux/blkdev.h
index 6d76b8b4aa2b04bb36add2778d42dd2bdce2a891,534dc402c54fff4c8a0871ce913637e4f12e8a64..0495e38542479b9abe4bf770cf8bb31f9e94dc38
@@@ -398,7 -398,7 +398,7 @@@ struct request_queue 
         */
        struct kobject mq_kobj;
  
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
        struct device           *dev;
        int                     rpm_status;
        unsigned int            nr_pending;
@@@ -1057,7 -1057,7 +1057,7 @@@ extern void blk_put_queue(struct reques
  /*
   * block layer runtime pm functions
   */
- #ifdef CONFIG_PM_RUNTIME
+ #ifdef CONFIG_PM
  extern void blk_pm_runtime_init(struct request_queue *q, struct device *dev);
  extern int blk_pre_runtime_suspend(struct request_queue *q);
  extern void blk_post_runtime_suspend(struct request_queue *q, int err);
@@@ -1136,6 -1136,7 +1136,6 @@@ static inline bool blk_needs_flush_plug
  /*
   * tag stuff
   */
 -#define blk_rq_tagged(rq)             ((rq)->cmd_flags & REQ_QUEUED)
  extern int blk_queue_start_tag(struct request_queue *, struct request *);
  extern struct request *blk_queue_find_tag(struct request_queue *, int);
  extern void blk_queue_end_tag(struct request_queue *, struct request *);
diff --combined include/linux/of.h
index c55b50018ac4316c7874c2a5bf43f51a67296a4b,cf79be1441d2cceab4fcfdf409ac970599b9ca93..1a66b8881c014edd40cde924d8ca954c0e6a66c7
@@@ -23,6 -23,7 +23,7 @@@
  #include <linux/spinlock.h>
  #include <linux/topology.h>
  #include <linux/notifier.h>
+ #include <linux/property.h>
  
  #include <asm/byteorder.h>
  #include <asm/errno.h>
@@@ -49,6 -50,7 +50,7 @@@ struct device_node 
        const char *type;
        phandle phandle;
        const char *full_name;
+       struct fwnode_handle fwnode;
  
        struct  property *properties;
        struct  property *deadprops;    /* removed properties */
@@@ -79,6 -81,7 +81,7 @@@ extern struct kobj_type of_node_ktype
  static inline void of_node_init(struct device_node *node)
  {
        kobject_init(&node->kobj, &of_node_ktype);
+       node->fwnode.type = FWNODE_OF;
  }
  
  /* true when node is initialized */
@@@ -114,6 -117,16 +117,16 @@@ extern struct device_node *of_aliases
  extern struct device_node *of_stdout;
  extern raw_spinlock_t devtree_lock;
  
+ static inline bool is_of_node(struct fwnode_handle *fwnode)
+ {
+       return fwnode && fwnode->type == FWNODE_OF;
+ }
+ static inline struct device_node *of_node(struct fwnode_handle *fwnode)
+ {
+       return fwnode ? container_of(fwnode, struct device_node, fwnode) : NULL;
+ }
  static inline bool of_have_populated_dt(void)
  {
        return of_allnodes != NULL;
@@@ -263,6 -276,10 +276,10 @@@ extern int of_property_read_u32_array(c
                                      size_t sz);
  extern int of_property_read_u64(const struct device_node *np,
                                const char *propname, u64 *out_value);
+ extern int of_property_read_u64_array(const struct device_node *np,
+                                     const char *propname,
+                                     u64 *out_values,
+                                     size_t sz);
  
  extern int of_property_read_string(struct device_node *np,
                                   const char *propname,
@@@ -355,6 -372,16 +372,16 @@@ bool of_console_check(struct device_nod
  
  #else /* CONFIG_OF */
  
+ static inline bool is_of_node(struct fwnode_handle *fwnode)
+ {
+       return false;
+ }
+ static inline struct device_node *of_node(struct fwnode_handle *fwnode)
+ {
+       return NULL;
+ }
  static inline const char* of_node_full_name(const struct device_node *np)
  {
        return "<no-node>";
@@@ -477,6 -504,13 +504,13 @@@ static inline int of_property_read_u32_
        return -ENOSYS;
  }
  
+ static inline int of_property_read_u64_array(const struct device_node *np,
+                                            const char *propname,
+                                            u64 *out_values, size_t sz)
+ {
+       return -ENOSYS;
+ }
  static inline int of_property_read_string(struct device_node *np,
                                          const char *propname,
                                          const char **out_string)
@@@ -922,15 -956,4 +956,15 @@@ static inline int of_changeset_update_p
  /* CONFIG_OF_RESOLVE api */
  extern int of_resolve_phandles(struct device_node *tree);
  
 +/**
 + * of_device_is_system_power_controller - Tells if system-power-controller is found for device_node
 + * @np: Pointer to the given device_node
 + *
 + * return true if present false otherwise
 + */
 +static inline bool of_device_is_system_power_controller(const struct device_node *np)
 +{
 +      return of_property_read_bool(np, "system-power-controller");
 +}
 +
  #endif /* _LINUX_OF_H */
This page took 0.243341 seconds and 4 git commands to generate.