Merge branches 'pm-cpuidle' and 'pm-devfreq'
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 13 Oct 2020 12:39:52 +0000 (14:39 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 13 Oct 2020 12:39:52 +0000 (14:39 +0200)
* pm-cpuidle:
  cpuidle: record state entry rejection statistics
  cpuidle: psci: Allow PM domain to be initialized even if no OSI mode
  firmware: psci: Extend psci_set_osi_mode() to allow reset to PC mode
  ACPI: processor: Print more information when acpi_processor_evaluate_cst() fails
  cpuidle: tegra: Correctly handle result of arm_cpuidle_simple_enter()

* pm-devfreq:
  PM / devfreq: tegra30: Improve initial hardware resetting
  PM / devfreq: event: Change prototype of devfreq_event_get_edev_by_phandle function
  PM / devfreq: Change prototype of devfreq_get_devfreq_by_phandle function
  PM / devfreq: Add devfreq_get_devfreq_by_node function

144 files changed:
Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.txt
Documentation/devicetree/bindings/crypto/ti,sa2ul.yaml
Documentation/devicetree/bindings/display/xlnx/xlnx,zynqmp-dpsub.yaml
Documentation/devicetree/bindings/dma/xilinx/xlnx,zynqmp-dpdma.yaml
Documentation/devicetree/bindings/gpio/sgpio-aspeed.txt
Documentation/devicetree/bindings/leds/cznic,turris-omnia-leds.yaml
Documentation/devicetree/bindings/opp/opp.txt
MAINTAINERS
Makefile
arch/arm/boot/dts/bcm2835-rpi.dtsi
arch/arm/boot/dts/tegra20-cpu-opp-microvolt.dtsi
arch/arm/boot/dts/tegra20-cpu-opp.dtsi
arch/arm/boot/dts/tegra30-cpu-opp-microvolt.dtsi
arch/arm/boot/dts/tegra30-cpu-opp.dtsi
arch/arm/include/asm/topology.h
arch/arm64/include/asm/topology.h
arch/arm64/kernel/acpi.c
arch/arm64/kernel/topology.c
arch/arm64/kvm/hyp/nvhe/tlb.c
arch/riscv/include/asm/stackprotector.h
arch/riscv/include/asm/timex.h
arch/x86/kvm/vmx/vmx.c
block/blk-mq.c
drivers/base/arch_topology.c
drivers/base/power/domain.c
drivers/clk/samsung/clk-exynos4.c
drivers/clk/samsung/clk-exynos5420.c
drivers/clk/socfpga/clk-s10.c
drivers/clk/tegra/clk-pll.c
drivers/clk/tegra/clk-tegra210-emc.c
drivers/clocksource/timer-clint.c
drivers/cpufreq/Kconfig.arm
drivers/cpufreq/armada-37xx-cpufreq.c
drivers/cpufreq/cpufreq-dt-platdev.c
drivers/cpufreq/cpufreq-dt.c
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq_stats.c
drivers/cpufreq/imx6q-cpufreq.c
drivers/cpufreq/intel_pstate.c
drivers/cpufreq/qcom-cpufreq-hw.c
drivers/cpufreq/s5pv210-cpufreq.c
drivers/cpufreq/scmi-cpufreq.c
drivers/cpufreq/scpi-cpufreq.c
drivers/cpufreq/sti-cpufreq.c
drivers/cpufreq/tegra186-cpufreq.c
drivers/cpufreq/vexpress-spc-cpufreq.c
drivers/devfreq/devfreq-event.c
drivers/devfreq/devfreq.c
drivers/devfreq/exynos-bus.c
drivers/devfreq/rk3399_dmc.c
drivers/devfreq/tegra30-devfreq.c
drivers/dma/dmatest.c
drivers/gpio/gpio-amd-fch.c
drivers/gpio/gpio-aspeed-sgpio.c
drivers/gpio/gpio-aspeed.c
drivers/gpio/gpio-mockup.c
drivers/gpio/gpio-omap.c
drivers/gpio/gpio-pca953x.c
drivers/gpio/gpio-siox.c
drivers/gpio/gpio-sprd.c
drivers/gpio/gpio-tc3589x.c
drivers/gpio/gpiolib-cdev.c
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c
drivers/gpu/drm/amd/display/dc/dcn30/Makefile
drivers/gpu/drm/amd/include/asic_reg/gc/gc_10_3_0_default.h
drivers/gpu/drm/amd/include/asic_reg/gc/gc_10_3_0_offset.h
drivers/gpu/drm/amd/include/asic_reg/gc/gc_10_3_0_sh_mask.h
drivers/gpu/drm/amd/include/asic_reg/vcn/vcn_3_0_0_sh_mask.h
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
drivers/gpu/drm/amd/powerplay/renoir_ppt.c
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
drivers/gpu/drm/vmwgfx/vmwgfx_thp.c
drivers/i2c/busses/i2c-cpm.c
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-npcm7xx.c
drivers/iio/adc/ad7124.c
drivers/iio/adc/qcom-spmi-adc5.c
drivers/input/mouse/trackpoint.c
drivers/input/serio/i8042-x86ia64io.h
drivers/iommu/amd/init.c
drivers/iommu/exynos-iommu.c
drivers/iommu/intel/iommu.c
drivers/memory/samsung/exynos5422-dmc.c
drivers/memstick/core/memstick.c
drivers/mmc/host/sdhci-pci-core.c
drivers/opp/core.c
drivers/opp/cpu.c
drivers/opp/of.c
drivers/opp/opp.h
drivers/pci/controller/pcie-rockchip-host.c
drivers/phy/ti/phy-am654-serdes.c
drivers/pinctrl/intel/pinctrl-cherryview.c
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
drivers/pinctrl/mvebu/pinctrl-armada-xp.c
drivers/pinctrl/qcom/pinctrl-sm8250.c
drivers/scsi/iscsi_tcp.c
drivers/soc/samsung/exynos-asv.c
drivers/target/target_core_transport.c
drivers/usb/core/driver.c
drivers/usb/gadget/function/f_ncm.c
drivers/usb/usbip/stub_dev.c
drivers/vhost/iotlb.c
drivers/vhost/vdpa.c
drivers/xen/events/events_base.c
fs/autofs/waitq.c
fs/btrfs/dev-replace.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h
fs/eventpoll.c
fs/io_uring.c
fs/nfs/dir.c
fs/nfs/flexfilelayout/flexfilelayout.c
fs/nfs/nfs42proc.c
fs/pipe.c
fs/read_write.c
fs/splice.c
include/linux/acpi.h
include/linux/arch_topology.h
include/linux/cpufreq.h
include/linux/devfreq-event.h
include/linux/devfreq.h
include/linux/memstick.h
include/linux/nfs_xdr.h
include/linux/pipe_fs_i.h
include/linux/vmstat.h
kernel/sched/cpufreq_schedutil.c
kernel/trace/ftrace.c
kernel/trace/trace.c
lib/random32.c
mm/filemap.c
mm/gup.c
mm/page_alloc.c
mm/slub.c
scripts/dtc/Makefile
scripts/spelling.txt

index 17e4f20..6834f5e 100644 (file)
@@ -23,7 +23,7 @@ properties:
   compatible:
     items:
       - const: raspberrypi,bcm2835-firmware
-      - const: simple-bus
+      - const: simple-mfd
 
   mboxes:
     $ref: '/schemas/types.yaml#/definitions/phandle'
@@ -57,7 +57,7 @@ required:
 examples:
   - |
     firmware {
-        compatible = "raspberrypi,bcm2835-firmware", "simple-bus";
+        compatible = "raspberrypi,bcm2835-firmware", "simple-mfd";
         mboxes = <&mailbox>;
 
         firmware_clocks: clocks {
index 3385694..9299028 100644 (file)
@@ -8,7 +8,7 @@ Properties:
 - compatible
        Usage:          required
        Value type:     <string>
-       Definition:     must be "qcom,cpufreq-hw".
+       Definition:     must be "qcom,cpufreq-hw" or "qcom,cpufreq-epss".
 
 - clocks
        Usage:          required
index 85ef69f..1465c9e 100644 (file)
@@ -67,7 +67,7 @@ examples:
 
     main_crypto: crypto@4e00000 {
         compatible = "ti,j721-sa2ul";
-        reg = <0x0 0x4e00000 0x0 0x1200>;
+        reg = <0x4e00000 0x1200>;
         power-domains = <&k3_pds 264 TI_SCI_PD_EXCLUSIVE>;
         dmas = <&main_udmap 0xc000>, <&main_udmap 0x4000>,
                <&main_udmap 0x4001>;
index 52a939c..7b9d468 100644 (file)
@@ -145,10 +145,10 @@ examples:
 
     display@fd4a0000 {
         compatible = "xlnx,zynqmp-dpsub-1.7";
-        reg = <0x0 0xfd4a0000 0x0 0x1000>,
-              <0x0 0xfd4aa000 0x0 0x1000>,
-              <0x0 0xfd4ab000 0x0 0x1000>,
-              <0x0 0xfd4ac000 0x0 0x1000>;
+        reg = <0xfd4a0000 0x1000>,
+              <0xfd4aa000 0x1000>,
+              <0xfd4ab000 0x1000>,
+              <0xfd4ac000 0x1000>;
         reg-names = "dp", "blend", "av_buf", "aud";
         interrupts = <0 119 4>;
         interrupt-parent = <&gic>;
index 5de510f..2a595b1 100644 (file)
@@ -57,7 +57,7 @@ examples:
 
     dma: dma-controller@fd4c0000 {
       compatible = "xlnx,zynqmp-dpdma";
-      reg = <0x0 0xfd4c0000 0x0 0x1000>;
+      reg = <0xfd4c0000 0x1000>;
       interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
       interrupt-parent = <&gic>;
       clocks = <&dpdma_clk>;
index d4d8391..be329ea 100644 (file)
@@ -20,8 +20,9 @@ Required properties:
 - gpio-controller : Marks the device node as a GPIO controller
 - interrupts : Interrupt specifier, see interrupt-controller/interrupts.txt
 - interrupt-controller : Mark the GPIO controller as an interrupt-controller
-- ngpios : number of GPIO lines, see gpio.txt
-  (should be multiple of 8, up to 80 pins)
+- ngpios : number of *hardware* GPIO lines, see gpio.txt. This will expose
+  2 software GPIOs per hardware GPIO: one for hardware input, one for hardware
+  output. Up to 80 pins, must be a multiple of 8.
 - clocks : A phandle to the APB clock for SGPM clock division
 - bus-frequency : SGPM CLK frequency
 
index 24ad144..fe7fa25 100644 (file)
@@ -30,7 +30,7 @@ properties:
     const: 0
 
 patternProperties:
-  "^multi-led[0-9a-f]$":
+  "^multi-led@[0-9a-b]$":
     type: object
     allOf:
       - $ref: leds-class-multicolor.yaml#
index 9d16d41..9847dfe 100644 (file)
@@ -154,25 +154,27 @@ Optional properties:
 - opp-suspend: Marks the OPP to be used during device suspend. If multiple OPPs
   in the table have this, the OPP with highest opp-hz will be used.
 
-- opp-supported-hw: This enables us to select only a subset of OPPs from the
-  larger OPP table, based on what version of the hardware we are running on. We
-  still can't have multiple nodes with the same opp-hz value in OPP table.
-
-  It's a user defined array containing a hierarchy of hardware version numbers,
-  supported by the OPP. For example: a platform with hierarchy of three levels
-  of versions (A, B and C), this field should be like <X Y Z>, where X
-  corresponds to Version hierarchy A, Y corresponds to version hierarchy B and Z
-  corresponds to version hierarchy C.
-
-  Each level of hierarchy is represented by a 32 bit value, and so there can be
-  only 32 different supported version per hierarchy. i.e. 1 bit per version. A
-  value of 0xFFFFFFFF will enable the OPP for all versions for that hierarchy
-  level. And a value of 0x00000000 will disable the OPP completely, and so we
-  never want that to happen.
-
-  If 32 values aren't sufficient for a version hierarchy, than that version
-  hierarchy can be contained in multiple 32 bit values. i.e. <X Y Z1 Z2> in the
-  above example, Z1 & Z2 refer to the version hierarchy Z.
+- opp-supported-hw: This property allows a platform to enable only a subset of
+  the OPPs from the larger set present in the OPP table, based on the current
+  version of the hardware (already known to the operating system).
+
+  Each block present in the array of blocks in this property, represents a
+  sub-group of hardware versions supported by the OPP. i.e. <sub-group A>,
+  <sub-group B>, etc. The OPP will be enabled if _any_ of these sub-groups match
+  the hardware's version.
+
+  Each sub-group is a platform defined array representing the hierarchy of
+  hardware versions supported by the platform. For a platform with three
+  hierarchical levels of version (X.Y.Z), this field shall look like
+
+  opp-supported-hw = <X1 Y1 Z1>, <X2 Y2 Z2>, <X3 Y3 Z3>.
+
+  Each level (eg. X1) in version hierarchy is represented by a 32 bit value, one
+  bit per version and so there can be maximum 32 versions per level. Logical AND
+  (&) operation is performed for each level with the hardware's level version
+  and a non-zero output for _all_ the levels in a sub-group means the OPP is
+  supported by hardware. A value of 0xFFFFFFFF for each level in the sub-group
+  will enable the OPP for all versions for the hardware.
 
 - status: Marks the node enabled/disabled.
 
@@ -503,7 +505,6 @@ Example 5: opp-supported-hw
                         */
                        opp-supported-hw = <0xF 0xFFFFFFFF 0xFFFFFFFF>
                        opp-hz = /bits/ 64 <600000000>;
-                       opp-microvolt = <915000 900000 925000>;
                        ...
                };
 
@@ -516,7 +517,17 @@ Example 5: opp-supported-hw
                         */
                        opp-supported-hw = <0x20 0xff0000ff 0x0000f4f0>
                        opp-hz = /bits/ 64 <800000000>;
-                       opp-microvolt = <915000 900000 925000>;
+                       ...
+               };
+
+               opp-900000000 {
+                       /*
+                        * Supports:
+                        * - All cuts and substrate where process version is 0x2.
+                        * - All cuts and process where substrate version is 0x2.
+                        */
+                       opp-supported-hw = <0xFFFFFFFF 0xFFFFFFFF 0x02>, <0xFFFFFFFF 0x01 0xFFFFFFFF>
+                       opp-hz = /bits/ 64 <900000000>;
                        ...
                };
        };
index 190c7fa..33b27e6 100644 (file)
@@ -13182,6 +13182,7 @@ F:      drivers/firmware/pcdp.*
 
 PCI DRIVER FOR AARDVARK (Marvell Armada 3700)
 M:     Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+M:     Pali Rohár <pali@kernel.org>
 L:     linux-pci@vger.kernel.org
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
index 992d244..f84d7e4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
 VERSION = 5
 PATCHLEVEL = 9
 SUBLEVEL = 0
-EXTRAVERSION = -rc7
+EXTRAVERSION = -rc8
 NAME = Kleptomaniac Octopus
 
 # *DOCUMENTATION*
index f7ae5a4..d94357b 100644 (file)
@@ -13,7 +13,7 @@
 
        soc {
                firmware: firmware {
-                       compatible = "raspberrypi,bcm2835-firmware", "simple-bus";
+                       compatible = "raspberrypi,bcm2835-firmware", "simple-mfd";
                        #address-cells = <1>;
                        #size-cells = <1>;
 
index dce85d3..6f3e8c5 100644 (file)
                        opp-microvolt = <800000 800000 1125000>;
                };
 
-               opp@456000000,800,2,2 {
-                       opp-microvolt = <800000 800000 1125000>;
-               };
-
-               opp@456000000,800,3,2 {
-                       opp-microvolt = <800000 800000 1125000>;
-               };
-
                opp@456000000,825 {
                        opp-microvolt = <825000 825000 1125000>;
                };
                        opp-microvolt = <800000 800000 1125000>;
                };
 
-               opp@608000000,800,3,2 {
-                       opp-microvolt = <800000 800000 1125000>;
-               };
-
                opp@608000000,825 {
                        opp-microvolt = <825000 825000 1125000>;
                };
                        opp-microvolt = <875000 875000 1125000>;
                };
 
-               opp@760000000,875,1,1 {
-                       opp-microvolt = <875000 875000 1125000>;
-               };
-
-               opp@760000000,875,0,2 {
-                       opp-microvolt = <875000 875000 1125000>;
-               };
-
-               opp@760000000,875,1,2 {
-                       opp-microvolt = <875000 875000 1125000>;
-               };
-
                opp@760000000,900 {
                        opp-microvolt = <900000 900000 1125000>;
                };
                        opp-microvolt = <950000 950000 1125000>;
                };
 
-               opp@912000000,950,0,2 {
-                       opp-microvolt = <950000 950000 1125000>;
-               };
-
-               opp@912000000,950,2,2 {
-                       opp-microvolt = <950000 950000 1125000>;
-               };
-
                opp@912000000,1000 {
                        opp-microvolt = <1000000 1000000 1125000>;
                };
                        opp-microvolt = <1000000 1000000 1125000>;
                };
 
-               opp@1000000000,1000,0,2 {
-                       opp-microvolt = <1000000 1000000 1125000>;
-               };
-
                opp@1000000000,1025 {
                        opp-microvolt = <1025000 1025000 1125000>;
                };
index 9b8fedb..702a635 100644 (file)
 
                opp@456000000,800 {
                        clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x03 0x0006>;
-                       opp-hz = /bits/ 64 <456000000>;
-               };
-
-               opp@456000000,800,2,2 {
-                       clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x04 0x0004>;
-                       opp-hz = /bits/ 64 <456000000>;
-               };
-
-               opp@456000000,800,3,2 {
-                       clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x08 0x0004>;
+                       opp-supported-hw = <0x03 0x0006>, <0x04 0x0004>,
+                                          <0x08 0x0004>;
                        opp-hz = /bits/ 64 <456000000>;
                };
 
 
                opp@608000000,800 {
                        clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x04 0x0006>;
-                       opp-hz = /bits/ 64 <608000000>;
-               };
-
-               opp@608000000,800,3,2 {
-                       clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x08 0x0004>;
+                       opp-supported-hw = <0x04 0x0006>, <0x08 0x0004>;
                        opp-hz = /bits/ 64 <608000000>;
                };
 
 
                opp@760000000,875 {
                        clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x04 0x0001>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,875,1,1 {
-                       clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x02 0x0002>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,875,0,2 {
-                       clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x01 0x0004>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,875,1,2 {
-                       clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x02 0x0004>;
+                       opp-supported-hw = <0x04 0x0001>, <0x02 0x0002>,
+                                          <0x01 0x0004>, <0x02 0x0004>;
                        opp-hz = /bits/ 64 <760000000>;
                };
 
 
                opp@912000000,950 {
                        clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x02 0x0006>;
-                       opp-hz = /bits/ 64 <912000000>;
-               };
-
-               opp@912000000,950,0,2 {
-                       clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x01 0x0004>;
-                       opp-hz = /bits/ 64 <912000000>;
-               };
-
-               opp@912000000,950,2,2 {
-                       clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x04 0x0004>;
+                       opp-supported-hw = <0x02 0x0006>, <0x01 0x0004>,
+                                          <0x04 0x0004>;
                        opp-hz = /bits/ 64 <912000000>;
                };
 
 
                opp@1000000000,1000 {
                        clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x02 0x0006>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,1000,0,2 {
-                       clock-latency-ns = <400000>;
-                       opp-supported-hw = <0x01 0x0004>;
+                       opp-supported-hw = <0x02 0x0006>, <0x01 0x0004>;
                        opp-hz = /bits/ 64 <1000000000>;
                };
 
index d682f74..1be715d 100644 (file)
                        opp-microvolt = <850000 850000 1250000>;
                };
 
-               opp@475000000,850,0,1 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@475000000,850,0,4 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@475000000,850,0,7 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@475000000,850,0,8 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
                opp@608000000,850 {
                        opp-microvolt = <850000 850000 1250000>;
                };
                        opp-microvolt = <850000 850000 1250000>;
                };
 
-               opp@640000000,850,1,1 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,2,1 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,3,1 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,1,4 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,2,4 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,3,4 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,1,7 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,2,7 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,3,7 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,4,7 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,1,8 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,2,8 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,3,8 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@640000000,850,4,8 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
                opp@640000000,900 {
                        opp-microvolt = <900000 900000 1250000>;
                };
                        opp-microvolt = <850000 850000 1250000>;
                };
 
-               opp@760000000,850,3,1 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@760000000,850,3,2 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@760000000,850,3,3 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@760000000,850,3,4 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@760000000,850,3,7 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@760000000,850,4,7 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@760000000,850,3,8 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@760000000,850,4,8 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
-               opp@760000000,850,0,10 {
-                       opp-microvolt = <850000 850000 1250000>;
-               };
-
                opp@760000000,900 {
                        opp-microvolt = <900000 900000 1250000>;
                };
 
-               opp@760000000,900,1,1 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@760000000,900,2,1 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@760000000,900,1,2 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@760000000,900,2,2 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@760000000,900,1,3 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@760000000,900,2,3 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@760000000,900,1,4 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@760000000,900,2,4 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@760000000,900,1,7 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@760000000,900,2,7 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@760000000,900,1,8 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@760000000,900,2,8 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
                opp@760000000,912 {
                        opp-microvolt = <912000 912000 1250000>;
                };
                        opp-microvolt = <900000 900000 1250000>;
                };
 
-               opp@860000000,900,2,1 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,3,1 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,2,2 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,3,2 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,2,3 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,3,3 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,2,4 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,3,4 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,2,7 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,3,7 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,4,7 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,2,8 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,3,8 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
-               opp@860000000,900,4,8 {
-                       opp-microvolt = <900000 900000 1250000>;
-               };
-
                opp@860000000,975 {
                        opp-microvolt = <975000 975000 1250000>;
                };
 
-               opp@860000000,975,1,1 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@860000000,975,1,2 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@860000000,975,1,3 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@860000000,975,1,4 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@860000000,975,1,7 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@860000000,975,1,8 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
                opp@860000000,1000 {
                        opp-microvolt = <1000000 1000000 1250000>;
                };
                        opp-microvolt = <975000 975000 1250000>;
                };
 
-               opp@1000000000,975,2,1 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,3,1 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,2,2 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,3,2 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,2,3 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,3,3 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,2,4 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,3,4 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,2,7 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,3,7 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,4,7 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,2,8 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,3,8 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1000000000,975,4,8 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
                opp@1000000000,1000 {
                        opp-microvolt = <1000000 1000000 1250000>;
                };
                        opp-microvolt = <975000 975000 1250000>;
                };
 
-               opp@1100000000,975,3,1 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1100000000,975,3,2 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1100000000,975,3,3 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1100000000,975,3,4 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1100000000,975,3,7 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1100000000,975,4,7 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1100000000,975,3,8 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
-               opp@1100000000,975,4,8 {
-                       opp-microvolt = <975000 975000 1250000>;
-               };
-
                opp@1100000000,1000 {
                        opp-microvolt = <1000000 1000000 1250000>;
                };
 
-               opp@1100000000,1000,2,1 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1100000000,1000,2,2 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1100000000,1000,2,3 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1100000000,1000,2,4 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1100000000,1000,2,7 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1100000000,1000,2,8 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
                opp@1100000000,1025 {
                        opp-microvolt = <1025000 1025000 1250000>;
                };
                        opp-microvolt = <1000000 1000000 1250000>;
                };
 
-               opp@1200000000,1000,3,1 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1200000000,1000,3,2 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1200000000,1000,3,3 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1200000000,1000,3,4 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1200000000,1000,3,7 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1200000000,1000,4,7 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1200000000,1000,3,8 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1200000000,1000,4,8 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
                opp@1200000000,1025 {
                        opp-microvolt = <1025000 1025000 1250000>;
                };
 
-               opp@1200000000,1025,2,1 {
-                       opp-microvolt = <1025000 1025000 1250000>;
-               };
-
-               opp@1200000000,1025,2,2 {
-                       opp-microvolt = <1025000 1025000 1250000>;
-               };
-
-               opp@1200000000,1025,2,3 {
-                       opp-microvolt = <1025000 1025000 1250000>;
-               };
-
-               opp@1200000000,1025,2,4 {
-                       opp-microvolt = <1025000 1025000 1250000>;
-               };
-
-               opp@1200000000,1025,2,7 {
-                       opp-microvolt = <1025000 1025000 1250000>;
-               };
-
-               opp@1200000000,1025,2,8 {
-                       opp-microvolt = <1025000 1025000 1250000>;
-               };
-
                opp@1200000000,1050 {
                        opp-microvolt = <1050000 1050000 1250000>;
                };
                        opp-microvolt = <1000000 1000000 1250000>;
                };
 
-               opp@1300000000,1000,4,7 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
-               opp@1300000000,1000,4,8 {
-                       opp-microvolt = <1000000 1000000 1250000>;
-               };
-
                opp@1300000000,1025 {
                        opp-microvolt = <1025000 1025000 1250000>;
                };
 
-               opp@1300000000,1025,3,1 {
-                       opp-microvolt = <1025000 1025000 1250000>;
-               };
-
-               opp@1300000000,1025,3,7 {
-                       opp-microvolt = <1025000 1025000 1250000>;
-               };
-
-               opp@1300000000,1025,3,8 {
-                       opp-microvolt = <1025000 1025000 1250000>;
-               };
-
                opp@1300000000,1050 {
                        opp-microvolt = <1050000 1050000 1250000>;
                };
 
-               opp@1300000000,1050,2,1 {
-                       opp-microvolt = <1050000 1050000 1250000>;
-               };
-
-               opp@1300000000,1050,3,2 {
-                       opp-microvolt = <1050000 1050000 1250000>;
-               };
-
-               opp@1300000000,1050,3,3 {
-                       opp-microvolt = <1050000 1050000 1250000>;
-               };
-
-               opp@1300000000,1050,3,4 {
-                       opp-microvolt = <1050000 1050000 1250000>;
-               };
-
-               opp@1300000000,1050,3,5 {
-                       opp-microvolt = <1050000 1050000 1250000>;
-               };
-
-               opp@1300000000,1050,3,6 {
-                       opp-microvolt = <1050000 1050000 1250000>;
-               };
-
-               opp@1300000000,1050,2,7 {
-                       opp-microvolt = <1050000 1050000 1250000>;
-               };
-
-               opp@1300000000,1050,2,8 {
-                       opp-microvolt = <1050000 1050000 1250000>;
-               };
-
-               opp@1300000000,1050,3,12 {
-                       opp-microvolt = <1050000 1050000 1250000>;
-               };
-
-               opp@1300000000,1050,3,13 {
-                       opp-microvolt = <1050000 1050000 1250000>;
-               };
-
                opp@1300000000,1075 {
                        opp-microvolt = <1075000 1075000 1250000>;
                };
 
-               opp@1300000000,1075,2,2 {
-                       opp-microvolt = <1075000 1075000 1250000>;
-               };
-
-               opp@1300000000,1075,2,3 {
-                       opp-microvolt = <1075000 1075000 1250000>;
-               };
-
-               opp@1300000000,1075,2,4 {
-                       opp-microvolt = <1075000 1075000 1250000>;
-               };
-
                opp@1300000000,1100 {
                        opp-microvolt = <1100000 1100000 1250000>;
                };
                        opp-microvolt = <1150000 1150000 1250000>;
                };
 
-               opp@1400000000,1150,2,4 {
-                       opp-microvolt = <1150000 1150000 1250000>;
-               };
-
                opp@1400000000,1175 {
                        opp-microvolt = <1175000 1175000 1250000>;
                };
                        opp-microvolt = <1125000 1125000 1250000>;
                };
 
-               opp@1500000000,1125,4,5 {
-                       opp-microvolt = <1125000 1125000 1250000>;
-               };
-
-               opp@1500000000,1125,4,6 {
-                       opp-microvolt = <1125000 1125000 1250000>;
-               };
-
-               opp@1500000000,1125,4,12 {
-                       opp-microvolt = <1125000 1125000 1250000>;
-               };
-
-               opp@1500000000,1125,4,13 {
-                       opp-microvolt = <1125000 1125000 1250000>;
-               };
-
                opp@1500000000,1150 {
                        opp-microvolt = <1150000 1150000 1250000>;
                };
 
-               opp@1500000000,1150,3,5 {
-                       opp-microvolt = <1150000 1150000 1250000>;
-               };
-
-               opp@1500000000,1150,3,6 {
-                       opp-microvolt = <1150000 1150000 1250000>;
-               };
-
-               opp@1500000000,1150,3,12 {
-                       opp-microvolt = <1150000 1150000 1250000>;
-               };
-
-               opp@1500000000,1150,3,13 {
-                       opp-microvolt = <1150000 1150000 1250000>;
-               };
-
                opp@1500000000,1200 {
                        opp-microvolt = <1200000 1200000 1250000>;
                };
index 8e434f6..0f71350 100644 (file)
 
                opp@475000000,850 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x0F 0x0001>;
-                       opp-hz = /bits/ 64 <475000000>;
-               };
-
-               opp@475000000,850,0,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0002>;
-                       opp-hz = /bits/ 64 <475000000>;
-               };
-
-               opp@475000000,850,0,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0010>;
-                       opp-hz = /bits/ 64 <475000000>;
-               };
-
-               opp@475000000,850,0,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0080>;
-                       opp-hz = /bits/ 64 <475000000>;
-               };
-
-               opp@475000000,850,0,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0100>;
-                       opp-hz = /bits/ 64 <475000000>;
-               };
-
-               opp@608000000,850 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x1F 0x0400>;
-                       opp-hz = /bits/ 64 <608000000>;
-               };
-
-               opp@608000000,912 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x1F 0x0200>;
-                       opp-hz = /bits/ 64 <608000000>;
-               };
-
-               opp@620000000,850 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x1E 0x306C>;
-                       opp-hz = /bits/ 64 <620000000>;
-               };
-
-               opp@640000000,850 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x0F 0x0001>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,1,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0002>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,2,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0002>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,3,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0002>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,1,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0010>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,2,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0010>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,3,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0010>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,1,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0080>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,2,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0080>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,3,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0080>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,4,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0080>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,1,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0100>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,2,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0100>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,3,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0100>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,850,4,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0100>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@640000000,900 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0192>;
-                       opp-hz = /bits/ 64 <640000000>;
-               };
-
-               opp@760000000,850 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x1E 0x3461>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,850,3,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0002>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,850,3,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0004>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,850,3,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0008>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,850,3,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0010>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,850,3,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0080>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,850,4,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0080>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,850,3,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0100>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,850,4,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0100>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,850,0,10 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0400>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0001>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,1,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0002>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,2,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0002>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,1,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0004>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,2,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0004>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,1,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0008>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,2,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0008>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,1,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0010>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,2,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0010>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,1,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0080>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,2,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0080>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,1,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0100>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,900,2,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0100>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,912 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x1F 0x0200>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@760000000,975 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0192>;
-                       opp-hz = /bits/ 64 <760000000>;
-               };
-
-               opp@816000000,850 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x1F 0x0400>;
-                       opp-hz = /bits/ 64 <816000000>;
-               };
-
-               opp@816000000,912 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x1F 0x0200>;
-                       opp-hz = /bits/ 64 <816000000>;
-               };
-
-               opp@860000000,850 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x0C 0x0001>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0001>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,2,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0002>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,3,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0002>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,2,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0004>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,3,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0004>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,2,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0008>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,3,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0008>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,2,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0010>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,3,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0010>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,2,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0080>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,3,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0080>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,4,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0080>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,2,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0100>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,3,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0100>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,900,4,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0100>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,975 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0001>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,975,1,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0002>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,975,1,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0004>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,975,1,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0008>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,975,1,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0010>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,975,1,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0080>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,975,1,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0100>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@860000000,1000 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0192>;
-                       opp-hz = /bits/ 64 <860000000>;
-               };
-
-               opp@910000000,900 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x18 0x3060>;
-                       opp-hz = /bits/ 64 <910000000>;
-               };
-
-               opp@1000000000,900 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x0C 0x0001>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,975 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x03 0x0001>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,975,2,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0002>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,975,3,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0002>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,975,2,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0004>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,975,3,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0004>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,975,2,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0008>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,975,3,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0008>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,975,2,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0010>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,975,3,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0010>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,975,2,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0080>;
-                       opp-hz = /bits/ 64 <1000000000>;
-               };
-
-               opp@1000000000,975,3,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0080>;
-                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-supported-hw = <0x0F 0x0001>, <0x01 0x0002>,
+                                          <0x01 0x0010>, <0x01 0x0080>,
+                                          <0x01 0x0100>;
+                       opp-hz = /bits/ 64 <475000000>;
                };
 
-               opp@1000000000,975,4,7 {
+               opp@608000000,850 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0080>;
-                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-supported-hw = <0x1F 0x0400>;
+                       opp-hz = /bits/ 64 <608000000>;
                };
 
-               opp@1000000000,975,2,8 {
+               opp@608000000,912 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0100>;
-                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-supported-hw = <0x1F 0x0200>;
+                       opp-hz = /bits/ 64 <608000000>;
                };
 
-               opp@1000000000,975,3,8 {
+               opp@620000000,850 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0100>;
-                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-supported-hw = <0x1E 0x306C>;
+                       opp-hz = /bits/ 64 <620000000>;
                };
 
-               opp@1000000000,975,4,8 {
+               opp@640000000,850 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0100>;
-                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-supported-hw = <0x0F 0x0001>, <0x02 0x0002>,
+                                          <0x04 0x0002>, <0x08 0x0002>,
+                                          <0x02 0x0010>, <0x04 0x0010>,
+                                          <0x08 0x0010>, <0x02 0x0080>,
+                                          <0x04 0x0080>, <0x08 0x0080>,
+                                          <0x10 0x0080>, <0x02 0x0100>,
+                                          <0x04 0x0100>, <0x08 0x0100>,
+                                          <0x10 0x0100>;
+                       opp-hz = /bits/ 64 <640000000>;
                };
 
-               opp@1000000000,1000 {
+               opp@640000000,900 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x019E>;
-                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-supported-hw = <0x01 0x0192>;
+                       opp-hz = /bits/ 64 <640000000>;
                };
 
-               opp@1000000000,1025 {
+               opp@760000000,850 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0192>;
-                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-supported-hw = <0x1E 0x3461>, <0x08 0x0002>,
+                                          <0x08 0x0004>, <0x08 0x0008>,
+                                          <0x08 0x0010>, <0x08 0x0080>,
+                                          <0x10 0x0080>, <0x08 0x0100>,
+                                          <0x10 0x0100>, <0x01 0x0400>;
+                       opp-hz = /bits/ 64 <760000000>;
                };
 
-               opp@1100000000,900 {
+               opp@760000000,900 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0001>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x01 0x0001>, <0x02 0x0002>,
+                                          <0x04 0x0002>, <0x02 0x0004>,
+                                          <0x04 0x0004>, <0x02 0x0008>,
+                                          <0x04 0x0008>, <0x02 0x0010>,
+                                          <0x04 0x0010>, <0x02 0x0080>,
+                                          <0x04 0x0080>, <0x02 0x0100>,
+                                          <0x04 0x0100>;
+                       opp-hz = /bits/ 64 <760000000>;
                };
 
-               opp@1100000000,975 {
+               opp@760000000,912 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x06 0x0001>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x1F 0x0200>;
+                       opp-hz = /bits/ 64 <760000000>;
                };
 
-               opp@1100000000,975,3,1 {
+               opp@760000000,975 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0002>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x01 0x0192>;
+                       opp-hz = /bits/ 64 <760000000>;
                };
 
-               opp@1100000000,975,3,2 {
+               opp@816000000,850 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0004>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x1F 0x0400>;
+                       opp-hz = /bits/ 64 <816000000>;
                };
 
-               opp@1100000000,975,3,3 {
+               opp@816000000,912 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0008>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x1F 0x0200>;
+                       opp-hz = /bits/ 64 <816000000>;
                };
 
-               opp@1100000000,975,3,4 {
+               opp@860000000,850 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0010>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x0C 0x0001>;
+                       opp-hz = /bits/ 64 <860000000>;
                };
 
-               opp@1100000000,975,3,7 {
+               opp@860000000,900 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0080>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x02 0x0001>, <0x04 0x0002>,
+                                          <0x08 0x0002>, <0x04 0x0004>,
+                                          <0x08 0x0004>, <0x04 0x0008>,
+                                          <0x08 0x0008>, <0x04 0x0010>,
+                                          <0x08 0x0010>, <0x04 0x0080>,
+                                          <0x08 0x0080>, <0x10 0x0080>,
+                                          <0x04 0x0100>, <0x08 0x0100>,
+                                          <0x10 0x0100>;
+                       opp-hz = /bits/ 64 <860000000>;
                };
 
