Simple overlapping changes in stmmac driver. Adjust skb_gro_flush_final_remcsum function signature to make GRO list changes in net-next, as per Stephen Rothwell's example merge resolution.
Unified · Split
| @@ -324,8 +324,7 @@ Global Attributes · 323 unmodified lines | ||
| 324 | 324 | |
| 325 | 325 | ``intel_pstate`` exposes several global attributes (files) in ``sysfs`` to |
| 326 | 326 | control its functionality at the system level. They are located in the |
| 327 | −``/sys/devices/system/cpu/cpufreq/intel_pstate/`` directory and affect all | |
| 328 | −CPUs. | |
| 327 | +``/sys/devices/system/cpu/intel_pstate/`` directory and affect all CPUs. | |
| 329 | 328 | |
| 330 | 329 | Some of them are not present if the ``intel_pstate=per_cpu_perf_limits`` |
| 331 | 330 | argument is passed to the kernel in the command line. |
| @@ -379,6 +378,17 @@ argument is passed to the kernel in the command line. · 47 unmodified lines | ||
| 379 | 378 | but it affects the maximum possible value of per-policy P-state limits |
| 380 | 379 | (see `Interpretation of Policy Attributes`_ below for details). |
| 381 | 380 | |
| 381 | +``hwp_dynamic_boost`` | |
| 382 | + This attribute is only present if ``intel_pstate`` works in the | |
| 383 | + `active mode with the HWP feature enabled <Active Mode With HWP_>`_ in | |
| 384 | + the processor. If set (equal to 1), it causes the minimum P-state limit | |
| 385 | + to be increased dynamically for a short time whenever a task previously | |
| 386 | + waiting on I/O is selected to run on a given logical CPU (the purpose | |
| 387 | + of this mechanism is to improve performance). | |
| 388 | + | |
| 389 | + This setting has no effect on logical CPUs whose minimum P-state limit | |
| 390 | + is directly set to the highest non-turbo P-state or above it. | |
| 391 | + | |
| 382 | 392 | .. _status_attr: |
| 383 | 393 | |
| 384 | 394 | ``status`` |
| @@ -0,0 +1,23 @@ | ||
| 1 | +Spreadtrum SC27xx PMIC Vibrator | |
| 2 | + | |
| 3 | +Required properties: | |
| 4 | +- compatible: should be "sprd,sc2731-vibrator". | |
| 5 | +- reg: address of vibrator control register. | |
| 6 | + | |
| 7 | +Example : | |
| 8 | + | |
| 9 | + sc2731_pmic: pmic@0 { | |
| 10 | + compatible = "sprd,sc2731"; | |
| 11 | + reg = <0>; | |
| 12 | + spi-max-frequency = <26000000>; | |
| 13 | + interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; | |
| 14 | + interrupt-controller; | |
| 15 | + #interrupt-cells = <2>; | |
| 16 | + #address-cells = <1>; | |
| 17 | + #size-cells = <0>; | |
| 18 | + | |
| 19 | + vibrator@eb4 { | |
| 20 | + compatible = "sprd,sc2731-vibrator"; | |
| 21 | + reg = <0xeb4>; | |
| 22 | + }; | |
| 23 | + }; | |
| @@ -441,8 +441,6 @@ prototypes: · 440 unmodified lines | ||
| 441 | 441 | int (*iterate) (struct file *, struct dir_context *); |
| 442 | 442 | int (*iterate_shared) (struct file *, struct dir_context *); |
| 443 | 443 | __poll_t (*poll) (struct file *, struct poll_table_struct *); |
| 444 | − struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t); | |
| 445 | − __poll_t (*poll_mask) (struct file *, __poll_t); | |
| 446 | 444 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
| 447 | 445 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
| 448 | 446 | int (*mmap) (struct file *, struct vm_area_struct *); |
| @@ -473,7 +471,7 @@ prototypes: · 24 unmodified lines | ||
| 473 | 471 | }; |
| 474 | 472 | |
| 475 | 473 | locking rules: |
| 476 | − All except for ->poll_mask may block. | |
| 474 | + All may block. | |
| 477 | 475 | |
| 478 | 476 | ->llseek() locking has moved from llseek to the individual llseek |
| 479 | 477 | implementations. If your fs is not using generic_file_llseek, you |
| @@ -505,9 +503,6 @@ in sys_read() and friends. · 25 unmodified lines | ||
| 505 | 503 | the lease within the individual filesystem to record the result of the |
| 506 | 504 | operation |
| 507 | 505 | |
| 508 | −->poll_mask can be called with or without the waitqueue lock for the waitqueue | |
| 509 | −returned from ->get_poll_head. | |
| 510 | − | |
| 511 | 506 | --------------------------- dquot_operations ------------------------------- |
| 512 | 507 | prototypes: |
| 513 | 508 | int (*write_dquot) (struct dquot *); |
| @@ -857,8 +857,6 @@ struct file_operations { · 856 unmodified lines | ||
| 857 | 857 | ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); |
| 858 | 858 | int (*iterate) (struct file *, struct dir_context *); |
| 859 | 859 | __poll_t (*poll) (struct file *, struct poll_table_struct *); |
| 860 | − struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t); | |
| 861 | − __poll_t (*poll_mask) (struct file *, __poll_t); | |
| 862 | 860 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
| 863 | 861 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
| 864 | 862 | int (*mmap) (struct file *, struct vm_area_struct *); |
| @@ -903,17 +901,6 @@ otherwise noted. · 38 unmodified lines | ||
| 903 | 901 | activity on this file and (optionally) go to sleep until there |
| 904 | 902 | is activity. Called by the select(2) and poll(2) system calls |
| 905 | 903 | |
| 906 | − get_poll_head: Returns the struct wait_queue_head that callers can | |
| 907 | − wait on. Callers need to check the returned events using ->poll_mask | |
| 908 | − once woken. Can return NULL to indicate polling is not supported, | |
| 909 | − or any error code using the ERR_PTR convention to indicate that a | |
| 910 | − grave error occured and ->poll_mask shall not be called. | |
| 911 | − | |
| 912 | − poll_mask: return the mask of EPOLL* values describing the file descriptor | |
| 913 | − state. Called either before going to sleep on the waitqueue returned by | |
| 914 | − get_poll_head, or after it has been woken. If ->get_poll_head and | |
| 915 | − ->poll_mask are implemented ->poll does not need to be implement. | |
| 916 | − | |
| 917 | 904 | unlocked_ioctl: called by the ioctl(2) system call. |
| 918 | 905 | |
| 919 | 906 | compat_ioctl: called by the ioctl(2) system call when 32 bit system calls |
| @@ -430,6 +430,12 @@ This sets the config program's title bar if the config program chooses · 429 unmodified lines | ||
| 430 | 430 | to use it. It should be placed at the top of the configuration, before any |
| 431 | 431 | other statement. |
| 432 | 432 | |
| 433 | +'#' Kconfig source file comment: | |
| 434 | + | |
| 435 | +An unquoted '#' character anywhere in a source file line indicates | |
| 436 | +the beginning of a source file comment. The remainder of that line | |
| 437 | +is a comment. | |
| 438 | + | |
| 433 | 439 | |
| 434 | 440 | Kconfig hints |
| 435 | 441 | ------------- |
| @@ -226,7 +226,7 @@ $ rm configs/<config name>.<number>/<function> · 225 unmodified lines | ||
| 226 | 226 | where <config name>.<number> specify the configuration and <function> is |
| 227 | 227 | a symlink to a function being removed from the configuration, e.g.: |
| 228 | 228 | |
| 229 | −$ rm configfs/c.1/ncm.usb0 | |
| 229 | +$ rm configs/c.1/ncm.usb0 | |
| 230 | 230 | |
| 231 | 231 | ... |
| 232 | 232 | ... |
| @@ -2971,9 +2971,13 @@ N: bcm585* · 2970 unmodified lines | ||
| 2971 | 2971 | N: bcm586* |
| 2972 | 2972 | N: bcm88312 |
| 2973 | 2973 | N: hr2 |
| 2974 | −F: arch/arm64/boot/dts/broadcom/ns2* | |
| 2974 | +N: stingray | |
| 2975 | +F: arch/arm64/boot/dts/broadcom/northstar2/* | |
| 2976 | +F: arch/arm64/boot/dts/broadcom/stingray/* | |
| 2975 | 2977 | F: drivers/clk/bcm/clk-ns* |
| 2978 | +F: drivers/clk/bcm/clk-sr* | |
| 2976 | 2979 | F: drivers/pinctrl/bcm/pinctrl-ns* |
| 2980 | +F: include/dt-bindings/clock/bcm-sr* | |
| 2977 | 2981 | |
| 2978 | 2982 | BROADCOM KONA GPIO DRIVER |
| 2979 | 2983 | M: Ray Jui <rjui@broadcom.com> |
| @@ -5669,7 +5673,7 @@ F: drivers/crypto/caam/ · 2689 unmodified lines | ||
| 5669 | 5673 | F: Documentation/devicetree/bindings/crypto/fsl-sec4.txt |
| 5670 | 5674 | |
| 5671 | 5675 | FREESCALE DIU FRAMEBUFFER DRIVER |
| 5672 | −M: Timur Tabi <timur@tabi.org> | |
| 5676 | +M: Timur Tabi <timur@kernel.org> | |
| 5673 | 5677 | L: linux-fbdev@vger.kernel.org |
| 5674 | 5678 | S: Maintained |
| 5675 | 5679 | F: drivers/video/fbdev/fsl-diu-fb.* |
| @@ -5769,7 +5773,7 @@ S: Maintained · 93 unmodified lines | ||
| 5769 | 5773 | F: drivers/net/wan/fsl_ucc_hdlc* |
| 5770 | 5774 | |
| 5771 | 5775 | FREESCALE QUICC ENGINE UCC UART DRIVER |
| 5772 | −M: Timur Tabi <timur@tabi.org> | |
| 5776 | +M: Timur Tabi <timur@kernel.org> | |
| 5773 | 5777 | L: linuxppc-dev@lists.ozlabs.org |
| 5774 | 5778 | S: Maintained |
| 5775 | 5779 | F: drivers/tty/serial/ucc_uart.c |
| @@ -5793,7 +5797,7 @@ F: drivers/net/ethernet/freescale/fs_enet/ · 17 unmodified lines | ||
| 5793 | 5797 | F: include/linux/fs_enet_pd.h |
| 5794 | 5798 | |
| 5795 | 5799 | FREESCALE SOC SOUND DRIVERS |
| 5796 | −M: Timur Tabi <timur@tabi.org> | |
| 5800 | +M: Timur Tabi <timur@kernel.org> | |
| 5797 | 5801 | M: Nicolin Chen <nicoleotsuka@gmail.com> |
| 5798 | 5802 | M: Xiubo Li <Xiubo.Lee@gmail.com> |
| 5799 | 5803 | R: Fabio Estevam <fabio.estevam@nxp.com> |
| @@ -11478,6 +11482,15 @@ W: http://wireless.kernel.org/en/users/Drivers/p54 · 5678 unmodified lines | ||
| 11478 | 11482 | S: Obsolete |
| 11479 | 11483 | F: drivers/net/wireless/intersil/prism54/ |
| 11480 | 11484 | |
| 11485 | +PROC FILESYSTEM | |
| 11486 | +R: Alexey Dobriyan <adobriyan@gmail.com> | |
| 11487 | +L: linux-kernel@vger.kernel.org | |
| 11488 | +L: linux-fsdevel@vger.kernel.org | |
| 11489 | +S: Maintained | |
| 11490 | +F: fs/proc/ | |
| 11491 | +F: include/linux/proc_fs.h | |
| 11492 | +F: tools/testing/selftests/proc/ | |
| 11493 | + | |
| 11481 | 11494 | PROC SYSCTL |
| 11482 | 11495 | M: "Luis R. Rodriguez" <mcgrof@kernel.org> |
| 11483 | 11496 | M: Kees Cook <keescook@chromium.org> |
| @@ -11810,9 +11823,9 @@ F: Documentation/devicetree/bindings/opp/kryo-cpufreq.txt · 326 unmodified lines | ||
| 11810 | 11823 | F: drivers/cpufreq/qcom-cpufreq-kryo.c |
| 11811 | 11824 | |
| 11812 | 11825 | QUALCOMM EMAC GIGABIT ETHERNET DRIVER |
| 11813 | −M: Timur Tabi <timur@codeaurora.org> | |
| 11826 | +M: Timur Tabi <timur@kernel.org> | |
| 11814 | 11827 | L: netdev@vger.kernel.org |
| 11815 | −S: Supported | |
| 11828 | +S: Maintained | |
| 11816 | 11829 | F: drivers/net/ethernet/qualcomm/emac/ |
| 11817 | 11830 | |
| 11818 | 11831 | QUALCOMM HEXAGON ARCHITECTURE |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | VERSION = 4 |
| 3 | 3 | PATCHLEVEL = 18 |
| 4 | 4 | SUBLEVEL = 0 |
| 5 | −EXTRAVERSION = -rc2 | |
| 5 | +EXTRAVERSION = -rc3 | |
| 6 | 6 | NAME = Merciless Moray |
| 7 | 7 | |
| 8 | 8 | # *DOCUMENTATION* |
| @@ -507,11 +507,6 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLA · 498 unmodified lines | ||
| 507 | 507 | KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO |
| 508 | 508 | endif |
| 509 | 509 | |
| 510 | −ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/cc-can-link.sh $(CC)), y) | |
| 511 | − CC_CAN_LINK := y | |
| 512 | − export CC_CAN_LINK | |
| 513 | −endif | |
| 514 | − | |
| 515 | 510 | # The expansion should be delayed until arch/$(SRCARCH)/Makefile is included. |
| 516 | 511 | # Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile. |
| 517 | 512 | # CC_VERSION_TEXT is referenced from Kconfig (so it needs export), |
| @@ -1245,8 +1245,14 @@ config PCI · 1244 unmodified lines | ||
| 1245 | 1245 | VESA. If you have PCI, say Y, otherwise N. |
| 1246 | 1246 | |
| 1247 | 1247 | config PCI_DOMAINS |
| 1248 | − bool | |
| 1248 | + bool "Support for multiple PCI domains" | |
| 1249 | 1249 | depends on PCI |
| 1250 | + help | |
| 1251 | + Enable PCI domains kernel management. Say Y if your machine | |
| 1252 | + has a PCI bus hierarchy that requires more than one PCI | |
| 1253 | + domain (aka segment) to be correctly managed. Say N otherwise. | |
| 1254 | + | |
| 1255 | + If you don't know what to do here, say N. | |
| 1250 | 1256 | |
| 1251 | 1257 | config PCI_DOMAINS_GENERIC |
| 1252 | 1258 | def_bool PCI_DOMAINS |
| @@ -139,7 +139,7 @@ · 138 unmodified lines | ||
| 139 | 139 | 3700 5 |
| 140 | 140 | 3900 6 |
| 141 | 141 | 4000 7>; |
| 142 | − cooling-cells = <2>; | |
| 142 | + #cooling-cells = <2>; | |
| 143 | 143 | }; |
| 144 | 144 | |
| 145 | 145 | gpio-leds { |
| @@ -216,7 +216,7 @@ · 215 unmodified lines | ||
| 216 | 216 | reg = <0x18008000 0x100>; |
| 217 | 217 | #address-cells = <1>; |
| 218 | 218 | #size-cells = <0>; |
| 219 | − interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>; | |
| 219 | + interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>; | |
| 220 | 220 | clock-frequency = <100000>; |
| 221 | 221 | status = "disabled"; |
| 222 | 222 | }; |
| @@ -245,7 +245,7 @@ · 22 unmodified lines | ||
| 245 | 245 | reg = <0x1800b000 0x100>; |
| 246 | 246 | #address-cells = <1>; |
| 247 | 247 | #size-cells = <0>; |
| 248 | − interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>; | |
| 248 | + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; | |
| 249 | 249 | clock-frequency = <100000>; |
| 250 | 250 | status = "disabled"; |
| 251 | 251 | }; |
| @@ -256,7 +256,7 @@ · 4 unmodified lines | ||
| 256 | 256 | |
| 257 | 257 | #interrupt-cells = <1>; |
| 258 | 258 | interrupt-map-mask = <0 0 0 0>; |
| 259 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_NONE>; | |
| 259 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>; | |
| 260 | 260 | |
| 261 | 261 | linux,pci-domain = <0>; |
| 262 | 262 | |
| @@ -278,10 +278,10 @@ · 15 unmodified lines | ||
| 278 | 278 | compatible = "brcm,iproc-msi"; |
| 279 | 279 | msi-controller; |
| 280 | 280 | interrupt-parent = <&gic>; |
| 281 | − interrupts = <GIC_SPI 96 IRQ_TYPE_NONE>, | |
| 282 | − <GIC_SPI 97 IRQ_TYPE_NONE>, | |
| 283 | − <GIC_SPI 98 IRQ_TYPE_NONE>, | |
| 284 | − <GIC_SPI 99 IRQ_TYPE_NONE>; | |
| 281 | + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>, | |
| 282 | + <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>, | |
| 283 | + <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>, | |
| 284 | + <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; | |
| 285 | 285 | }; |
| 286 | 286 | }; |
| 287 | 287 | |
| @@ -291,7 +291,7 @@ · 3 unmodified lines | ||
| 291 | 291 | |
| 292 | 292 | #interrupt-cells = <1>; |
| 293 | 293 | interrupt-map-mask = <0 0 0 0>; |
| 294 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_NONE>; | |
| 294 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>; | |
| 295 | 295 | |
| 296 | 296 | linux,pci-domain = <1>; |
| 297 | 297 | |
| @@ -313,10 +313,10 @@ · 15 unmodified lines | ||
| 313 | 313 | compatible = "brcm,iproc-msi"; |
| 314 | 314 | msi-controller; |
| 315 | 315 | interrupt-parent = <&gic>; |
| 316 | − interrupts = <GIC_SPI 102 IRQ_TYPE_NONE>, | |
| 317 | − <GIC_SPI 103 IRQ_TYPE_NONE>, | |
| 318 | − <GIC_SPI 104 IRQ_TYPE_NONE>, | |
| 319 | − <GIC_SPI 105 IRQ_TYPE_NONE>; | |
| 316 | + interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>, | |
| 317 | + <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>, | |
| 318 | + <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>, | |
| 319 | + <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; | |
| 320 | 320 | }; |
| 321 | 321 | }; |
| 322 | 322 | |
| @@ -264,7 +264,7 @@ · 263 unmodified lines | ||
| 264 | 264 | reg = <0x38000 0x50>; |
| 265 | 265 | #address-cells = <1>; |
| 266 | 266 | #size-cells = <0>; |
| 267 | − interrupts = <GIC_SPI 95 IRQ_TYPE_NONE>; | |
| 267 | + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; | |
| 268 | 268 | clock-frequency = <100000>; |
| 269 | 269 | }; |
| 270 | 270 | |
| @@ -279,7 +279,7 @@ · 8 unmodified lines | ||
| 279 | 279 | reg = <0x3b000 0x50>; |
| 280 | 280 | #address-cells = <1>; |
| 281 | 281 | #size-cells = <0>; |
| 282 | − interrupts = <GIC_SPI 96 IRQ_TYPE_NONE>; | |
| 282 | + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; | |
| 283 | 283 | clock-frequency = <100000>; |
| 284 | 284 | }; |
| 285 | 285 | }; |
| @@ -300,7 +300,7 @@ · 14 unmodified lines | ||
| 300 | 300 | |
| 301 | 301 | #interrupt-cells = <1>; |
| 302 | 302 | interrupt-map-mask = <0 0 0 0>; |
| 303 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 186 IRQ_TYPE_NONE>; | |
| 303 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>; | |
| 304 | 304 | |
| 305 | 305 | linux,pci-domain = <0>; |
| 306 | 306 | |
| @@ -322,10 +322,10 @@ · 15 unmodified lines | ||
| 322 | 322 | compatible = "brcm,iproc-msi"; |
| 323 | 323 | msi-controller; |
| 324 | 324 | interrupt-parent = <&gic>; |
| 325 | − interrupts = <GIC_SPI 182 IRQ_TYPE_NONE>, | |
| 326 | − <GIC_SPI 183 IRQ_TYPE_NONE>, | |
| 327 | − <GIC_SPI 184 IRQ_TYPE_NONE>, | |
| 328 | − <GIC_SPI 185 IRQ_TYPE_NONE>; | |
| 325 | + interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>, | |
| 326 | + <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>, | |
| 327 | + <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>, | |
| 328 | + <GIC_SPI 185 IRQ_TYPE_LEVEL_HIGH>; | |
| 329 | 329 | brcm,pcie-msi-inten; |
| 330 | 330 | }; |
| 331 | 331 | }; |
| @@ -336,7 +336,7 @@ · 4 unmodified lines | ||
| 336 | 336 | |
| 337 | 337 | #interrupt-cells = <1>; |
| 338 | 338 | interrupt-map-mask = <0 0 0 0>; |
| 339 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 192 IRQ_TYPE_NONE>; | |
| 339 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>; | |
| 340 | 340 | |
| 341 | 341 | linux,pci-domain = <1>; |
| 342 | 342 | |
| @@ -358,10 +358,10 @@ · 15 unmodified lines | ||
| 358 | 358 | compatible = "brcm,iproc-msi"; |
| 359 | 359 | msi-controller; |
| 360 | 360 | interrupt-parent = <&gic>; |
| 361 | − interrupts = <GIC_SPI 188 IRQ_TYPE_NONE>, | |
| 362 | − <GIC_SPI 189 IRQ_TYPE_NONE>, | |
| 363 | − <GIC_SPI 190 IRQ_TYPE_NONE>, | |
| 364 | − <GIC_SPI 191 IRQ_TYPE_NONE>; | |
| 361 | + interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>, | |
| 362 | + <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>, | |
| 363 | + <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>, | |
| 364 | + <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>; | |
| 365 | 365 | brcm,pcie-msi-inten; |
| 366 | 366 | }; |
| 367 | 367 | }; |
| @@ -391,7 +391,7 @@ · 390 unmodified lines | ||
| 391 | 391 | reg = <0x38000 0x50>; |
| 392 | 392 | #address-cells = <1>; |
| 393 | 393 | #size-cells = <0>; |
| 394 | − interrupts = <GIC_SPI 89 IRQ_TYPE_NONE>; | |
| 394 | + interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>; | |
| 395 | 395 | clock-frequency = <100000>; |
| 396 | 396 | dma-coherent; |
| 397 | 397 | status = "disabled"; |
| @@ -496,7 +496,7 @@ · 98 unmodified lines | ||
| 496 | 496 | |
| 497 | 497 | #interrupt-cells = <1>; |
| 498 | 498 | interrupt-map-mask = <0 0 0 0>; |
| 499 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 131 IRQ_TYPE_NONE>; | |
| 499 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>; | |
| 500 | 500 | |
| 501 | 501 | linux,pci-domain = <0>; |
| 502 | 502 | |
| @@ -519,10 +519,10 @@ · 16 unmodified lines | ||
| 519 | 519 | compatible = "brcm,iproc-msi"; |
| 520 | 520 | msi-controller; |
| 521 | 521 | interrupt-parent = <&gic>; |
| 522 | − interrupts = <GIC_SPI 127 IRQ_TYPE_NONE>, | |
| 523 | − <GIC_SPI 128 IRQ_TYPE_NONE>, | |
| 524 | − <GIC_SPI 129 IRQ_TYPE_NONE>, | |
| 525 | − <GIC_SPI 130 IRQ_TYPE_NONE>; | |
| 522 | + interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>, | |
| 523 | + <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>, | |
| 524 | + <GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>, | |
| 525 | + <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>; | |
| 526 | 526 | brcm,pcie-msi-inten; |
| 527 | 527 | }; |
| 528 | 528 | }; |
| @@ -533,7 +533,7 @@ · 4 unmodified lines | ||
| 533 | 533 | |
| 534 | 534 | #interrupt-cells = <1>; |
| 535 | 535 | interrupt-map-mask = <0 0 0 0>; |
| 536 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 137 IRQ_TYPE_NONE>; | |
| 536 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>; | |
| 537 | 537 | |
| 538 | 538 | linux,pci-domain = <1>; |
| 539 | 539 | |
| @@ -556,10 +556,10 @@ · 16 unmodified lines | ||
| 556 | 556 | compatible = "brcm,iproc-msi"; |
| 557 | 557 | msi-controller; |
| 558 | 558 | interrupt-parent = <&gic>; |
| 559 | − interrupts = <GIC_SPI 133 IRQ_TYPE_NONE>, | |
| 560 | − <GIC_SPI 134 IRQ_TYPE_NONE>, | |
| 561 | − <GIC_SPI 135 IRQ_TYPE_NONE>, | |
| 562 | − <GIC_SPI 136 IRQ_TYPE_NONE>; | |
| 559 | + interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>, | |
| 560 | + <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>, | |
| 561 | + <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>, | |
| 562 | + <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>; | |
| 563 | 563 | brcm,pcie-msi-inten; |
| 564 | 564 | }; |
| 565 | 565 | }; |
| @@ -570,7 +570,7 @@ · 4 unmodified lines | ||
| 570 | 570 | |
| 571 | 571 | #interrupt-cells = <1>; |
| 572 | 572 | interrupt-map-mask = <0 0 0 0>; |
| 573 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 143 IRQ_TYPE_NONE>; | |
| 573 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; | |
| 574 | 574 | |
| 575 | 575 | linux,pci-domain = <2>; |
| 576 | 576 | |
| @@ -593,10 +593,10 @@ · 16 unmodified lines | ||
| 593 | 593 | compatible = "brcm,iproc-msi"; |
| 594 | 594 | msi-controller; |
| 595 | 595 | interrupt-parent = <&gic>; |
| 596 | − interrupts = <GIC_SPI 139 IRQ_TYPE_NONE>, | |
| 597 | − <GIC_SPI 140 IRQ_TYPE_NONE>, | |
| 598 | − <GIC_SPI 141 IRQ_TYPE_NONE>, | |
| 599 | − <GIC_SPI 142 IRQ_TYPE_NONE>; | |
| 596 | + interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>, | |
| 597 | + <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>, | |
| 598 | + <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>, | |
| 599 | + <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>; | |
| 600 | 600 | brcm,pcie-msi-inten; |
| 601 | 601 | }; |
| 602 | 602 | }; |
| @@ -365,7 +365,7 @@ · 364 unmodified lines | ||
| 365 | 365 | i2c0: i2c@18009000 { |
| 366 | 366 | compatible = "brcm,iproc-i2c"; |
| 367 | 367 | reg = <0x18009000 0x50>; |
| 368 | − interrupts = <GIC_SPI 121 IRQ_TYPE_NONE>; | |
| 368 | + interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>; | |
| 369 | 369 | #address-cells = <1>; |
| 370 | 370 | #size-cells = <0>; |
| 371 | 371 | clock-frequency = <100000>; |
| @@ -549,11 +549,7 @@ · 548 unmodified lines | ||
| 549 | 549 | gpio-controller; |
| 550 | 550 | #gpio-cells = <2>; |
| 551 | 551 | reg = <0x226000 0x1000>; |
| 552 | − interrupts = <42 IRQ_TYPE_EDGE_BOTH | |
| 553 | − 43 IRQ_TYPE_EDGE_BOTH 44 IRQ_TYPE_EDGE_BOTH | |
| 554 | − 45 IRQ_TYPE_EDGE_BOTH 46 IRQ_TYPE_EDGE_BOTH | |
| 555 | − 47 IRQ_TYPE_EDGE_BOTH 48 IRQ_TYPE_EDGE_BOTH | |
| 556 | − 49 IRQ_TYPE_EDGE_BOTH 50 IRQ_TYPE_EDGE_BOTH>; | |
| 552 | + interrupts = <42 43 44 45 46 47 48 49 50>; | |
| 557 | 553 | ti,ngpio = <144>; |
| 558 | 554 | ti,davinci-gpio-unbanked = <0>; |
| 559 | 555 | status = "disabled"; |
| @@ -90,7 +90,7 @@ · 89 unmodified lines | ||
| 90 | 90 | clocks = <&clks IMX6Q_CLK_ECSPI5>, |
| 91 | 91 | <&clks IMX6Q_CLK_ECSPI5>; |
| 92 | 92 | clock-names = "ipg", "per"; |
| 93 | − dmas = <&sdma 11 7 1>, <&sdma 12 7 2>; | |
| 93 | + dmas = <&sdma 11 8 1>, <&sdma 12 8 2>; | |
| 94 | 94 | dma-names = "rx", "tx"; |
| 95 | 95 | status = "disabled"; |
| 96 | 96 | }; |
| @@ -1344,7 +1344,7 @@ · 1343 unmodified lines | ||
| 1344 | 1344 | ranges = <0x81000000 0 0 0x08f80000 0 0x00010000 /* downstream I/O */ |
| 1345 | 1345 | 0x82000000 0 0x08000000 0x08000000 0 0x00f00000>; /* non-prefetchable memory */ |
| 1346 | 1346 | num-lanes = <1>; |
| 1347 | − interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>; | |
| 1347 | + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; | |
| 1348 | 1348 | interrupt-names = "msi"; |
| 1349 | 1349 | #interrupt-cells = <1>; |
| 1350 | 1350 | interrupt-map-mask = <0 0 0 0x7>; |
| @@ -748,13 +748,13 @@ · 747 unmodified lines | ||
| 748 | 748 | nand0: nand@ff900000 { |
| 749 | 749 | #address-cells = <0x1>; |
| 750 | 750 | #size-cells = <0x1>; |
| 751 | − compatible = "denali,denali-nand-dt"; | |
| 751 | + compatible = "altr,socfpga-denali-nand"; | |
| 752 | 752 | reg = <0xff900000 0x100000>, |
| 753 | 753 | <0xffb80000 0x10000>; |
| 754 | 754 | reg-names = "nand_data", "denali_reg"; |
| 755 | 755 | interrupts = <0x0 0x90 0x4>; |
| 756 | 756 | dma-mask = <0xffffffff>; |
| 757 | − clocks = <&nand_clk>; | |
| 757 | + clocks = <&nand_x_clk>; | |
| 758 | 758 | status = "disabled"; |
| 759 | 759 | }; |
| 760 | 760 | |
| @@ -593,8 +593,7 @@ · 592 unmodified lines | ||
| 593 | 593 | #size-cells = <0>; |
| 594 | 594 | reg = <0xffda5000 0x100>; |
| 595 | 595 | interrupts = <0 102 4>; |
| 596 | − num-chipselect = <4>; | |
| 597 | − bus-num = <0>; | |
| 596 | + num-cs = <4>; | |
| 598 | 597 | /*32bit_access;*/ |
| 599 | 598 | tx-dma-channel = <&pdma 16>; |
| 600 | 599 | rx-dma-channel = <&pdma 17>; |
| @@ -633,7 +632,7 @@ · 32 unmodified lines | ||
| 633 | 632 | nand: nand@ffb90000 { |
| 634 | 633 | #address-cells = <1>; |
| 635 | 634 | #size-cells = <1>; |
| 636 | − compatible = "denali,denali-nand-dt", "altr,socfpga-denali-nand"; | |
| 635 | + compatible = "altr,socfpga-denali-nand"; | |
| 637 | 636 | reg = <0xffb90000 0x72000>, |
| 638 | 637 | <0xffb80000 0x10000>; |
| 639 | 638 | reg-names = "nand_data", "denali_reg"; |
| @@ -10,7 +10,7 @@ obj-$(CONFIG_DMABOUNCE) += dmabounce.o · 9 unmodified lines | ||
| 10 | 10 | obj-$(CONFIG_SHARP_LOCOMO) += locomo.o |
| 11 | 11 | obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o |
| 12 | 12 | obj-$(CONFIG_SHARP_SCOOP) += scoop.o |
| 13 | −obj-$(CONFIG_SMP) += secure_cntvoff.o | |
| 13 | +obj-$(CONFIG_CPU_V7) += secure_cntvoff.o | |
| 14 | 14 | obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o |
| 15 | 15 | obj-$(CONFIG_MCPM) += mcpm_head.o mcpm_entry.o mcpm_platsmp.o vlock.o |
| 16 | 16 | CFLAGS_REMOVE_mcpm_entry.o = -pg |
| @@ -1,5 +1,4 @@ | ||
| 1 | 1 | CONFIG_SYSVIPC=y |
| 2 | −CONFIG_FHANDLE=y | |
| 3 | 2 | CONFIG_NO_HZ=y |
| 4 | 3 | CONFIG_HIGH_RES_TIMERS=y |
| 5 | 4 | CONFIG_CGROUPS=y |
| @@ -10,20 +9,10 @@ CONFIG_MODULES=y · 4 unmodified lines | ||
| 10 | 9 | CONFIG_MODULE_UNLOAD=y |
| 11 | 10 | CONFIG_PARTITION_ADVANCED=y |
| 12 | 11 | CONFIG_CMDLINE_PARTITION=y |
| 13 | −CONFIG_ARCH_MULTI_V7=y | |
| 14 | −# CONFIG_ARCH_MULTI_V5 is not set | |
| 15 | −# CONFIG_ARCH_MULTI_V4 is not set | |
| 16 | 12 | CONFIG_ARCH_VIRT=y |
| 17 | 13 | CONFIG_ARCH_ALPINE=y |
| 18 | 14 | CONFIG_ARCH_ARTPEC=y |
| 19 | 15 | CONFIG_MACH_ARTPEC6=y |
| 20 | −CONFIG_ARCH_MVEBU=y | |
| 21 | −CONFIG_MACH_ARMADA_370=y | |
| 22 | −CONFIG_MACH_ARMADA_375=y | |
| 23 | −CONFIG_MACH_ARMADA_38X=y | |
| 24 | −CONFIG_MACH_ARMADA_39X=y | |
| 25 | −CONFIG_MACH_ARMADA_XP=y | |
| 26 | −CONFIG_MACH_DOVE=y | |
| 27 | 16 | CONFIG_ARCH_AT91=y |
| 28 | 17 | CONFIG_SOC_SAMA5D2=y |
| 29 | 18 | CONFIG_SOC_SAMA5D3=y |
| @@ -32,9 +21,9 @@ CONFIG_ARCH_BCM=y · 2 unmodified lines | ||
| 32 | 21 | CONFIG_ARCH_BCM_CYGNUS=y |
| 33 | 22 | CONFIG_ARCH_BCM_HR2=y |
| 34 | 23 | CONFIG_ARCH_BCM_NSP=y |
| 35 | −CONFIG_ARCH_BCM_21664=y | |
| 36 | −CONFIG_ARCH_BCM_281XX=y | |
| 37 | 24 | CONFIG_ARCH_BCM_5301X=y |
| 25 | +CONFIG_ARCH_BCM_281XX=y | |
| 26 | +CONFIG_ARCH_BCM_21664=y | |
| 38 | 27 | CONFIG_ARCH_BCM2835=y |
| 39 | 28 | CONFIG_ARCH_BCM_63XX=y |
| 40 | 29 | CONFIG_ARCH_BRCMSTB=y |
| @@ -43,14 +32,14 @@ CONFIG_MACH_BERLIN_BG2=y · 2 unmodified lines | ||
| 43 | 32 | CONFIG_MACH_BERLIN_BG2CD=y |
| 44 | 33 | CONFIG_MACH_BERLIN_BG2Q=y |
| 45 | 34 | CONFIG_ARCH_DIGICOLOR=y |
| 35 | +CONFIG_ARCH_EXYNOS=y | |
| 36 | +CONFIG_EXYNOS5420_MCPM=y | |
| 46 | 37 | CONFIG_ARCH_HIGHBANK=y |
| 47 | 38 | CONFIG_ARCH_HISI=y |
| 48 | 39 | CONFIG_ARCH_HI3xxx=y |
| 49 | −CONFIG_ARCH_HIX5HD2=y | |
| 50 | 40 | CONFIG_ARCH_HIP01=y |
| 51 | 41 | CONFIG_ARCH_HIP04=y |
| 52 | −CONFIG_ARCH_KEYSTONE=y | |
| 53 | −CONFIG_ARCH_MESON=y | |
| 42 | +CONFIG_ARCH_HIX5HD2=y | |
| 54 | 43 | CONFIG_ARCH_MXC=y |
| 55 | 44 | CONFIG_SOC_IMX50=y |
| 56 | 45 | CONFIG_SOC_IMX51=y |
| @@ -60,29 +49,30 @@ CONFIG_SOC_IMX6SL=y · 3 unmodified lines | ||
| 60 | 49 | CONFIG_SOC_IMX6SX=y |
| 61 | 50 | CONFIG_SOC_IMX6UL=y |
| 62 | 51 | CONFIG_SOC_IMX7D=y |
| 63 | −CONFIG_SOC_VF610=y | |
| 64 | 52 | CONFIG_SOC_LS1021A=y |
| 53 | +CONFIG_SOC_VF610=y | |
| 54 | +CONFIG_ARCH_KEYSTONE=y | |
| 55 | +CONFIG_ARCH_MEDIATEK=y | |
| 56 | +CONFIG_ARCH_MESON=y | |
| 57 | +CONFIG_ARCH_MVEBU=y | |
| 58 | +CONFIG_MACH_ARMADA_370=y | |
| 59 | +CONFIG_MACH_ARMADA_375=y | |
| 60 | +CONFIG_MACH_ARMADA_38X=y | |
| 61 | +CONFIG_MACH_ARMADA_39X=y | |
| 62 | +CONFIG_MACH_ARMADA_XP=y | |
| 63 | +CONFIG_MACH_DOVE=y | |
| 65 | 64 | CONFIG_ARCH_OMAP3=y |
| 66 | 65 | CONFIG_ARCH_OMAP4=y |
| 67 | 66 | CONFIG_SOC_OMAP5=y |
| 68 | 67 | CONFIG_SOC_AM33XX=y |
| 69 | 68 | CONFIG_SOC_AM43XX=y |
| 70 | 69 | CONFIG_SOC_DRA7XX=y |
| 70 | +CONFIG_ARCH_SIRF=y | |
| 71 | 71 | CONFIG_ARCH_QCOM=y |
| 72 | −CONFIG_ARCH_MEDIATEK=y | |
| 73 | 72 | CONFIG_ARCH_MSM8X60=y |
| 74 | 73 | CONFIG_ARCH_MSM8960=y |
| 75 | 74 | CONFIG_ARCH_MSM8974=y |
| 76 | 75 | CONFIG_ARCH_ROCKCHIP=y |
| 77 | −CONFIG_ARCH_SOCFPGA=y | |
| 78 | −CONFIG_PLAT_SPEAR=y | |
| 79 | −CONFIG_ARCH_SPEAR13XX=y | |
| 80 | −CONFIG_MACH_SPEAR1310=y | |
| 81 | −CONFIG_MACH_SPEAR1340=y | |
| 82 | −CONFIG_ARCH_STI=y | |
| 83 | −CONFIG_ARCH_STM32=y | |
| 84 | −CONFIG_ARCH_EXYNOS=y | |
| 85 | −CONFIG_EXYNOS5420_MCPM=y | |
| 86 | 76 | CONFIG_ARCH_RENESAS=y |
| 87 | 77 | CONFIG_ARCH_EMEV2=y |
| 88 | 78 | CONFIG_ARCH_R7S72100=y |
| @@ -99,40 +89,33 @@ CONFIG_ARCH_R8A7792=y · 10 unmodified lines | ||
| 99 | 89 | CONFIG_ARCH_R8A7793=y |
| 100 | 90 | CONFIG_ARCH_R8A7794=y |
| 101 | 91 | CONFIG_ARCH_SH73A0=y |
| 92 | +CONFIG_ARCH_SOCFPGA=y | |
| 93 | +CONFIG_PLAT_SPEAR=y | |
| 94 | +CONFIG_ARCH_SPEAR13XX=y | |
| 95 | +CONFIG_MACH_SPEAR1310=y | |
| 96 | +CONFIG_MACH_SPEAR1340=y | |
| 97 | +CONFIG_ARCH_STI=y | |
| 98 | +CONFIG_ARCH_STM32=y | |
| 102 | 99 | CONFIG_ARCH_SUNXI=y |
| 103 | −CONFIG_ARCH_SIRF=y | |
| 104 | 100 | CONFIG_ARCH_TEGRA=y |
| 105 | −CONFIG_ARCH_TEGRA_2x_SOC=y | |
| 106 | −CONFIG_ARCH_TEGRA_3x_SOC=y | |
| 107 | −CONFIG_ARCH_TEGRA_114_SOC=y | |
| 108 | −CONFIG_ARCH_TEGRA_124_SOC=y | |
| 109 | 101 | CONFIG_ARCH_UNIPHIER=y |
| 110 | 102 | CONFIG_ARCH_U8500=y |
| 111 | −CONFIG_MACH_HREFV60=y | |
| 112 | −CONFIG_MACH_SNOWBALL=y | |
| 113 | 103 | CONFIG_ARCH_VEXPRESS=y |
| 114 | 104 | CONFIG_ARCH_VEXPRESS_TC2_PM=y |
| 115 | 105 | CONFIG_ARCH_WM8850=y |
| 116 | 106 | CONFIG_ARCH_ZYNQ=y |
| 117 | −CONFIG_TRUSTED_FOUNDATIONS=y | |
| 118 | −CONFIG_PCI=y | |
| 119 | −CONFIG_PCI_HOST_GENERIC=y | |
| 120 | −CONFIG_PCI_DRA7XX=y | |
| 121 | −CONFIG_PCI_DRA7XX_EP=y | |
| 122 | −CONFIG_PCI_KEYSTONE=y | |
| 123 | −CONFIG_PCI_MSI=y | |
| 107 | +CONFIG_PCIEPORTBUS=y | |
| 124 | 108 | CONFIG_PCI_MVEBU=y |
| 125 | 109 | CONFIG_PCI_TEGRA=y |
| 126 | 110 | CONFIG_PCI_RCAR_GEN2=y |
| 127 | 111 | CONFIG_PCIE_RCAR=y |
| 128 | −CONFIG_PCIEPORTBUS=y | |
| 112 | +CONFIG_PCI_DRA7XX_EP=y | |
| 113 | +CONFIG_PCI_KEYSTONE=y | |
| 129 | 114 | CONFIG_PCI_ENDPOINT=y |
| 130 | 115 | CONFIG_PCI_ENDPOINT_CONFIGFS=y |
| 131 | 116 | CONFIG_PCI_EPF_TEST=m |
| 132 | 117 | CONFIG_SMP=y |
| 133 | 118 | CONFIG_NR_CPUS=16 |
| 134 | −CONFIG_HIGHPTE=y | |
| 135 | −CONFIG_CMA=y | |
| 136 | 119 | CONFIG_SECCOMP=y |
| 137 | 120 | CONFIG_ARM_APPENDED_DTB=y |
| 138 | 121 | CONFIG_ARM_ATAG_DTB_COMPAT=y |
| @@ -145,14 +128,14 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=m · 6 unmodified lines | ||
| 145 | 128 | CONFIG_CPU_FREQ_GOV_USERSPACE=m |
| 146 | 129 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m |
| 147 | 130 | CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y |
| 131 | +CONFIG_CPUFREQ_DT=y | |
| 148 | 132 | CONFIG_ARM_IMX6Q_CPUFREQ=y |
| 149 | 133 | CONFIG_QORIQ_CPUFREQ=y |
| 150 | 134 | CONFIG_CPU_IDLE=y |
| 151 | 135 | CONFIG_ARM_CPUIDLE=y |
| 152 | −CONFIG_NEON=y | |
| 153 | −CONFIG_KERNEL_MODE_NEON=y | |
| 154 | 136 | CONFIG_ARM_ZYNQ_CPUIDLE=y |
| 155 | 137 | CONFIG_ARM_EXYNOS_CPUIDLE=y |
| 138 | +CONFIG_KERNEL_MODE_NEON=y | |
| 156 | 139 | CONFIG_NET=y |
| 157 | 140 | CONFIG_PACKET=y |
| 158 | 141 | CONFIG_UNIX=y |
| @@ -170,23 +153,13 @@ CONFIG_IPV6_MIP6=m · 11 unmodified lines | ||
| 170 | 153 | CONFIG_IPV6_TUNNEL=m |
| 171 | 154 | CONFIG_IPV6_MULTIPLE_TABLES=y |
| 172 | 155 | CONFIG_NET_DSA=m |
| 173 | −CONFIG_NET_SWITCHDEV=y | |
| 174 | 156 | CONFIG_CAN=y |
| 175 | −CONFIG_CAN_RAW=y | |
| 176 | −CONFIG_CAN_BCM=y | |
| 177 | −CONFIG_CAN_DEV=y | |
| 178 | 157 | CONFIG_CAN_AT91=m |
| 179 | 158 | CONFIG_CAN_FLEXCAN=m |
| 180 | −CONFIG_CAN_RCAR=m | |
| 159 | +CONFIG_CAN_SUN4I=y | |
| 181 | 160 | CONFIG_CAN_XILINXCAN=y |
| 161 | +CONFIG_CAN_RCAR=m | |
| 182 | 162 | CONFIG_CAN_MCP251X=y |
| 183 | −CONFIG_NET_DSA_BCM_SF2=m | |
| 184 | −CONFIG_B53=m | |
| 185 | −CONFIG_B53_SPI_DRIVER=m | |
| 186 | −CONFIG_B53_MDIO_DRIVER=m | |
| 187 | −CONFIG_B53_MMAP_DRIVER=m | |
| 188 | −CONFIG_B53_SRAB_DRIVER=m | |
| 189 | −CONFIG_CAN_SUN4I=y | |
| 190 | 163 | CONFIG_BT=m |
| 191 | 164 | CONFIG_BT_HCIUART=m |
| 192 | 165 | CONFIG_BT_HCIUART_BCM=y |
| @@ -199,11 +172,9 @@ CONFIG_RFKILL_INPUT=y · 6 unmodified lines | ||
| 199 | 172 | CONFIG_RFKILL_GPIO=y |
| 200 | 173 | CONFIG_DEVTMPFS=y |
| 201 | 174 | CONFIG_DEVTMPFS_MOUNT=y |
| 202 | −CONFIG_DMA_CMA=y | |
| 203 | 175 | CONFIG_CMA_SIZE_MBYTES=64 |
| 204 | 176 | CONFIG_OMAP_OCP2SCP=y |
| 205 | 177 | CONFIG_SIMPLE_PM_BUS=y |
| 206 | −CONFIG_SUNXI_RSB=y | |
| 207 | 178 | CONFIG_MTD=y |
| 208 | 179 | CONFIG_MTD_CMDLINE_PARTS=y |
| 209 | 180 | CONFIG_MTD_BLOCK=y |
| @@ -236,7 +207,6 @@ CONFIG_PCI_ENDPOINT_TEST=m · 26 unmodified lines | ||
| 236 | 207 | CONFIG_EEPROM_AT24=y |
| 237 | 208 | CONFIG_BLK_DEV_SD=y |
| 238 | 209 | CONFIG_BLK_DEV_SR=y |
| 239 | −CONFIG_SCSI_MULTI_LUN=y | |
| 240 | 210 | CONFIG_ATA=y |
| 241 | 211 | CONFIG_SATA_AHCI=y |
| 242 | 212 | CONFIG_SATA_AHCI_PLATFORM=y |
| @@ -251,14 +221,20 @@ CONFIG_SATA_MV=y · 8 unmodified lines | ||
| 251 | 221 | CONFIG_SATA_RCAR=y |
| 252 | 222 | CONFIG_NETDEVICES=y |
| 253 | 223 | CONFIG_VIRTIO_NET=y |
| 254 | −CONFIG_HIX5HD2_GMAC=y | |
| 224 | +CONFIG_B53_SPI_DRIVER=m | |
| 225 | +CONFIG_B53_MDIO_DRIVER=m | |
| 226 | +CONFIG_B53_MMAP_DRIVER=m | |
| 227 | +CONFIG_B53_SRAB_DRIVER=m | |
| 228 | +CONFIG_NET_DSA_BCM_SF2=m | |
| 255 | 229 | CONFIG_SUN4I_EMAC=y |
| 256 | −CONFIG_MACB=y | |
| 257 | 230 | CONFIG_BCMGENET=m |
| 258 | 231 | CONFIG_BGMAC_BCMA=y |
| 259 | 232 | CONFIG_SYSTEMPORT=m |
| 233 | +CONFIG_MACB=y | |
| 260 | 234 | CONFIG_NET_CALXEDA_XGMAC=y |
| 261 | 235 | CONFIG_GIANFAR=y |
| 236 | +CONFIG_HIX5HD2_GMAC=y | |
| 237 | +CONFIG_E1000E=y | |
| 262 | 238 | CONFIG_IGB=y |
| 263 | 239 | CONFIG_MV643XX_ETH=y |
| 264 | 240 | CONFIG_MVNETA=y |
| @@ -268,19 +244,17 @@ CONFIG_R8169=y · 3 unmodified lines | ||
| 268 | 244 | CONFIG_SH_ETH=y |
| 269 | 245 | CONFIG_SMSC911X=y |
| 270 | 246 | CONFIG_STMMAC_ETH=y |
| 271 | −CONFIG_STMMAC_PLATFORM=y | |
| 272 | 247 | CONFIG_DWMAC_DWC_QOS_ETH=y |
| 273 | 248 | CONFIG_TI_CPSW=y |
| 274 | 249 | CONFIG_XILINX_EMACLITE=y |
| 275 | 250 | CONFIG_AT803X_PHY=y |
| 276 | −CONFIG_MARVELL_PHY=y | |
| 277 | −CONFIG_SMSC_PHY=y | |
| 278 | 251 | CONFIG_BROADCOM_PHY=y |
| 279 | 252 | CONFIG_ICPLUS_PHY=y |
| 280 | −CONFIG_REALTEK_PHY=y | |
| 253 | +CONFIG_MARVELL_PHY=y | |
| 281 | 254 | CONFIG_MICREL_PHY=y |
| 282 | −CONFIG_FIXED_PHY=y | |
| 255 | +CONFIG_REALTEK_PHY=y | |
| 283 | 256 | CONFIG_ROCKCHIP_PHY=y |
| 257 | +CONFIG_SMSC_PHY=y | |
| 284 | 258 | CONFIG_USB_PEGASUS=y |
| 285 | 259 | CONFIG_USB_RTL8152=m |
| 286 | 260 | CONFIG_USB_LAN78XX=m |
| @@ -288,29 +262,29 @@ CONFIG_USB_USBNET=y · 1 unmodified line | ||
| 288 | 262 | CONFIG_USB_NET_SMSC75XX=y |
| 289 | 263 | CONFIG_USB_NET_SMSC95XX=y |
| 290 | 264 | CONFIG_BRCMFMAC=m |
| 291 | −CONFIG_RT2X00=m | |
| 292 | −CONFIG_RT2800USB=m | |
| 293 | 265 | CONFIG_MWIFIEX=m |
| 294 | 266 | CONFIG_MWIFIEX_SDIO=m |
| 267 | +CONFIG_RT2X00=m | |
| 268 | +CONFIG_RT2800USB=m | |
| 295 | 269 | CONFIG_INPUT_JOYDEV=y |
| 296 | 270 | CONFIG_INPUT_EVDEV=y |
| 297 | 271 | CONFIG_KEYBOARD_QT1070=m |
| 298 | 272 | CONFIG_KEYBOARD_GPIO=y |
| 299 | 273 | CONFIG_KEYBOARD_TEGRA=y |
| 300 | −CONFIG_KEYBOARD_SPEAR=y | |
| 274 | +CONFIG_KEYBOARD_SAMSUNG=m | |
| 301 | 275 | CONFIG_KEYBOARD_ST_KEYSCAN=y |
| 276 | +CONFIG_KEYBOARD_SPEAR=y | |
| 302 | 277 | CONFIG_KEYBOARD_CROS_EC=m |
| 303 | −CONFIG_KEYBOARD_SAMSUNG=m | |
| 304 | 278 | CONFIG_MOUSE_PS2_ELANTECH=y |
| 305 | 279 | CONFIG_MOUSE_CYAPA=m |
| 306 | 280 | CONFIG_MOUSE_ELAN_I2C=y |
| 307 | 281 | CONFIG_INPUT_TOUCHSCREEN=y |
| 308 | 282 | CONFIG_TOUCHSCREEN_ATMEL_MXT=m |
| 309 | 283 | CONFIG_TOUCHSCREEN_MMS114=m |
| 284 | +CONFIG_TOUCHSCREEN_WM97XX=m | |
| 310 | 285 | CONFIG_TOUCHSCREEN_ST1232=m |
| 311 | 286 | CONFIG_TOUCHSCREEN_STMPE=y |
| 312 | 287 | CONFIG_TOUCHSCREEN_SUN4I=y |
| 313 | −CONFIG_TOUCHSCREEN_WM97XX=m | |
| 314 | 288 | CONFIG_INPUT_MISC=y |
| 315 | 289 | CONFIG_INPUT_MAX77693_HAPTIC=m |
| 316 | 290 | CONFIG_INPUT_MAX8997_HAPTIC=m |
| @@ -327,13 +301,12 @@ CONFIG_SERIAL_8250_DW=y · 10 unmodified lines | ||
| 327 | 301 | CONFIG_SERIAL_8250_EM=y |
| 328 | 302 | CONFIG_SERIAL_8250_MT6577=y |
| 329 | 303 | CONFIG_SERIAL_8250_UNIPHIER=y |
| 304 | +CONFIG_SERIAL_OF_PLATFORM=y | |
| 330 | 305 | CONFIG_SERIAL_AMBA_PL011=y |
| 331 | 306 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y |
| 332 | 307 | CONFIG_SERIAL_ATMEL=y |
| 333 | 308 | CONFIG_SERIAL_ATMEL_CONSOLE=y |
| 334 | 309 | CONFIG_SERIAL_ATMEL_TTYAT=y |
| 335 | −CONFIG_SERIAL_BCM63XX=y | |
| 336 | −CONFIG_SERIAL_BCM63XX_CONSOLE=y | |
| 337 | 310 | CONFIG_SERIAL_MESON=y |
| 338 | 311 | CONFIG_SERIAL_MESON_CONSOLE=y |
| 339 | 312 | CONFIG_SERIAL_SAMSUNG=y |
| @@ -345,15 +318,14 @@ CONFIG_SERIAL_IMX=y · 5 unmodified lines | ||
| 345 | 318 | CONFIG_SERIAL_IMX_CONSOLE=y |
| 346 | 319 | CONFIG_SERIAL_SH_SCI=y |
| 347 | 320 | CONFIG_SERIAL_SH_SCI_NR_UARTS=20 |
| 348 | −CONFIG_SERIAL_SH_SCI_CONSOLE=y | |
| 349 | −CONFIG_SERIAL_SH_SCI_DMA=y | |
| 350 | 321 | CONFIG_SERIAL_MSM=y |
| 351 | 322 | CONFIG_SERIAL_MSM_CONSOLE=y |
| 352 | 323 | CONFIG_SERIAL_VT8500=y |
| 353 | 324 | CONFIG_SERIAL_VT8500_CONSOLE=y |
| 354 | −CONFIG_SERIAL_OF_PLATFORM=y | |
| 355 | 325 | CONFIG_SERIAL_OMAP=y |
| 356 | 326 | CONFIG_SERIAL_OMAP_CONSOLE=y |
| 327 | +CONFIG_SERIAL_BCM63XX=y | |
| 328 | +CONFIG_SERIAL_BCM63XX_CONSOLE=y | |
| 357 | 329 | CONFIG_SERIAL_XILINX_PS_UART=y |
| 358 | 330 | CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y |
| 359 | 331 | CONFIG_SERIAL_FSL_LPUART=y |
| @@ -365,12 +337,10 @@ CONFIG_SERIAL_ST_ASC_CONSOLE=y · 5 unmodified lines | ||
| 365 | 337 | CONFIG_SERIAL_STM32=y |
| 366 | 338 | CONFIG_SERIAL_STM32_CONSOLE=y |
| 367 | 339 | CONFIG_SERIAL_DEV_BUS=y |
| 368 | −CONFIG_HVC_DRIVER=y | |
| 369 | 340 | CONFIG_VIRTIO_CONSOLE=y |
| 341 | +CONFIG_HW_RANDOM=y | |
| 342 | +CONFIG_HW_RANDOM_ST=y | |
| 370 | 343 | CONFIG_I2C_CHARDEV=y |
| 371 | −CONFIG_I2C_DAVINCI=y | |
| 372 | −CONFIG_I2C_MESON=y | |
| 373 | −CONFIG_I2C_MUX=y | |
| 374 | 344 | CONFIG_I2C_ARB_GPIO_CHALLENGE=m |
| 375 | 345 | CONFIG_I2C_MUX_PCA954x=y |
| 376 | 346 | CONFIG_I2C_MUX_PINCTRL=y |
| @@ -378,12 +348,13 @@ CONFIG_I2C_DEMUX_PINCTRL=y · 1 unmodified line | ||
| 378 | 348 | CONFIG_I2C_AT91=m |
| 379 | 349 | CONFIG_I2C_BCM2835=y |
| 380 | 350 | CONFIG_I2C_CADENCE=y |
| 351 | +CONFIG_I2C_DAVINCI=y | |
| 381 | 352 | CONFIG_I2C_DESIGNWARE_PLATFORM=y |
| 382 | 353 | CONFIG_I2C_DIGICOLOR=m |
| 383 | 354 | CONFIG_I2C_EMEV2=m |
| 384 | 355 | CONFIG_I2C_GPIO=m |
| 385 | −CONFIG_I2C_EXYNOS5=y | |
| 386 | 356 | CONFIG_I2C_IMX=y |
| 357 | +CONFIG_I2C_MESON=y | |
| 387 | 358 | CONFIG_I2C_MV64XXX=y |
| 388 | 359 | CONFIG_I2C_RIIC=y |
| 389 | 360 | CONFIG_I2C_RK3X=y |
| @@ -427,7 +398,6 @@ CONFIG_SPI_SPIDEV=y · 37 unmodified lines | ||
| 427 | 398 | CONFIG_SPMI=y |
| 428 | 399 | CONFIG_PINCTRL_AS3722=y |
| 429 | 400 | CONFIG_PINCTRL_PALMAS=y |
| 430 | −CONFIG_PINCTRL_BCM2835=y | |
| 431 | 401 | CONFIG_PINCTRL_APQ8064=y |
| 432 | 402 | CONFIG_PINCTRL_APQ8084=y |
| 433 | 403 | CONFIG_PINCTRL_IPQ8064=y |
| @@ -437,25 +407,33 @@ CONFIG_PINCTRL_MSM8X74=y · 3 unmodified lines | ||
| 437 | 407 | CONFIG_PINCTRL_MSM8916=y |
| 438 | 408 | CONFIG_PINCTRL_QCOM_SPMI_PMIC=y |
| 439 | 409 | CONFIG_PINCTRL_QCOM_SSBI_PMIC=y |
| 440 | −CONFIG_GPIO_GENERIC_PLATFORM=y | |
| 441 | 410 | CONFIG_GPIO_DAVINCI=y |
| 442 | 411 | CONFIG_GPIO_DWAPB=y |
| 443 | 412 | CONFIG_GPIO_EM=y |
| 444 | 413 | CONFIG_GPIO_RCAR=y |
| 414 | +CONFIG_GPIO_SYSCON=y | |
| 445 | 415 | CONFIG_GPIO_UNIPHIER=y |
| 446 | 416 | CONFIG_GPIO_XILINX=y |
| 447 | 417 | CONFIG_GPIO_ZYNQ=y |
| 448 | 418 | CONFIG_GPIO_PCA953X=y |
| 449 | 419 | CONFIG_GPIO_PCA953X_IRQ=y |
| 450 | 420 | CONFIG_GPIO_PCF857X=y |
| 451 | −CONFIG_GPIO_TWL4030=y | |
| 452 | 421 | CONFIG_GPIO_PALMAS=y |
| 453 | −CONFIG_GPIO_SYSCON=y | |
| 454 | 422 | CONFIG_GPIO_TPS6586X=y |
| 455 | 423 | CONFIG_GPIO_TPS65910=y |
| 424 | +CONFIG_GPIO_TWL4030=y | |
| 425 | +CONFIG_POWER_AVS=y | |
| 426 | +CONFIG_ROCKCHIP_IODOMAIN=y | |
| 427 | +CONFIG_POWER_RESET_AS3722=y | |
| 428 | +CONFIG_POWER_RESET_GPIO=y | |
| 429 | +CONFIG_POWER_RESET_GPIO_RESTART=y | |
| 430 | +CONFIG_POWER_RESET_ST=y | |
| 431 | +CONFIG_POWER_RESET_KEYSTONE=y | |
| 432 | +CONFIG_POWER_RESET_RMOBILE=y | |
| 456 | 433 | CONFIG_BATTERY_ACT8945A=y |
| 457 | 434 | CONFIG_BATTERY_CPCAP=m |
| 458 | 435 | CONFIG_BATTERY_SBS=y |
| 436 | +CONFIG_AXP20X_POWER=m | |
| 459 | 437 | CONFIG_BATTERY_MAX17040=m |
| 460 | 438 | CONFIG_BATTERY_MAX17042=m |
| 461 | 439 | CONFIG_CHARGER_CPCAP=m |
| @@ -464,15 +442,6 @@ CONFIG_CHARGER_MAX77693=m · 2 unmodified lines | ||
| 464 | 442 | CONFIG_CHARGER_MAX8997=m |
| 465 | 443 | CONFIG_CHARGER_MAX8998=m |
| 466 | 444 | CONFIG_CHARGER_TPS65090=y |
| 467 | −CONFIG_AXP20X_POWER=m | |
| 468 | −CONFIG_POWER_RESET_AS3722=y | |
| 469 | −CONFIG_POWER_RESET_GPIO=y | |
| 470 | −CONFIG_POWER_RESET_GPIO_RESTART=y | |
| 471 | −CONFIG_POWER_RESET_KEYSTONE=y | |
| 472 | −CONFIG_POWER_RESET_RMOBILE=y | |
| 473 | −CONFIG_POWER_RESET_ST=y | |
| 474 | −CONFIG_POWER_AVS=y | |
| 475 | −CONFIG_ROCKCHIP_IODOMAIN=y | |
| 476 | 445 | CONFIG_SENSORS_IIO_HWMON=y |
| 477 | 446 | CONFIG_SENSORS_LM90=y |
| 478 | 447 | CONFIG_SENSORS_LM95245=y |
| @@ -480,14 +449,12 @@ CONFIG_SENSORS_NTC_THERMISTOR=m · 1 unmodified line | ||
| 480 | 449 | CONFIG_SENSORS_PWM_FAN=m |
| 481 | 450 | CONFIG_SENSORS_INA2XX=m |
| 482 | 451 | CONFIG_CPU_THERMAL=y |
| 483 | −CONFIG_BCM2835_THERMAL=m | |
| 484 | −CONFIG_BRCMSTB_THERMAL=m | |
| 485 | 452 | CONFIG_IMX_THERMAL=y |
| 486 | 453 | CONFIG_ROCKCHIP_THERMAL=y |
| 487 | 454 | CONFIG_RCAR_THERMAL=y |
| 488 | 455 | CONFIG_ARMADA_THERMAL=y |
| 489 | −CONFIG_DAVINCI_WATCHDOG=m | |
| 490 | −CONFIG_EXYNOS_THERMAL=m | |
| 456 | +CONFIG_BCM2835_THERMAL=m | |
| 457 | +CONFIG_BRCMSTB_THERMAL=m | |
| 491 | 458 | CONFIG_ST_THERMAL_MEMMAP=y |
| 492 | 459 | CONFIG_WATCHDOG=y |
| 493 | 460 | CONFIG_DA9063_WATCHDOG=m |
| @@ -495,20 +462,24 @@ CONFIG_XILINX_WATCHDOG=y · 1 unmodified line | ||
| 495 | 462 | CONFIG_ARM_SP805_WATCHDOG=y |
| 496 | 463 | CONFIG_AT91SAM9X_WATCHDOG=y |
| 497 | 464 | CONFIG_SAMA5D4_WATCHDOG=y |
| 465 | +CONFIG_DW_WATCHDOG=y | |
| 466 | +CONFIG_DAVINCI_WATCHDOG=m | |
| 498 | 467 | CONFIG_ORION_WATCHDOG=y |
| 499 | 468 | CONFIG_RN5T618_WATCHDOG=y |
| 500 | −CONFIG_ST_LPC_WATCHDOG=y | |
| 501 | 469 | CONFIG_SUNXI_WATCHDOG=y |
| 502 | 470 | CONFIG_IMX2_WDT=y |
| 471 | +CONFIG_ST_LPC_WATCHDOG=y | |
| 503 | 472 | CONFIG_TEGRA_WATCHDOG=m |
| 504 | 473 | CONFIG_MESON_WATCHDOG=y |
| 505 | −CONFIG_DW_WATCHDOG=y | |
| 506 | 474 | CONFIG_DIGICOLOR_WATCHDOG=y |
| 507 | 475 | CONFIG_RENESAS_WDT=m |
| 508 | −CONFIG_BCM2835_WDT=y | |
| 509 | 476 | CONFIG_BCM47XX_WDT=y |
| 510 | −CONFIG_BCM7038_WDT=m | |
| 477 | +CONFIG_BCM2835_WDT=y | |
| 511 | 478 | CONFIG_BCM_KONA_WDT=y |
| 479 | +CONFIG_BCM7038_WDT=m | |
| 480 | +CONFIG_BCMA_HOST_SOC=y | |
| 481 | +CONFIG_BCMA_DRIVER_GMAC_CMN=y | |
| 482 | +CONFIG_BCMA_DRIVER_GPIO=y | |
| 512 | 483 | CONFIG_MFD_ACT8945A=y |
| 513 | 484 | CONFIG_MFD_AS3711=y |
| 514 | 485 | CONFIG_MFD_AS3722=y |
| @@ -516,7 +487,6 @@ CONFIG_MFD_ATMEL_FLEXCOM=y · 1 unmodified line | ||
| 516 | 487 | CONFIG_MFD_ATMEL_HLCDC=m |
| 517 | 488 | CONFIG_MFD_BCM590XX=y |
| 518 | 489 | CONFIG_MFD_AC100=y |
| 519 | −CONFIG_MFD_AXP20X=y | |
| 520 | 490 | CONFIG_MFD_AXP20X_I2C=y |
| 521 | 491 | CONFIG_MFD_AXP20X_RSB=y |
| 522 | 492 | CONFIG_MFD_CROS_EC=m |
| @@ -529,11 +499,11 @@ CONFIG_MFD_MAX77693=m · 6 unmodified lines | ||
| 529 | 499 | CONFIG_MFD_MAX8907=y |
| 530 | 500 | CONFIG_MFD_MAX8997=y |
| 531 | 501 | CONFIG_MFD_MAX8998=y |
| 532 | −CONFIG_MFD_RK808=y | |
| 533 | 502 | CONFIG_MFD_CPCAP=y |
| 534 | 503 | CONFIG_MFD_PM8XXX=y |
| 535 | 504 | CONFIG_MFD_QCOM_RPM=y |
| 536 | 505 | CONFIG_MFD_SPMI_PMIC=y |
| 506 | +CONFIG_MFD_RK808=y | |
| 537 | 507 | CONFIG_MFD_RN5T618=y |
| 538 | 508 | CONFIG_MFD_SEC_CORE=y |
| 539 | 509 | CONFIG_MFD_STMPE=y |
| @@ -543,10 +513,10 @@ CONFIG_MFD_TPS65217=y · 3 unmodified lines | ||
| 543 | 513 | CONFIG_MFD_TPS65218=y |
| 544 | 514 | CONFIG_MFD_TPS6586X=y |
| 545 | 515 | CONFIG_MFD_TPS65910=y |
| 546 | −CONFIG_REGULATOR_ACT8945A=y | |
| 547 | −CONFIG_REGULATOR_AB8500=y | |
| 548 | 516 | CONFIG_REGULATOR_ACT8865=y |
| 517 | +CONFIG_REGULATOR_ACT8945A=y | |
| 549 | 518 | CONFIG_REGULATOR_ANATOP=y |
| 519 | +CONFIG_REGULATOR_AB8500=y | |
| 550 | 520 | CONFIG_REGULATOR_AS3711=y |
| 551 | 521 | CONFIG_REGULATOR_AS3722=y |
| 552 | 522 | CONFIG_REGULATOR_AXP20X=y |
| @@ -554,10 +524,7 @@ CONFIG_REGULATOR_BCM590XX=y · 1 unmodified line | ||
| 554 | 524 | CONFIG_REGULATOR_CPCAP=y |
| 555 | 525 | CONFIG_REGULATOR_DA9210=y |
| 556 | 526 | CONFIG_REGULATOR_FAN53555=y |
| 557 | −CONFIG_REGULATOR_RK808=y | |
| 558 | 527 | CONFIG_REGULATOR_GPIO=y |
| 559 | −CONFIG_MFD_SYSCON=y | |
| 560 | −CONFIG_POWER_RESET_SYSCON=y | |
| 561 | 528 | CONFIG_REGULATOR_LP872X=y |
| 562 | 529 | CONFIG_REGULATOR_MAX14577=m |
| 563 | 530 | CONFIG_REGULATOR_MAX8907=y |
| @@ -571,7 +538,8 @@ CONFIG_REGULATOR_PALMAS=y · 7 unmodified lines | ||
| 571 | 538 | CONFIG_REGULATOR_PBIAS=y |
| 572 | 539 | CONFIG_REGULATOR_PWM=y |
| 573 | 540 | CONFIG_REGULATOR_QCOM_RPM=y |
| 574 | −CONFIG_REGULATOR_QCOM_SMD_RPM=y | |
| 541 | +CONFIG_REGULATOR_QCOM_SMD_RPM=m | |
| 542 | +CONFIG_REGULATOR_RK808=y | |
| 575 | 543 | CONFIG_REGULATOR_RN5T618=y |
| 576 | 544 | CONFIG_REGULATOR_S2MPS11=y |
| 577 | 545 | CONFIG_REGULATOR_S5M8767=y |
| @@ -592,18 +560,17 @@ CONFIG_MEDIA_CEC_SUPPORT=y · 14 unmodified lines | ||
| 592 | 560 | CONFIG_MEDIA_CONTROLLER=y |
| 593 | 561 | CONFIG_VIDEO_V4L2_SUBDEV_API=y |
| 594 | 562 | CONFIG_MEDIA_USB_SUPPORT=y |
| 595 | −CONFIG_USB_VIDEO_CLASS=y | |
| 596 | −CONFIG_USB_GSPCA=y | |
| 563 | +CONFIG_USB_VIDEO_CLASS=m | |
| 597 | 564 | CONFIG_V4L_PLATFORM_DRIVERS=y |
| 598 | 565 | CONFIG_SOC_CAMERA=m |
| 599 | 566 | CONFIG_SOC_CAMERA_PLATFORM=m |
| 600 | −CONFIG_VIDEO_RCAR_VIN=m | |
| 601 | −CONFIG_VIDEO_ATMEL_ISI=m | |
| 602 | 567 | CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS=m |
| 603 | 568 | CONFIG_VIDEO_S5P_FIMC=m |
| 604 | 569 | CONFIG_VIDEO_S5P_MIPI_CSIS=m |
| 605 | 570 | CONFIG_VIDEO_EXYNOS_FIMC_LITE=m |
| 606 | 571 | CONFIG_VIDEO_EXYNOS4_FIMC_IS=m |
| 572 | +CONFIG_VIDEO_RCAR_VIN=m | |
| 573 | +CONFIG_VIDEO_ATMEL_ISI=m | |
| 607 | 574 | CONFIG_V4L_MEM2MEM_DRIVERS=y |
| 608 | 575 | CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m |
| 609 | 576 | CONFIG_VIDEO_SAMSUNG_S5P_MFC=m |
| @@ -614,19 +581,15 @@ CONFIG_VIDEO_STI_DELTA=m · 4 unmodified lines | ||
| 614 | 581 | CONFIG_VIDEO_RENESAS_JPU=m |
| 615 | 582 | CONFIG_VIDEO_RENESAS_VSP1=m |
| 616 | 583 | CONFIG_V4L_TEST_DRIVERS=y |
| 584 | +CONFIG_VIDEO_VIVID=m | |
| 617 | 585 | CONFIG_CEC_PLATFORM_DRIVERS=y |
| 618 | 586 | CONFIG_VIDEO_SAMSUNG_S5P_CEC=m |
| 619 | 587 | # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set |
| 620 | 588 | CONFIG_VIDEO_ADV7180=m |
| 621 | 589 | CONFIG_VIDEO_ML86V7667=m |
| 622 | 590 | CONFIG_DRM=y |
| 623 | −CONFIG_DRM_I2C_ADV7511=m | |
| 624 | −CONFIG_DRM_I2C_ADV7511_AUDIO=y | |
| 625 | 591 | # CONFIG_DRM_I2C_CH7006 is not set |
| 626 | 592 | # CONFIG_DRM_I2C_SIL164 is not set |
| 627 | −CONFIG_DRM_DUMB_VGA_DAC=m | |
| 628 | −CONFIG_DRM_NXP_PTN3460=m | |
| 629 | −CONFIG_DRM_PARADE_PS8622=m | |
| 630 | 593 | CONFIG_DRM_NOUVEAU=m |
| 631 | 594 | CONFIG_DRM_EXYNOS=m |
| 632 | 595 | CONFIG_DRM_EXYNOS_FIMD=y |
| @@ -645,13 +608,18 @@ CONFIG_DRM_RCAR_LVDS=y · 12 unmodified lines | ||
| 645 | 608 | CONFIG_DRM_SUN4I=m |
| 646 | 609 | CONFIG_DRM_FSL_DCU=m |
| 647 | 610 | CONFIG_DRM_TEGRA=y |
| 611 | +CONFIG_DRM_PANEL_SIMPLE=y | |
| 648 | 612 | CONFIG_DRM_PANEL_SAMSUNG_LD9040=m |
| 649 | 613 | CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03=m |
| 650 | 614 | CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=m |
| 651 | −CONFIG_DRM_PANEL_SIMPLE=y | |
| 615 | +CONFIG_DRM_DUMB_VGA_DAC=m | |
| 616 | +CONFIG_DRM_NXP_PTN3460=m | |
| 617 | +CONFIG_DRM_PARADE_PS8622=m | |
| 652 | 618 | CONFIG_DRM_SII9234=m |
| 619 | +CONFIG_DRM_I2C_ADV7511=m | |
| 620 | +CONFIG_DRM_I2C_ADV7511_AUDIO=y | |
| 653 | 621 | CONFIG_DRM_STI=m |
| 654 | −CONFIG_DRM_VC4=y | |
| 622 | +CONFIG_DRM_VC4=m | |
| 655 | 623 | CONFIG_DRM_ETNAVIV=m |
| 656 | 624 | CONFIG_DRM_MXSFB=m |
| 657 | 625 | CONFIG_FB_ARMCLCD=y |
| @@ -659,8 +627,6 @@ CONFIG_FB_EFI=y · 1 unmodified line | ||
| 659 | 627 | CONFIG_FB_WM8505=y |
| 660 | 628 | CONFIG_FB_SH_MOBILE_LCDC=y |
| 661 | 629 | CONFIG_FB_SIMPLE=y |
| 662 | −CONFIG_BACKLIGHT_LCD_SUPPORT=y | |
| 663 | −CONFIG_BACKLIGHT_CLASS_DEVICE=y | |
| 664 | 630 | CONFIG_LCD_PLATFORM=m |
| 665 | 631 | CONFIG_BACKLIGHT_PWM=y |
| 666 | 632 | CONFIG_BACKLIGHT_AS3711=y |
| @@ -668,7 +634,6 @@ CONFIG_FRAMEBUFFER_CONSOLE=y · 1 unmodified line | ||
| 668 | 634 | CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y |
| 669 | 635 | CONFIG_SOUND=m |
| 670 | 636 | CONFIG_SND=m |
| 671 | −CONFIG_SND_DYNAMIC_MINORS=y | |
| 672 | 637 | CONFIG_SND_HDA_TEGRA=m |
| 673 | 638 | CONFIG_SND_HDA_INPUT_BEEP=y |
| 674 | 639 | CONFIG_SND_HDA_PATCH_LOADER=y |
| @@ -692,7 +657,7 @@ CONFIG_SND_SOC_SNOW=m · 17 unmodified lines | ||
| 692 | 657 | CONFIG_SND_SOC_ODROID=m |
| 693 | 658 | CONFIG_SND_SOC_SH4_FSI=m |
| 694 | 659 | CONFIG_SND_SOC_RCAR=m |
| 695 | −CONFIG_SND_SIMPLE_SCU_CARD=m | |
| 660 | +CONFIG_SND_SOC_STI=m | |
| 696 | 661 | CONFIG_SND_SUN4I_CODEC=m |
| 697 | 662 | CONFIG_SND_SOC_TEGRA=m |
| 698 | 663 | CONFIG_SND_SOC_TEGRA20_I2S=m |
| @@ -703,31 +668,25 @@ CONFIG_SND_SOC_TEGRA_WM8903=m · 4 unmodified lines | ||
| 703 | 668 | CONFIG_SND_SOC_TEGRA_WM9712=m |
| 704 | 669 | CONFIG_SND_SOC_TEGRA_TRIMSLICE=m |
| 705 | 670 | CONFIG_SND_SOC_TEGRA_ALC5632=m |
| 706 | −CONFIG_SND_SOC_CPCAP=m | |
| 707 | 671 | CONFIG_SND_SOC_TEGRA_MAX98090=m |
| 708 | 672 | CONFIG_SND_SOC_AK4642=m |
| 673 | +CONFIG_SND_SOC_CPCAP=m | |
| 709 | 674 | CONFIG_SND_SOC_SGTL5000=m |
| 710 | 675 | CONFIG_SND_SOC_SPDIF=m |
| 711 | −CONFIG_SND_SOC_WM8978=m | |
| 712 | −CONFIG_SND_SOC_STI=m | |
| 713 | 676 | CONFIG_SND_SOC_STI_SAS=m |
| 714 | −CONFIG_SND_SIMPLE_CARD=m | |
| 677 | +CONFIG_SND_SOC_WM8978=m | |
| 678 | +CONFIG_SND_SIMPLE_SCU_CARD=m | |
| 715 | 679 | CONFIG_USB=y |
| 716 | 680 | CONFIG_USB_OTG=y |
| 717 | 681 | CONFIG_USB_XHCI_HCD=y |
| 718 | 682 | CONFIG_USB_XHCI_MVEBU=y |
| 719 | −CONFIG_USB_XHCI_RCAR=m | |
| 720 | 683 | CONFIG_USB_XHCI_TEGRA=m |
| 721 | 684 | CONFIG_USB_EHCI_HCD=y |
| 722 | −CONFIG_USB_EHCI_MSM=m | |
| 723 | −CONFIG_USB_EHCI_EXYNOS=y | |
| 724 | −CONFIG_USB_EHCI_TEGRA=y | |
| 725 | 685 | CONFIG_USB_EHCI_HCD_STI=y |
| 726 | −CONFIG_USB_EHCI_HCD_PLATFORM=y | |
| 727 | −CONFIG_USB_ISP1760=y | |
| 686 | +CONFIG_USB_EHCI_TEGRA=y | |
| 687 | +CONFIG_USB_EHCI_EXYNOS=y | |
| 728 | 688 | CONFIG_USB_OHCI_HCD=y |
| 729 | 689 | CONFIG_USB_OHCI_HCD_STI=y |
| 730 | −CONFIG_USB_OHCI_HCD_PLATFORM=y | |
| 731 | 690 | CONFIG_USB_OHCI_EXYNOS=m |
| 732 | 691 | CONFIG_USB_R8A66597_HCD=m |
| 733 | 692 | CONFIG_USB_RENESAS_USBHS=m |
| @@ -746,18 +705,18 @@ CONFIG_USB_TI_CPPI41_DMA=y · 12 unmodified lines | ||
| 746 | 705 | CONFIG_USB_TUSB_OMAP_DMA=y |
| 747 | 706 | CONFIG_USB_DWC3=y |
| 748 | 707 | CONFIG_USB_DWC2=y |
| 749 | −CONFIG_USB_HSIC_USB3503=y | |
| 750 | 708 | CONFIG_USB_CHIPIDEA=y |
| 751 | 709 | CONFIG_USB_CHIPIDEA_UDC=y |
| 752 | 710 | CONFIG_USB_CHIPIDEA_HOST=y |
| 711 | +CONFIG_USB_ISP1760=y | |
| 712 | +CONFIG_USB_HSIC_USB3503=y | |
| 753 | 713 | CONFIG_AB8500_USB=y |
| 754 | −CONFIG_KEYSTONE_USB_PHY=y | |
| 714 | +CONFIG_KEYSTONE_USB_PHY=m | |
| 755 | 715 | CONFIG_NOP_USB_XCEIV=m |
| 756 | 716 | CONFIG_AM335X_PHY_USB=m |
| 757 | 717 | CONFIG_TWL6030_USB=m |
| 758 | 718 | CONFIG_USB_GPIO_VBUS=y |
| 759 | 719 | CONFIG_USB_ISP1301=y |
| 760 | −CONFIG_USB_MSM_OTG=m | |
| 761 | 720 | CONFIG_USB_MXS_PHY=y |
| 762 | 721 | CONFIG_USB_GADGET=y |
| 763 | 722 | CONFIG_USB_FSL_USB2=y |
| @@ -793,21 +752,20 @@ CONFIG_MMC_SDHCI_OF_ESDHC=y · 29 unmodified lines | ||
| 793 | 752 | CONFIG_MMC_SDHCI_ESDHC_IMX=y |
| 794 | 753 | CONFIG_MMC_SDHCI_DOVE=y |
| 795 | 754 | CONFIG_MMC_SDHCI_TEGRA=y |
| 755 | +CONFIG_MMC_SDHCI_S3C=y | |
| 796 | 756 | CONFIG_MMC_SDHCI_PXAV3=y |
| 797 | 757 | CONFIG_MMC_SDHCI_SPEAR=y |
| 798 | −CONFIG_MMC_SDHCI_S3C=y | |
| 799 | 758 | CONFIG_MMC_SDHCI_S3C_DMA=y |
| 800 | 759 | CONFIG_MMC_SDHCI_BCM_KONA=y |
| 760 | +CONFIG_MMC_MESON_MX_SDIO=y | |
| 801 | 761 | CONFIG_MMC_SDHCI_ST=y |
| 802 | 762 | CONFIG_MMC_OMAP=y |
| 803 | 763 | CONFIG_MMC_OMAP_HS=y |
| 804 | 764 | CONFIG_MMC_ATMELMCI=y |
| 805 | 765 | CONFIG_MMC_SDHCI_MSM=y |
| 806 | −CONFIG_MMC_MESON_MX_SDIO=y | |
| 807 | 766 | CONFIG_MMC_MVSDIO=y |
| 808 | 767 | CONFIG_MMC_SDHI=y |
| 809 | 768 | CONFIG_MMC_DW=y |
| 810 | −CONFIG_MMC_DW_PLTFM=y | |
| 811 | 769 | CONFIG_MMC_DW_EXYNOS=y |
| 812 | 770 | CONFIG_MMC_DW_ROCKCHIP=y |
| 813 | 771 | CONFIG_MMC_SH_MMCIF=y |
| @@ -847,94 +805,85 @@ CONFIG_RTC_DRV_MAX77686=y · 33 unmodified lines | ||
| 847 | 805 | CONFIG_RTC_DRV_RK808=m |
| 848 | 806 | CONFIG_RTC_DRV_RS5C372=m |
| 849 | 807 | CONFIG_RTC_DRV_BQ32K=m |
| 850 | −CONFIG_RTC_DRV_PALMAS=y | |
| 851 | −CONFIG_RTC_DRV_ST_LPC=y | |
| 852 | 808 | CONFIG_RTC_DRV_TWL4030=y |
| 809 | +CONFIG_RTC_DRV_PALMAS=y | |
| 853 | 810 | CONFIG_RTC_DRV_TPS6586X=y |
| 854 | 811 | CONFIG_RTC_DRV_TPS65910=y |
| 855 | 812 | CONFIG_RTC_DRV_S35390A=m |
| 856 | 813 | CONFIG_RTC_DRV_RX8581=m |
| 857 | 814 | CONFIG_RTC_DRV_EM3027=y |
| 815 | +CONFIG_RTC_DRV_S5M=m | |
| 858 | 816 | CONFIG_RTC_DRV_DA9063=m |
| 859 | 817 | CONFIG_RTC_DRV_EFI=m |
| 860 | 818 | CONFIG_RTC_DRV_DIGICOLOR=m |
| 861 | −CONFIG_RTC_DRV_S5M=m | |
| 862 | 819 | CONFIG_RTC_DRV_S3C=m |
| 863 | 820 | CONFIG_RTC_DRV_PL031=y |
| 864 | 821 | CONFIG_RTC_DRV_AT91RM9200=m |
| 865 | 822 | CONFIG_RTC_DRV_AT91SAM9=m |
| 866 | 823 | CONFIG_RTC_DRV_VT8500=y |
| 867 | −CONFIG_RTC_DRV_SUN6I=y | |
| 868 | 824 | CONFIG_RTC_DRV_SUNXI=y |
| 869 | 825 | CONFIG_RTC_DRV_MV=y |
| 870 | 826 | CONFIG_RTC_DRV_TEGRA=y |
| 827 | +CONFIG_RTC_DRV_ST_LPC=y | |
| 871 | 828 | CONFIG_RTC_DRV_CPCAP=m |
| 872 | 829 | CONFIG_DMADEVICES=y |
| 873 | −CONFIG_DW_DMAC=y | |
| 874 | 830 | CONFIG_AT_HDMAC=y |
| 875 | 831 | CONFIG_AT_XDMAC=y |
| 832 | +CONFIG_DMA_BCM2835=y | |
| 833 | +CONFIG_DMA_SUN6I=y | |
| 876 | 834 | CONFIG_FSL_EDMA=y |
| 835 | +CONFIG_IMX_DMA=y | |
| 836 | +CONFIG_IMX_SDMA=y | |
| 877 | 837 | CONFIG_MV_XOR=y |
| 838 | +CONFIG_MXS_DMA=y | |
| 839 | +CONFIG_PL330_DMA=y | |
| 840 | +CONFIG_SIRF_DMA=y | |
| 841 | +CONFIG_STE_DMA40=y | |
| 842 | +CONFIG_ST_FDMA=m | |
| 878 | 843 | CONFIG_TEGRA20_APB_DMA=y |
| 844 | +CONFIG_XILINX_DMA=y | |
| 845 | +CONFIG_QCOM_BAM_DMA=y | |
| 846 | +CONFIG_DW_DMAC=y | |
| 879 | 847 | CONFIG_SH_DMAE=y |
| 880 | 848 | CONFIG_RCAR_DMAC=y |
| 881 | 849 | CONFIG_RENESAS_USB_DMAC=m |
| 882 | −CONFIG_STE_DMA40=y | |
| 883 | −CONFIG_SIRF_DMA=y | |
| 884 | −CONFIG_TI_EDMA=y | |
| 885 | −CONFIG_PL330_DMA=y | |
| 886 | −CONFIG_IMX_SDMA=y | |
| 887 | −CONFIG_IMX_DMA=y | |
| 888 | −CONFIG_MXS_DMA=y | |
| 889 | −CONFIG_DMA_BCM2835=y | |
| 890 | −CONFIG_DMA_OMAP=y | |
| 891 | −CONFIG_QCOM_BAM_DMA=y | |
| 892 | −CONFIG_XILINX_DMA=y | |
| 893 | −CONFIG_DMA_SUN6I=y | |
| 894 | −CONFIG_ST_FDMA=m | |
| 850 | +CONFIG_VIRTIO_PCI=y | |
| 851 | +CONFIG_VIRTIO_MMIO=y | |
| 895 | 852 | CONFIG_STAGING=y |
| 896 | −CONFIG_SENSORS_ISL29018=y | |
| 897 | −CONFIG_SENSORS_ISL29028=y | |
| 898 | 853 | CONFIG_MFD_NVEC=y |
| 899 | 854 | CONFIG_KEYBOARD_NVEC=y |
| 900 | 855 | CONFIG_SERIO_NVEC_PS2=y |
| 901 | 856 | CONFIG_NVEC_POWER=y |
| 902 | 857 | CONFIG_NVEC_PAZ00=y |
| 903 | −CONFIG_BCMA=y | |
| 904 | −CONFIG_BCMA_HOST_SOC=y | |
| 905 | −CONFIG_BCMA_DRIVER_GMAC_CMN=y | |
| 906 | −CONFIG_BCMA_DRIVER_GPIO=y | |
| 907 | −CONFIG_QCOM_GSBI=y | |
| 908 | −CONFIG_QCOM_PM=y | |
| 909 | −CONFIG_QCOM_SMEM=y | |
| 910 | −CONFIG_QCOM_SMD_RPM=y | |
| 911 | −CONFIG_QCOM_SMP2P=y | |
| 912 | −CONFIG_QCOM_SMSM=y | |
| 913 | −CONFIG_QCOM_WCNSS_CTRL=m | |
| 914 | −CONFIG_ROCKCHIP_PM_DOMAINS=y | |
| 915 | −CONFIG_COMMON_CLK_QCOM=y | |
| 916 | −CONFIG_QCOM_CLK_RPM=y | |
| 917 | −CONFIG_CHROME_PLATFORMS=y | |
| 918 | 858 | CONFIG_STAGING_BOARD=y |
| 919 | −CONFIG_CROS_EC_CHARDEV=m | |
| 920 | 859 | CONFIG_COMMON_CLK_MAX77686=y |
| 921 | 860 | CONFIG_COMMON_CLK_RK808=m |
| 922 | 861 | CONFIG_COMMON_CLK_S2MPS11=m |
| 862 | +CONFIG_COMMON_CLK_QCOM=y | |
| 863 | +CONFIG_QCOM_CLK_RPM=y | |
| 923 | 864 | CONFIG_APQ_MMCC_8084=y |
| 924 | 865 | CONFIG_MSM_GCC_8660=y |
| 925 | 866 | CONFIG_MSM_MMCC_8960=y |
| 926 | 867 | CONFIG_MSM_MMCC_8974=y |
| 927 | −CONFIG_HWSPINLOCK_QCOM=y | |
| 868 | +CONFIG_BCM2835_MBOX=y | |
| 928 | 869 | CONFIG_ROCKCHIP_IOMMU=y |
| 929 | 870 | CONFIG_TEGRA_IOMMU_GART=y |
| 930 | 871 | CONFIG_TEGRA_IOMMU_SMMU=y |
| 931 | 872 | CONFIG_REMOTEPROC=m |
| 932 | 873 | CONFIG_ST_REMOTEPROC=m |
| 933 | 874 | CONFIG_RPMSG_VIRTIO=m |
| 875 | +CONFIG_RASPBERRYPI_POWER=y | |
| 876 | +CONFIG_QCOM_GSBI=y | |
| 877 | +CONFIG_QCOM_PM=y | |
| 878 | +CONFIG_QCOM_SMD_RPM=m | |
| 879 | +CONFIG_QCOM_WCNSS_CTRL=m | |
| 880 | +CONFIG_ROCKCHIP_PM_DOMAINS=y | |
| 881 | +CONFIG_ARCH_TEGRA_2x_SOC=y | |
| 882 | +CONFIG_ARCH_TEGRA_3x_SOC=y | |
| 883 | +CONFIG_ARCH_TEGRA_114_SOC=y | |
| 884 | +CONFIG_ARCH_TEGRA_124_SOC=y | |
| 934 | 885 | CONFIG_PM_DEVFREQ=y |
| 935 | 886 | CONFIG_ARM_TEGRA_DEVFREQ=m |
| 936 | −CONFIG_MEMORY=y | |
| 937 | −CONFIG_EXTCON=y | |
| 938 | 887 | CONFIG_TI_AEMIF=y |
| 939 | 888 | CONFIG_IIO=y |
| 940 | 889 | CONFIG_IIO_SW_TRIGGER=y |
| @@ -947,56 +896,54 @@ CONFIG_VF610_ADC=m · 6 unmodified lines | ||
| 947 | 896 | CONFIG_XILINX_XADC=y |
| 948 | 897 | CONFIG_MPU3050_I2C=y |
| 949 | 898 | CONFIG_CM36651=m |
| 899 | +CONFIG_SENSORS_ISL29018=y | |
| 900 | +CONFIG_SENSORS_ISL29028=y | |
| 950 | 901 | CONFIG_AK8975=y |
| 951 | −CONFIG_RASPBERRYPI_POWER=y | |
| 952 | 902 | CONFIG_IIO_HRTIMER_TRIGGER=y |
| 953 | 903 | CONFIG_PWM=y |
| 954 | 904 | CONFIG_PWM_ATMEL=m |
| 955 | 905 | CONFIG_PWM_ATMEL_HLCDC_PWM=m |
| 956 | 906 | CONFIG_PWM_ATMEL_TCB=m |
| 907 | +CONFIG_PWM_BCM2835=y | |
| 908 | +CONFIG_PWM_BRCMSTB=m | |
| 957 | 909 | CONFIG_PWM_FSL_FTM=m |
| 958 | 910 | CONFIG_PWM_MESON=m |
| 959 | 911 | CONFIG_PWM_RCAR=m |
| 960 | 912 | CONFIG_PWM_RENESAS_TPU=y |
| 961 | 913 | CONFIG_PWM_ROCKCHIP=m |
| 962 | 914 | CONFIG_PWM_SAMSUNG=m |
| 915 | +CONFIG_PWM_STI=y | |
| 963 | 916 | CONFIG_PWM_SUN4I=y |
| 964 | 917 | CONFIG_PWM_TEGRA=y |
| 965 | 918 | CONFIG_PWM_VT8500=y |
| 919 | +CONFIG_KEYSTONE_IRQ=y | |
| 920 | +CONFIG_PHY_SUN4I_USB=y | |
| 921 | +CONFIG_PHY_SUN9I_USB=y | |
| 966 | 922 | CONFIG_PHY_HIX5HD2_SATA=y |
| 967 | −CONFIG_E1000E=y | |
| 968 | −CONFIG_PWM_STI=y | |
| 969 | −CONFIG_PWM_BCM2835=y | |
| 970 | −CONFIG_PWM_BRCMSTB=m | |
| 971 | −CONFIG_PHY_DM816X_USB=m | |
| 972 | −CONFIG_OMAP_USB2=y | |
| 973 | −CONFIG_TI_PIPE3=y | |
| 974 | −CONFIG_TWL4030_USB=m | |
| 923 | +CONFIG_PHY_BERLIN_SATA=y | |
| 975 | 924 | CONFIG_PHY_BERLIN_USB=y |
| 976 | 925 | CONFIG_PHY_CPCAP_USB=m |
| 977 | −CONFIG_PHY_BERLIN_SATA=y | |
| 926 | +CONFIG_PHY_QCOM_APQ8064_SATA=m | |
| 927 | +CONFIG_PHY_RCAR_GEN2=m | |
| 978 | 928 | CONFIG_PHY_ROCKCHIP_DP=m |
| 979 | 929 | CONFIG_PHY_ROCKCHIP_USB=y |
| 980 | −CONFIG_PHY_QCOM_APQ8064_SATA=m | |
| 930 | +CONFIG_PHY_SAMSUNG_USB2=m | |
| 981 | 931 | CONFIG_PHY_MIPHY28LP=y |
| 982 | −CONFIG_PHY_RCAR_GEN2=m | |
| 983 | 932 | CONFIG_PHY_STIH407_USB=y |
| 984 | 933 | CONFIG_PHY_STM32_USBPHYC=y |
| 985 | −CONFIG_PHY_SUN4I_USB=y | |
| 986 | −CONFIG_PHY_SUN9I_USB=y | |
| 987 | −CONFIG_PHY_SAMSUNG_USB2=m | |
| 988 | 934 | CONFIG_PHY_TEGRA_XUSB=y |
| 989 | −CONFIG_PHY_BRCM_SATA=y | |
| 990 | −CONFIG_NVMEM=y | |
| 935 | +CONFIG_PHY_DM816X_USB=m | |
| 936 | +CONFIG_OMAP_USB2=y | |
| 937 | +CONFIG_TI_PIPE3=y | |
| 938 | +CONFIG_TWL4030_USB=m | |
| 991 | 939 | CONFIG_NVMEM_IMX_OCOTP=y |
| 992 | 940 | CONFIG_NVMEM_SUNXI_SID=y |
| 993 | 941 | CONFIG_NVMEM_VF610_OCOTP=y |
| 994 | −CONFIG_BCM2835_MBOX=y | |
| 995 | 942 | CONFIG_RASPBERRYPI_FIRMWARE=y |
| 996 | −CONFIG_EFI_VARS=m | |
| 997 | −CONFIG_EFI_CAPSULE_LOADER=m | |
| 998 | 943 | CONFIG_BCM47XX_NVRAM=y |
| 999 | 944 | CONFIG_BCM47XX_SPROM=y |
| 945 | +CONFIG_EFI_VARS=m | |
| 946 | +CONFIG_EFI_CAPSULE_LOADER=m | |
| 1000 | 947 | CONFIG_EXT4_FS=y |
| 1001 | 948 | CONFIG_AUTOFS4_FS=y |
| 1002 | 949 | CONFIG_MSDOS_FS=y |
| @@ -1004,7 +951,6 @@ CONFIG_VFAT_FS=y · 1 unmodified line | ||
| 1004 | 951 | CONFIG_NTFS_FS=y |
| 1005 | 952 | CONFIG_TMPFS_POSIX_ACL=y |
| 1006 | 953 | CONFIG_UBIFS_FS=y |
| 1007 | −CONFIG_TMPFS=y | |
| 1008 | 954 | CONFIG_SQUASHFS=y |
| 1009 | 955 | CONFIG_SQUASHFS_LZO=y |
| 1010 | 956 | CONFIG_SQUASHFS_XZ=y |
| @@ -1020,13 +966,7 @@ CONFIG_NLS_CODEPAGE_437=y · 9 unmodified lines | ||
| 1020 | 966 | CONFIG_NLS_ISO8859_1=y |
| 1021 | 967 | CONFIG_NLS_UTF8=y |
| 1022 | 968 | CONFIG_PRINTK_TIME=y |
| 1023 | −CONFIG_DEBUG_FS=y | |
| 1024 | 969 | CONFIG_MAGIC_SYSRQ=y |
| 1025 | −CONFIG_LOCKUP_DETECTOR=y | |
| 1026 | −CONFIG_CPUFREQ_DT=y | |
| 1027 | −CONFIG_KEYSTONE_IRQ=y | |
| 1028 | −CONFIG_HW_RANDOM=y | |
| 1029 | −CONFIG_HW_RANDOM_ST=y | |
| 1030 | 970 | CONFIG_CRYPTO_USER=m |
| 1031 | 971 | CONFIG_CRYPTO_USER_API_HASH=m |
| 1032 | 972 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| @@ -1035,27 +975,19 @@ CONFIG_CRYPTO_USER_API_AEAD=m · 2 unmodified lines | ||
| 1035 | 975 | CONFIG_CRYPTO_DEV_MARVELL_CESA=m |
| 1036 | 976 | CONFIG_CRYPTO_DEV_EXYNOS_RNG=m |
| 1037 | 977 | CONFIG_CRYPTO_DEV_S5P=m |
| 978 | +CONFIG_CRYPTO_DEV_ATMEL_AES=m | |
| 979 | +CONFIG_CRYPTO_DEV_ATMEL_TDES=m | |
| 980 | +CONFIG_CRYPTO_DEV_ATMEL_SHA=m | |
| 1038 | 981 | CONFIG_CRYPTO_DEV_SUN4I_SS=m |
| 1039 | 982 | CONFIG_CRYPTO_DEV_ROCKCHIP=m |
| 1040 | 983 | CONFIG_ARM_CRYPTO=y |
| 1041 | −CONFIG_CRYPTO_SHA1_ARM=m | |
| 1042 | 984 | CONFIG_CRYPTO_SHA1_ARM_NEON=m |
| 1043 | 985 | CONFIG_CRYPTO_SHA1_ARM_CE=m |
| 1044 | 986 | CONFIG_CRYPTO_SHA2_ARM_CE=m |
| 1045 | −CONFIG_CRYPTO_SHA256_ARM=m | |
| 1046 | 987 | CONFIG_CRYPTO_SHA512_ARM=m |
| 1047 | 988 | CONFIG_CRYPTO_AES_ARM=m |
| 1048 | 989 | CONFIG_CRYPTO_AES_ARM_BS=m |
| 1049 | 990 | CONFIG_CRYPTO_AES_ARM_CE=m |
| 1050 | −CONFIG_CRYPTO_CHACHA20_NEON=m | |
| 1051 | −CONFIG_CRYPTO_CRC32_ARM_CE=m | |
| 1052 | −CONFIG_CRYPTO_CRCT10DIF_ARM_CE=m | |
| 1053 | 991 | CONFIG_CRYPTO_GHASH_ARM_CE=m |
| 1054 | −CONFIG_CRYPTO_DEV_ATMEL_AES=m | |
| 1055 | −CONFIG_CRYPTO_DEV_ATMEL_TDES=m | |
| 1056 | −CONFIG_CRYPTO_DEV_ATMEL_SHA=m | |
| 1057 | −CONFIG_VIDEO_VIVID=m | |
| 1058 | −CONFIG_VIRTIO=y | |
| 1059 | −CONFIG_VIRTIO_PCI=y | |
| 1060 | −CONFIG_VIRTIO_PCI_LEGACY=y | |
| 1061 | −CONFIG_VIRTIO_MMIO=y | |
| 992 | +CONFIG_CRYPTO_CRC32_ARM_CE=m | |
| 993 | +CONFIG_CRYPTO_CHACHA20_NEON=m | |
| @@ -20,6 +20,7 @@ config ARCH_BCM_IPROC · 19 unmodified lines | ||
| 20 | 20 | select GPIOLIB |
| 21 | 21 | select ARM_AMBA |
| 22 | 22 | select PINCTRL |
| 23 | + select PCI_DOMAINS if PCI | |
| 23 | 24 | help |
| 24 | 25 | This enables support for systems based on Broadcom IPROC architected SoCs. |
| 25 | 26 | The IPROC complex contains one or more ARM CPUs along with common |
| @@ -774,7 +774,7 @@ static struct gpiod_lookup_table mmc_gpios_table = { · 773 unmodified lines | ||
| 774 | 774 | GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_CD_PIN, "cd", |
| 775 | 775 | GPIO_ACTIVE_LOW), |
| 776 | 776 | GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_WP_PIN, "wp", |
| 777 | − GPIO_ACTIVE_LOW), | |
| 777 | + GPIO_ACTIVE_HIGH), | |
| 778 | 778 | }, |
| 779 | 779 | }; |
| 780 | 780 | |
| @@ -10,6 +10,7 @@ menuconfig ARCH_SOCFPGA · 9 unmodified lines | ||
| 10 | 10 | select HAVE_ARM_SCU |
| 11 | 11 | select HAVE_ARM_TWD if SMP |
| 12 | 12 | select MFD_SYSCON |
| 13 | + select PCI_DOMAINS if PCI | |
| 13 | 14 | |
| 14 | 15 | if ARCH_SOCFPGA |
| 15 | 16 | config SOCFPGA_SUSPEND |
| @@ -1844,7 +1844,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) · 1843 unmodified lines | ||
| 1844 | 1844 | /* there are 2 passes here */ |
| 1845 | 1845 | bpf_jit_dump(prog->len, image_size, 2, ctx.target); |
| 1846 | 1846 | |
| 1847 | − set_memory_ro((unsigned long)header, header->pages); | |
| 1847 | + bpf_jit_binary_lock_ro(header); | |
| 1848 | 1848 | prog->bpf_func = (void *)ctx.target; |
| 1849 | 1849 | prog->jited = 1; |
| 1850 | 1850 | prog->jited_len = image_size; |
| @@ -309,8 +309,7 @@ · 308 unmodified lines | ||
| 309 | 309 | interrupts = <0 99 4>; |
| 310 | 310 | resets = <&rst SPIM0_RESET>; |
| 311 | 311 | reg-io-width = <4>; |
| 312 | − num-chipselect = <4>; | |
| 313 | − bus-num = <0>; | |
| 312 | + num-cs = <4>; | |
| 314 | 313 | status = "disabled"; |
| 315 | 314 | }; |
| 316 | 315 | |
| @@ -322,8 +321,7 @@ · 5 unmodified lines | ||
| 322 | 321 | interrupts = <0 100 4>; |
| 323 | 322 | resets = <&rst SPIM1_RESET>; |
| 324 | 323 | reg-io-width = <4>; |
| 325 | − num-chipselect = <4>; | |
| 326 | − bus-num = <0>; | |
| 324 | + num-cs = <4>; | |
| 327 | 325 | status = "disabled"; |
| 328 | 326 | }; |
| 329 | 327 | |
| @@ -66,9 +66,22 @@ · 65 unmodified lines | ||
| 66 | 66 | |
| 67 | 67 | ðmac { |
| 68 | 68 | status = "okay"; |
| 69 | − phy-mode = "rgmii"; | |
| 70 | 69 | pinctrl-0 = <ð_rgmii_y_pins>; |
| 71 | 70 | pinctrl-names = "default"; |
| 71 | + phy-handle = <ð_phy0>; | |
| 72 | + phy-mode = "rgmii"; | |
| 73 | + | |
| 74 | + mdio { | |
| 75 | + compatible = "snps,dwmac-mdio"; | |
| 76 | + #address-cells = <1>; | |
| 77 | + #size-cells = <0>; | |
| 78 | + | |
| 79 | + eth_phy0: ethernet-phy@0 { | |
| 80 | + /* Realtek RTL8211F (0x001cc916) */ | |
| 81 | + reg = <0>; | |
| 82 | + eee-broken-1000t; | |
| 83 | + }; | |
| 84 | + }; | |
| 72 | 85 | }; |
| 73 | 86 | |
| 74 | 87 | &uart_A { |
| @@ -132,7 +132,7 @@ · 131 unmodified lines | ||
| 132 | 132 | |
| 133 | 133 | sd_emmc_b: sd@5000 { |
| 134 | 134 | compatible = "amlogic,meson-axg-mmc"; |
| 135 | − reg = <0x0 0x5000 0x0 0x2000>; | |
| 135 | + reg = <0x0 0x5000 0x0 0x800>; | |
| 136 | 136 | interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>; |
| 137 | 137 | status = "disabled"; |
| 138 | 138 | clocks = <&clkc CLKID_SD_EMMC_B>, |
| @@ -144,7 +144,7 @@ · 5 unmodified lines | ||
| 144 | 144 | |
| 145 | 145 | sd_emmc_c: mmc@7000 { |
| 146 | 146 | compatible = "amlogic,meson-axg-mmc"; |
| 147 | − reg = <0x0 0x7000 0x0 0x2000>; | |
| 147 | + reg = <0x0 0x7000 0x0 0x800>; | |
| 148 | 148 | interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>; |
| 149 | 149 | status = "disabled"; |
| 150 | 150 | clocks = <&clkc CLKID_SD_EMMC_C>, |
| @@ -35,6 +35,12 @@ · 34 unmodified lines | ||
| 35 | 35 | no-map; |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | + /* Alternate 3 MiB reserved for ARM Trusted Firmware (BL31) */ | |
| 39 | + secmon_reserved_alt: secmon@5000000 { | |
| 40 | + reg = <0x0 0x05000000 0x0 0x300000>; | |
| 41 | + no-map; | |
| 42 | + }; | |
| 43 | + | |
| 38 | 44 | linux,cma { |
| 39 | 45 | compatible = "shared-dma-pool"; |
| 40 | 46 | reusable; |
| @@ -457,21 +463,21 @@ · 416 unmodified lines | ||
| 457 | 463 | |
| 458 | 464 | sd_emmc_a: mmc@70000 { |
| 459 | 465 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; |
| 460 | − reg = <0x0 0x70000 0x0 0x2000>; | |
| 466 | + reg = <0x0 0x70000 0x0 0x800>; | |
| 461 | 467 | interrupts = <GIC_SPI 216 IRQ_TYPE_EDGE_RISING>; |
| 462 | 468 | status = "disabled"; |
| 463 | 469 | }; |
| 464 | 470 | |
| 465 | 471 | sd_emmc_b: mmc@72000 { |
| 466 | 472 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; |
| 467 | − reg = <0x0 0x72000 0x0 0x2000>; | |
| 473 | + reg = <0x0 0x72000 0x0 0x800>; | |
| 468 | 474 | interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>; |
| 469 | 475 | status = "disabled"; |
| 470 | 476 | }; |
| 471 | 477 | |
| 472 | 478 | sd_emmc_c: mmc@74000 { |
| 473 | 479 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; |
| 474 | − reg = <0x0 0x74000 0x0 0x2000>; | |
| 480 | + reg = <0x0 0x74000 0x0 0x800>; | |
| 475 | 481 | interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>; |
| 476 | 482 | status = "disabled"; |
| 477 | 483 | }; |
| @@ -6,7 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | |
| 7 | 7 | &apb { |
| 8 | 8 | mali: gpu@c0000 { |
| 9 | − compatible = "amlogic,meson-gxbb-mali", "arm,mali-450"; | |
| 9 | + compatible = "amlogic,meson-gxl-mali", "arm,mali-450"; | |
| 10 | 10 | reg = <0x0 0xc0000 0x0 0x40000>; |
| 11 | 11 | interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>, |
| 12 | 12 | <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>, |
| @@ -234,9 +234,6 @@ · 233 unmodified lines | ||
| 234 | 234 | |
| 235 | 235 | bus-width = <4>; |
| 236 | 236 | cap-sd-highspeed; |
| 237 | − sd-uhs-sdr12; | |
| 238 | − sd-uhs-sdr25; | |
| 239 | − sd-uhs-sdr50; | |
| 240 | 237 | max-frequency = <100000000>; |
| 241 | 238 | disable-wp; |
| 242 | 239 | |
| @@ -189,3 +189,10 @@ · 188 unmodified lines | ||
| 189 | 189 | &usb0 { |
| 190 | 190 | status = "okay"; |
| 191 | 191 | }; |
| 192 | + | |
| 193 | +&usb2_phy0 { | |
| 194 | + /* | |
| 195 | + * HDMI_5V is also used as supply for the USB VBUS. | |
| 196 | + */ | |
| 197 | + phy-supply = <&hdmi_5v>; | |
| 198 | +}; | |
| @@ -13,14 +13,6 @@ · 12 unmodified lines | ||
| 13 | 13 | / { |
| 14 | 14 | compatible = "amlogic,meson-gxl"; |
| 15 | 15 | |
| 16 | − reserved-memory { | |
| 17 | − /* Alternate 3 MiB reserved for ARM Trusted Firmware (BL31) */ | |
| 18 | − secmon_reserved_alt: secmon@5000000 { | |
| 19 | − reg = <0x0 0x05000000 0x0 0x300000>; | |
| 20 | − no-map; | |
| 21 | − }; | |
| 22 | − }; | |
| 23 | − | |
| 24 | 16 | soc { |
| 25 | 17 | usb0: usb@c9000000 { |
| 26 | 18 | status = "disabled"; |
| @@ -118,7 +118,7 @@ · 117 unmodified lines | ||
| 118 | 118 | |
| 119 | 119 | #interrupt-cells = <1>; |
| 120 | 120 | interrupt-map-mask = <0 0 0 0>; |
| 121 | − interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 281 IRQ_TYPE_NONE>; | |
| 121 | + interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 281 IRQ_TYPE_LEVEL_HIGH>; | |
| 122 | 122 | |
| 123 | 123 | linux,pci-domain = <0>; |
| 124 | 124 | |
| @@ -149,7 +149,7 @@ · 24 unmodified lines | ||
| 149 | 149 | |
| 150 | 150 | #interrupt-cells = <1>; |
| 151 | 151 | interrupt-map-mask = <0 0 0 0>; |
| 152 | − interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 305 IRQ_TYPE_NONE>; | |
| 152 | + interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>; | |
| 153 | 153 | |
| 154 | 154 | linux,pci-domain = <4>; |
| 155 | 155 | |
| @@ -566,7 +566,7 @@ · 410 unmodified lines | ||
| 566 | 566 | reg = <0x66080000 0x100>; |
| 567 | 567 | #address-cells = <1>; |
| 568 | 568 | #size-cells = <0>; |
| 569 | − interrupts = <GIC_SPI 394 IRQ_TYPE_NONE>; | |
| 569 | + interrupts = <GIC_SPI 394 IRQ_TYPE_LEVEL_HIGH>; | |
| 570 | 570 | clock-frequency = <100000>; |
| 571 | 571 | status = "disabled"; |
| 572 | 572 | }; |
| @@ -594,7 +594,7 @@ · 21 unmodified lines | ||
| 594 | 594 | reg = <0x660b0000 0x100>; |
| 595 | 595 | #address-cells = <1>; |
| 596 | 596 | #size-cells = <0>; |
| 597 | − interrupts = <GIC_SPI 395 IRQ_TYPE_NONE>; | |
| 597 | + interrupts = <GIC_SPI 395 IRQ_TYPE_LEVEL_HIGH>; | |
| 598 | 598 | clock-frequency = <100000>; |
| 599 | 599 | status = "disabled"; |
| 600 | 600 | }; |
| @@ -43,6 +43,10 @@ · 42 unmodified lines | ||
| 43 | 43 | enet-phy-lane-swap; |
| 44 | 44 | }; |
| 45 | 45 | |
| 46 | +&sdio0 { | |
| 47 | + mmc-ddr-1_8v; | |
| 48 | +}; | |
| 49 | + | |
| 46 | 50 | &uart2 { |
| 47 | 51 | status = "okay"; |
| 48 | 52 | }; |
| @@ -42,3 +42,7 @@ · 41 unmodified lines | ||
| 42 | 42 | &gphy0 { |
| 43 | 43 | enet-phy-lane-swap; |
| 44 | 44 | }; |
| 45 | + | |
| 46 | +&sdio0 { | |
| 47 | + mmc-ddr-1_8v; | |
| 48 | +}; | |
| @@ -409,7 +409,7 @@ · 408 unmodified lines | ||
| 409 | 409 | reg = <0x000b0000 0x100>; |
| 410 | 410 | #address-cells = <1>; |
| 411 | 411 | #size-cells = <0>; |
| 412 | − interrupts = <GIC_SPI 177 IRQ_TYPE_NONE>; | |
| 412 | + interrupts = <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH>; | |
| 413 | 413 | clock-frequency = <100000>; |
| 414 | 414 | status = "disabled"; |
| 415 | 415 | }; |
| @@ -453,7 +453,7 @@ · 37 unmodified lines | ||
| 453 | 453 | reg = <0x000e0000 0x100>; |
| 454 | 454 | #address-cells = <1>; |
| 455 | 455 | #size-cells = <0>; |
| 456 | − interrupts = <GIC_SPI 178 IRQ_TYPE_NONE>; | |
| 456 | + interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>; | |
| 457 | 457 | clock-frequency = <100000>; |
| 458 | 458 | status = "disabled"; |
| 459 | 459 | }; |
| @@ -585,6 +585,8 @@ · 584 unmodified lines | ||
| 585 | 585 | vmmc-supply = <&wlan_en>; |
| 586 | 586 | ti,non-removable; |
| 587 | 587 | non-removable; |
| 588 | + cap-power-off-card; | |
| 589 | + keep-power-in-suspend; | |
| 588 | 590 | #address-cells = <0x1>; |
| 589 | 591 | #size-cells = <0x0>; |
| 590 | 592 | status = "ok"; |
| @@ -322,6 +322,8 @@ · 321 unmodified lines | ||
| 322 | 322 | dwmmc_2: dwmmc2@f723f000 { |
| 323 | 323 | bus-width = <0x4>; |
| 324 | 324 | non-removable; |
| 325 | + cap-power-off-card; | |
| 326 | + keep-power-in-suspend; | |
| 325 | 327 | vmmc-supply = <®_vdd_3v3>; |
| 326 | 328 | mmc-pwrseq = <&wl1835_pwrseq>; |
| 327 | 329 | |
| @@ -149,7 +149,7 @@ · 148 unmodified lines | ||
| 149 | 149 | |
| 150 | 150 | CP110_LABEL(icu): interrupt-controller@1e0000 { |
| 151 | 151 | compatible = "marvell,cp110-icu"; |
| 152 | − reg = <0x1e0000 0x10>; | |
| 152 | + reg = <0x1e0000 0x440>; | |
| 153 | 153 | #interrupt-cells = <3>; |
| 154 | 154 | interrupt-controller; |
| 155 | 155 | msi-parent = <&gicp>; |
| @@ -75,7 +75,7 @@ · 74 unmodified lines | ||
| 75 | 75 | |
| 76 | 76 | serial@75b1000 { |
| 77 | 77 | label = "LS-UART0"; |
| 78 | − status = "okay"; | |
| 78 | + status = "disabled"; | |
| 79 | 79 | pinctrl-names = "default", "sleep"; |
| 80 | 80 | pinctrl-0 = <&blsp2_uart2_4pins_default>; |
| 81 | 81 | pinctrl-1 = <&blsp2_uart2_4pins_sleep>; |
| @@ -1191,14 +1191,14 @@ · 1190 unmodified lines | ||
| 1191 | 1191 | |
| 1192 | 1192 | port@0 { |
| 1193 | 1193 | reg = <0>; |
| 1194 | − etf_out: endpoint { | |
| 1194 | + etf_in: endpoint { | |
| 1195 | 1195 | slave-mode; |
| 1196 | 1196 | remote-endpoint = <&funnel0_out>; |
| 1197 | 1197 | }; |
| 1198 | 1198 | }; |
| 1199 | 1199 | port@1 { |
| 1200 | 1200 | reg = <0>; |
| 1201 | − etf_in: endpoint { | |
| 1201 | + etf_out: endpoint { | |
| 1202 | 1202 | remote-endpoint = <&replicator_in>; |
| 1203 | 1203 | }; |
| 1204 | 1204 | }; |
| @@ -54,7 +54,7 @@ · 53 unmodified lines | ||
| 54 | 54 | sound { |
| 55 | 55 | compatible = "audio-graph-card"; |
| 56 | 56 | label = "UniPhier LD11"; |
| 57 | − widgets = "Headphone", "Headphone Jack"; | |
| 57 | + widgets = "Headphone", "Headphones"; | |
| 58 | 58 | dais = <&i2s_port2 |
| 59 | 59 | &i2s_port3 |
| 60 | 60 | &i2s_port4 |
| @@ -54,7 +54,7 @@ · 53 unmodified lines | ||
| 54 | 54 | sound { |
| 55 | 55 | compatible = "audio-graph-card"; |
| 56 | 56 | label = "UniPhier LD20"; |
| 57 | − widgets = "Headphone", "Headphone Jack"; | |
| 57 | + widgets = "Headphone", "Headphones"; | |
| 58 | 58 | dais = <&i2s_port2 |
| 59 | 59 | &i2s_port3 |
| 60 | 60 | &i2s_port4 |
| @@ -47,6 +47,7 @@ CONFIG_ARCH_MVEBU=y · 46 unmodified lines | ||
| 47 | 47 | CONFIG_ARCH_QCOM=y |
| 48 | 48 | CONFIG_ARCH_ROCKCHIP=y |
| 49 | 49 | CONFIG_ARCH_SEATTLE=y |
| 50 | +CONFIG_ARCH_SYNQUACER=y | |
| 50 | 51 | CONFIG_ARCH_RENESAS=y |
| 51 | 52 | CONFIG_ARCH_R8A7795=y |
| 52 | 53 | CONFIG_ARCH_R8A7796=y |
| @@ -58,7 +59,6 @@ CONFIG_ARCH_R8A77995=y · 5 unmodified lines | ||
| 58 | 59 | CONFIG_ARCH_STRATIX10=y |
| 59 | 60 | CONFIG_ARCH_TEGRA=y |
| 60 | 61 | CONFIG_ARCH_SPRD=y |
| 61 | −CONFIG_ARCH_SYNQUACER=y | |
| 62 | 62 | CONFIG_ARCH_THUNDER=y |
| 63 | 63 | CONFIG_ARCH_THUNDER2=y |
| 64 | 64 | CONFIG_ARCH_UNIPHIER=y |
| @@ -67,25 +67,23 @@ CONFIG_ARCH_XGENE=y · 2 unmodified lines | ||
| 67 | 67 | CONFIG_ARCH_ZX=y |
| 68 | 68 | CONFIG_ARCH_ZYNQMP=y |
| 69 | 69 | CONFIG_PCI=y |
| 70 | −CONFIG_HOTPLUG_PCI_PCIE=y | |
| 71 | 70 | CONFIG_PCI_IOV=y |
| 72 | 71 | CONFIG_HOTPLUG_PCI=y |
| 73 | 72 | CONFIG_HOTPLUG_PCI_ACPI=y |
| 74 | −CONFIG_PCI_LAYERSCAPE=y | |
| 75 | −CONFIG_PCI_HISI=y | |
| 76 | −CONFIG_PCIE_QCOM=y | |
| 77 | −CONFIG_PCIE_KIRIN=y | |
| 78 | −CONFIG_PCIE_ARMADA_8K=y | |
| 79 | −CONFIG_PCIE_HISI_STB=y | |
| 80 | 73 | CONFIG_PCI_AARDVARK=y |
| 81 | 74 | CONFIG_PCI_TEGRA=y |
| 82 | 75 | CONFIG_PCIE_RCAR=y |
| 83 | −CONFIG_PCIE_ROCKCHIP=y | |
| 84 | −CONFIG_PCIE_ROCKCHIP_HOST=m | |
| 85 | 76 | CONFIG_PCI_HOST_GENERIC=y |
| 86 | 77 | CONFIG_PCI_XGENE=y |
| 87 | 78 | CONFIG_PCI_HOST_THUNDER_PEM=y |
| 88 | 79 | CONFIG_PCI_HOST_THUNDER_ECAM=y |
| 80 | +CONFIG_PCIE_ROCKCHIP_HOST=m | |
| 81 | +CONFIG_PCI_LAYERSCAPE=y | |
| 82 | +CONFIG_PCI_HISI=y | |
| 83 | +CONFIG_PCIE_QCOM=y | |
| 84 | +CONFIG_PCIE_ARMADA_8K=y | |
| 85 | +CONFIG_PCIE_KIRIN=y | |
| 86 | +CONFIG_PCIE_HISI_STB=y | |
| 89 | 87 | CONFIG_ARM64_VA_BITS_48=y |
| 90 | 88 | CONFIG_SCHED_MC=y |
| 91 | 89 | CONFIG_NUMA=y |
| @@ -104,8 +102,6 @@ CONFIG_HIBERNATION=y · 12 unmodified lines | ||
| 104 | 102 | CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y |
| 105 | 103 | CONFIG_ARM_CPUIDLE=y |
| 106 | 104 | CONFIG_CPU_FREQ=y |
| 107 | −CONFIG_CPU_FREQ_GOV_ATTR_SET=y | |
| 108 | −CONFIG_CPU_FREQ_GOV_COMMON=y | |
| 109 | 105 | CONFIG_CPU_FREQ_STAT=y |
| 110 | 106 | CONFIG_CPU_FREQ_GOV_POWERSAVE=m |
| 111 | 107 | CONFIG_CPU_FREQ_GOV_USERSPACE=y |
| @@ -113,11 +109,11 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=y · 1 unmodified line | ||
| 113 | 109 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m |
| 114 | 110 | CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y |
| 115 | 111 | CONFIG_CPUFREQ_DT=y |
| 112 | +CONFIG_ACPI_CPPC_CPUFREQ=m | |
| 116 | 113 | CONFIG_ARM_ARMADA_37XX_CPUFREQ=y |
| 117 | 114 | CONFIG_ARM_BIG_LITTLE_CPUFREQ=y |
| 118 | 115 | CONFIG_ARM_SCPI_CPUFREQ=y |
| 119 | 116 | CONFIG_ARM_TEGRA186_CPUFREQ=y |
| 120 | −CONFIG_ACPI_CPPC_CPUFREQ=m | |
| 121 | 117 | CONFIG_NET=y |
| 122 | 118 | CONFIG_PACKET=y |
| 123 | 119 | CONFIG_UNIX=y |
| @@ -236,11 +232,6 @@ CONFIG_SMSC911X=y · 112 unmodified lines | ||
| 236 | 232 | CONFIG_SNI_AVE=y |
| 237 | 233 | CONFIG_SNI_NETSEC=y |
| 238 | 234 | CONFIG_STMMAC_ETH=m |
| 239 | −CONFIG_DWMAC_IPQ806X=m | |
| 240 | −CONFIG_DWMAC_MESON=m | |
| 241 | −CONFIG_DWMAC_ROCKCHIP=m | |
| 242 | −CONFIG_DWMAC_SUNXI=m | |
| 243 | −CONFIG_DWMAC_SUN8I=m | |
| 244 | 235 | CONFIG_MDIO_BUS_MUX_MMIOREG=y |
| 245 | 236 | CONFIG_AT803X_PHY=m |
| 246 | 237 | CONFIG_MARVELL_PHY=m |
| @@ -269,8 +260,8 @@ CONFIG_WL18XX=m · 22 unmodified lines | ||
| 269 | 260 | CONFIG_WLCORE_SDIO=m |
| 270 | 261 | CONFIG_INPUT_EVDEV=y |
| 271 | 262 | CONFIG_KEYBOARD_ADC=m |
| 272 | −CONFIG_KEYBOARD_CROS_EC=y | |
| 273 | 263 | CONFIG_KEYBOARD_GPIO=y |
| 264 | +CONFIG_KEYBOARD_CROS_EC=y | |
| 274 | 265 | CONFIG_INPUT_TOUCHSCREEN=y |
| 275 | 266 | CONFIG_TOUCHSCREEN_ATMEL_MXT=m |
| 276 | 267 | CONFIG_INPUT_MISC=y |
| @@ -296,17 +287,13 @@ CONFIG_SERIAL_SAMSUNG=y · 19 unmodified lines | ||
| 296 | 287 | CONFIG_SERIAL_SAMSUNG_CONSOLE=y |
| 297 | 288 | CONFIG_SERIAL_TEGRA=y |
| 298 | 289 | CONFIG_SERIAL_SH_SCI=y |
| 299 | −CONFIG_SERIAL_SH_SCI_NR_UARTS=11 | |
| 300 | −CONFIG_SERIAL_SH_SCI_CONSOLE=y | |
| 301 | 290 | CONFIG_SERIAL_MSM=y |
| 302 | 291 | CONFIG_SERIAL_MSM_CONSOLE=y |
| 303 | 292 | CONFIG_SERIAL_XILINX_PS_UART=y |
| 304 | 293 | CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y |
| 305 | 294 | CONFIG_SERIAL_MVEBU_UART=y |
| 306 | 295 | CONFIG_SERIAL_DEV_BUS=y |
| 307 | −CONFIG_SERIAL_DEV_CTRL_TTYPORT=y | |
| 308 | 296 | CONFIG_VIRTIO_CONSOLE=y |
| 309 | −CONFIG_I2C_HID=m | |
| 310 | 297 | CONFIG_I2C_CHARDEV=y |
| 311 | 298 | CONFIG_I2C_MUX=y |
| 312 | 299 | CONFIG_I2C_MUX_PCA954x=y |
| @@ -325,26 +312,26 @@ CONFIG_I2C_RCAR=y · 12 unmodified lines | ||
| 325 | 312 | CONFIG_I2C_CROS_EC_TUNNEL=y |
| 326 | 313 | CONFIG_SPI=y |
| 327 | 314 | CONFIG_SPI_ARMADA_3700=y |
| 328 | −CONFIG_SPI_MESON_SPICC=m | |
| 329 | −CONFIG_SPI_MESON_SPIFC=m | |
| 330 | 315 | CONFIG_SPI_BCM2835=m |
| 331 | 316 | CONFIG_SPI_BCM2835AUX=m |
| 317 | +CONFIG_SPI_MESON_SPICC=m | |
| 318 | +CONFIG_SPI_MESON_SPIFC=m | |
| 332 | 319 | CONFIG_SPI_ORION=y |
| 333 | 320 | CONFIG_SPI_PL022=y |
| 334 | −CONFIG_SPI_QUP=y | |
| 335 | 321 | CONFIG_SPI_ROCKCHIP=y |
| 322 | +CONFIG_SPI_QUP=y | |
| 336 | 323 | CONFIG_SPI_S3C64XX=y |
| 337 | 324 | CONFIG_SPI_SPIDEV=m |
| 338 | 325 | CONFIG_SPMI=y |
| 339 | −CONFIG_PINCTRL_IPQ8074=y | |
| 340 | 326 | CONFIG_PINCTRL_SINGLE=y |
| 341 | 327 | CONFIG_PINCTRL_MAX77620=y |
| 328 | +CONFIG_PINCTRL_IPQ8074=y | |
| 342 | 329 | CONFIG_PINCTRL_MSM8916=y |
| 343 | 330 | CONFIG_PINCTRL_MSM8994=y |
| 344 | 331 | CONFIG_PINCTRL_MSM8996=y |
| 345 | −CONFIG_PINCTRL_MT7622=y | |
| 346 | 332 | CONFIG_PINCTRL_QDF2XXX=y |
| 347 | 333 | CONFIG_PINCTRL_QCOM_SPMI_PMIC=y |
| 334 | +CONFIG_PINCTRL_MT7622=y | |
| 348 | 335 | CONFIG_GPIO_DWAPB=y |
| 349 | 336 | CONFIG_GPIO_MB86S7X=y |
| 350 | 337 | CONFIG_GPIO_PL061=y |
| @@ -368,13 +355,13 @@ CONFIG_SENSORS_INA2XX=m · 17 unmodified lines | ||
| 368 | 355 | CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y |
| 369 | 356 | CONFIG_CPU_THERMAL=y |
| 370 | 357 | CONFIG_THERMAL_EMULATION=y |
| 358 | +CONFIG_ROCKCHIP_THERMAL=m | |
| 359 | +CONFIG_RCAR_GEN3_THERMAL=y | |
| 371 | 360 | CONFIG_ARMADA_THERMAL=y |
| 372 | 361 | CONFIG_BRCMSTB_THERMAL=m |
| 373 | 362 | CONFIG_EXYNOS_THERMAL=y |
| 374 | −CONFIG_RCAR_GEN3_THERMAL=y | |
| 375 | −CONFIG_QCOM_TSENS=y | |
| 376 | −CONFIG_ROCKCHIP_THERMAL=m | |
| 377 | 363 | CONFIG_TEGRA_BPMP_THERMAL=m |
| 364 | +CONFIG_QCOM_TSENS=y | |
| 378 | 365 | CONFIG_UNIPHIER_THERMAL=y |
| 379 | 366 | CONFIG_WATCHDOG=y |
| 380 | 367 | CONFIG_S3C2410_WATCHDOG=y |
| @@ -395,9 +382,9 @@ CONFIG_MFD_MAX77620=y · 14 unmodified lines | ||
| 395 | 382 | CONFIG_MFD_SPMI_PMIC=y |
| 396 | 383 | CONFIG_MFD_RK808=y |
| 397 | 384 | CONFIG_MFD_SEC_CORE=y |
| 385 | +CONFIG_REGULATOR_FIXED_VOLTAGE=y | |
| 398 | 386 | CONFIG_REGULATOR_AXP20X=y |
| 399 | 387 | CONFIG_REGULATOR_FAN53555=y |
| 400 | −CONFIG_REGULATOR_FIXED_VOLTAGE=y | |
| 401 | 388 | CONFIG_REGULATOR_GPIO=y |
| 402 | 389 | CONFIG_REGULATOR_HI6421V530=y |
| 403 | 390 | CONFIG_REGULATOR_HI655X=y |
| @@ -407,16 +394,15 @@ CONFIG_REGULATOR_QCOM_SMD_RPM=y · 3 unmodified lines | ||
| 407 | 394 | CONFIG_REGULATOR_QCOM_SPMI=y |
| 408 | 395 | CONFIG_REGULATOR_RK808=y |
| 409 | 396 | CONFIG_REGULATOR_S2MPS11=y |
| 397 | +CONFIG_RC_CORE=m | |
| 398 | +CONFIG_RC_DECODERS=y | |
| 399 | +CONFIG_RC_DEVICES=y | |
| 400 | +CONFIG_IR_MESON=m | |
| 410 | 401 | CONFIG_MEDIA_SUPPORT=m |
| 411 | 402 | CONFIG_MEDIA_CAMERA_SUPPORT=y |
| 412 | 403 | CONFIG_MEDIA_ANALOG_TV_SUPPORT=y |
| 413 | 404 | CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y |
| 414 | 405 | CONFIG_MEDIA_CONTROLLER=y |
| 415 | −CONFIG_MEDIA_RC_SUPPORT=y | |
| 416 | −CONFIG_RC_CORE=m | |
| 417 | −CONFIG_RC_DEVICES=y | |
| 418 | −CONFIG_RC_DECODERS=y | |
| 419 | −CONFIG_IR_MESON=m | |
| 420 | 406 | CONFIG_VIDEO_V4L2_SUBDEV_API=y |
| 421 | 407 | # CONFIG_DVB_NET is not set |
| 422 | 408 | CONFIG_V4L_MEM2MEM_DRIVERS=y |
| @@ -441,8 +427,7 @@ CONFIG_ROCKCHIP_DW_HDMI=y · 18 unmodified lines | ||
| 441 | 427 | CONFIG_ROCKCHIP_DW_MIPI_DSI=y |
| 442 | 428 | CONFIG_ROCKCHIP_INNO_HDMI=y |
| 443 | 429 | CONFIG_DRM_RCAR_DU=m |
| 444 | −CONFIG_DRM_RCAR_LVDS=y | |
| 445 | −CONFIG_DRM_RCAR_VSP=y | |
| 430 | +CONFIG_DRM_RCAR_LVDS=m | |
| 446 | 431 | CONFIG_DRM_TEGRA=m |
| 447 | 432 | CONFIG_DRM_PANEL_SIMPLE=m |
| 448 | 433 | CONFIG_DRM_I2C_ADV7511=m |
| @@ -455,7 +440,6 @@ CONFIG_FB_ARMCLCD=y · 6 unmodified lines | ||
| 455 | 440 | CONFIG_BACKLIGHT_GENERIC=m |
| 456 | 441 | CONFIG_BACKLIGHT_PWM=m |
| 457 | 442 | CONFIG_BACKLIGHT_LP855X=m |
| 458 | −CONFIG_FRAMEBUFFER_CONSOLE=y | |
| 459 | 443 | CONFIG_LOGO=y |
| 460 | 444 | # CONFIG_LOGO_LINUX_MONO is not set |
| 461 | 445 | # CONFIG_LOGO_LINUX_VGA16 is not set |
| @@ -468,6 +452,7 @@ CONFIG_SND_SOC_RCAR=m · 6 unmodified lines | ||
| 468 | 452 | CONFIG_SND_SOC_AK4613=m |
| 469 | 453 | CONFIG_SND_SIMPLE_CARD=m |
| 470 | 454 | CONFIG_SND_AUDIO_GRAPH_CARD=m |
| 455 | +CONFIG_I2C_HID=m | |
| 471 | 456 | CONFIG_USB=y |
| 472 | 457 | CONFIG_USB_OTG=y |
| 473 | 458 | CONFIG_USB_XHCI_HCD=y |
| @@ -501,12 +486,12 @@ CONFIG_MMC_BLOCK_MINORS=32 · 27 unmodified lines | ||
| 501 | 486 | CONFIG_MMC_ARMMMCI=y |
| 502 | 487 | CONFIG_MMC_SDHCI=y |
| 503 | 488 | CONFIG_MMC_SDHCI_ACPI=y |
| 504 | −CONFIG_MMC_SDHCI_F_SDH30=y | |
| 505 | 489 | CONFIG_MMC_SDHCI_PLTFM=y |
| 506 | 490 | CONFIG_MMC_SDHCI_OF_ARASAN=y |
| 507 | 491 | CONFIG_MMC_SDHCI_OF_ESDHC=y |
| 508 | 492 | CONFIG_MMC_SDHCI_CADENCE=y |
| 509 | 493 | CONFIG_MMC_SDHCI_TEGRA=y |
| 494 | +CONFIG_MMC_SDHCI_F_SDH30=y | |
| 510 | 495 | CONFIG_MMC_MESON_GX=y |
| 511 | 496 | CONFIG_MMC_SDHCI_MSM=y |
| 512 | 497 | CONFIG_MMC_SPI=y |
| @@ -524,11 +509,11 @@ CONFIG_LEDS_CLASS=y · 11 unmodified lines | ||
| 524 | 509 | CONFIG_LEDS_GPIO=y |
| 525 | 510 | CONFIG_LEDS_PWM=y |
| 526 | 511 | CONFIG_LEDS_SYSCON=y |
| 512 | +CONFIG_LEDS_TRIGGER_DISK=y | |
| 527 | 513 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
| 528 | 514 | CONFIG_LEDS_TRIGGER_CPU=y |
| 529 | 515 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y |
| 530 | 516 | CONFIG_LEDS_TRIGGER_PANIC=y |
| 531 | −CONFIG_LEDS_TRIGGER_DISK=y | |
| 532 | 517 | CONFIG_EDAC=y |
| 533 | 518 | CONFIG_EDAC_GHES=y |
| 534 | 519 | CONFIG_RTC_CLASS=y |
| @@ -537,13 +522,13 @@ CONFIG_RTC_DRV_RK808=m · 2 unmodified lines | ||
| 537 | 522 | CONFIG_RTC_DRV_S5M=y |
| 538 | 523 | CONFIG_RTC_DRV_DS3232=y |
| 539 | 524 | CONFIG_RTC_DRV_EFI=y |
| 525 | +CONFIG_RTC_DRV_CROS_EC=y | |
| 540 | 526 | CONFIG_RTC_DRV_S3C=y |
| 541 | 527 | CONFIG_RTC_DRV_PL031=y |
| 542 | 528 | CONFIG_RTC_DRV_SUN6I=y |
| 543 | 529 | CONFIG_RTC_DRV_ARMADA38X=y |
| 544 | 530 | CONFIG_RTC_DRV_TEGRA=y |
| 545 | 531 | CONFIG_RTC_DRV_XGENE=y |
| 546 | −CONFIG_RTC_DRV_CROS_EC=y | |
| 547 | 532 | CONFIG_DMADEVICES=y |
| 548 | 533 | CONFIG_DMA_BCM2835=m |
| 549 | 534 | CONFIG_K3_DMA=y |
| @@ -579,7 +564,6 @@ CONFIG_HWSPINLOCK_QCOM=y · 29 unmodified lines | ||
| 579 | 564 | CONFIG_ARM_MHU=y |
| 580 | 565 | CONFIG_PLATFORM_MHU=y |
| 581 | 566 | CONFIG_BCM2835_MBOX=y |
| 582 | −CONFIG_HI6220_MBOX=y | |
| 583 | 567 | CONFIG_QCOM_APCS_IPC=y |
| 584 | 568 | CONFIG_ROCKCHIP_IOMMU=y |
| 585 | 569 | CONFIG_TEGRA_IOMMU_SMMU=y |
| @@ -602,7 +586,6 @@ CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y · 16 unmodified lines | ||
| 602 | 586 | CONFIG_EXTCON_USB_GPIO=y |
| 603 | 587 | CONFIG_EXTCON_USBC_CROS_EC=y |
| 604 | 588 | CONFIG_MEMORY=y |
| 605 | −CONFIG_TEGRA_MC=y | |
| 606 | 589 | CONFIG_IIO=y |
| 607 | 590 | CONFIG_EXYNOS_ADC=y |
| 608 | 591 | CONFIG_ROCKCHIP_SARADC=m |
| @@ -618,27 +601,27 @@ CONFIG_PWM_RCAR=m · 9 unmodified lines | ||
| 618 | 601 | CONFIG_PWM_ROCKCHIP=y |
| 619 | 602 | CONFIG_PWM_SAMSUNG=y |
| 620 | 603 | CONFIG_PWM_TEGRA=m |
| 604 | +CONFIG_PHY_XGENE=y | |
| 605 | +CONFIG_PHY_SUN4I_USB=y | |
| 606 | +CONFIG_PHY_HI6220_USB=y | |
| 621 | 607 | CONFIG_PHY_HISTB_COMBPHY=y |
| 622 | 608 | CONFIG_PHY_HISI_INNO_USB2=y |
| 623 | −CONFIG_PHY_RCAR_GEN3_USB2=y | |
| 624 | −CONFIG_PHY_RCAR_GEN3_USB3=m | |
| 625 | −CONFIG_PHY_HI6220_USB=y | |
| 626 | −CONFIG_PHY_QCOM_USB_HS=y | |
| 627 | −CONFIG_PHY_SUN4I_USB=y | |
| 628 | 609 | CONFIG_PHY_MVEBU_CP110_COMPHY=y |
| 629 | 610 | CONFIG_PHY_QCOM_QMP=m |
| 630 | −CONFIG_PHY_ROCKCHIP_INNO_USB2=y | |
| 611 | +CONFIG_PHY_QCOM_USB_HS=y | |
| 612 | +CONFIG_PHY_RCAR_GEN3_USB2=y | |
| 613 | +CONFIG_PHY_RCAR_GEN3_USB3=m | |
| 631 | 614 | CONFIG_PHY_ROCKCHIP_EMMC=y |
| 615 | +CONFIG_PHY_ROCKCHIP_INNO_USB2=y | |
| 632 | 616 | CONFIG_PHY_ROCKCHIP_PCIE=m |
| 633 | 617 | CONFIG_PHY_ROCKCHIP_TYPEC=y |
| 634 | −CONFIG_PHY_XGENE=y | |
| 635 | 618 | CONFIG_PHY_TEGRA_XUSB=y |
| 636 | 619 | CONFIG_QCOM_L2_PMU=y |
| 637 | 620 | CONFIG_QCOM_L3_PMU=y |
| 638 | −CONFIG_MESON_EFUSE=m | |
| 639 | 621 | CONFIG_QCOM_QFPROM=y |
| 640 | 622 | CONFIG_ROCKCHIP_EFUSE=y |
| 641 | 623 | CONFIG_UNIPHIER_EFUSE=y |
| 624 | +CONFIG_MESON_EFUSE=m | |
| 642 | 625 | CONFIG_TEE=y |
| 643 | 626 | CONFIG_OPTEE=y |
| 644 | 627 | CONFIG_ARM_SCPI_PROTOCOL=y |
| @@ -647,7 +630,6 @@ CONFIG_EFI_CAPSULE_LOADER=y · 2 unmodified lines | ||
| 647 | 630 | CONFIG_ACPI=y |
| 648 | 631 | CONFIG_ACPI_APEI=y |
| 649 | 632 | CONFIG_ACPI_APEI_GHES=y |
| 650 | −CONFIG_ACPI_APEI_PCIEAER=y | |
| 651 | 633 | CONFIG_ACPI_APEI_MEMORY_FAILURE=y |
| 652 | 634 | CONFIG_ACPI_APEI_EINJ=y |
| 653 | 635 | CONFIG_EXT2_FS=y |
| @@ -682,7 +664,6 @@ CONFIG_DEBUG_INFO=y · 28 unmodified lines | ||
| 682 | 664 | CONFIG_DEBUG_FS=y |
| 683 | 665 | CONFIG_MAGIC_SYSRQ=y |
| 684 | 666 | CONFIG_DEBUG_KERNEL=y |
| 685 | −CONFIG_LOCKUP_DETECTOR=y | |
| 686 | 667 | # CONFIG_SCHED_DEBUG is not set |
| 687 | 668 | # CONFIG_DEBUG_PREEMPT is not set |
| 688 | 669 | # CONFIG_FTRACE is not set |
| @@ -691,20 +672,15 @@ CONFIG_SECURITY=y · 2 unmodified lines | ||
| 691 | 672 | CONFIG_CRYPTO_ECHAINIV=y |
| 692 | 673 | CONFIG_CRYPTO_ANSI_CPRNG=y |
| 693 | 674 | CONFIG_ARM64_CRYPTO=y |
| 694 | −CONFIG_CRYPTO_SHA256_ARM64=m | |
| 695 | −CONFIG_CRYPTO_SHA512_ARM64=m | |
| 696 | 675 | CONFIG_CRYPTO_SHA1_ARM64_CE=y |
| 697 | 676 | CONFIG_CRYPTO_SHA2_ARM64_CE=y |
| 677 | +CONFIG_CRYPTO_SHA512_ARM64_CE=m | |
| 678 | +CONFIG_CRYPTO_SHA3_ARM64=m | |
| 679 | +CONFIG_CRYPTO_SM3_ARM64_CE=m | |
| 698 | 680 | CONFIG_CRYPTO_GHASH_ARM64_CE=y |
| 699 | 681 | CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=m |
| 700 | 682 | CONFIG_CRYPTO_CRC32_ARM64_CE=m |
| 701 | −CONFIG_CRYPTO_AES_ARM64=m | |
| 702 | −CONFIG_CRYPTO_AES_ARM64_CE=m | |
| 703 | 683 | CONFIG_CRYPTO_AES_ARM64_CE_CCM=y |
| 704 | 684 | CONFIG_CRYPTO_AES_ARM64_CE_BLK=y |
| 705 | −CONFIG_CRYPTO_AES_ARM64_NEON_BLK=m | |
| 706 | 685 | CONFIG_CRYPTO_CHACHA20_NEON=m |
| 707 | 686 | CONFIG_CRYPTO_AES_ARM64_BS=m |
| 708 | −CONFIG_CRYPTO_SHA512_ARM64_CE=m | |
| 709 | −CONFIG_CRYPTO_SHA3_ARM64=m | |
| 710 | −CONFIG_CRYPTO_SM3_ARM64_CE=m | |
| @@ -28,7 +28,12 @@ typedef void (*alternative_cb_t)(struct alt_instr *alt, · 27 unmodified lines | ||
| 28 | 28 | __le32 *origptr, __le32 *updptr, int nr_inst); |
| 29 | 29 | |
| 30 | 30 | void __init apply_alternatives_all(void); |
| 31 | −void apply_alternatives(void *start, size_t length); | |
| 31 | + | |
| 32 | +#ifdef CONFIG_MODULES | |
| 33 | +void apply_alternatives_module(void *start, size_t length); | |
| 34 | +#else | |
| 35 | +static inline void apply_alternatives_module(void *start, size_t length) { } | |
| 36 | +#endif | |
| 32 | 37 | |
| 33 | 38 | #define ALTINSTR_ENTRY(feature,cb) \ |
| 34 | 39 | " .word 661b - .\n" /* label */ \ |
| @@ -224,10 +224,8 @@ static inline void set_pte(pte_t *ptep, pte_t pte) · 223 unmodified lines | ||
| 224 | 224 | * Only if the new pte is valid and kernel, otherwise TLB maintenance |
| 225 | 225 | * or update_mmu_cache() have the necessary barriers. |
| 226 | 226 | */ |
| 227 | − if (pte_valid_not_user(pte)) { | |
| 227 | + if (pte_valid_not_user(pte)) | |
| 228 | 228 | dsb(ishst); |
| 229 | − isb(); | |
| 230 | − } | |
| 231 | 229 | } |
| 232 | 230 | |
| 233 | 231 | extern void __sync_icache_dcache(pte_t pteval); |
| @@ -434,7 +432,6 @@ static inline void set_pmd(pmd_t *pmdp, pmd_t pmd) · 200 unmodified lines | ||
| 434 | 432 | { |
| 435 | 433 | WRITE_ONCE(*pmdp, pmd); |
| 436 | 434 | dsb(ishst); |
| 437 | − isb(); | |
| 438 | 435 | } |
| 439 | 436 | |
| 440 | 437 | static inline void pmd_clear(pmd_t *pmdp) |
| @@ -485,7 +482,6 @@ static inline void set_pud(pud_t *pudp, pud_t pud) · 44 unmodified lines | ||
| 485 | 482 | { |
| 486 | 483 | WRITE_ONCE(*pudp, pud); |
| 487 | 484 | dsb(ishst); |
| 488 | − isb(); | |
| 489 | 485 | } |
| 490 | 486 | |
| 491 | 487 | static inline void pud_clear(pud_t *pudp) |
| @@ -122,7 +122,30 @@ static void patch_alternative(struct alt_instr *alt, · 121 unmodified lines | ||
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | −static void __apply_alternatives(void *alt_region, bool use_linear_alias) | |
| 125 | +/* | |
| 126 | + * We provide our own, private D-cache cleaning function so that we don't | |
| 127 | + * accidentally call into the cache.S code, which is patched by us at | |
| 128 | + * runtime. | |
| 129 | + */ | |
| 130 | +static void clean_dcache_range_nopatch(u64 start, u64 end) | |
| 131 | +{ | |
| 132 | + u64 cur, d_size, ctr_el0; | |
| 133 | + | |
| 134 | + ctr_el0 = read_sanitised_ftr_reg(SYS_CTR_EL0); | |
| 135 | + d_size = 4 << cpuid_feature_extract_unsigned_field(ctr_el0, | |
| 136 | + CTR_DMINLINE_SHIFT); | |
| 137 | + cur = start & ~(d_size - 1); | |
| 138 | + do { | |
| 139 | + /* | |
| 140 | + * We must clean+invalidate to the PoC in order to avoid | |
| 141 | + * Cortex-A53 errata 826319, 827319, 824069 and 819472 | |
| 142 | + * (this corresponds to ARM64_WORKAROUND_CLEAN_CACHE) | |
| 143 | + */ | |
| 144 | + asm volatile("dc civac, %0" : : "r" (cur) : "memory"); | |
| 145 | + } while (cur += d_size, cur < end); | |
| 146 | +} | |
| 147 | + | |
| 148 | +static void __apply_alternatives(void *alt_region, bool is_module) | |
| 126 | 149 | { |
| 127 | 150 | struct alt_instr *alt; |
| 128 | 151 | struct alt_region *region = alt_region; |
| @@ -145,7 +168,7 @@ static void __apply_alternatives(void *alt_region, bool use_linear_alias) · 16 unmodified lines | ||
| 145 | 168 | pr_info_once("patching kernel code\n"); |
| 146 | 169 | |
| 147 | 170 | origptr = ALT_ORIG_PTR(alt); |
| 148 | − updptr = use_linear_alias ? lm_alias(origptr) : origptr; | |
| 171 | + updptr = is_module ? origptr : lm_alias(origptr); | |
| 149 | 172 | nr_inst = alt->orig_len / AARCH64_INSN_SIZE; |
| 150 | 173 | |
| 151 | 174 | if (alt->cpufeature < ARM64_CB_PATCH) |
| @@ -155,8 +178,20 @@ static void __apply_alternatives(void *alt_region, bool use_linear_alias) · 3 unmodified lines | ||
| 155 | 178 | |
| 156 | 179 | alt_cb(alt, origptr, updptr, nr_inst); |
| 157 | 180 | |
| 158 | − flush_icache_range((uintptr_t)origptr, | |
| 159 | − (uintptr_t)(origptr + nr_inst)); | |
| 181 | + if (!is_module) { | |
| 182 | + clean_dcache_range_nopatch((u64)origptr, | |
| 183 | + (u64)(origptr + nr_inst)); | |
| 184 | + } | |
| 185 | + } | |
| 186 | + | |
| 187 | + /* | |
| 188 | + * The core module code takes care of cache maintenance in | |
| 189 | + * flush_module_icache(). | |
| 190 | + */ | |
| 191 | + if (!is_module) { | |
| 192 | + dsb(ish); | |
| 193 | + __flush_icache_all(); | |
| 194 | + isb(); | |
| 160 | 195 | } |
| 161 | 196 | } |
| 162 | 197 | |
| @@ -178,7 +213,7 @@ static int __apply_alternatives_multi_stop(void *unused) · 15 unmodified lines | ||
| 178 | 213 | isb(); |
| 179 | 214 | } else { |
| 180 | 215 | BUG_ON(alternatives_applied); |
| 181 | − __apply_alternatives(®ion, true); | |
| 216 | + __apply_alternatives(®ion, false); | |
| 182 | 217 | /* Barriers provided by the cache flushing */ |
| 183 | 218 | WRITE_ONCE(alternatives_applied, 1); |
| 184 | 219 | } |
| @@ -192,12 +227,14 @@ void __init apply_alternatives_all(void) · 7 unmodified lines | ||
| 192 | 227 | stop_machine(__apply_alternatives_multi_stop, NULL, cpu_online_mask); |
| 193 | 228 | } |
| 194 | 229 | |
| 195 | −void apply_alternatives(void *start, size_t length) | |
| 230 | +#ifdef CONFIG_MODULES | |
| 231 | +void apply_alternatives_module(void *start, size_t length) | |
| 196 | 232 | { |
| 197 | 233 | struct alt_region region = { |
| 198 | 234 | .begin = start, |
| 199 | 235 | .end = start + length, |
| 200 | 236 | }; |
| 201 | 237 | |
| 202 | − __apply_alternatives(®ion, false); | |
| 238 | + __apply_alternatives(®ion, true); | |
| 203 | 239 | } |
| 240 | +#endif | |
| @@ -448,9 +448,8 @@ int module_finalize(const Elf_Ehdr *hdr, · 447 unmodified lines | ||
| 448 | 448 | const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; |
| 449 | 449 | |
| 450 | 450 | for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) { |
| 451 | − if (strcmp(".altinstructions", secstrs + s->sh_name) == 0) { | |
| 452 | − apply_alternatives((void *)s->sh_addr, s->sh_size); | |
| 453 | − } | |
| 451 | + if (strcmp(".altinstructions", secstrs + s->sh_name) == 0) | |
| 452 | + apply_alternatives_module((void *)s->sh_addr, s->sh_size); | |
| 454 | 453 | #ifdef CONFIG_ARM64_MODULE_PLTS |
| 455 | 454 | if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE) && |
| 456 | 455 | !strcmp(".text.ftrace_trampoline", secstrs + s->sh_name)) |
| @@ -8,11 +8,4 @@ config TRACE_IRQFLAGS_SUPPORT · 7 unmodified lines | ||
| 8 | 8 | |
| 9 | 9 | source "lib/Kconfig.debug" |
| 10 | 10 | |
| 11 | −config HEART_BEAT | |
| 12 | − bool "Heart beat function for kernel" | |
| 13 | − default n | |
| 14 | − help | |
| 15 | − This option turns on/off heart beat kernel functionality. | |
| 16 | − First GPIO node is taken. | |
| 17 | − | |
| 18 | 11 | endmenu |
| @@ -19,15 +19,10 @@ extern char cmd_line[COMMAND_LINE_SIZE]; · 18 unmodified lines | ||
| 19 | 19 | |
| 20 | 20 | extern char *klimit; |
| 21 | 21 | |
| 22 | −void microblaze_heartbeat(void); | |
| 23 | −void microblaze_setup_heartbeat(void); | |
| 24 | − | |
| 25 | 22 | # ifdef CONFIG_MMU |
| 26 | 23 | extern void mmu_reset(void); |
| 27 | 24 | # endif /* CONFIG_MMU */ |
| 28 | 25 | |
| 29 | −extern void of_platform_reset_gpio_probe(void); | |
| 30 | − | |
| 31 | 26 | void time_init(void); |
| 32 | 27 | void init_IRQ(void); |
| 33 | 28 | void machine_early_init(const char *cmdline, unsigned int ram, |
| @@ -38,6 +38,6 @@ · 37 unmodified lines | ||
| 38 | 38 | |
| 39 | 39 | #endif /* __ASSEMBLY__ */ |
| 40 | 40 | |
| 41 | −#define __NR_syscalls 399 | |
| 41 | +#define __NR_syscalls 401 | |
| 42 | 42 | |
| 43 | 43 | #endif /* _ASM_MICROBLAZE_UNISTD_H */ |
| @@ -415,5 +415,7 @@ · 414 unmodified lines | ||
| 415 | 415 | #define __NR_pkey_alloc 396 |
| 416 | 416 | #define __NR_pkey_free 397 |
| 417 | 417 | #define __NR_statx 398 |
| 418 | +#define __NR_io_pgetevents 399 | |
| 419 | +#define __NR_rseq 400 | |
| 418 | 420 | |
| 419 | 421 | #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ |
| @@ -8,7 +8,6 @@ ifdef CONFIG_FUNCTION_TRACER · 7 unmodified lines | ||
| 8 | 8 | CFLAGS_REMOVE_timer.o = -pg |
| 9 | 9 | CFLAGS_REMOVE_intc.o = -pg |
| 10 | 10 | CFLAGS_REMOVE_early_printk.o = -pg |
| 11 | −CFLAGS_REMOVE_heartbeat.o = -pg | |
| 12 | 11 | CFLAGS_REMOVE_ftrace.o = -pg |
| 13 | 12 | CFLAGS_REMOVE_process.o = -pg |
| 14 | 13 | endif |
| @@ -17,12 +16,11 @@ extra-y := head.o vmlinux.lds · 2 unmodified lines | ||
| 17 | 16 | |
| 18 | 17 | obj-y += dma.o exceptions.o \ |
| 19 | 18 | hw_exception_handler.o irq.o \ |
| 20 | − platform.o process.o prom.o ptrace.o \ | |
| 19 | + process.o prom.o ptrace.o \ | |
| 21 | 20 | reset.o setup.o signal.o sys_microblaze.o timer.o traps.o unwind.o |
| 22 | 21 | |
| 23 | 22 | obj-y += cpu/ |
| 24 | 23 | |
| 25 | −obj-$(CONFIG_HEART_BEAT) += heartbeat.o | |
| 26 | 24 | obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o |
| 27 | 25 | obj-$(CONFIG_MMU) += misc.o |
| 28 | 26 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
| @@ -1,72 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu> | |
| 3 | − * Copyright (C) 2007-2009 PetaLogix | |
| 4 | − * Copyright (C) 2006 Atmark Techno, Inc. | |
| 5 | − * | |
| 6 | − * This file is subject to the terms and conditions of the GNU General Public | |
| 7 | − * License. See the file "COPYING" in the main directory of this archive | |
| 8 | − * for more details. | |
| 9 | − */ | |
| 10 | − | |
| 11 | −#include <linux/sched.h> | |
| 12 | −#include <linux/sched/loadavg.h> | |
| 13 | −#include <linux/io.h> | |
| 14 | − | |
| 15 | −#include <asm/setup.h> | |
| 16 | −#include <asm/page.h> | |
| 17 | −#include <asm/prom.h> | |
| 18 | − | |
| 19 | −static unsigned int base_addr; | |
| 20 | − | |
| 21 | −void microblaze_heartbeat(void) | |
| 22 | −{ | |
| 23 | − static unsigned int cnt, period, dist; | |
| 24 | − | |
| 25 | − if (base_addr) { | |
| 26 | − if (cnt == 0 || cnt == dist) | |
| 27 | − out_be32(base_addr, 1); | |
| 28 | − else if (cnt == 7 || cnt == dist + 7) | |
| 29 | − out_be32(base_addr, 0); | |
| 30 | − | |
| 31 | − if (++cnt > period) { | |
| 32 | − cnt = 0; | |
| 33 | − /* | |
| 34 | − * The hyperbolic function below modifies the heartbeat | |
| 35 | − * period length in dependency of the current (5min) | |
| 36 | − * load. It goes through the points f(0)=126, f(1)=86, | |
| 37 | − * f(5)=51, f(inf)->30. | |
| 38 | − */ | |
| 39 | − period = ((672 << FSHIFT) / (5 * avenrun[0] + | |
| 40 | − (7 << FSHIFT))) + 30; | |
| 41 | − dist = period / 4; | |
| 42 | − } | |
| 43 | − } | |
| 44 | −} | |
| 45 | − | |
| 46 | −void microblaze_setup_heartbeat(void) | |
| 47 | −{ | |
| 48 | − struct device_node *gpio = NULL; | |
| 49 | − int *prop; | |
| 50 | − int j; | |
| 51 | − const char * const gpio_list[] = { | |
| 52 | − "xlnx,xps-gpio-1.00.a", | |
| 53 | − NULL | |
| 54 | − }; | |
| 55 | − | |
| 56 | − for (j = 0; gpio_list[j] != NULL; j++) { | |
| 57 | − gpio = of_find_compatible_node(NULL, NULL, gpio_list[j]); | |
| 58 | − if (gpio) | |
| 59 | − break; | |
| 60 | − } | |
| 61 | − | |
| 62 | − if (gpio) { | |
| 63 | − base_addr = be32_to_cpup(of_get_property(gpio, "reg", NULL)); | |
| 64 | − base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE); | |
| 65 | − pr_notice("Heartbeat GPIO at 0x%x\n", base_addr); | |
| 66 | − | |
| 67 | − /* GPIO is configured as output */ | |
| 68 | − prop = (int *) of_get_property(gpio, "xlnx,is-bidir", NULL); | |
| 69 | − if (prop) | |
| 70 | − out_be32(base_addr + 4, 0); | |
| 71 | − } | |
| 72 | −} | |
| @@ -1,29 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − * Copyright 2008 Michal Simek <monstr@monstr.eu> | |
| 3 | − * | |
| 4 | − * based on virtex.c file | |
| 5 | − * | |
| 6 | − * Copyright 2007 Secret Lab Technologies Ltd. | |
| 7 | − * | |
| 8 | − * This file is licensed under the terms of the GNU General Public License | |
| 9 | − * version 2. This program is licensed "as is" without any warranty of any | |
| 10 | − * kind, whether express or implied. | |
| 11 | − */ | |
| 12 | − | |
| 13 | −#include <linux/init.h> | |
| 14 | −#include <linux/of_platform.h> | |
| 15 | −#include <asm/setup.h> | |
| 16 | − | |
| 17 | −static struct of_device_id xilinx_of_bus_ids[] __initdata = { | |
| 18 | − { .compatible = "simple-bus", }, | |
| 19 | − { .compatible = "xlnx,compound", }, | |
| 20 | − {} | |
| 21 | −}; | |
| 22 | − | |
| 23 | −static int __init microblaze_device_probe(void) | |
| 24 | −{ | |
| 25 | − of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL); | |
| 26 | − of_platform_reset_gpio_probe(); | |
| 27 | − return 0; | |
| 28 | −} | |
| 29 | −device_initcall(microblaze_device_probe); | |
| @@ -18,7 +18,7 @@ · 17 unmodified lines | ||
| 18 | 18 | static int handle; /* reset pin handle */ |
| 19 | 19 | static unsigned int reset_val; |
| 20 | 20 | |
| 21 | −void of_platform_reset_gpio_probe(void) | |
| 21 | +static int of_platform_reset_gpio_probe(void) | |
| 22 | 22 | { |
| 23 | 23 | int ret; |
| 24 | 24 | handle = of_get_named_gpio(of_find_node_by_path("/"), |
| @@ -27,13 +27,13 @@ void of_platform_reset_gpio_probe(void) · 2 unmodified lines | ||
| 27 | 27 | if (!gpio_is_valid(handle)) { |
| 28 | 28 | pr_info("Skipping unavailable RESET gpio %d (%s)\n", |
| 29 | 29 | handle, "reset"); |
| 30 | − return; | |
| 30 | + return -ENODEV; | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | ret = gpio_request(handle, "reset"); |
| 34 | 34 | if (ret < 0) { |
| 35 | 35 | pr_info("GPIO pin is already allocated\n"); |
| 36 | − return; | |
| 36 | + return ret; | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /* get current setup value */ |
| @@ -51,11 +51,12 @@ void of_platform_reset_gpio_probe(void) · 11 unmodified lines | ||
| 51 | 51 | |
| 52 | 52 | pr_info("RESET: Registered gpio device: %d, current val: %d\n", |
| 53 | 53 | handle, reset_val); |
| 54 | − return; | |
| 54 | + return 0; | |
| 55 | 55 | err: |
| 56 | 56 | gpio_free(handle); |
| 57 | − return; | |
| 57 | + return ret; | |
| 58 | 58 | } |
| 59 | +device_initcall(of_platform_reset_gpio_probe); | |
| 59 | 60 | |
| 60 | 61 | |
| 61 | 62 | static void gpio_system_reset(void) |
| @@ -400,3 +400,5 @@ ENTRY(sys_call_table) · 399 unmodified lines | ||
| 400 | 400 | .long sys_pkey_alloc |
| 401 | 401 | .long sys_pkey_free |
| 402 | 402 | .long sys_statx |
| 403 | + .long sys_io_pgetevents | |
| 404 | + .long sys_rseq | |
| @@ -156,9 +156,6 @@ static inline void timer_ack(void) · 155 unmodified lines | ||
| 156 | 156 | static irqreturn_t timer_interrupt(int irq, void *dev_id) |
| 157 | 157 | { |
| 158 | 158 | struct clock_event_device *evt = &clockevent_xilinx_timer; |
| 159 | −#ifdef CONFIG_HEART_BEAT | |
| 160 | − microblaze_heartbeat(); | |
| 161 | −#endif | |
| 162 | 159 | timer_ack(); |
| 163 | 160 | evt->event_handler(evt); |
| 164 | 161 | return IRQ_HANDLED; |
| @@ -318,10 +315,6 @@ static int __init xilinx_timer_init(struct device_node *timer) · 153 unmodified lines | ||
| 318 | 315 | return ret; |
| 319 | 316 | } |
| 320 | 317 | |
| 321 | −#ifdef CONFIG_HEART_BEAT | |
| 322 | − microblaze_setup_heartbeat(); | |
| 323 | −#endif | |
| 324 | − | |
| 325 | 318 | ret = xilinx_clocksource_init(); |
| 326 | 319 | if (ret) |
| 327 | 320 | return ret; |
| @@ -801,7 +801,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) · 800 unmodified lines | ||
| 801 | 801 | regs->regs[0] = 0; /* Don't deal with this again. */ |
| 802 | 802 | } |
| 803 | 803 | |
| 804 | − rseq_signal_deliver(regs); | |
| 804 | + rseq_signal_deliver(ksig, regs); | |
| 805 | 805 | |
| 806 | 806 | if (sig_uses_siginfo(&ksig->ka, abi)) |
| 807 | 807 | ret = abi->setup_rt_frame(vdso + abi->vdso->off_rt_sigreturn, |
| @@ -870,7 +870,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused, · 62 unmodified lines | ||
| 870 | 870 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { |
| 871 | 871 | clear_thread_flag(TIF_NOTIFY_RESUME); |
| 872 | 872 | tracehook_notify_resume(regs); |
| 873 | − rseq_handle_notify_resume(regs); | |
| 873 | + rseq_handle_notify_resume(NULL, regs); | |
| 874 | 874 | } |
| 875 | 875 | |
| 876 | 876 | user_enter(); |
| @@ -98,8 +98,12 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte) · 97 unmodified lines | ||
| 98 | 98 | __free_page(pte); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | +#define __pte_free_tlb(tlb, pte, addr) \ | |
| 102 | +do { \ | |
| 103 | + pgtable_page_dtor(pte); \ | |
| 104 | + tlb_remove_page((tlb), (pte)); \ | |
| 105 | +} while (0) | |
| 101 | 106 | |
| 102 | −#define __pte_free_tlb(tlb, pte, addr) tlb_remove_page((tlb), (pte)) | |
| 103 | 107 | #define pmd_pgtable(pmd) pmd_page(pmd) |
| 104 | 108 | |
| 105 | 109 | #define check_pgt_cache() do { } while (0) |
| @@ -277,12 +277,6 @@ EXCEPTION_ENTRY(_data_page_fault_handler) · 276 unmodified lines | ||
| 277 | 277 | l.addi r3,r1,0 // pt_regs |
| 278 | 278 | /* r4 set be EXCEPTION_HANDLE */ // effective address of fault |
| 279 | 279 | |
| 280 | − /* | |
| 281 | − * __PHX__: TODO | |
| 282 | − * | |
| 283 | − * all this can be written much simpler. look at | |
| 284 | − * DTLB miss handler in the CONFIG_GUARD_PROTECTED_CORE part | |
| 285 | − */ | |
| 286 | 280 | #ifdef CONFIG_OPENRISC_NO_SPR_SR_DSX |
| 287 | 281 | l.lwz r6,PT_PC(r3) // address of an offending insn |
| 288 | 282 | l.lwz r6,0(r6) // instruction that caused pf |
| @@ -314,7 +308,7 @@ EXCEPTION_ENTRY(_data_page_fault_handler) · 25 unmodified lines | ||
| 314 | 308 | |
| 315 | 309 | #else |
| 316 | 310 | |
| 317 | − l.lwz r6,PT_SR(r3) // SR | |
| 311 | + l.mfspr r6,r0,SPR_SR // SR | |
| 318 | 312 | l.andi r6,r6,SPR_SR_DSX // check for delay slot exception |
| 319 | 313 | l.sfne r6,r0 // exception happened in delay slot |
| 320 | 314 | l.bnf 7f |
| @@ -210,8 +210,7 @@ · 209 unmodified lines | ||
| 210 | 210 | * r4 - EEAR exception EA |
| 211 | 211 | * r10 - current pointing to current_thread_info struct |
| 212 | 212 | * r12 - syscall 0, since we didn't come from syscall |
| 213 | − * r13 - temp it actually contains new SR, not needed anymore | |
| 214 | − * r31 - handler address of the handler we'll jump to | |
| 213 | + * r30 - handler address of the handler we'll jump to | |
| 215 | 214 | * |
| 216 | 215 | * handler has to save remaining registers to the exception |
| 217 | 216 | * ksp frame *before* tainting them! |
| @@ -244,6 +243,7 @@ · 26 unmodified lines | ||
| 244 | 243 | /* r1 is KSP, r30 is __pa(KSP) */ ;\ |
| 245 | 244 | tophys (r30,r1) ;\ |
| 246 | 245 | l.sw PT_GPR12(r30),r12 ;\ |
| 246 | + /* r4 use for tmp before EA */ ;\ | |
| 247 | 247 | l.mfspr r12,r0,SPR_EPCR_BASE ;\ |
| 248 | 248 | l.sw PT_PC(r30),r12 ;\ |
| 249 | 249 | l.mfspr r12,r0,SPR_ESR_BASE ;\ |
| @@ -263,7 +263,10 @@ · 13 unmodified lines | ||
| 263 | 263 | /* r12 == 1 if we come from syscall */ ;\ |
| 264 | 264 | CLEAR_GPR(r12) ;\ |
| 265 | 265 | /* ----- turn on MMU ----- */ ;\ |
| 266 | − l.ori r30,r0,(EXCEPTION_SR) ;\ | |
| 266 | + /* Carry DSX into exception SR */ ;\ | |
| 267 | + l.mfspr r30,r0,SPR_SR ;\ | |
| 268 | + l.andi r30,r30,SPR_SR_DSX ;\ | |
| 269 | + l.ori r30,r30,(EXCEPTION_SR) ;\ | |
| 267 | 270 | l.mtspr r0,r30,SPR_ESR_BASE ;\ |
| 268 | 271 | /* r30: EA address of handler */ ;\ |
| 269 | 272 | LOAD_SYMBOL_2_GPR(r30,handler) ;\ |
| @@ -300,7 +300,7 @@ static inline int in_delay_slot(struct pt_regs *regs) · 299 unmodified lines | ||
| 300 | 300 | return 0; |
| 301 | 301 | } |
| 302 | 302 | #else |
| 303 | − return regs->sr & SPR_SR_DSX; | |
| 303 | + return mfspr(SPR_SR) & SPR_SR_DSX; | |
| 304 | 304 | #endif |
| 305 | 305 | } |
| 306 | 306 | |
| @@ -244,11 +244,11 @@ config PARISC_PAGE_SIZE_4KB · 243 unmodified lines | ||
| 244 | 244 | |
| 245 | 245 | config PARISC_PAGE_SIZE_16KB |
| 246 | 246 | bool "16KB" |
| 247 | − depends on PA8X00 | |
| 247 | + depends on PA8X00 && BROKEN | |
| 248 | 248 | |
| 249 | 249 | config PARISC_PAGE_SIZE_64KB |
| 250 | 250 | bool "64KB" |
| 251 | − depends on PA8X00 | |
| 251 | + depends on PA8X00 && BROKEN | |
| 252 | 252 | |
| 253 | 253 | endchoice |
| 254 | 254 | |
| @@ -347,7 +347,7 @@ config NR_CPUS · 92 unmodified lines | ||
| 347 | 347 | int "Maximum number of CPUs (2-32)" |
| 348 | 348 | range 2 32 |
| 349 | 349 | depends on SMP |
| 350 | − default "32" | |
| 350 | + default "4" | |
| 351 | 351 | |
| 352 | 352 | endmenu |
| 353 | 353 | |
| @@ -65,10 +65,6 @@ endif · 64 unmodified lines | ||
| 65 | 65 | # kernel. |
| 66 | 66 | cflags-y += -mdisable-fpregs |
| 67 | 67 | |
| 68 | −# Without this, "ld -r" results in .text sections that are too big | |
| 69 | −# (> 0x40000) for branches to reach stubs. | |
| 70 | −cflags-y += -ffunction-sections | |
| 71 | − | |
| 72 | 68 | # Use long jumps instead of long branches (needed if your linker fails to |
| 73 | 69 | # link a too big vmlinux executable). Not enabled for building modules. |
| 74 | 70 | ifdef CONFIG_MLONGCALLS |
| @@ -21,14 +21,6 @@ typedef struct { · 20 unmodified lines | ||
| 21 | 21 | unsigned long sig[_NSIG_WORDS]; |
| 22 | 22 | } sigset_t; |
| 23 | 23 | |
| 24 | −#ifndef __KERNEL__ | |
| 25 | −struct sigaction { | |
| 26 | − __sighandler_t sa_handler; | |
| 27 | − unsigned long sa_flags; | |
| 28 | − sigset_t sa_mask; /* mask last for extensibility */ | |
| 29 | −}; | |
| 30 | −#endif | |
| 31 | − | |
| 32 | 24 | #include <asm/sigcontext.h> |
| 33 | 25 | |
| 34 | 26 | #endif /* !__ASSEMBLY */ |
| @@ -364,8 +364,9 @@ · 363 unmodified lines | ||
| 364 | 364 | #define __NR_preadv2 (__NR_Linux + 347) |
| 365 | 365 | #define __NR_pwritev2 (__NR_Linux + 348) |
| 366 | 366 | #define __NR_statx (__NR_Linux + 349) |
| 367 | +#define __NR_io_pgetevents (__NR_Linux + 350) | |
| 367 | 368 | |
| 368 | −#define __NR_Linux_syscalls (__NR_statx + 1) | |
| 369 | +#define __NR_Linux_syscalls (__NR_io_pgetevents + 1) | |
| 369 | 370 | |
| 370 | 371 | |
| 371 | 372 | #define __IGNORE_select /* newselect */ |
| @@ -154,17 +154,14 @@ int register_parisc_driver(struct parisc_driver *driver) · 153 unmodified lines | ||
| 154 | 154 | { |
| 155 | 155 | /* FIXME: we need this because apparently the sti |
| 156 | 156 | * driver can be registered twice */ |
| 157 | − if(driver->drv.name) { | |
| 158 | − printk(KERN_WARNING | |
| 159 | − "BUG: skipping previously registered driver %s\n", | |
| 160 | − driver->name); | |
| 157 | + if (driver->drv.name) { | |
| 158 | + pr_warn("BUG: skipping previously registered driver %s\n", | |
| 159 | + driver->name); | |
| 161 | 160 | return 1; |
| 162 | 161 | } |
| 163 | 162 | |
| 164 | 163 | if (!driver->probe) { |
| 165 | − printk(KERN_WARNING | |
| 166 | − "BUG: driver %s has no probe routine\n", | |
| 167 | − driver->name); | |
| 164 | + pr_warn("BUG: driver %s has no probe routine\n", driver->name); | |
| 168 | 165 | return 1; |
| 169 | 166 | } |
| 170 | 167 | |
| @@ -491,12 +488,9 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) · 320 unmodified lines | ||
| 491 | 488 | |
| 492 | 489 | dev = create_parisc_device(mod_path); |
| 493 | 490 | if (dev->id.hw_type != HPHW_FAULTY) { |
| 494 | − printk(KERN_ERR "Two devices have hardware path [%s]. " | |
| 495 | − "IODC data for second device: " | |
| 496 | − "%02x%02x%02x%02x%02x%02x\n" | |
| 497 | − "Rearranging GSC cards sometimes helps\n", | |
| 498 | − parisc_pathname(dev), iodc_data[0], iodc_data[1], | |
| 499 | − iodc_data[3], iodc_data[4], iodc_data[5], iodc_data[6]); | |
| 491 | + pr_err("Two devices have hardware path [%s]. IODC data for second device: %7phN\n" | |
| 492 | + "Rearranging GSC cards sometimes helps\n", | |
| 493 | + parisc_pathname(dev), iodc_data); | |
| 500 | 494 | return NULL; |
| 501 | 495 | } |
| 502 | 496 | |
| @@ -528,8 +522,7 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) · 25 unmodified lines | ||
| 528 | 522 | * the keyboard controller |
| 529 | 523 | */ |
| 530 | 524 | if ((hpa & 0xfff) == 0 && insert_resource(&iomem_resource, &dev->hpa)) |
| 531 | − printk("Unable to claim HPA %lx for device %s\n", | |
| 532 | − hpa, name); | |
| 525 | + pr_warn("Unable to claim HPA %lx for device %s\n", hpa, name); | |
| 533 | 526 | |
| 534 | 527 | return dev; |
| 535 | 528 | } |
| @@ -875,7 +868,7 @@ static void print_parisc_device(struct parisc_device *dev) · 339 unmodified lines | ||
| 875 | 868 | static int count; |
| 876 | 869 | |
| 877 | 870 | print_pa_hwpath(dev, hw_path); |
| 878 | − printk(KERN_INFO "%d. %s at 0x%px [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }", | |
| 871 | + pr_info("%d. %s at 0x%px [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }", | |
| 879 | 872 | ++count, dev->name, (void*) dev->hpa.start, hw_path, dev->id.hw_type, |
| 880 | 873 | dev->id.hversion_rev, dev->id.hversion, dev->id.sversion); |
| 881 | 874 | |
| @@ -445,6 +445,7 @@ · 444 unmodified lines | ||
| 445 | 445 | ENTRY_COMP(preadv2) |
| 446 | 446 | ENTRY_COMP(pwritev2) |
| 447 | 447 | ENTRY_SAME(statx) |
| 448 | + ENTRY_COMP(io_pgetevents) /* 350 */ | |
| 448 | 449 | |
| 449 | 450 | |
| 450 | 451 | .ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b)) |
| @@ -25,7 +25,7 @@ · 24 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | /* #define DEBUG 1 */ |
| 27 | 27 | #ifdef DEBUG |
| 28 | −#define dbg(x...) printk(x) | |
| 28 | +#define dbg(x...) pr_debug(x) | |
| 29 | 29 | #else |
| 30 | 30 | #define dbg(x...) |
| 31 | 31 | #endif |
| @@ -182,7 +182,7 @@ int __init unwind_init(void) · 150 unmodified lines | ||
| 182 | 182 | start = (long)&__start___unwind[0]; |
| 183 | 183 | stop = (long)&__stop___unwind[0]; |
| 184 | 184 | |
| 185 | − printk("unwind_init: start = 0x%lx, end = 0x%lx, entries = %lu\n", | |
| 185 | + dbg("unwind_init: start = 0x%lx, end = 0x%lx, entries = %lu\n", | |
| 186 | 186 | start, stop, |
| 187 | 187 | (stop - start) / sizeof(struct unwind_table_entry)); |
| 188 | 188 | |
| @@ -138,7 +138,6 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb, · 137 unmodified lines | ||
| 138 | 138 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, |
| 139 | 139 | unsigned long address) |
| 140 | 140 | { |
| 141 | − pgtable_page_dtor(table); | |
| 142 | 141 | pgtable_free_tlb(tlb, page_address(table), 0); |
| 143 | 142 | } |
| 144 | 143 | #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */ |
| @@ -140,7 +140,6 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, · 139 unmodified lines | ||
| 140 | 140 | unsigned long address) |
| 141 | 141 | { |
| 142 | 142 | tlb_flush_pgtable(tlb, address); |
| 143 | − pgtable_page_dtor(table); | |
| 144 | 143 | pgtable_free_tlb(tlb, page_address(table), 0); |
| 145 | 144 | } |
| 146 | 145 | #endif /* _ASM_POWERPC_PGALLOC_32_H */ |
| @@ -393,3 +393,4 @@ SYSCALL(pkey_alloc) · 392 unmodified lines | ||
| 393 | 393 | SYSCALL(pkey_free) |
| 394 | 394 | SYSCALL(pkey_mprotect) |
| 395 | 395 | SYSCALL(rseq) |
| 396 | +COMPAT_SYS(io_pgetevents) | |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | #include <uapi/asm/unistd.h> |
| 13 | 13 | |
| 14 | 14 | |
| 15 | −#define NR_syscalls 388 | |
| 15 | +#define NR_syscalls 389 | |
| 16 | 16 | |
| 17 | 17 | #define __NR__exit __NR_exit |
| 18 | 18 | |
| @@ -399,5 +399,6 @@ · 398 unmodified lines | ||
| 399 | 399 | #define __NR_pkey_free 385 |
| 400 | 400 | #define __NR_pkey_mprotect 386 |
| 401 | 401 | #define __NR_rseq 387 |
| 402 | +#define __NR_io_pgetevents 388 | |
| 402 | 403 | |
| 403 | 404 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
| @@ -285,9 +285,6 @@ pci_bus_to_hose(int bus) · 284 unmodified lines | ||
| 285 | 285 | * Note that the returned IO or memory base is a physical address |
| 286 | 286 | */ |
| 287 | 287 | |
| 288 | −#pragma GCC diagnostic push | |
| 289 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 290 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 291 | 288 | SYSCALL_DEFINE3(pciconfig_iobase, long, which, |
| 292 | 289 | unsigned long, bus, unsigned long, devfn) |
| 293 | 290 | { |
| @@ -313,4 +310,3 @@ SYSCALL_DEFINE3(pciconfig_iobase, long, which, · 19 unmodified lines | ||
| 313 | 310 | |
| 314 | 311 | return result; |
| 315 | 312 | } |
| 316 | −#pragma GCC diagnostic pop | |
| @@ -203,9 +203,6 @@ void pcibios_setup_phb_io_space(struct pci_controller *hose) · 202 unmodified lines | ||
| 203 | 203 | #define IOBASE_ISA_IO 3 |
| 204 | 204 | #define IOBASE_ISA_MEM 4 |
| 205 | 205 | |
| 206 | −#pragma GCC diagnostic push | |
| 207 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 208 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 209 | 206 | SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus, |
| 210 | 207 | unsigned long, in_devfn) |
| 211 | 208 | { |
| @@ -259,7 +256,6 @@ SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus, · 47 unmodified lines | ||
| 259 | 256 | |
| 260 | 257 | return -EOPNOTSUPP; |
| 261 | 258 | } |
| 262 | −#pragma GCC diagnostic pop | |
| 263 | 259 | |
| 264 | 260 | #ifdef CONFIG_NUMA |
| 265 | 261 | int pcibus_to_node(struct pci_bus *bus) |
| @@ -1051,9 +1051,6 @@ struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log, · 1050 unmodified lines | ||
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | 1053 | /* We assume to be passed big endian arguments */ |
| 1054 | −#pragma GCC diagnostic push | |
| 1055 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 1056 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 1057 | 1054 | SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) |
| 1058 | 1055 | { |
| 1059 | 1056 | struct rtas_args args; |
| @@ -1140,7 +1137,6 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) · 80 unmodified lines | ||
| 1140 | 1137 | |
| 1141 | 1138 | return 0; |
| 1142 | 1139 | } |
| 1143 | −#pragma GCC diagnostic pop | |
| 1144 | 1140 | |
| 1145 | 1141 | /* |
| 1146 | 1142 | * Call early during boot, before mem init, to retrieve the RTAS |
| @@ -1038,9 +1038,6 @@ static int do_setcontext_tm(struct ucontext __user *ucp, · 1037 unmodified lines | ||
| 1038 | 1038 | } |
| 1039 | 1039 | #endif |
| 1040 | 1040 | |
| 1041 | −#pragma GCC diagnostic push | |
| 1042 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 1043 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 1044 | 1041 | #ifdef CONFIG_PPC64 |
| 1045 | 1042 | COMPAT_SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, |
| 1046 | 1043 | struct ucontext __user *, new_ctx, int, ctx_size) |
| @@ -1134,7 +1131,6 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, · 87 unmodified lines | ||
| 1134 | 1131 | set_thread_flag(TIF_RESTOREALL); |
| 1135 | 1132 | return 0; |
| 1136 | 1133 | } |
| 1137 | −#pragma GCC diagnostic pop | |
| 1138 | 1134 | |
| 1139 | 1135 | #ifdef CONFIG_PPC64 |
| 1140 | 1136 | COMPAT_SYSCALL_DEFINE0(rt_sigreturn) |
| @@ -1231,9 +1227,6 @@ SYSCALL_DEFINE0(rt_sigreturn) · 90 unmodified lines | ||
| 1231 | 1227 | return 0; |
| 1232 | 1228 | } |
| 1233 | 1229 | |
| 1234 | −#pragma GCC diagnostic push | |
| 1235 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 1236 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 1237 | 1230 | #ifdef CONFIG_PPC32 |
| 1238 | 1231 | SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, |
| 1239 | 1232 | int, ndbg, struct sig_dbg_op __user *, dbg) |
| @@ -1337,7 +1330,6 @@ SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, · 97 unmodified lines | ||
| 1337 | 1330 | return 0; |
| 1338 | 1331 | } |
| 1339 | 1332 | #endif |
| 1340 | −#pragma GCC diagnostic pop | |
| 1341 | 1333 | |
| 1342 | 1334 | /* |
| 1343 | 1335 | * OK, we're invoking a handler |
| @@ -625,9 +625,6 @@ static long setup_trampoline(unsigned int syscall, unsigned int __user *tramp) · 624 unmodified lines | ||
| 625 | 625 | /* |
| 626 | 626 | * Handle {get,set,swap}_context operations |
| 627 | 627 | */ |
| 628 | −#pragma GCC diagnostic push | |
| 629 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 630 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 631 | 628 | SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, |
| 632 | 629 | struct ucontext __user *, new_ctx, long, ctx_size) |
| 633 | 630 | { |
| @@ -693,7 +690,6 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, · 59 unmodified lines | ||
| 693 | 690 | set_thread_flag(TIF_RESTOREALL); |
| 694 | 691 | return 0; |
| 695 | 692 | } |
| 696 | −#pragma GCC diagnostic pop | |
| 697 | 693 | |
| 698 | 694 | |
| 699 | 695 | /* |
| @@ -62,9 +62,6 @@ out: · 61 unmodified lines | ||
| 62 | 62 | return ret; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | −#pragma GCC diagnostic push | |
| 66 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 67 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 68 | 65 | SYSCALL_DEFINE6(mmap2, unsigned long, addr, size_t, len, |
| 69 | 66 | unsigned long, prot, unsigned long, flags, |
| 70 | 67 | unsigned long, fd, unsigned long, pgoff) |
| @@ -78,7 +75,6 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, size_t, len, · 7 unmodified lines | ||
| 78 | 75 | { |
| 79 | 76 | return do_mmap2(addr, len, prot, flags, fd, offset, PAGE_SHIFT); |
| 80 | 77 | } |
| 81 | −#pragma GCC diagnostic pop | |
| 82 | 78 | |
| 83 | 79 | #ifdef CONFIG_PPC32 |
| 84 | 80 | /* |
| @@ -186,9 +186,6 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr, · 185 unmodified lines | ||
| 186 | 186 | * in a 2-bit field won't allow writes to a page that is otherwise |
| 187 | 187 | * write-protected. |
| 188 | 188 | */ |
| 189 | −#pragma GCC diagnostic push | |
| 190 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 191 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 192 | 189 | SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, |
| 193 | 190 | unsigned long, len, u32 __user *, map) |
| 194 | 191 | { |
| @@ -272,4 +269,3 @@ SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, · 77 unmodified lines | ||
| 272 | 269 | up_write(&mm->mmap_sem); |
| 273 | 270 | return err; |
| 274 | 271 | } |
| 275 | −#pragma GCC diagnostic pop | |
| @@ -42,7 +42,11 @@ · 41 unmodified lines | ||
| 42 | 42 | #define DBG(x...) |
| 43 | 43 | #endif |
| 44 | 44 | |
| 45 | −/* Apparently the RTC stores seconds since 1 Jan 1904 */ | |
| 45 | +/* | |
| 46 | + * Offset between Unix time (1970-based) and Mac time (1904-based). Cuda and PMU | |
| 47 | + * times wrap in 2040. If we need to handle later times, the read_time functions | |
| 48 | + * need to be changed to interpret wrapped times as post-2040. | |
| 49 | + */ | |
| 46 | 50 | #define RTC_OFFSET 2082844800 |
| 47 | 51 | |
| 48 | 52 | /* |
| @@ -97,8 +101,11 @@ static time64_t cuda_get_time(void) · 48 unmodified lines | ||
| 97 | 101 | if (req.reply_len != 7) |
| 98 | 102 | printk(KERN_ERR "cuda_get_time: got %d byte reply\n", |
| 99 | 103 | req.reply_len); |
| 100 | − now = (req.reply[3] << 24) + (req.reply[4] << 16) | |
| 101 | − + (req.reply[5] << 8) + req.reply[6]; | |
| 104 | + now = (u32)((req.reply[3] << 24) + (req.reply[4] << 16) + | |
| 105 | + (req.reply[5] << 8) + req.reply[6]); | |
| 106 | + /* it's either after year 2040, or the RTC has gone backwards */ | |
| 107 | + WARN_ON(now < RTC_OFFSET); | |
| 108 | + | |
| 102 | 109 | return now - RTC_OFFSET; |
| 103 | 110 | } |
| 104 | 111 | |
| @@ -106,10 +113,10 @@ static time64_t cuda_get_time(void) · 1 unmodified line | ||
| 106 | 113 | |
| 107 | 114 | static int cuda_set_rtc_time(struct rtc_time *tm) |
| 108 | 115 | { |
| 109 | − time64_t nowtime; | |
| 116 | + u32 nowtime; | |
| 110 | 117 | struct adb_request req; |
| 111 | 118 | |
| 112 | − nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET; | |
| 119 | + nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET); | |
| 113 | 120 | if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, |
| 114 | 121 | nowtime >> 24, nowtime >> 16, nowtime >> 8, |
| 115 | 122 | nowtime) < 0) |
| @@ -140,8 +147,12 @@ static time64_t pmu_get_time(void) · 24 unmodified lines | ||
| 140 | 147 | if (req.reply_len != 4) |
| 141 | 148 | printk(KERN_ERR "pmu_get_time: got %d byte reply from PMU\n", |
| 142 | 149 | req.reply_len); |
| 143 | − now = (req.reply[0] << 24) + (req.reply[1] << 16) | |
| 144 | − + (req.reply[2] << 8) + req.reply[3]; | |
| 150 | + now = (u32)((req.reply[0] << 24) + (req.reply[1] << 16) + | |
| 151 | + (req.reply[2] << 8) + req.reply[3]); | |
| 152 | + | |
| 153 | + /* it's either after year 2040, or the RTC has gone backwards */ | |
| 154 | + WARN_ON(now < RTC_OFFSET); | |
| 155 | + | |
| 145 | 156 | return now - RTC_OFFSET; |
| 146 | 157 | } |
| 147 | 158 | |
| @@ -149,10 +160,10 @@ static time64_t pmu_get_time(void) · 1 unmodified line | ||
| 149 | 160 | |
| 150 | 161 | static int pmu_set_rtc_time(struct rtc_time *tm) |
| 151 | 162 | { |
| 152 | − time64_t nowtime; | |
| 163 | + u32 nowtime; | |
| 153 | 164 | struct adb_request req; |
| 154 | 165 | |
| 155 | − nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET; | |
| 166 | + nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET); | |
| 156 | 167 | if (pmu_request(&req, NULL, 5, PMU_SET_RTC, nowtime >> 24, |
| 157 | 168 | nowtime >> 16, nowtime >> 8, nowtime) < 0) |
| 158 | 169 | return -ENXIO; |
| @@ -1286,6 +1286,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) · 1285 unmodified lines | ||
| 1286 | 1286 | goto free_addrs; |
| 1287 | 1287 | } |
| 1288 | 1288 | if (bpf_jit_prog(&jit, fp)) { |
| 1289 | + bpf_jit_binary_free(header); | |
| 1289 | 1290 | fp = orig_fp; |
| 1290 | 1291 | goto free_addrs; |
| 1291 | 1292 | } |
| @@ -477,7 +477,7 @@ ENTRY(entry_SYSENTER_32) · 476 unmodified lines | ||
| 477 | 477 | * whereas POPF does not.) |
| 478 | 478 | */ |
| 479 | 479 | addl $PT_EFLAGS-PT_DS, %esp /* point esp at pt_regs->flags */ |
| 480 | − btr $X86_EFLAGS_IF_BIT, (%esp) | |
| 480 | + btrl $X86_EFLAGS_IF_BIT, (%esp) | |
| 481 | 481 | popfl |
| 482 | 482 | |
| 483 | 483 | /* |
| @@ -84,13 +84,13 @@ ENTRY(entry_SYSENTER_compat) · 83 unmodified lines | ||
| 84 | 84 | pushq %rdx /* pt_regs->dx */ |
| 85 | 85 | pushq %rcx /* pt_regs->cx */ |
| 86 | 86 | pushq $-ENOSYS /* pt_regs->ax */ |
| 87 | − pushq %r8 /* pt_regs->r8 */ | |
| 87 | + pushq $0 /* pt_regs->r8 = 0 */ | |
| 88 | 88 | xorl %r8d, %r8d /* nospec r8 */ |
| 89 | − pushq %r9 /* pt_regs->r9 */ | |
| 89 | + pushq $0 /* pt_regs->r9 = 0 */ | |
| 90 | 90 | xorl %r9d, %r9d /* nospec r9 */ |
| 91 | − pushq %r10 /* pt_regs->r10 */ | |
| 91 | + pushq $0 /* pt_regs->r10 = 0 */ | |
| 92 | 92 | xorl %r10d, %r10d /* nospec r10 */ |
| 93 | − pushq %r11 /* pt_regs->r11 */ | |
| 93 | + pushq $0 /* pt_regs->r11 = 0 */ | |
| 94 | 94 | xorl %r11d, %r11d /* nospec r11 */ |
| 95 | 95 | pushq %rbx /* pt_regs->rbx */ |
| 96 | 96 | xorl %ebx, %ebx /* nospec rbx */ |
| @@ -374,13 +374,13 @@ ENTRY(entry_INT80_compat) · 277 unmodified lines | ||
| 374 | 374 | pushq %rcx /* pt_regs->cx */ |
| 375 | 375 | xorl %ecx, %ecx /* nospec cx */ |
| 376 | 376 | pushq $-ENOSYS /* pt_regs->ax */ |
| 377 | − pushq $0 /* pt_regs->r8 = 0 */ | |
| 377 | + pushq %r8 /* pt_regs->r8 */ | |
| 378 | 378 | xorl %r8d, %r8d /* nospec r8 */ |
| 379 | − pushq $0 /* pt_regs->r9 = 0 */ | |
| 379 | + pushq %r9 /* pt_regs->r9 */ | |
| 380 | 380 | xorl %r9d, %r9d /* nospec r9 */ |
| 381 | − pushq $0 /* pt_regs->r10 = 0 */ | |
| 381 | + pushq %r10 /* pt_regs->r10*/ | |
| 382 | 382 | xorl %r10d, %r10d /* nospec r10 */ |
| 383 | − pushq $0 /* pt_regs->r11 = 0 */ | |
| 383 | + pushq %r11 /* pt_regs->r11 */ | |
| 384 | 384 | xorl %r11d, %r11d /* nospec r11 */ |
| 385 | 385 | pushq %rbx /* pt_regs->rbx */ |
| 386 | 386 | xorl %ebx, %ebx /* nospec rbx */ |
| @@ -184,6 +184,9 @@ static inline p4d_t *p4d_alloc_one(struct mm_struct *mm, unsigned long addr) · 183 unmodified lines | ||
| 184 | 184 | |
| 185 | 185 | static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d) |
| 186 | 186 | { |
| 187 | + if (!pgtable_l5_enabled()) | |
| 188 | + return; | |
| 189 | + | |
| 187 | 190 | BUG_ON((unsigned long)p4d & (PAGE_SIZE-1)); |
| 188 | 191 | free_page((unsigned long)p4d); |
| 189 | 192 | } |
| @@ -898,7 +898,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd) · 897 unmodified lines | ||
| 898 | 898 | #define pgd_page(pgd) pfn_to_page(pgd_pfn(pgd)) |
| 899 | 899 | |
| 900 | 900 | /* to find an entry in a page-table-directory. */ |
| 901 | −static __always_inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address) | |
| 901 | +static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address) | |
| 902 | 902 | { |
| 903 | 903 | if (!pgtable_l5_enabled()) |
| 904 | 904 | return (p4d_t *)pgd; |
| @@ -216,7 +216,7 @@ static inline pgd_t pti_set_user_pgd(pgd_t *pgdp, pgd_t pgd) · 215 unmodified lines | ||
| 216 | 216 | } |
| 217 | 217 | #endif |
| 218 | 218 | |
| 219 | −static __always_inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) | |
| 219 | +static inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) | |
| 220 | 220 | { |
| 221 | 221 | pgd_t pgd; |
| 222 | 222 | |
| @@ -230,7 +230,7 @@ static __always_inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) · 7 unmodified lines | ||
| 230 | 230 | *p4dp = native_make_p4d(native_pgd_val(pgd)); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | −static __always_inline void native_p4d_clear(p4d_t *p4d) | |
| 233 | +static inline void native_p4d_clear(p4d_t *p4d) | |
| 234 | 234 | { |
| 235 | 235 | native_set_p4d(p4d, native_make_p4d(0)); |
| 236 | 236 | } |
| @@ -1248,6 +1248,7 @@ void __init e820__memblock_setup(void) · 1247 unmodified lines | ||
| 1248 | 1248 | { |
| 1249 | 1249 | int i; |
| 1250 | 1250 | u64 end; |
| 1251 | + u64 addr = 0; | |
| 1251 | 1252 | |
| 1252 | 1253 | /* |
| 1253 | 1254 | * The bootstrap memblock region count maximum is 128 entries |
| @@ -1264,13 +1265,21 @@ void __init e820__memblock_setup(void) · 10 unmodified lines | ||
| 1264 | 1265 | struct e820_entry *entry = &e820_table->entries[i]; |
| 1265 | 1266 | |
| 1266 | 1267 | end = entry->addr + entry->size; |
| 1268 | + if (addr < entry->addr) | |
| 1269 | + memblock_reserve(addr, entry->addr - addr); | |
| 1270 | + addr = end; | |
| 1267 | 1271 | if (end != (resource_size_t)end) |
| 1268 | 1272 | continue; |
| 1269 | 1273 | |
| 1274 | + /* | |
| 1275 | + * all !E820_TYPE_RAM ranges (including gap ranges) are put | |
| 1276 | + * into memblock.reserved to make sure that struct pages in | |
| 1277 | + * such regions are not left uninitialized after bootup. | |
| 1278 | + */ | |
| 1270 | 1279 | if (entry->type != E820_TYPE_RAM && entry->type != E820_TYPE_RESERVED_KERN) |
| 1271 | − continue; | |
| 1272 | − | |
| 1273 | − memblock_add(entry->addr, entry->size); | |
| 1280 | + memblock_reserve(entry->addr, entry->size); | |
| 1281 | + else | |
| 1282 | + memblock_add(entry->addr, entry->size); | |
| 1274 | 1283 | } |
| 1275 | 1284 | |
| 1276 | 1285 | /* Throw away partial pages: */ |
| @@ -641,11 +641,6 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) · 640 unmodified lines | ||
| 641 | 641 | return 0; |
| 642 | 642 | } |
| 643 | 643 | |
| 644 | −static const char nx_warning[] = KERN_CRIT | |
| 645 | −"kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n"; | |
| 646 | −static const char smep_warning[] = KERN_CRIT | |
| 647 | −"unable to execute userspace code (SMEP?) (uid: %d)\n"; | |
| 648 | − | |
| 649 | 644 | static void |
| 650 | 645 | show_fault_oops(struct pt_regs *regs, unsigned long error_code, |
| 651 | 646 | unsigned long address) |
| @@ -664,20 +659,18 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, · 12 unmodified lines | ||
| 664 | 659 | pte = lookup_address_in_pgd(pgd, address, &level); |
| 665 | 660 | |
| 666 | 661 | if (pte && pte_present(*pte) && !pte_exec(*pte)) |
| 667 | − printk(nx_warning, from_kuid(&init_user_ns, current_uid())); | |
| 662 | + pr_crit("kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n", | |
| 663 | + from_kuid(&init_user_ns, current_uid())); | |
| 668 | 664 | if (pte && pte_present(*pte) && pte_exec(*pte) && |
| 669 | 665 | (pgd_flags(*pgd) & _PAGE_USER) && |
| 670 | 666 | (__read_cr4() & X86_CR4_SMEP)) |
| 671 | − printk(smep_warning, from_kuid(&init_user_ns, current_uid())); | |
| 667 | + pr_crit("unable to execute userspace code (SMEP?) (uid: %d)\n", | |
| 668 | + from_kuid(&init_user_ns, current_uid())); | |
| 672 | 669 | } |
| 673 | 670 | |
| 674 | − printk(KERN_ALERT "BUG: unable to handle kernel "); | |
| 675 | − if (address < PAGE_SIZE) | |
| 676 | − printk(KERN_CONT "NULL pointer dereference"); | |
| 677 | − else | |
| 678 | − printk(KERN_CONT "paging request"); | |
| 679 | − | |
| 680 | − printk(KERN_CONT " at %px\n", (void *) address); | |
| 671 | + pr_alert("BUG: unable to handle kernel %s at %px\n", | |
| 672 | + address < PAGE_SIZE ? "NULL pointer dereference" : "paging request", | |
| 673 | + (void *)address); | |
| 681 | 674 | |
| 682 | 675 | dump_pagetable(address); |
| 683 | 676 | } |
| @@ -166,14 +166,14 @@ void __init efi_call_phys_epilog(pgd_t *save_pgd) · 165 unmodified lines | ||
| 166 | 166 | pgd = pgd_offset_k(pgd_idx * PGDIR_SIZE); |
| 167 | 167 | set_pgd(pgd_offset_k(pgd_idx * PGDIR_SIZE), save_pgd[pgd_idx]); |
| 168 | 168 | |
| 169 | − if (!(pgd_val(*pgd) & _PAGE_PRESENT)) | |
| 169 | + if (!pgd_present(*pgd)) | |
| 170 | 170 | continue; |
| 171 | 171 | |
| 172 | 172 | for (i = 0; i < PTRS_PER_P4D; i++) { |
| 173 | 173 | p4d = p4d_offset(pgd, |
| 174 | 174 | pgd_idx * PGDIR_SIZE + i * P4D_SIZE); |
| 175 | 175 | |
| 176 | − if (!(p4d_val(*p4d) & _PAGE_PRESENT)) | |
| 176 | + if (!p4d_present(*p4d)) | |
| 177 | 177 | continue; |
| 178 | 178 | |
| 179 | 179 | pud = (pud_t *)p4d_page_vaddr(*p4d); |
| @@ -3473,6 +3473,10 @@ static void __blk_rq_prep_clone(struct request *dst, struct request *src) · 3472 unmodified lines | ||
| 3473 | 3473 | dst->cpu = src->cpu; |
| 3474 | 3474 | dst->__sector = blk_rq_pos(src); |
| 3475 | 3475 | dst->__data_len = blk_rq_bytes(src); |
| 3476 | + if (src->rq_flags & RQF_SPECIAL_PAYLOAD) { | |
| 3477 | + dst->rq_flags |= RQF_SPECIAL_PAYLOAD; | |
| 3478 | + dst->special_vec = src->special_vec; | |
| 3479 | + } | |
| 3476 | 3480 | dst->nr_phys_segments = src->nr_phys_segments; |
| 3477 | 3481 | dst->ioprio = src->ioprio; |
| 3478 | 3482 | dst->extra_len = src->extra_len; |
| @@ -1075,6 +1075,9 @@ static bool blk_mq_mark_tag_wait(struct blk_mq_hw_ctx **hctx, · 1074 unmodified lines | ||
| 1075 | 1075 | |
| 1076 | 1076 | #define BLK_MQ_RESOURCE_DELAY 3 /* ms units */ |
| 1077 | 1077 | |
| 1078 | +/* | |
| 1079 | + * Returns true if we did some work AND can potentially do more. | |
| 1080 | + */ | |
| 1078 | 1081 | bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, |
| 1079 | 1082 | bool got_budget) |
| 1080 | 1083 | { |
| @@ -1205,8 +1208,17 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, · 124 unmodified lines | ||
| 1205 | 1208 | blk_mq_run_hw_queue(hctx, true); |
| 1206 | 1209 | else if (needs_restart && (ret == BLK_STS_RESOURCE)) |
| 1207 | 1210 | blk_mq_delay_run_hw_queue(hctx, BLK_MQ_RESOURCE_DELAY); |
| 1211 | + | |
| 1212 | + return false; | |
| 1208 | 1213 | } |
| 1209 | 1214 | |
| 1215 | + /* | |
| 1216 | + * If the host/device is unable to accept more work, inform the | |
| 1217 | + * caller of that. | |
| 1218 | + */ | |
| 1219 | + if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE) | |
| 1220 | + return false; | |
| 1221 | + | |
| 1210 | 1222 | return (queued + errors) != 0; |
| 1211 | 1223 | } |
| 1212 | 1224 | |
| @@ -1,3 +1,3 @@ | ||
| 1 | 1 | #include <linux/kernel.h> |
| 2 | 2 | |
| 3 | −extern const char __initdata *const blacklist_hashes[]; | |
| 3 | +extern const char __initconst *const blacklist_hashes[]; | |
| @@ -1060,12 +1060,19 @@ void af_alg_async_cb(struct crypto_async_request *_req, int err) · 1059 unmodified lines | ||
| 1060 | 1060 | } |
| 1061 | 1061 | EXPORT_SYMBOL_GPL(af_alg_async_cb); |
| 1062 | 1062 | |
| 1063 | −__poll_t af_alg_poll_mask(struct socket *sock, __poll_t events) | |
| 1063 | +/** | |
| 1064 | + * af_alg_poll - poll system call handler | |
| 1065 | + */ | |
| 1066 | +__poll_t af_alg_poll(struct file *file, struct socket *sock, | |
| 1067 | + poll_table *wait) | |
| 1064 | 1068 | { |
| 1065 | 1069 | struct sock *sk = sock->sk; |
| 1066 | 1070 | struct alg_sock *ask = alg_sk(sk); |
| 1067 | 1071 | struct af_alg_ctx *ctx = ask->private; |
| 1068 | − __poll_t mask = 0; | |
| 1072 | + __poll_t mask; | |
| 1073 | + | |
| 1074 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 1075 | + mask = 0; | |
| 1069 | 1076 | |
| 1070 | 1077 | if (!ctx->more || ctx->used) |
| 1071 | 1078 | mask |= EPOLLIN | EPOLLRDNORM; |
| @@ -1075,7 +1082,7 @@ __poll_t af_alg_poll_mask(struct socket *sock, __poll_t events) · 3 unmodified lines | ||
| 1075 | 1082 | |
| 1076 | 1083 | return mask; |
| 1077 | 1084 | } |
| 1078 | −EXPORT_SYMBOL_GPL(af_alg_poll_mask); | |
| 1085 | +EXPORT_SYMBOL_GPL(af_alg_poll); | |
| 1079 | 1086 | |
| 1080 | 1087 | /** |
| 1081 | 1088 | * af_alg_alloc_areq - allocate struct af_alg_async_req |
| @@ -375,7 +375,7 @@ static struct proto_ops algif_aead_ops = { · 374 unmodified lines | ||
| 375 | 375 | .sendmsg = aead_sendmsg, |
| 376 | 376 | .sendpage = af_alg_sendpage, |
| 377 | 377 | .recvmsg = aead_recvmsg, |
| 378 | − .poll_mask = af_alg_poll_mask, | |
| 378 | + .poll = af_alg_poll, | |
| 379 | 379 | }; |
| 380 | 380 | |
| 381 | 381 | static int aead_check_key(struct socket *sock) |
| @@ -471,7 +471,7 @@ static struct proto_ops algif_aead_ops_nokey = { · 89 unmodified lines | ||
| 471 | 471 | .sendmsg = aead_sendmsg_nokey, |
| 472 | 472 | .sendpage = aead_sendpage_nokey, |
| 473 | 473 | .recvmsg = aead_recvmsg_nokey, |
| 474 | − .poll_mask = af_alg_poll_mask, | |
| 474 | + .poll = af_alg_poll, | |
| 475 | 475 | }; |
| 476 | 476 | |
| 477 | 477 | static void *aead_bind(const char *name, u32 type, u32 mask) |
| @@ -206,7 +206,7 @@ static struct proto_ops algif_skcipher_ops = { · 205 unmodified lines | ||
| 206 | 206 | .sendmsg = skcipher_sendmsg, |
| 207 | 207 | .sendpage = af_alg_sendpage, |
| 208 | 208 | .recvmsg = skcipher_recvmsg, |
| 209 | − .poll_mask = af_alg_poll_mask, | |
| 209 | + .poll = af_alg_poll, | |
| 210 | 210 | }; |
| 211 | 211 | |
| 212 | 212 | static int skcipher_check_key(struct socket *sock) |
| @@ -302,7 +302,7 @@ static struct proto_ops algif_skcipher_ops_nokey = { · 89 unmodified lines | ||
| 302 | 302 | .sendmsg = skcipher_sendmsg_nokey, |
| 303 | 303 | .sendpage = skcipher_sendpage_nokey, |
| 304 | 304 | .recvmsg = skcipher_recvmsg_nokey, |
| 305 | − .poll_mask = af_alg_poll_mask, | |
| 305 | + .poll = af_alg_poll, | |
| 306 | 306 | }; |
| 307 | 307 | |
| 308 | 308 | static void *skcipher_bind(const char *name, u32 type, u32 mask) |
| @@ -249,6 +249,15 @@ int x509_note_signature(void *context, size_t hdrlen, · 248 unmodified lines | ||
| 249 | 249 | return -EINVAL; |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | + if (strcmp(ctx->cert->sig->pkey_algo, "rsa") == 0) { | |
| 253 | + /* Discard the BIT STRING metadata */ | |
| 254 | + if (vlen < 1 || *(const u8 *)value != 0) | |
| 255 | + return -EBADMSG; | |
| 256 | + | |
| 257 | + value++; | |
| 258 | + vlen--; | |
| 259 | + } | |
| 260 | + | |
| 252 | 261 | ctx->cert->raw_sig = value; |
| 253 | 262 | ctx->cert->raw_sig_size = vlen; |
| 254 | 263 | return 0; |
| @@ -45,6 +45,8 @@ · 44 unmodified lines | ||
| 45 | 45 | #include <linux/uaccess.h> |
| 46 | 46 | #include <linux/io-64-nonatomic-lo-hi.h> |
| 47 | 47 | |
| 48 | +#include "acpica/accommon.h" | |
| 49 | +#include "acpica/acnamesp.h" | |
| 48 | 50 | #include "internal.h" |
| 49 | 51 | |
| 50 | 52 | #define _COMPONENT ACPI_OS_SERVICES |
| @@ -1490,6 +1492,76 @@ int acpi_check_region(resource_size_t start, resource_size_t n, · 1439 unmodified lines | ||
| 1490 | 1492 | } |
| 1491 | 1493 | EXPORT_SYMBOL(acpi_check_region); |
| 1492 | 1494 | |
| 1495 | +static acpi_status acpi_deactivate_mem_region(acpi_handle handle, u32 level, | |
| 1496 | + void *_res, void **return_value) | |
| 1497 | +{ | |
| 1498 | + struct acpi_mem_space_context **mem_ctx; | |
| 1499 | + union acpi_operand_object *handler_obj; | |
| 1500 | + union acpi_operand_object *region_obj2; | |
| 1501 | + union acpi_operand_object *region_obj; | |
| 1502 | + struct resource *res = _res; | |
| 1503 | + acpi_status status; | |
| 1504 | + | |
| 1505 | + region_obj = acpi_ns_get_attached_object(handle); | |
| 1506 | + if (!region_obj) | |
| 1507 | + return AE_OK; | |
| 1508 | + | |
| 1509 | + handler_obj = region_obj->region.handler; | |
| 1510 | + if (!handler_obj) | |
| 1511 | + return AE_OK; | |
| 1512 | + | |
| 1513 | + if (region_obj->region.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) | |
| 1514 | + return AE_OK; | |
| 1515 | + | |
| 1516 | + if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) | |
| 1517 | + return AE_OK; | |
| 1518 | + | |
| 1519 | + region_obj2 = acpi_ns_get_secondary_object(region_obj); | |
| 1520 | + if (!region_obj2) | |
| 1521 | + return AE_OK; | |
| 1522 | + | |
| 1523 | + mem_ctx = (void *)®ion_obj2->extra.region_context; | |
| 1524 | + | |
| 1525 | + if (!(mem_ctx[0]->address >= res->start && | |
| 1526 | + mem_ctx[0]->address < res->end)) | |
| 1527 | + return AE_OK; | |
| 1528 | + | |
| 1529 | + status = handler_obj->address_space.setup(region_obj, | |
| 1530 | + ACPI_REGION_DEACTIVATE, | |
| 1531 | + NULL, (void **)mem_ctx); | |
| 1532 | + if (ACPI_SUCCESS(status)) | |
| 1533 | + region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE); | |
| 1534 | + | |
| 1535 | + return status; | |
| 1536 | +} | |
| 1537 | + | |
| 1538 | +/** | |
| 1539 | + * acpi_release_memory - Release any mappings done to a memory region | |
| 1540 | + * @handle: Handle to namespace node | |
| 1541 | + * @res: Memory resource | |
| 1542 | + * @level: A level that terminates the search | |
| 1543 | + * | |
| 1544 | + * Walks through @handle and unmaps all SystemMemory Operation Regions that | |
| 1545 | + * overlap with @res and that have already been activated (mapped). | |
| 1546 | + * | |
| 1547 | + * This is a helper that allows drivers to place special requirements on memory | |
| 1548 | + * region that may overlap with operation regions, primarily allowing them to | |
| 1549 | + * safely map the region as non-cached memory. | |
| 1550 | + * | |
| 1551 | + * The unmapped Operation Regions will be automatically remapped next time they | |
| 1552 | + * are called, so the drivers do not need to do anything else. | |
| 1553 | + */ | |
| 1554 | +acpi_status acpi_release_memory(acpi_handle handle, struct resource *res, | |
| 1555 | + u32 level) | |
| 1556 | +{ | |
| 1557 | + if (!(res->flags & IORESOURCE_MEM)) | |
| 1558 | + return AE_TYPE; | |
| 1559 | + | |
| 1560 | + return acpi_walk_namespace(ACPI_TYPE_REGION, handle, level, | |
| 1561 | + acpi_deactivate_mem_region, NULL, res, NULL); | |
| 1562 | +} | |
| 1563 | +EXPORT_SYMBOL_GPL(acpi_release_memory); | |
| 1564 | + | |
| 1493 | 1565 | /* |
| 1494 | 1566 | * Let drivers know whether the resource checks are effective |
| 1495 | 1567 | */ |
| @@ -1618,7 +1618,7 @@ static int rx_init(struct atm_dev *dev) · 1617 unmodified lines | ||
| 1618 | 1618 | skb_queue_head_init(&iadev->rx_dma_q); |
| 1619 | 1619 | iadev->rx_free_desc_qhead = NULL; |
| 1620 | 1620 | |
| 1621 | − iadev->rx_open = kcalloc(4, iadev->num_vc, GFP_KERNEL); | |
| 1621 | + iadev->rx_open = kcalloc(iadev->num_vc, sizeof(void *), GFP_KERNEL); | |
| 1622 | 1622 | if (!iadev->rx_open) { |
| 1623 | 1623 | printk(KERN_ERR DEV_LABEL "itf %d couldn't get free page\n", |
| 1624 | 1624 | dev->number); |
| @@ -1481,6 +1481,8 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg) · 1480 unmodified lines | ||
| 1481 | 1481 | return -EFAULT; |
| 1482 | 1482 | if (pool < 0 || pool > ZATM_LAST_POOL) |
| 1483 | 1483 | return -EINVAL; |
| 1484 | + pool = array_index_nospec(pool, | |
| 1485 | + ZATM_LAST_POOL + 1); | |
| 1484 | 1486 | if (copy_from_user(&info, |
| 1485 | 1487 | &((struct zatm_pool_req __user *) arg)->info, |
| 1486 | 1488 | sizeof(info))) return -EFAULT; |
| @@ -2487,10 +2487,9 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); · 2486 unmodified lines | ||
| 2487 | 2487 | * power domain corresponding to a DT node's "required-opps" property. |
| 2488 | 2488 | * |
| 2489 | 2489 | * @dev: Device for which the performance-state needs to be found. |
| 2490 | − * @opp_node: DT node where the "required-opps" property is present. This can be | |
| 2490 | + * @np: DT node where the "required-opps" property is present. This can be | |
| 2491 | 2491 | * the device node itself (if it doesn't have an OPP table) or a node |
| 2492 | 2492 | * within the OPP table of a device (if device has an OPP table). |
| 2493 | − * @state: Pointer to return performance state. | |
| 2494 | 2493 | * |
| 2495 | 2494 | * Returns performance state corresponding to the "required-opps" property of |
| 2496 | 2495 | * a DT node. This calls platform specific genpd->opp_to_performance_state() |
| @@ -2499,7 +2498,7 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); · 2 unmodified lines | ||
| 2499 | 2498 | * Returns performance state on success and 0 on failure. |
| 2500 | 2499 | */ |
| 2501 | 2500 | unsigned int of_genpd_opp_to_performance_state(struct device *dev, |
| 2502 | − struct device_node *opp_node) | |
| 2501 | + struct device_node *np) | |
| 2503 | 2502 | { |
| 2504 | 2503 | struct generic_pm_domain *genpd; |
| 2505 | 2504 | struct dev_pm_opp *opp; |
| @@ -2514,7 +2513,7 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev, · 8 unmodified lines | ||
| 2514 | 2513 | |
| 2515 | 2514 | genpd_lock(genpd); |
| 2516 | 2515 | |
| 2517 | − opp = of_dev_pm_opp_find_required_opp(&genpd->dev, opp_node); | |
| 2516 | + opp = of_dev_pm_opp_find_required_opp(&genpd->dev, np); | |
| 2518 | 2517 | if (IS_ERR(opp)) { |
| 2519 | 2518 | dev_err(dev, "Failed to find required OPP: %ld\n", |
| 2520 | 2519 | PTR_ERR(opp)); |
| @@ -1244,8 +1244,8 @@ drbd_request_prepare(struct drbd_device *device, struct bio *bio, unsigned long · 1243 unmodified lines | ||
| 1244 | 1244 | _drbd_start_io_acct(device, req); |
| 1245 | 1245 | |
| 1246 | 1246 | /* process discards always from our submitter thread */ |
| 1247 | − if ((bio_op(bio) & REQ_OP_WRITE_ZEROES) || | |
| 1248 | − (bio_op(bio) & REQ_OP_DISCARD)) | |
| 1247 | + if (bio_op(bio) == REQ_OP_WRITE_ZEROES || | |
| 1248 | + bio_op(bio) == REQ_OP_DISCARD) | |
| 1249 | 1249 | goto queue_for_submitter_thread; |
| 1250 | 1250 | |
| 1251 | 1251 | if (rw == WRITE && req->private_bio && req->i.size |
| @@ -402,7 +402,8 @@ static struct poolinfo { · 401 unmodified lines | ||
| 402 | 402 | /* |
| 403 | 403 | * Static global variables |
| 404 | 404 | */ |
| 405 | −static DECLARE_WAIT_QUEUE_HEAD(random_wait); | |
| 405 | +static DECLARE_WAIT_QUEUE_HEAD(random_read_wait); | |
| 406 | +static DECLARE_WAIT_QUEUE_HEAD(random_write_wait); | |
| 406 | 407 | static struct fasync_struct *fasync; |
| 407 | 408 | |
| 408 | 409 | static DEFINE_SPINLOCK(random_ready_list_lock); |
| @@ -721,8 +722,8 @@ retry: · 312 unmodified lines | ||
| 721 | 722 | |
| 722 | 723 | /* should we wake readers? */ |
| 723 | 724 | if (entropy_bits >= random_read_wakeup_bits && |
| 724 | − wq_has_sleeper(&random_wait)) { | |
| 725 | − wake_up_interruptible_poll(&random_wait, POLLIN); | |
| 725 | + wq_has_sleeper(&random_read_wait)) { | |
| 726 | + wake_up_interruptible(&random_read_wait); | |
| 726 | 727 | kill_fasync(&fasync, SIGIO, POLL_IN); |
| 727 | 728 | } |
| 728 | 729 | /* If the input pool is getting full, send some |
| @@ -1396,7 +1397,7 @@ retry: · 667 unmodified lines | ||
| 1396 | 1397 | trace_debit_entropy(r->name, 8 * ibytes); |
| 1397 | 1398 | if (ibytes && |
| 1398 | 1399 | (r->entropy_count >> ENTROPY_SHIFT) < random_write_wakeup_bits) { |
| 1399 | − wake_up_interruptible_poll(&random_wait, POLLOUT); | |
| 1400 | + wake_up_interruptible(&random_write_wait); | |
| 1400 | 1401 | kill_fasync(&fasync, SIGIO, POLL_OUT); |
| 1401 | 1402 | } |
| 1402 | 1403 | |
| @@ -1838,7 +1839,7 @@ _random_read(int nonblock, char __user *buf, size_t nbytes) · 435 unmodified lines | ||
| 1838 | 1839 | if (nonblock) |
| 1839 | 1840 | return -EAGAIN; |
| 1840 | 1841 | |
| 1841 | − wait_event_interruptible(random_wait, | |
| 1842 | + wait_event_interruptible(random_read_wait, | |
| 1842 | 1843 | ENTROPY_BITS(&input_pool) >= |
| 1843 | 1844 | random_read_wakeup_bits); |
| 1844 | 1845 | if (signal_pending(current)) |
| @@ -1875,17 +1876,14 @@ urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) · 30 unmodified lines | ||
| 1875 | 1876 | return ret; |
| 1876 | 1877 | } |
| 1877 | 1878 | |
| 1878 | −static struct wait_queue_head * | |
| 1879 | −random_get_poll_head(struct file *file, __poll_t events) | |
| 1880 | −{ | |
| 1881 | − return &random_wait; | |
| 1882 | −} | |
| 1883 | − | |
| 1884 | 1879 | static __poll_t |
| 1885 | −random_poll_mask(struct file *file, __poll_t events) | |
| 1880 | +random_poll(struct file *file, poll_table * wait) | |
| 1886 | 1881 | { |
| 1887 | − __poll_t mask = 0; | |
| 1882 | + __poll_t mask; | |
| 1888 | 1883 | |
| 1884 | + poll_wait(file, &random_read_wait, wait); | |
| 1885 | + poll_wait(file, &random_write_wait, wait); | |
| 1886 | + mask = 0; | |
| 1889 | 1887 | if (ENTROPY_BITS(&input_pool) >= random_read_wakeup_bits) |
| 1890 | 1888 | mask |= EPOLLIN | EPOLLRDNORM; |
| 1891 | 1889 | if (ENTROPY_BITS(&input_pool) < random_write_wakeup_bits) |
| @@ -1992,8 +1990,7 @@ static int random_fasync(int fd, struct file *filp, int on) · 100 unmodified lines | ||
| 1992 | 1990 | const struct file_operations random_fops = { |
| 1993 | 1991 | .read = random_read, |
| 1994 | 1992 | .write = random_write, |
| 1995 | − .get_poll_head = random_get_poll_head, | |
| 1996 | − .poll_mask = random_poll_mask, | |
| 1993 | + .poll = random_poll, | |
| 1997 | 1994 | .unlocked_ioctl = random_ioctl, |
| 1998 | 1995 | .fasync = random_fasync, |
| 1999 | 1996 | .llseek = noop_llseek, |
| @@ -2326,7 +2323,7 @@ void add_hwgenerator_randomness(const char *buffer, size_t count, · 326 unmodified lines | ||
| 2326 | 2323 | * We'll be woken up again once below random_write_wakeup_thresh, |
| 2327 | 2324 | * or when the calling thread is about to terminate. |
| 2328 | 2325 | */ |
| 2329 | − wait_event_interruptible(random_wait, kthread_should_stop() || | |
| 2326 | + wait_event_interruptible(random_write_wait, kthread_should_stop() || | |
| 2330 | 2327 | ENTROPY_BITS(&input_pool) <= random_write_wakeup_bits); |
| 2331 | 2328 | mix_pool_bytes(poolp, buffer, count); |
| 2332 | 2329 | credit_entropy_bits(poolp, entropy); |
| @@ -87,8 +87,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 86 unmodified lines | ||
| 87 | 87 | int ret; |
| 88 | 88 | |
| 89 | 89 | cpu_dev = get_cpu_device(0); |
| 90 | − if (NULL == cpu_dev) | |
| 91 | − ret = -ENODEV; | |
| 90 | + if (!cpu_dev) | |
| 91 | + return -ENODEV; | |
| 92 | 92 | |
| 93 | 93 | msm8996_version = qcom_cpufreq_kryo_get_msm_id(); |
| 94 | 94 | if (NUM_OF_MSM8996_VERSIONS == msm8996_version) { |
| @@ -97,8 +97,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 2 unmodified lines | ||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | np = dev_pm_opp_of_get_opp_desc_node(cpu_dev); |
| 100 | − if (IS_ERR(np)) | |
| 101 | − return PTR_ERR(np); | |
| 100 | + if (!np) | |
| 101 | + return -ENOENT; | |
| 102 | 102 | |
| 103 | 103 | ret = of_device_is_compatible(np, "operating-points-v2-kryo-cpu"); |
| 104 | 104 | if (!ret) { |
| @@ -86,6 +86,7 @@ bool __bdev_dax_supported(struct block_device *bdev, int blocksize) · 85 unmodified lines | ||
| 86 | 86 | { |
| 87 | 87 | struct dax_device *dax_dev; |
| 88 | 88 | bool dax_enabled = false; |
| 89 | + struct request_queue *q; | |
| 89 | 90 | pgoff_t pgoff; |
| 90 | 91 | int err, id; |
| 91 | 92 | void *kaddr; |
| @@ -99,6 +100,13 @@ bool __bdev_dax_supported(struct block_device *bdev, int blocksize) · 7 unmodified lines | ||
| 99 | 100 | return false; |
| 100 | 101 | } |
| 101 | 102 | |
| 103 | + q = bdev_get_queue(bdev); | |
| 104 | + if (!q || !blk_queue_dax(q)) { | |
| 105 | + pr_debug("%s: error: request queue doesn't support dax\n", | |
| 106 | + bdevname(bdev, buf)); | |
| 107 | + return false; | |
| 108 | + } | |
| 109 | + | |
| 102 | 110 | err = bdev_dax_pgoff(bdev, 0, PAGE_SIZE, &pgoff); |
| 103 | 111 | if (err) { |
| 104 | 112 | pr_debug("%s: error: unaligned partition for dax\n", |
| @@ -376,7 +376,7 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring, · 375 unmodified lines | ||
| 376 | 376 | struct amdgpu_device *adev = ring->adev; |
| 377 | 377 | uint64_t index; |
| 378 | 378 | |
| 379 | − if (ring != &adev->uvd.inst[ring->me].ring) { | |
| 379 | + if (ring->funcs->type != AMDGPU_RING_TYPE_UVD) { | |
| 380 | 380 | ring->fence_drv.cpu_addr = &adev->wb.wb[ring->fence_offs]; |
| 381 | 381 | ring->fence_drv.gpu_addr = adev->wb.gpu_addr + (ring->fence_offs * 4); |
| 382 | 382 | } else { |
| @@ -52,7 +52,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · 51 unmodified lines | ||
| 52 | 52 | unsigned long bo_size; |
| 53 | 53 | const char *fw_name; |
| 54 | 54 | const struct common_firmware_header *hdr; |
| 55 | − unsigned version_major, version_minor, family_id; | |
| 55 | + unsigned char fw_check; | |
| 56 | 56 | int r; |
| 57 | 57 | |
| 58 | 58 | INIT_DELAYED_WORK(&adev->vcn.idle_work, amdgpu_vcn_idle_work_handler); |
| @@ -83,12 +83,33 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · 24 unmodified lines | ||
| 83 | 83 | |
| 84 | 84 | hdr = (const struct common_firmware_header *)adev->vcn.fw->data; |
| 85 | 85 | adev->vcn.fw_version = le32_to_cpu(hdr->ucode_version); |
| 86 | − family_id = le32_to_cpu(hdr->ucode_version) & 0xff; | |
| 87 | − version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff; | |
| 88 | − version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; | |
| 89 | − DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n", | |
| 90 | − version_major, version_minor, family_id); | |
| 91 | 86 | |
| 87 | + /* Bit 20-23, it is encode major and non-zero for new naming convention. | |
| 88 | + * This field is part of version minor and DRM_DISABLED_FLAG in old naming | |
| 89 | + * convention. Since the l:wq!atest version minor is 0x5B and DRM_DISABLED_FLAG | |
| 90 | + * is zero in old naming convention, this field is always zero so far. | |
| 91 | + * These four bits are used to tell which naming convention is present. | |
| 92 | + */ | |
| 93 | + fw_check = (le32_to_cpu(hdr->ucode_version) >> 20) & 0xf; | |
| 94 | + if (fw_check) { | |
| 95 | + unsigned int dec_ver, enc_major, enc_minor, vep, fw_rev; | |
| 96 | + | |
| 97 | + fw_rev = le32_to_cpu(hdr->ucode_version) & 0xfff; | |
| 98 | + enc_minor = (le32_to_cpu(hdr->ucode_version) >> 12) & 0xff; | |
| 99 | + enc_major = fw_check; | |
| 100 | + dec_ver = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xf; | |
| 101 | + vep = (le32_to_cpu(hdr->ucode_version) >> 28) & 0xf; | |
| 102 | + DRM_INFO("Found VCN firmware Version ENC: %hu.%hu DEC: %hu VEP: %hu Revision: %hu\n", | |
| 103 | + enc_major, enc_minor, dec_ver, vep, fw_rev); | |
| 104 | + } else { | |
| 105 | + unsigned int version_major, version_minor, family_id; | |
| 106 | + | |
| 107 | + family_id = le32_to_cpu(hdr->ucode_version) & 0xff; | |
| 108 | + version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff; | |
| 109 | + version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; | |
| 110 | + DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n", | |
| 111 | + version_major, version_minor, family_id); | |
| 112 | + } | |
| 92 | 113 | |
| 93 | 114 | bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8) |
| 94 | 115 | + AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_HEAP_SIZE |
| @@ -1463,7 +1463,9 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 1462 unmodified lines | ||
| 1463 | 1463 | uint64_t count; |
| 1464 | 1464 | |
| 1465 | 1465 | max_entries = min(max_entries, 16ull * 1024ull); |
| 1466 | − for (count = 1; count < max_entries; ++count) { | |
| 1466 | + for (count = 1; | |
| 1467 | + count < max_entries / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE); | |
| 1468 | + ++count) { | |
| 1467 | 1469 | uint64_t idx = pfn + count; |
| 1468 | 1470 | |
| 1469 | 1471 | if (pages_addr[idx] != |
| @@ -1476,7 +1478,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 6 unmodified lines | ||
| 1476 | 1478 | dma_addr = pages_addr; |
| 1477 | 1479 | } else { |
| 1478 | 1480 | addr = pages_addr[pfn]; |
| 1479 | − max_entries = count; | |
| 1481 | + max_entries = count * (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE); | |
| 1480 | 1482 | } |
| 1481 | 1483 | |
| 1482 | 1484 | } else if (flags & AMDGPU_PTE_VALID) { |
| @@ -1491,7 +1493,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 8 unmodified lines | ||
| 1491 | 1493 | if (r) |
| 1492 | 1494 | return r; |
| 1493 | 1495 | |
| 1494 | − pfn += last - start + 1; | |
| 1496 | + pfn += (last - start + 1) / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE); | |
| 1495 | 1497 | if (nodes && nodes->size == pfn) { |
| 1496 | 1498 | pfn = 0; |
| 1497 | 1499 | ++nodes; |
| @@ -3928,10 +3928,11 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc, · 3927 unmodified lines | ||
| 3928 | 3928 | if (acrtc->base.state->event) |
| 3929 | 3929 | prepare_flip_isr(acrtc); |
| 3930 | 3930 | |
| 3931 | + spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | |
| 3932 | + | |
| 3931 | 3933 | surface_updates->surface = dc_stream_get_status(acrtc_state->stream)->plane_states[0]; |
| 3932 | 3934 | surface_updates->flip_addr = &addr; |
| 3933 | 3935 | |
| 3934 | − | |
| 3935 | 3936 | dc_commit_updates_for_stream(adev->dm.dc, |
| 3936 | 3937 | surface_updates, |
| 3937 | 3938 | 1, |
| @@ -3944,9 +3945,6 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc, · 6 unmodified lines | ||
| 3944 | 3945 | __func__, |
| 3945 | 3946 | addr.address.grph.addr.high_part, |
| 3946 | 3947 | addr.address.grph.addr.low_part); |
| 3947 | − | |
| 3948 | − | |
| 3949 | − spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | |
| 3950 | 3948 | } |
| 3951 | 3949 | |
| 3952 | 3950 | /* |
| @@ -4206,6 +4204,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 253 unmodified lines | ||
| 4206 | 4204 | struct drm_connector *connector; |
| 4207 | 4205 | struct drm_connector_state *old_con_state, *new_con_state; |
| 4208 | 4206 | struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state; |
| 4207 | + int crtc_disable_count = 0; | |
| 4209 | 4208 | |
| 4210 | 4209 | drm_atomic_helper_update_legacy_modeset_state(dev, state); |
| 4211 | 4210 | |
| @@ -4410,6 +4409,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 198 unmodified lines | ||
| 4410 | 4409 | struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); |
| 4411 | 4410 | bool modeset_needed; |
| 4412 | 4411 | |
| 4412 | + if (old_crtc_state->active && !new_crtc_state->active) | |
| 4413 | + crtc_disable_count++; | |
| 4414 | + | |
| 4413 | 4415 | dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); |
| 4414 | 4416 | dm_old_crtc_state = to_dm_crtc_state(old_crtc_state); |
| 4415 | 4417 | modeset_needed = modeset_required( |
| @@ -4463,11 +4465,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 47 unmodified lines | ||
| 4463 | 4465 | * so we can put the GPU into runtime suspend if we're not driving any |
| 4464 | 4466 | * displays anymore |
| 4465 | 4467 | */ |
| 4468 | + for (i = 0; i < crtc_disable_count; i++) | |
| 4469 | + pm_runtime_put_autosuspend(dev->dev); | |
| 4466 | 4470 | pm_runtime_mark_last_busy(dev->dev); |
| 4467 | − for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { | |
| 4468 | − if (old_crtc_state->active && !new_crtc_state->active) | |
| 4469 | − pm_runtime_put_autosuspend(dev->dev); | |
| 4470 | − } | |
| 4471 | 4471 | } |
| 4472 | 4472 | |
| 4473 | 4473 | |
| @@ -278,7 +278,6 @@ static int malidp_init(struct drm_device *drm) · 277 unmodified lines | ||
| 278 | 278 | |
| 279 | 279 | static void malidp_fini(struct drm_device *drm) |
| 280 | 280 | { |
| 281 | − drm_atomic_helper_shutdown(drm); | |
| 282 | 281 | drm_mode_config_cleanup(drm); |
| 283 | 282 | } |
| 284 | 283 | |
| @@ -646,6 +645,7 @@ vblank_fail: · 361 unmodified lines | ||
| 646 | 645 | malidp_de_irq_fini(drm); |
| 647 | 646 | drm->irq_enabled = false; |
| 648 | 647 | irq_init_fail: |
| 648 | + drm_atomic_helper_shutdown(drm); | |
| 649 | 649 | component_unbind_all(dev, drm); |
| 650 | 650 | bind_fail: |
| 651 | 651 | of_node_put(malidp->crtc.port); |
| @@ -681,6 +681,7 @@ static void malidp_unbind(struct device *dev) · 29 unmodified lines | ||
| 681 | 681 | malidp_se_irq_fini(drm); |
| 682 | 682 | malidp_de_irq_fini(drm); |
| 683 | 683 | drm->irq_enabled = false; |
| 684 | + drm_atomic_helper_shutdown(drm); | |
| 684 | 685 | component_unbind_all(dev, drm); |
| 685 | 686 | of_node_put(malidp->crtc.port); |
| 686 | 687 | malidp->crtc.port = NULL; |
| @@ -634,7 +634,8 @@ const struct malidp_hw malidp_device[MALIDP_MAX_DEVICES] = { · 633 unmodified lines | ||
| 634 | 634 | .vsync_irq = MALIDP500_DE_IRQ_VSYNC, |
| 635 | 635 | }, |
| 636 | 636 | .se_irq_map = { |
| 637 | − .irq_mask = MALIDP500_SE_IRQ_CONF_MODE, | |
| 637 | + .irq_mask = MALIDP500_SE_IRQ_CONF_MODE | | |
| 638 | + MALIDP500_SE_IRQ_GLOBAL, | |
| 638 | 639 | .vsync_irq = 0, |
| 639 | 640 | }, |
| 640 | 641 | .dc_irq_map = { |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | |
| 24 | 24 | /* Layer specific register offsets */ |
| 25 | 25 | #define MALIDP_LAYER_FORMAT 0x000 |
| 26 | +#define LAYER_FORMAT_MASK 0x3f | |
| 26 | 27 | #define MALIDP_LAYER_CONTROL 0x004 |
| 27 | 28 | #define LAYER_ENABLE (1 << 0) |
| 28 | 29 | #define LAYER_FLOWCFG_MASK 7 |
| @@ -235,8 +236,8 @@ static int malidp_de_plane_check(struct drm_plane *plane, · 206 unmodified lines | ||
| 235 | 236 | if (state->rotation & MALIDP_ROTATED_MASK) { |
| 236 | 237 | int val; |
| 237 | 238 | |
| 238 | − val = mp->hwdev->hw->rotmem_required(mp->hwdev, state->crtc_h, | |
| 239 | − state->crtc_w, | |
| 239 | + val = mp->hwdev->hw->rotmem_required(mp->hwdev, state->crtc_w, | |
| 240 | + state->crtc_h, | |
| 240 | 241 | fb->format->format); |
| 241 | 242 | if (val < 0) |
| 242 | 243 | return val; |
| @@ -337,7 +338,9 @@ static void malidp_de_plane_update(struct drm_plane *plane, · 94 unmodified lines | ||
| 337 | 338 | dest_w = plane->state->crtc_w; |
| 338 | 339 | dest_h = plane->state->crtc_h; |
| 339 | 340 | |
| 340 | − malidp_hw_write(mp->hwdev, ms->format, mp->layer->base); | |
| 341 | + val = malidp_hw_read(mp->hwdev, mp->layer->base); | |
| 342 | + val = (val & ~LAYER_FORMAT_MASK) | ms->format; | |
| 343 | + malidp_hw_write(mp->hwdev, val, mp->layer->base); | |
| 341 | 344 | |
| 342 | 345 | for (i = 0; i < ms->n_planes; i++) { |
| 343 | 346 | /* calculate the offset for the layer's plane registers */ |
| @@ -2245,9 +2245,6 @@ static inline struct scatterlist *____sg_next(struct scatterlist *sg) · 2244 unmodified lines | ||
| 2245 | 2245 | **/ |
| 2246 | 2246 | static inline struct scatterlist *__sg_next(struct scatterlist *sg) |
| 2247 | 2247 | { |
| 2248 | −#ifdef CONFIG_DEBUG_SG | |
| 2249 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 2250 | −#endif | |
| 2251 | 2248 | return sg_is_last(sg) ? NULL : ____sg_next(sg); |
| 2252 | 2249 | } |
| 2253 | 2250 | |
| @@ -197,8 +197,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) · 196 unmodified lines | ||
| 197 | 197 | priv->io_base = regs; |
| 198 | 198 | |
| 199 | 199 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hhi"); |
| 200 | − if (!res) | |
| 201 | − return -EINVAL; | |
| 200 | + if (!res) { | |
| 201 | + ret = -EINVAL; | |
| 202 | + goto free_drm; | |
| 203 | + } | |
| 202 | 204 | /* Simply ioremap since it may be a shared register zone */ |
| 203 | 205 | regs = devm_ioremap(dev, res->start, resource_size(res)); |
| 204 | 206 | if (!regs) { |
| @@ -215,8 +217,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) · 10 unmodified lines | ||
| 215 | 217 | } |
| 216 | 218 | |
| 217 | 219 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmc"); |
| 218 | − if (!res) | |
| 219 | − return -EINVAL; | |
| 220 | + if (!res) { | |
| 221 | + ret = -EINVAL; | |
| 222 | + goto free_drm; | |
| 223 | + } | |
| 220 | 224 | /* Simply ioremap since it may be a shared register zone */ |
| 221 | 225 | regs = devm_ioremap(dev, res->start, resource_size(res)); |
| 222 | 226 | if (!regs) { |
| @@ -647,10 +647,10 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap, · 646 unmodified lines | ||
| 647 | 647 | if (bit_adap->getscl == NULL) |
| 648 | 648 | adap->quirks = &i2c_bit_quirk_no_clk_stretch; |
| 649 | 649 | |
| 650 | − /* Bring bus to a known state. Looks like STOP if bus is not free yet */ | |
| 651 | − setscl(bit_adap, 1); | |
| 652 | − udelay(bit_adap->udelay); | |
| 653 | − setsda(bit_adap, 1); | |
| 650 | + /* | |
| 651 | + * We tried forcing SCL/SDA to an initial state here. But that caused a | |
| 652 | + * regression, sadly. Check Bugzilla #200045 for details. | |
| 653 | + */ | |
| 654 | 654 | |
| 655 | 655 | ret = add_adapter(adap); |
| 656 | 656 | if (ret < 0) |
| @@ -279,9 +279,9 @@ static int i2c_gpio_probe(struct platform_device *pdev) · 278 unmodified lines | ||
| 279 | 279 | * required for an I2C bus. |
| 280 | 280 | */ |
| 281 | 281 | if (pdata->scl_is_open_drain) |
| 282 | − gflags = GPIOD_OUT_LOW; | |
| 282 | + gflags = GPIOD_OUT_HIGH; | |
| 283 | 283 | else |
| 284 | − gflags = GPIOD_OUT_LOW_OPEN_DRAIN; | |
| 284 | + gflags = GPIOD_OUT_HIGH_OPEN_DRAIN; | |
| 285 | 285 | priv->scl = i2c_gpio_get_desc(dev, "scl", 1, gflags); |
| 286 | 286 | if (IS_ERR(priv->scl)) |
| 287 | 287 | return PTR_ERR(priv->scl); |
| @@ -465,15 +465,18 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, · 464 unmodified lines | ||
| 465 | 465 | |
| 466 | 466 | status = i2c_transfer(adapter, msg, num); |
| 467 | 467 | if (status < 0) |
| 468 | − return status; | |
| 469 | − if (status != num) | |
| 470 | − return -EIO; | |
| 468 | + goto cleanup; | |
| 469 | + if (status != num) { | |
| 470 | + status = -EIO; | |
| 471 | + goto cleanup; | |
| 472 | + } | |
| 473 | + status = 0; | |
| 471 | 474 | |
| 472 | 475 | /* Check PEC if last message is a read */ |
| 473 | 476 | if (i && (msg[num-1].flags & I2C_M_RD)) { |
| 474 | 477 | status = i2c_smbus_check_pec(partial_pec, &msg[num-1]); |
| 475 | 478 | if (status < 0) |
| 476 | − return status; | |
| 479 | + goto cleanup; | |
| 477 | 480 | } |
| 478 | 481 | |
| 479 | 482 | if (read_write == I2C_SMBUS_READ) |
| @@ -499,12 +502,13 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, · 19 unmodified lines | ||
| 499 | 502 | break; |
| 500 | 503 | } |
| 501 | 504 | |
| 505 | +cleanup: | |
| 502 | 506 | if (msg[0].flags & I2C_M_DMA_SAFE) |
| 503 | 507 | kfree(msg[0].buf); |
| 504 | 508 | if (msg[1].flags & I2C_M_DMA_SAFE) |
| 505 | 509 | kfree(msg[1].buf); |
| 506 | 510 | |
| 507 | − return 0; | |
| 511 | + return status; | |
| 508 | 512 | } |
| 509 | 513 | |
| 510 | 514 | /** |
| @@ -1053,7 +1053,7 @@ static irqreturn_t mma8452_interrupt(int irq, void *p) · 1052 unmodified lines | ||
| 1053 | 1053 | if (src < 0) |
| 1054 | 1054 | return IRQ_NONE; |
| 1055 | 1055 | |
| 1056 | − if (!(src & data->chip_info->enabled_events)) | |
| 1056 | + if (!(src & (data->chip_info->enabled_events | MMA8452_INT_DRDY))) | |
| 1057 | 1057 | return IRQ_NONE; |
| 1058 | 1058 | |
| 1059 | 1059 | if (src & MMA8452_INT_DRDY) { |
| @@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, · 958 unmodified lines | ||
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | irq_type = irqd_get_trigger_type(desc); |
| 962 | + if (!irq_type) | |
| 963 | + irq_type = IRQF_TRIGGER_RISING; | |
| 962 | 964 | if (irq_type == IRQF_TRIGGER_RISING) |
| 963 | 965 | st->irq_mask = INV_MPU6050_ACTIVE_HIGH; |
| 964 | 966 | else if (irq_type == IRQF_TRIGGER_FALLING) |
| @@ -582,6 +582,8 @@ static int tsl2772_als_calibrate(struct iio_dev *indio_dev) · 581 unmodified lines | ||
| 582 | 582 | "%s: failed to get lux\n", __func__); |
| 583 | 583 | return lux_val; |
| 584 | 584 | } |
| 585 | + if (lux_val == 0) | |
| 586 | + return -ERANGE; | |
| 585 | 587 | |
| 586 | 588 | ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) / |
| 587 | 589 | lux_val; |
| @@ -415,10 +415,9 @@ static int bmp280_read_humid(struct bmp280_data *data, int *val, int *val2) · 414 unmodified lines | ||
| 415 | 415 | } |
| 416 | 416 | comp_humidity = bmp280_compensate_humidity(data, adc_humidity); |
| 417 | 417 | |
| 418 | − *val = comp_humidity; | |
| 419 | − *val2 = 1024; | |
| 418 | + *val = comp_humidity * 1000 / 1024; | |
| 420 | 419 | |
| 421 | − return IIO_VAL_FRACTIONAL; | |
| 420 | + return IIO_VAL_INT; | |
| 422 | 421 | } |
| 423 | 422 | |
| 424 | 423 | static int bmp280_read_raw(struct iio_dev *indio_dev, |
| @@ -6113,7 +6113,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) · 6112 unmodified lines | ||
| 6113 | 6113 | dev->num_ports = max(MLX5_CAP_GEN(mdev, num_ports), |
| 6114 | 6114 | MLX5_CAP_GEN(mdev, num_vhca_ports)); |
| 6115 | 6115 | |
| 6116 | − if (MLX5_VPORT_MANAGER(mdev) && | |
| 6116 | + if (MLX5_ESWITCH_MANAGER(mdev) && | |
| 6117 | 6117 | mlx5_ib_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) { |
| 6118 | 6118 | dev->rep = mlx5_ib_vport_rep(mdev->priv.eswitch, 0); |
| 6119 | 6119 | |
| @@ -131,8 +131,10 @@ EXPORT_SYMBOL(input_mt_destroy_slots); · 130 unmodified lines | ||
| 131 | 131 | * inactive, or if the tool type is changed, a new tracking id is |
| 132 | 132 | * assigned to the slot. The tool type is only reported if the |
| 133 | 133 | * corresponding absbit field is set. |
| 134 | + * | |
| 135 | + * Returns true if contact is active. | |
| 134 | 136 | */ |
| 135 | −void input_mt_report_slot_state(struct input_dev *dev, | |
| 137 | +bool input_mt_report_slot_state(struct input_dev *dev, | |
| 136 | 138 | unsigned int tool_type, bool active) |
| 137 | 139 | { |
| 138 | 140 | struct input_mt *mt = dev->mt; |
| @@ -140,22 +142,24 @@ void input_mt_report_slot_state(struct input_dev *dev, · 1 unmodified line | ||
| 140 | 142 | int id; |
| 141 | 143 | |
| 142 | 144 | if (!mt) |
| 143 | − return; | |
| 145 | + return false; | |
| 144 | 146 | |
| 145 | 147 | slot = &mt->slots[mt->slot]; |
| 146 | 148 | slot->frame = mt->frame; |
| 147 | 149 | |
| 148 | 150 | if (!active) { |
| 149 | 151 | input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1); |
| 150 | − return; | |
| 152 | + return false; | |
| 151 | 153 | } |
| 152 | 154 | |
| 153 | 155 | id = input_mt_get_value(slot, ABS_MT_TRACKING_ID); |
| 154 | − if (id < 0 || input_mt_get_value(slot, ABS_MT_TOOL_TYPE) != tool_type) | |
| 156 | + if (id < 0) | |
| 155 | 157 | id = input_mt_new_trkid(mt); |
| 156 | 158 | |
| 157 | 159 | input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, id); |
| 158 | 160 | input_event(dev, EV_ABS, ABS_MT_TOOL_TYPE, tool_type); |
| 161 | + | |
| 162 | + return true; | |
| 159 | 163 | } |
| 160 | 164 | EXPORT_SYMBOL(input_mt_report_slot_state); |
| 161 | 165 | |
| @@ -125,7 +125,7 @@ static const struct xpad_device { · 124 unmodified lines | ||
| 125 | 125 | u8 mapping; |
| 126 | 126 | u8 xtype; |
| 127 | 127 | } xpad_device[] = { |
| 128 | − { 0x0079, 0x18d4, "GPD Win 2 Controller", 0, XTYPE_XBOX360 }, | |
| 128 | + { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 }, | |
| 129 | 129 | { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX }, |
| 130 | 130 | { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX }, |
| 131 | 131 | { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX }, |
| @@ -45,7 +45,7 @@ struct event_dev { · 44 unmodified lines | ||
| 45 | 45 | static irqreturn_t events_interrupt(int irq, void *dev_id) |
| 46 | 46 | { |
| 47 | 47 | struct event_dev *edev = dev_id; |
| 48 | − unsigned type, code, value; | |
| 48 | + unsigned int type, code, value; | |
| 49 | 49 | |
| 50 | 50 | type = __raw_readl(edev->addr + REG_READ); |
| 51 | 51 | code = __raw_readl(edev->addr + REG_READ); |
| @@ -57,7 +57,7 @@ static irqreturn_t events_interrupt(int irq, void *dev_id) · 5 unmodified lines | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static void events_import_bits(struct event_dev *edev, |
| 60 | − unsigned long bits[], unsigned type, size_t count) | |
| 60 | + unsigned long bits[], unsigned int type, size_t count) | |
| 61 | 61 | { |
| 62 | 62 | void __iomem *addr = edev->addr; |
| 63 | 63 | int i, j; |
| @@ -99,6 +99,7 @@ static void events_import_abs_params(struct event_dev *edev) · 35 unmodified lines | ||
| 99 | 99 | |
| 100 | 100 | for (j = 0; j < ARRAY_SIZE(val); j++) { |
| 101 | 101 | int offset = (i * ARRAY_SIZE(val) + j) * sizeof(u32); |
| 102 | + | |
| 102 | 103 | val[j] = __raw_readl(edev->addr + REG_DATA + offset); |
| 103 | 104 | } |
| 104 | 105 | |
| @@ -112,7 +113,7 @@ static int events_probe(struct platform_device *pdev) · 7 unmodified lines | ||
| 112 | 113 | struct input_dev *input_dev; |
| 113 | 114 | struct event_dev *edev; |
| 114 | 115 | struct resource *res; |
| 115 | − unsigned keymapnamelen; | |
| 116 | + unsigned int keymapnamelen; | |
| 116 | 117 | void __iomem *addr; |
| 117 | 118 | int irq; |
| 118 | 119 | int i; |
| @@ -150,7 +151,7 @@ static int events_probe(struct platform_device *pdev) · 31 unmodified lines | ||
| 150 | 151 | for (i = 0; i < keymapnamelen; i++) |
| 151 | 152 | edev->name[i] = __raw_readb(edev->addr + REG_DATA + i); |
| 152 | 153 | |
| 153 | − pr_debug("events_probe() keymap=%s\n", edev->name); | |
| 154 | + pr_debug("%s: keymap=%s\n", __func__, edev->name); | |
| 154 | 155 | |
| 155 | 156 | input_dev->name = edev->name; |
| 156 | 157 | input_dev->id.bustype = BUS_HOST; |
| @@ -841,4 +841,14 @@ config INPUT_RAVE_SP_PWRBUTTON · 840 unmodified lines | ||
| 841 | 841 | To compile this driver as a module, choose M here: the |
| 842 | 842 | module will be called rave-sp-pwrbutton. |
| 843 | 843 | |
| 844 | +config INPUT_SC27XX_VIBRA | |
| 845 | + tristate "Spreadtrum sc27xx vibrator support" | |
| 846 | + depends on MFD_SC27XX_PMIC || COMPILE_TEST | |
| 847 | + select INPUT_FF_MEMLESS | |
| 848 | + help | |
| 849 | + This option enables support for Spreadtrum sc27xx vibrator driver. | |
| 850 | + | |
| 851 | + To compile this driver as a module, choose M here. The module will | |
| 852 | + be called sc27xx_vibra. | |
| 853 | + | |
| 844 | 854 | endif |
| @@ -66,6 +66,7 @@ obj-$(CONFIG_INPUT_RETU_PWRBUTTON) += retu-pwrbutton.o · 65 unmodified lines | ||
| 66 | 66 | obj-$(CONFIG_INPUT_AXP20X_PEK) += axp20x-pek.o |
| 67 | 67 | obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o |
| 68 | 68 | obj-$(CONFIG_INPUT_RK805_PWRKEY) += rk805-pwrkey.o |
| 69 | +obj-$(CONFIG_INPUT_SC27XX_VIBRA) += sc27xx-vibra.o | |
| 69 | 70 | obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o |
| 70 | 71 | obj-$(CONFIG_INPUT_SIRFSOC_ONKEY) += sirfsoc-onkey.o |
| 71 | 72 | obj-$(CONFIG_INPUT_SOC_BUTTON_ARRAY) += soc_button_array.o |
| @@ -0,0 +1,154 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 2 | +/* | |
| 3 | + * Copyright (C) 2018 Spreadtrum Communications Inc. | |
| 4 | + */ | |
| 5 | + | |
| 6 | +#include <linux/module.h> | |
| 7 | +#include <linux/of_address.h> | |
| 8 | +#include <linux/platform_device.h> | |
| 9 | +#include <linux/regmap.h> | |
| 10 | +#include <linux/input.h> | |
| 11 | +#include <linux/workqueue.h> | |
| 12 | + | |
| 13 | +#define CUR_DRV_CAL_SEL GENMASK(13, 12) | |
| 14 | +#define SLP_LDOVIBR_PD_EN BIT(9) | |
| 15 | +#define LDO_VIBR_PD BIT(8) | |
| 16 | + | |
| 17 | +struct vibra_info { | |
| 18 | + struct input_dev *input_dev; | |
| 19 | + struct work_struct play_work; | |
| 20 | + struct regmap *regmap; | |
| 21 | + u32 base; | |
| 22 | + u32 strength; | |
| 23 | + bool enabled; | |
| 24 | +}; | |
| 25 | + | |
| 26 | +static void sc27xx_vibra_set(struct vibra_info *info, bool on) | |
| 27 | +{ | |
| 28 | + if (on) { | |
| 29 | + regmap_update_bits(info->regmap, info->base, LDO_VIBR_PD, 0); | |
| 30 | + regmap_update_bits(info->regmap, info->base, | |
| 31 | + SLP_LDOVIBR_PD_EN, 0); | |
| 32 | + info->enabled = true; | |
| 33 | + } else { | |
| 34 | + regmap_update_bits(info->regmap, info->base, LDO_VIBR_PD, | |
| 35 | + LDO_VIBR_PD); | |
| 36 | + regmap_update_bits(info->regmap, info->base, | |
| 37 | + SLP_LDOVIBR_PD_EN, SLP_LDOVIBR_PD_EN); | |
| 38 | + info->enabled = false; | |
| 39 | + } | |
| 40 | +} | |
| 41 | + | |
| 42 | +static int sc27xx_vibra_hw_init(struct vibra_info *info) | |
| 43 | +{ | |
| 44 | + return regmap_update_bits(info->regmap, info->base, CUR_DRV_CAL_SEL, 0); | |
| 45 | +} | |
| 46 | + | |
| 47 | +static void sc27xx_vibra_play_work(struct work_struct *work) | |
| 48 | +{ | |
| 49 | + struct vibra_info *info = container_of(work, struct vibra_info, | |
| 50 | + play_work); | |
| 51 | + | |
| 52 | + if (info->strength && !info->enabled) | |
| 53 | + sc27xx_vibra_set(info, true); | |
| 54 | + else if (info->strength == 0 && info->enabled) | |
| 55 | + sc27xx_vibra_set(info, false); | |
| 56 | +} | |
| 57 | + | |
| 58 | +static int sc27xx_vibra_play(struct input_dev *input, void *data, | |
| 59 | + struct ff_effect *effect) | |
| 60 | +{ | |
| 61 | + struct vibra_info *info = input_get_drvdata(input); | |
| 62 | + | |
| 63 | + info->strength = effect->u.rumble.weak_magnitude; | |
| 64 | + schedule_work(&info->play_work); | |
| 65 | + | |
| 66 | + return 0; | |
| 67 | +} | |
| 68 | + | |
| 69 | +static void sc27xx_vibra_close(struct input_dev *input) | |
| 70 | +{ | |
| 71 | + struct vibra_info *info = input_get_drvdata(input); | |
| 72 | + | |
| 73 | + cancel_work_sync(&info->play_work); | |
| 74 | + if (info->enabled) | |
| 75 | + sc27xx_vibra_set(info, false); | |
| 76 | +} | |
| 77 | + | |
| 78 | +static int sc27xx_vibra_probe(struct platform_device *pdev) | |
| 79 | +{ | |
| 80 | + struct vibra_info *info; | |
| 81 | + int error; | |
| 82 | + | |
| 83 | + info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); | |
| 84 | + if (!info) | |
| 85 | + return -ENOMEM; | |
| 86 | + | |
| 87 | + info->regmap = dev_get_regmap(pdev->dev.parent, NULL); | |
| 88 | + if (!info->regmap) { | |
| 89 | + dev_err(&pdev->dev, "failed to get vibrator regmap.\n"); | |
| 90 | + return -ENODEV; | |
| 91 | + } | |
| 92 | + | |
| 93 | + error = device_property_read_u32(&pdev->dev, "reg", &info->base); | |
| 94 | + if (error) { | |
| 95 | + dev_err(&pdev->dev, "failed to get vibrator base address.\n"); | |
| 96 | + return error; | |
| 97 | + } | |
| 98 | + | |
| 99 | + info->input_dev = devm_input_allocate_device(&pdev->dev); | |
| 100 | + if (!info->input_dev) { | |
| 101 | + dev_err(&pdev->dev, "failed to allocate input device.\n"); | |
| 102 | + return -ENOMEM; | |
| 103 | + } | |
| 104 | + | |
| 105 | + info->input_dev->name = "sc27xx:vibrator"; | |
| 106 | + info->input_dev->id.version = 0; | |
| 107 | + info->input_dev->close = sc27xx_vibra_close; | |
| 108 | + | |
| 109 | + input_set_drvdata(info->input_dev, info); | |
| 110 | + input_set_capability(info->input_dev, EV_FF, FF_RUMBLE); | |
| 111 | + INIT_WORK(&info->play_work, sc27xx_vibra_play_work); | |
| 112 | + info->enabled = false; | |
| 113 | + | |
| 114 | + error = sc27xx_vibra_hw_init(info); | |
| 115 | + if (error) { | |
| 116 | + dev_err(&pdev->dev, "failed to initialize the vibrator.\n"); | |
| 117 | + return error; | |
| 118 | + } | |
| 119 | + | |
| 120 | + error = input_ff_create_memless(info->input_dev, NULL, | |
| 121 | + sc27xx_vibra_play); | |
| 122 | + if (error) { | |
| 123 | + dev_err(&pdev->dev, "failed to register vibrator to FF.\n"); | |
| 124 | + return error; | |
| 125 | + } | |
| 126 | + | |
| 127 | + error = input_register_device(info->input_dev); | |
| 128 | + if (error) { | |
| 129 | + dev_err(&pdev->dev, "failed to register input device.\n"); | |
| 130 | + return error; | |
| 131 | + } | |
| 132 | + | |
| 133 | + return 0; | |
| 134 | +} | |
| 135 | + | |
| 136 | +static const struct of_device_id sc27xx_vibra_of_match[] = { | |
| 137 | + { .compatible = "sprd,sc2731-vibrator", }, | |
| 138 | + {} | |
| 139 | +}; | |
| 140 | +MODULE_DEVICE_TABLE(of, sc27xx_vibra_of_match); | |
| 141 | + | |
| 142 | +static struct platform_driver sc27xx_vibra_driver = { | |
| 143 | + .driver = { | |
| 144 | + .name = "sc27xx-vibrator", | |
| 145 | + .of_match_table = sc27xx_vibra_of_match, | |
| 146 | + }, | |
| 147 | + .probe = sc27xx_vibra_probe, | |
| 148 | +}; | |
| 149 | + | |
| 150 | +module_platform_driver(sc27xx_vibra_driver); | |
| 151 | + | |
| 152 | +MODULE_DESCRIPTION("Spreadtrum SC27xx Vibrator Driver"); | |
| 153 | +MODULE_LICENSE("GPL v2"); | |
| 154 | +MODULE_AUTHOR("Xiaotong Lu <xiaotong.lu@spreadtrum.com>"); | |
| @@ -27,6 +27,8 @@ · 26 unmodified lines | ||
| 27 | 27 | #define ETP_DISABLE_POWER 0x0001 |
| 28 | 28 | #define ETP_PRESSURE_OFFSET 25 |
| 29 | 29 | |
| 30 | +#define ETP_CALIBRATE_MAX_LEN 3 | |
| 31 | + | |
| 30 | 32 | /* IAP Firmware handling */ |
| 31 | 33 | #define ETP_PRODUCT_ID_FORMAT_STRING "%d.0" |
| 32 | 34 | #define ETP_FW_NAME "elan_i2c_" ETP_PRODUCT_ID_FORMAT_STRING ".bin" |
| @@ -613,7 +613,7 @@ static ssize_t calibrate_store(struct device *dev, · 612 unmodified lines | ||
| 613 | 613 | int tries = 20; |
| 614 | 614 | int retval; |
| 615 | 615 | int error; |
| 616 | − u8 val[3]; | |
| 616 | + u8 val[ETP_CALIBRATE_MAX_LEN]; | |
| 617 | 617 | |
| 618 | 618 | retval = mutex_lock_interruptible(&data->sysfs_mutex); |
| 619 | 619 | if (retval) |
| @@ -1345,6 +1345,7 @@ static const struct acpi_device_id elan_acpi_id[] = { · 725 unmodified lines | ||
| 1345 | 1345 | { "ELAN060C", 0 }, |
| 1346 | 1346 | { "ELAN0611", 0 }, |
| 1347 | 1347 | { "ELAN0612", 0 }, |
| 1348 | + { "ELAN0618", 0 }, | |
| 1348 | 1349 | { "ELAN1000", 0 }, |
| 1349 | 1350 | { } |
| 1350 | 1351 | }; |
| @@ -56,7 +56,7 @@ · 55 unmodified lines | ||
| 56 | 56 | static int elan_smbus_initialize(struct i2c_client *client) |
| 57 | 57 | { |
| 58 | 58 | u8 check[ETP_SMBUS_HELLOPACKET_LEN] = { 0x55, 0x55, 0x55, 0x55, 0x55 }; |
| 59 | − u8 values[ETP_SMBUS_HELLOPACKET_LEN] = { 0, 0, 0, 0, 0 }; | |
| 59 | + u8 values[I2C_SMBUS_BLOCK_MAX] = {0}; | |
| 60 | 60 | int len, error; |
| 61 | 61 | |
| 62 | 62 | /* Get hello packet */ |
| @@ -117,12 +117,16 @@ static int elan_smbus_calibrate(struct i2c_client *client) · 54 unmodified lines | ||
| 117 | 117 | static int elan_smbus_calibrate_result(struct i2c_client *client, u8 *val) |
| 118 | 118 | { |
| 119 | 119 | int error; |
| 120 | + u8 buf[I2C_SMBUS_BLOCK_MAX] = {0}; | |
| 121 | + | |
| 122 | + BUILD_BUG_ON(ETP_CALIBRATE_MAX_LEN > sizeof(buf)); | |
| 120 | 123 | |
| 121 | 124 | error = i2c_smbus_read_block_data(client, |
| 122 | − ETP_SMBUS_CALIBRATE_QUERY, val); | |
| 125 | + ETP_SMBUS_CALIBRATE_QUERY, buf); | |
| 123 | 126 | if (error < 0) |
| 124 | 127 | return error; |
| 125 | 128 | |
| 129 | + memcpy(val, buf, ETP_CALIBRATE_MAX_LEN); | |
| 126 | 130 | return 0; |
| 127 | 131 | } |
| 128 | 132 | |
| @@ -472,6 +476,8 @@ static int elan_smbus_get_report(struct i2c_client *client, u8 *report) · 343 unmodified lines | ||
| 472 | 476 | { |
| 473 | 477 | int len; |
| 474 | 478 | |
| 479 | + BUILD_BUG_ON(I2C_SMBUS_BLOCK_MAX > ETP_SMBUS_REPORT_LEN); | |
| 480 | + | |
| 475 | 481 | len = i2c_smbus_read_block_data(client, |
| 476 | 482 | ETP_SMBUS_PACKET_QUERY, |
| 477 | 483 | &report[ETP_SMBUS_REPORT_OFFSET]); |
| @@ -799,7 +799,7 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) · 798 unmodified lines | ||
| 799 | 799 | else if (ic_version == 7 && etd->info.samples[1] == 0x2A) |
| 800 | 800 | sanity_check = ((packet[3] & 0x1c) == 0x10); |
| 801 | 801 | else |
| 802 | − sanity_check = ((packet[0] & 0x0c) == 0x04 && | |
| 802 | + sanity_check = ((packet[0] & 0x08) == 0x00 && | |
| 803 | 803 | (packet[3] & 0x1c) == 0x10); |
| 804 | 804 | |
| 805 | 805 | if (!sanity_check) |
| @@ -1175,6 +1175,12 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = { · 369 unmodified lines | ||
| 1175 | 1175 | { } |
| 1176 | 1176 | }; |
| 1177 | 1177 | |
| 1178 | +static const char * const middle_button_pnp_ids[] = { | |
| 1179 | + "LEN2131", /* ThinkPad P52 w/ NFC */ | |
| 1180 | + "LEN2132", /* ThinkPad P52 */ | |
| 1181 | + NULL | |
| 1182 | +}; | |
| 1183 | + | |
| 1178 | 1184 | /* |
| 1179 | 1185 | * Set the appropriate event bits for the input subsystem |
| 1180 | 1186 | */ |
| @@ -1194,7 +1200,8 @@ static int elantech_set_input_params(struct psmouse *psmouse) · 13 unmodified lines | ||
| 1194 | 1200 | __clear_bit(EV_REL, dev->evbit); |
| 1195 | 1201 | |
| 1196 | 1202 | __set_bit(BTN_LEFT, dev->keybit); |
| 1197 | − if (dmi_check_system(elantech_dmi_has_middle_button)) | |
| 1203 | + if (dmi_check_system(elantech_dmi_has_middle_button) || | |
| 1204 | + psmouse_matches_pnp_id(psmouse, middle_button_pnp_ids)) | |
| 1198 | 1205 | __set_bit(BTN_MIDDLE, dev->keybit); |
| 1199 | 1206 | __set_bit(BTN_RIGHT, dev->keybit); |
| 1200 | 1207 | |
| @@ -192,8 +192,8 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) · 191 unmodified lines | ||
| 192 | 192 | else |
| 193 | 193 | input_report_rel(dev, REL_WHEEL, -wheel); |
| 194 | 194 | |
| 195 | − input_report_key(dev, BTN_SIDE, BIT(4)); | |
| 196 | − input_report_key(dev, BTN_EXTRA, BIT(5)); | |
| 195 | + input_report_key(dev, BTN_SIDE, packet[3] & BIT(4)); | |
| 196 | + input_report_key(dev, BTN_EXTRA, packet[3] & BIT(5)); | |
| 197 | 197 | break; |
| 198 | 198 | } |
| 199 | 199 | break; |
| @@ -203,13 +203,13 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) · 3 unmodified lines | ||
| 203 | 203 | input_report_rel(dev, REL_WHEEL, -(s8) packet[3]); |
| 204 | 204 | |
| 205 | 205 | /* Extra buttons on Genius NewNet 3D */ |
| 206 | − input_report_key(dev, BTN_SIDE, BIT(6)); | |
| 207 | − input_report_key(dev, BTN_EXTRA, BIT(7)); | |
| 206 | + input_report_key(dev, BTN_SIDE, packet[0] & BIT(6)); | |
| 207 | + input_report_key(dev, BTN_EXTRA, packet[0] & BIT(7)); | |
| 208 | 208 | break; |
| 209 | 209 | |
| 210 | 210 | case PSMOUSE_THINKPS: |
| 211 | 211 | /* Extra button on ThinkingMouse */ |
| 212 | − input_report_key(dev, BTN_EXTRA, BIT(3)); | |
| 212 | + input_report_key(dev, BTN_EXTRA, packet[0] & BIT(3)); | |
| 213 | 213 | |
| 214 | 214 | /* |
| 215 | 215 | * Without this bit of weirdness moving up gives wildly |
| @@ -223,7 +223,7 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) · 7 unmodified lines | ||
| 223 | 223 | * Cortron PS2 Trackball reports SIDE button in the |
| 224 | 224 | * 4th bit of the first byte. |
| 225 | 225 | */ |
| 226 | − input_report_key(dev, BTN_SIDE, BIT(3)); | |
| 226 | + input_report_key(dev, BTN_SIDE, packet[0] & BIT(3)); | |
| 227 | 227 | packet[0] |= BIT(3); |
| 228 | 228 | break; |
| 229 | 229 | |
| @@ -3,6 +3,7 @@ · 2 unmodified lines | ||
| 3 | 3 | # |
| 4 | 4 | config RMI4_CORE |
| 5 | 5 | tristate "Synaptics RMI4 bus support" |
| 6 | + select IRQ_DOMAIN | |
| 6 | 7 | help |
| 7 | 8 | Say Y here if you want to support the Synaptics RMI4 bus. This is |
| 8 | 9 | required for all RMI4 device support. |
| @@ -32,15 +32,15 @@ void rmi_2d_sensor_abs_process(struct rmi_2d_sensor *sensor, · 31 unmodified lines | ||
| 32 | 32 | if (obj->type == RMI_2D_OBJECT_NONE) |
| 33 | 33 | return; |
| 34 | 34 | |
| 35 | − if (axis_align->swap_axes) | |
| 36 | − swap(obj->x, obj->y); | |
| 37 | − | |
| 38 | 35 | if (axis_align->flip_x) |
| 39 | 36 | obj->x = sensor->max_x - obj->x; |
| 40 | 37 | |
| 41 | 38 | if (axis_align->flip_y) |
| 42 | 39 | obj->y = sensor->max_y - obj->y; |
| 43 | 40 | |
| 41 | + if (axis_align->swap_axes) | |
| 42 | + swap(obj->x, obj->y); | |
| 43 | + | |
| 44 | 44 | /* |
| 45 | 45 | * Here checking if X offset or y offset are specified is |
| 46 | 46 | * redundant. We just add the offsets or clip the values. |
| @@ -120,15 +120,15 @@ void rmi_2d_sensor_rel_report(struct rmi_2d_sensor *sensor, int x, int y) · 73 unmodified lines | ||
| 120 | 120 | x = min(RMI_2D_REL_POS_MAX, max(RMI_2D_REL_POS_MIN, (int)x)); |
| 121 | 121 | y = min(RMI_2D_REL_POS_MAX, max(RMI_2D_REL_POS_MIN, (int)y)); |
| 122 | 122 | |
| 123 | − if (axis_align->swap_axes) | |
| 124 | − swap(x, y); | |
| 125 | − | |
| 126 | 123 | if (axis_align->flip_x) |
| 127 | 124 | x = min(RMI_2D_REL_POS_MAX, -x); |
| 128 | 125 | |
| 129 | 126 | if (axis_align->flip_y) |
| 130 | 127 | y = min(RMI_2D_REL_POS_MAX, -y); |
| 131 | 128 | |
| 129 | + if (axis_align->swap_axes) | |
| 130 | + swap(x, y); | |
| 131 | + | |
| 132 | 132 | if (x || y) { |
| 133 | 133 | input_report_rel(sensor->input, REL_X, x); |
| 134 | 134 | input_report_rel(sensor->input, REL_Y, y); |
| @@ -141,17 +141,10 @@ static void rmi_2d_sensor_set_input_params(struct rmi_2d_sensor *sensor) · 6 unmodified lines | ||
| 141 | 141 | struct input_dev *input = sensor->input; |
| 142 | 142 | int res_x; |
| 143 | 143 | int res_y; |
| 144 | + int max_x, max_y; | |
| 144 | 145 | int input_flags = 0; |
| 145 | 146 | |
| 146 | 147 | if (sensor->report_abs) { |
| 147 | − if (sensor->axis_align.swap_axes) { | |
| 148 | − swap(sensor->max_x, sensor->max_y); | |
| 149 | − swap(sensor->axis_align.clip_x_low, | |
| 150 | − sensor->axis_align.clip_y_low); | |
| 151 | − swap(sensor->axis_align.clip_x_high, | |
| 152 | − sensor->axis_align.clip_y_high); | |
| 153 | − } | |
| 154 | − | |
| 155 | 148 | sensor->min_x = sensor->axis_align.clip_x_low; |
| 156 | 149 | if (sensor->axis_align.clip_x_high) |
| 157 | 150 | sensor->max_x = min(sensor->max_x, |
| @@ -163,14 +156,19 @@ static void rmi_2d_sensor_set_input_params(struct rmi_2d_sensor *sensor) · 5 unmodified lines | ||
| 163 | 156 | sensor->axis_align.clip_y_high); |
| 164 | 157 | |
| 165 | 158 | set_bit(EV_ABS, input->evbit); |
| 166 | − input_set_abs_params(input, ABS_MT_POSITION_X, 0, sensor->max_x, | |
| 167 | − 0, 0); | |
| 168 | − input_set_abs_params(input, ABS_MT_POSITION_Y, 0, sensor->max_y, | |
| 169 | − 0, 0); | |
| 159 | + | |
| 160 | + max_x = sensor->max_x; | |
| 161 | + max_y = sensor->max_y; | |
| 162 | + if (sensor->axis_align.swap_axes) | |
| 163 | + swap(max_x, max_y); | |
| 164 | + input_set_abs_params(input, ABS_MT_POSITION_X, 0, max_x, 0, 0); | |
| 165 | + input_set_abs_params(input, ABS_MT_POSITION_Y, 0, max_y, 0, 0); | |
| 170 | 166 | |
| 171 | 167 | if (sensor->x_mm && sensor->y_mm) { |
| 172 | 168 | res_x = (sensor->max_x - sensor->min_x) / sensor->x_mm; |
| 173 | 169 | res_y = (sensor->max_y - sensor->min_y) / sensor->y_mm; |
| 170 | + if (sensor->axis_align.swap_axes) | |
| 171 | + swap(res_x, res_y); | |
| 174 | 172 | |
| 175 | 173 | input_abs_set_res(input, ABS_X, res_x); |
| 176 | 174 | input_abs_set_res(input, ABS_Y, res_y); |
| @@ -9,6 +9,8 @@ · 8 unmodified lines | ||
| 9 | 9 | |
| 10 | 10 | #include <linux/kernel.h> |
| 11 | 11 | #include <linux/device.h> |
| 12 | +#include <linux/irq.h> | |
| 13 | +#include <linux/irqdomain.h> | |
| 12 | 14 | #include <linux/list.h> |
| 13 | 15 | #include <linux/pm.h> |
| 14 | 16 | #include <linux/rmi.h> |
| @@ -167,6 +169,39 @@ static inline void rmi_function_of_probe(struct rmi_function *fn) · 152 unmodified lines | ||
| 167 | 169 | {} |
| 168 | 170 | #endif |
| 169 | 171 | |
| 172 | +static struct irq_chip rmi_irq_chip = { | |
| 173 | + .name = "rmi4", | |
| 174 | +}; | |
| 175 | + | |
| 176 | +static int rmi_create_function_irq(struct rmi_function *fn, | |
| 177 | + struct rmi_function_handler *handler) | |
| 178 | +{ | |
| 179 | + struct rmi_driver_data *drvdata = dev_get_drvdata(&fn->rmi_dev->dev); | |
| 180 | + int i, error; | |
| 181 | + | |
| 182 | + for (i = 0; i < fn->num_of_irqs; i++) { | |
| 183 | + set_bit(fn->irq_pos + i, fn->irq_mask); | |
| 184 | + | |
| 185 | + fn->irq[i] = irq_create_mapping(drvdata->irqdomain, | |
| 186 | + fn->irq_pos + i); | |
| 187 | + | |
| 188 | + irq_set_chip_data(fn->irq[i], fn); | |
| 189 | + irq_set_chip_and_handler(fn->irq[i], &rmi_irq_chip, | |
| 190 | + handle_simple_irq); | |
| 191 | + irq_set_nested_thread(fn->irq[i], 1); | |
| 192 | + | |
| 193 | + error = devm_request_threaded_irq(&fn->dev, fn->irq[i], NULL, | |
| 194 | + handler->attention, IRQF_ONESHOT, | |
| 195 | + dev_name(&fn->dev), fn); | |
| 196 | + if (error) { | |
| 197 | + dev_err(&fn->dev, "Error %d registering IRQ\n", error); | |
| 198 | + return error; | |
| 199 | + } | |
| 200 | + } | |
| 201 | + | |
| 202 | + return 0; | |
| 203 | +} | |
| 204 | + | |
| 170 | 205 | static int rmi_function_probe(struct device *dev) |
| 171 | 206 | { |
| 172 | 207 | struct rmi_function *fn = to_rmi_function(dev); |
| @@ -178,7 +213,14 @@ static int rmi_function_probe(struct device *dev) · 5 unmodified lines | ||
| 178 | 213 | |
| 179 | 214 | if (handler->probe) { |
| 180 | 215 | error = handler->probe(fn); |
| 181 | − return error; | |
| 216 | + if (error) | |
| 217 | + return error; | |
| 218 | + } | |
| 219 | + | |
| 220 | + if (fn->num_of_irqs && handler->attention) { | |
| 221 | + error = rmi_create_function_irq(fn, handler); | |
| 222 | + if (error) | |
| 223 | + return error; | |
| 182 | 224 | } |
| 183 | 225 | |
| 184 | 226 | return 0; |
| @@ -230,12 +272,18 @@ err_put_device: · 45 unmodified lines | ||
| 230 | 272 | |
| 231 | 273 | void rmi_unregister_function(struct rmi_function *fn) |
| 232 | 274 | { |
| 275 | + int i; | |
| 276 | + | |
| 233 | 277 | rmi_dbg(RMI_DEBUG_CORE, &fn->dev, "Unregistering F%02X.\n", |
| 234 | 278 | fn->fd.function_number); |
| 235 | 279 | |
| 236 | 280 | device_del(&fn->dev); |
| 237 | 281 | of_node_put(fn->dev.of_node); |
| 238 | 282 | put_device(&fn->dev); |
| 283 | + | |
| 284 | + for (i = 0; i < fn->num_of_irqs; i++) | |
| 285 | + irq_dispose_mapping(fn->irq[i]); | |
| 286 | + | |
| 239 | 287 | } |
| 240 | 288 | |
| 241 | 289 | /** |
| @@ -14,6 +14,12 @@ · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | struct rmi_device; |
| 16 | 16 | |
| 17 | +/* | |
| 18 | + * The interrupt source count in the function descriptor can represent up to | |
| 19 | + * 6 interrupt sources in the normal manner. | |
| 20 | + */ | |
| 21 | +#define RMI_FN_MAX_IRQS 6 | |
| 22 | + | |
| 17 | 23 | /** |
| 18 | 24 | * struct rmi_function - represents the implementation of an RMI4 |
| 19 | 25 | * function for a particular device (basically, a driver for that RMI4 function) |
| @@ -26,6 +32,7 @@ struct rmi_device; · 6 unmodified lines | ||
| 26 | 32 | * @irq_pos: The position in the irq bitfield this function holds |
| 27 | 33 | * @irq_mask: For convenience, can be used to mask IRQ bits off during ATTN |
| 28 | 34 | * interrupt handling. |
| 35 | + * @irqs: assigned virq numbers (up to num_of_irqs) | |
| 29 | 36 | * |
| 30 | 37 | * @node: entry in device's list of functions |
| 31 | 38 | */ |
| @@ -36,6 +43,7 @@ struct rmi_function { · 4 unmodified lines | ||
| 36 | 43 | struct list_head node; |
| 37 | 44 | |
| 38 | 45 | unsigned int num_of_irqs; |
| 46 | + int irq[RMI_FN_MAX_IRQS]; | |
| 39 | 47 | unsigned int irq_pos; |
| 40 | 48 | unsigned long irq_mask[]; |
| 41 | 49 | }; |
| @@ -76,7 +84,7 @@ struct rmi_function_handler { · 34 unmodified lines | ||
| 76 | 84 | void (*remove)(struct rmi_function *fn); |
| 77 | 85 | int (*config)(struct rmi_function *fn); |
| 78 | 86 | int (*reset)(struct rmi_function *fn); |
| 79 | − int (*attention)(struct rmi_function *fn, unsigned long *irq_bits); | |
| 87 | + irqreturn_t (*attention)(int irq, void *ctx); | |
| 80 | 88 | int (*suspend)(struct rmi_function *fn); |
| 81 | 89 | int (*resume)(struct rmi_function *fn); |
| 82 | 90 | }; |
| @@ -21,6 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #include <linux/pm.h> |
| 22 | 22 | #include <linux/slab.h> |
| 23 | 23 | #include <linux/of.h> |
| 24 | +#include <linux/irqdomain.h> | |
| 24 | 25 | #include <uapi/linux/input.h> |
| 25 | 26 | #include <linux/rmi.h> |
| 26 | 27 | #include "rmi_bus.h" |
| @@ -127,28 +128,11 @@ static int rmi_driver_process_config_requests(struct rmi_device *rmi_dev) · 100 unmodified lines | ||
| 127 | 128 | return 0; |
| 128 | 129 | } |
| 129 | 130 | |
| 130 | −static void process_one_interrupt(struct rmi_driver_data *data, | |
| 131 | − struct rmi_function *fn) | |
| 132 | −{ | |
| 133 | − struct rmi_function_handler *fh; | |
| 134 | − | |
| 135 | − if (!fn || !fn->dev.driver) | |
| 136 | − return; | |
| 137 | − | |
| 138 | − fh = to_rmi_function_handler(fn->dev.driver); | |
| 139 | − if (fh->attention) { | |
| 140 | − bitmap_and(data->fn_irq_bits, data->irq_status, fn->irq_mask, | |
| 141 | − data->irq_count); | |
| 142 | − if (!bitmap_empty(data->fn_irq_bits, data->irq_count)) | |
| 143 | − fh->attention(fn, data->fn_irq_bits); | |
| 144 | − } | |
| 145 | −} | |
| 146 | − | |
| 147 | 131 | static int rmi_process_interrupt_requests(struct rmi_device *rmi_dev) |
| 148 | 132 | { |
| 149 | 133 | struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev); |
| 150 | 134 | struct device *dev = &rmi_dev->dev; |
| 151 | − struct rmi_function *entry; | |
| 135 | + int i; | |
| 152 | 136 | int error; |
| 153 | 137 | |
| 154 | 138 | if (!data) |
| @@ -173,16 +157,8 @@ static int rmi_process_interrupt_requests(struct rmi_device *rmi_dev) · 18 unmodified lines | ||
| 173 | 157 | */ |
| 174 | 158 | mutex_unlock(&data->irq_mutex); |
| 175 | 159 | |
| 176 | − /* | |
| 177 | − * It would be nice to be able to use irq_chip to handle these | |
| 178 | − * nested IRQs. Unfortunately, most of the current customers for | |
| 179 | − * this driver are using older kernels (3.0.x) that don't support | |
| 180 | − * the features required for that. Once they've shifted to more | |
| 181 | − * recent kernels (say, 3.3 and higher), this should be switched to | |
| 182 | − * use irq_chip. | |
| 183 | − */ | |
| 184 | − list_for_each_entry(entry, &data->function_list, node) | |
| 185 | − process_one_interrupt(data, entry); | |
| 160 | + for_each_set_bit(i, data->irq_status, data->irq_count) | |
| 161 | + handle_nested_irq(irq_find_mapping(data->irqdomain, i)); | |
| 186 | 162 | |
| 187 | 163 | if (data->input) |
| 188 | 164 | input_sync(data->input); |
| @@ -1001,9 +977,13 @@ EXPORT_SYMBOL_GPL(rmi_driver_resume); · 812 unmodified lines | ||
| 1001 | 977 | static int rmi_driver_remove(struct device *dev) |
| 1002 | 978 | { |
| 1003 | 979 | struct rmi_device *rmi_dev = to_rmi_device(dev); |
| 980 | + struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev); | |
| 1004 | 981 | |
| 1005 | 982 | rmi_disable_irq(rmi_dev, false); |
| 1006 | 983 | |
| 984 | + irq_domain_remove(data->irqdomain); | |
| 985 | + data->irqdomain = NULL; | |
| 986 | + | |
| 1007 | 987 | rmi_f34_remove_sysfs(rmi_dev); |
| 1008 | 988 | rmi_free_function_list(rmi_dev); |
| 1009 | 989 | |
| @@ -1035,7 +1015,8 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) · 25 unmodified lines | ||
| 1035 | 1015 | { |
| 1036 | 1016 | struct rmi_device *rmi_dev = data->rmi_dev; |
| 1037 | 1017 | struct device *dev = &rmi_dev->dev; |
| 1038 | − int irq_count; | |
| 1018 | + struct fwnode_handle *fwnode = rmi_dev->xport->dev->fwnode; | |
| 1019 | + int irq_count = 0; | |
| 1039 | 1020 | size_t size; |
| 1040 | 1021 | int retval; |
| 1041 | 1022 | |
| @@ -1046,7 +1027,6 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) · 4 unmodified lines | ||
| 1046 | 1027 | * being accessed. |
| 1047 | 1028 | */ |
| 1048 | 1029 | rmi_dbg(RMI_DEBUG_CORE, dev, "%s: Counting IRQs.\n", __func__); |
| 1049 | − irq_count = 0; | |
| 1050 | 1030 | data->bootloader_mode = false; |
| 1051 | 1031 | |
| 1052 | 1032 | retval = rmi_scan_pdt(rmi_dev, &irq_count, rmi_count_irqs); |
| @@ -1058,6 +1038,15 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) · 5 unmodified lines | ||
| 1058 | 1038 | if (data->bootloader_mode) |
| 1059 | 1039 | dev_warn(dev, "Device in bootloader mode.\n"); |
| 1060 | 1040 | |
| 1041 | + /* Allocate and register a linear revmap irq_domain */ | |
| 1042 | + data->irqdomain = irq_domain_create_linear(fwnode, irq_count, | |
| 1043 | + &irq_domain_simple_ops, | |
| 1044 | + data); | |
| 1045 | + if (!data->irqdomain) { | |
| 1046 | + dev_err(&rmi_dev->dev, "Failed to create IRQ domain\n"); | |
| 1047 | + return -ENOMEM; | |
| 1048 | + } | |
| 1049 | + | |
| 1061 | 1050 | data->irq_count = irq_count; |
| 1062 | 1051 | data->num_of_irq_regs = (data->irq_count + 7) / 8; |
| 1063 | 1052 | |
| @@ -1080,10 +1069,9 @@ int rmi_init_functions(struct rmi_driver_data *data) · 16 unmodified lines | ||
| 1080 | 1069 | { |
| 1081 | 1070 | struct rmi_device *rmi_dev = data->rmi_dev; |
| 1082 | 1071 | struct device *dev = &rmi_dev->dev; |
| 1083 | − int irq_count; | |
| 1072 | + int irq_count = 0; | |
| 1084 | 1073 | int retval; |
| 1085 | 1074 | |
| 1086 | − irq_count = 0; | |
| 1087 | 1075 | rmi_dbg(RMI_DEBUG_CORE, dev, "%s: Creating functions.\n", __func__); |
| 1088 | 1076 | retval = rmi_scan_pdt(rmi_dev, &irq_count, rmi_create_function); |
| 1089 | 1077 | if (retval < 0) { |
| @@ -681,9 +681,9 @@ static int rmi_f01_resume(struct rmi_function *fn) · 680 unmodified lines | ||
| 681 | 681 | return 0; |
| 682 | 682 | } |
| 683 | 683 | |
| 684 | −static int rmi_f01_attention(struct rmi_function *fn, | |
| 685 | − unsigned long *irq_bits) | |
| 684 | +static irqreturn_t rmi_f01_attention(int irq, void *ctx) | |
| 686 | 685 | { |
| 686 | + struct rmi_function *fn = ctx; | |
| 687 | 687 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 688 | 688 | int error; |
| 689 | 689 | u8 device_status; |
| @@ -692,7 +692,7 @@ static int rmi_f01_attention(struct rmi_function *fn, · 2 unmodified lines | ||
| 692 | 692 | if (error) { |
| 693 | 693 | dev_err(&fn->dev, |
| 694 | 694 | "Failed to read device status: %d.\n", error); |
| 695 | − return error; | |
| 695 | + return IRQ_RETVAL(error); | |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | if (RMI_F01_STATUS_BOOTLOADER(device_status)) |
| @@ -704,11 +704,11 @@ static int rmi_f01_attention(struct rmi_function *fn, · 5 unmodified lines | ||
| 704 | 704 | error = rmi_dev->driver->reset_handler(rmi_dev); |
| 705 | 705 | if (error) { |
| 706 | 706 | dev_err(&fn->dev, "Device reset failed: %d\n", error); |
| 707 | − return error; | |
| 707 | + return IRQ_RETVAL(error); | |
| 708 | 708 | } |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | − return 0; | |
| 711 | + return IRQ_HANDLED; | |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | struct rmi_function_handler rmi_f01_handler = { |
| @@ -244,8 +244,9 @@ static int rmi_f03_config(struct rmi_function *fn) · 243 unmodified lines | ||
| 244 | 244 | return 0; |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | −static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits) | |
| 247 | +static irqreturn_t rmi_f03_attention(int irq, void *ctx) | |
| 248 | 248 | { |
| 249 | + struct rmi_function *fn = ctx; | |
| 249 | 250 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 250 | 251 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); |
| 251 | 252 | struct f03_data *f03 = dev_get_drvdata(&fn->dev); |
| @@ -262,7 +263,7 @@ static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits) · 10 unmodified lines | ||
| 262 | 263 | /* First grab the data passed by the transport device */ |
| 263 | 264 | if (drvdata->attn_data.size < ob_len) { |
| 264 | 265 | dev_warn(&fn->dev, "F03 interrupted, but data is missing!\n"); |
| 265 | − return 0; | |
| 266 | + return IRQ_HANDLED; | |
| 266 | 267 | } |
| 267 | 268 | |
| 268 | 269 | memcpy(obs, drvdata->attn_data.data, ob_len); |
| @@ -277,7 +278,7 @@ static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits) · 8 unmodified lines | ||
| 277 | 278 | "%s: Failed to read F03 output buffers: %d\n", |
| 278 | 279 | __func__, error); |
| 279 | 280 | serio_interrupt(f03->serio, 0, SERIO_TIMEOUT); |
| 280 | − return error; | |
| 281 | + return IRQ_RETVAL(error); | |
| 281 | 282 | } |
| 282 | 283 | } |
| 283 | 284 | |
| @@ -303,7 +304,7 @@ static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits) · 19 unmodified lines | ||
| 303 | 304 | serio_interrupt(f03->serio, ob_data, serio_flags); |
| 304 | 305 | } |
| 305 | 306 | |
| 306 | − return 0; | |
| 307 | + return IRQ_HANDLED; | |
| 307 | 308 | } |
| 308 | 309 | |
| 309 | 310 | static void rmi_f03_remove(struct rmi_function *fn) |
| @@ -570,9 +570,7 @@ static inline u8 rmi_f11_parse_finger_state(const u8 *f_state, u8 n_finger) · 569 unmodified lines | ||
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | static void rmi_f11_finger_handler(struct f11_data *f11, |
| 573 | − struct rmi_2d_sensor *sensor, | |
| 574 | − unsigned long *irq_bits, int num_irq_regs, | |
| 575 | − int size) | |
| 573 | + struct rmi_2d_sensor *sensor, int size) | |
| 576 | 574 | { |
| 577 | 575 | const u8 *f_state = f11->data.f_state; |
| 578 | 576 | u8 finger_state; |
| @@ -581,12 +579,7 @@ static void rmi_f11_finger_handler(struct f11_data *f11, · 2 unmodified lines | ||
| 581 | 579 | int rel_fingers; |
| 582 | 580 | int abs_size = sensor->nbr_fingers * RMI_F11_ABS_BYTES; |
| 583 | 581 | |
| 584 | − int abs_bits = bitmap_and(f11->result_bits, irq_bits, f11->abs_mask, | |
| 585 | − num_irq_regs * 8); | |
| 586 | − int rel_bits = bitmap_and(f11->result_bits, irq_bits, f11->rel_mask, | |
| 587 | − num_irq_regs * 8); | |
| 588 | − | |
| 589 | − if (abs_bits) { | |
| 582 | + if (sensor->report_abs) { | |
| 590 | 583 | if (abs_size > size) |
| 591 | 584 | abs_fingers = size / RMI_F11_ABS_BYTES; |
| 592 | 585 | else |
| @@ -604,19 +597,7 @@ static void rmi_f11_finger_handler(struct f11_data *f11, · 11 unmodified lines | ||
| 604 | 597 | rmi_f11_abs_pos_process(f11, sensor, &sensor->objs[i], |
| 605 | 598 | finger_state, i); |
| 606 | 599 | } |
| 607 | − } | |
| 608 | 600 | |
| 609 | − if (rel_bits) { | |
| 610 | − if ((abs_size + sensor->nbr_fingers * RMI_F11_REL_BYTES) > size) | |
| 611 | − rel_fingers = (size - abs_size) / RMI_F11_REL_BYTES; | |
| 612 | − else | |
| 613 | − rel_fingers = sensor->nbr_fingers; | |
| 614 | − | |
| 615 | − for (i = 0; i < rel_fingers; i++) | |
| 616 | − rmi_f11_rel_pos_report(f11, i); | |
| 617 | − } | |
| 618 | − | |
| 619 | − if (abs_bits) { | |
| 620 | 601 | /* |
| 621 | 602 | * the absolute part is made in 2 parts to allow the kernel |
| 622 | 603 | * tracking to take place. |
| @@ -638,7 +619,16 @@ static void rmi_f11_finger_handler(struct f11_data *f11, · 15 unmodified lines | ||
| 638 | 619 | } |
| 639 | 620 | |
| 640 | 621 | input_mt_sync_frame(sensor->input); |
| 622 | + } else if (sensor->report_rel) { | |
| 623 | + if ((abs_size + sensor->nbr_fingers * RMI_F11_REL_BYTES) > size) | |
| 624 | + rel_fingers = (size - abs_size) / RMI_F11_REL_BYTES; | |
| 625 | + else | |
| 626 | + rel_fingers = sensor->nbr_fingers; | |
| 627 | + | |
| 628 | + for (i = 0; i < rel_fingers; i++) | |
| 629 | + rmi_f11_rel_pos_report(f11, i); | |
| 641 | 630 | } |
| 631 | + | |
| 642 | 632 | } |
| 643 | 633 | |
| 644 | 634 | static int f11_2d_construct_data(struct f11_data *f11) |
| @@ -1276,8 +1266,9 @@ static int rmi_f11_config(struct rmi_function *fn) · 631 unmodified lines | ||
| 1276 | 1266 | return 0; |
| 1277 | 1267 | } |
| 1278 | 1268 | |
| 1279 | −static int rmi_f11_attention(struct rmi_function *fn, unsigned long *irq_bits) | |
| 1269 | +static irqreturn_t rmi_f11_attention(int irq, void *ctx) | |
| 1280 | 1270 | { |
| 1271 | + struct rmi_function *fn = ctx; | |
| 1281 | 1272 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 1282 | 1273 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); |
| 1283 | 1274 | struct f11_data *f11 = dev_get_drvdata(&fn->dev); |
| @@ -1303,13 +1294,12 @@ static int rmi_f11_attention(struct rmi_function *fn, unsigned long *irq_bits) · 19 unmodified lines | ||
| 1303 | 1294 | data_base_addr, f11->sensor.data_pkt, |
| 1304 | 1295 | f11->sensor.pkt_size); |
| 1305 | 1296 | if (error < 0) |
| 1306 | − return error; | |
| 1297 | + return IRQ_RETVAL(error); | |
| 1307 | 1298 | } |
| 1308 | 1299 | |
| 1309 | − rmi_f11_finger_handler(f11, &f11->sensor, irq_bits, | |
| 1310 | − drvdata->num_of_irq_regs, valid_bytes); | |
| 1300 | + rmi_f11_finger_handler(f11, &f11->sensor, valid_bytes); | |
| 1311 | 1301 | |
| 1312 | − return 0; | |
| 1302 | + return IRQ_HANDLED; | |
| 1313 | 1303 | } |
| 1314 | 1304 | |
| 1315 | 1305 | static int rmi_f11_resume(struct rmi_function *fn) |
| @@ -197,10 +197,10 @@ static void rmi_f12_process_objects(struct f12_data *f12, u8 *data1, int size) · 196 unmodified lines | ||
| 197 | 197 | rmi_2d_sensor_abs_report(sensor, &sensor->objs[i], i); |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | −static int rmi_f12_attention(struct rmi_function *fn, | |
| 201 | − unsigned long *irq_nr_regs) | |
| 200 | +static irqreturn_t rmi_f12_attention(int irq, void *ctx) | |
| 202 | 201 | { |
| 203 | 202 | int retval; |
| 203 | + struct rmi_function *fn = ctx; | |
| 204 | 204 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 205 | 205 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); |
| 206 | 206 | struct f12_data *f12 = dev_get_drvdata(&fn->dev); |
| @@ -222,7 +222,7 @@ static int rmi_f12_attention(struct rmi_function *fn, · 15 unmodified lines | ||
| 222 | 222 | if (retval < 0) { |
| 223 | 223 | dev_err(&fn->dev, "Failed to read object data. Code: %d.\n", |
| 224 | 224 | retval); |
| 225 | − return retval; | |
| 225 | + return IRQ_RETVAL(retval); | |
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
| @@ -232,7 +232,7 @@ static int rmi_f12_attention(struct rmi_function *fn, · 3 unmodified lines | ||
| 232 | 232 | |
| 233 | 233 | input_mt_sync_frame(sensor->input); |
| 234 | 234 | |
| 235 | − return 0; | |
| 235 | + return IRQ_HANDLED; | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | static int rmi_f12_write_control_regs(struct rmi_function *fn) |
| @@ -122,8 +122,9 @@ static void rmi_f30_report_button(struct rmi_function *fn, · 121 unmodified lines | ||
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | −static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) | |
| 125 | +static irqreturn_t rmi_f30_attention(int irq, void *ctx) | |
| 126 | 126 | { |
| 127 | + struct rmi_function *fn = ctx; | |
| 127 | 128 | struct f30_data *f30 = dev_get_drvdata(&fn->dev); |
| 128 | 129 | struct rmi_driver_data *drvdata = dev_get_drvdata(&fn->rmi_dev->dev); |
| 129 | 130 | int error; |
| @@ -134,7 +135,7 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) · 4 unmodified lines | ||
| 134 | 135 | if (drvdata->attn_data.size < f30->register_count) { |
| 135 | 136 | dev_warn(&fn->dev, |
| 136 | 137 | "F30 interrupted, but data is missing\n"); |
| 137 | − return 0; | |
| 138 | + return IRQ_HANDLED; | |
| 138 | 139 | } |
| 139 | 140 | memcpy(f30->data_regs, drvdata->attn_data.data, |
| 140 | 141 | f30->register_count); |
| @@ -147,7 +148,7 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) · 6 unmodified lines | ||
| 147 | 148 | dev_err(&fn->dev, |
| 148 | 149 | "%s: Failed to read F30 data registers: %d\n", |
| 149 | 150 | __func__, error); |
| 150 | − return error; | |
| 151 | + return IRQ_RETVAL(error); | |
| 151 | 152 | } |
| 152 | 153 | } |
| 153 | 154 | |
| @@ -159,7 +160,7 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) · 5 unmodified lines | ||
| 159 | 160 | rmi_f03_commit_buttons(f30->f03); |
| 160 | 161 | } |
| 161 | 162 | |
| 162 | − return 0; | |
| 163 | + return IRQ_HANDLED; | |
| 163 | 164 | } |
| 164 | 165 | |
| 165 | 166 | static int rmi_f30_config(struct rmi_function *fn) |
| @@ -100,8 +100,9 @@ static int rmi_f34_command(struct f34_data *f34, u8 command, · 99 unmodified lines | ||
| 100 | 100 | return 0; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | −static int rmi_f34_attention(struct rmi_function *fn, unsigned long *irq_bits) | |
| 103 | +static irqreturn_t rmi_f34_attention(int irq, void *ctx) | |
| 104 | 104 | { |
| 105 | + struct rmi_function *fn = ctx; | |
| 105 | 106 | struct f34_data *f34 = dev_get_drvdata(&fn->dev); |
| 106 | 107 | int ret; |
| 107 | 108 | u8 status; |
| @@ -126,7 +127,7 @@ static int rmi_f34_attention(struct rmi_function *fn, unsigned long *irq_bits) · 18 unmodified lines | ||
| 126 | 127 | complete(&f34->v7.cmd_done); |
| 127 | 128 | } |
| 128 | 129 | |
| 129 | − return 0; | |
| 130 | + return IRQ_HANDLED; | |
| 130 | 131 | } |
| 131 | 132 | |
| 132 | 133 | static int rmi_f34_write_blocks(struct f34_data *f34, const void *data, |
| @@ -610,11 +610,6 @@ error: · 609 unmodified lines | ||
| 610 | 610 | mutex_unlock(&f54->data_mutex); |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | −static int rmi_f54_attention(struct rmi_function *fn, unsigned long *irqbits) | |
| 614 | −{ | |
| 615 | − return 0; | |
| 616 | −} | |
| 617 | − | |
| 618 | 613 | static int rmi_f54_config(struct rmi_function *fn) |
| 619 | 614 | { |
| 620 | 615 | struct rmi_driver *drv = fn->rmi_dev->driver; |
| @@ -756,6 +751,5 @@ struct rmi_function_handler rmi_f54_handler = { · 135 unmodified lines | ||
| 756 | 751 | .func = 0x54, |
| 757 | 752 | .probe = rmi_f54_probe, |
| 758 | 753 | .config = rmi_f54_config, |
| 759 | − .attention = rmi_f54_attention, | |
| 760 | 754 | .remove = rmi_f54_remove, |
| 761 | 755 | }; |
| @@ -603,6 +603,7 @@ static const struct acpi_device_id silead_ts_acpi_match[] = { · 602 unmodified lines | ||
| 603 | 603 | { "GSL3692", 0 }, |
| 604 | 604 | { "MSSL1680", 0 }, |
| 605 | 605 | { "MSSL0001", 0 }, |
| 606 | + { "MSSL0002", 0 }, | |
| 606 | 607 | { } |
| 607 | 608 | }; |
| 608 | 609 | MODULE_DEVICE_TABLE(acpi, silead_ts_acpi_match); |
| @@ -588,7 +588,7 @@ static const struct proto_ops data_sock_ops = { · 587 unmodified lines | ||
| 588 | 588 | .getname = data_sock_getname, |
| 589 | 589 | .sendmsg = mISDN_sock_sendmsg, |
| 590 | 590 | .recvmsg = mISDN_sock_recvmsg, |
| 591 | − .poll_mask = datagram_poll_mask, | |
| 591 | + .poll = datagram_poll, | |
| 592 | 592 | .listen = sock_no_listen, |
| 593 | 593 | .shutdown = sock_no_shutdown, |
| 594 | 594 | .setsockopt = data_sock_setsockopt, |
| @@ -588,7 +588,7 @@ static const char *raid10_md_layout_to_format(int layout) · 587 unmodified lines | ||
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | /* Return md raid10 algorithm for @name */ |
| 591 | −static const int raid10_name_to_format(const char *name) | |
| 591 | +static int raid10_name_to_format(const char *name) | |
| 592 | 592 | { |
| 593 | 593 | if (!strcasecmp(name, "near")) |
| 594 | 594 | return ALGORITHM_RAID10_NEAR; |
| @@ -885,9 +885,7 @@ EXPORT_SYMBOL_GPL(dm_table_set_type); · 884 unmodified lines | ||
| 885 | 885 | static int device_supports_dax(struct dm_target *ti, struct dm_dev *dev, |
| 886 | 886 | sector_t start, sector_t len, void *data) |
| 887 | 887 | { |
| 888 | − struct request_queue *q = bdev_get_queue(dev->bdev); | |
| 889 | − | |
| 890 | − return q && blk_queue_dax(q); | |
| 888 | + return bdev_dax_supported(dev->bdev, PAGE_SIZE); | |
| 891 | 889 | } |
| 892 | 890 | |
| 893 | 891 | static bool dm_table_supports_dax(struct dm_table *t) |
| @@ -1907,6 +1905,9 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, · 1013 unmodified lines | ||
| 1907 | 1905 | |
| 1908 | 1906 | if (dm_table_supports_dax(t)) |
| 1909 | 1907 | blk_queue_flag_set(QUEUE_FLAG_DAX, q); |
| 1908 | + else | |
| 1909 | + blk_queue_flag_clear(QUEUE_FLAG_DAX, q); | |
| 1910 | + | |
| 1910 | 1911 | if (dm_table_supports_dax_write_cache(t)) |
| 1911 | 1912 | dax_write_cache(t->md->dax_dev, true); |
| 1912 | 1913 | |
| @@ -776,7 +776,6 @@ static int __write_changed_details(struct dm_pool_metadata *pmd) · 775 unmodified lines | ||
| 776 | 776 | static int __commit_transaction(struct dm_pool_metadata *pmd) |
| 777 | 777 | { |
| 778 | 778 | int r; |
| 779 | − size_t metadata_len, data_len; | |
| 780 | 779 | struct thin_disk_superblock *disk_super; |
| 781 | 780 | struct dm_block *sblock; |
| 782 | 781 | |
| @@ -797,14 +796,6 @@ static int __commit_transaction(struct dm_pool_metadata *pmd) · 14 unmodified lines | ||
| 797 | 796 | if (r < 0) |
| 798 | 797 | return r; |
| 799 | 798 | |
| 800 | − r = dm_sm_root_size(pmd->metadata_sm, &metadata_len); | |
| 801 | − if (r < 0) | |
| 802 | − return r; | |
| 803 | − | |
| 804 | − r = dm_sm_root_size(pmd->data_sm, &data_len); | |
| 805 | − if (r < 0) | |
| 806 | − return r; | |
| 807 | − | |
| 808 | 799 | r = save_sm_roots(pmd); |
| 809 | 800 | if (r < 0) |
| 810 | 801 | return r; |
| @@ -1386,6 +1386,8 @@ static void schedule_external_copy(struct thin_c *tc, dm_block_t virt_block, · 1385 unmodified lines | ||
| 1386 | 1386 | |
| 1387 | 1387 | static void set_pool_mode(struct pool *pool, enum pool_mode new_mode); |
| 1388 | 1388 | |
| 1389 | +static void requeue_bios(struct pool *pool); | |
| 1390 | + | |
| 1389 | 1391 | static void check_for_space(struct pool *pool) |
| 1390 | 1392 | { |
| 1391 | 1393 | int r; |
| @@ -1398,8 +1400,10 @@ static void check_for_space(struct pool *pool) · 6 unmodified lines | ||
| 1398 | 1400 | if (r) |
| 1399 | 1401 | return; |
| 1400 | 1402 | |
| 1401 | − if (nr_free) | |
| 1403 | + if (nr_free) { | |
| 1402 | 1404 | set_pool_mode(pool, PM_WRITE); |
| 1405 | + requeue_bios(pool); | |
| 1406 | + } | |
| 1403 | 1407 | } |
| 1404 | 1408 | |
| 1405 | 1409 | /* |
| @@ -1476,7 +1480,10 @@ static int alloc_data_block(struct thin_c *tc, dm_block_t *result) · 70 unmodified lines | ||
| 1476 | 1480 | |
| 1477 | 1481 | r = dm_pool_alloc_data_block(pool->pmd, result); |
| 1478 | 1482 | if (r) { |
| 1479 | − metadata_operation_failed(pool, "dm_pool_alloc_data_block", r); | |
| 1483 | + if (r == -ENOSPC) | |
| 1484 | + set_pool_mode(pool, PM_OUT_OF_DATA_SPACE); | |
| 1485 | + else | |
| 1486 | + metadata_operation_failed(pool, "dm_pool_alloc_data_block", r); | |
| 1480 | 1487 | return r; |
| 1481 | 1488 | } |
| 1482 | 1489 | |
| @@ -259,7 +259,7 @@ static int persistent_memory_claim(struct dm_writecache *wc) · 258 unmodified lines | ||
| 259 | 259 | if (da != p) { |
| 260 | 260 | long i; |
| 261 | 261 | wc->memory_map = NULL; |
| 262 | − pages = kvmalloc(p * sizeof(struct page *), GFP_KERNEL); | |
| 262 | + pages = kvmalloc_array(p, sizeof(struct page *), GFP_KERNEL); | |
| 263 | 263 | if (!pages) { |
| 264 | 264 | r = -ENOMEM; |
| 265 | 265 | goto err2; |
| @@ -859,7 +859,7 @@ static int writecache_alloc_entries(struct dm_writecache *wc) · 593 unmodified lines | ||
| 859 | 859 | |
| 860 | 860 | if (wc->entries) |
| 861 | 861 | return 0; |
| 862 | − wc->entries = vmalloc(sizeof(struct wc_entry) * wc->n_blocks); | |
| 862 | + wc->entries = vmalloc(array_size(sizeof(struct wc_entry), wc->n_blocks)); | |
| 863 | 863 | if (!wc->entries) |
| 864 | 864 | return -ENOMEM; |
| 865 | 865 | for (b = 0; b < wc->n_blocks; b++) { |
| @@ -1481,9 +1481,9 @@ static void __writecache_writeback_pmem(struct dm_writecache *wc, struct writeba · 615 unmodified lines | ||
| 1481 | 1481 | wb->bio.bi_iter.bi_sector = read_original_sector(wc, e); |
| 1482 | 1482 | wb->page_offset = PAGE_SIZE; |
| 1483 | 1483 | if (max_pages <= WB_LIST_INLINE || |
| 1484 | − unlikely(!(wb->wc_list = kmalloc(max_pages * sizeof(struct wc_entry *), | |
| 1485 | − GFP_NOIO | __GFP_NORETRY | | |
| 1486 | − __GFP_NOMEMALLOC | __GFP_NOWARN)))) { | |
| 1484 | + unlikely(!(wb->wc_list = kmalloc_array(max_pages, sizeof(struct wc_entry *), | |
| 1485 | + GFP_NOIO | __GFP_NORETRY | | |
| 1486 | + __GFP_NOMEMALLOC | __GFP_NOWARN)))) { | |
| 1487 | 1487 | wb->wc_list = wb->wc_list_inline; |
| 1488 | 1488 | max_pages = WB_LIST_INLINE; |
| 1489 | 1489 | } |
| @@ -787,7 +787,7 @@ static int dmz_ctr(struct dm_target *ti, unsigned int argc, char **argv) · 786 unmodified lines | ||
| 787 | 787 | |
| 788 | 788 | /* Chunk BIO work */ |
| 789 | 789 | mutex_init(&dmz->chunk_lock); |
| 790 | − INIT_RADIX_TREE(&dmz->chunk_rxtree, GFP_KERNEL); | |
| 790 | + INIT_RADIX_TREE(&dmz->chunk_rxtree, GFP_NOIO); | |
| 791 | 791 | dmz->chunk_wq = alloc_workqueue("dmz_cwq_%s", WQ_MEM_RECLAIM | WQ_UNBOUND, |
| 792 | 792 | 0, dev->name); |
| 793 | 793 | if (!dmz->chunk_wq) { |
| @@ -1056,8 +1056,7 @@ static long dm_dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, · 1055 unmodified lines | ||
| 1056 | 1056 | if (len < 1) |
| 1057 | 1057 | goto out; |
| 1058 | 1058 | nr_pages = min(len, nr_pages); |
| 1059 | − if (ti->type->direct_access) | |
| 1060 | − ret = ti->type->direct_access(ti, pgoff, nr_pages, kaddr, pfn); | |
| 1059 | + ret = ti->type->direct_access(ti, pgoff, nr_pages, kaddr, pfn); | |
| 1061 | 1060 | |
| 1062 | 1061 | out: |
| 1063 | 1062 | dm_put_live_table(md, srcu_idx); |
| @@ -1606,10 +1605,9 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, · 542 unmodified lines | ||
| 1606 | 1605 | * the usage of io->orig_bio in dm_remap_zone_report() |
| 1607 | 1606 | * won't be affected by this reassignment. |
| 1608 | 1607 | */ |
| 1609 | − struct bio *b = bio_clone_bioset(bio, GFP_NOIO, | |
| 1610 | − &md->queue->bio_split); | |
| 1608 | + struct bio *b = bio_split(bio, bio_sectors(bio) - ci.sector_count, | |
| 1609 | + GFP_NOIO, &md->queue->bio_split); | |
| 1611 | 1610 | ci.io->orig_bio = b; |
| 1612 | − bio_advance(bio, (bio_sectors(bio) - ci.sector_count) << 9); | |
| 1613 | 1611 | bio_chain(b, bio); |
| 1614 | 1612 | ret = generic_make_request(bio); |
| 1615 | 1613 | break; |
| @@ -5547,7 +5547,8 @@ int md_run(struct mddev *mddev) · 5546 unmodified lines | ||
| 5547 | 5547 | else |
| 5548 | 5548 | pr_warn("md: personality for level %s is not loaded!\n", |
| 5549 | 5549 | mddev->clevel); |
| 5550 | − return -EINVAL; | |
| 5550 | + err = -EINVAL; | |
| 5551 | + goto abort; | |
| 5551 | 5552 | } |
| 5552 | 5553 | spin_unlock(&pers_lock); |
| 5553 | 5554 | if (mddev->level != pers->level) { |
| @@ -5560,7 +5561,8 @@ int md_run(struct mddev *mddev) · 6 unmodified lines | ||
| 5560 | 5561 | pers->start_reshape == NULL) { |
| 5561 | 5562 | /* This personality cannot handle reshaping... */ |
| 5562 | 5563 | module_put(pers->owner); |
| 5563 | − return -EINVAL; | |
| 5564 | + err = -EINVAL; | |
| 5565 | + goto abort; | |
| 5564 | 5566 | } |
| 5565 | 5567 | |
| 5566 | 5568 | if (pers->sync_request) { |
| @@ -5629,7 +5631,7 @@ int md_run(struct mddev *mddev) · 62 unmodified lines | ||
| 5629 | 5631 | mddev->private = NULL; |
| 5630 | 5632 | module_put(pers->owner); |
| 5631 | 5633 | bitmap_destroy(mddev); |
| 5632 | − return err; | |
| 5634 | + goto abort; | |
| 5633 | 5635 | } |
| 5634 | 5636 | if (mddev->queue) { |
| 5635 | 5637 | bool nonrot = true; |
| @@ -3893,6 +3893,13 @@ static int raid10_run(struct mddev *mddev) · 3892 unmodified lines | ||
| 3893 | 3893 | disk->rdev->saved_raid_disk < 0) |
| 3894 | 3894 | conf->fullsync = 1; |
| 3895 | 3895 | } |
| 3896 | + | |
| 3897 | + if (disk->replacement && | |
| 3898 | + !test_bit(In_sync, &disk->replacement->flags) && | |
| 3899 | + disk->replacement->saved_raid_disk < 0) { | |
| 3900 | + conf->fullsync = 1; | |
| 3901 | + } | |
| 3902 | + | |
| 3896 | 3903 | disk->recovery_disabled = mddev->recovery_disabled - 1; |
| 3897 | 3904 | } |
| 3898 | 3905 | |
| @@ -207,29 +207,19 @@ void lirc_bpf_free(struct rc_dev *rcdev) · 206 unmodified lines | ||
| 207 | 207 | bpf_prog_array_free(rcdev->raw->progs); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | −int lirc_prog_attach(const union bpf_attr *attr) | |
| 210 | +int lirc_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog) | |
| 211 | 211 | { |
| 212 | − struct bpf_prog *prog; | |
| 213 | 212 | struct rc_dev *rcdev; |
| 214 | 213 | int ret; |
| 215 | 214 | |
| 216 | 215 | if (attr->attach_flags) |
| 217 | 216 | return -EINVAL; |
| 218 | 217 | |
| 219 | − prog = bpf_prog_get_type(attr->attach_bpf_fd, | |
| 220 | − BPF_PROG_TYPE_LIRC_MODE2); | |
| 221 | − if (IS_ERR(prog)) | |
| 222 | − return PTR_ERR(prog); | |
| 223 | − | |
| 224 | 218 | rcdev = rc_dev_get_from_fd(attr->target_fd); |
| 225 | − if (IS_ERR(rcdev)) { | |
| 226 | − bpf_prog_put(prog); | |
| 219 | + if (IS_ERR(rcdev)) | |
| 227 | 220 | return PTR_ERR(rcdev); |
| 228 | − } | |
| 229 | 221 | |
| 230 | 222 | ret = lirc_bpf_attach(rcdev, prog); |
| 231 | − if (ret) | |
| 232 | − bpf_prog_put(prog); | |
| 233 | 223 | |
| 234 | 224 | put_device(&rcdev->dev); |
| 235 | 225 | |
| @@ -2526,7 +2526,7 @@ static int cfi_atmel_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) · 2525 unmodified lines | ||
| 2526 | 2526 | |
| 2527 | 2527 | struct ppb_lock { |
| 2528 | 2528 | struct flchip *chip; |
| 2529 | − loff_t offset; | |
| 2529 | + unsigned long adr; | |
| 2530 | 2530 | int locked; |
| 2531 | 2531 | }; |
| 2532 | 2532 | |
| @@ -2544,8 +2544,9 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, · 11 unmodified lines | ||
| 2544 | 2544 | unsigned long timeo; |
| 2545 | 2545 | int ret; |
| 2546 | 2546 | |
| 2547 | + adr += chip->start; | |
| 2547 | 2548 | mutex_lock(&chip->mutex); |
| 2548 | − ret = get_chip(map, chip, adr + chip->start, FL_LOCKING); | |
| 2549 | + ret = get_chip(map, chip, adr, FL_LOCKING); | |
| 2549 | 2550 | if (ret) { |
| 2550 | 2551 | mutex_unlock(&chip->mutex); |
| 2551 | 2552 | return ret; |
| @@ -2563,8 +2564,8 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, · 11 unmodified lines | ||
| 2563 | 2564 | |
| 2564 | 2565 | if (thunk == DO_XXLOCK_ONEBLOCK_LOCK) { |
| 2565 | 2566 | chip->state = FL_LOCKING; |
| 2566 | − map_write(map, CMD(0xA0), chip->start + adr); | |
| 2567 | − map_write(map, CMD(0x00), chip->start + adr); | |
| 2567 | + map_write(map, CMD(0xA0), adr); | |
| 2568 | + map_write(map, CMD(0x00), adr); | |
| 2568 | 2569 | } else if (thunk == DO_XXLOCK_ONEBLOCK_UNLOCK) { |
| 2569 | 2570 | /* |
| 2570 | 2571 | * Unlocking of one specific sector is not supported, so we |
| @@ -2602,7 +2603,7 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, · 31 unmodified lines | ||
| 2602 | 2603 | map_write(map, CMD(0x00), chip->start); |
| 2603 | 2604 | |
| 2604 | 2605 | chip->state = FL_READY; |
| 2605 | − put_chip(map, chip, adr + chip->start); | |
| 2606 | + put_chip(map, chip, adr); | |
| 2606 | 2607 | mutex_unlock(&chip->mutex); |
| 2607 | 2608 | |
| 2608 | 2609 | return ret; |
| @@ -2659,9 +2660,9 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, · 50 unmodified lines | ||
| 2659 | 2660 | * sectors shall be unlocked, so lets keep their locking |
| 2660 | 2661 | * status at "unlocked" (locked=0) for the final re-locking. |
| 2661 | 2662 | */ |
| 2662 | − if ((adr < ofs) || (adr >= (ofs + len))) { | |
| 2663 | + if ((offset < ofs) || (offset >= (ofs + len))) { | |
| 2663 | 2664 | sect[sectors].chip = &cfi->chips[chipnum]; |
| 2664 | − sect[sectors].offset = offset; | |
| 2665 | + sect[sectors].adr = adr; | |
| 2665 | 2666 | sect[sectors].locked = do_ppb_xxlock( |
| 2666 | 2667 | map, &cfi->chips[chipnum], adr, 0, |
| 2667 | 2668 | DO_XXLOCK_ONEBLOCK_GETLOCK); |
| @@ -2675,6 +2676,8 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, · 7 unmodified lines | ||
| 2675 | 2676 | i++; |
| 2676 | 2677 | |
| 2677 | 2678 | if (adr >> cfi->chipshift) { |
| 2679 | + if (offset >= (ofs + len)) | |
| 2680 | + break; | |
| 2678 | 2681 | adr = 0; |
| 2679 | 2682 | chipnum++; |
| 2680 | 2683 | |
| @@ -2705,7 +2708,7 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, · 24 unmodified lines | ||
| 2705 | 2708 | */ |
| 2706 | 2709 | for (i = 0; i < sectors; i++) { |
| 2707 | 2710 | if (sect[i].locked) |
| 2708 | − do_ppb_xxlock(map, sect[i].chip, sect[i].offset, 0, | |
| 2711 | + do_ppb_xxlock(map, sect[i].chip, sect[i].adr, 0, | |
| 2709 | 2712 | DO_XXLOCK_ONEBLOCK_LOCK); |
| 2710 | 2713 | } |
| 2711 | 2714 | |
| @@ -733,8 +733,8 @@ static struct flash_info dataflash_data[] = { · 732 unmodified lines | ||
| 733 | 733 | { "AT45DB642x", 0x1f2800, 8192, 1056, 11, SUP_POW2PS}, |
| 734 | 734 | { "at45db642d", 0x1f2800, 8192, 1024, 10, SUP_POW2PS | IS_POW2PS}, |
| 735 | 735 | |
| 736 | − { "AT45DB641E", 0x1f28000100, 32768, 264, 9, SUP_EXTID | SUP_POW2PS}, | |
| 737 | − { "at45db641e", 0x1f28000100, 32768, 256, 8, SUP_EXTID | SUP_POW2PS | IS_POW2PS}, | |
| 736 | + { "AT45DB641E", 0x1f28000100ULL, 32768, 264, 9, SUP_EXTID | SUP_POW2PS}, | |
| 737 | + { "at45db641e", 0x1f28000100ULL, 32768, 256, 8, SUP_EXTID | SUP_POW2PS | IS_POW2PS}, | |
| 738 | 738 | }; |
| 739 | 739 | |
| 740 | 740 | static struct flash_info *jedec_lookup(struct spi_device *spi, |
| @@ -123,7 +123,11 @@ static int denali_dt_probe(struct platform_device *pdev) · 122 unmodified lines | ||
| 123 | 123 | if (ret) |
| 124 | 124 | return ret; |
| 125 | 125 | |
| 126 | − denali->clk_x_rate = clk_get_rate(dt->clk); | |
| 126 | + /* | |
| 127 | + * Hardcode the clock rate for the backward compatibility. | |
| 128 | + * This works for both SOCFPGA and UniPhier. | |
| 129 | + */ | |
| 130 | + denali->clk_x_rate = 200000000; | |
| 127 | 131 | |
| 128 | 132 | ret = denali_init(denali); |
| 129 | 133 | if (ret) |
| @@ -48,7 +48,7 @@ · 47 unmodified lines | ||
| 48 | 48 | #define NFC_V1_V2_CONFIG (host->regs + 0x0a) |
| 49 | 49 | #define NFC_V1_V2_ECC_STATUS_RESULT (host->regs + 0x0c) |
| 50 | 50 | #define NFC_V1_V2_RSLTMAIN_AREA (host->regs + 0x0e) |
| 51 | −#define NFC_V1_V2_RSLTSPARE_AREA (host->regs + 0x10) | |
| 51 | +#define NFC_V21_RSLTSPARE_AREA (host->regs + 0x10) | |
| 52 | 52 | #define NFC_V1_V2_WRPROT (host->regs + 0x12) |
| 53 | 53 | #define NFC_V1_UNLOCKSTART_BLKADDR (host->regs + 0x14) |
| 54 | 54 | #define NFC_V1_UNLOCKEND_BLKADDR (host->regs + 0x16) |
| @@ -1274,6 +1274,9 @@ static void preset_v2(struct mtd_info *mtd) · 1219 unmodified lines | ||
| 1274 | 1274 | writew(config1, NFC_V1_V2_CONFIG1); |
| 1275 | 1275 | /* preset operation */ |
| 1276 | 1276 | |
| 1277 | + /* spare area size in 16-bit half-words */ | |
| 1278 | + writew(mtd->oobsize / 2, NFC_V21_RSLTSPARE_AREA); | |
| 1279 | + | |
| 1277 | 1280 | /* Unlock the internal RAM Buffer */ |
| 1278 | 1281 | writew(0x2, NFC_V1_V2_CONFIG); |
| 1279 | 1282 | |
| @@ -440,7 +440,7 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs) · 439 unmodified lines | ||
| 440 | 440 | |
| 441 | 441 | for (; page < page_end; page++) { |
| 442 | 442 | res = chip->ecc.read_oob(mtd, chip, page); |
| 443 | − if (res) | |
| 443 | + if (res < 0) | |
| 444 | 444 | return res; |
| 445 | 445 | |
| 446 | 446 | bad = chip->oob_poi[chip->badblockpos]; |
| @@ -17,23 +17,47 @@ · 16 unmodified lines | ||
| 17 | 17 | |
| 18 | 18 | #include <linux/mtd/rawnand.h> |
| 19 | 19 | |
| 20 | +/* | |
| 21 | + * Macronix AC series does not support using SET/GET_FEATURES to change | |
| 22 | + * the timings unlike what is declared in the parameter page. Unflag | |
| 23 | + * this feature to avoid unnecessary downturns. | |
| 24 | + */ | |
| 25 | +static void macronix_nand_fix_broken_get_timings(struct nand_chip *chip) | |
| 26 | +{ | |
| 27 | + unsigned int i; | |
| 28 | + static const char * const broken_get_timings[] = { | |
| 29 | + "MX30LF1G18AC", | |
| 30 | + "MX30LF1G28AC", | |
| 31 | + "MX30LF2G18AC", | |
| 32 | + "MX30LF2G28AC", | |
| 33 | + "MX30LF4G18AC", | |
| 34 | + "MX30LF4G28AC", | |
| 35 | + "MX60LF8G18AC", | |
| 36 | + }; | |
| 37 | + | |
| 38 | + if (!chip->parameters.supports_set_get_features) | |
| 39 | + return; | |
| 40 | + | |
| 41 | + for (i = 0; i < ARRAY_SIZE(broken_get_timings); i++) { | |
| 42 | + if (!strcmp(broken_get_timings[i], chip->parameters.model)) | |
| 43 | + break; | |
| 44 | + } | |
| 45 | + | |
| 46 | + if (i == ARRAY_SIZE(broken_get_timings)) | |
| 47 | + return; | |
| 48 | + | |
| 49 | + bitmap_clear(chip->parameters.get_feature_list, | |
| 50 | + ONFI_FEATURE_ADDR_TIMING_MODE, 1); | |
| 51 | + bitmap_clear(chip->parameters.set_feature_list, | |
| 52 | + ONFI_FEATURE_ADDR_TIMING_MODE, 1); | |
| 53 | +} | |
| 54 | + | |
| 20 | 55 | static int macronix_nand_init(struct nand_chip *chip) |
| 21 | 56 | { |
| 22 | 57 | if (nand_is_slc(chip)) |
| 23 | 58 | chip->bbt_options |= NAND_BBT_SCAN2NDPAGE; |
| 24 | 59 | |
| 25 | − /* | |
| 26 | − * MX30LF2G18AC chip does not support using SET/GET_FEATURES to change | |
| 27 | − * the timings unlike what is declared in the parameter page. Unflag | |
| 28 | − * this feature to avoid unnecessary downturns. | |
| 29 | − */ | |
| 30 | − if (chip->parameters.supports_set_get_features && | |
| 31 | − !strcmp("MX30LF2G18AC", chip->parameters.model)) { | |
| 32 | − bitmap_clear(chip->parameters.get_feature_list, | |
| 33 | − ONFI_FEATURE_ADDR_TIMING_MODE, 1); | |
| 34 | − bitmap_clear(chip->parameters.set_feature_list, | |
| 35 | − ONFI_FEATURE_ADDR_TIMING_MODE, 1); | |
| 36 | − } | |
| 60 | + macronix_nand_fix_broken_get_timings(chip); | |
| 37 | 61 | |
| 38 | 62 | return 0; |
| 39 | 63 | } |
| @@ -66,7 +66,9 @@ static int micron_nand_onfi_init(struct nand_chip *chip) · 65 unmodified lines | ||
| 66 | 66 | |
| 67 | 67 | if (p->supports_set_get_features) { |
| 68 | 68 | set_bit(ONFI_FEATURE_ADDR_READ_RETRY, p->set_feature_list); |
| 69 | + set_bit(ONFI_FEATURE_ON_DIE_ECC, p->set_feature_list); | |
| 69 | 70 | set_bit(ONFI_FEATURE_ADDR_READ_RETRY, p->get_feature_list); |
| 71 | + set_bit(ONFI_FEATURE_ON_DIE_ECC, p->get_feature_list); | |
| 70 | 72 | } |
| 71 | 73 | |
| 72 | 74 | return 0; |
| @@ -1897,13 +1897,19 @@ static int alx_resume(struct device *dev) · 1896 unmodified lines | ||
| 1897 | 1897 | struct pci_dev *pdev = to_pci_dev(dev); |
| 1898 | 1898 | struct alx_priv *alx = pci_get_drvdata(pdev); |
| 1899 | 1899 | struct alx_hw *hw = &alx->hw; |
| 1900 | + int err; | |
| 1900 | 1901 | |
| 1901 | 1902 | alx_reset_phy(hw); |
| 1902 | 1903 | |
| 1903 | 1904 | if (!netif_running(alx->dev)) |
| 1904 | 1905 | return 0; |
| 1905 | 1906 | netif_device_attach(alx->dev); |
| 1906 | − return __alx_open(alx, true); | |
| 1907 | + | |
| 1908 | + rtnl_lock(); | |
| 1909 | + err = __alx_open(alx, true); | |
| 1910 | + rtnl_unlock(); | |
| 1911 | + | |
| 1912 | + return err; | |
| 1907 | 1913 | } |
| 1908 | 1914 | |
| 1909 | 1915 | static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume); |
| @@ -1533,6 +1533,7 @@ struct bnx2x { · 1532 unmodified lines | ||
| 1533 | 1533 | struct link_vars link_vars; |
| 1534 | 1534 | u32 link_cnt; |
| 1535 | 1535 | struct bnx2x_link_report_data last_reported_link; |
| 1536 | + bool force_link_down; | |
| 1536 | 1537 | |
| 1537 | 1538 | struct mdio_if_info mdio; |
| 1538 | 1539 | |
| @@ -1261,6 +1261,11 @@ void __bnx2x_link_report(struct bnx2x *bp) · 1260 unmodified lines | ||
| 1261 | 1261 | { |
| 1262 | 1262 | struct bnx2x_link_report_data cur_data; |
| 1263 | 1263 | |
| 1264 | + if (bp->force_link_down) { | |
| 1265 | + bp->link_vars.link_up = 0; | |
| 1266 | + return; | |
| 1267 | + } | |
| 1268 | + | |
| 1264 | 1269 | /* reread mf_cfg */ |
| 1265 | 1270 | if (IS_PF(bp) && !CHIP_IS_E1(bp)) |
| 1266 | 1271 | bnx2x_read_mf_cfg(bp); |
| @@ -2817,6 +2822,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 1550 unmodified lines | ||
| 2817 | 2822 | bp->pending_max = 0; |
| 2818 | 2823 | } |
| 2819 | 2824 | |
| 2825 | + bp->force_link_down = false; | |
| 2820 | 2826 | if (bp->port.pmf) { |
| 2821 | 2827 | rc = bnx2x_initial_phy_init(bp, load_mode); |
| 2822 | 2828 | if (rc) |
| @@ -10279,6 +10279,12 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work) · 10278 unmodified lines | ||
| 10279 | 10279 | bp->sp_rtnl_state = 0; |
| 10280 | 10280 | smp_mb(); |
| 10281 | 10281 | |
| 10282 | + /* Immediately indicate link as down */ | |
| 10283 | + bp->link_vars.link_up = 0; | |
| 10284 | + bp->force_link_down = true; | |
| 10285 | + netif_carrier_off(bp->dev); | |
| 10286 | + BNX2X_ERR("Indicating link is down due to Tx-timeout\n"); | |
| 10287 | + | |
| 10282 | 10288 | bnx2x_nic_unload(bp, UNLOAD_NORMAL, true); |
| 10283 | 10289 | /* When ret value shows failure of allocation failure, |
| 10284 | 10290 | * the nic is rebooted again. If open still fails, a error |
| @@ -660,7 +660,7 @@ static int cnic_init_id_tbl(struct cnic_id_tbl *id_tbl, u32 size, u32 start_id, · 659 unmodified lines | ||
| 660 | 660 | id_tbl->max = size; |
| 661 | 661 | id_tbl->next = next; |
| 662 | 662 | spin_lock_init(&id_tbl->lock); |
| 663 | − id_tbl->table = kcalloc(DIV_ROUND_UP(size, 32), 4, GFP_KERNEL); | |
| 663 | + id_tbl->table = kcalloc(BITS_TO_LONGS(size), sizeof(long), GFP_KERNEL); | |
| 664 | 664 | if (!id_tbl->table) |
| 665 | 665 | return -ENOMEM; |
| 666 | 666 | |
| @@ -3726,6 +3726,8 @@ static int at91ether_init(struct platform_device *pdev) · 3725 unmodified lines | ||
| 3726 | 3726 | int err; |
| 3727 | 3727 | u32 reg; |
| 3728 | 3728 | |
| 3729 | + bp->queues[0].bp = bp; | |
| 3730 | + | |
| 3729 | 3731 | dev->netdev_ops = &at91ether_netdev_ops; |
| 3730 | 3732 | dev->ethtool_ops = &macb_ethtool_ops; |
| 3731 | 3733 | |
| @@ -125,6 +125,9 @@ MODULE_PARM_DESC(tx_timeout, "The Tx timeout in ms"); · 124 unmodified lines | ||
| 125 | 125 | /* Default alignment for start of data in an Rx FD */ |
| 126 | 126 | #define DPAA_FD_DATA_ALIGNMENT 16 |
| 127 | 127 | |
| 128 | +/* The DPAA requires 256 bytes reserved and mapped for the SGT */ | |
| 129 | +#define DPAA_SGT_SIZE 256 | |
| 130 | + | |
| 128 | 131 | /* Values for the L3R field of the FM Parse Results |
| 129 | 132 | */ |
| 130 | 133 | /* L3 Type field: First IP Present IPv4 */ |
| @@ -1631,8 +1634,8 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv, · 1500 unmodified lines | ||
| 1631 | 1634 | |
| 1632 | 1635 | if (unlikely(qm_fd_get_format(fd) == qm_fd_sg)) { |
| 1633 | 1636 | nr_frags = skb_shinfo(skb)->nr_frags; |
| 1634 | − dma_unmap_single(dev, addr, qm_fd_get_offset(fd) + | |
| 1635 | − sizeof(struct qm_sg_entry) * (1 + nr_frags), | |
| 1637 | + dma_unmap_single(dev, addr, | |
| 1638 | + qm_fd_get_offset(fd) + DPAA_SGT_SIZE, | |
| 1636 | 1639 | dma_dir); |
| 1637 | 1640 | |
| 1638 | 1641 | /* The sgt buffer has been allocated with netdev_alloc_frag(), |
| @@ -1917,8 +1920,7 @@ static int skb_to_sg_fd(struct dpaa_priv *priv, · 278 unmodified lines | ||
| 1917 | 1920 | void *sgt_buf; |
| 1918 | 1921 | |
| 1919 | 1922 | /* get a page frag to store the SGTable */ |
| 1920 | − sz = SKB_DATA_ALIGN(priv->tx_headroom + | |
| 1921 | − sizeof(struct qm_sg_entry) * (1 + nr_frags)); | |
| 1923 | + sz = SKB_DATA_ALIGN(priv->tx_headroom + DPAA_SGT_SIZE); | |
| 1922 | 1924 | sgt_buf = netdev_alloc_frag(sz); |
| 1923 | 1925 | if (unlikely(!sgt_buf)) { |
| 1924 | 1926 | netdev_err(net_dev, "netdev_alloc_frag() failed for size %d\n", |
| @@ -1986,9 +1988,8 @@ static int skb_to_sg_fd(struct dpaa_priv *priv, · 61 unmodified lines | ||
| 1986 | 1988 | skbh = (struct sk_buff **)buffer_start; |
| 1987 | 1989 | *skbh = skb; |
| 1988 | 1990 | |
| 1989 | − addr = dma_map_single(dev, buffer_start, priv->tx_headroom + | |
| 1990 | − sizeof(struct qm_sg_entry) * (1 + nr_frags), | |
| 1991 | − dma_dir); | |
| 1991 | + addr = dma_map_single(dev, buffer_start, | |
| 1992 | + priv->tx_headroom + DPAA_SGT_SIZE, dma_dir); | |
| 1992 | 1993 | if (unlikely(dma_mapping_error(dev, addr))) { |
| 1993 | 1994 | dev_err(dev, "DMA mapping failed"); |
| 1994 | 1995 | err = -EINVAL; |
| @@ -324,6 +324,10 @@ struct fman_port_qmi_regs { · 323 unmodified lines | ||
| 324 | 324 | #define HWP_HXS_PHE_REPORT 0x00000800 |
| 325 | 325 | #define HWP_HXS_PCAC_PSTAT 0x00000100 |
| 326 | 326 | #define HWP_HXS_PCAC_PSTOP 0x00000001 |
| 327 | +#define HWP_HXS_TCP_OFFSET 0xA | |
| 328 | +#define HWP_HXS_UDP_OFFSET 0xB | |
| 329 | +#define HWP_HXS_SH_PAD_REM 0x80000000 | |
| 330 | + | |
| 327 | 331 | struct fman_port_hwp_regs { |
| 328 | 332 | struct { |
| 329 | 333 | u32 ssa; /* Soft Sequence Attachment */ |
| @@ -728,6 +732,10 @@ static void init_hwp(struct fman_port *port) · 398 unmodified lines | ||
| 728 | 732 | iowrite32be(0xffffffff, ®s->pmda[i].lcv); |
| 729 | 733 | } |
| 730 | 734 | |
| 735 | + /* Short packet padding removal from checksum calculation */ | |
| 736 | + iowrite32be(HWP_HXS_SH_PAD_REM, ®s->pmda[HWP_HXS_TCP_OFFSET].ssa); | |
| 737 | + iowrite32be(HWP_HXS_SH_PAD_REM, ®s->pmda[HWP_HXS_UDP_OFFSET].ssa); | |
| 738 | + | |
| 731 | 739 | start_port_hwp(port); |
| 732 | 740 | } |
| 733 | 741 | |
| @@ -439,6 +439,7 @@ static void rx_free_irq(struct hinic_rxq *rxq) · 438 unmodified lines | ||
| 439 | 439 | { |
| 440 | 440 | struct hinic_rq *rq = rxq->rq; |
| 441 | 441 | |
| 442 | + irq_set_affinity_hint(rq->irq, NULL); | |
| 442 | 443 | free_irq(rq->irq, rxq); |
| 443 | 444 | rx_del_napi(rxq); |
| 444 | 445 | } |
| @@ -2199,9 +2199,10 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring, · 2198 unmodified lines | ||
| 2199 | 2199 | return true; |
| 2200 | 2200 | } |
| 2201 | 2201 | |
| 2202 | −#define I40E_XDP_PASS 0 | |
| 2203 | −#define I40E_XDP_CONSUMED 1 | |
| 2204 | −#define I40E_XDP_TX 2 | |
| 2202 | +#define I40E_XDP_PASS 0 | |
| 2203 | +#define I40E_XDP_CONSUMED BIT(0) | |
| 2204 | +#define I40E_XDP_TX BIT(1) | |
| 2205 | +#define I40E_XDP_REDIR BIT(2) | |
| 2205 | 2206 | |
| 2206 | 2207 | static int i40e_xmit_xdp_ring(struct xdp_frame *xdpf, |
| 2207 | 2208 | struct i40e_ring *xdp_ring); |
| @@ -2248,7 +2249,7 @@ static struct sk_buff *i40e_run_xdp(struct i40e_ring *rx_ring, · 40 unmodified lines | ||
| 2248 | 2249 | break; |
| 2249 | 2250 | case XDP_REDIRECT: |
| 2250 | 2251 | err = xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog); |
| 2251 | − result = !err ? I40E_XDP_TX : I40E_XDP_CONSUMED; | |
| 2252 | + result = !err ? I40E_XDP_REDIR : I40E_XDP_CONSUMED; | |
| 2252 | 2253 | break; |
| 2253 | 2254 | default: |
| 2254 | 2255 | bpf_warn_invalid_xdp_action(act); |
| @@ -2311,7 +2312,8 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) · 56 unmodified lines | ||
| 2311 | 2312 | unsigned int total_rx_bytes = 0, total_rx_packets = 0; |
| 2312 | 2313 | struct sk_buff *skb = rx_ring->skb; |
| 2313 | 2314 | u16 cleaned_count = I40E_DESC_UNUSED(rx_ring); |
| 2314 | − bool failure = false, xdp_xmit = false; | |
| 2315 | + unsigned int xdp_xmit = 0; | |
| 2316 | + bool failure = false; | |
| 2315 | 2317 | struct xdp_buff xdp; |
| 2316 | 2318 | |
| 2317 | 2319 | xdp.rxq = &rx_ring->xdp_rxq; |
| @@ -2372,8 +2374,10 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) · 54 unmodified lines | ||
| 2372 | 2374 | } |
| 2373 | 2375 | |
| 2374 | 2376 | if (IS_ERR(skb)) { |
| 2375 | − if (PTR_ERR(skb) == -I40E_XDP_TX) { | |
| 2376 | − xdp_xmit = true; | |
| 2377 | + unsigned int xdp_res = -PTR_ERR(skb); | |
| 2378 | + | |
| 2379 | + if (xdp_res & (I40E_XDP_TX | I40E_XDP_REDIR)) { | |
| 2380 | + xdp_xmit |= xdp_res; | |
| 2377 | 2381 | i40e_rx_buffer_flip(rx_ring, rx_buffer, size); |
| 2378 | 2382 | } else { |
| 2379 | 2383 | rx_buffer->pagecnt_bias++; |
| @@ -2427,12 +2431,14 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) · 47 unmodified lines | ||
| 2427 | 2431 | total_rx_packets++; |
| 2428 | 2432 | } |
| 2429 | 2433 | |
| 2430 | − if (xdp_xmit) { | |
| 2434 | + if (xdp_xmit & I40E_XDP_REDIR) | |
| 2435 | + xdp_do_flush_map(); | |
| 2436 | + | |
| 2437 | + if (xdp_xmit & I40E_XDP_TX) { | |
| 2431 | 2438 | struct i40e_ring *xdp_ring = |
| 2432 | 2439 | rx_ring->vsi->xdp_rings[rx_ring->queue_index]; |
| 2433 | 2440 | |
| 2434 | 2441 | i40e_xdp_ring_update_tail(xdp_ring); |
| 2435 | − xdp_do_flush_map(); | |
| 2436 | 2442 | } |
| 2437 | 2443 | |
| 2438 | 2444 | rx_ring->skb = skb; |
| @@ -2186,9 +2186,10 @@ static struct sk_buff *ixgbe_build_skb(struct ixgbe_ring *rx_ring, · 2185 unmodified lines | ||
| 2186 | 2186 | return skb; |
| 2187 | 2187 | } |
| 2188 | 2188 | |
| 2189 | −#define IXGBE_XDP_PASS 0 | |
| 2190 | −#define IXGBE_XDP_CONSUMED 1 | |
| 2191 | −#define IXGBE_XDP_TX 2 | |
| 2189 | +#define IXGBE_XDP_PASS 0 | |
| 2190 | +#define IXGBE_XDP_CONSUMED BIT(0) | |
| 2191 | +#define IXGBE_XDP_TX BIT(1) | |
| 2192 | +#define IXGBE_XDP_REDIR BIT(2) | |
| 2192 | 2193 | |
| 2193 | 2194 | static int ixgbe_xmit_xdp_ring(struct ixgbe_adapter *adapter, |
| 2194 | 2195 | struct xdp_frame *xdpf); |
| @@ -2225,7 +2226,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter, · 30 unmodified lines | ||
| 2225 | 2226 | case XDP_REDIRECT: |
| 2226 | 2227 | err = xdp_do_redirect(adapter->netdev, xdp, xdp_prog); |
| 2227 | 2228 | if (!err) |
| 2228 | − result = IXGBE_XDP_TX; | |
| 2229 | + result = IXGBE_XDP_REDIR; | |
| 2229 | 2230 | else |
| 2230 | 2231 | result = IXGBE_XDP_CONSUMED; |
| 2231 | 2232 | break; |
| @@ -2285,7 +2286,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, · 53 unmodified lines | ||
| 2285 | 2286 | unsigned int mss = 0; |
| 2286 | 2287 | #endif /* IXGBE_FCOE */ |
| 2287 | 2288 | u16 cleaned_count = ixgbe_desc_unused(rx_ring); |
| 2288 | − bool xdp_xmit = false; | |
| 2289 | + unsigned int xdp_xmit = 0; | |
| 2289 | 2290 | struct xdp_buff xdp; |
| 2290 | 2291 | |
| 2291 | 2292 | xdp.rxq = &rx_ring->xdp_rxq; |
| @@ -2328,8 +2329,10 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, · 36 unmodified lines | ||
| 2328 | 2329 | } |
| 2329 | 2330 | |
| 2330 | 2331 | if (IS_ERR(skb)) { |
| 2331 | − if (PTR_ERR(skb) == -IXGBE_XDP_TX) { | |
| 2332 | − xdp_xmit = true; | |
| 2332 | + unsigned int xdp_res = -PTR_ERR(skb); | |
| 2333 | + | |
| 2334 | + if (xdp_res & (IXGBE_XDP_TX | IXGBE_XDP_REDIR)) { | |
| 2335 | + xdp_xmit |= xdp_res; | |
| 2333 | 2336 | ixgbe_rx_buffer_flip(rx_ring, rx_buffer, size); |
| 2334 | 2337 | } else { |
| 2335 | 2338 | rx_buffer->pagecnt_bias++; |
| @@ -2401,7 +2404,10 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, · 65 unmodified lines | ||
| 2401 | 2404 | total_rx_packets++; |
| 2402 | 2405 | } |
| 2403 | 2406 | |
| 2404 | − if (xdp_xmit) { | |
| 2407 | + if (xdp_xmit & IXGBE_XDP_REDIR) | |
| 2408 | + xdp_do_flush_map(); | |
| 2409 | + | |
| 2410 | + if (xdp_xmit & IXGBE_XDP_TX) { | |
| 2405 | 2411 | struct ixgbe_ring *ring = adapter->xdp_ring[smp_processor_id()]; |
| 2406 | 2412 | |
| 2407 | 2413 | /* Force memory writes to complete before letting h/w |
| @@ -2409,8 +2415,6 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, · 1 unmodified line | ||
| 2409 | 2415 | */ |
| 2410 | 2416 | wmb(); |
| 2411 | 2417 | writel(ring->next_to_use, ring->tail); |
| 2412 | − | |
| 2413 | − xdp_do_flush_map(); | |
| 2414 | 2418 | } |
| 2415 | 2419 | |
| 2416 | 2420 | u64_stats_update_begin(&rx_ring->syncp); |
| @@ -807,6 +807,7 @@ static void cmd_work_handler(struct work_struct *work) · 806 unmodified lines | ||
| 807 | 807 | unsigned long flags; |
| 808 | 808 | bool poll_cmd = ent->polling; |
| 809 | 809 | int alloc_ret; |
| 810 | + int cmd_mode; | |
| 810 | 811 | |
| 811 | 812 | sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem; |
| 812 | 813 | down(sem); |
| @@ -853,6 +854,7 @@ static void cmd_work_handler(struct work_struct *work) · 40 unmodified lines | ||
| 853 | 854 | set_signature(ent, !cmd->checksum_disabled); |
| 854 | 855 | dump_command(dev, ent, 1); |
| 855 | 856 | ent->ts1 = ktime_get_ns(); |
| 857 | + cmd_mode = cmd->mode; | |
| 856 | 858 | |
| 857 | 859 | if (ent->callback) |
| 858 | 860 | schedule_delayed_work(&ent->cb_timeout_work, cb_timeout); |
| @@ -877,7 +879,7 @@ static void cmd_work_handler(struct work_struct *work) · 18 unmodified lines | ||
| 877 | 879 | iowrite32be(1 << ent->idx, &dev->iseg->cmd_dbell); |
| 878 | 880 | mmiowb(); |
| 879 | 881 | /* if not in polling don't use ent after this point */ |
| 880 | − if (cmd->mode == CMD_MODE_POLLING || poll_cmd) { | |
| 882 | + if (cmd_mode == CMD_MODE_POLLING || poll_cmd) { | |
| 881 | 883 | poll_timeout(ent); |
| 882 | 884 | /* make sure we read the descriptor after ownership is SW */ |
| 883 | 885 | rmb(); |
| @@ -1276,7 +1278,7 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf, · 392 unmodified lines | ||
| 1276 | 1278 | { |
| 1277 | 1279 | struct mlx5_core_dev *dev = filp->private_data; |
| 1278 | 1280 | struct mlx5_cmd_debug *dbg = &dev->cmd.dbg; |
| 1279 | − char outlen_str[8]; | |
| 1281 | + char outlen_str[8] = {0}; | |
| 1280 | 1282 | int outlen; |
| 1281 | 1283 | void *ptr; |
| 1282 | 1284 | int err; |
| @@ -1291,8 +1293,6 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf, · 8 unmodified lines | ||
| 1291 | 1293 | if (copy_from_user(outlen_str, buf, count)) |
| 1292 | 1294 | return -EFAULT; |
| 1293 | 1295 | |
| 1294 | − outlen_str[7] = 0; | |
| 1295 | − | |
| 1296 | 1296 | err = sscanf(outlen_str, "%d", &outlen); |
| 1297 | 1297 | if (err < 0) |
| 1298 | 1298 | return err; |
| @@ -2843,7 +2843,7 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv) · 2842 unmodified lines | ||
| 2843 | 2843 | mlx5e_activate_channels(&priv->channels); |
| 2844 | 2844 | netif_tx_start_all_queues(priv->netdev); |
| 2845 | 2845 | |
| 2846 | − if (MLX5_VPORT_MANAGER(priv->mdev)) | |
| 2846 | + if (MLX5_ESWITCH_MANAGER(priv->mdev)) | |
| 2847 | 2847 | mlx5e_add_sqs_fwd_rules(priv); |
| 2848 | 2848 | |
| 2849 | 2849 | mlx5e_wait_channels_min_rx_wqes(&priv->channels); |
| @@ -2854,7 +2854,7 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv) · 4 unmodified lines | ||
| 2854 | 2854 | { |
| 2855 | 2855 | mlx5e_redirect_rqts_to_drop(priv); |
| 2856 | 2856 | |
| 2857 | − if (MLX5_VPORT_MANAGER(priv->mdev)) | |
| 2857 | + if (MLX5_ESWITCH_MANAGER(priv->mdev)) | |
| 2858 | 2858 | mlx5e_remove_sqs_fwd_rules(priv); |
| 2859 | 2859 | |
| 2860 | 2860 | /* FIXME: This is a W/A only for tx timeout watch dog false alarm when |
| @@ -4600,7 +4600,7 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) · 1739 unmodified lines | ||
| 4600 | 4600 | mlx5e_set_netdev_dev_addr(netdev); |
| 4601 | 4601 | |
| 4602 | 4602 | #if IS_ENABLED(CONFIG_MLX5_ESWITCH) |
| 4603 | − if (MLX5_VPORT_MANAGER(mdev)) | |
| 4603 | + if (MLX5_ESWITCH_MANAGER(mdev)) | |
| 4604 | 4604 | netdev->switchdev_ops = &mlx5e_switchdev_ops; |
| 4605 | 4605 | #endif |
| 4606 | 4606 | |
| @@ -4756,7 +4756,7 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv) · 149 unmodified lines | ||
| 4756 | 4756 | |
| 4757 | 4757 | mlx5e_enable_async_events(priv); |
| 4758 | 4758 | |
| 4759 | − if (MLX5_VPORT_MANAGER(priv->mdev)) | |
| 4759 | + if (MLX5_ESWITCH_MANAGER(priv->mdev)) | |
| 4760 | 4760 | mlx5e_register_vport_reps(priv); |
| 4761 | 4761 | |
| 4762 | 4762 | if (netdev->reg_state != NETREG_REGISTERED) |
| @@ -4791,7 +4791,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv) · 28 unmodified lines | ||
| 4791 | 4791 | |
| 4792 | 4792 | queue_work(priv->wq, &priv->set_rx_mode_work); |
| 4793 | 4793 | |
| 4794 | − if (MLX5_VPORT_MANAGER(priv->mdev)) | |
| 4794 | + if (MLX5_ESWITCH_MANAGER(priv->mdev)) | |
| 4795 | 4795 | mlx5e_unregister_vport_reps(priv); |
| 4796 | 4796 | |
| 4797 | 4797 | mlx5e_disable_async_events(priv); |
| @@ -4975,7 +4975,7 @@ static void *mlx5e_add(struct mlx5_core_dev *mdev) · 177 unmodified lines | ||
| 4975 | 4975 | return NULL; |
| 4976 | 4976 | |
| 4977 | 4977 | #ifdef CONFIG_MLX5_ESWITCH |
| 4978 | − if (MLX5_VPORT_MANAGER(mdev)) { | |
| 4978 | + if (MLX5_ESWITCH_MANAGER(mdev)) { | |
| 4979 | 4979 | rpriv = mlx5e_alloc_nic_rep_priv(mdev); |
| 4980 | 4980 | if (!rpriv) { |
| 4981 | 4981 | mlx5_core_warn(mdev, "Failed to alloc NIC rep priv data\n"); |
| @@ -823,7 +823,7 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv) · 822 unmodified lines | ||
| 823 | 823 | struct mlx5e_rep_priv *rpriv = priv->ppriv; |
| 824 | 824 | struct mlx5_eswitch_rep *rep; |
| 825 | 825 | |
| 826 | − if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager)) | |
| 826 | + if (!MLX5_ESWITCH_MANAGER(priv->mdev)) | |
| 827 | 827 | return false; |
| 828 | 828 | |
| 829 | 829 | rep = rpriv->rep; |
| @@ -837,8 +837,12 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv) · 7 unmodified lines | ||
| 837 | 837 | static bool mlx5e_is_vf_vport_rep(struct mlx5e_priv *priv) |
| 838 | 838 | { |
| 839 | 839 | struct mlx5e_rep_priv *rpriv = priv->ppriv; |
| 840 | − struct mlx5_eswitch_rep *rep = rpriv->rep; | |
| 840 | + struct mlx5_eswitch_rep *rep; | |
| 841 | 841 | |
| 842 | + if (!MLX5_ESWITCH_MANAGER(priv->mdev)) | |
| 843 | + return false; | |
| 844 | + | |
| 845 | + rep = rpriv->rep; | |
| 842 | 846 | if (rep && rep->vport != FDB_UPLINK_VPORT) |
| 843 | 847 | return true; |
| 844 | 848 | |
| @@ -1594,17 +1594,15 @@ static void esw_disable_vport(struct mlx5_eswitch *esw, int vport_num) · 1593 unmodified lines | ||
| 1594 | 1594 | } |
| 1595 | 1595 | |
| 1596 | 1596 | /* Public E-Switch API */ |
| 1597 | −#define ESW_ALLOWED(esw) ((esw) && MLX5_VPORT_MANAGER((esw)->dev)) | |
| 1597 | +#define ESW_ALLOWED(esw) ((esw) && MLX5_ESWITCH_MANAGER((esw)->dev)) | |
| 1598 | + | |
| 1598 | 1599 | |
| 1599 | 1600 | int mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs, int mode) |
| 1600 | 1601 | { |
| 1601 | 1602 | int err; |
| 1602 | 1603 | int i, enabled_events; |
| 1603 | 1604 | |
| 1604 | − if (!ESW_ALLOWED(esw)) | |
| 1605 | − return 0; | |
| 1606 | − | |
| 1607 | − if (!MLX5_CAP_GEN(esw->dev, eswitch_flow_table) || | |
| 1605 | + if (!ESW_ALLOWED(esw) || | |
| 1608 | 1606 | !MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, ft_support)) { |
| 1609 | 1607 | esw_warn(esw->dev, "E-Switch FDB is not supported, aborting ...\n"); |
| 1610 | 1608 | return -EOPNOTSUPP; |
| @@ -1806,7 +1804,7 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw, · 195 unmodified lines | ||
| 1806 | 1804 | u64 node_guid; |
| 1807 | 1805 | int err = 0; |
| 1808 | 1806 | |
| 1809 | − if (!ESW_ALLOWED(esw)) | |
| 1807 | + if (!MLX5_CAP_GEN(esw->dev, vport_group_manager)) | |
| 1810 | 1808 | return -EPERM; |
| 1811 | 1809 | if (!LEGAL_VPORT(esw, vport) || is_multicast_ether_addr(mac)) |
| 1812 | 1810 | return -EINVAL; |
| @@ -1883,7 +1881,7 @@ int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw, · 70 unmodified lines | ||
| 1883 | 1881 | { |
| 1884 | 1882 | struct mlx5_vport *evport; |
| 1885 | 1883 | |
| 1886 | − if (!ESW_ALLOWED(esw)) | |
| 1884 | + if (!MLX5_CAP_GEN(esw->dev, vport_group_manager)) | |
| 1887 | 1885 | return -EPERM; |
| 1888 | 1886 | if (!LEGAL_VPORT(esw, vport)) |
| 1889 | 1887 | return -EINVAL; |
| @@ -1079,8 +1079,8 @@ static int mlx5_devlink_eswitch_check(struct devlink *devlink) · 1078 unmodified lines | ||
| 1079 | 1079 | if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH) |
| 1080 | 1080 | return -EOPNOTSUPP; |
| 1081 | 1081 | |
| 1082 | − if (!MLX5_CAP_GEN(dev, vport_group_manager)) | |
| 1083 | − return -EOPNOTSUPP; | |
| 1082 | + if(!MLX5_ESWITCH_MANAGER(dev)) | |
| 1083 | + return -EPERM; | |
| 1084 | 1084 | |
| 1085 | 1085 | if (dev->priv.eswitch->mode == SRIOV_NONE) |
| 1086 | 1086 | return -EOPNOTSUPP; |
| @@ -32,6 +32,7 @@ · 31 unmodified lines | ||
| 32 | 32 | |
| 33 | 33 | #include <linux/mutex.h> |
| 34 | 34 | #include <linux/mlx5/driver.h> |
| 35 | +#include <linux/mlx5/eswitch.h> | |
| 35 | 36 | |
| 36 | 37 | #include "mlx5_core.h" |
| 37 | 38 | #include "fs_core.h" |
| @@ -2652,7 +2653,7 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) · 2614 unmodified lines | ||
| 2652 | 2653 | goto err; |
| 2653 | 2654 | } |
| 2654 | 2655 | |
| 2655 | − if (MLX5_CAP_GEN(dev, eswitch_flow_table)) { | |
| 2656 | + if (MLX5_ESWITCH_MANAGER(dev)) { | |
| 2656 | 2657 | if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, ft_support)) { |
| 2657 | 2658 | err = init_fdb_root_ns(steering); |
| 2658 | 2659 | if (err) |
| @@ -32,6 +32,7 @@ · 31 unmodified lines | ||
| 32 | 32 | |
| 33 | 33 | #include <linux/mlx5/driver.h> |
| 34 | 34 | #include <linux/mlx5/cmd.h> |
| 35 | +#include <linux/mlx5/eswitch.h> | |
| 35 | 36 | #include <linux/module.h> |
| 36 | 37 | #include "mlx5_core.h" |
| 37 | 38 | #include "../../mlxfw/mlxfw.h" |
| @@ -159,13 +160,13 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev) · 121 unmodified lines | ||
| 159 | 160 | } |
| 160 | 161 | |
| 161 | 162 | if (MLX5_CAP_GEN(dev, vport_group_manager) && |
| 162 | − MLX5_CAP_GEN(dev, eswitch_flow_table)) { | |
| 163 | + MLX5_ESWITCH_MANAGER(dev)) { | |
| 163 | 164 | err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH_FLOW_TABLE); |
| 164 | 165 | if (err) |
| 165 | 166 | return err; |
| 166 | 167 | } |
| 167 | 168 | |
| 168 | − if (MLX5_CAP_GEN(dev, eswitch_flow_table)) { | |
| 169 | + if (MLX5_ESWITCH_MANAGER(dev)) { | |
| 169 | 170 | err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH); |
| 170 | 171 | if (err) |
| 171 | 172 | return err; |
| @@ -33,6 +33,7 @@ · 32 unmodified lines | ||
| 33 | 33 | #include <linux/etherdevice.h> |
| 34 | 34 | #include <linux/mlx5/driver.h> |
| 35 | 35 | #include <linux/mlx5/mlx5_ifc.h> |
| 36 | +#include <linux/mlx5/eswitch.h> | |
| 36 | 37 | #include "mlx5_core.h" |
| 37 | 38 | #include "lib/mpfs.h" |
| 38 | 39 | |
| @@ -98,7 +99,7 @@ int mlx5_mpfs_init(struct mlx5_core_dev *dev) · 59 unmodified lines | ||
| 98 | 99 | int l2table_size = 1 << MLX5_CAP_GEN(dev, log_max_l2_table); |
| 99 | 100 | struct mlx5_mpfs *mpfs; |
| 100 | 101 | |
| 101 | − if (!MLX5_VPORT_MANAGER(dev)) | |
| 102 | + if (!MLX5_ESWITCH_MANAGER(dev)) | |
| 102 | 103 | return 0; |
| 103 | 104 | |
| 104 | 105 | mpfs = kzalloc(sizeof(*mpfs), GFP_KERNEL); |
| @@ -122,7 +123,7 @@ void mlx5_mpfs_cleanup(struct mlx5_core_dev *dev) · 17 unmodified lines | ||
| 122 | 123 | { |
| 123 | 124 | struct mlx5_mpfs *mpfs = dev->priv.mpfs; |
| 124 | 125 | |
| 125 | − if (!MLX5_VPORT_MANAGER(dev)) | |
| 126 | + if (!MLX5_ESWITCH_MANAGER(dev)) | |
| 126 | 127 | return; |
| 127 | 128 | |
| 128 | 129 | WARN_ON(!hlist_empty(mpfs->hash)); |
| @@ -137,7 +138,7 @@ int mlx5_mpfs_add_mac(struct mlx5_core_dev *dev, u8 *mac) · 8 unmodified lines | ||
| 137 | 138 | u32 index; |
| 138 | 139 | int err; |
| 139 | 140 | |
| 140 | − if (!MLX5_VPORT_MANAGER(dev)) | |
| 141 | + if (!MLX5_ESWITCH_MANAGER(dev)) | |
| 141 | 142 | return 0; |
| 142 | 143 | |
| 143 | 144 | mutex_lock(&mpfs->lock); |
| @@ -179,7 +180,7 @@ int mlx5_mpfs_del_mac(struct mlx5_core_dev *dev, u8 *mac) · 35 unmodified lines | ||
| 179 | 180 | int err = 0; |
| 180 | 181 | u32 index; |
| 181 | 182 | |
| 182 | − if (!MLX5_VPORT_MANAGER(dev)) | |
| 183 | + if (!MLX5_ESWITCH_MANAGER(dev)) | |
| 183 | 184 | return 0; |
| 184 | 185 | |
| 185 | 186 | mutex_lock(&mpfs->lock); |
| @@ -701,7 +701,7 @@ EXPORT_SYMBOL_GPL(mlx5_query_port_prio_tc); · 700 unmodified lines | ||
| 701 | 701 | static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in, |
| 702 | 702 | int inlen) |
| 703 | 703 | { |
| 704 | − u32 out[MLX5_ST_SZ_DW(qtct_reg)]; | |
| 704 | + u32 out[MLX5_ST_SZ_DW(qetc_reg)]; | |
| 705 | 705 | |
| 706 | 706 | if (!MLX5_CAP_GEN(mdev, ets)) |
| 707 | 707 | return -EOPNOTSUPP; |
| @@ -713,7 +713,7 @@ static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in, · 5 unmodified lines | ||
| 713 | 713 | static int mlx5_query_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *out, |
| 714 | 714 | int outlen) |
| 715 | 715 | { |
| 716 | − u32 in[MLX5_ST_SZ_DW(qtct_reg)]; | |
| 716 | + u32 in[MLX5_ST_SZ_DW(qetc_reg)]; | |
| 717 | 717 | |
| 718 | 718 | if (!MLX5_CAP_GEN(mdev, ets)) |
| 719 | 719 | return -EOPNOTSUPP; |
| @@ -88,6 +88,9 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs) · 87 unmodified lines | ||
| 88 | 88 | return -EBUSY; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | + if (!MLX5_ESWITCH_MANAGER(dev)) | |
| 92 | + goto enable_vfs_hca; | |
| 93 | + | |
| 91 | 94 | err = mlx5_eswitch_enable_sriov(dev->priv.eswitch, num_vfs, SRIOV_LEGACY); |
| 92 | 95 | if (err) { |
| 93 | 96 | mlx5_core_warn(dev, |
| @@ -95,6 +98,7 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs) · 1 unmodified line | ||
| 95 | 98 | return err; |
| 96 | 99 | } |
| 97 | 100 | |
| 101 | +enable_vfs_hca: | |
| 98 | 102 | for (vf = 0; vf < num_vfs; vf++) { |
| 99 | 103 | err = mlx5_core_enable_hca(dev, vf + 1); |
| 100 | 104 | if (err) { |
| @@ -140,7 +144,8 @@ static void mlx5_device_disable_sriov(struct mlx5_core_dev *dev) · 39 unmodified lines | ||
| 140 | 144 | } |
| 141 | 145 | |
| 142 | 146 | out: |
| 143 | − mlx5_eswitch_disable_sriov(dev->priv.eswitch); | |
| 147 | + if (MLX5_ESWITCH_MANAGER(dev)) | |
| 148 | + mlx5_eswitch_disable_sriov(dev->priv.eswitch); | |
| 144 | 149 | |
| 145 | 150 | if (mlx5_wait_for_vf_pages(dev)) |
| 146 | 151 | mlx5_core_warn(dev, "timeout reclaiming VFs pages\n"); |
| @@ -549,8 +549,6 @@ int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev, · 548 unmodified lines | ||
| 549 | 549 | return -EINVAL; |
| 550 | 550 | if (!MLX5_CAP_GEN(mdev, vport_group_manager)) |
| 551 | 551 | return -EACCES; |
| 552 | − if (!MLX5_CAP_ESW(mdev, nic_vport_node_guid_modify)) | |
| 553 | − return -EOPNOTSUPP; | |
| 554 | 552 | |
| 555 | 553 | in = kvzalloc(inlen, GFP_KERNEL); |
| 556 | 554 | if (!in) |
| @@ -81,10 +81,10 @@ nfp_bpf_xdp_offload(struct nfp_app *app, struct nfp_net *nn, · 80 unmodified lines | ||
| 81 | 81 | |
| 82 | 82 | ret = nfp_net_bpf_offload(nn, prog, running, extack); |
| 83 | 83 | /* Stop offload if replace not possible */ |
| 84 | − if (ret && prog) | |
| 85 | − nfp_bpf_xdp_offload(app, nn, NULL, extack); | |
| 84 | + if (ret) | |
| 85 | + return ret; | |
| 86 | 86 | |
| 87 | − nn->dp.bpf_offload_xdp = prog && !ret; | |
| 87 | + nn->dp.bpf_offload_xdp = !!prog; | |
| 88 | 88 | return ret; |
| 89 | 89 | } |
| 90 | 90 | |
| @@ -202,6 +202,9 @@ static int nfp_bpf_setup_tc_block(struct net_device *netdev, · 111 unmodified lines | ||
| 202 | 202 | if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS) |
| 203 | 203 | return -EOPNOTSUPP; |
| 204 | 204 | |
| 205 | + if (tcf_block_shared(f->block)) | |
| 206 | + return -EOPNOTSUPP; | |
| 207 | + | |
| 205 | 208 | switch (f->command) { |
| 206 | 209 | case TC_BLOCK_BIND: |
| 207 | 210 | return tcf_block_cb_register(f->block, |
| @@ -123,6 +123,20 @@ nfp_flower_compile_mac(struct nfp_flower_mac_mpls *frame, · 122 unmodified lines | ||
| 123 | 123 | NFP_FLOWER_MASK_MPLS_Q; |
| 124 | 124 | |
| 125 | 125 | frame->mpls_lse = cpu_to_be32(t_mpls); |
| 126 | + } else if (dissector_uses_key(flow->dissector, | |
| 127 | + FLOW_DISSECTOR_KEY_BASIC)) { | |
| 128 | + /* Check for mpls ether type and set NFP_FLOWER_MASK_MPLS_Q | |
| 129 | + * bit, which indicates an mpls ether type but without any | |
| 130 | + * mpls fields. | |
| 131 | + */ | |
| 132 | + struct flow_dissector_key_basic *key_basic; | |
| 133 | + | |
| 134 | + key_basic = skb_flow_dissector_target(flow->dissector, | |
| 135 | + FLOW_DISSECTOR_KEY_BASIC, | |
| 136 | + flow->key); | |
| 137 | + if (key_basic->n_proto == cpu_to_be16(ETH_P_MPLS_UC) || | |
| 138 | + key_basic->n_proto == cpu_to_be16(ETH_P_MPLS_MC)) | |
| 139 | + frame->mpls_lse = cpu_to_be32(NFP_FLOWER_MASK_MPLS_Q); | |
| 126 | 140 | } |
| 127 | 141 | } |
| 128 | 142 | |
| @@ -264,6 +264,14 @@ nfp_flower_calculate_key_layers(struct nfp_app *app, · 263 unmodified lines | ||
| 264 | 264 | case cpu_to_be16(ETH_P_ARP): |
| 265 | 265 | return -EOPNOTSUPP; |
| 266 | 266 | |
| 267 | + case cpu_to_be16(ETH_P_MPLS_UC): | |
| 268 | + case cpu_to_be16(ETH_P_MPLS_MC): | |
| 269 | + if (!(key_layer & NFP_FLOWER_LAYER_MAC)) { | |
| 270 | + key_layer |= NFP_FLOWER_LAYER_MAC; | |
| 271 | + key_size += sizeof(struct nfp_flower_mac_mpls); | |
| 272 | + } | |
| 273 | + break; | |
| 274 | + | |
| 267 | 275 | /* Will be included in layer 2. */ |
| 268 | 276 | case cpu_to_be16(ETH_P_8021Q): |
| 269 | 277 | break; |
| @@ -623,6 +631,9 @@ static int nfp_flower_setup_tc_block(struct net_device *netdev, · 353 unmodified lines | ||
| 623 | 631 | if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS) |
| 624 | 632 | return -EOPNOTSUPP; |
| 625 | 633 | |
| 634 | + if (tcf_block_shared(f->block)) | |
| 635 | + return -EOPNOTSUPP; | |
| 636 | + | |
| 626 | 637 | switch (f->command) { |
| 627 | 638 | case TC_BLOCK_BIND: |
| 628 | 639 | return tcf_block_cb_register(f->block, |
| @@ -232,7 +232,7 @@ struct nfp_nffw_info *nfp_nffw_info_open(struct nfp_cpp *cpp) · 231 unmodified lines | ||
| 232 | 232 | err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res), |
| 233 | 233 | nfp_resource_address(state->res), |
| 234 | 234 | fwinf, sizeof(*fwinf)); |
| 235 | − if (err < sizeof(*fwinf)) | |
| 235 | + if (err < (int)sizeof(*fwinf)) | |
| 236 | 236 | goto err_release; |
| 237 | 237 | |
| 238 | 238 | if (!nffw_res_flg_init_get(fwinf)) |
| @@ -709,9 +709,9 @@ qed_dcbx_get_local_lldp_params(struct qed_hwfn *p_hwfn, · 708 unmodified lines | ||
| 709 | 709 | p_local = &p_hwfn->p_dcbx_info->lldp_local[LLDP_NEAREST_BRIDGE]; |
| 710 | 710 | |
| 711 | 711 | memcpy(params->lldp_local.local_chassis_id, p_local->local_chassis_id, |
| 712 | − ARRAY_SIZE(p_local->local_chassis_id)); | |
| 712 | + sizeof(p_local->local_chassis_id)); | |
| 713 | 713 | memcpy(params->lldp_local.local_port_id, p_local->local_port_id, |
| 714 | − ARRAY_SIZE(p_local->local_port_id)); | |
| 714 | + sizeof(p_local->local_port_id)); | |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | static void |
| @@ -723,9 +723,9 @@ qed_dcbx_get_remote_lldp_params(struct qed_hwfn *p_hwfn, · 5 unmodified lines | ||
| 723 | 723 | p_remote = &p_hwfn->p_dcbx_info->lldp_remote[LLDP_NEAREST_BRIDGE]; |
| 724 | 724 | |
| 725 | 725 | memcpy(params->lldp_remote.peer_chassis_id, p_remote->peer_chassis_id, |
| 726 | − ARRAY_SIZE(p_remote->peer_chassis_id)); | |
| 726 | + sizeof(p_remote->peer_chassis_id)); | |
| 727 | 727 | memcpy(params->lldp_remote.peer_port_id, p_remote->peer_port_id, |
| 728 | − ARRAY_SIZE(p_remote->peer_port_id)); | |
| 728 | + sizeof(p_remote->peer_port_id)); | |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | static int |
| @@ -1804,7 +1804,7 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params) · 1803 unmodified lines | ||
| 1804 | 1804 | DP_INFO(p_hwfn, "Failed to update driver state\n"); |
| 1805 | 1805 | |
| 1806 | 1806 | rc = qed_mcp_ov_update_eswitch(p_hwfn, p_hwfn->p_main_ptt, |
| 1807 | − QED_OV_ESWITCH_VEB); | |
| 1807 | + QED_OV_ESWITCH_NONE); | |
| 1808 | 1808 | if (rc) |
| 1809 | 1809 | DP_INFO(p_hwfn, "Failed to update eswitch mode\n"); |
| 1810 | 1810 | } |
| @@ -789,6 +789,14 @@ static int qed_slowpath_setup_int(struct qed_dev *cdev, · 788 unmodified lines | ||
| 789 | 789 | /* We want a minimum of one slowpath and one fastpath vector per hwfn */ |
| 790 | 790 | cdev->int_params.in.min_msix_cnt = cdev->num_hwfns * 2; |
| 791 | 791 | |
| 792 | + if (is_kdump_kernel()) { | |
| 793 | + DP_INFO(cdev, | |
| 794 | + "Kdump kernel: Limit the max number of requested MSI-X vectors to %hd\n", | |
| 795 | + cdev->int_params.in.min_msix_cnt); | |
| 796 | + cdev->int_params.in.num_vectors = | |
| 797 | + cdev->int_params.in.min_msix_cnt; | |
| 798 | + } | |
| 799 | + | |
| 792 | 800 | rc = qed_set_int_mode(cdev, false); |
| 793 | 801 | if (rc) { |
| 794 | 802 | DP_ERR(cdev, "qed_slowpath_setup_int ERR\n"); |
| @@ -4513,6 +4513,8 @@ static void qed_sriov_enable_qid_config(struct qed_hwfn *hwfn, · 4512 unmodified lines | ||
| 4513 | 4513 | static int qed_sriov_enable(struct qed_dev *cdev, int num) |
| 4514 | 4514 | { |
| 4515 | 4515 | struct qed_iov_vf_init_params params; |
| 4516 | + struct qed_hwfn *hwfn; | |
| 4517 | + struct qed_ptt *ptt; | |
| 4516 | 4518 | int i, j, rc; |
| 4517 | 4519 | |
| 4518 | 4520 | if (num >= RESC_NUM(&cdev->hwfns[0], QED_VPORT)) { |
| @@ -4525,8 +4527,8 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num) · 6 unmodified lines | ||
| 4525 | 4527 | |
| 4526 | 4528 | /* Initialize HW for VF access */ |
| 4527 | 4529 | for_each_hwfn(cdev, j) { |
| 4528 | − struct qed_hwfn *hwfn = &cdev->hwfns[j]; | |
| 4529 | − struct qed_ptt *ptt = qed_ptt_acquire(hwfn); | |
| 4530 | + hwfn = &cdev->hwfns[j]; | |
| 4531 | + ptt = qed_ptt_acquire(hwfn); | |
| 4530 | 4532 | |
| 4531 | 4533 | /* Make sure not to use more than 16 queues per VF */ |
| 4532 | 4534 | params.num_queues = min_t(int, |
| @@ -4562,6 +4564,19 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num) · 29 unmodified lines | ||
| 4562 | 4564 | goto err; |
| 4563 | 4565 | } |
| 4564 | 4566 | |
| 4567 | + hwfn = QED_LEADING_HWFN(cdev); | |
| 4568 | + ptt = qed_ptt_acquire(hwfn); | |
| 4569 | + if (!ptt) { | |
| 4570 | + DP_ERR(hwfn, "Failed to acquire ptt\n"); | |
| 4571 | + rc = -EBUSY; | |
| 4572 | + goto err; | |
| 4573 | + } | |
| 4574 | + | |
| 4575 | + rc = qed_mcp_ov_update_eswitch(hwfn, ptt, QED_OV_ESWITCH_VEB); | |
| 4576 | + if (rc) | |
| 4577 | + DP_INFO(cdev, "Failed to update eswitch mode\n"); | |
| 4578 | + qed_ptt_release(hwfn, ptt); | |
| 4579 | + | |
| 4565 | 4580 | return num; |
| 4566 | 4581 | |
| 4567 | 4582 | err: |
| @@ -337,8 +337,14 @@ int qede_ptp_get_ts_info(struct qede_dev *edev, struct ethtool_ts_info *info) · 336 unmodified lines | ||
| 337 | 337 | { |
| 338 | 338 | struct qede_ptp *ptp = edev->ptp; |
| 339 | 339 | |
| 340 | − if (!ptp) | |
| 341 | − return -EIO; | |
| 340 | + if (!ptp) { | |
| 341 | + info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE | | |
| 342 | + SOF_TIMESTAMPING_RX_SOFTWARE | | |
| 343 | + SOF_TIMESTAMPING_SOFTWARE; | |
| 344 | + info->phc_index = -1; | |
| 345 | + | |
| 346 | + return 0; | |
| 347 | + } | |
| 342 | 348 | |
| 343 | 349 | info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE | |
| 344 | 350 | SOF_TIMESTAMPING_RX_SOFTWARE | |
| @@ -2794,6 +2794,7 @@ int efx_farch_filter_table_probe(struct efx_nic *efx) · 2793 unmodified lines | ||
| 2794 | 2794 | if (!state) |
| 2795 | 2795 | return -ENOMEM; |
| 2796 | 2796 | efx->filter_state = state; |
| 2797 | + init_rwsem(&state->lock); | |
| 2797 | 2798 | |
| 2798 | 2799 | table = &state->table[EFX_FARCH_FILTER_TABLE_RX_IP]; |
| 2799 | 2800 | table->id = EFX_FARCH_FILTER_TABLE_RX_IP; |
| @@ -420,6 +420,16 @@ static void dwmac4_qmode(void __iomem *ioaddr, u32 channel, u8 qmode) · 419 unmodified lines | ||
| 420 | 420 | writel(mtl_tx_op, ioaddr + MTL_CHAN_TX_OP_MODE(channel)); |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | +static void dwmac4_set_bfsize(void __iomem *ioaddr, int bfsize, u32 chan) | |
| 424 | +{ | |
| 425 | + u32 value = readl(ioaddr + DMA_CHAN_RX_CONTROL(chan)); | |
| 426 | + | |
| 427 | + value &= ~DMA_RBSZ_MASK; | |
| 428 | + value |= (bfsize << DMA_RBSZ_SHIFT) & DMA_RBSZ_MASK; | |
| 429 | + | |
| 430 | + writel(value, ioaddr + DMA_CHAN_RX_CONTROL(chan)); | |
| 431 | +} | |
| 432 | + | |
| 423 | 433 | const struct stmmac_dma_ops dwmac4_dma_ops = { |
| 424 | 434 | .reset = dwmac4_dma_reset, |
| 425 | 435 | .init = dwmac4_dma_init, |
| @@ -445,6 +455,7 @@ const struct stmmac_dma_ops dwmac4_dma_ops = { · 19 unmodified lines | ||
| 445 | 455 | .set_tx_tail_ptr = dwmac4_set_tx_tail_ptr, |
| 446 | 456 | .enable_tso = dwmac4_enable_tso, |
| 447 | 457 | .qmode = dwmac4_qmode, |
| 458 | + .set_bfsize = dwmac4_set_bfsize, | |
| 448 | 459 | }; |
| 449 | 460 | |
| 450 | 461 | const struct stmmac_dma_ops dwmac410_dma_ops = { |
| @@ -472,4 +483,5 @@ const struct stmmac_dma_ops dwmac410_dma_ops = { · 21 unmodified lines | ||
| 472 | 483 | .set_tx_tail_ptr = dwmac4_set_tx_tail_ptr, |
| 473 | 484 | .enable_tso = dwmac4_enable_tso, |
| 474 | 485 | .qmode = dwmac4_qmode, |
| 486 | + .set_bfsize = dwmac4_set_bfsize, | |
| 475 | 487 | }; |
| @@ -120,6 +120,8 @@ · 119 unmodified lines | ||
| 120 | 120 | |
| 121 | 121 | /* DMA Rx Channel X Control register defines */ |
| 122 | 122 | #define DMA_CONTROL_SR BIT(0) |
| 123 | +#define DMA_RBSZ_MASK GENMASK(14, 1) | |
| 124 | +#define DMA_RBSZ_SHIFT 1 | |
| 123 | 125 | |
| 124 | 126 | /* Interrupt status per channel */ |
| 125 | 127 | #define DMA_CHAN_STATUS_REB GENMASK(21, 19) |
| @@ -184,6 +184,7 @@ struct stmmac_dma_ops { · 183 unmodified lines | ||
| 184 | 184 | void (*set_tx_tail_ptr)(void __iomem *ioaddr, u32 tail_ptr, u32 chan); |
| 185 | 185 | void (*enable_tso)(void __iomem *ioaddr, bool en, u32 chan); |
| 186 | 186 | void (*qmode)(void __iomem *ioaddr, u32 channel, u8 qmode); |
| 187 | + void (*set_bfsize)(void __iomem *ioaddr, int bfsize, u32 chan); | |
| 187 | 188 | }; |
| 188 | 189 | |
| 189 | 190 | #define stmmac_reset(__priv, __args...) \ |
| @@ -238,6 +239,8 @@ struct stmmac_dma_ops { · 48 unmodified lines | ||
| 238 | 239 | stmmac_do_void_callback(__priv, dma, enable_tso, __args) |
| 239 | 240 | #define stmmac_dma_qmode(__priv, __args...) \ |
| 240 | 241 | stmmac_do_void_callback(__priv, dma, qmode, __args) |
| 242 | +#define stmmac_set_dma_bfsize(__priv, __args...) \ | |
| 243 | + stmmac_do_void_callback(__priv, dma, set_bfsize, __args) | |
| 241 | 244 | |
| 242 | 245 | struct mac_device_info; |
| 243 | 246 | struct net_device; |
| @@ -1804,6 +1804,8 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv) · 1803 unmodified lines | ||
| 1804 | 1804 | |
| 1805 | 1805 | stmmac_dma_rx_mode(priv, priv->ioaddr, rxmode, chan, |
| 1806 | 1806 | rxfifosz, qmode); |
| 1807 | + stmmac_set_dma_bfsize(priv, priv->ioaddr, priv->dma_buf_sz, | |
| 1808 | + chan); | |
| 1807 | 1809 | } |
| 1808 | 1810 | |
| 1809 | 1811 | for (chan = 0; chan < tx_channels_count; chan++) { |
| @@ -478,7 +478,7 @@ static struct sk_buff *geneve_gro_receive(struct sock *sk, · 477 unmodified lines | ||
| 478 | 478 | out_unlock: |
| 479 | 479 | rcu_read_unlock(); |
| 480 | 480 | out: |
| 481 | − NAPI_GRO_CB(skb)->flush |= flush; | |
| 481 | + skb_gro_flush_final(skb, pp, flush); | |
| 482 | 482 | |
| 483 | 483 | return pp; |
| 484 | 484 | } |
| @@ -210,7 +210,7 @@ int netvsc_recv_callback(struct net_device *net, · 209 unmodified lines | ||
| 210 | 210 | void netvsc_channel_cb(void *context); |
| 211 | 211 | int netvsc_poll(struct napi_struct *napi, int budget); |
| 212 | 212 | |
| 213 | −void rndis_set_subchannel(struct work_struct *w); | |
| 213 | +int rndis_set_subchannel(struct net_device *ndev, struct netvsc_device *nvdev); | |
| 214 | 214 | int rndis_filter_open(struct netvsc_device *nvdev); |
| 215 | 215 | int rndis_filter_close(struct netvsc_device *nvdev); |
| 216 | 216 | struct netvsc_device *rndis_filter_device_add(struct hv_device *dev, |
| @@ -65,6 +65,41 @@ void netvsc_switch_datapath(struct net_device *ndev, bool vf) · 64 unmodified lines | ||
| 65 | 65 | VM_PKT_DATA_INBAND, 0); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | +/* Worker to setup sub channels on initial setup | |
| 69 | + * Initial hotplug event occurs in softirq context | |
| 70 | + * and can't wait for channels. | |
| 71 | + */ | |
| 72 | +static void netvsc_subchan_work(struct work_struct *w) | |
| 73 | +{ | |
| 74 | + struct netvsc_device *nvdev = | |
| 75 | + container_of(w, struct netvsc_device, subchan_work); | |
| 76 | + struct rndis_device *rdev; | |
| 77 | + int i, ret; | |
| 78 | + | |
| 79 | + /* Avoid deadlock with device removal already under RTNL */ | |
| 80 | + if (!rtnl_trylock()) { | |
| 81 | + schedule_work(w); | |
| 82 | + return; | |
| 83 | + } | |
| 84 | + | |
| 85 | + rdev = nvdev->extension; | |
| 86 | + if (rdev) { | |
| 87 | + ret = rndis_set_subchannel(rdev->ndev, nvdev); | |
| 88 | + if (ret == 0) { | |
| 89 | + netif_device_attach(rdev->ndev); | |
| 90 | + } else { | |
| 91 | + /* fallback to only primary channel */ | |
| 92 | + for (i = 1; i < nvdev->num_chn; i++) | |
| 93 | + netif_napi_del(&nvdev->chan_table[i].napi); | |
| 94 | + | |
| 95 | + nvdev->max_chn = 1; | |
| 96 | + nvdev->num_chn = 1; | |
| 97 | + } | |
| 98 | + } | |
| 99 | + | |
| 100 | + rtnl_unlock(); | |
| 101 | +} | |
| 102 | + | |
| 68 | 103 | static struct netvsc_device *alloc_net_device(void) |
| 69 | 104 | { |
| 70 | 105 | struct netvsc_device *net_device; |
| @@ -81,7 +116,7 @@ static struct netvsc_device *alloc_net_device(void) · 10 unmodified lines | ||
| 81 | 116 | |
| 82 | 117 | init_completion(&net_device->channel_init_wait); |
| 83 | 118 | init_waitqueue_head(&net_device->subchan_open); |
| 84 | − INIT_WORK(&net_device->subchan_work, rndis_set_subchannel); | |
| 119 | + INIT_WORK(&net_device->subchan_work, netvsc_subchan_work); | |
| 85 | 120 | |
| 86 | 121 | return net_device; |
| 87 | 122 | } |
| @@ -905,8 +905,20 @@ static int netvsc_attach(struct net_device *ndev, · 904 unmodified lines | ||
| 905 | 905 | if (IS_ERR(nvdev)) |
| 906 | 906 | return PTR_ERR(nvdev); |
| 907 | 907 | |
| 908 | − /* Note: enable and attach happen when sub-channels setup */ | |
| 908 | + if (nvdev->num_chn > 1) { | |
| 909 | + ret = rndis_set_subchannel(ndev, nvdev); | |
| 910 | + | |
| 911 | + /* if unavailable, just proceed with one queue */ | |
| 912 | + if (ret) { | |
| 913 | + nvdev->max_chn = 1; | |
| 914 | + nvdev->num_chn = 1; | |
| 915 | + } | |
| 916 | + } | |
| 917 | + | |
| 918 | + /* In any case device is now ready */ | |
| 919 | + netif_device_attach(ndev); | |
| 909 | 920 | |
| 921 | + /* Note: enable and attach happen when sub-channels setup */ | |
| 910 | 922 | netif_carrier_off(ndev); |
| 911 | 923 | |
| 912 | 924 | if (netif_running(ndev)) { |
| @@ -2089,6 +2101,9 @@ static int netvsc_probe(struct hv_device *dev, · 1176 unmodified lines | ||
| 2089 | 2101 | |
| 2090 | 2102 | memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN); |
| 2091 | 2103 | |
| 2104 | + if (nvdev->num_chn > 1) | |
| 2105 | + schedule_work(&nvdev->subchan_work); | |
| 2106 | + | |
| 2092 | 2107 | /* hw_features computed in rndis_netdev_set_hwcaps() */ |
| 2093 | 2108 | net->features = net->hw_features | |
| 2094 | 2109 | NETIF_F_HIGHDMA | NETIF_F_SG | |
| @@ -1062,29 +1062,15 @@ static void netvsc_sc_open(struct vmbus_channel *new_sc) · 1061 unmodified lines | ||
| 1062 | 1062 | * This breaks overlap of processing the host message for the |
| 1063 | 1063 | * new primary channel with the initialization of sub-channels. |
| 1064 | 1064 | */ |
| 1065 | −void rndis_set_subchannel(struct work_struct *w) | |
| 1065 | +int rndis_set_subchannel(struct net_device *ndev, struct netvsc_device *nvdev) | |
| 1066 | 1066 | { |
| 1067 | − struct netvsc_device *nvdev | |
| 1068 | − = container_of(w, struct netvsc_device, subchan_work); | |
| 1069 | 1067 | struct nvsp_message *init_packet = &nvdev->channel_init_pkt; |
| 1070 | − struct net_device_context *ndev_ctx; | |
| 1071 | − struct rndis_device *rdev; | |
| 1072 | − struct net_device *ndev; | |
| 1073 | − struct hv_device *hv_dev; | |
| 1068 | + struct net_device_context *ndev_ctx = netdev_priv(ndev); | |
| 1069 | + struct hv_device *hv_dev = ndev_ctx->device_ctx; | |
| 1070 | + struct rndis_device *rdev = nvdev->extension; | |
| 1074 | 1071 | int i, ret; |
| 1075 | 1072 | |
| 1076 | − if (!rtnl_trylock()) { | |
| 1077 | − schedule_work(w); | |
| 1078 | − return; | |
| 1079 | − } | |
| 1080 | − | |
| 1081 | − rdev = nvdev->extension; | |
| 1082 | − if (!rdev) | |
| 1083 | − goto unlock; /* device was removed */ | |
| 1084 | − | |
| 1085 | − ndev = rdev->ndev; | |
| 1086 | − ndev_ctx = netdev_priv(ndev); | |
| 1087 | − hv_dev = ndev_ctx->device_ctx; | |
| 1073 | + ASSERT_RTNL(); | |
| 1088 | 1074 | |
| 1089 | 1075 | memset(init_packet, 0, sizeof(struct nvsp_message)); |
| 1090 | 1076 | init_packet->hdr.msg_type = NVSP_MSG5_TYPE_SUBCHANNEL; |
| @@ -1100,13 +1086,13 @@ void rndis_set_subchannel(struct work_struct *w) · 9 unmodified lines | ||
| 1100 | 1086 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); |
| 1101 | 1087 | if (ret) { |
| 1102 | 1088 | netdev_err(ndev, "sub channel allocate send failed: %d\n", ret); |
| 1103 | − goto failed; | |
| 1089 | + return ret; | |
| 1104 | 1090 | } |
| 1105 | 1091 | |
| 1106 | 1092 | wait_for_completion(&nvdev->channel_init_wait); |
| 1107 | 1093 | if (init_packet->msg.v5_msg.subchn_comp.status != NVSP_STAT_SUCCESS) { |
| 1108 | 1094 | netdev_err(ndev, "sub channel request failed\n"); |
| 1109 | − goto failed; | |
| 1095 | + return -EIO; | |
| 1110 | 1096 | } |
| 1111 | 1097 | |
| 1112 | 1098 | nvdev->num_chn = 1 + |
| @@ -1125,21 +1111,7 @@ void rndis_set_subchannel(struct work_struct *w) · 12 unmodified lines | ||
| 1125 | 1111 | for (i = 0; i < VRSS_SEND_TAB_SIZE; i++) |
| 1126 | 1112 | ndev_ctx->tx_table[i] = i % nvdev->num_chn; |
| 1127 | 1113 | |
| 1128 | − netif_device_attach(ndev); | |
| 1129 | − rtnl_unlock(); | |
| 1130 | − return; | |
| 1131 | − | |
| 1132 | −failed: | |
| 1133 | − /* fallback to only primary channel */ | |
| 1134 | − for (i = 1; i < nvdev->num_chn; i++) | |
| 1135 | − netif_napi_del(&nvdev->chan_table[i].napi); | |
| 1136 | − | |
| 1137 | − nvdev->max_chn = 1; | |
| 1138 | − nvdev->num_chn = 1; | |
| 1139 | − | |
| 1140 | − netif_device_attach(ndev); | |
| 1141 | −unlock: | |
| 1142 | − rtnl_unlock(); | |
| 1114 | + return 0; | |
| 1143 | 1115 | } |
| 1144 | 1116 | |
| 1145 | 1117 | static int rndis_netdev_set_hwcaps(struct rndis_device *rndis_device, |
| @@ -1360,21 +1332,12 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev, · 214 unmodified lines | ||
| 1360 | 1332 | netif_napi_add(net, &net_device->chan_table[i].napi, |
| 1361 | 1333 | netvsc_poll, NAPI_POLL_WEIGHT); |
| 1362 | 1334 | |
| 1363 | − if (net_device->num_chn > 1) | |
| 1364 | − schedule_work(&net_device->subchan_work); | |
| 1335 | + return net_device; | |
| 1365 | 1336 | |
| 1366 | 1337 | out: |
| 1367 | − /* if unavailable, just proceed with one queue */ | |
| 1368 | − if (ret) { | |
| 1369 | − net_device->max_chn = 1; | |
| 1370 | − net_device->num_chn = 1; | |
| 1371 | − } | |
| 1372 | − | |
| 1373 | − /* No sub channels, device is ready */ | |
| 1374 | − if (net_device->num_chn == 1) | |
| 1375 | − netif_device_attach(net); | |
| 1376 | − | |
| 1377 | − return net_device; | |
| 1338 | + /* setting up multiple channels failed */ | |
| 1339 | + net_device->max_chn = 1; | |
| 1340 | + net_device->num_chn = 1; | |
| 1378 | 1341 | |
| 1379 | 1342 | err_dev_remv: |
| 1380 | 1343 | rndis_filter_device_remove(dev, net_device); |
| @@ -75,10 +75,23 @@ static int ipvlan_set_port_mode(struct ipvl_port *port, u16 nval) · 74 unmodified lines | ||
| 75 | 75 | { |
| 76 | 76 | struct ipvl_dev *ipvlan; |
| 77 | 77 | struct net_device *mdev = port->dev; |
| 78 | − int err = 0; | |
| 78 | + unsigned int flags; | |
| 79 | + int err; | |
| 79 | 80 | |
| 80 | 81 | ASSERT_RTNL(); |
| 81 | 82 | if (port->mode != nval) { |
| 83 | + list_for_each_entry(ipvlan, &port->ipvlans, pnode) { | |
| 84 | + flags = ipvlan->dev->flags; | |
| 85 | + if (nval == IPVLAN_MODE_L3 || nval == IPVLAN_MODE_L3S) { | |
| 86 | + err = dev_change_flags(ipvlan->dev, | |
| 87 | + flags | IFF_NOARP); | |
| 88 | + } else { | |
| 89 | + err = dev_change_flags(ipvlan->dev, | |
| 90 | + flags & ~IFF_NOARP); | |
| 91 | + } | |
| 92 | + if (unlikely(err)) | |
| 93 | + goto fail; | |
| 94 | + } | |
| 82 | 95 | if (nval == IPVLAN_MODE_L3S) { |
| 83 | 96 | /* New mode is L3S */ |
| 84 | 97 | err = ipvlan_register_nf_hook(read_pnet(&port->pnet)); |
| @@ -86,21 +99,28 @@ static int ipvlan_set_port_mode(struct ipvl_port *port, u16 nval) · 1 unmodified line | ||
| 86 | 99 | mdev->l3mdev_ops = &ipvl_l3mdev_ops; |
| 87 | 100 | mdev->priv_flags |= IFF_L3MDEV_MASTER; |
| 88 | 101 | } else |
| 89 | − return err; | |
| 102 | + goto fail; | |
| 90 | 103 | } else if (port->mode == IPVLAN_MODE_L3S) { |
| 91 | 104 | /* Old mode was L3S */ |
| 92 | 105 | mdev->priv_flags &= ~IFF_L3MDEV_MASTER; |
| 93 | 106 | ipvlan_unregister_nf_hook(read_pnet(&port->pnet)); |
| 94 | 107 | mdev->l3mdev_ops = NULL; |
| 95 | 108 | } |
| 96 | − list_for_each_entry(ipvlan, &port->ipvlans, pnode) { | |
| 97 | − if (nval == IPVLAN_MODE_L3 || nval == IPVLAN_MODE_L3S) | |
| 98 | − ipvlan->dev->flags |= IFF_NOARP; | |
| 99 | − else | |
| 100 | − ipvlan->dev->flags &= ~IFF_NOARP; | |
| 101 | − } | |
| 102 | 109 | port->mode = nval; |
| 103 | 110 | } |
| 111 | + return 0; | |
| 112 | + | |
| 113 | +fail: | |
| 114 | + /* Undo the flags changes that have been done so far. */ | |
| 115 | + list_for_each_entry_continue_reverse(ipvlan, &port->ipvlans, pnode) { | |
| 116 | + flags = ipvlan->dev->flags; | |
| 117 | + if (port->mode == IPVLAN_MODE_L3 || | |
| 118 | + port->mode == IPVLAN_MODE_L3S) | |
| 119 | + dev_change_flags(ipvlan->dev, flags | IFF_NOARP); | |
| 120 | + else | |
| 121 | + dev_change_flags(ipvlan->dev, flags & ~IFF_NOARP); | |
| 122 | + } | |
| 123 | + | |
| 104 | 124 | return err; |
| 105 | 125 | } |
| 106 | 126 | |
| @@ -222,7 +222,7 @@ static int dp83811_config_intr(struct phy_device *phydev) · 221 unmodified lines | ||
| 222 | 222 | if (err < 0) |
| 223 | 223 | return err; |
| 224 | 224 | |
| 225 | − err = phy_write(phydev, MII_DP83811_INT_STAT1, 0); | |
| 225 | + err = phy_write(phydev, MII_DP83811_INT_STAT2, 0); | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | return err; |
| @@ -1107,7 +1107,7 @@ static const struct proto_ops pppoe_ops = { · 1106 unmodified lines | ||
| 1107 | 1107 | .socketpair = sock_no_socketpair, |
| 1108 | 1108 | .accept = sock_no_accept, |
| 1109 | 1109 | .getname = pppoe_getname, |
| 1110 | − .poll_mask = datagram_poll_mask, | |
| 1110 | + .poll = datagram_poll, | |
| 1111 | 1111 | .listen = sock_no_listen, |
| 1112 | 1112 | .shutdown = sock_no_shutdown, |
| 1113 | 1113 | .setsockopt = sock_no_setsockopt, |
| @@ -64,6 +64,7 @@ · 63 unmodified lines | ||
| 64 | 64 | #define DEFAULT_RX_CSUM_ENABLE (true) |
| 65 | 65 | #define DEFAULT_TSO_CSUM_ENABLE (true) |
| 66 | 66 | #define DEFAULT_VLAN_FILTER_ENABLE (true) |
| 67 | +#define DEFAULT_VLAN_RX_OFFLOAD (true) | |
| 67 | 68 | #define TX_OVERHEAD (8) |
| 68 | 69 | #define RXW_PADDING 2 |
| 69 | 70 | |
| @@ -2298,7 +2299,7 @@ static int lan78xx_change_mtu(struct net_device *netdev, int new_mtu) · 2228 unmodified lines | ||
| 2298 | 2299 | if ((ll_mtu % dev->maxpacket) == 0) |
| 2299 | 2300 | return -EDOM; |
| 2300 | 2301 | |
| 2301 | − ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + ETH_HLEN); | |
| 2302 | + ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + VLAN_ETH_HLEN); | |
| 2302 | 2303 | |
| 2303 | 2304 | netdev->mtu = new_mtu; |
| 2304 | 2305 | |
| @@ -2364,6 +2365,11 @@ static int lan78xx_set_features(struct net_device *netdev, · 59 unmodified lines | ||
| 2364 | 2365 | } |
| 2365 | 2366 | |
| 2366 | 2367 | if (features & NETIF_F_HW_VLAN_CTAG_RX) |
| 2368 | + pdata->rfe_ctl |= RFE_CTL_VLAN_STRIP_; | |
| 2369 | + else | |
| 2370 | + pdata->rfe_ctl &= ~RFE_CTL_VLAN_STRIP_; | |
| 2371 | + | |
| 2372 | + if (features & NETIF_F_HW_VLAN_CTAG_FILTER) | |
| 2367 | 2373 | pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_; |
| 2368 | 2374 | else |
| 2369 | 2375 | pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_; |
| @@ -2587,7 +2593,8 @@ static int lan78xx_reset(struct lan78xx_net *dev) · 217 unmodified lines | ||
| 2587 | 2593 | buf |= FCT_TX_CTL_EN_; |
| 2588 | 2594 | ret = lan78xx_write_reg(dev, FCT_TX_CTL, buf); |
| 2589 | 2595 | |
| 2590 | − ret = lan78xx_set_rx_max_frame_length(dev, dev->net->mtu + ETH_HLEN); | |
| 2596 | + ret = lan78xx_set_rx_max_frame_length(dev, | |
| 2597 | + dev->net->mtu + VLAN_ETH_HLEN); | |
| 2591 | 2598 | |
| 2592 | 2599 | ret = lan78xx_read_reg(dev, MAC_RX, &buf); |
| 2593 | 2600 | buf |= MAC_RX_RXEN_; |
| @@ -2975,6 +2982,12 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) · 381 unmodified lines | ||
| 2975 | 2982 | if (DEFAULT_TSO_CSUM_ENABLE) |
| 2976 | 2983 | dev->net->features |= NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG; |
| 2977 | 2984 | |
| 2985 | + if (DEFAULT_VLAN_RX_OFFLOAD) | |
| 2986 | + dev->net->features |= NETIF_F_HW_VLAN_CTAG_RX; | |
| 2987 | + | |
| 2988 | + if (DEFAULT_VLAN_FILTER_ENABLE) | |
| 2989 | + dev->net->features |= NETIF_F_HW_VLAN_CTAG_FILTER; | |
| 2990 | + | |
| 2978 | 2991 | dev->net->hw_features = dev->net->features; |
| 2979 | 2992 | |
| 2980 | 2993 | ret = lan78xx_setup_irq_domain(dev); |
| @@ -3039,8 +3052,13 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev, · 58 unmodified lines | ||
| 3039 | 3052 | struct sk_buff *skb, |
| 3040 | 3053 | u32 rx_cmd_a, u32 rx_cmd_b) |
| 3041 | 3054 | { |
| 3055 | + /* HW Checksum offload appears to be flawed if used when not stripping | |
| 3056 | + * VLAN headers. Drop back to S/W checksums under these conditions. | |
| 3057 | + */ | |
| 3042 | 3058 | if (!(dev->net->features & NETIF_F_RXCSUM) || |
| 3043 | − unlikely(rx_cmd_a & RX_CMD_A_ICSM_)) { | |
| 3059 | + unlikely(rx_cmd_a & RX_CMD_A_ICSM_) || | |
| 3060 | + ((rx_cmd_a & RX_CMD_A_FVTG_) && | |
| 3061 | + !(dev->net->features & NETIF_F_HW_VLAN_CTAG_RX))) { | |
| 3044 | 3062 | skb->ip_summed = CHECKSUM_NONE; |
| 3045 | 3063 | } else { |
| 3046 | 3064 | skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_)); |
| @@ -3048,6 +3066,16 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev, · 1 unmodified line | ||
| 3048 | 3066 | } |
| 3049 | 3067 | } |
| 3050 | 3068 | |
| 3069 | +static void lan78xx_rx_vlan_offload(struct lan78xx_net *dev, | |
| 3070 | + struct sk_buff *skb, | |
| 3071 | + u32 rx_cmd_a, u32 rx_cmd_b) | |
| 3072 | +{ | |
| 3073 | + if ((dev->net->features & NETIF_F_HW_VLAN_CTAG_RX) && | |
| 3074 | + (rx_cmd_a & RX_CMD_A_FVTG_)) | |
| 3075 | + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), | |
| 3076 | + (rx_cmd_b & 0xffff)); | |
| 3077 | +} | |
| 3078 | + | |
| 3051 | 3079 | static void lan78xx_skb_return(struct lan78xx_net *dev, struct sk_buff *skb) |
| 3052 | 3080 | { |
| 3053 | 3081 | int status; |
| @@ -3112,6 +3140,8 @@ static int lan78xx_rx(struct lan78xx_net *dev, struct sk_buff *skb) · 58 unmodified lines | ||
| 3112 | 3140 | if (skb->len == size) { |
| 3113 | 3141 | lan78xx_rx_csum_offload(dev, skb, |
| 3114 | 3142 | rx_cmd_a, rx_cmd_b); |
| 3143 | + lan78xx_rx_vlan_offload(dev, skb, | |
| 3144 | + rx_cmd_a, rx_cmd_b); | |
| 3115 | 3145 | |
| 3116 | 3146 | skb_trim(skb, skb->len - 4); /* remove fcs */ |
| 3117 | 3147 | skb->truesize = size + sizeof(struct sk_buff); |
| @@ -3130,6 +3160,7 @@ static int lan78xx_rx(struct lan78xx_net *dev, struct sk_buff *skb) · 12 unmodified lines | ||
| 3130 | 3160 | skb_set_tail_pointer(skb2, size); |
| 3131 | 3161 | |
| 3132 | 3162 | lan78xx_rx_csum_offload(dev, skb2, rx_cmd_a, rx_cmd_b); |
| 3163 | + lan78xx_rx_vlan_offload(dev, skb2, rx_cmd_a, rx_cmd_b); | |
| 3133 | 3164 | |
| 3134 | 3165 | skb_trim(skb2, skb2->len - 4); /* remove fcs */ |
| 3135 | 3166 | skb2->truesize = size + sizeof(struct sk_buff); |
| @@ -3966,7 +3966,8 @@ static int rtl8152_close(struct net_device *netdev) · 3965 unmodified lines | ||
| 3966 | 3966 | #ifdef CONFIG_PM_SLEEP |
| 3967 | 3967 | unregister_pm_notifier(&tp->pm_notifier); |
| 3968 | 3968 | #endif |
| 3969 | − napi_disable(&tp->napi); | |
| 3969 | + if (!test_bit(RTL8152_UNPLUG, &tp->flags)) | |
| 3970 | + napi_disable(&tp->napi); | |
| 3970 | 3971 | clear_bit(WORK_ENABLE, &tp->flags); |
| 3971 | 3972 | usb_kill_urb(tp->intr_urb); |
| 3972 | 3973 | cancel_delayed_work_sync(&tp->schedule); |
| @@ -53,6 +53,10 @@ module_param(napi_tx, bool, 0644); · 52 unmodified lines | ||
| 53 | 53 | /* Amount of XDP headroom to prepend to packets for use by xdp_adjust_head */ |
| 54 | 54 | #define VIRTIO_XDP_HEADROOM 256 |
| 55 | 55 | |
| 56 | +/* Separating two types of XDP xmit */ | |
| 57 | +#define VIRTIO_XDP_TX BIT(0) | |
| 58 | +#define VIRTIO_XDP_REDIR BIT(1) | |
| 59 | + | |
| 56 | 60 | /* RX packet size EWMA. The average packet size is used to determine the packet |
| 57 | 61 | * buffer size when refilling RX rings. As the entire RX ring may be refilled |
| 58 | 62 | * at once, the weight is chosen so that the EWMA will be insensitive to short- |
| @@ -582,7 +586,7 @@ static struct sk_buff *receive_small(struct net_device *dev, · 523 unmodified lines | ||
| 582 | 586 | struct receive_queue *rq, |
| 583 | 587 | void *buf, void *ctx, |
| 584 | 588 | unsigned int len, |
| 585 | − bool *xdp_xmit) | |
| 589 | + unsigned int *xdp_xmit) | |
| 586 | 590 | { |
| 587 | 591 | struct sk_buff *skb; |
| 588 | 592 | struct bpf_prog *xdp_prog; |
| @@ -654,14 +658,14 @@ static struct sk_buff *receive_small(struct net_device *dev, · 65 unmodified lines | ||
| 654 | 658 | trace_xdp_exception(vi->dev, xdp_prog, act); |
| 655 | 659 | goto err_xdp; |
| 656 | 660 | } |
| 657 | − *xdp_xmit = true; | |
| 661 | + *xdp_xmit |= VIRTIO_XDP_TX; | |
| 658 | 662 | rcu_read_unlock(); |
| 659 | 663 | goto xdp_xmit; |
| 660 | 664 | case XDP_REDIRECT: |
| 661 | 665 | err = xdp_do_redirect(dev, &xdp, xdp_prog); |
| 662 | 666 | if (err) |
| 663 | 667 | goto err_xdp; |
| 664 | − *xdp_xmit = true; | |
| 668 | + *xdp_xmit |= VIRTIO_XDP_REDIR; | |
| 665 | 669 | rcu_read_unlock(); |
| 666 | 670 | goto xdp_xmit; |
| 667 | 671 | default: |
| @@ -723,7 +727,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, · 55 unmodified lines | ||
| 723 | 727 | void *buf, |
| 724 | 728 | void *ctx, |
| 725 | 729 | unsigned int len, |
| 726 | − bool *xdp_xmit) | |
| 730 | + unsigned int *xdp_xmit) | |
| 727 | 731 | { |
| 728 | 732 | struct virtio_net_hdr_mrg_rxbuf *hdr = buf; |
| 729 | 733 | u16 num_buf = virtio16_to_cpu(vi->vdev, hdr->num_buffers); |
| @@ -818,7 +822,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, · 88 unmodified lines | ||
| 818 | 822 | put_page(xdp_page); |
| 819 | 823 | goto err_xdp; |
| 820 | 824 | } |
| 821 | − *xdp_xmit = true; | |
| 825 | + *xdp_xmit |= VIRTIO_XDP_TX; | |
| 822 | 826 | if (unlikely(xdp_page != page)) |
| 823 | 827 | put_page(page); |
| 824 | 828 | rcu_read_unlock(); |
| @@ -830,7 +834,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, · 5 unmodified lines | ||
| 830 | 834 | put_page(xdp_page); |
| 831 | 835 | goto err_xdp; |
| 832 | 836 | } |
| 833 | − *xdp_xmit = true; | |
| 837 | + *xdp_xmit |= VIRTIO_XDP_REDIR; | |
| 834 | 838 | if (unlikely(xdp_page != page)) |
| 835 | 839 | put_page(page); |
| 836 | 840 | rcu_read_unlock(); |
| @@ -939,7 +943,8 @@ xdp_xmit: · 102 unmodified lines | ||
| 939 | 943 | } |
| 940 | 944 | |
| 941 | 945 | static int receive_buf(struct virtnet_info *vi, struct receive_queue *rq, |
| 942 | − void *buf, unsigned int len, void **ctx, bool *xdp_xmit) | |
| 946 | + void *buf, unsigned int len, void **ctx, | |
| 947 | + unsigned int *xdp_xmit) | |
| 943 | 948 | { |
| 944 | 949 | struct net_device *dev = vi->dev; |
| 945 | 950 | struct sk_buff *skb; |
| @@ -1232,7 +1237,8 @@ static void refill_work(struct work_struct *work) · 286 unmodified lines | ||
| 1232 | 1237 | } |
| 1233 | 1238 | } |
| 1234 | 1239 | |
| 1235 | −static int virtnet_receive(struct receive_queue *rq, int budget, bool *xdp_xmit) | |
| 1240 | +static int virtnet_receive(struct receive_queue *rq, int budget, | |
| 1241 | + unsigned int *xdp_xmit) | |
| 1236 | 1242 | { |
| 1237 | 1243 | struct virtnet_info *vi = rq->vq->vdev->priv; |
| 1238 | 1244 | unsigned int len, received = 0, bytes = 0; |
| @@ -1321,7 +1327,7 @@ static int virtnet_poll(struct napi_struct *napi, int budget) · 82 unmodified lines | ||
| 1321 | 1327 | struct virtnet_info *vi = rq->vq->vdev->priv; |
| 1322 | 1328 | struct send_queue *sq; |
| 1323 | 1329 | unsigned int received, qp; |
| 1324 | − bool xdp_xmit = false; | |
| 1330 | + unsigned int xdp_xmit = 0; | |
| 1325 | 1331 | |
| 1326 | 1332 | virtnet_poll_cleantx(rq); |
| 1327 | 1333 | |
| @@ -1331,12 +1337,14 @@ static int virtnet_poll(struct napi_struct *napi, int budget) · 3 unmodified lines | ||
| 1331 | 1337 | if (received < budget) |
| 1332 | 1338 | virtqueue_napi_complete(napi, rq->vq, received); |
| 1333 | 1339 | |
| 1334 | − if (xdp_xmit) { | |
| 1340 | + if (xdp_xmit & VIRTIO_XDP_REDIR) | |
| 1341 | + xdp_do_flush_map(); | |
| 1342 | + | |
| 1343 | + if (xdp_xmit & VIRTIO_XDP_TX) { | |
| 1335 | 1344 | qp = vi->curr_queue_pairs - vi->xdp_queue_pairs + |
| 1336 | 1345 | smp_processor_id(); |
| 1337 | 1346 | sq = &vi->sq[qp]; |
| 1338 | 1347 | virtqueue_kick(sq->vq); |
| 1339 | − xdp_do_flush_map(); | |
| 1340 | 1348 | } |
| 1341 | 1349 | |
| 1342 | 1350 | return received; |
| @@ -624,9 +624,7 @@ static struct sk_buff *vxlan_gro_receive(struct sock *sk, · 623 unmodified lines | ||
| 624 | 624 | flush = 0; |
| 625 | 625 | |
| 626 | 626 | out: |
| 627 | − skb_gro_remcsum_cleanup(skb, &grc); | |
| 628 | − skb->remcsum_offload = 0; | |
| 629 | − NAPI_GRO_CB(skb)->flush |= flush; | |
| 627 | + skb_gro_flush_final_remcsum(skb, pp, flush, &grc); | |
| 630 | 628 | |
| 631 | 629 | return pp; |
| 632 | 630 | } |
| @@ -74,7 +74,7 @@ static void pn533_recv_response(struct urb *urb) · 73 unmodified lines | ||
| 74 | 74 | struct sk_buff *skb = NULL; |
| 75 | 75 | |
| 76 | 76 | if (!urb->status) { |
| 77 | − skb = alloc_skb(urb->actual_length, GFP_KERNEL); | |
| 77 | + skb = alloc_skb(urb->actual_length, GFP_ATOMIC); | |
| 78 | 78 | if (!skb) { |
| 79 | 79 | nfc_err(&phy->udev->dev, "failed to alloc memory\n"); |
| 80 | 80 | } else { |
| @@ -186,7 +186,7 @@ static int pn533_usb_send_frame(struct pn533 *dev, · 105 unmodified lines | ||
| 186 | 186 | |
| 187 | 187 | if (dev->protocol_type == PN533_PROTO_REQ_RESP) { |
| 188 | 188 | /* request for response for sent packet directly */ |
| 189 | − rc = pn533_submit_urb_for_response(phy, GFP_ATOMIC); | |
| 189 | + rc = pn533_submit_urb_for_response(phy, GFP_KERNEL); | |
| 190 | 190 | if (rc) |
| 191 | 191 | goto error; |
| 192 | 192 | } else if (dev->protocol_type == PN533_PROTO_REQ_ACK_RESP) { |
| @@ -414,7 +414,8 @@ static int pmem_attach_disk(struct device *dev, · 413 unmodified lines | ||
| 414 | 414 | blk_queue_logical_block_size(q, pmem_sector_size(ndns)); |
| 415 | 415 | blk_queue_max_hw_sectors(q, UINT_MAX); |
| 416 | 416 | blk_queue_flag_set(QUEUE_FLAG_NONROT, q); |
| 417 | − blk_queue_flag_set(QUEUE_FLAG_DAX, q); | |
| 417 | + if (pmem->pfn_flags & PFN_MAP) | |
| 418 | + blk_queue_flag_set(QUEUE_FLAG_DAX, q); | |
| 418 | 419 | q->queuedata = pmem; |
| 419 | 420 | |
| 420 | 421 | disk = alloc_disk_node(0, nid); |
| @@ -732,8 +732,11 @@ static void nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl, · 731 unmodified lines | ||
| 732 | 732 | blk_cleanup_queue(ctrl->ctrl.admin_q); |
| 733 | 733 | nvme_rdma_free_tagset(&ctrl->ctrl, ctrl->ctrl.admin_tagset); |
| 734 | 734 | } |
| 735 | − nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe, | |
| 736 | − sizeof(struct nvme_command), DMA_TO_DEVICE); | |
| 735 | + if (ctrl->async_event_sqe.data) { | |
| 736 | + nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe, | |
| 737 | + sizeof(struct nvme_command), DMA_TO_DEVICE); | |
| 738 | + ctrl->async_event_sqe.data = NULL; | |
| 739 | + } | |
| 737 | 740 | nvme_rdma_free_queue(&ctrl->queues[0]); |
| 738 | 741 | } |
| 739 | 742 | |
| @@ -28,10 +28,10 @@ obj-$(CONFIG_PCI_PF_STUB) += pci-pf-stub.o · 27 unmodified lines | ||
| 28 | 28 | obj-$(CONFIG_PCI_ECAM) += ecam.o |
| 29 | 29 | obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o |
| 30 | 30 | |
| 31 | −obj-y += controller/ | |
| 32 | −obj-y += switch/ | |
| 33 | − | |
| 34 | 31 | # Endpoint library must be initialized before its users |
| 35 | 32 | obj-$(CONFIG_PCI_ENDPOINT) += endpoint/ |
| 36 | 33 | |
| 34 | +obj-y += controller/ | |
| 35 | +obj-y += switch/ | |
| 36 | + | |
| 37 | 37 | ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG |
| @@ -96,7 +96,6 @@ config PCI_HOST_GENERIC · 95 unmodified lines | ||
| 96 | 96 | depends on OF |
| 97 | 97 | select PCI_HOST_COMMON |
| 98 | 98 | select IRQ_DOMAIN |
| 99 | − select PCI_DOMAINS | |
| 100 | 99 | help |
| 101 | 100 | Say Y here if you want to support a simple generic PCI host |
| 102 | 101 | controller, such as the one emulated by kvmtool. |
| @@ -138,7 +137,6 @@ config PCI_VERSATILE · 35 unmodified lines | ||
| 138 | 137 | |
| 139 | 138 | config PCIE_IPROC |
| 140 | 139 | tristate |
| 141 | − select PCI_DOMAINS | |
| 142 | 140 | help |
| 143 | 141 | This enables the iProc PCIe core controller support for Broadcom's |
| 144 | 142 | iProc family of SoCs. An appropriate bus interface driver needs |
| @@ -176,7 +174,6 @@ config PCIE_IPROC_MSI · 31 unmodified lines | ||
| 176 | 174 | config PCIE_ALTERA |
| 177 | 175 | bool "Altera PCIe controller" |
| 178 | 176 | depends on ARM || NIOS2 || COMPILE_TEST |
| 179 | − select PCI_DOMAINS | |
| 180 | 177 | help |
| 181 | 178 | Say Y here if you want to enable PCIe controller support on Altera |
| 182 | 179 | FPGA. |
| @@ -7,7 +7,6 @@ · 6 unmodified lines | ||
| 7 | 7 | * All rights reserved. |
| 8 | 8 | * |
| 9 | 9 | * Send feedback to <kristen.c.accardi@intel.com> |
| 10 | − * | |
| 11 | 10 | */ |
| 12 | 11 | |
| 13 | 12 | #include <linux/module.h> |
| @@ -87,8 +86,17 @@ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *pdev) · 73 unmodified lines | ||
| 87 | 86 | return 0; |
| 88 | 87 | |
| 89 | 88 | /* If _OSC exists, we should not evaluate OSHP */ |
| 89 | + | |
| 90 | + /* | |
| 91 | + * If there's no ACPI host bridge (i.e., ACPI support is compiled | |
| 92 | + * into the kernel but the hardware platform doesn't support ACPI), | |
| 93 | + * there's nothing to do here. | |
| 94 | + */ | |
| 90 | 95 | host = pci_find_host_bridge(pdev->bus); |
| 91 | 96 | root = acpi_pci_find_root(ACPI_HANDLE(&host->dev)); |
| 97 | + if (!root) | |
| 98 | + return 0; | |
| 99 | + | |
| 92 | 100 | if (root->osc_support_set) |
| 93 | 101 | goto no_control; |
| 94 | 102 | |
| @@ -1463,7 +1463,7 @@ static char *xgene_pmu_dev_name(struct device *dev, u32 type, int id) · 1462 unmodified lines | ||
| 1463 | 1463 | case PMU_TYPE_IOB: |
| 1464 | 1464 | return devm_kasprintf(dev, GFP_KERNEL, "iob%d", id); |
| 1465 | 1465 | case PMU_TYPE_IOB_SLOW: |
| 1466 | − return devm_kasprintf(dev, GFP_KERNEL, "iob-slow%d", id); | |
| 1466 | + return devm_kasprintf(dev, GFP_KERNEL, "iob_slow%d", id); | |
| 1467 | 1467 | case PMU_TYPE_MCB: |
| 1468 | 1468 | return devm_kasprintf(dev, GFP_KERNEL, "mcb%d", id); |
| 1469 | 1469 | case PMU_TYPE_MC: |
| @@ -829,6 +829,17 @@ struct qeth_trap_id { · 828 unmodified lines | ||
| 829 | 829 | /*some helper functions*/ |
| 830 | 830 | #define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "") |
| 831 | 831 | |
| 832 | +static inline void qeth_scrub_qdio_buffer(struct qdio_buffer *buf, | |
| 833 | + unsigned int elements) | |
| 834 | +{ | |
| 835 | + unsigned int i; | |
| 836 | + | |
| 837 | + for (i = 0; i < elements; i++) | |
| 838 | + memset(&buf->element[i], 0, sizeof(struct qdio_buffer_element)); | |
| 839 | + buf->element[14].sflags = 0; | |
| 840 | + buf->element[15].sflags = 0; | |
| 841 | +} | |
| 842 | + | |
| 832 | 843 | /** |
| 833 | 844 | * qeth_get_elements_for_range() - find number of SBALEs to cover range. |
| 834 | 845 | * @start: Start of the address range. |
| @@ -1029,7 +1040,7 @@ struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *, · 194 unmodified lines | ||
| 1029 | 1040 | __u16, __u16, |
| 1030 | 1041 | enum qeth_prot_versions); |
| 1031 | 1042 | int qeth_set_features(struct net_device *, netdev_features_t); |
| 1032 | −void qeth_recover_features(struct net_device *dev); | |
| 1043 | +void qeth_enable_hw_features(struct net_device *dev); | |
| 1033 | 1044 | netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t); |
| 1034 | 1045 | netdev_features_t qeth_features_check(struct sk_buff *skb, |
| 1035 | 1046 | struct net_device *dev, |
| @@ -73,9 +73,6 @@ static void qeth_notify_skbs(struct qeth_qdio_out_q *queue, · 72 unmodified lines | ||
| 73 | 73 | struct qeth_qdio_out_buffer *buf, |
| 74 | 74 | enum iucv_tx_notify notification); |
| 75 | 75 | static void qeth_release_skbs(struct qeth_qdio_out_buffer *buf); |
| 76 | −static void qeth_clear_output_buffer(struct qeth_qdio_out_q *queue, | |
| 77 | − struct qeth_qdio_out_buffer *buf, | |
| 78 | − enum qeth_qdio_buffer_states newbufstate); | |
| 79 | 76 | static int qeth_init_qdio_out_buf(struct qeth_qdio_out_q *, int); |
| 80 | 77 | |
| 81 | 78 | struct workqueue_struct *qeth_wq; |
| @@ -489,6 +486,7 @@ static void qeth_qdio_handle_aob(struct qeth_card *card, · 407 unmodified lines | ||
| 489 | 486 | struct qaob *aob; |
| 490 | 487 | struct qeth_qdio_out_buffer *buffer; |
| 491 | 488 | enum iucv_tx_notify notification; |
| 489 | + unsigned int i; | |
| 492 | 490 | |
| 493 | 491 | aob = (struct qaob *) phys_to_virt(phys_aob_addr); |
| 494 | 492 | QETH_CARD_TEXT(card, 5, "haob"); |
| @@ -513,10 +511,18 @@ static void qeth_qdio_handle_aob(struct qeth_card *card, · 18 unmodified lines | ||
| 513 | 511 | qeth_notify_skbs(buffer->q, buffer, notification); |
| 514 | 512 | |
| 515 | 513 | buffer->aob = NULL; |
| 516 | − qeth_clear_output_buffer(buffer->q, buffer, | |
| 517 | − QETH_QDIO_BUF_HANDLED_DELAYED); | |
| 514 | + /* Free dangling allocations. The attached skbs are handled by | |
| 515 | + * qeth_cleanup_handled_pending(). | |
| 516 | + */ | |
| 517 | + for (i = 0; | |
| 518 | + i < aob->sb_count && i < QETH_MAX_BUFFER_ELEMENTS(card); | |
| 519 | + i++) { | |
| 520 | + if (aob->sba[i] && buffer->is_header[i]) | |
| 521 | + kmem_cache_free(qeth_core_header_cache, | |
| 522 | + (void *) aob->sba[i]); | |
| 523 | + } | |
| 524 | + atomic_set(&buffer->state, QETH_QDIO_BUF_HANDLED_DELAYED); | |
| 518 | 525 | |
| 519 | − /* from here on: do not touch buffer anymore */ | |
| 520 | 526 | qdio_release_aob(aob); |
| 521 | 527 | } |
| 522 | 528 | |
| @@ -3759,6 +3765,10 @@ static void qeth_qdio_output_handler(struct ccw_device *ccwdev, · 3236 unmodified lines | ||
| 3759 | 3765 | QETH_CARD_TEXT(queue->card, 5, "aob"); |
| 3760 | 3766 | QETH_CARD_TEXT_(queue->card, 5, "%lx", |
| 3761 | 3767 | virt_to_phys(buffer->aob)); |
| 3768 | + | |
| 3769 | + /* prepare the queue slot for re-use: */ | |
| 3770 | + qeth_scrub_qdio_buffer(buffer->buffer, | |
| 3771 | + QETH_MAX_BUFFER_ELEMENTS(card)); | |
| 3762 | 3772 | if (qeth_init_qdio_out_buf(queue, bidx)) { |
| 3763 | 3773 | QETH_CARD_TEXT(card, 2, "outofbuf"); |
| 3764 | 3774 | qeth_schedule_recovery(card); |
| @@ -4834,7 +4844,7 @@ int qeth_vm_request_mac(struct qeth_card *card) · 1069 unmodified lines | ||
| 4834 | 4844 | goto out; |
| 4835 | 4845 | } |
| 4836 | 4846 | |
| 4837 | − ccw_device_get_id(CARD_RDEV(card), &id); | |
| 4847 | + ccw_device_get_id(CARD_DDEV(card), &id); | |
| 4838 | 4848 | request->resp_buf_len = sizeof(*response); |
| 4839 | 4849 | request->resp_version = DIAG26C_VERSION2; |
| 4840 | 4850 | request->op_code = DIAG26C_GET_MAC; |
| @@ -6459,28 +6469,27 @@ static int qeth_set_ipa_rx_csum(struct qeth_card *card, bool on) · 1618 unmodified lines | ||
| 6459 | 6469 | #define QETH_HW_FEATURES (NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_TSO | \ |
| 6460 | 6470 | NETIF_F_IPV6_CSUM) |
| 6461 | 6471 | /** |
| 6462 | − * qeth_recover_features() - Restore device features after recovery | |
| 6463 | − * @dev: the recovering net_device | |
| 6464 | − * | |
| 6465 | − * Caller must hold rtnl lock. | |
| 6472 | + * qeth_enable_hw_features() - (Re-)Enable HW functions for device features | |
| 6473 | + * @dev: a net_device | |
| 6466 | 6474 | */ |
| 6467 | −void qeth_recover_features(struct net_device *dev) | |
| 6475 | +void qeth_enable_hw_features(struct net_device *dev) | |
| 6468 | 6476 | { |
| 6469 | − netdev_features_t features = dev->features; | |
| 6470 | 6477 | struct qeth_card *card = dev->ml_priv; |
| 6478 | + netdev_features_t features; | |
| 6471 | 6479 | |
| 6480 | + rtnl_lock(); | |
| 6481 | + features = dev->features; | |
| 6472 | 6482 | /* force-off any feature that needs an IPA sequence. |
| 6473 | 6483 | * netdev_update_features() will restart them. |
| 6474 | 6484 | */ |
| 6475 | 6485 | dev->features &= ~QETH_HW_FEATURES; |
| 6476 | 6486 | netdev_update_features(dev); |
| 6477 | − | |
| 6478 | − if (features == dev->features) | |
| 6479 | − return; | |
| 6480 | − dev_warn(&card->gdev->dev, | |
| 6481 | − "Device recovery failed to restore all offload features\n"); | |
| 6487 | + if (features != dev->features) | |
| 6488 | + dev_warn(&card->gdev->dev, | |
| 6489 | + "Device recovery failed to restore all offload features\n"); | |
| 6490 | + rtnl_unlock(); | |
| 6482 | 6491 | } |
| 6483 | −EXPORT_SYMBOL_GPL(qeth_recover_features); | |
| 6492 | +EXPORT_SYMBOL_GPL(qeth_enable_hw_features); | |
| 6484 | 6493 | |
| 6485 | 6494 | int qeth_set_features(struct net_device *dev, netdev_features_t features) |
| 6486 | 6495 | { |
| @@ -140,7 +140,7 @@ static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac) · 139 unmodified lines | ||
| 140 | 140 | |
| 141 | 141 | static int qeth_l2_write_mac(struct qeth_card *card, u8 *mac) |
| 142 | 142 | { |
| 143 | − enum qeth_ipa_cmds cmd = is_multicast_ether_addr_64bits(mac) ? | |
| 143 | + enum qeth_ipa_cmds cmd = is_multicast_ether_addr(mac) ? | |
| 144 | 144 | IPA_CMD_SETGMAC : IPA_CMD_SETVMAC; |
| 145 | 145 | int rc; |
| 146 | 146 | |
| @@ -157,7 +157,7 @@ static int qeth_l2_write_mac(struct qeth_card *card, u8 *mac) · 10 unmodified lines | ||
| 157 | 157 | |
| 158 | 158 | static int qeth_l2_remove_mac(struct qeth_card *card, u8 *mac) |
| 159 | 159 | { |
| 160 | − enum qeth_ipa_cmds cmd = is_multicast_ether_addr_64bits(mac) ? | |
| 160 | + enum qeth_ipa_cmds cmd = is_multicast_ether_addr(mac) ? | |
| 161 | 161 | IPA_CMD_DELGMAC : IPA_CMD_DELVMAC; |
| 162 | 162 | int rc; |
| 163 | 163 | |
| @@ -501,27 +501,34 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p) · 337 unmodified lines | ||
| 501 | 501 | return -ERESTARTSYS; |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | + /* avoid racing against concurrent state change: */ | |
| 505 | + if (!mutex_trylock(&card->conf_mutex)) | |
| 506 | + return -EAGAIN; | |
| 507 | + | |
| 504 | 508 | if (!qeth_card_hw_is_reachable(card)) { |
| 505 | 509 | ether_addr_copy(dev->dev_addr, addr->sa_data); |
| 506 | − return 0; | |
| 510 | + goto out_unlock; | |
| 507 | 511 | } |
| 508 | 512 | |
| 509 | 513 | /* don't register the same address twice */ |
| 510 | 514 | if (ether_addr_equal_64bits(dev->dev_addr, addr->sa_data) && |
| 511 | 515 | (card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED)) |
| 512 | − return 0; | |
| 516 | + goto out_unlock; | |
| 513 | 517 | |
| 514 | 518 | /* add the new address, switch over, drop the old */ |
| 515 | 519 | rc = qeth_l2_send_setmac(card, addr->sa_data); |
| 516 | 520 | if (rc) |
| 517 | − return rc; | |
| 521 | + goto out_unlock; | |
| 518 | 522 | ether_addr_copy(old_addr, dev->dev_addr); |
| 519 | 523 | ether_addr_copy(dev->dev_addr, addr->sa_data); |
| 520 | 524 | |
| 521 | 525 | if (card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED) |
| 522 | 526 | qeth_l2_remove_mac(card, old_addr); |
| 523 | 527 | card->info.mac_bits |= QETH_LAYER2_MAC_REGISTERED; |
| 524 | − return 0; | |
| 528 | + | |
| 529 | +out_unlock: | |
| 530 | + mutex_unlock(&card->conf_mutex); | |
| 531 | + return rc; | |
| 525 | 532 | } |
| 526 | 533 | |
| 527 | 534 | static void qeth_promisc_to_bridge(struct qeth_card *card) |
| @@ -1112,6 +1119,8 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode) · 584 unmodified lines | ||
| 1112 | 1119 | netif_carrier_off(card->dev); |
| 1113 | 1120 | |
| 1114 | 1121 | qeth_set_allowed_threads(card, 0xffffffff, 0); |
| 1122 | + | |
| 1123 | + qeth_enable_hw_features(card->dev); | |
| 1115 | 1124 | if (recover_flag == CARD_STATE_RECOVER) { |
| 1116 | 1125 | if (recovery_mode && |
| 1117 | 1126 | card->info.type != QETH_CARD_TYPE_OSN) { |
| @@ -1123,9 +1132,6 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode) · 5 unmodified lines | ||
| 1123 | 1132 | } |
| 1124 | 1133 | /* this also sets saved unicast addresses */ |
| 1125 | 1134 | qeth_l2_set_rx_mode(card->dev); |
| 1126 | − rtnl_lock(); | |
| 1127 | − qeth_recover_features(card->dev); | |
| 1128 | − rtnl_unlock(); | |
| 1129 | 1135 | } |
| 1130 | 1136 | /* let user_space know that device is online */ |
| 1131 | 1137 | kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE); |
| @@ -2662,6 +2662,8 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) · 2661 unmodified lines | ||
| 2662 | 2662 | netif_carrier_on(card->dev); |
| 2663 | 2663 | else |
| 2664 | 2664 | netif_carrier_off(card->dev); |
| 2665 | + | |
| 2666 | + qeth_enable_hw_features(card->dev); | |
| 2665 | 2667 | if (recover_flag == CARD_STATE_RECOVER) { |
| 2666 | 2668 | rtnl_lock(); |
| 2667 | 2669 | if (recovery_mode) |
| @@ -2669,7 +2671,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) · 1 unmodified line | ||
| 2669 | 2671 | else |
| 2670 | 2672 | dev_open(card->dev); |
| 2671 | 2673 | qeth_l3_set_rx_mode(card->dev); |
| 2672 | − qeth_recover_features(card->dev); | |
| 2673 | 2674 | rtnl_unlock(); |
| 2674 | 2675 | } |
| 2675 | 2676 | qeth_trace_features(card); |
| @@ -760,7 +760,6 @@ static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg, · 759 unmodified lines | ||
| 760 | 760 | ioa_cfg->hrrq[i].allow_interrupts = 0; |
| 761 | 761 | spin_unlock(&ioa_cfg->hrrq[i]._lock); |
| 762 | 762 | } |
| 763 | − wmb(); | |
| 764 | 763 | |
| 765 | 764 | /* Set interrupt mask to stop all new interrupts */ |
| 766 | 765 | if (ioa_cfg->sis64) |
| @@ -8403,7 +8402,6 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd) · 7636 unmodified lines | ||
| 8403 | 8402 | ioa_cfg->hrrq[i].allow_interrupts = 1; |
| 8404 | 8403 | spin_unlock(&ioa_cfg->hrrq[i]._lock); |
| 8405 | 8404 | } |
| 8406 | − wmb(); | |
| 8407 | 8405 | if (ioa_cfg->sis64) { |
| 8408 | 8406 | /* Set the adapter to the correct endian mode. */ |
| 8409 | 8407 | writel(IPR_ENDIAN_SWAP_KEY, ioa_cfg->regs.endian_swap_reg); |
| @@ -1224,7 +1224,6 @@ static void qla24xx_chk_fcp_state(struct fc_port *sess) · 1223 unmodified lines | ||
| 1224 | 1224 | void qlt_schedule_sess_for_deletion(struct fc_port *sess) |
| 1225 | 1225 | { |
| 1226 | 1226 | struct qla_tgt *tgt = sess->tgt; |
| 1227 | − struct qla_hw_data *ha = sess->vha->hw; | |
| 1228 | 1227 | unsigned long flags; |
| 1229 | 1228 | |
| 1230 | 1229 | if (sess->disc_state == DSC_DELETE_PEND) |
| @@ -1241,16 +1240,16 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) · 10 unmodified lines | ||
| 1241 | 1240 | return; |
| 1242 | 1241 | } |
| 1243 | 1242 | |
| 1244 | − spin_lock_irqsave(&ha->tgt.sess_lock, flags); | |
| 1245 | 1243 | if (sess->deleted == QLA_SESS_DELETED) |
| 1246 | 1244 | sess->logout_on_delete = 0; |
| 1247 | 1245 | |
| 1246 | + spin_lock_irqsave(&sess->vha->work_lock, flags); | |
| 1248 | 1247 | if (sess->deleted == QLA_SESS_DELETION_IN_PROGRESS) { |
| 1249 | − spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); | |
| 1248 | + spin_unlock_irqrestore(&sess->vha->work_lock, flags); | |
| 1250 | 1249 | return; |
| 1251 | 1250 | } |
| 1252 | 1251 | sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; |
| 1253 | − spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); | |
| 1252 | + spin_unlock_irqrestore(&sess->vha->work_lock, flags); | |
| 1254 | 1253 | |
| 1255 | 1254 | sess->disc_state = DSC_DELETE_PEND; |
| 1256 | 1255 | |
| @@ -5507,9 +5507,9 @@ static void __exit scsi_debug_exit(void) · 5506 unmodified lines | ||
| 5507 | 5507 | int k = sdebug_add_host; |
| 5508 | 5508 | |
| 5509 | 5509 | stop_all_queued(); |
| 5510 | − free_all_queued(); | |
| 5511 | 5510 | for (; k; k--) |
| 5512 | 5511 | sdebug_remove_adapter(); |
| 5512 | + free_all_queued(); | |
| 5513 | 5513 | driver_unregister(&sdebug_driverfs_driver); |
| 5514 | 5514 | bus_unregister(&pseudo_lld_bus); |
| 5515 | 5515 | root_device_unregister(pseudo_primary); |
| @@ -39,10 +39,15 @@ · 38 unmodified lines | ||
| 39 | 39 | |
| 40 | 40 | #define GPC_M4_PU_PDN_FLG 0x1bc |
| 41 | 41 | |
| 42 | − | |
| 43 | −#define PGC_MIPI 4 | |
| 44 | −#define PGC_PCIE 5 | |
| 45 | −#define PGC_USB_HSIC 8 | |
| 42 | +/* | |
| 43 | + * The PGC offset values in Reference Manual | |
| 44 | + * (Rev. 1, 01/2018 and the older ones) GPC chapter's | |
| 45 | + * GPC_PGC memory map are incorrect, below offset | |
| 46 | + * values are from design RTL. | |
| 47 | + */ | |
| 48 | +#define PGC_MIPI 16 | |
| 49 | +#define PGC_PCIE 17 | |
| 50 | +#define PGC_USB_HSIC 20 | |
| 46 | 51 | #define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40) |
| 47 | 52 | #define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0xc) |
| 48 | 53 | |
| @@ -5,7 +5,8 @@ menu "Qualcomm SoC drivers" · 4 unmodified lines | ||
| 5 | 5 | |
| 6 | 6 | config QCOM_COMMAND_DB |
| 7 | 7 | bool "Qualcomm Command DB" |
| 8 | − depends on (ARCH_QCOM && OF) || COMPILE_TEST | |
| 8 | + depends on ARCH_QCOM || COMPILE_TEST | |
| 9 | + depends on OF_RESERVED_MEM | |
| 9 | 10 | help |
| 10 | 11 | Command DB queries shared memory by key string for shared system |
| 11 | 12 | resources. Platform drivers that require to set state of a shared |
| @@ -194,11 +194,12 @@ static int rcar_sysc_pd_power_on(struct generic_pm_domain *genpd) · 193 unmodified lines | ||
| 194 | 194 | |
| 195 | 195 | static bool has_cpg_mstp; |
| 196 | 196 | |
| 197 | −static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd) | |
| 197 | +static int __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd) | |
| 198 | 198 | { |
| 199 | 199 | struct generic_pm_domain *genpd = &pd->genpd; |
| 200 | 200 | const char *name = pd->genpd.name; |
| 201 | 201 | struct dev_power_governor *gov = &simple_qos_governor; |
| 202 | + int error; | |
| 202 | 203 | |
| 203 | 204 | if (pd->flags & PD_CPU) { |
| 204 | 205 | /* |
| @@ -251,7 +252,11 @@ static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd) · 46 unmodified lines | ||
| 251 | 252 | rcar_sysc_power_up(&pd->ch); |
| 252 | 253 | |
| 253 | 254 | finalize: |
| 254 | − pm_genpd_init(genpd, gov, false); | |
| 255 | + error = pm_genpd_init(genpd, gov, false); | |
| 256 | + if (error) | |
| 257 | + pr_err("Failed to init PM domain %s: %d\n", name, error); | |
| 258 | + | |
| 259 | + return error; | |
| 255 | 260 | } |
| 256 | 261 | |
| 257 | 262 | static const struct of_device_id rcar_sysc_matches[] __initconst = { |
| @@ -375,6 +380,9 @@ static int __init rcar_sysc_pd_init(void) · 117 unmodified lines | ||
| 375 | 380 | pr_debug("%pOF: syscier = 0x%08x\n", np, syscier); |
| 376 | 381 | iowrite32(syscier, base + SYSCIER); |
| 377 | 382 | |
| 383 | + /* | |
| 384 | + * First, create all PM domains | |
| 385 | + */ | |
| 378 | 386 | for (i = 0; i < info->num_areas; i++) { |
| 379 | 387 | const struct rcar_sysc_area *area = &info->areas[i]; |
| 380 | 388 | struct rcar_sysc_pd *pd; |
| @@ -397,14 +405,29 @@ static int __init rcar_sysc_pd_init(void) · 16 unmodified lines | ||
| 397 | 405 | pd->ch.isr_bit = area->isr_bit; |
| 398 | 406 | pd->flags = area->flags; |
| 399 | 407 | |
| 400 | − rcar_sysc_pd_setup(pd); | |
| 401 | − if (area->parent >= 0) | |
| 402 | − pm_genpd_add_subdomain(domains->domains[area->parent], | |
| 403 | − &pd->genpd); | |
| 408 | + error = rcar_sysc_pd_setup(pd); | |
| 409 | + if (error) | |
| 410 | + goto out_put; | |
| 404 | 411 | |
| 405 | 412 | domains->domains[area->isr_bit] = &pd->genpd; |
| 406 | 413 | } |
| 407 | 414 | |
| 415 | + /* | |
| 416 | + * Second, link all PM domains to their parents | |
| 417 | + */ | |
| 418 | + for (i = 0; i < info->num_areas; i++) { | |
| 419 | + const struct rcar_sysc_area *area = &info->areas[i]; | |
| 420 | + | |
| 421 | + if (!area->name || area->parent < 0) | |
| 422 | + continue; | |
| 423 | + | |
| 424 | + error = pm_genpd_add_subdomain(domains->domains[area->parent], | |
| 425 | + domains->domains[area->isr_bit]); | |
| 426 | + if (error) | |
| 427 | + pr_warn("Failed to add PM subdomain %s to parent %u\n", | |
| 428 | + area->name, area->parent); | |
| 429 | + } | |
| 430 | + | |
| 408 | 431 | error = of_genpd_add_provider_onecell(np, &domains->onecell_data); |
| 409 | 432 | |
| 410 | 433 | out_put: |
| @@ -30,7 +30,7 @@ void *ion_heap_map_kernel(struct ion_heap *heap, · 29 unmodified lines | ||
| 30 | 30 | struct page **tmp = pages; |
| 31 | 31 | |
| 32 | 32 | if (!pages) |
| 33 | − return NULL; | |
| 33 | + return ERR_PTR(-ENOMEM); | |
| 34 | 34 | |
| 35 | 35 | if (buffer->flags & ION_FLAG_CACHED) |
| 36 | 36 | pgprot = PAGE_KERNEL; |
| @@ -642,7 +642,7 @@ static int daqp_ao_insn_write(struct comedi_device *dev, · 641 unmodified lines | ||
| 642 | 642 | /* Make sure D/A update mode is direct update */ |
| 643 | 643 | outb(0, dev->iobase + DAQP_AUX_REG); |
| 644 | 644 | |
| 645 | − for (i = 0; i > insn->n; i++) { | |
| 645 | + for (i = 0; i < insn->n; i++) { | |
| 646 | 646 | unsigned int val = data[i]; |
| 647 | 647 | int ret; |
| 648 | 648 | |
| @@ -11,6 +11,7 @@ config TYPEC_TCPCI · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | config TYPEC_RT1711H |
| 13 | 13 | tristate "Richtek RT1711H Type-C chip driver" |
| 14 | + depends on I2C | |
| 14 | 15 | select TYPEC_TCPCI |
| 15 | 16 | help |
| 16 | 17 | Richtek RT1711H Type-C chip driver that works with |
| @@ -656,7 +656,7 @@ static void scatter_data_area(struct tcmu_dev *udev, · 655 unmodified lines | ||
| 656 | 656 | } |
| 657 | 657 | |
| 658 | 658 | static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, |
| 659 | − bool bidi) | |
| 659 | + bool bidi, uint32_t read_len) | |
| 660 | 660 | { |
| 661 | 661 | struct se_cmd *se_cmd = cmd->se_cmd; |
| 662 | 662 | int i, dbi; |
| @@ -689,7 +689,7 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, · 26 unmodified lines | ||
| 689 | 689 | for_each_sg(data_sg, sg, data_nents, i) { |
| 690 | 690 | int sg_remaining = sg->length; |
| 691 | 691 | to = kmap_atomic(sg_page(sg)) + sg->offset; |
| 692 | − while (sg_remaining > 0) { | |
| 692 | + while (sg_remaining > 0 && read_len > 0) { | |
| 693 | 693 | if (block_remaining == 0) { |
| 694 | 694 | if (from) |
| 695 | 695 | kunmap_atomic(from); |
| @@ -701,6 +701,8 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, · 5 unmodified lines | ||
| 701 | 701 | } |
| 702 | 702 | copy_bytes = min_t(size_t, sg_remaining, |
| 703 | 703 | block_remaining); |
| 704 | + if (read_len < copy_bytes) | |
| 705 | + copy_bytes = read_len; | |
| 704 | 706 | offset = DATA_BLOCK_SIZE - block_remaining; |
| 705 | 707 | tcmu_flush_dcache_range(from, copy_bytes); |
| 706 | 708 | memcpy(to + sg->length - sg_remaining, from + offset, |
| @@ -708,8 +710,11 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, · 1 unmodified line | ||
| 708 | 710 | |
| 709 | 711 | sg_remaining -= copy_bytes; |
| 710 | 712 | block_remaining -= copy_bytes; |
| 713 | + read_len -= copy_bytes; | |
| 711 | 714 | } |
| 712 | 715 | kunmap_atomic(to - sg->offset); |
| 716 | + if (read_len == 0) | |
| 717 | + break; | |
| 713 | 718 | } |
| 714 | 719 | if (from) |
| 715 | 720 | kunmap_atomic(from); |
| @@ -1042,6 +1047,8 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * · 326 unmodified lines | ||
| 1042 | 1047 | { |
| 1043 | 1048 | struct se_cmd *se_cmd = cmd->se_cmd; |
| 1044 | 1049 | struct tcmu_dev *udev = cmd->tcmu_dev; |
| 1050 | + bool read_len_valid = false; | |
| 1051 | + uint32_t read_len = se_cmd->data_length; | |
| 1045 | 1052 | |
| 1046 | 1053 | /* |
| 1047 | 1054 | * cmd has been completed already from timeout, just reclaim |
| @@ -1056,13 +1063,28 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * · 8 unmodified lines | ||
| 1056 | 1063 | pr_warn("TCMU: Userspace set UNKNOWN_OP flag on se_cmd %p\n", |
| 1057 | 1064 | cmd->se_cmd); |
| 1058 | 1065 | entry->rsp.scsi_status = SAM_STAT_CHECK_CONDITION; |
| 1059 | − } else if (entry->rsp.scsi_status == SAM_STAT_CHECK_CONDITION) { | |
| 1066 | + goto done; | |
| 1067 | + } | |
| 1068 | + | |
| 1069 | + if (se_cmd->data_direction == DMA_FROM_DEVICE && | |
| 1070 | + (entry->hdr.uflags & TCMU_UFLAG_READ_LEN) && entry->rsp.read_len) { | |
| 1071 | + read_len_valid = true; | |
| 1072 | + if (entry->rsp.read_len < read_len) | |
| 1073 | + read_len = entry->rsp.read_len; | |
| 1074 | + } | |
| 1075 | + | |
| 1076 | + if (entry->rsp.scsi_status == SAM_STAT_CHECK_CONDITION) { | |
| 1060 | 1077 | transport_copy_sense_to_cmd(se_cmd, entry->rsp.sense_buffer); |
| 1061 | − } else if (se_cmd->se_cmd_flags & SCF_BIDI) { | |
| 1078 | + if (!read_len_valid ) | |
| 1079 | + goto done; | |
| 1080 | + else | |
| 1081 | + se_cmd->se_cmd_flags |= SCF_TREAT_READ_AS_NORMAL; | |
| 1082 | + } | |
| 1083 | + if (se_cmd->se_cmd_flags & SCF_BIDI) { | |
| 1062 | 1084 | /* Get Data-In buffer before clean up */ |
| 1063 | − gather_data_area(udev, cmd, true); | |
| 1085 | + gather_data_area(udev, cmd, true, read_len); | |
| 1064 | 1086 | } else if (se_cmd->data_direction == DMA_FROM_DEVICE) { |
| 1065 | − gather_data_area(udev, cmd, false); | |
| 1087 | + gather_data_area(udev, cmd, false, read_len); | |
| 1066 | 1088 | } else if (se_cmd->data_direction == DMA_TO_DEVICE) { |
| 1067 | 1089 | /* TODO: */ |
| 1068 | 1090 | } else if (se_cmd->data_direction != DMA_NONE) { |
| @@ -1070,7 +1092,13 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * · 1 unmodified line | ||
| 1070 | 1092 | se_cmd->data_direction); |
| 1071 | 1093 | } |
| 1072 | 1094 | |
| 1073 | − target_complete_cmd(cmd->se_cmd, entry->rsp.scsi_status); | |
| 1095 | +done: | |
| 1096 | + if (read_len_valid) { | |
| 1097 | + pr_debug("read_len = %d\n", read_len); | |
| 1098 | + target_complete_cmd_with_length(cmd->se_cmd, | |
| 1099 | + entry->rsp.scsi_status, read_len); | |
| 1100 | + } else | |
| 1101 | + target_complete_cmd(cmd->se_cmd, entry->rsp.scsi_status); | |
| 1074 | 1102 | |
| 1075 | 1103 | out: |
| 1076 | 1104 | cmd->se_cmd = NULL; |
| @@ -1740,7 +1768,7 @@ static int tcmu_configure_device(struct se_device *dev) · 663 unmodified lines | ||
| 1740 | 1768 | /* Initialise the mailbox of the ring buffer */ |
| 1741 | 1769 | mb = udev->mb_addr; |
| 1742 | 1770 | mb->version = TCMU_MAILBOX_VERSION; |
| 1743 | − mb->flags = TCMU_MAILBOX_FLAG_CAP_OOOC; | |
| 1771 | + mb->flags = TCMU_MAILBOX_FLAG_CAP_OOOC | TCMU_MAILBOX_FLAG_CAP_READ_LEN; | |
| 1744 | 1772 | mb->cmdr_off = CMDR_OFF; |
| 1745 | 1773 | mb->cmdr_size = udev->cmdr_size; |
| 1746 | 1774 | |
| @@ -124,6 +124,8 @@ struct n_tty_data { · 123 unmodified lines | ||
| 124 | 124 | struct mutex output_lock; |
| 125 | 125 | }; |
| 126 | 126 | |
| 127 | +#define MASK(x) ((x) & (N_TTY_BUF_SIZE - 1)) | |
| 128 | + | |
| 127 | 129 | static inline size_t read_cnt(struct n_tty_data *ldata) |
| 128 | 130 | { |
| 129 | 131 | return ldata->read_head - ldata->read_tail; |
| @@ -141,6 +143,7 @@ static inline unsigned char *read_buf_addr(struct n_tty_data *ldata, size_t i) · 11 unmodified lines | ||
| 141 | 143 | |
| 142 | 144 | static inline unsigned char echo_buf(struct n_tty_data *ldata, size_t i) |
| 143 | 145 | { |
| 146 | + smp_rmb(); /* Matches smp_wmb() in add_echo_byte(). */ | |
| 144 | 147 | return ldata->echo_buf[i & (N_TTY_BUF_SIZE - 1)]; |
| 145 | 148 | } |
| 146 | 149 | |
| @@ -316,9 +319,7 @@ static inline void put_tty_queue(unsigned char c, struct n_tty_data *ldata) · 169 unmodified lines | ||
| 316 | 319 | static void reset_buffer_flags(struct n_tty_data *ldata) |
| 317 | 320 | { |
| 318 | 321 | ldata->read_head = ldata->canon_head = ldata->read_tail = 0; |
| 319 | − ldata->echo_head = ldata->echo_tail = ldata->echo_commit = 0; | |
| 320 | 322 | ldata->commit_head = 0; |
| 321 | − ldata->echo_mark = 0; | |
| 322 | 323 | ldata->line_start = 0; |
| 323 | 324 | |
| 324 | 325 | ldata->erasing = 0; |
| @@ -617,12 +618,19 @@ static size_t __process_echoes(struct tty_struct *tty) · 292 unmodified lines | ||
| 617 | 618 | old_space = space = tty_write_room(tty); |
| 618 | 619 | |
| 619 | 620 | tail = ldata->echo_tail; |
| 620 | − while (ldata->echo_commit != tail) { | |
| 621 | + while (MASK(ldata->echo_commit) != MASK(tail)) { | |
| 621 | 622 | c = echo_buf(ldata, tail); |
| 622 | 623 | if (c == ECHO_OP_START) { |
| 623 | 624 | unsigned char op; |
| 624 | 625 | int no_space_left = 0; |
| 625 | 626 | |
| 627 | + /* | |
| 628 | + * Since add_echo_byte() is called without holding | |
| 629 | + * output_lock, we might see only portion of multi-byte | |
| 630 | + * operation. | |
| 631 | + */ | |
| 632 | + if (MASK(ldata->echo_commit) == MASK(tail + 1)) | |
| 633 | + goto not_yet_stored; | |
| 626 | 634 | /* |
| 627 | 635 | * If the buffer byte is the start of a multi-byte |
| 628 | 636 | * operation, get the next byte, which is either the |
| @@ -634,6 +642,8 @@ static size_t __process_echoes(struct tty_struct *tty) · 5 unmodified lines | ||
| 634 | 642 | unsigned int num_chars, num_bs; |
| 635 | 643 | |
| 636 | 644 | case ECHO_OP_ERASE_TAB: |
| 645 | + if (MASK(ldata->echo_commit) == MASK(tail + 2)) | |
| 646 | + goto not_yet_stored; | |
| 637 | 647 | num_chars = echo_buf(ldata, tail + 2); |
| 638 | 648 | |
| 639 | 649 | /* |
| @@ -728,7 +738,8 @@ static size_t __process_echoes(struct tty_struct *tty) · 88 unmodified lines | ||
| 728 | 738 | /* If the echo buffer is nearly full (so that the possibility exists |
| 729 | 739 | * of echo overrun before the next commit), then discard enough |
| 730 | 740 | * data at the tail to prevent a subsequent overrun */ |
| 731 | − while (ldata->echo_commit - tail >= ECHO_DISCARD_WATERMARK) { | |
| 741 | + while (ldata->echo_commit > tail && | |
| 742 | + ldata->echo_commit - tail >= ECHO_DISCARD_WATERMARK) { | |
| 732 | 743 | if (echo_buf(ldata, tail) == ECHO_OP_START) { |
| 733 | 744 | if (echo_buf(ldata, tail + 1) == ECHO_OP_ERASE_TAB) |
| 734 | 745 | tail += 3; |
| @@ -738,6 +749,7 @@ static size_t __process_echoes(struct tty_struct *tty) · 3 unmodified lines | ||
| 738 | 749 | tail++; |
| 739 | 750 | } |
| 740 | 751 | |
| 752 | + not_yet_stored: | |
| 741 | 753 | ldata->echo_tail = tail; |
| 742 | 754 | return old_space - space; |
| 743 | 755 | } |
| @@ -748,6 +760,7 @@ static void commit_echoes(struct tty_struct *tty) · 4 unmodified lines | ||
| 748 | 760 | size_t nr, old, echoed; |
| 749 | 761 | size_t head; |
| 750 | 762 | |
| 763 | + mutex_lock(&ldata->output_lock); | |
| 751 | 764 | head = ldata->echo_head; |
| 752 | 765 | ldata->echo_mark = head; |
| 753 | 766 | old = ldata->echo_commit - ldata->echo_tail; |
| @@ -756,10 +769,12 @@ static void commit_echoes(struct tty_struct *tty) · 2 unmodified lines | ||
| 756 | 769 | * is over the threshold (and try again each time another |
| 757 | 770 | * block is accumulated) */ |
| 758 | 771 | nr = head - ldata->echo_tail; |
| 759 | − if (nr < ECHO_COMMIT_WATERMARK || (nr % ECHO_BLOCK > old % ECHO_BLOCK)) | |
| 772 | + if (nr < ECHO_COMMIT_WATERMARK || | |
| 773 | + (nr % ECHO_BLOCK > old % ECHO_BLOCK)) { | |
| 774 | + mutex_unlock(&ldata->output_lock); | |
| 760 | 775 | return; |
| 776 | + } | |
| 761 | 777 | |
| 762 | − mutex_lock(&ldata->output_lock); | |
| 763 | 778 | ldata->echo_commit = head; |
| 764 | 779 | echoed = __process_echoes(tty); |
| 765 | 780 | mutex_unlock(&ldata->output_lock); |
| @@ -810,7 +825,9 @@ static void flush_echoes(struct tty_struct *tty) · 44 unmodified lines | ||
| 810 | 825 | |
| 811 | 826 | static inline void add_echo_byte(unsigned char c, struct n_tty_data *ldata) |
| 812 | 827 | { |
| 813 | − *echo_buf_addr(ldata, ldata->echo_head++) = c; | |
| 828 | + *echo_buf_addr(ldata, ldata->echo_head) = c; | |
| 829 | + smp_wmb(); /* Matches smp_rmb() in echo_buf(). */ | |
| 830 | + ldata->echo_head++; | |
| 814 | 831 | } |
| 815 | 832 | |
| 816 | 833 | /** |
| @@ -978,14 +995,15 @@ static void eraser(unsigned char c, struct tty_struct *tty) · 161 unmodified lines | ||
| 978 | 995 | } |
| 979 | 996 | |
| 980 | 997 | seen_alnums = 0; |
| 981 | − while (ldata->read_head != ldata->canon_head) { | |
| 998 | + while (MASK(ldata->read_head) != MASK(ldata->canon_head)) { | |
| 982 | 999 | head = ldata->read_head; |
| 983 | 1000 | |
| 984 | 1001 | /* erase a single possibly multibyte character */ |
| 985 | 1002 | do { |
| 986 | 1003 | head--; |
| 987 | 1004 | c = read_buf(ldata, head); |
| 988 | − } while (is_continuation(c, tty) && head != ldata->canon_head); | |
| 1005 | + } while (is_continuation(c, tty) && | |
| 1006 | + MASK(head) != MASK(ldata->canon_head)); | |
| 989 | 1007 | |
| 990 | 1008 | /* do not partially erase */ |
| 991 | 1009 | if (is_continuation(c, tty)) |
| @@ -1027,7 +1045,7 @@ static void eraser(unsigned char c, struct tty_struct *tty) · 35 unmodified lines | ||
| 1027 | 1045 | * This info is used to go back the correct |
| 1028 | 1046 | * number of columns. |
| 1029 | 1047 | */ |
| 1030 | − while (tail != ldata->canon_head) { | |
| 1048 | + while (MASK(tail) != MASK(ldata->canon_head)) { | |
| 1031 | 1049 | tail--; |
| 1032 | 1050 | c = read_buf(ldata, tail); |
| 1033 | 1051 | if (c == '\t') { |
| @@ -1302,7 +1320,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c) · 268 unmodified lines | ||
| 1302 | 1320 | finish_erasing(ldata); |
| 1303 | 1321 | echo_char(c, tty); |
| 1304 | 1322 | echo_char_raw('\n', ldata); |
| 1305 | − while (tail != ldata->read_head) { | |
| 1323 | + while (MASK(tail) != MASK(ldata->read_head)) { | |
| 1306 | 1324 | echo_char(read_buf(ldata, tail), tty); |
| 1307 | 1325 | tail++; |
| 1308 | 1326 | } |
| @@ -1878,30 +1896,21 @@ static int n_tty_open(struct tty_struct *tty) · 569 unmodified lines | ||
| 1878 | 1896 | struct n_tty_data *ldata; |
| 1879 | 1897 | |
| 1880 | 1898 | /* Currently a malloc failure here can panic */ |
| 1881 | − ldata = vmalloc(sizeof(*ldata)); | |
| 1899 | + ldata = vzalloc(sizeof(*ldata)); | |
| 1882 | 1900 | if (!ldata) |
| 1883 | − goto err; | |
| 1901 | + return -ENOMEM; | |
| 1884 | 1902 | |
| 1885 | 1903 | ldata->overrun_time = jiffies; |
| 1886 | 1904 | mutex_init(&ldata->atomic_read_lock); |
| 1887 | 1905 | mutex_init(&ldata->output_lock); |
| 1888 | 1906 | |
| 1889 | 1907 | tty->disc_data = ldata; |
| 1890 | − reset_buffer_flags(tty->disc_data); | |
| 1891 | − ldata->column = 0; | |
| 1892 | − ldata->canon_column = 0; | |
| 1893 | − ldata->num_overrun = 0; | |
| 1894 | − ldata->no_room = 0; | |
| 1895 | − ldata->lnext = 0; | |
| 1896 | 1908 | tty->closing = 0; |
| 1897 | 1909 | /* indicate buffer work may resume */ |
| 1898 | 1910 | clear_bit(TTY_LDISC_HALTED, &tty->flags); |
| 1899 | 1911 | n_tty_set_termios(tty, NULL); |
| 1900 | 1912 | tty_unthrottle(tty); |
| 1901 | − | |
| 1902 | 1913 | return 0; |
| 1903 | −err: | |
| 1904 | − return -ENOMEM; | |
| 1905 | 1914 | } |
| 1906 | 1915 | |
| 1907 | 1916 | static inline int input_available_p(struct tty_struct *tty, int poll) |
| @@ -2411,7 +2420,7 @@ static unsigned long inq_canon(struct n_tty_data *ldata) · 503 unmodified lines | ||
| 2411 | 2420 | tail = ldata->read_tail; |
| 2412 | 2421 | nr = head - tail; |
| 2413 | 2422 | /* Skip EOF-chars.. */ |
| 2414 | − while (head != tail) { | |
| 2423 | + while (MASK(head) != MASK(tail)) { | |
| 2415 | 2424 | if (test_bit(tail & (N_TTY_BUF_SIZE - 1), ldata->read_flags) && |
| 2416 | 2425 | read_buf(ldata, tail) == __DISABLED_CHAR) |
| 2417 | 2426 | nr--; |
| @@ -617,6 +617,7 @@ EXPORT_SYMBOL_GPL(__serdev_device_driver_register); · 616 unmodified lines | ||
| 617 | 617 | static void __exit serdev_exit(void) |
| 618 | 618 | { |
| 619 | 619 | bus_unregister(&serdev_bus_type); |
| 620 | + ida_destroy(&ctrl_ida); | |
| 620 | 621 | } |
| 621 | 622 | module_exit(serdev_exit); |
| 622 | 623 | |
| @@ -3339,9 +3339,7 @@ static const struct pci_device_id blacklist[] = { · 3338 unmodified lines | ||
| 3339 | 3339 | /* multi-io cards handled by parport_serial */ |
| 3340 | 3340 | { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */ |
| 3341 | 3341 | { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */ |
| 3342 | − { PCI_DEVICE(0x4348, 0x7173), }, /* WCH CH355 4S */ | |
| 3343 | 3342 | { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */ |
| 3344 | − { PCI_DEVICE(0x1c00, 0x3470), }, /* WCH CH384 4S */ | |
| 3345 | 3343 | |
| 3346 | 3344 | /* Moxa Smartio MUE boards handled by 8250_moxa */ |
| 3347 | 3345 | { PCI_VDEVICE(MOXA, 0x1024), }, |
| @@ -784,7 +784,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ · 783 unmodified lines | ||
| 784 | 784 | if (!*vc->vc_uni_pagedir_loc) |
| 785 | 785 | con_set_default_unimap(vc); |
| 786 | 786 | |
| 787 | − vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL); | |
| 787 | + vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_KERNEL); | |
| 788 | 788 | if (!vc->vc_screenbuf) |
| 789 | 789 | goto err_free; |
| 790 | 790 | |
| @@ -871,7 +871,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, · 80 unmodified lines | ||
| 871 | 871 | |
| 872 | 872 | if (new_screen_size > (4 << 20)) |
| 873 | 873 | return -EINVAL; |
| 874 | − newscreen = kmalloc(new_screen_size, GFP_USER); | |
| 874 | + newscreen = kzalloc(new_screen_size, GFP_USER); | |
| 875 | 875 | if (!newscreen) |
| 876 | 876 | return -ENOMEM; |
| 877 | 877 | |
| @@ -124,8 +124,11 @@ static int host_start(struct ci_hdrc *ci) · 123 unmodified lines | ||
| 124 | 124 | |
| 125 | 125 | hcd->power_budget = ci->platdata->power_budget; |
| 126 | 126 | hcd->tpl_support = ci->platdata->tpl_support; |
| 127 | − if (ci->phy || ci->usb_phy) | |
| 127 | + if (ci->phy || ci->usb_phy) { | |
| 128 | 128 | hcd->skip_phy_initialization = 1; |
| 129 | + if (ci->usb_phy) | |
| 130 | + hcd->usb_phy = ci->usb_phy; | |
| 131 | + } | |
| 129 | 132 | |
| 130 | 133 | ehci = hcd_to_ehci(hcd); |
| 131 | 134 | ehci->caps = ci->hw_bank.cap; |
| @@ -1758,6 +1758,9 @@ static const struct usb_device_id acm_ids[] = { · 1757 unmodified lines | ||
| 1758 | 1758 | { USB_DEVICE(0x11ca, 0x0201), /* VeriFone Mx870 Gadget Serial */ |
| 1759 | 1759 | .driver_info = SINGLE_RX_URB, |
| 1760 | 1760 | }, |
| 1761 | + { USB_DEVICE(0x1965, 0x0018), /* Uniden UBC125XLT */ | |
| 1762 | + .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ | |
| 1763 | + }, | |
| 1761 | 1764 | { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */ |
| 1762 | 1765 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ |
| 1763 | 1766 | }, |
| @@ -1004,6 +1004,7 @@ struct dwc2_hregs_backup { · 1003 unmodified lines | ||
| 1004 | 1004 | * @frame_list_sz: Frame list size |
| 1005 | 1005 | * @desc_gen_cache: Kmem cache for generic descriptors |
| 1006 | 1006 | * @desc_hsisoc_cache: Kmem cache for hs isochronous descriptors |
| 1007 | + * @unaligned_cache: Kmem cache for DMA mode to handle non-aligned buf | |
| 1007 | 1008 | * |
| 1008 | 1009 | * These are for peripheral mode: |
| 1009 | 1010 | * |
| @@ -1177,6 +1178,8 @@ struct dwc2_hsotg { · 167 unmodified lines | ||
| 1177 | 1178 | u32 frame_list_sz; |
| 1178 | 1179 | struct kmem_cache *desc_gen_cache; |
| 1179 | 1180 | struct kmem_cache *desc_hsisoc_cache; |
| 1181 | + struct kmem_cache *unaligned_cache; | |
| 1182 | +#define DWC2_KMEM_UNALIGNED_BUF_SIZE 1024 | |
| 1180 | 1183 | |
| 1181 | 1184 | #endif /* CONFIG_USB_DWC2_HOST || CONFIG_USB_DWC2_DUAL_ROLE */ |
| 1182 | 1185 | |
| @@ -812,6 +812,7 @@ static int dwc2_gadget_fill_isoc_desc(struct dwc2_hsotg_ep *hs_ep, · 811 unmodified lines | ||
| 812 | 812 | u32 index; |
| 813 | 813 | u32 maxsize = 0; |
| 814 | 814 | u32 mask = 0; |
| 815 | + u8 pid = 0; | |
| 815 | 816 | |
| 816 | 817 | maxsize = dwc2_gadget_get_desc_params(hs_ep, &mask); |
| 817 | 818 | |
| @@ -840,7 +841,11 @@ static int dwc2_gadget_fill_isoc_desc(struct dwc2_hsotg_ep *hs_ep, · 22 unmodified lines | ||
| 840 | 841 | ((len << DEV_DMA_NBYTES_SHIFT) & mask)); |
| 841 | 842 | |
| 842 | 843 | if (hs_ep->dir_in) { |
| 843 | − desc->status |= ((hs_ep->mc << DEV_DMA_ISOC_PID_SHIFT) & | |
| 844 | + if (len) | |
| 845 | + pid = DIV_ROUND_UP(len, hs_ep->ep.maxpacket); | |
| 846 | + else | |
| 847 | + pid = 1; | |
| 848 | + desc->status |= ((pid << DEV_DMA_ISOC_PID_SHIFT) & | |
| 844 | 849 | DEV_DMA_ISOC_PID_MASK) | |
| 845 | 850 | ((len % hs_ep->ep.maxpacket) ? |
| 846 | 851 | DEV_DMA_SHORT : 0) | |
| @@ -884,6 +889,7 @@ static void dwc2_gadget_start_isoc_ddma(struct dwc2_hsotg_ep *hs_ep) · 37 unmodified lines | ||
| 884 | 889 | struct dwc2_dma_desc *desc; |
| 885 | 890 | |
| 886 | 891 | if (list_empty(&hs_ep->queue)) { |
| 892 | + hs_ep->target_frame = TARGET_FRAME_INITIAL; | |
| 887 | 893 | dev_dbg(hsotg->dev, "%s: No requests in queue\n", __func__); |
| 888 | 894 | return; |
| 889 | 895 | } |
| @@ -2755,8 +2761,6 @@ static void dwc2_gadget_handle_out_token_ep_disabled(struct dwc2_hsotg_ep *ep) · 1865 unmodified lines | ||
| 2755 | 2761 | */ |
| 2756 | 2762 | tmp = dwc2_hsotg_read_frameno(hsotg); |
| 2757 | 2763 | |
| 2758 | − dwc2_hsotg_complete_request(hsotg, ep, get_ep_head(ep), 0); | |
| 2759 | − | |
| 2760 | 2764 | if (using_desc_dma(hsotg)) { |
| 2761 | 2765 | if (ep->target_frame == TARGET_FRAME_INITIAL) { |
| 2762 | 2766 | /* Start first ISO Out */ |
| @@ -2817,9 +2821,6 @@ static void dwc2_gadget_handle_nak(struct dwc2_hsotg_ep *hs_ep) · 54 unmodified lines | ||
| 2817 | 2821 | |
| 2818 | 2822 | tmp = dwc2_hsotg_read_frameno(hsotg); |
| 2819 | 2823 | if (using_desc_dma(hsotg)) { |
| 2820 | − dwc2_hsotg_complete_request(hsotg, hs_ep, | |
| 2821 | − get_ep_head(hs_ep), 0); | |
| 2822 | − | |
| 2823 | 2824 | hs_ep->target_frame = tmp; |
| 2824 | 2825 | dwc2_gadget_incr_frame_num(hs_ep); |
| 2825 | 2826 | dwc2_gadget_start_isoc_ddma(hs_ep); |
| @@ -4739,9 +4740,11 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg) · 1913 unmodified lines | ||
| 4739 | 4740 | } |
| 4740 | 4741 | |
| 4741 | 4742 | ret = usb_add_gadget_udc(dev, &hsotg->gadget); |
| 4742 | − if (ret) | |
| 4743 | + if (ret) { | |
| 4744 | + dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, | |
| 4745 | + hsotg->ctrl_req); | |
| 4743 | 4746 | return ret; |
| 4744 | − | |
| 4747 | + } | |
| 4745 | 4748 | dwc2_hsotg_dump(hsotg); |
| 4746 | 4749 | |
| 4747 | 4750 | return 0; |
| @@ -4755,6 +4758,7 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg) · 7 unmodified lines | ||
| 4755 | 4758 | int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg) |
| 4756 | 4759 | { |
| 4757 | 4760 | usb_del_gadget_udc(&hsotg->gadget); |
| 4761 | + dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, hsotg->ctrl_req); | |
| 4758 | 4762 | |
| 4759 | 4763 | return 0; |
| 4760 | 4764 | } |
| @@ -1567,11 +1567,20 @@ static void dwc2_hc_start_transfer(struct dwc2_hsotg *hsotg, · 1566 unmodified lines | ||
| 1567 | 1567 | } |
| 1568 | 1568 | |
| 1569 | 1569 | if (hsotg->params.host_dma) { |
| 1570 | − dwc2_writel((u32)chan->xfer_dma, | |
| 1571 | − hsotg->regs + HCDMA(chan->hc_num)); | |
| 1570 | + dma_addr_t dma_addr; | |
| 1571 | + | |
| 1572 | + if (chan->align_buf) { | |
| 1573 | + if (dbg_hc(chan)) | |
| 1574 | + dev_vdbg(hsotg->dev, "align_buf\n"); | |
| 1575 | + dma_addr = chan->align_buf; | |
| 1576 | + } else { | |
| 1577 | + dma_addr = chan->xfer_dma; | |
| 1578 | + } | |
| 1579 | + dwc2_writel((u32)dma_addr, hsotg->regs + HCDMA(chan->hc_num)); | |
| 1580 | + | |
| 1572 | 1581 | if (dbg_hc(chan)) |
| 1573 | 1582 | dev_vdbg(hsotg->dev, "Wrote %08lx to HCDMA(%d)\n", |
| 1574 | − (unsigned long)chan->xfer_dma, chan->hc_num); | |
| 1583 | + (unsigned long)dma_addr, chan->hc_num); | |
| 1575 | 1584 | } |
| 1576 | 1585 | |
| 1577 | 1586 | /* Start the split */ |
| @@ -2625,6 +2634,35 @@ static void dwc2_hc_init_xfer(struct dwc2_hsotg *hsotg, · 1047 unmodified lines | ||
| 2625 | 2634 | } |
| 2626 | 2635 | } |
| 2627 | 2636 | |
| 2637 | +static int dwc2_alloc_split_dma_aligned_buf(struct dwc2_hsotg *hsotg, | |
| 2638 | + struct dwc2_qh *qh, | |
| 2639 | + struct dwc2_host_chan *chan) | |
| 2640 | +{ | |
| 2641 | + if (!hsotg->unaligned_cache || | |
| 2642 | + chan->max_packet > DWC2_KMEM_UNALIGNED_BUF_SIZE) | |
| 2643 | + return -ENOMEM; | |
| 2644 | + | |
| 2645 | + if (!qh->dw_align_buf) { | |
| 2646 | + qh->dw_align_buf = kmem_cache_alloc(hsotg->unaligned_cache, | |
| 2647 | + GFP_ATOMIC | GFP_DMA); | |
| 2648 | + if (!qh->dw_align_buf) | |
| 2649 | + return -ENOMEM; | |
| 2650 | + } | |
| 2651 | + | |
| 2652 | + qh->dw_align_buf_dma = dma_map_single(hsotg->dev, qh->dw_align_buf, | |
| 2653 | + DWC2_KMEM_UNALIGNED_BUF_SIZE, | |
| 2654 | + DMA_FROM_DEVICE); | |
| 2655 | + | |
| 2656 | + if (dma_mapping_error(hsotg->dev, qh->dw_align_buf_dma)) { | |
| 2657 | + dev_err(hsotg->dev, "can't map align_buf\n"); | |
| 2658 | + chan->align_buf = 0; | |
| 2659 | + return -EINVAL; | |
| 2660 | + } | |
| 2661 | + | |
| 2662 | + chan->align_buf = qh->dw_align_buf_dma; | |
| 2663 | + return 0; | |
| 2664 | +} | |
| 2665 | + | |
| 2628 | 2666 | #define DWC2_USB_DMA_ALIGN 4 |
| 2629 | 2667 | |
| 2630 | 2668 | struct dma_aligned_buffer { |
| @@ -2802,6 +2840,32 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) · 171 unmodified lines | ||
| 2802 | 2840 | /* Set the transfer attributes */ |
| 2803 | 2841 | dwc2_hc_init_xfer(hsotg, chan, qtd); |
| 2804 | 2842 | |
| 2843 | + /* For non-dword aligned buffers */ | |
| 2844 | + if (hsotg->params.host_dma && qh->do_split && | |
| 2845 | + chan->ep_is_in && (chan->xfer_dma & 0x3)) { | |
| 2846 | + dev_vdbg(hsotg->dev, "Non-aligned buffer\n"); | |
| 2847 | + if (dwc2_alloc_split_dma_aligned_buf(hsotg, qh, chan)) { | |
| 2848 | + dev_err(hsotg->dev, | |
| 2849 | + "Failed to allocate memory to handle non-aligned buffer\n"); | |
| 2850 | + /* Add channel back to free list */ | |
| 2851 | + chan->align_buf = 0; | |
| 2852 | + chan->multi_count = 0; | |
| 2853 | + list_add_tail(&chan->hc_list_entry, | |
| 2854 | + &hsotg->free_hc_list); | |
| 2855 | + qtd->in_process = 0; | |
| 2856 | + qh->channel = NULL; | |
| 2857 | + return -ENOMEM; | |
| 2858 | + } | |
| 2859 | + } else { | |
| 2860 | + /* | |
| 2861 | + * We assume that DMA is always aligned in non-split | |
| 2862 | + * case or split out case. Warn if not. | |
| 2863 | + */ | |
| 2864 | + WARN_ON_ONCE(hsotg->params.host_dma && | |
| 2865 | + (chan->xfer_dma & 0x3)); | |
| 2866 | + chan->align_buf = 0; | |
| 2867 | + } | |
| 2868 | + | |
| 2805 | 2869 | if (chan->ep_type == USB_ENDPOINT_XFER_INT || |
| 2806 | 2870 | chan->ep_type == USB_ENDPOINT_XFER_ISOC) |
| 2807 | 2871 | /* |
| @@ -5246,6 +5310,19 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) · 2438 unmodified lines | ||
| 5246 | 5310 | } |
| 5247 | 5311 | } |
| 5248 | 5312 | |
| 5313 | + if (hsotg->params.host_dma) { | |
| 5314 | + /* | |
| 5315 | + * Create kmem caches to handle non-aligned buffer | |
| 5316 | + * in Buffer DMA mode. | |
| 5317 | + */ | |
| 5318 | + hsotg->unaligned_cache = kmem_cache_create("dwc2-unaligned-dma", | |
| 5319 | + DWC2_KMEM_UNALIGNED_BUF_SIZE, 4, | |
| 5320 | + SLAB_CACHE_DMA, NULL); | |
| 5321 | + if (!hsotg->unaligned_cache) | |
| 5322 | + dev_err(hsotg->dev, | |
| 5323 | + "unable to create dwc2 unaligned cache\n"); | |
| 5324 | + } | |
| 5325 | + | |
| 5249 | 5326 | hsotg->otg_port = 1; |
| 5250 | 5327 | hsotg->frame_list = NULL; |
| 5251 | 5328 | hsotg->frame_list_dma = 0; |
| @@ -5280,8 +5357,9 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) · 28 unmodified lines | ||
| 5280 | 5357 | return 0; |
| 5281 | 5358 | |
| 5282 | 5359 | error4: |
| 5283 | − kmem_cache_destroy(hsotg->desc_gen_cache); | |
| 5360 | + kmem_cache_destroy(hsotg->unaligned_cache); | |
| 5284 | 5361 | kmem_cache_destroy(hsotg->desc_hsisoc_cache); |
| 5362 | + kmem_cache_destroy(hsotg->desc_gen_cache); | |
| 5285 | 5363 | error3: |
| 5286 | 5364 | dwc2_hcd_release(hsotg); |
| 5287 | 5365 | error2: |
| @@ -5322,8 +5400,9 @@ void dwc2_hcd_remove(struct dwc2_hsotg *hsotg) · 34 unmodified lines | ||
| 5322 | 5400 | usb_remove_hcd(hcd); |
| 5323 | 5401 | hsotg->priv = NULL; |
| 5324 | 5402 | |
| 5325 | − kmem_cache_destroy(hsotg->desc_gen_cache); | |
| 5403 | + kmem_cache_destroy(hsotg->unaligned_cache); | |
| 5326 | 5404 | kmem_cache_destroy(hsotg->desc_hsisoc_cache); |
| 5405 | + kmem_cache_destroy(hsotg->desc_gen_cache); | |
| 5327 | 5406 | |
| 5328 | 5407 | dwc2_hcd_release(hsotg); |
| 5329 | 5408 | usb_put_hcd(hcd); |
| @@ -5435,7 +5514,7 @@ int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg) · 105 unmodified lines | ||
| 5435 | 5514 | dwc2_writel(hprt0, hsotg->regs + HPRT0); |
| 5436 | 5515 | |
| 5437 | 5516 | /* Wait for the HPRT0.PrtSusp register field to be set */ |
| 5438 | − if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 300)) | |
| 5517 | + if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 3000)) | |
| 5439 | 5518 | dev_warn(hsotg->dev, "Suspend wasn't generated\n"); |
| 5440 | 5519 | |
| 5441 | 5520 | /* |
| @@ -5616,6 +5695,8 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, · 174 unmodified lines | ||
| 5616 | 5695 | return ret; |
| 5617 | 5696 | } |
| 5618 | 5697 | |
| 5698 | + dwc2_hcd_rem_wakeup(hsotg); | |
| 5699 | + | |
| 5619 | 5700 | hsotg->hibernated = 0; |
| 5620 | 5701 | hsotg->bus_suspended = 0; |
| 5621 | 5702 | hsotg->lx_state = DWC2_L0; |
| @@ -76,6 +76,8 @@ struct dwc2_qh; · 75 unmodified lines | ||
| 76 | 76 | * (micro)frame |
| 77 | 77 | * @xfer_buf: Pointer to current transfer buffer position |
| 78 | 78 | * @xfer_dma: DMA address of xfer_buf |
| 79 | + * @align_buf: In Buffer DMA mode this will be used if xfer_buf is not | |
| 80 | + * DWORD aligned | |
| 79 | 81 | * @xfer_len: Total number of bytes to transfer |
| 80 | 82 | * @xfer_count: Number of bytes transferred so far |
| 81 | 83 | * @start_pkt_count: Packet count at start of transfer |
| @@ -133,6 +135,7 @@ struct dwc2_host_chan { · 51 unmodified lines | ||
| 133 | 135 | |
| 134 | 136 | u8 *xfer_buf; |
| 135 | 137 | dma_addr_t xfer_dma; |
| 138 | + dma_addr_t align_buf; | |
| 136 | 139 | u32 xfer_len; |
| 137 | 140 | u32 xfer_count; |
| 138 | 141 | u16 start_pkt_count; |
| @@ -302,6 +305,9 @@ struct dwc2_hs_transfer_time { · 163 unmodified lines | ||
| 302 | 305 | * speed. Note that this is in "schedule slice" which |
| 303 | 306 | * is tightly packed. |
| 304 | 307 | * @ntd: Actual number of transfer descriptors in a list |
| 308 | + * @dw_align_buf: Used instead of original buffer if its physical address | |
| 309 | + * is not dword-aligned | |
| 310 | + * @dw_align_buf_dma: DMA address for dw_align_buf | |
| 305 | 311 | * @qtd_list: List of QTDs for this QH |
| 306 | 312 | * @channel: Host channel currently processing transfers for this QH |
| 307 | 313 | * @qh_list_entry: Entry for QH in either the periodic or non-periodic |
| @@ -350,6 +356,8 @@ struct dwc2_qh { · 42 unmodified lines | ||
| 350 | 356 | struct dwc2_hs_transfer_time hs_transfers[DWC2_HS_SCHEDULE_UFRAMES]; |
| 351 | 357 | u32 ls_start_schedule_slice; |
| 352 | 358 | u16 ntd; |
| 359 | + u8 *dw_align_buf; | |
| 360 | + dma_addr_t dw_align_buf_dma; | |
| 353 | 361 | struct list_head qtd_list; |
| 354 | 362 | struct dwc2_host_chan *channel; |
| 355 | 363 | struct list_head qh_list_entry; |
| @@ -942,14 +942,21 @@ static int dwc2_xfercomp_isoc_split_in(struct dwc2_hsotg *hsotg, · 941 unmodified lines | ||
| 942 | 942 | frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index]; |
| 943 | 943 | len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd, |
| 944 | 944 | DWC2_HC_XFER_COMPLETE, NULL); |
| 945 | − if (!len) { | |
| 945 | + if (!len && !qtd->isoc_split_offset) { | |
| 946 | 946 | qtd->complete_split = 0; |
| 947 | − qtd->isoc_split_offset = 0; | |
| 948 | 947 | return 0; |
| 949 | 948 | } |
| 950 | 949 | |
| 951 | 950 | frame_desc->actual_length += len; |
| 952 | 951 | |
| 952 | + if (chan->align_buf) { | |
| 953 | + dev_vdbg(hsotg->dev, "non-aligned buffer\n"); | |
| 954 | + dma_unmap_single(hsotg->dev, chan->qh->dw_align_buf_dma, | |
| 955 | + DWC2_KMEM_UNALIGNED_BUF_SIZE, DMA_FROM_DEVICE); | |
| 956 | + memcpy(qtd->urb->buf + (chan->xfer_dma - qtd->urb->dma), | |
| 957 | + chan->qh->dw_align_buf, len); | |
| 958 | + } | |
| 959 | + | |
| 953 | 960 | qtd->isoc_split_offset += len; |
| 954 | 961 | |
| 955 | 962 | hctsiz = dwc2_readl(hsotg->regs + HCTSIZ(chnum)); |
| @@ -383,7 +383,7 @@ static unsigned long *dwc2_get_ls_map(struct dwc2_hsotg *hsotg, · 382 unmodified lines | ||
| 383 | 383 | /* Get the map and adjust if this is a multi_tt hub */ |
| 384 | 384 | map = qh->dwc_tt->periodic_bitmaps; |
| 385 | 385 | if (qh->dwc_tt->usb_tt->multi) |
| 386 | − map += DWC2_ELEMENTS_PER_LS_BITMAP * qh->ttport; | |
| 386 | + map += DWC2_ELEMENTS_PER_LS_BITMAP * (qh->ttport - 1); | |
| 387 | 387 | |
| 388 | 388 | return map; |
| 389 | 389 | } |
| @@ -1696,6 +1696,9 @@ void dwc2_hcd_qh_free(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) · 1306 unmodified lines | ||
| 1696 | 1696 | |
| 1697 | 1697 | if (qh->desc_list) |
| 1698 | 1698 | dwc2_hcd_qh_free_ddma(hsotg, qh); |
| 1699 | + else if (hsotg->unaligned_cache && qh->dw_align_buf) | |
| 1700 | + kmem_cache_free(hsotg->unaligned_cache, qh->dw_align_buf); | |
| 1701 | + | |
| 1699 | 1702 | kfree(qh); |
| 1700 | 1703 | } |
| 1701 | 1704 | |
| @@ -1272,7 +1272,6 @@ static int dwc3_probe(struct platform_device *pdev) · 1271 unmodified lines | ||
| 1272 | 1272 | if (!dwc->clks) |
| 1273 | 1273 | return -ENOMEM; |
| 1274 | 1274 | |
| 1275 | − dwc->num_clks = ARRAY_SIZE(dwc3_core_clks); | |
| 1276 | 1275 | dwc->dev = dev; |
| 1277 | 1276 | |
| 1278 | 1277 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| @@ -1307,15 +1306,19 @@ static int dwc3_probe(struct platform_device *pdev) · 28 unmodified lines | ||
| 1307 | 1306 | if (IS_ERR(dwc->reset)) |
| 1308 | 1307 | return PTR_ERR(dwc->reset); |
| 1309 | 1308 | |
| 1310 | − ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks); | |
| 1311 | − if (ret == -EPROBE_DEFER) | |
| 1312 | − return ret; | |
| 1313 | − /* | |
| 1314 | − * Clocks are optional, but new DT platforms should support all clocks | |
| 1315 | − * as required by the DT-binding. | |
| 1316 | − */ | |
| 1317 | − if (ret) | |
| 1318 | − dwc->num_clks = 0; | |
| 1309 | + if (dev->of_node) { | |
| 1310 | + dwc->num_clks = ARRAY_SIZE(dwc3_core_clks); | |
| 1311 | + | |
| 1312 | + ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks); | |
| 1313 | + if (ret == -EPROBE_DEFER) | |
| 1314 | + return ret; | |
| 1315 | + /* | |
| 1316 | + * Clocks are optional, but new DT platforms should support all | |
| 1317 | + * clocks as required by the DT-binding. | |
| 1318 | + */ | |
| 1319 | + if (ret) | |
| 1320 | + dwc->num_clks = 0; | |
| 1321 | + } | |
| 1319 | 1322 | |
| 1320 | 1323 | ret = reset_control_deassert(dwc->reset); |
| 1321 | 1324 | if (ret) |
| @@ -165,8 +165,9 @@ static int dwc3_of_simple_remove(struct platform_device *pdev) · 164 unmodified lines | ||
| 165 | 165 | |
| 166 | 166 | reset_control_put(simple->resets); |
| 167 | 167 | |
| 168 | − pm_runtime_put_sync(dev); | |
| 169 | 168 | pm_runtime_disable(dev); |
| 169 | + pm_runtime_put_noidle(dev); | |
| 170 | + pm_runtime_set_suspended(dev); | |
| 170 | 171 | |
| 171 | 172 | return 0; |
| 172 | 173 | } |
| @@ -34,6 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | #define PCI_DEVICE_ID_INTEL_GLK 0x31aa |
| 35 | 35 | #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee |
| 36 | 36 | #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e |
| 37 | +#define PCI_DEVICE_ID_INTEL_ICLLP 0x34ee | |
| 37 | 38 | |
| 38 | 39 | #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" |
| 39 | 40 | #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 |
| @@ -289,6 +290,7 @@ static const struct pci_device_id dwc3_pci_id_table[] = { · 249 unmodified lines | ||
| 289 | 290 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK), }, |
| 290 | 291 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPLP), }, |
| 291 | 292 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPH), }, |
| 293 | + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICLLP), }, | |
| 292 | 294 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, |
| 293 | 295 | { } /* Terminating Entry */ |
| 294 | 296 | }; |
| @@ -490,6 +490,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev) · 489 unmodified lines | ||
| 490 | 490 | qcom->dwc3 = of_find_device_by_node(dwc3_np); |
| 491 | 491 | if (!qcom->dwc3) { |
| 492 | 492 | dev_err(&pdev->dev, "failed to get dwc3 platform device\n"); |
| 493 | + ret = -ENODEV; | |
| 493 | 494 | goto depopulate; |
| 494 | 495 | } |
| 495 | 496 | |
| @@ -547,8 +548,7 @@ static int dwc3_qcom_remove(struct platform_device *pdev) · 51 unmodified lines | ||
| 547 | 548 | return 0; |
| 548 | 549 | } |
| 549 | 550 | |
| 550 | −#ifdef CONFIG_PM_SLEEP | |
| 551 | −static int dwc3_qcom_pm_suspend(struct device *dev) | |
| 551 | +static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev) | |
| 552 | 552 | { |
| 553 | 553 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 554 | 554 | int ret = 0; |
| @@ -560,7 +560,7 @@ static int dwc3_qcom_pm_suspend(struct device *dev) · 5 unmodified lines | ||
| 560 | 560 | return ret; |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | −static int dwc3_qcom_pm_resume(struct device *dev) | |
| 563 | +static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev) | |
| 564 | 564 | { |
| 565 | 565 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 566 | 566 | int ret; |
| @@ -571,23 +571,20 @@ static int dwc3_qcom_pm_resume(struct device *dev) · 4 unmodified lines | ||
| 571 | 571 | |
| 572 | 572 | return ret; |
| 573 | 573 | } |
| 574 | −#endif | |
| 575 | 574 | |
| 576 | −#ifdef CONFIG_PM | |
| 577 | −static int dwc3_qcom_runtime_suspend(struct device *dev) | |
| 575 | +static int __maybe_unused dwc3_qcom_runtime_suspend(struct device *dev) | |
| 578 | 576 | { |
| 579 | 577 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 580 | 578 | |
| 581 | 579 | return dwc3_qcom_suspend(qcom); |
| 582 | 580 | } |
| 583 | 581 | |
| 584 | −static int dwc3_qcom_runtime_resume(struct device *dev) | |
| 582 | +static int __maybe_unused dwc3_qcom_runtime_resume(struct device *dev) | |
| 585 | 583 | { |
| 586 | 584 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 587 | 585 | |
| 588 | 586 | return dwc3_qcom_resume(qcom); |
| 589 | 587 | } |
| 590 | −#endif | |
| 591 | 588 | |
| 592 | 589 | static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = { |
| 593 | 590 | SET_SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume) |
| @@ -1719,6 +1719,8 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) · 1718 unmodified lines | ||
| 1719 | 1719 | */ |
| 1720 | 1720 | if (w_value && !f->get_alt) |
| 1721 | 1721 | break; |
| 1722 | + | |
| 1723 | + spin_lock(&cdev->lock); | |
| 1722 | 1724 | value = f->set_alt(f, w_index, w_value); |
| 1723 | 1725 | if (value == USB_GADGET_DELAYED_STATUS) { |
| 1724 | 1726 | DBG(cdev, |
| @@ -1728,6 +1730,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) · 3 unmodified lines | ||
| 1728 | 1730 | DBG(cdev, "delayed_status count %d\n", |
| 1729 | 1731 | cdev->delayed_status); |
| 1730 | 1732 | } |
| 1733 | + spin_unlock(&cdev->lock); | |
| 1731 | 1734 | break; |
| 1732 | 1735 | case USB_REQ_GET_INTERFACE: |
| 1733 | 1736 | if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE)) |
| @@ -215,6 +215,7 @@ struct ffs_io_data { · 214 unmodified lines | ||
| 215 | 215 | |
| 216 | 216 | struct mm_struct *mm; |
| 217 | 217 | struct work_struct work; |
| 218 | + struct work_struct cancellation_work; | |
| 218 | 219 | |
| 219 | 220 | struct usb_ep *ep; |
| 220 | 221 | struct usb_request *req; |
| @@ -1072,22 +1073,31 @@ ffs_epfile_open(struct inode *inode, struct file *file) · 851 unmodified lines | ||
| 1072 | 1073 | return 0; |
| 1073 | 1074 | } |
| 1074 | 1075 | |
| 1076 | +static void ffs_aio_cancel_worker(struct work_struct *work) | |
| 1077 | +{ | |
| 1078 | + struct ffs_io_data *io_data = container_of(work, struct ffs_io_data, | |
| 1079 | + cancellation_work); | |
| 1080 | + | |
| 1081 | + ENTER(); | |
| 1082 | + | |
| 1083 | + usb_ep_dequeue(io_data->ep, io_data->req); | |
| 1084 | +} | |
| 1085 | + | |
| 1075 | 1086 | static int ffs_aio_cancel(struct kiocb *kiocb) |
| 1076 | 1087 | { |
| 1077 | 1088 | struct ffs_io_data *io_data = kiocb->private; |
| 1078 | − struct ffs_epfile *epfile = kiocb->ki_filp->private_data; | |
| 1089 | + struct ffs_data *ffs = io_data->ffs; | |
| 1079 | 1090 | int value; |
| 1080 | 1091 | |
| 1081 | 1092 | ENTER(); |
| 1082 | 1093 | |
| 1083 | − spin_lock_irq(&epfile->ffs->eps_lock); | |
| 1084 | − | |
| 1085 | − if (likely(io_data && io_data->ep && io_data->req)) | |
| 1086 | − value = usb_ep_dequeue(io_data->ep, io_data->req); | |
| 1087 | − else | |
| 1094 | + if (likely(io_data && io_data->ep && io_data->req)) { | |
| 1095 | + INIT_WORK(&io_data->cancellation_work, ffs_aio_cancel_worker); | |
| 1096 | + queue_work(ffs->io_completion_wq, &io_data->cancellation_work); | |
| 1097 | + value = -EINPROGRESS; | |
| 1098 | + } else { | |
| 1088 | 1099 | value = -EINVAL; |
| 1089 | − | |
| 1090 | − spin_unlock_irq(&epfile->ffs->eps_lock); | |
| 1100 | + } | |
| 1091 | 1101 | |
| 1092 | 1102 | return value; |
| 1093 | 1103 | } |
| @@ -886,12 +886,12 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id) · 885 unmodified lines | ||
| 886 | 886 | |
| 887 | 887 | dev = xhci->devs[slot_id]; |
| 888 | 888 | |
| 889 | − trace_xhci_free_virt_device(dev); | |
| 890 | − | |
| 891 | 889 | xhci->dcbaa->dev_context_ptrs[slot_id] = 0; |
| 892 | 890 | if (!dev) |
| 893 | 891 | return; |
| 894 | 892 | |
| 893 | + trace_xhci_free_virt_device(dev); | |
| 894 | + | |
| 895 | 895 | if (dev->tt_info) |
| 896 | 896 | old_active_eps = dev->tt_info->active_eps; |
| 897 | 897 | |
| @@ -481,7 +481,7 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra, · 480 unmodified lines | ||
| 481 | 481 | unsigned long mask; |
| 482 | 482 | unsigned int port; |
| 483 | 483 | bool idle, enable; |
| 484 | − int err; | |
| 484 | + int err = 0; | |
| 485 | 485 | |
| 486 | 486 | memset(&rsp, 0, sizeof(rsp)); |
| 487 | 487 | |
| @@ -1223,10 +1223,10 @@ disable_rpm: · 735 unmodified lines | ||
| 1223 | 1223 | pm_runtime_disable(&pdev->dev); |
| 1224 | 1224 | usb_put_hcd(tegra->hcd); |
| 1225 | 1225 | disable_xusbc: |
| 1226 | − if (!&pdev->dev.pm_domain) | |
| 1226 | + if (!pdev->dev.pm_domain) | |
| 1227 | 1227 | tegra_powergate_power_off(TEGRA_POWERGATE_XUSBC); |
| 1228 | 1228 | disable_xusba: |
| 1229 | − if (!&pdev->dev.pm_domain) | |
| 1229 | + if (!pdev->dev.pm_domain) | |
| 1230 | 1230 | tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA); |
| 1231 | 1231 | put_padctl: |
| 1232 | 1232 | tegra_xusb_padctl_put(tegra->padctl); |
| @@ -171,6 +171,37 @@ DEFINE_EVENT(xhci_log_trb, xhci_dbc_gadget_ep_queue, · 170 unmodified lines | ||
| 171 | 171 | TP_ARGS(ring, trb) |
| 172 | 172 | ); |
| 173 | 173 | |
| 174 | +DECLARE_EVENT_CLASS(xhci_log_free_virt_dev, | |
| 175 | + TP_PROTO(struct xhci_virt_device *vdev), | |
| 176 | + TP_ARGS(vdev), | |
| 177 | + TP_STRUCT__entry( | |
| 178 | + __field(void *, vdev) | |
| 179 | + __field(unsigned long long, out_ctx) | |
| 180 | + __field(unsigned long long, in_ctx) | |
| 181 | + __field(u8, fake_port) | |
| 182 | + __field(u8, real_port) | |
| 183 | + __field(u16, current_mel) | |
| 184 | + | |
| 185 | + ), | |
| 186 | + TP_fast_assign( | |
| 187 | + __entry->vdev = vdev; | |
| 188 | + __entry->in_ctx = (unsigned long long) vdev->in_ctx->dma; | |
| 189 | + __entry->out_ctx = (unsigned long long) vdev->out_ctx->dma; | |
| 190 | + __entry->fake_port = (u8) vdev->fake_port; | |
| 191 | + __entry->real_port = (u8) vdev->real_port; | |
| 192 | + __entry->current_mel = (u16) vdev->current_mel; | |
| 193 | + ), | |
| 194 | + TP_printk("vdev %p ctx %llx | %llx fake_port %d real_port %d current_mel %d", | |
| 195 | + __entry->vdev, __entry->in_ctx, __entry->out_ctx, | |
| 196 | + __entry->fake_port, __entry->real_port, __entry->current_mel | |
| 197 | + ) | |
| 198 | +); | |
| 199 | + | |
| 200 | +DEFINE_EVENT(xhci_log_free_virt_dev, xhci_free_virt_device, | |
| 201 | + TP_PROTO(struct xhci_virt_device *vdev), | |
| 202 | + TP_ARGS(vdev) | |
| 203 | +); | |
| 204 | + | |
| 174 | 205 | DECLARE_EVENT_CLASS(xhci_log_virt_dev, |
| 175 | 206 | TP_PROTO(struct xhci_virt_device *vdev), |
| 176 | 207 | TP_ARGS(vdev), |
| @@ -208,11 +239,6 @@ DEFINE_EVENT(xhci_log_virt_dev, xhci_alloc_virt_device, · 31 unmodified lines | ||
| 208 | 239 | TP_ARGS(vdev) |
| 209 | 240 | ); |
| 210 | 241 | |
| 211 | −DEFINE_EVENT(xhci_log_virt_dev, xhci_free_virt_device, | |
| 212 | − TP_PROTO(struct xhci_virt_device *vdev), | |
| 213 | − TP_ARGS(vdev) | |
| 214 | −); | |
| 215 | − | |
| 216 | 242 | DEFINE_EVENT(xhci_log_virt_dev, xhci_setup_device, |
| 217 | 243 | TP_PROTO(struct xhci_virt_device *vdev), |
| 218 | 244 | TP_ARGS(vdev) |
| @@ -908,6 +908,41 @@ static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci) · 907 unmodified lines | ||
| 908 | 908 | spin_unlock_irqrestore(&xhci->lock, flags); |
| 909 | 909 | } |
| 910 | 910 | |
| 911 | +static bool xhci_pending_portevent(struct xhci_hcd *xhci) | |
| 912 | +{ | |
| 913 | + struct xhci_port **ports; | |
| 914 | + int port_index; | |
| 915 | + u32 status; | |
| 916 | + u32 portsc; | |
| 917 | + | |
| 918 | + status = readl(&xhci->op_regs->status); | |
| 919 | + if (status & STS_EINT) | |
| 920 | + return true; | |
| 921 | + /* | |
| 922 | + * Checking STS_EINT is not enough as there is a lag between a change | |
| 923 | + * bit being set and the Port Status Change Event that it generated | |
| 924 | + * being written to the Event Ring. See note in xhci 1.1 section 4.19.2. | |
| 925 | + */ | |
| 926 | + | |
| 927 | + port_index = xhci->usb2_rhub.num_ports; | |
| 928 | + ports = xhci->usb2_rhub.ports; | |
| 929 | + while (port_index--) { | |
| 930 | + portsc = readl(ports[port_index]->addr); | |
| 931 | + if (portsc & PORT_CHANGE_MASK || | |
| 932 | + (portsc & PORT_PLS_MASK) == XDEV_RESUME) | |
| 933 | + return true; | |
| 934 | + } | |
| 935 | + port_index = xhci->usb3_rhub.num_ports; | |
| 936 | + ports = xhci->usb3_rhub.ports; | |
| 937 | + while (port_index--) { | |
| 938 | + portsc = readl(ports[port_index]->addr); | |
| 939 | + if (portsc & PORT_CHANGE_MASK || | |
| 940 | + (portsc & PORT_PLS_MASK) == XDEV_RESUME) | |
| 941 | + return true; | |
| 942 | + } | |
| 943 | + return false; | |
| 944 | +} | |
| 945 | + | |
| 911 | 946 | /* |
| 912 | 947 | * Stop HC (not bus-specific) |
| 913 | 948 | * |
| @@ -1009,7 +1044,7 @@ EXPORT_SYMBOL_GPL(xhci_suspend); · 95 unmodified lines | ||
| 1009 | 1044 | */ |
| 1010 | 1045 | int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
| 1011 | 1046 | { |
| 1012 | − u32 command, temp = 0, status; | |
| 1047 | + u32 command, temp = 0; | |
| 1013 | 1048 | struct usb_hcd *hcd = xhci_to_hcd(xhci); |
| 1014 | 1049 | struct usb_hcd *secondary_hcd; |
| 1015 | 1050 | int retval = 0; |
| @@ -1043,8 +1078,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) · 27 unmodified lines | ||
| 1043 | 1078 | command = readl(&xhci->op_regs->command); |
| 1044 | 1079 | command |= CMD_CRS; |
| 1045 | 1080 | writel(command, &xhci->op_regs->command); |
| 1081 | + /* | |
| 1082 | + * Some controllers take up to 55+ ms to complete the controller | |
| 1083 | + * restore so setting the timeout to 100ms. Xhci specification | |
| 1084 | + * doesn't mention any timeout value. | |
| 1085 | + */ | |
| 1046 | 1086 | if (xhci_handshake(&xhci->op_regs->status, |
| 1047 | − STS_RESTORE, 0, 10 * 1000)) { | |
| 1087 | + STS_RESTORE, 0, 100 * 1000)) { | |
| 1048 | 1088 | xhci_warn(xhci, "WARN: xHC restore state timeout\n"); |
| 1049 | 1089 | spin_unlock_irq(&xhci->lock); |
| 1050 | 1090 | return -ETIMEDOUT; |
| @@ -1134,8 +1174,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) · 83 unmodified lines | ||
| 1134 | 1174 | done: |
| 1135 | 1175 | if (retval == 0) { |
| 1136 | 1176 | /* Resume root hubs only when have pending events. */ |
| 1137 | − status = readl(&xhci->op_regs->status); | |
| 1138 | − if (status & STS_EINT) { | |
| 1177 | + if (xhci_pending_portevent(xhci)) { | |
| 1139 | 1178 | usb_hcd_resume_root_hub(xhci->shared_hcd); |
| 1140 | 1179 | usb_hcd_resume_root_hub(hcd); |
| 1141 | 1180 | } |
| @@ -382,6 +382,10 @@ struct xhci_op_regs { · 381 unmodified lines | ||
| 382 | 382 | #define PORT_PLC (1 << 22) |
| 383 | 383 | /* port configure error change - port failed to configure its link partner */ |
| 384 | 384 | #define PORT_CEC (1 << 23) |
| 385 | +#define PORT_CHANGE_MASK (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \ | |
| 386 | + PORT_RC | PORT_PLC | PORT_CEC) | |
| 387 | + | |
| 388 | + | |
| 385 | 389 | /* Cold Attach Status - xHC can set this bit to report device attached during |
| 386 | 390 | * Sx state. Warm port reset should be perfomed to clear this bit and move port |
| 387 | 391 | * to connected state. |
| @@ -95,6 +95,9 @@ static const struct usb_device_id id_table[] = { · 94 unmodified lines | ||
| 95 | 95 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ |
| 96 | 96 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ |
| 97 | 97 | { USB_DEVICE(0x10C4, 0x815F) }, /* Timewave HamLinkUSB */ |
| 98 | + { USB_DEVICE(0x10C4, 0x817C) }, /* CESINEL MEDCAL N Power Quality Monitor */ | |
| 99 | + { USB_DEVICE(0x10C4, 0x817D) }, /* CESINEL MEDCAL NT Power Quality Monitor */ | |
| 100 | + { USB_DEVICE(0x10C4, 0x817E) }, /* CESINEL MEDCAL S Power Quality Monitor */ | |
| 98 | 101 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ |
| 99 | 102 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ |
| 100 | 103 | { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ |
| @@ -112,6 +115,9 @@ static const struct usb_device_id id_table[] = { · 11 unmodified lines | ||
| 112 | 115 | { USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demonstration module */ |
| 113 | 116 | { USB_DEVICE(0x10C4, 0x8281) }, /* Nanotec Plug & Drive */ |
| 114 | 117 | { USB_DEVICE(0x10C4, 0x8293) }, /* Telegesis ETRX2USB */ |
| 118 | + { USB_DEVICE(0x10C4, 0x82EF) }, /* CESINEL FALCO 6105 AC Power Supply */ | |
| 119 | + { USB_DEVICE(0x10C4, 0x82F1) }, /* CESINEL MEDCAL EFD Earth Fault Detector */ | |
| 120 | + { USB_DEVICE(0x10C4, 0x82F2) }, /* CESINEL MEDCAL ST Network Analyzer */ | |
| 115 | 121 | { USB_DEVICE(0x10C4, 0x82F4) }, /* Starizona MicroTouch */ |
| 116 | 122 | { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */ |
| 117 | 123 | { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ |
| @@ -124,7 +130,9 @@ static const struct usb_device_id id_table[] = { · 6 unmodified lines | ||
| 124 | 130 | { USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */ |
| 125 | 131 | { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ |
| 126 | 132 | { USB_DEVICE(0x10C4, 0x84B6) }, /* Starizona Hyperion */ |
| 133 | + { USB_DEVICE(0x10C4, 0x851E) }, /* CESINEL MEDCAL PT Network Analyzer */ | |
| 127 | 134 | { USB_DEVICE(0x10C4, 0x85A7) }, /* LifeScan OneTouch Verio IQ */ |
| 135 | + { USB_DEVICE(0x10C4, 0x85B8) }, /* CESINEL ReCon T Energy Logger */ | |
| 128 | 136 | { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */ |
| 129 | 137 | { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */ |
| 130 | 138 | { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ |
| @@ -134,17 +142,23 @@ static const struct usb_device_id id_table[] = { · 3 unmodified lines | ||
| 134 | 142 | { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ |
| 135 | 143 | { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ |
| 136 | 144 | { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ |
| 145 | + { USB_DEVICE(0x10C4, 0x88FB) }, /* CESINEL MEDCAL STII Network Analyzer */ | |
| 146 | + { USB_DEVICE(0x10C4, 0x8938) }, /* CESINEL MEDCAL S II Network Analyzer */ | |
| 137 | 147 | { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ |
| 138 | 148 | { USB_DEVICE(0x10C4, 0x8962) }, /* Brim Brothers charging dock */ |
| 139 | 149 | { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ |
| 140 | 150 | { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ |
| 151 | + { USB_DEVICE(0x10C4, 0x89A4) }, /* CESINEL FTBC Flexible Thyristor Bridge Controller */ | |
| 141 | 152 | { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ |
| 142 | 153 | { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ |
| 143 | 154 | { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ |
| 144 | 155 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ |
| 145 | 156 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ |
| 157 | + { USB_DEVICE(0x10C4, 0xEA63) }, /* Silicon Labs Windows Update (CP2101-4/CP2102N) */ | |
| 146 | 158 | { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ |
| 147 | 159 | { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */ |
| 160 | + { USB_DEVICE(0x10C4, 0xEA7A) }, /* Silicon Labs Windows Update (CP2105) */ | |
| 161 | + { USB_DEVICE(0x10C4, 0xEA7B) }, /* Silicon Labs Windows Update (CP2108) */ | |
| 148 | 162 | { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ |
| 149 | 163 | { USB_DEVICE(0x10C4, 0xF002) }, /* Elan Digital Systems USBwave12 */ |
| 150 | 164 | { USB_DEVICE(0x10C4, 0xF003) }, /* Elan Digital Systems USBpulse100 */ |
| @@ -418,17 +418,18 @@ static void _tcpm_log(struct tcpm_port *port, const char *fmt, va_list args) · 417 unmodified lines | ||
| 418 | 418 | u64 ts_nsec = local_clock(); |
| 419 | 419 | unsigned long rem_nsec; |
| 420 | 420 | |
| 421 | + mutex_lock(&port->logbuffer_lock); | |
| 421 | 422 | if (!port->logbuffer[port->logbuffer_head]) { |
| 422 | 423 | port->logbuffer[port->logbuffer_head] = |
| 423 | 424 | kzalloc(LOG_BUFFER_ENTRY_SIZE, GFP_KERNEL); |
| 424 | − if (!port->logbuffer[port->logbuffer_head]) | |
| 425 | + if (!port->logbuffer[port->logbuffer_head]) { | |
| 426 | + mutex_unlock(&port->logbuffer_lock); | |
| 425 | 427 | return; |
| 428 | + } | |
| 426 | 429 | } |
| 427 | 430 | |
| 428 | 431 | vsnprintf(tmpbuffer, sizeof(tmpbuffer), fmt, args); |
| 429 | 432 | |
| 430 | − mutex_lock(&port->logbuffer_lock); | |
| 431 | − | |
| 432 | 433 | if (tcpm_log_full(port)) { |
| 433 | 434 | port->logbuffer_head = max(port->logbuffer_head - 1, 0); |
| 434 | 435 | strcpy(tmpbuffer, "overflow"); |
| @@ -3043,7 +3044,8 @@ static void run_state_machine(struct tcpm_port *port) · 2608 unmodified lines | ||
| 3043 | 3044 | tcpm_port_is_sink(port) && |
| 3044 | 3045 | time_is_after_jiffies(port->delayed_runtime)) { |
| 3045 | 3046 | tcpm_set_state(port, SNK_DISCOVERY, |
| 3046 | − port->delayed_runtime - jiffies); | |
| 3047 | + jiffies_to_msecs(port->delayed_runtime - | |
| 3048 | + jiffies)); | |
| 3047 | 3049 | break; |
| 3048 | 3050 | } |
| 3049 | 3051 | tcpm_set_state(port, unattached_state(port), 0); |
| @@ -350,6 +350,19 @@ static void ucsi_connector_change(struct work_struct *work) · 349 unmodified lines | ||
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | if (con->status.change & UCSI_CONSTAT_CONNECT_CHANGE) { |
| 353 | + typec_set_pwr_role(con->port, con->status.pwr_dir); | |
| 354 | + | |
| 355 | + switch (con->status.partner_type) { | |
| 356 | + case UCSI_CONSTAT_PARTNER_TYPE_UFP: | |
| 357 | + typec_set_data_role(con->port, TYPEC_HOST); | |
| 358 | + break; | |
| 359 | + case UCSI_CONSTAT_PARTNER_TYPE_DFP: | |
| 360 | + typec_set_data_role(con->port, TYPEC_DEVICE); | |
| 361 | + break; | |
| 362 | + default: | |
| 363 | + break; | |
| 364 | + } | |
| 365 | + | |
| 353 | 366 | if (con->status.connected) |
| 354 | 367 | ucsi_register_partner(con); |
| 355 | 368 | else |
| @@ -79,6 +79,11 @@ static int ucsi_acpi_probe(struct platform_device *pdev) · 78 unmodified lines | ||
| 79 | 79 | return -ENODEV; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | + /* This will make sure we can use ioremap_nocache() */ | |
| 83 | + status = acpi_release_memory(ACPI_HANDLE(&pdev->dev), res, 1); | |
| 84 | + if (ACPI_FAILURE(status)) | |
| 85 | + return -ENOMEM; | |
| 86 | + | |
| 82 | 87 | /* |
| 83 | 88 | * NOTE: The memory region for the data structures is used also in an |
| 84 | 89 | * operation region, which means ACPI has already reserved it. Therefore |
| @@ -5,7 +5,6 @@ · 4 unmodified lines | ||
| 5 | 5 | * Implements an efficient asynchronous io interface. |
| 6 | 6 | * |
| 7 | 7 | * Copyright 2000, 2001, 2002 Red Hat, Inc. All Rights Reserved. |
| 8 | − * Copyright 2018 Christoph Hellwig. | |
| 9 | 8 | * |
| 10 | 9 | * See ../COPYING for licensing terms. |
| 11 | 10 | */ |
| @@ -165,22 +164,10 @@ struct fsync_iocb { · 153 unmodified lines | ||
| 165 | 164 | bool datasync; |
| 166 | 165 | }; |
| 167 | 166 | |
| 168 | −struct poll_iocb { | |
| 169 | − struct file *file; | |
| 170 | − __poll_t events; | |
| 171 | − struct wait_queue_head *head; | |
| 172 | − | |
| 173 | − union { | |
| 174 | − struct wait_queue_entry wait; | |
| 175 | − struct work_struct work; | |
| 176 | − }; | |
| 177 | −}; | |
| 178 | − | |
| 179 | 167 | struct aio_kiocb { |
| 180 | 168 | union { |
| 181 | 169 | struct kiocb rw; |
| 182 | 170 | struct fsync_iocb fsync; |
| 183 | − struct poll_iocb poll; | |
| 184 | 171 | }; |
| 185 | 172 | |
| 186 | 173 | struct kioctx *ki_ctx; |
| @@ -1590,6 +1577,7 @@ static int aio_fsync(struct fsync_iocb *req, struct iocb *iocb, bool datasync) · 1403 unmodified lines | ||
| 1590 | 1577 | if (unlikely(iocb->aio_buf || iocb->aio_offset || iocb->aio_nbytes || |
| 1591 | 1578 | iocb->aio_rw_flags)) |
| 1592 | 1579 | return -EINVAL; |
| 1580 | + | |
| 1593 | 1581 | req->file = fget(iocb->aio_fildes); |
| 1594 | 1582 | if (unlikely(!req->file)) |
| 1595 | 1583 | return -EBADF; |
| @@ -1604,137 +1592,6 @@ static int aio_fsync(struct fsync_iocb *req, struct iocb *iocb, bool datasync) · 8 unmodified lines | ||
| 1604 | 1592 | return 0; |
| 1605 | 1593 | } |
| 1606 | 1594 | |
| 1607 | −/* need to use list_del_init so we can check if item was present */ | |
| 1608 | −static inline bool __aio_poll_remove(struct poll_iocb *req) | |
| 1609 | −{ | |
| 1610 | − if (list_empty(&req->wait.entry)) | |
| 1611 | − return false; | |
| 1612 | − list_del_init(&req->wait.entry); | |
| 1613 | − return true; | |
| 1614 | −} | |
| 1615 | − | |
| 1616 | −static inline void __aio_poll_complete(struct aio_kiocb *iocb, __poll_t mask) | |
| 1617 | −{ | |
| 1618 | − fput(iocb->poll.file); | |
| 1619 | − aio_complete(iocb, mangle_poll(mask), 0); | |
| 1620 | −} | |
| 1621 | − | |
| 1622 | −static void aio_poll_work(struct work_struct *work) | |
| 1623 | −{ | |
| 1624 | − struct aio_kiocb *iocb = container_of(work, struct aio_kiocb, poll.work); | |
| 1625 | − | |
| 1626 | − if (!list_empty_careful(&iocb->ki_list)) | |
| 1627 | − aio_remove_iocb(iocb); | |
| 1628 | − __aio_poll_complete(iocb, iocb->poll.events); | |
| 1629 | −} | |
| 1630 | − | |
| 1631 | −static int aio_poll_cancel(struct kiocb *iocb) | |
| 1632 | −{ | |
| 1633 | − struct aio_kiocb *aiocb = container_of(iocb, struct aio_kiocb, rw); | |
| 1634 | − struct poll_iocb *req = &aiocb->poll; | |
| 1635 | − struct wait_queue_head *head = req->head; | |
| 1636 | − bool found = false; | |
| 1637 | − | |
| 1638 | − spin_lock(&head->lock); | |
| 1639 | − found = __aio_poll_remove(req); | |
| 1640 | − spin_unlock(&head->lock); | |
| 1641 | − | |
| 1642 | − if (found) { | |
| 1643 | − req->events = 0; | |
| 1644 | − INIT_WORK(&req->work, aio_poll_work); | |
| 1645 | − schedule_work(&req->work); | |
| 1646 | − } | |
| 1647 | − return 0; | |
| 1648 | −} | |
| 1649 | − | |
| 1650 | −static int aio_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync, | |
| 1651 | − void *key) | |
| 1652 | −{ | |
| 1653 | − struct poll_iocb *req = container_of(wait, struct poll_iocb, wait); | |
| 1654 | − struct aio_kiocb *iocb = container_of(req, struct aio_kiocb, poll); | |
| 1655 | − struct file *file = req->file; | |
| 1656 | − __poll_t mask = key_to_poll(key); | |
| 1657 | − | |
| 1658 | − assert_spin_locked(&req->head->lock); | |
| 1659 | − | |
| 1660 | − /* for instances that support it check for an event match first: */ | |
| 1661 | − if (mask && !(mask & req->events)) | |
| 1662 | − return 0; | |
| 1663 | − | |
| 1664 | − mask = file->f_op->poll_mask(file, req->events) & req->events; | |
| 1665 | − if (!mask) | |
| 1666 | − return 0; | |
| 1667 | − | |
| 1668 | − __aio_poll_remove(req); | |
| 1669 | − | |
| 1670 | − /* | |
| 1671 | − * Try completing without a context switch if we can acquire ctx_lock | |
| 1672 | − * without spinning. Otherwise we need to defer to a workqueue to | |
| 1673 | − * avoid a deadlock due to the lock order. | |
| 1674 | − */ | |
| 1675 | − if (spin_trylock(&iocb->ki_ctx->ctx_lock)) { | |
| 1676 | − list_del_init(&iocb->ki_list); | |
| 1677 | − spin_unlock(&iocb->ki_ctx->ctx_lock); | |
| 1678 | − | |
| 1679 | − __aio_poll_complete(iocb, mask); | |
| 1680 | − } else { | |
| 1681 | − req->events = mask; | |
| 1682 | − INIT_WORK(&req->work, aio_poll_work); | |
| 1683 | − schedule_work(&req->work); | |
| 1684 | − } | |
| 1685 | − | |
| 1686 | − return 1; | |
| 1687 | −} | |
| 1688 | − | |
| 1689 | −static ssize_t aio_poll(struct aio_kiocb *aiocb, struct iocb *iocb) | |
| 1690 | −{ | |
| 1691 | − struct kioctx *ctx = aiocb->ki_ctx; | |
| 1692 | − struct poll_iocb *req = &aiocb->poll; | |
| 1693 | − __poll_t mask; | |
| 1694 | − | |
| 1695 | − /* reject any unknown events outside the normal event mask. */ | |
| 1696 | − if ((u16)iocb->aio_buf != iocb->aio_buf) | |
| 1697 | − return -EINVAL; | |
| 1698 | − /* reject fields that are not defined for poll */ | |
| 1699 | − if (iocb->aio_offset || iocb->aio_nbytes || iocb->aio_rw_flags) | |
| 1700 | − return -EINVAL; | |
| 1701 | − | |
| 1702 | − req->events = demangle_poll(iocb->aio_buf) | EPOLLERR | EPOLLHUP; | |
| 1703 | − req->file = fget(iocb->aio_fildes); | |
| 1704 | − if (unlikely(!req->file)) | |
| 1705 | − return -EBADF; | |
| 1706 | − if (!file_has_poll_mask(req->file)) | |
| 1707 | − goto out_fail; | |
| 1708 | − | |
| 1709 | − req->head = req->file->f_op->get_poll_head(req->file, req->events); | |
| 1710 | − if (!req->head) | |
| 1711 | − goto out_fail; | |
| 1712 | − if (IS_ERR(req->head)) { | |
| 1713 | − mask = EPOLLERR; | |
| 1714 | − goto done; | |
| 1715 | − } | |
| 1716 | − | |
| 1717 | − init_waitqueue_func_entry(&req->wait, aio_poll_wake); | |
| 1718 | − aiocb->ki_cancel = aio_poll_cancel; | |
| 1719 | − | |
| 1720 | − spin_lock_irq(&ctx->ctx_lock); | |
| 1721 | − spin_lock(&req->head->lock); | |
| 1722 | − mask = req->file->f_op->poll_mask(req->file, req->events) & req->events; | |
| 1723 | − if (!mask) { | |
| 1724 | − __add_wait_queue(req->head, &req->wait); | |
| 1725 | − list_add_tail(&aiocb->ki_list, &ctx->active_reqs); | |
| 1726 | − } | |
| 1727 | − spin_unlock(&req->head->lock); | |
| 1728 | − spin_unlock_irq(&ctx->ctx_lock); | |
| 1729 | −done: | |
| 1730 | − if (mask) | |
| 1731 | − __aio_poll_complete(aiocb, mask); | |
| 1732 | − return 0; | |
| 1733 | −out_fail: | |
| 1734 | − fput(req->file); | |
| 1735 | − return -EINVAL; /* same as no support for IOCB_CMD_POLL */ | |
| 1736 | −} | |
| 1737 | − | |
| 1738 | 1595 | static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, |
| 1739 | 1596 | bool compat) |
| 1740 | 1597 | { |
| @@ -1808,9 +1665,6 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, · 67 unmodified lines | ||
| 1808 | 1665 | case IOCB_CMD_FDSYNC: |
| 1809 | 1666 | ret = aio_fsync(&req->fsync, &iocb, true); |
| 1810 | 1667 | break; |
| 1811 | − case IOCB_CMD_POLL: | |
| 1812 | − ret = aio_poll(req, &iocb); | |
| 1813 | − break; | |
| 1814 | 1668 | default: |
| 1815 | 1669 | pr_debug("invalid aio operation %d\n", iocb.aio_lio_opcode); |
| 1816 | 1670 | ret = -EINVAL; |
| @@ -4542,8 +4542,11 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, · 4541 unmodified lines | ||
| 4542 | 4542 | offset_in_extent = em_start - em->start; |
| 4543 | 4543 | em_end = extent_map_end(em); |
| 4544 | 4544 | em_len = em_end - em_start; |
| 4545 | − disko = em->block_start + offset_in_extent; | |
| 4546 | 4545 | flags = 0; |
| 4546 | + if (em->block_start < EXTENT_MAP_LAST_BYTE) | |
| 4547 | + disko = em->block_start + offset_in_extent; | |
| 4548 | + else | |
| 4549 | + disko = 0; | |
| 4547 | 4550 | |
| 4548 | 4551 | /* |
| 4549 | 4552 | * bump off for our next call to get_extent |
| @@ -9005,13 +9005,14 @@ again: · 9004 unmodified lines | ||
| 9005 | 9005 | |
| 9006 | 9006 | unlock_extent_cached(io_tree, page_start, page_end, &cached_state); |
| 9007 | 9007 | |
| 9008 | −out_unlock: | |
| 9009 | 9008 | if (!ret2) { |
| 9010 | 9009 | btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, true); |
| 9011 | 9010 | sb_end_pagefault(inode->i_sb); |
| 9012 | 9011 | extent_changeset_free(data_reserved); |
| 9013 | 9012 | return VM_FAULT_LOCKED; |
| 9014 | 9013 | } |
| 9014 | + | |
| 9015 | +out_unlock: | |
| 9015 | 9016 | unlock_page(page); |
| 9016 | 9017 | out: |
| 9017 | 9018 | btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, (ret != 0)); |
| @@ -9443,6 +9444,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 425 unmodified lines | ||
| 9443 | 9444 | u64 new_idx = 0; |
| 9444 | 9445 | u64 root_objectid; |
| 9445 | 9446 | int ret; |
| 9447 | + int ret2; | |
| 9446 | 9448 | bool root_log_pinned = false; |
| 9447 | 9449 | bool dest_log_pinned = false; |
| 9448 | 9450 | |
| @@ -9639,7 +9641,8 @@ out_fail: · 190 unmodified lines | ||
| 9639 | 9641 | dest_log_pinned = false; |
| 9640 | 9642 | } |
| 9641 | 9643 | } |
| 9642 | − ret = btrfs_end_transaction(trans); | |
| 9644 | + ret2 = btrfs_end_transaction(trans); | |
| 9645 | + ret = ret ? ret : ret2; | |
| 9643 | 9646 | out_notrans: |
| 9644 | 9647 | if (new_ino == BTRFS_FIRST_FREE_OBJECTID) |
| 9645 | 9648 | up_read(&fs_info->subvol_sem); |
| @@ -3577,7 +3577,7 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, · 3576 unmodified lines | ||
| 3577 | 3577 | ret = btrfs_extent_same_range(src, loff, BTRFS_MAX_DEDUPE_LEN, |
| 3578 | 3578 | dst, dst_loff, &cmp); |
| 3579 | 3579 | if (ret) |
| 3580 | − goto out_unlock; | |
| 3580 | + goto out_free; | |
| 3581 | 3581 | |
| 3582 | 3582 | loff += BTRFS_MAX_DEDUPE_LEN; |
| 3583 | 3583 | dst_loff += BTRFS_MAX_DEDUPE_LEN; |
| @@ -3587,16 +3587,16 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, · 3 unmodified lines | ||
| 3587 | 3587 | ret = btrfs_extent_same_range(src, loff, tail_len, dst, |
| 3588 | 3588 | dst_loff, &cmp); |
| 3589 | 3589 | |
| 3590 | +out_free: | |
| 3591 | + kvfree(cmp.src_pages); | |
| 3592 | + kvfree(cmp.dst_pages); | |
| 3593 | + | |
| 3590 | 3594 | out_unlock: |
| 3591 | 3595 | if (same_inode) |
| 3592 | 3596 | inode_unlock(src); |
| 3593 | 3597 | else |
| 3594 | 3598 | btrfs_double_inode_unlock(src, dst); |
| 3595 | 3599 | |
| 3596 | −out_free: | |
| 3597 | − kvfree(cmp.src_pages); | |
| 3598 | − kvfree(cmp.dst_pages); | |
| 3599 | − | |
| 3600 | 3600 | return ret; |
| 3601 | 3601 | } |
| 3602 | 3602 | |
| @@ -2680,8 +2680,10 @@ out: · 2679 unmodified lines | ||
| 2680 | 2680 | free_extent_buffer(scratch_leaf); |
| 2681 | 2681 | } |
| 2682 | 2682 | |
| 2683 | − if (done && !ret) | |
| 2683 | + if (done && !ret) { | |
| 2684 | 2684 | ret = 1; |
| 2685 | + fs_info->qgroup_rescan_progress.objectid = (u64)-1; | |
| 2686 | + } | |
| 2685 | 2687 | return ret; |
| 2686 | 2688 | } |
| 2687 | 2689 | |
| @@ -2784,13 +2786,20 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid, · 96 unmodified lines | ||
| 2784 | 2786 | |
| 2785 | 2787 | if (!init_flags) { |
| 2786 | 2788 | /* we're resuming qgroup rescan at mount time */ |
| 2787 | − if (!(fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_RESCAN)) | |
| 2789 | + if (!(fs_info->qgroup_flags & | |
| 2790 | + BTRFS_QGROUP_STATUS_FLAG_RESCAN)) { | |
| 2788 | 2791 | btrfs_warn(fs_info, |
| 2789 | 2792 | "qgroup rescan init failed, qgroup is not enabled"); |
| 2790 | − else if (!(fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_ON)) | |
| 2793 | + ret = -EINVAL; | |
| 2794 | + } else if (!(fs_info->qgroup_flags & | |
| 2795 | + BTRFS_QGROUP_STATUS_FLAG_ON)) { | |
| 2791 | 2796 | btrfs_warn(fs_info, |
| 2792 | 2797 | "qgroup rescan init failed, qgroup rescan is not queued"); |
| 2793 | − return -EINVAL; | |
| 2798 | + ret = -EINVAL; | |
| 2799 | + } | |
| 2800 | + | |
| 2801 | + if (ret) | |
| 2802 | + return ret; | |
| 2794 | 2803 | } |
| 2795 | 2804 | |
| 2796 | 2805 | mutex_lock(&fs_info->qgroup_rescan_lock); |
| @@ -1135,6 +1135,7 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in) · 1134 unmodified lines | ||
| 1135 | 1135 | if (IS_ERR(realdn)) { |
| 1136 | 1136 | pr_err("splice_dentry error %ld %p inode %p ino %llx.%llx\n", |
| 1137 | 1137 | PTR_ERR(realdn), dn, in, ceph_vinop(in)); |
| 1138 | + dput(dn); | |
| 1138 | 1139 | dn = realdn; /* note realdn contains the error */ |
| 1139 | 1140 | goto out; |
| 1140 | 1141 | } else if (realdn) { |
| @@ -101,20 +101,14 @@ static int eventfd_release(struct inode *inode, struct file *file) · 100 unmodified lines | ||
| 101 | 101 | return 0; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | −static struct wait_queue_head * | |
| 105 | −eventfd_get_poll_head(struct file *file, __poll_t events) | |
| 106 | −{ | |
| 107 | − struct eventfd_ctx *ctx = file->private_data; | |
| 108 | − | |
| 109 | − return &ctx->wqh; | |
| 110 | −} | |
| 111 | − | |
| 112 | −static __poll_t eventfd_poll_mask(struct file *file, __poll_t eventmask) | |
| 104 | +static __poll_t eventfd_poll(struct file *file, poll_table *wait) | |
| 113 | 105 | { |
| 114 | 106 | struct eventfd_ctx *ctx = file->private_data; |
| 115 | 107 | __poll_t events = 0; |
| 116 | 108 | u64 count; |
| 117 | 109 | |
| 110 | + poll_wait(file, &ctx->wqh, wait); | |
| 111 | + | |
| 118 | 112 | /* |
| 119 | 113 | * All writes to ctx->count occur within ctx->wqh.lock. This read |
| 120 | 114 | * can be done outside ctx->wqh.lock because we know that poll_wait |
| @@ -156,11 +150,11 @@ static __poll_t eventfd_poll_mask(struct file *file, __poll_t eventmask) · 35 unmodified lines | ||
| 156 | 150 | count = READ_ONCE(ctx->count); |
| 157 | 151 | |
| 158 | 152 | if (count > 0) |
| 159 | − events |= (EPOLLIN & eventmask); | |
| 153 | + events |= EPOLLIN; | |
| 160 | 154 | if (count == ULLONG_MAX) |
| 161 | 155 | events |= EPOLLERR; |
| 162 | 156 | if (ULLONG_MAX - 1 > count) |
| 163 | − events |= (EPOLLOUT & eventmask); | |
| 157 | + events |= EPOLLOUT; | |
| 164 | 158 | |
| 165 | 159 | return events; |
| 166 | 160 | } |
| @@ -311,8 +305,7 @@ static const struct file_operations eventfd_fops = { · 144 unmodified lines | ||
| 311 | 305 | .show_fdinfo = eventfd_show_fdinfo, |
| 312 | 306 | #endif |
| 313 | 307 | .release = eventfd_release, |
| 314 | − .get_poll_head = eventfd_get_poll_head, | |
| 315 | − .poll_mask = eventfd_poll_mask, | |
| 308 | + .poll = eventfd_poll, | |
| 316 | 309 | .read = eventfd_read, |
| 317 | 310 | .write = eventfd_write, |
| 318 | 311 | .llseek = noop_llseek, |
| @@ -922,18 +922,14 @@ static __poll_t ep_read_events_proc(struct eventpoll *ep, struct list_head *head · 921 unmodified lines | ||
| 922 | 922 | return 0; |
| 923 | 923 | } |
| 924 | 924 | |
| 925 | −static struct wait_queue_head *ep_eventpoll_get_poll_head(struct file *file, | |
| 926 | − __poll_t eventmask) | |
| 927 | −{ | |
| 928 | − struct eventpoll *ep = file->private_data; | |
| 929 | − return &ep->poll_wait; | |
| 930 | −} | |
| 931 | − | |
| 932 | −static __poll_t ep_eventpoll_poll_mask(struct file *file, __poll_t eventmask) | |
| 925 | +static __poll_t ep_eventpoll_poll(struct file *file, poll_table *wait) | |
| 933 | 926 | { |
| 934 | 927 | struct eventpoll *ep = file->private_data; |
| 935 | 928 | int depth = 0; |
| 936 | 929 | |
| 930 | + /* Insert inside our poll wait queue */ | |
| 931 | + poll_wait(file, &ep->poll_wait, wait); | |
| 932 | + | |
| 937 | 933 | /* |
| 938 | 934 | * Proceed to find out if wanted events are really available inside |
| 939 | 935 | * the ready list. |
| @@ -972,8 +968,7 @@ static const struct file_operations eventpoll_fops = { · 32 unmodified lines | ||
| 972 | 968 | .show_fdinfo = ep_show_fdinfo, |
| 973 | 969 | #endif |
| 974 | 970 | .release = ep_eventpoll_release, |
| 975 | − .get_poll_head = ep_eventpoll_get_poll_head, | |
| 976 | − .poll_mask = ep_eventpoll_poll_mask, | |
| 971 | + .poll = ep_eventpoll_poll, | |
| 977 | 972 | .llseek = noop_llseek, |
| 978 | 973 | }; |
| 979 | 974 | |
| @@ -509,22 +509,19 @@ static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · 508 unmodified lines | ||
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | −static struct wait_queue_head * | |
| 513 | −pipe_get_poll_head(struct file *filp, __poll_t events) | |
| 514 | −{ | |
| 515 | − struct pipe_inode_info *pipe = filp->private_data; | |
| 516 | − | |
| 517 | − return &pipe->wait; | |
| 518 | −} | |
| 519 | − | |
| 520 | 512 | /* No kernel lock held - fine */ |
| 521 | −static __poll_t pipe_poll_mask(struct file *filp, __poll_t events) | |
| 513 | +static __poll_t | |
| 514 | +pipe_poll(struct file *filp, poll_table *wait) | |
| 522 | 515 | { |
| 516 | + __poll_t mask; | |
| 523 | 517 | struct pipe_inode_info *pipe = filp->private_data; |
| 524 | − int nrbufs = pipe->nrbufs; | |
| 525 | − __poll_t mask = 0; | |
| 518 | + int nrbufs; | |
| 519 | + | |
| 520 | + poll_wait(filp, &pipe->wait, wait); | |
| 526 | 521 | |
| 527 | 522 | /* Reading only -- no need for acquiring the semaphore. */ |
| 523 | + nrbufs = pipe->nrbufs; | |
| 524 | + mask = 0; | |
| 528 | 525 | if (filp->f_mode & FMODE_READ) { |
| 529 | 526 | mask = (nrbufs > 0) ? EPOLLIN | EPOLLRDNORM : 0; |
| 530 | 527 | if (!pipe->writers && filp->f_version != pipe->w_counter) |
| @@ -1023,8 +1020,7 @@ const struct file_operations pipefifo_fops = { · 492 unmodified lines | ||
| 1023 | 1020 | .llseek = no_llseek, |
| 1024 | 1021 | .read_iter = pipe_read, |
| 1025 | 1022 | .write_iter = pipe_write, |
| 1026 | − .get_poll_head = pipe_get_poll_head, | |
| 1027 | − .poll_mask = pipe_poll_mask, | |
| 1023 | + .poll = pipe_poll, | |
| 1028 | 1024 | .unlocked_ioctl = pipe_ioctl, |
| 1029 | 1025 | .release = pipe_release, |
| 1030 | 1026 | .fasync = pipe_fasync, |
| @@ -564,11 +564,20 @@ static int proc_seq_open(struct inode *inode, struct file *file) · 563 unmodified lines | ||
| 564 | 564 | return seq_open(file, de->seq_ops); |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | +static int proc_seq_release(struct inode *inode, struct file *file) | |
| 568 | +{ | |
| 569 | + struct proc_dir_entry *de = PDE(inode); | |
| 570 | + | |
| 571 | + if (de->state_size) | |
| 572 | + return seq_release_private(inode, file); | |
| 573 | + return seq_release(inode, file); | |
| 574 | +} | |
| 575 | + | |
| 567 | 576 | static const struct file_operations proc_seq_fops = { |
| 568 | 577 | .open = proc_seq_open, |
| 569 | 578 | .read = seq_read, |
| 570 | 579 | .llseek = seq_lseek, |
| 571 | − .release = seq_release, | |
| 580 | + .release = proc_seq_release, | |
| 572 | 581 | }; |
| 573 | 582 | |
| 574 | 583 | struct proc_dir_entry *proc_create_seq_private(const char *name, umode_t mode, |
| @@ -34,29 +34,6 @@ · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | #include <linux/uaccess.h> |
| 36 | 36 | |
| 37 | −__poll_t vfs_poll(struct file *file, struct poll_table_struct *pt) | |
| 38 | −{ | |
| 39 | − if (file->f_op->poll) { | |
| 40 | − return file->f_op->poll(file, pt); | |
| 41 | − } else if (file_has_poll_mask(file)) { | |
| 42 | − unsigned int events = poll_requested_events(pt); | |
| 43 | − struct wait_queue_head *head; | |
| 44 | − | |
| 45 | − if (pt && pt->_qproc) { | |
| 46 | − head = file->f_op->get_poll_head(file, events); | |
| 47 | − if (!head) | |
| 48 | − return DEFAULT_POLLMASK; | |
| 49 | − if (IS_ERR(head)) | |
| 50 | − return EPOLLERR; | |
| 51 | − pt->_qproc(file, head, pt); | |
| 52 | − } | |
| 53 | − | |
| 54 | − return file->f_op->poll_mask(file, events); | |
| 55 | − } else { | |
| 56 | − return DEFAULT_POLLMASK; | |
| 57 | − } | |
| 58 | −} | |
| 59 | −EXPORT_SYMBOL_GPL(vfs_poll); | |
| 60 | 37 | |
| 61 | 38 | /* |
| 62 | 39 | * Estimate expected accuracy in ns from a timeval. |
| @@ -226,20 +226,21 @@ static int timerfd_release(struct inode *inode, struct file *file) · 225 unmodified lines | ||
| 226 | 226 | kfree_rcu(ctx, rcu); |
| 227 | 227 | return 0; |
| 228 | 228 | } |
| 229 | − | |
| 230 | −static struct wait_queue_head *timerfd_get_poll_head(struct file *file, | |
| 231 | − __poll_t eventmask) | |
| 229 | + | |
| 230 | +static __poll_t timerfd_poll(struct file *file, poll_table *wait) | |
| 232 | 231 | { |
| 233 | 232 | struct timerfd_ctx *ctx = file->private_data; |
| 233 | + __poll_t events = 0; | |
| 234 | + unsigned long flags; | |
| 234 | 235 | |
| 235 | − return &ctx->wqh; | |
| 236 | −} | |
| 236 | + poll_wait(file, &ctx->wqh, wait); | |
| 237 | 237 | |
| 238 | −static __poll_t timerfd_poll_mask(struct file *file, __poll_t eventmask) | |
| 239 | −{ | |
| 240 | − struct timerfd_ctx *ctx = file->private_data; | |
| 238 | + spin_lock_irqsave(&ctx->wqh.lock, flags); | |
| 239 | + if (ctx->ticks) | |
| 240 | + events |= EPOLLIN; | |
| 241 | + spin_unlock_irqrestore(&ctx->wqh.lock, flags); | |
| 241 | 242 | |
| 242 | − return ctx->ticks ? EPOLLIN : 0; | |
| 243 | + return events; | |
| 243 | 244 | } |
| 244 | 245 | |
| 245 | 246 | static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count, |
| @@ -363,8 +364,7 @@ static long timerfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg · 117 unmodified lines | ||
| 363 | 364 | |
| 364 | 365 | static const struct file_operations timerfd_fops = { |
| 365 | 366 | .release = timerfd_release, |
| 366 | − .get_poll_head = timerfd_get_poll_head, | |
| 367 | − .poll_mask = timerfd_poll_mask, | |
| 367 | + .poll = timerfd_poll, | |
| 368 | 368 | .read = timerfd_read, |
| 369 | 369 | .llseek = noop_llseek, |
| 370 | 370 | .show_fdinfo = timerfd_show, |
| @@ -157,6 +157,7 @@ __xfs_ag_resv_free( · 156 unmodified lines | ||
| 157 | 157 | error = xfs_mod_fdblocks(pag->pag_mount, oldresv, true); |
| 158 | 158 | resv->ar_reserved = 0; |
| 159 | 159 | resv->ar_asked = 0; |
| 160 | + resv->ar_orig_reserved = 0; | |
| 160 | 161 | |
| 161 | 162 | if (error) |
| 162 | 163 | trace_xfs_ag_resv_free_error(pag->pag_mount, pag->pag_agno, |
| @@ -189,13 +190,34 @@ __xfs_ag_resv_init( · 26 unmodified lines | ||
| 189 | 190 | struct xfs_mount *mp = pag->pag_mount; |
| 190 | 191 | struct xfs_ag_resv *resv; |
| 191 | 192 | int error; |
| 192 | − xfs_extlen_t reserved; | |
| 193 | + xfs_extlen_t hidden_space; | |
| 193 | 194 | |
| 194 | 195 | if (used > ask) |
| 195 | 196 | ask = used; |
| 196 | − reserved = ask - used; | |
| 197 | 197 | |
| 198 | − error = xfs_mod_fdblocks(mp, -(int64_t)reserved, true); | |
| 198 | + switch (type) { | |
| 199 | + case XFS_AG_RESV_RMAPBT: | |
| 200 | + /* | |
| 201 | + * Space taken by the rmapbt is not subtracted from fdblocks | |
| 202 | + * because the rmapbt lives in the free space. Here we must | |
| 203 | + * subtract the entire reservation from fdblocks so that we | |
| 204 | + * always have blocks available for rmapbt expansion. | |
| 205 | + */ | |
| 206 | + hidden_space = ask; | |
| 207 | + break; | |
| 208 | + case XFS_AG_RESV_METADATA: | |
| 209 | + /* | |
| 210 | + * Space taken by all other metadata btrees are accounted | |
| 211 | + * on-disk as used space. We therefore only hide the space | |
| 212 | + * that is reserved but not used by the trees. | |
| 213 | + */ | |
| 214 | + hidden_space = ask - used; | |
| 215 | + break; | |
| 216 | + default: | |
| 217 | + ASSERT(0); | |
| 218 | + return -EINVAL; | |
| 219 | + } | |
| 220 | + error = xfs_mod_fdblocks(mp, -(int64_t)hidden_space, true); | |
| 199 | 221 | if (error) { |
| 200 | 222 | trace_xfs_ag_resv_init_error(pag->pag_mount, pag->pag_agno, |
| 201 | 223 | error, _RET_IP_); |
| @@ -216,7 +238,8 @@ __xfs_ag_resv_init( · 14 unmodified lines | ||
| 216 | 238 | |
| 217 | 239 | resv = xfs_perag_resv(pag, type); |
| 218 | 240 | resv->ar_asked = ask; |
| 219 | − resv->ar_reserved = resv->ar_orig_reserved = reserved; | |
| 241 | + resv->ar_orig_reserved = hidden_space; | |
| 242 | + resv->ar_reserved = ask - used; | |
| 220 | 243 | |
| 221 | 244 | trace_xfs_ag_resv_init(pag, type, ask); |
| 222 | 245 | return 0; |
| @@ -5780,6 +5780,32 @@ del_cursor: · 5779 unmodified lines | ||
| 5780 | 5780 | return error; |
| 5781 | 5781 | } |
| 5782 | 5782 | |
| 5783 | +/* Make sure we won't be right-shifting an extent past the maximum bound. */ | |
| 5784 | +int | |
| 5785 | +xfs_bmap_can_insert_extents( | |
| 5786 | + struct xfs_inode *ip, | |
| 5787 | + xfs_fileoff_t off, | |
| 5788 | + xfs_fileoff_t shift) | |
| 5789 | +{ | |
| 5790 | + struct xfs_bmbt_irec got; | |
| 5791 | + int is_empty; | |
| 5792 | + int error = 0; | |
| 5793 | + | |
| 5794 | + ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); | |
| 5795 | + | |
| 5796 | + if (XFS_FORCED_SHUTDOWN(ip->i_mount)) | |
| 5797 | + return -EIO; | |
| 5798 | + | |
| 5799 | + xfs_ilock(ip, XFS_ILOCK_EXCL); | |
| 5800 | + error = xfs_bmap_last_extent(NULL, ip, XFS_DATA_FORK, &got, &is_empty); | |
| 5801 | + if (!error && !is_empty && got.br_startoff >= off && | |
| 5802 | + ((got.br_startoff + shift) & BMBT_STARTOFF_MASK) < got.br_startoff) | |
| 5803 | + error = -EINVAL; | |
| 5804 | + xfs_iunlock(ip, XFS_ILOCK_EXCL); | |
| 5805 | + | |
| 5806 | + return error; | |
| 5807 | +} | |
| 5808 | + | |
| 5783 | 5809 | int |
| 5784 | 5810 | xfs_bmap_insert_extents( |
| 5785 | 5811 | struct xfs_trans *tp, |
| @@ -227,6 +227,8 @@ int xfs_bmap_collapse_extents(struct xfs_trans *tp, struct xfs_inode *ip, · 226 unmodified lines | ||
| 227 | 227 | xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb, |
| 228 | 228 | bool *done, xfs_fsblock_t *firstblock, |
| 229 | 229 | struct xfs_defer_ops *dfops); |
| 230 | +int xfs_bmap_can_insert_extents(struct xfs_inode *ip, xfs_fileoff_t off, | |
| 231 | + xfs_fileoff_t shift); | |
| 230 | 232 | int xfs_bmap_insert_extents(struct xfs_trans *tp, struct xfs_inode *ip, |
| 231 | 233 | xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb, |
| 232 | 234 | bool *done, xfs_fileoff_t stop_fsb, xfs_fsblock_t *firstblock, |
| @@ -962,6 +962,9 @@ typedef enum xfs_dinode_fmt { · 961 unmodified lines | ||
| 962 | 962 | XFS_DFORK_DSIZE(dip, mp) : \ |
| 963 | 963 | XFS_DFORK_ASIZE(dip, mp)) |
| 964 | 964 | |
| 965 | +#define XFS_DFORK_MAXEXT(dip, mp, w) \ | |
| 966 | + (XFS_DFORK_SIZE(dip, mp, w) / sizeof(struct xfs_bmbt_rec)) | |
| 967 | + | |
| 965 | 968 | /* |
| 966 | 969 | * Return pointers to the data or attribute forks. |
| 967 | 970 | */ |
| @@ -1526,6 +1529,8 @@ typedef struct xfs_bmdr_block { · 558 unmodified lines | ||
| 1526 | 1529 | #define BMBT_STARTBLOCK_BITLEN 52 |
| 1527 | 1530 | #define BMBT_BLOCKCOUNT_BITLEN 21 |
| 1528 | 1531 | |
| 1532 | +#define BMBT_STARTOFF_MASK ((1ULL << BMBT_STARTOFF_BITLEN) - 1) | |
| 1533 | + | |
| 1529 | 1534 | typedef struct xfs_bmbt_rec { |
| 1530 | 1535 | __be64 l0, l1; |
| 1531 | 1536 | } xfs_bmbt_rec_t; |
| @@ -374,6 +374,47 @@ xfs_log_dinode_to_disk( · 373 unmodified lines | ||
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | +static xfs_failaddr_t | |
| 378 | +xfs_dinode_verify_fork( | |
| 379 | + struct xfs_dinode *dip, | |
| 380 | + struct xfs_mount *mp, | |
| 381 | + int whichfork) | |
| 382 | +{ | |
| 383 | + uint32_t di_nextents = XFS_DFORK_NEXTENTS(dip, whichfork); | |
| 384 | + | |
| 385 | + switch (XFS_DFORK_FORMAT(dip, whichfork)) { | |
| 386 | + case XFS_DINODE_FMT_LOCAL: | |
| 387 | + /* | |
| 388 | + * no local regular files yet | |
| 389 | + */ | |
| 390 | + if (whichfork == XFS_DATA_FORK) { | |
| 391 | + if (S_ISREG(be16_to_cpu(dip->di_mode))) | |
| 392 | + return __this_address; | |
| 393 | + if (be64_to_cpu(dip->di_size) > | |
| 394 | + XFS_DFORK_SIZE(dip, mp, whichfork)) | |
| 395 | + return __this_address; | |
| 396 | + } | |
| 397 | + if (di_nextents) | |
| 398 | + return __this_address; | |
| 399 | + break; | |
| 400 | + case XFS_DINODE_FMT_EXTENTS: | |
| 401 | + if (di_nextents > XFS_DFORK_MAXEXT(dip, mp, whichfork)) | |
| 402 | + return __this_address; | |
| 403 | + break; | |
| 404 | + case XFS_DINODE_FMT_BTREE: | |
| 405 | + if (whichfork == XFS_ATTR_FORK) { | |
| 406 | + if (di_nextents > MAXAEXTNUM) | |
| 407 | + return __this_address; | |
| 408 | + } else if (di_nextents > MAXEXTNUM) { | |
| 409 | + return __this_address; | |
| 410 | + } | |
| 411 | + break; | |
| 412 | + default: | |
| 413 | + return __this_address; | |
| 414 | + } | |
| 415 | + return NULL; | |
| 416 | +} | |
| 417 | + | |
| 377 | 418 | xfs_failaddr_t |
| 378 | 419 | xfs_dinode_verify( |
| 379 | 420 | struct xfs_mount *mp, |
| @@ -441,24 +482,9 @@ xfs_dinode_verify( · 61 unmodified lines | ||
| 441 | 482 | case S_IFREG: |
| 442 | 483 | case S_IFLNK: |
| 443 | 484 | case S_IFDIR: |
| 444 | − switch (dip->di_format) { | |
| 445 | − case XFS_DINODE_FMT_LOCAL: | |
| 446 | − /* | |
| 447 | − * no local regular files yet | |
| 448 | − */ | |
| 449 | − if (S_ISREG(mode)) | |
| 450 | − return __this_address; | |
| 451 | − if (di_size > XFS_DFORK_DSIZE(dip, mp)) | |
| 452 | − return __this_address; | |
| 453 | − if (dip->di_nextents) | |
| 454 | − return __this_address; | |
| 455 | − /* fall through */ | |
| 456 | − case XFS_DINODE_FMT_EXTENTS: | |
| 457 | − case XFS_DINODE_FMT_BTREE: | |
| 458 | − break; | |
| 459 | − default: | |
| 460 | − return __this_address; | |
| 461 | − } | |
| 485 | + fa = xfs_dinode_verify_fork(dip, mp, XFS_DATA_FORK); | |
| 486 | + if (fa) | |
| 487 | + return fa; | |
| 462 | 488 | break; |
| 463 | 489 | case 0: |
| 464 | 490 | /* Uninitialized inode ok. */ |
| @@ -468,17 +494,9 @@ xfs_dinode_verify( · 3 unmodified lines | ||
| 468 | 494 | } |
| 469 | 495 | |
| 470 | 496 | if (XFS_DFORK_Q(dip)) { |
| 471 | − switch (dip->di_aformat) { | |
| 472 | − case XFS_DINODE_FMT_LOCAL: | |
| 473 | − if (dip->di_anextents) | |
| 474 | − return __this_address; | |
| 475 | − /* fall through */ | |
| 476 | − case XFS_DINODE_FMT_EXTENTS: | |
| 477 | − case XFS_DINODE_FMT_BTREE: | |
| 478 | − break; | |
| 479 | − default: | |
| 480 | − return __this_address; | |
| 481 | − } | |
| 497 | + fa = xfs_dinode_verify_fork(dip, mp, XFS_ATTR_FORK); | |
| 498 | + if (fa) | |
| 499 | + return fa; | |
| 482 | 500 | } else { |
| 483 | 501 | /* |
| 484 | 502 | * If there is no fork offset, this may be a freshly-made inode |
| @@ -1029,8 +1029,8 @@ xfs_rtalloc_query_range( · 1028 unmodified lines | ||
| 1029 | 1029 | if (low_rec->ar_startext >= mp->m_sb.sb_rextents || |
| 1030 | 1030 | low_rec->ar_startext == high_rec->ar_startext) |
| 1031 | 1031 | return 0; |
| 1032 | − if (high_rec->ar_startext >= mp->m_sb.sb_rextents) | |
| 1033 | − high_rec->ar_startext = mp->m_sb.sb_rextents - 1; | |
| 1032 | + if (high_rec->ar_startext > mp->m_sb.sb_rextents) | |
| 1033 | + high_rec->ar_startext = mp->m_sb.sb_rextents; | |
| 1034 | 1034 | |
| 1035 | 1035 | /* Iterate the bitmap, looking for discrepancies. */ |
| 1036 | 1036 | rtstart = low_rec->ar_startext; |
| @@ -685,12 +685,10 @@ out_unlock_iolock: · 684 unmodified lines | ||
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | /* |
| 688 | − * dead simple method of punching delalyed allocation blocks from a range in | |
| 689 | − * the inode. Walks a block at a time so will be slow, but is only executed in | |
| 690 | − * rare error cases so the overhead is not critical. This will always punch out | |
| 691 | − * both the start and end blocks, even if the ranges only partially overlap | |
| 692 | − * them, so it is up to the caller to ensure that partial blocks are not | |
| 693 | − * passed in. | |
| 688 | + * Dead simple method of punching delalyed allocation blocks from a range in | |
| 689 | + * the inode. This will always punch out both the start and end blocks, even | |
| 690 | + * if the ranges only partially overlap them, so it is up to the caller to | |
| 691 | + * ensure that partial blocks are not passed in. | |
| 694 | 692 | */ |
| 695 | 693 | int |
| 696 | 694 | xfs_bmap_punch_delalloc_range( |
| @@ -698,63 +696,44 @@ xfs_bmap_punch_delalloc_range( · 1 unmodified line | ||
| 698 | 696 | xfs_fileoff_t start_fsb, |
| 699 | 697 | xfs_fileoff_t length) |
| 700 | 698 | { |
| 701 | − xfs_fileoff_t remaining = length; | |
| 699 | + struct xfs_ifork *ifp = &ip->i_df; | |
| 700 | + xfs_fileoff_t end_fsb = start_fsb + length; | |
| 701 | + struct xfs_bmbt_irec got, del; | |
| 702 | + struct xfs_iext_cursor icur; | |
| 702 | 703 | int error = 0; |
| 703 | 704 | |
| 704 | 705 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); |
| 705 | 706 | |
| 706 | − do { | |
| 707 | − int done; | |
| 708 | − xfs_bmbt_irec_t imap; | |
| 709 | − int nimaps = 1; | |
| 710 | − xfs_fsblock_t firstblock; | |
| 711 | − struct xfs_defer_ops dfops; | |
| 707 | + if (!(ifp->if_flags & XFS_IFEXTENTS)) { | |
| 708 | + error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK); | |
| 709 | + if (error) | |
| 710 | + return error; | |
| 711 | + } | |
| 712 | 712 | |
| 713 | − /* | |
| 714 | − * Map the range first and check that it is a delalloc extent | |
| 715 | − * before trying to unmap the range. Otherwise we will be | |
| 716 | − * trying to remove a real extent (which requires a | |
| 717 | − * transaction) or a hole, which is probably a bad idea... | |
| 718 | − */ | |
| 719 | − error = xfs_bmapi_read(ip, start_fsb, 1, &imap, &nimaps, | |
| 720 | − XFS_BMAPI_ENTIRE); | |
| 713 | + if (!xfs_iext_lookup_extent_before(ip, ifp, &end_fsb, &icur, &got)) | |
| 714 | + return 0; | |
| 721 | 715 | |
| 722 | − if (error) { | |
| 723 | − /* something screwed, just bail */ | |
| 724 | − if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { | |
| 725 | − xfs_alert(ip->i_mount, | |
| 726 | − "Failed delalloc mapping lookup ino %lld fsb %lld.", | |
| 727 | − ip->i_ino, start_fsb); | |
| 728 | − } | |
| 729 | − break; | |
| 730 | − } | |
| 731 | − if (!nimaps) { | |
| 732 | − /* nothing there */ | |
| 733 | − goto next_block; | |
| 734 | − } | |
| 735 | − if (imap.br_startblock != DELAYSTARTBLOCK) { | |
| 736 | − /* been converted, ignore */ | |
| 737 | − goto next_block; | |
| 738 | − } | |
| 739 | − WARN_ON(imap.br_blockcount == 0); | |
| 716 | + while (got.br_startoff + got.br_blockcount > start_fsb) { | |
| 717 | + del = got; | |
| 718 | + xfs_trim_extent(&del, start_fsb, length); | |
| 740 | 719 | |
| 741 | 720 | /* |
| 742 | − * Note: while we initialise the firstblock/dfops pair, they | |
| 743 | − * should never be used because blocks should never be | |
| 744 | − * allocated or freed for a delalloc extent and hence we need | |
| 745 | − * don't cancel or finish them after the xfs_bunmapi() call. | |
| 721 | + * A delete can push the cursor forward. Step back to the | |
| 722 | + * previous extent on non-delalloc or extents outside the | |
| 723 | + * target range. | |
| 746 | 724 | */ |
| 747 | − xfs_defer_init(&dfops, &firstblock); | |
| 748 | − error = xfs_bunmapi(NULL, ip, start_fsb, 1, 0, 1, &firstblock, | |
| 749 | − &dfops, &done); | |
| 750 | − if (error) | |
| 751 | − break; | |
| 725 | + if (!del.br_blockcount || | |
| 726 | + !isnullstartblock(del.br_startblock)) { | |
| 727 | + if (!xfs_iext_prev_extent(ifp, &icur, &got)) | |
| 728 | + break; | |
| 729 | + continue; | |
| 730 | + } | |
| 752 | 731 | |
| 753 | − ASSERT(!xfs_defer_has_unfinished_work(&dfops)); | |
| 754 | −next_block: | |
| 755 | − start_fsb++; | |
| 756 | − remaining--; | |
| 757 | − } while(remaining > 0); | |
| 732 | + error = xfs_bmap_del_extent_delay(ip, XFS_DATA_FORK, &icur, | |
| 733 | + &got, &del); | |
| 734 | + if (error || !xfs_iext_get_extent(ifp, &icur, &got)) | |
| 735 | + break; | |
| 736 | + } | |
| 758 | 737 | |
| 759 | 738 | return error; |
| 760 | 739 | } |
| @@ -1208,7 +1187,22 @@ xfs_free_file_space( · 447 unmodified lines | ||
| 1208 | 1187 | return 0; |
| 1209 | 1188 | if (offset + len > XFS_ISIZE(ip)) |
| 1210 | 1189 | len = XFS_ISIZE(ip) - offset; |
| 1211 | − return iomap_zero_range(VFS_I(ip), offset, len, NULL, &xfs_iomap_ops); | |
| 1190 | + error = iomap_zero_range(VFS_I(ip), offset, len, NULL, &xfs_iomap_ops); | |
| 1191 | + if (error) | |
| 1192 | + return error; | |
| 1193 | + | |
| 1194 | + /* | |
| 1195 | + * If we zeroed right up to EOF and EOF straddles a page boundary we | |
| 1196 | + * must make sure that the post-EOF area is also zeroed because the | |
| 1197 | + * page could be mmap'd and iomap_zero_range doesn't do that for us. | |
| 1198 | + * Writeback of the eof page will do this, albeit clumsily. | |
| 1199 | + */ | |
| 1200 | + if (offset + len >= XFS_ISIZE(ip) && ((offset + len) & PAGE_MASK)) { | |
| 1201 | + error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, | |
| 1202 | + (offset + len) & ~PAGE_MASK, LLONG_MAX); | |
| 1203 | + } | |
| 1204 | + | |
| 1205 | + return error; | |
| 1212 | 1206 | } |
| 1213 | 1207 | |
| 1214 | 1208 | /* |
| @@ -1404,6 +1398,10 @@ xfs_insert_file_space( · 189 unmodified lines | ||
| 1404 | 1398 | |
| 1405 | 1399 | trace_xfs_insert_file_space(ip); |
| 1406 | 1400 | |
| 1401 | + error = xfs_bmap_can_insert_extents(ip, stop_fsb, shift_fsb); | |
| 1402 | + if (error) | |
| 1403 | + return error; | |
| 1404 | + | |
| 1407 | 1405 | error = xfs_prepare_shift(ip, offset); |
| 1408 | 1406 | if (error) |
| 1409 | 1407 | return error; |
| @@ -513,8 +513,8 @@ xfs_getfsmap_rtdev_rtbitmap_query( · 512 unmodified lines | ||
| 513 | 513 | struct xfs_trans *tp, |
| 514 | 514 | struct xfs_getfsmap_info *info) |
| 515 | 515 | { |
| 516 | − struct xfs_rtalloc_rec alow; | |
| 517 | − struct xfs_rtalloc_rec ahigh; | |
| 516 | + struct xfs_rtalloc_rec alow = { 0 }; | |
| 517 | + struct xfs_rtalloc_rec ahigh = { 0 }; | |
| 518 | 518 | int error; |
| 519 | 519 | |
| 520 | 520 | xfs_ilock(tp->t_mountp->m_rbmip, XFS_ILOCK_SHARED); |
| @@ -387,7 +387,7 @@ xfs_reserve_blocks( · 386 unmodified lines | ||
| 387 | 387 | do { |
| 388 | 388 | free = percpu_counter_sum(&mp->m_fdblocks) - |
| 389 | 389 | mp->m_alloc_set_aside; |
| 390 | − if (!free) | |
| 390 | + if (free <= 0) | |
| 391 | 391 | break; |
| 392 | 392 | |
| 393 | 393 | delta = request - mp->m_resblks; |
| @@ -3236,7 +3236,6 @@ xfs_iflush_cluster( · 3235 unmodified lines | ||
| 3236 | 3236 | struct xfs_inode *cip; |
| 3237 | 3237 | int nr_found; |
| 3238 | 3238 | int clcount = 0; |
| 3239 | − int bufwasdelwri; | |
| 3240 | 3239 | int i; |
| 3241 | 3240 | |
| 3242 | 3241 | pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); |
| @@ -3360,37 +3359,22 @@ cluster_corrupt_out: · 117 unmodified lines | ||
| 3360 | 3359 | * inode buffer and shut down the filesystem. |
| 3361 | 3360 | */ |
| 3362 | 3361 | rcu_read_unlock(); |
| 3363 | − /* | |
| 3364 | − * Clean up the buffer. If it was delwri, just release it -- | |
| 3365 | − * brelse can handle it with no problems. If not, shut down the | |
| 3366 | − * filesystem before releasing the buffer. | |
| 3367 | − */ | |
| 3368 | − bufwasdelwri = (bp->b_flags & _XBF_DELWRI_Q); | |
| 3369 | − if (bufwasdelwri) | |
| 3370 | − xfs_buf_relse(bp); | |
| 3371 | − | |
| 3372 | 3362 | xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); |
| 3373 | 3363 | |
| 3374 | − if (!bufwasdelwri) { | |
| 3375 | − /* | |
| 3376 | − * Just like incore_relse: if we have b_iodone functions, | |
| 3377 | − * mark the buffer as an error and call them. Otherwise | |
| 3378 | − * mark it as stale and brelse. | |
| 3379 | − */ | |
| 3380 | − if (bp->b_iodone) { | |
| 3381 | − bp->b_flags &= ~XBF_DONE; | |
| 3382 | − xfs_buf_stale(bp); | |
| 3383 | − xfs_buf_ioerror(bp, -EIO); | |
| 3384 | − xfs_buf_ioend(bp); | |
| 3385 | − } else { | |
| 3386 | − xfs_buf_stale(bp); | |
| 3387 | − xfs_buf_relse(bp); | |
| 3388 | − } | |
| 3389 | − } | |
| 3390 | − | |
| 3391 | 3364 | /* |
| 3392 | − * Unlocks the flush lock | |
| 3365 | + * We'll always have an inode attached to the buffer for completion | |
| 3366 | + * process by the time we are called from xfs_iflush(). Hence we have | |
| 3367 | + * always need to do IO completion processing to abort the inodes | |
| 3368 | + * attached to the buffer. handle them just like the shutdown case in | |
| 3369 | + * xfs_buf_submit(). | |
| 3393 | 3370 | */ |
| 3371 | + ASSERT(bp->b_iodone); | |
| 3372 | + bp->b_flags &= ~XBF_DONE; | |
| 3373 | + xfs_buf_stale(bp); | |
| 3374 | + xfs_buf_ioerror(bp, -EIO); | |
| 3375 | + xfs_buf_ioend(bp); | |
| 3376 | + | |
| 3377 | + /* abort the corrupt inode, as it was not attached to the buffer */ | |
| 3394 | 3378 | xfs_iflush_abort(cip, false); |
| 3395 | 3379 | kmem_free(cilist); |
| 3396 | 3380 | xfs_perag_put(pag); |
| @@ -3486,12 +3470,17 @@ xfs_iflush( · 89 unmodified lines | ||
| 3486 | 3470 | xfs_log_force(mp, 0); |
| 3487 | 3471 | |
| 3488 | 3472 | /* |
| 3489 | − * inode clustering: | |
| 3490 | − * see if other inodes can be gathered into this write | |
| 3473 | + * inode clustering: try to gather other inodes into this write | |
| 3474 | + * | |
| 3475 | + * Note: Any error during clustering will result in the filesystem | |
| 3476 | + * being shut down and completion callbacks run on the cluster buffer. | |
| 3477 | + * As we have already flushed and attached this inode to the buffer, | |
| 3478 | + * it has already been aborted and released by xfs_iflush_cluster() and | |
| 3479 | + * so we have no further error handling to do here. | |
| 3491 | 3480 | */ |
| 3492 | 3481 | error = xfs_iflush_cluster(ip, bp); |
| 3493 | 3482 | if (error) |
| 3494 | − goto cluster_corrupt_out; | |
| 3483 | + return error; | |
| 3495 | 3484 | |
| 3496 | 3485 | *bpp = bp; |
| 3497 | 3486 | return 0; |
| @@ -3500,12 +3489,8 @@ corrupt_out: · 2 unmodified lines | ||
| 3500 | 3489 | if (bp) |
| 3501 | 3490 | xfs_buf_relse(bp); |
| 3502 | 3491 | xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); |
| 3503 | −cluster_corrupt_out: | |
| 3504 | − error = -EFSCORRUPTED; | |
| 3505 | 3492 | abort_out: |
| 3506 | − /* | |
| 3507 | − * Unlocks the flush lock | |
| 3508 | − */ | |
| 3493 | + /* abort the corrupt inode, as it was not attached to the buffer */ | |
| 3509 | 3494 | xfs_iflush_abort(ip, false); |
| 3510 | 3495 | return error; |
| 3511 | 3496 | } |
| @@ -963,12 +963,13 @@ xfs_ilock_for_iomap( · 962 unmodified lines | ||
| 963 | 963 | unsigned *lockmode) |
| 964 | 964 | { |
| 965 | 965 | unsigned mode = XFS_ILOCK_SHARED; |
| 966 | + bool is_write = flags & (IOMAP_WRITE | IOMAP_ZERO); | |
| 966 | 967 | |
| 967 | 968 | /* |
| 968 | 969 | * COW writes may allocate delalloc space or convert unwritten COW |
| 969 | 970 | * extents, so we need to make sure to take the lock exclusively here. |
| 970 | 971 | */ |
| 971 | − if (xfs_is_reflink_inode(ip) && (flags & (IOMAP_WRITE | IOMAP_ZERO))) { | |
| 972 | + if (xfs_is_reflink_inode(ip) && is_write) { | |
| 972 | 973 | /* |
| 973 | 974 | * FIXME: It could still overwrite on unshared extents and not |
| 974 | 975 | * need allocation. |
| @@ -989,6 +990,7 @@ xfs_ilock_for_iomap( · 14 unmodified lines | ||
| 989 | 990 | mode = XFS_ILOCK_EXCL; |
| 990 | 991 | } |
| 991 | 992 | |
| 993 | +relock: | |
| 992 | 994 | if (flags & IOMAP_NOWAIT) { |
| 993 | 995 | if (!xfs_ilock_nowait(ip, mode)) |
| 994 | 996 | return -EAGAIN; |
| @@ -996,6 +998,17 @@ xfs_ilock_for_iomap( · 1 unmodified line | ||
| 996 | 998 | xfs_ilock(ip, mode); |
| 997 | 999 | } |
| 998 | 1000 | |
| 1001 | + /* | |
| 1002 | + * The reflink iflag could have changed since the earlier unlocked | |
| 1003 | + * check, so if we got ILOCK_SHARED for a write and but we're now a | |
| 1004 | + * reflink inode we have to switch to ILOCK_EXCL and relock. | |
| 1005 | + */ | |
| 1006 | + if (mode == XFS_ILOCK_SHARED && is_write && xfs_is_reflink_inode(ip)) { | |
| 1007 | + xfs_iunlock(ip, mode); | |
| 1008 | + mode = XFS_ILOCK_EXCL; | |
| 1009 | + goto relock; | |
| 1010 | + } | |
| 1011 | + | |
| 999 | 1012 | *lockmode = mode; |
| 1000 | 1013 | return 0; |
| 1001 | 1014 | } |
| @@ -258,7 +258,12 @@ xfs_trans_alloc( · 257 unmodified lines | ||
| 258 | 258 | if (!(flags & XFS_TRANS_NO_WRITECOUNT)) |
| 259 | 259 | sb_start_intwrite(mp->m_super); |
| 260 | 260 | |
| 261 | − WARN_ON(mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE); | |
| 261 | + /* | |
| 262 | + * Zero-reservation ("empty") transactions can't modify anything, so | |
| 263 | + * they're allowed to run while we're frozen. | |
| 264 | + */ | |
| 265 | + WARN_ON(resp->tr_logres > 0 && | |
| 266 | + mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE); | |
| 262 | 267 | atomic_inc(&mp->m_active_trans); |
| 263 | 268 | |
| 264 | 269 | tp = kmem_zone_zalloc(xfs_trans_zone, |
| @@ -245,7 +245,8 @@ ssize_t af_alg_sendpage(struct socket *sock, struct page *page, · 244 unmodified lines | ||
| 245 | 245 | int offset, size_t size, int flags); |
| 246 | 246 | void af_alg_free_resources(struct af_alg_async_req *areq); |
| 247 | 247 | void af_alg_async_cb(struct crypto_async_request *_req, int err); |
| 248 | −__poll_t af_alg_poll_mask(struct socket *sock, __poll_t events); | |
| 248 | +__poll_t af_alg_poll(struct file *file, struct socket *sock, | |
| 249 | + poll_table *wait); | |
| 249 | 250 | struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk, |
| 250 | 251 | unsigned int areqlen); |
| 251 | 252 | int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags, |
| @@ -443,6 +443,9 @@ int acpi_check_resource_conflict(const struct resource *res); · 442 unmodified lines | ||
| 443 | 443 | int acpi_check_region(resource_size_t start, resource_size_t n, |
| 444 | 444 | const char *name); |
| 445 | 445 | |
| 446 | +acpi_status acpi_release_memory(acpi_handle handle, struct resource *res, | |
| 447 | + u32 level); | |
| 448 | + | |
| 446 | 449 | int acpi_resources_are_enforced(void); |
| 447 | 450 | |
| 448 | 451 | #ifdef CONFIG_HIBERNATION |
| @@ -1119,8 +1119,8 @@ static inline unsigned int blk_max_size_offset(struct request_queue *q, · 1118 unmodified lines | ||
| 1119 | 1119 | if (!q->limits.chunk_sectors) |
| 1120 | 1120 | return q->limits.max_sectors; |
| 1121 | 1121 | |
| 1122 | − return q->limits.chunk_sectors - | |
| 1123 | − (offset & (q->limits.chunk_sectors - 1)); | |
| 1122 | + return min(q->limits.max_sectors, (unsigned int)(q->limits.chunk_sectors - | |
| 1123 | + (offset & (q->limits.chunk_sectors - 1)))); | |
| 1124 | 1124 | } |
| 1125 | 1125 | |
| 1126 | 1126 | static inline unsigned int blk_rq_get_max_sectors(struct request *rq, |
| @@ -188,12 +188,38 @@ int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor, · 187 unmodified lines | ||
| 188 | 188 | \ |
| 189 | 189 | __ret; \ |
| 190 | 190 | }) |
| 191 | +int cgroup_bpf_prog_attach(const union bpf_attr *attr, | |
| 192 | + enum bpf_prog_type ptype, struct bpf_prog *prog); | |
| 193 | +int cgroup_bpf_prog_detach(const union bpf_attr *attr, | |
| 194 | + enum bpf_prog_type ptype); | |
| 195 | +int cgroup_bpf_prog_query(const union bpf_attr *attr, | |
| 196 | + union bpf_attr __user *uattr); | |
| 191 | 197 | #else |
| 192 | 198 | |
| 199 | +struct bpf_prog; | |
| 193 | 200 | struct cgroup_bpf {}; |
| 194 | 201 | static inline void cgroup_bpf_put(struct cgroup *cgrp) {} |
| 195 | 202 | static inline int cgroup_bpf_inherit(struct cgroup *cgrp) { return 0; } |
| 196 | 203 | |
| 204 | +static inline int cgroup_bpf_prog_attach(const union bpf_attr *attr, | |
| 205 | + enum bpf_prog_type ptype, | |
| 206 | + struct bpf_prog *prog) | |
| 207 | +{ | |
| 208 | + return -EINVAL; | |
| 209 | +} | |
| 210 | + | |
| 211 | +static inline int cgroup_bpf_prog_detach(const union bpf_attr *attr, | |
| 212 | + enum bpf_prog_type ptype) | |
| 213 | +{ | |
| 214 | + return -EINVAL; | |
| 215 | +} | |
| 216 | + | |
| 217 | +static inline int cgroup_bpf_prog_query(const union bpf_attr *attr, | |
| 218 | + union bpf_attr __user *uattr) | |
| 219 | +{ | |
| 220 | + return -EINVAL; | |
| 221 | +} | |
| 222 | + | |
| 197 | 223 | #define cgroup_bpf_enabled (0) |
| 198 | 224 | #define BPF_CGROUP_PRE_CONNECT_ENABLED(sk) (0) |
| 199 | 225 | #define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk,skb) ({ 0; }) |
| @@ -696,6 +696,8 @@ static inline void bpf_map_offload_map_free(struct bpf_map *map) · 695 unmodified lines | ||
| 696 | 696 | struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key); |
| 697 | 697 | struct sock *__sock_hash_lookup_elem(struct bpf_map *map, void *key); |
| 698 | 698 | int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type); |
| 699 | +int sockmap_get_from_fd(const union bpf_attr *attr, int type, | |
| 700 | + struct bpf_prog *prog); | |
| 699 | 701 | #else |
| 700 | 702 | static inline struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key) |
| 701 | 703 | { |
| @@ -714,6 +716,12 @@ static inline int sock_map_prog(struct bpf_map *map, · 12 unmodified lines | ||
| 714 | 716 | { |
| 715 | 717 | return -EOPNOTSUPP; |
| 716 | 718 | } |
| 719 | + | |
| 720 | +static inline int sockmap_get_from_fd(const union bpf_attr *attr, int type, | |
| 721 | + struct bpf_prog *prog) | |
| 722 | +{ | |
| 723 | + return -EINVAL; | |
| 724 | +} | |
| 717 | 725 | #endif |
| 718 | 726 | |
| 719 | 727 | #if defined(CONFIG_XDP_SOCKETS) |
| @@ -5,11 +5,12 @@ · 4 unmodified lines | ||
| 5 | 5 | #include <uapi/linux/bpf.h> |
| 6 | 6 | |
| 7 | 7 | #ifdef CONFIG_BPF_LIRC_MODE2 |
| 8 | −int lirc_prog_attach(const union bpf_attr *attr); | |
| 8 | +int lirc_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog); | |
| 9 | 9 | int lirc_prog_detach(const union bpf_attr *attr); |
| 10 | 10 | int lirc_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr); |
| 11 | 11 | #else |
| 12 | −static inline int lirc_prog_attach(const union bpf_attr *attr) | |
| 12 | +static inline int lirc_prog_attach(const union bpf_attr *attr, | |
| 13 | + struct bpf_prog *prog) | |
| 13 | 14 | { |
| 14 | 15 | return -EINVAL; |
| 15 | 16 | } |
| @@ -72,6 +72,9 @@ · 71 unmodified lines | ||
| 72 | 72 | */ |
| 73 | 73 | #ifndef COMPAT_SYSCALL_DEFINEx |
| 74 | 74 | #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ |
| 75 | + __diag_push(); \ | |
| 76 | + __diag_ignore(GCC, 8, "-Wattribute-alias", \ | |
| 77 | + "Type aliasing is used to sanitize syscall arguments");\ | |
| 75 | 78 | asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ |
| 76 | 79 | asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ |
| 77 | 80 | __attribute__((alias(__stringify(__se_compat_sys##name)))); \ |
| @@ -80,8 +83,11 @@ · 2 unmodified lines | ||
| 80 | 83 | asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ |
| 81 | 84 | asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ |
| 82 | 85 | { \ |
| 83 | − return __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\ | |
| 86 | + long ret = __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\ | |
| 87 | + __MAP(x,__SC_TEST,__VA_ARGS__); \ | |
| 88 | + return ret; \ | |
| 84 | 89 | } \ |
| 90 | + __diag_pop(); \ | |
| 85 | 91 | static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) |
| 86 | 92 | #endif /* COMPAT_SYSCALL_DEFINEx */ |
| 87 | 93 | |
| @@ -347,3 +347,28 @@ · 346 unmodified lines | ||
| 347 | 347 | #if GCC_VERSION >= 50100 |
| 348 | 348 | #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 |
| 349 | 349 | #endif |
| 350 | + | |
| 351 | +/* | |
| 352 | + * Turn individual warnings and errors on and off locally, depending | |
| 353 | + * on version. | |
| 354 | + */ | |
| 355 | +#define __diag_GCC(version, severity, s) \ | |
| 356 | + __diag_GCC_ ## version(__diag_GCC_ ## severity s) | |
| 357 | + | |
| 358 | +/* Severity used in pragma directives */ | |
| 359 | +#define __diag_GCC_ignore ignored | |
| 360 | +#define __diag_GCC_warn warning | |
| 361 | +#define __diag_GCC_error error | |
| 362 | + | |
| 363 | +/* Compilers before gcc-4.6 do not understand "#pragma GCC diagnostic push" */ | |
| 364 | +#if GCC_VERSION >= 40600 | |
| 365 | +#define __diag_str1(s) #s | |
| 366 | +#define __diag_str(s) __diag_str1(s) | |
| 367 | +#define __diag(s) _Pragma(__diag_str(GCC diagnostic s)) | |
| 368 | +#endif | |
| 369 | + | |
| 370 | +#if GCC_VERSION >= 80000 | |
| 371 | +#define __diag_GCC_8(s) __diag(s) | |
| 372 | +#else | |
| 373 | +#define __diag_GCC_8(s) | |
| 374 | +#endif | |
| @@ -271,4 +271,22 @@ struct ftrace_likely_data { · 270 unmodified lines | ||
| 271 | 271 | # define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) |
| 272 | 272 | #endif |
| 273 | 273 | |
| 274 | +#ifndef __diag | |
| 275 | +#define __diag(string) | |
| 276 | +#endif | |
| 277 | + | |
| 278 | +#ifndef __diag_GCC | |
| 279 | +#define __diag_GCC(version, severity, string) | |
| 280 | +#endif | |
| 281 | + | |
| 282 | +#define __diag_push() __diag(push) | |
| 283 | +#define __diag_pop() __diag(pop) | |
| 284 | + | |
| 285 | +#define __diag_ignore(compiler, version, option, comment) \ | |
| 286 | + __diag_ ## compiler(version, ignore, option) | |
| 287 | +#define __diag_warn(compiler, version, option, comment) \ | |
| 288 | + __diag_ ## compiler(version, warn, option) | |
| 289 | +#define __diag_error(compiler, version, option, comment) \ | |
| 290 | + __diag_ ## compiler(version, error, option) | |
| 291 | + | |
| 274 | 292 | #endif /* __LINUX_COMPILER_TYPES_H */ |
| @@ -135,7 +135,7 @@ void dax_flush(struct dax_device *dax_dev, void *addr, size_t size); · 134 unmodified lines | ||
| 135 | 135 | |
| 136 | 136 | ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, |
| 137 | 137 | const struct iomap_ops *ops); |
| 138 | −int dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size, | |
| 138 | +vm_fault_t dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size, | |
| 139 | 139 | pfn_t *pfnp, int *errp, const struct iomap_ops *ops); |
| 140 | 140 | vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf, |
| 141 | 141 | enum page_entry_size pe_size, pfn_t pfn); |
| @@ -470,9 +470,7 @@ struct sock_fprog_kern { · 469 unmodified lines | ||
| 470 | 470 | }; |
| 471 | 471 | |
| 472 | 472 | struct bpf_binary_header { |
| 473 | − u16 pages; | |
| 474 | − u16 locked:1; | |
| 475 | − | |
| 473 | + u32 pages; | |
| 476 | 474 | /* Some arches need word alignment for their instructions */ |
| 477 | 475 | u8 image[] __aligned(4); |
| 478 | 476 | }; |
| @@ -481,7 +479,7 @@ struct bpf_prog { · 2 unmodified lines | ||
| 481 | 479 | u16 pages; /* Number of allocated pages */ |
| 482 | 480 | u16 jited:1, /* Is our filter JIT'ed? */ |
| 483 | 481 | jit_requested:1,/* archs need to JIT the prog */ |
| 484 | − locked:1, /* Program image locked? */ | |
| 482 | + undo_set_mem:1, /* Passed set_memory_ro() checkpoint */ | |
| 485 | 483 | gpl_compatible:1, /* Is filter GPL compatible? */ |
| 486 | 484 | cb_access:1, /* Is control block accessed? */ |
| 487 | 485 | dst_needed:1, /* Do we need dst entry? */ |
| @@ -677,46 +675,24 @@ bpf_ctx_narrow_access_ok(u32 off, u32 size, u32 size_default) · 189 unmodified lines | ||
| 677 | 675 | |
| 678 | 676 | static inline void bpf_prog_lock_ro(struct bpf_prog *fp) |
| 679 | 677 | { |
| 680 | −#ifdef CONFIG_ARCH_HAS_SET_MEMORY | |
| 681 | − fp->locked = 1; | |
| 682 | − if (set_memory_ro((unsigned long)fp, fp->pages)) | |
| 683 | − fp->locked = 0; | |
| 684 | −#endif | |
| 678 | + fp->undo_set_mem = 1; | |
| 679 | + set_memory_ro((unsigned long)fp, fp->pages); | |
| 685 | 680 | } |
| 686 | 681 | |
| 687 | 682 | static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) |
| 688 | 683 | { |
| 689 | −#ifdef CONFIG_ARCH_HAS_SET_MEMORY | |
| 690 | − if (fp->locked) { | |
| 691 | − WARN_ON_ONCE(set_memory_rw((unsigned long)fp, fp->pages)); | |
| 692 | − /* In case set_memory_rw() fails, we want to be the first | |
| 693 | − * to crash here instead of some random place later on. | |
| 694 | − */ | |
| 695 | − fp->locked = 0; | |
| 696 | − } | |
| 697 | −#endif | |
| 684 | + if (fp->undo_set_mem) | |
| 685 | + set_memory_rw((unsigned long)fp, fp->pages); | |
| 698 | 686 | } |
| 699 | 687 | |
| 700 | 688 | static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr) |
| 701 | 689 | { |
| 702 | −#ifdef CONFIG_ARCH_HAS_SET_MEMORY | |
| 703 | − hdr->locked = 1; | |
| 704 | − if (set_memory_ro((unsigned long)hdr, hdr->pages)) | |
| 705 | − hdr->locked = 0; | |
| 706 | −#endif | |
| 690 | + set_memory_ro((unsigned long)hdr, hdr->pages); | |
| 707 | 691 | } |
| 708 | 692 | |
| 709 | 693 | static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr) |
| 710 | 694 | { |
| 711 | −#ifdef CONFIG_ARCH_HAS_SET_MEMORY | |
| 712 | − if (hdr->locked) { | |
| 713 | − WARN_ON_ONCE(set_memory_rw((unsigned long)hdr, hdr->pages)); | |
| 714 | − /* In case set_memory_rw() fails, we want to be the first | |
| 715 | − * to crash here instead of some random place later on. | |
| 716 | − */ | |
| 717 | − hdr->locked = 0; | |
| 718 | − } | |
| 719 | −#endif | |
| 695 | + set_memory_rw((unsigned long)hdr, hdr->pages); | |
| 720 | 696 | } |
| 721 | 697 | |
| 722 | 698 | static inline struct bpf_binary_header * |
| @@ -728,22 +704,6 @@ bpf_jit_binary_hdr(const struct bpf_prog *fp) · 5 unmodified lines | ||
| 728 | 704 | return (void *)addr; |
| 729 | 705 | } |
| 730 | 706 | |
| 731 | −#ifdef CONFIG_ARCH_HAS_SET_MEMORY | |
| 732 | −static inline int bpf_prog_check_pages_ro_single(const struct bpf_prog *fp) | |
| 733 | −{ | |
| 734 | − if (!fp->locked) | |
| 735 | − return -ENOLCK; | |
| 736 | − if (fp->jited) { | |
| 737 | − const struct bpf_binary_header *hdr = bpf_jit_binary_hdr(fp); | |
| 738 | − | |
| 739 | − if (!hdr->locked) | |
| 740 | − return -ENOLCK; | |
| 741 | − } | |
| 742 | − | |
| 743 | − return 0; | |
| 744 | −} | |
| 745 | −#endif | |
| 746 | − | |
| 747 | 707 | int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap); |
| 748 | 708 | static inline int sk_filter(struct sock *sk, struct sk_buff *skb) |
| 749 | 709 | { |
| @@ -1720,8 +1720,6 @@ struct file_operations { · 1719 unmodified lines | ||
| 1720 | 1720 | int (*iterate) (struct file *, struct dir_context *); |
| 1721 | 1721 | int (*iterate_shared) (struct file *, struct dir_context *); |
| 1722 | 1722 | __poll_t (*poll) (struct file *, struct poll_table_struct *); |
| 1723 | − struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t); | |
| 1724 | − __poll_t (*poll_mask) (struct file *, __poll_t); | |
| 1725 | 1723 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
| 1726 | 1724 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
| 1727 | 1725 | int (*mmap) (struct file *, struct vm_area_struct *); |
| @@ -141,7 +141,7 @@ int iio_dma_buffer_read(struct iio_buffer *buffer, size_t n, · 140 unmodified lines | ||
| 141 | 141 | char __user *user_buffer); |
| 142 | 142 | size_t iio_dma_buffer_data_available(struct iio_buffer *buffer); |
| 143 | 143 | int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd); |
| 144 | −int iio_dma_buffer_set_length(struct iio_buffer *buffer, int length); | |
| 144 | +int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length); | |
| 145 | 145 | int iio_dma_buffer_request_update(struct iio_buffer *buffer); |
| 146 | 146 | |
| 147 | 147 | int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, |
| @@ -100,7 +100,7 @@ static inline bool input_is_mt_axis(int axis) · 99 unmodified lines | ||
| 100 | 100 | return axis == ABS_MT_SLOT || input_is_mt_value(axis); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | −void input_mt_report_slot_state(struct input_dev *dev, | |
| 103 | +bool input_mt_report_slot_state(struct input_dev *dev, | |
| 104 | 104 | unsigned int tool_type, bool active); |
| 105 | 105 | |
| 106 | 106 | void input_mt_report_finger_count(struct input_dev *dev, int count); |
| @@ -8,6 +8,8 @@ · 7 unmodified lines | ||
| 8 | 8 | |
| 9 | 9 | #include <linux/mlx5/driver.h> |
| 10 | 10 | |
| 11 | +#define MLX5_ESWITCH_MANAGER(mdev) MLX5_CAP_GEN(mdev, eswitch_manager) | |
| 12 | + | |
| 11 | 13 | enum { |
| 12 | 14 | SRIOV_NONE, |
| 13 | 15 | SRIOV_LEGACY, |
| @@ -922,7 +922,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 921 unmodified lines | ||
| 922 | 922 | u8 vnic_env_queue_counters[0x1]; |
| 923 | 923 | u8 ets[0x1]; |
| 924 | 924 | u8 nic_flow_table[0x1]; |
| 925 | − u8 eswitch_flow_table[0x1]; | |
| 925 | + u8 eswitch_manager[0x1]; | |
| 926 | 926 | u8 device_memory[0x1]; |
| 927 | 927 | u8 mcam_reg[0x1]; |
| 928 | 928 | u8 pcam_reg[0x1]; |
| @@ -147,7 +147,6 @@ struct proto_ops { · 146 unmodified lines | ||
| 147 | 147 | int (*getname) (struct socket *sock, |
| 148 | 148 | struct sockaddr *addr, |
| 149 | 149 | int peer); |
| 150 | − __poll_t (*poll_mask) (struct socket *sock, __poll_t events); | |
| 151 | 150 | __poll_t (*poll) (struct file *file, struct socket *sock, |
| 152 | 151 | struct poll_table_struct *wait); |
| 153 | 152 | int (*ioctl) (struct socket *sock, unsigned int cmd, |
| @@ -2796,11 +2796,31 @@ static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff *pp, · 2795 unmodified lines | ||
| 2796 | 2796 | if (PTR_ERR(pp) != -EINPROGRESS) |
| 2797 | 2797 | NAPI_GRO_CB(skb)->flush |= flush; |
| 2798 | 2798 | } |
| 2799 | +static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb, | |
| 2800 | + struct sk_buff *pp, | |
| 2801 | + int flush, | |
| 2802 | + struct gro_remcsum *grc) | |
| 2803 | +{ | |
| 2804 | + if (PTR_ERR(pp) != -EINPROGRESS) { | |
| 2805 | + NAPI_GRO_CB(skb)->flush |= flush; | |
| 2806 | + skb_gro_remcsum_cleanup(skb, grc); | |
| 2807 | + skb->remcsum_offload = 0; | |
| 2808 | + } | |
| 2809 | +} | |
| 2799 | 2810 | #else |
| 2800 | 2811 | static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff *pp, int flush) |
| 2801 | 2812 | { |
| 2802 | 2813 | NAPI_GRO_CB(skb)->flush |= flush; |
| 2803 | 2814 | } |
| 2815 | +static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb, | |
| 2816 | + struct sk_buff *pp, | |
| 2817 | + int flush, | |
| 2818 | + struct gro_remcsum *grc) | |
| 2819 | +{ | |
| 2820 | + NAPI_GRO_CB(skb)->flush |= flush; | |
| 2821 | + skb_gro_remcsum_cleanup(skb, grc); | |
| 2822 | + skb->remcsum_offload = 0; | |
| 2823 | +} | |
| 2804 | 2824 | #endif |
| 2805 | 2825 | |
| 2806 | 2826 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, |
| @@ -234,7 +234,7 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); · 233 unmodified lines | ||
| 234 | 234 | int of_genpd_parse_idle_states(struct device_node *dn, |
| 235 | 235 | struct genpd_power_state **states, int *n); |
| 236 | 236 | unsigned int of_genpd_opp_to_performance_state(struct device *dev, |
| 237 | − struct device_node *opp_node); | |
| 237 | + struct device_node *np); | |
| 238 | 238 | |
| 239 | 239 | int genpd_dev_pm_attach(struct device *dev); |
| 240 | 240 | struct device *genpd_dev_pm_attach_by_id(struct device *dev, |
| @@ -274,9 +274,9 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn, · 33 unmodified lines | ||
| 274 | 274 | |
| 275 | 275 | static inline unsigned int |
| 276 | 276 | of_genpd_opp_to_performance_state(struct device *dev, |
| 277 | − struct device_node *opp_node) | |
| 277 | + struct device_node *np) | |
| 278 | 278 | { |
| 279 | − return -ENODEV; | |
| 279 | + return 0; | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | static inline int genpd_dev_pm_attach(struct device *dev) |
| @@ -74,18 +74,18 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) · 73 unmodified lines | ||
| 74 | 74 | pt->_key = ~(__poll_t)0; /* all events enabled */ |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | −static inline bool file_has_poll_mask(struct file *file) | |
| 77 | +static inline bool file_can_poll(struct file *file) | |
| 78 | 78 | { |
| 79 | − return file->f_op->get_poll_head && file->f_op->poll_mask; | |
| 79 | + return file->f_op->poll; | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | −static inline bool file_can_poll(struct file *file) | |
| 82 | +static inline __poll_t vfs_poll(struct file *file, struct poll_table_struct *pt) | |
| 83 | 83 | { |
| 84 | − return file->f_op->poll || file_has_poll_mask(file); | |
| 84 | + if (unlikely(!file->f_op->poll)) | |
| 85 | + return DEFAULT_POLLMASK; | |
| 86 | + return file->f_op->poll(file, pt); | |
| 85 | 87 | } |
| 86 | 88 | |
| 87 | −__poll_t vfs_poll(struct file *file, struct poll_table_struct *pt); | |
| 88 | − | |
| 89 | 89 | struct poll_table_entry { |
| 90 | 90 | struct file *filp; |
| 91 | 91 | __poll_t key; |
| @@ -354,6 +354,8 @@ struct rmi_driver_data { · 353 unmodified lines | ||
| 354 | 354 | struct mutex irq_mutex; |
| 355 | 355 | struct input_dev *input; |
| 356 | 356 | |
| 357 | + struct irq_domain *irqdomain; | |
| 358 | + | |
| 357 | 359 | u8 pdt_props; |
| 358 | 360 | |
| 359 | 361 | u8 num_rx_electrodes; |
| @@ -9,9 +9,6 @@ · 8 unmodified lines | ||
| 9 | 9 | #include <asm/io.h> |
| 10 | 10 | |
| 11 | 11 | struct scatterlist { |
| 12 | −#ifdef CONFIG_DEBUG_SG | |
| 13 | − unsigned long sg_magic; | |
| 14 | −#endif | |
| 15 | 12 | unsigned long page_link; |
| 16 | 13 | unsigned int offset; |
| 17 | 14 | unsigned int length; |
| @@ -64,7 +61,6 @@ struct sg_table { · 46 unmodified lines | ||
| 64 | 61 | * |
| 65 | 62 | */ |
| 66 | 63 | |
| 67 | −#define SG_MAGIC 0x87654321 | |
| 68 | 64 | #define SG_CHAIN 0x01UL |
| 69 | 65 | #define SG_END 0x02UL |
| 70 | 66 | |
| @@ -98,7 +94,6 @@ static inline void sg_assign_page(struct scatterlist *sg, struct page *page) · 27 unmodified lines | ||
| 98 | 94 | */ |
| 99 | 95 | BUG_ON((unsigned long) page & (SG_CHAIN | SG_END)); |
| 100 | 96 | #ifdef CONFIG_DEBUG_SG |
| 101 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 102 | 97 | BUG_ON(sg_is_chain(sg)); |
| 103 | 98 | #endif |
| 104 | 99 | sg->page_link = page_link | (unsigned long) page; |
| @@ -129,7 +124,6 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page, · 24 unmodified lines | ||
| 129 | 124 | static inline struct page *sg_page(struct scatterlist *sg) |
| 130 | 125 | { |
| 131 | 126 | #ifdef CONFIG_DEBUG_SG |
| 132 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 133 | 127 | BUG_ON(sg_is_chain(sg)); |
| 134 | 128 | #endif |
| 135 | 129 | return (struct page *)((sg)->page_link & ~(SG_CHAIN | SG_END)); |
| @@ -195,9 +189,6 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, · 59 unmodified lines | ||
| 195 | 189 | **/ |
| 196 | 190 | static inline void sg_mark_end(struct scatterlist *sg) |
| 197 | 191 | { |
| 198 | −#ifdef CONFIG_DEBUG_SG | |
| 199 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 200 | −#endif | |
| 201 | 192 | /* |
| 202 | 193 | * Set termination bit, clear potential chain bit |
| 203 | 194 | */ |
| @@ -215,9 +206,6 @@ static inline void sg_mark_end(struct scatterlist *sg) · 11 unmodified lines | ||
| 215 | 206 | **/ |
| 216 | 207 | static inline void sg_unmark_end(struct scatterlist *sg) |
| 217 | 208 | { |
| 218 | −#ifdef CONFIG_DEBUG_SG | |
| 219 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 220 | −#endif | |
| 221 | 209 | sg->page_link &= ~SG_END; |
| 222 | 210 | } |
| 223 | 211 | |
| @@ -260,12 +248,6 @@ static inline void *sg_virt(struct scatterlist *sg) · 36 unmodified lines | ||
| 260 | 248 | static inline void sg_init_marker(struct scatterlist *sgl, |
| 261 | 249 | unsigned int nents) |
| 262 | 250 | { |
| 263 | −#ifdef CONFIG_DEBUG_SG | |
| 264 | − unsigned int i; | |
| 265 | − | |
| 266 | − for (i = 0; i < nents; i++) | |
| 267 | − sgl[i].sg_magic = SG_MAGIC; | |
| 268 | −#endif | |
| 269 | 251 | sg_mark_end(&sgl[nents - 1]); |
| 270 | 252 | } |
| 271 | 253 | |
| @@ -3253,7 +3253,8 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, · 3252 unmodified lines | ||
| 3253 | 3253 | int *peeked, int *off, int *err); |
| 3254 | 3254 | struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, |
| 3255 | 3255 | int *err); |
| 3256 | −__poll_t datagram_poll_mask(struct socket *sock, __poll_t events); | |
| 3256 | +__poll_t datagram_poll(struct file *file, struct socket *sock, | |
| 3257 | + struct poll_table_struct *wait); | |
| 3257 | 3258 | int skb_copy_datagram_iter(const struct sk_buff *from, int offset, |
| 3258 | 3259 | struct iov_iter *to, int size); |
| 3259 | 3260 | static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset, |
| @@ -155,8 +155,12 @@ struct kmem_cache { · 154 unmodified lines | ||
| 155 | 155 | |
| 156 | 156 | #ifdef CONFIG_SYSFS |
| 157 | 157 | #define SLAB_SUPPORTS_SYSFS |
| 158 | +void sysfs_slab_unlink(struct kmem_cache *); | |
| 158 | 159 | void sysfs_slab_release(struct kmem_cache *); |
| 159 | 160 | #else |
| 161 | +static inline void sysfs_slab_unlink(struct kmem_cache *s) | |
| 162 | +{ | |
| 163 | +} | |
| 160 | 164 | static inline void sysfs_slab_release(struct kmem_cache *s) |
| 161 | 165 | { |
| 162 | 166 | } |
| @@ -231,6 +231,9 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) · 230 unmodified lines | ||
| 231 | 231 | */ |
| 232 | 232 | #ifndef __SYSCALL_DEFINEx |
| 233 | 233 | #define __SYSCALL_DEFINEx(x, name, ...) \ |
| 234 | + __diag_push(); \ | |
| 235 | + __diag_ignore(GCC, 8, "-Wattribute-alias", \ | |
| 236 | + "Type aliasing is used to sanitize syscall arguments");\ | |
| 234 | 237 | asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ |
| 235 | 238 | __attribute__((alias(__stringify(__se_sys##name)))); \ |
| 236 | 239 | ALLOW_ERROR_INJECTION(sys##name, ERRNO); \ |
| @@ -243,6 +246,7 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) · 6 unmodified lines | ||
| 243 | 246 | __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ |
| 244 | 247 | return ret; \ |
| 245 | 248 | } \ |
| 249 | + __diag_pop(); \ | |
| 246 | 250 | static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) |
| 247 | 251 | #endif /* __SYSCALL_DEFINEx */ |
| 248 | 252 | |
| @@ -271,7 +271,7 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, · 270 unmodified lines | ||
| 271 | 271 | int flags); |
| 272 | 272 | int bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg, |
| 273 | 273 | size_t len, int flags); |
| 274 | −__poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events); | |
| 274 | +__poll_t bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait); | |
| 275 | 275 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 276 | 276 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); |
| 277 | 277 | int bt_sock_wait_ready(struct sock *sk, unsigned long flags); |
| @@ -153,6 +153,8 @@ struct iucv_sock_list { · 152 unmodified lines | ||
| 153 | 153 | atomic_t autobind_name; |
| 154 | 154 | }; |
| 155 | 155 | |
| 156 | +__poll_t iucv_sock_poll(struct file *file, struct socket *sock, | |
| 157 | + poll_table *wait); | |
| 156 | 158 | void iucv_sock_link(struct iucv_sock_list *l, struct sock *s); |
| 157 | 159 | void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s); |
| 158 | 160 | void iucv_accept_enqueue(struct sock *parent, struct sock *sk); |
| @@ -128,6 +128,7 @@ struct net { · 127 unmodified lines | ||
| 128 | 128 | #endif |
| 129 | 129 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) |
| 130 | 130 | struct netns_nf_frag nf_frag; |
| 131 | + struct ctl_table_header *nf_frag_frags_hdr; | |
| 131 | 132 | #endif |
| 132 | 133 | struct sock *nfnl; |
| 133 | 134 | struct sock *nfnl_stash; |
| @@ -109,7 +109,6 @@ struct netns_ipv6 { · 108 unmodified lines | ||
| 109 | 109 | |
| 110 | 110 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) |
| 111 | 111 | struct netns_nf_frag { |
| 112 | − struct netns_sysctl_ipv6 sysctl; | |
| 113 | 112 | struct netns_frags frags; |
| 114 | 113 | }; |
| 115 | 114 | #endif |
| @@ -113,6 +113,11 @@ void tcf_block_put_ext(struct tcf_block *block, struct Qdisc *q, · 112 unmodified lines | ||
| 113 | 113 | { |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | +static inline bool tcf_block_shared(struct tcf_block *block) | |
| 117 | +{ | |
| 118 | + return false; | |
| 119 | +} | |
| 120 | + | |
| 116 | 121 | static inline struct Qdisc *tcf_block_q(struct tcf_block *block) |
| 117 | 122 | { |
| 118 | 123 | return NULL; |
| @@ -109,7 +109,8 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); · 108 unmodified lines | ||
| 109 | 109 | int sctp_inet_listen(struct socket *sock, int backlog); |
| 110 | 110 | void sctp_write_space(struct sock *sk); |
| 111 | 111 | void sctp_data_ready(struct sock *sk); |
| 112 | −__poll_t sctp_poll_mask(struct socket *sock, __poll_t events); | |
| 112 | +__poll_t sctp_poll(struct file *file, struct socket *sock, | |
| 113 | + poll_table *wait); | |
| 113 | 114 | void sctp_sock_rfree(struct sk_buff *skb); |
| 114 | 115 | void sctp_copy_sock(struct sock *newsk, struct sock *sk, |
| 115 | 116 | struct sctp_association *asoc); |
| @@ -388,7 +388,8 @@ bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst); · 387 unmodified lines | ||
| 388 | 388 | void tcp_close(struct sock *sk, long timeout); |
| 389 | 389 | void tcp_init_sock(struct sock *sk); |
| 390 | 390 | void tcp_init_transfer(struct sock *sk, int bpf_op); |
| 391 | −__poll_t tcp_poll_mask(struct socket *sock, __poll_t events); | |
| 391 | +__poll_t tcp_poll(struct file *file, struct socket *sock, | |
| 392 | + struct poll_table_struct *wait); | |
| 392 | 393 | int tcp_getsockopt(struct sock *sk, int level, int optname, |
| 393 | 394 | char __user *optval, int __user *optlen); |
| 394 | 395 | int tcp_setsockopt(struct sock *sk, int level, int optname, |
| @@ -109,7 +109,8 @@ struct tls_sw_context_rx { · 108 unmodified lines | ||
| 109 | 109 | |
| 110 | 110 | struct strparser strp; |
| 111 | 111 | void (*saved_data_ready)(struct sock *sk); |
| 112 | − __poll_t (*sk_poll_mask)(struct socket *sock, __poll_t events); | |
| 112 | + unsigned int (*sk_poll)(struct file *file, struct socket *sock, | |
| 113 | + struct poll_table_struct *wait); | |
| 113 | 114 | struct sk_buff *recv_pkt; |
| 114 | 115 | u8 control; |
| 115 | 116 | bool decrypted; |
| @@ -224,7 +225,8 @@ void tls_sw_free_resources_tx(struct sock *sk); · 108 unmodified lines | ||
| 224 | 225 | void tls_sw_free_resources_rx(struct sock *sk); |
| 225 | 226 | int tls_sw_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, |
| 226 | 227 | int nonblock, int flags, int *addr_len); |
| 227 | −__poll_t tls_sw_poll_mask(struct socket *sock, __poll_t events); | |
| 228 | +unsigned int tls_sw_poll(struct file *file, struct socket *sock, | |
| 229 | + struct poll_table_struct *wait); | |
| 228 | 230 | ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos, |
| 229 | 231 | struct pipe_inode_info *pipe, |
| 230 | 232 | size_t len, unsigned int flags); |
| @@ -285,7 +285,7 @@ int udp_init_sock(struct sock *sk); · 284 unmodified lines | ||
| 285 | 285 | int udp_pre_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); |
| 286 | 286 | int __udp_disconnect(struct sock *sk, int flags); |
| 287 | 287 | int udp_disconnect(struct sock *sk, int flags); |
| 288 | −__poll_t udp_poll_mask(struct socket *sock, __poll_t events); | |
| 288 | +__poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait); | |
| 289 | 289 | struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, |
| 290 | 290 | netdev_features_t features, |
| 291 | 291 | bool is_ipv6); |
| @@ -39,8 +39,10 @@ enum { · 38 unmodified lines | ||
| 39 | 39 | IOCB_CMD_PWRITE = 1, |
| 40 | 40 | IOCB_CMD_FSYNC = 2, |
| 41 | 41 | IOCB_CMD_FDSYNC = 3, |
| 42 | − /* 4 was the experimental IOCB_CMD_PREADX */ | |
| 43 | − IOCB_CMD_POLL = 5, | |
| 42 | + /* These two are experimental. | |
| 43 | + * IOCB_CMD_PREADX = 4, | |
| 44 | + * IOCB_CMD_POLL = 5, | |
| 45 | + */ | |
| 44 | 46 | IOCB_CMD_NOOP = 6, |
| 45 | 47 | IOCB_CMD_PREADV = 7, |
| 46 | 48 | IOCB_CMD_PWRITEV = 8, |
| @@ -1857,7 +1857,8 @@ union bpf_attr { · 1856 unmodified lines | ||
| 1857 | 1857 | * is resolved), the nexthop address is returned in ipv4_dst |
| 1858 | 1858 | * or ipv6_dst based on family, smac is set to mac address of |
| 1859 | 1859 | * egress device, dmac is set to nexthop mac address, rt_metric |
| 1860 | − * is set to metric from route (IPv4/IPv6 only). | |
| 1860 | + * is set to metric from route (IPv4/IPv6 only), and ifindex | |
| 1861 | + * is set to the device index of the nexthop from the FIB lookup. | |
| 1861 | 1862 | * |
| 1862 | 1863 | * *plen* argument is the size of the passed in struct. |
| 1863 | 1864 | * *flags* argument can be a combination of one or more of the |
| @@ -1873,9 +1874,10 @@ union bpf_attr { · 9 unmodified lines | ||
| 1873 | 1874 | * *ctx* is either **struct xdp_md** for XDP programs or |
| 1874 | 1875 | * **struct sk_buff** tc cls_act programs. |
| 1875 | 1876 | * Return |
| 1876 | − * Egress device index on success, 0 if packet needs to continue | |
| 1877 | − * up the stack for further processing or a negative error in case | |
| 1878 | − * of failure. | |
| 1877 | + * * < 0 if any input argument is invalid | |
| 1878 | + * * 0 on success (packet is forwarded, nexthop neighbor exists) | |
| 1879 | + * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the | |
| 1880 | + * * packet is not forwarded or needs assist from full stack | |
| 1879 | 1881 | * |
| 1880 | 1882 | * int bpf_sock_hash_update(struct bpf_sock_ops_kern *skops, struct bpf_map *map, void *key, u64 flags) |
| 1881 | 1883 | * Description |
| @@ -2612,6 +2614,18 @@ struct bpf_raw_tracepoint_args { · 730 unmodified lines | ||
| 2612 | 2614 | #define BPF_FIB_LOOKUP_DIRECT BIT(0) |
| 2613 | 2615 | #define BPF_FIB_LOOKUP_OUTPUT BIT(1) |
| 2614 | 2616 | |
| 2617 | +enum { | |
| 2618 | + BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */ | |
| 2619 | + BPF_FIB_LKUP_RET_BLACKHOLE, /* dest is blackholed; can be dropped */ | |
| 2620 | + BPF_FIB_LKUP_RET_UNREACHABLE, /* dest is unreachable; can be dropped */ | |
| 2621 | + BPF_FIB_LKUP_RET_PROHIBIT, /* dest not allowed; can be dropped */ | |
| 2622 | + BPF_FIB_LKUP_RET_NOT_FWDED, /* packet is not forwarded */ | |
| 2623 | + BPF_FIB_LKUP_RET_FWD_DISABLED, /* fwding is not enabled on ingress */ | |
| 2624 | + BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */ | |
| 2625 | + BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */ | |
| 2626 | + BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */ | |
| 2627 | +}; | |
| 2628 | + | |
| 2615 | 2629 | struct bpf_fib_lookup { |
| 2616 | 2630 | /* input: network family for lookup (AF_INET, AF_INET6) |
| 2617 | 2631 | * output: network family of egress nexthop |
| @@ -2625,7 +2639,11 @@ struct bpf_fib_lookup { · 7 unmodified lines | ||
| 2625 | 2639 | |
| 2626 | 2640 | /* total length of packet from network header - used for MTU check */ |
| 2627 | 2641 | __u16 tot_len; |
| 2628 | − __u32 ifindex; /* L3 device index for lookup */ | |
| 2642 | + | |
| 2643 | + /* input: L3 device index for lookup | |
| 2644 | + * output: device index from FIB lookup | |
| 2645 | + */ | |
| 2646 | + __u32 ifindex; | |
| 2629 | 2647 | |
| 2630 | 2648 | union { |
| 2631 | 2649 | /* inputs to lookup */ |
| @@ -44,6 +44,7 @@ · 43 unmodified lines | ||
| 44 | 44 | #define TCMU_MAILBOX_VERSION 2 |
| 45 | 45 | #define ALIGN_SIZE 64 /* Should be enough for most CPUs */ |
| 46 | 46 | #define TCMU_MAILBOX_FLAG_CAP_OOOC (1 << 0) /* Out-of-order completions */ |
| 47 | +#define TCMU_MAILBOX_FLAG_CAP_READ_LEN (1 << 1) /* Read data length */ | |
| 47 | 48 | |
| 48 | 49 | struct tcmu_mailbox { |
| 49 | 50 | __u16 version; |
| @@ -71,6 +72,7 @@ struct tcmu_cmd_entry_hdr { · 21 unmodified lines | ||
| 71 | 72 | __u16 cmd_id; |
| 72 | 73 | __u8 kflags; |
| 73 | 74 | #define TCMU_UFLAG_UNKNOWN_OP 0x1 |
| 75 | +#define TCMU_UFLAG_READ_LEN 0x2 | |
| 74 | 76 | __u8 uflags; |
| 75 | 77 | |
| 76 | 78 | } __packed; |
| @@ -119,7 +121,7 @@ struct tcmu_cmd_entry { · 42 unmodified lines | ||
| 119 | 121 | __u8 scsi_status; |
| 120 | 122 | __u8 __pad1; |
| 121 | 123 | __u16 __pad2; |
| 122 | − __u32 __pad3; | |
| 124 | + __u32 read_len; | |
| 123 | 125 | char sense_buffer[TCMU_SENSE_BUFFERSIZE]; |
| 124 | 126 | } rsp; |
| 125 | 127 | }; |
| @@ -1051,10 +1051,9 @@ config LD_DEAD_CODE_DATA_ELIMINATION · 1050 unmodified lines | ||
| 1051 | 1051 | depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION |
| 1052 | 1052 | depends on EXPERT |
| 1053 | 1053 | help |
| 1054 | − Select this if the architecture wants to do dead code and | |
| 1055 | − data elimination with the linker by compiling with | |
| 1056 | − -ffunction-sections -fdata-sections, and linking with | |
| 1057 | − --gc-sections. | |
| 1054 | + Enable this if you want to do dead code and data elimination with | |
| 1055 | + the linker by compiling with -ffunction-sections -fdata-sections, | |
| 1056 | + and linking with --gc-sections. | |
| 1058 | 1057 | |
| 1059 | 1058 | This can reduce on disk and in-memory size of the kernel |
| 1060 | 1059 | code and static data, particularly for small configs and |
| @@ -428,6 +428,60 @@ int __cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr, · 427 unmodified lines | ||
| 428 | 428 | return ret; |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | +int cgroup_bpf_prog_attach(const union bpf_attr *attr, | |
| 432 | + enum bpf_prog_type ptype, struct bpf_prog *prog) | |
| 433 | +{ | |
| 434 | + struct cgroup *cgrp; | |
| 435 | + int ret; | |
| 436 | + | |
| 437 | + cgrp = cgroup_get_from_fd(attr->target_fd); | |
| 438 | + if (IS_ERR(cgrp)) | |
| 439 | + return PTR_ERR(cgrp); | |
| 440 | + | |
| 441 | + ret = cgroup_bpf_attach(cgrp, prog, attr->attach_type, | |
| 442 | + attr->attach_flags); | |
| 443 | + cgroup_put(cgrp); | |
| 444 | + return ret; | |
| 445 | +} | |
| 446 | + | |
| 447 | +int cgroup_bpf_prog_detach(const union bpf_attr *attr, enum bpf_prog_type ptype) | |
| 448 | +{ | |
| 449 | + struct bpf_prog *prog; | |
| 450 | + struct cgroup *cgrp; | |
| 451 | + int ret; | |
| 452 | + | |
| 453 | + cgrp = cgroup_get_from_fd(attr->target_fd); | |
| 454 | + if (IS_ERR(cgrp)) | |
| 455 | + return PTR_ERR(cgrp); | |
| 456 | + | |
| 457 | + prog = bpf_prog_get_type(attr->attach_bpf_fd, ptype); | |
| 458 | + if (IS_ERR(prog)) | |
| 459 | + prog = NULL; | |
| 460 | + | |
| 461 | + ret = cgroup_bpf_detach(cgrp, prog, attr->attach_type, 0); | |
| 462 | + if (prog) | |
| 463 | + bpf_prog_put(prog); | |
| 464 | + | |
| 465 | + cgroup_put(cgrp); | |
| 466 | + return ret; | |
| 467 | +} | |
| 468 | + | |
| 469 | +int cgroup_bpf_prog_query(const union bpf_attr *attr, | |
| 470 | + union bpf_attr __user *uattr) | |
| 471 | +{ | |
| 472 | + struct cgroup *cgrp; | |
| 473 | + int ret; | |
| 474 | + | |
| 475 | + cgrp = cgroup_get_from_fd(attr->query.target_fd); | |
| 476 | + if (IS_ERR(cgrp)) | |
| 477 | + return PTR_ERR(cgrp); | |
| 478 | + | |
| 479 | + ret = cgroup_bpf_query(cgrp, attr, uattr); | |
| 480 | + | |
| 481 | + cgroup_put(cgrp); | |
| 482 | + return ret; | |
| 483 | +} | |
| 484 | + | |
| 431 | 485 | /** |
| 432 | 486 | * __cgroup_bpf_run_filter_skb() - Run a program for packet filtering |
| 433 | 487 | * @sk: The socket sending or receiving traffic |
| @@ -598,8 +598,6 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr, · 597 unmodified lines | ||
| 598 | 598 | bpf_fill_ill_insns(hdr, size); |
| 599 | 599 | |
| 600 | 600 | hdr->pages = size / PAGE_SIZE; |
| 601 | − hdr->locked = 0; | |
| 602 | − | |
| 603 | 601 | hole = min_t(unsigned int, size - (proglen + sizeof(*hdr)), |
| 604 | 602 | PAGE_SIZE - sizeof(*hdr)); |
| 605 | 603 | start = (get_random_int() % hole) & ~(alignment - 1); |
| @@ -1450,22 +1448,6 @@ static int bpf_check_tail_call(const struct bpf_prog *fp) · 844 unmodified lines | ||
| 1450 | 1448 | return 0; |
| 1451 | 1449 | } |
| 1452 | 1450 | |
| 1453 | −static int bpf_prog_check_pages_ro_locked(const struct bpf_prog *fp) | |
| 1454 | −{ | |
| 1455 | −#ifdef CONFIG_ARCH_HAS_SET_MEMORY | |
| 1456 | − int i, err; | |
| 1457 | − | |
| 1458 | − for (i = 0; i < fp->aux->func_cnt; i++) { | |
| 1459 | − err = bpf_prog_check_pages_ro_single(fp->aux->func[i]); | |
| 1460 | − if (err) | |
| 1461 | − return err; | |
| 1462 | − } | |
| 1463 | − | |
| 1464 | − return bpf_prog_check_pages_ro_single(fp); | |
| 1465 | −#endif | |
| 1466 | − return 0; | |
| 1467 | −} | |
| 1468 | − | |
| 1469 | 1451 | static void bpf_prog_select_func(struct bpf_prog *fp) |
| 1470 | 1452 | { |
| 1471 | 1453 | #ifndef CONFIG_BPF_JIT_ALWAYS_ON |
| @@ -1524,17 +1506,7 @@ finalize: · 52 unmodified lines | ||
| 1524 | 1506 | * all eBPF JITs might immediately support all features. |
| 1525 | 1507 | */ |
| 1526 | 1508 | *err = bpf_check_tail_call(fp); |
| 1527 | − if (*err) | |
| 1528 | − return fp; | |
| 1529 | − | |
| 1530 | − /* Checkpoint: at this point onwards any cBPF -> eBPF or | |
| 1531 | − * native eBPF program is read-only. If we failed to change | |
| 1532 | − * the page attributes (e.g. allocation failure from | |
| 1533 | − * splitting large pages), then reject the whole program | |
| 1534 | − * in order to guarantee not ending up with any W+X pages | |
| 1535 | − * from BPF side in kernel. | |
| 1536 | − */ | |
| 1537 | − *err = bpf_prog_check_pages_ro_locked(fp); | |
| 1509 | + | |
| 1538 | 1510 | return fp; |
| 1539 | 1511 | } |
| 1540 | 1512 | EXPORT_SYMBOL_GPL(bpf_prog_select_runtime); |
| @@ -72,6 +72,7 @@ struct bpf_htab { · 71 unmodified lines | ||
| 72 | 72 | u32 n_buckets; |
| 73 | 73 | u32 elem_size; |
| 74 | 74 | struct bpf_sock_progs progs; |
| 75 | + struct rcu_head rcu; | |
| 75 | 76 | }; |
| 76 | 77 | |
| 77 | 78 | struct htab_elem { |
| @@ -89,8 +90,8 @@ enum smap_psock_state { · 11 unmodified lines | ||
| 89 | 90 | struct smap_psock_map_entry { |
| 90 | 91 | struct list_head list; |
| 91 | 92 | struct sock **entry; |
| 92 | − struct htab_elem *hash_link; | |
| 93 | − struct bpf_htab *htab; | |
| 93 | + struct htab_elem __rcu *hash_link; | |
| 94 | + struct bpf_htab __rcu *htab; | |
| 94 | 95 | }; |
| 95 | 96 | |
| 96 | 97 | struct smap_psock { |
| @@ -120,6 +121,7 @@ struct smap_psock { · 23 unmodified lines | ||
| 120 | 121 | struct bpf_prog *bpf_parse; |
| 121 | 122 | struct bpf_prog *bpf_verdict; |
| 122 | 123 | struct list_head maps; |
| 124 | + spinlock_t maps_lock; | |
| 123 | 125 | |
| 124 | 126 | /* Back reference used when sock callback trigger sockmap operations */ |
| 125 | 127 | struct sock *sock; |
| @@ -140,6 +142,7 @@ static int bpf_tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, · 14 unmodified lines | ||
| 140 | 142 | static int bpf_tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size); |
| 141 | 143 | static int bpf_tcp_sendpage(struct sock *sk, struct page *page, |
| 142 | 144 | int offset, size_t size, int flags); |
| 145 | +static void bpf_tcp_close(struct sock *sk, long timeout); | |
| 143 | 146 | |
| 144 | 147 | static inline struct smap_psock *smap_psock_sk(const struct sock *sk) |
| 145 | 148 | { |
| @@ -161,7 +164,42 @@ out: · 15 unmodified lines | ||
| 161 | 164 | return !empty; |
| 162 | 165 | } |
| 163 | 166 | |
| 164 | −static struct proto tcp_bpf_proto; | |
| 167 | +enum { | |
| 168 | + SOCKMAP_IPV4, | |
| 169 | + SOCKMAP_IPV6, | |
| 170 | + SOCKMAP_NUM_PROTS, | |
| 171 | +}; | |
| 172 | + | |
| 173 | +enum { | |
| 174 | + SOCKMAP_BASE, | |
| 175 | + SOCKMAP_TX, | |
| 176 | + SOCKMAP_NUM_CONFIGS, | |
| 177 | +}; | |
| 178 | + | |
| 179 | +static struct proto *saved_tcpv6_prot __read_mostly; | |
| 180 | +static DEFINE_SPINLOCK(tcpv6_prot_lock); | |
| 181 | +static struct proto bpf_tcp_prots[SOCKMAP_NUM_PROTS][SOCKMAP_NUM_CONFIGS]; | |
| 182 | +static void build_protos(struct proto prot[SOCKMAP_NUM_CONFIGS], | |
| 183 | + struct proto *base) | |
| 184 | +{ | |
| 185 | + prot[SOCKMAP_BASE] = *base; | |
| 186 | + prot[SOCKMAP_BASE].close = bpf_tcp_close; | |
| 187 | + prot[SOCKMAP_BASE].recvmsg = bpf_tcp_recvmsg; | |
| 188 | + prot[SOCKMAP_BASE].stream_memory_read = bpf_tcp_stream_read; | |
| 189 | + | |
| 190 | + prot[SOCKMAP_TX] = prot[SOCKMAP_BASE]; | |
| 191 | + prot[SOCKMAP_TX].sendmsg = bpf_tcp_sendmsg; | |
| 192 | + prot[SOCKMAP_TX].sendpage = bpf_tcp_sendpage; | |
| 193 | +} | |
| 194 | + | |
| 195 | +static void update_sk_prot(struct sock *sk, struct smap_psock *psock) | |
| 196 | +{ | |
| 197 | + int family = sk->sk_family == AF_INET6 ? SOCKMAP_IPV6 : SOCKMAP_IPV4; | |
| 198 | + int conf = psock->bpf_tx_msg ? SOCKMAP_TX : SOCKMAP_BASE; | |
| 199 | + | |
| 200 | + sk->sk_prot = &bpf_tcp_prots[family][conf]; | |
| 201 | +} | |
| 202 | + | |
| 165 | 203 | static int bpf_tcp_init(struct sock *sk) |
| 166 | 204 | { |
| 167 | 205 | struct smap_psock *psock; |
| @@ -181,14 +219,17 @@ static int bpf_tcp_init(struct sock *sk) · 13 unmodified lines | ||
| 181 | 219 | psock->save_close = sk->sk_prot->close; |
| 182 | 220 | psock->sk_proto = sk->sk_prot; |
| 183 | 221 | |
| 184 | − if (psock->bpf_tx_msg) { | |
| 185 | − tcp_bpf_proto.sendmsg = bpf_tcp_sendmsg; | |
| 186 | − tcp_bpf_proto.sendpage = bpf_tcp_sendpage; | |
| 187 | − tcp_bpf_proto.recvmsg = bpf_tcp_recvmsg; | |
| 188 | − tcp_bpf_proto.stream_memory_read = bpf_tcp_stream_read; | |
| 222 | + /* Build IPv6 sockmap whenever the address of tcpv6_prot changes */ | |
| 223 | + if (sk->sk_family == AF_INET6 && | |
| 224 | + unlikely(sk->sk_prot != smp_load_acquire(&saved_tcpv6_prot))) { | |
| 225 | + spin_lock_bh(&tcpv6_prot_lock); | |
| 226 | + if (likely(sk->sk_prot != saved_tcpv6_prot)) { | |
| 227 | + build_protos(bpf_tcp_prots[SOCKMAP_IPV6], sk->sk_prot); | |
| 228 | + smp_store_release(&saved_tcpv6_prot, sk->sk_prot); | |
| 229 | + } | |
| 230 | + spin_unlock_bh(&tcpv6_prot_lock); | |
| 189 | 231 | } |
| 190 | − | |
| 191 | − sk->sk_prot = &tcp_bpf_proto; | |
| 232 | + update_sk_prot(sk, psock); | |
| 192 | 233 | rcu_read_unlock(); |
| 193 | 234 | return 0; |
| 194 | 235 | } |
| @@ -219,16 +260,54 @@ out: · 24 unmodified lines | ||
| 219 | 260 | rcu_read_unlock(); |
| 220 | 261 | } |
| 221 | 262 | |
| 263 | +static struct htab_elem *lookup_elem_raw(struct hlist_head *head, | |
| 264 | + u32 hash, void *key, u32 key_size) | |
| 265 | +{ | |
| 266 | + struct htab_elem *l; | |
| 267 | + | |
| 268 | + hlist_for_each_entry_rcu(l, head, hash_node) { | |
| 269 | + if (l->hash == hash && !memcmp(&l->key, key, key_size)) | |
| 270 | + return l; | |
| 271 | + } | |
| 272 | + | |
| 273 | + return NULL; | |
| 274 | +} | |
| 275 | + | |
| 276 | +static inline struct bucket *__select_bucket(struct bpf_htab *htab, u32 hash) | |
| 277 | +{ | |
| 278 | + return &htab->buckets[hash & (htab->n_buckets - 1)]; | |
| 279 | +} | |
| 280 | + | |
| 281 | +static inline struct hlist_head *select_bucket(struct bpf_htab *htab, u32 hash) | |
| 282 | +{ | |
| 283 | + return &__select_bucket(htab, hash)->head; | |
| 284 | +} | |
| 285 | + | |
| 222 | 286 | static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l) |
| 223 | 287 | { |
| 224 | 288 | atomic_dec(&htab->count); |
| 225 | 289 | kfree_rcu(l, rcu); |
| 226 | 290 | } |
| 227 | 291 | |
| 292 | +static struct smap_psock_map_entry *psock_map_pop(struct sock *sk, | |
| 293 | + struct smap_psock *psock) | |
| 294 | +{ | |
| 295 | + struct smap_psock_map_entry *e; | |
| 296 | + | |
| 297 | + spin_lock_bh(&psock->maps_lock); | |
| 298 | + e = list_first_entry_or_null(&psock->maps, | |
| 299 | + struct smap_psock_map_entry, | |
| 300 | + list); | |
| 301 | + if (e) | |
| 302 | + list_del(&e->list); | |
| 303 | + spin_unlock_bh(&psock->maps_lock); | |
| 304 | + return e; | |
| 305 | +} | |
| 306 | + | |
| 228 | 307 | static void bpf_tcp_close(struct sock *sk, long timeout) |
| 229 | 308 | { |
| 230 | 309 | void (*close_fun)(struct sock *sk, long timeout); |
| 231 | − struct smap_psock_map_entry *e, *tmp; | |
| 310 | + struct smap_psock_map_entry *e; | |
| 232 | 311 | struct sk_msg_buff *md, *mtmp; |
| 233 | 312 | struct smap_psock *psock; |
| 234 | 313 | struct sock *osk; |
| @@ -247,7 +326,6 @@ static void bpf_tcp_close(struct sock *sk, long timeout) · 12 unmodified lines | ||
| 247 | 326 | */ |
| 248 | 327 | close_fun = psock->save_close; |
| 249 | 328 | |
| 250 | − write_lock_bh(&sk->sk_callback_lock); | |
| 251 | 329 | if (psock->cork) { |
| 252 | 330 | free_start_sg(psock->sock, psock->cork); |
| 253 | 331 | kfree(psock->cork); |
| @@ -260,20 +338,38 @@ static void bpf_tcp_close(struct sock *sk, long timeout) · 6 unmodified lines | ||
| 260 | 338 | kfree(md); |
| 261 | 339 | } |
| 262 | 340 | |
| 263 | − list_for_each_entry_safe(e, tmp, &psock->maps, list) { | |
| 341 | + e = psock_map_pop(sk, psock); | |
| 342 | + while (e) { | |
| 264 | 343 | if (e->entry) { |
| 265 | 344 | osk = cmpxchg(e->entry, sk, NULL); |
| 266 | 345 | if (osk == sk) { |
| 267 | − list_del(&e->list); | |
| 268 | 346 | smap_release_sock(psock, sk); |
| 269 | 347 | } |
| 270 | 348 | } else { |
| 271 | − hlist_del_rcu(&e->hash_link->hash_node); | |
| 272 | − smap_release_sock(psock, e->hash_link->sk); | |
| 273 | − free_htab_elem(e->htab, e->hash_link); | |
| 349 | + struct htab_elem *link = rcu_dereference(e->hash_link); | |
| 350 | + struct bpf_htab *htab = rcu_dereference(e->htab); | |
| 351 | + struct hlist_head *head; | |
| 352 | + struct htab_elem *l; | |
| 353 | + struct bucket *b; | |
| 354 | + | |
| 355 | + b = __select_bucket(htab, link->hash); | |
| 356 | + head = &b->head; | |
| 357 | + raw_spin_lock_bh(&b->lock); | |
| 358 | + l = lookup_elem_raw(head, | |
| 359 | + link->hash, link->key, | |
| 360 | + htab->map.key_size); | |
| 361 | + /* If another thread deleted this object skip deletion. | |
| 362 | + * The refcnt on psock may or may not be zero. | |
| 363 | + */ | |
| 364 | + if (l) { | |
| 365 | + hlist_del_rcu(&link->hash_node); | |
| 366 | + smap_release_sock(psock, link->sk); | |
| 367 | + free_htab_elem(htab, link); | |
| 368 | + } | |
| 369 | + raw_spin_unlock_bh(&b->lock); | |
| 274 | 370 | } |
| 371 | + e = psock_map_pop(sk, psock); | |
| 275 | 372 | } |
| 276 | − write_unlock_bh(&sk->sk_callback_lock); | |
| 277 | 373 | rcu_read_unlock(); |
| 278 | 374 | close_fun(sk, timeout); |
| 279 | 375 | } |
| @@ -1111,8 +1207,7 @@ static void bpf_tcp_msg_add(struct smap_psock *psock, · 831 unmodified lines | ||
| 1111 | 1207 | |
| 1112 | 1208 | static int bpf_tcp_ulp_register(void) |
| 1113 | 1209 | { |
| 1114 | − tcp_bpf_proto = tcp_prot; | |
| 1115 | − tcp_bpf_proto.close = bpf_tcp_close; | |
| 1210 | + build_protos(bpf_tcp_prots[SOCKMAP_IPV4], &tcp_prot); | |
| 1116 | 1211 | /* Once BPF TX ULP is registered it is never unregistered. It |
| 1117 | 1212 | * will be in the ULP list for the lifetime of the system. Doing |
| 1118 | 1213 | * duplicate registers is not a problem. |
| @@ -1357,7 +1452,9 @@ static void smap_release_sock(struct smap_psock *psock, struct sock *sock) · 238 unmodified lines | ||
| 1357 | 1452 | { |
| 1358 | 1453 | if (refcount_dec_and_test(&psock->refcnt)) { |
| 1359 | 1454 | tcp_cleanup_ulp(sock); |
| 1455 | + write_lock_bh(&sock->sk_callback_lock); | |
| 1360 | 1456 | smap_stop_sock(psock, sock); |
| 1457 | + write_unlock_bh(&sock->sk_callback_lock); | |
| 1361 | 1458 | clear_bit(SMAP_TX_RUNNING, &psock->state); |
| 1362 | 1459 | rcu_assign_sk_user_data(sock, NULL); |
| 1363 | 1460 | call_rcu_sched(&psock->rcu, smap_destroy_psock); |
| @@ -1508,6 +1605,7 @@ static struct smap_psock *smap_init_psock(struct sock *sock, int node) · 144 unmodified lines | ||
| 1508 | 1605 | INIT_LIST_HEAD(&psock->maps); |
| 1509 | 1606 | INIT_LIST_HEAD(&psock->ingress); |
| 1510 | 1607 | refcount_set(&psock->refcnt, 1); |
| 1608 | + spin_lock_init(&psock->maps_lock); | |
| 1511 | 1609 | |
| 1512 | 1610 | rcu_assign_sk_user_data(sock, psock); |
| 1513 | 1611 | sock_hold(sock); |
| @@ -1564,18 +1662,32 @@ free_stab: · 50 unmodified lines | ||
| 1564 | 1662 | return ERR_PTR(err); |
| 1565 | 1663 | } |
| 1566 | 1664 | |
| 1567 | −static void smap_list_remove(struct smap_psock *psock, | |
| 1568 | − struct sock **entry, | |
| 1569 | − struct htab_elem *hash_link) | |
| 1665 | +static void smap_list_map_remove(struct smap_psock *psock, | |
| 1666 | + struct sock **entry) | |
| 1570 | 1667 | { |
| 1571 | 1668 | struct smap_psock_map_entry *e, *tmp; |
| 1572 | 1669 | |
| 1670 | + spin_lock_bh(&psock->maps_lock); | |
| 1573 | 1671 | list_for_each_entry_safe(e, tmp, &psock->maps, list) { |
| 1574 | − if (e->entry == entry || e->hash_link == hash_link) { | |
| 1672 | + if (e->entry == entry) | |
| 1575 | 1673 | list_del(&e->list); |
| 1576 | − break; | |
| 1577 | − } | |
| 1578 | 1674 | } |
| 1675 | + spin_unlock_bh(&psock->maps_lock); | |
| 1676 | +} | |
| 1677 | + | |
| 1678 | +static void smap_list_hash_remove(struct smap_psock *psock, | |
| 1679 | + struct htab_elem *hash_link) | |
| 1680 | +{ | |
| 1681 | + struct smap_psock_map_entry *e, *tmp; | |
| 1682 | + | |
| 1683 | + spin_lock_bh(&psock->maps_lock); | |
| 1684 | + list_for_each_entry_safe(e, tmp, &psock->maps, list) { | |
| 1685 | + struct htab_elem *c = rcu_dereference(e->hash_link); | |
| 1686 | + | |
| 1687 | + if (c == hash_link) | |
| 1688 | + list_del(&e->list); | |
| 1689 | + } | |
| 1690 | + spin_unlock_bh(&psock->maps_lock); | |
| 1579 | 1691 | } |
| 1580 | 1692 | |
| 1581 | 1693 | static void sock_map_free(struct bpf_map *map) |
| @@ -1601,7 +1713,6 @@ static void sock_map_free(struct bpf_map *map) · 19 unmodified lines | ||
| 1601 | 1713 | if (!sock) |
| 1602 | 1714 | continue; |
| 1603 | 1715 | |
| 1604 | − write_lock_bh(&sock->sk_callback_lock); | |
| 1605 | 1716 | psock = smap_psock_sk(sock); |
| 1606 | 1717 | /* This check handles a racing sock event that can get the |
| 1607 | 1718 | * sk_callback_lock before this case but after xchg happens |
| @@ -1609,10 +1720,9 @@ static void sock_map_free(struct bpf_map *map) · 1 unmodified line | ||
| 1609 | 1720 | * to be null and queued for garbage collection. |
| 1610 | 1721 | */ |
| 1611 | 1722 | if (likely(psock)) { |
| 1612 | − smap_list_remove(psock, &stab->sock_map[i], NULL); | |
| 1723 | + smap_list_map_remove(psock, &stab->sock_map[i]); | |
| 1613 | 1724 | smap_release_sock(psock, sock); |
| 1614 | 1725 | } |
| 1615 | − write_unlock_bh(&sock->sk_callback_lock); | |
| 1616 | 1726 | } |
| 1617 | 1727 | rcu_read_unlock(); |
| 1618 | 1728 | |
| @@ -1661,17 +1771,15 @@ static int sock_map_delete_elem(struct bpf_map *map, void *key) · 42 unmodified lines | ||
| 1661 | 1771 | if (!sock) |
| 1662 | 1772 | return -EINVAL; |
| 1663 | 1773 | |
| 1664 | − write_lock_bh(&sock->sk_callback_lock); | |
| 1665 | 1774 | psock = smap_psock_sk(sock); |
| 1666 | 1775 | if (!psock) |
| 1667 | 1776 | goto out; |
| 1668 | 1777 | |
| 1669 | 1778 | if (psock->bpf_parse) |
| 1670 | 1779 | smap_stop_sock(psock, sock); |
| 1671 | − smap_list_remove(psock, &stab->sock_map[k], NULL); | |
| 1780 | + smap_list_map_remove(psock, &stab->sock_map[k]); | |
| 1672 | 1781 | smap_release_sock(psock, sock); |
| 1673 | 1782 | out: |
| 1674 | − write_unlock_bh(&sock->sk_callback_lock); | |
| 1675 | 1783 | return 0; |
| 1676 | 1784 | } |
| 1677 | 1785 | |
| @@ -1752,7 +1860,6 @@ static int __sock_map_ctx_update_elem(struct bpf_map *map, · 74 unmodified lines | ||
| 1752 | 1860 | } |
| 1753 | 1861 | } |
| 1754 | 1862 | |
| 1755 | − write_lock_bh(&sock->sk_callback_lock); | |
| 1756 | 1863 | psock = smap_psock_sk(sock); |
| 1757 | 1864 | |
| 1758 | 1865 | /* 2. Do not allow inheriting programs if psock exists and has |
| @@ -1809,7 +1916,9 @@ static int __sock_map_ctx_update_elem(struct bpf_map *map, · 50 unmodified lines | ||
| 1809 | 1916 | if (err) |
| 1810 | 1917 | goto out_free; |
| 1811 | 1918 | smap_init_progs(psock, verdict, parse); |
| 1919 | + write_lock_bh(&sock->sk_callback_lock); | |
| 1812 | 1920 | smap_start_sock(psock, sock); |
| 1921 | + write_unlock_bh(&sock->sk_callback_lock); | |
| 1813 | 1922 | } |
| 1814 | 1923 | |
| 1815 | 1924 | /* 4. Place psock in sockmap for use and stop any programs on |
| @@ -1819,9 +1928,10 @@ static int __sock_map_ctx_update_elem(struct bpf_map *map, · 3 unmodified lines | ||
| 1819 | 1928 | */ |
| 1820 | 1929 | if (map_link) { |
| 1821 | 1930 | e->entry = map_link; |
| 1931 | + spin_lock_bh(&psock->maps_lock); | |
| 1822 | 1932 | list_add_tail(&e->list, &psock->maps); |
| 1933 | + spin_unlock_bh(&psock->maps_lock); | |
| 1823 | 1934 | } |
| 1824 | − write_unlock_bh(&sock->sk_callback_lock); | |
| 1825 | 1935 | return err; |
| 1826 | 1936 | out_free: |
| 1827 | 1937 | smap_release_sock(psock, sock); |
| @@ -1832,7 +1942,6 @@ out_progs: · 4 unmodified lines | ||
| 1832 | 1942 | } |
| 1833 | 1943 | if (tx_msg) |
| 1834 | 1944 | bpf_prog_put(tx_msg); |
| 1835 | − write_unlock_bh(&sock->sk_callback_lock); | |
| 1836 | 1945 | kfree(e); |
| 1837 | 1946 | return err; |
| 1838 | 1947 | } |
| @@ -1869,10 +1978,8 @@ static int sock_map_ctx_update_elem(struct bpf_sock_ops_kern *skops, · 30 unmodified lines | ||
| 1869 | 1978 | if (osock) { |
| 1870 | 1979 | struct smap_psock *opsock = smap_psock_sk(osock); |
| 1871 | 1980 | |
| 1872 | − write_lock_bh(&osock->sk_callback_lock); | |
| 1873 | − smap_list_remove(opsock, &stab->sock_map[i], NULL); | |
| 1981 | + smap_list_map_remove(opsock, &stab->sock_map[i]); | |
| 1874 | 1982 | smap_release_sock(opsock, osock); |
| 1875 | − write_unlock_bh(&osock->sk_callback_lock); | |
| 1876 | 1983 | } |
| 1877 | 1984 | out: |
| 1878 | 1985 | return err; |
| @@ -1915,6 +2022,24 @@ int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type) · 36 unmodified lines | ||
| 1915 | 2022 | return 0; |
| 1916 | 2023 | } |
| 1917 | 2024 | |
| 2025 | +int sockmap_get_from_fd(const union bpf_attr *attr, int type, | |
| 2026 | + struct bpf_prog *prog) | |
| 2027 | +{ | |
| 2028 | + int ufd = attr->target_fd; | |
| 2029 | + struct bpf_map *map; | |
| 2030 | + struct fd f; | |
| 2031 | + int err; | |
| 2032 | + | |
| 2033 | + f = fdget(ufd); | |
| 2034 | + map = __bpf_map_get(f); | |
| 2035 | + if (IS_ERR(map)) | |
| 2036 | + return PTR_ERR(map); | |
| 2037 | + | |
| 2038 | + err = sock_map_prog(map, prog, attr->attach_type); | |
| 2039 | + fdput(f); | |
| 2040 | + return err; | |
| 2041 | +} | |
| 2042 | + | |
| 1918 | 2043 | static void *sock_map_lookup(struct bpf_map *map, void *key) |
| 1919 | 2044 | { |
| 1920 | 2045 | return NULL; |
| @@ -2043,14 +2168,13 @@ free_htab: · 122 unmodified lines | ||
| 2043 | 2168 | return ERR_PTR(err); |
| 2044 | 2169 | } |
| 2045 | 2170 | |
| 2046 | −static inline struct bucket *__select_bucket(struct bpf_htab *htab, u32 hash) | |
| 2171 | +static void __bpf_htab_free(struct rcu_head *rcu) | |
| 2047 | 2172 | { |
| 2048 | − return &htab->buckets[hash & (htab->n_buckets - 1)]; | |
| 2049 | −} | |
| 2173 | + struct bpf_htab *htab; | |
| 2050 | 2174 | |
| 2051 | −static inline struct hlist_head *select_bucket(struct bpf_htab *htab, u32 hash) | |
| 2052 | −{ | |
| 2053 | − return &__select_bucket(htab, hash)->head; | |
| 2175 | + htab = container_of(rcu, struct bpf_htab, rcu); | |
| 2176 | + bpf_map_area_free(htab->buckets); | |
| 2177 | + kfree(htab); | |
| 2054 | 2178 | } |
| 2055 | 2179 | |
| 2056 | 2180 | static void sock_hash_free(struct bpf_map *map) |
| @@ -2069,16 +2193,18 @@ static void sock_hash_free(struct bpf_map *map) · 12 unmodified lines | ||
| 2069 | 2193 | */ |
| 2070 | 2194 | rcu_read_lock(); |
| 2071 | 2195 | for (i = 0; i < htab->n_buckets; i++) { |
| 2072 | − struct hlist_head *head = select_bucket(htab, i); | |
| 2196 | + struct bucket *b = __select_bucket(htab, i); | |
| 2197 | + struct hlist_head *head; | |
| 2073 | 2198 | struct hlist_node *n; |
| 2074 | 2199 | struct htab_elem *l; |
| 2075 | 2200 | |
| 2201 | + raw_spin_lock_bh(&b->lock); | |
| 2202 | + head = &b->head; | |
| 2076 | 2203 | hlist_for_each_entry_safe(l, n, head, hash_node) { |
| 2077 | 2204 | struct sock *sock = l->sk; |
| 2078 | 2205 | struct smap_psock *psock; |
| 2079 | 2206 | |
| 2080 | 2207 | hlist_del_rcu(&l->hash_node); |
| 2081 | − write_lock_bh(&sock->sk_callback_lock); | |
| 2082 | 2208 | psock = smap_psock_sk(sock); |
| 2083 | 2209 | /* This check handles a racing sock event that can get |
| 2084 | 2210 | * the sk_callback_lock before this case but after xchg |
| @@ -2086,16 +2212,15 @@ static void sock_hash_free(struct bpf_map *map) · 1 unmodified line | ||
| 2086 | 2212 | * (psock) to be null and queued for garbage collection. |
| 2087 | 2213 | */ |
| 2088 | 2214 | if (likely(psock)) { |
| 2089 | − smap_list_remove(psock, NULL, l); | |
| 2215 | + smap_list_hash_remove(psock, l); | |
| 2090 | 2216 | smap_release_sock(psock, sock); |
| 2091 | 2217 | } |
| 2092 | − write_unlock_bh(&sock->sk_callback_lock); | |
| 2093 | − kfree(l); | |
| 2218 | + free_htab_elem(htab, l); | |
| 2094 | 2219 | } |
| 2220 | + raw_spin_unlock_bh(&b->lock); | |
| 2095 | 2221 | } |
| 2096 | 2222 | rcu_read_unlock(); |
| 2097 | − bpf_map_area_free(htab->buckets); | |
| 2098 | − kfree(htab); | |
| 2223 | + call_rcu(&htab->rcu, __bpf_htab_free); | |
| 2099 | 2224 | } |
| 2100 | 2225 | |
| 2101 | 2226 | static struct htab_elem *alloc_sock_hash_elem(struct bpf_htab *htab, |
| @@ -2122,19 +2247,6 @@ static struct htab_elem *alloc_sock_hash_elem(struct bpf_htab *htab, · 20 unmodified lines | ||
| 2122 | 2247 | return l_new; |
| 2123 | 2248 | } |
| 2124 | 2249 | |
| 2125 | −static struct htab_elem *lookup_elem_raw(struct hlist_head *head, | |
| 2126 | − u32 hash, void *key, u32 key_size) | |
| 2127 | −{ | |
| 2128 | − struct htab_elem *l; | |
| 2129 | − | |
| 2130 | − hlist_for_each_entry_rcu(l, head, hash_node) { | |
| 2131 | − if (l->hash == hash && !memcmp(&l->key, key, key_size)) | |
| 2132 | − return l; | |
| 2133 | − } | |
| 2134 | − | |
| 2135 | − return NULL; | |
| 2136 | −} | |
| 2137 | − | |
| 2138 | 2250 | static inline u32 htab_map_hash(const void *key, u32 key_len) |
| 2139 | 2251 | { |
| 2140 | 2252 | return jhash(key, key_len, 0); |
| @@ -2254,9 +2366,12 @@ static int sock_hash_ctx_update_elem(struct bpf_sock_ops_kern *skops, · 113 unmodified lines | ||
| 2254 | 2366 | goto bucket_err; |
| 2255 | 2367 | } |
| 2256 | 2368 | |
| 2257 | − e->hash_link = l_new; | |
| 2258 | − e->htab = container_of(map, struct bpf_htab, map); | |
| 2369 | + rcu_assign_pointer(e->hash_link, l_new); | |
| 2370 | + rcu_assign_pointer(e->htab, | |
| 2371 | + container_of(map, struct bpf_htab, map)); | |
| 2372 | + spin_lock_bh(&psock->maps_lock); | |
| 2259 | 2373 | list_add_tail(&e->list, &psock->maps); |
| 2374 | + spin_unlock_bh(&psock->maps_lock); | |
| 2260 | 2375 | |
| 2261 | 2376 | /* add new element to the head of the list, so that |
| 2262 | 2377 | * concurrent search will find it before old elem |
| @@ -2266,7 +2381,7 @@ static int sock_hash_ctx_update_elem(struct bpf_sock_ops_kern *skops, · 3 unmodified lines | ||
| 2266 | 2381 | psock = smap_psock_sk(l_old->sk); |
| 2267 | 2382 | |
| 2268 | 2383 | hlist_del_rcu(&l_old->hash_node); |
| 2269 | − smap_list_remove(psock, NULL, l_old); | |
| 2384 | + smap_list_hash_remove(psock, l_old); | |
| 2270 | 2385 | smap_release_sock(psock, l_old->sk); |
| 2271 | 2386 | free_htab_elem(htab, l_old); |
| 2272 | 2387 | } |
| @@ -2326,7 +2441,6 @@ static int sock_hash_delete_elem(struct bpf_map *map, void *key) · 53 unmodified lines | ||
| 2326 | 2441 | struct smap_psock *psock; |
| 2327 | 2442 | |
| 2328 | 2443 | hlist_del_rcu(&l->hash_node); |
| 2329 | − write_lock_bh(&sock->sk_callback_lock); | |
| 2330 | 2444 | psock = smap_psock_sk(sock); |
| 2331 | 2445 | /* This check handles a racing sock event that can get the |
| 2332 | 2446 | * sk_callback_lock before this case but after xchg happens |
| @@ -2334,10 +2448,9 @@ static int sock_hash_delete_elem(struct bpf_map *map, void *key) · 1 unmodified line | ||
| 2334 | 2448 | * to be null and queued for garbage collection. |
| 2335 | 2449 | */ |
| 2336 | 2450 | if (likely(psock)) { |
| 2337 | − smap_list_remove(psock, NULL, l); | |
| 2451 | + smap_list_hash_remove(psock, l); | |
| 2338 | 2452 | smap_release_sock(psock, sock); |
| 2339 | 2453 | } |
| 2340 | − write_unlock_bh(&sock->sk_callback_lock); | |
| 2341 | 2454 | free_htab_elem(htab, l); |
| 2342 | 2455 | ret = 0; |
| 2343 | 2456 | } |
| @@ -2383,6 +2496,7 @@ const struct bpf_map_ops sock_hash_ops = { · 39 unmodified lines | ||
| 2383 | 2496 | .map_get_next_key = sock_hash_get_next_key, |
| 2384 | 2497 | .map_update_elem = sock_hash_update_elem, |
| 2385 | 2498 | .map_delete_elem = sock_hash_delete_elem, |
| 2499 | + .map_release_uref = sock_map_release, | |
| 2386 | 2500 | }; |
| 2387 | 2501 | |
| 2388 | 2502 | BPF_CALL_4(bpf_sock_map_update, struct bpf_sock_ops_kern *, bpf_sock, |
| @@ -1483,8 +1483,6 @@ out_free_tp: · 1482 unmodified lines | ||
| 1483 | 1483 | return err; |
| 1484 | 1484 | } |
| 1485 | 1485 | |
| 1486 | −#ifdef CONFIG_CGROUP_BPF | |
| 1487 | − | |
| 1488 | 1486 | static int bpf_prog_attach_check_attach_type(const struct bpf_prog *prog, |
| 1489 | 1487 | enum bpf_attach_type attach_type) |
| 1490 | 1488 | { |
| @@ -1499,40 +1497,6 @@ static int bpf_prog_attach_check_attach_type(const struct bpf_prog *prog, · 8 unmodified lines | ||
| 1499 | 1497 | |
| 1500 | 1498 | #define BPF_PROG_ATTACH_LAST_FIELD attach_flags |
| 1501 | 1499 | |
| 1502 | −static int sockmap_get_from_fd(const union bpf_attr *attr, | |
| 1503 | − int type, bool attach) | |
| 1504 | −{ | |
| 1505 | − struct bpf_prog *prog = NULL; | |
| 1506 | − int ufd = attr->target_fd; | |
| 1507 | − struct bpf_map *map; | |
| 1508 | − struct fd f; | |
| 1509 | − int err; | |
| 1510 | − | |
| 1511 | − f = fdget(ufd); | |
| 1512 | − map = __bpf_map_get(f); | |
| 1513 | − if (IS_ERR(map)) | |
| 1514 | − return PTR_ERR(map); | |
| 1515 | − | |
| 1516 | − if (attach) { | |
| 1517 | − prog = bpf_prog_get_type(attr->attach_bpf_fd, type); | |
| 1518 | − if (IS_ERR(prog)) { | |
| 1519 | − fdput(f); | |
| 1520 | − return PTR_ERR(prog); | |
| 1521 | − } | |
| 1522 | − } | |
| 1523 | − | |
| 1524 | − err = sock_map_prog(map, prog, attr->attach_type); | |
| 1525 | − if (err) { | |
| 1526 | − fdput(f); | |
| 1527 | − if (prog) | |
| 1528 | − bpf_prog_put(prog); | |
| 1529 | − return err; | |
| 1530 | − } | |
| 1531 | − | |
| 1532 | − fdput(f); | |
| 1533 | − return 0; | |
| 1534 | −} | |
| 1535 | − | |
| 1536 | 1500 | #define BPF_F_ATTACH_MASK \ |
| 1537 | 1501 | (BPF_F_ALLOW_OVERRIDE | BPF_F_ALLOW_MULTI) |
| 1538 | 1502 | |
| @@ -1540,7 +1504,6 @@ static int bpf_prog_attach(const union bpf_attr *attr) · 1 unmodified line | ||
| 1540 | 1504 | { |
| 1541 | 1505 | enum bpf_prog_type ptype; |
| 1542 | 1506 | struct bpf_prog *prog; |
| 1543 | − struct cgroup *cgrp; | |
| 1544 | 1507 | int ret; |
| 1545 | 1508 | |
| 1546 | 1509 | if (!capable(CAP_NET_ADMIN)) |
| @@ -1577,12 +1540,15 @@ static int bpf_prog_attach(const union bpf_attr *attr) · 30 unmodified lines | ||
| 1577 | 1540 | ptype = BPF_PROG_TYPE_CGROUP_DEVICE; |
| 1578 | 1541 | break; |
| 1579 | 1542 | case BPF_SK_MSG_VERDICT: |
| 1580 | − return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_MSG, true); | |
| 1543 | + ptype = BPF_PROG_TYPE_SK_MSG; | |
| 1544 | + break; | |
| 1581 | 1545 | case BPF_SK_SKB_STREAM_PARSER: |
| 1582 | 1546 | case BPF_SK_SKB_STREAM_VERDICT: |
| 1583 | − return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_SKB, true); | |
| 1547 | + ptype = BPF_PROG_TYPE_SK_SKB; | |
| 1548 | + break; | |
| 1584 | 1549 | case BPF_LIRC_MODE2: |
| 1585 | − return lirc_prog_attach(attr); | |
| 1550 | + ptype = BPF_PROG_TYPE_LIRC_MODE2; | |
| 1551 | + break; | |
| 1586 | 1552 | default: |
| 1587 | 1553 | return -EINVAL; |
| 1588 | 1554 | } |
| @@ -1596,18 +1562,20 @@ static int bpf_prog_attach(const union bpf_attr *attr) · 7 unmodified lines | ||
| 1596 | 1562 | return -EINVAL; |
| 1597 | 1563 | } |
| 1598 | 1564 | |
| 1599 | − cgrp = cgroup_get_from_fd(attr->target_fd); | |
| 1600 | − if (IS_ERR(cgrp)) { | |
| 1601 | − bpf_prog_put(prog); | |
| 1602 | − return PTR_ERR(cgrp); | |
| 1565 | + switch (ptype) { | |
| 1566 | + case BPF_PROG_TYPE_SK_SKB: | |
| 1567 | + case BPF_PROG_TYPE_SK_MSG: | |
| 1568 | + ret = sockmap_get_from_fd(attr, ptype, prog); | |
| 1569 | + break; | |
| 1570 | + case BPF_PROG_TYPE_LIRC_MODE2: | |
| 1571 | + ret = lirc_prog_attach(attr, prog); | |
| 1572 | + break; | |
| 1573 | + default: | |
| 1574 | + ret = cgroup_bpf_prog_attach(attr, ptype, prog); | |
| 1603 | 1575 | } |
| 1604 | 1576 | |
| 1605 | − ret = cgroup_bpf_attach(cgrp, prog, attr->attach_type, | |
| 1606 | − attr->attach_flags); | |
| 1607 | 1577 | if (ret) |
| 1608 | 1578 | bpf_prog_put(prog); |
| 1609 | − cgroup_put(cgrp); | |
| 1610 | − | |
| 1611 | 1579 | return ret; |
| 1612 | 1580 | } |
| 1613 | 1581 | |
| @@ -1616,9 +1584,6 @@ static int bpf_prog_attach(const union bpf_attr *attr) · 2 unmodified lines | ||
| 1616 | 1584 | static int bpf_prog_detach(const union bpf_attr *attr) |
| 1617 | 1585 | { |
| 1618 | 1586 | enum bpf_prog_type ptype; |
| 1619 | − struct bpf_prog *prog; | |
| 1620 | − struct cgroup *cgrp; | |
| 1621 | − int ret; | |
| 1622 | 1587 | |
| 1623 | 1588 | if (!capable(CAP_NET_ADMIN)) |
| 1624 | 1589 | return -EPERM; |
| @@ -1651,29 +1616,17 @@ static int bpf_prog_detach(const union bpf_attr *attr) · 26 unmodified lines | ||
| 1651 | 1616 | ptype = BPF_PROG_TYPE_CGROUP_DEVICE; |
| 1652 | 1617 | break; |
| 1653 | 1618 | case BPF_SK_MSG_VERDICT: |
| 1654 | − return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_MSG, false); | |
| 1619 | + return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_MSG, NULL); | |
| 1655 | 1620 | case BPF_SK_SKB_STREAM_PARSER: |
| 1656 | 1621 | case BPF_SK_SKB_STREAM_VERDICT: |
| 1657 | − return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_SKB, false); | |
| 1622 | + return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_SKB, NULL); | |
| 1658 | 1623 | case BPF_LIRC_MODE2: |
| 1659 | 1624 | return lirc_prog_detach(attr); |
| 1660 | 1625 | default: |
| 1661 | 1626 | return -EINVAL; |
| 1662 | 1627 | } |
| 1663 | 1628 | |
| 1664 | − cgrp = cgroup_get_from_fd(attr->target_fd); | |
| 1665 | − if (IS_ERR(cgrp)) | |
| 1666 | − return PTR_ERR(cgrp); | |
| 1667 | − | |
| 1668 | − prog = bpf_prog_get_type(attr->attach_bpf_fd, ptype); | |
| 1669 | − if (IS_ERR(prog)) | |
| 1670 | − prog = NULL; | |
| 1671 | − | |
| 1672 | − ret = cgroup_bpf_detach(cgrp, prog, attr->attach_type, 0); | |
| 1673 | − if (prog) | |
| 1674 | − bpf_prog_put(prog); | |
| 1675 | − cgroup_put(cgrp); | |
| 1676 | − return ret; | |
| 1629 | + return cgroup_bpf_prog_detach(attr, ptype); | |
| 1677 | 1630 | } |
| 1678 | 1631 | |
| 1679 | 1632 | #define BPF_PROG_QUERY_LAST_FIELD query.prog_cnt |
| @@ -1681,9 +1634,6 @@ static int bpf_prog_detach(const union bpf_attr *attr) · 1 unmodified line | ||
| 1681 | 1634 | static int bpf_prog_query(const union bpf_attr *attr, |
| 1682 | 1635 | union bpf_attr __user *uattr) |
| 1683 | 1636 | { |
| 1684 | − struct cgroup *cgrp; | |
| 1685 | − int ret; | |
| 1686 | − | |
| 1687 | 1637 | if (!capable(CAP_NET_ADMIN)) |
| 1688 | 1638 | return -EPERM; |
| 1689 | 1639 | if (CHECK_ATTR(BPF_PROG_QUERY)) |
| @@ -1711,14 +1661,9 @@ static int bpf_prog_query(const union bpf_attr *attr, · 21 unmodified lines | ||
| 1711 | 1661 | default: |
| 1712 | 1662 | return -EINVAL; |
| 1713 | 1663 | } |
| 1714 | − cgrp = cgroup_get_from_fd(attr->query.target_fd); | |
| 1715 | − if (IS_ERR(cgrp)) | |
| 1716 | − return PTR_ERR(cgrp); | |
| 1717 | − ret = cgroup_bpf_query(cgrp, attr, uattr); | |
| 1718 | − cgroup_put(cgrp); | |
| 1719 | − return ret; | |
| 1664 | + | |
| 1665 | + return cgroup_bpf_prog_query(attr, uattr); | |
| 1720 | 1666 | } |
| 1721 | −#endif /* CONFIG_CGROUP_BPF */ | |
| 1722 | 1667 | |
| 1723 | 1668 | #define BPF_PROG_TEST_RUN_LAST_FIELD test.duration |
| 1724 | 1669 | |
| @@ -2365,7 +2310,6 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz · 640 unmodified lines | ||
| 2365 | 2310 | case BPF_OBJ_GET: |
| 2366 | 2311 | err = bpf_obj_get(&attr); |
| 2367 | 2312 | break; |
| 2368 | −#ifdef CONFIG_CGROUP_BPF | |
| 2369 | 2313 | case BPF_PROG_ATTACH: |
| 2370 | 2314 | err = bpf_prog_attach(&attr); |
| 2371 | 2315 | break; |
| @@ -2375,7 +2319,6 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz · 3 unmodified lines | ||
| 2375 | 2319 | case BPF_PROG_QUERY: |
| 2376 | 2320 | err = bpf_prog_query(&attr, uattr); |
| 2377 | 2321 | break; |
| 2378 | −#endif | |
| 2379 | 2322 | case BPF_PROG_TEST_RUN: |
| 2380 | 2323 | err = bpf_prog_test_run(&attr, uattr); |
| 2381 | 2324 | break; |
| @@ -1085,3 +1085,4 @@ const struct dma_map_ops swiotlb_dma_ops = { · 1084 unmodified lines | ||
| 1085 | 1085 | .unmap_page = swiotlb_unmap_page, |
| 1086 | 1086 | .dma_supported = dma_direct_supported, |
| 1087 | 1087 | }; |
| 1088 | +EXPORT_SYMBOL(swiotlb_dma_ops); | |
| @@ -6482,7 +6482,7 @@ void perf_prepare_sample(struct perf_event_header *header, · 6481 unmodified lines | ||
| 6482 | 6482 | data->phys_addr = perf_virt_to_phys(data->addr); |
| 6483 | 6483 | } |
| 6484 | 6484 | |
| 6485 | −static void __always_inline | |
| 6485 | +static __always_inline void | |
| 6486 | 6486 | __perf_event_output(struct perf_event *event, |
| 6487 | 6487 | struct perf_sample_data *data, |
| 6488 | 6488 | struct pt_regs *regs, |
| @@ -6,6 +6,7 @@ if HAVE_ARCH_KASAN · 5 unmodified lines | ||
| 6 | 6 | config KASAN |
| 7 | 7 | bool "KASan: runtime memory debugger" |
| 8 | 8 | depends on SLUB || (SLAB && !DEBUG_SLAB) |
| 9 | + select SLUB_DEBUG if SLUB | |
| 9 | 10 | select CONSTRUCTORS |
| 10 | 11 | select STACKDEPOT |
| 11 | 12 | help |
| @@ -141,7 +141,7 @@ int percpu_ida_alloc(struct percpu_ida *pool, int state) · 140 unmodified lines | ||
| 141 | 141 | spin_lock_irqsave(&tags->lock, flags); |
| 142 | 142 | |
| 143 | 143 | /* Fastpath */ |
| 144 | − if (likely(tags->nr_free >= 0)) { | |
| 144 | + if (likely(tags->nr_free)) { | |
| 145 | 145 | tag = tags->freelist[--tags->nr_free]; |
| 146 | 146 | spin_unlock_irqrestore(&tags->lock, flags); |
| 147 | 147 | return tag; |
| @@ -24,9 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | **/ |
| 25 | 25 | struct scatterlist *sg_next(struct scatterlist *sg) |
| 26 | 26 | { |
| 27 | −#ifdef CONFIG_DEBUG_SG | |
| 28 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 29 | −#endif | |
| 30 | 27 | if (sg_is_last(sg)) |
| 31 | 28 | return NULL; |
| 32 | 29 | |
| @@ -111,10 +108,7 @@ struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents) · 78 unmodified lines | ||
| 111 | 108 | for_each_sg(sgl, sg, nents, i) |
| 112 | 109 | ret = sg; |
| 113 | 110 | |
| 114 | −#ifdef CONFIG_DEBUG_SG | |
| 115 | − BUG_ON(sgl[0].sg_magic != SG_MAGIC); | |
| 116 | 111 | BUG_ON(!sg_is_last(ret)); |
| 117 | −#endif | |
| 118 | 112 | return ret; |
| 119 | 113 | } |
| 120 | 114 | EXPORT_SYMBOL(sg_last); |
| @@ -5282,21 +5282,31 @@ static struct bpf_test tests[] = { · 5281 unmodified lines | ||
| 5282 | 5282 | { /* Mainly checking JIT here. */ |
| 5283 | 5283 | "BPF_MAXINSNS: Ctx heavy transformations", |
| 5284 | 5284 | { }, |
| 5285 | +#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390) | |
| 5286 | + CLASSIC | FLAG_EXPECTED_FAIL, | |
| 5287 | +#else | |
| 5285 | 5288 | CLASSIC, |
| 5289 | +#endif | |
| 5286 | 5290 | { }, |
| 5287 | 5291 | { |
| 5288 | 5292 | { 1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }, |
| 5289 | 5293 | { 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) } |
| 5290 | 5294 | }, |
| 5291 | 5295 | .fill_helper = bpf_fill_maxinsns6, |
| 5296 | + .expected_errcode = -ENOTSUPP, | |
| 5292 | 5297 | }, |
| 5293 | 5298 | { /* Mainly checking JIT here. */ |
| 5294 | 5299 | "BPF_MAXINSNS: Call heavy transformations", |
| 5295 | 5300 | { }, |
| 5301 | +#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390) | |
| 5302 | + CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL, | |
| 5303 | +#else | |
| 5296 | 5304 | CLASSIC | FLAG_NO_DATA, |
| 5305 | +#endif | |
| 5297 | 5306 | { }, |
| 5298 | 5307 | { { 1, 0 }, { 10, 0 } }, |
| 5299 | 5308 | .fill_helper = bpf_fill_maxinsns7, |
| 5309 | + .expected_errcode = -ENOTSUPP, | |
| 5300 | 5310 | }, |
| 5301 | 5311 | { /* Mainly checking JIT here. */ |
| 5302 | 5312 | "BPF_MAXINSNS: Jump heavy test", |
| @@ -5347,18 +5357,28 @@ static struct bpf_test tests[] = { · 44 unmodified lines | ||
| 5347 | 5357 | { |
| 5348 | 5358 | "BPF_MAXINSNS: exec all MSH", |
| 5349 | 5359 | { }, |
| 5360 | +#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390) | |
| 5361 | + CLASSIC | FLAG_EXPECTED_FAIL, | |
| 5362 | +#else | |
| 5350 | 5363 | CLASSIC, |
| 5364 | +#endif | |
| 5351 | 5365 | { 0xfa, 0xfb, 0xfc, 0xfd, }, |
| 5352 | 5366 | { { 4, 0xababab83 } }, |
| 5353 | 5367 | .fill_helper = bpf_fill_maxinsns13, |
| 5368 | + .expected_errcode = -ENOTSUPP, | |
| 5354 | 5369 | }, |
| 5355 | 5370 | { |
| 5356 | 5371 | "BPF_MAXINSNS: ld_abs+get_processor_id", |
| 5357 | 5372 | { }, |
| 5373 | +#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390) | |
| 5374 | + CLASSIC | FLAG_EXPECTED_FAIL, | |
| 5375 | +#else | |
| 5358 | 5376 | CLASSIC, |
| 5377 | +#endif | |
| 5359 | 5378 | { }, |
| 5360 | 5379 | { { 1, 0xbee } }, |
| 5361 | 5380 | .fill_helper = bpf_fill_ld_abs_get_processor_id, |
| 5381 | + .expected_errcode = -ENOTSUPP, | |
| 5362 | 5382 | }, |
| 5363 | 5383 | /* |
| 5364 | 5384 | * LD_IND / LD_ABS on fragmented SKBs |
| @@ -260,13 +260,6 @@ plain(void) · 259 unmodified lines | ||
| 260 | 260 | { |
| 261 | 261 | int err; |
| 262 | 262 | |
| 263 | − /* | |
| 264 | − * Make sure crng is ready. Otherwise we get "(ptrval)" instead | |
| 265 | − * of a hashed address when printing '%p' in plain_hash() and | |
| 266 | − * plain_format(). | |
| 267 | − */ | |
| 268 | − wait_for_random_bytes(); | |
| 269 | − | |
| 270 | 263 | err = plain_hash(); |
| 271 | 264 | if (err) { |
| 272 | 265 | pr_warn("plain 'p' does not appear to be hashed\n"); |
| @@ -567,10 +567,14 @@ static int shutdown_cache(struct kmem_cache *s) · 566 unmodified lines | ||
| 567 | 567 | list_del(&s->list); |
| 568 | 568 | |
| 569 | 569 | if (s->flags & SLAB_TYPESAFE_BY_RCU) { |
| 570 | +#ifdef SLAB_SUPPORTS_SYSFS | |
| 571 | + sysfs_slab_unlink(s); | |
| 572 | +#endif | |
| 570 | 573 | list_add_tail(&s->list, &slab_caches_to_rcu_destroy); |
| 571 | 574 | schedule_work(&slab_caches_to_rcu_destroy_work); |
| 572 | 575 | } else { |
| 573 | 576 | #ifdef SLAB_SUPPORTS_SYSFS |
| 577 | + sysfs_slab_unlink(s); | |
| 574 | 578 | sysfs_slab_release(s); |
| 575 | 579 | #else |
| 576 | 580 | slab_kmem_cache_release(s); |
| @@ -5667,7 +5667,6 @@ static void sysfs_slab_remove_workfn(struct work_struct *work) · 5666 unmodified lines | ||
| 5667 | 5667 | kset_unregister(s->memcg_kset); |
| 5668 | 5668 | #endif |
| 5669 | 5669 | kobject_uevent(&s->kobj, KOBJ_REMOVE); |
| 5670 | − kobject_del(&s->kobj); | |
| 5671 | 5670 | out: |
| 5672 | 5671 | kobject_put(&s->kobj); |
| 5673 | 5672 | } |
| @@ -5752,6 +5751,12 @@ static void sysfs_slab_remove(struct kmem_cache *s) · 78 unmodified lines | ||
| 5752 | 5751 | schedule_work(&s->kobj_remove_work); |
| 5753 | 5752 | } |
| 5754 | 5753 | |
| 5754 | +void sysfs_slab_unlink(struct kmem_cache *s) | |
| 5755 | +{ | |
| 5756 | + if (slab_state >= FULL) | |
| 5757 | + kobject_del(&s->kobj); | |
| 5758 | +} | |
| 5759 | + | |
| 5755 | 5760 | void sysfs_slab_release(struct kmem_cache *s) |
| 5756 | 5761 | { |
| 5757 | 5762 | if (slab_state >= FULL) |
| @@ -1796,11 +1796,9 @@ static void vmstat_update(struct work_struct *w) · 1795 unmodified lines | ||
| 1796 | 1796 | * to occur in the future. Keep on running the |
| 1797 | 1797 | * update worker thread. |
| 1798 | 1798 | */ |
| 1799 | − preempt_disable(); | |
| 1800 | 1799 | queue_delayed_work_on(smp_processor_id(), mm_percpu_wq, |
| 1801 | 1800 | this_cpu_ptr(&vmstat_work), |
| 1802 | 1801 | round_jiffies_relative(sysctl_stat_interval)); |
| 1803 | − preempt_enable(); | |
| 1804 | 1802 | } |
| 1805 | 1803 | } |
| 1806 | 1804 | |
| @@ -694,7 +694,7 @@ static struct sk_buff *vlan_gro_receive(struct list_head *head, · 693 unmodified lines | ||
| 694 | 694 | out_unlock: |
| 695 | 695 | rcu_read_unlock(); |
| 696 | 696 | out: |
| 697 | − NAPI_GRO_CB(skb)->flush |= flush; | |
| 697 | + skb_gro_flush_final(skb, pp, flush); | |
| 698 | 698 | |
| 699 | 699 | return pp; |
| 700 | 700 | } |
| @@ -20,11 +20,7 @@ obj-$(CONFIG_TLS) += tls/ · 19 unmodified lines | ||
| 20 | 20 | obj-$(CONFIG_XFRM) += xfrm/ |
| 21 | 21 | obj-$(CONFIG_UNIX) += unix/ |
| 22 | 22 | obj-$(CONFIG_NET) += ipv6/ |
| 23 | −ifneq ($(CC_CAN_LINK),y) | |
| 24 | −$(warning CC cannot link executables. Skipping bpfilter.) | |
| 25 | −else | |
| 26 | 23 | obj-$(CONFIG_BPFILTER) += bpfilter/ |
| 27 | −endif | |
| 28 | 24 | obj-$(CONFIG_PACKET) += packet/ |
| 29 | 25 | obj-$(CONFIG_NET_KEY) += key/ |
| 30 | 26 | obj-$(CONFIG_BRIDGE) += bridge/ |
| @@ -1869,7 +1869,7 @@ static const struct proto_ops atalk_dgram_ops = { · 1868 unmodified lines | ||
| 1869 | 1869 | .socketpair = sock_no_socketpair, |
| 1870 | 1870 | .accept = sock_no_accept, |
| 1871 | 1871 | .getname = atalk_getname, |
| 1872 | − .poll_mask = datagram_poll_mask, | |
| 1872 | + .poll = datagram_poll, | |
| 1873 | 1873 | .ioctl = atalk_ioctl, |
| 1874 | 1874 | #ifdef CONFIG_COMPAT |
| 1875 | 1875 | .compat_ioctl = atalk_compat_ioctl, |
| @@ -647,11 +647,16 @@ out: · 646 unmodified lines | ||
| 647 | 647 | return error; |
| 648 | 648 | } |
| 649 | 649 | |
| 650 | −__poll_t vcc_poll_mask(struct socket *sock, __poll_t events) | |
| 650 | +__poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait) | |
| 651 | 651 | { |
| 652 | 652 | struct sock *sk = sock->sk; |
| 653 | − struct atm_vcc *vcc = ATM_SD(sock); | |
| 654 | − __poll_t mask = 0; | |
| 653 | + struct atm_vcc *vcc; | |
| 654 | + __poll_t mask; | |
| 655 | + | |
| 656 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 657 | + mask = 0; | |
| 658 | + | |
| 659 | + vcc = ATM_SD(sock); | |
| 655 | 660 | |
| 656 | 661 | /* exceptional events */ |
| 657 | 662 | if (sk->sk_err) |
| @@ -17,7 +17,7 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci); · 16 unmodified lines | ||
| 17 | 17 | int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, |
| 18 | 18 | int flags); |
| 19 | 19 | int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len); |
| 20 | −__poll_t vcc_poll_mask(struct socket *sock, __poll_t events); | |
| 20 | +__poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait); | |
| 21 | 21 | int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 22 | 22 | int vcc_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 23 | 23 | int vcc_setsockopt(struct socket *sock, int level, int optname, |
| @@ -113,7 +113,7 @@ static const struct proto_ops pvc_proto_ops = { · 112 unmodified lines | ||
| 113 | 113 | .socketpair = sock_no_socketpair, |
| 114 | 114 | .accept = sock_no_accept, |
| 115 | 115 | .getname = pvc_getname, |
| 116 | − .poll_mask = vcc_poll_mask, | |
| 116 | + .poll = vcc_poll, | |
| 117 | 117 | .ioctl = vcc_ioctl, |
| 118 | 118 | #ifdef CONFIG_COMPAT |
| 119 | 119 | .compat_ioctl = vcc_compat_ioctl, |
| @@ -636,7 +636,7 @@ static const struct proto_ops svc_proto_ops = { · 635 unmodified lines | ||
| 636 | 636 | .socketpair = sock_no_socketpair, |
| 637 | 637 | .accept = svc_accept, |
| 638 | 638 | .getname = svc_getname, |
| 639 | − .poll_mask = vcc_poll_mask, | |
| 639 | + .poll = vcc_poll, | |
| 640 | 640 | .ioctl = svc_ioctl, |
| 641 | 641 | #ifdef CONFIG_COMPAT |
| 642 | 642 | .compat_ioctl = svc_compat_ioctl, |
| @@ -1941,7 +1941,7 @@ static const struct proto_ops ax25_proto_ops = { · 1940 unmodified lines | ||
| 1941 | 1941 | .socketpair = sock_no_socketpair, |
| 1942 | 1942 | .accept = ax25_accept, |
| 1943 | 1943 | .getname = ax25_getname, |
| 1944 | − .poll_mask = datagram_poll_mask, | |
| 1944 | + .poll = datagram_poll, | |
| 1945 | 1945 | .ioctl = ax25_ioctl, |
| 1946 | 1946 | .listen = ax25_listen, |
| 1947 | 1947 | .shutdown = ax25_shutdown, |
| @@ -437,13 +437,16 @@ static inline __poll_t bt_accept_poll(struct sock *parent) · 436 unmodified lines | ||
| 437 | 437 | return 0; |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | −__poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events) | |
| 440 | +__poll_t bt_sock_poll(struct file *file, struct socket *sock, | |
| 441 | + poll_table *wait) | |
| 441 | 442 | { |
| 442 | 443 | struct sock *sk = sock->sk; |
| 443 | 444 | __poll_t mask = 0; |
| 444 | 445 | |
| 445 | 446 | BT_DBG("sock %p, sk %p", sock, sk); |
| 446 | 447 | |
| 448 | + poll_wait(file, sk_sleep(sk), wait); | |
| 449 | + | |
| 447 | 450 | if (sk->sk_state == BT_LISTEN) |
| 448 | 451 | return bt_accept_poll(sk); |
| 449 | 452 | |
| @@ -475,7 +478,7 @@ __poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events) · 25 unmodified lines | ||
| 475 | 478 | |
| 476 | 479 | return mask; |
| 477 | 480 | } |
| 478 | −EXPORT_SYMBOL(bt_sock_poll_mask); | |
| 481 | +EXPORT_SYMBOL(bt_sock_poll); | |
| 479 | 482 | |
| 480 | 483 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) |
| 481 | 484 | { |
| @@ -1975,7 +1975,7 @@ static const struct proto_ops hci_sock_ops = { · 1974 unmodified lines | ||
| 1975 | 1975 | .sendmsg = hci_sock_sendmsg, |
| 1976 | 1976 | .recvmsg = hci_sock_recvmsg, |
| 1977 | 1977 | .ioctl = hci_sock_ioctl, |
| 1978 | − .poll_mask = datagram_poll_mask, | |
| 1978 | + .poll = datagram_poll, | |
| 1979 | 1979 | .listen = sock_no_listen, |
| 1980 | 1980 | .shutdown = sock_no_shutdown, |
| 1981 | 1981 | .setsockopt = hci_sock_setsockopt, |
| @@ -1653,7 +1653,7 @@ static const struct proto_ops l2cap_sock_ops = { · 1652 unmodified lines | ||
| 1653 | 1653 | .getname = l2cap_sock_getname, |
| 1654 | 1654 | .sendmsg = l2cap_sock_sendmsg, |
| 1655 | 1655 | .recvmsg = l2cap_sock_recvmsg, |
| 1656 | − .poll_mask = bt_sock_poll_mask, | |
| 1656 | + .poll = bt_sock_poll, | |
| 1657 | 1657 | .ioctl = bt_sock_ioctl, |
| 1658 | 1658 | .mmap = sock_no_mmap, |
| 1659 | 1659 | .socketpair = sock_no_socketpair, |
| @@ -1049,7 +1049,7 @@ static const struct proto_ops rfcomm_sock_ops = { · 1048 unmodified lines | ||
| 1049 | 1049 | .setsockopt = rfcomm_sock_setsockopt, |
| 1050 | 1050 | .getsockopt = rfcomm_sock_getsockopt, |
| 1051 | 1051 | .ioctl = rfcomm_sock_ioctl, |
| 1052 | − .poll_mask = bt_sock_poll_mask, | |
| 1052 | + .poll = bt_sock_poll, | |
| 1053 | 1053 | .socketpair = sock_no_socketpair, |
| 1054 | 1054 | .mmap = sock_no_mmap |
| 1055 | 1055 | }; |
| @@ -1197,7 +1197,7 @@ static const struct proto_ops sco_sock_ops = { · 1196 unmodified lines | ||
| 1197 | 1197 | .getname = sco_sock_getname, |
| 1198 | 1198 | .sendmsg = sco_sock_sendmsg, |
| 1199 | 1199 | .recvmsg = sco_sock_recvmsg, |
| 1200 | − .poll_mask = bt_sock_poll_mask, | |
| 1200 | + .poll = bt_sock_poll, | |
| 1201 | 1201 | .ioctl = bt_sock_ioctl, |
| 1202 | 1202 | .mmap = sock_no_mmap, |
| 1203 | 1203 | .socketpair = sock_no_socketpair, |
| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | menuconfig BPFILTER |
| 2 | 2 | bool "BPF based packet filtering framework (BPFILTER)" |
| 3 | − default n | |
| 4 | 3 | depends on NET && BPF && INET |
| 5 | 4 | help |
| 6 | 5 | This builds experimental bpfilter framework that is aiming to |
| @@ -9,6 +8,7 @@ menuconfig BPFILTER · 2 unmodified lines | ||
| 9 | 8 | if BPFILTER |
| 10 | 9 | config BPFILTER_UMH |
| 11 | 10 | tristate "bpfilter kernel module with user mode helper" |
| 11 | + depends on $(success,$(srctree)/scripts/cc-can-link.sh $(CC)) | |
| 12 | 12 | default m |
| 13 | 13 | help |
| 14 | 14 | This builds bpfilter kernel module with embedded user mode helper |
| @@ -15,20 +15,7 @@ ifeq ($(CONFIG_BPFILTER_UMH), y) · 14 unmodified lines | ||
| 15 | 15 | HOSTLDFLAGS += -static |
| 16 | 16 | endif |
| 17 | 17 | |
| 18 | −# a bit of elf magic to convert bpfilter_umh binary into a binary blob | |
| 19 | −# inside bpfilter_umh.o elf file referenced by | |
| 20 | −# _binary_net_bpfilter_bpfilter_umh_start symbol | |
| 21 | −# which bpfilter_kern.c passes further into umh blob loader at run-time | |
| 22 | −quiet_cmd_copy_umh = GEN $@ | |
| 23 | − cmd_copy_umh = echo ':' > $(obj)/.bpfilter_umh.o.cmd; \ | |
| 24 | − $(OBJCOPY) -I binary \ | |
| 25 | − `LC_ALL=C $(OBJDUMP) -f net/bpfilter/bpfilter_umh \ | |
| 26 | − |awk -F' |,' '/file format/{print "-O",$$NF} \ | |
| 27 | − /^architecture:/{print "-B",$$2}'` \ | |
| 28 | − --rename-section .data=.init.rodata $< $@ | |
| 29 | − | |
| 30 | −$(obj)/bpfilter_umh.o: $(obj)/bpfilter_umh | |
| 31 | − $(call cmd,copy_umh) | |
| 18 | +$(obj)/bpfilter_umh_blob.o: $(obj)/bpfilter_umh | |
| 32 | 19 | |
| 33 | 20 | obj-$(CONFIG_BPFILTER_UMH) += bpfilter.o |
| 34 | −bpfilter-objs += bpfilter_kern.o bpfilter_umh.o | |
| 21 | +bpfilter-objs += bpfilter_kern.o bpfilter_umh_blob.o | |
| @@ -10,11 +10,8 @@ · 9 unmodified lines | ||
| 10 | 10 | #include <linux/file.h> |
| 11 | 11 | #include "msgfmt.h" |
| 12 | 12 | |
| 13 | −#define UMH_start _binary_net_bpfilter_bpfilter_umh_start | |
| 14 | −#define UMH_end _binary_net_bpfilter_bpfilter_umh_end | |
| 15 | − | |
| 16 | −extern char UMH_start; | |
| 17 | −extern char UMH_end; | |
| 13 | +extern char bpfilter_umh_start; | |
| 14 | +extern char bpfilter_umh_end; | |
| 18 | 15 | |
| 19 | 16 | static struct umh_info info; |
| 20 | 17 | /* since ip_getsockopt() can run in parallel, serialize access to umh */ |
| @@ -93,7 +90,9 @@ static int __init load_umh(void) · 72 unmodified lines | ||
| 93 | 90 | int err; |
| 94 | 91 | |
| 95 | 92 | /* fork usermode process */ |
| 96 | − err = fork_usermode_blob(&UMH_start, &UMH_end - &UMH_start, &info); | |
| 93 | + err = fork_usermode_blob(&bpfilter_umh_start, | |
| 94 | + &bpfilter_umh_end - &bpfilter_umh_start, | |
| 95 | + &info); | |
| 97 | 96 | if (err) |
| 98 | 97 | return err; |
| 99 | 98 | pr_info("Loaded bpfilter_umh pid %d\n", info.pid); |
| @@ -0,0 +1,7 @@ | ||
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ | |
| 2 | + .section .init.rodata, "a" | |
| 3 | + .global bpfilter_umh_start | |
| 4 | +bpfilter_umh_start: | |
| 5 | + .incbin "net/bpfilter/bpfilter_umh" | |
| 6 | + .global bpfilter_umh_end | |
| 7 | +bpfilter_umh_end: | |
| @@ -934,11 +934,15 @@ static int caif_release(struct socket *sock) · 933 unmodified lines | ||
| 934 | 934 | } |
| 935 | 935 | |
| 936 | 936 | /* Copied from af_unix.c:unix_poll(), added CAIF tx_flow handling */ |
| 937 | −static __poll_t caif_poll_mask(struct socket *sock, __poll_t events) | |
| 937 | +static __poll_t caif_poll(struct file *file, | |
| 938 | + struct socket *sock, poll_table *wait) | |
| 938 | 939 | { |
| 939 | 940 | struct sock *sk = sock->sk; |
| 941 | + __poll_t mask; | |
| 940 | 942 | struct caifsock *cf_sk = container_of(sk, struct caifsock, sk); |
| 941 | − __poll_t mask = 0; | |
| 943 | + | |
| 944 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 945 | + mask = 0; | |
| 942 | 946 | |
| 943 | 947 | /* exceptional events? */ |
| 944 | 948 | if (sk->sk_err) |
| @@ -972,7 +976,7 @@ static const struct proto_ops caif_seqpacket_ops = { · 27 unmodified lines | ||
| 972 | 976 | .socketpair = sock_no_socketpair, |
| 973 | 977 | .accept = sock_no_accept, |
| 974 | 978 | .getname = sock_no_getname, |
| 975 | − .poll_mask = caif_poll_mask, | |
| 979 | + .poll = caif_poll, | |
| 976 | 980 | .ioctl = sock_no_ioctl, |
| 977 | 981 | .listen = sock_no_listen, |
| 978 | 982 | .shutdown = sock_no_shutdown, |
| @@ -993,7 +997,7 @@ static const struct proto_ops caif_stream_ops = { · 14 unmodified lines | ||
| 993 | 997 | .socketpair = sock_no_socketpair, |
| 994 | 998 | .accept = sock_no_accept, |
| 995 | 999 | .getname = sock_no_getname, |
| 996 | − .poll_mask = caif_poll_mask, | |
| 1000 | + .poll = caif_poll, | |
| 997 | 1001 | .ioctl = sock_no_ioctl, |
| 998 | 1002 | .listen = sock_no_listen, |
| 999 | 1003 | .shutdown = sock_no_shutdown, |
| @@ -1660,7 +1660,7 @@ static const struct proto_ops bcm_ops = { · 1659 unmodified lines | ||
| 1660 | 1660 | .socketpair = sock_no_socketpair, |
| 1661 | 1661 | .accept = sock_no_accept, |
| 1662 | 1662 | .getname = sock_no_getname, |
| 1663 | − .poll_mask = datagram_poll_mask, | |
| 1663 | + .poll = datagram_poll, | |
| 1664 | 1664 | .ioctl = can_ioctl, /* use can_ioctl() from af_can.c */ |
| 1665 | 1665 | .listen = sock_no_listen, |
| 1666 | 1666 | .shutdown = sock_no_shutdown, |
| @@ -843,7 +843,7 @@ static const struct proto_ops raw_ops = { · 842 unmodified lines | ||
| 843 | 843 | .socketpair = sock_no_socketpair, |
| 844 | 844 | .accept = sock_no_accept, |
| 845 | 845 | .getname = raw_getname, |
| 846 | − .poll_mask = datagram_poll_mask, | |
| 846 | + .poll = datagram_poll, | |
| 847 | 847 | .ioctl = can_ioctl, /* use can_ioctl() from af_can.c */ |
| 848 | 848 | .listen = sock_no_listen, |
| 849 | 849 | .shutdown = sock_no_shutdown, |
| @@ -819,8 +819,9 @@ EXPORT_SYMBOL(skb_copy_and_csum_datagram_msg); · 818 unmodified lines | ||
| 819 | 819 | |
| 820 | 820 | /** |
| 821 | 821 | * datagram_poll - generic datagram poll |
| 822 | + * @file: file struct | |
| 822 | 823 | * @sock: socket |
| 823 | − * @events to wait for | |
| 824 | + * @wait: poll table | |
| 824 | 825 | * |
| 825 | 826 | * Datagram poll: Again totally generic. This also handles |
| 826 | 827 | * sequenced packet sockets providing the socket receive queue |
| @@ -830,10 +831,14 @@ EXPORT_SYMBOL(skb_copy_and_csum_datagram_msg); · 3 unmodified lines | ||
| 830 | 831 | * and you use a different write policy from sock_writeable() |
| 831 | 832 | * then please supply your own write_space callback. |
| 832 | 833 | */ |
| 833 | −__poll_t datagram_poll_mask(struct socket *sock, __poll_t events) | |
| 834 | +__poll_t datagram_poll(struct file *file, struct socket *sock, | |
| 835 | + poll_table *wait) | |
| 834 | 836 | { |
| 835 | 837 | struct sock *sk = sock->sk; |
| 836 | − __poll_t mask = 0; | |
| 838 | + __poll_t mask; | |
| 839 | + | |
| 840 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 841 | + mask = 0; | |
| 837 | 842 | |
| 838 | 843 | /* exceptional events? */ |
| 839 | 844 | if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) |
| @@ -866,4 +871,4 @@ __poll_t datagram_poll_mask(struct socket *sock, __poll_t events) · 26 unmodified lines | ||
| 866 | 871 | |
| 867 | 872 | return mask; |
| 868 | 873 | } |
| 869 | −EXPORT_SYMBOL(datagram_poll_mask); | |
| 874 | +EXPORT_SYMBOL(datagram_poll); | |
| @@ -285,16 +285,9 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd) · 284 unmodified lines | ||
| 285 | 285 | if (ifr->ifr_qlen < 0) |
| 286 | 286 | return -EINVAL; |
| 287 | 287 | if (dev->tx_queue_len ^ ifr->ifr_qlen) { |
| 288 | − unsigned int orig_len = dev->tx_queue_len; | |
| 289 | − | |
| 290 | − dev->tx_queue_len = ifr->ifr_qlen; | |
| 291 | − err = call_netdevice_notifiers( | |
| 292 | − NETDEV_CHANGE_TX_QUEUE_LEN, dev); | |
| 293 | − err = notifier_to_errno(err); | |
| 294 | − if (err) { | |
| 295 | − dev->tx_queue_len = orig_len; | |
| 288 | + err = dev_change_tx_queue_len(dev, ifr->ifr_qlen); | |
| 289 | + if (err) | |
| 296 | 290 | return err; |
| 297 | − } | |
| 298 | 291 | } |
| 299 | 292 | return 0; |
| 300 | 293 | |
| @@ -416,6 +416,14 @@ static struct fib_rule *rule_find(struct fib_rules_ops *ops, · 415 unmodified lines | ||
| 416 | 416 | if (rule->mark && r->mark != rule->mark) |
| 417 | 417 | continue; |
| 418 | 418 | |
| 419 | + if (rule->suppress_ifgroup != -1 && | |
| 420 | + r->suppress_ifgroup != rule->suppress_ifgroup) | |
| 421 | + continue; | |
| 422 | + | |
| 423 | + if (rule->suppress_prefixlen != -1 && | |
| 424 | + r->suppress_prefixlen != rule->suppress_prefixlen) | |
| 425 | + continue; | |
| 426 | + | |
| 419 | 427 | if (rule->mark_mask && r->mark_mask != rule->mark_mask) |
| 420 | 428 | continue; |
| 421 | 429 | |
| @@ -436,6 +444,9 @@ static struct fib_rule *rule_find(struct fib_rules_ops *ops, · 14 unmodified lines | ||
| 436 | 444 | if (rule->ip_proto && r->ip_proto != rule->ip_proto) |
| 437 | 445 | continue; |
| 438 | 446 | |
| 447 | + if (rule->proto && r->proto != rule->proto) | |
| 448 | + continue; | |
| 449 | + | |
| 439 | 450 | if (fib_rule_port_range_set(&rule->sport_range) && |
| 440 | 451 | !fib_rule_port_range_compare(&r->sport_range, |
| 441 | 452 | &rule->sport_range)) |
| @@ -645,6 +656,73 @@ errout: · 203 unmodified lines | ||
| 645 | 656 | return err; |
| 646 | 657 | } |
| 647 | 658 | |
| 659 | +static int rule_exists(struct fib_rules_ops *ops, struct fib_rule_hdr *frh, | |
| 660 | + struct nlattr **tb, struct fib_rule *rule) | |
| 661 | +{ | |
| 662 | + struct fib_rule *r; | |
| 663 | + | |
| 664 | + list_for_each_entry(r, &ops->rules_list, list) { | |
| 665 | + if (r->action != rule->action) | |
| 666 | + continue; | |
| 667 | + | |
| 668 | + if (r->table != rule->table) | |
| 669 | + continue; | |
| 670 | + | |
| 671 | + if (r->pref != rule->pref) | |
| 672 | + continue; | |
| 673 | + | |
| 674 | + if (memcmp(r->iifname, rule->iifname, IFNAMSIZ)) | |
| 675 | + continue; | |
| 676 | + | |
| 677 | + if (memcmp(r->oifname, rule->oifname, IFNAMSIZ)) | |
| 678 | + continue; | |
| 679 | + | |
| 680 | + if (r->mark != rule->mark) | |
| 681 | + continue; | |
| 682 | + | |
| 683 | + if (r->suppress_ifgroup != rule->suppress_ifgroup) | |
| 684 | + continue; | |
| 685 | + | |
| 686 | + if (r->suppress_prefixlen != rule->suppress_prefixlen) | |
| 687 | + continue; | |
| 688 | + | |
| 689 | + if (r->mark_mask != rule->mark_mask) | |
| 690 | + continue; | |
| 691 | + | |
| 692 | + if (r->tun_id != rule->tun_id) | |
| 693 | + continue; | |
| 694 | + | |
| 695 | + if (r->fr_net != rule->fr_net) | |
| 696 | + continue; | |
| 697 | + | |
| 698 | + if (r->l3mdev != rule->l3mdev) | |
| 699 | + continue; | |
| 700 | + | |
| 701 | + if (!uid_eq(r->uid_range.start, rule->uid_range.start) || | |
| 702 | + !uid_eq(r->uid_range.end, rule->uid_range.end)) | |
| 703 | + continue; | |
| 704 | + | |
| 705 | + if (r->ip_proto != rule->ip_proto) | |
| 706 | + continue; | |
| 707 | + | |
| 708 | + if (r->proto != rule->proto) | |
| 709 | + continue; | |
| 710 | + | |
| 711 | + if (!fib_rule_port_range_compare(&r->sport_range, | |
| 712 | + &rule->sport_range)) | |
| 713 | + continue; | |
| 714 | + | |
| 715 | + if (!fib_rule_port_range_compare(&r->dport_range, | |
| 716 | + &rule->dport_range)) | |
| 717 | + continue; | |
| 718 | + | |
| 719 | + if (!ops->compare(r, frh, tb)) | |
| 720 | + continue; | |
| 721 | + return 1; | |
| 722 | + } | |
| 723 | + return 0; | |
| 724 | +} | |
| 725 | + | |
| 648 | 726 | int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, |
| 649 | 727 | struct netlink_ext_ack *extack) |
| 650 | 728 | { |
| @@ -679,7 +757,7 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, · 28 unmodified lines | ||
| 679 | 757 | goto errout; |
| 680 | 758 | |
| 681 | 759 | if ((nlh->nlmsg_flags & NLM_F_EXCL) && |
| 682 | − rule_find(ops, frh, tb, rule, user_priority)) { | |
| 760 | + rule_exists(ops, frh, tb, rule)) { | |
| 683 | 761 | err = -EEXIST; |
| 684 | 762 | goto errout_free; |
| 685 | 763 | } |
| @@ -4073,8 +4073,9 @@ static int bpf_fib_set_fwd_params(struct bpf_fib_lookup *params, · 4072 unmodified lines | ||
| 4073 | 4073 | memcpy(params->smac, dev->dev_addr, ETH_ALEN); |
| 4074 | 4074 | params->h_vlan_TCI = 0; |
| 4075 | 4075 | params->h_vlan_proto = 0; |
| 4076 | + params->ifindex = dev->ifindex; | |
| 4076 | 4077 | |
| 4077 | − return dev->ifindex; | |
| 4078 | + return 0; | |
| 4078 | 4079 | } |
| 4079 | 4080 | #endif |
| 4080 | 4081 | |
| @@ -4098,7 +4099,7 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 17 unmodified lines | ||
| 4098 | 4099 | /* verify forwarding is enabled on this interface */ |
| 4099 | 4100 | in_dev = __in_dev_get_rcu(dev); |
| 4100 | 4101 | if (unlikely(!in_dev || !IN_DEV_FORWARD(in_dev))) |
| 4101 | − return 0; | |
| 4102 | + return BPF_FIB_LKUP_RET_FWD_DISABLED; | |
| 4102 | 4103 | |
| 4103 | 4104 | if (flags & BPF_FIB_LOOKUP_OUTPUT) { |
| 4104 | 4105 | fl4.flowi4_iif = 1; |
| @@ -4123,7 +4124,7 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 18 unmodified lines | ||
| 4123 | 4124 | |
| 4124 | 4125 | tb = fib_get_table(net, tbid); |
| 4125 | 4126 | if (unlikely(!tb)) |
| 4126 | − return 0; | |
| 4127 | + return BPF_FIB_LKUP_RET_NOT_FWDED; | |
| 4127 | 4128 | |
| 4128 | 4129 | err = fib_table_lookup(tb, &fl4, &res, FIB_LOOKUP_NOREF); |
| 4129 | 4130 | } else { |
| @@ -4135,8 +4136,20 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 5 unmodified lines | ||
| 4135 | 4136 | err = fib_lookup(net, &fl4, &res, FIB_LOOKUP_NOREF); |
| 4136 | 4137 | } |
| 4137 | 4138 | |
| 4138 | − if (err || res.type != RTN_UNICAST) | |
| 4139 | − return 0; | |
| 4139 | + if (err) { | |
| 4140 | + /* map fib lookup errors to RTN_ type */ | |
| 4141 | + if (err == -EINVAL) | |
| 4142 | + return BPF_FIB_LKUP_RET_BLACKHOLE; | |
| 4143 | + if (err == -EHOSTUNREACH) | |
| 4144 | + return BPF_FIB_LKUP_RET_UNREACHABLE; | |
| 4145 | + if (err == -EACCES) | |
| 4146 | + return BPF_FIB_LKUP_RET_PROHIBIT; | |
| 4147 | + | |
| 4148 | + return BPF_FIB_LKUP_RET_NOT_FWDED; | |
| 4149 | + } | |
| 4150 | + | |
| 4151 | + if (res.type != RTN_UNICAST) | |
| 4152 | + return BPF_FIB_LKUP_RET_NOT_FWDED; | |
| 4140 | 4153 | |
| 4141 | 4154 | if (res.fi->fib_nhs > 1) |
| 4142 | 4155 | fib_select_path(net, &res, &fl4, NULL); |
| @@ -4144,19 +4157,16 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 1 unmodified line | ||
| 4144 | 4157 | if (check_mtu) { |
| 4145 | 4158 | mtu = ip_mtu_from_fib_result(&res, params->ipv4_dst); |
| 4146 | 4159 | if (params->tot_len > mtu) |
| 4147 | − return 0; | |
| 4160 | + return BPF_FIB_LKUP_RET_FRAG_NEEDED; | |
| 4148 | 4161 | } |
| 4149 | 4162 | |
| 4150 | 4163 | nh = &res.fi->fib_nh[res.nh_sel]; |
| 4151 | 4164 | |
| 4152 | 4165 | /* do not handle lwt encaps right now */ |
| 4153 | 4166 | if (nh->nh_lwtstate) |
| 4154 | − return 0; | |
| 4167 | + return BPF_FIB_LKUP_RET_UNSUPP_LWT; | |
| 4155 | 4168 | |
| 4156 | 4169 | dev = nh->nh_dev; |
| 4157 | − if (unlikely(!dev)) | |
| 4158 | − return 0; | |
| 4159 | − | |
| 4160 | 4170 | if (nh->nh_gw) |
| 4161 | 4171 | params->ipv4_dst = nh->nh_gw; |
| 4162 | 4172 | |
| @@ -4166,10 +4176,10 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 3 unmodified lines | ||
| 4166 | 4176 | * rcu_read_lock_bh is not needed here |
| 4167 | 4177 | */ |
| 4168 | 4178 | neigh = __ipv4_neigh_lookup_noref(dev, (__force u32)params->ipv4_dst); |
| 4169 | − if (neigh) | |
| 4170 | − return bpf_fib_set_fwd_params(params, neigh, dev); | |
| 4179 | + if (!neigh) | |
| 4180 | + return BPF_FIB_LKUP_RET_NO_NEIGH; | |
| 4171 | 4181 | |
| 4172 | − return 0; | |
| 4182 | + return bpf_fib_set_fwd_params(params, neigh, dev); | |
| 4173 | 4183 | } |
| 4174 | 4184 | #endif |
| 4175 | 4185 | |
| @@ -4190,7 +4200,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 14 unmodified lines | ||
| 4190 | 4200 | |
| 4191 | 4201 | /* link local addresses are never forwarded */ |
| 4192 | 4202 | if (rt6_need_strict(dst) || rt6_need_strict(src)) |
| 4193 | − return 0; | |
| 4203 | + return BPF_FIB_LKUP_RET_NOT_FWDED; | |
| 4194 | 4204 | |
| 4195 | 4205 | dev = dev_get_by_index_rcu(net, params->ifindex); |
| 4196 | 4206 | if (unlikely(!dev)) |
| @@ -4198,7 +4208,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 1 unmodified line | ||
| 4198 | 4208 | |
| 4199 | 4209 | idev = __in6_dev_get_safely(dev); |
| 4200 | 4210 | if (unlikely(!idev || !net->ipv6.devconf_all->forwarding)) |
| 4201 | − return 0; | |
| 4211 | + return BPF_FIB_LKUP_RET_FWD_DISABLED; | |
| 4202 | 4212 | |
| 4203 | 4213 | if (flags & BPF_FIB_LOOKUP_OUTPUT) { |
| 4204 | 4214 | fl6.flowi6_iif = 1; |
| @@ -4225,7 +4235,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 20 unmodified lines | ||
| 4225 | 4235 | |
| 4226 | 4236 | tb = ipv6_stub->fib6_get_table(net, tbid); |
| 4227 | 4237 | if (unlikely(!tb)) |
| 4228 | − return 0; | |
| 4238 | + return BPF_FIB_LKUP_RET_NOT_FWDED; | |
| 4229 | 4239 | |
| 4230 | 4240 | f6i = ipv6_stub->fib6_table_lookup(net, tb, oif, &fl6, strict); |
| 4231 | 4241 | } else { |
| @@ -4238,11 +4248,23 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 6 unmodified lines | ||
| 4238 | 4248 | } |
| 4239 | 4249 | |
| 4240 | 4250 | if (unlikely(IS_ERR_OR_NULL(f6i) || f6i == net->ipv6.fib6_null_entry)) |
| 4241 | − return 0; | |
| 4251 | + return BPF_FIB_LKUP_RET_NOT_FWDED; | |
| 4252 | + | |
| 4253 | + if (unlikely(f6i->fib6_flags & RTF_REJECT)) { | |
| 4254 | + switch (f6i->fib6_type) { | |
| 4255 | + case RTN_BLACKHOLE: | |
| 4256 | + return BPF_FIB_LKUP_RET_BLACKHOLE; | |
| 4257 | + case RTN_UNREACHABLE: | |
| 4258 | + return BPF_FIB_LKUP_RET_UNREACHABLE; | |
| 4259 | + case RTN_PROHIBIT: | |
| 4260 | + return BPF_FIB_LKUP_RET_PROHIBIT; | |
| 4261 | + default: | |
| 4262 | + return BPF_FIB_LKUP_RET_NOT_FWDED; | |
| 4263 | + } | |
| 4264 | + } | |
| 4242 | 4265 | |
| 4243 | − if (unlikely(f6i->fib6_flags & RTF_REJECT || | |
| 4244 | − f6i->fib6_type != RTN_UNICAST)) | |
| 4245 | − return 0; | |
| 4266 | + if (f6i->fib6_type != RTN_UNICAST) | |
| 4267 | + return BPF_FIB_LKUP_RET_NOT_FWDED; | |
| 4246 | 4268 | |
| 4247 | 4269 | if (f6i->fib6_nsiblings && fl6.flowi6_oif == 0) |
| 4248 | 4270 | f6i = ipv6_stub->fib6_multipath_select(net, f6i, &fl6, |
| @@ -4252,11 +4274,11 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 3 unmodified lines | ||
| 4252 | 4274 | if (check_mtu) { |
| 4253 | 4275 | mtu = ipv6_stub->ip6_mtu_from_fib6(f6i, dst, src); |
| 4254 | 4276 | if (params->tot_len > mtu) |
| 4255 | − return 0; | |
| 4277 | + return BPF_FIB_LKUP_RET_FRAG_NEEDED; | |
| 4256 | 4278 | } |
| 4257 | 4279 | |
| 4258 | 4280 | if (f6i->fib6_nh.nh_lwtstate) |
| 4259 | − return 0; | |
| 4281 | + return BPF_FIB_LKUP_RET_UNSUPP_LWT; | |
| 4260 | 4282 | |
| 4261 | 4283 | if (f6i->fib6_flags & RTF_GATEWAY) |
| 4262 | 4284 | *dst = f6i->fib6_nh.nh_gw; |
| @@ -4270,10 +4292,10 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 7 unmodified lines | ||
| 4270 | 4292 | */ |
| 4271 | 4293 | neigh = ___neigh_lookup_noref(ipv6_stub->nd_tbl, neigh_key_eq128, |
| 4272 | 4294 | ndisc_hashfn, dst, dev); |
| 4273 | − if (neigh) | |
| 4274 | − return bpf_fib_set_fwd_params(params, neigh, dev); | |
| 4295 | + if (!neigh) | |
| 4296 | + return BPF_FIB_LKUP_RET_NO_NEIGH; | |
| 4275 | 4297 | |
| 4276 | − return 0; | |
| 4298 | + return bpf_fib_set_fwd_params(params, neigh, dev); | |
| 4277 | 4299 | } |
| 4278 | 4300 | #endif |
| 4279 | 4301 | |
| @@ -4315,7 +4337,7 @@ BPF_CALL_4(bpf_skb_fib_lookup, struct sk_buff *, skb, · 35 unmodified lines | ||
| 4315 | 4337 | struct bpf_fib_lookup *, params, int, plen, u32, flags) |
| 4316 | 4338 | { |
| 4317 | 4339 | struct net *net = dev_net(skb->dev); |
| 4318 | − int index = -EAFNOSUPPORT; | |
| 4340 | + int rc = -EAFNOSUPPORT; | |
| 4319 | 4341 | |
| 4320 | 4342 | if (plen < sizeof(*params)) |
| 4321 | 4343 | return -EINVAL; |
| @@ -4326,25 +4348,25 @@ BPF_CALL_4(bpf_skb_fib_lookup, struct sk_buff *, skb, · 4 unmodified lines | ||
| 4326 | 4348 | switch (params->family) { |
| 4327 | 4349 | #if IS_ENABLED(CONFIG_INET) |
| 4328 | 4350 | case AF_INET: |
| 4329 | − index = bpf_ipv4_fib_lookup(net, params, flags, false); | |
| 4351 | + rc = bpf_ipv4_fib_lookup(net, params, flags, false); | |
| 4330 | 4352 | break; |
| 4331 | 4353 | #endif |
| 4332 | 4354 | #if IS_ENABLED(CONFIG_IPV6) |
| 4333 | 4355 | case AF_INET6: |
| 4334 | − index = bpf_ipv6_fib_lookup(net, params, flags, false); | |
| 4356 | + rc = bpf_ipv6_fib_lookup(net, params, flags, false); | |
| 4335 | 4357 | break; |
| 4336 | 4358 | #endif |
| 4337 | 4359 | } |
| 4338 | 4360 | |
| 4339 | − if (index > 0) { | |
| 4361 | + if (!rc) { | |
| 4340 | 4362 | struct net_device *dev; |
| 4341 | 4363 | |
| 4342 | − dev = dev_get_by_index_rcu(net, index); | |
| 4364 | + dev = dev_get_by_index_rcu(net, params->ifindex); | |
| 4343 | 4365 | if (!is_skb_forwardable(dev, skb)) |
| 4344 | − index = 0; | |
| 4366 | + rc = BPF_FIB_LKUP_RET_FRAG_NEEDED; | |
| 4345 | 4367 | } |
| 4346 | 4368 | |
| 4347 | − return index; | |
| 4369 | + return rc; | |
| 4348 | 4370 | } |
| 4349 | 4371 | |
| 4350 | 4372 | static const struct bpf_func_proto bpf_skb_fib_lookup_proto = { |
| @@ -5275,8 +5275,7 @@ struct sk_buff *alloc_skb_with_frags(unsigned long header_len, · 5274 unmodified lines | ||
| 5275 | 5275 | if (npages >= 1 << order) { |
| 5276 | 5276 | page = alloc_pages((gfp_mask & ~__GFP_DIRECT_RECLAIM) | |
| 5277 | 5277 | __GFP_COMP | |
| 5278 | − __GFP_NOWARN | | |
| 5279 | − __GFP_NORETRY, | |
| 5278 | + __GFP_NOWARN, | |
| 5280 | 5279 | order); |
| 5281 | 5280 | if (page) |
| 5282 | 5281 | goto fill_page; |
| @@ -3247,7 +3247,8 @@ static int req_prot_init(const struct proto *prot) · 3246 unmodified lines | ||
| 3247 | 3247 | |
| 3248 | 3248 | rsk_prot->slab = kmem_cache_create(rsk_prot->slab_name, |
| 3249 | 3249 | rsk_prot->obj_size, 0, |
| 3250 | − prot->slab_flags, NULL); | |
| 3250 | + SLAB_ACCOUNT | prot->slab_flags, | |
| 3251 | + NULL); | |
| 3251 | 3252 | |
| 3252 | 3253 | if (!rsk_prot->slab) { |
| 3253 | 3254 | pr_crit("%s: Can't create request sock SLAB cache!\n", |
| @@ -3262,7 +3263,8 @@ int proto_register(struct proto *prot, int alloc_slab) · 8 unmodified lines | ||
| 3262 | 3263 | if (alloc_slab) { |
| 3263 | 3264 | prot->slab = kmem_cache_create_usercopy(prot->name, |
| 3264 | 3265 | prot->obj_size, 0, |
| 3265 | − SLAB_HWCACHE_ALIGN | prot->slab_flags, | |
| 3266 | + SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT | | |
| 3267 | + prot->slab_flags, | |
| 3266 | 3268 | prot->useroffset, prot->usersize, |
| 3267 | 3269 | NULL); |
| 3268 | 3270 | |
| @@ -3285,6 +3287,7 @@ int proto_register(struct proto *prot, int alloc_slab) · 16 unmodified lines | ||
| 3285 | 3287 | kmem_cache_create(prot->twsk_prot->twsk_slab_name, |
| 3286 | 3288 | prot->twsk_prot->twsk_obj_size, |
| 3287 | 3289 | 0, |
| 3290 | + SLAB_ACCOUNT | | |
| 3288 | 3291 | prot->slab_flags, |
| 3289 | 3292 | NULL); |
| 3290 | 3293 | if (prot->twsk_prot->twsk_slab == NULL) |
| @@ -316,7 +316,8 @@ int dccp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, · 315 unmodified lines | ||
| 316 | 316 | int flags, int *addr_len); |
| 317 | 317 | void dccp_shutdown(struct sock *sk, int how); |
| 318 | 318 | int inet_dccp_listen(struct socket *sock, int backlog); |
| 319 | −__poll_t dccp_poll_mask(struct socket *sock, __poll_t events); | |
| 319 | +__poll_t dccp_poll(struct file *file, struct socket *sock, | |
| 320 | + poll_table *wait); | |
| 320 | 321 | int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); |
| 321 | 322 | void dccp_req_err(struct sock *sk, u64 seq); |
| 322 | 323 | |
| @@ -984,7 +984,7 @@ static const struct proto_ops inet_dccp_ops = { · 983 unmodified lines | ||
| 984 | 984 | .accept = inet_accept, |
| 985 | 985 | .getname = inet_getname, |
| 986 | 986 | /* FIXME: work on tcp_poll to rename it to inet_csk_poll */ |
| 987 | − .poll_mask = dccp_poll_mask, | |
| 987 | + .poll = dccp_poll, | |
| 988 | 988 | .ioctl = inet_ioctl, |
| 989 | 989 | /* FIXME: work on inet_listen to rename it to sock_common_listen */ |
| 990 | 990 | .listen = inet_dccp_listen, |
| @@ -1070,7 +1070,7 @@ static const struct proto_ops inet6_dccp_ops = { · 1069 unmodified lines | ||
| 1070 | 1070 | .socketpair = sock_no_socketpair, |
| 1071 | 1071 | .accept = inet_accept, |
| 1072 | 1072 | .getname = inet6_getname, |
| 1073 | − .poll_mask = dccp_poll_mask, | |
| 1073 | + .poll = dccp_poll, | |
| 1074 | 1074 | .ioctl = inet6_ioctl, |
| 1075 | 1075 | .listen = inet_dccp_listen, |
| 1076 | 1076 | .shutdown = inet_shutdown, |
| @@ -312,11 +312,20 @@ int dccp_disconnect(struct sock *sk, int flags) · 311 unmodified lines | ||
| 312 | 312 | |
| 313 | 313 | EXPORT_SYMBOL_GPL(dccp_disconnect); |
| 314 | 314 | |
| 315 | −__poll_t dccp_poll_mask(struct socket *sock, __poll_t events) | |
| 315 | +/* | |
| 316 | + * Wait for a DCCP event. | |
| 317 | + * | |
| 318 | + * Note that we don't need to lock the socket, as the upper poll layers | |
| 319 | + * take care of normal races (between the test and the event) and we don't | |
| 320 | + * go look at any of the socket buffers directly. | |
| 321 | + */ | |
| 322 | +__poll_t dccp_poll(struct file *file, struct socket *sock, | |
| 323 | + poll_table *wait) | |
| 316 | 324 | { |
| 317 | 325 | __poll_t mask; |
| 318 | 326 | struct sock *sk = sock->sk; |
| 319 | 327 | |
| 328 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 320 | 329 | if (sk->sk_state == DCCP_LISTEN) |
| 321 | 330 | return inet_csk_listen_poll(sk); |
| 322 | 331 | |
| @@ -358,7 +367,7 @@ __poll_t dccp_poll_mask(struct socket *sock, __poll_t events) · 35 unmodified lines | ||
| 358 | 367 | return mask; |
| 359 | 368 | } |
| 360 | 369 | |
| 361 | −EXPORT_SYMBOL_GPL(dccp_poll_mask); | |
| 370 | +EXPORT_SYMBOL_GPL(dccp_poll); | |
| 362 | 371 | |
| 363 | 372 | int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg) |
| 364 | 373 | { |
| @@ -1207,11 +1207,11 @@ static int dn_getname(struct socket *sock, struct sockaddr *uaddr,int peer) · 1206 unmodified lines | ||
| 1207 | 1207 | } |
| 1208 | 1208 | |
| 1209 | 1209 | |
| 1210 | −static __poll_t dn_poll_mask(struct socket *sock, __poll_t events) | |
| 1210 | +static __poll_t dn_poll(struct file *file, struct socket *sock, poll_table *wait) | |
| 1211 | 1211 | { |
| 1212 | 1212 | struct sock *sk = sock->sk; |
| 1213 | 1213 | struct dn_scp *scp = DN_SK(sk); |
| 1214 | − __poll_t mask = datagram_poll_mask(sock, events); | |
| 1214 | + __poll_t mask = datagram_poll(file, sock, wait); | |
| 1215 | 1215 | |
| 1216 | 1216 | if (!skb_queue_empty(&scp->other_receive_queue)) |
| 1217 | 1217 | mask |= EPOLLRDBAND; |
| @@ -2331,7 +2331,7 @@ static const struct proto_ops dn_proto_ops = { · 1113 unmodified lines | ||
| 2331 | 2331 | .socketpair = sock_no_socketpair, |
| 2332 | 2332 | .accept = dn_accept, |
| 2333 | 2333 | .getname = dn_getname, |
| 2334 | − .poll_mask = dn_poll_mask, | |
| 2334 | + .poll = dn_poll, | |
| 2335 | 2335 | .ioctl = dn_ioctl, |
| 2336 | 2336 | .listen = dn_listen, |
| 2337 | 2337 | .shutdown = dn_shutdown, |
| @@ -423,7 +423,7 @@ static const struct proto_ops ieee802154_raw_ops = { · 422 unmodified lines | ||
| 423 | 423 | .socketpair = sock_no_socketpair, |
| 424 | 424 | .accept = sock_no_accept, |
| 425 | 425 | .getname = sock_no_getname, |
| 426 | − .poll_mask = datagram_poll_mask, | |
| 426 | + .poll = datagram_poll, | |
| 427 | 427 | .ioctl = ieee802154_sock_ioctl, |
| 428 | 428 | .listen = sock_no_listen, |
| 429 | 429 | .shutdown = sock_no_shutdown, |
| @@ -969,7 +969,7 @@ static const struct proto_ops ieee802154_dgram_ops = { · 539 unmodified lines | ||
| 969 | 969 | .socketpair = sock_no_socketpair, |
| 970 | 970 | .accept = sock_no_accept, |
| 971 | 971 | .getname = sock_no_getname, |
| 972 | − .poll_mask = datagram_poll_mask, | |
| 972 | + .poll = datagram_poll, | |
| 973 | 973 | .ioctl = ieee802154_sock_ioctl, |
| 974 | 974 | .listen = sock_no_listen, |
| 975 | 975 | .shutdown = sock_no_shutdown, |
| @@ -986,7 +986,7 @@ const struct proto_ops inet_stream_ops = { · 985 unmodified lines | ||
| 986 | 986 | .socketpair = sock_no_socketpair, |
| 987 | 987 | .accept = inet_accept, |
| 988 | 988 | .getname = inet_getname, |
| 989 | − .poll_mask = tcp_poll_mask, | |
| 989 | + .poll = tcp_poll, | |
| 990 | 990 | .ioctl = inet_ioctl, |
| 991 | 991 | .listen = inet_listen, |
| 992 | 992 | .shutdown = inet_shutdown, |
| @@ -1021,7 +1021,7 @@ const struct proto_ops inet_dgram_ops = { · 28 unmodified lines | ||
| 1021 | 1021 | .socketpair = sock_no_socketpair, |
| 1022 | 1022 | .accept = sock_no_accept, |
| 1023 | 1023 | .getname = inet_getname, |
| 1024 | − .poll_mask = udp_poll_mask, | |
| 1024 | + .poll = udp_poll, | |
| 1025 | 1025 | .ioctl = inet_ioctl, |
| 1026 | 1026 | .listen = sock_no_listen, |
| 1027 | 1027 | .shutdown = inet_shutdown, |
| @@ -1042,7 +1042,7 @@ EXPORT_SYMBOL(inet_dgram_ops); · 14 unmodified lines | ||
| 1042 | 1042 | |
| 1043 | 1043 | /* |
| 1044 | 1044 | * For SOCK_RAW sockets; should be the same as inet_dgram_ops but without |
| 1045 | − * udp_poll_mask | |
| 1045 | + * udp_poll | |
| 1046 | 1046 | */ |
| 1047 | 1047 | static const struct proto_ops inet_sockraw_ops = { |
| 1048 | 1048 | .family = PF_INET, |
| @@ -1053,7 +1053,7 @@ static const struct proto_ops inet_sockraw_ops = { · 4 unmodified lines | ||
| 1053 | 1053 | .socketpair = sock_no_socketpair, |
| 1054 | 1054 | .accept = sock_no_accept, |
| 1055 | 1055 | .getname = inet_getname, |
| 1056 | − .poll_mask = datagram_poll_mask, | |
| 1056 | + .poll = datagram_poll, | |
| 1057 | 1057 | .ioctl = inet_ioctl, |
| 1058 | 1058 | .listen = sock_no_listen, |
| 1059 | 1059 | .shutdown = inet_shutdown, |
| @@ -448,9 +448,7 @@ next_proto: · 447 unmodified lines | ||
| 448 | 448 | out_unlock: |
| 449 | 449 | rcu_read_unlock(); |
| 450 | 450 | out: |
| 451 | − NAPI_GRO_CB(skb)->flush |= flush; | |
| 452 | − skb_gro_remcsum_cleanup(skb, &grc); | |
| 453 | − skb->remcsum_offload = 0; | |
| 451 | + skb_gro_flush_final_remcsum(skb, pp, flush, &grc); | |
| 454 | 452 | |
| 455 | 453 | return pp; |
| 456 | 454 | } |
| @@ -223,7 +223,7 @@ static struct sk_buff *gre_gro_receive(struct list_head *head, · 222 unmodified lines | ||
| 223 | 223 | out_unlock: |
| 224 | 224 | rcu_read_unlock(); |
| 225 | 225 | out: |
| 226 | − NAPI_GRO_CB(skb)->flush |= flush; | |
| 226 | + skb_gro_flush_final(skb, pp, flush); | |
| 227 | 227 | |
| 228 | 228 | return pp; |
| 229 | 229 | } |
| @@ -265,8 +265,9 @@ static int proc_tcp_fastopen_key(struct ctl_table *table, int write, · 264 unmodified lines | ||
| 265 | 265 | ipv4.sysctl_tcp_fastopen); |
| 266 | 266 | struct ctl_table tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH * 2 + 10) }; |
| 267 | 267 | struct tcp_fastopen_context *ctxt; |
| 268 | − int ret; | |
| 269 | 268 | u32 user_key[4]; /* 16 bytes, matching TCP_FASTOPEN_KEY_LENGTH */ |
| 269 | + __le32 key[4]; | |
| 270 | + int ret, i; | |
| 270 | 271 | |
| 271 | 272 | tbl.data = kmalloc(tbl.maxlen, GFP_KERNEL); |
| 272 | 273 | if (!tbl.data) |
| @@ -275,11 +276,14 @@ static int proc_tcp_fastopen_key(struct ctl_table *table, int write, · 2 unmodified lines | ||
| 275 | 276 | rcu_read_lock(); |
| 276 | 277 | ctxt = rcu_dereference(net->ipv4.tcp_fastopen_ctx); |
| 277 | 278 | if (ctxt) |
| 278 | − memcpy(user_key, ctxt->key, TCP_FASTOPEN_KEY_LENGTH); | |
| 279 | + memcpy(key, ctxt->key, TCP_FASTOPEN_KEY_LENGTH); | |
| 279 | 280 | else |
| 280 | − memset(user_key, 0, sizeof(user_key)); | |
| 281 | + memset(key, 0, sizeof(key)); | |
| 281 | 282 | rcu_read_unlock(); |
| 282 | 283 | |
| 284 | + for (i = 0; i < ARRAY_SIZE(key); i++) | |
| 285 | + user_key[i] = le32_to_cpu(key[i]); | |
| 286 | + | |
| 283 | 287 | snprintf(tbl.data, tbl.maxlen, "%08x-%08x-%08x-%08x", |
| 284 | 288 | user_key[0], user_key[1], user_key[2], user_key[3]); |
| 285 | 289 | ret = proc_dostring(&tbl, write, buffer, lenp, ppos); |
| @@ -290,13 +294,17 @@ static int proc_tcp_fastopen_key(struct ctl_table *table, int write, · 4 unmodified lines | ||
| 290 | 294 | ret = -EINVAL; |
| 291 | 295 | goto bad_key; |
| 292 | 296 | } |
| 293 | − tcp_fastopen_reset_cipher(net, NULL, user_key, | |
| 297 | + | |
| 298 | + for (i = 0; i < ARRAY_SIZE(user_key); i++) | |
| 299 | + key[i] = cpu_to_le32(user_key[i]); | |
| 300 | + | |
| 301 | + tcp_fastopen_reset_cipher(net, NULL, key, | |
| 294 | 302 | TCP_FASTOPEN_KEY_LENGTH); |
| 295 | 303 | } |
| 296 | 304 | |
| 297 | 305 | bad_key: |
| 298 | 306 | pr_debug("proc FO key set 0x%x-%x-%x-%x <- 0x%s: %u\n", |
| 299 | − user_key[0], user_key[1], user_key[2], user_key[3], | |
| 307 | + user_key[0], user_key[1], user_key[2], user_key[3], | |
| 300 | 308 | (char *)tbl.data, ret); |
| 301 | 309 | kfree(tbl.data); |
| 302 | 310 | return ret; |
| @@ -494,21 +494,32 @@ static inline bool tcp_stream_is_readable(const struct tcp_sock *tp, · 493 unmodified lines | ||
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | /* |
| 497 | − * Socket is not locked. We are protected from async events by poll logic and | |
| 498 | − * correct handling of state changes made by other threads is impossible in | |
| 499 | − * any case. | |
| 497 | + * Wait for a TCP event. | |
| 498 | + * | |
| 499 | + * Note that we don't need to lock the socket, as the upper poll layers | |
| 500 | + * take care of normal races (between the test and the event) and we don't | |
| 501 | + * go look at any of the socket buffers directly. | |
| 500 | 502 | */ |
| 501 | −__poll_t tcp_poll_mask(struct socket *sock, __poll_t events) | |
| 503 | +__poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait) | |
| 502 | 504 | { |
| 505 | + __poll_t mask; | |
| 503 | 506 | struct sock *sk = sock->sk; |
| 504 | 507 | const struct tcp_sock *tp = tcp_sk(sk); |
| 505 | − __poll_t mask = 0; | |
| 506 | 508 | int state; |
| 507 | 509 | |
| 510 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 511 | + | |
| 508 | 512 | state = inet_sk_state_load(sk); |
| 509 | 513 | if (state == TCP_LISTEN) |
| 510 | 514 | return inet_csk_listen_poll(sk); |
| 511 | 515 | |
| 516 | + /* Socket is not locked. We are protected from async events | |
| 517 | + * by poll logic and correct handling of state changes | |
| 518 | + * made by other threads is impossible in any case. | |
| 519 | + */ | |
| 520 | + | |
| 521 | + mask = 0; | |
| 522 | + | |
| 512 | 523 | /* |
| 513 | 524 | * EPOLLHUP is certainly not done right. But poll() doesn't |
| 514 | 525 | * have a notion of HUP in just one direction, and for a |
| @@ -589,7 +600,7 @@ __poll_t tcp_poll_mask(struct socket *sock, __poll_t events) · 74 unmodified lines | ||
| 589 | 600 | |
| 590 | 601 | return mask; |
| 591 | 602 | } |
| 592 | −EXPORT_SYMBOL(tcp_poll_mask); | |
| 603 | +EXPORT_SYMBOL(tcp_poll); | |
| 593 | 604 | |
| 594 | 605 | int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg) |
| 595 | 606 | { |
| @@ -266,7 +266,7 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) · 265 unmodified lines | ||
| 266 | 266 | * it is probably a retransmit. |
| 267 | 267 | */ |
| 268 | 268 | if (tp->ecn_flags & TCP_ECN_SEEN) |
| 269 | − tcp_enter_quickack_mode(sk, 1); | |
| 269 | + tcp_enter_quickack_mode(sk, 2); | |
| 270 | 270 | break; |
| 271 | 271 | case INET_ECN_CE: |
| 272 | 272 | if (tcp_ca_needs_ecn(sk)) |
| @@ -274,7 +274,7 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) · 1 unmodified line | ||
| 274 | 274 | |
| 275 | 275 | if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) { |
| 276 | 276 | /* Better not delay acks, sender can have a very low cwnd */ |
| 277 | − tcp_enter_quickack_mode(sk, 1); | |
| 277 | + tcp_enter_quickack_mode(sk, 2); | |
| 278 | 278 | tp->ecn_flags |= TCP_ECN_DEMAND_CWR; |
| 279 | 279 | } |
| 280 | 280 | tp->ecn_flags |= TCP_ECN_SEEN; |
| @@ -3185,6 +3185,15 @@ static int tcp_clean_rtx_queue(struct sock *sk, u32 prior_fack, · 2904 unmodified lines | ||
| 3185 | 3185 | |
| 3186 | 3186 | if (tcp_is_reno(tp)) { |
| 3187 | 3187 | tcp_remove_reno_sacks(sk, pkts_acked); |
| 3188 | + | |
| 3189 | + /* If any of the cumulatively ACKed segments was | |
| 3190 | + * retransmitted, non-SACK case cannot confirm that | |
| 3191 | + * progress was due to original transmission due to | |
| 3192 | + * lack of TCPCB_SACKED_ACKED bits even if some of | |
| 3193 | + * the packets may have been never retransmitted. | |
| 3194 | + */ | |
| 3195 | + if (flag & FLAG_RETRANS_DATA_ACKED) | |
| 3196 | + flag &= ~FLAG_ORIG_SACK_ACKED; | |
| 3188 | 3197 | } else { |
| 3189 | 3198 | int delta; |
| 3190 | 3199 | |
| @@ -2591,7 +2591,7 @@ int compat_udp_getsockopt(struct sock *sk, int level, int optname, · 2590 unmodified lines | ||
| 2591 | 2591 | * udp_poll - wait for a UDP event. |
| 2592 | 2592 | * @file - file struct |
| 2593 | 2593 | * @sock - socket |
| 2594 | − * @events - events to wait for | |
| 2594 | + * @wait - poll table | |
| 2595 | 2595 | * |
| 2596 | 2596 | * This is same as datagram poll, except for the special case of |
| 2597 | 2597 | * blocking sockets. If application is using a blocking fd |
| @@ -2600,23 +2600,23 @@ int compat_udp_getsockopt(struct sock *sk, int level, int optname, · 2 unmodified lines | ||
| 2600 | 2600 | * but then block when reading it. Add special case code |
| 2601 | 2601 | * to work around these arguably broken applications. |
| 2602 | 2602 | */ |
| 2603 | −__poll_t udp_poll_mask(struct socket *sock, __poll_t events) | |
| 2603 | +__poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait) | |
| 2604 | 2604 | { |
| 2605 | − __poll_t mask = datagram_poll_mask(sock, events); | |
| 2605 | + __poll_t mask = datagram_poll(file, sock, wait); | |
| 2606 | 2606 | struct sock *sk = sock->sk; |
| 2607 | 2607 | |
| 2608 | 2608 | if (!skb_queue_empty(&udp_sk(sk)->reader_queue)) |
| 2609 | 2609 | mask |= EPOLLIN | EPOLLRDNORM; |
| 2610 | 2610 | |
| 2611 | 2611 | /* Check for false positives due to checksum errors */ |
| 2612 | − if ((mask & EPOLLRDNORM) && !(sock->file->f_flags & O_NONBLOCK) && | |
| 2612 | + if ((mask & EPOLLRDNORM) && !(file->f_flags & O_NONBLOCK) && | |
| 2613 | 2613 | !(sk->sk_shutdown & RCV_SHUTDOWN) && first_packet_length(sk) == -1) |
| 2614 | 2614 | mask &= ~(EPOLLIN | EPOLLRDNORM); |
| 2615 | 2615 | |
| 2616 | 2616 | return mask; |
| 2617 | 2617 | |
| 2618 | 2618 | } |
| 2619 | −EXPORT_SYMBOL(udp_poll_mask); | |
| 2619 | +EXPORT_SYMBOL(udp_poll); | |
| 2620 | 2620 | |
| 2621 | 2621 | int udp_abort(struct sock *sk, int err) |
| 2622 | 2622 | { |
| @@ -395,7 +395,7 @@ unflush: · 394 unmodified lines | ||
| 395 | 395 | out_unlock: |
| 396 | 396 | rcu_read_unlock(); |
| 397 | 397 | out: |
| 398 | − NAPI_GRO_CB(skb)->flush |= flush; | |
| 398 | + skb_gro_flush_final(skb, pp, flush); | |
| 399 | 399 | return pp; |
| 400 | 400 | } |
| 401 | 401 | EXPORT_SYMBOL(udp_gro_receive); |
| @@ -4528,6 +4528,7 @@ static int modify_prefix_route(struct inet6_ifaddr *ifp, · 4527 unmodified lines | ||
| 4528 | 4528 | unsigned long expires, u32 flags) |
| 4529 | 4529 | { |
| 4530 | 4530 | struct fib6_info *f6i; |
| 4531 | + u32 prio; | |
| 4531 | 4532 | |
| 4532 | 4533 | f6i = addrconf_get_prefix_route(&ifp->addr, |
| 4533 | 4534 | ifp->prefix_len, |
| @@ -4536,13 +4537,15 @@ static int modify_prefix_route(struct inet6_ifaddr *ifp, · 2 unmodified lines | ||
| 4536 | 4537 | if (!f6i) |
| 4537 | 4538 | return -ENOENT; |
| 4538 | 4539 | |
| 4539 | − if (f6i->fib6_metric != ifp->rt_priority) { | |
| 4540 | + prio = ifp->rt_priority ? : IP6_RT_PRIO_ADDRCONF; | |
| 4541 | + if (f6i->fib6_metric != prio) { | |
| 4542 | + /* delete old one */ | |
| 4543 | + ip6_del_rt(dev_net(ifp->idev->dev), f6i); | |
| 4544 | + | |
| 4540 | 4545 | /* add new one */ |
| 4541 | 4546 | addrconf_prefix_route(&ifp->addr, ifp->prefix_len, |
| 4542 | 4547 | ifp->rt_priority, ifp->idev->dev, |
| 4543 | 4548 | expires, flags, GFP_KERNEL); |
| 4544 | − /* delete old one */ | |
| 4545 | − ip6_del_rt(dev_net(ifp->idev->dev), f6i); | |
| 4546 | 4549 | } else { |
| 4547 | 4550 | if (!expires) |
| 4548 | 4551 | fib6_clean_expires(f6i); |
| @@ -570,7 +570,7 @@ const struct proto_ops inet6_stream_ops = { · 569 unmodified lines | ||
| 570 | 570 | .socketpair = sock_no_socketpair, /* a do nothing */ |
| 571 | 571 | .accept = inet_accept, /* ok */ |
| 572 | 572 | .getname = inet6_getname, |
| 573 | − .poll_mask = tcp_poll_mask, /* ok */ | |
| 573 | + .poll = tcp_poll, /* ok */ | |
| 574 | 574 | .ioctl = inet6_ioctl, /* must change */ |
| 575 | 575 | .listen = inet_listen, /* ok */ |
| 576 | 576 | .shutdown = inet_shutdown, /* ok */ |
| @@ -603,7 +603,7 @@ const struct proto_ops inet6_dgram_ops = { · 26 unmodified lines | ||
| 603 | 603 | .socketpair = sock_no_socketpair, /* a do nothing */ |
| 604 | 604 | .accept = sock_no_accept, /* a do nothing */ |
| 605 | 605 | .getname = inet6_getname, |
| 606 | − .poll_mask = udp_poll_mask, /* ok */ | |
| 606 | + .poll = udp_poll, /* ok */ | |
| 607 | 607 | .ioctl = inet6_ioctl, /* must change */ |
| 608 | 608 | .listen = sock_no_listen, /* ok */ |
| 609 | 609 | .shutdown = inet_shutdown, /* ok */ |
| @@ -107,7 +107,7 @@ static int nf_ct_frag6_sysctl_register(struct net *net) · 106 unmodified lines | ||
| 107 | 107 | if (hdr == NULL) |
| 108 | 108 | goto err_reg; |
| 109 | 109 | |
| 110 | − net->nf_frag.sysctl.frags_hdr = hdr; | |
| 110 | + net->nf_frag_frags_hdr = hdr; | |
| 111 | 111 | return 0; |
| 112 | 112 | |
| 113 | 113 | err_reg: |
| @@ -121,8 +121,8 @@ static void __net_exit nf_ct_frags6_sysctl_unregister(struct net *net) · 7 unmodified lines | ||
| 121 | 121 | { |
| 122 | 122 | struct ctl_table *table; |
| 123 | 123 | |
| 124 | − table = net->nf_frag.sysctl.frags_hdr->ctl_table_arg; | |
| 125 | − unregister_net_sysctl_table(net->nf_frag.sysctl.frags_hdr); | |
| 124 | + table = net->nf_frag_frags_hdr->ctl_table_arg; | |
| 125 | + unregister_net_sysctl_table(net->nf_frag_frags_hdr); | |
| 126 | 126 | if (!net_eq(net, &init_net)) |
| 127 | 127 | kfree(table); |
| 128 | 128 | } |
| @@ -1334,7 +1334,7 @@ void raw6_proc_exit(void) · 1333 unmodified lines | ||
| 1334 | 1334 | } |
| 1335 | 1335 | #endif /* CONFIG_PROC_FS */ |
| 1336 | 1336 | |
| 1337 | −/* Same as inet6_dgram_ops, sans udp_poll_mask. */ | |
| 1337 | +/* Same as inet6_dgram_ops, sans udp_poll. */ | |
| 1338 | 1338 | const struct proto_ops inet6_sockraw_ops = { |
| 1339 | 1339 | .family = PF_INET6, |
| 1340 | 1340 | .owner = THIS_MODULE, |
| @@ -1344,7 +1344,7 @@ const struct proto_ops inet6_sockraw_ops = { · 3 unmodified lines | ||
| 1344 | 1344 | .socketpair = sock_no_socketpair, /* a do nothing */ |
| 1345 | 1345 | .accept = sock_no_accept, /* a do nothing */ |
| 1346 | 1346 | .getname = inet6_getname, |
| 1347 | − .poll_mask = datagram_poll_mask, /* ok */ | |
| 1347 | + .poll = datagram_poll, /* ok */ | |
| 1348 | 1348 | .ioctl = inet6_ioctl, /* must change */ |
| 1349 | 1349 | .listen = sock_no_listen, /* ok */ |
| 1350 | 1350 | .shutdown = inet_shutdown, /* ok */ |
| @@ -374,7 +374,7 @@ static int seg6_hmac_init_algo(void) · 373 unmodified lines | ||
| 374 | 374 | return -ENOMEM; |
| 375 | 375 | |
| 376 | 376 | for_each_possible_cpu(cpu) { |
| 377 | − tfm = crypto_alloc_shash(algo->name, 0, GFP_KERNEL); | |
| 377 | + tfm = crypto_alloc_shash(algo->name, 0, 0); | |
| 378 | 378 | if (IS_ERR(tfm)) |
| 379 | 379 | return PTR_ERR(tfm); |
| 380 | 380 | p_tfm = per_cpu_ptr(algo->tfms, cpu); |
| @@ -1488,11 +1488,14 @@ static inline __poll_t iucv_accept_poll(struct sock *parent) · 1487 unmodified lines | ||
| 1488 | 1488 | return 0; |
| 1489 | 1489 | } |
| 1490 | 1490 | |
| 1491 | −static __poll_t iucv_sock_poll_mask(struct socket *sock, __poll_t events) | |
| 1491 | +__poll_t iucv_sock_poll(struct file *file, struct socket *sock, | |
| 1492 | + poll_table *wait) | |
| 1492 | 1493 | { |
| 1493 | 1494 | struct sock *sk = sock->sk; |
| 1494 | 1495 | __poll_t mask = 0; |
| 1495 | 1496 | |
| 1497 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 1498 | + | |
| 1496 | 1499 | if (sk->sk_state == IUCV_LISTEN) |
| 1497 | 1500 | return iucv_accept_poll(sk); |
| 1498 | 1501 | |
| @@ -2385,7 +2388,7 @@ static const struct proto_ops iucv_sock_ops = { · 886 unmodified lines | ||
| 2385 | 2388 | .getname = iucv_sock_getname, |
| 2386 | 2389 | .sendmsg = iucv_sock_sendmsg, |
| 2387 | 2390 | .recvmsg = iucv_sock_recvmsg, |
| 2388 | − .poll_mask = iucv_sock_poll_mask, | |
| 2391 | + .poll = iucv_sock_poll, | |
| 2389 | 2392 | .ioctl = sock_no_ioctl, |
| 2390 | 2393 | .mmap = sock_no_mmap, |
| 2391 | 2394 | .socketpair = sock_no_socketpair, |
| @@ -1336,9 +1336,9 @@ static void init_kcm_sock(struct kcm_sock *kcm, struct kcm_mux *mux) · 1335 unmodified lines | ||
| 1336 | 1336 | struct list_head *head; |
| 1337 | 1337 | int index = 0; |
| 1338 | 1338 | |
| 1339 | − /* For SOCK_SEQPACKET sock type, datagram_poll_mask checks the sk_state, | |
| 1340 | − * so we set sk_state, otherwise epoll_wait always returns right away | |
| 1341 | − * with EPOLLHUP | |
| 1339 | + /* For SOCK_SEQPACKET sock type, datagram_poll checks the sk_state, so | |
| 1340 | + * we set sk_state, otherwise epoll_wait always returns right away with | |
| 1341 | + * EPOLLHUP | |
| 1342 | 1342 | */ |
| 1343 | 1343 | kcm->sk.sk_state = TCP_ESTABLISHED; |
| 1344 | 1344 | |
| @@ -1903,7 +1903,7 @@ static const struct proto_ops kcm_dgram_ops = { · 558 unmodified lines | ||
| 1903 | 1903 | .socketpair = sock_no_socketpair, |
| 1904 | 1904 | .accept = sock_no_accept, |
| 1905 | 1905 | .getname = sock_no_getname, |
| 1906 | − .poll_mask = datagram_poll_mask, | |
| 1906 | + .poll = datagram_poll, | |
| 1907 | 1907 | .ioctl = kcm_ioctl, |
| 1908 | 1908 | .listen = sock_no_listen, |
| 1909 | 1909 | .shutdown = sock_no_shutdown, |
| @@ -1924,7 +1924,7 @@ static const struct proto_ops kcm_seqpacket_ops = { · 14 unmodified lines | ||
| 1924 | 1924 | .socketpair = sock_no_socketpair, |
| 1925 | 1925 | .accept = sock_no_accept, |
| 1926 | 1926 | .getname = sock_no_getname, |
| 1927 | − .poll_mask = datagram_poll_mask, | |
| 1927 | + .poll = datagram_poll, | |
| 1928 | 1928 | .ioctl = kcm_ioctl, |
| 1929 | 1929 | .listen = sock_no_listen, |
| 1930 | 1930 | .shutdown = sock_no_shutdown, |
| @@ -3751,7 +3751,7 @@ static const struct proto_ops pfkey_ops = { · 3750 unmodified lines | ||
| 3751 | 3751 | |
| 3752 | 3752 | /* Now the operations that really occur. */ |
| 3753 | 3753 | .release = pfkey_release, |
| 3754 | − .poll_mask = datagram_poll_mask, | |
| 3754 | + .poll = datagram_poll, | |
| 3755 | 3755 | .sendmsg = pfkey_sendmsg, |
| 3756 | 3756 | .recvmsg = pfkey_recvmsg, |
| 3757 | 3757 | }; |
| @@ -613,7 +613,7 @@ static const struct proto_ops l2tp_ip_ops = { · 612 unmodified lines | ||
| 613 | 613 | .socketpair = sock_no_socketpair, |
| 614 | 614 | .accept = sock_no_accept, |
| 615 | 615 | .getname = l2tp_ip_getname, |
| 616 | − .poll_mask = datagram_poll_mask, | |
| 616 | + .poll = datagram_poll, | |
| 617 | 617 | .ioctl = inet_ioctl, |
| 618 | 618 | .listen = sock_no_listen, |
| 619 | 619 | .shutdown = inet_shutdown, |
| @@ -754,7 +754,7 @@ static const struct proto_ops l2tp_ip6_ops = { · 753 unmodified lines | ||
| 754 | 754 | .socketpair = sock_no_socketpair, |
| 755 | 755 | .accept = sock_no_accept, |
| 756 | 756 | .getname = l2tp_ip6_getname, |
| 757 | − .poll_mask = datagram_poll_mask, | |
| 757 | + .poll = datagram_poll, | |
| 758 | 758 | .ioctl = inet6_ioctl, |
| 759 | 759 | .listen = sock_no_listen, |
| 760 | 760 | .shutdown = inet_shutdown, |
| @@ -1844,7 +1844,7 @@ static const struct proto_ops pppol2tp_ops = { · 1843 unmodified lines | ||
| 1844 | 1844 | .socketpair = sock_no_socketpair, |
| 1845 | 1845 | .accept = sock_no_accept, |
| 1846 | 1846 | .getname = pppol2tp_getname, |
| 1847 | − .poll_mask = datagram_poll_mask, | |
| 1847 | + .poll = datagram_poll, | |
| 1848 | 1848 | .listen = sock_no_listen, |
| 1849 | 1849 | .shutdown = sock_no_shutdown, |
| 1850 | 1850 | .setsockopt = pppol2tp_setsockopt, |
| @@ -1192,7 +1192,7 @@ static const struct proto_ops llc_ui_ops = { · 1191 unmodified lines | ||
| 1192 | 1192 | .socketpair = sock_no_socketpair, |
| 1193 | 1193 | .accept = llc_ui_accept, |
| 1194 | 1194 | .getname = llc_ui_getname, |
| 1195 | − .poll_mask = datagram_poll_mask, | |
| 1195 | + .poll = datagram_poll, | |
| 1196 | 1196 | .ioctl = llc_ui_ioctl, |
| 1197 | 1197 | .listen = llc_ui_listen, |
| 1198 | 1198 | .shutdown = llc_ui_shutdown, |
| @@ -4850,7 +4850,9 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, · 4849 unmodified lines | ||
| 4850 | 4850 | skb_reset_network_header(skb); |
| 4851 | 4851 | skb_reset_mac_header(skb); |
| 4852 | 4852 | |
| 4853 | + local_bh_disable(); | |
| 4853 | 4854 | __ieee80211_subif_start_xmit(skb, skb->dev, flags); |
| 4855 | + local_bh_enable(); | |
| 4854 | 4856 | |
| 4855 | 4857 | return 0; |
| 4856 | 4858 | } |
| @@ -47,6 +47,8 @@ struct nf_conncount_tuple { · 46 unmodified lines | ||
| 47 | 47 | struct hlist_node node; |
| 48 | 48 | struct nf_conntrack_tuple tuple; |
| 49 | 49 | struct nf_conntrack_zone zone; |
| 50 | + int cpu; | |
| 51 | + u32 jiffies32; | |
| 50 | 52 | }; |
| 51 | 53 | |
| 52 | 54 | struct nf_conncount_rb { |
| @@ -91,11 +93,42 @@ bool nf_conncount_add(struct hlist_head *head, · 38 unmodified lines | ||
| 91 | 93 | return false; |
| 92 | 94 | conn->tuple = *tuple; |
| 93 | 95 | conn->zone = *zone; |
| 96 | + conn->cpu = raw_smp_processor_id(); | |
| 97 | + conn->jiffies32 = (u32)jiffies; | |
| 94 | 98 | hlist_add_head(&conn->node, head); |
| 95 | 99 | return true; |
| 96 | 100 | } |
| 97 | 101 | EXPORT_SYMBOL_GPL(nf_conncount_add); |
| 98 | 102 | |
| 103 | +static const struct nf_conntrack_tuple_hash * | |
| 104 | +find_or_evict(struct net *net, struct nf_conncount_tuple *conn) | |
| 105 | +{ | |
| 106 | + const struct nf_conntrack_tuple_hash *found; | |
| 107 | + unsigned long a, b; | |
| 108 | + int cpu = raw_smp_processor_id(); | |
| 109 | + __s32 age; | |
| 110 | + | |
| 111 | + found = nf_conntrack_find_get(net, &conn->zone, &conn->tuple); | |
| 112 | + if (found) | |
| 113 | + return found; | |
| 114 | + b = conn->jiffies32; | |
| 115 | + a = (u32)jiffies; | |
| 116 | + | |
| 117 | + /* conn might have been added just before by another cpu and | |
| 118 | + * might still be unconfirmed. In this case, nf_conntrack_find() | |
| 119 | + * returns no result. Thus only evict if this cpu added the | |
| 120 | + * stale entry or if the entry is older than two jiffies. | |
| 121 | + */ | |
| 122 | + age = a - b; | |
| 123 | + if (conn->cpu == cpu || age >= 2) { | |
| 124 | + hlist_del(&conn->node); | |
| 125 | + kmem_cache_free(conncount_conn_cachep, conn); | |
| 126 | + return ERR_PTR(-ENOENT); | |
| 127 | + } | |
| 128 | + | |
| 129 | + return ERR_PTR(-EAGAIN); | |
| 130 | +} | |
| 131 | + | |
| 99 | 132 | unsigned int nf_conncount_lookup(struct net *net, struct hlist_head *head, |
| 100 | 133 | const struct nf_conntrack_tuple *tuple, |
| 101 | 134 | const struct nf_conntrack_zone *zone, |
| @@ -103,18 +136,27 @@ unsigned int nf_conncount_lookup(struct net *net, struct hlist_head *head, · 1 unmodified line | ||
| 103 | 136 | { |
| 104 | 137 | const struct nf_conntrack_tuple_hash *found; |
| 105 | 138 | struct nf_conncount_tuple *conn; |
| 106 | − struct hlist_node *n; | |
| 107 | 139 | struct nf_conn *found_ct; |
| 140 | + struct hlist_node *n; | |
| 108 | 141 | unsigned int length = 0; |
| 109 | 142 | |
| 110 | 143 | *addit = tuple ? true : false; |
| 111 | 144 | |
| 112 | 145 | /* check the saved connections */ |
| 113 | 146 | hlist_for_each_entry_safe(conn, n, head, node) { |
| 114 | − found = nf_conntrack_find_get(net, &conn->zone, &conn->tuple); | |
| 115 | − if (found == NULL) { | |
| 116 | − hlist_del(&conn->node); | |
| 117 | − kmem_cache_free(conncount_conn_cachep, conn); | |
| 147 | + found = find_or_evict(net, conn); | |
| 148 | + if (IS_ERR(found)) { | |
| 149 | + /* Not found, but might be about to be confirmed */ | |
| 150 | + if (PTR_ERR(found) == -EAGAIN) { | |
| 151 | + length++; | |
| 152 | + if (!tuple) | |
| 153 | + continue; | |
| 154 | + | |
| 155 | + if (nf_ct_tuple_equal(&conn->tuple, tuple) && | |
| 156 | + nf_ct_zone_id(&conn->zone, conn->zone.dir) == | |
| 157 | + nf_ct_zone_id(zone, zone->dir)) | |
| 158 | + *addit = false; | |
| 159 | + } | |
| 118 | 160 | continue; |
| 119 | 161 | } |
| 120 | 162 | |
| @@ -465,6 +465,11 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me) · 464 unmodified lines | ||
| 465 | 465 | |
| 466 | 466 | nf_ct_expect_iterate_destroy(expect_iter_me, NULL); |
| 467 | 467 | nf_ct_iterate_destroy(unhelp, me); |
| 468 | + | |
| 469 | + /* Maybe someone has gotten the helper already when unhelp above. | |
| 470 | + * So need to wait it. | |
| 471 | + */ | |
| 472 | + synchronize_rcu(); | |
| 468 | 473 | } |
| 469 | 474 | EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister); |
| 470 | 475 | |
| @@ -424,6 +424,10 @@ static int nf_log_proc_dostring(struct ctl_table *table, int write, · 423 unmodified lines | ||
| 424 | 424 | if (write) { |
| 425 | 425 | struct ctl_table tmp = *table; |
| 426 | 426 | |
| 427 | + /* proc_dostring() can append to existing strings, so we need to | |
| 428 | + * initialize it as an empty string. | |
| 429 | + */ | |
| 430 | + buf[0] = '\0'; | |
| 427 | 431 | tmp.data = buf; |
| 428 | 432 | r = proc_dostring(&tmp, write, buffer, lenp, ppos); |
| 429 | 433 | if (r) |
| @@ -442,14 +446,17 @@ static int nf_log_proc_dostring(struct ctl_table *table, int write, · 12 unmodified lines | ||
| 442 | 446 | rcu_assign_pointer(net->nf.nf_loggers[tindex], logger); |
| 443 | 447 | mutex_unlock(&nf_log_mutex); |
| 444 | 448 | } else { |
| 449 | + struct ctl_table tmp = *table; | |
| 450 | + | |
| 451 | + tmp.data = buf; | |
| 445 | 452 | mutex_lock(&nf_log_mutex); |
| 446 | 453 | logger = nft_log_dereference(net->nf.nf_loggers[tindex]); |
| 447 | 454 | if (!logger) |
| 448 | − table->data = "NONE"; | |
| 455 | + strlcpy(buf, "NONE", sizeof(buf)); | |
| 449 | 456 | else |
| 450 | − table->data = logger->name; | |
| 451 | − r = proc_dostring(table, write, buffer, lenp, ppos); | |
| 457 | + strlcpy(buf, logger->name, sizeof(buf)); | |
| 452 | 458 | mutex_unlock(&nf_log_mutex); |
| 459 | + r = proc_dostring(&tmp, write, buffer, lenp, ppos); | |
| 453 | 460 | } |
| 454 | 461 | |
| 455 | 462 | return r; |
| @@ -1243,6 +1243,9 @@ static int nfqnl_recv_unsupp(struct net *net, struct sock *ctnl, · 1242 unmodified lines | ||
| 1243 | 1243 | static const struct nla_policy nfqa_cfg_policy[NFQA_CFG_MAX+1] = { |
| 1244 | 1244 | [NFQA_CFG_CMD] = { .len = sizeof(struct nfqnl_msg_config_cmd) }, |
| 1245 | 1245 | [NFQA_CFG_PARAMS] = { .len = sizeof(struct nfqnl_msg_config_params) }, |
| 1246 | + [NFQA_CFG_QUEUE_MAXLEN] = { .type = NLA_U32 }, | |
| 1247 | + [NFQA_CFG_MASK] = { .type = NLA_U32 }, | |
| 1248 | + [NFQA_CFG_FLAGS] = { .type = NLA_U32 }, | |
| 1246 | 1249 | }; |
| 1247 | 1250 | |
| 1248 | 1251 | static const struct nf_queue_handler nfqh = { |
| @@ -2658,7 +2658,7 @@ static const struct proto_ops netlink_ops = { · 2657 unmodified lines | ||
| 2658 | 2658 | .socketpair = sock_no_socketpair, |
| 2659 | 2659 | .accept = sock_no_accept, |
| 2660 | 2660 | .getname = netlink_getname, |
| 2661 | − .poll_mask = datagram_poll_mask, | |
| 2661 | + .poll = datagram_poll, | |
| 2662 | 2662 | .ioctl = netlink_ioctl, |
| 2663 | 2663 | .listen = sock_no_listen, |
| 2664 | 2664 | .shutdown = sock_no_shutdown, |
| @@ -1355,7 +1355,7 @@ static const struct proto_ops nr_proto_ops = { · 1354 unmodified lines | ||
| 1355 | 1355 | .socketpair = sock_no_socketpair, |
| 1356 | 1356 | .accept = nr_accept, |
| 1357 | 1357 | .getname = nr_getname, |
| 1358 | − .poll_mask = datagram_poll_mask, | |
| 1358 | + .poll = datagram_poll, | |
| 1359 | 1359 | .ioctl = nr_ioctl, |
| 1360 | 1360 | .listen = nr_listen, |
| 1361 | 1361 | .shutdown = sock_no_shutdown, |
| @@ -548,13 +548,16 @@ static inline __poll_t llcp_accept_poll(struct sock *parent) · 547 unmodified lines | ||
| 548 | 548 | return 0; |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | −static __poll_t llcp_sock_poll_mask(struct socket *sock, __poll_t events) | |
| 551 | +static __poll_t llcp_sock_poll(struct file *file, struct socket *sock, | |
| 552 | + poll_table *wait) | |
| 552 | 553 | { |
| 553 | 554 | struct sock *sk = sock->sk; |
| 554 | 555 | __poll_t mask = 0; |
| 555 | 556 | |
| 556 | 557 | pr_debug("%p\n", sk); |
| 557 | 558 | |
| 559 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 560 | + | |
| 558 | 561 | if (sk->sk_state == LLCP_LISTEN) |
| 559 | 562 | return llcp_accept_poll(sk); |
| 560 | 563 | |
| @@ -896,7 +899,7 @@ static const struct proto_ops llcp_sock_ops = { · 335 unmodified lines | ||
| 896 | 899 | .socketpair = sock_no_socketpair, |
| 897 | 900 | .accept = llcp_sock_accept, |
| 898 | 901 | .getname = llcp_sock_getname, |
| 899 | − .poll_mask = llcp_sock_poll_mask, | |
| 902 | + .poll = llcp_sock_poll, | |
| 900 | 903 | .ioctl = sock_no_ioctl, |
| 901 | 904 | .listen = llcp_sock_listen, |
| 902 | 905 | .shutdown = sock_no_shutdown, |
| @@ -916,7 +919,7 @@ static const struct proto_ops llcp_rawsock_ops = { · 13 unmodified lines | ||
| 916 | 919 | .socketpair = sock_no_socketpair, |
| 917 | 920 | .accept = sock_no_accept, |
| 918 | 921 | .getname = llcp_sock_getname, |
| 919 | − .poll_mask = llcp_sock_poll_mask, | |
| 922 | + .poll = llcp_sock_poll, | |
| 920 | 923 | .ioctl = sock_no_ioctl, |
| 921 | 924 | .listen = sock_no_listen, |
| 922 | 925 | .shutdown = sock_no_shutdown, |
| @@ -284,7 +284,7 @@ static const struct proto_ops rawsock_ops = { · 283 unmodified lines | ||
| 284 | 284 | .socketpair = sock_no_socketpair, |
| 285 | 285 | .accept = sock_no_accept, |
| 286 | 286 | .getname = sock_no_getname, |
| 287 | − .poll_mask = datagram_poll_mask, | |
| 287 | + .poll = datagram_poll, | |
| 288 | 288 | .ioctl = sock_no_ioctl, |
| 289 | 289 | .listen = sock_no_listen, |
| 290 | 290 | .shutdown = sock_no_shutdown, |
| @@ -304,7 +304,7 @@ static const struct proto_ops rawsock_raw_ops = { · 13 unmodified lines | ||
| 304 | 304 | .socketpair = sock_no_socketpair, |
| 305 | 305 | .accept = sock_no_accept, |
| 306 | 306 | .getname = sock_no_getname, |
| 307 | − .poll_mask = datagram_poll_mask, | |
| 307 | + .poll = datagram_poll, | |
| 308 | 308 | .ioctl = sock_no_ioctl, |
| 309 | 309 | .listen = sock_no_listen, |
| 310 | 310 | .shutdown = sock_no_shutdown, |
| @@ -4076,11 +4076,12 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd, · 4075 unmodified lines | ||
| 4076 | 4076 | return 0; |
| 4077 | 4077 | } |
| 4078 | 4078 | |
| 4079 | −static __poll_t packet_poll_mask(struct socket *sock, __poll_t events) | |
| 4079 | +static __poll_t packet_poll(struct file *file, struct socket *sock, | |
| 4080 | + poll_table *wait) | |
| 4080 | 4081 | { |
| 4081 | 4082 | struct sock *sk = sock->sk; |
| 4082 | 4083 | struct packet_sock *po = pkt_sk(sk); |
| 4083 | − __poll_t mask = datagram_poll_mask(sock, events); | |
| 4084 | + __poll_t mask = datagram_poll(file, sock, wait); | |
| 4084 | 4085 | |
| 4085 | 4086 | spin_lock_bh(&sk->sk_receive_queue.lock); |
| 4086 | 4087 | if (po->rx_ring.pg_vec) { |
| @@ -4422,7 +4423,7 @@ static const struct proto_ops packet_ops_spkt = { · 335 unmodified lines | ||
| 4422 | 4423 | .socketpair = sock_no_socketpair, |
| 4423 | 4424 | .accept = sock_no_accept, |
| 4424 | 4425 | .getname = packet_getname_spkt, |
| 4425 | − .poll_mask = datagram_poll_mask, | |
| 4426 | + .poll = datagram_poll, | |
| 4426 | 4427 | .ioctl = packet_ioctl, |
| 4427 | 4428 | .listen = sock_no_listen, |
| 4428 | 4429 | .shutdown = sock_no_shutdown, |
| @@ -4443,7 +4444,7 @@ static const struct proto_ops packet_ops = { · 14 unmodified lines | ||
| 4443 | 4444 | .socketpair = sock_no_socketpair, |
| 4444 | 4445 | .accept = sock_no_accept, |
| 4445 | 4446 | .getname = packet_getname, |
| 4446 | − .poll_mask = packet_poll_mask, | |
| 4447 | + .poll = packet_poll, | |
| 4447 | 4448 | .ioctl = packet_ioctl, |
| 4448 | 4449 | .listen = sock_no_listen, |
| 4449 | 4450 | .shutdown = sock_no_shutdown, |
| @@ -340,12 +340,15 @@ static int pn_socket_getname(struct socket *sock, struct sockaddr *addr, · 339 unmodified lines | ||
| 340 | 340 | return sizeof(struct sockaddr_pn); |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | −static __poll_t pn_socket_poll_mask(struct socket *sock, __poll_t events) | |
| 343 | +static __poll_t pn_socket_poll(struct file *file, struct socket *sock, | |
| 344 | + poll_table *wait) | |
| 344 | 345 | { |
| 345 | 346 | struct sock *sk = sock->sk; |
| 346 | 347 | struct pep_sock *pn = pep_sk(sk); |
| 347 | 348 | __poll_t mask = 0; |
| 348 | 349 | |
| 350 | + poll_wait(file, sk_sleep(sk), wait); | |
| 351 | + | |
| 349 | 352 | if (sk->sk_state == TCP_CLOSE) |
| 350 | 353 | return EPOLLERR; |
| 351 | 354 | if (!skb_queue_empty(&sk->sk_receive_queue)) |
| @@ -445,7 +448,7 @@ const struct proto_ops phonet_dgram_ops = { · 93 unmodified lines | ||
| 445 | 448 | .socketpair = sock_no_socketpair, |
| 446 | 449 | .accept = sock_no_accept, |
| 447 | 450 | .getname = pn_socket_getname, |
| 448 | − .poll_mask = datagram_poll_mask, | |
| 451 | + .poll = datagram_poll, | |
| 449 | 452 | .ioctl = pn_socket_ioctl, |
| 450 | 453 | .listen = sock_no_listen, |
| 451 | 454 | .shutdown = sock_no_shutdown, |
| @@ -470,7 +473,7 @@ const struct proto_ops phonet_stream_ops = { · 18 unmodified lines | ||
| 470 | 473 | .socketpair = sock_no_socketpair, |
| 471 | 474 | .accept = pn_socket_accept, |
| 472 | 475 | .getname = pn_socket_getname, |
| 473 | − .poll_mask = pn_socket_poll_mask, | |
| 476 | + .poll = pn_socket_poll, | |
| 474 | 477 | .ioctl = pn_socket_ioctl, |
| 475 | 478 | .listen = pn_socket_listen, |
| 476 | 479 | .shutdown = sock_no_shutdown, |
| @@ -1023,7 +1023,7 @@ static const struct proto_ops qrtr_proto_ops = { · 1022 unmodified lines | ||
| 1023 | 1023 | .recvmsg = qrtr_recvmsg, |
| 1024 | 1024 | .getname = qrtr_getname, |
| 1025 | 1025 | .ioctl = qrtr_ioctl, |
| 1026 | − .poll_mask = datagram_poll_mask, | |
| 1026 | + .poll = datagram_poll, | |
| 1027 | 1027 | .shutdown = sock_no_shutdown, |
| 1028 | 1028 | .setsockopt = sock_no_setsockopt, |
| 1029 | 1029 | .getsockopt = sock_no_getsockopt, |
| @@ -659,11 +659,19 @@ static void rds_conn_info(struct socket *sock, unsigned int len, · 658 unmodified lines | ||
| 659 | 659 | |
| 660 | 660 | int rds_conn_init(void) |
| 661 | 661 | { |
| 662 | + int ret; | |
| 663 | + | |
| 664 | + ret = rds_loop_net_init(); /* register pernet callback */ | |
| 665 | + if (ret) | |
| 666 | + return ret; | |
| 667 | + | |
| 662 | 668 | rds_conn_slab = kmem_cache_create("rds_connection", |
| 663 | 669 | sizeof(struct rds_connection), |
| 664 | 670 | 0, 0, NULL); |
| 665 | − if (!rds_conn_slab) | |
| 671 | + if (!rds_conn_slab) { | |
| 672 | + rds_loop_net_exit(); | |
| 666 | 673 | return -ENOMEM; |
| 674 | + } | |
| 667 | 675 | |
| 668 | 676 | rds_info_register_func(RDS_INFO_CONNECTIONS, rds_conn_info); |
| 669 | 677 | rds_info_register_func(RDS_INFO_SEND_MESSAGES, |
| @@ -676,6 +684,7 @@ int rds_conn_init(void) · 6 unmodified lines | ||
| 676 | 684 | |
| 677 | 685 | void rds_conn_exit(void) |
| 678 | 686 | { |
| 687 | + rds_loop_net_exit(); /* unregister pernet callback */ | |
| 679 | 688 | rds_loop_exit(); |
| 680 | 689 | |
| 681 | 690 | WARN_ON(!hlist_empty(rds_conn_hash)); |
| @@ -33,6 +33,8 @@ · 32 unmodified lines | ||
| 33 | 33 | #include <linux/kernel.h> |
| 34 | 34 | #include <linux/slab.h> |
| 35 | 35 | #include <linux/in.h> |
| 36 | +#include <net/net_namespace.h> | |
| 37 | +#include <net/netns/generic.h> | |
| 36 | 38 | |
| 37 | 39 | #include "rds_single_path.h" |
| 38 | 40 | #include "rds.h" |
| @@ -40,6 +42,17 @@ · 1 unmodified line | ||
| 40 | 42 | |
| 41 | 43 | static DEFINE_SPINLOCK(loop_conns_lock); |
| 42 | 44 | static LIST_HEAD(loop_conns); |
| 45 | +static atomic_t rds_loop_unloading = ATOMIC_INIT(0); | |
| 46 | + | |
| 47 | +static void rds_loop_set_unloading(void) | |
| 48 | +{ | |
| 49 | + atomic_set(&rds_loop_unloading, 1); | |
| 50 | +} | |
| 51 | + | |
| 52 | +static bool rds_loop_is_unloading(struct rds_connection *conn) | |
| 53 | +{ | |
| 54 | + return atomic_read(&rds_loop_unloading) != 0; | |
| 55 | +} | |
| 43 | 56 | |
| 44 | 57 | /* |
| 45 | 58 | * This 'loopback' transport is a special case for flows that originate |
| @@ -165,6 +178,8 @@ void rds_loop_exit(void) · 119 unmodified lines | ||
| 165 | 178 | struct rds_loop_connection *lc, *_lc; |
| 166 | 179 | LIST_HEAD(tmp_list); |
| 167 | 180 | |
| 181 | + rds_loop_set_unloading(); | |
| 182 | + synchronize_rcu(); | |
| 168 | 183 | /* avoid calling conn_destroy with irqs off */ |
| 169 | 184 | spin_lock_irq(&loop_conns_lock); |
| 170 | 185 | list_splice(&loop_conns, &tmp_list); |
| @@ -177,6 +192,46 @@ void rds_loop_exit(void) · 6 unmodified lines | ||
| 177 | 192 | } |
| 178 | 193 | } |
| 179 | 194 | |
| 195 | +static void rds_loop_kill_conns(struct net *net) | |
| 196 | +{ | |
| 197 | + struct rds_loop_connection *lc, *_lc; | |
| 198 | + LIST_HEAD(tmp_list); | |
| 199 | + | |
| 200 | + spin_lock_irq(&loop_conns_lock); | |
| 201 | + list_for_each_entry_safe(lc, _lc, &loop_conns, loop_node) { | |
| 202 | + struct net *c_net = read_pnet(&lc->conn->c_net); | |
| 203 | + | |
| 204 | + if (net != c_net) | |
| 205 | + continue; | |
| 206 | + list_move_tail(&lc->loop_node, &tmp_list); | |
| 207 | + } | |
| 208 | + spin_unlock_irq(&loop_conns_lock); | |
| 209 | + | |
| 210 | + list_for_each_entry_safe(lc, _lc, &tmp_list, loop_node) { | |
| 211 | + WARN_ON(lc->conn->c_passive); | |
| 212 | + rds_conn_destroy(lc->conn); | |
| 213 | + } | |
| 214 | +} | |
| 215 | + | |
| 216 | +static void __net_exit rds_loop_exit_net(struct net *net) | |
| 217 | +{ | |
| 218 | + rds_loop_kill_conns(net); | |
| 219 | +} | |
| 220 | + | |
| 221 | +static struct pernet_operations rds_loop_net_ops = { | |
| 222 | + .exit = rds_loop_exit_net, | |
| 223 | +}; | |
| 224 | + | |
| 225 | +int rds_loop_net_init(void) | |
| 226 | +{ | |
| 227 | + return register_pernet_device(&rds_loop_net_ops); | |
| 228 | +} | |
| 229 | + | |
| 230 | +void rds_loop_net_exit(void) | |
| 231 | +{ | |
| 232 | + unregister_pernet_device(&rds_loop_net_ops); | |
| 233 | +} | |
| 234 | + | |
| 180 | 235 | /* |
| 181 | 236 | * This is missing .xmit_* because loop doesn't go through generic |
| 182 | 237 | * rds_send_xmit() and doesn't call rds_recv_incoming(). .listen_stop and |
| @@ -194,4 +249,5 @@ struct rds_transport rds_loop_transport = { · 11 unmodified lines | ||
| 194 | 249 | .inc_free = rds_loop_inc_free, |
| 195 | 250 | .t_name = "loopback", |
| 196 | 251 | .t_type = RDS_TRANS_LOOP, |
| 252 | + .t_unloading = rds_loop_is_unloading, | |
| 197 | 253 | }; |
| @@ -5,6 +5,8 @@ · 4 unmodified lines | ||
| 5 | 5 | /* loop.c */ |
| 6 | 6 | extern struct rds_transport rds_loop_transport; |
| 7 | 7 | |
| 8 | +int rds_loop_net_init(void); | |
| 9 | +void rds_loop_net_exit(void); | |
| 8 | 10 | void rds_loop_exit(void); |
| 9 | 11 | |
| 10 | 12 | #endif |
| @@ -1470,7 +1470,7 @@ static const struct proto_ops rose_proto_ops = { · 1469 unmodified lines | ||
| 1470 | 1470 | .socketpair = sock_no_socketpair, |
| 1471 | 1471 | .accept = rose_accept, |
| 1472 | 1472 | .getname = rose_getname, |
| 1473 | − .poll_mask = datagram_poll_mask, | |
| 1473 | + .poll = datagram_poll, | |
| 1474 | 1474 | .ioctl = rose_ioctl, |
| 1475 | 1475 | .listen = rose_listen, |
| 1476 | 1476 | .shutdown = sock_no_shutdown, |
| @@ -734,11 +734,15 @@ static int rxrpc_getsockopt(struct socket *sock, int level, int optname, · 733 unmodified lines | ||
| 734 | 734 | /* |
| 735 | 735 | * permit an RxRPC socket to be polled |
| 736 | 736 | */ |
| 737 | −static __poll_t rxrpc_poll_mask(struct socket *sock, __poll_t events) | |
| 737 | +static __poll_t rxrpc_poll(struct file *file, struct socket *sock, | |
| 738 | + poll_table *wait) | |
| 738 | 739 | { |
| 739 | 740 | struct sock *sk = sock->sk; |
| 740 | 741 | struct rxrpc_sock *rx = rxrpc_sk(sk); |
| 741 | − __poll_t mask = 0; | |
| 742 | + __poll_t mask; | |
| 743 | + | |
| 744 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 745 | + mask = 0; | |
| 742 | 746 | |
| 743 | 747 | /* the socket is readable if there are any messages waiting on the Rx |
| 744 | 748 | * queue */ |
| @@ -945,7 +949,7 @@ static const struct proto_ops rxrpc_rpc_ops = { · 200 unmodified lines | ||
| 945 | 949 | .socketpair = sock_no_socketpair, |
| 946 | 950 | .accept = sock_no_accept, |
| 947 | 951 | .getname = sock_no_getname, |
| 948 | − .poll_mask = rxrpc_poll_mask, | |
| 952 | + .poll = rxrpc_poll, | |
| 949 | 953 | .ioctl = sock_no_ioctl, |
| 950 | 954 | .listen = rxrpc_listen, |
| 951 | 955 | .shutdown = rxrpc_shutdown, |
| @@ -1010,7 +1010,7 @@ static const struct proto_ops inet6_seqpacket_ops = { · 1009 unmodified lines | ||
| 1010 | 1010 | .socketpair = sock_no_socketpair, |
| 1011 | 1011 | .accept = inet_accept, |
| 1012 | 1012 | .getname = sctp_getname, |
| 1013 | − .poll_mask = sctp_poll_mask, | |
| 1013 | + .poll = sctp_poll, | |
| 1014 | 1014 | .ioctl = inet6_ioctl, |
| 1015 | 1015 | .listen = sctp_inet_listen, |
| 1016 | 1016 | .shutdown = inet_shutdown, |
| @@ -1016,7 +1016,7 @@ static const struct proto_ops inet_seqpacket_ops = { · 1015 unmodified lines | ||
| 1016 | 1016 | .socketpair = sock_no_socketpair, |
| 1017 | 1017 | .accept = inet_accept, |
| 1018 | 1018 | .getname = inet_getname, /* Semantics are different. */ |
| 1019 | − .poll_mask = sctp_poll_mask, | |
| 1019 | + .poll = sctp_poll, | |
| 1020 | 1020 | .ioctl = inet_ioctl, |
| 1021 | 1021 | .listen = sctp_inet_listen, |
| 1022 | 1022 | .shutdown = inet_shutdown, /* Looks harmless. */ |
| @@ -7765,12 +7765,14 @@ out: · 7764 unmodified lines | ||
| 7765 | 7765 | * here, again, by modeling the current TCP/UDP code. We don't have |
| 7766 | 7766 | * a good way to test with it yet. |
| 7767 | 7767 | */ |
| 7768 | −__poll_t sctp_poll_mask(struct socket *sock, __poll_t events) | |
| 7768 | +__poll_t sctp_poll(struct file *file, struct socket *sock, poll_table *wait) | |
| 7769 | 7769 | { |
| 7770 | 7770 | struct sock *sk = sock->sk; |
| 7771 | 7771 | struct sctp_sock *sp = sctp_sk(sk); |
| 7772 | 7772 | __poll_t mask; |
| 7773 | 7773 | |
| 7774 | + poll_wait(file, sk_sleep(sk), wait); | |
| 7775 | + | |
| 7774 | 7776 | sock_rps_record_flow(sk); |
| 7775 | 7777 | |
| 7776 | 7778 | /* A TCP-style listening socket becomes readable when the accept queue |
| @@ -47,6 +47,7 @@ static DEFINE_MUTEX(smc_create_lgr_pending); /* serialize link group · 46 unmodified lines | ||
| 47 | 47 | */ |
| 48 | 48 | |
| 49 | 49 | static void smc_tcp_listen_work(struct work_struct *); |
| 50 | +static void smc_connect_work(struct work_struct *); | |
| 50 | 51 | |
| 51 | 52 | static void smc_set_keepalive(struct sock *sk, int val) |
| 52 | 53 | { |
| @@ -124,6 +125,12 @@ static int smc_release(struct socket *sock) · 71 unmodified lines | ||
| 124 | 125 | goto out; |
| 125 | 126 | |
| 126 | 127 | smc = smc_sk(sk); |
| 128 | + | |
| 129 | + /* cleanup for a dangling non-blocking connect */ | |
| 130 | + flush_work(&smc->connect_work); | |
| 131 | + kfree(smc->connect_info); | |
| 132 | + smc->connect_info = NULL; | |
| 133 | + | |
| 127 | 134 | if (sk->sk_state == SMC_LISTEN) |
| 128 | 135 | /* smc_close_non_accepted() is called and acquires |
| 129 | 136 | * sock lock for child sockets again |
| @@ -188,6 +195,7 @@ static struct sock *smc_sock_alloc(struct net *net, struct socket *sock, · 58 unmodified lines | ||
| 188 | 195 | sk->sk_protocol = protocol; |
| 189 | 196 | smc = smc_sk(sk); |
| 190 | 197 | INIT_WORK(&smc->tcp_listen_work, smc_tcp_listen_work); |
| 198 | + INIT_WORK(&smc->connect_work, smc_connect_work); | |
| 191 | 199 | INIT_DELAYED_WORK(&smc->conn.tx_work, smc_tx_work); |
| 192 | 200 | INIT_LIST_HEAD(&smc->accept_q); |
| 193 | 201 | spin_lock_init(&smc->accept_q_lock); |
| @@ -707,6 +715,35 @@ static int __smc_connect(struct smc_sock *smc) · 513 unmodified lines | ||
| 707 | 715 | return 0; |
| 708 | 716 | } |
| 709 | 717 | |
| 718 | +static void smc_connect_work(struct work_struct *work) | |
| 719 | +{ | |
| 720 | + struct smc_sock *smc = container_of(work, struct smc_sock, | |
| 721 | + connect_work); | |
| 722 | + int rc; | |
| 723 | + | |
| 724 | + lock_sock(&smc->sk); | |
| 725 | + rc = kernel_connect(smc->clcsock, &smc->connect_info->addr, | |
| 726 | + smc->connect_info->alen, smc->connect_info->flags); | |
| 727 | + if (smc->clcsock->sk->sk_err) { | |
| 728 | + smc->sk.sk_err = smc->clcsock->sk->sk_err; | |
| 729 | + goto out; | |
| 730 | + } | |
| 731 | + if (rc < 0) { | |
| 732 | + smc->sk.sk_err = -rc; | |
| 733 | + goto out; | |
| 734 | + } | |
| 735 | + | |
| 736 | + rc = __smc_connect(smc); | |
| 737 | + if (rc < 0) | |
| 738 | + smc->sk.sk_err = -rc; | |
| 739 | + | |
| 740 | +out: | |
| 741 | + smc->sk.sk_state_change(&smc->sk); | |
| 742 | + kfree(smc->connect_info); | |
| 743 | + smc->connect_info = NULL; | |
| 744 | + release_sock(&smc->sk); | |
| 745 | +} | |
| 746 | + | |
| 710 | 747 | static int smc_connect(struct socket *sock, struct sockaddr *addr, |
| 711 | 748 | int alen, int flags) |
| 712 | 749 | { |
| @@ -736,15 +773,32 @@ static int smc_connect(struct socket *sock, struct sockaddr *addr, · 23 unmodified lines | ||
| 736 | 773 | |
| 737 | 774 | smc_copy_sock_settings_to_clc(smc); |
| 738 | 775 | tcp_sk(smc->clcsock->sk)->syn_smc = 1; |
| 739 | − rc = kernel_connect(smc->clcsock, addr, alen, flags); | |
| 740 | − if (rc) | |
| 741 | − goto out; | |
| 776 | + if (flags & O_NONBLOCK) { | |
| 777 | + if (smc->connect_info) { | |
| 778 | + rc = -EALREADY; | |
| 779 | + goto out; | |
| 780 | + } | |
| 781 | + smc->connect_info = kzalloc(alen + 2 * sizeof(int), GFP_KERNEL); | |
| 782 | + if (!smc->connect_info) { | |
| 783 | + rc = -ENOMEM; | |
| 784 | + goto out; | |
| 785 | + } | |
| 786 | + smc->connect_info->alen = alen; | |
| 787 | + smc->connect_info->flags = flags ^ O_NONBLOCK; | |
| 788 | + memcpy(&smc->connect_info->addr, addr, alen); | |
| 789 | + schedule_work(&smc->connect_work); | |
| 790 | + rc = -EINPROGRESS; | |
| 791 | + } else { | |
| 792 | + rc = kernel_connect(smc->clcsock, addr, alen, flags); | |
| 793 | + if (rc) | |
| 794 | + goto out; | |
| 742 | 795 | |
| 743 | − rc = __smc_connect(smc); | |
| 744 | − if (rc < 0) | |
| 745 | − goto out; | |
| 746 | − else | |
| 747 | − rc = 0; /* success cases including fallback */ | |
| 796 | + rc = __smc_connect(smc); | |
| 797 | + if (rc < 0) | |
| 798 | + goto out; | |
| 799 | + else | |
| 800 | + rc = 0; /* success cases including fallback */ | |
| 801 | + } | |
| 748 | 802 | |
| 749 | 803 | out: |
| 750 | 804 | release_sock(sk); |
| @@ -1455,39 +1509,23 @@ static __poll_t smc_accept_poll(struct sock *parent) · 704 unmodified lines | ||
| 1455 | 1509 | return mask; |
| 1456 | 1510 | } |
| 1457 | 1511 | |
| 1458 | −static __poll_t smc_poll_mask(struct socket *sock, __poll_t events) | |
| 1512 | +static __poll_t smc_poll(struct file *file, struct socket *sock, | |
| 1513 | + poll_table *wait) | |
| 1459 | 1514 | { |
| 1460 | 1515 | struct sock *sk = sock->sk; |
| 1461 | 1516 | __poll_t mask = 0; |
| 1462 | 1517 | struct smc_sock *smc; |
| 1463 | − int rc; | |
| 1464 | 1518 | |
| 1465 | 1519 | if (!sk) |
| 1466 | 1520 | return EPOLLNVAL; |
| 1467 | 1521 | |
| 1468 | 1522 | smc = smc_sk(sock->sk); |
| 1469 | − sock_hold(sk); | |
| 1470 | − lock_sock(sk); | |
| 1471 | 1523 | if ((sk->sk_state == SMC_INIT) || smc->use_fallback) { |
| 1472 | 1524 | /* delegate to CLC child sock */ |
| 1473 | − release_sock(sk); | |
| 1474 | − mask = smc->clcsock->ops->poll_mask(smc->clcsock, events); | |
| 1475 | − lock_sock(sk); | |
| 1525 | + mask = smc->clcsock->ops->poll(file, smc->clcsock, wait); | |
| 1476 | 1526 | sk->sk_err = smc->clcsock->sk->sk_err; |
| 1477 | − if (sk->sk_err) { | |
| 1527 | + if (sk->sk_err) | |
| 1478 | 1528 | mask |= EPOLLERR; |
| 1479 | − } else { | |
| 1480 | − /* if non-blocking connect finished ... */ | |
| 1481 | − if (sk->sk_state == SMC_INIT && | |
| 1482 | − mask & EPOLLOUT && | |
| 1483 | − smc->clcsock->sk->sk_state != TCP_CLOSE) { | |
| 1484 | − rc = __smc_connect(smc); | |
| 1485 | − if (rc < 0) | |
| 1486 | − mask |= EPOLLERR; | |
| 1487 | − /* success cases including fallback */ | |
| 1488 | − mask |= EPOLLOUT | EPOLLWRNORM; | |
| 1489 | − } | |
| 1490 | − } | |
| 1491 | 1529 | } else { |
| 1492 | 1530 | if (sk->sk_err) |
| 1493 | 1531 | mask |= EPOLLERR; |
| @@ -1516,8 +1554,6 @@ static __poll_t smc_poll_mask(struct socket *sock, __poll_t events) · 22 unmodified lines | ||
| 1516 | 1554 | mask |= EPOLLPRI; |
| 1517 | 1555 | |
| 1518 | 1556 | } |
| 1519 | − release_sock(sk); | |
| 1520 | − sock_put(sk); | |
| 1521 | 1557 | |
| 1522 | 1558 | return mask; |
| 1523 | 1559 | } |
| @@ -1801,7 +1837,7 @@ static const struct proto_ops smc_sock_ops = { · 277 unmodified lines | ||
| 1801 | 1837 | .socketpair = sock_no_socketpair, |
| 1802 | 1838 | .accept = smc_accept, |
| 1803 | 1839 | .getname = smc_getname, |
| 1804 | − .poll_mask = smc_poll_mask, | |
| 1840 | + .poll = smc_poll, | |
| 1805 | 1841 | .ioctl = smc_ioctl, |
| 1806 | 1842 | .listen = smc_listen, |
| 1807 | 1843 | .shutdown = smc_shutdown, |
| @@ -190,11 +190,19 @@ struct smc_connection { · 189 unmodified lines | ||
| 190 | 190 | u64 peer_token; /* SMC-D token of peer */ |
| 191 | 191 | }; |
| 192 | 192 | |
| 193 | +struct smc_connect_info { | |
| 194 | + int flags; | |
| 195 | + int alen; | |
| 196 | + struct sockaddr addr; | |
| 197 | +}; | |
| 198 | + | |
| 193 | 199 | struct smc_sock { /* smc sock container */ |
| 194 | 200 | struct sock sk; |
| 195 | 201 | struct socket *clcsock; /* internal tcp socket */ |
| 196 | 202 | struct smc_connection conn; /* smc connection */ |
| 197 | 203 | struct smc_sock *listen_smc; /* listen parent */ |
| 204 | + struct smc_connect_info *connect_info; /* connect address & flags */ | |
| 205 | + struct work_struct connect_work; /* handle non-blocking connect*/ | |
| 198 | 206 | struct work_struct tcp_listen_work;/* handle tcp socket accepts */ |
| 199 | 207 | struct work_struct smc_listen_work;/* prepare new accept socket */ |
| 200 | 208 | struct list_head accept_q; /* sockets to be accepted */ |
| @@ -117,10 +117,8 @@ static ssize_t sock_write_iter(struct kiocb *iocb, struct iov_iter *from); · 116 unmodified lines | ||
| 117 | 117 | static int sock_mmap(struct file *file, struct vm_area_struct *vma); |
| 118 | 118 | |
| 119 | 119 | static int sock_close(struct inode *inode, struct file *file); |
| 120 | −static struct wait_queue_head *sock_get_poll_head(struct file *file, | |
| 121 | − __poll_t events); | |
| 122 | −static __poll_t sock_poll_mask(struct file *file, __poll_t); | |
| 123 | −static __poll_t sock_poll(struct file *file, struct poll_table_struct *wait); | |
| 120 | +static __poll_t sock_poll(struct file *file, | |
| 121 | + struct poll_table_struct *wait); | |
| 124 | 122 | static long sock_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
| 125 | 123 | #ifdef CONFIG_COMPAT |
| 126 | 124 | static long compat_sock_ioctl(struct file *file, |
| @@ -143,8 +141,6 @@ static const struct file_operations socket_file_ops = { · 16 unmodified lines | ||
| 143 | 141 | .llseek = no_llseek, |
| 144 | 142 | .read_iter = sock_read_iter, |
| 145 | 143 | .write_iter = sock_write_iter, |
| 146 | − .get_poll_head = sock_get_poll_head, | |
| 147 | − .poll_mask = sock_poll_mask, | |
| 148 | 144 | .poll = sock_poll, |
| 149 | 145 | .unlocked_ioctl = sock_ioctl, |
| 150 | 146 | #ifdef CONFIG_COMPAT |
| @@ -1130,48 +1126,16 @@ out_release: · 979 unmodified lines | ||
| 1130 | 1126 | } |
| 1131 | 1127 | EXPORT_SYMBOL(sock_create_lite); |
| 1132 | 1128 | |
| 1133 | −static struct wait_queue_head *sock_get_poll_head(struct file *file, | |
| 1134 | − __poll_t events) | |
| 1135 | −{ | |
| 1136 | − struct socket *sock = file->private_data; | |
| 1137 | − | |
| 1138 | − if (!sock->ops->poll_mask) | |
| 1139 | − return NULL; | |
| 1140 | − sock_poll_busy_loop(sock, events); | |
| 1141 | − return sk_sleep(sock->sk); | |
| 1142 | −} | |
| 1143 | − | |
| 1144 | −static __poll_t sock_poll_mask(struct file *file, __poll_t events) | |
| 1145 | −{ | |
| 1146 | − struct socket *sock = file->private_data; | |
| 1147 | − | |
| 1148 | − /* | |
| 1149 | − * We need to be sure we are in sync with the socket flags modification. | |
| 1150 | − * | |
| 1151 | − * This memory barrier is paired in the wq_has_sleeper. | |
| 1152 | − */ | |
| 1153 | − smp_mb(); | |
| 1154 | − | |
| 1155 | − /* this socket can poll_ll so tell the system call */ | |
| 1156 | − return sock->ops->poll_mask(sock, events) | | |
| 1157 | − (sk_can_busy_loop(sock->sk) ? POLL_BUSY_LOOP : 0); | |
| 1158 | −} | |
| 1159 | − | |
| 1160 | 1129 | /* No kernel lock held - perfect */ |
| 1161 | 1130 | static __poll_t sock_poll(struct file *file, poll_table *wait) |
| 1162 | 1131 | { |
| 1163 | 1132 | struct socket *sock = file->private_data; |
| 1164 | − __poll_t events = poll_requested_events(wait), mask = 0; | |
| 1165 | − | |
| 1166 | − if (sock->ops->poll) { | |
| 1167 | − sock_poll_busy_loop(sock, events); | |
| 1168 | − mask = sock->ops->poll(file, sock, wait); | |
| 1169 | − } else if (sock->ops->poll_mask) { | |
| 1170 | − sock_poll_wait(file, sock_get_poll_head(file, events), wait); | |
| 1171 | − mask = sock->ops->poll_mask(sock, events); | |
| 1172 | − } | |
| 1133 | + __poll_t events = poll_requested_events(wait); | |
| 1173 | 1134 | |
| 1174 | − return mask | sock_poll_busy_flag(sock); | |
| 1135 | + sock_poll_busy_loop(sock, events); | |
| 1136 | + if (!sock->ops->poll) | |
| 1137 | + return 0; | |
| 1138 | + return sock->ops->poll(file, sock, wait) | sock_poll_busy_flag(sock); | |
| 1175 | 1139 | } |
| 1176 | 1140 | |
| 1177 | 1141 | static int sock_mmap(struct file *file, struct vm_area_struct *vma) |
| @@ -35,7 +35,6 @@ struct _strp_msg { · 34 unmodified lines | ||
| 35 | 35 | */ |
| 36 | 36 | struct strp_msg strp; |
| 37 | 37 | int accum_len; |
| 38 | − int early_eaten; | |
| 39 | 38 | }; |
| 40 | 39 | |
| 41 | 40 | static inline struct _strp_msg *_strp_msg(struct sk_buff *skb) |
| @@ -115,20 +114,6 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb, · 73 unmodified lines | ||
| 115 | 114 | head = strp->skb_head; |
| 116 | 115 | if (head) { |
| 117 | 116 | /* Message already in progress */ |
| 118 | − | |
| 119 | − stm = _strp_msg(head); | |
| 120 | − if (unlikely(stm->early_eaten)) { | |
| 121 | − /* Already some number of bytes on the receive sock | |
| 122 | − * data saved in skb_head, just indicate they | |
| 123 | − * are consumed. | |
| 124 | − */ | |
| 125 | − eaten = orig_len <= stm->early_eaten ? | |
| 126 | − orig_len : stm->early_eaten; | |
| 127 | − stm->early_eaten -= eaten; | |
| 128 | − | |
| 129 | − return eaten; | |
| 130 | − } | |
| 131 | − | |
| 132 | 117 | if (unlikely(orig_offset)) { |
| 133 | 118 | /* Getting data with a non-zero offset when a message is |
| 134 | 119 | * in progress is not expected. If it does happen, we |
| @@ -301,9 +286,9 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb, · 166 unmodified lines | ||
| 301 | 286 | } |
| 302 | 287 | |
| 303 | 288 | stm->accum_len += cand_len; |
| 289 | + eaten += cand_len; | |
| 304 | 290 | strp->need_bytes = stm->strp.full_len - |
| 305 | 291 | stm->accum_len; |
| 306 | − stm->early_eaten = cand_len; | |
| 307 | 292 | STRP_STATS_ADD(strp->stats.bytes, cand_len); |
| 308 | 293 | desc->count = 0; /* Stop reading socket */ |
| 309 | 294 | break; |
| @@ -692,9 +692,10 @@ static int tipc_getname(struct socket *sock, struct sockaddr *uaddr, · 691 unmodified lines | ||
| 692 | 692 | } |
| 693 | 693 | |
| 694 | 694 | /** |
| 695 | − * tipc_poll - read pollmask | |
| 695 | + * tipc_poll - read and possibly block on pollmask | |
| 696 | 696 | * @file: file structure associated with the socket |
| 697 | 697 | * @sock: socket for which to calculate the poll bits |
| 698 | + * @wait: ??? | |
| 698 | 699 | * |
| 699 | 700 | * Returns pollmask value |
| 700 | 701 | * |
| @@ -708,12 +709,15 @@ static int tipc_getname(struct socket *sock, struct sockaddr *uaddr, · 7 unmodified lines | ||
| 708 | 709 | * imply that the operation will succeed, merely that it should be performed |
| 709 | 710 | * and will not block. |
| 710 | 711 | */ |
| 711 | −static __poll_t tipc_poll_mask(struct socket *sock, __poll_t events) | |
| 712 | +static __poll_t tipc_poll(struct file *file, struct socket *sock, | |
| 713 | + poll_table *wait) | |
| 712 | 714 | { |
| 713 | 715 | struct sock *sk = sock->sk; |
| 714 | 716 | struct tipc_sock *tsk = tipc_sk(sk); |
| 715 | 717 | __poll_t revents = 0; |
| 716 | 718 | |
| 719 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 720 | + | |
| 717 | 721 | if (sk->sk_shutdown & RCV_SHUTDOWN) |
| 718 | 722 | revents |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM; |
| 719 | 723 | if (sk->sk_shutdown == SHUTDOWN_MASK) |
| @@ -3033,7 +3037,7 @@ static const struct proto_ops msg_ops = { · 2313 unmodified lines | ||
| 3033 | 3037 | .socketpair = tipc_socketpair, |
| 3034 | 3038 | .accept = sock_no_accept, |
| 3035 | 3039 | .getname = tipc_getname, |
| 3036 | − .poll_mask = tipc_poll_mask, | |
| 3040 | + .poll = tipc_poll, | |
| 3037 | 3041 | .ioctl = tipc_ioctl, |
| 3038 | 3042 | .listen = sock_no_listen, |
| 3039 | 3043 | .shutdown = tipc_shutdown, |
| @@ -3054,7 +3058,7 @@ static const struct proto_ops packet_ops = { · 14 unmodified lines | ||
| 3054 | 3058 | .socketpair = tipc_socketpair, |
| 3055 | 3059 | .accept = tipc_accept, |
| 3056 | 3060 | .getname = tipc_getname, |
| 3057 | − .poll_mask = tipc_poll_mask, | |
| 3061 | + .poll = tipc_poll, | |
| 3058 | 3062 | .ioctl = tipc_ioctl, |
| 3059 | 3063 | .listen = tipc_listen, |
| 3060 | 3064 | .shutdown = tipc_shutdown, |
| @@ -3075,7 +3079,7 @@ static const struct proto_ops stream_ops = { · 14 unmodified lines | ||
| 3075 | 3079 | .socketpair = tipc_socketpair, |
| 3076 | 3080 | .accept = tipc_accept, |
| 3077 | 3081 | .getname = tipc_getname, |
| 3078 | − .poll_mask = tipc_poll_mask, | |
| 3082 | + .poll = tipc_poll, | |
| 3079 | 3083 | .ioctl = tipc_ioctl, |
| 3080 | 3084 | .listen = tipc_listen, |
| 3081 | 3085 | .shutdown = tipc_shutdown, |
| @@ -712,7 +712,7 @@ static int __init tls_register(void) · 711 unmodified lines | ||
| 712 | 712 | build_protos(tls_prots[TLSV4], &tcp_prot); |
| 713 | 713 | |
| 714 | 714 | tls_sw_proto_ops = inet_stream_ops; |
| 715 | − tls_sw_proto_ops.poll_mask = tls_sw_poll_mask; | |
| 715 | + tls_sw_proto_ops.poll = tls_sw_poll; | |
| 716 | 716 | tls_sw_proto_ops.splice_read = tls_sw_splice_read; |
| 717 | 717 | |
| 718 | 718 | #ifdef CONFIG_TLS_DEVICE |
| @@ -919,22 +919,23 @@ splice_read_end: · 918 unmodified lines | ||
| 919 | 919 | return copied ? : err; |
| 920 | 920 | } |
| 921 | 921 | |
| 922 | −__poll_t tls_sw_poll_mask(struct socket *sock, __poll_t events) | |
| 922 | +unsigned int tls_sw_poll(struct file *file, struct socket *sock, | |
| 923 | + struct poll_table_struct *wait) | |
| 923 | 924 | { |
| 925 | + unsigned int ret; | |
| 924 | 926 | struct sock *sk = sock->sk; |
| 925 | 927 | struct tls_context *tls_ctx = tls_get_ctx(sk); |
| 926 | 928 | struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); |
| 927 | − __poll_t mask; | |
| 928 | 929 | |
| 929 | − /* Grab EPOLLOUT and EPOLLHUP from the underlying socket */ | |
| 930 | − mask = ctx->sk_poll_mask(sock, events); | |
| 930 | + /* Grab POLLOUT and POLLHUP from the underlying socket */ | |
| 931 | + ret = ctx->sk_poll(file, sock, wait); | |
| 931 | 932 | |
| 932 | − /* Clear EPOLLIN bits, and set based on recv_pkt */ | |
| 933 | − mask &= ~(EPOLLIN | EPOLLRDNORM); | |
| 933 | + /* Clear POLLIN bits, and set based on recv_pkt */ | |
| 934 | + ret &= ~(POLLIN | POLLRDNORM); | |
| 934 | 935 | if (ctx->recv_pkt) |
| 935 | − mask |= EPOLLIN | EPOLLRDNORM; | |
| 936 | + ret |= POLLIN | POLLRDNORM; | |
| 936 | 937 | |
| 937 | − return mask; | |
| 938 | + return ret; | |
| 938 | 939 | } |
| 939 | 940 | |
| 940 | 941 | static int tls_read_size(struct strparser *strp, struct sk_buff *skb) |
| @@ -1194,7 +1195,7 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx) · 253 unmodified lines | ||
| 1194 | 1195 | sk->sk_data_ready = tls_data_ready; |
| 1195 | 1196 | write_unlock_bh(&sk->sk_callback_lock); |
| 1196 | 1197 | |
| 1197 | − sw_ctx_rx->sk_poll_mask = sk->sk_socket->ops->poll_mask; | |
| 1198 | + sw_ctx_rx->sk_poll = sk->sk_socket->ops->poll; | |
| 1198 | 1199 | |
| 1199 | 1200 | strp_check_rcv(&sw_ctx_rx->strp); |
| 1200 | 1201 | } |
| @@ -638,8 +638,9 @@ static int unix_stream_connect(struct socket *, struct sockaddr *, · 637 unmodified lines | ||
| 638 | 638 | static int unix_socketpair(struct socket *, struct socket *); |
| 639 | 639 | static int unix_accept(struct socket *, struct socket *, int, bool); |
| 640 | 640 | static int unix_getname(struct socket *, struct sockaddr *, int); |
| 641 | −static __poll_t unix_poll_mask(struct socket *, __poll_t); | |
| 642 | −static __poll_t unix_dgram_poll_mask(struct socket *, __poll_t); | |
| 641 | +static __poll_t unix_poll(struct file *, struct socket *, poll_table *); | |
| 642 | +static __poll_t unix_dgram_poll(struct file *, struct socket *, | |
| 643 | + poll_table *); | |
| 643 | 644 | static int unix_ioctl(struct socket *, unsigned int, unsigned long); |
| 644 | 645 | static int unix_shutdown(struct socket *, int); |
| 645 | 646 | static int unix_stream_sendmsg(struct socket *, struct msghdr *, size_t); |
| @@ -680,7 +681,7 @@ static const struct proto_ops unix_stream_ops = { · 34 unmodified lines | ||
| 680 | 681 | .socketpair = unix_socketpair, |
| 681 | 682 | .accept = unix_accept, |
| 682 | 683 | .getname = unix_getname, |
| 683 | − .poll_mask = unix_poll_mask, | |
| 684 | + .poll = unix_poll, | |
| 684 | 685 | .ioctl = unix_ioctl, |
| 685 | 686 | .listen = unix_listen, |
| 686 | 687 | .shutdown = unix_shutdown, |
| @@ -703,7 +704,7 @@ static const struct proto_ops unix_dgram_ops = { · 16 unmodified lines | ||
| 703 | 704 | .socketpair = unix_socketpair, |
| 704 | 705 | .accept = sock_no_accept, |
| 705 | 706 | .getname = unix_getname, |
| 706 | − .poll_mask = unix_dgram_poll_mask, | |
| 707 | + .poll = unix_dgram_poll, | |
| 707 | 708 | .ioctl = unix_ioctl, |
| 708 | 709 | .listen = sock_no_listen, |
| 709 | 710 | .shutdown = unix_shutdown, |
| @@ -725,7 +726,7 @@ static const struct proto_ops unix_seqpacket_ops = { · 15 unmodified lines | ||
| 725 | 726 | .socketpair = unix_socketpair, |
| 726 | 727 | .accept = unix_accept, |
| 727 | 728 | .getname = unix_getname, |
| 728 | − .poll_mask = unix_dgram_poll_mask, | |
| 729 | + .poll = unix_dgram_poll, | |
| 729 | 730 | .ioctl = unix_ioctl, |
| 730 | 731 | .listen = unix_listen, |
| 731 | 732 | .shutdown = unix_shutdown, |
| @@ -2629,10 +2630,13 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) · 1897 unmodified lines | ||
| 2629 | 2630 | return err; |
| 2630 | 2631 | } |
| 2631 | 2632 | |
| 2632 | −static __poll_t unix_poll_mask(struct socket *sock, __poll_t events) | |
| 2633 | +static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wait) | |
| 2633 | 2634 | { |
| 2634 | 2635 | struct sock *sk = sock->sk; |
| 2635 | − __poll_t mask = 0; | |
| 2636 | + __poll_t mask; | |
| 2637 | + | |
| 2638 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 2639 | + mask = 0; | |
| 2636 | 2640 | |
| 2637 | 2641 | /* exceptional events? */ |
| 2638 | 2642 | if (sk->sk_err) |
| @@ -2661,11 +2665,15 @@ static __poll_t unix_poll_mask(struct socket *sock, __poll_t events) · 22 unmodified lines | ||
| 2661 | 2665 | return mask; |
| 2662 | 2666 | } |
| 2663 | 2667 | |
| 2664 | −static __poll_t unix_dgram_poll_mask(struct socket *sock, __poll_t events) | |
| 2668 | +static __poll_t unix_dgram_poll(struct file *file, struct socket *sock, | |
| 2669 | + poll_table *wait) | |
| 2665 | 2670 | { |
| 2666 | 2671 | struct sock *sk = sock->sk, *other; |
| 2667 | − int writable; | |
| 2668 | − __poll_t mask = 0; | |
| 2672 | + unsigned int writable; | |
| 2673 | + __poll_t mask; | |
| 2674 | + | |
| 2675 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 2676 | + mask = 0; | |
| 2669 | 2677 | |
| 2670 | 2678 | /* exceptional events? */ |
| 2671 | 2679 | if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) |
| @@ -2691,7 +2699,7 @@ static __poll_t unix_dgram_poll_mask(struct socket *sock, __poll_t events) · 19 unmodified lines | ||
| 2691 | 2699 | } |
| 2692 | 2700 | |
| 2693 | 2701 | /* No write status requested, avoid expensive OUT tests. */ |
| 2694 | − if (!(events & (EPOLLWRBAND|EPOLLWRNORM|EPOLLOUT))) | |
| 2702 | + if (!(poll_requested_events(wait) & (EPOLLWRBAND|EPOLLWRNORM|EPOLLOUT))) | |
| 2695 | 2703 | return mask; |
| 2696 | 2704 | |
| 2697 | 2705 | writable = unix_writable(sk); |
| @@ -850,11 +850,18 @@ static int vsock_shutdown(struct socket *sock, int mode) · 849 unmodified lines | ||
| 850 | 850 | return err; |
| 851 | 851 | } |
| 852 | 852 | |
| 853 | −static __poll_t vsock_poll_mask(struct socket *sock, __poll_t events) | |
| 853 | +static __poll_t vsock_poll(struct file *file, struct socket *sock, | |
| 854 | + poll_table *wait) | |
| 854 | 855 | { |
| 855 | − struct sock *sk = sock->sk; | |
| 856 | − struct vsock_sock *vsk = vsock_sk(sk); | |
| 857 | − __poll_t mask = 0; | |
| 856 | + struct sock *sk; | |
| 857 | + __poll_t mask; | |
| 858 | + struct vsock_sock *vsk; | |
| 859 | + | |
| 860 | + sk = sock->sk; | |
| 861 | + vsk = vsock_sk(sk); | |
| 862 | + | |
| 863 | + poll_wait(file, sk_sleep(sk), wait); | |
| 864 | + mask = 0; | |
| 858 | 865 | |
| 859 | 866 | if (sk->sk_err) |
| 860 | 867 | /* Signify that there has been an error on this socket. */ |
| @@ -1084,7 +1091,7 @@ static const struct proto_ops vsock_dgram_ops = { · 223 unmodified lines | ||
| 1084 | 1091 | .socketpair = sock_no_socketpair, |
| 1085 | 1092 | .accept = sock_no_accept, |
| 1086 | 1093 | .getname = vsock_getname, |
| 1087 | − .poll_mask = vsock_poll_mask, | |
| 1094 | + .poll = vsock_poll, | |
| 1088 | 1095 | .ioctl = sock_no_ioctl, |
| 1089 | 1096 | .listen = sock_no_listen, |
| 1090 | 1097 | .shutdown = vsock_shutdown, |
| @@ -1842,7 +1849,7 @@ static const struct proto_ops vsock_stream_ops = { · 751 unmodified lines | ||
| 1842 | 1849 | .socketpair = sock_no_socketpair, |
| 1843 | 1850 | .accept = vsock_accept, |
| 1844 | 1851 | .getname = vsock_getname, |
| 1845 | − .poll_mask = vsock_poll_mask, | |
| 1852 | + .poll = vsock_poll, | |
| 1846 | 1853 | .ioctl = sock_no_ioctl, |
| 1847 | 1854 | .listen = vsock_listen, |
| 1848 | 1855 | .shutdown = vsock_shutdown, |
| @@ -6329,7 +6329,7 @@ do { \ · 6328 unmodified lines | ||
| 6329 | 6329 | nl80211_check_s32); |
| 6330 | 6330 | /* |
| 6331 | 6331 | * Check HT operation mode based on |
| 6332 | − * IEEE 802.11 2012 8.4.2.59 HT Operation element. | |
| 6332 | + * IEEE 802.11-2016 9.4.2.57 HT Operation element. | |
| 6333 | 6333 | */ |
| 6334 | 6334 | if (tb[NL80211_MESHCONF_HT_OPMODE]) { |
| 6335 | 6335 | ht_opmode = nla_get_u16(tb[NL80211_MESHCONF_HT_OPMODE]); |
| @@ -6339,22 +6339,9 @@ do { \ · 3 unmodified lines | ||
| 6339 | 6339 | IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)) |
| 6340 | 6340 | return -EINVAL; |
| 6341 | 6341 | |
| 6342 | − if ((ht_opmode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) && | |
| 6343 | − (ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)) | |
| 6344 | − return -EINVAL; | |
| 6342 | + /* NON_HT_STA bit is reserved, but some programs set it */ | |
| 6343 | + ht_opmode &= ~IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT; | |
| 6345 | 6344 | |
| 6346 | − switch (ht_opmode & IEEE80211_HT_OP_MODE_PROTECTION) { | |
| 6347 | − case IEEE80211_HT_OP_MODE_PROTECTION_NONE: | |
| 6348 | − case IEEE80211_HT_OP_MODE_PROTECTION_20MHZ: | |
| 6349 | − if (ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT) | |
| 6350 | − return -EINVAL; | |
| 6351 | − break; | |
| 6352 | − case IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER: | |
| 6353 | − case IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED: | |
| 6354 | − if (!(ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)) | |
| 6355 | − return -EINVAL; | |
| 6356 | − break; | |
| 6357 | − } | |
| 6358 | 6345 | cfg->ht_opmode = ht_opmode; |
| 6359 | 6346 | mask |= (1 << (NL80211_MESHCONF_HT_OPMODE - 1)); |
| 6360 | 6347 | } |
| @@ -11068,9 +11055,12 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info) · 4707 unmodified lines | ||
| 11068 | 11055 | rem) { |
| 11069 | 11056 | u8 *mask_pat; |
| 11070 | 11057 | |
| 11071 | − nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, | |
| 11072 | − nl80211_packet_pattern_policy, | |
| 11073 | − info->extack); | |
| 11058 | + err = nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, | |
| 11059 | + nl80211_packet_pattern_policy, | |
| 11060 | + info->extack); | |
| 11061 | + if (err) | |
| 11062 | + goto error; | |
| 11063 | + | |
| 11074 | 11064 | err = -EINVAL; |
| 11075 | 11065 | if (!pat_tb[NL80211_PKTPAT_MASK] || |
| 11076 | 11066 | !pat_tb[NL80211_PKTPAT_PATTERN]) |
| @@ -11319,8 +11309,11 @@ static int nl80211_parse_coalesce_rule(struct cfg80211_registered_device *rdev, · 242 unmodified lines | ||
| 11319 | 11309 | rem) { |
| 11320 | 11310 | u8 *mask_pat; |
| 11321 | 11311 | |
| 11322 | − nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, | |
| 11323 | − nl80211_packet_pattern_policy, NULL); | |
| 11312 | + err = nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, | |
| 11313 | + nl80211_packet_pattern_policy, NULL); | |
| 11314 | + if (err) | |
| 11315 | + return err; | |
| 11316 | + | |
| 11324 | 11317 | if (!pat_tb[NL80211_PKTPAT_MASK] || |
| 11325 | 11318 | !pat_tb[NL80211_PKTPAT_PATTERN]) |
| 11326 | 11319 | return -EINVAL; |
| @@ -1750,7 +1750,7 @@ static const struct proto_ops x25_proto_ops = { · 1749 unmodified lines | ||
| 1750 | 1750 | .socketpair = sock_no_socketpair, |
| 1751 | 1751 | .accept = x25_accept, |
| 1752 | 1752 | .getname = x25_getname, |
| 1753 | − .poll_mask = datagram_poll_mask, | |
| 1753 | + .poll = datagram_poll, | |
| 1754 | 1754 | .ioctl = x25_ioctl, |
| 1755 | 1755 | #ifdef CONFIG_COMPAT |
| 1756 | 1756 | .compat_ioctl = compat_x25_ioctl, |
| @@ -303,9 +303,10 @@ static int xsk_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len) · 302 unmodified lines | ||
| 303 | 303 | return (xs->zc) ? xsk_zc_xmit(sk) : xsk_generic_xmit(sk, m, total_len); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | −static __poll_t xsk_poll_mask(struct socket *sock, __poll_t events) | |
| 306 | +static unsigned int xsk_poll(struct file *file, struct socket *sock, | |
| 307 | + struct poll_table_struct *wait) | |
| 307 | 308 | { |
| 308 | − __poll_t mask = datagram_poll_mask(sock, events); | |
| 309 | + unsigned int mask = datagram_poll(file, sock, wait); | |
| 309 | 310 | struct sock *sk = sock->sk; |
| 310 | 311 | struct xdp_sock *xs = xdp_sk(sk); |
| 311 | 312 | |
| @@ -696,7 +697,7 @@ static const struct proto_ops xsk_proto_ops = { · 384 unmodified lines | ||
| 696 | 697 | .socketpair = sock_no_socketpair, |
| 697 | 698 | .accept = sock_no_accept, |
| 698 | 699 | .getname = sock_no_getname, |
| 699 | − .poll_mask = xsk_poll_mask, | |
| 700 | + .poll = xsk_poll, | |
| 700 | 701 | .ioctl = sock_no_ioctl, |
| 701 | 702 | .listen = sock_no_listen, |
| 702 | 703 | .shutdown = sock_no_shutdown, |
| @@ -48,9 +48,9 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags) · 47 unmodified lines | ||
| 48 | 48 | struct ethhdr *eth = data; |
| 49 | 49 | struct ipv6hdr *ip6h; |
| 50 | 50 | struct iphdr *iph; |
| 51 | − int out_index; | |
| 52 | 51 | u16 h_proto; |
| 53 | 52 | u64 nh_off; |
| 53 | + int rc; | |
| 54 | 54 | |
| 55 | 55 | nh_off = sizeof(*eth); |
| 56 | 56 | if (data + nh_off > data_end) |
| @@ -101,7 +101,7 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags) · 44 unmodified lines | ||
| 101 | 101 | |
| 102 | 102 | fib_params.ifindex = ctx->ingress_ifindex; |
| 103 | 103 | |
| 104 | − out_index = bpf_fib_lookup(ctx, &fib_params, sizeof(fib_params), flags); | |
| 104 | + rc = bpf_fib_lookup(ctx, &fib_params, sizeof(fib_params), flags); | |
| 105 | 105 | |
| 106 | 106 | /* verify egress index has xdp support |
| 107 | 107 | * TO-DO bpf_map_lookup_elem(&tx_port, &key) fails with |
| @@ -109,7 +109,7 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags) · 1 unmodified line | ||
| 109 | 109 | * NOTE: without verification that egress index supports XDP |
| 110 | 110 | * forwarding packets are dropped. |
| 111 | 111 | */ |
| 112 | − if (out_index > 0) { | |
| 112 | + if (rc == 0) { | |
| 113 | 113 | if (h_proto == htons(ETH_P_IP)) |
| 114 | 114 | ip_decrease_ttl(iph); |
| 115 | 115 | else if (h_proto == htons(ETH_P_IPV6)) |
| @@ -117,7 +117,7 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags) · 1 unmodified line | ||
| 117 | 117 | |
| 118 | 118 | memcpy(eth->h_dest, fib_params.dmac, ETH_ALEN); |
| 119 | 119 | memcpy(eth->h_source, fib_params.smac, ETH_ALEN); |
| 120 | − return bpf_redirect_map(&tx_port, out_index, 0); | |
| 120 | + return bpf_redirect_map(&tx_port, fib_params.ifindex, 0); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | return XDP_PASS; |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | #!/bin/sh |
| 2 | 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | 3 | |
| 4 | −cat << "END" | $@ -x c - -o /dev/null >/dev/null 2>&1 && echo "y" | |
| 4 | +cat << "END" | $@ -x c - -o /dev/null >/dev/null 2>&1 | |
| 5 | 5 | #include <stdio.h> |
| 6 | 6 | int main(void) |
| 7 | 7 | { |
| @@ -2606,12 +2606,6 @@ sub process { · 2605 unmodified lines | ||
| 2606 | 2606 | "A patch subject line should describe the change not the tool that found it\n" . $herecurr); |
| 2607 | 2607 | } |
| 2608 | 2608 | |
| 2609 | −# Check for old stable address | |
| 2610 | − if ($line =~ /^\s*cc:\s*.*<?\bstable\@kernel\.org\b>?.*$/i) { | |
| 2611 | − ERROR("STABLE_ADDRESS", | |
| 2612 | − "The 'stable' address should be 'stable\@vger.kernel.org'\n" . $herecurr); | |
| 2613 | − } | |
| 2614 | − | |
| 2615 | 2609 | # Check for unwanted Gerrit info |
| 2616 | 2610 | if ($in_commit_log && $line =~ /^\s*change-id:/i) { |
| 2617 | 2611 | ERROR("GERRIT_CHANGE_ID", |
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | #!/bin/sh |
| 2 | 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | 3 | |
| 4 | −echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs" | |
| 4 | +echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -m64 -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs" | |
| @@ -171,6 +171,9 @@ struct symbol { · 170 unmodified lines | ||
| 171 | 171 | * config BAZ |
| 172 | 172 | * int "BAZ Value" |
| 173 | 173 | * range 1..255 |
| 174 | + * | |
| 175 | + * Please, also check zconf.y:print_symbol() when modifying the | |
| 176 | + * list of property types! | |
| 174 | 177 | */ |
| 175 | 178 | enum prop_type { |
| 176 | 179 | P_UNKNOWN, |
| @@ -156,7 +156,7 @@ static char *do_shell(int argc, char *argv[]) · 155 unmodified lines | ||
| 156 | 156 | nread--; |
| 157 | 157 | |
| 158 | 158 | /* remove trailing new lines */ |
| 159 | − while (buf[nread - 1] == '\n') | |
| 159 | + while (nread > 0 && buf[nread - 1] == '\n') | |
| 160 | 160 | nread--; |
| 161 | 161 | |
| 162 | 162 | buf[nread] = 0; |
| @@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE]; · 30 unmodified lines | ||
| 31 | 31 | static struct menu *current_menu, *current_entry; |
| 32 | 32 | |
| 33 | 33 | %} |
| 34 | −%expect 32 | |
| 34 | +%expect 31 | |
| 35 | 35 | |
| 36 | 36 | %union |
| 37 | 37 | { |
| @@ -337,7 +337,7 @@ choice_block: · 299 unmodified lines | ||
| 337 | 337 | |
| 338 | 338 | /* if entry */ |
| 339 | 339 | |
| 340 | −if_entry: T_IF expr nl | |
| 340 | +if_entry: T_IF expr T_EOL | |
| 341 | 341 | { |
| 342 | 342 | printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); |
| 343 | 343 | menu_add_entry(NULL); |
| @@ -717,6 +717,10 @@ static void print_symbol(FILE *out, struct menu *menu) · 373 unmodified lines | ||
| 717 | 717 | print_quoted_string(out, prop->text); |
| 718 | 718 | fputc('\n', out); |
| 719 | 719 | break; |
| 720 | + case P_SYMBOL: | |
| 721 | + fputs( " symbol ", out); | |
| 722 | + fprintf(out, "%s\n", prop->sym->name); | |
| 723 | + break; | |
| 720 | 724 | default: |
| 721 | 725 | fprintf(out, " unknown prop %d!\n", prop->type); |
| 722 | 726 | break; |
| @@ -142,6 +142,8 @@ static void kdf_dealloc(struct kdf_sdesc *sdesc) · 141 unmodified lines | ||
| 142 | 142 | * The src pointer is defined as Z || other info where Z is the shared secret |
| 143 | 143 | * from DH and other info is an arbitrary string (see SP800-56A section |
| 144 | 144 | * 5.8.1.2). |
| 145 | + * | |
| 146 | + * 'dlen' must be a multiple of the digest size. | |
| 145 | 147 | */ |
| 146 | 148 | static int kdf_ctr(struct kdf_sdesc *sdesc, const u8 *src, unsigned int slen, |
| 147 | 149 | u8 *dst, unsigned int dlen, unsigned int zlen) |
| @@ -205,8 +207,8 @@ static int keyctl_dh_compute_kdf(struct kdf_sdesc *sdesc, · 57 unmodified lines | ||
| 205 | 207 | { |
| 206 | 208 | uint8_t *outbuf = NULL; |
| 207 | 209 | int ret; |
| 208 | − size_t outbuf_len = round_up(buflen, | |
| 209 | − crypto_shash_digestsize(sdesc->shash.tfm)); | |
| 210 | + size_t outbuf_len = roundup(buflen, | |
| 211 | + crypto_shash_digestsize(sdesc->shash.tfm)); | |
| 210 | 212 | |
| 211 | 213 | outbuf = kmalloc(outbuf_len, GFP_KERNEL); |
| 212 | 214 | if (!outbuf) { |
| @@ -441,22 +441,16 @@ static int sel_release_policy(struct inode *inode, struct file *filp) · 440 unmodified lines | ||
| 441 | 441 | static ssize_t sel_read_policy(struct file *filp, char __user *buf, |
| 442 | 442 | size_t count, loff_t *ppos) |
| 443 | 443 | { |
| 444 | − struct selinux_fs_info *fsi = file_inode(filp)->i_sb->s_fs_info; | |
| 445 | 444 | struct policy_load_memory *plm = filp->private_data; |
| 446 | 445 | int ret; |
| 447 | 446 | |
| 448 | − mutex_lock(&fsi->mutex); | |
| 449 | − | |
| 450 | 447 | ret = avc_has_perm(&selinux_state, |
| 451 | 448 | current_sid(), SECINITSID_SECURITY, |
| 452 | 449 | SECCLASS_SECURITY, SECURITY__READ_POLICY, NULL); |
| 453 | 450 | if (ret) |
| 454 | − goto out; | |
| 451 | + return ret; | |
| 455 | 452 | |
| 456 | − ret = simple_read_from_buffer(buf, count, ppos, plm->data, plm->len); | |
| 457 | −out: | |
| 458 | − mutex_unlock(&fsi->mutex); | |
| 459 | − return ret; | |
| 453 | + return simple_read_from_buffer(buf, count, ppos, plm->data, plm->len); | |
| 460 | 454 | } |
| 461 | 455 | |
| 462 | 456 | static vm_fault_t sel_mmap_policy_fault(struct vm_fault *vmf) |
| @@ -1188,25 +1182,29 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf, · 725 unmodified lines | ||
| 1188 | 1182 | ret = -EINVAL; |
| 1189 | 1183 | if (index >= fsi->bool_num || strcmp(name, |
| 1190 | 1184 | fsi->bool_pending_names[index])) |
| 1191 | − goto out; | |
| 1185 | + goto out_unlock; | |
| 1192 | 1186 | |
| 1193 | 1187 | ret = -ENOMEM; |
| 1194 | 1188 | page = (char *)get_zeroed_page(GFP_KERNEL); |
| 1195 | 1189 | if (!page) |
| 1196 | − goto out; | |
| 1190 | + goto out_unlock; | |
| 1197 | 1191 | |
| 1198 | 1192 | cur_enforcing = security_get_bool_value(fsi->state, index); |
| 1199 | 1193 | if (cur_enforcing < 0) { |
| 1200 | 1194 | ret = cur_enforcing; |
| 1201 | − goto out; | |
| 1195 | + goto out_unlock; | |
| 1202 | 1196 | } |
| 1203 | 1197 | length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing, |
| 1204 | 1198 | fsi->bool_pending_values[index]); |
| 1205 | − ret = simple_read_from_buffer(buf, count, ppos, page, length); | |
| 1206 | −out: | |
| 1207 | 1199 | mutex_unlock(&fsi->mutex); |
| 1200 | + ret = simple_read_from_buffer(buf, count, ppos, page, length); | |
| 1201 | +out_free: | |
| 1208 | 1202 | free_page((unsigned long)page); |
| 1209 | 1203 | return ret; |
| 1204 | + | |
| 1205 | +out_unlock: | |
| 1206 | + mutex_unlock(&fsi->mutex); | |
| 1207 | + goto out_free; | |
| 1210 | 1208 | } |
| 1211 | 1209 | |
| 1212 | 1210 | static ssize_t sel_write_bool(struct file *filep, const char __user *buf, |
| @@ -1219,6 +1217,17 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf, · 6 unmodified lines | ||
| 1219 | 1217 | unsigned index = file_inode(filep)->i_ino & SEL_INO_MASK; |
| 1220 | 1218 | const char *name = filep->f_path.dentry->d_name.name; |
| 1221 | 1219 | |
| 1220 | + if (count >= PAGE_SIZE) | |
| 1221 | + return -ENOMEM; | |
| 1222 | + | |
| 1223 | + /* No partial writes. */ | |
| 1224 | + if (*ppos != 0) | |
| 1225 | + return -EINVAL; | |
| 1226 | + | |
| 1227 | + page = memdup_user_nul(buf, count); | |
| 1228 | + if (IS_ERR(page)) | |
| 1229 | + return PTR_ERR(page); | |
| 1230 | + | |
| 1222 | 1231 | mutex_lock(&fsi->mutex); |
| 1223 | 1232 | |
| 1224 | 1233 | length = avc_has_perm(&selinux_state, |
| @@ -1233,22 +1242,6 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf, · 8 unmodified lines | ||
| 1233 | 1242 | fsi->bool_pending_names[index])) |
| 1234 | 1243 | goto out; |
| 1235 | 1244 | |
| 1236 | − length = -ENOMEM; | |
| 1237 | − if (count >= PAGE_SIZE) | |
| 1238 | − goto out; | |
| 1239 | − | |
| 1240 | − /* No partial writes. */ | |
| 1241 | − length = -EINVAL; | |
| 1242 | − if (*ppos != 0) | |
| 1243 | − goto out; | |
| 1244 | − | |
| 1245 | − page = memdup_user_nul(buf, count); | |
| 1246 | − if (IS_ERR(page)) { | |
| 1247 | − length = PTR_ERR(page); | |
| 1248 | − page = NULL; | |
| 1249 | − goto out; | |
| 1250 | − } | |
| 1251 | − | |
| 1252 | 1245 | length = -EINVAL; |
| 1253 | 1246 | if (sscanf(page, "%d", &new_value) != 1) |
| 1254 | 1247 | goto out; |
| @@ -1280,6 +1273,17 @@ static ssize_t sel_commit_bools_write(struct file *filep, · 25 unmodified lines | ||
| 1280 | 1273 | ssize_t length; |
| 1281 | 1274 | int new_value; |
| 1282 | 1275 | |
| 1276 | + if (count >= PAGE_SIZE) | |
| 1277 | + return -ENOMEM; | |
| 1278 | + | |
| 1279 | + /* No partial writes. */ | |
| 1280 | + if (*ppos != 0) | |
| 1281 | + return -EINVAL; | |
| 1282 | + | |
| 1283 | + page = memdup_user_nul(buf, count); | |
| 1284 | + if (IS_ERR(page)) | |
| 1285 | + return PTR_ERR(page); | |
| 1286 | + | |
| 1283 | 1287 | mutex_lock(&fsi->mutex); |
| 1284 | 1288 | |
| 1285 | 1289 | length = avc_has_perm(&selinux_state, |
| @@ -1289,22 +1293,6 @@ static ssize_t sel_commit_bools_write(struct file *filep, · 3 unmodified lines | ||
| 1289 | 1293 | if (length) |
| 1290 | 1294 | goto out; |
| 1291 | 1295 | |
| 1292 | − length = -ENOMEM; | |
| 1293 | − if (count >= PAGE_SIZE) | |
| 1294 | − goto out; | |
| 1295 | − | |
| 1296 | − /* No partial writes. */ | |
| 1297 | − length = -EINVAL; | |
| 1298 | − if (*ppos != 0) | |
| 1299 | − goto out; | |
| 1300 | − | |
| 1301 | − page = memdup_user_nul(buf, count); | |
| 1302 | − if (IS_ERR(page)) { | |
| 1303 | − length = PTR_ERR(page); | |
| 1304 | − page = NULL; | |
| 1305 | − goto out; | |
| 1306 | − } | |
| 1307 | − | |
| 1308 | 1296 | length = -EINVAL; |
| 1309 | 1297 | if (sscanf(page, "%d", &new_value) != 1) |
| 1310 | 1298 | goto out; |
| @@ -2296,6 +2296,7 @@ static void smack_task_to_inode(struct task_struct *p, struct inode *inode) · 2295 unmodified lines | ||
| 2296 | 2296 | struct smack_known *skp = smk_of_task_struct(p); |
| 2297 | 2297 | |
| 2298 | 2298 | isp->smk_inode = skp; |
| 2299 | + isp->smk_flags |= SMK_INODE_INSTANT; | |
| 2299 | 2300 | } |
| 2300 | 2301 | |
| 2301 | 2302 | /* |
| @@ -2004,7 +2004,8 @@ static int snd_seq_ioctl_query_next_client(struct snd_seq_client *client, · 2003 unmodified lines | ||
| 2004 | 2004 | struct snd_seq_client *cptr = NULL; |
| 2005 | 2005 | |
| 2006 | 2006 | /* search for next client */ |
| 2007 | − info->client++; | |
| 2007 | + if (info->client < INT_MAX) | |
| 2008 | + info->client++; | |
| 2008 | 2009 | if (info->client < 0) |
| 2009 | 2010 | info->client = 0; |
| 2010 | 2011 | for (; info->client < SNDRV_SEQ_MAX_CLIENTS; info->client++) { |
| @@ -1520,7 +1520,7 @@ static int snd_timer_user_next_device(struct snd_timer_id __user *_tid) · 1519 unmodified lines | ||
| 1520 | 1520 | } else { |
| 1521 | 1521 | if (id.subdevice < 0) |
| 1522 | 1522 | id.subdevice = 0; |
| 1523 | − else | |
| 1523 | + else if (id.subdevice < INT_MAX) | |
| 1524 | 1524 | id.subdevice++; |
| 1525 | 1525 | } |
| 1526 | 1526 | } |
| @@ -2899,8 +2899,9 @@ static int hda_codec_runtime_suspend(struct device *dev) · 2898 unmodified lines | ||
| 2899 | 2899 | list_for_each_entry(pcm, &codec->pcm_list_head, list) |
| 2900 | 2900 | snd_pcm_suspend_all(pcm->pcm); |
| 2901 | 2901 | state = hda_call_codec_suspend(codec); |
| 2902 | − if (codec_has_clkstop(codec) && codec_has_epss(codec) && | |
| 2903 | − (state & AC_PWRST_CLK_STOP_OK)) | |
| 2902 | + if (codec->link_down_at_suspend || | |
| 2903 | + (codec_has_clkstop(codec) && codec_has_epss(codec) && | |
| 2904 | + (state & AC_PWRST_CLK_STOP_OK))) | |
| 2904 | 2905 | snd_hdac_codec_link_down(&codec->core); |
| 2905 | 2906 | snd_hdac_link_power(&codec->core, false); |
| 2906 | 2907 | return 0; |
| @@ -258,6 +258,7 @@ struct hda_codec { · 257 unmodified lines | ||
| 258 | 258 | unsigned int power_save_node:1; /* advanced PM for each widget */ |
| 259 | 259 | unsigned int auto_runtime_pm:1; /* enable automatic codec runtime pm */ |
| 260 | 260 | unsigned int force_pin_prefix:1; /* Add location prefix */ |
| 261 | + unsigned int link_down_at_suspend:1; /* link down at runtime suspend */ | |
| 261 | 262 | #ifdef CONFIG_PM |
| 262 | 263 | unsigned long power_on_acct; |
| 263 | 264 | unsigned long power_off_acct; |
| @@ -991,6 +991,7 @@ struct ca0132_spec { · 990 unmodified lines | ||
| 991 | 991 | enum { |
| 992 | 992 | QUIRK_NONE, |
| 993 | 993 | QUIRK_ALIENWARE, |
| 994 | + QUIRK_ALIENWARE_M17XR4, | |
| 994 | 995 | QUIRK_SBZ, |
| 995 | 996 | QUIRK_R3DI, |
| 996 | 997 | }; |
| @@ -1040,6 +1041,7 @@ static const struct hda_pintbl r3di_pincfgs[] = { · 43 unmodified lines | ||
| 1040 | 1041 | }; |
| 1041 | 1042 | |
| 1042 | 1043 | static const struct snd_pci_quirk ca0132_quirks[] = { |
| 1044 | + SND_PCI_QUIRK(0x1028, 0x057b, "Alienware M17x R4", QUIRK_ALIENWARE_M17XR4), | |
| 1043 | 1045 | SND_PCI_QUIRK(0x1028, 0x0685, "Alienware 15 2015", QUIRK_ALIENWARE), |
| 1044 | 1046 | SND_PCI_QUIRK(0x1028, 0x0688, "Alienware 17 2015", QUIRK_ALIENWARE), |
| 1045 | 1047 | SND_PCI_QUIRK(0x1028, 0x0708, "Alienware 15 R2 2016", QUIRK_ALIENWARE), |
| @@ -5663,7 +5665,7 @@ static const char * const ca0132_alt_slave_pfxs[] = { · 4617 unmodified lines | ||
| 5663 | 5665 | * I think this has to do with the pin for rear surround being 0x11, |
| 5664 | 5666 | * and the center/lfe being 0x10. Usually the pin order is the opposite. |
| 5665 | 5667 | */ |
| 5666 | −const struct snd_pcm_chmap_elem ca0132_alt_chmaps[] = { | |
| 5668 | +static const struct snd_pcm_chmap_elem ca0132_alt_chmaps[] = { | |
| 5667 | 5669 | { .channels = 2, |
| 5668 | 5670 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, |
| 5669 | 5671 | { .channels = 4, |
| @@ -5966,7 +5968,7 @@ static int ca0132_build_pcms(struct hda_codec *codec) · 296 unmodified lines | ||
| 5966 | 5968 | info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[0]; |
| 5967 | 5969 | |
| 5968 | 5970 | /* With the DSP enabled, desktops don't use this ADC. */ |
| 5969 | − if (spec->use_alt_functions) { | |
| 5971 | + if (!spec->use_alt_functions) { | |
| 5970 | 5972 | info = snd_hda_codec_pcm_new(codec, "CA0132 Analog Mic-In2"); |
| 5971 | 5973 | if (!info) |
| 5972 | 5974 | return -ENOMEM; |
| @@ -6130,7 +6132,10 @@ static void ca0132_init_dmic(struct hda_codec *codec) · 157 unmodified lines | ||
| 6130 | 6132 | * Bit 6: set to select Data2, clear for Data1 |
| 6131 | 6133 | * Bit 7: set to enable DMic, clear for AMic |
| 6132 | 6134 | */ |
| 6133 | − val = 0x23; | |
| 6135 | + if (spec->quirk == QUIRK_ALIENWARE_M17XR4) | |
| 6136 | + val = 0x33; | |
| 6137 | + else | |
| 6138 | + val = 0x23; | |
| 6134 | 6139 | /* keep a copy of dmic ctl val for enable/disable dmic purpuse */ |
| 6135 | 6140 | spec->dmic_ctl = val; |
| 6136 | 6141 | snd_hda_codec_write(codec, spec->input_pins[0], 0, |
| @@ -7223,7 +7228,7 @@ static int ca0132_init(struct hda_codec *codec) · 1086 unmodified lines | ||
| 7223 | 7228 | |
| 7224 | 7229 | snd_hda_sequence_write(codec, spec->base_init_verbs); |
| 7225 | 7230 | |
| 7226 | − if (spec->quirk != QUIRK_NONE) | |
| 7231 | + if (spec->use_alt_functions) | |
| 7227 | 7232 | ca0132_alt_init(codec); |
| 7228 | 7233 | |
| 7229 | 7234 | ca0132_download_dsp(codec); |
| @@ -7237,8 +7242,9 @@ static int ca0132_init(struct hda_codec *codec) · 7 unmodified lines | ||
| 7237 | 7242 | case QUIRK_R3DI: |
| 7238 | 7243 | r3di_setup_defaults(codec); |
| 7239 | 7244 | break; |
| 7240 | − case QUIRK_NONE: | |
| 7241 | − case QUIRK_ALIENWARE: | |
| 7245 | + case QUIRK_SBZ: | |
| 7246 | + break; | |
| 7247 | + default: | |
| 7242 | 7248 | ca0132_setup_defaults(codec); |
| 7243 | 7249 | ca0132_init_analog_mic2(codec); |
| 7244 | 7250 | ca0132_init_dmic(codec); |
| @@ -7343,7 +7349,6 @@ static const struct hda_codec_ops ca0132_patch_ops = { · 98 unmodified lines | ||
| 7343 | 7349 | static void ca0132_config(struct hda_codec *codec) |
| 7344 | 7350 | { |
| 7345 | 7351 | struct ca0132_spec *spec = codec->spec; |
| 7346 | − struct auto_pin_cfg *cfg = &spec->autocfg; | |
| 7347 | 7352 | |
| 7348 | 7353 | spec->dacs[0] = 0x2; |
| 7349 | 7354 | spec->dacs[1] = 0x3; |
| @@ -7405,12 +7410,7 @@ static void ca0132_config(struct hda_codec *codec) · 55 unmodified lines | ||
| 7405 | 7410 | /* SPDIF I/O */ |
| 7406 | 7411 | spec->dig_out = 0x05; |
| 7407 | 7412 | spec->multiout.dig_out_nid = spec->dig_out; |
| 7408 | − cfg->dig_out_pins[0] = 0x0c; | |
| 7409 | − cfg->dig_outs = 1; | |
| 7410 | − cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF; | |
| 7411 | 7413 | spec->dig_in = 0x09; |
| 7412 | − cfg->dig_in_pin = 0x0e; | |
| 7413 | − cfg->dig_in_type = HDA_PCM_TYPE_SPDIF; | |
| 7414 | 7414 | break; |
| 7415 | 7415 | case QUIRK_R3DI: |
| 7416 | 7416 | codec_dbg(codec, "%s: QUIRK_R3DI applied.\n", __func__); |
| @@ -7438,9 +7438,6 @@ static void ca0132_config(struct hda_codec *codec) · 21 unmodified lines | ||
| 7438 | 7438 | /* SPDIF I/O */ |
| 7439 | 7439 | spec->dig_out = 0x05; |
| 7440 | 7440 | spec->multiout.dig_out_nid = spec->dig_out; |
| 7441 | − cfg->dig_out_pins[0] = 0x0c; | |
| 7442 | − cfg->dig_outs = 1; | |
| 7443 | − cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF; | |
| 7444 | 7441 | break; |
| 7445 | 7442 | default: |
| 7446 | 7443 | spec->num_outputs = 2; |
| @@ -7463,12 +7460,7 @@ static void ca0132_config(struct hda_codec *codec) · 16 unmodified lines | ||
| 7463 | 7460 | /* SPDIF I/O */ |
| 7464 | 7461 | spec->dig_out = 0x05; |
| 7465 | 7462 | spec->multiout.dig_out_nid = spec->dig_out; |
| 7466 | − cfg->dig_out_pins[0] = 0x0c; | |
| 7467 | − cfg->dig_outs = 1; | |
| 7468 | − cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF; | |
| 7469 | 7463 | spec->dig_in = 0x09; |
| 7470 | − cfg->dig_in_pin = 0x0e; | |
| 7471 | − cfg->dig_in_type = HDA_PCM_TYPE_SPDIF; | |
| 7472 | 7464 | break; |
| 7473 | 7465 | } |
| 7474 | 7466 | } |
| @@ -7476,7 +7468,7 @@ static void ca0132_config(struct hda_codec *codec) · 1 unmodified line | ||
| 7476 | 7468 | static int ca0132_prepare_verbs(struct hda_codec *codec) |
| 7477 | 7469 | { |
| 7478 | 7470 | /* Verbs + terminator (an empty element) */ |
| 7479 | −#define NUM_SPEC_VERBS 4 | |
| 7471 | +#define NUM_SPEC_VERBS 2 | |
| 7480 | 7472 | struct ca0132_spec *spec = codec->spec; |
| 7481 | 7473 | |
| 7482 | 7474 | spec->chip_init_verbs = ca0132_init_verbs0; |
| @@ -7488,34 +7480,24 @@ static int ca0132_prepare_verbs(struct hda_codec *codec) · 5 unmodified lines | ||
| 7488 | 7480 | if (!spec->spec_init_verbs) |
| 7489 | 7481 | return -ENOMEM; |
| 7490 | 7482 | |
| 7491 | − /* HP jack autodetection */ | |
| 7492 | − spec->spec_init_verbs[0].nid = spec->unsol_tag_hp; | |
| 7493 | − spec->spec_init_verbs[0].param = AC_VERB_SET_UNSOLICITED_ENABLE; | |
| 7494 | − spec->spec_init_verbs[0].verb = AC_USRSP_EN | spec->unsol_tag_hp; | |
| 7495 | − | |
| 7496 | − /* MIC1 jack autodetection */ | |
| 7497 | − spec->spec_init_verbs[1].nid = spec->unsol_tag_amic1; | |
| 7498 | − spec->spec_init_verbs[1].param = AC_VERB_SET_UNSOLICITED_ENABLE; | |
| 7499 | − spec->spec_init_verbs[1].verb = AC_USRSP_EN | spec->unsol_tag_amic1; | |
| 7500 | − | |
| 7501 | 7483 | /* config EAPD */ |
| 7502 | − spec->spec_init_verbs[2].nid = 0x0b; | |
| 7503 | − spec->spec_init_verbs[2].param = 0x78D; | |
| 7504 | − spec->spec_init_verbs[2].verb = 0x00; | |
| 7484 | + spec->spec_init_verbs[0].nid = 0x0b; | |
| 7485 | + spec->spec_init_verbs[0].param = 0x78D; | |
| 7486 | + spec->spec_init_verbs[0].verb = 0x00; | |
| 7505 | 7487 | |
| 7506 | 7488 | /* Previously commented configuration */ |
| 7507 | 7489 | /* |
| 7508 | − spec->spec_init_verbs[3].nid = 0x0b; | |
| 7509 | − spec->spec_init_verbs[3].param = AC_VERB_SET_EAPD_BTLENABLE; | |
| 7490 | + spec->spec_init_verbs[2].nid = 0x0b; | |
| 7491 | + spec->spec_init_verbs[2].param = AC_VERB_SET_EAPD_BTLENABLE; | |
| 7492 | + spec->spec_init_verbs[2].verb = 0x02; | |
| 7493 | + | |
| 7494 | + spec->spec_init_verbs[3].nid = 0x10; | |
| 7495 | + spec->spec_init_verbs[3].param = 0x78D; | |
| 7510 | 7496 | spec->spec_init_verbs[3].verb = 0x02; |
| 7511 | 7497 | |
| 7512 | 7498 | spec->spec_init_verbs[4].nid = 0x10; |
| 7513 | − spec->spec_init_verbs[4].param = 0x78D; | |
| 7499 | + spec->spec_init_verbs[4].param = AC_VERB_SET_EAPD_BTLENABLE; | |
| 7514 | 7500 | spec->spec_init_verbs[4].verb = 0x02; |
| 7515 | − | |
| 7516 | − spec->spec_init_verbs[5].nid = 0x10; | |
| 7517 | − spec->spec_init_verbs[5].param = AC_VERB_SET_EAPD_BTLENABLE; | |
| 7518 | − spec->spec_init_verbs[5].verb = 0x02; | |
| 7519 | 7501 | */ |
| 7520 | 7502 | |
| 7521 | 7503 | /* Terminator: spec->spec_init_verbs[NUM_SPEC_VERBS-1] */ |
| @@ -3741,6 +3741,11 @@ static int patch_atihdmi(struct hda_codec *codec) · 3740 unmodified lines | ||
| 3741 | 3741 | |
| 3742 | 3742 | spec->chmap.channels_max = max(spec->chmap.channels_max, 8u); |
| 3743 | 3743 | |
| 3744 | + /* AMD GPUs have neither EPSS nor CLKSTOP bits, hence preventing | |
| 3745 | + * the link-down as is. Tell the core to allow it. | |
| 3746 | + */ | |
| 3747 | + codec->link_down_at_suspend = 1; | |
| 3748 | + | |
| 3744 | 3749 | return 0; |
| 3745 | 3750 | } |
| 3746 | 3751 | |
| @@ -2545,6 +2545,7 @@ static const struct snd_pci_quirk alc262_fixup_tbl[] = { · 2544 unmodified lines | ||
| 2545 | 2545 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
| 2546 | 2546 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
| 2547 | 2547 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
| 2548 | + SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), | |
| 2548 | 2549 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
| 2549 | 2550 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
| 2550 | 2551 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
| @@ -4995,7 +4996,6 @@ static void alc_fixup_tpt440_dock(struct hda_codec *codec, · 2444 unmodified lines | ||
| 4995 | 4996 | struct alc_spec *spec = codec->spec; |
| 4996 | 4997 | |
| 4997 | 4998 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4998 | − spec->shutup = alc_no_shutup; /* reduce click noise */ | |
| 4999 | 4999 | spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */ |
| 5000 | 5000 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 5001 | 5001 | codec->power_save_node = 0; /* avoid click noises */ |
| @@ -5394,6 +5394,13 @@ static void alc274_fixup_bind_dacs(struct hda_codec *codec, · 392 unmodified lines | ||
| 5394 | 5394 | /* for hda_fixup_thinkpad_acpi() */ |
| 5395 | 5395 | #include "thinkpad_helper.c" |
| 5396 | 5396 | |
| 5397 | +static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, | |
| 5398 | + const struct hda_fixup *fix, int action) | |
| 5399 | +{ | |
| 5400 | + alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ | |
| 5401 | + hda_fixup_thinkpad_acpi(codec, fix, action); | |
| 5402 | +} | |
| 5403 | + | |
| 5397 | 5404 | /* for dell wmi mic mute led */ |
| 5398 | 5405 | #include "dell_wmi_helper.c" |
| 5399 | 5406 | |
| @@ -5946,7 +5953,7 @@ static const struct hda_fixup alc269_fixups[] = { · 546 unmodified lines | ||
| 5946 | 5953 | }, |
| 5947 | 5954 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
| 5948 | 5955 | .type = HDA_FIXUP_FUNC, |
| 5949 | − .v.func = hda_fixup_thinkpad_acpi, | |
| 5956 | + .v.func = alc_fixup_thinkpad_acpi, | |
| 5950 | 5957 | .chained = true, |
| 5951 | 5958 | .chain_id = ALC269_FIXUP_SKU_IGNORE, |
| 5952 | 5959 | }, |
| @@ -6603,8 +6610,9 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 650 unmodified lines | ||
| 6603 | 6610 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
| 6604 | 6611 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
| 6605 | 6612 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
| 6613 | + SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), | |
| 6606 | 6614 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
| 6607 | − SND_PCI_QUIRK(0x17aa, 0x3138, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), | |
| 6615 | + SND_PCI_QUIRK(0x17aa, 0x3136, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), | |
| 6608 | 6616 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
| 6609 | 6617 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
| 6610 | 6618 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
| @@ -6782,6 +6790,12 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { · 171 unmodified lines | ||
| 6782 | 6790 | {0x14, 0x90170110}, |
| 6783 | 6791 | {0x19, 0x02a11030}, |
| 6784 | 6792 | {0x21, 0x02211020}), |
| 6793 | + SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, | |
| 6794 | + {0x14, 0x90170110}, | |
| 6795 | + {0x19, 0x02a11030}, | |
| 6796 | + {0x1a, 0x02a11040}, | |
| 6797 | + {0x1b, 0x01014020}, | |
| 6798 | + {0x21, 0x0221101f}), | |
| 6785 | 6799 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6786 | 6800 | {0x12, 0x90a60140}, |
| 6787 | 6801 | {0x14, 0x90170110}, |
| @@ -1018,6 +1018,7 @@ static int snd_lx6464es_create(struct snd_card *card, · 1017 unmodified lines | ||
| 1018 | 1018 | chip->port_dsp_bar = pci_ioremap_bar(pci, 2); |
| 1019 | 1019 | if (!chip->port_dsp_bar) { |
| 1020 | 1020 | dev_err(card->dev, "cannot remap PCI memory region\n"); |
| 1021 | + err = -ENOMEM; | |
| 1021 | 1022 | goto remap_pci_failed; |
| 1022 | 1023 | } |
| 1023 | 1024 | |
| @@ -91,6 +91,7 @@ struct kvm_regs { · 90 unmodified lines | ||
| 91 | 91 | #define KVM_VGIC_V3_ADDR_TYPE_DIST 2 |
| 92 | 92 | #define KVM_VGIC_V3_ADDR_TYPE_REDIST 3 |
| 93 | 93 | #define KVM_VGIC_ITS_ADDR_TYPE 4 |
| 94 | +#define KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION 5 | |
| 94 | 95 | |
| 95 | 96 | #define KVM_VGIC_V3_DIST_SIZE SZ_64K |
| 96 | 97 | #define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K) |
| @@ -91,6 +91,7 @@ struct kvm_regs { · 90 unmodified lines | ||
| 91 | 91 | #define KVM_VGIC_V3_ADDR_TYPE_DIST 2 |
| 92 | 92 | #define KVM_VGIC_V3_ADDR_TYPE_REDIST 3 |
| 93 | 93 | #define KVM_VGIC_ITS_ADDR_TYPE 4 |
| 94 | +#define KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION 5 | |
| 94 | 95 | |
| 95 | 96 | #define KVM_VGIC_V3_DIST_SIZE SZ_64K |
| 96 | 97 | #define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K) |
| @@ -633,6 +633,7 @@ struct kvm_ppc_cpu_char { · 632 unmodified lines | ||
| 633 | 633 | #define KVM_REG_PPC_PSSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbd) |
| 634 | 634 | |
| 635 | 635 | #define KVM_REG_PPC_DEC_EXPIRY (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbe) |
| 636 | +#define KVM_REG_PPC_ONLINE (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbf) | |
| 636 | 637 | |
| 637 | 638 | /* Transactional Memory checkpointed state: |
| 638 | 639 | * This is all GPRs, all VSX regs and a subset of SPRs |
| @@ -398,5 +398,6 @@ · 397 unmodified lines | ||
| 398 | 398 | #define __NR_pkey_alloc 384 |
| 399 | 399 | #define __NR_pkey_free 385 |
| 400 | 400 | #define __NR_pkey_mprotect 386 |
| 401 | +#define __NR_rseq 387 | |
| 401 | 402 | |
| 402 | 403 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
| @@ -282,7 +282,9 @@ · 281 unmodified lines | ||
| 282 | 282 | #define X86_FEATURE_AMD_IBPB (13*32+12) /* "" Indirect Branch Prediction Barrier */ |
| 283 | 283 | #define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */ |
| 284 | 284 | #define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */ |
| 285 | +#define X86_FEATURE_AMD_SSBD (13*32+24) /* "" Speculative Store Bypass Disable */ | |
| 285 | 286 | #define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */ |
| 287 | +#define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */ | |
| 286 | 288 | |
| 287 | 289 | /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */ |
| 288 | 290 | #define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */ |
| @@ -694,15 +694,19 @@ static int do_load(int argc, char **argv) · 693 unmodified lines | ||
| 694 | 694 | return -1; |
| 695 | 695 | } |
| 696 | 696 | |
| 697 | − if (do_pin_fd(prog_fd, argv[1])) { | |
| 698 | − p_err("failed to pin program"); | |
| 699 | − return -1; | |
| 700 | − } | |
| 697 | + if (do_pin_fd(prog_fd, argv[1])) | |
| 698 | + goto err_close_obj; | |
| 701 | 699 | |
| 702 | 700 | if (json_output) |
| 703 | 701 | jsonw_null(json_wtr); |
| 704 | 702 | |
| 703 | + bpf_object__close(obj); | |
| 704 | + | |
| 705 | 705 | return 0; |
| 706 | + | |
| 707 | +err_close_obj: | |
| 708 | + bpf_object__close(obj); | |
| 709 | + return -1; | |
| 706 | 710 | } |
| 707 | 711 | |
| 708 | 712 | static int do_help(int argc, char **argv) |
| @@ -680,6 +680,13 @@ struct drm_get_cap { · 679 unmodified lines | ||
| 680 | 680 | */ |
| 681 | 681 | #define DRM_CLIENT_CAP_ATOMIC 3 |
| 682 | 682 | |
| 683 | +/** | |
| 684 | + * DRM_CLIENT_CAP_ASPECT_RATIO | |
| 685 | + * | |
| 686 | + * If set to 1, the DRM core will provide aspect ratio information in modes. | |
| 687 | + */ | |
| 688 | +#define DRM_CLIENT_CAP_ASPECT_RATIO 4 | |
| 689 | + | |
| 683 | 690 | /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ |
| 684 | 691 | struct drm_set_client_cap { |
| 685 | 692 | __u64 capability; |
| @@ -2630,7 +2630,7 @@ struct bpf_fib_lookup { · 2629 unmodified lines | ||
| 2630 | 2630 | union { |
| 2631 | 2631 | /* inputs to lookup */ |
| 2632 | 2632 | __u8 tos; /* AF_INET */ |
| 2633 | − __be32 flowlabel; /* AF_INET6 */ | |
| 2633 | + __be32 flowinfo; /* AF_INET6, flow_label + priority */ | |
| 2634 | 2634 | |
| 2635 | 2635 | /* output: metric of fib result (IPv4/IPv6 only) */ |
| 2636 | 2636 | __u32 rt_metric; |
| @@ -333,6 +333,7 @@ enum { · 332 unmodified lines | ||
| 333 | 333 | IFLA_BRPORT_BCAST_FLOOD, |
| 334 | 334 | IFLA_BRPORT_GROUP_FWD_MASK, |
| 335 | 335 | IFLA_BRPORT_NEIGH_SUPPRESS, |
| 336 | + IFLA_BRPORT_ISOLATED, | |
| 336 | 337 | __IFLA_BRPORT_MAX |
| 337 | 338 | }; |
| 338 | 339 | #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) |
| @@ -516,6 +517,7 @@ enum { · 177 unmodified lines | ||
| 516 | 517 | IFLA_VXLAN_COLLECT_METADATA, |
| 517 | 518 | IFLA_VXLAN_LABEL, |
| 518 | 519 | IFLA_VXLAN_GPE, |
| 520 | + IFLA_VXLAN_TTL_INHERIT, | |
| 519 | 521 | __IFLA_VXLAN_MAX |
| 520 | 522 | }; |
| 521 | 523 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) |
| @@ -948,6 +948,7 @@ struct kvm_ppc_resize_hpt { · 947 unmodified lines | ||
| 948 | 948 | #define KVM_CAP_S390_BPB 152 |
| 949 | 949 | #define KVM_CAP_GET_MSR_FEATURES 153 |
| 950 | 950 | #define KVM_CAP_HYPERV_EVENTFD 154 |
| 951 | +#define KVM_CAP_HYPERV_TLBFLUSH 155 | |
| 951 | 952 | |
| 952 | 953 | #ifdef KVM_CAP_IRQ_ROUTING |
| 953 | 954 | |
| @@ -243,7 +243,7 @@ int arch_skip_callchain_idx(struct thread *thread, struct ip_callchain *chain) · 242 unmodified lines | ||
| 243 | 243 | u64 ip; |
| 244 | 244 | u64 skip_slot = -1; |
| 245 | 245 | |
| 246 | − if (chain->nr < 3) | |
| 246 | + if (!chain || chain->nr < 3) | |
| 247 | 247 | return skip_slot; |
| 248 | 248 | |
| 249 | 249 | ip = chain->ips[2]; |
| @@ -341,6 +341,8 @@ · 340 unmodified lines | ||
| 341 | 341 | 330 common pkey_alloc __x64_sys_pkey_alloc |
| 342 | 342 | 331 common pkey_free __x64_sys_pkey_free |
| 343 | 343 | 332 common statx __x64_sys_statx |
| 344 | +333 common io_pgetevents __x64_sys_io_pgetevents | |
| 345 | +334 common rseq __x64_sys_rseq | |
| 344 | 346 | |
| 345 | 347 | # |
| 346 | 348 | # x32-specific system call numbers start at 512 to avoid cache impact |
| @@ -1098,7 +1098,7 @@ static void *worker_thread(void *__tdata) · 1097 unmodified lines | ||
| 1098 | 1098 | u8 *global_data; |
| 1099 | 1099 | u8 *process_data; |
| 1100 | 1100 | u8 *thread_data; |
| 1101 | − u64 bytes_done; | |
| 1101 | + u64 bytes_done, secs; | |
| 1102 | 1102 | long work_done; |
| 1103 | 1103 | u32 l; |
| 1104 | 1104 | struct rusage rusage; |
| @@ -1254,7 +1254,8 @@ static void *worker_thread(void *__tdata) · 149 unmodified lines | ||
| 1254 | 1254 | timersub(&stop, &start0, &diff); |
| 1255 | 1255 | td->runtime_ns = diff.tv_sec * NSEC_PER_SEC; |
| 1256 | 1256 | td->runtime_ns += diff.tv_usec * NSEC_PER_USEC; |
| 1257 | − td->speed_gbs = bytes_done / (td->runtime_ns / NSEC_PER_SEC) / 1e9; | |
| 1257 | + secs = td->runtime_ns / NSEC_PER_SEC; | |
| 1258 | + td->speed_gbs = secs ? bytes_done / secs / 1e9 : 0; | |
| 1258 | 1259 | |
| 1259 | 1260 | getrusage(RUSAGE_THREAD, &rusage); |
| 1260 | 1261 | td->system_time_ns = rusage.ru_stime.tv_sec * NSEC_PER_SEC; |
| @@ -283,6 +283,15 @@ out_put: · 282 unmodified lines | ||
| 283 | 283 | return ret; |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | +static int process_feature_event(struct perf_tool *tool, | |
| 287 | + union perf_event *event, | |
| 288 | + struct perf_session *session) | |
| 289 | +{ | |
| 290 | + if (event->feat.feat_id < HEADER_LAST_FEATURE) | |
| 291 | + return perf_event__process_feature(tool, event, session); | |
| 292 | + return 0; | |
| 293 | +} | |
| 294 | + | |
| 286 | 295 | static int hist_entry__tty_annotate(struct hist_entry *he, |
| 287 | 296 | struct perf_evsel *evsel, |
| 288 | 297 | struct perf_annotate *ann) |
| @@ -471,7 +480,7 @@ int cmd_annotate(int argc, const char **argv) · 182 unmodified lines | ||
| 471 | 480 | .attr = perf_event__process_attr, |
| 472 | 481 | .build_id = perf_event__process_build_id, |
| 473 | 482 | .tracing_data = perf_event__process_tracing_data, |
| 474 | − .feature = perf_event__process_feature, | |
| 483 | + .feature = process_feature_event, | |
| 475 | 484 | .ordered_events = true, |
| 476 | 485 | .ordering_requires_timestamps = true, |
| 477 | 486 | }, |
| @@ -217,7 +217,8 @@ static int process_feature_event(struct perf_tool *tool, · 216 unmodified lines | ||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /* |
| 220 | − * All features are received, we can force the | |
| 220 | + * (feat_id = HEADER_LAST_FEATURE) is the end marker which | |
| 221 | + * means all features are received, now we can force the | |
| 221 | 222 | * group if needed. |
| 222 | 223 | */ |
| 223 | 224 | setup_forced_leader(rep, session->evlist); |
| @@ -1834,6 +1834,7 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, · 1833 unmodified lines | ||
| 1834 | 1834 | struct perf_evlist *evlist; |
| 1835 | 1835 | struct perf_evsel *evsel, *pos; |
| 1836 | 1836 | int err; |
| 1837 | + static struct perf_evsel_script *es; | |
| 1837 | 1838 | |
| 1838 | 1839 | err = perf_event__process_attr(tool, event, pevlist); |
| 1839 | 1840 | if (err) |
| @@ -1842,6 +1843,19 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, · 2 unmodified lines | ||
| 1842 | 1843 | evlist = *pevlist; |
| 1843 | 1844 | evsel = perf_evlist__last(*pevlist); |
| 1844 | 1845 | |
| 1846 | + if (!evsel->priv) { | |
| 1847 | + if (scr->per_event_dump) { | |
| 1848 | + evsel->priv = perf_evsel_script__new(evsel, | |
| 1849 | + scr->session->data); | |
| 1850 | + } else { | |
| 1851 | + es = zalloc(sizeof(*es)); | |
| 1852 | + if (!es) | |
| 1853 | + return -ENOMEM; | |
| 1854 | + es->fp = stdout; | |
| 1855 | + evsel->priv = es; | |
| 1856 | + } | |
| 1857 | + } | |
| 1858 | + | |
| 1845 | 1859 | if (evsel->attr.type >= PERF_TYPE_MAX && |
| 1846 | 1860 | evsel->attr.type != PERF_TYPE_SYNTH) |
| 1847 | 1861 | return 0; |
| @@ -3030,6 +3044,15 @@ int process_cpu_map_event(struct perf_tool *tool __maybe_unused, · 1182 unmodified lines | ||
| 3030 | 3044 | return set_maps(script); |
| 3031 | 3045 | } |
| 3032 | 3046 | |
| 3047 | +static int process_feature_event(struct perf_tool *tool, | |
| 3048 | + union perf_event *event, | |
| 3049 | + struct perf_session *session) | |
| 3050 | +{ | |
| 3051 | + if (event->feat.feat_id < HEADER_LAST_FEATURE) | |
| 3052 | + return perf_event__process_feature(tool, event, session); | |
| 3053 | + return 0; | |
| 3054 | +} | |
| 3055 | + | |
| 3033 | 3056 | #ifdef HAVE_AUXTRACE_SUPPORT |
| 3034 | 3057 | static int perf_script__process_auxtrace_info(struct perf_tool *tool, |
| 3035 | 3058 | union perf_event *event, |
| @@ -3074,7 +3097,7 @@ int cmd_script(int argc, const char **argv) · 38 unmodified lines | ||
| 3074 | 3097 | .attr = process_attr, |
| 3075 | 3098 | .event_update = perf_event__process_event_update, |
| 3076 | 3099 | .tracing_data = perf_event__process_tracing_data, |
| 3077 | − .feature = perf_event__process_feature, | |
| 3100 | + .feature = process_feature_event, | |
| 3078 | 3101 | .build_id = perf_event__process_build_id, |
| 3079 | 3102 | .id_index = perf_event__process_id_index, |
| 3080 | 3103 | .auxtrace_info = perf_script__process_auxtrace_info, |
| @@ -3125,8 +3148,9 @@ int cmd_script(int argc, const char **argv) · 44 unmodified lines | ||
| 3125 | 3148 | "+field to add and -field to remove." |
| 3126 | 3149 | "Valid types: hw,sw,trace,raw,synth. " |
| 3127 | 3150 | "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso," |
| 3128 | − "addr,symoff,period,iregs,uregs,brstack,brstacksym,flags," | |
| 3129 | − "bpf-output,callindent,insn,insnlen,brstackinsn,synth,phys_addr", | |
| 3151 | + "addr,symoff,srcline,period,iregs,uregs,brstack," | |
| 3152 | + "brstacksym,flags,bpf-output,brstackinsn,brstackoff," | |
| 3153 | + "callindent,insn,insnlen,synth,phys_addr,metric,misc", | |
| 3130 | 3154 | parse_output_fields), |
| 3131 | 3155 | OPT_BOOLEAN('a', "all-cpus", &system_wide, |
| 3132 | 3156 | "system-wide collection from all CPUs"), |
| @@ -1309,6 +1309,11 @@ static int test__checkevent_config_cache(struct perf_evlist *evlist) · 1308 unmodified lines | ||
| 1309 | 1309 | return 0; |
| 1310 | 1310 | } |
| 1311 | 1311 | |
| 1312 | +static bool test__intel_pt_valid(void) | |
| 1313 | +{ | |
| 1314 | + return !!perf_pmu__find("intel_pt"); | |
| 1315 | +} | |
| 1316 | + | |
| 1312 | 1317 | static int test__intel_pt(struct perf_evlist *evlist) |
| 1313 | 1318 | { |
| 1314 | 1319 | struct perf_evsel *evsel = perf_evlist__first(evlist); |
| @@ -1375,6 +1380,7 @@ struct evlist_test { · 60 unmodified lines | ||
| 1375 | 1380 | const char *name; |
| 1376 | 1381 | __u32 type; |
| 1377 | 1382 | const int id; |
| 1383 | + bool (*valid)(void); | |
| 1378 | 1384 | int (*check)(struct perf_evlist *evlist); |
| 1379 | 1385 | }; |
| 1380 | 1386 | |
| @@ -1648,6 +1654,7 @@ static struct evlist_test test__events[] = { · 267 unmodified lines | ||
| 1648 | 1654 | }, |
| 1649 | 1655 | { |
| 1650 | 1656 | .name = "intel_pt//u", |
| 1657 | + .valid = test__intel_pt_valid, | |
| 1651 | 1658 | .check = test__intel_pt, |
| 1652 | 1659 | .id = 52, |
| 1653 | 1660 | }, |
| @@ -1686,17 +1693,24 @@ static struct terms_test test__terms[] = { · 32 unmodified lines | ||
| 1686 | 1693 | |
| 1687 | 1694 | static int test_event(struct evlist_test *e) |
| 1688 | 1695 | { |
| 1696 | + struct parse_events_error err = { .idx = 0, }; | |
| 1689 | 1697 | struct perf_evlist *evlist; |
| 1690 | 1698 | int ret; |
| 1691 | 1699 | |
| 1700 | + if (e->valid && !e->valid()) { | |
| 1701 | + pr_debug("... SKIP"); | |
| 1702 | + return 0; | |
| 1703 | + } | |
| 1704 | + | |
| 1692 | 1705 | evlist = perf_evlist__new(); |
| 1693 | 1706 | if (evlist == NULL) |
| 1694 | 1707 | return -ENOMEM; |
| 1695 | 1708 | |
| 1696 | − ret = parse_events(evlist, e->name, NULL); | |
| 1709 | + ret = parse_events(evlist, e->name, &err); | |
| 1697 | 1710 | if (ret) { |
| 1698 | − pr_debug("failed to parse event '%s', err %d\n", | |
| 1699 | − e->name, ret); | |
| 1711 | + pr_debug("failed to parse event '%s', err %d, str '%s'\n", | |
| 1712 | + e->name, ret, err.str); | |
| 1713 | + parse_events_print_error(&err, e->name); | |
| 1700 | 1714 | } else { |
| 1701 | 1715 | ret = e->check(evlist); |
| 1702 | 1716 | } |
| @@ -1714,10 +1728,11 @@ static int test_events(struct evlist_test *events, unsigned cnt) · 11 unmodified lines | ||
| 1714 | 1728 | for (i = 0; i < cnt; i++) { |
| 1715 | 1729 | struct evlist_test *e = &events[i]; |
| 1716 | 1730 | |
| 1717 | − pr_debug("running test %d '%s'\n", e->id, e->name); | |
| 1731 | + pr_debug("running test %d '%s'", e->id, e->name); | |
| 1718 | 1732 | ret1 = test_event(e); |
| 1719 | 1733 | if (ret1) |
| 1720 | 1734 | ret2 = ret1; |
| 1735 | + pr_debug("\n"); | |
| 1721 | 1736 | } |
| 1722 | 1737 | |
| 1723 | 1738 | return ret2; |
| @@ -1799,7 +1814,7 @@ static int test_pmu_events(void) · 75 unmodified lines | ||
| 1799 | 1814 | } |
| 1800 | 1815 | |
| 1801 | 1816 | while (!ret && (ent = readdir(dir))) { |
| 1802 | − struct evlist_test e; | |
| 1817 | + struct evlist_test e = { .id = 0, }; | |
| 1803 | 1818 | char name[2 * NAME_MAX + 1 + 12 + 3]; |
| 1804 | 1819 | |
| 1805 | 1820 | /* Names containing . are special and cannot be used directly */ |
| @@ -45,6 +45,7 @@ static int session_write_header(char *path) · 44 unmodified lines | ||
| 45 | 45 | |
| 46 | 46 | perf_header__set_feat(&session->header, HEADER_CPU_TOPOLOGY); |
| 47 | 47 | perf_header__set_feat(&session->header, HEADER_NRCPUS); |
| 48 | + perf_header__set_feat(&session->header, HEADER_ARCH); | |
| 48 | 49 | |
| 49 | 50 | session->header.data_size += DATA_SIZE; |
| 50 | 51 | |
| @@ -146,8 +146,15 @@ getBPFObjectFromModule(llvm::Module *Module) · 145 unmodified lines | ||
| 146 | 146 | raw_svector_ostream ostream(*Buffer); |
| 147 | 147 | |
| 148 | 148 | legacy::PassManager PM; |
| 149 | − if (TargetMachine->addPassesToEmitFile(PM, ostream, | |
| 150 | − TargetMachine::CGFT_ObjectFile)) { | |
| 149 | + bool NotAdded; | |
| 150 | +#if CLANG_VERSION_MAJOR < 7 | |
| 151 | + NotAdded = TargetMachine->addPassesToEmitFile(PM, ostream, | |
| 152 | + TargetMachine::CGFT_ObjectFile); | |
| 153 | +#else | |
| 154 | + NotAdded = TargetMachine->addPassesToEmitFile(PM, ostream, nullptr, | |
| 155 | + TargetMachine::CGFT_ObjectFile); | |
| 156 | +#endif | |
| 157 | + if (NotAdded) { | |
| 151 | 158 | llvm::errs() << "TargetMachine can't emit a file of this type\n"; |
| 152 | 159 | return std::unique_ptr<llvm::SmallVectorImpl<char>>(nullptr);; |
| 153 | 160 | } |
| @@ -2129,6 +2129,7 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) · 2128 unmodified lines | ||
| 2129 | 2129 | int cpu_nr = ff->ph->env.nr_cpus_avail; |
| 2130 | 2130 | u64 size = 0; |
| 2131 | 2131 | struct perf_header *ph = ff->ph; |
| 2132 | + bool do_core_id_test = true; | |
| 2132 | 2133 | |
| 2133 | 2134 | ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu)); |
| 2134 | 2135 | if (!ph->env.cpu) |
| @@ -2183,6 +2184,13 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) · 48 unmodified lines | ||
| 2183 | 2184 | return 0; |
| 2184 | 2185 | } |
| 2185 | 2186 | |
| 2187 | + /* On s390 the socket_id number is not related to the numbers of cpus. | |
| 2188 | + * The socket_id number might be higher than the numbers of cpus. | |
| 2189 | + * This depends on the configuration. | |
| 2190 | + */ | |
| 2191 | + if (ph->env.arch && !strncmp(ph->env.arch, "s390", 4)) | |
| 2192 | + do_core_id_test = false; | |
| 2193 | + | |
| 2186 | 2194 | for (i = 0; i < (u32)cpu_nr; i++) { |
| 2187 | 2195 | if (do_read_u32(ff, &nr)) |
| 2188 | 2196 | goto free_cpu; |
| @@ -2192,7 +2200,7 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) · 3 unmodified lines | ||
| 2192 | 2200 | if (do_read_u32(ff, &nr)) |
| 2193 | 2201 | goto free_cpu; |
| 2194 | 2202 | |
| 2195 | − if (nr != (u32)-1 && nr > (u32)cpu_nr) { | |
| 2203 | + if (do_core_id_test && nr != (u32)-1 && nr > (u32)cpu_nr) { | |
| 2196 | 2204 | pr_debug("socket_id number is too big." |
| 2197 | 2205 | "You may need to upgrade the perf tool.\n"); |
| 2198 | 2206 | goto free_cpu; |
| @@ -3456,7 +3464,7 @@ int perf_event__process_feature(struct perf_tool *tool, · 1257 unmodified lines | ||
| 3456 | 3464 | pr_warning("invalid record type %d in pipe-mode\n", type); |
| 3457 | 3465 | return 0; |
| 3458 | 3466 | } |
| 3459 | − if (feat == HEADER_RESERVED || feat > HEADER_LAST_FEATURE) { | |
| 3467 | + if (feat == HEADER_RESERVED || feat >= HEADER_LAST_FEATURE) { | |
| 3460 | 3468 | pr_warning("invalid record type %d in pipe-mode\n", type); |
| 3461 | 3469 | return -1; |
| 3462 | 3470 | } |
| @@ -366,7 +366,7 @@ static int intel_pt_get_cyc(unsigned int byte, const unsigned char *buf, · 365 unmodified lines | ||
| 366 | 366 | if (len < offs) |
| 367 | 367 | return INTEL_PT_NEED_MORE_BYTES; |
| 368 | 368 | byte = buf[offs++]; |
| 369 | − payload |= (byte >> 1) << shift; | |
| 369 | + payload |= ((uint64_t)byte >> 1) << shift; | |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | packet->type = INTEL_PT_CYC; |
| @@ -234,6 +234,74 @@ static int perf_pmu__parse_snapshot(struct perf_pmu_alias *alias, · 233 unmodified lines | ||
| 234 | 234 | return 0; |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | +static void perf_pmu_assign_str(char *name, const char *field, char **old_str, | |
| 238 | + char **new_str) | |
| 239 | +{ | |
| 240 | + if (!*old_str) | |
| 241 | + goto set_new; | |
| 242 | + | |
| 243 | + if (*new_str) { /* Have new string, check with old */ | |
| 244 | + if (strcasecmp(*old_str, *new_str)) | |
| 245 | + pr_debug("alias %s differs in field '%s'\n", | |
| 246 | + name, field); | |
| 247 | + zfree(old_str); | |
| 248 | + } else /* Nothing new --> keep old string */ | |
| 249 | + return; | |
| 250 | +set_new: | |
| 251 | + *old_str = *new_str; | |
| 252 | + *new_str = NULL; | |
| 253 | +} | |
| 254 | + | |
| 255 | +static void perf_pmu_update_alias(struct perf_pmu_alias *old, | |
| 256 | + struct perf_pmu_alias *newalias) | |
| 257 | +{ | |
| 258 | + perf_pmu_assign_str(old->name, "desc", &old->desc, &newalias->desc); | |
| 259 | + perf_pmu_assign_str(old->name, "long_desc", &old->long_desc, | |
| 260 | + &newalias->long_desc); | |
| 261 | + perf_pmu_assign_str(old->name, "topic", &old->topic, &newalias->topic); | |
| 262 | + perf_pmu_assign_str(old->name, "metric_expr", &old->metric_expr, | |
| 263 | + &newalias->metric_expr); | |
| 264 | + perf_pmu_assign_str(old->name, "metric_name", &old->metric_name, | |
| 265 | + &newalias->metric_name); | |
| 266 | + perf_pmu_assign_str(old->name, "value", &old->str, &newalias->str); | |
| 267 | + old->scale = newalias->scale; | |
| 268 | + old->per_pkg = newalias->per_pkg; | |
| 269 | + old->snapshot = newalias->snapshot; | |
| 270 | + memcpy(old->unit, newalias->unit, sizeof(old->unit)); | |
| 271 | +} | |
| 272 | + | |
| 273 | +/* Delete an alias entry. */ | |
| 274 | +static void perf_pmu_free_alias(struct perf_pmu_alias *newalias) | |
| 275 | +{ | |
| 276 | + zfree(&newalias->name); | |
| 277 | + zfree(&newalias->desc); | |
| 278 | + zfree(&newalias->long_desc); | |
| 279 | + zfree(&newalias->topic); | |
| 280 | + zfree(&newalias->str); | |
| 281 | + zfree(&newalias->metric_expr); | |
| 282 | + zfree(&newalias->metric_name); | |
| 283 | + parse_events_terms__purge(&newalias->terms); | |
| 284 | + free(newalias); | |
| 285 | +} | |
| 286 | + | |
| 287 | +/* Merge an alias, search in alias list. If this name is already | |
| 288 | + * present merge both of them to combine all information. | |
| 289 | + */ | |
| 290 | +static bool perf_pmu_merge_alias(struct perf_pmu_alias *newalias, | |
| 291 | + struct list_head *alist) | |
| 292 | +{ | |
| 293 | + struct perf_pmu_alias *a; | |
| 294 | + | |
| 295 | + list_for_each_entry(a, alist, list) { | |
| 296 | + if (!strcasecmp(newalias->name, a->name)) { | |
| 297 | + perf_pmu_update_alias(a, newalias); | |
| 298 | + perf_pmu_free_alias(newalias); | |
| 299 | + return true; | |
| 300 | + } | |
| 301 | + } | |
| 302 | + return false; | |
| 303 | +} | |
| 304 | + | |
| 237 | 305 | static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, |
| 238 | 306 | char *desc, char *val, |
| 239 | 307 | char *long_desc, char *topic, |
| @@ -241,9 +309,11 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, · 1 unmodified line | ||
| 241 | 309 | char *metric_expr, |
| 242 | 310 | char *metric_name) |
| 243 | 311 | { |
| 312 | + struct parse_events_term *term; | |
| 244 | 313 | struct perf_pmu_alias *alias; |
| 245 | 314 | int ret; |
| 246 | 315 | int num; |
| 316 | + char newval[256]; | |
| 247 | 317 | |
| 248 | 318 | alias = malloc(sizeof(*alias)); |
| 249 | 319 | if (!alias) |
| @@ -262,6 +332,27 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, · 12 unmodified lines | ||
| 262 | 332 | return ret; |
| 263 | 333 | } |
| 264 | 334 | |
| 335 | + /* Scan event and remove leading zeroes, spaces, newlines, some | |
| 336 | + * platforms have terms specified as | |
| 337 | + * event=0x0091 (read from files ../<PMU>/events/<FILE> | |
| 338 | + * and terms specified as event=0x91 (read from JSON files). | |
| 339 | + * | |
| 340 | + * Rebuild string to make alias->str member comparable. | |
| 341 | + */ | |
| 342 | + memset(newval, 0, sizeof(newval)); | |
| 343 | + ret = 0; | |
| 344 | + list_for_each_entry(term, &alias->terms, list) { | |
| 345 | + if (ret) | |
| 346 | + ret += scnprintf(newval + ret, sizeof(newval) - ret, | |
| 347 | + ","); | |
| 348 | + if (term->type_val == PARSE_EVENTS__TERM_TYPE_NUM) | |
| 349 | + ret += scnprintf(newval + ret, sizeof(newval) - ret, | |
| 350 | + "%s=%#x", term->config, term->val.num); | |
| 351 | + else if (term->type_val == PARSE_EVENTS__TERM_TYPE_STR) | |
| 352 | + ret += scnprintf(newval + ret, sizeof(newval) - ret, | |
| 353 | + "%s=%s", term->config, term->val.str); | |
| 354 | + } | |
| 355 | + | |
| 265 | 356 | alias->name = strdup(name); |
| 266 | 357 | if (dir) { |
| 267 | 358 | /* |
| @@ -285,9 +376,10 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, · 17 unmodified lines | ||
| 285 | 376 | snprintf(alias->unit, sizeof(alias->unit), "%s", unit); |
| 286 | 377 | } |
| 287 | 378 | alias->per_pkg = perpkg && sscanf(perpkg, "%d", &num) == 1 && num == 1; |
| 288 | − alias->str = strdup(val); | |
| 379 | + alias->str = strdup(newval); | |
| 289 | 380 | |
| 290 | − list_add_tail(&alias->list, list); | |
| 381 | + if (!perf_pmu_merge_alias(alias, list)) | |
| 382 | + list_add_tail(&alias->list, list); | |
| 291 | 383 | |
| 292 | 384 | return 0; |
| 293 | 385 | } |
| @@ -303,6 +395,9 @@ static int perf_pmu__new_alias(struct list_head *list, char *dir, char *name, FI · 9 unmodified lines | ||
| 303 | 395 | |
| 304 | 396 | buf[ret] = 0; |
| 305 | 397 | |
| 398 | + /* Remove trailing newline from sysfs file */ | |
| 399 | + rtrim(buf); | |
| 400 | + | |
| 306 | 401 | return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL, NULL, |
| 307 | 402 | NULL, NULL, NULL); |
| 308 | 403 | } |
| @@ -6,6 +6,7 @@ CONFIG_TEST_BPF=m · 5 unmodified lines | ||
| 6 | 6 | CONFIG_CGROUP_BPF=y |
| 7 | 7 | CONFIG_NETDEVSIM=m |
| 8 | 8 | CONFIG_NET_CLS_ACT=y |
| 9 | +CONFIG_NET_SCHED=y | |
| 9 | 10 | CONFIG_NET_SCH_INGRESS=y |
| 10 | 11 | CONFIG_NET_IPIP=y |
| 11 | 12 | CONFIG_IPV6=y |
| @@ -1,6 +1,15 @@ | ||
| 1 | 1 | #!/bin/sh |
| 2 | 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | 3 | |
| 4 | +# Kselftest framework requirement - SKIP code is 4. | |
| 5 | +ksft_skip=4 | |
| 6 | + | |
| 7 | +msg="skip all tests:" | |
| 8 | +if [ "$(id -u)" != "0" ]; then | |
| 9 | + echo $msg please run this as root >&2 | |
| 10 | + exit $ksft_skip | |
| 11 | +fi | |
| 12 | + | |
| 4 | 13 | SRC_TREE=../../../../ |
| 5 | 14 | |
| 6 | 15 | test_run() |
| @@ -1,6 +1,15 @@ | ||
| 1 | 1 | #!/bin/bash |
| 2 | 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | 3 | |
| 4 | +# Kselftest framework requirement - SKIP code is 4. | |
| 5 | +ksft_skip=4 | |
| 6 | + | |
| 7 | +msg="skip all tests:" | |
| 8 | +if [ $UID != 0 ]; then | |
| 9 | + echo $msg please run this as root >&2 | |
| 10 | + exit $ksft_skip | |
| 11 | +fi | |
| 12 | + | |
| 4 | 13 | GREEN='\033[0;92m' |
| 5 | 14 | RED='\033[0;31m' |
| 6 | 15 | NC='\033[0m' # No Color |
| @@ -21,6 +21,15 @@ · 20 unmodified lines | ||
| 21 | 21 | # An UDP datagram is sent from fb00::1 to fb00::6. The test succeeds if this |
| 22 | 22 | # datagram can be read on NS6 when binding to fb00::6. |
| 23 | 23 | |
| 24 | +# Kselftest framework requirement - SKIP code is 4. | |
| 25 | +ksft_skip=4 | |
| 26 | + | |
| 27 | +msg="skip all tests:" | |
| 28 | +if [ $UID != 0 ]; then | |
| 29 | + echo $msg please run this as root >&2 | |
| 30 | + exit $ksft_skip | |
| 31 | +fi | |
| 32 | + | |
| 24 | 33 | TMP_FILE="/tmp/selftest_lwt_seg6local.txt" |
| 25 | 34 | |
| 26 | 35 | cleanup() |
| @@ -1413,18 +1413,12 @@ out: · 1412 unmodified lines | ||
| 1413 | 1413 | |
| 1414 | 1414 | int main(int argc, char **argv) |
| 1415 | 1415 | { |
| 1416 | − struct rlimit r = {10 * 1024 * 1024, RLIM_INFINITY}; | |
| 1417 | 1416 | int iov_count = 1, length = 1024, rate = 1; |
| 1418 | 1417 | struct sockmap_options options = {0}; |
| 1419 | 1418 | int opt, longindex, err, cg_fd = 0; |
| 1420 | 1419 | char *bpf_file = BPF_SOCKMAP_FILENAME; |
| 1421 | 1420 | int test = PING_PONG; |
| 1422 | 1421 | |
| 1423 | − if (setrlimit(RLIMIT_MEMLOCK, &r)) { | |
| 1424 | − perror("setrlimit(RLIMIT_MEMLOCK)"); | |
| 1425 | − return 1; | |
| 1426 | − } | |
| 1427 | − | |
| 1428 | 1422 | if (argc < 2) |
| 1429 | 1423 | return test_suite(); |
| 1430 | 1424 | |
File mode changed from 100644 to 100755.
| @@ -610,21 +610,41 @@ static int test_valid_sigreturn(int cs_bits, bool use_16bit_ss, int force_ss) · 609 unmodified lines | ||
| 610 | 610 | */ |
| 611 | 611 | for (int i = 0; i < NGREG; i++) { |
| 612 | 612 | greg_t req = requested_regs[i], res = resulting_regs[i]; |
| 613 | + | |
| 613 | 614 | if (i == REG_TRAPNO || i == REG_IP) |
| 614 | 615 | continue; /* don't care */ |
| 615 | − if (i == REG_SP) { | |
| 616 | − printf("\tSP: %llx -> %llx\n", (unsigned long long)req, | |
| 617 | − (unsigned long long)res); | |
| 618 | 616 | |
| 617 | + if (i == REG_SP) { | |
| 619 | 618 | /* |
| 620 | − * In many circumstances, the high 32 bits of rsp | |
| 621 | − * are zeroed. For example, we could be a real | |
| 622 | − * 32-bit program, or we could hit any of a number | |
| 623 | − * of poorly-documented IRET or segmented ESP | |
| 624 | − * oddities. If this happens, it's okay. | |
| 619 | + * If we were using a 16-bit stack segment, then | |
| 620 | + * the kernel is a bit stuck: IRET only restores | |
| 621 | + * the low 16 bits of ESP/RSP if SS is 16-bit. | |
| 622 | + * The kernel uses a hack to restore bits 31:16, | |
| 623 | + * but that hack doesn't help with bits 63:32. | |
| 624 | + * On Intel CPUs, bits 63:32 end up zeroed, and, on | |
| 625 | + * AMD CPUs, they leak the high bits of the kernel | |
| 626 | + * espfix64 stack pointer. There's very little that | |
| 627 | + * the kernel can do about it. | |
| 628 | + * | |
| 629 | + * Similarly, if we are returning to a 32-bit context, | |
| 630 | + * the CPU will often lose the high 32 bits of RSP. | |
| 625 | 631 | */ |
| 626 | − if (res == (req & 0xFFFFFFFF)) | |
| 627 | − continue; /* OK; not expected to work */ | |
| 632 | + | |
| 633 | + if (res == req) | |
| 634 | + continue; | |
| 635 | + | |
| 636 | + if (cs_bits != 64 && ((res ^ req) & 0xFFFFFFFF) == 0) { | |
| 637 | + printf("[NOTE]\tSP: %llx -> %llx\n", | |
| 638 | + (unsigned long long)req, | |
| 639 | + (unsigned long long)res); | |
| 640 | + continue; | |
| 641 | + } | |
| 642 | + | |
| 643 | + printf("[FAIL]\tSP mismatch: requested 0x%llx; got 0x%llx\n", | |
| 644 | + (unsigned long long)requested_regs[i], | |
| 645 | + (unsigned long long)resulting_regs[i]); | |
| 646 | + nerrs++; | |
| 647 | + continue; | |
| 628 | 648 | } |
| 629 | 649 | |
| 630 | 650 | bool ignore_reg = false; |
| @@ -654,25 +674,18 @@ static int test_valid_sigreturn(int cs_bits, bool use_16bit_ss, int force_ss) · 23 unmodified lines | ||
| 654 | 674 | #endif |
| 655 | 675 | |
| 656 | 676 | /* Sanity check on the kernel */ |
| 657 | − if (i == REG_CX && requested_regs[i] != resulting_regs[i]) { | |
| 677 | + if (i == REG_CX && req != res) { | |
| 658 | 678 | printf("[FAIL]\tCX (saved SP) mismatch: requested 0x%llx; got 0x%llx\n", |
| 659 | − (unsigned long long)requested_regs[i], | |
| 660 | − (unsigned long long)resulting_regs[i]); | |
| 679 | + (unsigned long long)req, | |
| 680 | + (unsigned long long)res); | |
| 661 | 681 | nerrs++; |
| 662 | 682 | continue; |
| 663 | 683 | } |
| 664 | 684 | |
| 665 | − if (requested_regs[i] != resulting_regs[i] && !ignore_reg) { | |
| 666 | − /* | |
| 667 | − * SP is particularly interesting here. The | |
| 668 | − * usual cause of failures is that we hit the | |
| 669 | − * nasty IRET case of returning to a 16-bit SS, | |
| 670 | − * in which case bits 16:31 of the *kernel* | |
| 671 | − * stack pointer persist in ESP. | |
| 672 | − */ | |
| 685 | + if (req != res && !ignore_reg) { | |
| 673 | 686 | printf("[FAIL]\tReg %d mismatch: requested 0x%llx; got 0x%llx\n", |
| 674 | − i, (unsigned long long)requested_regs[i], | |
| 675 | − (unsigned long long)resulting_regs[i]); | |
| 687 | + i, (unsigned long long)req, | |
| 688 | + (unsigned long long)res); | |
| 676 | 689 | nerrs++; |
| 677 | 690 | } |
| 678 | 691 | } |
| @@ -36,7 +36,6 @@ static inline void sg_assign_page(struct scatterlist *sg, struct page *page) · 35 unmodified lines | ||
| 36 | 36 | */ |
| 37 | 37 | BUG_ON((unsigned long) page & 0x03); |
| 38 | 38 | #ifdef CONFIG_DEBUG_SG |
| 39 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 40 | 39 | BUG_ON(sg_is_chain(sg)); |
| 41 | 40 | #endif |
| 42 | 41 | sg->page_link = page_link | (unsigned long) page; |
| @@ -67,7 +66,6 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page, · 24 unmodified lines | ||
| 67 | 66 | static inline struct page *sg_page(struct scatterlist *sg) |
| 68 | 67 | { |
| 69 | 68 | #ifdef CONFIG_DEBUG_SG |
| 70 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 71 | 69 | BUG_ON(sg_is_chain(sg)); |
| 72 | 70 | #endif |
| 73 | 71 | return (struct page *)((sg)->page_link & ~0x3); |
| @@ -116,9 +114,6 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, · 42 unmodified lines | ||
| 116 | 114 | **/ |
| 117 | 115 | static inline void sg_mark_end(struct scatterlist *sg) |
| 118 | 116 | { |
| 119 | −#ifdef CONFIG_DEBUG_SG | |
| 120 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 121 | −#endif | |
| 122 | 117 | /* |
| 123 | 118 | * Set termination bit, clear potential chain bit |
| 124 | 119 | */ |
| @@ -136,17 +131,11 @@ static inline void sg_mark_end(struct scatterlist *sg) · 11 unmodified lines | ||
| 136 | 131 | **/ |
| 137 | 132 | static inline void sg_unmark_end(struct scatterlist *sg) |
| 138 | 133 | { |
| 139 | −#ifdef CONFIG_DEBUG_SG | |
| 140 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 141 | −#endif | |
| 142 | 134 | sg->page_link &= ~0x02; |
| 143 | 135 | } |
| 144 | 136 | |
| 145 | 137 | static inline struct scatterlist *sg_next(struct scatterlist *sg) |
| 146 | 138 | { |
| 147 | −#ifdef CONFIG_DEBUG_SG | |
| 148 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 149 | −#endif | |
| 150 | 139 | if (sg_is_last(sg)) |
| 151 | 140 | return NULL; |
| 152 | 141 | |
| @@ -160,13 +149,6 @@ static inline struct scatterlist *sg_next(struct scatterlist *sg) · 7 unmodified lines | ||
| 160 | 149 | static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) |
| 161 | 150 | { |
| 162 | 151 | memset(sgl, 0, sizeof(*sgl) * nents); |
| 163 | −#ifdef CONFIG_DEBUG_SG | |
| 164 | − { | |
| 165 | − unsigned int i; | |
| 166 | − for (i = 0; i < nents; i++) | |
| 167 | − sgl[i].sg_magic = SG_MAGIC; | |
| 168 | − } | |
| 169 | −#endif | |
| 170 | 152 | sg_mark_end(&sgl[nents - 1]); |
| 171 | 153 | } |
| 172 | 154 | |