diff options
208 files changed, 1738 insertions, 1231 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 21e2d8863705..be7c0d9506b1 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt | |||
@@ -106,6 +106,16 @@ | |||
106 | use by PCI | 106 | use by PCI |
107 | Format: <irq>,<irq>... | 107 | Format: <irq>,<irq>... |
108 | 108 | ||
109 | acpi_mask_gpe= [HW,ACPI] | ||
110 | Due to the existence of _Lxx/_Exx, some GPEs triggered | ||
111 | by unsupported hardware/firmware features can result in | ||
112 | GPE floodings that cannot be automatically disabled by | ||
113 | the GPE dispatcher. | ||
114 | This facility can be used to prevent such uncontrolled | ||
115 | GPE floodings. | ||
116 | Format: <int> | ||
117 | Support masking of GPEs numbered from 0x00 to 0x7f. | ||
118 | |||
109 | acpi_no_auto_serialize [HW,ACPI] | 119 | acpi_no_auto_serialize [HW,ACPI] |
110 | Disable auto-serialization of AML methods | 120 | Disable auto-serialization of AML methods |
111 | AML control methods that contain the opcodes to create | 121 | AML control methods that contain the opcodes to create |
@@ -3811,10 +3821,11 @@ | |||
3811 | it if 0 is given (See Documentation/cgroup-v1/memory.txt) | 3821 | it if 0 is given (See Documentation/cgroup-v1/memory.txt) |
3812 | 3822 | ||
3813 | swiotlb= [ARM,IA-64,PPC,MIPS,X86] | 3823 | swiotlb= [ARM,IA-64,PPC,MIPS,X86] |
3814 | Format: { <int> | force } | 3824 | Format: { <int> | force | noforce } |
3815 | <int> -- Number of I/O TLB slabs | 3825 | <int> -- Number of I/O TLB slabs |
3816 | force -- force using of bounce buffers even if they | 3826 | force -- force using of bounce buffers even if they |
3817 | wouldn't be automatically used by the kernel | 3827 | wouldn't be automatically used by the kernel |
3828 | noforce -- Never use bounce buffers (for debugging) | ||
3818 | 3829 | ||
3819 | switches= [HW,M68k] | 3830 | switches= [HW,M68k] |
3820 | 3831 | ||
diff --git a/Documentation/block/queue-sysfs.txt b/Documentation/block/queue-sysfs.txt index 51642159aedb..c0a3bb5a6e4e 100644 --- a/Documentation/block/queue-sysfs.txt +++ b/Documentation/block/queue-sysfs.txt | |||
@@ -54,9 +54,9 @@ This is the hardware sector size of the device, in bytes. | |||
54 | 54 | ||
55 | io_poll (RW) | 55 | io_poll (RW) |
56 | ------------ | 56 | ------------ |
57 | When read, this file shows the total number of block IO polls and how | 57 | When read, this file shows whether polling is enabled (1) or disabled |
58 | many returned success. Writing '0' to this file will disable polling | 58 | (0). Writing '0' to this file will disable polling for this device. |
59 | for this device. Writing any non-zero value will enable this feature. | 59 | Writing any non-zero value will enable this feature. |
60 | 60 | ||
61 | io_poll_delay (RW) | 61 | io_poll_delay (RW) |
62 | ------------------ | 62 | ------------------ |
diff --git a/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt b/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt index 3e5b9793341f..8682ab6d4a50 100644 --- a/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt +++ b/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt | |||
@@ -8,8 +8,9 @@ This driver provides a simple power button event via an Interrupt. | |||
8 | Required properties: | 8 | Required properties: |
9 | - compatible: should be "ti,tps65217-pwrbutton" or "ti,tps65218-pwrbutton" | 9 | - compatible: should be "ti,tps65217-pwrbutton" or "ti,tps65218-pwrbutton" |
10 | 10 | ||
11 | Required properties for TPS65218: | 11 | Required properties: |
12 | - interrupts: should be one of the following | 12 | - interrupts: should be one of the following |
13 | - <2>: For controllers compatible with tps65217 | ||
13 | - <3 IRQ_TYPE_EDGE_BOTH>: For controllers compatible with tps65218 | 14 | - <3 IRQ_TYPE_EDGE_BOTH>: For controllers compatible with tps65218 |
14 | 15 | ||
15 | Examples: | 16 | Examples: |
@@ -17,6 +18,7 @@ Examples: | |||
17 | &tps { | 18 | &tps { |
18 | tps65217-pwrbutton { | 19 | tps65217-pwrbutton { |
19 | compatible = "ti,tps65217-pwrbutton"; | 20 | compatible = "ti,tps65217-pwrbutton"; |
21 | interrupts = <2>; | ||
20 | }; | 22 | }; |
21 | }; | 23 | }; |
22 | 24 | ||
diff --git a/Documentation/devicetree/bindings/power/supply/tps65217_charger.txt b/Documentation/devicetree/bindings/power/supply/tps65217_charger.txt index 98d131acee95..a11072c5a866 100644 --- a/Documentation/devicetree/bindings/power/supply/tps65217_charger.txt +++ b/Documentation/devicetree/bindings/power/supply/tps65217_charger.txt | |||
@@ -2,11 +2,16 @@ TPS65217 Charger | |||
2 | 2 | ||
3 | Required Properties: | 3 | Required Properties: |
4 | -compatible: "ti,tps65217-charger" | 4 | -compatible: "ti,tps65217-charger" |
5 | -interrupts: TPS65217 interrupt numbers for the AC and USB charger input change. | ||
6 | Should be <0> for the USB charger and <1> for the AC adapter. | ||
7 | -interrupt-names: Should be "USB" and "AC" | ||
5 | 8 | ||
6 | This node is a subnode of the tps65217 PMIC. | 9 | This node is a subnode of the tps65217 PMIC. |
7 | 10 | ||
8 | Example: | 11 | Example: |
9 | 12 | ||
10 | tps65217-charger { | 13 | tps65217-charger { |
11 | compatible = "ti,tps65090-charger"; | 14 | compatible = "ti,tps65217-charger"; |
15 | interrupts = <0>, <1>; | ||
16 | interrupt-names = "USB", "AC"; | ||
12 | }; | 17 | }; |
diff --git a/Documentation/driver-api/infrastructure.rst b/Documentation/driver-api/infrastructure.rst index 0bb0b5fc9512..6d9ff316b608 100644 --- a/Documentation/driver-api/infrastructure.rst +++ b/Documentation/driver-api/infrastructure.rst | |||
@@ -55,21 +55,6 @@ Device Drivers DMA Management | |||
55 | .. kernel-doc:: drivers/base/dma-mapping.c | 55 | .. kernel-doc:: drivers/base/dma-mapping.c |
56 | :export: | 56 | :export: |
57 | 57 | ||
58 | Device Drivers Power Management | ||
59 | ------------------------------- | ||
60 | |||
61 | .. kernel-doc:: drivers/base/power/main.c | ||
62 | :export: | ||
63 | |||
64 | Device Drivers ACPI Support | ||
65 | --------------------------- | ||
66 | |||
67 | .. kernel-doc:: drivers/acpi/scan.c | ||
68 | :export: | ||
69 | |||
70 | .. kernel-doc:: drivers/acpi/scan.c | ||
71 | :internal: | ||
72 | |||
73 | Device drivers PnP support | 58 | Device drivers PnP support |
74 | -------------------------- | 59 | -------------------------- |
75 | 60 | ||
diff --git a/Documentation/networking/mpls-sysctl.txt b/Documentation/networking/mpls-sysctl.txt index 9ed15f86c17c..15d8d16934fd 100644 --- a/Documentation/networking/mpls-sysctl.txt +++ b/Documentation/networking/mpls-sysctl.txt | |||
@@ -5,8 +5,8 @@ platform_labels - INTEGER | |||
5 | possible to configure forwarding for label values equal to or | 5 | possible to configure forwarding for label values equal to or |
6 | greater than the number of platform labels. | 6 | greater than the number of platform labels. |
7 | 7 | ||
8 | A dense utliziation of the entries in the platform label table | 8 | A dense utilization of the entries in the platform label table |
9 | is possible and expected aas the platform labels are locally | 9 | is possible and expected as the platform labels are locally |
10 | allocated. | 10 | allocated. |
11 | 11 | ||
12 | If the number of platform label table entries is set to 0 no | 12 | If the number of platform label table entries is set to 0 no |
diff --git a/Documentation/vfio-mediated-device.txt b/Documentation/vfio-mediated-device.txt index b38afec35edc..d226c7a5ba8b 100644 --- a/Documentation/vfio-mediated-device.txt +++ b/Documentation/vfio-mediated-device.txt | |||
@@ -127,22 +127,22 @@ the VFIO when devices are unbound from the driver. | |||
127 | Physical Device Driver Interface | 127 | Physical Device Driver Interface |
128 | -------------------------------- | 128 | -------------------------------- |
129 | 129 | ||
130 | The physical device driver interface provides the parent_ops[3] structure to | 130 | The physical device driver interface provides the mdev_parent_ops[3] structure |
131 | define the APIs to manage work in the mediated core driver that is related to | 131 | to define the APIs to manage work in the mediated core driver that is related |
132 | the physical device. | 132 | to the physical device. |
133 | 133 | ||
134 | The structures in the parent_ops structure are as follows: | 134 | The structures in the mdev_parent_ops structure are as follows: |
135 | 135 | ||
136 | * dev_attr_groups: attributes of the parent device | 136 | * dev_attr_groups: attributes of the parent device |
137 | * mdev_attr_groups: attributes of the mediated device | 137 | * mdev_attr_groups: attributes of the mediated device |
138 | * supported_config: attributes to define supported configurations | 138 | * supported_config: attributes to define supported configurations |
139 | 139 | ||
140 | The functions in the parent_ops structure are as follows: | 140 | The functions in the mdev_parent_ops structure are as follows: |
141 | 141 | ||
142 | * create: allocate basic resources in a driver for a mediated device | 142 | * create: allocate basic resources in a driver for a mediated device |
143 | * remove: free resources in a driver when a mediated device is destroyed | 143 | * remove: free resources in a driver when a mediated device is destroyed |
144 | 144 | ||
145 | The callbacks in the parent_ops structure are as follows: | 145 | The callbacks in the mdev_parent_ops structure are as follows: |
146 | 146 | ||
147 | * open: open callback of mediated device | 147 | * open: open callback of mediated device |
148 | * close: close callback of mediated device | 148 | * close: close callback of mediated device |
@@ -151,14 +151,14 @@ The callbacks in the parent_ops structure are as follows: | |||
151 | * write: write emulation callback | 151 | * write: write emulation callback |
152 | * mmap: mmap emulation callback | 152 | * mmap: mmap emulation callback |
153 | 153 | ||
154 | A driver should use the parent_ops structure in the function call to register | 154 | A driver should use the mdev_parent_ops structure in the function call to |
155 | itself with the mdev core driver: | 155 | register itself with the mdev core driver: |
156 | 156 | ||
157 | extern int mdev_register_device(struct device *dev, | 157 | extern int mdev_register_device(struct device *dev, |
158 | const struct parent_ops *ops); | 158 | const struct mdev_parent_ops *ops); |
159 | 159 | ||
160 | However, the parent_ops structure is not required in the function call that a | 160 | However, the mdev_parent_ops structure is not required in the function call |
161 | driver should use to unregister itself with the mdev core driver: | 161 | that a driver should use to unregister itself with the mdev core driver: |
162 | 162 | ||
163 | extern void mdev_unregister_device(struct device *dev); | 163 | extern void mdev_unregister_device(struct device *dev); |
164 | 164 | ||
@@ -223,6 +223,9 @@ Directories and files under the sysfs for Each Physical Device | |||
223 | 223 | ||
224 | sprintf(buf, "%s-%s", dev_driver_string(parent->dev), group->name); | 224 | sprintf(buf, "%s-%s", dev_driver_string(parent->dev), group->name); |
225 | 225 | ||
226 | (or using mdev_parent_dev(mdev) to arrive at the parent device outside | ||
227 | of the core mdev code) | ||
228 | |||
226 | * device_api | 229 | * device_api |
227 | 230 | ||
228 | This attribute should show which device API is being created, for example, | 231 | This attribute should show which device API is being created, for example, |
@@ -394,5 +397,5 @@ References | |||
394 | 397 | ||
395 | [1] See Documentation/vfio.txt for more information on VFIO. | 398 | [1] See Documentation/vfio.txt for more information on VFIO. |
396 | [2] struct mdev_driver in include/linux/mdev.h | 399 | [2] struct mdev_driver in include/linux/mdev.h |
397 | [3] struct parent_ops in include/linux/mdev.h | 400 | [3] struct mdev_parent_ops in include/linux/mdev.h |
398 | [4] struct vfio_iommu_driver_ops in include/linux/vfio.h | 401 | [4] struct vfio_iommu_driver_ops in include/linux/vfio.h |
diff --git a/MAINTAINERS b/MAINTAINERS index cfff2c9e3d94..a136dfbb8eea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -3800,6 +3800,7 @@ F: include/linux/devcoredump.h | |||
3800 | DEVICE FREQUENCY (DEVFREQ) | 3800 | DEVICE FREQUENCY (DEVFREQ) |
3801 | M: MyungJoo Ham <myungjoo.ham@samsung.com> | 3801 | M: MyungJoo Ham <myungjoo.ham@samsung.com> |
3802 | M: Kyungmin Park <kyungmin.park@samsung.com> | 3802 | M: Kyungmin Park <kyungmin.park@samsung.com> |
3803 | R: Chanwoo Choi <cw00.choi@samsung.com> | ||
3803 | L: linux-pm@vger.kernel.org | 3804 | L: linux-pm@vger.kernel.org |
3804 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git | 3805 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git |
3805 | S: Maintained | 3806 | S: Maintained |
@@ -5080,9 +5081,11 @@ F: drivers/net/wan/dlci.c | |||
5080 | F: drivers/net/wan/sdla.c | 5081 | F: drivers/net/wan/sdla.c |
5081 | 5082 | ||
5082 | FRAMEBUFFER LAYER | 5083 | FRAMEBUFFER LAYER |
5084 | M: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | ||
5083 | L: linux-fbdev@vger.kernel.org | 5085 | L: linux-fbdev@vger.kernel.org |
5086 | T: git git://github.com/bzolnier/linux.git | ||
5084 | Q: http://patchwork.kernel.org/project/linux-fbdev/list/ | 5087 | Q: http://patchwork.kernel.org/project/linux-fbdev/list/ |
5085 | S: Orphan | 5088 | S: Maintained |
5086 | F: Documentation/fb/ | 5089 | F: Documentation/fb/ |
5087 | F: drivers/video/ | 5090 | F: drivers/video/ |
5088 | F: include/video/ | 5091 | F: include/video/ |
@@ -8852,17 +8855,22 @@ F: drivers/video/fbdev/nvidia/ | |||
8852 | NVM EXPRESS DRIVER | 8855 | NVM EXPRESS DRIVER |
8853 | M: Keith Busch <keith.busch@intel.com> | 8856 | M: Keith Busch <keith.busch@intel.com> |
8854 | M: Jens Axboe <axboe@fb.com> | 8857 | M: Jens Axboe <axboe@fb.com> |
8858 | M: Christoph Hellwig <hch@lst.de> | ||
8859 | M: Sagi Grimberg <sagi@grimberg.me> | ||
8855 | L: linux-nvme@lists.infradead.org | 8860 | L: linux-nvme@lists.infradead.org |
8856 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git | 8861 | T: git://git.infradead.org/nvme.git |
8857 | W: https://kernel.googlesource.com/pub/scm/linux/kernel/git/axboe/linux-block/ | 8862 | W: http://git.infradead.org/nvme.git |
8858 | S: Supported | 8863 | S: Supported |
8859 | F: drivers/nvme/host/ | 8864 | F: drivers/nvme/host/ |
8860 | F: include/linux/nvme.h | 8865 | F: include/linux/nvme.h |
8866 | F: include/uapi/linux/nvme_ioctl.h | ||
8861 | 8867 | ||
8862 | NVM EXPRESS TARGET DRIVER | 8868 | NVM EXPRESS TARGET DRIVER |
8863 | M: Christoph Hellwig <hch@lst.de> | 8869 | M: Christoph Hellwig <hch@lst.de> |
8864 | M: Sagi Grimberg <sagi@grimberg.me> | 8870 | M: Sagi Grimberg <sagi@grimberg.me> |
8865 | L: linux-nvme@lists.infradead.org | 8871 | L: linux-nvme@lists.infradead.org |
8872 | T: git://git.infradead.org/nvme.git | ||
8873 | W: http://git.infradead.org/nvme.git | ||
8866 | S: Supported | 8874 | S: Supported |
8867 | F: drivers/nvme/target/ | 8875 | F: drivers/nvme/target/ |
8868 | 8876 | ||
@@ -9842,7 +9850,7 @@ M: Mark Rutland <mark.rutland@arm.com> | |||
9842 | M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 9850 | M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> |
9843 | L: linux-arm-kernel@lists.infradead.org | 9851 | L: linux-arm-kernel@lists.infradead.org |
9844 | S: Maintained | 9852 | S: Maintained |
9845 | F: drivers/firmware/psci.c | 9853 | F: drivers/firmware/psci*.c |
9846 | F: include/linux/psci.h | 9854 | F: include/linux/psci.h |
9847 | F: include/uapi/linux/psci.h | 9855 | F: include/uapi/linux/psci.h |
9848 | 9856 | ||
@@ -13527,11 +13535,11 @@ F: arch/x86/xen/*swiotlb* | |||
13527 | F: drivers/xen/*swiotlb* | 13535 | F: drivers/xen/*swiotlb* |
13528 | 13536 | ||
13529 | XFS FILESYSTEM | 13537 | XFS FILESYSTEM |
13530 | M: Dave Chinner <david@fromorbit.com> | 13538 | M: Darrick J. Wong <darrick.wong@oracle.com> |
13531 | M: linux-xfs@vger.kernel.org | 13539 | M: linux-xfs@vger.kernel.org |
13532 | L: linux-xfs@vger.kernel.org | 13540 | L: linux-xfs@vger.kernel.org |
13533 | W: http://xfs.org/ | 13541 | W: http://xfs.org/ |
13534 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git | 13542 | T: git git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git |
13535 | S: Supported | 13543 | S: Supported |
13536 | F: Documentation/filesystems/xfs.txt | 13544 | F: Documentation/filesystems/xfs.txt |
13537 | F: fs/xfs/ | 13545 | F: fs/xfs/ |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 5fab553fd03a..186c4c214e0a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1502,8 +1502,7 @@ source kernel/Kconfig.preempt | |||
1502 | 1502 | ||
1503 | config HZ_FIXED | 1503 | config HZ_FIXED |
1504 | int | 1504 | int |
1505 | default 200 if ARCH_EBSA110 || ARCH_S3C24XX || \ | 1505 | default 200 if ARCH_EBSA110 |
1506 | ARCH_S5PV210 || ARCH_EXYNOS4 | ||
1507 | default 128 if SOC_AT91RM9200 | 1506 | default 128 if SOC_AT91RM9200 |
1508 | default 0 | 1507 | default 0 |
1509 | 1508 | ||
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index cccdbcb557b6..7327250f0bb6 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
@@ -501,6 +501,7 @@ dtb-$(CONFIG_ARCH_OMAP3) += \ | |||
501 | am3517-evm.dtb \ | 501 | am3517-evm.dtb \ |
502 | am3517_mt_ventoux.dtb \ | 502 | am3517_mt_ventoux.dtb \ |
503 | logicpd-torpedo-37xx-devkit.dtb \ | 503 | logicpd-torpedo-37xx-devkit.dtb \ |
504 | logicpd-som-lv-37xx-devkit.dtb \ | ||
504 | omap3430-sdp.dtb \ | 505 | omap3430-sdp.dtb \ |
505 | omap3-beagle.dtb \ | 506 | omap3-beagle.dtb \ |
506 | omap3-beagle-xm.dtb \ | 507 | omap3-beagle-xm.dtb \ |
diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi index dc561d505bbe..3e32dd18fd25 100644 --- a/arch/arm/boot/dts/am335x-bone-common.dtsi +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi | |||
@@ -6,8 +6,6 @@ | |||
6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <dt-bindings/mfd/tps65217.h> | ||
10 | |||
11 | / { | 9 | / { |
12 | cpus { | 10 | cpus { |
13 | cpu@0 { | 11 | cpu@0 { |
@@ -319,13 +317,13 @@ | |||
319 | ti,pmic-shutdown-controller; | 317 | ti,pmic-shutdown-controller; |
320 | 318 | ||
321 | charger { | 319 | charger { |
322 | interrupts = <TPS65217_IRQ_AC>, <TPS65217_IRQ_USB>; | 320 | interrupts = <0>, <1>; |
323 | interrupts-names = "AC", "USB"; | 321 | interrupt-names = "USB", "AC"; |
324 | status = "okay"; | 322 | status = "okay"; |
325 | }; | 323 | }; |
326 | 324 | ||
327 | pwrbutton { | 325 | pwrbutton { |
328 | interrupts = <TPS65217_IRQ_PB>; | 326 | interrupts = <2>; |
329 | status = "okay"; | 327 | status = "okay"; |
330 | }; | 328 | }; |
331 | 329 | ||
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi index 64c8aa9057a3..18d72a245e88 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi | |||
@@ -16,6 +16,7 @@ | |||
16 | interrupt-parent = <&intc>; | 16 | interrupt-parent = <&intc>; |
17 | #address-cells = <1>; | 17 | #address-cells = <1>; |
18 | #size-cells = <1>; | 18 | #size-cells = <1>; |
19 | chosen { }; | ||
19 | 20 | ||
20 | aliases { | 21 | aliases { |
21 | i2c0 = &i2c0; | 22 | i2c0 = &i2c0; |
diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi index ac55f93fc91e..2df9e6050c2f 100644 --- a/arch/arm/boot/dts/am4372.dtsi +++ b/arch/arm/boot/dts/am4372.dtsi | |||
@@ -16,6 +16,7 @@ | |||
16 | interrupt-parent = <&wakeupgen>; | 16 | interrupt-parent = <&wakeupgen>; |
17 | #address-cells = <1>; | 17 | #address-cells = <1>; |
18 | #size-cells = <1>; | 18 | #size-cells = <1>; |
19 | chosen { }; | ||
19 | 20 | ||
20 | memory@0 { | 21 | memory@0 { |
21 | device_type = "memory"; | 22 | device_type = "memory"; |
diff --git a/arch/arm/boot/dts/am571x-idk.dts b/arch/arm/boot/dts/am571x-idk.dts index d6e43e5184c1..ad68d1eb3bc3 100644 --- a/arch/arm/boot/dts/am571x-idk.dts +++ b/arch/arm/boot/dts/am571x-idk.dts | |||
@@ -62,11 +62,6 @@ | |||
62 | linux,default-trigger = "mmc0"; | 62 | linux,default-trigger = "mmc0"; |
63 | }; | 63 | }; |
64 | }; | 64 | }; |
65 | |||
66 | extcon_usb2: extcon_usb2 { | ||
67 | compatible = "linux,extcon-usb-gpio"; | ||
68 | id-gpio = <&gpio5 7 GPIO_ACTIVE_HIGH>; | ||
69 | }; | ||
70 | }; | 65 | }; |
71 | 66 | ||
72 | &mmc1 { | 67 | &mmc1 { |
@@ -79,3 +74,8 @@ | |||
79 | &omap_dwc3_2 { | 74 | &omap_dwc3_2 { |
80 | extcon = <&extcon_usb2>; | 75 | extcon = <&extcon_usb2>; |
81 | }; | 76 | }; |
77 | |||
78 | &extcon_usb2 { | ||
79 | id-gpio = <&gpio5 7 GPIO_ACTIVE_HIGH>; | ||
80 | vbus-gpio = <&gpio7 22 GPIO_ACTIVE_HIGH>; | ||
81 | }; | ||
diff --git a/arch/arm/boot/dts/am572x-idk.dts b/arch/arm/boot/dts/am572x-idk.dts index 27d9149cedba..8350b4b34b08 100644 --- a/arch/arm/boot/dts/am572x-idk.dts +++ b/arch/arm/boot/dts/am572x-idk.dts | |||
@@ -23,11 +23,6 @@ | |||
23 | reg = <0x0 0x80000000 0x0 0x80000000>; | 23 | reg = <0x0 0x80000000 0x0 0x80000000>; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | extcon_usb2: extcon_usb2 { | ||
27 | compatible = "linux,extcon-usb-gpio"; | ||
28 | id-gpio = <&gpio3 16 GPIO_ACTIVE_HIGH>; | ||
29 | }; | ||
30 | |||
31 | status-leds { | 26 | status-leds { |
32 | compatible = "gpio-leds"; | 27 | compatible = "gpio-leds"; |
33 | cpu0-led { | 28 | cpu0-led { |
@@ -76,6 +71,11 @@ | |||
76 | extcon = <&extcon_usb2>; | 71 | extcon = <&extcon_usb2>; |
77 | }; | 72 | }; |
78 | 73 | ||
74 | &extcon_usb2 { | ||
75 | id-gpio = <&gpio3 16 GPIO_ACTIVE_HIGH>; | ||
76 | vbus-gpio = <&gpio3 26 GPIO_ACTIVE_HIGH>; | ||
77 | }; | ||
78 | |||
79 | &mmc1 { | 79 | &mmc1 { |
80 | status = "okay"; | 80 | status = "okay"; |
81 | vmmc-supply = <&v3_3d>; | 81 | vmmc-supply = <&v3_3d>; |
@@ -87,3 +87,7 @@ | |||
87 | &sn65hvs882 { | 87 | &sn65hvs882 { |
88 | load-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>; | 88 | load-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>; |
89 | }; | 89 | }; |
90 | |||
91 | &pcie1 { | ||
92 | gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; | ||
93 | }; | ||
diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi b/arch/arm/boot/dts/am57xx-idk-common.dtsi index 555ae21f2b9a..814a720d5c3d 100644 --- a/arch/arm/boot/dts/am57xx-idk-common.dtsi +++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi | |||
@@ -303,6 +303,13 @@ | |||
303 | gpio-controller; | 303 | gpio-controller; |
304 | #gpio-cells = <2>; | 304 | #gpio-cells = <2>; |
305 | }; | 305 | }; |
306 | |||
307 | extcon_usb2: tps659038_usb { | ||
308 | compatible = "ti,palmas-usb-vid"; | ||
309 | ti,enable-vbus-detection; | ||
310 | ti,enable-id-detection; | ||
311 | /* ID & VBUS GPIOs provided in board dts */ | ||
312 | }; | ||
306 | }; | 313 | }; |
307 | }; | 314 | }; |
308 | 315 | ||
@@ -369,7 +376,7 @@ | |||
369 | }; | 376 | }; |
370 | 377 | ||
371 | &usb2 { | 378 | &usb2 { |
372 | dr_mode = "otg"; | 379 | dr_mode = "peripheral"; |
373 | }; | 380 | }; |
374 | 381 | ||
375 | &mmc2 { | 382 | &mmc2 { |
diff --git a/arch/arm/boot/dts/dm814x.dtsi b/arch/arm/boot/dts/dm814x.dtsi index 1facc5f12cef..81b8cecb5820 100644 --- a/arch/arm/boot/dts/dm814x.dtsi +++ b/arch/arm/boot/dts/dm814x.dtsi | |||
@@ -12,6 +12,7 @@ | |||
12 | interrupt-parent = <&intc>; | 12 | interrupt-parent = <&intc>; |
13 | #address-cells = <1>; | 13 | #address-cells = <1>; |
14 | #size-cells = <1>; | 14 | #size-cells = <1>; |
15 | chosen { }; | ||
15 | 16 | ||
16 | aliases { | 17 | aliases { |
17 | i2c0 = &i2c1; | 18 | i2c0 = &i2c1; |
diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi index 61dd2f6b02bc..6db652ae9bd5 100644 --- a/arch/arm/boot/dts/dm816x.dtsi +++ b/arch/arm/boot/dts/dm816x.dtsi | |||
@@ -12,6 +12,7 @@ | |||
12 | interrupt-parent = <&intc>; | 12 | interrupt-parent = <&intc>; |
13 | #address-cells = <1>; | 13 | #address-cells = <1>; |
14 | #size-cells = <1>; | 14 | #size-cells = <1>; |
15 | chosen { }; | ||
15 | 16 | ||
16 | aliases { | 17 | aliases { |
17 | i2c0 = &i2c1; | 18 | i2c0 = &i2c1; |
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi index addb7530cfbe..1faf24acd521 100644 --- a/arch/arm/boot/dts/dra7.dtsi +++ b/arch/arm/boot/dts/dra7.dtsi | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | compatible = "ti,dra7xx"; | 19 | compatible = "ti,dra7xx"; |
20 | interrupt-parent = <&crossbar_mpu>; | 20 | interrupt-parent = <&crossbar_mpu>; |
21 | chosen { }; | ||
21 | 22 | ||
22 | aliases { | 23 | aliases { |
23 | i2c0 = &i2c1; | 24 | i2c0 = &i2c1; |
diff --git a/arch/arm/boot/dts/dra72-evm-tps65917.dtsi b/arch/arm/boot/dts/dra72-evm-tps65917.dtsi index ee6dac44edf1..e6df676886c0 100644 --- a/arch/arm/boot/dts/dra72-evm-tps65917.dtsi +++ b/arch/arm/boot/dts/dra72-evm-tps65917.dtsi | |||
@@ -132,3 +132,19 @@ | |||
132 | ti,palmas-long-press-seconds = <6>; | 132 | ti,palmas-long-press-seconds = <6>; |
133 | }; | 133 | }; |
134 | }; | 134 | }; |
135 | |||
136 | &usb2_phy1 { | ||
137 | phy-supply = <&ldo4_reg>; | ||
138 | }; | ||
139 | |||
140 | &usb2_phy2 { | ||
141 | phy-supply = <&ldo4_reg>; | ||
142 | }; | ||
143 | |||
144 | &dss { | ||
145 | vdda_video-supply = <&ldo5_reg>; | ||
146 | }; | ||
147 | |||
148 | &mmc1 { | ||
149 | vmmc_aux-supply = <&ldo1_reg>; | ||
150 | }; | ||
diff --git a/arch/arm/boot/dts/imx31.dtsi b/arch/arm/boot/dts/imx31.dtsi index 685916e3d8a1..85cd8be22f71 100644 --- a/arch/arm/boot/dts/imx31.dtsi +++ b/arch/arm/boot/dts/imx31.dtsi | |||
@@ -31,11 +31,11 @@ | |||
31 | }; | 31 | }; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | avic: avic-interrupt-controller@60000000 { | 34 | avic: interrupt-controller@68000000 { |
35 | compatible = "fsl,imx31-avic", "fsl,avic"; | 35 | compatible = "fsl,imx31-avic", "fsl,avic"; |
36 | interrupt-controller; | 36 | interrupt-controller; |
37 | #interrupt-cells = <1>; | 37 | #interrupt-cells = <1>; |
38 | reg = <0x60000000 0x100000>; | 38 | reg = <0x68000000 0x100000>; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | soc { | 41 | soc { |
diff --git a/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi index e476d01959ea..26d060484728 100644 --- a/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi +++ b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi | |||
@@ -533,7 +533,6 @@ | |||
533 | MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17071 | 533 | MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17071 |
534 | MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17071 | 534 | MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17071 |
535 | MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17071 | 535 | MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17071 |
536 | MX6QDL_PAD_NANDF_CS2__GPIO6_IO15 0x000b0 | ||
537 | >; | 536 | >; |
538 | }; | 537 | }; |
539 | 538 | ||
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 53e6e63cbb02..89b834f3fa17 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi | |||
@@ -1100,6 +1100,7 @@ | |||
1100 | interrupts = <0 14 IRQ_TYPE_LEVEL_HIGH>; | 1100 | interrupts = <0 14 IRQ_TYPE_LEVEL_HIGH>; |
1101 | clocks = <&clks IMX6QDL_CLK_EIM_SLOW>; | 1101 | clocks = <&clks IMX6QDL_CLK_EIM_SLOW>; |
1102 | fsl,weim-cs-gpr = <&gpr>; | 1102 | fsl,weim-cs-gpr = <&gpr>; |
1103 | status = "disabled"; | ||
1103 | }; | 1104 | }; |
1104 | 1105 | ||
1105 | ocotp: ocotp@021bc000 { | 1106 | ocotp: ocotp@021bc000 { |
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi index 4fd6de29f07d..19cbd879c448 100644 --- a/arch/arm/boot/dts/imx6sl.dtsi +++ b/arch/arm/boot/dts/imx6sl.dtsi | |||
@@ -900,6 +900,7 @@ | |||
900 | reg = <0x021b8000 0x4000>; | 900 | reg = <0x021b8000 0x4000>; |
901 | interrupts = <0 14 IRQ_TYPE_LEVEL_HIGH>; | 901 | interrupts = <0 14 IRQ_TYPE_LEVEL_HIGH>; |
902 | fsl,weim-cs-gpr = <&gpr>; | 902 | fsl,weim-cs-gpr = <&gpr>; |
903 | status = "disabled"; | ||
903 | }; | 904 | }; |
904 | 905 | ||
905 | ocotp: ocotp@021bc000 { | 906 | ocotp: ocotp@021bc000 { |
diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi index 076a30f9bcae..10f333016197 100644 --- a/arch/arm/boot/dts/imx6sx.dtsi +++ b/arch/arm/boot/dts/imx6sx.dtsi | |||
@@ -977,6 +977,7 @@ | |||
977 | interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; | 977 | interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; |
978 | clocks = <&clks IMX6SX_CLK_EIM_SLOW>; | 978 | clocks = <&clks IMX6SX_CLK_EIM_SLOW>; |
979 | fsl,weim-cs-gpr = <&gpr>; | 979 | fsl,weim-cs-gpr = <&gpr>; |
980 | status = "disabled"; | ||
980 | }; | 981 | }; |
981 | 982 | ||
982 | ocotp: ocotp@021bc000 { | 983 | ocotp: ocotp@021bc000 { |
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index 4f793a025a72..f1d6de8b3c19 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi | |||
@@ -17,6 +17,7 @@ | |||
17 | interrupt-parent = <&intc>; | 17 | interrupt-parent = <&intc>; |
18 | #address-cells = <1>; | 18 | #address-cells = <1>; |
19 | #size-cells = <1>; | 19 | #size-cells = <1>; |
20 | chosen { }; | ||
20 | 21 | ||
21 | aliases { | 22 | aliases { |
22 | serial0 = &uart1; | 23 | serial0 = &uart1; |
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts index 87ca50b53002..4d448f145ed1 100644 --- a/arch/arm/boot/dts/omap3-n900.dts +++ b/arch/arm/boot/dts/omap3-n900.dts | |||
@@ -734,6 +734,8 @@ | |||
734 | vmmc_aux-supply = <&vsim>; | 734 | vmmc_aux-supply = <&vsim>; |
735 | bus-width = <8>; | 735 | bus-width = <8>; |
736 | non-removable; | 736 | non-removable; |
737 | no-sdio; | ||
738 | no-sd; | ||
737 | }; | 739 | }; |
738 | 740 | ||
739 | &mmc3 { | 741 | &mmc3 { |
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index ecf5eb584c75..a3ff4933dbc1 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi | |||
@@ -17,6 +17,7 @@ | |||
17 | interrupt-parent = <&intc>; | 17 | interrupt-parent = <&intc>; |
18 | #address-cells = <1>; | 18 | #address-cells = <1>; |
19 | #size-cells = <1>; | 19 | #size-cells = <1>; |
20 | chosen { }; | ||
20 | 21 | ||
21 | aliases { | 22 | aliases { |
22 | i2c0 = &i2c1; | 23 | i2c0 = &i2c1; |
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index 8087456b5fbe..578c53f08309 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi | |||
@@ -15,6 +15,7 @@ | |||
15 | interrupt-parent = <&wakeupgen>; | 15 | interrupt-parent = <&wakeupgen>; |
16 | #address-cells = <1>; | 16 | #address-cells = <1>; |
17 | #size-cells = <1>; | 17 | #size-cells = <1>; |
18 | chosen { }; | ||
18 | 19 | ||
19 | aliases { | 20 | aliases { |
20 | i2c0 = &i2c1; | 21 | i2c0 = &i2c1; |
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi index 968c67a49dbd..7cd92babc41a 100644 --- a/arch/arm/boot/dts/omap5.dtsi +++ b/arch/arm/boot/dts/omap5.dtsi | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | compatible = "ti,omap5"; | 18 | compatible = "ti,omap5"; |
19 | interrupt-parent = <&wakeupgen>; | 19 | interrupt-parent = <&wakeupgen>; |
20 | chosen { }; | ||
20 | 21 | ||
21 | aliases { | 22 | aliases { |
22 | i2c0 = &i2c1; | 23 | i2c0 = &i2c1; |
diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi index 268bd470c865..407a4610f4a7 100644 --- a/arch/arm/boot/dts/qcom-apq8064.dtsi +++ b/arch/arm/boot/dts/qcom-apq8064.dtsi | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <dt-bindings/clock/qcom,gcc-msm8960.h> | 4 | #include <dt-bindings/clock/qcom,gcc-msm8960.h> |
5 | #include <dt-bindings/reset/qcom,gcc-msm8960.h> | 5 | #include <dt-bindings/reset/qcom,gcc-msm8960.h> |
6 | #include <dt-bindings/clock/qcom,mmcc-msm8960.h> | 6 | #include <dt-bindings/clock/qcom,mmcc-msm8960.h> |
7 | #include <dt-bindings/clock/qcom,rpmcc.h> | ||
7 | #include <dt-bindings/soc/qcom,gsbi.h> | 8 | #include <dt-bindings/soc/qcom,gsbi.h> |
8 | #include <dt-bindings/interrupt-controller/irq.h> | 9 | #include <dt-bindings/interrupt-controller/irq.h> |
9 | #include <dt-bindings/interrupt-controller/arm-gic.h> | 10 | #include <dt-bindings/interrupt-controller/arm-gic.h> |
@@ -303,6 +304,9 @@ | |||
303 | firmware { | 304 | firmware { |
304 | scm { | 305 | scm { |
305 | compatible = "qcom,scm-apq8064"; | 306 | compatible = "qcom,scm-apq8064"; |
307 | |||
308 | clocks = <&rpmcc RPM_DAYTONA_FABRIC_CLK>; | ||
309 | clock-names = "core"; | ||
306 | }; | 310 | }; |
307 | }; | 311 | }; |
308 | 312 | ||
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts b/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts index 102838fcc588..15f4fd3f4695 100644 --- a/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts +++ b/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts | |||
@@ -81,7 +81,7 @@ | |||
81 | #address-cells = <0>; | 81 | #address-cells = <0>; |
82 | interrupt-controller; | 82 | interrupt-controller; |
83 | reg = <0 0x2c001000 0 0x1000>, | 83 | reg = <0 0x2c001000 0 0x1000>, |
84 | <0 0x2c002000 0 0x1000>, | 84 | <0 0x2c002000 0 0x2000>, |
85 | <0 0x2c004000 0 0x2000>, | 85 | <0 0x2c004000 0 0x2000>, |
86 | <0 0x2c006000 0 0x2000>; | 86 | <0 0x2c006000 0 0x2000>; |
87 | interrupts = <1 9 0xf04>; | 87 | interrupts = <1 9 0xf04>; |
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts b/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts index 45d08cc37b01..bd107c5a0226 100644 --- a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts +++ b/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts | |||
@@ -131,7 +131,7 @@ | |||
131 | #address-cells = <0>; | 131 | #address-cells = <0>; |
132 | interrupt-controller; | 132 | interrupt-controller; |
133 | reg = <0 0x2c001000 0 0x1000>, | 133 | reg = <0 0x2c001000 0 0x1000>, |
134 | <0 0x2c002000 0 0x1000>, | 134 | <0 0x2c002000 0 0x2000>, |
135 | <0 0x2c004000 0 0x2000>, | 135 | <0 0x2c004000 0 0x2000>, |
136 | <0 0x2c006000 0 0x2000>; | 136 | <0 0x2c006000 0 0x2000>; |
137 | interrupts = <1 9 0xf04>; | 137 | interrupts = <1 9 0xf04>; |
diff --git a/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts b/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts index 7ea617e47fe4..958b4c42d320 100644 --- a/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts +++ b/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts | |||
@@ -153,7 +153,8 @@ | |||
153 | switch0phy1: switch1phy0@1 { | 153 | switch0phy1: switch1phy0@1 { |
154 | reg = <1>; | 154 | reg = <1>; |
155 | interrupt-parent = <&switch0>; | 155 | interrupt-parent = <&switch0>; |
156 | interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; }; | 156 | interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; |
157 | }; | ||
157 | switch0phy2: switch1phy0@2 { | 158 | switch0phy2: switch1phy0@2 { |
158 | reg = <2>; | 159 | reg = <2>; |
159 | interrupt-parent = <&switch0>; | 160 | interrupt-parent = <&switch0>; |
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c index df42c93a93d6..f5dce9b4e617 100644 --- a/arch/arm/mach-davinci/clock.c +++ b/arch/arm/mach-davinci/clock.c | |||
@@ -31,10 +31,10 @@ static LIST_HEAD(clocks); | |||
31 | static DEFINE_MUTEX(clocks_mutex); | 31 | static DEFINE_MUTEX(clocks_mutex); |
32 | static DEFINE_SPINLOCK(clockfw_lock); | 32 | static DEFINE_SPINLOCK(clockfw_lock); |
33 | 33 | ||
34 | static void __clk_enable(struct clk *clk) | 34 | void davinci_clk_enable(struct clk *clk) |
35 | { | 35 | { |
36 | if (clk->parent) | 36 | if (clk->parent) |
37 | __clk_enable(clk->parent); | 37 | davinci_clk_enable(clk->parent); |
38 | if (clk->usecount++ == 0) { | 38 | if (clk->usecount++ == 0) { |
39 | if (clk->flags & CLK_PSC) | 39 | if (clk->flags & CLK_PSC) |
40 | davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, | 40 | davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, |
@@ -44,7 +44,7 @@ static void __clk_enable(struct clk *clk) | |||
44 | } | 44 | } |
45 | } | 45 | } |
46 | 46 | ||
47 | static void __clk_disable(struct clk *clk) | 47 | void davinci_clk_disable(struct clk *clk) |
48 | { | 48 | { |
49 | if (WARN_ON(clk->usecount == 0)) | 49 | if (WARN_ON(clk->usecount == 0)) |
50 | return; | 50 | return; |
@@ -56,7 +56,7 @@ static void __clk_disable(struct clk *clk) | |||
56 | clk->clk_disable(clk); | 56 | clk->clk_disable(clk); |
57 | } | 57 | } |
58 | if (clk->parent) | 58 | if (clk->parent) |
59 | __clk_disable(clk->parent); | 59 | davinci_clk_disable(clk->parent); |
60 | } | 60 | } |
61 | 61 | ||
62 | int davinci_clk_reset(struct clk *clk, bool reset) | 62 | int davinci_clk_reset(struct clk *clk, bool reset) |
@@ -103,7 +103,7 @@ int clk_enable(struct clk *clk) | |||
103 | return -EINVAL; | 103 | return -EINVAL; |
104 | 104 | ||
105 | spin_lock_irqsave(&clockfw_lock, flags); | 105 | spin_lock_irqsave(&clockfw_lock, flags); |
106 | __clk_enable(clk); | 106 | davinci_clk_enable(clk); |
107 | spin_unlock_irqrestore(&clockfw_lock, flags); | 107 | spin_unlock_irqrestore(&clockfw_lock, flags); |
108 | 108 | ||
109 | return 0; | 109 | return 0; |
@@ -118,7 +118,7 @@ void clk_disable(struct clk *clk) | |||
118 | return; | 118 | return; |
119 | 119 | ||
120 | spin_lock_irqsave(&clockfw_lock, flags); | 120 | spin_lock_irqsave(&clockfw_lock, flags); |
121 | __clk_disable(clk); | 121 | davinci_clk_disable(clk); |
122 | spin_unlock_irqrestore(&clockfw_lock, flags); | 122 | spin_unlock_irqrestore(&clockfw_lock, flags); |
123 | } | 123 | } |
124 | EXPORT_SYMBOL(clk_disable); | 124 | EXPORT_SYMBOL(clk_disable); |
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h index e2a5437a1aee..fa2b83752e03 100644 --- a/arch/arm/mach-davinci/clock.h +++ b/arch/arm/mach-davinci/clock.h | |||
@@ -132,6 +132,8 @@ int davinci_set_sysclk_rate(struct clk *clk, unsigned long rate); | |||
132 | int davinci_set_refclk_rate(unsigned long rate); | 132 | int davinci_set_refclk_rate(unsigned long rate); |
133 | int davinci_simple_set_rate(struct clk *clk, unsigned long rate); | 133 | int davinci_simple_set_rate(struct clk *clk, unsigned long rate); |
134 | int davinci_clk_reset(struct clk *clk, bool reset); | 134 | int davinci_clk_reset(struct clk *clk, bool reset); |
135 | void davinci_clk_enable(struct clk *clk); | ||
136 | void davinci_clk_disable(struct clk *clk); | ||
135 | 137 | ||
136 | extern struct platform_device davinci_wdt_device; | 138 | extern struct platform_device davinci_wdt_device; |
137 | extern void davinci_watchdog_reset(struct platform_device *); | 139 | extern void davinci_watchdog_reset(struct platform_device *); |
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index e770c97ea45c..1d873d15b545 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c | |||
@@ -319,6 +319,16 @@ static struct clk emac_clk = { | |||
319 | .gpsc = 1, | 319 | .gpsc = 1, |
320 | }; | 320 | }; |
321 | 321 | ||
322 | /* | ||
323 | * In order to avoid adding the emac_clk to the clock lookup table twice (and | ||
324 | * screwing up the linked list in the process) create a separate clock for | ||
325 | * mdio inheriting the rate from emac_clk. | ||
326 | */ | ||
327 | static struct clk mdio_clk = { | ||
328 | .name = "mdio", | ||
329 | .parent = &emac_clk, | ||
330 | }; | ||
331 | |||
322 | static struct clk mcasp_clk = { | 332 | static struct clk mcasp_clk = { |
323 | .name = "mcasp", | 333 | .name = "mcasp", |
324 | .parent = &async3_clk, | 334 | .parent = &async3_clk, |
@@ -367,6 +377,16 @@ static struct clk aemif_clk = { | |||
367 | .flags = ALWAYS_ENABLED, | 377 | .flags = ALWAYS_ENABLED, |
368 | }; | 378 | }; |
369 | 379 | ||
380 | /* | ||
381 | * In order to avoid adding the aemif_clk to the clock lookup table twice (and | ||
382 | * screwing up the linked list in the process) create a separate clock for | ||
383 | * nand inheriting the rate from aemif_clk. | ||
384 | */ | ||
385 | static struct clk aemif_nand_clk = { | ||
386 | .name = "nand", | ||
387 | .parent = &aemif_clk, | ||
388 | }; | ||
389 | |||
370 | static struct clk usb11_clk = { | 390 | static struct clk usb11_clk = { |
371 | .name = "usb11", | 391 | .name = "usb11", |
372 | .parent = &pll0_sysclk4, | 392 | .parent = &pll0_sysclk4, |
@@ -529,7 +549,7 @@ static struct clk_lookup da850_clks[] = { | |||
529 | CLK(NULL, "arm", &arm_clk), | 549 | CLK(NULL, "arm", &arm_clk), |
530 | CLK(NULL, "rmii", &rmii_clk), | 550 | CLK(NULL, "rmii", &rmii_clk), |
531 | CLK("davinci_emac.1", NULL, &emac_clk), | 551 | CLK("davinci_emac.1", NULL, &emac_clk), |
532 | CLK("davinci_mdio.0", "fck", &emac_clk), | 552 | CLK("davinci_mdio.0", "fck", &mdio_clk), |
533 | CLK("davinci-mcasp.0", NULL, &mcasp_clk), | 553 | CLK("davinci-mcasp.0", NULL, &mcasp_clk), |
534 | CLK("davinci-mcbsp.0", NULL, &mcbsp0_clk), | 554 | CLK("davinci-mcbsp.0", NULL, &mcbsp0_clk), |
535 | CLK("davinci-mcbsp.1", NULL, &mcbsp1_clk), | 555 | CLK("davinci-mcbsp.1", NULL, &mcbsp1_clk), |
@@ -537,7 +557,15 @@ static struct clk_lookup da850_clks[] = { | |||
537 | CLK("da830-mmc.0", NULL, &mmcsd0_clk), | 557 | CLK("da830-mmc.0", NULL, &mmcsd0_clk), |
538 | CLK("da830-mmc.1", NULL, &mmcsd1_clk), | 558 | CLK("da830-mmc.1", NULL, &mmcsd1_clk), |
539 | CLK("ti-aemif", NULL, &aemif_clk), | 559 | CLK("ti-aemif", NULL, &aemif_clk), |
540 | CLK(NULL, "aemif", &aemif_clk), | 560 | /* |
561 | * The only user of this clock is davinci_nand and it get's it through | ||
562 | * con_id. The nand node itself is created from within the aemif | ||
563 | * driver to guarantee that it's probed after the aemif timing | ||
564 | * parameters are configured. of_dev_auxdata is not accessible from | ||
565 | * the aemif driver and can't be passed to of_platform_populate(). For | ||
566 | * that reason we're leaving the dev_id here as NULL. | ||
567 | */ | ||
568 | CLK(NULL, "aemif", &aemif_nand_clk), | ||
541 | CLK("ohci-da8xx", "usb11", &usb11_clk), | 569 | CLK("ohci-da8xx", "usb11", &usb11_clk), |
542 | CLK("musb-da8xx", "usb20", &usb20_clk), | 570 | CLK("musb-da8xx", "usb20", &usb20_clk), |
543 | CLK("spi_davinci.0", NULL, &spi0_clk), | 571 | CLK("spi_davinci.0", NULL, &spi0_clk), |
diff --git a/arch/arm/mach-davinci/usb-da8xx.c b/arch/arm/mach-davinci/usb-da8xx.c index c6feecf7ae24..9a6af0bd5dc3 100644 --- a/arch/arm/mach-davinci/usb-da8xx.c +++ b/arch/arm/mach-davinci/usb-da8xx.c | |||
@@ -22,6 +22,8 @@ | |||
22 | #define DA8XX_USB0_BASE 0x01e00000 | 22 | #define DA8XX_USB0_BASE 0x01e00000 |
23 | #define DA8XX_USB1_BASE 0x01e25000 | 23 | #define DA8XX_USB1_BASE 0x01e25000 |
24 | 24 | ||
25 | static struct clk *usb20_clk; | ||
26 | |||
25 | static struct platform_device da8xx_usb_phy = { | 27 | static struct platform_device da8xx_usb_phy = { |
26 | .name = "da8xx-usb-phy", | 28 | .name = "da8xx-usb-phy", |
27 | .id = -1, | 29 | .id = -1, |
@@ -158,26 +160,13 @@ int __init da8xx_register_usb_refclkin(int rate) | |||
158 | 160 | ||
159 | static void usb20_phy_clk_enable(struct clk *clk) | 161 | static void usb20_phy_clk_enable(struct clk *clk) |
160 | { | 162 | { |
161 | struct clk *usb20_clk; | ||
162 | int err; | ||
163 | u32 val; | 163 | u32 val; |
164 | u32 timeout = 500000; /* 500 msec */ | 164 | u32 timeout = 500000; /* 500 msec */ |
165 | 165 | ||
166 | val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG)); | 166 | val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG)); |
167 | 167 | ||
168 | usb20_clk = clk_get(&da8xx_usb20_dev.dev, "usb20"); | ||
169 | if (IS_ERR(usb20_clk)) { | ||
170 | pr_err("could not get usb20 clk: %ld\n", PTR_ERR(usb20_clk)); | ||
171 | return; | ||
172 | } | ||
173 | |||
174 | /* The USB 2.O PLL requires that the USB 2.O PSC is enabled as well. */ | 168 | /* The USB 2.O PLL requires that the USB 2.O PSC is enabled as well. */ |
175 | err = clk_prepare_enable(usb20_clk); | 169 | davinci_clk_enable(usb20_clk); |
176 | if (err) { | ||
177 | pr_err("failed to enable usb20 clk: %d\n", err); | ||
178 | clk_put(usb20_clk); | ||
179 | return; | ||
180 | } | ||
181 | 170 | ||
182 | /* | 171 | /* |
183 | * Turn on the USB 2.0 PHY, but just the PLL, and not OTG. The USB 1.1 | 172 | * Turn on the USB 2.0 PHY, but just the PLL, and not OTG. The USB 1.1 |
@@ -197,8 +186,7 @@ static void usb20_phy_clk_enable(struct clk *clk) | |||
197 | 186 | ||
198 | pr_err("Timeout waiting for USB 2.0 PHY clock good\n"); | 187 | pr_err("Timeout waiting for USB 2.0 PHY clock good\n"); |
199 | done: | 188 | done: |
200 | clk_disable_unprepare(usb20_clk); | 189 | davinci_clk_disable(usb20_clk); |
201 | clk_put(usb20_clk); | ||
202 | } | 190 | } |
203 | 191 | ||
204 | static void usb20_phy_clk_disable(struct clk *clk) | 192 | static void usb20_phy_clk_disable(struct clk *clk) |
@@ -285,11 +273,19 @@ static struct clk_lookup usb20_phy_clk_lookup = | |||
285 | int __init da8xx_register_usb20_phy_clk(bool use_usb_refclkin) | 273 | int __init da8xx_register_usb20_phy_clk(bool use_usb_refclkin) |
286 | { | 274 | { |
287 | struct clk *parent; | 275 | struct clk *parent; |
288 | int ret = 0; | 276 | int ret; |
277 | |||
278 | usb20_clk = clk_get(&da8xx_usb20_dev.dev, "usb20"); | ||
279 | ret = PTR_ERR_OR_ZERO(usb20_clk); | ||
280 | if (ret) | ||
281 | return ret; | ||
289 | 282 | ||
290 | parent = clk_get(NULL, use_usb_refclkin ? "usb_refclkin" : "pll0_aux"); | 283 | parent = clk_get(NULL, use_usb_refclkin ? "usb_refclkin" : "pll0_aux"); |
291 | if (IS_ERR(parent)) | 284 | ret = PTR_ERR_OR_ZERO(parent); |
292 | return PTR_ERR(parent); | 285 | if (ret) { |
286 | clk_put(usb20_clk); | ||
287 | return ret; | ||
288 | } | ||
293 | 289 | ||
294 | usb20_phy_clk.parent = parent; | 290 | usb20_phy_clk.parent = parent; |
295 | ret = clk_register(&usb20_phy_clk); | 291 | ret = clk_register(&usb20_phy_clk); |
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 98ffe1e62ad5..a5d68411a037 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c | |||
@@ -385,36 +385,6 @@ fail: | |||
385 | return pen_release != -1 ? ret : 0; | 385 | return pen_release != -1 ? ret : 0; |
386 | } | 386 | } |
387 | 387 | ||
388 | /* | ||
389 | * Initialise the CPU possible map early - this describes the CPUs | ||
390 | * which may be present or become present in the system. | ||
391 | */ | ||
392 | |||
393 | static void __init exynos_smp_init_cpus(void) | ||
394 | { | ||
395 | void __iomem *scu_base = scu_base_addr(); | ||
396 | unsigned int i, ncores; | ||
397 | |||
398 | if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) | ||
399 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; | ||
400 | else | ||
401 | /* | ||
402 | * CPU Nodes are passed thru DT and set_cpu_possible | ||
403 | * is set by "arm_dt_init_cpu_maps". | ||
404 | */ | ||
405 | return; | ||
406 | |||
407 | /* sanity check */ | ||
408 | if (ncores > nr_cpu_ids) { | ||
409 | pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", | ||
410 | ncores, nr_cpu_ids); | ||
411 | ncores = nr_cpu_ids; | ||
412 | } | ||
413 | |||
414 | for (i = 0; i < ncores; i++) | ||
415 | set_cpu_possible(i, true); | ||
416 | } | ||
417 | |||
418 | static void __init exynos_smp_prepare_cpus(unsigned int max_cpus) | 388 | static void __init exynos_smp_prepare_cpus(unsigned int max_cpus) |
419 | { | 389 | { |
420 | int i; | 390 | int i; |
@@ -479,7 +449,6 @@ static void exynos_cpu_die(unsigned int cpu) | |||
479 | #endif /* CONFIG_HOTPLUG_CPU */ | 449 | #endif /* CONFIG_HOTPLUG_CPU */ |
480 | 450 | ||
481 | const struct smp_operations exynos_smp_ops __initconst = { | 451 | const struct smp_operations exynos_smp_ops __initconst = { |
482 | .smp_init_cpus = exynos_smp_init_cpus, | ||
483 | .smp_prepare_cpus = exynos_smp_prepare_cpus, | 452 | .smp_prepare_cpus = exynos_smp_prepare_cpus, |
484 | .smp_secondary_init = exynos_secondary_init, | 453 | .smp_secondary_init = exynos_secondary_init, |
485 | .smp_boot_secondary = exynos_boot_secondary, | 454 | .smp_boot_secondary = exynos_boot_secondary, |
diff --git a/arch/arm/mach-imx/mach-imx1.c b/arch/arm/mach-imx/mach-imx1.c index de5ab8d88549..3a8406e45b65 100644 --- a/arch/arm/mach-imx/mach-imx1.c +++ b/arch/arm/mach-imx/mach-imx1.c | |||
@@ -37,7 +37,6 @@ static const char * const imx1_dt_board_compat[] __initconst = { | |||
37 | }; | 37 | }; |
38 | 38 | ||
39 | DT_MACHINE_START(IMX1_DT, "Freescale i.MX1 (Device Tree Support)") | 39 | DT_MACHINE_START(IMX1_DT, "Freescale i.MX1 (Device Tree Support)") |
40 | .map_io = debug_ll_io_init, | ||
41 | .init_early = imx1_init_early, | 40 | .init_early = imx1_init_early, |
42 | .init_irq = imx1_init_irq, | 41 | .init_irq = imx1_init_irq, |
43 | .dt_compat = imx1_dt_board_compat, | 42 | .dt_compat = imx1_dt_board_compat, |
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 469894082fea..093458b62c8d 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -7,7 +7,7 @@ ccflags-y := -I$(srctree)/$(src)/include \ | |||
7 | 7 | ||
8 | # Common support | 8 | # Common support |
9 | obj-y := id.o io.o control.o devices.o fb.o timer.o pm.o \ | 9 | obj-y := id.o io.o control.o devices.o fb.o timer.o pm.o \ |
10 | common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \ | 10 | common.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \ |
11 | omap_device.o omap-headsmp.o sram.o drm.o | 11 | omap_device.o omap-headsmp.o sram.o drm.o |
12 | 12 | ||
13 | hwmod-common = omap_hwmod.o omap_hwmod_reset.o \ | 13 | hwmod-common = omap_hwmod.o omap_hwmod_reset.o \ |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 36d9943205ca..dc9e34e670a2 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -304,7 +304,7 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)") | |||
304 | .init_late = am43xx_init_late, | 304 | .init_late = am43xx_init_late, |
305 | .init_irq = omap_gic_of_init, | 305 | .init_irq = omap_gic_of_init, |
306 | .init_machine = omap_generic_init, | 306 | .init_machine = omap_generic_init, |
307 | .init_time = omap4_local_timer_init, | 307 | .init_time = omap3_gptimer_timer_init, |
308 | .dt_compat = am43_boards_compat, | 308 | .dt_compat = am43_boards_compat, |
309 | .restart = omap44xx_restart, | 309 | .restart = omap44xx_restart, |
310 | MACHINE_END | 310 | MACHINE_END |
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c deleted file mode 100644 index 7a577145b68b..000000000000 --- a/arch/arm/mach-omap2/gpio.c +++ /dev/null | |||
@@ -1,160 +0,0 @@ | |||
1 | /* | ||
2 | * OMAP2+ specific gpio initialization | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ | ||
5 | * | ||
6 | * Author: | ||
7 | * Charulatha V <charu@ti.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License as | ||
11 | * published by the Free Software Foundation version 2. | ||
12 | * | ||
13 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
14 | * kind, whether express or implied; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | */ | ||
18 | |||
19 | #include <linux/gpio.h> | ||
20 | #include <linux/err.h> | ||
21 | #include <linux/slab.h> | ||
22 | #include <linux/interrupt.h> | ||
23 | #include <linux/of.h> | ||
24 | #include <linux/platform_data/gpio-omap.h> | ||
25 | |||
26 | #include "soc.h" | ||
27 | #include "omap_hwmod.h" | ||
28 | #include "omap_device.h" | ||
29 | #include "omap-pm.h" | ||
30 | |||
31 | #include "powerdomain.h" | ||
32 | |||
33 | static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) | ||
34 | { | ||
35 | struct platform_device *pdev; | ||
36 | struct omap_gpio_platform_data *pdata; | ||
37 | struct omap_gpio_dev_attr *dev_attr; | ||
38 | char *name = "omap_gpio"; | ||
39 | int id; | ||
40 | struct powerdomain *pwrdm; | ||
41 | |||
42 | /* | ||
43 | * extract the device id from name field available in the | ||
44 | * hwmod database and use the same for constructing ids for | ||
45 | * gpio devices. | ||
46 | * CAUTION: Make sure the name in the hwmod database does | ||
47 | * not change. If changed, make corresponding change here | ||
48 | * or make use of static variable mechanism to handle this. | ||
49 | */ | ||
50 | sscanf(oh->name, "gpio%d", &id); | ||
51 | |||
52 | pdata = kzalloc(sizeof(struct omap_gpio_platform_data), GFP_KERNEL); | ||
53 | if (!pdata) { | ||
54 | pr_err("gpio%d: Memory allocation failed\n", id); | ||
55 | return -ENOMEM; | ||
56 | } | ||
57 | |||
58 | dev_attr = (struct omap_gpio_dev_attr *)oh->dev_attr; | ||
59 | pdata->bank_width = dev_attr->bank_width; | ||
60 | pdata->dbck_flag = dev_attr->dbck_flag; | ||
61 | pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count; | ||
62 | pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL); | ||
63 | if (!pdata->regs) { | ||
64 | pr_err("gpio%d: Memory allocation failed\n", id); | ||
65 | kfree(pdata); | ||
66 | return -ENOMEM; | ||
67 | } | ||
68 | |||
69 | switch (oh->class->rev) { | ||
70 | case 0: | ||
71 | if (id == 1) | ||
72 | /* non-wakeup GPIO pins for OMAP2 Bank1 */ | ||
73 | pdata->non_wakeup_gpios = 0xe203ffc0; | ||
74 | else if (id == 2) | ||
75 | /* non-wakeup GPIO pins for OMAP2 Bank2 */ | ||
76 | pdata->non_wakeup_gpios = 0x08700040; | ||
77 | /* fall through */ | ||
78 | |||
79 | case 1: | ||
80 | pdata->regs->revision = OMAP24XX_GPIO_REVISION; | ||
81 | pdata->regs->direction = OMAP24XX_GPIO_OE; | ||
82 | pdata->regs->datain = OMAP24XX_GPIO_DATAIN; | ||
83 | pdata->regs->dataout = OMAP24XX_GPIO_DATAOUT; | ||
84 | pdata->regs->set_dataout = OMAP24XX_GPIO_SETDATAOUT; | ||
85 | pdata->regs->clr_dataout = OMAP24XX_GPIO_CLEARDATAOUT; | ||
86 | pdata->regs->irqstatus = OMAP24XX_GPIO_IRQSTATUS1; | ||
87 | pdata->regs->irqstatus2 = OMAP24XX_GPIO_IRQSTATUS2; | ||
88 | pdata->regs->irqenable = OMAP24XX_GPIO_IRQENABLE1; | ||
89 | pdata->regs->irqenable2 = OMAP24XX_GPIO_IRQENABLE2; | ||
90 | pdata->regs->set_irqenable = OMAP24XX_GPIO_SETIRQENABLE1; | ||
91 | pdata->regs->clr_irqenable = OMAP24XX_GPIO_CLEARIRQENABLE1; | ||
92 | pdata->regs->debounce = OMAP24XX_GPIO_DEBOUNCE_VAL; | ||
93 | pdata->regs->debounce_en = OMAP24XX_GPIO_DEBOUNCE_EN; | ||
94 | pdata->regs->ctrl = OMAP24XX_GPIO_CTRL; | ||
95 | pdata->regs->wkup_en = OMAP24XX_GPIO_WAKE_EN; | ||
96 | pdata->regs->leveldetect0 = OMAP24XX_GPIO_LEVELDETECT0; | ||
97 | pdata->regs->leveldetect1 = OMAP24XX_GPIO_LEVELDETECT1; | ||
98 | pdata->regs->risingdetect = OMAP24XX_GPIO_RISINGDETECT; | ||
99 | pdata->regs->fallingdetect = OMAP24XX_GPIO_FALLINGDETECT; | ||
100 | break; | ||
101 | case 2: | ||
102 | pdata->regs->revision = OMAP4_GPIO_REVISION; | ||
103 | pdata->regs->direction = OMAP4_GPIO_OE; | ||
104 | pdata->regs->datain = OMAP4_GPIO_DATAIN; | ||
105 | pdata->regs->dataout = OMAP4_GPIO_DATAOUT; | ||
106 | pdata->regs->set_dataout = OMAP4_GPIO_SETDATAOUT; | ||
107 | pdata->regs->clr_dataout = OMAP4_GPIO_CLEARDATAOUT; | ||
108 | pdata->regs->irqstatus_raw0 = OMAP4_GPIO_IRQSTATUSRAW0; | ||
109 | pdata->regs->irqstatus_raw1 = OMAP4_GPIO_IRQSTATUSRAW1; | ||
110 | pdata->regs->irqstatus = OMAP4_GPIO_IRQSTATUS0; | ||
111 | pdata->regs->irqstatus2 = OMAP4_GPIO_IRQSTATUS1; | ||
112 | pdata->regs->irqenable = OMAP4_GPIO_IRQSTATUSSET0; | ||
113 | pdata->regs->irqenable2 = OMAP4_GPIO_IRQSTATUSSET1; | ||
114 | pdata->regs->set_irqenable = OMAP4_GPIO_IRQSTATUSSET0; | ||
115 | pdata->regs->clr_irqenable = OMAP4_GPIO_IRQSTATUSCLR0; | ||
116 | pdata->regs->debounce = OMAP4_GPIO_DEBOUNCINGTIME; | ||
117 | pdata->regs->debounce_en = OMAP4_GPIO_DEBOUNCENABLE; | ||
118 | pdata->regs->ctrl = OMAP4_GPIO_CTRL; | ||
119 | pdata->regs->wkup_en = OMAP4_GPIO_IRQWAKEN0; | ||
120 | pdata->regs->leveldetect0 = OMAP4_GPIO_LEVELDETECT0; | ||
121 | pdata->regs->leveldetect1 = OMAP4_GPIO_LEVELDETECT1; | ||
122 | pdata->regs->risingdetect = OMAP4_GPIO_RISINGDETECT; | ||
123 | pdata->regs->fallingdetect = OMAP4_GPIO_FALLINGDETECT; | ||
124 | break; | ||
125 | default: | ||
126 | WARN(1, "Invalid gpio bank_type\n"); | ||
127 | kfree(pdata->regs); | ||
128 | kfree(pdata); | ||
129 | return -EINVAL; | ||
130 | } | ||
131 | |||
132 | pwrdm = omap_hwmod_get_pwrdm(oh); | ||
133 | pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm); | ||
134 | |||
135 | pdev = omap_device_build(name, id - 1, oh, pdata, sizeof(*pdata)); | ||
136 | kfree(pdata); | ||
137 | |||
138 | if (IS_ERR(pdev)) { | ||
139 | WARN(1, "Can't build omap_device for %s:%s.\n", | ||
140 | name, oh->name); | ||
141 | return PTR_ERR(pdev); | ||
142 | } | ||
143 | |||
144 | return 0; | ||
145 | } | ||
146 | |||
147 | /* | ||
148 | * gpio_init needs to be done before | ||
149 | * machine_init functions access gpio APIs. | ||
150 | * Hence gpio_init is a omap_postcore_initcall. | ||
151 | */ | ||
152 | static int __init omap2_gpio_init(void) | ||
153 | { | ||
154 | /* If dtb is there, the devices will be created dynamically */ | ||
155 | if (of_have_populated_dt()) | ||
156 | return -ENODEV; | ||
157 | |||
158 | return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, NULL); | ||
159 | } | ||
160 | omap_postcore_initcall(omap2_gpio_init); | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 759e1d45ba25..e8b988714a09 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -741,14 +741,14 @@ static int _init_main_clk(struct omap_hwmod *oh) | |||
741 | int ret = 0; | 741 | int ret = 0; |
742 | char name[MOD_CLK_MAX_NAME_LEN]; | 742 | char name[MOD_CLK_MAX_NAME_LEN]; |
743 | struct clk *clk; | 743 | struct clk *clk; |
744 | static const char modck[] = "_mod_ck"; | ||
744 | 745 | ||
745 | /* +7 magic comes from '_mod_ck' suffix */ | 746 | if (strlen(oh->name) >= MOD_CLK_MAX_NAME_LEN - strlen(modck)) |
746 | if (strlen(oh->name) + 7 > MOD_CLK_MAX_NAME_LEN) | ||
747 | pr_warn("%s: warning: cropping name for %s\n", __func__, | 747 | pr_warn("%s: warning: cropping name for %s\n", __func__, |
748 | oh->name); | 748 | oh->name); |
749 | 749 | ||
750 | strncpy(name, oh->name, MOD_CLK_MAX_NAME_LEN - 7); | 750 | strlcpy(name, oh->name, MOD_CLK_MAX_NAME_LEN - strlen(modck)); |
751 | strcat(name, "_mod_ck"); | 751 | strlcat(name, modck, MOD_CLK_MAX_NAME_LEN); |
752 | 752 | ||
753 | clk = clk_get(NULL, name); | 753 | clk = clk_get(NULL, name); |
754 | if (!IS_ERR(clk)) { | 754 | if (!IS_ERR(clk)) { |
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.h b/arch/arm/mach-omap2/omap_hwmod_common_data.h index cdfbb44ceb0c..f22e9cb39f4a 100644 --- a/arch/arm/mach-omap2/omap_hwmod_common_data.h +++ b/arch/arm/mach-omap2/omap_hwmod_common_data.h | |||
@@ -121,10 +121,6 @@ extern struct omap_hwmod_irq_info omap2_uart3_mpu_irqs[]; | |||
121 | extern struct omap_hwmod_irq_info omap2_dispc_irqs[]; | 121 | extern struct omap_hwmod_irq_info omap2_dispc_irqs[]; |
122 | extern struct omap_hwmod_irq_info omap2_i2c1_mpu_irqs[]; | 122 | extern struct omap_hwmod_irq_info omap2_i2c1_mpu_irqs[]; |
123 | extern struct omap_hwmod_irq_info omap2_i2c2_mpu_irqs[]; | 123 | extern struct omap_hwmod_irq_info omap2_i2c2_mpu_irqs[]; |
124 | extern struct omap_hwmod_irq_info omap2_gpio1_irqs[]; | ||
125 | extern struct omap_hwmod_irq_info omap2_gpio2_irqs[]; | ||
126 | extern struct omap_hwmod_irq_info omap2_gpio3_irqs[]; | ||
127 | extern struct omap_hwmod_irq_info omap2_gpio4_irqs[]; | ||
128 | extern struct omap_hwmod_irq_info omap2_dma_system_irqs[]; | 124 | extern struct omap_hwmod_irq_info omap2_dma_system_irqs[]; |
129 | extern struct omap_hwmod_irq_info omap2_mcspi1_mpu_irqs[]; | 125 | extern struct omap_hwmod_irq_info omap2_mcspi1_mpu_irqs[]; |
130 | extern struct omap_hwmod_irq_info omap2_mcspi2_mpu_irqs[]; | 126 | extern struct omap_hwmod_irq_info omap2_mcspi2_mpu_irqs[]; |
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index 5b2f5138d938..2b138b65129a 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c | |||
@@ -295,10 +295,8 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup) | |||
295 | GFP_KERNEL); | 295 | GFP_KERNEL); |
296 | 296 | ||
297 | if (!prcm_irq_chips || !prcm_irq_setup->saved_mask || | 297 | if (!prcm_irq_chips || !prcm_irq_setup->saved_mask || |
298 | !prcm_irq_setup->priority_mask) { | 298 | !prcm_irq_setup->priority_mask) |
299 | pr_err("PRCM: kzalloc failed\n"); | ||
300 | goto err; | 299 | goto err; |
301 | } | ||
302 | 300 | ||
303 | memset(mask, 0, sizeof(mask)); | 301 | memset(mask, 0, sizeof(mask)); |
304 | 302 | ||
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 56128da23c3a..07dd692c4737 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
@@ -510,18 +510,19 @@ void __init omap3_secure_sync32k_timer_init(void) | |||
510 | } | 510 | } |
511 | #endif /* CONFIG_ARCH_OMAP3 */ | 511 | #endif /* CONFIG_ARCH_OMAP3 */ |
512 | 512 | ||
513 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) | 513 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) || \ |
514 | defined(CONFIG_SOC_AM43XX) | ||
514 | void __init omap3_gptimer_timer_init(void) | 515 | void __init omap3_gptimer_timer_init(void) |
515 | { | 516 | { |
516 | __omap_sync32k_timer_init(2, "timer_sys_ck", NULL, | 517 | __omap_sync32k_timer_init(2, "timer_sys_ck", NULL, |
517 | 1, "timer_sys_ck", "ti,timer-alwon", true); | 518 | 1, "timer_sys_ck", "ti,timer-alwon", true); |
518 | 519 | if (of_have_populated_dt()) | |
519 | clocksource_probe(); | 520 | clocksource_probe(); |
520 | } | 521 | } |
521 | #endif | 522 | #endif |
522 | 523 | ||
523 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ | 524 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ |
524 | defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX) | 525 | defined(CONFIG_SOC_DRA7XX) |
525 | static void __init omap4_sync32k_timer_init(void) | 526 | static void __init omap4_sync32k_timer_init(void) |
526 | { | 527 | { |
527 | __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon", | 528 | __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon", |
diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index f6c3f151d0d4..b59f4f4f256f 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c | |||
@@ -345,10 +345,40 @@ static struct s3c24xx_dma_channel s3c2410_dma_channels[DMACH_MAX] = { | |||
345 | [DMACH_USB_EP4] = { S3C24XX_DMA_APB, true, S3C24XX_DMA_CHANREQ(4, 3), }, | 345 | [DMACH_USB_EP4] = { S3C24XX_DMA_APB, true, S3C24XX_DMA_CHANREQ(4, 3), }, |
346 | }; | 346 | }; |
347 | 347 | ||
348 | static const struct dma_slave_map s3c2410_dma_slave_map[] = { | ||
349 | { "s3c2410-sdi", "rx-tx", (void *)DMACH_SDI }, | ||
350 | { "s3c2410-spi.0", "rx", (void *)DMACH_SPI0_RX }, | ||
351 | { "s3c2410-spi.0", "tx", (void *)DMACH_SPI0_TX }, | ||
352 | { "s3c2410-spi.1", "rx", (void *)DMACH_SPI1_RX }, | ||
353 | { "s3c2410-spi.1", "tx", (void *)DMACH_SPI1_TX }, | ||
354 | /* | ||
355 | * The DMA request source[1] (DMACH_UARTx_SRC2) are | ||
356 | * not used in the UART driver. | ||
357 | */ | ||
358 | { "s3c2410-uart.0", "rx", (void *)DMACH_UART0 }, | ||
359 | { "s3c2410-uart.0", "tx", (void *)DMACH_UART0 }, | ||
360 | { "s3c2410-uart.1", "rx", (void *)DMACH_UART1 }, | ||
361 | { "s3c2410-uart.1", "tx", (void *)DMACH_UART1 }, | ||
362 | { "s3c2410-uart.2", "rx", (void *)DMACH_UART2 }, | ||
363 | { "s3c2410-uart.2", "tx", (void *)DMACH_UART2 }, | ||
364 | { "s3c24xx-iis", "rx", (void *)DMACH_I2S_IN }, | ||
365 | { "s3c24xx-iis", "tx", (void *)DMACH_I2S_OUT }, | ||
366 | { "s3c-hsudc", "rx0", (void *)DMACH_USB_EP1 }, | ||
367 | { "s3c-hsudc", "tx0", (void *)DMACH_USB_EP1 }, | ||
368 | { "s3c-hsudc", "rx1", (void *)DMACH_USB_EP2 }, | ||
369 | { "s3c-hsudc", "tx1", (void *)DMACH_USB_EP2 }, | ||
370 | { "s3c-hsudc", "rx2", (void *)DMACH_USB_EP3 }, | ||
371 | { "s3c-hsudc", "tx2", (void *)DMACH_USB_EP3 }, | ||
372 | { "s3c-hsudc", "rx3", (void *)DMACH_USB_EP4 }, | ||
373 | { "s3c-hsudc", "tx3", (void *)DMACH_USB_EP4 } | ||
374 | }; | ||
375 | |||
348 | static struct s3c24xx_dma_platdata s3c2410_dma_platdata = { | 376 | static struct s3c24xx_dma_platdata s3c2410_dma_platdata = { |
349 | .num_phy_channels = 4, | 377 | .num_phy_channels = 4, |
350 | .channels = s3c2410_dma_channels, | 378 | .channels = s3c2410_dma_channels, |
351 | .num_channels = DMACH_MAX, | 379 | .num_channels = DMACH_MAX, |
380 | .slave_map = s3c2410_dma_slave_map, | ||
381 | .slavecnt = ARRAY_SIZE(s3c2410_dma_slave_map), | ||
352 | }; | 382 | }; |
353 | 383 | ||
354 | struct platform_device s3c2410_device_dma = { | 384 | struct platform_device s3c2410_device_dma = { |
@@ -388,10 +418,36 @@ static struct s3c24xx_dma_channel s3c2412_dma_channels[DMACH_MAX] = { | |||
388 | [DMACH_USB_EP4] = { S3C24XX_DMA_APB, true, 16 }, | 418 | [DMACH_USB_EP4] = { S3C24XX_DMA_APB, true, 16 }, |
389 | }; | 419 | }; |
390 | 420 | ||
421 | static const struct dma_slave_map s3c2412_dma_slave_map[] = { | ||
422 | { "s3c2412-sdi", "rx-tx", (void *)DMACH_SDI }, | ||
423 | { "s3c2412-spi.0", "rx", (void *)DMACH_SPI0_RX }, | ||
424 | { "s3c2412-spi.0", "tx", (void *)DMACH_SPI0_TX }, | ||
425 | { "s3c2412-spi.1", "rx", (void *)DMACH_SPI1_RX }, | ||
426 | { "s3c2412-spi.1", "tx", (void *)DMACH_SPI1_TX }, | ||
427 | { "s3c2440-uart.0", "rx", (void *)DMACH_UART0 }, | ||
428 | { "s3c2440-uart.0", "tx", (void *)DMACH_UART0 }, | ||
429 | { "s3c2440-uart.1", "rx", (void *)DMACH_UART1 }, | ||
430 | { "s3c2440-uart.1", "tx", (void *)DMACH_UART1 }, | ||
431 | { "s3c2440-uart.2", "rx", (void *)DMACH_UART2 }, | ||
432 | { "s3c2440-uart.2", "tx", (void *)DMACH_UART2 }, | ||
433 | { "s3c2412-iis", "rx", (void *)DMACH_I2S_IN }, | ||
434 | { "s3c2412-iis", "tx", (void *)DMACH_I2S_OUT }, | ||
435 | { "s3c-hsudc", "rx0", (void *)DMACH_USB_EP1 }, | ||
436 | { "s3c-hsudc", "tx0", (void *)DMACH_USB_EP1 }, | ||
437 | { "s3c-hsudc", "rx1", (void *)DMACH_USB_EP2 }, | ||
438 | { "s3c-hsudc", "tx1", (void *)DMACH_USB_EP2 }, | ||
439 | { "s3c-hsudc", "rx2", (void *)DMACH_USB_EP3 }, | ||
440 | { "s3c-hsudc", "tx2", (void *)DMACH_USB_EP3 }, | ||
441 | { "s3c-hsudc", "rx3", (void *)DMACH_USB_EP4 }, | ||
442 | { "s3c-hsudc", "tx3", (void *)DMACH_USB_EP4 } | ||
443 | }; | ||
444 | |||
391 | static struct s3c24xx_dma_platdata s3c2412_dma_platdata = { | 445 | static struct s3c24xx_dma_platdata s3c2412_dma_platdata = { |
392 | .num_phy_channels = 4, | 446 | .num_phy_channels = 4, |
393 | .channels = s3c2412_dma_channels, | 447 | .channels = s3c2412_dma_channels, |
394 | .num_channels = DMACH_MAX, | 448 | .num_channels = DMACH_MAX, |
449 | .slave_map = s3c2412_dma_slave_map, | ||
450 | .slavecnt = ARRAY_SIZE(s3c2412_dma_slave_map), | ||
395 | }; | 451 | }; |
396 | 452 | ||
397 | struct platform_device s3c2412_device_dma = { | 453 | struct platform_device s3c2412_device_dma = { |
@@ -534,10 +590,30 @@ static struct s3c24xx_dma_channel s3c2443_dma_channels[DMACH_MAX] = { | |||
534 | [DMACH_MIC_IN] = { S3C24XX_DMA_APB, true, 29 }, | 590 | [DMACH_MIC_IN] = { S3C24XX_DMA_APB, true, 29 }, |
535 | }; | 591 | }; |
536 | 592 | ||
593 | static const struct dma_slave_map s3c2443_dma_slave_map[] = { | ||
594 | { "s3c2440-sdi", "rx-tx", (void *)DMACH_SDI }, | ||
595 | { "s3c2443-spi.0", "rx", (void *)DMACH_SPI0_RX }, | ||
596 | { "s3c2443-spi.0", "tx", (void *)DMACH_SPI0_TX }, | ||
597 | { "s3c2443-spi.1", "rx", (void *)DMACH_SPI1_RX }, | ||
598 | { "s3c2443-spi.1", "tx", (void *)DMACH_SPI1_TX }, | ||
599 | { "s3c2440-uart.0", "rx", (void *)DMACH_UART0 }, | ||
600 | { "s3c2440-uart.0", "tx", (void *)DMACH_UART0 }, | ||
601 | { "s3c2440-uart.1", "rx", (void *)DMACH_UART1 }, | ||
602 | { "s3c2440-uart.1", "tx", (void *)DMACH_UART1 }, | ||
603 | { "s3c2440-uart.2", "rx", (void *)DMACH_UART2 }, | ||
604 | { "s3c2440-uart.2", "tx", (void *)DMACH_UART2 }, | ||
605 | { "s3c2440-uart.3", "rx", (void *)DMACH_UART3 }, | ||
606 | { "s3c2440-uart.3", "tx", (void *)DMACH_UART3 }, | ||
607 | { "s3c24xx-iis", "rx", (void *)DMACH_I2S_IN }, | ||
608 | { "s3c24xx-iis", "tx", (void *)DMACH_I2S_OUT }, | ||
609 | }; | ||
610 | |||
537 | static struct s3c24xx_dma_platdata s3c2443_dma_platdata = { | 611 | static struct s3c24xx_dma_platdata s3c2443_dma_platdata = { |
538 | .num_phy_channels = 6, | 612 | .num_phy_channels = 6, |
539 | .channels = s3c2443_dma_channels, | 613 | .channels = s3c2443_dma_channels, |
540 | .num_channels = DMACH_MAX, | 614 | .num_channels = DMACH_MAX, |
615 | .slave_map = s3c2443_dma_slave_map, | ||
616 | .slavecnt = ARRAY_SIZE(s3c2443_dma_slave_map), | ||
541 | }; | 617 | }; |
542 | 618 | ||
543 | struct platform_device s3c2443_device_dma = { | 619 | struct platform_device s3c2443_device_dma = { |
diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi index fc033c0d2a0f..eada0b58ba1c 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi | |||
@@ -356,5 +356,21 @@ | |||
356 | status = "disabled"; | 356 | status = "disabled"; |
357 | }; | 357 | }; |
358 | }; | 358 | }; |
359 | |||
360 | vpu: vpu@d0100000 { | ||
361 | compatible = "amlogic,meson-gx-vpu"; | ||
362 | reg = <0x0 0xd0100000 0x0 0x100000>, | ||
363 | <0x0 0xc883c000 0x0 0x1000>, | ||
364 | <0x0 0xc8838000 0x0 0x1000>; | ||
365 | reg-names = "vpu", "hhi", "dmc"; | ||
366 | interrupts = <GIC_SPI 3 IRQ_TYPE_EDGE_RISING>; | ||
367 | #address-cells = <1>; | ||
368 | #size-cells = <0>; | ||
369 | |||
370 | /* CVBS VDAC output port */ | ||
371 | cvbs_vdac_port: port@0 { | ||
372 | reg = <0>; | ||
373 | }; | ||
374 | }; | ||
359 | }; | 375 | }; |
360 | }; | 376 | }; |
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts index 969682092e0f..4cbd626a9e88 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts | |||
@@ -142,6 +142,16 @@ | |||
142 | clocks = <&wifi32k>; | 142 | clocks = <&wifi32k>; |
143 | clock-names = "ext_clock"; | 143 | clock-names = "ext_clock"; |
144 | }; | 144 | }; |
145 | |||
146 | cvbs-connector { | ||
147 | compatible = "composite-video-connector"; | ||
148 | |||
149 | port { | ||
150 | cvbs_connector_in: endpoint { | ||
151 | remote-endpoint = <&cvbs_vdac_out>; | ||
152 | }; | ||
153 | }; | ||
154 | }; | ||
145 | }; | 155 | }; |
146 | 156 | ||
147 | &uart_AO { | 157 | &uart_AO { |
@@ -229,3 +239,9 @@ | |||
229 | clocks = <&clkc CLKID_FCLK_DIV4>; | 239 | clocks = <&clkc CLKID_FCLK_DIV4>; |
230 | clock-names = "clkin0"; | 240 | clock-names = "clkin0"; |
231 | }; | 241 | }; |
242 | |||
243 | &cvbs_vdac_port { | ||
244 | cvbs_vdac_out: endpoint { | ||
245 | remote-endpoint = <&cvbs_connector_in>; | ||
246 | }; | ||
247 | }; | ||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi index 203be28978d5..4a96e0f6f926 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | |||
@@ -125,6 +125,16 @@ | |||
125 | clocks = <&wifi32k>; | 125 | clocks = <&wifi32k>; |
126 | clock-names = "ext_clock"; | 126 | clock-names = "ext_clock"; |
127 | }; | 127 | }; |
128 | |||
129 | cvbs-connector { | ||
130 | compatible = "composite-video-connector"; | ||
131 | |||
132 | port { | ||
133 | cvbs_connector_in: endpoint { | ||
134 | remote-endpoint = <&cvbs_vdac_out>; | ||
135 | }; | ||
136 | }; | ||
137 | }; | ||
128 | }; | 138 | }; |
129 | 139 | ||
130 | /* This UART is brought out to the DB9 connector */ | 140 | /* This UART is brought out to the DB9 connector */ |
@@ -234,3 +244,9 @@ | |||
234 | clocks = <&clkc CLKID_FCLK_DIV4>; | 244 | clocks = <&clkc CLKID_FCLK_DIV4>; |
235 | clock-names = "clkin0"; | 245 | clock-names = "clkin0"; |
236 | }; | 246 | }; |
247 | |||
248 | &cvbs_vdac_port { | ||
249 | cvbs_vdac_out: endpoint { | ||
250 | remote-endpoint = <&cvbs_connector_in>; | ||
251 | }; | ||
252 | }; | ||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi index 51edd5b5c460..596240c38a9c 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | |||
@@ -506,3 +506,7 @@ | |||
506 | <&clkc CLKID_FCLK_DIV2>; | 506 | <&clkc CLKID_FCLK_DIV2>; |
507 | clock-names = "core", "clkin0", "clkin1"; | 507 | clock-names = "core", "clkin0", "clkin1"; |
508 | }; | 508 | }; |
509 | |||
510 | &vpu { | ||
511 | compatible = "amlogic,meson-gxbb-vpu", "amlogic,meson-gx-vpu"; | ||
512 | }; | ||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts index e99101ae9664..cea4a3eded9b 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts | |||
@@ -117,6 +117,16 @@ | |||
117 | clocks = <&wifi32k>; | 117 | clocks = <&wifi32k>; |
118 | clock-names = "ext_clock"; | 118 | clock-names = "ext_clock"; |
119 | }; | 119 | }; |
120 | |||
121 | cvbs-connector { | ||
122 | compatible = "composite-video-connector"; | ||
123 | |||
124 | port { | ||
125 | cvbs_connector_in: endpoint { | ||
126 | remote-endpoint = <&cvbs_vdac_out>; | ||
127 | }; | ||
128 | }; | ||
129 | }; | ||
120 | }; | 130 | }; |
121 | 131 | ||
122 | &uart_AO { | 132 | &uart_AO { |
@@ -203,3 +213,9 @@ | |||
203 | clocks = <&clkc CLKID_FCLK_DIV4>; | 213 | clocks = <&clkc CLKID_FCLK_DIV4>; |
204 | clock-names = "clkin0"; | 214 | clock-names = "clkin0"; |
205 | }; | 215 | }; |
216 | |||
217 | &cvbs_vdac_port { | ||
218 | cvbs_vdac_out: endpoint { | ||
219 | remote-endpoint = <&cvbs_connector_in>; | ||
220 | }; | ||
221 | }; | ||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi index 9f89b99c4806..69216246275d 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | |||
@@ -43,7 +43,7 @@ | |||
43 | 43 | ||
44 | #include "meson-gx.dtsi" | 44 | #include "meson-gx.dtsi" |
45 | #include <dt-bindings/clock/gxbb-clkc.h> | 45 | #include <dt-bindings/clock/gxbb-clkc.h> |
46 | #include <dt-bindings/gpio/meson-gxbb-gpio.h> | 46 | #include <dt-bindings/gpio/meson-gxl-gpio.h> |
47 | 47 | ||
48 | / { | 48 | / { |
49 | compatible = "amlogic,meson-gxl"; | 49 | compatible = "amlogic,meson-gxl"; |
@@ -299,3 +299,7 @@ | |||
299 | <&clkc CLKID_FCLK_DIV2>; | 299 | <&clkc CLKID_FCLK_DIV2>; |
300 | clock-names = "core", "clkin0", "clkin1"; | 300 | clock-names = "core", "clkin0", "clkin1"; |
301 | }; | 301 | }; |
302 | |||
303 | &vpu { | ||
304 | compatible = "amlogic,meson-gxl-vpu", "amlogic,meson-gx-vpu"; | ||
305 | }; | ||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts index f859d75db8bd..5a337d339df1 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts | |||
@@ -90,6 +90,16 @@ | |||
90 | compatible = "mmc-pwrseq-emmc"; | 90 | compatible = "mmc-pwrseq-emmc"; |
91 | reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>; | 91 | reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>; |
92 | }; | 92 | }; |
93 | |||
94 | cvbs-connector { | ||
95 | compatible = "composite-video-connector"; | ||
96 | |||
97 | port { | ||
98 | cvbs_connector_in: endpoint { | ||
99 | remote-endpoint = <&cvbs_vdac_out>; | ||
100 | }; | ||
101 | }; | ||
102 | }; | ||
93 | }; | 103 | }; |
94 | 104 | ||
95 | /* This UART is brought out to the DB9 connector */ | 105 | /* This UART is brought out to the DB9 connector */ |
@@ -167,3 +177,9 @@ | |||
167 | max-speed = <1000>; | 177 | max-speed = <1000>; |
168 | }; | 178 | }; |
169 | }; | 179 | }; |
180 | |||
181 | &cvbs_vdac_port { | ||
182 | cvbs_vdac_out: endpoint { | ||
183 | remote-endpoint = <&cvbs_connector_in>; | ||
184 | }; | ||
185 | }; | ||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi index c1974bbbddea..eb2f0c3e5e53 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi | |||
@@ -112,3 +112,7 @@ | |||
112 | }; | 112 | }; |
113 | }; | 113 | }; |
114 | }; | 114 | }; |
115 | |||
116 | &vpu { | ||
117 | compatible = "amlogic,meson-gxm-vpu", "amlogic,meson-gx-vpu"; | ||
118 | }; | ||
diff --git a/arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts b/arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts index a852e28a40e1..a83ed2c6bbf7 100644 --- a/arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts +++ b/arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts | |||
@@ -81,7 +81,7 @@ | |||
81 | #address-cells = <0>; | 81 | #address-cells = <0>; |
82 | interrupt-controller; | 82 | interrupt-controller; |
83 | reg = <0x0 0x2c001000 0 0x1000>, | 83 | reg = <0x0 0x2c001000 0 0x1000>, |
84 | <0x0 0x2c002000 0 0x1000>, | 84 | <0x0 0x2c002000 0 0x2000>, |
85 | <0x0 0x2c004000 0 0x2000>, | 85 | <0x0 0x2c004000 0 0x2000>, |
86 | <0x0 0x2c006000 0 0x2000>; | 86 | <0x0 0x2c006000 0 0x2000>; |
87 | interrupts = <1 9 0xf04>; | 87 | interrupts = <1 9 0xf04>; |
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi index 9d1d7ad9b075..29ed6b61c737 100644 --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi | |||
@@ -64,6 +64,16 @@ | |||
64 | reg = <0x0 0x86000000 0x0 0x200000>; | 64 | reg = <0x0 0x86000000 0x0 0x200000>; |
65 | no-map; | 65 | no-map; |
66 | }; | 66 | }; |
67 | |||
68 | memory@85800000 { | ||
69 | reg = <0x0 0x85800000 0x0 0x800000>; | ||
70 | no-map; | ||
71 | }; | ||
72 | |||
73 | memory@86200000 { | ||
74 | reg = <0x0 0x86200000 0x0 0x2600000>; | ||
75 | no-map; | ||
76 | }; | ||
67 | }; | 77 | }; |
68 | 78 | ||
69 | cpus { | 79 | cpus { |
diff --git a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts index 6ffb0517421a..dbea2c3d8f0c 100644 --- a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts +++ b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts | |||
@@ -169,7 +169,7 @@ | |||
169 | power-source = <3300>; | 169 | power-source = <3300>; |
170 | }; | 170 | }; |
171 | 171 | ||
172 | sdhi0_pins_uhs: sd0 { | 172 | sdhi0_pins_uhs: sd0_uhs { |
173 | groups = "sdhi0_data4", "sdhi0_ctrl"; | 173 | groups = "sdhi0_data4", "sdhi0_ctrl"; |
174 | function = "sdhi0"; | 174 | function = "sdhi0"; |
175 | power-source = <1800>; | 175 | power-source = <1800>; |
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 869dded0f09f..33b744d54739 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig | |||
@@ -331,6 +331,7 @@ CONFIG_DRM_VC4=m | |||
331 | CONFIG_DRM_PANEL_SIMPLE=m | 331 | CONFIG_DRM_PANEL_SIMPLE=m |
332 | CONFIG_DRM_I2C_ADV7511=m | 332 | CONFIG_DRM_I2C_ADV7511=m |
333 | CONFIG_DRM_HISI_KIRIN=m | 333 | CONFIG_DRM_HISI_KIRIN=m |
334 | CONFIG_DRM_MESON=m | ||
334 | CONFIG_FB=y | 335 | CONFIG_FB=y |
335 | CONFIG_FB_ARMCLCD=y | 336 | CONFIG_FB_ARMCLCD=y |
336 | CONFIG_BACKLIGHT_GENERIC=m | 337 | CONFIG_BACKLIGHT_GENERIC=m |
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 290a84f3351f..e04082700bb1 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c | |||
@@ -524,7 +524,8 @@ EXPORT_SYMBOL(dummy_dma_ops); | |||
524 | 524 | ||
525 | static int __init arm64_dma_init(void) | 525 | static int __init arm64_dma_init(void) |
526 | { | 526 | { |
527 | if (swiotlb_force || max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT)) | 527 | if (swiotlb_force == SWIOTLB_FORCE || |
528 | max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT)) | ||
528 | swiotlb = 1; | 529 | swiotlb = 1; |
529 | 530 | ||
530 | return atomic_pool_init(); | 531 | return atomic_pool_init(); |
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 212c4d1e2f26..716d1226ba69 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c | |||
@@ -401,7 +401,8 @@ static void __init free_unused_memmap(void) | |||
401 | */ | 401 | */ |
402 | void __init mem_init(void) | 402 | void __init mem_init(void) |
403 | { | 403 | { |
404 | if (swiotlb_force || max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT)) | 404 | if (swiotlb_force == SWIOTLB_FORCE || |
405 | max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT)) | ||
405 | swiotlb_init(1); | 406 | swiotlb_init(1); |
406 | 407 | ||
407 | set_max_mapnr(pfn_to_page(max_pfn) - mem_map); | 408 | set_max_mapnr(pfn_to_page(max_pfn) - mem_map); |
diff --git a/arch/openrisc/kernel/vmlinux.lds.S b/arch/openrisc/kernel/vmlinux.lds.S index ef31fc24344e..552544616b9d 100644 --- a/arch/openrisc/kernel/vmlinux.lds.S +++ b/arch/openrisc/kernel/vmlinux.lds.S | |||
@@ -44,6 +44,8 @@ SECTIONS | |||
44 | /* Read-only sections, merged into text segment: */ | 44 | /* Read-only sections, merged into text segment: */ |
45 | . = LOAD_BASE ; | 45 | . = LOAD_BASE ; |
46 | 46 | ||
47 | _text = .; | ||
48 | |||
47 | /* _s_kernel_ro must be page aligned */ | 49 | /* _s_kernel_ro must be page aligned */ |
48 | . = ALIGN(PAGE_SIZE); | 50 | . = ALIGN(PAGE_SIZE); |
49 | _s_kernel_ro = .; | 51 | _s_kernel_ro = .; |
diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h index 7581330ea35b..88fe0aad4390 100644 --- a/arch/parisc/include/asm/thread_info.h +++ b/arch/parisc/include/asm/thread_info.h | |||
@@ -49,7 +49,6 @@ struct thread_info { | |||
49 | #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 49 | #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
50 | #define TIF_32BIT 4 /* 32 bit binary */ | 50 | #define TIF_32BIT 4 /* 32 bit binary */ |
51 | #define TIF_MEMDIE 5 /* is terminating due to OOM killer */ | 51 | #define TIF_MEMDIE 5 /* is terminating due to OOM killer */ |
52 | #define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */ | ||
53 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ | 52 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ |
54 | #define TIF_NOTIFY_RESUME 8 /* callback before returning to user */ | 53 | #define TIF_NOTIFY_RESUME 8 /* callback before returning to user */ |
55 | #define TIF_SINGLESTEP 9 /* single stepping? */ | 54 | #define TIF_SINGLESTEP 9 /* single stepping? */ |
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index da0d9cb63403..1e22f981cd81 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c | |||
@@ -235,9 +235,26 @@ void __init time_init(void) | |||
235 | 235 | ||
236 | cr16_hz = 100 * PAGE0->mem_10msec; /* Hz */ | 236 | cr16_hz = 100 * PAGE0->mem_10msec; /* Hz */ |
237 | 237 | ||
238 | /* register at clocksource framework */ | ||
239 | clocksource_register_hz(&clocksource_cr16, cr16_hz); | ||
240 | |||
241 | /* register as sched_clock source */ | 238 | /* register as sched_clock source */ |
242 | sched_clock_register(read_cr16_sched_clock, BITS_PER_LONG, cr16_hz); | 239 | sched_clock_register(read_cr16_sched_clock, BITS_PER_LONG, cr16_hz); |
243 | } | 240 | } |
241 | |||
242 | static int __init init_cr16_clocksource(void) | ||
243 | { | ||
244 | /* | ||
245 | * The cr16 interval timers are not syncronized across CPUs, so mark | ||
246 | * them unstable and lower rating on SMP systems. | ||
247 | */ | ||
248 | if (num_online_cpus() > 1) { | ||
249 | clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE; | ||
250 | clocksource_cr16.rating = 0; | ||
251 | } | ||
252 | |||
253 | /* register at clocksource framework */ | ||
254 | clocksource_register_hz(&clocksource_cr16, | ||
255 | 100 * PAGE0->mem_10msec); | ||
256 | |||
257 | return 0; | ||
258 | } | ||
259 | |||
260 | device_initcall(init_cr16_clocksource); | ||
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index 8ff9253930af..1a0b4f63f0e9 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c | |||
@@ -234,7 +234,7 @@ show_signal_msg(struct pt_regs *regs, unsigned long code, | |||
234 | tsk->comm, code, address); | 234 | tsk->comm, code, address); |
235 | print_vma_addr(KERN_CONT " in ", regs->iaoq[0]); | 235 | print_vma_addr(KERN_CONT " in ", regs->iaoq[0]); |
236 | 236 | ||
237 | pr_cont(" trap #%lu: %s%c", code, trap_name(code), | 237 | pr_cont("\ntrap #%lu: %s%c", code, trap_name(code), |
238 | vma ? ',':'\n'); | 238 | vma ? ',':'\n'); |
239 | 239 | ||
240 | if (vma) | 240 | if (vma) |
diff --git a/arch/s390/include/asm/asm-prototypes.h b/arch/s390/include/asm/asm-prototypes.h new file mode 100644 index 000000000000..2c3413b0ca52 --- /dev/null +++ b/arch/s390/include/asm/asm-prototypes.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef _ASM_S390_PROTOTYPES_H | ||
2 | |||
3 | #include <linux/kvm_host.h> | ||
4 | #include <linux/ftrace.h> | ||
5 | #include <asm/fpu/api.h> | ||
6 | #include <asm-generic/asm-prototypes.h> | ||
7 | |||
8 | #endif /* _ASM_S390_PROTOTYPES_H */ | ||
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 6b246aadf311..1b5c5ee9fc1b 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c | |||
@@ -94,7 +94,7 @@ static void update_mt_scaling(void) | |||
94 | * Update process times based on virtual cpu times stored by entry.S | 94 | * Update process times based on virtual cpu times stored by entry.S |
95 | * to the lowcore fields user_timer, system_timer & steal_clock. | 95 | * to the lowcore fields user_timer, system_timer & steal_clock. |
96 | */ | 96 | */ |
97 | static int do_account_vtime(struct task_struct *tsk, int hardirq_offset) | 97 | static int do_account_vtime(struct task_struct *tsk) |
98 | { | 98 | { |
99 | u64 timer, clock, user, system, steal; | 99 | u64 timer, clock, user, system, steal; |
100 | u64 user_scaled, system_scaled; | 100 | u64 user_scaled, system_scaled; |
@@ -138,7 +138,7 @@ static int do_account_vtime(struct task_struct *tsk, int hardirq_offset) | |||
138 | } | 138 | } |
139 | account_user_time(tsk, user); | 139 | account_user_time(tsk, user); |
140 | tsk->utimescaled += user_scaled; | 140 | tsk->utimescaled += user_scaled; |
141 | account_system_time(tsk, hardirq_offset, system); | 141 | account_system_time(tsk, 0, system); |
142 | tsk->stimescaled += system_scaled; | 142 | tsk->stimescaled += system_scaled; |
143 | 143 | ||
144 | steal = S390_lowcore.steal_timer; | 144 | steal = S390_lowcore.steal_timer; |
@@ -152,7 +152,7 @@ static int do_account_vtime(struct task_struct *tsk, int hardirq_offset) | |||
152 | 152 | ||
153 | void vtime_task_switch(struct task_struct *prev) | 153 | void vtime_task_switch(struct task_struct *prev) |
154 | { | 154 | { |
155 | do_account_vtime(prev, 0); | 155 | do_account_vtime(prev); |
156 | prev->thread.user_timer = S390_lowcore.user_timer; | 156 | prev->thread.user_timer = S390_lowcore.user_timer; |
157 | prev->thread.system_timer = S390_lowcore.system_timer; | 157 | prev->thread.system_timer = S390_lowcore.system_timer; |
158 | S390_lowcore.user_timer = current->thread.user_timer; | 158 | S390_lowcore.user_timer = current->thread.user_timer; |
@@ -166,7 +166,7 @@ void vtime_task_switch(struct task_struct *prev) | |||
166 | */ | 166 | */ |
167 | void vtime_account_user(struct task_struct *tsk) | 167 | void vtime_account_user(struct task_struct *tsk) |
168 | { | 168 | { |
169 | if (do_account_vtime(tsk, HARDIRQ_OFFSET)) | 169 | if (do_account_vtime(tsk)) |
170 | virt_timer_expire(); | 170 | virt_timer_expire(); |
171 | } | 171 | } |
172 | 172 | ||
diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c index b47edb8f5256..410efb2c7b80 100644 --- a/arch/x86/kernel/pci-swiotlb.c +++ b/arch/x86/kernel/pci-swiotlb.c | |||
@@ -68,12 +68,10 @@ static struct dma_map_ops swiotlb_dma_ops = { | |||
68 | */ | 68 | */ |
69 | int __init pci_swiotlb_detect_override(void) | 69 | int __init pci_swiotlb_detect_override(void) |
70 | { | 70 | { |
71 | int use_swiotlb = swiotlb | swiotlb_force; | 71 | if (swiotlb_force == SWIOTLB_FORCE) |
72 | |||
73 | if (swiotlb_force) | ||
74 | swiotlb = 1; | 72 | swiotlb = 1; |
75 | 73 | ||
76 | return use_swiotlb; | 74 | return swiotlb; |
77 | } | 75 | } |
78 | IOMMU_INIT_FINISH(pci_swiotlb_detect_override, | 76 | IOMMU_INIT_FINISH(pci_swiotlb_detect_override, |
79 | pci_xen_swiotlb_detect, | 77 | pci_xen_swiotlb_detect, |
diff --git a/arch/x86/xen/pci-swiotlb-xen.c b/arch/x86/xen/pci-swiotlb-xen.c index a9fafb5c8738..a0b36a9d5df1 100644 --- a/arch/x86/xen/pci-swiotlb-xen.c +++ b/arch/x86/xen/pci-swiotlb-xen.c | |||
@@ -48,7 +48,7 @@ int __init pci_xen_swiotlb_detect(void) | |||
48 | * activate this IOMMU. If running as PV privileged, activate it | 48 | * activate this IOMMU. If running as PV privileged, activate it |
49 | * irregardless. | 49 | * irregardless. |
50 | */ | 50 | */ |
51 | if ((xen_initial_domain() || swiotlb || swiotlb_force)) | 51 | if (xen_initial_domain() || swiotlb || swiotlb_force == SWIOTLB_FORCE) |
52 | xen_swiotlb = 1; | 52 | xen_swiotlb = 1; |
53 | 53 | ||
54 | /* If we are running under Xen, we MUST disable the native SWIOTLB. | 54 | /* If we are running under Xen, we MUST disable the native SWIOTLB. |
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 8c394e30e5fe..f3f7b41116f7 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -713,10 +713,9 @@ static void __init xen_reserve_xen_mfnlist(void) | |||
713 | size = PFN_PHYS(xen_start_info->nr_p2m_frames); | 713 | size = PFN_PHYS(xen_start_info->nr_p2m_frames); |
714 | } | 714 | } |
715 | 715 | ||
716 | if (!xen_is_e820_reserved(start, size)) { | 716 | memblock_reserve(start, size); |
717 | memblock_reserve(start, size); | 717 | if (!xen_is_e820_reserved(start, size)) |
718 | return; | 718 | return; |
719 | } | ||
720 | 719 | ||
721 | #ifdef CONFIG_X86_32 | 720 | #ifdef CONFIG_X86_32 |
722 | /* | 721 | /* |
@@ -727,6 +726,7 @@ static void __init xen_reserve_xen_mfnlist(void) | |||
727 | BUG(); | 726 | BUG(); |
728 | #else | 727 | #else |
729 | xen_relocate_p2m(); | 728 | xen_relocate_p2m(); |
729 | memblock_free(start, size); | ||
730 | #endif | 730 | #endif |
731 | } | 731 | } |
732 | 732 | ||
diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 6e82769f4042..f0a9c07b4c7a 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c | |||
@@ -544,6 +544,8 @@ static inline bool may_queue(struct rq_wb *rwb, struct rq_wait *rqw, | |||
544 | * the timer to kick off queuing again. | 544 | * the timer to kick off queuing again. |
545 | */ | 545 | */ |
546 | static void __wbt_wait(struct rq_wb *rwb, unsigned long rw, spinlock_t *lock) | 546 | static void __wbt_wait(struct rq_wb *rwb, unsigned long rw, spinlock_t *lock) |
547 | __releases(lock) | ||
548 | __acquires(lock) | ||
547 | { | 549 | { |
548 | struct rq_wait *rqw = get_rq_wait(rwb, current_is_kswapd()); | 550 | struct rq_wait *rqw = get_rq_wait(rwb, current_is_kswapd()); |
549 | DEFINE_WAIT(wait); | 551 | DEFINE_WAIT(wait); |
@@ -558,13 +560,12 @@ static void __wbt_wait(struct rq_wb *rwb, unsigned long rw, spinlock_t *lock) | |||
558 | if (may_queue(rwb, rqw, &wait, rw)) | 560 | if (may_queue(rwb, rqw, &wait, rw)) |
559 | break; | 561 | break; |
560 | 562 | ||
561 | if (lock) | 563 | if (lock) { |
562 | spin_unlock_irq(lock); | 564 | spin_unlock_irq(lock); |
563 | 565 | io_schedule(); | |
564 | io_schedule(); | ||
565 | |||
566 | if (lock) | ||
567 | spin_lock_irq(lock); | 566 | spin_lock_irq(lock); |
567 | } else | ||
568 | io_schedule(); | ||
568 | } while (1); | 569 | } while (1); |
569 | 570 | ||
570 | finish_wait(&rqw->wait, &wait); | 571 | finish_wait(&rqw->wait, &wait); |
@@ -595,7 +596,7 @@ static inline bool wbt_should_throttle(struct rq_wb *rwb, struct bio *bio) | |||
595 | * in an irq held spinlock, if it holds one when calling this function. | 596 | * in an irq held spinlock, if it holds one when calling this function. |
596 | * If we do sleep, we'll release and re-grab it. | 597 | * If we do sleep, we'll release and re-grab it. |
597 | */ | 598 | */ |
598 | unsigned int wbt_wait(struct rq_wb *rwb, struct bio *bio, spinlock_t *lock) | 599 | enum wbt_flags wbt_wait(struct rq_wb *rwb, struct bio *bio, spinlock_t *lock) |
599 | { | 600 | { |
600 | unsigned int ret = 0; | 601 | unsigned int ret = 0; |
601 | 602 | ||
diff --git a/drivers/acpi/acpi_watchdog.c b/drivers/acpi/acpi_watchdog.c index 13caebd679f5..8c4e0a18460a 100644 --- a/drivers/acpi/acpi_watchdog.c +++ b/drivers/acpi/acpi_watchdog.c | |||
@@ -114,7 +114,7 @@ void __init acpi_watchdog_init(void) | |||
114 | pdev = platform_device_register_simple("wdat_wdt", PLATFORM_DEVID_NONE, | 114 | pdev = platform_device_register_simple("wdat_wdt", PLATFORM_DEVID_NONE, |
115 | resources, nresources); | 115 | resources, nresources); |
116 | if (IS_ERR(pdev)) | 116 | if (IS_ERR(pdev)) |
117 | pr_err("Failed to create platform device\n"); | 117 | pr_err("Device creation failed: %ld\n", PTR_ERR(pdev)); |
118 | 118 | ||
119 | kfree(resources); | 119 | kfree(resources); |
120 | 120 | ||
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index f8d65647ea79..fb19e1cdb641 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c | |||
@@ -98,7 +98,15 @@ static int find_child_checks(struct acpi_device *adev, bool check_children) | |||
98 | if (check_children && list_empty(&adev->children)) | 98 | if (check_children && list_empty(&adev->children)) |
99 | return -ENODEV; | 99 | return -ENODEV; |
100 | 100 | ||
101 | return sta_present ? FIND_CHILD_MAX_SCORE : FIND_CHILD_MIN_SCORE; | 101 | /* |
102 | * If the device has a _HID (or _CID) returning a valid ACPI/PNP | ||
103 | * device ID, it is better to make it look less attractive here, so that | ||
104 | * the other device with the same _ADR value (that may not have a valid | ||
105 | * device ID) can be matched going forward. [This means a second spec | ||
106 | * violation in a row, so whatever we do here is best effort anyway.] | ||
107 | */ | ||
108 | return sta_present && list_empty(&adev->pnp.ids) ? | ||
109 | FIND_CHILD_MAX_SCORE : FIND_CHILD_MIN_SCORE; | ||
102 | } | 110 | } |
103 | 111 | ||
104 | struct acpi_device *acpi_find_child_device(struct acpi_device *parent, | 112 | struct acpi_device *acpi_find_child_device(struct acpi_device *parent, |
@@ -250,7 +258,6 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) | |||
250 | return 0; | 258 | return 0; |
251 | 259 | ||
252 | err: | 260 | err: |
253 | acpi_dma_deconfigure(dev); | ||
254 | ACPI_COMPANION_SET(dev, NULL); | 261 | ACPI_COMPANION_SET(dev, NULL); |
255 | put_device(dev); | 262 | put_device(dev); |
256 | put_device(&acpi_dev->dev); | 263 | put_device(&acpi_dev->dev); |
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 1b41a2739dac..0c452265c111 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
@@ -37,6 +37,7 @@ void acpi_amba_init(void); | |||
37 | static inline void acpi_amba_init(void) {} | 37 | static inline void acpi_amba_init(void) {} |
38 | #endif | 38 | #endif |
39 | int acpi_sysfs_init(void); | 39 | int acpi_sysfs_init(void); |
40 | void acpi_gpe_apply_masked_gpes(void); | ||
40 | void acpi_container_init(void); | 41 | void acpi_container_init(void); |
41 | void acpi_memory_hotplug_init(void); | 42 | void acpi_memory_hotplug_init(void); |
42 | #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC | 43 | #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 45dec874ea55..192691880d55 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -2074,6 +2074,7 @@ int __init acpi_scan_init(void) | |||
2074 | } | 2074 | } |
2075 | } | 2075 | } |
2076 | 2076 | ||
2077 | acpi_gpe_apply_masked_gpes(); | ||
2077 | acpi_update_all_gpes(); | 2078 | acpi_update_all_gpes(); |
2078 | acpi_ec_ecdt_start(); | 2079 | acpi_ec_ecdt_start(); |
2079 | 2080 | ||
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 703c26e7022c..cf05ae973381 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c | |||
@@ -708,6 +708,62 @@ end: | |||
708 | return result ? result : size; | 708 | return result ? result : size; |
709 | } | 709 | } |
710 | 710 | ||
711 | /* | ||
712 | * A Quirk Mechanism for GPE Flooding Prevention: | ||
713 | * | ||
714 | * Quirks may be needed to prevent GPE flooding on a specific GPE. The | ||
715 | * flooding typically cannot be detected and automatically prevented by | ||
716 | * ACPI_GPE_DISPATCH_NONE check because there is a _Lxx/_Exx prepared in | ||
717 | * the AML tables. This normally indicates a feature gap in Linux, thus | ||
718 | * instead of providing endless quirk tables, we provide a boot parameter | ||
719 | * for those who want this quirk. For example, if the users want to prevent | ||
720 | * the GPE flooding for GPE 00, they need to specify the following boot | ||
721 | * parameter: | ||
722 | * acpi_mask_gpe=0x00 | ||
723 | * The masking status can be modified by the following runtime controlling | ||
724 | * interface: | ||
725 | * echo unmask > /sys/firmware/acpi/interrupts/gpe00 | ||
726 | */ | ||
727 | |||
728 | /* | ||
729 | * Currently, the GPE flooding prevention only supports to mask the GPEs | ||
730 | * numbered from 00 to 7f. | ||
731 | */ | ||
732 | #define ACPI_MASKABLE_GPE_MAX 0x80 | ||
733 | |||
734 | static u64 __initdata acpi_masked_gpes; | ||
735 | |||
736 | static int __init acpi_gpe_set_masked_gpes(char *val) | ||
737 | { | ||
738 | u8 gpe; | ||
739 | |||
740 | if (kstrtou8(val, 0, &gpe) || gpe > ACPI_MASKABLE_GPE_MAX) | ||
741 | return -EINVAL; | ||
742 | acpi_masked_gpes |= ((u64)1<<gpe); | ||
743 | |||
744 | return 1; | ||
745 | } | ||
746 | __setup("acpi_mask_gpe=", acpi_gpe_set_masked_gpes); | ||
747 | |||
748 | void __init acpi_gpe_apply_masked_gpes(void) | ||
749 | { | ||
750 | acpi_handle handle; | ||
751 | acpi_status status; | ||
752 | u8 gpe; | ||
753 | |||
754 | for (gpe = 0; | ||
755 | gpe < min_t(u8, ACPI_MASKABLE_GPE_MAX, acpi_current_gpe_count); | ||
756 | gpe++) { | ||
757 | if (acpi_masked_gpes & ((u64)1<<gpe)) { | ||
758 | status = acpi_get_gpe_device(gpe, &handle); | ||
759 | if (ACPI_SUCCESS(status)) { | ||
760 | pr_info("Masking GPE 0x%x.\n", gpe); | ||
761 | (void)acpi_mask_gpe(handle, gpe, TRUE); | ||
762 | } | ||
763 | } | ||
764 | } | ||
765 | } | ||
766 | |||
711 | void acpi_irq_stats_init(void) | 767 | void acpi_irq_stats_init(void) |
712 | { | 768 | { |
713 | acpi_status status; | 769 | acpi_status status; |
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index a5e1262b964b..2997026b4dfb 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
@@ -626,6 +626,7 @@ static int genpd_runtime_resume(struct device *dev) | |||
626 | 626 | ||
627 | out: | 627 | out: |
628 | /* Measure resume latency. */ | 628 | /* Measure resume latency. */ |
629 | time_start = 0; | ||
629 | if (timed && runtime_pm) | 630 | if (timed && runtime_pm) |
630 | time_start = ktime_get(); | 631 | time_start = ktime_get(); |
631 | 632 | ||
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c index bc97b6a4b1cf..7fcaf26e8f81 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c | |||
@@ -26,6 +26,8 @@ static const struct of_device_id machines[] __initconst = { | |||
26 | { .compatible = "allwinner,sun8i-a83t", }, | 26 | { .compatible = "allwinner,sun8i-a83t", }, |
27 | { .compatible = "allwinner,sun8i-h3", }, | 27 | { .compatible = "allwinner,sun8i-h3", }, |
28 | 28 | ||
29 | { .compatible = "apm,xgene-shadowcat", }, | ||
30 | |||
29 | { .compatible = "arm,integrator-ap", }, | 31 | { .compatible = "arm,integrator-ap", }, |
30 | { .compatible = "arm,integrator-cp", }, | 32 | { .compatible = "arm,integrator-cp", }, |
31 | 33 | ||
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 6acbd4af632e..f91c25718d16 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -857,13 +857,13 @@ static struct freq_attr *hwp_cpufreq_attrs[] = { | |||
857 | NULL, | 857 | NULL, |
858 | }; | 858 | }; |
859 | 859 | ||
860 | static void intel_pstate_hwp_set(const struct cpumask *cpumask) | 860 | static void intel_pstate_hwp_set(struct cpufreq_policy *policy) |
861 | { | 861 | { |
862 | int min, hw_min, max, hw_max, cpu, range, adj_range; | 862 | int min, hw_min, max, hw_max, cpu, range, adj_range; |
863 | struct perf_limits *perf_limits = limits; | 863 | struct perf_limits *perf_limits = limits; |
864 | u64 value, cap; | 864 | u64 value, cap; |
865 | 865 | ||
866 | for_each_cpu(cpu, cpumask) { | 866 | for_each_cpu(cpu, policy->cpus) { |
867 | int max_perf_pct, min_perf_pct; | 867 | int max_perf_pct, min_perf_pct; |
868 | struct cpudata *cpu_data = all_cpu_data[cpu]; | 868 | struct cpudata *cpu_data = all_cpu_data[cpu]; |
869 | s16 epp; | 869 | s16 epp; |
@@ -949,7 +949,7 @@ skip_epp: | |||
949 | static int intel_pstate_hwp_set_policy(struct cpufreq_policy *policy) | 949 | static int intel_pstate_hwp_set_policy(struct cpufreq_policy *policy) |
950 | { | 950 | { |
951 | if (hwp_active) | 951 | if (hwp_active) |
952 | intel_pstate_hwp_set(policy->cpus); | 952 | intel_pstate_hwp_set(policy); |
953 | 953 | ||
954 | return 0; | 954 | return 0; |
955 | } | 955 | } |
@@ -968,19 +968,28 @@ static int intel_pstate_hwp_save_state(struct cpufreq_policy *policy) | |||
968 | 968 | ||
969 | static int intel_pstate_resume(struct cpufreq_policy *policy) | 969 | static int intel_pstate_resume(struct cpufreq_policy *policy) |
970 | { | 970 | { |
971 | int ret; | ||
972 | |||
971 | if (!hwp_active) | 973 | if (!hwp_active) |
972 | return 0; | 974 | return 0; |
973 | 975 | ||
976 | mutex_lock(&intel_pstate_limits_lock); | ||
977 | |||
974 | all_cpu_data[policy->cpu]->epp_policy = 0; | 978 | all_cpu_data[policy->cpu]->epp_policy = 0; |
975 | 979 | ||
976 | return intel_pstate_hwp_set_policy(policy); | 980 | ret = intel_pstate_hwp_set_policy(policy); |
981 | |||
982 | mutex_unlock(&intel_pstate_limits_lock); | ||
983 | |||
984 | return ret; | ||
977 | } | 985 | } |
978 | 986 | ||
979 | static void intel_pstate_hwp_set_online_cpus(void) | 987 | static void intel_pstate_update_policies(void) |
980 | { | 988 | { |
981 | get_online_cpus(); | 989 | int cpu; |
982 | intel_pstate_hwp_set(cpu_online_mask); | 990 | |
983 | put_online_cpus(); | 991 | for_each_possible_cpu(cpu) |
992 | cpufreq_update_policy(cpu); | ||
984 | } | 993 | } |
985 | 994 | ||
986 | /************************** debugfs begin ************************/ | 995 | /************************** debugfs begin ************************/ |
@@ -1018,10 +1027,6 @@ static void __init intel_pstate_debug_expose_params(void) | |||
1018 | struct dentry *debugfs_parent; | 1027 | struct dentry *debugfs_parent; |
1019 | int i = 0; | 1028 | int i = 0; |
1020 | 1029 | ||
1021 | if (hwp_active || | ||
1022 | pstate_funcs.get_target_pstate == get_target_pstate_use_cpu_load) | ||
1023 | return; | ||
1024 | |||
1025 | debugfs_parent = debugfs_create_dir("pstate_snb", NULL); | 1030 | debugfs_parent = debugfs_create_dir("pstate_snb", NULL); |
1026 | if (IS_ERR_OR_NULL(debugfs_parent)) | 1031 | if (IS_ERR_OR_NULL(debugfs_parent)) |
1027 | return; | 1032 | return; |
@@ -1105,11 +1110,10 @@ static ssize_t store_no_turbo(struct kobject *a, struct attribute *b, | |||
1105 | 1110 | ||
1106 | limits->no_turbo = clamp_t(int, input, 0, 1); | 1111 | limits->no_turbo = clamp_t(int, input, 0, 1); |
1107 | 1112 | ||
1108 | if (hwp_active) | ||
1109 | intel_pstate_hwp_set_online_cpus(); | ||
1110 | |||
1111 | mutex_unlock(&intel_pstate_limits_lock); | 1113 | mutex_unlock(&intel_pstate_limits_lock); |
1112 | 1114 | ||
1115 | intel_pstate_update_policies(); | ||
1116 | |||
1113 | return count; | 1117 | return count; |
1114 | } | 1118 | } |
1115 | 1119 | ||
@@ -1134,11 +1138,10 @@ static ssize_t store_max_perf_pct(struct kobject *a, struct attribute *b, | |||
1134 | limits->max_perf_pct); | 1138 | limits->max_perf_pct); |
1135 | limits->max_perf = div_ext_fp(limits->max_perf_pct, 100); | 1139 | limits->max_perf = div_ext_fp(limits->max_perf_pct, 100); |
1136 | 1140 | ||
1137 | if (hwp_active) | ||
1138 | intel_pstate_hwp_set_online_cpus(); | ||
1139 | |||
1140 | mutex_unlock(&intel_pstate_limits_lock); | 1141 | mutex_unlock(&intel_pstate_limits_lock); |
1141 | 1142 | ||
1143 | intel_pstate_update_policies(); | ||
1144 | |||
1142 | return count; | 1145 | return count; |
1143 | } | 1146 | } |
1144 | 1147 | ||
@@ -1163,11 +1166,10 @@ static ssize_t store_min_perf_pct(struct kobject *a, struct attribute *b, | |||
1163 | limits->min_perf_pct); | 1166 | limits->min_perf_pct); |
1164 | limits->min_perf = div_ext_fp(limits->min_perf_pct, 100); | 1167 | limits->min_perf = div_ext_fp(limits->min_perf_pct, 100); |
1165 | 1168 | ||
1166 | if (hwp_active) | ||
1167 | intel_pstate_hwp_set_online_cpus(); | ||
1168 | |||
1169 | mutex_unlock(&intel_pstate_limits_lock); | 1169 | mutex_unlock(&intel_pstate_limits_lock); |
1170 | 1170 | ||
1171 | intel_pstate_update_policies(); | ||
1172 | |||
1171 | return count; | 1173 | return count; |
1172 | } | 1174 | } |
1173 | 1175 | ||
@@ -2153,8 +2155,12 @@ static int intel_cpufreq_verify_policy(struct cpufreq_policy *policy) | |||
2153 | if (per_cpu_limits) | 2155 | if (per_cpu_limits) |
2154 | perf_limits = cpu->perf_limits; | 2156 | perf_limits = cpu->perf_limits; |
2155 | 2157 | ||
2158 | mutex_lock(&intel_pstate_limits_lock); | ||
2159 | |||
2156 | intel_pstate_update_perf_limits(policy, perf_limits); | 2160 | intel_pstate_update_perf_limits(policy, perf_limits); |
2157 | 2161 | ||
2162 | mutex_unlock(&intel_pstate_limits_lock); | ||
2163 | |||
2158 | return 0; | 2164 | return 0; |
2159 | } | 2165 | } |
2160 | 2166 | ||
@@ -2487,7 +2493,10 @@ hwp_cpu_matched: | |||
2487 | if (rc) | 2493 | if (rc) |
2488 | goto out; | 2494 | goto out; |
2489 | 2495 | ||
2490 | intel_pstate_debug_expose_params(); | 2496 | if (intel_pstate_driver == &intel_pstate && !hwp_active && |
2497 | pstate_funcs.get_target_pstate != get_target_pstate_use_cpu_load) | ||
2498 | intel_pstate_debug_expose_params(); | ||
2499 | |||
2491 | intel_pstate_sysfs_expose_params(); | 2500 | intel_pstate_sysfs_expose_params(); |
2492 | 2501 | ||
2493 | if (hwp_active) | 2502 | if (hwp_active) |
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index a324801d6a66..47206a21bb90 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c | |||
@@ -593,11 +593,16 @@ struct devfreq *devfreq_add_device(struct device *dev, | |||
593 | list_add(&devfreq->node, &devfreq_list); | 593 | list_add(&devfreq->node, &devfreq_list); |
594 | 594 | ||
595 | governor = find_devfreq_governor(devfreq->governor_name); | 595 | governor = find_devfreq_governor(devfreq->governor_name); |
596 | if (!IS_ERR(governor)) | 596 | if (IS_ERR(governor)) { |
597 | devfreq->governor = governor; | 597 | dev_err(dev, "%s: Unable to find governor for the device\n", |
598 | if (devfreq->governor) | 598 | __func__); |
599 | err = devfreq->governor->event_handler(devfreq, | 599 | err = PTR_ERR(governor); |
600 | DEVFREQ_GOV_START, NULL); | 600 | goto err_init; |
601 | } | ||
602 | |||
603 | devfreq->governor = governor; | ||
604 | err = devfreq->governor->event_handler(devfreq, DEVFREQ_GOV_START, | ||
605 | NULL); | ||
601 | if (err) { | 606 | if (err) { |
602 | dev_err(dev, "%s: Unable to start governor for the device\n", | 607 | dev_err(dev, "%s: Unable to start governor for the device\n", |
603 | __func__); | 608 | __func__); |
diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index a8ed7792ece2..9af86f46fbec 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c | |||
@@ -497,7 +497,7 @@ passive: | |||
497 | if (IS_ERR(bus->devfreq)) { | 497 | if (IS_ERR(bus->devfreq)) { |
498 | dev_err(dev, | 498 | dev_err(dev, |
499 | "failed to add devfreq dev with passive governor\n"); | 499 | "failed to add devfreq dev with passive governor\n"); |
500 | ret = -EPROBE_DEFER; | 500 | ret = PTR_ERR(bus->devfreq); |
501 | goto err; | 501 | goto err; |
502 | } | 502 | } |
503 | 503 | ||
diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c index 70e13230d8db..9ad0b1934be9 100644 --- a/drivers/firmware/arm_scpi.c +++ b/drivers/firmware/arm_scpi.c | |||
@@ -721,11 +721,17 @@ static int scpi_sensor_get_value(u16 sensor, u64 *val) | |||
721 | 721 | ||
722 | ret = scpi_send_message(CMD_SENSOR_VALUE, &id, sizeof(id), | 722 | ret = scpi_send_message(CMD_SENSOR_VALUE, &id, sizeof(id), |
723 | &buf, sizeof(buf)); | 723 | &buf, sizeof(buf)); |
724 | if (!ret) | 724 | if (ret) |
725 | return ret; | ||
726 | |||
727 | if (scpi_info->is_legacy) | ||
728 | /* only 32-bits supported, hi_val can be junk */ | ||
729 | *val = le32_to_cpu(buf.lo_val); | ||
730 | else | ||
725 | *val = (u64)le32_to_cpu(buf.hi_val) << 32 | | 731 | *val = (u64)le32_to_cpu(buf.hi_val) << 32 | |
726 | le32_to_cpu(buf.lo_val); | 732 | le32_to_cpu(buf.lo_val); |
727 | 733 | ||
728 | return ret; | 734 | return 0; |
729 | } | 735 | } |
730 | 736 | ||
731 | static int scpi_device_get_power_state(u16 dev_id) | 737 | static int scpi_device_get_power_state(u16 dev_id) |
diff --git a/drivers/firmware/psci_checker.c b/drivers/firmware/psci_checker.c index 44bdb78f837b..29d58feaf675 100644 --- a/drivers/firmware/psci_checker.c +++ b/drivers/firmware/psci_checker.c | |||
@@ -270,8 +270,7 @@ static int suspend_test_thread(void *arg) | |||
270 | struct cpuidle_device *dev; | 270 | struct cpuidle_device *dev; |
271 | struct cpuidle_driver *drv; | 271 | struct cpuidle_driver *drv; |
272 | /* No need for an actual callback, we just want to wake up the CPU. */ | 272 | /* No need for an actual callback, we just want to wake up the CPU. */ |
273 | struct timer_list wakeup_timer = | 273 | struct timer_list wakeup_timer; |
274 | TIMER_INITIALIZER(dummy_callback, 0, 0); | ||
275 | 274 | ||
276 | /* Wait for the main thread to give the start signal. */ | 275 | /* Wait for the main thread to give the start signal. */ |
277 | wait_for_completion(&suspend_threads_started); | 276 | wait_for_completion(&suspend_threads_started); |
@@ -287,6 +286,7 @@ static int suspend_test_thread(void *arg) | |||
287 | pr_info("CPU %d entering suspend cycles, states 1 through %d\n", | 286 | pr_info("CPU %d entering suspend cycles, states 1 through %d\n", |
288 | cpu, drv->state_count - 1); | 287 | cpu, drv->state_count - 1); |
289 | 288 | ||
289 | setup_timer_on_stack(&wakeup_timer, dummy_callback, 0); | ||
290 | for (i = 0; i < NUM_SUSPEND_CYCLE; ++i) { | 290 | for (i = 0; i < NUM_SUSPEND_CYCLE; ++i) { |
291 | int index; | 291 | int index; |
292 | /* | 292 | /* |
diff --git a/drivers/gpu/drm/i915/gvt/cfg_space.c b/drivers/gpu/drm/i915/gvt/cfg_space.c index db516382a4d4..711c31c8d8b4 100644 --- a/drivers/gpu/drm/i915/gvt/cfg_space.c +++ b/drivers/gpu/drm/i915/gvt/cfg_space.c | |||
@@ -123,6 +123,7 @@ static int emulate_pci_command_write(struct intel_vgpu *vgpu, | |||
123 | u8 changed = old ^ new; | 123 | u8 changed = old ^ new; |
124 | int ret; | 124 | int ret; |
125 | 125 | ||
126 | memcpy(vgpu_cfg_space(vgpu) + offset, p_data, bytes); | ||
126 | if (!(changed & PCI_COMMAND_MEMORY)) | 127 | if (!(changed & PCI_COMMAND_MEMORY)) |
127 | return 0; | 128 | return 0; |
128 | 129 | ||
@@ -142,7 +143,6 @@ static int emulate_pci_command_write(struct intel_vgpu *vgpu, | |||
142 | return ret; | 143 | return ret; |
143 | } | 144 | } |
144 | 145 | ||
145 | memcpy(vgpu_cfg_space(vgpu) + offset, p_data, bytes); | ||
146 | return 0; | 146 | return 0; |
147 | } | 147 | } |
148 | 148 | ||
@@ -240,7 +240,7 @@ int intel_vgpu_emulate_cfg_write(struct intel_vgpu *vgpu, unsigned int offset, | |||
240 | if (WARN_ON(bytes > 4)) | 240 | if (WARN_ON(bytes > 4)) |
241 | return -EINVAL; | 241 | return -EINVAL; |
242 | 242 | ||
243 | if (WARN_ON(offset + bytes >= INTEL_GVT_MAX_CFG_SPACE_SZ)) | 243 | if (WARN_ON(offset + bytes > INTEL_GVT_MAX_CFG_SPACE_SZ)) |
244 | return -EINVAL; | 244 | return -EINVAL; |
245 | 245 | ||
246 | /* First check if it's PCI_COMMAND */ | 246 | /* First check if it's PCI_COMMAND */ |
diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c index 7eaaf1c9ed2b..6c5fdf5b2ce2 100644 --- a/drivers/gpu/drm/i915/gvt/gtt.c +++ b/drivers/gpu/drm/i915/gvt/gtt.c | |||
@@ -1998,6 +1998,8 @@ int intel_vgpu_init_gtt(struct intel_vgpu *vgpu) | |||
1998 | INIT_LIST_HEAD(>t->oos_page_list_head); | 1998 | INIT_LIST_HEAD(>t->oos_page_list_head); |
1999 | INIT_LIST_HEAD(>t->post_shadow_list_head); | 1999 | INIT_LIST_HEAD(>t->post_shadow_list_head); |
2000 | 2000 | ||
2001 | intel_vgpu_reset_ggtt(vgpu); | ||
2002 | |||
2001 | ggtt_mm = intel_vgpu_create_mm(vgpu, INTEL_GVT_MM_GGTT, | 2003 | ggtt_mm = intel_vgpu_create_mm(vgpu, INTEL_GVT_MM_GGTT, |
2002 | NULL, 1, 0); | 2004 | NULL, 1, 0); |
2003 | if (IS_ERR(ggtt_mm)) { | 2005 | if (IS_ERR(ggtt_mm)) { |
@@ -2206,6 +2208,7 @@ int intel_vgpu_g2v_destroy_ppgtt_mm(struct intel_vgpu *vgpu, | |||
2206 | int intel_gvt_init_gtt(struct intel_gvt *gvt) | 2208 | int intel_gvt_init_gtt(struct intel_gvt *gvt) |
2207 | { | 2209 | { |
2208 | int ret; | 2210 | int ret; |
2211 | void *page_addr; | ||
2209 | 2212 | ||
2210 | gvt_dbg_core("init gtt\n"); | 2213 | gvt_dbg_core("init gtt\n"); |
2211 | 2214 | ||
@@ -2218,6 +2221,23 @@ int intel_gvt_init_gtt(struct intel_gvt *gvt) | |||
2218 | return -ENODEV; | 2221 | return -ENODEV; |
2219 | } | 2222 | } |
2220 | 2223 | ||
2224 | gvt->gtt.scratch_ggtt_page = | ||
2225 | alloc_page(GFP_KERNEL | GFP_ATOMIC | __GFP_ZERO); | ||
2226 | if (!gvt->gtt.scratch_ggtt_page) { | ||
2227 | gvt_err("fail to allocate scratch ggtt page\n"); | ||
2228 | return -ENOMEM; | ||
2229 | } | ||
2230 | |||
2231 | page_addr = page_address(gvt->gtt.scratch_ggtt_page); | ||
2232 | |||
2233 | gvt->gtt.scratch_ggtt_mfn = | ||
2234 | intel_gvt_hypervisor_virt_to_mfn(page_addr); | ||
2235 | if (gvt->gtt.scratch_ggtt_mfn == INTEL_GVT_INVALID_ADDR) { | ||
2236 | gvt_err("fail to translate scratch ggtt page\n"); | ||
2237 | __free_page(gvt->gtt.scratch_ggtt_page); | ||
2238 | return -EFAULT; | ||
2239 | } | ||
2240 | |||
2221 | if (enable_out_of_sync) { | 2241 | if (enable_out_of_sync) { |
2222 | ret = setup_spt_oos(gvt); | 2242 | ret = setup_spt_oos(gvt); |
2223 | if (ret) { | 2243 | if (ret) { |
@@ -2239,6 +2259,41 @@ int intel_gvt_init_gtt(struct intel_gvt *gvt) | |||
2239 | */ | 2259 | */ |
2240 | void intel_gvt_clean_gtt(struct intel_gvt *gvt) | 2260 | void intel_gvt_clean_gtt(struct intel_gvt *gvt) |
2241 | { | 2261 | { |
2262 | __free_page(gvt->gtt.scratch_ggtt_page); | ||
2263 | |||
2242 | if (enable_out_of_sync) | 2264 | if (enable_out_of_sync) |
2243 | clean_spt_oos(gvt); | 2265 | clean_spt_oos(gvt); |
2244 | } | 2266 | } |
2267 | |||
2268 | /** | ||
2269 | * intel_vgpu_reset_ggtt - reset the GGTT entry | ||
2270 | * @vgpu: a vGPU | ||
2271 | * | ||
2272 | * This function is called at the vGPU create stage | ||
2273 | * to reset all the GGTT entries. | ||
2274 | * | ||
2275 | */ | ||
2276 | void intel_vgpu_reset_ggtt(struct intel_vgpu *vgpu) | ||
2277 | { | ||
2278 | struct intel_gvt *gvt = vgpu->gvt; | ||
2279 | struct intel_gvt_gtt_pte_ops *ops = vgpu->gvt->gtt.pte_ops; | ||
2280 | u32 index; | ||
2281 | u32 offset; | ||
2282 | u32 num_entries; | ||
2283 | struct intel_gvt_gtt_entry e; | ||
2284 | |||
2285 | memset(&e, 0, sizeof(struct intel_gvt_gtt_entry)); | ||
2286 | e.type = GTT_TYPE_GGTT_PTE; | ||
2287 | ops->set_pfn(&e, gvt->gtt.scratch_ggtt_mfn); | ||
2288 | e.val64 |= _PAGE_PRESENT; | ||
2289 | |||
2290 | index = vgpu_aperture_gmadr_base(vgpu) >> PAGE_SHIFT; | ||
2291 | num_entries = vgpu_aperture_sz(vgpu) >> PAGE_SHIFT; | ||
2292 | for (offset = 0; offset < num_entries; offset++) | ||
2293 | ops->set_entry(NULL, &e, index + offset, false, 0, vgpu); | ||
2294 | |||
2295 | index = vgpu_hidden_gmadr_base(vgpu) >> PAGE_SHIFT; | ||
2296 | num_entries = vgpu_hidden_sz(vgpu) >> PAGE_SHIFT; | ||
2297 | for (offset = 0; offset < num_entries; offset++) | ||
2298 | ops->set_entry(NULL, &e, index + offset, false, 0, vgpu); | ||
2299 | } | ||
diff --git a/drivers/gpu/drm/i915/gvt/gtt.h b/drivers/gpu/drm/i915/gvt/gtt.h index d250013bc37b..b315ab3593ec 100644 --- a/drivers/gpu/drm/i915/gvt/gtt.h +++ b/drivers/gpu/drm/i915/gvt/gtt.h | |||
@@ -81,6 +81,9 @@ struct intel_gvt_gtt { | |||
81 | struct list_head oos_page_use_list_head; | 81 | struct list_head oos_page_use_list_head; |
82 | struct list_head oos_page_free_list_head; | 82 | struct list_head oos_page_free_list_head; |
83 | struct list_head mm_lru_list_head; | 83 | struct list_head mm_lru_list_head; |
84 | |||
85 | struct page *scratch_ggtt_page; | ||
86 | unsigned long scratch_ggtt_mfn; | ||
84 | }; | 87 | }; |
85 | 88 | ||
86 | enum { | 89 | enum { |
@@ -202,6 +205,7 @@ struct intel_vgpu_gtt { | |||
202 | 205 | ||
203 | extern int intel_vgpu_init_gtt(struct intel_vgpu *vgpu); | 206 | extern int intel_vgpu_init_gtt(struct intel_vgpu *vgpu); |
204 | extern void intel_vgpu_clean_gtt(struct intel_vgpu *vgpu); | 207 | extern void intel_vgpu_clean_gtt(struct intel_vgpu *vgpu); |
208 | void intel_vgpu_reset_ggtt(struct intel_vgpu *vgpu); | ||
205 | 209 | ||
206 | extern int intel_gvt_init_gtt(struct intel_gvt *gvt); | 210 | extern int intel_gvt_init_gtt(struct intel_gvt *gvt); |
207 | extern void intel_gvt_clean_gtt(struct intel_gvt *gvt); | 211 | extern void intel_gvt_clean_gtt(struct intel_gvt *gvt); |
diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h index ad0e9364ee70..0af17016f33f 100644 --- a/drivers/gpu/drm/i915/gvt/gvt.h +++ b/drivers/gpu/drm/i915/gvt/gvt.h | |||
@@ -175,6 +175,7 @@ struct intel_vgpu { | |||
175 | struct notifier_block group_notifier; | 175 | struct notifier_block group_notifier; |
176 | struct kvm *kvm; | 176 | struct kvm *kvm; |
177 | struct work_struct release_work; | 177 | struct work_struct release_work; |
178 | atomic_t released; | ||
178 | } vdev; | 179 | } vdev; |
179 | #endif | 180 | #endif |
180 | }; | 181 | }; |
diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index 4dd6722a7339..faaae07ae487 100644 --- a/drivers/gpu/drm/i915/gvt/kvmgt.c +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c | |||
@@ -114,12 +114,15 @@ out: | |||
114 | static kvm_pfn_t gvt_cache_find(struct intel_vgpu *vgpu, gfn_t gfn) | 114 | static kvm_pfn_t gvt_cache_find(struct intel_vgpu *vgpu, gfn_t gfn) |
115 | { | 115 | { |
116 | struct gvt_dma *entry; | 116 | struct gvt_dma *entry; |
117 | kvm_pfn_t pfn; | ||
117 | 118 | ||
118 | mutex_lock(&vgpu->vdev.cache_lock); | 119 | mutex_lock(&vgpu->vdev.cache_lock); |
120 | |||
119 | entry = __gvt_cache_find(vgpu, gfn); | 121 | entry = __gvt_cache_find(vgpu, gfn); |
120 | mutex_unlock(&vgpu->vdev.cache_lock); | 122 | pfn = (entry == NULL) ? 0 : entry->pfn; |
121 | 123 | ||
122 | return entry == NULL ? 0 : entry->pfn; | 124 | mutex_unlock(&vgpu->vdev.cache_lock); |
125 | return pfn; | ||
123 | } | 126 | } |
124 | 127 | ||
125 | static void gvt_cache_add(struct intel_vgpu *vgpu, gfn_t gfn, kvm_pfn_t pfn) | 128 | static void gvt_cache_add(struct intel_vgpu *vgpu, gfn_t gfn, kvm_pfn_t pfn) |
@@ -166,7 +169,7 @@ static void __gvt_cache_remove_entry(struct intel_vgpu *vgpu, | |||
166 | 169 | ||
167 | static void gvt_cache_remove(struct intel_vgpu *vgpu, gfn_t gfn) | 170 | static void gvt_cache_remove(struct intel_vgpu *vgpu, gfn_t gfn) |
168 | { | 171 | { |
169 | struct device *dev = &vgpu->vdev.mdev->dev; | 172 | struct device *dev = mdev_dev(vgpu->vdev.mdev); |
170 | struct gvt_dma *this; | 173 | struct gvt_dma *this; |
171 | unsigned long g1; | 174 | unsigned long g1; |
172 | int rc; | 175 | int rc; |
@@ -195,7 +198,7 @@ static void gvt_cache_destroy(struct intel_vgpu *vgpu) | |||
195 | { | 198 | { |
196 | struct gvt_dma *dma; | 199 | struct gvt_dma *dma; |
197 | struct rb_node *node = NULL; | 200 | struct rb_node *node = NULL; |
198 | struct device *dev = &vgpu->vdev.mdev->dev; | 201 | struct device *dev = mdev_dev(vgpu->vdev.mdev); |
199 | unsigned long gfn; | 202 | unsigned long gfn; |
200 | 203 | ||
201 | mutex_lock(&vgpu->vdev.cache_lock); | 204 | mutex_lock(&vgpu->vdev.cache_lock); |
@@ -396,7 +399,7 @@ static int intel_vgpu_create(struct kobject *kobj, struct mdev_device *mdev) | |||
396 | struct device *pdev; | 399 | struct device *pdev; |
397 | void *gvt; | 400 | void *gvt; |
398 | 401 | ||
399 | pdev = mdev->parent->dev; | 402 | pdev = mdev_parent_dev(mdev); |
400 | gvt = kdev_to_i915(pdev)->gvt; | 403 | gvt = kdev_to_i915(pdev)->gvt; |
401 | 404 | ||
402 | type = intel_gvt_find_vgpu_type(gvt, kobject_name(kobj)); | 405 | type = intel_gvt_find_vgpu_type(gvt, kobject_name(kobj)); |
@@ -418,7 +421,7 @@ static int intel_vgpu_create(struct kobject *kobj, struct mdev_device *mdev) | |||
418 | mdev_set_drvdata(mdev, vgpu); | 421 | mdev_set_drvdata(mdev, vgpu); |
419 | 422 | ||
420 | gvt_dbg_core("intel_vgpu_create succeeded for mdev: %s\n", | 423 | gvt_dbg_core("intel_vgpu_create succeeded for mdev: %s\n", |
421 | dev_name(&mdev->dev)); | 424 | dev_name(mdev_dev(mdev))); |
422 | return 0; | 425 | return 0; |
423 | } | 426 | } |
424 | 427 | ||
@@ -482,7 +485,7 @@ static int intel_vgpu_open(struct mdev_device *mdev) | |||
482 | vgpu->vdev.group_notifier.notifier_call = intel_vgpu_group_notifier; | 485 | vgpu->vdev.group_notifier.notifier_call = intel_vgpu_group_notifier; |
483 | 486 | ||
484 | events = VFIO_IOMMU_NOTIFY_DMA_UNMAP; | 487 | events = VFIO_IOMMU_NOTIFY_DMA_UNMAP; |
485 | ret = vfio_register_notifier(&mdev->dev, VFIO_IOMMU_NOTIFY, &events, | 488 | ret = vfio_register_notifier(mdev_dev(mdev), VFIO_IOMMU_NOTIFY, &events, |
486 | &vgpu->vdev.iommu_notifier); | 489 | &vgpu->vdev.iommu_notifier); |
487 | if (ret != 0) { | 490 | if (ret != 0) { |
488 | gvt_err("vfio_register_notifier for iommu failed: %d\n", ret); | 491 | gvt_err("vfio_register_notifier for iommu failed: %d\n", ret); |
@@ -490,17 +493,26 @@ static int intel_vgpu_open(struct mdev_device *mdev) | |||
490 | } | 493 | } |
491 | 494 | ||
492 | events = VFIO_GROUP_NOTIFY_SET_KVM; | 495 | events = VFIO_GROUP_NOTIFY_SET_KVM; |
493 | ret = vfio_register_notifier(&mdev->dev, VFIO_GROUP_NOTIFY, &events, | 496 | ret = vfio_register_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY, &events, |
494 | &vgpu->vdev.group_notifier); | 497 | &vgpu->vdev.group_notifier); |
495 | if (ret != 0) { | 498 | if (ret != 0) { |
496 | gvt_err("vfio_register_notifier for group failed: %d\n", ret); | 499 | gvt_err("vfio_register_notifier for group failed: %d\n", ret); |
497 | goto undo_iommu; | 500 | goto undo_iommu; |
498 | } | 501 | } |
499 | 502 | ||
500 | return kvmgt_guest_init(mdev); | 503 | ret = kvmgt_guest_init(mdev); |
504 | if (ret) | ||
505 | goto undo_group; | ||
506 | |||
507 | atomic_set(&vgpu->vdev.released, 0); | ||
508 | return ret; | ||
509 | |||
510 | undo_group: | ||
511 | vfio_unregister_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY, | ||
512 | &vgpu->vdev.group_notifier); | ||
501 | 513 | ||
502 | undo_iommu: | 514 | undo_iommu: |
503 | vfio_unregister_notifier(&mdev->dev, VFIO_IOMMU_NOTIFY, | 515 | vfio_unregister_notifier(mdev_dev(mdev), VFIO_IOMMU_NOTIFY, |
504 | &vgpu->vdev.iommu_notifier); | 516 | &vgpu->vdev.iommu_notifier); |
505 | out: | 517 | out: |
506 | return ret; | 518 | return ret; |
@@ -509,17 +521,26 @@ out: | |||
509 | static void __intel_vgpu_release(struct intel_vgpu *vgpu) | 521 | static void __intel_vgpu_release(struct intel_vgpu *vgpu) |
510 | { | 522 | { |
511 | struct kvmgt_guest_info *info; | 523 | struct kvmgt_guest_info *info; |
524 | int ret; | ||
512 | 525 | ||
513 | if (!handle_valid(vgpu->handle)) | 526 | if (!handle_valid(vgpu->handle)) |
514 | return; | 527 | return; |
515 | 528 | ||
516 | vfio_unregister_notifier(&vgpu->vdev.mdev->dev, VFIO_IOMMU_NOTIFY, | 529 | if (atomic_cmpxchg(&vgpu->vdev.released, 0, 1)) |
530 | return; | ||
531 | |||
532 | ret = vfio_unregister_notifier(mdev_dev(vgpu->vdev.mdev), VFIO_IOMMU_NOTIFY, | ||
517 | &vgpu->vdev.iommu_notifier); | 533 | &vgpu->vdev.iommu_notifier); |
518 | vfio_unregister_notifier(&vgpu->vdev.mdev->dev, VFIO_GROUP_NOTIFY, | 534 | WARN(ret, "vfio_unregister_notifier for iommu failed: %d\n", ret); |
535 | |||
536 | ret = vfio_unregister_notifier(mdev_dev(vgpu->vdev.mdev), VFIO_GROUP_NOTIFY, | ||
519 | &vgpu->vdev.group_notifier); | 537 | &vgpu->vdev.group_notifier); |
538 | WARN(ret, "vfio_unregister_notifier for group failed: %d\n", ret); | ||
520 | 539 | ||
521 | info = (struct kvmgt_guest_info *)vgpu->handle; | 540 | info = (struct kvmgt_guest_info *)vgpu->handle; |
522 | kvmgt_guest_exit(info); | 541 | kvmgt_guest_exit(info); |
542 | |||
543 | vgpu->vdev.kvm = NULL; | ||
523 | vgpu->handle = 0; | 544 | vgpu->handle = 0; |
524 | } | 545 | } |
525 | 546 | ||
@@ -534,6 +555,7 @@ static void intel_vgpu_release_work(struct work_struct *work) | |||
534 | { | 555 | { |
535 | struct intel_vgpu *vgpu = container_of(work, struct intel_vgpu, | 556 | struct intel_vgpu *vgpu = container_of(work, struct intel_vgpu, |
536 | vdev.release_work); | 557 | vdev.release_work); |
558 | |||
537 | __intel_vgpu_release(vgpu); | 559 | __intel_vgpu_release(vgpu); |
538 | } | 560 | } |
539 | 561 | ||
@@ -1089,7 +1111,7 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd, | |||
1089 | return 0; | 1111 | return 0; |
1090 | } | 1112 | } |
1091 | 1113 | ||
1092 | static const struct parent_ops intel_vgpu_ops = { | 1114 | static const struct mdev_parent_ops intel_vgpu_ops = { |
1093 | .supported_type_groups = intel_vgpu_type_groups, | 1115 | .supported_type_groups = intel_vgpu_type_groups, |
1094 | .create = intel_vgpu_create, | 1116 | .create = intel_vgpu_create, |
1095 | .remove = intel_vgpu_remove, | 1117 | .remove = intel_vgpu_remove, |
@@ -1134,6 +1156,10 @@ static int kvmgt_write_protect_add(unsigned long handle, u64 gfn) | |||
1134 | 1156 | ||
1135 | idx = srcu_read_lock(&kvm->srcu); | 1157 | idx = srcu_read_lock(&kvm->srcu); |
1136 | slot = gfn_to_memslot(kvm, gfn); | 1158 | slot = gfn_to_memslot(kvm, gfn); |
1159 | if (!slot) { | ||
1160 | srcu_read_unlock(&kvm->srcu, idx); | ||
1161 | return -EINVAL; | ||
1162 | } | ||
1137 | 1163 | ||
1138 | spin_lock(&kvm->mmu_lock); | 1164 | spin_lock(&kvm->mmu_lock); |
1139 | 1165 | ||
@@ -1164,6 +1190,10 @@ static int kvmgt_write_protect_remove(unsigned long handle, u64 gfn) | |||
1164 | 1190 | ||
1165 | idx = srcu_read_lock(&kvm->srcu); | 1191 | idx = srcu_read_lock(&kvm->srcu); |
1166 | slot = gfn_to_memslot(kvm, gfn); | 1192 | slot = gfn_to_memslot(kvm, gfn); |
1193 | if (!slot) { | ||
1194 | srcu_read_unlock(&kvm->srcu, idx); | ||
1195 | return -EINVAL; | ||
1196 | } | ||
1167 | 1197 | ||
1168 | spin_lock(&kvm->mmu_lock); | 1198 | spin_lock(&kvm->mmu_lock); |
1169 | 1199 | ||
@@ -1311,18 +1341,14 @@ static int kvmgt_guest_init(struct mdev_device *mdev) | |||
1311 | 1341 | ||
1312 | static bool kvmgt_guest_exit(struct kvmgt_guest_info *info) | 1342 | static bool kvmgt_guest_exit(struct kvmgt_guest_info *info) |
1313 | { | 1343 | { |
1314 | struct intel_vgpu *vgpu; | ||
1315 | |||
1316 | if (!info) { | 1344 | if (!info) { |
1317 | gvt_err("kvmgt_guest_info invalid\n"); | 1345 | gvt_err("kvmgt_guest_info invalid\n"); |
1318 | return false; | 1346 | return false; |
1319 | } | 1347 | } |
1320 | 1348 | ||
1321 | vgpu = info->vgpu; | ||
1322 | |||
1323 | kvm_page_track_unregister_notifier(info->kvm, &info->track_node); | 1349 | kvm_page_track_unregister_notifier(info->kvm, &info->track_node); |
1324 | kvmgt_protect_table_destroy(info); | 1350 | kvmgt_protect_table_destroy(info); |
1325 | gvt_cache_destroy(vgpu); | 1351 | gvt_cache_destroy(info->vgpu); |
1326 | vfree(info); | 1352 | vfree(info); |
1327 | 1353 | ||
1328 | return true; | 1354 | return true; |
@@ -1372,7 +1398,7 @@ static unsigned long kvmgt_gfn_to_pfn(unsigned long handle, unsigned long gfn) | |||
1372 | return pfn; | 1398 | return pfn; |
1373 | 1399 | ||
1374 | pfn = INTEL_GVT_INVALID_ADDR; | 1400 | pfn = INTEL_GVT_INVALID_ADDR; |
1375 | dev = &info->vgpu->vdev.mdev->dev; | 1401 | dev = mdev_dev(info->vgpu->vdev.mdev); |
1376 | rc = vfio_pin_pages(dev, &gfn, 1, IOMMU_READ | IOMMU_WRITE, &pfn); | 1402 | rc = vfio_pin_pages(dev, &gfn, 1, IOMMU_READ | IOMMU_WRITE, &pfn); |
1377 | if (rc != 1) { | 1403 | if (rc != 1) { |
1378 | gvt_err("vfio_pin_pages failed for gfn 0x%lx: %d\n", gfn, rc); | 1404 | gvt_err("vfio_pin_pages failed for gfn 0x%lx: %d\n", gfn, rc); |
diff --git a/drivers/gpu/drm/i915/gvt/opregion.c b/drivers/gpu/drm/i915/gvt/opregion.c index d2a0fbc896c3..81cd921770c6 100644 --- a/drivers/gpu/drm/i915/gvt/opregion.c +++ b/drivers/gpu/drm/i915/gvt/opregion.c | |||
@@ -65,7 +65,7 @@ static int map_vgpu_opregion(struct intel_vgpu *vgpu, bool map) | |||
65 | int i, ret; | 65 | int i, ret; |
66 | 66 | ||
67 | for (i = 0; i < INTEL_GVT_OPREGION_PAGES; i++) { | 67 | for (i = 0; i < INTEL_GVT_OPREGION_PAGES; i++) { |
68 | mfn = intel_gvt_hypervisor_virt_to_mfn(vgpu_opregion(vgpu) | 68 | mfn = intel_gvt_hypervisor_virt_to_mfn(vgpu_opregion(vgpu)->va |
69 | + i * PAGE_SIZE); | 69 | + i * PAGE_SIZE); |
70 | if (mfn == INTEL_GVT_INVALID_ADDR) { | 70 | if (mfn == INTEL_GVT_INVALID_ADDR) { |
71 | gvt_err("fail to get MFN from VA\n"); | 71 | gvt_err("fail to get MFN from VA\n"); |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 4a31b7a891ec..3dd7fc662859 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -244,14 +244,16 @@ err_phys: | |||
244 | 244 | ||
245 | static void | 245 | static void |
246 | __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj, | 246 | __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj, |
247 | struct sg_table *pages) | 247 | struct sg_table *pages, |
248 | bool needs_clflush) | ||
248 | { | 249 | { |
249 | GEM_BUG_ON(obj->mm.madv == __I915_MADV_PURGED); | 250 | GEM_BUG_ON(obj->mm.madv == __I915_MADV_PURGED); |
250 | 251 | ||
251 | if (obj->mm.madv == I915_MADV_DONTNEED) | 252 | if (obj->mm.madv == I915_MADV_DONTNEED) |
252 | obj->mm.dirty = false; | 253 | obj->mm.dirty = false; |
253 | 254 | ||
254 | if ((obj->base.read_domains & I915_GEM_DOMAIN_CPU) == 0 && | 255 | if (needs_clflush && |
256 | (obj->base.read_domains & I915_GEM_DOMAIN_CPU) == 0 && | ||
255 | !cpu_cache_is_coherent(obj->base.dev, obj->cache_level)) | 257 | !cpu_cache_is_coherent(obj->base.dev, obj->cache_level)) |
256 | drm_clflush_sg(pages); | 258 | drm_clflush_sg(pages); |
257 | 259 | ||
@@ -263,7 +265,7 @@ static void | |||
263 | i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj, | 265 | i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj, |
264 | struct sg_table *pages) | 266 | struct sg_table *pages) |
265 | { | 267 | { |
266 | __i915_gem_object_release_shmem(obj, pages); | 268 | __i915_gem_object_release_shmem(obj, pages, false); |
267 | 269 | ||
268 | if (obj->mm.dirty) { | 270 | if (obj->mm.dirty) { |
269 | struct address_space *mapping = obj->base.filp->f_mapping; | 271 | struct address_space *mapping = obj->base.filp->f_mapping; |
@@ -2231,7 +2233,7 @@ i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj, | |||
2231 | struct sgt_iter sgt_iter; | 2233 | struct sgt_iter sgt_iter; |
2232 | struct page *page; | 2234 | struct page *page; |
2233 | 2235 | ||
2234 | __i915_gem_object_release_shmem(obj, pages); | 2236 | __i915_gem_object_release_shmem(obj, pages, true); |
2235 | 2237 | ||
2236 | i915_gem_gtt_finish_pages(obj, pages); | 2238 | i915_gem_gtt_finish_pages(obj, pages); |
2237 | 2239 | ||
@@ -2304,15 +2306,6 @@ unlock: | |||
2304 | mutex_unlock(&obj->mm.lock); | 2306 | mutex_unlock(&obj->mm.lock); |
2305 | } | 2307 | } |
2306 | 2308 | ||
2307 | static unsigned int swiotlb_max_size(void) | ||
2308 | { | ||
2309 | #if IS_ENABLED(CONFIG_SWIOTLB) | ||
2310 | return rounddown(swiotlb_nr_tbl() << IO_TLB_SHIFT, PAGE_SIZE); | ||
2311 | #else | ||
2312 | return 0; | ||
2313 | #endif | ||
2314 | } | ||
2315 | |||
2316 | static void i915_sg_trim(struct sg_table *orig_st) | 2309 | static void i915_sg_trim(struct sg_table *orig_st) |
2317 | { | 2310 | { |
2318 | struct sg_table new_st; | 2311 | struct sg_table new_st; |
@@ -2322,7 +2315,7 @@ static void i915_sg_trim(struct sg_table *orig_st) | |||
2322 | if (orig_st->nents == orig_st->orig_nents) | 2315 | if (orig_st->nents == orig_st->orig_nents) |
2323 | return; | 2316 | return; |
2324 | 2317 | ||
2325 | if (sg_alloc_table(&new_st, orig_st->nents, GFP_KERNEL)) | 2318 | if (sg_alloc_table(&new_st, orig_st->nents, GFP_KERNEL | __GFP_NOWARN)) |
2326 | return; | 2319 | return; |
2327 | 2320 | ||
2328 | new_sg = new_st.sgl; | 2321 | new_sg = new_st.sgl; |
@@ -2360,7 +2353,7 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) | |||
2360 | GEM_BUG_ON(obj->base.read_domains & I915_GEM_GPU_DOMAINS); | 2353 | GEM_BUG_ON(obj->base.read_domains & I915_GEM_GPU_DOMAINS); |
2361 | GEM_BUG_ON(obj->base.write_domain & I915_GEM_GPU_DOMAINS); | 2354 | GEM_BUG_ON(obj->base.write_domain & I915_GEM_GPU_DOMAINS); |
2362 | 2355 | ||
2363 | max_segment = swiotlb_max_size(); | 2356 | max_segment = swiotlb_max_segment(); |
2364 | if (!max_segment) | 2357 | if (!max_segment) |
2365 | max_segment = rounddown(UINT_MAX, PAGE_SIZE); | 2358 | max_segment = rounddown(UINT_MAX, PAGE_SIZE); |
2366 | 2359 | ||
@@ -2728,6 +2721,7 @@ static void i915_gem_reset_engine(struct intel_engine_cs *engine) | |||
2728 | struct drm_i915_gem_request *request; | 2721 | struct drm_i915_gem_request *request; |
2729 | struct i915_gem_context *incomplete_ctx; | 2722 | struct i915_gem_context *incomplete_ctx; |
2730 | struct intel_timeline *timeline; | 2723 | struct intel_timeline *timeline; |
2724 | unsigned long flags; | ||
2731 | bool ring_hung; | 2725 | bool ring_hung; |
2732 | 2726 | ||
2733 | if (engine->irq_seqno_barrier) | 2727 | if (engine->irq_seqno_barrier) |
@@ -2763,13 +2757,20 @@ static void i915_gem_reset_engine(struct intel_engine_cs *engine) | |||
2763 | if (i915_gem_context_is_default(incomplete_ctx)) | 2757 | if (i915_gem_context_is_default(incomplete_ctx)) |
2764 | return; | 2758 | return; |
2765 | 2759 | ||
2760 | timeline = i915_gem_context_lookup_timeline(incomplete_ctx, engine); | ||
2761 | |||
2762 | spin_lock_irqsave(&engine->timeline->lock, flags); | ||
2763 | spin_lock(&timeline->lock); | ||
2764 | |||
2766 | list_for_each_entry_continue(request, &engine->timeline->requests, link) | 2765 | list_for_each_entry_continue(request, &engine->timeline->requests, link) |
2767 | if (request->ctx == incomplete_ctx) | 2766 | if (request->ctx == incomplete_ctx) |
2768 | reset_request(request); | 2767 | reset_request(request); |
2769 | 2768 | ||
2770 | timeline = i915_gem_context_lookup_timeline(incomplete_ctx, engine); | ||
2771 | list_for_each_entry(request, &timeline->requests, link) | 2769 | list_for_each_entry(request, &timeline->requests, link) |
2772 | reset_request(request); | 2770 | reset_request(request); |
2771 | |||
2772 | spin_unlock(&timeline->lock); | ||
2773 | spin_unlock_irqrestore(&engine->timeline->lock, flags); | ||
2773 | } | 2774 | } |
2774 | 2775 | ||
2775 | void i915_gem_reset(struct drm_i915_private *dev_priv) | 2776 | void i915_gem_reset(struct drm_i915_private *dev_priv) |
diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h index e2b077df2da0..d229f47d1028 100644 --- a/drivers/gpu/drm/i915/i915_gem_request.h +++ b/drivers/gpu/drm/i915/i915_gem_request.h | |||
@@ -413,6 +413,25 @@ i915_gem_active_set(struct i915_gem_active *active, | |||
413 | rcu_assign_pointer(active->request, request); | 413 | rcu_assign_pointer(active->request, request); |
414 | } | 414 | } |
415 | 415 | ||
416 | /** | ||
417 | * i915_gem_active_set_retire_fn - updates the retirement callback | ||
418 | * @active - the active tracker | ||
419 | * @fn - the routine called when the request is retired | ||
420 | * @mutex - struct_mutex used to guard retirements | ||
421 | * | ||
422 | * i915_gem_active_set_retire_fn() updates the function pointer that | ||
423 | * is called when the final request associated with the @active tracker | ||
424 | * is retired. | ||
425 | */ | ||
426 | static inline void | ||
427 | i915_gem_active_set_retire_fn(struct i915_gem_active *active, | ||
428 | i915_gem_retire_fn fn, | ||
429 | struct mutex *mutex) | ||
430 | { | ||
431 | lockdep_assert_held(mutex); | ||
432 | active->retire = fn ?: i915_gem_retire_noop; | ||
433 | } | ||
434 | |||
416 | static inline struct drm_i915_gem_request * | 435 | static inline struct drm_i915_gem_request * |
417 | __i915_gem_active_peek(const struct i915_gem_active *active) | 436 | __i915_gem_active_peek(const struct i915_gem_active *active) |
418 | { | 437 | { |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 6daad8613760..3dc8724df400 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -16791,7 +16791,6 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) | |||
16791 | 16791 | ||
16792 | for_each_intel_crtc(dev, crtc) { | 16792 | for_each_intel_crtc(dev, crtc) { |
16793 | struct intel_crtc_state *crtc_state = crtc->config; | 16793 | struct intel_crtc_state *crtc_state = crtc->config; |
16794 | int pixclk = 0; | ||
16795 | 16794 | ||
16796 | __drm_atomic_helper_crtc_destroy_state(&crtc_state->base); | 16795 | __drm_atomic_helper_crtc_destroy_state(&crtc_state->base); |
16797 | memset(crtc_state, 0, sizeof(*crtc_state)); | 16796 | memset(crtc_state, 0, sizeof(*crtc_state)); |
@@ -16803,23 +16802,9 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) | |||
16803 | crtc->base.enabled = crtc_state->base.enable; | 16802 | crtc->base.enabled = crtc_state->base.enable; |
16804 | crtc->active = crtc_state->base.active; | 16803 | crtc->active = crtc_state->base.active; |
16805 | 16804 | ||
16806 | if (crtc_state->base.active) { | 16805 | if (crtc_state->base.active) |
16807 | dev_priv->active_crtcs |= 1 << crtc->pipe; | 16806 | dev_priv->active_crtcs |= 1 << crtc->pipe; |
16808 | 16807 | ||
16809 | if (INTEL_GEN(dev_priv) >= 9 || IS_BROADWELL(dev_priv)) | ||
16810 | pixclk = ilk_pipe_pixel_rate(crtc_state); | ||
16811 | else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) | ||
16812 | pixclk = crtc_state->base.adjusted_mode.crtc_clock; | ||
16813 | else | ||
16814 | WARN_ON(dev_priv->display.modeset_calc_cdclk); | ||
16815 | |||
16816 | /* pixel rate mustn't exceed 95% of cdclk with IPS on BDW */ | ||
16817 | if (IS_BROADWELL(dev_priv) && crtc_state->ips_enabled) | ||
16818 | pixclk = DIV_ROUND_UP(pixclk * 100, 95); | ||
16819 | } | ||
16820 | |||
16821 | dev_priv->min_pixclk[crtc->pipe] = pixclk; | ||
16822 | |||
16823 | readout_plane_state(crtc); | 16808 | readout_plane_state(crtc); |
16824 | 16809 | ||
16825 | DRM_DEBUG_KMS("[CRTC:%d:%s] hw state readout: %s\n", | 16810 | DRM_DEBUG_KMS("[CRTC:%d:%s] hw state readout: %s\n", |
@@ -16892,6 +16877,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) | |||
16892 | } | 16877 | } |
16893 | 16878 | ||
16894 | for_each_intel_crtc(dev, crtc) { | 16879 | for_each_intel_crtc(dev, crtc) { |
16880 | int pixclk = 0; | ||
16881 | |||
16895 | crtc->base.hwmode = crtc->config->base.adjusted_mode; | 16882 | crtc->base.hwmode = crtc->config->base.adjusted_mode; |
16896 | 16883 | ||
16897 | memset(&crtc->base.mode, 0, sizeof(crtc->base.mode)); | 16884 | memset(&crtc->base.mode, 0, sizeof(crtc->base.mode)); |
@@ -16919,10 +16906,23 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) | |||
16919 | */ | 16906 | */ |
16920 | crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED; | 16907 | crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED; |
16921 | 16908 | ||
16909 | if (INTEL_GEN(dev_priv) >= 9 || IS_BROADWELL(dev_priv)) | ||
16910 | pixclk = ilk_pipe_pixel_rate(crtc->config); | ||
16911 | else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) | ||
16912 | pixclk = crtc->config->base.adjusted_mode.crtc_clock; | ||
16913 | else | ||
16914 | WARN_ON(dev_priv->display.modeset_calc_cdclk); | ||
16915 | |||
16916 | /* pixel rate mustn't exceed 95% of cdclk with IPS on BDW */ | ||
16917 | if (IS_BROADWELL(dev_priv) && crtc->config->ips_enabled) | ||
16918 | pixclk = DIV_ROUND_UP(pixclk * 100, 95); | ||
16919 | |||
16922 | drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode); | 16920 | drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode); |
16923 | update_scanline_offset(crtc); | 16921 | update_scanline_offset(crtc); |
16924 | } | 16922 | } |
16925 | 16923 | ||
16924 | dev_priv->min_pixclk[crtc->pipe] = pixclk; | ||
16925 | |||
16926 | intel_pipe_config_sanity_check(dev_priv, crtc->config); | 16926 | intel_pipe_config_sanity_check(dev_priv, crtc->config); |
16927 | } | 16927 | } |
16928 | } | 16928 | } |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index d9bc19be855e..0b8e8eb85c19 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -355,7 +355,8 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev, | |||
355 | struct intel_dp *intel_dp); | 355 | struct intel_dp *intel_dp); |
356 | static void | 356 | static void |
357 | intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev, | 357 | intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev, |
358 | struct intel_dp *intel_dp); | 358 | struct intel_dp *intel_dp, |
359 | bool force_disable_vdd); | ||
359 | static void | 360 | static void |
360 | intel_dp_pps_init(struct drm_device *dev, struct intel_dp *intel_dp); | 361 | intel_dp_pps_init(struct drm_device *dev, struct intel_dp *intel_dp); |
361 | 362 | ||
@@ -516,7 +517,7 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp) | |||
516 | 517 | ||
517 | /* init power sequencer on this pipe and port */ | 518 | /* init power sequencer on this pipe and port */ |
518 | intel_dp_init_panel_power_sequencer(dev, intel_dp); | 519 | intel_dp_init_panel_power_sequencer(dev, intel_dp); |
519 | intel_dp_init_panel_power_sequencer_registers(dev, intel_dp); | 520 | intel_dp_init_panel_power_sequencer_registers(dev, intel_dp, true); |
520 | 521 | ||
521 | /* | 522 | /* |
522 | * Even vdd force doesn't work until we've made | 523 | * Even vdd force doesn't work until we've made |
@@ -553,7 +554,7 @@ bxt_power_sequencer_idx(struct intel_dp *intel_dp) | |||
553 | * Only the HW needs to be reprogrammed, the SW state is fixed and | 554 | * Only the HW needs to be reprogrammed, the SW state is fixed and |
554 | * has been setup during connector init. | 555 | * has been setup during connector init. |
555 | */ | 556 | */ |
556 | intel_dp_init_panel_power_sequencer_registers(dev, intel_dp); | 557 | intel_dp_init_panel_power_sequencer_registers(dev, intel_dp, false); |
557 | 558 | ||
558 | return 0; | 559 | return 0; |
559 | } | 560 | } |
@@ -636,7 +637,7 @@ vlv_initial_power_sequencer_setup(struct intel_dp *intel_dp) | |||
636 | port_name(port), pipe_name(intel_dp->pps_pipe)); | 637 | port_name(port), pipe_name(intel_dp->pps_pipe)); |
637 | 638 | ||
638 | intel_dp_init_panel_power_sequencer(dev, intel_dp); | 639 | intel_dp_init_panel_power_sequencer(dev, intel_dp); |
639 | intel_dp_init_panel_power_sequencer_registers(dev, intel_dp); | 640 | intel_dp_init_panel_power_sequencer_registers(dev, intel_dp, false); |
640 | } | 641 | } |
641 | 642 | ||
642 | void intel_power_sequencer_reset(struct drm_i915_private *dev_priv) | 643 | void intel_power_sequencer_reset(struct drm_i915_private *dev_priv) |
@@ -2912,7 +2913,7 @@ static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp) | |||
2912 | 2913 | ||
2913 | /* init power sequencer on this pipe and port */ | 2914 | /* init power sequencer on this pipe and port */ |
2914 | intel_dp_init_panel_power_sequencer(dev, intel_dp); | 2915 | intel_dp_init_panel_power_sequencer(dev, intel_dp); |
2915 | intel_dp_init_panel_power_sequencer_registers(dev, intel_dp); | 2916 | intel_dp_init_panel_power_sequencer_registers(dev, intel_dp, true); |
2916 | } | 2917 | } |
2917 | 2918 | ||
2918 | static void vlv_pre_enable_dp(struct intel_encoder *encoder, | 2919 | static void vlv_pre_enable_dp(struct intel_encoder *encoder, |
@@ -5055,7 +5056,8 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev, | |||
5055 | 5056 | ||
5056 | static void | 5057 | static void |
5057 | intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev, | 5058 | intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev, |
5058 | struct intel_dp *intel_dp) | 5059 | struct intel_dp *intel_dp, |
5060 | bool force_disable_vdd) | ||
5059 | { | 5061 | { |
5060 | struct drm_i915_private *dev_priv = to_i915(dev); | 5062 | struct drm_i915_private *dev_priv = to_i915(dev); |
5061 | u32 pp_on, pp_off, pp_div, port_sel = 0; | 5063 | u32 pp_on, pp_off, pp_div, port_sel = 0; |
@@ -5068,6 +5070,31 @@ intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev, | |||
5068 | 5070 | ||
5069 | intel_pps_get_registers(dev_priv, intel_dp, ®s); | 5071 | intel_pps_get_registers(dev_priv, intel_dp, ®s); |
5070 | 5072 | ||
5073 | /* | ||
5074 | * On some VLV machines the BIOS can leave the VDD | ||
5075 | * enabled even on power seqeuencers which aren't | ||
5076 | * hooked up to any port. This would mess up the | ||
5077 | * power domain tracking the first time we pick | ||
5078 | * one of these power sequencers for use since | ||
5079 | * edp_panel_vdd_on() would notice that the VDD was | ||
5080 | * already on and therefore wouldn't grab the power | ||
5081 | * domain reference. Disable VDD first to avoid this. | ||
5082 | * This also avoids spuriously turning the VDD on as | ||
5083 | * soon as the new power seqeuencer gets initialized. | ||
5084 | */ | ||
5085 | if (force_disable_vdd) { | ||
5086 | u32 pp = ironlake_get_pp_control(intel_dp); | ||
5087 | |||
5088 | WARN(pp & PANEL_POWER_ON, "Panel power already on\n"); | ||
5089 | |||
5090 | if (pp & EDP_FORCE_VDD) | ||
5091 | DRM_DEBUG_KMS("VDD already on, disabling first\n"); | ||
5092 | |||
5093 | pp &= ~EDP_FORCE_VDD; | ||
5094 | |||
5095 | I915_WRITE(regs.pp_ctrl, pp); | ||
5096 | } | ||
5097 | |||
5071 | pp_on = (seq->t1_t3 << PANEL_POWER_UP_DELAY_SHIFT) | | 5098 | pp_on = (seq->t1_t3 << PANEL_POWER_UP_DELAY_SHIFT) | |
5072 | (seq->t8 << PANEL_LIGHT_ON_DELAY_SHIFT); | 5099 | (seq->t8 << PANEL_LIGHT_ON_DELAY_SHIFT); |
5073 | pp_off = (seq->t9 << PANEL_LIGHT_OFF_DELAY_SHIFT) | | 5100 | pp_off = (seq->t9 << PANEL_LIGHT_OFF_DELAY_SHIFT) | |
@@ -5122,7 +5149,7 @@ static void intel_dp_pps_init(struct drm_device *dev, | |||
5122 | vlv_initial_power_sequencer_setup(intel_dp); | 5149 | vlv_initial_power_sequencer_setup(intel_dp); |
5123 | } else { | 5150 | } else { |
5124 | intel_dp_init_panel_power_sequencer(dev, intel_dp); | 5151 | intel_dp_init_panel_power_sequencer(dev, intel_dp); |
5125 | intel_dp_init_panel_power_sequencer_registers(dev, intel_dp); | 5152 | intel_dp_init_panel_power_sequencer_registers(dev, intel_dp, false); |
5126 | } | 5153 | } |
5127 | } | 5154 | } |
5128 | 5155 | ||
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index fd0e4dac7cc1..e589e17876dc 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
@@ -216,7 +216,8 @@ static void intel_overlay_submit_request(struct intel_overlay *overlay, | |||
216 | { | 216 | { |
217 | GEM_BUG_ON(i915_gem_active_peek(&overlay->last_flip, | 217 | GEM_BUG_ON(i915_gem_active_peek(&overlay->last_flip, |
218 | &overlay->i915->drm.struct_mutex)); | 218 | &overlay->i915->drm.struct_mutex)); |
219 | overlay->last_flip.retire = retire; | 219 | i915_gem_active_set_retire_fn(&overlay->last_flip, retire, |
220 | &overlay->i915->drm.struct_mutex); | ||
220 | i915_gem_active_set(&overlay->last_flip, req); | 221 | i915_gem_active_set(&overlay->last_flip, req); |
221 | i915_add_request(req); | 222 | i915_add_request(req); |
222 | } | 223 | } |
@@ -839,8 +840,8 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay, | |||
839 | if (ret) | 840 | if (ret) |
840 | goto out_unpin; | 841 | goto out_unpin; |
841 | 842 | ||
842 | i915_gem_track_fb(overlay->vma->obj, new_bo, | 843 | i915_gem_track_fb(overlay->vma ? overlay->vma->obj : NULL, |
843 | INTEL_FRONTBUFFER_OVERLAY(pipe)); | 844 | vma->obj, INTEL_FRONTBUFFER_OVERLAY(pipe)); |
844 | 845 | ||
845 | overlay->old_vma = overlay->vma; | 846 | overlay->old_vma = overlay->vma; |
846 | overlay->vma = vma; | 847 | overlay->vma = vma; |
@@ -1430,6 +1431,8 @@ void intel_setup_overlay(struct drm_i915_private *dev_priv) | |||
1430 | overlay->contrast = 75; | 1431 | overlay->contrast = 75; |
1431 | overlay->saturation = 146; | 1432 | overlay->saturation = 146; |
1432 | 1433 | ||
1434 | init_request_active(&overlay->last_flip, NULL); | ||
1435 | |||
1433 | regs = intel_overlay_map_regs(overlay); | 1436 | regs = intel_overlay_map_regs(overlay); |
1434 | if (!regs) | 1437 | if (!regs) |
1435 | goto out_unpin_bo; | 1438 | goto out_unpin_bo; |
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index d40ed9fdf68d..70b12f89a193 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c | |||
@@ -64,7 +64,8 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad"); | |||
64 | #define QUIRK_SKIP_INPUT_MAPPING BIT(2) | 64 | #define QUIRK_SKIP_INPUT_MAPPING BIT(2) |
65 | #define QUIRK_IS_MULTITOUCH BIT(3) | 65 | #define QUIRK_IS_MULTITOUCH BIT(3) |
66 | 66 | ||
67 | #define NOTEBOOK_QUIRKS QUIRK_FIX_NOTEBOOK_REPORT | 67 | #define KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \ |
68 | QUIRK_NO_INIT_REPORTS) | ||
68 | #define TOUCHPAD_QUIRKS (QUIRK_NO_INIT_REPORTS | \ | 69 | #define TOUCHPAD_QUIRKS (QUIRK_NO_INIT_REPORTS | \ |
69 | QUIRK_SKIP_INPUT_MAPPING | \ | 70 | QUIRK_SKIP_INPUT_MAPPING | \ |
70 | QUIRK_IS_MULTITOUCH) | 71 | QUIRK_IS_MULTITOUCH) |
@@ -170,11 +171,11 @@ static int asus_raw_event(struct hid_device *hdev, | |||
170 | 171 | ||
171 | static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi) | 172 | static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi) |
172 | { | 173 | { |
174 | struct input_dev *input = hi->input; | ||
173 | struct asus_drvdata *drvdata = hid_get_drvdata(hdev); | 175 | struct asus_drvdata *drvdata = hid_get_drvdata(hdev); |
174 | 176 | ||
175 | if (drvdata->quirks & QUIRK_IS_MULTITOUCH) { | 177 | if (drvdata->quirks & QUIRK_IS_MULTITOUCH) { |
176 | int ret; | 178 | int ret; |
177 | struct input_dev *input = hi->input; | ||
178 | 179 | ||
179 | input_set_abs_params(input, ABS_MT_POSITION_X, 0, MAX_X, 0, 0); | 180 | input_set_abs_params(input, ABS_MT_POSITION_X, 0, MAX_X, 0, 0); |
180 | input_set_abs_params(input, ABS_MT_POSITION_Y, 0, MAX_Y, 0, 0); | 181 | input_set_abs_params(input, ABS_MT_POSITION_Y, 0, MAX_Y, 0, 0); |
@@ -191,10 +192,10 @@ static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi) | |||
191 | hid_err(hdev, "Asus input mt init slots failed: %d\n", ret); | 192 | hid_err(hdev, "Asus input mt init slots failed: %d\n", ret); |
192 | return ret; | 193 | return ret; |
193 | } | 194 | } |
194 | |||
195 | drvdata->input = input; | ||
196 | } | 195 | } |
197 | 196 | ||
197 | drvdata->input = input; | ||
198 | |||
198 | return 0; | 199 | return 0; |
199 | } | 200 | } |
200 | 201 | ||
@@ -286,7 +287,11 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
286 | goto err_stop_hw; | 287 | goto err_stop_hw; |
287 | } | 288 | } |
288 | 289 | ||
289 | drvdata->input->name = "Asus TouchPad"; | 290 | if (drvdata->quirks & QUIRK_IS_MULTITOUCH) { |
291 | drvdata->input->name = "Asus TouchPad"; | ||
292 | } else { | ||
293 | drvdata->input->name = "Asus Keyboard"; | ||
294 | } | ||
290 | 295 | ||
291 | if (drvdata->quirks & QUIRK_IS_MULTITOUCH) { | 296 | if (drvdata->quirks & QUIRK_IS_MULTITOUCH) { |
292 | ret = asus_start_multitouch(hdev); | 297 | ret = asus_start_multitouch(hdev); |
@@ -315,7 +320,7 @@ static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
315 | 320 | ||
316 | static const struct hid_device_id asus_devices[] = { | 321 | static const struct hid_device_id asus_devices[] = { |
317 | { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, | 322 | { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, |
318 | USB_DEVICE_ID_ASUSTEK_NOTEBOOK_KEYBOARD), NOTEBOOK_QUIRKS}, | 323 | USB_DEVICE_ID_ASUSTEK_NOTEBOOK_KEYBOARD), KEYBOARD_QUIRKS}, |
319 | { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, | 324 | { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, |
320 | USB_DEVICE_ID_ASUSTEK_TOUCHPAD), TOUCHPAD_QUIRKS }, | 325 | USB_DEVICE_ID_ASUSTEK_TOUCHPAD), TOUCHPAD_QUIRKS }, |
321 | { } | 326 | { } |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index ec277b96eaa1..54bd22dc1411 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -319,6 +319,7 @@ | |||
319 | #define USB_VENDOR_ID_DRAGONRISE 0x0079 | 319 | #define USB_VENDOR_ID_DRAGONRISE 0x0079 |
320 | #define USB_DEVICE_ID_DRAGONRISE_WIIU 0x1800 | 320 | #define USB_DEVICE_ID_DRAGONRISE_WIIU 0x1800 |
321 | #define USB_DEVICE_ID_DRAGONRISE_PS3 0x1801 | 321 | #define USB_DEVICE_ID_DRAGONRISE_PS3 0x1801 |
322 | #define USB_DEVICE_ID_DRAGONRISE_DOLPHINBAR 0x1803 | ||
322 | #define USB_DEVICE_ID_DRAGONRISE_GAMECUBE 0x1843 | 323 | #define USB_DEVICE_ID_DRAGONRISE_GAMECUBE 0x1843 |
323 | 324 | ||
324 | #define USB_VENDOR_ID_DWAV 0x0eef | 325 | #define USB_VENDOR_ID_DWAV 0x0eef |
@@ -365,6 +366,9 @@ | |||
365 | #define USB_VENDOR_ID_FLATFROG 0x25b5 | 366 | #define USB_VENDOR_ID_FLATFROG 0x25b5 |
366 | #define USB_DEVICE_ID_MULTITOUCH_3200 0x0002 | 367 | #define USB_DEVICE_ID_MULTITOUCH_3200 0x0002 |
367 | 368 | ||
369 | #define USB_VENDOR_ID_FUTABA 0x0547 | ||
370 | #define USB_DEVICE_ID_LED_DISPLAY 0x7000 | ||
371 | |||
368 | #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f | 372 | #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f |
369 | #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 | 373 | #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 |
370 | 374 | ||
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index 5c925228847c..4ef73374a8f9 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c | |||
@@ -212,7 +212,6 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | |||
212 | __s32 value; | 212 | __s32 value; |
213 | int ret = 0; | 213 | int ret = 0; |
214 | 214 | ||
215 | memset(buffer, 0, buffer_size); | ||
216 | mutex_lock(&data->mutex); | 215 | mutex_lock(&data->mutex); |
217 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); | 216 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); |
218 | if (!report || (field_index >= report->maxfield)) { | 217 | if (!report || (field_index >= report->maxfield)) { |
@@ -256,6 +255,8 @@ int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | |||
256 | int buffer_index = 0; | 255 | int buffer_index = 0; |
257 | int i; | 256 | int i; |
258 | 257 | ||
258 | memset(buffer, 0, buffer_size); | ||
259 | |||
259 | mutex_lock(&data->mutex); | 260 | mutex_lock(&data->mutex); |
260 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); | 261 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); |
261 | if (!report || (field_index >= report->maxfield) || | 262 | if (!report || (field_index >= report->maxfield) || |
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 7687c0875395..f405b07d0381 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
@@ -1099,8 +1099,11 @@ struct sony_sc { | |||
1099 | u8 led_delay_on[MAX_LEDS]; | 1099 | u8 led_delay_on[MAX_LEDS]; |
1100 | u8 led_delay_off[MAX_LEDS]; | 1100 | u8 led_delay_off[MAX_LEDS]; |
1101 | u8 led_count; | 1101 | u8 led_count; |
1102 | bool ds4_dongle_connected; | ||
1102 | }; | 1103 | }; |
1103 | 1104 | ||
1105 | static void sony_set_leds(struct sony_sc *sc); | ||
1106 | |||
1104 | static inline void sony_schedule_work(struct sony_sc *sc) | 1107 | static inline void sony_schedule_work(struct sony_sc *sc) |
1105 | { | 1108 | { |
1106 | if (!sc->defer_initialization) | 1109 | if (!sc->defer_initialization) |
@@ -1430,6 +1433,31 @@ static int sony_raw_event(struct hid_device *hdev, struct hid_report *report, | |||
1430 | return -EILSEQ; | 1433 | return -EILSEQ; |
1431 | } | 1434 | } |
1432 | } | 1435 | } |
1436 | |||
1437 | /* | ||
1438 | * In the case of a DS4 USB dongle, bit[2] of byte 31 indicates | ||
1439 | * if a DS4 is actually connected (indicated by '0'). | ||
1440 | * For non-dongle, this bit is always 0 (connected). | ||
1441 | */ | ||
1442 | if (sc->hdev->vendor == USB_VENDOR_ID_SONY && | ||
1443 | sc->hdev->product == USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) { | ||
1444 | bool connected = (rd[31] & 0x04) ? false : true; | ||
1445 | |||
1446 | if (!sc->ds4_dongle_connected && connected) { | ||
1447 | hid_info(sc->hdev, "DualShock 4 USB dongle: controller connected\n"); | ||
1448 | sony_set_leds(sc); | ||
1449 | sc->ds4_dongle_connected = true; | ||
1450 | } else if (sc->ds4_dongle_connected && !connected) { | ||
1451 | hid_info(sc->hdev, "DualShock 4 USB dongle: controller disconnected\n"); | ||
1452 | sc->ds4_dongle_connected = false; | ||
1453 | /* Return 0, so hidraw can get the report. */ | ||
1454 | return 0; | ||
1455 | } else if (!sc->ds4_dongle_connected) { | ||
1456 | /* Return 0, so hidraw can get the report. */ | ||
1457 | return 0; | ||
1458 | } | ||
1459 | } | ||
1460 | |||
1433 | dualshock4_parse_report(sc, rd, size); | 1461 | dualshock4_parse_report(sc, rd, size); |
1434 | } | 1462 | } |
1435 | 1463 | ||
@@ -2390,6 +2418,12 @@ static int sony_check_add(struct sony_sc *sc) | |||
2390 | } | 2418 | } |
2391 | 2419 | ||
2392 | memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address)); | 2420 | memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address)); |
2421 | |||
2422 | snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq), | ||
2423 | "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", | ||
2424 | sc->mac_address[5], sc->mac_address[4], | ||
2425 | sc->mac_address[3], sc->mac_address[2], | ||
2426 | sc->mac_address[1], sc->mac_address[0]); | ||
2393 | } else if ((sc->quirks & SIXAXIS_CONTROLLER_USB) || | 2427 | } else if ((sc->quirks & SIXAXIS_CONTROLLER_USB) || |
2394 | (sc->quirks & NAVIGATION_CONTROLLER_USB)) { | 2428 | (sc->quirks & NAVIGATION_CONTROLLER_USB)) { |
2395 | buf = kmalloc(SIXAXIS_REPORT_0xF2_SIZE, GFP_KERNEL); | 2429 | buf = kmalloc(SIXAXIS_REPORT_0xF2_SIZE, GFP_KERNEL); |
@@ -2548,7 +2582,7 @@ static int sony_input_configured(struct hid_device *hdev, | |||
2548 | hid_err(sc->hdev, | 2582 | hid_err(sc->hdev, |
2549 | "Unable to initialize multi-touch slots: %d\n", | 2583 | "Unable to initialize multi-touch slots: %d\n", |
2550 | ret); | 2584 | ret); |
2551 | return ret; | 2585 | goto err_stop; |
2552 | } | 2586 | } |
2553 | 2587 | ||
2554 | sony_init_output_report(sc, dualshock4_send_output_report); | 2588 | sony_init_output_report(sc, dualshock4_send_output_report); |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index b3e01c82af05..e9d6cc7cdfc5 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -83,11 +83,13 @@ static const struct hid_blacklist { | |||
83 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, | 83 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, |
84 | { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_WIIU, HID_QUIRK_MULTI_INPUT }, | 84 | { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_WIIU, HID_QUIRK_MULTI_INPUT }, |
85 | { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_PS3, HID_QUIRK_MULTI_INPUT }, | 85 | { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_PS3, HID_QUIRK_MULTI_INPUT }, |
86 | { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_DOLPHINBAR, HID_QUIRK_MULTI_INPUT }, | ||
86 | { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_GAMECUBE, HID_QUIRK_MULTI_INPUT }, | 87 | { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_GAMECUBE, HID_QUIRK_MULTI_INPUT }, |
87 | { USB_VENDOR_ID_ELAN, HID_ANY_ID, HID_QUIRK_ALWAYS_POLL }, | 88 | { USB_VENDOR_ID_ELAN, HID_ANY_ID, HID_QUIRK_ALWAYS_POLL }, |
88 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, | 89 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, |
89 | { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS }, | 90 | { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS }, |
90 | { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, | 91 | { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, |
92 | { USB_VENDOR_ID_FUTABA, USB_DEVICE_ID_LED_DISPLAY, HID_QUIRK_NO_INIT_REPORTS }, | ||
91 | { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0A4A, HID_QUIRK_ALWAYS_POLL }, | 93 | { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0A4A, HID_QUIRK_ALWAYS_POLL }, |
92 | { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A, HID_QUIRK_ALWAYS_POLL }, | 94 | { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A, HID_QUIRK_ALWAYS_POLL }, |
93 | { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE, HID_QUIRK_ALWAYS_POLL }, | 95 | { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE, HID_QUIRK_ALWAYS_POLL }, |
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index c8413fc120e6..7031a8dd4d14 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -1682,9 +1682,19 @@ static int __mlx4_ib_create_flow(struct ib_qp *qp, struct ib_flow_attr *flow_att | |||
1682 | size += ret; | 1682 | size += ret; |
1683 | } | 1683 | } |
1684 | 1684 | ||
1685 | if (mlx4_is_master(mdev->dev) && flow_type == MLX4_FS_REGULAR && | ||
1686 | flow_attr->num_of_specs == 1) { | ||
1687 | struct _rule_hw *rule_header = (struct _rule_hw *)(ctrl + 1); | ||
1688 | enum ib_flow_spec_type header_spec = | ||
1689 | ((union ib_flow_spec *)(flow_attr + 1))->type; | ||
1690 | |||
1691 | if (header_spec == IB_FLOW_SPEC_ETH) | ||
1692 | mlx4_handle_eth_header_mcast_prio(ctrl, rule_header); | ||
1693 | } | ||
1694 | |||
1685 | ret = mlx4_cmd_imm(mdev->dev, mailbox->dma, reg_id, size >> 2, 0, | 1695 | ret = mlx4_cmd_imm(mdev->dev, mailbox->dma, reg_id, size >> 2, 0, |
1686 | MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A, | 1696 | MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A, |
1687 | MLX4_CMD_WRAPPED); | 1697 | MLX4_CMD_NATIVE); |
1688 | if (ret == -ENOMEM) | 1698 | if (ret == -ENOMEM) |
1689 | pr_err("mcg table is full. Fail to register network rule.\n"); | 1699 | pr_err("mcg table is full. Fail to register network rule.\n"); |
1690 | else if (ret == -ENXIO) | 1700 | else if (ret == -ENXIO) |
@@ -1701,7 +1711,7 @@ static int __mlx4_ib_destroy_flow(struct mlx4_dev *dev, u64 reg_id) | |||
1701 | int err; | 1711 | int err; |
1702 | err = mlx4_cmd(dev, reg_id, 0, 0, | 1712 | err = mlx4_cmd(dev, reg_id, 0, 0, |
1703 | MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A, | 1713 | MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A, |
1704 | MLX4_CMD_WRAPPED); | 1714 | MLX4_CMD_NATIVE); |
1705 | if (err) | 1715 | if (err) |
1706 | pr_err("Fail to detach network rule. registration id = 0x%llx\n", | 1716 | pr_err("Fail to detach network rule. registration id = 0x%llx\n", |
1707 | reg_id); | 1717 | reg_id); |
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 019e02707cd5..3ef0f42984f2 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -1023,7 +1023,7 @@ again: | |||
1023 | next_tail = (tail + sizeof(*cmd)) % CMD_BUFFER_SIZE; | 1023 | next_tail = (tail + sizeof(*cmd)) % CMD_BUFFER_SIZE; |
1024 | left = (head - next_tail) % CMD_BUFFER_SIZE; | 1024 | left = (head - next_tail) % CMD_BUFFER_SIZE; |
1025 | 1025 | ||
1026 | if (left <= 2) { | 1026 | if (left <= 0x20) { |
1027 | struct iommu_cmd sync_cmd; | 1027 | struct iommu_cmd sync_cmd; |
1028 | int ret; | 1028 | int ret; |
1029 | 1029 | ||
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index a88576d50740..8ccbd7023194 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c | |||
@@ -903,8 +903,10 @@ int __init detect_intel_iommu(void) | |||
903 | x86_init.iommu.iommu_init = intel_iommu_init; | 903 | x86_init.iommu.iommu_init = intel_iommu_init; |
904 | #endif | 904 | #endif |
905 | 905 | ||
906 | acpi_put_table(dmar_tbl); | 906 | if (dmar_tbl) { |
907 | dmar_tbl = NULL; | 907 | acpi_put_table(dmar_tbl); |
908 | dmar_tbl = NULL; | ||
909 | } | ||
908 | up_write(&dmar_global_lock); | 910 | up_write(&dmar_global_lock); |
909 | 911 | ||
910 | return ret ? 1 : -ENODEV; | 912 | return ret ? 1 : -ENODEV; |
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index c66c273dfd8a..8a185250ae5a 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -2037,6 +2037,25 @@ static int domain_context_mapping_one(struct dmar_domain *domain, | |||
2037 | if (context_present(context)) | 2037 | if (context_present(context)) |
2038 | goto out_unlock; | 2038 | goto out_unlock; |
2039 | 2039 | ||
2040 | /* | ||
2041 | * For kdump cases, old valid entries may be cached due to the | ||
2042 | * in-flight DMA and copied pgtable, but there is no unmapping | ||
2043 | * behaviour for them, thus we need an explicit cache flush for | ||
2044 | * the newly-mapped device. For kdump, at this point, the device | ||
2045 | * is supposed to finish reset at its driver probe stage, so no | ||
2046 | * in-flight DMA will exist, and we don't need to worry anymore | ||
2047 | * hereafter. | ||
2048 | */ | ||
2049 | if (context_copied(context)) { | ||
2050 | u16 did_old = context_domain_id(context); | ||
2051 | |||
2052 | if (did_old >= 0 && did_old < cap_ndoms(iommu->cap)) | ||
2053 | iommu->flush.flush_context(iommu, did_old, | ||
2054 | (((u16)bus) << 8) | devfn, | ||
2055 | DMA_CCMD_MASK_NOBIT, | ||
2056 | DMA_CCMD_DEVICE_INVL); | ||
2057 | } | ||
2058 | |||
2040 | pgd = domain->pgd; | 2059 | pgd = domain->pgd; |
2041 | 2060 | ||
2042 | context_clear_entry(context); | 2061 | context_clear_entry(context); |
@@ -5185,6 +5204,25 @@ static void intel_iommu_remove_device(struct device *dev) | |||
5185 | } | 5204 | } |
5186 | 5205 | ||
5187 | #ifdef CONFIG_INTEL_IOMMU_SVM | 5206 | #ifdef CONFIG_INTEL_IOMMU_SVM |
5207 | #define MAX_NR_PASID_BITS (20) | ||
5208 | static inline unsigned long intel_iommu_get_pts(struct intel_iommu *iommu) | ||
5209 | { | ||
5210 | /* | ||
5211 | * Convert ecap_pss to extend context entry pts encoding, also | ||
5212 | * respect the soft pasid_max value set by the iommu. | ||
5213 | * - number of PASID bits = ecap_pss + 1 | ||
5214 | * - number of PASID table entries = 2^(pts + 5) | ||
5215 | * Therefore, pts = ecap_pss - 4 | ||
5216 | * e.g. KBL ecap_pss = 0x13, PASID has 20 bits, pts = 15 | ||
5217 | */ | ||
5218 | if (ecap_pss(iommu->ecap) < 5) | ||
5219 | return 0; | ||
5220 | |||
5221 | /* pasid_max is encoded as actual number of entries not the bits */ | ||
5222 | return find_first_bit((unsigned long *)&iommu->pasid_max, | ||
5223 | MAX_NR_PASID_BITS) - 5; | ||
5224 | } | ||
5225 | |||
5188 | int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct intel_svm_dev *sdev) | 5226 | int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct intel_svm_dev *sdev) |
5189 | { | 5227 | { |
5190 | struct device_domain_info *info; | 5228 | struct device_domain_info *info; |
@@ -5217,7 +5255,9 @@ int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct intel_svm_dev *sd | |||
5217 | 5255 | ||
5218 | if (!(ctx_lo & CONTEXT_PASIDE)) { | 5256 | if (!(ctx_lo & CONTEXT_PASIDE)) { |
5219 | context[1].hi = (u64)virt_to_phys(iommu->pasid_state_table); | 5257 | context[1].hi = (u64)virt_to_phys(iommu->pasid_state_table); |
5220 | context[1].lo = (u64)virt_to_phys(iommu->pasid_table) | ecap_pss(iommu->ecap); | 5258 | context[1].lo = (u64)virt_to_phys(iommu->pasid_table) | |
5259 | intel_iommu_get_pts(iommu); | ||
5260 | |||
5221 | wmb(); | 5261 | wmb(); |
5222 | /* CONTEXT_TT_MULTI_LEVEL and CONTEXT_TT_DEV_IOTLB are both | 5262 | /* CONTEXT_TT_MULTI_LEVEL and CONTEXT_TT_DEV_IOTLB are both |
5223 | * extended to permit requests-with-PASID if the PASIDE bit | 5263 | * extended to permit requests-with-PASID if the PASIDE bit |
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index 25d1eb4933d0..7e8cf213fd81 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c | |||
@@ -1012,15 +1012,6 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, | |||
1012 | goto out; | 1012 | goto out; |
1013 | } | 1013 | } |
1014 | 1014 | ||
1015 | /* Insert TSB and checksum infos */ | ||
1016 | if (priv->tsb_en) { | ||
1017 | skb = bcm_sysport_insert_tsb(skb, dev); | ||
1018 | if (!skb) { | ||
1019 | ret = NETDEV_TX_OK; | ||
1020 | goto out; | ||
1021 | } | ||
1022 | } | ||
1023 | |||
1024 | /* The Ethernet switch we are interfaced with needs packets to be at | 1015 | /* The Ethernet switch we are interfaced with needs packets to be at |
1025 | * least 64 bytes (including FCS) otherwise they will be discarded when | 1016 | * least 64 bytes (including FCS) otherwise they will be discarded when |
1026 | * they enter the switch port logic. When Broadcom tags are enabled, we | 1017 | * they enter the switch port logic. When Broadcom tags are enabled, we |
@@ -1028,13 +1019,21 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, | |||
1028 | * (including FCS and tag) because the length verification is done after | 1019 | * (including FCS and tag) because the length verification is done after |
1029 | * the Broadcom tag is stripped off the ingress packet. | 1020 | * the Broadcom tag is stripped off the ingress packet. |
1030 | */ | 1021 | */ |
1031 | if (skb_padto(skb, ETH_ZLEN + ENET_BRCM_TAG_LEN)) { | 1022 | if (skb_put_padto(skb, ETH_ZLEN + ENET_BRCM_TAG_LEN)) { |
1032 | ret = NETDEV_TX_OK; | 1023 | ret = NETDEV_TX_OK; |
1033 | goto out; | 1024 | goto out; |
1034 | } | 1025 | } |
1035 | 1026 | ||
1036 | skb_len = skb->len < ETH_ZLEN + ENET_BRCM_TAG_LEN ? | 1027 | /* Insert TSB and checksum infos */ |
1037 | ETH_ZLEN + ENET_BRCM_TAG_LEN : skb->len; | 1028 | if (priv->tsb_en) { |
1029 | skb = bcm_sysport_insert_tsb(skb, dev); | ||
1030 | if (!skb) { | ||
1031 | ret = NETDEV_TX_OK; | ||
1032 | goto out; | ||
1033 | } | ||
1034 | } | ||
1035 | |||
1036 | skb_len = skb->len; | ||
1038 | 1037 | ||
1039 | mapping = dma_map_single(kdev, skb->data, skb_len, DMA_TO_DEVICE); | 1038 | mapping = dma_map_single(kdev, skb->data, skb_len, DMA_TO_DEVICE); |
1040 | if (dma_mapping_error(kdev, mapping)) { | 1039 | if (dma_mapping_error(kdev, mapping)) { |
diff --git a/drivers/net/ethernet/cadence/macb_pci.c b/drivers/net/ethernet/cadence/macb_pci.c index 92be2cd8f817..9906fda76087 100644 --- a/drivers/net/ethernet/cadence/macb_pci.c +++ b/drivers/net/ethernet/cadence/macb_pci.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /** | 1 | /** |
2 | * macb_pci.c - Cadence GEM PCI wrapper. | 2 | * Cadence GEM PCI wrapper. |
3 | * | 3 | * |
4 | * Copyright (C) 2016 Cadence Design Systems - http://www.cadence.com | 4 | * Copyright (C) 2016 Cadence Design Systems - http://www.cadence.com |
5 | * | 5 | * |
@@ -45,32 +45,27 @@ static int macb_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
45 | struct macb_platform_data plat_data; | 45 | struct macb_platform_data plat_data; |
46 | struct resource res[2]; | 46 | struct resource res[2]; |
47 | 47 | ||
48 | /* sanity check */ | ||
49 | if (!id) | ||
50 | return -EINVAL; | ||
51 | |||
52 | /* enable pci device */ | 48 | /* enable pci device */ |
53 | err = pci_enable_device(pdev); | 49 | err = pcim_enable_device(pdev); |
54 | if (err < 0) { | 50 | if (err < 0) { |
55 | dev_err(&pdev->dev, "Enabling PCI device has failed: 0x%04X", | 51 | dev_err(&pdev->dev, "Enabling PCI device has failed: %d", err); |
56 | err); | 52 | return err; |
57 | return -EACCES; | ||
58 | } | 53 | } |
59 | 54 | ||
60 | pci_set_master(pdev); | 55 | pci_set_master(pdev); |
61 | 56 | ||
62 | /* set up resources */ | 57 | /* set up resources */ |
63 | memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res)); | 58 | memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res)); |
64 | res[0].start = pdev->resource[0].start; | 59 | res[0].start = pci_resource_start(pdev, 0); |
65 | res[0].end = pdev->resource[0].end; | 60 | res[0].end = pci_resource_end(pdev, 0); |
66 | res[0].name = PCI_DRIVER_NAME; | 61 | res[0].name = PCI_DRIVER_NAME; |
67 | res[0].flags = IORESOURCE_MEM; | 62 | res[0].flags = IORESOURCE_MEM; |
68 | res[1].start = pdev->irq; | 63 | res[1].start = pci_irq_vector(pdev, 0); |
69 | res[1].name = PCI_DRIVER_NAME; | 64 | res[1].name = PCI_DRIVER_NAME; |
70 | res[1].flags = IORESOURCE_IRQ; | 65 | res[1].flags = IORESOURCE_IRQ; |
71 | 66 | ||
72 | dev_info(&pdev->dev, "EMAC physical base addr = 0x%p\n", | 67 | dev_info(&pdev->dev, "EMAC physical base addr: %pa\n", |
73 | (void *)(uintptr_t)pci_resource_start(pdev, 0)); | 68 | &res[0].start); |
74 | 69 | ||
75 | /* set up macb platform data */ | 70 | /* set up macb platform data */ |
76 | memset(&plat_data, 0, sizeof(plat_data)); | 71 | memset(&plat_data, 0, sizeof(plat_data)); |
@@ -100,7 +95,7 @@ static int macb_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
100 | plat_info.num_res = ARRAY_SIZE(res); | 95 | plat_info.num_res = ARRAY_SIZE(res); |
101 | plat_info.data = &plat_data; | 96 | plat_info.data = &plat_data; |
102 | plat_info.size_data = sizeof(plat_data); | 97 | plat_info.size_data = sizeof(plat_data); |
103 | plat_info.dma_mask = DMA_BIT_MASK(32); | 98 | plat_info.dma_mask = pdev->dma_mask; |
104 | 99 | ||
105 | /* register platform device */ | 100 | /* register platform device */ |
106 | plat_dev = platform_device_register_full(&plat_info); | 101 | plat_dev = platform_device_register_full(&plat_info); |
@@ -120,7 +115,6 @@ err_hclk_register: | |||
120 | clk_unregister(plat_data.pclk); | 115 | clk_unregister(plat_data.pclk); |
121 | 116 | ||
122 | err_pclk_register: | 117 | err_pclk_register: |
123 | pci_disable_device(pdev); | ||
124 | return err; | 118 | return err; |
125 | } | 119 | } |
126 | 120 | ||
@@ -130,7 +124,6 @@ static void macb_remove(struct pci_dev *pdev) | |||
130 | struct macb_platform_data *plat_data = dev_get_platdata(&plat_dev->dev); | 124 | struct macb_platform_data *plat_data = dev_get_platdata(&plat_dev->dev); |
131 | 125 | ||
132 | platform_device_unregister(plat_dev); | 126 | platform_device_unregister(plat_dev); |
133 | pci_disable_device(pdev); | ||
134 | clk_unregister(plat_data->pclk); | 127 | clk_unregister(plat_data->pclk); |
135 | clk_unregister(plat_data->hclk); | 128 | clk_unregister(plat_data->hclk); |
136 | } | 129 | } |
diff --git a/drivers/net/ethernet/cavium/Kconfig b/drivers/net/ethernet/cavium/Kconfig index bbc8bd16cb97..dcbce6cac63e 100644 --- a/drivers/net/ethernet/cavium/Kconfig +++ b/drivers/net/ethernet/cavium/Kconfig | |||
@@ -77,7 +77,7 @@ config OCTEON_MGMT_ETHERNET | |||
77 | config LIQUIDIO_VF | 77 | config LIQUIDIO_VF |
78 | tristate "Cavium LiquidIO VF support" | 78 | tristate "Cavium LiquidIO VF support" |
79 | depends on 64BIT && PCI_MSI | 79 | depends on 64BIT && PCI_MSI |
80 | select PTP_1588_CLOCK | 80 | imply PTP_1588_CLOCK |
81 | ---help--- | 81 | ---help--- |
82 | This driver supports Cavium LiquidIO Intelligent Server Adapter | 82 | This driver supports Cavium LiquidIO Intelligent Server Adapter |
83 | based on CN23XX chips. | 83 | based on CN23XX chips. |
diff --git a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c index 0f0de5b63622..d04a6c163445 100644 --- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c +++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c | |||
@@ -133,17 +133,15 @@ cxgb_find_route6(struct cxgb4_lld_info *lldi, | |||
133 | if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL) | 133 | if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL) |
134 | fl6.flowi6_oif = sin6_scope_id; | 134 | fl6.flowi6_oif = sin6_scope_id; |
135 | dst = ip6_route_output(&init_net, NULL, &fl6); | 135 | dst = ip6_route_output(&init_net, NULL, &fl6); |
136 | if (!dst) | 136 | if (dst->error || |
137 | goto out; | 137 | (!cxgb_our_interface(lldi, get_real_dev, |
138 | if (!cxgb_our_interface(lldi, get_real_dev, | 138 | ip6_dst_idev(dst)->dev) && |
139 | ip6_dst_idev(dst)->dev) && | 139 | !(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK))) { |
140 | !(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK)) { | ||
141 | dst_release(dst); | 140 | dst_release(dst); |
142 | dst = NULL; | 141 | return NULL; |
143 | } | 142 | } |
144 | } | 143 | } |
145 | 144 | ||
146 | out: | ||
147 | return dst; | 145 | return dst; |
148 | } | 146 | } |
149 | EXPORT_SYMBOL(cxgb_find_route6); | 147 | EXPORT_SYMBOL(cxgb_find_route6); |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 7e1633bf5a22..225e9a4877d7 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -5155,7 +5155,9 @@ static netdev_features_t be_features_check(struct sk_buff *skb, | |||
5155 | skb->inner_protocol_type != ENCAP_TYPE_ETHER || | 5155 | skb->inner_protocol_type != ENCAP_TYPE_ETHER || |
5156 | skb->inner_protocol != htons(ETH_P_TEB) || | 5156 | skb->inner_protocol != htons(ETH_P_TEB) || |
5157 | skb_inner_mac_header(skb) - skb_transport_header(skb) != | 5157 | skb_inner_mac_header(skb) - skb_transport_header(skb) != |
5158 | sizeof(struct udphdr) + sizeof(struct vxlanhdr)) | 5158 | sizeof(struct udphdr) + sizeof(struct vxlanhdr) || |
5159 | !adapter->vxlan_port || | ||
5160 | udp_hdr(skb)->dest != adapter->vxlan_port) | ||
5159 | return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK); | 5161 | return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK); |
5160 | 5162 | ||
5161 | return features; | 5163 | return features; |
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 624ba9058dc4..c9b7ad65e563 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | |||
@@ -733,6 +733,7 @@ static int dpaa_eth_cgr_init(struct dpaa_priv *priv) | |||
733 | priv->cgr_data.cgr.cb = dpaa_eth_cgscn; | 733 | priv->cgr_data.cgr.cb = dpaa_eth_cgscn; |
734 | 734 | ||
735 | /* Enable Congestion State Change Notifications and CS taildrop */ | 735 | /* Enable Congestion State Change Notifications and CS taildrop */ |
736 | memset(&initcgr, 0, sizeof(initcgr)); | ||
736 | initcgr.we_mask = cpu_to_be16(QM_CGR_WE_CSCN_EN | QM_CGR_WE_CS_THRES); | 737 | initcgr.we_mask = cpu_to_be16(QM_CGR_WE_CSCN_EN | QM_CGR_WE_CS_THRES); |
737 | initcgr.cgr.cscn_en = QM_CGR_EN; | 738 | initcgr.cgr.cscn_en = QM_CGR_EN; |
738 | 739 | ||
@@ -2291,7 +2292,8 @@ static int dpaa_open(struct net_device *net_dev) | |||
2291 | net_dev->phydev = mac_dev->init_phy(net_dev, priv->mac_dev); | 2292 | net_dev->phydev = mac_dev->init_phy(net_dev, priv->mac_dev); |
2292 | if (!net_dev->phydev) { | 2293 | if (!net_dev->phydev) { |
2293 | netif_err(priv, ifup, net_dev, "init_phy() failed\n"); | 2294 | netif_err(priv, ifup, net_dev, "init_phy() failed\n"); |
2294 | return -ENODEV; | 2295 | err = -ENODEV; |
2296 | goto phy_init_failed; | ||
2295 | } | 2297 | } |
2296 | 2298 | ||
2297 | for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { | 2299 | for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { |
@@ -2314,6 +2316,7 @@ mac_start_failed: | |||
2314 | for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) | 2316 | for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) |
2315 | fman_port_disable(mac_dev->port[i]); | 2317 | fman_port_disable(mac_dev->port[i]); |
2316 | 2318 | ||
2319 | phy_init_failed: | ||
2317 | dpaa_eth_napi_disable(priv); | 2320 | dpaa_eth_napi_disable(priv); |
2318 | 2321 | ||
2319 | return err; | 2322 | return err; |
@@ -2420,6 +2423,7 @@ static int dpaa_ingress_cgr_init(struct dpaa_priv *priv) | |||
2420 | } | 2423 | } |
2421 | 2424 | ||
2422 | /* Enable CS TD, but disable Congestion State Change Notifications. */ | 2425 | /* Enable CS TD, but disable Congestion State Change Notifications. */ |
2426 | memset(&initcgr, 0, sizeof(initcgr)); | ||
2423 | initcgr.we_mask = cpu_to_be16(QM_CGR_WE_CS_THRES); | 2427 | initcgr.we_mask = cpu_to_be16(QM_CGR_WE_CS_THRES); |
2424 | initcgr.cgr.cscn_en = QM_CGR_EN; | 2428 | initcgr.cgr.cscn_en = QM_CGR_EN; |
2425 | cs_th = DPAA_INGRESS_CS_THRESHOLD; | 2429 | cs_th = DPAA_INGRESS_CS_THRESHOLD; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c index 015198c14fa8..504461a464c5 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c | |||
@@ -245,13 +245,9 @@ static u32 freq_to_shift(u16 freq) | |||
245 | { | 245 | { |
246 | u32 freq_khz = freq * 1000; | 246 | u32 freq_khz = freq * 1000; |
247 | u64 max_val_cycles = freq_khz * 1000 * MLX4_EN_WRAP_AROUND_SEC; | 247 | u64 max_val_cycles = freq_khz * 1000 * MLX4_EN_WRAP_AROUND_SEC; |
248 | u64 tmp_rounded = | 248 | u64 max_val_cycles_rounded = 1ULL << fls64(max_val_cycles - 1); |
249 | roundup_pow_of_two(max_val_cycles) > max_val_cycles ? | ||
250 | roundup_pow_of_two(max_val_cycles) - 1 : UINT_MAX; | ||
251 | u64 max_val_cycles_rounded = is_power_of_2(max_val_cycles + 1) ? | ||
252 | max_val_cycles : tmp_rounded; | ||
253 | /* calculate max possible multiplier in order to fit in 64bit */ | 249 | /* calculate max possible multiplier in order to fit in 64bit */ |
254 | u64 max_mul = div_u64(0xffffffffffffffffULL, max_val_cycles_rounded); | 250 | u64 max_mul = div64_u64(ULLONG_MAX, max_val_cycles_rounded); |
255 | 251 | ||
256 | /* This comes from the reverse of clocksource_khz2mult */ | 252 | /* This comes from the reverse of clocksource_khz2mult */ |
257 | return ilog2(div_u64(max_mul * freq_khz, 1000000)); | 253 | return ilog2(div_u64(max_mul * freq_khz, 1000000)); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index 3c37e216bbf3..eac527e25ec9 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -445,8 +445,14 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv) | |||
445 | ring->cqn = priv->rx_cq[ring_ind]->mcq.cqn; | 445 | ring->cqn = priv->rx_cq[ring_ind]->mcq.cqn; |
446 | 446 | ||
447 | ring->stride = stride; | 447 | ring->stride = stride; |
448 | if (ring->stride <= TXBB_SIZE) | 448 | if (ring->stride <= TXBB_SIZE) { |
449 | /* Stamp first unused send wqe */ | ||
450 | __be32 *ptr = (__be32 *)ring->buf; | ||
451 | __be32 stamp = cpu_to_be32(1 << STAMP_SHIFT); | ||
452 | *ptr = stamp; | ||
453 | /* Move pointer to start of rx section */ | ||
449 | ring->buf += TXBB_SIZE; | 454 | ring->buf += TXBB_SIZE; |
455 | } | ||
450 | 456 | ||
451 | ring->log_stride = ffs(ring->stride) - 1; | 457 | ring->log_stride = ffs(ring->stride) - 1; |
452 | ring->buf_size = ring->size * ring->stride; | 458 | ring->buf_size = ring->size * ring->stride; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c b/drivers/net/ethernet/mellanox/mlx4/icm.c index 2a9dd460a95f..e1f9e7cebf8f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/icm.c +++ b/drivers/net/ethernet/mellanox/mlx4/icm.c | |||
@@ -118,8 +118,13 @@ static int mlx4_alloc_icm_coherent(struct device *dev, struct scatterlist *mem, | |||
118 | if (!buf) | 118 | if (!buf) |
119 | return -ENOMEM; | 119 | return -ENOMEM; |
120 | 120 | ||
121 | if (offset_in_page(buf)) { | ||
122 | dma_free_coherent(dev, PAGE_SIZE << order, | ||
123 | buf, sg_dma_address(mem)); | ||
124 | return -ENOMEM; | ||
125 | } | ||
126 | |||
121 | sg_set_buf(mem, buf, PAGE_SIZE << order); | 127 | sg_set_buf(mem, buf, PAGE_SIZE << order); |
122 | BUG_ON(mem->offset); | ||
123 | sg_dma_len(mem) = PAGE_SIZE << order; | 128 | sg_dma_len(mem) = PAGE_SIZE << order; |
124 | return 0; | 129 | return 0; |
125 | } | 130 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 5e7840a7a33b..bffa6f345f2f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/io-mapping.h> | 42 | #include <linux/io-mapping.h> |
43 | #include <linux/delay.h> | 43 | #include <linux/delay.h> |
44 | #include <linux/kmod.h> | 44 | #include <linux/kmod.h> |
45 | #include <linux/etherdevice.h> | ||
45 | #include <net/devlink.h> | 46 | #include <net/devlink.h> |
46 | 47 | ||
47 | #include <linux/mlx4/device.h> | 48 | #include <linux/mlx4/device.h> |
@@ -782,6 +783,23 @@ int mlx4_is_slave_active(struct mlx4_dev *dev, int slave) | |||
782 | } | 783 | } |
783 | EXPORT_SYMBOL(mlx4_is_slave_active); | 784 | EXPORT_SYMBOL(mlx4_is_slave_active); |
784 | 785 | ||
786 | void mlx4_handle_eth_header_mcast_prio(struct mlx4_net_trans_rule_hw_ctrl *ctrl, | ||
787 | struct _rule_hw *eth_header) | ||
788 | { | ||
789 | if (is_multicast_ether_addr(eth_header->eth.dst_mac) || | ||
790 | is_broadcast_ether_addr(eth_header->eth.dst_mac)) { | ||
791 | struct mlx4_net_trans_rule_hw_eth *eth = | ||
792 | (struct mlx4_net_trans_rule_hw_eth *)eth_header; | ||
793 | struct _rule_hw *next_rule = (struct _rule_hw *)(eth + 1); | ||
794 | bool last_rule = next_rule->size == 0 && next_rule->id == 0 && | ||
795 | next_rule->rsvd == 0; | ||
796 | |||
797 | if (last_rule) | ||
798 | ctrl->prio = cpu_to_be16(MLX4_DOMAIN_NIC); | ||
799 | } | ||
800 | } | ||
801 | EXPORT_SYMBOL(mlx4_handle_eth_header_mcast_prio); | ||
802 | |||
785 | static void slave_adjust_steering_mode(struct mlx4_dev *dev, | 803 | static void slave_adjust_steering_mode(struct mlx4_dev *dev, |
786 | struct mlx4_dev_cap *dev_cap, | 804 | struct mlx4_dev_cap *dev_cap, |
787 | struct mlx4_init_hca_param *hca_param) | 805 | struct mlx4_init_hca_param *hca_param) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index c548beaaf910..56185a0b827d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | |||
@@ -4164,22 +4164,6 @@ static int validate_eth_header_mac(int slave, struct _rule_hw *eth_header, | |||
4164 | return 0; | 4164 | return 0; |
4165 | } | 4165 | } |
4166 | 4166 | ||
4167 | static void handle_eth_header_mcast_prio(struct mlx4_net_trans_rule_hw_ctrl *ctrl, | ||
4168 | struct _rule_hw *eth_header) | ||
4169 | { | ||
4170 | if (is_multicast_ether_addr(eth_header->eth.dst_mac) || | ||
4171 | is_broadcast_ether_addr(eth_header->eth.dst_mac)) { | ||
4172 | struct mlx4_net_trans_rule_hw_eth *eth = | ||
4173 | (struct mlx4_net_trans_rule_hw_eth *)eth_header; | ||
4174 | struct _rule_hw *next_rule = (struct _rule_hw *)(eth + 1); | ||
4175 | bool last_rule = next_rule->size == 0 && next_rule->id == 0 && | ||
4176 | next_rule->rsvd == 0; | ||
4177 | |||
4178 | if (last_rule) | ||
4179 | ctrl->prio = cpu_to_be16(MLX4_DOMAIN_NIC); | ||
4180 | } | ||
4181 | } | ||
4182 | |||
4183 | /* | 4167 | /* |
4184 | * In case of missing eth header, append eth header with a MAC address | 4168 | * In case of missing eth header, append eth header with a MAC address |
4185 | * assigned to the VF. | 4169 | * assigned to the VF. |
@@ -4363,10 +4347,7 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | |||
4363 | header_id = map_hw_to_sw_id(be16_to_cpu(rule_header->id)); | 4347 | header_id = map_hw_to_sw_id(be16_to_cpu(rule_header->id)); |
4364 | 4348 | ||
4365 | if (header_id == MLX4_NET_TRANS_RULE_ID_ETH) | 4349 | if (header_id == MLX4_NET_TRANS_RULE_ID_ETH) |
4366 | handle_eth_header_mcast_prio(ctrl, rule_header); | 4350 | mlx4_handle_eth_header_mcast_prio(ctrl, rule_header); |
4367 | |||
4368 | if (slave == dev->caps.function) | ||
4369 | goto execute; | ||
4370 | 4351 | ||
4371 | switch (header_id) { | 4352 | switch (header_id) { |
4372 | case MLX4_NET_TRANS_RULE_ID_ETH: | 4353 | case MLX4_NET_TRANS_RULE_ID_ETH: |
@@ -4394,7 +4375,6 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | |||
4394 | goto err_put_qp; | 4375 | goto err_put_qp; |
4395 | } | 4376 | } |
4396 | 4377 | ||
4397 | execute: | ||
4398 | err = mlx4_cmd_imm(dev, inbox->dma, &vhcr->out_param, | 4378 | err = mlx4_cmd_imm(dev, inbox->dma, &vhcr->out_param, |
4399 | vhcr->in_modifier, 0, | 4379 | vhcr->in_modifier, 0, |
4400 | MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A, | 4380 | MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A, |
@@ -4473,6 +4453,7 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave, | |||
4473 | struct res_qp *rqp; | 4453 | struct res_qp *rqp; |
4474 | struct res_fs_rule *rrule; | 4454 | struct res_fs_rule *rrule; |
4475 | u64 mirr_reg_id; | 4455 | u64 mirr_reg_id; |
4456 | int qpn; | ||
4476 | 4457 | ||
4477 | if (dev->caps.steering_mode != | 4458 | if (dev->caps.steering_mode != |
4478 | MLX4_STEERING_MODE_DEVICE_MANAGED) | 4459 | MLX4_STEERING_MODE_DEVICE_MANAGED) |
@@ -4489,10 +4470,11 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave, | |||
4489 | } | 4470 | } |
4490 | mirr_reg_id = rrule->mirr_rule_id; | 4471 | mirr_reg_id = rrule->mirr_rule_id; |
4491 | kfree(rrule->mirr_mbox); | 4472 | kfree(rrule->mirr_mbox); |
4473 | qpn = rrule->qpn; | ||
4492 | 4474 | ||
4493 | /* Release the rule form busy state before removal */ | 4475 | /* Release the rule form busy state before removal */ |
4494 | put_res(dev, slave, vhcr->in_param, RES_FS_RULE); | 4476 | put_res(dev, slave, vhcr->in_param, RES_FS_RULE); |
4495 | err = get_res(dev, slave, rrule->qpn, RES_QP, &rqp); | 4477 | err = get_res(dev, slave, qpn, RES_QP, &rqp); |
4496 | if (err) | 4478 | if (err) |
4497 | return err; | 4479 | return err; |
4498 | 4480 | ||
@@ -4517,7 +4499,7 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave, | |||
4517 | if (!err) | 4499 | if (!err) |
4518 | atomic_dec(&rqp->ref_count); | 4500 | atomic_dec(&rqp->ref_count); |
4519 | out: | 4501 | out: |
4520 | put_res(dev, slave, rrule->qpn, RES_QP); | 4502 | put_res(dev, slave, qpn, RES_QP); |
4521 | return err; | 4503 | return err; |
4522 | } | 4504 | } |
4523 | 4505 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c index 7f6c225666c1..f0b460f47f29 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | |||
@@ -723,6 +723,9 @@ static void mlx5e_ets_init(struct mlx5e_priv *priv) | |||
723 | int i; | 723 | int i; |
724 | struct ieee_ets ets; | 724 | struct ieee_ets ets; |
725 | 725 | ||
726 | if (!MLX5_CAP_GEN(priv->mdev, ets)) | ||
727 | return; | ||
728 | |||
726 | memset(&ets, 0, sizeof(ets)); | 729 | memset(&ets, 0, sizeof(ets)); |
727 | ets.ets_cap = mlx5_max_tc(priv->mdev) + 1; | 730 | ets.ets_cap = mlx5_max_tc(priv->mdev) + 1; |
728 | for (i = 0; i < ets.ets_cap; i++) { | 731 | for (i = 0; i < ets.ets_cap; i++) { |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index 352462af8d51..33a399a8b5d5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | |||
@@ -171,7 +171,6 @@ static int mlx5e_get_sset_count(struct net_device *dev, int sset) | |||
171 | return NUM_SW_COUNTERS + | 171 | return NUM_SW_COUNTERS + |
172 | MLX5E_NUM_Q_CNTRS(priv) + | 172 | MLX5E_NUM_Q_CNTRS(priv) + |
173 | NUM_VPORT_COUNTERS + NUM_PPORT_COUNTERS + | 173 | NUM_VPORT_COUNTERS + NUM_PPORT_COUNTERS + |
174 | NUM_PCIE_COUNTERS + | ||
175 | MLX5E_NUM_RQ_STATS(priv) + | 174 | MLX5E_NUM_RQ_STATS(priv) + |
176 | MLX5E_NUM_SQ_STATS(priv) + | 175 | MLX5E_NUM_SQ_STATS(priv) + |
177 | MLX5E_NUM_PFC_COUNTERS(priv) + | 176 | MLX5E_NUM_PFC_COUNTERS(priv) + |
@@ -219,14 +218,6 @@ static void mlx5e_fill_stats_strings(struct mlx5e_priv *priv, uint8_t *data) | |||
219 | strcpy(data + (idx++) * ETH_GSTRING_LEN, | 218 | strcpy(data + (idx++) * ETH_GSTRING_LEN, |
220 | pport_2819_stats_desc[i].format); | 219 | pport_2819_stats_desc[i].format); |
221 | 220 | ||
222 | for (i = 0; i < NUM_PCIE_PERF_COUNTERS; i++) | ||
223 | strcpy(data + (idx++) * ETH_GSTRING_LEN, | ||
224 | pcie_perf_stats_desc[i].format); | ||
225 | |||
226 | for (i = 0; i < NUM_PCIE_TAS_COUNTERS; i++) | ||
227 | strcpy(data + (idx++) * ETH_GSTRING_LEN, | ||
228 | pcie_tas_stats_desc[i].format); | ||
229 | |||
230 | for (prio = 0; prio < NUM_PPORT_PRIO; prio++) { | 221 | for (prio = 0; prio < NUM_PPORT_PRIO; prio++) { |
231 | for (i = 0; i < NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS; i++) | 222 | for (i = 0; i < NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS; i++) |
232 | sprintf(data + (idx++) * ETH_GSTRING_LEN, | 223 | sprintf(data + (idx++) * ETH_GSTRING_LEN, |
@@ -339,14 +330,6 @@ static void mlx5e_get_ethtool_stats(struct net_device *dev, | |||
339 | data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.RFC_2819_counters, | 330 | data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.RFC_2819_counters, |
340 | pport_2819_stats_desc, i); | 331 | pport_2819_stats_desc, i); |
341 | 332 | ||
342 | for (i = 0; i < NUM_PCIE_PERF_COUNTERS; i++) | ||
343 | data[idx++] = MLX5E_READ_CTR32_BE(&priv->stats.pcie.pcie_perf_counters, | ||
344 | pcie_perf_stats_desc, i); | ||
345 | |||
346 | for (i = 0; i < NUM_PCIE_TAS_COUNTERS; i++) | ||
347 | data[idx++] = MLX5E_READ_CTR32_BE(&priv->stats.pcie.pcie_tas_counters, | ||
348 | pcie_tas_stats_desc, i); | ||
349 | |||
350 | for (prio = 0; prio < NUM_PPORT_PRIO; prio++) { | 333 | for (prio = 0; prio < NUM_PPORT_PRIO; prio++) { |
351 | for (i = 0; i < NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS; i++) | 334 | for (i = 0; i < NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS; i++) |
352 | data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.per_prio_counters[prio], | 335 | data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.per_prio_counters[prio], |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c index 3691451c728c..d088effd7160 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c | |||
@@ -247,6 +247,7 @@ static int set_flow_attrs(u32 *match_c, u32 *match_v, | |||
247 | } | 247 | } |
248 | if (fs->flow_type & FLOW_MAC_EXT && | 248 | if (fs->flow_type & FLOW_MAC_EXT && |
249 | !is_zero_ether_addr(fs->m_ext.h_dest)) { | 249 | !is_zero_ether_addr(fs->m_ext.h_dest)) { |
250 | mask_spec(fs->m_ext.h_dest, fs->h_ext.h_dest, ETH_ALEN); | ||
250 | ether_addr_copy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, | 251 | ether_addr_copy(MLX5_ADDR_OF(fte_match_set_lyr_2_4, |
251 | outer_headers_c, dmac_47_16), | 252 | outer_headers_c, dmac_47_16), |
252 | fs->m_ext.h_dest); | 253 | fs->m_ext.h_dest); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index cbfa38fc72c0..1236b27b1493 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c | |||
@@ -291,36 +291,12 @@ static void mlx5e_update_q_counter(struct mlx5e_priv *priv) | |||
291 | &qcnt->rx_out_of_buffer); | 291 | &qcnt->rx_out_of_buffer); |
292 | } | 292 | } |
293 | 293 | ||
294 | static void mlx5e_update_pcie_counters(struct mlx5e_priv *priv) | ||
295 | { | ||
296 | struct mlx5e_pcie_stats *pcie_stats = &priv->stats.pcie; | ||
297 | struct mlx5_core_dev *mdev = priv->mdev; | ||
298 | int sz = MLX5_ST_SZ_BYTES(mpcnt_reg); | ||
299 | void *out; | ||
300 | u32 *in; | ||
301 | |||
302 | in = mlx5_vzalloc(sz); | ||
303 | if (!in) | ||
304 | return; | ||
305 | |||
306 | out = pcie_stats->pcie_perf_counters; | ||
307 | MLX5_SET(mpcnt_reg, in, grp, MLX5_PCIE_PERFORMANCE_COUNTERS_GROUP); | ||
308 | mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_MPCNT, 0, 0); | ||
309 | |||
310 | out = pcie_stats->pcie_tas_counters; | ||
311 | MLX5_SET(mpcnt_reg, in, grp, MLX5_PCIE_TIMERS_AND_STATES_COUNTERS_GROUP); | ||
312 | mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_MPCNT, 0, 0); | ||
313 | |||
314 | kvfree(in); | ||
315 | } | ||
316 | |||
317 | void mlx5e_update_stats(struct mlx5e_priv *priv) | 294 | void mlx5e_update_stats(struct mlx5e_priv *priv) |
318 | { | 295 | { |
319 | mlx5e_update_q_counter(priv); | 296 | mlx5e_update_q_counter(priv); |
320 | mlx5e_update_vport_counters(priv); | 297 | mlx5e_update_vport_counters(priv); |
321 | mlx5e_update_pport_counters(priv); | 298 | mlx5e_update_pport_counters(priv); |
322 | mlx5e_update_sw_counters(priv); | 299 | mlx5e_update_sw_counters(priv); |
323 | mlx5e_update_pcie_counters(priv); | ||
324 | } | 300 | } |
325 | 301 | ||
326 | void mlx5e_update_stats_work(struct work_struct *work) | 302 | void mlx5e_update_stats_work(struct work_struct *work) |
@@ -3805,14 +3781,7 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv) | |||
3805 | 3781 | ||
3806 | mlx5_lag_add(mdev, netdev); | 3782 | mlx5_lag_add(mdev, netdev); |
3807 | 3783 | ||
3808 | if (mlx5e_vxlan_allowed(mdev)) { | ||
3809 | rtnl_lock(); | ||
3810 | udp_tunnel_get_rx_info(netdev); | ||
3811 | rtnl_unlock(); | ||
3812 | } | ||
3813 | |||
3814 | mlx5e_enable_async_events(priv); | 3784 | mlx5e_enable_async_events(priv); |
3815 | queue_work(priv->wq, &priv->set_rx_mode_work); | ||
3816 | 3785 | ||
3817 | if (MLX5_CAP_GEN(mdev, vport_group_manager)) { | 3786 | if (MLX5_CAP_GEN(mdev, vport_group_manager)) { |
3818 | mlx5_query_nic_vport_mac_address(mdev, 0, rep.hw_id); | 3787 | mlx5_query_nic_vport_mac_address(mdev, 0, rep.hw_id); |
@@ -3822,6 +3791,18 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv) | |||
3822 | rep.netdev = netdev; | 3791 | rep.netdev = netdev; |
3823 | mlx5_eswitch_register_vport_rep(esw, 0, &rep); | 3792 | mlx5_eswitch_register_vport_rep(esw, 0, &rep); |
3824 | } | 3793 | } |
3794 | |||
3795 | if (netdev->reg_state != NETREG_REGISTERED) | ||
3796 | return; | ||
3797 | |||
3798 | /* Device already registered: sync netdev system state */ | ||
3799 | if (mlx5e_vxlan_allowed(mdev)) { | ||
3800 | rtnl_lock(); | ||
3801 | udp_tunnel_get_rx_info(netdev); | ||
3802 | rtnl_unlock(); | ||
3803 | } | ||
3804 | |||
3805 | queue_work(priv->wq, &priv->set_rx_mode_work); | ||
3825 | } | 3806 | } |
3826 | 3807 | ||
3827 | static void mlx5e_nic_disable(struct mlx5e_priv *priv) | 3808 | static void mlx5e_nic_disable(struct mlx5e_priv *priv) |
@@ -3966,10 +3947,6 @@ void mlx5e_detach_netdev(struct mlx5_core_dev *mdev, struct net_device *netdev) | |||
3966 | const struct mlx5e_profile *profile = priv->profile; | 3947 | const struct mlx5e_profile *profile = priv->profile; |
3967 | 3948 | ||
3968 | set_bit(MLX5E_STATE_DESTROYING, &priv->state); | 3949 | set_bit(MLX5E_STATE_DESTROYING, &priv->state); |
3969 | if (profile->disable) | ||
3970 | profile->disable(priv); | ||
3971 | |||
3972 | flush_workqueue(priv->wq); | ||
3973 | 3950 | ||
3974 | rtnl_lock(); | 3951 | rtnl_lock(); |
3975 | if (netif_running(netdev)) | 3952 | if (netif_running(netdev)) |
@@ -3977,6 +3954,10 @@ void mlx5e_detach_netdev(struct mlx5_core_dev *mdev, struct net_device *netdev) | |||
3977 | netif_device_detach(netdev); | 3954 | netif_device_detach(netdev); |
3978 | rtnl_unlock(); | 3955 | rtnl_unlock(); |
3979 | 3956 | ||
3957 | if (profile->disable) | ||
3958 | profile->disable(priv); | ||
3959 | flush_workqueue(priv->wq); | ||
3960 | |||
3980 | mlx5e_destroy_q_counter(priv); | 3961 | mlx5e_destroy_q_counter(priv); |
3981 | profile->cleanup_rx(priv); | 3962 | profile->cleanup_rx(priv); |
3982 | mlx5e_close_drop_rq(priv); | 3963 | mlx5e_close_drop_rq(priv); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h index f202f872f57f..ba5db1dd23a9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | |||
@@ -39,7 +39,7 @@ | |||
39 | #define MLX5E_READ_CTR32_CPU(ptr, dsc, i) \ | 39 | #define MLX5E_READ_CTR32_CPU(ptr, dsc, i) \ |
40 | (*(u32 *)((char *)ptr + dsc[i].offset)) | 40 | (*(u32 *)((char *)ptr + dsc[i].offset)) |
41 | #define MLX5E_READ_CTR32_BE(ptr, dsc, i) \ | 41 | #define MLX5E_READ_CTR32_BE(ptr, dsc, i) \ |
42 | be32_to_cpu(*(__be32 *)((char *)ptr + dsc[i].offset)) | 42 | be64_to_cpu(*(__be32 *)((char *)ptr + dsc[i].offset)) |
43 | 43 | ||
44 | #define MLX5E_DECLARE_STAT(type, fld) #fld, offsetof(type, fld) | 44 | #define MLX5E_DECLARE_STAT(type, fld) #fld, offsetof(type, fld) |
45 | #define MLX5E_DECLARE_RX_STAT(type, fld) "rx%d_"#fld, offsetof(type, fld) | 45 | #define MLX5E_DECLARE_RX_STAT(type, fld) "rx%d_"#fld, offsetof(type, fld) |
@@ -276,32 +276,6 @@ static const struct counter_desc pport_per_prio_pfc_stats_desc[] = { | |||
276 | { "rx_%s_pause_transition", PPORT_PER_PRIO_OFF(rx_pause_transition) }, | 276 | { "rx_%s_pause_transition", PPORT_PER_PRIO_OFF(rx_pause_transition) }, |
277 | }; | 277 | }; |
278 | 278 | ||
279 | #define PCIE_PERF_OFF(c) \ | ||
280 | MLX5_BYTE_OFF(mpcnt_reg, counter_set.pcie_perf_cntrs_grp_data_layout.c) | ||
281 | #define PCIE_PERF_GET(pcie_stats, c) \ | ||
282 | MLX5_GET(mpcnt_reg, pcie_stats->pcie_perf_counters, \ | ||
283 | counter_set.pcie_perf_cntrs_grp_data_layout.c) | ||
284 | #define PCIE_TAS_OFF(c) \ | ||
285 | MLX5_BYTE_OFF(mpcnt_reg, counter_set.pcie_tas_cntrs_grp_data_layout.c) | ||
286 | #define PCIE_TAS_GET(pcie_stats, c) \ | ||
287 | MLX5_GET(mpcnt_reg, pcie_stats->pcie_tas_counters, \ | ||
288 | counter_set.pcie_tas_cntrs_grp_data_layout.c) | ||
289 | |||
290 | struct mlx5e_pcie_stats { | ||
291 | __be64 pcie_perf_counters[MLX5_ST_SZ_QW(mpcnt_reg)]; | ||
292 | __be64 pcie_tas_counters[MLX5_ST_SZ_QW(mpcnt_reg)]; | ||
293 | }; | ||
294 | |||
295 | static const struct counter_desc pcie_perf_stats_desc[] = { | ||
296 | { "rx_pci_signal_integrity", PCIE_PERF_OFF(rx_errors) }, | ||
297 | { "tx_pci_signal_integrity", PCIE_PERF_OFF(tx_errors) }, | ||
298 | }; | ||
299 | |||
300 | static const struct counter_desc pcie_tas_stats_desc[] = { | ||
301 | { "tx_pci_transport_nonfatal_msg", PCIE_TAS_OFF(non_fatal_err_msg_sent) }, | ||
302 | { "tx_pci_transport_fatal_msg", PCIE_TAS_OFF(fatal_err_msg_sent) }, | ||
303 | }; | ||
304 | |||
305 | struct mlx5e_rq_stats { | 279 | struct mlx5e_rq_stats { |
306 | u64 packets; | 280 | u64 packets; |
307 | u64 bytes; | 281 | u64 bytes; |
@@ -386,8 +360,6 @@ static const struct counter_desc sq_stats_desc[] = { | |||
386 | #define NUM_PPORT_802_3_COUNTERS ARRAY_SIZE(pport_802_3_stats_desc) | 360 | #define NUM_PPORT_802_3_COUNTERS ARRAY_SIZE(pport_802_3_stats_desc) |
387 | #define NUM_PPORT_2863_COUNTERS ARRAY_SIZE(pport_2863_stats_desc) | 361 | #define NUM_PPORT_2863_COUNTERS ARRAY_SIZE(pport_2863_stats_desc) |
388 | #define NUM_PPORT_2819_COUNTERS ARRAY_SIZE(pport_2819_stats_desc) | 362 | #define NUM_PPORT_2819_COUNTERS ARRAY_SIZE(pport_2819_stats_desc) |
389 | #define NUM_PCIE_PERF_COUNTERS ARRAY_SIZE(pcie_perf_stats_desc) | ||
390 | #define NUM_PCIE_TAS_COUNTERS ARRAY_SIZE(pcie_tas_stats_desc) | ||
391 | #define NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS \ | 363 | #define NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS \ |
392 | ARRAY_SIZE(pport_per_prio_traffic_stats_desc) | 364 | ARRAY_SIZE(pport_per_prio_traffic_stats_desc) |
393 | #define NUM_PPORT_PER_PRIO_PFC_COUNTERS \ | 365 | #define NUM_PPORT_PER_PRIO_PFC_COUNTERS \ |
@@ -397,7 +369,6 @@ static const struct counter_desc sq_stats_desc[] = { | |||
397 | NUM_PPORT_2819_COUNTERS + \ | 369 | NUM_PPORT_2819_COUNTERS + \ |
398 | NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS * \ | 370 | NUM_PPORT_PER_PRIO_TRAFFIC_COUNTERS * \ |
399 | NUM_PPORT_PRIO) | 371 | NUM_PPORT_PRIO) |
400 | #define NUM_PCIE_COUNTERS (NUM_PCIE_PERF_COUNTERS + NUM_PCIE_TAS_COUNTERS) | ||
401 | #define NUM_RQ_STATS ARRAY_SIZE(rq_stats_desc) | 372 | #define NUM_RQ_STATS ARRAY_SIZE(rq_stats_desc) |
402 | #define NUM_SQ_STATS ARRAY_SIZE(sq_stats_desc) | 373 | #define NUM_SQ_STATS ARRAY_SIZE(sq_stats_desc) |
403 | 374 | ||
@@ -406,7 +377,6 @@ struct mlx5e_stats { | |||
406 | struct mlx5e_qcounter_stats qcnt; | 377 | struct mlx5e_qcounter_stats qcnt; |
407 | struct mlx5e_vport_stats vport; | 378 | struct mlx5e_vport_stats vport; |
408 | struct mlx5e_pport_stats pport; | 379 | struct mlx5e_pport_stats pport; |
409 | struct mlx5e_pcie_stats pcie; | ||
410 | struct rtnl_link_stats64 vf_vport; | 380 | struct rtnl_link_stats64 vf_vport; |
411 | }; | 381 | }; |
412 | 382 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index d6807c3cc461..f14d9c9ba773 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | |||
@@ -1860,7 +1860,7 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw, | |||
1860 | 1860 | ||
1861 | if (!ESW_ALLOWED(esw)) | 1861 | if (!ESW_ALLOWED(esw)) |
1862 | return -EPERM; | 1862 | return -EPERM; |
1863 | if (!LEGAL_VPORT(esw, vport)) | 1863 | if (!LEGAL_VPORT(esw, vport) || is_multicast_ether_addr(mac)) |
1864 | return -EINVAL; | 1864 | return -EINVAL; |
1865 | 1865 | ||
1866 | mutex_lock(&esw->state_lock); | 1866 | mutex_lock(&esw->state_lock); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 466e161010f7..03293ed1cc22 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | |||
@@ -695,6 +695,12 @@ int esw_offloads_init(struct mlx5_eswitch *esw, int nvports) | |||
695 | if (err) | 695 | if (err) |
696 | goto err_reps; | 696 | goto err_reps; |
697 | } | 697 | } |
698 | |||
699 | /* disable PF RoCE so missed packets don't go through RoCE steering */ | ||
700 | mlx5_dev_list_lock(); | ||
701 | mlx5_remove_dev_by_protocol(esw->dev, MLX5_INTERFACE_PROTOCOL_IB); | ||
702 | mlx5_dev_list_unlock(); | ||
703 | |||
698 | return 0; | 704 | return 0; |
699 | 705 | ||
700 | err_reps: | 706 | err_reps: |
@@ -718,6 +724,11 @@ static int esw_offloads_stop(struct mlx5_eswitch *esw) | |||
718 | { | 724 | { |
719 | int err, err1, num_vfs = esw->dev->priv.sriov.num_vfs; | 725 | int err, err1, num_vfs = esw->dev->priv.sriov.num_vfs; |
720 | 726 | ||
727 | /* enable back PF RoCE */ | ||
728 | mlx5_dev_list_lock(); | ||
729 | mlx5_add_dev_by_protocol(esw->dev, MLX5_INTERFACE_PROTOCOL_IB); | ||
730 | mlx5_dev_list_unlock(); | ||
731 | |||
721 | mlx5_eswitch_disable_sriov(esw); | 732 | mlx5_eswitch_disable_sriov(esw); |
722 | err = mlx5_eswitch_enable_sriov(esw, num_vfs, SRIOV_LEGACY); | 733 | err = mlx5_eswitch_enable_sriov(esw, num_vfs, SRIOV_LEGACY); |
723 | if (err) { | 734 | if (err) { |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index a263d8904a4c..0ac7a2fc916c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | |||
@@ -1263,6 +1263,7 @@ static struct mlx5_flow_handle *add_rule_fg(struct mlx5_flow_group *fg, | |||
1263 | nested_lock_ref_node(&fte->node, FS_MUTEX_CHILD); | 1263 | nested_lock_ref_node(&fte->node, FS_MUTEX_CHILD); |
1264 | handle = add_rule_fte(fte, fg, dest, dest_num, false); | 1264 | handle = add_rule_fte(fte, fg, dest, dest_num, false); |
1265 | if (IS_ERR(handle)) { | 1265 | if (IS_ERR(handle)) { |
1266 | unlock_ref_node(&fte->node); | ||
1266 | kfree(fte); | 1267 | kfree(fte); |
1267 | goto unlock_fg; | 1268 | goto unlock_fg; |
1268 | } | 1269 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 54e5a786f191..6547f22e6b9b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c | |||
@@ -503,6 +503,13 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) | |||
503 | MLX5_SET(cmd_hca_cap, set_hca_cap, pkey_table_size, | 503 | MLX5_SET(cmd_hca_cap, set_hca_cap, pkey_table_size, |
504 | to_fw_pkey_sz(dev, 128)); | 504 | to_fw_pkey_sz(dev, 128)); |
505 | 505 | ||
506 | /* Check log_max_qp from HCA caps to set in current profile */ | ||
507 | if (MLX5_CAP_GEN_MAX(dev, log_max_qp) < profile[prof_sel].log_max_qp) { | ||
508 | mlx5_core_warn(dev, "log_max_qp value in current profile is %d, changing it to HCA capability limit (%d)\n", | ||
509 | profile[prof_sel].log_max_qp, | ||
510 | MLX5_CAP_GEN_MAX(dev, log_max_qp)); | ||
511 | profile[prof_sel].log_max_qp = MLX5_CAP_GEN_MAX(dev, log_max_qp); | ||
512 | } | ||
506 | if (prof->mask & MLX5_PROF_MASK_QP_SIZE) | 513 | if (prof->mask & MLX5_PROF_MASK_QP_SIZE) |
507 | MLX5_SET(cmd_hca_cap, set_hca_cap, log_max_qp, | 514 | MLX5_SET(cmd_hca_cap, set_hca_cap, log_max_qp, |
508 | prof->log_max_qp); | 515 | prof->log_max_qp); |
@@ -575,7 +582,6 @@ static int mlx5_irq_set_affinity_hint(struct mlx5_core_dev *mdev, int i) | |||
575 | struct mlx5_priv *priv = &mdev->priv; | 582 | struct mlx5_priv *priv = &mdev->priv; |
576 | struct msix_entry *msix = priv->msix_arr; | 583 | struct msix_entry *msix = priv->msix_arr; |
577 | int irq = msix[i + MLX5_EQ_VEC_COMP_BASE].vector; | 584 | int irq = msix[i + MLX5_EQ_VEC_COMP_BASE].vector; |
578 | int numa_node = priv->numa_node; | ||
579 | int err; | 585 | int err; |
580 | 586 | ||
581 | if (!zalloc_cpumask_var(&priv->irq_info[i].mask, GFP_KERNEL)) { | 587 | if (!zalloc_cpumask_var(&priv->irq_info[i].mask, GFP_KERNEL)) { |
@@ -583,7 +589,7 @@ static int mlx5_irq_set_affinity_hint(struct mlx5_core_dev *mdev, int i) | |||
583 | return -ENOMEM; | 589 | return -ENOMEM; |
584 | } | 590 | } |
585 | 591 | ||
586 | cpumask_set_cpu(cpumask_local_spread(i, numa_node), | 592 | cpumask_set_cpu(cpumask_local_spread(i, priv->numa_node), |
587 | priv->irq_info[i].mask); | 593 | priv->irq_info[i].mask); |
588 | 594 | ||
589 | err = irq_set_affinity_hint(irq, priv->irq_info[i].mask); | 595 | err = irq_set_affinity_hint(irq, priv->irq_info[i].mask); |
@@ -1189,6 +1195,8 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv, | |||
1189 | { | 1195 | { |
1190 | int err = 0; | 1196 | int err = 0; |
1191 | 1197 | ||
1198 | mlx5_drain_health_wq(dev); | ||
1199 | |||
1192 | mutex_lock(&dev->intf_state_mutex); | 1200 | mutex_lock(&dev->intf_state_mutex); |
1193 | if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) { | 1201 | if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) { |
1194 | dev_warn(&dev->pdev->dev, "%s: interface is down, NOP\n", | 1202 | dev_warn(&dev->pdev->dev, "%s: interface is down, NOP\n", |
@@ -1351,10 +1359,9 @@ static pci_ers_result_t mlx5_pci_err_detected(struct pci_dev *pdev, | |||
1351 | 1359 | ||
1352 | mlx5_enter_error_state(dev); | 1360 | mlx5_enter_error_state(dev); |
1353 | mlx5_unload_one(dev, priv, false); | 1361 | mlx5_unload_one(dev, priv, false); |
1354 | /* In case of kernel call save the pci state and drain health wq */ | 1362 | /* In case of kernel call save the pci state */ |
1355 | if (state) { | 1363 | if (state) { |
1356 | pci_save_state(pdev); | 1364 | pci_save_state(pdev); |
1357 | mlx5_drain_health_wq(dev); | ||
1358 | mlx5_pci_disable_device(dev); | 1365 | mlx5_pci_disable_device(dev); |
1359 | } | 1366 | } |
1360 | 1367 | ||
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index f341c1bc7001..00fafabab1d0 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -819,6 +819,7 @@ static struct sh_eth_cpu_data sh7734_data = { | |||
819 | .tsu = 1, | 819 | .tsu = 1, |
820 | .hw_crc = 1, | 820 | .hw_crc = 1, |
821 | .select_mii = 1, | 821 | .select_mii = 1, |
822 | .shift_rd0 = 1, | ||
822 | }; | 823 | }; |
823 | 824 | ||
824 | /* SH7763 */ | 825 | /* SH7763 */ |
@@ -1656,7 +1657,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) | |||
1656 | else | 1657 | else |
1657 | goto out; | 1658 | goto out; |
1658 | 1659 | ||
1659 | if (!likely(mdp->irq_enabled)) { | 1660 | if (unlikely(!mdp->irq_enabled)) { |
1660 | sh_eth_write(ndev, 0, EESIPR); | 1661 | sh_eth_write(ndev, 0, EESIPR); |
1661 | goto out; | 1662 | goto out; |
1662 | } | 1663 | } |
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index de2947ccc5ad..5eb0e684fd76 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c | |||
@@ -1323,7 +1323,8 @@ static int efx_ef10_init_nic(struct efx_nic *efx) | |||
1323 | } | 1323 | } |
1324 | 1324 | ||
1325 | /* don't fail init if RSS setup doesn't work */ | 1325 | /* don't fail init if RSS setup doesn't work */ |
1326 | efx->type->rx_push_rss_config(efx, false, efx->rx_indir_table); | 1326 | rc = efx->type->rx_push_rss_config(efx, false, efx->rx_indir_table); |
1327 | efx->rss_active = (rc == 0); | ||
1327 | 1328 | ||
1328 | return 0; | 1329 | return 0; |
1329 | } | 1330 | } |
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c index 87bdc56b4e3a..18ebaea44e82 100644 --- a/drivers/net/ethernet/sfc/ethtool.c +++ b/drivers/net/ethernet/sfc/ethtool.c | |||
@@ -975,6 +975,8 @@ efx_ethtool_get_rxnfc(struct net_device *net_dev, | |||
975 | 975 | ||
976 | case ETHTOOL_GRXFH: { | 976 | case ETHTOOL_GRXFH: { |
977 | info->data = 0; | 977 | info->data = 0; |
978 | if (!efx->rss_active) /* No RSS */ | ||
979 | return 0; | ||
978 | switch (info->flow_type) { | 980 | switch (info->flow_type) { |
979 | case UDP_V4_FLOW: | 981 | case UDP_V4_FLOW: |
980 | if (efx->rx_hash_udp_4tuple) | 982 | if (efx->rx_hash_udp_4tuple) |
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 1a635ced62d0..1c62c1a00fca 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h | |||
@@ -860,6 +860,7 @@ struct vfdi_status; | |||
860 | * @rx_hash_key: Toeplitz hash key for RSS | 860 | * @rx_hash_key: Toeplitz hash key for RSS |
861 | * @rx_indir_table: Indirection table for RSS | 861 | * @rx_indir_table: Indirection table for RSS |
862 | * @rx_scatter: Scatter mode enabled for receives | 862 | * @rx_scatter: Scatter mode enabled for receives |
863 | * @rss_active: RSS enabled on hardware | ||
863 | * @rx_hash_udp_4tuple: UDP 4-tuple hashing enabled | 864 | * @rx_hash_udp_4tuple: UDP 4-tuple hashing enabled |
864 | * @int_error_count: Number of internal errors seen recently | 865 | * @int_error_count: Number of internal errors seen recently |
865 | * @int_error_expire: Time at which error count will be expired | 866 | * @int_error_expire: Time at which error count will be expired |
@@ -998,6 +999,7 @@ struct efx_nic { | |||
998 | u8 rx_hash_key[40]; | 999 | u8 rx_hash_key[40]; |
999 | u32 rx_indir_table[128]; | 1000 | u32 rx_indir_table[128]; |
1000 | bool rx_scatter; | 1001 | bool rx_scatter; |
1002 | bool rss_active; | ||
1001 | bool rx_hash_udp_4tuple; | 1003 | bool rx_hash_udp_4tuple; |
1002 | 1004 | ||
1003 | unsigned int_error_count; | 1005 | unsigned int_error_count; |
diff --git a/drivers/net/ethernet/sfc/siena.c b/drivers/net/ethernet/sfc/siena.c index a3901bc96586..4e54e5dc9fcb 100644 --- a/drivers/net/ethernet/sfc/siena.c +++ b/drivers/net/ethernet/sfc/siena.c | |||
@@ -403,6 +403,7 @@ static int siena_init_nic(struct efx_nic *efx) | |||
403 | efx_writeo(efx, &temp, FR_AZ_RX_CFG); | 403 | efx_writeo(efx, &temp, FR_AZ_RX_CFG); |
404 | 404 | ||
405 | siena_rx_push_rss_config(efx, false, efx->rx_indir_table); | 405 | siena_rx_push_rss_config(efx, false, efx->rx_indir_table); |
406 | efx->rss_active = true; | ||
406 | 407 | ||
407 | /* Enable event logging */ | 408 | /* Enable event logging */ |
408 | rc = efx_mcdi_log_ctrl(efx, true, false, 0); | 409 | rc = efx_mcdi_log_ctrl(efx, true, false, 0); |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c index c35597586121..3dc7d279f805 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c | |||
@@ -60,8 +60,9 @@ struct oxnas_dwmac { | |||
60 | struct regmap *regmap; | 60 | struct regmap *regmap; |
61 | }; | 61 | }; |
62 | 62 | ||
63 | static int oxnas_dwmac_init(struct oxnas_dwmac *dwmac) | 63 | static int oxnas_dwmac_init(struct platform_device *pdev, void *priv) |
64 | { | 64 | { |
65 | struct oxnas_dwmac *dwmac = priv; | ||
65 | unsigned int value; | 66 | unsigned int value; |
66 | int ret; | 67 | int ret; |
67 | 68 | ||
@@ -105,20 +106,20 @@ static int oxnas_dwmac_init(struct oxnas_dwmac *dwmac) | |||
105 | return 0; | 106 | return 0; |
106 | } | 107 | } |
107 | 108 | ||
109 | static void oxnas_dwmac_exit(struct platform_device *pdev, void *priv) | ||
110 | { | ||
111 | struct oxnas_dwmac *dwmac = priv; | ||
112 | |||
113 | clk_disable_unprepare(dwmac->clk); | ||
114 | } | ||
115 | |||
108 | static int oxnas_dwmac_probe(struct platform_device *pdev) | 116 | static int oxnas_dwmac_probe(struct platform_device *pdev) |
109 | { | 117 | { |
110 | struct plat_stmmacenet_data *plat_dat; | 118 | struct plat_stmmacenet_data *plat_dat; |
111 | struct stmmac_resources stmmac_res; | 119 | struct stmmac_resources stmmac_res; |
112 | struct device_node *sysctrl; | ||
113 | struct oxnas_dwmac *dwmac; | 120 | struct oxnas_dwmac *dwmac; |
114 | int ret; | 121 | int ret; |
115 | 122 | ||
116 | sysctrl = of_parse_phandle(pdev->dev.of_node, "oxsemi,sys-ctrl", 0); | ||
117 | if (!sysctrl) { | ||
118 | dev_err(&pdev->dev, "failed to get sys-ctrl node\n"); | ||
119 | return -EINVAL; | ||
120 | } | ||
121 | |||
122 | ret = stmmac_get_platform_resources(pdev, &stmmac_res); | 123 | ret = stmmac_get_platform_resources(pdev, &stmmac_res); |
123 | if (ret) | 124 | if (ret) |
124 | return ret; | 125 | return ret; |
@@ -128,72 +129,48 @@ static int oxnas_dwmac_probe(struct platform_device *pdev) | |||
128 | return PTR_ERR(plat_dat); | 129 | return PTR_ERR(plat_dat); |
129 | 130 | ||
130 | dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); | 131 | dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); |
131 | if (!dwmac) | 132 | if (!dwmac) { |
132 | return -ENOMEM; | 133 | ret = -ENOMEM; |
134 | goto err_remove_config_dt; | ||
135 | } | ||
133 | 136 | ||
134 | dwmac->dev = &pdev->dev; | 137 | dwmac->dev = &pdev->dev; |
135 | plat_dat->bsp_priv = dwmac; | 138 | plat_dat->bsp_priv = dwmac; |
139 | plat_dat->init = oxnas_dwmac_init; | ||
140 | plat_dat->exit = oxnas_dwmac_exit; | ||
136 | 141 | ||
137 | dwmac->regmap = syscon_node_to_regmap(sysctrl); | 142 | dwmac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, |
143 | "oxsemi,sys-ctrl"); | ||
138 | if (IS_ERR(dwmac->regmap)) { | 144 | if (IS_ERR(dwmac->regmap)) { |
139 | dev_err(&pdev->dev, "failed to have sysctrl regmap\n"); | 145 | dev_err(&pdev->dev, "failed to have sysctrl regmap\n"); |
140 | return PTR_ERR(dwmac->regmap); | 146 | ret = PTR_ERR(dwmac->regmap); |
147 | goto err_remove_config_dt; | ||
141 | } | 148 | } |
142 | 149 | ||
143 | dwmac->clk = devm_clk_get(&pdev->dev, "gmac"); | 150 | dwmac->clk = devm_clk_get(&pdev->dev, "gmac"); |
144 | if (IS_ERR(dwmac->clk)) | 151 | if (IS_ERR(dwmac->clk)) { |
145 | return PTR_ERR(dwmac->clk); | 152 | ret = PTR_ERR(dwmac->clk); |
153 | goto err_remove_config_dt; | ||
154 | } | ||
146 | 155 | ||
147 | ret = oxnas_dwmac_init(dwmac); | 156 | ret = oxnas_dwmac_init(pdev, plat_dat->bsp_priv); |
148 | if (ret) | 157 | if (ret) |
149 | return ret; | 158 | goto err_remove_config_dt; |
150 | 159 | ||
151 | ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); | 160 | ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); |
152 | if (ret) | 161 | if (ret) |
153 | clk_disable_unprepare(dwmac->clk); | 162 | goto err_dwmac_exit; |
154 | 163 | ||
155 | return ret; | ||
156 | } | ||
157 | 164 | ||
158 | static int oxnas_dwmac_remove(struct platform_device *pdev) | 165 | return 0; |
159 | { | ||
160 | struct oxnas_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev); | ||
161 | int ret = stmmac_dvr_remove(&pdev->dev); | ||
162 | |||
163 | clk_disable_unprepare(dwmac->clk); | ||
164 | |||
165 | return ret; | ||
166 | } | ||
167 | |||
168 | #ifdef CONFIG_PM_SLEEP | ||
169 | static int oxnas_dwmac_suspend(struct device *dev) | ||
170 | { | ||
171 | struct oxnas_dwmac *dwmac = get_stmmac_bsp_priv(dev); | ||
172 | int ret; | ||
173 | |||
174 | ret = stmmac_suspend(dev); | ||
175 | clk_disable_unprepare(dwmac->clk); | ||
176 | |||
177 | return ret; | ||
178 | } | ||
179 | |||
180 | static int oxnas_dwmac_resume(struct device *dev) | ||
181 | { | ||
182 | struct oxnas_dwmac *dwmac = get_stmmac_bsp_priv(dev); | ||
183 | int ret; | ||
184 | |||
185 | ret = oxnas_dwmac_init(dwmac); | ||
186 | if (ret) | ||
187 | return ret; | ||
188 | 166 | ||
189 | ret = stmmac_resume(dev); | 167 | err_dwmac_exit: |
168 | oxnas_dwmac_exit(pdev, plat_dat->bsp_priv); | ||
169 | err_remove_config_dt: | ||
170 | stmmac_remove_config_dt(pdev, plat_dat); | ||
190 | 171 | ||
191 | return ret; | 172 | return ret; |
192 | } | 173 | } |
193 | #endif /* CONFIG_PM_SLEEP */ | ||
194 | |||
195 | static SIMPLE_DEV_PM_OPS(oxnas_dwmac_pm_ops, | ||
196 | oxnas_dwmac_suspend, oxnas_dwmac_resume); | ||
197 | 174 | ||
198 | static const struct of_device_id oxnas_dwmac_match[] = { | 175 | static const struct of_device_id oxnas_dwmac_match[] = { |
199 | { .compatible = "oxsemi,ox820-dwmac" }, | 176 | { .compatible = "oxsemi,ox820-dwmac" }, |
@@ -203,10 +180,10 @@ MODULE_DEVICE_TABLE(of, oxnas_dwmac_match); | |||
203 | 180 | ||
204 | static struct platform_driver oxnas_dwmac_driver = { | 181 | static struct platform_driver oxnas_dwmac_driver = { |
205 | .probe = oxnas_dwmac_probe, | 182 | .probe = oxnas_dwmac_probe, |
206 | .remove = oxnas_dwmac_remove, | 183 | .remove = stmmac_pltfr_remove, |
207 | .driver = { | 184 | .driver = { |
208 | .name = "oxnas-dwmac", | 185 | .name = "oxnas-dwmac", |
209 | .pm = &oxnas_dwmac_pm_ops, | 186 | .pm = &stmmac_pltfr_pm_ops, |
210 | .of_match_table = oxnas_dwmac_match, | 187 | .of_match_table = oxnas_dwmac_match, |
211 | }, | 188 | }, |
212 | }; | 189 | }; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index bb40382e205d..39eb7a65bb9f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -3339,13 +3339,6 @@ int stmmac_dvr_probe(struct device *device, | |||
3339 | 3339 | ||
3340 | spin_lock_init(&priv->lock); | 3340 | spin_lock_init(&priv->lock); |
3341 | 3341 | ||
3342 | ret = register_netdev(ndev); | ||
3343 | if (ret) { | ||
3344 | netdev_err(priv->dev, "%s: ERROR %i registering the device\n", | ||
3345 | __func__, ret); | ||
3346 | goto error_netdev_register; | ||
3347 | } | ||
3348 | |||
3349 | /* If a specific clk_csr value is passed from the platform | 3342 | /* If a specific clk_csr value is passed from the platform |
3350 | * this means that the CSR Clock Range selection cannot be | 3343 | * this means that the CSR Clock Range selection cannot be |
3351 | * changed at run-time and it is fixed. Viceversa the driver'll try to | 3344 | * changed at run-time and it is fixed. Viceversa the driver'll try to |
@@ -3372,11 +3365,21 @@ int stmmac_dvr_probe(struct device *device, | |||
3372 | } | 3365 | } |
3373 | } | 3366 | } |
3374 | 3367 | ||
3375 | return 0; | 3368 | ret = register_netdev(ndev); |
3369 | if (ret) { | ||
3370 | netdev_err(priv->dev, "%s: ERROR %i registering the device\n", | ||
3371 | __func__, ret); | ||
3372 | goto error_netdev_register; | ||
3373 | } | ||
3374 | |||
3375 | return ret; | ||
3376 | 3376 | ||
3377 | error_mdio_register: | ||
3378 | unregister_netdev(ndev); | ||
3379 | error_netdev_register: | 3377 | error_netdev_register: |
3378 | if (priv->hw->pcs != STMMAC_PCS_RGMII && | ||
3379 | priv->hw->pcs != STMMAC_PCS_TBI && | ||
3380 | priv->hw->pcs != STMMAC_PCS_RTBI) | ||
3381 | stmmac_mdio_unregister(ndev); | ||
3382 | error_mdio_register: | ||
3380 | netif_napi_del(&priv->napi); | 3383 | netif_napi_del(&priv->napi); |
3381 | error_hw_init: | 3384 | error_hw_init: |
3382 | clk_disable_unprepare(priv->pclk); | 3385 | clk_disable_unprepare(priv->pclk); |
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index 6c646e228833..6e98ede997d3 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c | |||
@@ -1367,6 +1367,7 @@ static struct usb_driver asix_driver = { | |||
1367 | .probe = usbnet_probe, | 1367 | .probe = usbnet_probe, |
1368 | .suspend = asix_suspend, | 1368 | .suspend = asix_suspend, |
1369 | .resume = asix_resume, | 1369 | .resume = asix_resume, |
1370 | .reset_resume = asix_resume, | ||
1370 | .disconnect = usbnet_disconnect, | 1371 | .disconnect = usbnet_disconnect, |
1371 | .supports_autosuspend = 1, | 1372 | .supports_autosuspend = 1, |
1372 | .disable_hub_initiated_lpm = 1, | 1373 | .disable_hub_initiated_lpm = 1, |
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 7532646c3b7b..23dfb0eac098 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c | |||
@@ -967,6 +967,7 @@ static struct sk_buff *vrf_ip6_rcv(struct net_device *vrf_dev, | |||
967 | */ | 967 | */ |
968 | need_strict = rt6_need_strict(&ipv6_hdr(skb)->daddr); | 968 | need_strict = rt6_need_strict(&ipv6_hdr(skb)->daddr); |
969 | if (!ipv6_ndisc_frame(skb) && !need_strict) { | 969 | if (!ipv6_ndisc_frame(skb) && !need_strict) { |
970 | vrf_rx_stats(vrf_dev, skb->len); | ||
970 | skb->dev = vrf_dev; | 971 | skb->dev = vrf_dev; |
971 | skb->skb_iif = vrf_dev->ifindex; | 972 | skb->skb_iif = vrf_dev->ifindex; |
972 | 973 | ||
@@ -1011,6 +1012,8 @@ static struct sk_buff *vrf_ip_rcv(struct net_device *vrf_dev, | |||
1011 | goto out; | 1012 | goto out; |
1012 | } | 1013 | } |
1013 | 1014 | ||
1015 | vrf_rx_stats(vrf_dev, skb->len); | ||
1016 | |||
1014 | skb_push(skb, skb->mac_len); | 1017 | skb_push(skb, skb->mac_len); |
1015 | dev_queue_xmit_nit(skb, vrf_dev); | 1018 | dev_queue_xmit_nit(skb, vrf_dev); |
1016 | skb_pull(skb, skb->mac_len); | 1019 | skb_pull(skb, skb->mac_len); |
diff --git a/drivers/net/wan/slic_ds26522.c b/drivers/net/wan/slic_ds26522.c index b776a0ab106c..9d9b4e0def2a 100644 --- a/drivers/net/wan/slic_ds26522.c +++ b/drivers/net/wan/slic_ds26522.c | |||
@@ -218,7 +218,7 @@ static int slic_ds26522_probe(struct spi_device *spi) | |||
218 | 218 | ||
219 | ret = slic_ds26522_init_configure(spi); | 219 | ret = slic_ds26522_init_configure(spi); |
220 | if (ret == 0) | 220 | if (ret == 0) |
221 | pr_info("DS26522 cs%d configurated\n", spi->chip_select); | 221 | pr_info("DS26522 cs%d configured\n", spi->chip_select); |
222 | 222 | ||
223 | return ret; | 223 | return ret; |
224 | } | 224 | } |
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index b40cfb076f02..2fc86dc7a8df 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
@@ -1193,8 +1193,8 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, | |||
1193 | blk_queue_max_hw_sectors(q, ctrl->max_hw_sectors); | 1193 | blk_queue_max_hw_sectors(q, ctrl->max_hw_sectors); |
1194 | blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX)); | 1194 | blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX)); |
1195 | } | 1195 | } |
1196 | if (ctrl->stripe_size) | 1196 | if (ctrl->quirks & NVME_QUIRK_STRIPE_SIZE) |
1197 | blk_queue_chunk_sectors(q, ctrl->stripe_size >> 9); | 1197 | blk_queue_chunk_sectors(q, ctrl->max_hw_sectors); |
1198 | blk_queue_virt_boundary(q, ctrl->page_size - 1); | 1198 | blk_queue_virt_boundary(q, ctrl->page_size - 1); |
1199 | if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) | 1199 | if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) |
1200 | vwc = true; | 1200 | vwc = true; |
@@ -1250,19 +1250,6 @@ int nvme_init_identify(struct nvme_ctrl *ctrl) | |||
1250 | ctrl->max_hw_sectors = | 1250 | ctrl->max_hw_sectors = |
1251 | min_not_zero(ctrl->max_hw_sectors, max_hw_sectors); | 1251 | min_not_zero(ctrl->max_hw_sectors, max_hw_sectors); |
1252 | 1252 | ||
1253 | if ((ctrl->quirks & NVME_QUIRK_STRIPE_SIZE) && id->vs[3]) { | ||
1254 | unsigned int max_hw_sectors; | ||
1255 | |||
1256 | ctrl->stripe_size = 1 << (id->vs[3] + page_shift); | ||
1257 | max_hw_sectors = ctrl->stripe_size >> (page_shift - 9); | ||
1258 | if (ctrl->max_hw_sectors) { | ||
1259 | ctrl->max_hw_sectors = min(max_hw_sectors, | ||
1260 | ctrl->max_hw_sectors); | ||
1261 | } else { | ||
1262 | ctrl->max_hw_sectors = max_hw_sectors; | ||
1263 | } | ||
1264 | } | ||
1265 | |||
1266 | nvme_set_queue_limits(ctrl, ctrl->admin_q); | 1253 | nvme_set_queue_limits(ctrl, ctrl->admin_q); |
1267 | ctrl->sgls = le32_to_cpu(id->sgls); | 1254 | ctrl->sgls = le32_to_cpu(id->sgls); |
1268 | ctrl->kas = le16_to_cpu(id->kas); | 1255 | ctrl->kas = le16_to_cpu(id->kas); |
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 771e2e761872..aa0bc60810a7 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c | |||
@@ -1491,19 +1491,20 @@ static int | |||
1491 | nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize) | 1491 | nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize) |
1492 | { | 1492 | { |
1493 | struct nvme_fc_queue *queue = &ctrl->queues[1]; | 1493 | struct nvme_fc_queue *queue = &ctrl->queues[1]; |
1494 | int i, j, ret; | 1494 | int i, ret; |
1495 | 1495 | ||
1496 | for (i = 1; i < ctrl->queue_count; i++, queue++) { | 1496 | for (i = 1; i < ctrl->queue_count; i++, queue++) { |
1497 | ret = __nvme_fc_create_hw_queue(ctrl, queue, i, qsize); | 1497 | ret = __nvme_fc_create_hw_queue(ctrl, queue, i, qsize); |
1498 | if (ret) { | 1498 | if (ret) |
1499 | for (j = i-1; j >= 0; j--) | 1499 | goto delete_queues; |
1500 | __nvme_fc_delete_hw_queue(ctrl, | ||
1501 | &ctrl->queues[j], j); | ||
1502 | return ret; | ||
1503 | } | ||
1504 | } | 1500 | } |
1505 | 1501 | ||
1506 | return 0; | 1502 | return 0; |
1503 | |||
1504 | delete_queues: | ||
1505 | for (; i >= 0; i--) | ||
1506 | __nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[i], i); | ||
1507 | return ret; | ||
1507 | } | 1508 | } |
1508 | 1509 | ||
1509 | static int | 1510 | static int |
@@ -2401,8 +2402,8 @@ __nvme_fc_create_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, | |||
2401 | WARN_ON_ONCE(!changed); | 2402 | WARN_ON_ONCE(!changed); |
2402 | 2403 | ||
2403 | dev_info(ctrl->ctrl.device, | 2404 | dev_info(ctrl->ctrl.device, |
2404 | "NVME-FC{%d}: new ctrl: NQN \"%s\" (%p)\n", | 2405 | "NVME-FC{%d}: new ctrl: NQN \"%s\"\n", |
2405 | ctrl->cnum, ctrl->ctrl.opts->subsysnqn, &ctrl); | 2406 | ctrl->cnum, ctrl->ctrl.opts->subsysnqn); |
2406 | 2407 | ||
2407 | kref_get(&ctrl->ctrl.kref); | 2408 | kref_get(&ctrl->ctrl.kref); |
2408 | 2409 | ||
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index bd5321441d12..6377e14586dc 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h | |||
@@ -135,7 +135,6 @@ struct nvme_ctrl { | |||
135 | 135 | ||
136 | u32 page_size; | 136 | u32 page_size; |
137 | u32 max_hw_sectors; | 137 | u32 max_hw_sectors; |
138 | u32 stripe_size; | ||
139 | u16 oncs; | 138 | u16 oncs; |
140 | u16 vid; | 139 | u16 vid; |
141 | atomic_t abort_limit; | 140 | atomic_t abort_limit; |
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 3d21a154dce7..19beeb7b2ac2 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
@@ -712,15 +712,8 @@ static void __nvme_process_cq(struct nvme_queue *nvmeq, unsigned int *tag) | |||
712 | req = blk_mq_tag_to_rq(*nvmeq->tags, cqe.command_id); | 712 | req = blk_mq_tag_to_rq(*nvmeq->tags, cqe.command_id); |
713 | nvme_req(req)->result = cqe.result; | 713 | nvme_req(req)->result = cqe.result; |
714 | blk_mq_complete_request(req, le16_to_cpu(cqe.status) >> 1); | 714 | blk_mq_complete_request(req, le16_to_cpu(cqe.status) >> 1); |
715 | |||
716 | } | 715 | } |
717 | 716 | ||
718 | /* If the controller ignores the cq head doorbell and continuously | ||
719 | * writes to the queue, it is theoretically possible to wrap around | ||
720 | * the queue twice and mistakenly return IRQ_NONE. Linux only | ||
721 | * requires that 0.1% of your interrupts are handled, so this isn't | ||
722 | * a big problem. | ||
723 | */ | ||
724 | if (head == nvmeq->cq_head && phase == nvmeq->cq_phase) | 717 | if (head == nvmeq->cq_head && phase == nvmeq->cq_phase) |
725 | return; | 718 | return; |
726 | 719 | ||
@@ -1909,10 +1902,10 @@ static int nvme_dev_map(struct nvme_dev *dev) | |||
1909 | if (!dev->bar) | 1902 | if (!dev->bar) |
1910 | goto release; | 1903 | goto release; |
1911 | 1904 | ||
1912 | return 0; | 1905 | return 0; |
1913 | release: | 1906 | release: |
1914 | pci_release_mem_regions(pdev); | 1907 | pci_release_mem_regions(pdev); |
1915 | return -ENODEV; | 1908 | return -ENODEV; |
1916 | } | 1909 | } |
1917 | 1910 | ||
1918 | static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 1911 | static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
diff --git a/drivers/nvme/host/scsi.c b/drivers/nvme/host/scsi.c index b71e95044b43..a5c09e703bd8 100644 --- a/drivers/nvme/host/scsi.c +++ b/drivers/nvme/host/scsi.c | |||
@@ -2160,30 +2160,6 @@ static int nvme_trans_synchronize_cache(struct nvme_ns *ns, | |||
2160 | return nvme_trans_status_code(hdr, nvme_sc); | 2160 | return nvme_trans_status_code(hdr, nvme_sc); |
2161 | } | 2161 | } |
2162 | 2162 | ||
2163 | static int nvme_trans_start_stop(struct nvme_ns *ns, struct sg_io_hdr *hdr, | ||
2164 | u8 *cmd) | ||
2165 | { | ||
2166 | u8 immed, no_flush; | ||
2167 | |||
2168 | immed = cmd[1] & 0x01; | ||
2169 | no_flush = cmd[4] & 0x04; | ||
2170 | |||
2171 | if (immed != 0) { | ||
2172 | return nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, | ||
2173 | ILLEGAL_REQUEST, SCSI_ASC_INVALID_CDB, | ||
2174 | SCSI_ASCQ_CAUSE_NOT_REPORTABLE); | ||
2175 | } else { | ||
2176 | if (no_flush == 0) { | ||
2177 | /* Issue NVME FLUSH command prior to START STOP UNIT */ | ||
2178 | int res = nvme_trans_synchronize_cache(ns, hdr); | ||
2179 | if (res) | ||
2180 | return res; | ||
2181 | } | ||
2182 | |||
2183 | return 0; | ||
2184 | } | ||
2185 | } | ||
2186 | |||
2187 | static int nvme_trans_format_unit(struct nvme_ns *ns, struct sg_io_hdr *hdr, | 2163 | static int nvme_trans_format_unit(struct nvme_ns *ns, struct sg_io_hdr *hdr, |
2188 | u8 *cmd) | 2164 | u8 *cmd) |
2189 | { | 2165 | { |
@@ -2439,9 +2415,6 @@ static int nvme_scsi_translate(struct nvme_ns *ns, struct sg_io_hdr *hdr) | |||
2439 | case SECURITY_PROTOCOL_OUT: | 2415 | case SECURITY_PROTOCOL_OUT: |
2440 | retcode = nvme_trans_security_protocol(ns, hdr, cmd); | 2416 | retcode = nvme_trans_security_protocol(ns, hdr, cmd); |
2441 | break; | 2417 | break; |
2442 | case START_STOP: | ||
2443 | retcode = nvme_trans_start_stop(ns, hdr, cmd); | ||
2444 | break; | ||
2445 | case SYNCHRONIZE_CACHE: | 2418 | case SYNCHRONIZE_CACHE: |
2446 | retcode = nvme_trans_synchronize_cache(ns, hdr); | 2419 | retcode = nvme_trans_synchronize_cache(ns, hdr); |
2447 | break; | 2420 | break; |
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index ec1ad2aa0a4c..95ae52390478 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c | |||
@@ -382,7 +382,6 @@ static void nvmet_execute_set_features(struct nvmet_req *req) | |||
382 | { | 382 | { |
383 | struct nvmet_subsys *subsys = req->sq->ctrl->subsys; | 383 | struct nvmet_subsys *subsys = req->sq->ctrl->subsys; |
384 | u32 cdw10 = le32_to_cpu(req->cmd->common.cdw10[0]); | 384 | u32 cdw10 = le32_to_cpu(req->cmd->common.cdw10[0]); |
385 | u64 val; | ||
386 | u32 val32; | 385 | u32 val32; |
387 | u16 status = 0; | 386 | u16 status = 0; |
388 | 387 | ||
@@ -392,8 +391,7 @@ static void nvmet_execute_set_features(struct nvmet_req *req) | |||
392 | (subsys->max_qid - 1) | ((subsys->max_qid - 1) << 16)); | 391 | (subsys->max_qid - 1) | ((subsys->max_qid - 1) << 16)); |
393 | break; | 392 | break; |
394 | case NVME_FEAT_KATO: | 393 | case NVME_FEAT_KATO: |
395 | val = le64_to_cpu(req->cmd->prop_set.value); | 394 | val32 = le32_to_cpu(req->cmd->common.cdw10[1]); |
396 | val32 = val & 0xffff; | ||
397 | req->sq->ctrl->kato = DIV_ROUND_UP(val32, 1000); | 395 | req->sq->ctrl->kato = DIV_ROUND_UP(val32, 1000); |
398 | nvmet_set_result(req, req->sq->ctrl->kato); | 396 | nvmet_set_result(req, req->sq->ctrl->kato); |
399 | break; | 397 | break; |
diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c index bcb8ebeb01c5..4e8e6a22bce1 100644 --- a/drivers/nvme/target/fcloop.c +++ b/drivers/nvme/target/fcloop.c | |||
@@ -845,7 +845,7 @@ fcloop_create_remote_port(struct device *dev, struct device_attribute *attr, | |||
845 | rport->lport = nport->lport; | 845 | rport->lport = nport->lport; |
846 | nport->rport = rport; | 846 | nport->rport = rport; |
847 | 847 | ||
848 | return ret ? ret : count; | 848 | return count; |
849 | } | 849 | } |
850 | 850 | ||
851 | 851 | ||
@@ -952,7 +952,7 @@ fcloop_create_target_port(struct device *dev, struct device_attribute *attr, | |||
952 | tport->lport = nport->lport; | 952 | tport->lport = nport->lport; |
953 | nport->tport = tport; | 953 | nport->tport = tport; |
954 | 954 | ||
955 | return ret ? ret : count; | 955 | return count; |
956 | } | 956 | } |
957 | 957 | ||
958 | 958 | ||
diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index a579126832af..620c231a2889 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c | |||
@@ -212,7 +212,7 @@ static int meson_pmx_request_gpio(struct pinctrl_dev *pcdev, | |||
212 | { | 212 | { |
213 | struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); | 213 | struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); |
214 | 214 | ||
215 | meson_pmx_disable_other_groups(pc, range->pin_base + offset, -1); | 215 | meson_pmx_disable_other_groups(pc, offset, -1); |
216 | 216 | ||
217 | return 0; | 217 | return 0; |
218 | } | 218 | } |
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c index aea310a91821..c9a146948192 100644 --- a/drivers/pinctrl/pinctrl-amd.c +++ b/drivers/pinctrl/pinctrl-amd.c | |||
@@ -382,26 +382,21 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type) | |||
382 | { | 382 | { |
383 | int ret = 0; | 383 | int ret = 0; |
384 | u32 pin_reg; | 384 | u32 pin_reg; |
385 | unsigned long flags; | 385 | unsigned long flags, irq_flags; |
386 | bool level_trig; | ||
387 | u32 active_level; | ||
388 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | 386 | struct gpio_chip *gc = irq_data_get_irq_chip_data(d); |
389 | struct amd_gpio *gpio_dev = gpiochip_get_data(gc); | 387 | struct amd_gpio *gpio_dev = gpiochip_get_data(gc); |
390 | 388 | ||
391 | spin_lock_irqsave(&gpio_dev->lock, flags); | 389 | spin_lock_irqsave(&gpio_dev->lock, flags); |
392 | pin_reg = readl(gpio_dev->base + (d->hwirq)*4); | 390 | pin_reg = readl(gpio_dev->base + (d->hwirq)*4); |
393 | 391 | ||
394 | /* | 392 | /* Ignore the settings coming from the client and |
395 | * When level_trig is set EDGE and active_level is set HIGH in BIOS | 393 | * read the values from the ACPI tables |
396 | * default settings, ignore incoming settings from client and use | 394 | * while setting the trigger type |
397 | * BIOS settings to configure GPIO register. | ||
398 | */ | 395 | */ |
399 | level_trig = !(pin_reg & (LEVEL_TRIGGER << LEVEL_TRIG_OFF)); | ||
400 | active_level = pin_reg & (ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF); | ||
401 | 396 | ||
402 | if(level_trig && | 397 | irq_flags = irq_get_trigger_type(d->irq); |
403 | ((active_level >> ACTIVE_LEVEL_OFF) == ACTIVE_HIGH)) | 398 | if (irq_flags != IRQ_TYPE_NONE) |
404 | type = IRQ_TYPE_EDGE_FALLING; | 399 | type = irq_flags; |
405 | 400 | ||
406 | switch (type & IRQ_TYPE_SENSE_MASK) { | 401 | switch (type & IRQ_TYPE_SENSE_MASK) { |
407 | case IRQ_TYPE_EDGE_RISING: | 402 | case IRQ_TYPE_EDGE_RISING: |
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 12f7d1eb65bc..07409fde02b2 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c | |||
@@ -56,6 +56,17 @@ static const struct samsung_pin_bank_type bank_type_alive = { | |||
56 | .reg_offset = { 0x00, 0x04, 0x08, 0x0c, }, | 56 | .reg_offset = { 0x00, 0x04, 0x08, 0x0c, }, |
57 | }; | 57 | }; |
58 | 58 | ||
59 | /* Exynos5433 has the 4bit widths for PINCFG_TYPE_DRV bitfields. */ | ||
60 | static const struct samsung_pin_bank_type exynos5433_bank_type_off = { | ||
61 | .fld_width = { 4, 1, 2, 4, 2, 2, }, | ||
62 | .reg_offset = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, }, | ||
63 | }; | ||
64 | |||
65 | static const struct samsung_pin_bank_type exynos5433_bank_type_alive = { | ||
66 | .fld_width = { 4, 1, 2, 4, }, | ||
67 | .reg_offset = { 0x00, 0x04, 0x08, 0x0c, }, | ||
68 | }; | ||
69 | |||
59 | static void exynos_irq_mask(struct irq_data *irqd) | 70 | static void exynos_irq_mask(struct irq_data *irqd) |
60 | { | 71 | { |
61 | struct irq_chip *chip = irq_data_get_irq_chip(irqd); | 72 | struct irq_chip *chip = irq_data_get_irq_chip(irqd); |
@@ -1335,82 +1346,82 @@ const struct samsung_pin_ctrl exynos5420_pin_ctrl[] __initconst = { | |||
1335 | 1346 | ||
1336 | /* pin banks of exynos5433 pin-controller - ALIVE */ | 1347 | /* pin banks of exynos5433 pin-controller - ALIVE */ |
1337 | static const struct samsung_pin_bank_data exynos5433_pin_banks0[] = { | 1348 | static const struct samsung_pin_bank_data exynos5433_pin_banks0[] = { |
1338 | EXYNOS_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00), | 1349 | EXYNOS5433_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00), |
1339 | EXYNOS_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04), | 1350 | EXYNOS5433_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04), |
1340 | EXYNOS_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08), | 1351 | EXYNOS5433_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08), |
1341 | EXYNOS_PIN_BANK_EINTW(8, 0x060, "gpa3", 0x0c), | 1352 | EXYNOS5433_PIN_BANK_EINTW(8, 0x060, "gpa3", 0x0c), |
1342 | EXYNOS_PIN_BANK_EINTW_EXT(8, 0x020, "gpf1", 0x1004, 1), | 1353 | EXYNOS5433_PIN_BANK_EINTW_EXT(8, 0x020, "gpf1", 0x1004, 1), |
1343 | EXYNOS_PIN_BANK_EINTW_EXT(4, 0x040, "gpf2", 0x1008, 1), | 1354 | EXYNOS5433_PIN_BANK_EINTW_EXT(4, 0x040, "gpf2", 0x1008, 1), |
1344 | EXYNOS_PIN_BANK_EINTW_EXT(4, 0x060, "gpf3", 0x100c, 1), | 1355 | EXYNOS5433_PIN_BANK_EINTW_EXT(4, 0x060, "gpf3", 0x100c, 1), |
1345 | EXYNOS_PIN_BANK_EINTW_EXT(8, 0x080, "gpf4", 0x1010, 1), | 1356 | EXYNOS5433_PIN_BANK_EINTW_EXT(8, 0x080, "gpf4", 0x1010, 1), |
1346 | EXYNOS_PIN_BANK_EINTW_EXT(8, 0x0a0, "gpf5", 0x1014, 1), | 1357 | EXYNOS5433_PIN_BANK_EINTW_EXT(8, 0x0a0, "gpf5", 0x1014, 1), |
1347 | }; | 1358 | }; |
1348 | 1359 | ||
1349 | /* pin banks of exynos5433 pin-controller - AUD */ | 1360 | /* pin banks of exynos5433 pin-controller - AUD */ |
1350 | static const struct samsung_pin_bank_data exynos5433_pin_banks1[] = { | 1361 | static const struct samsung_pin_bank_data exynos5433_pin_banks1[] = { |
1351 | EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00), | 1362 | EXYNOS5433_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00), |
1352 | EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04), | 1363 | EXYNOS5433_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04), |
1353 | }; | 1364 | }; |
1354 | 1365 | ||
1355 | /* pin banks of exynos5433 pin-controller - CPIF */ | 1366 | /* pin banks of exynos5433 pin-controller - CPIF */ |
1356 | static const struct samsung_pin_bank_data exynos5433_pin_banks2[] = { | 1367 | static const struct samsung_pin_bank_data exynos5433_pin_banks2[] = { |
1357 | EXYNOS_PIN_BANK_EINTG(2, 0x000, "gpv6", 0x00), | 1368 | EXYNOS5433_PIN_BANK_EINTG(2, 0x000, "gpv6", 0x00), |
1358 | }; | 1369 | }; |
1359 | 1370 | ||
1360 | /* pin banks of exynos5433 pin-controller - eSE */ | 1371 | /* pin banks of exynos5433 pin-controller - eSE */ |
1361 | static const struct samsung_pin_bank_data exynos5433_pin_banks3[] = { | 1372 | static const struct samsung_pin_bank_data exynos5433_pin_banks3[] = { |
1362 | EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj2", 0x00), | 1373 | EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj2", 0x00), |
1363 | }; | 1374 | }; |
1364 | 1375 | ||
1365 | /* pin banks of exynos5433 pin-controller - FINGER */ | 1376 | /* pin banks of exynos5433 pin-controller - FINGER */ |
1366 | static const struct samsung_pin_bank_data exynos5433_pin_banks4[] = { | 1377 | static const struct samsung_pin_bank_data exynos5433_pin_banks4[] = { |
1367 | EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpd5", 0x00), | 1378 | EXYNOS5433_PIN_BANK_EINTG(4, 0x000, "gpd5", 0x00), |
1368 | }; | 1379 | }; |
1369 | 1380 | ||
1370 | /* pin banks of exynos5433 pin-controller - FSYS */ | 1381 | /* pin banks of exynos5433 pin-controller - FSYS */ |
1371 | static const struct samsung_pin_bank_data exynos5433_pin_banks5[] = { | 1382 | static const struct samsung_pin_bank_data exynos5433_pin_banks5[] = { |
1372 | EXYNOS_PIN_BANK_EINTG(6, 0x000, "gph1", 0x00), | 1383 | EXYNOS5433_PIN_BANK_EINTG(6, 0x000, "gph1", 0x00), |
1373 | EXYNOS_PIN_BANK_EINTG(7, 0x020, "gpr4", 0x04), | 1384 | EXYNOS5433_PIN_BANK_EINTG(7, 0x020, "gpr4", 0x04), |
1374 | EXYNOS_PIN_BANK_EINTG(5, 0x040, "gpr0", 0x08), | 1385 | EXYNOS5433_PIN_BANK_EINTG(5, 0x040, "gpr0", 0x08), |
1375 | EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpr1", 0x0c), | 1386 | EXYNOS5433_PIN_BANK_EINTG(8, 0x060, "gpr1", 0x0c), |
1376 | EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpr2", 0x10), | 1387 | EXYNOS5433_PIN_BANK_EINTG(2, 0x080, "gpr2", 0x10), |
1377 | EXYNOS_PIN_BANK_EINTG(8, 0x0a0, "gpr3", 0x14), | 1388 | EXYNOS5433_PIN_BANK_EINTG(8, 0x0a0, "gpr3", 0x14), |
1378 | }; | 1389 | }; |
1379 | 1390 | ||
1380 | /* pin banks of exynos5433 pin-controller - IMEM */ | 1391 | /* pin banks of exynos5433 pin-controller - IMEM */ |
1381 | static const struct samsung_pin_bank_data exynos5433_pin_banks6[] = { | 1392 | static const struct samsung_pin_bank_data exynos5433_pin_banks6[] = { |
1382 | EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpf0", 0x00), | 1393 | EXYNOS5433_PIN_BANK_EINTG(8, 0x000, "gpf0", 0x00), |
1383 | }; | 1394 | }; |
1384 | 1395 | ||
1385 | /* pin banks of exynos5433 pin-controller - NFC */ | 1396 | /* pin banks of exynos5433 pin-controller - NFC */ |
1386 | static const struct samsung_pin_bank_data exynos5433_pin_banks7[] = { | 1397 | static const struct samsung_pin_bank_data exynos5433_pin_banks7[] = { |
1387 | EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj0", 0x00), | 1398 | EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj0", 0x00), |
1388 | }; | 1399 | }; |
1389 | 1400 | ||
1390 | /* pin banks of exynos5433 pin-controller - PERIC */ | 1401 | /* pin banks of exynos5433 pin-controller - PERIC */ |
1391 | static const struct samsung_pin_bank_data exynos5433_pin_banks8[] = { | 1402 | static const struct samsung_pin_bank_data exynos5433_pin_banks8[] = { |
1392 | EXYNOS_PIN_BANK_EINTG(6, 0x000, "gpv7", 0x00), | 1403 | EXYNOS5433_PIN_BANK_EINTG(6, 0x000, "gpv7", 0x00), |
1393 | EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpb0", 0x04), | 1404 | EXYNOS5433_PIN_BANK_EINTG(5, 0x020, "gpb0", 0x04), |
1394 | EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpc0", 0x08), | 1405 | EXYNOS5433_PIN_BANK_EINTG(8, 0x040, "gpc0", 0x08), |
1395 | EXYNOS_PIN_BANK_EINTG(2, 0x060, "gpc1", 0x0c), | 1406 | EXYNOS5433_PIN_BANK_EINTG(2, 0x060, "gpc1", 0x0c), |
1396 | EXYNOS_PIN_BANK_EINTG(6, 0x080, "gpc2", 0x10), | 1407 | EXYNOS5433_PIN_BANK_EINTG(6, 0x080, "gpc2", 0x10), |
1397 | EXYNOS_PIN_BANK_EINTG(8, 0x0a0, "gpc3", 0x14), | 1408 | EXYNOS5433_PIN_BANK_EINTG(8, 0x0a0, "gpc3", 0x14), |
1398 | EXYNOS_PIN_BANK_EINTG(2, 0x0c0, "gpg0", 0x18), | 1409 | EXYNOS5433_PIN_BANK_EINTG(2, 0x0c0, "gpg0", 0x18), |
1399 | EXYNOS_PIN_BANK_EINTG(4, 0x0e0, "gpd0", 0x1c), | 1410 | EXYNOS5433_PIN_BANK_EINTG(4, 0x0e0, "gpd0", 0x1c), |
1400 | EXYNOS_PIN_BANK_EINTG(6, 0x100, "gpd1", 0x20), | 1411 | EXYNOS5433_PIN_BANK_EINTG(6, 0x100, "gpd1", 0x20), |
1401 | EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpd2", 0x24), | 1412 | EXYNOS5433_PIN_BANK_EINTG(8, 0x120, "gpd2", 0x24), |
1402 | EXYNOS_PIN_BANK_EINTG(5, 0x140, "gpd4", 0x28), | 1413 | EXYNOS5433_PIN_BANK_EINTG(5, 0x140, "gpd4", 0x28), |
1403 | EXYNOS_PIN_BANK_EINTG(2, 0x160, "gpd8", 0x2c), | 1414 | EXYNOS5433_PIN_BANK_EINTG(2, 0x160, "gpd8", 0x2c), |
1404 | EXYNOS_PIN_BANK_EINTG(7, 0x180, "gpd6", 0x30), | 1415 | EXYNOS5433_PIN_BANK_EINTG(7, 0x180, "gpd6", 0x30), |
1405 | EXYNOS_PIN_BANK_EINTG(3, 0x1a0, "gpd7", 0x34), | 1416 | EXYNOS5433_PIN_BANK_EINTG(3, 0x1a0, "gpd7", 0x34), |
1406 | EXYNOS_PIN_BANK_EINTG(5, 0x1c0, "gpg1", 0x38), | 1417 | EXYNOS5433_PIN_BANK_EINTG(5, 0x1c0, "gpg1", 0x38), |
1407 | EXYNOS_PIN_BANK_EINTG(2, 0x1e0, "gpg2", 0x3c), | 1418 | EXYNOS5433_PIN_BANK_EINTG(2, 0x1e0, "gpg2", 0x3c), |
1408 | EXYNOS_PIN_BANK_EINTG(8, 0x200, "gpg3", 0x40), | 1419 | EXYNOS5433_PIN_BANK_EINTG(8, 0x200, "gpg3", 0x40), |
1409 | }; | 1420 | }; |
1410 | 1421 | ||
1411 | /* pin banks of exynos5433 pin-controller - TOUCH */ | 1422 | /* pin banks of exynos5433 pin-controller - TOUCH */ |
1412 | static const struct samsung_pin_bank_data exynos5433_pin_banks9[] = { | 1423 | static const struct samsung_pin_bank_data exynos5433_pin_banks9[] = { |
1413 | EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj1", 0x00), | 1424 | EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj1", 0x00), |
1414 | }; | 1425 | }; |
1415 | 1426 | ||
1416 | /* | 1427 | /* |
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.h b/drivers/pinctrl/samsung/pinctrl-exynos.h index 5821525a2c84..a473092fb8d2 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.h +++ b/drivers/pinctrl/samsung/pinctrl-exynos.h | |||
@@ -90,6 +90,37 @@ | |||
90 | .pctl_res_idx = pctl_idx, \ | 90 | .pctl_res_idx = pctl_idx, \ |
91 | } \ | 91 | } \ |
92 | 92 | ||
93 | #define EXYNOS5433_PIN_BANK_EINTG(pins, reg, id, offs) \ | ||
94 | { \ | ||
95 | .type = &exynos5433_bank_type_off, \ | ||
96 | .pctl_offset = reg, \ | ||
97 | .nr_pins = pins, \ | ||
98 | .eint_type = EINT_TYPE_GPIO, \ | ||
99 | .eint_offset = offs, \ | ||
100 | .name = id \ | ||
101 | } | ||
102 | |||
103 | #define EXYNOS5433_PIN_BANK_EINTW(pins, reg, id, offs) \ | ||
104 | { \ | ||
105 | .type = &exynos5433_bank_type_alive, \ | ||
106 | .pctl_offset = reg, \ | ||
107 | .nr_pins = pins, \ | ||
108 | .eint_type = EINT_TYPE_WKUP, \ | ||
109 | .eint_offset = offs, \ | ||
110 | .name = id \ | ||
111 | } | ||
112 | |||
113 | #define EXYNOS5433_PIN_BANK_EINTW_EXT(pins, reg, id, offs, pctl_idx) \ | ||
114 | { \ | ||
115 | .type = &exynos5433_bank_type_alive, \ | ||
116 | .pctl_offset = reg, \ | ||
117 | .nr_pins = pins, \ | ||
118 | .eint_type = EINT_TYPE_WKUP, \ | ||
119 | .eint_offset = offs, \ | ||
120 | .name = id, \ | ||
121 | .pctl_res_idx = pctl_idx, \ | ||
122 | } \ | ||
123 | |||
93 | /** | 124 | /** |
94 | * struct exynos_weint_data: irq specific data for all the wakeup interrupts | 125 | * struct exynos_weint_data: irq specific data for all the wakeup interrupts |
95 | * generated by the external wakeup interrupt controller. | 126 | * generated by the external wakeup interrupt controller. |
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 5fe8be089b8b..59aa8e302bc3 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig | |||
@@ -1034,7 +1034,7 @@ config SURFACE_PRO3_BUTTON | |||
1034 | 1034 | ||
1035 | config SURFACE_3_BUTTON | 1035 | config SURFACE_3_BUTTON |
1036 | tristate "Power/home/volume buttons driver for Microsoft Surface 3 tablet" | 1036 | tristate "Power/home/volume buttons driver for Microsoft Surface 3 tablet" |
1037 | depends on ACPI && KEYBOARD_GPIO | 1037 | depends on ACPI && KEYBOARD_GPIO && I2C |
1038 | ---help--- | 1038 | ---help--- |
1039 | This driver handles the power/home/volume buttons on the Microsoft Surface 3 tablet. | 1039 | This driver handles the power/home/volume buttons on the Microsoft Surface 3 tablet. |
1040 | 1040 | ||
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 61f39abf5dc8..82d67715ce76 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c | |||
@@ -177,43 +177,43 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event); | |||
177 | 177 | ||
178 | #if IS_ENABLED(CONFIG_LEDS_CLASS) | 178 | #if IS_ENABLED(CONFIG_LEDS_CLASS) |
179 | static enum led_brightness logolamp_get(struct led_classdev *cdev); | 179 | static enum led_brightness logolamp_get(struct led_classdev *cdev); |
180 | static void logolamp_set(struct led_classdev *cdev, | 180 | static int logolamp_set(struct led_classdev *cdev, |
181 | enum led_brightness brightness); | 181 | enum led_brightness brightness); |
182 | 182 | ||
183 | static struct led_classdev logolamp_led = { | 183 | static struct led_classdev logolamp_led = { |
184 | .name = "fujitsu::logolamp", | 184 | .name = "fujitsu::logolamp", |
185 | .brightness_get = logolamp_get, | 185 | .brightness_get = logolamp_get, |
186 | .brightness_set = logolamp_set | 186 | .brightness_set_blocking = logolamp_set |
187 | }; | 187 | }; |
188 | 188 | ||
189 | static enum led_brightness kblamps_get(struct led_classdev *cdev); | 189 | static enum led_brightness kblamps_get(struct led_classdev *cdev); |
190 | static void kblamps_set(struct led_classdev *cdev, | 190 | static int kblamps_set(struct led_classdev *cdev, |
191 | enum led_brightness brightness); | 191 | enum led_brightness brightness); |
192 | 192 | ||
193 | static struct led_classdev kblamps_led = { | 193 | static struct led_classdev kblamps_led = { |
194 | .name = "fujitsu::kblamps", | 194 | .name = "fujitsu::kblamps", |
195 | .brightness_get = kblamps_get, | 195 | .brightness_get = kblamps_get, |
196 | .brightness_set = kblamps_set | 196 | .brightness_set_blocking = kblamps_set |
197 | }; | 197 | }; |
198 | 198 | ||
199 | static enum led_brightness radio_led_get(struct led_classdev *cdev); | 199 | static enum led_brightness radio_led_get(struct led_classdev *cdev); |
200 | static void radio_led_set(struct led_classdev *cdev, | 200 | static int radio_led_set(struct led_classdev *cdev, |
201 | enum led_brightness brightness); | 201 | enum led_brightness brightness); |
202 | 202 | ||
203 | static struct led_classdev radio_led = { | 203 | static struct led_classdev radio_led = { |
204 | .name = "fujitsu::radio_led", | 204 | .name = "fujitsu::radio_led", |
205 | .brightness_get = radio_led_get, | 205 | .brightness_get = radio_led_get, |
206 | .brightness_set = radio_led_set | 206 | .brightness_set_blocking = radio_led_set |
207 | }; | 207 | }; |
208 | 208 | ||
209 | static enum led_brightness eco_led_get(struct led_classdev *cdev); | 209 | static enum led_brightness eco_led_get(struct led_classdev *cdev); |
210 | static void eco_led_set(struct led_classdev *cdev, | 210 | static int eco_led_set(struct led_classdev *cdev, |
211 | enum led_brightness brightness); | 211 | enum led_brightness brightness); |
212 | 212 | ||
213 | static struct led_classdev eco_led = { | 213 | static struct led_classdev eco_led = { |
214 | .name = "fujitsu::eco_led", | 214 | .name = "fujitsu::eco_led", |
215 | .brightness_get = eco_led_get, | 215 | .brightness_get = eco_led_get, |
216 | .brightness_set = eco_led_set | 216 | .brightness_set_blocking = eco_led_set |
217 | }; | 217 | }; |
218 | #endif | 218 | #endif |
219 | 219 | ||
@@ -267,48 +267,48 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2) | |||
267 | #if IS_ENABLED(CONFIG_LEDS_CLASS) | 267 | #if IS_ENABLED(CONFIG_LEDS_CLASS) |
268 | /* LED class callbacks */ | 268 | /* LED class callbacks */ |
269 | 269 | ||
270 | static void logolamp_set(struct led_classdev *cdev, | 270 | static int logolamp_set(struct led_classdev *cdev, |
271 | enum led_brightness brightness) | 271 | enum led_brightness brightness) |
272 | { | 272 | { |
273 | if (brightness >= LED_FULL) { | 273 | if (brightness >= LED_FULL) { |
274 | call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_ON); | 274 | call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_ON); |
275 | call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_ON); | 275 | return call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_ON); |
276 | } else if (brightness >= LED_HALF) { | 276 | } else if (brightness >= LED_HALF) { |
277 | call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_ON); | 277 | call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_ON); |
278 | call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_OFF); | 278 | return call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_OFF); |
279 | } else { | 279 | } else { |
280 | call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_OFF); | 280 | return call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_OFF); |
281 | } | 281 | } |
282 | } | 282 | } |
283 | 283 | ||
284 | static void kblamps_set(struct led_classdev *cdev, | 284 | static int kblamps_set(struct led_classdev *cdev, |
285 | enum led_brightness brightness) | 285 | enum led_brightness brightness) |
286 | { | 286 | { |
287 | if (brightness >= LED_FULL) | 287 | if (brightness >= LED_FULL) |
288 | call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_ON); | 288 | return call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_ON); |
289 | else | 289 | else |
290 | call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_OFF); | 290 | return call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_OFF); |
291 | } | 291 | } |
292 | 292 | ||
293 | static void radio_led_set(struct led_classdev *cdev, | 293 | static int radio_led_set(struct led_classdev *cdev, |
294 | enum led_brightness brightness) | 294 | enum led_brightness brightness) |
295 | { | 295 | { |
296 | if (brightness >= LED_FULL) | 296 | if (brightness >= LED_FULL) |
297 | call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, RADIO_LED_ON); | 297 | return call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, RADIO_LED_ON); |
298 | else | 298 | else |
299 | call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, 0x0); | 299 | return call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, 0x0); |
300 | } | 300 | } |
301 | 301 | ||
302 | static void eco_led_set(struct led_classdev *cdev, | 302 | static int eco_led_set(struct led_classdev *cdev, |
303 | enum led_brightness brightness) | 303 | enum led_brightness brightness) |
304 | { | 304 | { |
305 | int curr; | 305 | int curr; |
306 | 306 | ||
307 | curr = call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0); | 307 | curr = call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0); |
308 | if (brightness >= LED_FULL) | 308 | if (brightness >= LED_FULL) |
309 | call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr | ECO_LED_ON); | 309 | return call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr | ECO_LED_ON); |
310 | else | 310 | else |
311 | call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr & ~ECO_LED_ON); | 311 | return call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr & ~ECO_LED_ON); |
312 | } | 312 | } |
313 | 313 | ||
314 | static enum led_brightness logolamp_get(struct led_classdev *cdev) | 314 | static enum led_brightness logolamp_get(struct led_classdev *cdev) |
diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index be1ee89ee917..36d75c367d22 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c | |||
@@ -27,6 +27,45 @@ static LIST_HEAD(parent_list); | |||
27 | static DEFINE_MUTEX(parent_list_lock); | 27 | static DEFINE_MUTEX(parent_list_lock); |
28 | static struct class_compat *mdev_bus_compat_class; | 28 | static struct class_compat *mdev_bus_compat_class; |
29 | 29 | ||
30 | static LIST_HEAD(mdev_list); | ||
31 | static DEFINE_MUTEX(mdev_list_lock); | ||
32 | |||
33 | struct device *mdev_parent_dev(struct mdev_device *mdev) | ||
34 | { | ||
35 | return mdev->parent->dev; | ||
36 | } | ||
37 | EXPORT_SYMBOL(mdev_parent_dev); | ||
38 | |||
39 | void *mdev_get_drvdata(struct mdev_device *mdev) | ||
40 | { | ||
41 | return mdev->driver_data; | ||
42 | } | ||
43 | EXPORT_SYMBOL(mdev_get_drvdata); | ||
44 | |||
45 | void mdev_set_drvdata(struct mdev_device *mdev, void *data) | ||
46 | { | ||
47 | mdev->driver_data = data; | ||
48 | } | ||
49 | EXPORT_SYMBOL(mdev_set_drvdata); | ||
50 | |||
51 | struct device *mdev_dev(struct mdev_device *mdev) | ||
52 | { | ||
53 | return &mdev->dev; | ||
54 | } | ||
55 | EXPORT_SYMBOL(mdev_dev); | ||
56 | |||
57 | struct mdev_device *mdev_from_dev(struct device *dev) | ||
58 | { | ||
59 | return dev_is_mdev(dev) ? to_mdev_device(dev) : NULL; | ||
60 | } | ||
61 | EXPORT_SYMBOL(mdev_from_dev); | ||
62 | |||
63 | uuid_le mdev_uuid(struct mdev_device *mdev) | ||
64 | { | ||
65 | return mdev->uuid; | ||
66 | } | ||
67 | EXPORT_SYMBOL(mdev_uuid); | ||
68 | |||
30 | static int _find_mdev_device(struct device *dev, void *data) | 69 | static int _find_mdev_device(struct device *dev, void *data) |
31 | { | 70 | { |
32 | struct mdev_device *mdev; | 71 | struct mdev_device *mdev; |
@@ -42,7 +81,7 @@ static int _find_mdev_device(struct device *dev, void *data) | |||
42 | return 0; | 81 | return 0; |
43 | } | 82 | } |
44 | 83 | ||
45 | static bool mdev_device_exist(struct parent_device *parent, uuid_le uuid) | 84 | static bool mdev_device_exist(struct mdev_parent *parent, uuid_le uuid) |
46 | { | 85 | { |
47 | struct device *dev; | 86 | struct device *dev; |
48 | 87 | ||
@@ -56,9 +95,9 @@ static bool mdev_device_exist(struct parent_device *parent, uuid_le uuid) | |||
56 | } | 95 | } |
57 | 96 | ||
58 | /* Should be called holding parent_list_lock */ | 97 | /* Should be called holding parent_list_lock */ |
59 | static struct parent_device *__find_parent_device(struct device *dev) | 98 | static struct mdev_parent *__find_parent_device(struct device *dev) |
60 | { | 99 | { |
61 | struct parent_device *parent; | 100 | struct mdev_parent *parent; |
62 | 101 | ||
63 | list_for_each_entry(parent, &parent_list, next) { | 102 | list_for_each_entry(parent, &parent_list, next) { |
64 | if (parent->dev == dev) | 103 | if (parent->dev == dev) |
@@ -69,8 +108,8 @@ static struct parent_device *__find_parent_device(struct device *dev) | |||
69 | 108 | ||
70 | static void mdev_release_parent(struct kref *kref) | 109 | static void mdev_release_parent(struct kref *kref) |
71 | { | 110 | { |
72 | struct parent_device *parent = container_of(kref, struct parent_device, | 111 | struct mdev_parent *parent = container_of(kref, struct mdev_parent, |
73 | ref); | 112 | ref); |
74 | struct device *dev = parent->dev; | 113 | struct device *dev = parent->dev; |
75 | 114 | ||
76 | kfree(parent); | 115 | kfree(parent); |
@@ -78,7 +117,7 @@ static void mdev_release_parent(struct kref *kref) | |||
78 | } | 117 | } |
79 | 118 | ||
80 | static | 119 | static |
81 | inline struct parent_device *mdev_get_parent(struct parent_device *parent) | 120 | inline struct mdev_parent *mdev_get_parent(struct mdev_parent *parent) |
82 | { | 121 | { |
83 | if (parent) | 122 | if (parent) |
84 | kref_get(&parent->ref); | 123 | kref_get(&parent->ref); |
@@ -86,7 +125,7 @@ inline struct parent_device *mdev_get_parent(struct parent_device *parent) | |||
86 | return parent; | 125 | return parent; |
87 | } | 126 | } |
88 | 127 | ||
89 | static inline void mdev_put_parent(struct parent_device *parent) | 128 | static inline void mdev_put_parent(struct mdev_parent *parent) |
90 | { | 129 | { |
91 | if (parent) | 130 | if (parent) |
92 | kref_put(&parent->ref, mdev_release_parent); | 131 | kref_put(&parent->ref, mdev_release_parent); |
@@ -95,7 +134,7 @@ static inline void mdev_put_parent(struct parent_device *parent) | |||
95 | static int mdev_device_create_ops(struct kobject *kobj, | 134 | static int mdev_device_create_ops(struct kobject *kobj, |
96 | struct mdev_device *mdev) | 135 | struct mdev_device *mdev) |
97 | { | 136 | { |
98 | struct parent_device *parent = mdev->parent; | 137 | struct mdev_parent *parent = mdev->parent; |
99 | int ret; | 138 | int ret; |
100 | 139 | ||
101 | ret = parent->ops->create(kobj, mdev); | 140 | ret = parent->ops->create(kobj, mdev); |
@@ -122,7 +161,7 @@ static int mdev_device_create_ops(struct kobject *kobj, | |||
122 | */ | 161 | */ |
123 | static int mdev_device_remove_ops(struct mdev_device *mdev, bool force_remove) | 162 | static int mdev_device_remove_ops(struct mdev_device *mdev, bool force_remove) |
124 | { | 163 | { |
125 | struct parent_device *parent = mdev->parent; | 164 | struct mdev_parent *parent = mdev->parent; |
126 | int ret; | 165 | int ret; |
127 | 166 | ||
128 | /* | 167 | /* |
@@ -153,10 +192,10 @@ static int mdev_device_remove_cb(struct device *dev, void *data) | |||
153 | * Add device to list of registered parent devices. | 192 | * Add device to list of registered parent devices. |
154 | * Returns a negative value on error, otherwise 0. | 193 | * Returns a negative value on error, otherwise 0. |
155 | */ | 194 | */ |
156 | int mdev_register_device(struct device *dev, const struct parent_ops *ops) | 195 | int mdev_register_device(struct device *dev, const struct mdev_parent_ops *ops) |
157 | { | 196 | { |
158 | int ret; | 197 | int ret; |
159 | struct parent_device *parent; | 198 | struct mdev_parent *parent; |
160 | 199 | ||
161 | /* check for mandatory ops */ | 200 | /* check for mandatory ops */ |
162 | if (!ops || !ops->create || !ops->remove || !ops->supported_type_groups) | 201 | if (!ops || !ops->create || !ops->remove || !ops->supported_type_groups) |
@@ -229,7 +268,7 @@ EXPORT_SYMBOL(mdev_register_device); | |||
229 | 268 | ||
230 | void mdev_unregister_device(struct device *dev) | 269 | void mdev_unregister_device(struct device *dev) |
231 | { | 270 | { |
232 | struct parent_device *parent; | 271 | struct mdev_parent *parent; |
233 | bool force_remove = true; | 272 | bool force_remove = true; |
234 | 273 | ||
235 | mutex_lock(&parent_list_lock); | 274 | mutex_lock(&parent_list_lock); |
@@ -266,7 +305,7 @@ int mdev_device_create(struct kobject *kobj, struct device *dev, uuid_le uuid) | |||
266 | { | 305 | { |
267 | int ret; | 306 | int ret; |
268 | struct mdev_device *mdev; | 307 | struct mdev_device *mdev; |
269 | struct parent_device *parent; | 308 | struct mdev_parent *parent; |
270 | struct mdev_type *type = to_mdev_type(kobj); | 309 | struct mdev_type *type = to_mdev_type(kobj); |
271 | 310 | ||
272 | parent = mdev_get_parent(type->parent); | 311 | parent = mdev_get_parent(type->parent); |
@@ -316,6 +355,11 @@ int mdev_device_create(struct kobject *kobj, struct device *dev, uuid_le uuid) | |||
316 | dev_dbg(&mdev->dev, "MDEV: created\n"); | 355 | dev_dbg(&mdev->dev, "MDEV: created\n"); |
317 | 356 | ||
318 | mutex_unlock(&parent->lock); | 357 | mutex_unlock(&parent->lock); |
358 | |||
359 | mutex_lock(&mdev_list_lock); | ||
360 | list_add(&mdev->next, &mdev_list); | ||
361 | mutex_unlock(&mdev_list_lock); | ||
362 | |||
319 | return ret; | 363 | return ret; |
320 | 364 | ||
321 | create_failed: | 365 | create_failed: |
@@ -329,12 +373,30 @@ create_err: | |||
329 | 373 | ||
330 | int mdev_device_remove(struct device *dev, bool force_remove) | 374 | int mdev_device_remove(struct device *dev, bool force_remove) |
331 | { | 375 | { |
332 | struct mdev_device *mdev; | 376 | struct mdev_device *mdev, *tmp; |
333 | struct parent_device *parent; | 377 | struct mdev_parent *parent; |
334 | struct mdev_type *type; | 378 | struct mdev_type *type; |
335 | int ret; | 379 | int ret; |
380 | bool found = false; | ||
336 | 381 | ||
337 | mdev = to_mdev_device(dev); | 382 | mdev = to_mdev_device(dev); |
383 | |||
384 | mutex_lock(&mdev_list_lock); | ||
385 | list_for_each_entry(tmp, &mdev_list, next) { | ||
386 | if (tmp == mdev) { | ||
387 | found = true; | ||
388 | break; | ||
389 | } | ||
390 | } | ||
391 | |||
392 | if (found) | ||
393 | list_del(&mdev->next); | ||
394 | |||
395 | mutex_unlock(&mdev_list_lock); | ||
396 | |||
397 | if (!found) | ||
398 | return -ENODEV; | ||
399 | |||
338 | type = to_mdev_type(mdev->type_kobj); | 400 | type = to_mdev_type(mdev->type_kobj); |
339 | parent = mdev->parent; | 401 | parent = mdev->parent; |
340 | mutex_lock(&parent->lock); | 402 | mutex_lock(&parent->lock); |
@@ -342,6 +404,11 @@ int mdev_device_remove(struct device *dev, bool force_remove) | |||
342 | ret = mdev_device_remove_ops(mdev, force_remove); | 404 | ret = mdev_device_remove_ops(mdev, force_remove); |
343 | if (ret) { | 405 | if (ret) { |
344 | mutex_unlock(&parent->lock); | 406 | mutex_unlock(&parent->lock); |
407 | |||
408 | mutex_lock(&mdev_list_lock); | ||
409 | list_add(&mdev->next, &mdev_list); | ||
410 | mutex_unlock(&mdev_list_lock); | ||
411 | |||
345 | return ret; | 412 | return ret; |
346 | } | 413 | } |
347 | 414 | ||
@@ -349,7 +416,8 @@ int mdev_device_remove(struct device *dev, bool force_remove) | |||
349 | device_unregister(dev); | 416 | device_unregister(dev); |
350 | mutex_unlock(&parent->lock); | 417 | mutex_unlock(&parent->lock); |
351 | mdev_put_parent(parent); | 418 | mdev_put_parent(parent); |
352 | return ret; | 419 | |
420 | return 0; | ||
353 | } | 421 | } |
354 | 422 | ||
355 | static int __init mdev_init(void) | 423 | static int __init mdev_init(void) |
diff --git a/drivers/vfio/mdev/mdev_private.h b/drivers/vfio/mdev/mdev_private.h index d35097cbf3d7..a9cefd70a705 100644 --- a/drivers/vfio/mdev/mdev_private.h +++ b/drivers/vfio/mdev/mdev_private.h | |||
@@ -16,10 +16,33 @@ | |||
16 | int mdev_bus_register(void); | 16 | int mdev_bus_register(void); |
17 | void mdev_bus_unregister(void); | 17 | void mdev_bus_unregister(void); |
18 | 18 | ||
19 | struct mdev_parent { | ||
20 | struct device *dev; | ||
21 | const struct mdev_parent_ops *ops; | ||
22 | struct kref ref; | ||
23 | struct mutex lock; | ||
24 | struct list_head next; | ||
25 | struct kset *mdev_types_kset; | ||
26 | struct list_head type_list; | ||
27 | }; | ||
28 | |||
29 | struct mdev_device { | ||
30 | struct device dev; | ||
31 | struct mdev_parent *parent; | ||
32 | uuid_le uuid; | ||
33 | void *driver_data; | ||
34 | struct kref ref; | ||
35 | struct list_head next; | ||
36 | struct kobject *type_kobj; | ||
37 | }; | ||
38 | |||
39 | #define to_mdev_device(dev) container_of(dev, struct mdev_device, dev) | ||
40 | #define dev_is_mdev(d) ((d)->bus == &mdev_bus_type) | ||
41 | |||
19 | struct mdev_type { | 42 | struct mdev_type { |
20 | struct kobject kobj; | 43 | struct kobject kobj; |
21 | struct kobject *devices_kobj; | 44 | struct kobject *devices_kobj; |
22 | struct parent_device *parent; | 45 | struct mdev_parent *parent; |
23 | struct list_head next; | 46 | struct list_head next; |
24 | struct attribute_group *group; | 47 | struct attribute_group *group; |
25 | }; | 48 | }; |
@@ -29,8 +52,8 @@ struct mdev_type { | |||
29 | #define to_mdev_type(_kobj) \ | 52 | #define to_mdev_type(_kobj) \ |
30 | container_of(_kobj, struct mdev_type, kobj) | 53 | container_of(_kobj, struct mdev_type, kobj) |
31 | 54 | ||
32 | int parent_create_sysfs_files(struct parent_device *parent); | 55 | int parent_create_sysfs_files(struct mdev_parent *parent); |
33 | void parent_remove_sysfs_files(struct parent_device *parent); | 56 | void parent_remove_sysfs_files(struct mdev_parent *parent); |
34 | 57 | ||
35 | int mdev_create_sysfs_files(struct device *dev, struct mdev_type *type); | 58 | int mdev_create_sysfs_files(struct device *dev, struct mdev_type *type); |
36 | void mdev_remove_sysfs_files(struct device *dev, struct mdev_type *type); | 59 | void mdev_remove_sysfs_files(struct device *dev, struct mdev_type *type); |
diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c index 1a53deb2ee10..802df210929b 100644 --- a/drivers/vfio/mdev/mdev_sysfs.c +++ b/drivers/vfio/mdev/mdev_sysfs.c | |||
@@ -92,7 +92,7 @@ static struct kobj_type mdev_type_ktype = { | |||
92 | .release = mdev_type_release, | 92 | .release = mdev_type_release, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | struct mdev_type *add_mdev_supported_type(struct parent_device *parent, | 95 | struct mdev_type *add_mdev_supported_type(struct mdev_parent *parent, |
96 | struct attribute_group *group) | 96 | struct attribute_group *group) |
97 | { | 97 | { |
98 | struct mdev_type *type; | 98 | struct mdev_type *type; |
@@ -158,7 +158,7 @@ static void remove_mdev_supported_type(struct mdev_type *type) | |||
158 | kobject_put(&type->kobj); | 158 | kobject_put(&type->kobj); |
159 | } | 159 | } |
160 | 160 | ||
161 | static int add_mdev_supported_type_groups(struct parent_device *parent) | 161 | static int add_mdev_supported_type_groups(struct mdev_parent *parent) |
162 | { | 162 | { |
163 | int i; | 163 | int i; |
164 | 164 | ||
@@ -183,7 +183,7 @@ static int add_mdev_supported_type_groups(struct parent_device *parent) | |||
183 | } | 183 | } |
184 | 184 | ||
185 | /* mdev sysfs functions */ | 185 | /* mdev sysfs functions */ |
186 | void parent_remove_sysfs_files(struct parent_device *parent) | 186 | void parent_remove_sysfs_files(struct mdev_parent *parent) |
187 | { | 187 | { |
188 | struct mdev_type *type, *tmp; | 188 | struct mdev_type *type, *tmp; |
189 | 189 | ||
@@ -196,7 +196,7 @@ void parent_remove_sysfs_files(struct parent_device *parent) | |||
196 | kset_unregister(parent->mdev_types_kset); | 196 | kset_unregister(parent->mdev_types_kset); |
197 | } | 197 | } |
198 | 198 | ||
199 | int parent_create_sysfs_files(struct parent_device *parent) | 199 | int parent_create_sysfs_files(struct mdev_parent *parent) |
200 | { | 200 | { |
201 | int ret; | 201 | int ret; |
202 | 202 | ||
diff --git a/drivers/vfio/mdev/vfio_mdev.c b/drivers/vfio/mdev/vfio_mdev.c index ffc36758cb84..fa848a701b8b 100644 --- a/drivers/vfio/mdev/vfio_mdev.c +++ b/drivers/vfio/mdev/vfio_mdev.c | |||
@@ -27,7 +27,7 @@ | |||
27 | static int vfio_mdev_open(void *device_data) | 27 | static int vfio_mdev_open(void *device_data) |
28 | { | 28 | { |
29 | struct mdev_device *mdev = device_data; | 29 | struct mdev_device *mdev = device_data; |
30 | struct parent_device *parent = mdev->parent; | 30 | struct mdev_parent *parent = mdev->parent; |
31 | int ret; | 31 | int ret; |
32 | 32 | ||
33 | if (unlikely(!parent->ops->open)) | 33 | if (unlikely(!parent->ops->open)) |
@@ -46,7 +46,7 @@ static int vfio_mdev_open(void *device_data) | |||
46 | static void vfio_mdev_release(void *device_data) | 46 | static void vfio_mdev_release(void *device_data) |
47 | { | 47 | { |
48 | struct mdev_device *mdev = device_data; | 48 | struct mdev_device *mdev = device_data; |
49 | struct parent_device *parent = mdev->parent; | 49 | struct mdev_parent *parent = mdev->parent; |
50 | 50 | ||
51 | if (likely(parent->ops->release)) | 51 | if (likely(parent->ops->release)) |
52 | parent->ops->release(mdev); | 52 | parent->ops->release(mdev); |
@@ -58,7 +58,7 @@ static long vfio_mdev_unlocked_ioctl(void *device_data, | |||
58 | unsigned int cmd, unsigned long arg) | 58 | unsigned int cmd, unsigned long arg) |
59 | { | 59 | { |
60 | struct mdev_device *mdev = device_data; | 60 | struct mdev_device *mdev = device_data; |
61 | struct parent_device *parent = mdev->parent; | 61 | struct mdev_parent *parent = mdev->parent; |
62 | 62 | ||
63 | if (unlikely(!parent->ops->ioctl)) | 63 | if (unlikely(!parent->ops->ioctl)) |
64 | return -EINVAL; | 64 | return -EINVAL; |
@@ -70,7 +70,7 @@ static ssize_t vfio_mdev_read(void *device_data, char __user *buf, | |||
70 | size_t count, loff_t *ppos) | 70 | size_t count, loff_t *ppos) |
71 | { | 71 | { |
72 | struct mdev_device *mdev = device_data; | 72 | struct mdev_device *mdev = device_data; |
73 | struct parent_device *parent = mdev->parent; | 73 | struct mdev_parent *parent = mdev->parent; |
74 | 74 | ||
75 | if (unlikely(!parent->ops->read)) | 75 | if (unlikely(!parent->ops->read)) |
76 | return -EINVAL; | 76 | return -EINVAL; |
@@ -82,7 +82,7 @@ static ssize_t vfio_mdev_write(void *device_data, const char __user *buf, | |||
82 | size_t count, loff_t *ppos) | 82 | size_t count, loff_t *ppos) |
83 | { | 83 | { |
84 | struct mdev_device *mdev = device_data; | 84 | struct mdev_device *mdev = device_data; |
85 | struct parent_device *parent = mdev->parent; | 85 | struct mdev_parent *parent = mdev->parent; |
86 | 86 | ||
87 | if (unlikely(!parent->ops->write)) | 87 | if (unlikely(!parent->ops->write)) |
88 | return -EINVAL; | 88 | return -EINVAL; |
@@ -93,7 +93,7 @@ static ssize_t vfio_mdev_write(void *device_data, const char __user *buf, | |||
93 | static int vfio_mdev_mmap(void *device_data, struct vm_area_struct *vma) | 93 | static int vfio_mdev_mmap(void *device_data, struct vm_area_struct *vma) |
94 | { | 94 | { |
95 | struct mdev_device *mdev = device_data; | 95 | struct mdev_device *mdev = device_data; |
96 | struct parent_device *parent = mdev->parent; | 96 | struct mdev_parent *parent = mdev->parent; |
97 | 97 | ||
98 | if (unlikely(!parent->ops->mmap)) | 98 | if (unlikely(!parent->ops->mmap)) |
99 | return -EINVAL; | 99 | return -EINVAL; |
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index dcd7c2a99618..324c52e3a1a4 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c | |||
@@ -1142,6 +1142,10 @@ static int vfio_pci_mmap(void *device_data, struct vm_area_struct *vma) | |||
1142 | return ret; | 1142 | return ret; |
1143 | 1143 | ||
1144 | vdev->barmap[index] = pci_iomap(pdev, index, 0); | 1144 | vdev->barmap[index] = pci_iomap(pdev, index, 0); |
1145 | if (!vdev->barmap[index]) { | ||
1146 | pci_release_selected_regions(pdev, 1 << index); | ||
1147 | return -ENOMEM; | ||
1148 | } | ||
1145 | } | 1149 | } |
1146 | 1150 | ||
1147 | vma->vm_private_data = vdev; | 1151 | vma->vm_private_data = vdev; |
diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c b/drivers/vfio/pci/vfio_pci_rdwr.c index 5ffd1d9ad4bd..357243d76f10 100644 --- a/drivers/vfio/pci/vfio_pci_rdwr.c +++ b/drivers/vfio/pci/vfio_pci_rdwr.c | |||
@@ -193,7 +193,10 @@ ssize_t vfio_pci_vga_rw(struct vfio_pci_device *vdev, char __user *buf, | |||
193 | if (!vdev->has_vga) | 193 | if (!vdev->has_vga) |
194 | return -EINVAL; | 194 | return -EINVAL; |
195 | 195 | ||
196 | switch (pos) { | 196 | if (pos > 0xbfffful) |
197 | return -EINVAL; | ||
198 | |||
199 | switch ((u32)pos) { | ||
197 | case 0xa0000 ... 0xbffff: | 200 | case 0xa0000 ... 0xbffff: |
198 | count = min(count, (size_t)(0xc0000 - pos)); | 201 | count = min(count, (size_t)(0xc0000 - pos)); |
199 | iomem = ioremap_nocache(0xa0000, 0xbffff - 0xa0000 + 1); | 202 | iomem = ioremap_nocache(0xa0000, 0xbffff - 0xa0000 + 1); |
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index f3726ba12aa6..9266271a787a 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c | |||
@@ -268,28 +268,38 @@ static void vfio_lock_acct(struct task_struct *task, long npage) | |||
268 | { | 268 | { |
269 | struct vwork *vwork; | 269 | struct vwork *vwork; |
270 | struct mm_struct *mm; | 270 | struct mm_struct *mm; |
271 | bool is_current; | ||
271 | 272 | ||
272 | if (!npage) | 273 | if (!npage) |
273 | return; | 274 | return; |
274 | 275 | ||
275 | mm = get_task_mm(task); | 276 | is_current = (task->mm == current->mm); |
277 | |||
278 | mm = is_current ? task->mm : get_task_mm(task); | ||
276 | if (!mm) | 279 | if (!mm) |
277 | return; /* process exited or nothing to do */ | 280 | return; /* process exited */ |
278 | 281 | ||
279 | if (down_write_trylock(&mm->mmap_sem)) { | 282 | if (down_write_trylock(&mm->mmap_sem)) { |
280 | mm->locked_vm += npage; | 283 | mm->locked_vm += npage; |
281 | up_write(&mm->mmap_sem); | 284 | up_write(&mm->mmap_sem); |
282 | mmput(mm); | 285 | if (!is_current) |
286 | mmput(mm); | ||
283 | return; | 287 | return; |
284 | } | 288 | } |
285 | 289 | ||
290 | if (is_current) { | ||
291 | mm = get_task_mm(task); | ||
292 | if (!mm) | ||
293 | return; | ||
294 | } | ||
295 | |||
286 | /* | 296 | /* |
287 | * Couldn't get mmap_sem lock, so must setup to update | 297 | * Couldn't get mmap_sem lock, so must setup to update |
288 | * mm->locked_vm later. If locked_vm were atomic, we | 298 | * mm->locked_vm later. If locked_vm were atomic, we |
289 | * wouldn't need this silliness | 299 | * wouldn't need this silliness |
290 | */ | 300 | */ |
291 | vwork = kmalloc(sizeof(struct vwork), GFP_KERNEL); | 301 | vwork = kmalloc(sizeof(struct vwork), GFP_KERNEL); |
292 | if (!vwork) { | 302 | if (WARN_ON(!vwork)) { |
293 | mmput(mm); | 303 | mmput(mm); |
294 | return; | 304 | return; |
295 | } | 305 | } |
@@ -393,77 +403,71 @@ static int vaddr_get_pfn(struct mm_struct *mm, unsigned long vaddr, | |||
393 | static long vfio_pin_pages_remote(struct vfio_dma *dma, unsigned long vaddr, | 403 | static long vfio_pin_pages_remote(struct vfio_dma *dma, unsigned long vaddr, |
394 | long npage, unsigned long *pfn_base) | 404 | long npage, unsigned long *pfn_base) |
395 | { | 405 | { |
396 | unsigned long limit; | 406 | unsigned long limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT; |
397 | bool lock_cap = ns_capable(task_active_pid_ns(dma->task)->user_ns, | 407 | bool lock_cap = capable(CAP_IPC_LOCK); |
398 | CAP_IPC_LOCK); | 408 | long ret, pinned = 0, lock_acct = 0; |
399 | struct mm_struct *mm; | ||
400 | long ret, i = 0, lock_acct = 0; | ||
401 | bool rsvd; | 409 | bool rsvd; |
402 | dma_addr_t iova = vaddr - dma->vaddr + dma->iova; | 410 | dma_addr_t iova = vaddr - dma->vaddr + dma->iova; |
403 | 411 | ||
404 | mm = get_task_mm(dma->task); | 412 | /* This code path is only user initiated */ |
405 | if (!mm) | 413 | if (!current->mm) |
406 | return -ENODEV; | 414 | return -ENODEV; |
407 | 415 | ||
408 | ret = vaddr_get_pfn(mm, vaddr, dma->prot, pfn_base); | 416 | ret = vaddr_get_pfn(current->mm, vaddr, dma->prot, pfn_base); |
409 | if (ret) | 417 | if (ret) |
410 | goto pin_pg_remote_exit; | 418 | return ret; |
411 | 419 | ||
420 | pinned++; | ||
412 | rsvd = is_invalid_reserved_pfn(*pfn_base); | 421 | rsvd = is_invalid_reserved_pfn(*pfn_base); |
413 | limit = task_rlimit(dma->task, RLIMIT_MEMLOCK) >> PAGE_SHIFT; | ||
414 | 422 | ||
415 | /* | 423 | /* |
416 | * Reserved pages aren't counted against the user, externally pinned | 424 | * Reserved pages aren't counted against the user, externally pinned |
417 | * pages are already counted against the user. | 425 | * pages are already counted against the user. |
418 | */ | 426 | */ |
419 | if (!rsvd && !vfio_find_vpfn(dma, iova)) { | 427 | if (!rsvd && !vfio_find_vpfn(dma, iova)) { |
420 | if (!lock_cap && mm->locked_vm + 1 > limit) { | 428 | if (!lock_cap && current->mm->locked_vm + 1 > limit) { |
421 | put_pfn(*pfn_base, dma->prot); | 429 | put_pfn(*pfn_base, dma->prot); |
422 | pr_warn("%s: RLIMIT_MEMLOCK (%ld) exceeded\n", __func__, | 430 | pr_warn("%s: RLIMIT_MEMLOCK (%ld) exceeded\n", __func__, |
423 | limit << PAGE_SHIFT); | 431 | limit << PAGE_SHIFT); |
424 | ret = -ENOMEM; | 432 | return -ENOMEM; |
425 | goto pin_pg_remote_exit; | ||
426 | } | 433 | } |
427 | lock_acct++; | 434 | lock_acct++; |
428 | } | 435 | } |
429 | 436 | ||
430 | i++; | 437 | if (unlikely(disable_hugepages)) |
431 | if (likely(!disable_hugepages)) { | 438 | goto out; |
432 | /* Lock all the consecutive pages from pfn_base */ | ||
433 | for (vaddr += PAGE_SIZE, iova += PAGE_SIZE; i < npage; | ||
434 | i++, vaddr += PAGE_SIZE, iova += PAGE_SIZE) { | ||
435 | unsigned long pfn = 0; | ||
436 | 439 | ||
437 | ret = vaddr_get_pfn(mm, vaddr, dma->prot, &pfn); | 440 | /* Lock all the consecutive pages from pfn_base */ |
438 | if (ret) | 441 | for (vaddr += PAGE_SIZE, iova += PAGE_SIZE; pinned < npage; |
439 | break; | 442 | pinned++, vaddr += PAGE_SIZE, iova += PAGE_SIZE) { |
443 | unsigned long pfn = 0; | ||
440 | 444 | ||
441 | if (pfn != *pfn_base + i || | 445 | ret = vaddr_get_pfn(current->mm, vaddr, dma->prot, &pfn); |
442 | rsvd != is_invalid_reserved_pfn(pfn)) { | 446 | if (ret) |
447 | break; | ||
448 | |||
449 | if (pfn != *pfn_base + pinned || | ||
450 | rsvd != is_invalid_reserved_pfn(pfn)) { | ||
451 | put_pfn(pfn, dma->prot); | ||
452 | break; | ||
453 | } | ||
454 | |||
455 | if (!rsvd && !vfio_find_vpfn(dma, iova)) { | ||
456 | if (!lock_cap && | ||
457 | current->mm->locked_vm + lock_acct + 1 > limit) { | ||
443 | put_pfn(pfn, dma->prot); | 458 | put_pfn(pfn, dma->prot); |
459 | pr_warn("%s: RLIMIT_MEMLOCK (%ld) exceeded\n", | ||
460 | __func__, limit << PAGE_SHIFT); | ||
444 | break; | 461 | break; |
445 | } | 462 | } |
446 | 463 | lock_acct++; | |
447 | if (!rsvd && !vfio_find_vpfn(dma, iova)) { | ||
448 | if (!lock_cap && | ||
449 | mm->locked_vm + lock_acct + 1 > limit) { | ||
450 | put_pfn(pfn, dma->prot); | ||
451 | pr_warn("%s: RLIMIT_MEMLOCK (%ld) " | ||
452 | "exceeded\n", __func__, | ||
453 | limit << PAGE_SHIFT); | ||
454 | break; | ||
455 | } | ||
456 | lock_acct++; | ||
457 | } | ||
458 | } | 464 | } |
459 | } | 465 | } |
460 | 466 | ||
461 | vfio_lock_acct(dma->task, lock_acct); | 467 | out: |
462 | ret = i; | 468 | vfio_lock_acct(current, lock_acct); |
463 | 469 | ||
464 | pin_pg_remote_exit: | 470 | return pinned; |
465 | mmput(mm); | ||
466 | return ret; | ||
467 | } | 471 | } |
468 | 472 | ||
469 | static long vfio_unpin_pages_remote(struct vfio_dma *dma, dma_addr_t iova, | 473 | static long vfio_unpin_pages_remote(struct vfio_dma *dma, dma_addr_t iova, |
@@ -473,10 +477,10 @@ static long vfio_unpin_pages_remote(struct vfio_dma *dma, dma_addr_t iova, | |||
473 | long unlocked = 0, locked = 0; | 477 | long unlocked = 0, locked = 0; |
474 | long i; | 478 | long i; |
475 | 479 | ||
476 | for (i = 0; i < npage; i++) { | 480 | for (i = 0; i < npage; i++, iova += PAGE_SIZE) { |
477 | if (put_pfn(pfn++, dma->prot)) { | 481 | if (put_pfn(pfn++, dma->prot)) { |
478 | unlocked++; | 482 | unlocked++; |
479 | if (vfio_find_vpfn(dma, iova + (i << PAGE_SHIFT))) | 483 | if (vfio_find_vpfn(dma, iova)) |
480 | locked++; | 484 | locked++; |
481 | } | 485 | } |
482 | } | 486 | } |
diff --git a/drivers/video/fbdev/cobalt_lcdfb.c b/drivers/video/fbdev/cobalt_lcdfb.c index 2d3b691f3fc4..038ac6934fe9 100644 --- a/drivers/video/fbdev/cobalt_lcdfb.c +++ b/drivers/video/fbdev/cobalt_lcdfb.c | |||
@@ -308,6 +308,11 @@ static int cobalt_lcdfb_probe(struct platform_device *dev) | |||
308 | info->screen_size = resource_size(res); | 308 | info->screen_size = resource_size(res); |
309 | info->screen_base = devm_ioremap(&dev->dev, res->start, | 309 | info->screen_base = devm_ioremap(&dev->dev, res->start, |
310 | info->screen_size); | 310 | info->screen_size); |
311 | if (!info->screen_base) { | ||
312 | framebuffer_release(info); | ||
313 | return -ENOMEM; | ||
314 | } | ||
315 | |||
311 | info->fbops = &cobalt_lcd_fbops; | 316 | info->fbops = &cobalt_lcd_fbops; |
312 | info->fix = cobalt_lcdfb_fix; | 317 | info->fix = cobalt_lcdfb_fix; |
313 | info->fix.smem_start = res->start; | 318 | info->fix.smem_start = res->start; |
diff --git a/drivers/xen/arm-device.c b/drivers/xen/arm-device.c index 778acf80aacb..85dd20e05726 100644 --- a/drivers/xen/arm-device.c +++ b/drivers/xen/arm-device.c | |||
@@ -58,9 +58,13 @@ static int xen_map_device_mmio(const struct resource *resources, | |||
58 | xen_pfn_t *gpfns; | 58 | xen_pfn_t *gpfns; |
59 | xen_ulong_t *idxs; | 59 | xen_ulong_t *idxs; |
60 | int *errs; | 60 | int *errs; |
61 | struct xen_add_to_physmap_range xatp; | ||
62 | 61 | ||
63 | for (i = 0; i < count; i++) { | 62 | for (i = 0; i < count; i++) { |
63 | struct xen_add_to_physmap_range xatp = { | ||
64 | .domid = DOMID_SELF, | ||
65 | .space = XENMAPSPACE_dev_mmio | ||
66 | }; | ||
67 | |||
64 | r = &resources[i]; | 68 | r = &resources[i]; |
65 | nr = DIV_ROUND_UP(resource_size(r), XEN_PAGE_SIZE); | 69 | nr = DIV_ROUND_UP(resource_size(r), XEN_PAGE_SIZE); |
66 | if ((resource_type(r) != IORESOURCE_MEM) || (nr == 0)) | 70 | if ((resource_type(r) != IORESOURCE_MEM) || (nr == 0)) |
@@ -87,9 +91,7 @@ static int xen_map_device_mmio(const struct resource *resources, | |||
87 | idxs[j] = XEN_PFN_DOWN(r->start) + j; | 91 | idxs[j] = XEN_PFN_DOWN(r->start) + j; |
88 | } | 92 | } |
89 | 93 | ||
90 | xatp.domid = DOMID_SELF; | ||
91 | xatp.size = nr; | 94 | xatp.size = nr; |
92 | xatp.space = XENMAPSPACE_dev_mmio; | ||
93 | 95 | ||
94 | set_xen_guest_handle(xatp.gpfns, gpfns); | 96 | set_xen_guest_handle(xatp.gpfns, gpfns); |
95 | set_xen_guest_handle(xatp.idxs, idxs); | 97 | set_xen_guest_handle(xatp.idxs, idxs); |
diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c index c03f9c86c7e3..3c41470c7fc4 100644 --- a/drivers/xen/events/events_fifo.c +++ b/drivers/xen/events/events_fifo.c | |||
@@ -369,8 +369,7 @@ static void evtchn_fifo_resume(void) | |||
369 | } | 369 | } |
370 | 370 | ||
371 | ret = init_control_block(cpu, control_block); | 371 | ret = init_control_block(cpu, control_block); |
372 | if (ret < 0) | 372 | BUG_ON(ret < 0); |
373 | BUG(); | ||
374 | } | 373 | } |
375 | 374 | ||
376 | /* | 375 | /* |
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c index e8c7f09d01be..6890897a6f30 100644 --- a/drivers/xen/evtchn.c +++ b/drivers/xen/evtchn.c | |||
@@ -125,7 +125,7 @@ static int add_evtchn(struct per_user_data *u, struct user_evtchn *evtchn) | |||
125 | while (*new) { | 125 | while (*new) { |
126 | struct user_evtchn *this; | 126 | struct user_evtchn *this; |
127 | 127 | ||
128 | this = container_of(*new, struct user_evtchn, node); | 128 | this = rb_entry(*new, struct user_evtchn, node); |
129 | 129 | ||
130 | parent = *new; | 130 | parent = *new; |
131 | if (this->port < evtchn->port) | 131 | if (this->port < evtchn->port) |
@@ -157,7 +157,7 @@ static struct user_evtchn *find_evtchn(struct per_user_data *u, unsigned port) | |||
157 | while (node) { | 157 | while (node) { |
158 | struct user_evtchn *evtchn; | 158 | struct user_evtchn *evtchn; |
159 | 159 | ||
160 | evtchn = container_of(node, struct user_evtchn, node); | 160 | evtchn = rb_entry(node, struct user_evtchn, node); |
161 | 161 | ||
162 | if (evtchn->port < port) | 162 | if (evtchn->port < port) |
163 | node = node->rb_left; | 163 | node = node->rb_left; |
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 478fb91e3df2..f905d6eeb048 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c | |||
@@ -275,6 +275,10 @@ retry: | |||
275 | rc = 0; | 275 | rc = 0; |
276 | } else | 276 | } else |
277 | rc = swiotlb_late_init_with_tbl(xen_io_tlb_start, xen_io_tlb_nslabs); | 277 | rc = swiotlb_late_init_with_tbl(xen_io_tlb_start, xen_io_tlb_nslabs); |
278 | |||
279 | if (!rc) | ||
280 | swiotlb_set_max_segment(PAGE_SIZE); | ||
281 | |||
278 | return rc; | 282 | return rc; |
279 | error: | 283 | error: |
280 | if (repeat--) { | 284 | if (repeat--) { |
@@ -392,7 +396,7 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, | |||
392 | if (dma_capable(dev, dev_addr, size) && | 396 | if (dma_capable(dev, dev_addr, size) && |
393 | !range_straddles_page_boundary(phys, size) && | 397 | !range_straddles_page_boundary(phys, size) && |
394 | !xen_arch_need_swiotlb(dev, phys, dev_addr) && | 398 | !xen_arch_need_swiotlb(dev, phys, dev_addr) && |
395 | !swiotlb_force) { | 399 | (swiotlb_force != SWIOTLB_FORCE)) { |
396 | /* we are not interested in the dma_addr returned by | 400 | /* we are not interested in the dma_addr returned by |
397 | * xen_dma_map_page, only in the potential cache flushes executed | 401 | * xen_dma_map_page, only in the potential cache flushes executed |
398 | * by the function. */ | 402 | * by the function. */ |
@@ -552,7 +556,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, | |||
552 | phys_addr_t paddr = sg_phys(sg); | 556 | phys_addr_t paddr = sg_phys(sg); |
553 | dma_addr_t dev_addr = xen_phys_to_bus(paddr); | 557 | dma_addr_t dev_addr = xen_phys_to_bus(paddr); |
554 | 558 | ||
555 | if (swiotlb_force || | 559 | if (swiotlb_force == SWIOTLB_FORCE || |
556 | xen_arch_need_swiotlb(hwdev, paddr, dev_addr) || | 560 | xen_arch_need_swiotlb(hwdev, paddr, dev_addr) || |
557 | !dma_capable(hwdev, dev_addr, sg->length) || | 561 | !dma_capable(hwdev, dev_addr, sg->length) || |
558 | range_straddles_page_boundary(paddr, sg->length)) { | 562 | range_straddles_page_boundary(paddr, sg->length)) { |
diff --git a/drivers/xen/xenbus/xenbus_comms.h b/drivers/xen/xenbus/xenbus_comms.h index e74f9c1fbd80..867a2e425208 100644 --- a/drivers/xen/xenbus/xenbus_comms.h +++ b/drivers/xen/xenbus/xenbus_comms.h | |||
@@ -42,7 +42,6 @@ int xb_write(const void *data, unsigned len); | |||
42 | int xb_read(void *data, unsigned len); | 42 | int xb_read(void *data, unsigned len); |
43 | int xb_data_to_read(void); | 43 | int xb_data_to_read(void); |
44 | int xb_wait_for_data_to_read(void); | 44 | int xb_wait_for_data_to_read(void); |
45 | int xs_input_avail(void); | ||
46 | extern struct xenstore_domain_interface *xen_store_interface; | 45 | extern struct xenstore_domain_interface *xen_store_interface; |
47 | extern int xen_store_evtchn; | 46 | extern int xen_store_evtchn; |
48 | extern enum xenstore_init xen_store_domain_type; | 47 | extern enum xenstore_init xen_store_domain_type; |
diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c index 6c0ead4be784..79130b310247 100644 --- a/drivers/xen/xenbus/xenbus_dev_frontend.c +++ b/drivers/xen/xenbus/xenbus_dev_frontend.c | |||
@@ -302,6 +302,29 @@ static void watch_fired(struct xenbus_watch *watch, | |||
302 | mutex_unlock(&adap->dev_data->reply_mutex); | 302 | mutex_unlock(&adap->dev_data->reply_mutex); |
303 | } | 303 | } |
304 | 304 | ||
305 | static int xenbus_command_reply(struct xenbus_file_priv *u, | ||
306 | unsigned int msg_type, const char *reply) | ||
307 | { | ||
308 | struct { | ||
309 | struct xsd_sockmsg hdr; | ||
310 | const char body[16]; | ||
311 | } msg; | ||
312 | int rc; | ||
313 | |||
314 | msg.hdr = u->u.msg; | ||
315 | msg.hdr.type = msg_type; | ||
316 | msg.hdr.len = strlen(reply) + 1; | ||
317 | if (msg.hdr.len > sizeof(msg.body)) | ||
318 | return -E2BIG; | ||
319 | |||
320 | mutex_lock(&u->reply_mutex); | ||
321 | rc = queue_reply(&u->read_buffers, &msg, sizeof(msg.hdr) + msg.hdr.len); | ||
322 | wake_up(&u->read_waitq); | ||
323 | mutex_unlock(&u->reply_mutex); | ||
324 | |||
325 | return rc; | ||
326 | } | ||
327 | |||
305 | static int xenbus_write_transaction(unsigned msg_type, | 328 | static int xenbus_write_transaction(unsigned msg_type, |
306 | struct xenbus_file_priv *u) | 329 | struct xenbus_file_priv *u) |
307 | { | 330 | { |
@@ -316,12 +339,12 @@ static int xenbus_write_transaction(unsigned msg_type, | |||
316 | rc = -ENOMEM; | 339 | rc = -ENOMEM; |
317 | goto out; | 340 | goto out; |
318 | } | 341 | } |
319 | } else if (msg_type == XS_TRANSACTION_END) { | 342 | } else if (u->u.msg.tx_id != 0) { |
320 | list_for_each_entry(trans, &u->transactions, list) | 343 | list_for_each_entry(trans, &u->transactions, list) |
321 | if (trans->handle.id == u->u.msg.tx_id) | 344 | if (trans->handle.id == u->u.msg.tx_id) |
322 | break; | 345 | break; |
323 | if (&trans->list == &u->transactions) | 346 | if (&trans->list == &u->transactions) |
324 | return -ESRCH; | 347 | return xenbus_command_reply(u, XS_ERROR, "ENOENT"); |
325 | } | 348 | } |
326 | 349 | ||
327 | reply = xenbus_dev_request_and_reply(&u->u.msg); | 350 | reply = xenbus_dev_request_and_reply(&u->u.msg); |
@@ -372,12 +395,12 @@ static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u) | |||
372 | path = u->u.buffer + sizeof(u->u.msg); | 395 | path = u->u.buffer + sizeof(u->u.msg); |
373 | token = memchr(path, 0, u->u.msg.len); | 396 | token = memchr(path, 0, u->u.msg.len); |
374 | if (token == NULL) { | 397 | if (token == NULL) { |
375 | rc = -EILSEQ; | 398 | rc = xenbus_command_reply(u, XS_ERROR, "EINVAL"); |
376 | goto out; | 399 | goto out; |
377 | } | 400 | } |
378 | token++; | 401 | token++; |
379 | if (memchr(token, 0, u->u.msg.len - (token - path)) == NULL) { | 402 | if (memchr(token, 0, u->u.msg.len - (token - path)) == NULL) { |
380 | rc = -EILSEQ; | 403 | rc = xenbus_command_reply(u, XS_ERROR, "EINVAL"); |
381 | goto out; | 404 | goto out; |
382 | } | 405 | } |
383 | 406 | ||
@@ -411,23 +434,7 @@ static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u) | |||
411 | } | 434 | } |
412 | 435 | ||
413 | /* Success. Synthesize a reply to say all is OK. */ | 436 | /* Success. Synthesize a reply to say all is OK. */ |
414 | { | 437 | rc = xenbus_command_reply(u, msg_type, "OK"); |
415 | struct { | ||
416 | struct xsd_sockmsg hdr; | ||
417 | char body[3]; | ||
418 | } __packed reply = { | ||
419 | { | ||
420 | .type = msg_type, | ||
421 | .len = sizeof(reply.body) | ||
422 | }, | ||
423 | "OK" | ||
424 | }; | ||
425 | |||
426 | mutex_lock(&u->reply_mutex); | ||
427 | rc = queue_reply(&u->read_buffers, &reply, sizeof(reply)); | ||
428 | wake_up(&u->read_waitq); | ||
429 | mutex_unlock(&u->reply_mutex); | ||
430 | } | ||
431 | 438 | ||
432 | out: | 439 | out: |
433 | return rc; | 440 | return rc; |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 6254cee8f8f3..5db5d1340d69 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -328,6 +328,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) | |||
328 | struct file *file = iocb->ki_filp; | 328 | struct file *file = iocb->ki_filp; |
329 | struct inode *inode = bdev_file_inode(file); | 329 | struct inode *inode = bdev_file_inode(file); |
330 | struct block_device *bdev = I_BDEV(inode); | 330 | struct block_device *bdev = I_BDEV(inode); |
331 | struct blk_plug plug; | ||
331 | struct blkdev_dio *dio; | 332 | struct blkdev_dio *dio; |
332 | struct bio *bio; | 333 | struct bio *bio; |
333 | bool is_read = (iov_iter_rw(iter) == READ); | 334 | bool is_read = (iov_iter_rw(iter) == READ); |
@@ -353,6 +354,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) | |||
353 | dio->multi_bio = false; | 354 | dio->multi_bio = false; |
354 | dio->should_dirty = is_read && (iter->type == ITER_IOVEC); | 355 | dio->should_dirty = is_read && (iter->type == ITER_IOVEC); |
355 | 356 | ||
357 | blk_start_plug(&plug); | ||
356 | for (;;) { | 358 | for (;;) { |
357 | bio->bi_bdev = bdev; | 359 | bio->bi_bdev = bdev; |
358 | bio->bi_iter.bi_sector = pos >> 9; | 360 | bio->bi_iter.bi_sector = pos >> 9; |
@@ -394,6 +396,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) | |||
394 | submit_bio(bio); | 396 | submit_bio(bio); |
395 | bio = bio_alloc(GFP_KERNEL, nr_pages); | 397 | bio = bio_alloc(GFP_KERNEL, nr_pages); |
396 | } | 398 | } |
399 | blk_finish_plug(&plug); | ||
397 | 400 | ||
398 | if (!dio->is_sync) | 401 | if (!dio->is_sync) |
399 | return -EIOCBQUEUED; | 402 | return -EIOCBQUEUED; |
diff --git a/fs/buffer.c b/fs/buffer.c index d21771fcf7d3..0e87401cf335 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -1660,7 +1660,7 @@ void clean_bdev_aliases(struct block_device *bdev, sector_t block, sector_t len) | |||
1660 | head = page_buffers(page); | 1660 | head = page_buffers(page); |
1661 | bh = head; | 1661 | bh = head; |
1662 | do { | 1662 | do { |
1663 | if (!buffer_mapped(bh)) | 1663 | if (!buffer_mapped(bh) || (bh->b_blocknr < block)) |
1664 | goto next; | 1664 | goto next; |
1665 | if (bh->b_blocknr >= block + len) | 1665 | if (bh->b_blocknr >= block + len) |
1666 | break; | 1666 | break; |
diff --git a/fs/crypto/keyinfo.c b/fs/crypto/keyinfo.c index 6eeea1dcba41..95cd4c3b06c3 100644 --- a/fs/crypto/keyinfo.c +++ b/fs/crypto/keyinfo.c | |||
@@ -248,7 +248,8 @@ retry: | |||
248 | goto out; | 248 | goto out; |
249 | 249 | ||
250 | if (fscrypt_dummy_context_enabled(inode)) { | 250 | if (fscrypt_dummy_context_enabled(inode)) { |
251 | memset(raw_key, 0x42, FS_AES_256_XTS_KEY_SIZE); | 251 | memset(raw_key, 0x42, keysize/2); |
252 | memset(raw_key+keysize/2, 0x24, keysize - (keysize/2)); | ||
252 | goto got_key; | 253 | goto got_key; |
253 | } | 254 | } |
254 | 255 | ||
diff --git a/fs/crypto/policy.c b/fs/crypto/policy.c index 6ed7c2eebeec..d6cd7ea4851d 100644 --- a/fs/crypto/policy.c +++ b/fs/crypto/policy.c | |||
@@ -179,6 +179,11 @@ int fscrypt_has_permitted_context(struct inode *parent, struct inode *child) | |||
179 | BUG_ON(1); | 179 | BUG_ON(1); |
180 | } | 180 | } |
181 | 181 | ||
182 | /* No restrictions on file types which are never encrypted */ | ||
183 | if (!S_ISREG(child->i_mode) && !S_ISDIR(child->i_mode) && | ||
184 | !S_ISLNK(child->i_mode)) | ||
185 | return 1; | ||
186 | |||
182 | /* no restrictions if the parent directory is not encrypted */ | 187 | /* no restrictions if the parent directory is not encrypted */ |
183 | if (!parent->i_sb->s_cop->is_encrypted(parent)) | 188 | if (!parent->i_sb->s_cop->is_encrypted(parent)) |
184 | return 1; | 189 | return 1; |
diff --git a/fs/notify/mark.c b/fs/notify/mark.c index d3fea0bd89e2..6043306e8e21 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c | |||
@@ -510,18 +510,6 @@ void fsnotify_detach_group_marks(struct fsnotify_group *group) | |||
510 | } | 510 | } |
511 | } | 511 | } |
512 | 512 | ||
513 | void fsnotify_duplicate_mark(struct fsnotify_mark *new, struct fsnotify_mark *old) | ||
514 | { | ||
515 | assert_spin_locked(&old->lock); | ||
516 | new->inode = old->inode; | ||
517 | new->mnt = old->mnt; | ||
518 | if (old->group) | ||
519 | fsnotify_get_group(old->group); | ||
520 | new->group = old->group; | ||
521 | new->mask = old->mask; | ||
522 | new->free_mark = old->free_mark; | ||
523 | } | ||
524 | |||
525 | /* | 513 | /* |
526 | * Nothing fancy, just initialize lists and locks and counters. | 514 | * Nothing fancy, just initialize lists and locks and counters. |
527 | */ | 515 | */ |
diff --git a/fs/xfs/libxfs/xfs_ag_resv.c b/fs/xfs/libxfs/xfs_ag_resv.c index e5ebc3770460..d346d42c54d1 100644 --- a/fs/xfs/libxfs/xfs_ag_resv.c +++ b/fs/xfs/libxfs/xfs_ag_resv.c | |||
@@ -256,6 +256,9 @@ xfs_ag_resv_init( | |||
256 | goto out; | 256 | goto out; |
257 | } | 257 | } |
258 | 258 | ||
259 | ASSERT(xfs_perag_resv(pag, XFS_AG_RESV_METADATA)->ar_reserved + | ||
260 | xfs_perag_resv(pag, XFS_AG_RESV_AGFL)->ar_reserved <= | ||
261 | pag->pagf_freeblks + pag->pagf_flcount); | ||
259 | out: | 262 | out: |
260 | return error; | 263 | return error; |
261 | } | 264 | } |
diff --git a/fs/xfs/libxfs/xfs_refcount_btree.c b/fs/xfs/libxfs/xfs_refcount_btree.c index 6fb2215f8ff7..50add5272807 100644 --- a/fs/xfs/libxfs/xfs_refcount_btree.c +++ b/fs/xfs/libxfs/xfs_refcount_btree.c | |||
@@ -409,13 +409,14 @@ xfs_refcountbt_calc_size( | |||
409 | */ | 409 | */ |
410 | xfs_extlen_t | 410 | xfs_extlen_t |
411 | xfs_refcountbt_max_size( | 411 | xfs_refcountbt_max_size( |
412 | struct xfs_mount *mp) | 412 | struct xfs_mount *mp, |
413 | xfs_agblock_t agblocks) | ||
413 | { | 414 | { |
414 | /* Bail out if we're uninitialized, which can happen in mkfs. */ | 415 | /* Bail out if we're uninitialized, which can happen in mkfs. */ |
415 | if (mp->m_refc_mxr[0] == 0) | 416 | if (mp->m_refc_mxr[0] == 0) |
416 | return 0; | 417 | return 0; |
417 | 418 | ||
418 | return xfs_refcountbt_calc_size(mp, mp->m_sb.sb_agblocks); | 419 | return xfs_refcountbt_calc_size(mp, agblocks); |
419 | } | 420 | } |
420 | 421 | ||
421 | /* | 422 | /* |
@@ -430,22 +431,24 @@ xfs_refcountbt_calc_reserves( | |||
430 | { | 431 | { |
431 | struct xfs_buf *agbp; | 432 | struct xfs_buf *agbp; |
432 | struct xfs_agf *agf; | 433 | struct xfs_agf *agf; |
434 | xfs_agblock_t agblocks; | ||
433 | xfs_extlen_t tree_len; | 435 | xfs_extlen_t tree_len; |
434 | int error; | 436 | int error; |
435 | 437 | ||
436 | if (!xfs_sb_version_hasreflink(&mp->m_sb)) | 438 | if (!xfs_sb_version_hasreflink(&mp->m_sb)) |
437 | return 0; | 439 | return 0; |
438 | 440 | ||
439 | *ask += xfs_refcountbt_max_size(mp); | ||
440 | 441 | ||
441 | error = xfs_alloc_read_agf(mp, NULL, agno, 0, &agbp); | 442 | error = xfs_alloc_read_agf(mp, NULL, agno, 0, &agbp); |
442 | if (error) | 443 | if (error) |
443 | return error; | 444 | return error; |
444 | 445 | ||
445 | agf = XFS_BUF_TO_AGF(agbp); | 446 | agf = XFS_BUF_TO_AGF(agbp); |
447 | agblocks = be32_to_cpu(agf->agf_length); | ||
446 | tree_len = be32_to_cpu(agf->agf_refcount_blocks); | 448 | tree_len = be32_to_cpu(agf->agf_refcount_blocks); |
447 | xfs_buf_relse(agbp); | 449 | xfs_buf_relse(agbp); |
448 | 450 | ||
451 | *ask += xfs_refcountbt_max_size(mp, agblocks); | ||
449 | *used += tree_len; | 452 | *used += tree_len; |
450 | 453 | ||
451 | return error; | 454 | return error; |
diff --git a/fs/xfs/libxfs/xfs_refcount_btree.h b/fs/xfs/libxfs/xfs_refcount_btree.h index 3be7768bd51a..9db008b955b7 100644 --- a/fs/xfs/libxfs/xfs_refcount_btree.h +++ b/fs/xfs/libxfs/xfs_refcount_btree.h | |||
@@ -66,7 +66,8 @@ extern void xfs_refcountbt_compute_maxlevels(struct xfs_mount *mp); | |||
66 | 66 | ||
67 | extern xfs_extlen_t xfs_refcountbt_calc_size(struct xfs_mount *mp, | 67 | extern xfs_extlen_t xfs_refcountbt_calc_size(struct xfs_mount *mp, |
68 | unsigned long long len); | 68 | unsigned long long len); |
69 | extern xfs_extlen_t xfs_refcountbt_max_size(struct xfs_mount *mp); | 69 | extern xfs_extlen_t xfs_refcountbt_max_size(struct xfs_mount *mp, |
70 | xfs_agblock_t agblocks); | ||
70 | 71 | ||
71 | extern int xfs_refcountbt_calc_reserves(struct xfs_mount *mp, | 72 | extern int xfs_refcountbt_calc_reserves(struct xfs_mount *mp, |
72 | xfs_agnumber_t agno, xfs_extlen_t *ask, xfs_extlen_t *used); | 73 | xfs_agnumber_t agno, xfs_extlen_t *ask, xfs_extlen_t *used); |
diff --git a/fs/xfs/libxfs/xfs_rmap_btree.c b/fs/xfs/libxfs/xfs_rmap_btree.c index de25771764ba..74e5a54bc428 100644 --- a/fs/xfs/libxfs/xfs_rmap_btree.c +++ b/fs/xfs/libxfs/xfs_rmap_btree.c | |||
@@ -550,13 +550,14 @@ xfs_rmapbt_calc_size( | |||
550 | */ | 550 | */ |
551 | xfs_extlen_t | 551 | xfs_extlen_t |
552 | xfs_rmapbt_max_size( | 552 | xfs_rmapbt_max_size( |
553 | struct xfs_mount *mp) | 553 | struct xfs_mount *mp, |
554 | xfs_agblock_t agblocks) | ||
554 | { | 555 | { |
555 | /* Bail out if we're uninitialized, which can happen in mkfs. */ | 556 | /* Bail out if we're uninitialized, which can happen in mkfs. */ |
556 | if (mp->m_rmap_mxr[0] == 0) | 557 | if (mp->m_rmap_mxr[0] == 0) |
557 | return 0; | 558 | return 0; |
558 | 559 | ||
559 | return xfs_rmapbt_calc_size(mp, mp->m_sb.sb_agblocks); | 560 | return xfs_rmapbt_calc_size(mp, agblocks); |
560 | } | 561 | } |
561 | 562 | ||
562 | /* | 563 | /* |
@@ -571,25 +572,24 @@ xfs_rmapbt_calc_reserves( | |||
571 | { | 572 | { |
572 | struct xfs_buf *agbp; | 573 | struct xfs_buf *agbp; |
573 | struct xfs_agf *agf; | 574 | struct xfs_agf *agf; |
574 | xfs_extlen_t pool_len; | 575 | xfs_agblock_t agblocks; |
575 | xfs_extlen_t tree_len; | 576 | xfs_extlen_t tree_len; |
576 | int error; | 577 | int error; |
577 | 578 | ||
578 | if (!xfs_sb_version_hasrmapbt(&mp->m_sb)) | 579 | if (!xfs_sb_version_hasrmapbt(&mp->m_sb)) |
579 | return 0; | 580 | return 0; |
580 | 581 | ||
581 | /* Reserve 1% of the AG or enough for 1 block per record. */ | ||
582 | pool_len = max(mp->m_sb.sb_agblocks / 100, xfs_rmapbt_max_size(mp)); | ||
583 | *ask += pool_len; | ||
584 | |||
585 | error = xfs_alloc_read_agf(mp, NULL, agno, 0, &agbp); | 582 | error = xfs_alloc_read_agf(mp, NULL, agno, 0, &agbp); |
586 | if (error) | 583 | if (error) |
587 | return error; | 584 | return error; |
588 | 585 | ||
589 | agf = XFS_BUF_TO_AGF(agbp); | 586 | agf = XFS_BUF_TO_AGF(agbp); |
587 | agblocks = be32_to_cpu(agf->agf_length); | ||
590 | tree_len = be32_to_cpu(agf->agf_rmap_blocks); | 588 | tree_len = be32_to_cpu(agf->agf_rmap_blocks); |
591 | xfs_buf_relse(agbp); | 589 | xfs_buf_relse(agbp); |
592 | 590 | ||
591 | /* Reserve 1% of the AG or enough for 1 block per record. */ | ||
592 | *ask += max(agblocks / 100, xfs_rmapbt_max_size(mp, agblocks)); | ||
593 | *used += tree_len; | 593 | *used += tree_len; |
594 | 594 | ||
595 | return error; | 595 | return error; |
diff --git a/fs/xfs/libxfs/xfs_rmap_btree.h b/fs/xfs/libxfs/xfs_rmap_btree.h index 2a9ac472fb15..19c08e933049 100644 --- a/fs/xfs/libxfs/xfs_rmap_btree.h +++ b/fs/xfs/libxfs/xfs_rmap_btree.h | |||
@@ -60,7 +60,8 @@ extern void xfs_rmapbt_compute_maxlevels(struct xfs_mount *mp); | |||
60 | 60 | ||
61 | extern xfs_extlen_t xfs_rmapbt_calc_size(struct xfs_mount *mp, | 61 | extern xfs_extlen_t xfs_rmapbt_calc_size(struct xfs_mount *mp, |
62 | unsigned long long len); | 62 | unsigned long long len); |
63 | extern xfs_extlen_t xfs_rmapbt_max_size(struct xfs_mount *mp); | 63 | extern xfs_extlen_t xfs_rmapbt_max_size(struct xfs_mount *mp, |
64 | xfs_agblock_t agblocks); | ||
64 | 65 | ||
65 | extern int xfs_rmapbt_calc_reserves(struct xfs_mount *mp, | 66 | extern int xfs_rmapbt_calc_reserves(struct xfs_mount *mp, |
66 | xfs_agnumber_t agno, xfs_extlen_t *ask, xfs_extlen_t *used); | 67 | xfs_agnumber_t agno, xfs_extlen_t *ask, xfs_extlen_t *used); |
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index 93d12fa2670d..242e8091296d 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c | |||
@@ -631,6 +631,20 @@ xfs_growfs_data_private( | |||
631 | xfs_set_low_space_thresholds(mp); | 631 | xfs_set_low_space_thresholds(mp); |
632 | mp->m_alloc_set_aside = xfs_alloc_set_aside(mp); | 632 | mp->m_alloc_set_aside = xfs_alloc_set_aside(mp); |
633 | 633 | ||
634 | /* | ||
635 | * If we expanded the last AG, free the per-AG reservation | ||
636 | * so we can reinitialize it with the new size. | ||
637 | */ | ||
638 | if (new) { | ||
639 | struct xfs_perag *pag; | ||
640 | |||
641 | pag = xfs_perag_get(mp, agno); | ||
642 | error = xfs_ag_resv_free(pag); | ||
643 | xfs_perag_put(pag); | ||
644 | if (error) | ||
645 | goto out; | ||
646 | } | ||
647 | |||
634 | /* Reserve AG metadata blocks. */ | 648 | /* Reserve AG metadata blocks. */ |
635 | error = xfs_fs_reserve_ag_blocks(mp); | 649 | error = xfs_fs_reserve_ag_blocks(mp); |
636 | if (error && error != -ENOSPC) | 650 | if (error && error != -ENOSPC) |
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index ff4d6311c7f4..70ca4f608321 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c | |||
@@ -1597,7 +1597,8 @@ xfs_inode_free_cowblocks( | |||
1597 | * If the mapping is dirty or under writeback we cannot touch the | 1597 | * If the mapping is dirty or under writeback we cannot touch the |
1598 | * CoW fork. Leave it alone if we're in the midst of a directio. | 1598 | * CoW fork. Leave it alone if we're in the midst of a directio. |
1599 | */ | 1599 | */ |
1600 | if (mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY) || | 1600 | if ((VFS_I(ip)->i_state & I_DIRTY_PAGES) || |
1601 | mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY) || | ||
1601 | mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_WRITEBACK) || | 1602 | mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_WRITEBACK) || |
1602 | atomic_read(&VFS_I(ip)->i_dio_count)) | 1603 | atomic_read(&VFS_I(ip)->i_dio_count)) |
1603 | return 0; | 1604 | return 0; |
diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c index fe86a668a57e..6e4c7446c3d4 100644 --- a/fs/xfs/xfs_refcount_item.c +++ b/fs/xfs/xfs_refcount_item.c | |||
@@ -526,13 +526,14 @@ xfs_cui_recover( | |||
526 | xfs_refcount_finish_one_cleanup(tp, rcur, error); | 526 | xfs_refcount_finish_one_cleanup(tp, rcur, error); |
527 | error = xfs_defer_finish(&tp, &dfops, NULL); | 527 | error = xfs_defer_finish(&tp, &dfops, NULL); |
528 | if (error) | 528 | if (error) |
529 | goto abort_error; | 529 | goto abort_defer; |
530 | set_bit(XFS_CUI_RECOVERED, &cuip->cui_flags); | 530 | set_bit(XFS_CUI_RECOVERED, &cuip->cui_flags); |
531 | error = xfs_trans_commit(tp); | 531 | error = xfs_trans_commit(tp); |
532 | return error; | 532 | return error; |
533 | 533 | ||
534 | abort_error: | 534 | abort_error: |
535 | xfs_refcount_finish_one_cleanup(tp, rcur, error); | 535 | xfs_refcount_finish_one_cleanup(tp, rcur, error); |
536 | abort_defer: | ||
536 | xfs_defer_cancel(&dfops); | 537 | xfs_defer_cancel(&dfops); |
537 | xfs_trans_cancel(tp); | 538 | xfs_trans_cancel(tp); |
538 | return error; | 539 | return error; |
diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index 276d3023d60f..de6195e38910 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c | |||
@@ -396,7 +396,7 @@ max_retries_show( | |||
396 | int retries; | 396 | int retries; |
397 | struct xfs_error_cfg *cfg = to_error_cfg(kobject); | 397 | struct xfs_error_cfg *cfg = to_error_cfg(kobject); |
398 | 398 | ||
399 | if (cfg->retry_timeout == XFS_ERR_RETRY_FOREVER) | 399 | if (cfg->max_retries == XFS_ERR_RETRY_FOREVER) |
400 | retries = -1; | 400 | retries = -1; |
401 | else | 401 | else |
402 | retries = cfg->max_retries; | 402 | retries = cfg->max_retries; |
@@ -422,7 +422,7 @@ max_retries_store( | |||
422 | return -EINVAL; | 422 | return -EINVAL; |
423 | 423 | ||
424 | if (val == -1) | 424 | if (val == -1) |
425 | cfg->retry_timeout = XFS_ERR_RETRY_FOREVER; | 425 | cfg->max_retries = XFS_ERR_RETRY_FOREVER; |
426 | else | 426 | else |
427 | cfg->max_retries = val; | 427 | cfg->max_retries = val; |
428 | return count; | 428 | return count; |
diff --git a/include/dt-bindings/mfd/tps65217.h b/include/dt-bindings/mfd/tps65217.h deleted file mode 100644 index cafb9e60cf12..000000000000 --- a/include/dt-bindings/mfd/tps65217.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * This header provides macros for TI TPS65217 DT bindings. | ||
3 | * | ||
4 | * Copyright (C) 2016 Texas Instruments | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | * General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License along with | ||
16 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #ifndef __DT_BINDINGS_TPS65217_H__ | ||
20 | #define __DT_BINDINGS_TPS65217_H__ | ||
21 | |||
22 | #define TPS65217_IRQ_USB 0 | ||
23 | #define TPS65217_IRQ_AC 1 | ||
24 | #define TPS65217_IRQ_PB 2 | ||
25 | |||
26 | #endif | ||
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 0cf34d6cc253..487246546ebe 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -323,8 +323,6 @@ extern void fsnotify_init_mark(struct fsnotify_mark *mark, void (*free_mark)(str | |||
323 | extern struct fsnotify_mark *fsnotify_find_inode_mark(struct fsnotify_group *group, struct inode *inode); | 323 | extern struct fsnotify_mark *fsnotify_find_inode_mark(struct fsnotify_group *group, struct inode *inode); |
324 | /* find (and take a reference) to a mark associated with group and vfsmount */ | 324 | /* find (and take a reference) to a mark associated with group and vfsmount */ |
325 | extern struct fsnotify_mark *fsnotify_find_vfsmount_mark(struct fsnotify_group *group, struct vfsmount *mnt); | 325 | extern struct fsnotify_mark *fsnotify_find_vfsmount_mark(struct fsnotify_group *group, struct vfsmount *mnt); |
326 | /* copy the values from old into new */ | ||
327 | extern void fsnotify_duplicate_mark(struct fsnotify_mark *new, struct fsnotify_mark *old); | ||
328 | /* set the ignored_mask of a mark */ | 326 | /* set the ignored_mask of a mark */ |
329 | extern void fsnotify_set_mark_ignored_mask_locked(struct fsnotify_mark *mark, __u32 mask); | 327 | extern void fsnotify_set_mark_ignored_mask_locked(struct fsnotify_mark *mark, __u32 mask); |
330 | /* set the mask of a mark (might pin the object into memory */ | 328 | /* set the mask of a mark (might pin the object into memory */ |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index e0341af6950e..76f39754e7b0 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -146,15 +146,6 @@ enum { | |||
146 | DISK_EVENT_EJECT_REQUEST = 1 << 1, /* eject requested */ | 146 | DISK_EVENT_EJECT_REQUEST = 1 << 1, /* eject requested */ |
147 | }; | 147 | }; |
148 | 148 | ||
149 | #define BLK_SCSI_MAX_CMDS (256) | ||
150 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | ||
151 | |||
152 | struct blk_scsi_cmd_filter { | ||
153 | unsigned long read_ok[BLK_SCSI_CMD_PER_LONG]; | ||
154 | unsigned long write_ok[BLK_SCSI_CMD_PER_LONG]; | ||
155 | struct kobject kobj; | ||
156 | }; | ||
157 | |||
158 | struct disk_part_tbl { | 149 | struct disk_part_tbl { |
159 | struct rcu_head rcu_head; | 150 | struct rcu_head rcu_head; |
160 | int len; | 151 | int len; |
diff --git a/include/linux/mdev.h b/include/linux/mdev.h index ec819e9a115a..b6e048e1045f 100644 --- a/include/linux/mdev.h +++ b/include/linux/mdev.h | |||
@@ -13,34 +13,10 @@ | |||
13 | #ifndef MDEV_H | 13 | #ifndef MDEV_H |
14 | #define MDEV_H | 14 | #define MDEV_H |
15 | 15 | ||
16 | /* Parent device */ | 16 | struct mdev_device; |
17 | struct parent_device { | ||
18 | struct device *dev; | ||
19 | const struct parent_ops *ops; | ||
20 | |||
21 | /* internal */ | ||
22 | struct kref ref; | ||
23 | struct mutex lock; | ||
24 | struct list_head next; | ||
25 | struct kset *mdev_types_kset; | ||
26 | struct list_head type_list; | ||
27 | }; | ||
28 | |||
29 | /* Mediated device */ | ||
30 | struct mdev_device { | ||
31 | struct device dev; | ||
32 | struct parent_device *parent; | ||
33 | uuid_le uuid; | ||
34 | void *driver_data; | ||
35 | |||
36 | /* internal */ | ||
37 | struct kref ref; | ||
38 | struct list_head next; | ||
39 | struct kobject *type_kobj; | ||
40 | }; | ||
41 | 17 | ||
42 | /** | 18 | /** |
43 | * struct parent_ops - Structure to be registered for each parent device to | 19 | * struct mdev_parent_ops - Structure to be registered for each parent device to |
44 | * register the device to mdev module. | 20 | * register the device to mdev module. |
45 | * | 21 | * |
46 | * @owner: The module owner. | 22 | * @owner: The module owner. |
@@ -86,10 +62,9 @@ struct mdev_device { | |||
86 | * @mdev: mediated device structure | 62 | * @mdev: mediated device structure |
87 | * @vma: vma structure | 63 | * @vma: vma structure |
88 | * Parent device that support mediated device should be registered with mdev | 64 | * Parent device that support mediated device should be registered with mdev |
89 | * module with parent_ops structure. | 65 | * module with mdev_parent_ops structure. |
90 | **/ | 66 | **/ |
91 | 67 | struct mdev_parent_ops { | |
92 | struct parent_ops { | ||
93 | struct module *owner; | 68 | struct module *owner; |
94 | const struct attribute_group **dev_attr_groups; | 69 | const struct attribute_group **dev_attr_groups; |
95 | const struct attribute_group **mdev_attr_groups; | 70 | const struct attribute_group **mdev_attr_groups; |
@@ -103,7 +78,7 @@ struct parent_ops { | |||
103 | size_t count, loff_t *ppos); | 78 | size_t count, loff_t *ppos); |
104 | ssize_t (*write)(struct mdev_device *mdev, const char __user *buf, | 79 | ssize_t (*write)(struct mdev_device *mdev, const char __user *buf, |
105 | size_t count, loff_t *ppos); | 80 | size_t count, loff_t *ppos); |
106 | ssize_t (*ioctl)(struct mdev_device *mdev, unsigned int cmd, | 81 | long (*ioctl)(struct mdev_device *mdev, unsigned int cmd, |
107 | unsigned long arg); | 82 | unsigned long arg); |
108 | int (*mmap)(struct mdev_device *mdev, struct vm_area_struct *vma); | 83 | int (*mmap)(struct mdev_device *mdev, struct vm_area_struct *vma); |
109 | }; | 84 | }; |
@@ -142,27 +117,22 @@ struct mdev_driver { | |||
142 | }; | 117 | }; |
143 | 118 | ||
144 | #define to_mdev_driver(drv) container_of(drv, struct mdev_driver, driver) | 119 | #define to_mdev_driver(drv) container_of(drv, struct mdev_driver, driver) |
145 | #define to_mdev_device(dev) container_of(dev, struct mdev_device, dev) | ||
146 | |||
147 | static inline void *mdev_get_drvdata(struct mdev_device *mdev) | ||
148 | { | ||
149 | return mdev->driver_data; | ||
150 | } | ||
151 | 120 | ||
152 | static inline void mdev_set_drvdata(struct mdev_device *mdev, void *data) | 121 | extern void *mdev_get_drvdata(struct mdev_device *mdev); |
153 | { | 122 | extern void mdev_set_drvdata(struct mdev_device *mdev, void *data); |
154 | mdev->driver_data = data; | 123 | extern uuid_le mdev_uuid(struct mdev_device *mdev); |
155 | } | ||
156 | 124 | ||
157 | extern struct bus_type mdev_bus_type; | 125 | extern struct bus_type mdev_bus_type; |
158 | 126 | ||
159 | #define dev_is_mdev(d) ((d)->bus == &mdev_bus_type) | ||
160 | |||
161 | extern int mdev_register_device(struct device *dev, | 127 | extern int mdev_register_device(struct device *dev, |
162 | const struct parent_ops *ops); | 128 | const struct mdev_parent_ops *ops); |
163 | extern void mdev_unregister_device(struct device *dev); | 129 | extern void mdev_unregister_device(struct device *dev); |
164 | 130 | ||
165 | extern int mdev_register_driver(struct mdev_driver *drv, struct module *owner); | 131 | extern int mdev_register_driver(struct mdev_driver *drv, struct module *owner); |
166 | extern void mdev_unregister_driver(struct mdev_driver *drv); | 132 | extern void mdev_unregister_driver(struct mdev_driver *drv); |
167 | 133 | ||
134 | extern struct device *mdev_parent_dev(struct mdev_device *mdev); | ||
135 | extern struct device *mdev_dev(struct mdev_device *mdev); | ||
136 | extern struct mdev_device *mdev_from_dev(struct device *dev); | ||
137 | |||
168 | #endif /* MDEV_H */ | 138 | #endif /* MDEV_H */ |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 93bdb3485192..6533c16e27ad 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -1384,6 +1384,8 @@ int set_phv_bit(struct mlx4_dev *dev, u8 port, int new_val); | |||
1384 | int get_phv_bit(struct mlx4_dev *dev, u8 port, int *phv); | 1384 | int get_phv_bit(struct mlx4_dev *dev, u8 port, int *phv); |
1385 | int mlx4_get_is_vlan_offload_disabled(struct mlx4_dev *dev, u8 port, | 1385 | int mlx4_get_is_vlan_offload_disabled(struct mlx4_dev *dev, u8 port, |
1386 | bool *vlan_offload_disabled); | 1386 | bool *vlan_offload_disabled); |
1387 | void mlx4_handle_eth_header_mcast_prio(struct mlx4_net_trans_rule_hw_ctrl *ctrl, | ||
1388 | struct _rule_hw *eth_header); | ||
1387 | int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx); | 1389 | int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx); |
1388 | int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); | 1390 | int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); |
1389 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); | 1391 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); |
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index 9f489365b3d3..52b437431c6a 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h | |||
@@ -1071,11 +1071,6 @@ enum { | |||
1071 | MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20, | 1071 | MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20, |
1072 | }; | 1072 | }; |
1073 | 1073 | ||
1074 | enum { | ||
1075 | MLX5_PCIE_PERFORMANCE_COUNTERS_GROUP = 0x0, | ||
1076 | MLX5_PCIE_TIMERS_AND_STATES_COUNTERS_GROUP = 0x2, | ||
1077 | }; | ||
1078 | |||
1079 | static inline u16 mlx5_to_sw_pkey_sz(int pkey_sz) | 1074 | static inline u16 mlx5_to_sw_pkey_sz(int pkey_sz) |
1080 | { | 1075 | { |
1081 | if (pkey_sz > MLX5_MAX_LOG_PKEY_TABLE) | 1076 | if (pkey_sz > MLX5_MAX_LOG_PKEY_TABLE) |
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 0ae55361e674..735b36335f29 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h | |||
@@ -123,7 +123,6 @@ enum { | |||
123 | MLX5_REG_HOST_ENDIANNESS = 0x7004, | 123 | MLX5_REG_HOST_ENDIANNESS = 0x7004, |
124 | MLX5_REG_MCIA = 0x9014, | 124 | MLX5_REG_MCIA = 0x9014, |
125 | MLX5_REG_MLCR = 0x902b, | 125 | MLX5_REG_MLCR = 0x902b, |
126 | MLX5_REG_MPCNT = 0x9051, | ||
127 | }; | 126 | }; |
128 | 127 | ||
129 | enum mlx5_dcbx_oper_mode { | 128 | enum mlx5_dcbx_oper_mode { |
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 57bec544e20a..a852e9db6f0d 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h | |||
@@ -1757,80 +1757,6 @@ struct mlx5_ifc_eth_802_3_cntrs_grp_data_layout_bits { | |||
1757 | u8 reserved_at_4c0[0x300]; | 1757 | u8 reserved_at_4c0[0x300]; |
1758 | }; | 1758 | }; |
1759 | 1759 | ||
1760 | struct mlx5_ifc_pcie_perf_cntrs_grp_data_layout_bits { | ||
1761 | u8 life_time_counter_high[0x20]; | ||
1762 | |||
1763 | u8 life_time_counter_low[0x20]; | ||
1764 | |||
1765 | u8 rx_errors[0x20]; | ||
1766 | |||
1767 | u8 tx_errors[0x20]; | ||
1768 | |||
1769 | u8 l0_to_recovery_eieos[0x20]; | ||
1770 | |||
1771 | u8 l0_to_recovery_ts[0x20]; | ||
1772 | |||
1773 | u8 l0_to_recovery_framing[0x20]; | ||
1774 | |||
1775 | u8 l0_to_recovery_retrain[0x20]; | ||
1776 | |||
1777 | u8 crc_error_dllp[0x20]; | ||
1778 | |||
1779 | u8 crc_error_tlp[0x20]; | ||
1780 | |||
1781 | u8 reserved_at_140[0x680]; | ||
1782 | }; | ||
1783 | |||
1784 | struct mlx5_ifc_pcie_tas_cntrs_grp_data_layout_bits { | ||
1785 | u8 life_time_counter_high[0x20]; | ||
1786 | |||
1787 | u8 life_time_counter_low[0x20]; | ||
1788 | |||
1789 | u8 time_to_boot_image_start[0x20]; | ||
1790 | |||
1791 | u8 time_to_link_image[0x20]; | ||
1792 | |||
1793 | u8 calibration_time[0x20]; | ||
1794 | |||
1795 | u8 time_to_first_perst[0x20]; | ||
1796 | |||
1797 | u8 time_to_detect_state[0x20]; | ||
1798 | |||
1799 | u8 time_to_l0[0x20]; | ||
1800 | |||
1801 | u8 time_to_crs_en[0x20]; | ||
1802 | |||
1803 | u8 time_to_plastic_image_start[0x20]; | ||
1804 | |||
1805 | u8 time_to_iron_image_start[0x20]; | ||
1806 | |||
1807 | u8 perst_handler[0x20]; | ||
1808 | |||
1809 | u8 times_in_l1[0x20]; | ||
1810 | |||
1811 | u8 times_in_l23[0x20]; | ||
1812 | |||
1813 | u8 dl_down[0x20]; | ||
1814 | |||
1815 | u8 config_cycle1usec[0x20]; | ||
1816 | |||
1817 | u8 config_cycle2to7usec[0x20]; | ||
1818 | |||
1819 | u8 config_cycle_8to15usec[0x20]; | ||
1820 | |||
1821 | u8 config_cycle_16_to_63usec[0x20]; | ||
1822 | |||
1823 | u8 config_cycle_64usec[0x20]; | ||
1824 | |||
1825 | u8 correctable_err_msg_sent[0x20]; | ||
1826 | |||
1827 | u8 non_fatal_err_msg_sent[0x20]; | ||
1828 | |||
1829 | u8 fatal_err_msg_sent[0x20]; | ||
1830 | |||
1831 | u8 reserved_at_2e0[0x4e0]; | ||
1832 | }; | ||
1833 | |||
1834 | struct mlx5_ifc_cmd_inter_comp_event_bits { | 1760 | struct mlx5_ifc_cmd_inter_comp_event_bits { |
1835 | u8 command_completion_vector[0x20]; | 1761 | u8 command_completion_vector[0x20]; |
1836 | 1762 | ||
@@ -2995,12 +2921,6 @@ union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits { | |||
2995 | u8 reserved_at_0[0x7c0]; | 2921 | u8 reserved_at_0[0x7c0]; |
2996 | }; | 2922 | }; |
2997 | 2923 | ||
2998 | union mlx5_ifc_pcie_cntrs_grp_data_layout_auto_bits { | ||
2999 | struct mlx5_ifc_pcie_perf_cntrs_grp_data_layout_bits pcie_perf_cntrs_grp_data_layout; | ||
3000 | struct mlx5_ifc_pcie_tas_cntrs_grp_data_layout_bits pcie_tas_cntrs_grp_data_layout; | ||
3001 | u8 reserved_at_0[0x7c0]; | ||
3002 | }; | ||
3003 | |||
3004 | union mlx5_ifc_event_auto_bits { | 2924 | union mlx5_ifc_event_auto_bits { |
3005 | struct mlx5_ifc_comp_event_bits comp_event; | 2925 | struct mlx5_ifc_comp_event_bits comp_event; |
3006 | struct mlx5_ifc_dct_events_bits dct_events; | 2926 | struct mlx5_ifc_dct_events_bits dct_events; |
@@ -7320,18 +7240,6 @@ struct mlx5_ifc_ppcnt_reg_bits { | |||
7320 | union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits counter_set; | 7240 | union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits counter_set; |
7321 | }; | 7241 | }; |
7322 | 7242 | ||
7323 | struct mlx5_ifc_mpcnt_reg_bits { | ||
7324 | u8 reserved_at_0[0x8]; | ||
7325 | u8 pcie_index[0x8]; | ||
7326 | u8 reserved_at_10[0xa]; | ||
7327 | u8 grp[0x6]; | ||
7328 | |||
7329 | u8 clr[0x1]; | ||
7330 | u8 reserved_at_21[0x1f]; | ||
7331 | |||
7332 | union mlx5_ifc_pcie_cntrs_grp_data_layout_auto_bits counter_set; | ||
7333 | }; | ||
7334 | |||
7335 | struct mlx5_ifc_ppad_reg_bits { | 7243 | struct mlx5_ifc_ppad_reg_bits { |
7336 | u8 reserved_at_0[0x3]; | 7244 | u8 reserved_at_0[0x3]; |
7337 | u8 single_mac[0x1]; | 7245 | u8 single_mac[0x1]; |
@@ -7937,7 +7845,6 @@ union mlx5_ifc_ports_control_registers_document_bits { | |||
7937 | struct mlx5_ifc_pmtu_reg_bits pmtu_reg; | 7845 | struct mlx5_ifc_pmtu_reg_bits pmtu_reg; |
7938 | struct mlx5_ifc_ppad_reg_bits ppad_reg; | 7846 | struct mlx5_ifc_ppad_reg_bits ppad_reg; |
7939 | struct mlx5_ifc_ppcnt_reg_bits ppcnt_reg; | 7847 | struct mlx5_ifc_ppcnt_reg_bits ppcnt_reg; |
7940 | struct mlx5_ifc_mpcnt_reg_bits mpcnt_reg; | ||
7941 | struct mlx5_ifc_pplm_reg_bits pplm_reg; | 7848 | struct mlx5_ifc_pplm_reg_bits pplm_reg; |
7942 | struct mlx5_ifc_pplr_reg_bits pplr_reg; | 7849 | struct mlx5_ifc_pplr_reg_bits pplr_reg; |
7943 | struct mlx5_ifc_ppsc_reg_bits ppsc_reg; | 7850 | struct mlx5_ifc_ppsc_reg_bits ppsc_reg; |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 183f37c8a5e1..4ee479f2f355 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
@@ -9,7 +9,13 @@ struct device; | |||
9 | struct page; | 9 | struct page; |
10 | struct scatterlist; | 10 | struct scatterlist; |
11 | 11 | ||
12 | extern int swiotlb_force; | 12 | enum swiotlb_force { |
13 | SWIOTLB_NORMAL, /* Default - depending on HW DMA mask etc. */ | ||
14 | SWIOTLB_FORCE, /* swiotlb=force */ | ||
15 | SWIOTLB_NO_FORCE, /* swiotlb=noforce */ | ||
16 | }; | ||
17 | |||
18 | extern enum swiotlb_force swiotlb_force; | ||
13 | 19 | ||
14 | /* | 20 | /* |
15 | * Maximum allowable number of contiguous slabs to map, | 21 | * Maximum allowable number of contiguous slabs to map, |
@@ -108,11 +114,14 @@ swiotlb_dma_supported(struct device *hwdev, u64 mask); | |||
108 | 114 | ||
109 | #ifdef CONFIG_SWIOTLB | 115 | #ifdef CONFIG_SWIOTLB |
110 | extern void __init swiotlb_free(void); | 116 | extern void __init swiotlb_free(void); |
117 | unsigned int swiotlb_max_segment(void); | ||
111 | #else | 118 | #else |
112 | static inline void swiotlb_free(void) { } | 119 | static inline void swiotlb_free(void) { } |
120 | static inline unsigned int swiotlb_max_segment(void) { return 0; } | ||
113 | #endif | 121 | #endif |
114 | 122 | ||
115 | extern void swiotlb_print_info(void); | 123 | extern void swiotlb_print_info(void); |
116 | extern int is_swiotlb_buffer(phys_addr_t paddr); | 124 | extern int is_swiotlb_buffer(phys_addr_t paddr); |
125 | extern void swiotlb_set_max_segment(unsigned int); | ||
117 | 126 | ||
118 | #endif /* __LINUX_SWIOTLB_H */ | 127 | #endif /* __LINUX_SWIOTLB_H */ |
diff --git a/include/trace/events/swiotlb.h b/include/trace/events/swiotlb.h index 7ea4c5e7c448..288c0c54a2b4 100644 --- a/include/trace/events/swiotlb.h +++ b/include/trace/events/swiotlb.h | |||
@@ -11,16 +11,16 @@ TRACE_EVENT(swiotlb_bounced, | |||
11 | TP_PROTO(struct device *dev, | 11 | TP_PROTO(struct device *dev, |
12 | dma_addr_t dev_addr, | 12 | dma_addr_t dev_addr, |
13 | size_t size, | 13 | size_t size, |
14 | int swiotlb_force), | 14 | enum swiotlb_force swiotlb_force), |
15 | 15 | ||
16 | TP_ARGS(dev, dev_addr, size, swiotlb_force), | 16 | TP_ARGS(dev, dev_addr, size, swiotlb_force), |
17 | 17 | ||
18 | TP_STRUCT__entry( | 18 | TP_STRUCT__entry( |
19 | __string( dev_name, dev_name(dev) ) | 19 | __string( dev_name, dev_name(dev) ) |
20 | __field( u64, dma_mask ) | 20 | __field( u64, dma_mask ) |
21 | __field( dma_addr_t, dev_addr ) | 21 | __field( dma_addr_t, dev_addr ) |
22 | __field( size_t, size ) | 22 | __field( size_t, size ) |
23 | __field( int, swiotlb_force ) | 23 | __field( enum swiotlb_force, swiotlb_force ) |
24 | ), | 24 | ), |
25 | 25 | ||
26 | TP_fast_assign( | 26 | TP_fast_assign( |
@@ -37,7 +37,10 @@ TRACE_EVENT(swiotlb_bounced, | |||
37 | __entry->dma_mask, | 37 | __entry->dma_mask, |
38 | (unsigned long long)__entry->dev_addr, | 38 | (unsigned long long)__entry->dev_addr, |
39 | __entry->size, | 39 | __entry->size, |
40 | __entry->swiotlb_force ? "swiotlb_force" : "" ) | 40 | __print_symbolic(__entry->swiotlb_force, |
41 | { SWIOTLB_NORMAL, "NORMAL" }, | ||
42 | { SWIOTLB_FORCE, "FORCE" }, | ||
43 | { SWIOTLB_NO_FORCE, "NO_FORCE" })) | ||
41 | ); | 44 | ); |
42 | 45 | ||
43 | #endif /* _TRACE_SWIOTLB_H */ | 46 | #endif /* _TRACE_SWIOTLB_H */ |
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c index 8b1dde96a0fa..7b44195da81b 100644 --- a/kernel/audit_tree.c +++ b/kernel/audit_tree.c | |||
@@ -231,9 +231,11 @@ static void untag_chunk(struct node *p) | |||
231 | if (size) | 231 | if (size) |
232 | new = alloc_chunk(size); | 232 | new = alloc_chunk(size); |
233 | 233 | ||
234 | mutex_lock(&entry->group->mark_mutex); | ||
234 | spin_lock(&entry->lock); | 235 | spin_lock(&entry->lock); |
235 | if (chunk->dead || !entry->inode) { | 236 | if (chunk->dead || !entry->inode) { |
236 | spin_unlock(&entry->lock); | 237 | spin_unlock(&entry->lock); |
238 | mutex_unlock(&entry->group->mark_mutex); | ||
237 | if (new) | 239 | if (new) |
238 | free_chunk(new); | 240 | free_chunk(new); |
239 | goto out; | 241 | goto out; |
@@ -251,6 +253,7 @@ static void untag_chunk(struct node *p) | |||
251 | list_del_rcu(&chunk->hash); | 253 | list_del_rcu(&chunk->hash); |
252 | spin_unlock(&hash_lock); | 254 | spin_unlock(&hash_lock); |
253 | spin_unlock(&entry->lock); | 255 | spin_unlock(&entry->lock); |
256 | mutex_unlock(&entry->group->mark_mutex); | ||
254 | fsnotify_destroy_mark(entry, audit_tree_group); | 257 | fsnotify_destroy_mark(entry, audit_tree_group); |
255 | goto out; | 258 | goto out; |
256 | } | 259 | } |
@@ -258,8 +261,8 @@ static void untag_chunk(struct node *p) | |||
258 | if (!new) | 261 | if (!new) |
259 | goto Fallback; | 262 | goto Fallback; |
260 | 263 | ||
261 | fsnotify_duplicate_mark(&new->mark, entry); | 264 | if (fsnotify_add_mark_locked(&new->mark, entry->group, entry->inode, |
262 | if (fsnotify_add_mark(&new->mark, new->mark.group, new->mark.inode, NULL, 1)) { | 265 | NULL, 1)) { |
263 | fsnotify_put_mark(&new->mark); | 266 | fsnotify_put_mark(&new->mark); |
264 | goto Fallback; | 267 | goto Fallback; |
265 | } | 268 | } |
@@ -293,6 +296,7 @@ static void untag_chunk(struct node *p) | |||
293 | owner->root = new; | 296 | owner->root = new; |
294 | spin_unlock(&hash_lock); | 297 | spin_unlock(&hash_lock); |
295 | spin_unlock(&entry->lock); | 298 | spin_unlock(&entry->lock); |
299 | mutex_unlock(&entry->group->mark_mutex); | ||
296 | fsnotify_destroy_mark(entry, audit_tree_group); | 300 | fsnotify_destroy_mark(entry, audit_tree_group); |
297 | fsnotify_put_mark(&new->mark); /* drop initial reference */ | 301 | fsnotify_put_mark(&new->mark); /* drop initial reference */ |
298 | goto out; | 302 | goto out; |
@@ -309,6 +313,7 @@ Fallback: | |||
309 | put_tree(owner); | 313 | put_tree(owner); |
310 | spin_unlock(&hash_lock); | 314 | spin_unlock(&hash_lock); |
311 | spin_unlock(&entry->lock); | 315 | spin_unlock(&entry->lock); |
316 | mutex_unlock(&entry->group->mark_mutex); | ||
312 | out: | 317 | out: |
313 | fsnotify_put_mark(entry); | 318 | fsnotify_put_mark(entry); |
314 | spin_lock(&hash_lock); | 319 | spin_lock(&hash_lock); |
@@ -386,18 +391,21 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree) | |||
386 | 391 | ||
387 | chunk_entry = &chunk->mark; | 392 | chunk_entry = &chunk->mark; |
388 | 393 | ||
394 | mutex_lock(&old_entry->group->mark_mutex); | ||
389 | spin_lock(&old_entry->lock); | 395 | spin_lock(&old_entry->lock); |
390 | if (!old_entry->inode) { | 396 | if (!old_entry->inode) { |
391 | /* old_entry is being shot, lets just lie */ | 397 | /* old_entry is being shot, lets just lie */ |
392 | spin_unlock(&old_entry->lock); | 398 | spin_unlock(&old_entry->lock); |
399 | mutex_unlock(&old_entry->group->mark_mutex); | ||
393 | fsnotify_put_mark(old_entry); | 400 | fsnotify_put_mark(old_entry); |
394 | free_chunk(chunk); | 401 | free_chunk(chunk); |
395 | return -ENOENT; | 402 | return -ENOENT; |
396 | } | 403 | } |
397 | 404 | ||
398 | fsnotify_duplicate_mark(chunk_entry, old_entry); | 405 | if (fsnotify_add_mark_locked(chunk_entry, old_entry->group, |
399 | if (fsnotify_add_mark(chunk_entry, chunk_entry->group, chunk_entry->inode, NULL, 1)) { | 406 | old_entry->inode, NULL, 1)) { |
400 | spin_unlock(&old_entry->lock); | 407 | spin_unlock(&old_entry->lock); |
408 | mutex_unlock(&old_entry->group->mark_mutex); | ||
401 | fsnotify_put_mark(chunk_entry); | 409 | fsnotify_put_mark(chunk_entry); |
402 | fsnotify_put_mark(old_entry); | 410 | fsnotify_put_mark(old_entry); |
403 | return -ENOSPC; | 411 | return -ENOSPC; |
@@ -413,6 +421,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree) | |||
413 | chunk->dead = 1; | 421 | chunk->dead = 1; |
414 | spin_unlock(&chunk_entry->lock); | 422 | spin_unlock(&chunk_entry->lock); |
415 | spin_unlock(&old_entry->lock); | 423 | spin_unlock(&old_entry->lock); |
424 | mutex_unlock(&old_entry->group->mark_mutex); | ||
416 | 425 | ||
417 | fsnotify_destroy_mark(chunk_entry, audit_tree_group); | 426 | fsnotify_destroy_mark(chunk_entry, audit_tree_group); |
418 | 427 | ||
@@ -445,6 +454,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree) | |||
445 | spin_unlock(&hash_lock); | 454 | spin_unlock(&hash_lock); |
446 | spin_unlock(&chunk_entry->lock); | 455 | spin_unlock(&chunk_entry->lock); |
447 | spin_unlock(&old_entry->lock); | 456 | spin_unlock(&old_entry->lock); |
457 | mutex_unlock(&old_entry->group->mark_mutex); | ||
448 | fsnotify_destroy_mark(old_entry, audit_tree_group); | 458 | fsnotify_destroy_mark(old_entry, audit_tree_group); |
449 | fsnotify_put_mark(chunk_entry); /* drop initial reference */ | 459 | fsnotify_put_mark(chunk_entry); /* drop initial reference */ |
450 | fsnotify_put_mark(old_entry); /* pair to fsnotify_find mark_entry */ | 460 | fsnotify_put_mark(old_entry); /* pair to fsnotify_find mark_entry */ |
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index cb1b54ee8527..975b8fc4f1e1 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -53,7 +53,7 @@ | |||
53 | */ | 53 | */ |
54 | #define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT) | 54 | #define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT) |
55 | 55 | ||
56 | int swiotlb_force; | 56 | enum swiotlb_force swiotlb_force; |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * Used to do a quick range check in swiotlb_tbl_unmap_single and | 59 | * Used to do a quick range check in swiotlb_tbl_unmap_single and |
@@ -83,6 +83,12 @@ static unsigned int *io_tlb_list; | |||
83 | static unsigned int io_tlb_index; | 83 | static unsigned int io_tlb_index; |
84 | 84 | ||
85 | /* | 85 | /* |
86 | * Max segment that we can provide which (if pages are contingous) will | ||
87 | * not be bounced (unless SWIOTLB_FORCE is set). | ||
88 | */ | ||
89 | unsigned int max_segment; | ||
90 | |||
91 | /* | ||
86 | * We need to save away the original address corresponding to a mapped entry | 92 | * We need to save away the original address corresponding to a mapped entry |
87 | * for the sync operations. | 93 | * for the sync operations. |
88 | */ | 94 | */ |
@@ -106,8 +112,12 @@ setup_io_tlb_npages(char *str) | |||
106 | } | 112 | } |
107 | if (*str == ',') | 113 | if (*str == ',') |
108 | ++str; | 114 | ++str; |
109 | if (!strcmp(str, "force")) | 115 | if (!strcmp(str, "force")) { |
110 | swiotlb_force = 1; | 116 | swiotlb_force = SWIOTLB_FORCE; |
117 | } else if (!strcmp(str, "noforce")) { | ||
118 | swiotlb_force = SWIOTLB_NO_FORCE; | ||
119 | io_tlb_nslabs = 1; | ||
120 | } | ||
111 | 121 | ||
112 | return 0; | 122 | return 0; |
113 | } | 123 | } |
@@ -120,6 +130,20 @@ unsigned long swiotlb_nr_tbl(void) | |||
120 | } | 130 | } |
121 | EXPORT_SYMBOL_GPL(swiotlb_nr_tbl); | 131 | EXPORT_SYMBOL_GPL(swiotlb_nr_tbl); |
122 | 132 | ||
133 | unsigned int swiotlb_max_segment(void) | ||
134 | { | ||
135 | return max_segment; | ||
136 | } | ||
137 | EXPORT_SYMBOL_GPL(swiotlb_max_segment); | ||
138 | |||
139 | void swiotlb_set_max_segment(unsigned int val) | ||
140 | { | ||
141 | if (swiotlb_force == SWIOTLB_FORCE) | ||
142 | max_segment = 1; | ||
143 | else | ||
144 | max_segment = rounddown(val, PAGE_SIZE); | ||
145 | } | ||
146 | |||
123 | /* default to 64MB */ | 147 | /* default to 64MB */ |
124 | #define IO_TLB_DEFAULT_SIZE (64UL<<20) | 148 | #define IO_TLB_DEFAULT_SIZE (64UL<<20) |
125 | unsigned long swiotlb_size_or_default(void) | 149 | unsigned long swiotlb_size_or_default(void) |
@@ -201,6 +225,7 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose) | |||
201 | if (verbose) | 225 | if (verbose) |
202 | swiotlb_print_info(); | 226 | swiotlb_print_info(); |
203 | 227 | ||
228 | swiotlb_set_max_segment(io_tlb_nslabs << IO_TLB_SHIFT); | ||
204 | return 0; | 229 | return 0; |
205 | } | 230 | } |
206 | 231 | ||
@@ -279,6 +304,7 @@ swiotlb_late_init_with_default_size(size_t default_size) | |||
279 | rc = swiotlb_late_init_with_tbl(vstart, io_tlb_nslabs); | 304 | rc = swiotlb_late_init_with_tbl(vstart, io_tlb_nslabs); |
280 | if (rc) | 305 | if (rc) |
281 | free_pages((unsigned long)vstart, order); | 306 | free_pages((unsigned long)vstart, order); |
307 | |||
282 | return rc; | 308 | return rc; |
283 | } | 309 | } |
284 | 310 | ||
@@ -333,6 +359,8 @@ swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs) | |||
333 | 359 | ||
334 | late_alloc = 1; | 360 | late_alloc = 1; |
335 | 361 | ||
362 | swiotlb_set_max_segment(io_tlb_nslabs << IO_TLB_SHIFT); | ||
363 | |||
336 | return 0; | 364 | return 0; |
337 | 365 | ||
338 | cleanup4: | 366 | cleanup4: |
@@ -347,6 +375,7 @@ cleanup2: | |||
347 | io_tlb_end = 0; | 375 | io_tlb_end = 0; |
348 | io_tlb_start = 0; | 376 | io_tlb_start = 0; |
349 | io_tlb_nslabs = 0; | 377 | io_tlb_nslabs = 0; |
378 | max_segment = 0; | ||
350 | return -ENOMEM; | 379 | return -ENOMEM; |
351 | } | 380 | } |
352 | 381 | ||
@@ -375,6 +404,7 @@ void __init swiotlb_free(void) | |||
375 | PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT)); | 404 | PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT)); |
376 | } | 405 | } |
377 | io_tlb_nslabs = 0; | 406 | io_tlb_nslabs = 0; |
407 | max_segment = 0; | ||
378 | } | 408 | } |
379 | 409 | ||
380 | int is_swiotlb_buffer(phys_addr_t paddr) | 410 | int is_swiotlb_buffer(phys_addr_t paddr) |
@@ -543,8 +573,15 @@ static phys_addr_t | |||
543 | map_single(struct device *hwdev, phys_addr_t phys, size_t size, | 573 | map_single(struct device *hwdev, phys_addr_t phys, size_t size, |
544 | enum dma_data_direction dir, unsigned long attrs) | 574 | enum dma_data_direction dir, unsigned long attrs) |
545 | { | 575 | { |
546 | dma_addr_t start_dma_addr = phys_to_dma(hwdev, io_tlb_start); | 576 | dma_addr_t start_dma_addr; |
547 | 577 | ||
578 | if (swiotlb_force == SWIOTLB_NO_FORCE) { | ||
579 | dev_warn_ratelimited(hwdev, "Cannot do DMA to address %pa\n", | ||
580 | &phys); | ||
581 | return SWIOTLB_MAP_ERROR; | ||
582 | } | ||
583 | |||
584 | start_dma_addr = phys_to_dma(hwdev, io_tlb_start); | ||
548 | return swiotlb_tbl_map_single(hwdev, start_dma_addr, phys, size, | 585 | return swiotlb_tbl_map_single(hwdev, start_dma_addr, phys, size, |
549 | dir, attrs); | 586 | dir, attrs); |
550 | } | 587 | } |
@@ -721,6 +758,9 @@ static void | |||
721 | swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir, | 758 | swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir, |
722 | int do_panic) | 759 | int do_panic) |
723 | { | 760 | { |
761 | if (swiotlb_force == SWIOTLB_NO_FORCE) | ||
762 | return; | ||
763 | |||
724 | /* | 764 | /* |
725 | * Ran out of IOMMU space for this operation. This is very bad. | 765 | * Ran out of IOMMU space for this operation. This is very bad. |
726 | * Unfortunately the drivers cannot handle this operation properly. | 766 | * Unfortunately the drivers cannot handle this operation properly. |
@@ -763,7 +803,7 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, | |||
763 | * we can safely return the device addr and not worry about bounce | 803 | * we can safely return the device addr and not worry about bounce |
764 | * buffering it. | 804 | * buffering it. |
765 | */ | 805 | */ |
766 | if (dma_capable(dev, dev_addr, size) && !swiotlb_force) | 806 | if (dma_capable(dev, dev_addr, size) && swiotlb_force != SWIOTLB_FORCE) |
767 | return dev_addr; | 807 | return dev_addr; |
768 | 808 | ||
769 | trace_swiotlb_bounced(dev, dev_addr, size, swiotlb_force); | 809 | trace_swiotlb_bounced(dev, dev_addr, size, swiotlb_force); |
@@ -904,7 +944,7 @@ swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, | |||
904 | phys_addr_t paddr = sg_phys(sg); | 944 | phys_addr_t paddr = sg_phys(sg); |
905 | dma_addr_t dev_addr = phys_to_dma(hwdev, paddr); | 945 | dma_addr_t dev_addr = phys_to_dma(hwdev, paddr); |
906 | 946 | ||
907 | if (swiotlb_force || | 947 | if (swiotlb_force == SWIOTLB_FORCE || |
908 | !dma_capable(hwdev, dev_addr, sg->length)) { | 948 | !dma_capable(hwdev, dev_addr, sg->length)) { |
909 | phys_addr_t map = map_single(hwdev, sg_phys(sg), | 949 | phys_addr_t map = map_single(hwdev, sg_phys(sg), |
910 | sg->length, dir, attrs); | 950 | sg->length, dir, attrs); |
diff --git a/net/atm/lec.c b/net/atm/lec.c index 019557d0a11d..09cfe87f0a44 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -1059,7 +1059,9 @@ static void __exit lane_module_cleanup(void) | |||
1059 | { | 1059 | { |
1060 | int i; | 1060 | int i; |
1061 | 1061 | ||
1062 | #ifdef CONFIG_PROC_FS | ||
1062 | remove_proc_entry("lec", atm_proc_root); | 1063 | remove_proc_entry("lec", atm_proc_root); |
1064 | #endif | ||
1063 | 1065 | ||
1064 | deregister_atm_ioctl(&lane_ioctl_ops); | 1066 | deregister_atm_ioctl(&lane_ioctl_ops); |
1065 | 1067 | ||
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index 8e0c0635ee97..fb55327dcfea 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c | |||
@@ -75,6 +75,7 @@ static struct sk_buff *reset_per_cpu_data(struct per_cpu_dm_data *data) | |||
75 | struct nlattr *nla; | 75 | struct nlattr *nla; |
76 | struct sk_buff *skb; | 76 | struct sk_buff *skb; |
77 | unsigned long flags; | 77 | unsigned long flags; |
78 | void *msg_header; | ||
78 | 79 | ||
79 | al = sizeof(struct net_dm_alert_msg); | 80 | al = sizeof(struct net_dm_alert_msg); |
80 | al += dm_hit_limit * sizeof(struct net_dm_drop_point); | 81 | al += dm_hit_limit * sizeof(struct net_dm_drop_point); |
@@ -82,21 +83,41 @@ static struct sk_buff *reset_per_cpu_data(struct per_cpu_dm_data *data) | |||
82 | 83 | ||
83 | skb = genlmsg_new(al, GFP_KERNEL); | 84 | skb = genlmsg_new(al, GFP_KERNEL); |
84 | 85 | ||
85 | if (skb) { | 86 | if (!skb) |
86 | genlmsg_put(skb, 0, 0, &net_drop_monitor_family, | 87 | goto err; |
87 | 0, NET_DM_CMD_ALERT); | 88 | |
88 | nla = nla_reserve(skb, NLA_UNSPEC, | 89 | msg_header = genlmsg_put(skb, 0, 0, &net_drop_monitor_family, |
89 | sizeof(struct net_dm_alert_msg)); | 90 | 0, NET_DM_CMD_ALERT); |
90 | msg = nla_data(nla); | 91 | if (!msg_header) { |
91 | memset(msg, 0, al); | 92 | nlmsg_free(skb); |
92 | } else { | 93 | skb = NULL; |
93 | mod_timer(&data->send_timer, jiffies + HZ / 10); | 94 | goto err; |
95 | } | ||
96 | nla = nla_reserve(skb, NLA_UNSPEC, | ||
97 | sizeof(struct net_dm_alert_msg)); | ||
98 | if (!nla) { | ||
99 | nlmsg_free(skb); | ||
100 | skb = NULL; | ||
101 | goto err; | ||
94 | } | 102 | } |
103 | msg = nla_data(nla); | ||
104 | memset(msg, 0, al); | ||
105 | goto out; | ||
95 | 106 | ||
107 | err: | ||
108 | mod_timer(&data->send_timer, jiffies + HZ / 10); | ||
109 | out: | ||
96 | spin_lock_irqsave(&data->lock, flags); | 110 | spin_lock_irqsave(&data->lock, flags); |
97 | swap(data->skb, skb); | 111 | swap(data->skb, skb); |
98 | spin_unlock_irqrestore(&data->lock, flags); | 112 | spin_unlock_irqrestore(&data->lock, flags); |
99 | 113 | ||
114 | if (skb) { | ||
115 | struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data; | ||
116 | struct genlmsghdr *gnlh = (struct genlmsghdr *)nlmsg_data(nlh); | ||
117 | |||
118 | genlmsg_end(skb, genlmsg_data(gnlh)); | ||
119 | } | ||
120 | |||
100 | return skb; | 121 | return skb; |
101 | } | 122 | } |
102 | 123 | ||
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index d6447dc10371..fe4e1531976c 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c | |||
@@ -468,8 +468,9 @@ ip_proto_again: | |||
468 | if (hdr->flags & GRE_ACK) | 468 | if (hdr->flags & GRE_ACK) |
469 | offset += sizeof(((struct pptp_gre_header *)0)->ack); | 469 | offset += sizeof(((struct pptp_gre_header *)0)->ack); |
470 | 470 | ||
471 | ppp_hdr = skb_header_pointer(skb, nhoff + offset, | 471 | ppp_hdr = __skb_header_pointer(skb, nhoff + offset, |
472 | sizeof(_ppp_hdr), _ppp_hdr); | 472 | sizeof(_ppp_hdr), |
473 | data, hlen, _ppp_hdr); | ||
473 | if (!ppp_hdr) | 474 | if (!ppp_hdr) |
474 | goto out_bad; | 475 | goto out_bad; |
475 | 476 | ||
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 18b5aae99bec..75e3ea7bda08 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -3898,6 +3898,9 @@ static int rtnl_stats_get(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
3898 | u32 filter_mask; | 3898 | u32 filter_mask; |
3899 | int err; | 3899 | int err; |
3900 | 3900 | ||
3901 | if (nlmsg_len(nlh) < sizeof(*ifsm)) | ||
3902 | return -EINVAL; | ||
3903 | |||
3901 | ifsm = nlmsg_data(nlh); | 3904 | ifsm = nlmsg_data(nlh); |
3902 | if (ifsm->ifindex > 0) | 3905 | if (ifsm->ifindex > 0) |
3903 | dev = __dev_get_by_index(net, ifsm->ifindex); | 3906 | dev = __dev_get_by_index(net, ifsm->ifindex); |
@@ -3947,6 +3950,9 @@ static int rtnl_stats_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
3947 | 3950 | ||
3948 | cb->seq = net->dev_base_seq; | 3951 | cb->seq = net->dev_base_seq; |
3949 | 3952 | ||
3953 | if (nlmsg_len(cb->nlh) < sizeof(*ifsm)) | ||
3954 | return -EINVAL; | ||
3955 | |||
3950 | ifsm = nlmsg_data(cb->nlh); | 3956 | ifsm = nlmsg_data(cb->nlh); |
3951 | filter_mask = ifsm->filter_mask; | 3957 | filter_mask = ifsm->filter_mask; |
3952 | if (!filter_mask) | 3958 | if (!filter_mask) |
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 3ff8938893ec..eae0332b0e8c 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -85,7 +85,7 @@ struct fib_table *fib_new_table(struct net *net, u32 id) | |||
85 | if (tb) | 85 | if (tb) |
86 | return tb; | 86 | return tb; |
87 | 87 | ||
88 | if (id == RT_TABLE_LOCAL) | 88 | if (id == RT_TABLE_LOCAL && !net->ipv4.fib_has_custom_rules) |
89 | alias = fib_new_table(net, RT_TABLE_MAIN); | 89 | alias = fib_new_table(net, RT_TABLE_MAIN); |
90 | 90 | ||
91 | tb = fib_trie_table(id, alias); | 91 | tb = fib_trie_table(id, alias); |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 68d622133f53..5b15459955f8 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -219,9 +219,14 @@ static void igmp_start_timer(struct ip_mc_list *im, int max_delay) | |||
219 | static void igmp_gq_start_timer(struct in_device *in_dev) | 219 | static void igmp_gq_start_timer(struct in_device *in_dev) |
220 | { | 220 | { |
221 | int tv = prandom_u32() % in_dev->mr_maxdelay; | 221 | int tv = prandom_u32() % in_dev->mr_maxdelay; |
222 | unsigned long exp = jiffies + tv + 2; | ||
223 | |||
224 | if (in_dev->mr_gq_running && | ||
225 | time_after_eq(exp, (in_dev->mr_gq_timer).expires)) | ||
226 | return; | ||
222 | 227 | ||
223 | in_dev->mr_gq_running = 1; | 228 | in_dev->mr_gq_running = 1; |
224 | if (!mod_timer(&in_dev->mr_gq_timer, jiffies+tv+2)) | 229 | if (!mod_timer(&in_dev->mr_gq_timer, exp)) |
225 | in_dev_hold(in_dev); | 230 | in_dev_hold(in_dev); |
226 | } | 231 | } |
227 | 232 | ||
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 57e1405e8282..53ae0c6315ad 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -1225,8 +1225,14 @@ void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb) | |||
1225 | * which has interface index (iif) as the first member of the | 1225 | * which has interface index (iif) as the first member of the |
1226 | * underlying inet{6}_skb_parm struct. This code then overlays | 1226 | * underlying inet{6}_skb_parm struct. This code then overlays |
1227 | * PKTINFO_SKB_CB and in_pktinfo also has iif as the first | 1227 | * PKTINFO_SKB_CB and in_pktinfo also has iif as the first |
1228 | * element so the iif is picked up from the prior IPCB | 1228 | * element so the iif is picked up from the prior IPCB. If iif |
1229 | * is the loopback interface, then return the sending interface | ||
1230 | * (e.g., process binds socket to eth0 for Tx which is | ||
1231 | * redirected to loopback in the rtable/dst). | ||
1229 | */ | 1232 | */ |
1233 | if (pktinfo->ipi_ifindex == LOOPBACK_IFINDEX) | ||
1234 | pktinfo->ipi_ifindex = inet_iif(skb); | ||
1235 | |||
1230 | pktinfo->ipi_spec_dst.s_addr = fib_compute_spec_dst(skb); | 1236 | pktinfo->ipi_spec_dst.s_addr = fib_compute_spec_dst(skb); |
1231 | } else { | 1237 | } else { |
1232 | pktinfo->ipi_ifindex = 0; | 1238 | pktinfo->ipi_ifindex = 0; |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index a82a11747b3f..0fcac8e7a2b2 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1914,7 +1914,8 @@ local_input: | |||
1914 | } | 1914 | } |
1915 | } | 1915 | } |
1916 | 1916 | ||
1917 | rth = rt_dst_alloc(net->loopback_dev, flags | RTCF_LOCAL, res.type, | 1917 | rth = rt_dst_alloc(l3mdev_master_dev_rcu(dev) ? : net->loopback_dev, |
1918 | flags | RTCF_LOCAL, res.type, | ||
1918 | IN_DEV_CONF_GET(in_dev, NOPOLICY), false, do_cache); | 1919 | IN_DEV_CONF_GET(in_dev, NOPOLICY), false, do_cache); |
1919 | if (!rth) | 1920 | if (!rth) |
1920 | goto e_nobufs; | 1921 | goto e_nobufs; |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 70d0de404197..38122d04fadc 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -1373,7 +1373,7 @@ emsgsize: | |||
1373 | */ | 1373 | */ |
1374 | 1374 | ||
1375 | cork->length += length; | 1375 | cork->length += length; |
1376 | if (((length > mtu) || | 1376 | if ((((length + fragheaderlen) > mtu) || |
1377 | (skb && skb_is_gso(skb))) && | 1377 | (skb && skb_is_gso(skb))) && |
1378 | (sk->sk_protocol == IPPROTO_UDP) && | 1378 | (sk->sk_protocol == IPPROTO_UDP) && |
1379 | (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len && | 1379 | (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len && |
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index 8938b6ba57a0..3d73278b86ca 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
@@ -47,7 +47,8 @@ static inline struct l2tp_ip_sock *l2tp_ip_sk(const struct sock *sk) | |||
47 | return (struct l2tp_ip_sock *)sk; | 47 | return (struct l2tp_ip_sock *)sk; |
48 | } | 48 | } |
49 | 49 | ||
50 | static struct sock *__l2tp_ip_bind_lookup(struct net *net, __be32 laddr, int dif, u32 tunnel_id) | 50 | static struct sock *__l2tp_ip_bind_lookup(const struct net *net, __be32 laddr, |
51 | __be32 raddr, int dif, u32 tunnel_id) | ||
51 | { | 52 | { |
52 | struct sock *sk; | 53 | struct sock *sk; |
53 | 54 | ||
@@ -61,6 +62,7 @@ static struct sock *__l2tp_ip_bind_lookup(struct net *net, __be32 laddr, int dif | |||
61 | if ((l2tp->conn_id == tunnel_id) && | 62 | if ((l2tp->conn_id == tunnel_id) && |
62 | net_eq(sock_net(sk), net) && | 63 | net_eq(sock_net(sk), net) && |
63 | !(inet->inet_rcv_saddr && inet->inet_rcv_saddr != laddr) && | 64 | !(inet->inet_rcv_saddr && inet->inet_rcv_saddr != laddr) && |
65 | (!inet->inet_daddr || !raddr || inet->inet_daddr == raddr) && | ||
64 | (!sk->sk_bound_dev_if || !dif || | 66 | (!sk->sk_bound_dev_if || !dif || |
65 | sk->sk_bound_dev_if == dif)) | 67 | sk->sk_bound_dev_if == dif)) |
66 | goto found; | 68 | goto found; |
@@ -71,15 +73,6 @@ found: | |||
71 | return sk; | 73 | return sk; |
72 | } | 74 | } |
73 | 75 | ||
74 | static inline struct sock *l2tp_ip_bind_lookup(struct net *net, __be32 laddr, int dif, u32 tunnel_id) | ||
75 | { | ||
76 | struct sock *sk = __l2tp_ip_bind_lookup(net, laddr, dif, tunnel_id); | ||
77 | if (sk) | ||
78 | sock_hold(sk); | ||
79 | |||
80 | return sk; | ||
81 | } | ||
82 | |||
83 | /* When processing receive frames, there are two cases to | 76 | /* When processing receive frames, there are two cases to |
84 | * consider. Data frames consist of a non-zero session-id and an | 77 | * consider. Data frames consist of a non-zero session-id and an |
85 | * optional cookie. Control frames consist of a regular L2TP header | 78 | * optional cookie. Control frames consist of a regular L2TP header |
@@ -183,8 +176,8 @@ pass_up: | |||
183 | struct iphdr *iph = (struct iphdr *) skb_network_header(skb); | 176 | struct iphdr *iph = (struct iphdr *) skb_network_header(skb); |
184 | 177 | ||
185 | read_lock_bh(&l2tp_ip_lock); | 178 | read_lock_bh(&l2tp_ip_lock); |
186 | sk = __l2tp_ip_bind_lookup(net, iph->daddr, inet_iif(skb), | 179 | sk = __l2tp_ip_bind_lookup(net, iph->daddr, iph->saddr, |
187 | tunnel_id); | 180 | inet_iif(skb), tunnel_id); |
188 | if (!sk) { | 181 | if (!sk) { |
189 | read_unlock_bh(&l2tp_ip_lock); | 182 | read_unlock_bh(&l2tp_ip_lock); |
190 | goto discard; | 183 | goto discard; |
@@ -280,7 +273,7 @@ static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
280 | inet->inet_saddr = 0; /* Use device */ | 273 | inet->inet_saddr = 0; /* Use device */ |
281 | 274 | ||
282 | write_lock_bh(&l2tp_ip_lock); | 275 | write_lock_bh(&l2tp_ip_lock); |
283 | if (__l2tp_ip_bind_lookup(net, addr->l2tp_addr.s_addr, | 276 | if (__l2tp_ip_bind_lookup(net, addr->l2tp_addr.s_addr, 0, |
284 | sk->sk_bound_dev_if, addr->l2tp_conn_id)) { | 277 | sk->sk_bound_dev_if, addr->l2tp_conn_id)) { |
285 | write_unlock_bh(&l2tp_ip_lock); | 278 | write_unlock_bh(&l2tp_ip_lock); |
286 | ret = -EADDRINUSE; | 279 | ret = -EADDRINUSE; |
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c index f092ac441fdd..331ccf5a7bad 100644 --- a/net/l2tp/l2tp_ip6.c +++ b/net/l2tp/l2tp_ip6.c | |||
@@ -59,12 +59,14 @@ static inline struct l2tp_ip6_sock *l2tp_ip6_sk(const struct sock *sk) | |||
59 | 59 | ||
60 | static struct sock *__l2tp_ip6_bind_lookup(struct net *net, | 60 | static struct sock *__l2tp_ip6_bind_lookup(struct net *net, |
61 | struct in6_addr *laddr, | 61 | struct in6_addr *laddr, |
62 | const struct in6_addr *raddr, | ||
62 | int dif, u32 tunnel_id) | 63 | int dif, u32 tunnel_id) |
63 | { | 64 | { |
64 | struct sock *sk; | 65 | struct sock *sk; |
65 | 66 | ||
66 | sk_for_each_bound(sk, &l2tp_ip6_bind_table) { | 67 | sk_for_each_bound(sk, &l2tp_ip6_bind_table) { |
67 | const struct in6_addr *addr = inet6_rcv_saddr(sk); | 68 | const struct in6_addr *sk_laddr = inet6_rcv_saddr(sk); |
69 | const struct in6_addr *sk_raddr = &sk->sk_v6_daddr; | ||
68 | struct l2tp_ip6_sock *l2tp = l2tp_ip6_sk(sk); | 70 | struct l2tp_ip6_sock *l2tp = l2tp_ip6_sk(sk); |
69 | 71 | ||
70 | if (l2tp == NULL) | 72 | if (l2tp == NULL) |
@@ -72,7 +74,8 @@ static struct sock *__l2tp_ip6_bind_lookup(struct net *net, | |||
72 | 74 | ||
73 | if ((l2tp->conn_id == tunnel_id) && | 75 | if ((l2tp->conn_id == tunnel_id) && |
74 | net_eq(sock_net(sk), net) && | 76 | net_eq(sock_net(sk), net) && |
75 | (!addr || ipv6_addr_equal(addr, laddr)) && | 77 | (!sk_laddr || ipv6_addr_any(sk_laddr) || ipv6_addr_equal(sk_laddr, laddr)) && |
78 | (!raddr || ipv6_addr_any(sk_raddr) || ipv6_addr_equal(sk_raddr, raddr)) && | ||
76 | (!sk->sk_bound_dev_if || !dif || | 79 | (!sk->sk_bound_dev_if || !dif || |
77 | sk->sk_bound_dev_if == dif)) | 80 | sk->sk_bound_dev_if == dif)) |
78 | goto found; | 81 | goto found; |
@@ -83,17 +86,6 @@ found: | |||
83 | return sk; | 86 | return sk; |
84 | } | 87 | } |
85 | 88 | ||
86 | static inline struct sock *l2tp_ip6_bind_lookup(struct net *net, | ||
87 | struct in6_addr *laddr, | ||
88 | int dif, u32 tunnel_id) | ||
89 | { | ||
90 | struct sock *sk = __l2tp_ip6_bind_lookup(net, laddr, dif, tunnel_id); | ||
91 | if (sk) | ||
92 | sock_hold(sk); | ||
93 | |||
94 | return sk; | ||
95 | } | ||
96 | |||
97 | /* When processing receive frames, there are two cases to | 89 | /* When processing receive frames, there are two cases to |
98 | * consider. Data frames consist of a non-zero session-id and an | 90 | * consider. Data frames consist of a non-zero session-id and an |
99 | * optional cookie. Control frames consist of a regular L2TP header | 91 | * optional cookie. Control frames consist of a regular L2TP header |
@@ -197,8 +189,8 @@ pass_up: | |||
197 | struct ipv6hdr *iph = ipv6_hdr(skb); | 189 | struct ipv6hdr *iph = ipv6_hdr(skb); |
198 | 190 | ||
199 | read_lock_bh(&l2tp_ip6_lock); | 191 | read_lock_bh(&l2tp_ip6_lock); |
200 | sk = __l2tp_ip6_bind_lookup(net, &iph->daddr, inet6_iif(skb), | 192 | sk = __l2tp_ip6_bind_lookup(net, &iph->daddr, &iph->saddr, |
201 | tunnel_id); | 193 | inet6_iif(skb), tunnel_id); |
202 | if (!sk) { | 194 | if (!sk) { |
203 | read_unlock_bh(&l2tp_ip6_lock); | 195 | read_unlock_bh(&l2tp_ip6_lock); |
204 | goto discard; | 196 | goto discard; |
@@ -330,7 +322,7 @@ static int l2tp_ip6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
330 | rcu_read_unlock(); | 322 | rcu_read_unlock(); |
331 | 323 | ||
332 | write_lock_bh(&l2tp_ip6_lock); | 324 | write_lock_bh(&l2tp_ip6_lock); |
333 | if (__l2tp_ip6_bind_lookup(net, &addr->l2tp_addr, bound_dev_if, | 325 | if (__l2tp_ip6_bind_lookup(net, &addr->l2tp_addr, NULL, bound_dev_if, |
334 | addr->l2tp_conn_id)) { | 326 | addr->l2tp_conn_id)) { |
335 | write_unlock_bh(&l2tp_ip6_lock); | 327 | write_unlock_bh(&l2tp_ip6_lock); |
336 | err = -EADDRINUSE; | 328 | err = -EADDRINUSE; |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 2c21b7039136..0d8b716e509e 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -3287,7 +3287,7 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, | |||
3287 | int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2); | 3287 | int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2); |
3288 | int hw_headroom = sdata->local->hw.extra_tx_headroom; | 3288 | int hw_headroom = sdata->local->hw.extra_tx_headroom; |
3289 | struct ethhdr eth; | 3289 | struct ethhdr eth; |
3290 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 3290 | struct ieee80211_tx_info *info; |
3291 | struct ieee80211_hdr *hdr = (void *)fast_tx->hdr; | 3291 | struct ieee80211_hdr *hdr = (void *)fast_tx->hdr; |
3292 | struct ieee80211_tx_data tx; | 3292 | struct ieee80211_tx_data tx; |
3293 | ieee80211_tx_result r; | 3293 | ieee80211_tx_result r; |
@@ -3351,6 +3351,7 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, | |||
3351 | memcpy(skb->data + fast_tx->da_offs, eth.h_dest, ETH_ALEN); | 3351 | memcpy(skb->data + fast_tx->da_offs, eth.h_dest, ETH_ALEN); |
3352 | memcpy(skb->data + fast_tx->sa_offs, eth.h_source, ETH_ALEN); | 3352 | memcpy(skb->data + fast_tx->sa_offs, eth.h_source, ETH_ALEN); |
3353 | 3353 | ||
3354 | info = IEEE80211_SKB_CB(skb); | ||
3354 | memset(info, 0, sizeof(*info)); | 3355 | memset(info, 0, sizeof(*info)); |
3355 | info->band = fast_tx->band; | 3356 | info->band = fast_tx->band; |
3356 | info->control.vif = &sdata->vif; | 3357 | info->control.vif = &sdata->vif; |
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 333f8e268431..970db7a41684 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c | |||
@@ -153,10 +153,14 @@ static int fl_classify(struct sk_buff *skb, const struct tcf_proto *tp, | |||
153 | 153 | ||
154 | switch (ip_tunnel_info_af(info)) { | 154 | switch (ip_tunnel_info_af(info)) { |
155 | case AF_INET: | 155 | case AF_INET: |
156 | skb_key.enc_control.addr_type = | ||
157 | FLOW_DISSECTOR_KEY_IPV4_ADDRS; | ||
156 | skb_key.enc_ipv4.src = key->u.ipv4.src; | 158 | skb_key.enc_ipv4.src = key->u.ipv4.src; |
157 | skb_key.enc_ipv4.dst = key->u.ipv4.dst; | 159 | skb_key.enc_ipv4.dst = key->u.ipv4.dst; |
158 | break; | 160 | break; |
159 | case AF_INET6: | 161 | case AF_INET6: |
162 | skb_key.enc_control.addr_type = | ||
163 | FLOW_DISSECTOR_KEY_IPV6_ADDRS; | ||
160 | skb_key.enc_ipv6.src = key->u.ipv6.src; | 164 | skb_key.enc_ipv6.src = key->u.ipv6.src; |
161 | skb_key.enc_ipv6.dst = key->u.ipv6.dst; | 165 | skb_key.enc_ipv6.dst = key->u.ipv6.dst; |
162 | break; | 166 | break; |
diff --git a/net/socket.c b/net/socket.c index 8487bf136e5c..a8c2307590b8 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -537,7 +537,7 @@ int sockfs_setattr(struct dentry *dentry, struct iattr *iattr) | |||
537 | { | 537 | { |
538 | int err = simple_setattr(dentry, iattr); | 538 | int err = simple_setattr(dentry, iattr); |
539 | 539 | ||
540 | if (!err) { | 540 | if (!err && (iattr->ia_valid & ATTR_UID)) { |
541 | struct socket *sock = SOCKET_I(d_inode(dentry)); | 541 | struct socket *sock = SOCKET_I(d_inode(dentry)); |
542 | 542 | ||
543 | sock->sk->sk_uid = iattr->ia_uid; | 543 | sock->sk->sk_uid = iattr->ia_uid; |
diff --git a/samples/Kconfig b/samples/Kconfig index a6d2a43bbf2e..b124f62ed6cb 100644 --- a/samples/Kconfig +++ b/samples/Kconfig | |||
@@ -105,4 +105,11 @@ config SAMPLE_BLACKFIN_GPTIMERS | |||
105 | help | 105 | help |
106 | Build samples of blackfin gptimers sample module. | 106 | Build samples of blackfin gptimers sample module. |
107 | 107 | ||
108 | config SAMPLE_VFIO_MDEV_MTTY | ||
109 | tristate "Build VFIO mtty example mediated device sample code -- loadable modules only" | ||
110 | depends on VFIO_MDEV_DEVICE && m | ||
111 | help | ||
112 | Build a virtual tty sample driver for use as a VFIO | ||
113 | mediated device | ||
114 | |||
108 | endif # SAMPLES | 115 | endif # SAMPLES |
diff --git a/samples/Makefile b/samples/Makefile index e17d66d77f09..86a137e451d9 100644 --- a/samples/Makefile +++ b/samples/Makefile | |||
@@ -2,4 +2,5 @@ | |||
2 | 2 | ||
3 | obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ trace_events/ livepatch/ \ | 3 | obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ trace_events/ livepatch/ \ |
4 | hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \ | 4 | hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \ |
5 | configfs/ connector/ v4l/ trace_printk/ blackfin/ | 5 | configfs/ connector/ v4l/ trace_printk/ blackfin/ \ |
6 | vfio-mdev/ | ||
diff --git a/samples/vfio-mdev/Makefile b/samples/vfio-mdev/Makefile index a932edbe38eb..cbbd868a50a8 100644 --- a/samples/vfio-mdev/Makefile +++ b/samples/vfio-mdev/Makefile | |||
@@ -1,13 +1 @@ | |||
1 | # | obj-$(CONFIG_SAMPLE_VFIO_MDEV_MTTY) += mtty.o | |
2 | # Makefile for mtty.c file | ||
3 | # | ||
4 | KERNEL_DIR:=/lib/modules/$(shell uname -r)/build | ||
5 | |||
6 | obj-m:=mtty.o | ||
7 | |||
8 | modules clean modules_install: | ||
9 | $(MAKE) -C $(KERNEL_DIR) SUBDIRS=$(PWD) $@ | ||
10 | |||
11 | default: modules | ||
12 | |||
13 | module: modules | ||
diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c index 6b633a4ea333..1fc57a5093a7 100644 --- a/samples/vfio-mdev/mtty.c +++ b/samples/vfio-mdev/mtty.c | |||
@@ -164,7 +164,7 @@ static struct mdev_state *find_mdev_state_by_uuid(uuid_le uuid) | |||
164 | struct mdev_state *mds; | 164 | struct mdev_state *mds; |
165 | 165 | ||
166 | list_for_each_entry(mds, &mdev_devices_list, next) { | 166 | list_for_each_entry(mds, &mdev_devices_list, next) { |
167 | if (uuid_le_cmp(mds->mdev->uuid, uuid) == 0) | 167 | if (uuid_le_cmp(mdev_uuid(mds->mdev), uuid) == 0) |
168 | return mds; | 168 | return mds; |
169 | } | 169 | } |
170 | 170 | ||
@@ -341,7 +341,8 @@ static void handle_bar_write(unsigned int index, struct mdev_state *mdev_state, | |||
341 | pr_err("Serial port %d: Fifo level trigger\n", | 341 | pr_err("Serial port %d: Fifo level trigger\n", |
342 | index); | 342 | index); |
343 | #endif | 343 | #endif |
344 | mtty_trigger_interrupt(mdev_state->mdev->uuid); | 344 | mtty_trigger_interrupt( |
345 | mdev_uuid(mdev_state->mdev)); | ||
345 | } | 346 | } |
346 | } else { | 347 | } else { |
347 | #if defined(DEBUG_INTR) | 348 | #if defined(DEBUG_INTR) |
@@ -355,7 +356,8 @@ static void handle_bar_write(unsigned int index, struct mdev_state *mdev_state, | |||
355 | */ | 356 | */ |
356 | if (mdev_state->s[index].uart_reg[UART_IER] & | 357 | if (mdev_state->s[index].uart_reg[UART_IER] & |
357 | UART_IER_RLSI) | 358 | UART_IER_RLSI) |
358 | mtty_trigger_interrupt(mdev_state->mdev->uuid); | 359 | mtty_trigger_interrupt( |
360 | mdev_uuid(mdev_state->mdev)); | ||
359 | } | 361 | } |
360 | mutex_unlock(&mdev_state->rxtx_lock); | 362 | mutex_unlock(&mdev_state->rxtx_lock); |
361 | break; | 363 | break; |
@@ -374,7 +376,8 @@ static void handle_bar_write(unsigned int index, struct mdev_state *mdev_state, | |||
374 | pr_err("Serial port %d: IER_THRI write\n", | 376 | pr_err("Serial port %d: IER_THRI write\n", |
375 | index); | 377 | index); |
376 | #endif | 378 | #endif |
377 | mtty_trigger_interrupt(mdev_state->mdev->uuid); | 379 | mtty_trigger_interrupt( |
380 | mdev_uuid(mdev_state->mdev)); | ||
378 | } | 381 | } |
379 | 382 | ||
380 | mutex_unlock(&mdev_state->rxtx_lock); | 383 | mutex_unlock(&mdev_state->rxtx_lock); |
@@ -445,7 +448,7 @@ static void handle_bar_write(unsigned int index, struct mdev_state *mdev_state, | |||
445 | #if defined(DEBUG_INTR) | 448 | #if defined(DEBUG_INTR) |
446 | pr_err("Serial port %d: MCR_OUT2 write\n", index); | 449 | pr_err("Serial port %d: MCR_OUT2 write\n", index); |
447 | #endif | 450 | #endif |
448 | mtty_trigger_interrupt(mdev_state->mdev->uuid); | 451 | mtty_trigger_interrupt(mdev_uuid(mdev_state->mdev)); |
449 | } | 452 | } |
450 | 453 | ||
451 | if ((mdev_state->s[index].uart_reg[UART_IER] & UART_IER_MSI) && | 454 | if ((mdev_state->s[index].uart_reg[UART_IER] & UART_IER_MSI) && |
@@ -453,7 +456,7 @@ static void handle_bar_write(unsigned int index, struct mdev_state *mdev_state, | |||
453 | #if defined(DEBUG_INTR) | 456 | #if defined(DEBUG_INTR) |
454 | pr_err("Serial port %d: MCR RTS/DTR write\n", index); | 457 | pr_err("Serial port %d: MCR RTS/DTR write\n", index); |
455 | #endif | 458 | #endif |
456 | mtty_trigger_interrupt(mdev_state->mdev->uuid); | 459 | mtty_trigger_interrupt(mdev_uuid(mdev_state->mdev)); |
457 | } | 460 | } |
458 | break; | 461 | break; |
459 | 462 | ||
@@ -504,7 +507,8 @@ static void handle_bar_read(unsigned int index, struct mdev_state *mdev_state, | |||
504 | #endif | 507 | #endif |
505 | if (mdev_state->s[index].uart_reg[UART_IER] & | 508 | if (mdev_state->s[index].uart_reg[UART_IER] & |
506 | UART_IER_THRI) | 509 | UART_IER_THRI) |
507 | mtty_trigger_interrupt(mdev_state->mdev->uuid); | 510 | mtty_trigger_interrupt( |
511 | mdev_uuid(mdev_state->mdev)); | ||
508 | } | 512 | } |
509 | mutex_unlock(&mdev_state->rxtx_lock); | 513 | mutex_unlock(&mdev_state->rxtx_lock); |
510 | 514 | ||
@@ -734,7 +738,7 @@ int mtty_create(struct kobject *kobj, struct mdev_device *mdev) | |||
734 | 738 | ||
735 | for (i = 0; i < 2; i++) { | 739 | for (i = 0; i < 2; i++) { |
736 | snprintf(name, MTTY_STRING_LEN, "%s-%d", | 740 | snprintf(name, MTTY_STRING_LEN, "%s-%d", |
737 | dev_driver_string(mdev->parent->dev), i + 1); | 741 | dev_driver_string(mdev_parent_dev(mdev)), i + 1); |
738 | if (!strcmp(kobj->name, name)) { | 742 | if (!strcmp(kobj->name, name)) { |
739 | nr_ports = i + 1; | 743 | nr_ports = i + 1; |
740 | break; | 744 | break; |
@@ -1298,10 +1302,8 @@ static ssize_t | |||
1298 | sample_mdev_dev_show(struct device *dev, struct device_attribute *attr, | 1302 | sample_mdev_dev_show(struct device *dev, struct device_attribute *attr, |
1299 | char *buf) | 1303 | char *buf) |
1300 | { | 1304 | { |
1301 | struct mdev_device *mdev = to_mdev_device(dev); | 1305 | if (mdev_from_dev(dev)) |
1302 | 1306 | return sprintf(buf, "This is MDEV %s\n", dev_name(dev)); | |
1303 | if (mdev) | ||
1304 | return sprintf(buf, "This is MDEV %s\n", dev_name(&mdev->dev)); | ||
1305 | 1307 | ||
1306 | return sprintf(buf, "\n"); | 1308 | return sprintf(buf, "\n"); |
1307 | } | 1309 | } |
@@ -1402,7 +1404,7 @@ struct attribute_group *mdev_type_groups[] = { | |||
1402 | NULL, | 1404 | NULL, |
1403 | }; | 1405 | }; |
1404 | 1406 | ||
1405 | struct parent_ops mdev_fops = { | 1407 | struct mdev_parent_ops mdev_fops = { |
1406 | .owner = THIS_MODULE, | 1408 | .owner = THIS_MODULE, |
1407 | .dev_attr_groups = mtty_dev_groups, | 1409 | .dev_attr_groups = mtty_dev_groups, |
1408 | .mdev_attr_groups = mdev_dev_groups, | 1410 | .mdev_attr_groups = mdev_dev_groups, |
@@ -1447,6 +1449,7 @@ static int __init mtty_dev_init(void) | |||
1447 | 1449 | ||
1448 | if (IS_ERR(mtty_dev.vd_class)) { | 1450 | if (IS_ERR(mtty_dev.vd_class)) { |
1449 | pr_err("Error: failed to register mtty_dev class\n"); | 1451 | pr_err("Error: failed to register mtty_dev class\n"); |
1452 | ret = PTR_ERR(mtty_dev.vd_class); | ||
1450 | goto failed1; | 1453 | goto failed1; |
1451 | } | 1454 | } |
1452 | 1455 | ||
@@ -1458,7 +1461,8 @@ static int __init mtty_dev_init(void) | |||
1458 | if (ret) | 1461 | if (ret) |
1459 | goto failed2; | 1462 | goto failed2; |
1460 | 1463 | ||
1461 | if (mdev_register_device(&mtty_dev.dev, &mdev_fops) != 0) | 1464 | ret = mdev_register_device(&mtty_dev.dev, &mdev_fops); |
1465 | if (ret) | ||
1462 | goto failed3; | 1466 | goto failed3; |
1463 | 1467 | ||
1464 | mutex_init(&mdev_list_lock); | 1468 | mutex_init(&mdev_list_lock); |
diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h index 950fd2e64bb7..12262c0cc691 100644 --- a/scripts/gcc-plugins/gcc-common.h +++ b/scripts/gcc-plugins/gcc-common.h | |||
@@ -39,6 +39,9 @@ | |||
39 | #include "hash-map.h" | 39 | #include "hash-map.h" |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | #if BUILDING_GCC_VERSION >= 7000 | ||
43 | #include "memmodel.h" | ||
44 | #endif | ||
42 | #include "emit-rtl.h" | 45 | #include "emit-rtl.h" |
43 | #include "debug.h" | 46 | #include "debug.h" |
44 | #include "target.h" | 47 | #include "target.h" |
@@ -91,6 +94,9 @@ | |||
91 | #include "tree-ssa-alias.h" | 94 | #include "tree-ssa-alias.h" |
92 | #include "tree-ssa.h" | 95 | #include "tree-ssa.h" |
93 | #include "stringpool.h" | 96 | #include "stringpool.h" |
97 | #if BUILDING_GCC_VERSION >= 7000 | ||
98 | #include "tree-vrp.h" | ||
99 | #endif | ||
94 | #include "tree-ssanames.h" | 100 | #include "tree-ssanames.h" |
95 | #include "print-tree.h" | 101 | #include "print-tree.h" |
96 | #include "tree-eh.h" | 102 | #include "tree-eh.h" |
@@ -287,6 +293,22 @@ static inline struct cgraph_node *cgraph_next_function_with_gimple_body(struct c | |||
287 | return NULL; | 293 | return NULL; |
288 | } | 294 | } |
289 | 295 | ||
296 | static inline bool cgraph_for_node_and_aliases(cgraph_node_ptr node, bool (*callback)(cgraph_node_ptr, void *), void *data, bool include_overwritable) | ||
297 | { | ||
298 | cgraph_node_ptr alias; | ||
299 | |||
300 | if (callback(node, data)) | ||
301 | return true; | ||
302 | |||
303 | for (alias = node->same_body; alias; alias = alias->next) { | ||
304 | if (include_overwritable || cgraph_function_body_availability(alias) > AVAIL_OVERWRITABLE) | ||
305 | if (cgraph_for_node_and_aliases(alias, callback, data, include_overwritable)) | ||
306 | return true; | ||
307 | } | ||
308 | |||
309 | return false; | ||
310 | } | ||
311 | |||
290 | #define FOR_EACH_FUNCTION_WITH_GIMPLE_BODY(node) \ | 312 | #define FOR_EACH_FUNCTION_WITH_GIMPLE_BODY(node) \ |
291 | for ((node) = cgraph_first_function_with_gimple_body(); (node); \ | 313 | for ((node) = cgraph_first_function_with_gimple_body(); (node); \ |
292 | (node) = cgraph_next_function_with_gimple_body(node)) | 314 | (node) = cgraph_next_function_with_gimple_body(node)) |
@@ -399,6 +421,7 @@ typedef union gimple_statement_d gassign; | |||
399 | typedef union gimple_statement_d gcall; | 421 | typedef union gimple_statement_d gcall; |
400 | typedef union gimple_statement_d gcond; | 422 | typedef union gimple_statement_d gcond; |
401 | typedef union gimple_statement_d gdebug; | 423 | typedef union gimple_statement_d gdebug; |
424 | typedef union gimple_statement_d ggoto; | ||
402 | typedef union gimple_statement_d gphi; | 425 | typedef union gimple_statement_d gphi; |
403 | typedef union gimple_statement_d greturn; | 426 | typedef union gimple_statement_d greturn; |
404 | 427 | ||
@@ -452,6 +475,16 @@ static inline const gdebug *as_a_const_gdebug(const_gimple stmt) | |||
452 | return stmt; | 475 | return stmt; |
453 | } | 476 | } |
454 | 477 | ||
478 | static inline ggoto *as_a_ggoto(gimple stmt) | ||
479 | { | ||
480 | return stmt; | ||
481 | } | ||
482 | |||
483 | static inline const ggoto *as_a_const_ggoto(const_gimple stmt) | ||
484 | { | ||
485 | return stmt; | ||
486 | } | ||
487 | |||
455 | static inline gphi *as_a_gphi(gimple stmt) | 488 | static inline gphi *as_a_gphi(gimple stmt) |
456 | { | 489 | { |
457 | return stmt; | 490 | return stmt; |
@@ -496,6 +529,14 @@ static inline const greturn *as_a_const_greturn(const_gimple stmt) | |||
496 | 529 | ||
497 | typedef struct rtx_def rtx_insn; | 530 | typedef struct rtx_def rtx_insn; |
498 | 531 | ||
532 | static inline const char *get_decl_section_name(const_tree decl) | ||
533 | { | ||
534 | if (DECL_SECTION_NAME(decl) == NULL_TREE) | ||
535 | return NULL; | ||
536 | |||
537 | return TREE_STRING_POINTER(DECL_SECTION_NAME(decl)); | ||
538 | } | ||
539 | |||
499 | static inline void set_decl_section_name(tree node, const char *value) | 540 | static inline void set_decl_section_name(tree node, const char *value) |
500 | { | 541 | { |
501 | if (value) | 542 | if (value) |
@@ -511,6 +552,7 @@ typedef struct gimple_statement_base gassign; | |||
511 | typedef struct gimple_statement_call gcall; | 552 | typedef struct gimple_statement_call gcall; |
512 | typedef struct gimple_statement_base gcond; | 553 | typedef struct gimple_statement_base gcond; |
513 | typedef struct gimple_statement_base gdebug; | 554 | typedef struct gimple_statement_base gdebug; |
555 | typedef struct gimple_statement_base ggoto; | ||
514 | typedef struct gimple_statement_phi gphi; | 556 | typedef struct gimple_statement_phi gphi; |
515 | typedef struct gimple_statement_base greturn; | 557 | typedef struct gimple_statement_base greturn; |
516 | 558 | ||
@@ -564,6 +606,16 @@ static inline const gdebug *as_a_const_gdebug(const_gimple stmt) | |||
564 | return stmt; | 606 | return stmt; |
565 | } | 607 | } |
566 | 608 | ||
609 | static inline ggoto *as_a_ggoto(gimple stmt) | ||
610 | { | ||
611 | return stmt; | ||
612 | } | ||
613 | |||
614 | static inline const ggoto *as_a_const_ggoto(const_gimple stmt) | ||
615 | { | ||
616 | return stmt; | ||
617 | } | ||
618 | |||
567 | static inline gphi *as_a_gphi(gimple stmt) | 619 | static inline gphi *as_a_gphi(gimple stmt) |
568 | { | 620 | { |
569 | return as_a<gphi>(stmt); | 621 | return as_a<gphi>(stmt); |
@@ -611,6 +663,11 @@ inline bool is_a_helper<const gassign *>::test(const_gimple gs) | |||
611 | 663 | ||
612 | #define INSN_DELETED_P(insn) (insn)->deleted() | 664 | #define INSN_DELETED_P(insn) (insn)->deleted() |
613 | 665 | ||
666 | static inline const char *get_decl_section_name(const_tree decl) | ||
667 | { | ||
668 | return DECL_SECTION_NAME(decl); | ||
669 | } | ||
670 | |||
614 | /* symtab/cgraph related */ | 671 | /* symtab/cgraph related */ |
615 | #define debug_cgraph_node(node) (node)->debug() | 672 | #define debug_cgraph_node(node) (node)->debug() |
616 | #define cgraph_get_node(decl) cgraph_node::get(decl) | 673 | #define cgraph_get_node(decl) cgraph_node::get(decl) |
@@ -619,6 +676,7 @@ inline bool is_a_helper<const gassign *>::test(const_gimple gs) | |||
619 | #define cgraph_n_nodes symtab->cgraph_count | 676 | #define cgraph_n_nodes symtab->cgraph_count |
620 | #define cgraph_max_uid symtab->cgraph_max_uid | 677 | #define cgraph_max_uid symtab->cgraph_max_uid |
621 | #define varpool_get_node(decl) varpool_node::get(decl) | 678 | #define varpool_get_node(decl) varpool_node::get(decl) |
679 | #define dump_varpool_node(file, node) (node)->dump(file) | ||
622 | 680 | ||
623 | #define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \ | 681 | #define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \ |
624 | (caller)->create_edge((callee), (call_stmt), (count), (freq)) | 682 | (caller)->create_edge((callee), (call_stmt), (count), (freq)) |
@@ -674,6 +732,11 @@ static inline cgraph_node_ptr cgraph_alias_target(cgraph_node_ptr node) | |||
674 | return node->get_alias_target(); | 732 | return node->get_alias_target(); |
675 | } | 733 | } |
676 | 734 | ||
735 | static inline bool cgraph_for_node_and_aliases(cgraph_node_ptr node, bool (*callback)(cgraph_node_ptr, void *), void *data, bool include_overwritable) | ||
736 | { | ||
737 | return node->call_for_symbol_thunks_and_aliases(callback, data, include_overwritable); | ||
738 | } | ||
739 | |||
677 | static inline struct cgraph_node_hook_list *cgraph_add_function_insertion_hook(cgraph_node_hook hook, void *data) | 740 | static inline struct cgraph_node_hook_list *cgraph_add_function_insertion_hook(cgraph_node_hook hook, void *data) |
678 | { | 741 | { |
679 | return symtab->add_cgraph_insertion_hook(hook, data); | 742 | return symtab->add_cgraph_insertion_hook(hook, data); |
@@ -731,6 +794,13 @@ static inline gimple gimple_build_assign_with_ops(enum tree_code subcode, tree l | |||
731 | 794 | ||
732 | template <> | 795 | template <> |
733 | template <> | 796 | template <> |
797 | inline bool is_a_helper<const ggoto *>::test(const_gimple gs) | ||
798 | { | ||
799 | return gs->code == GIMPLE_GOTO; | ||
800 | } | ||
801 | |||
802 | template <> | ||
803 | template <> | ||
734 | inline bool is_a_helper<const greturn *>::test(const_gimple gs) | 804 | inline bool is_a_helper<const greturn *>::test(const_gimple gs) |
735 | { | 805 | { |
736 | return gs->code == GIMPLE_RETURN; | 806 | return gs->code == GIMPLE_RETURN; |
@@ -766,6 +836,16 @@ static inline const gcall *as_a_const_gcall(const_gimple stmt) | |||
766 | return as_a<const gcall *>(stmt); | 836 | return as_a<const gcall *>(stmt); |
767 | } | 837 | } |
768 | 838 | ||
839 | static inline ggoto *as_a_ggoto(gimple stmt) | ||
840 | { | ||
841 | return as_a<ggoto *>(stmt); | ||
842 | } | ||
843 | |||
844 | static inline const ggoto *as_a_const_ggoto(const_gimple stmt) | ||
845 | { | ||
846 | return as_a<const ggoto *>(stmt); | ||
847 | } | ||
848 | |||
769 | static inline gphi *as_a_gphi(gimple stmt) | 849 | static inline gphi *as_a_gphi(gimple stmt) |
770 | { | 850 | { |
771 | return as_a<gphi *>(stmt); | 851 | return as_a<gphi *>(stmt); |
@@ -828,4 +908,9 @@ static inline void debug_gimple_stmt(const_gimple s) | |||
828 | #define debug_gimple_stmt(s) debug_gimple_stmt(CONST_CAST_GIMPLE(s)) | 908 | #define debug_gimple_stmt(s) debug_gimple_stmt(CONST_CAST_GIMPLE(s)) |
829 | #endif | 909 | #endif |
830 | 910 | ||
911 | #if BUILDING_GCC_VERSION >= 7000 | ||
912 | #define get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsignedp, preversep, pvolatilep, keep_aligning) \ | ||
913 | get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsignedp, preversep, pvolatilep) | ||
914 | #endif | ||
915 | |||
831 | #endif | 916 | #endif |
diff --git a/scripts/gcc-plugins/latent_entropy_plugin.c b/scripts/gcc-plugins/latent_entropy_plugin.c index 12541126575b..8ff203ad4809 100644 --- a/scripts/gcc-plugins/latent_entropy_plugin.c +++ b/scripts/gcc-plugins/latent_entropy_plugin.c | |||
@@ -328,9 +328,9 @@ static enum tree_code get_op(tree *rhs) | |||
328 | op = LROTATE_EXPR; | 328 | op = LROTATE_EXPR; |
329 | /* | 329 | /* |
330 | * This code limits the value of random_const to | 330 | * This code limits the value of random_const to |
331 | * the size of a wide int for the rotation | 331 | * the size of a long for the rotation |
332 | */ | 332 | */ |
333 | random_const &= HOST_BITS_PER_WIDE_INT - 1; | 333 | random_const %= TYPE_PRECISION(long_unsigned_type_node); |
334 | break; | 334 | break; |
335 | } | 335 | } |
336 | 336 | ||
diff --git a/usr/Makefile b/usr/Makefile index 17a513268325..0b87e71c00fc 100644 --- a/usr/Makefile +++ b/usr/Makefile | |||
@@ -5,8 +5,10 @@ | |||
5 | klibcdirs:; | 5 | klibcdirs:; |
6 | PHONY += klibcdirs | 6 | PHONY += klibcdirs |
7 | 7 | ||
8 | suffix_y = $(CONFIG_INITRAMFS_COMPRESSION) | 8 | suffix_y = $(subst $\",,$(CONFIG_INITRAMFS_COMPRESSION)) |
9 | AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)" | 9 | datafile_y = initramfs_data.cpio$(suffix_y) |
10 | AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/$(datafile_y)" | ||
11 | |||
10 | 12 | ||
11 | # Generate builtin.o based on initramfs_data.o | 13 | # Generate builtin.o based on initramfs_data.o |
12 | obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o | 14 | obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o |
@@ -14,7 +16,7 @@ obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o | |||
14 | # initramfs_data.o contains the compressed initramfs_data.cpio image. | 16 | # initramfs_data.o contains the compressed initramfs_data.cpio image. |
15 | # The image is included using .incbin, a dependency which is not | 17 | # The image is included using .incbin, a dependency which is not |
16 | # tracked automatically. | 18 | # tracked automatically. |
17 | $(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio$(suffix_y) FORCE | 19 | $(obj)/initramfs_data.o: $(obj)/$(datafile_y) FORCE |
18 | 20 | ||
19 | ##### | 21 | ##### |
20 | # Generate the initramfs cpio archive | 22 | # Generate the initramfs cpio archive |
@@ -38,10 +40,8 @@ endif | |||
38 | quiet_cmd_initfs = GEN $@ | 40 | quiet_cmd_initfs = GEN $@ |
39 | cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input) | 41 | cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input) |
40 | 42 | ||
41 | targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 \ | 43 | targets := $(datafile_y) |
42 | initramfs_data.cpio.lzma initramfs_data.cpio.xz \ | 44 | |
43 | initramfs_data.cpio.lzo initramfs_data.cpio.lz4 \ | ||
44 | initramfs_data.cpio | ||
45 | # do not try to update files included in initramfs | 45 | # do not try to update files included in initramfs |
46 | $(deps_initramfs): ; | 46 | $(deps_initramfs): ; |
47 | 47 | ||
@@ -51,6 +51,6 @@ $(deps_initramfs): klibcdirs | |||
51 | # 2) There are changes in which files are included (added or deleted) | 51 | # 2) There are changes in which files are included (added or deleted) |
52 | # 3) If gen_init_cpio are newer than initramfs_data.cpio | 52 | # 3) If gen_init_cpio are newer than initramfs_data.cpio |
53 | # 4) arguments to gen_initramfs.sh changes | 53 | # 4) arguments to gen_initramfs.sh changes |
54 | $(obj)/initramfs_data.cpio$(suffix_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs | 54 | $(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs |
55 | $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.d | 55 | $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.d |
56 | $(call if_changed,initfs) | 56 | $(call if_changed,initfs) |