-               opp@1100000000,975,4,7 {
+               opp@860000000,975 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0080>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x01 0x0001>, <0x02 0x0002>,
+                                          <0x02 0x0004>, <0x02 0x0008>,
+                                          <0x02 0x0010>, <0x02 0x0080>,
+                                          <0x02 0x0100>;
+                       opp-hz = /bits/ 64 <860000000>;
                };
 
-               opp@1100000000,975,3,8 {
+               opp@860000000,1000 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0100>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x01 0x0192>;
+                       opp-hz = /bits/ 64 <860000000>;
                };
 
-               opp@1100000000,975,4,8 {
+               opp@910000000,900 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0100>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x18 0x3060>;
+                       opp-hz = /bits/ 64 <910000000>;
                };
 
-               opp@1100000000,1000 {
+               opp@1000000000,900 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x01 0x0001>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x0C 0x0001>;
+                       opp-hz = /bits/ 64 <1000000000>;
                };
 
-               opp@1100000000,1000,2,1 {
+               opp@1000000000,975 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0002>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x03 0x0001>, <0x04 0x0002>,
+                                          <0x08 0x0002>, <0x04 0x0004>,
+                                          <0x08 0x0004>, <0x04 0x0008>,
+                                          <0x08 0x0008>, <0x04 0x0010>,
+                                          <0x08 0x0010>, <0x04 0x0080>,
+                                          <0x08 0x0080>, <0x10 0x0080>,
+                                          <0x04 0x0100>, <0x08 0x0100>,
+                                          <0x10 0x0100>;
+                       opp-hz = /bits/ 64 <1000000000>;
                };
 
-               opp@1100000000,1000,2,2 {
+               opp@1000000000,1000 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0004>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x02 0x019E>;
+                       opp-hz = /bits/ 64 <1000000000>;
                };
 
-               opp@1100000000,1000,2,3 {
+               opp@1000000000,1025 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0008>;
-                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-supported-hw = <0x01 0x0192>;
+                       opp-hz = /bits/ 64 <1000000000>;
                };
 
-               opp@1100000000,1000,2,4 {
+               opp@1100000000,900 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0010>;
+                       opp-supported-hw = <0x08 0x0001>;
                        opp-hz = /bits/ 64 <1100000000>;
                };
 
-               opp@1100000000,1000,2,7 {
+               opp@1100000000,975 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0080>;
+                       opp-supported-hw = <0x06 0x0001>, <0x08 0x0002>,
+                                          <0x08 0x0004>, <0x08 0x0008>,
+                                          <0x08 0x0010>, <0x08 0x0080>,
+                                          <0x10 0x0080>, <0x08 0x0100>,
+                                          <0x10 0x0100>;
                        opp-hz = /bits/ 64 <1100000000>;
                };
 
-               opp@1100000000,1000,2,8 {
+               opp@1100000000,1000 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0100>;
+                       opp-supported-hw = <0x01 0x0001>, <0x04 0x0002>,
+                                          <0x04 0x0004>, <0x04 0x0008>,
+                                          <0x04 0x0010>, <0x04 0x0080>,
+                                          <0x04 0x0100>;
                        opp-hz = /bits/ 64 <1100000000>;
                };
 
 
                opp@1200000000,1000 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0001>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1000,3,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0002>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1000,3,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0004>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1000,3,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0008>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1000,3,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0010>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1000,3,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0080>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1000,4,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0080>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1000,3,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0100>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1000,4,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0100>;
+                       opp-supported-hw = <0x04 0x0001>, <0x08 0x0002>,
+                                          <0x08 0x0004>, <0x08 0x0008>,
+                                          <0x08 0x0010>, <0x08 0x0080>,
+                                          <0x10 0x0080>, <0x08 0x0100>,
+                                          <0x10 0x0100>;
                        opp-hz = /bits/ 64 <1200000000>;
                };
 
                opp@1200000000,1025 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0001>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1025,2,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0002>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1025,2,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0004>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1025,2,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0008>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1025,2,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0010>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1025,2,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0080>;
-                       opp-hz = /bits/ 64 <1200000000>;
-               };
-
-               opp@1200000000,1025,2,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0100>;
+                       opp-supported-hw = <0x02 0x0001>, <0x04 0x0002>,
+                                          <0x04 0x0004>, <0x04 0x0008>,
+                                          <0x04 0x0010>, <0x04 0x0080>,
+                                          <0x04 0x0100>;
                        opp-hz = /bits/ 64 <1200000000>;
                };
 
 
                opp@1300000000,1000 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0001>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1000,4,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0080>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1000,4,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0100>;
+                       opp-supported-hw = <0x08 0x0001>, <0x10 0x0080>,
+                                          <0x10 0x0100>;
                        opp-hz = /bits/ 64 <1300000000>;
                };
 
                opp@1300000000,1025 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0001>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1025,3,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0002>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1025,3,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0080>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1025,3,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0100>;
+                       opp-supported-hw = <0x04 0x0001>, <0x08 0x0002>,
+                                          <0x08 0x0080>, <0x08 0x0100>;
                        opp-hz = /bits/ 64 <1300000000>;
                };
 
                opp@1300000000,1050 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x12 0x3061>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1050,2,1 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0002>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1050,3,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0004>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1050,3,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0008>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1050,3,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0010>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1050,3,5 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0020>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1050,3,6 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0040>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1050,2,7 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0080>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1050,2,8 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0100>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1050,3,12 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x1000>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1050,3,13 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x2000>;
+                       opp-supported-hw = <0x12 0x3061>, <0x04 0x0002>,
+                                          <0x08 0x0004>, <0x08 0x0008>,
+                                          <0x08 0x0010>, <0x08 0x0020>,
+                                          <0x08 0x0040>, <0x04 0x0080>,
+                                          <0x04 0x0100>, <0x08 0x1000>,
+                                          <0x08 0x2000>;
                        opp-hz = /bits/ 64 <1300000000>;
                };
 
                opp@1300000000,1075 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x0182>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1075,2,2 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0004>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1075,2,3 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0008>;
-                       opp-hz = /bits/ 64 <1300000000>;
-               };
-
-               opp@1300000000,1075,2,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0010>;
+                       opp-supported-hw = <0x02 0x0182>, <0x04 0x0004>,
+                                          <0x04 0x0008>, <0x04 0x0010>;
                        opp-hz = /bits/ 64 <1300000000>;
                };
 
 
                opp@1400000000,1150 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x02 0x000C>;
-                       opp-hz = /bits/ 64 <1400000000>;
-               };
-
-               opp@1400000000,1150,2,4 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0010>;
+                       opp-supported-hw = <0x02 0x000C>, <0x04 0x0010>;
                        opp-hz = /bits/ 64 <1400000000>;
                };
 
 
                opp@1500000000,1125 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0010>;
-                       opp-hz = /bits/ 64 <1500000000>;
-               };
-
-               opp@1500000000,1125,4,5 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0020>;
-                       opp-hz = /bits/ 64 <1500000000>;
-               };
-
-               opp@1500000000,1125,4,6 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x0040>;
-                       opp-hz = /bits/ 64 <1500000000>;
-               };
-
-               opp@1500000000,1125,4,12 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x1000>;
-                       opp-hz = /bits/ 64 <1500000000>;
-               };
-
-               opp@1500000000,1125,4,13 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x10 0x2000>;
+                       opp-supported-hw = <0x08 0x0010>, <0x10 0x0020>,
+                                          <0x10 0x0040>, <0x10 0x1000>,
+                                          <0x10 0x2000>;
                        opp-hz = /bits/ 64 <1500000000>;
                };
 
                opp@1500000000,1150 {
                        clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x04 0x0010>;
-                       opp-hz = /bits/ 64 <1500000000>;
-               };
-
-               opp@1500000000,1150,3,5 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0020>;
-                       opp-hz = /bits/ 64 <1500000000>;
-               };
-
-               opp@1500000000,1150,3,6 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x0040>;
-                       opp-hz = /bits/ 64 <1500000000>;
-               };
-
-               opp@1500000000,1150,3,12 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x1000>;
-                       opp-hz = /bits/ 64 <1500000000>;
-               };
-
-               opp@1500000000,1150,3,13 {
-                       clock-latency-ns = <100000>;
-                       opp-supported-hw = <0x08 0x2000>;
+                       opp-supported-hw = <0x04 0x0010>, <0x08 0x0020>,
+                                          <0x08 0x0040>, <0x08 0x1000>,
+                                          <0x08 0x2000>;
                        opp-hz = /bits/ 64 <1500000000>;
                };
 
index e0593cf..470299e 100644 (file)
@@ -7,8 +7,13 @@
 #include <linux/cpumask.h>
 #include <linux/arch_topology.h>
 
+/* big.LITTLE switcher is incompatible with frequency invariance */
+#ifndef CONFIG_BL_SWITCHER
 /* Replace task scheduler's default frequency-invariant accounting */
+#define arch_set_freq_scale topology_set_freq_scale
 #define arch_scale_freq_capacity topology_get_freq_scale
+#define arch_scale_freq_invariant topology_scale_freq_invariant
+#endif
 
 /* Replace task scheduler's default cpu-invariant accounting */
 #define arch_scale_cpu_capacity topology_get_cpu_scale
index e042f65..11a4652 100644 (file)
@@ -26,7 +26,9 @@ void topology_scale_freq_tick(void);
 #endif /* CONFIG_ARM64_AMU_EXTN */
 
 /* Replace task scheduler's default frequency-invariant accounting */
+#define arch_set_freq_scale topology_set_freq_scale
 #define arch_scale_freq_capacity topology_get_freq_scale
+#define arch_scale_freq_invariant topology_scale_freq_invariant
 
 /* Replace task scheduler's default cpu-invariant accounting */
 #define arch_scale_cpu_capacity topology_get_cpu_scale
index a85174d..cada0b8 100644 (file)
@@ -298,8 +298,21 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
                case EFI_BOOT_SERVICES_DATA:
                case EFI_CONVENTIONAL_MEMORY:
                case EFI_PERSISTENT_MEMORY:
-                       pr_warn(FW_BUG "requested region covers kernel memory @ %pa\n", &phys);
-                       return NULL;
+                       if (memblock_is_map_memory(phys) ||
+                           !memblock_is_region_memory(phys, size)) {
+                               pr_warn(FW_BUG "requested region covers kernel memory @ %pa\n", &phys);
+                               return NULL;
+                       }
+                       /*
+                        * Mapping kernel memory is permitted if the region in
+                        * question is covered by a single memblock with the
+                        * NOMAP attribute set: this enables the use of ACPI
+                        * table overrides passed via initramfs, which are
+                        * reserved in memory using arch_reserve_mem_area()
+                        * below. As this particular use case only requires
+                        * read access, fall through to the R/O mapping case.
+                        */
+                       fallthrough;
 
                case EFI_RUNTIME_SERVICES_CODE:
                        /*
@@ -388,3 +401,8 @@ int apei_claim_sea(struct pt_regs *regs)
 
        return err;
 }
+
+void arch_reserve_mem_area(acpi_physical_address addr, size_t size)
+{
+       memblock_mark_nomap(addr, size);
+}
index 0801a0f..4064d39 100644 (file)
@@ -246,6 +246,13 @@ static int __init init_amu_fie(void)
                static_branch_enable(&amu_fie_key);
        }
 
+       /*
+        * If the system is not fully invariant after AMU init, disable
+        * partial use of counters for frequency invariance.
+        */
+       if (!topology_scale_freq_invariant())
+               static_branch_disable(&amu_fie_key);
+
 free_valid_mask:
        free_cpumask_var(valid_cpus);
 
@@ -253,7 +260,7 @@ free_valid_mask:
 }
 late_initcall_sync(init_amu_fie);
 
-bool arch_freq_counters_available(struct cpumask *cpus)
+bool arch_freq_counters_available(const struct cpumask *cpus)
 {
        return amu_freq_invariant() &&
               cpumask_subset(cpus, amu_fie_cpus);
index 69eae60..b15d65a 100644 (file)
@@ -31,7 +31,14 @@ static void __tlb_switch_to_guest(struct kvm_s2_mmu *mmu,
                isb();
        }
 
+       /*
+        * __load_guest_stage2() includes an ISB only when the AT
+        * workaround is applied. Take care of the opposite condition,
+        * ensuring that we always have an ISB, but not two ISBs back
+        * to back.
+        */
        __load_guest_stage2(mmu);
+       asm(ALTERNATIVE("isb", "nop", ARM64_WORKAROUND_SPECULATIVE_AT));
 }
 
 static void __tlb_switch_to_host(struct tlb_inv_context *cxt)
index d95f7b2..5962f88 100644 (file)
@@ -5,7 +5,6 @@
 
 #include <linux/random.h>
 #include <linux/version.h>
-#include <asm/timex.h>
 
 extern unsigned long __stack_chk_guard;
 
@@ -18,12 +17,9 @@ extern unsigned long __stack_chk_guard;
 static __always_inline void boot_init_stack_canary(void)
 {
        unsigned long canary;
-       unsigned long tsc;
 
        /* Try to get a semi random initial value. */
        get_random_bytes(&canary, sizeof(canary));
-       tsc = get_cycles();
-       canary += tsc + (tsc << BITS_PER_LONG/2);
        canary ^= LINUX_VERSION_CODE;
        canary &= CANARY_MASK;
 
index 7f659dd..ab10490 100644 (file)
@@ -33,6 +33,19 @@ static inline u32 get_cycles_hi(void)
 #define get_cycles_hi get_cycles_hi
 #endif /* CONFIG_64BIT */
 
+/*
+ * Much like MIPS, we may not have a viable counter to use at an early point
+ * in the boot process. Unfortunately we don't have a fallback, so instead
+ * we just return 0.
+ */
+static inline unsigned long random_get_entropy(void)
+{
+       if (unlikely(clint_time_val == NULL))
+               return 0;
+       return get_cycles();
+}
+#define random_get_entropy()   random_get_entropy()
+
 #else /* CONFIG_RISCV_M_MODE */
 
 static inline cycles_t get_cycles(void)
index 7b2a068..96979c0 100644 (file)
@@ -794,6 +794,18 @@ void update_exception_bitmap(struct kvm_vcpu *vcpu)
         */
        if (is_guest_mode(vcpu))
                eb |= get_vmcs12(vcpu)->exception_bitmap;
+        else {
+               /*
+                * If EPT is enabled, #PF is only trapped if MAXPHYADDR is mismatched
+                * between guest and host.  In that case we only care about present
+                * faults.  For vmcs02, however, PFEC_MASK and PFEC_MATCH are set in
+                * prepare_vmcs02_rare.
+                */
+               bool selective_pf_trap = enable_ept && (eb & (1u << PF_VECTOR));
+               int mask = selective_pf_trap ? PFERR_PRESENT_MASK : 0;
+               vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, mask);
+               vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, mask);
+       }
 
        vmcs_write32(EXCEPTION_BITMAP, eb);
 }
@@ -4355,16 +4367,6 @@ static void init_vmcs(struct vcpu_vmx *vmx)
                vmx->pt_desc.guest.output_mask = 0x7F;
                vmcs_write64(GUEST_IA32_RTIT_CTL, 0);
        }
-
-       /*
-        * If EPT is enabled, #PF is only trapped if MAXPHYADDR is mismatched
-        * between guest and host.  In that case we only care about present
-        * faults.
-        */
-       if (enable_ept) {
-               vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, PFERR_PRESENT_MASK);
-               vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, PFERR_PRESENT_MASK);
-       }
 }
 
 static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
index b3d2785..cdced4a 100644 (file)
@@ -1412,6 +1412,11 @@ out:
 
        hctx->dispatched[queued_to_index(queued)]++;
 
+       /* If we didn't flush the entire list, we could have told the driver
+        * there was more coming, but that turned out to be a lie.
+        */
+       if ((!list_empty(list) || errors) && q->mq_ops->commit_rqs && queued)
+               q->mq_ops->commit_rqs(hctx);
        /*
         * Any items that need requeuing? Stuff them into hctx->dispatch,
         * that is where we will continue on next queue run.
@@ -1425,14 +1430,6 @@ out:
 
                blk_mq_release_budgets(q, nr_budgets);
 
-               /*
-                * If we didn't flush the entire list, we could have told
-                * the driver there was more coming, but that turned out to
-                * be a lie.
-                */
-               if (q->mq_ops->commit_rqs && queued)
-                       q->mq_ops->commit_rqs(hctx);
-
                spin_lock(&hctx->lock);
                list_splice_tail_init(list, &hctx->dispatch);
                spin_unlock(&hctx->lock);
@@ -2079,6 +2076,7 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx,
                struct list_head *list)
 {
        int queued = 0;
+       int errors = 0;
 
        while (!list_empty(list)) {
                blk_status_t ret;
@@ -2095,6 +2093,7 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx,
                                break;
                        }
                        blk_mq_end_request(rq, ret);
+                       errors++;
                } else
                        queued++;
        }
@@ -2104,7 +2103,8 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx,
         * the driver there was more coming, but that turned out to
         * be a lie.
         */
-       if (!list_empty(list) && hctx->queue->mq_ops->commit_rqs && queued)
+       if ((!list_empty(list) || errors) &&
+            hctx->queue->mq_ops->commit_rqs && queued)
                hctx->queue->mq_ops->commit_rqs(hctx);
 }
 
index 75f72d6..c1a9e2f 100644 (file)
 #include <linux/sched.h>
 #include <linux/smp.h>
 
-__weak bool arch_freq_counters_available(struct cpumask *cpus)
+bool topology_scale_freq_invariant(void)
+{
+       return cpufreq_supports_freq_invariance() ||
+              arch_freq_counters_available(cpu_online_mask);
+}
+
+__weak bool arch_freq_counters_available(const struct cpumask *cpus)
 {
        return false;
 }
 DEFINE_PER_CPU(unsigned long, freq_scale) = SCHED_CAPACITY_SCALE;
 
-void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq,
-                        unsigned long max_freq)
+void topology_set_freq_scale(const struct cpumask *cpus, unsigned long cur_freq,
+                            unsigned long max_freq)
 {
        unsigned long scale;
        int i;
 
+       if (WARN_ON_ONCE(!cur_freq || !max_freq))
+               return;
+
        /*
         * If the use of counters for FIE is enabled, just return as we don't
         * want to update the scale factor with information from CPUFREQ.
index 2cb5e04..b92bb61 100644 (file)
@@ -2044,8 +2044,9 @@ int of_genpd_add_provider_simple(struct device_node *np,
        if (genpd->set_performance_state) {
                ret = dev_pm_opp_of_add_table(&genpd->dev);
                if (ret) {
-                       dev_err(&genpd->dev, "Failed to add OPP table: %d\n",
-                               ret);
+                       if (ret != -EPROBE_DEFER)
+                               dev_err(&genpd->dev, "Failed to add OPP table: %d\n",
+                                       ret);
                        goto unlock;
                }
 
@@ -2054,7 +2055,7 @@ int of_genpd_add_provider_simple(struct device_node *np,
                 * state.
                 */
                genpd->opp_table = dev_pm_opp_get_opp_table(&genpd->dev);
-               WARN_ON(!genpd->opp_table);
+               WARN_ON(IS_ERR(genpd->opp_table));
        }
 
        ret = genpd_add_provider(np, genpd_xlate_simple, genpd);
@@ -2111,8 +2112,9 @@ int of_genpd_add_provider_onecell(struct device_node *np,
                if (genpd->set_performance_state) {
                        ret = dev_pm_opp_of_add_table_indexed(&genpd->dev, i);
                        if (ret) {
-                               dev_err(&genpd->dev, "Failed to add OPP table for index %d: %d\n",
-                                       i, ret);
+                               if (ret != -EPROBE_DEFER)
+                                       dev_err(&genpd->dev, "Failed to add OPP table for index %d: %d\n",
+                                               i, ret);
                                goto error;
                        }
 
@@ -2121,7 +2123,7 @@ int of_genpd_add_provider_onecell(struct device_node *np,
                         * performance state.
                         */
                        genpd->opp_table = dev_pm_opp_get_opp_table_indexed(&genpd->dev, i);
-                       WARN_ON(!genpd->opp_table);
+                       WARN_ON(IS_ERR(genpd->opp_table));
                }
 
                genpd->provider = &np->fwnode;
index 51564fc..f408628 100644 (file)
@@ -927,7 +927,7 @@ static const struct samsung_gate_clock exynos4210_gate_clks[] __initconst = {
        GATE(CLK_PCIE, "pcie", "aclk133", GATE_IP_FSYS, 14, 0, 0),
        GATE(CLK_SMMU_PCIE, "smmu_pcie", "aclk133", GATE_IP_FSYS, 18, 0, 0),
        GATE(CLK_MODEMIF, "modemif", "aclk100", GATE_IP_PERIL, 28, 0, 0),
-       GATE(CLK_CHIPID, "chipid", "aclk100", E4210_GATE_IP_PERIR, 0, 0, 0),
+       GATE(CLK_CHIPID, "chipid", "aclk100", E4210_GATE_IP_PERIR, 0, CLK_IGNORE_UNUSED, 0),
        GATE(CLK_SYSREG, "sysreg", "aclk100", E4210_GATE_IP_PERIR, 0,
                        CLK_IGNORE_UNUSED, 0),
        GATE(CLK_HDMI_CEC, "hdmi_cec", "aclk100", E4210_GATE_IP_PERIR, 11, 0,
@@ -969,7 +969,7 @@ static const struct samsung_gate_clock exynos4x12_gate_clks[] __initconst = {
                0),
        GATE(CLK_TSADC, "tsadc", "aclk133", E4X12_GATE_BUS_FSYS1, 16, 0, 0),
        GATE(CLK_MIPI_HSI, "mipi_hsi", "aclk133", GATE_IP_FSYS, 10, 0, 0),
-       GATE(CLK_CHIPID, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, 0, 0),
+       GATE(CLK_CHIPID, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, CLK_IGNORE_UNUSED, 0),
        GATE(CLK_SYSREG, "sysreg", "aclk100", E4X12_GATE_IP_PERIR, 1,
                        CLK_IGNORE_UNUSED, 0),
        GATE(CLK_HDMI_CEC, "hdmi_cec", "aclk100", E4X12_GATE_IP_PERIR, 11, 0,
index fea3339..bd62087 100644 (file)
@@ -1655,6 +1655,11 @@ static void __init exynos5x_clk_init(struct device_node *np,
         * main G3D clock enablement status.
         */
        clk_prepare_enable(__clk_lookup("mout_sw_aclk_g3d"));
+       /*
+        * Keep top BPLL mux enabled permanently to ensure that DRAM operates
+        * properly.
+        */
+       clk_prepare_enable(__clk_lookup("mout_bpll"));
 
        samsung_clk_of_add_provider(np, ctx);
 }
index c1dfc9b..661a8e9 100644 (file)
@@ -209,7 +209,7 @@ static const struct stratix10_perip_cnt_clock s10_main_perip_cnt_clks[] = {
        { STRATIX10_EMAC_B_FREE_CLK, "emacb_free_clk", NULL, emacb_free_mux, ARRAY_SIZE(emacb_free_mux),
          0, 0, 2, 0xB0, 1},
        { STRATIX10_EMAC_PTP_FREE_CLK, "emac_ptp_free_clk", NULL, emac_ptp_free_mux,
-         ARRAY_SIZE(emac_ptp_free_mux), 0, 0, 4, 0xB0, 2},
+         ARRAY_SIZE(emac_ptp_free_mux), 0, 0, 2, 0xB0, 2},
        { STRATIX10_GPIO_DB_FREE_CLK, "gpio_db_free_clk", NULL, gpio_db_free_mux,
          ARRAY_SIZE(gpio_db_free_mux), 0, 0, 0, 0xB0, 3},
        { STRATIX10_SDMMC_FREE_CLK, "sdmmc_free_clk", NULL, sdmmc_free_mux,
index f180c05..c5cc0a2 100644 (file)
@@ -1611,9 +1611,6 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
        unsigned long flags = 0;
        unsigned long input_rate;
 
-       if (clk_pll_is_enabled(hw))
-               return 0;
-
        input_rate = clk_hw_get_rate(clk_hw_get_parent(hw));
 
        if (_get_table_rate(hw, &sel, pll->params->fixed_rate, input_rate))
@@ -1673,7 +1670,7 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
        pll_writel(val, PLLE_SS_CTRL, pll);
        udelay(1);
 
-       /* Enable hw control of xusb brick pll */
+       /* Enable HW control of XUSB brick PLL */
        val = pll_readl_misc(pll);
        val &= ~PLLE_MISC_IDDQ_SW_CTRL;
        pll_writel_misc(val, pll);
@@ -1696,7 +1693,7 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
        val |= XUSBIO_PLL_CFG0_SEQ_ENABLE;
        pll_writel(val, XUSBIO_PLL_CFG0, pll);
 
-       /* Enable hw control of SATA pll */
+       /* Enable HW control of SATA PLL */
        val = pll_readl(SATA_PLL_CFG0, pll);
        val &= ~SATA_PLL_CFG0_PADPLL_RESET_SWCTL;
        val |= SATA_PLL_CFG0_PADPLL_USE_LOCKDET;
index 352a2c3..51fd0ec 100644 (file)
@@ -12,6 +12,8 @@
 #include <linux/io.h>
 #include <linux/slab.h>
 
+#include "clk.h"
+
 #define CLK_SOURCE_EMC 0x19c
 #define  CLK_SOURCE_EMC_2X_CLK_SRC GENMASK(31, 29)
 #define  CLK_SOURCE_EMC_MC_EMC_SAME_FREQ BIT(16)
index d17367d..6cfe2ab 100644 (file)
@@ -38,6 +38,7 @@ static unsigned int clint_timer_irq;
 
 #ifdef CONFIG_RISCV_M_MODE
 u64 __iomem *clint_time_val;
+EXPORT_SYMBOL(clint_time_val);
 #endif
 
 static void clint_send_ipi(const struct cpumask *target)
index cb72fb5..bf5830e 100644 (file)
@@ -283,7 +283,7 @@ config ARM_SPEAR_CPUFREQ
 
 config ARM_STI_CPUFREQ
        tristate "STi CPUFreq support"
-       depends on SOC_STIH407
+       depends on CPUFREQ_DT && SOC_STIH407
        help
          This driver uses the generic OPP framework to match the running
          platform with a predefined set of suitable values.  If not provided
index df1c941..b4af409 100644 (file)
@@ -484,6 +484,12 @@ remove_opp:
 /* late_initcall, to guarantee the driver is loaded after A37xx clock driver */
 late_initcall(armada37xx_cpufreq_driver_init);
 
+static const struct of_device_id __maybe_unused armada37xx_cpufreq_of_match[] = {
+       { .compatible = "marvell,armada-3700-nb-pm" },
+       { },
+};
+MODULE_DEVICE_TABLE(of, armada37xx_cpufreq_of_match);
+
 MODULE_AUTHOR("Gregory CLEMENT <gregory.clement@free-electrons.com>");
 MODULE_DESCRIPTION("Armada 37xx cpufreq driver");
 MODULE_LICENSE("GPL");
index 7d01df7..3776d96 100644 (file)
@@ -137,6 +137,7 @@ static const struct of_device_id blacklist[] __initconst = {
 
        { .compatible = "st,stih407", },
        { .compatible = "st,stih410", },
+       { .compatible = "st,stih418", },
 
        { .compatible = "sigma,tango4", },
 
index 944d7b4..e363ae0 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/cpufreq.h>
 #include <linux/cpumask.h>
 #include <linux/err.h>
+#include <linux/list.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/pm_opp.h>
 #include "cpufreq-dt.h"
 
 struct private_data {
-       struct opp_table *opp_table;
+       struct list_head node;
+
+       cpumask_var_t cpus;
        struct device *cpu_dev;
-       const char *reg_name;
+       struct opp_table *opp_table;
+       struct opp_table *reg_opp_table;
        bool have_static_opps;
 };
 
+static LIST_HEAD(priv_list);
+
 static struct freq_attr *cpufreq_dt_attr[] = {
        &cpufreq_freq_attr_scaling_available_freqs,
        NULL,   /* Extra space for boost-attr if required */
        NULL,
 };
 
+static struct private_data *cpufreq_dt_find_data(int cpu)
+{
+       struct private_data *priv;
+
+       list_for_each_entry(priv, &priv_list, node) {
+               if (cpumask_test_cpu(cpu, priv->cpus))
+                       return priv;
+       }
+
+       return NULL;
+}
+
 static int set_target(struct cpufreq_policy *policy, unsigned int index)
 {
        struct private_data *priv = policy->driver_data;
        unsigned long freq = policy->freq_table[index].frequency;
-       int ret;
-
-       ret = dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000);
-
-       if (!ret) {
-               arch_set_freq_scale(policy->related_cpus, freq,
-                                   policy->cpuinfo.max_freq);
-       }
 
-       return ret;
+       return dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000);
 }
 
 /*
@@ -90,83 +100,24 @@ node_put:
        return name;
 }
 
-static int resources_available(void)
-{
-       struct device *cpu_dev;
-       struct regulator *cpu_reg;
-       struct clk *cpu_clk;
-       int ret = 0;
-       const char *name;
-
-       cpu_dev = get_cpu_device(0);
-       if (!cpu_dev) {
-               pr_err("failed to get cpu0 device\n");
-               return -ENODEV;
-       }
-
-       cpu_clk = clk_get(cpu_dev, NULL);
-       ret = PTR_ERR_OR_ZERO(cpu_clk);
-       if (ret) {
-               /*
-                * If cpu's clk node is present, but clock is not yet
-                * registered, we should try defering probe.
-                */
-               if (ret == -EPROBE_DEFER)
-                       dev_dbg(cpu_dev, "clock not ready, retry\n");
-               else
-                       dev_err(cpu_dev, "failed to get clock: %d\n", ret);
-
-               return ret;
-       }
-
-       clk_put(cpu_clk);
-
-       ret = dev_pm_opp_of_find_icc_paths(cpu_dev, NULL);
-       if (ret)
-               return ret;
-
-       name = find_supply_name(cpu_dev);
-       /* Platform doesn't require regulator */
-       if (!name)
-               return 0;
-
-       cpu_reg = regulator_get_optional(cpu_dev, name);
-       ret = PTR_ERR_OR_ZERO(cpu_reg);
-       if (ret) {
-               /*
-                * If cpu's regulator supply node is present, but regulator is
-                * not yet registered, we should try defering probe.
-                */
-               if (ret == -EPROBE_DEFER)
-                       dev_dbg(cpu_dev, "cpu0 regulator not ready, retry\n");
-               else
-                       dev_dbg(cpu_dev, "no regulator for cpu0: %d\n", ret);
-
-               return ret;
-       }
-
-       regulator_put(cpu_reg);
-       return 0;
-}
-
 static int cpufreq_init(struct cpufreq_policy *policy)
 {
        struct cpufreq_frequency_table *freq_table;
-       struct opp_table *opp_table = NULL;
        struct private_data *priv;
        struct device *cpu_dev;
        struct clk *cpu_clk;
        unsigned int transition_latency;
-       bool fallback = false;
-       const char *name;
        int ret;
 
-       cpu_dev = get_cpu_device(policy->cpu);
-       if (!cpu_dev) {
-               pr_err("failed to get cpu%d device\n", policy->cpu);
+       priv = cpufreq_dt_find_data(policy->cpu);
+       if (!priv) {
+               pr_err("failed to find data for cpu%d\n", policy->cpu);
                return -ENODEV;
        }
 
+       cpu_dev = priv->cpu_dev;
+       cpumask_copy(policy->cpus, priv->cpus);
+
        cpu_clk = clk_get(cpu_dev, NULL);
        if (IS_ERR(cpu_clk)) {
                ret = PTR_ERR(cpu_clk);
@@ -174,45 +125,6 @@ static int cpufreq_init(struct cpufreq_policy *policy)
                return ret;
        }
 
-       /* Get OPP-sharing information from "operating-points-v2" bindings */
-       ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus);
-       if (ret) {
-               if (ret != -ENOENT)
-                       goto out_put_clk;
-
-               /*
-                * operating-points-v2 not supported, fallback to old method of
-                * finding shared-OPPs for backward compatibility if the
-                * platform hasn't set sharing CPUs.
-                */
-               if (dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus))
-                       fallback = true;
-       }
-
-       /*
-        * OPP layer will be taking care of regulators now, but it needs to know
-        * the name of the regulator first.
-        */
-       name = find_supply_name(cpu_dev);
-       if (name) {
-               opp_table = dev_pm_opp_set_regulators(cpu_dev, &name, 1);
-               if (IS_ERR(opp_table)) {
-                       ret = PTR_ERR(opp_table);
-                       dev_err(cpu_dev, "Failed to set regulator for cpu%d: %d\n",
-                               policy->cpu, ret);
-                       goto out_put_clk;
-               }
-       }
-
-       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
-       if (!priv) {
-               ret = -ENOMEM;
-               goto out_put_regulator;
-       }
-
-       priv->reg_name = name;
-       priv->opp_table = opp_table;
-
        /*
         * Initialize OPP tables for all policy->cpus. They will be shared by
         * all CPUs which have marked their CPUs shared with OPP bindings.
@@ -232,31 +144,17 @@ static int cpufreq_init(struct cpufreq_policy *policy)
         */
        ret = dev_pm_opp_get_opp_count(cpu_dev);
        if (ret <= 0) {
-               dev_dbg(cpu_dev, "OPP table is not ready, deferring probe\n");
-               ret = -EPROBE_DEFER;
+               dev_err(cpu_dev, "OPP table can't be empty\n");
+               ret = -ENODEV;
                goto out_free_opp;
        }
 
-       if (fallback) {
-               cpumask_setall(policy->cpus);
-
-               /*
-                * OPP tables are initialized only for policy->cpu, do it for
-                * others as well.
-                */
-               ret = dev_pm_opp_set_sharing_cpus(cpu_dev, policy->cpus);
-               if (ret)
-                       dev_err(cpu_dev, "%s: failed to mark OPPs as shared: %d\n",
-                               __func__, ret);
-       }
-
        ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
        if (ret) {
                dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret);
                goto out_free_opp;
        }
 
-       priv->cpu_dev = cpu_dev;
        policy->driver_data = priv;
        policy->clk = cpu_clk;
        policy->freq_table = freq_table;
@@ -288,11 +186,6 @@ out_free_cpufreq_table:
 out_free_opp:
        if (priv->have_static_opps)
                dev_pm_opp_of_cpumask_remove_table(policy->cpus);
-       kfree(priv);
-out_put_regulator:
-       if (name)
-               dev_pm_opp_put_regulators(opp_table);
-out_put_clk:
        clk_put(cpu_clk);
 
        return ret;
@@ -320,12 +213,7 @@ static int cpufreq_exit(struct cpufreq_policy *policy)
        dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
        if (priv->have_static_opps)
                dev_pm_opp_of_cpumask_remove_table(policy->related_cpus);
-       if (priv->reg_name)
-               dev_pm_opp_put_regulators(priv->opp_table);
-
        clk_put(policy->clk);
-       kfree(priv);
-
        return 0;
 }
 
@@ -344,21 +232,119 @@ static struct cpufreq_driver dt_cpufreq_driver = {
        .suspend = cpufreq_generic_suspend,
 };
 
-static int dt_cpufreq_probe(struct platform_device *pdev)
+static int dt_cpufreq_early_init(struct device *dev, int cpu)
 {
-       struct cpufreq_dt_platform_data *data = dev_get_platdata(&pdev->dev);
+       struct private_data *priv;
+       struct device *cpu_dev;
+       const char *reg_name;
        int ret;
 
+       /* Check if this CPU is already covered by some other policy */
+       if (cpufreq_dt_find_data(cpu))
+               return 0;
+
+       cpu_dev = get_cpu_device(cpu);
+       if (!cpu_dev)
+               return -EPROBE_DEFER;
+
+       priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       if (!alloc_cpumask_var(&priv->cpus, GFP_KERNEL))
+               return -ENOMEM;
+
+       priv->cpu_dev = cpu_dev;
+
+       /* Try to get OPP table early to ensure resources are available */
+       priv->opp_table = dev_pm_opp_get_opp_table(cpu_dev);
+       if (IS_ERR(priv->opp_table)) {
+               ret = PTR_ERR(priv->opp_table);
+               if (ret != -EPROBE_DEFER)
+                       dev_err(cpu_dev, "failed to get OPP table: %d\n", ret);
+               goto free_cpumask;
+       }
+
        /*
-        * All per-cluster (CPUs sharing clock/voltages) initialization is done
-        * from ->init(). In probe(), we just need to make sure that clk and
-        * regulators are available. Else defer probe and retry.
-        *
-        * FIXME: Is checking this only for CPU0 sufficient ?
+        * OPP layer will be taking care of regulators now, but it needs to know
+        * the name of the regulator first.
         */
-       ret = resources_available();
-       if (ret)
-               return ret;
+       reg_name = find_supply_name(cpu_dev);
+       if (reg_name) {
+               priv->reg_opp_table = dev_pm_opp_set_regulators(cpu_dev,
+                                                               &reg_name, 1);
+               if (IS_ERR(priv->reg_opp_table)) {
+                       ret = PTR_ERR(priv->reg_opp_table);
+                       if (ret != -EPROBE_DEFER)
+                               dev_err(cpu_dev, "failed to set regulators: %d\n",
+                                       ret);
+                       goto put_table;
+               }
+       }
+
+       /* Find OPP sharing information so we can fill pri->cpus here */
+       /* Get OPP-sharing information from "operating-points-v2" bindings */
+       ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, priv->cpus);
+       if (ret) {
+               if (ret != -ENOENT)
+                       goto put_reg;
+
+               /*
+                * operating-points-v2 not supported, fallback to all CPUs share
+                * OPP for backward compatibility if the platform hasn't set
+                * sharing CPUs.
+                */
+               if (dev_pm_opp_get_sharing_cpus(cpu_dev, priv->cpus)) {
+                       cpumask_setall(priv->cpus);
+
+                       /*
+                        * OPP tables are initialized only for cpu, do it for
+                        * others as well.
+                        */
+                       ret = dev_pm_opp_set_sharing_cpus(cpu_dev, priv->cpus);
+                       if (ret)
+                               dev_err(cpu_dev, "%s: failed to mark OPPs as shared: %d\n",
+                                       __func__, ret);
+               }
+       }
+
+       list_add(&priv->node, &priv_list);
+       return 0;
+
+put_reg:
+       if (priv->reg_opp_table)
+               dev_pm_opp_put_regulators(priv->reg_opp_table);
+put_table:
+       dev_pm_opp_put_opp_table(priv->opp_table);
+free_cpumask:
+       free_cpumask_var(priv->cpus);
+       return ret;
+}
+
+static void dt_cpufreq_release(void)
+{
+       struct private_data *priv, *tmp;
+
+       list_for_each_entry_safe(priv, tmp, &priv_list, node) {
+               if (priv->reg_opp_table)
+                       dev_pm_opp_put_regulators(priv->reg_opp_table);
+               dev_pm_opp_put_opp_table(priv->opp_table);
+               free_cpumask_var(priv->cpus);
+               list_del(&priv->node);
+       }
+}
+
+static int dt_cpufreq_probe(struct platform_device *pdev)
+{
+       struct cpufreq_dt_platform_data *data = dev_get_platdata(&pdev->dev);
+       int ret, cpu;
+
+       /* Request resources early so we can return in case of -EPROBE_DEFER */
+       for_each_possible_cpu(cpu) {
+               ret = dt_cpufreq_early_init(&pdev->dev, cpu);
+               if (ret)
+                       goto err;
+       }
 
        if (data) {
                if (data->have_governor_per_policy)
@@ -374,15 +360,21 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
        }
 
        ret = cpufreq_register_driver(&dt_cpufreq_driver);
-       if (ret)
+       if (ret) {
                dev_err(&pdev->dev, "failed register driver: %d\n", ret);
+               goto err;
+       }
 
+       return 0;
+err:
+       dt_cpufreq_release();
        return ret;
 }
 
 static int dt_cpufreq_remove(struct platform_device *pdev)
 {
        cpufreq_unregister_driver(&dt_cpufreq_driver);
+       dt_cpufreq_release();
        return 0;
 }
 
