diff options
703 files changed, 5994 insertions, 3490 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index efc7aa7a0670..533ff5c68970 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt | |||
| @@ -4846,3 +4846,8 @@ | |||
| 4846 | xirc2ps_cs= [NET,PCMCIA] | 4846 | xirc2ps_cs= [NET,PCMCIA] |
| 4847 | Format: | 4847 | Format: |
| 4848 | <irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]] | 4848 | <irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]] |
| 4849 | |||
| 4850 | xhci-hcd.quirks [USB,KNL] | ||
| 4851 | A hex value specifying bitmask with supplemental xhci | ||
| 4852 | host controller quirks. Meaning of each bit can be | ||
| 4853 | consulted in header drivers/usb/host/xhci.h. | ||
diff --git a/Documentation/admin-guide/pm/intel_pstate.rst b/Documentation/admin-guide/pm/intel_pstate.rst index 8b9164990956..8f1d3de449b5 100644 --- a/Documentation/admin-guide/pm/intel_pstate.rst +++ b/Documentation/admin-guide/pm/intel_pstate.rst | |||
| @@ -324,8 +324,7 @@ Global Attributes | |||
| 324 | 324 | ||
| 325 | ``intel_pstate`` exposes several global attributes (files) in ``sysfs`` to | 325 | ``intel_pstate`` exposes several global attributes (files) in ``sysfs`` to |
| 326 | control its functionality at the system level. They are located in the | 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 | 327 | ``/sys/devices/system/cpu/intel_pstate/`` directory and affect all CPUs. |
| 328 | CPUs. | ||
| 329 | 328 | ||
| 330 | Some of them are not present if the ``intel_pstate=per_cpu_perf_limits`` | 329 | Some of them are not present if the ``intel_pstate=per_cpu_perf_limits`` |
| 331 | argument is passed to the kernel in the command line. | 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. | |||
| 379 | but it affects the maximum possible value of per-policy P-state limits | 378 | but it affects the maximum possible value of per-policy P-state limits |
| 380 | (see `Interpretation of Policy Attributes`_ below for details). | 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 | .. _status_attr: | 392 | .. _status_attr: |
| 383 | 393 | ||
| 384 | ``status`` | 394 | ``status`` |
diff --git a/Documentation/devicetree/bindings/input/sprd,sc27xx-vibra.txt b/Documentation/devicetree/bindings/input/sprd,sc27xx-vibra.txt new file mode 100644 index 000000000000..f2ec0d4f2dff --- /dev/null +++ b/Documentation/devicetree/bindings/input/sprd,sc27xx-vibra.txt | |||
| @@ -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 | }; | ||
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 2c391338c675..37bf0a9de75c 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
| @@ -441,8 +441,6 @@ prototypes: | |||
| 441 | int (*iterate) (struct file *, struct dir_context *); | 441 | int (*iterate) (struct file *, struct dir_context *); |
| 442 | int (*iterate_shared) (struct file *, struct dir_context *); | 442 | int (*iterate_shared) (struct file *, struct dir_context *); |
| 443 | __poll_t (*poll) (struct file *, struct poll_table_struct *); | 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 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | 444 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
| 447 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); | 445 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
| 448 | int (*mmap) (struct file *, struct vm_area_struct *); | 446 | int (*mmap) (struct file *, struct vm_area_struct *); |
| @@ -473,7 +471,7 @@ prototypes: | |||
| 473 | }; | 471 | }; |
| 474 | 472 | ||
| 475 | locking rules: | 473 | locking rules: |
| 476 | All except for ->poll_mask may block. | 474 | All may block. |
| 477 | 475 | ||
| 478 | ->llseek() locking has moved from llseek to the individual llseek | 476 | ->llseek() locking has moved from llseek to the individual llseek |
| 479 | implementations. If your fs is not using generic_file_llseek, you | 477 | implementations. If your fs is not using generic_file_llseek, you |
| @@ -505,9 +503,6 @@ in sys_read() and friends. | |||
| 505 | the lease within the individual filesystem to record the result of the | 503 | the lease within the individual filesystem to record the result of the |
| 506 | operation | 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 | --------------------------- dquot_operations ------------------------------- | 506 | --------------------------- dquot_operations ------------------------------- |
| 512 | prototypes: | 507 | prototypes: |
| 513 | int (*write_dquot) (struct dquot *); | 508 | int (*write_dquot) (struct dquot *); |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 829a7b7857a4..f608180ad59d 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
| @@ -857,8 +857,6 @@ struct file_operations { | |||
| 857 | ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); | 857 | ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); |
| 858 | int (*iterate) (struct file *, struct dir_context *); | 858 | int (*iterate) (struct file *, struct dir_context *); |
| 859 | __poll_t (*poll) (struct file *, struct poll_table_struct *); | 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 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | 860 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
| 863 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); | 861 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
| 864 | int (*mmap) (struct file *, struct vm_area_struct *); | 862 | int (*mmap) (struct file *, struct vm_area_struct *); |
| @@ -903,17 +901,6 @@ otherwise noted. | |||
| 903 | activity on this file and (optionally) go to sleep until there | 901 | activity on this file and (optionally) go to sleep until there |
| 904 | is activity. Called by the select(2) and poll(2) system calls | 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 | unlocked_ioctl: called by the ioctl(2) system call. | 904 | unlocked_ioctl: called by the ioctl(2) system call. |
| 918 | 905 | ||
| 919 | compat_ioctl: called by the ioctl(2) system call when 32 bit system calls | 906 | compat_ioctl: called by the ioctl(2) system call when 32 bit system calls |
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt index 6c9c69ec3986..114c7ce7b58d 100644 --- a/Documentation/kbuild/kbuild.txt +++ b/Documentation/kbuild/kbuild.txt | |||
| @@ -50,6 +50,11 @@ LDFLAGS_MODULE | |||
| 50 | -------------------------------------------------- | 50 | -------------------------------------------------- |
| 51 | Additional options used for $(LD) when linking modules. | 51 | Additional options used for $(LD) when linking modules. |
| 52 | 52 | ||
| 53 | KBUILD_KCONFIG | ||
| 54 | -------------------------------------------------- | ||
| 55 | Set the top-level Kconfig file to the value of this environment | ||
| 56 | variable. The default name is "Kconfig". | ||
| 57 | |||
| 53 | KBUILD_VERBOSE | 58 | KBUILD_VERBOSE |
| 54 | -------------------------------------------------- | 59 | -------------------------------------------------- |
| 55 | Set the kbuild verbosity. Can be assigned same values as "V=...". | 60 | Set the kbuild verbosity. Can be assigned same values as "V=...". |
| @@ -88,7 +93,8 @@ In most cases the name of the architecture is the same as the | |||
| 88 | directory name found in the arch/ directory. | 93 | directory name found in the arch/ directory. |
| 89 | But some architectures such as x86 and sparc have aliases. | 94 | But some architectures such as x86 and sparc have aliases. |
| 90 | x86: i386 for 32 bit, x86_64 for 64 bit | 95 | x86: i386 for 32 bit, x86_64 for 64 bit |
| 91 | sparc: sparc for 32 bit, sparc64 for 64 bit | 96 | sh: sh for 32 bit, sh64 for 64 bit |
| 97 | sparc: sparc32 for 32 bit, sparc64 for 64 bit | ||
| 92 | 98 | ||
| 93 | CROSS_COMPILE | 99 | CROSS_COMPILE |
| 94 | -------------------------------------------------- | 100 | -------------------------------------------------- |
| @@ -148,15 +154,6 @@ stripped after they are installed. If INSTALL_MOD_STRIP is '1', then | |||
| 148 | the default option --strip-debug will be used. Otherwise, | 154 | the default option --strip-debug will be used. Otherwise, |
| 149 | INSTALL_MOD_STRIP value will be used as the options to the strip command. | 155 | INSTALL_MOD_STRIP value will be used as the options to the strip command. |
| 150 | 156 | ||
| 151 | INSTALL_FW_PATH | ||
| 152 | -------------------------------------------------- | ||
| 153 | INSTALL_FW_PATH specifies where to install the firmware blobs. | ||
| 154 | The default value is: | ||
| 155 | |||
| 156 | $(INSTALL_MOD_PATH)/lib/firmware | ||
| 157 | |||
| 158 | The value can be overridden in which case the default value is ignored. | ||
| 159 | |||
| 160 | INSTALL_HDR_PATH | 157 | INSTALL_HDR_PATH |
| 161 | -------------------------------------------------- | 158 | -------------------------------------------------- |
| 162 | INSTALL_HDR_PATH specifies where to install user space headers when | 159 | INSTALL_HDR_PATH specifies where to install user space headers when |
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt index 3534a84d206c..64e0775a62d4 100644 --- a/Documentation/kbuild/kconfig-language.txt +++ b/Documentation/kbuild/kconfig-language.txt | |||
| @@ -430,6 +430,12 @@ This sets the config program's title bar if the config program chooses | |||
| 430 | to use it. It should be placed at the top of the configuration, before any | 430 | to use it. It should be placed at the top of the configuration, before any |
| 431 | other statement. | 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 | Kconfig hints | 440 | Kconfig hints |
| 435 | ------------- | 441 | ------------- |
diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt index 7233118f3a05..68c82914c0f3 100644 --- a/Documentation/kbuild/kconfig.txt +++ b/Documentation/kbuild/kconfig.txt | |||
| @@ -2,9 +2,9 @@ This file contains some assistance for using "make *config". | |||
| 2 | 2 | ||
| 3 | Use "make help" to list all of the possible configuration targets. | 3 | Use "make help" to list all of the possible configuration targets. |
| 4 | 4 | ||
| 5 | The xconfig ('qconf') and menuconfig ('mconf') programs also | 5 | The xconfig ('qconf'), menuconfig ('mconf'), and nconfig ('nconf') |
| 6 | have embedded help text. Be sure to check it for navigation, | 6 | programs also have embedded help text. Be sure to check that for |
| 7 | search, and other general help text. | 7 | navigation, search, and other general help text. |
| 8 | 8 | ||
| 9 | ====================================================================== | 9 | ====================================================================== |
| 10 | General | 10 | General |
| @@ -17,13 +17,16 @@ this happens, using a previously working .config file and running | |||
| 17 | for you, so you may find that you need to see what NEW kernel | 17 | for you, so you may find that you need to see what NEW kernel |
| 18 | symbols have been introduced. | 18 | symbols have been introduced. |
| 19 | 19 | ||
| 20 | To see a list of new config symbols when using "make oldconfig", use | 20 | To see a list of new config symbols, use |
| 21 | 21 | ||
| 22 | cp user/some/old.config .config | 22 | cp user/some/old.config .config |
| 23 | make listnewconfig | 23 | make listnewconfig |
| 24 | 24 | ||
| 25 | and the config program will list any new symbols, one per line. | 25 | and the config program will list any new symbols, one per line. |
| 26 | 26 | ||
| 27 | Alternatively, you can use the brute force method: | ||
| 28 | |||
| 29 | make oldconfig | ||
| 27 | scripts/diffconfig .config.old .config | less | 30 | scripts/diffconfig .config.old .config | less |
| 28 | 31 | ||
| 29 | ______________________________________________________________________ | 32 | ______________________________________________________________________ |
| @@ -160,7 +163,7 @@ Searching in menuconfig: | |||
| 160 | This lists all config symbols that contain "hotplug", | 163 | This lists all config symbols that contain "hotplug", |
| 161 | e.g., HOTPLUG_CPU, MEMORY_HOTPLUG. | 164 | e.g., HOTPLUG_CPU, MEMORY_HOTPLUG. |
| 162 | 165 | ||
| 163 | For search help, enter / followed TAB-TAB-TAB (to highlight | 166 | For search help, enter / followed by TAB-TAB (to highlight |
| 164 | <Help>) and Enter. This will tell you that you can also use | 167 | <Help>) and Enter. This will tell you that you can also use |
| 165 | regular expressions (regexes) in the search string, so if you | 168 | regular expressions (regexes) in the search string, so if you |
| 166 | are not interested in MEMORY_HOTPLUG, you could try | 169 | are not interested in MEMORY_HOTPLUG, you could try |
| @@ -203,6 +206,39 @@ Example: | |||
| 203 | 206 | ||
| 204 | 207 | ||
| 205 | ====================================================================== | 208 | ====================================================================== |
| 209 | nconfig | ||
| 210 | -------------------------------------------------- | ||
| 211 | |||
| 212 | nconfig is an alternate text-based configurator. It lists function | ||
| 213 | keys across the bottom of the terminal (window) that execute commands. | ||
| 214 | You can also just use the corresponding numeric key to execute the | ||
| 215 | commands unless you are in a data entry window. E.g., instead of F6 | ||
| 216 | for Save, you can just press 6. | ||
| 217 | |||
| 218 | Use F1 for Global help or F3 for the Short help menu. | ||
| 219 | |||
| 220 | Searching in nconfig: | ||
| 221 | |||
| 222 | You can search either in the menu entry "prompt" strings | ||
| 223 | or in the configuration symbols. | ||
| 224 | |||
| 225 | Use / to begin a search through the menu entries. This does | ||
| 226 | not support regular expressions. Use <Down> or <Up> for | ||
| 227 | Next hit and Previous hit, respectively. Use <Esc> to | ||
| 228 | terminate the search mode. | ||
| 229 | |||
| 230 | F8 (SymSearch) searches the configuration symbols for the | ||
| 231 | given string or regular expression (regex). | ||
| 232 | |||
| 233 | NCONFIG_MODE | ||
| 234 | -------------------------------------------------- | ||
| 235 | This mode shows all sub-menus in one large tree. | ||
| 236 | |||
| 237 | Example: | ||
| 238 | make NCONFIG_MODE=single_menu nconfig | ||
| 239 | |||
| 240 | |||
| 241 | ====================================================================== | ||
| 206 | xconfig | 242 | xconfig |
| 207 | -------------------------------------------------- | 243 | -------------------------------------------------- |
| 208 | 244 | ||
| @@ -230,8 +266,7 @@ gconfig | |||
| 230 | 266 | ||
| 231 | Searching in gconfig: | 267 | Searching in gconfig: |
| 232 | 268 | ||
| 233 | None (gconfig isn't maintained as well as xconfig or menuconfig); | 269 | There is no search command in gconfig. However, gconfig does |
| 234 | however, gconfig does have a few more viewing choices than | 270 | have several different viewing choices, modes, and options. |
| 235 | xconfig does. | ||
| 236 | 271 | ||
| 237 | ### | 272 | ### |
diff --git a/Documentation/usb/gadget_configfs.txt b/Documentation/usb/gadget_configfs.txt index 635e57493709..b8cb38a98c19 100644 --- a/Documentation/usb/gadget_configfs.txt +++ b/Documentation/usb/gadget_configfs.txt | |||
| @@ -226,7 +226,7 @@ $ rm configs/<config name>.<number>/<function> | |||
| 226 | where <config name>.<number> specify the configuration and <function> is | 226 | where <config name>.<number> specify the configuration and <function> is |
| 227 | a symlink to a function being removed from the configuration, e.g.: | 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 | ... |
diff --git a/MAINTAINERS b/MAINTAINERS index e19ec6d90a44..192d7f73fd01 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -581,7 +581,7 @@ W: https://www.infradead.org/~dhowells/kafs/ | |||
| 581 | 581 | ||
| 582 | AGPGART DRIVER | 582 | AGPGART DRIVER |
| 583 | M: David Airlie <airlied@linux.ie> | 583 | M: David Airlie <airlied@linux.ie> |
| 584 | T: git git://people.freedesktop.org/~airlied/linux (part of drm maint) | 584 | T: git git://anongit.freedesktop.org/drm/drm |
| 585 | S: Maintained | 585 | S: Maintained |
| 586 | F: drivers/char/agp/ | 586 | F: drivers/char/agp/ |
| 587 | F: include/linux/agp* | 587 | F: include/linux/agp* |
| @@ -2971,9 +2971,13 @@ N: bcm585* | |||
| 2971 | N: bcm586* | 2971 | N: bcm586* |
| 2972 | N: bcm88312 | 2972 | N: bcm88312 |
| 2973 | N: hr2 | 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 | F: drivers/clk/bcm/clk-ns* | 2977 | F: drivers/clk/bcm/clk-ns* |
| 2978 | F: drivers/clk/bcm/clk-sr* | ||
| 2976 | F: drivers/pinctrl/bcm/pinctrl-ns* | 2979 | F: drivers/pinctrl/bcm/pinctrl-ns* |
| 2980 | F: include/dt-bindings/clock/bcm-sr* | ||
| 2977 | 2981 | ||
| 2978 | BROADCOM KONA GPIO DRIVER | 2982 | BROADCOM KONA GPIO DRIVER |
| 2979 | M: Ray Jui <rjui@broadcom.com> | 2983 | M: Ray Jui <rjui@broadcom.com> |
| @@ -4456,6 +4460,7 @@ F: Documentation/blockdev/drbd/ | |||
| 4456 | 4460 | ||
| 4457 | DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS | 4461 | DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS |
| 4458 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 4462 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| 4463 | R: "Rafael J. Wysocki" <rafael@kernel.org> | ||
| 4459 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git | 4464 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git |
| 4460 | S: Supported | 4465 | S: Supported |
| 4461 | F: Documentation/kobject.txt | 4466 | F: Documentation/kobject.txt |
| @@ -4626,7 +4631,7 @@ F: include/uapi/drm/vmwgfx_drm.h | |||
| 4626 | DRM DRIVERS | 4631 | DRM DRIVERS |
| 4627 | M: David Airlie <airlied@linux.ie> | 4632 | M: David Airlie <airlied@linux.ie> |
| 4628 | L: dri-devel@lists.freedesktop.org | 4633 | L: dri-devel@lists.freedesktop.org |
| 4629 | T: git git://people.freedesktop.org/~airlied/linux | 4634 | T: git git://anongit.freedesktop.org/drm/drm |
| 4630 | B: https://bugs.freedesktop.org/ | 4635 | B: https://bugs.freedesktop.org/ |
| 4631 | C: irc://chat.freenode.net/dri-devel | 4636 | C: irc://chat.freenode.net/dri-devel |
| 4632 | S: Maintained | 4637 | S: Maintained |
| @@ -5669,7 +5674,7 @@ F: drivers/crypto/caam/ | |||
| 5669 | F: Documentation/devicetree/bindings/crypto/fsl-sec4.txt | 5674 | F: Documentation/devicetree/bindings/crypto/fsl-sec4.txt |
| 5670 | 5675 | ||
| 5671 | FREESCALE DIU FRAMEBUFFER DRIVER | 5676 | FREESCALE DIU FRAMEBUFFER DRIVER |
| 5672 | M: Timur Tabi <timur@tabi.org> | 5677 | M: Timur Tabi <timur@kernel.org> |
| 5673 | L: linux-fbdev@vger.kernel.org | 5678 | L: linux-fbdev@vger.kernel.org |
| 5674 | S: Maintained | 5679 | S: Maintained |
| 5675 | F: drivers/video/fbdev/fsl-diu-fb.* | 5680 | F: drivers/video/fbdev/fsl-diu-fb.* |
| @@ -5769,7 +5774,7 @@ S: Maintained | |||
| 5769 | F: drivers/net/wan/fsl_ucc_hdlc* | 5774 | F: drivers/net/wan/fsl_ucc_hdlc* |
| 5770 | 5775 | ||
| 5771 | FREESCALE QUICC ENGINE UCC UART DRIVER | 5776 | FREESCALE QUICC ENGINE UCC UART DRIVER |
| 5772 | M: Timur Tabi <timur@tabi.org> | 5777 | M: Timur Tabi <timur@kernel.org> |
| 5773 | L: linuxppc-dev@lists.ozlabs.org | 5778 | L: linuxppc-dev@lists.ozlabs.org |
| 5774 | S: Maintained | 5779 | S: Maintained |
| 5775 | F: drivers/tty/serial/ucc_uart.c | 5780 | F: drivers/tty/serial/ucc_uart.c |
| @@ -5793,7 +5798,7 @@ F: drivers/net/ethernet/freescale/fs_enet/ | |||
| 5793 | F: include/linux/fs_enet_pd.h | 5798 | F: include/linux/fs_enet_pd.h |
| 5794 | 5799 | ||
| 5795 | FREESCALE SOC SOUND DRIVERS | 5800 | FREESCALE SOC SOUND DRIVERS |
| 5796 | M: Timur Tabi <timur@tabi.org> | 5801 | M: Timur Tabi <timur@kernel.org> |
| 5797 | M: Nicolin Chen <nicoleotsuka@gmail.com> | 5802 | M: Nicolin Chen <nicoleotsuka@gmail.com> |
| 5798 | M: Xiubo Li <Xiubo.Lee@gmail.com> | 5803 | M: Xiubo Li <Xiubo.Lee@gmail.com> |
| 5799 | R: Fabio Estevam <fabio.estevam@nxp.com> | 5804 | R: Fabio Estevam <fabio.estevam@nxp.com> |
| @@ -10209,11 +10214,13 @@ F: sound/soc/codecs/sgtl5000* | |||
| 10209 | 10214 | ||
| 10210 | NXP TDA998X DRM DRIVER | 10215 | NXP TDA998X DRM DRIVER |
| 10211 | M: Russell King <linux@armlinux.org.uk> | 10216 | M: Russell King <linux@armlinux.org.uk> |
| 10212 | S: Supported | 10217 | S: Maintained |
| 10213 | T: git git://git.armlinux.org.uk/~rmk/linux-arm.git drm-tda998x-devel | 10218 | T: git git://git.armlinux.org.uk/~rmk/linux-arm.git drm-tda998x-devel |
| 10214 | T: git git://git.armlinux.org.uk/~rmk/linux-arm.git drm-tda998x-fixes | 10219 | T: git git://git.armlinux.org.uk/~rmk/linux-arm.git drm-tda998x-fixes |
| 10215 | F: drivers/gpu/drm/i2c/tda998x_drv.c | 10220 | F: drivers/gpu/drm/i2c/tda998x_drv.c |
| 10216 | F: include/drm/i2c/tda998x.h | 10221 | F: include/drm/i2c/tda998x.h |
| 10222 | F: include/dt-bindings/display/tda998x.h | ||
| 10223 | K: "nxp,tda998x" | ||
| 10217 | 10224 | ||
| 10218 | NXP TFA9879 DRIVER | 10225 | NXP TFA9879 DRIVER |
| 10219 | M: Peter Rosin <peda@axentia.se> | 10226 | M: Peter Rosin <peda@axentia.se> |
| @@ -11477,6 +11484,15 @@ W: http://wireless.kernel.org/en/users/Drivers/p54 | |||
| 11477 | S: Obsolete | 11484 | S: Obsolete |
| 11478 | F: drivers/net/wireless/intersil/prism54/ | 11485 | F: drivers/net/wireless/intersil/prism54/ |
| 11479 | 11486 | ||
| 11487 | PROC FILESYSTEM | ||
| 11488 | R: Alexey Dobriyan <adobriyan@gmail.com> | ||
| 11489 | L: linux-kernel@vger.kernel.org | ||
| 11490 | L: linux-fsdevel@vger.kernel.org | ||
| 11491 | S: Maintained | ||
| 11492 | F: fs/proc/ | ||
| 11493 | F: include/linux/proc_fs.h | ||
| 11494 | F: tools/testing/selftests/proc/ | ||
| 11495 | |||
| 11480 | PROC SYSCTL | 11496 | PROC SYSCTL |
| 11481 | M: "Luis R. Rodriguez" <mcgrof@kernel.org> | 11497 | M: "Luis R. Rodriguez" <mcgrof@kernel.org> |
| 11482 | M: Kees Cook <keescook@chromium.org> | 11498 | M: Kees Cook <keescook@chromium.org> |
| @@ -11809,9 +11825,9 @@ F: Documentation/devicetree/bindings/opp/kryo-cpufreq.txt | |||
| 11809 | F: drivers/cpufreq/qcom-cpufreq-kryo.c | 11825 | F: drivers/cpufreq/qcom-cpufreq-kryo.c |
| 11810 | 11826 | ||
| 11811 | QUALCOMM EMAC GIGABIT ETHERNET DRIVER | 11827 | QUALCOMM EMAC GIGABIT ETHERNET DRIVER |
| 11812 | M: Timur Tabi <timur@codeaurora.org> | 11828 | M: Timur Tabi <timur@kernel.org> |
| 11813 | L: netdev@vger.kernel.org | 11829 | L: netdev@vger.kernel.org |
| 11814 | S: Supported | 11830 | S: Maintained |
| 11815 | F: drivers/net/ethernet/qualcomm/emac/ | 11831 | F: drivers/net/ethernet/qualcomm/emac/ |
| 11816 | 11832 | ||
| 11817 | QUALCOMM HEXAGON ARCHITECTURE | 11833 | QUALCOMM HEXAGON ARCHITECTURE |
| @@ -11822,7 +11838,7 @@ S: Supported | |||
| 11822 | F: arch/hexagon/ | 11838 | F: arch/hexagon/ |
| 11823 | 11839 | ||
| 11824 | QUALCOMM HIDMA DRIVER | 11840 | QUALCOMM HIDMA DRIVER |
| 11825 | M: Sinan Kaya <okaya@codeaurora.org> | 11841 | M: Sinan Kaya <okaya@kernel.org> |
| 11826 | L: linux-arm-kernel@lists.infradead.org | 11842 | L: linux-arm-kernel@lists.infradead.org |
| 11827 | L: linux-arm-msm@vger.kernel.org | 11843 | L: linux-arm-msm@vger.kernel.org |
| 11828 | L: dmaengine@vger.kernel.org | 11844 | L: dmaengine@vger.kernel.org |
| @@ -2,7 +2,7 @@ | |||
| 2 | VERSION = 4 | 2 | VERSION = 4 |
| 3 | PATCHLEVEL = 18 | 3 | PATCHLEVEL = 18 |
| 4 | SUBLEVEL = 0 | 4 | SUBLEVEL = 0 |
| 5 | EXTRAVERSION = -rc2 | 5 | EXTRAVERSION = -rc4 |
| 6 | NAME = Merciless Moray | 6 | NAME = Merciless Moray |
| 7 | 7 | ||
| 8 | # *DOCUMENTATION* | 8 | # *DOCUMENTATION* |
| @@ -353,9 +353,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ | |||
| 353 | else if [ -x /bin/bash ]; then echo /bin/bash; \ | 353 | else if [ -x /bin/bash ]; then echo /bin/bash; \ |
| 354 | else echo sh; fi ; fi) | 354 | else echo sh; fi ; fi) |
| 355 | 355 | ||
| 356 | HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS) | 356 | HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null) |
| 357 | HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS) | 357 | HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null) |
| 358 | HOST_LFS_LIBS := $(shell getconf LFS_LIBS) | 358 | HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null) |
| 359 | 359 | ||
| 360 | HOSTCC = gcc | 360 | HOSTCC = gcc |
| 361 | HOSTCXX = g++ | 361 | HOSTCXX = g++ |
| @@ -507,11 +507,6 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLA | |||
| 507 | KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO | 507 | KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO |
| 508 | endif | 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 | # The expansion should be delayed until arch/$(SRCARCH)/Makefile is included. | 510 | # The expansion should be delayed until arch/$(SRCARCH)/Makefile is included. |
| 516 | # Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile. | 511 | # Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile. |
| 517 | # CC_VERSION_TEXT is referenced from Kconfig (so it needs export), | 512 | # CC_VERSION_TEXT is referenced from Kconfig (so it needs export), |
| @@ -1717,6 +1712,6 @@ endif # skip-makefile | |||
| 1717 | PHONY += FORCE | 1712 | PHONY += FORCE |
| 1718 | FORCE: | 1713 | FORCE: |
| 1719 | 1714 | ||
| 1720 | # Declare the contents of the .PHONY variable as phony. We keep that | 1715 | # Declare the contents of the PHONY variable as phony. We keep that |
| 1721 | # information in a variable so we can use it in if_changed and friends. | 1716 | # information in a variable so we can use it in if_changed and friends. |
| 1722 | .PHONY: $(PHONY) | 1717 | .PHONY: $(PHONY) |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 54eeb8d00bc6..843edfd000be 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -1245,8 +1245,14 @@ config PCI | |||
| 1245 | VESA. If you have PCI, say Y, otherwise N. | 1245 | VESA. If you have PCI, say Y, otherwise N. |
| 1246 | 1246 | ||
| 1247 | config PCI_DOMAINS | 1247 | config PCI_DOMAINS |
| 1248 | bool | 1248 | bool "Support for multiple PCI domains" |
| 1249 | depends on PCI | 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 | config PCI_DOMAINS_GENERIC | 1257 | config PCI_DOMAINS_GENERIC |
| 1252 | def_bool PCI_DOMAINS | 1258 | def_bool PCI_DOMAINS |
diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi index f9e8667f5886..73b514dddf65 100644 --- a/arch/arm/boot/dts/am335x-bone-common.dtsi +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi | |||
| @@ -168,7 +168,6 @@ | |||
| 168 | AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3.mmc0_dat3 */ | 168 | AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3.mmc0_dat3 */ |
| 169 | AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd.mmc0_cmd */ | 169 | AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd.mmc0_cmd */ |
| 170 | AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk.mmc0_clk */ | 170 | AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk.mmc0_clk */ |
| 171 | AM33XX_IOPAD(0x9a0, PIN_INPUT | MUX_MODE4) /* mcasp0_aclkr.mmc0_sdwp */ | ||
| 172 | >; | 171 | >; |
| 173 | }; | 172 | }; |
| 174 | 173 | ||
diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi index ca294914bbb1..4b6062b631b1 100644 --- a/arch/arm/boot/dts/am3517.dtsi +++ b/arch/arm/boot/dts/am3517.dtsi | |||
| @@ -39,6 +39,8 @@ | |||
| 39 | ti,davinci-ctrl-ram-size = <0x2000>; | 39 | ti,davinci-ctrl-ram-size = <0x2000>; |
| 40 | ti,davinci-rmii-en = /bits/ 8 <1>; | 40 | ti,davinci-rmii-en = /bits/ 8 <1>; |
| 41 | local-mac-address = [ 00 00 00 00 00 00 ]; | 41 | local-mac-address = [ 00 00 00 00 00 00 ]; |
| 42 | clocks = <&emac_ick>; | ||
| 43 | clock-names = "ick"; | ||
| 42 | }; | 44 | }; |
| 43 | 45 | ||
| 44 | davinci_mdio: ethernet@5c030000 { | 46 | davinci_mdio: ethernet@5c030000 { |
| @@ -49,6 +51,8 @@ | |||
| 49 | bus_freq = <1000000>; | 51 | bus_freq = <1000000>; |
| 50 | #address-cells = <1>; | 52 | #address-cells = <1>; |
| 51 | #size-cells = <0>; | 53 | #size-cells = <0>; |
| 54 | clocks = <&emac_fck>; | ||
| 55 | clock-names = "fck"; | ||
| 52 | }; | 56 | }; |
| 53 | 57 | ||
| 54 | uart4: serial@4809e000 { | 58 | uart4: serial@4809e000 { |
diff --git a/arch/arm/boot/dts/am437x-sk-evm.dts b/arch/arm/boot/dts/am437x-sk-evm.dts index 440351ad0b80..d4be3fd0b6f4 100644 --- a/arch/arm/boot/dts/am437x-sk-evm.dts +++ b/arch/arm/boot/dts/am437x-sk-evm.dts | |||
| @@ -610,6 +610,8 @@ | |||
| 610 | 610 | ||
| 611 | touchscreen-size-x = <480>; | 611 | touchscreen-size-x = <480>; |
| 612 | touchscreen-size-y = <272>; | 612 | touchscreen-size-y = <272>; |
| 613 | |||
| 614 | wakeup-source; | ||
| 613 | }; | 615 | }; |
| 614 | 616 | ||
| 615 | tlv320aic3106: tlv320aic3106@1b { | 617 | tlv320aic3106: tlv320aic3106@1b { |
diff --git a/arch/arm/boot/dts/armada-385-synology-ds116.dts b/arch/arm/boot/dts/armada-385-synology-ds116.dts index 6782ce481ac9..d8769956cbfc 100644 --- a/arch/arm/boot/dts/armada-385-synology-ds116.dts +++ b/arch/arm/boot/dts/armada-385-synology-ds116.dts | |||
| @@ -139,7 +139,7 @@ | |||
| 139 | 3700 5 | 139 | 3700 5 |
| 140 | 3900 6 | 140 | 3900 6 |
| 141 | 4000 7>; | 141 | 4000 7>; |
| 142 | cooling-cells = <2>; | 142 | #cooling-cells = <2>; |
| 143 | }; | 143 | }; |
| 144 | 144 | ||
| 145 | gpio-leds { | 145 | gpio-leds { |
diff --git a/arch/arm/boot/dts/bcm-cygnus.dtsi b/arch/arm/boot/dts/bcm-cygnus.dtsi index 9fe4f5a6379e..2c4df2d2d4a6 100644 --- a/arch/arm/boot/dts/bcm-cygnus.dtsi +++ b/arch/arm/boot/dts/bcm-cygnus.dtsi | |||
| @@ -216,7 +216,7 @@ | |||
| 216 | reg = <0x18008000 0x100>; | 216 | reg = <0x18008000 0x100>; |
| 217 | #address-cells = <1>; | 217 | #address-cells = <1>; |
| 218 | #size-cells = <0>; | 218 | #size-cells = <0>; |
| 219 | interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>; | 219 | interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>; |
| 220 | clock-frequency = <100000>; | 220 | clock-frequency = <100000>; |
| 221 | status = "disabled"; | 221 | status = "disabled"; |
| 222 | }; | 222 | }; |
| @@ -245,7 +245,7 @@ | |||
| 245 | reg = <0x1800b000 0x100>; | 245 | reg = <0x1800b000 0x100>; |
| 246 | #address-cells = <1>; | 246 | #address-cells = <1>; |
| 247 | #size-cells = <0>; | 247 | #size-cells = <0>; |
| 248 | interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>; | 248 | interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; |
| 249 | clock-frequency = <100000>; | 249 | clock-frequency = <100000>; |
| 250 | status = "disabled"; | 250 | status = "disabled"; |
| 251 | }; | 251 | }; |
| @@ -256,7 +256,7 @@ | |||
| 256 | 256 | ||
| 257 | #interrupt-cells = <1>; | 257 | #interrupt-cells = <1>; |
| 258 | interrupt-map-mask = <0 0 0 0>; | 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 | linux,pci-domain = <0>; | 261 | linux,pci-domain = <0>; |
| 262 | 262 | ||
| @@ -278,10 +278,10 @@ | |||
| 278 | compatible = "brcm,iproc-msi"; | 278 | compatible = "brcm,iproc-msi"; |
| 279 | msi-controller; | 279 | msi-controller; |
| 280 | interrupt-parent = <&gic>; | 280 | interrupt-parent = <&gic>; |
| 281 | interrupts = <GIC_SPI 96 IRQ_TYPE_NONE>, | 281 | interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>, |
| 282 | <GIC_SPI 97 IRQ_TYPE_NONE>, | 282 | <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>, |
| 283 | <GIC_SPI 98 IRQ_TYPE_NONE>, | 283 | <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>, |
| 284 | <GIC_SPI 99 IRQ_TYPE_NONE>; | 284 | <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; |
| 285 | }; | 285 | }; |
| 286 | }; | 286 | }; |
| 287 | 287 | ||
| @@ -291,7 +291,7 @@ | |||
| 291 | 291 | ||
| 292 | #interrupt-cells = <1>; | 292 | #interrupt-cells = <1>; |
| 293 | interrupt-map-mask = <0 0 0 0>; | 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 | linux,pci-domain = <1>; | 296 | linux,pci-domain = <1>; |
| 297 | 297 | ||
| @@ -313,10 +313,10 @@ | |||
| 313 | compatible = "brcm,iproc-msi"; | 313 | compatible = "brcm,iproc-msi"; |
| 314 | msi-controller; | 314 | msi-controller; |
| 315 | interrupt-parent = <&gic>; | 315 | interrupt-parent = <&gic>; |
| 316 | interrupts = <GIC_SPI 102 IRQ_TYPE_NONE>, | 316 | interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>, |
| 317 | <GIC_SPI 103 IRQ_TYPE_NONE>, | 317 | <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>, |
| 318 | <GIC_SPI 104 IRQ_TYPE_NONE>, | 318 | <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>, |
| 319 | <GIC_SPI 105 IRQ_TYPE_NONE>; | 319 | <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; |
| 320 | }; | 320 | }; |
| 321 | }; | 321 | }; |
| 322 | 322 | ||
diff --git a/arch/arm/boot/dts/bcm-hr2.dtsi b/arch/arm/boot/dts/bcm-hr2.dtsi index 3f9cedd8011f..3084a7c95733 100644 --- a/arch/arm/boot/dts/bcm-hr2.dtsi +++ b/arch/arm/boot/dts/bcm-hr2.dtsi | |||
| @@ -264,7 +264,7 @@ | |||
| 264 | reg = <0x38000 0x50>; | 264 | reg = <0x38000 0x50>; |
| 265 | #address-cells = <1>; | 265 | #address-cells = <1>; |
| 266 | #size-cells = <0>; | 266 | #size-cells = <0>; |
| 267 | interrupts = <GIC_SPI 95 IRQ_TYPE_NONE>; | 267 | interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; |
| 268 | clock-frequency = <100000>; | 268 | clock-frequency = <100000>; |
| 269 | }; | 269 | }; |
| 270 | 270 | ||
| @@ -279,7 +279,7 @@ | |||
| 279 | reg = <0x3b000 0x50>; | 279 | reg = <0x3b000 0x50>; |
| 280 | #address-cells = <1>; | 280 | #address-cells = <1>; |
| 281 | #size-cells = <0>; | 281 | #size-cells = <0>; |
| 282 | interrupts = <GIC_SPI 96 IRQ_TYPE_NONE>; | 282 | interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; |
| 283 | clock-frequency = <100000>; | 283 | clock-frequency = <100000>; |
| 284 | }; | 284 | }; |
| 285 | }; | 285 | }; |
| @@ -300,7 +300,7 @@ | |||
| 300 | 300 | ||
| 301 | #interrupt-cells = <1>; | 301 | #interrupt-cells = <1>; |
| 302 | interrupt-map-mask = <0 0 0 0>; | 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 | linux,pci-domain = <0>; | 305 | linux,pci-domain = <0>; |
| 306 | 306 | ||
| @@ -322,10 +322,10 @@ | |||
| 322 | compatible = "brcm,iproc-msi"; | 322 | compatible = "brcm,iproc-msi"; |
| 323 | msi-controller; | 323 | msi-controller; |
| 324 | interrupt-parent = <&gic>; | 324 | interrupt-parent = <&gic>; |
| 325 | interrupts = <GIC_SPI 182 IRQ_TYPE_NONE>, | 325 | interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>, |
| 326 | <GIC_SPI 183 IRQ_TYPE_NONE>, | 326 | <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>, |
| 327 | <GIC_SPI 184 IRQ_TYPE_NONE>, | 327 | <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>, |
| 328 | <GIC_SPI 185 IRQ_TYPE_NONE>; | 328 | <GIC_SPI 185 IRQ_TYPE_LEVEL_HIGH>; |
| 329 | brcm,pcie-msi-inten; | 329 | brcm,pcie-msi-inten; |
| 330 | }; | 330 | }; |
| 331 | }; | 331 | }; |
| @@ -336,7 +336,7 @@ | |||
| 336 | 336 | ||
| 337 | #interrupt-cells = <1>; | 337 | #interrupt-cells = <1>; |
| 338 | interrupt-map-mask = <0 0 0 0>; | 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 | linux,pci-domain = <1>; | 341 | linux,pci-domain = <1>; |
| 342 | 342 | ||
| @@ -358,10 +358,10 @@ | |||
| 358 | compatible = "brcm,iproc-msi"; | 358 | compatible = "brcm,iproc-msi"; |
| 359 | msi-controller; | 359 | msi-controller; |
| 360 | interrupt-parent = <&gic>; | 360 | interrupt-parent = <&gic>; |
| 361 | interrupts = <GIC_SPI 188 IRQ_TYPE_NONE>, | 361 | interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>, |
| 362 | <GIC_SPI 189 IRQ_TYPE_NONE>, | 362 | <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>, |
| 363 | <GIC_SPI 190 IRQ_TYPE_NONE>, | 363 | <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>, |
| 364 | <GIC_SPI 191 IRQ_TYPE_NONE>; | 364 | <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>; |
| 365 | brcm,pcie-msi-inten; | 365 | brcm,pcie-msi-inten; |
| 366 | }; | 366 | }; |
| 367 | }; | 367 | }; |
diff --git a/arch/arm/boot/dts/bcm-nsp.dtsi b/arch/arm/boot/dts/bcm-nsp.dtsi index dcc55aa84583..09ba85046322 100644 --- a/arch/arm/boot/dts/bcm-nsp.dtsi +++ b/arch/arm/boot/dts/bcm-nsp.dtsi | |||
| @@ -391,7 +391,7 @@ | |||
| 391 | reg = <0x38000 0x50>; | 391 | reg = <0x38000 0x50>; |
| 392 | #address-cells = <1>; | 392 | #address-cells = <1>; |
| 393 | #size-cells = <0>; | 393 | #size-cells = <0>; |
| 394 | interrupts = <GIC_SPI 89 IRQ_TYPE_NONE>; | 394 | interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>; |
| 395 | clock-frequency = <100000>; | 395 | clock-frequency = <100000>; |
| 396 | dma-coherent; | 396 | dma-coherent; |
| 397 | status = "disabled"; | 397 | status = "disabled"; |
| @@ -496,7 +496,7 @@ | |||
| 496 | 496 | ||
| 497 | #interrupt-cells = <1>; | 497 | #interrupt-cells = <1>; |
| 498 | interrupt-map-mask = <0 0 0 0>; | 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 | linux,pci-domain = <0>; | 501 | linux,pci-domain = <0>; |
| 502 | 502 | ||
| @@ -519,10 +519,10 @@ | |||
| 519 | compatible = "brcm,iproc-msi"; | 519 | compatible = "brcm,iproc-msi"; |
| 520 | msi-controller; | 520 | msi-controller; |
| 521 | interrupt-parent = <&gic>; | 521 | interrupt-parent = <&gic>; |
| 522 | interrupts = <GIC_SPI 127 IRQ_TYPE_NONE>, | 522 | interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>, |
| 523 | <GIC_SPI 128 IRQ_TYPE_NONE>, | 523 | <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>, |
| 524 | <GIC_SPI 129 IRQ_TYPE_NONE>, | 524 | <GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>, |
| 525 | <GIC_SPI 130 IRQ_TYPE_NONE>; | 525 | <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>; |
| 526 | brcm,pcie-msi-inten; | 526 | brcm,pcie-msi-inten; |
| 527 | }; | 527 | }; |
| 528 | }; | 528 | }; |
| @@ -533,7 +533,7 @@ | |||
| 533 | 533 | ||
| 534 | #interrupt-cells = <1>; | 534 | #interrupt-cells = <1>; |
| 535 | interrupt-map-mask = <0 0 0 0>; | 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 | linux,pci-domain = <1>; | 538 | linux,pci-domain = <1>; |
| 539 | 539 | ||
| @@ -556,10 +556,10 @@ | |||
| 556 | compatible = "brcm,iproc-msi"; | 556 | compatible = "brcm,iproc-msi"; |
| 557 | msi-controller; | 557 | msi-controller; |
| 558 | interrupt-parent = <&gic>; | 558 | interrupt-parent = <&gic>; |
| 559 | interrupts = <GIC_SPI 133 IRQ_TYPE_NONE>, | 559 | interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>, |
| 560 | <GIC_SPI 134 IRQ_TYPE_NONE>, | 560 | <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>, |
| 561 | <GIC_SPI 135 IRQ_TYPE_NONE>, | 561 | <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>, |
| 562 | <GIC_SPI 136 IRQ_TYPE_NONE>; | 562 | <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>; |
| 563 | brcm,pcie-msi-inten; | 563 | brcm,pcie-msi-inten; |
| 564 | }; | 564 | }; |
| 565 | }; | 565 | }; |
| @@ -570,7 +570,7 @@ | |||
| 570 | 570 | ||
| 571 | #interrupt-cells = <1>; | 571 | #interrupt-cells = <1>; |
| 572 | interrupt-map-mask = <0 0 0 0>; | 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 | linux,pci-domain = <2>; | 575 | linux,pci-domain = <2>; |
| 576 | 576 | ||
| @@ -593,10 +593,10 @@ | |||
| 593 | compatible = "brcm,iproc-msi"; | 593 | compatible = "brcm,iproc-msi"; |
| 594 | msi-controller; | 594 | msi-controller; |
| 595 | interrupt-parent = <&gic>; | 595 | interrupt-parent = <&gic>; |
| 596 | interrupts = <GIC_SPI 139 IRQ_TYPE_NONE>, | 596 | interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>, |
| 597 | <GIC_SPI 140 IRQ_TYPE_NONE>, | 597 | <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>, |
| 598 | <GIC_SPI 141 IRQ_TYPE_NONE>, | 598 | <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>, |
| 599 | <GIC_SPI 142 IRQ_TYPE_NONE>; | 599 | <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>; |
| 600 | brcm,pcie-msi-inten; | 600 | brcm,pcie-msi-inten; |
| 601 | }; | 601 | }; |
| 602 | }; | 602 | }; |
diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi index 9a076c409f4e..ef995e50ee12 100644 --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi | |||
| @@ -365,7 +365,7 @@ | |||
| 365 | i2c0: i2c@18009000 { | 365 | i2c0: i2c@18009000 { |
| 366 | compatible = "brcm,iproc-i2c"; | 366 | compatible = "brcm,iproc-i2c"; |
| 367 | reg = <0x18009000 0x50>; | 367 | reg = <0x18009000 0x50>; |
| 368 | interrupts = <GIC_SPI 121 IRQ_TYPE_NONE>; | 368 | interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>; |
| 369 | #address-cells = <1>; | 369 | #address-cells = <1>; |
| 370 | #size-cells = <0>; | 370 | #size-cells = <0>; |
| 371 | clock-frequency = <100000>; | 371 | clock-frequency = <100000>; |
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi index f6f1597b03df..0f4f817a9e22 100644 --- a/arch/arm/boot/dts/da850.dtsi +++ b/arch/arm/boot/dts/da850.dtsi | |||
| @@ -549,11 +549,7 @@ | |||
| 549 | gpio-controller; | 549 | gpio-controller; |
| 550 | #gpio-cells = <2>; | 550 | #gpio-cells = <2>; |
| 551 | reg = <0x226000 0x1000>; | 551 | reg = <0x226000 0x1000>; |
| 552 | interrupts = <42 IRQ_TYPE_EDGE_BOTH | 552 | interrupts = <42 43 44 45 46 47 48 49 50>; |
| 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>; | ||
| 557 | ti,ngpio = <144>; | 553 | ti,ngpio = <144>; |
| 558 | ti,davinci-gpio-unbanked = <0>; | 554 | ti,davinci-gpio-unbanked = <0>; |
| 559 | status = "disabled"; | 555 | status = "disabled"; |
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi index 9dcd14edc202..e03495a799ce 100644 --- a/arch/arm/boot/dts/dra7.dtsi +++ b/arch/arm/boot/dts/dra7.dtsi | |||
| @@ -1580,7 +1580,6 @@ | |||
| 1580 | dr_mode = "otg"; | 1580 | dr_mode = "otg"; |
| 1581 | snps,dis_u3_susphy_quirk; | 1581 | snps,dis_u3_susphy_quirk; |
| 1582 | snps,dis_u2_susphy_quirk; | 1582 | snps,dis_u2_susphy_quirk; |
| 1583 | snps,dis_metastability_quirk; | ||
| 1584 | }; | 1583 | }; |
| 1585 | }; | 1584 | }; |
| 1586 | 1585 | ||
| @@ -1608,6 +1607,7 @@ | |||
| 1608 | dr_mode = "otg"; | 1607 | dr_mode = "otg"; |
| 1609 | snps,dis_u3_susphy_quirk; | 1608 | snps,dis_u3_susphy_quirk; |
| 1610 | snps,dis_u2_susphy_quirk; | 1609 | snps,dis_u2_susphy_quirk; |
| 1610 | snps,dis_metastability_quirk; | ||
| 1611 | }; | 1611 | }; |
| 1612 | }; | 1612 | }; |
| 1613 | 1613 | ||
diff --git a/arch/arm/boot/dts/imx51-zii-rdu1.dts b/arch/arm/boot/dts/imx51-zii-rdu1.dts index df9eca94d812..8a878687197b 100644 --- a/arch/arm/boot/dts/imx51-zii-rdu1.dts +++ b/arch/arm/boot/dts/imx51-zii-rdu1.dts | |||
| @@ -770,7 +770,7 @@ | |||
| 770 | 770 | ||
| 771 | pinctrl_ts: tsgrp { | 771 | pinctrl_ts: tsgrp { |
| 772 | fsl,pins = < | 772 | fsl,pins = < |
| 773 | MX51_PAD_CSI1_D8__GPIO3_12 0x85 | 773 | MX51_PAD_CSI1_D8__GPIO3_12 0x04 |
| 774 | MX51_PAD_CSI1_D9__GPIO3_13 0x85 | 774 | MX51_PAD_CSI1_D9__GPIO3_13 0x85 |
| 775 | >; | 775 | >; |
| 776 | }; | 776 | }; |
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index 70483ce72ba6..77f8f030dd07 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi | |||
| @@ -90,7 +90,7 @@ | |||
| 90 | clocks = <&clks IMX6Q_CLK_ECSPI5>, | 90 | clocks = <&clks IMX6Q_CLK_ECSPI5>, |
| 91 | <&clks IMX6Q_CLK_ECSPI5>; | 91 | <&clks IMX6Q_CLK_ECSPI5>; |
| 92 | clock-names = "ipg", "per"; | 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 | dma-names = "rx", "tx"; | 94 | dma-names = "rx", "tx"; |
| 95 | status = "disabled"; | 95 | status = "disabled"; |
| 96 | }; | 96 | }; |
diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi index d8b94f47498b..4e4a55aad5c9 100644 --- a/arch/arm/boot/dts/imx6sx.dtsi +++ b/arch/arm/boot/dts/imx6sx.dtsi | |||
| @@ -1344,7 +1344,7 @@ | |||
| 1344 | ranges = <0x81000000 0 0 0x08f80000 0 0x00010000 /* downstream I/O */ | 1344 | ranges = <0x81000000 0 0 0x08f80000 0 0x00010000 /* downstream I/O */ |
| 1345 | 0x82000000 0 0x08000000 0x08000000 0 0x00f00000>; /* non-prefetchable memory */ | 1345 | 0x82000000 0 0x08000000 0x08000000 0 0x00f00000>; /* non-prefetchable memory */ |
| 1346 | num-lanes = <1>; | 1346 | num-lanes = <1>; |
| 1347 | interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>; | 1347 | interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; |
| 1348 | interrupt-names = "msi"; | 1348 | interrupt-names = "msi"; |
| 1349 | #interrupt-cells = <1>; | 1349 | #interrupt-cells = <1>; |
| 1350 | interrupt-map-mask = <0 0 0 0x7>; | 1350 | interrupt-map-mask = <0 0 0 0x7>; |
diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi index 486d4e7433ed..b38f8c240558 100644 --- a/arch/arm/boot/dts/socfpga.dtsi +++ b/arch/arm/boot/dts/socfpga.dtsi | |||
| @@ -748,13 +748,13 @@ | |||
| 748 | nand0: nand@ff900000 { | 748 | nand0: nand@ff900000 { |
| 749 | #address-cells = <0x1>; | 749 | #address-cells = <0x1>; |
| 750 | #size-cells = <0x1>; | 750 | #size-cells = <0x1>; |
| 751 | compatible = "denali,denali-nand-dt"; | 751 | compatible = "altr,socfpga-denali-nand"; |
| 752 | reg = <0xff900000 0x100000>, | 752 | reg = <0xff900000 0x100000>, |
| 753 | <0xffb80000 0x10000>; | 753 | <0xffb80000 0x10000>; |
| 754 | reg-names = "nand_data", "denali_reg"; | 754 | reg-names = "nand_data", "denali_reg"; |
| 755 | interrupts = <0x0 0x90 0x4>; | 755 | interrupts = <0x0 0x90 0x4>; |
| 756 | dma-mask = <0xffffffff>; | 756 | dma-mask = <0xffffffff>; |
| 757 | clocks = <&nand_clk>; | 757 | clocks = <&nand_x_clk>; |
| 758 | status = "disabled"; | 758 | status = "disabled"; |
| 759 | }; | 759 | }; |
| 760 | 760 | ||
diff --git a/arch/arm/boot/dts/socfpga_arria10.dtsi b/arch/arm/boot/dts/socfpga_arria10.dtsi index bead79e4b2aa..791ca15c799e 100644 --- a/arch/arm/boot/dts/socfpga_arria10.dtsi +++ b/arch/arm/boot/dts/socfpga_arria10.dtsi | |||
| @@ -593,8 +593,7 @@ | |||
| 593 | #size-cells = <0>; | 593 | #size-cells = <0>; |
| 594 | reg = <0xffda5000 0x100>; | 594 | reg = <0xffda5000 0x100>; |
| 595 | interrupts = <0 102 4>; | 595 | interrupts = <0 102 4>; |
| 596 | num-chipselect = <4>; | 596 | num-cs = <4>; |
| 597 | bus-num = <0>; | ||
| 598 | /*32bit_access;*/ | 597 | /*32bit_access;*/ |
| 599 | tx-dma-channel = <&pdma 16>; | 598 | tx-dma-channel = <&pdma 16>; |
| 600 | rx-dma-channel = <&pdma 17>; | 599 | rx-dma-channel = <&pdma 17>; |
| @@ -633,7 +632,7 @@ | |||
| 633 | nand: nand@ffb90000 { | 632 | nand: nand@ffb90000 { |
| 634 | #address-cells = <1>; | 633 | #address-cells = <1>; |
| 635 | #size-cells = <1>; | 634 | #size-cells = <1>; |
| 636 | compatible = "denali,denali-nand-dt", "altr,socfpga-denali-nand"; | 635 | compatible = "altr,socfpga-denali-nand"; |
| 637 | reg = <0xffb90000 0x72000>, | 636 | reg = <0xffb90000 0x72000>, |
| 638 | <0xffb80000 0x10000>; | 637 | <0xffb80000 0x10000>; |
| 639 | reg-names = "nand_data", "denali_reg"; | 638 | reg-names = "nand_data", "denali_reg"; |
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile index 1e9f7af8f70f..3157be413297 100644 --- a/arch/arm/common/Makefile +++ b/arch/arm/common/Makefile | |||
| @@ -10,7 +10,7 @@ obj-$(CONFIG_DMABOUNCE) += dmabounce.o | |||
| 10 | obj-$(CONFIG_SHARP_LOCOMO) += locomo.o | 10 | obj-$(CONFIG_SHARP_LOCOMO) += locomo.o |
| 11 | obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o | 11 | obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o |
| 12 | obj-$(CONFIG_SHARP_SCOOP) += scoop.o | 12 | obj-$(CONFIG_SHARP_SCOOP) += scoop.o |
| 13 | obj-$(CONFIG_SMP) += secure_cntvoff.o | 13 | obj-$(CONFIG_CPU_V7) += secure_cntvoff.o |
| 14 | obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o | 14 | obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o |
| 15 | obj-$(CONFIG_MCPM) += mcpm_head.o mcpm_entry.o mcpm_platsmp.o vlock.o | 15 | obj-$(CONFIG_MCPM) += mcpm_head.o mcpm_entry.o mcpm_platsmp.o vlock.o |
| 16 | CFLAGS_REMOVE_mcpm_entry.o = -pg | 16 | CFLAGS_REMOVE_mcpm_entry.o = -pg |
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig index 054591dc9a00..4cd2f4a2bff4 100644 --- a/arch/arm/configs/imx_v4_v5_defconfig +++ b/arch/arm/configs/imx_v4_v5_defconfig | |||
| @@ -141,9 +141,11 @@ CONFIG_USB_STORAGE=y | |||
| 141 | CONFIG_USB_CHIPIDEA=y | 141 | CONFIG_USB_CHIPIDEA=y |
| 142 | CONFIG_USB_CHIPIDEA_UDC=y | 142 | CONFIG_USB_CHIPIDEA_UDC=y |
| 143 | CONFIG_USB_CHIPIDEA_HOST=y | 143 | CONFIG_USB_CHIPIDEA_HOST=y |
| 144 | CONFIG_USB_CHIPIDEA_ULPI=y | ||
| 144 | CONFIG_NOP_USB_XCEIV=y | 145 | CONFIG_NOP_USB_XCEIV=y |
| 145 | CONFIG_USB_GADGET=y | 146 | CONFIG_USB_GADGET=y |
| 146 | CONFIG_USB_ETH=m | 147 | CONFIG_USB_ETH=m |
| 148 | CONFIG_USB_ULPI_BUS=y | ||
| 147 | CONFIG_MMC=y | 149 | CONFIG_MMC=y |
| 148 | CONFIG_MMC_SDHCI=y | 150 | CONFIG_MMC_SDHCI=y |
| 149 | CONFIG_MMC_SDHCI_PLTFM=y | 151 | CONFIG_MMC_SDHCI_PLTFM=y |
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index f70507ab91ee..200ebda47e0c 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig | |||
| @@ -302,6 +302,7 @@ CONFIG_USB_STORAGE=y | |||
| 302 | CONFIG_USB_CHIPIDEA=y | 302 | CONFIG_USB_CHIPIDEA=y |
| 303 | CONFIG_USB_CHIPIDEA_UDC=y | 303 | CONFIG_USB_CHIPIDEA_UDC=y |
| 304 | CONFIG_USB_CHIPIDEA_HOST=y | 304 | CONFIG_USB_CHIPIDEA_HOST=y |
| 305 | CONFIG_USB_CHIPIDEA_ULPI=y | ||
| 305 | CONFIG_USB_SERIAL=m | 306 | CONFIG_USB_SERIAL=m |
| 306 | CONFIG_USB_SERIAL_GENERIC=y | 307 | CONFIG_USB_SERIAL_GENERIC=y |
| 307 | CONFIG_USB_SERIAL_FTDI_SIO=m | 308 | CONFIG_USB_SERIAL_FTDI_SIO=m |
| @@ -338,6 +339,7 @@ CONFIG_USB_GADGETFS=m | |||
| 338 | CONFIG_USB_FUNCTIONFS=m | 339 | CONFIG_USB_FUNCTIONFS=m |
| 339 | CONFIG_USB_MASS_STORAGE=m | 340 | CONFIG_USB_MASS_STORAGE=m |
| 340 | CONFIG_USB_G_SERIAL=m | 341 | CONFIG_USB_G_SERIAL=m |
| 342 | CONFIG_USB_ULPI_BUS=y | ||
| 341 | CONFIG_MMC=y | 343 | CONFIG_MMC=y |
| 342 | CONFIG_MMC_SDHCI=y | 344 | CONFIG_MMC_SDHCI=y |
| 343 | CONFIG_MMC_SDHCI_PLTFM=y | 345 | CONFIG_MMC_SDHCI_PLTFM=y |
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 7e1c543162c3..8f6be1982545 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | CONFIG_SYSVIPC=y | 1 | CONFIG_SYSVIPC=y |
| 2 | CONFIG_FHANDLE=y | ||
| 3 | CONFIG_NO_HZ=y | 2 | CONFIG_NO_HZ=y |
| 4 | CONFIG_HIGH_RES_TIMERS=y | 3 | CONFIG_HIGH_RES_TIMERS=y |
| 5 | CONFIG_CGROUPS=y | 4 | CONFIG_CGROUPS=y |
| @@ -10,20 +9,10 @@ CONFIG_MODULES=y | |||
| 10 | CONFIG_MODULE_UNLOAD=y | 9 | CONFIG_MODULE_UNLOAD=y |
| 11 | CONFIG_PARTITION_ADVANCED=y | 10 | CONFIG_PARTITION_ADVANCED=y |
| 12 | CONFIG_CMDLINE_PARTITION=y | 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 | CONFIG_ARCH_VIRT=y | 12 | CONFIG_ARCH_VIRT=y |
| 17 | CONFIG_ARCH_ALPINE=y | 13 | CONFIG_ARCH_ALPINE=y |
| 18 | CONFIG_ARCH_ARTPEC=y | 14 | CONFIG_ARCH_ARTPEC=y |
| 19 | CONFIG_MACH_ARTPEC6=y | 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 | CONFIG_ARCH_AT91=y | 16 | CONFIG_ARCH_AT91=y |
| 28 | CONFIG_SOC_SAMA5D2=y | 17 | CONFIG_SOC_SAMA5D2=y |
| 29 | CONFIG_SOC_SAMA5D3=y | 18 | CONFIG_SOC_SAMA5D3=y |
| @@ -32,9 +21,9 @@ CONFIG_ARCH_BCM=y | |||
| 32 | CONFIG_ARCH_BCM_CYGNUS=y | 21 | CONFIG_ARCH_BCM_CYGNUS=y |
| 33 | CONFIG_ARCH_BCM_HR2=y | 22 | CONFIG_ARCH_BCM_HR2=y |
| 34 | CONFIG_ARCH_BCM_NSP=y | 23 | CONFIG_ARCH_BCM_NSP=y |
| 35 | CONFIG_ARCH_BCM_21664=y | ||
| 36 | CONFIG_ARCH_BCM_281XX=y | ||
| 37 | CONFIG_ARCH_BCM_5301X=y | 24 | CONFIG_ARCH_BCM_5301X=y |
| 25 | CONFIG_ARCH_BCM_281XX=y | ||
| 26 | CONFIG_ARCH_BCM_21664=y | ||
| 38 | CONFIG_ARCH_BCM2835=y | 27 | CONFIG_ARCH_BCM2835=y |
| 39 | CONFIG_ARCH_BCM_63XX=y | 28 | CONFIG_ARCH_BCM_63XX=y |
| 40 | CONFIG_ARCH_BRCMSTB=y | 29 | CONFIG_ARCH_BRCMSTB=y |
| @@ -43,14 +32,14 @@ CONFIG_MACH_BERLIN_BG2=y | |||
| 43 | CONFIG_MACH_BERLIN_BG2CD=y | 32 | CONFIG_MACH_BERLIN_BG2CD=y |
| 44 | CONFIG_MACH_BERLIN_BG2Q=y | 33 | CONFIG_MACH_BERLIN_BG2Q=y |
| 45 | CONFIG_ARCH_DIGICOLOR=y | 34 | CONFIG_ARCH_DIGICOLOR=y |
| 35 | CONFIG_ARCH_EXYNOS=y | ||
| 36 | CONFIG_EXYNOS5420_MCPM=y | ||
| 46 | CONFIG_ARCH_HIGHBANK=y | 37 | CONFIG_ARCH_HIGHBANK=y |
| 47 | CONFIG_ARCH_HISI=y | 38 | CONFIG_ARCH_HISI=y |
| 48 | CONFIG_ARCH_HI3xxx=y | 39 | CONFIG_ARCH_HI3xxx=y |
| 49 | CONFIG_ARCH_HIX5HD2=y | ||
| 50 | CONFIG_ARCH_HIP01=y | 40 | CONFIG_ARCH_HIP01=y |
| 51 | CONFIG_ARCH_HIP04=y | 41 | CONFIG_ARCH_HIP04=y |
| 52 | CONFIG_ARCH_KEYSTONE=y | 42 | CONFIG_ARCH_HIX5HD2=y |
| 53 | CONFIG_ARCH_MESON=y | ||
| 54 | CONFIG_ARCH_MXC=y | 43 | CONFIG_ARCH_MXC=y |
| 55 | CONFIG_SOC_IMX50=y | 44 | CONFIG_SOC_IMX50=y |
| 56 | CONFIG_SOC_IMX51=y | 45 | CONFIG_SOC_IMX51=y |
| @@ -60,29 +49,30 @@ CONFIG_SOC_IMX6SL=y | |||
| 60 | CONFIG_SOC_IMX6SX=y | 49 | CONFIG_SOC_IMX6SX=y |
| 61 | CONFIG_SOC_IMX6UL=y | 50 | CONFIG_SOC_IMX6UL=y |
| 62 | CONFIG_SOC_IMX7D=y | 51 | CONFIG_SOC_IMX7D=y |
| 63 | CONFIG_SOC_VF610=y | ||
| 64 | CONFIG_SOC_LS1021A=y | 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 | CONFIG_ARCH_OMAP3=y | 64 | CONFIG_ARCH_OMAP3=y |
| 66 | CONFIG_ARCH_OMAP4=y | 65 | CONFIG_ARCH_OMAP4=y |
| 67 | CONFIG_SOC_OMAP5=y | 66 | CONFIG_SOC_OMAP5=y |
| 68 | CONFIG_SOC_AM33XX=y | 67 | CONFIG_SOC_AM33XX=y |
| 69 | CONFIG_SOC_AM43XX=y | 68 | CONFIG_SOC_AM43XX=y |
| 70 | CONFIG_SOC_DRA7XX=y | 69 | CONFIG_SOC_DRA7XX=y |
| 70 | CONFIG_ARCH_SIRF=y | ||
| 71 | CONFIG_ARCH_QCOM=y | 71 | CONFIG_ARCH_QCOM=y |
| 72 | CONFIG_ARCH_MEDIATEK=y | ||
| 73 | CONFIG_ARCH_MSM8X60=y | 72 | CONFIG_ARCH_MSM8X60=y |
| 74 | CONFIG_ARCH_MSM8960=y | 73 | CONFIG_ARCH_MSM8960=y |
| 75 | CONFIG_ARCH_MSM8974=y | 74 | CONFIG_ARCH_MSM8974=y |
| 76 | CONFIG_ARCH_ROCKCHIP=y | 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 | CONFIG_ARCH_RENESAS=y | 76 | CONFIG_ARCH_RENESAS=y |
| 87 | CONFIG_ARCH_EMEV2=y | 77 | CONFIG_ARCH_EMEV2=y |
| 88 | CONFIG_ARCH_R7S72100=y | 78 | CONFIG_ARCH_R7S72100=y |
| @@ -99,40 +89,33 @@ CONFIG_ARCH_R8A7792=y | |||
| 99 | CONFIG_ARCH_R8A7793=y | 89 | CONFIG_ARCH_R8A7793=y |
| 100 | CONFIG_ARCH_R8A7794=y | 90 | CONFIG_ARCH_R8A7794=y |
| 101 | CONFIG_ARCH_SH73A0=y | 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 | CONFIG_ARCH_SUNXI=y | 99 | CONFIG_ARCH_SUNXI=y |
| 103 | CONFIG_ARCH_SIRF=y | ||
| 104 | CONFIG_ARCH_TEGRA=y | 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 | CONFIG_ARCH_UNIPHIER=y | 101 | CONFIG_ARCH_UNIPHIER=y |
| 110 | CONFIG_ARCH_U8500=y | 102 | CONFIG_ARCH_U8500=y |
| 111 | CONFIG_MACH_HREFV60=y | ||
| 112 | CONFIG_MACH_SNOWBALL=y | ||
| 113 | CONFIG_ARCH_VEXPRESS=y | 103 | CONFIG_ARCH_VEXPRESS=y |
| 114 | CONFIG_ARCH_VEXPRESS_TC2_PM=y | 104 | CONFIG_ARCH_VEXPRESS_TC2_PM=y |
| 115 | CONFIG_ARCH_WM8850=y | 105 | CONFIG_ARCH_WM8850=y |
| 116 | CONFIG_ARCH_ZYNQ=y | 106 | CONFIG_ARCH_ZYNQ=y |
| 117 | CONFIG_TRUSTED_FOUNDATIONS=y | 107 | CONFIG_PCIEPORTBUS=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 | ||
| 124 | CONFIG_PCI_MVEBU=y | 108 | CONFIG_PCI_MVEBU=y |
| 125 | CONFIG_PCI_TEGRA=y | 109 | CONFIG_PCI_TEGRA=y |
| 126 | CONFIG_PCI_RCAR_GEN2=y | 110 | CONFIG_PCI_RCAR_GEN2=y |
| 127 | CONFIG_PCIE_RCAR=y | 111 | CONFIG_PCIE_RCAR=y |
| 128 | CONFIG_PCIEPORTBUS=y | 112 | CONFIG_PCI_DRA7XX_EP=y |
| 113 | CONFIG_PCI_KEYSTONE=y | ||
| 129 | CONFIG_PCI_ENDPOINT=y | 114 | CONFIG_PCI_ENDPOINT=y |
| 130 | CONFIG_PCI_ENDPOINT_CONFIGFS=y | 115 | CONFIG_PCI_ENDPOINT_CONFIGFS=y |
| 131 | CONFIG_PCI_EPF_TEST=m | 116 | CONFIG_PCI_EPF_TEST=m |
| 132 | CONFIG_SMP=y | 117 | CONFIG_SMP=y |
| 133 | CONFIG_NR_CPUS=16 | 118 | CONFIG_NR_CPUS=16 |
| 134 | CONFIG_HIGHPTE=y | ||
| 135 | CONFIG_CMA=y | ||
| 136 | CONFIG_SECCOMP=y | 119 | CONFIG_SECCOMP=y |
| 137 | CONFIG_ARM_APPENDED_DTB=y | 120 | CONFIG_ARM_APPENDED_DTB=y |
| 138 | CONFIG_ARM_ATAG_DTB_COMPAT=y | 121 | CONFIG_ARM_ATAG_DTB_COMPAT=y |
| @@ -145,14 +128,14 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=m | |||
| 145 | CONFIG_CPU_FREQ_GOV_USERSPACE=m | 128 | CONFIG_CPU_FREQ_GOV_USERSPACE=m |
| 146 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m | 129 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m |
| 147 | CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y | 130 | CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y |
| 131 | CONFIG_CPUFREQ_DT=y | ||
| 148 | CONFIG_ARM_IMX6Q_CPUFREQ=y | 132 | CONFIG_ARM_IMX6Q_CPUFREQ=y |
| 149 | CONFIG_QORIQ_CPUFREQ=y | 133 | CONFIG_QORIQ_CPUFREQ=y |
| 150 | CONFIG_CPU_IDLE=y | 134 | CONFIG_CPU_IDLE=y |
| 151 | CONFIG_ARM_CPUIDLE=y | 135 | CONFIG_ARM_CPUIDLE=y |
| 152 | CONFIG_NEON=y | ||
| 153 | CONFIG_KERNEL_MODE_NEON=y | ||
| 154 | CONFIG_ARM_ZYNQ_CPUIDLE=y | 136 | CONFIG_ARM_ZYNQ_CPUIDLE=y |
| 155 | CONFIG_ARM_EXYNOS_CPUIDLE=y | 137 | CONFIG_ARM_EXYNOS_CPUIDLE=y |
| 138 | CONFIG_KERNEL_MODE_NEON=y | ||
| 156 | CONFIG_NET=y | 139 | CONFIG_NET=y |
| 157 | CONFIG_PACKET=y | 140 | CONFIG_PACKET=y |
| 158 | CONFIG_UNIX=y | 141 | CONFIG_UNIX=y |
| @@ -170,23 +153,13 @@ CONFIG_IPV6_MIP6=m | |||
| 170 | CONFIG_IPV6_TUNNEL=m | 153 | CONFIG_IPV6_TUNNEL=m |
| 171 | CONFIG_IPV6_MULTIPLE_TABLES=y | 154 | CONFIG_IPV6_MULTIPLE_TABLES=y |
| 172 | CONFIG_NET_DSA=m | 155 | CONFIG_NET_DSA=m |
| 173 | CONFIG_NET_SWITCHDEV=y | ||
| 174 | CONFIG_CAN=y | 156 | CONFIG_CAN=y |
| 175 | CONFIG_CAN_RAW=y | ||
| 176 | CONFIG_CAN_BCM=y | ||
| 177 | CONFIG_CAN_DEV=y | ||
| 178 | CONFIG_CAN_AT91=m | 157 | CONFIG_CAN_AT91=m |
| 179 | CONFIG_CAN_FLEXCAN=m | 158 | CONFIG_CAN_FLEXCAN=m |
| 180 | CONFIG_CAN_RCAR=m | 159 | CONFIG_CAN_SUN4I=y |
| 181 | CONFIG_CAN_XILINXCAN=y | 160 | CONFIG_CAN_XILINXCAN=y |
| 161 | CONFIG_CAN_RCAR=m | ||
| 182 | CONFIG_CAN_MCP251X=y | 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 | CONFIG_BT=m | 163 | CONFIG_BT=m |
| 191 | CONFIG_BT_HCIUART=m | 164 | CONFIG_BT_HCIUART=m |
| 192 | CONFIG_BT_HCIUART_BCM=y | 165 | CONFIG_BT_HCIUART_BCM=y |
| @@ -199,11 +172,9 @@ CONFIG_RFKILL_INPUT=y | |||
| 199 | CONFIG_RFKILL_GPIO=y | 172 | CONFIG_RFKILL_GPIO=y |
| 200 | CONFIG_DEVTMPFS=y | 173 | CONFIG_DEVTMPFS=y |
| 201 | CONFIG_DEVTMPFS_MOUNT=y | 174 | CONFIG_DEVTMPFS_MOUNT=y |
| 202 | CONFIG_DMA_CMA=y | ||
| 203 | CONFIG_CMA_SIZE_MBYTES=64 | 175 | CONFIG_CMA_SIZE_MBYTES=64 |
| 204 | CONFIG_OMAP_OCP2SCP=y | 176 | CONFIG_OMAP_OCP2SCP=y |
| 205 | CONFIG_SIMPLE_PM_BUS=y | 177 | CONFIG_SIMPLE_PM_BUS=y |
| 206 | CONFIG_SUNXI_RSB=y | ||
| 207 | CONFIG_MTD=y | 178 | CONFIG_MTD=y |
| 208 | CONFIG_MTD_CMDLINE_PARTS=y | 179 | CONFIG_MTD_CMDLINE_PARTS=y |
| 209 | CONFIG_MTD_BLOCK=y | 180 | CONFIG_MTD_BLOCK=y |
| @@ -236,7 +207,6 @@ CONFIG_PCI_ENDPOINT_TEST=m | |||
| 236 | CONFIG_EEPROM_AT24=y | 207 | CONFIG_EEPROM_AT24=y |
| 237 | CONFIG_BLK_DEV_SD=y | 208 | CONFIG_BLK_DEV_SD=y |
| 238 | CONFIG_BLK_DEV_SR=y | 209 | CONFIG_BLK_DEV_SR=y |
| 239 | CONFIG_SCSI_MULTI_LUN=y | ||
| 240 | CONFIG_ATA=y | 210 | CONFIG_ATA=y |
| 241 | CONFIG_SATA_AHCI=y | 211 | CONFIG_SATA_AHCI=y |
| 242 | CONFIG_SATA_AHCI_PLATFORM=y | 212 | CONFIG_SATA_AHCI_PLATFORM=y |
| @@ -251,14 +221,20 @@ CONFIG_SATA_MV=y | |||
| 251 | CONFIG_SATA_RCAR=y | 221 | CONFIG_SATA_RCAR=y |
| 252 | CONFIG_NETDEVICES=y | 222 | CONFIG_NETDEVICES=y |
| 253 | CONFIG_VIRTIO_NET=y | 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 | CONFIG_SUN4I_EMAC=y | 229 | CONFIG_SUN4I_EMAC=y |
| 256 | CONFIG_MACB=y | ||
| 257 | CONFIG_BCMGENET=m | 230 | CONFIG_BCMGENET=m |
| 258 | CONFIG_BGMAC_BCMA=y | 231 | CONFIG_BGMAC_BCMA=y |
| 259 | CONFIG_SYSTEMPORT=m | 232 | CONFIG_SYSTEMPORT=m |
| 233 | CONFIG_MACB=y | ||
| 260 | CONFIG_NET_CALXEDA_XGMAC=y | 234 | CONFIG_NET_CALXEDA_XGMAC=y |
| 261 | CONFIG_GIANFAR=y | 235 | CONFIG_GIANFAR=y |
| 236 | CONFIG_HIX5HD2_GMAC=y | ||
| 237 | CONFIG_E1000E=y | ||
| 262 | CONFIG_IGB=y | 238 | CONFIG_IGB=y |
| 263 | CONFIG_MV643XX_ETH=y | 239 | CONFIG_MV643XX_ETH=y |
| 264 | CONFIG_MVNETA=y | 240 | CONFIG_MVNETA=y |
| @@ -268,19 +244,17 @@ CONFIG_R8169=y | |||
| 268 | CONFIG_SH_ETH=y | 244 | CONFIG_SH_ETH=y |
| 269 | CONFIG_SMSC911X=y | 245 | CONFIG_SMSC911X=y |
| 270 | CONFIG_STMMAC_ETH=y | 246 | CONFIG_STMMAC_ETH=y |
| 271 | CONFIG_STMMAC_PLATFORM=y | ||
| 272 | CONFIG_DWMAC_DWC_QOS_ETH=y | 247 | CONFIG_DWMAC_DWC_QOS_ETH=y |
| 273 | CONFIG_TI_CPSW=y | 248 | CONFIG_TI_CPSW=y |
| 274 | CONFIG_XILINX_EMACLITE=y | 249 | CONFIG_XILINX_EMACLITE=y |
| 275 | CONFIG_AT803X_PHY=y | 250 | CONFIG_AT803X_PHY=y |
| 276 | CONFIG_MARVELL_PHY=y | ||
| 277 | CONFIG_SMSC_PHY=y | ||
| 278 | CONFIG_BROADCOM_PHY=y | 251 | CONFIG_BROADCOM_PHY=y |
| 279 | CONFIG_ICPLUS_PHY=y | 252 | CONFIG_ICPLUS_PHY=y |
| 280 | CONFIG_REALTEK_PHY=y | 253 | CONFIG_MARVELL_PHY=y |
| 281 | CONFIG_MICREL_PHY=y | 254 | CONFIG_MICREL_PHY=y |
| 282 | CONFIG_FIXED_PHY=y | 255 | CONFIG_REALTEK_PHY=y |
| 283 | CONFIG_ROCKCHIP_PHY=y | 256 | CONFIG_ROCKCHIP_PHY=y |
| 257 | CONFIG_SMSC_PHY=y | ||
| 284 | CONFIG_USB_PEGASUS=y | 258 | CONFIG_USB_PEGASUS=y |
| 285 | CONFIG_USB_RTL8152=m | 259 | CONFIG_USB_RTL8152=m |
| 286 | CONFIG_USB_LAN78XX=m | 260 | CONFIG_USB_LAN78XX=m |
| @@ -288,29 +262,29 @@ CONFIG_USB_USBNET=y | |||
| 288 | CONFIG_USB_NET_SMSC75XX=y | 262 | CONFIG_USB_NET_SMSC75XX=y |
| 289 | CONFIG_USB_NET_SMSC95XX=y | 263 | CONFIG_USB_NET_SMSC95XX=y |
| 290 | CONFIG_BRCMFMAC=m | 264 | CONFIG_BRCMFMAC=m |
| 291 | CONFIG_RT2X00=m | ||
| 292 | CONFIG_RT2800USB=m | ||
| 293 | CONFIG_MWIFIEX=m | 265 | CONFIG_MWIFIEX=m |
| 294 | CONFIG_MWIFIEX_SDIO=m | 266 | CONFIG_MWIFIEX_SDIO=m |
| 267 | CONFIG_RT2X00=m | ||
| 268 | CONFIG_RT2800USB=m | ||
| 295 | CONFIG_INPUT_JOYDEV=y | 269 | CONFIG_INPUT_JOYDEV=y |
| 296 | CONFIG_INPUT_EVDEV=y | 270 | CONFIG_INPUT_EVDEV=y |
| 297 | CONFIG_KEYBOARD_QT1070=m | 271 | CONFIG_KEYBOARD_QT1070=m |
| 298 | CONFIG_KEYBOARD_GPIO=y | 272 | CONFIG_KEYBOARD_GPIO=y |
| 299 | CONFIG_KEYBOARD_TEGRA=y | 273 | CONFIG_KEYBOARD_TEGRA=y |
| 300 | CONFIG_KEYBOARD_SPEAR=y | 274 | CONFIG_KEYBOARD_SAMSUNG=m |
| 301 | CONFIG_KEYBOARD_ST_KEYSCAN=y | 275 | CONFIG_KEYBOARD_ST_KEYSCAN=y |
| 276 | CONFIG_KEYBOARD_SPEAR=y | ||
| 302 | CONFIG_KEYBOARD_CROS_EC=m | 277 | CONFIG_KEYBOARD_CROS_EC=m |
| 303 | CONFIG_KEYBOARD_SAMSUNG=m | ||
| 304 | CONFIG_MOUSE_PS2_ELANTECH=y | 278 | CONFIG_MOUSE_PS2_ELANTECH=y |
| 305 | CONFIG_MOUSE_CYAPA=m | 279 | CONFIG_MOUSE_CYAPA=m |
| 306 | CONFIG_MOUSE_ELAN_I2C=y | 280 | CONFIG_MOUSE_ELAN_I2C=y |
| 307 | CONFIG_INPUT_TOUCHSCREEN=y | 281 | CONFIG_INPUT_TOUCHSCREEN=y |
| 308 | CONFIG_TOUCHSCREEN_ATMEL_MXT=m | 282 | CONFIG_TOUCHSCREEN_ATMEL_MXT=m |
| 309 | CONFIG_TOUCHSCREEN_MMS114=m | 283 | CONFIG_TOUCHSCREEN_MMS114=m |
| 284 | CONFIG_TOUCHSCREEN_WM97XX=m | ||
| 310 | CONFIG_TOUCHSCREEN_ST1232=m | 285 | CONFIG_TOUCHSCREEN_ST1232=m |
| 311 | CONFIG_TOUCHSCREEN_STMPE=y | 286 | CONFIG_TOUCHSCREEN_STMPE=y |
| 312 | CONFIG_TOUCHSCREEN_SUN4I=y | 287 | CONFIG_TOUCHSCREEN_SUN4I=y |
| 313 | CONFIG_TOUCHSCREEN_WM97XX=m | ||
| 314 | CONFIG_INPUT_MISC=y | 288 | CONFIG_INPUT_MISC=y |
| 315 | CONFIG_INPUT_MAX77693_HAPTIC=m | 289 | CONFIG_INPUT_MAX77693_HAPTIC=m |
| 316 | CONFIG_INPUT_MAX8997_HAPTIC=m | 290 | CONFIG_INPUT_MAX8997_HAPTIC=m |
| @@ -327,13 +301,12 @@ CONFIG_SERIAL_8250_DW=y | |||
| 327 | CONFIG_SERIAL_8250_EM=y | 301 | CONFIG_SERIAL_8250_EM=y |
| 328 | CONFIG_SERIAL_8250_MT6577=y | 302 | CONFIG_SERIAL_8250_MT6577=y |
| 329 | CONFIG_SERIAL_8250_UNIPHIER=y | 303 | CONFIG_SERIAL_8250_UNIPHIER=y |
| 304 | CONFIG_SERIAL_OF_PLATFORM=y | ||
| 330 | CONFIG_SERIAL_AMBA_PL011=y | 305 | CONFIG_SERIAL_AMBA_PL011=y |
| 331 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | 306 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y |
| 332 | CONFIG_SERIAL_ATMEL=y | 307 | CONFIG_SERIAL_ATMEL=y |
| 333 | CONFIG_SERIAL_ATMEL_CONSOLE=y | 308 | CONFIG_SERIAL_ATMEL_CONSOLE=y |
| 334 | CONFIG_SERIAL_ATMEL_TTYAT=y | 309 | CONFIG_SERIAL_ATMEL_TTYAT=y |
| 335 | CONFIG_SERIAL_BCM63XX=y | ||
| 336 | CONFIG_SERIAL_BCM63XX_CONSOLE=y | ||
| 337 | CONFIG_SERIAL_MESON=y | 310 | CONFIG_SERIAL_MESON=y |
| 338 | CONFIG_SERIAL_MESON_CONSOLE=y | 311 | CONFIG_SERIAL_MESON_CONSOLE=y |
| 339 | CONFIG_SERIAL_SAMSUNG=y | 312 | CONFIG_SERIAL_SAMSUNG=y |
| @@ -345,15 +318,14 @@ CONFIG_SERIAL_IMX=y | |||
| 345 | CONFIG_SERIAL_IMX_CONSOLE=y | 318 | CONFIG_SERIAL_IMX_CONSOLE=y |
| 346 | CONFIG_SERIAL_SH_SCI=y | 319 | CONFIG_SERIAL_SH_SCI=y |
| 347 | CONFIG_SERIAL_SH_SCI_NR_UARTS=20 | 320 | CONFIG_SERIAL_SH_SCI_NR_UARTS=20 |
| 348 | CONFIG_SERIAL_SH_SCI_CONSOLE=y | ||
| 349 | CONFIG_SERIAL_SH_SCI_DMA=y | ||
| 350 | CONFIG_SERIAL_MSM=y | 321 | CONFIG_SERIAL_MSM=y |
| 351 | CONFIG_SERIAL_MSM_CONSOLE=y | 322 | CONFIG_SERIAL_MSM_CONSOLE=y |
| 352 | CONFIG_SERIAL_VT8500=y | 323 | CONFIG_SERIAL_VT8500=y |
| 353 | CONFIG_SERIAL_VT8500_CONSOLE=y | 324 | CONFIG_SERIAL_VT8500_CONSOLE=y |
| 354 | CONFIG_SERIAL_OF_PLATFORM=y | ||
| 355 | CONFIG_SERIAL_OMAP=y | 325 | CONFIG_SERIAL_OMAP=y |
| 356 | CONFIG_SERIAL_OMAP_CONSOLE=y | 326 | CONFIG_SERIAL_OMAP_CONSOLE=y |
| 327 | CONFIG_SERIAL_BCM63XX=y | ||
| 328 | CONFIG_SERIAL_BCM63XX_CONSOLE=y | ||
| 357 | CONFIG_SERIAL_XILINX_PS_UART=y | 329 | CONFIG_SERIAL_XILINX_PS_UART=y |
| 358 | CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y | 330 | CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y |
| 359 | CONFIG_SERIAL_FSL_LPUART=y | 331 | CONFIG_SERIAL_FSL_LPUART=y |
| @@ -365,12 +337,10 @@ CONFIG_SERIAL_ST_ASC_CONSOLE=y | |||
| 365 | CONFIG_SERIAL_STM32=y | 337 | CONFIG_SERIAL_STM32=y |
| 366 | CONFIG_SERIAL_STM32_CONSOLE=y | 338 | CONFIG_SERIAL_STM32_CONSOLE=y |
| 367 | CONFIG_SERIAL_DEV_BUS=y | 339 | CONFIG_SERIAL_DEV_BUS=y |
| 368 | CONFIG_HVC_DRIVER=y | ||
| 369 | CONFIG_VIRTIO_CONSOLE=y | 340 | CONFIG_VIRTIO_CONSOLE=y |
| 341 | CONFIG_HW_RANDOM=y | ||
| 342 | CONFIG_HW_RANDOM_ST=y | ||
| 370 | CONFIG_I2C_CHARDEV=y | 343 | CONFIG_I2C_CHARDEV=y |
| 371 | CONFIG_I2C_DAVINCI=y | ||
| 372 | CONFIG_I2C_MESON=y | ||
| 373 | CONFIG_I2C_MUX=y | ||
| 374 | CONFIG_I2C_ARB_GPIO_CHALLENGE=m | 344 | CONFIG_I2C_ARB_GPIO_CHALLENGE=m |
| 375 | CONFIG_I2C_MUX_PCA954x=y | 345 | CONFIG_I2C_MUX_PCA954x=y |
| 376 | CONFIG_I2C_MUX_PINCTRL=y | 346 | CONFIG_I2C_MUX_PINCTRL=y |
| @@ -378,12 +348,13 @@ CONFIG_I2C_DEMUX_PINCTRL=y | |||
| 378 | CONFIG_I2C_AT91=m | 348 | CONFIG_I2C_AT91=m |
| 379 | CONFIG_I2C_BCM2835=y | 349 | CONFIG_I2C_BCM2835=y |
| 380 | CONFIG_I2C_CADENCE=y | 350 | CONFIG_I2C_CADENCE=y |
| 351 | CONFIG_I2C_DAVINCI=y | ||
| 381 | CONFIG_I2C_DESIGNWARE_PLATFORM=y | 352 | CONFIG_I2C_DESIGNWARE_PLATFORM=y |
| 382 | CONFIG_I2C_DIGICOLOR=m | 353 | CONFIG_I2C_DIGICOLOR=m |
| 383 | CONFIG_I2C_EMEV2=m | 354 | CONFIG_I2C_EMEV2=m |
| 384 | CONFIG_I2C_GPIO=m | 355 | CONFIG_I2C_GPIO=m |
| 385 | CONFIG_I2C_EXYNOS5=y | ||
| 386 | CONFIG_I2C_IMX=y | 356 | CONFIG_I2C_IMX=y |
| 357 | CONFIG_I2C_MESON=y | ||
| 387 | CONFIG_I2C_MV64XXX=y | 358 | CONFIG_I2C_MV64XXX=y |
| 388 | CONFIG_I2C_RIIC=y | 359 | CONFIG_I2C_RIIC=y |
| 389 | CONFIG_I2C_RK3X=y | 360 | CONFIG_I2C_RK3X=y |
| @@ -427,7 +398,6 @@ CONFIG_SPI_SPIDEV=y | |||
| 427 | CONFIG_SPMI=y | 398 | CONFIG_SPMI=y |
| 428 | CONFIG_PINCTRL_AS3722=y | 399 | CONFIG_PINCTRL_AS3722=y |
| 429 | CONFIG_PINCTRL_PALMAS=y | 400 | CONFIG_PINCTRL_PALMAS=y |
| 430 | CONFIG_PINCTRL_BCM2835=y | ||
| 431 | CONFIG_PINCTRL_APQ8064=y | 401 | CONFIG_PINCTRL_APQ8064=y |
| 432 | CONFIG_PINCTRL_APQ8084=y | 402 | CONFIG_PINCTRL_APQ8084=y |
| 433 | CONFIG_PINCTRL_IPQ8064=y | 403 | CONFIG_PINCTRL_IPQ8064=y |
| @@ -437,25 +407,33 @@ CONFIG_PINCTRL_MSM8X74=y | |||
| 437 | CONFIG_PINCTRL_MSM8916=y | 407 | CONFIG_PINCTRL_MSM8916=y |
| 438 | CONFIG_PINCTRL_QCOM_SPMI_PMIC=y | 408 | CONFIG_PINCTRL_QCOM_SPMI_PMIC=y |
| 439 | CONFIG_PINCTRL_QCOM_SSBI_PMIC=y | 409 | CONFIG_PINCTRL_QCOM_SSBI_PMIC=y |
| 440 | CONFIG_GPIO_GENERIC_PLATFORM=y | ||
| 441 | CONFIG_GPIO_DAVINCI=y | 410 | CONFIG_GPIO_DAVINCI=y |
| 442 | CONFIG_GPIO_DWAPB=y | 411 | CONFIG_GPIO_DWAPB=y |
| 443 | CONFIG_GPIO_EM=y | 412 | CONFIG_GPIO_EM=y |
| 444 | CONFIG_GPIO_RCAR=y | 413 | CONFIG_GPIO_RCAR=y |
| 414 | CONFIG_GPIO_SYSCON=y | ||
| 445 | CONFIG_GPIO_UNIPHIER=y | 415 | CONFIG_GPIO_UNIPHIER=y |
| 446 | CONFIG_GPIO_XILINX=y | 416 | CONFIG_GPIO_XILINX=y |
| 447 | CONFIG_GPIO_ZYNQ=y | 417 | CONFIG_GPIO_ZYNQ=y |
| 448 | CONFIG_GPIO_PCA953X=y | 418 | CONFIG_GPIO_PCA953X=y |
| 449 | CONFIG_GPIO_PCA953X_IRQ=y | 419 | CONFIG_GPIO_PCA953X_IRQ=y |
| 450 | CONFIG_GPIO_PCF857X=y | 420 | CONFIG_GPIO_PCF857X=y |
| 451 | CONFIG_GPIO_TWL4030=y | ||
| 452 | CONFIG_GPIO_PALMAS=y | 421 | CONFIG_GPIO_PALMAS=y |
| 453 | CONFIG_GPIO_SYSCON=y | ||
| 454 | CONFIG_GPIO_TPS6586X=y | 422 | CONFIG_GPIO_TPS6586X=y |
| 455 | CONFIG_GPIO_TPS65910=y | 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 | CONFIG_BATTERY_ACT8945A=y | 433 | CONFIG_BATTERY_ACT8945A=y |
| 457 | CONFIG_BATTERY_CPCAP=m | 434 | CONFIG_BATTERY_CPCAP=m |
| 458 | CONFIG_BATTERY_SBS=y | 435 | CONFIG_BATTERY_SBS=y |
| 436 | CONFIG_AXP20X_POWER=m | ||
| 459 | CONFIG_BATTERY_MAX17040=m | 437 | CONFIG_BATTERY_MAX17040=m |
| 460 | CONFIG_BATTERY_MAX17042=m | 438 | CONFIG_BATTERY_MAX17042=m |
| 461 | CONFIG_CHARGER_CPCAP=m | 439 | CONFIG_CHARGER_CPCAP=m |
| @@ -464,15 +442,6 @@ CONFIG_CHARGER_MAX77693=m | |||
| 464 | CONFIG_CHARGER_MAX8997=m | 442 | CONFIG_CHARGER_MAX8997=m |
| 465 | CONFIG_CHARGER_MAX8998=m | 443 | CONFIG_CHARGER_MAX8998=m |
| 466 | CONFIG_CHARGER_TPS65090=y | 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 | CONFIG_SENSORS_IIO_HWMON=y | 445 | CONFIG_SENSORS_IIO_HWMON=y |
| 477 | CONFIG_SENSORS_LM90=y | 446 | CONFIG_SENSORS_LM90=y |
| 478 | CONFIG_SENSORS_LM95245=y | 447 | CONFIG_SENSORS_LM95245=y |
| @@ -480,14 +449,12 @@ CONFIG_SENSORS_NTC_THERMISTOR=m | |||
| 480 | CONFIG_SENSORS_PWM_FAN=m | 449 | CONFIG_SENSORS_PWM_FAN=m |
| 481 | CONFIG_SENSORS_INA2XX=m | 450 | CONFIG_SENSORS_INA2XX=m |
| 482 | CONFIG_CPU_THERMAL=y | 451 | CONFIG_CPU_THERMAL=y |
| 483 | CONFIG_BCM2835_THERMAL=m | ||
| 484 | CONFIG_BRCMSTB_THERMAL=m | ||
| 485 | CONFIG_IMX_THERMAL=y | 452 | CONFIG_IMX_THERMAL=y |
| 486 | CONFIG_ROCKCHIP_THERMAL=y | 453 | CONFIG_ROCKCHIP_THERMAL=y |
| 487 | CONFIG_RCAR_THERMAL=y | 454 | CONFIG_RCAR_THERMAL=y |
| 488 | CONFIG_ARMADA_THERMAL=y | 455 | CONFIG_ARMADA_THERMAL=y |
| 489 | CONFIG_DAVINCI_WATCHDOG=m | 456 | CONFIG_BCM2835_THERMAL=m |
| 490 | CONFIG_EXYNOS_THERMAL=m | 457 | CONFIG_BRCMSTB_THERMAL=m |
| 491 | CONFIG_ST_THERMAL_MEMMAP=y | 458 | CONFIG_ST_THERMAL_MEMMAP=y |
| 492 | CONFIG_WATCHDOG=y | 459 | CONFIG_WATCHDOG=y |
| 493 | CONFIG_DA9063_WATCHDOG=m | 460 | CONFIG_DA9063_WATCHDOG=m |
| @@ -495,20 +462,24 @@ CONFIG_XILINX_WATCHDOG=y | |||
| 495 | CONFIG_ARM_SP805_WATCHDOG=y | 462 | CONFIG_ARM_SP805_WATCHDOG=y |
| 496 | CONFIG_AT91SAM9X_WATCHDOG=y | 463 | CONFIG_AT91SAM9X_WATCHDOG=y |
| 497 | CONFIG_SAMA5D4_WATCHDOG=y | 464 | CONFIG_SAMA5D4_WATCHDOG=y |
| 465 | CONFIG_DW_WATCHDOG=y | ||
| 466 | CONFIG_DAVINCI_WATCHDOG=m | ||
| 498 | CONFIG_ORION_WATCHDOG=y | 467 | CONFIG_ORION_WATCHDOG=y |
| 499 | CONFIG_RN5T618_WATCHDOG=y | 468 | CONFIG_RN5T618_WATCHDOG=y |
| 500 | CONFIG_ST_LPC_WATCHDOG=y | ||
| 501 | CONFIG_SUNXI_WATCHDOG=y | 469 | CONFIG_SUNXI_WATCHDOG=y |
| 502 | CONFIG_IMX2_WDT=y | 470 | CONFIG_IMX2_WDT=y |
| 471 | CONFIG_ST_LPC_WATCHDOG=y | ||
| 503 | CONFIG_TEGRA_WATCHDOG=m | 472 | CONFIG_TEGRA_WATCHDOG=m |
| 504 | CONFIG_MESON_WATCHDOG=y | 473 | CONFIG_MESON_WATCHDOG=y |
| 505 | CONFIG_DW_WATCHDOG=y | ||
| 506 | CONFIG_DIGICOLOR_WATCHDOG=y | 474 | CONFIG_DIGICOLOR_WATCHDOG=y |
| 507 | CONFIG_RENESAS_WDT=m | 475 | CONFIG_RENESAS_WDT=m |
| 508 | CONFIG_BCM2835_WDT=y | ||
| 509 | CONFIG_BCM47XX_WDT=y | 476 | CONFIG_BCM47XX_WDT=y |
| 510 | CONFIG_BCM7038_WDT=m | 477 | CONFIG_BCM2835_WDT=y |
| 511 | CONFIG_BCM_KONA_WDT=y | 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 | CONFIG_MFD_ACT8945A=y | 483 | CONFIG_MFD_ACT8945A=y |
| 513 | CONFIG_MFD_AS3711=y | 484 | CONFIG_MFD_AS3711=y |
| 514 | CONFIG_MFD_AS3722=y | 485 | CONFIG_MFD_AS3722=y |
| @@ -516,7 +487,6 @@ CONFIG_MFD_ATMEL_FLEXCOM=y | |||
| 516 | CONFIG_MFD_ATMEL_HLCDC=m | 487 | CONFIG_MFD_ATMEL_HLCDC=m |
| 517 | CONFIG_MFD_BCM590XX=y | 488 | CONFIG_MFD_BCM590XX=y |
| 518 | CONFIG_MFD_AC100=y | 489 | CONFIG_MFD_AC100=y |
| 519 | CONFIG_MFD_AXP20X=y | ||
| 520 | CONFIG_MFD_AXP20X_I2C=y | 490 | CONFIG_MFD_AXP20X_I2C=y |
| 521 | CONFIG_MFD_AXP20X_RSB=y | 491 | CONFIG_MFD_AXP20X_RSB=y |
| 522 | CONFIG_MFD_CROS_EC=m | 492 | CONFIG_MFD_CROS_EC=m |
| @@ -529,11 +499,11 @@ CONFIG_MFD_MAX77693=m | |||
| 529 | CONFIG_MFD_MAX8907=y | 499 | CONFIG_MFD_MAX8907=y |
| 530 | CONFIG_MFD_MAX8997=y | 500 | CONFIG_MFD_MAX8997=y |
| 531 | CONFIG_MFD_MAX8998=y | 501 | CONFIG_MFD_MAX8998=y |
| 532 | CONFIG_MFD_RK808=y | ||
| 533 | CONFIG_MFD_CPCAP=y | 502 | CONFIG_MFD_CPCAP=y |
| 534 | CONFIG_MFD_PM8XXX=y | 503 | CONFIG_MFD_PM8XXX=y |
| 535 | CONFIG_MFD_QCOM_RPM=y | 504 | CONFIG_MFD_QCOM_RPM=y |
| 536 | CONFIG_MFD_SPMI_PMIC=y | 505 | CONFIG_MFD_SPMI_PMIC=y |
| 506 | CONFIG_MFD_RK808=y | ||
| 537 | CONFIG_MFD_RN5T618=y | 507 | CONFIG_MFD_RN5T618=y |
| 538 | CONFIG_MFD_SEC_CORE=y | 508 | CONFIG_MFD_SEC_CORE=y |
| 539 | CONFIG_MFD_STMPE=y | 509 | CONFIG_MFD_STMPE=y |
| @@ -543,10 +513,10 @@ CONFIG_MFD_TPS65217=y | |||
| 543 | CONFIG_MFD_TPS65218=y | 513 | CONFIG_MFD_TPS65218=y |
| 544 | CONFIG_MFD_TPS6586X=y | 514 | CONFIG_MFD_TPS6586X=y |
| 545 | CONFIG_MFD_TPS65910=y | 515 | CONFIG_MFD_TPS65910=y |
| 546 | CONFIG_REGULATOR_ACT8945A=y | ||
| 547 | CONFIG_REGULATOR_AB8500=y | ||
| 548 | CONFIG_REGULATOR_ACT8865=y | 516 | CONFIG_REGULATOR_ACT8865=y |
| 517 | CONFIG_REGULATOR_ACT8945A=y | ||
| 549 | CONFIG_REGULATOR_ANATOP=y | 518 | CONFIG_REGULATOR_ANATOP=y |
| 519 | CONFIG_REGULATOR_AB8500=y | ||
| 550 | CONFIG_REGULATOR_AS3711=y | 520 | CONFIG_REGULATOR_AS3711=y |
| 551 | CONFIG_REGULATOR_AS3722=y | 521 | CONFIG_REGULATOR_AS3722=y |
| 552 | CONFIG_REGULATOR_AXP20X=y | 522 | CONFIG_REGULATOR_AXP20X=y |
| @@ -554,10 +524,7 @@ CONFIG_REGULATOR_BCM590XX=y | |||
| 554 | CONFIG_REGULATOR_CPCAP=y | 524 | CONFIG_REGULATOR_CPCAP=y |
| 555 | CONFIG_REGULATOR_DA9210=y | 525 | CONFIG_REGULATOR_DA9210=y |
| 556 | CONFIG_REGULATOR_FAN53555=y | 526 | CONFIG_REGULATOR_FAN53555=y |
| 557 | CONFIG_REGULATOR_RK808=y | ||
| 558 | CONFIG_REGULATOR_GPIO=y | 527 | CONFIG_REGULATOR_GPIO=y |
| 559 | CONFIG_MFD_SYSCON=y | ||
| 560 | CONFIG_POWER_RESET_SYSCON=y | ||
| 561 | CONFIG_REGULATOR_LP872X=y | 528 | CONFIG_REGULATOR_LP872X=y |
| 562 | CONFIG_REGULATOR_MAX14577=m | 529 | CONFIG_REGULATOR_MAX14577=m |
| 563 | CONFIG_REGULATOR_MAX8907=y | 530 | CONFIG_REGULATOR_MAX8907=y |
| @@ -571,7 +538,8 @@ CONFIG_REGULATOR_PALMAS=y | |||
| 571 | CONFIG_REGULATOR_PBIAS=y | 538 | CONFIG_REGULATOR_PBIAS=y |
| 572 | CONFIG_REGULATOR_PWM=y | 539 | CONFIG_REGULATOR_PWM=y |
| 573 | CONFIG_REGULATOR_QCOM_RPM=y | 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 | CONFIG_REGULATOR_RN5T618=y | 543 | CONFIG_REGULATOR_RN5T618=y |
| 576 | CONFIG_REGULATOR_S2MPS11=y | 544 | CONFIG_REGULATOR_S2MPS11=y |
| 577 | CONFIG_REGULATOR_S5M8767=y | 545 | CONFIG_REGULATOR_S5M8767=y |
| @@ -592,18 +560,17 @@ CONFIG_MEDIA_CEC_SUPPORT=y | |||
| 592 | CONFIG_MEDIA_CONTROLLER=y | 560 | CONFIG_MEDIA_CONTROLLER=y |
| 593 | CONFIG_VIDEO_V4L2_SUBDEV_API=y | 561 | CONFIG_VIDEO_V4L2_SUBDEV_API=y |
| 594 | CONFIG_MEDIA_USB_SUPPORT=y | 562 | CONFIG_MEDIA_USB_SUPPORT=y |
| 595 | CONFIG_USB_VIDEO_CLASS=y | 563 | CONFIG_USB_VIDEO_CLASS=m |
| 596 | CONFIG_USB_GSPCA=y | ||
| 597 | CONFIG_V4L_PLATFORM_DRIVERS=y | 564 | CONFIG_V4L_PLATFORM_DRIVERS=y |
| 598 | CONFIG_SOC_CAMERA=m | 565 | CONFIG_SOC_CAMERA=m |
| 599 | CONFIG_SOC_CAMERA_PLATFORM=m | 566 | CONFIG_SOC_CAMERA_PLATFORM=m |
| 600 | CONFIG_VIDEO_RCAR_VIN=m | ||
| 601 | CONFIG_VIDEO_ATMEL_ISI=m | ||
| 602 | CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS=m | 567 | CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS=m |
| 603 | CONFIG_VIDEO_S5P_FIMC=m | 568 | CONFIG_VIDEO_S5P_FIMC=m |
| 604 | CONFIG_VIDEO_S5P_MIPI_CSIS=m | 569 | CONFIG_VIDEO_S5P_MIPI_CSIS=m |
| 605 | CONFIG_VIDEO_EXYNOS_FIMC_LITE=m | 570 | CONFIG_VIDEO_EXYNOS_FIMC_LITE=m |
| 606 | CONFIG_VIDEO_EXYNOS4_FIMC_IS=m | 571 | CONFIG_VIDEO_EXYNOS4_FIMC_IS=m |
| 572 | CONFIG_VIDEO_RCAR_VIN=m | ||
| 573 | CONFIG_VIDEO_ATMEL_ISI=m | ||
| 607 | CONFIG_V4L_MEM2MEM_DRIVERS=y | 574 | CONFIG_V4L_MEM2MEM_DRIVERS=y |
| 608 | CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m | 575 | CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m |
| 609 | CONFIG_VIDEO_SAMSUNG_S5P_MFC=m | 576 | CONFIG_VIDEO_SAMSUNG_S5P_MFC=m |
| @@ -614,19 +581,15 @@ CONFIG_VIDEO_STI_DELTA=m | |||
| 614 | CONFIG_VIDEO_RENESAS_JPU=m | 581 | CONFIG_VIDEO_RENESAS_JPU=m |
| 615 | CONFIG_VIDEO_RENESAS_VSP1=m | 582 | CONFIG_VIDEO_RENESAS_VSP1=m |
| 616 | CONFIG_V4L_TEST_DRIVERS=y | 583 | CONFIG_V4L_TEST_DRIVERS=y |
| 584 | CONFIG_VIDEO_VIVID=m | ||
| 617 | CONFIG_CEC_PLATFORM_DRIVERS=y | 585 | CONFIG_CEC_PLATFORM_DRIVERS=y |
| 618 | CONFIG_VIDEO_SAMSUNG_S5P_CEC=m | 586 | CONFIG_VIDEO_SAMSUNG_S5P_CEC=m |
| 619 | # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set | 587 | # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set |
| 620 | CONFIG_VIDEO_ADV7180=m | 588 | CONFIG_VIDEO_ADV7180=m |
| 621 | CONFIG_VIDEO_ML86V7667=m | 589 | CONFIG_VIDEO_ML86V7667=m |
| 622 | CONFIG_DRM=y | 590 | CONFIG_DRM=y |
| 623 | CONFIG_DRM_I2C_ADV7511=m | ||
| 624 | CONFIG_DRM_I2C_ADV7511_AUDIO=y | ||
| 625 | # CONFIG_DRM_I2C_CH7006 is not set | 591 | # CONFIG_DRM_I2C_CH7006 is not set |
| 626 | # CONFIG_DRM_I2C_SIL164 is not set | 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 | CONFIG_DRM_NOUVEAU=m | 593 | CONFIG_DRM_NOUVEAU=m |
| 631 | CONFIG_DRM_EXYNOS=m | 594 | CONFIG_DRM_EXYNOS=m |
| 632 | CONFIG_DRM_EXYNOS_FIMD=y | 595 | CONFIG_DRM_EXYNOS_FIMD=y |
| @@ -645,13 +608,18 @@ CONFIG_DRM_RCAR_LVDS=y | |||
| 645 | CONFIG_DRM_SUN4I=m | 608 | CONFIG_DRM_SUN4I=m |
| 646 | CONFIG_DRM_FSL_DCU=m | 609 | CONFIG_DRM_FSL_DCU=m |
| 647 | CONFIG_DRM_TEGRA=y | 610 | CONFIG_DRM_TEGRA=y |
| 611 | CONFIG_DRM_PANEL_SIMPLE=y | ||
| 648 | CONFIG_DRM_PANEL_SAMSUNG_LD9040=m | 612 | CONFIG_DRM_PANEL_SAMSUNG_LD9040=m |
| 649 | CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03=m | 613 | CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03=m |
| 650 | CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=m | 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 | CONFIG_DRM_SII9234=m | 618 | CONFIG_DRM_SII9234=m |
| 619 | CONFIG_DRM_I2C_ADV7511=m | ||
| 620 | CONFIG_DRM_I2C_ADV7511_AUDIO=y | ||
| 653 | CONFIG_DRM_STI=m | 621 | CONFIG_DRM_STI=m |
| 654 | CONFIG_DRM_VC4=y | 622 | CONFIG_DRM_VC4=m |
| 655 | CONFIG_DRM_ETNAVIV=m | 623 | CONFIG_DRM_ETNAVIV=m |
| 656 | CONFIG_DRM_MXSFB=m | 624 | CONFIG_DRM_MXSFB=m |
| 657 | CONFIG_FB_ARMCLCD=y | 625 | CONFIG_FB_ARMCLCD=y |
| @@ -659,8 +627,6 @@ CONFIG_FB_EFI=y | |||
| 659 | CONFIG_FB_WM8505=y | 627 | CONFIG_FB_WM8505=y |
| 660 | CONFIG_FB_SH_MOBILE_LCDC=y | 628 | CONFIG_FB_SH_MOBILE_LCDC=y |
| 661 | CONFIG_FB_SIMPLE=y | 629 | CONFIG_FB_SIMPLE=y |
| 662 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
| 663 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
| 664 | CONFIG_LCD_PLATFORM=m | 630 | CONFIG_LCD_PLATFORM=m |
| 665 | CONFIG_BACKLIGHT_PWM=y | 631 | CONFIG_BACKLIGHT_PWM=y |
| 666 | CONFIG_BACKLIGHT_AS3711=y | 632 | CONFIG_BACKLIGHT_AS3711=y |
| @@ -668,7 +634,6 @@ CONFIG_FRAMEBUFFER_CONSOLE=y | |||
| 668 | CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y | 634 | CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y |
| 669 | CONFIG_SOUND=m | 635 | CONFIG_SOUND=m |
| 670 | CONFIG_SND=m | 636 | CONFIG_SND=m |
| 671 | CONFIG_SND_DYNAMIC_MINORS=y | ||
| 672 | CONFIG_SND_HDA_TEGRA=m | 637 | CONFIG_SND_HDA_TEGRA=m |
| 673 | CONFIG_SND_HDA_INPUT_BEEP=y | 638 | CONFIG_SND_HDA_INPUT_BEEP=y |
| 674 | CONFIG_SND_HDA_PATCH_LOADER=y | 639 | CONFIG_SND_HDA_PATCH_LOADER=y |
| @@ -692,7 +657,7 @@ CONFIG_SND_SOC_SNOW=m | |||
| 692 | CONFIG_SND_SOC_ODROID=m | 657 | CONFIG_SND_SOC_ODROID=m |
| 693 | CONFIG_SND_SOC_SH4_FSI=m | 658 | CONFIG_SND_SOC_SH4_FSI=m |
| 694 | CONFIG_SND_SOC_RCAR=m | 659 | CONFIG_SND_SOC_RCAR=m |
| 695 | CONFIG_SND_SIMPLE_SCU_CARD=m | 660 | CONFIG_SND_SOC_STI=m |
| 696 | CONFIG_SND_SUN4I_CODEC=m | 661 | CONFIG_SND_SUN4I_CODEC=m |
| 697 | CONFIG_SND_SOC_TEGRA=m | 662 | CONFIG_SND_SOC_TEGRA=m |
| 698 | CONFIG_SND_SOC_TEGRA20_I2S=m | 663 | CONFIG_SND_SOC_TEGRA20_I2S=m |
| @@ -703,31 +668,25 @@ CONFIG_SND_SOC_TEGRA_WM8903=m | |||
| 703 | CONFIG_SND_SOC_TEGRA_WM9712=m | 668 | CONFIG_SND_SOC_TEGRA_WM9712=m |
| 704 | CONFIG_SND_SOC_TEGRA_TRIMSLICE=m | 669 | CONFIG_SND_SOC_TEGRA_TRIMSLICE=m |
| 705 | CONFIG_SND_SOC_TEGRA_ALC5632=m | 670 | CONFIG_SND_SOC_TEGRA_ALC5632=m |
| 706 | CONFIG_SND_SOC_CPCAP=m | ||
| 707 | CONFIG_SND_SOC_TEGRA_MAX98090=m | 671 | CONFIG_SND_SOC_TEGRA_MAX98090=m |
| 708 | CONFIG_SND_SOC_AK4642=m | 672 | CONFIG_SND_SOC_AK4642=m |
| 673 | CONFIG_SND_SOC_CPCAP=m | ||
| 709 | CONFIG_SND_SOC_SGTL5000=m | 674 | CONFIG_SND_SOC_SGTL5000=m |
| 710 | CONFIG_SND_SOC_SPDIF=m | 675 | CONFIG_SND_SOC_SPDIF=m |
| 711 | CONFIG_SND_SOC_WM8978=m | ||
| 712 | CONFIG_SND_SOC_STI=m | ||
| 713 | CONFIG_SND_SOC_STI_SAS=m | 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 | CONFIG_USB=y | 679 | CONFIG_USB=y |
| 716 | CONFIG_USB_OTG=y | 680 | CONFIG_USB_OTG=y |
| 717 | CONFIG_USB_XHCI_HCD=y | 681 | CONFIG_USB_XHCI_HCD=y |
| 718 | CONFIG_USB_XHCI_MVEBU=y | 682 | CONFIG_USB_XHCI_MVEBU=y |
| 719 | CONFIG_USB_XHCI_RCAR=m | ||
| 720 | CONFIG_USB_XHCI_TEGRA=m | 683 | CONFIG_USB_XHCI_TEGRA=m |
| 721 | CONFIG_USB_EHCI_HCD=y | 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 | CONFIG_USB_EHCI_HCD_STI=y | 685 | CONFIG_USB_EHCI_HCD_STI=y |
| 726 | CONFIG_USB_EHCI_HCD_PLATFORM=y | 686 | CONFIG_USB_EHCI_TEGRA=y |
| 727 | CONFIG_USB_ISP1760=y | 687 | CONFIG_USB_EHCI_EXYNOS=y |
| 728 | CONFIG_USB_OHCI_HCD=y | 688 | CONFIG_USB_OHCI_HCD=y |
| 729 | CONFIG_USB_OHCI_HCD_STI=y | 689 | CONFIG_USB_OHCI_HCD_STI=y |
| 730 | CONFIG_USB_OHCI_HCD_PLATFORM=y | ||
| 731 | CONFIG_USB_OHCI_EXYNOS=m | 690 | CONFIG_USB_OHCI_EXYNOS=m |
| 732 | CONFIG_USB_R8A66597_HCD=m | 691 | CONFIG_USB_R8A66597_HCD=m |
| 733 | CONFIG_USB_RENESAS_USBHS=m | 692 | CONFIG_USB_RENESAS_USBHS=m |
| @@ -746,18 +705,18 @@ CONFIG_USB_TI_CPPI41_DMA=y | |||
| 746 | CONFIG_USB_TUSB_OMAP_DMA=y | 705 | CONFIG_USB_TUSB_OMAP_DMA=y |
| 747 | CONFIG_USB_DWC3=y | 706 | CONFIG_USB_DWC3=y |
| 748 | CONFIG_USB_DWC2=y | 707 | CONFIG_USB_DWC2=y |
| 749 | CONFIG_USB_HSIC_USB3503=y | ||
| 750 | CONFIG_USB_CHIPIDEA=y | 708 | CONFIG_USB_CHIPIDEA=y |
| 751 | CONFIG_USB_CHIPIDEA_UDC=y | 709 | CONFIG_USB_CHIPIDEA_UDC=y |
| 752 | CONFIG_USB_CHIPIDEA_HOST=y | 710 | CONFIG_USB_CHIPIDEA_HOST=y |
| 711 | CONFIG_USB_ISP1760=y | ||
| 712 | CONFIG_USB_HSIC_USB3503=y | ||
| 753 | CONFIG_AB8500_USB=y | 713 | CONFIG_AB8500_USB=y |
| 754 | CONFIG_KEYSTONE_USB_PHY=y | 714 | CONFIG_KEYSTONE_USB_PHY=m |
| 755 | CONFIG_NOP_USB_XCEIV=m | 715 | CONFIG_NOP_USB_XCEIV=m |
| 756 | CONFIG_AM335X_PHY_USB=m | 716 | CONFIG_AM335X_PHY_USB=m |
| 757 | CONFIG_TWL6030_USB=m | 717 | CONFIG_TWL6030_USB=m |
| 758 | CONFIG_USB_GPIO_VBUS=y | 718 | CONFIG_USB_GPIO_VBUS=y |
| 759 | CONFIG_USB_ISP1301=y | 719 | CONFIG_USB_ISP1301=y |
| 760 | CONFIG_USB_MSM_OTG=m | ||
| 761 | CONFIG_USB_MXS_PHY=y | 720 | CONFIG_USB_MXS_PHY=y |
| 762 | CONFIG_USB_GADGET=y | 721 | CONFIG_USB_GADGET=y |
| 763 | CONFIG_USB_FSL_USB2=y | 722 | CONFIG_USB_FSL_USB2=y |
| @@ -793,21 +752,20 @@ CONFIG_MMC_SDHCI_OF_ESDHC=y | |||
| 793 | CONFIG_MMC_SDHCI_ESDHC_IMX=y | 752 | CONFIG_MMC_SDHCI_ESDHC_IMX=y |
| 794 | CONFIG_MMC_SDHCI_DOVE=y | 753 | CONFIG_MMC_SDHCI_DOVE=y |
| 795 | CONFIG_MMC_SDHCI_TEGRA=y | 754 | CONFIG_MMC_SDHCI_TEGRA=y |
| 755 | CONFIG_MMC_SDHCI_S3C=y | ||
| 796 | CONFIG_MMC_SDHCI_PXAV3=y | 756 | CONFIG_MMC_SDHCI_PXAV3=y |
| 797 | CONFIG_MMC_SDHCI_SPEAR=y | 757 | CONFIG_MMC_SDHCI_SPEAR=y |
| 798 | CONFIG_MMC_SDHCI_S3C=y | ||
| 799 | CONFIG_MMC_SDHCI_S3C_DMA=y | 758 | CONFIG_MMC_SDHCI_S3C_DMA=y |
| 800 | CONFIG_MMC_SDHCI_BCM_KONA=y | 759 | CONFIG_MMC_SDHCI_BCM_KONA=y |
| 760 | CONFIG_MMC_MESON_MX_SDIO=y | ||
| 801 | CONFIG_MMC_SDHCI_ST=y | 761 | CONFIG_MMC_SDHCI_ST=y |
| 802 | CONFIG_MMC_OMAP=y | 762 | CONFIG_MMC_OMAP=y |
| 803 | CONFIG_MMC_OMAP_HS=y | 763 | CONFIG_MMC_OMAP_HS=y |
| 804 | CONFIG_MMC_ATMELMCI=y | 764 | CONFIG_MMC_ATMELMCI=y |
| 805 | CONFIG_MMC_SDHCI_MSM=y | 765 | CONFIG_MMC_SDHCI_MSM=y |
| 806 | CONFIG_MMC_MESON_MX_SDIO=y | ||
| 807 | CONFIG_MMC_MVSDIO=y | 766 | CONFIG_MMC_MVSDIO=y |
| 808 | CONFIG_MMC_SDHI=y | 767 | CONFIG_MMC_SDHI=y |
| 809 | CONFIG_MMC_DW=y | 768 | CONFIG_MMC_DW=y |
| 810 | CONFIG_MMC_DW_PLTFM=y | ||
| 811 | CONFIG_MMC_DW_EXYNOS=y | 769 | CONFIG_MMC_DW_EXYNOS=y |
| 812 | CONFIG_MMC_DW_ROCKCHIP=y | 770 | CONFIG_MMC_DW_ROCKCHIP=y |
| 813 | CONFIG_MMC_SH_MMCIF=y | 771 | CONFIG_MMC_SH_MMCIF=y |
| @@ -847,94 +805,85 @@ CONFIG_RTC_DRV_MAX77686=y | |||
| 847 | CONFIG_RTC_DRV_RK808=m | 805 | CONFIG_RTC_DRV_RK808=m |
| 848 | CONFIG_RTC_DRV_RS5C372=m | 806 | CONFIG_RTC_DRV_RS5C372=m |
| 849 | CONFIG_RTC_DRV_BQ32K=m | 807 | CONFIG_RTC_DRV_BQ32K=m |
| 850 | CONFIG_RTC_DRV_PALMAS=y | ||
| 851 | CONFIG_RTC_DRV_ST_LPC=y | ||
| 852 | CONFIG_RTC_DRV_TWL4030=y | 808 | CONFIG_RTC_DRV_TWL4030=y |
| 809 | CONFIG_RTC_DRV_PALMAS=y | ||
| 853 | CONFIG_RTC_DRV_TPS6586X=y | 810 | CONFIG_RTC_DRV_TPS6586X=y |
| 854 | CONFIG_RTC_DRV_TPS65910=y | 811 | CONFIG_RTC_DRV_TPS65910=y |
| 855 | CONFIG_RTC_DRV_S35390A=m | 812 | CONFIG_RTC_DRV_S35390A=m |
| 856 | CONFIG_RTC_DRV_RX8581=m | 813 | CONFIG_RTC_DRV_RX8581=m |
| 857 | CONFIG_RTC_DRV_EM3027=y | 814 | CONFIG_RTC_DRV_EM3027=y |
| 815 | CONFIG_RTC_DRV_S5M=m | ||
| 858 | CONFIG_RTC_DRV_DA9063=m | 816 | CONFIG_RTC_DRV_DA9063=m |
| 859 | CONFIG_RTC_DRV_EFI=m | 817 | CONFIG_RTC_DRV_EFI=m |
| 860 | CONFIG_RTC_DRV_DIGICOLOR=m | 818 | CONFIG_RTC_DRV_DIGICOLOR=m |
| 861 | CONFIG_RTC_DRV_S5M=m | ||
| 862 | CONFIG_RTC_DRV_S3C=m | 819 | CONFIG_RTC_DRV_S3C=m |
| 863 | CONFIG_RTC_DRV_PL031=y | 820 | CONFIG_RTC_DRV_PL031=y |
| 864 | CONFIG_RTC_DRV_AT91RM9200=m | 821 | CONFIG_RTC_DRV_AT91RM9200=m |
| 865 | CONFIG_RTC_DRV_AT91SAM9=m | 822 | CONFIG_RTC_DRV_AT91SAM9=m |
| 866 | CONFIG_RTC_DRV_VT8500=y | 823 | CONFIG_RTC_DRV_VT8500=y |
| 867 | CONFIG_RTC_DRV_SUN6I=y | ||
| 868 | CONFIG_RTC_DRV_SUNXI=y | 824 | CONFIG_RTC_DRV_SUNXI=y |
| 869 | CONFIG_RTC_DRV_MV=y | 825 | CONFIG_RTC_DRV_MV=y |
| 870 | CONFIG_RTC_DRV_TEGRA=y | 826 | CONFIG_RTC_DRV_TEGRA=y |
| 827 | CONFIG_RTC_DRV_ST_LPC=y | ||
| 871 | CONFIG_RTC_DRV_CPCAP=m | 828 | CONFIG_RTC_DRV_CPCAP=m |
| 872 | CONFIG_DMADEVICES=y | 829 | CONFIG_DMADEVICES=y |
| 873 | CONFIG_DW_DMAC=y | ||
| 874 | CONFIG_AT_HDMAC=y | 830 | CONFIG_AT_HDMAC=y |
| 875 | CONFIG_AT_XDMAC=y | 831 | CONFIG_AT_XDMAC=y |
| 832 | CONFIG_DMA_BCM2835=y | ||
| 833 | CONFIG_DMA_SUN6I=y | ||
| 876 | CONFIG_FSL_EDMA=y | 834 | CONFIG_FSL_EDMA=y |
| 835 | CONFIG_IMX_DMA=y | ||
| 836 | CONFIG_IMX_SDMA=y | ||
| 877 | CONFIG_MV_XOR=y | 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 | CONFIG_TEGRA20_APB_DMA=y | 843 | CONFIG_TEGRA20_APB_DMA=y |
| 844 | CONFIG_XILINX_DMA=y | ||
| 845 | CONFIG_QCOM_BAM_DMA=y | ||
| 846 | CONFIG_DW_DMAC=y | ||
| 879 | CONFIG_SH_DMAE=y | 847 | CONFIG_SH_DMAE=y |
| 880 | CONFIG_RCAR_DMAC=y | 848 | CONFIG_RCAR_DMAC=y |
| 881 | CONFIG_RENESAS_USB_DMAC=m | 849 | CONFIG_RENESAS_USB_DMAC=m |
| 882 | CONFIG_STE_DMA40=y | 850 | CONFIG_VIRTIO_PCI=y |
| 883 | CONFIG_SIRF_DMA=y | 851 | CONFIG_VIRTIO_MMIO=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 | ||
| 895 | CONFIG_STAGING=y | 852 | CONFIG_STAGING=y |
| 896 | CONFIG_SENSORS_ISL29018=y | ||
| 897 | CONFIG_SENSORS_ISL29028=y | ||
| 898 | CONFIG_MFD_NVEC=y | 853 | CONFIG_MFD_NVEC=y |
| 899 | CONFIG_KEYBOARD_NVEC=y | 854 | CONFIG_KEYBOARD_NVEC=y |
| 900 | CONFIG_SERIO_NVEC_PS2=y | 855 | CONFIG_SERIO_NVEC_PS2=y |
| 901 | CONFIG_NVEC_POWER=y | 856 | CONFIG_NVEC_POWER=y |
| 902 | CONFIG_NVEC_PAZ00=y | 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 | CONFIG_STAGING_BOARD=y | 858 | CONFIG_STAGING_BOARD=y |
| 919 | CONFIG_CROS_EC_CHARDEV=m | ||
| 920 | CONFIG_COMMON_CLK_MAX77686=y | 859 | CONFIG_COMMON_CLK_MAX77686=y |
| 921 | CONFIG_COMMON_CLK_RK808=m | 860 | CONFIG_COMMON_CLK_RK808=m |
| 922 | CONFIG_COMMON_CLK_S2MPS11=m | 861 | CONFIG_COMMON_CLK_S2MPS11=m |
| 862 | CONFIG_COMMON_CLK_QCOM=y | ||
| 863 | CONFIG_QCOM_CLK_RPM=y | ||
| 923 | CONFIG_APQ_MMCC_8084=y | 864 | CONFIG_APQ_MMCC_8084=y |
| 924 | CONFIG_MSM_GCC_8660=y | 865 | CONFIG_MSM_GCC_8660=y |
| 925 | CONFIG_MSM_MMCC_8960=y | 866 | CONFIG_MSM_MMCC_8960=y |
| 926 | CONFIG_MSM_MMCC_8974=y | 867 | CONFIG_MSM_MMCC_8974=y |
| 927 | CONFIG_HWSPINLOCK_QCOM=y | 868 | CONFIG_BCM2835_MBOX=y |
| 928 | CONFIG_ROCKCHIP_IOMMU=y | 869 | CONFIG_ROCKCHIP_IOMMU=y |
| 929 | CONFIG_TEGRA_IOMMU_GART=y | 870 | CONFIG_TEGRA_IOMMU_GART=y |
| 930 | CONFIG_TEGRA_IOMMU_SMMU=y | 871 | CONFIG_TEGRA_IOMMU_SMMU=y |
| 931 | CONFIG_REMOTEPROC=m | 872 | CONFIG_REMOTEPROC=m |
| 932 | CONFIG_ST_REMOTEPROC=m | 873 | CONFIG_ST_REMOTEPROC=m |
| 933 | CONFIG_RPMSG_VIRTIO=m | 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 | CONFIG_PM_DEVFREQ=y | 885 | CONFIG_PM_DEVFREQ=y |
| 935 | CONFIG_ARM_TEGRA_DEVFREQ=m | 886 | CONFIG_ARM_TEGRA_DEVFREQ=m |
| 936 | CONFIG_MEMORY=y | ||
| 937 | CONFIG_EXTCON=y | ||
| 938 | CONFIG_TI_AEMIF=y | 887 | CONFIG_TI_AEMIF=y |
| 939 | CONFIG_IIO=y | 888 | CONFIG_IIO=y |
| 940 | CONFIG_IIO_SW_TRIGGER=y | 889 | CONFIG_IIO_SW_TRIGGER=y |
| @@ -947,56 +896,54 @@ CONFIG_VF610_ADC=m | |||
| 947 | CONFIG_XILINX_XADC=y | 896 | CONFIG_XILINX_XADC=y |
| 948 | CONFIG_MPU3050_I2C=y | 897 | CONFIG_MPU3050_I2C=y |
| 949 | CONFIG_CM36651=m | 898 | CONFIG_CM36651=m |
| 899 | CONFIG_SENSORS_ISL29018=y | ||
| 900 | CONFIG_SENSORS_ISL29028=y | ||
| 950 | CONFIG_AK8975=y | 901 | CONFIG_AK8975=y |
| 951 | CONFIG_RASPBERRYPI_POWER=y | ||
| 952 | CONFIG_IIO_HRTIMER_TRIGGER=y | 902 | CONFIG_IIO_HRTIMER_TRIGGER=y |
| 953 | CONFIG_PWM=y | 903 | CONFIG_PWM=y |
| 954 | CONFIG_PWM_ATMEL=m | 904 | CONFIG_PWM_ATMEL=m |
| 955 | CONFIG_PWM_ATMEL_HLCDC_PWM=m | 905 | CONFIG_PWM_ATMEL_HLCDC_PWM=m |
| 956 | CONFIG_PWM_ATMEL_TCB=m | 906 | CONFIG_PWM_ATMEL_TCB=m |
| 907 | CONFIG_PWM_BCM2835=y | ||
| 908 | CONFIG_PWM_BRCMSTB=m | ||
| 957 | CONFIG_PWM_FSL_FTM=m | 909 | CONFIG_PWM_FSL_FTM=m |
| 958 | CONFIG_PWM_MESON=m | 910 | CONFIG_PWM_MESON=m |
| 959 | CONFIG_PWM_RCAR=m | 911 | CONFIG_PWM_RCAR=m |
| 960 | CONFIG_PWM_RENESAS_TPU=y | 912 | CONFIG_PWM_RENESAS_TPU=y |
| 961 | CONFIG_PWM_ROCKCHIP=m | 913 | CONFIG_PWM_ROCKCHIP=m |
| 962 | CONFIG_PWM_SAMSUNG=m | 914 | CONFIG_PWM_SAMSUNG=m |
| 915 | CONFIG_PWM_STI=y | ||
| 963 | CONFIG_PWM_SUN4I=y | 916 | CONFIG_PWM_SUN4I=y |
| 964 | CONFIG_PWM_TEGRA=y | 917 | CONFIG_PWM_TEGRA=y |
| 965 | CONFIG_PWM_VT8500=y | 918 | CONFIG_PWM_VT8500=y |
| 919 | CONFIG_KEYSTONE_IRQ=y | ||
| 920 | CONFIG_PHY_SUN4I_USB=y | ||
| 921 | CONFIG_PHY_SUN9I_USB=y | ||
| 966 | CONFIG_PHY_HIX5HD2_SATA=y | 922 | CONFIG_PHY_HIX5HD2_SATA=y |
| 967 | CONFIG_E1000E=y | 923 | CONFIG_PHY_BERLIN_SATA=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 | ||
| 975 | CONFIG_PHY_BERLIN_USB=y | 924 | CONFIG_PHY_BERLIN_USB=y |
| 976 | CONFIG_PHY_CPCAP_USB=m | 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 | CONFIG_PHY_ROCKCHIP_DP=m | 928 | CONFIG_PHY_ROCKCHIP_DP=m |
| 979 | CONFIG_PHY_ROCKCHIP_USB=y | 929 | CONFIG_PHY_ROCKCHIP_USB=y |
| 980 | CONFIG_PHY_QCOM_APQ8064_SATA=m | 930 | CONFIG_PHY_SAMSUNG_USB2=m |
| 981 | CONFIG_PHY_MIPHY28LP=y | 931 | CONFIG_PHY_MIPHY28LP=y |
| 982 | CONFIG_PHY_RCAR_GEN2=m | ||
| 983 | CONFIG_PHY_STIH407_USB=y | 932 | CONFIG_PHY_STIH407_USB=y |
| 984 | CONFIG_PHY_STM32_USBPHYC=y | 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 | CONFIG_PHY_TEGRA_XUSB=y | 934 | CONFIG_PHY_TEGRA_XUSB=y |
| 989 | CONFIG_PHY_BRCM_SATA=y | 935 | CONFIG_PHY_DM816X_USB=m |
| 990 | CONFIG_NVMEM=y | 936 | CONFIG_OMAP_USB2=y |
| 937 | CONFIG_TI_PIPE3=y | ||
| 938 | CONFIG_TWL4030_USB=m | ||
| 991 | CONFIG_NVMEM_IMX_OCOTP=y | 939 | CONFIG_NVMEM_IMX_OCOTP=y |
| 992 | CONFIG_NVMEM_SUNXI_SID=y | 940 | CONFIG_NVMEM_SUNXI_SID=y |
| 993 | CONFIG_NVMEM_VF610_OCOTP=y | 941 | CONFIG_NVMEM_VF610_OCOTP=y |
| 994 | CONFIG_BCM2835_MBOX=y | ||
| 995 | CONFIG_RASPBERRYPI_FIRMWARE=y | 942 | CONFIG_RASPBERRYPI_FIRMWARE=y |
| 996 | CONFIG_EFI_VARS=m | ||
| 997 | CONFIG_EFI_CAPSULE_LOADER=m | ||
| 998 | CONFIG_BCM47XX_NVRAM=y | 943 | CONFIG_BCM47XX_NVRAM=y |
| 999 | CONFIG_BCM47XX_SPROM=y | 944 | CONFIG_BCM47XX_SPROM=y |
| 945 | CONFIG_EFI_VARS=m | ||
| 946 | CONFIG_EFI_CAPSULE_LOADER=m | ||
| 1000 | CONFIG_EXT4_FS=y | 947 | CONFIG_EXT4_FS=y |
| 1001 | CONFIG_AUTOFS4_FS=y | 948 | CONFIG_AUTOFS4_FS=y |
| 1002 | CONFIG_MSDOS_FS=y | 949 | CONFIG_MSDOS_FS=y |
| @@ -1004,7 +951,6 @@ CONFIG_VFAT_FS=y | |||
| 1004 | CONFIG_NTFS_FS=y | 951 | CONFIG_NTFS_FS=y |
| 1005 | CONFIG_TMPFS_POSIX_ACL=y | 952 | CONFIG_TMPFS_POSIX_ACL=y |
| 1006 | CONFIG_UBIFS_FS=y | 953 | CONFIG_UBIFS_FS=y |
| 1007 | CONFIG_TMPFS=y | ||
| 1008 | CONFIG_SQUASHFS=y | 954 | CONFIG_SQUASHFS=y |
| 1009 | CONFIG_SQUASHFS_LZO=y | 955 | CONFIG_SQUASHFS_LZO=y |
| 1010 | CONFIG_SQUASHFS_XZ=y | 956 | CONFIG_SQUASHFS_XZ=y |
| @@ -1020,13 +966,7 @@ CONFIG_NLS_CODEPAGE_437=y | |||
| 1020 | CONFIG_NLS_ISO8859_1=y | 966 | CONFIG_NLS_ISO8859_1=y |
| 1021 | CONFIG_NLS_UTF8=y | 967 | CONFIG_NLS_UTF8=y |
| 1022 | CONFIG_PRINTK_TIME=y | 968 | CONFIG_PRINTK_TIME=y |
| 1023 | CONFIG_DEBUG_FS=y | ||
| 1024 | CONFIG_MAGIC_SYSRQ=y | 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 | CONFIG_CRYPTO_USER=m | 970 | CONFIG_CRYPTO_USER=m |
| 1031 | CONFIG_CRYPTO_USER_API_HASH=m | 971 | CONFIG_CRYPTO_USER_API_HASH=m |
| 1032 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 972 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| @@ -1035,27 +975,19 @@ CONFIG_CRYPTO_USER_API_AEAD=m | |||
| 1035 | CONFIG_CRYPTO_DEV_MARVELL_CESA=m | 975 | CONFIG_CRYPTO_DEV_MARVELL_CESA=m |
| 1036 | CONFIG_CRYPTO_DEV_EXYNOS_RNG=m | 976 | CONFIG_CRYPTO_DEV_EXYNOS_RNG=m |
| 1037 | CONFIG_CRYPTO_DEV_S5P=m | 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 | CONFIG_CRYPTO_DEV_SUN4I_SS=m | 981 | CONFIG_CRYPTO_DEV_SUN4I_SS=m |
| 1039 | CONFIG_CRYPTO_DEV_ROCKCHIP=m | 982 | CONFIG_CRYPTO_DEV_ROCKCHIP=m |
| 1040 | CONFIG_ARM_CRYPTO=y | 983 | CONFIG_ARM_CRYPTO=y |
| 1041 | CONFIG_CRYPTO_SHA1_ARM=m | ||
| 1042 | CONFIG_CRYPTO_SHA1_ARM_NEON=m | 984 | CONFIG_CRYPTO_SHA1_ARM_NEON=m |
| 1043 | CONFIG_CRYPTO_SHA1_ARM_CE=m | 985 | CONFIG_CRYPTO_SHA1_ARM_CE=m |
| 1044 | CONFIG_CRYPTO_SHA2_ARM_CE=m | 986 | CONFIG_CRYPTO_SHA2_ARM_CE=m |
| 1045 | CONFIG_CRYPTO_SHA256_ARM=m | ||
| 1046 | CONFIG_CRYPTO_SHA512_ARM=m | 987 | CONFIG_CRYPTO_SHA512_ARM=m |
| 1047 | CONFIG_CRYPTO_AES_ARM=m | 988 | CONFIG_CRYPTO_AES_ARM=m |
| 1048 | CONFIG_CRYPTO_AES_ARM_BS=m | 989 | CONFIG_CRYPTO_AES_ARM_BS=m |
| 1049 | CONFIG_CRYPTO_AES_ARM_CE=m | 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 | CONFIG_CRYPTO_GHASH_ARM_CE=m | 991 | CONFIG_CRYPTO_GHASH_ARM_CE=m |
| 1054 | CONFIG_CRYPTO_DEV_ATMEL_AES=m | 992 | CONFIG_CRYPTO_CRC32_ARM_CE=m |
| 1055 | CONFIG_CRYPTO_DEV_ATMEL_TDES=m | 993 | CONFIG_CRYPTO_CHACHA20_NEON=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 | ||
diff --git a/arch/arm/crypto/speck-neon-core.S b/arch/arm/crypto/speck-neon-core.S index 3c1e203e53b9..57caa742016e 100644 --- a/arch/arm/crypto/speck-neon-core.S +++ b/arch/arm/crypto/speck-neon-core.S | |||
| @@ -272,9 +272,11 @@ | |||
| 272 | * Allocate stack space to store 128 bytes worth of tweaks. For | 272 | * Allocate stack space to store 128 bytes worth of tweaks. For |
| 273 | * performance, this space is aligned to a 16-byte boundary so that we | 273 | * performance, this space is aligned to a 16-byte boundary so that we |
| 274 | * can use the load/store instructions that declare 16-byte alignment. | 274 | * can use the load/store instructions that declare 16-byte alignment. |
| 275 | * For Thumb2 compatibility, don't do the 'bic' directly on 'sp'. | ||
| 275 | */ | 276 | */ |
| 276 | sub sp, #128 | 277 | sub r12, sp, #128 |
| 277 | bic sp, #0xf | 278 | bic r12, #0xf |
| 279 | mov sp, r12 | ||
| 278 | 280 | ||
| 279 | .if \n == 64 | 281 | .if \n == 64 |
| 280 | // Load first tweak | 282 | // Load first tweak |
diff --git a/arch/arm/firmware/Makefile b/arch/arm/firmware/Makefile index a71f16536b6c..6e41336b0bc4 100644 --- a/arch/arm/firmware/Makefile +++ b/arch/arm/firmware/Makefile | |||
| @@ -1 +1,4 @@ | |||
| 1 | obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o | 1 | obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o |
| 2 | |||
| 3 | # tf_generic_smc() fails to build with -fsanitize-coverage=trace-pc | ||
| 4 | KCOV_INSTRUMENT := n | ||
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S index dd546d65a383..7a9b86978ee1 100644 --- a/arch/arm/kernel/head-nommu.S +++ b/arch/arm/kernel/head-nommu.S | |||
| @@ -177,7 +177,7 @@ M_CLASS(streq r3, [r12, #PMSAv8_MAIR1]) | |||
| 177 | bic r0, r0, #CR_I | 177 | bic r0, r0, #CR_I |
| 178 | #endif | 178 | #endif |
| 179 | mcr p15, 0, r0, c1, c0, 0 @ write control reg | 179 | mcr p15, 0, r0, c1, c0, 0 @ write control reg |
| 180 | isb | 180 | instr_sync |
| 181 | #elif defined (CONFIG_CPU_V7M) | 181 | #elif defined (CONFIG_CPU_V7M) |
| 182 | #ifdef CONFIG_ARM_MPU | 182 | #ifdef CONFIG_ARM_MPU |
| 183 | ldreq r3, [r12, MPU_CTRL] | 183 | ldreq r3, [r12, MPU_CTRL] |
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index c46a728df44e..25aac6ee2ab1 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig | |||
| @@ -20,6 +20,7 @@ config ARCH_BCM_IPROC | |||
| 20 | select GPIOLIB | 20 | select GPIOLIB |
| 21 | select ARM_AMBA | 21 | select ARM_AMBA |
| 22 | select PINCTRL | 22 | select PINCTRL |
| 23 | select PCI_DOMAINS if PCI | ||
| 23 | help | 24 | help |
| 24 | This enables support for systems based on Broadcom IPROC architected SoCs. | 25 | This enables support for systems based on Broadcom IPROC architected SoCs. |
| 25 | The IPROC complex contains one or more ARM CPUs along with common | 26 | The IPROC complex contains one or more ARM CPUs along with common |
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index e22fb40e34bc..6d5beb11bd96 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
| @@ -774,7 +774,7 @@ static struct gpiod_lookup_table mmc_gpios_table = { | |||
| 774 | GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_CD_PIN, "cd", | 774 | GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_CD_PIN, "cd", |
| 775 | GPIO_ACTIVE_LOW), | 775 | GPIO_ACTIVE_LOW), |
| 776 | GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_WP_PIN, "wp", | 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 | ||
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig index d0f62eacf59d..4adb901dd5eb 100644 --- a/arch/arm/mach-socfpga/Kconfig +++ b/arch/arm/mach-socfpga/Kconfig | |||
| @@ -10,6 +10,7 @@ menuconfig ARCH_SOCFPGA | |||
| 10 | select HAVE_ARM_SCU | 10 | select HAVE_ARM_SCU |
| 11 | select HAVE_ARM_TWD if SMP | 11 | select HAVE_ARM_TWD if SMP |
| 12 | select MFD_SYSCON | 12 | select MFD_SYSCON |
| 13 | select PCI_DOMAINS if PCI | ||
| 13 | 14 | ||
| 14 | if ARCH_SOCFPGA | 15 | if ARCH_SOCFPGA |
| 15 | config SOCFPGA_SUSPEND | 16 | config SOCFPGA_SUSPEND |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index c186474422f3..0cc8e04295a4 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
| @@ -736,20 +736,29 @@ static int __mark_rodata_ro(void *unused) | |||
| 736 | return 0; | 736 | return 0; |
| 737 | } | 737 | } |
| 738 | 738 | ||
| 739 | static int kernel_set_to_readonly __read_mostly; | ||
| 740 | |||
| 739 | void mark_rodata_ro(void) | 741 | void mark_rodata_ro(void) |
| 740 | { | 742 | { |
| 743 | kernel_set_to_readonly = 1; | ||
| 741 | stop_machine(__mark_rodata_ro, NULL, NULL); | 744 | stop_machine(__mark_rodata_ro, NULL, NULL); |
| 742 | debug_checkwx(); | 745 | debug_checkwx(); |
| 743 | } | 746 | } |
| 744 | 747 | ||
| 745 | void set_kernel_text_rw(void) | 748 | void set_kernel_text_rw(void) |
| 746 | { | 749 | { |
| 750 | if (!kernel_set_to_readonly) | ||
| 751 | return; | ||
| 752 | |||
| 747 | set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), false, | 753 | set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), false, |
| 748 | current->active_mm); | 754 | current->active_mm); |
| 749 | } | 755 | } |
| 750 | 756 | ||
| 751 | void set_kernel_text_ro(void) | 757 | void set_kernel_text_ro(void) |
| 752 | { | 758 | { |
| 759 | if (!kernel_set_to_readonly) | ||
| 760 | return; | ||
| 761 | |||
| 753 | set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), true, | 762 | set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), true, |
| 754 | current->active_mm); | 763 | current->active_mm); |
| 755 | } | 764 | } |
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 6e8b71613039..f6a62ae44a65 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c | |||
| @@ -1844,7 +1844,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) | |||
| 1844 | /* there are 2 passes here */ | 1844 | /* there are 2 passes here */ |
| 1845 | bpf_jit_dump(prog->len, image_size, 2, ctx.target); | 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 | prog->bpf_func = (void *)ctx.target; | 1848 | prog->bpf_func = (void *)ctx.target; |
| 1849 | prog->jited = 1; | 1849 | prog->jited = 1; |
| 1850 | prog->jited_len = image_size; | 1850 | prog->jited_len = image_size; |
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 45272266dafb..e7101b19d590 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | # | 10 | # |
| 11 | # Copyright (C) 1995-2001 by Russell King | 11 | # Copyright (C) 1995-2001 by Russell King |
| 12 | 12 | ||
| 13 | LDFLAGS_vmlinux :=-p --no-undefined -X | 13 | LDFLAGS_vmlinux :=--no-undefined -X |
| 14 | CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET) | 14 | CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET) |
| 15 | GZFLAGS :=-9 | 15 | GZFLAGS :=-9 |
| 16 | 16 | ||
| @@ -60,15 +60,15 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN), y) | |||
| 60 | KBUILD_CPPFLAGS += -mbig-endian | 60 | KBUILD_CPPFLAGS += -mbig-endian |
| 61 | CHECKFLAGS += -D__AARCH64EB__ | 61 | CHECKFLAGS += -D__AARCH64EB__ |
| 62 | AS += -EB | 62 | AS += -EB |
| 63 | LD += -EB | 63 | # We must use the linux target here, since distributions don't tend to package |
| 64 | LDFLAGS += -maarch64linuxb | 64 | # the ELF linker scripts with binutils, and this results in a build failure. |
| 65 | LDFLAGS += -EB -maarch64linuxb | ||
| 65 | UTS_MACHINE := aarch64_be | 66 | UTS_MACHINE := aarch64_be |
| 66 | else | 67 | else |
| 67 | KBUILD_CPPFLAGS += -mlittle-endian | 68 | KBUILD_CPPFLAGS += -mlittle-endian |
| 68 | CHECKFLAGS += -D__AARCH64EL__ | 69 | CHECKFLAGS += -D__AARCH64EL__ |
| 69 | AS += -EL | 70 | AS += -EL |
| 70 | LD += -EL | 71 | LDFLAGS += -EL -maarch64linux # See comment above |
| 71 | LDFLAGS += -maarch64linux | ||
| 72 | UTS_MACHINE := aarch64 | 72 | UTS_MACHINE := aarch64 |
| 73 | endif | 73 | endif |
| 74 | 74 | ||
diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi index e6b059378dc0..67dac595dc72 100644 --- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | |||
| @@ -309,8 +309,7 @@ | |||
| 309 | interrupts = <0 99 4>; | 309 | interrupts = <0 99 4>; |
| 310 | resets = <&rst SPIM0_RESET>; | 310 | resets = <&rst SPIM0_RESET>; |
| 311 | reg-io-width = <4>; | 311 | reg-io-width = <4>; |
| 312 | num-chipselect = <4>; | 312 | num-cs = <4>; |
| 313 | bus-num = <0>; | ||
| 314 | status = "disabled"; | 313 | status = "disabled"; |
| 315 | }; | 314 | }; |
| 316 | 315 | ||
| @@ -322,8 +321,7 @@ | |||
| 322 | interrupts = <0 100 4>; | 321 | interrupts = <0 100 4>; |
| 323 | resets = <&rst SPIM1_RESET>; | 322 | resets = <&rst SPIM1_RESET>; |
| 324 | reg-io-width = <4>; | 323 | reg-io-width = <4>; |
| 325 | num-chipselect = <4>; | 324 | num-cs = <4>; |
| 326 | bus-num = <0>; | ||
| 327 | status = "disabled"; | 325 | status = "disabled"; |
| 328 | }; | 326 | }; |
| 329 | 327 | ||
diff --git a/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts b/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts index 4b3331fbfe39..dff9b15eb3c0 100644 --- a/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +++ b/arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | |||
| @@ -66,9 +66,22 @@ | |||
| 66 | 66 | ||
| 67 | ðmac { | 67 | ðmac { |
| 68 | status = "okay"; | 68 | status = "okay"; |
| 69 | phy-mode = "rgmii"; | ||
| 70 | pinctrl-0 = <ð_rgmii_y_pins>; | 69 | pinctrl-0 = <ð_rgmii_y_pins>; |
| 71 | pinctrl-names = "default"; | 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 | &uart_A { | 87 | &uart_A { |
diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi index fee87737a201..67d7115e4eff 100644 --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi | |||
| @@ -132,7 +132,7 @@ | |||
| 132 | 132 | ||
| 133 | sd_emmc_b: sd@5000 { | 133 | sd_emmc_b: sd@5000 { |
| 134 | compatible = "amlogic,meson-axg-mmc"; | 134 | compatible = "amlogic,meson-axg-mmc"; |
| 135 | reg = <0x0 0x5000 0x0 0x2000>; | 135 | reg = <0x0 0x5000 0x0 0x800>; |
| 136 | interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>; | 136 | interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>; |
| 137 | status = "disabled"; | 137 | status = "disabled"; |
| 138 | clocks = <&clkc CLKID_SD_EMMC_B>, | 138 | clocks = <&clkc CLKID_SD_EMMC_B>, |
| @@ -144,7 +144,7 @@ | |||
| 144 | 144 | ||
| 145 | sd_emmc_c: mmc@7000 { | 145 | sd_emmc_c: mmc@7000 { |
| 146 | compatible = "amlogic,meson-axg-mmc"; | 146 | compatible = "amlogic,meson-axg-mmc"; |
| 147 | reg = <0x0 0x7000 0x0 0x2000>; | 147 | reg = <0x0 0x7000 0x0 0x800>; |
| 148 | interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>; | 148 | interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>; |
| 149 | status = "disabled"; | 149 | status = "disabled"; |
| 150 | clocks = <&clkc CLKID_SD_EMMC_C>, | 150 | clocks = <&clkc CLKID_SD_EMMC_C>, |
diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi index 3c31e21cbed7..b8dc4dbb391b 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi | |||
| @@ -35,6 +35,12 @@ | |||
| 35 | no-map; | 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 | linux,cma { | 44 | linux,cma { |
| 39 | compatible = "shared-dma-pool"; | 45 | compatible = "shared-dma-pool"; |
| 40 | reusable; | 46 | reusable; |
| @@ -457,21 +463,21 @@ | |||
| 457 | 463 | ||
| 458 | sd_emmc_a: mmc@70000 { | 464 | sd_emmc_a: mmc@70000 { |
| 459 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; | 465 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; |
| 460 | reg = <0x0 0x70000 0x0 0x2000>; | 466 | reg = <0x0 0x70000 0x0 0x800>; |
| 461 | interrupts = <GIC_SPI 216 IRQ_TYPE_EDGE_RISING>; | 467 | interrupts = <GIC_SPI 216 IRQ_TYPE_EDGE_RISING>; |
| 462 | status = "disabled"; | 468 | status = "disabled"; |
| 463 | }; | 469 | }; |
| 464 | 470 | ||
| 465 | sd_emmc_b: mmc@72000 { | 471 | sd_emmc_b: mmc@72000 { |
| 466 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; | 472 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; |
| 467 | reg = <0x0 0x72000 0x0 0x2000>; | 473 | reg = <0x0 0x72000 0x0 0x800>; |
| 468 | interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>; | 474 | interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>; |
| 469 | status = "disabled"; | 475 | status = "disabled"; |
| 470 | }; | 476 | }; |
| 471 | 477 | ||
| 472 | sd_emmc_c: mmc@74000 { | 478 | sd_emmc_c: mmc@74000 { |
| 473 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; | 479 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; |
| 474 | reg = <0x0 0x74000 0x0 0x2000>; | 480 | reg = <0x0 0x74000 0x0 0x800>; |
| 475 | interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>; | 481 | interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>; |
| 476 | status = "disabled"; | 482 | status = "disabled"; |
| 477 | }; | 483 | }; |
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi index eb327664a4d8..6aaafff674f9 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | &apb { | 7 | &apb { |
| 8 | mali: gpu@c0000 { | 8 | mali: gpu@c0000 { |
| 9 | compatible = "amlogic,meson-gxbb-mali", "arm,mali-450"; | 9 | compatible = "amlogic,meson-gxl-mali", "arm,mali-450"; |
| 10 | reg = <0x0 0xc0000 0x0 0x40000>; | 10 | reg = <0x0 0xc0000 0x0 0x40000>; |
| 11 | interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>, | 11 | interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>, |
| 12 | <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>, | 12 | <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>, |
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts index 3e3eb31748a3..f63bceb88caa 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts | |||
| @@ -234,9 +234,6 @@ | |||
| 234 | 234 | ||
| 235 | bus-width = <4>; | 235 | bus-width = <4>; |
| 236 | cap-sd-highspeed; | 236 | cap-sd-highspeed; |
| 237 | sd-uhs-sdr12; | ||
| 238 | sd-uhs-sdr25; | ||
| 239 | sd-uhs-sdr50; | ||
| 240 | max-frequency = <100000000>; | 237 | max-frequency = <100000000>; |
| 241 | disable-wp; | 238 | disable-wp; |
| 242 | 239 | ||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi index 0cfd701809de..a1b31013ab6e 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi | |||
| @@ -189,3 +189,10 @@ | |||
| 189 | &usb0 { | 189 | &usb0 { |
| 190 | status = "okay"; | 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 | }; | ||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi index 27538eea547b..c87a80e9bcc6 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | |||
| @@ -13,14 +13,6 @@ | |||
| 13 | / { | 13 | / { |
| 14 | compatible = "amlogic,meson-gxl"; | 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 | soc { | 16 | soc { |
| 25 | usb0: usb@c9000000 { | 17 | usb0: usb@c9000000 { |
| 26 | status = "disabled"; | 18 | status = "disabled"; |
diff --git a/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi b/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi index 4a2a6af8e752..4057197048dc 100644 --- a/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi +++ b/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi | |||
| @@ -118,7 +118,7 @@ | |||
| 118 | 118 | ||
| 119 | #interrupt-cells = <1>; | 119 | #interrupt-cells = <1>; |
| 120 | interrupt-map-mask = <0 0 0 0>; | 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 | linux,pci-domain = <0>; | 123 | linux,pci-domain = <0>; |
| 124 | 124 | ||
| @@ -149,7 +149,7 @@ | |||
| 149 | 149 | ||
| 150 | #interrupt-cells = <1>; | 150 | #interrupt-cells = <1>; |
| 151 | interrupt-map-mask = <0 0 0 0>; | 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 | linux,pci-domain = <4>; | 154 | linux,pci-domain = <4>; |
| 155 | 155 | ||
| @@ -566,7 +566,7 @@ | |||
| 566 | reg = <0x66080000 0x100>; | 566 | reg = <0x66080000 0x100>; |
| 567 | #address-cells = <1>; | 567 | #address-cells = <1>; |
| 568 | #size-cells = <0>; | 568 | #size-cells = <0>; |
| 569 | interrupts = <GIC_SPI 394 IRQ_TYPE_NONE>; | 569 | interrupts = <GIC_SPI 394 IRQ_TYPE_LEVEL_HIGH>; |
| 570 | clock-frequency = <100000>; | 570 | clock-frequency = <100000>; |
| 571 | status = "disabled"; | 571 | status = "disabled"; |
| 572 | }; | 572 | }; |
| @@ -594,7 +594,7 @@ | |||
| 594 | reg = <0x660b0000 0x100>; | 594 | reg = <0x660b0000 0x100>; |
| 595 | #address-cells = <1>; | 595 | #address-cells = <1>; |
| 596 | #size-cells = <0>; | 596 | #size-cells = <0>; |
| 597 | interrupts = <GIC_SPI 395 IRQ_TYPE_NONE>; | 597 | interrupts = <GIC_SPI 395 IRQ_TYPE_LEVEL_HIGH>; |
| 598 | clock-frequency = <100000>; | 598 | clock-frequency = <100000>; |
| 599 | status = "disabled"; | 599 | status = "disabled"; |
| 600 | }; | 600 | }; |
diff --git a/arch/arm64/boot/dts/broadcom/stingray/bcm958742k.dts b/arch/arm64/boot/dts/broadcom/stingray/bcm958742k.dts index eb6f08cdbd79..77efa28c4dd5 100644 --- a/arch/arm64/boot/dts/broadcom/stingray/bcm958742k.dts +++ b/arch/arm64/boot/dts/broadcom/stingray/bcm958742k.dts | |||
| @@ -43,6 +43,10 @@ | |||
| 43 | enet-phy-lane-swap; | 43 | enet-phy-lane-swap; |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | &sdio0 { | ||
| 47 | mmc-ddr-1_8v; | ||
| 48 | }; | ||
| 49 | |||
| 46 | &uart2 { | 50 | &uart2 { |
| 47 | status = "okay"; | 51 | status = "okay"; |
| 48 | }; | 52 | }; |
diff --git a/arch/arm64/boot/dts/broadcom/stingray/bcm958742t.dts b/arch/arm64/boot/dts/broadcom/stingray/bcm958742t.dts index 5084b037320f..55ba495ef56e 100644 --- a/arch/arm64/boot/dts/broadcom/stingray/bcm958742t.dts +++ b/arch/arm64/boot/dts/broadcom/stingray/bcm958742t.dts | |||
| @@ -42,3 +42,7 @@ | |||
| 42 | &gphy0 { | 42 | &gphy0 { |
| 43 | enet-phy-lane-swap; | 43 | enet-phy-lane-swap; |
| 44 | }; | 44 | }; |
| 45 | |||
| 46 | &sdio0 { | ||
| 47 | mmc-ddr-1_8v; | ||
| 48 | }; | ||
diff --git a/arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi b/arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi index 99aaff0b6d72..b203152ad67c 100644 --- a/arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi +++ b/arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi | |||
| @@ -409,7 +409,7 @@ | |||
| 409 | reg = <0x000b0000 0x100>; | 409 | reg = <0x000b0000 0x100>; |
| 410 | #address-cells = <1>; | 410 | #address-cells = <1>; |
| 411 | #size-cells = <0>; | 411 | #size-cells = <0>; |
| 412 | interrupts = <GIC_SPI 177 IRQ_TYPE_NONE>; | 412 | interrupts = <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH>; |
| 413 | clock-frequency = <100000>; | 413 | clock-frequency = <100000>; |
| 414 | status = "disabled"; | 414 | status = "disabled"; |
| 415 | }; | 415 | }; |
| @@ -453,7 +453,7 @@ | |||
| 453 | reg = <0x000e0000 0x100>; | 453 | reg = <0x000e0000 0x100>; |
| 454 | #address-cells = <1>; | 454 | #address-cells = <1>; |
| 455 | #size-cells = <0>; | 455 | #size-cells = <0>; |
| 456 | interrupts = <GIC_SPI 178 IRQ_TYPE_NONE>; | 456 | interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>; |
| 457 | clock-frequency = <100000>; | 457 | clock-frequency = <100000>; |
| 458 | status = "disabled"; | 458 | status = "disabled"; |
| 459 | }; | 459 | }; |
diff --git a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts index c6999624ed8a..68c5a6c819ae 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts +++ b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts | |||
| @@ -585,6 +585,8 @@ | |||
| 585 | vmmc-supply = <&wlan_en>; | 585 | vmmc-supply = <&wlan_en>; |
| 586 | ti,non-removable; | 586 | ti,non-removable; |
| 587 | non-removable; | 587 | non-removable; |
| 588 | cap-power-off-card; | ||
| 589 | keep-power-in-suspend; | ||
| 588 | #address-cells = <0x1>; | 590 | #address-cells = <0x1>; |
| 589 | #size-cells = <0x0>; | 591 | #size-cells = <0x0>; |
| 590 | status = "ok"; | 592 | status = "ok"; |
diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts index edb4ee0b8896..7f12624f6c8e 100644 --- a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts +++ b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | |||
| @@ -322,6 +322,8 @@ | |||
| 322 | dwmmc_2: dwmmc2@f723f000 { | 322 | dwmmc_2: dwmmc2@f723f000 { |
| 323 | bus-width = <0x4>; | 323 | bus-width = <0x4>; |
| 324 | non-removable; | 324 | non-removable; |
| 325 | cap-power-off-card; | ||
| 326 | keep-power-in-suspend; | ||
| 325 | vmmc-supply = <®_vdd_3v3>; | 327 | vmmc-supply = <®_vdd_3v3>; |
| 326 | mmc-pwrseq = <&wl1835_pwrseq>; | 328 | mmc-pwrseq = <&wl1835_pwrseq>; |
| 327 | 329 | ||
diff --git a/arch/arm64/boot/dts/marvell/armada-cp110.dtsi b/arch/arm64/boot/dts/marvell/armada-cp110.dtsi index 7dabe25f6774..1c6ff8197a88 100644 --- a/arch/arm64/boot/dts/marvell/armada-cp110.dtsi +++ b/arch/arm64/boot/dts/marvell/armada-cp110.dtsi | |||
| @@ -149,7 +149,7 @@ | |||
| 149 | 149 | ||
| 150 | CP110_LABEL(icu): interrupt-controller@1e0000 { | 150 | CP110_LABEL(icu): interrupt-controller@1e0000 { |
| 151 | compatible = "marvell,cp110-icu"; | 151 | compatible = "marvell,cp110-icu"; |
| 152 | reg = <0x1e0000 0x10>; | 152 | reg = <0x1e0000 0x440>; |
| 153 | #interrupt-cells = <3>; | 153 | #interrupt-cells = <3>; |
| 154 | interrupt-controller; | 154 | interrupt-controller; |
| 155 | msi-parent = <&gicp>; | 155 | msi-parent = <&gicp>; |
diff --git a/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi b/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi index 0f829db33efe..4d5ef01f43a3 100644 --- a/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | |||
| @@ -75,7 +75,7 @@ | |||
| 75 | 75 | ||
| 76 | serial@75b1000 { | 76 | serial@75b1000 { |
| 77 | label = "LS-UART0"; | 77 | label = "LS-UART0"; |
| 78 | status = "okay"; | 78 | status = "disabled"; |
| 79 | pinctrl-names = "default", "sleep"; | 79 | pinctrl-names = "default", "sleep"; |
| 80 | pinctrl-0 = <&blsp2_uart2_4pins_default>; | 80 | pinctrl-0 = <&blsp2_uart2_4pins_default>; |
| 81 | pinctrl-1 = <&blsp2_uart2_4pins_sleep>; | 81 | pinctrl-1 = <&blsp2_uart2_4pins_sleep>; |
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi index 650f356f69ca..c2625d15a8c0 100644 --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi | |||
| @@ -1191,14 +1191,14 @@ | |||
| 1191 | 1191 | ||
| 1192 | port@0 { | 1192 | port@0 { |
| 1193 | reg = <0>; | 1193 | reg = <0>; |
| 1194 | etf_out: endpoint { | 1194 | etf_in: endpoint { |
| 1195 | slave-mode; | 1195 | slave-mode; |
| 1196 | remote-endpoint = <&funnel0_out>; | 1196 | remote-endpoint = <&funnel0_out>; |
| 1197 | }; | 1197 | }; |
| 1198 | }; | 1198 | }; |
| 1199 | port@1 { | 1199 | port@1 { |
| 1200 | reg = <0>; | 1200 | reg = <0>; |
| 1201 | etf_in: endpoint { | 1201 | etf_out: endpoint { |
| 1202 | remote-endpoint = <&replicator_in>; | 1202 | remote-endpoint = <&replicator_in>; |
| 1203 | }; | 1203 | }; |
| 1204 | }; | 1204 | }; |
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts b/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts index 9b4dc41703e3..ae3b5adf32df 100644 --- a/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts +++ b/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts | |||
| @@ -54,7 +54,7 @@ | |||
| 54 | sound { | 54 | sound { |
| 55 | compatible = "audio-graph-card"; | 55 | compatible = "audio-graph-card"; |
| 56 | label = "UniPhier LD11"; | 56 | label = "UniPhier LD11"; |
| 57 | widgets = "Headphone", "Headphone Jack"; | 57 | widgets = "Headphone", "Headphones"; |
| 58 | dais = <&i2s_port2 | 58 | dais = <&i2s_port2 |
| 59 | &i2s_port3 | 59 | &i2s_port3 |
| 60 | &i2s_port4 | 60 | &i2s_port4 |
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts b/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts index fe6608ea3277..7919233c9ce2 100644 --- a/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts +++ b/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts | |||
| @@ -54,7 +54,7 @@ | |||
| 54 | sound { | 54 | sound { |
| 55 | compatible = "audio-graph-card"; | 55 | compatible = "audio-graph-card"; |
| 56 | label = "UniPhier LD20"; | 56 | label = "UniPhier LD20"; |
| 57 | widgets = "Headphone", "Headphone Jack"; | 57 | widgets = "Headphone", "Headphones"; |
| 58 | dais = <&i2s_port2 | 58 | dais = <&i2s_port2 |
| 59 | &i2s_port3 | 59 | &i2s_port3 |
| 60 | &i2s_port4 | 60 | &i2s_port4 |
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 3cfa8ca26738..f9a186f6af8a 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig | |||
| @@ -47,6 +47,7 @@ CONFIG_ARCH_MVEBU=y | |||
| 47 | CONFIG_ARCH_QCOM=y | 47 | CONFIG_ARCH_QCOM=y |
| 48 | CONFIG_ARCH_ROCKCHIP=y | 48 | CONFIG_ARCH_ROCKCHIP=y |
| 49 | CONFIG_ARCH_SEATTLE=y | 49 | CONFIG_ARCH_SEATTLE=y |
| 50 | CONFIG_ARCH_SYNQUACER=y | ||
| 50 | CONFIG_ARCH_RENESAS=y | 51 | CONFIG_ARCH_RENESAS=y |
| 51 | CONFIG_ARCH_R8A7795=y | 52 | CONFIG_ARCH_R8A7795=y |
| 52 | CONFIG_ARCH_R8A7796=y | 53 | CONFIG_ARCH_R8A7796=y |
| @@ -58,7 +59,6 @@ CONFIG_ARCH_R8A77995=y | |||
| 58 | CONFIG_ARCH_STRATIX10=y | 59 | CONFIG_ARCH_STRATIX10=y |
| 59 | CONFIG_ARCH_TEGRA=y | 60 | CONFIG_ARCH_TEGRA=y |
| 60 | CONFIG_ARCH_SPRD=y | 61 | CONFIG_ARCH_SPRD=y |
| 61 | CONFIG_ARCH_SYNQUACER=y | ||
| 62 | CONFIG_ARCH_THUNDER=y | 62 | CONFIG_ARCH_THUNDER=y |
| 63 | CONFIG_ARCH_THUNDER2=y | 63 | CONFIG_ARCH_THUNDER2=y |
| 64 | CONFIG_ARCH_UNIPHIER=y | 64 | CONFIG_ARCH_UNIPHIER=y |
| @@ -67,25 +67,23 @@ CONFIG_ARCH_XGENE=y | |||
| 67 | CONFIG_ARCH_ZX=y | 67 | CONFIG_ARCH_ZX=y |
| 68 | CONFIG_ARCH_ZYNQMP=y | 68 | CONFIG_ARCH_ZYNQMP=y |
| 69 | CONFIG_PCI=y | 69 | CONFIG_PCI=y |
| 70 | CONFIG_HOTPLUG_PCI_PCIE=y | ||
| 71 | CONFIG_PCI_IOV=y | 70 | CONFIG_PCI_IOV=y |
| 72 | CONFIG_HOTPLUG_PCI=y | 71 | CONFIG_HOTPLUG_PCI=y |
| 73 | CONFIG_HOTPLUG_PCI_ACPI=y | 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 | CONFIG_PCI_AARDVARK=y | 73 | CONFIG_PCI_AARDVARK=y |
| 81 | CONFIG_PCI_TEGRA=y | 74 | CONFIG_PCI_TEGRA=y |
| 82 | CONFIG_PCIE_RCAR=y | 75 | CONFIG_PCIE_RCAR=y |
| 83 | CONFIG_PCIE_ROCKCHIP=y | ||
| 84 | CONFIG_PCIE_ROCKCHIP_HOST=m | ||
| 85 | CONFIG_PCI_HOST_GENERIC=y | 76 | CONFIG_PCI_HOST_GENERIC=y |
| 86 | CONFIG_PCI_XGENE=y | 77 | CONFIG_PCI_XGENE=y |
| 87 | CONFIG_PCI_HOST_THUNDER_PEM=y | 78 | CONFIG_PCI_HOST_THUNDER_PEM=y |
| 88 | CONFIG_PCI_HOST_THUNDER_ECAM=y | 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 | CONFIG_ARM64_VA_BITS_48=y | 87 | CONFIG_ARM64_VA_BITS_48=y |
| 90 | CONFIG_SCHED_MC=y | 88 | CONFIG_SCHED_MC=y |
| 91 | CONFIG_NUMA=y | 89 | CONFIG_NUMA=y |
| @@ -104,8 +102,6 @@ CONFIG_HIBERNATION=y | |||
| 104 | CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y | 102 | CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y |
| 105 | CONFIG_ARM_CPUIDLE=y | 103 | CONFIG_ARM_CPUIDLE=y |
| 106 | CONFIG_CPU_FREQ=y | 104 | CONFIG_CPU_FREQ=y |
| 107 | CONFIG_CPU_FREQ_GOV_ATTR_SET=y | ||
| 108 | CONFIG_CPU_FREQ_GOV_COMMON=y | ||
| 109 | CONFIG_CPU_FREQ_STAT=y | 105 | CONFIG_CPU_FREQ_STAT=y |
| 110 | CONFIG_CPU_FREQ_GOV_POWERSAVE=m | 106 | CONFIG_CPU_FREQ_GOV_POWERSAVE=m |
| 111 | CONFIG_CPU_FREQ_GOV_USERSPACE=y | 107 | CONFIG_CPU_FREQ_GOV_USERSPACE=y |
| @@ -113,11 +109,11 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=y | |||
| 113 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m | 109 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m |
| 114 | CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y | 110 | CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y |
| 115 | CONFIG_CPUFREQ_DT=y | 111 | CONFIG_CPUFREQ_DT=y |
| 112 | CONFIG_ACPI_CPPC_CPUFREQ=m | ||
| 116 | CONFIG_ARM_ARMADA_37XX_CPUFREQ=y | 113 | CONFIG_ARM_ARMADA_37XX_CPUFREQ=y |
| 117 | CONFIG_ARM_BIG_LITTLE_CPUFREQ=y | 114 | CONFIG_ARM_BIG_LITTLE_CPUFREQ=y |
| 118 | CONFIG_ARM_SCPI_CPUFREQ=y | 115 | CONFIG_ARM_SCPI_CPUFREQ=y |
| 119 | CONFIG_ARM_TEGRA186_CPUFREQ=y | 116 | CONFIG_ARM_TEGRA186_CPUFREQ=y |
| 120 | CONFIG_ACPI_CPPC_CPUFREQ=m | ||
| 121 | CONFIG_NET=y | 117 | CONFIG_NET=y |
| 122 | CONFIG_PACKET=y | 118 | CONFIG_PACKET=y |
| 123 | CONFIG_UNIX=y | 119 | CONFIG_UNIX=y |
| @@ -236,11 +232,6 @@ CONFIG_SMSC911X=y | |||
| 236 | CONFIG_SNI_AVE=y | 232 | CONFIG_SNI_AVE=y |
| 237 | CONFIG_SNI_NETSEC=y | 233 | CONFIG_SNI_NETSEC=y |
| 238 | CONFIG_STMMAC_ETH=m | 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 | CONFIG_MDIO_BUS_MUX_MMIOREG=y | 235 | CONFIG_MDIO_BUS_MUX_MMIOREG=y |
| 245 | CONFIG_AT803X_PHY=m | 236 | CONFIG_AT803X_PHY=m |
| 246 | CONFIG_MARVELL_PHY=m | 237 | CONFIG_MARVELL_PHY=m |
| @@ -269,8 +260,8 @@ CONFIG_WL18XX=m | |||
| 269 | CONFIG_WLCORE_SDIO=m | 260 | CONFIG_WLCORE_SDIO=m |
| 270 | CONFIG_INPUT_EVDEV=y | 261 | CONFIG_INPUT_EVDEV=y |
| 271 | CONFIG_KEYBOARD_ADC=m | 262 | CONFIG_KEYBOARD_ADC=m |
| 272 | CONFIG_KEYBOARD_CROS_EC=y | ||
| 273 | CONFIG_KEYBOARD_GPIO=y | 263 | CONFIG_KEYBOARD_GPIO=y |
| 264 | CONFIG_KEYBOARD_CROS_EC=y | ||
| 274 | CONFIG_INPUT_TOUCHSCREEN=y | 265 | CONFIG_INPUT_TOUCHSCREEN=y |
| 275 | CONFIG_TOUCHSCREEN_ATMEL_MXT=m | 266 | CONFIG_TOUCHSCREEN_ATMEL_MXT=m |
| 276 | CONFIG_INPUT_MISC=y | 267 | CONFIG_INPUT_MISC=y |
| @@ -296,17 +287,13 @@ CONFIG_SERIAL_SAMSUNG=y | |||
| 296 | CONFIG_SERIAL_SAMSUNG_CONSOLE=y | 287 | CONFIG_SERIAL_SAMSUNG_CONSOLE=y |
| 297 | CONFIG_SERIAL_TEGRA=y | 288 | CONFIG_SERIAL_TEGRA=y |
| 298 | CONFIG_SERIAL_SH_SCI=y | 289 | CONFIG_SERIAL_SH_SCI=y |
| 299 | CONFIG_SERIAL_SH_SCI_NR_UARTS=11 | ||
| 300 | CONFIG_SERIAL_SH_SCI_CONSOLE=y | ||
| 301 | CONFIG_SERIAL_MSM=y | 290 | CONFIG_SERIAL_MSM=y |
| 302 | CONFIG_SERIAL_MSM_CONSOLE=y | 291 | CONFIG_SERIAL_MSM_CONSOLE=y |
| 303 | CONFIG_SERIAL_XILINX_PS_UART=y | 292 | CONFIG_SERIAL_XILINX_PS_UART=y |
| 304 | CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y | 293 | CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y |
| 305 | CONFIG_SERIAL_MVEBU_UART=y | 294 | CONFIG_SERIAL_MVEBU_UART=y |
| 306 | CONFIG_SERIAL_DEV_BUS=y | 295 | CONFIG_SERIAL_DEV_BUS=y |
| 307 | CONFIG_SERIAL_DEV_CTRL_TTYPORT=y | ||
| 308 | CONFIG_VIRTIO_CONSOLE=y | 296 | CONFIG_VIRTIO_CONSOLE=y |
| 309 | CONFIG_I2C_HID=m | ||
| 310 | CONFIG_I2C_CHARDEV=y | 297 | CONFIG_I2C_CHARDEV=y |
| 311 | CONFIG_I2C_MUX=y | 298 | CONFIG_I2C_MUX=y |
| 312 | CONFIG_I2C_MUX_PCA954x=y | 299 | CONFIG_I2C_MUX_PCA954x=y |
| @@ -325,26 +312,26 @@ CONFIG_I2C_RCAR=y | |||
| 325 | CONFIG_I2C_CROS_EC_TUNNEL=y | 312 | CONFIG_I2C_CROS_EC_TUNNEL=y |
| 326 | CONFIG_SPI=y | 313 | CONFIG_SPI=y |
| 327 | CONFIG_SPI_ARMADA_3700=y | 314 | CONFIG_SPI_ARMADA_3700=y |
| 328 | CONFIG_SPI_MESON_SPICC=m | ||
| 329 | CONFIG_SPI_MESON_SPIFC=m | ||
| 330 | CONFIG_SPI_BCM2835=m | 315 | CONFIG_SPI_BCM2835=m |
| 331 | CONFIG_SPI_BCM2835AUX=m | 316 | CONFIG_SPI_BCM2835AUX=m |
| 317 | CONFIG_SPI_MESON_SPICC=m | ||
| 318 | CONFIG_SPI_MESON_SPIFC=m | ||
| 332 | CONFIG_SPI_ORION=y | 319 | CONFIG_SPI_ORION=y |
| 333 | CONFIG_SPI_PL022=y | 320 | CONFIG_SPI_PL022=y |
| 334 | CONFIG_SPI_QUP=y | ||
| 335 | CONFIG_SPI_ROCKCHIP=y | 321 | CONFIG_SPI_ROCKCHIP=y |
| 322 | CONFIG_SPI_QUP=y | ||
| 336 | CONFIG_SPI_S3C64XX=y | 323 | CONFIG_SPI_S3C64XX=y |
| 337 | CONFIG_SPI_SPIDEV=m | 324 | CONFIG_SPI_SPIDEV=m |
| 338 | CONFIG_SPMI=y | 325 | CONFIG_SPMI=y |
| 339 | CONFIG_PINCTRL_IPQ8074=y | ||
| 340 | CONFIG_PINCTRL_SINGLE=y | 326 | CONFIG_PINCTRL_SINGLE=y |
| 341 | CONFIG_PINCTRL_MAX77620=y | 327 | CONFIG_PINCTRL_MAX77620=y |
| 328 | CONFIG_PINCTRL_IPQ8074=y | ||
| 342 | CONFIG_PINCTRL_MSM8916=y | 329 | CONFIG_PINCTRL_MSM8916=y |
| 343 | CONFIG_PINCTRL_MSM8994=y | 330 | CONFIG_PINCTRL_MSM8994=y |
| 344 | CONFIG_PINCTRL_MSM8996=y | 331 | CONFIG_PINCTRL_MSM8996=y |
| 345 | CONFIG_PINCTRL_MT7622=y | ||
| 346 | CONFIG_PINCTRL_QDF2XXX=y | 332 | CONFIG_PINCTRL_QDF2XXX=y |
| 347 | CONFIG_PINCTRL_QCOM_SPMI_PMIC=y | 333 | CONFIG_PINCTRL_QCOM_SPMI_PMIC=y |
| 334 | CONFIG_PINCTRL_MT7622=y | ||
| 348 | CONFIG_GPIO_DWAPB=y | 335 | CONFIG_GPIO_DWAPB=y |
| 349 | CONFIG_GPIO_MB86S7X=y | 336 | CONFIG_GPIO_MB86S7X=y |
| 350 | CONFIG_GPIO_PL061=y | 337 | CONFIG_GPIO_PL061=y |
| @@ -368,13 +355,13 @@ CONFIG_SENSORS_INA2XX=m | |||
| 368 | CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y | 355 | CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y |
| 369 | CONFIG_CPU_THERMAL=y | 356 | CONFIG_CPU_THERMAL=y |
| 370 | CONFIG_THERMAL_EMULATION=y | 357 | CONFIG_THERMAL_EMULATION=y |
| 358 | CONFIG_ROCKCHIP_THERMAL=m | ||
| 359 | CONFIG_RCAR_GEN3_THERMAL=y | ||
| 371 | CONFIG_ARMADA_THERMAL=y | 360 | CONFIG_ARMADA_THERMAL=y |
| 372 | CONFIG_BRCMSTB_THERMAL=m | 361 | CONFIG_BRCMSTB_THERMAL=m |
| 373 | CONFIG_EXYNOS_THERMAL=y | 362 | CONFIG_EXYNOS_THERMAL=y |
| 374 | CONFIG_RCAR_GEN3_THERMAL=y | ||
| 375 | CONFIG_QCOM_TSENS=y | ||
| 376 | CONFIG_ROCKCHIP_THERMAL=m | ||
| 377 | CONFIG_TEGRA_BPMP_THERMAL=m | 363 | CONFIG_TEGRA_BPMP_THERMAL=m |
| 364 | CONFIG_QCOM_TSENS=y | ||
| 378 | CONFIG_UNIPHIER_THERMAL=y | 365 | CONFIG_UNIPHIER_THERMAL=y |
| 379 | CONFIG_WATCHDOG=y | 366 | CONFIG_WATCHDOG=y |
| 380 | CONFIG_S3C2410_WATCHDOG=y | 367 | CONFIG_S3C2410_WATCHDOG=y |
| @@ -395,9 +382,9 @@ CONFIG_MFD_MAX77620=y | |||
| 395 | CONFIG_MFD_SPMI_PMIC=y | 382 | CONFIG_MFD_SPMI_PMIC=y |
| 396 | CONFIG_MFD_RK808=y | 383 | CONFIG_MFD_RK808=y |
| 397 | CONFIG_MFD_SEC_CORE=y | 384 | CONFIG_MFD_SEC_CORE=y |
| 385 | CONFIG_REGULATOR_FIXED_VOLTAGE=y | ||
| 398 | CONFIG_REGULATOR_AXP20X=y | 386 | CONFIG_REGULATOR_AXP20X=y |
| 399 | CONFIG_REGULATOR_FAN53555=y | 387 | CONFIG_REGULATOR_FAN53555=y |
| 400 | CONFIG_REGULATOR_FIXED_VOLTAGE=y | ||
| 401 | CONFIG_REGULATOR_GPIO=y | 388 | CONFIG_REGULATOR_GPIO=y |
| 402 | CONFIG_REGULATOR_HI6421V530=y | 389 | CONFIG_REGULATOR_HI6421V530=y |
| 403 | CONFIG_REGULATOR_HI655X=y | 390 | CONFIG_REGULATOR_HI655X=y |
| @@ -407,16 +394,15 @@ CONFIG_REGULATOR_QCOM_SMD_RPM=y | |||
| 407 | CONFIG_REGULATOR_QCOM_SPMI=y | 394 | CONFIG_REGULATOR_QCOM_SPMI=y |
| 408 | CONFIG_REGULATOR_RK808=y | 395 | CONFIG_REGULATOR_RK808=y |
| 409 | CONFIG_REGULATOR_S2MPS11=y | 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 | CONFIG_MEDIA_SUPPORT=m | 401 | CONFIG_MEDIA_SUPPORT=m |
| 411 | CONFIG_MEDIA_CAMERA_SUPPORT=y | 402 | CONFIG_MEDIA_CAMERA_SUPPORT=y |
| 412 | CONFIG_MEDIA_ANALOG_TV_SUPPORT=y | 403 | CONFIG_MEDIA_ANALOG_TV_SUPPORT=y |
| 413 | CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y | 404 | CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y |
| 414 | CONFIG_MEDIA_CONTROLLER=y | 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 | CONFIG_VIDEO_V4L2_SUBDEV_API=y | 406 | CONFIG_VIDEO_V4L2_SUBDEV_API=y |
| 421 | # CONFIG_DVB_NET is not set | 407 | # CONFIG_DVB_NET is not set |
| 422 | CONFIG_V4L_MEM2MEM_DRIVERS=y | 408 | CONFIG_V4L_MEM2MEM_DRIVERS=y |
| @@ -441,8 +427,7 @@ CONFIG_ROCKCHIP_DW_HDMI=y | |||
| 441 | CONFIG_ROCKCHIP_DW_MIPI_DSI=y | 427 | CONFIG_ROCKCHIP_DW_MIPI_DSI=y |
| 442 | CONFIG_ROCKCHIP_INNO_HDMI=y | 428 | CONFIG_ROCKCHIP_INNO_HDMI=y |
| 443 | CONFIG_DRM_RCAR_DU=m | 429 | CONFIG_DRM_RCAR_DU=m |
| 444 | CONFIG_DRM_RCAR_LVDS=y | 430 | CONFIG_DRM_RCAR_LVDS=m |
| 445 | CONFIG_DRM_RCAR_VSP=y | ||
| 446 | CONFIG_DRM_TEGRA=m | 431 | CONFIG_DRM_TEGRA=m |
| 447 | CONFIG_DRM_PANEL_SIMPLE=m | 432 | CONFIG_DRM_PANEL_SIMPLE=m |
| 448 | CONFIG_DRM_I2C_ADV7511=m | 433 | CONFIG_DRM_I2C_ADV7511=m |
| @@ -455,7 +440,6 @@ CONFIG_FB_ARMCLCD=y | |||
| 455 | CONFIG_BACKLIGHT_GENERIC=m | 440 | CONFIG_BACKLIGHT_GENERIC=m |
| 456 | CONFIG_BACKLIGHT_PWM=m | 441 | CONFIG_BACKLIGHT_PWM=m |
| 457 | CONFIG_BACKLIGHT_LP855X=m | 442 | CONFIG_BACKLIGHT_LP855X=m |
| 458 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
| 459 | CONFIG_LOGO=y | 443 | CONFIG_LOGO=y |
| 460 | # CONFIG_LOGO_LINUX_MONO is not set | 444 | # CONFIG_LOGO_LINUX_MONO is not set |
| 461 | # CONFIG_LOGO_LINUX_VGA16 is not set | 445 | # CONFIG_LOGO_LINUX_VGA16 is not set |
| @@ -468,6 +452,7 @@ CONFIG_SND_SOC_RCAR=m | |||
| 468 | CONFIG_SND_SOC_AK4613=m | 452 | CONFIG_SND_SOC_AK4613=m |
| 469 | CONFIG_SND_SIMPLE_CARD=m | 453 | CONFIG_SND_SIMPLE_CARD=m |
| 470 | CONFIG_SND_AUDIO_GRAPH_CARD=m | 454 | CONFIG_SND_AUDIO_GRAPH_CARD=m |
| 455 | CONFIG_I2C_HID=m | ||
| 471 | CONFIG_USB=y | 456 | CONFIG_USB=y |
| 472 | CONFIG_USB_OTG=y | 457 | CONFIG_USB_OTG=y |
| 473 | CONFIG_USB_XHCI_HCD=y | 458 | CONFIG_USB_XHCI_HCD=y |
| @@ -501,12 +486,12 @@ CONFIG_MMC_BLOCK_MINORS=32 | |||
| 501 | CONFIG_MMC_ARMMMCI=y | 486 | CONFIG_MMC_ARMMMCI=y |
| 502 | CONFIG_MMC_SDHCI=y | 487 | CONFIG_MMC_SDHCI=y |
| 503 | CONFIG_MMC_SDHCI_ACPI=y | 488 | CONFIG_MMC_SDHCI_ACPI=y |
| 504 | CONFIG_MMC_SDHCI_F_SDH30=y | ||
| 505 | CONFIG_MMC_SDHCI_PLTFM=y | 489 | CONFIG_MMC_SDHCI_PLTFM=y |
| 506 | CONFIG_MMC_SDHCI_OF_ARASAN=y | 490 | CONFIG_MMC_SDHCI_OF_ARASAN=y |
| 507 | CONFIG_MMC_SDHCI_OF_ESDHC=y | 491 | CONFIG_MMC_SDHCI_OF_ESDHC=y |
| 508 | CONFIG_MMC_SDHCI_CADENCE=y | 492 | CONFIG_MMC_SDHCI_CADENCE=y |
| 509 | CONFIG_MMC_SDHCI_TEGRA=y | 493 | CONFIG_MMC_SDHCI_TEGRA=y |
| 494 | CONFIG_MMC_SDHCI_F_SDH30=y | ||
| 510 | CONFIG_MMC_MESON_GX=y | 495 | CONFIG_MMC_MESON_GX=y |
| 511 | CONFIG_MMC_SDHCI_MSM=y | 496 | CONFIG_MMC_SDHCI_MSM=y |
| 512 | CONFIG_MMC_SPI=y | 497 | CONFIG_MMC_SPI=y |
| @@ -524,11 +509,11 @@ CONFIG_LEDS_CLASS=y | |||
| 524 | CONFIG_LEDS_GPIO=y | 509 | CONFIG_LEDS_GPIO=y |
| 525 | CONFIG_LEDS_PWM=y | 510 | CONFIG_LEDS_PWM=y |
| 526 | CONFIG_LEDS_SYSCON=y | 511 | CONFIG_LEDS_SYSCON=y |
| 512 | CONFIG_LEDS_TRIGGER_DISK=y | ||
| 527 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 513 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
| 528 | CONFIG_LEDS_TRIGGER_CPU=y | 514 | CONFIG_LEDS_TRIGGER_CPU=y |
| 529 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | 515 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y |
| 530 | CONFIG_LEDS_TRIGGER_PANIC=y | 516 | CONFIG_LEDS_TRIGGER_PANIC=y |
| 531 | CONFIG_LEDS_TRIGGER_DISK=y | ||
| 532 | CONFIG_EDAC=y | 517 | CONFIG_EDAC=y |
| 533 | CONFIG_EDAC_GHES=y | 518 | CONFIG_EDAC_GHES=y |
| 534 | CONFIG_RTC_CLASS=y | 519 | CONFIG_RTC_CLASS=y |
| @@ -537,13 +522,13 @@ CONFIG_RTC_DRV_RK808=m | |||
| 537 | CONFIG_RTC_DRV_S5M=y | 522 | CONFIG_RTC_DRV_S5M=y |
| 538 | CONFIG_RTC_DRV_DS3232=y | 523 | CONFIG_RTC_DRV_DS3232=y |
| 539 | CONFIG_RTC_DRV_EFI=y | 524 | CONFIG_RTC_DRV_EFI=y |
| 525 | CONFIG_RTC_DRV_CROS_EC=y | ||
| 540 | CONFIG_RTC_DRV_S3C=y | 526 | CONFIG_RTC_DRV_S3C=y |
| 541 | CONFIG_RTC_DRV_PL031=y | 527 | CONFIG_RTC_DRV_PL031=y |
| 542 | CONFIG_RTC_DRV_SUN6I=y | 528 | CONFIG_RTC_DRV_SUN6I=y |
| 543 | CONFIG_RTC_DRV_ARMADA38X=y | 529 | CONFIG_RTC_DRV_ARMADA38X=y |
| 544 | CONFIG_RTC_DRV_TEGRA=y | 530 | CONFIG_RTC_DRV_TEGRA=y |
| 545 | CONFIG_RTC_DRV_XGENE=y | 531 | CONFIG_RTC_DRV_XGENE=y |
| 546 | CONFIG_RTC_DRV_CROS_EC=y | ||
| 547 | CONFIG_DMADEVICES=y | 532 | CONFIG_DMADEVICES=y |
| 548 | CONFIG_DMA_BCM2835=m | 533 | CONFIG_DMA_BCM2835=m |
| 549 | CONFIG_K3_DMA=y | 534 | CONFIG_K3_DMA=y |
| @@ -579,7 +564,6 @@ CONFIG_HWSPINLOCK_QCOM=y | |||
| 579 | CONFIG_ARM_MHU=y | 564 | CONFIG_ARM_MHU=y |
| 580 | CONFIG_PLATFORM_MHU=y | 565 | CONFIG_PLATFORM_MHU=y |
| 581 | CONFIG_BCM2835_MBOX=y | 566 | CONFIG_BCM2835_MBOX=y |
| 582 | CONFIG_HI6220_MBOX=y | ||
| 583 | CONFIG_QCOM_APCS_IPC=y | 567 | CONFIG_QCOM_APCS_IPC=y |
| 584 | CONFIG_ROCKCHIP_IOMMU=y | 568 | CONFIG_ROCKCHIP_IOMMU=y |
| 585 | CONFIG_TEGRA_IOMMU_SMMU=y | 569 | CONFIG_TEGRA_IOMMU_SMMU=y |
| @@ -602,7 +586,6 @@ CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y | |||
| 602 | CONFIG_EXTCON_USB_GPIO=y | 586 | CONFIG_EXTCON_USB_GPIO=y |
| 603 | CONFIG_EXTCON_USBC_CROS_EC=y | 587 | CONFIG_EXTCON_USBC_CROS_EC=y |
| 604 | CONFIG_MEMORY=y | 588 | CONFIG_MEMORY=y |
| 605 | CONFIG_TEGRA_MC=y | ||
| 606 | CONFIG_IIO=y | 589 | CONFIG_IIO=y |
| 607 | CONFIG_EXYNOS_ADC=y | 590 | CONFIG_EXYNOS_ADC=y |
| 608 | CONFIG_ROCKCHIP_SARADC=m | 591 | CONFIG_ROCKCHIP_SARADC=m |
| @@ -618,27 +601,27 @@ CONFIG_PWM_RCAR=m | |||
| 618 | CONFIG_PWM_ROCKCHIP=y | 601 | CONFIG_PWM_ROCKCHIP=y |
| 619 | CONFIG_PWM_SAMSUNG=y | 602 | CONFIG_PWM_SAMSUNG=y |
| 620 | CONFIG_PWM_TEGRA=m | 603 | CONFIG_PWM_TEGRA=m |
| 604 | CONFIG_PHY_XGENE=y | ||
| 605 | CONFIG_PHY_SUN4I_USB=y | ||
| 606 | CONFIG_PHY_HI6220_USB=y | ||
| 621 | CONFIG_PHY_HISTB_COMBPHY=y | 607 | CONFIG_PHY_HISTB_COMBPHY=y |
| 622 | CONFIG_PHY_HISI_INNO_USB2=y | 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 | CONFIG_PHY_MVEBU_CP110_COMPHY=y | 609 | CONFIG_PHY_MVEBU_CP110_COMPHY=y |
| 629 | CONFIG_PHY_QCOM_QMP=m | 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 | CONFIG_PHY_ROCKCHIP_EMMC=y | 614 | CONFIG_PHY_ROCKCHIP_EMMC=y |
| 615 | CONFIG_PHY_ROCKCHIP_INNO_USB2=y | ||
| 632 | CONFIG_PHY_ROCKCHIP_PCIE=m | 616 | CONFIG_PHY_ROCKCHIP_PCIE=m |
| 633 | CONFIG_PHY_ROCKCHIP_TYPEC=y | 617 | CONFIG_PHY_ROCKCHIP_TYPEC=y |
| 634 | CONFIG_PHY_XGENE=y | ||
| 635 | CONFIG_PHY_TEGRA_XUSB=y | 618 | CONFIG_PHY_TEGRA_XUSB=y |
| 636 | CONFIG_QCOM_L2_PMU=y | 619 | CONFIG_QCOM_L2_PMU=y |
| 637 | CONFIG_QCOM_L3_PMU=y | 620 | CONFIG_QCOM_L3_PMU=y |
| 638 | CONFIG_MESON_EFUSE=m | ||
| 639 | CONFIG_QCOM_QFPROM=y | 621 | CONFIG_QCOM_QFPROM=y |
| 640 | CONFIG_ROCKCHIP_EFUSE=y | 622 | CONFIG_ROCKCHIP_EFUSE=y |
| 641 | CONFIG_UNIPHIER_EFUSE=y | 623 | CONFIG_UNIPHIER_EFUSE=y |
| 624 | CONFIG_MESON_EFUSE=m | ||
| 642 | CONFIG_TEE=y | 625 | CONFIG_TEE=y |
| 643 | CONFIG_OPTEE=y | 626 | CONFIG_OPTEE=y |
| 644 | CONFIG_ARM_SCPI_PROTOCOL=y | 627 | CONFIG_ARM_SCPI_PROTOCOL=y |
| @@ -647,7 +630,6 @@ CONFIG_EFI_CAPSULE_LOADER=y | |||
| 647 | CONFIG_ACPI=y | 630 | CONFIG_ACPI=y |
| 648 | CONFIG_ACPI_APEI=y | 631 | CONFIG_ACPI_APEI=y |
| 649 | CONFIG_ACPI_APEI_GHES=y | 632 | CONFIG_ACPI_APEI_GHES=y |
| 650 | CONFIG_ACPI_APEI_PCIEAER=y | ||
| 651 | CONFIG_ACPI_APEI_MEMORY_FAILURE=y | 633 | CONFIG_ACPI_APEI_MEMORY_FAILURE=y |
| 652 | CONFIG_ACPI_APEI_EINJ=y | 634 | CONFIG_ACPI_APEI_EINJ=y |
| 653 | CONFIG_EXT2_FS=y | 635 | CONFIG_EXT2_FS=y |
| @@ -682,7 +664,6 @@ CONFIG_DEBUG_INFO=y | |||
| 682 | CONFIG_DEBUG_FS=y | 664 | CONFIG_DEBUG_FS=y |
| 683 | CONFIG_MAGIC_SYSRQ=y | 665 | CONFIG_MAGIC_SYSRQ=y |
| 684 | CONFIG_DEBUG_KERNEL=y | 666 | CONFIG_DEBUG_KERNEL=y |
| 685 | CONFIG_LOCKUP_DETECTOR=y | ||
| 686 | # CONFIG_SCHED_DEBUG is not set | 667 | # CONFIG_SCHED_DEBUG is not set |
| 687 | # CONFIG_DEBUG_PREEMPT is not set | 668 | # CONFIG_DEBUG_PREEMPT is not set |
| 688 | # CONFIG_FTRACE is not set | 669 | # CONFIG_FTRACE is not set |
| @@ -691,20 +672,15 @@ CONFIG_SECURITY=y | |||
| 691 | CONFIG_CRYPTO_ECHAINIV=y | 672 | CONFIG_CRYPTO_ECHAINIV=y |
| 692 | CONFIG_CRYPTO_ANSI_CPRNG=y | 673 | CONFIG_CRYPTO_ANSI_CPRNG=y |
| 693 | CONFIG_ARM64_CRYPTO=y | 674 | CONFIG_ARM64_CRYPTO=y |
| 694 | CONFIG_CRYPTO_SHA256_ARM64=m | ||
| 695 | CONFIG_CRYPTO_SHA512_ARM64=m | ||
| 696 | CONFIG_CRYPTO_SHA1_ARM64_CE=y | 675 | CONFIG_CRYPTO_SHA1_ARM64_CE=y |
| 697 | CONFIG_CRYPTO_SHA2_ARM64_CE=y | 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 | CONFIG_CRYPTO_GHASH_ARM64_CE=y | 680 | CONFIG_CRYPTO_GHASH_ARM64_CE=y |
| 699 | CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=m | 681 | CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=m |
| 700 | CONFIG_CRYPTO_CRC32_ARM64_CE=m | 682 | CONFIG_CRYPTO_CRC32_ARM64_CE=m |
| 701 | CONFIG_CRYPTO_AES_ARM64=m | ||
| 702 | CONFIG_CRYPTO_AES_ARM64_CE=m | ||
| 703 | CONFIG_CRYPTO_AES_ARM64_CE_CCM=y | 683 | CONFIG_CRYPTO_AES_ARM64_CE_CCM=y |
| 704 | CONFIG_CRYPTO_AES_ARM64_CE_BLK=y | 684 | CONFIG_CRYPTO_AES_ARM64_CE_BLK=y |
| 705 | CONFIG_CRYPTO_AES_ARM64_NEON_BLK=m | ||
| 706 | CONFIG_CRYPTO_CHACHA20_NEON=m | 685 | CONFIG_CRYPTO_CHACHA20_NEON=m |
| 707 | CONFIG_CRYPTO_AES_ARM64_BS=m | 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 | ||
diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h index a91933b1e2e6..4b650ec1d7dd 100644 --- a/arch/arm64/include/asm/alternative.h +++ b/arch/arm64/include/asm/alternative.h | |||
| @@ -28,7 +28,12 @@ typedef void (*alternative_cb_t)(struct alt_instr *alt, | |||
| 28 | __le32 *origptr, __le32 *updptr, int nr_inst); | 28 | __le32 *origptr, __le32 *updptr, int nr_inst); |
| 29 | 29 | ||
| 30 | void __init apply_alternatives_all(void); | 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 | #define ALTINSTR_ENTRY(feature,cb) \ | 38 | #define ALTINSTR_ENTRY(feature,cb) \ |
| 34 | " .word 661b - .\n" /* label */ \ | 39 | " .word 661b - .\n" /* label */ \ |
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 9f82d6b53851..1bdeca8918a6 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
| @@ -224,10 +224,8 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
| 224 | * Only if the new pte is valid and kernel, otherwise TLB maintenance | 224 | * Only if the new pte is valid and kernel, otherwise TLB maintenance |
| 225 | * or update_mmu_cache() have the necessary barriers. | 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 | dsb(ishst); | 228 | dsb(ishst); |
| 229 | isb(); | ||
| 230 | } | ||
| 231 | } | 229 | } |
| 232 | 230 | ||
| 233 | extern void __sync_icache_dcache(pte_t pteval); | 231 | extern void __sync_icache_dcache(pte_t pteval); |
| @@ -434,7 +432,6 @@ static inline void set_pmd(pmd_t *pmdp, pmd_t pmd) | |||
| 434 | { | 432 | { |
| 435 | WRITE_ONCE(*pmdp, pmd); | 433 | WRITE_ONCE(*pmdp, pmd); |
| 436 | dsb(ishst); | 434 | dsb(ishst); |
| 437 | isb(); | ||
| 438 | } | 435 | } |
| 439 | 436 | ||
| 440 | static inline void pmd_clear(pmd_t *pmdp) | 437 | static inline void pmd_clear(pmd_t *pmdp) |
| @@ -485,7 +482,6 @@ static inline void set_pud(pud_t *pudp, pud_t pud) | |||
| 485 | { | 482 | { |
| 486 | WRITE_ONCE(*pudp, pud); | 483 | WRITE_ONCE(*pudp, pud); |
| 487 | dsb(ishst); | 484 | dsb(ishst); |
| 488 | isb(); | ||
| 489 | } | 485 | } |
| 490 | 486 | ||
| 491 | static inline void pud_clear(pud_t *pudp) | 487 | static inline void pud_clear(pud_t *pudp) |
diff --git a/arch/arm64/include/asm/simd.h b/arch/arm64/include/asm/simd.h index fa8b3fe932e6..6495cc51246f 100644 --- a/arch/arm64/include/asm/simd.h +++ b/arch/arm64/include/asm/simd.h | |||
| @@ -29,20 +29,15 @@ DECLARE_PER_CPU(bool, kernel_neon_busy); | |||
| 29 | static __must_check inline bool may_use_simd(void) | 29 | static __must_check inline bool may_use_simd(void) |
| 30 | { | 30 | { |
| 31 | /* | 31 | /* |
| 32 | * The raw_cpu_read() is racy if called with preemption enabled. | 32 | * kernel_neon_busy is only set while preemption is disabled, |
| 33 | * This is not a bug: kernel_neon_busy is only set when | 33 | * and is clear whenever preemption is enabled. Since |
| 34 | * preemption is disabled, so we cannot migrate to another CPU | 34 | * this_cpu_read() is atomic w.r.t. preemption, kernel_neon_busy |
| 35 | * while it is set, nor can we migrate to a CPU where it is set. | 35 | * cannot change under our feet -- if it's set we cannot be |
| 36 | * So, if we find it clear on some CPU then we're guaranteed to | 36 | * migrated, and if it's clear we cannot be migrated to a CPU |
| 37 | * find it clear on any CPU we could migrate to. | 37 | * where it is set. |
| 38 | * | ||
| 39 | * If we are in between kernel_neon_begin()...kernel_neon_end(), | ||
| 40 | * the flag will be set, but preemption is also disabled, so we | ||
| 41 | * can't migrate to another CPU and spuriously see it become | ||
| 42 | * false. | ||
| 43 | */ | 38 | */ |
| 44 | return !in_irq() && !irqs_disabled() && !in_nmi() && | 39 | return !in_irq() && !irqs_disabled() && !in_nmi() && |
| 45 | !raw_cpu_read(kernel_neon_busy); | 40 | !this_cpu_read(kernel_neon_busy); |
| 46 | } | 41 | } |
| 47 | 42 | ||
| 48 | #else /* ! CONFIG_KERNEL_MODE_NEON */ | 43 | #else /* ! CONFIG_KERNEL_MODE_NEON */ |
diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c index 5c4bce4ac381..36fb069fd049 100644 --- a/arch/arm64/kernel/alternative.c +++ b/arch/arm64/kernel/alternative.c | |||
| @@ -122,7 +122,30 @@ static void patch_alternative(struct alt_instr *alt, | |||
| 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 | struct alt_instr *alt; | 150 | struct alt_instr *alt; |
| 128 | struct alt_region *region = alt_region; | 151 | struct alt_region *region = alt_region; |
| @@ -145,7 +168,7 @@ static void __apply_alternatives(void *alt_region, bool use_linear_alias) | |||
| 145 | pr_info_once("patching kernel code\n"); | 168 | pr_info_once("patching kernel code\n"); |
| 146 | 169 | ||
| 147 | origptr = ALT_ORIG_PTR(alt); | 170 | origptr = ALT_ORIG_PTR(alt); |
| 148 | updptr = use_linear_alias ? lm_alias(origptr) : origptr; | 171 | updptr = is_module ? origptr : lm_alias(origptr); |
| 149 | nr_inst = alt->orig_len / AARCH64_INSN_SIZE; | 172 | nr_inst = alt->orig_len / AARCH64_INSN_SIZE; |
| 150 | 173 | ||
| 151 | if (alt->cpufeature < ARM64_CB_PATCH) | 174 | if (alt->cpufeature < ARM64_CB_PATCH) |
| @@ -155,8 +178,20 @@ static void __apply_alternatives(void *alt_region, bool use_linear_alias) | |||
| 155 | 178 | ||
| 156 | alt_cb(alt, origptr, updptr, nr_inst); | 179 | alt_cb(alt, origptr, updptr, nr_inst); |
| 157 | 180 | ||
| 158 | flush_icache_range((uintptr_t)origptr, | 181 | if (!is_module) { |
| 159 | (uintptr_t)(origptr + nr_inst)); | 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) | |||
| 178 | isb(); | 213 | isb(); |
| 179 | } else { | 214 | } else { |
| 180 | BUG_ON(alternatives_applied); | 215 | BUG_ON(alternatives_applied); |
| 181 | __apply_alternatives(®ion, true); | 216 | __apply_alternatives(®ion, false); |
| 182 | /* Barriers provided by the cache flushing */ | 217 | /* Barriers provided by the cache flushing */ |
| 183 | WRITE_ONCE(alternatives_applied, 1); | 218 | WRITE_ONCE(alternatives_applied, 1); |
| 184 | } | 219 | } |
| @@ -192,12 +227,14 @@ void __init apply_alternatives_all(void) | |||
| 192 | stop_machine(__apply_alternatives_multi_stop, NULL, cpu_online_mask); | 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 | struct alt_region region = { | 233 | struct alt_region region = { |
| 198 | .begin = start, | 234 | .begin = start, |
| 199 | .end = start + length, | 235 | .end = start + length, |
| 200 | }; | 236 | }; |
| 201 | 237 | ||
| 202 | __apply_alternatives(®ion, false); | 238 | __apply_alternatives(®ion, true); |
| 203 | } | 239 | } |
| 240 | #endif | ||
diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c index 155fd91e78f4..f0f27aeefb73 100644 --- a/arch/arm64/kernel/module.c +++ b/arch/arm64/kernel/module.c | |||
| @@ -448,9 +448,8 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 448 | const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; | 448 | const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; |
| 449 | 449 | ||
| 450 | for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) { | 450 | for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) { |
| 451 | if (strcmp(".altinstructions", secstrs + s->sh_name) == 0) { | 451 | if (strcmp(".altinstructions", secstrs + s->sh_name) == 0) |
| 452 | apply_alternatives((void *)s->sh_addr, s->sh_size); | 452 | apply_alternatives_module((void *)s->sh_addr, s->sh_size); |
| 453 | } | ||
| 454 | #ifdef CONFIG_ARM64_MODULE_PLTS | 453 | #ifdef CONFIG_ARM64_MODULE_PLTS |
| 455 | if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE) && | 454 | if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE) && |
| 456 | !strcmp(".text.ftrace_trampoline", secstrs + s->sh_name)) | 455 | !strcmp(".text.ftrace_trampoline", secstrs + s->sh_name)) |
diff --git a/arch/m68k/include/asm/mcf_pgalloc.h b/arch/m68k/include/asm/mcf_pgalloc.h index 8b707c249026..12fe700632f4 100644 --- a/arch/m68k/include/asm/mcf_pgalloc.h +++ b/arch/m68k/include/asm/mcf_pgalloc.h | |||
| @@ -44,6 +44,7 @@ extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address) | |||
| 44 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page, | 44 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page, |
| 45 | unsigned long address) | 45 | unsigned long address) |
| 46 | { | 46 | { |
| 47 | pgtable_page_dtor(page); | ||
| 47 | __free_page(page); | 48 | __free_page(page); |
| 48 | } | 49 | } |
| 49 | 50 | ||
| @@ -74,8 +75,9 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
| 74 | return page; | 75 | return page; |
| 75 | } | 76 | } |
| 76 | 77 | ||
| 77 | extern inline void pte_free(struct mm_struct *mm, struct page *page) | 78 | static inline void pte_free(struct mm_struct *mm, struct page *page) |
| 78 | { | 79 | { |
| 80 | pgtable_page_dtor(page); | ||
| 79 | __free_page(page); | 81 | __free_page(page); |
| 80 | } | 82 | } |
| 81 | 83 | ||
diff --git a/arch/microblaze/Kconfig.debug b/arch/microblaze/Kconfig.debug index 331a3bb66297..93a737c8d1a6 100644 --- a/arch/microblaze/Kconfig.debug +++ b/arch/microblaze/Kconfig.debug | |||
| @@ -8,11 +8,4 @@ config TRACE_IRQFLAGS_SUPPORT | |||
| 8 | 8 | ||
| 9 | source "lib/Kconfig.debug" | 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 | endmenu | 11 | endmenu |
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h index d5384f6f36f7..ce9b7b786156 100644 --- a/arch/microblaze/include/asm/setup.h +++ b/arch/microblaze/include/asm/setup.h | |||
| @@ -19,15 +19,10 @@ extern char cmd_line[COMMAND_LINE_SIZE]; | |||
| 19 | 19 | ||
| 20 | extern char *klimit; | 20 | extern char *klimit; |
| 21 | 21 | ||
| 22 | void microblaze_heartbeat(void); | ||
| 23 | void microblaze_setup_heartbeat(void); | ||
| 24 | |||
| 25 | # ifdef CONFIG_MMU | 22 | # ifdef CONFIG_MMU |
| 26 | extern void mmu_reset(void); | 23 | extern void mmu_reset(void); |
| 27 | # endif /* CONFIG_MMU */ | 24 | # endif /* CONFIG_MMU */ |
| 28 | 25 | ||
| 29 | extern void of_platform_reset_gpio_probe(void); | ||
| 30 | |||
| 31 | void time_init(void); | 26 | void time_init(void); |
| 32 | void init_IRQ(void); | 27 | void init_IRQ(void); |
| 33 | void machine_early_init(const char *cmdline, unsigned int ram, | 28 | void machine_early_init(const char *cmdline, unsigned int ram, |
diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h index 9774e1d9507b..a62d09420a47 100644 --- a/arch/microblaze/include/asm/unistd.h +++ b/arch/microblaze/include/asm/unistd.h | |||
| @@ -38,6 +38,6 @@ | |||
| 38 | 38 | ||
| 39 | #endif /* __ASSEMBLY__ */ | 39 | #endif /* __ASSEMBLY__ */ |
| 40 | 40 | ||
| 41 | #define __NR_syscalls 399 | 41 | #define __NR_syscalls 401 |
| 42 | 42 | ||
| 43 | #endif /* _ASM_MICROBLAZE_UNISTD_H */ | 43 | #endif /* _ASM_MICROBLAZE_UNISTD_H */ |
diff --git a/arch/microblaze/include/uapi/asm/unistd.h b/arch/microblaze/include/uapi/asm/unistd.h index eb156f914793..7a9f16a76413 100644 --- a/arch/microblaze/include/uapi/asm/unistd.h +++ b/arch/microblaze/include/uapi/asm/unistd.h | |||
| @@ -415,5 +415,7 @@ | |||
| 415 | #define __NR_pkey_alloc 396 | 415 | #define __NR_pkey_alloc 396 |
| 416 | #define __NR_pkey_free 397 | 416 | #define __NR_pkey_free 397 |
| 417 | #define __NR_statx 398 | 417 | #define __NR_statx 398 |
| 418 | #define __NR_io_pgetevents 399 | ||
| 419 | #define __NR_rseq 400 | ||
| 418 | 420 | ||
| 419 | #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ | 421 | #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ |
diff --git a/arch/microblaze/kernel/Makefile b/arch/microblaze/kernel/Makefile index 7e99cf6984a1..dd71637437f4 100644 --- a/arch/microblaze/kernel/Makefile +++ b/arch/microblaze/kernel/Makefile | |||
| @@ -8,7 +8,6 @@ ifdef CONFIG_FUNCTION_TRACER | |||
| 8 | CFLAGS_REMOVE_timer.o = -pg | 8 | CFLAGS_REMOVE_timer.o = -pg |
| 9 | CFLAGS_REMOVE_intc.o = -pg | 9 | CFLAGS_REMOVE_intc.o = -pg |
| 10 | CFLAGS_REMOVE_early_printk.o = -pg | 10 | CFLAGS_REMOVE_early_printk.o = -pg |
| 11 | CFLAGS_REMOVE_heartbeat.o = -pg | ||
| 12 | CFLAGS_REMOVE_ftrace.o = -pg | 11 | CFLAGS_REMOVE_ftrace.o = -pg |
| 13 | CFLAGS_REMOVE_process.o = -pg | 12 | CFLAGS_REMOVE_process.o = -pg |
| 14 | endif | 13 | endif |
| @@ -17,12 +16,11 @@ extra-y := head.o vmlinux.lds | |||
| 17 | 16 | ||
| 18 | obj-y += dma.o exceptions.o \ | 17 | obj-y += dma.o exceptions.o \ |
| 19 | hw_exception_handler.o irq.o \ | 18 | hw_exception_handler.o irq.o \ |
| 20 | platform.o process.o prom.o ptrace.o \ | 19 | process.o prom.o ptrace.o \ |
| 21 | reset.o setup.o signal.o sys_microblaze.o timer.o traps.o unwind.o | 20 | reset.o setup.o signal.o sys_microblaze.o timer.o traps.o unwind.o |
| 22 | 21 | ||
| 23 | obj-y += cpu/ | 22 | obj-y += cpu/ |
| 24 | 23 | ||
| 25 | obj-$(CONFIG_HEART_BEAT) += heartbeat.o | ||
| 26 | obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o | 24 | obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o |
| 27 | obj-$(CONFIG_MMU) += misc.o | 25 | obj-$(CONFIG_MMU) += misc.o |
| 28 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 26 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
diff --git a/arch/microblaze/kernel/heartbeat.c b/arch/microblaze/kernel/heartbeat.c deleted file mode 100644 index 2022130139d2..000000000000 --- a/arch/microblaze/kernel/heartbeat.c +++ /dev/null | |||
| @@ -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 | } | ||
diff --git a/arch/microblaze/kernel/platform.c b/arch/microblaze/kernel/platform.c deleted file mode 100644 index 2540d60610d9..000000000000 --- a/arch/microblaze/kernel/platform.c +++ /dev/null | |||
| @@ -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); | ||
diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c index bab4c8330ef4..fcbe1daf6316 100644 --- a/arch/microblaze/kernel/reset.c +++ b/arch/microblaze/kernel/reset.c | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | static int handle; /* reset pin handle */ | 18 | static int handle; /* reset pin handle */ |
| 19 | static unsigned int reset_val; | 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 | int ret; | 23 | int ret; |
| 24 | handle = of_get_named_gpio(of_find_node_by_path("/"), | 24 | handle = of_get_named_gpio(of_find_node_by_path("/"), |
| @@ -27,13 +27,13 @@ void of_platform_reset_gpio_probe(void) | |||
| 27 | if (!gpio_is_valid(handle)) { | 27 | if (!gpio_is_valid(handle)) { |
| 28 | pr_info("Skipping unavailable RESET gpio %d (%s)\n", | 28 | pr_info("Skipping unavailable RESET gpio %d (%s)\n", |
| 29 | handle, "reset"); | 29 | handle, "reset"); |
| 30 | return; | 30 | return -ENODEV; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | ret = gpio_request(handle, "reset"); | 33 | ret = gpio_request(handle, "reset"); |
| 34 | if (ret < 0) { | 34 | if (ret < 0) { |
| 35 | pr_info("GPIO pin is already allocated\n"); | 35 | pr_info("GPIO pin is already allocated\n"); |
| 36 | return; | 36 | return ret; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | /* get current setup value */ | 39 | /* get current setup value */ |
| @@ -51,11 +51,12 @@ void of_platform_reset_gpio_probe(void) | |||
| 51 | 51 | ||
| 52 | pr_info("RESET: Registered gpio device: %d, current val: %d\n", | 52 | pr_info("RESET: Registered gpio device: %d, current val: %d\n", |
| 53 | handle, reset_val); | 53 | handle, reset_val); |
| 54 | return; | 54 | return 0; |
| 55 | err: | 55 | err: |
| 56 | gpio_free(handle); | 56 | gpio_free(handle); |
| 57 | return; | 57 | return ret; |
| 58 | } | 58 | } |
| 59 | device_initcall(of_platform_reset_gpio_probe); | ||
| 59 | 60 | ||
| 60 | 61 | ||
| 61 | static void gpio_system_reset(void) | 62 | static void gpio_system_reset(void) |
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S index 56bcf313121f..6ab650593792 100644 --- a/arch/microblaze/kernel/syscall_table.S +++ b/arch/microblaze/kernel/syscall_table.S | |||
| @@ -400,3 +400,5 @@ ENTRY(sys_call_table) | |||
| 400 | .long sys_pkey_alloc | 400 | .long sys_pkey_alloc |
| 401 | .long sys_pkey_free | 401 | .long sys_pkey_free |
| 402 | .long sys_statx | 402 | .long sys_statx |
| 403 | .long sys_io_pgetevents | ||
| 404 | .long sys_rseq | ||
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index 7de941cbbd94..a6683484b3a1 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c | |||
| @@ -156,9 +156,6 @@ static inline void timer_ack(void) | |||
| 156 | static irqreturn_t timer_interrupt(int irq, void *dev_id) | 156 | static irqreturn_t timer_interrupt(int irq, void *dev_id) |
| 157 | { | 157 | { |
| 158 | struct clock_event_device *evt = &clockevent_xilinx_timer; | 158 | struct clock_event_device *evt = &clockevent_xilinx_timer; |
| 159 | #ifdef CONFIG_HEART_BEAT | ||
| 160 | microblaze_heartbeat(); | ||
| 161 | #endif | ||
| 162 | timer_ack(); | 159 | timer_ack(); |
| 163 | evt->event_handler(evt); | 160 | evt->event_handler(evt); |
| 164 | return IRQ_HANDLED; | 161 | return IRQ_HANDLED; |
| @@ -318,10 +315,6 @@ static int __init xilinx_timer_init(struct device_node *timer) | |||
| 318 | return ret; | 315 | return ret; |
| 319 | } | 316 | } |
| 320 | 317 | ||
| 321 | #ifdef CONFIG_HEART_BEAT | ||
| 322 | microblaze_setup_heartbeat(); | ||
| 323 | #endif | ||
| 324 | |||
| 325 | ret = xilinx_clocksource_init(); | 318 | ret = xilinx_clocksource_init(); |
| 326 | if (ret) | 319 | if (ret) |
| 327 | return ret; | 320 | return ret; |
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 8d85046adcc8..9670e70139fd 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/kallsyms.h> | 29 | #include <linux/kallsyms.h> |
| 30 | #include <linux/random.h> | 30 | #include <linux/random.h> |
| 31 | #include <linux/prctl.h> | 31 | #include <linux/prctl.h> |
| 32 | #include <linux/nmi.h> | ||
| 32 | 33 | ||
| 33 | #include <asm/asm.h> | 34 | #include <asm/asm.h> |
| 34 | #include <asm/bootinfo.h> | 35 | #include <asm/bootinfo.h> |
| @@ -655,28 +656,42 @@ unsigned long arch_align_stack(unsigned long sp) | |||
| 655 | return sp & ALMASK; | 656 | return sp & ALMASK; |
| 656 | } | 657 | } |
| 657 | 658 | ||
| 658 | static void arch_dump_stack(void *info) | 659 | static DEFINE_PER_CPU(call_single_data_t, backtrace_csd); |
| 660 | static struct cpumask backtrace_csd_busy; | ||
| 661 | |||
| 662 | static void handle_backtrace(void *info) | ||
| 659 | { | 663 | { |
| 660 | struct pt_regs *regs; | 664 | nmi_cpu_backtrace(get_irq_regs()); |
| 665 | cpumask_clear_cpu(smp_processor_id(), &backtrace_csd_busy); | ||
| 666 | } | ||
| 661 | 667 | ||
| 662 | regs = get_irq_regs(); | 668 | static void raise_backtrace(cpumask_t *mask) |
| 669 | { | ||
| 670 | call_single_data_t *csd; | ||
| 671 | int cpu; | ||
| 663 | 672 | ||
| 664 | if (regs) | 673 | for_each_cpu(cpu, mask) { |
| 665 | show_regs(regs); | 674 | /* |
| 675 | * If we previously sent an IPI to the target CPU & it hasn't | ||
| 676 | * cleared its bit in the busy cpumask then it didn't handle | ||
| 677 | * our previous IPI & it's not safe for us to reuse the | ||
| 678 | * call_single_data_t. | ||
| 679 | */ | ||
| 680 | if (cpumask_test_and_set_cpu(cpu, &backtrace_csd_busy)) { | ||
| 681 | pr_warn("Unable to send backtrace IPI to CPU%u - perhaps it hung?\n", | ||
| 682 | cpu); | ||
| 683 | continue; | ||
| 684 | } | ||
| 666 | 685 | ||
| 667 | dump_stack(); | 686 | csd = &per_cpu(backtrace_csd, cpu); |
| 687 | csd->func = handle_backtrace; | ||
| 688 | smp_call_function_single_async(cpu, csd); | ||
| 689 | } | ||
| 668 | } | 690 | } |
| 669 | 691 | ||
| 670 | void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self) | 692 | void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self) |
| 671 | { | 693 | { |
| 672 | long this_cpu = get_cpu(); | 694 | nmi_trigger_cpumask_backtrace(mask, exclude_self, raise_backtrace); |
| 673 | |||
| 674 | if (cpumask_test_cpu(this_cpu, mask) && !exclude_self) | ||
| 675 | dump_stack(); | ||
| 676 | |||
| 677 | smp_call_function_many(mask, arch_dump_stack, NULL, 1); | ||
| 678 | |||
| 679 | put_cpu(); | ||
| 680 | } | 695 | } |
| 681 | 696 | ||
| 682 | int mips_get_process_fp_mode(struct task_struct *task) | 697 | int mips_get_process_fp_mode(struct task_struct *task) |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 00f2535d2226..0a9cfe7a0372 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
| @@ -801,7 +801,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) | |||
| 801 | regs->regs[0] = 0; /* Don't deal with this again. */ | 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 | if (sig_uses_siginfo(&ksig->ka, abi)) | 806 | if (sig_uses_siginfo(&ksig->ka, abi)) |
| 807 | ret = abi->setup_rt_frame(vdso + abi->vdso->off_rt_sigreturn, | 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, | |||
| 870 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { | 870 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { |
| 871 | clear_thread_flag(TIF_NOTIFY_RESUME); | 871 | clear_thread_flag(TIF_NOTIFY_RESUME); |
| 872 | tracehook_notify_resume(regs); | 872 | tracehook_notify_resume(regs); |
| 873 | rseq_handle_notify_resume(regs); | 873 | rseq_handle_notify_resume(NULL, regs); |
| 874 | } | 874 | } |
| 875 | 875 | ||
| 876 | user_enter(); | 876 | user_enter(); |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index d67fa74622ee..8d505a21396e 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
| @@ -351,6 +351,7 @@ static void __show_regs(const struct pt_regs *regs) | |||
| 351 | void show_regs(struct pt_regs *regs) | 351 | void show_regs(struct pt_regs *regs) |
| 352 | { | 352 | { |
| 353 | __show_regs((struct pt_regs *)regs); | 353 | __show_regs((struct pt_regs *)regs); |
| 354 | dump_stack(); | ||
| 354 | } | 355 | } |
| 355 | 356 | ||
| 356 | void show_registers(struct pt_regs *regs) | 357 | void show_registers(struct pt_regs *regs) |
diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c index 1986e09fb457..1601d90b087b 100644 --- a/arch/mips/mm/ioremap.c +++ b/arch/mips/mm/ioremap.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <linux/export.h> | 9 | #include <linux/export.h> |
| 10 | #include <asm/addrspace.h> | 10 | #include <asm/addrspace.h> |
| 11 | #include <asm/byteorder.h> | 11 | #include <asm/byteorder.h> |
| 12 | #include <linux/ioport.h> | ||
| 12 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
| 13 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
| 14 | #include <linux/vmalloc.h> | 15 | #include <linux/vmalloc.h> |
| @@ -98,6 +99,20 @@ static int remap_area_pages(unsigned long address, phys_addr_t phys_addr, | |||
| 98 | return error; | 99 | return error; |
| 99 | } | 100 | } |
| 100 | 101 | ||
| 102 | static int __ioremap_check_ram(unsigned long start_pfn, unsigned long nr_pages, | ||
| 103 | void *arg) | ||
| 104 | { | ||
| 105 | unsigned long i; | ||
| 106 | |||
| 107 | for (i = 0; i < nr_pages; i++) { | ||
| 108 | if (pfn_valid(start_pfn + i) && | ||
| 109 | !PageReserved(pfn_to_page(start_pfn + i))) | ||
| 110 | return 1; | ||
| 111 | } | ||
| 112 | |||
| 113 | return 0; | ||
| 114 | } | ||
| 115 | |||
| 101 | /* | 116 | /* |
| 102 | * Generic mapping function (not visible outside): | 117 | * Generic mapping function (not visible outside): |
| 103 | */ | 118 | */ |
| @@ -116,8 +131,8 @@ static int remap_area_pages(unsigned long address, phys_addr_t phys_addr, | |||
| 116 | 131 | ||
| 117 | void __iomem * __ioremap(phys_addr_t phys_addr, phys_addr_t size, unsigned long flags) | 132 | void __iomem * __ioremap(phys_addr_t phys_addr, phys_addr_t size, unsigned long flags) |
| 118 | { | 133 | { |
| 134 | unsigned long offset, pfn, last_pfn; | ||
| 119 | struct vm_struct * area; | 135 | struct vm_struct * area; |
| 120 | unsigned long offset; | ||
| 121 | phys_addr_t last_addr; | 136 | phys_addr_t last_addr; |
| 122 | void * addr; | 137 | void * addr; |
| 123 | 138 | ||
| @@ -137,18 +152,16 @@ void __iomem * __ioremap(phys_addr_t phys_addr, phys_addr_t size, unsigned long | |||
| 137 | return (void __iomem *) CKSEG1ADDR(phys_addr); | 152 | return (void __iomem *) CKSEG1ADDR(phys_addr); |
| 138 | 153 | ||
| 139 | /* | 154 | /* |
| 140 | * Don't allow anybody to remap normal RAM that we're using.. | 155 | * Don't allow anybody to remap RAM that may be allocated by the page |
| 156 | * allocator, since that could lead to races & data clobbering. | ||
| 141 | */ | 157 | */ |
| 142 | if (phys_addr < virt_to_phys(high_memory)) { | 158 | pfn = PFN_DOWN(phys_addr); |
| 143 | char *t_addr, *t_end; | 159 | last_pfn = PFN_DOWN(last_addr); |
| 144 | struct page *page; | 160 | if (walk_system_ram_range(pfn, last_pfn - pfn + 1, NULL, |
| 145 | 161 | __ioremap_check_ram) == 1) { | |
| 146 | t_addr = __va(phys_addr); | 162 | WARN_ONCE(1, "ioremap on RAM at %pa - %pa\n", |
| 147 | t_end = t_addr + (size - 1); | 163 | &phys_addr, &last_addr); |
| 148 | 164 | return NULL; | |
| 149 | for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++) | ||
| 150 | if(!PageReserved(page)) | ||
| 151 | return NULL; | ||
| 152 | } | 165 | } |
| 153 | 166 | ||
| 154 | /* | 167 | /* |
diff --git a/arch/openrisc/include/asm/pgalloc.h b/arch/openrisc/include/asm/pgalloc.h index 3e1a46615120..8999b9226512 100644 --- a/arch/openrisc/include/asm/pgalloc.h +++ b/arch/openrisc/include/asm/pgalloc.h | |||
| @@ -98,8 +98,12 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte) | |||
| 98 | __free_page(pte); | 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 | #define pmd_pgtable(pmd) pmd_page(pmd) | 107 | #define pmd_pgtable(pmd) pmd_page(pmd) |
| 104 | 108 | ||
| 105 | #define check_pgt_cache() do { } while (0) | 109 | #define check_pgt_cache() do { } while (0) |
diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S index 690d55272ba6..0c826ad6e994 100644 --- a/arch/openrisc/kernel/entry.S +++ b/arch/openrisc/kernel/entry.S | |||
| @@ -277,12 +277,6 @@ EXCEPTION_ENTRY(_data_page_fault_handler) | |||
| 277 | l.addi r3,r1,0 // pt_regs | 277 | l.addi r3,r1,0 // pt_regs |
| 278 | /* r4 set be EXCEPTION_HANDLE */ // effective address of fault | 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 | #ifdef CONFIG_OPENRISC_NO_SPR_SR_DSX | 280 | #ifdef CONFIG_OPENRISC_NO_SPR_SR_DSX |
| 287 | l.lwz r6,PT_PC(r3) // address of an offending insn | 281 | l.lwz r6,PT_PC(r3) // address of an offending insn |
| 288 | l.lwz r6,0(r6) // instruction that caused pf | 282 | l.lwz r6,0(r6) // instruction that caused pf |
| @@ -314,7 +308,7 @@ EXCEPTION_ENTRY(_data_page_fault_handler) | |||
| 314 | 308 | ||
| 315 | #else | 309 | #else |
| 316 | 310 | ||
| 317 | l.lwz r6,PT_SR(r3) // SR | 311 | l.mfspr r6,r0,SPR_SR // SR |
| 318 | l.andi r6,r6,SPR_SR_DSX // check for delay slot exception | 312 | l.andi r6,r6,SPR_SR_DSX // check for delay slot exception |
| 319 | l.sfne r6,r0 // exception happened in delay slot | 313 | l.sfne r6,r0 // exception happened in delay slot |
| 320 | l.bnf 7f | 314 | l.bnf 7f |
diff --git a/arch/openrisc/kernel/head.S b/arch/openrisc/kernel/head.S index fb02b2a1d6f2..9fc6b60140f0 100644 --- a/arch/openrisc/kernel/head.S +++ b/arch/openrisc/kernel/head.S | |||
| @@ -210,8 +210,7 @@ | |||
| 210 | * r4 - EEAR exception EA | 210 | * r4 - EEAR exception EA |
| 211 | * r10 - current pointing to current_thread_info struct | 211 | * r10 - current pointing to current_thread_info struct |
| 212 | * r12 - syscall 0, since we didn't come from syscall | 212 | * r12 - syscall 0, since we didn't come from syscall |
| 213 | * r13 - temp it actually contains new SR, not needed anymore | 213 | * r30 - handler address of the handler we'll jump to |
| 214 | * r31 - handler address of the handler we'll jump to | ||
| 215 | * | 214 | * |
| 216 | * handler has to save remaining registers to the exception | 215 | * handler has to save remaining registers to the exception |
| 217 | * ksp frame *before* tainting them! | 216 | * ksp frame *before* tainting them! |
| @@ -244,6 +243,7 @@ | |||
| 244 | /* r1 is KSP, r30 is __pa(KSP) */ ;\ | 243 | /* r1 is KSP, r30 is __pa(KSP) */ ;\ |
| 245 | tophys (r30,r1) ;\ | 244 | tophys (r30,r1) ;\ |
| 246 | l.sw PT_GPR12(r30),r12 ;\ | 245 | l.sw PT_GPR12(r30),r12 ;\ |
| 246 | /* r4 use for tmp before EA */ ;\ | ||
| 247 | l.mfspr r12,r0,SPR_EPCR_BASE ;\ | 247 | l.mfspr r12,r0,SPR_EPCR_BASE ;\ |
| 248 | l.sw PT_PC(r30),r12 ;\ | 248 | l.sw PT_PC(r30),r12 ;\ |
| 249 | l.mfspr r12,r0,SPR_ESR_BASE ;\ | 249 | l.mfspr r12,r0,SPR_ESR_BASE ;\ |
| @@ -263,7 +263,10 @@ | |||
| 263 | /* r12 == 1 if we come from syscall */ ;\ | 263 | /* r12 == 1 if we come from syscall */ ;\ |
| 264 | CLEAR_GPR(r12) ;\ | 264 | CLEAR_GPR(r12) ;\ |
| 265 | /* ----- turn on MMU ----- */ ;\ | 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 | l.mtspr r0,r30,SPR_ESR_BASE ;\ | 270 | l.mtspr r0,r30,SPR_ESR_BASE ;\ |
| 268 | /* r30: EA address of handler */ ;\ | 271 | /* r30: EA address of handler */ ;\ |
| 269 | LOAD_SYMBOL_2_GPR(r30,handler) ;\ | 272 | LOAD_SYMBOL_2_GPR(r30,handler) ;\ |
diff --git a/arch/openrisc/kernel/traps.c b/arch/openrisc/kernel/traps.c index fac246e6f37a..d8981cbb852a 100644 --- a/arch/openrisc/kernel/traps.c +++ b/arch/openrisc/kernel/traps.c | |||
| @@ -300,7 +300,7 @@ static inline int in_delay_slot(struct pt_regs *regs) | |||
| 300 | return 0; | 300 | return 0; |
| 301 | } | 301 | } |
| 302 | #else | 302 | #else |
| 303 | return regs->sr & SPR_SR_DSX; | 303 | return mfspr(SPR_SR) & SPR_SR_DSX; |
| 304 | #endif | 304 | #endif |
| 305 | } | 305 | } |
| 306 | 306 | ||
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index c480770fabcd..17526bebcbd2 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
| @@ -244,11 +244,11 @@ config PARISC_PAGE_SIZE_4KB | |||
| 244 | 244 | ||
| 245 | config PARISC_PAGE_SIZE_16KB | 245 | config PARISC_PAGE_SIZE_16KB |
| 246 | bool "16KB" | 246 | bool "16KB" |
| 247 | depends on PA8X00 | 247 | depends on PA8X00 && BROKEN |
| 248 | 248 | ||
| 249 | config PARISC_PAGE_SIZE_64KB | 249 | config PARISC_PAGE_SIZE_64KB |
| 250 | bool "64KB" | 250 | bool "64KB" |
| 251 | depends on PA8X00 | 251 | depends on PA8X00 && BROKEN |
| 252 | 252 | ||
| 253 | endchoice | 253 | endchoice |
| 254 | 254 | ||
| @@ -347,7 +347,7 @@ config NR_CPUS | |||
| 347 | int "Maximum number of CPUs (2-32)" | 347 | int "Maximum number of CPUs (2-32)" |
| 348 | range 2 32 | 348 | range 2 32 |
| 349 | depends on SMP | 349 | depends on SMP |
| 350 | default "32" | 350 | default "4" |
| 351 | 351 | ||
| 352 | endmenu | 352 | endmenu |
| 353 | 353 | ||
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index 714284ea6cc2..5ce030266e7d 100644 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile | |||
| @@ -65,10 +65,6 @@ endif | |||
| 65 | # kernel. | 65 | # kernel. |
| 66 | cflags-y += -mdisable-fpregs | 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 | # Use long jumps instead of long branches (needed if your linker fails to | 68 | # Use long jumps instead of long branches (needed if your linker fails to |
| 73 | # link a too big vmlinux executable). Not enabled for building modules. | 69 | # link a too big vmlinux executable). Not enabled for building modules. |
| 74 | ifdef CONFIG_MLONGCALLS | 70 | ifdef CONFIG_MLONGCALLS |
diff --git a/arch/parisc/include/asm/signal.h b/arch/parisc/include/asm/signal.h index eeb5c8858663..715c96ba2ec8 100644 --- a/arch/parisc/include/asm/signal.h +++ b/arch/parisc/include/asm/signal.h | |||
| @@ -21,14 +21,6 @@ typedef struct { | |||
| 21 | unsigned long sig[_NSIG_WORDS]; | 21 | unsigned long sig[_NSIG_WORDS]; |
| 22 | } sigset_t; | 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 | #include <asm/sigcontext.h> | 24 | #include <asm/sigcontext.h> |
| 33 | 25 | ||
| 34 | #endif /* !__ASSEMBLY */ | 26 | #endif /* !__ASSEMBLY */ |
diff --git a/arch/parisc/include/uapi/asm/unistd.h b/arch/parisc/include/uapi/asm/unistd.h index 4872e77aa96b..dc77c5a51db7 100644 --- a/arch/parisc/include/uapi/asm/unistd.h +++ b/arch/parisc/include/uapi/asm/unistd.h | |||
| @@ -364,8 +364,9 @@ | |||
| 364 | #define __NR_preadv2 (__NR_Linux + 347) | 364 | #define __NR_preadv2 (__NR_Linux + 347) |
| 365 | #define __NR_pwritev2 (__NR_Linux + 348) | 365 | #define __NR_pwritev2 (__NR_Linux + 348) |
| 366 | #define __NR_statx (__NR_Linux + 349) | 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 | #define __IGNORE_select /* newselect */ | 372 | #define __IGNORE_select /* newselect */ |
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c index e0e1c9775c32..5eb979d04b90 100644 --- a/arch/parisc/kernel/drivers.c +++ b/arch/parisc/kernel/drivers.c | |||
| @@ -154,17 +154,14 @@ int register_parisc_driver(struct parisc_driver *driver) | |||
| 154 | { | 154 | { |
| 155 | /* FIXME: we need this because apparently the sti | 155 | /* FIXME: we need this because apparently the sti |
| 156 | * driver can be registered twice */ | 156 | * driver can be registered twice */ |
| 157 | if(driver->drv.name) { | 157 | if (driver->drv.name) { |
| 158 | printk(KERN_WARNING | 158 | pr_warn("BUG: skipping previously registered driver %s\n", |
| 159 | "BUG: skipping previously registered driver %s\n", | 159 | driver->name); |
| 160 | driver->name); | ||
| 161 | return 1; | 160 | return 1; |
| 162 | } | 161 | } |
| 163 | 162 | ||
| 164 | if (!driver->probe) { | 163 | if (!driver->probe) { |
| 165 | printk(KERN_WARNING | 164 | pr_warn("BUG: driver %s has no probe routine\n", driver->name); |
| 166 | "BUG: driver %s has no probe routine\n", | ||
| 167 | driver->name); | ||
| 168 | return 1; | 165 | return 1; |
| 169 | } | 166 | } |
| 170 | 167 | ||
| @@ -491,12 +488,9 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) | |||
| 491 | 488 | ||
| 492 | dev = create_parisc_device(mod_path); | 489 | dev = create_parisc_device(mod_path); |
| 493 | if (dev->id.hw_type != HPHW_FAULTY) { | 490 | if (dev->id.hw_type != HPHW_FAULTY) { |
| 494 | printk(KERN_ERR "Two devices have hardware path [%s]. " | 491 | pr_err("Two devices have hardware path [%s]. IODC data for second device: %7phN\n" |
| 495 | "IODC data for second device: " | 492 | "Rearranging GSC cards sometimes helps\n", |
| 496 | "%02x%02x%02x%02x%02x%02x\n" | 493 | parisc_pathname(dev), iodc_data); |
| 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]); | ||
| 500 | return NULL; | 494 | return NULL; |
| 501 | } | 495 | } |
| 502 | 496 | ||
| @@ -528,8 +522,7 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) | |||
| 528 | * the keyboard controller | 522 | * the keyboard controller |
| 529 | */ | 523 | */ |
| 530 | if ((hpa & 0xfff) == 0 && insert_resource(&iomem_resource, &dev->hpa)) | 524 | if ((hpa & 0xfff) == 0 && insert_resource(&iomem_resource, &dev->hpa)) |
| 531 | printk("Unable to claim HPA %lx for device %s\n", | 525 | pr_warn("Unable to claim HPA %lx for device %s\n", hpa, name); |
| 532 | hpa, name); | ||
| 533 | 526 | ||
| 534 | return dev; | 527 | return dev; |
| 535 | } | 528 | } |
| @@ -875,7 +868,7 @@ static void print_parisc_device(struct parisc_device *dev) | |||
| 875 | static int count; | 868 | static int count; |
| 876 | 869 | ||
| 877 | print_pa_hwpath(dev, hw_path); | 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 | ++count, dev->name, (void*) dev->hpa.start, hw_path, dev->id.hw_type, | 872 | ++count, dev->name, (void*) dev->hpa.start, hw_path, dev->id.hw_type, |
| 880 | dev->id.hversion_rev, dev->id.hversion, dev->id.sversion); | 873 | dev->id.hversion_rev, dev->id.hversion, dev->id.sversion); |
| 881 | 874 | ||
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 6308749359e4..fe3f2a49d2b1 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S | |||
| @@ -445,6 +445,7 @@ | |||
| 445 | ENTRY_COMP(preadv2) | 445 | ENTRY_COMP(preadv2) |
| 446 | ENTRY_COMP(pwritev2) | 446 | ENTRY_COMP(pwritev2) |
| 447 | ENTRY_SAME(statx) | 447 | ENTRY_SAME(statx) |
| 448 | ENTRY_COMP(io_pgetevents) /* 350 */ | ||
| 448 | 449 | ||
| 449 | 450 | ||
| 450 | .ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b)) | 451 | .ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b)) |
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index 143f90e2f9f3..2ef83d78eec4 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | /* #define DEBUG 1 */ | 26 | /* #define DEBUG 1 */ |
| 27 | #ifdef DEBUG | 27 | #ifdef DEBUG |
| 28 | #define dbg(x...) printk(x) | 28 | #define dbg(x...) pr_debug(x) |
| 29 | #else | 29 | #else |
| 30 | #define dbg(x...) | 30 | #define dbg(x...) |
| 31 | #endif | 31 | #endif |
| @@ -182,7 +182,7 @@ int __init unwind_init(void) | |||
| 182 | start = (long)&__start___unwind[0]; | 182 | start = (long)&__start___unwind[0]; |
| 183 | stop = (long)&__stop___unwind[0]; | 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 | start, stop, | 186 | start, stop, |
| 187 | (stop - start) / sizeof(struct unwind_table_entry)); | 187 | (stop - start) / sizeof(struct unwind_table_entry)); |
| 188 | 188 | ||
diff --git a/arch/powerpc/include/asm/book3s/32/pgalloc.h b/arch/powerpc/include/asm/book3s/32/pgalloc.h index e4633803fe43..82e44b1a00ae 100644 --- a/arch/powerpc/include/asm/book3s/32/pgalloc.h +++ b/arch/powerpc/include/asm/book3s/32/pgalloc.h | |||
| @@ -138,7 +138,6 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb, | |||
| 138 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, | 138 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, |
| 139 | unsigned long address) | 139 | unsigned long address) |
| 140 | { | 140 | { |
| 141 | pgtable_page_dtor(table); | ||
| 142 | pgtable_free_tlb(tlb, page_address(table), 0); | 141 | pgtable_free_tlb(tlb, page_address(table), 0); |
| 143 | } | 142 | } |
| 144 | #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */ | 143 | #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */ |
diff --git a/arch/powerpc/include/asm/nohash/32/pgalloc.h b/arch/powerpc/include/asm/nohash/32/pgalloc.h index 9de40eb614da..8825953c225b 100644 --- a/arch/powerpc/include/asm/nohash/32/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/32/pgalloc.h | |||
| @@ -140,7 +140,6 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, | |||
| 140 | unsigned long address) | 140 | unsigned long address) |
| 141 | { | 141 | { |
| 142 | tlb_flush_pgtable(tlb, address); | 142 | tlb_flush_pgtable(tlb, address); |
| 143 | pgtable_page_dtor(table); | ||
| 144 | pgtable_free_tlb(tlb, page_address(table), 0); | 143 | pgtable_free_tlb(tlb, page_address(table), 0); |
| 145 | } | 144 | } |
| 146 | #endif /* _ASM_POWERPC_PGALLOC_32_H */ | 145 | #endif /* _ASM_POWERPC_PGALLOC_32_H */ |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index cfcf6a874cfa..01b5171ea189 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
| @@ -393,3 +393,4 @@ SYSCALL(pkey_alloc) | |||
| 393 | SYSCALL(pkey_free) | 393 | SYSCALL(pkey_free) |
| 394 | SYSCALL(pkey_mprotect) | 394 | SYSCALL(pkey_mprotect) |
| 395 | SYSCALL(rseq) | 395 | SYSCALL(rseq) |
| 396 | COMPAT_SYS(io_pgetevents) | ||
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index 1e9708632dce..c19379f0a32e 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include <uapi/asm/unistd.h> | 12 | #include <uapi/asm/unistd.h> |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | #define NR_syscalls 388 | 15 | #define NR_syscalls 389 |
| 16 | 16 | ||
| 17 | #define __NR__exit __NR_exit | 17 | #define __NR__exit __NR_exit |
| 18 | 18 | ||
diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h index ac5ba55066dd..985534d0b448 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h | |||
| @@ -399,5 +399,6 @@ | |||
| 399 | #define __NR_pkey_free 385 | 399 | #define __NR_pkey_free 385 |
| 400 | #define __NR_pkey_mprotect 386 | 400 | #define __NR_pkey_mprotect 386 |
| 401 | #define __NR_rseq 387 | 401 | #define __NR_rseq 387 |
| 402 | #define __NR_io_pgetevents 388 | ||
| 402 | 403 | ||
| 403 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ | 404 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 4f861055a852..d63b488d34d7 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
| @@ -285,9 +285,6 @@ pci_bus_to_hose(int bus) | |||
| 285 | * Note that the returned IO or memory base is a physical address | 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 | SYSCALL_DEFINE3(pciconfig_iobase, long, which, | 288 | SYSCALL_DEFINE3(pciconfig_iobase, long, which, |
| 292 | unsigned long, bus, unsigned long, devfn) | 289 | unsigned long, bus, unsigned long, devfn) |
| 293 | { | 290 | { |
| @@ -313,4 +310,3 @@ SYSCALL_DEFINE3(pciconfig_iobase, long, which, | |||
| 313 | 310 | ||
| 314 | return result; | 311 | return result; |
| 315 | } | 312 | } |
| 316 | #pragma GCC diagnostic pop | ||
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 812171c09f42..dff28f903512 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
| @@ -203,9 +203,6 @@ void pcibios_setup_phb_io_space(struct pci_controller *hose) | |||
| 203 | #define IOBASE_ISA_IO 3 | 203 | #define IOBASE_ISA_IO 3 |
| 204 | #define IOBASE_ISA_MEM 4 | 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 | SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus, | 206 | SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus, |
| 210 | unsigned long, in_devfn) | 207 | unsigned long, in_devfn) |
| 211 | { | 208 | { |
| @@ -259,7 +256,6 @@ SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus, | |||
| 259 | 256 | ||
| 260 | return -EOPNOTSUPP; | 257 | return -EOPNOTSUPP; |
| 261 | } | 258 | } |
| 262 | #pragma GCC diagnostic pop | ||
| 263 | 259 | ||
| 264 | #ifdef CONFIG_NUMA | 260 | #ifdef CONFIG_NUMA |
| 265 | int pcibus_to_node(struct pci_bus *bus) | 261 | int pcibus_to_node(struct pci_bus *bus) |
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 7fb9f83dcde8..8afd146bc9c7 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
| @@ -1051,9 +1051,6 @@ struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log, | |||
| 1051 | } | 1051 | } |
| 1052 | 1052 | ||
| 1053 | /* We assume to be passed big endian arguments */ | 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 | SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) | 1054 | SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) |
| 1058 | { | 1055 | { |
| 1059 | struct rtas_args args; | 1056 | struct rtas_args args; |
| @@ -1140,7 +1137,6 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) | |||
| 1140 | 1137 | ||
| 1141 | return 0; | 1138 | return 0; |
| 1142 | } | 1139 | } |
| 1143 | #pragma GCC diagnostic pop | ||
| 1144 | 1140 | ||
| 1145 | /* | 1141 | /* |
| 1146 | * Call early during boot, before mem init, to retrieve the RTAS | 1142 | * Call early during boot, before mem init, to retrieve the RTAS |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 5eedbb282d42..e6474a45cef5 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
| @@ -1038,9 +1038,6 @@ static int do_setcontext_tm(struct ucontext __user *ucp, | |||
| 1038 | } | 1038 | } |
| 1039 | #endif | 1039 | #endif |
| 1040 | 1040 | ||
| 1041 | #pragma GCC diagnostic push | ||
| 1042 | #pragma GCC diagnostic ignored "-Wpragmas" | ||
| 1043 | #pragma GCC diagnostic ignored "-Wattribute-alias" | ||
| 1044 | #ifdef CONFIG_PPC64 | 1041 | #ifdef CONFIG_PPC64 |
| 1045 | COMPAT_SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, | 1042 | COMPAT_SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, |
| 1046 | struct ucontext __user *, new_ctx, int, ctx_size) | 1043 | struct ucontext __user *, new_ctx, int, ctx_size) |
| @@ -1134,7 +1131,6 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, | |||
| 1134 | set_thread_flag(TIF_RESTOREALL); | 1131 | set_thread_flag(TIF_RESTOREALL); |
| 1135 | return 0; | 1132 | return 0; |
| 1136 | } | 1133 | } |
| 1137 | #pragma GCC diagnostic pop | ||
| 1138 | 1134 | ||
| 1139 | #ifdef CONFIG_PPC64 | 1135 | #ifdef CONFIG_PPC64 |
| 1140 | COMPAT_SYSCALL_DEFINE0(rt_sigreturn) | 1136 | COMPAT_SYSCALL_DEFINE0(rt_sigreturn) |
| @@ -1231,9 +1227,6 @@ SYSCALL_DEFINE0(rt_sigreturn) | |||
| 1231 | return 0; | 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 | #ifdef CONFIG_PPC32 | 1230 | #ifdef CONFIG_PPC32 |
| 1238 | SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, | 1231 | SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, |
| 1239 | int, ndbg, struct sig_dbg_op __user *, dbg) | 1232 | int, ndbg, struct sig_dbg_op __user *, dbg) |
| @@ -1337,7 +1330,6 @@ SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, | |||
| 1337 | return 0; | 1330 | return 0; |
| 1338 | } | 1331 | } |
| 1339 | #endif | 1332 | #endif |
| 1340 | #pragma GCC diagnostic pop | ||
| 1341 | 1333 | ||
| 1342 | /* | 1334 | /* |
| 1343 | * OK, we're invoking a handler | 1335 | * OK, we're invoking a handler |
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index d42b60020389..83d51bf586c7 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
| @@ -625,9 +625,6 @@ static long setup_trampoline(unsigned int syscall, unsigned int __user *tramp) | |||
| 625 | /* | 625 | /* |
| 626 | * Handle {get,set,swap}_context operations | 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 | SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, | 628 | SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, |
| 632 | struct ucontext __user *, new_ctx, long, ctx_size) | 629 | struct ucontext __user *, new_ctx, long, ctx_size) |
| 633 | { | 630 | { |
| @@ -693,7 +690,6 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, | |||
| 693 | set_thread_flag(TIF_RESTOREALL); | 690 | set_thread_flag(TIF_RESTOREALL); |
| 694 | return 0; | 691 | return 0; |
| 695 | } | 692 | } |
| 696 | #pragma GCC diagnostic pop | ||
| 697 | 693 | ||
| 698 | 694 | ||
| 699 | /* | 695 | /* |
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c index 083fa06962fd..466216506eb2 100644 --- a/arch/powerpc/kernel/syscalls.c +++ b/arch/powerpc/kernel/syscalls.c | |||
| @@ -62,9 +62,6 @@ out: | |||
| 62 | return ret; | 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 | SYSCALL_DEFINE6(mmap2, unsigned long, addr, size_t, len, | 65 | SYSCALL_DEFINE6(mmap2, unsigned long, addr, size_t, len, |
| 69 | unsigned long, prot, unsigned long, flags, | 66 | unsigned long, prot, unsigned long, flags, |
| 70 | unsigned long, fd, unsigned long, pgoff) | 67 | unsigned long, fd, unsigned long, pgoff) |
| @@ -78,7 +75,6 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, size_t, len, | |||
| 78 | { | 75 | { |
| 79 | return do_mmap2(addr, len, prot, flags, fd, offset, PAGE_SHIFT); | 76 | return do_mmap2(addr, len, prot, flags, fd, offset, PAGE_SHIFT); |
| 80 | } | 77 | } |
| 81 | #pragma GCC diagnostic pop | ||
| 82 | 78 | ||
| 83 | #ifdef CONFIG_PPC32 | 79 | #ifdef CONFIG_PPC32 |
| 84 | /* | 80 | /* |
diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c index 75cb646a79c3..9d16ee251fc0 100644 --- a/arch/powerpc/mm/subpage-prot.c +++ b/arch/powerpc/mm/subpage-prot.c | |||
| @@ -186,9 +186,6 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr, | |||
| 186 | * in a 2-bit field won't allow writes to a page that is otherwise | 186 | * in a 2-bit field won't allow writes to a page that is otherwise |
| 187 | * write-protected. | 187 | * write-protected. |
| 188 | */ | 188 | */ |
| 189 | #pragma GCC diagnostic push | ||
| 190 | #pragma GCC diagnostic ignored "-Wpragmas" | ||
| 191 | #pragma GCC diagnostic ignored "-Wattribute-alias" | ||
| 192 | SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, | 189 | SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, |
| 193 | unsigned long, len, u32 __user *, map) | 190 | unsigned long, len, u32 __user *, map) |
| 194 | { | 191 | { |
| @@ -272,4 +269,3 @@ SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, | |||
| 272 | up_write(&mm->mmap_sem); | 269 | up_write(&mm->mmap_sem); |
| 273 | return err; | 270 | return err; |
| 274 | } | 271 | } |
| 275 | #pragma GCC diagnostic pop | ||
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c index 7c968e46736f..12e6e4d30602 100644 --- a/arch/powerpc/platforms/powermac/time.c +++ b/arch/powerpc/platforms/powermac/time.c | |||
| @@ -42,7 +42,11 @@ | |||
| 42 | #define DBG(x...) | 42 | #define DBG(x...) |
| 43 | #endif | 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 | #define RTC_OFFSET 2082844800 | 50 | #define RTC_OFFSET 2082844800 |
| 47 | 51 | ||
| 48 | /* | 52 | /* |
| @@ -97,8 +101,11 @@ static time64_t cuda_get_time(void) | |||
| 97 | if (req.reply_len != 7) | 101 | if (req.reply_len != 7) |
| 98 | printk(KERN_ERR "cuda_get_time: got %d byte reply\n", | 102 | printk(KERN_ERR "cuda_get_time: got %d byte reply\n", |
| 99 | req.reply_len); | 103 | req.reply_len); |
| 100 | now = (req.reply[3] << 24) + (req.reply[4] << 16) | 104 | now = (u32)((req.reply[3] << 24) + (req.reply[4] << 16) + |
| 101 | + (req.reply[5] << 8) + req.reply[6]; | 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 | return now - RTC_OFFSET; | 109 | return now - RTC_OFFSET; |
| 103 | } | 110 | } |
| 104 | 111 | ||
| @@ -106,10 +113,10 @@ static time64_t cuda_get_time(void) | |||
| 106 | 113 | ||
| 107 | static int cuda_set_rtc_time(struct rtc_time *tm) | 114 | static int cuda_set_rtc_time(struct rtc_time *tm) |
| 108 | { | 115 | { |
| 109 | time64_t nowtime; | 116 | u32 nowtime; |
| 110 | struct adb_request req; | 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 | if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, | 120 | if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, |
| 114 | nowtime >> 24, nowtime >> 16, nowtime >> 8, | 121 | nowtime >> 24, nowtime >> 16, nowtime >> 8, |
| 115 | nowtime) < 0) | 122 | nowtime) < 0) |
| @@ -140,8 +147,12 @@ static time64_t pmu_get_time(void) | |||
| 140 | if (req.reply_len != 4) | 147 | if (req.reply_len != 4) |
| 141 | printk(KERN_ERR "pmu_get_time: got %d byte reply from PMU\n", | 148 | printk(KERN_ERR "pmu_get_time: got %d byte reply from PMU\n", |
| 142 | req.reply_len); | 149 | req.reply_len); |
| 143 | now = (req.reply[0] << 24) + (req.reply[1] << 16) | 150 | now = (u32)((req.reply[0] << 24) + (req.reply[1] << 16) + |
| 144 | + (req.reply[2] << 8) + req.reply[3]; | 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 | return now - RTC_OFFSET; | 156 | return now - RTC_OFFSET; |
| 146 | } | 157 | } |
| 147 | 158 | ||
| @@ -149,10 +160,10 @@ static time64_t pmu_get_time(void) | |||
| 149 | 160 | ||
| 150 | static int pmu_set_rtc_time(struct rtc_time *tm) | 161 | static int pmu_set_rtc_time(struct rtc_time *tm) |
| 151 | { | 162 | { |
| 152 | time64_t nowtime; | 163 | u32 nowtime; |
| 153 | struct adb_request req; | 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 | if (pmu_request(&req, NULL, 5, PMU_SET_RTC, nowtime >> 24, | 167 | if (pmu_request(&req, NULL, 5, PMU_SET_RTC, nowtime >> 24, |
| 157 | nowtime >> 16, nowtime >> 8, nowtime) < 0) | 168 | nowtime >> 16, nowtime >> 8, nowtime) < 0) |
| 158 | return -ENXIO; | 169 | return -ENXIO; |
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index f12680c9b947..4764fdeb4f1f 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig | |||
| @@ -107,6 +107,7 @@ config ARCH_RV32I | |||
| 107 | select GENERIC_LIB_ASHLDI3 | 107 | select GENERIC_LIB_ASHLDI3 |
| 108 | select GENERIC_LIB_ASHRDI3 | 108 | select GENERIC_LIB_ASHRDI3 |
| 109 | select GENERIC_LIB_LSHRDI3 | 109 | select GENERIC_LIB_LSHRDI3 |
| 110 | select GENERIC_LIB_UCMPDI2 | ||
| 110 | 111 | ||
| 111 | config ARCH_RV64I | 112 | config ARCH_RV64I |
| 112 | bool "RV64I" | 113 | bool "RV64I" |
diff --git a/arch/riscv/include/uapi/asm/elf.h b/arch/riscv/include/uapi/asm/elf.h index 5cae4c30cd8e..1e0dfc36aab9 100644 --- a/arch/riscv/include/uapi/asm/elf.h +++ b/arch/riscv/include/uapi/asm/elf.h | |||
| @@ -21,8 +21,13 @@ typedef struct user_regs_struct elf_gregset_t; | |||
| 21 | 21 | ||
| 22 | typedef union __riscv_fp_state elf_fpregset_t; | 22 | typedef union __riscv_fp_state elf_fpregset_t; |
| 23 | 23 | ||
| 24 | #define ELF_RISCV_R_SYM(r_info) ((r_info) >> 32) | 24 | #if __riscv_xlen == 64 |
| 25 | #define ELF_RISCV_R_TYPE(r_info) ((r_info) & 0xffffffff) | 25 | #define ELF_RISCV_R_SYM(r_info) ELF64_R_SYM(r_info) |
| 26 | #define ELF_RISCV_R_TYPE(r_info) ELF64_R_TYPE(r_info) | ||
| 27 | #else | ||
| 28 | #define ELF_RISCV_R_SYM(r_info) ELF32_R_SYM(r_info) | ||
| 29 | #define ELF_RISCV_R_TYPE(r_info) ELF32_R_TYPE(r_info) | ||
| 30 | #endif | ||
| 26 | 31 | ||
| 27 | /* | 32 | /* |
| 28 | * RISC-V relocation types | 33 | * RISC-V relocation types |
diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c index b74cbfbce2d0..7bcdaed15703 100644 --- a/arch/riscv/kernel/irq.c +++ b/arch/riscv/kernel/irq.c | |||
| @@ -16,10 +16,6 @@ | |||
| 16 | #include <linux/irqchip.h> | 16 | #include <linux/irqchip.h> |
| 17 | #include <linux/irqdomain.h> | 17 | #include <linux/irqdomain.h> |
| 18 | 18 | ||
| 19 | #ifdef CONFIG_RISCV_INTC | ||
| 20 | #include <linux/irqchip/irq-riscv-intc.h> | ||
| 21 | #endif | ||
| 22 | |||
| 23 | void __init init_IRQ(void) | 19 | void __init init_IRQ(void) |
| 24 | { | 20 | { |
| 25 | irqchip_init(); | 21 | irqchip_init(); |
diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c index 1d5e9b934b8c..3303ed2cd419 100644 --- a/arch/riscv/kernel/module.c +++ b/arch/riscv/kernel/module.c | |||
| @@ -37,7 +37,7 @@ static int apply_r_riscv_64_rela(struct module *me, u32 *location, Elf_Addr v) | |||
| 37 | static int apply_r_riscv_branch_rela(struct module *me, u32 *location, | 37 | static int apply_r_riscv_branch_rela(struct module *me, u32 *location, |
| 38 | Elf_Addr v) | 38 | Elf_Addr v) |
| 39 | { | 39 | { |
| 40 | s64 offset = (void *)v - (void *)location; | 40 | ptrdiff_t offset = (void *)v - (void *)location; |
| 41 | u32 imm12 = (offset & 0x1000) << (31 - 12); | 41 | u32 imm12 = (offset & 0x1000) << (31 - 12); |
| 42 | u32 imm11 = (offset & 0x800) >> (11 - 7); | 42 | u32 imm11 = (offset & 0x800) >> (11 - 7); |
| 43 | u32 imm10_5 = (offset & 0x7e0) << (30 - 10); | 43 | u32 imm10_5 = (offset & 0x7e0) << (30 - 10); |
| @@ -50,7 +50,7 @@ static int apply_r_riscv_branch_rela(struct module *me, u32 *location, | |||
| 50 | static int apply_r_riscv_jal_rela(struct module *me, u32 *location, | 50 | static int apply_r_riscv_jal_rela(struct module *me, u32 *location, |
| 51 | Elf_Addr v) | 51 | Elf_Addr v) |
| 52 | { | 52 | { |
| 53 | s64 offset = (void *)v - (void *)location; | 53 | ptrdiff_t offset = (void *)v - (void *)location; |
| 54 | u32 imm20 = (offset & 0x100000) << (31 - 20); | 54 | u32 imm20 = (offset & 0x100000) << (31 - 20); |
| 55 | u32 imm19_12 = (offset & 0xff000); | 55 | u32 imm19_12 = (offset & 0xff000); |
| 56 | u32 imm11 = (offset & 0x800) << (20 - 11); | 56 | u32 imm11 = (offset & 0x800) << (20 - 11); |
| @@ -63,7 +63,7 @@ static int apply_r_riscv_jal_rela(struct module *me, u32 *location, | |||
| 63 | static int apply_r_riscv_rcv_branch_rela(struct module *me, u32 *location, | 63 | static int apply_r_riscv_rcv_branch_rela(struct module *me, u32 *location, |
| 64 | Elf_Addr v) | 64 | Elf_Addr v) |
| 65 | { | 65 | { |
| 66 | s64 offset = (void *)v - (void *)location; | 66 | ptrdiff_t offset = (void *)v - (void *)location; |
| 67 | u16 imm8 = (offset & 0x100) << (12 - 8); | 67 | u16 imm8 = (offset & 0x100) << (12 - 8); |
| 68 | u16 imm7_6 = (offset & 0xc0) >> (6 - 5); | 68 | u16 imm7_6 = (offset & 0xc0) >> (6 - 5); |
| 69 | u16 imm5 = (offset & 0x20) >> (5 - 2); | 69 | u16 imm5 = (offset & 0x20) >> (5 - 2); |
| @@ -78,7 +78,7 @@ static int apply_r_riscv_rcv_branch_rela(struct module *me, u32 *location, | |||
| 78 | static int apply_r_riscv_rvc_jump_rela(struct module *me, u32 *location, | 78 | static int apply_r_riscv_rvc_jump_rela(struct module *me, u32 *location, |
| 79 | Elf_Addr v) | 79 | Elf_Addr v) |
| 80 | { | 80 | { |
| 81 | s64 offset = (void *)v - (void *)location; | 81 | ptrdiff_t offset = (void *)v - (void *)location; |
| 82 | u16 imm11 = (offset & 0x800) << (12 - 11); | 82 | u16 imm11 = (offset & 0x800) << (12 - 11); |
| 83 | u16 imm10 = (offset & 0x400) >> (10 - 8); | 83 | u16 imm10 = (offset & 0x400) >> (10 - 8); |
| 84 | u16 imm9_8 = (offset & 0x300) << (12 - 11); | 84 | u16 imm9_8 = (offset & 0x300) << (12 - 11); |
| @@ -96,7 +96,7 @@ static int apply_r_riscv_rvc_jump_rela(struct module *me, u32 *location, | |||
| 96 | static int apply_r_riscv_pcrel_hi20_rela(struct module *me, u32 *location, | 96 | static int apply_r_riscv_pcrel_hi20_rela(struct module *me, u32 *location, |
| 97 | Elf_Addr v) | 97 | Elf_Addr v) |
| 98 | { | 98 | { |
| 99 | s64 offset = (void *)v - (void *)location; | 99 | ptrdiff_t offset = (void *)v - (void *)location; |
| 100 | s32 hi20; | 100 | s32 hi20; |
| 101 | 101 | ||
| 102 | if (offset != (s32)offset) { | 102 | if (offset != (s32)offset) { |
| @@ -178,7 +178,7 @@ static int apply_r_riscv_lo12_s_rela(struct module *me, u32 *location, | |||
| 178 | static int apply_r_riscv_got_hi20_rela(struct module *me, u32 *location, | 178 | static int apply_r_riscv_got_hi20_rela(struct module *me, u32 *location, |
| 179 | Elf_Addr v) | 179 | Elf_Addr v) |
| 180 | { | 180 | { |
| 181 | s64 offset = (void *)v - (void *)location; | 181 | ptrdiff_t offset = (void *)v - (void *)location; |
| 182 | s32 hi20; | 182 | s32 hi20; |
| 183 | 183 | ||
| 184 | /* Always emit the got entry */ | 184 | /* Always emit the got entry */ |
| @@ -200,7 +200,7 @@ static int apply_r_riscv_got_hi20_rela(struct module *me, u32 *location, | |||
| 200 | static int apply_r_riscv_call_plt_rela(struct module *me, u32 *location, | 200 | static int apply_r_riscv_call_plt_rela(struct module *me, u32 *location, |
| 201 | Elf_Addr v) | 201 | Elf_Addr v) |
| 202 | { | 202 | { |
| 203 | s64 offset = (void *)v - (void *)location; | 203 | ptrdiff_t offset = (void *)v - (void *)location; |
| 204 | s32 fill_v = offset; | 204 | s32 fill_v = offset; |
| 205 | u32 hi20, lo12; | 205 | u32 hi20, lo12; |
| 206 | 206 | ||
| @@ -227,7 +227,7 @@ static int apply_r_riscv_call_plt_rela(struct module *me, u32 *location, | |||
| 227 | static int apply_r_riscv_call_rela(struct module *me, u32 *location, | 227 | static int apply_r_riscv_call_rela(struct module *me, u32 *location, |
| 228 | Elf_Addr v) | 228 | Elf_Addr v) |
| 229 | { | 229 | { |
| 230 | s64 offset = (void *)v - (void *)location; | 230 | ptrdiff_t offset = (void *)v - (void *)location; |
| 231 | s32 fill_v = offset; | 231 | s32 fill_v = offset; |
| 232 | u32 hi20, lo12; | 232 | u32 hi20, lo12; |
| 233 | 233 | ||
| @@ -263,14 +263,14 @@ static int apply_r_riscv_align_rela(struct module *me, u32 *location, | |||
| 263 | static int apply_r_riscv_add32_rela(struct module *me, u32 *location, | 263 | static int apply_r_riscv_add32_rela(struct module *me, u32 *location, |
| 264 | Elf_Addr v) | 264 | Elf_Addr v) |
| 265 | { | 265 | { |
| 266 | *(u32 *)location += (*(u32 *)v); | 266 | *(u32 *)location += (u32)v; |
| 267 | return 0; | 267 | return 0; |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | static int apply_r_riscv_sub32_rela(struct module *me, u32 *location, | 270 | static int apply_r_riscv_sub32_rela(struct module *me, u32 *location, |
| 271 | Elf_Addr v) | 271 | Elf_Addr v) |
| 272 | { | 272 | { |
| 273 | *(u32 *)location -= (*(u32 *)v); | 273 | *(u32 *)location -= (u32)v; |
| 274 | return 0; | 274 | return 0; |
| 275 | } | 275 | } |
| 276 | 276 | ||
| @@ -347,7 +347,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, | |||
| 347 | unsigned int j; | 347 | unsigned int j; |
| 348 | 348 | ||
| 349 | for (j = 0; j < sechdrs[relsec].sh_size / sizeof(*rel); j++) { | 349 | for (j = 0; j < sechdrs[relsec].sh_size / sizeof(*rel); j++) { |
| 350 | u64 hi20_loc = | 350 | unsigned long hi20_loc = |
| 351 | sechdrs[sechdrs[relsec].sh_info].sh_addr | 351 | sechdrs[sechdrs[relsec].sh_info].sh_addr |
| 352 | + rel[j].r_offset; | 352 | + rel[j].r_offset; |
| 353 | u32 hi20_type = ELF_RISCV_R_TYPE(rel[j].r_info); | 353 | u32 hi20_type = ELF_RISCV_R_TYPE(rel[j].r_info); |
| @@ -360,12 +360,12 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, | |||
| 360 | Elf_Sym *hi20_sym = | 360 | Elf_Sym *hi20_sym = |
| 361 | (Elf_Sym *)sechdrs[symindex].sh_addr | 361 | (Elf_Sym *)sechdrs[symindex].sh_addr |
| 362 | + ELF_RISCV_R_SYM(rel[j].r_info); | 362 | + ELF_RISCV_R_SYM(rel[j].r_info); |
| 363 | u64 hi20_sym_val = | 363 | unsigned long hi20_sym_val = |
| 364 | hi20_sym->st_value | 364 | hi20_sym->st_value |
| 365 | + rel[j].r_addend; | 365 | + rel[j].r_addend; |
| 366 | 366 | ||
| 367 | /* Calculate lo12 */ | 367 | /* Calculate lo12 */ |
| 368 | u64 offset = hi20_sym_val - hi20_loc; | 368 | size_t offset = hi20_sym_val - hi20_loc; |
| 369 | if (IS_ENABLED(CONFIG_MODULE_SECTIONS) | 369 | if (IS_ENABLED(CONFIG_MODULE_SECTIONS) |
| 370 | && hi20_type == R_RISCV_GOT_HI20) { | 370 | && hi20_type == R_RISCV_GOT_HI20) { |
| 371 | offset = module_emit_got_entry( | 371 | offset = module_emit_got_entry( |
diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c index ba3e80712797..9f82a7e34c64 100644 --- a/arch/riscv/kernel/ptrace.c +++ b/arch/riscv/kernel/ptrace.c | |||
| @@ -50,7 +50,7 @@ static int riscv_gpr_set(struct task_struct *target, | |||
| 50 | struct pt_regs *regs; | 50 | struct pt_regs *regs; |
| 51 | 51 | ||
| 52 | regs = task_pt_regs(target); | 52 | regs = task_pt_regs(target); |
| 53 | ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, ®s, 0, -1); | 53 | ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, regs, 0, -1); |
| 54 | return ret; | 54 | return ret; |
| 55 | } | 55 | } |
| 56 | 56 | ||
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index ee44a48faf79..f0d2070866d4 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c | |||
| @@ -220,8 +220,3 @@ void __init setup_arch(char **cmdline_p) | |||
| 220 | riscv_fill_hwcap(); | 220 | riscv_fill_hwcap(); |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | static int __init riscv_device_init(void) | ||
| 224 | { | ||
| 225 | return of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
| 226 | } | ||
| 227 | subsys_initcall_sync(riscv_device_init); | ||
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index c77df8142be2..58a522f9bcc3 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c | |||
| @@ -28,7 +28,9 @@ static void __init zone_sizes_init(void) | |||
| 28 | { | 28 | { |
| 29 | unsigned long max_zone_pfns[MAX_NR_ZONES] = { 0, }; | 29 | unsigned long max_zone_pfns[MAX_NR_ZONES] = { 0, }; |
| 30 | 30 | ||
| 31 | #ifdef CONFIG_ZONE_DMA32 | ||
| 31 | max_zone_pfns[ZONE_DMA32] = PFN_DOWN(min(4UL * SZ_1G, max_low_pfn)); | 32 | max_zone_pfns[ZONE_DMA32] = PFN_DOWN(min(4UL * SZ_1G, max_low_pfn)); |
| 33 | #endif | ||
| 32 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; | 34 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; |
| 33 | 35 | ||
| 34 | free_area_init_nodes(max_zone_pfns); | 36 | free_area_init_nodes(max_zone_pfns); |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index baed39772c84..e44bb2b2873e 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
| @@ -160,6 +160,7 @@ config S390 | |||
| 160 | select HAVE_OPROFILE | 160 | select HAVE_OPROFILE |
| 161 | select HAVE_PERF_EVENTS | 161 | select HAVE_PERF_EVENTS |
| 162 | select HAVE_REGS_AND_STACK_ACCESS_API | 162 | select HAVE_REGS_AND_STACK_ACCESS_API |
| 163 | select HAVE_RSEQ | ||
| 163 | select HAVE_SYSCALL_TRACEPOINTS | 164 | select HAVE_SYSCALL_TRACEPOINTS |
| 164 | select HAVE_VIRT_CPU_ACCOUNTING | 165 | select HAVE_VIRT_CPU_ACCOUNTING |
| 165 | select MODULES_USE_ELF_RELA | 166 | select MODULES_USE_ELF_RELA |
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c index 607c5e9fba3d..2ce28bf0c5ec 100644 --- a/arch/s390/kernel/compat_wrapper.c +++ b/arch/s390/kernel/compat_wrapper.c | |||
| @@ -183,3 +183,4 @@ COMPAT_SYSCALL_WRAP2(s390_guarded_storage, int, command, struct gs_cb *, gs_cb); | |||
| 183 | COMPAT_SYSCALL_WRAP5(statx, int, dfd, const char __user *, path, unsigned, flags, unsigned, mask, struct statx __user *, buffer); | 183 | COMPAT_SYSCALL_WRAP5(statx, int, dfd, const char __user *, path, unsigned, flags, unsigned, mask, struct statx __user *, buffer); |
| 184 | COMPAT_SYSCALL_WRAP4(s390_sthyi, unsigned long, code, void __user *, info, u64 __user *, rc, unsigned long, flags); | 184 | COMPAT_SYSCALL_WRAP4(s390_sthyi, unsigned long, code, void __user *, info, u64 __user *, rc, unsigned long, flags); |
| 185 | COMPAT_SYSCALL_WRAP5(kexec_file_load, int, kernel_fd, int, initrd_fd, unsigned long, cmdline_len, const char __user *, cmdline_ptr, unsigned long, flags) | 185 | COMPAT_SYSCALL_WRAP5(kexec_file_load, int, kernel_fd, int, initrd_fd, unsigned long, cmdline_len, const char __user *, cmdline_ptr, unsigned long, flags) |
| 186 | COMPAT_SYSCALL_WRAP4(rseq, struct rseq __user *, rseq, u32, rseq_len, int, flags, u32, sig) | ||
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index f03402efab4b..150130c897c3 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S | |||
| @@ -357,6 +357,10 @@ ENTRY(system_call) | |||
| 357 | stg %r2,__PT_R2(%r11) # store return value | 357 | stg %r2,__PT_R2(%r11) # store return value |
| 358 | 358 | ||
| 359 | .Lsysc_return: | 359 | .Lsysc_return: |
| 360 | #ifdef CONFIG_DEBUG_RSEQ | ||
| 361 | lgr %r2,%r11 | ||
| 362 | brasl %r14,rseq_syscall | ||
| 363 | #endif | ||
| 360 | LOCKDEP_SYS_EXIT | 364 | LOCKDEP_SYS_EXIT |
| 361 | .Lsysc_tif: | 365 | .Lsysc_tif: |
| 362 | TSTMSK __PT_FLAGS(%r11),_PIF_WORK | 366 | TSTMSK __PT_FLAGS(%r11),_PIF_WORK |
| @@ -1265,7 +1269,7 @@ cleanup_critical: | |||
| 1265 | jl 0f | 1269 | jl 0f |
| 1266 | clg %r9,BASED(.Lcleanup_table+104) # .Lload_fpu_regs_end | 1270 | clg %r9,BASED(.Lcleanup_table+104) # .Lload_fpu_regs_end |
| 1267 | jl .Lcleanup_load_fpu_regs | 1271 | jl .Lcleanup_load_fpu_regs |
| 1268 | 0: BR_EX %r14 | 1272 | 0: BR_EX %r14,%r11 |
| 1269 | 1273 | ||
| 1270 | .align 8 | 1274 | .align 8 |
| 1271 | .Lcleanup_table: | 1275 | .Lcleanup_table: |
| @@ -1301,7 +1305,7 @@ cleanup_critical: | |||
| 1301 | ni __SIE_PROG0C+3(%r9),0xfe # no longer in SIE | 1305 | ni __SIE_PROG0C+3(%r9),0xfe # no longer in SIE |
| 1302 | lctlg %c1,%c1,__LC_USER_ASCE # load primary asce | 1306 | lctlg %c1,%c1,__LC_USER_ASCE # load primary asce |
| 1303 | larl %r9,sie_exit # skip forward to sie_exit | 1307 | larl %r9,sie_exit # skip forward to sie_exit |
| 1304 | BR_EX %r14 | 1308 | BR_EX %r14,%r11 |
| 1305 | #endif | 1309 | #endif |
| 1306 | 1310 | ||
| 1307 | .Lcleanup_system_call: | 1311 | .Lcleanup_system_call: |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index 2d2960ab3e10..22f08245aa5d 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
| @@ -498,7 +498,7 @@ void do_signal(struct pt_regs *regs) | |||
| 498 | } | 498 | } |
| 499 | /* No longer in a system call */ | 499 | /* No longer in a system call */ |
| 500 | clear_pt_regs_flag(regs, PIF_SYSCALL); | 500 | clear_pt_regs_flag(regs, PIF_SYSCALL); |
| 501 | 501 | rseq_signal_deliver(&ksig, regs); | |
| 502 | if (is_compat_task()) | 502 | if (is_compat_task()) |
| 503 | handle_signal32(&ksig, oldset, regs); | 503 | handle_signal32(&ksig, oldset, regs); |
| 504 | else | 504 | else |
| @@ -537,4 +537,5 @@ void do_notify_resume(struct pt_regs *regs) | |||
| 537 | { | 537 | { |
| 538 | clear_thread_flag(TIF_NOTIFY_RESUME); | 538 | clear_thread_flag(TIF_NOTIFY_RESUME); |
| 539 | tracehook_notify_resume(regs); | 539 | tracehook_notify_resume(regs); |
| 540 | rseq_handle_notify_resume(NULL, regs); | ||
| 540 | } | 541 | } |
diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl index 8b210ead7956..022fc099b628 100644 --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl | |||
| @@ -389,3 +389,5 @@ | |||
| 389 | 379 common statx sys_statx compat_sys_statx | 389 | 379 common statx sys_statx compat_sys_statx |
| 390 | 380 common s390_sthyi sys_s390_sthyi compat_sys_s390_sthyi | 390 | 380 common s390_sthyi sys_s390_sthyi compat_sys_s390_sthyi |
| 391 | 381 common kexec_file_load sys_kexec_file_load compat_sys_kexec_file_load | 391 | 381 common kexec_file_load sys_kexec_file_load compat_sys_kexec_file_load |
| 392 | 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents | ||
| 393 | 383 common rseq sys_rseq compat_sys_rseq | ||
diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c index 84bd6329a88d..e3bd5627afef 100644 --- a/arch/s390/mm/pgalloc.c +++ b/arch/s390/mm/pgalloc.c | |||
| @@ -252,6 +252,8 @@ void page_table_free(struct mm_struct *mm, unsigned long *table) | |||
| 252 | spin_unlock_bh(&mm->context.lock); | 252 | spin_unlock_bh(&mm->context.lock); |
| 253 | if (mask != 0) | 253 | if (mask != 0) |
| 254 | return; | 254 | return; |
| 255 | } else { | ||
| 256 | atomic_xor_bits(&page->_refcount, 3U << 24); | ||
| 255 | } | 257 | } |
| 256 | 258 | ||
| 257 | pgtable_page_dtor(page); | 259 | pgtable_page_dtor(page); |
| @@ -304,6 +306,8 @@ static void __tlb_remove_table(void *_table) | |||
| 304 | break; | 306 | break; |
| 305 | /* fallthrough */ | 307 | /* fallthrough */ |
| 306 | case 3: /* 4K page table with pgstes */ | 308 | case 3: /* 4K page table with pgstes */ |
| 309 | if (mask & 3) | ||
| 310 | atomic_xor_bits(&page->_refcount, 3 << 24); | ||
| 307 | pgtable_page_dtor(page); | 311 | pgtable_page_dtor(page); |
| 308 | __free_page(page); | 312 | __free_page(page); |
| 309 | break; | 313 | break; |
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index d2db8acb1a55..5f0234ec8038 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c | |||
| @@ -1286,6 +1286,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) | |||
| 1286 | goto free_addrs; | 1286 | goto free_addrs; |
| 1287 | } | 1287 | } |
| 1288 | if (bpf_jit_prog(&jit, fp)) { | 1288 | if (bpf_jit_prog(&jit, fp)) { |
| 1289 | bpf_jit_binary_free(header); | ||
| 1289 | fp = orig_fp; | 1290 | fp = orig_fp; |
| 1290 | goto free_addrs; | 1291 | goto free_addrs; |
| 1291 | } | 1292 | } |
diff --git a/arch/x86/crypto/aegis128-aesni-asm.S b/arch/x86/crypto/aegis128-aesni-asm.S index 9254e0b6cc06..717bf0776421 100644 --- a/arch/x86/crypto/aegis128-aesni-asm.S +++ b/arch/x86/crypto/aegis128-aesni-asm.S | |||
| @@ -535,6 +535,7 @@ ENTRY(crypto_aegis128_aesni_enc_tail) | |||
| 535 | movdqu STATE3, 0x40(STATEP) | 535 | movdqu STATE3, 0x40(STATEP) |
| 536 | 536 | ||
| 537 | FRAME_END | 537 | FRAME_END |
| 538 | ret | ||
| 538 | ENDPROC(crypto_aegis128_aesni_enc_tail) | 539 | ENDPROC(crypto_aegis128_aesni_enc_tail) |
| 539 | 540 | ||
| 540 | .macro decrypt_block a s0 s1 s2 s3 s4 i | 541 | .macro decrypt_block a s0 s1 s2 s3 s4 i |
diff --git a/arch/x86/crypto/aegis128l-aesni-asm.S b/arch/x86/crypto/aegis128l-aesni-asm.S index 9263c344f2c7..4eda2b8db9e1 100644 --- a/arch/x86/crypto/aegis128l-aesni-asm.S +++ b/arch/x86/crypto/aegis128l-aesni-asm.S | |||
| @@ -645,6 +645,7 @@ ENTRY(crypto_aegis128l_aesni_enc_tail) | |||
| 645 | state_store0 | 645 | state_store0 |
| 646 | 646 | ||
| 647 | FRAME_END | 647 | FRAME_END |
| 648 | ret | ||
| 648 | ENDPROC(crypto_aegis128l_aesni_enc_tail) | 649 | ENDPROC(crypto_aegis128l_aesni_enc_tail) |
| 649 | 650 | ||
| 650 | /* | 651 | /* |
diff --git a/arch/x86/crypto/aegis256-aesni-asm.S b/arch/x86/crypto/aegis256-aesni-asm.S index 1d977d515bf9..32aae8397268 100644 --- a/arch/x86/crypto/aegis256-aesni-asm.S +++ b/arch/x86/crypto/aegis256-aesni-asm.S | |||
| @@ -543,6 +543,7 @@ ENTRY(crypto_aegis256_aesni_enc_tail) | |||
| 543 | state_store0 | 543 | state_store0 |
| 544 | 544 | ||
| 545 | FRAME_END | 545 | FRAME_END |
| 546 | ret | ||
| 546 | ENDPROC(crypto_aegis256_aesni_enc_tail) | 547 | ENDPROC(crypto_aegis256_aesni_enc_tail) |
| 547 | 548 | ||
| 548 | /* | 549 | /* |
diff --git a/arch/x86/crypto/morus1280-avx2-asm.S b/arch/x86/crypto/morus1280-avx2-asm.S index 37d422e77931..07653d4582a6 100644 --- a/arch/x86/crypto/morus1280-avx2-asm.S +++ b/arch/x86/crypto/morus1280-avx2-asm.S | |||
| @@ -453,6 +453,7 @@ ENTRY(crypto_morus1280_avx2_enc_tail) | |||
| 453 | vmovdqu STATE4, (4 * 32)(%rdi) | 453 | vmovdqu STATE4, (4 * 32)(%rdi) |
| 454 | 454 | ||
| 455 | FRAME_END | 455 | FRAME_END |
| 456 | ret | ||
| 456 | ENDPROC(crypto_morus1280_avx2_enc_tail) | 457 | ENDPROC(crypto_morus1280_avx2_enc_tail) |
| 457 | 458 | ||
| 458 | /* | 459 | /* |
diff --git a/arch/x86/crypto/morus1280-sse2-asm.S b/arch/x86/crypto/morus1280-sse2-asm.S index 1fe637c7be9d..bd1aa1b60869 100644 --- a/arch/x86/crypto/morus1280-sse2-asm.S +++ b/arch/x86/crypto/morus1280-sse2-asm.S | |||
| @@ -652,6 +652,7 @@ ENTRY(crypto_morus1280_sse2_enc_tail) | |||
| 652 | movdqu STATE4_HI, (9 * 16)(%rdi) | 652 | movdqu STATE4_HI, (9 * 16)(%rdi) |
| 653 | 653 | ||
| 654 | FRAME_END | 654 | FRAME_END |
| 655 | ret | ||
| 655 | ENDPROC(crypto_morus1280_sse2_enc_tail) | 656 | ENDPROC(crypto_morus1280_sse2_enc_tail) |
| 656 | 657 | ||
| 657 | /* | 658 | /* |
diff --git a/arch/x86/crypto/morus640-sse2-asm.S b/arch/x86/crypto/morus640-sse2-asm.S index 71c72a0a0862..efa02816d921 100644 --- a/arch/x86/crypto/morus640-sse2-asm.S +++ b/arch/x86/crypto/morus640-sse2-asm.S | |||
| @@ -437,6 +437,7 @@ ENTRY(crypto_morus640_sse2_enc_tail) | |||
| 437 | movdqu STATE4, (4 * 16)(%rdi) | 437 | movdqu STATE4, (4 * 16)(%rdi) |
| 438 | 438 | ||
| 439 | FRAME_END | 439 | FRAME_END |
| 440 | ret | ||
| 440 | ENDPROC(crypto_morus640_sse2_enc_tail) | 441 | ENDPROC(crypto_morus640_sse2_enc_tail) |
| 441 | 442 | ||
| 442 | /* | 443 | /* |
diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S index 2582881d19ce..c371bfee137a 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S | |||
| @@ -477,7 +477,7 @@ ENTRY(entry_SYSENTER_32) | |||
| 477 | * whereas POPF does not.) | 477 | * whereas POPF does not.) |
| 478 | */ | 478 | */ |
| 479 | addl $PT_EFLAGS-PT_DS, %esp /* point esp at pt_regs->flags */ | 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 | popfl | 481 | popfl |
| 482 | 482 | ||
| 483 | /* | 483 | /* |
diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S index 9de7f1e1dede..7d0df78db727 100644 --- a/arch/x86/entry/entry_64_compat.S +++ b/arch/x86/entry/entry_64_compat.S | |||
| @@ -84,13 +84,13 @@ ENTRY(entry_SYSENTER_compat) | |||
| 84 | pushq %rdx /* pt_regs->dx */ | 84 | pushq %rdx /* pt_regs->dx */ |
| 85 | pushq %rcx /* pt_regs->cx */ | 85 | pushq %rcx /* pt_regs->cx */ |
| 86 | pushq $-ENOSYS /* pt_regs->ax */ | 86 | pushq $-ENOSYS /* pt_regs->ax */ |
| 87 | pushq %r8 /* pt_regs->r8 */ | 87 | pushq $0 /* pt_regs->r8 = 0 */ |
| 88 | xorl %r8d, %r8d /* nospec r8 */ | 88 | xorl %r8d, %r8d /* nospec r8 */ |
| 89 | pushq %r9 /* pt_regs->r9 */ | 89 | pushq $0 /* pt_regs->r9 = 0 */ |
| 90 | xorl %r9d, %r9d /* nospec r9 */ | 90 | xorl %r9d, %r9d /* nospec r9 */ |
| 91 | pushq %r10 /* pt_regs->r10 */ | 91 | pushq $0 /* pt_regs->r10 = 0 */ |
| 92 | xorl %r10d, %r10d /* nospec r10 */ | 92 | xorl %r10d, %r10d /* nospec r10 */ |
| 93 | pushq %r11 /* pt_regs->r11 */ | 93 | pushq $0 /* pt_regs->r11 = 0 */ |
| 94 | xorl %r11d, %r11d /* nospec r11 */ | 94 | xorl %r11d, %r11d /* nospec r11 */ |
| 95 | pushq %rbx /* pt_regs->rbx */ | 95 | pushq %rbx /* pt_regs->rbx */ |
| 96 | xorl %ebx, %ebx /* nospec rbx */ | 96 | xorl %ebx, %ebx /* nospec rbx */ |
| @@ -374,13 +374,13 @@ ENTRY(entry_INT80_compat) | |||
| 374 | pushq %rcx /* pt_regs->cx */ | 374 | pushq %rcx /* pt_regs->cx */ |
| 375 | xorl %ecx, %ecx /* nospec cx */ | 375 | xorl %ecx, %ecx /* nospec cx */ |
| 376 | pushq $-ENOSYS /* pt_regs->ax */ | 376 | pushq $-ENOSYS /* pt_regs->ax */ |
| 377 | pushq $0 /* pt_regs->r8 = 0 */ | 377 | pushq %r8 /* pt_regs->r8 */ |
| 378 | xorl %r8d, %r8d /* nospec r8 */ | 378 | xorl %r8d, %r8d /* nospec r8 */ |
| 379 | pushq $0 /* pt_regs->r9 = 0 */ | 379 | pushq %r9 /* pt_regs->r9 */ |
| 380 | xorl %r9d, %r9d /* nospec r9 */ | 380 | xorl %r9d, %r9d /* nospec r9 */ |
| 381 | pushq $0 /* pt_regs->r10 = 0 */ | 381 | pushq %r10 /* pt_regs->r10*/ |
| 382 | xorl %r10d, %r10d /* nospec r10 */ | 382 | xorl %r10d, %r10d /* nospec r10 */ |
| 383 | pushq $0 /* pt_regs->r11 = 0 */ | 383 | pushq %r11 /* pt_regs->r11 */ |
| 384 | xorl %r11d, %r11d /* nospec r11 */ | 384 | xorl %r11d, %r11d /* nospec r11 */ |
| 385 | pushq %rbx /* pt_regs->rbx */ | 385 | pushq %rbx /* pt_regs->rbx */ |
| 386 | xorl %ebx, %ebx /* nospec rbx */ | 386 | xorl %ebx, %ebx /* nospec rbx */ |
diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c index f68855499391..402338365651 100644 --- a/arch/x86/hyperv/hv_apic.c +++ b/arch/x86/hyperv/hv_apic.c | |||
| @@ -114,6 +114,8 @@ static bool __send_ipi_mask_ex(const struct cpumask *mask, int vector) | |||
| 114 | ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K; | 114 | ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K; |
| 115 | nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask); | 115 | nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask); |
| 116 | } | 116 | } |
| 117 | if (nr_bank < 0) | ||
| 118 | goto ipi_mask_ex_done; | ||
| 117 | if (!nr_bank) | 119 | if (!nr_bank) |
| 118 | ipi_arg->vp_set.format = HV_GENERIC_SET_ALL; | 120 | ipi_arg->vp_set.format = HV_GENERIC_SET_ALL; |
| 119 | 121 | ||
| @@ -158,6 +160,9 @@ static bool __send_ipi_mask(const struct cpumask *mask, int vector) | |||
| 158 | 160 | ||
| 159 | for_each_cpu(cur_cpu, mask) { | 161 | for_each_cpu(cur_cpu, mask) { |
| 160 | vcpu = hv_cpu_number_to_vp_number(cur_cpu); | 162 | vcpu = hv_cpu_number_to_vp_number(cur_cpu); |
| 163 | if (vcpu == VP_INVAL) | ||
| 164 | goto ipi_mask_done; | ||
| 165 | |||
| 161 | /* | 166 | /* |
| 162 | * This particular version of the IPI hypercall can | 167 | * This particular version of the IPI hypercall can |
| 163 | * only target upto 64 CPUs. | 168 | * only target upto 64 CPUs. |
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 4c431e1c1eff..1ff420217298 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c | |||
| @@ -265,7 +265,7 @@ void __init hyperv_init(void) | |||
| 265 | { | 265 | { |
| 266 | u64 guest_id, required_msrs; | 266 | u64 guest_id, required_msrs; |
| 267 | union hv_x64_msr_hypercall_contents hypercall_msr; | 267 | union hv_x64_msr_hypercall_contents hypercall_msr; |
| 268 | int cpuhp; | 268 | int cpuhp, i; |
| 269 | 269 | ||
| 270 | if (x86_hyper_type != X86_HYPER_MS_HYPERV) | 270 | if (x86_hyper_type != X86_HYPER_MS_HYPERV) |
| 271 | return; | 271 | return; |
| @@ -293,6 +293,9 @@ void __init hyperv_init(void) | |||
| 293 | if (!hv_vp_index) | 293 | if (!hv_vp_index) |
| 294 | return; | 294 | return; |
| 295 | 295 | ||
| 296 | for (i = 0; i < num_possible_cpus(); i++) | ||
| 297 | hv_vp_index[i] = VP_INVAL; | ||
| 298 | |||
| 296 | hv_vp_assist_page = kcalloc(num_possible_cpus(), | 299 | hv_vp_assist_page = kcalloc(num_possible_cpus(), |
| 297 | sizeof(*hv_vp_assist_page), GFP_KERNEL); | 300 | sizeof(*hv_vp_assist_page), GFP_KERNEL); |
| 298 | if (!hv_vp_assist_page) { | 301 | if (!hv_vp_assist_page) { |
diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index 219faaec51df..990770f9e76b 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h | |||
| @@ -46,6 +46,65 @@ | |||
| 46 | #define _ASM_SI __ASM_REG(si) | 46 | #define _ASM_SI __ASM_REG(si) |
| 47 | #define _ASM_DI __ASM_REG(di) | 47 | #define _ASM_DI __ASM_REG(di) |
| 48 | 48 | ||
| 49 | #ifndef __x86_64__ | ||
| 50 | /* 32 bit */ | ||
| 51 | |||
| 52 | #define _ASM_ARG1 _ASM_AX | ||
| 53 | #define _ASM_ARG2 _ASM_DX | ||
| 54 | #define _ASM_ARG3 _ASM_CX | ||
| 55 | |||
| 56 | #define _ASM_ARG1L eax | ||
| 57 | #define _ASM_ARG2L edx | ||
| 58 | #define _ASM_ARG3L ecx | ||
| 59 | |||
| 60 | #define _ASM_ARG1W ax | ||
| 61 | #define _ASM_ARG2W dx | ||
| 62 | #define _ASM_ARG3W cx | ||
| 63 | |||
| 64 | #define _ASM_ARG1B al | ||
| 65 | #define _ASM_ARG2B dl | ||
| 66 | #define _ASM_ARG3B cl | ||
| 67 | |||
| 68 | #else | ||
| 69 | /* 64 bit */ | ||
| 70 | |||
| 71 | #define _ASM_ARG1 _ASM_DI | ||
| 72 | #define _ASM_ARG2 _ASM_SI | ||
| 73 | #define _ASM_ARG3 _ASM_DX | ||
| 74 | #define _ASM_ARG4 _ASM_CX | ||
| 75 | #define _ASM_ARG5 r8 | ||
| 76 | #define _ASM_ARG6 r9 | ||
| 77 | |||
| 78 | #define _ASM_ARG1Q rdi | ||
| 79 | #define _ASM_ARG2Q rsi | ||
| 80 | #define _ASM_ARG3Q rdx | ||
| 81 | #define _ASM_ARG4Q rcx | ||
| 82 | #define _ASM_ARG5Q r8 | ||
| 83 | #define _ASM_ARG6Q r9 | ||
| 84 | |||
| 85 | #define _ASM_ARG1L edi | ||
| 86 | #define _ASM_ARG2L esi | ||
| 87 | #define _ASM_ARG3L edx | ||
| 88 | #define _ASM_ARG4L ecx | ||
| 89 | #define _ASM_ARG5L r8d | ||
| 90 | #define _ASM_ARG6L r9d | ||
| 91 | |||
| 92 | #define _ASM_ARG1W di | ||
| 93 | #define _ASM_ARG2W si | ||
| 94 | #define _ASM_ARG3W dx | ||
| 95 | #define _ASM_ARG4W cx | ||
| 96 | #define _ASM_ARG5W r8w | ||
| 97 | #define _ASM_ARG6W r9w | ||
| 98 | |||
| 99 | #define _ASM_ARG1B dil | ||
| 100 | #define _ASM_ARG2B sil | ||
| 101 | #define _ASM_ARG3B dl | ||
| 102 | #define _ASM_ARG4B cl | ||
| 103 | #define _ASM_ARG5B r8b | ||
| 104 | #define _ASM_ARG6B r9b | ||
| 105 | |||
| 106 | #endif | ||
| 107 | |||
| 49 | /* | 108 | /* |
| 50 | * Macros to generate condition code outputs from inline assembly, | 109 | * Macros to generate condition code outputs from inline assembly, |
| 51 | * The output operand must be type "bool". | 110 | * The output operand must be type "bool". |
diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h index 89f08955fff7..c4fc17220df9 100644 --- a/arch/x86/include/asm/irqflags.h +++ b/arch/x86/include/asm/irqflags.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | * Interrupt control: | 13 | * Interrupt control: |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | static inline unsigned long native_save_fl(void) | 16 | extern inline unsigned long native_save_fl(void) |
| 17 | { | 17 | { |
| 18 | unsigned long flags; | 18 | unsigned long flags; |
| 19 | 19 | ||
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 3cd14311edfa..5a7375ed5f7c 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #include <asm/hyperv-tlfs.h> | 9 | #include <asm/hyperv-tlfs.h> |
| 10 | #include <asm/nospec-branch.h> | 10 | #include <asm/nospec-branch.h> |
| 11 | 11 | ||
| 12 | #define VP_INVAL U32_MAX | ||
| 13 | |||
| 12 | struct ms_hyperv_info { | 14 | struct ms_hyperv_info { |
| 13 | u32 features; | 15 | u32 features; |
| 14 | u32 misc_features; | 16 | u32 misc_features; |
| @@ -20,7 +22,6 @@ struct ms_hyperv_info { | |||
| 20 | 22 | ||
| 21 | extern struct ms_hyperv_info ms_hyperv; | 23 | extern struct ms_hyperv_info ms_hyperv; |
| 22 | 24 | ||
| 23 | |||
| 24 | /* | 25 | /* |
| 25 | * Generate the guest ID. | 26 | * Generate the guest ID. |
| 26 | */ | 27 | */ |
| @@ -281,6 +282,8 @@ static inline int cpumask_to_vpset(struct hv_vpset *vpset, | |||
| 281 | */ | 282 | */ |
| 282 | for_each_cpu(cpu, cpus) { | 283 | for_each_cpu(cpu, cpus) { |
| 283 | vcpu = hv_cpu_number_to_vp_number(cpu); | 284 | vcpu = hv_cpu_number_to_vp_number(cpu); |
| 285 | if (vcpu == VP_INVAL) | ||
| 286 | return -1; | ||
| 284 | vcpu_bank = vcpu / 64; | 287 | vcpu_bank = vcpu / 64; |
| 285 | vcpu_offset = vcpu % 64; | 288 | vcpu_offset = vcpu % 64; |
| 286 | __set_bit(vcpu_offset, (unsigned long *) | 289 | __set_bit(vcpu_offset, (unsigned long *) |
diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h index ada6410fd2ec..fbd578daa66e 100644 --- a/arch/x86/include/asm/pgalloc.h +++ b/arch/x86/include/asm/pgalloc.h | |||
| @@ -184,6 +184,9 @@ static inline p4d_t *p4d_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
| 184 | 184 | ||
| 185 | static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d) | 185 | static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d) |
| 186 | { | 186 | { |
| 187 | if (!pgtable_l5_enabled()) | ||
| 188 | return; | ||
| 189 | |||
| 187 | BUG_ON((unsigned long)p4d & (PAGE_SIZE-1)); | 190 | BUG_ON((unsigned long)p4d & (PAGE_SIZE-1)); |
| 188 | free_page((unsigned long)p4d); | 191 | free_page((unsigned long)p4d); |
| 189 | } | 192 | } |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 99ecde23c3ec..5715647fc4fe 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
| @@ -898,7 +898,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd) | |||
| 898 | #define pgd_page(pgd) pfn_to_page(pgd_pfn(pgd)) | 898 | #define pgd_page(pgd) pfn_to_page(pgd_pfn(pgd)) |
| 899 | 899 | ||
| 900 | /* to find an entry in a page-table-directory. */ | 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 | if (!pgtable_l5_enabled()) | 903 | if (!pgtable_l5_enabled()) |
| 904 | return (p4d_t *)pgd; | 904 | return (p4d_t *)pgd; |
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h index 0fdcd21dadbd..3c5385f9a88f 100644 --- a/arch/x86/include/asm/pgtable_64.h +++ b/arch/x86/include/asm/pgtable_64.h | |||
| @@ -216,7 +216,7 @@ static inline pgd_t pti_set_user_pgd(pgd_t *pgdp, pgd_t pgd) | |||
| 216 | } | 216 | } |
| 217 | #endif | 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 | pgd_t pgd; | 221 | pgd_t pgd; |
| 222 | 222 | ||
| @@ -230,7 +230,7 @@ static __always_inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) | |||
| 230 | *p4dp = native_make_p4d(native_pgd_val(pgd)); | 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 | native_set_p4d(p4d, native_make_p4d(0)); | 235 | native_set_p4d(p4d, native_make_p4d(0)); |
| 236 | } | 236 | } |
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 02d6f5cf4e70..8824d01c0c35 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
| @@ -61,6 +61,7 @@ obj-y += alternative.o i8253.o hw_breakpoint.o | |||
| 61 | obj-y += tsc.o tsc_msr.o io_delay.o rtc.o | 61 | obj-y += tsc.o tsc_msr.o io_delay.o rtc.o |
| 62 | obj-y += pci-iommu_table.o | 62 | obj-y += pci-iommu_table.o |
| 63 | obj-y += resource.o | 63 | obj-y += resource.o |
| 64 | obj-y += irqflags.o | ||
| 64 | 65 | ||
| 65 | obj-y += process.o | 66 | obj-y += process.o |
| 66 | obj-y += fpu/ | 67 | obj-y += fpu/ |
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 082d7875cef8..38915fbfae73 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
| @@ -543,7 +543,9 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) | |||
| 543 | nodes_per_socket = ((value >> 3) & 7) + 1; | 543 | nodes_per_socket = ((value >> 3) & 7) + 1; |
| 544 | } | 544 | } |
| 545 | 545 | ||
| 546 | if (c->x86 >= 0x15 && c->x86 <= 0x17) { | 546 | if (!boot_cpu_has(X86_FEATURE_AMD_SSBD) && |
| 547 | !boot_cpu_has(X86_FEATURE_VIRT_SSBD) && | ||
| 548 | c->x86 >= 0x15 && c->x86 <= 0x17) { | ||
| 547 | unsigned int bit; | 549 | unsigned int bit; |
| 548 | 550 | ||
| 549 | switch (c->x86) { | 551 | switch (c->x86) { |
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 404df26b7de8..5c0ea39311fe 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c | |||
| @@ -155,7 +155,8 @@ x86_virt_spec_ctrl(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl, bool setguest) | |||
| 155 | guestval |= guest_spec_ctrl & x86_spec_ctrl_mask; | 155 | guestval |= guest_spec_ctrl & x86_spec_ctrl_mask; |
| 156 | 156 | ||
| 157 | /* SSBD controlled in MSR_SPEC_CTRL */ | 157 | /* SSBD controlled in MSR_SPEC_CTRL */ |
| 158 | if (static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD)) | 158 | if (static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) || |
| 159 | static_cpu_has(X86_FEATURE_AMD_SSBD)) | ||
| 159 | hostval |= ssbd_tif_to_spec_ctrl(ti->flags); | 160 | hostval |= ssbd_tif_to_spec_ctrl(ti->flags); |
| 160 | 161 | ||
| 161 | if (hostval != guestval) { | 162 | if (hostval != guestval) { |
| @@ -533,9 +534,10 @@ static enum ssb_mitigation __init __ssb_select_mitigation(void) | |||
| 533 | * Intel uses the SPEC CTRL MSR Bit(2) for this, while AMD may | 534 | * Intel uses the SPEC CTRL MSR Bit(2) for this, while AMD may |
| 534 | * use a completely different MSR and bit dependent on family. | 535 | * use a completely different MSR and bit dependent on family. |
| 535 | */ | 536 | */ |
| 536 | if (!static_cpu_has(X86_FEATURE_MSR_SPEC_CTRL)) | 537 | if (!static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) && |
| 538 | !static_cpu_has(X86_FEATURE_AMD_SSBD)) { | ||
| 537 | x86_amd_ssb_disable(); | 539 | x86_amd_ssb_disable(); |
| 538 | else { | 540 | } else { |
| 539 | x86_spec_ctrl_base |= SPEC_CTRL_SSBD; | 541 | x86_spec_ctrl_base |= SPEC_CTRL_SSBD; |
| 540 | x86_spec_ctrl_mask |= SPEC_CTRL_SSBD; | 542 | x86_spec_ctrl_mask |= SPEC_CTRL_SSBD; |
| 541 | wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base); | 543 | wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base); |
diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c index 4021d3859499..40eee6cc4124 100644 --- a/arch/x86/kernel/cpu/mtrr/if.c +++ b/arch/x86/kernel/cpu/mtrr/if.c | |||
| @@ -106,7 +106,8 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos) | |||
| 106 | 106 | ||
| 107 | memset(line, 0, LINE_SIZE); | 107 | memset(line, 0, LINE_SIZE); |
| 108 | 108 | ||
| 109 | length = strncpy_from_user(line, buf, LINE_SIZE - 1); | 109 | len = min_t(size_t, len, LINE_SIZE - 1); |
| 110 | length = strncpy_from_user(line, buf, len); | ||
| 110 | if (length < 0) | 111 | if (length < 0) |
| 111 | return length; | 112 | return length; |
| 112 | 113 | ||
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index d1f25c831447..c88c23c658c1 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
| @@ -1248,6 +1248,7 @@ void __init e820__memblock_setup(void) | |||
| 1248 | { | 1248 | { |
| 1249 | int i; | 1249 | int i; |
| 1250 | u64 end; | 1250 | u64 end; |
| 1251 | u64 addr = 0; | ||
| 1251 | 1252 | ||
| 1252 | /* | 1253 | /* |
| 1253 | * The bootstrap memblock region count maximum is 128 entries | 1254 | * The bootstrap memblock region count maximum is 128 entries |
| @@ -1264,13 +1265,21 @@ void __init e820__memblock_setup(void) | |||
| 1264 | struct e820_entry *entry = &e820_table->entries[i]; | 1265 | struct e820_entry *entry = &e820_table->entries[i]; |
| 1265 | 1266 | ||
| 1266 | end = entry->addr + entry->size; | 1267 | end = entry->addr + entry->size; |
| 1268 | if (addr < entry->addr) | ||
| 1269 | memblock_reserve(addr, entry->addr - addr); | ||
| 1270 | addr = end; | ||
| 1267 | if (end != (resource_size_t)end) | 1271 | if (end != (resource_size_t)end) |
| 1268 | continue; | 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 | if (entry->type != E820_TYPE_RAM && entry->type != E820_TYPE_RESERVED_KERN) | 1279 | if (entry->type != E820_TYPE_RAM && entry->type != E820_TYPE_RESERVED_KERN) |
| 1271 | continue; | 1280 | memblock_reserve(entry->addr, entry->size); |
| 1272 | 1281 | else | |
| 1273 | memblock_add(entry->addr, entry->size); | 1282 | memblock_add(entry->addr, entry->size); |
| 1274 | } | 1283 | } |
| 1275 | 1284 | ||
| 1276 | /* Throw away partial pages: */ | 1285 | /* Throw away partial pages: */ |
diff --git a/arch/x86/kernel/irqflags.S b/arch/x86/kernel/irqflags.S new file mode 100644 index 000000000000..ddeeaac8adda --- /dev/null +++ b/arch/x86/kernel/irqflags.S | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | |||
| 3 | #include <asm/asm.h> | ||
| 4 | #include <asm/export.h> | ||
| 5 | #include <linux/linkage.h> | ||
| 6 | |||
| 7 | /* | ||
| 8 | * unsigned long native_save_fl(void) | ||
| 9 | */ | ||
| 10 | ENTRY(native_save_fl) | ||
| 11 | pushf | ||
| 12 | pop %_ASM_AX | ||
| 13 | ret | ||
| 14 | ENDPROC(native_save_fl) | ||
| 15 | EXPORT_SYMBOL(native_save_fl) | ||
| 16 | |||
| 17 | /* | ||
| 18 | * void native_restore_fl(unsigned long flags) | ||
| 19 | * %eax/%rdi: flags | ||
| 20 | */ | ||
| 21 | ENTRY(native_restore_fl) | ||
| 22 | push %_ASM_ARG1 | ||
| 23 | popf | ||
| 24 | ret | ||
| 25 | ENDPROC(native_restore_fl) | ||
| 26 | EXPORT_SYMBOL(native_restore_fl) | ||
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index c2f7d1d2a5c3..db9656e13ea0 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
| @@ -221,6 +221,11 @@ static void notrace start_secondary(void *unused) | |||
| 221 | #ifdef CONFIG_X86_32 | 221 | #ifdef CONFIG_X86_32 |
| 222 | /* switch away from the initial page table */ | 222 | /* switch away from the initial page table */ |
| 223 | load_cr3(swapper_pg_dir); | 223 | load_cr3(swapper_pg_dir); |
| 224 | /* | ||
| 225 | * Initialize the CR4 shadow before doing anything that could | ||
| 226 | * try to read it. | ||
| 227 | */ | ||
| 228 | cr4_init_shadow(); | ||
| 224 | __flush_tlb_all(); | 229 | __flush_tlb_all(); |
| 225 | #endif | 230 | #endif |
| 226 | load_current_idt(); | 231 | load_current_idt(); |
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 9a84a0d08727..2aafa6ab6103 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
| @@ -641,11 +641,6 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) | |||
| 641 | return 0; | 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 | static void | 644 | static void |
| 650 | show_fault_oops(struct pt_regs *regs, unsigned long error_code, | 645 | show_fault_oops(struct pt_regs *regs, unsigned long error_code, |
| 651 | unsigned long address) | 646 | unsigned long address) |
| @@ -664,20 +659,18 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, | |||
| 664 | pte = lookup_address_in_pgd(pgd, address, &level); | 659 | pte = lookup_address_in_pgd(pgd, address, &level); |
| 665 | 660 | ||
| 666 | if (pte && pte_present(*pte) && !pte_exec(*pte)) | 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 | if (pte && pte_present(*pte) && pte_exec(*pte) && | 664 | if (pte && pte_present(*pte) && pte_exec(*pte) && |
| 669 | (pgd_flags(*pgd) & _PAGE_USER) && | 665 | (pgd_flags(*pgd) & _PAGE_USER) && |
| 670 | (__read_cr4() & X86_CR4_SMEP)) | 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 "); | 671 | pr_alert("BUG: unable to handle kernel %s at %px\n", |
| 675 | if (address < PAGE_SIZE) | 672 | address < PAGE_SIZE ? "NULL pointer dereference" : "paging request", |
| 676 | printk(KERN_CONT "NULL pointer dereference"); | 673 | (void *)address); |
| 677 | else | ||
| 678 | printk(KERN_CONT "paging request"); | ||
| 679 | |||
| 680 | printk(KERN_CONT " at %px\n", (void *) address); | ||
| 681 | 674 | ||
| 682 | dump_pagetable(address); | 675 | dump_pagetable(address); |
| 683 | } | 676 | } |
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index e01f7ceb9e7a..77873ce700ae 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c | |||
| @@ -166,14 +166,14 @@ void __init efi_call_phys_epilog(pgd_t *save_pgd) | |||
| 166 | pgd = pgd_offset_k(pgd_idx * PGDIR_SIZE); | 166 | pgd = pgd_offset_k(pgd_idx * PGDIR_SIZE); |
| 167 | set_pgd(pgd_offset_k(pgd_idx * PGDIR_SIZE), save_pgd[pgd_idx]); | 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 | continue; | 170 | continue; |
| 171 | 171 | ||
| 172 | for (i = 0; i < PTRS_PER_P4D; i++) { | 172 | for (i = 0; i < PTRS_PER_P4D; i++) { |
| 173 | p4d = p4d_offset(pgd, | 173 | p4d = p4d_offset(pgd, |
| 174 | pgd_idx * PGDIR_SIZE + i * P4D_SIZE); | 174 | pgd_idx * PGDIR_SIZE + i * P4D_SIZE); |
| 175 | 175 | ||
| 176 | if (!(p4d_val(*p4d) & _PAGE_PRESENT)) | 176 | if (!p4d_present(*p4d)) |
| 177 | continue; | 177 | continue; |
| 178 | 178 | ||
| 179 | pud = (pud_t *)p4d_page_vaddr(*p4d); | 179 | pud = (pud_t *)p4d_page_vaddr(*p4d); |
diff --git a/block/blk-core.c b/block/blk-core.c index afd2596ea3d3..f84a9b7b6f5a 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
| @@ -3473,6 +3473,10 @@ static void __blk_rq_prep_clone(struct request *dst, struct request *src) | |||
| 3473 | dst->cpu = src->cpu; | 3473 | dst->cpu = src->cpu; |
| 3474 | dst->__sector = blk_rq_pos(src); | 3474 | dst->__sector = blk_rq_pos(src); |
| 3475 | dst->__data_len = blk_rq_bytes(src); | 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 | dst->nr_phys_segments = src->nr_phys_segments; | 3480 | dst->nr_phys_segments = src->nr_phys_segments; |
| 3477 | dst->ioprio = src->ioprio; | 3481 | dst->ioprio = src->ioprio; |
| 3478 | dst->extra_len = src->extra_len; | 3482 | dst->extra_len = src->extra_len; |
diff --git a/block/blk-mq.c b/block/blk-mq.c index b429d515b568..95919268564b 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
| @@ -1075,6 +1075,9 @@ static bool blk_mq_mark_tag_wait(struct blk_mq_hw_ctx **hctx, | |||
| 1075 | 1075 | ||
| 1076 | #define BLK_MQ_RESOURCE_DELAY 3 /* ms units */ | 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 | bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, | 1081 | bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, |
| 1079 | bool got_budget) | 1082 | bool got_budget) |
| 1080 | { | 1083 | { |
| @@ -1205,8 +1208,17 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, | |||
| 1205 | blk_mq_run_hw_queue(hctx, true); | 1208 | blk_mq_run_hw_queue(hctx, true); |
| 1206 | else if (needs_restart && (ret == BLK_STS_RESOURCE)) | 1209 | else if (needs_restart && (ret == BLK_STS_RESOURCE)) |
| 1207 | blk_mq_delay_run_hw_queue(hctx, BLK_MQ_RESOURCE_DELAY); | 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 | return (queued + errors) != 0; | 1222 | return (queued + errors) != 0; |
| 1211 | } | 1223 | } |
| 1212 | 1224 | ||
diff --git a/certs/blacklist.h b/certs/blacklist.h index 150d82da8e99..1efd6fa0dc60 100644 --- a/certs/blacklist.h +++ b/certs/blacklist.h | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | #include <linux/kernel.h> | 1 | #include <linux/kernel.h> |
| 2 | 2 | ||
| 3 | extern const char __initdata *const blacklist_hashes[]; | 3 | extern const char __initconst *const blacklist_hashes[]; |
diff --git a/crypto/af_alg.c b/crypto/af_alg.c index 49fa8582138b..314c52c967e5 100644 --- a/crypto/af_alg.c +++ b/crypto/af_alg.c | |||
| @@ -1060,12 +1060,19 @@ void af_alg_async_cb(struct crypto_async_request *_req, int err) | |||
| 1060 | } | 1060 | } |
| 1061 | EXPORT_SYMBOL_GPL(af_alg_async_cb); | 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 | struct sock *sk = sock->sk; | 1069 | struct sock *sk = sock->sk; |
| 1066 | struct alg_sock *ask = alg_sk(sk); | 1070 | struct alg_sock *ask = alg_sk(sk); |
| 1067 | struct af_alg_ctx *ctx = ask->private; | 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 | if (!ctx->more || ctx->used) | 1077 | if (!ctx->more || ctx->used) |
| 1071 | mask |= EPOLLIN | EPOLLRDNORM; | 1078 | mask |= EPOLLIN | EPOLLRDNORM; |
| @@ -1075,7 +1082,7 @@ __poll_t af_alg_poll_mask(struct socket *sock, __poll_t events) | |||
| 1075 | 1082 | ||
| 1076 | return mask; | 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 | * af_alg_alloc_areq - allocate struct af_alg_async_req | 1088 | * af_alg_alloc_areq - allocate struct af_alg_async_req |
diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c index 825524f27438..c40a8c7ee8ae 100644 --- a/crypto/algif_aead.c +++ b/crypto/algif_aead.c | |||
| @@ -375,7 +375,7 @@ static struct proto_ops algif_aead_ops = { | |||
| 375 | .sendmsg = aead_sendmsg, | 375 | .sendmsg = aead_sendmsg, |
| 376 | .sendpage = af_alg_sendpage, | 376 | .sendpage = af_alg_sendpage, |
| 377 | .recvmsg = aead_recvmsg, | 377 | .recvmsg = aead_recvmsg, |
| 378 | .poll_mask = af_alg_poll_mask, | 378 | .poll = af_alg_poll, |
| 379 | }; | 379 | }; |
| 380 | 380 | ||
| 381 | static int aead_check_key(struct socket *sock) | 381 | static int aead_check_key(struct socket *sock) |
| @@ -471,7 +471,7 @@ static struct proto_ops algif_aead_ops_nokey = { | |||
| 471 | .sendmsg = aead_sendmsg_nokey, | 471 | .sendmsg = aead_sendmsg_nokey, |
| 472 | .sendpage = aead_sendpage_nokey, | 472 | .sendpage = aead_sendpage_nokey, |
| 473 | .recvmsg = aead_recvmsg_nokey, | 473 | .recvmsg = aead_recvmsg_nokey, |
| 474 | .poll_mask = af_alg_poll_mask, | 474 | .poll = af_alg_poll, |
| 475 | }; | 475 | }; |
| 476 | 476 | ||
| 477 | static void *aead_bind(const char *name, u32 type, u32 mask) | 477 | static void *aead_bind(const char *name, u32 type, u32 mask) |
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index 4c04eb9888ad..cfdaab2b7d76 100644 --- a/crypto/algif_skcipher.c +++ b/crypto/algif_skcipher.c | |||
| @@ -206,7 +206,7 @@ static struct proto_ops algif_skcipher_ops = { | |||
| 206 | .sendmsg = skcipher_sendmsg, | 206 | .sendmsg = skcipher_sendmsg, |
| 207 | .sendpage = af_alg_sendpage, | 207 | .sendpage = af_alg_sendpage, |
| 208 | .recvmsg = skcipher_recvmsg, | 208 | .recvmsg = skcipher_recvmsg, |
| 209 | .poll_mask = af_alg_poll_mask, | 209 | .poll = af_alg_poll, |
| 210 | }; | 210 | }; |
| 211 | 211 | ||
| 212 | static int skcipher_check_key(struct socket *sock) | 212 | static int skcipher_check_key(struct socket *sock) |
| @@ -302,7 +302,7 @@ static struct proto_ops algif_skcipher_ops_nokey = { | |||
| 302 | .sendmsg = skcipher_sendmsg_nokey, | 302 | .sendmsg = skcipher_sendmsg_nokey, |
| 303 | .sendpage = skcipher_sendpage_nokey, | 303 | .sendpage = skcipher_sendpage_nokey, |
| 304 | .recvmsg = skcipher_recvmsg_nokey, | 304 | .recvmsg = skcipher_recvmsg_nokey, |
| 305 | .poll_mask = af_alg_poll_mask, | 305 | .poll = af_alg_poll, |
| 306 | }; | 306 | }; |
| 307 | 307 | ||
| 308 | static void *skcipher_bind(const char *name, u32 type, u32 mask) | 308 | static void *skcipher_bind(const char *name, u32 type, u32 mask) |
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c index 7d81e6bb461a..b6cabac4b62b 100644 --- a/crypto/asymmetric_keys/x509_cert_parser.c +++ b/crypto/asymmetric_keys/x509_cert_parser.c | |||
| @@ -249,6 +249,15 @@ int x509_note_signature(void *context, size_t hdrlen, | |||
| 249 | return -EINVAL; | 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 | ctx->cert->raw_sig = value; | 261 | ctx->cert->raw_sig = value; |
| 253 | ctx->cert->raw_sig_size = vlen; | 262 | ctx->cert->raw_sig_size = vlen; |
| 254 | return 0; | 263 | return 0; |
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c index fc0c2e2328cd..fe9d46d81750 100644 --- a/drivers/acpi/acpica/hwsleep.c +++ b/drivers/acpi/acpica/hwsleep.c | |||
| @@ -51,16 +51,23 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state) | |||
| 51 | return_ACPI_STATUS(status); | 51 | return_ACPI_STATUS(status); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | /* | 54 | /* Disable all GPEs */ |
| 55 | * 1) Disable all GPEs | ||
| 56 | * 2) Enable all wakeup GPEs | ||
| 57 | */ | ||
| 58 | status = acpi_hw_disable_all_gpes(); | 55 | status = acpi_hw_disable_all_gpes(); |
| 59 | if (ACPI_FAILURE(status)) { | 56 | if (ACPI_FAILURE(status)) { |
| 60 | return_ACPI_STATUS(status); | 57 | return_ACPI_STATUS(status); |
| 61 | } | 58 | } |
| 59 | /* | ||
| 60 | * If the target sleep state is S5, clear all GPEs and fixed events too | ||
| 61 | */ | ||
| 62 | if (sleep_state == ACPI_STATE_S5) { | ||
| 63 | status = acpi_hw_clear_acpi_status(); | ||
| 64 | if (ACPI_FAILURE(status)) { | ||
| 65 | return_ACPI_STATUS(status); | ||
| 66 | } | ||
| 67 | } | ||
| 62 | acpi_gbl_system_awake_and_running = FALSE; | 68 | acpi_gbl_system_awake_and_running = FALSE; |
| 63 | 69 | ||
| 70 | /* Enable all wakeup GPEs */ | ||
| 64 | status = acpi_hw_enable_all_wakeup_gpes(); | 71 | status = acpi_hw_enable_all_wakeup_gpes(); |
| 65 | if (ACPI_FAILURE(status)) { | 72 | if (ACPI_FAILURE(status)) { |
| 66 | return_ACPI_STATUS(status); | 73 | return_ACPI_STATUS(status); |
diff --git a/drivers/acpi/acpica/uterror.c b/drivers/acpi/acpica/uterror.c index 5a64ddaed8a3..e47430272692 100644 --- a/drivers/acpi/acpica/uterror.c +++ b/drivers/acpi/acpica/uterror.c | |||
| @@ -182,19 +182,19 @@ acpi_ut_prefixed_namespace_error(const char *module_name, | |||
| 182 | switch (lookup_status) { | 182 | switch (lookup_status) { |
| 183 | case AE_ALREADY_EXISTS: | 183 | case AE_ALREADY_EXISTS: |
| 184 | 184 | ||
| 185 | acpi_os_printf("\n" ACPI_MSG_BIOS_ERROR); | 185 | acpi_os_printf(ACPI_MSG_BIOS_ERROR); |
| 186 | message = "Failure creating"; | 186 | message = "Failure creating"; |
| 187 | break; | 187 | break; |
| 188 | 188 | ||
| 189 | case AE_NOT_FOUND: | 189 | case AE_NOT_FOUND: |
| 190 | 190 | ||
| 191 | acpi_os_printf("\n" ACPI_MSG_BIOS_ERROR); | 191 | acpi_os_printf(ACPI_MSG_BIOS_ERROR); |
| 192 | message = "Could not resolve"; | 192 | message = "Could not resolve"; |
| 193 | break; | 193 | break; |
| 194 | 194 | ||
| 195 | default: | 195 | default: |
| 196 | 196 | ||
| 197 | acpi_os_printf("\n" ACPI_MSG_ERROR); | 197 | acpi_os_printf(ACPI_MSG_ERROR); |
| 198 | message = "Failure resolving"; | 198 | message = "Failure resolving"; |
| 199 | break; | 199 | break; |
| 200 | } | 200 | } |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index b0113a5802a3..d79ad844c78f 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
| @@ -717,10 +717,11 @@ void battery_hook_register(struct acpi_battery_hook *hook) | |||
| 717 | */ | 717 | */ |
| 718 | pr_err("extension failed to load: %s", hook->name); | 718 | pr_err("extension failed to load: %s", hook->name); |
| 719 | __battery_hook_unregister(hook, 0); | 719 | __battery_hook_unregister(hook, 0); |
| 720 | return; | 720 | goto end; |
| 721 | } | 721 | } |
| 722 | } | 722 | } |
| 723 | pr_info("new extension: %s\n", hook->name); | 723 | pr_info("new extension: %s\n", hook->name); |
| 724 | end: | ||
| 724 | mutex_unlock(&hook_mutex); | 725 | mutex_unlock(&hook_mutex); |
| 725 | } | 726 | } |
| 726 | EXPORT_SYMBOL_GPL(battery_hook_register); | 727 | EXPORT_SYMBOL_GPL(battery_hook_register); |
| @@ -732,7 +733,7 @@ EXPORT_SYMBOL_GPL(battery_hook_register); | |||
| 732 | */ | 733 | */ |
| 733 | static void battery_hook_add_battery(struct acpi_battery *battery) | 734 | static void battery_hook_add_battery(struct acpi_battery *battery) |
| 734 | { | 735 | { |
| 735 | struct acpi_battery_hook *hook_node; | 736 | struct acpi_battery_hook *hook_node, *tmp; |
| 736 | 737 | ||
| 737 | mutex_lock(&hook_mutex); | 738 | mutex_lock(&hook_mutex); |
| 738 | INIT_LIST_HEAD(&battery->list); | 739 | INIT_LIST_HEAD(&battery->list); |
| @@ -744,15 +745,15 @@ static void battery_hook_add_battery(struct acpi_battery *battery) | |||
| 744 | * when a battery gets hotplugged or initialized | 745 | * when a battery gets hotplugged or initialized |
| 745 | * during the battery module initialization. | 746 | * during the battery module initialization. |
| 746 | */ | 747 | */ |
| 747 | list_for_each_entry(hook_node, &battery_hook_list, list) { | 748 | list_for_each_entry_safe(hook_node, tmp, &battery_hook_list, list) { |
| 748 | if (hook_node->add_battery(battery->bat)) { | 749 | if (hook_node->add_battery(battery->bat)) { |
| 749 | /* | 750 | /* |
| 750 | * The notification of the extensions has failed, to | 751 | * The notification of the extensions has failed, to |
| 751 | * prevent further errors we will unload the extension. | 752 | * prevent further errors we will unload the extension. |
| 752 | */ | 753 | */ |
| 753 | __battery_hook_unregister(hook_node, 0); | ||
| 754 | pr_err("error in extension, unloading: %s", | 754 | pr_err("error in extension, unloading: %s", |
| 755 | hook_node->name); | 755 | hook_node->name); |
| 756 | __battery_hook_unregister(hook_node, 0); | ||
| 756 | } | 757 | } |
| 757 | } | 758 | } |
| 758 | mutex_unlock(&hook_mutex); | 759 | mutex_unlock(&hook_mutex); |
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index d15814e1727f..7c479002e798 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c | |||
| @@ -408,6 +408,8 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, | |||
| 408 | const guid_t *guid; | 408 | const guid_t *guid; |
| 409 | int rc, i; | 409 | int rc, i; |
| 410 | 410 | ||
| 411 | if (cmd_rc) | ||
| 412 | *cmd_rc = -EINVAL; | ||
| 411 | func = cmd; | 413 | func = cmd; |
| 412 | if (cmd == ND_CMD_CALL) { | 414 | if (cmd == ND_CMD_CALL) { |
| 413 | call_pkg = buf; | 415 | call_pkg = buf; |
| @@ -518,6 +520,8 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, | |||
| 518 | * If we return an error (like elsewhere) then caller wouldn't | 520 | * If we return an error (like elsewhere) then caller wouldn't |
| 519 | * be able to rely upon data returned to make calculation. | 521 | * be able to rely upon data returned to make calculation. |
| 520 | */ | 522 | */ |
| 523 | if (cmd_rc) | ||
| 524 | *cmd_rc = 0; | ||
| 521 | return 0; | 525 | return 0; |
| 522 | } | 526 | } |
| 523 | 527 | ||
| @@ -1273,7 +1277,7 @@ static ssize_t scrub_show(struct device *dev, | |||
| 1273 | 1277 | ||
| 1274 | mutex_lock(&acpi_desc->init_mutex); | 1278 | mutex_lock(&acpi_desc->init_mutex); |
| 1275 | rc = sprintf(buf, "%d%s", acpi_desc->scrub_count, | 1279 | rc = sprintf(buf, "%d%s", acpi_desc->scrub_count, |
| 1276 | work_busy(&acpi_desc->dwork.work) | 1280 | acpi_desc->scrub_busy |
| 1277 | && !acpi_desc->cancel ? "+\n" : "\n"); | 1281 | && !acpi_desc->cancel ? "+\n" : "\n"); |
| 1278 | mutex_unlock(&acpi_desc->init_mutex); | 1282 | mutex_unlock(&acpi_desc->init_mutex); |
| 1279 | } | 1283 | } |
| @@ -2939,6 +2943,32 @@ static unsigned int __acpi_nfit_scrub(struct acpi_nfit_desc *acpi_desc, | |||
| 2939 | return 0; | 2943 | return 0; |
| 2940 | } | 2944 | } |
| 2941 | 2945 | ||
| 2946 | static void __sched_ars(struct acpi_nfit_desc *acpi_desc, unsigned int tmo) | ||
| 2947 | { | ||
| 2948 | lockdep_assert_held(&acpi_desc->init_mutex); | ||
| 2949 | |||
| 2950 | acpi_desc->scrub_busy = 1; | ||
| 2951 | /* note this should only be set from within the workqueue */ | ||
| 2952 | if (tmo) | ||
| 2953 | acpi_desc->scrub_tmo = tmo; | ||
| 2954 | queue_delayed_work(nfit_wq, &acpi_desc->dwork, tmo * HZ); | ||
| 2955 | } | ||
| 2956 | |||
| 2957 | static void sched_ars(struct acpi_nfit_desc *acpi_desc) | ||
| 2958 | { | ||
| 2959 | __sched_ars(acpi_desc, 0); | ||
| 2960 | } | ||
| 2961 | |||
| 2962 | static void notify_ars_done(struct acpi_nfit_desc *acpi_desc) | ||
| 2963 | { | ||
| 2964 | lockdep_assert_held(&acpi_desc->init_mutex); | ||
| 2965 | |||
| 2966 | acpi_desc->scrub_busy = 0; | ||
| 2967 | acpi_desc->scrub_count++; | ||
| 2968 | if (acpi_desc->scrub_count_state) | ||
| 2969 | sysfs_notify_dirent(acpi_desc->scrub_count_state); | ||
| 2970 | } | ||
| 2971 | |||
| 2942 | static void acpi_nfit_scrub(struct work_struct *work) | 2972 | static void acpi_nfit_scrub(struct work_struct *work) |
| 2943 | { | 2973 | { |
| 2944 | struct acpi_nfit_desc *acpi_desc; | 2974 | struct acpi_nfit_desc *acpi_desc; |
| @@ -2949,14 +2979,10 @@ static void acpi_nfit_scrub(struct work_struct *work) | |||
| 2949 | mutex_lock(&acpi_desc->init_mutex); | 2979 | mutex_lock(&acpi_desc->init_mutex); |
| 2950 | query_rc = acpi_nfit_query_poison(acpi_desc); | 2980 | query_rc = acpi_nfit_query_poison(acpi_desc); |
| 2951 | tmo = __acpi_nfit_scrub(acpi_desc, query_rc); | 2981 | tmo = __acpi_nfit_scrub(acpi_desc, query_rc); |
| 2952 | if (tmo) { | 2982 | if (tmo) |
| 2953 | queue_delayed_work(nfit_wq, &acpi_desc->dwork, tmo * HZ); | 2983 | __sched_ars(acpi_desc, tmo); |
| 2954 | acpi_desc->scrub_tmo = tmo; | 2984 | else |
| 2955 | } else { | 2985 | notify_ars_done(acpi_desc); |
| 2956 | acpi_desc->scrub_count++; | ||
| 2957 | if (acpi_desc->scrub_count_state) | ||
| 2958 | sysfs_notify_dirent(acpi_desc->scrub_count_state); | ||
| 2959 | } | ||
| 2960 | memset(acpi_desc->ars_status, 0, acpi_desc->max_ars); | 2986 | memset(acpi_desc->ars_status, 0, acpi_desc->max_ars); |
| 2961 | mutex_unlock(&acpi_desc->init_mutex); | 2987 | mutex_unlock(&acpi_desc->init_mutex); |
| 2962 | } | 2988 | } |
| @@ -3037,7 +3063,7 @@ static int acpi_nfit_register_regions(struct acpi_nfit_desc *acpi_desc) | |||
| 3037 | break; | 3063 | break; |
| 3038 | } | 3064 | } |
| 3039 | 3065 | ||
| 3040 | queue_delayed_work(nfit_wq, &acpi_desc->dwork, 0); | 3066 | sched_ars(acpi_desc); |
| 3041 | return 0; | 3067 | return 0; |
| 3042 | } | 3068 | } |
| 3043 | 3069 | ||
| @@ -3239,7 +3265,7 @@ int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, unsigned long flags) | |||
| 3239 | } | 3265 | } |
| 3240 | } | 3266 | } |
| 3241 | if (scheduled) { | 3267 | if (scheduled) { |
| 3242 | queue_delayed_work(nfit_wq, &acpi_desc->dwork, 0); | 3268 | sched_ars(acpi_desc); |
| 3243 | dev_dbg(dev, "ars_scan triggered\n"); | 3269 | dev_dbg(dev, "ars_scan triggered\n"); |
| 3244 | } | 3270 | } |
| 3245 | mutex_unlock(&acpi_desc->init_mutex); | 3271 | mutex_unlock(&acpi_desc->init_mutex); |
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h index 7d15856a739f..a97ff42fe311 100644 --- a/drivers/acpi/nfit/nfit.h +++ b/drivers/acpi/nfit/nfit.h | |||
| @@ -203,6 +203,7 @@ struct acpi_nfit_desc { | |||
| 203 | unsigned int max_ars; | 203 | unsigned int max_ars; |
| 204 | unsigned int scrub_count; | 204 | unsigned int scrub_count; |
| 205 | unsigned int scrub_mode; | 205 | unsigned int scrub_mode; |
| 206 | unsigned int scrub_busy:1; | ||
| 206 | unsigned int cancel:1; | 207 | unsigned int cancel:1; |
| 207 | unsigned long dimm_cmd_force_en; | 208 | unsigned long dimm_cmd_force_en; |
| 208 | unsigned long bus_cmd_force_en; | 209 | unsigned long bus_cmd_force_en; |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 7ca41bf023c9..8df9abfa947b 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
| @@ -45,6 +45,8 @@ | |||
| 45 | #include <linux/uaccess.h> | 45 | #include <linux/uaccess.h> |
| 46 | #include <linux/io-64-nonatomic-lo-hi.h> | 46 | #include <linux/io-64-nonatomic-lo-hi.h> |
| 47 | 47 | ||
| 48 | #include "acpica/accommon.h" | ||
| 49 | #include "acpica/acnamesp.h" | ||
| 48 | #include "internal.h" | 50 | #include "internal.h" |
| 49 | 51 | ||
| 50 | #define _COMPONENT ACPI_OS_SERVICES | 52 | #define _COMPONENT ACPI_OS_SERVICES |
| @@ -1490,6 +1492,76 @@ int acpi_check_region(resource_size_t start, resource_size_t n, | |||
| 1490 | } | 1492 | } |
| 1491 | EXPORT_SYMBOL(acpi_check_region); | 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 | * Let drivers know whether the resource checks are effective | 1566 | * Let drivers know whether the resource checks are effective |
| 1495 | */ | 1567 | */ |
diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c index e5ea1974d1e3..d1e26cb599bf 100644 --- a/drivers/acpi/pptt.c +++ b/drivers/acpi/pptt.c | |||
| @@ -481,8 +481,14 @@ static int topology_get_acpi_cpu_tag(struct acpi_table_header *table, | |||
| 481 | if (cpu_node) { | 481 | if (cpu_node) { |
| 482 | cpu_node = acpi_find_processor_package_id(table, cpu_node, | 482 | cpu_node = acpi_find_processor_package_id(table, cpu_node, |
| 483 | level, flag); | 483 | level, flag); |
| 484 | /* Only the first level has a guaranteed id */ | 484 | /* |
| 485 | if (level == 0) | 485 | * As per specification if the processor structure represents |
| 486 | * an actual processor, then ACPI processor ID must be valid. | ||
| 487 | * For processor containers ACPI_PPTT_ACPI_PROCESSOR_ID_VALID | ||
| 488 | * should be set if the UID is valid | ||
| 489 | */ | ||
| 490 | if (level == 0 || | ||
| 491 | cpu_node->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID) | ||
| 486 | return cpu_node->acpi_processor_id; | 492 | return cpu_node->acpi_processor_id; |
| 487 | return ACPI_PTR_DIFF(cpu_node, table); | 493 | return ACPI_PTR_DIFF(cpu_node, table); |
| 488 | } | 494 | } |
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index 2b16e7c8fff3..39b181d6bd0d 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
| @@ -398,7 +398,6 @@ config SATA_DWC_VDEBUG | |||
| 398 | 398 | ||
| 399 | config SATA_HIGHBANK | 399 | config SATA_HIGHBANK |
| 400 | tristate "Calxeda Highbank SATA support" | 400 | tristate "Calxeda Highbank SATA support" |
| 401 | depends on HAS_DMA | ||
| 402 | depends on ARCH_HIGHBANK || COMPILE_TEST | 401 | depends on ARCH_HIGHBANK || COMPILE_TEST |
| 403 | help | 402 | help |
| 404 | This option enables support for the Calxeda Highbank SoC's | 403 | This option enables support for the Calxeda Highbank SoC's |
| @@ -408,7 +407,6 @@ config SATA_HIGHBANK | |||
| 408 | 407 | ||
| 409 | config SATA_MV | 408 | config SATA_MV |
| 410 | tristate "Marvell SATA support" | 409 | tristate "Marvell SATA support" |
| 411 | depends on HAS_DMA | ||
| 412 | depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \ | 410 | depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \ |
| 413 | ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST | 411 | ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST |
| 414 | select GENERIC_PHY | 412 | select GENERIC_PHY |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 738fb22978dd..b2b9eba1d214 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
| @@ -400,6 +400,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
| 400 | { PCI_VDEVICE(INTEL, 0x0f23), board_ahci_mobile }, /* Bay Trail AHCI */ | 400 | { PCI_VDEVICE(INTEL, 0x0f23), board_ahci_mobile }, /* Bay Trail AHCI */ |
| 401 | { PCI_VDEVICE(INTEL, 0x22a3), board_ahci_mobile }, /* Cherry Tr. AHCI */ | 401 | { PCI_VDEVICE(INTEL, 0x22a3), board_ahci_mobile }, /* Cherry Tr. AHCI */ |
| 402 | { PCI_VDEVICE(INTEL, 0x5ae3), board_ahci_mobile }, /* ApolloLake AHCI */ | 402 | { PCI_VDEVICE(INTEL, 0x5ae3), board_ahci_mobile }, /* ApolloLake AHCI */ |
| 403 | { PCI_VDEVICE(INTEL, 0x34d3), board_ahci_mobile }, /* Ice Lake LP AHCI */ | ||
| 403 | 404 | ||
| 404 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ | 405 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ |
| 405 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | 406 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
| @@ -1280,6 +1281,59 @@ static bool ahci_broken_suspend(struct pci_dev *pdev) | |||
| 1280 | return strcmp(buf, dmi->driver_data) < 0; | 1281 | return strcmp(buf, dmi->driver_data) < 0; |
| 1281 | } | 1282 | } |
| 1282 | 1283 | ||
| 1284 | static bool ahci_broken_lpm(struct pci_dev *pdev) | ||
| 1285 | { | ||
| 1286 | static const struct dmi_system_id sysids[] = { | ||
| 1287 | /* Various Lenovo 50 series have LPM issues with older BIOSen */ | ||
| 1288 | { | ||
| 1289 | .matches = { | ||
| 1290 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1291 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X250"), | ||
| 1292 | }, | ||
| 1293 | .driver_data = "20180406", /* 1.31 */ | ||
| 1294 | }, | ||
| 1295 | { | ||
| 1296 | .matches = { | ||
| 1297 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1298 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L450"), | ||
| 1299 | }, | ||
| 1300 | .driver_data = "20180420", /* 1.28 */ | ||
| 1301 | }, | ||
| 1302 | { | ||
| 1303 | .matches = { | ||
| 1304 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1305 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T450s"), | ||
| 1306 | }, | ||
| 1307 | .driver_data = "20180315", /* 1.33 */ | ||
| 1308 | }, | ||
| 1309 | { | ||
| 1310 | .matches = { | ||
| 1311 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1312 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W541"), | ||
| 1313 | }, | ||
| 1314 | /* | ||
| 1315 | * Note date based on release notes, 2.35 has been | ||
| 1316 | * reported to be good, but I've been unable to get | ||
| 1317 | * a hold of the reporter to get the DMI BIOS date. | ||
| 1318 | * TODO: fix this. | ||
| 1319 | */ | ||
| 1320 | .driver_data = "20180310", /* 2.35 */ | ||
| 1321 | }, | ||
| 1322 | { } /* terminate list */ | ||
| 1323 | }; | ||
| 1324 | const struct dmi_system_id *dmi = dmi_first_match(sysids); | ||
| 1325 | int year, month, date; | ||
| 1326 | char buf[9]; | ||
| 1327 | |||
| 1328 | if (!dmi) | ||
| 1329 | return false; | ||
| 1330 | |||
| 1331 | dmi_get_date(DMI_BIOS_DATE, &year, &month, &date); | ||
| 1332 | snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date); | ||
| 1333 | |||
| 1334 | return strcmp(buf, dmi->driver_data) < 0; | ||
| 1335 | } | ||
| 1336 | |||
| 1283 | static bool ahci_broken_online(struct pci_dev *pdev) | 1337 | static bool ahci_broken_online(struct pci_dev *pdev) |
| 1284 | { | 1338 | { |
| 1285 | #define ENCODE_BUSDEVFN(bus, slot, func) \ | 1339 | #define ENCODE_BUSDEVFN(bus, slot, func) \ |
| @@ -1694,6 +1748,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 1694 | "quirky BIOS, skipping spindown on poweroff\n"); | 1748 | "quirky BIOS, skipping spindown on poweroff\n"); |
| 1695 | } | 1749 | } |
| 1696 | 1750 | ||
| 1751 | if (ahci_broken_lpm(pdev)) { | ||
| 1752 | pi.flags |= ATA_FLAG_NO_LPM; | ||
| 1753 | dev_warn(&pdev->dev, | ||
| 1754 | "BIOS update required for Link Power Management support\n"); | ||
| 1755 | } | ||
| 1756 | |||
| 1697 | if (ahci_broken_suspend(pdev)) { | 1757 | if (ahci_broken_suspend(pdev)) { |
| 1698 | hpriv->flags |= AHCI_HFLAG_NO_SUSPEND; | 1758 | hpriv->flags |= AHCI_HFLAG_NO_SUSPEND; |
| 1699 | dev_warn(&pdev->dev, | 1759 | dev_warn(&pdev->dev, |
diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c index 0045dacd814b..72d90b4c3aae 100644 --- a/drivers/ata/ahci_mvebu.c +++ b/drivers/ata/ahci_mvebu.c | |||
| @@ -82,7 +82,7 @@ static void ahci_mvebu_regret_option(struct ahci_host_priv *hpriv) | |||
| 82 | * | 82 | * |
| 83 | * Return: 0 on success; Error code otherwise. | 83 | * Return: 0 on success; Error code otherwise. |
| 84 | */ | 84 | */ |
| 85 | int ahci_mvebu_stop_engine(struct ata_port *ap) | 85 | static int ahci_mvebu_stop_engine(struct ata_port *ap) |
| 86 | { | 86 | { |
| 87 | void __iomem *port_mmio = ahci_port_base(ap); | 87 | void __iomem *port_mmio = ahci_port_base(ap); |
| 88 | u32 tmp, port_fbs; | 88 | u32 tmp, port_fbs; |
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 965842a08743..09620c2ffa0f 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/kernel.h> | 35 | #include <linux/kernel.h> |
| 36 | #include <linux/gfp.h> | 36 | #include <linux/gfp.h> |
| 37 | #include <linux/module.h> | 37 | #include <linux/module.h> |
| 38 | #include <linux/nospec.h> | ||
| 38 | #include <linux/blkdev.h> | 39 | #include <linux/blkdev.h> |
| 39 | #include <linux/delay.h> | 40 | #include <linux/delay.h> |
| 40 | #include <linux/interrupt.h> | 41 | #include <linux/interrupt.h> |
| @@ -1146,10 +1147,12 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf, | |||
| 1146 | 1147 | ||
| 1147 | /* get the slot number from the message */ | 1148 | /* get the slot number from the message */ |
| 1148 | pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8; | 1149 | pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8; |
| 1149 | if (pmp < EM_MAX_SLOTS) | 1150 | if (pmp < EM_MAX_SLOTS) { |
| 1151 | pmp = array_index_nospec(pmp, EM_MAX_SLOTS); | ||
| 1150 | emp = &pp->em_priv[pmp]; | 1152 | emp = &pp->em_priv[pmp]; |
| 1151 | else | 1153 | } else { |
| 1152 | return -EINVAL; | 1154 | return -EINVAL; |
| 1155 | } | ||
| 1153 | 1156 | ||
| 1154 | /* mask off the activity bits if we are in sw_activity | 1157 | /* mask off the activity bits if we are in sw_activity |
| 1155 | * mode, user should turn off sw_activity before setting | 1158 | * mode, user should turn off sw_activity before setting |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 27d15ed7fa3d..cc71c63df381 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
| @@ -2493,6 +2493,9 @@ int ata_dev_configure(struct ata_device *dev) | |||
| 2493 | (id[ATA_ID_SATA_CAPABILITY] & 0xe) == 0x2) | 2493 | (id[ATA_ID_SATA_CAPABILITY] & 0xe) == 0x2) |
| 2494 | dev->horkage |= ATA_HORKAGE_NOLPM; | 2494 | dev->horkage |= ATA_HORKAGE_NOLPM; |
| 2495 | 2495 | ||
| 2496 | if (ap->flags & ATA_FLAG_NO_LPM) | ||
| 2497 | dev->horkage |= ATA_HORKAGE_NOLPM; | ||
| 2498 | |||
| 2496 | if (dev->horkage & ATA_HORKAGE_NOLPM) { | 2499 | if (dev->horkage & ATA_HORKAGE_NOLPM) { |
| 2497 | ata_dev_warn(dev, "LPM support broken, forcing max_power\n"); | 2500 | ata_dev_warn(dev, "LPM support broken, forcing max_power\n"); |
| 2498 | dev->link->ap->target_lpm_policy = ATA_LPM_MAX_POWER; | 2501 | dev->link->ap->target_lpm_policy = ATA_LPM_MAX_POWER; |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index d5412145d76d..01306c018398 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
| @@ -614,8 +614,7 @@ void ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap, | |||
| 614 | list_for_each_entry_safe(scmd, tmp, eh_work_q, eh_entry) { | 614 | list_for_each_entry_safe(scmd, tmp, eh_work_q, eh_entry) { |
| 615 | struct ata_queued_cmd *qc; | 615 | struct ata_queued_cmd *qc; |
| 616 | 616 | ||
| 617 | for (i = 0; i < ATA_MAX_QUEUE; i++) { | 617 | ata_qc_for_each_raw(ap, qc, i) { |
| 618 | qc = __ata_qc_from_tag(ap, i); | ||
| 619 | if (qc->flags & ATA_QCFLAG_ACTIVE && | 618 | if (qc->flags & ATA_QCFLAG_ACTIVE && |
| 620 | qc->scsicmd == scmd) | 619 | qc->scsicmd == scmd) |
| 621 | break; | 620 | break; |
| @@ -818,14 +817,13 @@ EXPORT_SYMBOL_GPL(ata_port_wait_eh); | |||
| 818 | 817 | ||
| 819 | static int ata_eh_nr_in_flight(struct ata_port *ap) | 818 | static int ata_eh_nr_in_flight(struct ata_port *ap) |
| 820 | { | 819 | { |
| 820 | struct ata_queued_cmd *qc; | ||
| 821 | unsigned int tag; | 821 | unsigned int tag; |
| 822 | int nr = 0; | 822 | int nr = 0; |
| 823 | 823 | ||
| 824 | /* count only non-internal commands */ | 824 | /* count only non-internal commands */ |
| 825 | for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { | 825 | ata_qc_for_each(ap, qc, tag) { |
| 826 | if (ata_tag_internal(tag)) | 826 | if (qc) |
| 827 | continue; | ||
| 828 | if (ata_qc_from_tag(ap, tag)) | ||
| 829 | nr++; | 827 | nr++; |
| 830 | } | 828 | } |
| 831 | 829 | ||
| @@ -847,13 +845,13 @@ void ata_eh_fastdrain_timerfn(struct timer_list *t) | |||
| 847 | goto out_unlock; | 845 | goto out_unlock; |
| 848 | 846 | ||
| 849 | if (cnt == ap->fastdrain_cnt) { | 847 | if (cnt == ap->fastdrain_cnt) { |
| 848 | struct ata_queued_cmd *qc; | ||
| 850 | unsigned int tag; | 849 | unsigned int tag; |
| 851 | 850 | ||
| 852 | /* No progress during the last interval, tag all | 851 | /* No progress during the last interval, tag all |
| 853 | * in-flight qcs as timed out and freeze the port. | 852 | * in-flight qcs as timed out and freeze the port. |
| 854 | */ | 853 | */ |
| 855 | for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { | 854 | ata_qc_for_each(ap, qc, tag) { |
| 856 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, tag); | ||
| 857 | if (qc) | 855 | if (qc) |
| 858 | qc->err_mask |= AC_ERR_TIMEOUT; | 856 | qc->err_mask |= AC_ERR_TIMEOUT; |
| 859 | } | 857 | } |
| @@ -999,6 +997,7 @@ void ata_port_schedule_eh(struct ata_port *ap) | |||
| 999 | 997 | ||
| 1000 | static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link) | 998 | static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link) |
| 1001 | { | 999 | { |
| 1000 | struct ata_queued_cmd *qc; | ||
| 1002 | int tag, nr_aborted = 0; | 1001 | int tag, nr_aborted = 0; |
| 1003 | 1002 | ||
| 1004 | WARN_ON(!ap->ops->error_handler); | 1003 | WARN_ON(!ap->ops->error_handler); |
| @@ -1007,9 +1006,7 @@ static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link) | |||
| 1007 | ata_eh_set_pending(ap, 0); | 1006 | ata_eh_set_pending(ap, 0); |
| 1008 | 1007 | ||
| 1009 | /* include internal tag in iteration */ | 1008 | /* include internal tag in iteration */ |
| 1010 | for (tag = 0; tag <= ATA_MAX_QUEUE; tag++) { | 1009 | ata_qc_for_each_with_internal(ap, qc, tag) { |
| 1011 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, tag); | ||
| 1012 | |||
| 1013 | if (qc && (!link || qc->dev->link == link)) { | 1010 | if (qc && (!link || qc->dev->link == link)) { |
| 1014 | qc->flags |= ATA_QCFLAG_FAILED; | 1011 | qc->flags |= ATA_QCFLAG_FAILED; |
| 1015 | ata_qc_complete(qc); | 1012 | ata_qc_complete(qc); |
| @@ -1712,9 +1709,7 @@ void ata_eh_analyze_ncq_error(struct ata_link *link) | |||
| 1712 | return; | 1709 | return; |
| 1713 | 1710 | ||
| 1714 | /* has LLDD analyzed already? */ | 1711 | /* has LLDD analyzed already? */ |
| 1715 | for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { | 1712 | ata_qc_for_each_raw(ap, qc, tag) { |
| 1716 | qc = __ata_qc_from_tag(ap, tag); | ||
| 1717 | |||
| 1718 | if (!(qc->flags & ATA_QCFLAG_FAILED)) | 1713 | if (!(qc->flags & ATA_QCFLAG_FAILED)) |
| 1719 | continue; | 1714 | continue; |
| 1720 | 1715 | ||
| @@ -2136,6 +2131,7 @@ static void ata_eh_link_autopsy(struct ata_link *link) | |||
| 2136 | { | 2131 | { |
| 2137 | struct ata_port *ap = link->ap; | 2132 | struct ata_port *ap = link->ap; |
| 2138 | struct ata_eh_context *ehc = &link->eh_context; | 2133 | struct ata_eh_context *ehc = &link->eh_context; |
| 2134 | struct ata_queued_cmd *qc; | ||
| 2139 | struct ata_device *dev; | 2135 | struct ata_device *dev; |
| 2140 | unsigned int all_err_mask = 0, eflags = 0; | 2136 | unsigned int all_err_mask = 0, eflags = 0; |
| 2141 | int tag, nr_failed = 0, nr_quiet = 0; | 2137 | int tag, nr_failed = 0, nr_quiet = 0; |
| @@ -2168,9 +2164,7 @@ static void ata_eh_link_autopsy(struct ata_link *link) | |||
| 2168 | 2164 | ||
| 2169 | all_err_mask |= ehc->i.err_mask; | 2165 | all_err_mask |= ehc->i.err_mask; |
| 2170 | 2166 | ||
| 2171 | for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { | 2167 | ata_qc_for_each_raw(ap, qc, tag) { |
| 2172 | struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag); | ||
| 2173 | |||
| 2174 | if (!(qc->flags & ATA_QCFLAG_FAILED) || | 2168 | if (!(qc->flags & ATA_QCFLAG_FAILED) || |
| 2175 | ata_dev_phys_link(qc->dev) != link) | 2169 | ata_dev_phys_link(qc->dev) != link) |
| 2176 | continue; | 2170 | continue; |
| @@ -2436,6 +2430,7 @@ static void ata_eh_link_report(struct ata_link *link) | |||
| 2436 | { | 2430 | { |
| 2437 | struct ata_port *ap = link->ap; | 2431 | struct ata_port *ap = link->ap; |
| 2438 | struct ata_eh_context *ehc = &link->eh_context; | 2432 | struct ata_eh_context *ehc = &link->eh_context; |
| 2433 | struct ata_queued_cmd *qc; | ||
| 2439 | const char *frozen, *desc; | 2434 | const char *frozen, *desc; |
| 2440 | char tries_buf[6] = ""; | 2435 | char tries_buf[6] = ""; |
| 2441 | int tag, nr_failed = 0; | 2436 | int tag, nr_failed = 0; |
| @@ -2447,9 +2442,7 @@ static void ata_eh_link_report(struct ata_link *link) | |||
| 2447 | if (ehc->i.desc[0] != '\0') | 2442 | if (ehc->i.desc[0] != '\0') |
| 2448 | desc = ehc->i.desc; | 2443 | desc = ehc->i.desc; |
| 2449 | 2444 | ||
| 2450 | for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { | 2445 | ata_qc_for_each_raw(ap, qc, tag) { |
| 2451 | struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag); | ||
| 2452 | |||
| 2453 | if (!(qc->flags & ATA_QCFLAG_FAILED) || | 2446 | if (!(qc->flags & ATA_QCFLAG_FAILED) || |
| 2454 | ata_dev_phys_link(qc->dev) != link || | 2447 | ata_dev_phys_link(qc->dev) != link || |
| 2455 | ((qc->flags & ATA_QCFLAG_QUIET) && | 2448 | ((qc->flags & ATA_QCFLAG_QUIET) && |
| @@ -2511,8 +2504,7 @@ static void ata_eh_link_report(struct ata_link *link) | |||
| 2511 | ehc->i.serror & SERR_DEV_XCHG ? "DevExch " : ""); | 2504 | ehc->i.serror & SERR_DEV_XCHG ? "DevExch " : ""); |
| 2512 | #endif | 2505 | #endif |
| 2513 | 2506 | ||
| 2514 | for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { | 2507 | ata_qc_for_each_raw(ap, qc, tag) { |
| 2515 | struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag); | ||
| 2516 | struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf; | 2508 | struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf; |
| 2517 | char data_buf[20] = ""; | 2509 | char data_buf[20] = ""; |
| 2518 | char cdb_buf[70] = ""; | 2510 | char cdb_buf[70] = ""; |
| @@ -3992,12 +3984,11 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
| 3992 | */ | 3984 | */ |
| 3993 | void ata_eh_finish(struct ata_port *ap) | 3985 | void ata_eh_finish(struct ata_port *ap) |
| 3994 | { | 3986 | { |
| 3987 | struct ata_queued_cmd *qc; | ||
| 3995 | int tag; | 3988 | int tag; |
| 3996 | 3989 | ||
| 3997 | /* retry or finish qcs */ | 3990 | /* retry or finish qcs */ |
| 3998 | for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { | 3991 | ata_qc_for_each_raw(ap, qc, tag) { |
| 3999 | struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag); | ||
| 4000 | |||
| 4001 | if (!(qc->flags & ATA_QCFLAG_FAILED)) | 3992 | if (!(qc->flags & ATA_QCFLAG_FAILED)) |
| 4002 | continue; | 3993 | continue; |
| 4003 | 3994 | ||
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 6a91d04351d9..aad1b01447de 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
| @@ -3805,10 +3805,20 @@ static unsigned int ata_scsi_zbc_out_xlat(struct ata_queued_cmd *qc) | |||
| 3805 | */ | 3805 | */ |
| 3806 | goto invalid_param_len; | 3806 | goto invalid_param_len; |
| 3807 | } | 3807 | } |
| 3808 | if (block > dev->n_sectors) | ||
| 3809 | goto out_of_range; | ||
| 3810 | 3808 | ||
| 3811 | all = cdb[14] & 0x1; | 3809 | all = cdb[14] & 0x1; |
| 3810 | if (all) { | ||
| 3811 | /* | ||
| 3812 | * Ignore the block address (zone ID) as defined by ZBC. | ||
| 3813 | */ | ||
| 3814 | block = 0; | ||
| 3815 | } else if (block >= dev->n_sectors) { | ||
| 3816 | /* | ||
| 3817 | * Block must be a valid zone ID (a zone start LBA). | ||
| 3818 | */ | ||
| 3819 | fp = 2; | ||
| 3820 | goto invalid_fld; | ||
| 3821 | } | ||
| 3812 | 3822 | ||
| 3813 | if (ata_ncq_enabled(qc->dev) && | 3823 | if (ata_ncq_enabled(qc->dev) && |
| 3814 | ata_fpdma_zac_mgmt_out_supported(qc->dev)) { | 3824 | ata_fpdma_zac_mgmt_out_supported(qc->dev)) { |
| @@ -3837,10 +3847,6 @@ static unsigned int ata_scsi_zbc_out_xlat(struct ata_queued_cmd *qc) | |||
| 3837 | invalid_fld: | 3847 | invalid_fld: |
| 3838 | ata_scsi_set_invalid_field(qc->dev, scmd, fp, 0xff); | 3848 | ata_scsi_set_invalid_field(qc->dev, scmd, fp, 0xff); |
| 3839 | return 1; | 3849 | return 1; |
| 3840 | out_of_range: | ||
| 3841 | /* "Logical Block Address out of range" */ | ||
| 3842 | ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST, 0x21, 0x00); | ||
| 3843 | return 1; | ||
| 3844 | invalid_param_len: | 3850 | invalid_param_len: |
| 3845 | /* "Parameter list length error" */ | 3851 | /* "Parameter list length error" */ |
| 3846 | ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST, 0x1a, 0x0); | 3852 | ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST, 0x1a, 0x0); |
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index b8d9cfc60374..4dc528bf8e85 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c | |||
| @@ -395,12 +395,6 @@ static inline unsigned int sata_fsl_tag(unsigned int tag, | |||
| 395 | { | 395 | { |
| 396 | /* We let libATA core do actual (queue) tag allocation */ | 396 | /* We let libATA core do actual (queue) tag allocation */ |
| 397 | 397 | ||
| 398 | /* all non NCQ/queued commands should have tag#0 */ | ||
| 399 | if (ata_tag_internal(tag)) { | ||
| 400 | DPRINTK("mapping internal cmds to tag#0\n"); | ||
| 401 | return 0; | ||
| 402 | } | ||
| 403 | |||
| 404 | if (unlikely(tag >= SATA_FSL_QUEUE_DEPTH)) { | 398 | if (unlikely(tag >= SATA_FSL_QUEUE_DEPTH)) { |
| 405 | DPRINTK("tag %d invalid : out of range\n", tag); | 399 | DPRINTK("tag %d invalid : out of range\n", tag); |
| 406 | return 0; | 400 | return 0; |
| @@ -1229,8 +1223,7 @@ static void sata_fsl_host_intr(struct ata_port *ap) | |||
| 1229 | 1223 | ||
| 1230 | /* Workaround for data length mismatch errata */ | 1224 | /* Workaround for data length mismatch errata */ |
| 1231 | if (unlikely(hstatus & INT_ON_DATA_LENGTH_MISMATCH)) { | 1225 | if (unlikely(hstatus & INT_ON_DATA_LENGTH_MISMATCH)) { |
| 1232 | for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { | 1226 | ata_qc_for_each_with_internal(ap, qc, tag) { |
| 1233 | qc = ata_qc_from_tag(ap, tag); | ||
| 1234 | if (qc && ata_is_atapi(qc->tf.protocol)) { | 1227 | if (qc && ata_is_atapi(qc->tf.protocol)) { |
| 1235 | u32 hcontrol; | 1228 | u32 hcontrol; |
| 1236 | /* Set HControl[27] to clear error registers */ | 1229 | /* Set HControl[27] to clear error registers */ |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 10ae11aa1926..72c9b922a77b 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
| @@ -675,7 +675,6 @@ static int nv_adma_slave_config(struct scsi_device *sdev) | |||
| 675 | struct ata_port *ap = ata_shost_to_port(sdev->host); | 675 | struct ata_port *ap = ata_shost_to_port(sdev->host); |
| 676 | struct nv_adma_port_priv *pp = ap->private_data; | 676 | struct nv_adma_port_priv *pp = ap->private_data; |
| 677 | struct nv_adma_port_priv *port0, *port1; | 677 | struct nv_adma_port_priv *port0, *port1; |
| 678 | struct scsi_device *sdev0, *sdev1; | ||
| 679 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 678 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
| 680 | unsigned long segment_boundary, flags; | 679 | unsigned long segment_boundary, flags; |
| 681 | unsigned short sg_tablesize; | 680 | unsigned short sg_tablesize; |
| @@ -736,8 +735,6 @@ static int nv_adma_slave_config(struct scsi_device *sdev) | |||
| 736 | 735 | ||
| 737 | port0 = ap->host->ports[0]->private_data; | 736 | port0 = ap->host->ports[0]->private_data; |
| 738 | port1 = ap->host->ports[1]->private_data; | 737 | port1 = ap->host->ports[1]->private_data; |
| 739 | sdev0 = ap->host->ports[0]->link.device[0].sdev; | ||
| 740 | sdev1 = ap->host->ports[1]->link.device[0].sdev; | ||
| 741 | if ((port0->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) || | 738 | if ((port0->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) || |
| 742 | (port1->flags & NV_ADMA_ATAPI_SETUP_COMPLETE)) { | 739 | (port1->flags & NV_ADMA_ATAPI_SETUP_COMPLETE)) { |
| 743 | /* | 740 | /* |
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index ff81a576347e..82532c299bb5 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
| @@ -1618,7 +1618,7 @@ static int rx_init(struct atm_dev *dev) | |||
| 1618 | skb_queue_head_init(&iadev->rx_dma_q); | 1618 | skb_queue_head_init(&iadev->rx_dma_q); |
| 1619 | iadev->rx_free_desc_qhead = NULL; | 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 | if (!iadev->rx_open) { | 1622 | if (!iadev->rx_open) { |
| 1623 | printk(KERN_ERR DEV_LABEL "itf %d couldn't get free page\n", | 1623 | printk(KERN_ERR DEV_LABEL "itf %d couldn't get free page\n", |
| 1624 | dev->number); | 1624 | dev->number); |
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index a8d2eb0ceb8d..2c288d1f42bb 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c | |||
| @@ -1483,6 +1483,8 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg) | |||
| 1483 | return -EFAULT; | 1483 | return -EFAULT; |
| 1484 | if (pool < 0 || pool > ZATM_LAST_POOL) | 1484 | if (pool < 0 || pool > ZATM_LAST_POOL) |
| 1485 | return -EINVAL; | 1485 | return -EINVAL; |
| 1486 | pool = array_index_nospec(pool, | ||
| 1487 | ZATM_LAST_POOL + 1); | ||
| 1486 | if (copy_from_user(&info, | 1488 | if (copy_from_user(&info, |
| 1487 | &((struct zatm_pool_req __user *) arg)->info, | 1489 | &((struct zatm_pool_req __user *) arg)->info, |
| 1488 | sizeof(info))) return -EFAULT; | 1490 | sizeof(info))) return -EFAULT; |
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 4925af5c4cf0..9e8484189034 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
| @@ -2235,7 +2235,7 @@ static void genpd_dev_pm_sync(struct device *dev) | |||
| 2235 | } | 2235 | } |
| 2236 | 2236 | ||
| 2237 | static int __genpd_dev_pm_attach(struct device *dev, struct device_node *np, | 2237 | static int __genpd_dev_pm_attach(struct device *dev, struct device_node *np, |
| 2238 | unsigned int index) | 2238 | unsigned int index, bool power_on) |
| 2239 | { | 2239 | { |
| 2240 | struct of_phandle_args pd_args; | 2240 | struct of_phandle_args pd_args; |
| 2241 | struct generic_pm_domain *pd; | 2241 | struct generic_pm_domain *pd; |
| @@ -2271,9 +2271,11 @@ static int __genpd_dev_pm_attach(struct device *dev, struct device_node *np, | |||
| 2271 | dev->pm_domain->detach = genpd_dev_pm_detach; | 2271 | dev->pm_domain->detach = genpd_dev_pm_detach; |
| 2272 | dev->pm_domain->sync = genpd_dev_pm_sync; | 2272 | dev->pm_domain->sync = genpd_dev_pm_sync; |
| 2273 | 2273 | ||
| 2274 | genpd_lock(pd); | 2274 | if (power_on) { |
| 2275 | ret = genpd_power_on(pd, 0); | 2275 | genpd_lock(pd); |
| 2276 | genpd_unlock(pd); | 2276 | ret = genpd_power_on(pd, 0); |
| 2277 | genpd_unlock(pd); | ||
| 2278 | } | ||
| 2277 | 2279 | ||
| 2278 | if (ret) | 2280 | if (ret) |
| 2279 | genpd_remove_device(pd, dev); | 2281 | genpd_remove_device(pd, dev); |
| @@ -2307,7 +2309,7 @@ int genpd_dev_pm_attach(struct device *dev) | |||
| 2307 | "#power-domain-cells") != 1) | 2309 | "#power-domain-cells") != 1) |
| 2308 | return 0; | 2310 | return 0; |
| 2309 | 2311 | ||
| 2310 | return __genpd_dev_pm_attach(dev, dev->of_node, 0); | 2312 | return __genpd_dev_pm_attach(dev, dev->of_node, 0, true); |
| 2311 | } | 2313 | } |
| 2312 | EXPORT_SYMBOL_GPL(genpd_dev_pm_attach); | 2314 | EXPORT_SYMBOL_GPL(genpd_dev_pm_attach); |
| 2313 | 2315 | ||
| @@ -2359,14 +2361,14 @@ struct device *genpd_dev_pm_attach_by_id(struct device *dev, | |||
| 2359 | } | 2361 | } |
| 2360 | 2362 | ||
| 2361 | /* Try to attach the device to the PM domain at the specified index. */ | 2363 | /* Try to attach the device to the PM domain at the specified index. */ |
| 2362 | ret = __genpd_dev_pm_attach(genpd_dev, dev->of_node, index); | 2364 | ret = __genpd_dev_pm_attach(genpd_dev, dev->of_node, index, false); |
| 2363 | if (ret < 1) { | 2365 | if (ret < 1) { |
| 2364 | device_unregister(genpd_dev); | 2366 | device_unregister(genpd_dev); |
| 2365 | return ret ? ERR_PTR(ret) : NULL; | 2367 | return ret ? ERR_PTR(ret) : NULL; |
| 2366 | } | 2368 | } |
| 2367 | 2369 | ||
| 2368 | pm_runtime_set_active(genpd_dev); | ||
| 2369 | pm_runtime_enable(genpd_dev); | 2370 | pm_runtime_enable(genpd_dev); |
| 2371 | genpd_queue_power_off_work(dev_to_genpd(genpd_dev)); | ||
| 2370 | 2372 | ||
| 2371 | return genpd_dev; | 2373 | return genpd_dev; |
| 2372 | } | 2374 | } |
| @@ -2487,10 +2489,9 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); | |||
| 2487 | * power domain corresponding to a DT node's "required-opps" property. | 2489 | * power domain corresponding to a DT node's "required-opps" property. |
| 2488 | * | 2490 | * |
| 2489 | * @dev: Device for which the performance-state needs to be found. | 2491 | * @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 | 2492 | * @np: DT node where the "required-opps" property is present. This can be |
| 2491 | * the device node itself (if it doesn't have an OPP table) or a node | 2493 | * the device node itself (if it doesn't have an OPP table) or a node |
| 2492 | * within the OPP table of a device (if device has an OPP table). | 2494 | * within the OPP table of a device (if device has an OPP table). |
| 2493 | * @state: Pointer to return performance state. | ||
| 2494 | * | 2495 | * |
| 2495 | * Returns performance state corresponding to the "required-opps" property of | 2496 | * Returns performance state corresponding to the "required-opps" property of |
| 2496 | * a DT node. This calls platform specific genpd->opp_to_performance_state() | 2497 | * a DT node. This calls platform specific genpd->opp_to_performance_state() |
| @@ -2499,7 +2500,7 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); | |||
| 2499 | * Returns performance state on success and 0 on failure. | 2500 | * Returns performance state on success and 0 on failure. |
| 2500 | */ | 2501 | */ |
| 2501 | unsigned int of_genpd_opp_to_performance_state(struct device *dev, | 2502 | unsigned int of_genpd_opp_to_performance_state(struct device *dev, |
| 2502 | struct device_node *opp_node) | 2503 | struct device_node *np) |
| 2503 | { | 2504 | { |
| 2504 | struct generic_pm_domain *genpd; | 2505 | struct generic_pm_domain *genpd; |
| 2505 | struct dev_pm_opp *opp; | 2506 | struct dev_pm_opp *opp; |
| @@ -2514,7 +2515,7 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev, | |||
| 2514 | 2515 | ||
| 2515 | genpd_lock(genpd); | 2516 | genpd_lock(genpd); |
| 2516 | 2517 | ||
| 2517 | opp = of_dev_pm_opp_find_required_opp(&genpd->dev, opp_node); | 2518 | opp = of_dev_pm_opp_find_required_opp(&genpd->dev, np); |
| 2518 | if (IS_ERR(opp)) { | 2519 | if (IS_ERR(opp)) { |
| 2519 | dev_err(dev, "Failed to find required OPP: %ld\n", | 2520 | dev_err(dev, "Failed to find required OPP: %ld\n", |
| 2520 | PTR_ERR(opp)); | 2521 | PTR_ERR(opp)); |
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index a47e4987ee46..d146fedc38bb 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c | |||
| @@ -1244,8 +1244,8 @@ drbd_request_prepare(struct drbd_device *device, struct bio *bio, unsigned long | |||
| 1244 | _drbd_start_io_acct(device, req); | 1244 | _drbd_start_io_acct(device, req); |
| 1245 | 1245 | ||
| 1246 | /* process discards always from our submitter thread */ | 1246 | /* process discards always from our submitter thread */ |
| 1247 | if ((bio_op(bio) & REQ_OP_WRITE_ZEROES) || | 1247 | if (bio_op(bio) == REQ_OP_WRITE_ZEROES || |
| 1248 | (bio_op(bio) & REQ_OP_DISCARD)) | 1248 | bio_op(bio) == REQ_OP_DISCARD) |
| 1249 | goto queue_for_submitter_thread; | 1249 | goto queue_for_submitter_thread; |
| 1250 | 1250 | ||
| 1251 | if (rw == WRITE && req->private_bio && req->i.size | 1251 | if (rw == WRITE && req->private_bio && req->i.size |
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 1476cb3439f4..5e793dd7adfb 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
| @@ -282,8 +282,8 @@ void drbd_request_endio(struct bio *bio) | |||
| 282 | what = COMPLETED_OK; | 282 | what = COMPLETED_OK; |
| 283 | } | 283 | } |
| 284 | 284 | ||
| 285 | bio_put(req->private_bio); | ||
| 286 | req->private_bio = ERR_PTR(blk_status_to_errno(bio->bi_status)); | 285 | req->private_bio = ERR_PTR(blk_status_to_errno(bio->bi_status)); |
| 286 | bio_put(bio); | ||
| 287 | 287 | ||
| 288 | /* not req_mod(), we need irqsave here! */ | 288 | /* not req_mod(), we need irqsave here! */ |
| 289 | spin_lock_irqsave(&device->resource->req_lock, flags); | 289 | spin_lock_irqsave(&device->resource->req_lock, flags); |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index d6b6f434fd4b..4cb1d1be3cfb 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
| @@ -1613,6 +1613,7 @@ static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode, | |||
| 1613 | arg = (unsigned long) compat_ptr(arg); | 1613 | arg = (unsigned long) compat_ptr(arg); |
| 1614 | case LOOP_SET_FD: | 1614 | case LOOP_SET_FD: |
| 1615 | case LOOP_CHANGE_FD: | 1615 | case LOOP_CHANGE_FD: |
| 1616 | case LOOP_SET_BLOCK_SIZE: | ||
| 1616 | err = lo_ioctl(bdev, mode, cmd, arg); | 1617 | err = lo_ioctl(bdev, mode, cmd, arg); |
| 1617 | break; | 1618 | break; |
| 1618 | default: | 1619 | default: |
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 1cc29629d238..80d60f43db56 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c | |||
| @@ -169,9 +169,9 @@ static int sysc_get_clocks(struct sysc *ddata) | |||
| 169 | const char *name; | 169 | const char *name; |
| 170 | int nr_fck = 0, nr_ick = 0, i, error = 0; | 170 | int nr_fck = 0, nr_ick = 0, i, error = 0; |
| 171 | 171 | ||
| 172 | ddata->clock_roles = devm_kzalloc(ddata->dev, | 172 | ddata->clock_roles = devm_kcalloc(ddata->dev, |
| 173 | sizeof(*ddata->clock_roles) * | ||
| 174 | SYSC_MAX_CLOCKS, | 173 | SYSC_MAX_CLOCKS, |
| 174 | sizeof(*ddata->clock_roles), | ||
| 175 | GFP_KERNEL); | 175 | GFP_KERNEL); |
| 176 | if (!ddata->clock_roles) | 176 | if (!ddata->clock_roles) |
| 177 | return -ENOMEM; | 177 | return -ENOMEM; |
| @@ -200,8 +200,8 @@ static int sysc_get_clocks(struct sysc *ddata) | |||
| 200 | return -EINVAL; | 200 | return -EINVAL; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | ddata->clocks = devm_kzalloc(ddata->dev, | 203 | ddata->clocks = devm_kcalloc(ddata->dev, |
| 204 | sizeof(*ddata->clocks) * ddata->nr_clocks, | 204 | ddata->nr_clocks, sizeof(*ddata->clocks), |
| 205 | GFP_KERNEL); | 205 | GFP_KERNEL); |
| 206 | if (!ddata->clocks) | 206 | if (!ddata->clocks) |
| 207 | return -ENOMEM; | 207 | return -ENOMEM; |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index ad353be871bf..90ec010bffbd 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
| @@ -2088,8 +2088,10 @@ static int try_smi_init(struct smi_info *new_smi) | |||
| 2088 | return 0; | 2088 | return 0; |
| 2089 | 2089 | ||
| 2090 | out_err: | 2090 | out_err: |
| 2091 | ipmi_unregister_smi(new_smi->intf); | 2091 | if (new_smi->intf) { |
| 2092 | new_smi->intf = NULL; | 2092 | ipmi_unregister_smi(new_smi->intf); |
| 2093 | new_smi->intf = NULL; | ||
| 2094 | } | ||
| 2093 | 2095 | ||
| 2094 | kfree(init_name); | 2096 | kfree(init_name); |
| 2095 | 2097 | ||
diff --git a/drivers/char/ipmi/kcs_bmc.c b/drivers/char/ipmi/kcs_bmc.c index fbfc05e3f3d1..bb882ab161fe 100644 --- a/drivers/char/ipmi/kcs_bmc.c +++ b/drivers/char/ipmi/kcs_bmc.c | |||
| @@ -210,34 +210,23 @@ static void kcs_bmc_handle_cmd(struct kcs_bmc *kcs_bmc) | |||
| 210 | int kcs_bmc_handle_event(struct kcs_bmc *kcs_bmc) | 210 | int kcs_bmc_handle_event(struct kcs_bmc *kcs_bmc) |
| 211 | { | 211 | { |
| 212 | unsigned long flags; | 212 | unsigned long flags; |
| 213 | int ret = 0; | 213 | int ret = -ENODATA; |
| 214 | u8 status; | 214 | u8 status; |
| 215 | 215 | ||
| 216 | spin_lock_irqsave(&kcs_bmc->lock, flags); | 216 | spin_lock_irqsave(&kcs_bmc->lock, flags); |
| 217 | 217 | ||
| 218 | if (!kcs_bmc->running) { | 218 | status = read_status(kcs_bmc); |
| 219 | kcs_force_abort(kcs_bmc); | 219 | if (status & KCS_STATUS_IBF) { |
| 220 | ret = -ENODEV; | 220 | if (!kcs_bmc->running) |
| 221 | goto out_unlock; | 221 | kcs_force_abort(kcs_bmc); |
| 222 | } | 222 | else if (status & KCS_STATUS_CMD_DAT) |
| 223 | 223 | kcs_bmc_handle_cmd(kcs_bmc); | |
| 224 | status = read_status(kcs_bmc) & (KCS_STATUS_IBF | KCS_STATUS_CMD_DAT); | 224 | else |
| 225 | 225 | kcs_bmc_handle_data(kcs_bmc); | |
| 226 | switch (status) { | ||
| 227 | case KCS_STATUS_IBF | KCS_STATUS_CMD_DAT: | ||
| 228 | kcs_bmc_handle_cmd(kcs_bmc); | ||
| 229 | break; | ||
| 230 | |||
| 231 | case KCS_STATUS_IBF: | ||
| 232 | kcs_bmc_handle_data(kcs_bmc); | ||
| 233 | break; | ||
| 234 | 226 | ||
| 235 | default: | 227 | ret = 0; |
| 236 | ret = -ENODATA; | ||
| 237 | break; | ||
| 238 | } | 228 | } |
| 239 | 229 | ||
| 240 | out_unlock: | ||
| 241 | spin_unlock_irqrestore(&kcs_bmc->lock, flags); | 230 | spin_unlock_irqrestore(&kcs_bmc->lock, flags); |
| 242 | 231 | ||
| 243 | return ret; | 232 | return ret; |
diff --git a/drivers/char/random.c b/drivers/char/random.c index a8fb0020ba5c..cd888d4ee605 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
| @@ -402,7 +402,8 @@ static struct poolinfo { | |||
| 402 | /* | 402 | /* |
| 403 | * Static global variables | 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 | static struct fasync_struct *fasync; | 407 | static struct fasync_struct *fasync; |
| 407 | 408 | ||
| 408 | static DEFINE_SPINLOCK(random_ready_list_lock); | 409 | static DEFINE_SPINLOCK(random_ready_list_lock); |
| @@ -721,8 +722,8 @@ retry: | |||
| 721 | 722 | ||
| 722 | /* should we wake readers? */ | 723 | /* should we wake readers? */ |
| 723 | if (entropy_bits >= random_read_wakeup_bits && | 724 | if (entropy_bits >= random_read_wakeup_bits && |
| 724 | wq_has_sleeper(&random_wait)) { | 725 | wq_has_sleeper(&random_read_wait)) { |
| 725 | wake_up_interruptible_poll(&random_wait, POLLIN); | 726 | wake_up_interruptible(&random_read_wait); |
| 726 | kill_fasync(&fasync, SIGIO, POLL_IN); | 727 | kill_fasync(&fasync, SIGIO, POLL_IN); |
| 727 | } | 728 | } |
| 728 | /* If the input pool is getting full, send some | 729 | /* If the input pool is getting full, send some |
| @@ -1396,7 +1397,7 @@ retry: | |||
| 1396 | trace_debit_entropy(r->name, 8 * ibytes); | 1397 | trace_debit_entropy(r->name, 8 * ibytes); |
| 1397 | if (ibytes && | 1398 | if (ibytes && |
| 1398 | (r->entropy_count >> ENTROPY_SHIFT) < random_write_wakeup_bits) { | 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 | kill_fasync(&fasync, SIGIO, POLL_OUT); | 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) | |||
| 1838 | if (nonblock) | 1839 | if (nonblock) |
| 1839 | return -EAGAIN; | 1840 | return -EAGAIN; |
| 1840 | 1841 | ||
| 1841 | wait_event_interruptible(random_wait, | 1842 | wait_event_interruptible(random_read_wait, |
| 1842 | ENTROPY_BITS(&input_pool) >= | 1843 | ENTROPY_BITS(&input_pool) >= |
| 1843 | random_read_wakeup_bits); | 1844 | random_read_wakeup_bits); |
| 1844 | if (signal_pending(current)) | 1845 | if (signal_pending(current)) |
| @@ -1875,17 +1876,14 @@ urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) | |||
| 1875 | return ret; | 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 | static __poll_t | 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 | if (ENTROPY_BITS(&input_pool) >= random_read_wakeup_bits) | 1887 | if (ENTROPY_BITS(&input_pool) >= random_read_wakeup_bits) |
| 1890 | mask |= EPOLLIN | EPOLLRDNORM; | 1888 | mask |= EPOLLIN | EPOLLRDNORM; |
| 1891 | if (ENTROPY_BITS(&input_pool) < random_write_wakeup_bits) | 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) | |||
| 1992 | const struct file_operations random_fops = { | 1990 | const struct file_operations random_fops = { |
| 1993 | .read = random_read, | 1991 | .read = random_read, |
| 1994 | .write = random_write, | 1992 | .write = random_write, |
| 1995 | .get_poll_head = random_get_poll_head, | 1993 | .poll = random_poll, |
| 1996 | .poll_mask = random_poll_mask, | ||
| 1997 | .unlocked_ioctl = random_ioctl, | 1994 | .unlocked_ioctl = random_ioctl, |
| 1998 | .fasync = random_fasync, | 1995 | .fasync = random_fasync, |
| 1999 | .llseek = noop_llseek, | 1996 | .llseek = noop_llseek, |
| @@ -2326,7 +2323,7 @@ void add_hwgenerator_randomness(const char *buffer, size_t count, | |||
| 2326 | * We'll be woken up again once below random_write_wakeup_thresh, | 2323 | * We'll be woken up again once below random_write_wakeup_thresh, |
| 2327 | * or when the calling thread is about to terminate. | 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 | ENTROPY_BITS(&input_pool) <= random_write_wakeup_bits); | 2327 | ENTROPY_BITS(&input_pool) <= random_write_wakeup_bits); |
| 2331 | mix_pool_bytes(poolp, buffer, count); | 2328 | mix_pool_bytes(poolp, buffer, count); |
| 2332 | credit_entropy_bits(poolp, entropy); | 2329 | credit_entropy_bits(poolp, entropy); |
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index ae40cbe770f0..0bb25dd009d1 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile | |||
| @@ -96,7 +96,7 @@ obj-$(CONFIG_ARCH_SPRD) += sprd/ | |||
| 96 | obj-$(CONFIG_ARCH_STI) += st/ | 96 | obj-$(CONFIG_ARCH_STI) += st/ |
| 97 | obj-$(CONFIG_ARCH_STRATIX10) += socfpga/ | 97 | obj-$(CONFIG_ARCH_STRATIX10) += socfpga/ |
| 98 | obj-$(CONFIG_ARCH_SUNXI) += sunxi/ | 98 | obj-$(CONFIG_ARCH_SUNXI) += sunxi/ |
| 99 | obj-$(CONFIG_ARCH_SUNXI) += sunxi-ng/ | 99 | obj-$(CONFIG_SUNXI_CCU) += sunxi-ng/ |
| 100 | obj-$(CONFIG_ARCH_TEGRA) += tegra/ | 100 | obj-$(CONFIG_ARCH_TEGRA) += tegra/ |
| 101 | obj-y += ti/ | 101 | obj-y += ti/ |
| 102 | obj-$(CONFIG_CLK_UNIPHIER) += uniphier/ | 102 | obj-$(CONFIG_CLK_UNIPHIER) += uniphier/ |
diff --git a/drivers/clk/davinci/da8xx-cfgchip.c b/drivers/clk/davinci/da8xx-cfgchip.c index aae62a5b8734..d1bbee19ed0f 100644 --- a/drivers/clk/davinci/da8xx-cfgchip.c +++ b/drivers/clk/davinci/da8xx-cfgchip.c | |||
| @@ -672,7 +672,7 @@ static int of_da8xx_usb_phy_clk_init(struct device *dev, struct regmap *regmap) | |||
| 672 | 672 | ||
| 673 | usb1 = da8xx_cfgchip_register_usb1_clk48(dev, regmap); | 673 | usb1 = da8xx_cfgchip_register_usb1_clk48(dev, regmap); |
| 674 | if (IS_ERR(usb1)) { | 674 | if (IS_ERR(usb1)) { |
| 675 | if (PTR_ERR(usb0) == -EPROBE_DEFER) | 675 | if (PTR_ERR(usb1) == -EPROBE_DEFER) |
| 676 | return -EPROBE_DEFER; | 676 | return -EPROBE_DEFER; |
| 677 | 677 | ||
| 678 | dev_warn(dev, "Failed to register usb1_clk48 (%ld)\n", | 678 | dev_warn(dev, "Failed to register usb1_clk48 (%ld)\n", |
diff --git a/drivers/clk/davinci/psc.h b/drivers/clk/davinci/psc.h index 6a42529d31a9..cc5614567a70 100644 --- a/drivers/clk/davinci/psc.h +++ b/drivers/clk/davinci/psc.h | |||
| @@ -107,7 +107,7 @@ extern const struct davinci_psc_init_data of_da850_psc1_init_data; | |||
| 107 | #ifdef CONFIG_ARCH_DAVINCI_DM355 | 107 | #ifdef CONFIG_ARCH_DAVINCI_DM355 |
| 108 | extern const struct davinci_psc_init_data dm355_psc_init_data; | 108 | extern const struct davinci_psc_init_data dm355_psc_init_data; |
| 109 | #endif | 109 | #endif |
| 110 | #ifdef CONFIG_ARCH_DAVINCI_DM356 | 110 | #ifdef CONFIG_ARCH_DAVINCI_DM365 |
| 111 | extern const struct davinci_psc_init_data dm365_psc_init_data; | 111 | extern const struct davinci_psc_init_data dm365_psc_init_data; |
| 112 | #endif | 112 | #endif |
| 113 | #ifdef CONFIG_ARCH_DAVINCI_DM644x | 113 | #ifdef CONFIG_ARCH_DAVINCI_DM644x |
diff --git a/drivers/clk/sunxi-ng/Makefile b/drivers/clk/sunxi-ng/Makefile index acaa14cfa25c..49454700f2e5 100644 --- a/drivers/clk/sunxi-ng/Makefile +++ b/drivers/clk/sunxi-ng/Makefile | |||
| @@ -1,24 +1,24 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | # Common objects | 2 | # Common objects |
| 3 | lib-$(CONFIG_SUNXI_CCU) += ccu_common.o | 3 | obj-y += ccu_common.o |
| 4 | lib-$(CONFIG_SUNXI_CCU) += ccu_mmc_timing.o | 4 | obj-y += ccu_mmc_timing.o |
| 5 | lib-$(CONFIG_SUNXI_CCU) += ccu_reset.o | 5 | obj-y += ccu_reset.o |
| 6 | 6 | ||
| 7 | # Base clock types | 7 | # Base clock types |
| 8 | lib-$(CONFIG_SUNXI_CCU) += ccu_div.o | 8 | obj-y += ccu_div.o |
| 9 | lib-$(CONFIG_SUNXI_CCU) += ccu_frac.o | 9 | obj-y += ccu_frac.o |
| 10 | lib-$(CONFIG_SUNXI_CCU) += ccu_gate.o | 10 | obj-y += ccu_gate.o |
| 11 | lib-$(CONFIG_SUNXI_CCU) += ccu_mux.o | 11 | obj-y += ccu_mux.o |
| 12 | lib-$(CONFIG_SUNXI_CCU) += ccu_mult.o | 12 | obj-y += ccu_mult.o |
| 13 | lib-$(CONFIG_SUNXI_CCU) += ccu_phase.o | 13 | obj-y += ccu_phase.o |
| 14 | lib-$(CONFIG_SUNXI_CCU) += ccu_sdm.o | 14 | obj-y += ccu_sdm.o |
| 15 | 15 | ||
| 16 | # Multi-factor clocks | 16 | # Multi-factor clocks |
| 17 | lib-$(CONFIG_SUNXI_CCU) += ccu_nk.o | 17 | obj-y += ccu_nk.o |
| 18 | lib-$(CONFIG_SUNXI_CCU) += ccu_nkm.o | 18 | obj-y += ccu_nkm.o |
| 19 | lib-$(CONFIG_SUNXI_CCU) += ccu_nkmp.o | 19 | obj-y += ccu_nkmp.o |
| 20 | lib-$(CONFIG_SUNXI_CCU) += ccu_nm.o | 20 | obj-y += ccu_nm.o |
| 21 | lib-$(CONFIG_SUNXI_CCU) += ccu_mp.o | 21 | obj-y += ccu_mp.o |
| 22 | 22 | ||
| 23 | # SoC support | 23 | # SoC support |
| 24 | obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o | 24 | obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o |
| @@ -38,12 +38,3 @@ obj-$(CONFIG_SUN8I_R40_CCU) += ccu-sun8i-r40.o | |||
| 38 | obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80.o | 38 | obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80.o |
| 39 | obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-de.o | 39 | obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-de.o |
| 40 | obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-usb.o | 40 | obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-usb.o |
| 41 | |||
| 42 | # The lib-y file goals is supposed to work only in arch/*/lib or lib/. In our | ||
| 43 | # case, we want to use that goal, but even though lib.a will be properly | ||
| 44 | # generated, it will not be linked in, eventually resulting in a linker error | ||
| 45 | # for missing symbols. | ||
| 46 | # | ||
| 47 | # We can work around that by explicitly adding lib.a to the obj-y goal. This is | ||
| 48 | # an undocumented behaviour, but works well for now. | ||
| 49 | obj-$(CONFIG_SUNXI_CCU) += lib.a | ||
diff --git a/drivers/cpufreq/qcom-cpufreq-kryo.c b/drivers/cpufreq/qcom-cpufreq-kryo.c index 01bddacf5c3b..29389accf3e9 100644 --- a/drivers/cpufreq/qcom-cpufreq-kryo.c +++ b/drivers/cpufreq/qcom-cpufreq-kryo.c | |||
| @@ -87,8 +87,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) | |||
| 87 | int ret; | 87 | int ret; |
| 88 | 88 | ||
| 89 | cpu_dev = get_cpu_device(0); | 89 | cpu_dev = get_cpu_device(0); |
| 90 | if (NULL == cpu_dev) | 90 | if (!cpu_dev) |
| 91 | ret = -ENODEV; | 91 | return -ENODEV; |
| 92 | 92 | ||
| 93 | msm8996_version = qcom_cpufreq_kryo_get_msm_id(); | 93 | msm8996_version = qcom_cpufreq_kryo_get_msm_id(); |
| 94 | if (NUM_OF_MSM8996_VERSIONS == msm8996_version) { | 94 | if (NUM_OF_MSM8996_VERSIONS == msm8996_version) { |
| @@ -97,8 +97,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) | |||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | np = dev_pm_opp_of_get_opp_desc_node(cpu_dev); | 99 | np = dev_pm_opp_of_get_opp_desc_node(cpu_dev); |
| 100 | if (IS_ERR(np)) | 100 | if (!np) |
| 101 | return PTR_ERR(np); | 101 | return -ENOENT; |
| 102 | 102 | ||
| 103 | ret = of_device_is_compatible(np, "operating-points-v2-kryo-cpu"); | 103 | ret = of_device_is_compatible(np, "operating-points-v2-kryo-cpu"); |
| 104 | if (!ret) { | 104 | if (!ret) { |
diff --git a/drivers/dax/device.c b/drivers/dax/device.c index de2f8297a210..108c37fca782 100644 --- a/drivers/dax/device.c +++ b/drivers/dax/device.c | |||
| @@ -189,14 +189,16 @@ static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma, | |||
| 189 | 189 | ||
| 190 | /* prevent private mappings from being established */ | 190 | /* prevent private mappings from being established */ |
| 191 | if ((vma->vm_flags & VM_MAYSHARE) != VM_MAYSHARE) { | 191 | if ((vma->vm_flags & VM_MAYSHARE) != VM_MAYSHARE) { |
| 192 | dev_info(dev, "%s: %s: fail, attempted private mapping\n", | 192 | dev_info_ratelimited(dev, |
| 193 | "%s: %s: fail, attempted private mapping\n", | ||
| 193 | current->comm, func); | 194 | current->comm, func); |
| 194 | return -EINVAL; | 195 | return -EINVAL; |
| 195 | } | 196 | } |
| 196 | 197 | ||
| 197 | mask = dax_region->align - 1; | 198 | mask = dax_region->align - 1; |
| 198 | if (vma->vm_start & mask || vma->vm_end & mask) { | 199 | if (vma->vm_start & mask || vma->vm_end & mask) { |
| 199 | dev_info(dev, "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n", | 200 | dev_info_ratelimited(dev, |
| 201 | "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n", | ||
| 200 | current->comm, func, vma->vm_start, vma->vm_end, | 202 | current->comm, func, vma->vm_start, vma->vm_end, |
| 201 | mask); | 203 | mask); |
| 202 | return -EINVAL; | 204 | return -EINVAL; |
| @@ -204,13 +206,15 @@ static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma, | |||
| 204 | 206 | ||
| 205 | if ((dax_region->pfn_flags & (PFN_DEV|PFN_MAP)) == PFN_DEV | 207 | if ((dax_region->pfn_flags & (PFN_DEV|PFN_MAP)) == PFN_DEV |
| 206 | && (vma->vm_flags & VM_DONTCOPY) == 0) { | 208 | && (vma->vm_flags & VM_DONTCOPY) == 0) { |
| 207 | dev_info(dev, "%s: %s: fail, dax range requires MADV_DONTFORK\n", | 209 | dev_info_ratelimited(dev, |
| 210 | "%s: %s: fail, dax range requires MADV_DONTFORK\n", | ||
| 208 | current->comm, func); | 211 | current->comm, func); |
| 209 | return -EINVAL; | 212 | return -EINVAL; |
| 210 | } | 213 | } |
| 211 | 214 | ||
| 212 | if (!vma_is_dax(vma)) { | 215 | if (!vma_is_dax(vma)) { |
| 213 | dev_info(dev, "%s: %s: fail, vma is not DAX capable\n", | 216 | dev_info_ratelimited(dev, |
| 217 | "%s: %s: fail, vma is not DAX capable\n", | ||
| 214 | current->comm, func); | 218 | current->comm, func); |
| 215 | return -EINVAL; | 219 | return -EINVAL; |
| 216 | } | 220 | } |
diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 903d9c473749..45276abf03aa 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c | |||
| @@ -86,6 +86,7 @@ bool __bdev_dax_supported(struct block_device *bdev, int blocksize) | |||
| 86 | { | 86 | { |
| 87 | struct dax_device *dax_dev; | 87 | struct dax_device *dax_dev; |
| 88 | bool dax_enabled = false; | 88 | bool dax_enabled = false; |
| 89 | struct request_queue *q; | ||
| 89 | pgoff_t pgoff; | 90 | pgoff_t pgoff; |
| 90 | int err, id; | 91 | int err, id; |
| 91 | void *kaddr; | 92 | void *kaddr; |
| @@ -99,6 +100,13 @@ bool __bdev_dax_supported(struct block_device *bdev, int blocksize) | |||
| 99 | return false; | 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 | err = bdev_dax_pgoff(bdev, 0, PAGE_SIZE, &pgoff); | 110 | err = bdev_dax_pgoff(bdev, 0, PAGE_SIZE, &pgoff); |
| 103 | if (err) { | 111 | if (err) { |
| 104 | pr_debug("%s: error: unaligned partition for dax\n", | 112 | pr_debug("%s: error: unaligned partition for dax\n", |
diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c index fa31cccbe04f..6bfa217ed6d0 100644 --- a/drivers/dma/k3dma.c +++ b/drivers/dma/k3dma.c | |||
| @@ -794,7 +794,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct of_phandle_args *dma_spec, | |||
| 794 | struct k3_dma_dev *d = ofdma->of_dma_data; | 794 | struct k3_dma_dev *d = ofdma->of_dma_data; |
| 795 | unsigned int request = dma_spec->args[0]; | 795 | unsigned int request = dma_spec->args[0]; |
| 796 | 796 | ||
| 797 | if (request > d->dma_requests) | 797 | if (request >= d->dma_requests) |
| 798 | return NULL; | 798 | return NULL; |
| 799 | 799 | ||
| 800 | return dma_get_slave_channel(&(d->chans[request].vc.chan)); | 800 | return dma_get_slave_channel(&(d->chans[request].vc.chan)); |
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index defcdde4d358..de0957fe9668 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
| @@ -3033,7 +3033,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
| 3033 | pd->src_addr_widths = PL330_DMA_BUSWIDTHS; | 3033 | pd->src_addr_widths = PL330_DMA_BUSWIDTHS; |
| 3034 | pd->dst_addr_widths = PL330_DMA_BUSWIDTHS; | 3034 | pd->dst_addr_widths = PL330_DMA_BUSWIDTHS; |
| 3035 | pd->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); | 3035 | pd->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); |
| 3036 | pd->residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT; | 3036 | pd->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; |
| 3037 | pd->max_burst = ((pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP) ? | 3037 | pd->max_burst = ((pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP) ? |
| 3038 | 1 : PL330_MAX_BURST); | 3038 | 1 : PL330_MAX_BURST); |
| 3039 | 3039 | ||
diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c index 9b5ca8691f27..a4a931ddf6f6 100644 --- a/drivers/dma/ti/omap-dma.c +++ b/drivers/dma/ti/omap-dma.c | |||
| @@ -1485,7 +1485,11 @@ static int omap_dma_probe(struct platform_device *pdev) | |||
| 1485 | od->ddev.src_addr_widths = OMAP_DMA_BUSWIDTHS; | 1485 | od->ddev.src_addr_widths = OMAP_DMA_BUSWIDTHS; |
| 1486 | od->ddev.dst_addr_widths = OMAP_DMA_BUSWIDTHS; | 1486 | od->ddev.dst_addr_widths = OMAP_DMA_BUSWIDTHS; |
| 1487 | od->ddev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); | 1487 | od->ddev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); |
| 1488 | od->ddev.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; | 1488 | if (__dma_omap15xx(od->plat->dma_attr)) |
| 1489 | od->ddev.residue_granularity = | ||
| 1490 | DMA_RESIDUE_GRANULARITY_DESCRIPTOR; | ||
| 1491 | else | ||
| 1492 | od->ddev.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; | ||
| 1489 | od->ddev.max_burst = SZ_16M - 1; /* CCEN: 24bit unsigned */ | 1493 | od->ddev.max_burst = SZ_16M - 1; /* CCEN: 24bit unsigned */ |
| 1490 | od->ddev.dev = &pdev->dev; | 1494 | od->ddev.dev = &pdev->dev; |
| 1491 | INIT_LIST_HEAD(&od->ddev.channels); | 1495 | INIT_LIST_HEAD(&od->ddev.channels); |
diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c index dd4edd8f22ce..7fa793672a7a 100644 --- a/drivers/fpga/altera-cvp.c +++ b/drivers/fpga/altera-cvp.c | |||
| @@ -455,8 +455,10 @@ static int altera_cvp_probe(struct pci_dev *pdev, | |||
| 455 | 455 | ||
| 456 | mgr = fpga_mgr_create(&pdev->dev, conf->mgr_name, | 456 | mgr = fpga_mgr_create(&pdev->dev, conf->mgr_name, |
| 457 | &altera_cvp_ops, conf); | 457 | &altera_cvp_ops, conf); |
| 458 | if (!mgr) | 458 | if (!mgr) { |
| 459 | return -ENOMEM; | 459 | ret = -ENOMEM; |
| 460 | goto err_unmap; | ||
| 461 | } | ||
| 460 | 462 | ||
| 461 | pci_set_drvdata(pdev, mgr); | 463 | pci_set_drvdata(pdev, mgr); |
| 462 | 464 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index a59c07590cee..7dcbac8af9a7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
| @@ -190,6 +190,7 @@ struct amdgpu_job; | |||
| 190 | struct amdgpu_irq_src; | 190 | struct amdgpu_irq_src; |
| 191 | struct amdgpu_fpriv; | 191 | struct amdgpu_fpriv; |
| 192 | struct amdgpu_bo_va_mapping; | 192 | struct amdgpu_bo_va_mapping; |
| 193 | struct amdgpu_atif; | ||
| 193 | 194 | ||
| 194 | enum amdgpu_cp_irq { | 195 | enum amdgpu_cp_irq { |
| 195 | AMDGPU_CP_IRQ_GFX_EOP = 0, | 196 | AMDGPU_CP_IRQ_GFX_EOP = 0, |
| @@ -1269,43 +1270,6 @@ struct amdgpu_vram_scratch { | |||
| 1269 | /* | 1270 | /* |
| 1270 | * ACPI | 1271 | * ACPI |
| 1271 | */ | 1272 | */ |
| 1272 | struct amdgpu_atif_notification_cfg { | ||
| 1273 | bool enabled; | ||
| 1274 | int command_code; | ||
| 1275 | }; | ||
| 1276 | |||
| 1277 | struct amdgpu_atif_notifications { | ||
| 1278 | bool display_switch; | ||
| 1279 | bool expansion_mode_change; | ||
| 1280 | bool thermal_state; | ||
| 1281 | bool forced_power_state; | ||
| 1282 | bool system_power_state; | ||
| 1283 | bool display_conf_change; | ||
| 1284 | bool px_gfx_switch; | ||
| 1285 | bool brightness_change; | ||
| 1286 | bool dgpu_display_event; | ||
| 1287 | }; | ||
| 1288 | |||
| 1289 | struct amdgpu_atif_functions { | ||
| 1290 | bool system_params; | ||
| 1291 | bool sbios_requests; | ||
| 1292 | bool select_active_disp; | ||
| 1293 | bool lid_state; | ||
| 1294 | bool get_tv_standard; | ||
| 1295 | bool set_tv_standard; | ||
| 1296 | bool get_panel_expansion_mode; | ||
| 1297 | bool set_panel_expansion_mode; | ||
| 1298 | bool temperature_change; | ||
| 1299 | bool graphics_device_types; | ||
| 1300 | }; | ||
| 1301 | |||
| 1302 | struct amdgpu_atif { | ||
| 1303 | struct amdgpu_atif_notifications notifications; | ||
| 1304 | struct amdgpu_atif_functions functions; | ||
| 1305 | struct amdgpu_atif_notification_cfg notification_cfg; | ||
| 1306 | struct amdgpu_encoder *encoder_for_bl; | ||
| 1307 | }; | ||
| 1308 | |||
| 1309 | struct amdgpu_atcs_functions { | 1273 | struct amdgpu_atcs_functions { |
| 1310 | bool get_ext_state; | 1274 | bool get_ext_state; |
| 1311 | bool pcie_perf_req; | 1275 | bool pcie_perf_req; |
| @@ -1466,7 +1430,7 @@ struct amdgpu_device { | |||
| 1466 | #if defined(CONFIG_DEBUG_FS) | 1430 | #if defined(CONFIG_DEBUG_FS) |
| 1467 | struct dentry *debugfs_regs[AMDGPU_DEBUGFS_MAX_COMPONENTS]; | 1431 | struct dentry *debugfs_regs[AMDGPU_DEBUGFS_MAX_COMPONENTS]; |
| 1468 | #endif | 1432 | #endif |
| 1469 | struct amdgpu_atif atif; | 1433 | struct amdgpu_atif *atif; |
| 1470 | struct amdgpu_atcs atcs; | 1434 | struct amdgpu_atcs atcs; |
| 1471 | struct mutex srbm_mutex; | 1435 | struct mutex srbm_mutex; |
| 1472 | /* GRBM index mutex. Protects concurrent access to GRBM index */ | 1436 | /* GRBM index mutex. Protects concurrent access to GRBM index */ |
| @@ -1894,6 +1858,12 @@ static inline bool amdgpu_atpx_dgpu_req_power_for_displays(void) { return false; | |||
| 1894 | static inline bool amdgpu_has_atpx(void) { return false; } | 1858 | static inline bool amdgpu_has_atpx(void) { return false; } |
| 1895 | #endif | 1859 | #endif |
| 1896 | 1860 | ||
| 1861 | #if defined(CONFIG_VGA_SWITCHEROO) && defined(CONFIG_ACPI) | ||
| 1862 | void *amdgpu_atpx_get_dhandle(void); | ||
| 1863 | #else | ||
| 1864 | static inline void *amdgpu_atpx_get_dhandle(void) { return NULL; } | ||
| 1865 | #endif | ||
| 1866 | |||
| 1897 | /* | 1867 | /* |
| 1898 | * KMS | 1868 | * KMS |
| 1899 | */ | 1869 | */ |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index 8fa850a070e0..0d8c3fc6eace 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | |||
| @@ -34,6 +34,45 @@ | |||
| 34 | #include "amd_acpi.h" | 34 | #include "amd_acpi.h" |
| 35 | #include "atom.h" | 35 | #include "atom.h" |
| 36 | 36 | ||
| 37 | struct amdgpu_atif_notification_cfg { | ||
| 38 | bool enabled; | ||
| 39 | int command_code; | ||
| 40 | }; | ||
| 41 | |||
| 42 | struct amdgpu_atif_notifications { | ||
| 43 | bool display_switch; | ||
| 44 | bool expansion_mode_change; | ||
| 45 | bool thermal_state; | ||
| 46 | bool forced_power_state; | ||
| 47 | bool system_power_state; | ||
| 48 | bool display_conf_change; | ||
| 49 | bool px_gfx_switch; | ||
| 50 | bool brightness_change; | ||
| 51 | bool dgpu_display_event; | ||
| 52 | }; | ||
| 53 | |||
| 54 | struct amdgpu_atif_functions { | ||
| 55 | bool system_params; | ||
| 56 | bool sbios_requests; | ||
| 57 | bool select_active_disp; | ||
| 58 | bool lid_state; | ||
| 59 | bool get_tv_standard; | ||
| 60 | bool set_tv_standard; | ||
| 61 | bool get_panel_expansion_mode; | ||
| 62 | bool set_panel_expansion_mode; | ||
| 63 | bool temperature_change; | ||
| 64 | bool graphics_device_types; | ||
| 65 | }; | ||
| 66 | |||
| 67 | struct amdgpu_atif { | ||
| 68 | acpi_handle handle; | ||
| 69 | |||
| 70 | struct amdgpu_atif_notifications notifications; | ||
| 71 | struct amdgpu_atif_functions functions; | ||
| 72 | struct amdgpu_atif_notification_cfg notification_cfg; | ||
| 73 | struct amdgpu_encoder *encoder_for_bl; | ||
| 74 | }; | ||
| 75 | |||
| 37 | /* Call the ATIF method | 76 | /* Call the ATIF method |
| 38 | */ | 77 | */ |
| 39 | /** | 78 | /** |
| @@ -46,8 +85,9 @@ | |||
| 46 | * Executes the requested ATIF function (all asics). | 85 | * Executes the requested ATIF function (all asics). |
| 47 | * Returns a pointer to the acpi output buffer. | 86 | * Returns a pointer to the acpi output buffer. |
| 48 | */ | 87 | */ |
| 49 | static union acpi_object *amdgpu_atif_call(acpi_handle handle, int function, | 88 | static union acpi_object *amdgpu_atif_call(struct amdgpu_atif *atif, |
| 50 | struct acpi_buffer *params) | 89 | int function, |
| 90 | struct acpi_buffer *params) | ||
| 51 | { | 91 | { |
| 52 | acpi_status status; | 92 | acpi_status status; |
| 53 | union acpi_object atif_arg_elements[2]; | 93 | union acpi_object atif_arg_elements[2]; |
| @@ -70,7 +110,8 @@ static union acpi_object *amdgpu_atif_call(acpi_handle handle, int function, | |||
| 70 | atif_arg_elements[1].integer.value = 0; | 110 | atif_arg_elements[1].integer.value = 0; |
| 71 | } | 111 | } |
| 72 | 112 | ||
| 73 | status = acpi_evaluate_object(handle, "ATIF", &atif_arg, &buffer); | 113 | status = acpi_evaluate_object(atif->handle, NULL, &atif_arg, |
| 114 | &buffer); | ||
| 74 | 115 | ||
| 75 | /* Fail only if calling the method fails and ATIF is supported */ | 116 | /* Fail only if calling the method fails and ATIF is supported */ |
| 76 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { | 117 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
| @@ -141,15 +182,14 @@ static void amdgpu_atif_parse_functions(struct amdgpu_atif_functions *f, u32 mas | |||
| 141 | * (all asics). | 182 | * (all asics). |
| 142 | * returns 0 on success, error on failure. | 183 | * returns 0 on success, error on failure. |
| 143 | */ | 184 | */ |
| 144 | static int amdgpu_atif_verify_interface(acpi_handle handle, | 185 | static int amdgpu_atif_verify_interface(struct amdgpu_atif *atif) |
| 145 | struct amdgpu_atif *atif) | ||
| 146 | { | 186 | { |
| 147 | union acpi_object *info; | 187 | union acpi_object *info; |
| 148 | struct atif_verify_interface output; | 188 | struct atif_verify_interface output; |
| 149 | size_t size; | 189 | size_t size; |
| 150 | int err = 0; | 190 | int err = 0; |
| 151 | 191 | ||
| 152 | info = amdgpu_atif_call(handle, ATIF_FUNCTION_VERIFY_INTERFACE, NULL); | 192 | info = amdgpu_atif_call(atif, ATIF_FUNCTION_VERIFY_INTERFACE, NULL); |
| 153 | if (!info) | 193 | if (!info) |
| 154 | return -EIO; | 194 | return -EIO; |
| 155 | 195 | ||
| @@ -176,6 +216,35 @@ out: | |||
| 176 | return err; | 216 | return err; |
| 177 | } | 217 | } |
| 178 | 218 | ||
| 219 | static acpi_handle amdgpu_atif_probe_handle(acpi_handle dhandle) | ||
| 220 | { | ||
| 221 | acpi_handle handle = NULL; | ||
| 222 | char acpi_method_name[255] = { 0 }; | ||
| 223 | struct acpi_buffer buffer = { sizeof(acpi_method_name), acpi_method_name }; | ||
| 224 | acpi_status status; | ||
| 225 | |||
| 226 | /* For PX/HG systems, ATIF and ATPX are in the iGPU's namespace, on dGPU only | ||
| 227 | * systems, ATIF is in the dGPU's namespace. | ||
| 228 | */ | ||
| 229 | status = acpi_get_handle(dhandle, "ATIF", &handle); | ||
| 230 | if (ACPI_SUCCESS(status)) | ||
| 231 | goto out; | ||
| 232 | |||
| 233 | if (amdgpu_has_atpx()) { | ||
| 234 | status = acpi_get_handle(amdgpu_atpx_get_dhandle(), "ATIF", | ||
| 235 | &handle); | ||
| 236 | if (ACPI_SUCCESS(status)) | ||
| 237 | goto out; | ||
| 238 | } | ||
| 239 | |||
| 240 | DRM_DEBUG_DRIVER("No ATIF handle found\n"); | ||
| 241 | return NULL; | ||
| 242 | out: | ||
| 243 | acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); | ||
| 244 | DRM_DEBUG_DRIVER("Found ATIF handle %s\n", acpi_method_name); | ||
| 245 | return handle; | ||
| 246 | } | ||
| 247 | |||
| 179 | /** | 248 | /** |
| 180 | * amdgpu_atif_get_notification_params - determine notify configuration | 249 | * amdgpu_atif_get_notification_params - determine notify configuration |
| 181 | * | 250 | * |
| @@ -188,15 +257,16 @@ out: | |||
| 188 | * where n is specified in the result if a notifier is used. | 257 | * where n is specified in the result if a notifier is used. |
| 189 | * Returns 0 on success, error on failure. | 258 | * Returns 0 on success, error on failure. |
| 190 | */ | 259 | */ |
| 191 | static int amdgpu_atif_get_notification_params(acpi_handle handle, | 260 | static int amdgpu_atif_get_notification_params(struct amdgpu_atif *atif) |
| 192 | struct amdgpu_atif_notification_cfg *n) | ||
| 193 | { | 261 | { |
| 194 | union acpi_object *info; | 262 | union acpi_object *info; |
| 263 | struct amdgpu_atif_notification_cfg *n = &atif->notification_cfg; | ||
| 195 | struct atif_system_params params; | 264 | struct atif_system_params params; |
| 196 | size_t size; | 265 | size_t size; |
| 197 | int err = 0; | 266 | int err = 0; |
| 198 | 267 | ||
| 199 | info = amdgpu_atif_call(handle, ATIF_FUNCTION_GET_SYSTEM_PARAMETERS, NULL); | 268 | info = amdgpu_atif_call(atif, ATIF_FUNCTION_GET_SYSTEM_PARAMETERS, |
| 269 | NULL); | ||
| 200 | if (!info) { | 270 | if (!info) { |
| 201 | err = -EIO; | 271 | err = -EIO; |
| 202 | goto out; | 272 | goto out; |
| @@ -250,14 +320,15 @@ out: | |||
| 250 | * (all asics). | 320 | * (all asics). |
| 251 | * Returns 0 on success, error on failure. | 321 | * Returns 0 on success, error on failure. |
| 252 | */ | 322 | */ |
| 253 | static int amdgpu_atif_get_sbios_requests(acpi_handle handle, | 323 | static int amdgpu_atif_get_sbios_requests(struct amdgpu_atif *atif, |
| 254 | struct atif_sbios_requests *req) | 324 | struct atif_sbios_requests *req) |
| 255 | { | 325 | { |
| 256 | union acpi_object *info; | 326 | union acpi_object *info; |
| 257 | size_t size; | 327 | size_t size; |
| 258 | int count = 0; | 328 | int count = 0; |
| 259 | 329 | ||
| 260 | info = amdgpu_atif_call(handle, ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS, NULL); | 330 | info = amdgpu_atif_call(atif, ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS, |
| 331 | NULL); | ||
| 261 | if (!info) | 332 | if (!info) |
| 262 | return -EIO; | 333 | return -EIO; |
| 263 | 334 | ||
| @@ -290,11 +361,10 @@ out: | |||
| 290 | * Returns NOTIFY code | 361 | * Returns NOTIFY code |
| 291 | */ | 362 | */ |
| 292 | static int amdgpu_atif_handler(struct amdgpu_device *adev, | 363 | static int amdgpu_atif_handler(struct amdgpu_device *adev, |
| 293 | struct acpi_bus_event *event) | 364 | struct acpi_bus_event *event) |
| 294 | { | 365 | { |
| 295 | struct amdgpu_atif *atif = &adev->atif; | 366 | struct amdgpu_atif *atif = adev->atif; |
| 296 | struct atif_sbios_requests req; | 367 | struct atif_sbios_requests req; |
| 297 | acpi_handle handle; | ||
| 298 | int count; | 368 | int count; |
| 299 | 369 | ||
| 300 | DRM_DEBUG_DRIVER("event, device_class = %s, type = %#x\n", | 370 | DRM_DEBUG_DRIVER("event, device_class = %s, type = %#x\n", |
| @@ -303,14 +373,14 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev, | |||
| 303 | if (strcmp(event->device_class, ACPI_VIDEO_CLASS) != 0) | 373 | if (strcmp(event->device_class, ACPI_VIDEO_CLASS) != 0) |
| 304 | return NOTIFY_DONE; | 374 | return NOTIFY_DONE; |
| 305 | 375 | ||
| 306 | if (!atif->notification_cfg.enabled || | 376 | if (!atif || |
| 377 | !atif->notification_cfg.enabled || | ||
| 307 | event->type != atif->notification_cfg.command_code) | 378 | event->type != atif->notification_cfg.command_code) |
| 308 | /* Not our event */ | 379 | /* Not our event */ |
| 309 | return NOTIFY_DONE; | 380 | return NOTIFY_DONE; |
| 310 | 381 | ||
| 311 | /* Check pending SBIOS requests */ | 382 | /* Check pending SBIOS requests */ |
| 312 | handle = ACPI_HANDLE(&adev->pdev->dev); | 383 | count = amdgpu_atif_get_sbios_requests(atif, &req); |
| 313 | count = amdgpu_atif_get_sbios_requests(handle, &req); | ||
| 314 | 384 | ||
| 315 | if (count <= 0) | 385 | if (count <= 0) |
| 316 | return NOTIFY_DONE; | 386 | return NOTIFY_DONE; |
| @@ -641,8 +711,8 @@ static int amdgpu_acpi_event(struct notifier_block *nb, | |||
| 641 | */ | 711 | */ |
| 642 | int amdgpu_acpi_init(struct amdgpu_device *adev) | 712 | int amdgpu_acpi_init(struct amdgpu_device *adev) |
| 643 | { | 713 | { |
| 644 | acpi_handle handle; | 714 | acpi_handle handle, atif_handle; |
| 645 | struct amdgpu_atif *atif = &adev->atif; | 715 | struct amdgpu_atif *atif; |
| 646 | struct amdgpu_atcs *atcs = &adev->atcs; | 716 | struct amdgpu_atcs *atcs = &adev->atcs; |
| 647 | int ret; | 717 | int ret; |
| 648 | 718 | ||
| @@ -658,12 +728,26 @@ int amdgpu_acpi_init(struct amdgpu_device *adev) | |||
| 658 | DRM_DEBUG_DRIVER("Call to ATCS verify_interface failed: %d\n", ret); | 728 | DRM_DEBUG_DRIVER("Call to ATCS verify_interface failed: %d\n", ret); |
| 659 | } | 729 | } |
| 660 | 730 | ||
| 731 | /* Probe for ATIF, and initialize it if found */ | ||
| 732 | atif_handle = amdgpu_atif_probe_handle(handle); | ||
| 733 | if (!atif_handle) | ||
| 734 | goto out; | ||
| 735 | |||
| 736 | atif = kzalloc(sizeof(*atif), GFP_KERNEL); | ||
| 737 | if (!atif) { | ||
| 738 | DRM_WARN("Not enough memory to initialize ATIF\n"); | ||
| 739 | goto out; | ||
| 740 | } | ||
| 741 | atif->handle = atif_handle; | ||
| 742 | |||
| 661 | /* Call the ATIF method */ | 743 | /* Call the ATIF method */ |
| 662 | ret = amdgpu_atif_verify_interface(handle, atif); | 744 | ret = amdgpu_atif_verify_interface(atif); |
| 663 | if (ret) { | 745 | if (ret) { |
| 664 | DRM_DEBUG_DRIVER("Call to ATIF verify_interface failed: %d\n", ret); | 746 | DRM_DEBUG_DRIVER("Call to ATIF verify_interface failed: %d\n", ret); |
| 747 | kfree(atif); | ||
| 665 | goto out; | 748 | goto out; |
| 666 | } | 749 | } |
| 750 | adev->atif = atif; | ||
| 667 | 751 | ||
| 668 | if (atif->notifications.brightness_change) { | 752 | if (atif->notifications.brightness_change) { |
| 669 | struct drm_encoder *tmp; | 753 | struct drm_encoder *tmp; |
| @@ -693,8 +777,7 @@ int amdgpu_acpi_init(struct amdgpu_device *adev) | |||
| 693 | } | 777 | } |
| 694 | 778 | ||
| 695 | if (atif->functions.system_params) { | 779 | if (atif->functions.system_params) { |
| 696 | ret = amdgpu_atif_get_notification_params(handle, | 780 | ret = amdgpu_atif_get_notification_params(atif); |
| 697 | &atif->notification_cfg); | ||
| 698 | if (ret) { | 781 | if (ret) { |
| 699 | DRM_DEBUG_DRIVER("Call to GET_SYSTEM_PARAMS failed: %d\n", | 782 | DRM_DEBUG_DRIVER("Call to GET_SYSTEM_PARAMS failed: %d\n", |
| 700 | ret); | 783 | ret); |
| @@ -720,4 +803,6 @@ out: | |||
| 720 | void amdgpu_acpi_fini(struct amdgpu_device *adev) | 803 | void amdgpu_acpi_fini(struct amdgpu_device *adev) |
| 721 | { | 804 | { |
| 722 | unregister_acpi_notifier(&adev->acpi_nb); | 805 | unregister_acpi_notifier(&adev->acpi_nb); |
| 806 | if (adev->atif) | ||
| 807 | kfree(adev->atif); | ||
| 723 | } | 808 | } |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c index daa06e7c5bb7..9ab89371d9e8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | |||
| @@ -90,6 +90,12 @@ bool amdgpu_atpx_dgpu_req_power_for_displays(void) { | |||
| 90 | return amdgpu_atpx_priv.atpx.dgpu_req_power_for_displays; | 90 | return amdgpu_atpx_priv.atpx.dgpu_req_power_for_displays; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | #if defined(CONFIG_ACPI) | ||
| 94 | void *amdgpu_atpx_get_dhandle(void) { | ||
| 95 | return amdgpu_atpx_priv.dhandle; | ||
| 96 | } | ||
| 97 | #endif | ||
| 98 | |||
| 93 | /** | 99 | /** |
| 94 | * amdgpu_atpx_call - call an ATPX method | 100 | * amdgpu_atpx_call - call an ATPX method |
| 95 | * | 101 | * |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index 39ec6b8890a1..e74d620d9699 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | |||
| @@ -376,7 +376,7 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring, | |||
| 376 | struct amdgpu_device *adev = ring->adev; | 376 | struct amdgpu_device *adev = ring->adev; |
| 377 | uint64_t index; | 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 | ring->fence_drv.cpu_addr = &adev->wb.wb[ring->fence_offs]; | 380 | ring->fence_drv.cpu_addr = &adev->wb.wb[ring->fence_offs]; |
| 381 | ring->fence_drv.gpu_addr = adev->wb.gpu_addr + (ring->fence_offs * 4); | 381 | ring->fence_drv.gpu_addr = adev->wb.gpu_addr + (ring->fence_offs * 4); |
| 382 | } else { | 382 | } else { |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index f70eeed9ed76..7aaa263ad8c7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | |||
| @@ -231,6 +231,12 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, | |||
| 231 | if (ib->flags & AMDGPU_IB_FLAG_TC_WB_NOT_INVALIDATE) | 231 | if (ib->flags & AMDGPU_IB_FLAG_TC_WB_NOT_INVALIDATE) |
| 232 | fence_flags |= AMDGPU_FENCE_FLAG_TC_WB_ONLY; | 232 | fence_flags |= AMDGPU_FENCE_FLAG_TC_WB_ONLY; |
| 233 | 233 | ||
| 234 | /* wrap the last IB with fence */ | ||
| 235 | if (job && job->uf_addr) { | ||
| 236 | amdgpu_ring_emit_fence(ring, job->uf_addr, job->uf_sequence, | ||
| 237 | fence_flags | AMDGPU_FENCE_FLAG_64BIT); | ||
| 238 | } | ||
| 239 | |||
| 234 | r = amdgpu_fence_emit(ring, f, fence_flags); | 240 | r = amdgpu_fence_emit(ring, f, fence_flags); |
| 235 | if (r) { | 241 | if (r) { |
| 236 | dev_err(adev->dev, "failed to emit fence (%d)\n", r); | 242 | dev_err(adev->dev, "failed to emit fence (%d)\n", r); |
| @@ -243,12 +249,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, | |||
| 243 | if (ring->funcs->insert_end) | 249 | if (ring->funcs->insert_end) |
| 244 | ring->funcs->insert_end(ring); | 250 | ring->funcs->insert_end(ring); |
| 245 | 251 | ||
| 246 | /* wrap the last IB with fence */ | ||
| 247 | if (job && job->uf_addr) { | ||
| 248 | amdgpu_ring_emit_fence(ring, job->uf_addr, job->uf_sequence, | ||
| 249 | fence_flags | AMDGPU_FENCE_FLAG_64BIT); | ||
| 250 | } | ||
| 251 | |||
| 252 | if (patch_offset != ~0 && ring->funcs->patch_cond_exec) | 252 | if (patch_offset != ~0 && ring->funcs->patch_cond_exec) |
| 253 | amdgpu_ring_patch_cond_exec(ring, patch_offset); | 253 | amdgpu_ring_patch_cond_exec(ring, patch_offset); |
| 254 | 254 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index b455da487782..fc818b4d849c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
| @@ -1882,7 +1882,7 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev) | |||
| 1882 | if (!amdgpu_device_has_dc_support(adev)) { | 1882 | if (!amdgpu_device_has_dc_support(adev)) { |
| 1883 | mutex_lock(&adev->pm.mutex); | 1883 | mutex_lock(&adev->pm.mutex); |
| 1884 | amdgpu_dpm_get_active_displays(adev); | 1884 | amdgpu_dpm_get_active_displays(adev); |
| 1885 | adev->pm.pm_display_cfg.num_display = adev->pm.dpm.new_active_crtcs; | 1885 | adev->pm.pm_display_cfg.num_display = adev->pm.dpm.new_active_crtc_count; |
| 1886 | adev->pm.pm_display_cfg.vrefresh = amdgpu_dpm_get_vrefresh(adev); | 1886 | adev->pm.pm_display_cfg.vrefresh = amdgpu_dpm_get_vrefresh(adev); |
| 1887 | adev->pm.pm_display_cfg.min_vblank_time = amdgpu_dpm_get_vblank_time(adev); | 1887 | adev->pm.pm_display_cfg.min_vblank_time = amdgpu_dpm_get_vblank_time(adev); |
| 1888 | /* we have issues with mclk switching with refresh rates over 120 hz on the non-DC code. */ | 1888 | /* we have issues with mclk switching with refresh rates over 120 hz on the non-DC code. */ |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c index 127e87b470ff..1b4ad9b2a755 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | |||
| @@ -52,7 +52,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) | |||
| 52 | unsigned long bo_size; | 52 | unsigned long bo_size; |
| 53 | const char *fw_name; | 53 | const char *fw_name; |
| 54 | const struct common_firmware_header *hdr; | 54 | const struct common_firmware_header *hdr; |
| 55 | unsigned version_major, version_minor, family_id; | 55 | unsigned char fw_check; |
| 56 | int r; | 56 | int r; |
| 57 | 57 | ||
| 58 | INIT_DELAYED_WORK(&adev->vcn.idle_work, amdgpu_vcn_idle_work_handler); | 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) | |||
| 83 | 83 | ||
| 84 | hdr = (const struct common_firmware_header *)adev->vcn.fw->data; | 84 | hdr = (const struct common_firmware_header *)adev->vcn.fw->data; |
| 85 | adev->vcn.fw_version = le32_to_cpu(hdr->ucode_version); | 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 | bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8) | 114 | bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8) |
| 94 | + AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_HEAP_SIZE | 115 | + AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_HEAP_SIZE |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index b0eb2f537392..edf16b2b957a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
| @@ -1463,7 +1463,9 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, | |||
| 1463 | uint64_t count; | 1463 | uint64_t count; |
| 1464 | 1464 | ||
| 1465 | max_entries = min(max_entries, 16ull * 1024ull); | 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 | uint64_t idx = pfn + count; | 1469 | uint64_t idx = pfn + count; |
| 1468 | 1470 | ||
| 1469 | if (pages_addr[idx] != | 1471 | if (pages_addr[idx] != |
| @@ -1476,7 +1478,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, | |||
| 1476 | dma_addr = pages_addr; | 1478 | dma_addr = pages_addr; |
| 1477 | } else { | 1479 | } else { |
| 1478 | addr = pages_addr[pfn]; | 1480 | addr = pages_addr[pfn]; |
| 1479 | max_entries = count; | 1481 | max_entries = count * (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE); |
| 1480 | } | 1482 | } |
| 1481 | 1483 | ||
| 1482 | } else if (flags & AMDGPU_PTE_VALID) { | 1484 | } else if (flags & AMDGPU_PTE_VALID) { |
| @@ -1491,7 +1493,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, | |||
| 1491 | if (r) | 1493 | if (r) |
| 1492 | return r; | 1494 | return r; |
| 1493 | 1495 | ||
| 1494 | pfn += last - start + 1; | 1496 | pfn += (last - start + 1) / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE); |
| 1495 | if (nodes && nodes->size == pfn) { | 1497 | if (nodes && nodes->size == pfn) { |
| 1496 | pfn = 0; | 1498 | pfn = 0; |
| 1497 | ++nodes; | 1499 | ++nodes; |
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c index 0999c843f623..a71b97519cc0 100644 --- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | |||
| @@ -900,7 +900,7 @@ static const struct amdgpu_ring_funcs vce_v3_0_ring_phys_funcs = { | |||
| 900 | .emit_frame_size = | 900 | .emit_frame_size = |
| 901 | 4 + /* vce_v3_0_emit_pipeline_sync */ | 901 | 4 + /* vce_v3_0_emit_pipeline_sync */ |
| 902 | 6, /* amdgpu_vce_ring_emit_fence x1 no user fence */ | 902 | 6, /* amdgpu_vce_ring_emit_fence x1 no user fence */ |
| 903 | .emit_ib_size = 5, /* vce_v3_0_ring_emit_ib */ | 903 | .emit_ib_size = 4, /* amdgpu_vce_ring_emit_ib */ |
| 904 | .emit_ib = amdgpu_vce_ring_emit_ib, | 904 | .emit_ib = amdgpu_vce_ring_emit_ib, |
| 905 | .emit_fence = amdgpu_vce_ring_emit_fence, | 905 | .emit_fence = amdgpu_vce_ring_emit_fence, |
| 906 | .test_ring = amdgpu_vce_ring_test_ring, | 906 | .test_ring = amdgpu_vce_ring_test_ring, |
| @@ -924,7 +924,7 @@ static const struct amdgpu_ring_funcs vce_v3_0_ring_vm_funcs = { | |||
| 924 | 6 + /* vce_v3_0_emit_vm_flush */ | 924 | 6 + /* vce_v3_0_emit_vm_flush */ |
| 925 | 4 + /* vce_v3_0_emit_pipeline_sync */ | 925 | 4 + /* vce_v3_0_emit_pipeline_sync */ |
| 926 | 6 + 6, /* amdgpu_vce_ring_emit_fence x2 vm fence */ | 926 | 6 + 6, /* amdgpu_vce_ring_emit_fence x2 vm fence */ |
| 927 | .emit_ib_size = 4, /* amdgpu_vce_ring_emit_ib */ | 927 | .emit_ib_size = 5, /* vce_v3_0_ring_emit_ib */ |
| 928 | .emit_ib = vce_v3_0_ring_emit_ib, | 928 | .emit_ib = vce_v3_0_ring_emit_ib, |
| 929 | .emit_vm_flush = vce_v3_0_emit_vm_flush, | 929 | .emit_vm_flush = vce_v3_0_emit_vm_flush, |
| 930 | .emit_pipeline_sync = vce_v3_0_emit_pipeline_sync, | 930 | .emit_pipeline_sync = vce_v3_0_emit_pipeline_sync, |
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index f9add85157e7..770c6b24be0b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |||
| @@ -2175,6 +2175,46 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing) | |||
| 2175 | return color_space; | 2175 | return color_space; |
| 2176 | } | 2176 | } |
| 2177 | 2177 | ||
| 2178 | static void reduce_mode_colour_depth(struct dc_crtc_timing *timing_out) | ||
| 2179 | { | ||
| 2180 | if (timing_out->display_color_depth <= COLOR_DEPTH_888) | ||
| 2181 | return; | ||
| 2182 | |||
| 2183 | timing_out->display_color_depth--; | ||
| 2184 | } | ||
| 2185 | |||
| 2186 | static void adjust_colour_depth_from_display_info(struct dc_crtc_timing *timing_out, | ||
| 2187 | const struct drm_display_info *info) | ||
| 2188 | { | ||
| 2189 | int normalized_clk; | ||
| 2190 | if (timing_out->display_color_depth <= COLOR_DEPTH_888) | ||
| 2191 | return; | ||
| 2192 | do { | ||
| 2193 | normalized_clk = timing_out->pix_clk_khz; | ||
| 2194 | /* YCbCr 4:2:0 requires additional adjustment of 1/2 */ | ||
| 2195 | if (timing_out->pixel_encoding == PIXEL_ENCODING_YCBCR420) | ||
| 2196 | normalized_clk /= 2; | ||
| 2197 | /* Adjusting pix clock following on HDMI spec based on colour depth */ | ||
| 2198 | switch (timing_out->display_color_depth) { | ||
| 2199 | case COLOR_DEPTH_101010: | ||
| 2200 | normalized_clk = (normalized_clk * 30) / 24; | ||
| 2201 | break; | ||
| 2202 | case COLOR_DEPTH_121212: | ||
| 2203 | normalized_clk = (normalized_clk * 36) / 24; | ||
| 2204 | break; | ||
| 2205 | case COLOR_DEPTH_161616: | ||
| 2206 | normalized_clk = (normalized_clk * 48) / 24; | ||
| 2207 | break; | ||
| 2208 | default: | ||
| 2209 | return; | ||
| 2210 | } | ||
| 2211 | if (normalized_clk <= info->max_tmds_clock) | ||
| 2212 | return; | ||
| 2213 | reduce_mode_colour_depth(timing_out); | ||
| 2214 | |||
| 2215 | } while (timing_out->display_color_depth > COLOR_DEPTH_888); | ||
| 2216 | |||
| 2217 | } | ||
| 2178 | /*****************************************************************************/ | 2218 | /*****************************************************************************/ |
| 2179 | 2219 | ||
| 2180 | static void | 2220 | static void |
| @@ -2183,6 +2223,7 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream, | |||
| 2183 | const struct drm_connector *connector) | 2223 | const struct drm_connector *connector) |
| 2184 | { | 2224 | { |
| 2185 | struct dc_crtc_timing *timing_out = &stream->timing; | 2225 | struct dc_crtc_timing *timing_out = &stream->timing; |
| 2226 | const struct drm_display_info *info = &connector->display_info; | ||
| 2186 | 2227 | ||
| 2187 | memset(timing_out, 0, sizeof(struct dc_crtc_timing)); | 2228 | memset(timing_out, 0, sizeof(struct dc_crtc_timing)); |
| 2188 | 2229 | ||
| @@ -2191,8 +2232,10 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream, | |||
| 2191 | timing_out->v_border_top = 0; | 2232 | timing_out->v_border_top = 0; |
| 2192 | timing_out->v_border_bottom = 0; | 2233 | timing_out->v_border_bottom = 0; |
| 2193 | /* TODO: un-hardcode */ | 2234 | /* TODO: un-hardcode */ |
| 2194 | 2235 | if (drm_mode_is_420_only(info, mode_in) | |
| 2195 | if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB444) | 2236 | && stream->sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A) |
| 2237 | timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420; | ||
| 2238 | else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB444) | ||
| 2196 | && stream->sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A) | 2239 | && stream->sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A) |
| 2197 | timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR444; | 2240 | timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR444; |
| 2198 | else | 2241 | else |
| @@ -2228,6 +2271,8 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream, | |||
| 2228 | 2271 | ||
| 2229 | stream->out_transfer_func->type = TF_TYPE_PREDEFINED; | 2272 | stream->out_transfer_func->type = TF_TYPE_PREDEFINED; |
| 2230 | stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB; | 2273 | stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB; |
| 2274 | if (stream->sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A) | ||
| 2275 | adjust_colour_depth_from_display_info(timing_out, info); | ||
| 2231 | } | 2276 | } |
| 2232 | 2277 | ||
| 2233 | static void fill_audio_info(struct audio_info *audio_info, | 2278 | static void fill_audio_info(struct audio_info *audio_info, |
| @@ -3928,10 +3973,11 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc, | |||
| 3928 | if (acrtc->base.state->event) | 3973 | if (acrtc->base.state->event) |
| 3929 | prepare_flip_isr(acrtc); | 3974 | prepare_flip_isr(acrtc); |
| 3930 | 3975 | ||
| 3976 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | ||
| 3977 | |||
| 3931 | surface_updates->surface = dc_stream_get_status(acrtc_state->stream)->plane_states[0]; | 3978 | surface_updates->surface = dc_stream_get_status(acrtc_state->stream)->plane_states[0]; |
| 3932 | surface_updates->flip_addr = &addr; | 3979 | surface_updates->flip_addr = &addr; |
| 3933 | 3980 | ||
| 3934 | |||
| 3935 | dc_commit_updates_for_stream(adev->dm.dc, | 3981 | dc_commit_updates_for_stream(adev->dm.dc, |
| 3936 | surface_updates, | 3982 | surface_updates, |
| 3937 | 1, | 3983 | 1, |
| @@ -3944,9 +3990,6 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc, | |||
| 3944 | __func__, | 3990 | __func__, |
| 3945 | addr.address.grph.addr.high_part, | 3991 | addr.address.grph.addr.high_part, |
| 3946 | addr.address.grph.addr.low_part); | 3992 | addr.address.grph.addr.low_part); |
| 3947 | |||
| 3948 | |||
| 3949 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | ||
| 3950 | } | 3993 | } |
| 3951 | 3994 | ||
| 3952 | /* | 3995 | /* |
| @@ -4206,6 +4249,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) | |||
| 4206 | struct drm_connector *connector; | 4249 | struct drm_connector *connector; |
| 4207 | struct drm_connector_state *old_con_state, *new_con_state; | 4250 | struct drm_connector_state *old_con_state, *new_con_state; |
| 4208 | struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state; | 4251 | struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state; |
| 4252 | int crtc_disable_count = 0; | ||
| 4209 | 4253 | ||
| 4210 | drm_atomic_helper_update_legacy_modeset_state(dev, state); | 4254 | drm_atomic_helper_update_legacy_modeset_state(dev, state); |
| 4211 | 4255 | ||
| @@ -4410,6 +4454,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) | |||
| 4410 | struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); | 4454 | struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); |
| 4411 | bool modeset_needed; | 4455 | bool modeset_needed; |
| 4412 | 4456 | ||
| 4457 | if (old_crtc_state->active && !new_crtc_state->active) | ||
| 4458 | crtc_disable_count++; | ||
| 4459 | |||
| 4413 | dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); | 4460 | dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); |
| 4414 | dm_old_crtc_state = to_dm_crtc_state(old_crtc_state); | 4461 | dm_old_crtc_state = to_dm_crtc_state(old_crtc_state); |
| 4415 | modeset_needed = modeset_required( | 4462 | modeset_needed = modeset_required( |
| @@ -4463,11 +4510,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) | |||
| 4463 | * so we can put the GPU into runtime suspend if we're not driving any | 4510 | * so we can put the GPU into runtime suspend if we're not driving any |
| 4464 | * displays anymore | 4511 | * displays anymore |
| 4465 | */ | 4512 | */ |
| 4513 | for (i = 0; i < crtc_disable_count; i++) | ||
| 4514 | pm_runtime_put_autosuspend(dev->dev); | ||
| 4466 | pm_runtime_mark_last_busy(dev->dev); | 4515 | 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 | } | 4516 | } |
| 4472 | 4517 | ||
| 4473 | 4518 | ||
diff --git a/drivers/gpu/drm/amd/include/atomfirmware.h b/drivers/gpu/drm/amd/include/atomfirmware.h index 092d800b703a..33b4de4ad66e 100644 --- a/drivers/gpu/drm/amd/include/atomfirmware.h +++ b/drivers/gpu/drm/amd/include/atomfirmware.h | |||
| @@ -1433,7 +1433,10 @@ struct atom_smc_dpm_info_v4_1 | |||
| 1433 | uint8_t acggfxclkspreadpercent; | 1433 | uint8_t acggfxclkspreadpercent; |
| 1434 | uint16_t acggfxclkspreadfreq; | 1434 | uint16_t acggfxclkspreadfreq; |
| 1435 | 1435 | ||
| 1436 | uint32_t boardreserved[10]; | 1436 | uint8_t Vr2_I2C_address; |
| 1437 | uint8_t padding_vr2[3]; | ||
| 1438 | |||
| 1439 | uint32_t boardreserved[9]; | ||
| 1437 | }; | 1440 | }; |
| 1438 | 1441 | ||
| 1439 | /* | 1442 | /* |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c index 5325661fedff..d27c1c9df286 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c | |||
| @@ -512,14 +512,82 @@ int pp_atomfwctrl_get_clk_information_by_clkid(struct pp_hwmgr *hwmgr, BIOS_CLKI | |||
| 512 | return 0; | 512 | return 0; |
| 513 | } | 513 | } |
| 514 | 514 | ||
| 515 | static void pp_atomfwctrl_copy_vbios_bootup_values_3_2(struct pp_hwmgr *hwmgr, | ||
| 516 | struct pp_atomfwctrl_bios_boot_up_values *boot_values, | ||
| 517 | struct atom_firmware_info_v3_2 *fw_info) | ||
| 518 | { | ||
| 519 | uint32_t frequency = 0; | ||
| 520 | |||
| 521 | boot_values->ulRevision = fw_info->firmware_revision; | ||
| 522 | boot_values->ulGfxClk = fw_info->bootup_sclk_in10khz; | ||
| 523 | boot_values->ulUClk = fw_info->bootup_mclk_in10khz; | ||
| 524 | boot_values->usVddc = fw_info->bootup_vddc_mv; | ||
| 525 | boot_values->usVddci = fw_info->bootup_vddci_mv; | ||
| 526 | boot_values->usMvddc = fw_info->bootup_mvddc_mv; | ||
| 527 | boot_values->usVddGfx = fw_info->bootup_vddgfx_mv; | ||
| 528 | boot_values->ucCoolingID = fw_info->coolingsolution_id; | ||
| 529 | boot_values->ulSocClk = 0; | ||
| 530 | boot_values->ulDCEFClk = 0; | ||
| 531 | |||
| 532 | if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU11_SYSPLL0_SOCCLK_ID, &frequency)) | ||
| 533 | boot_values->ulSocClk = frequency; | ||
| 534 | |||
| 535 | if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU11_SYSPLL0_DCEFCLK_ID, &frequency)) | ||
| 536 | boot_values->ulDCEFClk = frequency; | ||
| 537 | |||
| 538 | if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU11_SYSPLL0_ECLK_ID, &frequency)) | ||
| 539 | boot_values->ulEClk = frequency; | ||
| 540 | |||
| 541 | if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU11_SYSPLL0_VCLK_ID, &frequency)) | ||
| 542 | boot_values->ulVClk = frequency; | ||
| 543 | |||
| 544 | if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU11_SYSPLL0_DCLK_ID, &frequency)) | ||
| 545 | boot_values->ulDClk = frequency; | ||
| 546 | } | ||
| 547 | |||
| 548 | static void pp_atomfwctrl_copy_vbios_bootup_values_3_1(struct pp_hwmgr *hwmgr, | ||
| 549 | struct pp_atomfwctrl_bios_boot_up_values *boot_values, | ||
| 550 | struct atom_firmware_info_v3_1 *fw_info) | ||
| 551 | { | ||
| 552 | uint32_t frequency = 0; | ||
| 553 | |||
| 554 | boot_values->ulRevision = fw_info->firmware_revision; | ||
| 555 | boot_values->ulGfxClk = fw_info->bootup_sclk_in10khz; | ||
| 556 | boot_values->ulUClk = fw_info->bootup_mclk_in10khz; | ||
| 557 | boot_values->usVddc = fw_info->bootup_vddc_mv; | ||
| 558 | boot_values->usVddci = fw_info->bootup_vddci_mv; | ||
| 559 | boot_values->usMvddc = fw_info->bootup_mvddc_mv; | ||
| 560 | boot_values->usVddGfx = fw_info->bootup_vddgfx_mv; | ||
| 561 | boot_values->ucCoolingID = fw_info->coolingsolution_id; | ||
| 562 | boot_values->ulSocClk = 0; | ||
| 563 | boot_values->ulDCEFClk = 0; | ||
| 564 | |||
| 565 | if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU9_SYSPLL0_SOCCLK_ID, &frequency)) | ||
| 566 | boot_values->ulSocClk = frequency; | ||
| 567 | |||
| 568 | if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU9_SYSPLL0_DCEFCLK_ID, &frequency)) | ||
| 569 | boot_values->ulDCEFClk = frequency; | ||
| 570 | |||
| 571 | if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU9_SYSPLL0_ECLK_ID, &frequency)) | ||
| 572 | boot_values->ulEClk = frequency; | ||
| 573 | |||
| 574 | if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU9_SYSPLL0_VCLK_ID, &frequency)) | ||
| 575 | boot_values->ulVClk = frequency; | ||
| 576 | |||
| 577 | if (!pp_atomfwctrl_get_clk_information_by_clkid(hwmgr, SMU9_SYSPLL0_DCLK_ID, &frequency)) | ||
| 578 | boot_values->ulDClk = frequency; | ||
| 579 | } | ||
| 580 | |||
| 515 | int pp_atomfwctrl_get_vbios_bootup_values(struct pp_hwmgr *hwmgr, | 581 | int pp_atomfwctrl_get_vbios_bootup_values(struct pp_hwmgr *hwmgr, |
| 516 | struct pp_atomfwctrl_bios_boot_up_values *boot_values) | 582 | struct pp_atomfwctrl_bios_boot_up_values *boot_values) |
| 517 | { | 583 | { |
| 518 | struct atom_firmware_info_v3_1 *info = NULL; | 584 | struct atom_firmware_info_v3_2 *fwinfo_3_2; |
| 585 | struct atom_firmware_info_v3_1 *fwinfo_3_1; | ||
| 586 | struct atom_common_table_header *info = NULL; | ||
| 519 | uint16_t ix; | 587 | uint16_t ix; |
| 520 | 588 | ||
| 521 | ix = GetIndexIntoMasterDataTable(firmwareinfo); | 589 | ix = GetIndexIntoMasterDataTable(firmwareinfo); |
| 522 | info = (struct atom_firmware_info_v3_1 *) | 590 | info = (struct atom_common_table_header *) |
| 523 | smu_atom_get_data_table(hwmgr->adev, | 591 | smu_atom_get_data_table(hwmgr->adev, |
| 524 | ix, NULL, NULL, NULL); | 592 | ix, NULL, NULL, NULL); |
| 525 | 593 | ||
| @@ -528,16 +596,18 @@ int pp_atomfwctrl_get_vbios_bootup_values(struct pp_hwmgr *hwmgr, | |||
| 528 | return -EINVAL; | 596 | return -EINVAL; |
| 529 | } | 597 | } |
| 530 | 598 | ||
| 531 | boot_values->ulRevision = info->firmware_revision; | 599 | if ((info->format_revision == 3) && (info->content_revision == 2)) { |
| 532 | boot_values->ulGfxClk = info->bootup_sclk_in10khz; | 600 | fwinfo_3_2 = (struct atom_firmware_info_v3_2 *)info; |
| 533 | boot_values->ulUClk = info->bootup_mclk_in10khz; | 601 | pp_atomfwctrl_copy_vbios_bootup_values_3_2(hwmgr, |
| 534 | boot_values->usVddc = info->bootup_vddc_mv; | 602 | boot_values, fwinfo_3_2); |
| 535 | boot_values->usVddci = info->bootup_vddci_mv; | 603 | } else if ((info->format_revision == 3) && (info->content_revision == 1)) { |
| 536 | boot_values->usMvddc = info->bootup_mvddc_mv; | 604 | fwinfo_3_1 = (struct atom_firmware_info_v3_1 *)info; |
| 537 | boot_values->usVddGfx = info->bootup_vddgfx_mv; | 605 | pp_atomfwctrl_copy_vbios_bootup_values_3_1(hwmgr, |
| 538 | boot_values->ucCoolingID = info->coolingsolution_id; | 606 | boot_values, fwinfo_3_1); |
| 539 | boot_values->ulSocClk = 0; | 607 | } else { |
| 540 | boot_values->ulDCEFClk = 0; | 608 | pr_info("Fw info table revision does not match!"); |
| 609 | return -EINVAL; | ||
| 610 | } | ||
| 541 | 611 | ||
| 542 | return 0; | 612 | return 0; |
| 543 | } | 613 | } |
| @@ -629,5 +699,7 @@ int pp_atomfwctrl_get_smc_dpm_information(struct pp_hwmgr *hwmgr, | |||
| 629 | param->acggfxclkspreadpercent = info->acggfxclkspreadpercent; | 699 | param->acggfxclkspreadpercent = info->acggfxclkspreadpercent; |
| 630 | param->acggfxclkspreadfreq = info->acggfxclkspreadfreq; | 700 | param->acggfxclkspreadfreq = info->acggfxclkspreadfreq; |
| 631 | 701 | ||
| 702 | param->Vr2_I2C_address = info->Vr2_I2C_address; | ||
| 703 | |||
| 632 | return 0; | 704 | return 0; |
| 633 | } | 705 | } |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h index fe10aa4db5e6..22e21668c93a 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h | |||
| @@ -136,6 +136,9 @@ struct pp_atomfwctrl_bios_boot_up_values { | |||
| 136 | uint32_t ulUClk; | 136 | uint32_t ulUClk; |
| 137 | uint32_t ulSocClk; | 137 | uint32_t ulSocClk; |
| 138 | uint32_t ulDCEFClk; | 138 | uint32_t ulDCEFClk; |
| 139 | uint32_t ulEClk; | ||
| 140 | uint32_t ulVClk; | ||
| 141 | uint32_t ulDClk; | ||
| 139 | uint16_t usVddc; | 142 | uint16_t usVddc; |
| 140 | uint16_t usVddci; | 143 | uint16_t usVddci; |
| 141 | uint16_t usMvddc; | 144 | uint16_t usMvddc; |
| @@ -207,6 +210,8 @@ struct pp_atomfwctrl_smc_dpm_parameters | |||
| 207 | uint8_t acggfxclkspreadenabled; | 210 | uint8_t acggfxclkspreadenabled; |
| 208 | uint8_t acggfxclkspreadpercent; | 211 | uint8_t acggfxclkspreadpercent; |
| 209 | uint16_t acggfxclkspreadfreq; | 212 | uint16_t acggfxclkspreadfreq; |
| 213 | |||
| 214 | uint8_t Vr2_I2C_address; | ||
| 210 | }; | 215 | }; |
| 211 | 216 | ||
| 212 | int pp_atomfwctrl_get_gpu_pll_dividers_vega10(struct pp_hwmgr *hwmgr, | 217 | int pp_atomfwctrl_get_gpu_pll_dividers_vega10(struct pp_hwmgr *hwmgr, |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c index 782e2098824d..c98e5de777cd 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | |||
| @@ -81,6 +81,7 @@ static void vega12_set_default_registry_data(struct pp_hwmgr *hwmgr) | |||
| 81 | 81 | ||
| 82 | data->registry_data.disallowed_features = 0x0; | 82 | data->registry_data.disallowed_features = 0x0; |
| 83 | data->registry_data.od_state_in_dc_support = 0; | 83 | data->registry_data.od_state_in_dc_support = 0; |
| 84 | data->registry_data.thermal_support = 1; | ||
| 84 | data->registry_data.skip_baco_hardware = 0; | 85 | data->registry_data.skip_baco_hardware = 0; |
| 85 | 86 | ||
| 86 | data->registry_data.log_avfs_param = 0; | 87 | data->registry_data.log_avfs_param = 0; |
| @@ -803,6 +804,9 @@ static int vega12_init_smc_table(struct pp_hwmgr *hwmgr) | |||
| 803 | data->vbios_boot_state.soc_clock = boot_up_values.ulSocClk; | 804 | data->vbios_boot_state.soc_clock = boot_up_values.ulSocClk; |
| 804 | data->vbios_boot_state.dcef_clock = boot_up_values.ulDCEFClk; | 805 | data->vbios_boot_state.dcef_clock = boot_up_values.ulDCEFClk; |
| 805 | data->vbios_boot_state.uc_cooling_id = boot_up_values.ucCoolingID; | 806 | data->vbios_boot_state.uc_cooling_id = boot_up_values.ucCoolingID; |
| 807 | data->vbios_boot_state.eclock = boot_up_values.ulEClk; | ||
| 808 | data->vbios_boot_state.dclock = boot_up_values.ulDClk; | ||
| 809 | data->vbios_boot_state.vclock = boot_up_values.ulVClk; | ||
| 806 | smum_send_msg_to_smc_with_parameter(hwmgr, | 810 | smum_send_msg_to_smc_with_parameter(hwmgr, |
| 807 | PPSMC_MSG_SetMinDeepSleepDcefclk, | 811 | PPSMC_MSG_SetMinDeepSleepDcefclk, |
| 808 | (uint32_t)(data->vbios_boot_state.dcef_clock / 100)); | 812 | (uint32_t)(data->vbios_boot_state.dcef_clock / 100)); |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.h b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.h index e81ded1ec198..49b38df8c7f2 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.h +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.h | |||
| @@ -167,6 +167,9 @@ struct vega12_vbios_boot_state { | |||
| 167 | uint32_t mem_clock; | 167 | uint32_t mem_clock; |
| 168 | uint32_t soc_clock; | 168 | uint32_t soc_clock; |
| 169 | uint32_t dcef_clock; | 169 | uint32_t dcef_clock; |
| 170 | uint32_t eclock; | ||
| 171 | uint32_t dclock; | ||
| 172 | uint32_t vclock; | ||
| 170 | }; | 173 | }; |
| 171 | 174 | ||
| 172 | #define DPMTABLE_OD_UPDATE_SCLK 0x00000001 | 175 | #define DPMTABLE_OD_UPDATE_SCLK 0x00000001 |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_processpptables.c index 888ddca902d8..29914700ee82 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_processpptables.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_processpptables.c | |||
| @@ -230,6 +230,8 @@ static int append_vbios_pptable(struct pp_hwmgr *hwmgr, PPTable_t *ppsmc_pptable | |||
| 230 | ppsmc_pptable->AcgThresholdFreqLow = 0xFFFF; | 230 | ppsmc_pptable->AcgThresholdFreqLow = 0xFFFF; |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | ppsmc_pptable->Vr2_I2C_address = smc_dpm_table.Vr2_I2C_address; | ||
| 234 | |||
| 233 | return 0; | 235 | return 0; |
| 234 | } | 236 | } |
| 235 | 237 | ||
diff --git a/drivers/gpu/drm/amd/powerplay/inc/vega12/smu9_driver_if.h b/drivers/gpu/drm/amd/powerplay/inc/vega12/smu9_driver_if.h index 2f8a3b983cce..b08526fd1619 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/vega12/smu9_driver_if.h +++ b/drivers/gpu/drm/amd/powerplay/inc/vega12/smu9_driver_if.h | |||
| @@ -499,7 +499,10 @@ typedef struct { | |||
| 499 | uint8_t AcgGfxclkSpreadPercent; | 499 | uint8_t AcgGfxclkSpreadPercent; |
| 500 | uint16_t AcgGfxclkSpreadFreq; | 500 | uint16_t AcgGfxclkSpreadFreq; |
| 501 | 501 | ||
| 502 | uint32_t BoardReserved[10]; | 502 | uint8_t Vr2_I2C_address; |
| 503 | uint8_t padding_vr2[3]; | ||
| 504 | |||
| 505 | uint32_t BoardReserved[9]; | ||
| 503 | 506 | ||
| 504 | 507 | ||
| 505 | uint32_t MmHubPadding[7]; | 508 | uint32_t MmHubPadding[7]; |
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 8d20faa198cf..0a788d76ed5f 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c | |||
| @@ -278,7 +278,6 @@ static int malidp_init(struct drm_device *drm) | |||
| 278 | 278 | ||
| 279 | static void malidp_fini(struct drm_device *drm) | 279 | static void malidp_fini(struct drm_device *drm) |
| 280 | { | 280 | { |
| 281 | drm_atomic_helper_shutdown(drm); | ||
| 282 | drm_mode_config_cleanup(drm); | 281 | drm_mode_config_cleanup(drm); |
| 283 | } | 282 | } |
| 284 | 283 | ||
| @@ -646,6 +645,7 @@ vblank_fail: | |||
| 646 | malidp_de_irq_fini(drm); | 645 | malidp_de_irq_fini(drm); |
| 647 | drm->irq_enabled = false; | 646 | drm->irq_enabled = false; |
| 648 | irq_init_fail: | 647 | irq_init_fail: |
| 648 | drm_atomic_helper_shutdown(drm); | ||
| 649 | component_unbind_all(dev, drm); | 649 | component_unbind_all(dev, drm); |
| 650 | bind_fail: | 650 | bind_fail: |
| 651 | of_node_put(malidp->crtc.port); | 651 | of_node_put(malidp->crtc.port); |
| @@ -681,6 +681,7 @@ static void malidp_unbind(struct device *dev) | |||
| 681 | malidp_se_irq_fini(drm); | 681 | malidp_se_irq_fini(drm); |
| 682 | malidp_de_irq_fini(drm); | 682 | malidp_de_irq_fini(drm); |
| 683 | drm->irq_enabled = false; | 683 | drm->irq_enabled = false; |
| 684 | drm_atomic_helper_shutdown(drm); | ||
| 684 | component_unbind_all(dev, drm); | 685 | component_unbind_all(dev, drm); |
| 685 | of_node_put(malidp->crtc.port); | 686 | of_node_put(malidp->crtc.port); |
| 686 | malidp->crtc.port = NULL; | 687 | malidp->crtc.port = NULL; |
diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c index d789b46dc817..069783e715f1 100644 --- a/drivers/gpu/drm/arm/malidp_hw.c +++ b/drivers/gpu/drm/arm/malidp_hw.c | |||
| @@ -634,7 +634,8 @@ const struct malidp_hw malidp_device[MALIDP_MAX_DEVICES] = { | |||
| 634 | .vsync_irq = MALIDP500_DE_IRQ_VSYNC, | 634 | .vsync_irq = MALIDP500_DE_IRQ_VSYNC, |
| 635 | }, | 635 | }, |
| 636 | .se_irq_map = { | 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 | .vsync_irq = 0, | 639 | .vsync_irq = 0, |
| 639 | }, | 640 | }, |
| 640 | .dc_irq_map = { | 641 | .dc_irq_map = { |
diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 7a44897c50fe..29409a65d864 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | /* Layer specific register offsets */ | 24 | /* Layer specific register offsets */ |
| 25 | #define MALIDP_LAYER_FORMAT 0x000 | 25 | #define MALIDP_LAYER_FORMAT 0x000 |
| 26 | #define LAYER_FORMAT_MASK 0x3f | ||
| 26 | #define MALIDP_LAYER_CONTROL 0x004 | 27 | #define MALIDP_LAYER_CONTROL 0x004 |
| 27 | #define LAYER_ENABLE (1 << 0) | 28 | #define LAYER_ENABLE (1 << 0) |
| 28 | #define LAYER_FLOWCFG_MASK 7 | 29 | #define LAYER_FLOWCFG_MASK 7 |
| @@ -235,8 +236,8 @@ static int malidp_de_plane_check(struct drm_plane *plane, | |||
| 235 | if (state->rotation & MALIDP_ROTATED_MASK) { | 236 | if (state->rotation & MALIDP_ROTATED_MASK) { |
| 236 | int val; | 237 | int val; |
| 237 | 238 | ||
| 238 | val = mp->hwdev->hw->rotmem_required(mp->hwdev, state->crtc_h, | 239 | val = mp->hwdev->hw->rotmem_required(mp->hwdev, state->crtc_w, |
| 239 | state->crtc_w, | 240 | state->crtc_h, |
| 240 | fb->format->format); | 241 | fb->format->format); |
| 241 | if (val < 0) | 242 | if (val < 0) |
| 242 | return val; | 243 | return val; |
| @@ -337,7 +338,9 @@ static void malidp_de_plane_update(struct drm_plane *plane, | |||
| 337 | dest_w = plane->state->crtc_w; | 338 | dest_w = plane->state->crtc_w; |
| 338 | dest_h = plane->state->crtc_h; | 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 | for (i = 0; i < ms->n_planes; i++) { | 345 | for (i = 0; i < ms->n_planes; i++) { |
| 343 | /* calculate the offset for the layer's plane registers */ | 346 | /* calculate the offset for the layer's plane registers */ |
diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c index 250effa0e6b8..a6e8f4591e63 100644 --- a/drivers/gpu/drm/bridge/sil-sii8620.c +++ b/drivers/gpu/drm/bridge/sil-sii8620.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <drm/bridge/mhl.h> | 14 | #include <drm/bridge/mhl.h> |
| 15 | #include <drm/drm_crtc.h> | 15 | #include <drm/drm_crtc.h> |
| 16 | #include <drm/drm_edid.h> | 16 | #include <drm/drm_edid.h> |
| 17 | #include <drm/drm_encoder.h> | ||
| 17 | 18 | ||
| 18 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
| 19 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
| @@ -72,9 +73,7 @@ struct sii8620 { | |||
| 72 | struct regulator_bulk_data supplies[2]; | 73 | struct regulator_bulk_data supplies[2]; |
| 73 | struct mutex lock; /* context lock, protects fields below */ | 74 | struct mutex lock; /* context lock, protects fields below */ |
| 74 | int error; | 75 | int error; |
| 75 | int pixel_clock; | ||
| 76 | unsigned int use_packed_pixel:1; | 76 | unsigned int use_packed_pixel:1; |
| 77 | int video_code; | ||
| 78 | enum sii8620_mode mode; | 77 | enum sii8620_mode mode; |
| 79 | enum sii8620_sink_type sink_type; | 78 | enum sii8620_sink_type sink_type; |
| 80 | u8 cbus_status; | 79 | u8 cbus_status; |
| @@ -82,7 +81,6 @@ struct sii8620 { | |||
| 82 | u8 xstat[MHL_XDS_SIZE]; | 81 | u8 xstat[MHL_XDS_SIZE]; |
| 83 | u8 devcap[MHL_DCAP_SIZE]; | 82 | u8 devcap[MHL_DCAP_SIZE]; |
| 84 | u8 xdevcap[MHL_XDC_SIZE]; | 83 | u8 xdevcap[MHL_XDC_SIZE]; |
| 85 | u8 avif[HDMI_INFOFRAME_SIZE(AVI)]; | ||
| 86 | bool feature_complete; | 84 | bool feature_complete; |
| 87 | bool devcap_read; | 85 | bool devcap_read; |
| 88 | bool sink_detected; | 86 | bool sink_detected; |
| @@ -1017,21 +1015,36 @@ static void sii8620_stop_video(struct sii8620 *ctx) | |||
| 1017 | 1015 | ||
| 1018 | static void sii8620_set_format(struct sii8620 *ctx) | 1016 | static void sii8620_set_format(struct sii8620 *ctx) |
| 1019 | { | 1017 | { |
| 1018 | u8 out_fmt; | ||
| 1019 | |||
| 1020 | if (sii8620_is_mhl3(ctx)) { | 1020 | if (sii8620_is_mhl3(ctx)) { |
| 1021 | sii8620_setbits(ctx, REG_M3_P0CTRL, | 1021 | sii8620_setbits(ctx, REG_M3_P0CTRL, |
| 1022 | BIT_M3_P0CTRL_MHL3_P0_PIXEL_MODE_PACKED, | 1022 | BIT_M3_P0CTRL_MHL3_P0_PIXEL_MODE_PACKED, |
| 1023 | ctx->use_packed_pixel ? ~0 : 0); | 1023 | ctx->use_packed_pixel ? ~0 : 0); |
| 1024 | } else { | 1024 | } else { |
| 1025 | if (ctx->use_packed_pixel) { | ||
| 1026 | sii8620_write_seq_static(ctx, | ||
| 1027 | REG_VID_MODE, BIT_VID_MODE_M1080P, | ||
| 1028 | REG_MHL_TOP_CTL, BIT_MHL_TOP_CTL_MHL_PP_SEL | 1, | ||
| 1029 | REG_MHLTX_CTL6, 0x60 | ||
| 1030 | ); | ||
| 1031 | } else { | ||
| 1025 | sii8620_write_seq_static(ctx, | 1032 | sii8620_write_seq_static(ctx, |
| 1026 | REG_VID_MODE, 0, | 1033 | REG_VID_MODE, 0, |
| 1027 | REG_MHL_TOP_CTL, 1, | 1034 | REG_MHL_TOP_CTL, 1, |
| 1028 | REG_MHLTX_CTL6, 0xa0 | 1035 | REG_MHLTX_CTL6, 0xa0 |
| 1029 | ); | 1036 | ); |
| 1037 | } | ||
| 1030 | } | 1038 | } |
| 1031 | 1039 | ||
| 1040 | if (ctx->use_packed_pixel) | ||
| 1041 | out_fmt = VAL_TPI_FORMAT(YCBCR422, FULL); | ||
| 1042 | else | ||
| 1043 | out_fmt = VAL_TPI_FORMAT(RGB, FULL); | ||
| 1044 | |||
| 1032 | sii8620_write_seq(ctx, | 1045 | sii8620_write_seq(ctx, |
| 1033 | REG_TPI_INPUT, VAL_TPI_FORMAT(RGB, FULL), | 1046 | REG_TPI_INPUT, VAL_TPI_FORMAT(RGB, FULL), |
| 1034 | REG_TPI_OUTPUT, VAL_TPI_FORMAT(RGB, FULL), | 1047 | REG_TPI_OUTPUT, out_fmt, |
| 1035 | ); | 1048 | ); |
| 1036 | } | 1049 | } |
| 1037 | 1050 | ||
| @@ -1082,18 +1095,28 @@ static ssize_t mhl3_infoframe_pack(struct mhl3_infoframe *frame, | |||
| 1082 | return frm_len; | 1095 | return frm_len; |
| 1083 | } | 1096 | } |
| 1084 | 1097 | ||
| 1085 | static void sii8620_set_infoframes(struct sii8620 *ctx) | 1098 | static void sii8620_set_infoframes(struct sii8620 *ctx, |
| 1099 | struct drm_display_mode *mode) | ||
| 1086 | { | 1100 | { |
| 1087 | struct mhl3_infoframe mhl_frm; | 1101 | struct mhl3_infoframe mhl_frm; |
| 1088 | union hdmi_infoframe frm; | 1102 | union hdmi_infoframe frm; |
| 1089 | u8 buf[31]; | 1103 | u8 buf[31]; |
| 1090 | int ret; | 1104 | int ret; |
| 1091 | 1105 | ||
| 1106 | ret = drm_hdmi_avi_infoframe_from_display_mode(&frm.avi, | ||
| 1107 | mode, | ||
| 1108 | true); | ||
| 1109 | if (ctx->use_packed_pixel) | ||
| 1110 | frm.avi.colorspace = HDMI_COLORSPACE_YUV422; | ||
| 1111 | |||
| 1112 | if (!ret) | ||
| 1113 | ret = hdmi_avi_infoframe_pack(&frm.avi, buf, ARRAY_SIZE(buf)); | ||
| 1114 | if (ret > 0) | ||
| 1115 | sii8620_write_buf(ctx, REG_TPI_AVI_CHSUM, buf + 3, ret - 3); | ||
| 1116 | |||
| 1092 | if (!sii8620_is_mhl3(ctx) || !ctx->use_packed_pixel) { | 1117 | if (!sii8620_is_mhl3(ctx) || !ctx->use_packed_pixel) { |
| 1093 | sii8620_write(ctx, REG_TPI_SC, | 1118 | sii8620_write(ctx, REG_TPI_SC, |
| 1094 | BIT_TPI_SC_TPI_OUTPUT_MODE_0_HDMI); | 1119 | BIT_TPI_SC_TPI_OUTPUT_MODE_0_HDMI); |
| 1095 | sii8620_write_buf(ctx, REG_TPI_AVI_CHSUM, ctx->avif + 3, | ||
| 1096 | ARRAY_SIZE(ctx->avif) - 3); | ||
| 1097 | sii8620_write(ctx, REG_PKT_FILTER_0, | 1120 | sii8620_write(ctx, REG_PKT_FILTER_0, |
| 1098 | BIT_PKT_FILTER_0_DROP_CEA_GAMUT_PKT | | 1121 | BIT_PKT_FILTER_0_DROP_CEA_GAMUT_PKT | |
| 1099 | BIT_PKT_FILTER_0_DROP_MPEG_PKT | | 1122 | BIT_PKT_FILTER_0_DROP_MPEG_PKT | |
| @@ -1102,16 +1125,6 @@ static void sii8620_set_infoframes(struct sii8620 *ctx) | |||
| 1102 | return; | 1125 | return; |
| 1103 | } | 1126 | } |
| 1104 | 1127 | ||
| 1105 | ret = hdmi_avi_infoframe_init(&frm.avi); | ||
| 1106 | frm.avi.colorspace = HDMI_COLORSPACE_YUV422; | ||
| 1107 | frm.avi.active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; | ||
| 1108 | frm.avi.picture_aspect = HDMI_PICTURE_ASPECT_16_9; | ||
| 1109 | frm.avi.colorimetry = HDMI_COLORIMETRY_ITU_709; | ||
| 1110 | frm.avi.video_code = ctx->video_code; | ||
| 1111 | if (!ret) | ||
| 1112 | ret = hdmi_avi_infoframe_pack(&frm.avi, buf, ARRAY_SIZE(buf)); | ||
| 1113 | if (ret > 0) | ||
| 1114 | sii8620_write_buf(ctx, REG_TPI_AVI_CHSUM, buf + 3, ret - 3); | ||
| 1115 | sii8620_write(ctx, REG_PKT_FILTER_0, | 1128 | sii8620_write(ctx, REG_PKT_FILTER_0, |
| 1116 | BIT_PKT_FILTER_0_DROP_CEA_GAMUT_PKT | | 1129 | BIT_PKT_FILTER_0_DROP_CEA_GAMUT_PKT | |
| 1117 | BIT_PKT_FILTER_0_DROP_MPEG_PKT | | 1130 | BIT_PKT_FILTER_0_DROP_MPEG_PKT | |
| @@ -1131,6 +1144,9 @@ static void sii8620_set_infoframes(struct sii8620 *ctx) | |||
| 1131 | 1144 | ||
| 1132 | static void sii8620_start_video(struct sii8620 *ctx) | 1145 | static void sii8620_start_video(struct sii8620 *ctx) |
| 1133 | { | 1146 | { |
| 1147 | struct drm_display_mode *mode = | ||
| 1148 | &ctx->bridge.encoder->crtc->state->adjusted_mode; | ||
| 1149 | |||
| 1134 | if (!sii8620_is_mhl3(ctx)) | 1150 | if (!sii8620_is_mhl3(ctx)) |
| 1135 | sii8620_stop_video(ctx); | 1151 | sii8620_stop_video(ctx); |
| 1136 | 1152 | ||
| @@ -1149,8 +1165,14 @@ static void sii8620_start_video(struct sii8620 *ctx) | |||
| 1149 | sii8620_set_format(ctx); | 1165 | sii8620_set_format(ctx); |
| 1150 | 1166 | ||
| 1151 | if (!sii8620_is_mhl3(ctx)) { | 1167 | if (!sii8620_is_mhl3(ctx)) { |
| 1152 | sii8620_mt_write_stat(ctx, MHL_DST_REG(LINK_MODE), | 1168 | u8 link_mode = MHL_DST_LM_PATH_ENABLED; |
| 1153 | MHL_DST_LM_CLK_MODE_NORMAL | MHL_DST_LM_PATH_ENABLED); | 1169 | |
| 1170 | if (ctx->use_packed_pixel) | ||
| 1171 | link_mode |= MHL_DST_LM_CLK_MODE_PACKED_PIXEL; | ||
| 1172 | else | ||
| 1173 | link_mode |= MHL_DST_LM_CLK_MODE_NORMAL; | ||
| 1174 | |||
| 1175 | sii8620_mt_write_stat(ctx, MHL_DST_REG(LINK_MODE), link_mode); | ||
| 1154 | sii8620_set_auto_zone(ctx); | 1176 | sii8620_set_auto_zone(ctx); |
| 1155 | } else { | 1177 | } else { |
| 1156 | static const struct { | 1178 | static const struct { |
| @@ -1167,7 +1189,7 @@ static void sii8620_start_video(struct sii8620 *ctx) | |||
| 1167 | MHL_XDS_LINK_RATE_6_0_GBPS, 0x40 }, | 1189 | MHL_XDS_LINK_RATE_6_0_GBPS, 0x40 }, |
| 1168 | }; | 1190 | }; |
| 1169 | u8 p0_ctrl = BIT_M3_P0CTRL_MHL3_P0_PORT_EN; | 1191 | u8 p0_ctrl = BIT_M3_P0CTRL_MHL3_P0_PORT_EN; |
| 1170 | int clk = ctx->pixel_clock * (ctx->use_packed_pixel ? 2 : 3); | 1192 | int clk = mode->clock * (ctx->use_packed_pixel ? 2 : 3); |
| 1171 | int i; | 1193 | int i; |
| 1172 | 1194 | ||
| 1173 | for (i = 0; i < ARRAY_SIZE(clk_spec) - 1; ++i) | 1195 | for (i = 0; i < ARRAY_SIZE(clk_spec) - 1; ++i) |
| @@ -1196,7 +1218,7 @@ static void sii8620_start_video(struct sii8620 *ctx) | |||
| 1196 | clk_spec[i].link_rate); | 1218 | clk_spec[i].link_rate); |
| 1197 | } | 1219 | } |
| 1198 | 1220 | ||
| 1199 | sii8620_set_infoframes(ctx); | 1221 | sii8620_set_infoframes(ctx, mode); |
| 1200 | } | 1222 | } |
| 1201 | 1223 | ||
| 1202 | static void sii8620_disable_hpd(struct sii8620 *ctx) | 1224 | static void sii8620_disable_hpd(struct sii8620 *ctx) |
| @@ -1661,14 +1683,18 @@ static void sii8620_status_dcap_ready(struct sii8620 *ctx) | |||
| 1661 | 1683 | ||
| 1662 | static void sii8620_status_changed_path(struct sii8620 *ctx) | 1684 | static void sii8620_status_changed_path(struct sii8620 *ctx) |
| 1663 | { | 1685 | { |
| 1664 | if (ctx->stat[MHL_DST_LINK_MODE] & MHL_DST_LM_PATH_ENABLED) { | 1686 | u8 link_mode; |
| 1665 | sii8620_mt_write_stat(ctx, MHL_DST_REG(LINK_MODE), | 1687 | |
| 1666 | MHL_DST_LM_CLK_MODE_NORMAL | 1688 | if (ctx->use_packed_pixel) |
| 1667 | | MHL_DST_LM_PATH_ENABLED); | 1689 | link_mode = MHL_DST_LM_CLK_MODE_PACKED_PIXEL; |
| 1668 | } else { | 1690 | else |
| 1669 | sii8620_mt_write_stat(ctx, MHL_DST_REG(LINK_MODE), | 1691 | link_mode = MHL_DST_LM_CLK_MODE_NORMAL; |
| 1670 | MHL_DST_LM_CLK_MODE_NORMAL); | 1692 | |
| 1671 | } | 1693 | if (ctx->stat[MHL_DST_LINK_MODE] & MHL_DST_LM_PATH_ENABLED) |
| 1694 | link_mode |= MHL_DST_LM_PATH_ENABLED; | ||
| 1695 | |||
| 1696 | sii8620_mt_write_stat(ctx, MHL_DST_REG(LINK_MODE), | ||
| 1697 | link_mode); | ||
| 1672 | } | 1698 | } |
| 1673 | 1699 | ||
| 1674 | static void sii8620_msc_mr_write_stat(struct sii8620 *ctx) | 1700 | static void sii8620_msc_mr_write_stat(struct sii8620 *ctx) |
| @@ -2242,8 +2268,6 @@ static bool sii8620_mode_fixup(struct drm_bridge *bridge, | |||
| 2242 | mutex_lock(&ctx->lock); | 2268 | mutex_lock(&ctx->lock); |
| 2243 | 2269 | ||
| 2244 | ctx->use_packed_pixel = sii8620_is_packing_required(ctx, adjusted_mode); | 2270 | ctx->use_packed_pixel = sii8620_is_packing_required(ctx, adjusted_mode); |
| 2245 | ctx->video_code = drm_match_cea_mode(adjusted_mode); | ||
| 2246 | ctx->pixel_clock = adjusted_mode->clock; | ||
| 2247 | 2271 | ||
| 2248 | mutex_unlock(&ctx->lock); | 2272 | mutex_unlock(&ctx->lock); |
| 2249 | 2273 | ||
diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c index 1f8031e30f53..cdb10f885a4f 100644 --- a/drivers/gpu/drm/drm_property.c +++ b/drivers/gpu/drm/drm_property.c | |||
| @@ -532,7 +532,7 @@ static void drm_property_free_blob(struct kref *kref) | |||
| 532 | 532 | ||
| 533 | drm_mode_object_unregister(blob->dev, &blob->base); | 533 | drm_mode_object_unregister(blob->dev, &blob->base); |
| 534 | 534 | ||
| 535 | kfree(blob); | 535 | kvfree(blob); |
| 536 | } | 536 | } |
| 537 | 537 | ||
| 538 | /** | 538 | /** |
| @@ -559,7 +559,7 @@ drm_property_create_blob(struct drm_device *dev, size_t length, | |||
| 559 | if (!length || length > ULONG_MAX - sizeof(struct drm_property_blob)) | 559 | if (!length || length > ULONG_MAX - sizeof(struct drm_property_blob)) |
| 560 | return ERR_PTR(-EINVAL); | 560 | return ERR_PTR(-EINVAL); |
| 561 | 561 | ||
| 562 | blob = kzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL); | 562 | blob = kvzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL); |
| 563 | if (!blob) | 563 | if (!blob) |
| 564 | return ERR_PTR(-ENOMEM); | 564 | return ERR_PTR(-ENOMEM); |
| 565 | 565 | ||
| @@ -576,7 +576,7 @@ drm_property_create_blob(struct drm_device *dev, size_t length, | |||
| 576 | ret = __drm_mode_object_add(dev, &blob->base, DRM_MODE_OBJECT_BLOB, | 576 | ret = __drm_mode_object_add(dev, &blob->base, DRM_MODE_OBJECT_BLOB, |
| 577 | true, drm_property_free_blob); | 577 | true, drm_property_free_blob); |
| 578 | if (ret) { | 578 | if (ret) { |
| 579 | kfree(blob); | 579 | kvfree(blob); |
| 580 | return ERR_PTR(-EINVAL); | 580 | return ERR_PTR(-EINVAL); |
| 581 | } | 581 | } |
| 582 | 582 | ||
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index e5013a999147..540b59fb4103 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c | |||
| @@ -631,8 +631,11 @@ static struct platform_driver etnaviv_platform_driver = { | |||
| 631 | }, | 631 | }, |
| 632 | }; | 632 | }; |
| 633 | 633 | ||
| 634 | static struct platform_device *etnaviv_drm; | ||
| 635 | |||
| 634 | static int __init etnaviv_init(void) | 636 | static int __init etnaviv_init(void) |
| 635 | { | 637 | { |
| 638 | struct platform_device *pdev; | ||
| 636 | int ret; | 639 | int ret; |
| 637 | struct device_node *np; | 640 | struct device_node *np; |
| 638 | 641 | ||
| @@ -644,7 +647,7 @@ static int __init etnaviv_init(void) | |||
| 644 | 647 | ||
| 645 | ret = platform_driver_register(&etnaviv_platform_driver); | 648 | ret = platform_driver_register(&etnaviv_platform_driver); |
| 646 | if (ret != 0) | 649 | if (ret != 0) |
| 647 | platform_driver_unregister(&etnaviv_gpu_driver); | 650 | goto unregister_gpu_driver; |
| 648 | 651 | ||
| 649 | /* | 652 | /* |
| 650 | * If the DT contains at least one available GPU device, instantiate | 653 | * If the DT contains at least one available GPU device, instantiate |
| @@ -653,20 +656,33 @@ static int __init etnaviv_init(void) | |||
| 653 | for_each_compatible_node(np, NULL, "vivante,gc") { | 656 | for_each_compatible_node(np, NULL, "vivante,gc") { |
| 654 | if (!of_device_is_available(np)) | 657 | if (!of_device_is_available(np)) |
| 655 | continue; | 658 | continue; |
| 656 | 659 | pdev = platform_device_register_simple("etnaviv", -1, | |
| 657 | platform_device_register_simple("etnaviv", -1, NULL, 0); | 660 | NULL, 0); |
| 661 | if (IS_ERR(pdev)) { | ||
| 662 | ret = PTR_ERR(pdev); | ||
| 663 | of_node_put(np); | ||
| 664 | goto unregister_platform_driver; | ||
| 665 | } | ||
| 666 | etnaviv_drm = pdev; | ||
| 658 | of_node_put(np); | 667 | of_node_put(np); |
| 659 | break; | 668 | break; |
| 660 | } | 669 | } |
| 661 | 670 | ||
| 671 | return 0; | ||
| 672 | |||
| 673 | unregister_platform_driver: | ||
| 674 | platform_driver_unregister(&etnaviv_platform_driver); | ||
| 675 | unregister_gpu_driver: | ||
| 676 | platform_driver_unregister(&etnaviv_gpu_driver); | ||
| 662 | return ret; | 677 | return ret; |
| 663 | } | 678 | } |
| 664 | module_init(etnaviv_init); | 679 | module_init(etnaviv_init); |
| 665 | 680 | ||
| 666 | static void __exit etnaviv_exit(void) | 681 | static void __exit etnaviv_exit(void) |
| 667 | { | 682 | { |
| 668 | platform_driver_unregister(&etnaviv_gpu_driver); | 683 | platform_device_unregister(etnaviv_drm); |
| 669 | platform_driver_unregister(&etnaviv_platform_driver); | 684 | platform_driver_unregister(&etnaviv_platform_driver); |
| 685 | platform_driver_unregister(&etnaviv_gpu_driver); | ||
| 670 | } | 686 | } |
| 671 | module_exit(etnaviv_exit); | 687 | module_exit(etnaviv_exit); |
| 672 | 688 | ||
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h index dd430f0f8ff5..90f17ff7888e 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h | |||
| @@ -131,6 +131,9 @@ struct etnaviv_gpu { | |||
| 131 | struct work_struct sync_point_work; | 131 | struct work_struct sync_point_work; |
| 132 | int sync_point_event; | 132 | int sync_point_event; |
| 133 | 133 | ||
| 134 | /* hang detection */ | ||
| 135 | u32 hangcheck_dma_addr; | ||
| 136 | |||
| 134 | void __iomem *mmio; | 137 | void __iomem *mmio; |
| 135 | int irq; | 138 | int irq; |
| 136 | 139 | ||
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_sched.c b/drivers/gpu/drm/etnaviv/etnaviv_sched.c index a74eb57af15b..50d6b88cb7aa 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_sched.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_sched.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include "etnaviv_gem.h" | 10 | #include "etnaviv_gem.h" |
| 11 | #include "etnaviv_gpu.h" | 11 | #include "etnaviv_gpu.h" |
| 12 | #include "etnaviv_sched.h" | 12 | #include "etnaviv_sched.h" |
| 13 | #include "state.xml.h" | ||
| 13 | 14 | ||
| 14 | static int etnaviv_job_hang_limit = 0; | 15 | static int etnaviv_job_hang_limit = 0; |
| 15 | module_param_named(job_hang_limit, etnaviv_job_hang_limit, int , 0444); | 16 | module_param_named(job_hang_limit, etnaviv_job_hang_limit, int , 0444); |
| @@ -85,6 +86,29 @@ static void etnaviv_sched_timedout_job(struct drm_sched_job *sched_job) | |||
| 85 | { | 86 | { |
| 86 | struct etnaviv_gem_submit *submit = to_etnaviv_submit(sched_job); | 87 | struct etnaviv_gem_submit *submit = to_etnaviv_submit(sched_job); |
| 87 | struct etnaviv_gpu *gpu = submit->gpu; | 88 | struct etnaviv_gpu *gpu = submit->gpu; |
| 89 | u32 dma_addr; | ||
| 90 | int change; | ||
| 91 | |||
| 92 | /* | ||
| 93 | * If the GPU managed to complete this jobs fence, the timout is | ||
| 94 | * spurious. Bail out. | ||
| 95 | */ | ||
| 96 | if (fence_completed(gpu, submit->out_fence->seqno)) | ||
| 97 | return; | ||
| 98 | |||
| 99 | /* | ||
| 100 | * If the GPU is still making forward progress on the front-end (which | ||
| 101 | * should never loop) we shift out the timeout to give it a chance to | ||
| 102 | * finish the job. | ||
| 103 | */ | ||
| 104 | dma_addr = gpu_read(gpu, VIVS_FE_DMA_ADDRESS); | ||
| 105 | change = dma_addr - gpu->hangcheck_dma_addr; | ||
| 106 | if (change < 0 || change > 16) { | ||
| 107 | gpu->hangcheck_dma_addr = dma_addr; | ||
| 108 | schedule_delayed_work(&sched_job->work_tdr, | ||
| 109 | sched_job->sched->timeout); | ||
| 110 | return; | ||
| 111 | } | ||
| 88 | 112 | ||
| 89 | /* block scheduler */ | 113 | /* block scheduler */ |
| 90 | kthread_park(gpu->sched.thread); | 114 | kthread_park(gpu->sched.thread); |
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index 82c95c34447f..e868773ea509 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c | |||
| @@ -265,7 +265,7 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win, | |||
| 265 | unsigned long val; | 265 | unsigned long val; |
| 266 | 266 | ||
| 267 | val = readl(ctx->addr + DECON_WINCONx(win)); | 267 | val = readl(ctx->addr + DECON_WINCONx(win)); |
| 268 | val &= ~WINCONx_BPPMODE_MASK; | 268 | val &= WINCONx_ENWIN_F; |
| 269 | 269 | ||
| 270 | switch (fb->format->format) { | 270 | switch (fb->format->format) { |
| 271 | case DRM_FORMAT_XRGB1555: | 271 | case DRM_FORMAT_XRGB1555: |
| @@ -356,8 +356,8 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, | |||
| 356 | writel(val, ctx->addr + DECON_VIDOSDxB(win)); | 356 | writel(val, ctx->addr + DECON_VIDOSDxB(win)); |
| 357 | } | 357 | } |
| 358 | 358 | ||
| 359 | val = VIDOSD_Wx_ALPHA_R_F(0x0) | VIDOSD_Wx_ALPHA_G_F(0x0) | | 359 | val = VIDOSD_Wx_ALPHA_R_F(0xff) | VIDOSD_Wx_ALPHA_G_F(0xff) | |
| 360 | VIDOSD_Wx_ALPHA_B_F(0x0); | 360 | VIDOSD_Wx_ALPHA_B_F(0xff); |
| 361 | writel(val, ctx->addr + DECON_VIDOSDxC(win)); | 361 | writel(val, ctx->addr + DECON_VIDOSDxC(win)); |
| 362 | 362 | ||
| 363 | val = VIDOSD_Wx_ALPHA_R_F(0x0) | VIDOSD_Wx_ALPHA_G_F(0x0) | | 363 | val = VIDOSD_Wx_ALPHA_R_F(0x0) | VIDOSD_Wx_ALPHA_G_F(0x0) | |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index a81b4a5e24a7..ed3cc2989f93 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c | |||
| @@ -420,7 +420,7 @@ err_mode_config_cleanup: | |||
| 420 | err_free_private: | 420 | err_free_private: |
| 421 | kfree(private); | 421 | kfree(private); |
| 422 | err_free_drm: | 422 | err_free_drm: |
| 423 | drm_dev_unref(drm); | 423 | drm_dev_put(drm); |
| 424 | 424 | ||
| 425 | return ret; | 425 | return ret; |
| 426 | } | 426 | } |
| @@ -444,7 +444,7 @@ static void exynos_drm_unbind(struct device *dev) | |||
| 444 | drm->dev_private = NULL; | 444 | drm->dev_private = NULL; |
| 445 | dev_set_drvdata(dev, NULL); | 445 | dev_set_drvdata(dev, NULL); |
| 446 | 446 | ||
| 447 | drm_dev_unref(drm); | 447 | drm_dev_put(drm); |
| 448 | } | 448 | } |
| 449 | 449 | ||
| 450 | static const struct component_master_ops exynos_drm_ops = { | 450 | static const struct component_master_ops exynos_drm_ops = { |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index 7fcc1a7ab1a0..27b7d34d776c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c | |||
| @@ -138,7 +138,7 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, | |||
| 138 | 138 | ||
| 139 | err: | 139 | err: |
| 140 | while (i--) | 140 | while (i--) |
| 141 | drm_gem_object_unreference_unlocked(&exynos_gem[i]->base); | 141 | drm_gem_object_put_unlocked(&exynos_gem[i]->base); |
| 142 | 142 | ||
| 143 | return ERR_PTR(ret); | 143 | return ERR_PTR(ret); |
| 144 | } | 144 | } |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 6127ef25acd6..e8d0670bb5f8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c | |||
| @@ -470,17 +470,18 @@ static void fimc_src_set_transf(struct fimc_context *ctx, unsigned int rotation) | |||
| 470 | static void fimc_set_window(struct fimc_context *ctx, | 470 | static void fimc_set_window(struct fimc_context *ctx, |
| 471 | struct exynos_drm_ipp_buffer *buf) | 471 | struct exynos_drm_ipp_buffer *buf) |
| 472 | { | 472 | { |
| 473 | unsigned int real_width = buf->buf.pitch[0] / buf->format->cpp[0]; | ||
| 473 | u32 cfg, h1, h2, v1, v2; | 474 | u32 cfg, h1, h2, v1, v2; |
| 474 | 475 | ||
| 475 | /* cropped image */ | 476 | /* cropped image */ |
| 476 | h1 = buf->rect.x; | 477 | h1 = buf->rect.x; |
| 477 | h2 = buf->buf.width - buf->rect.w - buf->rect.x; | 478 | h2 = real_width - buf->rect.w - buf->rect.x; |
| 478 | v1 = buf->rect.y; | 479 | v1 = buf->rect.y; |
| 479 | v2 = buf->buf.height - buf->rect.h - buf->rect.y; | 480 | v2 = buf->buf.height - buf->rect.h - buf->rect.y; |
| 480 | 481 | ||
| 481 | DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n", | 482 | DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n", |
| 482 | buf->rect.x, buf->rect.y, buf->rect.w, buf->rect.h, | 483 | buf->rect.x, buf->rect.y, buf->rect.w, buf->rect.h, |
| 483 | buf->buf.width, buf->buf.height); | 484 | real_width, buf->buf.height); |
| 484 | DRM_DEBUG_KMS("h1[%d]h2[%d]v1[%d]v2[%d]\n", h1, h2, v1, v2); | 485 | DRM_DEBUG_KMS("h1[%d]h2[%d]v1[%d]v2[%d]\n", h1, h2, v1, v2); |
| 485 | 486 | ||
| 486 | /* | 487 | /* |
| @@ -503,12 +504,13 @@ static void fimc_set_window(struct fimc_context *ctx, | |||
| 503 | static void fimc_src_set_size(struct fimc_context *ctx, | 504 | static void fimc_src_set_size(struct fimc_context *ctx, |
| 504 | struct exynos_drm_ipp_buffer *buf) | 505 | struct exynos_drm_ipp_buffer *buf) |
| 505 | { | 506 | { |
| 507 | unsigned int real_width = buf->buf.pitch[0] / buf->format->cpp[0]; | ||
| 506 | u32 cfg; | 508 | u32 cfg; |
| 507 | 509 | ||
| 508 | DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", buf->buf.width, buf->buf.height); | 510 | DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", real_width, buf->buf.height); |
| 509 | 511 | ||
| 510 | /* original size */ | 512 | /* original size */ |
| 511 | cfg = (EXYNOS_ORGISIZE_HORIZONTAL(buf->buf.width) | | 513 | cfg = (EXYNOS_ORGISIZE_HORIZONTAL(real_width) | |
| 512 | EXYNOS_ORGISIZE_VERTICAL(buf->buf.height)); | 514 | EXYNOS_ORGISIZE_VERTICAL(buf->buf.height)); |
| 513 | 515 | ||
| 514 | fimc_write(ctx, cfg, EXYNOS_ORGISIZE); | 516 | fimc_write(ctx, cfg, EXYNOS_ORGISIZE); |
| @@ -529,7 +531,7 @@ static void fimc_src_set_size(struct fimc_context *ctx, | |||
| 529 | * for now, we support only ITU601 8 bit mode | 531 | * for now, we support only ITU601 8 bit mode |
| 530 | */ | 532 | */ |
| 531 | cfg = (EXYNOS_CISRCFMT_ITU601_8BIT | | 533 | cfg = (EXYNOS_CISRCFMT_ITU601_8BIT | |
| 532 | EXYNOS_CISRCFMT_SOURCEHSIZE(buf->buf.width) | | 534 | EXYNOS_CISRCFMT_SOURCEHSIZE(real_width) | |
| 533 | EXYNOS_CISRCFMT_SOURCEVSIZE(buf->buf.height)); | 535 | EXYNOS_CISRCFMT_SOURCEVSIZE(buf->buf.height)); |
| 534 | fimc_write(ctx, cfg, EXYNOS_CISRCFMT); | 536 | fimc_write(ctx, cfg, EXYNOS_CISRCFMT); |
| 535 | 537 | ||
| @@ -842,12 +844,13 @@ static void fimc_set_scaler(struct fimc_context *ctx, struct fimc_scaler *sc) | |||
| 842 | static void fimc_dst_set_size(struct fimc_context *ctx, | 844 | static void fimc_dst_set_size(struct fimc_context *ctx, |
| 843 | struct exynos_drm_ipp_buffer *buf) | 845 | struct exynos_drm_ipp_buffer *buf) |
| 844 | { | 846 | { |
| 847 | unsigned int real_width = buf->buf.pitch[0] / buf->format->cpp[0]; | ||
| 845 | u32 cfg, cfg_ext; | 848 | u32 cfg, cfg_ext; |
| 846 | 849 | ||
| 847 | DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", buf->buf.width, buf->buf.height); | 850 | DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", real_width, buf->buf.height); |
| 848 | 851 | ||
| 849 | /* original size */ | 852 | /* original size */ |
| 850 | cfg = (EXYNOS_ORGOSIZE_HORIZONTAL(buf->buf.width) | | 853 | cfg = (EXYNOS_ORGOSIZE_HORIZONTAL(real_width) | |
| 851 | EXYNOS_ORGOSIZE_VERTICAL(buf->buf.height)); | 854 | EXYNOS_ORGOSIZE_VERTICAL(buf->buf.height)); |
| 852 | 855 | ||
| 853 | fimc_write(ctx, cfg, EXYNOS_ORGOSIZE); | 856 | fimc_write(ctx, cfg, EXYNOS_ORGOSIZE); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 6e1494fa71b4..bdf5a7655228 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c | |||
| @@ -143,7 +143,7 @@ static int exynos_drm_gem_handle_create(struct drm_gem_object *obj, | |||
| 143 | DRM_DEBUG_KMS("gem handle = 0x%x\n", *handle); | 143 | DRM_DEBUG_KMS("gem handle = 0x%x\n", *handle); |
| 144 | 144 | ||
| 145 | /* drop reference from allocate - handle holds it now. */ | 145 | /* drop reference from allocate - handle holds it now. */ |
| 146 | drm_gem_object_unreference_unlocked(obj); | 146 | drm_gem_object_put_unlocked(obj); |
| 147 | 147 | ||
| 148 | return 0; | 148 | return 0; |
| 149 | } | 149 | } |
| @@ -186,7 +186,7 @@ unsigned long exynos_drm_gem_get_size(struct drm_device *dev, | |||
| 186 | 186 | ||
| 187 | exynos_gem = to_exynos_gem(obj); | 187 | exynos_gem = to_exynos_gem(obj); |
| 188 | 188 | ||
| 189 | drm_gem_object_unreference_unlocked(obj); | 189 | drm_gem_object_put_unlocked(obj); |
| 190 | 190 | ||
| 191 | return exynos_gem->size; | 191 | return exynos_gem->size; |
| 192 | } | 192 | } |
| @@ -329,13 +329,13 @@ void exynos_drm_gem_put_dma_addr(struct drm_device *dev, | |||
| 329 | return; | 329 | return; |
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | drm_gem_object_unreference_unlocked(obj); | 332 | drm_gem_object_put_unlocked(obj); |
| 333 | 333 | ||
| 334 | /* | 334 | /* |
| 335 | * decrease obj->refcount one more time because we has already | 335 | * decrease obj->refcount one more time because we has already |
| 336 | * increased it at exynos_drm_gem_get_dma_addr(). | 336 | * increased it at exynos_drm_gem_get_dma_addr(). |
| 337 | */ | 337 | */ |
| 338 | drm_gem_object_unreference_unlocked(obj); | 338 | drm_gem_object_put_unlocked(obj); |
| 339 | } | 339 | } |
| 340 | 340 | ||
| 341 | static int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem *exynos_gem, | 341 | static int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem *exynos_gem, |
| @@ -383,7 +383,7 @@ int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data, | |||
| 383 | args->flags = exynos_gem->flags; | 383 | args->flags = exynos_gem->flags; |
| 384 | args->size = exynos_gem->size; | 384 | args->size = exynos_gem->size; |
| 385 | 385 | ||
| 386 | drm_gem_object_unreference_unlocked(obj); | 386 | drm_gem_object_put_unlocked(obj); |
| 387 | 387 | ||
| 388 | return 0; | 388 | return 0; |
| 389 | } | 389 | } |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 35ac66730563..7ba414b52faa 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c | |||
| @@ -492,21 +492,25 @@ static void gsc_src_set_fmt(struct gsc_context *ctx, u32 fmt) | |||
| 492 | GSC_IN_CHROMA_ORDER_CRCB); | 492 | GSC_IN_CHROMA_ORDER_CRCB); |
| 493 | break; | 493 | break; |
| 494 | case DRM_FORMAT_NV21: | 494 | case DRM_FORMAT_NV21: |
| 495 | cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV420_2P); | ||
| 496 | break; | ||
| 495 | case DRM_FORMAT_NV61: | 497 | case DRM_FORMAT_NV61: |
| 496 | cfg |= (GSC_IN_CHROMA_ORDER_CRCB | | 498 | cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV422_2P); |
| 497 | GSC_IN_YUV420_2P); | ||
| 498 | break; | 499 | break; |
| 499 | case DRM_FORMAT_YUV422: | 500 | case DRM_FORMAT_YUV422: |
| 500 | cfg |= GSC_IN_YUV422_3P; | 501 | cfg |= GSC_IN_YUV422_3P; |
| 501 | break; | 502 | break; |
| 502 | case DRM_FORMAT_YUV420: | 503 | case DRM_FORMAT_YUV420: |
| 504 | cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV420_3P); | ||
| 505 | break; | ||
| 503 | case DRM_FORMAT_YVU420: | 506 | case DRM_FORMAT_YVU420: |
| 504 | cfg |= GSC_IN_YUV420_3P; | 507 | cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV420_3P); |
| 505 | break; | 508 | break; |
| 506 | case DRM_FORMAT_NV12: | 509 | case DRM_FORMAT_NV12: |
| 510 | cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV420_2P); | ||
| 511 | break; | ||
| 507 | case DRM_FORMAT_NV16: | 512 | case DRM_FORMAT_NV16: |
| 508 | cfg |= (GSC_IN_CHROMA_ORDER_CBCR | | 513 | cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV422_2P); |
| 509 | GSC_IN_YUV420_2P); | ||
| 510 | break; | 514 | break; |
| 511 | } | 515 | } |
| 512 | 516 | ||
| @@ -523,30 +527,30 @@ static void gsc_src_set_transf(struct gsc_context *ctx, unsigned int rotation) | |||
| 523 | 527 | ||
| 524 | switch (degree) { | 528 | switch (degree) { |
| 525 | case DRM_MODE_ROTATE_0: | 529 | case DRM_MODE_ROTATE_0: |
| 526 | if (rotation & DRM_MODE_REFLECT_Y) | ||
| 527 | cfg |= GSC_IN_ROT_XFLIP; | ||
| 528 | if (rotation & DRM_MODE_REFLECT_X) | 530 | if (rotation & DRM_MODE_REFLECT_X) |
| 531 | cfg |= GSC_IN_ROT_XFLIP; | ||
| 532 | if (rotation & DRM_MODE_REFLECT_Y) | ||
| 529 | cfg |= GSC_IN_ROT_YFLIP; | 533 | cfg |= GSC_IN_ROT_YFLIP; |
| 530 | break; | 534 | break; |
| 531 | case DRM_MODE_ROTATE_90: | 535 | case DRM_MODE_ROTATE_90: |
| 532 | cfg |= GSC_IN_ROT_90; | 536 | cfg |= GSC_IN_ROT_90; |
| 533 | if (rotation & DRM_MODE_REFLECT_Y) | ||
| 534 | cfg |= GSC_IN_ROT_XFLIP; | ||
| 535 | if (rotation & DRM_MODE_REFLECT_X) | 537 | if (rotation & DRM_MODE_REFLECT_X) |
| 538 | cfg |= GSC_IN_ROT_XFLIP; | ||
| 539 | if (rotation & DRM_MODE_REFLECT_Y) | ||
| 536 | cfg |= GSC_IN_ROT_YFLIP; | 540 | cfg |= GSC_IN_ROT_YFLIP; |
| 537 | break; | 541 | break; |
| 538 | case DRM_MODE_ROTATE_180: | 542 | case DRM_MODE_ROTATE_180: |
| 539 | cfg |= GSC_IN_ROT_180; | 543 | cfg |= GSC_IN_ROT_180; |
| 540 | if (rotation & DRM_MODE_REFLECT_Y) | ||
| 541 | cfg &= ~GSC_IN_ROT_XFLIP; | ||
| 542 | if (rotation & DRM_MODE_REFLECT_X) | 544 | if (rotation & DRM_MODE_REFLECT_X) |
| 545 | cfg &= ~GSC_IN_ROT_XFLIP; | ||
| 546 | if (rotation & DRM_MODE_REFLECT_Y) | ||
| 543 | cfg &= ~GSC_IN_ROT_YFLIP; | 547 | cfg &= ~GSC_IN_ROT_YFLIP; |
| 544 | break; | 548 | break; |
| 545 | case DRM_MODE_ROTATE_270: | 549 | case DRM_MODE_ROTATE_270: |
| 546 | cfg |= GSC_IN_ROT_270; | 550 | cfg |= GSC_IN_ROT_270; |
| 547 | if (rotation & DRM_MODE_REFLECT_Y) | ||
| 548 | cfg &= ~GSC_IN_ROT_XFLIP; | ||
| 549 | if (rotation & DRM_MODE_REFLECT_X) | 551 | if (rotation & DRM_MODE_REFLECT_X) |
| 552 | cfg &= ~GSC_IN_ROT_XFLIP; | ||
| 553 | if (rotation & DRM_MODE_REFLECT_Y) | ||
| 550 | cfg &= ~GSC_IN_ROT_YFLIP; | 554 | cfg &= ~GSC_IN_ROT_YFLIP; |
| 551 | break; | 555 | break; |
| 552 | } | 556 | } |
| @@ -577,7 +581,7 @@ static void gsc_src_set_size(struct gsc_context *ctx, | |||
| 577 | cfg &= ~(GSC_SRCIMG_HEIGHT_MASK | | 581 | cfg &= ~(GSC_SRCIMG_HEIGHT_MASK | |
| 578 | GSC_SRCIMG_WIDTH_MASK); | 582 | GSC_SRCIMG_WIDTH_MASK); |
| 579 | 583 | ||
| 580 | cfg |= (GSC_SRCIMG_WIDTH(buf->buf.width) | | 584 | cfg |= (GSC_SRCIMG_WIDTH(buf->buf.pitch[0] / buf->format->cpp[0]) | |
| 581 | GSC_SRCIMG_HEIGHT(buf->buf.height)); | 585 | GSC_SRCIMG_HEIGHT(buf->buf.height)); |
| 582 | 586 | ||
| 583 | gsc_write(cfg, GSC_SRCIMG_SIZE); | 587 | gsc_write(cfg, GSC_SRCIMG_SIZE); |
| @@ -672,18 +676,25 @@ static void gsc_dst_set_fmt(struct gsc_context *ctx, u32 fmt) | |||
| 672 | GSC_OUT_CHROMA_ORDER_CRCB); | 676 | GSC_OUT_CHROMA_ORDER_CRCB); |
| 673 | break; | 677 | break; |
| 674 | case DRM_FORMAT_NV21: | 678 | case DRM_FORMAT_NV21: |
| 675 | case DRM_FORMAT_NV61: | ||
| 676 | cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_2P); | 679 | cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_2P); |
| 677 | break; | 680 | break; |
| 681 | case DRM_FORMAT_NV61: | ||
| 682 | cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV422_2P); | ||
| 683 | break; | ||
| 678 | case DRM_FORMAT_YUV422: | 684 | case DRM_FORMAT_YUV422: |
| 685 | cfg |= GSC_OUT_YUV422_3P; | ||
| 686 | break; | ||
| 679 | case DRM_FORMAT_YUV420: | 687 | case DRM_FORMAT_YUV420: |
| 688 | cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV420_3P); | ||
| 689 | break; | ||
| 680 | case DRM_FORMAT_YVU420: | 690 | case DRM_FORMAT_YVU420: |
| 681 | cfg |= GSC_OUT_YUV420_3P; | 691 | cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_3P); |
| 682 | break; | 692 | break; |
| 683 | case DRM_FORMAT_NV12: | 693 | case DRM_FORMAT_NV12: |
| 694 | cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV420_2P); | ||
| 695 | break; | ||
| 684 | case DRM_FORMAT_NV16: | 696 | case DRM_FORMAT_NV16: |
| 685 | cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | | 697 | cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV422_2P); |
| 686 | GSC_OUT_YUV420_2P); | ||
| 687 | break; | 698 | break; |
| 688 | } | 699 | } |
| 689 | 700 | ||
| @@ -868,7 +879,7 @@ static void gsc_dst_set_size(struct gsc_context *ctx, | |||
| 868 | /* original size */ | 879 | /* original size */ |
| 869 | cfg = gsc_read(GSC_DSTIMG_SIZE); | 880 | cfg = gsc_read(GSC_DSTIMG_SIZE); |
| 870 | cfg &= ~(GSC_DSTIMG_HEIGHT_MASK | GSC_DSTIMG_WIDTH_MASK); | 881 | cfg &= ~(GSC_DSTIMG_HEIGHT_MASK | GSC_DSTIMG_WIDTH_MASK); |
| 871 | cfg |= GSC_DSTIMG_WIDTH(buf->buf.width) | | 882 | cfg |= GSC_DSTIMG_WIDTH(buf->buf.pitch[0] / buf->format->cpp[0]) | |
| 872 | GSC_DSTIMG_HEIGHT(buf->buf.height); | 883 | GSC_DSTIMG_HEIGHT(buf->buf.height); |
| 873 | gsc_write(cfg, GSC_DSTIMG_SIZE); | 884 | gsc_write(cfg, GSC_DSTIMG_SIZE); |
| 874 | 885 | ||
| @@ -1341,7 +1352,7 @@ static const struct drm_exynos_ipp_limit gsc_5420_limits[] = { | |||
| 1341 | }; | 1352 | }; |
| 1342 | 1353 | ||
| 1343 | static const struct drm_exynos_ipp_limit gsc_5433_limits[] = { | 1354 | static const struct drm_exynos_ipp_limit gsc_5433_limits[] = { |
| 1344 | { IPP_SIZE_LIMIT(BUFFER, .h = { 32, 8191, 2 }, .v = { 16, 8191, 2 }) }, | 1355 | { IPP_SIZE_LIMIT(BUFFER, .h = { 32, 8191, 16 }, .v = { 16, 8191, 2 }) }, |
| 1345 | { IPP_SIZE_LIMIT(AREA, .h = { 16, 4800, 1 }, .v = { 8, 3344, 1 }) }, | 1356 | { IPP_SIZE_LIMIT(AREA, .h = { 16, 4800, 1 }, .v = { 8, 3344, 1 }) }, |
| 1346 | { IPP_SIZE_LIMIT(ROTATED, .h = { 32, 2047 }, .v = { 8, 8191 }) }, | 1357 | { IPP_SIZE_LIMIT(ROTATED, .h = { 32, 2047 }, .v = { 8, 8191 }) }, |
| 1347 | { IPP_SCALE_LIMIT(.h = { (1 << 16) / 16, (1 << 16) * 8 }, | 1358 | { IPP_SCALE_LIMIT(.h = { (1 << 16) / 16, (1 << 16) * 8 }, |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 26374e58c557..b435db8fc916 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c | |||
| @@ -345,27 +345,6 @@ static int exynos_drm_ipp_task_setup_buffer(struct exynos_drm_ipp_buffer *buf, | |||
| 345 | int ret = 0; | 345 | int ret = 0; |
| 346 | int i; | 346 | int i; |
| 347 | 347 | ||
| 348 | /* basic checks */ | ||
| 349 | if (buf->buf.width == 0 || buf->buf.height == 0) | ||
| 350 | return -EINVAL; | ||
| 351 | buf->format = drm_format_info(buf->buf.fourcc); | ||
| 352 | for (i = 0; i < buf->format->num_planes; i++) { | ||
| 353 | unsigned int width = (i == 0) ? buf->buf.width : | ||
| 354 | DIV_ROUND_UP(buf->buf.width, buf->format->hsub); | ||
| 355 | |||
| 356 | if (buf->buf.pitch[i] == 0) | ||
| 357 | buf->buf.pitch[i] = width * buf->format->cpp[i]; | ||
| 358 | if (buf->buf.pitch[i] < width * buf->format->cpp[i]) | ||
| 359 | return -EINVAL; | ||
| 360 | if (!buf->buf.gem_id[i]) | ||
| 361 | return -ENOENT; | ||
| 362 | } | ||
| 363 | |||
| 364 | /* pitch for additional planes must match */ | ||
| 365 | if (buf->format->num_planes > 2 && | ||
| 366 | buf->buf.pitch[1] != buf->buf.pitch[2]) | ||
| 367 | return -EINVAL; | ||
| 368 | |||
| 369 | /* get GEM buffers and check their size */ | 348 | /* get GEM buffers and check their size */ |
| 370 | for (i = 0; i < buf->format->num_planes; i++) { | 349 | for (i = 0; i < buf->format->num_planes; i++) { |
| 371 | unsigned int height = (i == 0) ? buf->buf.height : | 350 | unsigned int height = (i == 0) ? buf->buf.height : |
| @@ -428,7 +407,7 @@ enum drm_ipp_size_id { | |||
| 428 | IPP_LIMIT_BUFFER, IPP_LIMIT_AREA, IPP_LIMIT_ROTATED, IPP_LIMIT_MAX | 407 | IPP_LIMIT_BUFFER, IPP_LIMIT_AREA, IPP_LIMIT_ROTATED, IPP_LIMIT_MAX |
| 429 | }; | 408 | }; |
| 430 | 409 | ||
| 431 | static const enum drm_ipp_size_id limit_id_fallback[IPP_LIMIT_MAX][4] = { | 410 | static const enum drm_exynos_ipp_limit_type limit_id_fallback[IPP_LIMIT_MAX][4] = { |
| 432 | [IPP_LIMIT_BUFFER] = { DRM_EXYNOS_IPP_LIMIT_SIZE_BUFFER }, | 411 | [IPP_LIMIT_BUFFER] = { DRM_EXYNOS_IPP_LIMIT_SIZE_BUFFER }, |
| 433 | [IPP_LIMIT_AREA] = { DRM_EXYNOS_IPP_LIMIT_SIZE_AREA, | 412 | [IPP_LIMIT_AREA] = { DRM_EXYNOS_IPP_LIMIT_SIZE_AREA, |
| 434 | DRM_EXYNOS_IPP_LIMIT_SIZE_BUFFER }, | 413 | DRM_EXYNOS_IPP_LIMIT_SIZE_BUFFER }, |
| @@ -495,12 +474,13 @@ static int exynos_drm_ipp_check_size_limits(struct exynos_drm_ipp_buffer *buf, | |||
| 495 | enum drm_ipp_size_id id = rotate ? IPP_LIMIT_ROTATED : IPP_LIMIT_AREA; | 474 | enum drm_ipp_size_id id = rotate ? IPP_LIMIT_ROTATED : IPP_LIMIT_AREA; |
| 496 | struct drm_ipp_limit l; | 475 | struct drm_ipp_limit l; |
| 497 | struct drm_exynos_ipp_limit_val *lh = &l.h, *lv = &l.v; | 476 | struct drm_exynos_ipp_limit_val *lh = &l.h, *lv = &l.v; |
| 477 | int real_width = buf->buf.pitch[0] / buf->format->cpp[0]; | ||
| 498 | 478 | ||
| 499 | if (!limits) | 479 | if (!limits) |
| 500 | return 0; | 480 | return 0; |
| 501 | 481 | ||
| 502 | __get_size_limit(limits, num_limits, IPP_LIMIT_BUFFER, &l); | 482 | __get_size_limit(limits, num_limits, IPP_LIMIT_BUFFER, &l); |
| 503 | if (!__size_limit_check(buf->buf.width, &l.h) || | 483 | if (!__size_limit_check(real_width, &l.h) || |
| 504 | !__size_limit_check(buf->buf.height, &l.v)) | 484 | !__size_limit_check(buf->buf.height, &l.v)) |
| 505 | return -EINVAL; | 485 | return -EINVAL; |
| 506 | 486 | ||
| @@ -560,10 +540,62 @@ static int exynos_drm_ipp_check_scale_limits( | |||
| 560 | return 0; | 540 | return 0; |
| 561 | } | 541 | } |
| 562 | 542 | ||
| 543 | static int exynos_drm_ipp_check_format(struct exynos_drm_ipp_task *task, | ||
| 544 | struct exynos_drm_ipp_buffer *buf, | ||
| 545 | struct exynos_drm_ipp_buffer *src, | ||
| 546 | struct exynos_drm_ipp_buffer *dst, | ||
| 547 | bool rotate, bool swap) | ||
| 548 | { | ||
| 549 | const struct exynos_drm_ipp_formats *fmt; | ||
| 550 | int ret, i; | ||
| 551 | |||
| 552 | fmt = __ipp_format_get(task->ipp, buf->buf.fourcc, buf->buf.modifier, | ||
| 553 | buf == src ? DRM_EXYNOS_IPP_FORMAT_SOURCE : | ||
| 554 | DRM_EXYNOS_IPP_FORMAT_DESTINATION); | ||
| 555 | if (!fmt) { | ||
| 556 | DRM_DEBUG_DRIVER("Task %pK: %s format not supported\n", task, | ||
| 557 | buf == src ? "src" : "dst"); | ||
| 558 | return -EINVAL; | ||
| 559 | } | ||
| 560 | |||
| 561 | /* basic checks */ | ||
| 562 | if (buf->buf.width == 0 || buf->buf.height == 0) | ||
| 563 | return -EINVAL; | ||
| 564 | |||
| 565 | buf->format = drm_format_info(buf->buf.fourcc); | ||
| 566 | for (i = 0; i < buf->format->num_planes; i++) { | ||
| 567 | unsigned int width = (i == 0) ? buf->buf.width : | ||
| 568 | DIV_ROUND_UP(buf->buf.width, buf->format->hsub); | ||
| 569 | |||
| 570 | if (buf->buf.pitch[i] == 0) | ||
| 571 | buf->buf.pitch[i] = width * buf->format->cpp[i]; | ||
| 572 | if (buf->buf.pitch[i] < width * buf->format->cpp[i]) | ||
| 573 | return -EINVAL; | ||
| 574 | if (!buf->buf.gem_id[i]) | ||
| 575 | return -ENOENT; | ||
| 576 | } | ||
| 577 | |||
| 578 | /* pitch for additional planes must match */ | ||
| 579 | if (buf->format->num_planes > 2 && | ||
| 580 | buf->buf.pitch[1] != buf->buf.pitch[2]) | ||
| 581 | return -EINVAL; | ||
| 582 | |||
| 583 | /* check driver limits */ | ||
| 584 | ret = exynos_drm_ipp_check_size_limits(buf, fmt->limits, | ||
| 585 | fmt->num_limits, | ||
| 586 | rotate, | ||
| 587 | buf == dst ? swap : false); | ||
| 588 | if (ret) | ||
| 589 | return ret; | ||
| 590 | ret = exynos_drm_ipp_check_scale_limits(&src->rect, &dst->rect, | ||
| 591 | fmt->limits, | ||
| 592 | fmt->num_limits, swap); | ||
| 593 | return ret; | ||
| 594 | } | ||
| 595 | |||
| 563 | static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task) | 596 | static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task) |
| 564 | { | 597 | { |
| 565 | struct exynos_drm_ipp *ipp = task->ipp; | 598 | struct exynos_drm_ipp *ipp = task->ipp; |
| 566 | const struct exynos_drm_ipp_formats *src_fmt, *dst_fmt; | ||
| 567 | struct exynos_drm_ipp_buffer *src = &task->src, *dst = &task->dst; | 599 | struct exynos_drm_ipp_buffer *src = &task->src, *dst = &task->dst; |
| 568 | unsigned int rotation = task->transform.rotation; | 600 | unsigned int rotation = task->transform.rotation; |
| 569 | int ret = 0; | 601 | int ret = 0; |
| @@ -607,37 +639,11 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task) | |||
| 607 | return -EINVAL; | 639 | return -EINVAL; |
| 608 | } | 640 | } |
| 609 | 641 | ||
| 610 | src_fmt = __ipp_format_get(ipp, src->buf.fourcc, src->buf.modifier, | 642 | ret = exynos_drm_ipp_check_format(task, src, src, dst, rotate, swap); |
| 611 | DRM_EXYNOS_IPP_FORMAT_SOURCE); | ||
| 612 | if (!src_fmt) { | ||
| 613 | DRM_DEBUG_DRIVER("Task %pK: src format not supported\n", task); | ||
| 614 | return -EINVAL; | ||
| 615 | } | ||
| 616 | ret = exynos_drm_ipp_check_size_limits(src, src_fmt->limits, | ||
| 617 | src_fmt->num_limits, | ||
| 618 | rotate, false); | ||
| 619 | if (ret) | ||
| 620 | return ret; | ||
| 621 | ret = exynos_drm_ipp_check_scale_limits(&src->rect, &dst->rect, | ||
| 622 | src_fmt->limits, | ||
| 623 | src_fmt->num_limits, swap); | ||
| 624 | if (ret) | 643 | if (ret) |
| 625 | return ret; | 644 | return ret; |
| 626 | 645 | ||
| 627 | dst_fmt = __ipp_format_get(ipp, dst->buf.fourcc, dst->buf.modifier, | 646 | ret = exynos_drm_ipp_check_format(task, dst, src, dst, false, swap); |
| 628 | DRM_EXYNOS_IPP_FORMAT_DESTINATION); | ||
| 629 | if (!dst_fmt) { | ||
| 630 | DRM_DEBUG_DRIVER("Task %pK: dst format not supported\n", task); | ||
| 631 | return -EINVAL; | ||
| 632 | } | ||
| 633 | ret = exynos_drm_ipp_check_size_limits(dst, dst_fmt->limits, | ||
| 634 | dst_fmt->num_limits, | ||
| 635 | false, swap); | ||
| 636 | if (ret) | ||
| 637 | return ret; | ||
| 638 | ret = exynos_drm_ipp_check_scale_limits(&src->rect, &dst->rect, | ||
| 639 | dst_fmt->limits, | ||
| 640 | dst_fmt->num_limits, swap); | ||
| 641 | if (ret) | 647 | if (ret) |
| 642 | return ret; | 648 | return ret; |
| 643 | 649 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 38a2a7f1204b..7098c6d35266 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c | |||
| @@ -132,7 +132,7 @@ static void exynos_drm_plane_reset(struct drm_plane *plane) | |||
| 132 | if (plane->state) { | 132 | if (plane->state) { |
| 133 | exynos_state = to_exynos_plane_state(plane->state); | 133 | exynos_state = to_exynos_plane_state(plane->state); |
| 134 | if (exynos_state->base.fb) | 134 | if (exynos_state->base.fb) |
| 135 | drm_framebuffer_unreference(exynos_state->base.fb); | 135 | drm_framebuffer_put(exynos_state->base.fb); |
| 136 | kfree(exynos_state); | 136 | kfree(exynos_state); |
| 137 | plane->state = NULL; | 137 | plane->state = NULL; |
| 138 | } | 138 | } |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 1a76dd3d52e1..a820a68429b9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c | |||
| @@ -168,9 +168,9 @@ static void rotator_dst_set_transf(struct rot_context *rot, | |||
| 168 | val &= ~ROT_CONTROL_FLIP_MASK; | 168 | val &= ~ROT_CONTROL_FLIP_MASK; |
| 169 | 169 | ||
| 170 | if (rotation & DRM_MODE_REFLECT_X) | 170 | if (rotation & DRM_MODE_REFLECT_X) |
| 171 | val |= ROT_CONTROL_FLIP_HORIZONTAL; | ||
| 172 | if (rotation & DRM_MODE_REFLECT_Y) | ||
| 173 | val |= ROT_CONTROL_FLIP_VERTICAL; | 171 | val |= ROT_CONTROL_FLIP_VERTICAL; |
| 172 | if (rotation & DRM_MODE_REFLECT_Y) | ||
| 173 | val |= ROT_CONTROL_FLIP_HORIZONTAL; | ||
| 174 | 174 | ||
| 175 | val &= ~ROT_CONTROL_ROT_MASK; | 175 | val &= ~ROT_CONTROL_ROT_MASK; |
| 176 | 176 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c index 91d4382343d0..0ddb6eec7b11 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #define scaler_write(cfg, offset) writel(cfg, scaler->regs + (offset)) | 30 | #define scaler_write(cfg, offset) writel(cfg, scaler->regs + (offset)) |
| 31 | #define SCALER_MAX_CLK 4 | 31 | #define SCALER_MAX_CLK 4 |
| 32 | #define SCALER_AUTOSUSPEND_DELAY 2000 | 32 | #define SCALER_AUTOSUSPEND_DELAY 2000 |
| 33 | #define SCALER_RESET_WAIT_RETRIES 100 | ||
| 33 | 34 | ||
| 34 | struct scaler_data { | 35 | struct scaler_data { |
| 35 | const char *clk_name[SCALER_MAX_CLK]; | 36 | const char *clk_name[SCALER_MAX_CLK]; |
| @@ -51,9 +52,9 @@ struct scaler_context { | |||
| 51 | static u32 scaler_get_format(u32 drm_fmt) | 52 | static u32 scaler_get_format(u32 drm_fmt) |
| 52 | { | 53 | { |
| 53 | switch (drm_fmt) { | 54 | switch (drm_fmt) { |
| 54 | case DRM_FORMAT_NV21: | ||
| 55 | return SCALER_YUV420_2P_UV; | ||
| 56 | case DRM_FORMAT_NV12: | 55 | case DRM_FORMAT_NV12: |
| 56 | return SCALER_YUV420_2P_UV; | ||
| 57 | case DRM_FORMAT_NV21: | ||
| 57 | return SCALER_YUV420_2P_VU; | 58 | return SCALER_YUV420_2P_VU; |
| 58 | case DRM_FORMAT_YUV420: | 59 | case DRM_FORMAT_YUV420: |
| 59 | return SCALER_YUV420_3P; | 60 | return SCALER_YUV420_3P; |
| @@ -63,15 +64,15 @@ static u32 scaler_get_format(u32 drm_fmt) | |||
| 63 | return SCALER_YUV422_1P_UYVY; | 64 | return SCALER_YUV422_1P_UYVY; |
| 64 | case DRM_FORMAT_YVYU: | 65 | case DRM_FORMAT_YVYU: |
| 65 | return SCALER_YUV422_1P_YVYU; | 66 | return SCALER_YUV422_1P_YVYU; |
| 66 | case DRM_FORMAT_NV61: | ||
| 67 | return SCALER_YUV422_2P_UV; | ||
| 68 | case DRM_FORMAT_NV16: | 67 | case DRM_FORMAT_NV16: |
| 68 | return SCALER_YUV422_2P_UV; | ||
| 69 | case DRM_FORMAT_NV61: | ||
| 69 | return SCALER_YUV422_2P_VU; | 70 | return SCALER_YUV422_2P_VU; |
| 70 | case DRM_FORMAT_YUV422: | 71 | case DRM_FORMAT_YUV422: |
| 71 | return SCALER_YUV422_3P; | 72 | return SCALER_YUV422_3P; |
| 72 | case DRM_FORMAT_NV42: | ||
| 73 | return SCALER_YUV444_2P_UV; | ||
| 74 | case DRM_FORMAT_NV24: | 73 | case DRM_FORMAT_NV24: |
| 74 | return SCALER_YUV444_2P_UV; | ||
| 75 | case DRM_FORMAT_NV42: | ||
| 75 | return SCALER_YUV444_2P_VU; | 76 | return SCALER_YUV444_2P_VU; |
| 76 | case DRM_FORMAT_YUV444: | 77 | case DRM_FORMAT_YUV444: |
| 77 | return SCALER_YUV444_3P; | 78 | return SCALER_YUV444_3P; |
| @@ -100,6 +101,23 @@ static u32 scaler_get_format(u32 drm_fmt) | |||
| 100 | return 0; | 101 | return 0; |
| 101 | } | 102 | } |
| 102 | 103 | ||
| 104 | static inline int scaler_reset(struct scaler_context *scaler) | ||
| 105 | { | ||
| 106 | int retry = SCALER_RESET_WAIT_RETRIES; | ||
| 107 | |||
| 108 | scaler_write(SCALER_CFG_SOFT_RESET, SCALER_CFG); | ||
| 109 | do { | ||
| 110 | cpu_relax(); | ||
| 111 | } while (retry > 1 && | ||
| 112 | scaler_read(SCALER_CFG) & SCALER_CFG_SOFT_RESET); | ||
| 113 | do { | ||
| 114 | cpu_relax(); | ||
| 115 | scaler_write(1, SCALER_INT_EN); | ||
| 116 | } while (retry > 0 && scaler_read(SCALER_INT_EN) != 1); | ||
| 117 | |||
| 118 | return retry ? 0 : -EIO; | ||
| 119 | } | ||
| 120 | |||
| 103 | static inline void scaler_enable_int(struct scaler_context *scaler) | 121 | static inline void scaler_enable_int(struct scaler_context *scaler) |
| 104 | { | 122 | { |
| 105 | u32 val; | 123 | u32 val; |
| @@ -354,9 +372,13 @@ static int scaler_commit(struct exynos_drm_ipp *ipp, | |||
| 354 | u32 dst_fmt = scaler_get_format(task->dst.buf.fourcc); | 372 | u32 dst_fmt = scaler_get_format(task->dst.buf.fourcc); |
| 355 | struct drm_exynos_ipp_task_rect *dst_pos = &task->dst.rect; | 373 | struct drm_exynos_ipp_task_rect *dst_pos = &task->dst.rect; |
| 356 | 374 | ||
| 357 | scaler->task = task; | ||
| 358 | |||
| 359 | pm_runtime_get_sync(scaler->dev); | 375 | pm_runtime_get_sync(scaler->dev); |
| 376 | if (scaler_reset(scaler)) { | ||
| 377 | pm_runtime_put(scaler->dev); | ||
| 378 | return -EIO; | ||
| 379 | } | ||
| 380 | |||
| 381 | scaler->task = task; | ||
| 360 | 382 | ||
| 361 | scaler_set_src_fmt(scaler, src_fmt); | 383 | scaler_set_src_fmt(scaler, src_fmt); |
| 362 | scaler_set_src_base(scaler, &task->src); | 384 | scaler_set_src_base(scaler, &task->src); |
| @@ -394,7 +416,11 @@ static inline void scaler_disable_int(struct scaler_context *scaler) | |||
| 394 | 416 | ||
| 395 | static inline u32 scaler_get_int_status(struct scaler_context *scaler) | 417 | static inline u32 scaler_get_int_status(struct scaler_context *scaler) |
| 396 | { | 418 | { |
| 397 | return scaler_read(SCALER_INT_STATUS); | 419 | u32 val = scaler_read(SCALER_INT_STATUS); |
| 420 | |||
| 421 | scaler_write(val, SCALER_INT_STATUS); | ||
| 422 | |||
| 423 | return val; | ||
| 398 | } | 424 | } |
| 399 | 425 | ||
| 400 | static inline int scaler_task_done(u32 val) | 426 | static inline int scaler_task_done(u32 val) |
diff --git a/drivers/gpu/drm/exynos/regs-gsc.h b/drivers/gpu/drm/exynos/regs-gsc.h index 4704a993cbb7..16b39734115c 100644 --- a/drivers/gpu/drm/exynos/regs-gsc.h +++ b/drivers/gpu/drm/exynos/regs-gsc.h | |||
| @@ -138,6 +138,7 @@ | |||
| 138 | #define GSC_OUT_YUV420_3P (3 << 4) | 138 | #define GSC_OUT_YUV420_3P (3 << 4) |
| 139 | #define GSC_OUT_YUV422_1P (4 << 4) | 139 | #define GSC_OUT_YUV422_1P (4 << 4) |
| 140 | #define GSC_OUT_YUV422_2P (5 << 4) | 140 | #define GSC_OUT_YUV422_2P (5 << 4) |
| 141 | #define GSC_OUT_YUV422_3P (6 << 4) | ||
| 141 | #define GSC_OUT_YUV444 (7 << 4) | 142 | #define GSC_OUT_YUV444 (7 << 4) |
| 142 | #define GSC_OUT_TILE_TYPE_MASK (1 << 2) | 143 | #define GSC_OUT_TILE_TYPE_MASK (1 << 2) |
| 143 | #define GSC_OUT_TILE_C_16x8 (0 << 2) | 144 | #define GSC_OUT_TILE_C_16x8 (0 << 2) |
diff --git a/drivers/gpu/drm/i915/gvt/display.c b/drivers/gpu/drm/i915/gvt/display.c index 6d8180e8d1e2..4b072ade8c38 100644 --- a/drivers/gpu/drm/i915/gvt/display.c +++ b/drivers/gpu/drm/i915/gvt/display.c | |||
| @@ -196,7 +196,7 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) | |||
| 196 | ~(TRANS_DDI_BPC_MASK | TRANS_DDI_MODE_SELECT_MASK | | 196 | ~(TRANS_DDI_BPC_MASK | TRANS_DDI_MODE_SELECT_MASK | |
| 197 | TRANS_DDI_PORT_MASK); | 197 | TRANS_DDI_PORT_MASK); |
| 198 | vgpu_vreg_t(vgpu, TRANS_DDI_FUNC_CTL(TRANSCODER_A)) |= | 198 | vgpu_vreg_t(vgpu, TRANS_DDI_FUNC_CTL(TRANSCODER_A)) |= |
| 199 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | | 199 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DVI | |
| 200 | (PORT_B << TRANS_DDI_PORT_SHIFT) | | 200 | (PORT_B << TRANS_DDI_PORT_SHIFT) | |
| 201 | TRANS_DDI_FUNC_ENABLE); | 201 | TRANS_DDI_FUNC_ENABLE); |
| 202 | if (IS_BROADWELL(dev_priv)) { | 202 | if (IS_BROADWELL(dev_priv)) { |
| @@ -216,7 +216,7 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) | |||
| 216 | ~(TRANS_DDI_BPC_MASK | TRANS_DDI_MODE_SELECT_MASK | | 216 | ~(TRANS_DDI_BPC_MASK | TRANS_DDI_MODE_SELECT_MASK | |
| 217 | TRANS_DDI_PORT_MASK); | 217 | TRANS_DDI_PORT_MASK); |
| 218 | vgpu_vreg_t(vgpu, TRANS_DDI_FUNC_CTL(TRANSCODER_A)) |= | 218 | vgpu_vreg_t(vgpu, TRANS_DDI_FUNC_CTL(TRANSCODER_A)) |= |
| 219 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | | 219 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DVI | |
| 220 | (PORT_C << TRANS_DDI_PORT_SHIFT) | | 220 | (PORT_C << TRANS_DDI_PORT_SHIFT) | |
| 221 | TRANS_DDI_FUNC_ENABLE); | 221 | TRANS_DDI_FUNC_ENABLE); |
| 222 | if (IS_BROADWELL(dev_priv)) { | 222 | if (IS_BROADWELL(dev_priv)) { |
| @@ -236,7 +236,7 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) | |||
| 236 | ~(TRANS_DDI_BPC_MASK | TRANS_DDI_MODE_SELECT_MASK | | 236 | ~(TRANS_DDI_BPC_MASK | TRANS_DDI_MODE_SELECT_MASK | |
| 237 | TRANS_DDI_PORT_MASK); | 237 | TRANS_DDI_PORT_MASK); |
| 238 | vgpu_vreg_t(vgpu, TRANS_DDI_FUNC_CTL(TRANSCODER_A)) |= | 238 | vgpu_vreg_t(vgpu, TRANS_DDI_FUNC_CTL(TRANSCODER_A)) |= |
| 239 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | | 239 | (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DVI | |
| 240 | (PORT_D << TRANS_DDI_PORT_SHIFT) | | 240 | (PORT_D << TRANS_DDI_PORT_SHIFT) | |
| 241 | TRANS_DDI_FUNC_ENABLE); | 241 | TRANS_DDI_FUNC_ENABLE); |
| 242 | if (IS_BROADWELL(dev_priv)) { | 242 | if (IS_BROADWELL(dev_priv)) { |
diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c index 23296547da95..4efec8fa6c1d 100644 --- a/drivers/gpu/drm/i915/gvt/gtt.c +++ b/drivers/gpu/drm/i915/gvt/gtt.c | |||
| @@ -1592,6 +1592,7 @@ static struct intel_vgpu_mm *intel_vgpu_create_ggtt_mm(struct intel_vgpu *vgpu) | |||
| 1592 | vgpu_free_mm(mm); | 1592 | vgpu_free_mm(mm); |
| 1593 | return ERR_PTR(-ENOMEM); | 1593 | return ERR_PTR(-ENOMEM); |
| 1594 | } | 1594 | } |
| 1595 | mm->ggtt_mm.last_partial_off = -1UL; | ||
| 1595 | 1596 | ||
| 1596 | return mm; | 1597 | return mm; |
| 1597 | } | 1598 | } |
| @@ -1616,6 +1617,7 @@ void _intel_vgpu_mm_release(struct kref *mm_ref) | |||
| 1616 | invalidate_ppgtt_mm(mm); | 1617 | invalidate_ppgtt_mm(mm); |
| 1617 | } else { | 1618 | } else { |
| 1618 | vfree(mm->ggtt_mm.virtual_ggtt); | 1619 | vfree(mm->ggtt_mm.virtual_ggtt); |
| 1620 | mm->ggtt_mm.last_partial_off = -1UL; | ||
| 1619 | } | 1621 | } |
| 1620 | 1622 | ||
| 1621 | vgpu_free_mm(mm); | 1623 | vgpu_free_mm(mm); |
| @@ -1868,6 +1870,62 @@ static int emulate_ggtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off, | |||
| 1868 | memcpy((void *)&e.val64 + (off & (info->gtt_entry_size - 1)), p_data, | 1870 | memcpy((void *)&e.val64 + (off & (info->gtt_entry_size - 1)), p_data, |
| 1869 | bytes); | 1871 | bytes); |
| 1870 | 1872 | ||
| 1873 | /* If ggtt entry size is 8 bytes, and it's split into two 4 bytes | ||
| 1874 | * write, we assume the two 4 bytes writes are consecutive. | ||
| 1875 | * Otherwise, we abort and report error | ||
| 1876 | */ | ||
| 1877 | if (bytes < info->gtt_entry_size) { | ||
| 1878 | if (ggtt_mm->ggtt_mm.last_partial_off == -1UL) { | ||
| 1879 | /* the first partial part*/ | ||
| 1880 | ggtt_mm->ggtt_mm.last_partial_off = off; | ||
| 1881 | ggtt_mm->ggtt_mm.last_partial_data = e.val64; | ||
| 1882 | return 0; | ||
| 1883 | } else if ((g_gtt_index == | ||
| 1884 | (ggtt_mm->ggtt_mm.last_partial_off >> | ||
| 1885 | info->gtt_entry_size_shift)) && | ||
| 1886 | (off != ggtt_mm->ggtt_mm.last_partial_off)) { | ||
| 1887 | /* the second partial part */ | ||
| 1888 | |||
| 1889 | int last_off = ggtt_mm->ggtt_mm.last_partial_off & | ||
| 1890 | (info->gtt_entry_size - 1); | ||
| 1891 | |||
| 1892 | memcpy((void *)&e.val64 + last_off, | ||
| 1893 | (void *)&ggtt_mm->ggtt_mm.last_partial_data + | ||
| 1894 | last_off, bytes); | ||
| 1895 | |||
| 1896 | ggtt_mm->ggtt_mm.last_partial_off = -1UL; | ||
| 1897 | } else { | ||
| 1898 | int last_offset; | ||
| 1899 | |||
| 1900 | gvt_vgpu_err("failed to populate guest ggtt entry: abnormal ggtt entry write sequence, last_partial_off=%lx, offset=%x, bytes=%d, ggtt entry size=%d\n", | ||
| 1901 | ggtt_mm->ggtt_mm.last_partial_off, off, | ||
| 1902 | bytes, info->gtt_entry_size); | ||
| 1903 | |||
| 1904 | /* set host ggtt entry to scratch page and clear | ||
| 1905 | * virtual ggtt entry as not present for last | ||
| 1906 | * partially write offset | ||
| 1907 | */ | ||
| 1908 | last_offset = ggtt_mm->ggtt_mm.last_partial_off & | ||
| 1909 | (~(info->gtt_entry_size - 1)); | ||
| 1910 | |||
| 1911 | ggtt_get_host_entry(ggtt_mm, &m, last_offset); | ||
| 1912 | ggtt_invalidate_pte(vgpu, &m); | ||
| 1913 | ops->set_pfn(&m, gvt->gtt.scratch_mfn); | ||
| 1914 | ops->clear_present(&m); | ||
| 1915 | ggtt_set_host_entry(ggtt_mm, &m, last_offset); | ||
| 1916 | ggtt_invalidate(gvt->dev_priv); | ||
| 1917 | |||
| 1918 | ggtt_get_guest_entry(ggtt_mm, &e, last_offset); | ||
| 1919 | ops->clear_present(&e); | ||
| 1920 | ggtt_set_guest_entry(ggtt_mm, &e, last_offset); | ||
| 1921 | |||
| 1922 | ggtt_mm->ggtt_mm.last_partial_off = off; | ||
| 1923 | ggtt_mm->ggtt_mm.last_partial_data = e.val64; | ||
| 1924 | |||
| 1925 | return 0; | ||
| 1926 | } | ||
| 1927 | } | ||
| 1928 | |||
| 1871 | if (ops->test_present(&e)) { | 1929 | if (ops->test_present(&e)) { |
| 1872 | gfn = ops->get_pfn(&e); | 1930 | gfn = ops->get_pfn(&e); |
| 1873 | m = e; | 1931 | m = e; |
diff --git a/drivers/gpu/drm/i915/gvt/gtt.h b/drivers/gpu/drm/i915/gvt/gtt.h index 3792f2b7f4ff..97e62647418a 100644 --- a/drivers/gpu/drm/i915/gvt/gtt.h +++ b/drivers/gpu/drm/i915/gvt/gtt.h | |||
| @@ -150,6 +150,8 @@ struct intel_vgpu_mm { | |||
| 150 | } ppgtt_mm; | 150 | } ppgtt_mm; |
| 151 | struct { | 151 | struct { |
| 152 | void *virtual_ggtt; | 152 | void *virtual_ggtt; |
| 153 | unsigned long last_partial_off; | ||
| 154 | u64 last_partial_data; | ||
| 153 | } ggtt_mm; | 155 | } ggtt_mm; |
| 154 | }; | 156 | }; |
| 155 | }; | 157 | }; |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 7014a96546f4..52f3b91d14fd 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
| @@ -2245,9 +2245,6 @@ static inline struct scatterlist *____sg_next(struct scatterlist *sg) | |||
| 2245 | **/ | 2245 | **/ |
| 2246 | static inline struct scatterlist *__sg_next(struct scatterlist *sg) | 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 | return sg_is_last(sg) ? NULL : ____sg_next(sg); | 2248 | return sg_is_last(sg) ? NULL : ____sg_next(sg); |
| 2252 | } | 2249 | } |
| 2253 | 2250 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index d44ad7bc1e94..17c5097721e8 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -2002,7 +2002,6 @@ int i915_gem_fault(struct vm_fault *vmf) | |||
| 2002 | bool write = !!(vmf->flags & FAULT_FLAG_WRITE); | 2002 | bool write = !!(vmf->flags & FAULT_FLAG_WRITE); |
| 2003 | struct i915_vma *vma; | 2003 | struct i915_vma *vma; |
| 2004 | pgoff_t page_offset; | 2004 | pgoff_t page_offset; |
| 2005 | unsigned int flags; | ||
| 2006 | int ret; | 2005 | int ret; |
| 2007 | 2006 | ||
| 2008 | /* We don't use vmf->pgoff since that has the fake offset */ | 2007 | /* We don't use vmf->pgoff since that has the fake offset */ |
| @@ -2038,27 +2037,34 @@ int i915_gem_fault(struct vm_fault *vmf) | |||
| 2038 | goto err_unlock; | 2037 | goto err_unlock; |
| 2039 | } | 2038 | } |
| 2040 | 2039 | ||
| 2041 | /* If the object is smaller than a couple of partial vma, it is | ||
| 2042 | * not worth only creating a single partial vma - we may as well | ||
| 2043 | * clear enough space for the full object. | ||
| 2044 | */ | ||
| 2045 | flags = PIN_MAPPABLE; | ||
| 2046 | if (obj->base.size > 2 * MIN_CHUNK_PAGES << PAGE_SHIFT) | ||
| 2047 | flags |= PIN_NONBLOCK | PIN_NONFAULT; | ||
| 2048 | 2040 | ||
| 2049 | /* Now pin it into the GTT as needed */ | 2041 | /* Now pin it into the GTT as needed */ |
| 2050 | vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, flags); | 2042 | vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, |
| 2043 | PIN_MAPPABLE | | ||
| 2044 | PIN_NONBLOCK | | ||
| 2045 | PIN_NONFAULT); | ||
| 2051 | if (IS_ERR(vma)) { | 2046 | if (IS_ERR(vma)) { |
| 2052 | /* Use a partial view if it is bigger than available space */ | 2047 | /* Use a partial view if it is bigger than available space */ |
| 2053 | struct i915_ggtt_view view = | 2048 | struct i915_ggtt_view view = |
| 2054 | compute_partial_view(obj, page_offset, MIN_CHUNK_PAGES); | 2049 | compute_partial_view(obj, page_offset, MIN_CHUNK_PAGES); |
| 2050 | unsigned int flags; | ||
| 2055 | 2051 | ||
| 2056 | /* Userspace is now writing through an untracked VMA, abandon | 2052 | flags = PIN_MAPPABLE; |
| 2053 | if (view.type == I915_GGTT_VIEW_NORMAL) | ||
| 2054 | flags |= PIN_NONBLOCK; /* avoid warnings for pinned */ | ||
| 2055 | |||
| 2056 | /* | ||
| 2057 | * Userspace is now writing through an untracked VMA, abandon | ||
| 2057 | * all hope that the hardware is able to track future writes. | 2058 | * all hope that the hardware is able to track future writes. |
| 2058 | */ | 2059 | */ |
| 2059 | obj->frontbuffer_ggtt_origin = ORIGIN_CPU; | 2060 | obj->frontbuffer_ggtt_origin = ORIGIN_CPU; |
| 2060 | 2061 | ||
| 2061 | vma = i915_gem_object_ggtt_pin(obj, &view, 0, 0, PIN_MAPPABLE); | 2062 | vma = i915_gem_object_ggtt_pin(obj, &view, 0, 0, flags); |
| 2063 | if (IS_ERR(vma) && !view.type) { | ||
| 2064 | flags = PIN_MAPPABLE; | ||
| 2065 | view.type = I915_GGTT_VIEW_PARTIAL; | ||
| 2066 | vma = i915_gem_object_ggtt_pin(obj, &view, 0, 0, flags); | ||
| 2067 | } | ||
| 2062 | } | 2068 | } |
| 2063 | if (IS_ERR(vma)) { | 2069 | if (IS_ERR(vma)) { |
| 2064 | ret = PTR_ERR(vma); | 2070 | ret = PTR_ERR(vma); |
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index 9324d476e0a7..0531c01c3604 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c | |||
| @@ -109,7 +109,7 @@ vma_create(struct drm_i915_gem_object *obj, | |||
| 109 | obj->base.size >> PAGE_SHIFT)); | 109 | obj->base.size >> PAGE_SHIFT)); |
| 110 | vma->size = view->partial.size; | 110 | vma->size = view->partial.size; |
| 111 | vma->size <<= PAGE_SHIFT; | 111 | vma->size <<= PAGE_SHIFT; |
| 112 | GEM_BUG_ON(vma->size >= obj->base.size); | 112 | GEM_BUG_ON(vma->size > obj->base.size); |
| 113 | } else if (view->type == I915_GGTT_VIEW_ROTATED) { | 113 | } else if (view->type == I915_GGTT_VIEW_ROTATED) { |
| 114 | vma->size = intel_rotation_info_size(&view->rotated); | 114 | vma->size = intel_rotation_info_size(&view->rotated); |
| 115 | vma->size <<= PAGE_SHIFT; | 115 | vma->size <<= PAGE_SHIFT; |
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index 32b1a6cdecfc..d3443125e661 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c | |||
| @@ -197,8 +197,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) | |||
| 197 | priv->io_base = regs; | 197 | priv->io_base = regs; |
| 198 | 198 | ||
| 199 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hhi"); | 199 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hhi"); |
| 200 | if (!res) | 200 | if (!res) { |
| 201 | return -EINVAL; | 201 | ret = -EINVAL; |
| 202 | goto free_drm; | ||
| 203 | } | ||
| 202 | /* Simply ioremap since it may be a shared register zone */ | 204 | /* Simply ioremap since it may be a shared register zone */ |
| 203 | regs = devm_ioremap(dev, res->start, resource_size(res)); | 205 | regs = devm_ioremap(dev, res->start, resource_size(res)); |
| 204 | if (!regs) { | 206 | if (!regs) { |
| @@ -215,8 +217,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) | |||
| 215 | } | 217 | } |
| 216 | 218 | ||
| 217 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmc"); | 219 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmc"); |
| 218 | if (!res) | 220 | if (!res) { |
| 219 | return -EINVAL; | 221 | ret = -EINVAL; |
| 222 | goto free_drm; | ||
| 223 | } | ||
| 220 | /* Simply ioremap since it may be a shared register zone */ | 224 | /* Simply ioremap since it may be a shared register zone */ |
| 221 | regs = devm_ioremap(dev, res->start, resource_size(res)); | 225 | regs = devm_ioremap(dev, res->start, resource_size(res)); |
| 222 | if (!regs) { | 226 | if (!regs) { |
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c index 2ebdc6d5a76e..d5583190f3e4 100644 --- a/drivers/gpu/drm/udl/udl_fb.c +++ b/drivers/gpu/drm/udl/udl_fb.c | |||
| @@ -137,7 +137,10 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y, | |||
| 137 | 137 | ||
| 138 | if (cmd > (char *) urb->transfer_buffer) { | 138 | if (cmd > (char *) urb->transfer_buffer) { |
| 139 | /* Send partial buffer remaining before exiting */ | 139 | /* Send partial buffer remaining before exiting */ |
| 140 | int len = cmd - (char *) urb->transfer_buffer; | 140 | int len; |
| 141 | if (cmd < (char *) urb->transfer_buffer + urb->transfer_buffer_length) | ||
| 142 | *cmd++ = 0xAF; | ||
| 143 | len = cmd - (char *) urb->transfer_buffer; | ||
| 141 | ret = udl_submit_urb(dev, urb, len); | 144 | ret = udl_submit_urb(dev, urb, len); |
| 142 | bytes_sent += len; | 145 | bytes_sent += len; |
| 143 | } else | 146 | } else |
diff --git a/drivers/gpu/drm/udl/udl_transfer.c b/drivers/gpu/drm/udl/udl_transfer.c index 0c87b1ac6b68..b992644c17e6 100644 --- a/drivers/gpu/drm/udl/udl_transfer.c +++ b/drivers/gpu/drm/udl/udl_transfer.c | |||
| @@ -153,11 +153,11 @@ static void udl_compress_hline16( | |||
| 153 | raw_pixels_count_byte = cmd++; /* we'll know this later */ | 153 | raw_pixels_count_byte = cmd++; /* we'll know this later */ |
| 154 | raw_pixel_start = pixel; | 154 | raw_pixel_start = pixel; |
| 155 | 155 | ||
| 156 | cmd_pixel_end = pixel + (min(MAX_CMD_PIXELS + 1, | 156 | cmd_pixel_end = pixel + min3(MAX_CMD_PIXELS + 1UL, |
| 157 | min((int)(pixel_end - pixel) / bpp, | 157 | (unsigned long)(pixel_end - pixel) / bpp, |
| 158 | (int)(cmd_buffer_end - cmd) / 2))) * bpp; | 158 | (unsigned long)(cmd_buffer_end - 1 - cmd) / 2) * bpp; |
| 159 | 159 | ||
| 160 | prefetch_range((void *) pixel, (cmd_pixel_end - pixel) * bpp); | 160 | prefetch_range((void *) pixel, cmd_pixel_end - pixel); |
| 161 | pixel_val16 = get_pixel_val16(pixel, bpp); | 161 | pixel_val16 = get_pixel_val16(pixel, bpp); |
| 162 | 162 | ||
| 163 | while (pixel < cmd_pixel_end) { | 163 | while (pixel < cmd_pixel_end) { |
| @@ -193,6 +193,9 @@ static void udl_compress_hline16( | |||
| 193 | if (pixel > raw_pixel_start) { | 193 | if (pixel > raw_pixel_start) { |
| 194 | /* finalize last RAW span */ | 194 | /* finalize last RAW span */ |
| 195 | *raw_pixels_count_byte = ((pixel-raw_pixel_start) / bpp) & 0xFF; | 195 | *raw_pixels_count_byte = ((pixel-raw_pixel_start) / bpp) & 0xFF; |
| 196 | } else { | ||
| 197 | /* undo unused byte */ | ||
| 198 | cmd--; | ||
| 196 | } | 199 | } |
| 197 | 200 | ||
| 198 | *cmd_pixels_count_byte = ((pixel - cmd_pixel_start) / bpp) & 0xFF; | 201 | *cmd_pixels_count_byte = ((pixel - cmd_pixel_start) / bpp) & 0xFF; |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index f858cc72011d..3942ee61bd1c 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
| @@ -1952,6 +1952,8 @@ static int hid_device_probe(struct device *dev) | |||
| 1952 | } | 1952 | } |
| 1953 | hdev->io_started = false; | 1953 | hdev->io_started = false; |
| 1954 | 1954 | ||
| 1955 | clear_bit(ffs(HID_STAT_REPROBED), &hdev->status); | ||
| 1956 | |||
| 1955 | if (!hdev->driver) { | 1957 | if (!hdev->driver) { |
| 1956 | id = hid_match_device(hdev, hdrv); | 1958 | id = hid_match_device(hdev, hdrv); |
| 1957 | if (id == NULL) { | 1959 | if (id == NULL) { |
| @@ -2215,7 +2217,8 @@ static int __hid_bus_reprobe_drivers(struct device *dev, void *data) | |||
| 2215 | struct hid_device *hdev = to_hid_device(dev); | 2217 | struct hid_device *hdev = to_hid_device(dev); |
| 2216 | 2218 | ||
| 2217 | if (hdev->driver == hdrv && | 2219 | if (hdev->driver == hdrv && |
| 2218 | !hdrv->match(hdev, hid_ignore_special_drivers)) | 2220 | !hdrv->match(hdev, hid_ignore_special_drivers) && |
| 2221 | !test_and_set_bit(ffs(HID_STAT_REPROBED), &hdev->status)) | ||
| 2219 | return device_reprobe(dev); | 2222 | return device_reprobe(dev); |
| 2220 | 2223 | ||
| 2221 | return 0; | 2224 | return 0; |
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 8469b6964ff6..b48100236df8 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c | |||
| @@ -1154,6 +1154,8 @@ copy_rest: | |||
| 1154 | goto out; | 1154 | goto out; |
| 1155 | if (list->tail > list->head) { | 1155 | if (list->tail > list->head) { |
| 1156 | len = list->tail - list->head; | 1156 | len = list->tail - list->head; |
| 1157 | if (len > count) | ||
| 1158 | len = count; | ||
| 1157 | 1159 | ||
| 1158 | if (copy_to_user(buffer + ret, &list->hid_debug_buf[list->head], len)) { | 1160 | if (copy_to_user(buffer + ret, &list->hid_debug_buf[list->head], len)) { |
| 1159 | ret = -EFAULT; | 1161 | ret = -EFAULT; |
| @@ -1163,6 +1165,8 @@ copy_rest: | |||
| 1163 | list->head += len; | 1165 | list->head += len; |
| 1164 | } else { | 1166 | } else { |
| 1165 | len = HID_DEBUG_BUFSIZE - list->head; | 1167 | len = HID_DEBUG_BUFSIZE - list->head; |
| 1168 | if (len > count) | ||
| 1169 | len = count; | ||
| 1166 | 1170 | ||
| 1167 | if (copy_to_user(buffer, &list->hid_debug_buf[list->head], len)) { | 1171 | if (copy_to_user(buffer, &list->hid_debug_buf[list->head], len)) { |
| 1168 | ret = -EFAULT; | 1172 | ret = -EFAULT; |
| @@ -1170,7 +1174,9 @@ copy_rest: | |||
| 1170 | } | 1174 | } |
| 1171 | list->head = 0; | 1175 | list->head = 0; |
| 1172 | ret += len; | 1176 | ret += len; |
| 1173 | goto copy_rest; | 1177 | count -= len; |
| 1178 | if (count > 0) | ||
| 1179 | goto copy_rest; | ||
| 1174 | } | 1180 | } |
| 1175 | 1181 | ||
| 1176 | } | 1182 | } |
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index c1652bb7bd15..eae0cb3ddec6 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c | |||
| @@ -484,7 +484,7 @@ static void i2c_hid_get_input(struct i2c_hid *ihid) | |||
| 484 | return; | 484 | return; |
| 485 | } | 485 | } |
| 486 | 486 | ||
| 487 | if ((ret_size > size) || (ret_size <= 2)) { | 487 | if ((ret_size > size) || (ret_size < 2)) { |
| 488 | dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n", | 488 | dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n", |
| 489 | __func__, size, ret_size); | 489 | __func__, size, ret_size); |
| 490 | return; | 490 | return; |
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index e3ce233f8bdc..23872d08308c 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/hiddev.h> | 36 | #include <linux/hiddev.h> |
| 37 | #include <linux/compat.h> | 37 | #include <linux/compat.h> |
| 38 | #include <linux/vmalloc.h> | 38 | #include <linux/vmalloc.h> |
| 39 | #include <linux/nospec.h> | ||
| 39 | #include "usbhid.h" | 40 | #include "usbhid.h" |
| 40 | 41 | ||
| 41 | #ifdef CONFIG_USB_DYNAMIC_MINORS | 42 | #ifdef CONFIG_USB_DYNAMIC_MINORS |
| @@ -469,10 +470,14 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd, | |||
| 469 | 470 | ||
| 470 | if (uref->field_index >= report->maxfield) | 471 | if (uref->field_index >= report->maxfield) |
| 471 | goto inval; | 472 | goto inval; |
| 473 | uref->field_index = array_index_nospec(uref->field_index, | ||
| 474 | report->maxfield); | ||
| 472 | 475 | ||
| 473 | field = report->field[uref->field_index]; | 476 | field = report->field[uref->field_index]; |
| 474 | if (uref->usage_index >= field->maxusage) | 477 | if (uref->usage_index >= field->maxusage) |
| 475 | goto inval; | 478 | goto inval; |
| 479 | uref->usage_index = array_index_nospec(uref->usage_index, | ||
| 480 | field->maxusage); | ||
| 476 | 481 | ||
| 477 | uref->usage_code = field->usage[uref->usage_index].hid; | 482 | uref->usage_code = field->usage[uref->usage_index].hid; |
| 478 | 483 | ||
| @@ -499,6 +504,8 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd, | |||
| 499 | 504 | ||
| 500 | if (uref->field_index >= report->maxfield) | 505 | if (uref->field_index >= report->maxfield) |
| 501 | goto inval; | 506 | goto inval; |
| 507 | uref->field_index = array_index_nospec(uref->field_index, | ||
| 508 | report->maxfield); | ||
| 502 | 509 | ||
| 503 | field = report->field[uref->field_index]; | 510 | field = report->field[uref->field_index]; |
| 504 | 511 | ||
| @@ -753,6 +760,8 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 753 | 760 | ||
| 754 | if (finfo.field_index >= report->maxfield) | 761 | if (finfo.field_index >= report->maxfield) |
| 755 | break; | 762 | break; |
| 763 | finfo.field_index = array_index_nospec(finfo.field_index, | ||
| 764 | report->maxfield); | ||
| 756 | 765 | ||
| 757 | field = report->field[finfo.field_index]; | 766 | field = report->field[finfo.field_index]; |
| 758 | memset(&finfo, 0, sizeof(finfo)); | 767 | memset(&finfo, 0, sizeof(finfo)); |
| @@ -797,6 +806,8 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 797 | 806 | ||
| 798 | if (cinfo.index >= hid->maxcollection) | 807 | if (cinfo.index >= hid->maxcollection) |
| 799 | break; | 808 | break; |
| 809 | cinfo.index = array_index_nospec(cinfo.index, | ||
| 810 | hid->maxcollection); | ||
| 800 | 811 | ||
| 801 | cinfo.type = hid->collection[cinfo.index].type; | 812 | cinfo.type = hid->collection[cinfo.index].type; |
| 802 | cinfo.usage = hid->collection[cinfo.index].usage; | 813 | cinfo.usage = hid->collection[cinfo.index].usage; |
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 0bb44d0088ed..ad7afa74d365 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c | |||
| @@ -3365,8 +3365,14 @@ void wacom_setup_device_quirks(struct wacom *wacom) | |||
| 3365 | if (features->type >= INTUOSHT && features->type <= BAMBOO_PT) | 3365 | if (features->type >= INTUOSHT && features->type <= BAMBOO_PT) |
| 3366 | features->device_type |= WACOM_DEVICETYPE_PAD; | 3366 | features->device_type |= WACOM_DEVICETYPE_PAD; |
| 3367 | 3367 | ||
| 3368 | features->x_max = 4096; | 3368 | if (features->type == INTUOSHT2) { |
| 3369 | features->y_max = 4096; | 3369 | features->x_max = features->x_max / 10; |
| 3370 | features->y_max = features->y_max / 10; | ||
| 3371 | } | ||
| 3372 | else { | ||
| 3373 | features->x_max = 4096; | ||
| 3374 | features->y_max = 4096; | ||
| 3375 | } | ||
| 3370 | } | 3376 | } |
| 3371 | else if (features->pktlen == WACOM_PKGLEN_BBTOUCH) { | 3377 | else if (features->pktlen == WACOM_PKGLEN_BBTOUCH) { |
| 3372 | features->device_type |= WACOM_DEVICETYPE_PAD; | 3378 | features->device_type |= WACOM_DEVICETYPE_PAD; |
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index 4a34f311e1ff..6ec65adaba49 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c | |||
| @@ -647,10 +647,10 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap, | |||
| 647 | if (bit_adap->getscl == NULL) | 647 | if (bit_adap->getscl == NULL) |
| 648 | adap->quirks = &i2c_bit_quirk_no_clk_stretch; | 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 */ | 650 | /* |
| 651 | setscl(bit_adap, 1); | 651 | * We tried forcing SCL/SDA to an initial state here. But that caused a |
| 652 | udelay(bit_adap->udelay); | 652 | * regression, sadly. Check Bugzilla #200045 for details. |
| 653 | setsda(bit_adap, 1); | 653 | */ |
| 654 | 654 | ||
| 655 | ret = add_adapter(adap); | 655 | ret = add_adapter(adap); |
| 656 | if (ret < 0) | 656 | if (ret < 0) |
diff --git a/drivers/i2c/busses/i2c-cht-wc.c b/drivers/i2c/busses/i2c-cht-wc.c index 44cffad43701..c4d176f5ed79 100644 --- a/drivers/i2c/busses/i2c-cht-wc.c +++ b/drivers/i2c/busses/i2c-cht-wc.c | |||
| @@ -234,7 +234,8 @@ static const struct irq_chip cht_wc_i2c_irq_chip = { | |||
| 234 | .name = "cht_wc_ext_chrg_irq_chip", | 234 | .name = "cht_wc_ext_chrg_irq_chip", |
| 235 | }; | 235 | }; |
| 236 | 236 | ||
| 237 | static const char * const bq24190_suppliers[] = { "fusb302-typec-source" }; | 237 | static const char * const bq24190_suppliers[] = { |
| 238 | "tcpm-source-psy-i2c-fusb302" }; | ||
| 238 | 239 | ||
| 239 | static const struct property_entry bq24190_props[] = { | 240 | static const struct property_entry bq24190_props[] = { |
| 240 | PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq24190_suppliers), | 241 | PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq24190_suppliers), |
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index 005e6e0330c2..66f85bbf3591 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c | |||
| @@ -279,9 +279,9 @@ static int i2c_gpio_probe(struct platform_device *pdev) | |||
| 279 | * required for an I2C bus. | 279 | * required for an I2C bus. |
| 280 | */ | 280 | */ |
| 281 | if (pdata->scl_is_open_drain) | 281 | if (pdata->scl_is_open_drain) |
| 282 | gflags = GPIOD_OUT_LOW; | 282 | gflags = GPIOD_OUT_HIGH; |
| 283 | else | 283 | else |
| 284 | gflags = GPIOD_OUT_LOW_OPEN_DRAIN; | 284 | gflags = GPIOD_OUT_HIGH_OPEN_DRAIN; |
| 285 | priv->scl = i2c_gpio_get_desc(dev, "scl", 1, gflags); | 285 | priv->scl = i2c_gpio_get_desc(dev, "scl", 1, gflags); |
| 286 | if (IS_ERR(priv->scl)) | 286 | if (IS_ERR(priv->scl)) |
| 287 | return PTR_ERR(priv->scl); | 287 | return PTR_ERR(priv->scl); |
diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c index f3f683041e7f..51970bae3c4a 100644 --- a/drivers/i2c/i2c-core-smbus.c +++ b/drivers/i2c/i2c-core-smbus.c | |||
| @@ -465,15 +465,18 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, | |||
| 465 | 465 | ||
| 466 | status = i2c_transfer(adapter, msg, num); | 466 | status = i2c_transfer(adapter, msg, num); |
| 467 | if (status < 0) | 467 | if (status < 0) |
| 468 | return status; | 468 | goto cleanup; |
| 469 | if (status != num) | 469 | if (status != num) { |
| 470 | return -EIO; | 470 | status = -EIO; |
| 471 | goto cleanup; | ||
| 472 | } | ||
| 473 | status = 0; | ||
| 471 | 474 | ||
| 472 | /* Check PEC if last message is a read */ | 475 | /* Check PEC if last message is a read */ |
| 473 | if (i && (msg[num-1].flags & I2C_M_RD)) { | 476 | if (i && (msg[num-1].flags & I2C_M_RD)) { |
| 474 | status = i2c_smbus_check_pec(partial_pec, &msg[num-1]); | 477 | status = i2c_smbus_check_pec(partial_pec, &msg[num-1]); |
| 475 | if (status < 0) | 478 | if (status < 0) |
| 476 | return status; | 479 | goto cleanup; |
| 477 | } | 480 | } |
| 478 | 481 | ||
| 479 | if (read_write == I2C_SMBUS_READ) | 482 | if (read_write == I2C_SMBUS_READ) |
| @@ -499,12 +502,13 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, | |||
| 499 | break; | 502 | break; |
| 500 | } | 503 | } |
| 501 | 504 | ||
| 505 | cleanup: | ||
| 502 | if (msg[0].flags & I2C_M_DMA_SAFE) | 506 | if (msg[0].flags & I2C_M_DMA_SAFE) |
| 503 | kfree(msg[0].buf); | 507 | kfree(msg[0].buf); |
| 504 | if (msg[1].flags & I2C_M_DMA_SAFE) | 508 | if (msg[1].flags & I2C_M_DMA_SAFE) |
| 505 | kfree(msg[1].buf); | 509 | kfree(msg[1].buf); |
| 506 | 510 | ||
| 507 | return 0; | 511 | return status; |
| 508 | } | 512 | } |
| 509 | 513 | ||
| 510 | /** | 514 | /** |
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index 7e3d82cff3d5..c149c9c360fc 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c | |||
| @@ -1053,7 +1053,7 @@ static irqreturn_t mma8452_interrupt(int irq, void *p) | |||
| 1053 | if (src < 0) | 1053 | if (src < 0) |
| 1054 | return IRQ_NONE; | 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 | return IRQ_NONE; | 1057 | return IRQ_NONE; |
| 1058 | 1058 | ||
| 1059 | if (src & MMA8452_INT_DRDY) { | 1059 | if (src & MMA8452_INT_DRDY) { |
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index f9c0624505a2..42618fe4f83e 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | |||
| @@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, | |||
| 959 | } | 959 | } |
| 960 | 960 | ||
| 961 | irq_type = irqd_get_trigger_type(desc); | 961 | irq_type = irqd_get_trigger_type(desc); |
| 962 | if (!irq_type) | ||
| 963 | irq_type = IRQF_TRIGGER_RISING; | ||
| 962 | if (irq_type == IRQF_TRIGGER_RISING) | 964 | if (irq_type == IRQF_TRIGGER_RISING) |
| 963 | st->irq_mask = INV_MPU6050_ACTIVE_HIGH; | 965 | st->irq_mask = INV_MPU6050_ACTIVE_HIGH; |
| 964 | else if (irq_type == IRQF_TRIGGER_FALLING) | 966 | else if (irq_type == IRQF_TRIGGER_FALLING) |
diff --git a/drivers/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c index 34d42a2504c9..df5b2a0da96c 100644 --- a/drivers/iio/light/tsl2772.c +++ b/drivers/iio/light/tsl2772.c | |||
| @@ -582,6 +582,8 @@ static int tsl2772_als_calibrate(struct iio_dev *indio_dev) | |||
| 582 | "%s: failed to get lux\n", __func__); | 582 | "%s: failed to get lux\n", __func__); |
| 583 | return lux_val; | 583 | return lux_val; |
| 584 | } | 584 | } |
| 585 | if (lux_val == 0) | ||
| 586 | return -ERANGE; | ||
| 585 | 587 | ||
| 586 | ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) / | 588 | ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) / |
| 587 | lux_val; | 589 | lux_val; |
diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index 5ec3e41b65f2..fe87d27779d9 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c | |||
| @@ -415,10 +415,9 @@ static int bmp280_read_humid(struct bmp280_data *data, int *val, int *val2) | |||
| 415 | } | 415 | } |
| 416 | comp_humidity = bmp280_compensate_humidity(data, adc_humidity); | 416 | comp_humidity = bmp280_compensate_humidity(data, adc_humidity); |
| 417 | 417 | ||
| 418 | *val = comp_humidity; | 418 | *val = comp_humidity * 1000 / 1024; |
| 419 | *val2 = 1024; | ||
| 420 | 419 | ||
| 421 | return IIO_VAL_FRACTIONAL; | 420 | return IIO_VAL_INT; |
| 422 | } | 421 | } |
| 423 | 422 | ||
| 424 | static int bmp280_read_raw(struct iio_dev *indio_dev, | 423 | static int bmp280_read_raw(struct iio_dev *indio_dev, |
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index e3e330f59c2c..b3ba9a222550 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
| @@ -6113,7 +6113,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) | |||
| 6113 | dev->num_ports = max(MLX5_CAP_GEN(mdev, num_ports), | 6113 | dev->num_ports = max(MLX5_CAP_GEN(mdev, num_ports), |
| 6114 | MLX5_CAP_GEN(mdev, num_vhca_ports)); | 6114 | MLX5_CAP_GEN(mdev, num_vhca_ports)); |
| 6115 | 6115 | ||
| 6116 | if (MLX5_VPORT_MANAGER(mdev) && | 6116 | if (MLX5_ESWITCH_MANAGER(mdev) && |
| 6117 | mlx5_ib_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) { | 6117 | mlx5_ib_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) { |
| 6118 | dev->rep = mlx5_ib_vport_rep(mdev->priv.eswitch, 0); | 6118 | dev->rep = mlx5_ib_vport_rep(mdev->priv.eswitch, 0); |
| 6119 | 6119 | ||
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index cf30523c6ef6..6c7326c93721 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c | |||
| @@ -131,8 +131,10 @@ EXPORT_SYMBOL(input_mt_destroy_slots); | |||
| 131 | * inactive, or if the tool type is changed, a new tracking id is | 131 | * inactive, or if the tool type is changed, a new tracking id is |
| 132 | * assigned to the slot. The tool type is only reported if the | 132 | * assigned to the slot. The tool type is only reported if the |
| 133 | * corresponding absbit field is set. | 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 | unsigned int tool_type, bool active) | 138 | unsigned int tool_type, bool active) |
| 137 | { | 139 | { |
| 138 | struct input_mt *mt = dev->mt; | 140 | struct input_mt *mt = dev->mt; |
| @@ -140,22 +142,24 @@ void input_mt_report_slot_state(struct input_dev *dev, | |||
| 140 | int id; | 142 | int id; |
| 141 | 143 | ||
| 142 | if (!mt) | 144 | if (!mt) |
| 143 | return; | 145 | return false; |
| 144 | 146 | ||
| 145 | slot = &mt->slots[mt->slot]; | 147 | slot = &mt->slots[mt->slot]; |
| 146 | slot->frame = mt->frame; | 148 | slot->frame = mt->frame; |
| 147 | 149 | ||
| 148 | if (!active) { | 150 | if (!active) { |
| 149 | input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1); | 151 | input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1); |
| 150 | return; | 152 | return false; |
| 151 | } | 153 | } |
| 152 | 154 | ||
| 153 | id = input_mt_get_value(slot, ABS_MT_TRACKING_ID); | 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 | id = input_mt_new_trkid(mt); | 157 | id = input_mt_new_trkid(mt); |
| 156 | 158 | ||
| 157 | input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, id); | 159 | input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, id); |
| 158 | input_event(dev, EV_ABS, ABS_MT_TOOL_TYPE, tool_type); | 160 | input_event(dev, EV_ABS, ABS_MT_TOOL_TYPE, tool_type); |
| 161 | |||
| 162 | return true; | ||
| 159 | } | 163 | } |
| 160 | EXPORT_SYMBOL(input_mt_report_slot_state); | 164 | EXPORT_SYMBOL(input_mt_report_slot_state); |
| 161 | 165 | ||
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 48e36acbeb49..cd620e009bad 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c | |||
| @@ -125,7 +125,7 @@ static const struct xpad_device { | |||
| 125 | u8 mapping; | 125 | u8 mapping; |
| 126 | u8 xtype; | 126 | u8 xtype; |
| 127 | } xpad_device[] = { | 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 | { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX }, | 129 | { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX }, |
| 130 | { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX }, | 130 | { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX }, |
| 131 | { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX }, | 131 | { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX }, |
diff --git a/drivers/input/keyboard/goldfish_events.c b/drivers/input/keyboard/goldfish_events.c index f6e643b589b6..e8dae6195b30 100644 --- a/drivers/input/keyboard/goldfish_events.c +++ b/drivers/input/keyboard/goldfish_events.c | |||
| @@ -45,7 +45,7 @@ struct event_dev { | |||
| 45 | static irqreturn_t events_interrupt(int irq, void *dev_id) | 45 | static irqreturn_t events_interrupt(int irq, void *dev_id) |
| 46 | { | 46 | { |
| 47 | struct event_dev *edev = dev_id; | 47 | struct event_dev *edev = dev_id; |
| 48 | unsigned type, code, value; | 48 | unsigned int type, code, value; |
| 49 | 49 | ||
| 50 | type = __raw_readl(edev->addr + REG_READ); | 50 | type = __raw_readl(edev->addr + REG_READ); |
| 51 | code = __raw_readl(edev->addr + REG_READ); | 51 | code = __raw_readl(edev->addr + REG_READ); |
| @@ -57,7 +57,7 @@ static irqreturn_t events_interrupt(int irq, void *dev_id) | |||
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | static void events_import_bits(struct event_dev *edev, | 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 | void __iomem *addr = edev->addr; | 62 | void __iomem *addr = edev->addr; |
| 63 | int i, j; | 63 | int i, j; |
| @@ -99,6 +99,7 @@ static void events_import_abs_params(struct event_dev *edev) | |||
| 99 | 99 | ||
| 100 | for (j = 0; j < ARRAY_SIZE(val); j++) { | 100 | for (j = 0; j < ARRAY_SIZE(val); j++) { |
| 101 | int offset = (i * ARRAY_SIZE(val) + j) * sizeof(u32); | 101 | int offset = (i * ARRAY_SIZE(val) + j) * sizeof(u32); |
| 102 | |||
| 102 | val[j] = __raw_readl(edev->addr + REG_DATA + offset); | 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) | |||
| 112 | struct input_dev *input_dev; | 113 | struct input_dev *input_dev; |
| 113 | struct event_dev *edev; | 114 | struct event_dev *edev; |
| 114 | struct resource *res; | 115 | struct resource *res; |
| 115 | unsigned keymapnamelen; | 116 | unsigned int keymapnamelen; |
| 116 | void __iomem *addr; | 117 | void __iomem *addr; |
| 117 | int irq; | 118 | int irq; |
| 118 | int i; | 119 | int i; |
| @@ -150,7 +151,7 @@ static int events_probe(struct platform_device *pdev) | |||
| 150 | for (i = 0; i < keymapnamelen; i++) | 151 | for (i = 0; i < keymapnamelen; i++) |
| 151 | edev->name[i] = __raw_readb(edev->addr + REG_DATA + i); | 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 | input_dev->name = edev->name; | 156 | input_dev->name = edev->name; |
| 156 | input_dev->id.bustype = BUS_HOST; | 157 | input_dev->id.bustype = BUS_HOST; |
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index c25606e00693..ca59a2be9bc5 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
| @@ -841,4 +841,14 @@ config INPUT_RAVE_SP_PWRBUTTON | |||
| 841 | To compile this driver as a module, choose M here: the | 841 | To compile this driver as a module, choose M here: the |
| 842 | module will be called rave-sp-pwrbutton. | 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 | endif | 854 | endif |
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index 72cde28649e2..9d0f9d1ff68f 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile | |||
| @@ -66,6 +66,7 @@ obj-$(CONFIG_INPUT_RETU_PWRBUTTON) += retu-pwrbutton.o | |||
| 66 | obj-$(CONFIG_INPUT_AXP20X_PEK) += axp20x-pek.o | 66 | obj-$(CONFIG_INPUT_AXP20X_PEK) += axp20x-pek.o |
| 67 | obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o | 67 | obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o |
| 68 | obj-$(CONFIG_INPUT_RK805_PWRKEY) += rk805-pwrkey.o | 68 | obj-$(CONFIG_INPUT_RK805_PWRKEY) += rk805-pwrkey.o |
| 69 | obj-$(CONFIG_INPUT_SC27XX_VIBRA) += sc27xx-vibra.o | ||
| 69 | obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o | 70 | obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o |
| 70 | obj-$(CONFIG_INPUT_SIRFSOC_ONKEY) += sirfsoc-onkey.o | 71 | obj-$(CONFIG_INPUT_SIRFSOC_ONKEY) += sirfsoc-onkey.o |
| 71 | obj-$(CONFIG_INPUT_SOC_BUTTON_ARRAY) += soc_button_array.o | 72 | obj-$(CONFIG_INPUT_SOC_BUTTON_ARRAY) += soc_button_array.o |
diff --git a/drivers/input/misc/sc27xx-vibra.c b/drivers/input/misc/sc27xx-vibra.c new file mode 100644 index 000000000000..295251abbdac --- /dev/null +++ b/drivers/input/misc/sc27xx-vibra.c | |||
| @@ -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>"); | ||
diff --git a/drivers/input/mouse/elan_i2c.h b/drivers/input/mouse/elan_i2c.h index 599544c1a91c..243e0fa6e3e3 100644 --- a/drivers/input/mouse/elan_i2c.h +++ b/drivers/input/mouse/elan_i2c.h | |||
| @@ -27,6 +27,8 @@ | |||
| 27 | #define ETP_DISABLE_POWER 0x0001 | 27 | #define ETP_DISABLE_POWER 0x0001 |
| 28 | #define ETP_PRESSURE_OFFSET 25 | 28 | #define ETP_PRESSURE_OFFSET 25 |
| 29 | 29 | ||
| 30 | #define ETP_CALIBRATE_MAX_LEN 3 | ||
| 31 | |||
| 30 | /* IAP Firmware handling */ | 32 | /* IAP Firmware handling */ |
| 31 | #define ETP_PRODUCT_ID_FORMAT_STRING "%d.0" | 33 | #define ETP_PRODUCT_ID_FORMAT_STRING "%d.0" |
| 32 | #define ETP_FW_NAME "elan_i2c_" ETP_PRODUCT_ID_FORMAT_STRING ".bin" | 34 | #define ETP_FW_NAME "elan_i2c_" ETP_PRODUCT_ID_FORMAT_STRING ".bin" |
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 8ff75114e762..1f9cd7d8b7ad 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c | |||
| @@ -613,7 +613,7 @@ static ssize_t calibrate_store(struct device *dev, | |||
| 613 | int tries = 20; | 613 | int tries = 20; |
| 614 | int retval; | 614 | int retval; |
| 615 | int error; | 615 | int error; |
| 616 | u8 val[3]; | 616 | u8 val[ETP_CALIBRATE_MAX_LEN]; |
| 617 | 617 | ||
| 618 | retval = mutex_lock_interruptible(&data->sysfs_mutex); | 618 | retval = mutex_lock_interruptible(&data->sysfs_mutex); |
| 619 | if (retval) | 619 | if (retval) |
| @@ -1345,6 +1345,7 @@ static const struct acpi_device_id elan_acpi_id[] = { | |||
| 1345 | { "ELAN060C", 0 }, | 1345 | { "ELAN060C", 0 }, |
| 1346 | { "ELAN0611", 0 }, | 1346 | { "ELAN0611", 0 }, |
| 1347 | { "ELAN0612", 0 }, | 1347 | { "ELAN0612", 0 }, |
| 1348 | { "ELAN0618", 0 }, | ||
| 1348 | { "ELAN1000", 0 }, | 1349 | { "ELAN1000", 0 }, |
| 1349 | { } | 1350 | { } |
| 1350 | }; | 1351 | }; |
diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c index cfcb32559925..c060d270bc4d 100644 --- a/drivers/input/mouse/elan_i2c_smbus.c +++ b/drivers/input/mouse/elan_i2c_smbus.c | |||
| @@ -56,7 +56,7 @@ | |||
| 56 | static int elan_smbus_initialize(struct i2c_client *client) | 56 | static int elan_smbus_initialize(struct i2c_client *client) |
| 57 | { | 57 | { |
| 58 | u8 check[ETP_SMBUS_HELLOPACKET_LEN] = { 0x55, 0x55, 0x55, 0x55, 0x55 }; | 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 | int len, error; | 60 | int len, error; |
| 61 | 61 | ||
| 62 | /* Get hello packet */ | 62 | /* Get hello packet */ |
| @@ -117,12 +117,16 @@ static int elan_smbus_calibrate(struct i2c_client *client) | |||
| 117 | static int elan_smbus_calibrate_result(struct i2c_client *client, u8 *val) | 117 | static int elan_smbus_calibrate_result(struct i2c_client *client, u8 *val) |
| 118 | { | 118 | { |
| 119 | int error; | 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 | error = i2c_smbus_read_block_data(client, | 124 | error = i2c_smbus_read_block_data(client, |
| 122 | ETP_SMBUS_CALIBRATE_QUERY, val); | 125 | ETP_SMBUS_CALIBRATE_QUERY, buf); |
| 123 | if (error < 0) | 126 | if (error < 0) |
| 124 | return error; | 127 | return error; |
| 125 | 128 | ||
| 129 | memcpy(val, buf, ETP_CALIBRATE_MAX_LEN); | ||
| 126 | return 0; | 130 | return 0; |
| 127 | } | 131 | } |
| 128 | 132 | ||
| @@ -472,6 +476,8 @@ static int elan_smbus_get_report(struct i2c_client *client, u8 *report) | |||
| 472 | { | 476 | { |
| 473 | int len; | 477 | int len; |
| 474 | 478 | ||
| 479 | BUILD_BUG_ON(I2C_SMBUS_BLOCK_MAX > ETP_SMBUS_REPORT_LEN); | ||
| 480 | |||
| 475 | len = i2c_smbus_read_block_data(client, | 481 | len = i2c_smbus_read_block_data(client, |
| 476 | ETP_SMBUS_PACKET_QUERY, | 482 | ETP_SMBUS_PACKET_QUERY, |
| 477 | &report[ETP_SMBUS_REPORT_OFFSET]); | 483 | &report[ETP_SMBUS_REPORT_OFFSET]); |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index fb4d902c4403..dd85b16dc6f8 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
| @@ -799,7 +799,7 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) | |||
| 799 | else if (ic_version == 7 && etd->info.samples[1] == 0x2A) | 799 | else if (ic_version == 7 && etd->info.samples[1] == 0x2A) |
| 800 | sanity_check = ((packet[3] & 0x1c) == 0x10); | 800 | sanity_check = ((packet[3] & 0x1c) == 0x10); |
| 801 | else | 801 | else |
| 802 | sanity_check = ((packet[0] & 0x0c) == 0x04 && | 802 | sanity_check = ((packet[0] & 0x08) == 0x00 && |
| 803 | (packet[3] & 0x1c) == 0x10); | 803 | (packet[3] & 0x1c) == 0x10); |
| 804 | 804 | ||
| 805 | if (!sanity_check) | 805 | if (!sanity_check) |
| @@ -1175,6 +1175,12 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = { | |||
| 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 | * Set the appropriate event bits for the input subsystem | 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) | |||
| 1194 | __clear_bit(EV_REL, dev->evbit); | 1200 | __clear_bit(EV_REL, dev->evbit); |
| 1195 | 1201 | ||
| 1196 | __set_bit(BTN_LEFT, dev->keybit); | 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 | __set_bit(BTN_MIDDLE, dev->keybit); | 1205 | __set_bit(BTN_MIDDLE, dev->keybit); |
| 1199 | __set_bit(BTN_RIGHT, dev->keybit); | 1206 | __set_bit(BTN_RIGHT, dev->keybit); |
| 1200 | 1207 | ||
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 5ff5b1952be0..d3ff1fc09af7 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
| @@ -192,8 +192,8 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) | |||
| 192 | else | 192 | else |
| 193 | input_report_rel(dev, REL_WHEEL, -wheel); | 193 | input_report_rel(dev, REL_WHEEL, -wheel); |
| 194 | 194 | ||
| 195 | input_report_key(dev, BTN_SIDE, BIT(4)); | 195 | input_report_key(dev, BTN_SIDE, packet[3] & BIT(4)); |
| 196 | input_report_key(dev, BTN_EXTRA, BIT(5)); | 196 | input_report_key(dev, BTN_EXTRA, packet[3] & BIT(5)); |
| 197 | break; | 197 | break; |
| 198 | } | 198 | } |
| 199 | break; | 199 | break; |
| @@ -203,13 +203,13 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) | |||
| 203 | input_report_rel(dev, REL_WHEEL, -(s8) packet[3]); | 203 | input_report_rel(dev, REL_WHEEL, -(s8) packet[3]); |
| 204 | 204 | ||
| 205 | /* Extra buttons on Genius NewNet 3D */ | 205 | /* Extra buttons on Genius NewNet 3D */ |
| 206 | input_report_key(dev, BTN_SIDE, BIT(6)); | 206 | input_report_key(dev, BTN_SIDE, packet[0] & BIT(6)); |
| 207 | input_report_key(dev, BTN_EXTRA, BIT(7)); | 207 | input_report_key(dev, BTN_EXTRA, packet[0] & BIT(7)); |
| 208 | break; | 208 | break; |
| 209 | 209 | ||
| 210 | case PSMOUSE_THINKPS: | 210 | case PSMOUSE_THINKPS: |
| 211 | /* Extra button on ThinkingMouse */ | 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 | * Without this bit of weirdness moving up gives wildly | 215 | * Without this bit of weirdness moving up gives wildly |
| @@ -223,7 +223,7 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) | |||
| 223 | * Cortron PS2 Trackball reports SIDE button in the | 223 | * Cortron PS2 Trackball reports SIDE button in the |
| 224 | * 4th bit of the first byte. | 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 | packet[0] |= BIT(3); | 227 | packet[0] |= BIT(3); |
| 228 | break; | 228 | break; |
| 229 | 229 | ||
diff --git a/drivers/input/rmi4/Kconfig b/drivers/input/rmi4/Kconfig index 7172b88cd064..fad2eae4a118 100644 --- a/drivers/input/rmi4/Kconfig +++ b/drivers/input/rmi4/Kconfig | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | # | 3 | # |
| 4 | config RMI4_CORE | 4 | config RMI4_CORE |
| 5 | tristate "Synaptics RMI4 bus support" | 5 | tristate "Synaptics RMI4 bus support" |
| 6 | select IRQ_DOMAIN | ||
| 6 | help | 7 | help |
| 7 | Say Y here if you want to support the Synaptics RMI4 bus. This is | 8 | Say Y here if you want to support the Synaptics RMI4 bus. This is |
| 8 | required for all RMI4 device support. | 9 | required for all RMI4 device support. |
diff --git a/drivers/input/rmi4/rmi_2d_sensor.c b/drivers/input/rmi4/rmi_2d_sensor.c index 8bb866c7b985..8eeffa066022 100644 --- a/drivers/input/rmi4/rmi_2d_sensor.c +++ b/drivers/input/rmi4/rmi_2d_sensor.c | |||
| @@ -32,15 +32,15 @@ void rmi_2d_sensor_abs_process(struct rmi_2d_sensor *sensor, | |||
| 32 | if (obj->type == RMI_2D_OBJECT_NONE) | 32 | if (obj->type == RMI_2D_OBJECT_NONE) |
| 33 | return; | 33 | return; |
| 34 | 34 | ||
| 35 | if (axis_align->swap_axes) | ||
| 36 | swap(obj->x, obj->y); | ||
| 37 | |||
| 38 | if (axis_align->flip_x) | 35 | if (axis_align->flip_x) |
| 39 | obj->x = sensor->max_x - obj->x; | 36 | obj->x = sensor->max_x - obj->x; |
| 40 | 37 | ||
| 41 | if (axis_align->flip_y) | 38 | if (axis_align->flip_y) |
| 42 | obj->y = sensor->max_y - obj->y; | 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 | * Here checking if X offset or y offset are specified is | 45 | * Here checking if X offset or y offset are specified is |
| 46 | * redundant. We just add the offsets or clip the values. | 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) | |||
| 120 | x = min(RMI_2D_REL_POS_MAX, max(RMI_2D_REL_POS_MIN, (int)x)); | 120 | x = min(RMI_2D_REL_POS_MAX, max(RMI_2D_REL_POS_MIN, (int)x)); |
| 121 | y = min(RMI_2D_REL_POS_MAX, max(RMI_2D_REL_POS_MIN, (int)y)); | 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 | if (axis_align->flip_x) | 123 | if (axis_align->flip_x) |
| 127 | x = min(RMI_2D_REL_POS_MAX, -x); | 124 | x = min(RMI_2D_REL_POS_MAX, -x); |
| 128 | 125 | ||
| 129 | if (axis_align->flip_y) | 126 | if (axis_align->flip_y) |
| 130 | y = min(RMI_2D_REL_POS_MAX, -y); | 127 | y = min(RMI_2D_REL_POS_MAX, -y); |
| 131 | 128 | ||
| 129 | if (axis_align->swap_axes) | ||
| 130 | swap(x, y); | ||
| 131 | |||
| 132 | if (x || y) { | 132 | if (x || y) { |
| 133 | input_report_rel(sensor->input, REL_X, x); | 133 | input_report_rel(sensor->input, REL_X, x); |
| 134 | input_report_rel(sensor->input, REL_Y, y); | 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) | |||
| 141 | struct input_dev *input = sensor->input; | 141 | struct input_dev *input = sensor->input; |
| 142 | int res_x; | 142 | int res_x; |
| 143 | int res_y; | 143 | int res_y; |
| 144 | int max_x, max_y; | ||
| 144 | int input_flags = 0; | 145 | int input_flags = 0; |
| 145 | 146 | ||
| 146 | if (sensor->report_abs) { | 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 | sensor->min_x = sensor->axis_align.clip_x_low; | 148 | sensor->min_x = sensor->axis_align.clip_x_low; |
| 156 | if (sensor->axis_align.clip_x_high) | 149 | if (sensor->axis_align.clip_x_high) |
| 157 | sensor->max_x = min(sensor->max_x, | 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) | |||
| 163 | sensor->axis_align.clip_y_high); | 156 | sensor->axis_align.clip_y_high); |
| 164 | 157 | ||
| 165 | set_bit(EV_ABS, input->evbit); | 158 | set_bit(EV_ABS, input->evbit); |
| 166 | input_set_abs_params(input, ABS_MT_POSITION_X, 0, sensor->max_x, | 159 | |
| 167 | 0, 0); | 160 | max_x = sensor->max_x; |
| 168 | input_set_abs_params(input, ABS_MT_POSITION_Y, 0, sensor->max_y, | 161 | max_y = sensor->max_y; |
| 169 | 0, 0); | 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 | if (sensor->x_mm && sensor->y_mm) { | 167 | if (sensor->x_mm && sensor->y_mm) { |
| 172 | res_x = (sensor->max_x - sensor->min_x) / sensor->x_mm; | 168 | res_x = (sensor->max_x - sensor->min_x) / sensor->x_mm; |
| 173 | res_y = (sensor->max_y - sensor->min_y) / sensor->y_mm; | 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 | input_abs_set_res(input, ABS_X, res_x); | 173 | input_abs_set_res(input, ABS_X, res_x); |
| 176 | input_abs_set_res(input, ABS_Y, res_y); | 174 | input_abs_set_res(input, ABS_Y, res_y); |
diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c index c5fa53adba8d..bd0d5ff01b08 100644 --- a/drivers/input/rmi4/rmi_bus.c +++ b/drivers/input/rmi4/rmi_bus.c | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | 9 | ||
| 10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
| 11 | #include <linux/device.h> | 11 | #include <linux/device.h> |
| 12 | #include <linux/irq.h> | ||
| 13 | #include <linux/irqdomain.h> | ||
| 12 | #include <linux/list.h> | 14 | #include <linux/list.h> |
| 13 | #include <linux/pm.h> | 15 | #include <linux/pm.h> |
| 14 | #include <linux/rmi.h> | 16 | #include <linux/rmi.h> |
| @@ -167,6 +169,39 @@ static inline void rmi_function_of_probe(struct rmi_function *fn) | |||
| 167 | {} | 169 | {} |
| 168 | #endif | 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 | static int rmi_function_probe(struct device *dev) | 205 | static int rmi_function_probe(struct device *dev) |
| 171 | { | 206 | { |
| 172 | struct rmi_function *fn = to_rmi_function(dev); | 207 | struct rmi_function *fn = to_rmi_function(dev); |
| @@ -178,7 +213,14 @@ static int rmi_function_probe(struct device *dev) | |||
| 178 | 213 | ||
| 179 | if (handler->probe) { | 214 | if (handler->probe) { |
| 180 | error = handler->probe(fn); | 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 | return 0; | 226 | return 0; |
| @@ -230,12 +272,18 @@ err_put_device: | |||
| 230 | 272 | ||
| 231 | void rmi_unregister_function(struct rmi_function *fn) | 273 | void rmi_unregister_function(struct rmi_function *fn) |
| 232 | { | 274 | { |
| 275 | int i; | ||
| 276 | |||
| 233 | rmi_dbg(RMI_DEBUG_CORE, &fn->dev, "Unregistering F%02X.\n", | 277 | rmi_dbg(RMI_DEBUG_CORE, &fn->dev, "Unregistering F%02X.\n", |
| 234 | fn->fd.function_number); | 278 | fn->fd.function_number); |
| 235 | 279 | ||
| 236 | device_del(&fn->dev); | 280 | device_del(&fn->dev); |
| 237 | of_node_put(fn->dev.of_node); | 281 | of_node_put(fn->dev.of_node); |
| 238 | put_device(&fn->dev); | 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 | /** |
diff --git a/drivers/input/rmi4/rmi_bus.h b/drivers/input/rmi4/rmi_bus.h index b7625a9ac66a..96383eab41ba 100644 --- a/drivers/input/rmi4/rmi_bus.h +++ b/drivers/input/rmi4/rmi_bus.h | |||
| @@ -14,6 +14,12 @@ | |||
| 14 | 14 | ||
| 15 | struct rmi_device; | 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 | * struct rmi_function - represents the implementation of an RMI4 | 24 | * struct rmi_function - represents the implementation of an RMI4 |
| 19 | * function for a particular device (basically, a driver for that RMI4 function) | 25 | * function for a particular device (basically, a driver for that RMI4 function) |
| @@ -26,6 +32,7 @@ struct rmi_device; | |||
| 26 | * @irq_pos: The position in the irq bitfield this function holds | 32 | * @irq_pos: The position in the irq bitfield this function holds |
| 27 | * @irq_mask: For convenience, can be used to mask IRQ bits off during ATTN | 33 | * @irq_mask: For convenience, can be used to mask IRQ bits off during ATTN |
| 28 | * interrupt handling. | 34 | * interrupt handling. |
| 35 | * @irqs: assigned virq numbers (up to num_of_irqs) | ||
| 29 | * | 36 | * |
| 30 | * @node: entry in device's list of functions | 37 | * @node: entry in device's list of functions |
| 31 | */ | 38 | */ |
| @@ -36,6 +43,7 @@ struct rmi_function { | |||
| 36 | struct list_head node; | 43 | struct list_head node; |
| 37 | 44 | ||
| 38 | unsigned int num_of_irqs; | 45 | unsigned int num_of_irqs; |
| 46 | int irq[RMI_FN_MAX_IRQS]; | ||
| 39 | unsigned int irq_pos; | 47 | unsigned int irq_pos; |
| 40 | unsigned long irq_mask[]; | 48 | unsigned long irq_mask[]; |
| 41 | }; | 49 | }; |
| @@ -76,7 +84,7 @@ struct rmi_function_handler { | |||
| 76 | void (*remove)(struct rmi_function *fn); | 84 | void (*remove)(struct rmi_function *fn); |
| 77 | int (*config)(struct rmi_function *fn); | 85 | int (*config)(struct rmi_function *fn); |
| 78 | int (*reset)(struct rmi_function *fn); | 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 | int (*suspend)(struct rmi_function *fn); | 88 | int (*suspend)(struct rmi_function *fn); |
| 81 | int (*resume)(struct rmi_function *fn); | 89 | int (*resume)(struct rmi_function *fn); |
| 82 | }; | 90 | }; |
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index 7d29053dfb0f..fc3ab93b7aea 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/pm.h> | 21 | #include <linux/pm.h> |
| 22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
| 23 | #include <linux/of.h> | 23 | #include <linux/of.h> |
| 24 | #include <linux/irqdomain.h> | ||
| 24 | #include <uapi/linux/input.h> | 25 | #include <uapi/linux/input.h> |
| 25 | #include <linux/rmi.h> | 26 | #include <linux/rmi.h> |
| 26 | #include "rmi_bus.h" | 27 | #include "rmi_bus.h" |
| @@ -127,28 +128,11 @@ static int rmi_driver_process_config_requests(struct rmi_device *rmi_dev) | |||
| 127 | return 0; | 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 | static int rmi_process_interrupt_requests(struct rmi_device *rmi_dev) | 131 | static int rmi_process_interrupt_requests(struct rmi_device *rmi_dev) |
| 148 | { | 132 | { |
| 149 | struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev); | 133 | struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev); |
| 150 | struct device *dev = &rmi_dev->dev; | 134 | struct device *dev = &rmi_dev->dev; |
| 151 | struct rmi_function *entry; | 135 | int i; |
| 152 | int error; | 136 | int error; |
| 153 | 137 | ||
| 154 | if (!data) | 138 | if (!data) |
| @@ -173,16 +157,8 @@ static int rmi_process_interrupt_requests(struct rmi_device *rmi_dev) | |||
| 173 | */ | 157 | */ |
| 174 | mutex_unlock(&data->irq_mutex); | 158 | mutex_unlock(&data->irq_mutex); |
| 175 | 159 | ||
| 176 | /* | 160 | for_each_set_bit(i, data->irq_status, data->irq_count) |
| 177 | * It would be nice to be able to use irq_chip to handle these | 161 | handle_nested_irq(irq_find_mapping(data->irqdomain, i)); |
| 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); | ||
| 186 | 162 | ||
| 187 | if (data->input) | 163 | if (data->input) |
| 188 | input_sync(data->input); | 164 | input_sync(data->input); |
| @@ -1001,9 +977,13 @@ EXPORT_SYMBOL_GPL(rmi_driver_resume); | |||
| 1001 | static int rmi_driver_remove(struct device *dev) | 977 | static int rmi_driver_remove(struct device *dev) |
| 1002 | { | 978 | { |
| 1003 | struct rmi_device *rmi_dev = to_rmi_device(dev); | 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 | rmi_disable_irq(rmi_dev, false); | 982 | rmi_disable_irq(rmi_dev, false); |
| 1006 | 983 | ||
| 984 | irq_domain_remove(data->irqdomain); | ||
| 985 | data->irqdomain = NULL; | ||
| 986 | |||
| 1007 | rmi_f34_remove_sysfs(rmi_dev); | 987 | rmi_f34_remove_sysfs(rmi_dev); |
| 1008 | rmi_free_function_list(rmi_dev); | 988 | rmi_free_function_list(rmi_dev); |
| 1009 | 989 | ||
| @@ -1035,7 +1015,8 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) | |||
| 1035 | { | 1015 | { |
| 1036 | struct rmi_device *rmi_dev = data->rmi_dev; | 1016 | struct rmi_device *rmi_dev = data->rmi_dev; |
| 1037 | struct device *dev = &rmi_dev->dev; | 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 | size_t size; | 1020 | size_t size; |
| 1040 | int retval; | 1021 | int retval; |
| 1041 | 1022 | ||
| @@ -1046,7 +1027,6 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) | |||
| 1046 | * being accessed. | 1027 | * being accessed. |
| 1047 | */ | 1028 | */ |
| 1048 | rmi_dbg(RMI_DEBUG_CORE, dev, "%s: Counting IRQs.\n", __func__); | 1029 | rmi_dbg(RMI_DEBUG_CORE, dev, "%s: Counting IRQs.\n", __func__); |
| 1049 | irq_count = 0; | ||
| 1050 | data->bootloader_mode = false; | 1030 | data->bootloader_mode = false; |
| 1051 | 1031 | ||
| 1052 | retval = rmi_scan_pdt(rmi_dev, &irq_count, rmi_count_irqs); | 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) | |||
| 1058 | if (data->bootloader_mode) | 1038 | if (data->bootloader_mode) |
| 1059 | dev_warn(dev, "Device in bootloader mode.\n"); | 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 | data->irq_count = irq_count; | 1050 | data->irq_count = irq_count; |
| 1062 | data->num_of_irq_regs = (data->irq_count + 7) / 8; | 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) | |||
| 1080 | { | 1069 | { |
| 1081 | struct rmi_device *rmi_dev = data->rmi_dev; | 1070 | struct rmi_device *rmi_dev = data->rmi_dev; |
| 1082 | struct device *dev = &rmi_dev->dev; | 1071 | struct device *dev = &rmi_dev->dev; |
| 1083 | int irq_count; | 1072 | int irq_count = 0; |
| 1084 | int retval; | 1073 | int retval; |
| 1085 | 1074 | ||
| 1086 | irq_count = 0; | ||
| 1087 | rmi_dbg(RMI_DEBUG_CORE, dev, "%s: Creating functions.\n", __func__); | 1075 | rmi_dbg(RMI_DEBUG_CORE, dev, "%s: Creating functions.\n", __func__); |
| 1088 | retval = rmi_scan_pdt(rmi_dev, &irq_count, rmi_create_function); | 1076 | retval = rmi_scan_pdt(rmi_dev, &irq_count, rmi_create_function); |
| 1089 | if (retval < 0) { | 1077 | if (retval < 0) { |
diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c index 8a07ae147df6..4edaa14fe878 100644 --- a/drivers/input/rmi4/rmi_f01.c +++ b/drivers/input/rmi4/rmi_f01.c | |||
| @@ -681,9 +681,9 @@ static int rmi_f01_resume(struct rmi_function *fn) | |||
| 681 | return 0; | 681 | return 0; |
| 682 | } | 682 | } |
| 683 | 683 | ||
| 684 | static int rmi_f01_attention(struct rmi_function *fn, | 684 | static irqreturn_t rmi_f01_attention(int irq, void *ctx) |
| 685 | unsigned long *irq_bits) | ||
| 686 | { | 685 | { |
| 686 | struct rmi_function *fn = ctx; | ||
| 687 | struct rmi_device *rmi_dev = fn->rmi_dev; | 687 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 688 | int error; | 688 | int error; |
| 689 | u8 device_status; | 689 | u8 device_status; |
| @@ -692,7 +692,7 @@ static int rmi_f01_attention(struct rmi_function *fn, | |||
| 692 | if (error) { | 692 | if (error) { |
| 693 | dev_err(&fn->dev, | 693 | dev_err(&fn->dev, |
| 694 | "Failed to read device status: %d.\n", error); | 694 | "Failed to read device status: %d.\n", error); |
| 695 | return error; | 695 | return IRQ_RETVAL(error); |
| 696 | } | 696 | } |
| 697 | 697 | ||
| 698 | if (RMI_F01_STATUS_BOOTLOADER(device_status)) | 698 | if (RMI_F01_STATUS_BOOTLOADER(device_status)) |
| @@ -704,11 +704,11 @@ static int rmi_f01_attention(struct rmi_function *fn, | |||
| 704 | error = rmi_dev->driver->reset_handler(rmi_dev); | 704 | error = rmi_dev->driver->reset_handler(rmi_dev); |
| 705 | if (error) { | 705 | if (error) { |
| 706 | dev_err(&fn->dev, "Device reset failed: %d\n", error); | 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 | struct rmi_function_handler rmi_f01_handler = { | 714 | struct rmi_function_handler rmi_f01_handler = { |
diff --git a/drivers/input/rmi4/rmi_f03.c b/drivers/input/rmi4/rmi_f03.c index 88822196d6b7..aaa1edc95522 100644 --- a/drivers/input/rmi4/rmi_f03.c +++ b/drivers/input/rmi4/rmi_f03.c | |||
| @@ -244,8 +244,9 @@ static int rmi_f03_config(struct rmi_function *fn) | |||
| 244 | return 0; | 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 | struct rmi_device *rmi_dev = fn->rmi_dev; | 250 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 250 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); | 251 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); |
| 251 | struct f03_data *f03 = dev_get_drvdata(&fn->dev); | 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) | |||
| 262 | /* First grab the data passed by the transport device */ | 263 | /* First grab the data passed by the transport device */ |
| 263 | if (drvdata->attn_data.size < ob_len) { | 264 | if (drvdata->attn_data.size < ob_len) { |
| 264 | dev_warn(&fn->dev, "F03 interrupted, but data is missing!\n"); | 265 | dev_warn(&fn->dev, "F03 interrupted, but data is missing!\n"); |
| 265 | return 0; | 266 | return IRQ_HANDLED; |
| 266 | } | 267 | } |
| 267 | 268 | ||
| 268 | memcpy(obs, drvdata->attn_data.data, ob_len); | 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) | |||
| 277 | "%s: Failed to read F03 output buffers: %d\n", | 278 | "%s: Failed to read F03 output buffers: %d\n", |
| 278 | __func__, error); | 279 | __func__, error); |
| 279 | serio_interrupt(f03->serio, 0, SERIO_TIMEOUT); | 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) | |||
| 303 | serio_interrupt(f03->serio, ob_data, serio_flags); | 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 | static void rmi_f03_remove(struct rmi_function *fn) | 310 | static void rmi_f03_remove(struct rmi_function *fn) |
diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c index 12a233251793..df64d6aed4f7 100644 --- a/drivers/input/rmi4/rmi_f11.c +++ b/drivers/input/rmi4/rmi_f11.c | |||
| @@ -570,9 +570,7 @@ static inline u8 rmi_f11_parse_finger_state(const u8 *f_state, u8 n_finger) | |||
| 570 | } | 570 | } |
| 571 | 571 | ||
| 572 | static void rmi_f11_finger_handler(struct f11_data *f11, | 572 | static void rmi_f11_finger_handler(struct f11_data *f11, |
| 573 | struct rmi_2d_sensor *sensor, | 573 | struct rmi_2d_sensor *sensor, int size) |
| 574 | unsigned long *irq_bits, int num_irq_regs, | ||
| 575 | int size) | ||
| 576 | { | 574 | { |
| 577 | const u8 *f_state = f11->data.f_state; | 575 | const u8 *f_state = f11->data.f_state; |
| 578 | u8 finger_state; | 576 | u8 finger_state; |
| @@ -581,12 +579,7 @@ static void rmi_f11_finger_handler(struct f11_data *f11, | |||
| 581 | int rel_fingers; | 579 | int rel_fingers; |
| 582 | int abs_size = sensor->nbr_fingers * RMI_F11_ABS_BYTES; | 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, | 582 | if (sensor->report_abs) { |
| 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) { | ||
| 590 | if (abs_size > size) | 583 | if (abs_size > size) |
| 591 | abs_fingers = size / RMI_F11_ABS_BYTES; | 584 | abs_fingers = size / RMI_F11_ABS_BYTES; |
| 592 | else | 585 | else |
| @@ -604,19 +597,7 @@ static void rmi_f11_finger_handler(struct f11_data *f11, | |||
| 604 | rmi_f11_abs_pos_process(f11, sensor, &sensor->objs[i], | 597 | rmi_f11_abs_pos_process(f11, sensor, &sensor->objs[i], |
| 605 | finger_state, i); | 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 | * the absolute part is made in 2 parts to allow the kernel | 602 | * the absolute part is made in 2 parts to allow the kernel |
| 622 | * tracking to take place. | 603 | * tracking to take place. |
| @@ -638,7 +619,16 @@ static void rmi_f11_finger_handler(struct f11_data *f11, | |||
| 638 | } | 619 | } |
| 639 | 620 | ||
| 640 | input_mt_sync_frame(sensor->input); | 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 | static int f11_2d_construct_data(struct f11_data *f11) | 634 | static int f11_2d_construct_data(struct f11_data *f11) |
| @@ -1276,8 +1266,9 @@ static int rmi_f11_config(struct rmi_function *fn) | |||
| 1276 | return 0; | 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 | struct rmi_device *rmi_dev = fn->rmi_dev; | 1272 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 1282 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); | 1273 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); |
| 1283 | struct f11_data *f11 = dev_get_drvdata(&fn->dev); | 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) | |||
| 1303 | data_base_addr, f11->sensor.data_pkt, | 1294 | data_base_addr, f11->sensor.data_pkt, |
| 1304 | f11->sensor.pkt_size); | 1295 | f11->sensor.pkt_size); |
| 1305 | if (error < 0) | 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, | 1300 | rmi_f11_finger_handler(f11, &f11->sensor, valid_bytes); |
| 1310 | drvdata->num_of_irq_regs, valid_bytes); | ||
| 1311 | 1301 | ||
| 1312 | return 0; | 1302 | return IRQ_HANDLED; |
| 1313 | } | 1303 | } |
| 1314 | 1304 | ||
| 1315 | static int rmi_f11_resume(struct rmi_function *fn) | 1305 | static int rmi_f11_resume(struct rmi_function *fn) |
diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c index a3d1aa88f2a9..5c7f48915779 100644 --- a/drivers/input/rmi4/rmi_f12.c +++ b/drivers/input/rmi4/rmi_f12.c | |||
| @@ -197,10 +197,10 @@ static void rmi_f12_process_objects(struct f12_data *f12, u8 *data1, int size) | |||
| 197 | rmi_2d_sensor_abs_report(sensor, &sensor->objs[i], i); | 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, | 200 | static irqreturn_t rmi_f12_attention(int irq, void *ctx) |
| 201 | unsigned long *irq_nr_regs) | ||
| 202 | { | 201 | { |
| 203 | int retval; | 202 | int retval; |
| 203 | struct rmi_function *fn = ctx; | ||
| 204 | struct rmi_device *rmi_dev = fn->rmi_dev; | 204 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 205 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); | 205 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); |
| 206 | struct f12_data *f12 = dev_get_drvdata(&fn->dev); | 206 | struct f12_data *f12 = dev_get_drvdata(&fn->dev); |
| @@ -222,7 +222,7 @@ static int rmi_f12_attention(struct rmi_function *fn, | |||
| 222 | if (retval < 0) { | 222 | if (retval < 0) { |
| 223 | dev_err(&fn->dev, "Failed to read object data. Code: %d.\n", | 223 | dev_err(&fn->dev, "Failed to read object data. Code: %d.\n", |
| 224 | retval); | 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, | |||
| 232 | 232 | ||
| 233 | input_mt_sync_frame(sensor->input); | 233 | input_mt_sync_frame(sensor->input); |
| 234 | 234 | ||
| 235 | return 0; | 235 | return IRQ_HANDLED; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | static int rmi_f12_write_control_regs(struct rmi_function *fn) | 238 | static int rmi_f12_write_control_regs(struct rmi_function *fn) |
diff --git a/drivers/input/rmi4/rmi_f30.c b/drivers/input/rmi4/rmi_f30.c index 82e0f0d43d55..5e3ed5ac0c3e 100644 --- a/drivers/input/rmi4/rmi_f30.c +++ b/drivers/input/rmi4/rmi_f30.c | |||
| @@ -122,8 +122,9 @@ static void rmi_f30_report_button(struct rmi_function *fn, | |||
| 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 | struct f30_data *f30 = dev_get_drvdata(&fn->dev); | 128 | struct f30_data *f30 = dev_get_drvdata(&fn->dev); |
| 128 | struct rmi_driver_data *drvdata = dev_get_drvdata(&fn->rmi_dev->dev); | 129 | struct rmi_driver_data *drvdata = dev_get_drvdata(&fn->rmi_dev->dev); |
| 129 | int error; | 130 | int error; |
| @@ -134,7 +135,7 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) | |||
| 134 | if (drvdata->attn_data.size < f30->register_count) { | 135 | if (drvdata->attn_data.size < f30->register_count) { |
| 135 | dev_warn(&fn->dev, | 136 | dev_warn(&fn->dev, |
| 136 | "F30 interrupted, but data is missing\n"); | 137 | "F30 interrupted, but data is missing\n"); |
| 137 | return 0; | 138 | return IRQ_HANDLED; |
| 138 | } | 139 | } |
| 139 | memcpy(f30->data_regs, drvdata->attn_data.data, | 140 | memcpy(f30->data_regs, drvdata->attn_data.data, |
| 140 | f30->register_count); | 141 | f30->register_count); |
| @@ -147,7 +148,7 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) | |||
| 147 | dev_err(&fn->dev, | 148 | dev_err(&fn->dev, |
| 148 | "%s: Failed to read F30 data registers: %d\n", | 149 | "%s: Failed to read F30 data registers: %d\n", |
| 149 | __func__, error); | 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) | |||
| 159 | rmi_f03_commit_buttons(f30->f03); | 160 | rmi_f03_commit_buttons(f30->f03); |
| 160 | } | 161 | } |
| 161 | 162 | ||
| 162 | return 0; | 163 | return IRQ_HANDLED; |
| 163 | } | 164 | } |
| 164 | 165 | ||
| 165 | static int rmi_f30_config(struct rmi_function *fn) | 166 | static int rmi_f30_config(struct rmi_function *fn) |
diff --git a/drivers/input/rmi4/rmi_f34.c b/drivers/input/rmi4/rmi_f34.c index f1f5ac539d5d..87a7d4ba382d 100644 --- a/drivers/input/rmi4/rmi_f34.c +++ b/drivers/input/rmi4/rmi_f34.c | |||
| @@ -100,8 +100,9 @@ static int rmi_f34_command(struct f34_data *f34, u8 command, | |||
| 100 | return 0; | 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 | struct f34_data *f34 = dev_get_drvdata(&fn->dev); | 106 | struct f34_data *f34 = dev_get_drvdata(&fn->dev); |
| 106 | int ret; | 107 | int ret; |
| 107 | u8 status; | 108 | u8 status; |
| @@ -126,7 +127,7 @@ static int rmi_f34_attention(struct rmi_function *fn, unsigned long *irq_bits) | |||
| 126 | complete(&f34->v7.cmd_done); | 127 | complete(&f34->v7.cmd_done); |
| 127 | } | 128 | } |
| 128 | 129 | ||
| 129 | return 0; | 130 | return IRQ_HANDLED; |
| 130 | } | 131 | } |
| 131 | 132 | ||
| 132 | static int rmi_f34_write_blocks(struct f34_data *f34, const void *data, | 133 | static int rmi_f34_write_blocks(struct f34_data *f34, const void *data, |
diff --git a/drivers/input/rmi4/rmi_f54.c b/drivers/input/rmi4/rmi_f54.c index e8a59d164019..a6f515bcab22 100644 --- a/drivers/input/rmi4/rmi_f54.c +++ b/drivers/input/rmi4/rmi_f54.c | |||
| @@ -610,11 +610,6 @@ error: | |||
| 610 | mutex_unlock(&f54->data_mutex); | 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 | static int rmi_f54_config(struct rmi_function *fn) | 613 | static int rmi_f54_config(struct rmi_function *fn) |
| 619 | { | 614 | { |
| 620 | struct rmi_driver *drv = fn->rmi_dev->driver; | 615 | struct rmi_driver *drv = fn->rmi_dev->driver; |
| @@ -756,6 +751,5 @@ struct rmi_function_handler rmi_f54_handler = { | |||
| 756 | .func = 0x54, | 751 | .func = 0x54, |
| 757 | .probe = rmi_f54_probe, | 752 | .probe = rmi_f54_probe, |
| 758 | .config = rmi_f54_config, | 753 | .config = rmi_f54_config, |
| 759 | .attention = rmi_f54_attention, | ||
| 760 | .remove = rmi_f54_remove, | 754 | .remove = rmi_f54_remove, |
| 761 | }; | 755 | }; |
diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c index ff7043f74a3d..d196ac3d8b8c 100644 --- a/drivers/input/touchscreen/silead.c +++ b/drivers/input/touchscreen/silead.c | |||
| @@ -603,6 +603,7 @@ static const struct acpi_device_id silead_ts_acpi_match[] = { | |||
| 603 | { "GSL3692", 0 }, | 603 | { "GSL3692", 0 }, |
| 604 | { "MSSL1680", 0 }, | 604 | { "MSSL1680", 0 }, |
| 605 | { "MSSL0001", 0 }, | 605 | { "MSSL0001", 0 }, |
| 606 | { "MSSL0002", 0 }, | ||
| 606 | { } | 607 | { } |
| 607 | }; | 608 | }; |
| 608 | MODULE_DEVICE_TABLE(acpi, silead_ts_acpi_match); | 609 | MODULE_DEVICE_TABLE(acpi, silead_ts_acpi_match); |
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index e055d228bfb9..689ffe538370 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig | |||
| @@ -142,7 +142,6 @@ config DMAR_TABLE | |||
| 142 | config INTEL_IOMMU | 142 | config INTEL_IOMMU |
| 143 | bool "Support for Intel IOMMU using DMA Remapping Devices" | 143 | bool "Support for Intel IOMMU using DMA Remapping Devices" |
| 144 | depends on PCI_MSI && ACPI && (X86 || IA64_GENERIC) | 144 | depends on PCI_MSI && ACPI && (X86 || IA64_GENERIC) |
| 145 | select DMA_DIRECT_OPS | ||
| 146 | select IOMMU_API | 145 | select IOMMU_API |
| 147 | select IOMMU_IOVA | 146 | select IOMMU_IOVA |
| 148 | select NEED_DMA_MAP_STATE | 147 | select NEED_DMA_MAP_STATE |
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 14e4b3722428..b344a883f116 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
| @@ -31,7 +31,6 @@ | |||
| 31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
| 32 | #include <linux/dmar.h> | 32 | #include <linux/dmar.h> |
| 33 | #include <linux/dma-mapping.h> | 33 | #include <linux/dma-mapping.h> |
| 34 | #include <linux/dma-direct.h> | ||
| 35 | #include <linux/mempool.h> | 34 | #include <linux/mempool.h> |
| 36 | #include <linux/memory.h> | 35 | #include <linux/memory.h> |
| 37 | #include <linux/cpu.h> | 36 | #include <linux/cpu.h> |
| @@ -3713,30 +3712,61 @@ static void *intel_alloc_coherent(struct device *dev, size_t size, | |||
| 3713 | dma_addr_t *dma_handle, gfp_t flags, | 3712 | dma_addr_t *dma_handle, gfp_t flags, |
| 3714 | unsigned long attrs) | 3713 | unsigned long attrs) |
| 3715 | { | 3714 | { |
| 3716 | void *vaddr; | 3715 | struct page *page = NULL; |
| 3716 | int order; | ||
| 3717 | 3717 | ||
| 3718 | vaddr = dma_direct_alloc(dev, size, dma_handle, flags, attrs); | 3718 | size = PAGE_ALIGN(size); |
| 3719 | if (iommu_no_mapping(dev) || !vaddr) | 3719 | order = get_order(size); |
| 3720 | return vaddr; | ||
| 3721 | 3720 | ||
| 3722 | *dma_handle = __intel_map_single(dev, virt_to_phys(vaddr), | 3721 | if (!iommu_no_mapping(dev)) |
| 3723 | PAGE_ALIGN(size), DMA_BIDIRECTIONAL, | 3722 | flags &= ~(GFP_DMA | GFP_DMA32); |
| 3724 | dev->coherent_dma_mask); | 3723 | else if (dev->coherent_dma_mask < dma_get_required_mask(dev)) { |
| 3725 | if (!*dma_handle) | 3724 | if (dev->coherent_dma_mask < DMA_BIT_MASK(32)) |
| 3726 | goto out_free_pages; | 3725 | flags |= GFP_DMA; |
| 3727 | return vaddr; | 3726 | else |
| 3727 | flags |= GFP_DMA32; | ||
| 3728 | } | ||
| 3729 | |||
| 3730 | if (gfpflags_allow_blocking(flags)) { | ||
| 3731 | unsigned int count = size >> PAGE_SHIFT; | ||
| 3732 | |||
| 3733 | page = dma_alloc_from_contiguous(dev, count, order, flags); | ||
| 3734 | if (page && iommu_no_mapping(dev) && | ||
| 3735 | page_to_phys(page) + size > dev->coherent_dma_mask) { | ||
| 3736 | dma_release_from_contiguous(dev, page, count); | ||
| 3737 | page = NULL; | ||
| 3738 | } | ||
| 3739 | } | ||
| 3740 | |||
| 3741 | if (!page) | ||
| 3742 | page = alloc_pages(flags, order); | ||
| 3743 | if (!page) | ||
| 3744 | return NULL; | ||
| 3745 | memset(page_address(page), 0, size); | ||
| 3746 | |||
| 3747 | *dma_handle = __intel_map_single(dev, page_to_phys(page), size, | ||
| 3748 | DMA_BIDIRECTIONAL, | ||
| 3749 | dev->coherent_dma_mask); | ||
| 3750 | if (*dma_handle) | ||
| 3751 | return page_address(page); | ||
| 3752 | if (!dma_release_from_contiguous(dev, page, size >> PAGE_SHIFT)) | ||
| 3753 | __free_pages(page, order); | ||
| 3728 | 3754 | ||
| 3729 | out_free_pages: | ||
| 3730 | dma_direct_free(dev, size, vaddr, *dma_handle, attrs); | ||
| 3731 | return NULL; | 3755 | return NULL; |
| 3732 | } | 3756 | } |
| 3733 | 3757 | ||
| 3734 | static void intel_free_coherent(struct device *dev, size_t size, void *vaddr, | 3758 | static void intel_free_coherent(struct device *dev, size_t size, void *vaddr, |
| 3735 | dma_addr_t dma_handle, unsigned long attrs) | 3759 | dma_addr_t dma_handle, unsigned long attrs) |
| 3736 | { | 3760 | { |
| 3737 | if (!iommu_no_mapping(dev)) | 3761 | int order; |
| 3738 | intel_unmap(dev, dma_handle, PAGE_ALIGN(size)); | 3762 | struct page *page = virt_to_page(vaddr); |
| 3739 | dma_direct_free(dev, size, vaddr, dma_handle, attrs); | 3763 | |
| 3764 | size = PAGE_ALIGN(size); | ||
| 3765 | order = get_order(size); | ||
| 3766 | |||
| 3767 | intel_unmap(dev, dma_handle, size); | ||
| 3768 | if (!dma_release_from_contiguous(dev, page, size >> PAGE_SHIFT)) | ||
| 3769 | __free_pages(page, order); | ||
| 3740 | } | 3770 | } |
| 3741 | 3771 | ||
| 3742 | static void intel_unmap_sg(struct device *dev, struct scatterlist *sglist, | 3772 | static void intel_unmap_sg(struct device *dev, struct scatterlist *sglist, |
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c index 98f90aadd141..18c0a1281914 100644 --- a/drivers/isdn/mISDN/socket.c +++ b/drivers/isdn/mISDN/socket.c | |||
| @@ -588,7 +588,7 @@ static const struct proto_ops data_sock_ops = { | |||
| 588 | .getname = data_sock_getname, | 588 | .getname = data_sock_getname, |
| 589 | .sendmsg = mISDN_sock_sendmsg, | 589 | .sendmsg = mISDN_sock_sendmsg, |
| 590 | .recvmsg = mISDN_sock_recvmsg, | 590 | .recvmsg = mISDN_sock_recvmsg, |
| 591 | .poll_mask = datagram_poll_mask, | 591 | .poll = datagram_poll, |
| 592 | .listen = sock_no_listen, | 592 | .listen = sock_no_listen, |
| 593 | .shutdown = sock_no_shutdown, | 593 | .shutdown = sock_no_shutdown, |
| 594 | .setsockopt = data_sock_setsockopt, | 594 | .setsockopt = data_sock_setsockopt, |
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index ab13fcec3fca..75df4c9d8b54 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c | |||
| @@ -588,7 +588,7 @@ static const char *raid10_md_layout_to_format(int layout) | |||
| 588 | } | 588 | } |
| 589 | 589 | ||
| 590 | /* Return md raid10 algorithm for @name */ | 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 | if (!strcasecmp(name, "near")) | 593 | if (!strcasecmp(name, "near")) |
| 594 | return ALGORITHM_RAID10_NEAR; | 594 | return ALGORITHM_RAID10_NEAR; |
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 938766794c2e..3d0e2c198f06 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
| @@ -885,9 +885,7 @@ EXPORT_SYMBOL_GPL(dm_table_set_type); | |||
| 885 | static int device_supports_dax(struct dm_target *ti, struct dm_dev *dev, | 885 | static int device_supports_dax(struct dm_target *ti, struct dm_dev *dev, |
| 886 | sector_t start, sector_t len, void *data) | 886 | sector_t start, sector_t len, void *data) |
| 887 | { | 887 | { |
| 888 | struct request_queue *q = bdev_get_queue(dev->bdev); | 888 | return bdev_dax_supported(dev->bdev, PAGE_SIZE); |
| 889 | |||
| 890 | return q && blk_queue_dax(q); | ||
| 891 | } | 889 | } |
| 892 | 890 | ||
| 893 | static bool dm_table_supports_dax(struct dm_table *t) | 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, | |||
| 1907 | 1905 | ||
| 1908 | if (dm_table_supports_dax(t)) | 1906 | if (dm_table_supports_dax(t)) |
| 1909 | blk_queue_flag_set(QUEUE_FLAG_DAX, q); | 1907 | blk_queue_flag_set(QUEUE_FLAG_DAX, q); |
| 1908 | else | ||
| 1909 | blk_queue_flag_clear(QUEUE_FLAG_DAX, q); | ||
| 1910 | |||
| 1910 | if (dm_table_supports_dax_write_cache(t)) | 1911 | if (dm_table_supports_dax_write_cache(t)) |
| 1911 | dax_write_cache(t->md->dax_dev, true); | 1912 | dax_write_cache(t->md->dax_dev, true); |
| 1912 | 1913 | ||
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index 36ef284ad086..72142021b5c9 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c | |||
| @@ -776,7 +776,6 @@ static int __write_changed_details(struct dm_pool_metadata *pmd) | |||
| 776 | static int __commit_transaction(struct dm_pool_metadata *pmd) | 776 | static int __commit_transaction(struct dm_pool_metadata *pmd) |
| 777 | { | 777 | { |
| 778 | int r; | 778 | int r; |
| 779 | size_t metadata_len, data_len; | ||
| 780 | struct thin_disk_superblock *disk_super; | 779 | struct thin_disk_superblock *disk_super; |
| 781 | struct dm_block *sblock; | 780 | struct dm_block *sblock; |
| 782 | 781 | ||
| @@ -797,14 +796,6 @@ static int __commit_transaction(struct dm_pool_metadata *pmd) | |||
| 797 | if (r < 0) | 796 | if (r < 0) |
| 798 | return r; | 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 | r = save_sm_roots(pmd); | 799 | r = save_sm_roots(pmd); |
| 809 | if (r < 0) | 800 | if (r < 0) |
| 810 | return r; | 801 | return r; |
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 7945238df1c0..b900723bbd0f 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
| @@ -1386,6 +1386,8 @@ static void schedule_external_copy(struct thin_c *tc, dm_block_t virt_block, | |||
| 1386 | 1386 | ||
| 1387 | static void set_pool_mode(struct pool *pool, enum pool_mode new_mode); | 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 | static void check_for_space(struct pool *pool) | 1391 | static void check_for_space(struct pool *pool) |
| 1390 | { | 1392 | { |
| 1391 | int r; | 1393 | int r; |
| @@ -1398,8 +1400,10 @@ static void check_for_space(struct pool *pool) | |||
| 1398 | if (r) | 1400 | if (r) |
| 1399 | return; | 1401 | return; |
| 1400 | 1402 | ||
| 1401 | if (nr_free) | 1403 | if (nr_free) { |
| 1402 | set_pool_mode(pool, PM_WRITE); | 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) | |||
| 1476 | 1480 | ||
| 1477 | r = dm_pool_alloc_data_block(pool->pmd, result); | 1481 | r = dm_pool_alloc_data_block(pool->pmd, result); |
| 1478 | if (r) { | 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 | return r; | 1487 | return r; |
| 1481 | } | 1488 | } |
| 1482 | 1489 | ||
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 5961c7794ef3..07ea6a48aac6 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c | |||
| @@ -259,7 +259,7 @@ static int persistent_memory_claim(struct dm_writecache *wc) | |||
| 259 | if (da != p) { | 259 | if (da != p) { |
| 260 | long i; | 260 | long i; |
| 261 | wc->memory_map = NULL; | 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 | if (!pages) { | 263 | if (!pages) { |
| 264 | r = -ENOMEM; | 264 | r = -ENOMEM; |
| 265 | goto err2; | 265 | goto err2; |
| @@ -859,7 +859,7 @@ static int writecache_alloc_entries(struct dm_writecache *wc) | |||
| 859 | 859 | ||
| 860 | if (wc->entries) | 860 | if (wc->entries) |
| 861 | return 0; | 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 | if (!wc->entries) | 863 | if (!wc->entries) |
| 864 | return -ENOMEM; | 864 | return -ENOMEM; |
| 865 | for (b = 0; b < wc->n_blocks; b++) { | 865 | for (b = 0; b < wc->n_blocks; b++) { |
| @@ -1481,9 +1481,9 @@ static void __writecache_writeback_pmem(struct dm_writecache *wc, struct writeba | |||
| 1481 | wb->bio.bi_iter.bi_sector = read_original_sector(wc, e); | 1481 | wb->bio.bi_iter.bi_sector = read_original_sector(wc, e); |
| 1482 | wb->page_offset = PAGE_SIZE; | 1482 | wb->page_offset = PAGE_SIZE; |
| 1483 | if (max_pages <= WB_LIST_INLINE || | 1483 | if (max_pages <= WB_LIST_INLINE || |
| 1484 | unlikely(!(wb->wc_list = kmalloc(max_pages * sizeof(struct wc_entry *), | 1484 | unlikely(!(wb->wc_list = kmalloc_array(max_pages, sizeof(struct wc_entry *), |
| 1485 | GFP_NOIO | __GFP_NORETRY | | 1485 | GFP_NOIO | __GFP_NORETRY | |
| 1486 | __GFP_NOMEMALLOC | __GFP_NOWARN)))) { | 1486 | __GFP_NOMEMALLOC | __GFP_NOWARN)))) { |
| 1487 | wb->wc_list = wb->wc_list_inline; | 1487 | wb->wc_list = wb->wc_list_inline; |
| 1488 | max_pages = WB_LIST_INLINE; | 1488 | max_pages = WB_LIST_INLINE; |
| 1489 | } | 1489 | } |
diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c index 3c0e45f4dcf5..a44183ff4be0 100644 --- a/drivers/md/dm-zoned-target.c +++ b/drivers/md/dm-zoned-target.c | |||
| @@ -787,7 +787,7 @@ static int dmz_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
| 787 | 787 | ||
| 788 | /* Chunk BIO work */ | 788 | /* Chunk BIO work */ |
| 789 | mutex_init(&dmz->chunk_lock); | 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 | dmz->chunk_wq = alloc_workqueue("dmz_cwq_%s", WQ_MEM_RECLAIM | WQ_UNBOUND, | 791 | dmz->chunk_wq = alloc_workqueue("dmz_cwq_%s", WQ_MEM_RECLAIM | WQ_UNBOUND, |
| 792 | 0, dev->name); | 792 | 0, dev->name); |
| 793 | if (!dmz->chunk_wq) { | 793 | if (!dmz->chunk_wq) { |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index e65429a29c06..b0dd7027848b 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
| @@ -1056,8 +1056,7 @@ static long dm_dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, | |||
| 1056 | if (len < 1) | 1056 | if (len < 1) |
| 1057 | goto out; | 1057 | goto out; |
| 1058 | nr_pages = min(len, nr_pages); | 1058 | nr_pages = min(len, nr_pages); |
| 1059 | if (ti->type->direct_access) | 1059 | ret = ti->type->direct_access(ti, pgoff, nr_pages, kaddr, pfn); |
| 1060 | ret = ti->type->direct_access(ti, pgoff, nr_pages, kaddr, pfn); | ||
| 1061 | 1060 | ||
| 1062 | out: | 1061 | out: |
| 1063 | dm_put_live_table(md, srcu_idx); | 1062 | dm_put_live_table(md, srcu_idx); |
| @@ -1606,10 +1605,9 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, | |||
| 1606 | * the usage of io->orig_bio in dm_remap_zone_report() | 1605 | * the usage of io->orig_bio in dm_remap_zone_report() |
| 1607 | * won't be affected by this reassignment. | 1606 | * won't be affected by this reassignment. |
| 1608 | */ | 1607 | */ |
| 1609 | struct bio *b = bio_clone_bioset(bio, GFP_NOIO, | 1608 | struct bio *b = bio_split(bio, bio_sectors(bio) - ci.sector_count, |
| 1610 | &md->queue->bio_split); | 1609 | GFP_NOIO, &md->queue->bio_split); |
| 1611 | ci.io->orig_bio = b; | 1610 | ci.io->orig_bio = b; |
| 1612 | bio_advance(bio, (bio_sectors(bio) - ci.sector_count) << 9); | ||
| 1613 | bio_chain(b, bio); | 1611 | bio_chain(b, bio); |
| 1614 | ret = generic_make_request(bio); | 1612 | ret = generic_make_request(bio); |
| 1615 | break; | 1613 | break; |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 29b0cd9ec951..994aed2f9dff 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
| @@ -5547,7 +5547,8 @@ int md_run(struct mddev *mddev) | |||
| 5547 | else | 5547 | else |
| 5548 | pr_warn("md: personality for level %s is not loaded!\n", | 5548 | pr_warn("md: personality for level %s is not loaded!\n", |
| 5549 | mddev->clevel); | 5549 | mddev->clevel); |
| 5550 | return -EINVAL; | 5550 | err = -EINVAL; |
| 5551 | goto abort; | ||
| 5551 | } | 5552 | } |
| 5552 | spin_unlock(&pers_lock); | 5553 | spin_unlock(&pers_lock); |
| 5553 | if (mddev->level != pers->level) { | 5554 | if (mddev->level != pers->level) { |
| @@ -5560,7 +5561,8 @@ int md_run(struct mddev *mddev) | |||
| 5560 | pers->start_reshape == NULL) { | 5561 | pers->start_reshape == NULL) { |
| 5561 | /* This personality cannot handle reshaping... */ | 5562 | /* This personality cannot handle reshaping... */ |
| 5562 | module_put(pers->owner); | 5563 | module_put(pers->owner); |
| 5563 | return -EINVAL; | 5564 | err = -EINVAL; |
| 5565 | goto abort; | ||
| 5564 | } | 5566 | } |
| 5565 | 5567 | ||
| 5566 | if (pers->sync_request) { | 5568 | if (pers->sync_request) { |
| @@ -5629,7 +5631,7 @@ int md_run(struct mddev *mddev) | |||
| 5629 | mddev->private = NULL; | 5631 | mddev->private = NULL; |
| 5630 | module_put(pers->owner); | 5632 | module_put(pers->owner); |
| 5631 | bitmap_destroy(mddev); | 5633 | bitmap_destroy(mddev); |
| 5632 | return err; | 5634 | goto abort; |
| 5633 | } | 5635 | } |
| 5634 | if (mddev->queue) { | 5636 | if (mddev->queue) { |
| 5635 | bool nonrot = true; | 5637 | bool nonrot = true; |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 478cf446827f..35bd3a62451b 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
| @@ -3893,6 +3893,13 @@ static int raid10_run(struct mddev *mddev) | |||
| 3893 | disk->rdev->saved_raid_disk < 0) | 3893 | disk->rdev->saved_raid_disk < 0) |
| 3894 | conf->fullsync = 1; | 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 | disk->recovery_disabled = mddev->recovery_disabled - 1; | 3903 | disk->recovery_disabled = mddev->recovery_disabled - 1; |
| 3897 | } | 3904 | } |
| 3898 | 3905 | ||
diff --git a/drivers/media/rc/bpf-lirc.c b/drivers/media/rc/bpf-lirc.c index 40826bba06b6..fcfab6635f9c 100644 --- a/drivers/media/rc/bpf-lirc.c +++ b/drivers/media/rc/bpf-lirc.c | |||
| @@ -207,29 +207,19 @@ void lirc_bpf_free(struct rc_dev *rcdev) | |||
| 207 | bpf_prog_array_free(rcdev->raw->progs); | 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 | struct rc_dev *rcdev; | 212 | struct rc_dev *rcdev; |
| 214 | int ret; | 213 | int ret; |
| 215 | 214 | ||
| 216 | if (attr->attach_flags) | 215 | if (attr->attach_flags) |
| 217 | return -EINVAL; | 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 | rcdev = rc_dev_get_from_fd(attr->target_fd); | 218 | rcdev = rc_dev_get_from_fd(attr->target_fd); |
| 225 | if (IS_ERR(rcdev)) { | 219 | if (IS_ERR(rcdev)) |
| 226 | bpf_prog_put(prog); | ||
| 227 | return PTR_ERR(rcdev); | 220 | return PTR_ERR(rcdev); |
| 228 | } | ||
| 229 | 221 | ||
| 230 | ret = lirc_bpf_attach(rcdev, prog); | 222 | ret = lirc_bpf_attach(rcdev, prog); |
| 231 | if (ret) | ||
| 232 | bpf_prog_put(prog); | ||
| 233 | 223 | ||
| 234 | put_device(&rcdev->dev); | 224 | put_device(&rcdev->dev); |
| 235 | 225 | ||
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index e05c3245930a..fa840666bdd1 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c | |||
| @@ -507,35 +507,14 @@ static int remote_settings_file_close(struct inode *inode, struct file *file) | |||
| 507 | static ssize_t remote_settings_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset) | 507 | static ssize_t remote_settings_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset) |
| 508 | { | 508 | { |
| 509 | void __iomem *address = (void __iomem *)file->private_data; | 509 | void __iomem *address = (void __iomem *)file->private_data; |
| 510 | unsigned char *page; | ||
| 511 | int retval; | ||
| 512 | int len = 0; | 510 | int len = 0; |
| 513 | unsigned int value; | 511 | unsigned int value; |
| 514 | 512 | char lbuf[20]; | |
| 515 | if (*offset < 0) | ||
| 516 | return -EINVAL; | ||
| 517 | if (count == 0 || count > 1024) | ||
| 518 | return 0; | ||
| 519 | if (*offset != 0) | ||
| 520 | return 0; | ||
| 521 | |||
| 522 | page = (unsigned char *)__get_free_page(GFP_KERNEL); | ||
| 523 | if (!page) | ||
| 524 | return -ENOMEM; | ||
| 525 | 513 | ||
| 526 | value = readl(address); | 514 | value = readl(address); |
| 527 | len = sprintf(page, "%d\n", value); | 515 | len = snprintf(lbuf, sizeof(lbuf), "%d\n", value); |
| 528 | |||
| 529 | if (copy_to_user(buf, page, len)) { | ||
| 530 | retval = -EFAULT; | ||
| 531 | goto exit; | ||
| 532 | } | ||
| 533 | *offset += len; | ||
| 534 | retval = len; | ||
| 535 | 516 | ||
| 536 | exit: | 517 | return simple_read_from_buffer(buf, count, offset, lbuf, len); |
| 537 | free_page((unsigned long)page); | ||
| 538 | return retval; | ||
| 539 | } | 518 | } |
| 540 | 519 | ||
| 541 | static ssize_t remote_settings_file_write(struct file *file, const char __user *ubuff, size_t count, loff_t *offset) | 520 | static ssize_t remote_settings_file_write(struct file *file, const char __user *ubuff, size_t count, loff_t *offset) |
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index b0b8f18a85e3..6649f0d56d2f 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c | |||
| @@ -310,8 +310,11 @@ int mei_irq_read_handler(struct mei_device *dev, | |||
| 310 | if (&cl->link == &dev->file_list) { | 310 | if (&cl->link == &dev->file_list) { |
| 311 | /* A message for not connected fixed address clients | 311 | /* A message for not connected fixed address clients |
| 312 | * should be silently discarded | 312 | * should be silently discarded |
| 313 | * On power down client may be force cleaned, | ||
| 314 | * silently discard such messages | ||
| 313 | */ | 315 | */ |
| 314 | if (hdr_is_fixed(mei_hdr)) { | 316 | if (hdr_is_fixed(mei_hdr) || |
| 317 | dev->dev_state == MEI_DEV_POWER_DOWN) { | ||
| 315 | mei_irq_discard_msg(dev, mei_hdr); | 318 | mei_irq_discard_msg(dev, mei_hdr); |
| 316 | ret = 0; | 319 | ret = 0; |
| 317 | goto reset_slots; | 320 | goto reset_slots; |
diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index efd733472a35..56c6f79a5c5a 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c | |||
| @@ -467,7 +467,7 @@ static int vmballoon_send_batched_lock(struct vmballoon *b, | |||
| 467 | unsigned int num_pages, bool is_2m_pages, unsigned int *target) | 467 | unsigned int num_pages, bool is_2m_pages, unsigned int *target) |
| 468 | { | 468 | { |
| 469 | unsigned long status; | 469 | unsigned long status; |
| 470 | unsigned long pfn = page_to_pfn(b->page); | 470 | unsigned long pfn = PHYS_PFN(virt_to_phys(b->batch_page)); |
| 471 | 471 | ||
| 472 | STATS_INC(b->stats.lock[is_2m_pages]); | 472 | STATS_INC(b->stats.lock[is_2m_pages]); |
| 473 | 473 | ||
| @@ -515,7 +515,7 @@ static bool vmballoon_send_batched_unlock(struct vmballoon *b, | |||
| 515 | unsigned int num_pages, bool is_2m_pages, unsigned int *target) | 515 | unsigned int num_pages, bool is_2m_pages, unsigned int *target) |
| 516 | { | 516 | { |
| 517 | unsigned long status; | 517 | unsigned long status; |
| 518 | unsigned long pfn = page_to_pfn(b->page); | 518 | unsigned long pfn = PHYS_PFN(virt_to_phys(b->batch_page)); |
| 519 | 519 | ||
| 520 | STATS_INC(b->stats.unlock[is_2m_pages]); | 520 | STATS_INC(b->stats.unlock[is_2m_pages]); |
| 521 | 521 | ||
diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index ef05e0039378..2a833686784b 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c | |||
| @@ -27,8 +27,8 @@ struct mmc_gpio { | |||
| 27 | bool override_cd_active_level; | 27 | bool override_cd_active_level; |
| 28 | irqreturn_t (*cd_gpio_isr)(int irq, void *dev_id); | 28 | irqreturn_t (*cd_gpio_isr)(int irq, void *dev_id); |
| 29 | char *ro_label; | 29 | char *ro_label; |
| 30 | char cd_label[0]; | ||
| 31 | u32 cd_debounce_delay_ms; | 30 | u32 cd_debounce_delay_ms; |
| 31 | char cd_label[]; | ||
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| 34 | static irqreturn_t mmc_gpio_cd_irqt(int irq, void *dev_id) | 34 | static irqreturn_t mmc_gpio_cd_irqt(int irq, void *dev_id) |
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 623f4d27fa01..80dc2fd6576c 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
| @@ -1065,8 +1065,8 @@ static void dw_mci_ctrl_thld(struct dw_mci *host, struct mmc_data *data) | |||
| 1065 | * It's used when HS400 mode is enabled. | 1065 | * It's used when HS400 mode is enabled. |
| 1066 | */ | 1066 | */ |
| 1067 | if (data->flags & MMC_DATA_WRITE && | 1067 | if (data->flags & MMC_DATA_WRITE && |
| 1068 | !(host->timing != MMC_TIMING_MMC_HS400)) | 1068 | host->timing != MMC_TIMING_MMC_HS400) |
| 1069 | return; | 1069 | goto disable; |
| 1070 | 1070 | ||
| 1071 | if (data->flags & MMC_DATA_WRITE) | 1071 | if (data->flags & MMC_DATA_WRITE) |
| 1072 | enable = SDMMC_CARD_WR_THR_EN; | 1072 | enable = SDMMC_CARD_WR_THR_EN; |
| @@ -1074,7 +1074,8 @@ static void dw_mci_ctrl_thld(struct dw_mci *host, struct mmc_data *data) | |||
| 1074 | enable = SDMMC_CARD_RD_THR_EN; | 1074 | enable = SDMMC_CARD_RD_THR_EN; |
| 1075 | 1075 | ||
| 1076 | if (host->timing != MMC_TIMING_MMC_HS200 && | 1076 | if (host->timing != MMC_TIMING_MMC_HS200 && |
| 1077 | host->timing != MMC_TIMING_UHS_SDR104) | 1077 | host->timing != MMC_TIMING_UHS_SDR104 && |
| 1078 | host->timing != MMC_TIMING_MMC_HS400) | ||
| 1078 | goto disable; | 1079 | goto disable; |
| 1079 | 1080 | ||
| 1080 | blksz_depth = blksz / (1 << host->data_shift); | 1081 | blksz_depth = blksz / (1 << host->data_shift); |
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c index f7f9773d161f..d032bd63444d 100644 --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c | |||
| @@ -139,8 +139,7 @@ renesas_sdhi_internal_dmac_abort_dma(struct tmio_mmc_host *host) { | |||
| 139 | renesas_sdhi_internal_dmac_dm_write(host, DM_CM_RST, | 139 | renesas_sdhi_internal_dmac_dm_write(host, DM_CM_RST, |
| 140 | RST_RESERVED_BITS | val); | 140 | RST_RESERVED_BITS | val); |
| 141 | 141 | ||
| 142 | if (host->data && host->data->flags & MMC_DATA_READ) | 142 | clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags); |
| 143 | clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags); | ||
| 144 | 143 | ||
| 145 | renesas_sdhi_internal_dmac_enable_dma(host, true); | 144 | renesas_sdhi_internal_dmac_enable_dma(host, true); |
| 146 | } | 145 | } |
| @@ -164,17 +163,14 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host, | |||
| 164 | goto force_pio; | 163 | goto force_pio; |
| 165 | 164 | ||
| 166 | /* This DMAC cannot handle if buffer is not 8-bytes alignment */ | 165 | /* This DMAC cannot handle if buffer is not 8-bytes alignment */ |
| 167 | if (!IS_ALIGNED(sg_dma_address(sg), 8)) { | 166 | if (!IS_ALIGNED(sg_dma_address(sg), 8)) |
| 168 | dma_unmap_sg(&host->pdev->dev, sg, host->sg_len, | 167 | goto force_pio_with_unmap; |
| 169 | mmc_get_dma_dir(data)); | ||
| 170 | goto force_pio; | ||
| 171 | } | ||
| 172 | 168 | ||
| 173 | if (data->flags & MMC_DATA_READ) { | 169 | if (data->flags & MMC_DATA_READ) { |
| 174 | dtran_mode |= DTRAN_MODE_CH_NUM_CH1; | 170 | dtran_mode |= DTRAN_MODE_CH_NUM_CH1; |
| 175 | if (test_bit(SDHI_INTERNAL_DMAC_ONE_RX_ONLY, &global_flags) && | 171 | if (test_bit(SDHI_INTERNAL_DMAC_ONE_RX_ONLY, &global_flags) && |
| 176 | test_and_set_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags)) | 172 | test_and_set_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags)) |
| 177 | goto force_pio; | 173 | goto force_pio_with_unmap; |
| 178 | } else { | 174 | } else { |
| 179 | dtran_mode |= DTRAN_MODE_CH_NUM_CH0; | 175 | dtran_mode |= DTRAN_MODE_CH_NUM_CH0; |
| 180 | } | 176 | } |
| @@ -189,6 +185,9 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host, | |||
| 189 | 185 | ||
| 190 | return; | 186 | return; |
| 191 | 187 | ||
| 188 | force_pio_with_unmap: | ||
| 189 | dma_unmap_sg(&host->pdev->dev, sg, host->sg_len, mmc_get_dma_dir(data)); | ||
| 190 | |||
| 192 | force_pio: | 191 | force_pio: |
| 193 | host->force_pio = true; | 192 | host->force_pio = true; |
| 194 | renesas_sdhi_internal_dmac_enable_dma(host, false); | 193 | renesas_sdhi_internal_dmac_enable_dma(host, false); |
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index d6aef70d34fa..4eb3d29ecde1 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c | |||
| @@ -312,6 +312,15 @@ static u32 esdhc_readl_le(struct sdhci_host *host, int reg) | |||
| 312 | 312 | ||
| 313 | if (imx_data->socdata->flags & ESDHC_FLAG_HS400) | 313 | if (imx_data->socdata->flags & ESDHC_FLAG_HS400) |
| 314 | val |= SDHCI_SUPPORT_HS400; | 314 | val |= SDHCI_SUPPORT_HS400; |
| 315 | |||
| 316 | /* | ||
| 317 | * Do not advertise faster UHS modes if there are no | ||
| 318 | * pinctrl states for 100MHz/200MHz. | ||
| 319 | */ | ||
| 320 | if (IS_ERR_OR_NULL(imx_data->pins_100mhz) || | ||
| 321 | IS_ERR_OR_NULL(imx_data->pins_200mhz)) | ||
| 322 | val &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50 | ||
| 323 | | SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_HS400); | ||
| 315 | } | 324 | } |
| 316 | } | 325 | } |
| 317 | 326 | ||
| @@ -1158,18 +1167,6 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, | |||
| 1158 | ESDHC_PINCTRL_STATE_100MHZ); | 1167 | ESDHC_PINCTRL_STATE_100MHZ); |
| 1159 | imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl, | 1168 | imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl, |
| 1160 | ESDHC_PINCTRL_STATE_200MHZ); | 1169 | ESDHC_PINCTRL_STATE_200MHZ); |
| 1161 | if (IS_ERR(imx_data->pins_100mhz) || | ||
| 1162 | IS_ERR(imx_data->pins_200mhz)) { | ||
| 1163 | dev_warn(mmc_dev(host->mmc), | ||
| 1164 | "could not get ultra high speed state, work on normal mode\n"); | ||
| 1165 | /* | ||
| 1166 | * fall back to not supporting uhs by specifying no | ||
| 1167 | * 1.8v quirk | ||
| 1168 | */ | ||
| 1169 | host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; | ||
| 1170 | } | ||
| 1171 | } else { | ||
| 1172 | host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; | ||
| 1173 | } | 1170 | } |
| 1174 | 1171 | ||
| 1175 | /* call to generic mmc_of_parse to support additional capabilities */ | 1172 | /* call to generic mmc_of_parse to support additional capabilities */ |
diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index e7472590f2ed..8e7f3e35ee3d 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c | |||
| @@ -1446,6 +1446,7 @@ static int sunxi_mmc_runtime_resume(struct device *dev) | |||
| 1446 | sunxi_mmc_init_host(host); | 1446 | sunxi_mmc_init_host(host); |
| 1447 | sunxi_mmc_set_bus_width(host, mmc->ios.bus_width); | 1447 | sunxi_mmc_set_bus_width(host, mmc->ios.bus_width); |
| 1448 | sunxi_mmc_set_clk(host, &mmc->ios); | 1448 | sunxi_mmc_set_clk(host, &mmc->ios); |
| 1449 | enable_irq(host->irq); | ||
| 1449 | 1450 | ||
| 1450 | return 0; | 1451 | return 0; |
| 1451 | } | 1452 | } |
| @@ -1455,6 +1456,12 @@ static int sunxi_mmc_runtime_suspend(struct device *dev) | |||
| 1455 | struct mmc_host *mmc = dev_get_drvdata(dev); | 1456 | struct mmc_host *mmc = dev_get_drvdata(dev); |
| 1456 | struct sunxi_mmc_host *host = mmc_priv(mmc); | 1457 | struct sunxi_mmc_host *host = mmc_priv(mmc); |
| 1457 | 1458 | ||
| 1459 | /* | ||
| 1460 | * When clocks are off, it's possible receiving | ||
| 1461 | * fake interrupts, which will stall the system. | ||
| 1462 | * Disabling the irq will prevent this. | ||
| 1463 | */ | ||
| 1464 | disable_irq(host->irq); | ||
| 1458 | sunxi_mmc_reset_host(host); | 1465 | sunxi_mmc_reset_host(host); |
| 1459 | sunxi_mmc_disable(host); | 1466 | sunxi_mmc_disable(host); |
| 1460 | 1467 | ||
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index a0c655628d6d..1b64ac8c5bc8 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
| @@ -2526,7 +2526,7 @@ static int cfi_atmel_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) | |||
| 2526 | 2526 | ||
| 2527 | struct ppb_lock { | 2527 | struct ppb_lock { |
| 2528 | struct flchip *chip; | 2528 | struct flchip *chip; |
| 2529 | loff_t offset; | 2529 | unsigned long adr; |
| 2530 | int locked; | 2530 | int locked; |
| 2531 | }; | 2531 | }; |
| 2532 | 2532 | ||
| @@ -2544,8 +2544,9 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, | |||
| 2544 | unsigned long timeo; | 2544 | unsigned long timeo; |
| 2545 | int ret; | 2545 | int ret; |
| 2546 | 2546 | ||
| 2547 | adr += chip->start; | ||
| 2547 | mutex_lock(&chip->mutex); | 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 | if (ret) { | 2550 | if (ret) { |
| 2550 | mutex_unlock(&chip->mutex); | 2551 | mutex_unlock(&chip->mutex); |
| 2551 | return ret; | 2552 | return ret; |
| @@ -2563,8 +2564,8 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, | |||
| 2563 | 2564 | ||
| 2564 | if (thunk == DO_XXLOCK_ONEBLOCK_LOCK) { | 2565 | if (thunk == DO_XXLOCK_ONEBLOCK_LOCK) { |
| 2565 | chip->state = FL_LOCKING; | 2566 | chip->state = FL_LOCKING; |
| 2566 | map_write(map, CMD(0xA0), chip->start + adr); | 2567 | map_write(map, CMD(0xA0), adr); |
| 2567 | map_write(map, CMD(0x00), chip->start + adr); | 2568 | map_write(map, CMD(0x00), adr); |
| 2568 | } else if (thunk == DO_XXLOCK_ONEBLOCK_UNLOCK) { | 2569 | } else if (thunk == DO_XXLOCK_ONEBLOCK_UNLOCK) { |
| 2569 | /* | 2570 | /* |
| 2570 | * Unlocking of one specific sector is not supported, so we | 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, | |||
| 2602 | map_write(map, CMD(0x00), chip->start); | 2603 | map_write(map, CMD(0x00), chip->start); |
| 2603 | 2604 | ||
| 2604 | chip->state = FL_READY; | 2605 | chip->state = FL_READY; |
| 2605 | put_chip(map, chip, adr + chip->start); | 2606 | put_chip(map, chip, adr); |
| 2606 | mutex_unlock(&chip->mutex); | 2607 | mutex_unlock(&chip->mutex); |
| 2607 | 2608 | ||
| 2608 | return ret; | 2609 | return ret; |
| @@ -2659,9 +2660,9 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, | |||
| 2659 | * sectors shall be unlocked, so lets keep their locking | 2660 | * sectors shall be unlocked, so lets keep their locking |
| 2660 | * status at "unlocked" (locked=0) for the final re-locking. | 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 | sect[sectors].chip = &cfi->chips[chipnum]; | 2664 | sect[sectors].chip = &cfi->chips[chipnum]; |
| 2664 | sect[sectors].offset = offset; | 2665 | sect[sectors].adr = adr; |
| 2665 | sect[sectors].locked = do_ppb_xxlock( | 2666 | sect[sectors].locked = do_ppb_xxlock( |
| 2666 | map, &cfi->chips[chipnum], adr, 0, | 2667 | map, &cfi->chips[chipnum], adr, 0, |
| 2667 | DO_XXLOCK_ONEBLOCK_GETLOCK); | 2668 | DO_XXLOCK_ONEBLOCK_GETLOCK); |
| @@ -2675,6 +2676,8 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, | |||
| 2675 | i++; | 2676 | i++; |
| 2676 | 2677 | ||
| 2677 | if (adr >> cfi->chipshift) { | 2678 | if (adr >> cfi->chipshift) { |
| 2679 | if (offset >= (ofs + len)) | ||
| 2680 | break; | ||
| 2678 | adr = 0; | 2681 | adr = 0; |
| 2679 | chipnum++; | 2682 | chipnum++; |
| 2680 | 2683 | ||
| @@ -2705,7 +2708,7 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, | |||
| 2705 | */ | 2708 | */ |
| 2706 | for (i = 0; i < sectors; i++) { | 2709 | for (i = 0; i < sectors; i++) { |
| 2707 | if (sect[i].locked) | 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 | DO_XXLOCK_ONEBLOCK_LOCK); | 2712 | DO_XXLOCK_ONEBLOCK_LOCK); |
| 2710 | } | 2713 | } |
| 2711 | 2714 | ||
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 3a6f450d1093..53febe8a68c3 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c | |||
| @@ -733,8 +733,8 @@ static struct flash_info dataflash_data[] = { | |||
| 733 | { "AT45DB642x", 0x1f2800, 8192, 1056, 11, SUP_POW2PS}, | 733 | { "AT45DB642x", 0x1f2800, 8192, 1056, 11, SUP_POW2PS}, |
| 734 | { "at45db642d", 0x1f2800, 8192, 1024, 10, SUP_POW2PS | IS_POW2PS}, | 734 | { "at45db642d", 0x1f2800, 8192, 1024, 10, SUP_POW2PS | IS_POW2PS}, |
| 735 | 735 | ||
| 736 | { "AT45DB641E", 0x1f28000100, 32768, 264, 9, SUP_EXTID | SUP_POW2PS}, | 736 | { "AT45DB641E", 0x1f28000100ULL, 32768, 264, 9, SUP_EXTID | SUP_POW2PS}, |
| 737 | { "at45db641e", 0x1f28000100, 32768, 256, 8, SUP_EXTID | SUP_POW2PS | IS_POW2PS}, | 737 | { "at45db641e", 0x1f28000100ULL, 32768, 256, 8, SUP_EXTID | SUP_POW2PS | IS_POW2PS}, |
| 738 | }; | 738 | }; |
| 739 | 739 | ||
| 740 | static struct flash_info *jedec_lookup(struct spi_device *spi, | 740 | static struct flash_info *jedec_lookup(struct spi_device *spi, |
diff --git a/drivers/mtd/nand/raw/denali_dt.c b/drivers/mtd/nand/raw/denali_dt.c index cfd33e6ca77f..5869e90cc14b 100644 --- a/drivers/mtd/nand/raw/denali_dt.c +++ b/drivers/mtd/nand/raw/denali_dt.c | |||
| @@ -123,7 +123,11 @@ static int denali_dt_probe(struct platform_device *pdev) | |||
| 123 | if (ret) | 123 | if (ret) |
| 124 | return ret; | 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 | ret = denali_init(denali); | 132 | ret = denali_init(denali); |
| 129 | if (ret) | 133 | if (ret) |
diff --git a/drivers/mtd/nand/raw/mxc_nand.c b/drivers/mtd/nand/raw/mxc_nand.c index 45786e707b7b..26cef218bb43 100644 --- a/drivers/mtd/nand/raw/mxc_nand.c +++ b/drivers/mtd/nand/raw/mxc_nand.c | |||
| @@ -48,7 +48,7 @@ | |||
| 48 | #define NFC_V1_V2_CONFIG (host->regs + 0x0a) | 48 | #define NFC_V1_V2_CONFIG (host->regs + 0x0a) |
| 49 | #define NFC_V1_V2_ECC_STATUS_RESULT (host->regs + 0x0c) | 49 | #define NFC_V1_V2_ECC_STATUS_RESULT (host->regs + 0x0c) |
| 50 | #define NFC_V1_V2_RSLTMAIN_AREA (host->regs + 0x0e) | 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 | #define NFC_V1_V2_WRPROT (host->regs + 0x12) | 52 | #define NFC_V1_V2_WRPROT (host->regs + 0x12) |
| 53 | #define NFC_V1_UNLOCKSTART_BLKADDR (host->regs + 0x14) | 53 | #define NFC_V1_UNLOCKSTART_BLKADDR (host->regs + 0x14) |
| 54 | #define NFC_V1_UNLOCKEND_BLKADDR (host->regs + 0x16) | 54 | #define NFC_V1_UNLOCKEND_BLKADDR (host->regs + 0x16) |
| @@ -1274,6 +1274,9 @@ static void preset_v2(struct mtd_info *mtd) | |||
| 1274 | writew(config1, NFC_V1_V2_CONFIG1); | 1274 | writew(config1, NFC_V1_V2_CONFIG1); |
| 1275 | /* preset operation */ | 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 | /* Unlock the internal RAM Buffer */ | 1280 | /* Unlock the internal RAM Buffer */ |
| 1278 | writew(0x2, NFC_V1_V2_CONFIG); | 1281 | writew(0x2, NFC_V1_V2_CONFIG); |
| 1279 | 1282 | ||
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 10c4f9919850..b01d15ec4c56 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c | |||
| @@ -440,7 +440,7 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs) | |||
| 440 | 440 | ||
| 441 | for (; page < page_end; page++) { | 441 | for (; page < page_end; page++) { |
| 442 | res = chip->ecc.read_oob(mtd, chip, page); | 442 | res = chip->ecc.read_oob(mtd, chip, page); |
| 443 | if (res) | 443 | if (res < 0) |
| 444 | return res; | 444 | return res; |
| 445 | 445 | ||
| 446 | bad = chip->oob_poi[chip->badblockpos]; | 446 | bad = chip->oob_poi[chip->badblockpos]; |
diff --git a/drivers/mtd/nand/raw/nand_macronix.c b/drivers/mtd/nand/raw/nand_macronix.c index 7ed1f87e742a..49c546c97c6f 100644 --- a/drivers/mtd/nand/raw/nand_macronix.c +++ b/drivers/mtd/nand/raw/nand_macronix.c | |||
| @@ -17,23 +17,47 @@ | |||
| 17 | 17 | ||
| 18 | #include <linux/mtd/rawnand.h> | 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 | static int macronix_nand_init(struct nand_chip *chip) | 55 | static int macronix_nand_init(struct nand_chip *chip) |
| 21 | { | 56 | { |
| 22 | if (nand_is_slc(chip)) | 57 | if (nand_is_slc(chip)) |
| 23 | chip->bbt_options |= NAND_BBT_SCAN2NDPAGE; | 58 | chip->bbt_options |= NAND_BBT_SCAN2NDPAGE; |
| 24 | 59 | ||
| 25 | /* | 60 | macronix_nand_fix_broken_get_timings(chip); |
| 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 | } | ||
| 37 | 61 | ||
| 38 | return 0; | 62 | return 0; |
| 39 | } | 63 | } |
diff --git a/drivers/mtd/nand/raw/nand_micron.c b/drivers/mtd/nand/raw/nand_micron.c index 0af45b134c0c..5ec4c90a637d 100644 --- a/drivers/mtd/nand/raw/nand_micron.c +++ b/drivers/mtd/nand/raw/nand_micron.c | |||
| @@ -66,7 +66,9 @@ static int micron_nand_onfi_init(struct nand_chip *chip) | |||
| 66 | 66 | ||
| 67 | if (p->supports_set_get_features) { | 67 | if (p->supports_set_get_features) { |
| 68 | set_bit(ONFI_FEATURE_ADDR_READ_RETRY, p->set_feature_list); | 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 | set_bit(ONFI_FEATURE_ADDR_READ_RETRY, p->get_feature_list); | 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 | return 0; | 74 | return 0; |
diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c index c3f7aaa5d18f..d7e10b36a0b9 100644 --- a/drivers/mtd/spi-nor/cadence-quadspi.c +++ b/drivers/mtd/spi-nor/cadence-quadspi.c | |||
| @@ -926,10 +926,12 @@ static ssize_t cqspi_write(struct spi_nor *nor, loff_t to, | |||
| 926 | if (ret) | 926 | if (ret) |
| 927 | return ret; | 927 | return ret; |
| 928 | 928 | ||
| 929 | if (f_pdata->use_direct_mode) | 929 | if (f_pdata->use_direct_mode) { |
| 930 | memcpy_toio(cqspi->ahb_base + to, buf, len); | 930 | memcpy_toio(cqspi->ahb_base + to, buf, len); |
| 931 | else | 931 | ret = cqspi_wait_idle(cqspi); |
| 932 | } else { | ||
| 932 | ret = cqspi_indirect_write_execute(nor, to, buf, len); | 933 | ret = cqspi_indirect_write_execute(nor, to, buf, len); |
| 934 | } | ||
| 933 | if (ret) | 935 | if (ret) |
| 934 | return ret; | 936 | return ret; |
| 935 | 937 | ||
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c index 567ee54504bc..5e5022fa1d04 100644 --- a/drivers/net/ethernet/atheros/alx/main.c +++ b/drivers/net/ethernet/atheros/alx/main.c | |||
| @@ -1897,13 +1897,19 @@ static int alx_resume(struct device *dev) | |||
| 1897 | struct pci_dev *pdev = to_pci_dev(dev); | 1897 | struct pci_dev *pdev = to_pci_dev(dev); |
| 1898 | struct alx_priv *alx = pci_get_drvdata(pdev); | 1898 | struct alx_priv *alx = pci_get_drvdata(pdev); |
| 1899 | struct alx_hw *hw = &alx->hw; | 1899 | struct alx_hw *hw = &alx->hw; |
| 1900 | int err; | ||
| 1900 | 1901 | ||
| 1901 | alx_reset_phy(hw); | 1902 | alx_reset_phy(hw); |
| 1902 | 1903 | ||
| 1903 | if (!netif_running(alx->dev)) | 1904 | if (!netif_running(alx->dev)) |
| 1904 | return 0; | 1905 | return 0; |
| 1905 | netif_device_attach(alx->dev); | 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 | static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume); | 1915 | static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index d847e1b9c37b..be1506169076 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
| @@ -1533,6 +1533,7 @@ struct bnx2x { | |||
| 1533 | struct link_vars link_vars; | 1533 | struct link_vars link_vars; |
| 1534 | u32 link_cnt; | 1534 | u32 link_cnt; |
| 1535 | struct bnx2x_link_report_data last_reported_link; | 1535 | struct bnx2x_link_report_data last_reported_link; |
| 1536 | bool force_link_down; | ||
| 1536 | 1537 | ||
| 1537 | struct mdio_if_info mdio; | 1538 | struct mdio_if_info mdio; |
| 1538 | 1539 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 8cd73ff5debc..af7b5a4d8ba0 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
| @@ -1261,6 +1261,11 @@ void __bnx2x_link_report(struct bnx2x *bp) | |||
| 1261 | { | 1261 | { |
| 1262 | struct bnx2x_link_report_data cur_data; | 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 | /* reread mf_cfg */ | 1269 | /* reread mf_cfg */ |
| 1265 | if (IS_PF(bp) && !CHIP_IS_E1(bp)) | 1270 | if (IS_PF(bp) && !CHIP_IS_E1(bp)) |
| 1266 | bnx2x_read_mf_cfg(bp); | 1271 | bnx2x_read_mf_cfg(bp); |
| @@ -2817,6 +2822,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
| 2817 | bp->pending_max = 0; | 2822 | bp->pending_max = 0; |
| 2818 | } | 2823 | } |
| 2819 | 2824 | ||
| 2825 | bp->force_link_down = false; | ||
| 2820 | if (bp->port.pmf) { | 2826 | if (bp->port.pmf) { |
| 2821 | rc = bnx2x_initial_phy_init(bp, load_mode); | 2827 | rc = bnx2x_initial_phy_init(bp, load_mode); |
| 2822 | if (rc) | 2828 | if (rc) |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 5b1ed240bf18..57348f2b49a3 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
| @@ -10279,6 +10279,12 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work) | |||
| 10279 | bp->sp_rtnl_state = 0; | 10279 | bp->sp_rtnl_state = 0; |
| 10280 | smp_mb(); | 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 | bnx2x_nic_unload(bp, UNLOAD_NORMAL, true); | 10288 | bnx2x_nic_unload(bp, UNLOAD_NORMAL, true); |
| 10283 | /* When ret value shows failure of allocation failure, | 10289 | /* When ret value shows failure of allocation failure, |
| 10284 | * the nic is rebooted again. If open still fails, a error | 10290 | * the nic is rebooted again. If open still fails, a error |
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index 30273a7717e2..4fd829b5e65d 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
| @@ -660,7 +660,7 @@ static int cnic_init_id_tbl(struct cnic_id_tbl *id_tbl, u32 size, u32 start_id, | |||
| 660 | id_tbl->max = size; | 660 | id_tbl->max = size; |
| 661 | id_tbl->next = next; | 661 | id_tbl->next = next; |
| 662 | spin_lock_init(&id_tbl->lock); | 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 | if (!id_tbl->table) | 664 | if (!id_tbl->table) |
| 665 | return -ENOMEM; | 665 | return -ENOMEM; |
| 666 | 666 | ||
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 3e93df5d4e3b..96cc03a6d942 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c | |||
| @@ -3726,6 +3726,8 @@ static int at91ether_init(struct platform_device *pdev) | |||
| 3726 | int err; | 3726 | int err; |
| 3727 | u32 reg; | 3727 | u32 reg; |
| 3728 | 3728 | ||
| 3729 | bp->queues[0].bp = bp; | ||
| 3730 | |||
| 3729 | dev->netdev_ops = &at91ether_netdev_ops; | 3731 | dev->netdev_ops = &at91ether_netdev_ops; |
| 3730 | dev->ethtool_ops = &macb_ethtool_ops; | 3732 | dev->ethtool_ops = &macb_ethtool_ops; |
| 3731 | 3733 | ||
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 5f4e1ffa7b95..ab02057ac730 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | |||
| @@ -125,6 +125,9 @@ MODULE_PARM_DESC(tx_timeout, "The Tx timeout in ms"); | |||
| 125 | /* Default alignment for start of data in an Rx FD */ | 125 | /* Default alignment for start of data in an Rx FD */ |
| 126 | #define DPAA_FD_DATA_ALIGNMENT 16 | 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 | /* Values for the L3R field of the FM Parse Results | 131 | /* Values for the L3R field of the FM Parse Results |
| 129 | */ | 132 | */ |
| 130 | /* L3 Type field: First IP Present IPv4 */ | 133 | /* L3 Type field: First IP Present IPv4 */ |
| @@ -1617,8 +1620,8 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv, | |||
| 1617 | 1620 | ||
| 1618 | if (unlikely(qm_fd_get_format(fd) == qm_fd_sg)) { | 1621 | if (unlikely(qm_fd_get_format(fd) == qm_fd_sg)) { |
| 1619 | nr_frags = skb_shinfo(skb)->nr_frags; | 1622 | nr_frags = skb_shinfo(skb)->nr_frags; |
| 1620 | dma_unmap_single(dev, addr, qm_fd_get_offset(fd) + | 1623 | dma_unmap_single(dev, addr, |
| 1621 | sizeof(struct qm_sg_entry) * (1 + nr_frags), | 1624 | qm_fd_get_offset(fd) + DPAA_SGT_SIZE, |
| 1622 | dma_dir); | 1625 | dma_dir); |
| 1623 | 1626 | ||
| 1624 | /* The sgt buffer has been allocated with netdev_alloc_frag(), | 1627 | /* The sgt buffer has been allocated with netdev_alloc_frag(), |
| @@ -1903,8 +1906,7 @@ static int skb_to_sg_fd(struct dpaa_priv *priv, | |||
| 1903 | void *sgt_buf; | 1906 | void *sgt_buf; |
| 1904 | 1907 | ||
| 1905 | /* get a page frag to store the SGTable */ | 1908 | /* get a page frag to store the SGTable */ |
| 1906 | sz = SKB_DATA_ALIGN(priv->tx_headroom + | 1909 | sz = SKB_DATA_ALIGN(priv->tx_headroom + DPAA_SGT_SIZE); |
| 1907 | sizeof(struct qm_sg_entry) * (1 + nr_frags)); | ||
| 1908 | sgt_buf = netdev_alloc_frag(sz); | 1910 | sgt_buf = netdev_alloc_frag(sz); |
| 1909 | if (unlikely(!sgt_buf)) { | 1911 | if (unlikely(!sgt_buf)) { |
| 1910 | netdev_err(net_dev, "netdev_alloc_frag() failed for size %d\n", | 1912 | netdev_err(net_dev, "netdev_alloc_frag() failed for size %d\n", |
| @@ -1972,9 +1974,8 @@ static int skb_to_sg_fd(struct dpaa_priv *priv, | |||
| 1972 | skbh = (struct sk_buff **)buffer_start; | 1974 | skbh = (struct sk_buff **)buffer_start; |
| 1973 | *skbh = skb; | 1975 | *skbh = skb; |
| 1974 | 1976 | ||
| 1975 | addr = dma_map_single(dev, buffer_start, priv->tx_headroom + | 1977 | addr = dma_map_single(dev, buffer_start, |
| 1976 | sizeof(struct qm_sg_entry) * (1 + nr_frags), | 1978 | priv->tx_headroom + DPAA_SGT_SIZE, dma_dir); |
| 1977 | dma_dir); | ||
| 1978 | if (unlikely(dma_mapping_error(dev, addr))) { | 1979 | if (unlikely(dma_mapping_error(dev, addr))) { |
| 1979 | dev_err(dev, "DMA mapping failed"); | 1980 | dev_err(dev, "DMA mapping failed"); |
| 1980 | err = -EINVAL; | 1981 | err = -EINVAL; |
diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c index ce6e24c74978..ecbf6187e13a 100644 --- a/drivers/net/ethernet/freescale/fman/fman_port.c +++ b/drivers/net/ethernet/freescale/fman/fman_port.c | |||
| @@ -324,6 +324,10 @@ struct fman_port_qmi_regs { | |||
| 324 | #define HWP_HXS_PHE_REPORT 0x00000800 | 324 | #define HWP_HXS_PHE_REPORT 0x00000800 |
| 325 | #define HWP_HXS_PCAC_PSTAT 0x00000100 | 325 | #define HWP_HXS_PCAC_PSTAT 0x00000100 |
| 326 | #define HWP_HXS_PCAC_PSTOP 0x00000001 | 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 | struct fman_port_hwp_regs { | 331 | struct fman_port_hwp_regs { |
| 328 | struct { | 332 | struct { |
| 329 | u32 ssa; /* Soft Sequence Attachment */ | 333 | u32 ssa; /* Soft Sequence Attachment */ |
| @@ -728,6 +732,10 @@ static void init_hwp(struct fman_port *port) | |||
| 728 | iowrite32be(0xffffffff, ®s->pmda[i].lcv); | 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 | start_port_hwp(port); | 739 | start_port_hwp(port); |
| 732 | } | 740 | } |
| 733 | 741 | ||
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_rx.c b/drivers/net/ethernet/huawei/hinic/hinic_rx.c index e2e5cdc7119c..4c0f7eda1166 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_rx.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_rx.c | |||
| @@ -439,6 +439,7 @@ static void rx_free_irq(struct hinic_rxq *rxq) | |||
| 439 | { | 439 | { |
| 440 | struct hinic_rq *rq = rxq->rq; | 440 | struct hinic_rq *rq = rxq->rq; |
| 441 | 441 | ||
| 442 | irq_set_affinity_hint(rq->irq, NULL); | ||
| 442 | free_irq(rq->irq, rxq); | 443 | free_irq(rq->irq, rxq); |
| 443 | rx_del_napi(rxq); | 444 | rx_del_napi(rxq); |
| 444 | } | 445 | } |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index ed6dbcfd4e96..b151ae316546 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
| @@ -2199,9 +2199,10 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring, | |||
| 2199 | return true; | 2199 | return true; |
| 2200 | } | 2200 | } |
| 2201 | 2201 | ||
| 2202 | #define I40E_XDP_PASS 0 | 2202 | #define I40E_XDP_PASS 0 |
| 2203 | #define I40E_XDP_CONSUMED 1 | 2203 | #define I40E_XDP_CONSUMED BIT(0) |
| 2204 | #define I40E_XDP_TX 2 | 2204 | #define I40E_XDP_TX BIT(1) |
| 2205 | #define I40E_XDP_REDIR BIT(2) | ||
| 2205 | 2206 | ||
| 2206 | static int i40e_xmit_xdp_ring(struct xdp_frame *xdpf, | 2207 | static int i40e_xmit_xdp_ring(struct xdp_frame *xdpf, |
| 2207 | struct i40e_ring *xdp_ring); | 2208 | struct i40e_ring *xdp_ring); |
| @@ -2248,7 +2249,7 @@ static struct sk_buff *i40e_run_xdp(struct i40e_ring *rx_ring, | |||
| 2248 | break; | 2249 | break; |
| 2249 | case XDP_REDIRECT: | 2250 | case XDP_REDIRECT: |
| 2250 | err = xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog); | 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 | break; | 2253 | break; |
| 2253 | default: | 2254 | default: |
| 2254 | bpf_warn_invalid_xdp_action(act); | 2255 | bpf_warn_invalid_xdp_action(act); |
| @@ -2311,7 +2312,8 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) | |||
| 2311 | unsigned int total_rx_bytes = 0, total_rx_packets = 0; | 2312 | unsigned int total_rx_bytes = 0, total_rx_packets = 0; |
| 2312 | struct sk_buff *skb = rx_ring->skb; | 2313 | struct sk_buff *skb = rx_ring->skb; |
| 2313 | u16 cleaned_count = I40E_DESC_UNUSED(rx_ring); | 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 | struct xdp_buff xdp; | 2317 | struct xdp_buff xdp; |
| 2316 | 2318 | ||
| 2317 | xdp.rxq = &rx_ring->xdp_rxq; | 2319 | xdp.rxq = &rx_ring->xdp_rxq; |
| @@ -2372,8 +2374,10 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) | |||
| 2372 | } | 2374 | } |
| 2373 | 2375 | ||
| 2374 | if (IS_ERR(skb)) { | 2376 | if (IS_ERR(skb)) { |
| 2375 | if (PTR_ERR(skb) == -I40E_XDP_TX) { | 2377 | unsigned int xdp_res = -PTR_ERR(skb); |
| 2376 | xdp_xmit = true; | 2378 | |
| 2379 | if (xdp_res & (I40E_XDP_TX | I40E_XDP_REDIR)) { | ||
| 2380 | xdp_xmit |= xdp_res; | ||
| 2377 | i40e_rx_buffer_flip(rx_ring, rx_buffer, size); | 2381 | i40e_rx_buffer_flip(rx_ring, rx_buffer, size); |
| 2378 | } else { | 2382 | } else { |
| 2379 | rx_buffer->pagecnt_bias++; | 2383 | rx_buffer->pagecnt_bias++; |
| @@ -2427,12 +2431,14 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) | |||
| 2427 | total_rx_packets++; | 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 | struct i40e_ring *xdp_ring = | 2438 | struct i40e_ring *xdp_ring = |
| 2432 | rx_ring->vsi->xdp_rings[rx_ring->queue_index]; | 2439 | rx_ring->vsi->xdp_rings[rx_ring->queue_index]; |
| 2433 | 2440 | ||
| 2434 | i40e_xdp_ring_update_tail(xdp_ring); | 2441 | i40e_xdp_ring_update_tail(xdp_ring); |
| 2435 | xdp_do_flush_map(); | ||
| 2436 | } | 2442 | } |
| 2437 | 2443 | ||
| 2438 | rx_ring->skb = skb; | 2444 | rx_ring->skb = skb; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 3e87dbbc9024..62e57b05a0ae 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
| @@ -2186,9 +2186,10 @@ static struct sk_buff *ixgbe_build_skb(struct ixgbe_ring *rx_ring, | |||
| 2186 | return skb; | 2186 | return skb; |
| 2187 | } | 2187 | } |
| 2188 | 2188 | ||
| 2189 | #define IXGBE_XDP_PASS 0 | 2189 | #define IXGBE_XDP_PASS 0 |
| 2190 | #define IXGBE_XDP_CONSUMED 1 | 2190 | #define IXGBE_XDP_CONSUMED BIT(0) |
| 2191 | #define IXGBE_XDP_TX 2 | 2191 | #define IXGBE_XDP_TX BIT(1) |
| 2192 | #define IXGBE_XDP_REDIR BIT(2) | ||
| 2192 | 2193 | ||
| 2193 | static int ixgbe_xmit_xdp_ring(struct ixgbe_adapter *adapter, | 2194 | static int ixgbe_xmit_xdp_ring(struct ixgbe_adapter *adapter, |
| 2194 | struct xdp_frame *xdpf); | 2195 | struct xdp_frame *xdpf); |
| @@ -2225,7 +2226,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter, | |||
| 2225 | case XDP_REDIRECT: | 2226 | case XDP_REDIRECT: |
| 2226 | err = xdp_do_redirect(adapter->netdev, xdp, xdp_prog); | 2227 | err = xdp_do_redirect(adapter->netdev, xdp, xdp_prog); |
| 2227 | if (!err) | 2228 | if (!err) |
| 2228 | result = IXGBE_XDP_TX; | 2229 | result = IXGBE_XDP_REDIR; |
| 2229 | else | 2230 | else |
| 2230 | result = IXGBE_XDP_CONSUMED; | 2231 | result = IXGBE_XDP_CONSUMED; |
| 2231 | break; | 2232 | break; |
| @@ -2285,7 +2286,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
| 2285 | unsigned int mss = 0; | 2286 | unsigned int mss = 0; |
| 2286 | #endif /* IXGBE_FCOE */ | 2287 | #endif /* IXGBE_FCOE */ |
| 2287 | u16 cleaned_count = ixgbe_desc_unused(rx_ring); | 2288 | u16 cleaned_count = ixgbe_desc_unused(rx_ring); |
| 2288 | bool xdp_xmit = false; | 2289 | unsigned int xdp_xmit = 0; |
| 2289 | struct xdp_buff xdp; | 2290 | struct xdp_buff xdp; |
| 2290 | 2291 | ||
| 2291 | xdp.rxq = &rx_ring->xdp_rxq; | 2292 | xdp.rxq = &rx_ring->xdp_rxq; |
| @@ -2328,8 +2329,10 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
| 2328 | } | 2329 | } |
| 2329 | 2330 | ||
| 2330 | if (IS_ERR(skb)) { | 2331 | if (IS_ERR(skb)) { |
| 2331 | if (PTR_ERR(skb) == -IXGBE_XDP_TX) { | 2332 | unsigned int xdp_res = -PTR_ERR(skb); |
| 2332 | xdp_xmit = true; | 2333 | |
| 2334 | if (xdp_res & (IXGBE_XDP_TX | IXGBE_XDP_REDIR)) { | ||
| 2335 | xdp_xmit |= xdp_res; | ||
| 2333 | ixgbe_rx_buffer_flip(rx_ring, rx_buffer, size); | 2336 | ixgbe_rx_buffer_flip(rx_ring, rx_buffer, size); |
| 2334 | } else { | 2337 | } else { |
| 2335 | rx_buffer->pagecnt_bias++; | 2338 | rx_buffer->pagecnt_bias++; |
| @@ -2401,7 +2404,10 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
| 2401 | total_rx_packets++; | 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 | struct ixgbe_ring *ring = adapter->xdp_ring[smp_processor_id()]; | 2411 | struct ixgbe_ring *ring = adapter->xdp_ring[smp_processor_id()]; |
| 2406 | 2412 | ||
| 2407 | /* Force memory writes to complete before letting h/w | 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, | |||
| 2409 | */ | 2415 | */ |
| 2410 | wmb(); | 2416 | wmb(); |
| 2411 | writel(ring->next_to_use, ring->tail); | 2417 | writel(ring->next_to_use, ring->tail); |
| 2412 | |||
| 2413 | xdp_do_flush_map(); | ||
| 2414 | } | 2418 | } |
| 2415 | 2419 | ||
| 2416 | u64_stats_update_begin(&rx_ring->syncp); | 2420 | u64_stats_update_begin(&rx_ring->syncp); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 487388aed98f..384c1fa49081 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c | |||
| @@ -807,6 +807,7 @@ static void cmd_work_handler(struct work_struct *work) | |||
| 807 | unsigned long flags; | 807 | unsigned long flags; |
| 808 | bool poll_cmd = ent->polling; | 808 | bool poll_cmd = ent->polling; |
| 809 | int alloc_ret; | 809 | int alloc_ret; |
| 810 | int cmd_mode; | ||
| 810 | 811 | ||
| 811 | sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem; | 812 | sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem; |
| 812 | down(sem); | 813 | down(sem); |
| @@ -853,6 +854,7 @@ static void cmd_work_handler(struct work_struct *work) | |||
| 853 | set_signature(ent, !cmd->checksum_disabled); | 854 | set_signature(ent, !cmd->checksum_disabled); |
| 854 | dump_command(dev, ent, 1); | 855 | dump_command(dev, ent, 1); |
| 855 | ent->ts1 = ktime_get_ns(); | 856 | ent->ts1 = ktime_get_ns(); |
| 857 | cmd_mode = cmd->mode; | ||
| 856 | 858 | ||
| 857 | if (ent->callback) | 859 | if (ent->callback) |
| 858 | schedule_delayed_work(&ent->cb_timeout_work, cb_timeout); | 860 | schedule_delayed_work(&ent->cb_timeout_work, cb_timeout); |
| @@ -877,7 +879,7 @@ static void cmd_work_handler(struct work_struct *work) | |||
| 877 | iowrite32be(1 << ent->idx, &dev->iseg->cmd_dbell); | 879 | iowrite32be(1 << ent->idx, &dev->iseg->cmd_dbell); |
| 878 | mmiowb(); | 880 | mmiowb(); |
| 879 | /* if not in polling don't use ent after this point */ | 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 | poll_timeout(ent); | 883 | poll_timeout(ent); |
| 882 | /* make sure we read the descriptor after ownership is SW */ | 884 | /* make sure we read the descriptor after ownership is SW */ |
| 883 | rmb(); | 885 | rmb(); |
| @@ -1276,7 +1278,7 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf, | |||
| 1276 | { | 1278 | { |
| 1277 | struct mlx5_core_dev *dev = filp->private_data; | 1279 | struct mlx5_core_dev *dev = filp->private_data; |
| 1278 | struct mlx5_cmd_debug *dbg = &dev->cmd.dbg; | 1280 | struct mlx5_cmd_debug *dbg = &dev->cmd.dbg; |
| 1279 | char outlen_str[8]; | 1281 | char outlen_str[8] = {0}; |
| 1280 | int outlen; | 1282 | int outlen; |
| 1281 | void *ptr; | 1283 | void *ptr; |
| 1282 | int err; | 1284 | int err; |
| @@ -1291,8 +1293,6 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf, | |||
| 1291 | if (copy_from_user(outlen_str, buf, count)) | 1293 | if (copy_from_user(outlen_str, buf, count)) |
| 1292 | return -EFAULT; | 1294 | return -EFAULT; |
| 1293 | 1295 | ||
| 1294 | outlen_str[7] = 0; | ||
| 1295 | |||
| 1296 | err = sscanf(outlen_str, "%d", &outlen); | 1296 | err = sscanf(outlen_str, "%d", &outlen); |
| 1297 | if (err < 0) | 1297 | if (err < 0) |
| 1298 | return err; | 1298 | return err; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 56c1b6f5593e..dae4156a710d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c | |||
| @@ -2846,7 +2846,7 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv) | |||
| 2846 | mlx5e_activate_channels(&priv->channels); | 2846 | mlx5e_activate_channels(&priv->channels); |
| 2847 | netif_tx_start_all_queues(priv->netdev); | 2847 | netif_tx_start_all_queues(priv->netdev); |
| 2848 | 2848 | ||
| 2849 | if (MLX5_VPORT_MANAGER(priv->mdev)) | 2849 | if (MLX5_ESWITCH_MANAGER(priv->mdev)) |
| 2850 | mlx5e_add_sqs_fwd_rules(priv); | 2850 | mlx5e_add_sqs_fwd_rules(priv); |
| 2851 | 2851 | ||
| 2852 | mlx5e_wait_channels_min_rx_wqes(&priv->channels); | 2852 | mlx5e_wait_channels_min_rx_wqes(&priv->channels); |
| @@ -2857,7 +2857,7 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv) | |||
| 2857 | { | 2857 | { |
| 2858 | mlx5e_redirect_rqts_to_drop(priv); | 2858 | mlx5e_redirect_rqts_to_drop(priv); |
| 2859 | 2859 | ||
| 2860 | if (MLX5_VPORT_MANAGER(priv->mdev)) | 2860 | if (MLX5_ESWITCH_MANAGER(priv->mdev)) |
| 2861 | mlx5e_remove_sqs_fwd_rules(priv); | 2861 | mlx5e_remove_sqs_fwd_rules(priv); |
| 2862 | 2862 | ||
| 2863 | /* FIXME: This is a W/A only for tx timeout watch dog false alarm when | 2863 | /* FIXME: This is a W/A only for tx timeout watch dog false alarm when |
| @@ -4597,7 +4597,7 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) | |||
| 4597 | mlx5e_set_netdev_dev_addr(netdev); | 4597 | mlx5e_set_netdev_dev_addr(netdev); |
| 4598 | 4598 | ||
| 4599 | #if IS_ENABLED(CONFIG_MLX5_ESWITCH) | 4599 | #if IS_ENABLED(CONFIG_MLX5_ESWITCH) |
| 4600 | if (MLX5_VPORT_MANAGER(mdev)) | 4600 | if (MLX5_ESWITCH_MANAGER(mdev)) |
| 4601 | netdev->switchdev_ops = &mlx5e_switchdev_ops; | 4601 | netdev->switchdev_ops = &mlx5e_switchdev_ops; |
| 4602 | #endif | 4602 | #endif |
| 4603 | 4603 | ||
| @@ -4753,7 +4753,7 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv) | |||
| 4753 | 4753 | ||
| 4754 | mlx5e_enable_async_events(priv); | 4754 | mlx5e_enable_async_events(priv); |
| 4755 | 4755 | ||
| 4756 | if (MLX5_VPORT_MANAGER(priv->mdev)) | 4756 | if (MLX5_ESWITCH_MANAGER(priv->mdev)) |
| 4757 | mlx5e_register_vport_reps(priv); | 4757 | mlx5e_register_vport_reps(priv); |
| 4758 | 4758 | ||
| 4759 | if (netdev->reg_state != NETREG_REGISTERED) | 4759 | if (netdev->reg_state != NETREG_REGISTERED) |
| @@ -4788,7 +4788,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv) | |||
| 4788 | 4788 | ||
| 4789 | queue_work(priv->wq, &priv->set_rx_mode_work); | 4789 | queue_work(priv->wq, &priv->set_rx_mode_work); |
| 4790 | 4790 | ||
| 4791 | if (MLX5_VPORT_MANAGER(priv->mdev)) | 4791 | if (MLX5_ESWITCH_MANAGER(priv->mdev)) |
| 4792 | mlx5e_unregister_vport_reps(priv); | 4792 | mlx5e_unregister_vport_reps(priv); |
| 4793 | 4793 | ||
| 4794 | mlx5e_disable_async_events(priv); | 4794 | mlx5e_disable_async_events(priv); |
| @@ -4972,7 +4972,7 @@ static void *mlx5e_add(struct mlx5_core_dev *mdev) | |||
| 4972 | return NULL; | 4972 | return NULL; |
| 4973 | 4973 | ||
| 4974 | #ifdef CONFIG_MLX5_ESWITCH | 4974 | #ifdef CONFIG_MLX5_ESWITCH |
| 4975 | if (MLX5_VPORT_MANAGER(mdev)) { | 4975 | if (MLX5_ESWITCH_MANAGER(mdev)) { |
| 4976 | rpriv = mlx5e_alloc_nic_rep_priv(mdev); | 4976 | rpriv = mlx5e_alloc_nic_rep_priv(mdev); |
| 4977 | if (!rpriv) { | 4977 | if (!rpriv) { |
| 4978 | mlx5_core_warn(mdev, "Failed to alloc NIC rep priv data\n"); | 4978 | mlx5_core_warn(mdev, "Failed to alloc NIC rep priv data\n"); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index 57987f6546e8..2b8040a3cdbd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | |||
| @@ -823,7 +823,7 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv) | |||
| 823 | struct mlx5e_rep_priv *rpriv = priv->ppriv; | 823 | struct mlx5e_rep_priv *rpriv = priv->ppriv; |
| 824 | struct mlx5_eswitch_rep *rep; | 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 | return false; | 827 | return false; |
| 828 | 828 | ||
| 829 | rep = rpriv->rep; | 829 | rep = rpriv->rep; |
| @@ -837,8 +837,12 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv) | |||
| 837 | static bool mlx5e_is_vf_vport_rep(struct mlx5e_priv *priv) | 837 | static bool mlx5e_is_vf_vport_rep(struct mlx5e_priv *priv) |
| 838 | { | 838 | { |
| 839 | struct mlx5e_rep_priv *rpriv = priv->ppriv; | 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 | if (rep && rep->vport != FDB_UPLINK_VPORT) | 846 | if (rep && rep->vport != FDB_UPLINK_VPORT) |
| 843 | return true; | 847 | return true; |
| 844 | 848 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index f63dfbcd29fe..b79d74860a30 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | |||
| @@ -1594,17 +1594,15 @@ static void esw_disable_vport(struct mlx5_eswitch *esw, int vport_num) | |||
| 1594 | } | 1594 | } |
| 1595 | 1595 | ||
| 1596 | /* Public E-Switch API */ | 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 | int mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs, int mode) | 1600 | int mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs, int mode) |
| 1600 | { | 1601 | { |
| 1601 | int err; | 1602 | int err; |
| 1602 | int i, enabled_events; | 1603 | int i, enabled_events; |
| 1603 | 1604 | ||
| 1604 | if (!ESW_ALLOWED(esw)) | 1605 | if (!ESW_ALLOWED(esw) || |
| 1605 | return 0; | ||
| 1606 | |||
| 1607 | if (!MLX5_CAP_GEN(esw->dev, eswitch_flow_table) || | ||
| 1608 | !MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, ft_support)) { | 1606 | !MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, ft_support)) { |
| 1609 | esw_warn(esw->dev, "E-Switch FDB is not supported, aborting ...\n"); | 1607 | esw_warn(esw->dev, "E-Switch FDB is not supported, aborting ...\n"); |
| 1610 | return -EOPNOTSUPP; | 1608 | return -EOPNOTSUPP; |
| @@ -1806,7 +1804,7 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw, | |||
| 1806 | u64 node_guid; | 1804 | u64 node_guid; |
| 1807 | int err = 0; | 1805 | int err = 0; |
| 1808 | 1806 | ||
| 1809 | if (!ESW_ALLOWED(esw)) | 1807 | if (!MLX5_CAP_GEN(esw->dev, vport_group_manager)) |
| 1810 | return -EPERM; | 1808 | return -EPERM; |
| 1811 | if (!LEGAL_VPORT(esw, vport) || is_multicast_ether_addr(mac)) | 1809 | if (!LEGAL_VPORT(esw, vport) || is_multicast_ether_addr(mac)) |
| 1812 | return -EINVAL; | 1810 | return -EINVAL; |
| @@ -1883,7 +1881,7 @@ int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw, | |||
| 1883 | { | 1881 | { |
| 1884 | struct mlx5_vport *evport; | 1882 | struct mlx5_vport *evport; |
| 1885 | 1883 | ||
| 1886 | if (!ESW_ALLOWED(esw)) | 1884 | if (!MLX5_CAP_GEN(esw->dev, vport_group_manager)) |
| 1887 | return -EPERM; | 1885 | return -EPERM; |
| 1888 | if (!LEGAL_VPORT(esw, vport)) | 1886 | if (!LEGAL_VPORT(esw, vport)) |
| 1889 | return -EINVAL; | 1887 | return -EINVAL; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index cecd201f0b73..91f1209886ff 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | |||
| @@ -1079,8 +1079,8 @@ static int mlx5_devlink_eswitch_check(struct devlink *devlink) | |||
| 1079 | if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH) | 1079 | if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH) |
| 1080 | return -EOPNOTSUPP; | 1080 | return -EOPNOTSUPP; |
| 1081 | 1081 | ||
| 1082 | if (!MLX5_CAP_GEN(dev, vport_group_manager)) | 1082 | if(!MLX5_ESWITCH_MANAGER(dev)) |
| 1083 | return -EOPNOTSUPP; | 1083 | return -EPERM; |
| 1084 | 1084 | ||
| 1085 | if (dev->priv.eswitch->mode == SRIOV_NONE) | 1085 | if (dev->priv.eswitch->mode == SRIOV_NONE) |
| 1086 | return -EOPNOTSUPP; | 1086 | return -EOPNOTSUPP; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index 49a75d31185e..f1a86cea86a0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | 32 | ||
| 33 | #include <linux/mutex.h> | 33 | #include <linux/mutex.h> |
| 34 | #include <linux/mlx5/driver.h> | 34 | #include <linux/mlx5/driver.h> |
| 35 | #include <linux/mlx5/eswitch.h> | ||
| 35 | 36 | ||
| 36 | #include "mlx5_core.h" | 37 | #include "mlx5_core.h" |
| 37 | #include "fs_core.h" | 38 | #include "fs_core.h" |
| @@ -2652,7 +2653,7 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) | |||
| 2652 | goto err; | 2653 | goto err; |
| 2653 | } | 2654 | } |
| 2654 | 2655 | ||
| 2655 | if (MLX5_CAP_GEN(dev, eswitch_flow_table)) { | 2656 | if (MLX5_ESWITCH_MANAGER(dev)) { |
| 2656 | if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, ft_support)) { | 2657 | if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, ft_support)) { |
| 2657 | err = init_fdb_root_ns(steering); | 2658 | err = init_fdb_root_ns(steering); |
| 2658 | if (err) | 2659 | if (err) |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw.c b/drivers/net/ethernet/mellanox/mlx5/core/fw.c index afd9f4fa22f4..41ad24f0de2c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fw.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fw.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | 32 | ||
| 33 | #include <linux/mlx5/driver.h> | 33 | #include <linux/mlx5/driver.h> |
| 34 | #include <linux/mlx5/cmd.h> | 34 | #include <linux/mlx5/cmd.h> |
| 35 | #include <linux/mlx5/eswitch.h> | ||
| 35 | #include <linux/module.h> | 36 | #include <linux/module.h> |
| 36 | #include "mlx5_core.h" | 37 | #include "mlx5_core.h" |
| 37 | #include "../../mlxfw/mlxfw.h" | 38 | #include "../../mlxfw/mlxfw.h" |
| @@ -159,13 +160,13 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev) | |||
| 159 | } | 160 | } |
| 160 | 161 | ||
| 161 | if (MLX5_CAP_GEN(dev, vport_group_manager) && | 162 | if (MLX5_CAP_GEN(dev, vport_group_manager) && |
| 162 | MLX5_CAP_GEN(dev, eswitch_flow_table)) { | 163 | MLX5_ESWITCH_MANAGER(dev)) { |
| 163 | err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH_FLOW_TABLE); | 164 | err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH_FLOW_TABLE); |
| 164 | if (err) | 165 | if (err) |
| 165 | return err; | 166 | return err; |
| 166 | } | 167 | } |
| 167 | 168 | ||
| 168 | if (MLX5_CAP_GEN(dev, eswitch_flow_table)) { | 169 | if (MLX5_ESWITCH_MANAGER(dev)) { |
| 169 | err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH); | 170 | err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH); |
| 170 | if (err) | 171 | if (err) |
| 171 | return err; | 172 | return err; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c index 7cb67122e8b5..98359559c77e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/etherdevice.h> | 33 | #include <linux/etherdevice.h> |
| 34 | #include <linux/mlx5/driver.h> | 34 | #include <linux/mlx5/driver.h> |
| 35 | #include <linux/mlx5/mlx5_ifc.h> | 35 | #include <linux/mlx5/mlx5_ifc.h> |
| 36 | #include <linux/mlx5/eswitch.h> | ||
| 36 | #include "mlx5_core.h" | 37 | #include "mlx5_core.h" |
| 37 | #include "lib/mpfs.h" | 38 | #include "lib/mpfs.h" |
| 38 | 39 | ||
| @@ -98,7 +99,7 @@ int mlx5_mpfs_init(struct mlx5_core_dev *dev) | |||
| 98 | int l2table_size = 1 << MLX5_CAP_GEN(dev, log_max_l2_table); | 99 | int l2table_size = 1 << MLX5_CAP_GEN(dev, log_max_l2_table); |
| 99 | struct mlx5_mpfs *mpfs; | 100 | struct mlx5_mpfs *mpfs; |
| 100 | 101 | ||
| 101 | if (!MLX5_VPORT_MANAGER(dev)) | 102 | if (!MLX5_ESWITCH_MANAGER(dev)) |
| 102 | return 0; | 103 | return 0; |
| 103 | 104 | ||
| 104 | mpfs = kzalloc(sizeof(*mpfs), GFP_KERNEL); | 105 | mpfs = kzalloc(sizeof(*mpfs), GFP_KERNEL); |
| @@ -122,7 +123,7 @@ void mlx5_mpfs_cleanup(struct mlx5_core_dev *dev) | |||
| 122 | { | 123 | { |
| 123 | struct mlx5_mpfs *mpfs = dev->priv.mpfs; | 124 | struct mlx5_mpfs *mpfs = dev->priv.mpfs; |
| 124 | 125 | ||
| 125 | if (!MLX5_VPORT_MANAGER(dev)) | 126 | if (!MLX5_ESWITCH_MANAGER(dev)) |
| 126 | return; | 127 | return; |
| 127 | 128 | ||
| 128 | WARN_ON(!hlist_empty(mpfs->hash)); | 129 | WARN_ON(!hlist_empty(mpfs->hash)); |
| @@ -137,7 +138,7 @@ int mlx5_mpfs_add_mac(struct mlx5_core_dev *dev, u8 *mac) | |||
| 137 | u32 index; | 138 | u32 index; |
| 138 | int err; | 139 | int err; |
| 139 | 140 | ||
| 140 | if (!MLX5_VPORT_MANAGER(dev)) | 141 | if (!MLX5_ESWITCH_MANAGER(dev)) |
| 141 | return 0; | 142 | return 0; |
| 142 | 143 | ||
| 143 | mutex_lock(&mpfs->lock); | 144 | mutex_lock(&mpfs->lock); |
| @@ -179,7 +180,7 @@ int mlx5_mpfs_del_mac(struct mlx5_core_dev *dev, u8 *mac) | |||
| 179 | int err = 0; | 180 | int err = 0; |
| 180 | u32 index; | 181 | u32 index; |
| 181 | 182 | ||
| 182 | if (!MLX5_VPORT_MANAGER(dev)) | 183 | if (!MLX5_ESWITCH_MANAGER(dev)) |
| 183 | return 0; | 184 | return 0; |
| 184 | 185 | ||
| 185 | mutex_lock(&mpfs->lock); | 186 | mutex_lock(&mpfs->lock); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/port.c b/drivers/net/ethernet/mellanox/mlx5/core/port.c index fa9d0760dd36..31a9cbd85689 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/port.c | |||
| @@ -701,7 +701,7 @@ EXPORT_SYMBOL_GPL(mlx5_query_port_prio_tc); | |||
| 701 | static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in, | 701 | static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in, |
| 702 | int inlen) | 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 | if (!MLX5_CAP_GEN(mdev, ets)) | 706 | if (!MLX5_CAP_GEN(mdev, ets)) |
| 707 | return -EOPNOTSUPP; | 707 | return -EOPNOTSUPP; |
| @@ -713,7 +713,7 @@ static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in, | |||
| 713 | static int mlx5_query_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *out, | 713 | static int mlx5_query_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *out, |
| 714 | int outlen) | 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 | if (!MLX5_CAP_GEN(mdev, ets)) | 718 | if (!MLX5_CAP_GEN(mdev, ets)) |
| 719 | return -EOPNOTSUPP; | 719 | return -EOPNOTSUPP; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c index 2a8b529ce6dd..a0674962f02c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c | |||
| @@ -88,6 +88,9 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs) | |||
| 88 | return -EBUSY; | 88 | return -EBUSY; |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | if (!MLX5_ESWITCH_MANAGER(dev)) | ||
| 92 | goto enable_vfs_hca; | ||
| 93 | |||
| 91 | err = mlx5_eswitch_enable_sriov(dev->priv.eswitch, num_vfs, SRIOV_LEGACY); | 94 | err = mlx5_eswitch_enable_sriov(dev->priv.eswitch, num_vfs, SRIOV_LEGACY); |
| 92 | if (err) { | 95 | if (err) { |
| 93 | mlx5_core_warn(dev, | 96 | mlx5_core_warn(dev, |
| @@ -95,6 +98,7 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs) | |||
| 95 | return err; | 98 | return err; |
| 96 | } | 99 | } |
| 97 | 100 | ||
| 101 | enable_vfs_hca: | ||
| 98 | for (vf = 0; vf < num_vfs; vf++) { | 102 | for (vf = 0; vf < num_vfs; vf++) { |
| 99 | err = mlx5_core_enable_hca(dev, vf + 1); | 103 | err = mlx5_core_enable_hca(dev, vf + 1); |
| 100 | if (err) { | 104 | if (err) { |
| @@ -140,7 +144,8 @@ static void mlx5_device_disable_sriov(struct mlx5_core_dev *dev) | |||
| 140 | } | 144 | } |
| 141 | 145 | ||
| 142 | out: | 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 | if (mlx5_wait_for_vf_pages(dev)) | 150 | if (mlx5_wait_for_vf_pages(dev)) |
| 146 | mlx5_core_warn(dev, "timeout reclaiming VFs pages\n"); | 151 | mlx5_core_warn(dev, "timeout reclaiming VFs pages\n"); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/vport.c b/drivers/net/ethernet/mellanox/mlx5/core/vport.c index 719cecb182c6..7eecd5b07bb1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/vport.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/vport.c | |||
| @@ -549,8 +549,6 @@ int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev, | |||
| 549 | return -EINVAL; | 549 | return -EINVAL; |
| 550 | if (!MLX5_CAP_GEN(mdev, vport_group_manager)) | 550 | if (!MLX5_CAP_GEN(mdev, vport_group_manager)) |
| 551 | return -EACCES; | 551 | return -EACCES; |
| 552 | if (!MLX5_CAP_ESW(mdev, nic_vport_node_guid_modify)) | ||
| 553 | return -EOPNOTSUPP; | ||
| 554 | 552 | ||
| 555 | in = kvzalloc(inlen, GFP_KERNEL); | 553 | in = kvzalloc(inlen, GFP_KERNEL); |
| 556 | if (!in) | 554 | if (!in) |
diff --git a/drivers/net/ethernet/netronome/nfp/bpf/main.c b/drivers/net/ethernet/netronome/nfp/bpf/main.c index fcdfb8e7fdea..40216d56dddc 100644 --- a/drivers/net/ethernet/netronome/nfp/bpf/main.c +++ b/drivers/net/ethernet/netronome/nfp/bpf/main.c | |||
| @@ -81,10 +81,10 @@ nfp_bpf_xdp_offload(struct nfp_app *app, struct nfp_net *nn, | |||
| 81 | 81 | ||
| 82 | ret = nfp_net_bpf_offload(nn, prog, running, extack); | 82 | ret = nfp_net_bpf_offload(nn, prog, running, extack); |
| 83 | /* Stop offload if replace not possible */ | 83 | /* Stop offload if replace not possible */ |
| 84 | if (ret && prog) | 84 | if (ret) |
| 85 | nfp_bpf_xdp_offload(app, nn, NULL, extack); | 85 | return ret; |
| 86 | 86 | ||
| 87 | nn->dp.bpf_offload_xdp = prog && !ret; | 87 | nn->dp.bpf_offload_xdp = !!prog; |
| 88 | return ret; | 88 | return ret; |
| 89 | } | 89 | } |
| 90 | 90 | ||
| @@ -202,6 +202,9 @@ static int nfp_bpf_setup_tc_block(struct net_device *netdev, | |||
| 202 | if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS) | 202 | if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS) |
| 203 | return -EOPNOTSUPP; | 203 | return -EOPNOTSUPP; |
| 204 | 204 | ||
| 205 | if (tcf_block_shared(f->block)) | ||
| 206 | return -EOPNOTSUPP; | ||
| 207 | |||
| 205 | switch (f->command) { | 208 | switch (f->command) { |
| 206 | case TC_BLOCK_BIND: | 209 | case TC_BLOCK_BIND: |
| 207 | return tcf_block_cb_register(f->block, | 210 | return tcf_block_cb_register(f->block, |
diff --git a/drivers/net/ethernet/netronome/nfp/flower/match.c b/drivers/net/ethernet/netronome/nfp/flower/match.c index 91935405f586..84f7a5dbea9d 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/match.c +++ b/drivers/net/ethernet/netronome/nfp/flower/match.c | |||
| @@ -123,6 +123,20 @@ nfp_flower_compile_mac(struct nfp_flower_mac_mpls *frame, | |||
| 123 | NFP_FLOWER_MASK_MPLS_Q; | 123 | NFP_FLOWER_MASK_MPLS_Q; |
| 124 | 124 | ||
| 125 | frame->mpls_lse = cpu_to_be32(t_mpls); | 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 | ||
diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c index c42e64f32333..525057bee0ed 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c | |||
| @@ -264,6 +264,14 @@ nfp_flower_calculate_key_layers(struct nfp_app *app, | |||
| 264 | case cpu_to_be16(ETH_P_ARP): | 264 | case cpu_to_be16(ETH_P_ARP): |
| 265 | return -EOPNOTSUPP; | 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 | /* Will be included in layer 2. */ | 275 | /* Will be included in layer 2. */ |
| 268 | case cpu_to_be16(ETH_P_8021Q): | 276 | case cpu_to_be16(ETH_P_8021Q): |
| 269 | break; | 277 | break; |
| @@ -623,6 +631,9 @@ static int nfp_flower_setup_tc_block(struct net_device *netdev, | |||
| 623 | if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS) | 631 | if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS) |
| 624 | return -EOPNOTSUPP; | 632 | return -EOPNOTSUPP; |
| 625 | 633 | ||
| 634 | if (tcf_block_shared(f->block)) | ||
| 635 | return -EOPNOTSUPP; | ||
| 636 | |||
| 626 | switch (f->command) { | 637 | switch (f->command) { |
| 627 | case TC_BLOCK_BIND: | 638 | case TC_BLOCK_BIND: |
| 628 | return tcf_block_cb_register(f->block, | 639 | return tcf_block_cb_register(f->block, |
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c index 46b76d5a726c..152283d7e59c 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c | |||
| @@ -240,7 +240,6 @@ static int nfp_pcie_sriov_read_nfd_limit(struct nfp_pf *pf) | |||
| 240 | return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs); | 240 | return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs); |
| 241 | 241 | ||
| 242 | pf->limit_vfs = ~0; | 242 | pf->limit_vfs = ~0; |
| 243 | pci_sriov_set_totalvfs(pf->pdev, 0); /* 0 is unset */ | ||
| 244 | /* Allow any setting for backwards compatibility if symbol not found */ | 243 | /* Allow any setting for backwards compatibility if symbol not found */ |
| 245 | if (err == -ENOENT) | 244 | if (err == -ENOENT) |
| 246 | return 0; | 245 | return 0; |
| @@ -668,7 +667,7 @@ static int nfp_pci_probe(struct pci_dev *pdev, | |||
| 668 | 667 | ||
| 669 | err = nfp_net_pci_probe(pf); | 668 | err = nfp_net_pci_probe(pf); |
| 670 | if (err) | 669 | if (err) |
| 671 | goto err_sriov_unlimit; | 670 | goto err_fw_unload; |
| 672 | 671 | ||
| 673 | err = nfp_hwmon_register(pf); | 672 | err = nfp_hwmon_register(pf); |
| 674 | if (err) { | 673 | if (err) { |
| @@ -680,8 +679,6 @@ static int nfp_pci_probe(struct pci_dev *pdev, | |||
| 680 | 679 | ||
| 681 | err_net_remove: | 680 | err_net_remove: |
| 682 | nfp_net_pci_remove(pf); | 681 | nfp_net_pci_remove(pf); |
| 683 | err_sriov_unlimit: | ||
| 684 | pci_sriov_set_totalvfs(pf->pdev, 0); | ||
| 685 | err_fw_unload: | 682 | err_fw_unload: |
| 686 | kfree(pf->rtbl); | 683 | kfree(pf->rtbl); |
| 687 | nfp_mip_close(pf->mip); | 684 | nfp_mip_close(pf->mip); |
| @@ -715,7 +712,6 @@ static void nfp_pci_remove(struct pci_dev *pdev) | |||
| 715 | nfp_hwmon_unregister(pf); | 712 | nfp_hwmon_unregister(pf); |
| 716 | 713 | ||
| 717 | nfp_pcie_sriov_disable(pdev); | 714 | nfp_pcie_sriov_disable(pdev); |
| 718 | pci_sriov_set_totalvfs(pf->pdev, 0); | ||
| 719 | 715 | ||
| 720 | nfp_net_pci_remove(pf); | 716 | nfp_net_pci_remove(pf); |
| 721 | 717 | ||
diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c index cd34097b79f1..37a6d7822a38 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c | |||
| @@ -232,7 +232,7 @@ struct nfp_nffw_info *nfp_nffw_info_open(struct nfp_cpp *cpp) | |||
| 232 | err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res), | 232 | err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res), |
| 233 | nfp_resource_address(state->res), | 233 | nfp_resource_address(state->res), |
| 234 | fwinf, sizeof(*fwinf)); | 234 | fwinf, sizeof(*fwinf)); |
| 235 | if (err < sizeof(*fwinf)) | 235 | if (err < (int)sizeof(*fwinf)) |
| 236 | goto err_release; | 236 | goto err_release; |
| 237 | 237 | ||
| 238 | if (!nffw_res_flg_init_get(fwinf)) | 238 | if (!nffw_res_flg_init_get(fwinf)) |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c index f0b01385d5cb..e0680ce91328 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c | |||
| @@ -709,9 +709,9 @@ qed_dcbx_get_local_lldp_params(struct qed_hwfn *p_hwfn, | |||
| 709 | p_local = &p_hwfn->p_dcbx_info->lldp_local[LLDP_NEAREST_BRIDGE]; | 709 | p_local = &p_hwfn->p_dcbx_info->lldp_local[LLDP_NEAREST_BRIDGE]; |
| 710 | 710 | ||
| 711 | memcpy(params->lldp_local.local_chassis_id, p_local->local_chassis_id, | 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 | memcpy(params->lldp_local.local_port_id, p_local->local_port_id, | 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 | static void | 717 | static void |
| @@ -723,9 +723,9 @@ qed_dcbx_get_remote_lldp_params(struct qed_hwfn *p_hwfn, | |||
| 723 | p_remote = &p_hwfn->p_dcbx_info->lldp_remote[LLDP_NEAREST_BRIDGE]; | 723 | p_remote = &p_hwfn->p_dcbx_info->lldp_remote[LLDP_NEAREST_BRIDGE]; |
| 724 | 724 | ||
| 725 | memcpy(params->lldp_remote.peer_chassis_id, p_remote->peer_chassis_id, | 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 | memcpy(params->lldp_remote.peer_port_id, p_remote->peer_port_id, | 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 | static int | 731 | static int |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c index 329781cda77f..e5249b4741d0 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dev.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c | |||
| @@ -1804,7 +1804,7 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params) | |||
| 1804 | DP_INFO(p_hwfn, "Failed to update driver state\n"); | 1804 | DP_INFO(p_hwfn, "Failed to update driver state\n"); |
| 1805 | 1805 | ||
| 1806 | rc = qed_mcp_ov_update_eswitch(p_hwfn, p_hwfn->p_main_ptt, | 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 | if (rc) | 1808 | if (rc) |
| 1809 | DP_INFO(p_hwfn, "Failed to update eswitch mode\n"); | 1809 | DP_INFO(p_hwfn, "Failed to update eswitch mode\n"); |
| 1810 | } | 1810 | } |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index 5c10fd7210c3..0cbc74d6ca8b 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c | |||
| @@ -789,6 +789,14 @@ static int qed_slowpath_setup_int(struct qed_dev *cdev, | |||
| 789 | /* We want a minimum of one slowpath and one fastpath vector per hwfn */ | 789 | /* We want a minimum of one slowpath and one fastpath vector per hwfn */ |
| 790 | cdev->int_params.in.min_msix_cnt = cdev->num_hwfns * 2; | 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 | rc = qed_set_int_mode(cdev, false); | 800 | rc = qed_set_int_mode(cdev, false); |
| 793 | if (rc) { | 801 | if (rc) { |
| 794 | DP_ERR(cdev, "qed_slowpath_setup_int ERR\n"); | 802 | DP_ERR(cdev, "qed_slowpath_setup_int ERR\n"); |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c b/drivers/net/ethernet/qlogic/qed/qed_sriov.c index f01bf52bc381..fd59cf45f4be 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c +++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c | |||
| @@ -4513,6 +4513,8 @@ static void qed_sriov_enable_qid_config(struct qed_hwfn *hwfn, | |||
| 4513 | static int qed_sriov_enable(struct qed_dev *cdev, int num) | 4513 | static int qed_sriov_enable(struct qed_dev *cdev, int num) |
| 4514 | { | 4514 | { |
| 4515 | struct qed_iov_vf_init_params params; | 4515 | struct qed_iov_vf_init_params params; |
| 4516 | struct qed_hwfn *hwfn; | ||
| 4517 | struct qed_ptt *ptt; | ||
| 4516 | int i, j, rc; | 4518 | int i, j, rc; |
| 4517 | 4519 | ||
| 4518 | if (num >= RESC_NUM(&cdev->hwfns[0], QED_VPORT)) { | 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) | |||
| 4525 | 4527 | ||
| 4526 | /* Initialize HW for VF access */ | 4528 | /* Initialize HW for VF access */ |
| 4527 | for_each_hwfn(cdev, j) { | 4529 | for_each_hwfn(cdev, j) { |
| 4528 | struct qed_hwfn *hwfn = &cdev->hwfns[j]; | 4530 | hwfn = &cdev->hwfns[j]; |
| 4529 | struct qed_ptt *ptt = qed_ptt_acquire(hwfn); | 4531 | ptt = qed_ptt_acquire(hwfn); |
| 4530 | 4532 | ||
| 4531 | /* Make sure not to use more than 16 queues per VF */ | 4533 | /* Make sure not to use more than 16 queues per VF */ |
| 4532 | params.num_queues = min_t(int, | 4534 | params.num_queues = min_t(int, |
| @@ -4562,6 +4564,19 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num) | |||
| 4562 | goto err; | 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 | return num; | 4580 | return num; |
| 4566 | 4581 | ||
| 4567 | err: | 4582 | err: |
diff --git a/drivers/net/ethernet/qlogic/qede/qede_ptp.c b/drivers/net/ethernet/qlogic/qede/qede_ptp.c index 02adb513f475..013ff567283c 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_ptp.c +++ b/drivers/net/ethernet/qlogic/qede/qede_ptp.c | |||
| @@ -337,8 +337,14 @@ int qede_ptp_get_ts_info(struct qede_dev *edev, struct ethtool_ts_info *info) | |||
| 337 | { | 337 | { |
| 338 | struct qede_ptp *ptp = edev->ptp; | 338 | struct qede_ptp *ptp = edev->ptp; |
| 339 | 339 | ||
| 340 | if (!ptp) | 340 | if (!ptp) { |
| 341 | return -EIO; | 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 | info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE | | 349 | info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE | |
| 344 | SOF_TIMESTAMPING_RX_SOFTWARE | | 350 | SOF_TIMESTAMPING_RX_SOFTWARE | |
diff --git a/drivers/net/ethernet/sfc/farch.c b/drivers/net/ethernet/sfc/farch.c index 8edf20967c82..e045a5d6b938 100644 --- a/drivers/net/ethernet/sfc/farch.c +++ b/drivers/net/ethernet/sfc/farch.c | |||
| @@ -2794,6 +2794,7 @@ int efx_farch_filter_table_probe(struct efx_nic *efx) | |||
| 2794 | if (!state) | 2794 | if (!state) |
| 2795 | return -ENOMEM; | 2795 | return -ENOMEM; |
| 2796 | efx->filter_state = state; | 2796 | efx->filter_state = state; |
| 2797 | init_rwsem(&state->lock); | ||
| 2797 | 2798 | ||
| 2798 | table = &state->table[EFX_FARCH_FILTER_TABLE_RX_IP]; | 2799 | table = &state->table[EFX_FARCH_FILTER_TABLE_RX_IP]; |
| 2799 | table->id = EFX_FARCH_FILTER_TABLE_RX_IP; | 2800 | table->id = EFX_FARCH_FILTER_TABLE_RX_IP; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c index d37f17ca62fe..65bc3556bd8f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | |||
| @@ -407,6 +407,16 @@ static void dwmac4_enable_tso(void __iomem *ioaddr, bool en, u32 chan) | |||
| 407 | } | 407 | } |
| 408 | } | 408 | } |
| 409 | 409 | ||
| 410 | static void dwmac4_set_bfsize(void __iomem *ioaddr, int bfsize, u32 chan) | ||
| 411 | { | ||
| 412 | u32 value = readl(ioaddr + DMA_CHAN_RX_CONTROL(chan)); | ||
| 413 | |||
| 414 | value &= ~DMA_RBSZ_MASK; | ||
| 415 | value |= (bfsize << DMA_RBSZ_SHIFT) & DMA_RBSZ_MASK; | ||
| 416 | |||
| 417 | writel(value, ioaddr + DMA_CHAN_RX_CONTROL(chan)); | ||
| 418 | } | ||
| 419 | |||
| 410 | const struct stmmac_dma_ops dwmac4_dma_ops = { | 420 | const struct stmmac_dma_ops dwmac4_dma_ops = { |
| 411 | .reset = dwmac4_dma_reset, | 421 | .reset = dwmac4_dma_reset, |
| 412 | .init = dwmac4_dma_init, | 422 | .init = dwmac4_dma_init, |
| @@ -431,6 +441,7 @@ const struct stmmac_dma_ops dwmac4_dma_ops = { | |||
| 431 | .set_rx_tail_ptr = dwmac4_set_rx_tail_ptr, | 441 | .set_rx_tail_ptr = dwmac4_set_rx_tail_ptr, |
| 432 | .set_tx_tail_ptr = dwmac4_set_tx_tail_ptr, | 442 | .set_tx_tail_ptr = dwmac4_set_tx_tail_ptr, |
| 433 | .enable_tso = dwmac4_enable_tso, | 443 | .enable_tso = dwmac4_enable_tso, |
| 444 | .set_bfsize = dwmac4_set_bfsize, | ||
| 434 | }; | 445 | }; |
| 435 | 446 | ||
| 436 | const struct stmmac_dma_ops dwmac410_dma_ops = { | 447 | const struct stmmac_dma_ops dwmac410_dma_ops = { |
| @@ -457,4 +468,5 @@ const struct stmmac_dma_ops dwmac410_dma_ops = { | |||
| 457 | .set_rx_tail_ptr = dwmac4_set_rx_tail_ptr, | 468 | .set_rx_tail_ptr = dwmac4_set_rx_tail_ptr, |
| 458 | .set_tx_tail_ptr = dwmac4_set_tx_tail_ptr, | 469 | .set_tx_tail_ptr = dwmac4_set_tx_tail_ptr, |
| 459 | .enable_tso = dwmac4_enable_tso, | 470 | .enable_tso = dwmac4_enable_tso, |
| 471 | .set_bfsize = dwmac4_set_bfsize, | ||
| 460 | }; | 472 | }; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h index c63c1fe3f26b..22a4a6dbb1a4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h | |||
| @@ -120,6 +120,8 @@ | |||
| 120 | 120 | ||
| 121 | /* DMA Rx Channel X Control register defines */ | 121 | /* DMA Rx Channel X Control register defines */ |
| 122 | #define DMA_CONTROL_SR BIT(0) | 122 | #define DMA_CONTROL_SR BIT(0) |
| 123 | #define DMA_RBSZ_MASK GENMASK(14, 1) | ||
| 124 | #define DMA_RBSZ_SHIFT 1 | ||
| 123 | 125 | ||
| 124 | /* Interrupt status per channel */ | 126 | /* Interrupt status per channel */ |
| 125 | #define DMA_CHAN_STATUS_REB GENMASK(21, 19) | 127 | #define DMA_CHAN_STATUS_REB GENMASK(21, 19) |
diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h index e44e7b26ce82..fe8b536b13f8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h | |||
| @@ -183,6 +183,7 @@ struct stmmac_dma_ops { | |||
| 183 | void (*set_rx_tail_ptr)(void __iomem *ioaddr, u32 tail_ptr, u32 chan); | 183 | void (*set_rx_tail_ptr)(void __iomem *ioaddr, u32 tail_ptr, u32 chan); |
| 184 | void (*set_tx_tail_ptr)(void __iomem *ioaddr, u32 tail_ptr, u32 chan); | 184 | void (*set_tx_tail_ptr)(void __iomem *ioaddr, u32 tail_ptr, u32 chan); |
| 185 | void (*enable_tso)(void __iomem *ioaddr, bool en, u32 chan); | 185 | void (*enable_tso)(void __iomem *ioaddr, bool en, u32 chan); |
| 186 | void (*set_bfsize)(void __iomem *ioaddr, int bfsize, u32 chan); | ||
| 186 | }; | 187 | }; |
| 187 | 188 | ||
| 188 | #define stmmac_reset(__priv, __args...) \ | 189 | #define stmmac_reset(__priv, __args...) \ |
| @@ -235,6 +236,8 @@ struct stmmac_dma_ops { | |||
| 235 | stmmac_do_void_callback(__priv, dma, set_tx_tail_ptr, __args) | 236 | stmmac_do_void_callback(__priv, dma, set_tx_tail_ptr, __args) |
| 236 | #define stmmac_enable_tso(__priv, __args...) \ | 237 | #define stmmac_enable_tso(__priv, __args...) \ |
| 237 | stmmac_do_void_callback(__priv, dma, enable_tso, __args) | 238 | stmmac_do_void_callback(__priv, dma, enable_tso, __args) |
| 239 | #define stmmac_set_dma_bfsize(__priv, __args...) \ | ||
| 240 | stmmac_do_void_callback(__priv, dma, set_bfsize, __args) | ||
| 238 | 241 | ||
| 239 | struct mac_device_info; | 242 | struct mac_device_info; |
| 240 | struct net_device; | 243 | struct net_device; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index cba46b62a1cd..60f59abab009 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
| @@ -1804,6 +1804,8 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv) | |||
| 1804 | 1804 | ||
| 1805 | stmmac_dma_rx_mode(priv, priv->ioaddr, rxmode, chan, | 1805 | stmmac_dma_rx_mode(priv, priv->ioaddr, rxmode, chan, |
| 1806 | rxfifosz, qmode); | 1806 | rxfifosz, qmode); |
| 1807 | stmmac_set_dma_bfsize(priv, priv->ioaddr, priv->dma_buf_sz, | ||
| 1808 | chan); | ||
| 1807 | } | 1809 | } |
| 1808 | 1810 | ||
| 1809 | for (chan = 0; chan < tx_channels_count; chan++) { | 1811 | for (chan = 0; chan < tx_channels_count; chan++) { |
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index 750eaa53bf0c..ada33c2d9ac2 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c | |||
| @@ -476,7 +476,7 @@ static struct sk_buff **geneve_gro_receive(struct sock *sk, | |||
| 476 | out_unlock: | 476 | out_unlock: |
| 477 | rcu_read_unlock(); | 477 | rcu_read_unlock(); |
| 478 | out: | 478 | out: |
| 479 | NAPI_GRO_CB(skb)->flush |= flush; | 479 | skb_gro_flush_final(skb, pp, flush); |
| 480 | 480 | ||
| 481 | return pp; | 481 | return pp; |
| 482 | } | 482 | } |
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 1a924b867b07..4b6e308199d2 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h | |||
| @@ -210,7 +210,7 @@ int netvsc_recv_callback(struct net_device *net, | |||
| 210 | void netvsc_channel_cb(void *context); | 210 | void netvsc_channel_cb(void *context); |
| 211 | int netvsc_poll(struct napi_struct *napi, int budget); | 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 | int rndis_filter_open(struct netvsc_device *nvdev); | 214 | int rndis_filter_open(struct netvsc_device *nvdev); |
| 215 | int rndis_filter_close(struct netvsc_device *nvdev); | 215 | int rndis_filter_close(struct netvsc_device *nvdev); |
| 216 | struct netvsc_device *rndis_filter_device_add(struct hv_device *dev, | 216 | struct netvsc_device *rndis_filter_device_add(struct hv_device *dev, |
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 5d5bd513847f..8e9d0ee1572b 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c | |||
| @@ -65,6 +65,41 @@ void netvsc_switch_datapath(struct net_device *ndev, bool vf) | |||
| 65 | VM_PKT_DATA_INBAND, 0); | 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 | static struct netvsc_device *alloc_net_device(void) | 103 | static struct netvsc_device *alloc_net_device(void) |
| 69 | { | 104 | { |
| 70 | struct netvsc_device *net_device; | 105 | struct netvsc_device *net_device; |
| @@ -81,7 +116,7 @@ static struct netvsc_device *alloc_net_device(void) | |||
| 81 | 116 | ||
| 82 | init_completion(&net_device->channel_init_wait); | 117 | init_completion(&net_device->channel_init_wait); |
| 83 | init_waitqueue_head(&net_device->subchan_open); | 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 | return net_device; | 121 | return net_device; |
| 87 | } | 122 | } |
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index fe2256bf1d13..dd1d6e115145 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
| @@ -905,8 +905,20 @@ static int netvsc_attach(struct net_device *ndev, | |||
| 905 | if (IS_ERR(nvdev)) | 905 | if (IS_ERR(nvdev)) |
| 906 | return PTR_ERR(nvdev); | 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 | netif_carrier_off(ndev); | 922 | netif_carrier_off(ndev); |
| 911 | 923 | ||
| 912 | if (netif_running(ndev)) { | 924 | if (netif_running(ndev)) { |
| @@ -2089,6 +2101,9 @@ static int netvsc_probe(struct hv_device *dev, | |||
| 2089 | 2101 | ||
| 2090 | memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN); | 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 | /* hw_features computed in rndis_netdev_set_hwcaps() */ | 2107 | /* hw_features computed in rndis_netdev_set_hwcaps() */ |
| 2093 | net->features = net->hw_features | | 2108 | net->features = net->hw_features | |
| 2094 | NETIF_F_HIGHDMA | NETIF_F_SG | | 2109 | NETIF_F_HIGHDMA | NETIF_F_SG | |
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 5428bb261102..9b4e3c3787e5 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c | |||
| @@ -1062,29 +1062,15 @@ static void netvsc_sc_open(struct vmbus_channel *new_sc) | |||
| 1062 | * This breaks overlap of processing the host message for the | 1062 | * This breaks overlap of processing the host message for the |
| 1063 | * new primary channel with the initialization of sub-channels. | 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 | struct nvsp_message *init_packet = &nvdev->channel_init_pkt; | 1067 | struct nvsp_message *init_packet = &nvdev->channel_init_pkt; |
| 1070 | struct net_device_context *ndev_ctx; | 1068 | struct net_device_context *ndev_ctx = netdev_priv(ndev); |
| 1071 | struct rndis_device *rdev; | 1069 | struct hv_device *hv_dev = ndev_ctx->device_ctx; |
| 1072 | struct net_device *ndev; | 1070 | struct rndis_device *rdev = nvdev->extension; |
| 1073 | struct hv_device *hv_dev; | ||
| 1074 | int i, ret; | 1071 | int i, ret; |
| 1075 | 1072 | ||
| 1076 | if (!rtnl_trylock()) { | 1073 | ASSERT_RTNL(); |
| 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; | ||
| 1088 | 1074 | ||
| 1089 | memset(init_packet, 0, sizeof(struct nvsp_message)); | 1075 | memset(init_packet, 0, sizeof(struct nvsp_message)); |
| 1090 | init_packet->hdr.msg_type = NVSP_MSG5_TYPE_SUBCHANNEL; | 1076 | init_packet->hdr.msg_type = NVSP_MSG5_TYPE_SUBCHANNEL; |
| @@ -1100,13 +1086,13 @@ void rndis_set_subchannel(struct work_struct *w) | |||
| 1100 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); | 1086 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); |
| 1101 | if (ret) { | 1087 | if (ret) { |
| 1102 | netdev_err(ndev, "sub channel allocate send failed: %d\n", ret); | 1088 | netdev_err(ndev, "sub channel allocate send failed: %d\n", ret); |
| 1103 | goto failed; | 1089 | return ret; |
| 1104 | } | 1090 | } |
| 1105 | 1091 | ||
| 1106 | wait_for_completion(&nvdev->channel_init_wait); | 1092 | wait_for_completion(&nvdev->channel_init_wait); |
| 1107 | if (init_packet->msg.v5_msg.subchn_comp.status != NVSP_STAT_SUCCESS) { | 1093 | if (init_packet->msg.v5_msg.subchn_comp.status != NVSP_STAT_SUCCESS) { |
| 1108 | netdev_err(ndev, "sub channel request failed\n"); | 1094 | netdev_err(ndev, "sub channel request failed\n"); |
| 1109 | goto failed; | 1095 | return -EIO; |
| 1110 | } | 1096 | } |
| 1111 | 1097 | ||
| 1112 | nvdev->num_chn = 1 + | 1098 | nvdev->num_chn = 1 + |
| @@ -1125,21 +1111,7 @@ void rndis_set_subchannel(struct work_struct *w) | |||
| 1125 | for (i = 0; i < VRSS_SEND_TAB_SIZE; i++) | 1111 | for (i = 0; i < VRSS_SEND_TAB_SIZE; i++) |
| 1126 | ndev_ctx->tx_table[i] = i % nvdev->num_chn; | 1112 | ndev_ctx->tx_table[i] = i % nvdev->num_chn; |
| 1127 | 1113 | ||
| 1128 | netif_device_attach(ndev); | 1114 | return 0; |
| 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(); | ||
| 1143 | } | 1115 | } |
| 1144 | 1116 | ||
| 1145 | static int rndis_netdev_set_hwcaps(struct rndis_device *rndis_device, | 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, | |||
| 1360 | netif_napi_add(net, &net_device->chan_table[i].napi, | 1332 | netif_napi_add(net, &net_device->chan_table[i].napi, |
| 1361 | netvsc_poll, NAPI_POLL_WEIGHT); | 1333 | netvsc_poll, NAPI_POLL_WEIGHT); |
| 1362 | 1334 | ||
| 1363 | if (net_device->num_chn > 1) | 1335 | return net_device; |
| 1364 | schedule_work(&net_device->subchan_work); | ||
| 1365 | 1336 | ||
| 1366 | out: | 1337 | out: |
| 1367 | /* if unavailable, just proceed with one queue */ | 1338 | /* setting up multiple channels failed */ |
| 1368 | if (ret) { | 1339 | net_device->max_chn = 1; |
| 1369 | net_device->max_chn = 1; | 1340 | net_device->num_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; | ||
| 1378 | 1341 | ||
| 1379 | err_dev_remv: | 1342 | err_dev_remv: |
| 1380 | rndis_filter_device_remove(dev, net_device); | 1343 | rndis_filter_device_remove(dev, net_device); |
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 23c1d6600241..4a949569ec4c 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c | |||
| @@ -75,10 +75,23 @@ static int ipvlan_set_port_mode(struct ipvl_port *port, u16 nval) | |||
| 75 | { | 75 | { |
| 76 | struct ipvl_dev *ipvlan; | 76 | struct ipvl_dev *ipvlan; |
| 77 | struct net_device *mdev = port->dev; | 77 | struct net_device *mdev = port->dev; |
| 78 | int err = 0; | 78 | unsigned int flags; |
| 79 | int err; | ||
| 79 | 80 | ||
| 80 | ASSERT_RTNL(); | 81 | ASSERT_RTNL(); |
| 81 | if (port->mode != nval) { | 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 | if (nval == IPVLAN_MODE_L3S) { | 95 | if (nval == IPVLAN_MODE_L3S) { |
| 83 | /* New mode is L3S */ | 96 | /* New mode is L3S */ |
| 84 | err = ipvlan_register_nf_hook(read_pnet(&port->pnet)); | 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) | |||
| 86 | mdev->l3mdev_ops = &ipvl_l3mdev_ops; | 99 | mdev->l3mdev_ops = &ipvl_l3mdev_ops; |
| 87 | mdev->priv_flags |= IFF_L3MDEV_MASTER; | 100 | mdev->priv_flags |= IFF_L3MDEV_MASTER; |
| 88 | } else | 101 | } else |
| 89 | return err; | 102 | goto fail; |
| 90 | } else if (port->mode == IPVLAN_MODE_L3S) { | 103 | } else if (port->mode == IPVLAN_MODE_L3S) { |
| 91 | /* Old mode was L3S */ | 104 | /* Old mode was L3S */ |
| 92 | mdev->priv_flags &= ~IFF_L3MDEV_MASTER; | 105 | mdev->priv_flags &= ~IFF_L3MDEV_MASTER; |
| 93 | ipvlan_unregister_nf_hook(read_pnet(&port->pnet)); | 106 | ipvlan_unregister_nf_hook(read_pnet(&port->pnet)); |
| 94 | mdev->l3mdev_ops = NULL; | 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 | port->mode = nval; | 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 | return err; | 124 | return err; |
| 105 | } | 125 | } |
| 106 | 126 | ||
diff --git a/drivers/net/phy/dp83tc811.c b/drivers/net/phy/dp83tc811.c index 081d99aa3985..49ac678eb2dc 100644 --- a/drivers/net/phy/dp83tc811.c +++ b/drivers/net/phy/dp83tc811.c | |||
| @@ -222,7 +222,7 @@ static int dp83811_config_intr(struct phy_device *phydev) | |||
| 222 | if (err < 0) | 222 | if (err < 0) |
| 223 | return err; | 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 | return err; | 228 | return err; |
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c index de51e8f70f44..ce61231e96ea 100644 --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c | |||
| @@ -1107,7 +1107,7 @@ static const struct proto_ops pppoe_ops = { | |||
| 1107 | .socketpair = sock_no_socketpair, | 1107 | .socketpair = sock_no_socketpair, |
| 1108 | .accept = sock_no_accept, | 1108 | .accept = sock_no_accept, |
| 1109 | .getname = pppoe_getname, | 1109 | .getname = pppoe_getname, |
| 1110 | .poll_mask = datagram_poll_mask, | 1110 | .poll = datagram_poll, |
| 1111 | .listen = sock_no_listen, | 1111 | .listen = sock_no_listen, |
| 1112 | .shutdown = sock_no_shutdown, | 1112 | .shutdown = sock_no_shutdown, |
| 1113 | .setsockopt = sock_no_setsockopt, | 1113 | .setsockopt = sock_no_setsockopt, |
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 8dff87ec6d99..2e4130746c40 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c | |||
| @@ -64,6 +64,7 @@ | |||
| 64 | #define DEFAULT_RX_CSUM_ENABLE (true) | 64 | #define DEFAULT_RX_CSUM_ENABLE (true) |
| 65 | #define DEFAULT_TSO_CSUM_ENABLE (true) | 65 | #define DEFAULT_TSO_CSUM_ENABLE (true) |
| 66 | #define DEFAULT_VLAN_FILTER_ENABLE (true) | 66 | #define DEFAULT_VLAN_FILTER_ENABLE (true) |
| 67 | #define DEFAULT_VLAN_RX_OFFLOAD (true) | ||
| 67 | #define TX_OVERHEAD (8) | 68 | #define TX_OVERHEAD (8) |
| 68 | #define RXW_PADDING 2 | 69 | #define RXW_PADDING 2 |
| 69 | 70 | ||
| @@ -2298,7 +2299,7 @@ static int lan78xx_change_mtu(struct net_device *netdev, int new_mtu) | |||
| 2298 | if ((ll_mtu % dev->maxpacket) == 0) | 2299 | if ((ll_mtu % dev->maxpacket) == 0) |
| 2299 | return -EDOM; | 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 | netdev->mtu = new_mtu; | 2304 | netdev->mtu = new_mtu; |
| 2304 | 2305 | ||
| @@ -2364,6 +2365,11 @@ static int lan78xx_set_features(struct net_device *netdev, | |||
| 2364 | } | 2365 | } |
| 2365 | 2366 | ||
| 2366 | if (features & NETIF_F_HW_VLAN_CTAG_RX) | 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 | pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_; | 2373 | pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_; |
| 2368 | else | 2374 | else |
| 2369 | pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_; | 2375 | pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_; |
| @@ -2587,7 +2593,8 @@ static int lan78xx_reset(struct lan78xx_net *dev) | |||
| 2587 | buf |= FCT_TX_CTL_EN_; | 2593 | buf |= FCT_TX_CTL_EN_; |
| 2588 | ret = lan78xx_write_reg(dev, FCT_TX_CTL, buf); | 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 | ret = lan78xx_read_reg(dev, MAC_RX, &buf); | 2599 | ret = lan78xx_read_reg(dev, MAC_RX, &buf); |
| 2593 | buf |= MAC_RX_RXEN_; | 2600 | buf |= MAC_RX_RXEN_; |
| @@ -2975,6 +2982,12 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) | |||
| 2975 | if (DEFAULT_TSO_CSUM_ENABLE) | 2982 | if (DEFAULT_TSO_CSUM_ENABLE) |
| 2976 | dev->net->features |= NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG; | 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 | dev->net->hw_features = dev->net->features; | 2991 | dev->net->hw_features = dev->net->features; |
| 2979 | 2992 | ||
| 2980 | ret = lan78xx_setup_irq_domain(dev); | 2993 | ret = lan78xx_setup_irq_domain(dev); |
| @@ -3039,8 +3052,13 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev, | |||
| 3039 | struct sk_buff *skb, | 3052 | struct sk_buff *skb, |
| 3040 | u32 rx_cmd_a, u32 rx_cmd_b) | 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 | if (!(dev->net->features & NETIF_F_RXCSUM) || | 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 | skb->ip_summed = CHECKSUM_NONE; | 3062 | skb->ip_summed = CHECKSUM_NONE; |
| 3045 | } else { | 3063 | } else { |
| 3046 | skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_)); | 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, | |||
| 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 | static void lan78xx_skb_return(struct lan78xx_net *dev, struct sk_buff *skb) | 3079 | static void lan78xx_skb_return(struct lan78xx_net *dev, struct sk_buff *skb) |
| 3052 | { | 3080 | { |
| 3053 | int status; | 3081 | int status; |
| @@ -3112,6 +3140,8 @@ static int lan78xx_rx(struct lan78xx_net *dev, struct sk_buff *skb) | |||
| 3112 | if (skb->len == size) { | 3140 | if (skb->len == size) { |
| 3113 | lan78xx_rx_csum_offload(dev, skb, | 3141 | lan78xx_rx_csum_offload(dev, skb, |
| 3114 | rx_cmd_a, rx_cmd_b); | 3142 | rx_cmd_a, rx_cmd_b); |
| 3143 | lan78xx_rx_vlan_offload(dev, skb, | ||
| 3144 | rx_cmd_a, rx_cmd_b); | ||
| 3115 | 3145 | ||
| 3116 | skb_trim(skb, skb->len - 4); /* remove fcs */ | 3146 | skb_trim(skb, skb->len - 4); /* remove fcs */ |
| 3117 | skb->truesize = size + sizeof(struct sk_buff); | 3147 | skb->truesize = size + sizeof(struct sk_buff); |
| @@ -3130,6 +3160,7 @@ static int lan78xx_rx(struct lan78xx_net *dev, struct sk_buff *skb) | |||
| 3130 | skb_set_tail_pointer(skb2, size); | 3160 | skb_set_tail_pointer(skb2, size); |
| 3131 | 3161 | ||
| 3132 | lan78xx_rx_csum_offload(dev, skb2, rx_cmd_a, rx_cmd_b); | 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 | skb_trim(skb2, skb2->len - 4); /* remove fcs */ | 3165 | skb_trim(skb2, skb2->len - 4); /* remove fcs */ |
| 3135 | skb2->truesize = size + sizeof(struct sk_buff); | 3166 | skb2->truesize = size + sizeof(struct sk_buff); |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 86f7196f9d91..2a58607a6aea 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
| @@ -3962,7 +3962,8 @@ static int rtl8152_close(struct net_device *netdev) | |||
| 3962 | #ifdef CONFIG_PM_SLEEP | 3962 | #ifdef CONFIG_PM_SLEEP |
| 3963 | unregister_pm_notifier(&tp->pm_notifier); | 3963 | unregister_pm_notifier(&tp->pm_notifier); |
| 3964 | #endif | 3964 | #endif |
| 3965 | napi_disable(&tp->napi); | 3965 | if (!test_bit(RTL8152_UNPLUG, &tp->flags)) |
| 3966 | napi_disable(&tp->napi); | ||
| 3966 | clear_bit(WORK_ENABLE, &tp->flags); | 3967 | clear_bit(WORK_ENABLE, &tp->flags); |
| 3967 | usb_kill_urb(tp->intr_urb); | 3968 | usb_kill_urb(tp->intr_urb); |
| 3968 | cancel_delayed_work_sync(&tp->schedule); | 3969 | cancel_delayed_work_sync(&tp->schedule); |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index b6c9a2af3732..53085c63277b 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
| @@ -53,6 +53,10 @@ module_param(napi_tx, bool, 0644); | |||
| 53 | /* Amount of XDP headroom to prepend to packets for use by xdp_adjust_head */ | 53 | /* Amount of XDP headroom to prepend to packets for use by xdp_adjust_head */ |
| 54 | #define VIRTIO_XDP_HEADROOM 256 | 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 | /* RX packet size EWMA. The average packet size is used to determine the packet | 60 | /* RX packet size EWMA. The average packet size is used to determine the packet |
| 57 | * buffer size when refilling RX rings. As the entire RX ring may be refilled | 61 | * buffer size when refilling RX rings. As the entire RX ring may be refilled |
| 58 | * at once, the weight is chosen so that the EWMA will be insensitive to short- | 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, | |||
| 582 | struct receive_queue *rq, | 586 | struct receive_queue *rq, |
| 583 | void *buf, void *ctx, | 587 | void *buf, void *ctx, |
| 584 | unsigned int len, | 588 | unsigned int len, |
| 585 | bool *xdp_xmit) | 589 | unsigned int *xdp_xmit) |
| 586 | { | 590 | { |
| 587 | struct sk_buff *skb; | 591 | struct sk_buff *skb; |
| 588 | struct bpf_prog *xdp_prog; | 592 | struct bpf_prog *xdp_prog; |
| @@ -654,14 +658,14 @@ static struct sk_buff *receive_small(struct net_device *dev, | |||
| 654 | trace_xdp_exception(vi->dev, xdp_prog, act); | 658 | trace_xdp_exception(vi->dev, xdp_prog, act); |
| 655 | goto err_xdp; | 659 | goto err_xdp; |
| 656 | } | 660 | } |
| 657 | *xdp_xmit = true; | 661 | *xdp_xmit |= VIRTIO_XDP_TX; |
| 658 | rcu_read_unlock(); | 662 | rcu_read_unlock(); |
| 659 | goto xdp_xmit; | 663 | goto xdp_xmit; |
| 660 | case XDP_REDIRECT: | 664 | case XDP_REDIRECT: |
| 661 | err = xdp_do_redirect(dev, &xdp, xdp_prog); | 665 | err = xdp_do_redirect(dev, &xdp, xdp_prog); |
| 662 | if (err) | 666 | if (err) |
| 663 | goto err_xdp; | 667 | goto err_xdp; |
| 664 | *xdp_xmit = true; | 668 | *xdp_xmit |= VIRTIO_XDP_REDIR; |
| 665 | rcu_read_unlock(); | 669 | rcu_read_unlock(); |
| 666 | goto xdp_xmit; | 670 | goto xdp_xmit; |
| 667 | default: | 671 | default: |
| @@ -723,7 +727,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, | |||
| 723 | void *buf, | 727 | void *buf, |
| 724 | void *ctx, | 728 | void *ctx, |
| 725 | unsigned int len, | 729 | unsigned int len, |
| 726 | bool *xdp_xmit) | 730 | unsigned int *xdp_xmit) |
| 727 | { | 731 | { |
| 728 | struct virtio_net_hdr_mrg_rxbuf *hdr = buf; | 732 | struct virtio_net_hdr_mrg_rxbuf *hdr = buf; |
| 729 | u16 num_buf = virtio16_to_cpu(vi->vdev, hdr->num_buffers); | 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, | |||
| 818 | put_page(xdp_page); | 822 | put_page(xdp_page); |
| 819 | goto err_xdp; | 823 | goto err_xdp; |
| 820 | } | 824 | } |
| 821 | *xdp_xmit = true; | 825 | *xdp_xmit |= VIRTIO_XDP_TX; |
| 822 | if (unlikely(xdp_page != page)) | 826 | if (unlikely(xdp_page != page)) |
| 823 | put_page(page); | 827 | put_page(page); |
| 824 | rcu_read_unlock(); | 828 | rcu_read_unlock(); |
| @@ -830,7 +834,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, | |||
| 830 | put_page(xdp_page); | 834 | put_page(xdp_page); |
| 831 | goto err_xdp; | 835 | goto err_xdp; |
| 832 | } | 836 | } |
| 833 | *xdp_xmit = true; | 837 | *xdp_xmit |= VIRTIO_XDP_REDIR; |
| 834 | if (unlikely(xdp_page != page)) | 838 | if (unlikely(xdp_page != page)) |
| 835 | put_page(page); | 839 | put_page(page); |
| 836 | rcu_read_unlock(); | 840 | rcu_read_unlock(); |
| @@ -939,7 +943,8 @@ xdp_xmit: | |||
| 939 | } | 943 | } |
| 940 | 944 | ||
| 941 | static int receive_buf(struct virtnet_info *vi, struct receive_queue *rq, | 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 | struct net_device *dev = vi->dev; | 949 | struct net_device *dev = vi->dev; |
| 945 | struct sk_buff *skb; | 950 | struct sk_buff *skb; |
| @@ -1232,7 +1237,8 @@ static void refill_work(struct work_struct *work) | |||
| 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 | struct virtnet_info *vi = rq->vq->vdev->priv; | 1243 | struct virtnet_info *vi = rq->vq->vdev->priv; |
| 1238 | unsigned int len, received = 0, bytes = 0; | 1244 | unsigned int len, received = 0, bytes = 0; |
| @@ -1321,7 +1327,7 @@ static int virtnet_poll(struct napi_struct *napi, int budget) | |||
| 1321 | struct virtnet_info *vi = rq->vq->vdev->priv; | 1327 | struct virtnet_info *vi = rq->vq->vdev->priv; |
| 1322 | struct send_queue *sq; | 1328 | struct send_queue *sq; |
| 1323 | unsigned int received, qp; | 1329 | unsigned int received, qp; |
| 1324 | bool xdp_xmit = false; | 1330 | unsigned int xdp_xmit = 0; |
| 1325 | 1331 | ||
| 1326 | virtnet_poll_cleantx(rq); | 1332 | virtnet_poll_cleantx(rq); |
| 1327 | 1333 | ||
| @@ -1331,12 +1337,14 @@ static int virtnet_poll(struct napi_struct *napi, int budget) | |||
| 1331 | if (received < budget) | 1337 | if (received < budget) |
| 1332 | virtqueue_napi_complete(napi, rq->vq, received); | 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 | qp = vi->curr_queue_pairs - vi->xdp_queue_pairs + | 1344 | qp = vi->curr_queue_pairs - vi->xdp_queue_pairs + |
| 1336 | smp_processor_id(); | 1345 | smp_processor_id(); |
| 1337 | sq = &vi->sq[qp]; | 1346 | sq = &vi->sq[qp]; |
| 1338 | virtqueue_kick(sq->vq); | 1347 | virtqueue_kick(sq->vq); |
| 1339 | xdp_do_flush_map(); | ||
| 1340 | } | 1348 | } |
| 1341 | 1349 | ||
| 1342 | return received; | 1350 | return received; |
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index aee0e60471f1..f6bb1d54d4bd 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
| @@ -623,9 +623,7 @@ static struct sk_buff **vxlan_gro_receive(struct sock *sk, | |||
| 623 | flush = 0; | 623 | flush = 0; |
| 624 | 624 | ||
| 625 | out: | 625 | out: |
| 626 | skb_gro_remcsum_cleanup(skb, &grc); | 626 | skb_gro_flush_final_remcsum(skb, pp, flush, &grc); |
| 627 | skb->remcsum_offload = 0; | ||
| 628 | NAPI_GRO_CB(skb)->flush |= flush; | ||
| 629 | 627 | ||
| 630 | return pp; | 628 | return pp; |
| 631 | } | 629 | } |
diff --git a/drivers/nfc/pn533/usb.c b/drivers/nfc/pn533/usb.c index d5553c47014f..5d823e965883 100644 --- a/drivers/nfc/pn533/usb.c +++ b/drivers/nfc/pn533/usb.c | |||
| @@ -74,7 +74,7 @@ static void pn533_recv_response(struct urb *urb) | |||
| 74 | struct sk_buff *skb = NULL; | 74 | struct sk_buff *skb = NULL; |
| 75 | 75 | ||
| 76 | if (!urb->status) { | 76 | if (!urb->status) { |
| 77 | skb = alloc_skb(urb->actual_length, GFP_KERNEL); | 77 | skb = alloc_skb(urb->actual_length, GFP_ATOMIC); |
| 78 | if (!skb) { | 78 | if (!skb) { |
| 79 | nfc_err(&phy->udev->dev, "failed to alloc memory\n"); | 79 | nfc_err(&phy->udev->dev, "failed to alloc memory\n"); |
| 80 | } else { | 80 | } else { |
| @@ -186,7 +186,7 @@ static int pn533_usb_send_frame(struct pn533 *dev, | |||
| 186 | 186 | ||
| 187 | if (dev->protocol_type == PN533_PROTO_REQ_RESP) { | 187 | if (dev->protocol_type == PN533_PROTO_REQ_RESP) { |
| 188 | /* request for response for sent packet directly */ | 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 | if (rc) | 190 | if (rc) |
| 191 | goto error; | 191 | goto error; |
| 192 | } else if (dev->protocol_type == PN533_PROTO_REQ_ACK_RESP) { | 192 | } else if (dev->protocol_type == PN533_PROTO_REQ_ACK_RESP) { |
diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c index 2e96b34bc936..fb667bf469c7 100644 --- a/drivers/nvdimm/claim.c +++ b/drivers/nvdimm/claim.c | |||
| @@ -278,6 +278,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns, | |||
| 278 | return -EIO; | 278 | return -EIO; |
| 279 | if (memcpy_mcsafe(buf, nsio->addr + offset, size) != 0) | 279 | if (memcpy_mcsafe(buf, nsio->addr + offset, size) != 0) |
| 280 | return -EIO; | 280 | return -EIO; |
| 281 | return 0; | ||
| 281 | } | 282 | } |
| 282 | 283 | ||
| 283 | if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) { | 284 | if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) { |
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 68940356cad3..8b1fd7f1a224 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c | |||
| @@ -414,7 +414,8 @@ static int pmem_attach_disk(struct device *dev, | |||
| 414 | blk_queue_logical_block_size(q, pmem_sector_size(ndns)); | 414 | blk_queue_logical_block_size(q, pmem_sector_size(ndns)); |
| 415 | blk_queue_max_hw_sectors(q, UINT_MAX); | 415 | blk_queue_max_hw_sectors(q, UINT_MAX); |
| 416 | blk_queue_flag_set(QUEUE_FLAG_NONROT, q); | 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 | q->queuedata = pmem; | 419 | q->queuedata = pmem; |
| 419 | 420 | ||
| 420 | disk = alloc_disk_node(0, nid); | 421 | disk = alloc_disk_node(0, nid); |
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 9544625c0b7d..518c5b09038c 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c | |||
| @@ -732,8 +732,11 @@ static void nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl, | |||
| 732 | blk_cleanup_queue(ctrl->ctrl.admin_q); | 732 | blk_cleanup_queue(ctrl->ctrl.admin_q); |
| 733 | nvme_rdma_free_tagset(&ctrl->ctrl, ctrl->ctrl.admin_tagset); | 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, | 735 | if (ctrl->async_event_sqe.data) { |
| 736 | sizeof(struct nvme_command), DMA_TO_DEVICE); | 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 | nvme_rdma_free_queue(&ctrl->queues[0]); | 740 | nvme_rdma_free_queue(&ctrl->queues[0]); |
| 738 | } | 741 | } |
| 739 | 742 | ||
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index b5b0cdc21d01..514d1dfc5630 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c | |||
| @@ -936,6 +936,10 @@ struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *cell_id) | |||
| 936 | return cell; | 936 | return cell; |
| 937 | } | 937 | } |
| 938 | 938 | ||
| 939 | /* NULL cell_id only allowed for device tree; invalid otherwise */ | ||
| 940 | if (!cell_id) | ||
| 941 | return ERR_PTR(-EINVAL); | ||
| 942 | |||
| 939 | return nvmem_cell_get_from_list(cell_id); | 943 | return nvmem_cell_get_from_list(cell_id); |
| 940 | } | 944 | } |
| 941 | EXPORT_SYMBOL_GPL(nvmem_cell_get); | 945 | EXPORT_SYMBOL_GPL(nvmem_cell_get); |
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index 535201984b8b..1b2cfe51e8d7 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile | |||
| @@ -28,10 +28,10 @@ obj-$(CONFIG_PCI_PF_STUB) += pci-pf-stub.o | |||
| 28 | obj-$(CONFIG_PCI_ECAM) += ecam.o | 28 | obj-$(CONFIG_PCI_ECAM) += ecam.o |
| 29 | obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o | 29 | obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o |
| 30 | 30 | ||
| 31 | obj-y += controller/ | ||
| 32 | obj-y += switch/ | ||
| 33 | |||
| 34 | # Endpoint library must be initialized before its users | 31 | # Endpoint library must be initialized before its users |
| 35 | obj-$(CONFIG_PCI_ENDPOINT) += endpoint/ | 32 | obj-$(CONFIG_PCI_ENDPOINT) += endpoint/ |
| 36 | 33 | ||
| 34 | obj-y += controller/ | ||
| 35 | obj-y += switch/ | ||
| 36 | |||
| 37 | ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG | 37 | ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG |
diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig index 18fa09b3ac8f..cc9fa02d32a0 100644 --- a/drivers/pci/controller/Kconfig +++ b/drivers/pci/controller/Kconfig | |||
| @@ -96,7 +96,6 @@ config PCI_HOST_GENERIC | |||
| 96 | depends on OF | 96 | depends on OF |
| 97 | select PCI_HOST_COMMON | 97 | select PCI_HOST_COMMON |
| 98 | select IRQ_DOMAIN | 98 | select IRQ_DOMAIN |
| 99 | select PCI_DOMAINS | ||
| 100 | help | 99 | help |
| 101 | Say Y here if you want to support a simple generic PCI host | 100 | Say Y here if you want to support a simple generic PCI host |
| 102 | controller, such as the one emulated by kvmtool. | 101 | controller, such as the one emulated by kvmtool. |
| @@ -138,7 +137,6 @@ config PCI_VERSATILE | |||
| 138 | 137 | ||
| 139 | config PCIE_IPROC | 138 | config PCIE_IPROC |
| 140 | tristate | 139 | tristate |
| 141 | select PCI_DOMAINS | ||
| 142 | help | 140 | help |
| 143 | This enables the iProc PCIe core controller support for Broadcom's | 141 | This enables the iProc PCIe core controller support for Broadcom's |
| 144 | iProc family of SoCs. An appropriate bus interface driver needs | 142 | iProc family of SoCs. An appropriate bus interface driver needs |
| @@ -176,7 +174,6 @@ config PCIE_IPROC_MSI | |||
| 176 | config PCIE_ALTERA | 174 | config PCIE_ALTERA |
| 177 | bool "Altera PCIe controller" | 175 | bool "Altera PCIe controller" |
| 178 | depends on ARM || NIOS2 || COMPILE_TEST | 176 | depends on ARM || NIOS2 || COMPILE_TEST |
| 179 | select PCI_DOMAINS | ||
| 180 | help | 177 | help |
| 181 | Say Y here if you want to enable PCIe controller support on Altera | 178 | Say Y here if you want to enable PCIe controller support on Altera |
| 182 | FPGA. | 179 | FPGA. |
diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig index 16f52c626b4b..91b0194240a5 100644 --- a/drivers/pci/controller/dwc/Kconfig +++ b/drivers/pci/controller/dwc/Kconfig | |||
| @@ -58,7 +58,6 @@ config PCIE_DW_PLAT_HOST | |||
| 58 | depends on PCI && PCI_MSI_IRQ_DOMAIN | 58 | depends on PCI && PCI_MSI_IRQ_DOMAIN |
| 59 | select PCIE_DW_HOST | 59 | select PCIE_DW_HOST |
| 60 | select PCIE_DW_PLAT | 60 | select PCIE_DW_PLAT |
| 61 | default y | ||
| 62 | help | 61 | help |
| 63 | Enables support for the PCIe controller in the Designware IP to | 62 | Enables support for the PCIe controller in the Designware IP to |
| 64 | work in host mode. There are two instances of PCIe controller in | 63 | work in host mode. There are two instances of PCIe controller in |
diff --git a/drivers/pci/controller/pci-ftpci100.c b/drivers/pci/controller/pci-ftpci100.c index a1ebe9ed441f..20bb2564a6b3 100644 --- a/drivers/pci/controller/pci-ftpci100.c +++ b/drivers/pci/controller/pci-ftpci100.c | |||
| @@ -355,11 +355,13 @@ static int faraday_pci_setup_cascaded_irq(struct faraday_pci *p) | |||
| 355 | irq = of_irq_get(intc, 0); | 355 | irq = of_irq_get(intc, 0); |
| 356 | if (irq <= 0) { | 356 | if (irq <= 0) { |
| 357 | dev_err(p->dev, "failed to get parent IRQ\n"); | 357 | dev_err(p->dev, "failed to get parent IRQ\n"); |
| 358 | of_node_put(intc); | ||
| 358 | return irq ?: -EINVAL; | 359 | return irq ?: -EINVAL; |
| 359 | } | 360 | } |
| 360 | 361 | ||
| 361 | p->irqdomain = irq_domain_add_linear(intc, PCI_NUM_INTX, | 362 | p->irqdomain = irq_domain_add_linear(intc, PCI_NUM_INTX, |
| 362 | &faraday_pci_irqdomain_ops, p); | 363 | &faraday_pci_irqdomain_ops, p); |
| 364 | of_node_put(intc); | ||
| 363 | if (!p->irqdomain) { | 365 | if (!p->irqdomain) { |
| 364 | dev_err(p->dev, "failed to create Gemini PCI IRQ domain\n"); | 366 | dev_err(p->dev, "failed to create Gemini PCI IRQ domain\n"); |
| 365 | return -EINVAL; | 367 | return -EINVAL; |
diff --git a/drivers/pci/controller/pcie-rcar.c b/drivers/pci/controller/pcie-rcar.c index 874d75c9ee4a..c8febb009454 100644 --- a/drivers/pci/controller/pcie-rcar.c +++ b/drivers/pci/controller/pcie-rcar.c | |||
| @@ -680,7 +680,11 @@ static int rcar_pcie_phy_init_gen3(struct rcar_pcie *pcie) | |||
| 680 | if (err) | 680 | if (err) |
| 681 | return err; | 681 | return err; |
| 682 | 682 | ||
| 683 | return phy_power_on(pcie->phy); | 683 | err = phy_power_on(pcie->phy); |
| 684 | if (err) | ||
| 685 | phy_exit(pcie->phy); | ||
| 686 | |||
| 687 | return err; | ||
| 684 | } | 688 | } |
| 685 | 689 | ||
| 686 | static int rcar_msi_alloc(struct rcar_msi *chip) | 690 | static int rcar_msi_alloc(struct rcar_msi *chip) |
| @@ -1165,7 +1169,7 @@ static int rcar_pcie_probe(struct platform_device *pdev) | |||
| 1165 | if (rcar_pcie_hw_init(pcie)) { | 1169 | if (rcar_pcie_hw_init(pcie)) { |
| 1166 | dev_info(dev, "PCIe link down\n"); | 1170 | dev_info(dev, "PCIe link down\n"); |
| 1167 | err = -ENODEV; | 1171 | err = -ENODEV; |
| 1168 | goto err_clk_disable; | 1172 | goto err_phy_shutdown; |
| 1169 | } | 1173 | } |
| 1170 | 1174 | ||
| 1171 | data = rcar_pci_read_reg(pcie, MACSR); | 1175 | data = rcar_pci_read_reg(pcie, MACSR); |
| @@ -1177,7 +1181,7 @@ static int rcar_pcie_probe(struct platform_device *pdev) | |||
| 1177 | dev_err(dev, | 1181 | dev_err(dev, |
| 1178 | "failed to enable MSI support: %d\n", | 1182 | "failed to enable MSI support: %d\n", |
| 1179 | err); | 1183 | err); |
| 1180 | goto err_clk_disable; | 1184 | goto err_phy_shutdown; |
| 1181 | } | 1185 | } |
| 1182 | } | 1186 | } |
| 1183 | 1187 | ||
| @@ -1191,6 +1195,12 @@ err_msi_teardown: | |||
| 1191 | if (IS_ENABLED(CONFIG_PCI_MSI)) | 1195 | if (IS_ENABLED(CONFIG_PCI_MSI)) |
| 1192 | rcar_pcie_teardown_msi(pcie); | 1196 | rcar_pcie_teardown_msi(pcie); |
| 1193 | 1197 | ||
| 1198 | err_phy_shutdown: | ||
| 1199 | if (pcie->phy) { | ||
| 1200 | phy_power_off(pcie->phy); | ||
| 1201 | phy_exit(pcie->phy); | ||
| 1202 | } | ||
| 1203 | |||
| 1194 | err_clk_disable: | 1204 | err_clk_disable: |
| 1195 | clk_disable_unprepare(pcie->bus_clk); | 1205 | clk_disable_unprepare(pcie->bus_clk); |
| 1196 | 1206 | ||
diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/controller/pcie-xilinx-nwl.c index 6a4bbb5b3de0..fb32840ce8e6 100644 --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c | |||
| @@ -559,7 +559,7 @@ static int nwl_pcie_init_irq_domain(struct nwl_pcie *pcie) | |||
| 559 | PCI_NUM_INTX, | 559 | PCI_NUM_INTX, |
| 560 | &legacy_domain_ops, | 560 | &legacy_domain_ops, |
| 561 | pcie); | 561 | pcie); |
| 562 | 562 | of_node_put(legacy_intc_node); | |
| 563 | if (!pcie->legacy_irq_domain) { | 563 | if (!pcie->legacy_irq_domain) { |
| 564 | dev_err(dev, "failed to create IRQ domain\n"); | 564 | dev_err(dev, "failed to create IRQ domain\n"); |
| 565 | return -ENOMEM; | 565 | return -ENOMEM; |
diff --git a/drivers/pci/controller/pcie-xilinx.c b/drivers/pci/controller/pcie-xilinx.c index b110a3a814e3..7b1389d8e2a5 100644 --- a/drivers/pci/controller/pcie-xilinx.c +++ b/drivers/pci/controller/pcie-xilinx.c | |||
| @@ -509,6 +509,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port) | |||
| 509 | port->leg_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX, | 509 | port->leg_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX, |
| 510 | &intx_domain_ops, | 510 | &intx_domain_ops, |
| 511 | port); | 511 | port); |
| 512 | of_node_put(pcie_intc_node); | ||
| 512 | if (!port->leg_domain) { | 513 | if (!port->leg_domain) { |
| 513 | dev_err(dev, "Failed to get a INTx IRQ domain\n"); | 514 | dev_err(dev, "Failed to get a INTx IRQ domain\n"); |
| 514 | return -ENODEV; | 515 | return -ENODEV; |
diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index 523a8cab3bfb..bf53fad636a5 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c | |||
| @@ -145,10 +145,10 @@ EXPORT_SYMBOL_GPL(pci_epf_alloc_space); | |||
| 145 | */ | 145 | */ |
| 146 | void pci_epf_unregister_driver(struct pci_epf_driver *driver) | 146 | void pci_epf_unregister_driver(struct pci_epf_driver *driver) |
| 147 | { | 147 | { |
| 148 | struct config_group *group; | 148 | struct config_group *group, *tmp; |
| 149 | 149 | ||
| 150 | mutex_lock(&pci_epf_mutex); | 150 | mutex_lock(&pci_epf_mutex); |
| 151 | list_for_each_entry(group, &driver->epf_group, group_entry) | 151 | list_for_each_entry_safe(group, tmp, &driver->epf_group, group_entry) |
| 152 | pci_ep_cfs_remove_epf_group(group); | 152 | pci_ep_cfs_remove_epf_group(group); |
| 153 | list_del(&driver->epf_group); | 153 | list_del(&driver->epf_group); |
| 154 | mutex_unlock(&pci_epf_mutex); | 154 | mutex_unlock(&pci_epf_mutex); |
diff --git a/drivers/pci/hotplug/acpi_pcihp.c b/drivers/pci/hotplug/acpi_pcihp.c index 3979f89b250a..5bd6c1573295 100644 --- a/drivers/pci/hotplug/acpi_pcihp.c +++ b/drivers/pci/hotplug/acpi_pcihp.c | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | * All rights reserved. | 7 | * All rights reserved. |
| 8 | * | 8 | * |
| 9 | * Send feedback to <kristen.c.accardi@intel.com> | 9 | * Send feedback to <kristen.c.accardi@intel.com> |
| 10 | * | ||
| 11 | */ | 10 | */ |
| 12 | 11 | ||
| 13 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| @@ -87,8 +86,17 @@ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *pdev) | |||
| 87 | return 0; | 86 | return 0; |
| 88 | 87 | ||
| 89 | /* If _OSC exists, we should not evaluate OSHP */ | 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 | host = pci_find_host_bridge(pdev->bus); | 95 | host = pci_find_host_bridge(pdev->bus); |
| 91 | root = acpi_pci_find_root(ACPI_HANDLE(&host->dev)); | 96 | root = acpi_pci_find_root(ACPI_HANDLE(&host->dev)); |
| 97 | if (!root) | ||
| 98 | return 0; | ||
| 99 | |||
| 92 | if (root->osc_support_set) | 100 | if (root->osc_support_set) |
| 93 | goto no_control; | 101 | goto no_control; |
| 94 | 102 | ||
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index d0d73dbbd5ca..0f04ae648cf1 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c | |||
| @@ -575,6 +575,22 @@ void pci_iov_release(struct pci_dev *dev) | |||
| 575 | } | 575 | } |
| 576 | 576 | ||
| 577 | /** | 577 | /** |
| 578 | * pci_iov_remove - clean up SR-IOV state after PF driver is detached | ||
| 579 | * @dev: the PCI device | ||
| 580 | */ | ||
| 581 | void pci_iov_remove(struct pci_dev *dev) | ||
| 582 | { | ||
| 583 | struct pci_sriov *iov = dev->sriov; | ||
| 584 | |||
| 585 | if (!dev->is_physfn) | ||
| 586 | return; | ||
| 587 | |||
| 588 | iov->driver_max_VFs = iov->total_VFs; | ||
| 589 | if (iov->num_VFs) | ||
| 590 | pci_warn(dev, "driver left SR-IOV enabled after remove\n"); | ||
| 591 | } | ||
| 592 | |||
| 593 | /** | ||
| 578 | * pci_iov_update_resource - update a VF BAR | 594 | * pci_iov_update_resource - update a VF BAR |
| 579 | * @dev: the PCI device | 595 | * @dev: the PCI device |
| 580 | * @resno: the resource number | 596 | * @resno: the resource number |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 65113b6eed14..89ee6a2b6eb8 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
| @@ -629,6 +629,18 @@ static bool acpi_pci_need_resume(struct pci_dev *dev) | |||
| 629 | { | 629 | { |
| 630 | struct acpi_device *adev = ACPI_COMPANION(&dev->dev); | 630 | struct acpi_device *adev = ACPI_COMPANION(&dev->dev); |
| 631 | 631 | ||
| 632 | /* | ||
| 633 | * In some cases (eg. Samsung 305V4A) leaving a bridge in suspend over | ||
| 634 | * system-wide suspend/resume confuses the platform firmware, so avoid | ||
| 635 | * doing that, unless the bridge has a driver that should take care of | ||
| 636 | * the PM handling. According to Section 16.1.6 of ACPI 6.2, endpoint | ||
| 637 | * devices are expected to be in D3 before invoking the S3 entry path | ||
| 638 | * from the firmware, so they should not be affected by this issue. | ||
| 639 | */ | ||
| 640 | if (pci_is_bridge(dev) && !dev->driver && | ||
| 641 | acpi_target_system_state() != ACPI_STATE_S0) | ||
| 642 | return true; | ||
| 643 | |||
| 632 | if (!adev || !acpi_device_power_manageable(adev)) | 644 | if (!adev || !acpi_device_power_manageable(adev)) |
| 633 | return false; | 645 | return false; |
| 634 | 646 | ||
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index c125d53033c6..6792292b5fc7 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
| @@ -445,6 +445,7 @@ static int pci_device_remove(struct device *dev) | |||
| 445 | } | 445 | } |
| 446 | pcibios_free_irq(pci_dev); | 446 | pcibios_free_irq(pci_dev); |
| 447 | pci_dev->driver = NULL; | 447 | pci_dev->driver = NULL; |
| 448 | pci_iov_remove(pci_dev); | ||
| 448 | } | 449 | } |
| 449 | 450 | ||
| 450 | /* Undo the runtime PM settings in local_pci_probe() */ | 451 | /* Undo the runtime PM settings in local_pci_probe() */ |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index c358e7a07f3f..882f1f9596df 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
| @@ -311,6 +311,7 @@ static inline void pci_restore_ats_state(struct pci_dev *dev) | |||
| 311 | #ifdef CONFIG_PCI_IOV | 311 | #ifdef CONFIG_PCI_IOV |
| 312 | int pci_iov_init(struct pci_dev *dev); | 312 | int pci_iov_init(struct pci_dev *dev); |
| 313 | void pci_iov_release(struct pci_dev *dev); | 313 | void pci_iov_release(struct pci_dev *dev); |
| 314 | void pci_iov_remove(struct pci_dev *dev); | ||
| 314 | void pci_iov_update_resource(struct pci_dev *dev, int resno); | 315 | void pci_iov_update_resource(struct pci_dev *dev, int resno); |
| 315 | resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno); | 316 | resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno); |
| 316 | void pci_restore_iov_state(struct pci_dev *dev); | 317 | void pci_restore_iov_state(struct pci_dev *dev); |
| @@ -325,6 +326,9 @@ static inline void pci_iov_release(struct pci_dev *dev) | |||
| 325 | 326 | ||
| 326 | { | 327 | { |
| 327 | } | 328 | } |
| 329 | static inline void pci_iov_remove(struct pci_dev *dev) | ||
| 330 | { | ||
| 331 | } | ||
| 328 | static inline void pci_restore_iov_state(struct pci_dev *dev) | 332 | static inline void pci_restore_iov_state(struct pci_dev *dev) |
| 329 | { | 333 | { |
| 330 | } | 334 | } |
diff --git a/drivers/perf/xgene_pmu.c b/drivers/perf/xgene_pmu.c index 6bdb1dad805f..0e31f1392a53 100644 --- a/drivers/perf/xgene_pmu.c +++ b/drivers/perf/xgene_pmu.c | |||
| @@ -1463,7 +1463,7 @@ static char *xgene_pmu_dev_name(struct device *dev, u32 type, int id) | |||
| 1463 | case PMU_TYPE_IOB: | 1463 | case PMU_TYPE_IOB: |
| 1464 | return devm_kasprintf(dev, GFP_KERNEL, "iob%d", id); | 1464 | return devm_kasprintf(dev, GFP_KERNEL, "iob%d", id); |
| 1465 | case PMU_TYPE_IOB_SLOW: | 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 | case PMU_TYPE_MCB: | 1467 | case PMU_TYPE_MCB: |
| 1468 | return devm_kasprintf(dev, GFP_KERNEL, "mcb%d", id); | 1468 | return devm_kasprintf(dev, GFP_KERNEL, "mcb%d", id); |
| 1469 | case PMU_TYPE_MC: | 1469 | case PMU_TYPE_MC: |
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index d3a38c421503..a9f60d0ee02e 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
| @@ -41,6 +41,15 @@ | |||
| 41 | 41 | ||
| 42 | #define DASD_DIAG_MOD "dasd_diag_mod" | 42 | #define DASD_DIAG_MOD "dasd_diag_mod" |
| 43 | 43 | ||
| 44 | static unsigned int queue_depth = 32; | ||
| 45 | static unsigned int nr_hw_queues = 4; | ||
| 46 | |||
| 47 | module_param(queue_depth, uint, 0444); | ||
| 48 | MODULE_PARM_DESC(queue_depth, "Default queue depth for new DASD devices"); | ||
| 49 | |||
| 50 | module_param(nr_hw_queues, uint, 0444); | ||
| 51 | MODULE_PARM_DESC(nr_hw_queues, "Default number of hardware queues for new DASD devices"); | ||
| 52 | |||
| 44 | /* | 53 | /* |
| 45 | * SECTION: exported variables of dasd.c | 54 | * SECTION: exported variables of dasd.c |
| 46 | */ | 55 | */ |
| @@ -3115,8 +3124,8 @@ static int dasd_alloc_queue(struct dasd_block *block) | |||
| 3115 | 3124 | ||
| 3116 | block->tag_set.ops = &dasd_mq_ops; | 3125 | block->tag_set.ops = &dasd_mq_ops; |
| 3117 | block->tag_set.cmd_size = sizeof(struct dasd_ccw_req); | 3126 | block->tag_set.cmd_size = sizeof(struct dasd_ccw_req); |
| 3118 | block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES; | 3127 | block->tag_set.nr_hw_queues = nr_hw_queues; |
| 3119 | block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV; | 3128 | block->tag_set.queue_depth = queue_depth; |
| 3120 | block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; | 3129 | block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; |
| 3121 | 3130 | ||
| 3122 | rc = blk_mq_alloc_tag_set(&block->tag_set); | 3131 | rc = blk_mq_alloc_tag_set(&block->tag_set); |
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h index 976b6bd4fb05..de6b96036aa4 100644 --- a/drivers/s390/block/dasd_int.h +++ b/drivers/s390/block/dasd_int.h | |||
| @@ -228,14 +228,6 @@ struct dasd_ccw_req { | |||
| 228 | #define DASD_CQR_SUPPRESS_IL 6 /* Suppress 'Incorrect Length' error */ | 228 | #define DASD_CQR_SUPPRESS_IL 6 /* Suppress 'Incorrect Length' error */ |
| 229 | #define DASD_CQR_SUPPRESS_CR 7 /* Suppress 'Command Reject' error */ | 229 | #define DASD_CQR_SUPPRESS_CR 7 /* Suppress 'Command Reject' error */ |
| 230 | 230 | ||
| 231 | /* | ||
| 232 | * There is no reliable way to determine the number of available CPUs on | ||
| 233 | * LPAR but there is no big performance difference between 1 and the | ||
| 234 | * maximum CPU number. | ||
| 235 | * 64 is a good trade off performance wise. | ||
| 236 | */ | ||
| 237 | #define DASD_NR_HW_QUEUES 64 | ||
| 238 | #define DASD_MAX_LCU_DEV 256 | ||
| 239 | #define DASD_REQ_PER_DEV 4 | 231 | #define DASD_REQ_PER_DEV 4 |
| 240 | 232 | ||
| 241 | /* Signature for error recovery functions. */ | 233 | /* Signature for error recovery functions. */ |
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index 2a5fec55bf60..a246a618f9a4 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h | |||
| @@ -829,6 +829,17 @@ struct qeth_trap_id { | |||
| 829 | /*some helper functions*/ | 829 | /*some helper functions*/ |
| 830 | #define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "") | 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 | * qeth_get_elements_for_range() - find number of SBALEs to cover range. | 844 | * qeth_get_elements_for_range() - find number of SBALEs to cover range. |
| 834 | * @start: Start of the address range. | 845 | * @start: Start of the address range. |
| @@ -1029,7 +1040,7 @@ struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *, | |||
| 1029 | __u16, __u16, | 1040 | __u16, __u16, |
| 1030 | enum qeth_prot_versions); | 1041 | enum qeth_prot_versions); |
| 1031 | int qeth_set_features(struct net_device *, netdev_features_t); | 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 | netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t); | 1044 | netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t); |
| 1034 | netdev_features_t qeth_features_check(struct sk_buff *skb, | 1045 | netdev_features_t qeth_features_check(struct sk_buff *skb, |
| 1035 | struct net_device *dev, | 1046 | struct net_device *dev, |
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 8e1474f1ffac..d01ac29fd986 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
| @@ -73,9 +73,6 @@ static void qeth_notify_skbs(struct qeth_qdio_out_q *queue, | |||
| 73 | struct qeth_qdio_out_buffer *buf, | 73 | struct qeth_qdio_out_buffer *buf, |
| 74 | enum iucv_tx_notify notification); | 74 | enum iucv_tx_notify notification); |
| 75 | static void qeth_release_skbs(struct qeth_qdio_out_buffer *buf); | 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 | static int qeth_init_qdio_out_buf(struct qeth_qdio_out_q *, int); | 76 | static int qeth_init_qdio_out_buf(struct qeth_qdio_out_q *, int); |
| 80 | 77 | ||
| 81 | struct workqueue_struct *qeth_wq; | 78 | struct workqueue_struct *qeth_wq; |
| @@ -489,6 +486,7 @@ static void qeth_qdio_handle_aob(struct qeth_card *card, | |||
| 489 | struct qaob *aob; | 486 | struct qaob *aob; |
| 490 | struct qeth_qdio_out_buffer *buffer; | 487 | struct qeth_qdio_out_buffer *buffer; |
| 491 | enum iucv_tx_notify notification; | 488 | enum iucv_tx_notify notification; |
| 489 | unsigned int i; | ||
| 492 | 490 | ||
| 493 | aob = (struct qaob *) phys_to_virt(phys_aob_addr); | 491 | aob = (struct qaob *) phys_to_virt(phys_aob_addr); |
| 494 | QETH_CARD_TEXT(card, 5, "haob"); | 492 | QETH_CARD_TEXT(card, 5, "haob"); |
| @@ -513,10 +511,18 @@ static void qeth_qdio_handle_aob(struct qeth_card *card, | |||
| 513 | qeth_notify_skbs(buffer->q, buffer, notification); | 511 | qeth_notify_skbs(buffer->q, buffer, notification); |
| 514 | 512 | ||
| 515 | buffer->aob = NULL; | 513 | buffer->aob = NULL; |
| 516 | qeth_clear_output_buffer(buffer->q, buffer, | 514 | /* Free dangling allocations. The attached skbs are handled by |
| 517 | QETH_QDIO_BUF_HANDLED_DELAYED); | 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 | qdio_release_aob(aob); | 526 | qdio_release_aob(aob); |
| 521 | } | 527 | } |
| 522 | 528 | ||
| @@ -3759,6 +3765,10 @@ static void qeth_qdio_output_handler(struct ccw_device *ccwdev, | |||
| 3759 | QETH_CARD_TEXT(queue->card, 5, "aob"); | 3765 | QETH_CARD_TEXT(queue->card, 5, "aob"); |
| 3760 | QETH_CARD_TEXT_(queue->card, 5, "%lx", | 3766 | QETH_CARD_TEXT_(queue->card, 5, "%lx", |
| 3761 | virt_to_phys(buffer->aob)); | 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 | if (qeth_init_qdio_out_buf(queue, bidx)) { | 3772 | if (qeth_init_qdio_out_buf(queue, bidx)) { |
| 3763 | QETH_CARD_TEXT(card, 2, "outofbuf"); | 3773 | QETH_CARD_TEXT(card, 2, "outofbuf"); |
| 3764 | qeth_schedule_recovery(card); | 3774 | qeth_schedule_recovery(card); |
| @@ -4834,7 +4844,7 @@ int qeth_vm_request_mac(struct qeth_card *card) | |||
| 4834 | goto out; | 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 | request->resp_buf_len = sizeof(*response); | 4848 | request->resp_buf_len = sizeof(*response); |
| 4839 | request->resp_version = DIAG26C_VERSION2; | 4849 | request->resp_version = DIAG26C_VERSION2; |
| 4840 | request->op_code = DIAG26C_GET_MAC; | 4850 | request->op_code = DIAG26C_GET_MAC; |
| @@ -6459,28 +6469,27 @@ static int qeth_set_ipa_rx_csum(struct qeth_card *card, bool on) | |||
| 6459 | #define QETH_HW_FEATURES (NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_TSO | \ | 6469 | #define QETH_HW_FEATURES (NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_TSO | \ |
| 6460 | NETIF_F_IPV6_CSUM) | 6470 | NETIF_F_IPV6_CSUM) |
| 6461 | /** | 6471 | /** |
| 6462 | * qeth_recover_features() - Restore device features after recovery | 6472 | * qeth_enable_hw_features() - (Re-)Enable HW functions for device features |
| 6463 | * @dev: the recovering net_device | 6473 | * @dev: a net_device |
| 6464 | * | ||
| 6465 | * Caller must hold rtnl lock. | ||
| 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 | struct qeth_card *card = dev->ml_priv; | 6477 | struct qeth_card *card = dev->ml_priv; |
| 6478 | netdev_features_t features; | ||
| 6471 | 6479 | ||
| 6480 | rtnl_lock(); | ||
| 6481 | features = dev->features; | ||
| 6472 | /* force-off any feature that needs an IPA sequence. | 6482 | /* force-off any feature that needs an IPA sequence. |
| 6473 | * netdev_update_features() will restart them. | 6483 | * netdev_update_features() will restart them. |
| 6474 | */ | 6484 | */ |
| 6475 | dev->features &= ~QETH_HW_FEATURES; | 6485 | dev->features &= ~QETH_HW_FEATURES; |
| 6476 | netdev_update_features(dev); | 6486 | netdev_update_features(dev); |
| 6477 | 6487 | if (features != dev->features) | |
| 6478 | if (features == dev->features) | 6488 | dev_warn(&card->gdev->dev, |
| 6479 | return; | 6489 | "Device recovery failed to restore all offload features\n"); |
| 6480 | dev_warn(&card->gdev->dev, | 6490 | rtnl_unlock(); |
| 6481 | "Device recovery failed to restore all offload features\n"); | ||
| 6482 | } | 6491 | } |
| 6483 | EXPORT_SYMBOL_GPL(qeth_recover_features); | 6492 | EXPORT_SYMBOL_GPL(qeth_enable_hw_features); |
| 6484 | 6493 | ||
| 6485 | int qeth_set_features(struct net_device *dev, netdev_features_t features) | 6494 | int qeth_set_features(struct net_device *dev, netdev_features_t features) |
| 6486 | { | 6495 | { |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index a7cb37da6a21..2487f0aeb165 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
| @@ -140,7 +140,7 @@ static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac) | |||
| 140 | 140 | ||
| 141 | static int qeth_l2_write_mac(struct qeth_card *card, u8 *mac) | 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 | IPA_CMD_SETGMAC : IPA_CMD_SETVMAC; | 144 | IPA_CMD_SETGMAC : IPA_CMD_SETVMAC; |
| 145 | int rc; | 145 | int rc; |
| 146 | 146 | ||
| @@ -157,7 +157,7 @@ static int qeth_l2_write_mac(struct qeth_card *card, u8 *mac) | |||
| 157 | 157 | ||
| 158 | static int qeth_l2_remove_mac(struct qeth_card *card, u8 *mac) | 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 | IPA_CMD_DELGMAC : IPA_CMD_DELVMAC; | 161 | IPA_CMD_DELGMAC : IPA_CMD_DELVMAC; |
| 162 | int rc; | 162 | int rc; |
| 163 | 163 | ||
| @@ -501,27 +501,34 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p) | |||
| 501 | return -ERESTARTSYS; | 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 | if (!qeth_card_hw_is_reachable(card)) { | 508 | if (!qeth_card_hw_is_reachable(card)) { |
| 505 | ether_addr_copy(dev->dev_addr, addr->sa_data); | 509 | ether_addr_copy(dev->dev_addr, addr->sa_data); |
| 506 | return 0; | 510 | goto out_unlock; |
| 507 | } | 511 | } |
| 508 | 512 | ||
| 509 | /* don't register the same address twice */ | 513 | /* don't register the same address twice */ |
| 510 | if (ether_addr_equal_64bits(dev->dev_addr, addr->sa_data) && | 514 | if (ether_addr_equal_64bits(dev->dev_addr, addr->sa_data) && |
| 511 | (card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED)) | 515 | (card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED)) |
| 512 | return 0; | 516 | goto out_unlock; |
| 513 | 517 | ||
| 514 | /* add the new address, switch over, drop the old */ | 518 | /* add the new address, switch over, drop the old */ |
| 515 | rc = qeth_l2_send_setmac(card, addr->sa_data); | 519 | rc = qeth_l2_send_setmac(card, addr->sa_data); |
| 516 | if (rc) | 520 | if (rc) |
| 517 | return rc; | 521 | goto out_unlock; |
| 518 | ether_addr_copy(old_addr, dev->dev_addr); | 522 | ether_addr_copy(old_addr, dev->dev_addr); |
| 519 | ether_addr_copy(dev->dev_addr, addr->sa_data); | 523 | ether_addr_copy(dev->dev_addr, addr->sa_data); |
| 520 | 524 | ||
| 521 | if (card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED) | 525 | if (card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED) |
| 522 | qeth_l2_remove_mac(card, old_addr); | 526 | qeth_l2_remove_mac(card, old_addr); |
| 523 | card->info.mac_bits |= QETH_LAYER2_MAC_REGISTERED; | 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 | static void qeth_promisc_to_bridge(struct qeth_card *card) | 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) | |||
| 1112 | netif_carrier_off(card->dev); | 1119 | netif_carrier_off(card->dev); |
| 1113 | 1120 | ||
| 1114 | qeth_set_allowed_threads(card, 0xffffffff, 0); | 1121 | qeth_set_allowed_threads(card, 0xffffffff, 0); |
| 1122 | |||
| 1123 | qeth_enable_hw_features(card->dev); | ||
| 1115 | if (recover_flag == CARD_STATE_RECOVER) { | 1124 | if (recover_flag == CARD_STATE_RECOVER) { |
| 1116 | if (recovery_mode && | 1125 | if (recovery_mode && |
| 1117 | card->info.type != QETH_CARD_TYPE_OSN) { | 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) | |||
| 1123 | } | 1132 | } |
| 1124 | /* this also sets saved unicast addresses */ | 1133 | /* this also sets saved unicast addresses */ |
| 1125 | qeth_l2_set_rx_mode(card->dev); | 1134 | qeth_l2_set_rx_mode(card->dev); |
| 1126 | rtnl_lock(); | ||
| 1127 | qeth_recover_features(card->dev); | ||
| 1128 | rtnl_unlock(); | ||
| 1129 | } | 1135 | } |
| 1130 | /* let user_space know that device is online */ | 1136 | /* let user_space know that device is online */ |
| 1131 | kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE); | 1137 | kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE); |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index e7fa479adf47..5905dc63e256 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
| @@ -2662,6 +2662,8 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
| 2662 | netif_carrier_on(card->dev); | 2662 | netif_carrier_on(card->dev); |
| 2663 | else | 2663 | else |
| 2664 | netif_carrier_off(card->dev); | 2664 | netif_carrier_off(card->dev); |
| 2665 | |||
| 2666 | qeth_enable_hw_features(card->dev); | ||
| 2665 | if (recover_flag == CARD_STATE_RECOVER) { | 2667 | if (recover_flag == CARD_STATE_RECOVER) { |
| 2666 | rtnl_lock(); | 2668 | rtnl_lock(); |
| 2667 | if (recovery_mode) | 2669 | if (recovery_mode) |
| @@ -2669,7 +2671,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
| 2669 | else | 2671 | else |
| 2670 | dev_open(card->dev); | 2672 | dev_open(card->dev); |
| 2671 | qeth_l3_set_rx_mode(card->dev); | 2673 | qeth_l3_set_rx_mode(card->dev); |
| 2672 | qeth_recover_features(card->dev); | ||
| 2673 | rtnl_unlock(); | 2674 | rtnl_unlock(); |
| 2674 | } | 2675 | } |
| 2675 | qeth_trace_features(card); | 2676 | qeth_trace_features(card); |
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index a9831bd37a73..a57f3a7d4748 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c | |||
| @@ -1974,7 +1974,6 @@ static void aac_set_safw_attr_all_targets(struct aac_dev *dev) | |||
| 1974 | u32 lun_count, nexus; | 1974 | u32 lun_count, nexus; |
| 1975 | u32 i, bus, target; | 1975 | u32 i, bus, target; |
| 1976 | u8 expose_flag, attribs; | 1976 | u8 expose_flag, attribs; |
| 1977 | u8 devtype; | ||
| 1978 | 1977 | ||
| 1979 | lun_count = aac_get_safw_phys_lun_count(dev); | 1978 | lun_count = aac_get_safw_phys_lun_count(dev); |
| 1980 | 1979 | ||
| @@ -1992,23 +1991,23 @@ static void aac_set_safw_attr_all_targets(struct aac_dev *dev) | |||
| 1992 | continue; | 1991 | continue; |
| 1993 | 1992 | ||
| 1994 | if (expose_flag != 0) { | 1993 | if (expose_flag != 0) { |
| 1995 | devtype = AAC_DEVTYPE_RAID_MEMBER; | 1994 | dev->hba_map[bus][target].devtype = |
| 1996 | goto update_devtype; | 1995 | AAC_DEVTYPE_RAID_MEMBER; |
| 1996 | continue; | ||
| 1997 | } | 1997 | } |
| 1998 | 1998 | ||
| 1999 | if (nexus != 0 && (attribs & 8)) { | 1999 | if (nexus != 0 && (attribs & 8)) { |
| 2000 | devtype = AAC_DEVTYPE_NATIVE_RAW; | 2000 | dev->hba_map[bus][target].devtype = |
| 2001 | AAC_DEVTYPE_NATIVE_RAW; | ||
| 2001 | dev->hba_map[bus][target].rmw_nexus = | 2002 | dev->hba_map[bus][target].rmw_nexus = |
| 2002 | nexus; | 2003 | nexus; |
| 2003 | } else | 2004 | } else |
| 2004 | devtype = AAC_DEVTYPE_ARC_RAW; | 2005 | dev->hba_map[bus][target].devtype = |
| 2006 | AAC_DEVTYPE_ARC_RAW; | ||
| 2005 | 2007 | ||
| 2006 | dev->hba_map[bus][target].scan_counter = dev->scan_counter; | 2008 | dev->hba_map[bus][target].scan_counter = dev->scan_counter; |
| 2007 | 2009 | ||
| 2008 | aac_set_safw_target_qd(dev, bus, target); | 2010 | aac_set_safw_target_qd(dev, bus, target); |
| 2009 | |||
| 2010 | update_devtype: | ||
| 2011 | dev->hba_map[bus][target].devtype = devtype; | ||
| 2012 | } | 2011 | } |
| 2013 | } | 2012 | } |
| 2014 | 2013 | ||
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 0a9b8b387bd2..02d65dce74e5 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
| @@ -760,7 +760,6 @@ static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg, | |||
| 760 | ioa_cfg->hrrq[i].allow_interrupts = 0; | 760 | ioa_cfg->hrrq[i].allow_interrupts = 0; |
| 761 | spin_unlock(&ioa_cfg->hrrq[i]._lock); | 761 | spin_unlock(&ioa_cfg->hrrq[i]._lock); |
| 762 | } | 762 | } |
| 763 | wmb(); | ||
| 764 | 763 | ||
| 765 | /* Set interrupt mask to stop all new interrupts */ | 764 | /* Set interrupt mask to stop all new interrupts */ |
| 766 | if (ioa_cfg->sis64) | 765 | if (ioa_cfg->sis64) |
| @@ -8403,7 +8402,6 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd) | |||
| 8403 | ioa_cfg->hrrq[i].allow_interrupts = 1; | 8402 | ioa_cfg->hrrq[i].allow_interrupts = 1; |
| 8404 | spin_unlock(&ioa_cfg->hrrq[i]._lock); | 8403 | spin_unlock(&ioa_cfg->hrrq[i]._lock); |
| 8405 | } | 8404 | } |
| 8406 | wmb(); | ||
| 8407 | if (ioa_cfg->sis64) { | 8405 | if (ioa_cfg->sis64) { |
| 8408 | /* Set the adapter to the correct endian mode. */ | 8406 | /* Set the adapter to the correct endian mode. */ |
| 8409 | writel(IPR_ENDIAN_SWAP_KEY, ioa_cfg->regs.endian_swap_reg); | 8407 | writel(IPR_ENDIAN_SWAP_KEY, ioa_cfg->regs.endian_swap_reg); |
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 0fea2e2326be..1027b0cb7fa3 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
| @@ -1224,7 +1224,6 @@ static void qla24xx_chk_fcp_state(struct fc_port *sess) | |||
| 1224 | void qlt_schedule_sess_for_deletion(struct fc_port *sess) | 1224 | void qlt_schedule_sess_for_deletion(struct fc_port *sess) |
| 1225 | { | 1225 | { |
| 1226 | struct qla_tgt *tgt = sess->tgt; | 1226 | struct qla_tgt *tgt = sess->tgt; |
| 1227 | struct qla_hw_data *ha = sess->vha->hw; | ||
| 1228 | unsigned long flags; | 1227 | unsigned long flags; |
| 1229 | 1228 | ||
| 1230 | if (sess->disc_state == DSC_DELETE_PEND) | 1229 | if (sess->disc_state == DSC_DELETE_PEND) |
| @@ -1241,16 +1240,16 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) | |||
| 1241 | return; | 1240 | return; |
| 1242 | } | 1241 | } |
| 1243 | 1242 | ||
| 1244 | spin_lock_irqsave(&ha->tgt.sess_lock, flags); | ||
| 1245 | if (sess->deleted == QLA_SESS_DELETED) | 1243 | if (sess->deleted == QLA_SESS_DELETED) |
| 1246 | sess->logout_on_delete = 0; | 1244 | sess->logout_on_delete = 0; |
| 1247 | 1245 | ||
| 1246 | spin_lock_irqsave(&sess->vha->work_lock, flags); | ||
| 1248 | if (sess->deleted == QLA_SESS_DELETION_IN_PROGRESS) { | 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 | return; | 1249 | return; |
| 1251 | } | 1250 | } |
| 1252 | sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; | 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 | sess->disc_state = DSC_DELETE_PEND; | 1254 | sess->disc_state = DSC_DELETE_PEND; |
| 1256 | 1255 | ||
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 24d7496cd9e2..364e71861bfd 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c | |||
| @@ -5507,9 +5507,9 @@ static void __exit scsi_debug_exit(void) | |||
| 5507 | int k = sdebug_add_host; | 5507 | int k = sdebug_add_host; |
| 5508 | 5508 | ||
| 5509 | stop_all_queued(); | 5509 | stop_all_queued(); |
| 5510 | free_all_queued(); | ||
| 5511 | for (; k; k--) | 5510 | for (; k; k--) |
| 5512 | sdebug_remove_adapter(); | 5511 | sdebug_remove_adapter(); |
| 5512 | free_all_queued(); | ||
| 5513 | driver_unregister(&sdebug_driverfs_driver); | 5513 | driver_unregister(&sdebug_driverfs_driver); |
| 5514 | bus_unregister(&pseudo_lld_bus); | 5514 | bus_unregister(&pseudo_lld_bus); |
| 5515 | root_device_unregister(pseudo_primary); | 5515 | root_device_unregister(pseudo_primary); |
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 53ae52dbff84..cd2fdac000c9 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
| @@ -51,6 +51,7 @@ static int sg_version_num = 30536; /* 2 digits for each component */ | |||
| 51 | #include <linux/atomic.h> | 51 | #include <linux/atomic.h> |
| 52 | #include <linux/ratelimit.h> | 52 | #include <linux/ratelimit.h> |
| 53 | #include <linux/uio.h> | 53 | #include <linux/uio.h> |
| 54 | #include <linux/cred.h> /* for sg_check_file_access() */ | ||
| 54 | 55 | ||
| 55 | #include "scsi.h" | 56 | #include "scsi.h" |
| 56 | #include <scsi/scsi_dbg.h> | 57 | #include <scsi/scsi_dbg.h> |
| @@ -209,6 +210,33 @@ static void sg_device_destroy(struct kref *kref); | |||
| 209 | sdev_prefix_printk(prefix, (sdp)->device, \ | 210 | sdev_prefix_printk(prefix, (sdp)->device, \ |
| 210 | (sdp)->disk->disk_name, fmt, ##a) | 211 | (sdp)->disk->disk_name, fmt, ##a) |
| 211 | 212 | ||
| 213 | /* | ||
| 214 | * The SCSI interfaces that use read() and write() as an asynchronous variant of | ||
| 215 | * ioctl(..., SG_IO, ...) are fundamentally unsafe, since there are lots of ways | ||
| 216 | * to trigger read() and write() calls from various contexts with elevated | ||
| 217 | * privileges. This can lead to kernel memory corruption (e.g. if these | ||
| 218 | * interfaces are called through splice()) and privilege escalation inside | ||
| 219 | * userspace (e.g. if a process with access to such a device passes a file | ||
| 220 | * descriptor to a SUID binary as stdin/stdout/stderr). | ||
| 221 | * | ||
| 222 | * This function provides protection for the legacy API by restricting the | ||
| 223 | * calling context. | ||
| 224 | */ | ||
| 225 | static int sg_check_file_access(struct file *filp, const char *caller) | ||
| 226 | { | ||
| 227 | if (filp->f_cred != current_real_cred()) { | ||
| 228 | pr_err_once("%s: process %d (%s) changed security contexts after opening file descriptor, this is not allowed.\n", | ||
| 229 | caller, task_tgid_vnr(current), current->comm); | ||
| 230 | return -EPERM; | ||
| 231 | } | ||
| 232 | if (uaccess_kernel()) { | ||
| 233 | pr_err_once("%s: process %d (%s) called from kernel context, this is not allowed.\n", | ||
| 234 | caller, task_tgid_vnr(current), current->comm); | ||
| 235 | return -EACCES; | ||
| 236 | } | ||
| 237 | return 0; | ||
| 238 | } | ||
| 239 | |||
| 212 | static int sg_allow_access(struct file *filp, unsigned char *cmd) | 240 | static int sg_allow_access(struct file *filp, unsigned char *cmd) |
| 213 | { | 241 | { |
| 214 | struct sg_fd *sfp = filp->private_data; | 242 | struct sg_fd *sfp = filp->private_data; |
| @@ -393,6 +421,14 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) | |||
| 393 | struct sg_header *old_hdr = NULL; | 421 | struct sg_header *old_hdr = NULL; |
| 394 | int retval = 0; | 422 | int retval = 0; |
| 395 | 423 | ||
| 424 | /* | ||
| 425 | * This could cause a response to be stranded. Close the associated | ||
| 426 | * file descriptor to free up any resources being held. | ||
| 427 | */ | ||
| 428 | retval = sg_check_file_access(filp, __func__); | ||
| 429 | if (retval) | ||
| 430 | return retval; | ||
| 431 | |||
| 396 | if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) | 432 | if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) |
| 397 | return -ENXIO; | 433 | return -ENXIO; |
| 398 | SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp, | 434 | SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp, |
| @@ -580,9 +616,11 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) | |||
| 580 | struct sg_header old_hdr; | 616 | struct sg_header old_hdr; |
| 581 | sg_io_hdr_t *hp; | 617 | sg_io_hdr_t *hp; |
| 582 | unsigned char cmnd[SG_MAX_CDB_SIZE]; | 618 | unsigned char cmnd[SG_MAX_CDB_SIZE]; |
| 619 | int retval; | ||
| 583 | 620 | ||
| 584 | if (unlikely(uaccess_kernel())) | 621 | retval = sg_check_file_access(filp, __func__); |
| 585 | return -EINVAL; | 622 | if (retval) |
| 623 | return retval; | ||
| 586 | 624 | ||
| 587 | if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) | 625 | if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) |
| 588 | return -ENXIO; | 626 | return -ENXIO; |
diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index f4e3bd40c72e..6ef18cf8f243 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c | |||
| @@ -39,10 +39,15 @@ | |||
| 39 | 39 | ||
| 40 | #define GPC_M4_PU_PDN_FLG 0x1bc | 40 | #define GPC_M4_PU_PDN_FLG 0x1bc |
| 41 | 41 | ||
| 42 | 42 | /* | |
| 43 | #define PGC_MIPI 4 | 43 | * The PGC offset values in Reference Manual |
| 44 | #define PGC_PCIE 5 | 44 | * (Rev. 1, 01/2018 and the older ones) GPC chapter's |
| 45 | #define PGC_USB_HSIC 8 | 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 | #define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40) | 51 | #define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40) |
| 47 | #define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0xc) | 52 | #define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0xc) |
| 48 | 53 | ||
diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index 9dc02f390ba3..5856e792d09c 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig | |||
| @@ -5,7 +5,8 @@ menu "Qualcomm SoC drivers" | |||
| 5 | 5 | ||
| 6 | config QCOM_COMMAND_DB | 6 | config QCOM_COMMAND_DB |
| 7 | bool "Qualcomm Command DB" | 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 | help | 10 | help |
| 10 | Command DB queries shared memory by key string for shared system | 11 | Command DB queries shared memory by key string for shared system |
| 11 | resources. Platform drivers that require to set state of a shared | 12 | resources. Platform drivers that require to set state of a shared |
diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c index 95120acc4d80..50d03d8b4f9a 100644 --- a/drivers/soc/renesas/rcar-sysc.c +++ b/drivers/soc/renesas/rcar-sysc.c | |||
| @@ -194,11 +194,12 @@ static int rcar_sysc_pd_power_on(struct generic_pm_domain *genpd) | |||
| 194 | 194 | ||
| 195 | static bool has_cpg_mstp; | 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 | struct generic_pm_domain *genpd = &pd->genpd; | 199 | struct generic_pm_domain *genpd = &pd->genpd; |
| 200 | const char *name = pd->genpd.name; | 200 | const char *name = pd->genpd.name; |
| 201 | struct dev_power_governor *gov = &simple_qos_governor; | 201 | struct dev_power_governor *gov = &simple_qos_governor; |
| 202 | int error; | ||
| 202 | 203 | ||
| 203 | if (pd->flags & PD_CPU) { | 204 | if (pd->flags & PD_CPU) { |
| 204 | /* | 205 | /* |
| @@ -251,7 +252,11 @@ static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd) | |||
| 251 | rcar_sysc_power_up(&pd->ch); | 252 | rcar_sysc_power_up(&pd->ch); |
| 252 | 253 | ||
| 253 | finalize: | 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 | static const struct of_device_id rcar_sysc_matches[] __initconst = { | 262 | static const struct of_device_id rcar_sysc_matches[] __initconst = { |
| @@ -375,6 +380,9 @@ static int __init rcar_sysc_pd_init(void) | |||
| 375 | pr_debug("%pOF: syscier = 0x%08x\n", np, syscier); | 380 | pr_debug("%pOF: syscier = 0x%08x\n", np, syscier); |
| 376 | iowrite32(syscier, base + SYSCIER); | 381 | iowrite32(syscier, base + SYSCIER); |
| 377 | 382 | ||
| 383 | /* | ||
| 384 | * First, create all PM domains | ||
| 385 | */ | ||
| 378 | for (i = 0; i < info->num_areas; i++) { | 386 | for (i = 0; i < info->num_areas; i++) { |
| 379 | const struct rcar_sysc_area *area = &info->areas[i]; | 387 | const struct rcar_sysc_area *area = &info->areas[i]; |
| 380 | struct rcar_sysc_pd *pd; | 388 | struct rcar_sysc_pd *pd; |
| @@ -397,14 +405,29 @@ static int __init rcar_sysc_pd_init(void) | |||
| 397 | pd->ch.isr_bit = area->isr_bit; | 405 | pd->ch.isr_bit = area->isr_bit; |
| 398 | pd->flags = area->flags; | 406 | pd->flags = area->flags; |
| 399 | 407 | ||
| 400 | rcar_sysc_pd_setup(pd); | 408 | error = rcar_sysc_pd_setup(pd); |
| 401 | if (area->parent >= 0) | 409 | if (error) |
| 402 | pm_genpd_add_subdomain(domains->domains[area->parent], | 410 | goto out_put; |
| 403 | &pd->genpd); | ||
| 404 | 411 | ||
| 405 | domains->domains[area->isr_bit] = &pd->genpd; | 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 | error = of_genpd_add_provider_onecell(np, &domains->onecell_data); | 431 | error = of_genpd_add_provider_onecell(np, &domains->onecell_data); |
| 409 | 432 | ||
| 410 | out_put: | 433 | out_put: |
diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c index e8c440329708..31db510018a9 100644 --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c | |||
| @@ -30,7 +30,7 @@ void *ion_heap_map_kernel(struct ion_heap *heap, | |||
| 30 | struct page **tmp = pages; | 30 | struct page **tmp = pages; |
| 31 | 31 | ||
| 32 | if (!pages) | 32 | if (!pages) |
| 33 | return NULL; | 33 | return ERR_PTR(-ENOMEM); |
| 34 | 34 | ||
| 35 | if (buffer->flags & ION_FLAG_CACHED) | 35 | if (buffer->flags & ION_FLAG_CACHED) |
| 36 | pgprot = PAGE_KERNEL; | 36 | pgprot = PAGE_KERNEL; |
diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c index ea194aa01a64..257b0daff01f 100644 --- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c +++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c | |||
| @@ -642,7 +642,7 @@ static int daqp_ao_insn_write(struct comedi_device *dev, | |||
| 642 | /* Make sure D/A update mode is direct update */ | 642 | /* Make sure D/A update mode is direct update */ |
| 643 | outb(0, dev->iobase + DAQP_AUX_REG); | 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 | unsigned int val = data[i]; | 646 | unsigned int val = data[i]; |
| 647 | int ret; | 647 | int ret; |
| 648 | 648 | ||
diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c index 45c05527a57a..faf4b4158cfa 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ap.c +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c | |||
| @@ -1051,7 +1051,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) | |||
| 1051 | return _FAIL; | 1051 | return _FAIL; |
| 1052 | 1052 | ||
| 1053 | 1053 | ||
| 1054 | if (len > MAX_IE_SZ) | 1054 | if (len < 0 || len > MAX_IE_SZ) |
| 1055 | return _FAIL; | 1055 | return _FAIL; |
| 1056 | 1056 | ||
| 1057 | pbss_network->IELength = len; | 1057 | pbss_network->IELength = len; |
diff --git a/drivers/staging/rtlwifi/rtl8822be/hw.c b/drivers/staging/rtlwifi/rtl8822be/hw.c index 7947edb239a1..88ba5b2fea6a 100644 --- a/drivers/staging/rtlwifi/rtl8822be/hw.c +++ b/drivers/staging/rtlwifi/rtl8822be/hw.c | |||
| @@ -803,7 +803,7 @@ static void _rtl8822be_enable_aspm_back_door(struct ieee80211_hw *hw) | |||
| 803 | return; | 803 | return; |
| 804 | 804 | ||
| 805 | pci_read_config_byte(rtlpci->pdev, 0x70f, &tmp); | 805 | pci_read_config_byte(rtlpci->pdev, 0x70f, &tmp); |
| 806 | pci_write_config_byte(rtlpci->pdev, 0x70f, tmp | BIT(7)); | 806 | pci_write_config_byte(rtlpci->pdev, 0x70f, tmp | ASPM_L1_LATENCY << 3); |
| 807 | 807 | ||
| 808 | pci_read_config_byte(rtlpci->pdev, 0x719, &tmp); | 808 | pci_read_config_byte(rtlpci->pdev, 0x719, &tmp); |
| 809 | pci_write_config_byte(rtlpci->pdev, 0x719, tmp | BIT(3) | BIT(4)); | 809 | pci_write_config_byte(rtlpci->pdev, 0x719, tmp | BIT(3) | BIT(4)); |
diff --git a/drivers/staging/rtlwifi/wifi.h b/drivers/staging/rtlwifi/wifi.h index 012fb618840b..a45f0eb69d3f 100644 --- a/drivers/staging/rtlwifi/wifi.h +++ b/drivers/staging/rtlwifi/wifi.h | |||
| @@ -88,6 +88,7 @@ | |||
| 88 | #define RTL_USB_MAX_RX_COUNT 100 | 88 | #define RTL_USB_MAX_RX_COUNT 100 |
| 89 | #define QBSS_LOAD_SIZE 5 | 89 | #define QBSS_LOAD_SIZE 5 |
| 90 | #define MAX_WMMELE_LENGTH 64 | 90 | #define MAX_WMMELE_LENGTH 64 |
| 91 | #define ASPM_L1_LATENCY 7 | ||
| 91 | 92 | ||
| 92 | #define TOTAL_CAM_ENTRY 32 | 93 | #define TOTAL_CAM_ENTRY 32 |
| 93 | 94 | ||
diff --git a/drivers/staging/typec/Kconfig b/drivers/staging/typec/Kconfig index 3aa981fbc8f5..e45ed08a5166 100644 --- a/drivers/staging/typec/Kconfig +++ b/drivers/staging/typec/Kconfig | |||
| @@ -11,6 +11,7 @@ config TYPEC_TCPCI | |||
| 11 | 11 | ||
| 12 | config TYPEC_RT1711H | 12 | config TYPEC_RT1711H |
| 13 | tristate "Richtek RT1711H Type-C chip driver" | 13 | tristate "Richtek RT1711H Type-C chip driver" |
| 14 | depends on I2C | ||
| 14 | select TYPEC_TCPCI | 15 | select TYPEC_TCPCI |
| 15 | help | 16 | help |
| 16 | Richtek RT1711H Type-C chip driver that works with | 17 | Richtek RT1711H Type-C chip driver that works with |
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 01ac306131c1..10db5656fd5d 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c | |||
| @@ -3727,11 +3727,16 @@ core_scsi3_pri_read_keys(struct se_cmd *cmd) | |||
| 3727 | * Check for overflow of 8byte PRI READ_KEYS payload and | 3727 | * Check for overflow of 8byte PRI READ_KEYS payload and |
| 3728 | * next reservation key list descriptor. | 3728 | * next reservation key list descriptor. |
| 3729 | */ | 3729 | */ |
| 3730 | if ((add_len + 8) > (cmd->data_length - 8)) | 3730 | if (off + 8 <= cmd->data_length) { |
| 3731 | break; | 3731 | put_unaligned_be64(pr_reg->pr_res_key, &buf[off]); |
| 3732 | 3732 | off += 8; | |
| 3733 | put_unaligned_be64(pr_reg->pr_res_key, &buf[off]); | 3733 | } |
| 3734 | off += 8; | 3734 | /* |
| 3735 | * SPC5r17: 6.16.2 READ KEYS service action | ||
| 3736 | * The ADDITIONAL LENGTH field indicates the number of bytes in | ||
| 3737 | * the Reservation key list. The contents of the ADDITIONAL | ||
| 3738 | * LENGTH field are not altered based on the allocation length | ||
| 3739 | */ | ||
| 3735 | add_len += 8; | 3740 | add_len += 8; |
| 3736 | } | 3741 | } |
| 3737 | spin_unlock(&dev->t10_pr.registration_lock); | 3742 | spin_unlock(&dev->t10_pr.registration_lock); |
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 7f96dfa32b9c..d8dc3d22051f 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c | |||
| @@ -656,7 +656,7 @@ static void scatter_data_area(struct tcmu_dev *udev, | |||
| 656 | } | 656 | } |
| 657 | 657 | ||
| 658 | static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, | 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 | struct se_cmd *se_cmd = cmd->se_cmd; | 661 | struct se_cmd *se_cmd = cmd->se_cmd; |
| 662 | int i, dbi; | 662 | int i, dbi; |
| @@ -689,7 +689,7 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, | |||
| 689 | for_each_sg(data_sg, sg, data_nents, i) { | 689 | for_each_sg(data_sg, sg, data_nents, i) { |
| 690 | int sg_remaining = sg->length; | 690 | int sg_remaining = sg->length; |
| 691 | to = kmap_atomic(sg_page(sg)) + sg->offset; | 691 | to = kmap_atomic(sg_page(sg)) + sg->offset; |
| 692 | while (sg_remaining > 0) { | 692 | while (sg_remaining > 0 && read_len > 0) { |
| 693 | if (block_remaining == 0) { | 693 | if (block_remaining == 0) { |
| 694 | if (from) | 694 | if (from) |
| 695 | kunmap_atomic(from); | 695 | kunmap_atomic(from); |
| @@ -701,6 +701,8 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, | |||
| 701 | } | 701 | } |
| 702 | copy_bytes = min_t(size_t, sg_remaining, | 702 | copy_bytes = min_t(size_t, sg_remaining, |
| 703 | block_remaining); | 703 | block_remaining); |
| 704 | if (read_len < copy_bytes) | ||
| 705 | copy_bytes = read_len; | ||
| 704 | offset = DATA_BLOCK_SIZE - block_remaining; | 706 | offset = DATA_BLOCK_SIZE - block_remaining; |
| 705 | tcmu_flush_dcache_range(from, copy_bytes); | 707 | tcmu_flush_dcache_range(from, copy_bytes); |
| 706 | memcpy(to + sg->length - sg_remaining, from + offset, | 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, | |||
| 708 | 710 | ||
| 709 | sg_remaining -= copy_bytes; | 711 | sg_remaining -= copy_bytes; |
| 710 | block_remaining -= copy_bytes; | 712 | block_remaining -= copy_bytes; |
| 713 | read_len -= copy_bytes; | ||
| 711 | } | 714 | } |
| 712 | kunmap_atomic(to - sg->offset); | 715 | kunmap_atomic(to - sg->offset); |
| 716 | if (read_len == 0) | ||
| 717 | break; | ||
| 713 | } | 718 | } |
| 714 | if (from) | 719 | if (from) |
| 715 | kunmap_atomic(from); | 720 | kunmap_atomic(from); |
| @@ -1042,6 +1047,8 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * | |||
| 1042 | { | 1047 | { |
| 1043 | struct se_cmd *se_cmd = cmd->se_cmd; | 1048 | struct se_cmd *se_cmd = cmd->se_cmd; |
| 1044 | struct tcmu_dev *udev = cmd->tcmu_dev; | 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 | * cmd has been completed already from timeout, just reclaim | 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 * | |||
| 1056 | pr_warn("TCMU: Userspace set UNKNOWN_OP flag on se_cmd %p\n", | 1063 | pr_warn("TCMU: Userspace set UNKNOWN_OP flag on se_cmd %p\n", |
| 1057 | cmd->se_cmd); | 1064 | cmd->se_cmd); |
| 1058 | entry->rsp.scsi_status = SAM_STAT_CHECK_CONDITION; | 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 | transport_copy_sense_to_cmd(se_cmd, entry->rsp.sense_buffer); | 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 | /* Get Data-In buffer before clean up */ | 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 | } else if (se_cmd->data_direction == DMA_FROM_DEVICE) { | 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 | } else if (se_cmd->data_direction == DMA_TO_DEVICE) { | 1088 | } else if (se_cmd->data_direction == DMA_TO_DEVICE) { |
| 1067 | /* TODO: */ | 1089 | /* TODO: */ |
| 1068 | } else if (se_cmd->data_direction != DMA_NONE) { | 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 * | |||
| 1070 | se_cmd->data_direction); | 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 | out: | 1103 | out: |
| 1076 | cmd->se_cmd = NULL; | 1104 | cmd->se_cmd = NULL; |
| @@ -1740,7 +1768,7 @@ static int tcmu_configure_device(struct se_device *dev) | |||
| 1740 | /* Initialise the mailbox of the ring buffer */ | 1768 | /* Initialise the mailbox of the ring buffer */ |
| 1741 | mb = udev->mb_addr; | 1769 | mb = udev->mb_addr; |
| 1742 | mb->version = TCMU_MAILBOX_VERSION; | 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 | mb->cmdr_off = CMDR_OFF; | 1772 | mb->cmdr_off = CMDR_OFF; |
| 1745 | mb->cmdr_size = udev->cmdr_size; | 1773 | mb->cmdr_size = udev->cmdr_size; |
| 1746 | 1774 | ||
diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c index 6281266b8ec0..a923ebdeb73c 100644 --- a/drivers/thunderbolt/domain.c +++ b/drivers/thunderbolt/domain.c | |||
| @@ -213,6 +213,10 @@ static ssize_t boot_acl_store(struct device *dev, struct device_attribute *attr, | |||
| 213 | goto err_free_acl; | 213 | goto err_free_acl; |
| 214 | } | 214 | } |
| 215 | ret = tb->cm_ops->set_boot_acl(tb, acl, tb->nboot_acl); | 215 | ret = tb->cm_ops->set_boot_acl(tb, acl, tb->nboot_acl); |
| 216 | if (!ret) { | ||
| 217 | /* Notify userspace about the change */ | ||
| 218 | kobject_uevent(&tb->dev.kobj, KOBJ_CHANGE); | ||
| 219 | } | ||
| 216 | mutex_unlock(&tb->lock); | 220 | mutex_unlock(&tb->lock); |
| 217 | 221 | ||
| 218 | err_free_acl: | 222 | err_free_acl: |
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index cbe98bc2b998..431742201709 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
| @@ -124,6 +124,8 @@ struct n_tty_data { | |||
| 124 | struct mutex output_lock; | 124 | struct mutex output_lock; |
| 125 | }; | 125 | }; |
| 126 | 126 | ||
| 127 | #define MASK(x) ((x) & (N_TTY_BUF_SIZE - 1)) | ||
| 128 | |||
| 127 | static inline size_t read_cnt(struct n_tty_data *ldata) | 129 | static inline size_t read_cnt(struct n_tty_data *ldata) |
| 128 | { | 130 | { |
| 129 | return ldata->read_head - ldata->read_tail; | 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) | |||
| 141 | 143 | ||
| 142 | static inline unsigned char echo_buf(struct n_tty_data *ldata, size_t i) | 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 | return ldata->echo_buf[i & (N_TTY_BUF_SIZE - 1)]; | 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) | |||
| 316 | static void reset_buffer_flags(struct n_tty_data *ldata) | 319 | static void reset_buffer_flags(struct n_tty_data *ldata) |
| 317 | { | 320 | { |
| 318 | ldata->read_head = ldata->canon_head = ldata->read_tail = 0; | 321 | ldata->read_head = ldata->canon_head = ldata->read_tail = 0; |
| 319 | ldata->echo_head = ldata->echo_tail = ldata->echo_commit = 0; | ||
| 320 | ldata->commit_head = 0; | 322 | ldata->commit_head = 0; |
| 321 | ldata->echo_mark = 0; | ||
| 322 | ldata->line_start = 0; | 323 | ldata->line_start = 0; |
| 323 | 324 | ||
| 324 | ldata->erasing = 0; | 325 | ldata->erasing = 0; |
| @@ -617,13 +618,20 @@ static size_t __process_echoes(struct tty_struct *tty) | |||
| 617 | old_space = space = tty_write_room(tty); | 618 | old_space = space = tty_write_room(tty); |
| 618 | 619 | ||
| 619 | tail = ldata->echo_tail; | 620 | tail = ldata->echo_tail; |
| 620 | while (ldata->echo_commit != tail) { | 621 | while (MASK(ldata->echo_commit) != MASK(tail)) { |
| 621 | c = echo_buf(ldata, tail); | 622 | c = echo_buf(ldata, tail); |
| 622 | if (c == ECHO_OP_START) { | 623 | if (c == ECHO_OP_START) { |
| 623 | unsigned char op; | 624 | unsigned char op; |
| 624 | int no_space_left = 0; | 625 | int no_space_left = 0; |
| 625 | 626 | ||
| 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; | ||
| 634 | /* | ||
| 627 | * If the buffer byte is the start of a multi-byte | 635 | * If the buffer byte is the start of a multi-byte |
| 628 | * operation, get the next byte, which is either the | 636 | * operation, get the next byte, which is either the |
| 629 | * op code or a control character value. | 637 | * op code or a control character value. |
| @@ -634,6 +642,8 @@ static size_t __process_echoes(struct tty_struct *tty) | |||
| 634 | unsigned int num_chars, num_bs; | 642 | unsigned int num_chars, num_bs; |
| 635 | 643 | ||
| 636 | case ECHO_OP_ERASE_TAB: | 644 | case ECHO_OP_ERASE_TAB: |
| 645 | if (MASK(ldata->echo_commit) == MASK(tail + 2)) | ||
| 646 | goto not_yet_stored; | ||
| 637 | num_chars = echo_buf(ldata, tail + 2); | 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) | |||
| 728 | /* If the echo buffer is nearly full (so that the possibility exists | 738 | /* If the echo buffer is nearly full (so that the possibility exists |
| 729 | * of echo overrun before the next commit), then discard enough | 739 | * of echo overrun before the next commit), then discard enough |
| 730 | * data at the tail to prevent a subsequent overrun */ | 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 | if (echo_buf(ldata, tail) == ECHO_OP_START) { | 743 | if (echo_buf(ldata, tail) == ECHO_OP_START) { |
| 733 | if (echo_buf(ldata, tail + 1) == ECHO_OP_ERASE_TAB) | 744 | if (echo_buf(ldata, tail + 1) == ECHO_OP_ERASE_TAB) |
| 734 | tail += 3; | 745 | tail += 3; |
| @@ -738,6 +749,7 @@ static size_t __process_echoes(struct tty_struct *tty) | |||
| 738 | tail++; | 749 | tail++; |
| 739 | } | 750 | } |
| 740 | 751 | ||
| 752 | not_yet_stored: | ||
| 741 | ldata->echo_tail = tail; | 753 | ldata->echo_tail = tail; |
| 742 | return old_space - space; | 754 | return old_space - space; |
| 743 | } | 755 | } |
| @@ -748,6 +760,7 @@ static void commit_echoes(struct tty_struct *tty) | |||
| 748 | size_t nr, old, echoed; | 760 | size_t nr, old, echoed; |
| 749 | size_t head; | 761 | size_t head; |
| 750 | 762 | ||
| 763 | mutex_lock(&ldata->output_lock); | ||
| 751 | head = ldata->echo_head; | 764 | head = ldata->echo_head; |
| 752 | ldata->echo_mark = head; | 765 | ldata->echo_mark = head; |
| 753 | old = ldata->echo_commit - ldata->echo_tail; | 766 | old = ldata->echo_commit - ldata->echo_tail; |
| @@ -756,10 +769,12 @@ static void commit_echoes(struct tty_struct *tty) | |||
| 756 | * is over the threshold (and try again each time another | 769 | * is over the threshold (and try again each time another |
| 757 | * block is accumulated) */ | 770 | * block is accumulated) */ |
| 758 | nr = head - ldata->echo_tail; | 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 | return; | 775 | return; |
| 776 | } | ||
| 761 | 777 | ||
| 762 | mutex_lock(&ldata->output_lock); | ||
| 763 | ldata->echo_commit = head; | 778 | ldata->echo_commit = head; |
| 764 | echoed = __process_echoes(tty); | 779 | echoed = __process_echoes(tty); |
| 765 | mutex_unlock(&ldata->output_lock); | 780 | mutex_unlock(&ldata->output_lock); |
| @@ -810,7 +825,9 @@ static void flush_echoes(struct tty_struct *tty) | |||
| 810 | 825 | ||
| 811 | static inline void add_echo_byte(unsigned char c, struct n_tty_data *ldata) | 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) | |||
| 978 | } | 995 | } |
| 979 | 996 | ||
| 980 | seen_alnums = 0; | 997 | seen_alnums = 0; |
| 981 | while (ldata->read_head != ldata->canon_head) { | 998 | while (MASK(ldata->read_head) != MASK(ldata->canon_head)) { |
| 982 | head = ldata->read_head; | 999 | head = ldata->read_head; |
| 983 | 1000 | ||
| 984 | /* erase a single possibly multibyte character */ | 1001 | /* erase a single possibly multibyte character */ |
| 985 | do { | 1002 | do { |
| 986 | head--; | 1003 | head--; |
| 987 | c = read_buf(ldata, head); | 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 | /* do not partially erase */ | 1008 | /* do not partially erase */ |
| 991 | if (is_continuation(c, tty)) | 1009 | if (is_continuation(c, tty)) |
| @@ -1027,7 +1045,7 @@ static void eraser(unsigned char c, struct tty_struct *tty) | |||
| 1027 | * This info is used to go back the correct | 1045 | * This info is used to go back the correct |
| 1028 | * number of columns. | 1046 | * number of columns. |
| 1029 | */ | 1047 | */ |
| 1030 | while (tail != ldata->canon_head) { | 1048 | while (MASK(tail) != MASK(ldata->canon_head)) { |
| 1031 | tail--; | 1049 | tail--; |
| 1032 | c = read_buf(ldata, tail); | 1050 | c = read_buf(ldata, tail); |
| 1033 | if (c == '\t') { | 1051 | if (c == '\t') { |
| @@ -1302,7 +1320,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c) | |||
| 1302 | finish_erasing(ldata); | 1320 | finish_erasing(ldata); |
| 1303 | echo_char(c, tty); | 1321 | echo_char(c, tty); |
| 1304 | echo_char_raw('\n', ldata); | 1322 | echo_char_raw('\n', ldata); |
| 1305 | while (tail != ldata->read_head) { | 1323 | while (MASK(tail) != MASK(ldata->read_head)) { |
| 1306 | echo_char(read_buf(ldata, tail), tty); | 1324 | echo_char(read_buf(ldata, tail), tty); |
| 1307 | tail++; | 1325 | tail++; |
| 1308 | } | 1326 | } |
| @@ -1878,30 +1896,21 @@ static int n_tty_open(struct tty_struct *tty) | |||
| 1878 | struct n_tty_data *ldata; | 1896 | struct n_tty_data *ldata; |
| 1879 | 1897 | ||
| 1880 | /* Currently a malloc failure here can panic */ | 1898 | /* Currently a malloc failure here can panic */ |
| 1881 | ldata = vmalloc(sizeof(*ldata)); | 1899 | ldata = vzalloc(sizeof(*ldata)); |
| 1882 | if (!ldata) | 1900 | if (!ldata) |
| 1883 | goto err; | 1901 | return -ENOMEM; |
| 1884 | 1902 | ||
| 1885 | ldata->overrun_time = jiffies; | 1903 | ldata->overrun_time = jiffies; |
| 1886 | mutex_init(&ldata->atomic_read_lock); | 1904 | mutex_init(&ldata->atomic_read_lock); |
| 1887 | mutex_init(&ldata->output_lock); | 1905 | mutex_init(&ldata->output_lock); |
| 1888 | 1906 | ||
| 1889 | tty->disc_data = ldata; | 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 | tty->closing = 0; | 1908 | tty->closing = 0; |
| 1897 | /* indicate buffer work may resume */ | 1909 | /* indicate buffer work may resume */ |
| 1898 | clear_bit(TTY_LDISC_HALTED, &tty->flags); | 1910 | clear_bit(TTY_LDISC_HALTED, &tty->flags); |
| 1899 | n_tty_set_termios(tty, NULL); | 1911 | n_tty_set_termios(tty, NULL); |
| 1900 | tty_unthrottle(tty); | 1912 | tty_unthrottle(tty); |
| 1901 | |||
| 1902 | return 0; | 1913 | return 0; |
| 1903 | err: | ||
| 1904 | return -ENOMEM; | ||
| 1905 | } | 1914 | } |
| 1906 | 1915 | ||
| 1907 | static inline int input_available_p(struct tty_struct *tty, int poll) | 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) | |||
| 2411 | tail = ldata->read_tail; | 2420 | tail = ldata->read_tail; |
| 2412 | nr = head - tail; | 2421 | nr = head - tail; |
| 2413 | /* Skip EOF-chars.. */ | 2422 | /* Skip EOF-chars.. */ |
| 2414 | while (head != tail) { | 2423 | while (MASK(head) != MASK(tail)) { |
| 2415 | if (test_bit(tail & (N_TTY_BUF_SIZE - 1), ldata->read_flags) && | 2424 | if (test_bit(tail & (N_TTY_BUF_SIZE - 1), ldata->read_flags) && |
| 2416 | read_buf(ldata, tail) == __DISABLED_CHAR) | 2425 | read_buf(ldata, tail) == __DISABLED_CHAR) |
| 2417 | nr--; | 2426 | nr--; |
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index df93b727e984..9e59f4788589 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c | |||
| @@ -617,6 +617,7 @@ EXPORT_SYMBOL_GPL(__serdev_device_driver_register); | |||
| 617 | static void __exit serdev_exit(void) | 617 | static void __exit serdev_exit(void) |
| 618 | { | 618 | { |
| 619 | bus_unregister(&serdev_bus_type); | 619 | bus_unregister(&serdev_bus_type); |
| 620 | ida_destroy(&ctrl_ida); | ||
| 620 | } | 621 | } |
| 621 | module_exit(serdev_exit); | 622 | module_exit(serdev_exit); |
| 622 | 623 | ||
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 3296a05cda2d..f80a300b5d68 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c | |||
| @@ -3339,9 +3339,7 @@ static const struct pci_device_id blacklist[] = { | |||
| 3339 | /* multi-io cards handled by parport_serial */ | 3339 | /* multi-io cards handled by parport_serial */ |
| 3340 | { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */ | 3340 | { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */ |
| 3341 | { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */ | 3341 | { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */ |
| 3342 | { PCI_DEVICE(0x4348, 0x7173), }, /* WCH CH355 4S */ | ||
| 3343 | { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */ | 3342 | { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */ |
| 3344 | { PCI_DEVICE(0x1c00, 0x3470), }, /* WCH CH384 4S */ | ||
| 3345 | 3343 | ||
| 3346 | /* Moxa Smartio MUE boards handled by 8250_moxa */ | 3344 | /* Moxa Smartio MUE boards handled by 8250_moxa */ |
| 3347 | { PCI_VDEVICE(MOXA, 0x1024), }, | 3345 | { PCI_VDEVICE(MOXA, 0x1024), }, |
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 1eb1a376a041..15eb6c829d39 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c | |||
| @@ -784,7 +784,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ | |||
| 784 | if (!*vc->vc_uni_pagedir_loc) | 784 | if (!*vc->vc_uni_pagedir_loc) |
| 785 | con_set_default_unimap(vc); | 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 | if (!vc->vc_screenbuf) | 788 | if (!vc->vc_screenbuf) |
| 789 | goto err_free; | 789 | goto err_free; |
| 790 | 790 | ||
| @@ -871,7 +871,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, | |||
| 871 | 871 | ||
| 872 | if (new_screen_size > (4 << 20)) | 872 | if (new_screen_size > (4 << 20)) |
| 873 | return -EINVAL; | 873 | return -EINVAL; |
| 874 | newscreen = kmalloc(new_screen_size, GFP_USER); | 874 | newscreen = kzalloc(new_screen_size, GFP_USER); |
| 875 | if (!newscreen) | 875 | if (!newscreen) |
| 876 | return -ENOMEM; | 876 | return -ENOMEM; |
| 877 | 877 | ||
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index e8f4ac9400ea..5d421d7e8904 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c | |||
| @@ -215,7 +215,20 @@ static ssize_t name_show(struct device *dev, | |||
| 215 | struct device_attribute *attr, char *buf) | 215 | struct device_attribute *attr, char *buf) |
| 216 | { | 216 | { |
| 217 | struct uio_device *idev = dev_get_drvdata(dev); | 217 | struct uio_device *idev = dev_get_drvdata(dev); |
| 218 | return sprintf(buf, "%s\n", idev->info->name); | 218 | int ret; |
| 219 | |||
| 220 | mutex_lock(&idev->info_lock); | ||
| 221 | if (!idev->info) { | ||
| 222 | ret = -EINVAL; | ||
| 223 | dev_err(dev, "the device has been unregistered\n"); | ||
| 224 | goto out; | ||
| 225 | } | ||
| 226 | |||
| 227 | ret = sprintf(buf, "%s\n", idev->info->name); | ||
| 228 | |||
| 229 | out: | ||
| 230 | mutex_unlock(&idev->info_lock); | ||
| 231 | return ret; | ||
| 219 | } | 232 | } |
| 220 | static DEVICE_ATTR_RO(name); | 233 | static DEVICE_ATTR_RO(name); |
| 221 | 234 | ||
| @@ -223,7 +236,20 @@ static ssize_t version_show(struct device *dev, | |||
| 223 | struct device_attribute *attr, char *buf) | 236 | struct device_attribute *attr, char *buf) |
| 224 | { | 237 | { |
| 225 | struct uio_device *idev = dev_get_drvdata(dev); | 238 | struct uio_device *idev = dev_get_drvdata(dev); |
| 226 | return sprintf(buf, "%s\n", idev->info->version); | 239 | int ret; |
| 240 | |||
| 241 | mutex_lock(&idev->info_lock); | ||
| 242 | if (!idev->info) { | ||
| 243 | ret = -EINVAL; | ||
| 244 | dev_err(dev, "the device has been unregistered\n"); | ||
| 245 | goto out; | ||
| 246 | } | ||
| 247 | |||
| 248 | ret = sprintf(buf, "%s\n", idev->info->version); | ||
| 249 | |||
| 250 | out: | ||
| 251 | mutex_unlock(&idev->info_lock); | ||
| 252 | return ret; | ||
| 227 | } | 253 | } |
| 228 | static DEVICE_ATTR_RO(version); | 254 | static DEVICE_ATTR_RO(version); |
| 229 | 255 | ||
| @@ -415,11 +441,15 @@ EXPORT_SYMBOL_GPL(uio_event_notify); | |||
| 415 | static irqreturn_t uio_interrupt(int irq, void *dev_id) | 441 | static irqreturn_t uio_interrupt(int irq, void *dev_id) |
| 416 | { | 442 | { |
| 417 | struct uio_device *idev = (struct uio_device *)dev_id; | 443 | struct uio_device *idev = (struct uio_device *)dev_id; |
| 418 | irqreturn_t ret = idev->info->handler(irq, idev->info); | 444 | irqreturn_t ret; |
| 419 | 445 | ||
| 446 | mutex_lock(&idev->info_lock); | ||
| 447 | |||
| 448 | ret = idev->info->handler(irq, idev->info); | ||
| 420 | if (ret == IRQ_HANDLED) | 449 | if (ret == IRQ_HANDLED) |
| 421 | uio_event_notify(idev->info); | 450 | uio_event_notify(idev->info); |
| 422 | 451 | ||
| 452 | mutex_unlock(&idev->info_lock); | ||
| 423 | return ret; | 453 | return ret; |
| 424 | } | 454 | } |
| 425 | 455 | ||
| @@ -433,7 +463,6 @@ static int uio_open(struct inode *inode, struct file *filep) | |||
| 433 | struct uio_device *idev; | 463 | struct uio_device *idev; |
| 434 | struct uio_listener *listener; | 464 | struct uio_listener *listener; |
| 435 | int ret = 0; | 465 | int ret = 0; |
| 436 | unsigned long flags; | ||
| 437 | 466 | ||
| 438 | mutex_lock(&minor_lock); | 467 | mutex_lock(&minor_lock); |
| 439 | idev = idr_find(&uio_idr, iminor(inode)); | 468 | idev = idr_find(&uio_idr, iminor(inode)); |
| @@ -460,10 +489,16 @@ static int uio_open(struct inode *inode, struct file *filep) | |||
| 460 | listener->event_count = atomic_read(&idev->event); | 489 | listener->event_count = atomic_read(&idev->event); |
| 461 | filep->private_data = listener; | 490 | filep->private_data = listener; |
| 462 | 491 | ||
| 463 | spin_lock_irqsave(&idev->info_lock, flags); | 492 | mutex_lock(&idev->info_lock); |
| 493 | if (!idev->info) { | ||
| 494 | mutex_unlock(&idev->info_lock); | ||
| 495 | ret = -EINVAL; | ||
| 496 | goto err_alloc_listener; | ||
| 497 | } | ||
| 498 | |||
| 464 | if (idev->info && idev->info->open) | 499 | if (idev->info && idev->info->open) |
| 465 | ret = idev->info->open(idev->info, inode); | 500 | ret = idev->info->open(idev->info, inode); |
| 466 | spin_unlock_irqrestore(&idev->info_lock, flags); | 501 | mutex_unlock(&idev->info_lock); |
| 467 | if (ret) | 502 | if (ret) |
| 468 | goto err_infoopen; | 503 | goto err_infoopen; |
| 469 | 504 | ||
| @@ -495,12 +530,11 @@ static int uio_release(struct inode *inode, struct file *filep) | |||
| 495 | int ret = 0; | 530 | int ret = 0; |
| 496 | struct uio_listener *listener = filep->private_data; | 531 | struct uio_listener *listener = filep->private_data; |
| 497 | struct uio_device *idev = listener->dev; | 532 | struct uio_device *idev = listener->dev; |
| 498 | unsigned long flags; | ||
| 499 | 533 | ||
| 500 | spin_lock_irqsave(&idev->info_lock, flags); | 534 | mutex_lock(&idev->info_lock); |
| 501 | if (idev->info && idev->info->release) | 535 | if (idev->info && idev->info->release) |
| 502 | ret = idev->info->release(idev->info, inode); | 536 | ret = idev->info->release(idev->info, inode); |
| 503 | spin_unlock_irqrestore(&idev->info_lock, flags); | 537 | mutex_unlock(&idev->info_lock); |
| 504 | 538 | ||
| 505 | module_put(idev->owner); | 539 | module_put(idev->owner); |
| 506 | kfree(listener); | 540 | kfree(listener); |
| @@ -513,12 +547,11 @@ static __poll_t uio_poll(struct file *filep, poll_table *wait) | |||
| 513 | struct uio_listener *listener = filep->private_data; | 547 | struct uio_listener *listener = filep->private_data; |
| 514 | struct uio_device *idev = listener->dev; | 548 | struct uio_device *idev = listener->dev; |
| 515 | __poll_t ret = 0; | 549 | __poll_t ret = 0; |
| 516 | unsigned long flags; | ||
| 517 | 550 | ||
| 518 | spin_lock_irqsave(&idev->info_lock, flags); | 551 | mutex_lock(&idev->info_lock); |
| 519 | if (!idev->info || !idev->info->irq) | 552 | if (!idev->info || !idev->info->irq) |
| 520 | ret = -EIO; | 553 | ret = -EIO; |
| 521 | spin_unlock_irqrestore(&idev->info_lock, flags); | 554 | mutex_unlock(&idev->info_lock); |
| 522 | 555 | ||
| 523 | if (ret) | 556 | if (ret) |
| 524 | return ret; | 557 | return ret; |
| @@ -537,12 +570,11 @@ static ssize_t uio_read(struct file *filep, char __user *buf, | |||
| 537 | DECLARE_WAITQUEUE(wait, current); | 570 | DECLARE_WAITQUEUE(wait, current); |
| 538 | ssize_t retval = 0; | 571 | ssize_t retval = 0; |
| 539 | s32 event_count; | 572 | s32 event_count; |
| 540 | unsigned long flags; | ||
| 541 | 573 | ||
| 542 | spin_lock_irqsave(&idev->info_lock, flags); | 574 | mutex_lock(&idev->info_lock); |
| 543 | if (!idev->info || !idev->info->irq) | 575 | if (!idev->info || !idev->info->irq) |
| 544 | retval = -EIO; | 576 | retval = -EIO; |
| 545 | spin_unlock_irqrestore(&idev->info_lock, flags); | 577 | mutex_unlock(&idev->info_lock); |
| 546 | 578 | ||
| 547 | if (retval) | 579 | if (retval) |
| 548 | return retval; | 580 | return retval; |
| @@ -592,9 +624,13 @@ static ssize_t uio_write(struct file *filep, const char __user *buf, | |||
| 592 | struct uio_device *idev = listener->dev; | 624 | struct uio_device *idev = listener->dev; |
| 593 | ssize_t retval; | 625 | ssize_t retval; |
| 594 | s32 irq_on; | 626 | s32 irq_on; |
| 595 | unsigned long flags; | ||
| 596 | 627 | ||
| 597 | spin_lock_irqsave(&idev->info_lock, flags); | 628 | mutex_lock(&idev->info_lock); |
| 629 | if (!idev->info) { | ||
| 630 | retval = -EINVAL; | ||
| 631 | goto out; | ||
| 632 | } | ||
| 633 | |||
| 598 | if (!idev->info || !idev->info->irq) { | 634 | if (!idev->info || !idev->info->irq) { |
| 599 | retval = -EIO; | 635 | retval = -EIO; |
| 600 | goto out; | 636 | goto out; |
| @@ -618,7 +654,7 @@ static ssize_t uio_write(struct file *filep, const char __user *buf, | |||
| 618 | retval = idev->info->irqcontrol(idev->info, irq_on); | 654 | retval = idev->info->irqcontrol(idev->info, irq_on); |
| 619 | 655 | ||
| 620 | out: | 656 | out: |
| 621 | spin_unlock_irqrestore(&idev->info_lock, flags); | 657 | mutex_unlock(&idev->info_lock); |
| 622 | return retval ? retval : sizeof(s32); | 658 | return retval ? retval : sizeof(s32); |
| 623 | } | 659 | } |
| 624 | 660 | ||
| @@ -640,10 +676,20 @@ static vm_fault_t uio_vma_fault(struct vm_fault *vmf) | |||
| 640 | struct page *page; | 676 | struct page *page; |
| 641 | unsigned long offset; | 677 | unsigned long offset; |
| 642 | void *addr; | 678 | void *addr; |
| 679 | int ret = 0; | ||
| 680 | int mi; | ||
| 643 | 681 | ||
| 644 | int mi = uio_find_mem_index(vmf->vma); | 682 | mutex_lock(&idev->info_lock); |
| 645 | if (mi < 0) | 683 | if (!idev->info) { |
| 646 | return VM_FAULT_SIGBUS; | 684 | ret = VM_FAULT_SIGBUS; |
| 685 | goto out; | ||
| 686 | } | ||
| 687 | |||
| 688 | mi = uio_find_mem_index(vmf->vma); | ||
| 689 | if (mi < 0) { | ||
| 690 | ret = VM_FAULT_SIGBUS; | ||
| 691 | goto out; | ||
| 692 | } | ||
| 647 | 693 | ||
| 648 | /* | 694 | /* |
| 649 | * We need to subtract mi because userspace uses offset = N*PAGE_SIZE | 695 | * We need to subtract mi because userspace uses offset = N*PAGE_SIZE |
| @@ -658,7 +704,11 @@ static vm_fault_t uio_vma_fault(struct vm_fault *vmf) | |||
| 658 | page = vmalloc_to_page(addr); | 704 | page = vmalloc_to_page(addr); |
| 659 | get_page(page); | 705 | get_page(page); |
| 660 | vmf->page = page; | 706 | vmf->page = page; |
| 661 | return 0; | 707 | |
| 708 | out: | ||
| 709 | mutex_unlock(&idev->info_lock); | ||
| 710 | |||
| 711 | return ret; | ||
| 662 | } | 712 | } |
| 663 | 713 | ||
| 664 | static const struct vm_operations_struct uio_logical_vm_ops = { | 714 | static const struct vm_operations_struct uio_logical_vm_ops = { |
| @@ -683,6 +733,7 @@ static int uio_mmap_physical(struct vm_area_struct *vma) | |||
| 683 | struct uio_device *idev = vma->vm_private_data; | 733 | struct uio_device *idev = vma->vm_private_data; |
| 684 | int mi = uio_find_mem_index(vma); | 734 | int mi = uio_find_mem_index(vma); |
| 685 | struct uio_mem *mem; | 735 | struct uio_mem *mem; |
| 736 | |||
| 686 | if (mi < 0) | 737 | if (mi < 0) |
| 687 | return -EINVAL; | 738 | return -EINVAL; |
| 688 | mem = idev->info->mem + mi; | 739 | mem = idev->info->mem + mi; |
| @@ -724,30 +775,46 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma) | |||
| 724 | 775 | ||
| 725 | vma->vm_private_data = idev; | 776 | vma->vm_private_data = idev; |
| 726 | 777 | ||
| 778 | mutex_lock(&idev->info_lock); | ||
| 779 | if (!idev->info) { | ||
| 780 | ret = -EINVAL; | ||
| 781 | goto out; | ||
| 782 | } | ||
| 783 | |||
| 727 | mi = uio_find_mem_index(vma); | 784 | mi = uio_find_mem_index(vma); |
| 728 | if (mi < 0) | 785 | if (mi < 0) { |
| 729 | return -EINVAL; | 786 | ret = -EINVAL; |
| 787 | goto out; | ||
| 788 | } | ||
| 730 | 789 | ||
| 731 | requested_pages = vma_pages(vma); | 790 | requested_pages = vma_pages(vma); |
| 732 | actual_pages = ((idev->info->mem[mi].addr & ~PAGE_MASK) | 791 | actual_pages = ((idev->info->mem[mi].addr & ~PAGE_MASK) |
| 733 | + idev->info->mem[mi].size + PAGE_SIZE -1) >> PAGE_SHIFT; | 792 | + idev->info->mem[mi].size + PAGE_SIZE -1) >> PAGE_SHIFT; |
| 734 | if (requested_pages > actual_pages) | 793 | if (requested_pages > actual_pages) { |
| 735 | return -EINVAL; | 794 | ret = -EINVAL; |
| 795 | goto out; | ||
| 796 | } | ||
| 736 | 797 | ||
| 737 | if (idev->info->mmap) { | 798 | if (idev->info->mmap) { |
| 738 | ret = idev->info->mmap(idev->info, vma); | 799 | ret = idev->info->mmap(idev->info, vma); |
| 739 | return ret; | 800 | goto out; |
| 740 | } | 801 | } |
| 741 | 802 | ||
| 742 | switch (idev->info->mem[mi].memtype) { | 803 | switch (idev->info->mem[mi].memtype) { |
| 743 | case UIO_MEM_PHYS: | 804 | case UIO_MEM_PHYS: |
| 744 | return uio_mmap_physical(vma); | 805 | ret = uio_mmap_physical(vma); |
| 806 | break; | ||
| 745 | case UIO_MEM_LOGICAL: | 807 | case UIO_MEM_LOGICAL: |
| 746 | case UIO_MEM_VIRTUAL: | 808 | case UIO_MEM_VIRTUAL: |
| 747 | return uio_mmap_logical(vma); | 809 | ret = uio_mmap_logical(vma); |
| 810 | break; | ||
| 748 | default: | 811 | default: |
| 749 | return -EINVAL; | 812 | ret = -EINVAL; |
| 750 | } | 813 | } |
| 814 | |||
| 815 | out: | ||
| 816 | mutex_unlock(&idev->info_lock); | ||
| 817 | return 0; | ||
| 751 | } | 818 | } |
| 752 | 819 | ||
| 753 | static const struct file_operations uio_fops = { | 820 | static const struct file_operations uio_fops = { |
| @@ -865,7 +932,7 @@ int __uio_register_device(struct module *owner, | |||
| 865 | 932 | ||
| 866 | idev->owner = owner; | 933 | idev->owner = owner; |
| 867 | idev->info = info; | 934 | idev->info = info; |
| 868 | spin_lock_init(&idev->info_lock); | 935 | mutex_init(&idev->info_lock); |
| 869 | init_waitqueue_head(&idev->wait); | 936 | init_waitqueue_head(&idev->wait); |
| 870 | atomic_set(&idev->event, 0); | 937 | atomic_set(&idev->event, 0); |
| 871 | 938 | ||
| @@ -902,8 +969,9 @@ int __uio_register_device(struct module *owner, | |||
| 902 | * FDs at the time of unregister and therefore may not be | 969 | * FDs at the time of unregister and therefore may not be |
| 903 | * freed until they are released. | 970 | * freed until they are released. |
| 904 | */ | 971 | */ |
| 905 | ret = request_irq(info->irq, uio_interrupt, | 972 | ret = request_threaded_irq(info->irq, NULL, uio_interrupt, |
| 906 | info->irq_flags, info->name, idev); | 973 | info->irq_flags, info->name, idev); |
| 974 | |||
| 907 | if (ret) | 975 | if (ret) |
| 908 | goto err_request_irq; | 976 | goto err_request_irq; |
| 909 | } | 977 | } |
| @@ -928,7 +996,6 @@ EXPORT_SYMBOL_GPL(__uio_register_device); | |||
| 928 | void uio_unregister_device(struct uio_info *info) | 996 | void uio_unregister_device(struct uio_info *info) |
| 929 | { | 997 | { |
| 930 | struct uio_device *idev; | 998 | struct uio_device *idev; |
| 931 | unsigned long flags; | ||
| 932 | 999 | ||
| 933 | if (!info || !info->uio_dev) | 1000 | if (!info || !info->uio_dev) |
| 934 | return; | 1001 | return; |
| @@ -937,14 +1004,14 @@ void uio_unregister_device(struct uio_info *info) | |||
| 937 | 1004 | ||
| 938 | uio_free_minor(idev); | 1005 | uio_free_minor(idev); |
| 939 | 1006 | ||
| 1007 | mutex_lock(&idev->info_lock); | ||
| 940 | uio_dev_del_attributes(idev); | 1008 | uio_dev_del_attributes(idev); |
| 941 | 1009 | ||
| 942 | if (info->irq && info->irq != UIO_IRQ_CUSTOM) | 1010 | if (info->irq && info->irq != UIO_IRQ_CUSTOM) |
| 943 | free_irq(info->irq, idev); | 1011 | free_irq(info->irq, idev); |
| 944 | 1012 | ||
| 945 | spin_lock_irqsave(&idev->info_lock, flags); | ||
| 946 | idev->info = NULL; | 1013 | idev->info = NULL; |
| 947 | spin_unlock_irqrestore(&idev->info_lock, flags); | 1014 | mutex_unlock(&idev->info_lock); |
| 948 | 1015 | ||
| 949 | device_unregister(&idev->dev); | 1016 | device_unregister(&idev->dev); |
| 950 | 1017 | ||
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index af45aa3222b5..4638d9b066be 100644 --- a/drivers/usb/chipidea/host.c +++ b/drivers/usb/chipidea/host.c | |||
| @@ -124,8 +124,11 @@ static int host_start(struct ci_hdrc *ci) | |||
| 124 | 124 | ||
| 125 | hcd->power_budget = ci->platdata->power_budget; | 125 | hcd->power_budget = ci->platdata->power_budget; |
| 126 | hcd->tpl_support = ci->platdata->tpl_support; | 126 | hcd->tpl_support = ci->platdata->tpl_support; |
| 127 | if (ci->phy || ci->usb_phy) | 127 | if (ci->phy || ci->usb_phy) { |
| 128 | hcd->skip_phy_initialization = 1; | 128 | hcd->skip_phy_initialization = 1; |
| 129 | if (ci->usb_phy) | ||
| 130 | hcd->usb_phy = ci->usb_phy; | ||
| 131 | } | ||
| 129 | 132 | ||
| 130 | ehci = hcd_to_ehci(hcd); | 133 | ehci = hcd_to_ehci(hcd); |
| 131 | ehci->caps = ci->hw_bank.cap; | 134 | ehci->caps = ci->hw_bank.cap; |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 7b366a6c0b49..998b32d0167e 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
| @@ -1758,6 +1758,9 @@ static const struct usb_device_id acm_ids[] = { | |||
| 1758 | { USB_DEVICE(0x11ca, 0x0201), /* VeriFone Mx870 Gadget Serial */ | 1758 | { USB_DEVICE(0x11ca, 0x0201), /* VeriFone Mx870 Gadget Serial */ |
| 1759 | .driver_info = SINGLE_RX_URB, | 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 | { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */ | 1764 | { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */ |
| 1762 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ | 1765 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ |
| 1763 | }, | 1766 | }, |
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index c55def2f1320..097057d2eacf 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
| @@ -378,6 +378,10 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
| 378 | /* Corsair K70 RGB */ | 378 | /* Corsair K70 RGB */ |
| 379 | { USB_DEVICE(0x1b1c, 0x1b13), .driver_info = USB_QUIRK_DELAY_INIT }, | 379 | { USB_DEVICE(0x1b1c, 0x1b13), .driver_info = USB_QUIRK_DELAY_INIT }, |
| 380 | 380 | ||
| 381 | /* Corsair Strafe */ | ||
| 382 | { USB_DEVICE(0x1b1c, 0x1b15), .driver_info = USB_QUIRK_DELAY_INIT | | ||
| 383 | USB_QUIRK_DELAY_CTRL_MSG }, | ||
| 384 | |||
| 381 | /* Corsair Strafe RGB */ | 385 | /* Corsair Strafe RGB */ |
| 382 | { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT | | 386 | { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT | |
| 383 | USB_QUIRK_DELAY_CTRL_MSG }, | 387 | USB_QUIRK_DELAY_CTRL_MSG }, |
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index 4a56ac772a3c..71b3b08ad516 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h | |||
| @@ -1004,6 +1004,7 @@ struct dwc2_hregs_backup { | |||
| 1004 | * @frame_list_sz: Frame list size | 1004 | * @frame_list_sz: Frame list size |
| 1005 | * @desc_gen_cache: Kmem cache for generic descriptors | 1005 | * @desc_gen_cache: Kmem cache for generic descriptors |
| 1006 | * @desc_hsisoc_cache: Kmem cache for hs isochronous descriptors | 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 | * These are for peripheral mode: | 1009 | * These are for peripheral mode: |
| 1009 | * | 1010 | * |
| @@ -1177,6 +1178,8 @@ struct dwc2_hsotg { | |||
| 1177 | u32 frame_list_sz; | 1178 | u32 frame_list_sz; |
| 1178 | struct kmem_cache *desc_gen_cache; | 1179 | struct kmem_cache *desc_gen_cache; |
| 1179 | struct kmem_cache *desc_hsisoc_cache; | 1180 | struct kmem_cache *desc_hsisoc_cache; |
| 1181 | struct kmem_cache *unaligned_cache; | ||
| 1182 | #define DWC2_KMEM_UNALIGNED_BUF_SIZE 1024 | ||
| 1180 | 1183 | ||
| 1181 | #endif /* CONFIG_USB_DWC2_HOST || CONFIG_USB_DWC2_DUAL_ROLE */ | 1184 | #endif /* CONFIG_USB_DWC2_HOST || CONFIG_USB_DWC2_DUAL_ROLE */ |
| 1182 | 1185 | ||
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index f0d9ccf1d665..a0f82cca2d9a 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c | |||
| @@ -812,6 +812,7 @@ static int dwc2_gadget_fill_isoc_desc(struct dwc2_hsotg_ep *hs_ep, | |||
| 812 | u32 index; | 812 | u32 index; |
| 813 | u32 maxsize = 0; | 813 | u32 maxsize = 0; |
| 814 | u32 mask = 0; | 814 | u32 mask = 0; |
| 815 | u8 pid = 0; | ||
| 815 | 816 | ||
| 816 | maxsize = dwc2_gadget_get_desc_params(hs_ep, &mask); | 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, | |||
| 840 | ((len << DEV_DMA_NBYTES_SHIFT) & mask)); | 841 | ((len << DEV_DMA_NBYTES_SHIFT) & mask)); |
| 841 | 842 | ||
| 842 | if (hs_ep->dir_in) { | 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 | DEV_DMA_ISOC_PID_MASK) | | 849 | DEV_DMA_ISOC_PID_MASK) | |
| 845 | ((len % hs_ep->ep.maxpacket) ? | 850 | ((len % hs_ep->ep.maxpacket) ? |
| 846 | DEV_DMA_SHORT : 0) | | 851 | DEV_DMA_SHORT : 0) | |
| @@ -884,6 +889,7 @@ static void dwc2_gadget_start_isoc_ddma(struct dwc2_hsotg_ep *hs_ep) | |||
| 884 | struct dwc2_dma_desc *desc; | 889 | struct dwc2_dma_desc *desc; |
| 885 | 890 | ||
| 886 | if (list_empty(&hs_ep->queue)) { | 891 | if (list_empty(&hs_ep->queue)) { |
| 892 | hs_ep->target_frame = TARGET_FRAME_INITIAL; | ||
| 887 | dev_dbg(hsotg->dev, "%s: No requests in queue\n", __func__); | 893 | dev_dbg(hsotg->dev, "%s: No requests in queue\n", __func__); |
| 888 | return; | 894 | return; |
| 889 | } | 895 | } |
| @@ -2755,8 +2761,6 @@ static void dwc2_gadget_handle_out_token_ep_disabled(struct dwc2_hsotg_ep *ep) | |||
| 2755 | */ | 2761 | */ |
| 2756 | tmp = dwc2_hsotg_read_frameno(hsotg); | 2762 | tmp = dwc2_hsotg_read_frameno(hsotg); |
| 2757 | 2763 | ||
| 2758 | dwc2_hsotg_complete_request(hsotg, ep, get_ep_head(ep), 0); | ||
| 2759 | |||
| 2760 | if (using_desc_dma(hsotg)) { | 2764 | if (using_desc_dma(hsotg)) { |
| 2761 | if (ep->target_frame == TARGET_FRAME_INITIAL) { | 2765 | if (ep->target_frame == TARGET_FRAME_INITIAL) { |
| 2762 | /* Start first ISO Out */ | 2766 | /* Start first ISO Out */ |
| @@ -2817,9 +2821,6 @@ static void dwc2_gadget_handle_nak(struct dwc2_hsotg_ep *hs_ep) | |||
| 2817 | 2821 | ||
| 2818 | tmp = dwc2_hsotg_read_frameno(hsotg); | 2822 | tmp = dwc2_hsotg_read_frameno(hsotg); |
| 2819 | if (using_desc_dma(hsotg)) { | 2823 | if (using_desc_dma(hsotg)) { |
| 2820 | dwc2_hsotg_complete_request(hsotg, hs_ep, | ||
| 2821 | get_ep_head(hs_ep), 0); | ||
| 2822 | |||
| 2823 | hs_ep->target_frame = tmp; | 2824 | hs_ep->target_frame = tmp; |
| 2824 | dwc2_gadget_incr_frame_num(hs_ep); | 2825 | dwc2_gadget_incr_frame_num(hs_ep); |
| 2825 | dwc2_gadget_start_isoc_ddma(hs_ep); | 2826 | dwc2_gadget_start_isoc_ddma(hs_ep); |
| @@ -4739,9 +4740,11 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg) | |||
| 4739 | } | 4740 | } |
| 4740 | 4741 | ||
| 4741 | ret = usb_add_gadget_udc(dev, &hsotg->gadget); | 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 | return ret; | 4746 | return ret; |
| 4744 | 4747 | } | |
| 4745 | dwc2_hsotg_dump(hsotg); | 4748 | dwc2_hsotg_dump(hsotg); |
| 4746 | 4749 | ||
| 4747 | return 0; | 4750 | return 0; |
| @@ -4755,6 +4758,7 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg) | |||
| 4755 | int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg) | 4758 | int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg) |
| 4756 | { | 4759 | { |
| 4757 | usb_del_gadget_udc(&hsotg->gadget); | 4760 | usb_del_gadget_udc(&hsotg->gadget); |
| 4761 | dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, hsotg->ctrl_req); | ||
| 4758 | 4762 | ||
| 4759 | return 0; | 4763 | return 0; |
| 4760 | } | 4764 | } |
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index edaf0b6af4f0..b1104be3429c 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c | |||
| @@ -1567,11 +1567,20 @@ static void dwc2_hc_start_transfer(struct dwc2_hsotg *hsotg, | |||
| 1567 | } | 1567 | } |
| 1568 | 1568 | ||
| 1569 | if (hsotg->params.host_dma) { | 1569 | if (hsotg->params.host_dma) { |
| 1570 | dwc2_writel((u32)chan->xfer_dma, | 1570 | dma_addr_t dma_addr; |
| 1571 | hsotg->regs + HCDMA(chan->hc_num)); | 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 | if (dbg_hc(chan)) | 1581 | if (dbg_hc(chan)) |
| 1573 | dev_vdbg(hsotg->dev, "Wrote %08lx to HCDMA(%d)\n", | 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 | /* Start the split */ | 1586 | /* Start the split */ |
| @@ -2625,6 +2634,35 @@ static void dwc2_hc_init_xfer(struct dwc2_hsotg *hsotg, | |||
| 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 | #define DWC2_USB_DMA_ALIGN 4 | 2666 | #define DWC2_USB_DMA_ALIGN 4 |
| 2629 | 2667 | ||
| 2630 | struct dma_aligned_buffer { | 2668 | struct dma_aligned_buffer { |
| @@ -2802,6 +2840,32 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) | |||
| 2802 | /* Set the transfer attributes */ | 2840 | /* Set the transfer attributes */ |
| 2803 | dwc2_hc_init_xfer(hsotg, chan, qtd); | 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 | if (chan->ep_type == USB_ENDPOINT_XFER_INT || | 2869 | if (chan->ep_type == USB_ENDPOINT_XFER_INT || |
| 2806 | chan->ep_type == USB_ENDPOINT_XFER_ISOC) | 2870 | chan->ep_type == USB_ENDPOINT_XFER_ISOC) |
| 2807 | /* | 2871 | /* |
| @@ -5246,6 +5310,19 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) | |||
| 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 | hsotg->otg_port = 1; | 5326 | hsotg->otg_port = 1; |
| 5250 | hsotg->frame_list = NULL; | 5327 | hsotg->frame_list = NULL; |
| 5251 | hsotg->frame_list_dma = 0; | 5328 | hsotg->frame_list_dma = 0; |
| @@ -5280,8 +5357,9 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) | |||
| 5280 | return 0; | 5357 | return 0; |
| 5281 | 5358 | ||
| 5282 | error4: | 5359 | error4: |
| 5283 | kmem_cache_destroy(hsotg->desc_gen_cache); | 5360 | kmem_cache_destroy(hsotg->unaligned_cache); |
| 5284 | kmem_cache_destroy(hsotg->desc_hsisoc_cache); | 5361 | kmem_cache_destroy(hsotg->desc_hsisoc_cache); |
| 5362 | kmem_cache_destroy(hsotg->desc_gen_cache); | ||
| 5285 | error3: | 5363 | error3: |
| 5286 | dwc2_hcd_release(hsotg); | 5364 | dwc2_hcd_release(hsotg); |
| 5287 | error2: | 5365 | error2: |
| @@ -5322,8 +5400,9 @@ void dwc2_hcd_remove(struct dwc2_hsotg *hsotg) | |||
| 5322 | usb_remove_hcd(hcd); | 5400 | usb_remove_hcd(hcd); |
| 5323 | hsotg->priv = NULL; | 5401 | hsotg->priv = NULL; |
| 5324 | 5402 | ||
| 5325 | kmem_cache_destroy(hsotg->desc_gen_cache); | 5403 | kmem_cache_destroy(hsotg->unaligned_cache); |
| 5326 | kmem_cache_destroy(hsotg->desc_hsisoc_cache); | 5404 | kmem_cache_destroy(hsotg->desc_hsisoc_cache); |
| 5405 | kmem_cache_destroy(hsotg->desc_gen_cache); | ||
| 5327 | 5406 | ||
| 5328 | dwc2_hcd_release(hsotg); | 5407 | dwc2_hcd_release(hsotg); |
| 5329 | usb_put_hcd(hcd); | 5408 | usb_put_hcd(hcd); |
| @@ -5435,7 +5514,7 @@ int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg) | |||
| 5435 | dwc2_writel(hprt0, hsotg->regs + HPRT0); | 5514 | dwc2_writel(hprt0, hsotg->regs + HPRT0); |
| 5436 | 5515 | ||
| 5437 | /* Wait for the HPRT0.PrtSusp register field to be set */ | 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 | dev_warn(hsotg->dev, "Suspend wasn't generated\n"); | 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, | |||
| 5616 | return ret; | 5695 | return ret; |
| 5617 | } | 5696 | } |
| 5618 | 5697 | ||
| 5698 | dwc2_hcd_rem_wakeup(hsotg); | ||
| 5699 | |||
| 5619 | hsotg->hibernated = 0; | 5700 | hsotg->hibernated = 0; |
| 5620 | hsotg->bus_suspended = 0; | 5701 | hsotg->bus_suspended = 0; |
| 5621 | hsotg->lx_state = DWC2_L0; | 5702 | hsotg->lx_state = DWC2_L0; |
diff --git a/drivers/usb/dwc2/hcd.h b/drivers/usb/dwc2/hcd.h index 7db1ee7e7a77..5502a501f516 100644 --- a/drivers/usb/dwc2/hcd.h +++ b/drivers/usb/dwc2/hcd.h | |||
| @@ -76,6 +76,8 @@ struct dwc2_qh; | |||
| 76 | * (micro)frame | 76 | * (micro)frame |
| 77 | * @xfer_buf: Pointer to current transfer buffer position | 77 | * @xfer_buf: Pointer to current transfer buffer position |
| 78 | * @xfer_dma: DMA address of xfer_buf | 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 | * @xfer_len: Total number of bytes to transfer | 81 | * @xfer_len: Total number of bytes to transfer |
| 80 | * @xfer_count: Number of bytes transferred so far | 82 | * @xfer_count: Number of bytes transferred so far |
| 81 | * @start_pkt_count: Packet count at start of transfer | 83 | * @start_pkt_count: Packet count at start of transfer |
| @@ -133,6 +135,7 @@ struct dwc2_host_chan { | |||
| 133 | 135 | ||
| 134 | u8 *xfer_buf; | 136 | u8 *xfer_buf; |
| 135 | dma_addr_t xfer_dma; | 137 | dma_addr_t xfer_dma; |
| 138 | dma_addr_t align_buf; | ||
| 136 | u32 xfer_len; | 139 | u32 xfer_len; |
| 137 | u32 xfer_count; | 140 | u32 xfer_count; |
| 138 | u16 start_pkt_count; | 141 | u16 start_pkt_count; |
| @@ -302,6 +305,9 @@ struct dwc2_hs_transfer_time { | |||
| 302 | * speed. Note that this is in "schedule slice" which | 305 | * speed. Note that this is in "schedule slice" which |
| 303 | * is tightly packed. | 306 | * is tightly packed. |
| 304 | * @ntd: Actual number of transfer descriptors in a list | 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 | * @qtd_list: List of QTDs for this QH | 311 | * @qtd_list: List of QTDs for this QH |
| 306 | * @channel: Host channel currently processing transfers for this QH | 312 | * @channel: Host channel currently processing transfers for this QH |
| 307 | * @qh_list_entry: Entry for QH in either the periodic or non-periodic | 313 | * @qh_list_entry: Entry for QH in either the periodic or non-periodic |
| @@ -350,6 +356,8 @@ struct dwc2_qh { | |||
| 350 | struct dwc2_hs_transfer_time hs_transfers[DWC2_HS_SCHEDULE_UFRAMES]; | 356 | struct dwc2_hs_transfer_time hs_transfers[DWC2_HS_SCHEDULE_UFRAMES]; |
| 351 | u32 ls_start_schedule_slice; | 357 | u32 ls_start_schedule_slice; |
| 352 | u16 ntd; | 358 | u16 ntd; |
| 359 | u8 *dw_align_buf; | ||
| 360 | dma_addr_t dw_align_buf_dma; | ||
| 353 | struct list_head qtd_list; | 361 | struct list_head qtd_list; |
| 354 | struct dwc2_host_chan *channel; | 362 | struct dwc2_host_chan *channel; |
| 355 | struct list_head qh_list_entry; | 363 | struct list_head qh_list_entry; |
diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index fbea5e3fb947..ed7f05cf4906 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c | |||
| @@ -942,14 +942,21 @@ static int dwc2_xfercomp_isoc_split_in(struct dwc2_hsotg *hsotg, | |||
| 942 | frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index]; | 942 | frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index]; |
| 943 | len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd, | 943 | len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd, |
| 944 | DWC2_HC_XFER_COMPLETE, NULL); | 944 | DWC2_HC_XFER_COMPLETE, NULL); |
| 945 | if (!len) { | 945 | if (!len && !qtd->isoc_split_offset) { |
| 946 | qtd->complete_split = 0; | 946 | qtd->complete_split = 0; |
| 947 | qtd->isoc_split_offset = 0; | ||
| 948 | return 0; | 947 | return 0; |
| 949 | } | 948 | } |
| 950 | 949 | ||
| 951 | frame_desc->actual_length += len; | 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 | qtd->isoc_split_offset += len; | 960 | qtd->isoc_split_offset += len; |
| 954 | 961 | ||
| 955 | hctsiz = dwc2_readl(hsotg->regs + HCTSIZ(chnum)); | 962 | hctsiz = dwc2_readl(hsotg->regs + HCTSIZ(chnum)); |
diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c index d7c3d6c776d8..301ced1618f8 100644 --- a/drivers/usb/dwc2/hcd_queue.c +++ b/drivers/usb/dwc2/hcd_queue.c | |||
| @@ -383,7 +383,7 @@ static unsigned long *dwc2_get_ls_map(struct dwc2_hsotg *hsotg, | |||
| 383 | /* Get the map and adjust if this is a multi_tt hub */ | 383 | /* Get the map and adjust if this is a multi_tt hub */ |
| 384 | map = qh->dwc_tt->periodic_bitmaps; | 384 | map = qh->dwc_tt->periodic_bitmaps; |
| 385 | if (qh->dwc_tt->usb_tt->multi) | 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 | return map; | 388 | return map; |
| 389 | } | 389 | } |
| @@ -1696,6 +1696,9 @@ void dwc2_hcd_qh_free(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) | |||
| 1696 | 1696 | ||
| 1697 | if (qh->desc_list) | 1697 | if (qh->desc_list) |
| 1698 | dwc2_hcd_qh_free_ddma(hsotg, qh); | 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 | kfree(qh); | 1702 | kfree(qh); |
| 1700 | } | 1703 | } |
| 1701 | 1704 | ||
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index ea91310113b9..103807587dc6 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c | |||
| @@ -1272,7 +1272,6 @@ static int dwc3_probe(struct platform_device *pdev) | |||
| 1272 | if (!dwc->clks) | 1272 | if (!dwc->clks) |
| 1273 | return -ENOMEM; | 1273 | return -ENOMEM; |
| 1274 | 1274 | ||
| 1275 | dwc->num_clks = ARRAY_SIZE(dwc3_core_clks); | ||
| 1276 | dwc->dev = dev; | 1275 | dwc->dev = dev; |
| 1277 | 1276 | ||
| 1278 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1277 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| @@ -1307,15 +1306,19 @@ static int dwc3_probe(struct platform_device *pdev) | |||
| 1307 | if (IS_ERR(dwc->reset)) | 1306 | if (IS_ERR(dwc->reset)) |
| 1308 | return PTR_ERR(dwc->reset); | 1307 | return PTR_ERR(dwc->reset); |
| 1309 | 1308 | ||
| 1310 | ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks); | 1309 | if (dev->of_node) { |
| 1311 | if (ret == -EPROBE_DEFER) | 1310 | dwc->num_clks = ARRAY_SIZE(dwc3_core_clks); |
| 1312 | return ret; | 1311 | |
| 1313 | /* | 1312 | ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks); |
| 1314 | * Clocks are optional, but new DT platforms should support all clocks | 1313 | if (ret == -EPROBE_DEFER) |
| 1315 | * as required by the DT-binding. | 1314 | return ret; |
| 1316 | */ | 1315 | /* |
| 1317 | if (ret) | 1316 | * Clocks are optional, but new DT platforms should support all |
| 1318 | dwc->num_clks = 0; | 1317 | * clocks as required by the DT-binding. |
| 1318 | */ | ||
| 1319 | if (ret) | ||
| 1320 | dwc->num_clks = 0; | ||
| 1321 | } | ||
| 1319 | 1322 | ||
| 1320 | ret = reset_control_deassert(dwc->reset); | 1323 | ret = reset_control_deassert(dwc->reset); |
| 1321 | if (ret) | 1324 | if (ret) |
diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c index 6b3ccd542bd7..dbeff5e6ad14 100644 --- a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c | |||
| @@ -165,8 +165,9 @@ static int dwc3_of_simple_remove(struct platform_device *pdev) | |||
| 165 | 165 | ||
| 166 | reset_control_put(simple->resets); | 166 | reset_control_put(simple->resets); |
| 167 | 167 | ||
| 168 | pm_runtime_put_sync(dev); | ||
| 169 | pm_runtime_disable(dev); | 168 | pm_runtime_disable(dev); |
| 169 | pm_runtime_put_noidle(dev); | ||
| 170 | pm_runtime_set_suspended(dev); | ||
| 170 | 171 | ||
| 171 | return 0; | 172 | return 0; |
| 172 | } | 173 | } |
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index c961a94d136b..f57e7c94b8e5 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #define PCI_DEVICE_ID_INTEL_GLK 0x31aa | 34 | #define PCI_DEVICE_ID_INTEL_GLK 0x31aa |
| 35 | #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee | 35 | #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee |
| 36 | #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e | 36 | #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e |
| 37 | #define PCI_DEVICE_ID_INTEL_ICLLP 0x34ee | ||
| 37 | 38 | ||
| 38 | #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" | 39 | #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" |
| 39 | #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 | 40 | #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 |
| @@ -289,6 +290,7 @@ static const struct pci_device_id dwc3_pci_id_table[] = { | |||
| 289 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK), }, | 290 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK), }, |
| 290 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPLP), }, | 291 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPLP), }, |
| 291 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPH), }, | 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 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, | 294 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, |
| 293 | { } /* Terminating Entry */ | 295 | { } /* Terminating Entry */ |
| 294 | }; | 296 | }; |
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index b0e67ab2f98c..a6d0203e40b6 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c | |||
| @@ -490,6 +490,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev) | |||
| 490 | qcom->dwc3 = of_find_device_by_node(dwc3_np); | 490 | qcom->dwc3 = of_find_device_by_node(dwc3_np); |
| 491 | if (!qcom->dwc3) { | 491 | if (!qcom->dwc3) { |
| 492 | dev_err(&pdev->dev, "failed to get dwc3 platform device\n"); | 492 | dev_err(&pdev->dev, "failed to get dwc3 platform device\n"); |
| 493 | ret = -ENODEV; | ||
| 493 | goto depopulate; | 494 | goto depopulate; |
| 494 | } | 495 | } |
| 495 | 496 | ||
| @@ -547,8 +548,7 @@ static int dwc3_qcom_remove(struct platform_device *pdev) | |||
| 547 | return 0; | 548 | return 0; |
| 548 | } | 549 | } |
| 549 | 550 | ||
| 550 | #ifdef CONFIG_PM_SLEEP | 551 | static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev) |
| 551 | static int dwc3_qcom_pm_suspend(struct device *dev) | ||
| 552 | { | 552 | { |
| 553 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); | 553 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 554 | int ret = 0; | 554 | int ret = 0; |
| @@ -560,7 +560,7 @@ static int dwc3_qcom_pm_suspend(struct device *dev) | |||
| 560 | return ret; | 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 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); | 565 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 566 | int ret; | 566 | int ret; |
| @@ -571,23 +571,20 @@ static int dwc3_qcom_pm_resume(struct device *dev) | |||
| 571 | 571 | ||
| 572 | return ret; | 572 | return ret; |
| 573 | } | 573 | } |
| 574 | #endif | ||
| 575 | 574 | ||
| 576 | #ifdef CONFIG_PM | 575 | static int __maybe_unused dwc3_qcom_runtime_suspend(struct device *dev) |
| 577 | static int dwc3_qcom_runtime_suspend(struct device *dev) | ||
| 578 | { | 576 | { |
| 579 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); | 577 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 580 | 578 | ||
| 581 | return dwc3_qcom_suspend(qcom); | 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 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); | 584 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 587 | 585 | ||
| 588 | return dwc3_qcom_resume(qcom); | 586 | return dwc3_qcom_resume(qcom); |
| 589 | } | 587 | } |
| 590 | #endif | ||
| 591 | 588 | ||
| 592 | static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = { | 589 | static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = { |
| 593 | SET_SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume) | 590 | SET_SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume) |
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index f242c2bcea81..d2fa071c21b1 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c | |||
| @@ -1719,6 +1719,8 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) | |||
| 1719 | */ | 1719 | */ |
| 1720 | if (w_value && !f->get_alt) | 1720 | if (w_value && !f->get_alt) |
| 1721 | break; | 1721 | break; |
| 1722 | |||
| 1723 | spin_lock(&cdev->lock); | ||
| 1722 | value = f->set_alt(f, w_index, w_value); | 1724 | value = f->set_alt(f, w_index, w_value); |
| 1723 | if (value == USB_GADGET_DELAYED_STATUS) { | 1725 | if (value == USB_GADGET_DELAYED_STATUS) { |
| 1724 | DBG(cdev, | 1726 | DBG(cdev, |
| @@ -1728,6 +1730,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) | |||
| 1728 | DBG(cdev, "delayed_status count %d\n", | 1730 | DBG(cdev, "delayed_status count %d\n", |
| 1729 | cdev->delayed_status); | 1731 | cdev->delayed_status); |
| 1730 | } | 1732 | } |
| 1733 | spin_unlock(&cdev->lock); | ||
| 1731 | break; | 1734 | break; |
| 1732 | case USB_REQ_GET_INTERFACE: | 1735 | case USB_REQ_GET_INTERFACE: |
| 1733 | if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE)) | 1736 | if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE)) |
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index dce9d12c7981..33e2030503fa 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c | |||
| @@ -215,6 +215,7 @@ struct ffs_io_data { | |||
| 215 | 215 | ||
| 216 | struct mm_struct *mm; | 216 | struct mm_struct *mm; |
| 217 | struct work_struct work; | 217 | struct work_struct work; |
| 218 | struct work_struct cancellation_work; | ||
| 218 | 219 | ||
| 219 | struct usb_ep *ep; | 220 | struct usb_ep *ep; |
| 220 | struct usb_request *req; | 221 | struct usb_request *req; |
| @@ -1072,22 +1073,31 @@ ffs_epfile_open(struct inode *inode, struct file *file) | |||
| 1072 | return 0; | 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 | static int ffs_aio_cancel(struct kiocb *kiocb) | 1086 | static int ffs_aio_cancel(struct kiocb *kiocb) |
| 1076 | { | 1087 | { |
| 1077 | struct ffs_io_data *io_data = kiocb->private; | 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 | int value; | 1090 | int value; |
| 1080 | 1091 | ||
| 1081 | ENTER(); | 1092 | ENTER(); |
| 1082 | 1093 | ||
| 1083 | spin_lock_irq(&epfile->ffs->eps_lock); | 1094 | if (likely(io_data && io_data->ep && io_data->req)) { |
| 1084 | 1095 | INIT_WORK(&io_data->cancellation_work, ffs_aio_cancel_worker); | |
| 1085 | if (likely(io_data && io_data->ep && io_data->req)) | 1096 | queue_work(ffs->io_completion_wq, &io_data->cancellation_work); |
| 1086 | value = usb_ep_dequeue(io_data->ep, io_data->req); | 1097 | value = -EINPROGRESS; |
| 1087 | else | 1098 | } else { |
| 1088 | value = -EINVAL; | 1099 | value = -EINVAL; |
| 1089 | 1100 | } | |
| 1090 | spin_unlock_irq(&epfile->ffs->eps_lock); | ||
| 1091 | 1101 | ||
| 1092 | return value; | 1102 | return value; |
| 1093 | } | 1103 | } |
diff --git a/drivers/usb/gadget/udc/aspeed-vhub/Kconfig b/drivers/usb/gadget/udc/aspeed-vhub/Kconfig index f0cdf89b8503..83ba8a2eb6af 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/Kconfig +++ b/drivers/usb/gadget/udc/aspeed-vhub/Kconfig | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | config USB_ASPEED_VHUB | 2 | config USB_ASPEED_VHUB |
| 3 | tristate "Aspeed vHub UDC driver" | 3 | tristate "Aspeed vHub UDC driver" |
| 4 | depends on ARCH_ASPEED || COMPILE_TEST | 4 | depends on ARCH_ASPEED || COMPILE_TEST |
| 5 | depends on USB_LIBCOMPOSITE | ||
| 5 | help | 6 | help |
| 6 | USB peripheral controller for the Aspeed AST2500 family | 7 | USB peripheral controller for the Aspeed AST2500 family |
| 7 | SoCs supporting the "vHub" functionality and USB2.0 | 8 | SoCs supporting the "vHub" functionality and USB2.0 |
diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index 1fbfd89d0a0f..387f124a8334 100644 --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c | |||
| @@ -508,16 +508,18 @@ static int xhci_do_dbc_start(struct xhci_hcd *xhci) | |||
| 508 | return 0; | 508 | return 0; |
| 509 | } | 509 | } |
| 510 | 510 | ||
| 511 | static void xhci_do_dbc_stop(struct xhci_hcd *xhci) | 511 | static int xhci_do_dbc_stop(struct xhci_hcd *xhci) |
| 512 | { | 512 | { |
| 513 | struct xhci_dbc *dbc = xhci->dbc; | 513 | struct xhci_dbc *dbc = xhci->dbc; |
| 514 | 514 | ||
| 515 | if (dbc->state == DS_DISABLED) | 515 | if (dbc->state == DS_DISABLED) |
| 516 | return; | 516 | return -1; |
| 517 | 517 | ||
| 518 | writel(0, &dbc->regs->control); | 518 | writel(0, &dbc->regs->control); |
| 519 | xhci_dbc_mem_cleanup(xhci); | 519 | xhci_dbc_mem_cleanup(xhci); |
| 520 | dbc->state = DS_DISABLED; | 520 | dbc->state = DS_DISABLED; |
| 521 | |||
| 522 | return 0; | ||
| 521 | } | 523 | } |
| 522 | 524 | ||
| 523 | static int xhci_dbc_start(struct xhci_hcd *xhci) | 525 | static int xhci_dbc_start(struct xhci_hcd *xhci) |
| @@ -544,6 +546,7 @@ static int xhci_dbc_start(struct xhci_hcd *xhci) | |||
| 544 | 546 | ||
| 545 | static void xhci_dbc_stop(struct xhci_hcd *xhci) | 547 | static void xhci_dbc_stop(struct xhci_hcd *xhci) |
| 546 | { | 548 | { |
| 549 | int ret; | ||
| 547 | unsigned long flags; | 550 | unsigned long flags; |
| 548 | struct xhci_dbc *dbc = xhci->dbc; | 551 | struct xhci_dbc *dbc = xhci->dbc; |
| 549 | struct dbc_port *port = &dbc->port; | 552 | struct dbc_port *port = &dbc->port; |
| @@ -556,10 +559,11 @@ static void xhci_dbc_stop(struct xhci_hcd *xhci) | |||
| 556 | xhci_dbc_tty_unregister_device(xhci); | 559 | xhci_dbc_tty_unregister_device(xhci); |
| 557 | 560 | ||
| 558 | spin_lock_irqsave(&dbc->lock, flags); | 561 | spin_lock_irqsave(&dbc->lock, flags); |
| 559 | xhci_do_dbc_stop(xhci); | 562 | ret = xhci_do_dbc_stop(xhci); |
| 560 | spin_unlock_irqrestore(&dbc->lock, flags); | 563 | spin_unlock_irqrestore(&dbc->lock, flags); |
| 561 | 564 | ||
| 562 | pm_runtime_put_sync(xhci_to_hcd(xhci)->self.controller); | 565 | if (!ret) |
| 566 | pm_runtime_put_sync(xhci_to_hcd(xhci)->self.controller); | ||
| 563 | } | 567 | } |
| 564 | 568 | ||
| 565 | static void | 569 | static void |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index acbd3d7b8828..ef350c33dc4a 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
| @@ -595,7 +595,7 @@ struct xhci_ring *xhci_stream_id_to_ring( | |||
| 595 | if (!ep->stream_info) | 595 | if (!ep->stream_info) |
| 596 | return NULL; | 596 | return NULL; |
| 597 | 597 | ||
| 598 | if (stream_id > ep->stream_info->num_streams) | 598 | if (stream_id >= ep->stream_info->num_streams) |
| 599 | return NULL; | 599 | return NULL; |
| 600 | return ep->stream_info->stream_rings[stream_id]; | 600 | return ep->stream_info->stream_rings[stream_id]; |
| 601 | } | 601 | } |
| @@ -886,12 +886,12 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id) | |||
| 886 | 886 | ||
| 887 | dev = xhci->devs[slot_id]; | 887 | dev = xhci->devs[slot_id]; |
| 888 | 888 | ||
| 889 | trace_xhci_free_virt_device(dev); | ||
| 890 | |||
| 891 | xhci->dcbaa->dev_context_ptrs[slot_id] = 0; | 889 | xhci->dcbaa->dev_context_ptrs[slot_id] = 0; |
| 892 | if (!dev) | 890 | if (!dev) |
| 893 | return; | 891 | return; |
| 894 | 892 | ||
| 893 | trace_xhci_free_virt_device(dev); | ||
| 894 | |||
| 895 | if (dev->tt_info) | 895 | if (dev->tt_info) |
| 896 | old_active_eps = dev->tt_info->active_eps; | 896 | old_active_eps = dev->tt_info->active_eps; |
| 897 | 897 | ||
diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index a8c1d073cba0..4b463e5202a4 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c | |||
| @@ -481,7 +481,7 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra, | |||
| 481 | unsigned long mask; | 481 | unsigned long mask; |
| 482 | unsigned int port; | 482 | unsigned int port; |
| 483 | bool idle, enable; | 483 | bool idle, enable; |
| 484 | int err; | 484 | int err = 0; |
| 485 | 485 | ||
| 486 | memset(&rsp, 0, sizeof(rsp)); | 486 | memset(&rsp, 0, sizeof(rsp)); |
| 487 | 487 | ||
| @@ -1223,10 +1223,10 @@ disable_rpm: | |||
| 1223 | pm_runtime_disable(&pdev->dev); | 1223 | pm_runtime_disable(&pdev->dev); |
| 1224 | usb_put_hcd(tegra->hcd); | 1224 | usb_put_hcd(tegra->hcd); |
| 1225 | disable_xusbc: | 1225 | disable_xusbc: |
| 1226 | if (!&pdev->dev.pm_domain) | 1226 | if (!pdev->dev.pm_domain) |
| 1227 | tegra_powergate_power_off(TEGRA_POWERGATE_XUSBC); | 1227 | tegra_powergate_power_off(TEGRA_POWERGATE_XUSBC); |
| 1228 | disable_xusba: | 1228 | disable_xusba: |
| 1229 | if (!&pdev->dev.pm_domain) | 1229 | if (!pdev->dev.pm_domain) |
| 1230 | tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA); | 1230 | tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA); |
| 1231 | put_padctl: | 1231 | put_padctl: |
| 1232 | tegra_xusb_padctl_put(tegra->padctl); | 1232 | tegra_xusb_padctl_put(tegra->padctl); |
diff --git a/drivers/usb/host/xhci-trace.h b/drivers/usb/host/xhci-trace.h index 410544ffe78f..88b427434bd8 100644 --- a/drivers/usb/host/xhci-trace.h +++ b/drivers/usb/host/xhci-trace.h | |||
| @@ -171,6 +171,37 @@ DEFINE_EVENT(xhci_log_trb, xhci_dbc_gadget_ep_queue, | |||
| 171 | TP_ARGS(ring, trb) | 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 | DECLARE_EVENT_CLASS(xhci_log_virt_dev, | 205 | DECLARE_EVENT_CLASS(xhci_log_virt_dev, |
| 175 | TP_PROTO(struct xhci_virt_device *vdev), | 206 | TP_PROTO(struct xhci_virt_device *vdev), |
| 176 | TP_ARGS(vdev), | 207 | TP_ARGS(vdev), |
| @@ -208,11 +239,6 @@ DEFINE_EVENT(xhci_log_virt_dev, xhci_alloc_virt_device, | |||
| 208 | TP_ARGS(vdev) | 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 | DEFINE_EVENT(xhci_log_virt_dev, xhci_setup_device, | 242 | DEFINE_EVENT(xhci_log_virt_dev, xhci_setup_device, |
| 217 | TP_PROTO(struct xhci_virt_device *vdev), | 243 | TP_PROTO(struct xhci_virt_device *vdev), |
| 218 | TP_ARGS(vdev) | 244 | TP_ARGS(vdev) |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 8c8da2d657fa..2f4850f25e82 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -908,6 +908,41 @@ static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci) | |||
| 908 | spin_unlock_irqrestore(&xhci->lock, flags); | 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 | * Stop HC (not bus-specific) | 947 | * Stop HC (not bus-specific) |
| 913 | * | 948 | * |
| @@ -1009,7 +1044,7 @@ EXPORT_SYMBOL_GPL(xhci_suspend); | |||
| 1009 | */ | 1044 | */ |
| 1010 | int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | 1045 | int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
| 1011 | { | 1046 | { |
| 1012 | u32 command, temp = 0, status; | 1047 | u32 command, temp = 0; |
| 1013 | struct usb_hcd *hcd = xhci_to_hcd(xhci); | 1048 | struct usb_hcd *hcd = xhci_to_hcd(xhci); |
| 1014 | struct usb_hcd *secondary_hcd; | 1049 | struct usb_hcd *secondary_hcd; |
| 1015 | int retval = 0; | 1050 | int retval = 0; |
| @@ -1043,8 +1078,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
| 1043 | command = readl(&xhci->op_regs->command); | 1078 | command = readl(&xhci->op_regs->command); |
| 1044 | command |= CMD_CRS; | 1079 | command |= CMD_CRS; |
| 1045 | writel(command, &xhci->op_regs->command); | 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 | if (xhci_handshake(&xhci->op_regs->status, | 1086 | if (xhci_handshake(&xhci->op_regs->status, |
| 1047 | STS_RESTORE, 0, 10 * 1000)) { | 1087 | STS_RESTORE, 0, 100 * 1000)) { |
| 1048 | xhci_warn(xhci, "WARN: xHC restore state timeout\n"); | 1088 | xhci_warn(xhci, "WARN: xHC restore state timeout\n"); |
| 1049 | spin_unlock_irq(&xhci->lock); | 1089 | spin_unlock_irq(&xhci->lock); |
| 1050 | return -ETIMEDOUT; | 1090 | return -ETIMEDOUT; |
| @@ -1134,8 +1174,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
| 1134 | done: | 1174 | done: |
| 1135 | if (retval == 0) { | 1175 | if (retval == 0) { |
| 1136 | /* Resume root hubs only when have pending events. */ | 1176 | /* Resume root hubs only when have pending events. */ |
| 1137 | status = readl(&xhci->op_regs->status); | 1177 | if (xhci_pending_portevent(xhci)) { |
| 1138 | if (status & STS_EINT) { | ||
| 1139 | usb_hcd_resume_root_hub(xhci->shared_hcd); | 1178 | usb_hcd_resume_root_hub(xhci->shared_hcd); |
| 1140 | usb_hcd_resume_root_hub(hcd); | 1179 | usb_hcd_resume_root_hub(hcd); |
| 1141 | } | 1180 | } |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 939e2f86b595..841e89ffe2e9 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
| @@ -382,6 +382,10 @@ struct xhci_op_regs { | |||
| 382 | #define PORT_PLC (1 << 22) | 382 | #define PORT_PLC (1 << 22) |
| 383 | /* port configure error change - port failed to configure its link partner */ | 383 | /* port configure error change - port failed to configure its link partner */ |
| 384 | #define PORT_CEC (1 << 23) | 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 | /* Cold Attach Status - xHC can set this bit to report device attached during | 389 | /* Cold Attach Status - xHC can set this bit to report device attached during |
| 386 | * Sx state. Warm port reset should be perfomed to clear this bit and move port | 390 | * Sx state. Warm port reset should be perfomed to clear this bit and move port |
| 387 | * to connected state. | 391 | * to connected state. |
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index 8abb6cbbd98a..3be40eaa1ac9 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c | |||
| @@ -396,8 +396,7 @@ static ssize_t yurex_read(struct file *file, char __user *buffer, size_t count, | |||
| 396 | loff_t *ppos) | 396 | loff_t *ppos) |
| 397 | { | 397 | { |
| 398 | struct usb_yurex *dev; | 398 | struct usb_yurex *dev; |
| 399 | int retval = 0; | 399 | int len = 0; |
| 400 | int bytes_read = 0; | ||
| 401 | char in_buffer[20]; | 400 | char in_buffer[20]; |
| 402 | unsigned long flags; | 401 | unsigned long flags; |
| 403 | 402 | ||
| @@ -405,26 +404,16 @@ static ssize_t yurex_read(struct file *file, char __user *buffer, size_t count, | |||
| 405 | 404 | ||
| 406 | mutex_lock(&dev->io_mutex); | 405 | mutex_lock(&dev->io_mutex); |
| 407 | if (!dev->interface) { /* already disconnected */ | 406 | if (!dev->interface) { /* already disconnected */ |
| 408 | retval = -ENODEV; | 407 | mutex_unlock(&dev->io_mutex); |
| 409 | goto exit; | 408 | return -ENODEV; |
| 410 | } | 409 | } |
| 411 | 410 | ||
| 412 | spin_lock_irqsave(&dev->lock, flags); | 411 | spin_lock_irqsave(&dev->lock, flags); |
| 413 | bytes_read = snprintf(in_buffer, 20, "%lld\n", dev->bbu); | 412 | len = snprintf(in_buffer, 20, "%lld\n", dev->bbu); |
| 414 | spin_unlock_irqrestore(&dev->lock, flags); | 413 | spin_unlock_irqrestore(&dev->lock, flags); |
| 415 | |||
| 416 | if (*ppos < bytes_read) { | ||
| 417 | if (copy_to_user(buffer, in_buffer + *ppos, bytes_read - *ppos)) | ||
| 418 | retval = -EFAULT; | ||
| 419 | else { | ||
| 420 | retval = bytes_read - *ppos; | ||
| 421 | *ppos += bytes_read; | ||
| 422 | } | ||
| 423 | } | ||
| 424 | |||
| 425 | exit: | ||
| 426 | mutex_unlock(&dev->io_mutex); | 414 | mutex_unlock(&dev->io_mutex); |
| 427 | return retval; | 415 | |
| 416 | return simple_read_from_buffer(buffer, count, ppos, in_buffer, len); | ||
| 428 | } | 417 | } |
| 429 | 418 | ||
| 430 | static ssize_t yurex_write(struct file *file, const char __user *user_buffer, | 419 | static ssize_t yurex_write(struct file *file, const char __user *user_buffer, |
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index bdd7a5ad3bf1..3bb1fff02bed 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c | |||
| @@ -128,7 +128,7 @@ static int ch341_control_in(struct usb_device *dev, | |||
| 128 | r = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), request, | 128 | r = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), request, |
| 129 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, | 129 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, |
| 130 | value, index, buf, bufsize, DEFAULT_TIMEOUT); | 130 | value, index, buf, bufsize, DEFAULT_TIMEOUT); |
| 131 | if (r < bufsize) { | 131 | if (r < (int)bufsize) { |
| 132 | if (r >= 0) { | 132 | if (r >= 0) { |
| 133 | dev_err(&dev->dev, | 133 | dev_err(&dev->dev, |
| 134 | "short control message received (%d < %u)\n", | 134 | "short control message received (%d < %u)\n", |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index eb6c26cbe579..626a29d9aa58 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
| @@ -95,6 +95,9 @@ static const struct usb_device_id id_table[] = { | |||
| 95 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ | 95 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ |
| 96 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ | 96 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ |
| 97 | { USB_DEVICE(0x10C4, 0x815F) }, /* Timewave HamLinkUSB */ | 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 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ | 101 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ |
| 99 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ | 102 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ |
| 100 | { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ | 103 | { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ |
| @@ -112,6 +115,9 @@ static const struct usb_device_id id_table[] = { | |||
| 112 | { USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demonstration module */ | 115 | { USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demonstration module */ |
| 113 | { USB_DEVICE(0x10C4, 0x8281) }, /* Nanotec Plug & Drive */ | 116 | { USB_DEVICE(0x10C4, 0x8281) }, /* Nanotec Plug & Drive */ |
| 114 | { USB_DEVICE(0x10C4, 0x8293) }, /* Telegesis ETRX2USB */ | 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 | { USB_DEVICE(0x10C4, 0x82F4) }, /* Starizona MicroTouch */ | 121 | { USB_DEVICE(0x10C4, 0x82F4) }, /* Starizona MicroTouch */ |
| 116 | { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */ | 122 | { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */ |
| 117 | { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ | 123 | { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ |
| @@ -124,7 +130,9 @@ static const struct usb_device_id id_table[] = { | |||
| 124 | { USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */ | 130 | { USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */ |
| 125 | { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ | 131 | { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ |
| 126 | { USB_DEVICE(0x10C4, 0x84B6) }, /* Starizona Hyperion */ | 132 | { USB_DEVICE(0x10C4, 0x84B6) }, /* Starizona Hyperion */ |
| 133 | { USB_DEVICE(0x10C4, 0x851E) }, /* CESINEL MEDCAL PT Network Analyzer */ | ||
| 127 | { USB_DEVICE(0x10C4, 0x85A7) }, /* LifeScan OneTouch Verio IQ */ | 134 | { USB_DEVICE(0x10C4, 0x85A7) }, /* LifeScan OneTouch Verio IQ */ |
| 135 | { USB_DEVICE(0x10C4, 0x85B8) }, /* CESINEL ReCon T Energy Logger */ | ||
| 128 | { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */ | 136 | { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */ |
| 129 | { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */ | 137 | { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */ |
| 130 | { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ | 138 | { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ |
| @@ -134,17 +142,24 @@ static const struct usb_device_id id_table[] = { | |||
| 134 | { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ | 142 | { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ |
| 135 | { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ | 143 | { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ |
| 136 | { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ | 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 | { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ | 147 | { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ |
| 138 | { USB_DEVICE(0x10C4, 0x8962) }, /* Brim Brothers charging dock */ | 148 | { USB_DEVICE(0x10C4, 0x8962) }, /* Brim Brothers charging dock */ |
| 139 | { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ | 149 | { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ |
| 140 | { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ | 150 | { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ |
| 151 | { USB_DEVICE(0x10C4, 0x89A4) }, /* CESINEL FTBC Flexible Thyristor Bridge Controller */ | ||
| 152 | { USB_DEVICE(0x10C4, 0x89FB) }, /* Qivicon ZigBee USB Radio Stick */ | ||
| 141 | { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ | 153 | { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ |
| 142 | { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ | 154 | { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ |
| 143 | { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ | 155 | { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ |
| 144 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ | 156 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ |
| 145 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ | 157 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ |
| 158 | { USB_DEVICE(0x10C4, 0xEA63) }, /* Silicon Labs Windows Update (CP2101-4/CP2102N) */ | ||
| 146 | { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ | 159 | { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ |
| 147 | { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */ | 160 | { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */ |
| 161 | { USB_DEVICE(0x10C4, 0xEA7A) }, /* Silicon Labs Windows Update (CP2105) */ | ||
| 162 | { USB_DEVICE(0x10C4, 0xEA7B) }, /* Silicon Labs Windows Update (CP2108) */ | ||
| 148 | { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ | 163 | { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ |
| 149 | { USB_DEVICE(0x10C4, 0xF002) }, /* Elan Digital Systems USBwave12 */ | 164 | { USB_DEVICE(0x10C4, 0xF002) }, /* Elan Digital Systems USBwave12 */ |
| 150 | { USB_DEVICE(0x10C4, 0xF003) }, /* Elan Digital Systems USBpulse100 */ | 165 | { USB_DEVICE(0x10C4, 0xF003) }, /* Elan Digital Systems USBpulse100 */ |
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index 5169624d8b11..38d43c4b7ce5 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c | |||
| @@ -369,8 +369,10 @@ static int keyspan_pda_get_modem_info(struct usb_serial *serial, | |||
| 369 | 3, /* get pins */ | 369 | 3, /* get pins */ |
| 370 | USB_TYPE_VENDOR|USB_RECIP_INTERFACE|USB_DIR_IN, | 370 | USB_TYPE_VENDOR|USB_RECIP_INTERFACE|USB_DIR_IN, |
| 371 | 0, 0, data, 1, 2000); | 371 | 0, 0, data, 1, 2000); |
| 372 | if (rc >= 0) | 372 | if (rc == 1) |
| 373 | *value = *data; | 373 | *value = *data; |
| 374 | else if (rc >= 0) | ||
| 375 | rc = -EIO; | ||
| 374 | 376 | ||
| 375 | kfree(data); | 377 | kfree(data); |
| 376 | return rc; | 378 | return rc; |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index fdceb46d9fc6..b580b4c7fa48 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
| @@ -468,6 +468,9 @@ static void mos7840_control_callback(struct urb *urb) | |||
| 468 | } | 468 | } |
| 469 | 469 | ||
| 470 | dev_dbg(dev, "%s urb buffer size is %d\n", __func__, urb->actual_length); | 470 | dev_dbg(dev, "%s urb buffer size is %d\n", __func__, urb->actual_length); |
| 471 | if (urb->actual_length < 1) | ||
| 472 | goto out; | ||
| 473 | |||
| 471 | dev_dbg(dev, "%s mos7840_port->MsrLsr is %d port %d\n", __func__, | 474 | dev_dbg(dev, "%s mos7840_port->MsrLsr is %d port %d\n", __func__, |
| 472 | mos7840_port->MsrLsr, mos7840_port->port_num); | 475 | mos7840_port->MsrLsr, mos7840_port->port_num); |
| 473 | data = urb->transfer_buffer; | 476 | data = urb->transfer_buffer; |
diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index 8a201dd53d36..150f43668bec 100644 --- a/drivers/usb/typec/tcpm.c +++ b/drivers/usb/typec/tcpm.c | |||
| @@ -418,17 +418,18 @@ static void _tcpm_log(struct tcpm_port *port, const char *fmt, va_list args) | |||
| 418 | u64 ts_nsec = local_clock(); | 418 | u64 ts_nsec = local_clock(); |
| 419 | unsigned long rem_nsec; | 419 | unsigned long rem_nsec; |
| 420 | 420 | ||
| 421 | mutex_lock(&port->logbuffer_lock); | ||
| 421 | if (!port->logbuffer[port->logbuffer_head]) { | 422 | if (!port->logbuffer[port->logbuffer_head]) { |
| 422 | port->logbuffer[port->logbuffer_head] = | 423 | port->logbuffer[port->logbuffer_head] = |
| 423 | kzalloc(LOG_BUFFER_ENTRY_SIZE, GFP_KERNEL); | 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 | return; | 427 | return; |
| 428 | } | ||
| 426 | } | 429 | } |
| 427 | 430 | ||
| 428 | vsnprintf(tmpbuffer, sizeof(tmpbuffer), fmt, args); | 431 | vsnprintf(tmpbuffer, sizeof(tmpbuffer), fmt, args); |
| 429 | 432 | ||
| 430 | mutex_lock(&port->logbuffer_lock); | ||
| 431 | |||
| 432 | if (tcpm_log_full(port)) { | 433 | if (tcpm_log_full(port)) { |
| 433 | port->logbuffer_head = max(port->logbuffer_head - 1, 0); | 434 | port->logbuffer_head = max(port->logbuffer_head - 1, 0); |
| 434 | strcpy(tmpbuffer, "overflow"); | 435 | strcpy(tmpbuffer, "overflow"); |
| @@ -724,6 +725,9 @@ static int tcpm_set_current_limit(struct tcpm_port *port, u32 max_ma, u32 mv) | |||
| 724 | 725 | ||
| 725 | tcpm_log(port, "Setting voltage/current limit %u mV %u mA", mv, max_ma); | 726 | tcpm_log(port, "Setting voltage/current limit %u mV %u mA", mv, max_ma); |
| 726 | 727 | ||
| 728 | port->supply_voltage = mv; | ||
| 729 | port->current_limit = max_ma; | ||
| 730 | |||
| 727 | if (port->tcpc->set_current_limit) | 731 | if (port->tcpc->set_current_limit) |
| 728 | ret = port->tcpc->set_current_limit(port->tcpc, max_ma, mv); | 732 | ret = port->tcpc->set_current_limit(port->tcpc, max_ma, mv); |
| 729 | 733 | ||
| @@ -2594,8 +2598,6 @@ static void tcpm_reset_port(struct tcpm_port *port) | |||
| 2594 | tcpm_set_attached_state(port, false); | 2598 | tcpm_set_attached_state(port, false); |
| 2595 | port->try_src_count = 0; | 2599 | port->try_src_count = 0; |
| 2596 | port->try_snk_count = 0; | 2600 | port->try_snk_count = 0; |
| 2597 | port->supply_voltage = 0; | ||
| 2598 | port->current_limit = 0; | ||
| 2599 | port->usb_type = POWER_SUPPLY_USB_TYPE_C; | 2601 | port->usb_type = POWER_SUPPLY_USB_TYPE_C; |
| 2600 | 2602 | ||
| 2601 | power_supply_changed(port->psy); | 2603 | power_supply_changed(port->psy); |
| @@ -3043,7 +3045,8 @@ static void run_state_machine(struct tcpm_port *port) | |||
| 3043 | tcpm_port_is_sink(port) && | 3045 | tcpm_port_is_sink(port) && |
| 3044 | time_is_after_jiffies(port->delayed_runtime)) { | 3046 | time_is_after_jiffies(port->delayed_runtime)) { |
| 3045 | tcpm_set_state(port, SNK_DISCOVERY, | 3047 | tcpm_set_state(port, SNK_DISCOVERY, |
| 3046 | port->delayed_runtime - jiffies); | 3048 | jiffies_to_msecs(port->delayed_runtime - |
| 3049 | jiffies)); | ||
| 3047 | break; | 3050 | break; |
| 3048 | } | 3051 | } |
| 3049 | tcpm_set_state(port, unattached_state(port), 0); | 3052 | tcpm_set_state(port, unattached_state(port), 0); |
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index bd5cca5632b3..8d0a6fe748bd 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c | |||
| @@ -350,6 +350,19 @@ static void ucsi_connector_change(struct work_struct *work) | |||
| 350 | } | 350 | } |
| 351 | 351 | ||
| 352 | if (con->status.change & UCSI_CONSTAT_CONNECT_CHANGE) { | 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 | if (con->status.connected) | 366 | if (con->status.connected) |
| 354 | ucsi_register_partner(con); | 367 | ucsi_register_partner(con); |
| 355 | else | 368 | else |
diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c index 44eb4e1ea817..a18112a83fae 100644 --- a/drivers/usb/typec/ucsi/ucsi_acpi.c +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c | |||
| @@ -79,6 +79,11 @@ static int ucsi_acpi_probe(struct platform_device *pdev) | |||
| 79 | return -ENODEV; | 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 | * NOTE: The memory region for the data structures is used also in an | 88 | * NOTE: The memory region for the data structures is used also in an |
| 84 | * operation region, which means ACPI has already reserved it. Therefore | 89 | * operation region, which means ACPI has already reserved it. Therefore |
diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig index 24ee2605b9f0..42dc1d3d71cf 100644 --- a/drivers/vfio/pci/Kconfig +++ b/drivers/vfio/pci/Kconfig | |||
| @@ -28,5 +28,13 @@ config VFIO_PCI_INTX | |||
| 28 | def_bool y if !S390 | 28 | def_bool y if !S390 |
| 29 | 29 | ||
| 30 | config VFIO_PCI_IGD | 30 | config VFIO_PCI_IGD |
| 31 | depends on VFIO_PCI | 31 | bool "VFIO PCI extensions for Intel graphics (GVT-d)" |
| 32 | def_bool y if X86 | 32 | depends on VFIO_PCI && X86 |
| 33 | default y | ||
| 34 | help | ||
| 35 | Support for Intel IGD specific extensions to enable direct | ||
| 36 | assignment to virtual machines. This includes exposing an IGD | ||
| 37 | specific firmware table and read-only copies of the host bridge | ||
| 38 | and LPC bridge config space. | ||
| 39 | |||
| 40 | To enable Intel IGD assignment through vfio-pci, say Y. | ||
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 2c75b33db4ac..3e5b17710a4f 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c | |||
| @@ -343,18 +343,16 @@ static int vaddr_get_pfn(struct mm_struct *mm, unsigned long vaddr, | |||
| 343 | struct page *page[1]; | 343 | struct page *page[1]; |
| 344 | struct vm_area_struct *vma; | 344 | struct vm_area_struct *vma; |
| 345 | struct vm_area_struct *vmas[1]; | 345 | struct vm_area_struct *vmas[1]; |
| 346 | unsigned int flags = 0; | ||
| 346 | int ret; | 347 | int ret; |
| 347 | 348 | ||
| 349 | if (prot & IOMMU_WRITE) | ||
| 350 | flags |= FOLL_WRITE; | ||
| 351 | |||
| 352 | down_read(&mm->mmap_sem); | ||
| 348 | if (mm == current->mm) { | 353 | if (mm == current->mm) { |
| 349 | ret = get_user_pages_longterm(vaddr, 1, !!(prot & IOMMU_WRITE), | 354 | ret = get_user_pages_longterm(vaddr, 1, flags, page, vmas); |
| 350 | page, vmas); | ||
| 351 | } else { | 355 | } else { |
| 352 | unsigned int flags = 0; | ||
| 353 | |||
| 354 | if (prot & IOMMU_WRITE) | ||
| 355 | flags |= FOLL_WRITE; | ||
| 356 | |||
| 357 | down_read(&mm->mmap_sem); | ||
| 358 | ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags, page, | 356 | ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags, page, |
| 359 | vmas, NULL); | 357 | vmas, NULL); |
| 360 | /* | 358 | /* |
| @@ -368,8 +366,8 @@ static int vaddr_get_pfn(struct mm_struct *mm, unsigned long vaddr, | |||
| 368 | ret = -EOPNOTSUPP; | 366 | ret = -EOPNOTSUPP; |
| 369 | put_page(page[0]); | 367 | put_page(page[0]); |
| 370 | } | 368 | } |
| 371 | up_read(&mm->mmap_sem); | ||
| 372 | } | 369 | } |
| 370 | up_read(&mm->mmap_sem); | ||
| 373 | 371 | ||
| 374 | if (ret == 1) { | 372 | if (ret == 1) { |
| 375 | *pfn = page_to_pfn(page[0]); | 373 | *pfn = page_to_pfn(page[0]); |
| @@ -5,7 +5,6 @@ | |||
| 5 | * Implements an efficient asynchronous io interface. | 5 | * Implements an efficient asynchronous io interface. |
| 6 | * | 6 | * |
| 7 | * Copyright 2000, 2001, 2002 Red Hat, Inc. All Rights Reserved. | 7 | * Copyright 2000, 2001, 2002 Red Hat, Inc. All Rights Reserved. |
| 8 | * Copyright 2018 Christoph Hellwig. | ||
| 9 | * | 8 | * |
| 10 | * See ../COPYING for licensing terms. | 9 | * See ../COPYING for licensing terms. |
| 11 | */ | 10 | */ |
| @@ -165,22 +164,10 @@ struct fsync_iocb { | |||
| 165 | bool datasync; | 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 | struct aio_kiocb { | 167 | struct aio_kiocb { |
| 180 | union { | 168 | union { |
| 181 | struct kiocb rw; | 169 | struct kiocb rw; |
| 182 | struct fsync_iocb fsync; | 170 | struct fsync_iocb fsync; |
| 183 | struct poll_iocb poll; | ||
| 184 | }; | 171 | }; |
| 185 | 172 | ||
| 186 | struct kioctx *ki_ctx; | 173 | struct kioctx *ki_ctx; |
| @@ -1590,6 +1577,7 @@ static int aio_fsync(struct fsync_iocb *req, struct iocb *iocb, bool datasync) | |||
| 1590 | if (unlikely(iocb->aio_buf || iocb->aio_offset || iocb->aio_nbytes || | 1577 | if (unlikely(iocb->aio_buf || iocb->aio_offset || iocb->aio_nbytes || |
| 1591 | iocb->aio_rw_flags)) | 1578 | iocb->aio_rw_flags)) |
| 1592 | return -EINVAL; | 1579 | return -EINVAL; |
| 1580 | |||
| 1593 | req->file = fget(iocb->aio_fildes); | 1581 | req->file = fget(iocb->aio_fildes); |
| 1594 | if (unlikely(!req->file)) | 1582 | if (unlikely(!req->file)) |
| 1595 | return -EBADF; | 1583 | return -EBADF; |
| @@ -1604,137 +1592,6 @@ static int aio_fsync(struct fsync_iocb *req, struct iocb *iocb, bool datasync) | |||
| 1604 | return 0; | 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 | static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, | 1595 | static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, |
| 1739 | bool compat) | 1596 | bool compat) |
| 1740 | { | 1597 | { |
| @@ -1808,9 +1665,6 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, | |||
| 1808 | case IOCB_CMD_FDSYNC: | 1665 | case IOCB_CMD_FDSYNC: |
| 1809 | ret = aio_fsync(&req->fsync, &iocb, true); | 1666 | ret = aio_fsync(&req->fsync, &iocb, true); |
| 1810 | break; | 1667 | break; |
| 1811 | case IOCB_CMD_POLL: | ||
| 1812 | ret = aio_poll(req, &iocb); | ||
| 1813 | break; | ||
| 1814 | default: | 1668 | default: |
| 1815 | pr_debug("invalid aio operation %d\n", iocb.aio_lio_opcode); | 1669 | pr_debug("invalid aio operation %d\n", iocb.aio_lio_opcode); |
| 1816 | ret = -EINVAL; | 1670 | ret = -EINVAL; |
diff --git a/fs/autofs/Makefile b/fs/autofs/Makefile index 43fedde15c26..1f85d35ec8b7 100644 --- a/fs/autofs/Makefile +++ b/fs/autofs/Makefile | |||
| @@ -2,6 +2,6 @@ | |||
| 2 | # Makefile for the linux autofs-filesystem routines. | 2 | # Makefile for the linux autofs-filesystem routines. |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-$(CONFIG_AUTOFS_FS) += autofs.o | 5 | obj-$(CONFIG_AUTOFS_FS) += autofs4.o |
| 6 | 6 | ||
| 7 | autofs-objs := init.o inode.o root.o symlink.o waitq.o expire.o dev-ioctl.o | 7 | autofs4-objs := init.o inode.o root.o symlink.o waitq.o expire.o dev-ioctl.o |
diff --git a/fs/autofs/init.c b/fs/autofs/init.c index cc9447e1903f..79ae07d9592f 100644 --- a/fs/autofs/init.c +++ b/fs/autofs/init.c | |||
| @@ -23,7 +23,7 @@ static struct file_system_type autofs_fs_type = { | |||
| 23 | .kill_sb = autofs_kill_sb, | 23 | .kill_sb = autofs_kill_sb, |
| 24 | }; | 24 | }; |
| 25 | MODULE_ALIAS_FS("autofs"); | 25 | MODULE_ALIAS_FS("autofs"); |
| 26 | MODULE_ALIAS("autofs4"); | 26 | MODULE_ALIAS("autofs"); |
| 27 | 27 | ||
| 28 | static int __init init_autofs_fs(void) | 28 | static int __init init_autofs_fs(void) |
| 29 | { | 29 | { |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index cce6087d6880..e55843f536bc 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
| @@ -4542,8 +4542,11 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | |||
| 4542 | offset_in_extent = em_start - em->start; | 4542 | offset_in_extent = em_start - em->start; |
| 4543 | em_end = extent_map_end(em); | 4543 | em_end = extent_map_end(em); |
| 4544 | em_len = em_end - em_start; | 4544 | em_len = em_end - em_start; |
| 4545 | disko = em->block_start + offset_in_extent; | ||
| 4546 | flags = 0; | 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 | * bump off for our next call to get_extent | 4552 | * bump off for our next call to get_extent |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index e9482f0db9d0..eba61bcb9bb3 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
| @@ -9005,13 +9005,14 @@ again: | |||
| 9005 | 9005 | ||
| 9006 | unlock_extent_cached(io_tree, page_start, page_end, &cached_state); | 9006 | unlock_extent_cached(io_tree, page_start, page_end, &cached_state); |
| 9007 | 9007 | ||
| 9008 | out_unlock: | ||
| 9009 | if (!ret2) { | 9008 | if (!ret2) { |
| 9010 | btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, true); | 9009 | btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, true); |
| 9011 | sb_end_pagefault(inode->i_sb); | 9010 | sb_end_pagefault(inode->i_sb); |
| 9012 | extent_changeset_free(data_reserved); | 9011 | extent_changeset_free(data_reserved); |
| 9013 | return VM_FAULT_LOCKED; | 9012 | return VM_FAULT_LOCKED; |
| 9014 | } | 9013 | } |
| 9014 | |||
| 9015 | out_unlock: | ||
| 9015 | unlock_page(page); | 9016 | unlock_page(page); |
| 9016 | out: | 9017 | out: |
| 9017 | btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, (ret != 0)); | 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, | |||
| 9443 | u64 new_idx = 0; | 9444 | u64 new_idx = 0; |
| 9444 | u64 root_objectid; | 9445 | u64 root_objectid; |
| 9445 | int ret; | 9446 | int ret; |
| 9447 | int ret2; | ||
| 9446 | bool root_log_pinned = false; | 9448 | bool root_log_pinned = false; |
| 9447 | bool dest_log_pinned = false; | 9449 | bool dest_log_pinned = false; |
| 9448 | 9450 | ||
| @@ -9639,7 +9641,8 @@ out_fail: | |||
| 9639 | dest_log_pinned = false; | 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 | out_notrans: | 9646 | out_notrans: |
| 9644 | if (new_ino == BTRFS_FIRST_FREE_OBJECTID) | 9647 | if (new_ino == BTRFS_FIRST_FREE_OBJECTID) |
| 9645 | up_read(&fs_info->subvol_sem); | 9648 | up_read(&fs_info->subvol_sem); |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index c2837a32d689..43ecbe620dea 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
| @@ -3577,7 +3577,7 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, | |||
| 3577 | ret = btrfs_extent_same_range(src, loff, BTRFS_MAX_DEDUPE_LEN, | 3577 | ret = btrfs_extent_same_range(src, loff, BTRFS_MAX_DEDUPE_LEN, |
| 3578 | dst, dst_loff, &cmp); | 3578 | dst, dst_loff, &cmp); |
| 3579 | if (ret) | 3579 | if (ret) |
| 3580 | goto out_unlock; | 3580 | goto out_free; |
| 3581 | 3581 | ||
| 3582 | loff += BTRFS_MAX_DEDUPE_LEN; | 3582 | loff += BTRFS_MAX_DEDUPE_LEN; |
| 3583 | dst_loff += BTRFS_MAX_DEDUPE_LEN; | 3583 | dst_loff += BTRFS_MAX_DEDUPE_LEN; |
| @@ -3587,16 +3587,16 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, | |||
| 3587 | ret = btrfs_extent_same_range(src, loff, tail_len, dst, | 3587 | ret = btrfs_extent_same_range(src, loff, tail_len, dst, |
| 3588 | dst_loff, &cmp); | 3588 | dst_loff, &cmp); |
| 3589 | 3589 | ||
| 3590 | out_free: | ||
| 3591 | kvfree(cmp.src_pages); | ||
| 3592 | kvfree(cmp.dst_pages); | ||
| 3593 | |||
| 3590 | out_unlock: | 3594 | out_unlock: |
| 3591 | if (same_inode) | 3595 | if (same_inode) |
| 3592 | inode_unlock(src); | 3596 | inode_unlock(src); |
| 3593 | else | 3597 | else |
| 3594 | btrfs_double_inode_unlock(src, dst); | 3598 | btrfs_double_inode_unlock(src, dst); |
| 3595 | 3599 | ||
| 3596 | out_free: | ||
| 3597 | kvfree(cmp.src_pages); | ||
| 3598 | kvfree(cmp.dst_pages); | ||
| 3599 | |||
| 3600 | return ret; | 3600 | return ret; |
| 3601 | } | 3601 | } |
| 3602 | 3602 | ||
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 1874a6d2e6f5..c25dc47210a3 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c | |||
| @@ -2680,8 +2680,10 @@ out: | |||
| 2680 | free_extent_buffer(scratch_leaf); | 2680 | free_extent_buffer(scratch_leaf); |
| 2681 | } | 2681 | } |
| 2682 | 2682 | ||
| 2683 | if (done && !ret) | 2683 | if (done && !ret) { |
| 2684 | ret = 1; | 2684 | ret = 1; |
| 2685 | fs_info->qgroup_rescan_progress.objectid = (u64)-1; | ||
| 2686 | } | ||
| 2685 | return ret; | 2687 | return ret; |
| 2686 | } | 2688 | } |
| 2687 | 2689 | ||
| @@ -2784,13 +2786,20 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid, | |||
| 2784 | 2786 | ||
| 2785 | if (!init_flags) { | 2787 | if (!init_flags) { |
| 2786 | /* we're resuming qgroup rescan at mount time */ | 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 | btrfs_warn(fs_info, | 2791 | btrfs_warn(fs_info, |
| 2789 | "qgroup rescan init failed, qgroup is not enabled"); | 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 | btrfs_warn(fs_info, | 2796 | btrfs_warn(fs_info, |
| 2792 | "qgroup rescan init failed, qgroup rescan is not queued"); | 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 | mutex_lock(&fs_info->qgroup_rescan_lock); | 2805 | mutex_lock(&fs_info->qgroup_rescan_lock); |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index ee764ac352ab..a866be999216 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
| @@ -1135,6 +1135,7 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in) | |||
| 1135 | if (IS_ERR(realdn)) { | 1135 | if (IS_ERR(realdn)) { |
| 1136 | pr_err("splice_dentry error %ld %p inode %p ino %llx.%llx\n", | 1136 | pr_err("splice_dentry error %ld %p inode %p ino %llx.%llx\n", |
| 1137 | PTR_ERR(realdn), dn, in, ceph_vinop(in)); | 1137 | PTR_ERR(realdn), dn, in, ceph_vinop(in)); |
| 1138 | dput(dn); | ||
| 1138 | dn = realdn; /* note realdn contains the error */ | 1139 | dn = realdn; /* note realdn contains the error */ |
| 1139 | goto out; | 1140 | goto out; |
| 1140 | } else if (realdn) { | 1141 | } else if (realdn) { |
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index bd78da59a4fd..c923c7854027 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
| @@ -423,7 +423,7 @@ struct smb_version_operations { | |||
| 423 | void (*set_oplock_level)(struct cifsInodeInfo *, __u32, unsigned int, | 423 | void (*set_oplock_level)(struct cifsInodeInfo *, __u32, unsigned int, |
| 424 | bool *); | 424 | bool *); |
| 425 | /* create lease context buffer for CREATE request */ | 425 | /* create lease context buffer for CREATE request */ |
| 426 | char * (*create_lease_buf)(u8 *, u8); | 426 | char * (*create_lease_buf)(u8 *lease_key, u8 oplock); |
| 427 | /* parse lease context buffer and return oplock/epoch info */ | 427 | /* parse lease context buffer and return oplock/epoch info */ |
| 428 | __u8 (*parse_lease_buf)(void *buf, unsigned int *epoch, char *lkey); | 428 | __u8 (*parse_lease_buf)(void *buf, unsigned int *epoch, char *lkey); |
| 429 | ssize_t (*copychunk_range)(const unsigned int, | 429 | ssize_t (*copychunk_range)(const unsigned int, |
| @@ -1416,6 +1416,7 @@ typedef int (mid_handle_t)(struct TCP_Server_Info *server, | |||
| 1416 | /* one of these for every pending CIFS request to the server */ | 1416 | /* one of these for every pending CIFS request to the server */ |
| 1417 | struct mid_q_entry { | 1417 | struct mid_q_entry { |
| 1418 | struct list_head qhead; /* mids waiting on reply from this server */ | 1418 | struct list_head qhead; /* mids waiting on reply from this server */ |
| 1419 | struct kref refcount; | ||
| 1419 | struct TCP_Server_Info *server; /* server corresponding to this mid */ | 1420 | struct TCP_Server_Info *server; /* server corresponding to this mid */ |
| 1420 | __u64 mid; /* multiplex id */ | 1421 | __u64 mid; /* multiplex id */ |
| 1421 | __u32 pid; /* process id */ | 1422 | __u32 pid; /* process id */ |
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 03018be17283..1890f534c88b 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
| @@ -82,6 +82,7 @@ extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer, | |||
| 82 | struct TCP_Server_Info *server); | 82 | struct TCP_Server_Info *server); |
| 83 | extern void DeleteMidQEntry(struct mid_q_entry *midEntry); | 83 | extern void DeleteMidQEntry(struct mid_q_entry *midEntry); |
| 84 | extern void cifs_delete_mid(struct mid_q_entry *mid); | 84 | extern void cifs_delete_mid(struct mid_q_entry *mid); |
| 85 | extern void cifs_mid_q_entry_release(struct mid_q_entry *midEntry); | ||
| 85 | extern void cifs_wake_up_task(struct mid_q_entry *mid); | 86 | extern void cifs_wake_up_task(struct mid_q_entry *mid); |
| 86 | extern int cifs_handle_standard(struct TCP_Server_Info *server, | 87 | extern int cifs_handle_standard(struct TCP_Server_Info *server, |
| 87 | struct mid_q_entry *mid); | 88 | struct mid_q_entry *mid); |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index d352da325de3..93408eab92e7 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
| @@ -157,8 +157,14 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command) | |||
| 157 | * greater than cifs socket timeout which is 7 seconds | 157 | * greater than cifs socket timeout which is 7 seconds |
| 158 | */ | 158 | */ |
| 159 | while (server->tcpStatus == CifsNeedReconnect) { | 159 | while (server->tcpStatus == CifsNeedReconnect) { |
| 160 | wait_event_interruptible_timeout(server->response_q, | 160 | rc = wait_event_interruptible_timeout(server->response_q, |
| 161 | (server->tcpStatus != CifsNeedReconnect), 10 * HZ); | 161 | (server->tcpStatus != CifsNeedReconnect), |
| 162 | 10 * HZ); | ||
| 163 | if (rc < 0) { | ||
| 164 | cifs_dbg(FYI, "%s: aborting reconnect due to a received" | ||
| 165 | " signal by the process\n", __func__); | ||
| 166 | return -ERESTARTSYS; | ||
| 167 | } | ||
| 162 | 168 | ||
| 163 | /* are we still trying to reconnect? */ | 169 | /* are we still trying to reconnect? */ |
| 164 | if (server->tcpStatus != CifsNeedReconnect) | 170 | if (server->tcpStatus != CifsNeedReconnect) |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index a57da1b88bdf..5df2c0698cda 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
| @@ -924,6 +924,7 @@ next_pdu: | |||
| 924 | server->pdu_size = next_offset; | 924 | server->pdu_size = next_offset; |
| 925 | } | 925 | } |
| 926 | 926 | ||
| 927 | mid_entry = NULL; | ||
| 927 | if (server->ops->is_transform_hdr && | 928 | if (server->ops->is_transform_hdr && |
| 928 | server->ops->receive_transform && | 929 | server->ops->receive_transform && |
| 929 | server->ops->is_transform_hdr(buf)) { | 930 | server->ops->is_transform_hdr(buf)) { |
| @@ -938,8 +939,11 @@ next_pdu: | |||
| 938 | length = mid_entry->receive(server, mid_entry); | 939 | length = mid_entry->receive(server, mid_entry); |
| 939 | } | 940 | } |
| 940 | 941 | ||
| 941 | if (length < 0) | 942 | if (length < 0) { |
| 943 | if (mid_entry) | ||
| 944 | cifs_mid_q_entry_release(mid_entry); | ||
| 942 | continue; | 945 | continue; |
| 946 | } | ||
| 943 | 947 | ||
| 944 | if (server->large_buf) | 948 | if (server->large_buf) |
| 945 | buf = server->bigbuf; | 949 | buf = server->bigbuf; |
| @@ -956,6 +960,8 @@ next_pdu: | |||
| 956 | 960 | ||
| 957 | if (!mid_entry->multiRsp || mid_entry->multiEnd) | 961 | if (!mid_entry->multiRsp || mid_entry->multiEnd) |
| 958 | mid_entry->callback(mid_entry); | 962 | mid_entry->callback(mid_entry); |
| 963 | |||
| 964 | cifs_mid_q_entry_release(mid_entry); | ||
| 959 | } else if (server->ops->is_oplock_break && | 965 | } else if (server->ops->is_oplock_break && |
| 960 | server->ops->is_oplock_break(buf, server)) { | 966 | server->ops->is_oplock_break(buf, server)) { |
| 961 | cifs_dbg(FYI, "Received oplock break\n"); | 967 | cifs_dbg(FYI, "Received oplock break\n"); |
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index aff8ce8ba34d..646dcd149de1 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c | |||
| @@ -107,6 +107,7 @@ cifs_find_mid(struct TCP_Server_Info *server, char *buffer) | |||
| 107 | if (compare_mid(mid->mid, buf) && | 107 | if (compare_mid(mid->mid, buf) && |
| 108 | mid->mid_state == MID_REQUEST_SUBMITTED && | 108 | mid->mid_state == MID_REQUEST_SUBMITTED && |
| 109 | le16_to_cpu(mid->command) == buf->Command) { | 109 | le16_to_cpu(mid->command) == buf->Command) { |
| 110 | kref_get(&mid->refcount); | ||
| 110 | spin_unlock(&GlobalMid_Lock); | 111 | spin_unlock(&GlobalMid_Lock); |
| 111 | return mid; | 112 | return mid; |
| 112 | } | 113 | } |
diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c index 788412675723..4ed10dd086e6 100644 --- a/fs/cifs/smb2file.c +++ b/fs/cifs/smb2file.c | |||
| @@ -41,7 +41,7 @@ smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, | |||
| 41 | int rc; | 41 | int rc; |
| 42 | __le16 *smb2_path; | 42 | __le16 *smb2_path; |
| 43 | struct smb2_file_all_info *smb2_data = NULL; | 43 | struct smb2_file_all_info *smb2_data = NULL; |
| 44 | __u8 smb2_oplock[17]; | 44 | __u8 smb2_oplock; |
| 45 | struct cifs_fid *fid = oparms->fid; | 45 | struct cifs_fid *fid = oparms->fid; |
| 46 | struct network_resiliency_req nr_ioctl_req; | 46 | struct network_resiliency_req nr_ioctl_req; |
| 47 | 47 | ||
| @@ -59,12 +59,9 @@ smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, | |||
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | oparms->desired_access |= FILE_READ_ATTRIBUTES; | 61 | oparms->desired_access |= FILE_READ_ATTRIBUTES; |
| 62 | *smb2_oplock = SMB2_OPLOCK_LEVEL_BATCH; | 62 | smb2_oplock = SMB2_OPLOCK_LEVEL_BATCH; |
| 63 | 63 | ||
| 64 | if (oparms->tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_LEASING) | 64 | rc = SMB2_open(xid, oparms, smb2_path, &smb2_oplock, smb2_data, NULL, |
| 65 | memcpy(smb2_oplock + 1, fid->lease_key, SMB2_LEASE_KEY_SIZE); | ||
| 66 | |||
| 67 | rc = SMB2_open(xid, oparms, smb2_path, smb2_oplock, smb2_data, NULL, | ||
| 68 | NULL); | 65 | NULL); |
| 69 | if (rc) | 66 | if (rc) |
| 70 | goto out; | 67 | goto out; |
| @@ -101,7 +98,7 @@ smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, | |||
| 101 | move_smb2_info_to_cifs(buf, smb2_data); | 98 | move_smb2_info_to_cifs(buf, smb2_data); |
| 102 | } | 99 | } |
| 103 | 100 | ||
| 104 | *oplock = *smb2_oplock; | 101 | *oplock = smb2_oplock; |
| 105 | out: | 102 | out: |
| 106 | kfree(smb2_data); | 103 | kfree(smb2_data); |
| 107 | kfree(smb2_path); | 104 | kfree(smb2_path); |
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 0356b5559c71..ea92a38b2f08 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
| @@ -203,6 +203,7 @@ smb2_find_mid(struct TCP_Server_Info *server, char *buf) | |||
| 203 | if ((mid->mid == wire_mid) && | 203 | if ((mid->mid == wire_mid) && |
| 204 | (mid->mid_state == MID_REQUEST_SUBMITTED) && | 204 | (mid->mid_state == MID_REQUEST_SUBMITTED) && |
| 205 | (mid->command == shdr->Command)) { | 205 | (mid->command == shdr->Command)) { |
| 206 | kref_get(&mid->refcount); | ||
| 206 | spin_unlock(&GlobalMid_Lock); | 207 | spin_unlock(&GlobalMid_Lock); |
| 207 | return mid; | 208 | return mid; |
| 208 | } | 209 | } |
| @@ -855,6 +856,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, | |||
| 855 | 856 | ||
| 856 | rc = SMB2_set_ea(xid, tcon, fid.persistent_fid, fid.volatile_fid, ea, | 857 | rc = SMB2_set_ea(xid, tcon, fid.persistent_fid, fid.volatile_fid, ea, |
| 857 | len); | 858 | len); |
| 859 | kfree(ea); | ||
| 860 | |||
| 858 | SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid); | 861 | SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid); |
| 859 | 862 | ||
| 860 | return rc; | 863 | return rc; |
| @@ -2219,8 +2222,7 @@ smb2_create_lease_buf(u8 *lease_key, u8 oplock) | |||
| 2219 | if (!buf) | 2222 | if (!buf) |
| 2220 | return NULL; | 2223 | return NULL; |
| 2221 | 2224 | ||
| 2222 | buf->lcontext.LeaseKeyLow = cpu_to_le64(*((u64 *)lease_key)); | 2225 | memcpy(&buf->lcontext.LeaseKey, lease_key, SMB2_LEASE_KEY_SIZE); |
| 2223 | buf->lcontext.LeaseKeyHigh = cpu_to_le64(*((u64 *)(lease_key + 8))); | ||
| 2224 | buf->lcontext.LeaseState = map_oplock_to_lease(oplock); | 2226 | buf->lcontext.LeaseState = map_oplock_to_lease(oplock); |
| 2225 | 2227 | ||
| 2226 | buf->ccontext.DataOffset = cpu_to_le16(offsetof | 2228 | buf->ccontext.DataOffset = cpu_to_le16(offsetof |
| @@ -2246,8 +2248,7 @@ smb3_create_lease_buf(u8 *lease_key, u8 oplock) | |||
| 2246 | if (!buf) | 2248 | if (!buf) |
| 2247 | return NULL; | 2249 | return NULL; |
| 2248 | 2250 | ||
| 2249 | buf->lcontext.LeaseKeyLow = cpu_to_le64(*((u64 *)lease_key)); | 2251 | memcpy(&buf->lcontext.LeaseKey, lease_key, SMB2_LEASE_KEY_SIZE); |
| 2250 | buf->lcontext.LeaseKeyHigh = cpu_to_le64(*((u64 *)(lease_key + 8))); | ||
| 2251 | buf->lcontext.LeaseState = map_oplock_to_lease(oplock); | 2252 | buf->lcontext.LeaseState = map_oplock_to_lease(oplock); |
| 2252 | 2253 | ||
| 2253 | buf->ccontext.DataOffset = cpu_to_le16(offsetof | 2254 | buf->ccontext.DataOffset = cpu_to_le16(offsetof |
| @@ -2284,8 +2285,7 @@ smb3_parse_lease_buf(void *buf, unsigned int *epoch, char *lease_key) | |||
| 2284 | if (lc->lcontext.LeaseFlags & SMB2_LEASE_FLAG_BREAK_IN_PROGRESS) | 2285 | if (lc->lcontext.LeaseFlags & SMB2_LEASE_FLAG_BREAK_IN_PROGRESS) |
| 2285 | return SMB2_OPLOCK_LEVEL_NOCHANGE; | 2286 | return SMB2_OPLOCK_LEVEL_NOCHANGE; |
| 2286 | if (lease_key) | 2287 | if (lease_key) |
| 2287 | memcpy(lease_key, &lc->lcontext.LeaseKeyLow, | 2288 | memcpy(lease_key, &lc->lcontext.LeaseKey, SMB2_LEASE_KEY_SIZE); |
| 2288 | SMB2_LEASE_KEY_SIZE); | ||
| 2289 | return le32_to_cpu(lc->lcontext.LeaseState); | 2289 | return le32_to_cpu(lc->lcontext.LeaseState); |
| 2290 | } | 2290 | } |
| 2291 | 2291 | ||
| @@ -2521,7 +2521,7 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, struct smb_rqst *new_rq, | |||
| 2521 | if (!tr_hdr) | 2521 | if (!tr_hdr) |
| 2522 | goto err_free_iov; | 2522 | goto err_free_iov; |
| 2523 | 2523 | ||
| 2524 | orig_len = smb2_rqst_len(old_rq, false); | 2524 | orig_len = smb_rqst_len(server, old_rq); |
| 2525 | 2525 | ||
| 2526 | /* fill the 2nd iov with a transform header */ | 2526 | /* fill the 2nd iov with a transform header */ |
| 2527 | fill_transform_hdr(tr_hdr, orig_len, old_rq); | 2527 | fill_transform_hdr(tr_hdr, orig_len, old_rq); |
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 810b85787c91..3c92678cb45b 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c | |||
| @@ -155,7 +155,7 @@ out: | |||
| 155 | static int | 155 | static int |
| 156 | smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) | 156 | smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) |
| 157 | { | 157 | { |
| 158 | int rc = 0; | 158 | int rc; |
| 159 | struct nls_table *nls_codepage; | 159 | struct nls_table *nls_codepage; |
| 160 | struct cifs_ses *ses; | 160 | struct cifs_ses *ses; |
| 161 | struct TCP_Server_Info *server; | 161 | struct TCP_Server_Info *server; |
| @@ -166,10 +166,10 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) | |||
| 166 | * for those three - in the calling routine. | 166 | * for those three - in the calling routine. |
| 167 | */ | 167 | */ |
| 168 | if (tcon == NULL) | 168 | if (tcon == NULL) |
| 169 | return rc; | 169 | return 0; |
| 170 | 170 | ||
| 171 | if (smb2_command == SMB2_TREE_CONNECT) | 171 | if (smb2_command == SMB2_TREE_CONNECT) |
| 172 | return rc; | 172 | return 0; |
| 173 | 173 | ||
| 174 | if (tcon->tidStatus == CifsExiting) { | 174 | if (tcon->tidStatus == CifsExiting) { |
| 175 | /* | 175 | /* |
| @@ -212,8 +212,14 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) | |||
| 212 | return -EAGAIN; | 212 | return -EAGAIN; |
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | wait_event_interruptible_timeout(server->response_q, | 215 | rc = wait_event_interruptible_timeout(server->response_q, |
| 216 | (server->tcpStatus != CifsNeedReconnect), 10 * HZ); | 216 | (server->tcpStatus != CifsNeedReconnect), |
| 217 | 10 * HZ); | ||
| 218 | if (rc < 0) { | ||
| 219 | cifs_dbg(FYI, "%s: aborting reconnect due to a received" | ||
| 220 | " signal by the process\n", __func__); | ||
| 221 | return -ERESTARTSYS; | ||
| 222 | } | ||
| 217 | 223 | ||
| 218 | /* are we still trying to reconnect? */ | 224 | /* are we still trying to reconnect? */ |
| 219 | if (server->tcpStatus != CifsNeedReconnect) | 225 | if (server->tcpStatus != CifsNeedReconnect) |
| @@ -231,7 +237,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) | |||
| 231 | } | 237 | } |
| 232 | 238 | ||
| 233 | if (!tcon->ses->need_reconnect && !tcon->need_reconnect) | 239 | if (!tcon->ses->need_reconnect && !tcon->need_reconnect) |
| 234 | return rc; | 240 | return 0; |
| 235 | 241 | ||
| 236 | nls_codepage = load_nls_default(); | 242 | nls_codepage = load_nls_default(); |
| 237 | 243 | ||
| @@ -340,7 +346,10 @@ smb2_plain_req_init(__le16 smb2_command, struct cifs_tcon *tcon, | |||
| 340 | return rc; | 346 | return rc; |
| 341 | 347 | ||
| 342 | /* BB eventually switch this to SMB2 specific small buf size */ | 348 | /* BB eventually switch this to SMB2 specific small buf size */ |
| 343 | *request_buf = cifs_small_buf_get(); | 349 | if (smb2_command == SMB2_SET_INFO) |
| 350 | *request_buf = cifs_buf_get(); | ||
| 351 | else | ||
| 352 | *request_buf = cifs_small_buf_get(); | ||
| 344 | if (*request_buf == NULL) { | 353 | if (*request_buf == NULL) { |
| 345 | /* BB should we add a retry in here if not a writepage? */ | 354 | /* BB should we add a retry in here if not a writepage? */ |
| 346 | return -ENOMEM; | 355 | return -ENOMEM; |
| @@ -1707,12 +1716,12 @@ parse_lease_state(struct TCP_Server_Info *server, struct smb2_create_rsp *rsp, | |||
| 1707 | 1716 | ||
| 1708 | static int | 1717 | static int |
| 1709 | add_lease_context(struct TCP_Server_Info *server, struct kvec *iov, | 1718 | add_lease_context(struct TCP_Server_Info *server, struct kvec *iov, |
| 1710 | unsigned int *num_iovec, __u8 *oplock) | 1719 | unsigned int *num_iovec, u8 *lease_key, __u8 *oplock) |
| 1711 | { | 1720 | { |
| 1712 | struct smb2_create_req *req = iov[0].iov_base; | 1721 | struct smb2_create_req *req = iov[0].iov_base; |
| 1713 | unsigned int num = *num_iovec; | 1722 | unsigned int num = *num_iovec; |
| 1714 | 1723 | ||
| 1715 | iov[num].iov_base = server->ops->create_lease_buf(oplock+1, *oplock); | 1724 | iov[num].iov_base = server->ops->create_lease_buf(lease_key, *oplock); |
| 1716 | if (iov[num].iov_base == NULL) | 1725 | if (iov[num].iov_base == NULL) |
| 1717 | return -ENOMEM; | 1726 | return -ENOMEM; |
| 1718 | iov[num].iov_len = server->vals->create_lease_size; | 1727 | iov[num].iov_len = server->vals->create_lease_size; |
| @@ -2172,7 +2181,8 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, | |||
| 2172 | *oplock == SMB2_OPLOCK_LEVEL_NONE) | 2181 | *oplock == SMB2_OPLOCK_LEVEL_NONE) |
| 2173 | req->RequestedOplockLevel = *oplock; | 2182 | req->RequestedOplockLevel = *oplock; |
| 2174 | else { | 2183 | else { |
| 2175 | rc = add_lease_context(server, iov, &n_iov, oplock); | 2184 | rc = add_lease_context(server, iov, &n_iov, |
| 2185 | oparms->fid->lease_key, oplock); | ||
| 2176 | if (rc) { | 2186 | if (rc) { |
| 2177 | cifs_small_buf_release(req); | 2187 | cifs_small_buf_release(req); |
| 2178 | kfree(copy_path); | 2188 | kfree(copy_path); |
| @@ -3720,7 +3730,7 @@ send_set_info(const unsigned int xid, struct cifs_tcon *tcon, | |||
| 3720 | 3730 | ||
| 3721 | rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, | 3731 | rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, |
| 3722 | &rsp_iov); | 3732 | &rsp_iov); |
| 3723 | cifs_small_buf_release(req); | 3733 | cifs_buf_release(req); |
| 3724 | rsp = (struct smb2_set_info_rsp *)rsp_iov.iov_base; | 3734 | rsp = (struct smb2_set_info_rsp *)rsp_iov.iov_base; |
| 3725 | 3735 | ||
| 3726 | if (rc != 0) { | 3736 | if (rc != 0) { |
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 824dddeee3f2..a671adcc44a6 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h | |||
| @@ -678,16 +678,14 @@ struct create_context { | |||
| 678 | #define SMB2_LEASE_KEY_SIZE 16 | 678 | #define SMB2_LEASE_KEY_SIZE 16 |
| 679 | 679 | ||
| 680 | struct lease_context { | 680 | struct lease_context { |
| 681 | __le64 LeaseKeyLow; | 681 | u8 LeaseKey[SMB2_LEASE_KEY_SIZE]; |
| 682 | __le64 LeaseKeyHigh; | ||
| 683 | __le32 LeaseState; | 682 | __le32 LeaseState; |
| 684 | __le32 LeaseFlags; | 683 | __le32 LeaseFlags; |
| 685 | __le64 LeaseDuration; | 684 | __le64 LeaseDuration; |
| 686 | } __packed; | 685 | } __packed; |
| 687 | 686 | ||
| 688 | struct lease_context_v2 { | 687 | struct lease_context_v2 { |
| 689 | __le64 LeaseKeyLow; | 688 | u8 LeaseKey[SMB2_LEASE_KEY_SIZE]; |
| 690 | __le64 LeaseKeyHigh; | ||
| 691 | __le32 LeaseState; | 689 | __le32 LeaseState; |
| 692 | __le32 LeaseFlags; | 690 | __le32 LeaseFlags; |
| 693 | __le64 LeaseDuration; | 691 | __le64 LeaseDuration; |
diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h index 3ae208ac2a77..6e6a4f2ec890 100644 --- a/fs/cifs/smb2proto.h +++ b/fs/cifs/smb2proto.h | |||
| @@ -113,8 +113,8 @@ extern int smb2_unlock_range(struct cifsFileInfo *cfile, | |||
| 113 | extern int smb2_push_mandatory_locks(struct cifsFileInfo *cfile); | 113 | extern int smb2_push_mandatory_locks(struct cifsFileInfo *cfile); |
| 114 | extern void smb2_reconnect_server(struct work_struct *work); | 114 | extern void smb2_reconnect_server(struct work_struct *work); |
| 115 | extern int smb3_crypto_aead_allocate(struct TCP_Server_Info *server); | 115 | extern int smb3_crypto_aead_allocate(struct TCP_Server_Info *server); |
| 116 | extern unsigned long | 116 | extern unsigned long smb_rqst_len(struct TCP_Server_Info *server, |
| 117 | smb2_rqst_len(struct smb_rqst *rqst, bool skip_rfc1002_marker); | 117 | struct smb_rqst *rqst); |
| 118 | 118 | ||
| 119 | /* | 119 | /* |
| 120 | * SMB2 Worker functions - most of protocol specific implementation details | 120 | * SMB2 Worker functions - most of protocol specific implementation details |
diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c index 51b9437c3c7b..719d55e63d88 100644 --- a/fs/cifs/smb2transport.c +++ b/fs/cifs/smb2transport.c | |||
| @@ -173,6 +173,8 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) | |||
| 173 | struct kvec *iov = rqst->rq_iov; | 173 | struct kvec *iov = rqst->rq_iov; |
| 174 | struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)iov[0].iov_base; | 174 | struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)iov[0].iov_base; |
| 175 | struct cifs_ses *ses; | 175 | struct cifs_ses *ses; |
| 176 | struct shash_desc *shash = &server->secmech.sdeschmacsha256->shash; | ||
| 177 | struct smb_rqst drqst; | ||
| 176 | 178 | ||
| 177 | ses = smb2_find_smb_ses(server, shdr->SessionId); | 179 | ses = smb2_find_smb_ses(server, shdr->SessionId); |
| 178 | if (!ses) { | 180 | if (!ses) { |
| @@ -190,21 +192,39 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) | |||
| 190 | } | 192 | } |
| 191 | 193 | ||
| 192 | rc = crypto_shash_setkey(server->secmech.hmacsha256, | 194 | rc = crypto_shash_setkey(server->secmech.hmacsha256, |
| 193 | ses->auth_key.response, SMB2_NTLMV2_SESSKEY_SIZE); | 195 | ses->auth_key.response, SMB2_NTLMV2_SESSKEY_SIZE); |
| 194 | if (rc) { | 196 | if (rc) { |
| 195 | cifs_dbg(VFS, "%s: Could not update with response\n", __func__); | 197 | cifs_dbg(VFS, "%s: Could not update with response\n", __func__); |
| 196 | return rc; | 198 | return rc; |
| 197 | } | 199 | } |
| 198 | 200 | ||
| 199 | rc = crypto_shash_init(&server->secmech.sdeschmacsha256->shash); | 201 | rc = crypto_shash_init(shash); |
| 200 | if (rc) { | 202 | if (rc) { |
| 201 | cifs_dbg(VFS, "%s: Could not init sha256", __func__); | 203 | cifs_dbg(VFS, "%s: Could not init sha256", __func__); |
| 202 | return rc; | 204 | return rc; |
| 203 | } | 205 | } |
| 204 | 206 | ||
| 205 | rc = __cifs_calc_signature(rqst, server, sigptr, | 207 | /* |
| 206 | &server->secmech.sdeschmacsha256->shash); | 208 | * For SMB2+, __cifs_calc_signature() expects to sign only the actual |
| 209 | * data, that is, iov[0] should not contain a rfc1002 length. | ||
| 210 | * | ||
| 211 | * Sign the rfc1002 length prior to passing the data (iov[1-N]) down to | ||
| 212 | * __cifs_calc_signature(). | ||
| 213 | */ | ||
| 214 | drqst = *rqst; | ||
| 215 | if (drqst.rq_nvec >= 2 && iov[0].iov_len == 4) { | ||
| 216 | rc = crypto_shash_update(shash, iov[0].iov_base, | ||
| 217 | iov[0].iov_len); | ||
| 218 | if (rc) { | ||
| 219 | cifs_dbg(VFS, "%s: Could not update with payload\n", | ||
| 220 | __func__); | ||
| 221 | return rc; | ||
| 222 | } | ||
| 223 | drqst.rq_iov++; | ||
| 224 | drqst.rq_nvec--; | ||
| 225 | } | ||
| 207 | 226 | ||
| 227 | rc = __cifs_calc_signature(&drqst, server, sigptr, shash); | ||
| 208 | if (!rc) | 228 | if (!rc) |
| 209 | memcpy(shdr->Signature, sigptr, SMB2_SIGNATURE_SIZE); | 229 | memcpy(shdr->Signature, sigptr, SMB2_SIGNATURE_SIZE); |
| 210 | 230 | ||
| @@ -408,12 +428,14 @@ generate_smb311signingkey(struct cifs_ses *ses) | |||
| 408 | int | 428 | int |
| 409 | smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) | 429 | smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) |
| 410 | { | 430 | { |
| 411 | int rc = 0; | 431 | int rc; |
| 412 | unsigned char smb3_signature[SMB2_CMACAES_SIZE]; | 432 | unsigned char smb3_signature[SMB2_CMACAES_SIZE]; |
| 413 | unsigned char *sigptr = smb3_signature; | 433 | unsigned char *sigptr = smb3_signature; |
| 414 | struct kvec *iov = rqst->rq_iov; | 434 | struct kvec *iov = rqst->rq_iov; |
| 415 | struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)iov[0].iov_base; | 435 | struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)iov[0].iov_base; |
| 416 | struct cifs_ses *ses; | 436 | struct cifs_ses *ses; |
| 437 | struct shash_desc *shash = &server->secmech.sdesccmacaes->shash; | ||
| 438 | struct smb_rqst drqst; | ||
| 417 | 439 | ||
| 418 | ses = smb2_find_smb_ses(server, shdr->SessionId); | 440 | ses = smb2_find_smb_ses(server, shdr->SessionId); |
| 419 | if (!ses) { | 441 | if (!ses) { |
| @@ -425,8 +447,7 @@ smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) | |||
| 425 | memset(shdr->Signature, 0x0, SMB2_SIGNATURE_SIZE); | 447 | memset(shdr->Signature, 0x0, SMB2_SIGNATURE_SIZE); |
| 426 | 448 | ||
| 427 | rc = crypto_shash_setkey(server->secmech.cmacaes, | 449 | rc = crypto_shash_setkey(server->secmech.cmacaes, |
| 428 | ses->smb3signingkey, SMB2_CMACAES_SIZE); | 450 | ses->smb3signingkey, SMB2_CMACAES_SIZE); |
| 429 | |||
| 430 | if (rc) { | 451 | if (rc) { |
| 431 | cifs_dbg(VFS, "%s: Could not set key for cmac aes\n", __func__); | 452 | cifs_dbg(VFS, "%s: Could not set key for cmac aes\n", __func__); |
| 432 | return rc; | 453 | return rc; |
| @@ -437,15 +458,33 @@ smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) | |||
| 437 | * so unlike smb2 case we do not have to check here if secmech are | 458 | * so unlike smb2 case we do not have to check here if secmech are |
| 438 | * initialized | 459 | * initialized |
| 439 | */ | 460 | */ |
| 440 | rc = crypto_shash_init(&server->secmech.sdesccmacaes->shash); | 461 | rc = crypto_shash_init(shash); |
| 441 | if (rc) { | 462 | if (rc) { |
| 442 | cifs_dbg(VFS, "%s: Could not init cmac aes\n", __func__); | 463 | cifs_dbg(VFS, "%s: Could not init cmac aes\n", __func__); |
| 443 | return rc; | 464 | return rc; |
| 444 | } | 465 | } |
| 445 | 466 | ||
| 446 | rc = __cifs_calc_signature(rqst, server, sigptr, | 467 | /* |
| 447 | &server->secmech.sdesccmacaes->shash); | 468 | * For SMB2+, __cifs_calc_signature() expects to sign only the actual |
| 469 | * data, that is, iov[0] should not contain a rfc1002 length. | ||
| 470 | * | ||
| 471 | * Sign the rfc1002 length prior to passing the data (iov[1-N]) down to | ||
| 472 | * __cifs_calc_signature(). | ||
| 473 | */ | ||
| 474 | drqst = *rqst; | ||
| 475 | if (drqst.rq_nvec >= 2 && iov[0].iov_len == 4) { | ||
| 476 | rc = crypto_shash_update(shash, iov[0].iov_base, | ||
| 477 | iov[0].iov_len); | ||
| 478 | if (rc) { | ||
| 479 | cifs_dbg(VFS, "%s: Could not update with payload\n", | ||
| 480 | __func__); | ||
| 481 | return rc; | ||
| 482 | } | ||
| 483 | drqst.rq_iov++; | ||
| 484 | drqst.rq_nvec--; | ||
| 485 | } | ||
| 448 | 486 | ||
| 487 | rc = __cifs_calc_signature(&drqst, server, sigptr, shash); | ||
| 449 | if (!rc) | 488 | if (!rc) |
| 450 | memcpy(shdr->Signature, sigptr, SMB2_SIGNATURE_SIZE); | 489 | memcpy(shdr->Signature, sigptr, SMB2_SIGNATURE_SIZE); |
| 451 | 490 | ||
| @@ -548,6 +587,7 @@ smb2_mid_entry_alloc(const struct smb2_sync_hdr *shdr, | |||
| 548 | 587 | ||
| 549 | temp = mempool_alloc(cifs_mid_poolp, GFP_NOFS); | 588 | temp = mempool_alloc(cifs_mid_poolp, GFP_NOFS); |
| 550 | memset(temp, 0, sizeof(struct mid_q_entry)); | 589 | memset(temp, 0, sizeof(struct mid_q_entry)); |
| 590 | kref_init(&temp->refcount); | ||
| 551 | temp->mid = le64_to_cpu(shdr->MessageId); | 591 | temp->mid = le64_to_cpu(shdr->MessageId); |
| 552 | temp->pid = current->pid; | 592 | temp->pid = current->pid; |
| 553 | temp->command = shdr->Command; /* Always LE */ | 593 | temp->command = shdr->Command; /* Always LE */ |
diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 6fd94d9ffac2..c55ea4e6201b 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c | |||
| @@ -2083,8 +2083,9 @@ int smbd_recv(struct smbd_connection *info, struct msghdr *msg) | |||
| 2083 | * rqst: the data to write | 2083 | * rqst: the data to write |
| 2084 | * return value: 0 if successfully write, otherwise error code | 2084 | * return value: 0 if successfully write, otherwise error code |
| 2085 | */ | 2085 | */ |
| 2086 | int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) | 2086 | int smbd_send(struct TCP_Server_Info *server, struct smb_rqst *rqst) |
| 2087 | { | 2087 | { |
| 2088 | struct smbd_connection *info = server->smbd_conn; | ||
| 2088 | struct kvec vec; | 2089 | struct kvec vec; |
| 2089 | int nvecs; | 2090 | int nvecs; |
| 2090 | int size; | 2091 | int size; |
| @@ -2118,7 +2119,7 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) | |||
| 2118 | * rq_tailsz to PAGE_SIZE when the buffer has multiple pages and | 2119 | * rq_tailsz to PAGE_SIZE when the buffer has multiple pages and |
| 2119 | * ends at page boundary | 2120 | * ends at page boundary |
| 2120 | */ | 2121 | */ |
| 2121 | buflen = smb2_rqst_len(rqst, true); | 2122 | buflen = smb_rqst_len(server, rqst); |
| 2122 | 2123 | ||
| 2123 | if (buflen + sizeof(struct smbd_data_transfer) > | 2124 | if (buflen + sizeof(struct smbd_data_transfer) > |
| 2124 | info->max_fragmented_send_size) { | 2125 | info->max_fragmented_send_size) { |
diff --git a/fs/cifs/smbdirect.h b/fs/cifs/smbdirect.h index 1e419c21dc60..a11096254f29 100644 --- a/fs/cifs/smbdirect.h +++ b/fs/cifs/smbdirect.h | |||
| @@ -292,7 +292,7 @@ void smbd_destroy(struct smbd_connection *info); | |||
| 292 | 292 | ||
| 293 | /* Interface for carrying upper layer I/O through send/recv */ | 293 | /* Interface for carrying upper layer I/O through send/recv */ |
| 294 | int smbd_recv(struct smbd_connection *info, struct msghdr *msg); | 294 | int smbd_recv(struct smbd_connection *info, struct msghdr *msg); |
| 295 | int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst); | 295 | int smbd_send(struct TCP_Server_Info *server, struct smb_rqst *rqst); |
| 296 | 296 | ||
| 297 | enum mr_state { | 297 | enum mr_state { |
| 298 | MR_READY, | 298 | MR_READY, |
| @@ -332,7 +332,7 @@ static inline void *smbd_get_connection( | |||
| 332 | static inline int smbd_reconnect(struct TCP_Server_Info *server) {return -1; } | 332 | static inline int smbd_reconnect(struct TCP_Server_Info *server) {return -1; } |
| 333 | static inline void smbd_destroy(struct smbd_connection *info) {} | 333 | static inline void smbd_destroy(struct smbd_connection *info) {} |
| 334 | static inline int smbd_recv(struct smbd_connection *info, struct msghdr *msg) {return -1; } | 334 | static inline int smbd_recv(struct smbd_connection *info, struct msghdr *msg) {return -1; } |
| 335 | static inline int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) {return -1; } | 335 | static inline int smbd_send(struct TCP_Server_Info *server, struct smb_rqst *rqst) {return -1; } |
| 336 | #endif | 336 | #endif |
| 337 | 337 | ||
| 338 | #endif | 338 | #endif |
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index fb57dfbfb749..a341ec839c83 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
| @@ -61,6 +61,7 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) | |||
| 61 | 61 | ||
| 62 | temp = mempool_alloc(cifs_mid_poolp, GFP_NOFS); | 62 | temp = mempool_alloc(cifs_mid_poolp, GFP_NOFS); |
| 63 | memset(temp, 0, sizeof(struct mid_q_entry)); | 63 | memset(temp, 0, sizeof(struct mid_q_entry)); |
| 64 | kref_init(&temp->refcount); | ||
| 64 | temp->mid = get_mid(smb_buffer); | 65 | temp->mid = get_mid(smb_buffer); |
| 65 | temp->pid = current->pid; | 66 | temp->pid = current->pid; |
| 66 | temp->command = cpu_to_le16(smb_buffer->Command); | 67 | temp->command = cpu_to_le16(smb_buffer->Command); |
| @@ -82,6 +83,21 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) | |||
| 82 | return temp; | 83 | return temp; |
| 83 | } | 84 | } |
| 84 | 85 | ||
| 86 | static void _cifs_mid_q_entry_release(struct kref *refcount) | ||
| 87 | { | ||
| 88 | struct mid_q_entry *mid = container_of(refcount, struct mid_q_entry, | ||
| 89 | refcount); | ||
| 90 | |||
| 91 | mempool_free(mid, cifs_mid_poolp); | ||
| 92 | } | ||
| 93 | |||
| 94 | void cifs_mid_q_entry_release(struct mid_q_entry *midEntry) | ||
| 95 | { | ||
| 96 | spin_lock(&GlobalMid_Lock); | ||
| 97 | kref_put(&midEntry->refcount, _cifs_mid_q_entry_release); | ||
| 98 | spin_unlock(&GlobalMid_Lock); | ||
| 99 | } | ||
| 100 | |||
| 85 | void | 101 | void |
| 86 | DeleteMidQEntry(struct mid_q_entry *midEntry) | 102 | DeleteMidQEntry(struct mid_q_entry *midEntry) |
| 87 | { | 103 | { |
| @@ -110,7 +126,7 @@ DeleteMidQEntry(struct mid_q_entry *midEntry) | |||
| 110 | } | 126 | } |
| 111 | } | 127 | } |
| 112 | #endif | 128 | #endif |
| 113 | mempool_free(midEntry, cifs_mid_poolp); | 129 | cifs_mid_q_entry_release(midEntry); |
| 114 | } | 130 | } |
| 115 | 131 | ||
| 116 | void | 132 | void |
| @@ -202,14 +218,15 @@ smb_send_kvec(struct TCP_Server_Info *server, struct msghdr *smb_msg, | |||
| 202 | } | 218 | } |
| 203 | 219 | ||
| 204 | unsigned long | 220 | unsigned long |
| 205 | smb2_rqst_len(struct smb_rqst *rqst, bool skip_rfc1002_marker) | 221 | smb_rqst_len(struct TCP_Server_Info *server, struct smb_rqst *rqst) |
| 206 | { | 222 | { |
| 207 | unsigned int i; | 223 | unsigned int i; |
| 208 | struct kvec *iov; | 224 | struct kvec *iov; |
| 209 | int nvec; | 225 | int nvec; |
| 210 | unsigned long buflen = 0; | 226 | unsigned long buflen = 0; |
| 211 | 227 | ||
| 212 | if (skip_rfc1002_marker && rqst->rq_iov[0].iov_len == 4) { | 228 | if (server->vals->header_preamble_size == 0 && |
| 229 | rqst->rq_nvec >= 2 && rqst->rq_iov[0].iov_len == 4) { | ||
| 213 | iov = &rqst->rq_iov[1]; | 230 | iov = &rqst->rq_iov[1]; |
| 214 | nvec = rqst->rq_nvec - 1; | 231 | nvec = rqst->rq_nvec - 1; |
| 215 | } else { | 232 | } else { |
| @@ -260,7 +277,7 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, | |||
| 260 | __be32 rfc1002_marker; | 277 | __be32 rfc1002_marker; |
| 261 | 278 | ||
| 262 | if (cifs_rdma_enabled(server) && server->smbd_conn) { | 279 | if (cifs_rdma_enabled(server) && server->smbd_conn) { |
| 263 | rc = smbd_send(server->smbd_conn, rqst); | 280 | rc = smbd_send(server, rqst); |
| 264 | goto smbd_done; | 281 | goto smbd_done; |
| 265 | } | 282 | } |
| 266 | if (ssocket == NULL) | 283 | if (ssocket == NULL) |
| @@ -271,7 +288,7 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, | |||
| 271 | (char *)&val, sizeof(val)); | 288 | (char *)&val, sizeof(val)); |
| 272 | 289 | ||
| 273 | for (j = 0; j < num_rqst; j++) | 290 | for (j = 0; j < num_rqst; j++) |
| 274 | send_length += smb2_rqst_len(&rqst[j], true); | 291 | send_length += smb_rqst_len(server, &rqst[j]); |
| 275 | rfc1002_marker = cpu_to_be32(send_length); | 292 | rfc1002_marker = cpu_to_be32(send_length); |
| 276 | 293 | ||
| 277 | /* Generate a rfc1002 marker for SMB2+ */ | 294 | /* Generate a rfc1002 marker for SMB2+ */ |
diff --git a/fs/eventfd.c b/fs/eventfd.c index ceb1031f1cac..08d3bd602f73 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c | |||
| @@ -101,20 +101,14 @@ static int eventfd_release(struct inode *inode, struct file *file) | |||
| 101 | return 0; | 101 | return 0; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | static struct wait_queue_head * | 104 | static __poll_t eventfd_poll(struct file *file, poll_table *wait) |
| 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) | ||
| 113 | { | 105 | { |
| 114 | struct eventfd_ctx *ctx = file->private_data; | 106 | struct eventfd_ctx *ctx = file->private_data; |
| 115 | __poll_t events = 0; | 107 | __poll_t events = 0; |
| 116 | u64 count; | 108 | u64 count; |
| 117 | 109 | ||
| 110 | poll_wait(file, &ctx->wqh, wait); | ||
| 111 | |||
| 118 | /* | 112 | /* |
| 119 | * All writes to ctx->count occur within ctx->wqh.lock. This read | 113 | * All writes to ctx->count occur within ctx->wqh.lock. This read |
| 120 | * can be done outside ctx->wqh.lock because we know that poll_wait | 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) | |||
| 156 | count = READ_ONCE(ctx->count); | 150 | count = READ_ONCE(ctx->count); |
| 157 | 151 | ||
| 158 | if (count > 0) | 152 | if (count > 0) |
| 159 | events |= (EPOLLIN & eventmask); | 153 | events |= EPOLLIN; |
| 160 | if (count == ULLONG_MAX) | 154 | if (count == ULLONG_MAX) |
| 161 | events |= EPOLLERR; | 155 | events |= EPOLLERR; |
| 162 | if (ULLONG_MAX - 1 > count) | 156 | if (ULLONG_MAX - 1 > count) |
| 163 | events |= (EPOLLOUT & eventmask); | 157 | events |= EPOLLOUT; |
| 164 | 158 | ||
| 165 | return events; | 159 | return events; |
| 166 | } | 160 | } |
| @@ -311,8 +305,7 @@ static const struct file_operations eventfd_fops = { | |||
| 311 | .show_fdinfo = eventfd_show_fdinfo, | 305 | .show_fdinfo = eventfd_show_fdinfo, |
| 312 | #endif | 306 | #endif |
| 313 | .release = eventfd_release, | 307 | .release = eventfd_release, |
| 314 | .get_poll_head = eventfd_get_poll_head, | 308 | .poll = eventfd_poll, |
| 315 | .poll_mask = eventfd_poll_mask, | ||
| 316 | .read = eventfd_read, | 309 | .read = eventfd_read, |
| 317 | .write = eventfd_write, | 310 | .write = eventfd_write, |
| 318 | .llseek = noop_llseek, | 311 | .llseek = noop_llseek, |
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index ea4436f409fb..67db22fe99c5 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
| @@ -922,18 +922,14 @@ static __poll_t ep_read_events_proc(struct eventpoll *ep, struct list_head *head | |||
| 922 | return 0; | 922 | return 0; |
| 923 | } | 923 | } |
| 924 | 924 | ||
| 925 | static struct wait_queue_head *ep_eventpoll_get_poll_head(struct file *file, | 925 | static __poll_t ep_eventpoll_poll(struct file *file, poll_table *wait) |
| 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) | ||
| 933 | { | 926 | { |
| 934 | struct eventpoll *ep = file->private_data; | 927 | struct eventpoll *ep = file->private_data; |
| 935 | int depth = 0; | 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 | * Proceed to find out if wanted events are really available inside | 934 | * Proceed to find out if wanted events are really available inside |
| 939 | * the ready list. | 935 | * the ready list. |
| @@ -972,8 +968,7 @@ static const struct file_operations eventpoll_fops = { | |||
| 972 | .show_fdinfo = ep_show_fdinfo, | 968 | .show_fdinfo = ep_show_fdinfo, |
| 973 | #endif | 969 | #endif |
| 974 | .release = ep_eventpoll_release, | 970 | .release = ep_eventpoll_release, |
| 975 | .get_poll_head = ep_eventpoll_get_poll_head, | 971 | .poll = ep_eventpoll_poll, |
| 976 | .poll_mask = ep_eventpoll_poll_mask, | ||
| 977 | .llseek = noop_llseek, | 972 | .llseek = noop_llseek, |
| 978 | }; | 973 | }; |
| 979 | 974 | ||
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index b00481c475cb..e68cefe08261 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
| @@ -184,7 +184,6 @@ static int ext4_init_block_bitmap(struct super_block *sb, | |||
| 184 | unsigned int bit, bit_max; | 184 | unsigned int bit, bit_max; |
| 185 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 185 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
| 186 | ext4_fsblk_t start, tmp; | 186 | ext4_fsblk_t start, tmp; |
| 187 | int flex_bg = 0; | ||
| 188 | 187 | ||
| 189 | J_ASSERT_BH(bh, buffer_locked(bh)); | 188 | J_ASSERT_BH(bh, buffer_locked(bh)); |
| 190 | 189 | ||
| @@ -207,22 +206,19 @@ static int ext4_init_block_bitmap(struct super_block *sb, | |||
| 207 | 206 | ||
| 208 | start = ext4_group_first_block_no(sb, block_group); | 207 | start = ext4_group_first_block_no(sb, block_group); |
| 209 | 208 | ||
| 210 | if (ext4_has_feature_flex_bg(sb)) | ||
| 211 | flex_bg = 1; | ||
| 212 | |||
| 213 | /* Set bits for block and inode bitmaps, and inode table */ | 209 | /* Set bits for block and inode bitmaps, and inode table */ |
| 214 | tmp = ext4_block_bitmap(sb, gdp); | 210 | tmp = ext4_block_bitmap(sb, gdp); |
| 215 | if (!flex_bg || ext4_block_in_group(sb, tmp, block_group)) | 211 | if (ext4_block_in_group(sb, tmp, block_group)) |
| 216 | ext4_set_bit(EXT4_B2C(sbi, tmp - start), bh->b_data); | 212 | ext4_set_bit(EXT4_B2C(sbi, tmp - start), bh->b_data); |
| 217 | 213 | ||
| 218 | tmp = ext4_inode_bitmap(sb, gdp); | 214 | tmp = ext4_inode_bitmap(sb, gdp); |
| 219 | if (!flex_bg || ext4_block_in_group(sb, tmp, block_group)) | 215 | if (ext4_block_in_group(sb, tmp, block_group)) |
| 220 | ext4_set_bit(EXT4_B2C(sbi, tmp - start), bh->b_data); | 216 | ext4_set_bit(EXT4_B2C(sbi, tmp - start), bh->b_data); |
| 221 | 217 | ||
| 222 | tmp = ext4_inode_table(sb, gdp); | 218 | tmp = ext4_inode_table(sb, gdp); |
| 223 | for (; tmp < ext4_inode_table(sb, gdp) + | 219 | for (; tmp < ext4_inode_table(sb, gdp) + |
| 224 | sbi->s_itb_per_group; tmp++) { | 220 | sbi->s_itb_per_group; tmp++) { |
| 225 | if (!flex_bg || ext4_block_in_group(sb, tmp, block_group)) | 221 | if (ext4_block_in_group(sb, tmp, block_group)) |
| 226 | ext4_set_bit(EXT4_B2C(sbi, tmp - start), bh->b_data); | 222 | ext4_set_bit(EXT4_B2C(sbi, tmp - start), bh->b_data); |
| 227 | } | 223 | } |
| 228 | 224 | ||
| @@ -442,7 +438,16 @@ ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group) | |||
| 442 | goto verify; | 438 | goto verify; |
| 443 | } | 439 | } |
| 444 | ext4_lock_group(sb, block_group); | 440 | ext4_lock_group(sb, block_group); |
| 445 | if (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { | 441 | if (ext4_has_group_desc_csum(sb) && |
| 442 | (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT))) { | ||
| 443 | if (block_group == 0) { | ||
| 444 | ext4_unlock_group(sb, block_group); | ||
| 445 | unlock_buffer(bh); | ||
| 446 | ext4_error(sb, "Block bitmap for bg 0 marked " | ||
| 447 | "uninitialized"); | ||
| 448 | err = -EFSCORRUPTED; | ||
| 449 | goto out; | ||
| 450 | } | ||
| 446 | err = ext4_init_block_bitmap(sb, bh, block_group, desc); | 451 | err = ext4_init_block_bitmap(sb, bh, block_group, desc); |
| 447 | set_bitmap_uptodate(bh); | 452 | set_bitmap_uptodate(bh); |
| 448 | set_buffer_uptodate(bh); | 453 | set_buffer_uptodate(bh); |
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 0b127853c584..7c7123f265c2 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
| @@ -1114,6 +1114,7 @@ struct ext4_inode_info { | |||
| 1114 | #define EXT4_MOUNT_DIOREAD_NOLOCK 0x400000 /* Enable support for dio read nolocking */ | 1114 | #define EXT4_MOUNT_DIOREAD_NOLOCK 0x400000 /* Enable support for dio read nolocking */ |
| 1115 | #define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */ | 1115 | #define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */ |
| 1116 | #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */ | 1116 | #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */ |
| 1117 | #define EXT4_MOUNT_WARN_ON_ERROR 0x2000000 /* Trigger WARN_ON on error */ | ||
| 1117 | #define EXT4_MOUNT_DELALLOC 0x8000000 /* Delalloc support */ | 1118 | #define EXT4_MOUNT_DELALLOC 0x8000000 /* Delalloc support */ |
| 1118 | #define EXT4_MOUNT_DATA_ERR_ABORT 0x10000000 /* Abort on file data write */ | 1119 | #define EXT4_MOUNT_DATA_ERR_ABORT 0x10000000 /* Abort on file data write */ |
| 1119 | #define EXT4_MOUNT_BLOCK_VALIDITY 0x20000000 /* Block validity checking */ | 1120 | #define EXT4_MOUNT_BLOCK_VALIDITY 0x20000000 /* Block validity checking */ |
| @@ -1507,11 +1508,6 @@ static inline struct ext4_inode_info *EXT4_I(struct inode *inode) | |||
| 1507 | static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) | 1508 | static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) |
| 1508 | { | 1509 | { |
| 1509 | return ino == EXT4_ROOT_INO || | 1510 | return ino == EXT4_ROOT_INO || |
| 1510 | ino == EXT4_USR_QUOTA_INO || | ||
| 1511 | ino == EXT4_GRP_QUOTA_INO || | ||
| 1512 | ino == EXT4_BOOT_LOADER_INO || | ||
| 1513 | ino == EXT4_JOURNAL_INO || | ||
| 1514 | ino == EXT4_RESIZE_INO || | ||
| 1515 | (ino >= EXT4_FIRST_INO(sb) && | 1511 | (ino >= EXT4_FIRST_INO(sb) && |
| 1516 | ino <= le32_to_cpu(EXT4_SB(sb)->s_es->s_inodes_count)); | 1512 | ino <= le32_to_cpu(EXT4_SB(sb)->s_es->s_inodes_count)); |
| 1517 | } | 1513 | } |
| @@ -3018,9 +3014,6 @@ extern int ext4_inline_data_fiemap(struct inode *inode, | |||
| 3018 | struct iomap; | 3014 | struct iomap; |
| 3019 | extern int ext4_inline_data_iomap(struct inode *inode, struct iomap *iomap); | 3015 | extern int ext4_inline_data_iomap(struct inode *inode, struct iomap *iomap); |
| 3020 | 3016 | ||
| 3021 | extern int ext4_try_to_evict_inline_data(handle_t *handle, | ||
| 3022 | struct inode *inode, | ||
| 3023 | int needed); | ||
| 3024 | extern int ext4_inline_data_truncate(struct inode *inode, int *has_inline); | 3017 | extern int ext4_inline_data_truncate(struct inode *inode, int *has_inline); |
| 3025 | 3018 | ||
| 3026 | extern int ext4_convert_inline_data(struct inode *inode); | 3019 | extern int ext4_convert_inline_data(struct inode *inode); |
diff --git a/fs/ext4/ext4_extents.h b/fs/ext4/ext4_extents.h index 98fb0c119c68..adf6668b596f 100644 --- a/fs/ext4/ext4_extents.h +++ b/fs/ext4/ext4_extents.h | |||
| @@ -91,6 +91,7 @@ struct ext4_extent_header { | |||
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| 93 | #define EXT4_EXT_MAGIC cpu_to_le16(0xf30a) | 93 | #define EXT4_EXT_MAGIC cpu_to_le16(0xf30a) |
| 94 | #define EXT4_MAX_EXTENT_DEPTH 5 | ||
| 94 | 95 | ||
| 95 | #define EXT4_EXTENT_TAIL_OFFSET(hdr) \ | 96 | #define EXT4_EXTENT_TAIL_OFFSET(hdr) \ |
| 96 | (sizeof(struct ext4_extent_header) + \ | 97 | (sizeof(struct ext4_extent_header) + \ |
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 0057fe3f248d..8ce6fd5b10dd 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
| @@ -869,6 +869,12 @@ ext4_find_extent(struct inode *inode, ext4_lblk_t block, | |||
| 869 | 869 | ||
| 870 | eh = ext_inode_hdr(inode); | 870 | eh = ext_inode_hdr(inode); |
| 871 | depth = ext_depth(inode); | 871 | depth = ext_depth(inode); |
| 872 | if (depth < 0 || depth > EXT4_MAX_EXTENT_DEPTH) { | ||
| 873 | EXT4_ERROR_INODE(inode, "inode has invalid extent depth: %d", | ||
| 874 | depth); | ||
| 875 | ret = -EFSCORRUPTED; | ||
| 876 | goto err; | ||
| 877 | } | ||
| 872 | 878 | ||
| 873 | if (path) { | 879 | if (path) { |
| 874 | ext4_ext_drop_refs(path); | 880 | ext4_ext_drop_refs(path); |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index f525f909b559..fb83750c1a14 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
| @@ -150,7 +150,16 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) | |||
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | ext4_lock_group(sb, block_group); | 152 | ext4_lock_group(sb, block_group); |
| 153 | if (desc->bg_flags & cpu_to_le16(EXT4_BG_INODE_UNINIT)) { | 153 | if (ext4_has_group_desc_csum(sb) && |
| 154 | (desc->bg_flags & cpu_to_le16(EXT4_BG_INODE_UNINIT))) { | ||
| 155 | if (block_group == 0) { | ||
| 156 | ext4_unlock_group(sb, block_group); | ||
| 157 | unlock_buffer(bh); | ||
| 158 | ext4_error(sb, "Inode bitmap for bg 0 marked " | ||
| 159 | "uninitialized"); | ||
| 160 | err = -EFSCORRUPTED; | ||
| 161 | goto out; | ||
| 162 | } | ||
| 154 | memset(bh->b_data, 0, (EXT4_INODES_PER_GROUP(sb) + 7) / 8); | 163 | memset(bh->b_data, 0, (EXT4_INODES_PER_GROUP(sb) + 7) / 8); |
| 155 | ext4_mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), | 164 | ext4_mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), |
| 156 | sb->s_blocksize * 8, bh->b_data); | 165 | sb->s_blocksize * 8, bh->b_data); |
| @@ -994,7 +1003,8 @@ got: | |||
| 994 | 1003 | ||
| 995 | /* recheck and clear flag under lock if we still need to */ | 1004 | /* recheck and clear flag under lock if we still need to */ |
| 996 | ext4_lock_group(sb, group); | 1005 | ext4_lock_group(sb, group); |
| 997 | if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { | 1006 | if (ext4_has_group_desc_csum(sb) && |
| 1007 | (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT))) { | ||
| 998 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); | 1008 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); |
| 999 | ext4_free_group_clusters_set(sb, gdp, | 1009 | ext4_free_group_clusters_set(sb, gdp, |
| 1000 | ext4_free_clusters_after_init(sb, group, gdp)); | 1010 | ext4_free_clusters_after_init(sb, group, gdp)); |
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 285ed1588730..e55a8bc870bd 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c | |||
| @@ -437,6 +437,7 @@ static int ext4_destroy_inline_data_nolock(handle_t *handle, | |||
| 437 | 437 | ||
| 438 | memset((void *)ext4_raw_inode(&is.iloc)->i_block, | 438 | memset((void *)ext4_raw_inode(&is.iloc)->i_block, |
| 439 | 0, EXT4_MIN_INLINE_DATA_SIZE); | 439 | 0, EXT4_MIN_INLINE_DATA_SIZE); |
| 440 | memset(ei->i_data, 0, EXT4_MIN_INLINE_DATA_SIZE); | ||
| 440 | 441 | ||
| 441 | if (ext4_has_feature_extents(inode->i_sb)) { | 442 | if (ext4_has_feature_extents(inode->i_sb)) { |
| 442 | if (S_ISDIR(inode->i_mode) || | 443 | if (S_ISDIR(inode->i_mode) || |
| @@ -886,11 +887,11 @@ retry_journal: | |||
| 886 | flags |= AOP_FLAG_NOFS; | 887 | flags |= AOP_FLAG_NOFS; |
| 887 | 888 | ||
| 888 | if (ret == -ENOSPC) { | 889 | if (ret == -ENOSPC) { |
| 890 | ext4_journal_stop(handle); | ||
| 889 | ret = ext4_da_convert_inline_data_to_extent(mapping, | 891 | ret = ext4_da_convert_inline_data_to_extent(mapping, |
| 890 | inode, | 892 | inode, |
| 891 | flags, | 893 | flags, |
| 892 | fsdata); | 894 | fsdata); |
| 893 | ext4_journal_stop(handle); | ||
| 894 | if (ret == -ENOSPC && | 895 | if (ret == -ENOSPC && |
| 895 | ext4_should_retry_alloc(inode->i_sb, &retries)) | 896 | ext4_should_retry_alloc(inode->i_sb, &retries)) |
| 896 | goto retry_journal; | 897 | goto retry_journal; |
| @@ -1890,42 +1891,6 @@ out: | |||
| 1890 | return (error < 0 ? error : 0); | 1891 | return (error < 0 ? error : 0); |
| 1891 | } | 1892 | } |
| 1892 | 1893 | ||
| 1893 | /* | ||
| 1894 | * Called during xattr set, and if we can sparse space 'needed', | ||
| 1895 | * just create the extent tree evict the data to the outer block. | ||
| 1896 | * | ||
| 1897 | * We use jbd2 instead of page cache to move data to the 1st block | ||
| 1898 | * so that the whole transaction can be committed as a whole and | ||
| 1899 | * the data isn't lost because of the delayed page cache write. | ||
| 1900 | */ | ||
| 1901 | int ext4_try_to_evict_inline_data(handle_t *handle, | ||
| 1902 | struct inode *inode, | ||
| 1903 | int needed) | ||
| 1904 | { | ||
| 1905 | int error; | ||
| 1906 | struct ext4_xattr_entry *entry; | ||
| 1907 | struct ext4_inode *raw_inode; | ||
| 1908 | struct ext4_iloc iloc; | ||
| 1909 | |||
| 1910 | error = ext4_get_inode_loc(inode, &iloc); | ||
| 1911 | if (error) | ||
| 1912 | return error; | ||
| 1913 | |||
| 1914 | raw_inode = ext4_raw_inode(&iloc); | ||
| 1915 | entry = (struct ext4_xattr_entry *)((void *)raw_inode + | ||
| 1916 | EXT4_I(inode)->i_inline_off); | ||
| 1917 | if (EXT4_XATTR_LEN(entry->e_name_len) + | ||
| 1918 | EXT4_XATTR_SIZE(le32_to_cpu(entry->e_value_size)) < needed) { | ||
| 1919 | error = -ENOSPC; | ||
| 1920 | goto out; | ||
| 1921 | } | ||
| 1922 | |||
| 1923 | error = ext4_convert_inline_data_nolock(handle, inode, &iloc); | ||
| 1924 | out: | ||
| 1925 | brelse(iloc.bh); | ||
| 1926 | return error; | ||
| 1927 | } | ||
| 1928 | |||
| 1929 | int ext4_inline_data_truncate(struct inode *inode, int *has_inline) | 1894 | int ext4_inline_data_truncate(struct inode *inode, int *has_inline) |
| 1930 | { | 1895 | { |
| 1931 | handle_t *handle; | 1896 | handle_t *handle; |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 2ea07efbe016..7d6c10017bdf 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
| @@ -402,9 +402,9 @@ static int __check_block_validity(struct inode *inode, const char *func, | |||
| 402 | if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), map->m_pblk, | 402 | if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), map->m_pblk, |
| 403 | map->m_len)) { | 403 | map->m_len)) { |
| 404 | ext4_error_inode(inode, func, line, map->m_pblk, | 404 | ext4_error_inode(inode, func, line, map->m_pblk, |
| 405 | "lblock %lu mapped to illegal pblock " | 405 | "lblock %lu mapped to illegal pblock %llu " |
| 406 | "(length %d)", (unsigned long) map->m_lblk, | 406 | "(length %d)", (unsigned long) map->m_lblk, |
| 407 | map->m_len); | 407 | map->m_pblk, map->m_len); |
| 408 | return -EFSCORRUPTED; | 408 | return -EFSCORRUPTED; |
| 409 | } | 409 | } |
| 410 | return 0; | 410 | return 0; |
| @@ -4506,7 +4506,8 @@ static int __ext4_get_inode_loc(struct inode *inode, | |||
| 4506 | int inodes_per_block, inode_offset; | 4506 | int inodes_per_block, inode_offset; |
| 4507 | 4507 | ||
| 4508 | iloc->bh = NULL; | 4508 | iloc->bh = NULL; |
| 4509 | if (!ext4_valid_inum(sb, inode->i_ino)) | 4509 | if (inode->i_ino < EXT4_ROOT_INO || |
| 4510 | inode->i_ino > le32_to_cpu(EXT4_SB(sb)->s_es->s_inodes_count)) | ||
| 4510 | return -EFSCORRUPTED; | 4511 | return -EFSCORRUPTED; |
| 4511 | 4512 | ||
| 4512 | iloc->block_group = (inode->i_ino - 1) / EXT4_INODES_PER_GROUP(sb); | 4513 | iloc->block_group = (inode->i_ino - 1) / EXT4_INODES_PER_GROUP(sb); |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 6eae2b91aafa..f7ab34088162 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
| @@ -2423,7 +2423,8 @@ int ext4_mb_add_groupinfo(struct super_block *sb, ext4_group_t group, | |||
| 2423 | * initialize bb_free to be able to skip | 2423 | * initialize bb_free to be able to skip |
| 2424 | * empty groups without initialization | 2424 | * empty groups without initialization |
| 2425 | */ | 2425 | */ |
| 2426 | if (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { | 2426 | if (ext4_has_group_desc_csum(sb) && |
| 2427 | (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT))) { | ||
| 2427 | meta_group_info[i]->bb_free = | 2428 | meta_group_info[i]->bb_free = |
| 2428 | ext4_free_clusters_after_init(sb, group, desc); | 2429 | ext4_free_clusters_after_init(sb, group, desc); |
| 2429 | } else { | 2430 | } else { |
| @@ -2989,7 +2990,8 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, | |||
| 2989 | #endif | 2990 | #endif |
| 2990 | ext4_set_bits(bitmap_bh->b_data, ac->ac_b_ex.fe_start, | 2991 | ext4_set_bits(bitmap_bh->b_data, ac->ac_b_ex.fe_start, |
| 2991 | ac->ac_b_ex.fe_len); | 2992 | ac->ac_b_ex.fe_len); |
| 2992 | if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { | 2993 | if (ext4_has_group_desc_csum(sb) && |
| 2994 | (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT))) { | ||
| 2993 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); | 2995 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); |
| 2994 | ext4_free_group_clusters_set(sb, gdp, | 2996 | ext4_free_group_clusters_set(sb, gdp, |
| 2995 | ext4_free_clusters_after_init(sb, | 2997 | ext4_free_clusters_after_init(sb, |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 0c4c2201b3aa..ba2396a7bd04 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -405,6 +405,9 @@ static void ext4_journal_commit_callback(journal_t *journal, transaction_t *txn) | |||
| 405 | 405 | ||
| 406 | static void ext4_handle_error(struct super_block *sb) | 406 | static void ext4_handle_error(struct super_block *sb) |
| 407 | { | 407 | { |
| 408 | if (test_opt(sb, WARN_ON_ERROR)) | ||
| 409 | WARN_ON_ONCE(1); | ||
| 410 | |||
| 408 | if (sb_rdonly(sb)) | 411 | if (sb_rdonly(sb)) |
| 409 | return; | 412 | return; |
| 410 | 413 | ||
| @@ -740,6 +743,9 @@ __acquires(bitlock) | |||
| 740 | va_end(args); | 743 | va_end(args); |
| 741 | } | 744 | } |
| 742 | 745 | ||
| 746 | if (test_opt(sb, WARN_ON_ERROR)) | ||
| 747 | WARN_ON_ONCE(1); | ||
| 748 | |||
| 743 | if (test_opt(sb, ERRORS_CONT)) { | 749 | if (test_opt(sb, ERRORS_CONT)) { |
| 744 | ext4_commit_super(sb, 0); | 750 | ext4_commit_super(sb, 0); |
| 745 | return; | 751 | return; |
| @@ -1371,7 +1377,8 @@ enum { | |||
| 1371 | Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_jqfmt_vfsv1, Opt_quota, | 1377 | Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_jqfmt_vfsv1, Opt_quota, |
| 1372 | Opt_noquota, Opt_barrier, Opt_nobarrier, Opt_err, | 1378 | Opt_noquota, Opt_barrier, Opt_nobarrier, Opt_err, |
| 1373 | Opt_usrquota, Opt_grpquota, Opt_prjquota, Opt_i_version, Opt_dax, | 1379 | Opt_usrquota, Opt_grpquota, Opt_prjquota, Opt_i_version, Opt_dax, |
| 1374 | Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_mblk_io_submit, | 1380 | Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_warn_on_error, |
| 1381 | Opt_nowarn_on_error, Opt_mblk_io_submit, | ||
| 1375 | Opt_lazytime, Opt_nolazytime, Opt_debug_want_extra_isize, | 1382 | Opt_lazytime, Opt_nolazytime, Opt_debug_want_extra_isize, |
| 1376 | Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity, | 1383 | Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity, |
| 1377 | Opt_inode_readahead_blks, Opt_journal_ioprio, | 1384 | Opt_inode_readahead_blks, Opt_journal_ioprio, |
| @@ -1438,6 +1445,8 @@ static const match_table_t tokens = { | |||
| 1438 | {Opt_dax, "dax"}, | 1445 | {Opt_dax, "dax"}, |
| 1439 | {Opt_stripe, "stripe=%u"}, | 1446 | {Opt_stripe, "stripe=%u"}, |
| 1440 | {Opt_delalloc, "delalloc"}, | 1447 | {Opt_delalloc, "delalloc"}, |
| 1448 | {Opt_warn_on_error, "warn_on_error"}, | ||
| 1449 | {Opt_nowarn_on_error, "nowarn_on_error"}, | ||
| 1441 | {Opt_lazytime, "lazytime"}, | 1450 | {Opt_lazytime, "lazytime"}, |
| 1442 | {Opt_nolazytime, "nolazytime"}, | 1451 | {Opt_nolazytime, "nolazytime"}, |
| 1443 | {Opt_debug_want_extra_isize, "debug_want_extra_isize=%u"}, | 1452 | {Opt_debug_want_extra_isize, "debug_want_extra_isize=%u"}, |
| @@ -1602,6 +1611,8 @@ static const struct mount_opts { | |||
| 1602 | MOPT_EXT4_ONLY | MOPT_SET | MOPT_EXPLICIT}, | 1611 | MOPT_EXT4_ONLY | MOPT_SET | MOPT_EXPLICIT}, |
| 1603 | {Opt_nodelalloc, EXT4_MOUNT_DELALLOC, | 1612 | {Opt_nodelalloc, EXT4_MOUNT_DELALLOC, |
| 1604 | MOPT_EXT4_ONLY | MOPT_CLEAR}, | 1613 | MOPT_EXT4_ONLY | MOPT_CLEAR}, |
| 1614 | {Opt_warn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_SET}, | ||
| 1615 | {Opt_nowarn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_CLEAR}, | ||
| 1605 | {Opt_nojournal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM, | 1616 | {Opt_nojournal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM, |
| 1606 | MOPT_EXT4_ONLY | MOPT_CLEAR}, | 1617 | MOPT_EXT4_ONLY | MOPT_CLEAR}, |
| 1607 | {Opt_journal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM, | 1618 | {Opt_journal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM, |
| @@ -2331,6 +2342,7 @@ static int ext4_check_descriptors(struct super_block *sb, | |||
| 2331 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 2342 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
| 2332 | ext4_fsblk_t first_block = le32_to_cpu(sbi->s_es->s_first_data_block); | 2343 | ext4_fsblk_t first_block = le32_to_cpu(sbi->s_es->s_first_data_block); |
| 2333 | ext4_fsblk_t last_block; | 2344 | ext4_fsblk_t last_block; |
| 2345 | ext4_fsblk_t last_bg_block = sb_block + ext4_bg_num_gdb(sb, 0) + 1; | ||
| 2334 | ext4_fsblk_t block_bitmap; | 2346 | ext4_fsblk_t block_bitmap; |
| 2335 | ext4_fsblk_t inode_bitmap; | 2347 | ext4_fsblk_t inode_bitmap; |
| 2336 | ext4_fsblk_t inode_table; | 2348 | ext4_fsblk_t inode_table; |
| @@ -2363,6 +2375,14 @@ static int ext4_check_descriptors(struct super_block *sb, | |||
| 2363 | if (!sb_rdonly(sb)) | 2375 | if (!sb_rdonly(sb)) |
| 2364 | return 0; | 2376 | return 0; |
| 2365 | } | 2377 | } |
| 2378 | if (block_bitmap >= sb_block + 1 && | ||
| 2379 | block_bitmap <= last_bg_block) { | ||
| 2380 | ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " | ||
| 2381 | "Block bitmap for group %u overlaps " | ||
| 2382 | "block group descriptors", i); | ||
| 2383 | if (!sb_rdonly(sb)) | ||
| 2384 | return 0; | ||
| 2385 | } | ||
| 2366 | if (block_bitmap < first_block || block_bitmap > last_block) { | 2386 | if (block_bitmap < first_block || block_bitmap > last_block) { |
| 2367 | ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " | 2387 | ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " |
| 2368 | "Block bitmap for group %u not in group " | 2388 | "Block bitmap for group %u not in group " |
| @@ -2377,6 +2397,14 @@ static int ext4_check_descriptors(struct super_block *sb, | |||
| 2377 | if (!sb_rdonly(sb)) | 2397 | if (!sb_rdonly(sb)) |
| 2378 | return 0; | 2398 | return 0; |
| 2379 | } | 2399 | } |
| 2400 | if (inode_bitmap >= sb_block + 1 && | ||
| 2401 | inode_bitmap <= last_bg_block) { | ||
| 2402 | ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " | ||
| 2403 | "Inode bitmap for group %u overlaps " | ||
| 2404 | "block group descriptors", i); | ||
| 2405 | if (!sb_rdonly(sb)) | ||
| 2406 | return 0; | ||
| 2407 | } | ||
| 2380 | if (inode_bitmap < first_block || inode_bitmap > last_block) { | 2408 | if (inode_bitmap < first_block || inode_bitmap > last_block) { |
| 2381 | ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " | 2409 | ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " |
| 2382 | "Inode bitmap for group %u not in group " | 2410 | "Inode bitmap for group %u not in group " |
| @@ -2391,6 +2419,14 @@ static int ext4_check_descriptors(struct super_block *sb, | |||
| 2391 | if (!sb_rdonly(sb)) | 2419 | if (!sb_rdonly(sb)) |
| 2392 | return 0; | 2420 | return 0; |
| 2393 | } | 2421 | } |
| 2422 | if (inode_table >= sb_block + 1 && | ||
| 2423 | inode_table <= last_bg_block) { | ||
| 2424 | ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " | ||
| 2425 | "Inode table for group %u overlaps " | ||
| 2426 | "block group descriptors", i); | ||
| 2427 | if (!sb_rdonly(sb)) | ||
| 2428 | return 0; | ||
| 2429 | } | ||
| 2394 | if (inode_table < first_block || | 2430 | if (inode_table < first_block || |
| 2395 | inode_table + sbi->s_itb_per_group - 1 > last_block) { | 2431 | inode_table + sbi->s_itb_per_group - 1 > last_block) { |
| 2396 | ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " | 2432 | ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " |
| @@ -3097,13 +3133,22 @@ static ext4_group_t ext4_has_uninit_itable(struct super_block *sb) | |||
| 3097 | ext4_group_t group, ngroups = EXT4_SB(sb)->s_groups_count; | 3133 | ext4_group_t group, ngroups = EXT4_SB(sb)->s_groups_count; |
| 3098 | struct ext4_group_desc *gdp = NULL; | 3134 | struct ext4_group_desc *gdp = NULL; |
| 3099 | 3135 | ||
| 3136 | if (!ext4_has_group_desc_csum(sb)) | ||
| 3137 | return ngroups; | ||
| 3138 | |||
| 3100 | for (group = 0; group < ngroups; group++) { | 3139 | for (group = 0; group < ngroups; group++) { |
| 3101 | gdp = ext4_get_group_desc(sb, group, NULL); | 3140 | gdp = ext4_get_group_desc(sb, group, NULL); |
| 3102 | if (!gdp) | 3141 | if (!gdp) |
| 3103 | continue; | 3142 | continue; |
| 3104 | 3143 | ||
| 3105 | if (!(gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_ZEROED))) | 3144 | if (gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_ZEROED)) |
| 3145 | continue; | ||
| 3146 | if (group != 0) | ||
| 3106 | break; | 3147 | break; |
| 3148 | ext4_error(sb, "Inode table for bg 0 marked as " | ||
| 3149 | "needing zeroing"); | ||
| 3150 | if (sb_rdonly(sb)) | ||
| 3151 | return ngroups; | ||
| 3107 | } | 3152 | } |
| 3108 | 3153 | ||
| 3109 | return group; | 3154 | return group; |
| @@ -3742,6 +3787,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3742 | le32_to_cpu(es->s_log_block_size)); | 3787 | le32_to_cpu(es->s_log_block_size)); |
| 3743 | goto failed_mount; | 3788 | goto failed_mount; |
| 3744 | } | 3789 | } |
| 3790 | if (le32_to_cpu(es->s_log_cluster_size) > | ||
| 3791 | (EXT4_MAX_CLUSTER_LOG_SIZE - EXT4_MIN_BLOCK_LOG_SIZE)) { | ||
| 3792 | ext4_msg(sb, KERN_ERR, | ||
| 3793 | "Invalid log cluster size: %u", | ||
| 3794 | le32_to_cpu(es->s_log_cluster_size)); | ||
| 3795 | goto failed_mount; | ||
| 3796 | } | ||
| 3745 | 3797 | ||
| 3746 | if (le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) > (blocksize / 4)) { | 3798 | if (le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) > (blocksize / 4)) { |
| 3747 | ext4_msg(sb, KERN_ERR, | 3799 | ext4_msg(sb, KERN_ERR, |
| @@ -3806,6 +3858,11 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3806 | } else { | 3858 | } else { |
| 3807 | sbi->s_inode_size = le16_to_cpu(es->s_inode_size); | 3859 | sbi->s_inode_size = le16_to_cpu(es->s_inode_size); |
| 3808 | sbi->s_first_ino = le32_to_cpu(es->s_first_ino); | 3860 | sbi->s_first_ino = le32_to_cpu(es->s_first_ino); |
| 3861 | if (sbi->s_first_ino < EXT4_GOOD_OLD_FIRST_INO) { | ||
| 3862 | ext4_msg(sb, KERN_ERR, "invalid first ino: %u", | ||
| 3863 | sbi->s_first_ino); | ||
| 3864 | goto failed_mount; | ||
| 3865 | } | ||
| 3809 | if ((sbi->s_inode_size < EXT4_GOOD_OLD_INODE_SIZE) || | 3866 | if ((sbi->s_inode_size < EXT4_GOOD_OLD_INODE_SIZE) || |
| 3810 | (!is_power_of_2(sbi->s_inode_size)) || | 3867 | (!is_power_of_2(sbi->s_inode_size)) || |
| 3811 | (sbi->s_inode_size > blocksize)) { | 3868 | (sbi->s_inode_size > blocksize)) { |
| @@ -3882,13 +3939,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3882 | "block size (%d)", clustersize, blocksize); | 3939 | "block size (%d)", clustersize, blocksize); |
| 3883 | goto failed_mount; | 3940 | goto failed_mount; |
| 3884 | } | 3941 | } |
| 3885 | if (le32_to_cpu(es->s_log_cluster_size) > | ||
| 3886 | (EXT4_MAX_CLUSTER_LOG_SIZE - EXT4_MIN_BLOCK_LOG_SIZE)) { | ||
| 3887 | ext4_msg(sb, KERN_ERR, | ||
| 3888 | "Invalid log cluster size: %u", | ||
| 3889 | le32_to_cpu(es->s_log_cluster_size)); | ||
| 3890 | goto failed_mount; | ||
| 3891 | } | ||
| 3892 | sbi->s_cluster_bits = le32_to_cpu(es->s_log_cluster_size) - | 3942 | sbi->s_cluster_bits = le32_to_cpu(es->s_log_cluster_size) - |
| 3893 | le32_to_cpu(es->s_log_block_size); | 3943 | le32_to_cpu(es->s_log_block_size); |
| 3894 | sbi->s_clusters_per_group = | 3944 | sbi->s_clusters_per_group = |
| @@ -3909,10 +3959,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3909 | } | 3959 | } |
| 3910 | } else { | 3960 | } else { |
| 3911 | if (clustersize != blocksize) { | 3961 | if (clustersize != blocksize) { |
| 3912 | ext4_warning(sb, "fragment/cluster size (%d) != " | 3962 | ext4_msg(sb, KERN_ERR, |
| 3913 | "block size (%d)", clustersize, | 3963 | "fragment/cluster size (%d) != " |
| 3914 | blocksize); | 3964 | "block size (%d)", clustersize, blocksize); |
| 3915 | clustersize = blocksize; | 3965 | goto failed_mount; |
| 3916 | } | 3966 | } |
| 3917 | if (sbi->s_blocks_per_group > blocksize * 8) { | 3967 | if (sbi->s_blocks_per_group > blocksize * 8) { |
| 3918 | ext4_msg(sb, KERN_ERR, | 3968 | ext4_msg(sb, KERN_ERR, |
| @@ -3966,6 +4016,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3966 | ext4_blocks_count(es)); | 4016 | ext4_blocks_count(es)); |
| 3967 | goto failed_mount; | 4017 | goto failed_mount; |
| 3968 | } | 4018 | } |
| 4019 | if ((es->s_first_data_block == 0) && (es->s_log_block_size == 0) && | ||
| 4020 | (sbi->s_cluster_ratio == 1)) { | ||
| 4021 | ext4_msg(sb, KERN_WARNING, "bad geometry: first data " | ||
| 4022 | "block is 0 with a 1k block and cluster size"); | ||
| 4023 | goto failed_mount; | ||
| 4024 | } | ||
| 4025 | |||
| 3969 | blocks_count = (ext4_blocks_count(es) - | 4026 | blocks_count = (ext4_blocks_count(es) - |
| 3970 | le32_to_cpu(es->s_first_data_block) + | 4027 | le32_to_cpu(es->s_first_data_block) + |
| 3971 | EXT4_BLOCKS_PER_GROUP(sb) - 1); | 4028 | EXT4_BLOCKS_PER_GROUP(sb) - 1); |
| @@ -4001,6 +4058,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 4001 | ret = -ENOMEM; | 4058 | ret = -ENOMEM; |
| 4002 | goto failed_mount; | 4059 | goto failed_mount; |
| 4003 | } | 4060 | } |
| 4061 | if (((u64)sbi->s_groups_count * sbi->s_inodes_per_group) != | ||
| 4062 | le32_to_cpu(es->s_inodes_count)) { | ||
| 4063 | ext4_msg(sb, KERN_ERR, "inodes count not valid: %u vs %llu", | ||
| 4064 | le32_to_cpu(es->s_inodes_count), | ||
| 4065 | ((u64)sbi->s_groups_count * sbi->s_inodes_per_group)); | ||
| 4066 | ret = -EINVAL; | ||
| 4067 | goto failed_mount; | ||
| 4068 | } | ||
| 4004 | 4069 | ||
| 4005 | bgl_lock_init(sbi->s_blockgroup_lock); | 4070 | bgl_lock_init(sbi->s_blockgroup_lock); |
| 4006 | 4071 | ||
| @@ -4736,6 +4801,14 @@ static int ext4_commit_super(struct super_block *sb, int sync) | |||
| 4736 | 4801 | ||
| 4737 | if (!sbh || block_device_ejected(sb)) | 4802 | if (!sbh || block_device_ejected(sb)) |
| 4738 | return error; | 4803 | return error; |
| 4804 | |||
| 4805 | /* | ||
| 4806 | * The superblock bh should be mapped, but it might not be if the | ||
| 4807 | * device was hot-removed. Not much we can do but fail the I/O. | ||
| 4808 | */ | ||
| 4809 | if (!buffer_mapped(sbh)) | ||
| 4810 | return error; | ||
| 4811 | |||
| 4739 | /* | 4812 | /* |
| 4740 | * If the file system is mounted read-only, don't update the | 4813 | * If the file system is mounted read-only, don't update the |
| 4741 | * superblock write time. This avoids updating the superblock | 4814 | * superblock write time. This avoids updating the superblock |
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index fc4ced59c565..723df14f4084 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
| @@ -230,12 +230,12 @@ __ext4_xattr_check_block(struct inode *inode, struct buffer_head *bh, | |||
| 230 | { | 230 | { |
| 231 | int error = -EFSCORRUPTED; | 231 | int error = -EFSCORRUPTED; |
| 232 | 232 | ||
| 233 | if (buffer_verified(bh)) | ||
| 234 | return 0; | ||
| 235 | |||
| 236 | if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) || | 233 | if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) || |
| 237 | BHDR(bh)->h_blocks != cpu_to_le32(1)) | 234 | BHDR(bh)->h_blocks != cpu_to_le32(1)) |
| 238 | goto errout; | 235 | goto errout; |
| 236 | if (buffer_verified(bh)) | ||
| 237 | return 0; | ||
| 238 | |||
| 239 | error = -EFSBADCRC; | 239 | error = -EFSBADCRC; |
| 240 | if (!ext4_xattr_block_csum_verify(inode, bh)) | 240 | if (!ext4_xattr_block_csum_verify(inode, bh)) |
| 241 | goto errout; | 241 | goto errout; |
| @@ -1560,7 +1560,7 @@ static int ext4_xattr_set_entry(struct ext4_xattr_info *i, | |||
| 1560 | handle_t *handle, struct inode *inode, | 1560 | handle_t *handle, struct inode *inode, |
| 1561 | bool is_block) | 1561 | bool is_block) |
| 1562 | { | 1562 | { |
| 1563 | struct ext4_xattr_entry *last; | 1563 | struct ext4_xattr_entry *last, *next; |
| 1564 | struct ext4_xattr_entry *here = s->here; | 1564 | struct ext4_xattr_entry *here = s->here; |
| 1565 | size_t min_offs = s->end - s->base, name_len = strlen(i->name); | 1565 | size_t min_offs = s->end - s->base, name_len = strlen(i->name); |
| 1566 | int in_inode = i->in_inode; | 1566 | int in_inode = i->in_inode; |
| @@ -1595,7 +1595,13 @@ static int ext4_xattr_set_entry(struct ext4_xattr_info *i, | |||
| 1595 | 1595 | ||
| 1596 | /* Compute min_offs and last. */ | 1596 | /* Compute min_offs and last. */ |
| 1597 | last = s->first; | 1597 | last = s->first; |
| 1598 | for (; !IS_LAST_ENTRY(last); last = EXT4_XATTR_NEXT(last)) { | 1598 | for (; !IS_LAST_ENTRY(last); last = next) { |
| 1599 | next = EXT4_XATTR_NEXT(last); | ||
| 1600 | if ((void *)next >= s->end) { | ||
| 1601 | EXT4_ERROR_INODE(inode, "corrupted xattr entries"); | ||
| 1602 | ret = -EFSCORRUPTED; | ||
| 1603 | goto out; | ||
| 1604 | } | ||
| 1599 | if (!last->e_value_inum && last->e_value_size) { | 1605 | if (!last->e_value_inum && last->e_value_size) { |
| 1600 | size_t offs = le16_to_cpu(last->e_value_offs); | 1606 | size_t offs = le16_to_cpu(last->e_value_offs); |
| 1601 | if (offs < min_offs) | 1607 | if (offs < min_offs) |
| @@ -2206,23 +2212,8 @@ int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode, | |||
| 2206 | if (EXT4_I(inode)->i_extra_isize == 0) | 2212 | if (EXT4_I(inode)->i_extra_isize == 0) |
| 2207 | return -ENOSPC; | 2213 | return -ENOSPC; |
| 2208 | error = ext4_xattr_set_entry(i, s, handle, inode, false /* is_block */); | 2214 | error = ext4_xattr_set_entry(i, s, handle, inode, false /* is_block */); |
| 2209 | if (error) { | 2215 | if (error) |
| 2210 | if (error == -ENOSPC && | 2216 | return error; |
| 2211 | ext4_has_inline_data(inode)) { | ||
| 2212 | error = ext4_try_to_evict_inline_data(handle, inode, | ||
| 2213 | EXT4_XATTR_LEN(strlen(i->name) + | ||
| 2214 | EXT4_XATTR_SIZE(i->value_len))); | ||
| 2215 | if (error) | ||
| 2216 | return error; | ||
| 2217 | error = ext4_xattr_ibody_find(inode, i, is); | ||
| 2218 | if (error) | ||
| 2219 | return error; | ||
| 2220 | error = ext4_xattr_set_entry(i, s, handle, inode, | ||
| 2221 | false /* is_block */); | ||
| 2222 | } | ||
| 2223 | if (error) | ||
| 2224 | return error; | ||
| 2225 | } | ||
| 2226 | header = IHDR(inode, ext4_raw_inode(&is->iloc)); | 2217 | header = IHDR(inode, ext4_raw_inode(&is->iloc)); |
| 2227 | if (!IS_LAST_ENTRY(s->first)) { | 2218 | if (!IS_LAST_ENTRY(s->first)) { |
| 2228 | header->h_magic = cpu_to_le32(EXT4_XATTR_MAGIC); | 2219 | header->h_magic = cpu_to_le32(EXT4_XATTR_MAGIC); |
| @@ -2651,6 +2642,11 @@ static int ext4_xattr_make_inode_space(handle_t *handle, struct inode *inode, | |||
| 2651 | last = IFIRST(header); | 2642 | last = IFIRST(header); |
| 2652 | /* Find the entry best suited to be pushed into EA block */ | 2643 | /* Find the entry best suited to be pushed into EA block */ |
| 2653 | for (; !IS_LAST_ENTRY(last); last = EXT4_XATTR_NEXT(last)) { | 2644 | for (; !IS_LAST_ENTRY(last); last = EXT4_XATTR_NEXT(last)) { |
| 2645 | /* never move system.data out of the inode */ | ||
| 2646 | if ((last->e_name_len == 4) && | ||
| 2647 | (last->e_name_index == EXT4_XATTR_INDEX_SYSTEM) && | ||
| 2648 | !memcmp(last->e_name, "data", 4)) | ||
| 2649 | continue; | ||
| 2654 | total_size = EXT4_XATTR_LEN(last->e_name_len); | 2650 | total_size = EXT4_XATTR_LEN(last->e_name_len); |
| 2655 | if (!last->e_value_inum) | 2651 | if (!last->e_value_inum) |
| 2656 | total_size += EXT4_XATTR_SIZE( | 2652 | total_size += EXT4_XATTR_SIZE( |
diff --git a/fs/inode.c b/fs/inode.c index 2c300e981796..8c86c809ca17 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
| @@ -1999,8 +1999,14 @@ void inode_init_owner(struct inode *inode, const struct inode *dir, | |||
| 1999 | inode->i_uid = current_fsuid(); | 1999 | inode->i_uid = current_fsuid(); |
| 2000 | if (dir && dir->i_mode & S_ISGID) { | 2000 | if (dir && dir->i_mode & S_ISGID) { |
| 2001 | inode->i_gid = dir->i_gid; | 2001 | inode->i_gid = dir->i_gid; |
| 2002 | |||
| 2003 | /* Directories are special, and always inherit S_ISGID */ | ||
| 2002 | if (S_ISDIR(mode)) | 2004 | if (S_ISDIR(mode)) |
| 2003 | mode |= S_ISGID; | 2005 | mode |= S_ISGID; |
| 2006 | else if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP) && | ||
| 2007 | !in_group_p(inode->i_gid) && | ||
| 2008 | !capable_wrt_inode_uidgid(dir, CAP_FSETID)) | ||
| 2009 | mode &= ~S_ISGID; | ||
| 2004 | } else | 2010 | } else |
| 2005 | inode->i_gid = current_fsgid(); | 2011 | inode->i_gid = current_fsgid(); |
| 2006 | inode->i_mode = mode; | 2012 | inode->i_mode = mode; |
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index 51dd68e67b0f..c0b66a7a795b 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
| @@ -1361,6 +1361,13 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh) | |||
| 1361 | if (jh->b_transaction == transaction && | 1361 | if (jh->b_transaction == transaction && |
| 1362 | jh->b_jlist != BJ_Metadata) { | 1362 | jh->b_jlist != BJ_Metadata) { |
| 1363 | jbd_lock_bh_state(bh); | 1363 | jbd_lock_bh_state(bh); |
| 1364 | if (jh->b_transaction == transaction && | ||
| 1365 | jh->b_jlist != BJ_Metadata) | ||
| 1366 | pr_err("JBD2: assertion failure: h_type=%u " | ||
| 1367 | "h_line_no=%u block_no=%llu jlist=%u\n", | ||
| 1368 | handle->h_type, handle->h_line_no, | ||
| 1369 | (unsigned long long) bh->b_blocknr, | ||
| 1370 | jh->b_jlist); | ||
| 1364 | J_ASSERT_JH(jh, jh->b_transaction != transaction || | 1371 | J_ASSERT_JH(jh, jh->b_transaction != transaction || |
| 1365 | jh->b_jlist == BJ_Metadata); | 1372 | jh->b_jlist == BJ_Metadata); |
| 1366 | jbd_unlock_bh_state(bh); | 1373 | jbd_unlock_bh_state(bh); |
| @@ -1380,11 +1387,11 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh) | |||
| 1380 | * of the transaction. This needs to be done | 1387 | * of the transaction. This needs to be done |
| 1381 | * once a transaction -bzzz | 1388 | * once a transaction -bzzz |
| 1382 | */ | 1389 | */ |
| 1383 | jh->b_modified = 1; | ||
| 1384 | if (handle->h_buffer_credits <= 0) { | 1390 | if (handle->h_buffer_credits <= 0) { |
| 1385 | ret = -ENOSPC; | 1391 | ret = -ENOSPC; |
| 1386 | goto out_unlock_bh; | 1392 | goto out_unlock_bh; |
| 1387 | } | 1393 | } |
| 1394 | jh->b_modified = 1; | ||
| 1388 | handle->h_buffer_credits--; | 1395 | handle->h_buffer_credits--; |
| 1389 | } | 1396 | } |
| 1390 | 1397 | ||
| @@ -509,22 +509,19 @@ static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
| 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 | /* No kernel lock held - fine */ | 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 | struct pipe_inode_info *pipe = filp->private_data; | 517 | struct pipe_inode_info *pipe = filp->private_data; |
| 524 | int nrbufs = pipe->nrbufs; | 518 | int nrbufs; |
| 525 | __poll_t mask = 0; | 519 | |
| 520 | poll_wait(filp, &pipe->wait, wait); | ||
| 526 | 521 | ||
| 527 | /* Reading only -- no need for acquiring the semaphore. */ | 522 | /* Reading only -- no need for acquiring the semaphore. */ |
| 523 | nrbufs = pipe->nrbufs; | ||
| 524 | mask = 0; | ||
| 528 | if (filp->f_mode & FMODE_READ) { | 525 | if (filp->f_mode & FMODE_READ) { |
| 529 | mask = (nrbufs > 0) ? EPOLLIN | EPOLLRDNORM : 0; | 526 | mask = (nrbufs > 0) ? EPOLLIN | EPOLLRDNORM : 0; |
| 530 | if (!pipe->writers && filp->f_version != pipe->w_counter) | 527 | if (!pipe->writers && filp->f_version != pipe->w_counter) |
| @@ -1023,8 +1020,7 @@ const struct file_operations pipefifo_fops = { | |||
| 1023 | .llseek = no_llseek, | 1020 | .llseek = no_llseek, |
| 1024 | .read_iter = pipe_read, | 1021 | .read_iter = pipe_read, |
| 1025 | .write_iter = pipe_write, | 1022 | .write_iter = pipe_write, |
| 1026 | .get_poll_head = pipe_get_poll_head, | 1023 | .poll = pipe_poll, |
| 1027 | .poll_mask = pipe_poll_mask, | ||
| 1028 | .unlocked_ioctl = pipe_ioctl, | 1024 | .unlocked_ioctl = pipe_ioctl, |
| 1029 | .release = pipe_release, | 1025 | .release = pipe_release, |
| 1030 | .fasync = pipe_fasync, | 1026 | .fasync = pipe_fasync, |
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 6ac1c92997ea..bb1c1625b158 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
| @@ -564,11 +564,20 @@ static int proc_seq_open(struct inode *inode, struct file *file) | |||
| 564 | return seq_open(file, de->seq_ops); | 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 | static const struct file_operations proc_seq_fops = { | 576 | static const struct file_operations proc_seq_fops = { |
| 568 | .open = proc_seq_open, | 577 | .open = proc_seq_open, |
| 569 | .read = seq_read, | 578 | .read = seq_read, |
| 570 | .llseek = seq_lseek, | 579 | .llseek = seq_lseek, |
| 571 | .release = seq_release, | 580 | .release = proc_seq_release, |
| 572 | }; | 581 | }; |
| 573 | 582 | ||
| 574 | struct proc_dir_entry *proc_create_seq_private(const char *name, umode_t mode, | 583 | struct proc_dir_entry *proc_create_seq_private(const char *name, umode_t mode, |
diff --git a/fs/select.c b/fs/select.c index 317891ff8165..4a6b6e4b21cb 100644 --- a/fs/select.c +++ b/fs/select.c | |||
| @@ -34,29 +34,6 @@ | |||
| 34 | 34 | ||
| 35 | #include <linux/uaccess.h> | 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 | * Estimate expected accuracy in ns from a timeval. | 39 | * Estimate expected accuracy in ns from a timeval. |
diff --git a/fs/timerfd.c b/fs/timerfd.c index d84a2bee4f82..cdad49da3ff7 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c | |||
| @@ -226,20 +226,21 @@ static int timerfd_release(struct inode *inode, struct file *file) | |||
| 226 | kfree_rcu(ctx, rcu); | 226 | kfree_rcu(ctx, rcu); |
| 227 | return 0; | 227 | return 0; |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | static struct wait_queue_head *timerfd_get_poll_head(struct file *file, | 230 | static __poll_t timerfd_poll(struct file *file, poll_table *wait) |
| 231 | __poll_t eventmask) | ||
| 232 | { | 231 | { |
| 233 | struct timerfd_ctx *ctx = file->private_data; | 232 | struct timerfd_ctx *ctx = file->private_data; |
| 233 | __poll_t events = 0; | ||
| 234 | unsigned long flags; | ||
| 234 | 235 | ||
| 235 | return &ctx->wqh; | 236 | poll_wait(file, &ctx->wqh, wait); |
| 236 | } | ||
| 237 | 237 | ||
| 238 | static __poll_t timerfd_poll_mask(struct file *file, __poll_t eventmask) | 238 | spin_lock_irqsave(&ctx->wqh.lock, flags); |
| 239 | { | 239 | if (ctx->ticks) |
| 240 | struct timerfd_ctx *ctx = file->private_data; | 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 | static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count, | 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 | |||
| 363 | 364 | ||
| 364 | static const struct file_operations timerfd_fops = { | 365 | static const struct file_operations timerfd_fops = { |
| 365 | .release = timerfd_release, | 366 | .release = timerfd_release, |
| 366 | .get_poll_head = timerfd_get_poll_head, | 367 | .poll = timerfd_poll, |
| 367 | .poll_mask = timerfd_poll_mask, | ||
| 368 | .read = timerfd_read, | 368 | .read = timerfd_read, |
| 369 | .llseek = noop_llseek, | 369 | .llseek = noop_llseek, |
| 370 | .show_fdinfo = timerfd_show, | 370 | .show_fdinfo = timerfd_show, |
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index 123bf7d516fc..594d192b2331 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c | |||
| @@ -222,24 +222,26 @@ static inline bool userfaultfd_huge_must_wait(struct userfaultfd_ctx *ctx, | |||
| 222 | unsigned long reason) | 222 | unsigned long reason) |
| 223 | { | 223 | { |
| 224 | struct mm_struct *mm = ctx->mm; | 224 | struct mm_struct *mm = ctx->mm; |
| 225 | pte_t *pte; | 225 | pte_t *ptep, pte; |
| 226 | bool ret = true; | 226 | bool ret = true; |
| 227 | 227 | ||
| 228 | VM_BUG_ON(!rwsem_is_locked(&mm->mmap_sem)); | 228 | VM_BUG_ON(!rwsem_is_locked(&mm->mmap_sem)); |
| 229 | 229 | ||
| 230 | pte = huge_pte_offset(mm, address, vma_mmu_pagesize(vma)); | 230 | ptep = huge_pte_offset(mm, address, vma_mmu_pagesize(vma)); |
| 231 | if (!pte) | 231 | |
| 232 | if (!ptep) | ||
| 232 | goto out; | 233 | goto out; |
| 233 | 234 | ||
| 234 | ret = false; | 235 | ret = false; |
| 236 | pte = huge_ptep_get(ptep); | ||
| 235 | 237 | ||
| 236 | /* | 238 | /* |
| 237 | * Lockless access: we're in a wait_event so it's ok if it | 239 | * Lockless access: we're in a wait_event so it's ok if it |
| 238 | * changes under us. | 240 | * changes under us. |
| 239 | */ | 241 | */ |
| 240 | if (huge_pte_none(*pte)) | 242 | if (huge_pte_none(pte)) |
| 241 | ret = true; | 243 | ret = true; |
| 242 | if (!huge_pte_write(*pte) && (reason & VM_UFFD_WP)) | 244 | if (!huge_pte_write(pte) && (reason & VM_UFFD_WP)) |
| 243 | ret = true; | 245 | ret = true; |
| 244 | out: | 246 | out: |
| 245 | return ret; | 247 | return ret; |
diff --git a/fs/xfs/libxfs/xfs_ag_resv.c b/fs/xfs/libxfs/xfs_ag_resv.c index 84db76e0e3e3..fecd187fcf2c 100644 --- a/fs/xfs/libxfs/xfs_ag_resv.c +++ b/fs/xfs/libxfs/xfs_ag_resv.c | |||
| @@ -157,6 +157,7 @@ __xfs_ag_resv_free( | |||
| 157 | error = xfs_mod_fdblocks(pag->pag_mount, oldresv, true); | 157 | error = xfs_mod_fdblocks(pag->pag_mount, oldresv, true); |
| 158 | resv->ar_reserved = 0; | 158 | resv->ar_reserved = 0; |
| 159 | resv->ar_asked = 0; | 159 | resv->ar_asked = 0; |
| 160 | resv->ar_orig_reserved = 0; | ||
| 160 | 161 | ||
| 161 | if (error) | 162 | if (error) |
| 162 | trace_xfs_ag_resv_free_error(pag->pag_mount, pag->pag_agno, | 163 | trace_xfs_ag_resv_free_error(pag->pag_mount, pag->pag_agno, |
| @@ -189,13 +190,34 @@ __xfs_ag_resv_init( | |||
| 189 | struct xfs_mount *mp = pag->pag_mount; | 190 | struct xfs_mount *mp = pag->pag_mount; |
| 190 | struct xfs_ag_resv *resv; | 191 | struct xfs_ag_resv *resv; |
| 191 | int error; | 192 | int error; |
| 192 | xfs_extlen_t reserved; | 193 | xfs_extlen_t hidden_space; |
| 193 | 194 | ||
| 194 | if (used > ask) | 195 | if (used > ask) |
| 195 | ask = used; | 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 | if (error) { | 221 | if (error) { |
| 200 | trace_xfs_ag_resv_init_error(pag->pag_mount, pag->pag_agno, | 222 | trace_xfs_ag_resv_init_error(pag->pag_mount, pag->pag_agno, |
| 201 | error, _RET_IP_); | 223 | error, _RET_IP_); |
| @@ -216,7 +238,8 @@ __xfs_ag_resv_init( | |||
| 216 | 238 | ||
| 217 | resv = xfs_perag_resv(pag, type); | 239 | resv = xfs_perag_resv(pag, type); |
| 218 | resv->ar_asked = ask; | 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 | trace_xfs_ag_resv_init(pag, type, ask); | 244 | trace_xfs_ag_resv_init(pag, type, ask); |
| 222 | return 0; | 245 | return 0; |
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 01628f0c9a0c..7205268b30bc 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c | |||
| @@ -5780,6 +5780,32 @@ del_cursor: | |||
| 5780 | return error; | 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 | int | 5809 | int |
| 5784 | xfs_bmap_insert_extents( | 5810 | xfs_bmap_insert_extents( |
| 5785 | struct xfs_trans *tp, | 5811 | struct xfs_trans *tp, |
diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h index 99dddbd0fcc6..9b49ddf99c41 100644 --- a/fs/xfs/libxfs/xfs_bmap.h +++ b/fs/xfs/libxfs/xfs_bmap.h | |||
| @@ -227,6 +227,8 @@ int xfs_bmap_collapse_extents(struct xfs_trans *tp, struct xfs_inode *ip, | |||
| 227 | xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb, | 227 | xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb, |
| 228 | bool *done, xfs_fsblock_t *firstblock, | 228 | bool *done, xfs_fsblock_t *firstblock, |
| 229 | struct xfs_defer_ops *dfops); | 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 | int xfs_bmap_insert_extents(struct xfs_trans *tp, struct xfs_inode *ip, | 232 | int xfs_bmap_insert_extents(struct xfs_trans *tp, struct xfs_inode *ip, |
| 231 | xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb, | 233 | xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb, |
| 232 | bool *done, xfs_fileoff_t stop_fsb, xfs_fsblock_t *firstblock, | 234 | bool *done, xfs_fileoff_t stop_fsb, xfs_fsblock_t *firstblock, |
diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index 1c5a8aaf2bfc..059bc44c27e8 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h | |||
| @@ -962,6 +962,9 @@ typedef enum xfs_dinode_fmt { | |||
| 962 | XFS_DFORK_DSIZE(dip, mp) : \ | 962 | XFS_DFORK_DSIZE(dip, mp) : \ |
| 963 | XFS_DFORK_ASIZE(dip, mp)) | 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 | * Return pointers to the data or attribute forks. | 969 | * Return pointers to the data or attribute forks. |
| 967 | */ | 970 | */ |
| @@ -1526,6 +1529,8 @@ typedef struct xfs_bmdr_block { | |||
| 1526 | #define BMBT_STARTBLOCK_BITLEN 52 | 1529 | #define BMBT_STARTBLOCK_BITLEN 52 |
| 1527 | #define BMBT_BLOCKCOUNT_BITLEN 21 | 1530 | #define BMBT_BLOCKCOUNT_BITLEN 21 |
| 1528 | 1531 | ||
| 1532 | #define BMBT_STARTOFF_MASK ((1ULL << BMBT_STARTOFF_BITLEN) - 1) | ||
| 1533 | |||
| 1529 | typedef struct xfs_bmbt_rec { | 1534 | typedef struct xfs_bmbt_rec { |
| 1530 | __be64 l0, l1; | 1535 | __be64 l0, l1; |
| 1531 | } xfs_bmbt_rec_t; | 1536 | } xfs_bmbt_rec_t; |
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index d38d724534c4..33dc34655ac3 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c | |||
| @@ -374,6 +374,47 @@ xfs_log_dinode_to_disk( | |||
| 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 | xfs_failaddr_t | 418 | xfs_failaddr_t |
| 378 | xfs_dinode_verify( | 419 | xfs_dinode_verify( |
| 379 | struct xfs_mount *mp, | 420 | struct xfs_mount *mp, |
| @@ -441,24 +482,9 @@ xfs_dinode_verify( | |||
| 441 | case S_IFREG: | 482 | case S_IFREG: |
| 442 | case S_IFLNK: | 483 | case S_IFLNK: |
| 443 | case S_IFDIR: | 484 | case S_IFDIR: |
| 444 | switch (dip->di_format) { | 485 | fa = xfs_dinode_verify_fork(dip, mp, XFS_DATA_FORK); |
| 445 | case XFS_DINODE_FMT_LOCAL: | 486 | if (fa) |
| 446 | /* | 487 | return fa; |
| 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 | } | ||
| 462 | break; | 488 | break; |
| 463 | case 0: | 489 | case 0: |
| 464 | /* Uninitialized inode ok. */ | 490 | /* Uninitialized inode ok. */ |
| @@ -468,17 +494,9 @@ xfs_dinode_verify( | |||
| 468 | } | 494 | } |
| 469 | 495 | ||
| 470 | if (XFS_DFORK_Q(dip)) { | 496 | if (XFS_DFORK_Q(dip)) { |
| 471 | switch (dip->di_aformat) { | 497 | fa = xfs_dinode_verify_fork(dip, mp, XFS_ATTR_FORK); |
| 472 | case XFS_DINODE_FMT_LOCAL: | 498 | if (fa) |
| 473 | if (dip->di_anextents) | 499 | return fa; |
| 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 | } | ||
| 482 | } else { | 500 | } else { |
| 483 | /* | 501 | /* |
| 484 | * If there is no fork offset, this may be a freshly-made inode | 502 | * If there is no fork offset, this may be a freshly-made inode |
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c index 65fc4ed2e9a1..b228c821bae6 100644 --- a/fs/xfs/libxfs/xfs_rtbitmap.c +++ b/fs/xfs/libxfs/xfs_rtbitmap.c | |||
| @@ -1029,8 +1029,8 @@ xfs_rtalloc_query_range( | |||
| 1029 | if (low_rec->ar_startext >= mp->m_sb.sb_rextents || | 1029 | if (low_rec->ar_startext >= mp->m_sb.sb_rextents || |
| 1030 | low_rec->ar_startext == high_rec->ar_startext) | 1030 | low_rec->ar_startext == high_rec->ar_startext) |
| 1031 | return 0; | 1031 | return 0; |
| 1032 | if (high_rec->ar_startext >= mp->m_sb.sb_rextents) | 1032 | if (high_rec->ar_startext > mp->m_sb.sb_rextents) |
| 1033 | high_rec->ar_startext = mp->m_sb.sb_rextents - 1; | 1033 | high_rec->ar_startext = mp->m_sb.sb_rextents; |
| 1034 | 1034 | ||
| 1035 | /* Iterate the bitmap, looking for discrepancies. */ | 1035 | /* Iterate the bitmap, looking for discrepancies. */ |
| 1036 | rtstart = low_rec->ar_startext; | 1036 | rtstart = low_rec->ar_startext; |
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index c35009a86699..83b1e8c6c18f 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c | |||
| @@ -685,12 +685,10 @@ out_unlock_iolock: | |||
| 685 | } | 685 | } |
| 686 | 686 | ||
| 687 | /* | 687 | /* |
| 688 | * dead simple method of punching delalyed allocation blocks from a range in | 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 | 689 | * the inode. This will always punch out both the start and end blocks, even |
| 690 | * rare error cases so the overhead is not critical. This will always punch out | 690 | * if the ranges only partially overlap them, so it is up to the caller to |
| 691 | * both the start and end blocks, even if the ranges only partially overlap | 691 | * ensure that partial blocks are not passed in. |
| 692 | * them, so it is up to the caller to ensure that partial blocks are not | ||
| 693 | * passed in. | ||
| 694 | */ | 692 | */ |
| 695 | int | 693 | int |
| 696 | xfs_bmap_punch_delalloc_range( | 694 | xfs_bmap_punch_delalloc_range( |
| @@ -698,63 +696,44 @@ xfs_bmap_punch_delalloc_range( | |||
| 698 | xfs_fileoff_t start_fsb, | 696 | xfs_fileoff_t start_fsb, |
| 699 | xfs_fileoff_t length) | 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 | int error = 0; | 703 | int error = 0; |
| 703 | 704 | ||
| 704 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); | 705 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); |
| 705 | 706 | ||
| 706 | do { | 707 | if (!(ifp->if_flags & XFS_IFEXTENTS)) { |
| 707 | int done; | 708 | error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK); |
| 708 | xfs_bmbt_irec_t imap; | 709 | if (error) |
| 709 | int nimaps = 1; | 710 | return error; |
| 710 | xfs_fsblock_t firstblock; | 711 | } |
| 711 | struct xfs_defer_ops dfops; | ||
| 712 | 712 | ||
| 713 | /* | 713 | if (!xfs_iext_lookup_extent_before(ip, ifp, &end_fsb, &icur, &got)) |
| 714 | * Map the range first and check that it is a delalloc extent | 714 | return 0; |
| 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); | ||
| 721 | 715 | ||
| 722 | if (error) { | 716 | while (got.br_startoff + got.br_blockcount > start_fsb) { |
| 723 | /* something screwed, just bail */ | 717 | del = got; |
| 724 | if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { | 718 | xfs_trim_extent(&del, start_fsb, length); |
| 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); | ||
| 740 | 719 | ||
| 741 | /* | 720 | /* |
| 742 | * Note: while we initialise the firstblock/dfops pair, they | 721 | * A delete can push the cursor forward. Step back to the |
| 743 | * should never be used because blocks should never be | 722 | * previous extent on non-delalloc or extents outside the |
| 744 | * allocated or freed for a delalloc extent and hence we need | 723 | * target range. |
| 745 | * don't cancel or finish them after the xfs_bunmapi() call. | ||
| 746 | */ | 724 | */ |
| 747 | xfs_defer_init(&dfops, &firstblock); | 725 | if (!del.br_blockcount || |
| 748 | error = xfs_bunmapi(NULL, ip, start_fsb, 1, 0, 1, &firstblock, | 726 | !isnullstartblock(del.br_startblock)) { |
| 749 | &dfops, &done); | 727 | if (!xfs_iext_prev_extent(ifp, &icur, &got)) |
| 750 | if (error) | 728 | break; |
| 751 | break; | 729 | continue; |
| 730 | } | ||
| 752 | 731 | ||
| 753 | ASSERT(!xfs_defer_has_unfinished_work(&dfops)); | 732 | error = xfs_bmap_del_extent_delay(ip, XFS_DATA_FORK, &icur, |
| 754 | next_block: | 733 | &got, &del); |
| 755 | start_fsb++; | 734 | if (error || !xfs_iext_get_extent(ifp, &icur, &got)) |
| 756 | remaining--; | 735 | break; |
| 757 | } while(remaining > 0); | 736 | } |
| 758 | 737 | ||
| 759 | return error; | 738 | return error; |
| 760 | } | 739 | } |
| @@ -1208,7 +1187,22 @@ xfs_free_file_space( | |||
| 1208 | return 0; | 1187 | return 0; |
| 1209 | if (offset + len > XFS_ISIZE(ip)) | 1188 | if (offset + len > XFS_ISIZE(ip)) |
| 1210 | len = XFS_ISIZE(ip) - offset; | 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( | |||
| 1404 | 1398 | ||
| 1405 | trace_xfs_insert_file_space(ip); | 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 | error = xfs_prepare_shift(ip, offset); | 1405 | error = xfs_prepare_shift(ip, offset); |
| 1408 | if (error) | 1406 | if (error) |
| 1409 | return error; | 1407 | return error; |
diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c index c34fa9c342f2..c7157bc48bd1 100644 --- a/fs/xfs/xfs_fsmap.c +++ b/fs/xfs/xfs_fsmap.c | |||
| @@ -513,8 +513,8 @@ xfs_getfsmap_rtdev_rtbitmap_query( | |||
| 513 | struct xfs_trans *tp, | 513 | struct xfs_trans *tp, |
| 514 | struct xfs_getfsmap_info *info) | 514 | struct xfs_getfsmap_info *info) |
| 515 | { | 515 | { |
| 516 | struct xfs_rtalloc_rec alow; | 516 | struct xfs_rtalloc_rec alow = { 0 }; |
| 517 | struct xfs_rtalloc_rec ahigh; | 517 | struct xfs_rtalloc_rec ahigh = { 0 }; |
| 518 | int error; | 518 | int error; |
| 519 | 519 | ||
| 520 | xfs_ilock(tp->t_mountp->m_rbmip, XFS_ILOCK_SHARED); | 520 | xfs_ilock(tp->t_mountp->m_rbmip, XFS_ILOCK_SHARED); |
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index a7afcad6b711..3f2bd6032cf8 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c | |||
| @@ -387,7 +387,7 @@ xfs_reserve_blocks( | |||
| 387 | do { | 387 | do { |
| 388 | free = percpu_counter_sum(&mp->m_fdblocks) - | 388 | free = percpu_counter_sum(&mp->m_fdblocks) - |
| 389 | mp->m_alloc_set_aside; | 389 | mp->m_alloc_set_aside; |
| 390 | if (!free) | 390 | if (free <= 0) |
| 391 | break; | 391 | break; |
| 392 | 392 | ||
| 393 | delta = request - mp->m_resblks; | 393 | delta = request - mp->m_resblks; |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 7a96c4e0ab5c..5df4de666cc1 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
| @@ -3236,7 +3236,6 @@ xfs_iflush_cluster( | |||
| 3236 | struct xfs_inode *cip; | 3236 | struct xfs_inode *cip; |
| 3237 | int nr_found; | 3237 | int nr_found; |
| 3238 | int clcount = 0; | 3238 | int clcount = 0; |
| 3239 | int bufwasdelwri; | ||
| 3240 | int i; | 3239 | int i; |
| 3241 | 3240 | ||
| 3242 | pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); | 3241 | pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); |
| @@ -3360,37 +3359,22 @@ cluster_corrupt_out: | |||
| 3360 | * inode buffer and shut down the filesystem. | 3359 | * inode buffer and shut down the filesystem. |
| 3361 | */ | 3360 | */ |
| 3362 | rcu_read_unlock(); | 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 | xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); | 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 | xfs_iflush_abort(cip, false); | 3378 | xfs_iflush_abort(cip, false); |
| 3395 | kmem_free(cilist); | 3379 | kmem_free(cilist); |
| 3396 | xfs_perag_put(pag); | 3380 | xfs_perag_put(pag); |
| @@ -3486,12 +3470,17 @@ xfs_iflush( | |||
| 3486 | xfs_log_force(mp, 0); | 3470 | xfs_log_force(mp, 0); |
| 3487 | 3471 | ||
| 3488 | /* | 3472 | /* |
| 3489 | * inode clustering: | 3473 | * inode clustering: try to gather other inodes into this write |
| 3490 | * see if other inodes can be gathered 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 | error = xfs_iflush_cluster(ip, bp); | 3481 | error = xfs_iflush_cluster(ip, bp); |
| 3493 | if (error) | 3482 | if (error) |
| 3494 | goto cluster_corrupt_out; | 3483 | return error; |
| 3495 | 3484 | ||
| 3496 | *bpp = bp; | 3485 | *bpp = bp; |
| 3497 | return 0; | 3486 | return 0; |
| @@ -3500,12 +3489,8 @@ corrupt_out: | |||
| 3500 | if (bp) | 3489 | if (bp) |
| 3501 | xfs_buf_relse(bp); | 3490 | xfs_buf_relse(bp); |
| 3502 | xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); | 3491 | xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); |
| 3503 | cluster_corrupt_out: | ||
| 3504 | error = -EFSCORRUPTED; | ||
| 3505 | abort_out: | 3492 | abort_out: |
| 3506 | /* | 3493 | /* abort the corrupt inode, as it was not attached to the buffer */ |
| 3507 | * Unlocks the flush lock | ||
| 3508 | */ | ||
| 3509 | xfs_iflush_abort(ip, false); | 3494 | xfs_iflush_abort(ip, false); |
| 3510 | return error; | 3495 | return error; |
| 3511 | } | 3496 | } |
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 49f5492eed3b..55876dd02f0c 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
| @@ -963,12 +963,13 @@ xfs_ilock_for_iomap( | |||
| 963 | unsigned *lockmode) | 963 | unsigned *lockmode) |
| 964 | { | 964 | { |
| 965 | unsigned mode = XFS_ILOCK_SHARED; | 965 | unsigned mode = XFS_ILOCK_SHARED; |
| 966 | bool is_write = flags & (IOMAP_WRITE | IOMAP_ZERO); | ||
| 966 | 967 | ||
| 967 | /* | 968 | /* |
| 968 | * COW writes may allocate delalloc space or convert unwritten COW | 969 | * COW writes may allocate delalloc space or convert unwritten COW |
| 969 | * extents, so we need to make sure to take the lock exclusively here. | 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 | * FIXME: It could still overwrite on unshared extents and not | 974 | * FIXME: It could still overwrite on unshared extents and not |
| 974 | * need allocation. | 975 | * need allocation. |
| @@ -989,6 +990,7 @@ xfs_ilock_for_iomap( | |||
| 989 | mode = XFS_ILOCK_EXCL; | 990 | mode = XFS_ILOCK_EXCL; |
| 990 | } | 991 | } |
| 991 | 992 | ||
| 993 | relock: | ||
| 992 | if (flags & IOMAP_NOWAIT) { | 994 | if (flags & IOMAP_NOWAIT) { |
| 993 | if (!xfs_ilock_nowait(ip, mode)) | 995 | if (!xfs_ilock_nowait(ip, mode)) |
| 994 | return -EAGAIN; | 996 | return -EAGAIN; |
| @@ -996,6 +998,17 @@ xfs_ilock_for_iomap( | |||
| 996 | xfs_ilock(ip, mode); | 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 | *lockmode = mode; | 1012 | *lockmode = mode; |
| 1000 | return 0; | 1013 | return 0; |
| 1001 | } | 1014 | } |
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index e040af120b69..524f543c5b82 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c | |||
| @@ -258,7 +258,12 @@ xfs_trans_alloc( | |||
| 258 | if (!(flags & XFS_TRANS_NO_WRITECOUNT)) | 258 | if (!(flags & XFS_TRANS_NO_WRITECOUNT)) |
| 259 | sb_start_intwrite(mp->m_super); | 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 | atomic_inc(&mp->m_active_trans); | 267 | atomic_inc(&mp->m_active_trans); |
| 263 | 268 | ||
| 264 | tp = kmem_zone_zalloc(xfs_trans_zone, | 269 | tp = kmem_zone_zalloc(xfs_trans_zone, |
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h index cc414db9da0a..482461d8931d 100644 --- a/include/crypto/if_alg.h +++ b/include/crypto/if_alg.h | |||
| @@ -245,7 +245,8 @@ ssize_t af_alg_sendpage(struct socket *sock, struct page *page, | |||
| 245 | int offset, size_t size, int flags); | 245 | int offset, size_t size, int flags); |
| 246 | void af_alg_free_resources(struct af_alg_async_req *areq); | 246 | void af_alg_free_resources(struct af_alg_async_req *areq); |
| 247 | void af_alg_async_cb(struct crypto_async_request *_req, int err); | 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 | struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk, | 250 | struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk, |
| 250 | unsigned int areqlen); | 251 | unsigned int areqlen); |
| 251 | int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags, | 252 | int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags, |
diff --git a/include/dt-bindings/clock/imx6ul-clock.h b/include/dt-bindings/clock/imx6ul-clock.h index 9564597cbfac..0aa1d9c3e0b9 100644 --- a/include/dt-bindings/clock/imx6ul-clock.h +++ b/include/dt-bindings/clock/imx6ul-clock.h | |||
| @@ -235,27 +235,25 @@ | |||
| 235 | #define IMX6UL_CLK_CSI_PODF 222 | 235 | #define IMX6UL_CLK_CSI_PODF 222 |
| 236 | #define IMX6UL_CLK_PLL3_120M 223 | 236 | #define IMX6UL_CLK_PLL3_120M 223 |
| 237 | #define IMX6UL_CLK_KPP 224 | 237 | #define IMX6UL_CLK_KPP 224 |
| 238 | #define IMX6UL_CLK_CKO1_SEL 225 | 238 | #define IMX6ULL_CLK_ESAI_PRED 225 |
| 239 | #define IMX6UL_CLK_CKO1_PODF 226 | 239 | #define IMX6ULL_CLK_ESAI_PODF 226 |
| 240 | #define IMX6UL_CLK_CKO1 227 | 240 | #define IMX6ULL_CLK_ESAI_EXTAL 227 |
| 241 | #define IMX6UL_CLK_CKO2_SEL 228 | 241 | #define IMX6ULL_CLK_ESAI_MEM 228 |
| 242 | #define IMX6UL_CLK_CKO2_PODF 229 | 242 | #define IMX6ULL_CLK_ESAI_IPG 229 |
| 243 | #define IMX6UL_CLK_CKO2 230 | 243 | #define IMX6ULL_CLK_DCP_CLK 230 |
| 244 | #define IMX6UL_CLK_CKO 231 | 244 | #define IMX6ULL_CLK_EPDC_PRE_SEL 231 |
| 245 | 245 | #define IMX6ULL_CLK_EPDC_SEL 232 | |
| 246 | /* For i.MX6ULL */ | 246 | #define IMX6ULL_CLK_EPDC_PODF 233 |
| 247 | #define IMX6ULL_CLK_ESAI_PRED 232 | 247 | #define IMX6ULL_CLK_EPDC_ACLK 234 |
| 248 | #define IMX6ULL_CLK_ESAI_PODF 233 | 248 | #define IMX6ULL_CLK_EPDC_PIX 235 |
| 249 | #define IMX6ULL_CLK_ESAI_EXTAL 234 | 249 | #define IMX6ULL_CLK_ESAI_SEL 236 |
| 250 | #define IMX6ULL_CLK_ESAI_MEM 235 | 250 | #define IMX6UL_CLK_CKO1_SEL 237 |
| 251 | #define IMX6ULL_CLK_ESAI_IPG 236 | 251 | #define IMX6UL_CLK_CKO1_PODF 238 |
| 252 | #define IMX6ULL_CLK_DCP_CLK 237 | 252 | #define IMX6UL_CLK_CKO1 239 |
| 253 | #define IMX6ULL_CLK_EPDC_PRE_SEL 238 | 253 | #define IMX6UL_CLK_CKO2_SEL 240 |
| 254 | #define IMX6ULL_CLK_EPDC_SEL 239 | 254 | #define IMX6UL_CLK_CKO2_PODF 241 |
| 255 | #define IMX6ULL_CLK_EPDC_PODF 240 | 255 | #define IMX6UL_CLK_CKO2 242 |
| 256 | #define IMX6ULL_CLK_EPDC_ACLK 241 | 256 | #define IMX6UL_CLK_CKO 243 |
| 257 | #define IMX6ULL_CLK_EPDC_PIX 242 | ||
| 258 | #define IMX6ULL_CLK_ESAI_SEL 243 | ||
| 259 | #define IMX6UL_CLK_END 244 | 257 | #define IMX6UL_CLK_END 244 |
| 260 | 258 | ||
| 261 | #endif /* __DT_BINDINGS_CLOCK_IMX6UL_H */ | 259 | #endif /* __DT_BINDINGS_CLOCK_IMX6UL_H */ |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 4b35a66383f9..e54f40974eb0 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -443,6 +443,9 @@ int acpi_check_resource_conflict(const struct resource *res); | |||
| 443 | int acpi_check_region(resource_size_t start, resource_size_t n, | 443 | int acpi_check_region(resource_size_t start, resource_size_t n, |
| 444 | const char *name); | 444 | const char *name); |
| 445 | 445 | ||
| 446 | acpi_status acpi_release_memory(acpi_handle handle, struct resource *res, | ||
| 447 | u32 level); | ||
| 448 | |||
| 446 | int acpi_resources_are_enforced(void); | 449 | int acpi_resources_are_enforced(void); |
| 447 | 450 | ||
| 448 | #ifdef CONFIG_HIBERNATION | 451 | #ifdef CONFIG_HIBERNATION |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 9154570edf29..79226ca8f80f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -1119,8 +1119,8 @@ static inline unsigned int blk_max_size_offset(struct request_queue *q, | |||
| 1119 | if (!q->limits.chunk_sectors) | 1119 | if (!q->limits.chunk_sectors) |
| 1120 | return q->limits.max_sectors; | 1120 | return q->limits.max_sectors; |
| 1121 | 1121 | ||
| 1122 | return q->limits.chunk_sectors - | 1122 | return min(q->limits.max_sectors, (unsigned int)(q->limits.chunk_sectors - |
| 1123 | (offset & (q->limits.chunk_sectors - 1)); | 1123 | (offset & (q->limits.chunk_sectors - 1)))); |
| 1124 | } | 1124 | } |
| 1125 | 1125 | ||
| 1126 | static inline unsigned int blk_rq_get_max_sectors(struct request *rq, | 1126 | static inline unsigned int blk_rq_get_max_sectors(struct request *rq, |
diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h index 975fb4cf1bb7..79795c5fa7c3 100644 --- a/include/linux/bpf-cgroup.h +++ b/include/linux/bpf-cgroup.h | |||
| @@ -188,12 +188,38 @@ int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor, | |||
| 188 | \ | 188 | \ |
| 189 | __ret; \ | 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 | #else | 197 | #else |
| 192 | 198 | ||
| 199 | struct bpf_prog; | ||
| 193 | struct cgroup_bpf {}; | 200 | struct cgroup_bpf {}; |
| 194 | static inline void cgroup_bpf_put(struct cgroup *cgrp) {} | 201 | static inline void cgroup_bpf_put(struct cgroup *cgrp) {} |
| 195 | static inline int cgroup_bpf_inherit(struct cgroup *cgrp) { return 0; } | 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 | #define cgroup_bpf_enabled (0) | 223 | #define cgroup_bpf_enabled (0) |
| 198 | #define BPF_CGROUP_PRE_CONNECT_ENABLED(sk) (0) | 224 | #define BPF_CGROUP_PRE_CONNECT_ENABLED(sk) (0) |
| 199 | #define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk,skb) ({ 0; }) | 225 | #define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk,skb) ({ 0; }) |
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 7df32a3200f7..8827e797ff97 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h | |||
| @@ -696,6 +696,8 @@ static inline void bpf_map_offload_map_free(struct bpf_map *map) | |||
| 696 | struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key); | 696 | struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key); |
| 697 | struct sock *__sock_hash_lookup_elem(struct bpf_map *map, void *key); | 697 | struct sock *__sock_hash_lookup_elem(struct bpf_map *map, void *key); |
| 698 | int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type); | 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 | #else | 701 | #else |
| 700 | static inline struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key) | 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, | |||
| 714 | { | 716 | { |
| 715 | return -EOPNOTSUPP; | 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 | #endif | 725 | #endif |
| 718 | 726 | ||
| 719 | #if defined(CONFIG_XDP_SOCKETS) | 727 | #if defined(CONFIG_XDP_SOCKETS) |
diff --git a/include/linux/bpf_lirc.h b/include/linux/bpf_lirc.h index 5f8a4283092d..9d9ff755ec29 100644 --- a/include/linux/bpf_lirc.h +++ b/include/linux/bpf_lirc.h | |||
| @@ -5,11 +5,12 @@ | |||
| 5 | #include <uapi/linux/bpf.h> | 5 | #include <uapi/linux/bpf.h> |
| 6 | 6 | ||
| 7 | #ifdef CONFIG_BPF_LIRC_MODE2 | 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 | int lirc_prog_detach(const union bpf_attr *attr); | 9 | int lirc_prog_detach(const union bpf_attr *attr); |
| 10 | int lirc_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr); | 10 | int lirc_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr); |
| 11 | #else | 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 | return -EINVAL; | 15 | return -EINVAL; |
| 15 | } | 16 | } |
diff --git a/include/linux/compat.h b/include/linux/compat.h index b1a5562b3215..c68acc47da57 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -72,6 +72,9 @@ | |||
| 72 | */ | 72 | */ |
| 73 | #ifndef COMPAT_SYSCALL_DEFINEx | 73 | #ifndef COMPAT_SYSCALL_DEFINEx |
| 74 | #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ | 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 | asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ | 78 | asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ |
| 76 | asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ | 79 | asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ |
| 77 | __attribute__((alias(__stringify(__se_compat_sys##name)))); \ | 80 | __attribute__((alias(__stringify(__se_compat_sys##name)))); \ |
| @@ -80,8 +83,11 @@ | |||
| 80 | asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ | 83 | asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ |
| 81 | asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ | 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 | static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) | 91 | static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) |
| 86 | #endif /* COMPAT_SYSCALL_DEFINEx */ | 92 | #endif /* COMPAT_SYSCALL_DEFINEx */ |
| 87 | 93 | ||
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index f1a7492a5cc8..573f5a7d42d4 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -66,25 +66,40 @@ | |||
| 66 | #endif | 66 | #endif |
| 67 | 67 | ||
| 68 | /* | 68 | /* |
| 69 | * Feature detection for gnu_inline (gnu89 extern inline semantics). Either | ||
| 70 | * __GNUC_STDC_INLINE__ is defined (not using gnu89 extern inline semantics, | ||
| 71 | * and we opt in to the gnu89 semantics), or __GNUC_STDC_INLINE__ is not | ||
| 72 | * defined so the gnu89 semantics are the default. | ||
| 73 | */ | ||
| 74 | #ifdef __GNUC_STDC_INLINE__ | ||
| 75 | # define __gnu_inline __attribute__((gnu_inline)) | ||
| 76 | #else | ||
| 77 | # define __gnu_inline | ||
| 78 | #endif | ||
| 79 | |||
| 80 | /* | ||
| 69 | * Force always-inline if the user requests it so via the .config, | 81 | * Force always-inline if the user requests it so via the .config, |
| 70 | * or if gcc is too old. | 82 | * or if gcc is too old. |
| 71 | * GCC does not warn about unused static inline functions for | 83 | * GCC does not warn about unused static inline functions for |
| 72 | * -Wunused-function. This turns out to avoid the need for complex #ifdef | 84 | * -Wunused-function. This turns out to avoid the need for complex #ifdef |
| 73 | * directives. Suppress the warning in clang as well by using "unused" | 85 | * directives. Suppress the warning in clang as well by using "unused" |
| 74 | * function attribute, which is redundant but not harmful for gcc. | 86 | * function attribute, which is redundant but not harmful for gcc. |
| 87 | * Prefer gnu_inline, so that extern inline functions do not emit an | ||
| 88 | * externally visible function. This makes extern inline behave as per gnu89 | ||
| 89 | * semantics rather than c99. This prevents multiple symbol definition errors | ||
| 90 | * of extern inline functions at link time. | ||
| 91 | * A lot of inline functions can cause havoc with function tracing. | ||
| 75 | */ | 92 | */ |
| 76 | #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ | 93 | #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ |
| 77 | !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) | 94 | !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) |
| 78 | #define inline inline __attribute__((always_inline,unused)) notrace | 95 | #define inline \ |
| 79 | #define __inline__ __inline__ __attribute__((always_inline,unused)) notrace | 96 | inline __attribute__((always_inline, unused)) notrace __gnu_inline |
| 80 | #define __inline __inline __attribute__((always_inline,unused)) notrace | ||
| 81 | #else | 97 | #else |
| 82 | /* A lot of inline functions can cause havoc with function tracing */ | 98 | #define inline inline __attribute__((unused)) notrace __gnu_inline |
| 83 | #define inline inline __attribute__((unused)) notrace | ||
| 84 | #define __inline__ __inline__ __attribute__((unused)) notrace | ||
| 85 | #define __inline __inline __attribute__((unused)) notrace | ||
| 86 | #endif | 99 | #endif |
| 87 | 100 | ||
| 101 | #define __inline__ inline | ||
| 102 | #define __inline inline | ||
| 88 | #define __always_inline inline __attribute__((always_inline)) | 103 | #define __always_inline inline __attribute__((always_inline)) |
| 89 | #define noinline __attribute__((noinline)) | 104 | #define noinline __attribute__((noinline)) |
| 90 | 105 | ||
| @@ -347,3 +362,28 @@ | |||
| 347 | #if GCC_VERSION >= 50100 | 362 | #if GCC_VERSION >= 50100 |
| 348 | #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 | 363 | #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 |
| 349 | #endif | 364 | #endif |
| 365 | |||
| 366 | /* | ||
| 367 | * Turn individual warnings and errors on and off locally, depending | ||
| 368 | * on version. | ||
| 369 | */ | ||
| 370 | #define __diag_GCC(version, severity, s) \ | ||
| 371 | __diag_GCC_ ## version(__diag_GCC_ ## severity s) | ||
| 372 | |||
| 373 | /* Severity used in pragma directives */ | ||
| 374 | #define __diag_GCC_ignore ignored | ||
| 375 | #define __diag_GCC_warn warning | ||
| 376 | #define __diag_GCC_error error | ||
| 377 | |||
| 378 | /* Compilers before gcc-4.6 do not understand "#pragma GCC diagnostic push" */ | ||
| 379 | #if GCC_VERSION >= 40600 | ||
| 380 | #define __diag_str1(s) #s | ||
| 381 | #define __diag_str(s) __diag_str1(s) | ||
| 382 | #define __diag(s) _Pragma(__diag_str(GCC diagnostic s)) | ||
| 383 | #endif | ||
| 384 | |||
| 385 | #if GCC_VERSION >= 80000 | ||
| 386 | #define __diag_GCC_8(s) __diag(s) | ||
| 387 | #else | ||
| 388 | #define __diag_GCC_8(s) | ||
| 389 | #endif | ||
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 6b79a9bba9a7..a8ba6b04152c 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h | |||
| @@ -271,4 +271,22 @@ struct ftrace_likely_data { | |||
| 271 | # define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) | 271 | # define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) |
| 272 | #endif | 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 | #endif /* __LINUX_COMPILER_TYPES_H */ | 292 | #endif /* __LINUX_COMPILER_TYPES_H */ |
diff --git a/include/linux/dax.h b/include/linux/dax.h index 3855e3800f48..deb0f663252f 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h | |||
| @@ -135,7 +135,7 @@ void dax_flush(struct dax_device *dax_dev, void *addr, size_t size); | |||
| 135 | 135 | ||
| 136 | ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, | 136 | ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, |
| 137 | const struct iomap_ops *ops); | 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 | pfn_t *pfnp, int *errp, const struct iomap_ops *ops); | 139 | pfn_t *pfnp, int *errp, const struct iomap_ops *ops); |
| 140 | vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf, | 140 | vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf, |
| 141 | enum page_entry_size pe_size, pfn_t pfn); | 141 | enum page_entry_size pe_size, pfn_t pfn); |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 20f2659dd829..300baad62c88 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
| @@ -470,9 +470,7 @@ struct sock_fprog_kern { | |||
| 470 | }; | 470 | }; |
| 471 | 471 | ||
| 472 | struct bpf_binary_header { | 472 | struct bpf_binary_header { |
| 473 | u16 pages; | 473 | u32 pages; |
| 474 | u16 locked:1; | ||
| 475 | |||
| 476 | /* Some arches need word alignment for their instructions */ | 474 | /* Some arches need word alignment for their instructions */ |
| 477 | u8 image[] __aligned(4); | 475 | u8 image[] __aligned(4); |
| 478 | }; | 476 | }; |
| @@ -481,7 +479,7 @@ struct bpf_prog { | |||
| 481 | u16 pages; /* Number of allocated pages */ | 479 | u16 pages; /* Number of allocated pages */ |
| 482 | u16 jited:1, /* Is our filter JIT'ed? */ | 480 | u16 jited:1, /* Is our filter JIT'ed? */ |
| 483 | jit_requested:1,/* archs need to JIT the prog */ | 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 | gpl_compatible:1, /* Is filter GPL compatible? */ | 483 | gpl_compatible:1, /* Is filter GPL compatible? */ |
| 486 | cb_access:1, /* Is control block accessed? */ | 484 | cb_access:1, /* Is control block accessed? */ |
| 487 | dst_needed:1, /* Do we need dst entry? */ | 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) | |||
| 677 | 675 | ||
| 678 | static inline void bpf_prog_lock_ro(struct bpf_prog *fp) | 676 | static inline void bpf_prog_lock_ro(struct bpf_prog *fp) |
| 679 | { | 677 | { |
| 680 | #ifdef CONFIG_ARCH_HAS_SET_MEMORY | 678 | fp->undo_set_mem = 1; |
| 681 | fp->locked = 1; | 679 | set_memory_ro((unsigned long)fp, fp->pages); |
| 682 | if (set_memory_ro((unsigned long)fp, fp->pages)) | ||
| 683 | fp->locked = 0; | ||
| 684 | #endif | ||
| 685 | } | 680 | } |
| 686 | 681 | ||
| 687 | static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) | 682 | static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) |
| 688 | { | 683 | { |
| 689 | #ifdef CONFIG_ARCH_HAS_SET_MEMORY | 684 | if (fp->undo_set_mem) |
| 690 | if (fp->locked) { | 685 | set_memory_rw((unsigned long)fp, fp->pages); |
| 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 | ||
| 698 | } | 686 | } |
| 699 | 687 | ||
| 700 | static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr) | 688 | static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr) |
| 701 | { | 689 | { |
| 702 | #ifdef CONFIG_ARCH_HAS_SET_MEMORY | 690 | set_memory_ro((unsigned long)hdr, hdr->pages); |
| 703 | hdr->locked = 1; | ||
| 704 | if (set_memory_ro((unsigned long)hdr, hdr->pages)) | ||
| 705 | hdr->locked = 0; | ||
| 706 | #endif | ||
| 707 | } | 691 | } |
| 708 | 692 | ||
| 709 | static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr) | 693 | static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr) |
| 710 | { | 694 | { |
| 711 | #ifdef CONFIG_ARCH_HAS_SET_MEMORY | 695 | set_memory_rw((unsigned long)hdr, hdr->pages); |
| 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 | ||
| 720 | } | 696 | } |
| 721 | 697 | ||
| 722 | static inline struct bpf_binary_header * | 698 | static inline struct bpf_binary_header * |
| @@ -728,22 +704,6 @@ bpf_jit_binary_hdr(const struct bpf_prog *fp) | |||
| 728 | return (void *)addr; | 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 | int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap); | 707 | int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap); |
| 748 | static inline int sk_filter(struct sock *sk, struct sk_buff *skb) | 708 | static inline int sk_filter(struct sock *sk, struct sk_buff *skb) |
| 749 | { | 709 | { |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 5c91108846db..d78d146a98da 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1720,8 +1720,6 @@ struct file_operations { | |||
| 1720 | int (*iterate) (struct file *, struct dir_context *); | 1720 | int (*iterate) (struct file *, struct dir_context *); |
| 1721 | int (*iterate_shared) (struct file *, struct dir_context *); | 1721 | int (*iterate_shared) (struct file *, struct dir_context *); |
| 1722 | __poll_t (*poll) (struct file *, struct poll_table_struct *); | 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 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | 1723 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
| 1726 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); | 1724 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
| 1727 | int (*mmap) (struct file *, struct vm_area_struct *); | 1725 | int (*mmap) (struct file *, struct vm_area_struct *); |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 8154f4920fcb..ebb77674be90 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -223,7 +223,6 @@ extern enum ftrace_tracing_type_t ftrace_tracing_type; | |||
| 223 | */ | 223 | */ |
| 224 | int register_ftrace_function(struct ftrace_ops *ops); | 224 | int register_ftrace_function(struct ftrace_ops *ops); |
| 225 | int unregister_ftrace_function(struct ftrace_ops *ops); | 225 | int unregister_ftrace_function(struct ftrace_ops *ops); |
| 226 | void clear_ftrace_function(void); | ||
| 227 | 226 | ||
| 228 | extern void ftrace_stub(unsigned long a0, unsigned long a1, | 227 | extern void ftrace_stub(unsigned long a0, unsigned long a1, |
| 229 | struct ftrace_ops *op, struct pt_regs *regs); | 228 | struct ftrace_ops *op, struct pt_regs *regs); |
| @@ -239,7 +238,6 @@ static inline int ftrace_nr_registered_ops(void) | |||
| 239 | { | 238 | { |
| 240 | return 0; | 239 | return 0; |
| 241 | } | 240 | } |
| 242 | static inline void clear_ftrace_function(void) { } | ||
| 243 | static inline void ftrace_kill(void) { } | 241 | static inline void ftrace_kill(void) { } |
| 244 | static inline void ftrace_free_init_mem(void) { } | 242 | static inline void ftrace_free_init_mem(void) { } |
| 245 | static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { } | 243 | static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { } |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 41a3d5775394..773bcb1d4044 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -511,6 +511,7 @@ struct hid_output_fifo { | |||
| 511 | #define HID_STAT_ADDED BIT(0) | 511 | #define HID_STAT_ADDED BIT(0) |
| 512 | #define HID_STAT_PARSED BIT(1) | 512 | #define HID_STAT_PARSED BIT(1) |
| 513 | #define HID_STAT_DUP_DETECTED BIT(2) | 513 | #define HID_STAT_DUP_DETECTED BIT(2) |
| 514 | #define HID_STAT_REPROBED BIT(3) | ||
| 514 | 515 | ||
| 515 | struct hid_input { | 516 | struct hid_input { |
| 516 | struct list_head list; | 517 | struct list_head list; |
| @@ -579,7 +580,7 @@ struct hid_device { /* device report descriptor */ | |||
| 579 | bool battery_avoid_query; | 580 | bool battery_avoid_query; |
| 580 | #endif | 581 | #endif |
| 581 | 582 | ||
| 582 | unsigned int status; /* see STAT flags above */ | 583 | unsigned long status; /* see STAT flags above */ |
| 583 | unsigned claimed; /* Claimed by hidinput, hiddev? */ | 584 | unsigned claimed; /* Claimed by hidinput, hiddev? */ |
| 584 | unsigned quirks; /* Various quirks the device can pull on us */ | 585 | unsigned quirks; /* Various quirks the device can pull on us */ |
| 585 | bool io_started; /* If IO has started */ | 586 | bool io_started; /* If IO has started */ |
diff --git a/include/linux/iio/buffer-dma.h b/include/linux/iio/buffer-dma.h index 767467d886de..67c75372b691 100644 --- a/include/linux/iio/buffer-dma.h +++ b/include/linux/iio/buffer-dma.h | |||
| @@ -141,7 +141,7 @@ int iio_dma_buffer_read(struct iio_buffer *buffer, size_t n, | |||
| 141 | char __user *user_buffer); | 141 | char __user *user_buffer); |
| 142 | size_t iio_dma_buffer_data_available(struct iio_buffer *buffer); | 142 | size_t iio_dma_buffer_data_available(struct iio_buffer *buffer); |
| 143 | int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd); | 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 | int iio_dma_buffer_request_update(struct iio_buffer *buffer); | 145 | int iio_dma_buffer_request_update(struct iio_buffer *buffer); |
| 146 | 146 | ||
| 147 | int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, | 147 | int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, |
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h index d7188de4db96..3f4bf60b0bb5 100644 --- a/include/linux/input/mt.h +++ b/include/linux/input/mt.h | |||
| @@ -100,7 +100,7 @@ static inline bool input_is_mt_axis(int axis) | |||
| 100 | return axis == ABS_MT_SLOT || input_is_mt_value(axis); | 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 | unsigned int tool_type, bool active); | 104 | unsigned int tool_type, bool active); |
| 105 | 105 | ||
| 106 | void input_mt_report_finger_count(struct input_dev *dev, int count); | 106 | void input_mt_report_finger_count(struct input_dev *dev, int count); |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 2803264c512f..c1961761311d 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
| @@ -62,7 +62,6 @@ void *kthread_probe_data(struct task_struct *k); | |||
| 62 | int kthread_park(struct task_struct *k); | 62 | int kthread_park(struct task_struct *k); |
| 63 | void kthread_unpark(struct task_struct *k); | 63 | void kthread_unpark(struct task_struct *k); |
| 64 | void kthread_parkme(void); | 64 | void kthread_parkme(void); |
| 65 | void kthread_park_complete(struct task_struct *k); | ||
| 66 | 65 | ||
| 67 | int kthreadd(void *unused); | 66 | int kthreadd(void *unused); |
| 68 | extern struct task_struct *kthreadd_task; | 67 | extern struct task_struct *kthreadd_task; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 8b8946dd63b9..32f247cb5e9e 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -210,6 +210,7 @@ enum { | |||
| 210 | ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */ | 210 | ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */ |
| 211 | /* (doesn't imply presence) */ | 211 | /* (doesn't imply presence) */ |
| 212 | ATA_FLAG_SATA = (1 << 1), | 212 | ATA_FLAG_SATA = (1 << 1), |
| 213 | ATA_FLAG_NO_LPM = (1 << 2), /* host not happy with LPM */ | ||
| 213 | ATA_FLAG_NO_LOG_PAGE = (1 << 5), /* do not issue log page read */ | 214 | ATA_FLAG_NO_LOG_PAGE = (1 << 5), /* do not issue log page read */ |
| 214 | ATA_FLAG_NO_ATAPI = (1 << 6), /* No ATAPI support */ | 215 | ATA_FLAG_NO_ATAPI = (1 << 6), /* No ATAPI support */ |
| 215 | ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */ | 216 | ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */ |
| @@ -1495,6 +1496,29 @@ static inline bool ata_tag_valid(unsigned int tag) | |||
| 1495 | return tag < ATA_MAX_QUEUE || ata_tag_internal(tag); | 1496 | return tag < ATA_MAX_QUEUE || ata_tag_internal(tag); |
| 1496 | } | 1497 | } |
| 1497 | 1498 | ||
| 1499 | #define __ata_qc_for_each(ap, qc, tag, max_tag, fn) \ | ||
| 1500 | for ((tag) = 0; (tag) < (max_tag) && \ | ||
| 1501 | ({ qc = fn((ap), (tag)); 1; }); (tag)++) \ | ||
| 1502 | |||
| 1503 | /* | ||
| 1504 | * Internal use only, iterate commands ignoring error handling and | ||
| 1505 | * status of 'qc'. | ||
| 1506 | */ | ||
| 1507 | #define ata_qc_for_each_raw(ap, qc, tag) \ | ||
| 1508 | __ata_qc_for_each(ap, qc, tag, ATA_MAX_QUEUE, __ata_qc_from_tag) | ||
| 1509 | |||
| 1510 | /* | ||
| 1511 | * Iterate all potential commands that can be queued | ||
| 1512 | */ | ||
| 1513 | #define ata_qc_for_each(ap, qc, tag) \ | ||
| 1514 | __ata_qc_for_each(ap, qc, tag, ATA_MAX_QUEUE, ata_qc_from_tag) | ||
| 1515 | |||
| 1516 | /* | ||
| 1517 | * Like ata_qc_for_each, but with the internal tag included | ||
| 1518 | */ | ||
| 1519 | #define ata_qc_for_each_with_internal(ap, qc, tag) \ | ||
| 1520 | __ata_qc_for_each(ap, qc, tag, ATA_MAX_QUEUE + 1, ata_qc_from_tag) | ||
| 1521 | |||
| 1498 | /* | 1522 | /* |
| 1499 | * device helpers | 1523 | * device helpers |
| 1500 | */ | 1524 | */ |
diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h index d3c9db492b30..fab5121ffb8f 100644 --- a/include/linux/mlx5/eswitch.h +++ b/include/linux/mlx5/eswitch.h | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | 8 | ||
| 9 | #include <linux/mlx5/driver.h> | 9 | #include <linux/mlx5/driver.h> |
| 10 | 10 | ||
| 11 | #define MLX5_ESWITCH_MANAGER(mdev) MLX5_CAP_GEN(mdev, eswitch_manager) | ||
| 12 | |||
| 11 | enum { | 13 | enum { |
| 12 | SRIOV_NONE, | 14 | SRIOV_NONE, |
| 13 | SRIOV_LEGACY, | 15 | SRIOV_LEGACY, |
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 27134c4fcb76..ac281f5ec9b8 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h | |||
| @@ -922,7 +922,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { | |||
| 922 | u8 vnic_env_queue_counters[0x1]; | 922 | u8 vnic_env_queue_counters[0x1]; |
| 923 | u8 ets[0x1]; | 923 | u8 ets[0x1]; |
| 924 | u8 nic_flow_table[0x1]; | 924 | u8 nic_flow_table[0x1]; |
| 925 | u8 eswitch_flow_table[0x1]; | 925 | u8 eswitch_manager[0x1]; |
| 926 | u8 device_memory[0x1]; | 926 | u8 device_memory[0x1]; |
| 927 | u8 mcam_reg[0x1]; | 927 | u8 mcam_reg[0x1]; |
| 928 | u8 pcam_reg[0x1]; | 928 | u8 pcam_reg[0x1]; |
diff --git a/include/linux/net.h b/include/linux/net.h index 08b6eb964dd6..6554d3ba4396 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -147,7 +147,6 @@ struct proto_ops { | |||
| 147 | int (*getname) (struct socket *sock, | 147 | int (*getname) (struct socket *sock, |
| 148 | struct sockaddr *addr, | 148 | struct sockaddr *addr, |
| 149 | int peer); | 149 | int peer); |
| 150 | __poll_t (*poll_mask) (struct socket *sock, __poll_t events); | ||
| 151 | __poll_t (*poll) (struct file *file, struct socket *sock, | 150 | __poll_t (*poll) (struct file *file, struct socket *sock, |
| 152 | struct poll_table_struct *wait); | 151 | struct poll_table_struct *wait); |
| 153 | int (*ioctl) (struct socket *sock, unsigned int cmd, | 152 | int (*ioctl) (struct socket *sock, unsigned int cmd, |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3ec9850c7936..3d0cc0b5cec2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -2789,11 +2789,31 @@ static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, | |||
| 2789 | if (PTR_ERR(pp) != -EINPROGRESS) | 2789 | if (PTR_ERR(pp) != -EINPROGRESS) |
| 2790 | NAPI_GRO_CB(skb)->flush |= flush; | 2790 | NAPI_GRO_CB(skb)->flush |= flush; |
| 2791 | } | 2791 | } |
| 2792 | static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb, | ||
| 2793 | struct sk_buff **pp, | ||
| 2794 | int flush, | ||
| 2795 | struct gro_remcsum *grc) | ||
| 2796 | { | ||
| 2797 | if (PTR_ERR(pp) != -EINPROGRESS) { | ||
| 2798 | NAPI_GRO_CB(skb)->flush |= flush; | ||
| 2799 | skb_gro_remcsum_cleanup(skb, grc); | ||
| 2800 | skb->remcsum_offload = 0; | ||
| 2801 | } | ||
| 2802 | } | ||
| 2792 | #else | 2803 | #else |
| 2793 | static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush) | 2804 | static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush) |
| 2794 | { | 2805 | { |
| 2795 | NAPI_GRO_CB(skb)->flush |= flush; | 2806 | NAPI_GRO_CB(skb)->flush |= flush; |
| 2796 | } | 2807 | } |
| 2808 | static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb, | ||
| 2809 | struct sk_buff **pp, | ||
| 2810 | int flush, | ||
| 2811 | struct gro_remcsum *grc) | ||
| 2812 | { | ||
| 2813 | NAPI_GRO_CB(skb)->flush |= flush; | ||
| 2814 | skb_gro_remcsum_cleanup(skb, grc); | ||
| 2815 | skb->remcsum_offload = 0; | ||
| 2816 | } | ||
| 2797 | #endif | 2817 | #endif |
| 2798 | 2818 | ||
| 2799 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, | 2819 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 9206a4fef9ac..cb8d84090cfb 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
| @@ -234,7 +234,7 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); | |||
| 234 | int of_genpd_parse_idle_states(struct device_node *dn, | 234 | int of_genpd_parse_idle_states(struct device_node *dn, |
| 235 | struct genpd_power_state **states, int *n); | 235 | struct genpd_power_state **states, int *n); |
| 236 | unsigned int of_genpd_opp_to_performance_state(struct device *dev, | 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 | int genpd_dev_pm_attach(struct device *dev); | 239 | int genpd_dev_pm_attach(struct device *dev); |
| 240 | struct device *genpd_dev_pm_attach_by_id(struct device *dev, | 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, | |||
| 274 | 274 | ||
| 275 | static inline unsigned int | 275 | static inline unsigned int |
| 276 | of_genpd_opp_to_performance_state(struct device *dev, | 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 | static inline int genpd_dev_pm_attach(struct device *dev) | 282 | static inline int genpd_dev_pm_attach(struct device *dev) |
diff --git a/include/linux/poll.h b/include/linux/poll.h index fdf86b4cbc71..7e0fdcf905d2 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
| @@ -74,18 +74,18 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) | |||
| 74 | pt->_key = ~(__poll_t)0; /* all events enabled */ | 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 | struct poll_table_entry { | 89 | struct poll_table_entry { |
| 90 | struct file *filp; | 90 | struct file *filp; |
| 91 | __poll_t key; | 91 | __poll_t key; |
diff --git a/include/linux/rmi.h b/include/linux/rmi.h index 64125443f8a6..5ef5c7c412a7 100644 --- a/include/linux/rmi.h +++ b/include/linux/rmi.h | |||
| @@ -354,6 +354,8 @@ struct rmi_driver_data { | |||
| 354 | struct mutex irq_mutex; | 354 | struct mutex irq_mutex; |
| 355 | struct input_dev *input; | 355 | struct input_dev *input; |
| 356 | 356 | ||
| 357 | struct irq_domain *irqdomain; | ||
| 358 | |||
| 357 | u8 pdt_props; | 359 | u8 pdt_props; |
| 358 | 360 | ||
| 359 | u8 num_rx_electrodes; | 361 | u8 num_rx_electrodes; |
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 51f52020ad5f..093aa57120b0 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
| @@ -9,9 +9,6 @@ | |||
| 9 | #include <asm/io.h> | 9 | #include <asm/io.h> |
| 10 | 10 | ||
| 11 | struct scatterlist { | 11 | struct scatterlist { |
| 12 | #ifdef CONFIG_DEBUG_SG | ||
| 13 | unsigned long sg_magic; | ||
| 14 | #endif | ||
| 15 | unsigned long page_link; | 12 | unsigned long page_link; |
| 16 | unsigned int offset; | 13 | unsigned int offset; |
| 17 | unsigned int length; | 14 | unsigned int length; |
| @@ -64,7 +61,6 @@ struct sg_table { | |||
| 64 | * | 61 | * |
| 65 | */ | 62 | */ |
| 66 | 63 | ||
| 67 | #define SG_MAGIC 0x87654321 | ||
| 68 | #define SG_CHAIN 0x01UL | 64 | #define SG_CHAIN 0x01UL |
| 69 | #define SG_END 0x02UL | 65 | #define SG_END 0x02UL |
| 70 | 66 | ||
| @@ -98,7 +94,6 @@ static inline void sg_assign_page(struct scatterlist *sg, struct page *page) | |||
| 98 | */ | 94 | */ |
| 99 | BUG_ON((unsigned long) page & (SG_CHAIN | SG_END)); | 95 | BUG_ON((unsigned long) page & (SG_CHAIN | SG_END)); |
| 100 | #ifdef CONFIG_DEBUG_SG | 96 | #ifdef CONFIG_DEBUG_SG |
| 101 | BUG_ON(sg->sg_magic != SG_MAGIC); | ||
| 102 | BUG_ON(sg_is_chain(sg)); | 97 | BUG_ON(sg_is_chain(sg)); |
| 103 | #endif | 98 | #endif |
| 104 | sg->page_link = page_link | (unsigned long) page; | 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, | |||
| 129 | static inline struct page *sg_page(struct scatterlist *sg) | 124 | static inline struct page *sg_page(struct scatterlist *sg) |
| 130 | { | 125 | { |
| 131 | #ifdef CONFIG_DEBUG_SG | 126 | #ifdef CONFIG_DEBUG_SG |
| 132 | BUG_ON(sg->sg_magic != SG_MAGIC); | ||
| 133 | BUG_ON(sg_is_chain(sg)); | 127 | BUG_ON(sg_is_chain(sg)); |
| 134 | #endif | 128 | #endif |
| 135 | return (struct page *)((sg)->page_link & ~(SG_CHAIN | SG_END)); | 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, | |||
| 195 | **/ | 189 | **/ |
| 196 | static inline void sg_mark_end(struct scatterlist *sg) | 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 | * Set termination bit, clear potential chain bit | 193 | * Set termination bit, clear potential chain bit |
| 203 | */ | 194 | */ |
| @@ -215,9 +206,6 @@ static inline void sg_mark_end(struct scatterlist *sg) | |||
| 215 | **/ | 206 | **/ |
| 216 | static inline void sg_unmark_end(struct scatterlist *sg) | 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 | sg->page_link &= ~SG_END; | 209 | sg->page_link &= ~SG_END; |
| 222 | } | 210 | } |
| 223 | 211 | ||
| @@ -260,12 +248,6 @@ static inline void *sg_virt(struct scatterlist *sg) | |||
| 260 | static inline void sg_init_marker(struct scatterlist *sgl, | 248 | static inline void sg_init_marker(struct scatterlist *sgl, |
| 261 | unsigned int nents) | 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 | sg_mark_end(&sgl[nents - 1]); | 251 | sg_mark_end(&sgl[nents - 1]); |
| 270 | } | 252 | } |
| 271 | 253 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 9256118bd40c..43731fe51c97 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -118,7 +118,7 @@ struct task_group; | |||
| 118 | * the comment with set_special_state(). | 118 | * the comment with set_special_state(). |
| 119 | */ | 119 | */ |
| 120 | #define is_special_task_state(state) \ | 120 | #define is_special_task_state(state) \ |
| 121 | ((state) & (__TASK_STOPPED | __TASK_TRACED | TASK_DEAD)) | 121 | ((state) & (__TASK_STOPPED | __TASK_TRACED | TASK_PARKED | TASK_DEAD)) |
| 122 | 122 | ||
| 123 | #define __set_current_state(state_value) \ | 123 | #define __set_current_state(state_value) \ |
| 124 | do { \ | 124 | do { \ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index c86885954994..164cdedf6012 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -3252,7 +3252,8 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, | |||
| 3252 | int *peeked, int *off, int *err); | 3252 | int *peeked, int *off, int *err); |
| 3253 | struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, | 3253 | struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, |
| 3254 | int *err); | 3254 | int *err); |
| 3255 | __poll_t datagram_poll_mask(struct socket *sock, __poll_t events); | 3255 | __poll_t datagram_poll(struct file *file, struct socket *sock, |
| 3256 | struct poll_table_struct *wait); | ||
| 3256 | int skb_copy_datagram_iter(const struct sk_buff *from, int offset, | 3257 | int skb_copy_datagram_iter(const struct sk_buff *from, int offset, |
| 3257 | struct iov_iter *to, int size); | 3258 | struct iov_iter *to, int size); |
| 3258 | static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset, | 3259 | static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset, |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 09fa2c6f0e68..3a1a1dbc6f49 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -155,8 +155,12 @@ struct kmem_cache { | |||
| 155 | 155 | ||
| 156 | #ifdef CONFIG_SYSFS | 156 | #ifdef CONFIG_SYSFS |
| 157 | #define SLAB_SUPPORTS_SYSFS | 157 | #define SLAB_SUPPORTS_SYSFS |
| 158 | void sysfs_slab_unlink(struct kmem_cache *); | ||
| 158 | void sysfs_slab_release(struct kmem_cache *); | 159 | void sysfs_slab_release(struct kmem_cache *); |
| 159 | #else | 160 | #else |
| 161 | static inline void sysfs_slab_unlink(struct kmem_cache *s) | ||
| 162 | { | ||
| 163 | } | ||
| 160 | static inline void sysfs_slab_release(struct kmem_cache *s) | 164 | static inline void sysfs_slab_release(struct kmem_cache *s) |
| 161 | { | 165 | { |
| 162 | } | 166 | } |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 73810808cdf2..a368a68cb667 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -231,6 +231,9 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) | |||
| 231 | */ | 231 | */ |
| 232 | #ifndef __SYSCALL_DEFINEx | 232 | #ifndef __SYSCALL_DEFINEx |
| 233 | #define __SYSCALL_DEFINEx(x, name, ...) \ | 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 | asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ | 237 | asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ |
| 235 | __attribute__((alias(__stringify(__se_sys##name)))); \ | 238 | __attribute__((alias(__stringify(__se_sys##name)))); \ |
| 236 | ALLOW_ERROR_INJECTION(sys##name, ERRNO); \ | 239 | ALLOW_ERROR_INJECTION(sys##name, ERRNO); \ |
| @@ -243,6 +246,7 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) | |||
| 243 | __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ | 246 | __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ |
| 244 | return ret; \ | 247 | return ret; \ |
| 245 | } \ | 248 | } \ |
| 249 | __diag_pop(); \ | ||
| 246 | static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) | 250 | static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) |
| 247 | #endif /* __SYSCALL_DEFINEx */ | 251 | #endif /* __SYSCALL_DEFINEx */ |
| 248 | 252 | ||
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h index 6c5f2074e14f..6f8b68cd460f 100644 --- a/include/linux/uio_driver.h +++ b/include/linux/uio_driver.h | |||
| @@ -75,7 +75,7 @@ struct uio_device { | |||
| 75 | struct fasync_struct *async_queue; | 75 | struct fasync_struct *async_queue; |
| 76 | wait_queue_head_t wait; | 76 | wait_queue_head_t wait; |
| 77 | struct uio_info *info; | 77 | struct uio_info *info; |
| 78 | spinlock_t info_lock; | 78 | struct mutex info_lock; |
| 79 | struct kobject *map_dir; | 79 | struct kobject *map_dir; |
| 80 | struct kobject *portio_dir; | 80 | struct kobject *portio_dir; |
| 81 | }; | 81 | }; |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 53ce8176c313..ec9d6bc65855 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -271,7 +271,7 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, | |||
| 271 | int flags); | 271 | int flags); |
| 272 | int bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg, | 272 | int bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg, |
| 273 | size_t len, int flags); | 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 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 275 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 276 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); | 276 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); |
| 277 | int bt_sock_wait_ready(struct sock *sk, unsigned long flags); | 277 | int bt_sock_wait_ready(struct sock *sk, unsigned long flags); |
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h index b0eaeb02d46d..f4c21b5a1242 100644 --- a/include/net/iucv/af_iucv.h +++ b/include/net/iucv/af_iucv.h | |||
| @@ -153,6 +153,8 @@ struct iucv_sock_list { | |||
| 153 | atomic_t autobind_name; | 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 | void iucv_sock_link(struct iucv_sock_list *l, struct sock *s); | 158 | void iucv_sock_link(struct iucv_sock_list *l, struct sock *s); |
| 157 | void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s); | 159 | void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s); |
| 158 | void iucv_accept_enqueue(struct sock *parent, struct sock *sk); | 160 | void iucv_accept_enqueue(struct sock *parent, struct sock *sk); |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 47e35cce3b64..a71264d75d7f 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -128,6 +128,7 @@ struct net { | |||
| 128 | #endif | 128 | #endif |
| 129 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) | 129 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) |
| 130 | struct netns_nf_frag nf_frag; | 130 | struct netns_nf_frag nf_frag; |
| 131 | struct ctl_table_header *nf_frag_frags_hdr; | ||
| 131 | #endif | 132 | #endif |
| 132 | struct sock *nfnl; | 133 | struct sock *nfnl; |
| 133 | struct sock *nfnl_stash; | 134 | struct sock *nfnl_stash; |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index c978a31b0f84..762ac9931b62 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
| @@ -109,7 +109,6 @@ struct netns_ipv6 { | |||
| 109 | 109 | ||
| 110 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) | 110 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) |
| 111 | struct netns_nf_frag { | 111 | struct netns_nf_frag { |
| 112 | struct netns_sysctl_ipv6 sysctl; | ||
| 113 | struct netns_frags frags; | 112 | struct netns_frags frags; |
| 114 | }; | 113 | }; |
| 115 | #endif | 114 | #endif |
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index a3c1a2c47cd4..20b059574e60 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h | |||
| @@ -111,6 +111,11 @@ void tcf_block_put_ext(struct tcf_block *block, struct Qdisc *q, | |||
| 111 | { | 111 | { |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | static inline bool tcf_block_shared(struct tcf_block *block) | ||
| 115 | { | ||
| 116 | return false; | ||
| 117 | } | ||
| 118 | |||
| 114 | static inline struct Qdisc *tcf_block_q(struct tcf_block *block) | 119 | static inline struct Qdisc *tcf_block_q(struct tcf_block *block) |
| 115 | { | 120 | { |
| 116 | return NULL; | 121 | return NULL; |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 30b3e2fe240a..8c2caa370e0f 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -109,7 +109,8 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); | |||
| 109 | int sctp_inet_listen(struct socket *sock, int backlog); | 109 | int sctp_inet_listen(struct socket *sock, int backlog); |
| 110 | void sctp_write_space(struct sock *sk); | 110 | void sctp_write_space(struct sock *sk); |
| 111 | void sctp_data_ready(struct sock *sk); | 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 | void sctp_sock_rfree(struct sk_buff *skb); | 114 | void sctp_sock_rfree(struct sk_buff *skb); |
| 114 | void sctp_copy_sock(struct sock *newsk, struct sock *sk, | 115 | void sctp_copy_sock(struct sock *newsk, struct sock *sk, |
| 115 | struct sctp_association *asoc); | 116 | struct sctp_association *asoc); |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 0448e7c5d2b4..800582b5dd54 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -388,7 +388,8 @@ bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst); | |||
| 388 | void tcp_close(struct sock *sk, long timeout); | 388 | void tcp_close(struct sock *sk, long timeout); |
| 389 | void tcp_init_sock(struct sock *sk); | 389 | void tcp_init_sock(struct sock *sk); |
| 390 | void tcp_init_transfer(struct sock *sk, int bpf_op); | 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 | int tcp_getsockopt(struct sock *sk, int level, int optname, | 393 | int tcp_getsockopt(struct sock *sk, int level, int optname, |
| 393 | char __user *optval, int __user *optlen); | 394 | char __user *optval, int __user *optlen); |
| 394 | int tcp_setsockopt(struct sock *sk, int level, int optname, | 395 | int tcp_setsockopt(struct sock *sk, int level, int optname, |
diff --git a/include/net/tls.h b/include/net/tls.h index 7f84ea3e217c..70c273777fe9 100644 --- a/include/net/tls.h +++ b/include/net/tls.h | |||
| @@ -109,7 +109,8 @@ struct tls_sw_context_rx { | |||
| 109 | 109 | ||
| 110 | struct strparser strp; | 110 | struct strparser strp; |
| 111 | void (*saved_data_ready)(struct sock *sk); | 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 | struct sk_buff *recv_pkt; | 114 | struct sk_buff *recv_pkt; |
| 114 | u8 control; | 115 | u8 control; |
| 115 | bool decrypted; | 116 | bool decrypted; |
| @@ -224,7 +225,8 @@ void tls_sw_free_resources_tx(struct sock *sk); | |||
| 224 | void tls_sw_free_resources_rx(struct sock *sk); | 225 | void tls_sw_free_resources_rx(struct sock *sk); |
| 225 | int tls_sw_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, | 226 | int tls_sw_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, |
| 226 | int nonblock, int flags, int *addr_len); | 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 | ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos, | 230 | ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos, |
| 229 | struct pipe_inode_info *pipe, | 231 | struct pipe_inode_info *pipe, |
| 230 | size_t len, unsigned int flags); | 232 | size_t len, unsigned int flags); |
diff --git a/include/net/udp.h b/include/net/udp.h index b1ea8b0f5e6a..81afdacd4fff 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
| @@ -285,7 +285,7 @@ int udp_init_sock(struct sock *sk); | |||
| 285 | int udp_pre_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); | 285 | int udp_pre_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); |
| 286 | int __udp_disconnect(struct sock *sk, int flags); | 286 | int __udp_disconnect(struct sock *sk, int flags); |
| 287 | int udp_disconnect(struct sock *sk, int flags); | 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 | struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, | 289 | struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, |
| 290 | netdev_features_t features, | 290 | netdev_features_t features, |
| 291 | bool is_ipv6); | 291 | bool is_ipv6); |
diff --git a/include/uapi/linux/aio_abi.h b/include/uapi/linux/aio_abi.h index d00221345c19..3c5038b587ba 100644 --- a/include/uapi/linux/aio_abi.h +++ b/include/uapi/linux/aio_abi.h | |||
| @@ -39,8 +39,10 @@ enum { | |||
| 39 | IOCB_CMD_PWRITE = 1, | 39 | IOCB_CMD_PWRITE = 1, |
| 40 | IOCB_CMD_FSYNC = 2, | 40 | IOCB_CMD_FSYNC = 2, |
| 41 | IOCB_CMD_FDSYNC = 3, | 41 | IOCB_CMD_FDSYNC = 3, |
| 42 | /* 4 was the experimental IOCB_CMD_PREADX */ | 42 | /* These two are experimental. |
| 43 | IOCB_CMD_POLL = 5, | 43 | * IOCB_CMD_PREADX = 4, |
| 44 | * IOCB_CMD_POLL = 5, | ||
| 45 | */ | ||
| 44 | IOCB_CMD_NOOP = 6, | 46 | IOCB_CMD_NOOP = 6, |
| 45 | IOCB_CMD_PREADV = 7, | 47 | IOCB_CMD_PREADV = 7, |
| 46 | IOCB_CMD_PWRITEV = 8, | 48 | IOCB_CMD_PWRITEV = 8, |
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 59b19b6a40d7..b7db3261c62d 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h | |||
| @@ -1857,7 +1857,8 @@ union bpf_attr { | |||
| 1857 | * is resolved), the nexthop address is returned in ipv4_dst | 1857 | * is resolved), the nexthop address is returned in ipv4_dst |
| 1858 | * or ipv6_dst based on family, smac is set to mac address of | 1858 | * or ipv6_dst based on family, smac is set to mac address of |
| 1859 | * egress device, dmac is set to nexthop mac address, rt_metric | 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 | * *plen* argument is the size of the passed in struct. | 1863 | * *plen* argument is the size of the passed in struct. |
| 1863 | * *flags* argument can be a combination of one or more of the | 1864 | * *flags* argument can be a combination of one or more of the |
| @@ -1873,9 +1874,10 @@ union bpf_attr { | |||
| 1873 | * *ctx* is either **struct xdp_md** for XDP programs or | 1874 | * *ctx* is either **struct xdp_md** for XDP programs or |
| 1874 | * **struct sk_buff** tc cls_act programs. | 1875 | * **struct sk_buff** tc cls_act programs. |
| 1875 | * Return | 1876 | * Return |
| 1876 | * Egress device index on success, 0 if packet needs to continue | 1877 | * * < 0 if any input argument is invalid |
| 1877 | * up the stack for further processing or a negative error in case | 1878 | * * 0 on success (packet is forwarded, nexthop neighbor exists) |
| 1878 | * of failure. | 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 | * int bpf_sock_hash_update(struct bpf_sock_ops_kern *skops, struct bpf_map *map, void *key, u64 flags) | 1882 | * int bpf_sock_hash_update(struct bpf_sock_ops_kern *skops, struct bpf_map *map, void *key, u64 flags) |
| 1881 | * Description | 1883 | * Description |
| @@ -2612,6 +2614,18 @@ struct bpf_raw_tracepoint_args { | |||
| 2612 | #define BPF_FIB_LOOKUP_DIRECT BIT(0) | 2614 | #define BPF_FIB_LOOKUP_DIRECT BIT(0) |
| 2613 | #define BPF_FIB_LOOKUP_OUTPUT BIT(1) | 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 | struct bpf_fib_lookup { | 2629 | struct bpf_fib_lookup { |
| 2616 | /* input: network family for lookup (AF_INET, AF_INET6) | 2630 | /* input: network family for lookup (AF_INET, AF_INET6) |
| 2617 | * output: network family of egress nexthop | 2631 | * output: network family of egress nexthop |
| @@ -2625,7 +2639,11 @@ struct bpf_fib_lookup { | |||
| 2625 | 2639 | ||
| 2626 | /* total length of packet from network header - used for MTU check */ | 2640 | /* total length of packet from network header - used for MTU check */ |
| 2627 | __u16 tot_len; | 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 | union { | 2648 | union { |
| 2631 | /* inputs to lookup */ | 2649 | /* inputs to lookup */ |
diff --git a/include/uapi/linux/target_core_user.h b/include/uapi/linux/target_core_user.h index 6e299349b158..b7b57967d90f 100644 --- a/include/uapi/linux/target_core_user.h +++ b/include/uapi/linux/target_core_user.h | |||
| @@ -44,6 +44,7 @@ | |||
| 44 | #define TCMU_MAILBOX_VERSION 2 | 44 | #define TCMU_MAILBOX_VERSION 2 |
| 45 | #define ALIGN_SIZE 64 /* Should be enough for most CPUs */ | 45 | #define ALIGN_SIZE 64 /* Should be enough for most CPUs */ |
| 46 | #define TCMU_MAILBOX_FLAG_CAP_OOOC (1 << 0) /* Out-of-order completions */ | 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 | struct tcmu_mailbox { | 49 | struct tcmu_mailbox { |
| 49 | __u16 version; | 50 | __u16 version; |
| @@ -71,6 +72,7 @@ struct tcmu_cmd_entry_hdr { | |||
| 71 | __u16 cmd_id; | 72 | __u16 cmd_id; |
| 72 | __u8 kflags; | 73 | __u8 kflags; |
| 73 | #define TCMU_UFLAG_UNKNOWN_OP 0x1 | 74 | #define TCMU_UFLAG_UNKNOWN_OP 0x1 |
| 75 | #define TCMU_UFLAG_READ_LEN 0x2 | ||
| 74 | __u8 uflags; | 76 | __u8 uflags; |
| 75 | 77 | ||
| 76 | } __packed; | 78 | } __packed; |
| @@ -119,7 +121,7 @@ struct tcmu_cmd_entry { | |||
| 119 | __u8 scsi_status; | 121 | __u8 scsi_status; |
| 120 | __u8 __pad1; | 122 | __u8 __pad1; |
| 121 | __u16 __pad2; | 123 | __u16 __pad2; |
| 122 | __u32 __pad3; | 124 | __u32 read_len; |
| 123 | char sense_buffer[TCMU_SENSE_BUFFERSIZE]; | 125 | char sense_buffer[TCMU_SENSE_BUFFERSIZE]; |
| 124 | } rsp; | 126 | } rsp; |
| 125 | }; | 127 | }; |
diff --git a/init/Kconfig b/init/Kconfig index fde3d09e8b27..041f3a022122 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
| @@ -1051,10 +1051,9 @@ config LD_DEAD_CODE_DATA_ELIMINATION | |||
| 1051 | depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION | 1051 | depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION |
| 1052 | depends on EXPERT | 1052 | depends on EXPERT |
| 1053 | help | 1053 | help |
| 1054 | Select this if the architecture wants to do dead code and | 1054 | Enable this if you want to do dead code and data elimination with |
| 1055 | data elimination with the linker by compiling with | 1055 | the linker by compiling with -ffunction-sections -fdata-sections, |
| 1056 | -ffunction-sections -fdata-sections, and linking with | 1056 | and linking with --gc-sections. |
| 1057 | --gc-sections. | ||
| 1058 | 1057 | ||
| 1059 | This can reduce on disk and in-memory size of the kernel | 1058 | This can reduce on disk and in-memory size of the kernel |
| 1060 | code and static data, particularly for small configs and | 1059 | code and static data, particularly for small configs and |
diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c index f7c00bd6f8e4..3d83ee7df381 100644 --- a/kernel/bpf/cgroup.c +++ b/kernel/bpf/cgroup.c | |||
| @@ -428,6 +428,60 @@ int __cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr, | |||
| 428 | return ret; | 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 | * __cgroup_bpf_run_filter_skb() - Run a program for packet filtering | 486 | * __cgroup_bpf_run_filter_skb() - Run a program for packet filtering |
| 433 | * @sk: The socket sending or receiving traffic | 487 | * @sk: The socket sending or receiving traffic |
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index a9e6c04d0f4a..1e5625d46414 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c | |||
| @@ -598,8 +598,6 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr, | |||
| 598 | bpf_fill_ill_insns(hdr, size); | 598 | bpf_fill_ill_insns(hdr, size); |
| 599 | 599 | ||
| 600 | hdr->pages = size / PAGE_SIZE; | 600 | hdr->pages = size / PAGE_SIZE; |
| 601 | hdr->locked = 0; | ||
| 602 | |||
| 603 | hole = min_t(unsigned int, size - (proglen + sizeof(*hdr)), | 601 | hole = min_t(unsigned int, size - (proglen + sizeof(*hdr)), |
| 604 | PAGE_SIZE - sizeof(*hdr)); | 602 | PAGE_SIZE - sizeof(*hdr)); |
| 605 | start = (get_random_int() % hole) & ~(alignment - 1); | 603 | start = (get_random_int() % hole) & ~(alignment - 1); |
| @@ -1450,22 +1448,6 @@ static int bpf_check_tail_call(const struct bpf_prog *fp) | |||
| 1450 | return 0; | 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 | static void bpf_prog_select_func(struct bpf_prog *fp) | 1451 | static void bpf_prog_select_func(struct bpf_prog *fp) |
| 1470 | { | 1452 | { |
| 1471 | #ifndef CONFIG_BPF_JIT_ALWAYS_ON | 1453 | #ifndef CONFIG_BPF_JIT_ALWAYS_ON |
| @@ -1524,17 +1506,7 @@ finalize: | |||
| 1524 | * all eBPF JITs might immediately support all features. | 1506 | * all eBPF JITs might immediately support all features. |
| 1525 | */ | 1507 | */ |
| 1526 | *err = bpf_check_tail_call(fp); | 1508 | *err = bpf_check_tail_call(fp); |
| 1527 | if (*err) | 1509 | |
| 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); | ||
| 1538 | return fp; | 1510 | return fp; |
| 1539 | } | 1511 | } |
| 1540 | EXPORT_SYMBOL_GPL(bpf_prog_select_runtime); | 1512 | EXPORT_SYMBOL_GPL(bpf_prog_select_runtime); |
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c index 52a91d816c0e..cf7b6a6dbd1f 100644 --- a/kernel/bpf/sockmap.c +++ b/kernel/bpf/sockmap.c | |||
| @@ -72,6 +72,7 @@ struct bpf_htab { | |||
| 72 | u32 n_buckets; | 72 | u32 n_buckets; |
| 73 | u32 elem_size; | 73 | u32 elem_size; |
| 74 | struct bpf_sock_progs progs; | 74 | struct bpf_sock_progs progs; |
| 75 | struct rcu_head rcu; | ||
| 75 | }; | 76 | }; |
| 76 | 77 | ||
| 77 | struct htab_elem { | 78 | struct htab_elem { |
| @@ -89,8 +90,8 @@ enum smap_psock_state { | |||
| 89 | struct smap_psock_map_entry { | 90 | struct smap_psock_map_entry { |
| 90 | struct list_head list; | 91 | struct list_head list; |
| 91 | struct sock **entry; | 92 | struct sock **entry; |
| 92 | struct htab_elem *hash_link; | 93 | struct htab_elem __rcu *hash_link; |
| 93 | struct bpf_htab *htab; | 94 | struct bpf_htab __rcu *htab; |
| 94 | }; | 95 | }; |
| 95 | 96 | ||
| 96 | struct smap_psock { | 97 | struct smap_psock { |
| @@ -120,6 +121,7 @@ struct smap_psock { | |||
| 120 | struct bpf_prog *bpf_parse; | 121 | struct bpf_prog *bpf_parse; |
| 121 | struct bpf_prog *bpf_verdict; | 122 | struct bpf_prog *bpf_verdict; |
| 122 | struct list_head maps; | 123 | struct list_head maps; |
| 124 | spinlock_t maps_lock; | ||
| 123 | 125 | ||
| 124 | /* Back reference used when sock callback trigger sockmap operations */ | 126 | /* Back reference used when sock callback trigger sockmap operations */ |
| 125 | struct sock *sock; | 127 | struct sock *sock; |
| @@ -140,6 +142,7 @@ static int bpf_tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, | |||
| 140 | static int bpf_tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size); | 142 | static int bpf_tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size); |
| 141 | static int bpf_tcp_sendpage(struct sock *sk, struct page *page, | 143 | static int bpf_tcp_sendpage(struct sock *sk, struct page *page, |
| 142 | int offset, size_t size, int flags); | 144 | int offset, size_t size, int flags); |
| 145 | static void bpf_tcp_close(struct sock *sk, long timeout); | ||
| 143 | 146 | ||
| 144 | static inline struct smap_psock *smap_psock_sk(const struct sock *sk) | 147 | static inline struct smap_psock *smap_psock_sk(const struct sock *sk) |
| 145 | { | 148 | { |
| @@ -161,7 +164,42 @@ out: | |||
| 161 | return !empty; | 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 | static int bpf_tcp_init(struct sock *sk) | 203 | static int bpf_tcp_init(struct sock *sk) |
| 166 | { | 204 | { |
| 167 | struct smap_psock *psock; | 205 | struct smap_psock *psock; |
| @@ -181,14 +219,17 @@ static int bpf_tcp_init(struct sock *sk) | |||
| 181 | psock->save_close = sk->sk_prot->close; | 219 | psock->save_close = sk->sk_prot->close; |
| 182 | psock->sk_proto = sk->sk_prot; | 220 | psock->sk_proto = sk->sk_prot; |
| 183 | 221 | ||
| 184 | if (psock->bpf_tx_msg) { | 222 | /* Build IPv6 sockmap whenever the address of tcpv6_prot changes */ |
| 185 | tcp_bpf_proto.sendmsg = bpf_tcp_sendmsg; | 223 | if (sk->sk_family == AF_INET6 && |
| 186 | tcp_bpf_proto.sendpage = bpf_tcp_sendpage; | 224 | unlikely(sk->sk_prot != smp_load_acquire(&saved_tcpv6_prot))) { |
| 187 | tcp_bpf_proto.recvmsg = bpf_tcp_recvmsg; | 225 | spin_lock_bh(&tcpv6_prot_lock); |
| 188 | tcp_bpf_proto.stream_memory_read = bpf_tcp_stream_read; | 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 | 232 | update_sk_prot(sk, psock); | |
| 191 | sk->sk_prot = &tcp_bpf_proto; | ||
| 192 | rcu_read_unlock(); | 233 | rcu_read_unlock(); |
| 193 | return 0; | 234 | return 0; |
| 194 | } | 235 | } |
| @@ -219,16 +260,54 @@ out: | |||
| 219 | rcu_read_unlock(); | 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 | static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l) | 286 | static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l) |
| 223 | { | 287 | { |
| 224 | atomic_dec(&htab->count); | 288 | atomic_dec(&htab->count); |
| 225 | kfree_rcu(l, rcu); | 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 | static void bpf_tcp_close(struct sock *sk, long timeout) | 307 | static void bpf_tcp_close(struct sock *sk, long timeout) |
| 229 | { | 308 | { |
| 230 | void (*close_fun)(struct sock *sk, long timeout); | 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 | struct sk_msg_buff *md, *mtmp; | 311 | struct sk_msg_buff *md, *mtmp; |
| 233 | struct smap_psock *psock; | 312 | struct smap_psock *psock; |
| 234 | struct sock *osk; | 313 | struct sock *osk; |
| @@ -247,7 +326,6 @@ static void bpf_tcp_close(struct sock *sk, long timeout) | |||
| 247 | */ | 326 | */ |
| 248 | close_fun = psock->save_close; | 327 | close_fun = psock->save_close; |
| 249 | 328 | ||
| 250 | write_lock_bh(&sk->sk_callback_lock); | ||
| 251 | if (psock->cork) { | 329 | if (psock->cork) { |
| 252 | free_start_sg(psock->sock, psock->cork); | 330 | free_start_sg(psock->sock, psock->cork); |
| 253 | kfree(psock->cork); | 331 | kfree(psock->cork); |
| @@ -260,20 +338,38 @@ static void bpf_tcp_close(struct sock *sk, long timeout) | |||
| 260 | kfree(md); | 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 | if (e->entry) { | 343 | if (e->entry) { |
| 265 | osk = cmpxchg(e->entry, sk, NULL); | 344 | osk = cmpxchg(e->entry, sk, NULL); |
| 266 | if (osk == sk) { | 345 | if (osk == sk) { |
| 267 | list_del(&e->list); | ||
| 268 | smap_release_sock(psock, sk); | 346 | smap_release_sock(psock, sk); |
| 269 | } | 347 | } |
| 270 | } else { | 348 | } else { |
| 271 | hlist_del_rcu(&e->hash_link->hash_node); | 349 | struct htab_elem *link = rcu_dereference(e->hash_link); |
| 272 | smap_release_sock(psock, e->hash_link->sk); | 350 | struct bpf_htab *htab = rcu_dereference(e->htab); |
| 273 | free_htab_elem(e->htab, e->hash_link); | 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 | rcu_read_unlock(); | 373 | rcu_read_unlock(); |
| 278 | close_fun(sk, timeout); | 374 | close_fun(sk, timeout); |
| 279 | } | 375 | } |
| @@ -1111,8 +1207,7 @@ static void bpf_tcp_msg_add(struct smap_psock *psock, | |||
| 1111 | 1207 | ||
| 1112 | static int bpf_tcp_ulp_register(void) | 1208 | static int bpf_tcp_ulp_register(void) |
| 1113 | { | 1209 | { |
| 1114 | tcp_bpf_proto = tcp_prot; | 1210 | build_protos(bpf_tcp_prots[SOCKMAP_IPV4], &tcp_prot); |
| 1115 | tcp_bpf_proto.close = bpf_tcp_close; | ||
| 1116 | /* Once BPF TX ULP is registered it is never unregistered. It | 1211 | /* Once BPF TX ULP is registered it is never unregistered. It |
| 1117 | * will be in the ULP list for the lifetime of the system. Doing | 1212 | * will be in the ULP list for the lifetime of the system. Doing |
| 1118 | * duplicate registers is not a problem. | 1213 | * duplicate registers is not a problem. |
| @@ -1357,7 +1452,9 @@ static void smap_release_sock(struct smap_psock *psock, struct sock *sock) | |||
| 1357 | { | 1452 | { |
| 1358 | if (refcount_dec_and_test(&psock->refcnt)) { | 1453 | if (refcount_dec_and_test(&psock->refcnt)) { |
| 1359 | tcp_cleanup_ulp(sock); | 1454 | tcp_cleanup_ulp(sock); |
| 1455 | write_lock_bh(&sock->sk_callback_lock); | ||
| 1360 | smap_stop_sock(psock, sock); | 1456 | smap_stop_sock(psock, sock); |
| 1457 | write_unlock_bh(&sock->sk_callback_lock); | ||
| 1361 | clear_bit(SMAP_TX_RUNNING, &psock->state); | 1458 | clear_bit(SMAP_TX_RUNNING, &psock->state); |
| 1362 | rcu_assign_sk_user_data(sock, NULL); | 1459 | rcu_assign_sk_user_data(sock, NULL); |
| 1363 | call_rcu_sched(&psock->rcu, smap_destroy_psock); | 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) | |||
| 1508 | INIT_LIST_HEAD(&psock->maps); | 1605 | INIT_LIST_HEAD(&psock->maps); |
| 1509 | INIT_LIST_HEAD(&psock->ingress); | 1606 | INIT_LIST_HEAD(&psock->ingress); |
| 1510 | refcount_set(&psock->refcnt, 1); | 1607 | refcount_set(&psock->refcnt, 1); |
| 1608 | spin_lock_init(&psock->maps_lock); | ||
| 1511 | 1609 | ||
| 1512 | rcu_assign_sk_user_data(sock, psock); | 1610 | rcu_assign_sk_user_data(sock, psock); |
| 1513 | sock_hold(sock); | 1611 | sock_hold(sock); |
| @@ -1564,18 +1662,32 @@ free_stab: | |||
| 1564 | return ERR_PTR(err); | 1662 | return ERR_PTR(err); |
| 1565 | } | 1663 | } |
| 1566 | 1664 | ||
| 1567 | static void smap_list_remove(struct smap_psock *psock, | 1665 | static void smap_list_map_remove(struct smap_psock *psock, |
| 1568 | struct sock **entry, | 1666 | struct sock **entry) |
| 1569 | struct htab_elem *hash_link) | ||
| 1570 | { | 1667 | { |
| 1571 | struct smap_psock_map_entry *e, *tmp; | 1668 | struct smap_psock_map_entry *e, *tmp; |
| 1572 | 1669 | ||
| 1670 | spin_lock_bh(&psock->maps_lock); | ||
| 1573 | list_for_each_entry_safe(e, tmp, &psock->maps, list) { | 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 | list_del(&e->list); | 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 | static void sock_map_free(struct bpf_map *map) | 1693 | static void sock_map_free(struct bpf_map *map) |
| @@ -1601,7 +1713,6 @@ static void sock_map_free(struct bpf_map *map) | |||
| 1601 | if (!sock) | 1713 | if (!sock) |
| 1602 | continue; | 1714 | continue; |
| 1603 | 1715 | ||
| 1604 | write_lock_bh(&sock->sk_callback_lock); | ||
| 1605 | psock = smap_psock_sk(sock); | 1716 | psock = smap_psock_sk(sock); |
| 1606 | /* This check handles a racing sock event that can get the | 1717 | /* This check handles a racing sock event that can get the |
| 1607 | * sk_callback_lock before this case but after xchg happens | 1718 | * sk_callback_lock before this case but after xchg happens |
| @@ -1609,10 +1720,9 @@ static void sock_map_free(struct bpf_map *map) | |||
| 1609 | * to be null and queued for garbage collection. | 1720 | * to be null and queued for garbage collection. |
| 1610 | */ | 1721 | */ |
| 1611 | if (likely(psock)) { | 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 | smap_release_sock(psock, sock); | 1724 | smap_release_sock(psock, sock); |
| 1614 | } | 1725 | } |
| 1615 | write_unlock_bh(&sock->sk_callback_lock); | ||
| 1616 | } | 1726 | } |
| 1617 | rcu_read_unlock(); | 1727 | rcu_read_unlock(); |
| 1618 | 1728 | ||
| @@ -1661,17 +1771,15 @@ static int sock_map_delete_elem(struct bpf_map *map, void *key) | |||
| 1661 | if (!sock) | 1771 | if (!sock) |
| 1662 | return -EINVAL; | 1772 | return -EINVAL; |
| 1663 | 1773 | ||
| 1664 | write_lock_bh(&sock->sk_callback_lock); | ||
| 1665 | psock = smap_psock_sk(sock); | 1774 | psock = smap_psock_sk(sock); |
| 1666 | if (!psock) | 1775 | if (!psock) |
| 1667 | goto out; | 1776 | goto out; |
| 1668 | 1777 | ||
| 1669 | if (psock->bpf_parse) | 1778 | if (psock->bpf_parse) |
| 1670 | smap_stop_sock(psock, sock); | 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 | smap_release_sock(psock, sock); | 1781 | smap_release_sock(psock, sock); |
| 1673 | out: | 1782 | out: |
| 1674 | write_unlock_bh(&sock->sk_callback_lock); | ||
| 1675 | return 0; | 1783 | return 0; |
| 1676 | } | 1784 | } |
| 1677 | 1785 | ||
| @@ -1752,7 +1860,6 @@ static int __sock_map_ctx_update_elem(struct bpf_map *map, | |||
| 1752 | } | 1860 | } |
| 1753 | } | 1861 | } |
| 1754 | 1862 | ||
| 1755 | write_lock_bh(&sock->sk_callback_lock); | ||
| 1756 | psock = smap_psock_sk(sock); | 1863 | psock = smap_psock_sk(sock); |
| 1757 | 1864 | ||
| 1758 | /* 2. Do not allow inheriting programs if psock exists and has | 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, | |||
| 1809 | if (err) | 1916 | if (err) |
| 1810 | goto out_free; | 1917 | goto out_free; |
| 1811 | smap_init_progs(psock, verdict, parse); | 1918 | smap_init_progs(psock, verdict, parse); |
| 1919 | write_lock_bh(&sock->sk_callback_lock); | ||
| 1812 | smap_start_sock(psock, sock); | 1920 | smap_start_sock(psock, sock); |
| 1921 | write_unlock_bh(&sock->sk_callback_lock); | ||
| 1813 | } | 1922 | } |
| 1814 | 1923 | ||
| 1815 | /* 4. Place psock in sockmap for use and stop any programs on | 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, | |||
| 1819 | */ | 1928 | */ |
| 1820 | if (map_link) { | 1929 | if (map_link) { |
| 1821 | e->entry = map_link; | 1930 | e->entry = map_link; |
| 1931 | spin_lock_bh(&psock->maps_lock); | ||
| 1822 | list_add_tail(&e->list, &psock->maps); | 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 | return err; | 1935 | return err; |
| 1826 | out_free: | 1936 | out_free: |
| 1827 | smap_release_sock(psock, sock); | 1937 | smap_release_sock(psock, sock); |
| @@ -1832,7 +1942,6 @@ out_progs: | |||
| 1832 | } | 1942 | } |
| 1833 | if (tx_msg) | 1943 | if (tx_msg) |
| 1834 | bpf_prog_put(tx_msg); | 1944 | bpf_prog_put(tx_msg); |
| 1835 | write_unlock_bh(&sock->sk_callback_lock); | ||
| 1836 | kfree(e); | 1945 | kfree(e); |
| 1837 | return err; | 1946 | return err; |
| 1838 | } | 1947 | } |
| @@ -1869,10 +1978,8 @@ static int sock_map_ctx_update_elem(struct bpf_sock_ops_kern *skops, | |||
| 1869 | if (osock) { | 1978 | if (osock) { |
| 1870 | struct smap_psock *opsock = smap_psock_sk(osock); | 1979 | struct smap_psock *opsock = smap_psock_sk(osock); |
| 1871 | 1980 | ||
| 1872 | write_lock_bh(&osock->sk_callback_lock); | 1981 | smap_list_map_remove(opsock, &stab->sock_map[i]); |
| 1873 | smap_list_remove(opsock, &stab->sock_map[i], NULL); | ||
| 1874 | smap_release_sock(opsock, osock); | 1982 | smap_release_sock(opsock, osock); |
| 1875 | write_unlock_bh(&osock->sk_callback_lock); | ||
| 1876 | } | 1983 | } |
| 1877 | out: | 1984 | out: |
| 1878 | return err; | 1985 | return err; |
| @@ -1915,6 +2022,24 @@ int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type) | |||
| 1915 | return 0; | 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 | static void *sock_map_lookup(struct bpf_map *map, void *key) | 2043 | static void *sock_map_lookup(struct bpf_map *map, void *key) |
| 1919 | { | 2044 | { |
| 1920 | return NULL; | 2045 | return NULL; |
| @@ -2043,14 +2168,13 @@ free_htab: | |||
| 2043 | return ERR_PTR(err); | 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)]; | 2173 | struct bpf_htab *htab; |
| 2049 | } | ||
| 2050 | 2174 | ||
| 2051 | static inline struct hlist_head *select_bucket(struct bpf_htab *htab, u32 hash) | 2175 | htab = container_of(rcu, struct bpf_htab, rcu); |
| 2052 | { | 2176 | bpf_map_area_free(htab->buckets); |
| 2053 | return &__select_bucket(htab, hash)->head; | 2177 | kfree(htab); |
| 2054 | } | 2178 | } |
| 2055 | 2179 | ||
| 2056 | static void sock_hash_free(struct bpf_map *map) | 2180 | static void sock_hash_free(struct bpf_map *map) |
| @@ -2069,16 +2193,18 @@ static void sock_hash_free(struct bpf_map *map) | |||
| 2069 | */ | 2193 | */ |
| 2070 | rcu_read_lock(); | 2194 | rcu_read_lock(); |
| 2071 | for (i = 0; i < htab->n_buckets; i++) { | 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 | struct hlist_node *n; | 2198 | struct hlist_node *n; |
| 2074 | struct htab_elem *l; | 2199 | struct htab_elem *l; |
| 2075 | 2200 | ||
| 2201 | raw_spin_lock_bh(&b->lock); | ||
| 2202 | head = &b->head; | ||
| 2076 | hlist_for_each_entry_safe(l, n, head, hash_node) { | 2203 | hlist_for_each_entry_safe(l, n, head, hash_node) { |
| 2077 | struct sock *sock = l->sk; | 2204 | struct sock *sock = l->sk; |
| 2078 | struct smap_psock *psock; | 2205 | struct smap_psock *psock; |
| 2079 | 2206 | ||
| 2080 | hlist_del_rcu(&l->hash_node); | 2207 | hlist_del_rcu(&l->hash_node); |
| 2081 | write_lock_bh(&sock->sk_callback_lock); | ||
| 2082 | psock = smap_psock_sk(sock); | 2208 | psock = smap_psock_sk(sock); |
| 2083 | /* This check handles a racing sock event that can get | 2209 | /* This check handles a racing sock event that can get |
| 2084 | * the sk_callback_lock before this case but after xchg | 2210 | * the sk_callback_lock before this case but after xchg |
| @@ -2086,16 +2212,15 @@ static void sock_hash_free(struct bpf_map *map) | |||
| 2086 | * (psock) to be null and queued for garbage collection. | 2212 | * (psock) to be null and queued for garbage collection. |
| 2087 | */ | 2213 | */ |
| 2088 | if (likely(psock)) { | 2214 | if (likely(psock)) { |
| 2089 | smap_list_remove(psock, NULL, l); | 2215 | smap_list_hash_remove(psock, l); |
| 2090 | smap_release_sock(psock, sock); | 2216 | smap_release_sock(psock, sock); |
| 2091 | } | 2217 | } |
| 2092 | write_unlock_bh(&sock->sk_callback_lock); | 2218 | free_htab_elem(htab, l); |
| 2093 | kfree(l); | ||
| 2094 | } | 2219 | } |
| 2220 | raw_spin_unlock_bh(&b->lock); | ||
| 2095 | } | 2221 | } |
| 2096 | rcu_read_unlock(); | 2222 | rcu_read_unlock(); |
| 2097 | bpf_map_area_free(htab->buckets); | 2223 | call_rcu(&htab->rcu, __bpf_htab_free); |
| 2098 | kfree(htab); | ||
| 2099 | } | 2224 | } |
| 2100 | 2225 | ||
| 2101 | static struct htab_elem *alloc_sock_hash_elem(struct bpf_htab *htab, | 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, | |||
| 2122 | return l_new; | 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 | static inline u32 htab_map_hash(const void *key, u32 key_len) | 2250 | static inline u32 htab_map_hash(const void *key, u32 key_len) |
| 2139 | { | 2251 | { |
| 2140 | return jhash(key, key_len, 0); | 2252 | return jhash(key, key_len, 0); |
| @@ -2254,9 +2366,12 @@ static int sock_hash_ctx_update_elem(struct bpf_sock_ops_kern *skops, | |||
| 2254 | goto bucket_err; | 2366 | goto bucket_err; |
| 2255 | } | 2367 | } |
| 2256 | 2368 | ||
| 2257 | e->hash_link = l_new; | 2369 | rcu_assign_pointer(e->hash_link, l_new); |
| 2258 | e->htab = container_of(map, struct bpf_htab, map); | 2370 | rcu_assign_pointer(e->htab, |
| 2371 | container_of(map, struct bpf_htab, map)); | ||
| 2372 | spin_lock_bh(&psock->maps_lock); | ||
| 2259 | list_add_tail(&e->list, &psock->maps); | 2373 | list_add_tail(&e->list, &psock->maps); |
| 2374 | spin_unlock_bh(&psock->maps_lock); | ||
| 2260 | 2375 | ||
| 2261 | /* add new element to the head of the list, so that | 2376 | /* add new element to the head of the list, so that |
| 2262 | * concurrent search will find it before old elem | 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, | |||
| 2266 | psock = smap_psock_sk(l_old->sk); | 2381 | psock = smap_psock_sk(l_old->sk); |
| 2267 | 2382 | ||
| 2268 | hlist_del_rcu(&l_old->hash_node); | 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 | smap_release_sock(psock, l_old->sk); | 2385 | smap_release_sock(psock, l_old->sk); |
| 2271 | free_htab_elem(htab, l_old); | 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) | |||
| 2326 | struct smap_psock *psock; | 2441 | struct smap_psock *psock; |
| 2327 | 2442 | ||
| 2328 | hlist_del_rcu(&l->hash_node); | 2443 | hlist_del_rcu(&l->hash_node); |
| 2329 | write_lock_bh(&sock->sk_callback_lock); | ||
| 2330 | psock = smap_psock_sk(sock); | 2444 | psock = smap_psock_sk(sock); |
| 2331 | /* This check handles a racing sock event that can get the | 2445 | /* This check handles a racing sock event that can get the |
| 2332 | * sk_callback_lock before this case but after xchg happens | 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) | |||
| 2334 | * to be null and queued for garbage collection. | 2448 | * to be null and queued for garbage collection. |
| 2335 | */ | 2449 | */ |
| 2336 | if (likely(psock)) { | 2450 | if (likely(psock)) { |
| 2337 | smap_list_remove(psock, NULL, l); | 2451 | smap_list_hash_remove(psock, l); |
| 2338 | smap_release_sock(psock, sock); | 2452 | smap_release_sock(psock, sock); |
| 2339 | } | 2453 | } |
| 2340 | write_unlock_bh(&sock->sk_callback_lock); | ||
| 2341 | free_htab_elem(htab, l); | 2454 | free_htab_elem(htab, l); |
| 2342 | ret = 0; | 2455 | ret = 0; |
| 2343 | } | 2456 | } |
| @@ -2383,6 +2496,7 @@ const struct bpf_map_ops sock_hash_ops = { | |||
| 2383 | .map_get_next_key = sock_hash_get_next_key, | 2496 | .map_get_next_key = sock_hash_get_next_key, |
| 2384 | .map_update_elem = sock_hash_update_elem, | 2497 | .map_update_elem = sock_hash_update_elem, |
| 2385 | .map_delete_elem = sock_hash_delete_elem, | 2498 | .map_delete_elem = sock_hash_delete_elem, |
| 2499 | .map_release_uref = sock_map_release, | ||
| 2386 | }; | 2500 | }; |
| 2387 | 2501 | ||
| 2388 | BPF_CALL_4(bpf_sock_map_update, struct bpf_sock_ops_kern *, bpf_sock, | 2502 | BPF_CALL_4(bpf_sock_map_update, struct bpf_sock_ops_kern *, bpf_sock, |
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 35dc466641f2..d10ecd78105f 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c | |||
| @@ -1483,8 +1483,6 @@ out_free_tp: | |||
| 1483 | return err; | 1483 | return err; |
| 1484 | } | 1484 | } |
| 1485 | 1485 | ||
| 1486 | #ifdef CONFIG_CGROUP_BPF | ||
| 1487 | |||
| 1488 | static int bpf_prog_attach_check_attach_type(const struct bpf_prog *prog, | 1486 | static int bpf_prog_attach_check_attach_type(const struct bpf_prog *prog, |
| 1489 | enum bpf_attach_type attach_type) | 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, | |||
| 1499 | 1497 | ||
| 1500 | #define BPF_PROG_ATTACH_LAST_FIELD attach_flags | 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 | #define BPF_F_ATTACH_MASK \ | 1500 | #define BPF_F_ATTACH_MASK \ |
| 1537 | (BPF_F_ALLOW_OVERRIDE | BPF_F_ALLOW_MULTI) | 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) | |||
| 1540 | { | 1504 | { |
| 1541 | enum bpf_prog_type ptype; | 1505 | enum bpf_prog_type ptype; |
| 1542 | struct bpf_prog *prog; | 1506 | struct bpf_prog *prog; |
| 1543 | struct cgroup *cgrp; | ||
| 1544 | int ret; | 1507 | int ret; |
| 1545 | 1508 | ||
| 1546 | if (!capable(CAP_NET_ADMIN)) | 1509 | if (!capable(CAP_NET_ADMIN)) |
| @@ -1577,12 +1540,15 @@ static int bpf_prog_attach(const union bpf_attr *attr) | |||
| 1577 | ptype = BPF_PROG_TYPE_CGROUP_DEVICE; | 1540 | ptype = BPF_PROG_TYPE_CGROUP_DEVICE; |
| 1578 | break; | 1541 | break; |
| 1579 | case BPF_SK_MSG_VERDICT: | 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 | case BPF_SK_SKB_STREAM_PARSER: | 1545 | case BPF_SK_SKB_STREAM_PARSER: |
| 1582 | case BPF_SK_SKB_STREAM_VERDICT: | 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 | case BPF_LIRC_MODE2: | 1549 | case BPF_LIRC_MODE2: |
| 1585 | return lirc_prog_attach(attr); | 1550 | ptype = BPF_PROG_TYPE_LIRC_MODE2; |
| 1551 | break; | ||
| 1586 | default: | 1552 | default: |
| 1587 | return -EINVAL; | 1553 | return -EINVAL; |
| 1588 | } | 1554 | } |
| @@ -1596,18 +1562,20 @@ static int bpf_prog_attach(const union bpf_attr *attr) | |||
| 1596 | return -EINVAL; | 1562 | return -EINVAL; |
| 1597 | } | 1563 | } |
| 1598 | 1564 | ||
| 1599 | cgrp = cgroup_get_from_fd(attr->target_fd); | 1565 | switch (ptype) { |
| 1600 | if (IS_ERR(cgrp)) { | 1566 | case BPF_PROG_TYPE_SK_SKB: |
| 1601 | bpf_prog_put(prog); | 1567 | case BPF_PROG_TYPE_SK_MSG: |
| 1602 | return PTR_ERR(cgrp); | 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 | if (ret) | 1577 | if (ret) |
| 1608 | bpf_prog_put(prog); | 1578 | bpf_prog_put(prog); |
| 1609 | cgroup_put(cgrp); | ||
| 1610 | |||
| 1611 | return ret; | 1579 | return ret; |
| 1612 | } | 1580 | } |
| 1613 | 1581 | ||
| @@ -1616,9 +1584,6 @@ static int bpf_prog_attach(const union bpf_attr *attr) | |||
| 1616 | static int bpf_prog_detach(const union bpf_attr *attr) | 1584 | static int bpf_prog_detach(const union bpf_attr *attr) |
| 1617 | { | 1585 | { |
| 1618 | enum bpf_prog_type ptype; | 1586 | enum bpf_prog_type ptype; |
| 1619 | struct bpf_prog *prog; | ||
| 1620 | struct cgroup *cgrp; | ||
| 1621 | int ret; | ||
| 1622 | 1587 | ||
| 1623 | if (!capable(CAP_NET_ADMIN)) | 1588 | if (!capable(CAP_NET_ADMIN)) |
| 1624 | return -EPERM; | 1589 | return -EPERM; |
| @@ -1651,29 +1616,17 @@ static int bpf_prog_detach(const union bpf_attr *attr) | |||
| 1651 | ptype = BPF_PROG_TYPE_CGROUP_DEVICE; | 1616 | ptype = BPF_PROG_TYPE_CGROUP_DEVICE; |
| 1652 | break; | 1617 | break; |
| 1653 | case BPF_SK_MSG_VERDICT: | 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 | case BPF_SK_SKB_STREAM_PARSER: | 1620 | case BPF_SK_SKB_STREAM_PARSER: |
| 1656 | case BPF_SK_SKB_STREAM_VERDICT: | 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 | case BPF_LIRC_MODE2: | 1623 | case BPF_LIRC_MODE2: |
| 1659 | return lirc_prog_detach(attr); | 1624 | return lirc_prog_detach(attr); |
| 1660 | default: | 1625 | default: |
| 1661 | return -EINVAL; | 1626 | return -EINVAL; |
| 1662 | } | 1627 | } |
| 1663 | 1628 | ||
| 1664 | cgrp = cgroup_get_from_fd(attr->target_fd); | 1629 | return cgroup_bpf_prog_detach(attr, ptype); |
| 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; | ||
| 1677 | } | 1630 | } |
| 1678 | 1631 | ||
| 1679 | #define BPF_PROG_QUERY_LAST_FIELD query.prog_cnt | 1632 | #define BPF_PROG_QUERY_LAST_FIELD query.prog_cnt |
| @@ -1681,9 +1634,6 @@ static int bpf_prog_detach(const union bpf_attr *attr) | |||
| 1681 | static int bpf_prog_query(const union bpf_attr *attr, | 1634 | static int bpf_prog_query(const union bpf_attr *attr, |
| 1682 | union bpf_attr __user *uattr) | 1635 | union bpf_attr __user *uattr) |
| 1683 | { | 1636 | { |
| 1684 | struct cgroup *cgrp; | ||
| 1685 | int ret; | ||
| 1686 | |||
| 1687 | if (!capable(CAP_NET_ADMIN)) | 1637 | if (!capable(CAP_NET_ADMIN)) |
| 1688 | return -EPERM; | 1638 | return -EPERM; |
| 1689 | if (CHECK_ATTR(BPF_PROG_QUERY)) | 1639 | if (CHECK_ATTR(BPF_PROG_QUERY)) |
| @@ -1711,14 +1661,9 @@ static int bpf_prog_query(const union bpf_attr *attr, | |||
| 1711 | default: | 1661 | default: |
| 1712 | return -EINVAL; | 1662 | return -EINVAL; |
| 1713 | } | 1663 | } |
| 1714 | cgrp = cgroup_get_from_fd(attr->query.target_fd); | 1664 | |
| 1715 | if (IS_ERR(cgrp)) | 1665 | return cgroup_bpf_prog_query(attr, uattr); |
| 1716 | return PTR_ERR(cgrp); | ||
| 1717 | ret = cgroup_bpf_query(cgrp, attr, uattr); | ||
| 1718 | cgroup_put(cgrp); | ||
| 1719 | return ret; | ||
| 1720 | } | 1666 | } |
| 1721 | #endif /* CONFIG_CGROUP_BPF */ | ||
| 1722 | 1667 | ||
| 1723 | #define BPF_PROG_TEST_RUN_LAST_FIELD test.duration | 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 | |||
| 2365 | case BPF_OBJ_GET: | 2310 | case BPF_OBJ_GET: |
| 2366 | err = bpf_obj_get(&attr); | 2311 | err = bpf_obj_get(&attr); |
| 2367 | break; | 2312 | break; |
| 2368 | #ifdef CONFIG_CGROUP_BPF | ||
| 2369 | case BPF_PROG_ATTACH: | 2313 | case BPF_PROG_ATTACH: |
| 2370 | err = bpf_prog_attach(&attr); | 2314 | err = bpf_prog_attach(&attr); |
| 2371 | break; | 2315 | break; |
| @@ -2375,7 +2319,6 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz | |||
| 2375 | case BPF_PROG_QUERY: | 2319 | case BPF_PROG_QUERY: |
| 2376 | err = bpf_prog_query(&attr, uattr); | 2320 | err = bpf_prog_query(&attr, uattr); |
| 2377 | break; | 2321 | break; |
| 2378 | #endif | ||
| 2379 | case BPF_PROG_TEST_RUN: | 2322 | case BPF_PROG_TEST_RUN: |
| 2380 | err = bpf_prog_test_run(&attr, uattr); | 2323 | err = bpf_prog_test_run(&attr, uattr); |
| 2381 | break; | 2324 | break; |
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 04b68d9dffac..904541055792 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c | |||
| @@ -1085,3 +1085,4 @@ const struct dma_map_ops swiotlb_dma_ops = { | |||
| 1085 | .unmap_page = swiotlb_unmap_page, | 1085 | .unmap_page = swiotlb_unmap_page, |
| 1086 | .dma_supported = dma_direct_supported, | 1086 | .dma_supported = dma_direct_supported, |
| 1087 | }; | 1087 | }; |
| 1088 | EXPORT_SYMBOL(swiotlb_dma_ops); | ||
diff --git a/kernel/events/core.c b/kernel/events/core.c index 80cca2b30c4f..8f0434a9951a 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
| @@ -6482,7 +6482,7 @@ void perf_prepare_sample(struct perf_event_header *header, | |||
| 6482 | data->phys_addr = perf_virt_to_phys(data->addr); | 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 | __perf_event_output(struct perf_event *event, | 6486 | __perf_event_output(struct perf_event *event, |
| 6487 | struct perf_sample_data *data, | 6487 | struct perf_sample_data *data, |
| 6488 | struct pt_regs *regs, | 6488 | struct pt_regs *regs, |
diff --git a/kernel/kthread.c b/kernel/kthread.c index 481951bf091d..750cb8082694 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c | |||
| @@ -177,9 +177,20 @@ void *kthread_probe_data(struct task_struct *task) | |||
| 177 | static void __kthread_parkme(struct kthread *self) | 177 | static void __kthread_parkme(struct kthread *self) |
| 178 | { | 178 | { |
| 179 | for (;;) { | 179 | for (;;) { |
| 180 | set_current_state(TASK_PARKED); | 180 | /* |
| 181 | * TASK_PARKED is a special state; we must serialize against | ||
| 182 | * possible pending wakeups to avoid store-store collisions on | ||
| 183 | * task->state. | ||
| 184 | * | ||
| 185 | * Such a collision might possibly result in the task state | ||
| 186 | * changin from TASK_PARKED and us failing the | ||
| 187 | * wait_task_inactive() in kthread_park(). | ||
| 188 | */ | ||
| 189 | set_special_state(TASK_PARKED); | ||
| 181 | if (!test_bit(KTHREAD_SHOULD_PARK, &self->flags)) | 190 | if (!test_bit(KTHREAD_SHOULD_PARK, &self->flags)) |
| 182 | break; | 191 | break; |
| 192 | |||
| 193 | complete_all(&self->parked); | ||
| 183 | schedule(); | 194 | schedule(); |
| 184 | } | 195 | } |
| 185 | __set_current_state(TASK_RUNNING); | 196 | __set_current_state(TASK_RUNNING); |
| @@ -191,11 +202,6 @@ void kthread_parkme(void) | |||
| 191 | } | 202 | } |
| 192 | EXPORT_SYMBOL_GPL(kthread_parkme); | 203 | EXPORT_SYMBOL_GPL(kthread_parkme); |
| 193 | 204 | ||
| 194 | void kthread_park_complete(struct task_struct *k) | ||
| 195 | { | ||
| 196 | complete_all(&to_kthread(k)->parked); | ||
| 197 | } | ||
| 198 | |||
| 199 | static int kthread(void *_create) | 205 | static int kthread(void *_create) |
| 200 | { | 206 | { |
| 201 | /* Copy data: it's on kthread's stack */ | 207 | /* Copy data: it's on kthread's stack */ |
| @@ -461,6 +467,9 @@ void kthread_unpark(struct task_struct *k) | |||
| 461 | 467 | ||
| 462 | reinit_completion(&kthread->parked); | 468 | reinit_completion(&kthread->parked); |
| 463 | clear_bit(KTHREAD_SHOULD_PARK, &kthread->flags); | 469 | clear_bit(KTHREAD_SHOULD_PARK, &kthread->flags); |
| 470 | /* | ||
| 471 | * __kthread_parkme() will either see !SHOULD_PARK or get the wakeup. | ||
| 472 | */ | ||
| 464 | wake_up_state(k, TASK_PARKED); | 473 | wake_up_state(k, TASK_PARKED); |
| 465 | } | 474 | } |
| 466 | EXPORT_SYMBOL_GPL(kthread_unpark); | 475 | EXPORT_SYMBOL_GPL(kthread_unpark); |
| @@ -487,7 +496,16 @@ int kthread_park(struct task_struct *k) | |||
| 487 | set_bit(KTHREAD_SHOULD_PARK, &kthread->flags); | 496 | set_bit(KTHREAD_SHOULD_PARK, &kthread->flags); |
| 488 | if (k != current) { | 497 | if (k != current) { |
| 489 | wake_up_process(k); | 498 | wake_up_process(k); |
| 499 | /* | ||
| 500 | * Wait for __kthread_parkme() to complete(), this means we | ||
| 501 | * _will_ have TASK_PARKED and are about to call schedule(). | ||
| 502 | */ | ||
| 490 | wait_for_completion(&kthread->parked); | 503 | wait_for_completion(&kthread->parked); |
| 504 | /* | ||
| 505 | * Now wait for that schedule() to complete and the task to | ||
| 506 | * get scheduled out. | ||
| 507 | */ | ||
| 508 | WARN_ON_ONCE(!wait_task_inactive(k, TASK_PARKED)); | ||
| 491 | } | 509 | } |
| 492 | 510 | ||
| 493 | return 0; | 511 | return 0; |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 78d8facba456..fe365c9a08e9 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | */ | 7 | */ |
| 8 | #include "sched.h" | 8 | #include "sched.h" |
| 9 | 9 | ||
| 10 | #include <linux/kthread.h> | ||
| 11 | #include <linux/nospec.h> | 10 | #include <linux/nospec.h> |
| 12 | 11 | ||
| 13 | #include <linux/kcov.h> | 12 | #include <linux/kcov.h> |
| @@ -2724,28 +2723,20 @@ static struct rq *finish_task_switch(struct task_struct *prev) | |||
| 2724 | membarrier_mm_sync_core_before_usermode(mm); | 2723 | membarrier_mm_sync_core_before_usermode(mm); |
| 2725 | mmdrop(mm); | 2724 | mmdrop(mm); |
| 2726 | } | 2725 | } |
| 2727 | if (unlikely(prev_state & (TASK_DEAD|TASK_PARKED))) { | 2726 | if (unlikely(prev_state == TASK_DEAD)) { |
| 2728 | switch (prev_state) { | 2727 | if (prev->sched_class->task_dead) |
| 2729 | case TASK_DEAD: | 2728 | prev->sched_class->task_dead(prev); |
| 2730 | if (prev->sched_class->task_dead) | ||
| 2731 | prev->sched_class->task_dead(prev); | ||
| 2732 | 2729 | ||
| 2733 | /* | 2730 | /* |
| 2734 | * Remove function-return probe instances associated with this | 2731 | * Remove function-return probe instances associated with this |
| 2735 | * task and put them back on the free list. | 2732 | * task and put them back on the free list. |
| 2736 | */ | 2733 | */ |
| 2737 | kprobe_flush_task(prev); | 2734 | kprobe_flush_task(prev); |
| 2738 | |||
| 2739 | /* Task is done with its stack. */ | ||
| 2740 | put_task_stack(prev); | ||
| 2741 | 2735 | ||
| 2742 | put_task_struct(prev); | 2736 | /* Task is done with its stack. */ |
| 2743 | break; | 2737 | put_task_stack(prev); |
| 2744 | 2738 | ||
| 2745 | case TASK_PARKED: | 2739 | put_task_struct(prev); |
| 2746 | kthread_park_complete(prev); | ||
| 2747 | break; | ||
| 2748 | } | ||
| 2749 | } | 2740 | } |
| 2750 | 2741 | ||
| 2751 | tick_nohz_task_switch(); | 2742 | tick_nohz_task_switch(); |
| @@ -3113,7 +3104,9 @@ static void sched_tick_remote(struct work_struct *work) | |||
| 3113 | struct tick_work *twork = container_of(dwork, struct tick_work, work); | 3104 | struct tick_work *twork = container_of(dwork, struct tick_work, work); |
| 3114 | int cpu = twork->cpu; | 3105 | int cpu = twork->cpu; |
| 3115 | struct rq *rq = cpu_rq(cpu); | 3106 | struct rq *rq = cpu_rq(cpu); |
| 3107 | struct task_struct *curr; | ||
| 3116 | struct rq_flags rf; | 3108 | struct rq_flags rf; |
| 3109 | u64 delta; | ||
| 3117 | 3110 | ||
| 3118 | /* | 3111 | /* |
| 3119 | * Handle the tick only if it appears the remote CPU is running in full | 3112 | * Handle the tick only if it appears the remote CPU is running in full |
| @@ -3122,24 +3115,28 @@ static void sched_tick_remote(struct work_struct *work) | |||
| 3122 | * statistics and checks timeslices in a time-independent way, regardless | 3115 | * statistics and checks timeslices in a time-independent way, regardless |
| 3123 | * of when exactly it is running. | 3116 | * of when exactly it is running. |
| 3124 | */ | 3117 | */ |
| 3125 | if (!idle_cpu(cpu) && tick_nohz_tick_stopped_cpu(cpu)) { | 3118 | if (idle_cpu(cpu) || !tick_nohz_tick_stopped_cpu(cpu)) |
| 3126 | struct task_struct *curr; | 3119 | goto out_requeue; |
| 3127 | u64 delta; | ||
| 3128 | 3120 | ||
| 3129 | rq_lock_irq(rq, &rf); | 3121 | rq_lock_irq(rq, &rf); |
| 3130 | update_rq_clock(rq); | 3122 | curr = rq->curr; |
| 3131 | curr = rq->curr; | 3123 | if (is_idle_task(curr)) |
| 3132 | delta = rq_clock_task(rq) - curr->se.exec_start; | 3124 | goto out_unlock; |
| 3133 | 3125 | ||
| 3134 | /* | 3126 | update_rq_clock(rq); |
| 3135 | * Make sure the next tick runs within a reasonable | 3127 | delta = rq_clock_task(rq) - curr->se.exec_start; |
| 3136 | * amount of time. | 3128 | |
| 3137 | */ | 3129 | /* |
| 3138 | WARN_ON_ONCE(delta > (u64)NSEC_PER_SEC * 3); | 3130 | * Make sure the next tick runs within a reasonable |
| 3139 | curr->sched_class->task_tick(rq, curr, 0); | 3131 | * amount of time. |
| 3140 | rq_unlock_irq(rq, &rf); | 3132 | */ |
| 3141 | } | 3133 | WARN_ON_ONCE(delta > (u64)NSEC_PER_SEC * 3); |
| 3134 | curr->sched_class->task_tick(rq, curr, 0); | ||
| 3135 | |||
| 3136 | out_unlock: | ||
| 3137 | rq_unlock_irq(rq, &rf); | ||
| 3142 | 3138 | ||
| 3139 | out_requeue: | ||
| 3143 | /* | 3140 | /* |
| 3144 | * Run the remote tick once per second (1Hz). This arbitrary | 3141 | * Run the remote tick once per second (1Hz). This arbitrary |
| 3145 | * frequency is large enough to avoid overload but short enough | 3142 | * frequency is large enough to avoid overload but short enough |
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 3cde46483f0a..c907fde01eaa 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c | |||
| @@ -192,7 +192,7 @@ static unsigned long sugov_aggregate_util(struct sugov_cpu *sg_cpu) | |||
| 192 | { | 192 | { |
| 193 | struct rq *rq = cpu_rq(sg_cpu->cpu); | 193 | struct rq *rq = cpu_rq(sg_cpu->cpu); |
| 194 | 194 | ||
| 195 | if (rq->rt.rt_nr_running) | 195 | if (rt_rq_is_runnable(&rq->rt)) |
| 196 | return sg_cpu->max; | 196 | return sg_cpu->max; |
| 197 | 197 | ||
| 198 | /* | 198 | /* |
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1866e64792a7..2f0a0be4d344 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
| @@ -3982,18 +3982,10 @@ util_est_dequeue(struct cfs_rq *cfs_rq, struct task_struct *p, bool task_sleep) | |||
| 3982 | if (!sched_feat(UTIL_EST)) | 3982 | if (!sched_feat(UTIL_EST)) |
| 3983 | return; | 3983 | return; |
| 3984 | 3984 | ||
| 3985 | /* | 3985 | /* Update root cfs_rq's estimated utilization */ |
| 3986 | * Update root cfs_rq's estimated utilization | 3986 | ue.enqueued = cfs_rq->avg.util_est.enqueued; |
| 3987 | * | 3987 | ue.enqueued -= min_t(unsigned int, ue.enqueued, |
| 3988 | * If *p is the last task then the root cfs_rq's estimated utilization | 3988 | (_task_util_est(p) | UTIL_AVG_UNCHANGED)); |
| 3989 | * of a CPU is 0 by definition. | ||
| 3990 | */ | ||
| 3991 | ue.enqueued = 0; | ||
| 3992 | if (cfs_rq->nr_running) { | ||
| 3993 | ue.enqueued = cfs_rq->avg.util_est.enqueued; | ||
| 3994 | ue.enqueued -= min_t(unsigned int, ue.enqueued, | ||
| 3995 | (_task_util_est(p) | UTIL_AVG_UNCHANGED)); | ||
| 3996 | } | ||
| 3997 | WRITE_ONCE(cfs_rq->avg.util_est.enqueued, ue.enqueued); | 3989 | WRITE_ONCE(cfs_rq->avg.util_est.enqueued, ue.enqueued); |
| 3998 | 3990 | ||
| 3999 | /* | 3991 | /* |
| @@ -4590,6 +4582,7 @@ void __refill_cfs_bandwidth_runtime(struct cfs_bandwidth *cfs_b) | |||
| 4590 | now = sched_clock_cpu(smp_processor_id()); | 4582 | now = sched_clock_cpu(smp_processor_id()); |
| 4591 | cfs_b->runtime = cfs_b->quota; | 4583 | cfs_b->runtime = cfs_b->quota; |
| 4592 | cfs_b->runtime_expires = now + ktime_to_ns(cfs_b->period); | 4584 | cfs_b->runtime_expires = now + ktime_to_ns(cfs_b->period); |
| 4585 | cfs_b->expires_seq++; | ||
| 4593 | } | 4586 | } |
| 4594 | 4587 | ||
| 4595 | static inline struct cfs_bandwidth *tg_cfs_bandwidth(struct task_group *tg) | 4588 | static inline struct cfs_bandwidth *tg_cfs_bandwidth(struct task_group *tg) |
| @@ -4612,6 +4605,7 @@ static int assign_cfs_rq_runtime(struct cfs_rq *cfs_rq) | |||
| 4612 | struct task_group *tg = cfs_rq->tg; | 4605 | struct task_group *tg = cfs_rq->tg; |
| 4613 | struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(tg); | 4606 | struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(tg); |
| 4614 | u64 amount = 0, min_amount, expires; | 4607 | u64 amount = 0, min_amount, expires; |
| 4608 | int expires_seq; | ||
| 4615 | 4609 | ||
| 4616 | /* note: this is a positive sum as runtime_remaining <= 0 */ | 4610 | /* note: this is a positive sum as runtime_remaining <= 0 */ |
| 4617 | min_amount = sched_cfs_bandwidth_slice() - cfs_rq->runtime_remaining; | 4611 | min_amount = sched_cfs_bandwidth_slice() - cfs_rq->runtime_remaining; |
| @@ -4628,6 +4622,7 @@ static int assign_cfs_rq_runtime(struct cfs_rq *cfs_rq) | |||
| 4628 | cfs_b->idle = 0; | 4622 | cfs_b->idle = 0; |
| 4629 | } | 4623 | } |
| 4630 | } | 4624 | } |
| 4625 | expires_seq = cfs_b->expires_seq; | ||
| 4631 | expires = cfs_b->runtime_expires; | 4626 | expires = cfs_b->runtime_expires; |
| 4632 | raw_spin_unlock(&cfs_b->lock); | 4627 | raw_spin_unlock(&cfs_b->lock); |
| 4633 | 4628 | ||
| @@ -4637,8 +4632,10 @@ static int assign_cfs_rq_runtime(struct cfs_rq *cfs_rq) | |||
| 4637 | * spread between our sched_clock and the one on which runtime was | 4632 | * spread between our sched_clock and the one on which runtime was |
| 4638 | * issued. | 4633 | * issued. |
| 4639 | */ | 4634 | */ |
| 4640 | if ((s64)(expires - cfs_rq->runtime_expires) > 0) | 4635 | if (cfs_rq->expires_seq != expires_seq) { |
| 4636 | cfs_rq->expires_seq = expires_seq; | ||
| 4641 | cfs_rq->runtime_expires = expires; | 4637 | cfs_rq->runtime_expires = expires; |
| 4638 | } | ||
| 4642 | 4639 | ||
| 4643 | return cfs_rq->runtime_remaining > 0; | 4640 | return cfs_rq->runtime_remaining > 0; |
| 4644 | } | 4641 | } |
| @@ -4664,12 +4661,9 @@ static void expire_cfs_rq_runtime(struct cfs_rq *cfs_rq) | |||
| 4664 | * has not truly expired. | 4661 | * has not truly expired. |
| 4665 | * | 4662 | * |
| 4666 | * Fortunately we can check determine whether this the case by checking | 4663 | * Fortunately we can check determine whether this the case by checking |
| 4667 | * whether the global deadline has advanced. It is valid to compare | 4664 | * whether the global deadline(cfs_b->expires_seq) has advanced. |
| 4668 | * cfs_b->runtime_expires without any locks since we only care about | ||
| 4669 | * exact equality, so a partial write will still work. | ||
| 4670 | */ | 4665 | */ |
| 4671 | 4666 | if (cfs_rq->expires_seq == cfs_b->expires_seq) { | |
| 4672 | if (cfs_rq->runtime_expires != cfs_b->runtime_expires) { | ||
| 4673 | /* extend local deadline, drift is bounded above by 2 ticks */ | 4667 | /* extend local deadline, drift is bounded above by 2 ticks */ |
| 4674 | cfs_rq->runtime_expires += TICK_NSEC; | 4668 | cfs_rq->runtime_expires += TICK_NSEC; |
| 4675 | } else { | 4669 | } else { |
| @@ -5202,13 +5196,18 @@ static void init_cfs_rq_runtime(struct cfs_rq *cfs_rq) | |||
| 5202 | 5196 | ||
| 5203 | void start_cfs_bandwidth(struct cfs_bandwidth *cfs_b) | 5197 | void start_cfs_bandwidth(struct cfs_bandwidth *cfs_b) |
| 5204 | { | 5198 | { |
| 5199 | u64 overrun; | ||
| 5200 | |||
| 5205 | lockdep_assert_held(&cfs_b->lock); | 5201 | lockdep_assert_held(&cfs_b->lock); |
| 5206 | 5202 | ||
| 5207 | if (!cfs_b->period_active) { | 5203 | if (cfs_b->period_active) |
| 5208 | cfs_b->period_active = 1; | 5204 | return; |
| 5209 | hrtimer_forward_now(&cfs_b->period_timer, cfs_b->period); | 5205 | |
| 5210 | hrtimer_start_expires(&cfs_b->period_timer, HRTIMER_MODE_ABS_PINNED); | 5206 | cfs_b->period_active = 1; |
| 5211 | } | 5207 | overrun = hrtimer_forward_now(&cfs_b->period_timer, cfs_b->period); |
| 5208 | cfs_b->runtime_expires += (overrun + 1) * ktime_to_ns(cfs_b->period); | ||
| 5209 | cfs_b->expires_seq++; | ||
| 5210 | hrtimer_start_expires(&cfs_b->period_timer, HRTIMER_MODE_ABS_PINNED); | ||
| 5212 | } | 5211 | } |
| 5213 | 5212 | ||
| 5214 | static void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b) | 5213 | static void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b) |
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 47556b0c9a95..572567078b60 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c | |||
| @@ -508,8 +508,11 @@ static void sched_rt_rq_dequeue(struct rt_rq *rt_rq) | |||
| 508 | 508 | ||
| 509 | rt_se = rt_rq->tg->rt_se[cpu]; | 509 | rt_se = rt_rq->tg->rt_se[cpu]; |
| 510 | 510 | ||
| 511 | if (!rt_se) | 511 | if (!rt_se) { |
| 512 | dequeue_top_rt_rq(rt_rq); | 512 | dequeue_top_rt_rq(rt_rq); |
| 513 | /* Kick cpufreq (see the comment in kernel/sched/sched.h). */ | ||
| 514 | cpufreq_update_util(rq_of_rt_rq(rt_rq), 0); | ||
| 515 | } | ||
| 513 | else if (on_rt_rq(rt_se)) | 516 | else if (on_rt_rq(rt_se)) |
| 514 | dequeue_rt_entity(rt_se, 0); | 517 | dequeue_rt_entity(rt_se, 0); |
| 515 | } | 518 | } |
| @@ -1001,8 +1004,6 @@ dequeue_top_rt_rq(struct rt_rq *rt_rq) | |||
| 1001 | sub_nr_running(rq, rt_rq->rt_nr_running); | 1004 | sub_nr_running(rq, rt_rq->rt_nr_running); |
| 1002 | rt_rq->rt_queued = 0; | 1005 | rt_rq->rt_queued = 0; |
| 1003 | 1006 | ||
| 1004 | /* Kick cpufreq (see the comment in kernel/sched/sched.h). */ | ||
| 1005 | cpufreq_update_util(rq, 0); | ||
| 1006 | } | 1007 | } |
| 1007 | 1008 | ||
| 1008 | static void | 1009 | static void |
| @@ -1014,11 +1015,14 @@ enqueue_top_rt_rq(struct rt_rq *rt_rq) | |||
| 1014 | 1015 | ||
| 1015 | if (rt_rq->rt_queued) | 1016 | if (rt_rq->rt_queued) |
| 1016 | return; | 1017 | return; |
| 1017 | if (rt_rq_throttled(rt_rq) || !rt_rq->rt_nr_running) | 1018 | |
| 1019 | if (rt_rq_throttled(rt_rq)) | ||
| 1018 | return; | 1020 | return; |
| 1019 | 1021 | ||
| 1020 | add_nr_running(rq, rt_rq->rt_nr_running); | 1022 | if (rt_rq->rt_nr_running) { |
| 1021 | rt_rq->rt_queued = 1; | 1023 | add_nr_running(rq, rt_rq->rt_nr_running); |
| 1024 | rt_rq->rt_queued = 1; | ||
| 1025 | } | ||
| 1022 | 1026 | ||
| 1023 | /* Kick cpufreq (see the comment in kernel/sched/sched.h). */ | 1027 | /* Kick cpufreq (see the comment in kernel/sched/sched.h). */ |
| 1024 | cpufreq_update_util(rq, 0); | 1028 | cpufreq_update_util(rq, 0); |
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 6601baf2361c..c7742dcc136c 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h | |||
| @@ -334,9 +334,10 @@ struct cfs_bandwidth { | |||
| 334 | u64 runtime; | 334 | u64 runtime; |
| 335 | s64 hierarchical_quota; | 335 | s64 hierarchical_quota; |
| 336 | u64 runtime_expires; | 336 | u64 runtime_expires; |
| 337 | int expires_seq; | ||
| 337 | 338 | ||
| 338 | int idle; | 339 | short idle; |
| 339 | int period_active; | 340 | short period_active; |
| 340 | struct hrtimer period_timer; | 341 | struct hrtimer period_timer; |
| 341 | struct hrtimer slack_timer; | 342 | struct hrtimer slack_timer; |
| 342 | struct list_head throttled_cfs_rq; | 343 | struct list_head throttled_cfs_rq; |
| @@ -551,6 +552,7 @@ struct cfs_rq { | |||
| 551 | 552 | ||
| 552 | #ifdef CONFIG_CFS_BANDWIDTH | 553 | #ifdef CONFIG_CFS_BANDWIDTH |
| 553 | int runtime_enabled; | 554 | int runtime_enabled; |
| 555 | int expires_seq; | ||
| 554 | u64 runtime_expires; | 556 | u64 runtime_expires; |
| 555 | s64 runtime_remaining; | 557 | s64 runtime_remaining; |
| 556 | 558 | ||
| @@ -609,6 +611,11 @@ struct rt_rq { | |||
| 609 | #endif | 611 | #endif |
| 610 | }; | 612 | }; |
| 611 | 613 | ||
| 614 | static inline bool rt_rq_is_runnable(struct rt_rq *rt_rq) | ||
| 615 | { | ||
| 616 | return rt_rq->rt_queued && rt_rq->rt_nr_running; | ||
| 617 | } | ||
| 618 | |||
| 612 | /* Deadline class' related fields in a runqueue */ | 619 | /* Deadline class' related fields in a runqueue */ |
| 613 | struct dl_rq { | 620 | struct dl_rq { |
| 614 | /* runqueue is an rbtree, ordered by deadline */ | 621 | /* runqueue is an rbtree, ordered by deadline */ |
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index efed9c1cfb7e..caf9cbf35816 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -192,17 +192,6 @@ static void ftrace_pid_func(unsigned long ip, unsigned long parent_ip, | |||
| 192 | op->saved_func(ip, parent_ip, op, regs); | 192 | op->saved_func(ip, parent_ip, op, regs); |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | /** | ||
| 196 | * clear_ftrace_function - reset the ftrace function | ||
| 197 | * | ||
| 198 | * This NULLs the ftrace function and in essence stops | ||
| 199 | * tracing. There may be lag | ||
| 200 | */ | ||
| 201 | void clear_ftrace_function(void) | ||
| 202 | { | ||
| 203 | ftrace_trace_function = ftrace_stub; | ||
| 204 | } | ||
| 205 | |||
| 206 | static void ftrace_sync(struct work_struct *work) | 195 | static void ftrace_sync(struct work_struct *work) |
| 207 | { | 196 | { |
| 208 | /* | 197 | /* |
| @@ -6689,7 +6678,7 @@ void ftrace_kill(void) | |||
| 6689 | { | 6678 | { |
| 6690 | ftrace_disabled = 1; | 6679 | ftrace_disabled = 1; |
| 6691 | ftrace_enabled = 0; | 6680 | ftrace_enabled = 0; |
| 6692 | clear_ftrace_function(); | 6681 | ftrace_trace_function = ftrace_stub; |
| 6693 | } | 6682 | } |
| 6694 | 6683 | ||
| 6695 | /** | 6684 | /** |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index a0079b4c7a49..87cf25171fb8 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
| @@ -2953,6 +2953,7 @@ out_nobuffer: | |||
| 2953 | } | 2953 | } |
| 2954 | EXPORT_SYMBOL_GPL(trace_vbprintk); | 2954 | EXPORT_SYMBOL_GPL(trace_vbprintk); |
| 2955 | 2955 | ||
| 2956 | __printf(3, 0) | ||
| 2956 | static int | 2957 | static int |
| 2957 | __trace_array_vprintk(struct ring_buffer *buffer, | 2958 | __trace_array_vprintk(struct ring_buffer *buffer, |
| 2958 | unsigned long ip, const char *fmt, va_list args) | 2959 | unsigned long ip, const char *fmt, va_list args) |
| @@ -3007,12 +3008,14 @@ out_nobuffer: | |||
| 3007 | return len; | 3008 | return len; |
| 3008 | } | 3009 | } |
| 3009 | 3010 | ||
| 3011 | __printf(3, 0) | ||
| 3010 | int trace_array_vprintk(struct trace_array *tr, | 3012 | int trace_array_vprintk(struct trace_array *tr, |
| 3011 | unsigned long ip, const char *fmt, va_list args) | 3013 | unsigned long ip, const char *fmt, va_list args) |
| 3012 | { | 3014 | { |
| 3013 | return __trace_array_vprintk(tr->trace_buffer.buffer, ip, fmt, args); | 3015 | return __trace_array_vprintk(tr->trace_buffer.buffer, ip, fmt, args); |
| 3014 | } | 3016 | } |
| 3015 | 3017 | ||
| 3018 | __printf(3, 0) | ||
| 3016 | int trace_array_printk(struct trace_array *tr, | 3019 | int trace_array_printk(struct trace_array *tr, |
| 3017 | unsigned long ip, const char *fmt, ...) | 3020 | unsigned long ip, const char *fmt, ...) |
| 3018 | { | 3021 | { |
| @@ -3028,6 +3031,7 @@ int trace_array_printk(struct trace_array *tr, | |||
| 3028 | return ret; | 3031 | return ret; |
| 3029 | } | 3032 | } |
| 3030 | 3033 | ||
| 3034 | __printf(3, 4) | ||
| 3031 | int trace_array_printk_buf(struct ring_buffer *buffer, | 3035 | int trace_array_printk_buf(struct ring_buffer *buffer, |
| 3032 | unsigned long ip, const char *fmt, ...) | 3036 | unsigned long ip, const char *fmt, ...) |
| 3033 | { | 3037 | { |
| @@ -3043,6 +3047,7 @@ int trace_array_printk_buf(struct ring_buffer *buffer, | |||
| 3043 | return ret; | 3047 | return ret; |
| 3044 | } | 3048 | } |
| 3045 | 3049 | ||
| 3050 | __printf(2, 0) | ||
| 3046 | int trace_vprintk(unsigned long ip, const char *fmt, va_list args) | 3051 | int trace_vprintk(unsigned long ip, const char *fmt, va_list args) |
| 3047 | { | 3052 | { |
| 3048 | return trace_array_vprintk(&global_trace, ip, fmt, args); | 3053 | return trace_array_vprintk(&global_trace, ip, fmt, args); |
| @@ -3360,8 +3365,8 @@ static void print_func_help_header(struct trace_buffer *buf, struct seq_file *m, | |||
| 3360 | 3365 | ||
| 3361 | print_event_info(buf, m); | 3366 | print_event_info(buf, m); |
| 3362 | 3367 | ||
| 3363 | seq_printf(m, "# TASK-PID CPU# %s TIMESTAMP FUNCTION\n", tgid ? "TGID " : ""); | 3368 | seq_printf(m, "# TASK-PID %s CPU# TIMESTAMP FUNCTION\n", tgid ? "TGID " : ""); |
| 3364 | seq_printf(m, "# | | | %s | |\n", tgid ? " | " : ""); | 3369 | seq_printf(m, "# | | %s | | |\n", tgid ? " | " : ""); |
| 3365 | } | 3370 | } |
| 3366 | 3371 | ||
| 3367 | static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file *m, | 3372 | static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file *m, |
| @@ -3381,9 +3386,9 @@ static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file | |||
| 3381 | tgid ? tgid_space : space); | 3386 | tgid ? tgid_space : space); |
| 3382 | seq_printf(m, "# %s||| / delay\n", | 3387 | seq_printf(m, "# %s||| / delay\n", |
| 3383 | tgid ? tgid_space : space); | 3388 | tgid ? tgid_space : space); |
| 3384 | seq_printf(m, "# TASK-PID CPU#%s|||| TIMESTAMP FUNCTION\n", | 3389 | seq_printf(m, "# TASK-PID %sCPU# |||| TIMESTAMP FUNCTION\n", |
| 3385 | tgid ? " TGID " : space); | 3390 | tgid ? " TGID " : space); |
| 3386 | seq_printf(m, "# | | | %s|||| | |\n", | 3391 | seq_printf(m, "# | | %s | |||| | |\n", |
| 3387 | tgid ? " | " : space); | 3392 | tgid ? " | " : space); |
| 3388 | } | 3393 | } |
| 3389 | 3394 | ||
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 630c5a24b2b2..f8f86231ad90 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
| @@ -583,9 +583,7 @@ static __always_inline void trace_clear_recursion(int bit) | |||
| 583 | static inline struct ring_buffer_iter * | 583 | static inline struct ring_buffer_iter * |
| 584 | trace_buffer_iter(struct trace_iterator *iter, int cpu) | 584 | trace_buffer_iter(struct trace_iterator *iter, int cpu) |
| 585 | { | 585 | { |
| 586 | if (iter->buffer_iter && iter->buffer_iter[cpu]) | 586 | return iter->buffer_iter ? iter->buffer_iter[cpu] : NULL; |
| 587 | return iter->buffer_iter[cpu]; | ||
| 588 | return NULL; | ||
| 589 | } | 587 | } |
| 590 | 588 | ||
| 591 | int tracer_init(struct tracer *t, struct trace_array *tr); | 589 | int tracer_init(struct tracer *t, struct trace_array *tr); |
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 0dceb77d1d42..893a206bcba4 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
| @@ -1701,6 +1701,7 @@ static void create_filter_finish(struct filter_parse_error *pe) | |||
| 1701 | * @filter_str: filter string | 1701 | * @filter_str: filter string |
| 1702 | * @set_str: remember @filter_str and enable detailed error in filter | 1702 | * @set_str: remember @filter_str and enable detailed error in filter |
| 1703 | * @filterp: out param for created filter (always updated on return) | 1703 | * @filterp: out param for created filter (always updated on return) |
| 1704 | * Must be a pointer that references a NULL pointer. | ||
| 1704 | * | 1705 | * |
| 1705 | * Creates a filter for @call with @filter_str. If @set_str is %true, | 1706 | * Creates a filter for @call with @filter_str. If @set_str is %true, |
| 1706 | * @filter_str is copied and recorded in the new filter. | 1707 | * @filter_str is copied and recorded in the new filter. |
| @@ -1718,6 +1719,10 @@ static int create_filter(struct trace_event_call *call, | |||
| 1718 | struct filter_parse_error *pe = NULL; | 1719 | struct filter_parse_error *pe = NULL; |
| 1719 | int err; | 1720 | int err; |
| 1720 | 1721 | ||
| 1722 | /* filterp must point to NULL */ | ||
| 1723 | if (WARN_ON(*filterp)) | ||
| 1724 | *filterp = NULL; | ||
| 1725 | |||
| 1721 | err = create_filter_start(filter_string, set_str, &pe, filterp); | 1726 | err = create_filter_start(filter_string, set_str, &pe, filterp); |
| 1722 | if (err) | 1727 | if (err) |
| 1723 | return err; | 1728 | return err; |
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 046c716a6536..aae18af94c94 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c | |||
| @@ -393,7 +393,7 @@ static void hist_err_event(char *str, char *system, char *event, char *var) | |||
| 393 | else if (system) | 393 | else if (system) |
| 394 | snprintf(err, MAX_FILTER_STR_VAL, "%s.%s", system, event); | 394 | snprintf(err, MAX_FILTER_STR_VAL, "%s.%s", system, event); |
| 395 | else | 395 | else |
| 396 | strncpy(err, var, MAX_FILTER_STR_VAL); | 396 | strscpy(err, var, MAX_FILTER_STR_VAL); |
| 397 | 397 | ||
| 398 | hist_err(str, err); | 398 | hist_err(str, err); |
| 399 | } | 399 | } |
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 23c0b0cb5fb9..169b3c44ee97 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c | |||
| @@ -831,6 +831,7 @@ print_graph_entry_leaf(struct trace_iterator *iter, | |||
| 831 | struct ftrace_graph_ret *graph_ret; | 831 | struct ftrace_graph_ret *graph_ret; |
| 832 | struct ftrace_graph_ent *call; | 832 | struct ftrace_graph_ent *call; |
| 833 | unsigned long long duration; | 833 | unsigned long long duration; |
| 834 | int cpu = iter->cpu; | ||
| 834 | int i; | 835 | int i; |
| 835 | 836 | ||
| 836 | graph_ret = &ret_entry->ret; | 837 | graph_ret = &ret_entry->ret; |
| @@ -839,7 +840,6 @@ print_graph_entry_leaf(struct trace_iterator *iter, | |||
| 839 | 840 | ||
| 840 | if (data) { | 841 | if (data) { |
| 841 | struct fgraph_cpu_data *cpu_data; | 842 | struct fgraph_cpu_data *cpu_data; |
| 842 | int cpu = iter->cpu; | ||
| 843 | 843 | ||
| 844 | cpu_data = per_cpu_ptr(data->cpu_data, cpu); | 844 | cpu_data = per_cpu_ptr(data->cpu_data, cpu); |
| 845 | 845 | ||
| @@ -869,6 +869,9 @@ print_graph_entry_leaf(struct trace_iterator *iter, | |||
| 869 | 869 | ||
| 870 | trace_seq_printf(s, "%ps();\n", (void *)call->func); | 870 | trace_seq_printf(s, "%ps();\n", (void *)call->func); |
| 871 | 871 | ||
| 872 | print_graph_irq(iter, graph_ret->func, TRACE_GRAPH_RET, | ||
| 873 | cpu, iter->ent->pid, flags); | ||
| 874 | |||
| 872 | return trace_handle_return(s); | 875 | return trace_handle_return(s); |
| 873 | } | 876 | } |
| 874 | 877 | ||
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index daa81571b22a..21f718472942 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
| @@ -1480,8 +1480,10 @@ create_local_trace_kprobe(char *func, void *addr, unsigned long offs, | |||
| 1480 | } | 1480 | } |
| 1481 | 1481 | ||
| 1482 | ret = __register_trace_kprobe(tk); | 1482 | ret = __register_trace_kprobe(tk); |
| 1483 | if (ret < 0) | 1483 | if (ret < 0) { |
| 1484 | kfree(tk->tp.call.print_fmt); | ||
| 1484 | goto error; | 1485 | goto error; |
| 1486 | } | ||
| 1485 | 1487 | ||
| 1486 | return &tk->tp.call; | 1488 | return &tk->tp.call; |
| 1487 | error: | 1489 | error: |
| @@ -1501,6 +1503,8 @@ void destroy_local_trace_kprobe(struct trace_event_call *event_call) | |||
| 1501 | } | 1503 | } |
| 1502 | 1504 | ||
| 1503 | __unregister_trace_kprobe(tk); | 1505 | __unregister_trace_kprobe(tk); |
| 1506 | |||
| 1507 | kfree(tk->tp.call.print_fmt); | ||
| 1504 | free_trace_kprobe(tk); | 1508 | free_trace_kprobe(tk); |
| 1505 | } | 1509 | } |
| 1506 | #endif /* CONFIG_PERF_EVENTS */ | 1510 | #endif /* CONFIG_PERF_EVENTS */ |
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 90db994ac900..1c8e30fda46a 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
| @@ -594,8 +594,7 @@ int trace_print_context(struct trace_iterator *iter) | |||
| 594 | 594 | ||
| 595 | trace_find_cmdline(entry->pid, comm); | 595 | trace_find_cmdline(entry->pid, comm); |
| 596 | 596 | ||
| 597 | trace_seq_printf(s, "%16s-%-5d [%03d] ", | 597 | trace_seq_printf(s, "%16s-%-5d ", comm, entry->pid); |
| 598 | comm, entry->pid, iter->cpu); | ||
| 599 | 598 | ||
| 600 | if (tr->trace_flags & TRACE_ITER_RECORD_TGID) { | 599 | if (tr->trace_flags & TRACE_ITER_RECORD_TGID) { |
| 601 | unsigned int tgid = trace_find_tgid(entry->pid); | 600 | unsigned int tgid = trace_find_tgid(entry->pid); |
| @@ -606,6 +605,8 @@ int trace_print_context(struct trace_iterator *iter) | |||
| 606 | trace_seq_printf(s, "(%5d) ", tgid); | 605 | trace_seq_printf(s, "(%5d) ", tgid); |
| 607 | } | 606 | } |
| 608 | 607 | ||
| 608 | trace_seq_printf(s, "[%03d] ", iter->cpu); | ||
| 609 | |||
| 609 | if (tr->trace_flags & TRACE_ITER_IRQ_INFO) | 610 | if (tr->trace_flags & TRACE_ITER_IRQ_INFO) |
| 610 | trace_print_lat_fmt(s, entry); | 611 | trace_print_lat_fmt(s, entry); |
| 611 | 612 | ||
diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index 3d35d062970d..c253c1b46c6b 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan | |||
| @@ -6,6 +6,7 @@ if HAVE_ARCH_KASAN | |||
| 6 | config KASAN | 6 | config KASAN |
| 7 | bool "KASan: runtime memory debugger" | 7 | bool "KASan: runtime memory debugger" |
| 8 | depends on SLUB || (SLAB && !DEBUG_SLAB) | 8 | depends on SLUB || (SLAB && !DEBUG_SLAB) |
| 9 | select SLUB_DEBUG if SLUB | ||
| 9 | select CONSTRUCTORS | 10 | select CONSTRUCTORS |
| 10 | select STACKDEPOT | 11 | select STACKDEPOT |
| 11 | help | 12 | help |
diff --git a/lib/percpu_ida.c b/lib/percpu_ida.c index 9bbd9c5d375a..beb14839b41a 100644 --- a/lib/percpu_ida.c +++ b/lib/percpu_ida.c | |||
| @@ -141,7 +141,7 @@ int percpu_ida_alloc(struct percpu_ida *pool, int state) | |||
| 141 | spin_lock_irqsave(&tags->lock, flags); | 141 | spin_lock_irqsave(&tags->lock, flags); |
| 142 | 142 | ||
| 143 | /* Fastpath */ | 143 | /* Fastpath */ |
| 144 | if (likely(tags->nr_free >= 0)) { | 144 | if (likely(tags->nr_free)) { |
| 145 | tag = tags->freelist[--tags->nr_free]; | 145 | tag = tags->freelist[--tags->nr_free]; |
| 146 | spin_unlock_irqrestore(&tags->lock, flags); | 146 | spin_unlock_irqrestore(&tags->lock, flags); |
| 147 | return tag; | 147 | return tag; |
diff --git a/lib/scatterlist.c b/lib/scatterlist.c index 1642fd507a96..7c6096a71704 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c | |||
| @@ -24,9 +24,6 @@ | |||
| 24 | **/ | 24 | **/ |
| 25 | struct scatterlist *sg_next(struct scatterlist *sg) | 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 | if (sg_is_last(sg)) | 27 | if (sg_is_last(sg)) |
| 31 | return NULL; | 28 | return NULL; |
| 32 | 29 | ||
| @@ -111,10 +108,7 @@ struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents) | |||
| 111 | for_each_sg(sgl, sg, nents, i) | 108 | for_each_sg(sgl, sg, nents, i) |
| 112 | ret = sg; | 109 | ret = sg; |
| 113 | 110 | ||
| 114 | #ifdef CONFIG_DEBUG_SG | ||
| 115 | BUG_ON(sgl[0].sg_magic != SG_MAGIC); | ||
| 116 | BUG_ON(!sg_is_last(ret)); | 111 | BUG_ON(!sg_is_last(ret)); |
| 117 | #endif | ||
| 118 | return ret; | 112 | return ret; |
| 119 | } | 113 | } |
| 120 | EXPORT_SYMBOL(sg_last); | 114 | EXPORT_SYMBOL(sg_last); |
diff --git a/lib/test_bpf.c b/lib/test_bpf.c index 60aedc879361..08d3d59dca17 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c | |||
| @@ -5282,21 +5282,31 @@ static struct bpf_test tests[] = { | |||
| 5282 | { /* Mainly checking JIT here. */ | 5282 | { /* Mainly checking JIT here. */ |
| 5283 | "BPF_MAXINSNS: Ctx heavy transformations", | 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 | CLASSIC, | 5288 | CLASSIC, |
| 5289 | #endif | ||
| 5286 | { }, | 5290 | { }, |
| 5287 | { | 5291 | { |
| 5288 | { 1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }, | 5292 | { 1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }, |
| 5289 | { 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) } | 5293 | { 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) } |
| 5290 | }, | 5294 | }, |
| 5291 | .fill_helper = bpf_fill_maxinsns6, | 5295 | .fill_helper = bpf_fill_maxinsns6, |
| 5296 | .expected_errcode = -ENOTSUPP, | ||
| 5292 | }, | 5297 | }, |
| 5293 | { /* Mainly checking JIT here. */ | 5298 | { /* Mainly checking JIT here. */ |
| 5294 | "BPF_MAXINSNS: Call heavy transformations", | 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 | CLASSIC | FLAG_NO_DATA, | 5304 | CLASSIC | FLAG_NO_DATA, |
| 5305 | #endif | ||
| 5297 | { }, | 5306 | { }, |
| 5298 | { { 1, 0 }, { 10, 0 } }, | 5307 | { { 1, 0 }, { 10, 0 } }, |
| 5299 | .fill_helper = bpf_fill_maxinsns7, | 5308 | .fill_helper = bpf_fill_maxinsns7, |
| 5309 | .expected_errcode = -ENOTSUPP, | ||
| 5300 | }, | 5310 | }, |
| 5301 | { /* Mainly checking JIT here. */ | 5311 | { /* Mainly checking JIT here. */ |
| 5302 | "BPF_MAXINSNS: Jump heavy test", | 5312 | "BPF_MAXINSNS: Jump heavy test", |
| @@ -5347,18 +5357,28 @@ static struct bpf_test tests[] = { | |||
| 5347 | { | 5357 | { |
| 5348 | "BPF_MAXINSNS: exec all MSH", | 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 | CLASSIC, | 5363 | CLASSIC, |
| 5364 | #endif | ||
| 5351 | { 0xfa, 0xfb, 0xfc, 0xfd, }, | 5365 | { 0xfa, 0xfb, 0xfc, 0xfd, }, |
| 5352 | { { 4, 0xababab83 } }, | 5366 | { { 4, 0xababab83 } }, |
| 5353 | .fill_helper = bpf_fill_maxinsns13, | 5367 | .fill_helper = bpf_fill_maxinsns13, |
| 5368 | .expected_errcode = -ENOTSUPP, | ||
| 5354 | }, | 5369 | }, |
| 5355 | { | 5370 | { |
| 5356 | "BPF_MAXINSNS: ld_abs+get_processor_id", | 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 | CLASSIC, | 5376 | CLASSIC, |
| 5377 | #endif | ||
| 5359 | { }, | 5378 | { }, |
| 5360 | { { 1, 0xbee } }, | 5379 | { { 1, 0xbee } }, |
| 5361 | .fill_helper = bpf_fill_ld_abs_get_processor_id, | 5380 | .fill_helper = bpf_fill_ld_abs_get_processor_id, |
| 5381 | .expected_errcode = -ENOTSUPP, | ||
| 5362 | }, | 5382 | }, |
| 5363 | /* | 5383 | /* |
| 5364 | * LD_IND / LD_ABS on fragmented SKBs | 5384 | * LD_IND / LD_ABS on fragmented SKBs |
diff --git a/lib/test_printf.c b/lib/test_printf.c index b2aa8f514844..cea592f402ed 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c | |||
| @@ -260,13 +260,6 @@ plain(void) | |||
| 260 | { | 260 | { |
| 261 | int err; | 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 | err = plain_hash(); | 263 | err = plain_hash(); |
| 271 | if (err) { | 264 | if (err) { |
| 272 | pr_warn("plain 'p' does not appear to be hashed\n"); | 265 | pr_warn("plain 'p' does not appear to be hashed\n"); |
diff --git a/mm/debug.c b/mm/debug.c index 56e2d9125ea5..38c926520c97 100644 --- a/mm/debug.c +++ b/mm/debug.c | |||
| @@ -43,12 +43,25 @@ const struct trace_print_flags vmaflag_names[] = { | |||
| 43 | 43 | ||
| 44 | void __dump_page(struct page *page, const char *reason) | 44 | void __dump_page(struct page *page, const char *reason) |
| 45 | { | 45 | { |
| 46 | bool page_poisoned = PagePoisoned(page); | ||
| 47 | int mapcount; | ||
| 48 | |||
| 49 | /* | ||
| 50 | * If struct page is poisoned don't access Page*() functions as that | ||
| 51 | * leads to recursive loop. Page*() check for poisoned pages, and calls | ||
| 52 | * dump_page() when detected. | ||
| 53 | */ | ||
| 54 | if (page_poisoned) { | ||
| 55 | pr_emerg("page:%px is uninitialized and poisoned", page); | ||
| 56 | goto hex_only; | ||
| 57 | } | ||
| 58 | |||
| 46 | /* | 59 | /* |
| 47 | * Avoid VM_BUG_ON() in page_mapcount(). | 60 | * Avoid VM_BUG_ON() in page_mapcount(). |
| 48 | * page->_mapcount space in struct page is used by sl[aou]b pages to | 61 | * page->_mapcount space in struct page is used by sl[aou]b pages to |
| 49 | * encode own info. | 62 | * encode own info. |
| 50 | */ | 63 | */ |
| 51 | int mapcount = PageSlab(page) ? 0 : page_mapcount(page); | 64 | mapcount = PageSlab(page) ? 0 : page_mapcount(page); |
| 52 | 65 | ||
| 53 | pr_emerg("page:%px count:%d mapcount:%d mapping:%px index:%#lx", | 66 | pr_emerg("page:%px count:%d mapcount:%d mapping:%px index:%#lx", |
| 54 | page, page_ref_count(page), mapcount, | 67 | page, page_ref_count(page), mapcount, |
| @@ -60,6 +73,7 @@ void __dump_page(struct page *page, const char *reason) | |||
| 60 | 73 | ||
| 61 | pr_emerg("flags: %#lx(%pGp)\n", page->flags, &page->flags); | 74 | pr_emerg("flags: %#lx(%pGp)\n", page->flags, &page->flags); |
| 62 | 75 | ||
| 76 | hex_only: | ||
| 63 | print_hex_dump(KERN_ALERT, "raw: ", DUMP_PREFIX_NONE, 32, | 77 | print_hex_dump(KERN_ALERT, "raw: ", DUMP_PREFIX_NONE, 32, |
| 64 | sizeof(unsigned long), page, | 78 | sizeof(unsigned long), page, |
| 65 | sizeof(struct page), false); | 79 | sizeof(struct page), false); |
| @@ -68,7 +82,7 @@ void __dump_page(struct page *page, const char *reason) | |||
| 68 | pr_alert("page dumped because: %s\n", reason); | 82 | pr_alert("page dumped because: %s\n", reason); |
| 69 | 83 | ||
| 70 | #ifdef CONFIG_MEMCG | 84 | #ifdef CONFIG_MEMCG |
| 71 | if (page->mem_cgroup) | 85 | if (!page_poisoned && page->mem_cgroup) |
| 72 | pr_alert("page->mem_cgroup:%px\n", page->mem_cgroup); | 86 | pr_alert("page->mem_cgroup:%px\n", page->mem_cgroup); |
| 73 | #endif | 87 | #endif |
| 74 | } | 88 | } |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 3612fbb32e9d..039ddbc574e9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
| @@ -2163,6 +2163,7 @@ static void __init gather_bootmem_prealloc(void) | |||
| 2163 | */ | 2163 | */ |
| 2164 | if (hstate_is_gigantic(h)) | 2164 | if (hstate_is_gigantic(h)) |
| 2165 | adjust_managed_page_count(page, 1 << h->order); | 2165 | adjust_managed_page_count(page, 1 << h->order); |
| 2166 | cond_resched(); | ||
| 2166 | } | 2167 | } |
| 2167 | } | 2168 | } |
| 2168 | 2169 | ||
diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index f185455b3406..c3bd5209da38 100644 --- a/mm/kasan/kasan.c +++ b/mm/kasan/kasan.c | |||
| @@ -619,12 +619,13 @@ void kasan_kfree_large(void *ptr, unsigned long ip) | |||
| 619 | int kasan_module_alloc(void *addr, size_t size) | 619 | int kasan_module_alloc(void *addr, size_t size) |
| 620 | { | 620 | { |
| 621 | void *ret; | 621 | void *ret; |
| 622 | size_t scaled_size; | ||
| 622 | size_t shadow_size; | 623 | size_t shadow_size; |
| 623 | unsigned long shadow_start; | 624 | unsigned long shadow_start; |
| 624 | 625 | ||
| 625 | shadow_start = (unsigned long)kasan_mem_to_shadow(addr); | 626 | shadow_start = (unsigned long)kasan_mem_to_shadow(addr); |
| 626 | shadow_size = round_up(size >> KASAN_SHADOW_SCALE_SHIFT, | 627 | scaled_size = (size + KASAN_SHADOW_MASK) >> KASAN_SHADOW_SCALE_SHIFT; |
| 627 | PAGE_SIZE); | 628 | shadow_size = round_up(scaled_size, PAGE_SIZE); |
| 628 | 629 | ||
| 629 | if (WARN_ON(!PAGE_ALIGNED(shadow_start))) | 630 | if (WARN_ON(!PAGE_ALIGNED(shadow_start))) |
| 630 | return -EINVAL; | 631 | return -EINVAL; |
diff --git a/mm/slab_common.c b/mm/slab_common.c index 890b1f04a03a..2296caf87bfb 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c | |||
| @@ -567,10 +567,14 @@ static int shutdown_cache(struct kmem_cache *s) | |||
| 567 | list_del(&s->list); | 567 | list_del(&s->list); |
| 568 | 568 | ||
| 569 | if (s->flags & SLAB_TYPESAFE_BY_RCU) { | 569 | if (s->flags & SLAB_TYPESAFE_BY_RCU) { |
| 570 | #ifdef SLAB_SUPPORTS_SYSFS | ||
| 571 | sysfs_slab_unlink(s); | ||
| 572 | #endif | ||
| 570 | list_add_tail(&s->list, &slab_caches_to_rcu_destroy); | 573 | list_add_tail(&s->list, &slab_caches_to_rcu_destroy); |
| 571 | schedule_work(&slab_caches_to_rcu_destroy_work); | 574 | schedule_work(&slab_caches_to_rcu_destroy_work); |
| 572 | } else { | 575 | } else { |
| 573 | #ifdef SLAB_SUPPORTS_SYSFS | 576 | #ifdef SLAB_SUPPORTS_SYSFS |
| 577 | sysfs_slab_unlink(s); | ||
| 574 | sysfs_slab_release(s); | 578 | sysfs_slab_release(s); |
| 575 | #else | 579 | #else |
| 576 | slab_kmem_cache_release(s); | 580 | slab_kmem_cache_release(s); |
| @@ -5667,7 +5667,6 @@ static void sysfs_slab_remove_workfn(struct work_struct *work) | |||
| 5667 | kset_unregister(s->memcg_kset); | 5667 | kset_unregister(s->memcg_kset); |
| 5668 | #endif | 5668 | #endif |
| 5669 | kobject_uevent(&s->kobj, KOBJ_REMOVE); | 5669 | kobject_uevent(&s->kobj, KOBJ_REMOVE); |
| 5670 | kobject_del(&s->kobj); | ||
| 5671 | out: | 5670 | out: |
| 5672 | kobject_put(&s->kobj); | 5671 | kobject_put(&s->kobj); |
| 5673 | } | 5672 | } |
| @@ -5752,6 +5751,12 @@ static void sysfs_slab_remove(struct kmem_cache *s) | |||
| 5752 | schedule_work(&s->kobj_remove_work); | 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 | void sysfs_slab_release(struct kmem_cache *s) | 5760 | void sysfs_slab_release(struct kmem_cache *s) |
| 5756 | { | 5761 | { |
| 5757 | if (slab_state >= FULL) | 5762 | if (slab_state >= FULL) |
diff --git a/mm/vmstat.c b/mm/vmstat.c index 75eda9c2b260..8ba0870ecddd 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
| @@ -1796,11 +1796,9 @@ static void vmstat_update(struct work_struct *w) | |||
| 1796 | * to occur in the future. Keep on running the | 1796 | * to occur in the future. Keep on running the |
| 1797 | * update worker thread. | 1797 | * update worker thread. |
| 1798 | */ | 1798 | */ |
| 1799 | preempt_disable(); | ||
| 1800 | queue_delayed_work_on(smp_processor_id(), mm_percpu_wq, | 1799 | queue_delayed_work_on(smp_processor_id(), mm_percpu_wq, |
| 1801 | this_cpu_ptr(&vmstat_work), | 1800 | this_cpu_ptr(&vmstat_work), |
| 1802 | round_jiffies_relative(sysctl_stat_interval)); | 1801 | round_jiffies_relative(sysctl_stat_interval)); |
| 1803 | preempt_enable(); | ||
| 1804 | } | 1802 | } |
| 1805 | } | 1803 | } |
| 1806 | 1804 | ||
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 73a65789271b..8ccee3d01822 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
| @@ -693,7 +693,7 @@ static struct sk_buff **vlan_gro_receive(struct sk_buff **head, | |||
| 693 | out_unlock: | 693 | out_unlock: |
| 694 | rcu_read_unlock(); | 694 | rcu_read_unlock(); |
| 695 | out: | 695 | out: |
| 696 | NAPI_GRO_CB(skb)->flush |= flush; | 696 | skb_gro_flush_final(skb, pp, flush); |
| 697 | 697 | ||
| 698 | return pp; | 698 | return pp; |
| 699 | } | 699 | } |
diff --git a/net/Makefile b/net/Makefile index 13ec0d5415c7..bdaf53925acd 100644 --- a/net/Makefile +++ b/net/Makefile | |||
| @@ -20,11 +20,7 @@ obj-$(CONFIG_TLS) += tls/ | |||
| 20 | obj-$(CONFIG_XFRM) += xfrm/ | 20 | obj-$(CONFIG_XFRM) += xfrm/ |
| 21 | obj-$(CONFIG_UNIX) += unix/ | 21 | obj-$(CONFIG_UNIX) += unix/ |
| 22 | obj-$(CONFIG_NET) += ipv6/ | 22 | obj-$(CONFIG_NET) += ipv6/ |
| 23 | ifneq ($(CC_CAN_LINK),y) | ||
| 24 | $(warning CC cannot link executables. Skipping bpfilter.) | ||
| 25 | else | ||
| 26 | obj-$(CONFIG_BPFILTER) += bpfilter/ | 23 | obj-$(CONFIG_BPFILTER) += bpfilter/ |
| 27 | endif | ||
| 28 | obj-$(CONFIG_PACKET) += packet/ | 24 | obj-$(CONFIG_PACKET) += packet/ |
| 29 | obj-$(CONFIG_NET_KEY) += key/ | 25 | obj-$(CONFIG_NET_KEY) += key/ |
| 30 | obj-$(CONFIG_BRIDGE) += bridge/ | 26 | obj-$(CONFIG_BRIDGE) += bridge/ |
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 55fdba05d7d9..9b6bc5abe946 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c | |||
| @@ -1869,7 +1869,7 @@ static const struct proto_ops atalk_dgram_ops = { | |||
| 1869 | .socketpair = sock_no_socketpair, | 1869 | .socketpair = sock_no_socketpair, |
| 1870 | .accept = sock_no_accept, | 1870 | .accept = sock_no_accept, |
| 1871 | .getname = atalk_getname, | 1871 | .getname = atalk_getname, |
| 1872 | .poll_mask = datagram_poll_mask, | 1872 | .poll = datagram_poll, |
| 1873 | .ioctl = atalk_ioctl, | 1873 | .ioctl = atalk_ioctl, |
| 1874 | #ifdef CONFIG_COMPAT | 1874 | #ifdef CONFIG_COMPAT |
| 1875 | .compat_ioctl = atalk_compat_ioctl, | 1875 | .compat_ioctl = atalk_compat_ioctl, |
diff --git a/net/atm/common.c b/net/atm/common.c index ff5748b2190f..a7a68e509628 100644 --- a/net/atm/common.c +++ b/net/atm/common.c | |||
| @@ -647,11 +647,16 @@ out: | |||
| 647 | return error; | 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 | struct sock *sk = sock->sk; | 652 | struct sock *sk = sock->sk; |
| 653 | struct atm_vcc *vcc = ATM_SD(sock); | 653 | struct atm_vcc *vcc; |
| 654 | __poll_t mask = 0; | 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 | /* exceptional events */ | 661 | /* exceptional events */ |
| 657 | if (sk->sk_err) | 662 | if (sk->sk_err) |
diff --git a/net/atm/common.h b/net/atm/common.h index 526796ad230f..5850649068bb 100644 --- a/net/atm/common.h +++ b/net/atm/common.h | |||
| @@ -17,7 +17,7 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci); | |||
| 17 | int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, | 17 | int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, |
| 18 | int flags); | 18 | int flags); |
| 19 | int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len); | 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 | int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 21 | int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 22 | int vcc_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 22 | int vcc_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 23 | int vcc_setsockopt(struct socket *sock, int level, int optname, | 23 | int vcc_setsockopt(struct socket *sock, int level, int optname, |
diff --git a/net/atm/pvc.c b/net/atm/pvc.c index 9f75092fe778..2cb10af16afc 100644 --- a/net/atm/pvc.c +++ b/net/atm/pvc.c | |||
| @@ -113,7 +113,7 @@ static const struct proto_ops pvc_proto_ops = { | |||
| 113 | .socketpair = sock_no_socketpair, | 113 | .socketpair = sock_no_socketpair, |
| 114 | .accept = sock_no_accept, | 114 | .accept = sock_no_accept, |
| 115 | .getname = pvc_getname, | 115 | .getname = pvc_getname, |
| 116 | .poll_mask = vcc_poll_mask, | 116 | .poll = vcc_poll, |
| 117 | .ioctl = vcc_ioctl, | 117 | .ioctl = vcc_ioctl, |
| 118 | #ifdef CONFIG_COMPAT | 118 | #ifdef CONFIG_COMPAT |
| 119 | .compat_ioctl = vcc_compat_ioctl, | 119 | .compat_ioctl = vcc_compat_ioctl, |
diff --git a/net/atm/svc.c b/net/atm/svc.c index 53f4ad7087b1..2f91b766ac42 100644 --- a/net/atm/svc.c +++ b/net/atm/svc.c | |||
| @@ -636,7 +636,7 @@ static const struct proto_ops svc_proto_ops = { | |||
| 636 | .socketpair = sock_no_socketpair, | 636 | .socketpair = sock_no_socketpair, |
| 637 | .accept = svc_accept, | 637 | .accept = svc_accept, |
| 638 | .getname = svc_getname, | 638 | .getname = svc_getname, |
| 639 | .poll_mask = vcc_poll_mask, | 639 | .poll = vcc_poll, |
| 640 | .ioctl = svc_ioctl, | 640 | .ioctl = svc_ioctl, |
| 641 | #ifdef CONFIG_COMPAT | 641 | #ifdef CONFIG_COMPAT |
| 642 | .compat_ioctl = svc_compat_ioctl, | 642 | .compat_ioctl = svc_compat_ioctl, |
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index d1d2442ce573..c603d33d5410 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
| @@ -1941,7 +1941,7 @@ static const struct proto_ops ax25_proto_ops = { | |||
| 1941 | .socketpair = sock_no_socketpair, | 1941 | .socketpair = sock_no_socketpair, |
| 1942 | .accept = ax25_accept, | 1942 | .accept = ax25_accept, |
| 1943 | .getname = ax25_getname, | 1943 | .getname = ax25_getname, |
| 1944 | .poll_mask = datagram_poll_mask, | 1944 | .poll = datagram_poll, |
| 1945 | .ioctl = ax25_ioctl, | 1945 | .ioctl = ax25_ioctl, |
| 1946 | .listen = ax25_listen, | 1946 | .listen = ax25_listen, |
| 1947 | .shutdown = ax25_shutdown, | 1947 | .shutdown = ax25_shutdown, |
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 510ab4f55df5..3264e1873219 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
| @@ -437,13 +437,16 @@ static inline __poll_t bt_accept_poll(struct sock *parent) | |||
| 437 | return 0; | 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 | struct sock *sk = sock->sk; | 443 | struct sock *sk = sock->sk; |
| 443 | __poll_t mask = 0; | 444 | __poll_t mask = 0; |
| 444 | 445 | ||
| 445 | BT_DBG("sock %p, sk %p", sock, sk); | 446 | BT_DBG("sock %p, sk %p", sock, sk); |
| 446 | 447 | ||
| 448 | poll_wait(file, sk_sleep(sk), wait); | ||
| 449 | |||
| 447 | if (sk->sk_state == BT_LISTEN) | 450 | if (sk->sk_state == BT_LISTEN) |
| 448 | return bt_accept_poll(sk); | 451 | return bt_accept_poll(sk); |
| 449 | 452 | ||
| @@ -475,7 +478,7 @@ __poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events) | |||
| 475 | 478 | ||
| 476 | return mask; | 479 | return mask; |
| 477 | } | 480 | } |
| 478 | EXPORT_SYMBOL(bt_sock_poll_mask); | 481 | EXPORT_SYMBOL(bt_sock_poll); |
| 479 | 482 | ||
| 480 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | 483 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) |
| 481 | { | 484 | { |
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index d6c099861538..1506e1632394 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
| @@ -1975,7 +1975,7 @@ static const struct proto_ops hci_sock_ops = { | |||
| 1975 | .sendmsg = hci_sock_sendmsg, | 1975 | .sendmsg = hci_sock_sendmsg, |
| 1976 | .recvmsg = hci_sock_recvmsg, | 1976 | .recvmsg = hci_sock_recvmsg, |
| 1977 | .ioctl = hci_sock_ioctl, | 1977 | .ioctl = hci_sock_ioctl, |
| 1978 | .poll_mask = datagram_poll_mask, | 1978 | .poll = datagram_poll, |
| 1979 | .listen = sock_no_listen, | 1979 | .listen = sock_no_listen, |
| 1980 | .shutdown = sock_no_shutdown, | 1980 | .shutdown = sock_no_shutdown, |
| 1981 | .setsockopt = hci_sock_setsockopt, | 1981 | .setsockopt = hci_sock_setsockopt, |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 742a190034e6..686bdc6b35b0 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
| @@ -1653,7 +1653,7 @@ static const struct proto_ops l2cap_sock_ops = { | |||
| 1653 | .getname = l2cap_sock_getname, | 1653 | .getname = l2cap_sock_getname, |
| 1654 | .sendmsg = l2cap_sock_sendmsg, | 1654 | .sendmsg = l2cap_sock_sendmsg, |
| 1655 | .recvmsg = l2cap_sock_recvmsg, | 1655 | .recvmsg = l2cap_sock_recvmsg, |
| 1656 | .poll_mask = bt_sock_poll_mask, | 1656 | .poll = bt_sock_poll, |
| 1657 | .ioctl = bt_sock_ioctl, | 1657 | .ioctl = bt_sock_ioctl, |
| 1658 | .mmap = sock_no_mmap, | 1658 | .mmap = sock_no_mmap, |
| 1659 | .socketpair = sock_no_socketpair, | 1659 | .socketpair = sock_no_socketpair, |
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index 1cf57622473a..d606e9212291 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
| @@ -1049,7 +1049,7 @@ static const struct proto_ops rfcomm_sock_ops = { | |||
| 1049 | .setsockopt = rfcomm_sock_setsockopt, | 1049 | .setsockopt = rfcomm_sock_setsockopt, |
| 1050 | .getsockopt = rfcomm_sock_getsockopt, | 1050 | .getsockopt = rfcomm_sock_getsockopt, |
| 1051 | .ioctl = rfcomm_sock_ioctl, | 1051 | .ioctl = rfcomm_sock_ioctl, |
| 1052 | .poll_mask = bt_sock_poll_mask, | 1052 | .poll = bt_sock_poll, |
| 1053 | .socketpair = sock_no_socketpair, | 1053 | .socketpair = sock_no_socketpair, |
| 1054 | .mmap = sock_no_mmap | 1054 | .mmap = sock_no_mmap |
| 1055 | }; | 1055 | }; |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index d60dbc61d170..413b8ee49fec 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
| @@ -1197,7 +1197,7 @@ static const struct proto_ops sco_sock_ops = { | |||
| 1197 | .getname = sco_sock_getname, | 1197 | .getname = sco_sock_getname, |
| 1198 | .sendmsg = sco_sock_sendmsg, | 1198 | .sendmsg = sco_sock_sendmsg, |
| 1199 | .recvmsg = sco_sock_recvmsg, | 1199 | .recvmsg = sco_sock_recvmsg, |
| 1200 | .poll_mask = bt_sock_poll_mask, | 1200 | .poll = bt_sock_poll, |
| 1201 | .ioctl = bt_sock_ioctl, | 1201 | .ioctl = bt_sock_ioctl, |
| 1202 | .mmap = sock_no_mmap, | 1202 | .mmap = sock_no_mmap, |
| 1203 | .socketpair = sock_no_socketpair, | 1203 | .socketpair = sock_no_socketpair, |
diff --git a/net/bpfilter/Kconfig b/net/bpfilter/Kconfig index a948b072c28f..76deb6615883 100644 --- a/net/bpfilter/Kconfig +++ b/net/bpfilter/Kconfig | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | menuconfig BPFILTER | 1 | menuconfig BPFILTER |
| 2 | bool "BPF based packet filtering framework (BPFILTER)" | 2 | bool "BPF based packet filtering framework (BPFILTER)" |
| 3 | default n | ||
| 4 | depends on NET && BPF && INET | 3 | depends on NET && BPF && INET |
| 5 | help | 4 | help |
| 6 | This builds experimental bpfilter framework that is aiming to | 5 | This builds experimental bpfilter framework that is aiming to |
| @@ -9,6 +8,7 @@ menuconfig BPFILTER | |||
| 9 | if BPFILTER | 8 | if BPFILTER |
| 10 | config BPFILTER_UMH | 9 | config BPFILTER_UMH |
| 11 | tristate "bpfilter kernel module with user mode helper" | 10 | tristate "bpfilter kernel module with user mode helper" |
| 11 | depends on $(success,$(srctree)/scripts/cc-can-link.sh $(CC)) | ||
| 12 | default m | 12 | default m |
| 13 | help | 13 | help |
| 14 | This builds bpfilter kernel module with embedded user mode helper | 14 | This builds bpfilter kernel module with embedded user mode helper |
diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile index 051dc18b8ccb..39c6980b5d99 100644 --- a/net/bpfilter/Makefile +++ b/net/bpfilter/Makefile | |||
| @@ -15,20 +15,7 @@ ifeq ($(CONFIG_BPFILTER_UMH), y) | |||
| 15 | HOSTLDFLAGS += -static | 15 | HOSTLDFLAGS += -static |
| 16 | endif | 16 | endif |
| 17 | 17 | ||
| 18 | # a bit of elf magic to convert bpfilter_umh binary into a binary blob | 18 | $(obj)/bpfilter_umh_blob.o: $(obj)/bpfilter_umh |
| 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) | ||
| 32 | 19 | ||
| 33 | obj-$(CONFIG_BPFILTER_UMH) += bpfilter.o | 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 |
diff --git a/net/bpfilter/bpfilter_kern.c b/net/bpfilter/bpfilter_kern.c index 09522573f611..f0fc182d3db7 100644 --- a/net/bpfilter/bpfilter_kern.c +++ b/net/bpfilter/bpfilter_kern.c | |||
| @@ -10,11 +10,8 @@ | |||
| 10 | #include <linux/file.h> | 10 | #include <linux/file.h> |
| 11 | #include "msgfmt.h" | 11 | #include "msgfmt.h" |
| 12 | 12 | ||
| 13 | #define UMH_start _binary_net_bpfilter_bpfilter_umh_start | 13 | extern char bpfilter_umh_start; |
| 14 | #define UMH_end _binary_net_bpfilter_bpfilter_umh_end | 14 | extern char bpfilter_umh_end; |
| 15 | |||
| 16 | extern char UMH_start; | ||
| 17 | extern char UMH_end; | ||
| 18 | 15 | ||
| 19 | static struct umh_info info; | 16 | static struct umh_info info; |
| 20 | /* since ip_getsockopt() can run in parallel, serialize access to umh */ | 17 | /* since ip_getsockopt() can run in parallel, serialize access to umh */ |
| @@ -93,7 +90,9 @@ static int __init load_umh(void) | |||
| 93 | int err; | 90 | int err; |
| 94 | 91 | ||
| 95 | /* fork usermode process */ | 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 | if (err) | 96 | if (err) |
| 98 | return err; | 97 | return err; |
| 99 | pr_info("Loaded bpfilter_umh pid %d\n", info.pid); | 98 | pr_info("Loaded bpfilter_umh pid %d\n", info.pid); |
diff --git a/net/bpfilter/bpfilter_umh_blob.S b/net/bpfilter/bpfilter_umh_blob.S new file mode 100644 index 000000000000..40311d10d2f2 --- /dev/null +++ b/net/bpfilter/bpfilter_umh_blob.S | |||
| @@ -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: | ||
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index c7991867d622..a6fb1b3bcad9 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c | |||
| @@ -934,11 +934,15 @@ static int caif_release(struct socket *sock) | |||
| 934 | } | 934 | } |
| 935 | 935 | ||
| 936 | /* Copied from af_unix.c:unix_poll(), added CAIF tx_flow handling */ | 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 | struct sock *sk = sock->sk; | 940 | struct sock *sk = sock->sk; |
| 941 | __poll_t mask; | ||
| 940 | struct caifsock *cf_sk = container_of(sk, struct caifsock, sk); | 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 | /* exceptional events? */ | 947 | /* exceptional events? */ |
| 944 | if (sk->sk_err) | 948 | if (sk->sk_err) |
| @@ -972,7 +976,7 @@ static const struct proto_ops caif_seqpacket_ops = { | |||
| 972 | .socketpair = sock_no_socketpair, | 976 | .socketpair = sock_no_socketpair, |
| 973 | .accept = sock_no_accept, | 977 | .accept = sock_no_accept, |
| 974 | .getname = sock_no_getname, | 978 | .getname = sock_no_getname, |
| 975 | .poll_mask = caif_poll_mask, | 979 | .poll = caif_poll, |
| 976 | .ioctl = sock_no_ioctl, | 980 | .ioctl = sock_no_ioctl, |
| 977 | .listen = sock_no_listen, | 981 | .listen = sock_no_listen, |
| 978 | .shutdown = sock_no_shutdown, | 982 | .shutdown = sock_no_shutdown, |
| @@ -993,7 +997,7 @@ static const struct proto_ops caif_stream_ops = { | |||
| 993 | .socketpair = sock_no_socketpair, | 997 | .socketpair = sock_no_socketpair, |
| 994 | .accept = sock_no_accept, | 998 | .accept = sock_no_accept, |
| 995 | .getname = sock_no_getname, | 999 | .getname = sock_no_getname, |
| 996 | .poll_mask = caif_poll_mask, | 1000 | .poll = caif_poll, |
| 997 | .ioctl = sock_no_ioctl, | 1001 | .ioctl = sock_no_ioctl, |
| 998 | .listen = sock_no_listen, | 1002 | .listen = sock_no_listen, |
| 999 | .shutdown = sock_no_shutdown, | 1003 | .shutdown = sock_no_shutdown, |
diff --git a/net/can/bcm.c b/net/can/bcm.c index 9393f25df08d..0af8f0db892a 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c | |||
| @@ -1660,7 +1660,7 @@ static const struct proto_ops bcm_ops = { | |||
| 1660 | .socketpair = sock_no_socketpair, | 1660 | .socketpair = sock_no_socketpair, |
| 1661 | .accept = sock_no_accept, | 1661 | .accept = sock_no_accept, |
| 1662 | .getname = sock_no_getname, | 1662 | .getname = sock_no_getname, |
| 1663 | .poll_mask = datagram_poll_mask, | 1663 | .poll = datagram_poll, |
| 1664 | .ioctl = can_ioctl, /* use can_ioctl() from af_can.c */ | 1664 | .ioctl = can_ioctl, /* use can_ioctl() from af_can.c */ |
| 1665 | .listen = sock_no_listen, | 1665 | .listen = sock_no_listen, |
| 1666 | .shutdown = sock_no_shutdown, | 1666 | .shutdown = sock_no_shutdown, |
diff --git a/net/can/raw.c b/net/can/raw.c index fd7e2f49ea6a..1051eee82581 100644 --- a/net/can/raw.c +++ b/net/can/raw.c | |||
| @@ -843,7 +843,7 @@ static const struct proto_ops raw_ops = { | |||
| 843 | .socketpair = sock_no_socketpair, | 843 | .socketpair = sock_no_socketpair, |
| 844 | .accept = sock_no_accept, | 844 | .accept = sock_no_accept, |
| 845 | .getname = raw_getname, | 845 | .getname = raw_getname, |
| 846 | .poll_mask = datagram_poll_mask, | 846 | .poll = datagram_poll, |
| 847 | .ioctl = can_ioctl, /* use can_ioctl() from af_can.c */ | 847 | .ioctl = can_ioctl, /* use can_ioctl() from af_can.c */ |
| 848 | .listen = sock_no_listen, | 848 | .listen = sock_no_listen, |
| 849 | .shutdown = sock_no_shutdown, | 849 | .shutdown = sock_no_shutdown, |
diff --git a/net/core/datagram.c b/net/core/datagram.c index f19bf3dc2bd6..9938952c5c78 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c | |||
| @@ -819,8 +819,9 @@ EXPORT_SYMBOL(skb_copy_and_csum_datagram_msg); | |||
| 819 | 819 | ||
| 820 | /** | 820 | /** |
| 821 | * datagram_poll - generic datagram poll | 821 | * datagram_poll - generic datagram poll |
| 822 | * @file: file struct | ||
| 822 | * @sock: socket | 823 | * @sock: socket |
| 823 | * @events to wait for | 824 | * @wait: poll table |
| 824 | * | 825 | * |
| 825 | * Datagram poll: Again totally generic. This also handles | 826 | * Datagram poll: Again totally generic. This also handles |
| 826 | * sequenced packet sockets providing the socket receive queue | 827 | * sequenced packet sockets providing the socket receive queue |
| @@ -830,10 +831,14 @@ EXPORT_SYMBOL(skb_copy_and_csum_datagram_msg); | |||
| 830 | * and you use a different write policy from sock_writeable() | 831 | * and you use a different write policy from sock_writeable() |
| 831 | * then please supply your own write_space callback. | 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 | struct sock *sk = sock->sk; | 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 | /* exceptional events? */ | 843 | /* exceptional events? */ |
| 839 | if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) | 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) | |||
| 866 | 871 | ||
| 867 | return mask; | 872 | return mask; |
| 868 | } | 873 | } |
| 869 | EXPORT_SYMBOL(datagram_poll_mask); | 874 | EXPORT_SYMBOL(datagram_poll); |
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index a04e1e88bf3a..50537ff961a7 100644 --- a/net/core/dev_ioctl.c +++ b/net/core/dev_ioctl.c | |||
| @@ -285,16 +285,9 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd) | |||
| 285 | if (ifr->ifr_qlen < 0) | 285 | if (ifr->ifr_qlen < 0) |
| 286 | return -EINVAL; | 286 | return -EINVAL; |
| 287 | if (dev->tx_queue_len ^ ifr->ifr_qlen) { | 287 | if (dev->tx_queue_len ^ ifr->ifr_qlen) { |
| 288 | unsigned int orig_len = dev->tx_queue_len; | 288 | err = dev_change_tx_queue_len(dev, ifr->ifr_qlen); |
| 289 | 289 | if (err) | |
| 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; | ||
| 296 | return err; | 290 | return err; |
| 297 | } | ||
| 298 | } | 291 | } |
| 299 | return 0; | 292 | return 0; |
| 300 | 293 | ||
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 126ffc5bc630..f64aa13811ea 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
| @@ -416,6 +416,14 @@ static struct fib_rule *rule_find(struct fib_rules_ops *ops, | |||
| 416 | if (rule->mark && r->mark != rule->mark) | 416 | if (rule->mark && r->mark != rule->mark) |
| 417 | continue; | 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 | if (rule->mark_mask && r->mark_mask != rule->mark_mask) | 427 | if (rule->mark_mask && r->mark_mask != rule->mark_mask) |
| 420 | continue; | 428 | continue; |
| 421 | 429 | ||
| @@ -436,6 +444,9 @@ static struct fib_rule *rule_find(struct fib_rules_ops *ops, | |||
| 436 | if (rule->ip_proto && r->ip_proto != rule->ip_proto) | 444 | if (rule->ip_proto && r->ip_proto != rule->ip_proto) |
| 437 | continue; | 445 | continue; |
| 438 | 446 | ||
| 447 | if (rule->proto && r->proto != rule->proto) | ||
| 448 | continue; | ||
| 449 | |||
| 439 | if (fib_rule_port_range_set(&rule->sport_range) && | 450 | if (fib_rule_port_range_set(&rule->sport_range) && |
| 440 | !fib_rule_port_range_compare(&r->sport_range, | 451 | !fib_rule_port_range_compare(&r->sport_range, |
| 441 | &rule->sport_range)) | 452 | &rule->sport_range)) |
| @@ -645,6 +656,73 @@ errout: | |||
| 645 | return err; | 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 | int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, | 726 | int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, |
| 649 | struct netlink_ext_ack *extack) | 727 | struct netlink_ext_ack *extack) |
| 650 | { | 728 | { |
| @@ -679,7 +757,7 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 679 | goto errout; | 757 | goto errout; |
| 680 | 758 | ||
| 681 | if ((nlh->nlmsg_flags & NLM_F_EXCL) && | 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 | err = -EEXIST; | 761 | err = -EEXIST; |
| 684 | goto errout_free; | 762 | goto errout_free; |
| 685 | } | 763 | } |
diff --git a/net/core/filter.c b/net/core/filter.c index e7f12e9f598c..0ca6907d7efe 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
| @@ -4073,8 +4073,9 @@ static int bpf_fib_set_fwd_params(struct bpf_fib_lookup *params, | |||
| 4073 | memcpy(params->smac, dev->dev_addr, ETH_ALEN); | 4073 | memcpy(params->smac, dev->dev_addr, ETH_ALEN); |
| 4074 | params->h_vlan_TCI = 0; | 4074 | params->h_vlan_TCI = 0; |
| 4075 | params->h_vlan_proto = 0; | 4075 | params->h_vlan_proto = 0; |
| 4076 | params->ifindex = dev->ifindex; | ||
| 4076 | 4077 | ||
| 4077 | return dev->ifindex; | 4078 | return 0; |
| 4078 | } | 4079 | } |
| 4079 | #endif | 4080 | #endif |
| 4080 | 4081 | ||
| @@ -4098,7 +4099,7 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, | |||
| 4098 | /* verify forwarding is enabled on this interface */ | 4099 | /* verify forwarding is enabled on this interface */ |
| 4099 | in_dev = __in_dev_get_rcu(dev); | 4100 | in_dev = __in_dev_get_rcu(dev); |
| 4100 | if (unlikely(!in_dev || !IN_DEV_FORWARD(in_dev))) | 4101 | if (unlikely(!in_dev || !IN_DEV_FORWARD(in_dev))) |
| 4101 | return 0; | 4102 | return BPF_FIB_LKUP_RET_FWD_DISABLED; |
| 4102 | 4103 | ||
| 4103 | if (flags & BPF_FIB_LOOKUP_OUTPUT) { | 4104 | if (flags & BPF_FIB_LOOKUP_OUTPUT) { |
| 4104 | fl4.flowi4_iif = 1; | 4105 | fl4.flowi4_iif = 1; |
| @@ -4123,7 +4124,7 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, | |||
| 4123 | 4124 | ||
| 4124 | tb = fib_get_table(net, tbid); | 4125 | tb = fib_get_table(net, tbid); |
| 4125 | if (unlikely(!tb)) | 4126 | if (unlikely(!tb)) |
| 4126 | return 0; | 4127 | return BPF_FIB_LKUP_RET_NOT_FWDED; |
| 4127 | 4128 | ||
| 4128 | err = fib_table_lookup(tb, &fl4, &res, FIB_LOOKUP_NOREF); | 4129 | err = fib_table_lookup(tb, &fl4, &res, FIB_LOOKUP_NOREF); |
| 4129 | } else { | 4130 | } else { |
| @@ -4135,8 +4136,20 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, | |||
| 4135 | err = fib_lookup(net, &fl4, &res, FIB_LOOKUP_NOREF); | 4136 | err = fib_lookup(net, &fl4, &res, FIB_LOOKUP_NOREF); |
| 4136 | } | 4137 | } |
| 4137 | 4138 | ||
| 4138 | if (err || res.type != RTN_UNICAST) | 4139 | if (err) { |
| 4139 | return 0; | 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 | if (res.fi->fib_nhs > 1) | 4154 | if (res.fi->fib_nhs > 1) |
| 4142 | fib_select_path(net, &res, &fl4, NULL); | 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, | |||
| 4144 | if (check_mtu) { | 4157 | if (check_mtu) { |
| 4145 | mtu = ip_mtu_from_fib_result(&res, params->ipv4_dst); | 4158 | mtu = ip_mtu_from_fib_result(&res, params->ipv4_dst); |
| 4146 | if (params->tot_len > mtu) | 4159 | if (params->tot_len > mtu) |
| 4147 | return 0; | 4160 | return BPF_FIB_LKUP_RET_FRAG_NEEDED; |
| 4148 | } | 4161 | } |
| 4149 | 4162 | ||
| 4150 | nh = &res.fi->fib_nh[res.nh_sel]; | 4163 | nh = &res.fi->fib_nh[res.nh_sel]; |
| 4151 | 4164 | ||
| 4152 | /* do not handle lwt encaps right now */ | 4165 | /* do not handle lwt encaps right now */ |
| 4153 | if (nh->nh_lwtstate) | 4166 | if (nh->nh_lwtstate) |
| 4154 | return 0; | 4167 | return BPF_FIB_LKUP_RET_UNSUPP_LWT; |
| 4155 | 4168 | ||
| 4156 | dev = nh->nh_dev; | 4169 | dev = nh->nh_dev; |
| 4157 | if (unlikely(!dev)) | ||
| 4158 | return 0; | ||
| 4159 | |||
| 4160 | if (nh->nh_gw) | 4170 | if (nh->nh_gw) |
| 4161 | params->ipv4_dst = nh->nh_gw; | 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, | |||
| 4166 | * rcu_read_lock_bh is not needed here | 4176 | * rcu_read_lock_bh is not needed here |
| 4167 | */ | 4177 | */ |
| 4168 | neigh = __ipv4_neigh_lookup_noref(dev, (__force u32)params->ipv4_dst); | 4178 | neigh = __ipv4_neigh_lookup_noref(dev, (__force u32)params->ipv4_dst); |
| 4169 | if (neigh) | 4179 | if (!neigh) |
| 4170 | return bpf_fib_set_fwd_params(params, neigh, dev); | 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 | #endif | 4184 | #endif |
| 4175 | 4185 | ||
| @@ -4190,7 +4200,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, | |||
| 4190 | 4200 | ||
| 4191 | /* link local addresses are never forwarded */ | 4201 | /* link local addresses are never forwarded */ |
| 4192 | if (rt6_need_strict(dst) || rt6_need_strict(src)) | 4202 | if (rt6_need_strict(dst) || rt6_need_strict(src)) |
| 4193 | return 0; | 4203 | return BPF_FIB_LKUP_RET_NOT_FWDED; |
| 4194 | 4204 | ||
| 4195 | dev = dev_get_by_index_rcu(net, params->ifindex); | 4205 | dev = dev_get_by_index_rcu(net, params->ifindex); |
| 4196 | if (unlikely(!dev)) | 4206 | if (unlikely(!dev)) |
| @@ -4198,7 +4208,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, | |||
| 4198 | 4208 | ||
| 4199 | idev = __in6_dev_get_safely(dev); | 4209 | idev = __in6_dev_get_safely(dev); |
| 4200 | if (unlikely(!idev || !net->ipv6.devconf_all->forwarding)) | 4210 | if (unlikely(!idev || !net->ipv6.devconf_all->forwarding)) |
| 4201 | return 0; | 4211 | return BPF_FIB_LKUP_RET_FWD_DISABLED; |
| 4202 | 4212 | ||
| 4203 | if (flags & BPF_FIB_LOOKUP_OUTPUT) { | 4213 | if (flags & BPF_FIB_LOOKUP_OUTPUT) { |
| 4204 | fl6.flowi6_iif = 1; | 4214 | fl6.flowi6_iif = 1; |
| @@ -4225,7 +4235,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, | |||
| 4225 | 4235 | ||
| 4226 | tb = ipv6_stub->fib6_get_table(net, tbid); | 4236 | tb = ipv6_stub->fib6_get_table(net, tbid); |
| 4227 | if (unlikely(!tb)) | 4237 | if (unlikely(!tb)) |
| 4228 | return 0; | 4238 | return BPF_FIB_LKUP_RET_NOT_FWDED; |
| 4229 | 4239 | ||
| 4230 | f6i = ipv6_stub->fib6_table_lookup(net, tb, oif, &fl6, strict); | 4240 | f6i = ipv6_stub->fib6_table_lookup(net, tb, oif, &fl6, strict); |
| 4231 | } else { | 4241 | } else { |
| @@ -4238,11 +4248,23 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, | |||
| 4238 | } | 4248 | } |
| 4239 | 4249 | ||
| 4240 | if (unlikely(IS_ERR_OR_NULL(f6i) || f6i == net->ipv6.fib6_null_entry)) | 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 || | 4266 | if (f6i->fib6_type != RTN_UNICAST) |
| 4244 | f6i->fib6_type != RTN_UNICAST)) | 4267 | return BPF_FIB_LKUP_RET_NOT_FWDED; |
| 4245 | return 0; | ||
| 4246 | 4268 | ||
| 4247 | if (f6i->fib6_nsiblings && fl6.flowi6_oif == 0) | 4269 | if (f6i->fib6_nsiblings && fl6.flowi6_oif == 0) |
| 4248 | f6i = ipv6_stub->fib6_multipath_select(net, f6i, &fl6, | 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, | |||
| 4252 | if (check_mtu) { | 4274 | if (check_mtu) { |
| 4253 | mtu = ipv6_stub->ip6_mtu_from_fib6(f6i, dst, src); | 4275 | mtu = ipv6_stub->ip6_mtu_from_fib6(f6i, dst, src); |
| 4254 | if (params->tot_len > mtu) | 4276 | if (params->tot_len > mtu) |
| 4255 | return 0; | 4277 | return BPF_FIB_LKUP_RET_FRAG_NEEDED; |
| 4256 | } | 4278 | } |
| 4257 | 4279 | ||
| 4258 | if (f6i->fib6_nh.nh_lwtstate) | 4280 | if (f6i->fib6_nh.nh_lwtstate) |
| 4259 | return 0; | 4281 | return BPF_FIB_LKUP_RET_UNSUPP_LWT; |
| 4260 | 4282 | ||
| 4261 | if (f6i->fib6_flags & RTF_GATEWAY) | 4283 | if (f6i->fib6_flags & RTF_GATEWAY) |
| 4262 | *dst = f6i->fib6_nh.nh_gw; | 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, | |||
| 4270 | */ | 4292 | */ |
| 4271 | neigh = ___neigh_lookup_noref(ipv6_stub->nd_tbl, neigh_key_eq128, | 4293 | neigh = ___neigh_lookup_noref(ipv6_stub->nd_tbl, neigh_key_eq128, |
| 4272 | ndisc_hashfn, dst, dev); | 4294 | ndisc_hashfn, dst, dev); |
| 4273 | if (neigh) | 4295 | if (!neigh) |
| 4274 | return bpf_fib_set_fwd_params(params, neigh, dev); | 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 | #endif | 4300 | #endif |
| 4279 | 4301 | ||
| @@ -4315,7 +4337,7 @@ BPF_CALL_4(bpf_skb_fib_lookup, struct sk_buff *, skb, | |||
| 4315 | struct bpf_fib_lookup *, params, int, plen, u32, flags) | 4337 | struct bpf_fib_lookup *, params, int, plen, u32, flags) |
| 4316 | { | 4338 | { |
| 4317 | struct net *net = dev_net(skb->dev); | 4339 | struct net *net = dev_net(skb->dev); |
| 4318 | int index = -EAFNOSUPPORT; | 4340 | int rc = -EAFNOSUPPORT; |
| 4319 | 4341 | ||
| 4320 | if (plen < sizeof(*params)) | 4342 | if (plen < sizeof(*params)) |
| 4321 | return -EINVAL; | 4343 | return -EINVAL; |
| @@ -4326,25 +4348,25 @@ BPF_CALL_4(bpf_skb_fib_lookup, struct sk_buff *, skb, | |||
| 4326 | switch (params->family) { | 4348 | switch (params->family) { |
| 4327 | #if IS_ENABLED(CONFIG_INET) | 4349 | #if IS_ENABLED(CONFIG_INET) |
| 4328 | case AF_INET: | 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 | break; | 4352 | break; |
| 4331 | #endif | 4353 | #endif |
| 4332 | #if IS_ENABLED(CONFIG_IPV6) | 4354 | #if IS_ENABLED(CONFIG_IPV6) |
| 4333 | case AF_INET6: | 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 | break; | 4357 | break; |
| 4336 | #endif | 4358 | #endif |
| 4337 | } | 4359 | } |
| 4338 | 4360 | ||
| 4339 | if (index > 0) { | 4361 | if (!rc) { |
| 4340 | struct net_device *dev; | 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 | if (!is_skb_forwardable(dev, skb)) | 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 | static const struct bpf_func_proto bpf_skb_fib_lookup_proto = { | 4372 | static const struct bpf_func_proto bpf_skb_fib_lookup_proto = { |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index c642304f178c..eba8dae22c25 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
| @@ -5276,8 +5276,7 @@ struct sk_buff *alloc_skb_with_frags(unsigned long header_len, | |||
| 5276 | if (npages >= 1 << order) { | 5276 | if (npages >= 1 << order) { |
| 5277 | page = alloc_pages((gfp_mask & ~__GFP_DIRECT_RECLAIM) | | 5277 | page = alloc_pages((gfp_mask & ~__GFP_DIRECT_RECLAIM) | |
| 5278 | __GFP_COMP | | 5278 | __GFP_COMP | |
| 5279 | __GFP_NOWARN | | 5279 | __GFP_NOWARN, |
| 5280 | __GFP_NORETRY, | ||
| 5281 | order); | 5280 | order); |
| 5282 | if (page) | 5281 | if (page) |
| 5283 | goto fill_page; | 5282 | goto fill_page; |
diff --git a/net/core/sock.c b/net/core/sock.c index bcc41829a16d..9e8f65585b81 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
| @@ -3243,7 +3243,8 @@ static int req_prot_init(const struct proto *prot) | |||
| 3243 | 3243 | ||
| 3244 | rsk_prot->slab = kmem_cache_create(rsk_prot->slab_name, | 3244 | rsk_prot->slab = kmem_cache_create(rsk_prot->slab_name, |
| 3245 | rsk_prot->obj_size, 0, | 3245 | rsk_prot->obj_size, 0, |
| 3246 | prot->slab_flags, NULL); | 3246 | SLAB_ACCOUNT | prot->slab_flags, |
| 3247 | NULL); | ||
| 3247 | 3248 | ||
| 3248 | if (!rsk_prot->slab) { | 3249 | if (!rsk_prot->slab) { |
| 3249 | pr_crit("%s: Can't create request sock SLAB cache!\n", | 3250 | pr_crit("%s: Can't create request sock SLAB cache!\n", |
| @@ -3258,7 +3259,8 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
| 3258 | if (alloc_slab) { | 3259 | if (alloc_slab) { |
| 3259 | prot->slab = kmem_cache_create_usercopy(prot->name, | 3260 | prot->slab = kmem_cache_create_usercopy(prot->name, |
| 3260 | prot->obj_size, 0, | 3261 | prot->obj_size, 0, |
| 3261 | SLAB_HWCACHE_ALIGN | prot->slab_flags, | 3262 | SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT | |
| 3263 | prot->slab_flags, | ||
| 3262 | prot->useroffset, prot->usersize, | 3264 | prot->useroffset, prot->usersize, |
| 3263 | NULL); | 3265 | NULL); |
| 3264 | 3266 | ||
| @@ -3281,6 +3283,7 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
| 3281 | kmem_cache_create(prot->twsk_prot->twsk_slab_name, | 3283 | kmem_cache_create(prot->twsk_prot->twsk_slab_name, |
| 3282 | prot->twsk_prot->twsk_obj_size, | 3284 | prot->twsk_prot->twsk_obj_size, |
| 3283 | 0, | 3285 | 0, |
| 3286 | SLAB_ACCOUNT | | ||
| 3284 | prot->slab_flags, | 3287 | prot->slab_flags, |
| 3285 | NULL); | 3288 | NULL); |
| 3286 | if (prot->twsk_prot->twsk_slab == NULL) | 3289 | if (prot->twsk_prot->twsk_slab == NULL) |
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index 0ea2ee56ac1b..f91e3816806b 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h | |||
| @@ -316,7 +316,8 @@ int dccp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, | |||
| 316 | int flags, int *addr_len); | 316 | int flags, int *addr_len); |
| 317 | void dccp_shutdown(struct sock *sk, int how); | 317 | void dccp_shutdown(struct sock *sk, int how); |
| 318 | int inet_dccp_listen(struct socket *sock, int backlog); | 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 | int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); | 321 | int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); |
| 321 | void dccp_req_err(struct sock *sk, u64 seq); | 322 | void dccp_req_err(struct sock *sk, u64 seq); |
| 322 | 323 | ||
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index a9e478cd3787..b08feb219b44 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
| @@ -984,7 +984,7 @@ static const struct proto_ops inet_dccp_ops = { | |||
| 984 | .accept = inet_accept, | 984 | .accept = inet_accept, |
| 985 | .getname = inet_getname, | 985 | .getname = inet_getname, |
| 986 | /* FIXME: work on tcp_poll to rename it to inet_csk_poll */ | 986 | /* FIXME: work on tcp_poll to rename it to inet_csk_poll */ |
| 987 | .poll_mask = dccp_poll_mask, | 987 | .poll = dccp_poll, |
| 988 | .ioctl = inet_ioctl, | 988 | .ioctl = inet_ioctl, |
| 989 | /* FIXME: work on inet_listen to rename it to sock_common_listen */ | 989 | /* FIXME: work on inet_listen to rename it to sock_common_listen */ |
| 990 | .listen = inet_dccp_listen, | 990 | .listen = inet_dccp_listen, |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 17fc4e0166ba..6344f1b18a6a 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
| @@ -1070,7 +1070,7 @@ static const struct proto_ops inet6_dccp_ops = { | |||
| 1070 | .socketpair = sock_no_socketpair, | 1070 | .socketpair = sock_no_socketpair, |
| 1071 | .accept = inet_accept, | 1071 | .accept = inet_accept, |
| 1072 | .getname = inet6_getname, | 1072 | .getname = inet6_getname, |
| 1073 | .poll_mask = dccp_poll_mask, | 1073 | .poll = dccp_poll, |
| 1074 | .ioctl = inet6_ioctl, | 1074 | .ioctl = inet6_ioctl, |
| 1075 | .listen = inet_dccp_listen, | 1075 | .listen = inet_dccp_listen, |
| 1076 | .shutdown = inet_shutdown, | 1076 | .shutdown = inet_shutdown, |
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index ca21c1c76da0..0d56e36a6db7 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
| @@ -312,11 +312,20 @@ int dccp_disconnect(struct sock *sk, int flags) | |||
| 312 | 312 | ||
| 313 | EXPORT_SYMBOL_GPL(dccp_disconnect); | 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 | __poll_t mask; | 325 | __poll_t mask; |
| 318 | struct sock *sk = sock->sk; | 326 | struct sock *sk = sock->sk; |
| 319 | 327 | ||
| 328 | sock_poll_wait(file, sk_sleep(sk), wait); | ||
| 320 | if (sk->sk_state == DCCP_LISTEN) | 329 | if (sk->sk_state == DCCP_LISTEN) |
| 321 | return inet_csk_listen_poll(sk); | 330 | return inet_csk_listen_poll(sk); |
| 322 | 331 | ||
| @@ -358,7 +367,7 @@ __poll_t dccp_poll_mask(struct socket *sock, __poll_t events) | |||
| 358 | return mask; | 367 | return mask; |
| 359 | } | 368 | } |
| 360 | 369 | ||
| 361 | EXPORT_SYMBOL_GPL(dccp_poll_mask); | 370 | EXPORT_SYMBOL_GPL(dccp_poll); |
| 362 | 371 | ||
| 363 | int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg) | 372 | int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg) |
| 364 | { | 373 | { |
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index 9a686d890bfa..7d6ff983ba2c 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c | |||
| @@ -1207,11 +1207,11 @@ static int dn_getname(struct socket *sock, struct sockaddr *uaddr,int peer) | |||
| 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 | struct sock *sk = sock->sk; | 1212 | struct sock *sk = sock->sk; |
| 1213 | struct dn_scp *scp = DN_SK(sk); | 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 | if (!skb_queue_empty(&scp->other_receive_queue)) | 1216 | if (!skb_queue_empty(&scp->other_receive_queue)) |
| 1217 | mask |= EPOLLRDBAND; | 1217 | mask |= EPOLLRDBAND; |
| @@ -2331,7 +2331,7 @@ static const struct proto_ops dn_proto_ops = { | |||
| 2331 | .socketpair = sock_no_socketpair, | 2331 | .socketpair = sock_no_socketpair, |
| 2332 | .accept = dn_accept, | 2332 | .accept = dn_accept, |
| 2333 | .getname = dn_getname, | 2333 | .getname = dn_getname, |
| 2334 | .poll_mask = dn_poll_mask, | 2334 | .poll = dn_poll, |
| 2335 | .ioctl = dn_ioctl, | 2335 | .ioctl = dn_ioctl, |
| 2336 | .listen = dn_listen, | 2336 | .listen = dn_listen, |
| 2337 | .shutdown = dn_shutdown, | 2337 | .shutdown = dn_shutdown, |
diff --git a/net/ieee802154/socket.c b/net/ieee802154/socket.c index a0768d2759b8..a60658c85a9a 100644 --- a/net/ieee802154/socket.c +++ b/net/ieee802154/socket.c | |||
| @@ -423,7 +423,7 @@ static const struct proto_ops ieee802154_raw_ops = { | |||
| 423 | .socketpair = sock_no_socketpair, | 423 | .socketpair = sock_no_socketpair, |
| 424 | .accept = sock_no_accept, | 424 | .accept = sock_no_accept, |
| 425 | .getname = sock_no_getname, | 425 | .getname = sock_no_getname, |
| 426 | .poll_mask = datagram_poll_mask, | 426 | .poll = datagram_poll, |
| 427 | .ioctl = ieee802154_sock_ioctl, | 427 | .ioctl = ieee802154_sock_ioctl, |
| 428 | .listen = sock_no_listen, | 428 | .listen = sock_no_listen, |
| 429 | .shutdown = sock_no_shutdown, | 429 | .shutdown = sock_no_shutdown, |
| @@ -969,7 +969,7 @@ static const struct proto_ops ieee802154_dgram_ops = { | |||
| 969 | .socketpair = sock_no_socketpair, | 969 | .socketpair = sock_no_socketpair, |
| 970 | .accept = sock_no_accept, | 970 | .accept = sock_no_accept, |
| 971 | .getname = sock_no_getname, | 971 | .getname = sock_no_getname, |
| 972 | .poll_mask = datagram_poll_mask, | 972 | .poll = datagram_poll, |
| 973 | .ioctl = ieee802154_sock_ioctl, | 973 | .ioctl = ieee802154_sock_ioctl, |
| 974 | .listen = sock_no_listen, | 974 | .listen = sock_no_listen, |
| 975 | .shutdown = sock_no_shutdown, | 975 | .shutdown = sock_no_shutdown, |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 15e125558c76..b403499fdabe 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
| @@ -986,7 +986,7 @@ const struct proto_ops inet_stream_ops = { | |||
| 986 | .socketpair = sock_no_socketpair, | 986 | .socketpair = sock_no_socketpair, |
| 987 | .accept = inet_accept, | 987 | .accept = inet_accept, |
| 988 | .getname = inet_getname, | 988 | .getname = inet_getname, |
| 989 | .poll_mask = tcp_poll_mask, | 989 | .poll = tcp_poll, |
| 990 | .ioctl = inet_ioctl, | 990 | .ioctl = inet_ioctl, |
| 991 | .listen = inet_listen, | 991 | .listen = inet_listen, |
| 992 | .shutdown = inet_shutdown, | 992 | .shutdown = inet_shutdown, |
| @@ -1021,7 +1021,7 @@ const struct proto_ops inet_dgram_ops = { | |||
| 1021 | .socketpair = sock_no_socketpair, | 1021 | .socketpair = sock_no_socketpair, |
| 1022 | .accept = sock_no_accept, | 1022 | .accept = sock_no_accept, |
| 1023 | .getname = inet_getname, | 1023 | .getname = inet_getname, |
| 1024 | .poll_mask = udp_poll_mask, | 1024 | .poll = udp_poll, |
| 1025 | .ioctl = inet_ioctl, | 1025 | .ioctl = inet_ioctl, |
| 1026 | .listen = sock_no_listen, | 1026 | .listen = sock_no_listen, |
| 1027 | .shutdown = inet_shutdown, | 1027 | .shutdown = inet_shutdown, |
| @@ -1042,7 +1042,7 @@ EXPORT_SYMBOL(inet_dgram_ops); | |||
| 1042 | 1042 | ||
| 1043 | /* | 1043 | /* |
| 1044 | * For SOCK_RAW sockets; should be the same as inet_dgram_ops but without | 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 | static const struct proto_ops inet_sockraw_ops = { | 1047 | static const struct proto_ops inet_sockraw_ops = { |
| 1048 | .family = PF_INET, | 1048 | .family = PF_INET, |
| @@ -1053,7 +1053,7 @@ static const struct proto_ops inet_sockraw_ops = { | |||
| 1053 | .socketpair = sock_no_socketpair, | 1053 | .socketpair = sock_no_socketpair, |
| 1054 | .accept = sock_no_accept, | 1054 | .accept = sock_no_accept, |
| 1055 | .getname = inet_getname, | 1055 | .getname = inet_getname, |
| 1056 | .poll_mask = datagram_poll_mask, | 1056 | .poll = datagram_poll, |
| 1057 | .ioctl = inet_ioctl, | 1057 | .ioctl = inet_ioctl, |
| 1058 | .listen = sock_no_listen, | 1058 | .listen = sock_no_listen, |
| 1059 | .shutdown = inet_shutdown, | 1059 | .shutdown = inet_shutdown, |
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c index 1540db65241a..c9ec1603666b 100644 --- a/net/ipv4/fou.c +++ b/net/ipv4/fou.c | |||
| @@ -448,9 +448,7 @@ next_proto: | |||
| 448 | out_unlock: | 448 | out_unlock: |
| 449 | rcu_read_unlock(); | 449 | rcu_read_unlock(); |
| 450 | out: | 450 | out: |
| 451 | NAPI_GRO_CB(skb)->flush |= flush; | 451 | skb_gro_flush_final_remcsum(skb, pp, flush, &grc); |
| 452 | skb_gro_remcsum_cleanup(skb, &grc); | ||
| 453 | skb->remcsum_offload = 0; | ||
| 454 | 452 | ||
| 455 | return pp; | 453 | return pp; |
| 456 | } | 454 | } |
diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c index 1859c473b21a..6a7d980105f6 100644 --- a/net/ipv4/gre_offload.c +++ b/net/ipv4/gre_offload.c | |||
| @@ -223,7 +223,7 @@ static struct sk_buff **gre_gro_receive(struct sk_buff **head, | |||
| 223 | out_unlock: | 223 | out_unlock: |
| 224 | rcu_read_unlock(); | 224 | rcu_read_unlock(); |
| 225 | out: | 225 | out: |
| 226 | NAPI_GRO_CB(skb)->flush |= flush; | 226 | skb_gro_flush_final(skb, pp, flush); |
| 227 | 227 | ||
| 228 | return pp; | 228 | return pp; |
| 229 | } | 229 | } |
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index d06247ba08b2..af0a857d8352 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
| @@ -265,8 +265,9 @@ static int proc_tcp_fastopen_key(struct ctl_table *table, int write, | |||
| 265 | ipv4.sysctl_tcp_fastopen); | 265 | ipv4.sysctl_tcp_fastopen); |
| 266 | struct ctl_table tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH * 2 + 10) }; | 266 | struct ctl_table tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH * 2 + 10) }; |
| 267 | struct tcp_fastopen_context *ctxt; | 267 | struct tcp_fastopen_context *ctxt; |
| 268 | int ret; | ||
| 269 | u32 user_key[4]; /* 16 bytes, matching TCP_FASTOPEN_KEY_LENGTH */ | 268 | u32 user_key[4]; /* 16 bytes, matching TCP_FASTOPEN_KEY_LENGTH */ |
| 269 | __le32 key[4]; | ||
| 270 | int ret, i; | ||
| 270 | 271 | ||
| 271 | tbl.data = kmalloc(tbl.maxlen, GFP_KERNEL); | 272 | tbl.data = kmalloc(tbl.maxlen, GFP_KERNEL); |
| 272 | if (!tbl.data) | 273 | if (!tbl.data) |
| @@ -275,11 +276,14 @@ static int proc_tcp_fastopen_key(struct ctl_table *table, int write, | |||
| 275 | rcu_read_lock(); | 276 | rcu_read_lock(); |
| 276 | ctxt = rcu_dereference(net->ipv4.tcp_fastopen_ctx); | 277 | ctxt = rcu_dereference(net->ipv4.tcp_fastopen_ctx); |
| 277 | if (ctxt) | 278 | if (ctxt) |
| 278 | memcpy(user_key, ctxt->key, TCP_FASTOPEN_KEY_LENGTH); | 279 | memcpy(key, ctxt->key, TCP_FASTOPEN_KEY_LENGTH); |
| 279 | else | 280 | else |
| 280 | memset(user_key, 0, sizeof(user_key)); | 281 | memset(key, 0, sizeof(key)); |
| 281 | rcu_read_unlock(); | 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 | snprintf(tbl.data, tbl.maxlen, "%08x-%08x-%08x-%08x", | 287 | snprintf(tbl.data, tbl.maxlen, "%08x-%08x-%08x-%08x", |
| 284 | user_key[0], user_key[1], user_key[2], user_key[3]); | 288 | user_key[0], user_key[1], user_key[2], user_key[3]); |
| 285 | ret = proc_dostring(&tbl, write, buffer, lenp, ppos); | 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, | |||
| 290 | ret = -EINVAL; | 294 | ret = -EINVAL; |
| 291 | goto bad_key; | 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 | TCP_FASTOPEN_KEY_LENGTH); | 302 | TCP_FASTOPEN_KEY_LENGTH); |
| 295 | } | 303 | } |
| 296 | 304 | ||
| 297 | bad_key: | 305 | bad_key: |
| 298 | pr_debug("proc FO key set 0x%x-%x-%x-%x <- 0x%s: %u\n", | 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 | (char *)tbl.data, ret); | 308 | (char *)tbl.data, ret); |
| 301 | kfree(tbl.data); | 309 | kfree(tbl.data); |
| 302 | return ret; | 310 | return ret; |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 141acd92e58a..e7b53d2a971f 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
| @@ -494,21 +494,32 @@ static inline bool tcp_stream_is_readable(const struct tcp_sock *tp, | |||
| 494 | } | 494 | } |
| 495 | 495 | ||
| 496 | /* | 496 | /* |
| 497 | * Socket is not locked. We are protected from async events by poll logic and | 497 | * Wait for a TCP event. |
| 498 | * correct handling of state changes made by other threads is impossible in | 498 | * |
| 499 | * any case. | 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 | struct sock *sk = sock->sk; | 506 | struct sock *sk = sock->sk; |
| 504 | const struct tcp_sock *tp = tcp_sk(sk); | 507 | const struct tcp_sock *tp = tcp_sk(sk); |
| 505 | __poll_t mask = 0; | ||
| 506 | int state; | 508 | int state; |
| 507 | 509 | ||
| 510 | sock_poll_wait(file, sk_sleep(sk), wait); | ||
| 511 | |||
| 508 | state = inet_sk_state_load(sk); | 512 | state = inet_sk_state_load(sk); |
| 509 | if (state == TCP_LISTEN) | 513 | if (state == TCP_LISTEN) |
| 510 | return inet_csk_listen_poll(sk); | 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 | * EPOLLHUP is certainly not done right. But poll() doesn't | 524 | * EPOLLHUP is certainly not done right. But poll() doesn't |
| 514 | * have a notion of HUP in just one direction, and for a | 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) | |||
| 589 | 600 | ||
| 590 | return mask; | 601 | return mask; |
| 591 | } | 602 | } |
| 592 | EXPORT_SYMBOL(tcp_poll_mask); | 603 | EXPORT_SYMBOL(tcp_poll); |
| 593 | 604 | ||
| 594 | int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg) | 605 | int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg) |
| 595 | { | 606 | { |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 355d3dffd021..8e5522c6833a 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -265,7 +265,7 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) | |||
| 265 | * it is probably a retransmit. | 265 | * it is probably a retransmit. |
| 266 | */ | 266 | */ |
| 267 | if (tp->ecn_flags & TCP_ECN_SEEN) | 267 | if (tp->ecn_flags & TCP_ECN_SEEN) |
| 268 | tcp_enter_quickack_mode(sk, 1); | 268 | tcp_enter_quickack_mode(sk, 2); |
| 269 | break; | 269 | break; |
| 270 | case INET_ECN_CE: | 270 | case INET_ECN_CE: |
| 271 | if (tcp_ca_needs_ecn(sk)) | 271 | if (tcp_ca_needs_ecn(sk)) |
| @@ -273,7 +273,7 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) | |||
| 273 | 273 | ||
| 274 | if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) { | 274 | if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) { |
| 275 | /* Better not delay acks, sender can have a very low cwnd */ | 275 | /* Better not delay acks, sender can have a very low cwnd */ |
| 276 | tcp_enter_quickack_mode(sk, 1); | 276 | tcp_enter_quickack_mode(sk, 2); |
| 277 | tp->ecn_flags |= TCP_ECN_DEMAND_CWR; | 277 | tp->ecn_flags |= TCP_ECN_DEMAND_CWR; |
| 278 | } | 278 | } |
| 279 | tp->ecn_flags |= TCP_ECN_SEEN; | 279 | tp->ecn_flags |= TCP_ECN_SEEN; |
| @@ -3181,6 +3181,15 @@ static int tcp_clean_rtx_queue(struct sock *sk, u32 prior_fack, | |||
| 3181 | 3181 | ||
| 3182 | if (tcp_is_reno(tp)) { | 3182 | if (tcp_is_reno(tp)) { |
| 3183 | tcp_remove_reno_sacks(sk, pkts_acked); | 3183 | tcp_remove_reno_sacks(sk, pkts_acked); |
| 3184 | |||
| 3185 | /* If any of the cumulatively ACKed segments was | ||
| 3186 | * retransmitted, non-SACK case cannot confirm that | ||
| 3187 | * progress was due to original transmission due to | ||
| 3188 | * lack of TCPCB_SACKED_ACKED bits even if some of | ||
| 3189 | * the packets may have been never retransmitted. | ||
| 3190 | */ | ||
| 3191 | if (flag & FLAG_RETRANS_DATA_ACKED) | ||
| 3192 | flag &= ~FLAG_ORIG_SACK_ACKED; | ||
| 3184 | } else { | 3193 | } else { |
| 3185 | int delta; | 3194 | int delta; |
| 3186 | 3195 | ||
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 9bb27df4dac5..24e116ddae79 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
| @@ -2591,7 +2591,7 @@ int compat_udp_getsockopt(struct sock *sk, int level, int optname, | |||
| 2591 | * udp_poll - wait for a UDP event. | 2591 | * udp_poll - wait for a UDP event. |
| 2592 | * @file - file struct | 2592 | * @file - file struct |
| 2593 | * @sock - socket | 2593 | * @sock - socket |
| 2594 | * @events - events to wait for | 2594 | * @wait - poll table |
| 2595 | * | 2595 | * |
| 2596 | * This is same as datagram poll, except for the special case of | 2596 | * This is same as datagram poll, except for the special case of |
| 2597 | * blocking sockets. If application is using a blocking fd | 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, | |||
| 2600 | * but then block when reading it. Add special case code | 2600 | * but then block when reading it. Add special case code |
| 2601 | * to work around these arguably broken applications. | 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 | struct sock *sk = sock->sk; | 2606 | struct sock *sk = sock->sk; |
| 2607 | 2607 | ||
| 2608 | if (!skb_queue_empty(&udp_sk(sk)->reader_queue)) | 2608 | if (!skb_queue_empty(&udp_sk(sk)->reader_queue)) |
| 2609 | mask |= EPOLLIN | EPOLLRDNORM; | 2609 | mask |= EPOLLIN | EPOLLRDNORM; |
| 2610 | 2610 | ||
| 2611 | /* Check for false positives due to checksum errors */ | 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 | !(sk->sk_shutdown & RCV_SHUTDOWN) && first_packet_length(sk) == -1) | 2613 | !(sk->sk_shutdown & RCV_SHUTDOWN) && first_packet_length(sk) == -1) |
| 2614 | mask &= ~(EPOLLIN | EPOLLRDNORM); | 2614 | mask &= ~(EPOLLIN | EPOLLRDNORM); |
| 2615 | 2615 | ||
| 2616 | return mask; | 2616 | return mask; |
| 2617 | 2617 | ||
| 2618 | } | 2618 | } |
| 2619 | EXPORT_SYMBOL(udp_poll_mask); | 2619 | EXPORT_SYMBOL(udp_poll); |
| 2620 | 2620 | ||
| 2621 | int udp_abort(struct sock *sk, int err) | 2621 | int udp_abort(struct sock *sk, int err) |
| 2622 | { | 2622 | { |
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index 92dc9e5a7ff3..69c54540d5b4 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c | |||
| @@ -394,7 +394,7 @@ unflush: | |||
| 394 | out_unlock: | 394 | out_unlock: |
| 395 | rcu_read_unlock(); | 395 | rcu_read_unlock(); |
| 396 | out: | 396 | out: |
| 397 | NAPI_GRO_CB(skb)->flush |= flush; | 397 | skb_gro_flush_final(skb, pp, flush); |
| 398 | return pp; | 398 | return pp; |
| 399 | } | 399 | } |
| 400 | EXPORT_SYMBOL(udp_gro_receive); | 400 | EXPORT_SYMBOL(udp_gro_receive); |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index c134286d6a41..91580c62bb86 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
| @@ -4528,6 +4528,7 @@ static int modify_prefix_route(struct inet6_ifaddr *ifp, | |||
| 4528 | unsigned long expires, u32 flags) | 4528 | unsigned long expires, u32 flags) |
| 4529 | { | 4529 | { |
| 4530 | struct fib6_info *f6i; | 4530 | struct fib6_info *f6i; |
| 4531 | u32 prio; | ||
| 4531 | 4532 | ||
| 4532 | f6i = addrconf_get_prefix_route(&ifp->addr, | 4533 | f6i = addrconf_get_prefix_route(&ifp->addr, |
| 4533 | ifp->prefix_len, | 4534 | ifp->prefix_len, |
| @@ -4536,13 +4537,15 @@ static int modify_prefix_route(struct inet6_ifaddr *ifp, | |||
| 4536 | if (!f6i) | 4537 | if (!f6i) |
| 4537 | return -ENOENT; | 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 | /* add new one */ | 4545 | /* add new one */ |
| 4541 | addrconf_prefix_route(&ifp->addr, ifp->prefix_len, | 4546 | addrconf_prefix_route(&ifp->addr, ifp->prefix_len, |
| 4542 | ifp->rt_priority, ifp->idev->dev, | 4547 | ifp->rt_priority, ifp->idev->dev, |
| 4543 | expires, flags, GFP_KERNEL); | 4548 | expires, flags, GFP_KERNEL); |
| 4544 | /* delete old one */ | ||
| 4545 | ip6_del_rt(dev_net(ifp->idev->dev), f6i); | ||
| 4546 | } else { | 4549 | } else { |
| 4547 | if (!expires) | 4550 | if (!expires) |
| 4548 | fib6_clean_expires(f6i); | 4551 | fib6_clean_expires(f6i); |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 74f2a261e8df..9ed0eae91758 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
| @@ -570,7 +570,7 @@ const struct proto_ops inet6_stream_ops = { | |||
| 570 | .socketpair = sock_no_socketpair, /* a do nothing */ | 570 | .socketpair = sock_no_socketpair, /* a do nothing */ |
| 571 | .accept = inet_accept, /* ok */ | 571 | .accept = inet_accept, /* ok */ |
| 572 | .getname = inet6_getname, | 572 | .getname = inet6_getname, |
| 573 | .poll_mask = tcp_poll_mask, /* ok */ | 573 | .poll = tcp_poll, /* ok */ |
| 574 | .ioctl = inet6_ioctl, /* must change */ | 574 | .ioctl = inet6_ioctl, /* must change */ |
| 575 | .listen = inet_listen, /* ok */ | 575 | .listen = inet_listen, /* ok */ |
| 576 | .shutdown = inet_shutdown, /* ok */ | 576 | .shutdown = inet_shutdown, /* ok */ |
| @@ -603,7 +603,7 @@ const struct proto_ops inet6_dgram_ops = { | |||
| 603 | .socketpair = sock_no_socketpair, /* a do nothing */ | 603 | .socketpair = sock_no_socketpair, /* a do nothing */ |
| 604 | .accept = sock_no_accept, /* a do nothing */ | 604 | .accept = sock_no_accept, /* a do nothing */ |
| 605 | .getname = inet6_getname, | 605 | .getname = inet6_getname, |
| 606 | .poll_mask = udp_poll_mask, /* ok */ | 606 | .poll = udp_poll, /* ok */ |
| 607 | .ioctl = inet6_ioctl, /* must change */ | 607 | .ioctl = inet6_ioctl, /* must change */ |
| 608 | .listen = sock_no_listen, /* ok */ | 608 | .listen = sock_no_listen, /* ok */ |
| 609 | .shutdown = inet_shutdown, /* ok */ | 609 | .shutdown = inet_shutdown, /* ok */ |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index 5e0332014c17..a452d99c9f52 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
| @@ -107,7 +107,7 @@ static int nf_ct_frag6_sysctl_register(struct net *net) | |||
| 107 | if (hdr == NULL) | 107 | if (hdr == NULL) |
| 108 | goto err_reg; | 108 | goto err_reg; |
| 109 | 109 | ||
| 110 | net->nf_frag.sysctl.frags_hdr = hdr; | 110 | net->nf_frag_frags_hdr = hdr; |
| 111 | return 0; | 111 | return 0; |
| 112 | 112 | ||
| 113 | err_reg: | 113 | err_reg: |
| @@ -121,8 +121,8 @@ static void __net_exit nf_ct_frags6_sysctl_unregister(struct net *net) | |||
| 121 | { | 121 | { |
| 122 | struct ctl_table *table; | 122 | struct ctl_table *table; |
| 123 | 123 | ||
| 124 | table = net->nf_frag.sysctl.frags_hdr->ctl_table_arg; | 124 | table = net->nf_frag_frags_hdr->ctl_table_arg; |
| 125 | unregister_net_sysctl_table(net->nf_frag.sysctl.frags_hdr); | 125 | unregister_net_sysctl_table(net->nf_frag_frags_hdr); |
| 126 | if (!net_eq(net, &init_net)) | 126 | if (!net_eq(net, &init_net)) |
| 127 | kfree(table); | 127 | kfree(table); |
| 128 | } | 128 | } |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index ce6f0d15b5dd..afc307c89d1a 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
| @@ -1334,7 +1334,7 @@ void raw6_proc_exit(void) | |||
| 1334 | } | 1334 | } |
| 1335 | #endif /* CONFIG_PROC_FS */ | 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 | const struct proto_ops inet6_sockraw_ops = { | 1338 | const struct proto_ops inet6_sockraw_ops = { |
| 1339 | .family = PF_INET6, | 1339 | .family = PF_INET6, |
| 1340 | .owner = THIS_MODULE, | 1340 | .owner = THIS_MODULE, |
| @@ -1344,7 +1344,7 @@ const struct proto_ops inet6_sockraw_ops = { | |||
| 1344 | .socketpair = sock_no_socketpair, /* a do nothing */ | 1344 | .socketpair = sock_no_socketpair, /* a do nothing */ |
| 1345 | .accept = sock_no_accept, /* a do nothing */ | 1345 | .accept = sock_no_accept, /* a do nothing */ |
| 1346 | .getname = inet6_getname, | 1346 | .getname = inet6_getname, |
| 1347 | .poll_mask = datagram_poll_mask, /* ok */ | 1347 | .poll = datagram_poll, /* ok */ |
| 1348 | .ioctl = inet6_ioctl, /* must change */ | 1348 | .ioctl = inet6_ioctl, /* must change */ |
| 1349 | .listen = sock_no_listen, /* ok */ | 1349 | .listen = sock_no_listen, /* ok */ |
| 1350 | .shutdown = inet_shutdown, /* ok */ | 1350 | .shutdown = inet_shutdown, /* ok */ |
diff --git a/net/ipv6/seg6_hmac.c b/net/ipv6/seg6_hmac.c index 33fb35cbfac1..558fe8cc6d43 100644 --- a/net/ipv6/seg6_hmac.c +++ b/net/ipv6/seg6_hmac.c | |||
| @@ -373,7 +373,7 @@ static int seg6_hmac_init_algo(void) | |||
| 373 | return -ENOMEM; | 373 | return -ENOMEM; |
| 374 | 374 | ||
| 375 | for_each_possible_cpu(cpu) { | 375 | for_each_possible_cpu(cpu) { |
| 376 | tfm = crypto_alloc_shash(algo->name, 0, GFP_KERNEL); | 376 | tfm = crypto_alloc_shash(algo->name, 0, 0); |
| 377 | if (IS_ERR(tfm)) | 377 | if (IS_ERR(tfm)) |
| 378 | return PTR_ERR(tfm); | 378 | return PTR_ERR(tfm); |
| 379 | p_tfm = per_cpu_ptr(algo->tfms, cpu); | 379 | p_tfm = per_cpu_ptr(algo->tfms, cpu); |
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 68e86257a549..893a022f9620 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c | |||
| @@ -1488,11 +1488,14 @@ static inline __poll_t iucv_accept_poll(struct sock *parent) | |||
| 1488 | return 0; | 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 | struct sock *sk = sock->sk; | 1494 | struct sock *sk = sock->sk; |
| 1494 | __poll_t mask = 0; | 1495 | __poll_t mask = 0; |
| 1495 | 1496 | ||
| 1497 | sock_poll_wait(file, sk_sleep(sk), wait); | ||
| 1498 | |||
| 1496 | if (sk->sk_state == IUCV_LISTEN) | 1499 | if (sk->sk_state == IUCV_LISTEN) |
| 1497 | return iucv_accept_poll(sk); | 1500 | return iucv_accept_poll(sk); |
| 1498 | 1501 | ||
| @@ -2385,7 +2388,7 @@ static const struct proto_ops iucv_sock_ops = { | |||
| 2385 | .getname = iucv_sock_getname, | 2388 | .getname = iucv_sock_getname, |
| 2386 | .sendmsg = iucv_sock_sendmsg, | 2389 | .sendmsg = iucv_sock_sendmsg, |
| 2387 | .recvmsg = iucv_sock_recvmsg, | 2390 | .recvmsg = iucv_sock_recvmsg, |
| 2388 | .poll_mask = iucv_sock_poll_mask, | 2391 | .poll = iucv_sock_poll, |
| 2389 | .ioctl = sock_no_ioctl, | 2392 | .ioctl = sock_no_ioctl, |
| 2390 | .mmap = sock_no_mmap, | 2393 | .mmap = sock_no_mmap, |
| 2391 | .socketpair = sock_no_socketpair, | 2394 | .socketpair = sock_no_socketpair, |
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c index 84b7d5c6fec8..d3601d421571 100644 --- a/net/kcm/kcmsock.c +++ b/net/kcm/kcmsock.c | |||
| @@ -1336,9 +1336,9 @@ static void init_kcm_sock(struct kcm_sock *kcm, struct kcm_mux *mux) | |||
| 1336 | struct list_head *head; | 1336 | struct list_head *head; |
| 1337 | int index = 0; | 1337 | int index = 0; |
| 1338 | 1338 | ||
| 1339 | /* For SOCK_SEQPACKET sock type, datagram_poll_mask checks the sk_state, | 1339 | /* For SOCK_SEQPACKET sock type, datagram_poll checks the sk_state, so |
| 1340 | * so we set sk_state, otherwise epoll_wait always returns right away | 1340 | * we set sk_state, otherwise epoll_wait always returns right away with |
| 1341 | * with EPOLLHUP | 1341 | * EPOLLHUP |
| 1342 | */ | 1342 | */ |
| 1343 | kcm->sk.sk_state = TCP_ESTABLISHED; | 1343 | kcm->sk.sk_state = TCP_ESTABLISHED; |
| 1344 | 1344 | ||
| @@ -1903,7 +1903,7 @@ static const struct proto_ops kcm_dgram_ops = { | |||
| 1903 | .socketpair = sock_no_socketpair, | 1903 | .socketpair = sock_no_socketpair, |
| 1904 | .accept = sock_no_accept, | 1904 | .accept = sock_no_accept, |
| 1905 | .getname = sock_no_getname, | 1905 | .getname = sock_no_getname, |
| 1906 | .poll_mask = datagram_poll_mask, | 1906 | .poll = datagram_poll, |
| 1907 | .ioctl = kcm_ioctl, | 1907 | .ioctl = kcm_ioctl, |
| 1908 | .listen = sock_no_listen, | 1908 | .listen = sock_no_listen, |
| 1909 | .shutdown = sock_no_shutdown, | 1909 | .shutdown = sock_no_shutdown, |
| @@ -1924,7 +1924,7 @@ static const struct proto_ops kcm_seqpacket_ops = { | |||
| 1924 | .socketpair = sock_no_socketpair, | 1924 | .socketpair = sock_no_socketpair, |
| 1925 | .accept = sock_no_accept, | 1925 | .accept = sock_no_accept, |
| 1926 | .getname = sock_no_getname, | 1926 | .getname = sock_no_getname, |
| 1927 | .poll_mask = datagram_poll_mask, | 1927 | .poll = datagram_poll, |
| 1928 | .ioctl = kcm_ioctl, | 1928 | .ioctl = kcm_ioctl, |
| 1929 | .listen = sock_no_listen, | 1929 | .listen = sock_no_listen, |
| 1930 | .shutdown = sock_no_shutdown, | 1930 | .shutdown = sock_no_shutdown, |
diff --git a/net/key/af_key.c b/net/key/af_key.c index 8bdc1cbe490a..5e1d2946ffbf 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
| @@ -3751,7 +3751,7 @@ static const struct proto_ops pfkey_ops = { | |||
| 3751 | 3751 | ||
| 3752 | /* Now the operations that really occur. */ | 3752 | /* Now the operations that really occur. */ |
| 3753 | .release = pfkey_release, | 3753 | .release = pfkey_release, |
| 3754 | .poll_mask = datagram_poll_mask, | 3754 | .poll = datagram_poll, |
| 3755 | .sendmsg = pfkey_sendmsg, | 3755 | .sendmsg = pfkey_sendmsg, |
| 3756 | .recvmsg = pfkey_recvmsg, | 3756 | .recvmsg = pfkey_recvmsg, |
| 3757 | }; | 3757 | }; |
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index 181073bf6925..a9c05b2bc1b0 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
| @@ -613,7 +613,7 @@ static const struct proto_ops l2tp_ip_ops = { | |||
| 613 | .socketpair = sock_no_socketpair, | 613 | .socketpair = sock_no_socketpair, |
| 614 | .accept = sock_no_accept, | 614 | .accept = sock_no_accept, |
| 615 | .getname = l2tp_ip_getname, | 615 | .getname = l2tp_ip_getname, |
| 616 | .poll_mask = datagram_poll_mask, | 616 | .poll = datagram_poll, |
| 617 | .ioctl = inet_ioctl, | 617 | .ioctl = inet_ioctl, |
| 618 | .listen = sock_no_listen, | 618 | .listen = sock_no_listen, |
| 619 | .shutdown = inet_shutdown, | 619 | .shutdown = inet_shutdown, |
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c index 336e4c00abbc..957369192ca1 100644 --- a/net/l2tp/l2tp_ip6.c +++ b/net/l2tp/l2tp_ip6.c | |||
| @@ -754,7 +754,7 @@ static const struct proto_ops l2tp_ip6_ops = { | |||
| 754 | .socketpair = sock_no_socketpair, | 754 | .socketpair = sock_no_socketpair, |
| 755 | .accept = sock_no_accept, | 755 | .accept = sock_no_accept, |
| 756 | .getname = l2tp_ip6_getname, | 756 | .getname = l2tp_ip6_getname, |
| 757 | .poll_mask = datagram_poll_mask, | 757 | .poll = datagram_poll, |
| 758 | .ioctl = inet6_ioctl, | 758 | .ioctl = inet6_ioctl, |
| 759 | .listen = sock_no_listen, | 759 | .listen = sock_no_listen, |
| 760 | .shutdown = inet_shutdown, | 760 | .shutdown = inet_shutdown, |
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c index 55188382845c..e398797878a9 100644 --- a/net/l2tp/l2tp_ppp.c +++ b/net/l2tp/l2tp_ppp.c | |||
| @@ -1818,7 +1818,7 @@ static const struct proto_ops pppol2tp_ops = { | |||
| 1818 | .socketpair = sock_no_socketpair, | 1818 | .socketpair = sock_no_socketpair, |
| 1819 | .accept = sock_no_accept, | 1819 | .accept = sock_no_accept, |
| 1820 | .getname = pppol2tp_getname, | 1820 | .getname = pppol2tp_getname, |
| 1821 | .poll_mask = datagram_poll_mask, | 1821 | .poll = datagram_poll, |
| 1822 | .listen = sock_no_listen, | 1822 | .listen = sock_no_listen, |
| 1823 | .shutdown = sock_no_shutdown, | 1823 | .shutdown = sock_no_shutdown, |
| 1824 | .setsockopt = pppol2tp_setsockopt, | 1824 | .setsockopt = pppol2tp_setsockopt, |
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index 804de8490186..1beeea9549fa 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
| @@ -1192,7 +1192,7 @@ static const struct proto_ops llc_ui_ops = { | |||
| 1192 | .socketpair = sock_no_socketpair, | 1192 | .socketpair = sock_no_socketpair, |
| 1193 | .accept = llc_ui_accept, | 1193 | .accept = llc_ui_accept, |
| 1194 | .getname = llc_ui_getname, | 1194 | .getname = llc_ui_getname, |
| 1195 | .poll_mask = datagram_poll_mask, | 1195 | .poll = datagram_poll, |
| 1196 | .ioctl = llc_ui_ioctl, | 1196 | .ioctl = llc_ui_ioctl, |
| 1197 | .listen = llc_ui_listen, | 1197 | .listen = llc_ui_listen, |
| 1198 | .shutdown = llc_ui_shutdown, | 1198 | .shutdown = llc_ui_shutdown, |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 44b5dfe8727d..fa1f1e63a264 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
| @@ -4845,7 +4845,9 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, | |||
| 4845 | skb_reset_network_header(skb); | 4845 | skb_reset_network_header(skb); |
| 4846 | skb_reset_mac_header(skb); | 4846 | skb_reset_mac_header(skb); |
| 4847 | 4847 | ||
| 4848 | local_bh_disable(); | ||
| 4848 | __ieee80211_subif_start_xmit(skb, skb->dev, flags); | 4849 | __ieee80211_subif_start_xmit(skb, skb->dev, flags); |
| 4850 | local_bh_enable(); | ||
| 4849 | 4851 | ||
| 4850 | return 0; | 4852 | return 0; |
| 4851 | } | 4853 | } |
diff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c index d8383609fe28..510039862aa9 100644 --- a/net/netfilter/nf_conncount.c +++ b/net/netfilter/nf_conncount.c | |||
| @@ -47,6 +47,8 @@ struct nf_conncount_tuple { | |||
| 47 | struct hlist_node node; | 47 | struct hlist_node node; |
| 48 | struct nf_conntrack_tuple tuple; | 48 | struct nf_conntrack_tuple tuple; |
| 49 | struct nf_conntrack_zone zone; | 49 | struct nf_conntrack_zone zone; |
| 50 | int cpu; | ||
| 51 | u32 jiffies32; | ||
| 50 | }; | 52 | }; |
| 51 | 53 | ||
| 52 | struct nf_conncount_rb { | 54 | struct nf_conncount_rb { |
| @@ -91,11 +93,42 @@ bool nf_conncount_add(struct hlist_head *head, | |||
| 91 | return false; | 93 | return false; |
| 92 | conn->tuple = *tuple; | 94 | conn->tuple = *tuple; |
| 93 | conn->zone = *zone; | 95 | conn->zone = *zone; |
| 96 | conn->cpu = raw_smp_processor_id(); | ||
| 97 | conn->jiffies32 = (u32)jiffies; | ||
| 94 | hlist_add_head(&conn->node, head); | 98 | hlist_add_head(&conn->node, head); |
| 95 | return true; | 99 | return true; |
| 96 | } | 100 | } |
| 97 | EXPORT_SYMBOL_GPL(nf_conncount_add); | 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 | unsigned int nf_conncount_lookup(struct net *net, struct hlist_head *head, | 132 | unsigned int nf_conncount_lookup(struct net *net, struct hlist_head *head, |
| 100 | const struct nf_conntrack_tuple *tuple, | 133 | const struct nf_conntrack_tuple *tuple, |
| 101 | const struct nf_conntrack_zone *zone, | 134 | const struct nf_conntrack_zone *zone, |
| @@ -103,18 +136,27 @@ unsigned int nf_conncount_lookup(struct net *net, struct hlist_head *head, | |||
| 103 | { | 136 | { |
| 104 | const struct nf_conntrack_tuple_hash *found; | 137 | const struct nf_conntrack_tuple_hash *found; |
| 105 | struct nf_conncount_tuple *conn; | 138 | struct nf_conncount_tuple *conn; |
| 106 | struct hlist_node *n; | ||
| 107 | struct nf_conn *found_ct; | 139 | struct nf_conn *found_ct; |
| 140 | struct hlist_node *n; | ||
| 108 | unsigned int length = 0; | 141 | unsigned int length = 0; |
| 109 | 142 | ||
| 110 | *addit = tuple ? true : false; | 143 | *addit = tuple ? true : false; |
| 111 | 144 | ||
| 112 | /* check the saved connections */ | 145 | /* check the saved connections */ |
| 113 | hlist_for_each_entry_safe(conn, n, head, node) { | 146 | hlist_for_each_entry_safe(conn, n, head, node) { |
| 114 | found = nf_conntrack_find_get(net, &conn->zone, &conn->tuple); | 147 | found = find_or_evict(net, conn); |
| 115 | if (found == NULL) { | 148 | if (IS_ERR(found)) { |
| 116 | hlist_del(&conn->node); | 149 | /* Not found, but might be about to be confirmed */ |
| 117 | kmem_cache_free(conncount_conn_cachep, conn); | 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 | continue; | 160 | continue; |
| 119 | } | 161 | } |
| 120 | 162 | ||
diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c index 551a1eddf0fa..a75b11c39312 100644 --- a/net/netfilter/nf_conntrack_helper.c +++ b/net/netfilter/nf_conntrack_helper.c | |||
| @@ -465,6 +465,11 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me) | |||
| 465 | 465 | ||
| 466 | nf_ct_expect_iterate_destroy(expect_iter_me, NULL); | 466 | nf_ct_expect_iterate_destroy(expect_iter_me, NULL); |
| 467 | nf_ct_iterate_destroy(unhelp, me); | 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 | EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister); | 474 | EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister); |
| 470 | 475 | ||
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index 426457047578..a61d6df6e5f6 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c | |||
| @@ -424,6 +424,10 @@ static int nf_log_proc_dostring(struct ctl_table *table, int write, | |||
| 424 | if (write) { | 424 | if (write) { |
| 425 | struct ctl_table tmp = *table; | 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 | tmp.data = buf; | 431 | tmp.data = buf; |
| 428 | r = proc_dostring(&tmp, write, buffer, lenp, ppos); | 432 | r = proc_dostring(&tmp, write, buffer, lenp, ppos); |
| 429 | if (r) | 433 | if (r) |
| @@ -442,14 +446,17 @@ static int nf_log_proc_dostring(struct ctl_table *table, int write, | |||
| 442 | rcu_assign_pointer(net->nf.nf_loggers[tindex], logger); | 446 | rcu_assign_pointer(net->nf.nf_loggers[tindex], logger); |
| 443 | mutex_unlock(&nf_log_mutex); | 447 | mutex_unlock(&nf_log_mutex); |
| 444 | } else { | 448 | } else { |
| 449 | struct ctl_table tmp = *table; | ||
| 450 | |||
| 451 | tmp.data = buf; | ||
| 445 | mutex_lock(&nf_log_mutex); | 452 | mutex_lock(&nf_log_mutex); |
| 446 | logger = nft_log_dereference(net->nf.nf_loggers[tindex]); | 453 | logger = nft_log_dereference(net->nf.nf_loggers[tindex]); |
| 447 | if (!logger) | 454 | if (!logger) |
| 448 | table->data = "NONE"; | 455 | strlcpy(buf, "NONE", sizeof(buf)); |
| 449 | else | 456 | else |
| 450 | table->data = logger->name; | 457 | strlcpy(buf, logger->name, sizeof(buf)); |
| 451 | r = proc_dostring(table, write, buffer, lenp, ppos); | ||
| 452 | mutex_unlock(&nf_log_mutex); | 458 | mutex_unlock(&nf_log_mutex); |
| 459 | r = proc_dostring(&tmp, write, buffer, lenp, ppos); | ||
| 453 | } | 460 | } |
| 454 | 461 | ||
| 455 | return r; | 462 | return r; |
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 4ccd2988f9db..ea4ba551abb2 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
| @@ -1243,6 +1243,9 @@ static int nfqnl_recv_unsupp(struct net *net, struct sock *ctnl, | |||
| 1243 | static const struct nla_policy nfqa_cfg_policy[NFQA_CFG_MAX+1] = { | 1243 | static const struct nla_policy nfqa_cfg_policy[NFQA_CFG_MAX+1] = { |
| 1244 | [NFQA_CFG_CMD] = { .len = sizeof(struct nfqnl_msg_config_cmd) }, | 1244 | [NFQA_CFG_CMD] = { .len = sizeof(struct nfqnl_msg_config_cmd) }, |
| 1245 | [NFQA_CFG_PARAMS] = { .len = sizeof(struct nfqnl_msg_config_params) }, | 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 | static const struct nf_queue_handler nfqh = { | 1251 | static const struct nf_queue_handler nfqh = { |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 1189b84413d5..393573a99a5a 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
| @@ -2658,7 +2658,7 @@ static const struct proto_ops netlink_ops = { | |||
| 2658 | .socketpair = sock_no_socketpair, | 2658 | .socketpair = sock_no_socketpair, |
| 2659 | .accept = sock_no_accept, | 2659 | .accept = sock_no_accept, |
| 2660 | .getname = netlink_getname, | 2660 | .getname = netlink_getname, |
| 2661 | .poll_mask = datagram_poll_mask, | 2661 | .poll = datagram_poll, |
| 2662 | .ioctl = netlink_ioctl, | 2662 | .ioctl = netlink_ioctl, |
| 2663 | .listen = sock_no_listen, | 2663 | .listen = sock_no_listen, |
| 2664 | .shutdown = sock_no_shutdown, | 2664 | .shutdown = sock_no_shutdown, |
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 93fbcafbf388..03f37c4e64fe 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
| @@ -1355,7 +1355,7 @@ static const struct proto_ops nr_proto_ops = { | |||
| 1355 | .socketpair = sock_no_socketpair, | 1355 | .socketpair = sock_no_socketpair, |
| 1356 | .accept = nr_accept, | 1356 | .accept = nr_accept, |
| 1357 | .getname = nr_getname, | 1357 | .getname = nr_getname, |
| 1358 | .poll_mask = datagram_poll_mask, | 1358 | .poll = datagram_poll, |
| 1359 | .ioctl = nr_ioctl, | 1359 | .ioctl = nr_ioctl, |
| 1360 | .listen = nr_listen, | 1360 | .listen = nr_listen, |
| 1361 | .shutdown = sock_no_shutdown, | 1361 | .shutdown = sock_no_shutdown, |
diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c index ab5bb14b49af..ea0c0c6f1874 100644 --- a/net/nfc/llcp_sock.c +++ b/net/nfc/llcp_sock.c | |||
| @@ -548,13 +548,16 @@ static inline __poll_t llcp_accept_poll(struct sock *parent) | |||
| 548 | return 0; | 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 | struct sock *sk = sock->sk; | 554 | struct sock *sk = sock->sk; |
| 554 | __poll_t mask = 0; | 555 | __poll_t mask = 0; |
| 555 | 556 | ||
| 556 | pr_debug("%p\n", sk); | 557 | pr_debug("%p\n", sk); |
| 557 | 558 | ||
| 559 | sock_poll_wait(file, sk_sleep(sk), wait); | ||
| 560 | |||
| 558 | if (sk->sk_state == LLCP_LISTEN) | 561 | if (sk->sk_state == LLCP_LISTEN) |
| 559 | return llcp_accept_poll(sk); | 562 | return llcp_accept_poll(sk); |
| 560 | 563 | ||
| @@ -896,7 +899,7 @@ static const struct proto_ops llcp_sock_ops = { | |||
| 896 | .socketpair = sock_no_socketpair, | 899 | .socketpair = sock_no_socketpair, |
| 897 | .accept = llcp_sock_accept, | 900 | .accept = llcp_sock_accept, |
| 898 | .getname = llcp_sock_getname, | 901 | .getname = llcp_sock_getname, |
| 899 | .poll_mask = llcp_sock_poll_mask, | 902 | .poll = llcp_sock_poll, |
| 900 | .ioctl = sock_no_ioctl, | 903 | .ioctl = sock_no_ioctl, |
| 901 | .listen = llcp_sock_listen, | 904 | .listen = llcp_sock_listen, |
| 902 | .shutdown = sock_no_shutdown, | 905 | .shutdown = sock_no_shutdown, |
| @@ -916,7 +919,7 @@ static const struct proto_ops llcp_rawsock_ops = { | |||
| 916 | .socketpair = sock_no_socketpair, | 919 | .socketpair = sock_no_socketpair, |
| 917 | .accept = sock_no_accept, | 920 | .accept = sock_no_accept, |
| 918 | .getname = llcp_sock_getname, | 921 | .getname = llcp_sock_getname, |
| 919 | .poll_mask = llcp_sock_poll_mask, | 922 | .poll = llcp_sock_poll, |
| 920 | .ioctl = sock_no_ioctl, | 923 | .ioctl = sock_no_ioctl, |
| 921 | .listen = sock_no_listen, | 924 | .listen = sock_no_listen, |
| 922 | .shutdown = sock_no_shutdown, | 925 | .shutdown = sock_no_shutdown, |
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c index 60c322531c49..e2188deb08dc 100644 --- a/net/nfc/rawsock.c +++ b/net/nfc/rawsock.c | |||
| @@ -284,7 +284,7 @@ static const struct proto_ops rawsock_ops = { | |||
| 284 | .socketpair = sock_no_socketpair, | 284 | .socketpair = sock_no_socketpair, |
| 285 | .accept = sock_no_accept, | 285 | .accept = sock_no_accept, |
| 286 | .getname = sock_no_getname, | 286 | .getname = sock_no_getname, |
| 287 | .poll_mask = datagram_poll_mask, | 287 | .poll = datagram_poll, |
| 288 | .ioctl = sock_no_ioctl, | 288 | .ioctl = sock_no_ioctl, |
| 289 | .listen = sock_no_listen, | 289 | .listen = sock_no_listen, |
| 290 | .shutdown = sock_no_shutdown, | 290 | .shutdown = sock_no_shutdown, |
| @@ -304,7 +304,7 @@ static const struct proto_ops rawsock_raw_ops = { | |||
| 304 | .socketpair = sock_no_socketpair, | 304 | .socketpair = sock_no_socketpair, |
| 305 | .accept = sock_no_accept, | 305 | .accept = sock_no_accept, |
| 306 | .getname = sock_no_getname, | 306 | .getname = sock_no_getname, |
| 307 | .poll_mask = datagram_poll_mask, | 307 | .poll = datagram_poll, |
| 308 | .ioctl = sock_no_ioctl, | 308 | .ioctl = sock_no_ioctl, |
| 309 | .listen = sock_no_listen, | 309 | .listen = sock_no_listen, |
| 310 | .shutdown = sock_no_shutdown, | 310 | .shutdown = sock_no_shutdown, |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index ff8e7e245c37..57634bc3da74 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
| @@ -4076,11 +4076,12 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd, | |||
| 4076 | return 0; | 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 | struct sock *sk = sock->sk; | 4082 | struct sock *sk = sock->sk; |
| 4082 | struct packet_sock *po = pkt_sk(sk); | 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 | spin_lock_bh(&sk->sk_receive_queue.lock); | 4086 | spin_lock_bh(&sk->sk_receive_queue.lock); |
| 4086 | if (po->rx_ring.pg_vec) { | 4087 | if (po->rx_ring.pg_vec) { |
| @@ -4422,7 +4423,7 @@ static const struct proto_ops packet_ops_spkt = { | |||
| 4422 | .socketpair = sock_no_socketpair, | 4423 | .socketpair = sock_no_socketpair, |
| 4423 | .accept = sock_no_accept, | 4424 | .accept = sock_no_accept, |
| 4424 | .getname = packet_getname_spkt, | 4425 | .getname = packet_getname_spkt, |
| 4425 | .poll_mask = datagram_poll_mask, | 4426 | .poll = datagram_poll, |
| 4426 | .ioctl = packet_ioctl, | 4427 | .ioctl = packet_ioctl, |
| 4427 | .listen = sock_no_listen, | 4428 | .listen = sock_no_listen, |
| 4428 | .shutdown = sock_no_shutdown, | 4429 | .shutdown = sock_no_shutdown, |
| @@ -4443,7 +4444,7 @@ static const struct proto_ops packet_ops = { | |||
| 4443 | .socketpair = sock_no_socketpair, | 4444 | .socketpair = sock_no_socketpair, |
| 4444 | .accept = sock_no_accept, | 4445 | .accept = sock_no_accept, |
| 4445 | .getname = packet_getname, | 4446 | .getname = packet_getname, |
| 4446 | .poll_mask = packet_poll_mask, | 4447 | .poll = packet_poll, |
| 4447 | .ioctl = packet_ioctl, | 4448 | .ioctl = packet_ioctl, |
| 4448 | .listen = sock_no_listen, | 4449 | .listen = sock_no_listen, |
| 4449 | .shutdown = sock_no_shutdown, | 4450 | .shutdown = sock_no_shutdown, |
diff --git a/net/phonet/socket.c b/net/phonet/socket.c index c295c4e20f01..30187990257f 100644 --- a/net/phonet/socket.c +++ b/net/phonet/socket.c | |||
| @@ -340,12 +340,15 @@ static int pn_socket_getname(struct socket *sock, struct sockaddr *addr, | |||
| 340 | return sizeof(struct sockaddr_pn); | 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 | struct sock *sk = sock->sk; | 346 | struct sock *sk = sock->sk; |
| 346 | struct pep_sock *pn = pep_sk(sk); | 347 | struct pep_sock *pn = pep_sk(sk); |
| 347 | __poll_t mask = 0; | 348 | __poll_t mask = 0; |
| 348 | 349 | ||
| 350 | poll_wait(file, sk_sleep(sk), wait); | ||
| 351 | |||
| 349 | if (sk->sk_state == TCP_CLOSE) | 352 | if (sk->sk_state == TCP_CLOSE) |
| 350 | return EPOLLERR; | 353 | return EPOLLERR; |
| 351 | if (!skb_queue_empty(&sk->sk_receive_queue)) | 354 | if (!skb_queue_empty(&sk->sk_receive_queue)) |
| @@ -445,7 +448,7 @@ const struct proto_ops phonet_dgram_ops = { | |||
| 445 | .socketpair = sock_no_socketpair, | 448 | .socketpair = sock_no_socketpair, |
| 446 | .accept = sock_no_accept, | 449 | .accept = sock_no_accept, |
| 447 | .getname = pn_socket_getname, | 450 | .getname = pn_socket_getname, |
| 448 | .poll_mask = datagram_poll_mask, | 451 | .poll = datagram_poll, |
| 449 | .ioctl = pn_socket_ioctl, | 452 | .ioctl = pn_socket_ioctl, |
| 450 | .listen = sock_no_listen, | 453 | .listen = sock_no_listen, |
| 451 | .shutdown = sock_no_shutdown, | 454 | .shutdown = sock_no_shutdown, |
| @@ -470,7 +473,7 @@ const struct proto_ops phonet_stream_ops = { | |||
| 470 | .socketpair = sock_no_socketpair, | 473 | .socketpair = sock_no_socketpair, |
| 471 | .accept = pn_socket_accept, | 474 | .accept = pn_socket_accept, |
| 472 | .getname = pn_socket_getname, | 475 | .getname = pn_socket_getname, |
| 473 | .poll_mask = pn_socket_poll_mask, | 476 | .poll = pn_socket_poll, |
| 474 | .ioctl = pn_socket_ioctl, | 477 | .ioctl = pn_socket_ioctl, |
| 475 | .listen = pn_socket_listen, | 478 | .listen = pn_socket_listen, |
| 476 | .shutdown = sock_no_shutdown, | 479 | .shutdown = sock_no_shutdown, |
diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index 1b5025ea5b04..2aa07b547b16 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c | |||
| @@ -1023,7 +1023,7 @@ static const struct proto_ops qrtr_proto_ops = { | |||
| 1023 | .recvmsg = qrtr_recvmsg, | 1023 | .recvmsg = qrtr_recvmsg, |
| 1024 | .getname = qrtr_getname, | 1024 | .getname = qrtr_getname, |
| 1025 | .ioctl = qrtr_ioctl, | 1025 | .ioctl = qrtr_ioctl, |
| 1026 | .poll_mask = datagram_poll_mask, | 1026 | .poll = datagram_poll, |
| 1027 | .shutdown = sock_no_shutdown, | 1027 | .shutdown = sock_no_shutdown, |
| 1028 | .setsockopt = sock_no_setsockopt, | 1028 | .setsockopt = sock_no_setsockopt, |
| 1029 | .getsockopt = sock_no_getsockopt, | 1029 | .getsockopt = sock_no_getsockopt, |
diff --git a/net/rds/connection.c b/net/rds/connection.c index abef75da89a7..cfb05953b0e5 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c | |||
| @@ -659,11 +659,19 @@ static void rds_conn_info(struct socket *sock, unsigned int len, | |||
| 659 | 659 | ||
| 660 | int rds_conn_init(void) | 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 | rds_conn_slab = kmem_cache_create("rds_connection", | 668 | rds_conn_slab = kmem_cache_create("rds_connection", |
| 663 | sizeof(struct rds_connection), | 669 | sizeof(struct rds_connection), |
| 664 | 0, 0, NULL); | 670 | 0, 0, NULL); |
| 665 | if (!rds_conn_slab) | 671 | if (!rds_conn_slab) { |
| 672 | rds_loop_net_exit(); | ||
| 666 | return -ENOMEM; | 673 | return -ENOMEM; |
| 674 | } | ||
| 667 | 675 | ||
| 668 | rds_info_register_func(RDS_INFO_CONNECTIONS, rds_conn_info); | 676 | rds_info_register_func(RDS_INFO_CONNECTIONS, rds_conn_info); |
| 669 | rds_info_register_func(RDS_INFO_SEND_MESSAGES, | 677 | rds_info_register_func(RDS_INFO_SEND_MESSAGES, |
| @@ -676,6 +684,7 @@ int rds_conn_init(void) | |||
| 676 | 684 | ||
| 677 | void rds_conn_exit(void) | 685 | void rds_conn_exit(void) |
| 678 | { | 686 | { |
| 687 | rds_loop_net_exit(); /* unregister pernet callback */ | ||
| 679 | rds_loop_exit(); | 688 | rds_loop_exit(); |
| 680 | 689 | ||
| 681 | WARN_ON(!hlist_empty(rds_conn_hash)); | 690 | WARN_ON(!hlist_empty(rds_conn_hash)); |
diff --git a/net/rds/loop.c b/net/rds/loop.c index dac6218a460e..feea1f96ee2a 100644 --- a/net/rds/loop.c +++ b/net/rds/loop.c | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
| 35 | #include <linux/in.h> | 35 | #include <linux/in.h> |
| 36 | #include <net/net_namespace.h> | ||
| 37 | #include <net/netns/generic.h> | ||
| 36 | 38 | ||
| 37 | #include "rds_single_path.h" | 39 | #include "rds_single_path.h" |
| 38 | #include "rds.h" | 40 | #include "rds.h" |
| @@ -40,6 +42,17 @@ | |||
| 40 | 42 | ||
| 41 | static DEFINE_SPINLOCK(loop_conns_lock); | 43 | static DEFINE_SPINLOCK(loop_conns_lock); |
| 42 | static LIST_HEAD(loop_conns); | 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 | * This 'loopback' transport is a special case for flows that originate | 58 | * This 'loopback' transport is a special case for flows that originate |
| @@ -165,6 +178,8 @@ void rds_loop_exit(void) | |||
| 165 | struct rds_loop_connection *lc, *_lc; | 178 | struct rds_loop_connection *lc, *_lc; |
| 166 | LIST_HEAD(tmp_list); | 179 | LIST_HEAD(tmp_list); |
| 167 | 180 | ||
| 181 | rds_loop_set_unloading(); | ||
| 182 | synchronize_rcu(); | ||
| 168 | /* avoid calling conn_destroy with irqs off */ | 183 | /* avoid calling conn_destroy with irqs off */ |
| 169 | spin_lock_irq(&loop_conns_lock); | 184 | spin_lock_irq(&loop_conns_lock); |
| 170 | list_splice(&loop_conns, &tmp_list); | 185 | list_splice(&loop_conns, &tmp_list); |
| @@ -177,6 +192,46 @@ void rds_loop_exit(void) | |||
| 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 | * This is missing .xmit_* because loop doesn't go through generic | 236 | * This is missing .xmit_* because loop doesn't go through generic |
| 182 | * rds_send_xmit() and doesn't call rds_recv_incoming(). .listen_stop and | 237 | * rds_send_xmit() and doesn't call rds_recv_incoming(). .listen_stop and |
| @@ -194,4 +249,5 @@ struct rds_transport rds_loop_transport = { | |||
| 194 | .inc_free = rds_loop_inc_free, | 249 | .inc_free = rds_loop_inc_free, |
| 195 | .t_name = "loopback", | 250 | .t_name = "loopback", |
| 196 | .t_type = RDS_TRANS_LOOP, | 251 | .t_type = RDS_TRANS_LOOP, |
| 252 | .t_unloading = rds_loop_is_unloading, | ||
| 197 | }; | 253 | }; |
diff --git a/net/rds/loop.h b/net/rds/loop.h index 469fa4b2da4f..bbc8cdd030df 100644 --- a/net/rds/loop.h +++ b/net/rds/loop.h | |||
| @@ -5,6 +5,8 @@ | |||
| 5 | /* loop.c */ | 5 | /* loop.c */ |
| 6 | extern struct rds_transport rds_loop_transport; | 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 | void rds_loop_exit(void); | 10 | void rds_loop_exit(void); |
| 9 | 11 | ||
| 10 | #endif | 12 | #endif |
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index ebe42e7eb456..d00a0ef39a56 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
| @@ -1470,7 +1470,7 @@ static const struct proto_ops rose_proto_ops = { | |||
| 1470 | .socketpair = sock_no_socketpair, | 1470 | .socketpair = sock_no_socketpair, |
| 1471 | .accept = rose_accept, | 1471 | .accept = rose_accept, |
| 1472 | .getname = rose_getname, | 1472 | .getname = rose_getname, |
| 1473 | .poll_mask = datagram_poll_mask, | 1473 | .poll = datagram_poll, |
| 1474 | .ioctl = rose_ioctl, | 1474 | .ioctl = rose_ioctl, |
| 1475 | .listen = rose_listen, | 1475 | .listen = rose_listen, |
| 1476 | .shutdown = sock_no_shutdown, | 1476 | .shutdown = sock_no_shutdown, |
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c index 3b1ac93efee2..2b463047dd7b 100644 --- a/net/rxrpc/af_rxrpc.c +++ b/net/rxrpc/af_rxrpc.c | |||
| @@ -734,11 +734,15 @@ static int rxrpc_getsockopt(struct socket *sock, int level, int optname, | |||
| 734 | /* | 734 | /* |
| 735 | * permit an RxRPC socket to be polled | 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 | struct sock *sk = sock->sk; | 740 | struct sock *sk = sock->sk; |
| 740 | struct rxrpc_sock *rx = rxrpc_sk(sk); | 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 | /* the socket is readable if there are any messages waiting on the Rx | 747 | /* the socket is readable if there are any messages waiting on the Rx |
| 744 | * queue */ | 748 | * queue */ |
| @@ -945,7 +949,7 @@ static const struct proto_ops rxrpc_rpc_ops = { | |||
| 945 | .socketpair = sock_no_socketpair, | 949 | .socketpair = sock_no_socketpair, |
| 946 | .accept = sock_no_accept, | 950 | .accept = sock_no_accept, |
| 947 | .getname = sock_no_getname, | 951 | .getname = sock_no_getname, |
| 948 | .poll_mask = rxrpc_poll_mask, | 952 | .poll = rxrpc_poll, |
| 949 | .ioctl = sock_no_ioctl, | 953 | .ioctl = sock_no_ioctl, |
| 950 | .listen = rxrpc_listen, | 954 | .listen = rxrpc_listen, |
| 951 | .shutdown = rxrpc_shutdown, | 955 | .shutdown = rxrpc_shutdown, |
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 7339918a805d..0cd2e764f47f 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
| @@ -1010,7 +1010,7 @@ static const struct proto_ops inet6_seqpacket_ops = { | |||
| 1010 | .socketpair = sock_no_socketpair, | 1010 | .socketpair = sock_no_socketpair, |
| 1011 | .accept = inet_accept, | 1011 | .accept = inet_accept, |
| 1012 | .getname = sctp_getname, | 1012 | .getname = sctp_getname, |
| 1013 | .poll_mask = sctp_poll_mask, | 1013 | .poll = sctp_poll, |
| 1014 | .ioctl = inet6_ioctl, | 1014 | .ioctl = inet6_ioctl, |
| 1015 | .listen = sctp_inet_listen, | 1015 | .listen = sctp_inet_listen, |
| 1016 | .shutdown = inet_shutdown, | 1016 | .shutdown = inet_shutdown, |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 5dffbc493008..67f73d3a1356 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
| @@ -1016,7 +1016,7 @@ static const struct proto_ops inet_seqpacket_ops = { | |||
| 1016 | .socketpair = sock_no_socketpair, | 1016 | .socketpair = sock_no_socketpair, |
| 1017 | .accept = inet_accept, | 1017 | .accept = inet_accept, |
| 1018 | .getname = inet_getname, /* Semantics are different. */ | 1018 | .getname = inet_getname, /* Semantics are different. */ |
| 1019 | .poll_mask = sctp_poll_mask, | 1019 | .poll = sctp_poll, |
| 1020 | .ioctl = inet_ioctl, | 1020 | .ioctl = inet_ioctl, |
| 1021 | .listen = sctp_inet_listen, | 1021 | .listen = sctp_inet_listen, |
| 1022 | .shutdown = inet_shutdown, /* Looks harmless. */ | 1022 | .shutdown = inet_shutdown, /* Looks harmless. */ |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d20f7addee19..ce620e878538 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
| @@ -7717,12 +7717,14 @@ out: | |||
| 7717 | * here, again, by modeling the current TCP/UDP code. We don't have | 7717 | * here, again, by modeling the current TCP/UDP code. We don't have |
| 7718 | * a good way to test with it yet. | 7718 | * a good way to test with it yet. |
| 7719 | */ | 7719 | */ |
| 7720 | __poll_t sctp_poll_mask(struct socket *sock, __poll_t events) | 7720 | __poll_t sctp_poll(struct file *file, struct socket *sock, poll_table *wait) |
| 7721 | { | 7721 | { |
| 7722 | struct sock *sk = sock->sk; | 7722 | struct sock *sk = sock->sk; |
| 7723 | struct sctp_sock *sp = sctp_sk(sk); | 7723 | struct sctp_sock *sp = sctp_sk(sk); |
| 7724 | __poll_t mask; | 7724 | __poll_t mask; |
| 7725 | 7725 | ||
| 7726 | poll_wait(file, sk_sleep(sk), wait); | ||
| 7727 | |||
| 7726 | sock_rps_record_flow(sk); | 7728 | sock_rps_record_flow(sk); |
| 7727 | 7729 | ||
| 7728 | /* A TCP-style listening socket becomes readable when the accept queue | 7730 | /* A TCP-style listening socket becomes readable when the accept queue |
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index da7f02edcd37..3c1405df936c 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c | |||
| @@ -45,6 +45,7 @@ static DEFINE_MUTEX(smc_create_lgr_pending); /* serialize link group | |||
| 45 | */ | 45 | */ |
| 46 | 46 | ||
| 47 | static void smc_tcp_listen_work(struct work_struct *); | 47 | static void smc_tcp_listen_work(struct work_struct *); |
| 48 | static void smc_connect_work(struct work_struct *); | ||
| 48 | 49 | ||
| 49 | static void smc_set_keepalive(struct sock *sk, int val) | 50 | static void smc_set_keepalive(struct sock *sk, int val) |
| 50 | { | 51 | { |
| @@ -122,6 +123,12 @@ static int smc_release(struct socket *sock) | |||
| 122 | goto out; | 123 | goto out; |
| 123 | 124 | ||
| 124 | smc = smc_sk(sk); | 125 | smc = smc_sk(sk); |
| 126 | |||
| 127 | /* cleanup for a dangling non-blocking connect */ | ||
| 128 | flush_work(&smc->connect_work); | ||
| 129 | kfree(smc->connect_info); | ||
| 130 | smc->connect_info = NULL; | ||
| 131 | |||
| 125 | if (sk->sk_state == SMC_LISTEN) | 132 | if (sk->sk_state == SMC_LISTEN) |
| 126 | /* smc_close_non_accepted() is called and acquires | 133 | /* smc_close_non_accepted() is called and acquires |
| 127 | * sock lock for child sockets again | 134 | * sock lock for child sockets again |
| @@ -186,6 +193,7 @@ static struct sock *smc_sock_alloc(struct net *net, struct socket *sock, | |||
| 186 | sk->sk_protocol = protocol; | 193 | sk->sk_protocol = protocol; |
| 187 | smc = smc_sk(sk); | 194 | smc = smc_sk(sk); |
| 188 | INIT_WORK(&smc->tcp_listen_work, smc_tcp_listen_work); | 195 | INIT_WORK(&smc->tcp_listen_work, smc_tcp_listen_work); |
| 196 | INIT_WORK(&smc->connect_work, smc_connect_work); | ||
| 189 | INIT_DELAYED_WORK(&smc->conn.tx_work, smc_tx_work); | 197 | INIT_DELAYED_WORK(&smc->conn.tx_work, smc_tx_work); |
| 190 | INIT_LIST_HEAD(&smc->accept_q); | 198 | INIT_LIST_HEAD(&smc->accept_q); |
| 191 | spin_lock_init(&smc->accept_q_lock); | 199 | spin_lock_init(&smc->accept_q_lock); |
| @@ -576,6 +584,35 @@ static int __smc_connect(struct smc_sock *smc) | |||
| 576 | return 0; | 584 | return 0; |
| 577 | } | 585 | } |
| 578 | 586 | ||
| 587 | static void smc_connect_work(struct work_struct *work) | ||
| 588 | { | ||
| 589 | struct smc_sock *smc = container_of(work, struct smc_sock, | ||
| 590 | connect_work); | ||
| 591 | int rc; | ||
| 592 | |||
| 593 | lock_sock(&smc->sk); | ||
| 594 | rc = kernel_connect(smc->clcsock, &smc->connect_info->addr, | ||
| 595 | smc->connect_info->alen, smc->connect_info->flags); | ||
| 596 | if (smc->clcsock->sk->sk_err) { | ||
| 597 | smc->sk.sk_err = smc->clcsock->sk->sk_err; | ||
| 598 | goto out; | ||
| 599 | } | ||
| 600 | if (rc < 0) { | ||
| 601 | smc->sk.sk_err = -rc; | ||
| 602 | goto out; | ||
| 603 | } | ||
| 604 | |||
| 605 | rc = __smc_connect(smc); | ||
| 606 | if (rc < 0) | ||
| 607 | smc->sk.sk_err = -rc; | ||
| 608 | |||
| 609 | out: | ||
| 610 | smc->sk.sk_state_change(&smc->sk); | ||
| 611 | kfree(smc->connect_info); | ||
| 612 | smc->connect_info = NULL; | ||
| 613 | release_sock(&smc->sk); | ||
| 614 | } | ||
| 615 | |||
| 579 | static int smc_connect(struct socket *sock, struct sockaddr *addr, | 616 | static int smc_connect(struct socket *sock, struct sockaddr *addr, |
| 580 | int alen, int flags) | 617 | int alen, int flags) |
| 581 | { | 618 | { |
| @@ -605,15 +642,32 @@ static int smc_connect(struct socket *sock, struct sockaddr *addr, | |||
| 605 | 642 | ||
| 606 | smc_copy_sock_settings_to_clc(smc); | 643 | smc_copy_sock_settings_to_clc(smc); |
| 607 | tcp_sk(smc->clcsock->sk)->syn_smc = 1; | 644 | tcp_sk(smc->clcsock->sk)->syn_smc = 1; |
| 608 | rc = kernel_connect(smc->clcsock, addr, alen, flags); | 645 | if (flags & O_NONBLOCK) { |
| 609 | if (rc) | 646 | if (smc->connect_info) { |
| 610 | goto out; | 647 | rc = -EALREADY; |
| 648 | goto out; | ||
| 649 | } | ||
| 650 | smc->connect_info = kzalloc(alen + 2 * sizeof(int), GFP_KERNEL); | ||
| 651 | if (!smc->connect_info) { | ||
| 652 | rc = -ENOMEM; | ||
| 653 | goto out; | ||
| 654 | } | ||
| 655 | smc->connect_info->alen = alen; | ||
| 656 | smc->connect_info->flags = flags ^ O_NONBLOCK; | ||
| 657 | memcpy(&smc->connect_info->addr, addr, alen); | ||
| 658 | schedule_work(&smc->connect_work); | ||
| 659 | rc = -EINPROGRESS; | ||
| 660 | } else { | ||
| 661 | rc = kernel_connect(smc->clcsock, addr, alen, flags); | ||
| 662 | if (rc) | ||
| 663 | goto out; | ||
| 611 | 664 | ||
| 612 | rc = __smc_connect(smc); | 665 | rc = __smc_connect(smc); |
| 613 | if (rc < 0) | 666 | if (rc < 0) |
| 614 | goto out; | 667 | goto out; |
| 615 | else | 668 | else |
| 616 | rc = 0; /* success cases including fallback */ | 669 | rc = 0; /* success cases including fallback */ |
| 670 | } | ||
| 617 | 671 | ||
| 618 | out: | 672 | out: |
| 619 | release_sock(sk); | 673 | release_sock(sk); |
| @@ -1273,40 +1327,26 @@ static __poll_t smc_accept_poll(struct sock *parent) | |||
| 1273 | return mask; | 1327 | return mask; |
| 1274 | } | 1328 | } |
| 1275 | 1329 | ||
| 1276 | static __poll_t smc_poll_mask(struct socket *sock, __poll_t events) | 1330 | static __poll_t smc_poll(struct file *file, struct socket *sock, |
| 1331 | poll_table *wait) | ||
| 1277 | { | 1332 | { |
| 1278 | struct sock *sk = sock->sk; | 1333 | struct sock *sk = sock->sk; |
| 1279 | __poll_t mask = 0; | 1334 | __poll_t mask = 0; |
| 1280 | struct smc_sock *smc; | 1335 | struct smc_sock *smc; |
| 1281 | int rc; | ||
| 1282 | 1336 | ||
| 1283 | if (!sk) | 1337 | if (!sk) |
| 1284 | return EPOLLNVAL; | 1338 | return EPOLLNVAL; |
| 1285 | 1339 | ||
| 1286 | smc = smc_sk(sock->sk); | 1340 | smc = smc_sk(sock->sk); |
| 1287 | sock_hold(sk); | ||
| 1288 | lock_sock(sk); | ||
| 1289 | if ((sk->sk_state == SMC_INIT) || smc->use_fallback) { | 1341 | if ((sk->sk_state == SMC_INIT) || smc->use_fallback) { |
| 1290 | /* delegate to CLC child sock */ | 1342 | /* delegate to CLC child sock */ |
| 1291 | release_sock(sk); | 1343 | mask = smc->clcsock->ops->poll(file, smc->clcsock, wait); |
| 1292 | mask = smc->clcsock->ops->poll_mask(smc->clcsock, events); | ||
| 1293 | lock_sock(sk); | ||
| 1294 | sk->sk_err = smc->clcsock->sk->sk_err; | 1344 | sk->sk_err = smc->clcsock->sk->sk_err; |
| 1295 | if (sk->sk_err) { | 1345 | if (sk->sk_err) |
| 1296 | mask |= EPOLLERR; | 1346 | mask |= EPOLLERR; |
| 1297 | } else { | ||
| 1298 | /* if non-blocking connect finished ... */ | ||
| 1299 | if (sk->sk_state == SMC_INIT && | ||
| 1300 | mask & EPOLLOUT && | ||
| 1301 | smc->clcsock->sk->sk_state != TCP_CLOSE) { | ||
| 1302 | rc = __smc_connect(smc); | ||
| 1303 | if (rc < 0) | ||
| 1304 | mask |= EPOLLERR; | ||
| 1305 | /* success cases including fallback */ | ||
| 1306 | mask |= EPOLLOUT | EPOLLWRNORM; | ||
| 1307 | } | ||
| 1308 | } | ||
| 1309 | } else { | 1347 | } else { |
| 1348 | if (sk->sk_state != SMC_CLOSED) | ||
| 1349 | sock_poll_wait(file, sk_sleep(sk), wait); | ||
| 1310 | if (sk->sk_err) | 1350 | if (sk->sk_err) |
| 1311 | mask |= EPOLLERR; | 1351 | mask |= EPOLLERR; |
| 1312 | if ((sk->sk_shutdown == SHUTDOWN_MASK) || | 1352 | if ((sk->sk_shutdown == SHUTDOWN_MASK) || |
| @@ -1332,10 +1372,7 @@ static __poll_t smc_poll_mask(struct socket *sock, __poll_t events) | |||
| 1332 | } | 1372 | } |
| 1333 | if (smc->conn.urg_state == SMC_URG_VALID) | 1373 | if (smc->conn.urg_state == SMC_URG_VALID) |
| 1334 | mask |= EPOLLPRI; | 1374 | mask |= EPOLLPRI; |
| 1335 | |||
| 1336 | } | 1375 | } |
| 1337 | release_sock(sk); | ||
| 1338 | sock_put(sk); | ||
| 1339 | 1376 | ||
| 1340 | return mask; | 1377 | return mask; |
| 1341 | } | 1378 | } |
| @@ -1619,7 +1656,7 @@ static const struct proto_ops smc_sock_ops = { | |||
| 1619 | .socketpair = sock_no_socketpair, | 1656 | .socketpair = sock_no_socketpair, |
| 1620 | .accept = smc_accept, | 1657 | .accept = smc_accept, |
| 1621 | .getname = smc_getname, | 1658 | .getname = smc_getname, |
| 1622 | .poll_mask = smc_poll_mask, | 1659 | .poll = smc_poll, |
| 1623 | .ioctl = smc_ioctl, | 1660 | .ioctl = smc_ioctl, |
| 1624 | .listen = smc_listen, | 1661 | .listen = smc_listen, |
| 1625 | .shutdown = smc_shutdown, | 1662 | .shutdown = smc_shutdown, |
diff --git a/net/smc/smc.h b/net/smc/smc.h index 51ae1f10d81a..d7ca26570482 100644 --- a/net/smc/smc.h +++ b/net/smc/smc.h | |||
| @@ -187,11 +187,19 @@ struct smc_connection { | |||
| 187 | struct work_struct close_work; /* peer sent some closing */ | 187 | struct work_struct close_work; /* peer sent some closing */ |
| 188 | }; | 188 | }; |
| 189 | 189 | ||
| 190 | struct smc_connect_info { | ||
| 191 | int flags; | ||
| 192 | int alen; | ||
| 193 | struct sockaddr addr; | ||
| 194 | }; | ||
| 195 | |||
| 190 | struct smc_sock { /* smc sock container */ | 196 | struct smc_sock { /* smc sock container */ |
| 191 | struct sock sk; | 197 | struct sock sk; |
| 192 | struct socket *clcsock; /* internal tcp socket */ | 198 | struct socket *clcsock; /* internal tcp socket */ |
| 193 | struct smc_connection conn; /* smc connection */ | 199 | struct smc_connection conn; /* smc connection */ |
| 194 | struct smc_sock *listen_smc; /* listen parent */ | 200 | struct smc_sock *listen_smc; /* listen parent */ |
| 201 | struct smc_connect_info *connect_info; /* connect address & flags */ | ||
| 202 | struct work_struct connect_work; /* handle non-blocking connect*/ | ||
| 195 | struct work_struct tcp_listen_work;/* handle tcp socket accepts */ | 203 | struct work_struct tcp_listen_work;/* handle tcp socket accepts */ |
| 196 | struct work_struct smc_listen_work;/* prepare new accept socket */ | 204 | struct work_struct smc_listen_work;/* prepare new accept socket */ |
| 197 | struct list_head accept_q; /* sockets to be accepted */ | 205 | struct list_head accept_q; /* sockets to be accepted */ |
diff --git a/net/socket.c b/net/socket.c index 8a109012608a..85633622c94d 100644 --- a/net/socket.c +++ b/net/socket.c | |||
| @@ -117,10 +117,8 @@ static ssize_t sock_write_iter(struct kiocb *iocb, struct iov_iter *from); | |||
| 117 | static int sock_mmap(struct file *file, struct vm_area_struct *vma); | 117 | static int sock_mmap(struct file *file, struct vm_area_struct *vma); |
| 118 | 118 | ||
| 119 | static int sock_close(struct inode *inode, struct file *file); | 119 | static int sock_close(struct inode *inode, struct file *file); |
| 120 | static struct wait_queue_head *sock_get_poll_head(struct file *file, | 120 | static __poll_t sock_poll(struct file *file, |
| 121 | __poll_t events); | 121 | struct poll_table_struct *wait); |
| 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); | ||
| 124 | static long sock_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | 122 | static long sock_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
| 125 | #ifdef CONFIG_COMPAT | 123 | #ifdef CONFIG_COMPAT |
| 126 | static long compat_sock_ioctl(struct file *file, | 124 | static long compat_sock_ioctl(struct file *file, |
| @@ -143,8 +141,6 @@ static const struct file_operations socket_file_ops = { | |||
| 143 | .llseek = no_llseek, | 141 | .llseek = no_llseek, |
| 144 | .read_iter = sock_read_iter, | 142 | .read_iter = sock_read_iter, |
| 145 | .write_iter = sock_write_iter, | 143 | .write_iter = sock_write_iter, |
| 146 | .get_poll_head = sock_get_poll_head, | ||
| 147 | .poll_mask = sock_poll_mask, | ||
| 148 | .poll = sock_poll, | 144 | .poll = sock_poll, |
| 149 | .unlocked_ioctl = sock_ioctl, | 145 | .unlocked_ioctl = sock_ioctl, |
| 150 | #ifdef CONFIG_COMPAT | 146 | #ifdef CONFIG_COMPAT |
| @@ -1130,48 +1126,16 @@ out_release: | |||
| 1130 | } | 1126 | } |
| 1131 | EXPORT_SYMBOL(sock_create_lite); | 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 | /* No kernel lock held - perfect */ | 1129 | /* No kernel lock held - perfect */ |
| 1161 | static __poll_t sock_poll(struct file *file, poll_table *wait) | 1130 | static __poll_t sock_poll(struct file *file, poll_table *wait) |
| 1162 | { | 1131 | { |
| 1163 | struct socket *sock = file->private_data; | 1132 | struct socket *sock = file->private_data; |
| 1164 | __poll_t events = poll_requested_events(wait), mask = 0; | 1133 | __poll_t events = poll_requested_events(wait); |
| 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 | } | ||
| 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 | static int sock_mmap(struct file *file, struct vm_area_struct *vma) | 1141 | static int sock_mmap(struct file *file, struct vm_area_struct *vma) |
diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c index 373836615c57..625acb27efcc 100644 --- a/net/strparser/strparser.c +++ b/net/strparser/strparser.c | |||
| @@ -35,7 +35,6 @@ struct _strp_msg { | |||
| 35 | */ | 35 | */ |
| 36 | struct strp_msg strp; | 36 | struct strp_msg strp; |
| 37 | int accum_len; | 37 | int accum_len; |
| 38 | int early_eaten; | ||
| 39 | }; | 38 | }; |
| 40 | 39 | ||
| 41 | static inline struct _strp_msg *_strp_msg(struct sk_buff *skb) | 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, | |||
| 115 | head = strp->skb_head; | 114 | head = strp->skb_head; |
| 116 | if (head) { | 115 | if (head) { |
| 117 | /* Message already in progress */ | 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 | if (unlikely(orig_offset)) { | 117 | if (unlikely(orig_offset)) { |
| 133 | /* Getting data with a non-zero offset when a message is | 118 | /* Getting data with a non-zero offset when a message is |
| 134 | * in progress is not expected. If it does happen, we | 119 | * in progress is not expected. If it does happen, we |
| @@ -297,9 +282,9 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb, | |||
| 297 | } | 282 | } |
| 298 | 283 | ||
| 299 | stm->accum_len += cand_len; | 284 | stm->accum_len += cand_len; |
| 285 | eaten += cand_len; | ||
| 300 | strp->need_bytes = stm->strp.full_len - | 286 | strp->need_bytes = stm->strp.full_len - |
| 301 | stm->accum_len; | 287 | stm->accum_len; |
| 302 | stm->early_eaten = cand_len; | ||
| 303 | STRP_STATS_ADD(strp->stats.bytes, cand_len); | 288 | STRP_STATS_ADD(strp->stats.bytes, cand_len); |
| 304 | desc->count = 0; /* Stop reading socket */ | 289 | desc->count = 0; /* Stop reading socket */ |
| 305 | break; | 290 | break; |
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 14a5d055717d..930852c54d7a 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
| @@ -692,9 +692,10 @@ static int tipc_getname(struct socket *sock, struct sockaddr *uaddr, | |||
| 692 | } | 692 | } |
| 693 | 693 | ||
| 694 | /** | 694 | /** |
| 695 | * tipc_poll - read pollmask | 695 | * tipc_poll - read and possibly block on pollmask |
| 696 | * @file: file structure associated with the socket | 696 | * @file: file structure associated with the socket |
| 697 | * @sock: socket for which to calculate the poll bits | 697 | * @sock: socket for which to calculate the poll bits |
| 698 | * @wait: ??? | ||
| 698 | * | 699 | * |
| 699 | * Returns pollmask value | 700 | * Returns pollmask value |
| 700 | * | 701 | * |
| @@ -708,12 +709,15 @@ static int tipc_getname(struct socket *sock, struct sockaddr *uaddr, | |||
| 708 | * imply that the operation will succeed, merely that it should be performed | 709 | * imply that the operation will succeed, merely that it should be performed |
| 709 | * and will not block. | 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 | struct sock *sk = sock->sk; | 715 | struct sock *sk = sock->sk; |
| 714 | struct tipc_sock *tsk = tipc_sk(sk); | 716 | struct tipc_sock *tsk = tipc_sk(sk); |
| 715 | __poll_t revents = 0; | 717 | __poll_t revents = 0; |
| 716 | 718 | ||
| 719 | sock_poll_wait(file, sk_sleep(sk), wait); | ||
| 720 | |||
| 717 | if (sk->sk_shutdown & RCV_SHUTDOWN) | 721 | if (sk->sk_shutdown & RCV_SHUTDOWN) |
| 718 | revents |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM; | 722 | revents |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM; |
| 719 | if (sk->sk_shutdown == SHUTDOWN_MASK) | 723 | if (sk->sk_shutdown == SHUTDOWN_MASK) |
| @@ -3033,7 +3037,7 @@ static const struct proto_ops msg_ops = { | |||
| 3033 | .socketpair = tipc_socketpair, | 3037 | .socketpair = tipc_socketpair, |
| 3034 | .accept = sock_no_accept, | 3038 | .accept = sock_no_accept, |
| 3035 | .getname = tipc_getname, | 3039 | .getname = tipc_getname, |
| 3036 | .poll_mask = tipc_poll_mask, | 3040 | .poll = tipc_poll, |
| 3037 | .ioctl = tipc_ioctl, | 3041 | .ioctl = tipc_ioctl, |
| 3038 | .listen = sock_no_listen, | 3042 | .listen = sock_no_listen, |
| 3039 | .shutdown = tipc_shutdown, | 3043 | .shutdown = tipc_shutdown, |
| @@ -3054,7 +3058,7 @@ static const struct proto_ops packet_ops = { | |||
| 3054 | .socketpair = tipc_socketpair, | 3058 | .socketpair = tipc_socketpair, |
| 3055 | .accept = tipc_accept, | 3059 | .accept = tipc_accept, |
| 3056 | .getname = tipc_getname, | 3060 | .getname = tipc_getname, |
| 3057 | .poll_mask = tipc_poll_mask, | 3061 | .poll = tipc_poll, |
| 3058 | .ioctl = tipc_ioctl, | 3062 | .ioctl = tipc_ioctl, |
| 3059 | .listen = tipc_listen, | 3063 | .listen = tipc_listen, |
| 3060 | .shutdown = tipc_shutdown, | 3064 | .shutdown = tipc_shutdown, |
| @@ -3075,7 +3079,7 @@ static const struct proto_ops stream_ops = { | |||
| 3075 | .socketpair = tipc_socketpair, | 3079 | .socketpair = tipc_socketpair, |
| 3076 | .accept = tipc_accept, | 3080 | .accept = tipc_accept, |
| 3077 | .getname = tipc_getname, | 3081 | .getname = tipc_getname, |
| 3078 | .poll_mask = tipc_poll_mask, | 3082 | .poll = tipc_poll, |
| 3079 | .ioctl = tipc_ioctl, | 3083 | .ioctl = tipc_ioctl, |
| 3080 | .listen = tipc_listen, | 3084 | .listen = tipc_listen, |
| 3081 | .shutdown = tipc_shutdown, | 3085 | .shutdown = tipc_shutdown, |
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index a127d61e8af9..301f22430469 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c | |||
| @@ -712,7 +712,7 @@ static int __init tls_register(void) | |||
| 712 | build_protos(tls_prots[TLSV4], &tcp_prot); | 712 | build_protos(tls_prots[TLSV4], &tcp_prot); |
| 713 | 713 | ||
| 714 | tls_sw_proto_ops = inet_stream_ops; | 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 | tls_sw_proto_ops.splice_read = tls_sw_splice_read; | 716 | tls_sw_proto_ops.splice_read = tls_sw_splice_read; |
| 717 | 717 | ||
| 718 | #ifdef CONFIG_TLS_DEVICE | 718 | #ifdef CONFIG_TLS_DEVICE |
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index f127fac88acf..d2380548f8f6 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c | |||
| @@ -919,22 +919,23 @@ splice_read_end: | |||
| 919 | return copied ? : err; | 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 | struct sock *sk = sock->sk; | 926 | struct sock *sk = sock->sk; |
| 925 | struct tls_context *tls_ctx = tls_get_ctx(sk); | 927 | struct tls_context *tls_ctx = tls_get_ctx(sk); |
| 926 | struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); | 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 | /* Grab POLLOUT and POLLHUP from the underlying socket */ |
| 930 | mask = ctx->sk_poll_mask(sock, events); | 931 | ret = ctx->sk_poll(file, sock, wait); |
| 931 | 932 | ||
| 932 | /* Clear EPOLLIN bits, and set based on recv_pkt */ | 933 | /* Clear POLLIN bits, and set based on recv_pkt */ |
| 933 | mask &= ~(EPOLLIN | EPOLLRDNORM); | 934 | ret &= ~(POLLIN | POLLRDNORM); |
| 934 | if (ctx->recv_pkt) | 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 | static int tls_read_size(struct strparser *strp, struct sk_buff *skb) | 941 | static int tls_read_size(struct strparser *strp, struct sk_buff *skb) |
| @@ -1191,7 +1192,7 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx) | |||
| 1191 | sk->sk_data_ready = tls_data_ready; | 1192 | sk->sk_data_ready = tls_data_ready; |
| 1192 | write_unlock_bh(&sk->sk_callback_lock); | 1193 | write_unlock_bh(&sk->sk_callback_lock); |
| 1193 | 1194 | ||
| 1194 | sw_ctx_rx->sk_poll_mask = sk->sk_socket->ops->poll_mask; | 1195 | sw_ctx_rx->sk_poll = sk->sk_socket->ops->poll; |
| 1195 | 1196 | ||
| 1196 | strp_check_rcv(&sw_ctx_rx->strp); | 1197 | strp_check_rcv(&sw_ctx_rx->strp); |
| 1197 | } | 1198 | } |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 95b02a71fd47..e5473c03d667 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
| @@ -638,8 +638,9 @@ static int unix_stream_connect(struct socket *, struct sockaddr *, | |||
| 638 | static int unix_socketpair(struct socket *, struct socket *); | 638 | static int unix_socketpair(struct socket *, struct socket *); |
| 639 | static int unix_accept(struct socket *, struct socket *, int, bool); | 639 | static int unix_accept(struct socket *, struct socket *, int, bool); |
| 640 | static int unix_getname(struct socket *, struct sockaddr *, int); | 640 | static int unix_getname(struct socket *, struct sockaddr *, int); |
| 641 | static __poll_t unix_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_mask(struct socket *, __poll_t); | 642 | static __poll_t unix_dgram_poll(struct file *, struct socket *, |
| 643 | poll_table *); | ||
| 643 | static int unix_ioctl(struct socket *, unsigned int, unsigned long); | 644 | static int unix_ioctl(struct socket *, unsigned int, unsigned long); |
| 644 | static int unix_shutdown(struct socket *, int); | 645 | static int unix_shutdown(struct socket *, int); |
| 645 | static int unix_stream_sendmsg(struct socket *, struct msghdr *, size_t); | 646 | static int unix_stream_sendmsg(struct socket *, struct msghdr *, size_t); |
| @@ -680,7 +681,7 @@ static const struct proto_ops unix_stream_ops = { | |||
| 680 | .socketpair = unix_socketpair, | 681 | .socketpair = unix_socketpair, |
| 681 | .accept = unix_accept, | 682 | .accept = unix_accept, |
| 682 | .getname = unix_getname, | 683 | .getname = unix_getname, |
| 683 | .poll_mask = unix_poll_mask, | 684 | .poll = unix_poll, |
| 684 | .ioctl = unix_ioctl, | 685 | .ioctl = unix_ioctl, |
| 685 | .listen = unix_listen, | 686 | .listen = unix_listen, |
| 686 | .shutdown = unix_shutdown, | 687 | .shutdown = unix_shutdown, |
| @@ -703,7 +704,7 @@ static const struct proto_ops unix_dgram_ops = { | |||
| 703 | .socketpair = unix_socketpair, | 704 | .socketpair = unix_socketpair, |
| 704 | .accept = sock_no_accept, | 705 | .accept = sock_no_accept, |
| 705 | .getname = unix_getname, | 706 | .getname = unix_getname, |
| 706 | .poll_mask = unix_dgram_poll_mask, | 707 | .poll = unix_dgram_poll, |
| 707 | .ioctl = unix_ioctl, | 708 | .ioctl = unix_ioctl, |
| 708 | .listen = sock_no_listen, | 709 | .listen = sock_no_listen, |
| 709 | .shutdown = unix_shutdown, | 710 | .shutdown = unix_shutdown, |
| @@ -725,7 +726,7 @@ static const struct proto_ops unix_seqpacket_ops = { | |||
| 725 | .socketpair = unix_socketpair, | 726 | .socketpair = unix_socketpair, |
| 726 | .accept = unix_accept, | 727 | .accept = unix_accept, |
| 727 | .getname = unix_getname, | 728 | .getname = unix_getname, |
| 728 | .poll_mask = unix_dgram_poll_mask, | 729 | .poll = unix_dgram_poll, |
| 729 | .ioctl = unix_ioctl, | 730 | .ioctl = unix_ioctl, |
| 730 | .listen = unix_listen, | 731 | .listen = unix_listen, |
| 731 | .shutdown = unix_shutdown, | 732 | .shutdown = unix_shutdown, |
| @@ -2629,10 +2630,13 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
| 2629 | return err; | 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 | struct sock *sk = sock->sk; | 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 | /* exceptional events? */ | 2641 | /* exceptional events? */ |
| 2638 | if (sk->sk_err) | 2642 | if (sk->sk_err) |
| @@ -2661,11 +2665,15 @@ static __poll_t unix_poll_mask(struct socket *sock, __poll_t events) | |||
| 2661 | return mask; | 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 | struct sock *sk = sock->sk, *other; | 2671 | struct sock *sk = sock->sk, *other; |
| 2667 | int writable; | 2672 | unsigned int writable; |
| 2668 | __poll_t mask = 0; | 2673 | __poll_t mask; |
| 2674 | |||
| 2675 | sock_poll_wait(file, sk_sleep(sk), wait); | ||
| 2676 | mask = 0; | ||
| 2669 | 2677 | ||
| 2670 | /* exceptional events? */ | 2678 | /* exceptional events? */ |
| 2671 | if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) | 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) | |||
| 2691 | } | 2699 | } |
| 2692 | 2700 | ||
| 2693 | /* No write status requested, avoid expensive OUT tests. */ | 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 | return mask; | 2703 | return mask; |
| 2696 | 2704 | ||
| 2697 | writable = unix_writable(sk); | 2705 | writable = unix_writable(sk); |
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index bb5d5fa68c35..c1076c19b858 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c | |||
| @@ -850,11 +850,18 @@ static int vsock_shutdown(struct socket *sock, int mode) | |||
| 850 | return err; | 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 sock *sk; |
| 856 | struct vsock_sock *vsk = vsock_sk(sk); | 857 | __poll_t mask; |
| 857 | __poll_t mask = 0; | 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 | if (sk->sk_err) | 866 | if (sk->sk_err) |
| 860 | /* Signify that there has been an error on this socket. */ | 867 | /* Signify that there has been an error on this socket. */ |
| @@ -1084,7 +1091,7 @@ static const struct proto_ops vsock_dgram_ops = { | |||
| 1084 | .socketpair = sock_no_socketpair, | 1091 | .socketpair = sock_no_socketpair, |
| 1085 | .accept = sock_no_accept, | 1092 | .accept = sock_no_accept, |
| 1086 | .getname = vsock_getname, | 1093 | .getname = vsock_getname, |
| 1087 | .poll_mask = vsock_poll_mask, | 1094 | .poll = vsock_poll, |
| 1088 | .ioctl = sock_no_ioctl, | 1095 | .ioctl = sock_no_ioctl, |
| 1089 | .listen = sock_no_listen, | 1096 | .listen = sock_no_listen, |
| 1090 | .shutdown = vsock_shutdown, | 1097 | .shutdown = vsock_shutdown, |
| @@ -1842,7 +1849,7 @@ static const struct proto_ops vsock_stream_ops = { | |||
| 1842 | .socketpair = sock_no_socketpair, | 1849 | .socketpair = sock_no_socketpair, |
| 1843 | .accept = vsock_accept, | 1850 | .accept = vsock_accept, |
| 1844 | .getname = vsock_getname, | 1851 | .getname = vsock_getname, |
| 1845 | .poll_mask = vsock_poll_mask, | 1852 | .poll = vsock_poll, |
| 1846 | .ioctl = sock_no_ioctl, | 1853 | .ioctl = sock_no_ioctl, |
| 1847 | .listen = vsock_listen, | 1854 | .listen = vsock_listen, |
| 1848 | .shutdown = vsock_shutdown, | 1855 | .shutdown = vsock_shutdown, |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index c7bbe5f0aae8..4eece06be1e7 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
| @@ -6231,7 +6231,7 @@ do { \ | |||
| 6231 | nl80211_check_s32); | 6231 | nl80211_check_s32); |
| 6232 | /* | 6232 | /* |
| 6233 | * Check HT operation mode based on | 6233 | * Check HT operation mode based on |
| 6234 | * IEEE 802.11 2012 8.4.2.59 HT Operation element. | 6234 | * IEEE 802.11-2016 9.4.2.57 HT Operation element. |
| 6235 | */ | 6235 | */ |
| 6236 | if (tb[NL80211_MESHCONF_HT_OPMODE]) { | 6236 | if (tb[NL80211_MESHCONF_HT_OPMODE]) { |
| 6237 | ht_opmode = nla_get_u16(tb[NL80211_MESHCONF_HT_OPMODE]); | 6237 | ht_opmode = nla_get_u16(tb[NL80211_MESHCONF_HT_OPMODE]); |
| @@ -6241,22 +6241,9 @@ do { \ | |||
| 6241 | IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)) | 6241 | IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)) |
| 6242 | return -EINVAL; | 6242 | return -EINVAL; |
| 6243 | 6243 | ||
| 6244 | if ((ht_opmode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) && | 6244 | /* NON_HT_STA bit is reserved, but some programs set it */ |
| 6245 | (ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)) | 6245 | ht_opmode &= ~IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT; |
| 6246 | return -EINVAL; | ||
| 6247 | 6246 | ||
| 6248 | switch (ht_opmode & IEEE80211_HT_OP_MODE_PROTECTION) { | ||
| 6249 | case IEEE80211_HT_OP_MODE_PROTECTION_NONE: | ||
| 6250 | case IEEE80211_HT_OP_MODE_PROTECTION_20MHZ: | ||
| 6251 | if (ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT) | ||
| 6252 | return -EINVAL; | ||
| 6253 | break; | ||
| 6254 | case IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER: | ||
| 6255 | case IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED: | ||
| 6256 | if (!(ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)) | ||
| 6257 | return -EINVAL; | ||
| 6258 | break; | ||
| 6259 | } | ||
| 6260 | cfg->ht_opmode = ht_opmode; | 6247 | cfg->ht_opmode = ht_opmode; |
| 6261 | mask |= (1 << (NL80211_MESHCONF_HT_OPMODE - 1)); | 6248 | mask |= (1 << (NL80211_MESHCONF_HT_OPMODE - 1)); |
| 6262 | } | 6249 | } |
| @@ -10962,9 +10949,12 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info) | |||
| 10962 | rem) { | 10949 | rem) { |
| 10963 | u8 *mask_pat; | 10950 | u8 *mask_pat; |
| 10964 | 10951 | ||
| 10965 | nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, | 10952 | err = nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, |
| 10966 | nl80211_packet_pattern_policy, | 10953 | nl80211_packet_pattern_policy, |
| 10967 | info->extack); | 10954 | info->extack); |
| 10955 | if (err) | ||
| 10956 | goto error; | ||
| 10957 | |||
| 10968 | err = -EINVAL; | 10958 | err = -EINVAL; |
| 10969 | if (!pat_tb[NL80211_PKTPAT_MASK] || | 10959 | if (!pat_tb[NL80211_PKTPAT_MASK] || |
| 10970 | !pat_tb[NL80211_PKTPAT_PATTERN]) | 10960 | !pat_tb[NL80211_PKTPAT_PATTERN]) |
| @@ -11213,8 +11203,11 @@ static int nl80211_parse_coalesce_rule(struct cfg80211_registered_device *rdev, | |||
| 11213 | rem) { | 11203 | rem) { |
| 11214 | u8 *mask_pat; | 11204 | u8 *mask_pat; |
| 11215 | 11205 | ||
| 11216 | nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, | 11206 | err = nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, |
| 11217 | nl80211_packet_pattern_policy, NULL); | 11207 | nl80211_packet_pattern_policy, NULL); |
| 11208 | if (err) | ||
| 11209 | return err; | ||
| 11210 | |||
| 11218 | if (!pat_tb[NL80211_PKTPAT_MASK] || | 11211 | if (!pat_tb[NL80211_PKTPAT_MASK] || |
| 11219 | !pat_tb[NL80211_PKTPAT_PATTERN]) | 11212 | !pat_tb[NL80211_PKTPAT_PATTERN]) |
| 11220 | return -EINVAL; | 11213 | return -EINVAL; |
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index f93365ae0fdd..d49aa79b7997 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
| @@ -1750,7 +1750,7 @@ static const struct proto_ops x25_proto_ops = { | |||
| 1750 | .socketpair = sock_no_socketpair, | 1750 | .socketpair = sock_no_socketpair, |
| 1751 | .accept = x25_accept, | 1751 | .accept = x25_accept, |
| 1752 | .getname = x25_getname, | 1752 | .getname = x25_getname, |
| 1753 | .poll_mask = datagram_poll_mask, | 1753 | .poll = datagram_poll, |
| 1754 | .ioctl = x25_ioctl, | 1754 | .ioctl = x25_ioctl, |
| 1755 | #ifdef CONFIG_COMPAT | 1755 | #ifdef CONFIG_COMPAT |
| 1756 | .compat_ioctl = compat_x25_ioctl, | 1756 | .compat_ioctl = compat_x25_ioctl, |
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 3b3410ada097..59fb7d3c36a3 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c | |||
| @@ -303,9 +303,10 @@ static int xsk_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len) | |||
| 303 | return (xs->zc) ? xsk_zc_xmit(sk) : xsk_generic_xmit(sk, m, total_len); | 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 | struct sock *sk = sock->sk; | 310 | struct sock *sk = sock->sk; |
| 310 | struct xdp_sock *xs = xdp_sk(sk); | 311 | struct xdp_sock *xs = xdp_sk(sk); |
| 311 | 312 | ||
| @@ -696,7 +697,7 @@ static const struct proto_ops xsk_proto_ops = { | |||
| 696 | .socketpair = sock_no_socketpair, | 697 | .socketpair = sock_no_socketpair, |
| 697 | .accept = sock_no_accept, | 698 | .accept = sock_no_accept, |
| 698 | .getname = sock_no_getname, | 699 | .getname = sock_no_getname, |
| 699 | .poll_mask = xsk_poll_mask, | 700 | .poll = xsk_poll, |
| 700 | .ioctl = sock_no_ioctl, | 701 | .ioctl = sock_no_ioctl, |
| 701 | .listen = sock_no_listen, | 702 | .listen = sock_no_listen, |
| 702 | .shutdown = sock_no_shutdown, | 703 | .shutdown = sock_no_shutdown, |
diff --git a/samples/bpf/xdp_fwd_kern.c b/samples/bpf/xdp_fwd_kern.c index 6673cdb9f55c..a7e94e7ff87d 100644 --- a/samples/bpf/xdp_fwd_kern.c +++ b/samples/bpf/xdp_fwd_kern.c | |||
| @@ -48,9 +48,9 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags) | |||
| 48 | struct ethhdr *eth = data; | 48 | struct ethhdr *eth = data; |
| 49 | struct ipv6hdr *ip6h; | 49 | struct ipv6hdr *ip6h; |
| 50 | struct iphdr *iph; | 50 | struct iphdr *iph; |
| 51 | int out_index; | ||
| 52 | u16 h_proto; | 51 | u16 h_proto; |
| 53 | u64 nh_off; | 52 | u64 nh_off; |
| 53 | int rc; | ||
| 54 | 54 | ||
| 55 | nh_off = sizeof(*eth); | 55 | nh_off = sizeof(*eth); |
| 56 | if (data + nh_off > data_end) | 56 | if (data + nh_off > data_end) |
| @@ -101,7 +101,7 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags) | |||
| 101 | 101 | ||
| 102 | fib_params.ifindex = ctx->ingress_ifindex; | 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 | /* verify egress index has xdp support | 106 | /* verify egress index has xdp support |
| 107 | * TO-DO bpf_map_lookup_elem(&tx_port, &key) fails with | 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) | |||
| 109 | * NOTE: without verification that egress index supports XDP | 109 | * NOTE: without verification that egress index supports XDP |
| 110 | * forwarding packets are dropped. | 110 | * forwarding packets are dropped. |
| 111 | */ | 111 | */ |
| 112 | if (out_index > 0) { | 112 | if (rc == 0) { |
| 113 | if (h_proto == htons(ETH_P_IP)) | 113 | if (h_proto == htons(ETH_P_IP)) |
| 114 | ip_decrease_ttl(iph); | 114 | ip_decrease_ttl(iph); |
| 115 | else if (h_proto == htons(ETH_P_IPV6)) | 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) | |||
| 117 | 117 | ||
| 118 | memcpy(eth->h_dest, fib_params.dmac, ETH_ALEN); | 118 | memcpy(eth->h_dest, fib_params.dmac, ETH_ALEN); |
| 119 | memcpy(eth->h_source, fib_params.smac, ETH_ALEN); | 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 | return XDP_PASS; | 123 | return XDP_PASS; |
diff --git a/samples/vfio-mdev/mbochs.c b/samples/vfio-mdev/mbochs.c index 2960e26c6ea4..2535c3677c7b 100644 --- a/samples/vfio-mdev/mbochs.c +++ b/samples/vfio-mdev/mbochs.c | |||
| @@ -178,6 +178,8 @@ static const char *vbe_name(u32 index) | |||
| 178 | return "(invalid)"; | 178 | return "(invalid)"; |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | static struct page *__mbochs_get_page(struct mdev_state *mdev_state, | ||
| 182 | pgoff_t pgoff); | ||
| 181 | static struct page *mbochs_get_page(struct mdev_state *mdev_state, | 183 | static struct page *mbochs_get_page(struct mdev_state *mdev_state, |
| 182 | pgoff_t pgoff); | 184 | pgoff_t pgoff); |
| 183 | 185 | ||
| @@ -394,7 +396,7 @@ static ssize_t mdev_access(struct mdev_device *mdev, char *buf, size_t count, | |||
| 394 | MBOCHS_MEMORY_BAR_OFFSET + mdev_state->memsize) { | 396 | MBOCHS_MEMORY_BAR_OFFSET + mdev_state->memsize) { |
| 395 | pos -= MBOCHS_MMIO_BAR_OFFSET; | 397 | pos -= MBOCHS_MMIO_BAR_OFFSET; |
| 396 | poff = pos & ~PAGE_MASK; | 398 | poff = pos & ~PAGE_MASK; |
| 397 | pg = mbochs_get_page(mdev_state, pos >> PAGE_SHIFT); | 399 | pg = __mbochs_get_page(mdev_state, pos >> PAGE_SHIFT); |
| 398 | map = kmap(pg); | 400 | map = kmap(pg); |
| 399 | if (is_write) | 401 | if (is_write) |
| 400 | memcpy(map + poff, buf, count); | 402 | memcpy(map + poff, buf, count); |
| @@ -657,7 +659,7 @@ static void mbochs_put_pages(struct mdev_state *mdev_state) | |||
| 657 | dev_dbg(dev, "%s: %d pages released\n", __func__, count); | 659 | dev_dbg(dev, "%s: %d pages released\n", __func__, count); |
| 658 | } | 660 | } |
| 659 | 661 | ||
| 660 | static int mbochs_region_vm_fault(struct vm_fault *vmf) | 662 | static vm_fault_t mbochs_region_vm_fault(struct vm_fault *vmf) |
| 661 | { | 663 | { |
| 662 | struct vm_area_struct *vma = vmf->vma; | 664 | struct vm_area_struct *vma = vmf->vma; |
| 663 | struct mdev_state *mdev_state = vma->vm_private_data; | 665 | struct mdev_state *mdev_state = vma->vm_private_data; |
| @@ -695,7 +697,7 @@ static int mbochs_mmap(struct mdev_device *mdev, struct vm_area_struct *vma) | |||
| 695 | return 0; | 697 | return 0; |
| 696 | } | 698 | } |
| 697 | 699 | ||
| 698 | static int mbochs_dmabuf_vm_fault(struct vm_fault *vmf) | 700 | static vm_fault_t mbochs_dmabuf_vm_fault(struct vm_fault *vmf) |
| 699 | { | 701 | { |
| 700 | struct vm_area_struct *vma = vmf->vma; | 702 | struct vm_area_struct *vma = vmf->vma; |
| 701 | struct mbochs_dmabuf *dmabuf = vma->vm_private_data; | 703 | struct mbochs_dmabuf *dmabuf = vma->vm_private_data; |
| @@ -803,29 +805,26 @@ static void mbochs_release_dmabuf(struct dma_buf *buf) | |||
| 803 | mutex_unlock(&mdev_state->ops_lock); | 805 | mutex_unlock(&mdev_state->ops_lock); |
| 804 | } | 806 | } |
| 805 | 807 | ||
| 806 | static void *mbochs_kmap_atomic_dmabuf(struct dma_buf *buf, | 808 | static void *mbochs_kmap_dmabuf(struct dma_buf *buf, unsigned long page_num) |
| 807 | unsigned long page_num) | ||
| 808 | { | 809 | { |
| 809 | struct mbochs_dmabuf *dmabuf = buf->priv; | 810 | struct mbochs_dmabuf *dmabuf = buf->priv; |
| 810 | struct page *page = dmabuf->pages[page_num]; | 811 | struct page *page = dmabuf->pages[page_num]; |
| 811 | 812 | ||
| 812 | return kmap_atomic(page); | 813 | return kmap(page); |
| 813 | } | 814 | } |
| 814 | 815 | ||
| 815 | static void *mbochs_kmap_dmabuf(struct dma_buf *buf, unsigned long page_num) | 816 | static void mbochs_kunmap_dmabuf(struct dma_buf *buf, unsigned long page_num, |
| 817 | void *vaddr) | ||
| 816 | { | 818 | { |
| 817 | struct mbochs_dmabuf *dmabuf = buf->priv; | 819 | kunmap(vaddr); |
| 818 | struct page *page = dmabuf->pages[page_num]; | ||
| 819 | |||
| 820 | return kmap(page); | ||
| 821 | } | 820 | } |
| 822 | 821 | ||
| 823 | static struct dma_buf_ops mbochs_dmabuf_ops = { | 822 | static struct dma_buf_ops mbochs_dmabuf_ops = { |
| 824 | .map_dma_buf = mbochs_map_dmabuf, | 823 | .map_dma_buf = mbochs_map_dmabuf, |
| 825 | .unmap_dma_buf = mbochs_unmap_dmabuf, | 824 | .unmap_dma_buf = mbochs_unmap_dmabuf, |
| 826 | .release = mbochs_release_dmabuf, | 825 | .release = mbochs_release_dmabuf, |
| 827 | .map_atomic = mbochs_kmap_atomic_dmabuf, | ||
| 828 | .map = mbochs_kmap_dmabuf, | 826 | .map = mbochs_kmap_dmabuf, |
| 827 | .unmap = mbochs_kunmap_dmabuf, | ||
| 829 | .mmap = mbochs_mmap_dmabuf, | 828 | .mmap = mbochs_mmap_dmabuf, |
| 830 | }; | 829 | }; |
| 831 | 830 | ||
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index c8156d61678c..86321f06461e 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
| @@ -214,7 +214,7 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj | |||
| 214 | # Prefix -I with $(srctree) if it is not an absolute path. | 214 | # Prefix -I with $(srctree) if it is not an absolute path. |
| 215 | # skip if -I has no parameter | 215 | # skip if -I has no parameter |
| 216 | addtree = $(if $(patsubst -I%,%,$(1)), \ | 216 | addtree = $(if $(patsubst -I%,%,$(1)), \ |
| 217 | $(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1))) | 217 | $(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)),$(1)) |
| 218 | 218 | ||
| 219 | # Find all -I options and call addtree | 219 | # Find all -I options and call addtree |
| 220 | flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) | 220 | flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) |
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index e7889f486ca1..514ed63ff571 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
| @@ -590,7 +590,4 @@ endif | |||
| 590 | # We never want them to be removed automatically. | 590 | # We never want them to be removed automatically. |
| 591 | .SECONDARY: $(targets) | 591 | .SECONDARY: $(targets) |
| 592 | 592 | ||
| 593 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
| 594 | # information in a variable se we can use it in if_changed and friends. | ||
| 595 | |||
| 596 | .PHONY: $(PHONY) | 593 | .PHONY: $(PHONY) |
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 808d09f27ad4..17ef94c635cd 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean | |||
| @@ -88,7 +88,4 @@ PHONY += $(subdir-ymn) | |||
| 88 | $(subdir-ymn): | 88 | $(subdir-ymn): |
| 89 | $(Q)$(MAKE) $(clean)=$@ | 89 | $(Q)$(MAKE) $(clean)=$@ |
| 90 | 90 | ||
| 91 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
| 92 | # information in a variable se we can use it in if_changed and friends. | ||
| 93 | |||
| 94 | .PHONY: $(PHONY) | 91 | .PHONY: $(PHONY) |
diff --git a/scripts/Makefile.modbuiltin b/scripts/Makefile.modbuiltin index a763b4775d06..40867a41615b 100644 --- a/scripts/Makefile.modbuiltin +++ b/scripts/Makefile.modbuiltin | |||
| @@ -54,8 +54,4 @@ PHONY += $(subdir-ym) | |||
| 54 | $(subdir-ym): | 54 | $(subdir-ym): |
| 55 | $(Q)$(MAKE) $(modbuiltin)=$@ | 55 | $(Q)$(MAKE) $(modbuiltin)=$@ |
| 56 | 56 | ||
| 57 | |||
| 58 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
| 59 | # information in a variable se we can use it in if_changed and friends. | ||
| 60 | |||
| 61 | .PHONY: $(PHONY) | 57 | .PHONY: $(PHONY) |
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 51ca0244fc8a..ff5ca9817a85 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst | |||
| @@ -35,8 +35,4 @@ modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D)) | |||
| 35 | $(modules): | 35 | $(modules): |
| 36 | $(call cmd,modules_install,$(MODLIB)/$(modinst_dir)) | 36 | $(call cmd,modules_install,$(MODLIB)/$(modinst_dir)) |
| 37 | 37 | ||
| 38 | |||
| 39 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
| 40 | # information in a variable so we can use it in if_changed and friends. | ||
| 41 | |||
| 42 | .PHONY: $(PHONY) | 38 | .PHONY: $(PHONY) |
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index df4174405feb..dd92dbbbaa68 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost | |||
| @@ -149,8 +149,4 @@ ifneq ($(cmd_files),) | |||
| 149 | include $(cmd_files) | 149 | include $(cmd_files) |
| 150 | endif | 150 | endif |
| 151 | 151 | ||
| 152 | |||
| 153 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
| 154 | # information in a variable se we can use it in if_changed and friends. | ||
| 155 | |||
| 156 | .PHONY: $(PHONY) | 152 | .PHONY: $(PHONY) |
diff --git a/scripts/Makefile.modsign b/scripts/Makefile.modsign index 171483bc0538..da56aa78d245 100644 --- a/scripts/Makefile.modsign +++ b/scripts/Makefile.modsign | |||
| @@ -27,7 +27,4 @@ modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D)) | |||
| 27 | $(modules): | 27 | $(modules): |
| 28 | $(call cmd,sign_ko,$(MODLIB)/$(modinst_dir)) | 28 | $(call cmd,sign_ko,$(MODLIB)/$(modinst_dir)) |
| 29 | 29 | ||
| 30 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
| 31 | # information in a variable se we can use it in if_changed and friends. | ||
| 32 | |||
| 33 | .PHONY: $(PHONY) | 30 | .PHONY: $(PHONY) |
diff --git a/scripts/cc-can-link.sh b/scripts/cc-can-link.sh index 208eb2825dab..6efcead31989 100755 --- a/scripts/cc-can-link.sh +++ b/scripts/cc-can-link.sh | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: GPL-2.0 | 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 | #include <stdio.h> | 5 | #include <stdio.h> |
| 6 | int main(void) | 6 | int main(void) |
| 7 | { | 7 | { |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e3b7362b0ee4..a9c05506e325 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -2606,12 +2606,6 @@ sub process { | |||
| 2606 | "A patch subject line should describe the change not the tool that found it\n" . $herecurr); | 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 | # Check for unwanted Gerrit info | 2609 | # Check for unwanted Gerrit info |
| 2616 | if ($in_commit_log && $line =~ /^\s*change-id:/i) { | 2610 | if ($in_commit_log && $line =~ /^\s*change-id:/i) { |
| 2617 | ERROR("GERRIT_CHANGE_ID", | 2611 | ERROR("GERRIT_CHANGE_ID", |
diff --git a/scripts/extract-vmlinux b/scripts/extract-vmlinux index 5061abcc2540..e6239f39abad 100755 --- a/scripts/extract-vmlinux +++ b/scripts/extract-vmlinux | |||
| @@ -57,6 +57,8 @@ try_decompress '\3757zXZ\000' abcde unxz | |||
| 57 | try_decompress 'BZh' xy bunzip2 | 57 | try_decompress 'BZh' xy bunzip2 |
| 58 | try_decompress '\135\0\0\0' xxx unlzma | 58 | try_decompress '\135\0\0\0' xxx unlzma |
| 59 | try_decompress '\211\114\132' xy 'lzop -d' | 59 | try_decompress '\211\114\132' xy 'lzop -d' |
| 60 | try_decompress '\002!L\030' xxx 'lz4 -d' | ||
| 61 | try_decompress '(\265/\375' xxx unzstd | ||
| 60 | 62 | ||
| 61 | # Bail out: | 63 | # Bail out: |
| 62 | echo "$me: Cannot find vmlinux." >&2 | 64 | echo "$me: Cannot find vmlinux." >&2 |
diff --git a/scripts/gcc-x86_64-has-stack-protector.sh b/scripts/gcc-x86_64-has-stack-protector.sh index 3755af0cd9f7..75e4e22b986a 100755 --- a/scripts/gcc-x86_64-has-stack-protector.sh +++ b/scripts/gcc-x86_64-has-stack-protector.sh | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: GPL-2.0 | 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" |
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 94a383b21df6..f63b41b0dd49 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
| @@ -171,6 +171,9 @@ struct symbol { | |||
| 171 | * config BAZ | 171 | * config BAZ |
| 172 | * int "BAZ Value" | 172 | * int "BAZ Value" |
| 173 | * range 1..255 | 173 | * range 1..255 |
| 174 | * | ||
| 175 | * Please, also check zconf.y:print_symbol() when modifying the | ||
| 176 | * list of property types! | ||
| 174 | */ | 177 | */ |
| 175 | enum prop_type { | 178 | enum prop_type { |
| 176 | P_UNKNOWN, | 179 | P_UNKNOWN, |
diff --git a/scripts/kconfig/preprocess.c b/scripts/kconfig/preprocess.c index 65da87fce907..5ca2df790d3c 100644 --- a/scripts/kconfig/preprocess.c +++ b/scripts/kconfig/preprocess.c | |||
| @@ -156,7 +156,7 @@ static char *do_shell(int argc, char *argv[]) | |||
| 156 | nread--; | 156 | nread--; |
| 157 | 157 | ||
| 158 | /* remove trailing new lines */ | 158 | /* remove trailing new lines */ |
| 159 | while (buf[nread - 1] == '\n') | 159 | while (nread > 0 && buf[nread - 1] == '\n') |
| 160 | nread--; | 160 | nread--; |
| 161 | 161 | ||
| 162 | buf[nread] = 0; | 162 | buf[nread] = 0; |
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 6f9b0aa32a82..4b68272ebdb9 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y | |||
| @@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE]; | |||
| 31 | static struct menu *current_menu, *current_entry; | 31 | static struct menu *current_menu, *current_entry; |
| 32 | 32 | ||
| 33 | %} | 33 | %} |
| 34 | %expect 32 | 34 | %expect 31 |
| 35 | 35 | ||
| 36 | %union | 36 | %union |
| 37 | { | 37 | { |
| @@ -337,7 +337,7 @@ choice_block: | |||
| 337 | 337 | ||
| 338 | /* if entry */ | 338 | /* if entry */ |
| 339 | 339 | ||
| 340 | if_entry: T_IF expr nl | 340 | if_entry: T_IF expr T_EOL |
| 341 | { | 341 | { |
| 342 | printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); | 342 | printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); |
| 343 | menu_add_entry(NULL); | 343 | menu_add_entry(NULL); |
| @@ -717,6 +717,10 @@ static void print_symbol(FILE *out, struct menu *menu) | |||
| 717 | print_quoted_string(out, prop->text); | 717 | print_quoted_string(out, prop->text); |
| 718 | fputc('\n', out); | 718 | fputc('\n', out); |
| 719 | break; | 719 | break; |
| 720 | case P_SYMBOL: | ||
| 721 | fputs( " symbol ", out); | ||
| 722 | fprintf(out, "%s\n", prop->sym->name); | ||
| 723 | break; | ||
| 720 | default: | 724 | default: |
| 721 | fprintf(out, " unknown prop %d!\n", prop->type); | 725 | fprintf(out, " unknown prop %d!\n", prop->type); |
| 722 | break; | 726 | break; |
diff --git a/scripts/tags.sh b/scripts/tags.sh index 66f08bb1cce9..412a70cce558 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh | |||
| @@ -245,7 +245,7 @@ exuberant() | |||
| 245 | { | 245 | { |
| 246 | setup_regex exuberant asm c | 246 | setup_regex exuberant asm c |
| 247 | all_target_sources | xargs $1 -a \ | 247 | all_target_sources | xargs $1 -a \ |
| 248 | -I __initdata,__exitdata,__initconst, \ | 248 | -I __initdata,__exitdata,__initconst,__ro_after_init \ |
| 249 | -I __initdata_memblock \ | 249 | -I __initdata_memblock \ |
| 250 | -I __refdata,__attribute,__maybe_unused,__always_unused \ | 250 | -I __refdata,__attribute,__maybe_unused,__always_unused \ |
| 251 | -I __acquires,__releases,__deprecated \ | 251 | -I __acquires,__releases,__deprecated \ |
diff --git a/security/keys/dh.c b/security/keys/dh.c index f7403821db7f..b203f7758f97 100644 --- a/security/keys/dh.c +++ b/security/keys/dh.c | |||
| @@ -142,6 +142,8 @@ static void kdf_dealloc(struct kdf_sdesc *sdesc) | |||
| 142 | * The src pointer is defined as Z || other info where Z is the shared secret | 142 | * The src pointer is defined as Z || other info where Z is the shared secret |
| 143 | * from DH and other info is an arbitrary string (see SP800-56A section | 143 | * from DH and other info is an arbitrary string (see SP800-56A section |
| 144 | * 5.8.1.2). | 144 | * 5.8.1.2). |
| 145 | * | ||
| 146 | * 'dlen' must be a multiple of the digest size. | ||
| 145 | */ | 147 | */ |
| 146 | static int kdf_ctr(struct kdf_sdesc *sdesc, const u8 *src, unsigned int slen, | 148 | static int kdf_ctr(struct kdf_sdesc *sdesc, const u8 *src, unsigned int slen, |
| 147 | u8 *dst, unsigned int dlen, unsigned int zlen) | 149 | u8 *dst, unsigned int dlen, unsigned int zlen) |
| @@ -205,8 +207,8 @@ static int keyctl_dh_compute_kdf(struct kdf_sdesc *sdesc, | |||
| 205 | { | 207 | { |
| 206 | uint8_t *outbuf = NULL; | 208 | uint8_t *outbuf = NULL; |
| 207 | int ret; | 209 | int ret; |
| 208 | size_t outbuf_len = round_up(buflen, | 210 | size_t outbuf_len = roundup(buflen, |
| 209 | crypto_shash_digestsize(sdesc->shash.tfm)); | 211 | crypto_shash_digestsize(sdesc->shash.tfm)); |
| 210 | 212 | ||
| 211 | outbuf = kmalloc(outbuf_len, GFP_KERNEL); | 213 | outbuf = kmalloc(outbuf_len, GFP_KERNEL); |
| 212 | if (!outbuf) { | 214 | if (!outbuf) { |
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index f3d374d2ca04..79d3709b0671 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
| @@ -441,22 +441,16 @@ static int sel_release_policy(struct inode *inode, struct file *filp) | |||
| 441 | static ssize_t sel_read_policy(struct file *filp, char __user *buf, | 441 | static ssize_t sel_read_policy(struct file *filp, char __user *buf, |
| 442 | size_t count, loff_t *ppos) | 442 | size_t count, loff_t *ppos) |
| 443 | { | 443 | { |
| 444 | struct selinux_fs_info *fsi = file_inode(filp)->i_sb->s_fs_info; | ||
| 445 | struct policy_load_memory *plm = filp->private_data; | 444 | struct policy_load_memory *plm = filp->private_data; |
| 446 | int ret; | 445 | int ret; |
| 447 | 446 | ||
| 448 | mutex_lock(&fsi->mutex); | ||
| 449 | |||
| 450 | ret = avc_has_perm(&selinux_state, | 447 | ret = avc_has_perm(&selinux_state, |
| 451 | current_sid(), SECINITSID_SECURITY, | 448 | current_sid(), SECINITSID_SECURITY, |
| 452 | SECCLASS_SECURITY, SECURITY__READ_POLICY, NULL); | 449 | SECCLASS_SECURITY, SECURITY__READ_POLICY, NULL); |
| 453 | if (ret) | 450 | if (ret) |
| 454 | goto out; | 451 | return ret; |
| 455 | 452 | ||
| 456 | ret = simple_read_from_buffer(buf, count, ppos, plm->data, plm->len); | 453 | return simple_read_from_buffer(buf, count, ppos, plm->data, plm->len); |
| 457 | out: | ||
| 458 | mutex_unlock(&fsi->mutex); | ||
| 459 | return ret; | ||
| 460 | } | 454 | } |
| 461 | 455 | ||
| 462 | static vm_fault_t sel_mmap_policy_fault(struct vm_fault *vmf) | 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, | |||
| 1188 | ret = -EINVAL; | 1182 | ret = -EINVAL; |
| 1189 | if (index >= fsi->bool_num || strcmp(name, | 1183 | if (index >= fsi->bool_num || strcmp(name, |
| 1190 | fsi->bool_pending_names[index])) | 1184 | fsi->bool_pending_names[index])) |
| 1191 | goto out; | 1185 | goto out_unlock; |
| 1192 | 1186 | ||
| 1193 | ret = -ENOMEM; | 1187 | ret = -ENOMEM; |
| 1194 | page = (char *)get_zeroed_page(GFP_KERNEL); | 1188 | page = (char *)get_zeroed_page(GFP_KERNEL); |
| 1195 | if (!page) | 1189 | if (!page) |
| 1196 | goto out; | 1190 | goto out_unlock; |
| 1197 | 1191 | ||
| 1198 | cur_enforcing = security_get_bool_value(fsi->state, index); | 1192 | cur_enforcing = security_get_bool_value(fsi->state, index); |
| 1199 | if (cur_enforcing < 0) { | 1193 | if (cur_enforcing < 0) { |
| 1200 | ret = cur_enforcing; | 1194 | ret = cur_enforcing; |
| 1201 | goto out; | 1195 | goto out_unlock; |
| 1202 | } | 1196 | } |
| 1203 | length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing, | 1197 | length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing, |
| 1204 | fsi->bool_pending_values[index]); | 1198 | fsi->bool_pending_values[index]); |
| 1205 | ret = simple_read_from_buffer(buf, count, ppos, page, length); | ||
| 1206 | out: | ||
| 1207 | mutex_unlock(&fsi->mutex); | 1199 | mutex_unlock(&fsi->mutex); |
| 1200 | ret = simple_read_from_buffer(buf, count, ppos, page, length); | ||
| 1201 | out_free: | ||
| 1208 | free_page((unsigned long)page); | 1202 | free_page((unsigned long)page); |
| 1209 | return ret; | 1203 | return ret; |
| 1204 | |||
| 1205 | out_unlock: | ||
| 1206 | mutex_unlock(&fsi->mutex); | ||
| 1207 | goto out_free; | ||
| 1210 | } | 1208 | } |
| 1211 | 1209 | ||
| 1212 | static ssize_t sel_write_bool(struct file *filep, const char __user *buf, | 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, | |||
| 1219 | unsigned index = file_inode(filep)->i_ino & SEL_INO_MASK; | 1217 | unsigned index = file_inode(filep)->i_ino & SEL_INO_MASK; |
| 1220 | const char *name = filep->f_path.dentry->d_name.name; | 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 | mutex_lock(&fsi->mutex); | 1231 | mutex_lock(&fsi->mutex); |
| 1223 | 1232 | ||
| 1224 | length = avc_has_perm(&selinux_state, | 1233 | length = avc_has_perm(&selinux_state, |
| @@ -1233,22 +1242,6 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf, | |||
| 1233 | fsi->bool_pending_names[index])) | 1242 | fsi->bool_pending_names[index])) |
| 1234 | goto out; | 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 | length = -EINVAL; | 1245 | length = -EINVAL; |
| 1253 | if (sscanf(page, "%d", &new_value) != 1) | 1246 | if (sscanf(page, "%d", &new_value) != 1) |
| 1254 | goto out; | 1247 | goto out; |
| @@ -1280,6 +1273,17 @@ static ssize_t sel_commit_bools_write(struct file *filep, | |||
| 1280 | ssize_t length; | 1273 | ssize_t length; |
| 1281 | int new_value; | 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 | mutex_lock(&fsi->mutex); | 1287 | mutex_lock(&fsi->mutex); |
| 1284 | 1288 | ||
| 1285 | length = avc_has_perm(&selinux_state, | 1289 | length = avc_has_perm(&selinux_state, |
| @@ -1289,22 +1293,6 @@ static ssize_t sel_commit_bools_write(struct file *filep, | |||
| 1289 | if (length) | 1293 | if (length) |
| 1290 | goto out; | 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 | length = -EINVAL; | 1296 | length = -EINVAL; |
| 1309 | if (sscanf(page, "%d", &new_value) != 1) | 1297 | if (sscanf(page, "%d", &new_value) != 1) |
| 1310 | goto out; | 1298 | goto out; |
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 7ad226018f51..19de675d4504 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
| @@ -2296,6 +2296,7 @@ static void smack_task_to_inode(struct task_struct *p, struct inode *inode) | |||
| 2296 | struct smack_known *skp = smk_of_task_struct(p); | 2296 | struct smack_known *skp = smk_of_task_struct(p); |
| 2297 | 2297 | ||
| 2298 | isp->smk_inode = skp; | 2298 | isp->smk_inode = skp; |
| 2299 | isp->smk_flags |= SMK_INODE_INSTANT; | ||
| 2299 | } | 2300 | } |
| 2300 | 2301 | ||
| 2301 | /* | 2302 | /* |
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index 61a07fe34cd2..56ca78423040 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c | |||
| @@ -2004,7 +2004,8 @@ static int snd_seq_ioctl_query_next_client(struct snd_seq_client *client, | |||
| 2004 | struct snd_seq_client *cptr = NULL; | 2004 | struct snd_seq_client *cptr = NULL; |
| 2005 | 2005 | ||
| 2006 | /* search for next client */ | 2006 | /* search for next client */ |
| 2007 | info->client++; | 2007 | if (info->client < INT_MAX) |
| 2008 | info->client++; | ||
| 2008 | if (info->client < 0) | 2009 | if (info->client < 0) |
| 2009 | info->client = 0; | 2010 | info->client = 0; |
| 2010 | for (; info->client < SNDRV_SEQ_MAX_CLIENTS; info->client++) { | 2011 | for (; info->client < SNDRV_SEQ_MAX_CLIENTS; info->client++) { |
diff --git a/sound/core/timer.c b/sound/core/timer.c index 665089c45560..b6f076bbc72d 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c | |||
| @@ -1520,7 +1520,7 @@ static int snd_timer_user_next_device(struct snd_timer_id __user *_tid) | |||
| 1520 | } else { | 1520 | } else { |
| 1521 | if (id.subdevice < 0) | 1521 | if (id.subdevice < 0) |
| 1522 | id.subdevice = 0; | 1522 | id.subdevice = 0; |
| 1523 | else | 1523 | else if (id.subdevice < INT_MAX) |
| 1524 | id.subdevice++; | 1524 | id.subdevice++; |
| 1525 | } | 1525 | } |
| 1526 | } | 1526 | } |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index d91c87e41756..20a171ac4bb2 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
| @@ -2899,8 +2899,9 @@ static int hda_codec_runtime_suspend(struct device *dev) | |||
| 2899 | list_for_each_entry(pcm, &codec->pcm_list_head, list) | 2899 | list_for_each_entry(pcm, &codec->pcm_list_head, list) |
| 2900 | snd_pcm_suspend_all(pcm->pcm); | 2900 | snd_pcm_suspend_all(pcm->pcm); |
| 2901 | state = hda_call_codec_suspend(codec); | 2901 | state = hda_call_codec_suspend(codec); |
| 2902 | if (codec_has_clkstop(codec) && codec_has_epss(codec) && | 2902 | if (codec->link_down_at_suspend || |
| 2903 | (state & AC_PWRST_CLK_STOP_OK)) | 2903 | (codec_has_clkstop(codec) && codec_has_epss(codec) && |
| 2904 | (state & AC_PWRST_CLK_STOP_OK))) | ||
| 2904 | snd_hdac_codec_link_down(&codec->core); | 2905 | snd_hdac_codec_link_down(&codec->core); |
| 2905 | snd_hdac_link_power(&codec->core, false); | 2906 | snd_hdac_link_power(&codec->core, false); |
| 2906 | return 0; | 2907 | return 0; |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 681c360f29f9..a8b1b31f161c 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
| @@ -258,6 +258,7 @@ struct hda_codec { | |||
| 258 | unsigned int power_save_node:1; /* advanced PM for each widget */ | 258 | unsigned int power_save_node:1; /* advanced PM for each widget */ |
| 259 | unsigned int auto_runtime_pm:1; /* enable automatic codec runtime pm */ | 259 | unsigned int auto_runtime_pm:1; /* enable automatic codec runtime pm */ |
| 260 | unsigned int force_pin_prefix:1; /* Add location prefix */ | 260 | unsigned int force_pin_prefix:1; /* Add location prefix */ |
| 261 | unsigned int link_down_at_suspend:1; /* link down at runtime suspend */ | ||
| 261 | #ifdef CONFIG_PM | 262 | #ifdef CONFIG_PM |
| 262 | unsigned long power_on_acct; | 263 | unsigned long power_on_acct; |
| 263 | unsigned long power_off_acct; | 264 | unsigned long power_off_acct; |
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index 04e949aa01ad..321e95c409c1 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c | |||
| @@ -991,6 +991,7 @@ struct ca0132_spec { | |||
| 991 | enum { | 991 | enum { |
| 992 | QUIRK_NONE, | 992 | QUIRK_NONE, |
| 993 | QUIRK_ALIENWARE, | 993 | QUIRK_ALIENWARE, |
| 994 | QUIRK_ALIENWARE_M17XR4, | ||
| 994 | QUIRK_SBZ, | 995 | QUIRK_SBZ, |
| 995 | QUIRK_R3DI, | 996 | QUIRK_R3DI, |
| 996 | }; | 997 | }; |
| @@ -1040,13 +1041,15 @@ static const struct hda_pintbl r3di_pincfgs[] = { | |||
| 1040 | }; | 1041 | }; |
| 1041 | 1042 | ||
| 1042 | static const struct snd_pci_quirk ca0132_quirks[] = { | 1043 | static const struct snd_pci_quirk ca0132_quirks[] = { |
| 1044 | SND_PCI_QUIRK(0x1028, 0x057b, "Alienware M17x R4", QUIRK_ALIENWARE_M17XR4), | ||
| 1043 | SND_PCI_QUIRK(0x1028, 0x0685, "Alienware 15 2015", QUIRK_ALIENWARE), | 1045 | SND_PCI_QUIRK(0x1028, 0x0685, "Alienware 15 2015", QUIRK_ALIENWARE), |
| 1044 | SND_PCI_QUIRK(0x1028, 0x0688, "Alienware 17 2015", QUIRK_ALIENWARE), | 1046 | SND_PCI_QUIRK(0x1028, 0x0688, "Alienware 17 2015", QUIRK_ALIENWARE), |
| 1045 | SND_PCI_QUIRK(0x1028, 0x0708, "Alienware 15 R2 2016", QUIRK_ALIENWARE), | 1047 | SND_PCI_QUIRK(0x1028, 0x0708, "Alienware 15 R2 2016", QUIRK_ALIENWARE), |
| 1046 | SND_PCI_QUIRK(0x1102, 0x0010, "Sound Blaster Z", QUIRK_SBZ), | 1048 | SND_PCI_QUIRK(0x1102, 0x0010, "Sound Blaster Z", QUIRK_SBZ), |
| 1047 | SND_PCI_QUIRK(0x1102, 0x0023, "Sound Blaster Z", QUIRK_SBZ), | 1049 | SND_PCI_QUIRK(0x1102, 0x0023, "Sound Blaster Z", QUIRK_SBZ), |
| 1048 | SND_PCI_QUIRK(0x1458, 0xA016, "Recon3Di", QUIRK_R3DI), | 1050 | SND_PCI_QUIRK(0x1458, 0xA016, "Recon3Di", QUIRK_R3DI), |
| 1049 | SND_PCI_QUIRK(0x1458, 0xA036, "Recon3Di", QUIRK_R3DI), | 1051 | SND_PCI_QUIRK(0x1458, 0xA026, "Gigabyte G1.Sniper Z97", QUIRK_R3DI), |
| 1052 | SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI), | ||
| 1050 | {} | 1053 | {} |
| 1051 | }; | 1054 | }; |
| 1052 | 1055 | ||
| @@ -5663,7 +5666,7 @@ static const char * const ca0132_alt_slave_pfxs[] = { | |||
| 5663 | * I think this has to do with the pin for rear surround being 0x11, | 5666 | * I think this has to do with the pin for rear surround being 0x11, |
| 5664 | * and the center/lfe being 0x10. Usually the pin order is the opposite. | 5667 | * and the center/lfe being 0x10. Usually the pin order is the opposite. |
| 5665 | */ | 5668 | */ |
| 5666 | const struct snd_pcm_chmap_elem ca0132_alt_chmaps[] = { | 5669 | static const struct snd_pcm_chmap_elem ca0132_alt_chmaps[] = { |
| 5667 | { .channels = 2, | 5670 | { .channels = 2, |
| 5668 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, | 5671 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, |
| 5669 | { .channels = 4, | 5672 | { .channels = 4, |
| @@ -5966,7 +5969,7 @@ static int ca0132_build_pcms(struct hda_codec *codec) | |||
| 5966 | info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[0]; | 5969 | info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[0]; |
| 5967 | 5970 | ||
| 5968 | /* With the DSP enabled, desktops don't use this ADC. */ | 5971 | /* With the DSP enabled, desktops don't use this ADC. */ |
| 5969 | if (spec->use_alt_functions) { | 5972 | if (!spec->use_alt_functions) { |
| 5970 | info = snd_hda_codec_pcm_new(codec, "CA0132 Analog Mic-In2"); | 5973 | info = snd_hda_codec_pcm_new(codec, "CA0132 Analog Mic-In2"); |
| 5971 | if (!info) | 5974 | if (!info) |
| 5972 | return -ENOMEM; | 5975 | return -ENOMEM; |
| @@ -6130,7 +6133,10 @@ static void ca0132_init_dmic(struct hda_codec *codec) | |||
| 6130 | * Bit 6: set to select Data2, clear for Data1 | 6133 | * Bit 6: set to select Data2, clear for Data1 |
| 6131 | * Bit 7: set to enable DMic, clear for AMic | 6134 | * Bit 7: set to enable DMic, clear for AMic |
| 6132 | */ | 6135 | */ |
| 6133 | val = 0x23; | 6136 | if (spec->quirk == QUIRK_ALIENWARE_M17XR4) |
| 6137 | val = 0x33; | ||
| 6138 | else | ||
| 6139 | val = 0x23; | ||
| 6134 | /* keep a copy of dmic ctl val for enable/disable dmic purpuse */ | 6140 | /* keep a copy of dmic ctl val for enable/disable dmic purpuse */ |
| 6135 | spec->dmic_ctl = val; | 6141 | spec->dmic_ctl = val; |
| 6136 | snd_hda_codec_write(codec, spec->input_pins[0], 0, | 6142 | snd_hda_codec_write(codec, spec->input_pins[0], 0, |
| @@ -7223,7 +7229,7 @@ static int ca0132_init(struct hda_codec *codec) | |||
| 7223 | 7229 | ||
| 7224 | snd_hda_sequence_write(codec, spec->base_init_verbs); | 7230 | snd_hda_sequence_write(codec, spec->base_init_verbs); |
| 7225 | 7231 | ||
| 7226 | if (spec->quirk != QUIRK_NONE) | 7232 | if (spec->use_alt_functions) |
| 7227 | ca0132_alt_init(codec); | 7233 | ca0132_alt_init(codec); |
| 7228 | 7234 | ||
| 7229 | ca0132_download_dsp(codec); | 7235 | ca0132_download_dsp(codec); |
| @@ -7237,8 +7243,9 @@ static int ca0132_init(struct hda_codec *codec) | |||
| 7237 | case QUIRK_R3DI: | 7243 | case QUIRK_R3DI: |
| 7238 | r3di_setup_defaults(codec); | 7244 | r3di_setup_defaults(codec); |
| 7239 | break; | 7245 | break; |
| 7240 | case QUIRK_NONE: | 7246 | case QUIRK_SBZ: |
| 7241 | case QUIRK_ALIENWARE: | 7247 | break; |
| 7248 | default: | ||
| 7242 | ca0132_setup_defaults(codec); | 7249 | ca0132_setup_defaults(codec); |
| 7243 | ca0132_init_analog_mic2(codec); | 7250 | ca0132_init_analog_mic2(codec); |
| 7244 | ca0132_init_dmic(codec); | 7251 | ca0132_init_dmic(codec); |
| @@ -7343,7 +7350,6 @@ static const struct hda_codec_ops ca0132_patch_ops = { | |||
| 7343 | static void ca0132_config(struct hda_codec *codec) | 7350 | static void ca0132_config(struct hda_codec *codec) |
| 7344 | { | 7351 | { |
| 7345 | struct ca0132_spec *spec = codec->spec; | 7352 | struct ca0132_spec *spec = codec->spec; |
| 7346 | struct auto_pin_cfg *cfg = &spec->autocfg; | ||
| 7347 | 7353 | ||
| 7348 | spec->dacs[0] = 0x2; | 7354 | spec->dacs[0] = 0x2; |
| 7349 | spec->dacs[1] = 0x3; | 7355 | spec->dacs[1] = 0x3; |
| @@ -7405,12 +7411,7 @@ static void ca0132_config(struct hda_codec *codec) | |||
| 7405 | /* SPDIF I/O */ | 7411 | /* SPDIF I/O */ |
| 7406 | spec->dig_out = 0x05; | 7412 | spec->dig_out = 0x05; |
| 7407 | spec->multiout.dig_out_nid = spec->dig_out; | 7413 | 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 | spec->dig_in = 0x09; | 7414 | spec->dig_in = 0x09; |
| 7412 | cfg->dig_in_pin = 0x0e; | ||
| 7413 | cfg->dig_in_type = HDA_PCM_TYPE_SPDIF; | ||
| 7414 | break; | 7415 | break; |
| 7415 | case QUIRK_R3DI: | 7416 | case QUIRK_R3DI: |
| 7416 | codec_dbg(codec, "%s: QUIRK_R3DI applied.\n", __func__); | 7417 | codec_dbg(codec, "%s: QUIRK_R3DI applied.\n", __func__); |
| @@ -7438,9 +7439,6 @@ static void ca0132_config(struct hda_codec *codec) | |||
| 7438 | /* SPDIF I/O */ | 7439 | /* SPDIF I/O */ |
| 7439 | spec->dig_out = 0x05; | 7440 | spec->dig_out = 0x05; |
| 7440 | spec->multiout.dig_out_nid = spec->dig_out; | 7441 | 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 | break; | 7442 | break; |
| 7445 | default: | 7443 | default: |
| 7446 | spec->num_outputs = 2; | 7444 | spec->num_outputs = 2; |
| @@ -7463,12 +7461,7 @@ static void ca0132_config(struct hda_codec *codec) | |||
| 7463 | /* SPDIF I/O */ | 7461 | /* SPDIF I/O */ |
| 7464 | spec->dig_out = 0x05; | 7462 | spec->dig_out = 0x05; |
| 7465 | spec->multiout.dig_out_nid = spec->dig_out; | 7463 | 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 | spec->dig_in = 0x09; | 7464 | spec->dig_in = 0x09; |
| 7470 | cfg->dig_in_pin = 0x0e; | ||
| 7471 | cfg->dig_in_type = HDA_PCM_TYPE_SPDIF; | ||
| 7472 | break; | 7465 | break; |
| 7473 | } | 7466 | } |
| 7474 | } | 7467 | } |
| @@ -7476,7 +7469,7 @@ static void ca0132_config(struct hda_codec *codec) | |||
| 7476 | static int ca0132_prepare_verbs(struct hda_codec *codec) | 7469 | static int ca0132_prepare_verbs(struct hda_codec *codec) |
| 7477 | { | 7470 | { |
| 7478 | /* Verbs + terminator (an empty element) */ | 7471 | /* Verbs + terminator (an empty element) */ |
| 7479 | #define NUM_SPEC_VERBS 4 | 7472 | #define NUM_SPEC_VERBS 2 |
| 7480 | struct ca0132_spec *spec = codec->spec; | 7473 | struct ca0132_spec *spec = codec->spec; |
| 7481 | 7474 | ||
| 7482 | spec->chip_init_verbs = ca0132_init_verbs0; | 7475 | spec->chip_init_verbs = ca0132_init_verbs0; |
| @@ -7488,34 +7481,24 @@ static int ca0132_prepare_verbs(struct hda_codec *codec) | |||
| 7488 | if (!spec->spec_init_verbs) | 7481 | if (!spec->spec_init_verbs) |
| 7489 | return -ENOMEM; | 7482 | return -ENOMEM; |
| 7490 | 7483 | ||
| 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 | /* config EAPD */ | 7484 | /* config EAPD */ |
| 7502 | spec->spec_init_verbs[2].nid = 0x0b; | 7485 | spec->spec_init_verbs[0].nid = 0x0b; |
| 7503 | spec->spec_init_verbs[2].param = 0x78D; | 7486 | spec->spec_init_verbs[0].param = 0x78D; |
| 7504 | spec->spec_init_verbs[2].verb = 0x00; | 7487 | spec->spec_init_verbs[0].verb = 0x00; |
| 7505 | 7488 | ||
| 7506 | /* Previously commented configuration */ | 7489 | /* Previously commented configuration */ |
| 7507 | /* | 7490 | /* |
| 7508 | spec->spec_init_verbs[3].nid = 0x0b; | 7491 | spec->spec_init_verbs[2].nid = 0x0b; |
| 7509 | spec->spec_init_verbs[3].param = AC_VERB_SET_EAPD_BTLENABLE; | 7492 | spec->spec_init_verbs[2].param = AC_VERB_SET_EAPD_BTLENABLE; |
| 7493 | spec->spec_init_verbs[2].verb = 0x02; | ||
| 7494 | |||
| 7495 | spec->spec_init_verbs[3].nid = 0x10; | ||
| 7496 | spec->spec_init_verbs[3].param = 0x78D; | ||
| 7510 | spec->spec_init_verbs[3].verb = 0x02; | 7497 | spec->spec_init_verbs[3].verb = 0x02; |
| 7511 | 7498 | ||
| 7512 | spec->spec_init_verbs[4].nid = 0x10; | 7499 | spec->spec_init_verbs[4].nid = 0x10; |
| 7513 | spec->spec_init_verbs[4].param = 0x78D; | 7500 | spec->spec_init_verbs[4].param = AC_VERB_SET_EAPD_BTLENABLE; |
| 7514 | spec->spec_init_verbs[4].verb = 0x02; | 7501 | 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 | */ | 7502 | */ |
| 7520 | 7503 | ||
| 7521 | /* Terminator: spec->spec_init_verbs[NUM_SPEC_VERBS-1] */ | 7504 | /* Terminator: spec->spec_init_verbs[NUM_SPEC_VERBS-1] */ |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 8840daf9c6a3..8a49415aebac 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/delay.h> | 33 | #include <linux/delay.h> |
| 34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
| 35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
| 36 | #include <linux/pm_runtime.h> | ||
| 36 | #include <sound/core.h> | 37 | #include <sound/core.h> |
| 37 | #include <sound/jack.h> | 38 | #include <sound/jack.h> |
| 38 | #include <sound/asoundef.h> | 39 | #include <sound/asoundef.h> |
| @@ -764,8 +765,10 @@ static void check_presence_and_report(struct hda_codec *codec, hda_nid_t nid, | |||
| 764 | 765 | ||
| 765 | if (pin_idx < 0) | 766 | if (pin_idx < 0) |
| 766 | return; | 767 | return; |
| 768 | mutex_lock(&spec->pcm_lock); | ||
| 767 | if (hdmi_present_sense(get_pin(spec, pin_idx), 1)) | 769 | if (hdmi_present_sense(get_pin(spec, pin_idx), 1)) |
| 768 | snd_hda_jack_report_sync(codec); | 770 | snd_hda_jack_report_sync(codec); |
| 771 | mutex_unlock(&spec->pcm_lock); | ||
| 769 | } | 772 | } |
| 770 | 773 | ||
| 771 | static void jack_callback(struct hda_codec *codec, | 774 | static void jack_callback(struct hda_codec *codec, |
| @@ -1628,21 +1631,23 @@ static void sync_eld_via_acomp(struct hda_codec *codec, | |||
| 1628 | static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll) | 1631 | static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll) |
| 1629 | { | 1632 | { |
| 1630 | struct hda_codec *codec = per_pin->codec; | 1633 | struct hda_codec *codec = per_pin->codec; |
| 1631 | struct hdmi_spec *spec = codec->spec; | ||
| 1632 | int ret; | 1634 | int ret; |
| 1633 | 1635 | ||
| 1634 | /* no temporary power up/down needed for component notifier */ | 1636 | /* no temporary power up/down needed for component notifier */ |
| 1635 | if (!codec_has_acomp(codec)) | 1637 | if (!codec_has_acomp(codec)) { |
| 1636 | snd_hda_power_up_pm(codec); | 1638 | ret = snd_hda_power_up_pm(codec); |
| 1639 | if (ret < 0 && pm_runtime_suspended(hda_codec_dev(codec))) { | ||
| 1640 | snd_hda_power_down_pm(codec); | ||
| 1641 | return false; | ||
| 1642 | } | ||
| 1643 | } | ||
| 1637 | 1644 | ||
| 1638 | mutex_lock(&spec->pcm_lock); | ||
| 1639 | if (codec_has_acomp(codec)) { | 1645 | if (codec_has_acomp(codec)) { |
| 1640 | sync_eld_via_acomp(codec, per_pin); | 1646 | sync_eld_via_acomp(codec, per_pin); |
| 1641 | ret = false; /* don't call snd_hda_jack_report_sync() */ | 1647 | ret = false; /* don't call snd_hda_jack_report_sync() */ |
| 1642 | } else { | 1648 | } else { |
| 1643 | ret = hdmi_present_sense_via_verbs(per_pin, repoll); | 1649 | ret = hdmi_present_sense_via_verbs(per_pin, repoll); |
| 1644 | } | 1650 | } |
| 1645 | mutex_unlock(&spec->pcm_lock); | ||
| 1646 | 1651 | ||
| 1647 | if (!codec_has_acomp(codec)) | 1652 | if (!codec_has_acomp(codec)) |
| 1648 | snd_hda_power_down_pm(codec); | 1653 | snd_hda_power_down_pm(codec); |
| @@ -1654,12 +1659,16 @@ static void hdmi_repoll_eld(struct work_struct *work) | |||
| 1654 | { | 1659 | { |
| 1655 | struct hdmi_spec_per_pin *per_pin = | 1660 | struct hdmi_spec_per_pin *per_pin = |
| 1656 | container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work); | 1661 | container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work); |
| 1662 | struct hda_codec *codec = per_pin->codec; | ||
| 1663 | struct hdmi_spec *spec = codec->spec; | ||
| 1657 | 1664 | ||
| 1658 | if (per_pin->repoll_count++ > 6) | 1665 | if (per_pin->repoll_count++ > 6) |
| 1659 | per_pin->repoll_count = 0; | 1666 | per_pin->repoll_count = 0; |
| 1660 | 1667 | ||
| 1668 | mutex_lock(&spec->pcm_lock); | ||
| 1661 | if (hdmi_present_sense(per_pin, per_pin->repoll_count)) | 1669 | if (hdmi_present_sense(per_pin, per_pin->repoll_count)) |
| 1662 | snd_hda_jack_report_sync(per_pin->codec); | 1670 | snd_hda_jack_report_sync(per_pin->codec); |
| 1671 | mutex_unlock(&spec->pcm_lock); | ||
| 1663 | } | 1672 | } |
| 1664 | 1673 | ||
| 1665 | static void intel_haswell_fixup_connect_list(struct hda_codec *codec, | 1674 | static void intel_haswell_fixup_connect_list(struct hda_codec *codec, |
| @@ -3741,6 +3750,11 @@ static int patch_atihdmi(struct hda_codec *codec) | |||
| 3741 | 3750 | ||
| 3742 | spec->chmap.channels_max = max(spec->chmap.channels_max, 8u); | 3751 | spec->chmap.channels_max = max(spec->chmap.channels_max, 8u); |
| 3743 | 3752 | ||
| 3753 | /* AMD GPUs have neither EPSS nor CLKSTOP bits, hence preventing | ||
| 3754 | * the link-down as is. Tell the core to allow it. | ||
| 3755 | */ | ||
| 3756 | codec->link_down_at_suspend = 1; | ||
| 3757 | |||
| 3744 | return 0; | 3758 | return 0; |
| 3745 | } | 3759 | } |
| 3746 | 3760 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index e9bd33ea538f..7496be4491b1 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -2545,6 +2545,7 @@ static const struct snd_pci_quirk alc262_fixup_tbl[] = { | |||
| 2545 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), | 2545 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
| 2546 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), | 2546 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
| 2547 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), | 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 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), | 2549 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
| 2549 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), | 2550 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
| 2550 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), | 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, | |||
| 4995 | struct alc_spec *spec = codec->spec; | 4996 | struct alc_spec *spec = codec->spec; |
| 4996 | 4997 | ||
| 4997 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | 4998 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
| 4998 | spec->shutup = alc_no_shutup; /* reduce click noise */ | ||
| 4999 | spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */ | 4999 | spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */ |
| 5000 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; | 5000 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
| 5001 | codec->power_save_node = 0; /* avoid click noises */ | 5001 | codec->power_save_node = 0; /* avoid click noises */ |
| @@ -5394,6 +5394,13 @@ static void alc274_fixup_bind_dacs(struct hda_codec *codec, | |||
| 5394 | /* for hda_fixup_thinkpad_acpi() */ | 5394 | /* for hda_fixup_thinkpad_acpi() */ |
| 5395 | #include "thinkpad_helper.c" | 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 | /* for dell wmi mic mute led */ | 5404 | /* for dell wmi mic mute led */ |
| 5398 | #include "dell_wmi_helper.c" | 5405 | #include "dell_wmi_helper.c" |
| 5399 | 5406 | ||
| @@ -5946,7 +5953,7 @@ static const struct hda_fixup alc269_fixups[] = { | |||
| 5946 | }, | 5953 | }, |
| 5947 | [ALC269_FIXUP_THINKPAD_ACPI] = { | 5954 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
| 5948 | .type = HDA_FIXUP_FUNC, | 5955 | .type = HDA_FIXUP_FUNC, |
| 5949 | .v.func = hda_fixup_thinkpad_acpi, | 5956 | .v.func = alc_fixup_thinkpad_acpi, |
| 5950 | .chained = true, | 5957 | .chained = true, |
| 5951 | .chain_id = ALC269_FIXUP_SKU_IGNORE, | 5958 | .chain_id = ALC269_FIXUP_SKU_IGNORE, |
| 5952 | }, | 5959 | }, |
| @@ -6603,8 +6610,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
| 6603 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), | 6610 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
| 6604 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), | 6611 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
| 6605 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), | 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 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), | 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), | ||
| 6608 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), | 6615 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
| 6609 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), | 6616 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
| 6610 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), | 6617 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
| @@ -6782,6 +6789,17 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { | |||
| 6782 | {0x14, 0x90170110}, | 6789 | {0x14, 0x90170110}, |
| 6783 | {0x19, 0x02a11030}, | 6790 | {0x19, 0x02a11030}, |
| 6784 | {0x21, 0x02211020}), | 6791 | {0x21, 0x02211020}), |
| 6792 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, | ||
| 6793 | {0x14, 0x90170110}, | ||
| 6794 | {0x19, 0x02a11030}, | ||
| 6795 | {0x1a, 0x02a11040}, | ||
| 6796 | {0x1b, 0x01014020}, | ||
| 6797 | {0x21, 0x0221101f}), | ||
| 6798 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, | ||
| 6799 | {0x14, 0x90170110}, | ||
| 6800 | {0x19, 0x02a11020}, | ||
| 6801 | {0x1a, 0x02a11030}, | ||
| 6802 | {0x21, 0x0221101f}), | ||
| 6785 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | 6803 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 6786 | {0x12, 0x90a60140}, | 6804 | {0x12, 0x90a60140}, |
| 6787 | {0x14, 0x90170110}, | 6805 | {0x14, 0x90170110}, |
diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c index 6c85f13ab23f..54f6252faca6 100644 --- a/sound/pci/lx6464es/lx6464es.c +++ b/sound/pci/lx6464es/lx6464es.c | |||
| @@ -1018,6 +1018,7 @@ static int snd_lx6464es_create(struct snd_card *card, | |||
| 1018 | chip->port_dsp_bar = pci_ioremap_bar(pci, 2); | 1018 | chip->port_dsp_bar = pci_ioremap_bar(pci, 2); |
| 1019 | if (!chip->port_dsp_bar) { | 1019 | if (!chip->port_dsp_bar) { |
| 1020 | dev_err(card->dev, "cannot remap PCI memory region\n"); | 1020 | dev_err(card->dev, "cannot remap PCI memory region\n"); |
| 1021 | err = -ENOMEM; | ||
| 1021 | goto remap_pci_failed; | 1022 | goto remap_pci_failed; |
| 1022 | } | 1023 | } |
| 1023 | 1024 | ||
diff --git a/tools/arch/arm/include/uapi/asm/kvm.h b/tools/arch/arm/include/uapi/asm/kvm.h index caae4843cb70..16e006f708ca 100644 --- a/tools/arch/arm/include/uapi/asm/kvm.h +++ b/tools/arch/arm/include/uapi/asm/kvm.h | |||
| @@ -91,6 +91,7 @@ struct kvm_regs { | |||
| 91 | #define KVM_VGIC_V3_ADDR_TYPE_DIST 2 | 91 | #define KVM_VGIC_V3_ADDR_TYPE_DIST 2 |
| 92 | #define KVM_VGIC_V3_ADDR_TYPE_REDIST 3 | 92 | #define KVM_VGIC_V3_ADDR_TYPE_REDIST 3 |
| 93 | #define KVM_VGIC_ITS_ADDR_TYPE 4 | 93 | #define KVM_VGIC_ITS_ADDR_TYPE 4 |
| 94 | #define KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION 5 | ||
| 94 | 95 | ||
| 95 | #define KVM_VGIC_V3_DIST_SIZE SZ_64K | 96 | #define KVM_VGIC_V3_DIST_SIZE SZ_64K |
| 96 | #define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K) | 97 | #define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K) |
diff --git a/tools/arch/arm64/include/uapi/asm/kvm.h b/tools/arch/arm64/include/uapi/asm/kvm.h index 04b3256f8e6d..4e76630dd655 100644 --- a/tools/arch/arm64/include/uapi/asm/kvm.h +++ b/tools/arch/arm64/include/uapi/asm/kvm.h | |||
| @@ -91,6 +91,7 @@ struct kvm_regs { | |||
| 91 | #define KVM_VGIC_V3_ADDR_TYPE_DIST 2 | 91 | #define KVM_VGIC_V3_ADDR_TYPE_DIST 2 |
| 92 | #define KVM_VGIC_V3_ADDR_TYPE_REDIST 3 | 92 | #define KVM_VGIC_V3_ADDR_TYPE_REDIST 3 |
| 93 | #define KVM_VGIC_ITS_ADDR_TYPE 4 | 93 | #define KVM_VGIC_ITS_ADDR_TYPE 4 |
| 94 | #define KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION 5 | ||
| 94 | 95 | ||
| 95 | #define KVM_VGIC_V3_DIST_SIZE SZ_64K | 96 | #define KVM_VGIC_V3_DIST_SIZE SZ_64K |
| 96 | #define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K) | 97 | #define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K) |
diff --git a/tools/arch/powerpc/include/uapi/asm/kvm.h b/tools/arch/powerpc/include/uapi/asm/kvm.h index 833ed9a16adf..1b32b56a03d3 100644 --- a/tools/arch/powerpc/include/uapi/asm/kvm.h +++ b/tools/arch/powerpc/include/uapi/asm/kvm.h | |||
| @@ -633,6 +633,7 @@ struct kvm_ppc_cpu_char { | |||
| 633 | #define KVM_REG_PPC_PSSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbd) | 633 | #define KVM_REG_PPC_PSSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbd) |
| 634 | 634 | ||
| 635 | #define KVM_REG_PPC_DEC_EXPIRY (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbe) | 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 | /* Transactional Memory checkpointed state: | 638 | /* Transactional Memory checkpointed state: |
| 638 | * This is all GPRs, all VSX regs and a subset of SPRs | 639 | * This is all GPRs, all VSX regs and a subset of SPRs |
diff --git a/tools/arch/powerpc/include/uapi/asm/unistd.h b/tools/arch/powerpc/include/uapi/asm/unistd.h index 389c36fd8299..ac5ba55066dd 100644 --- a/tools/arch/powerpc/include/uapi/asm/unistd.h +++ b/tools/arch/powerpc/include/uapi/asm/unistd.h | |||
| @@ -398,5 +398,6 @@ | |||
| 398 | #define __NR_pkey_alloc 384 | 398 | #define __NR_pkey_alloc 384 |
| 399 | #define __NR_pkey_free 385 | 399 | #define __NR_pkey_free 385 |
| 400 | #define __NR_pkey_mprotect 386 | 400 | #define __NR_pkey_mprotect 386 |
| 401 | #define __NR_rseq 387 | ||
| 401 | 402 | ||
| 402 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ | 403 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h index fb00a2fca990..5701f5cecd31 100644 --- a/tools/arch/x86/include/asm/cpufeatures.h +++ b/tools/arch/x86/include/asm/cpufeatures.h | |||
| @@ -282,7 +282,9 @@ | |||
| 282 | #define X86_FEATURE_AMD_IBPB (13*32+12) /* "" Indirect Branch Prediction Barrier */ | 282 | #define X86_FEATURE_AMD_IBPB (13*32+12) /* "" Indirect Branch Prediction Barrier */ |
| 283 | #define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */ | 283 | #define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */ |
| 284 | #define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */ | 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 | #define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */ | 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 | /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */ | 289 | /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */ |
| 288 | #define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */ | 290 | #define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */ |
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index 05f42a46d6ed..959aa53ab678 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c | |||
| @@ -694,15 +694,19 @@ static int do_load(int argc, char **argv) | |||
| 694 | return -1; | 694 | return -1; |
| 695 | } | 695 | } |
| 696 | 696 | ||
| 697 | if (do_pin_fd(prog_fd, argv[1])) { | 697 | if (do_pin_fd(prog_fd, argv[1])) |
| 698 | p_err("failed to pin program"); | 698 | goto err_close_obj; |
| 699 | return -1; | ||
| 700 | } | ||
| 701 | 699 | ||
| 702 | if (json_output) | 700 | if (json_output) |
| 703 | jsonw_null(json_wtr); | 701 | jsonw_null(json_wtr); |
| 704 | 702 | ||
| 703 | bpf_object__close(obj); | ||
| 704 | |||
| 705 | return 0; | 705 | return 0; |
| 706 | |||
| 707 | err_close_obj: | ||
| 708 | bpf_object__close(obj); | ||
| 709 | return -1; | ||
| 706 | } | 710 | } |
| 707 | 711 | ||
| 708 | static int do_help(int argc, char **argv) | 712 | static int do_help(int argc, char **argv) |
diff --git a/tools/build/Build.include b/tools/build/Build.include index a4bbb984941d..950c1504ca37 100644 --- a/tools/build/Build.include +++ b/tools/build/Build.include | |||
| @@ -63,8 +63,8 @@ dep-cmd = $(if $(wildcard $(fixdep)), | |||
| 63 | $(fixdep) $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp; \ | 63 | $(fixdep) $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp; \ |
| 64 | rm -f $(depfile); \ | 64 | rm -f $(depfile); \ |
| 65 | mv -f $(dot-target).tmp $(dot-target).cmd, \ | 65 | mv -f $(dot-target).tmp $(dot-target).cmd, \ |
| 66 | printf '\# cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \ | 66 | printf '$(pound) cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \ |
| 67 | printf '\# using basic dep data\n\n' >> $(dot-target).cmd; \ | 67 | printf '$(pound) using basic dep data\n\n' >> $(dot-target).cmd; \ |
| 68 | cat $(depfile) >> $(dot-target).cmd; \ | 68 | cat $(depfile) >> $(dot-target).cmd; \ |
| 69 | printf '\n%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd) | 69 | printf '\n%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd) |
| 70 | 70 | ||
| @@ -98,4 +98,4 @@ cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXX | |||
| 98 | ### | 98 | ### |
| 99 | ## HOSTCC C flags | 99 | ## HOSTCC C flags |
| 100 | 100 | ||
| 101 | host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) | 101 | host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(HOSTCFLAGS) -D"BUILD_STR(s)=\#s" $(HOSTCFLAGS_$(basetarget).o) $(HOSTCFLAGS_$(obj)) |
diff --git a/tools/build/Makefile b/tools/build/Makefile index 5eb4b5ad79cb..5edf65e684ab 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile | |||
| @@ -43,7 +43,7 @@ $(OUTPUT)fixdep-in.o: FORCE | |||
| 43 | $(Q)$(MAKE) $(build)=fixdep | 43 | $(Q)$(MAKE) $(build)=fixdep |
| 44 | 44 | ||
| 45 | $(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o | 45 | $(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o |
| 46 | $(QUIET_LINK)$(HOSTCC) $(LDFLAGS) -o $@ $< | 46 | $(QUIET_LINK)$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< |
| 47 | 47 | ||
| 48 | FORCE: | 48 | FORCE: |
| 49 | 49 | ||
diff --git a/tools/include/uapi/drm/drm.h b/tools/include/uapi/drm/drm.h index 6fdff5945c8a..9c660e1688ab 100644 --- a/tools/include/uapi/drm/drm.h +++ b/tools/include/uapi/drm/drm.h | |||
| @@ -680,6 +680,13 @@ struct drm_get_cap { | |||
| 680 | */ | 680 | */ |
| 681 | #define DRM_CLIENT_CAP_ATOMIC 3 | 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 | /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ | 690 | /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ |
| 684 | struct drm_set_client_cap { | 691 | struct drm_set_client_cap { |
| 685 | __u64 capability; | 692 | __u64 capability; |
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index e0b06784f227..59b19b6a40d7 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h | |||
| @@ -2630,7 +2630,7 @@ struct bpf_fib_lookup { | |||
| 2630 | union { | 2630 | union { |
| 2631 | /* inputs to lookup */ | 2631 | /* inputs to lookup */ |
| 2632 | __u8 tos; /* AF_INET */ | 2632 | __u8 tos; /* AF_INET */ |
| 2633 | __be32 flowlabel; /* AF_INET6 */ | 2633 | __be32 flowinfo; /* AF_INET6, flow_label + priority */ |
| 2634 | 2634 | ||
| 2635 | /* output: metric of fib result (IPv4/IPv6 only) */ | 2635 | /* output: metric of fib result (IPv4/IPv6 only) */ |
| 2636 | __u32 rt_metric; | 2636 | __u32 rt_metric; |
diff --git a/tools/include/uapi/linux/if_link.h b/tools/include/uapi/linux/if_link.h index 68699f654118..cf01b6824244 100644 --- a/tools/include/uapi/linux/if_link.h +++ b/tools/include/uapi/linux/if_link.h | |||
| @@ -333,6 +333,7 @@ enum { | |||
| 333 | IFLA_BRPORT_BCAST_FLOOD, | 333 | IFLA_BRPORT_BCAST_FLOOD, |
| 334 | IFLA_BRPORT_GROUP_FWD_MASK, | 334 | IFLA_BRPORT_GROUP_FWD_MASK, |
| 335 | IFLA_BRPORT_NEIGH_SUPPRESS, | 335 | IFLA_BRPORT_NEIGH_SUPPRESS, |
| 336 | IFLA_BRPORT_ISOLATED, | ||
| 336 | __IFLA_BRPORT_MAX | 337 | __IFLA_BRPORT_MAX |
| 337 | }; | 338 | }; |
| 338 | #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) | 339 | #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) |
| @@ -516,6 +517,7 @@ enum { | |||
| 516 | IFLA_VXLAN_COLLECT_METADATA, | 517 | IFLA_VXLAN_COLLECT_METADATA, |
| 517 | IFLA_VXLAN_LABEL, | 518 | IFLA_VXLAN_LABEL, |
| 518 | IFLA_VXLAN_GPE, | 519 | IFLA_VXLAN_GPE, |
| 520 | IFLA_VXLAN_TTL_INHERIT, | ||
| 519 | __IFLA_VXLAN_MAX | 521 | __IFLA_VXLAN_MAX |
| 520 | }; | 522 | }; |
| 521 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) | 523 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) |
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h index 39e364c70caf..b6270a3b38e9 100644 --- a/tools/include/uapi/linux/kvm.h +++ b/tools/include/uapi/linux/kvm.h | |||
| @@ -948,6 +948,7 @@ struct kvm_ppc_resize_hpt { | |||
| 948 | #define KVM_CAP_S390_BPB 152 | 948 | #define KVM_CAP_S390_BPB 152 |
| 949 | #define KVM_CAP_GET_MSR_FEATURES 153 | 949 | #define KVM_CAP_GET_MSR_FEATURES 153 |
| 950 | #define KVM_CAP_HYPERV_EVENTFD 154 | 950 | #define KVM_CAP_HYPERV_EVENTFD 154 |
| 951 | #define KVM_CAP_HYPERV_TLBFLUSH 155 | ||
| 951 | 952 | ||
| 952 | #ifdef KVM_CAP_IRQ_ROUTING | 953 | #ifdef KVM_CAP_IRQ_ROUTING |
| 953 | 954 | ||
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index 4e60e105583e..0d1acb704f64 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c | |||
| @@ -302,19 +302,34 @@ static int read_symbols(struct elf *elf) | |||
| 302 | continue; | 302 | continue; |
| 303 | sym->pfunc = sym->cfunc = sym; | 303 | sym->pfunc = sym->cfunc = sym; |
| 304 | coldstr = strstr(sym->name, ".cold."); | 304 | coldstr = strstr(sym->name, ".cold."); |
| 305 | if (coldstr) { | 305 | if (!coldstr) |
| 306 | coldstr[0] = '\0'; | 306 | continue; |
| 307 | pfunc = find_symbol_by_name(elf, sym->name); | 307 | |
| 308 | coldstr[0] = '.'; | 308 | coldstr[0] = '\0'; |
| 309 | 309 | pfunc = find_symbol_by_name(elf, sym->name); | |
| 310 | if (!pfunc) { | 310 | coldstr[0] = '.'; |
| 311 | WARN("%s(): can't find parent function", | 311 | |
| 312 | sym->name); | 312 | if (!pfunc) { |
| 313 | goto err; | 313 | WARN("%s(): can't find parent function", |
| 314 | } | 314 | sym->name); |
| 315 | 315 | goto err; | |
| 316 | sym->pfunc = pfunc; | 316 | } |
| 317 | pfunc->cfunc = sym; | 317 | |
| 318 | sym->pfunc = pfunc; | ||
| 319 | pfunc->cfunc = sym; | ||
| 320 | |||
| 321 | /* | ||
| 322 | * Unfortunately, -fnoreorder-functions puts the child | ||
| 323 | * inside the parent. Remove the overlap so we can | ||
| 324 | * have sane assumptions. | ||
| 325 | * | ||
| 326 | * Note that pfunc->len now no longer matches | ||
| 327 | * pfunc->sym.st_size. | ||
| 328 | */ | ||
| 329 | if (sym->sec == pfunc->sec && | ||
| 330 | sym->offset >= pfunc->offset && | ||
| 331 | sym->offset + sym->len == pfunc->offset + pfunc->len) { | ||
| 332 | pfunc->len -= sym->len; | ||
| 318 | } | 333 | } |
| 319 | } | 334 | } |
| 320 | } | 335 | } |
diff --git a/tools/perf/arch/powerpc/util/skip-callchain-idx.c b/tools/perf/arch/powerpc/util/skip-callchain-idx.c index 3598b8b75d27..ef5d59a5742e 100644 --- a/tools/perf/arch/powerpc/util/skip-callchain-idx.c +++ b/tools/perf/arch/powerpc/util/skip-callchain-idx.c | |||
| @@ -243,7 +243,7 @@ int arch_skip_callchain_idx(struct thread *thread, struct ip_callchain *chain) | |||
| 243 | u64 ip; | 243 | u64 ip; |
| 244 | u64 skip_slot = -1; | 244 | u64 skip_slot = -1; |
| 245 | 245 | ||
| 246 | if (chain->nr < 3) | 246 | if (!chain || chain->nr < 3) |
| 247 | return skip_slot; | 247 | return skip_slot; |
| 248 | 248 | ||
| 249 | ip = chain->ips[2]; | 249 | ip = chain->ips[2]; |
diff --git a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl index 4dfe42666d0c..f0b1709a5ffb 100644 --- a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +++ b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl | |||
| @@ -341,6 +341,8 @@ | |||
| 341 | 330 common pkey_alloc __x64_sys_pkey_alloc | 341 | 330 common pkey_alloc __x64_sys_pkey_alloc |
| 342 | 331 common pkey_free __x64_sys_pkey_free | 342 | 331 common pkey_free __x64_sys_pkey_free |
| 343 | 332 common statx __x64_sys_statx | 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 | # x32-specific system call numbers start at 512 to avoid cache impact | 348 | # x32-specific system call numbers start at 512 to avoid cache impact |
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index 63eb49082774..44195514b19e 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c | |||
| @@ -1098,7 +1098,7 @@ static void *worker_thread(void *__tdata) | |||
| 1098 | u8 *global_data; | 1098 | u8 *global_data; |
| 1099 | u8 *process_data; | 1099 | u8 *process_data; |
| 1100 | u8 *thread_data; | 1100 | u8 *thread_data; |
| 1101 | u64 bytes_done; | 1101 | u64 bytes_done, secs; |
| 1102 | long work_done; | 1102 | long work_done; |
| 1103 | u32 l; | 1103 | u32 l; |
| 1104 | struct rusage rusage; | 1104 | struct rusage rusage; |
| @@ -1254,7 +1254,8 @@ static void *worker_thread(void *__tdata) | |||
| 1254 | timersub(&stop, &start0, &diff); | 1254 | timersub(&stop, &start0, &diff); |
| 1255 | td->runtime_ns = diff.tv_sec * NSEC_PER_SEC; | 1255 | td->runtime_ns = diff.tv_sec * NSEC_PER_SEC; |
| 1256 | td->runtime_ns += diff.tv_usec * NSEC_PER_USEC; | 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 | getrusage(RUSAGE_THREAD, &rusage); | 1260 | getrusage(RUSAGE_THREAD, &rusage); |
| 1260 | td->system_time_ns = rusage.ru_stime.tv_sec * NSEC_PER_SEC; | 1261 | td->system_time_ns = rusage.ru_stime.tv_sec * NSEC_PER_SEC; |
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 5eb22cc56363..8180319285af 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
| @@ -283,6 +283,15 @@ out_put: | |||
| 283 | return ret; | 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 | static int hist_entry__tty_annotate(struct hist_entry *he, | 295 | static int hist_entry__tty_annotate(struct hist_entry *he, |
| 287 | struct perf_evsel *evsel, | 296 | struct perf_evsel *evsel, |
| 288 | struct perf_annotate *ann) | 297 | struct perf_annotate *ann) |
| @@ -471,7 +480,7 @@ int cmd_annotate(int argc, const char **argv) | |||
| 471 | .attr = perf_event__process_attr, | 480 | .attr = perf_event__process_attr, |
| 472 | .build_id = perf_event__process_build_id, | 481 | .build_id = perf_event__process_build_id, |
| 473 | .tracing_data = perf_event__process_tracing_data, | 482 | .tracing_data = perf_event__process_tracing_data, |
| 474 | .feature = perf_event__process_feature, | 483 | .feature = process_feature_event, |
| 475 | .ordered_events = true, | 484 | .ordered_events = true, |
| 476 | .ordering_requires_timestamps = true, | 485 | .ordering_requires_timestamps = true, |
| 477 | }, | 486 | }, |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index cdb5b6949832..c04dc7b53797 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
| @@ -217,7 +217,8 @@ static int process_feature_event(struct perf_tool *tool, | |||
| 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 | * group if needed. | 222 | * group if needed. |
| 222 | */ | 223 | */ |
| 223 | setup_forced_leader(rep, session->evlist); | 224 | setup_forced_leader(rep, session->evlist); |
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index a31d7082188e..568ddfac3213 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
| @@ -1834,6 +1834,7 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, | |||
| 1834 | struct perf_evlist *evlist; | 1834 | struct perf_evlist *evlist; |
| 1835 | struct perf_evsel *evsel, *pos; | 1835 | struct perf_evsel *evsel, *pos; |
| 1836 | int err; | 1836 | int err; |
| 1837 | static struct perf_evsel_script *es; | ||
| 1837 | 1838 | ||
| 1838 | err = perf_event__process_attr(tool, event, pevlist); | 1839 | err = perf_event__process_attr(tool, event, pevlist); |
| 1839 | if (err) | 1840 | if (err) |
| @@ -1842,6 +1843,19 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, | |||
| 1842 | evlist = *pevlist; | 1843 | evlist = *pevlist; |
| 1843 | evsel = perf_evlist__last(*pevlist); | 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 | if (evsel->attr.type >= PERF_TYPE_MAX && | 1859 | if (evsel->attr.type >= PERF_TYPE_MAX && |
| 1846 | evsel->attr.type != PERF_TYPE_SYNTH) | 1860 | evsel->attr.type != PERF_TYPE_SYNTH) |
| 1847 | return 0; | 1861 | return 0; |
| @@ -3030,6 +3044,15 @@ int process_cpu_map_event(struct perf_tool *tool __maybe_unused, | |||
| 3030 | return set_maps(script); | 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 | #ifdef HAVE_AUXTRACE_SUPPORT | 3056 | #ifdef HAVE_AUXTRACE_SUPPORT |
| 3034 | static int perf_script__process_auxtrace_info(struct perf_tool *tool, | 3057 | static int perf_script__process_auxtrace_info(struct perf_tool *tool, |
| 3035 | union perf_event *event, | 3058 | union perf_event *event, |
| @@ -3074,7 +3097,7 @@ int cmd_script(int argc, const char **argv) | |||
| 3074 | .attr = process_attr, | 3097 | .attr = process_attr, |
| 3075 | .event_update = perf_event__process_event_update, | 3098 | .event_update = perf_event__process_event_update, |
| 3076 | .tracing_data = perf_event__process_tracing_data, | 3099 | .tracing_data = perf_event__process_tracing_data, |
| 3077 | .feature = perf_event__process_feature, | 3100 | .feature = process_feature_event, |
| 3078 | .build_id = perf_event__process_build_id, | 3101 | .build_id = perf_event__process_build_id, |
| 3079 | .id_index = perf_event__process_id_index, | 3102 | .id_index = perf_event__process_id_index, |
| 3080 | .auxtrace_info = perf_script__process_auxtrace_info, | 3103 | .auxtrace_info = perf_script__process_auxtrace_info, |
| @@ -3125,8 +3148,9 @@ int cmd_script(int argc, const char **argv) | |||
| 3125 | "+field to add and -field to remove." | 3148 | "+field to add and -field to remove." |
| 3126 | "Valid types: hw,sw,trace,raw,synth. " | 3149 | "Valid types: hw,sw,trace,raw,synth. " |
| 3127 | "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso," | 3150 | "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso," |
| 3128 | "addr,symoff,period,iregs,uregs,brstack,brstacksym,flags," | 3151 | "addr,symoff,srcline,period,iregs,uregs,brstack," |
| 3129 | "bpf-output,callindent,insn,insnlen,brstackinsn,synth,phys_addr", | 3152 | "brstacksym,flags,bpf-output,brstackinsn,brstackoff," |
| 3153 | "callindent,insn,insnlen,synth,phys_addr,metric,misc", | ||
| 3130 | parse_output_fields), | 3154 | parse_output_fields), |
| 3131 | OPT_BOOLEAN('a', "all-cpus", &system_wide, | 3155 | OPT_BOOLEAN('a', "all-cpus", &system_wide, |
| 3132 | "system-wide collection from all CPUs"), | 3156 | "system-wide collection from all CPUs"), |
diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build index 17783913d330..215ba30b8534 100644 --- a/tools/perf/pmu-events/Build +++ b/tools/perf/pmu-events/Build | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | hostprogs := jevents | 1 | hostprogs := jevents |
| 2 | 2 | ||
| 3 | jevents-y += json.o jsmn.o jevents.o | 3 | jevents-y += json.o jsmn.o jevents.o |
| 4 | CHOSTFLAGS_jevents.o = -I$(srctree)/tools/include | 4 | HOSTCFLAGS_jevents.o = -I$(srctree)/tools/include |
| 5 | pmu-events-y += pmu-events.o | 5 | pmu-events-y += pmu-events.o |
| 6 | JDIR = pmu-events/arch/$(SRCARCH) | 6 | JDIR = pmu-events/arch/$(SRCARCH) |
| 7 | JSON = $(shell [ -d $(JDIR) ] && \ | 7 | JSON = $(shell [ -d $(JDIR) ] && \ |
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 7d4077068454..61211918bfba 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c | |||
| @@ -1309,6 +1309,11 @@ static int test__checkevent_config_cache(struct perf_evlist *evlist) | |||
| 1309 | return 0; | 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 | static int test__intel_pt(struct perf_evlist *evlist) | 1317 | static int test__intel_pt(struct perf_evlist *evlist) |
| 1313 | { | 1318 | { |
| 1314 | struct perf_evsel *evsel = perf_evlist__first(evlist); | 1319 | struct perf_evsel *evsel = perf_evlist__first(evlist); |
| @@ -1375,6 +1380,7 @@ struct evlist_test { | |||
| 1375 | const char *name; | 1380 | const char *name; |
| 1376 | __u32 type; | 1381 | __u32 type; |
| 1377 | const int id; | 1382 | const int id; |
| 1383 | bool (*valid)(void); | ||
| 1378 | int (*check)(struct perf_evlist *evlist); | 1384 | int (*check)(struct perf_evlist *evlist); |
| 1379 | }; | 1385 | }; |
| 1380 | 1386 | ||
| @@ -1648,6 +1654,7 @@ static struct evlist_test test__events[] = { | |||
| 1648 | }, | 1654 | }, |
| 1649 | { | 1655 | { |
| 1650 | .name = "intel_pt//u", | 1656 | .name = "intel_pt//u", |
| 1657 | .valid = test__intel_pt_valid, | ||
| 1651 | .check = test__intel_pt, | 1658 | .check = test__intel_pt, |
| 1652 | .id = 52, | 1659 | .id = 52, |
| 1653 | }, | 1660 | }, |
| @@ -1686,17 +1693,24 @@ static struct terms_test test__terms[] = { | |||
| 1686 | 1693 | ||
| 1687 | static int test_event(struct evlist_test *e) | 1694 | static int test_event(struct evlist_test *e) |
| 1688 | { | 1695 | { |
| 1696 | struct parse_events_error err = { .idx = 0, }; | ||
| 1689 | struct perf_evlist *evlist; | 1697 | struct perf_evlist *evlist; |
| 1690 | int ret; | 1698 | int ret; |
| 1691 | 1699 | ||
| 1700 | if (e->valid && !e->valid()) { | ||
| 1701 | pr_debug("... SKIP"); | ||
| 1702 | return 0; | ||
| 1703 | } | ||
| 1704 | |||
| 1692 | evlist = perf_evlist__new(); | 1705 | evlist = perf_evlist__new(); |
| 1693 | if (evlist == NULL) | 1706 | if (evlist == NULL) |
| 1694 | return -ENOMEM; | 1707 | return -ENOMEM; |
| 1695 | 1708 | ||
| 1696 | ret = parse_events(evlist, e->name, NULL); | 1709 | ret = parse_events(evlist, e->name, &err); |
| 1697 | if (ret) { | 1710 | if (ret) { |
| 1698 | pr_debug("failed to parse event '%s', err %d\n", | 1711 | pr_debug("failed to parse event '%s', err %d, str '%s'\n", |
| 1699 | e->name, ret); | 1712 | e->name, ret, err.str); |
| 1713 | parse_events_print_error(&err, e->name); | ||
| 1700 | } else { | 1714 | } else { |
| 1701 | ret = e->check(evlist); | 1715 | ret = e->check(evlist); |
| 1702 | } | 1716 | } |
| @@ -1714,10 +1728,11 @@ static int test_events(struct evlist_test *events, unsigned cnt) | |||
| 1714 | for (i = 0; i < cnt; i++) { | 1728 | for (i = 0; i < cnt; i++) { |
| 1715 | struct evlist_test *e = &events[i]; | 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 | ret1 = test_event(e); | 1732 | ret1 = test_event(e); |
| 1719 | if (ret1) | 1733 | if (ret1) |
| 1720 | ret2 = ret1; | 1734 | ret2 = ret1; |
| 1735 | pr_debug("\n"); | ||
| 1721 | } | 1736 | } |
| 1722 | 1737 | ||
| 1723 | return ret2; | 1738 | return ret2; |
| @@ -1799,7 +1814,7 @@ static int test_pmu_events(void) | |||
| 1799 | } | 1814 | } |
| 1800 | 1815 | ||
| 1801 | while (!ret && (ent = readdir(dir))) { | 1816 | while (!ret && (ent = readdir(dir))) { |
| 1802 | struct evlist_test e; | 1817 | struct evlist_test e = { .id = 0, }; |
| 1803 | char name[2 * NAME_MAX + 1 + 12 + 3]; | 1818 | char name[2 * NAME_MAX + 1 + 12 + 3]; |
| 1804 | 1819 | ||
| 1805 | /* Names containing . are special and cannot be used directly */ | 1820 | /* Names containing . are special and cannot be used directly */ |
diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c index 40e30a26b23c..9497d02f69e6 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c | |||
| @@ -45,6 +45,7 @@ static int session_write_header(char *path) | |||
| 45 | 45 | ||
| 46 | perf_header__set_feat(&session->header, HEADER_CPU_TOPOLOGY); | 46 | perf_header__set_feat(&session->header, HEADER_CPU_TOPOLOGY); |
| 47 | perf_header__set_feat(&session->header, HEADER_NRCPUS); | 47 | perf_header__set_feat(&session->header, HEADER_NRCPUS); |
| 48 | perf_header__set_feat(&session->header, HEADER_ARCH); | ||
| 48 | 49 | ||
| 49 | session->header.data_size += DATA_SIZE; | 50 | session->header.data_size += DATA_SIZE; |
| 50 | 51 | ||
diff --git a/tools/perf/util/c++/clang.cpp b/tools/perf/util/c++/clang.cpp index bf31ceab33bd..89512504551b 100644 --- a/tools/perf/util/c++/clang.cpp +++ b/tools/perf/util/c++/clang.cpp | |||
| @@ -146,8 +146,15 @@ getBPFObjectFromModule(llvm::Module *Module) | |||
| 146 | raw_svector_ostream ostream(*Buffer); | 146 | raw_svector_ostream ostream(*Buffer); |
| 147 | 147 | ||
| 148 | legacy::PassManager PM; | 148 | legacy::PassManager PM; |
| 149 | if (TargetMachine->addPassesToEmitFile(PM, ostream, | 149 | bool NotAdded; |
| 150 | TargetMachine::CGFT_ObjectFile)) { | 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 | llvm::errs() << "TargetMachine can't emit a file of this type\n"; | 158 | llvm::errs() << "TargetMachine can't emit a file of this type\n"; |
| 152 | return std::unique_ptr<llvm::SmallVectorImpl<char>>(nullptr);; | 159 | return std::unique_ptr<llvm::SmallVectorImpl<char>>(nullptr);; |
| 153 | } | 160 | } |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 540cd2dcd3e7..653ff65aa2c3 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
| @@ -2129,6 +2129,7 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) | |||
| 2129 | int cpu_nr = ff->ph->env.nr_cpus_avail; | 2129 | int cpu_nr = ff->ph->env.nr_cpus_avail; |
| 2130 | u64 size = 0; | 2130 | u64 size = 0; |
| 2131 | struct perf_header *ph = ff->ph; | 2131 | struct perf_header *ph = ff->ph; |
| 2132 | bool do_core_id_test = true; | ||
| 2132 | 2133 | ||
| 2133 | ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu)); | 2134 | ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu)); |
| 2134 | if (!ph->env.cpu) | 2135 | if (!ph->env.cpu) |
| @@ -2183,6 +2184,13 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) | |||
| 2183 | return 0; | 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 | for (i = 0; i < (u32)cpu_nr; i++) { | 2194 | for (i = 0; i < (u32)cpu_nr; i++) { |
| 2187 | if (do_read_u32(ff, &nr)) | 2195 | if (do_read_u32(ff, &nr)) |
| 2188 | goto free_cpu; | 2196 | goto free_cpu; |
| @@ -2192,7 +2200,7 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) | |||
| 2192 | if (do_read_u32(ff, &nr)) | 2200 | if (do_read_u32(ff, &nr)) |
| 2193 | goto free_cpu; | 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 | pr_debug("socket_id number is too big." | 2204 | pr_debug("socket_id number is too big." |
| 2197 | "You may need to upgrade the perf tool.\n"); | 2205 | "You may need to upgrade the perf tool.\n"); |
| 2198 | goto free_cpu; | 2206 | goto free_cpu; |
| @@ -3456,7 +3464,7 @@ int perf_event__process_feature(struct perf_tool *tool, | |||
| 3456 | pr_warning("invalid record type %d in pipe-mode\n", type); | 3464 | pr_warning("invalid record type %d in pipe-mode\n", type); |
| 3457 | return 0; | 3465 | return 0; |
| 3458 | } | 3466 | } |
| 3459 | if (feat == HEADER_RESERVED || feat > HEADER_LAST_FEATURE) { | 3467 | if (feat == HEADER_RESERVED || feat >= HEADER_LAST_FEATURE) { |
| 3460 | pr_warning("invalid record type %d in pipe-mode\n", type); | 3468 | pr_warning("invalid record type %d in pipe-mode\n", type); |
| 3461 | return -1; | 3469 | return -1; |
| 3462 | } | 3470 | } |
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c index ba4c9dd18643..d426761a549d 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c | |||
| @@ -366,7 +366,7 @@ static int intel_pt_get_cyc(unsigned int byte, const unsigned char *buf, | |||
| 366 | if (len < offs) | 366 | if (len < offs) |
| 367 | return INTEL_PT_NEED_MORE_BYTES; | 367 | return INTEL_PT_NEED_MORE_BYTES; |
| 368 | byte = buf[offs++]; | 368 | byte = buf[offs++]; |
| 369 | payload |= (byte >> 1) << shift; | 369 | payload |= ((uint64_t)byte >> 1) << shift; |
| 370 | } | 370 | } |
| 371 | 371 | ||
| 372 | packet->type = INTEL_PT_CYC; | 372 | packet->type = INTEL_PT_CYC; |
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index d2fb597c9a8c..3ba6a1742f91 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c | |||
| @@ -234,6 +234,74 @@ static int perf_pmu__parse_snapshot(struct perf_pmu_alias *alias, | |||
| 234 | return 0; | 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 | static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, | 305 | static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, |
| 238 | char *desc, char *val, | 306 | char *desc, char *val, |
| 239 | char *long_desc, char *topic, | 307 | char *long_desc, char *topic, |
| @@ -241,9 +309,11 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, | |||
| 241 | char *metric_expr, | 309 | char *metric_expr, |
| 242 | char *metric_name) | 310 | char *metric_name) |
| 243 | { | 311 | { |
| 312 | struct parse_events_term *term; | ||
| 244 | struct perf_pmu_alias *alias; | 313 | struct perf_pmu_alias *alias; |
| 245 | int ret; | 314 | int ret; |
| 246 | int num; | 315 | int num; |
| 316 | char newval[256]; | ||
| 247 | 317 | ||
| 248 | alias = malloc(sizeof(*alias)); | 318 | alias = malloc(sizeof(*alias)); |
| 249 | if (!alias) | 319 | if (!alias) |
| @@ -262,6 +332,27 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, | |||
| 262 | return ret; | 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 | alias->name = strdup(name); | 356 | alias->name = strdup(name); |
| 266 | if (dir) { | 357 | if (dir) { |
| 267 | /* | 358 | /* |
| @@ -285,9 +376,10 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, | |||
| 285 | snprintf(alias->unit, sizeof(alias->unit), "%s", unit); | 376 | snprintf(alias->unit, sizeof(alias->unit), "%s", unit); |
| 286 | } | 377 | } |
| 287 | alias->per_pkg = perpkg && sscanf(perpkg, "%d", &num) == 1 && num == 1; | 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 | return 0; | 384 | return 0; |
| 293 | } | 385 | } |
| @@ -303,6 +395,9 @@ static int perf_pmu__new_alias(struct list_head *list, char *dir, char *name, FI | |||
| 303 | 395 | ||
| 304 | buf[ret] = 0; | 396 | buf[ret] = 0; |
| 305 | 397 | ||
| 398 | /* Remove trailing newline from sysfs file */ | ||
| 399 | rtrim(buf); | ||
| 400 | |||
| 306 | return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL, NULL, | 401 | return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL, NULL, |
| 307 | NULL, NULL, NULL); | 402 | NULL, NULL, NULL); |
| 308 | } | 403 | } |
diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c index a8fb63edcf89..e2926f72a821 100644 --- a/tools/testing/nvdimm/test/nfit.c +++ b/tools/testing/nvdimm/test/nfit.c | |||
| @@ -1991,8 +1991,7 @@ static void nfit_test0_setup(struct nfit_test *t) | |||
| 1991 | pcap->header.type = ACPI_NFIT_TYPE_CAPABILITIES; | 1991 | pcap->header.type = ACPI_NFIT_TYPE_CAPABILITIES; |
| 1992 | pcap->header.length = sizeof(*pcap); | 1992 | pcap->header.length = sizeof(*pcap); |
| 1993 | pcap->highest_capability = 1; | 1993 | pcap->highest_capability = 1; |
| 1994 | pcap->capabilities = ACPI_NFIT_CAPABILITY_CACHE_FLUSH | | 1994 | pcap->capabilities = ACPI_NFIT_CAPABILITY_MEM_FLUSH; |
| 1995 | ACPI_NFIT_CAPABILITY_MEM_FLUSH; | ||
| 1996 | offset += pcap->header.length; | 1995 | offset += pcap->header.length; |
| 1997 | 1996 | ||
| 1998 | if (t->setup_hotplug) { | 1997 | if (t->setup_hotplug) { |
diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config index 7eb613ffef55..b4994a94968b 100644 --- a/tools/testing/selftests/bpf/config +++ b/tools/testing/selftests/bpf/config | |||
| @@ -6,6 +6,7 @@ CONFIG_TEST_BPF=m | |||
| 6 | CONFIG_CGROUP_BPF=y | 6 | CONFIG_CGROUP_BPF=y |
| 7 | CONFIG_NETDEVSIM=m | 7 | CONFIG_NETDEVSIM=m |
| 8 | CONFIG_NET_CLS_ACT=y | 8 | CONFIG_NET_CLS_ACT=y |
| 9 | CONFIG_NET_SCHED=y | ||
| 9 | CONFIG_NET_SCH_INGRESS=y | 10 | CONFIG_NET_SCH_INGRESS=y |
| 10 | CONFIG_NET_IPIP=y | 11 | CONFIG_NET_IPIP=y |
| 11 | CONFIG_IPV6=y | 12 | CONFIG_IPV6=y |
diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh index 35669ccd4d23..9df0d2ac45f8 100755 --- a/tools/testing/selftests/bpf/test_kmod.sh +++ b/tools/testing/selftests/bpf/test_kmod.sh | |||
| @@ -1,6 +1,15 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: GPL-2.0 | 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 | SRC_TREE=../../../../ | 13 | SRC_TREE=../../../../ |
| 5 | 14 | ||
| 6 | test_run() | 15 | test_run() |
diff --git a/tools/testing/selftests/bpf/test_lirc_mode2.sh b/tools/testing/selftests/bpf/test_lirc_mode2.sh index ce2e15e4f976..677686198df3 100755 --- a/tools/testing/selftests/bpf/test_lirc_mode2.sh +++ b/tools/testing/selftests/bpf/test_lirc_mode2.sh | |||
| @@ -1,6 +1,15 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | # SPDX-License-Identifier: GPL-2.0 | 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 | GREEN='\033[0;92m' | 13 | GREEN='\033[0;92m' |
| 5 | RED='\033[0;31m' | 14 | RED='\033[0;31m' |
| 6 | NC='\033[0m' # No Color | 15 | NC='\033[0m' # No Color |
diff --git a/tools/testing/selftests/bpf/test_lwt_seg6local.sh b/tools/testing/selftests/bpf/test_lwt_seg6local.sh index 1c77994b5e71..270fa8f49573 100755 --- a/tools/testing/selftests/bpf/test_lwt_seg6local.sh +++ b/tools/testing/selftests/bpf/test_lwt_seg6local.sh | |||
| @@ -21,6 +21,15 @@ | |||
| 21 | # An UDP datagram is sent from fb00::1 to fb00::6. The test succeeds if this | 21 | # An UDP datagram is sent from fb00::1 to fb00::6. The test succeeds if this |
| 22 | # datagram can be read on NS6 when binding to fb00::6. | 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 | TMP_FILE="/tmp/selftest_lwt_seg6local.txt" | 33 | TMP_FILE="/tmp/selftest_lwt_seg6local.txt" |
| 25 | 34 | ||
| 26 | cleanup() | 35 | cleanup() |
diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c index 05c8cb71724a..9e78df207919 100644 --- a/tools/testing/selftests/bpf/test_sockmap.c +++ b/tools/testing/selftests/bpf/test_sockmap.c | |||
| @@ -1413,18 +1413,12 @@ out: | |||
| 1413 | 1413 | ||
| 1414 | int main(int argc, char **argv) | 1414 | int main(int argc, char **argv) |
| 1415 | { | 1415 | { |
| 1416 | struct rlimit r = {10 * 1024 * 1024, RLIM_INFINITY}; | ||
| 1417 | int iov_count = 1, length = 1024, rate = 1; | 1416 | int iov_count = 1, length = 1024, rate = 1; |
| 1418 | struct sockmap_options options = {0}; | 1417 | struct sockmap_options options = {0}; |
| 1419 | int opt, longindex, err, cg_fd = 0; | 1418 | int opt, longindex, err, cg_fd = 0; |
| 1420 | char *bpf_file = BPF_SOCKMAP_FILENAME; | 1419 | char *bpf_file = BPF_SOCKMAP_FILENAME; |
| 1421 | int test = PING_PONG; | 1420 | int test = PING_PONG; |
| 1422 | 1421 | ||
| 1423 | if (setrlimit(RLIMIT_MEMLOCK, &r)) { | ||
| 1424 | perror("setrlimit(RLIMIT_MEMLOCK)"); | ||
| 1425 | return 1; | ||
| 1426 | } | ||
| 1427 | |||
| 1428 | if (argc < 2) | 1422 | if (argc < 2) |
| 1429 | return test_suite(); | 1423 | return test_suite(); |
| 1430 | 1424 | ||
diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh index 78245d60d8bc..78245d60d8bc 100644..100755 --- a/tools/testing/selftests/net/fib_tests.sh +++ b/tools/testing/selftests/net/fib_tests.sh | |||
diff --git a/tools/testing/selftests/x86/sigreturn.c b/tools/testing/selftests/x86/sigreturn.c index 246145b84a12..4d9dc3f2fd70 100644 --- a/tools/testing/selftests/x86/sigreturn.c +++ b/tools/testing/selftests/x86/sigreturn.c | |||
| @@ -610,21 +610,41 @@ static int test_valid_sigreturn(int cs_bits, bool use_16bit_ss, int force_ss) | |||
| 610 | */ | 610 | */ |
| 611 | for (int i = 0; i < NGREG; i++) { | 611 | for (int i = 0; i < NGREG; i++) { |
| 612 | greg_t req = requested_regs[i], res = resulting_regs[i]; | 612 | greg_t req = requested_regs[i], res = resulting_regs[i]; |
| 613 | |||
| 613 | if (i == REG_TRAPNO || i == REG_IP) | 614 | if (i == REG_TRAPNO || i == REG_IP) |
| 614 | continue; /* don't care */ | 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 | 619 | * If we were using a 16-bit stack segment, then |
| 621 | * are zeroed. For example, we could be a real | 620 | * the kernel is a bit stuck: IRET only restores |
| 622 | * 32-bit program, or we could hit any of a number | 621 | * the low 16 bits of ESP/RSP if SS is 16-bit. |
| 623 | * of poorly-documented IRET or segmented ESP | 622 | * The kernel uses a hack to restore bits 31:16, |
| 624 | * oddities. If this happens, it's okay. | 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)) | 632 | |
| 627 | continue; /* OK; not expected to work */ | 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 | bool ignore_reg = false; | 650 | bool ignore_reg = false; |
| @@ -654,25 +674,18 @@ static int test_valid_sigreturn(int cs_bits, bool use_16bit_ss, int force_ss) | |||
| 654 | #endif | 674 | #endif |
| 655 | 675 | ||
| 656 | /* Sanity check on the kernel */ | 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 | printf("[FAIL]\tCX (saved SP) mismatch: requested 0x%llx; got 0x%llx\n", | 678 | printf("[FAIL]\tCX (saved SP) mismatch: requested 0x%llx; got 0x%llx\n", |
| 659 | (unsigned long long)requested_regs[i], | 679 | (unsigned long long)req, |
| 660 | (unsigned long long)resulting_regs[i]); | 680 | (unsigned long long)res); |
| 661 | nerrs++; | 681 | nerrs++; |
| 662 | continue; | 682 | continue; |
| 663 | } | 683 | } |
| 664 | 684 | ||
| 665 | if (requested_regs[i] != resulting_regs[i] && !ignore_reg) { | 685 | if (req != res && !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 | */ | ||
| 673 | printf("[FAIL]\tReg %d mismatch: requested 0x%llx; got 0x%llx\n", | 686 | printf("[FAIL]\tReg %d mismatch: requested 0x%llx; got 0x%llx\n", |
| 674 | i, (unsigned long long)requested_regs[i], | 687 | i, (unsigned long long)req, |
| 675 | (unsigned long long)resulting_regs[i]); | 688 | (unsigned long long)res); |
| 676 | nerrs++; | 689 | nerrs++; |
| 677 | } | 690 | } |
| 678 | } | 691 | } |
diff --git a/tools/virtio/linux/scatterlist.h b/tools/virtio/linux/scatterlist.h index 9a45f90e2d08..369ee308b668 100644 --- a/tools/virtio/linux/scatterlist.h +++ b/tools/virtio/linux/scatterlist.h | |||
| @@ -36,7 +36,6 @@ static inline void sg_assign_page(struct scatterlist *sg, struct page *page) | |||
| 36 | */ | 36 | */ |
| 37 | BUG_ON((unsigned long) page & 0x03); | 37 | BUG_ON((unsigned long) page & 0x03); |
| 38 | #ifdef CONFIG_DEBUG_SG | 38 | #ifdef CONFIG_DEBUG_SG |
| 39 | BUG_ON(sg->sg_magic != SG_MAGIC); | ||
| 40 | BUG_ON(sg_is_chain(sg)); | 39 | BUG_ON(sg_is_chain(sg)); |
| 41 | #endif | 40 | #endif |
| 42 | sg->page_link = page_link | (unsigned long) page; | 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, | |||
| 67 | static inline struct page *sg_page(struct scatterlist *sg) | 66 | static inline struct page *sg_page(struct scatterlist *sg) |
| 68 | { | 67 | { |
| 69 | #ifdef CONFIG_DEBUG_SG | 68 | #ifdef CONFIG_DEBUG_SG |
| 70 | BUG_ON(sg->sg_magic != SG_MAGIC); | ||
| 71 | BUG_ON(sg_is_chain(sg)); | 69 | BUG_ON(sg_is_chain(sg)); |
| 72 | #endif | 70 | #endif |
| 73 | return (struct page *)((sg)->page_link & ~0x3); | 71 | return (struct page *)((sg)->page_link & ~0x3); |
| @@ -116,9 +114,6 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, | |||
| 116 | **/ | 114 | **/ |
| 117 | static inline void sg_mark_end(struct scatterlist *sg) | 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 | * Set termination bit, clear potential chain bit | 118 | * Set termination bit, clear potential chain bit |
| 124 | */ | 119 | */ |
| @@ -136,17 +131,11 @@ static inline void sg_mark_end(struct scatterlist *sg) | |||
| 136 | **/ | 131 | **/ |
| 137 | static inline void sg_unmark_end(struct scatterlist *sg) | 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 | sg->page_link &= ~0x02; | 134 | sg->page_link &= ~0x02; |
| 143 | } | 135 | } |
| 144 | 136 | ||
| 145 | static inline struct scatterlist *sg_next(struct scatterlist *sg) | 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 | if (sg_is_last(sg)) | 139 | if (sg_is_last(sg)) |
| 151 | return NULL; | 140 | return NULL; |
| 152 | 141 | ||
| @@ -160,13 +149,6 @@ static inline struct scatterlist *sg_next(struct scatterlist *sg) | |||
| 160 | static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) | 149 | static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) |
| 161 | { | 150 | { |
| 162 | memset(sgl, 0, sizeof(*sgl) * nents); | 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 | sg_mark_end(&sgl[nents - 1]); | 152 | sg_mark_end(&sgl[nents - 1]); |
| 171 | } | 153 | } |
| 172 | 154 | ||