index 47aa90f..1877f5e 100644 (file)
@@ -61,6 +61,12 @@ static struct cpufreq_driver *cpufreq_driver;
 static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data);
 static DEFINE_RWLOCK(cpufreq_driver_lock);
 
+static DEFINE_STATIC_KEY_FALSE(cpufreq_freq_invariance);
+bool cpufreq_supports_freq_invariance(void)
+{
+       return static_branch_likely(&cpufreq_freq_invariance);
+}
+
 /* Flag to suspend/resume CPUFreq governors */
 static bool cpufreq_suspended;
 
@@ -154,12 +160,6 @@ u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy)
 }
 EXPORT_SYMBOL_GPL(get_cpu_idle_time);
 
-__weak void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq,
-               unsigned long max_freq)
-{
-}
-EXPORT_SYMBOL_GPL(arch_set_freq_scale);
-
 /*
  * This is a generic cpufreq init() routine which can be used by cpufreq
  * drivers of SMP systems. It will do following:
@@ -446,6 +446,10 @@ void cpufreq_freq_transition_end(struct cpufreq_policy *policy,
 
        cpufreq_notify_post_transition(policy, freqs, transition_failed);
 
+       arch_set_freq_scale(policy->related_cpus,
+                           policy->cur,
+                           policy->cpuinfo.max_freq);
+
        policy->transition_ongoing = false;
        policy->transition_task = NULL;
 
@@ -2056,9 +2060,26 @@ EXPORT_SYMBOL(cpufreq_unregister_notifier);
 unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
                                        unsigned int target_freq)
 {
+       unsigned int freq;
+       int cpu;
+
        target_freq = clamp_val(target_freq, policy->min, policy->max);
+       freq = cpufreq_driver->fast_switch(policy, target_freq);
 
-       return cpufreq_driver->fast_switch(policy, target_freq);
+       if (!freq)
+               return 0;
+
+       policy->cur = freq;
+       arch_set_freq_scale(policy->related_cpus, freq,
+                           policy->cpuinfo.max_freq);
+       cpufreq_stats_record_transition(policy, freq);
+
+       if (trace_cpu_frequency_enabled()) {
+               for_each_cpu(cpu, policy->cpus)
+                       trace_cpu_frequency(freq, cpu);
+       }
+
+       return freq;
 }
 EXPORT_SYMBOL_GPL(cpufreq_driver_fast_switch);
 
@@ -2710,6 +2731,15 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
        cpufreq_driver = driver_data;
        write_unlock_irqrestore(&cpufreq_driver_lock, flags);
 
+       /*
+        * Mark support for the scheduler's frequency invariance engine for
+        * drivers that implement target(), target_index() or fast_switch().
+        */
+       if (!cpufreq_driver->setpolicy) {
+               static_branch_enable_cpuslocked(&cpufreq_freq_invariance);
+               pr_debug("supports frequency invariance");
+       }
+
        if (driver_data->setpolicy)
                driver_data->flags |= CPUFREQ_CONST_LOOPS;
 
@@ -2779,6 +2809,7 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
        cpus_read_lock();
        subsys_interface_unregister(&cpufreq_interface);
        remove_boost_sysfs_file();
+       static_branch_disable_cpuslocked(&cpufreq_freq_invariance);
        cpuhp_remove_state_nocalls_cpuslocked(hp_online);
 
        write_lock_irqsave(&cpufreq_driver_lock, flags);
index 94d959a..6cd5c8a 100644 (file)
@@ -19,64 +19,104 @@ struct cpufreq_stats {
        unsigned int state_num;
        unsigned int last_index;
        u64 *time_in_state;
-       spinlock_t lock;
        unsigned int *freq_table;
        unsigned int *trans_table;
+
+       /* Deferred reset */
+       unsigned int reset_pending;
+       unsigned long long reset_time;
 };
 
-static void cpufreq_stats_update(struct cpufreq_stats *stats)
+static void cpufreq_stats_update(struct cpufreq_stats *stats,
+                                unsigned long long time)
 {
        unsigned long long cur_time = get_jiffies_64();
 
-       stats->time_in_state[stats->last_index] += cur_time - stats->last_time;
+       stats->time_in_state[stats->last_index] += cur_time - time;
        stats->last_time = cur_time;
 }
 
-static void cpufreq_stats_clear_table(struct cpufreq_stats *stats)
+static void cpufreq_stats_reset_table(struct cpufreq_stats *stats)
 {
        unsigned int count = stats->max_state;
 
-       spin_lock(&stats->lock);
        memset(stats->time_in_state, 0, count * sizeof(u64));
        memset(stats->trans_table, 0, count * count * sizeof(int));
        stats->last_time = get_jiffies_64();
        stats->total_trans = 0;
-       spin_unlock(&stats->lock);
+
+       /* Adjust for the time elapsed since reset was requested */
+       WRITE_ONCE(stats->reset_pending, 0);
+       /*
+        * Prevent the reset_time read from being reordered before the
+        * reset_pending accesses in cpufreq_stats_record_transition().
+        */
+       smp_rmb();
+       cpufreq_stats_update(stats, READ_ONCE(stats->reset_time));
 }
 
 static ssize_t show_total_trans(struct cpufreq_policy *policy, char *buf)
 {
-       return sprintf(buf, "%d\n", policy->stats->total_trans);
+       struct cpufreq_stats *stats = policy->stats;
+
+       if (READ_ONCE(stats->reset_pending))
+               return sprintf(buf, "%d\n", 0);
+       else
+               return sprintf(buf, "%u\n", stats->total_trans);
 }
 cpufreq_freq_attr_ro(total_trans);
 
 static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf)
 {
        struct cpufreq_stats *stats = policy->stats;
+       bool pending = READ_ONCE(stats->reset_pending);
+       unsigned long long time;
        ssize_t len = 0;
        int i;
 
-       if (policy->fast_switch_enabled)
-               return 0;
-
-       spin_lock(&stats->lock);
-       cpufreq_stats_update(stats);
-       spin_unlock(&stats->lock);
-
        for (i = 0; i < stats->state_num; i++) {
+               if (pending) {
+                       if (i == stats->last_index) {
+                               /*
+                                * Prevent the reset_time read from occurring
+                                * before the reset_pending read above.
+                                */
+                               smp_rmb();
+                               time = get_jiffies_64() - READ_ONCE(stats->reset_time);
+                       } else {
+                               time = 0;
+                       }
+               } else {
+                       time = stats->time_in_state[i];
+                       if (i == stats->last_index)
+                               time += get_jiffies_64() - stats->last_time;
+               }
+
                len += sprintf(buf + len, "%u %llu\n", stats->freq_table[i],
-                       (unsigned long long)
-                       jiffies_64_to_clock_t(stats->time_in_state[i]));
+                              jiffies_64_to_clock_t(time));
        }
        return len;
 }
 cpufreq_freq_attr_ro(time_in_state);
 
+/* We don't care what is written to the attribute */
 static ssize_t store_reset(struct cpufreq_policy *policy, const char *buf,
                           size_t count)
 {
-       /* We don't care what is written to the attribute. */
-       cpufreq_stats_clear_table(policy->stats);
+       struct cpufreq_stats *stats = policy->stats;
+
+       /*
+        * Defer resetting of stats to cpufreq_stats_record_transition() to
+        * avoid races.
+        */
+       WRITE_ONCE(stats->reset_time, get_jiffies_64());
+       /*
+        * The memory barrier below is to prevent the readers of reset_time from
+        * seeing a stale or partially updated value.
+        */
+       smp_wmb();
+       WRITE_ONCE(stats->reset_pending, 1);
+
        return count;
 }
 cpufreq_freq_attr_wo(reset);
@@ -84,11 +124,9 @@ cpufreq_freq_attr_wo(reset);
 static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
 {
        struct cpufreq_stats *stats = policy->stats;
+       bool pending = READ_ONCE(stats->reset_pending);
        ssize_t len = 0;
-       int i, j;
-
-       if (policy->fast_switch_enabled)
-               return 0;
+       int i, j, count;
 
        len += scnprintf(buf + len, PAGE_SIZE - len, "   From  :    To\n");
        len += scnprintf(buf + len, PAGE_SIZE - len, "         : ");
@@ -113,8 +151,13 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
                for (j = 0; j < stats->state_num; j++) {
                        if (len >= PAGE_SIZE)
                                break;
-                       len += scnprintf(buf + len, PAGE_SIZE - len, "%9u ",
-                                       stats->trans_table[i*stats->max_state+j]);
+
+                       if (pending)
+                               count = 0;
+                       else
+                               count = stats->trans_table[i * stats->max_state + j];
+
+                       len += scnprintf(buf + len, PAGE_SIZE - len, "%9u ", count);
                }
                if (len >= PAGE_SIZE)
                        break;
@@ -208,7 +251,6 @@ void cpufreq_stats_create_table(struct cpufreq_policy *policy)
        stats->state_num = i;
        stats->last_time = get_jiffies_64();
        stats->last_index = freq_table_get_index(stats, policy->cur);
-       spin_lock_init(&stats->lock);
 
        policy->stats = stats;
        ret = sysfs_create_group(&policy->kobj, &stats_attr_group);
@@ -228,23 +270,22 @@ void cpufreq_stats_record_transition(struct cpufreq_policy *policy,
        struct cpufreq_stats *stats = policy->stats;
        int old_index, new_index;
 
-       if (!stats) {
-               pr_debug("%s: No stats found\n", __func__);
+       if (unlikely(!stats))
                return;
-       }
+
+       if (unlikely(READ_ONCE(stats->reset_pending)))
+               cpufreq_stats_reset_table(stats);
 
        old_index = stats->last_index;
        new_index = freq_table_get_index(stats, new_freq);
 
        /* We can't do stats->time_in_state[-1]= .. */
-       if (old_index == -1 || new_index == -1 || old_index == new_index)
+       if (unlikely(old_index == -1 || new_index == -1 || old_index == new_index))
                return;
 
-       spin_lock(&stats->lock);
-       cpufreq_stats_update(stats);
+       cpufreq_stats_update(stats, stats->last_time);
 
        stats->last_index = new_index;
        stats->trans_table[old_index * stats->max_state + new_index]++;
        stats->total_trans++;
-       spin_unlock(&stats->lock);
 }
index ef7b34c..5bf5fc7 100644 (file)
@@ -48,7 +48,6 @@ static struct clk_bulk_data clks[] = {
 };
 
 static struct device *cpu_dev;
-static bool free_opp;
 static struct cpufreq_frequency_table *freq_table;
 static unsigned int max_freq;
 static unsigned int transition_latency;
@@ -390,9 +389,6 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
                goto put_reg;
        }
 
-       /* Because we have added the OPPs here, we must free them */
-       free_opp = true;
-
        if (of_machine_is_compatible("fsl,imx6ul") ||
            of_machine_is_compatible("fsl,imx6ull")) {
                ret = imx6ul_opp_check_speed_grading(cpu_dev);
@@ -507,8 +503,7 @@ soc_opp_out:
 free_freq_table:
        dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
 out_free_opp:
-       if (free_opp)
-               dev_pm_opp_of_remove_table(cpu_dev);
+       dev_pm_opp_of_remove_table(cpu_dev);
 put_reg:
        if (!IS_ERR(arm_reg))
                regulator_put(arm_reg);
@@ -528,8 +523,7 @@ static int imx6q_cpufreq_remove(struct platform_device *pdev)
 {
        cpufreq_unregister_driver(&imx6q_cpufreq_driver);
        dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
-       if (free_opp)
-               dev_pm_opp_of_remove_table(cpu_dev);
+       dev_pm_opp_of_remove_table(cpu_dev);
        regulator_put(arm_reg);
        if (!IS_ERR(pu_reg))
                regulator_put(pu_reg);
index a827b00..9a515c4 100644 (file)
@@ -2781,6 +2781,7 @@ static int intel_pstate_update_status(const char *buf, size_t size)
 
                cpufreq_unregister_driver(intel_pstate_driver);
                intel_pstate_driver_cleanup();
+               return 0;
        }
 
        if (size == 6 && !strncmp(buf, "active", size)) {
index 3fb044b..9ed5341 100644 (file)
 #define LUT_L_VAL                      GENMASK(7, 0)
 #define LUT_CORE_COUNT                 GENMASK(18, 16)
 #define LUT_VOLT                       GENMASK(11, 0)
-#define LUT_ROW_SIZE                   32
 #define CLK_HW_DIV                     2
 #define LUT_TURBO_IND                  1
 
-/* Register offsets */
-#define REG_ENABLE                     0x0
-#define REG_FREQ_LUT                   0x110
-#define REG_VOLT_LUT                   0x114
-#define REG_PERF_STATE                 0x920
+struct qcom_cpufreq_soc_data {
+       u32 reg_enable;
+       u32 reg_freq_lut;
+       u32 reg_volt_lut;
+       u32 reg_perf_state;
+       u8 lut_row_size;
+};
+
+struct qcom_cpufreq_data {
+       void __iomem *base;
+       const struct qcom_cpufreq_soc_data *soc_data;
+};
 
 static unsigned long cpu_hw_rate, xo_rate;
-static struct platform_device *global_pdev;
 static bool icc_scaling_enabled;
 
 static int qcom_cpufreq_set_bw(struct cpufreq_policy *policy,
@@ -77,22 +82,22 @@ static int qcom_cpufreq_update_opp(struct device *cpu_dev,
 static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy,
                                        unsigned int index)
 {
-       void __iomem *perf_state_reg = policy->driver_data;
+       struct qcom_cpufreq_data *data = policy->driver_data;
+       const struct qcom_cpufreq_soc_data *soc_data = data->soc_data;
        unsigned long freq = policy->freq_table[index].frequency;
 
-       writel_relaxed(index, perf_state_reg);
+       writel_relaxed(index, data->base + soc_data->reg_perf_state);
 
        if (icc_scaling_enabled)
                qcom_cpufreq_set_bw(policy, freq);
 
-       arch_set_freq_scale(policy->related_cpus, freq,
-                           policy->cpuinfo.max_freq);
        return 0;
 }
 
 static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)
 {
-       void __iomem *perf_state_reg;
+       struct qcom_cpufreq_data *data;
+       const struct qcom_cpufreq_soc_data *soc_data;
        struct cpufreq_policy *policy;
        unsigned int index;
 
@@ -100,9 +105,10 @@ static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)
        if (!policy)
                return 0;
 
-       perf_state_reg = policy->driver_data;
+       data = policy->driver_data;
+       soc_data = data->soc_data;
 
-       index = readl_relaxed(perf_state_reg);
+       index = readl_relaxed(data->base + soc_data->reg_perf_state);
        index = min(index, LUT_MAX_ENTRIES - 1);
 
        return policy->freq_table[index].frequency;
@@ -111,23 +117,18 @@ static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)
 static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
                                                unsigned int target_freq)
 {
-       void __iomem *perf_state_reg = policy->driver_data;
+       struct qcom_cpufreq_data *data = policy->driver_data;
+       const struct qcom_cpufreq_soc_data *soc_data = data->soc_data;
        unsigned int index;
-       unsigned long freq;
 
        index = policy->cached_resolved_idx;
-       writel_relaxed(index, perf_state_reg);
+       writel_relaxed(index, data->base + soc_data->reg_perf_state);
 
-       freq = policy->freq_table[index].frequency;
-       arch_set_freq_scale(policy->related_cpus, freq,
-                           policy->cpuinfo.max_freq);
-
-       return freq;
+       return policy->freq_table[index].frequency;
 }
 
 static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev,
-                                   struct cpufreq_policy *policy,
-                                   void __iomem *base)
+                                   struct cpufreq_policy *policy)
 {
        u32 data, src, lval, i, core_count, prev_freq = 0, freq;
        u32 volt;
@@ -135,6 +136,8 @@ static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev,
        struct dev_pm_opp *opp;
        unsigned long rate;
        int ret;
+       struct qcom_cpufreq_data *drv_data = policy->driver_data;
+       const struct qcom_cpufreq_soc_data *soc_data = drv_data->soc_data;
 
        table = kcalloc(LUT_MAX_ENTRIES + 1, sizeof(*table), GFP_KERNEL);
        if (!table)
@@ -161,14 +164,14 @@ static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev,
        }
 
        for (i = 0; i < LUT_MAX_ENTRIES; i++) {
-               data = readl_relaxed(base + REG_FREQ_LUT +
-                                     i * LUT_ROW_SIZE);
+               data = readl_relaxed(drv_data->base + soc_data->reg_freq_lut +
+                                     i * soc_data->lut_row_size);
                src = FIELD_GET(LUT_SRC, data);
                lval = FIELD_GET(LUT_L_VAL, data);
                core_count = FIELD_GET(LUT_CORE_COUNT, data);
 
-               data = readl_relaxed(base + REG_VOLT_LUT +
-                                     i * LUT_ROW_SIZE);
+               data = readl_relaxed(drv_data->base + soc_data->reg_volt_lut +
+                                     i * soc_data->lut_row_size);
                volt = FIELD_GET(LUT_VOLT, data) * 1000;
 
                if (src)
@@ -177,10 +180,15 @@ static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev,
                        freq = cpu_hw_rate / 1000;
 
                if (freq != prev_freq && core_count != LUT_TURBO_IND) {
-                       table[i].frequency = freq;
-                       qcom_cpufreq_update_opp(cpu_dev, freq, volt);
-                       dev_dbg(cpu_dev, "index=%d freq=%d, core_count %d\n", i,
+                       if (!qcom_cpufreq_update_opp(cpu_dev, freq, volt)) {
+                               table[i].frequency = freq;
+                               dev_dbg(cpu_dev, "index=%d freq=%d, core_count %d\n", i,
                                freq, core_count);
+                       } else {
+                               dev_warn(cpu_dev, "failed to update OPP for freq=%d\n", freq);
+                               table[i].frequency = CPUFREQ_ENTRY_INVALID;
+                       }
+
                } else if (core_count == LUT_TURBO_IND) {
                        table[i].frequency = CPUFREQ_ENTRY_INVALID;
                }
@@ -197,9 +205,13 @@ static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev,
                         * as the boost frequency
                         */
                        if (prev->frequency == CPUFREQ_ENTRY_INVALID) {
-                               prev->frequency = prev_freq;
-                               prev->flags = CPUFREQ_BOOST_FREQ;
-                               qcom_cpufreq_update_opp(cpu_dev, prev_freq, volt);
+                               if (!qcom_cpufreq_update_opp(cpu_dev, prev_freq, volt)) {
+                                       prev->frequency = prev_freq;
+                                       prev->flags = CPUFREQ_BOOST_FREQ;
+                               } else {
+                                       dev_warn(cpu_dev, "failed to update OPP for freq=%d\n",
+                                                freq);
+                               }
                        }
 
                        break;
@@ -238,14 +250,38 @@ static void qcom_get_related_cpus(int index, struct cpumask *m)
        }
 }
 
+static const struct qcom_cpufreq_soc_data qcom_soc_data = {
+       .reg_enable = 0x0,
+       .reg_freq_lut = 0x110,
+       .reg_volt_lut = 0x114,
+       .reg_perf_state = 0x920,
+       .lut_row_size = 32,
+};
+
+static const struct qcom_cpufreq_soc_data epss_soc_data = {
+       .reg_enable = 0x0,
+       .reg_freq_lut = 0x100,
+       .reg_volt_lut = 0x200,
+       .reg_perf_state = 0x320,
+       .lut_row_size = 4,
+};
+
+static const struct of_device_id qcom_cpufreq_hw_match[] = {
+       { .compatible = "qcom,cpufreq-hw", .data = &qcom_soc_data },
+       { .compatible = "qcom,cpufreq-epss", .data = &epss_soc_data },
+       {}
+};
+MODULE_DEVICE_TABLE(of, qcom_cpufreq_hw_match);
+
 static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
 {
-       struct device *dev = &global_pdev->dev;
+       struct platform_device *pdev = cpufreq_get_driver_data();
+       struct device *dev = &pdev->dev;
        struct of_phandle_args args;
        struct device_node *cpu_np;
        struct device *cpu_dev;
-       struct resource *res;
        void __iomem *base;
+       struct qcom_cpufreq_data *data;
        int ret, index;
 
        cpu_dev = get_cpu_device(policy->cpu);
@@ -267,16 +303,21 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
 
        index = args.args[0];
 
-       res = platform_get_resource(global_pdev, IORESOURCE_MEM, index);
-       if (!res)
-               return -ENODEV;
+       base = devm_platform_ioremap_resource(pdev, index);
+       if (IS_ERR(base))
+               return PTR_ERR(base);
 
-       base = devm_ioremap(dev, res->start, resource_size(res));
-       if (!base)
-               return -ENOMEM;
+       data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+       if (!data) {
+               ret = -ENOMEM;
+               goto error;
+       }
+
+       data->soc_data = of_device_get_match_data(&pdev->dev);
+       data->base = base;
 
        /* HW should be in enabled state to proceed */
-       if (!(readl_relaxed(base + REG_ENABLE) & 0x1)) {
+       if (!(readl_relaxed(base + data->soc_data->reg_enable) & 0x1)) {
                dev_err(dev, "Domain-%d cpufreq hardware not enabled\n", index);
                ret = -ENODEV;
                goto error;
@@ -289,9 +330,9 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
                goto error;
        }
 
-       policy->driver_data = base + REG_PERF_STATE;
+       policy->driver_data = data;
 
-       ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy, base);
+       ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy);
        if (ret) {
                dev_err(dev, "Domain-%d failed to read LUT\n", index);
                goto error;
@@ -315,12 +356,13 @@ error:
 static int qcom_cpufreq_hw_cpu_exit(struct cpufreq_policy *policy)
 {
        struct device *cpu_dev = get_cpu_device(policy->cpu);
-       void __iomem *base = policy->driver_data - REG_PERF_STATE;
+       struct qcom_cpufreq_data *data = policy->driver_data;
+       struct platform_device *pdev = cpufreq_get_driver_data();
 
        dev_pm_opp_remove_all_dynamic(cpu_dev);
        dev_pm_opp_of_cpumask_remove_table(policy->related_cpus);
        kfree(policy->freq_table);
-       devm_iounmap(&global_pdev->dev, base);
+       devm_iounmap(&pdev->dev, data->base);
 
        return 0;
 }
@@ -365,7 +407,7 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)
        cpu_hw_rate = clk_get_rate(clk) / CLK_HW_DIV;
        clk_put(clk);
 
-       global_pdev = pdev;
+       cpufreq_qcom_hw_driver.driver_data = pdev;
 
        /* Check for optional interconnect paths on CPU0 */
        cpu_dev = get_cpu_device(0);
@@ -390,12 +432,6 @@ static int qcom_cpufreq_hw_driver_remove(struct platform_device *pdev)
        return cpufreq_unregister_driver(&cpufreq_qcom_hw_driver);
 }
 
-static const struct of_device_id qcom_cpufreq_hw_match[] = {
-       { .compatible = "qcom,cpufreq-hw" },
-       {}
-};
-MODULE_DEVICE_TABLE(of, qcom_cpufreq_hw_match);
-
 static struct platform_driver qcom_cpufreq_hw_driver = {
        .probe = qcom_cpufreq_hw_driver_probe,
        .remove = qcom_cpufreq_hw_driver_remove,
index e84281e..bed496c 100644 (file)
@@ -590,6 +590,7 @@ static struct notifier_block s5pv210_cpufreq_reboot_notifier = {
 
 static int s5pv210_cpufreq_probe(struct platform_device *pdev)
 {
+       struct device *dev = &pdev->dev;
        struct device_node *np;
        int id, result = 0;
 
@@ -602,28 +603,20 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
         * cpufreq-dt driver.
         */
        arm_regulator = regulator_get(NULL, "vddarm");
-       if (IS_ERR(arm_regulator)) {
-               if (PTR_ERR(arm_regulator) == -EPROBE_DEFER)
-                       pr_debug("vddarm regulator not ready, defer\n");
-               else
-                       pr_err("failed to get regulator vddarm\n");
-               return PTR_ERR(arm_regulator);
-       }
+       if (IS_ERR(arm_regulator))
+               return dev_err_probe(dev, PTR_ERR(arm_regulator),
+                                    "failed to get regulator vddarm\n");
 
        int_regulator = regulator_get(NULL, "vddint");
        if (IS_ERR(int_regulator)) {
-               if (PTR_ERR(int_regulator) == -EPROBE_DEFER)
-                       pr_debug("vddint regulator not ready, defer\n");
-               else
-                       pr_err("failed to get regulator vddint\n");
-               result = PTR_ERR(int_regulator);
+               result = dev_err_probe(dev, PTR_ERR(int_regulator),
+                                      "failed to get regulator vddint\n");
                goto err_int_regulator;
        }
 
        np = of_find_compatible_node(NULL, NULL, "samsung,s5pv210-clock");
        if (!np) {
-               pr_err("%s: failed to find clock controller DT node\n",
-                       __func__);
+               dev_err(dev, "failed to find clock controller DT node\n");
                result = -ENODEV;
                goto err_clock;
        }
@@ -631,7 +624,7 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
        clk_base = of_iomap(np, 0);
        of_node_put(np);
        if (!clk_base) {
-               pr_err("%s: failed to map clock registers\n", __func__);
+               dev_err(dev, "failed to map clock registers\n");
                result = -EFAULT;
                goto err_clock;
        }
@@ -639,8 +632,7 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
        for_each_compatible_node(np, NULL, "samsung,s5pv210-dmc") {
                id = of_alias_get_id(np, "dmc");
                if (id < 0 || id >= ARRAY_SIZE(dmc_base)) {
-                       pr_err("%s: failed to get alias of dmc node '%pOFn'\n",
-                               __func__, np);
+                       dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", np);
                        of_node_put(np);
                        result = id;
                        goto err_clk_base;
@@ -648,8 +640,7 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
 
                dmc_base[id] = of_iomap(np, 0);
                if (!dmc_base[id]) {
-                       pr_err("%s: failed to map dmc%d registers\n",
-                               __func__, id);
+                       dev_err(dev, "failed to map dmc%d registers\n", id);
                        of_node_put(np);
                        result = -EFAULT;
                        goto err_dmc;
@@ -658,7 +649,7 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
 
        for (id = 0; id < ARRAY_SIZE(dmc_base); ++id) {
                if (!dmc_base[id]) {
-                       pr_err("%s: failed to find dmc%d node\n", __func__, id);
+                       dev_err(dev, "failed to find dmc%d node\n", id);
                        result = -ENODEV;
                        goto err_dmc;
                }
index fb42e33..6dd1311 100644 (file)
@@ -48,16 +48,11 @@ static unsigned int scmi_cpufreq_get_rate(unsigned int cpu)
 static int
 scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)
 {
-       int ret;
        struct scmi_data *priv = policy->driver_data;
        struct scmi_perf_ops *perf_ops = handle->perf_ops;
        u64 freq = policy->freq_table[index].frequency;
 
-       ret = perf_ops->freq_set(handle, priv->domain_id, freq * 1000, false);
-       if (!ret)
-               arch_set_freq_scale(policy->related_cpus, freq,
-                                   policy->cpuinfo.max_freq);
-       return ret;
+       return perf_ops->freq_set(handle, priv->domain_id, freq * 1000, false);
 }
 
 static unsigned int scmi_cpufreq_fast_switch(struct cpufreq_policy *policy,
@@ -67,11 +62,8 @@ static unsigned int scmi_cpufreq_fast_switch(struct cpufreq_policy *policy,
        struct scmi_perf_ops *perf_ops = handle->perf_ops;
 
        if (!perf_ops->freq_set(handle, priv->domain_id,
-                               target_freq * 1000, true)) {
-               arch_set_freq_scale(policy->related_cpus, target_freq,
-                                   policy->cpuinfo.max_freq);
+                               target_freq * 1000, true))
                return target_freq;
-       }
 
        return 0;
 }
index b0f5388..43db05b 100644 (file)
@@ -47,9 +47,8 @@ static unsigned int scpi_cpufreq_get_rate(unsigned int cpu)
 static int
 scpi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)
 {
-       unsigned long freq = policy->freq_table[index].frequency;
+       u64 rate = policy->freq_table[index].frequency * 1000;
        struct scpi_data *priv = policy->driver_data;
-       u64 rate = freq * 1000;
        int ret;
 
        ret = clk_set_rate(priv->clk, rate);
@@ -60,9 +59,6 @@ scpi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)
        if (clk_get_rate(priv->clk) != rate)
                return -EIO;
 
-       arch_set_freq_scale(policy->related_cpus, freq,
-                           policy->cpuinfo.max_freq);
-
        return 0;
 }
 
index a5ad96d..4ac6fb2 100644 (file)
@@ -141,7 +141,8 @@ static const struct reg_field sti_stih407_dvfs_regfields[DVFS_MAX_REGFIELDS] = {
 static const struct reg_field *sti_cpufreq_match(void)
 {
        if (of_machine_is_compatible("st,stih407") ||
-           of_machine_is_compatible("st,stih410"))
+           of_machine_is_compatible("st,stih410") ||
+           of_machine_is_compatible("st,stih418"))
                return sti_stih407_dvfs_regfields;
 
        return NULL;
@@ -258,7 +259,8 @@ static int sti_cpufreq_init(void)
        int ret;
 
        if ((!of_machine_is_compatible("st,stih407")) &&
-               (!of_machine_is_compatible("st,stih410")))
+               (!of_machine_is_compatible("st,stih410")) &&
+               (!of_machine_is_compatible("st,stih418")))
                return -ENODEV;
 
        ddata.cpu = get_cpu_device(0);
index 01e1f58..4b4079f 100644 (file)
@@ -14,6 +14,7 @@
 
 #define EDVD_CORE_VOLT_FREQ(core)              (0x20 + (core) * 0x4)
 #define EDVD_CORE_VOLT_FREQ_F_SHIFT            0
+#define EDVD_CORE_VOLT_FREQ_F_MASK             0xffff
 #define EDVD_CORE_VOLT_FREQ_V_SHIFT            16
 
 struct tegra186_cpufreq_cluster_info {
@@ -91,10 +92,39 @@ static int tegra186_cpufreq_set_target(struct cpufreq_policy *policy,
        return 0;
 }
 
+static unsigned int tegra186_cpufreq_get(unsigned int cpu)
+{
+       struct cpufreq_frequency_table *tbl;
+       struct cpufreq_policy *policy;
+       void __iomem *edvd_reg;
+       unsigned int i, freq = 0;
+       u32 ndiv;
+
+       policy = cpufreq_cpu_get(cpu);
+       if (!policy)
+               return 0;
+
+       tbl = policy->freq_table;
+       edvd_reg = policy->driver_data;
+       ndiv = readl(edvd_reg) & EDVD_CORE_VOLT_FREQ_F_MASK;
+
+       for (i = 0; tbl[i].frequency != CPUFREQ_TABLE_END; i++) {
+               if ((tbl[i].driver_data & EDVD_CORE_VOLT_FREQ_F_MASK) == ndiv) {
+                       freq = tbl[i].frequency;
+                       break;
+               }
+       }
+
+       cpufreq_cpu_put(policy);
+
+       return freq;
+}
+
 static struct cpufreq_driver tegra186_cpufreq_driver = {
        .name = "tegra186",
        .flags = CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY |
                        CPUFREQ_NEED_INITIAL_FREQ_CHECK,
+       .get = tegra186_cpufreq_get,
        .verify = cpufreq_generic_frequency_table_verify,
        .target_index = tegra186_cpufreq_set_target,
        .init = tegra186_cpufreq_init,
index 4e8b1de..e89b905 100644 (file)
@@ -182,7 +182,6 @@ static int ve_spc_cpufreq_set_target(struct cpufreq_policy *policy,
 {
        u32 cpu = policy->cpu, cur_cluster, new_cluster, actual_cluster;
        unsigned int freqs_new;
-       int ret;
 
        cur_cluster = cpu_to_cluster(cpu);
        new_cluster = actual_cluster = per_cpu(physical_cluster, cpu);
@@ -197,15 +196,8 @@ static int ve_spc_cpufreq_set_target(struct cpufreq_policy *policy,
                        new_cluster = A15_CLUSTER;
        }
 
-       ret = ve_spc_cpufreq_set_rate(cpu, actual_cluster, new_cluster,
-                                     freqs_new);
-
-       if (!ret) {
-               arch_set_freq_scale(policy->related_cpus, freqs_new,
-                                   policy->cpuinfo.max_freq);
-       }
-
-       return ret;
+       return ve_spc_cpufreq_set_rate(cpu, actual_cluster, new_cluster,
+                                      freqs_new);
 }
 
 static inline u32 get_table_count(struct cpufreq_frequency_table *table)
index 56efbeb..6765c03 100644 (file)
@@ -213,20 +213,21 @@ EXPORT_SYMBOL_GPL(devfreq_event_reset_event);
  * devfreq_event_get_edev_by_phandle() - Get the devfreq-event dev from
  *                                      devicetree.
  * @dev                : the pointer to the given device
+ * @phandle_name: name of property holding a phandle value
  * @index      : the index into list of devfreq-event device
  *
  * Note that this function return the pointer of devfreq-event device.
  */
 struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,
-                                                     int index)
+                                       const char *phandle_name, int index)
 {
        struct device_node *node;
        struct devfreq_event_dev *edev;
 
-       if (!dev->of_node)
+       if (!dev->of_node || !phandle_name)
                return ERR_PTR(-EINVAL);
 
-       node = of_parse_phandle(dev->of_node, "devfreq-events", index);
+       node = of_parse_phandle(dev->of_node, phandle_name, index);
        if (!node)
                return ERR_PTR(-ENODEV);
 
@@ -258,19 +259,20 @@ EXPORT_SYMBOL_GPL(devfreq_event_get_edev_by_phandle);
 /**
  * devfreq_event_get_edev_count() - Get the count of devfreq-event dev
  * @dev                : the pointer to the given device
+ * @phandle_name: name of property holding a phandle value
  *
  * Note that this function return the count of devfreq-event devices.
  */
-int devfreq_event_get_edev_count(struct device *dev)
+int devfreq_event_get_edev_count(struct device *dev, const char *phandle_name)
 {
        int count;
 
-       if (!dev->of_node) {
+       if (!dev->of_node || !phandle_name) {
                dev_err(dev, "device does not have a device node entry\n");
                return -EINVAL;
        }
 
-       count = of_property_count_elems_of_size(dev->of_node, "devfreq-events",
+       count = of_property_count_elems_of_size(dev->of_node, phandle_name,
                                                sizeof(u32));
        if (count < 0) {
                dev_err(dev,
index 071b59f..861c100 100644 (file)
@@ -983,48 +983,75 @@ struct devfreq *devm_devfreq_add_device(struct device *dev,
 EXPORT_SYMBOL(devm_devfreq_add_device);
 
 #ifdef CONFIG_OF
+/*
+ * devfreq_get_devfreq_by_node - Get the devfreq device from devicetree
+ * @node - pointer to device_node
+ *
+ * return the instance of devfreq device
+ */
+struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node)
+{
+       struct devfreq *devfreq;
+
+       if (!node)
+               return ERR_PTR(-EINVAL);
+
+       mutex_lock(&devfreq_list_lock);
+       list_for_each_entry(devfreq, &devfreq_list, node) {
+               if (devfreq->dev.parent
+                       && devfreq->dev.parent->of_node == node) {
+                       mutex_unlock(&devfreq_list_lock);
+                       return devfreq;
+               }
+       }
+       mutex_unlock(&devfreq_list_lock);
+
+       return ERR_PTR(-ENODEV);
+}
+
 /*
  * devfreq_get_devfreq_by_phandle - Get the devfreq device from devicetree
  * @dev - instance to the given device
+ * @phandle_name - name of property holding a phandle value
  * @index - index into list of devfreq
  *
  * return the instance of devfreq device
  */
-struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index)
+struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev,
+                                       const char *phandle_name, int index)
 {
        struct device_node *node;
        struct devfreq *devfreq;
 
-       if (!dev)
+       if (!dev || !phandle_name)
                return ERR_PTR(-EINVAL);
 
        if (!dev->of_node)
                return ERR_PTR(-EINVAL);
 
-       node = of_parse_phandle(dev->of_node, "devfreq", index);
+       node = of_parse_phandle(dev->of_node, phandle_name, index);
        if (!node)
                return ERR_PTR(-ENODEV);
 
-       mutex_lock(&devfreq_list_lock);
-       list_for_each_entry(devfreq, &devfreq_list, node) {
-               if (devfreq->dev.parent
-                       && devfreq->dev.parent->of_node == node) {
-                       mutex_unlock(&devfreq_list_lock);
-                       of_node_put(node);
-                       return devfreq;
-               }
-       }
-       mutex_unlock(&devfreq_list_lock);
+       devfreq = devfreq_get_devfreq_by_node(node);
        of_node_put(node);
 
-       return ERR_PTR(-EPROBE_DEFER);
+       return devfreq;
 }
+
 #else
-struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index)
+struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node)
+{
+       return ERR_PTR(-ENODEV);
+}
+
+struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev,
+                                       const char *phandle_name, int index)
 {
        return ERR_PTR(-ENODEV);
 }
 #endif /* CONFIG_OF */
+EXPORT_SYMBOL_GPL(devfreq_get_devfreq_by_node);
 EXPORT_SYMBOL_GPL(devfreq_get_devfreq_by_phandle);
 
 /**
index 8fa8eb5..1e684a4 100644 (file)
@@ -193,7 +193,7 @@ static int exynos_bus_parent_parse_of(struct device_node *np,
         * Get the devfreq-event devices to get the current utilization of
         * buses. This raw data will be used in devfreq ondemand governor.
         */
-       count = devfreq_event_get_edev_count(dev);
+       count = devfreq_event_get_edev_count(dev, "devfreq-events");
        if (count < 0) {
                dev_err(dev, "failed to get the count of devfreq-event dev\n");
                ret = count;
@@ -209,7 +209,8 @@ static int exynos_bus_parent_parse_of(struct device_node *np,
        }
 
        for (i = 0; i < count; i++) {
-               bus->edev[i] = devfreq_event_get_edev_by_phandle(dev, i);
+               bus->edev[i] = devfreq_event_get_edev_by_phandle(dev,
+                                                       "devfreq-events", i);
                if (IS_ERR(bus->edev[i])) {
                        ret = -EPROBE_DEFER;
                        goto err_regulator;
@@ -360,7 +361,7 @@ static int exynos_bus_profile_init_passive(struct exynos_bus *bus,
        profile->exit = exynos_bus_passive_exit;
 
        /* Get the instance of parent devfreq device */
-       parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0);
+       parent_devfreq = devfreq_get_devfreq_by_phandle(dev, "devfreq", 0);
        if (IS_ERR(parent_devfreq))
                return -EPROBE_DEFER;
 
index 027769e..2e91216 100644 (file)
@@ -341,7 +341,7 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
                return PTR_ERR(data->dmc_clk);
        }
 
-       data->edev = devfreq_event_get_edev_by_phandle(dev, 0);
+       data->edev = devfreq_event_get_edev_by_phandle(dev, "devfreq-events", 0);
        if (IS_ERR(data->edev))
                return -EPROBE_DEFER;
 
index dedd39d..f5e74c2 100644 (file)
@@ -822,8 +822,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
                return err;
        }
 
-       reset_control_assert(tegra->reset);
-
        err = clk_prepare_enable(tegra->clock);
        if (err) {
                dev_err(&pdev->dev,
@@ -831,7 +829,11 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
                return err;
        }
 
-       reset_control_deassert(tegra->reset);
+       err = reset_control_reset(tegra->reset);
+       if (err) {
+               dev_err(&pdev->dev, "Failed to reset hardware: %d\n", err);
+               goto disable_clk;
+       }
 
        rate = clk_round_rate(tegra->emc_clock, ULONG_MAX);
        if (rate < 0) {
index 45d4d92..a819611 100644 (file)
@@ -129,6 +129,7 @@ struct dmatest_params {
  * @nr_channels:       number of channels under test
  * @lock:              access protection to the fields of this structure
  * @did_init:          module has been initialized completely
+ * @last_error:                test has faced configuration issues
  */
 static struct dmatest_info {
        /* Test parameters */
@@ -137,6 +138,7 @@ static struct dmatest_info {
        /* Internal state */
        struct list_head        channels;
        unsigned int            nr_channels;
+       int                     last_error;
        struct mutex            lock;
        bool                    did_init;
 } test_info = {
@@ -1184,10 +1186,22 @@ static int dmatest_run_set(const char *val, const struct kernel_param *kp)
                return ret;
        } else if (dmatest_run) {
                if (!is_threaded_test_pending(info)) {
-                       pr_info("No channels configured, continue with any\n");
-                       if (!is_threaded_test_run(info))
-                               stop_threaded_test(info);
-                       add_threaded_test(info);
+                       /*
+                        * We have nothing to run. This can be due to:
+                        */
+                       ret = info->last_error;
+                       if (ret) {
+                               /* 1) Misconfiguration */
+                               pr_err("Channel misconfigured, can't continue\n");
+                               mutex_unlock(&info->lock);
+                               return ret;
+                       } else {
+                               /* 2) We rely on defaults */
+                               pr_info("No channels configured, continue with any\n");
+                               if (!is_threaded_test_run(info))
+                                       stop_threaded_test(info);
+                               add_threaded_test(info);
+                       }
                }
                start_threaded_tests(info);
        } else {
@@ -1204,7 +1218,7 @@ static int dmatest_chan_set(const char *val, const struct kernel_param *kp)
        struct dmatest_info *info = &test_info;
        struct dmatest_chan *dtc;
        char chan_reset_val[20];
-       int ret = 0;
+       int ret;
 
        mutex_lock(&info->lock);
        ret = param_set_copystring(val, kp);
@@ -1259,12 +1273,14 @@ static int dmatest_chan_set(const char *val, const struct kernel_param *kp)
                goto add_chan_err;
        }
 
+       info->last_error = ret;
        mutex_unlock(&info->lock);
 
        return ret;
 
 add_chan_err:
        param_set_copystring(chan_reset_val, kp);
+       info->last_error = ret;
        mutex_unlock(&info->lock);
 
        return ret;
index 4e44ba4..2a21354 100644 (file)
@@ -92,7 +92,7 @@ static int amd_fch_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio)
        ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_DIRECTION);
        spin_unlock_irqrestore(&priv->lock, flags);
 
-       return ret ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
+       return ret ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
 }
 
 static void amd_fch_gpio_set(struct gpio_chip *gc,
index 3aa4593..64e54f8 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/string.h>
 
-#define MAX_NR_SGPIO                   80
+/*
+ * MAX_NR_HW_GPIO represents the number of actual hardware-supported GPIOs (ie,
+ * slots within the clocked serial GPIO data). Since each HW GPIO is both an
+ * input and an output, we provide MAX_NR_HW_GPIO * 2 lines on our gpiochip
+ * device.
+ *
+ * We use SGPIO_OUTPUT_OFFSET to define the split between the inputs and
+ * outputs; the inputs start at line 0, the outputs start at OUTPUT_OFFSET.
+ */
+#define MAX_NR_HW_SGPIO                        80
+#define SGPIO_OUTPUT_OFFSET            MAX_NR_HW_SGPIO
 
 #define ASPEED_SGPIO_CTRL              0x54
 
@@ -30,8 +40,8 @@ struct aspeed_sgpio {
        struct clk *pclk;
        spinlock_t lock;
        void __iomem *base;
-       uint32_t dir_in[3];
        int irq;
+       int n_sgpio;
 };
 
 struct aspeed_sgpio_bank {
@@ -111,31 +121,69 @@ static void __iomem *bank_reg(struct aspeed_sgpio *gpio,
        }
 }
 
-#define GPIO_BANK(x)    ((x) >> 5)
-#define GPIO_OFFSET(x)  ((x) & 0x1f)
+#define GPIO_BANK(x)    ((x % SGPIO_OUTPUT_OFFSET) >> 5)
+#define GPIO_OFFSET(x)  ((x % SGPIO_OUTPUT_OFFSET) & 0x1f)
 #define GPIO_BIT(x)     BIT(GPIO_OFFSET(x))
 
 static const struct aspeed_sgpio_bank *to_bank(unsigned int offset)
 {
-       unsigned int bank = GPIO_BANK(offset);
+       unsigned int bank;
+
+       bank = GPIO_BANK(offset);
 
        WARN_ON(bank >= ARRAY_SIZE(aspeed_sgpio_banks));
        return &aspeed_sgpio_banks[bank];
 }
 
+static int aspeed_sgpio_init_valid_mask(struct gpio_chip *gc,
+               unsigned long *valid_mask, unsigned int ngpios)
+{
+       struct aspeed_sgpio *sgpio = gpiochip_get_data(gc);
+       int n = sgpio->n_sgpio;
+       int c = SGPIO_OUTPUT_OFFSET - n;
+
+       WARN_ON(ngpios < MAX_NR_HW_SGPIO * 2);
+
+       /* input GPIOs in the lower range */
+       bitmap_set(valid_mask, 0, n);
+       bitmap_clear(valid_mask, n, c);
+
+       /* output GPIOS above SGPIO_OUTPUT_OFFSET */
+       bitmap_set(valid_mask, SGPIO_OUTPUT_OFFSET, n);
+       bitmap_clear(valid_mask, SGPIO_OUTPUT_OFFSET + n, c);
+
+       return 0;
+}
+
+static void aspeed_sgpio_irq_init_valid_mask(struct gpio_chip *gc,
+               unsigned long *valid_mask, unsigned int ngpios)
+{
+       struct aspeed_sgpio *sgpio = gpiochip_get_data(gc);
+       int n = sgpio->n_sgpio;
+
+       WARN_ON(ngpios < MAX_NR_HW_SGPIO * 2);
+
+       /* input GPIOs in the lower range */
+       bitmap_set(valid_mask, 0, n);
+       bitmap_clear(valid_mask, n, ngpios - n);
+}
+
+static bool aspeed_sgpio_is_input(unsigned int offset)
+{
+       return offset < SGPIO_OUTPUT_OFFSET;
+}
+
 static int aspeed_sgpio_get(struct gpio_chip *gc, unsigned int offset)
 {
        struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
        const struct aspeed_sgpio_bank *bank = to_bank(offset);
        unsigned long flags;
        enum aspeed_sgpio_reg reg;
-       bool is_input;
        int rc = 0;
 
        spin_lock_irqsave(&gpio->lock, flags);
 
-       is_input = gpio->dir_in[GPIO_BANK(offset)] & GPIO_BIT(offset);
-       reg = is_input ? reg_val : reg_rdata;
+       reg = aspeed_sgpio_is_input(offset) ? reg_val : reg_rdata;
        rc = !!(ioread32(bank_reg(gpio, bank, reg)) & GPIO_BIT(offset));
 
        spin_unlock_irqrestore(&gpio->lock, flags);
@@ -143,22 +191,31 @@ static int aspeed_sgpio_get(struct gpio_chip *gc, unsigned int offset)
        return rc;
 }
 
-static void sgpio_set_value(struct gpio_chip *gc, unsigned int offset, int val)
+static int sgpio_set_value(struct gpio_chip *gc, unsigned int offset, int val)
 {
        struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
        const struct aspeed_sgpio_bank *bank = to_bank(offset);
-       void __iomem *addr;
+       void __iomem *addr_r, *addr_w;
        u32 reg = 0;
 
-       addr = bank_reg(gpio, bank, reg_val);
-       reg = ioread32(addr);
+       if (aspeed_sgpio_is_input(offset))
+               return -EINVAL;
+
+       /* Since this is an output, read the cached value from rdata, then
+        * update val. */
+       addr_r = bank_reg(gpio, bank, reg_rdata);
+       addr_w = bank_reg(gpio, bank, reg_val);
+
+       reg = ioread32(addr_r);
 
        if (val)
                reg |= GPIO_BIT(offset);
        else
                reg &= ~GPIO_BIT(offset);
 
-       iowrite32(reg, addr);
+       iowrite32(reg, addr_w);
+
+       return 0;
 }
 
 static void aspeed_sgpio_set(struct gpio_chip *gc, unsigned int offset, int val)
@@ -175,43 +232,28 @@ static void aspeed_sgpio_set(struct gpio_chip *gc, unsigned int offset, int val)
 
 static int aspeed_sgpio_dir_in(struct gpio_chip *gc, unsigned int offset)
 {
-       struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
-       unsigned long flags;
-
-       spin_lock_irqsave(&gpio->lock, flags);
-       gpio->dir_in[GPIO_BANK(offset)] |= GPIO_BIT(offset);
-       spin_unlock_irqrestore(&gpio->lock, flags);
-
-       return 0;
+       return aspeed_sgpio_is_input(offset) ? 0 : -EINVAL;
 }
 
 static int aspeed_sgpio_dir_out(struct gpio_chip *gc, unsigned int offset, int val)
 {
        struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
        unsigned long flags;
+       int rc;
 
-       spin_lock_irqsave(&gpio->lock, flags);
-
-       gpio->dir_in[GPIO_BANK(offset)] &= ~GPIO_BIT(offset);
-       sgpio_set_value(gc, offset, val);
+       /* No special action is required for setting the direction; we'll
+        * error-out in sgpio_set_value if this isn't an output GPIO */
 
+       spin_lock_irqsave(&gpio->lock, flags);
+       rc = sgpio_set_value(gc, offset, val);
        spin_unlock_irqrestore(&gpio->lock, flags);
 
-       return 0;
+       return rc;
 }
 
 static int aspeed_sgpio_get_direction(struct gpio_chip *gc, unsigned int offset)
 {
-       int dir_status;
-       struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
-       unsigned long flags;
-
-       spin_lock_irqsave(&gpio->lock, flags);
-       dir_status = gpio->dir_in[GPIO_BANK(offset)] & GPIO_BIT(offset);
-       spin_unlock_irqrestore(&gpio->lock, flags);
-
-       return dir_status;
-
+       return !!aspeed_sgpio_is_input(offset);
 }
 
 static void irqd_to_aspeed_sgpio_data(struct irq_data *d,
@@ -402,6 +444,7 @@ static int aspeed_sgpio_setup_irqs(struct aspeed_sgpio *gpio,
 
        irq = &gpio->chip.irq;
        irq->chip = &aspeed_sgpio_irqchip;
+       irq->init_valid_mask = aspeed_sgpio_irq_init_valid_mask;
        irq->handler = handle_bad_irq;
        irq->default_type = IRQ_TYPE_NONE;
        irq->parent_handler = aspeed_sgpio_irq_handler;
@@ -409,17 +452,15 @@ static int aspeed_sgpio_setup_irqs(struct aspeed_sgpio *gpio,
        irq->parents = &gpio->irq;
        irq->num_parents = 1;
 
-       /* set IRQ settings and Enable Interrupt */
+       /* Apply default IRQ settings */
        for (i = 0; i < ARRAY_SIZE(aspeed_sgpio_banks); i++) {
                bank = &aspeed_sgpio_banks[i];
                /* set falling or level-low irq */
                iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type0));
                /* trigger type is edge */
                iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type1));
-               /* dual edge trigger mode. */
-               iowrite32(0xffffffff, bank_reg(gpio, bank, reg_irq_type2));
-               /* enable irq */
-               iowrite32(0xffffffff, bank_reg(gpio, bank, reg_irq_enable));
+               /* single edge trigger */
+               iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type2));
        }
 
        return 0;
@@ -452,11 +493,12 @@ static int __init aspeed_sgpio_probe(struct platform_device *pdev)
        if (rc < 0) {
                dev_err(&pdev->dev, "Could not read ngpios property\n");
                return -EINVAL;
-       } else if (nr_gpios > MAX_NR_SGPIO) {
+       } else if (nr_gpios > MAX_NR_HW_SGPIO) {
                dev_err(&pdev->dev, "Number of GPIOs exceeds the maximum of %d: %d\n",
-                       MAX_NR_SGPIO, nr_gpios);
+                       MAX_NR_HW_SGPIO, nr_gpios);
                return -EINVAL;
        }
+       gpio->n_sgpio = nr_gpios;
 
        rc = of_property_read_u32(pdev->dev.of_node, "bus-frequency", &sgpio_freq);
        if (rc < 0) {
@@ -497,7 +539,8 @@ static int __init aspeed_sgpio_probe(struct platform_device *pdev)
        spin_lock_init(&gpio->lock);
 
        gpio->chip.parent = &pdev->dev;
-       gpio->chip.ngpio = nr_gpios;
+       gpio->chip.ngpio = MAX_NR_HW_SGPIO * 2;
+       gpio->chip.init_valid_mask = aspeed_sgpio_init_valid_mask;
        gpio->chip.direction_input = aspeed_sgpio_dir_in;
        gpio->chip.direction_output = aspeed_sgpio_dir_out;
        gpio->chip.get_direction = aspeed_sgpio_get_direction;
@@ -509,9 +552,6 @@ static int __init aspeed_sgpio_probe(struct platform_device *pdev)
        gpio->chip.label = dev_name(&pdev->dev);
        gpio->chip.base = -1;
 
-       /* set all SGPIO pins as input (1). */
-       memset(gpio->dir_in, 0xff, sizeof(gpio->dir_in));
-
        aspeed_sgpio_setup_irqs(gpio, pdev);
 
        rc = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio);
index bf08b45..e44d5de 100644 (file)
@@ -1114,8 +1114,8 @@ static const struct aspeed_gpio_config ast2500_config =
 
 static const struct aspeed_bank_props ast2600_bank_props[] = {
        /*     input      output   */
-       {5, 0xffffffff,  0x0000ffff}, /* U/V/W/X */
-       {6, 0xffff0000,  0x0fff0000}, /* Y/Z */
+       {5, 0xffffffff,  0xffffff00}, /* U/V/W/X */
+       {6, 0x0000ffff,  0x0000ffff}, /* Y/Z */
        { },
 };
 
index bc34518..1652897 100644 (file)
@@ -552,6 +552,7 @@ static int __init gpio_mockup_init(void)
        err = platform_driver_register(&gpio_mockup_driver);
        if (err) {
                gpio_mockup_err("error registering platform driver\n");
+               debugfs_remove_recursive(gpio_mockup_dbg_dir);
                return err;
        }
 
@@ -582,6 +583,7 @@ static int __init gpio_mockup_init(void)
                        gpio_mockup_err("error registering device");
                        platform_driver_unregister(&gpio_mockup_driver);
                        gpio_mockup_unregister_pdevs();
+                       debugfs_remove_recursive(gpio_mockup_dbg_dir);
                        return PTR_ERR(pdev);
                }
 
index 7fbe0c9..0ea640f 100644 (file)
@@ -1516,7 +1516,7 @@ static int __maybe_unused omap_gpio_runtime_resume(struct device *dev)
        return 0;
 }
 
-static int omap_gpio_suspend(struct device *dev)
+static int __maybe_unused omap_gpio_suspend(struct device *dev)
 {
        struct gpio_bank *bank = dev_get_drvdata(dev);
 
@@ -1528,7 +1528,7 @@ static int omap_gpio_suspend(struct device *dev)
        return omap_gpio_runtime_suspend(dev);
 }
 
-static int omap_gpio_resume(struct device *dev)
+static int __maybe_unused omap_gpio_resume(struct device *dev)
 {
        struct gpio_bank *bank = dev_get_drvdata(dev);
 
index bd2e96c..fb61f2f 100644 (file)
@@ -818,6 +818,8 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
        int level;
        bool ret;
 
+       bitmap_zero(pending, MAX_LINE);
+
        mutex_lock(&chip->i2c_lock);
        ret = pca953x_irq_pending(chip, pending);
        mutex_unlock(&chip->i2c_lock);
@@ -940,6 +942,7 @@ out:
 static int device_pca957x_init(struct pca953x_chip *chip, u32 invert)
 {
        DECLARE_BITMAP(val, MAX_LINE);
+       unsigned int i;
        int ret;
 
        ret = device_pca95xx_init(chip, invert);
@@ -947,7 +950,9 @@ static int device_pca957x_init(struct pca953x_chip *chip, u32 invert)
                goto out;
 
        /* To enable register 6, 7 to control pull up and pull down */
-       memset(val, 0x02, NBANK(chip));
+       for (i = 0; i < NBANK(chip); i++)
+               bitmap_set_value8(val, 0x02, i * BANK_SZ);
+
        ret = pca953x_write_regs(chip, PCA957X_BKEN, val);
        if (ret)
                goto out;
index 26e1fe0..f8c5e9f 100644 (file)
@@ -245,6 +245,7 @@ static int gpio_siox_probe(struct siox_device *sdevice)
        girq->chip = &ddata->ichip;
        girq->default_type = IRQ_TYPE_NONE;
        girq->handler = handle_level_irq;
+       girq->threaded = true;
 
        ret = devm_gpiochip_add_data(dev, &ddata->gchip, NULL);
        if (ret)
index d7314d3..36ea8a3 100644 (file)
@@ -149,17 +149,20 @@ static int sprd_gpio_irq_set_type(struct irq_data *data,
                sprd_gpio_update(chip, offset, SPRD_GPIO_IS, 0);
                sprd_gpio_update(chip, offset, SPRD_GPIO_IBE, 0);
                sprd_gpio_update(chip, offset, SPRD_GPIO_IEV, 1);
+               sprd_gpio_update(chip, offset, SPRD_GPIO_IC, 1);
                irq_set_handler_locked(data, handle_edge_irq);
                break;
        case IRQ_TYPE_EDGE_FALLING:
                sprd_gpio_update(chip, offset, SPRD_GPIO_IS, 0);
                sprd_gpio_update(chip, offset, SPRD_GPIO_IBE, 0);
                sprd_gpio_update(chip, offset, SPRD_GPIO_IEV, 0);
+               sprd_gpio_update(chip, offset, SPRD_GPIO_IC, 1);
                irq_set_handler_locked(data, handle_edge_irq);
                break;
        case IRQ_TYPE_EDGE_BOTH:
                sprd_gpio_update(chip, offset, SPRD_GPIO_IS, 0);
                sprd_gpio_update(chip, offset, SPRD_GPIO_IBE, 1);
+               sprd_gpio_update(chip, offset, SPRD_GPIO_IC, 1);
                irq_set_handler_locked(data, handle_edge_irq);
                break;
        case IRQ_TYPE_LEVEL_HIGH:
index 58b0da9..ea3f68a 100644 (file)
@@ -212,7 +212,7 @@ static void tc3589x_gpio_irq_sync_unlock(struct irq_data *d)
                                continue;
 
                        tc3589x_gpio->oldregs[i][j] = new;
-                       tc3589x_reg_write(tc3589x, regmap[i] + j * 8, new);
+                       tc3589x_reg_write(tc3589x, regmap[i] + j, new);
                }
        }
 
index e6c9b78..76c36b0 100644 (file)
@@ -423,6 +423,21 @@ static __poll_t lineevent_poll(struct file *file,
        return events;
 }
 
+static ssize_t lineevent_get_size(void)
+{
+#ifdef __x86_64__
+       /* i386 has no padding after 'id' */
+       if (in_ia32_syscall()) {
+               struct compat_gpioeevent_data {
+                       compat_u64      timestamp;
+                       u32             id;
+               };
+
+               return sizeof(struct compat_gpioeevent_data);
+       }
+#endif
+       return sizeof(struct gpioevent_data);
+}
 
 static ssize_t lineevent_read(struct file *file,
                              char __user *buf,
@@ -432,9 +447,20 @@ static ssize_t lineevent_read(struct file *file,
        struct lineevent_state *le = file->private_data;
        struct gpioevent_data ge;
        ssize_t bytes_read = 0;
+       ssize_t ge_size;
        int ret;
 
-       if (count < sizeof(ge))
+       /*
+        * When compatible system call is being used the struct gpioevent_data,
+        * in case of at least ia32, has different size due to the alignment
+        * differences. Because we have first member 64 bits followed by one of
+        * 32 bits there is no gap between them. The only difference is the
+        * padding at the end of the data structure. Hence, we calculate the
+        * actual sizeof() and pass this as an argument to copy_to_user() to
+        * drop unneeded bytes from the output.
+        */
+       ge_size = lineevent_get_size();
+       if (count < ge_size)
                return -EINVAL;
 
        do {
@@ -470,10 +496,10 @@ static ssize_t lineevent_read(struct file *file,
                        break;
                }
 
-               if (copy_to_user(buf + bytes_read, &ge, sizeof(ge)))
+               if (copy_to_user(buf + bytes_read, &ge, ge_size))
                        return -EFAULT;
-               bytes_read += sizeof(ge);
-       } while (count >= bytes_read + sizeof(ge));
+               bytes_read += ge_size;
+       } while (count >= bytes_read + ge_size);
 
        return bytes_read;
 }
index eb7cfe8..d0b8d0d 100644 (file)
@@ -80,8 +80,6 @@ MODULE_FIRMWARE("amdgpu/renoir_gpu_info.bin");
 MODULE_FIRMWARE("amdgpu/navi10_gpu_info.bin");
 MODULE_FIRMWARE("amdgpu/navi14_gpu_info.bin");
 MODULE_FIRMWARE("amdgpu/navi12_gpu_info.bin");
-MODULE_FIRMWARE("amdgpu/sienna_cichlid_gpu_info.bin");
-MODULE_FIRMWARE("amdgpu/navy_flounder_gpu_info.bin");
 
 #define AMDGPU_RESUME_MS               2000
 
@@ -1600,6 +1598,8 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
        case CHIP_CARRIZO:
        case CHIP_STONEY:
        case CHIP_VEGA20:
+       case CHIP_SIENNA_CICHLID:
+       case CHIP_NAVY_FLOUNDER:
        default:
                return 0;
        case CHIP_VEGA10:
@@ -1631,12 +1631,6 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
        case CHIP_NAVI12:
                chip_name = "navi12";
                break;
-       case CHIP_SIENNA_CICHLID:
-               chip_name = "sienna_cichlid";
-               break;
-       case CHIP_NAVY_FLOUNDER:
-               chip_name = "navy_flounder";
-               break;
        }
 
        snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_gpu_info.bin", chip_name);
index d761729..44c1f6e 100644 (file)
@@ -297,7 +297,7 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
           take the current one */
        if (active && !adev->have_disp_power_ref) {
                adev->have_disp_power_ref = true;
-               goto out;
+               return ret;
        }
        /* if we have no active crtcs, then drop the power ref
           we got before */
index 26127c7..321032d 100644 (file)
@@ -1044,8 +1044,16 @@ static const struct pci_device_id pciidlist[] = {
        {0x1002, 0x1636, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RENOIR|AMD_IS_APU},
 
        /* Navi12 */
-       {0x1002, 0x7360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI12|AMD_EXP_HW_SUPPORT},
-       {0x1002, 0x7362, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI12|AMD_EXP_HW_SUPPORT},
+       {0x1002, 0x7360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI12},
+       {0x1002, 0x7362, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI12},
+
+       /* Sienna_Cichlid */
+       {0x1002, 0x73A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID},
+       {0x1002, 0x73A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID},
+       {0x1002, 0x73A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID},
+       {0x1002, 0x73AB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID},
+       {0x1002, 0x73AE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID},
+       {0x1002, 0x73BF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID},
 
        {0, 0, 0}
 };
index e11c5d6..978bae7 100644 (file)
@@ -1076,6 +1076,7 @@ static int amdgpu_ttm_tt_pin_userptr(struct ttm_tt *ttm)
 
 release_sg:
        kfree(ttm->sg);
+       ttm->sg = NULL;
        return r;
 }
 
index 037a187..f73ce97 100644 (file)
@@ -3595,6 +3595,9 @@ static void gfx_v10_0_check_gfxoff_flag(struct amdgpu_device *adev)
                if (!gfx_v10_0_navi10_gfxoff_should_enable(adev))
                        adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
                break;
+       case CHIP_NAVY_FLOUNDER:
+               adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
+               break;
        default:
                break;
        }
index 63e5547..3a805ea 100644 (file)
@@ -746,18 +746,18 @@ static void vcn_v3_0_disable_clock_gating(struct amdgpu_device *adev, int inst)
                | UVD_SUVD_CGC_GATE__IME_HEVC_MASK
                | UVD_SUVD_CGC_GATE__EFC_MASK
                | UVD_SUVD_CGC_GATE__SAOE_MASK
-               | 0x08000000
+               | UVD_SUVD_CGC_GATE__SRE_AV1_MASK
                | UVD_SUVD_CGC_GATE__FBC_PCLK_MASK
                | UVD_SUVD_CGC_GATE__FBC_CCLK_MASK
-               | 0x40000000
+               | UVD_SUVD_CGC_GATE__SCM_AV1_MASK
                | UVD_SUVD_CGC_GATE__SMPA_MASK);
        WREG32_SOC15(VCN, inst, mmUVD_SUVD_CGC_GATE, data);
 
        data = RREG32_SOC15(VCN, inst, mmUVD_SUVD_CGC_GATE2);
        data |= (UVD_SUVD_CGC_GATE2__MPBE0_MASK
                | UVD_SUVD_CGC_GATE2__MPBE1_MASK
-               | 0x00000004
-               | 0x00000008
+               | UVD_SUVD_CGC_GATE2__SIT_AV1_MASK
+               | UVD_SUVD_CGC_GATE2__SDB_AV1_MASK
                | UVD_SUVD_CGC_GATE2__MPC1_MASK);
        WREG32_SOC15(VCN, inst, mmUVD_SUVD_CGC_GATE2, data);
 
@@ -776,8 +776,8 @@ static void vcn_v3_0_disable_clock_gating(struct amdgpu_device *adev, int inst)
                | UVD_SUVD_CGC_CTRL__SMPA_MODE_MASK
                | UVD_SUVD_CGC_CTRL__MPBE0_MODE_MASK
                | UVD_SUVD_CGC_CTRL__MPBE1_MODE_MASK
-               | 0x00008000
-               | 0x00010000
+               | UVD_SUVD_CGC_CTRL__SIT_AV1_MODE_MASK
+               | UVD_SUVD_CGC_CTRL__SDB_AV1_MODE_MASK
                | UVD_SUVD_CGC_CTRL__MPC1_MODE_MASK
                | UVD_SUVD_CGC_CTRL__FBC_PCLK_MASK
                | UVD_SUVD_CGC_CTRL__FBC_CCLK_MASK);
@@ -892,8 +892,8 @@ static void vcn_v3_0_enable_clock_gating(struct amdgpu_device *adev, int inst)
                | UVD_SUVD_CGC_CTRL__SMPA_MODE_MASK
                | UVD_SUVD_CGC_CTRL__MPBE0_MODE_MASK
                | UVD_SUVD_CGC_CTRL__MPBE1_MODE_MASK
-               | 0x00008000
-               | 0x00010000
+               | UVD_SUVD_CGC_CTRL__SIT_AV1_MODE_MASK
+               | UVD_SUVD_CGC_CTRL__SDB_AV1_MODE_MASK
                | UVD_SUVD_CGC_CTRL__MPC1_MODE_MASK
                | UVD_SUVD_CGC_CTRL__FBC_PCLK_MASK
                | UVD_SUVD_CGC_CTRL__FBC_CCLK_MASK);
index 694c5bc..c2cd184 100644 (file)
@@ -604,7 +604,7 @@ struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, struct
        int i = 0;
 
        hdcp_work = kcalloc(max_caps, sizeof(*hdcp_work), GFP_KERNEL);
-       if (hdcp_work == NULL)
+       if (ZERO_OR_NULL_PTR(hdcp_work))
                return NULL;
 
        hdcp_work->srm = kcalloc(PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE, sizeof(*hdcp_work->srm), GFP_KERNEL);
index 543afa3..21a3073 100644 (file)
@@ -783,7 +783,6 @@ void rn_clk_mgr_construct(
        } else {
                struct clk_log_info log_info = {0};
 
-               clk_mgr->smu_ver = rn_vbios_smu_get_smu_version(clk_mgr);
                clk_mgr->periodic_retraining_disabled = rn_vbios_smu_is_periodic_retraining_disabled(clk_mgr);
 
                /* SMU Version 55.51.0 and up no longer have an issue
index 025637a..bd2a068 100644 (file)
@@ -31,9 +31,21 @@ DCN30 = dcn30_init.o dcn30_hubbub.o dcn30_hubp.o dcn30_dpp.o dcn30_optc.o \
        dcn30_dio_link_encoder.o dcn30_resource.o
 
 
-CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse -mpreferred-stack-boundary=4
-
+ifdef CONFIG_X86
 CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse
+endif
+
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -maltivec
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -maltivec
+endif
+
+ifdef CONFIG_ARM64
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mgeneral-regs-only
+CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mgeneral-regs-only
+endif
+
 ifdef CONFIG_CC_IS_GCC
 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
 IS_OLD_GCC = 1
@@ -45,8 +57,10 @@ ifdef IS_OLD_GCC
 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
 # (8B stack alignment).
 CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -mpreferred-stack-boundary=4
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -mpreferred-stack-boundary=4
 else
 CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -msse2
+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -msse2
 endif
 
 AMD_DAL_DCN30 = $(addprefix $(AMDDALPATH)/dc/dcn30/,$(DCN30))
index 1116779..e245e91 100644 (file)
 #define mmDB_STENCIL_WRITE_BASE_DEFAULT                                          0x00000000
 #define mmDB_RESERVED_REG_1_DEFAULT                                              0x00000000
 #define mmDB_RESERVED_REG_3_DEFAULT                                              0x00000000
+#define mmDB_VRS_OVERRIDE_CNTL_DEFAULT                                           0x00000000
 #define mmDB_Z_READ_BASE_HI_DEFAULT                                              0x00000000
 #define mmDB_STENCIL_READ_BASE_HI_DEFAULT                                        0x00000000
 #define mmDB_Z_WRITE_BASE_HI_DEFAULT                                             0x00000000
 #define mmPA_SU_OVER_RASTERIZATION_CNTL_DEFAULT                                  0x00000000
 #define mmPA_STEREO_CNTL_DEFAULT                                                 0x00000000
 #define mmPA_STATE_STEREO_X_DEFAULT                                              0x00000000
+#define mmPA_CL_VRS_CNTL_DEFAULT                                                 0x00000000
 #define mmPA_SU_POINT_SIZE_DEFAULT                                               0x00000000
 #define mmPA_SU_POINT_MINMAX_DEFAULT                                             0x00000000
 #define mmPA_SU_LINE_CNTL_DEFAULT                                                0x00000000
index 05d1b0a..644a9fa 100644 (file)
 #define mmDB_RESERVED_REG_1_BASE_IDX                                                                   1
 #define mmDB_RESERVED_REG_3                                                                            0x0017
 #define mmDB_RESERVED_REG_3_BASE_IDX                                                                   1
+#define mmDB_VRS_OVERRIDE_CNTL                                                                         0x0019
+#define mmDB_VRS_OVERRIDE_CNTL_BASE_IDX                                                                1
 #define mmDB_Z_READ_BASE_HI                                                                            0x001a
 #define mmDB_Z_READ_BASE_HI_BASE_IDX                                                                   1
 #define mmDB_STENCIL_READ_BASE_HI                                                                      0x001b
 #define mmPA_STEREO_CNTL_BASE_IDX                                                                      1
 #define mmPA_STATE_STEREO_X                                                                            0x0211
 #define mmPA_STATE_STEREO_X_BASE_IDX                                                                   1
+#define mmPA_CL_VRS_CNTL                                                                               0x0212
+#define mmPA_CL_VRS_CNTL_BASE_IDX                                                                      1
 #define mmPA_SU_POINT_SIZE                                                                             0x0280
 #define mmPA_SU_POINT_SIZE_BASE_IDX                                                                    1
 #define mmPA_SU_POINT_MINMAX                                                                           0x0281
index aac57f7..2e449fc 100644 (file)
 #define DB_EXCEPTION_CONTROL__AUTO_FLUSH_HTILE__SHIFT                                                         0x3
 #define DB_EXCEPTION_CONTROL__AUTO_FLUSH_QUAD__SHIFT                                                          0x4
 #define DB_EXCEPTION_CONTROL__FORCE_SUMMARIZE__SHIFT                                                          0x8
+#define DB_EXCEPTION_CONTROL__FORCE_VRS_RATE_FINE__SHIFT                                                      0x10
 #define DB_EXCEPTION_CONTROL__DTAG_WATERMARK__SHIFT                                                           0x18
 #define DB_EXCEPTION_CONTROL__EARLY_Z_PANIC_DISABLE_MASK                                                      0x00000001L
 #define DB_EXCEPTION_CONTROL__LATE_Z_PANIC_DISABLE_MASK                                                       0x00000002L
 #define DB_EXCEPTION_CONTROL__AUTO_FLUSH_HTILE_MASK                                                           0x00000008L
 #define DB_EXCEPTION_CONTROL__AUTO_FLUSH_QUAD_MASK                                                            0x00000010L
 #define DB_EXCEPTION_CONTROL__FORCE_SUMMARIZE_MASK                                                            0x00000F00L
+#define DB_EXCEPTION_CONTROL__FORCE_VRS_RATE_FINE_MASK                                                        0x00FF0000L
 #define DB_EXCEPTION_CONTROL__DTAG_WATERMARK_MASK                                                             0x7F000000L
 //DB_DFSM_CONFIG
 #define DB_DFSM_CONFIG__BYPASS_DFSM__SHIFT                                                                    0x0
 #define CB_HW_CONTROL_3__DISABLE_NACK_PROCESSING_CM__SHIFT                                                    0x18
 #define CB_HW_CONTROL_3__DISABLE_NACK_COLOR_RD_WR_OPT__SHIFT                                                  0x19
 #define CB_HW_CONTROL_3__DISABLE_BLENDER_CLOCK_GATING__SHIFT                                                  0x1a
+#define CB_HW_CONTROL_3__DISABLE_DCC_VRS_OPT__SHIFT                                                           0x1c
 #define CB_HW_CONTROL_3__DISABLE_FMASK_NOFETCH_OPT__SHIFT                                                     0x1e
 #define CB_HW_CONTROL_3__DISABLE_FMASK_NOFETCH_OPT_BC__SHIFT                                                  0x1f
 #define CB_HW_CONTROL_3__DISABLE_SLOW_MODE_EMPTY_HALF_QUAD_KILL_MASK                                          0x00000001L
 #define CB_HW_CONTROL_3__DISABLE_NACK_PROCESSING_CM_MASK                                                      0x01000000L
 #define CB_HW_CONTROL_3__DISABLE_NACK_COLOR_RD_WR_OPT_MASK                                                    0x02000000L
 #define CB_HW_CONTROL_3__DISABLE_BLENDER_CLOCK_GATING_MASK                                                    0x04000000L
+#define CB_HW_CONTROL_3__DISABLE_DCC_VRS_OPT_MASK                                                             0x10000000L
 #define CB_HW_CONTROL_3__DISABLE_FMASK_NOFETCH_OPT_MASK                                                       0x40000000L
 #define CB_HW_CONTROL_3__DISABLE_FMASK_NOFETCH_OPT_BC_MASK                                                    0x80000000L
 //CB_HW_CONTROL
 #define CB_HW_CONTROL__ALLOW_MRT_WITH_DUAL_SOURCE__SHIFT                                                      0x0
+#define CB_HW_CONTROL__DISABLE_VRS_FILLRATE_OPTIMIZATION__SHIFT                                               0x1
 #define CB_HW_CONTROL__DISABLE_FILLRATE_OPT_FIX_WITH_CFC__SHIFT                                               0x3
 #define CB_HW_CONTROL__DISABLE_POST_DCC_WITH_CFC_FIX__SHIFT                                                   0x4
+#define CB_HW_CONTROL__DISABLE_COMPRESS_1FRAG_WHEN_VRS_RATE_HINT_EN__SHIFT                                    0x5
 #define CB_HW_CONTROL__RMI_CREDITS__SHIFT                                                                     0x6
 #define CB_HW_CONTROL__CHICKEN_BITS__SHIFT                                                                    0xc
 #define CB_HW_CONTROL__DISABLE_FMASK_MULTI_MGCG_DOMAINS__SHIFT                                                0xf
 #define CB_HW_CONTROL__DISABLE_CC_IB_SERIALIZER_STATE_OPT__SHIFT                                              0x1e
 #define CB_HW_CONTROL__DISABLE_PIXEL_IN_QUAD_FIX_FOR_LINEAR_SURFACE__SHIFT                                    0x1f
 #define CB_HW_CONTROL__ALLOW_MRT_WITH_DUAL_SOURCE_MASK                                                        0x00000001L
+#define CB_HW_CONTROL__DISABLE_VRS_FILLRATE_OPTIMIZATION_MASK                                                 0x00000002L
 #define CB_HW_CONTROL__DISABLE_FILLRATE_OPT_FIX_WITH_CFC_MASK                                                 0x00000008L
 #define CB_HW_CONTROL__DISABLE_POST_DCC_WITH_CFC_FIX_MASK                                                     0x00000010L
+#define CB_HW_CONTROL__DISABLE_COMPRESS_1FRAG_WHEN_VRS_RATE_HINT_EN_MASK                                      0x00000020L
 #define CB_HW_CONTROL__RMI_CREDITS_MASK                                                                       0x00000FC0L
 #define CB_HW_CONTROL__CHICKEN_BITS_MASK                                                                      0x00007000L
 #define CB_HW_CONTROL__DISABLE_FMASK_MULTI_MGCG_DOMAINS_MASK                                                  0x00008000L
 #define DB_RENDER_OVERRIDE2__PRESERVE_SRESULTS__SHIFT                                                         0x16
 #define DB_RENDER_OVERRIDE2__DISABLE_FAST_PASS__SHIFT                                                         0x17
 #define DB_RENDER_OVERRIDE2__ALLOW_PARTIAL_RES_HIER_KILL__SHIFT                                               0x19
+#define DB_RENDER_OVERRIDE2__FORCE_VRS_RATE_FINE__SHIFT                                                       0x1a
 #define DB_RENDER_OVERRIDE2__CENTROID_COMPUTATION_MODE__SHIFT                                                 0x1b
 #define DB_RENDER_OVERRIDE2__PARTIAL_SQUAD_LAUNCH_CONTROL_MASK                                                0x00000003L
 #define DB_RENDER_OVERRIDE2__PARTIAL_SQUAD_LAUNCH_COUNTDOWN_MASK                                              0x0000001CL
 #define DB_RENDER_OVERRIDE2__PRESERVE_SRESULTS_MASK                                                           0x00400000L
 #define DB_RENDER_OVERRIDE2__DISABLE_FAST_PASS_MASK                                                           0x00800000L
 #define DB_RENDER_OVERRIDE2__ALLOW_PARTIAL_RES_HIER_KILL_MASK                                                 0x02000000L
+#define DB_RENDER_OVERRIDE2__FORCE_VRS_RATE_FINE_MASK                                                         0x04000000L
 #define DB_RENDER_OVERRIDE2__CENTROID_COMPUTATION_MODE_MASK                                                   0x18000000L
 //DB_HTILE_DATA_BASE
 #define DB_HTILE_DATA_BASE__BASE_256B__SHIFT                                                                  0x0
 //DB_RESERVED_REG_3
 #define DB_RESERVED_REG_3__FIELD_1__SHIFT                                                                     0x0
 #define DB_RESERVED_REG_3__FIELD_1_MASK                                                                       0x003FFFFFL
+//DB_VRS_OVERRIDE_CNTL
+#define DB_VRS_OVERRIDE_CNTL__VRS_OVERRIDE_RATE_COMBINER_MODE__SHIFT                                          0x0
+#define DB_VRS_OVERRIDE_CNTL__VRS_OVERRIDE_RATE_X__SHIFT                                                      0x4
+#define DB_VRS_OVERRIDE_CNTL__VRS_OVERRIDE_RATE_Y__SHIFT                                                      0x6
+#define DB_VRS_OVERRIDE_CNTL__VRS_OVERRIDE_RATE_COMBINER_MODE_MASK                                            0x00000007L
+#define DB_VRS_OVERRIDE_CNTL__VRS_OVERRIDE_RATE_X_MASK                                                        0x00000030L
+#define DB_VRS_OVERRIDE_CNTL__VRS_OVERRIDE_RATE_Y_MASK                                                        0x000000C0L
 //DB_Z_READ_BASE_HI
 #define DB_Z_READ_BASE_HI__BASE_HI__SHIFT                                                                     0x0
 #define DB_Z_READ_BASE_HI__BASE_HI_MASK                                                                       0x000000FFL
 #define PA_CL_VS_OUT_CNTL__VS_OUT_MISC_SIDE_BUS_ENA__SHIFT                                                    0x18
 #define PA_CL_VS_OUT_CNTL__USE_VTX_GS_CUT_FLAG__SHIFT                                                         0x19
 #define PA_CL_VS_OUT_CNTL__USE_VTX_LINE_WIDTH__SHIFT                                                          0x1b
+#define PA_CL_VS_OUT_CNTL__USE_VTX_VRS_RATE__SHIFT                                                            0x1c
 #define PA_CL_VS_OUT_CNTL__BYPASS_VTX_RATE_COMBINER__SHIFT                                                    0x1d
 #define PA_CL_VS_OUT_CNTL__BYPASS_PRIM_RATE_COMBINER__SHIFT                                                   0x1e
 #define PA_CL_VS_OUT_CNTL__CLIP_DIST_ENA_0_MASK                                                               0x00000001L
 #define PA_CL_VS_OUT_CNTL__VS_OUT_MISC_SIDE_BUS_ENA_MASK                                                      0x01000000L
 #define PA_CL_VS_OUT_CNTL__USE_VTX_GS_CUT_FLAG_MASK                                                           0x02000000L
 #define PA_CL_VS_OUT_CNTL__USE_VTX_LINE_WIDTH_MASK                                                            0x08000000L
+#define PA_CL_VS_OUT_CNTL__USE_VTX_VRS_RATE_MASK                                                              0x10000000L
 #define PA_CL_VS_OUT_CNTL__BYPASS_VTX_RATE_COMBINER_MASK                                                      0x20000000L
 #define PA_CL_VS_OUT_CNTL__BYPASS_PRIM_RATE_COMBINER_MASK                                                     0x40000000L
 //PA_CL_NANINF_CNTL
 //PA_STATE_STEREO_X
 #define PA_STATE_STEREO_X__STEREO_X_OFFSET__SHIFT                                                             0x0
 #define PA_STATE_STEREO_X__STEREO_X_OFFSET_MASK                                                               0xFFFFFFFFL
+//PA_CL_VRS_CNTL
+#define PA_CL_VRS_CNTL__VERTEX_RATE_COMBINER_MODE__SHIFT                                                      0x0
+#define PA_CL_VRS_CNTL__PRIMITIVE_RATE_COMBINER_MODE__SHIFT                                                   0x3
+#define PA_CL_VRS_CNTL__HTILE_RATE_COMBINER_MODE__SHIFT                                                       0x6
+#define PA_CL_VRS_CNTL__SAMPLE_ITER_COMBINER_MODE__SHIFT                                                      0x9
+#define PA_CL_VRS_CNTL__EXPOSE_VRS_PIXELS_MASK__SHIFT                                                         0xd
+#define PA_CL_VRS_CNTL__CMASK_RATE_HINT_FORCE_ZERO__SHIFT                                                     0xe
+#define PA_CL_VRS_CNTL__VERTEX_RATE_COMBINER_MODE_MASK                                                        0x00000007L
+#define PA_CL_VRS_CNTL__PRIMITIVE_RATE_COMBINER_MODE_MASK                                                     0x00000038L
+#define PA_CL_VRS_CNTL__HTILE_RATE_COMBINER_MODE_MASK                                                         0x000001C0L
+#define PA_CL_VRS_CNTL__SAMPLE_ITER_COMBINER_MODE_MASK                                                        0x00000E00L
+#define PA_CL_VRS_CNTL__EXPOSE_VRS_PIXELS_MASK_MASK                                                           0x00002000L
+#define PA_CL_VRS_CNTL__CMASK_RATE_HINT_FORCE_ZERO_MASK                                                       0x00004000L
 //PA_SU_POINT_SIZE
 #define PA_SU_POINT_SIZE__HEIGHT__SHIFT                                                                       0x0
 #define PA_SU_POINT_SIZE__WIDTH__SHIFT                                                                        0x10
 #define DB_HTILE_SURFACE__DST_OUTSIDE_ZERO_TO_ONE__SHIFT                                                      0x10
 #define DB_HTILE_SURFACE__RESERVED_FIELD_6__SHIFT                                                             0x11
 #define DB_HTILE_SURFACE__PIPE_ALIGNED__SHIFT                                                                 0x12
+#define DB_HTILE_SURFACE__VRS_HTILE_ENCODING__SHIFT                                                           0x13
 #define DB_HTILE_SURFACE__RESERVED_FIELD_1_MASK                                                               0x00000001L
 #define DB_HTILE_SURFACE__FULL_CACHE_MASK                                                                     0x00000002L
 #define DB_HTILE_SURFACE__RESERVED_FIELD_2_MASK                                                               0x00000004L
 #define DB_HTILE_SURFACE__DST_OUTSIDE_ZERO_TO_ONE_MASK                                                        0x00010000L
 #define DB_HTILE_SURFACE__RESERVED_FIELD_6_MASK                                                               0x00020000L
 #define DB_HTILE_SURFACE__PIPE_ALIGNED_MASK                                                                   0x00040000L
+#define DB_HTILE_SURFACE__VRS_HTILE_ENCODING_MASK                                                             0x00180000L
 //DB_SRESULTS_COMPARE_STATE0
 #define DB_SRESULTS_COMPARE_STATE0__COMPAREFUNC0__SHIFT                                                       0x0
 #define DB_SRESULTS_COMPARE_STATE0__COMPAREVALUE0__SHIFT                                                      0x4
 #define CB_COLOR0_ATTRIB3__CMASK_PIPE_ALIGNED__SHIFT                                                          0x1a
 #define CB_COLOR0_ATTRIB3__RESOURCE_LEVEL__SHIFT                                                              0x1b
 #define CB_COLOR0_ATTRIB3__DCC_PIPE_ALIGNED__SHIFT                                                            0x1e
+#define CB_COLOR0_ATTRIB3__VRS_RATE_HINT_ENABLE__SHIFT                                                        0x1f
 #define CB_COLOR0_ATTRIB3__MIP0_DEPTH_MASK                                                                    0x00001FFFL
 #define CB_COLOR0_ATTRIB3__META_LINEAR_MASK                                                                   0x00002000L
 #define CB_COLOR0_ATTRIB3__COLOR_SW_MODE_MASK                                                                 0x0007C000L
 #define CB_COLOR0_ATTRIB3__CMASK_PIPE_ALIGNED_MASK                                                            0x04000000L
 #define CB_COLOR0_ATTRIB3__RESOURCE_LEVEL_MASK                                                                0x38000000L
 #define CB_COLOR0_ATTRIB3__DCC_PIPE_ALIGNED_MASK                                                              0x40000000L
+#define CB_COLOR0_ATTRIB3__VRS_RATE_HINT_ENABLE_MASK                                                          0x80000000L
 //CB_COLOR1_ATTRIB3
 #define CB_COLOR1_ATTRIB3__MIP0_DEPTH__SHIFT                                                                  0x0
 #define CB_COLOR1_ATTRIB3__META_LINEAR__SHIFT                                                                 0xd
 #define CB_COLOR1_ATTRIB3__CMASK_PIPE_ALIGNED__SHIFT                                                          0x1a
 #define CB_COLOR1_ATTRIB3__RESOURCE_LEVEL__SHIFT                                                              0x1b
 #define CB_COLOR1_ATTRIB3__DCC_PIPE_ALIGNED__SHIFT                                                            0x1e
+#define CB_COLOR1_ATTRIB3__VRS_RATE_HINT_ENABLE__SHIFT                                                        0x1f
 #define CB_COLOR1_ATTRIB3__MIP0_DEPTH_MASK                                                                    0x00001FFFL
 #define CB_COLOR1_ATTRIB3__META_LINEAR_MASK                                                                   0x00002000L
 #define CB_COLOR1_ATTRIB3__COLOR_SW_MODE_MASK                                                                 0x0007C000L
 #define CB_COLOR1_ATTRIB3__CMASK_PIPE_ALIGNED_MASK                                                            0x04000000L
 #define CB_COLOR1_ATTRIB3__RESOURCE_LEVEL_MASK                                                                0x38000000L
 #define CB_COLOR1_ATTRIB3__DCC_PIPE_ALIGNED_MASK                                                              0x40000000L
+#define CB_COLOR1_ATTRIB3__VRS_RATE_HINT_ENABLE_MASK                                                          0x80000000L
 //CB_COLOR2_ATTRIB3
 #define CB_COLOR2_ATTRIB3__MIP0_DEPTH__SHIFT                                                                  0x0
 #define CB_COLOR2_ATTRIB3__META_LINEAR__SHIFT                                                                 0xd
 #define CB_COLOR2_ATTRIB3__CMASK_PIPE_ALIGNED__SHIFT                                                          0x1a
 #define CB_COLOR2_ATTRIB3__RESOURCE_LEVEL__SHIFT                                                              0x1b
 #define CB_COLOR2_ATTRIB3__DCC_PIPE_ALIGNED__SHIFT                                                            0x1e
+#define CB_COLOR2_ATTRIB3__VRS_RATE_HINT_ENABLE__SHIFT                                                        0x1f
 #define CB_COLOR2_ATTRIB3__MIP0_DEPTH_MASK                                                                    0x00001FFFL
 #define CB_COLOR2_ATTRIB3__META_LINEAR_MASK                                                                   0x00002000L
 #define CB_COLOR2_ATTRIB3__COLOR_SW_MODE_MASK                                                                 0x0007C000L
 #define CB_COLOR2_ATTRIB3__CMASK_PIPE_ALIGNED_MASK                                                            0x04000000L
 #define CB_COLOR2_ATTRIB3__RESOURCE_LEVEL_MASK                                                                0x38000000L
 #define CB_COLOR2_ATTRIB3__DCC_PIPE_ALIGNED_MASK                                                              0x40000000L
+#define CB_COLOR2_ATTRIB3__VRS_RATE_HINT_ENABLE_MASK                                                          0x80000000L
 //CB_COLOR3_ATTRIB3
 #define CB_COLOR3_ATTRIB3__MIP0_DEPTH__SHIFT                                                                  0x0
 #define CB_COLOR3_ATTRIB3__META_LINEAR__SHIFT                                                                 0xd
 #define CB_COLOR3_ATTRIB3__CMASK_PIPE_ALIGNED__SHIFT                                                          0x1a
 #define CB_COLOR3_ATTRIB3__RESOURCE_LEVEL__SHIFT                                                              0x1b
 #define CB_COLOR3_ATTRIB3__DCC_PIPE_ALIGNED__SHIFT                                                            0x1e
+#define CB_COLOR3_ATTRIB3__VRS_RATE_HINT_ENABLE__SHIFT                                                        0x1f
 #define CB_COLOR3_ATTRIB3__MIP0_DEPTH_MASK                                                                    0x00001FFFL
 #define CB_COLOR3_ATTRIB3__META_LINEAR_MASK                                                                   0x00002000L
 #define CB_COLOR3_ATTRIB3__COLOR_SW_MODE_MASK                                                                 0x0007C000L
 #define CB_COLOR3_ATTRIB3__CMASK_PIPE_ALIGNED_MASK                                                            0x04000000L
 #define CB_COLOR3_ATTRIB3__RESOURCE_LEVEL_MASK                                                                0x38000000L
 #define CB_COLOR3_ATTRIB3__DCC_PIPE_ALIGNED_MASK                                                              0x40000000L
+#define CB_COLOR3_ATTRIB3__VRS_RATE_HINT_ENABLE_MASK                                                          0x80000000L
 //CB_COLOR4_ATTRIB3
 #define CB_COLOR4_ATTRIB3__MIP0_DEPTH__SHIFT                                                                  0x0
 #define CB_COLOR4_ATTRIB3__META_LINEAR__SHIFT                                                                 0xd
 #define CB_COLOR4_ATTRIB3__CMASK_PIPE_ALIGNED__SHIFT                                                          0x1a
 #define CB_COLOR4_ATTRIB3__RESOURCE_LEVEL__SHIFT                                                              0x1b
 #define CB_COLOR4_ATTRIB3__DCC_PIPE_ALIGNED__SHIFT                                                            0x1e
+#define CB_COLOR4_ATTRIB3__VRS_RATE_HINT_ENABLE__SHIFT                                                        0x1f
 #define CB_COLOR4_ATTRIB3__MIP0_DEPTH_MASK                                                                    0x00001FFFL
 #define CB_COLOR4_ATTRIB3__META_LINEAR_MASK                                                                   0x00002000L
 #define CB_COLOR4_ATTRIB3__COLOR_SW_MODE_MASK                                                                 0x0007C000L
 #define CB_COLOR4_ATTRIB3__CMASK_PIPE_ALIGNED_MASK                                                            0x04000000L
 #define CB_COLOR4_ATTRIB3__RESOURCE_LEVEL_MASK                                                                0x38000000L
 #define CB_COLOR4_ATTRIB3__DCC_PIPE_ALIGNED_MASK                                                              0x40000000L
+#define CB_COLOR4_ATTRIB3__VRS_RATE_HINT_ENABLE_MASK                                                          0x80000000L
 //CB_COLOR5_ATTRIB3
 #define CB_COLOR5_ATTRIB3__MIP0_DEPTH__SHIFT                                                                  0x0
 #define CB_COLOR5_ATTRIB3__META_LINEAR__SHIFT                                                                 0xd
 #define CB_COLOR5_ATTRIB3__CMASK_PIPE_ALIGNED__SHIFT                                                          0x1a
 #define CB_COLOR5_ATTRIB3__RESOURCE_LEVEL__SHIFT                                                              0x1b
 #define CB_COLOR5_ATTRIB3__DCC_PIPE_ALIGNED__SHIFT                                                            0x1e
+#define CB_COLOR5_ATTRIB3__VRS_RATE_HINT_ENABLE__SHIFT                                                        0x1f
 #define CB_COLOR5_ATTRIB3__MIP0_DEPTH_MASK                                                                    0x00001FFFL
 #define CB_COLOR5_ATTRIB3__META_LINEAR_MASK                                                                   0x00002000L
 #define CB_COLOR5_ATTRIB3__COLOR_SW_MODE_MASK                                                                 0x0007C000L
 #define CB_COLOR5_ATTRIB3__CMASK_PIPE_ALIGNED_MASK                                                            0x04000000L
 #define CB_COLOR5_ATTRIB3__RESOURCE_LEVEL_MASK                                                                0x38000000L
 #define CB_COLOR5_ATTRIB3__DCC_PIPE_ALIGNED_MASK                                                              0x40000000L
+#define CB_COLOR5_ATTRIB3__VRS_RATE_HINT_ENABLE_MASK                                                          0x80000000L
 //CB_COLOR6_ATTRIB3
 #define CB_COLOR6_ATTRIB3__MIP0_DEPTH__SHIFT                                                                  0x0
 #define CB_COLOR6_ATTRIB3__META_LINEAR__SHIFT                                                                 0xd
 #define CB_COLOR6_ATTRIB3__CMASK_PIPE_ALIGNED__SHIFT                                                          0x1a
 #define CB_COLOR6_ATTRIB3__RESOURCE_LEVEL__SHIFT                                                              0x1b
 #define CB_COLOR6_ATTRIB3__DCC_PIPE_ALIGNED__SHIFT                                                            0x1e
+#define CB_COLOR6_ATTRIB3__VRS_RATE_HINT_ENABLE__SHIFT                                                        0x1f
 #define CB_COLOR6_ATTRIB3__MIP0_DEPTH_MASK                                                                    0x00001FFFL
 #define CB_COLOR6_ATTRIB3__META_LINEAR_MASK                                                                   0x00002000L
 #define CB_COLOR6_ATTRIB3__COLOR_SW_MODE_MASK                                                                 0x0007C000L
 #define CB_COLOR6_ATTRIB3__CMASK_PIPE_ALIGNED_MASK                                                            0x04000000L
 #define CB_COLOR6_ATTRIB3__RESOURCE_LEVEL_MASK                                                                0x38000000L
 #define CB_COLOR6_ATTRIB3__DCC_PIPE_ALIGNED_MASK                                                              0x40000000L
+#define CB_COLOR6_ATTRIB3__VRS_RATE_HINT_ENABLE_MASK                                                          0x80000000L
 //CB_COLOR7_ATTRIB3
 #define CB_COLOR7_ATTRIB3__MIP0_DEPTH__SHIFT                                                                  0x0
 #define CB_COLOR7_ATTRIB3__META_LINEAR__SHIFT                                                                 0xd
 #define CB_COLOR7_ATTRIB3__CMASK_PIPE_ALIGNED__SHIFT                                                          0x1a
 #define CB_COLOR7_ATTRIB3__RESOURCE_LEVEL__SHIFT                                                              0x1b
 #define CB_COLOR7_ATTRIB3__DCC_PIPE_ALIGNED__SHIFT                                                            0x1e
+#define CB_COLOR7_ATTRIB3__VRS_RATE_HINT_ENABLE__SHIFT                                                        0x1f
 #define CB_COLOR7_ATTRIB3__MIP0_DEPTH_MASK                                                                    0x00001FFFL
 #define CB_COLOR7_ATTRIB3__META_LINEAR_MASK                                                                   0x00002000L
 #define CB_COLOR7_ATTRIB3__COLOR_SW_MODE_MASK                                                                 0x0007C000L
 #define CB_COLOR7_ATTRIB3__CMASK_PIPE_ALIGNED_MASK                                                            0x04000000L
 #define CB_COLOR7_ATTRIB3__RESOURCE_LEVEL_MASK                                                                0x38000000L
 #define CB_COLOR7_ATTRIB3__DCC_PIPE_ALIGNED_MASK                                                              0x40000000L
+#define CB_COLOR7_ATTRIB3__VRS_RATE_HINT_ENABLE_MASK                                                          0x80000000L
 
 
 // addressBlock: gc_gfxudec
index c0efd90..58cf7ad 100644 (file)
 #define VCN_FEATURES__HAS_MJPEG2_IDCT_DEC__SHIFT                                                              0x7
 #define VCN_FEATURES__HAS_SCLR_DEC__SHIFT                                                                     0x8
 #define VCN_FEATURES__HAS_VP9_DEC__SHIFT                                                                      0x9
+#define VCN_FEATURES__HAS_AV1_DEC__SHIFT                                                                      0xa
 #define VCN_FEATURES__HAS_EFC_ENC__SHIFT                                                                      0xb
 #define VCN_FEATURES__HAS_EFC_HDR2SDR_ENC__SHIFT                                                              0xc
 #define VCN_FEATURES__HAS_DUAL_MJPEG_DEC__SHIFT                                                               0xd
 #define VCN_FEATURES__HAS_MJPEG2_IDCT_DEC_MASK                                                                0x00000080L
 #define VCN_FEATURES__HAS_SCLR_DEC_MASK                                                                       0x00000100L
 #define VCN_FEATURES__HAS_VP9_DEC_MASK                                                                        0x00000200L
+#define VCN_FEATURES__HAS_AV1_DEC_MASK                                                                        0x00000400L
 #define VCN_FEATURES__HAS_EFC_ENC_MASK                                                                        0x00000800L
 #define VCN_FEATURES__HAS_EFC_HDR2SDR_ENC_MASK                                                                0x00001000L
 #define VCN_FEATURES__HAS_DUAL_MJPEG_DEC_MASK                                                                 0x00002000L
 #define UVD_SUVD_CGC_GATE__IME_HEVC__SHIFT                                                                    0x18
 #define UVD_SUVD_CGC_GATE__EFC__SHIFT                                                                         0x19
 #define UVD_SUVD_CGC_GATE__SAOE__SHIFT                                                                        0x1a
+#define UVD_SUVD_CGC_GATE__SRE_AV1__SHIFT                                                                     0x1b
 #define UVD_SUVD_CGC_GATE__FBC_PCLK__SHIFT                                                                    0x1c
 #define UVD_SUVD_CGC_GATE__FBC_CCLK__SHIFT                                                                    0x1d
+#define UVD_SUVD_CGC_GATE__SCM_AV1__SHIFT                                                                     0x1e
 #define UVD_SUVD_CGC_GATE__SMPA__SHIFT                                                                        0x1f
 #define UVD_SUVD_CGC_GATE__SRE_MASK                                                                           0x00000001L
 #define UVD_SUVD_CGC_GATE__SIT_MASK                                                                           0x00000002L
 #define UVD_SUVD_CGC_GATE__IME_HEVC_MASK                                                                      0x01000000L
 #define UVD_SUVD_CGC_GATE__EFC_MASK                                                                           0x02000000L
 #define UVD_SUVD_CGC_GATE__SAOE_MASK                                                                          0x04000000L
+#define UVD_SUVD_CGC_GATE__SRE_AV1_MASK                                                                       0x08000000L
 #define UVD_SUVD_CGC_GATE__FBC_PCLK_MASK                                                                      0x10000000L
 #define UVD_SUVD_CGC_GATE__FBC_CCLK_MASK                                                                      0x20000000L
+#define UVD_SUVD_CGC_GATE__SCM_AV1_MASK                                                                       0x40000000L
 #define UVD_SUVD_CGC_GATE__SMPA_MASK                                                                          0x80000000L
 //UVD_SUVD_CGC_STATUS
 #define UVD_SUVD_CGC_STATUS__SRE_VCLK__SHIFT                                                                  0x0
 #define UVD_SUVD_CGC_STATUS__IME_HEVC_DCLK__SHIFT                                                             0x1b
 #define UVD_SUVD_CGC_STATUS__EFC_DCLK__SHIFT                                                                  0x1c
 #define UVD_SUVD_CGC_STATUS__SAOE_DCLK__SHIFT                                                                 0x1d
+#define UVD_SUVD_CGC_STATUS__SRE_AV1_VCLK__SHIFT                                                              0x1e
+#define UVD_SUVD_CGC_STATUS__SCM_AV1_DCLK__SHIFT                                                              0x1f
 #define UVD_SUVD_CGC_STATUS__SRE_VCLK_MASK                                                                    0x00000001L
 #define UVD_SUVD_CGC_STATUS__SRE_DCLK_MASK                                                                    0x00000002L
 #define UVD_SUVD_CGC_STATUS__SIT_DCLK_MASK                                                                    0x00000004L
 #define UVD_SUVD_CGC_STATUS__IME_HEVC_DCLK_MASK                                                               0x08000000L
 #define UVD_SUVD_CGC_STATUS__EFC_DCLK_MASK                                                                    0x10000000L
 #define UVD_SUVD_CGC_STATUS__SAOE_DCLK_MASK                                                                   0x20000000L
+#define UVD_SUVD_CGC_STATUS__SRE_AV1_VCLK_MASK                                                                0x40000000L
+#define UVD_SUVD_CGC_STATUS__SCM_AV1_DCLK_MASK                                                                0x80000000L
 //UVD_SUVD_CGC_CTRL
 #define UVD_SUVD_CGC_CTRL__SRE_MODE__SHIFT                                                                    0x0
 #define UVD_SUVD_CGC_CTRL__SIT_MODE__SHIFT                                                                    0x1
 #define UVD_SUVD_CGC_CTRL__SMPA_MODE__SHIFT                                                                   0xc
 #define UVD_SUVD_CGC_CTRL__MPBE0_MODE__SHIFT                                                                  0xd
 #define UVD_SUVD_CGC_CTRL__MPBE1_MODE__SHIFT                                                                  0xe
+#define UVD_SUVD_CGC_CTRL__SIT_AV1_MODE__SHIFT                                                                0xf
+#define UVD_SUVD_CGC_CTRL__SDB_AV1_MODE__SHIFT                                                                0x10
 #define UVD_SUVD_CGC_CTRL__MPC1_MODE__SHIFT                                                                   0x11
 #define UVD_SUVD_CGC_CTRL__FBC_PCLK__SHIFT                                                                    0x1c
 #define UVD_SUVD_CGC_CTRL__FBC_CCLK__SHIFT                                                                    0x1d
 #define UVD_SUVD_CGC_CTRL__SMPA_MODE_MASK                                                                     0x00001000L
 #define UVD_SUVD_CGC_CTRL__MPBE0_MODE_MASK                                                                    0x00002000L
 #define UVD_SUVD_CGC_CTRL__MPBE1_MODE_MASK                                                                    0x00004000L
+#define UVD_SUVD_CGC_CTRL__SIT_AV1_MODE_MASK                                                                  0x00008000L
+#define UVD_SUVD_CGC_CTRL__SDB_AV1_MODE_MASK                                                                  0x00010000L
 #define UVD_SUVD_CGC_CTRL__MPC1_MODE_MASK                                                                     0x00020000L
 #define UVD_SUVD_CGC_CTRL__FBC_PCLK_MASK                                                                      0x10000000L
 #define UVD_SUVD_CGC_CTRL__FBC_CCLK_MASK                                                                      0x20000000L
 #define UVD_SUVD_CGC_STATUS2__SMPA_VCLK__SHIFT                                                                0x0
 #define UVD_SUVD_CGC_STATUS2__SMPA_DCLK__SHIFT                                                                0x1
 #define UVD_SUVD_CGC_STATUS2__MPBE1_DCLK__SHIFT                                                               0x3
+#define UVD_SUVD_CGC_STATUS2__SIT_AV1_DCLK__SHIFT                                                             0x4
+#define UVD_SUVD_CGC_STATUS2__SDB_AV1_DCLK__SHIFT                                                             0x5
 #define UVD_SUVD_CGC_STATUS2__MPC1_DCLK__SHIFT                                                                0x6
 #define UVD_SUVD_CGC_STATUS2__MPC1_SCLK__SHIFT                                                                0x7
 #define UVD_SUVD_CGC_STATUS2__MPC1_VCLK__SHIFT                                                                0x8
 #define UVD_SUVD_CGC_STATUS2__SMPA_VCLK_MASK                                                                  0x00000001L
 #define UVD_SUVD_CGC_STATUS2__SMPA_DCLK_MASK                                                                  0x00000002L
 #define UVD_SUVD_CGC_STATUS2__MPBE1_DCLK_MASK                                                                 0x00000008L
+#define UVD_SUVD_CGC_STATUS2__SIT_AV1_DCLK_MASK                                                               0x00000010L
+#define UVD_SUVD_CGC_STATUS2__SDB_AV1_DCLK_MASK                                                               0x00000020L
 #define UVD_SUVD_CGC_STATUS2__MPC1_DCLK_MASK                                                                  0x00000040L
 #define UVD_SUVD_CGC_STATUS2__MPC1_SCLK_MASK                                                                  0x00000080L
 #define UVD_SUVD_CGC_STATUS2__MPC1_VCLK_MASK                                                                  0x00000100L
 //UVD_SUVD_CGC_GATE2
 #define UVD_SUVD_CGC_GATE2__MPBE0__SHIFT                                                                      0x0
 #define UVD_SUVD_CGC_GATE2__MPBE1__SHIFT                                                                      0x1
+#define UVD_SUVD_CGC_GATE2__SIT_AV1__SHIFT                                                                    0x2
+#define UVD_SUVD_CGC_GATE2__SDB_AV1__SHIFT                                                                    0x3
 #define UVD_SUVD_CGC_GATE2__MPC1__SHIFT                                                                       0x4
 #define UVD_SUVD_CGC_GATE2__MPBE0_MASK                                                                        0x00000001L
 #define UVD_SUVD_CGC_GATE2__MPBE1_MASK                                                                        0x00000002L
+#define UVD_SUVD_CGC_GATE2__SIT_AV1_MASK                                                                      0x00000004L
+#define UVD_SUVD_CGC_GATE2__SDB_AV1_MASK                                                                      0x00000008L
 #define UVD_SUVD_CGC_GATE2__MPC1_MASK                                                                         0x00000010L
 //UVD_SUVD_INT_STATUS2
 #define UVD_SUVD_INT_STATUS2__SMPA_FUNC_INT__SHIFT                                                            0x0
 #define UVD_SUVD_INT_STATUS2__SMPA_ERR_INT__SHIFT                                                             0x5
+#define UVD_SUVD_INT_STATUS2__SDB_AV1_FUNC_INT__SHIFT                                                         0x6
+#define UVD_SUVD_INT_STATUS2__SDB_AV1_ERR_INT__SHIFT                                                          0xb
 #define UVD_SUVD_INT_STATUS2__SMPA_FUNC_INT_MASK                                                              0x0000001FL
 #define UVD_SUVD_INT_STATUS2__SMPA_ERR_INT_MASK                                                               0x00000020L
+#define UVD_SUVD_INT_STATUS2__SDB_AV1_FUNC_INT_MASK                                                           0x000007C0L
+#define UVD_SUVD_INT_STATUS2__SDB_AV1_ERR_INT_MASK                                                            0x00000800L
 //UVD_SUVD_INT_EN2
 #define UVD_SUVD_INT_EN2__SMPA_FUNC_INT_EN__SHIFT                                                             0x0
 #define UVD_SUVD_INT_EN2__SMPA_ERR_INT_EN__SHIFT                                                              0x5
+#define UVD_SUVD_INT_EN2__SDB_AV1_FUNC_INT_EN__SHIFT                                                          0x6
+#define UVD_SUVD_INT_EN2__SDB_AV1_ERR_INT_EN__SHIFT                                                           0xb
 #define UVD_SUVD_INT_EN2__SMPA_FUNC_INT_EN_MASK                                                               0x0000001FL
 #define UVD_SUVD_INT_EN2__SMPA_ERR_INT_EN_MASK                                                                0x00000020L
+#define UVD_SUVD_INT_EN2__SDB_AV1_FUNC_INT_EN_MASK                                                            0x000007C0L
+#define UVD_SUVD_INT_EN2__SDB_AV1_ERR_INT_EN_MASK                                                             0x00000800L
 //UVD_SUVD_INT_ACK2
 #define UVD_SUVD_INT_ACK2__SMPA_FUNC_INT_ACK__SHIFT                                                           0x0
 #define UVD_SUVD_INT_ACK2__SMPA_ERR_INT_ACK__SHIFT                                                            0x5
+#define UVD_SUVD_INT_ACK2__SDB_AV1_FUNC_INT_ACK__SHIFT                                                        0x6
+#define UVD_SUVD_INT_ACK2__SDB_AV1_ERR_INT_ACK__SHIFT                                                         0xb
 #define UVD_SUVD_INT_ACK2__SMPA_FUNC_INT_ACK_MASK                                                             0x0000001FL
 #define UVD_SUVD_INT_ACK2__SMPA_ERR_INT_ACK_MASK                                                              0x00000020L
+#define UVD_SUVD_INT_ACK2__SDB_AV1_FUNC_INT_ACK_MASK                                                          0x000007C0L
+#define UVD_SUVD_INT_ACK2__SDB_AV1_ERR_INT_ACK_MASK                                                           0x00000800L
 
 
 // addressBlock: uvd0_ecpudec
index 63f945f..8dc5abb 100644 (file)
@@ -479,17 +479,6 @@ static int smu_late_init(void *handle)
                return ret;
        }
 
-       /*
-        * Set initialized values (get from vbios) to dpm tables context such as
-        * gfxclk, memclk, dcefclk, and etc. And enable the DPM feature for each
-        * type of clks.
-        */
-       ret = smu_set_default_dpm_table(smu);
-       if (ret) {
-               dev_err(adev->dev, "Failed to setup default dpm clock tables!\n");
-               return ret;
-       }
-
        ret = smu_populate_umd_state_clk(smu);
        if (ret) {
                dev_err(adev->dev, "Failed to populate UMD state clocks!\n");
@@ -984,6 +973,17 @@ static int smu_smc_hw_setup(struct smu_context *smu)
                return ret;
        }
 
+       /*
+        * Set initialized values (get from vbios) to dpm tables context such as
+        * gfxclk, memclk, dcefclk, and etc. And enable the DPM feature for each
+        * type of clks.
+        */
+       ret = smu_set_default_dpm_table(smu);
+       if (ret) {
+               dev_err(adev->dev, "Failed to setup default dpm clock tables!\n");
+               return ret;
+       }
+
        ret = smu_notify_display_change(smu);
        if (ret)
                return ret;
index 9ee8cf8..43f7adf 100644 (file)
@@ -563,6 +563,8 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,
        struct smu10_hwmgr *data = hwmgr->backend;
        uint32_t min_sclk = hwmgr->display_config->min_core_set_clock;
        uint32_t min_mclk = hwmgr->display_config->min_mem_set_clock/100;
+       uint32_t index_fclk = data->clock_vol_info.vdd_dep_on_fclk->count - 1;
+       uint32_t index_socclk = data->clock_vol_info.vdd_dep_on_socclk->count - 1;
 
        if (hwmgr->smu_version < 0x1E3700) {
                pr_info("smu firmware version too old, can not set dpm level\n");
@@ -676,13 +678,13 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,
                smum_send_msg_to_smc_with_parameter(hwmgr,
                                                PPSMC_MSG_SetHardMinFclkByFreq,
                                                hwmgr->display_config->num_display > 3 ?
-                                               SMU10_UMD_PSTATE_PEAK_FCLK :
+                                               data->clock_vol_info.vdd_dep_on_fclk->entries[0].clk :
                                                min_mclk,
                                                NULL);
 
                smum_send_msg_to_smc_with_parameter(hwmgr,
                                                PPSMC_MSG_SetHardMinSocclkByFreq,
-                                               SMU10_UMD_PSTATE_MIN_SOCCLK,
+                                               data->clock_vol_info.vdd_dep_on_socclk->entries[0].clk,
                                                NULL);
                smum_send_msg_to_smc_with_parameter(hwmgr,
                                                PPSMC_MSG_SetHardMinVcn,
@@ -695,11 +697,11 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,
                                                NULL);
                smum_send_msg_to_smc_with_parameter(hwmgr,
                                                PPSMC_MSG_SetSoftMaxFclkByFreq,
-                                               SMU10_UMD_PSTATE_PEAK_FCLK,
+                                               data->clock_vol_info.vdd_dep_on_fclk->entries[index_fclk].clk,
                                                NULL);
                smum_send_msg_to_smc_with_parameter(hwmgr,
                                                PPSMC_MSG_SetSoftMaxSocclkByFreq,
-                                               SMU10_UMD_PSTATE_PEAK_SOCCLK,
+                                               data->clock_vol_info.vdd_dep_on_socclk->entries[index_socclk].clk,
                                                NULL);
                smum_send_msg_to_smc_with_parameter(hwmgr,
                                                PPSMC_MSG_SetSoftMaxVcn,
index dbb676c..15263cf 100644 (file)
@@ -232,14 +232,16 @@ static int renoir_get_profiling_clk_mask(struct smu_context *smu,
                        *sclk_mask = 0;
        } else if (level == AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK) {
                if (mclk_mask)
-                       *mclk_mask = 0;
+                       /* mclk levels are in reverse order */
+                       *mclk_mask = NUM_MEMCLK_DPM_LEVELS - 1;
        } else if (level == AMD_DPM_FORCED_LEVEL_PROFILE_PEAK) {
                if(sclk_mask)
                        /* The sclk as gfxclk and has three level about max/min/current */
                        *sclk_mask = 3 - 1;
 
                if(mclk_mask)
-                       *mclk_mask = NUM_MEMCLK_DPM_LEVELS - 1;
+                       /* mclk levels are in reverse order */
+                       *mclk_mask = 0;
 
                if(soc_mask)
                        *soc_mask = NUM_SOCCLK_DPM_LEVELS - 1;
@@ -333,7 +335,7 @@ static int renoir_get_dpm_ultimate_freq(struct smu_context *smu,
                case SMU_UCLK:
                case SMU_FCLK:
                case SMU_MCLK:
-                       ret = renoir_get_dpm_clk_limited(smu, clk_type, 0, min);
+                       ret = renoir_get_dpm_clk_limited(smu, clk_type, NUM_MEMCLK_DPM_LEVELS - 1, min);
                        if (ret)
                                goto failed;
                        break;
index 4a76fc7..f8bdd4e 100644 (file)
@@ -55,7 +55,7 @@ static int vmw_gmrid_man_get_node(struct ttm_mem_type_manager *man,
 
        id = ida_alloc_max(&gman->gmr_ida, gman->max_gmr_ids - 1, GFP_KERNEL);
        if (id < 0)
-               return (id != -ENOMEM ? 0 : id);
+               return id;
 
        spin_lock(&gman->lock);
 
index b7c816b..c8b9335 100644 (file)
@@ -95,7 +95,7 @@ found_unlock:
                mem->start = node->start;
        }
 
-       return 0;
+       return ret;
 }
 
 
index 1213e19..24d584a 100644 (file)
@@ -65,6 +65,9 @@ struct i2c_ram {
        char    res1[4];        /* Reserved */
        ushort  rpbase;         /* Relocation pointer */
        char    res2[2];        /* Reserved */
+       /* The following elements are only for CPM2 */
+       char    res3[4];        /* Reserved */
+       uint    sdmatmp;        /* Internal */
 };
 
 #define I2COM_START    0x80
index ebb4c0b..bffca72 100644 (file)
@@ -1917,6 +1917,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
        pci_set_drvdata(dev, priv);
 
+       dev_pm_set_driver_flags(&dev->dev, DPM_FLAG_NO_DIRECT_COMPLETE);
        pm_runtime_set_autosuspend_delay(&dev->dev, 1000);
        pm_runtime_use_autosuspend(&dev->dev);
        pm_runtime_put_autosuspend(&dev->dev);
index dfcf04e..2ad1663 100644 (file)
@@ -2163,6 +2163,15 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
        if (bus->cmd_err == -EAGAIN)
                ret = i2c_recover_bus(adap);
 
+       /*
+        * After any type of error, check if LAST bit is still set,
+        * due to a HW issue.
+        * It cannot be cleared without resetting the module.
+        */
+       if (bus->cmd_err &&
+           (NPCM_I2CRXF_CTL_LAST_PEC & ioread8(bus->reg + NPCM_I2CRXF_CTL)))
+               npcm_i2c_reset(bus);
+
 #if IS_ENABLED(CONFIG_I2C_SLAVE)
        /* reenable slave if it was enabled */
        if (bus->slave)
index 8dce06e..766c733 100644 (file)
@@ -177,12 +177,12 @@ static const struct iio_chan_spec ad7124_channel_template = {
 
 static struct ad7124_chip_info ad7124_chip_info_tbl[] = {
        [ID_AD7124_4] = {
-               .name = "ad7127-4",
+               .name = "ad7124-4",
                .chip_id = CHIPID_AD7124_4,
                .num_inputs = 8,
        },
        [ID_AD7124_8] = {
-               .name = "ad7127-8",
+               .name = "ad7124-8",
                .chip_id = CHIPID_AD7124_8,
                .num_inputs = 16,
        },
index b4b73c9..c10aa28 100644 (file)
@@ -982,7 +982,7 @@ static int adc5_probe(struct platform_device *pdev)
 
 static struct platform_driver adc5_driver = {
        .driver = {
-               .name = "qcom-spmi-adc5.c",
+               .name = "qcom-spmi-adc5",
                .of_match_table = adc5_match_table,
        },
        .probe = adc5_probe,
index 854d5e7..ef2fa09 100644 (file)
@@ -282,6 +282,8 @@ static int trackpoint_start_protocol(struct psmouse *psmouse,
        case TP_VARIANT_ALPS:
        case TP_VARIANT_ELAN:
        case TP_VARIANT_NXP:
+       case TP_VARIANT_JYT_SYNAPTICS:
+       case TP_VARIANT_SYNAPTICS:
                if (variant_id)
                        *variant_id = param[0];
                if (firmware_id)
index 37fb9aa..a4c9b96 100644 (file)
@@ -721,6 +721,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = {
                        DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
                },
        },
+       {
+               /* Acer Aspire 5 A515 */
+               .matches = {
+                       DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
+                       DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
+               },
+       },
        { }
 };
 
index 445a08d..1ba6b4c 100644 (file)
@@ -1103,25 +1103,6 @@ static int __init add_early_maps(void)
        return 0;
 }
 
-/*
- * Reads the device exclusion range from ACPI and initializes the IOMMU with
- * it
- */
-static void __init set_device_exclusion_range(u16 devid, struct ivmd_header *m)
-{
-       if (!(m->flags & IVMD_FLAG_EXCL_RANGE))
-               return;
-
-       /*
-        * Treat per-device exclusion ranges as r/w unity-mapped regions
-        * since some buggy BIOSes might lead to the overwritten exclusion
-        * range (exclusion_start and exclusion_length members). This
-        * happens when there are multiple exclusion ranges (IVMD entries)
-        * defined in ACPI table.
-        */
-       m->flags = (IVMD_FLAG_IW | IVMD_FLAG_IR | IVMD_FLAG_UNITY_MAP);
-}
-
 /*
  * Takes a pointer to an AMD IOMMU entry in the ACPI table and
  * initializes the hardware and our data structures with it.
@@ -2073,30 +2054,6 @@ static void __init free_unity_maps(void)
        }
 }
 
-/* called when we find an exclusion range definition in ACPI */
-static int __init init_exclusion_range(struct ivmd_header *m)
-{
-       int i;
-
-       switch (m->type) {
-       case ACPI_IVMD_TYPE:
-               set_device_exclusion_range(m->devid, m);
-               break;
-       case ACPI_IVMD_TYPE_ALL:
-               for (i = 0; i <= amd_iommu_last_bdf; ++i)
-                       set_device_exclusion_range(i, m);
-               break;
-       case ACPI_IVMD_TYPE_RANGE:
-               for (i = m->devid; i <= m->aux; ++i)
-                       set_device_exclusion_range(i, m);
-               break;
-       default:
-               break;
-       }
-
-       return 0;
-}
-
 /* called for unity map ACPI definition */
 static int __init init_unity_map_range(struct ivmd_header *m)
 {
@@ -2107,9 +2064,6 @@ static int __init init_unity_map_range(struct ivmd_header *m)
        if (e == NULL)
                return -ENOMEM;
 
-       if (m->flags & IVMD_FLAG_EXCL_RANGE)
-               init_exclusion_range(m);
-
        switch (m->type) {
        default:
                kfree(e);
@@ -2133,6 +2087,16 @@ static int __init init_unity_map_range(struct ivmd_header *m)
        e->address_end = e->address_start + PAGE_ALIGN(m->range_length);
        e->prot = m->flags >> 1;
 
+       /*
+        * Treat per-device exclusion ranges as r/w unity-mapped regions
+        * since some buggy BIOSes might lead to the overwritten exclusion
+        * range (exclusion_start and exclusion_length members). This
+        * happens when there are multiple exclusion ranges (IVMD entries)
+        * defined in ACPI table.
+        */
+       if (m->flags & IVMD_FLAG_EXCL_RANGE)
+               e->prot = (IVMD_FLAG_IW | IVMD_FLAG_IR) >> 1;
+
        DUMP_printk("%s devid_start: %02x:%02x.%x devid_end: %02x:%02x.%x"
                    " range_start: %016llx range_end: %016llx flags: %x\n", s,
                    PCI_BUS_NUM(e->devid_start), PCI_SLOT(e->devid_start),
index bad3c0c..de324b4 100644 (file)
@@ -1295,13 +1295,17 @@ static int exynos_iommu_of_xlate(struct device *dev,
                return -ENODEV;
 
        data = platform_get_drvdata(sysmmu);
-       if (!data)
+       if (!data) {
+               put_device(&sysmmu->dev);
                return -ENODEV;
+       }
 
        if (!owner) {
                owner = kzalloc(sizeof(*owner), GFP_KERNEL);
-               if (!owner)
+               if (!owner) {
+                       put_device(&sysmmu->dev);
                        return -ENOMEM;
+               }
 
                INIT_LIST_HEAD(&owner->controllers);
                mutex_init(&owner->rpm_lock);
index 87b17ba..2239c21 100644 (file)
@@ -2664,7 +2664,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
                }
 
                /* Setup the PASID entry for requests without PASID: */
-               spin_lock(&iommu->lock);
+               spin_lock_irqsave(&iommu->lock, flags);
                if (hw_pass_through && domain_type_is_si(domain))
                        ret = intel_pasid_setup_pass_through(iommu, domain,
                                        dev, PASID_RID2PASID);
@@ -2674,7 +2674,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
                else
                        ret = intel_pasid_setup_second_level(iommu, domain,
                                        dev, PASID_RID2PASID);
-               spin_unlock(&iommu->lock);
+               spin_unlock_irqrestore(&iommu->lock, flags);
                if (ret) {
                        dev_err(dev, "Setup RID2PASID failed\n");
                        dmar_remove_one_dev_info(dev);
index b9c7956..714d1f6 100644 (file)
@@ -1293,7 +1293,8 @@ static int exynos5_performance_counters_init(struct exynos5_dmc *dmc)
        int counters_size;
        int ret, i;
 
-       dmc->num_counters = devfreq_event_get_edev_count(dmc->dev);
+       dmc->num_counters = devfreq_event_get_edev_count(dmc->dev,
+                                                       "devfreq-events");
        if (dmc->num_counters < 0) {
                dev_err(dmc->dev, "could not get devfreq-event counters\n");
                return dmc->num_counters;
@@ -1306,7 +1307,8 @@ static int exynos5_performance_counters_init(struct exynos5_dmc *dmc)
 
        for (i = 0; i < dmc->num_counters; i++) {
                dmc->counter[i] =
-                       devfreq_event_get_edev_by_phandle(dmc->dev, i);
+                       devfreq_event_get_edev_by_phandle(dmc->dev,
+                                               "devfreq-events", i);
                if (IS_ERR_OR_NULL(dmc->counter[i]))
                        return -EPROBE_DEFER;
        }
index 693ee73..ef03d6f 100644 (file)
@@ -441,6 +441,9 @@ static void memstick_check(struct work_struct *work)
        } else if (host->card->stop)
                host->card->stop(host->card);
 
+       if (host->removing)
+               goto out_power_off;
+
        card = memstick_alloc_card(host);
 
        if (!card) {
@@ -545,6 +548,7 @@ EXPORT_SYMBOL(memstick_add_host);
  */
 void memstick_remove_host(struct memstick_host *host)
 {
+       host->removing = 1;
        flush_workqueue(workqueue);
        mutex_lock(&host->lock);
        if (host->card)
index af41380..914f518 100644 (file)
@@ -794,7 +794,8 @@ static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot)
 static bool glk_broken_cqhci(struct sdhci_pci_slot *slot)
 {
        return slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_GLK_EMMC &&
-              dmi_match(DMI_BIOS_VENDOR, "LENOVO");
+              (dmi_match(DMI_BIOS_VENDOR, "LENOVO") ||
+               dmi_match(DMI_SYS_VENDOR, "IRBIS"));
 }
 
 static int glk_emmc_probe_slot(struct sdhci_pci_slot *slot)
index 3ca7543..2483e76 100644 (file)
@@ -703,12 +703,10 @@ static int _generic_set_opp_regulator(struct opp_table *opp_table,
         * Enable the regulator after setting its voltages, otherwise it breaks
         * some boot-enabled regulators.
         */
-       if (unlikely(!opp_table->regulator_enabled)) {
+       if (unlikely(!opp_table->enabled)) {
                ret = regulator_enable(reg);
                if (ret < 0)
                        dev_warn(dev, "Failed to enable regulator: %d", ret);
-               else
-                       opp_table->regulator_enabled = true;
        }
 
        return 0;
@@ -781,29 +779,39 @@ static int _set_opp_custom(const struct opp_table *opp_table,
        return opp_table->set_opp(data);
 }
 
+static int _set_required_opp(struct device *dev, struct device *pd_dev,
+                            struct dev_pm_opp *opp, int i)
+{
+       unsigned int pstate = likely(opp) ? opp->required_opps[i]->pstate : 0;
+       int ret;
+
+       if (!pd_dev)
+               return 0;
+
+       ret = dev_pm_genpd_set_performance_state(pd_dev, pstate);
+       if (ret) {
+               dev_err(dev, "Failed to set performance rate of %s: %d (%d)\n",
+                       dev_name(pd_dev), pstate, ret);
+       }
+
+       return ret;
+}
+
 /* This is only called for PM domain for now */
 static int _set_required_opps(struct device *dev,
                              struct opp_table *opp_table,
-                             struct dev_pm_opp *opp)
+                             struct dev_pm_opp *opp, bool up)
 {
        struct opp_table **required_opp_tables = opp_table->required_opp_tables;
        struct device **genpd_virt_devs = opp_table->genpd_virt_devs;
-       unsigned int pstate;
        int i, ret = 0;
 
        if (!required_opp_tables)
                return 0;
 
        /* Single genpd case */
-       if (!genpd_virt_devs) {
-               pstate = likely(opp) ? opp->required_opps[0]->pstate : 0;
-               ret = dev_pm_genpd_set_performance_state(dev, pstate);
-               if (ret) {
-                       dev_err(dev, "Failed to set performance state of %s: %d (%d)\n",
-                               dev_name(dev), pstate, ret);
-               }
-               return ret;
-       }
+       if (!genpd_virt_devs)
+               return _set_required_opp(dev, dev, opp, 0);
 
        /* Multiple genpd case */
 
@@ -813,19 +821,21 @@ static int _set_required_opps(struct device *dev,
         */
        mutex_lock(&opp_table->genpd_virt_dev_lock);
 
-       for (i = 0; i < opp_table->required_opp_count; i++) {
-               pstate = likely(opp) ? opp->required_opps[i]->pstate : 0;
-
-               if (!genpd_virt_devs[i])
-                       continue;
-
-               ret = dev_pm_genpd_set_performance_state(genpd_virt_devs[i], pstate);
-               if (ret) {
-                       dev_err(dev, "Failed to set performance rate of %s: %d (%d)\n",
-                               dev_name(genpd_virt_devs[i]), pstate, ret);
-                       break;
+       /* Scaling up? Set required OPPs in normal order, else reverse */
+       if (up) {
+               for (i = 0; i < opp_table->required_opp_count; i++) {
+                       ret = _set_required_opp(dev, genpd_virt_devs[i], opp, i);
+                       if (ret)
+                               break;
+               }
+       } else {
+               for (i = opp_table->required_opp_count - 1; i >= 0; i--) {
+                       ret = _set_required_opp(dev, genpd_virt_devs[i], opp, i);
+                       if (ret)
+                               break;
                }
        }
+
        mutex_unlock(&opp_table->genpd_virt_dev_lock);
 
        return ret;
@@ -862,6 +872,34 @@ int dev_pm_opp_set_bw(struct device *dev, struct dev_pm_opp *opp)
 }
 EXPORT_SYMBOL_GPL(dev_pm_opp_set_bw);
 
+static int _opp_set_rate_zero(struct device *dev, struct opp_table *opp_table)
+{
+       int ret;
+
+       if (!opp_table->enabled)
+               return 0;
+
+       /*
+        * Some drivers need to support cases where some platforms may
+        * have OPP table for the device, while others don't and
+        * opp_set_rate() just needs to behave like clk_set_rate().
+        */
+       if (!_get_opp_count(opp_table))
+               return 0;
+
+       ret = _set_opp_bw(opp_table, NULL, dev, true);
+       if (ret)
+               return ret;
+
+       if (opp_table->regulators)
+               regulator_disable(opp_table->regulators[0]);
+
+       ret = _set_required_opps(dev, opp_table, NULL, false);
+
+       opp_table->enabled = false;
+       return ret;
+}
+
 /**
  * dev_pm_opp_set_rate() - Configure new OPP based on frequency
  * @dev:        device for which we do this operation
@@ -888,33 +926,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
        }
 
        if (unlikely(!target_freq)) {
-               /*
-                * Some drivers need to support cases where some platforms may
-                * have OPP table for the device, while others don't and
-                * opp_set_rate() just needs to behave like clk_set_rate().
-                */
-               if (!_get_opp_count(opp_table)) {
-                       ret = 0;
-                       goto put_opp_table;
-               }
-
-               if (!opp_table->required_opp_tables && !opp_table->regulators &&
-                   !opp_table->paths) {
-                       dev_err(dev, "target frequency can't be 0\n");
-                       ret = -EINVAL;
-                       goto put_opp_table;
-               }
-
-               ret = _set_opp_bw(opp_table, NULL, dev, true);
-               if (ret)
-                       goto put_opp_table;
-
-               if (opp_table->regulator_enabled) {
-                       regulator_disable(opp_table->regulators[0]);
-                       opp_table->regulator_enabled = false;
-               }
-
-               ret = _set_required_opps(dev, opp_table, NULL);
+               ret = _opp_set_rate_zero(dev, opp_table);
                goto put_opp_table;
        }
 
@@ -933,14 +945,11 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
        old_freq = clk_get_rate(clk);
 
        /* Return early if nothing to do */
-       if (old_freq == freq) {
-               if (!opp_table->required_opp_tables && !opp_table->regulators &&
-                   !opp_table->paths) {
-                       dev_dbg(dev, "%s: old/new frequencies (%lu Hz) are same, nothing to do\n",
-                               __func__, freq);
-                       ret = 0;
-                       goto put_opp_table;
-               }
+       if (opp_table->enabled && old_freq == freq) {
+               dev_dbg(dev, "%s: old/new frequencies (%lu Hz) are same, nothing to do\n",
+                       __func__, freq);
+               ret = 0;
+               goto put_opp_table;
        }
 
        /*
@@ -976,7 +985,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
 
        /* Scaling up? Configure required OPPs before frequency */
        if (freq >= old_freq) {
-               ret = _set_required_opps(dev, opp_table, opp);
+               ret = _set_required_opps(dev, opp_table, opp, true);
                if (ret)
                        goto put_opp;
        }
@@ -996,13 +1005,16 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
 
        /* Scaling down? Configure required OPPs after frequency */
        if (!ret && freq < old_freq) {
-               ret = _set_required_opps(dev, opp_table, opp);
+               ret = _set_required_opps(dev, opp_table, opp, false);
                if (ret)
                        dev_err(dev, "Failed to set required opps: %d\n", ret);
        }
 
-       if (!ret)
+       if (!ret) {
                ret = _set_opp_bw(opp_table, opp, dev, false);
+               if (!ret)
+                       opp_table->enabled = true;
+       }
 
 put_opp:
        dev_pm_opp_put(opp);
@@ -1068,7 +1080,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
         */
        opp_table = kzalloc(sizeof(*opp_table), GFP_KERNEL);
        if (!opp_table)
-               return NULL;
+               return ERR_PTR(-ENOMEM);
 
        mutex_init(&opp_table->lock);
        mutex_init(&opp_table->genpd_virt_dev_lock);
@@ -1079,8 +1091,8 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
 
        opp_dev = _add_opp_dev(dev, opp_table);
        if (!opp_dev) {
-               kfree(opp_table);
-               return NULL;
+               ret = -ENOMEM;
+               goto err;
        }
 
        _of_init_opp_table(opp_table, dev, index);
@@ -1089,16 +1101,21 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
        opp_table->clk = clk_get(dev, NULL);
        if (IS_ERR(opp_table->clk)) {
                ret = PTR_ERR(opp_table->clk);
-               if (ret != -EPROBE_DEFER)
-                       dev_dbg(dev, "%s: Couldn't find clock: %d\n", __func__,
-                               ret);
+               if (ret == -EPROBE_DEFER)
+                       goto err;
+
+               dev_dbg(dev, "%s: Couldn't find clock: %d\n", __func__, ret);
        }
 
        /* Find interconnect path(s) for the device */
        ret = dev_pm_opp_of_find_icc_paths(dev, opp_table);
-       if (ret)
+       if (ret) {
+               if (ret == -EPROBE_DEFER)
+                       goto err;
+
                dev_warn(dev, "%s: Error finding interconnect paths: %d\n",
                         __func__, ret);
+       }
 
        BLOCKING_INIT_NOTIFIER_HEAD(&opp_table->head);
        INIT_LIST_HEAD(&opp_table->opp_list);
@@ -1107,6 +1124,10 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
        /* Secure the device table modification */
        list_add(&opp_table->node, &opp_tables);
        return opp_table;
+
+err:
+       kfree(opp_table);
+       return ERR_PTR(ret);
 }
 
 void _get_opp_table_kref(struct opp_table *opp_table)
@@ -1129,7 +1150,7 @@ static struct opp_table *_opp_get_opp_table(struct device *dev, int index)
        if (opp_table) {
                if (!_add_opp_dev_unlocked(dev, opp_table)) {
                        dev_pm_opp_put_opp_table(opp_table);
-                       opp_table = NULL;
+                       opp_table = ERR_PTR(-ENOMEM);
                }
                goto unlock;
        }
@@ -1581,8 +1602,8 @@ struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev,
        struct opp_table *opp_table;
 
        opp_table = dev_pm_opp_get_opp_table(dev);
-       if (!opp_table)
-               return ERR_PTR(-ENOMEM);
+       if (IS_ERR(opp_table))
+               return opp_table;
 
        /* Make sure there are no concurrent readers while updating opp_table */
        WARN_ON(!list_empty(&opp_table->opp_list));
@@ -1640,8 +1661,8 @@ struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name)
        struct opp_table *opp_table;
 
        opp_table = dev_pm_opp_get_opp_table(dev);
-       if (!opp_table)
-               return ERR_PTR(-ENOMEM);
+       if (IS_ERR(opp_table))
+               return opp_table;
 
        /* Make sure there are no concurrent readers while updating opp_table */
        WARN_ON(!list_empty(&opp_table->opp_list));
@@ -1733,8 +1754,8 @@ struct opp_table *dev_pm_opp_set_regulators(struct device *dev,
        int ret, i;
 
        opp_table = dev_pm_opp_get_opp_table(dev);
-       if (!opp_table)
-               return ERR_PTR(-ENOMEM);
+       if (IS_ERR(opp_table))
+               return opp_table;
 
        /* This should be called before OPPs are initialized */
        if (WARN_ON(!list_empty(&opp_table->opp_list))) {
@@ -1804,11 +1825,9 @@ void dev_pm_opp_put_regulators(struct opp_table *opp_table)
        /* Make sure there are no concurrent readers while updating opp_table */
        WARN_ON(!list_empty(&opp_table->opp_list));
 
-       if (opp_table->regulator_enabled) {
+       if (opp_table->enabled) {
                for (i = opp_table->regulator_count - 1; i >= 0; i--)
                        regulator_disable(opp_table->regulators[i]);
-
-               opp_table->regulator_enabled = false;
        }
 
        for (i = opp_table->regulator_count - 1; i >= 0; i--)
@@ -1843,8 +1862,8 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *name)
        int ret;
 
        opp_table = dev_pm_opp_get_opp_table(dev);
-       if (!opp_table)
-               return ERR_PTR(-ENOMEM);
+       if (IS_ERR(opp_table))
+               return opp_table;
 
        /* This should be called before OPPs are initialized */
        if (WARN_ON(!list_empty(&opp_table->opp_list))) {
@@ -1911,8 +1930,8 @@ struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev,
                return ERR_PTR(-EINVAL);
 
        opp_table = dev_pm_opp_get_opp_table(dev);
-       if (!opp_table)
-               return ERR_PTR(-ENOMEM);
+       if (!IS_ERR(opp_table))
+               return opp_table;
 
        /* This should be called before OPPs are initialized */
        if (WARN_ON(!list_empty(&opp_table->opp_list))) {
@@ -1949,6 +1968,9 @@ static void _opp_detach_genpd(struct opp_table *opp_table)
 {
        int index;
 
+       if (!opp_table->genpd_virt_devs)
+               return;
+
        for (index = 0; index < opp_table->required_opp_count; index++) {
                if (!opp_table->genpd_virt_devs[index])
                        continue;
@@ -1992,8 +2014,11 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev,
        const char **name = names;
 
        opp_table = dev_pm_opp_get_opp_table(dev);
-       if (!opp_table)
-               return ERR_PTR(-ENOMEM);
+       if (IS_ERR(opp_table))
+               return opp_table;
+
+       if (opp_table->genpd_virt_devs)
+               return opp_table;
 
        /*
         * If the genpd's OPP table isn't already initialized, parsing of the
@@ -2020,12 +2045,6 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev,
                        goto err;
                }
 
-               if (opp_table->genpd_virt_devs[index]) {
-                       dev_err(dev, "Genpd virtual device already set %s\n",
-                               *name);
-                       goto err;
-               }
-
                virt_dev = dev_pm_domain_attach_by_name(dev, *name);
                if (IS_ERR(virt_dev)) {
                        ret = PTR_ERR(virt_dev);
@@ -2098,9 +2117,6 @@ int dev_pm_opp_xlate_performance_state(struct opp_table *src_table,
        int dest_pstate = -EINVAL;
        int i;
 
-       if (!pstate)
-               return 0;
-
        /*
         * Normally the src_table will have the "required_opps" property set to
         * point to one of the OPPs in the dst_table, but in some cases the
@@ -2163,8 +2179,8 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
        int ret;
 
        opp_table = dev_pm_opp_get_opp_table(dev);
-       if (!opp_table)
-               return -ENOMEM;
+       if (IS_ERR(opp_table))
+               return PTR_ERR(opp_table);
 
        /* Fix regulator count for dynamic OPPs */
        opp_table->regulator_count = 1;
@@ -2405,7 +2421,14 @@ int dev_pm_opp_unregister_notifier(struct device *dev,
 }
 EXPORT_SYMBOL(dev_pm_opp_unregister_notifier);
 
-void _dev_pm_opp_find_and_remove_table(struct device *dev)
+/**
+ * dev_pm_opp_remove_table() - Free all OPPs associated with the device
+ * @dev:       device pointer used to lookup OPP table.
+ *
+ * Free both OPPs created using static entries present in DT and the
+ * dynamically added entries.
+ */
+void dev_pm_opp_remove_table(struct device *dev)
 {
        struct opp_table *opp_table;
 
@@ -2432,16 +2455,4 @@ void _dev_pm_opp_find_and_remove_table(struct device *dev)
        /* Drop reference taken by _find_opp_table() */
        dev_pm_opp_put_opp_table(opp_table);
 }
-
-/**
- * dev_pm_opp_remove_table() - Free all OPPs associated with the device
- * @dev:       device pointer used to lookup OPP table.
- *
- * Free both OPPs created using static entries present in DT and the
- * dynamically added entries.
- */
-void dev_pm_opp_remove_table(struct device *dev)
-{
-       _dev_pm_opp_find_and_remove_table(dev);
-}
 EXPORT_SYMBOL_GPL(dev_pm_opp_remove_table);
index b5055cc..5004335 100644 (file)
@@ -124,7 +124,7 @@ void _dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask,
                        continue;
                }
 
-               _dev_pm_opp_find_and_remove_table(cpu_dev);
+               dev_pm_opp_remove_table(cpu_dev);
        }
 }
 
index 0430290..874b587 100644 (file)
@@ -434,9 +434,9 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_find_icc_paths);
 static bool _opp_is_supported(struct device *dev, struct opp_table *opp_table,
                              struct device_node *np)
 {
-       unsigned int count = opp_table->supported_hw_count;
-       u32 version;
-       int ret;
+       unsigned int levels = opp_table->supported_hw_count;
+       int count, versions, ret, i, j;
+       u32 val;
 
        if (!opp_table->supported_hw) {
                /*
@@ -451,21 +451,40 @@ static bool _opp_is_supported(struct device *dev, struct opp_table *opp_table,
                        return true;
        }
 
-       while (count--) {
-               ret = of_property_read_u32_index(np, "opp-supported-hw", count,
-                                                &version);
-               if (ret) {
-                       dev_warn(dev, "%s: failed to read opp-supported-hw property at index %d: %d\n",
-                                __func__, count, ret);
-                       return false;
+       count = of_property_count_u32_elems(np, "opp-supported-hw");
+       if (count <= 0 || count % levels) {
+               dev_err(dev, "%s: Invalid opp-supported-hw property (%d)\n",
+                       __func__, count);
+               return false;
+       }
+
+       versions = count / levels;
+
+       /* All levels in at least one of the versions should match */
+       for (i = 0; i < versions; i++) {
+               bool supported = true;
+
+               for (j = 0; j < levels; j++) {
+                       ret = of_property_read_u32_index(np, "opp-supported-hw",
+                                                        i * levels + j, &val);
+                       if (ret) {
+                               dev_warn(dev, "%s: failed to read opp-supported-hw property at index %d: %d\n",
+                                        __func__, i * levels + j, ret);
+                               return false;
+                       }
+
+                       /* Check if the level is supported */
+                       if (!(val & opp_table->supported_hw[j])) {
+                               supported = false;
+                               break;
+                       }
                }
 
-               /* Both of these are bitwise masks of the versions */
-               if (!(version & opp_table->supported_hw[count]))
-                       return false;
+               if (supported)
+                       return true;
        }
 
-       return true;
+       return false;
 }
 
 static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev,
@@ -616,7 +635,7 @@ free_microvolt:
  */
 void dev_pm_opp_of_remove_table(struct device *dev)
 {
-       _dev_pm_opp_find_and_remove_table(dev);
+       dev_pm_opp_remove_table(dev);
 }
 EXPORT_SYMBOL_GPL(dev_pm_opp_of_remove_table);
 
@@ -823,7 +842,7 @@ free_opp:
 static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table)
 {
        struct device_node *np;
-       int ret, count = 0, pstate_count = 0;
+       int ret, count = 0;
        struct dev_pm_opp *opp;
 
        /* OPP table is already initialized for the device */
@@ -857,20 +876,14 @@ static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table)
                goto remove_static_opp;
        }
 
-       list_for_each_entry(opp, &opp_table->opp_list, node)
-               pstate_count += !!opp->pstate;
-
-       /* Either all or none of the nodes shall have performance state set */
-       if (pstate_count && pstate_count != count) {
-               dev_err(dev, "Not all nodes have performance state set (%d: %d)\n",
-                       count, pstate_count);
-               ret = -ENOENT;
-               goto remove_static_opp;
+       list_for_each_entry(opp, &opp_table->opp_list, node) {
+               /* Any non-zero performance state would enable the feature */
+               if (opp->pstate) {
+                       opp_table->genpd_performance_state = true;
+                       break;
+               }
        }
 
-       if (pstate_count)
-               opp_table->genpd_performance_state = true;
-
        return 0;
 
 remove_static_opp:
@@ -886,11 +899,25 @@ static int _of_add_opp_table_v1(struct device *dev, struct opp_table *opp_table)
        const __be32 *val;
        int nr, ret = 0;
 
+       mutex_lock(&opp_table->lock);
+       if (opp_table->parsed_static_opps) {
+               opp_table->parsed_static_opps++;
+               mutex_unlock(&opp_table->lock);
+               return 0;
+       }
+
+       opp_table->parsed_static_opps = 1;
+       mutex_unlock(&opp_table->lock);
+
        prop = of_find_property(dev->of_node, "operating-points", NULL);
-       if (!prop)
-               return -ENODEV;
-       if (!prop->value)
-               return -ENODATA;
+       if (!prop) {
+               ret = -ENODEV;
+               goto remove_static_opp;
+       }
+       if (!prop->value) {
+               ret = -ENODATA;
+               goto remove_static_opp;
+       }
 
        /*
         * Each OPP is a set of tuples consisting of frequency and
@@ -899,13 +926,10 @@ static int _of_add_opp_table_v1(struct device *dev, struct opp_table *opp_table)
        nr = prop->length / sizeof(u32);
        if (nr % 2) {
                dev_err(dev, "%s: Invalid OPP table\n", __func__);
-               return -EINVAL;
+               ret = -EINVAL;
+               goto remove_static_opp;
        }
 
-       mutex_lock(&opp_table->lock);
-       opp_table->parsed_static_opps = 1;
-       mutex_unlock(&opp_table->lock);
-
        val = prop->value;
        while (nr) {
                unsigned long freq = be32_to_cpup(val++) * 1000;
@@ -915,12 +939,14 @@ static int _of_add_opp_table_v1(struct device *dev, struct opp_table *opp_table)
                if (ret) {
                        dev_err(dev, "%s: Failed to add OPP %ld (%d)\n",
                                __func__, freq, ret);
-                       _opp_remove_all_static(opp_table);
-                       return ret;
+                       goto remove_static_opp;
                }
                nr -= 2;
        }
 
+remove_static_opp:
+       _opp_remove_all_static(opp_table);
+
        return ret;
 }
 
@@ -947,8 +973,8 @@ int dev_pm_opp_of_add_table(struct device *dev)
        int ret;
 
        opp_table = dev_pm_opp_get_opp_table_indexed(dev, 0);
-       if (!opp_table)
-               return -ENOMEM;
+       if (IS_ERR(opp_table))
+               return PTR_ERR(opp_table);
 
        /*
         * OPPs have two version of bindings now. Also try the old (v1)
@@ -1002,8 +1028,8 @@ int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
        }
 
        opp_table = dev_pm_opp_get_opp_table_indexed(dev, index);
-       if (!opp_table)
-               return -ENOMEM;
+       if (IS_ERR(opp_table))
+               return PTR_ERR(opp_table);
 
        ret = _of_add_opp_table_v2(dev, opp_table);
        if (ret)
index c3fcd57..ebd930e 100644 (file)
@@ -147,11 +147,11 @@ enum opp_table_access {
  * @clk: Device's clock handle
  * @regulators: Supply regulators
  * @regulator_count: Number of power supply regulators. Its value can be -1
- * @regulator_enabled: Set to true if regulators were previously enabled.
  * (uninitialized), 0 (no opp-microvolt property) or > 0 (has opp-microvolt
  * property).
  * @paths: Interconnect path handles
  * @path_count: Number of interconnect paths
+ * @enabled: Set to true if the device's resources are enabled/configured.
  * @genpd_performance_state: Device's power domain support performance state.
  * @is_genpd: Marks if the OPP table belongs to a genpd.
  * @set_opp: Platform specific set_opp callback
@@ -195,9 +195,9 @@ struct opp_table {
        struct clk *clk;
        struct regulator **regulators;
        int regulator_count;
-       bool regulator_enabled;
        struct icc_path **paths;
        unsigned int path_count;
+       bool enabled;
        bool genpd_performance_state;
        bool is_genpd;
 
@@ -217,7 +217,6 @@ void _get_opp_table_kref(struct opp_table *opp_table);
 int _get_opp_count(struct opp_table *opp_table);
 struct opp_table *_find_opp_table(struct device *dev);
 struct opp_device *_add_opp_dev(const struct device *dev, struct opp_table *opp_table);
-void _dev_pm_opp_find_and_remove_table(struct device *dev);
 struct dev_pm_opp *_opp_allocate(struct opp_table *opp_table);
 void _opp_free(struct dev_pm_opp *opp);
 int _opp_compare_key(struct dev_pm_opp *opp1, struct dev_pm_opp *opp2);
index 0bb2fb3..9705059 100644 (file)
@@ -71,16 +71,13 @@ static void rockchip_pcie_update_txcredit_mui(struct rockchip_pcie *rockchip)
 static int rockchip_pcie_valid_device(struct rockchip_pcie *rockchip,
                                      struct pci_bus *bus, int dev)
 {
-       /* access only one slot on each root port */
-       if (pci_is_root_bus(bus) && dev > 0)
-               return 0;
-
        /*
-        * do not read more than one device on the bus directly attached
+        * Access only one slot on each root port.
+        * Do not read more than one device on the bus directly attached
         * to RC's downstream side.
         */
-       if (pci_is_root_bus(bus->parent) && dev > 0)
-               return 0;
+       if (pci_is_root_bus(bus) || pci_is_root_bus(bus->parent))
+               return dev == 0;
 
        return 1;
 }
index a174b3c..819c49a 100644 (file)
@@ -725,8 +725,10 @@ static int serdes_am654_probe(struct platform_device *pdev)
        pm_runtime_enable(dev);
 
        phy = devm_phy_create(dev, NULL, &ops);
-       if (IS_ERR(phy))
-               return PTR_ERR(phy);
+       if (IS_ERR(phy)) {
+               ret = PTR_ERR(phy);
+               goto clk_err;
+       }
 
        phy_set_drvdata(phy, am654_phy);
        phy_provider = devm_of_phy_provider_register(dev, serdes_am654_xlate);
index 9ef2461..0652109 100644 (file)
@@ -58,6 +58,7 @@
 #define CHV_PADCTRL1_CFGLOCK           BIT(31)
 #define CHV_PADCTRL1_INVRXTX_SHIFT     4
 #define CHV_PADCTRL1_INVRXTX_MASK      GENMASK(7, 4)
+#define CHV_PADCTRL1_INVRXTX_TXDATA    BIT(7)
 #define CHV_PADCTRL1_INVRXTX_RXDATA    BIT(6)
 #define CHV_PADCTRL1_INVRXTX_TXENABLE  BIT(5)
 #define CHV_PADCTRL1_ODEN              BIT(3)
@@ -792,11 +793,22 @@ static int chv_pinmux_set_mux(struct pinctrl_dev *pctldev,
 static void chv_gpio_clear_triggering(struct chv_pinctrl *pctrl,
                                      unsigned int offset)
 {
+       u32 invrxtx_mask = CHV_PADCTRL1_INVRXTX_MASK;
        u32 value;
 
+       /*
+        * One some devices the GPIO should output the inverted value from what
+        * device-drivers / ACPI code expects (inverted external buffer?). The
+        * BIOS makes this work by setting the CHV_PADCTRL1_INVRXTX_TXDATA flag,
+        * preserve this flag if the pin is already setup as GPIO.
+        */
+       value = chv_readl(pctrl, offset, CHV_PADCTRL0);
+       if (value & CHV_PADCTRL0_GPIOEN)
+               invrxtx_mask &= ~CHV_PADCTRL1_INVRXTX_TXDATA;
+
        value = chv_readl(pctrl, offset, CHV_PADCTRL1);
        value &= ~CHV_PADCTRL1_INTWAKECFG_MASK;
-       value &= ~CHV_PADCTRL1_INVRXTX_MASK;
+       value &= ~invrxtx_mask;
        chv_writel(pctrl, offset, CHV_PADCTRL1, value);
 }
 
index 2f3dfb5..35bbe59 100644 (file)
@@ -259,6 +259,10 @@ bool mtk_is_virt_gpio(struct mtk_pinctrl *hw, unsigned int gpio_n)
 
        desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio_n];
 
+       /* if the GPIO is not supported for eint mode */
+       if (desc->eint.eint_m == NO_EINT_SUPPORT)
+               return virt_gpio;
+
        if (desc->funcs && !desc->funcs[desc->eint.eint_m].name)
                virt_gpio = true;
 
index a767a05..48e2a6c 100644 (file)
@@ -414,7 +414,7 @@ static struct mvebu_mpp_mode mv98dx3236_mpp_modes[] = {
                 MPP_VAR_FUNCTION(0x1, "i2c0", "sck",        V_98DX3236_PLUS)),
        MPP_MODE(15,
                 MPP_VAR_FUNCTION(0x0, "gpio", NULL,         V_98DX3236_PLUS),
-                MPP_VAR_FUNCTION(0x4, "i2c0", "sda",        V_98DX3236_PLUS)),
+                MPP_VAR_FUNCTION(0x1, "i2c0", "sda",        V_98DX3236_PLUS)),
        MPP_MODE(16,
                 MPP_VAR_FUNCTION(0x0, "gpo", NULL,          V_98DX3236_PLUS),
                 MPP_VAR_FUNCTION(0x4, "dev", "oe",          V_98DX3236_PLUS)),
index a660f12..826df0d 100644 (file)
@@ -1308,7 +1308,7 @@ static const struct msm_pingroup sm8250_groups[] = {
        [178] = PINGROUP(178, WEST, _, _, _, _, _, _, _, _, _),
        [179] = PINGROUP(179, WEST, _, _, _, _, _, _, _, _, _),
        [180] = UFS_RESET(ufs_reset, 0xb8000),
-       [181] = SDC_PINGROUP(sdc2_clk, 0x7000, 14, 6),
+       [181] = SDC_PINGROUP(sdc2_clk, 0xb7000, 14, 6),
        [182] = SDC_PINGROUP(sdc2_cmd, 0xb7000, 11, 3),
        [183] = SDC_PINGROUP(sdc2_data, 0xb7000, 9, 0),
 };
index b5dd1ca..d10efb6 100644 (file)
@@ -736,6 +736,7 @@ static int iscsi_sw_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn,
        struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
        struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data;
        struct sockaddr_in6 addr;
+       struct socket *sock;
        int rc;
 
        switch(param) {
@@ -747,13 +748,17 @@ static int iscsi_sw_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn,
                        spin_unlock_bh(&conn->session->frwd_lock);
                        return -ENOTCONN;
                }
+               sock = tcp_sw_conn->sock;
+               sock_hold(sock->sk);
+               spin_unlock_bh(&conn->session->frwd_lock);
+
                if (param == ISCSI_PARAM_LOCAL_PORT)
-                       rc = kernel_getsockname(tcp_sw_conn->sock,
+                       rc = kernel_getsockname(sock,
                                                (struct sockaddr *)&addr);
                else
-                       rc = kernel_getpeername(tcp_sw_conn->sock,
+                       rc = kernel_getpeername(sock,
                                                (struct sockaddr *)&addr);
-               spin_unlock_bh(&conn->session->frwd_lock);
+               sock_put(sock->sk);
                if (rc < 0)
                        return rc;
 
@@ -775,6 +780,7 @@ static int iscsi_sw_tcp_host_get_param(struct Scsi_Host *shost,
        struct iscsi_tcp_conn *tcp_conn;
        struct iscsi_sw_tcp_conn *tcp_sw_conn;
        struct sockaddr_in6 addr;
+       struct socket *sock;
        int rc;
 
        switch (param) {
@@ -789,16 +795,18 @@ static int iscsi_sw_tcp_host_get_param(struct Scsi_Host *shost,
                        return -ENOTCONN;
                }
                tcp_conn = conn->dd_data;
-
                tcp_sw_conn = tcp_conn->dd_data;
-               if (!tcp_sw_conn->sock) {
+               sock = tcp_sw_conn->sock;
+               if (!sock) {
                        spin_unlock_bh(&session->frwd_lock);
                        return -ENOTCONN;
                }
+               sock_hold(sock->sk);
+               spin_unlock_bh(&session->frwd_lock);
 
-               rc = kernel_getsockname(tcp_sw_conn->sock,
+               rc = kernel_getsockname(sock,
                                        (struct sockaddr *)&addr);
-               spin_unlock_bh(&session->frwd_lock);
+               sock_put(sock->sk);
                if (rc < 0)
                        return rc;
 
index 30bb7b7..8abf4df 100644 (file)
@@ -93,7 +93,7 @@ static int exynos_asv_update_opps(struct exynos_asv *asv)
                        continue;
 
                opp_table = dev_pm_opp_get_opp_table(cpu);
-               if (IS_ERR_OR_NULL(opp_table))
+               if (IS_ERR(opp_table))
                        continue;
 
                if (!last_opp_table || opp_table != last_opp_table) {
index 590eac2..ff26ab0 100644 (file)
@@ -1840,7 +1840,8 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
         * out unpacked_lun for the original se_cmd.
         */
        if (tm_type == TMR_ABORT_TASK && (flags & TARGET_SCF_LOOKUP_LUN_FROM_TAG)) {
-               if (!target_lookup_lun_from_tag(se_sess, tag, &unpacked_lun))
+               if (!target_lookup_lun_from_tag(se_sess, tag,
+                                               &se_cmd->orig_fe_lun))
                        goto failure;
        }
 
index 7e73e98..b351962 100644 (file)
@@ -269,8 +269,30 @@ static int usb_probe_device(struct device *dev)
        if (error)
                return error;
 
+       /* Probe the USB device with the driver in hand, but only
+        * defer to a generic driver in case the current USB
+        * device driver has an id_table or a match function; i.e.,
+        * when the device driver was explicitly matched against
+        * a device.
+        *
+        * If the device driver does not have either of these,
+        * then we assume that it can bind to any device and is
+        * not truly a more specialized/non-generic driver, so a
+        * return value of -ENODEV should not force the device
+        * to be handled by the generic USB driver, as there
+        * can still be another, more specialized, device driver.
+        *
+        * This accommodates the usbip driver.
+        *
+        * TODO: What if, in the future, there are multiple
+        * specialized USB device drivers for a particular device?
+        * In such cases, there is a need to try all matching
+        * specialised device drivers prior to setting the
+        * use_generic_driver bit.
+        */
        error = udriver->probe(udev);
-       if (error == -ENODEV && udriver != &usb_generic_driver) {
+       if (error == -ENODEV && udriver != &usb_generic_driver &&
+           (udriver->id_table || udriver->match)) {
                udev->use_generic_driver = 1;
                return -EPROBE_DEFER;
        }
@@ -831,14 +853,17 @@ static int usb_device_match(struct device *dev, struct device_driver *drv)
                udev = to_usb_device(dev);
                udrv = to_usb_device_driver(drv);
 
-               if (udrv->id_table &&
-                   usb_device_match_id(udev, udrv->id_table) != NULL) {
-                       return 1;
-               }
+               if (udrv->id_table)
+                       return usb_device_match_id(udev, udrv->id_table) != NULL;
 
                if (udrv->match)
                        return udrv->match(udev);
-               return 0;
+
+               /* If the device driver under consideration does not have a
+                * id_table or a match function, then let the driver's probe
+                * function decide.
+                */
+               return 1;
 
        } else if (is_usb_interface(dev)) {
                struct usb_interface *intf;
@@ -905,26 +930,19 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
        return 0;
 }
 
-static bool is_dev_usb_generic_driver(struct device *dev)
-{
-       struct usb_device_driver *udd = dev->driver ?
-               to_usb_device_driver(dev->driver) : NULL;
-
-       return udd == &usb_generic_driver;
-}
-
 static int __usb_bus_reprobe_drivers(struct device *dev, void *data)
 {
        struct usb_device_driver *new_udriver = data;
        struct usb_device *udev;
        int ret;
 
-       if (!is_dev_usb_generic_driver(dev))
+       /* Don't reprobe if current driver isn't usb_generic_driver */
+       if (dev->driver != &usb_generic_driver.drvwrap.driver)
                return 0;
 
        udev = to_usb_device(dev);
        if (usb_device_match_id(udev, new_udriver->id_table) == NULL &&
-           (!new_udriver->match || new_udriver->match(udev) != 0))
+           (!new_udriver->match || new_udriver->match(udev) == 0))
                return 0;
 
        ret = device_reprobe(dev);
index b4206b0..1f63875 100644 (file)
@@ -1189,7 +1189,6 @@ static int ncm_unwrap_ntb(struct gether *port,
        const struct ndp_parser_opts *opts = ncm->parser_opts;
        unsigned        crc_len = ncm->is_crc ? sizeof(uint32_t) : 0;
        int             dgram_counter;
-       bool            ndp_after_header;
 
        /* dwSignature */
        if (get_unaligned_le32(tmp) != opts->nth_sign) {
@@ -1216,7 +1215,6 @@ static int ncm_unwrap_ntb(struct gether *port,
        }
 
        ndp_index = get_ncm(&tmp, opts->ndp_index);
-       ndp_after_header = false;
 
        /* Run through all the NDP's in the NTB */
        do {
@@ -1232,8 +1230,6 @@ static int ncm_unwrap_ntb(struct gether *port,
                             ndp_index);
                        goto err;
                }
-               if (ndp_index == opts->nth_size)
-                       ndp_after_header = true;
 
                /*
                 * walk through NDP
@@ -1312,37 +1308,13 @@ static int ncm_unwrap_ntb(struct gether *port,
                        index2 = get_ncm(&tmp, opts->dgram_item_len);
                        dg_len2 = get_ncm(&tmp, opts->dgram_item_len);
 
-                       if (index2 == 0 || dg_len2 == 0)
-                               break;
-
                        /* wDatagramIndex[1] */
-                       if (ndp_after_header) {
-                               if (index2 < opts->nth_size + opts->ndp_size) {
-                                       INFO(port->func.config->cdev,
-                                            "Bad index: %#X\n", index2);
-                                       goto err;
-                               }
-                       } else {
-                               if (index2 < opts->nth_size + opts->dpe_size) {
-                                       INFO(port->func.config->cdev,
-                                            "Bad index: %#X\n", index2);
-                                       goto err;
-                               }
-                       }
                        if (index2 > block_len - opts->dpe_size) {
                                INFO(port->func.config->cdev,
                                     "Bad index: %#X\n", index2);
                                goto err;
                        }
 
-                       /* wDatagramLength[1] */
-                       if ((dg_len2 < 14 + crc_len) ||
-                                       (dg_len2 > frame_max)) {
-                               INFO(port->func.config->cdev,
-                                    "Bad dgram length: %#X\n", dg_len);
-                               goto err;
-                       }
-
                        /*
                         * Copy the data into a new skb.
                         * This ensures the truesize is correct
@@ -1359,6 +1331,8 @@ static int ncm_unwrap_ntb(struct gether *port,
                        ndp_len -= 2 * (opts->dgram_item_len * 2);
 
                        dgram_counter++;
+                       if (index2 == 0 || dg_len2 == 0)
+                               break;
                } while (ndp_len > 2 * (opts->dgram_item_len * 2));
        } while (ndp_index);
 
index 9d7d642..2305d42 100644 (file)
@@ -461,11 +461,6 @@ static void stub_disconnect(struct usb_device *udev)
        return;
 }
 
-static bool usbip_match(struct usb_device *udev)
-{
-       return true;
-}
-
 #ifdef CONFIG_PM
 
 /* These functions need usb_port_suspend and usb_port_resume,
@@ -491,7 +486,6 @@ struct usb_device_driver stub_driver = {
        .name           = "usbip-host",
        .probe          = stub_probe,
        .disconnect     = stub_disconnect,
-       .match          = usbip_match,
 #ifdef CONFIG_PM
        .suspend        = stub_suspend,
        .resume         = stub_resume,
index 34aec4b..0fd3f87 100644 (file)
@@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(vhost_iotlb_free);
  * vhost_iotlb_itree_first - return the first overlapped range
  * @iotlb: the IOTLB
  * @start: start of IOVA range
- * @end: end of IOVA range
+ * @last: last byte in IOVA range
  */
 struct vhost_iotlb_map *
 vhost_iotlb_itree_first(struct vhost_iotlb *iotlb, u64 start, u64 last)
@@ -162,7 +162,7 @@ EXPORT_SYMBOL_GPL(vhost_iotlb_itree_first);
  * vhost_iotlb_itree_next - return the next overlapped range
  * @map: the starting map node
  * @start: start of IOVA range
- * @end: end of IOVA range
+ * @last: last byte IOVA range
  */
 struct vhost_iotlb_map *
 vhost_iotlb_itree_next(struct vhost_iotlb_map *map, u64 start, u64 last)
index 3fab94f..796fe97 100644 (file)
@@ -353,8 +353,6 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
        struct vdpa_callback cb;
        struct vhost_virtqueue *vq;
        struct vhost_vring_state s;
-       u64 __user *featurep = argp;
-       u64 features;
        u32 idx;
        long r;
 
@@ -381,18 +379,6 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
 
                vq->last_avail_idx = vq_state.avail_index;
                break;
-       case VHOST_GET_BACKEND_FEATURES:
-               features = VHOST_VDPA_BACKEND_FEATURES;
-               if (copy_to_user(featurep, &features, sizeof(features)))
-                       return -EFAULT;
-               return 0;
-       case VHOST_SET_BACKEND_FEATURES:
-               if (copy_from_user(&features, featurep, sizeof(features)))
-                       return -EFAULT;
-               if (features & ~VHOST_VDPA_BACKEND_FEATURES)
-                       return -EOPNOTSUPP;
-               vhost_set_backend_features(&v->vdev, features);
-               return 0;
        }
 
        r = vhost_vring_ioctl(&v->vdev, cmd, argp);
@@ -440,8 +426,20 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
        struct vhost_vdpa *v = filep->private_data;
        struct vhost_dev *d = &v->vdev;
        void __user *argp = (void __user *)arg;
+       u64 __user *featurep = argp;
+       u64 features;
        long r;
 
+       if (cmd == VHOST_SET_BACKEND_FEATURES) {
+               r = copy_from_user(&features, featurep, sizeof(features));
+               if (r)
+                       return r;
+               if (features & ~VHOST_VDPA_BACKEND_FEATURES)
+                       return -EOPNOTSUPP;
+               vhost_set_backend_features(&v->vdev, features);
+               return 0;
+       }
+
        mutex_lock(&d->mutex);
 
        switch (cmd) {
@@ -476,6 +474,10 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
        case VHOST_VDPA_SET_CONFIG_CALL:
                r = vhost_vdpa_set_config_call(v, argp);
                break;
+       case VHOST_GET_BACKEND_FEATURES:
+               features = VHOST_VDPA_BACKEND_FEATURES;
+               r = copy_to_user(featurep, &features, sizeof(features));
+               break;
        default:
                r = vhost_dev_ioctl(&v->vdev, cmd, argp);
                if (r == -ENOIOCTLCMD)
index 90b8f56..6f02c18 100644 (file)
@@ -92,6 +92,8 @@ static bool (*pirq_needs_eoi)(unsigned irq);
 /* Xen will never allocate port zero for any purpose. */
 #define VALID_EVTCHN(chn)      ((chn) != 0)
 
+static struct irq_info *legacy_info_ptrs[NR_IRQS_LEGACY];
+
 static struct irq_chip xen_dynamic_chip;
 static struct irq_chip xen_percpu_chip;
 static struct irq_chip xen_pirq_chip;
@@ -156,7 +158,18 @@ int get_evtchn_to_irq(evtchn_port_t evtchn)
 /* Get info for IRQ */
 struct irq_info *info_for_irq(unsigned irq)
 {
-       return irq_get_chip_data(irq);
+       if (irq < nr_legacy_irqs())
+               return legacy_info_ptrs[irq];
+       else
+               return irq_get_chip_data(irq);
+}
+
+static void set_info_for_irq(unsigned int irq, struct irq_info *info)
+{
+       if (irq < nr_legacy_irqs())
+               legacy_info_ptrs[irq] = info;
+       else
+               irq_set_chip_data(irq, info);
 }
 
 /* Constructors for packed IRQ information. */
@@ -377,7 +390,7 @@ static void xen_irq_init(unsigned irq)
        info->type = IRQT_UNBOUND;
        info->refcnt = -1;
 
-       irq_set_chip_data(irq, info);
+       set_info_for_irq(irq, info);
 
        list_add_tail(&info->list, &xen_irq_list_head);
 }
@@ -426,14 +439,14 @@ static int __must_check xen_allocate_irq_gsi(unsigned gsi)
 
 static void xen_free_irq(unsigned irq)
 {
-       struct irq_info *info = irq_get_chip_data(irq);
+       struct irq_info *info = info_for_irq(irq);
 
        if (WARN_ON(!info))
                return;
 
        list_del(&info->list);
 
-       irq_set_chip_data(irq, NULL);
+       set_info_for_irq(irq, NULL);
 
        WARN_ON(info->refcnt > 0);
 
@@ -603,7 +616,7 @@ EXPORT_SYMBOL_GPL(xen_irq_from_gsi);
 static void __unbind_from_irq(unsigned int irq)
 {
        evtchn_port_t evtchn = evtchn_from_irq(irq);
-       struct irq_info *info = irq_get_chip_data(irq);
+       struct irq_info *info = info_for_irq(irq);
 
        if (info->refcnt > 0) {
                info->refcnt--;
@@ -1108,7 +1121,7 @@ int bind_ipi_to_irqhandler(enum ipi_vector ipi,
 
 void unbind_from_irqhandler(unsigned int irq, void *dev_id)
 {
-       struct irq_info *info = irq_get_chip_data(irq);
+       struct irq_info *info = info_for_irq(irq);
 
        if (WARN_ON(!info))
                return;
@@ -1142,7 +1155,7 @@ int evtchn_make_refcounted(evtchn_port_t evtchn)
        if (irq == -1)
                return -ENOENT;
 
-       info = irq_get_chip_data(irq);
+       info = info_for_irq(irq);
 
        if (!info)
                return -ENOENT;
@@ -1170,7 +1183,7 @@ int evtchn_get(evtchn_port_t evtchn)
        if (irq == -1)
                goto done;
 
-       info = irq_get_chip_data(irq);
+       info = info_for_irq(irq);
 
        if (!info)
                goto done;
index 74c886f..5ced859 100644 (file)
@@ -53,7 +53,7 @@ static int autofs_write(struct autofs_sb_info *sbi,
 
        mutex_lock(&sbi->pipe_mutex);
        while (bytes) {
-               wr = kernel_write(file, data, bytes, &file->f_pos);
+               wr = __kernel_write(file, data, bytes, NULL);
                if (wr <= 0)
                        break;
                data += wr;
index db93909..e4a1c6a 100644 (file)
@@ -599,6 +599,37 @@ static void btrfs_rm_dev_replace_unblocked(struct btrfs_fs_info *fs_info)
        wake_up(&fs_info->dev_replace.replace_wait);
 }
 
+/*
+ * When finishing the device replace, before swapping the source device with the
+ * target device we must update the chunk allocation state in the target device,
+ * as it is empty because replace works by directly copying the chunks and not
+ * through the normal chunk allocation path.
+ */
+static int btrfs_set_target_alloc_state(struct btrfs_device *srcdev,
+                                       struct btrfs_device *tgtdev)
+{
+       struct extent_state *cached_state = NULL;
+       u64 start = 0;
+       u64 found_start;
+       u64 found_end;
+       int ret = 0;
+
+       lockdep_assert_held(&srcdev->fs_info->chunk_mutex);
+
+       while (!find_first_extent_bit(&srcdev->alloc_state, start,
+                                     &found_start, &found_end,
+                                     CHUNK_ALLOCATED, &cached_state)) {
+               ret = set_extent_bits(&tgtdev->alloc_state, found_start,
+                                     found_end, CHUNK_ALLOCATED);
+               if (ret)
+                       break;
+               start = found_end + 1;
+       }
+
+       free_extent_state(cached_state);
+       return ret;
+}
+
 static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
                                       int scrub_ret)
 {
@@ -673,8 +704,14 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
        dev_replace->time_stopped = ktime_get_real_seconds();
        dev_replace->item_needs_writeback = 1;
 
-       /* replace old device with new one in mapping tree */
+       /*
+        * Update allocation state in the new device and replace the old device
+        * with the new one in the mapping tree.
+        */
        if (!scrub_ret) {
+               scrub_ret = btrfs_set_target_alloc_state(src_device, tgt_device);
+               if (scrub_ret)
+                       goto error;
                btrfs_dev_replace_update_device_in_mapping_tree(fs_info,
                                                                src_device,
                                                                tgt_device);
@@ -685,6 +722,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
                                 btrfs_dev_name(src_device),
                                 src_device->devid,
                                 rcu_str_deref(tgt_device->name), scrub_ret);
+error:
                up_write(&dev_replace->rwsem);
                mutex_unlock(&fs_info->chunk_mutex);
                mutex_unlock(&fs_info->fs_devices->device_list_mutex);
@@ -745,7 +783,9 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
        /* replace the sysfs entry */
        btrfs_sysfs_remove_devices_dir(fs_info->fs_devices, src_device);
        btrfs_sysfs_update_devid(tgt_device);
-       btrfs_rm_dev_replace_free_srcdev(src_device);
+       if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &src_device->dev_state))
+               btrfs_scratch_superblocks(fs_info, src_device->bdev,
+                                         src_device->name->str);
 
        /* write back the superblocks */
        trans = btrfs_start_transaction(root, 0);
@@ -754,6 +794,8 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
 
        mutex_unlock(&dev_replace->lock_finishing_cancel_unmount);
 
+       btrfs_rm_dev_replace_free_srcdev(src_device);
+
        return 0;
 }
 
index 117b433..1997a7d 100644 (file)
@@ -1999,9 +1999,9 @@ static u64 btrfs_num_devices(struct btrfs_fs_info *fs_info)
        return num_devices;
 }
 
-static void btrfs_scratch_superblocks(struct btrfs_fs_info *fs_info,
-                                     struct block_device *bdev,
-                                     const char *device_path)
+void btrfs_scratch_superblocks(struct btrfs_fs_info *fs_info,
+                              struct block_device *bdev,
+                              const char *device_path)
 {
        struct btrfs_super_block *disk_super;
        int copy_num;
@@ -2224,11 +2224,7 @@ void btrfs_rm_dev_replace_free_srcdev(struct btrfs_device *srcdev)
        struct btrfs_fs_info *fs_info = srcdev->fs_info;
        struct btrfs_fs_devices *fs_devices = srcdev->fs_devices;
 
-       if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &srcdev->dev_state)) {
-               /* zero out the old super if it is writable */
-               btrfs_scratch_superblocks(fs_info, srcdev->bdev,
-                                         srcdev->name->str);
-       }
+       mutex_lock(&uuid_mutex);
 
        btrfs_close_bdev(srcdev);
        synchronize_rcu();
@@ -2258,6 +2254,7 @@ void btrfs_rm_dev_replace_free_srcdev(struct btrfs_device *srcdev)
                close_fs_devices(fs_devices);
                free_fs_devices(fs_devices);
        }
+       mutex_unlock(&uuid_mutex);
 }
 
 void btrfs_destroy_dev_replace_tgtdev(struct btrfs_device *tgtdev)
index 5eea939..302c923 100644 (file)
@@ -573,6 +573,9 @@ void btrfs_set_fs_info_ptr(struct btrfs_fs_info *fs_info);
 void btrfs_reset_fs_info_ptr(struct btrfs_fs_info *fs_info);
 bool btrfs_check_rw_degradable(struct btrfs_fs_info *fs_info,
                                        struct btrfs_device *failing_dev);
+void btrfs_scratch_superblocks(struct btrfs_fs_info *fs_info,
+                              struct block_device *bdev,
+                              const char *device_path);
 
 int btrfs_bg_type_to_factor(u64 flags);
 const char *btrfs_bg_type_to_raid_name(u64 flags);
index 8107e06..4df6112 100644 (file)
@@ -218,8 +218,7 @@ struct eventpoll {
        struct file *file;
 
        /* used to optimize loop detection check */
-       struct list_head visited_list_link;
-       int visited;
+       u64 gen;
 
 #ifdef CONFIG_NET_RX_BUSY_POLL
        /* used to track busy poll napi_id */
@@ -274,6 +273,8 @@ static long max_user_watches __read_mostly;
  */
 static DEFINE_MUTEX(epmutex);
 
+static u64 loop_check_gen = 0;
+
 /* Used to check for epoll file descriptor inclusion loops */
 static struct nested_calls poll_loop_ncalls;
 
@@ -283,9 +284,6 @@ static struct kmem_cache *epi_cache __read_mostly;
 /* Slab cache used to allocate "struct eppoll_entry" */
 static struct kmem_cache *pwq_cache __read_mostly;
 
-/* Visited nodes during ep_loop_check(), so we can unset them when we finish */
-static LIST_HEAD(visited_list);
-
 /*
  * List of files with newly added links, where we may need to limit the number
  * of emanating paths. Protected by the epmutex.
@@ -1450,7 +1448,7 @@ static int reverse_path_check(void)
 
 static int ep_create_wakeup_source(struct epitem *epi)
 {
-       const char *name;
+       struct name_snapshot n;
        struct wakeup_source *ws;
 
        if (!epi->ep->ws) {
@@ -1459,8 +1457,9 @@ static int ep_create_wakeup_source(struct epitem *epi)
                        return -ENOMEM;
        }
 
-       name = epi->ffd.file->f_path.dentry->d_name.name;
-       ws = wakeup_source_register(NULL, name);
+       take_dentry_name_snapshot(&n, epi->ffd.file->f_path.dentry);
+       ws = wakeup_source_register(NULL, n.name.name);
+       release_dentry_name_snapshot(&n);
 
        if (!ws)
                return -ENOMEM;
@@ -1522,6 +1521,22 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,
                RCU_INIT_POINTER(epi->ws, NULL);
        }
 
+       /* Add the current item to the list of active epoll hook for this file */
+       spin_lock(&tfile->f_lock);
+       list_add_tail_rcu(&epi->fllink, &tfile->f_ep_links);
+       spin_unlock(&tfile->f_lock);
+
+       /*
+        * Add the current item to the RB tree. All RB tree operations are
+        * protected by "mtx", and ep_insert() is called with "mtx" held.
+        */
+       ep_rbtree_insert(ep, epi);
+
+       /* now check if we've created too many backpaths */
+       error = -EINVAL;
+       if (full_check && reverse_path_check())
+               goto error_remove_epi;
+
        /* Initialize the poll table using the queue callback */
        epq.epi = epi;
        init_poll_funcptr(&epq.pt, ep_ptable_queue_proc);
@@ -1544,22 +1559,6 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,
        if (epi->nwait < 0)
                goto error_unregister;
 
-       /* Add the current item to the list of active epoll hook for this file */
-       spin_lock(&tfile->f_lock);
-       list_add_tail_rcu(&epi->fllink, &tfile->f_ep_links);
-       spin_unlock(&tfile->f_lock);
-
-       /*
-        * Add the current item to the RB tree. All RB tree operations are
-        * protected by "mtx", and ep_insert() is called with "mtx" held.
-        */
-       ep_rbtree_insert(ep, epi);
-
-       /* now check if we've created too many backpaths */
-       error = -EINVAL;
-       if (full_check && reverse_path_check())
-               goto error_remove_epi;
-
        /* We have to drop the new item inside our item list to keep track of it */
        write_lock_irq(&ep->lock);
 
@@ -1588,6 +1587,8 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,
 
        return 0;
 
+error_unregister:
+       ep_unregister_pollwait(ep, epi);
 error_remove_epi:
        spin_lock(&tfile->f_lock);
        list_del_rcu(&epi->fllink);
@@ -1595,9 +1596,6 @@ error_remove_epi:
 
        rb_erase_cached(&epi->rbn, &ep->rbr);
 
-error_unregister:
-       ep_unregister_pollwait(ep, epi);
-
        /*
         * We need to do this because an event could have been arrived on some
         * allocated wait queue. Note that we don't care about the ep->ovflist
@@ -1972,13 +1970,12 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
        struct epitem *epi;
 
        mutex_lock_nested(&ep->mtx, call_nests + 1);
-       ep->visited = 1;
-       list_add(&ep->visited_list_link, &visited_list);
+       ep->gen = loop_check_gen;
        for (rbp = rb_first_cached(&ep->rbr); rbp; rbp = rb_next(rbp)) {
                epi = rb_entry(rbp, struct epitem, rbn);
                if (unlikely(is_file_epoll(epi->ffd.file))) {
                        ep_tovisit = epi->ffd.file->private_data;
-                       if (ep_tovisit->visited)
+                       if (ep_tovisit->gen == loop_check_gen)
                                continue;
                        error = ep_call_nested(&poll_loop_ncalls,
                                        ep_loop_check_proc, epi->ffd.file,
@@ -2019,18 +2016,8 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
  */
 static int ep_loop_check(struct eventpoll *ep, struct file *file)
 {
-       int ret;
-       struct eventpoll *ep_cur, *ep_next;
-
-       ret = ep_call_nested(&poll_loop_ncalls,
+       return ep_call_nested(&poll_loop_ncalls,
                              ep_loop_check_proc, file, ep, current);
-       /* clear visited list */
-       list_for_each_entry_safe(ep_cur, ep_next, &visited_list,
-                                                       visited_list_link) {
-               ep_cur->visited = 0;
-               list_del(&ep_cur->visited_list_link);
-       }
-       return ret;
 }
 
 static void clear_tfile_check_list(void)
@@ -2195,11 +2182,13 @@ int do_epoll_ctl(int epfd, int op, int fd, struct epoll_event *epds,
                goto error_tgt_fput;
        if (op == EPOLL_CTL_ADD) {
                if (!list_empty(&f.file->f_ep_links) ||
+                               ep->gen == loop_check_gen ||
                                                is_file_epoll(tf.file)) {
                        mutex_unlock(&ep->mtx);
                        error = epoll_mutex_lock(&epmutex, 0, nonblock);
                        if (error)
                                goto error_tgt_fput;
+                       loop_check_gen++;
                        full_check = 1;
                        if (is_file_epoll(tf.file)) {
                                error = -ELOOP;
@@ -2263,6 +2252,7 @@ int do_epoll_ctl(int epfd, int op, int fd, struct epoll_event *epds,
 error_tgt_fput:
        if (full_check) {
                clear_tfile_check_list();
+               loop_check_gen++;
                mutex_unlock(&epmutex);
        }
 
index eed0d06..aae0ef2 100644 (file)
@@ -3049,6 +3049,7 @@ static int io_async_buf_func(struct wait_queue_entry *wait, unsigned mode,
        if (!wake_page_match(wpq, key))
                return 0;
 
+       req->rw.kiocb.ki_flags &= ~IOCB_WAITQ;
        list_del_init(&wait->entry);
 
        init_task_work(&req->task_work, io_req_task_submit);
@@ -3106,6 +3107,7 @@ static bool io_rw_should_retry(struct io_kiocb *req)
        wait->wait.flags = 0;
        INIT_LIST_HEAD(&wait->wait.entry);
        kiocb->ki_flags |= IOCB_WAITQ;
+       kiocb->ki_flags &= ~IOCB_NOWAIT;
        kiocb->ki_waitq = wait;
 
        io_get_req_task(req);
@@ -4743,6 +4745,8 @@ static int io_poll_double_wake(struct wait_queue_entry *wait, unsigned mode,
        if (mask && !(mask & poll->events))
                return 0;
 
+       list_del_init(&wait->entry);
+
        if (poll && poll->head) {
                bool done;
 
@@ -8412,11 +8416,19 @@ static int io_uring_show_cred(int id, void *p, void *data)
 
 static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
 {
+       bool has_lock;
        int i;
 
-       mutex_lock(&ctx->uring_lock);
+       /*
+        * Avoid ABBA deadlock between the seq lock and the io_uring mutex,
+        * since fdinfo case grabs it in the opposite direction of normal use
+        * cases. If we fail to get the lock, we just don't iterate any
+        * structures that could be going away outside the io_uring mutex.
+        */
+       has_lock = mutex_trylock(&ctx->uring_lock);
+
        seq_printf(m, "UserFiles:\t%u\n", ctx->nr_user_files);
-       for (i = 0; i < ctx->nr_user_files; i++) {
+       for (i = 0; has_lock && i < ctx->nr_user_files; i++) {
                struct fixed_file_table *table;
                struct file *f;
 
@@ -8428,13 +8440,13 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
                        seq_printf(m, "%5u: <none>\n", i);
        }
        seq_printf(m, "UserBufs:\t%u\n", ctx->nr_user_bufs);
-       for (i = 0; i < ctx->nr_user_bufs; i++) {
+       for (i = 0; has_lock && i < ctx->nr_user_bufs; i++) {
                struct io_mapped_ubuf *buf = &ctx->user_bufs[i];
 
                seq_printf(m, "%5u: 0x%llx/%u\n", i, buf->ubuf,
                                                (unsigned int) buf->len);
        }
-       if (!idr_is_empty(&ctx->personality_idr)) {
+       if (has_lock && !idr_is_empty(&ctx->personality_idr)) {
                seq_printf(m, "Personalities:\n");
                idr_for_each(&ctx->personality_idr, io_uring_show_cred, m);
        }
@@ -8449,7 +8461,8 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
                                        req->task->task_works != NULL);
        }
        spin_unlock_irq(&ctx->completion_lock);
-       mutex_unlock(&ctx->uring_lock);
+       if (has_lock)
+               mutex_unlock(&ctx->uring_lock);
 }
 
 static void io_uring_show_fdinfo(struct seq_file *m, struct file *f)
index e732580..cb52db9 100644 (file)
@@ -579,6 +579,9 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en
        xdr_set_scratch_buffer(&stream, page_address(scratch), PAGE_SIZE);
 
        do {
+               if (entry->label)
+                       entry->label->len = NFS4_MAXLABELLEN;
+
                status = xdr_decode(desc, entry, &stream);
                if (status != 0) {
                        if (status == -EAGAIN)
index ff8965d..a163533 100644 (file)
@@ -715,7 +715,7 @@ nfs4_ff_layout_stat_io_end_write(struct rpc_task *task,
 }
 
 static void
-ff_layout_mark_ds_unreachable(struct pnfs_layout_segment *lseg, int idx)
+ff_layout_mark_ds_unreachable(struct pnfs_layout_segment *lseg, u32 idx)
 {
        struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx);
 
@@ -724,7 +724,7 @@ ff_layout_mark_ds_unreachable(struct pnfs_layout_segment *lseg, int idx)
 }
 
 static void
-ff_layout_mark_ds_reachable(struct pnfs_layout_segment *lseg, int idx)
+ff_layout_mark_ds_reachable(struct pnfs_layout_segment *lseg, u32 idx)
 {
        struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx);
 
@@ -734,14 +734,14 @@ ff_layout_mark_ds_reachable(struct pnfs_layout_segment *lseg, int idx)
 
 static struct nfs4_pnfs_ds *
 ff_layout_choose_ds_for_read(struct pnfs_layout_segment *lseg,
-                            int start_idx, int *best_idx,
+                            u32 start_idx, u32 *best_idx,
                             bool check_device)
 {
        struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg);
        struct nfs4_ff_layout_mirror *mirror;
        struct nfs4_pnfs_ds *ds;
        bool fail_return = false;
-       int idx;
+       u32 idx;
 
        /* mirrors are initially sorted by efficiency */
        for (idx = start_idx; idx < fls->mirror_array_cnt; idx++) {
@@ -766,21 +766,21 @@ ff_layout_choose_ds_for_read(struct pnfs_layout_segment *lseg,
 
 static struct nfs4_pnfs_ds *
 ff_layout_choose_any_ds_for_read(struct pnfs_layout_segment *lseg,
-                                int start_idx, int *best_idx)
+                                u32 start_idx, u32 *best_idx)
 {
        return ff_layout_choose_ds_for_read(lseg, start_idx, best_idx, false);
 }
 
 static struct nfs4_pnfs_ds *
 ff_layout_choose_valid_ds_for_read(struct pnfs_layout_segment *lseg,
-                                  int start_idx, int *best_idx)
+                                  u32 start_idx, u32 *best_idx)
 {
        return ff_layout_choose_ds_for_read(lseg, start_idx, best_idx, true);
 }
 
 static struct nfs4_pnfs_ds *
 ff_layout_choose_best_ds_for_read(struct pnfs_layout_segment *lseg,
-                                 int start_idx, int *best_idx)
+                                 u32 start_idx, u32 *best_idx)
 {
        struct nfs4_pnfs_ds *ds;
 
@@ -791,7 +791,8 @@ ff_layout_choose_best_ds_for_read(struct pnfs_layout_segment *lseg,
 }
 
 static struct nfs4_pnfs_ds *
-ff_layout_get_ds_for_read(struct nfs_pageio_descriptor *pgio, int *best_idx)
+ff_layout_get_ds_for_read(struct nfs_pageio_descriptor *pgio,
+                         u32 *best_idx)
 {
        struct pnfs_layout_segment *lseg = pgio->pg_lseg;
        struct nfs4_pnfs_ds *ds;
@@ -837,7 +838,7 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,
        struct nfs_pgio_mirror *pgm;
        struct nfs4_ff_layout_mirror *mirror;
        struct nfs4_pnfs_ds *ds;
-       int ds_idx;
+       u32 ds_idx, i;
 
 retry:
        ff_layout_pg_check_layout(pgio, req);
@@ -863,14 +864,14 @@ retry:
                goto retry;
        }
 
-       mirror = FF_LAYOUT_COMP(pgio->pg_lseg, ds_idx);
+       for (i = 0; i < pgio->pg_mirror_count; i++) {
+               mirror = FF_LAYOUT_COMP(pgio->pg_lseg, i);
+               pgm = &pgio->pg_mirrors[i];
+               pgm->pg_bsize = mirror->mirror_ds->ds_versions[0].rsize;
+       }
 
        pgio->pg_mirror_idx = ds_idx;
 
-       /* read always uses only one mirror - idx 0 for pgio layer */
-       pgm = &pgio->pg_mirrors[0];
-       pgm->pg_bsize = mirror->mirror_ds->ds_versions[0].rsize;
-
        if (NFS_SERVER(pgio->pg_inode)->flags &
                        (NFS_MOUNT_SOFT|NFS_MOUNT_SOFTERR))
                pgio->pg_maxretrans = io_maxretrans;
@@ -894,7 +895,7 @@ ff_layout_pg_init_write(struct nfs_pageio_descriptor *pgio,
        struct nfs4_ff_layout_mirror *mirror;
        struct nfs_pgio_mirror *pgm;
        struct nfs4_pnfs_ds *ds;
-       int i;
+       u32 i;
 
 retry:
        ff_layout_pg_check_layout(pgio, req);
@@ -1038,7 +1039,7 @@ static void ff_layout_reset_write(struct nfs_pgio_header *hdr, bool retry_pnfs)
 static void ff_layout_resend_pnfs_read(struct nfs_pgio_header *hdr)
 {
        u32 idx = hdr->pgio_mirror_idx + 1;
-       int new_idx = 0;
+       u32 new_idx = 0;
 
        if (ff_layout_choose_any_ds_for_read(hdr->lseg, idx + 1, &new_idx))
                ff_layout_send_layouterror(hdr->lseg);
@@ -1075,7 +1076,7 @@ static int ff_layout_async_handle_error_v4(struct rpc_task *task,
                                           struct nfs4_state *state,
                                           struct nfs_client *clp,
                                           struct pnfs_layout_segment *lseg,
-                                          int idx)
+                                          u32 idx)
 {
        struct pnfs_layout_hdr *lo = lseg->pls_layout;
        struct inode *inode = lo->plh_inode;
@@ -1149,7 +1150,7 @@ reset:
 /* Retry all errors through either pNFS or MDS except for -EJUKEBOX */
 static int ff_layout_async_handle_error_v3(struct rpc_task *task,
                                           struct pnfs_layout_segment *lseg,
-                                          int idx)
+                                          u32 idx)
 {
        struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx);
 
@@ -1184,7 +1185,7 @@ static int ff_layout_async_handle_error(struct rpc_task *task,
                                        struct nfs4_state *state,
                                        struct nfs_client *clp,
                                        struct pnfs_layout_segment *lseg,
-                                       int idx)
+                                       u32 idx)
 {
        int vers = clp->cl_nfs_mod->rpc_vers->number;
 
@@ -1211,7 +1212,7 @@ static int ff_layout_async_handle_error(struct rpc_task *task,
 }
 
 static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg,
-                                       int idx, u64 offset, u64 length,
+                                       u32 idx, u64 offset, u64 length,
                                        u32 *op_status, int opnum, int error)
 {
        struct nfs4_ff_layout_mirror *mirror;
@@ -1809,7 +1810,7 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
        loff_t offset = hdr->args.offset;
        int vers;
        struct nfs_fh *fh;
-       int idx = hdr->pgio_mirror_idx;
+       u32 idx = hdr->pgio_mirror_idx;
 
        mirror = FF_LAYOUT_COMP(lseg, idx);
        ds = nfs4_ff_layout_prepare_ds(lseg, mirror, true);
index 142225f..2b2211d 100644 (file)
@@ -356,7 +356,15 @@ static ssize_t _nfs42_proc_copy(struct file *src,
 
        truncate_pagecache_range(dst_inode, pos_dst,
                                 pos_dst + res->write_res.count);
-
+       spin_lock(&dst_inode->i_lock);
+       NFS_I(dst_inode)->cache_validity |= (NFS_INO_REVAL_PAGECACHE |
+                       NFS_INO_REVAL_FORCED | NFS_INO_INVALID_SIZE |
+                       NFS_INO_INVALID_ATTR | NFS_INO_INVALID_DATA);
+       spin_unlock(&dst_inode->i_lock);
+       spin_lock(&src_inode->i_lock);
+       NFS_I(src_inode)->cache_validity |= (NFS_INO_REVAL_PAGECACHE |
+                       NFS_INO_REVAL_FORCED | NFS_INO_INVALID_ATIME);
+       spin_unlock(&src_inode->i_lock);
        status = res->write_res.count;
 out:
        if (args->sync)
index 60dbee4..117db82 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -106,25 +106,6 @@ void pipe_double_lock(struct pipe_inode_info *pipe1,
        }
 }
 
-/* Drop the inode semaphore and wait for a pipe event, atomically */
-void pipe_wait(struct pipe_inode_info *pipe)
-{
-       DEFINE_WAIT(rdwait);
-       DEFINE_WAIT(wrwait);
-
-       /*
-        * Pipes are system-local resources, so sleeping on them
-        * is considered a noninteractive wait:
-        */
-       prepare_to_wait(&pipe->rd_wait, &rdwait, TASK_INTERRUPTIBLE);
-       prepare_to_wait(&pipe->wr_wait, &wrwait, TASK_INTERRUPTIBLE);
-       pipe_unlock(pipe);
-       schedule();
-       finish_wait(&pipe->rd_wait, &rdwait);
-       finish_wait(&pipe->wr_wait, &wrwait);
-       pipe_lock(pipe);
-}
-
 static void anon_pipe_buf_release(struct pipe_inode_info *pipe,
                                  struct pipe_buffer *buf)
 {
@@ -1035,12 +1016,52 @@ SYSCALL_DEFINE1(pipe, int __user *, fildes)
        return do_pipe2(fildes, 0);
 }
 
+/*
+ * This is the stupid "wait for pipe to be readable or writable"
+ * model.
+ *
+ * See pipe_read/write() for the proper kind of exclusive wait,
+ * but that requires that we wake up any other readers/writers
+ * if we then do not end up reading everything (ie the whole
+ * "wake_next_reader/writer" logic in pipe_read/write()).
+ */
+void pipe_wait_readable(struct pipe_inode_info *pipe)
+{
+       pipe_unlock(pipe);
+       wait_event_interruptible(pipe->rd_wait, pipe_readable(pipe));
+       pipe_lock(pipe);
+}
+
+void pipe_wait_writable(struct pipe_inode_info *pipe)
+{
+       pipe_unlock(pipe);
+       wait_event_interruptible(pipe->wr_wait, pipe_writable(pipe));
+       pipe_lock(pipe);
+}
+
+/*
+ * This depends on both the wait (here) and the wakeup (wake_up_partner)
+ * holding the pipe lock, so "*cnt" is stable and we know a wakeup cannot
+ * race with the count check and waitqueue prep.
+ *
+ * Normally in order to avoid races, you'd do the prepare_to_wait() first,
+ * then check the condition you're waiting for, and only then sleep. But
+ * because of the pipe lock, we can check the condition before being on
+ * the wait queue.
+ *
+ * We use the 'rd_wait' waitqueue for pipe partner waiting.
+ */
 static int wait_for_partner(struct pipe_inode_info *pipe, unsigned int *cnt)
 {
+       DEFINE_WAIT(rdwait);
        int cur = *cnt;
 
        while (cur == *cnt) {
-               pipe_wait(pipe);
+               prepare_to_wait(&pipe->rd_wait, &rdwait, TASK_INTERRUPTIBLE);
+               pipe_unlock(pipe);
+               schedule();
+               finish_wait(&pipe->rd_wait, &rdwait);
+               pipe_lock(pipe);
                if (signal_pending(current))
                        break;
        }
@@ -1050,7 +1071,6 @@ static int wait_for_partner(struct pipe_inode_info *pipe, unsigned int *cnt)
 static void wake_up_partner(struct pipe_inode_info *pipe)
 {
        wake_up_interruptible_all(&pipe->rd_wait);
-       wake_up_interruptible_all(&pipe->wr_wait);
 }
 
 static int fifo_open(struct inode *inode, struct file *filp)
index 5db58b8..d342818 100644 (file)
@@ -538,6 +538,14 @@ ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t
        inc_syscw(current);
        return ret;
 }
+/*
+ * This "EXPORT_SYMBOL_GPL()" is more of a "EXPORT_SYMBOL_DONTUSE()",
+ * but autofs is one of the few internal kernel users that actually
+ * wants this _and_ can be built as a module. So we need to export
+ * this symbol for autofs, even though it really isn't appropriate
+ * for any other kernel modules.
+ */
+EXPORT_SYMBOL_GPL(__kernel_write);
 
 ssize_t kernel_write(struct file *file, const void *buf, size_t count,
                            loff_t *pos)
index d7c8a7c..c3d00df 100644 (file)
@@ -563,7 +563,7 @@ static int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_des
                        sd->need_wakeup = false;
                }
 
-               pipe_wait(pipe);
+               pipe_wait_readable(pipe);
        }
 
        return 1;
@@ -1077,7 +1077,7 @@ static int wait_for_space(struct pipe_inode_info *pipe, unsigned flags)
                        return -EAGAIN;
                if (signal_pending(current))
                        return -ERESTARTSYS;
-               pipe_wait(pipe);
+               pipe_wait_writable(pipe);
        }
 }
 
@@ -1454,7 +1454,7 @@ static int ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
                        ret = -EAGAIN;
                        break;
                }
-               pipe_wait(pipe);
+               pipe_wait_readable(pipe);
        }
 
        pipe_unlock(pipe);
@@ -1493,7 +1493,7 @@ static int opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
                        ret = -ERESTARTSYS;
                        break;
                }
-               pipe_wait(pipe);
+               pipe_wait_writable(pipe);
        }
 
        pipe_unlock(pipe);
index 1e4cdc6..64ae25c 100644 (file)
@@ -958,7 +958,7 @@ void acpi_os_set_prepare_extended_sleep(int (*func)(u8 sleep_state,
 acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state,
                                           u32 val_a, u32 val_b);
 
-#ifdef CONFIG_X86
+#ifndef CONFIG_IA64
 void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
 #else
 static inline void arch_reserve_mem_area(acpi_physical_address addr,
index 69b1dab..0f6cd6b 100644 (file)
@@ -30,7 +30,11 @@ static inline unsigned long topology_get_freq_scale(int cpu)
        return per_cpu(freq_scale, cpu);
 }
 
-bool arch_freq_counters_available(struct cpumask *cpus);
+void topology_set_freq_scale(const struct cpumask *cpus, unsigned long cur_freq,
+                            unsigned long max_freq);
+bool topology_scale_freq_invariant(void);
+
+bool arch_freq_counters_available(const struct cpumask *cpus);
 
 DECLARE_PER_CPU(unsigned long, thermal_pressure);
 
index a911e5d..fa37b1c 100644 (file)
@@ -217,6 +217,7 @@ void refresh_frequency_limits(struct cpufreq_policy *policy);
 void cpufreq_update_policy(unsigned int cpu);
 void cpufreq_update_limits(unsigned int cpu);
 bool have_governor_per_policy(void);
+bool cpufreq_supports_freq_invariance(void);
 struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
 void cpufreq_enable_fast_switch(struct cpufreq_policy *policy);
 void cpufreq_disable_fast_switch(struct cpufreq_policy *policy);
@@ -237,6 +238,10 @@ static inline unsigned int cpufreq_get_hw_max_freq(unsigned int cpu)
 {
        return 0;
 }
+static inline bool cpufreq_supports_freq_invariance(void)
+{
+       return false;
+}
 static inline void disable_cpufreq(void) { }
 #endif
 
@@ -1006,8 +1011,14 @@ static inline void sched_cpufreq_governor_change(struct cpufreq_policy *policy,
 extern void arch_freq_prepare_all(void);
 extern unsigned int arch_freq_get_on_cpu(int cpu);
 
-extern void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq,
-                               unsigned long max_freq);
+#ifndef arch_set_freq_scale
+static __always_inline
+void arch_set_freq_scale(const struct cpumask *cpus,
+                        unsigned long cur_freq,
+                        unsigned long max_freq)
+{
+}
+#endif
 
 /* the following are really really optional */
 extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs;
index f14f17f..4a50a5c 100644 (file)
@@ -106,8 +106,11 @@ extern int devfreq_event_get_event(struct devfreq_event_dev *edev,
                                struct devfreq_event_data *edata);
 extern int devfreq_event_reset_event(struct devfreq_event_dev *edev);
 extern struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(
-                               struct device *dev, int index);
-extern int devfreq_event_get_edev_count(struct device *dev);
+                               struct device *dev,
+                               const char *phandle_name,
+                               int index);
+extern int devfreq_event_get_edev_count(struct device *dev,
+                               const char *phandle_name);
 extern struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev,
                                struct devfreq_event_desc *desc);
 extern int devfreq_event_remove_edev(struct devfreq_event_dev *edev);
@@ -152,12 +155,15 @@ static inline int devfreq_event_reset_event(struct devfreq_event_dev *edev)
 }
 
 static inline struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(
-                                       struct device *dev, int index)
+                                       struct device *dev,
+                                       const char *phandle_name,
+                                       int index)
 {
        return ERR_PTR(-EINVAL);
 }
 
-static inline int devfreq_event_get_edev_count(struct device *dev)
+static inline int devfreq_event_get_edev_count(struct device *dev,
+                                       const char *phandle_name)
 {
        return -EINVAL;
 }
index 12782fb..2f4a74e 100644 (file)
@@ -261,7 +261,9 @@ void devm_devfreq_unregister_notifier(struct device *dev,
                                struct devfreq *devfreq,
                                struct notifier_block *nb,
                                unsigned int list);
-struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index);
+struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node);
+struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev,
+                               const char *phandle_name, int index);
 
 #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
 /**
@@ -414,8 +416,13 @@ static inline void devm_devfreq_unregister_notifier(struct device *dev,
 {
 }
 
+static inline struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node)
+{
+       return ERR_PTR(-ENODEV);
+}
+
 static inline struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev,
-                                       int index)
+                                       const char *phandle_name, int index)
 {
        return ERR_PTR(-ENODEV);
 }
index da4c65f..ebf73d4 100644 (file)
@@ -281,6 +281,7 @@ struct memstick_host {
 
        struct memstick_dev *card;
        unsigned int        retries;
+       bool removing;
 
        /* Notify the host that some requests are pending. */
        void                (*request)(struct memstick_host *host);
index 9408f32..69cb46f 100644 (file)
@@ -1611,8 +1611,8 @@ struct nfs_pgio_header {
        __u64                   mds_offset;     /* Filelayout dense stripe */
        struct nfs_page_array   page_array;
        struct nfs_client       *ds_clp;        /* pNFS data server */
-       int                     ds_commit_idx;  /* ds index if ds_clp is set */
-       int                     pgio_mirror_idx;/* mirror index in pgio layer */
+       u32                     ds_commit_idx;  /* ds index if ds_clp is set */
+       u32                     pgio_mirror_idx;/* mirror index in pgio layer */
 };
 
 struct nfs_mds_commit_info {
index 50afd0d..5d2705f 100644 (file)
@@ -240,8 +240,9 @@ extern unsigned int pipe_max_size;
 extern unsigned long pipe_user_pages_hard;
 extern unsigned long pipe_user_pages_soft;
 
-/* Drop the inode semaphore and wait for a pipe event, atomically */
-void pipe_wait(struct pipe_inode_info *pipe);
+/* Wait for a pipe to be readable/writable while dropping the pipe lock */
+void pipe_wait_readable(struct pipe_inode_info *);
+void pipe_wait_writable(struct pipe_inode_info *);
 
 struct pipe_inode_info *alloc_pipe_info(void);
 void free_pipe_info(struct pipe_inode_info *);
index 91220ac..7557c10 100644 (file)
@@ -312,6 +312,11 @@ static inline void __mod_zone_page_state(struct zone *zone,
 static inline void __mod_node_page_state(struct pglist_data *pgdat,
                        enum node_stat_item item, int delta)
 {
+       if (vmstat_item_in_bytes(item)) {
+               VM_WARN_ON_ONCE(delta & (PAGE_SIZE - 1));
+               delta >>= PAGE_SHIFT;
+       }
+
        node_page_state_add(delta, pgdat, item);
 }
 
index e390082..5ae7b4e 100644 (file)
@@ -114,22 +114,8 @@ static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time,
 static void sugov_fast_switch(struct sugov_policy *sg_policy, u64 time,
                              unsigned int next_freq)
 {
-       struct cpufreq_policy *policy = sg_policy->policy;
-       int cpu;
-
-       if (!sugov_update_next_freq(sg_policy, time, next_freq))
-               return;
-
-       next_freq = cpufreq_driver_fast_switch(policy, next_freq);
-       if (!next_freq)
-               return;
-
-       policy->cur = next_freq;
-
-       if (trace_cpu_frequency_enabled()) {
-               for_each_cpu(cpu, policy->cpus)
-                       trace_cpu_frequency(next_freq, cpu);
-       }
+       if (sugov_update_next_freq(sg_policy, time, next_freq))
+               cpufreq_driver_fast_switch(sg_policy->policy, next_freq);
 }
 
 static void sugov_deferred_update(struct sugov_policy *sg_policy, u64 time,
index 603255f..5414539 100644 (file)
@@ -6993,16 +6993,14 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip,
 {
        int bit;
 
-       if ((op->flags & FTRACE_OPS_FL_RCU) && !rcu_is_watching())
-               return;
-
        bit = trace_test_and_set_recursion(TRACE_LIST_START, TRACE_LIST_MAX);
        if (bit < 0)
                return;
 
        preempt_disable_notrace();
 
-       op->func(ip, parent_ip, op, regs);
+       if (!(op->flags & FTRACE_OPS_FL_RCU) || rcu_is_watching())
+               op->func(ip, parent_ip, op, regs);
 
        preempt_enable_notrace();
        trace_clear_recursion(bit);
index 2a7c263..d3e5de7 100644 (file)
@@ -3546,13 +3546,15 @@ struct trace_entry *trace_find_next_entry(struct trace_iterator *iter,
        if (iter->ent && iter->ent != iter->temp) {
                if ((!iter->temp || iter->temp_size < iter->ent_size) &&
                    !WARN_ON_ONCE(iter->temp == static_temp_buf)) {
-                       kfree(iter->temp);
-                       iter->temp = kmalloc(iter->ent_size, GFP_KERNEL);
-                       if (!iter->temp)
+                       void *temp;
+                       temp = kmalloc(iter->ent_size, GFP_KERNEL);
+                       if (!temp)
                                return NULL;
+                       kfree(iter->temp);
+                       iter->temp = temp;
+                       iter->temp_size = iter->ent_size;
                }
                memcpy(iter->temp, iter->ent, iter->ent_size);
-               iter->temp_size = iter->ent_size;
                iter->ent = iter->temp;
        }
        entry = __find_next_entry(iter, ent_cpu, NULL, ent_ts);
index 9323453..dfb9981 100644 (file)
@@ -49,7 +49,7 @@ static inline void prandom_state_selftest(void)
 }
 #endif
 
-DEFINE_PER_CPU(struct rnd_state, net_rand_state);
+DEFINE_PER_CPU(struct rnd_state, net_rand_state)  __latent_entropy;
 
 /**
  *     prandom_u32_state - seeded pseudo-random number generator.
index 5202e38..99c49ee 100644 (file)
@@ -2365,7 +2365,11 @@ readpage:
                }
 
                if (!PageUptodate(page)) {
-                       error = lock_page_killable(page);
+                       if (iocb->ki_flags & IOCB_WAITQ)
+                               error = lock_page_async(page, iocb->ki_waitq);
+                       else
+                               error = lock_page_killable(page);
+
                        if (unlikely(error))
                                goto readpage_error;
                        if (!PageUptodate(page)) {
index dfe781d..e869c63 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1256,7 +1256,7 @@ static __always_inline long __get_user_pages_locked(struct mm_struct *mm,
        }
 
        if (flags & FOLL_PIN)
-               atomic_set(&current->mm->has_pinned, 1);
+               atomic_set(&mm->has_pinned, 1);
 
        /*
         * FOLL_PIN and FOLL_GET are mutually exclusive. Traditional behavior
index 5661fa1..6866533 100644 (file)
@@ -3367,9 +3367,16 @@ struct page *rmqueue(struct zone *preferred_zone,
        struct page *page;
 
        if (likely(order == 0)) {
-               page = rmqueue_pcplist(preferred_zone, zone, gfp_flags,
+               /*
+                * MIGRATE_MOVABLE pcplist could have the pages on CMA area and
+                * we need to skip it when CMA area isn't allowed.
+                */
+               if (!IS_ENABLED(CONFIG_CMA) || alloc_flags & ALLOC_CMA ||
+                               migratetype != MIGRATE_MOVABLE) {
+                       page = rmqueue_pcplist(preferred_zone, zone, gfp_flags,
                                        migratetype, alloc_flags);
-               goto out;
+                       goto out;
+               }
        }
 
        /*
@@ -3381,7 +3388,13 @@ struct page *rmqueue(struct zone *preferred_zone,
 
        do {
                page = NULL;
-               if (alloc_flags & ALLOC_HARDER) {
+               /*
+                * order-0 request can reach here when the pcplist is skipped
+                * due to non-CMA allocation context. HIGHATOMIC area is
+                * reserved for high-order atomic allocation, so order-0
+                * request should skip it.
+                */
+               if (order > 0 && alloc_flags & ALLOC_HARDER) {
                        page = __rmqueue_smallest(zone, order, MIGRATE_HIGHATOMIC);
                        if (page)
                                trace_mm_page_alloc_zone_locked(page, order, migratetype);
index d4177ae..6d35740 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1413,10 +1413,6 @@ slab_flags_t kmem_cache_flags(unsigned int object_size,
        char *next_block;
        slab_flags_t block_flags;
 
-       /* If slub_debug = 0, it folds into the if conditional. */
-       if (!slub_debug_string)
-               return flags | slub_debug;
-
        len = strlen(name);
        next_block = slub_debug_string;
        /* Go through all blocks of debug options, see if any matches our slab's name */
@@ -1450,7 +1446,7 @@ slab_flags_t kmem_cache_flags(unsigned int object_size,
                }
        }
 
-       return slub_debug;
+       return flags | slub_debug;
 }
 #else /* !CONFIG_SLUB_DEBUG */
 static inline void setup_object_debug(struct kmem_cache *s,
index a698ece..4852bf4 100644 (file)
@@ -9,7 +9,7 @@ dtc-objs        := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
 dtc-objs       += dtc-lexer.lex.o dtc-parser.tab.o
 
 # Source files need to get at the userspace version of libfdt_env.h to compile
-HOST_EXTRACFLAGS := -I $(srctree)/$(src)/libfdt
+HOST_EXTRACFLAGS += -I $(srctree)/$(src)/libfdt
 
 ifeq ($(shell pkg-config --exists yaml-0.1 2>/dev/null && echo yes),)
 ifneq ($(CHECK_DT_BINDING)$(CHECK_DTBS),)
index f253681..feb2efa 100644 (file)
@@ -589,7 +589,7 @@ explictly||explicitly
 expresion||expression
 exprimental||experimental
 extened||extended
-exteneded||extended||extended
+exteneded||extended
 extensability||extensibility
 extention||extension
 extenstion||extension