Two requests have come in for a backmerge, and I've got some pull reqs on rc2, so this just makes sense.
Unified · Split
| @@ -324,8 +324,7 @@ Global Attributes · 323 unmodified lines | ||
| 324 | 324 | |
| 325 | 325 | ``intel_pstate`` exposes several global attributes (files) in ``sysfs`` to |
| 326 | 326 | control its functionality at the system level. They are located in the |
| 327 | −``/sys/devices/system/cpu/cpufreq/intel_pstate/`` directory and affect all | |
| 328 | −CPUs. | |
| 327 | +``/sys/devices/system/cpu/intel_pstate/`` directory and affect all CPUs. | |
| 329 | 328 | |
| 330 | 329 | Some of them are not present if the ``intel_pstate=per_cpu_perf_limits`` |
| 331 | 330 | argument is passed to the kernel in the command line. |
| @@ -379,6 +378,17 @@ argument is passed to the kernel in the command line. · 47 unmodified lines | ||
| 379 | 378 | but it affects the maximum possible value of per-policy P-state limits |
| 380 | 379 | (see `Interpretation of Policy Attributes`_ below for details). |
| 381 | 380 | |
| 381 | +``hwp_dynamic_boost`` | |
| 382 | + This attribute is only present if ``intel_pstate`` works in the | |
| 383 | + `active mode with the HWP feature enabled <Active Mode With HWP_>`_ in | |
| 384 | + the processor. If set (equal to 1), it causes the minimum P-state limit | |
| 385 | + to be increased dynamically for a short time whenever a task previously | |
| 386 | + waiting on I/O is selected to run on a given logical CPU (the purpose | |
| 387 | + of this mechanism is to improve performance). | |
| 388 | + | |
| 389 | + This setting has no effect on logical CPUs whose minimum P-state limit | |
| 390 | + is directly set to the highest non-turbo P-state or above it. | |
| 391 | + | |
| 382 | 392 | .. _status_attr: |
| 383 | 393 | |
| 384 | 394 | ``status`` |
| @@ -410,7 +420,7 @@ argument is passed to the kernel in the command line. · 25 unmodified lines | ||
| 410 | 420 | That only is supported in some configurations, though (for example, if |
| 411 | 421 | the `HWP feature is enabled in the processor <Active Mode With HWP_>`_, |
| 412 | 422 | the operation mode of the driver cannot be changed), and if it is not |
| 413 | − supported in the current configuration, writes to this attribute with | |
| 423 | + supported in the current configuration, writes to this attribute will | |
| 414 | 424 | fail with an appropriate error. |
| 415 | 425 | |
| 416 | 426 | Interpretation of Policy Attributes |
| @@ -284,7 +284,7 @@ Resources Management · 283 unmodified lines | ||
| 284 | 284 | MTRR Handling |
| 285 | 285 | ------------- |
| 286 | 286 | |
| 287 | −.. kernel-doc:: arch/x86/kernel/cpu/mtrr/main.c | |
| 287 | +.. kernel-doc:: arch/x86/kernel/cpu/mtrr/mtrr.c | |
| 288 | 288 | :export: |
| 289 | 289 | |
| 290 | 290 | Security Framework |
| @@ -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 | + }; | |
| @@ -49,10 +49,10 @@ Device Drivers Base · 48 unmodified lines | ||
| 49 | 49 | Device Drivers DMA Management |
| 50 | 50 | ----------------------------- |
| 51 | 51 | |
| 52 | −.. kernel-doc:: drivers/base/dma-coherent.c | |
| 52 | +.. kernel-doc:: kernel/dma/coherent.c | |
| 53 | 53 | :export: |
| 54 | 54 | |
| 55 | −.. kernel-doc:: drivers/base/dma-mapping.c | |
| 55 | +.. kernel-doc:: kernel/dma/mapping.c | |
| 56 | 56 | :export: |
| 57 | 57 | |
| 58 | 58 | Device drivers PnP support |
| @@ -441,8 +441,6 @@ prototypes: · 440 unmodified lines | ||
| 441 | 441 | int (*iterate) (struct file *, struct dir_context *); |
| 442 | 442 | int (*iterate_shared) (struct file *, struct dir_context *); |
| 443 | 443 | __poll_t (*poll) (struct file *, struct poll_table_struct *); |
| 444 | − struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t); | |
| 445 | − __poll_t (*poll_mask) (struct file *, __poll_t); | |
| 446 | 444 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
| 447 | 445 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
| 448 | 446 | int (*mmap) (struct file *, struct vm_area_struct *); |
| @@ -473,7 +471,7 @@ prototypes: · 24 unmodified lines | ||
| 473 | 471 | }; |
| 474 | 472 | |
| 475 | 473 | locking rules: |
| 476 | − All except for ->poll_mask may block. | |
| 474 | + All may block. | |
| 477 | 475 | |
| 478 | 476 | ->llseek() locking has moved from llseek to the individual llseek |
| 479 | 477 | implementations. If your fs is not using generic_file_llseek, you |
| @@ -505,9 +503,6 @@ in sys_read() and friends. · 25 unmodified lines | ||
| 505 | 503 | the lease within the individual filesystem to record the result of the |
| 506 | 504 | operation |
| 507 | 505 | |
| 508 | −->poll_mask can be called with or without the waitqueue lock for the waitqueue | |
| 509 | −returned from ->get_poll_head. | |
| 510 | − | |
| 511 | 506 | --------------------------- dquot_operations ------------------------------- |
| 512 | 507 | prototypes: |
| 513 | 508 | int (*write_dquot) (struct dquot *); |
| @@ -42,9 +42,11 @@ Jeff Layton (many, many fixes, as well as great work on the cifs Kerberos code) · 41 unmodified lines | ||
| 42 | 42 | Scott Lovenberg |
| 43 | 43 | Pavel Shilovsky (for great work adding SMB2 support, and various SMB3 features) |
| 44 | 44 | Aurelien Aptel (for DFS SMB3 work and some key bug fixes) |
| 45 | −Ronnie Sahlberg (for SMB3 xattr work and bug fixes) | |
| 45 | +Ronnie Sahlberg (for SMB3 xattr work, bug fixes, and lots of great work on compounding) | |
| 46 | 46 | Shirish Pargaonkar (for many ACL patches over the years) |
| 47 | 47 | Sachin Prabhu (many bug fixes, including for reconnect, copy offload and security) |
| 48 | +Paulo Alcantara | |
| 49 | +Long Li (some great work on RDMA, SMB Direct) | |
| 48 | 50 | |
| 49 | 51 | |
| 50 | 52 | Test case and Bug Report contributors |
| @@ -58,5 +60,4 @@ mention to the Stanford Checker (SWAT) which pointed out many minor · 7 unmodified lines | ||
| 58 | 60 | bugs in error paths. Valuable suggestions also have come from Al Viro |
| 59 | 61 | and Dave Miller. |
| 60 | 62 | |
| 61 | −And thanks to the IBM LTC and Power test teams and SuSE testers for | |
| 62 | −finding multiple bugs during excellent stress test runs. | |
| 63 | +And thanks to the IBM LTC and Power test teams and SuSE and Citrix and RedHat testers for finding multiple bugs during excellent stress test runs. | |
| @@ -1,3 +1,6 @@ | ||
| 1 | +See https://wiki.samba.org/index.php/LinuxCIFSKernel for | |
| 2 | +more current information. | |
| 3 | + | |
| 1 | 4 | Version 1.62 |
| 2 | 5 | ------------ |
| 3 | 6 | Add sockopt=TCP_NODELAY mount option. EA (xattr) routines hardened |
| @@ -9,14 +9,14 @@ is a partial list of the known problems and missing features: · 8 unmodified lines | ||
| 9 | 9 | |
| 10 | 10 | a) SMB3 (and SMB3.02) missing optional features: |
| 11 | 11 | - multichannel (started), integration with RDMA |
| 12 | − - directory leases (improved metadata caching) | |
| 13 | − - T10 copy offload (copy chunk, and "Duplicate Extents" ioctl | |
| 12 | + - directory leases (improved metadata caching), started (root dir only) | |
| 13 | + - T10 copy offload ie "ODX" (copy chunk, and "Duplicate Extents" ioctl | |
| 14 | 14 | currently the only two server side copy mechanisms supported) |
| 15 | 15 | |
| 16 | 16 | b) improved sparse file support |
| 17 | 17 | |
| 18 | 18 | c) Directory entry caching relies on a 1 second timer, rather than |
| 19 | −using Directory Leases | |
| 19 | +using Directory Leases, currently only the root file handle is cached longer | |
| 20 | 20 | |
| 21 | 21 | d) quota support (needs minor kernel change since quota calls |
| 22 | 22 | to make it to network filesystems or deviceless filesystems) |
| @@ -42,6 +42,8 @@ mount or a per server basis to client UIDs or nobody if no mapping · 19 unmodified lines | ||
| 42 | 42 | exists. Also better integration with winbind for resolving SID owners |
| 43 | 43 | |
| 44 | 44 | k) Add tools to take advantage of more smb3 specific ioctls and features |
| 45 | +(passthrough ioctl/fsctl for sending various SMB3 fsctls to the server | |
| 46 | +is in progress) | |
| 45 | 47 | |
| 46 | 48 | l) encrypted file support |
| 47 | 49 | |
| @@ -71,9 +73,8 @@ t) split cifs and smb3 support into separate modules so legacy (and less · 23 unmodified lines | ||
| 71 | 73 | secure) CIFS dialect can be disabled in environments that don't need it |
| 72 | 74 | and simplify the code. |
| 73 | 75 | |
| 74 | −u) Finish up SMB3.1.1 dialect support | |
| 75 | − | |
| 76 | −v) POSIX Extensions for SMB3.1.1 | |
| 76 | +v) POSIX Extensions for SMB3.1.1 (started, create and mkdir support added | |
| 77 | +so far). | |
| 77 | 78 | |
| 78 | 79 | KNOWN BUGS |
| 79 | 80 | ==================================== |
| @@ -92,8 +93,8 @@ Misc testing to do · 12 unmodified lines | ||
| 92 | 93 | 1) check out max path names and max path name components against various server |
| 93 | 94 | types. Try nested symlinks (8 deep). Return max path name in stat -f information |
| 94 | 95 | |
| 95 | −2) Improve xfstest's cifs enablement and adapt xfstests where needed to test | |
| 96 | −cifs better | |
| 96 | +2) Improve xfstest's cifs/smb3 enablement and adapt xfstests where needed to test | |
| 97 | +cifs/smb3 better | |
| 97 | 98 | |
| 98 | 99 | 3) Additional performance testing and optimization using iozone and similar - |
| 99 | 100 | there are some easy changes that can be done to parallelize sequential writes, |
| @@ -857,8 +857,6 @@ struct file_operations { · 856 unmodified lines | ||
| 857 | 857 | ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); |
| 858 | 858 | int (*iterate) (struct file *, struct dir_context *); |
| 859 | 859 | __poll_t (*poll) (struct file *, struct poll_table_struct *); |
| 860 | − struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t); | |
| 861 | − __poll_t (*poll_mask) (struct file *, __poll_t); | |
| 862 | 860 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
| 863 | 861 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
| 864 | 862 | int (*mmap) (struct file *, struct vm_area_struct *); |
| @@ -903,17 +901,6 @@ otherwise noted. · 38 unmodified lines | ||
| 903 | 901 | activity on this file and (optionally) go to sleep until there |
| 904 | 902 | is activity. Called by the select(2) and poll(2) system calls |
| 905 | 903 | |
| 906 | − get_poll_head: Returns the struct wait_queue_head that callers can | |
| 907 | − wait on. Callers need to check the returned events using ->poll_mask | |
| 908 | − once woken. Can return NULL to indicate polling is not supported, | |
| 909 | − or any error code using the ERR_PTR convention to indicate that a | |
| 910 | − grave error occured and ->poll_mask shall not be called. | |
| 911 | − | |
| 912 | − poll_mask: return the mask of EPOLL* values describing the file descriptor | |
| 913 | − state. Called either before going to sleep on the waitqueue returned by | |
| 914 | − get_poll_head, or after it has been woken. If ->get_poll_head and | |
| 915 | − ->poll_mask are implemented ->poll does not need to be implement. | |
| 916 | − | |
| 917 | 904 | unlocked_ioctl: called by the ioctl(2) system call. |
| 918 | 905 | |
| 919 | 906 | compat_ioctl: called by the ioctl(2) system call when 32 bit system calls |
| @@ -430,6 +430,12 @@ This sets the config program's title bar if the config program chooses · 429 unmodified lines | ||
| 430 | 430 | to use it. It should be placed at the top of the configuration, before any |
| 431 | 431 | other statement. |
| 432 | 432 | |
| 433 | +'#' Kconfig source file comment: | |
| 434 | + | |
| 435 | +An unquoted '#' character anywhere in a source file line indicates | |
| 436 | +the beginning of a source file comment. The remainder of that line | |
| 437 | +is a comment. | |
| 438 | + | |
| 433 | 439 | |
| 434 | 440 | Kconfig hints |
| 435 | 441 | ------------- |
| @@ -1,3 +1,4 @@ | ||
| 1 | +============================================================== | |
| 1 | 2 | Linux* Base Driver for the Intel(R) PRO/100 Family of Adapters |
| 2 | 3 | ============================================================== |
| 3 | 4 | |
| @@ -86,83 +87,84 @@ Event Log Message Level: The driver uses the message level flag to log events · 82 unmodified lines | ||
| 86 | 87 | Additional Configurations |
| 87 | 88 | ========================= |
| 88 | 89 | |
| 89 | − Configuring the Driver on Different Distributions | |
| 90 | − ------------------------------------------------- | |
| 90 | +Configuring the Driver on Different Distributions | |
| 91 | +------------------------------------------------- | |
| 91 | 92 | |
| 92 | − Configuring a network driver to load properly when the system is started is | |
| 93 | − distribution dependent. Typically, the configuration process involves adding | |
| 94 | − an alias line to /etc/modprobe.d/*.conf as well as editing other system | |
| 95 | − startup scripts and/or configuration files. Many popular Linux | |
| 96 | − distributions ship with tools to make these changes for you. To learn the | |
| 97 | − proper way to configure a network device for your system, refer to your | |
| 98 | − distribution documentation. If during this process you are asked for the | |
| 99 | − driver or module name, the name for the Linux Base Driver for the Intel | |
| 100 | − PRO/100 Family of Adapters is e100. | |
| 93 | +Configuring a network driver to load properly when the system is started | |
| 94 | +is distribution dependent. Typically, the configuration process involves | |
| 95 | +adding an alias line to /etc/modprobe.d/*.conf as well as editing other | |
| 96 | +system startup scripts and/or configuration files. Many popular Linux | |
| 97 | +distributions ship with tools to make these changes for you. To learn | |
| 98 | +the proper way to configure a network device for your system, refer to | |
| 99 | +your distribution documentation. If during this process you are asked | |
| 100 | +for the driver or module name, the name for the Linux Base Driver for | |
| 101 | +the Intel PRO/100 Family of Adapters is e100. | |
| 101 | 102 | |
| 102 | − As an example, if you install the e100 driver for two PRO/100 adapters | |
| 103 | − (eth0 and eth1), add the following to a configuration file in /etc/modprobe.d/ | |
| 103 | +As an example, if you install the e100 driver for two PRO/100 adapters | |
| 104 | +(eth0 and eth1), add the following to a configuration file in | |
| 105 | +/etc/modprobe.d/:: | |
| 104 | 106 | |
| 105 | 107 | alias eth0 e100 |
| 106 | 108 | alias eth1 e100 |
| 107 | 109 | |
| 108 | − Viewing Link Messages | |
| 109 | − --------------------- | |
| 110 | − In order to see link messages and other Intel driver information on your | |
| 111 | − console, you must set the dmesg level up to six. This can be done by | |
| 112 | − entering the following on the command line before loading the e100 driver:: | |
| 113 | − | |
| 114 | − dmesg -n 6 | |
| 110 | +Viewing Link Messages | |
| 111 | +--------------------- | |
| 115 | 112 | |
| 116 | − If you wish to see all messages issued by the driver, including debug | |
| 117 | − messages, set the dmesg level to eight. | |
| 113 | +In order to see link messages and other Intel driver information on your | |
| 114 | +console, you must set the dmesg level up to six. This can be done by | |
| 115 | +entering the following on the command line before loading the e100 | |
| 116 | +driver:: | |
| 118 | 117 | |
| 119 | − NOTE: This setting is not saved across reboots. | |
| 118 | + dmesg -n 6 | |
| 120 | 119 | |
| 120 | +If you wish to see all messages issued by the driver, including debug | |
| 121 | +messages, set the dmesg level to eight. | |
| 121 | 122 | |
| 122 | − ethtool | |
| 123 | − ------- | |
| 123 | +NOTE: This setting is not saved across reboots. | |
| 124 | 124 | |
| 125 | − The driver utilizes the ethtool interface for driver configuration and | |
| 126 | − diagnostics, as well as displaying statistical information. The ethtool | |
| 127 | − version 1.6 or later is required for this functionality. | |
| 125 | +ethtool | |
| 126 | +------- | |
| 128 | 127 | |
| 129 | − The latest release of ethtool can be found from | |
| 130 | − https://www.kernel.org/pub/software/network/ethtool/ | |
| 128 | +The driver utilizes the ethtool interface for driver configuration and | |
| 129 | +diagnostics, as well as displaying statistical information. The ethtool | |
| 130 | +version 1.6 or later is required for this functionality. | |
| 131 | 131 | |
| 132 | − Enabling Wake on LAN* (WoL) | |
| 133 | − --------------------------- | |
| 134 | − WoL is provided through the ethtool* utility. For instructions on enabling | |
| 135 | − WoL with ethtool, refer to the ethtool man page. | |
| 132 | +The latest release of ethtool can be found from | |
| 133 | +https://www.kernel.org/pub/software/network/ethtool/ | |
| 136 | 134 | |
| 137 | − WoL will be enabled on the system during the next shut down or reboot. For | |
| 138 | − this driver version, in order to enable WoL, the e100 driver must be | |
| 139 | − loaded when shutting down or rebooting the system. | |
| 135 | +Enabling Wake on LAN* (WoL) | |
| 136 | +--------------------------- | |
| 137 | +WoL is provided through the ethtool* utility. For instructions on | |
| 138 | +enabling WoL with ethtool, refer to the ethtool man page. WoL will be | |
| 139 | +enabled on the system during the next shut down or reboot. For this | |
| 140 | +driver version, in order to enable WoL, the e100 driver must be loaded | |
| 141 | +when shutting down or rebooting the system. | |
| 140 | 142 | |
| 141 | − NAPI | |
| 142 | − ---- | |
| 143 | +NAPI | |
| 144 | +---- | |
| 143 | 145 | |
| 144 | − NAPI (Rx polling mode) is supported in the e100 driver. | |
| 146 | +NAPI (Rx polling mode) is supported in the e100 driver. | |
| 145 | 147 | |
| 146 | − See https://wiki.linuxfoundation.org/networking/napi for more information | |
| 147 | − on NAPI. | |
| 148 | +See https://wiki.linuxfoundation.org/networking/napi for more | |
| 149 | +information on NAPI. | |
| 148 | 150 | |
| 149 | − Multiple Interfaces on Same Ethernet Broadcast Network | |
| 150 | − ------------------------------------------------------ | |
| 151 | +Multiple Interfaces on Same Ethernet Broadcast Network | |
| 152 | +------------------------------------------------------ | |
| 151 | 153 | |
| 152 | − Due to the default ARP behavior on Linux, it is not possible to have | |
| 153 | − one system on two IP networks in the same Ethernet broadcast domain | |
| 154 | − (non-partitioned switch) behave as expected. All Ethernet interfaces | |
| 155 | − will respond to IP traffic for any IP address assigned to the system. | |
| 156 | − This results in unbalanced receive traffic. | |
| 154 | +Due to the default ARP behavior on Linux, it is not possible to have one | |
| 155 | +system on two IP networks in the same Ethernet broadcast domain | |
| 156 | +(non-partitioned switch) behave as expected. All Ethernet interfaces | |
| 157 | +will respond to IP traffic for any IP address assigned to the system. | |
| 158 | +This results in unbalanced receive traffic. | |
| 157 | 159 | |
| 158 | − If you have multiple interfaces in a server, either turn on ARP | |
| 159 | − filtering by | |
| 160 | +If you have multiple interfaces in a server, either turn on ARP | |
| 161 | +filtering by | |
| 160 | 162 | |
| 161 | − (1) entering:: echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter | |
| 162 | − (this only works if your kernel's version is higher than 2.4.5), or | |
| 163 | +(1) entering:: echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter | |
| 164 | + (this only works if your kernel's version is higher than 2.4.5), or | |
| 163 | 165 | |
| 164 | − (2) installing the interfaces in separate broadcast domains (either | |
| 165 | − in different switches or in a switch partitioned to VLANs). | |
| 166 | +(2) installing the interfaces in separate broadcast domains (either | |
| 167 | + in different switches or in a switch partitioned to VLANs). | |
| 166 | 168 | |
| 167 | 169 | |
| 168 | 170 | Support |
| @@ -1,3 +1,4 @@ | ||
| 1 | +=========================================================== | |
| 1 | 2 | Linux* Base Driver for Intel(R) Ethernet Network Connection |
| 2 | 3 | =========================================================== |
| 3 | 4 | |
| @@ -354,57 +355,58 @@ previously mentioned to force the adapter to the same speed and duplex. · 350 unmodified lines | ||
| 354 | 355 | Additional Configurations |
| 355 | 356 | ========================= |
| 356 | 357 | |
| 357 | − Jumbo Frames | |
| 358 | − ------------ | |
| 359 | − Jumbo Frames support is enabled by changing the MTU to a value larger than | |
| 360 | − the default of 1500. Use the ifconfig command to increase the MTU size. | |
| 361 | − For example:: | |
| 358 | +Jumbo Frames | |
| 359 | +------------ | |
| 360 | +Jumbo Frames support is enabled by changing the MTU to a value larger | |
| 361 | +than the default of 1500. Use the ifconfig command to increase the MTU | |
| 362 | +size. For example:: | |
| 362 | 363 | |
| 363 | 364 | ifconfig eth<x> mtu 9000 up |
| 364 | 365 | |
| 365 | − This setting is not saved across reboots. It can be made permanent if | |
| 366 | − you add:: | |
| 366 | +This setting is not saved across reboots. It can be made permanent if | |
| 367 | +you add:: | |
| 367 | 368 | |
| 368 | 369 | MTU=9000 |
| 369 | 370 | |
| 370 | − to the file /etc/sysconfig/network-scripts/ifcfg-eth<x>. This example | |
| 371 | − applies to the Red Hat distributions; other distributions may store this | |
| 372 | − setting in a different location. | |
| 371 | +to the file /etc/sysconfig/network-scripts/ifcfg-eth<x>. This example | |
| 372 | +applies to the Red Hat distributions; other distributions may store this | |
| 373 | +setting in a different location. | |
| 374 | + | |
| 375 | +Notes: Degradation in throughput performance may be observed in some | |
| 376 | +Jumbo frames environments. If this is observed, increasing the | |
| 377 | +application's socket buffer size and/or increasing the | |
| 378 | +/proc/sys/net/ipv4/tcp_*mem entry values may help. See the specific | |
| 379 | +application manual and /usr/src/linux*/Documentation/ | |
| 380 | +networking/ip-sysctl.txt for more details. | |
| 373 | 381 | |
| 374 | − Notes: | |
| 375 | − Degradation in throughput performance may be observed in some Jumbo frames | |
| 376 | − environments. If this is observed, increasing the application's socket buffer | |
| 377 | − size and/or increasing the /proc/sys/net/ipv4/tcp_*mem entry values may help. | |
| 378 | − See the specific application manual and /usr/src/linux*/Documentation/ | |
| 379 | − networking/ip-sysctl.txt for more details. | |
| 382 | +- The maximum MTU setting for Jumbo Frames is 16110. This value | |
| 383 | + coincides with the maximum Jumbo Frames size of 16128. | |
| 380 | 384 | |
| 381 | − - The maximum MTU setting for Jumbo Frames is 16110. This value coincides | |
| 382 | − with the maximum Jumbo Frames size of 16128. | |
| 385 | +- Using Jumbo frames at 10 or 100 Mbps is not supported and may result | |
| 386 | + in poor performance or loss of link. | |
| 383 | 387 | |
| 384 | − - Using Jumbo frames at 10 or 100 Mbps is not supported and may result in | |
| 385 | − poor performance or loss of link. | |
| 388 | +- Adapters based on the Intel(R) 82542 and 82573V/E controller do not | |
| 389 | + support Jumbo Frames. These correspond to the following product names: | |
| 390 | + Intel(R) PRO/1000 Gigabit Server Adapter Intel(R) PRO/1000 PM Network | |
| 391 | + Connection | |
| 386 | 392 | |
| 387 | − - Adapters based on the Intel(R) 82542 and 82573V/E controller do not | |
| 388 | − support Jumbo Frames. These correspond to the following product names: | |
| 389 | − Intel(R) PRO/1000 Gigabit Server Adapter | |
| 390 | − Intel(R) PRO/1000 PM Network Connection | |
| 393 | +ethtool | |
| 394 | +------- | |
| 395 | +The driver utilizes the ethtool interface for driver configuration and | |
| 396 | +diagnostics, as well as displaying statistical information. The ethtool | |
| 397 | +version 1.6 or later is required for this functionality. | |
| 391 | 398 | |
| 392 | − ethtool | |
| 393 | − ------- | |
| 394 | − The driver utilizes the ethtool interface for driver configuration and | |
| 395 | − diagnostics, as well as displaying statistical information. The ethtool | |
| 396 | − version 1.6 or later is required for this functionality. | |
| 399 | +The latest release of ethtool can be found from | |
| 400 | +https://www.kernel.org/pub/software/network/ethtool/ | |
| 397 | 401 | |
| 398 | − The latest release of ethtool can be found from | |
| 399 | − https://www.kernel.org/pub/software/network/ethtool/ | |
| 402 | +Enabling Wake on LAN* (WoL) | |
| 403 | +--------------------------- | |
| 404 | +WoL is configured through the ethtool* utility. | |
| 400 | 405 | |
| 401 | − Enabling Wake on LAN* (WoL) | |
| 402 | − --------------------------- | |
| 403 | − WoL is configured through the ethtool* utility. | |
| 406 | +WoL will be enabled on the system during the next shut down or reboot. | |
| 407 | +For this driver version, in order to enable WoL, the e1000 driver must be | |
| 408 | +loaded when shutting down or rebooting the system. | |
| 404 | 409 | |
| 405 | − WoL will be enabled on the system during the next shut down or reboot. | |
| 406 | − For this driver version, in order to enable WoL, the e1000 driver must be | |
| 407 | − loaded when shutting down or rebooting the system. | |
| 408 | 410 | |
| 409 | 411 | Support |
| 410 | 412 | ======= |
| @@ -48,7 +48,7 @@ void strp_pause(struct strparser *strp) · 47 unmodified lines | ||
| 48 | 48 | Temporarily pause a stream parser. Message parsing is suspended |
| 49 | 49 | and no new messages are delivered to the upper layer. |
| 50 | 50 | |
| 51 | −void strp_pause(struct strparser *strp) | |
| 51 | +void strp_unpause(struct strparser *strp) | |
| 52 | 52 | |
| 53 | 53 | Unpause a paused stream parser. |
| 54 | 54 | |
| @@ -1729,35 +1729,35 @@ If a variable isn't a key variable or prefixed with 'vals=', the · 1728 unmodified lines | ||
| 1729 | 1729 | associated event field will be saved in a variable but won't be summed |
| 1730 | 1730 | as a value: |
| 1731 | 1731 | |
| 1732 | − # echo 'hist:keys=next_pid:ts1=common_timestamp ... >> event/trigger | |
| 1732 | + # echo 'hist:keys=next_pid:ts1=common_timestamp ...' >> event/trigger | |
| 1733 | 1733 | |
| 1734 | 1734 | Multiple variables can be assigned at the same time. The below would |
| 1735 | 1735 | result in both ts0 and b being created as variables, with both |
| 1736 | 1736 | common_timestamp and field1 additionally being summed as values: |
| 1737 | 1737 | |
| 1738 | − # echo 'hist:keys=pid:vals=$ts0,$b:ts0=common_timestamp,b=field1 ... >> \ | |
| 1738 | + # echo 'hist:keys=pid:vals=$ts0,$b:ts0=common_timestamp,b=field1 ...' >> \ | |
| 1739 | 1739 | event/trigger |
| 1740 | 1740 | |
| 1741 | 1741 | Note that variable assignments can appear either preceding or |
| 1742 | 1742 | following their use. The command below behaves identically to the |
| 1743 | 1743 | command above: |
| 1744 | 1744 | |
| 1745 | − # echo 'hist:keys=pid:ts0=common_timestamp,b=field1:vals=$ts0,$b ... >> \ | |
| 1745 | + # echo 'hist:keys=pid:ts0=common_timestamp,b=field1:vals=$ts0,$b ...' >> \ | |
| 1746 | 1746 | event/trigger |
| 1747 | 1747 | |
| 1748 | 1748 | Any number of variables not bound to a 'vals=' prefix can also be |
| 1749 | 1749 | assigned by simply separating them with colons. Below is the same |
| 1750 | 1750 | thing but without the values being summed in the histogram: |
| 1751 | 1751 | |
| 1752 | − # echo 'hist:keys=pid:ts0=common_timestamp:b=field1 ... >> event/trigger | |
| 1752 | + # echo 'hist:keys=pid:ts0=common_timestamp:b=field1 ...' >> event/trigger | |
| 1753 | 1753 | |
| 1754 | 1754 | Variables set as above can be referenced and used in expressions on |
| 1755 | 1755 | another event. |
| 1756 | 1756 | |
| 1757 | 1757 | For example, here's how a latency can be calculated: |
| 1758 | 1758 | |
| 1759 | − # echo 'hist:keys=pid,prio:ts0=common_timestamp ... >> event1/trigger | |
| 1760 | − # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ... >> event2/trigger | |
| 1759 | + # echo 'hist:keys=pid,prio:ts0=common_timestamp ...' >> event1/trigger | |
| 1760 | + # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ...' >> event2/trigger | |
| 1761 | 1761 | |
| 1762 | 1762 | In the first line above, the event's timetamp is saved into the |
| 1763 | 1763 | variable ts0. In the next line, ts0 is subtracted from the second |
| @@ -1766,7 +1766,7 @@ yet another variable, 'wakeup_lat'. The hist trigger below in turn · 2 unmodified lines | ||
| 1766 | 1766 | makes use of the wakeup_lat variable to compute a combined latency |
| 1767 | 1767 | using the same key and variable from yet another event: |
| 1768 | 1768 | |
| 1769 | − # echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ... >> event3/trigger | |
| 1769 | + # echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ...' >> event3/trigger | |
| 1770 | 1770 | |
| 1771 | 1771 | 2.2.2 Synthetic Events |
| 1772 | 1772 | ---------------------- |
| @@ -1807,10 +1807,11 @@ the command that defined it with a '!': · 34 unmodified lines | ||
| 1807 | 1807 | At this point, there isn't yet an actual 'wakeup_latency' event |
| 1808 | 1808 | instantiated in the event subsytem - for this to happen, a 'hist |
| 1809 | 1809 | trigger action' needs to be instantiated and bound to actual fields |
| 1810 | −and variables defined on other events (see Section 6.3.3 below). | |
| 1810 | +and variables defined on other events (see Section 2.2.3 below on | |
| 1811 | +how that is done using hist trigger 'onmatch' action). Once that is | |
| 1812 | +done, the 'wakeup_latency' synthetic event instance is created. | |
| 1811 | 1813 | |
| 1812 | −Once that is done, an event instance is created, and a histogram can | |
| 1813 | −be defined using it: | |
| 1814 | +A histogram can now be defined for the new synthetic event: | |
| 1814 | 1815 | |
| 1815 | 1816 | # echo 'hist:keys=pid,prio,lat.log2:sort=pid,lat' >> \ |
| 1816 | 1817 | /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/trigger |
| @@ -1960,7 +1961,7 @@ hist trigger specification. · 143 unmodified lines | ||
| 1960 | 1961 | back to that pid, the timestamp difference is calculated. If the |
| 1961 | 1962 | resulting latency, stored in wakeup_lat, exceeds the current |
| 1962 | 1963 | maximum latency, the values specified in the save() fields are |
| 1963 | − recoreded: | |
| 1964 | + recorded: | |
| 1964 | 1965 | |
| 1965 | 1966 | # echo 'hist:keys=pid:ts0=common_timestamp.usecs \ |
| 1966 | 1967 | if comm=="cyclictest"' >> \ |
| @@ -226,7 +226,7 @@ $ rm configs/<config name>.<number>/<function> · 225 unmodified lines | ||
| 226 | 226 | where <config name>.<number> specify the configuration and <function> is |
| 227 | 227 | a symlink to a function being removed from the configuration, e.g.: |
| 228 | 228 | |
| 229 | −$ rm configfs/c.1/ncm.usb0 | |
| 229 | +$ rm configs/c.1/ncm.usb0 | |
| 230 | 230 | |
| 231 | 231 | ... |
| 232 | 232 | ... |
| @@ -4610,7 +4610,7 @@ This capability indicates that kvm will implement the interfaces to handle · 4609 unmodified lines | ||
| 4610 | 4610 | reset, migration and nested KVM for branch prediction blocking. The stfle |
| 4611 | 4611 | facility 82 should not be provided to the guest without this capability. |
| 4612 | 4612 | |
| 4613 | −8.14 KVM_CAP_HYPERV_TLBFLUSH | |
| 4613 | +8.18 KVM_CAP_HYPERV_TLBFLUSH | |
| 4614 | 4614 | |
| 4615 | 4615 | Architectures: x86 |
| 4616 | 4616 | |
| @@ -2971,9 +2971,13 @@ N: bcm585* · 2970 unmodified lines | ||
| 2971 | 2971 | N: bcm586* |
| 2972 | 2972 | N: bcm88312 |
| 2973 | 2973 | N: hr2 |
| 2974 | −F: arch/arm64/boot/dts/broadcom/ns2* | |
| 2974 | +N: stingray | |
| 2975 | +F: arch/arm64/boot/dts/broadcom/northstar2/* | |
| 2976 | +F: arch/arm64/boot/dts/broadcom/stingray/* | |
| 2975 | 2977 | F: drivers/clk/bcm/clk-ns* |
| 2978 | +F: drivers/clk/bcm/clk-sr* | |
| 2976 | 2979 | F: drivers/pinctrl/bcm/pinctrl-ns* |
| 2980 | +F: include/dt-bindings/clock/bcm-sr* | |
| 2977 | 2981 | |
| 2978 | 2982 | BROADCOM KONA GPIO DRIVER |
| 2979 | 2983 | M: Ray Jui <rjui@broadcom.com> |
| @@ -4360,12 +4364,7 @@ L: iommu@lists.linux-foundation.org · 1380 unmodified lines | ||
| 4360 | 4364 | T: git git://git.infradead.org/users/hch/dma-mapping.git |
| 4361 | 4365 | W: http://git.infradead.org/users/hch/dma-mapping.git |
| 4362 | 4366 | S: Supported |
| 4363 | −F: lib/dma-debug.c | |
| 4364 | −F: lib/dma-direct.c | |
| 4365 | −F: lib/dma-noncoherent.c | |
| 4366 | −F: lib/dma-virt.c | |
| 4367 | −F: drivers/base/dma-mapping.c | |
| 4368 | −F: drivers/base/dma-coherent.c | |
| 4367 | +F: kernel/dma/ | |
| 4369 | 4368 | F: include/asm-generic/dma-mapping.h |
| 4370 | 4369 | F: include/linux/dma-direct.h |
| 4371 | 4370 | F: include/linux/dma-mapping.h |
| @@ -5674,7 +5673,7 @@ F: drivers/crypto/caam/ · 1302 unmodified lines | ||
| 5674 | 5673 | F: Documentation/devicetree/bindings/crypto/fsl-sec4.txt |
| 5675 | 5674 | |
| 5676 | 5675 | FREESCALE DIU FRAMEBUFFER DRIVER |
| 5677 | −M: Timur Tabi <timur@tabi.org> | |
| 5676 | +M: Timur Tabi <timur@kernel.org> | |
| 5678 | 5677 | L: linux-fbdev@vger.kernel.org |
| 5679 | 5678 | S: Maintained |
| 5680 | 5679 | F: drivers/video/fbdev/fsl-diu-fb.* |
| @@ -5774,7 +5773,7 @@ S: Maintained · 93 unmodified lines | ||
| 5774 | 5773 | F: drivers/net/wan/fsl_ucc_hdlc* |
| 5775 | 5774 | |
| 5776 | 5775 | FREESCALE QUICC ENGINE UCC UART DRIVER |
| 5777 | −M: Timur Tabi <timur@tabi.org> | |
| 5776 | +M: Timur Tabi <timur@kernel.org> | |
| 5778 | 5777 | L: linuxppc-dev@lists.ozlabs.org |
| 5779 | 5778 | S: Maintained |
| 5780 | 5779 | F: drivers/tty/serial/ucc_uart.c |
| @@ -5798,7 +5797,7 @@ F: drivers/net/ethernet/freescale/fs_enet/ · 17 unmodified lines | ||
| 5798 | 5797 | F: include/linux/fs_enet_pd.h |
| 5799 | 5798 | |
| 5800 | 5799 | FREESCALE SOC SOUND DRIVERS |
| 5801 | −M: Timur Tabi <timur@tabi.org> | |
| 5800 | +M: Timur Tabi <timur@kernel.org> | |
| 5802 | 5801 | M: Nicolin Chen <nicoleotsuka@gmail.com> |
| 5803 | 5802 | M: Xiubo Li <Xiubo.Lee@gmail.com> |
| 5804 | 5803 | R: Fabio Estevam <fabio.estevam@nxp.com> |
| @@ -9756,6 +9755,11 @@ L: linux-scsi@vger.kernel.org · 3951 unmodified lines | ||
| 9756 | 9755 | S: Maintained |
| 9757 | 9756 | F: drivers/scsi/NCR_D700.* |
| 9758 | 9757 | |
| 9758 | +NCSI LIBRARY: | |
| 9759 | +M: Samuel Mendoza-Jonas <sam@mendozajonas.com> | |
| 9760 | +S: Maintained | |
| 9761 | +F: net/ncsi/ | |
| 9762 | + | |
| 9759 | 9763 | NCT6775 HARDWARE MONITOR DRIVER |
| 9760 | 9764 | M: Guenter Roeck <linux@roeck-us.net> |
| 9761 | 9765 | L: linux-hwmon@vger.kernel.org |
| @@ -9882,6 +9886,7 @@ M: Andrew Lunn <andrew@lunn.ch> · 120 unmodified lines | ||
| 9882 | 9886 | M: Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
| 9883 | 9887 | M: Florian Fainelli <f.fainelli@gmail.com> |
| 9884 | 9888 | S: Maintained |
| 9889 | +F: Documentation/devicetree/bindings/net/dsa/ | |
| 9885 | 9890 | F: net/dsa/ |
| 9886 | 9891 | F: include/net/dsa.h |
| 9887 | 9892 | F: include/linux/dsa/ |
| @@ -11476,6 +11481,15 @@ W: http://wireless.kernel.org/en/users/Drivers/p54 · 1588 unmodified lines | ||
| 11476 | 11481 | S: Obsolete |
| 11477 | 11482 | F: drivers/net/wireless/intersil/prism54/ |
| 11478 | 11483 | |
| 11484 | +PROC FILESYSTEM | |
| 11485 | +R: Alexey Dobriyan <adobriyan@gmail.com> | |
| 11486 | +L: linux-kernel@vger.kernel.org | |
| 11487 | +L: linux-fsdevel@vger.kernel.org | |
| 11488 | +S: Maintained | |
| 11489 | +F: fs/proc/ | |
| 11490 | +F: include/linux/proc_fs.h | |
| 11491 | +F: tools/testing/selftests/proc/ | |
| 11492 | + | |
| 11479 | 11493 | PROC SYSCTL |
| 11480 | 11494 | M: "Luis R. Rodriguez" <mcgrof@kernel.org> |
| 11481 | 11495 | M: Kees Cook <keescook@chromium.org> |
| @@ -11808,9 +11822,9 @@ F: Documentation/devicetree/bindings/opp/kryo-cpufreq.txt · 326 unmodified lines | ||
| 11808 | 11822 | F: drivers/cpufreq/qcom-cpufreq-kryo.c |
| 11809 | 11823 | |
| 11810 | 11824 | QUALCOMM EMAC GIGABIT ETHERNET DRIVER |
| 11811 | −M: Timur Tabi <timur@codeaurora.org> | |
| 11825 | +M: Timur Tabi <timur@kernel.org> | |
| 11812 | 11826 | L: netdev@vger.kernel.org |
| 11813 | −S: Supported | |
| 11827 | +S: Maintained | |
| 11814 | 11828 | F: drivers/net/ethernet/qualcomm/emac/ |
| 11815 | 11829 | |
| 11816 | 11830 | QUALCOMM HEXAGON ARCHITECTURE |
| @@ -13648,7 +13662,7 @@ M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> · 1831 unmodified lines | ||
| 13648 | 13662 | L: iommu@lists.linux-foundation.org |
| 13649 | 13663 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git |
| 13650 | 13664 | S: Supported |
| 13651 | −F: lib/swiotlb.c | |
| 13665 | +F: kernel/dma/swiotlb.c | |
| 13652 | 13666 | F: arch/*/kernel/pci-swiotlb.c |
| 13653 | 13667 | F: include/linux/swiotlb.h |
| 13654 | 13668 | |
| @@ -15572,9 +15586,17 @@ M: x86@kernel.org · 1917 unmodified lines | ||
| 15572 | 15586 | L: linux-kernel@vger.kernel.org |
| 15573 | 15587 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core |
| 15574 | 15588 | S: Maintained |
| 15589 | +F: Documentation/devicetree/bindings/x86/ | |
| 15575 | 15590 | F: Documentation/x86/ |
| 15576 | 15591 | F: arch/x86/ |
| 15577 | 15592 | |
| 15593 | +X86 ENTRY CODE | |
| 15594 | +M: Andy Lutomirski <luto@kernel.org> | |
| 15595 | +L: linux-kernel@vger.kernel.org | |
| 15596 | +T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/asm | |
| 15597 | +S: Maintained | |
| 15598 | +F: arch/x86/entry/ | |
| 15599 | + | |
| 15578 | 15600 | X86 MCE INFRASTRUCTURE |
| 15579 | 15601 | M: Tony Luck <tony.luck@intel.com> |
| 15580 | 15602 | M: Borislav Petkov <bp@alien8.de> |
| @@ -15597,7 +15619,7 @@ F: drivers/platform/x86/ · 16 unmodified lines | ||
| 15597 | 15619 | F: drivers/platform/olpc/ |
| 15598 | 15620 | |
| 15599 | 15621 | X86 VDSO |
| 15600 | −M: Andy Lutomirski <luto@amacapital.net> | |
| 15622 | +M: Andy Lutomirski <luto@kernel.org> | |
| 15601 | 15623 | L: linux-kernel@vger.kernel.org |
| 15602 | 15624 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/vdso |
| 15603 | 15625 | S: Maintained |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | VERSION = 4 |
| 3 | 3 | PATCHLEVEL = 18 |
| 4 | 4 | SUBLEVEL = 0 |
| 5 | −EXTRAVERSION = -rc1 | |
| 5 | +EXTRAVERSION = -rc3 | |
| 6 | 6 | NAME = Merciless Moray |
| 7 | 7 | |
| 8 | 8 | # *DOCUMENTATION* |
| @@ -555,11 +555,6 @@ config SMP · 554 unmodified lines | ||
| 555 | 555 | |
| 556 | 556 | If you don't know what to do here, say N. |
| 557 | 557 | |
| 558 | −config HAVE_DEC_LOCK | |
| 559 | − bool | |
| 560 | − depends on SMP | |
| 561 | − default y | |
| 562 | − | |
| 563 | 558 | config NR_CPUS |
| 564 | 559 | int "Maximum number of CPUs (2-32)" |
| 565 | 560 | range 2 32 |
| @@ -35,8 +35,6 @@ lib-y = __divqu.o __remqu.o __divlu.o __remlu.o \ · 34 unmodified lines | ||
| 35 | 35 | callback_srm.o srm_puts.o srm_printk.o \ |
| 36 | 36 | fls.o |
| 37 | 37 | |
| 38 | −lib-$(CONFIG_SMP) += dec_and_lock.o | |
| 39 | − | |
| 40 | 38 | # The division routines are built from single source, with different defines. |
| 41 | 39 | AFLAGS___divqu.o = -DDIV |
| 42 | 40 | AFLAGS___remqu.o = -DREM |
| @@ -1,44 +0,0 @@ | ||
| 1 | −// SPDX-License-Identifier: GPL-2.0 | |
| 2 | −/* | |
| 3 | − * arch/alpha/lib/dec_and_lock.c | |
| 4 | − * | |
| 5 | − * ll/sc version of atomic_dec_and_lock() | |
| 6 | − * | |
| 7 | − */ | |
| 8 | − | |
| 9 | −#include <linux/spinlock.h> | |
| 10 | −#include <linux/atomic.h> | |
| 11 | −#include <linux/export.h> | |
| 12 | − | |
| 13 | − asm (".text \n\ | |
| 14 | − .global _atomic_dec_and_lock \n\ | |
| 15 | − .ent _atomic_dec_and_lock \n\ | |
| 16 | − .align 4 \n\ | |
| 17 | −_atomic_dec_and_lock: \n\ | |
| 18 | − .prologue 0 \n\ | |
| 19 | −1: ldl_l $1, 0($16) \n\ | |
| 20 | − subl $1, 1, $1 \n\ | |
| 21 | − beq $1, 2f \n\ | |
| 22 | − stl_c $1, 0($16) \n\ | |
| 23 | − beq $1, 4f \n\ | |
| 24 | − mb \n\ | |
| 25 | − clr $0 \n\ | |
| 26 | − ret \n\ | |
| 27 | −2: br $29, 3f \n\ | |
| 28 | −3: ldgp $29, 0($29) \n\ | |
| 29 | − br $atomic_dec_and_lock_1..ng \n\ | |
| 30 | − .subsection 2 \n\ | |
| 31 | −4: br 1b \n\ | |
| 32 | − .previous \n\ | |
| 33 | − .end _atomic_dec_and_lock"); | |
| 34 | − | |
| 35 | −static int __used atomic_dec_and_lock_1(atomic_t *atomic, spinlock_t *lock) | |
| 36 | −{ | |
| 37 | − /* Slow path */ | |
| 38 | − spin_lock(lock); | |
| 39 | − if (atomic_dec_and_test(atomic)) | |
| 40 | − return 1; | |
| 41 | − spin_unlock(lock); | |
| 42 | − return 0; | |
| 43 | −} | |
| 44 | −EXPORT_SYMBOL(_atomic_dec_and_lock); | |
| @@ -1245,8 +1245,14 @@ config PCI · 1244 unmodified lines | ||
| 1245 | 1245 | VESA. If you have PCI, say Y, otherwise N. |
| 1246 | 1246 | |
| 1247 | 1247 | config PCI_DOMAINS |
| 1248 | − bool | |
| 1248 | + bool "Support for multiple PCI domains" | |
| 1249 | 1249 | depends on PCI |
| 1250 | + help | |
| 1251 | + Enable PCI domains kernel management. Say Y if your machine | |
| 1252 | + has a PCI bus hierarchy that requires more than one PCI | |
| 1253 | + domain (aka segment) to be correctly managed. Say N otherwise. | |
| 1254 | + | |
| 1255 | + If you don't know what to do here, say N. | |
| 1250 | 1256 | |
| 1251 | 1257 | config PCI_DOMAINS_GENERIC |
| 1252 | 1258 | def_bool PCI_DOMAINS |
| @@ -139,7 +139,7 @@ · 138 unmodified lines | ||
| 139 | 139 | 3700 5 |
| 140 | 140 | 3900 6 |
| 141 | 141 | 4000 7>; |
| 142 | − cooling-cells = <2>; | |
| 142 | + #cooling-cells = <2>; | |
| 143 | 143 | }; |
| 144 | 144 | |
| 145 | 145 | gpio-leds { |
| @@ -216,7 +216,7 @@ · 215 unmodified lines | ||
| 216 | 216 | reg = <0x18008000 0x100>; |
| 217 | 217 | #address-cells = <1>; |
| 218 | 218 | #size-cells = <0>; |
| 219 | − interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>; | |
| 219 | + interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>; | |
| 220 | 220 | clock-frequency = <100000>; |
| 221 | 221 | status = "disabled"; |
| 222 | 222 | }; |
| @@ -245,7 +245,7 @@ · 22 unmodified lines | ||
| 245 | 245 | reg = <0x1800b000 0x100>; |
| 246 | 246 | #address-cells = <1>; |
| 247 | 247 | #size-cells = <0>; |
| 248 | − interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>; | |
| 248 | + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; | |
| 249 | 249 | clock-frequency = <100000>; |
| 250 | 250 | status = "disabled"; |
| 251 | 251 | }; |
| @@ -256,7 +256,7 @@ · 4 unmodified lines | ||
| 256 | 256 | |
| 257 | 257 | #interrupt-cells = <1>; |
| 258 | 258 | interrupt-map-mask = <0 0 0 0>; |
| 259 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_NONE>; | |
| 259 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>; | |
| 260 | 260 | |
| 261 | 261 | linux,pci-domain = <0>; |
| 262 | 262 | |
| @@ -278,10 +278,10 @@ · 15 unmodified lines | ||
| 278 | 278 | compatible = "brcm,iproc-msi"; |
| 279 | 279 | msi-controller; |
| 280 | 280 | interrupt-parent = <&gic>; |
| 281 | − interrupts = <GIC_SPI 96 IRQ_TYPE_NONE>, | |
| 282 | − <GIC_SPI 97 IRQ_TYPE_NONE>, | |
| 283 | − <GIC_SPI 98 IRQ_TYPE_NONE>, | |
| 284 | − <GIC_SPI 99 IRQ_TYPE_NONE>; | |
| 281 | + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>, | |
| 282 | + <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>, | |
| 283 | + <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>, | |
| 284 | + <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; | |
| 285 | 285 | }; |
| 286 | 286 | }; |
| 287 | 287 | |
| @@ -291,7 +291,7 @@ · 3 unmodified lines | ||
| 291 | 291 | |
| 292 | 292 | #interrupt-cells = <1>; |
| 293 | 293 | interrupt-map-mask = <0 0 0 0>; |
| 294 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_NONE>; | |
| 294 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>; | |
| 295 | 295 | |
| 296 | 296 | linux,pci-domain = <1>; |
| 297 | 297 | |
| @@ -313,10 +313,10 @@ · 15 unmodified lines | ||
| 313 | 313 | compatible = "brcm,iproc-msi"; |
| 314 | 314 | msi-controller; |
| 315 | 315 | interrupt-parent = <&gic>; |
| 316 | − interrupts = <GIC_SPI 102 IRQ_TYPE_NONE>, | |
| 317 | − <GIC_SPI 103 IRQ_TYPE_NONE>, | |
| 318 | − <GIC_SPI 104 IRQ_TYPE_NONE>, | |
| 319 | − <GIC_SPI 105 IRQ_TYPE_NONE>; | |
| 316 | + interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>, | |
| 317 | + <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>, | |
| 318 | + <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>, | |
| 319 | + <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; | |
| 320 | 320 | }; |
| 321 | 321 | }; |
| 322 | 322 | |
| @@ -264,7 +264,7 @@ · 263 unmodified lines | ||
| 264 | 264 | reg = <0x38000 0x50>; |
| 265 | 265 | #address-cells = <1>; |
| 266 | 266 | #size-cells = <0>; |
| 267 | − interrupts = <GIC_SPI 95 IRQ_TYPE_NONE>; | |
| 267 | + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; | |
| 268 | 268 | clock-frequency = <100000>; |
| 269 | 269 | }; |
| 270 | 270 | |
| @@ -279,7 +279,7 @@ · 8 unmodified lines | ||
| 279 | 279 | reg = <0x3b000 0x50>; |
| 280 | 280 | #address-cells = <1>; |
| 281 | 281 | #size-cells = <0>; |
| 282 | − interrupts = <GIC_SPI 96 IRQ_TYPE_NONE>; | |
| 282 | + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; | |
| 283 | 283 | clock-frequency = <100000>; |
| 284 | 284 | }; |
| 285 | 285 | }; |
| @@ -300,7 +300,7 @@ · 14 unmodified lines | ||
| 300 | 300 | |
| 301 | 301 | #interrupt-cells = <1>; |
| 302 | 302 | interrupt-map-mask = <0 0 0 0>; |
| 303 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 186 IRQ_TYPE_NONE>; | |
| 303 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>; | |
| 304 | 304 | |
| 305 | 305 | linux,pci-domain = <0>; |
| 306 | 306 | |
| @@ -322,10 +322,10 @@ · 15 unmodified lines | ||
| 322 | 322 | compatible = "brcm,iproc-msi"; |
| 323 | 323 | msi-controller; |
| 324 | 324 | interrupt-parent = <&gic>; |
| 325 | − interrupts = <GIC_SPI 182 IRQ_TYPE_NONE>, | |
| 326 | − <GIC_SPI 183 IRQ_TYPE_NONE>, | |
| 327 | − <GIC_SPI 184 IRQ_TYPE_NONE>, | |
| 328 | − <GIC_SPI 185 IRQ_TYPE_NONE>; | |
| 325 | + interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>, | |
| 326 | + <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>, | |
| 327 | + <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>, | |
| 328 | + <GIC_SPI 185 IRQ_TYPE_LEVEL_HIGH>; | |
| 329 | 329 | brcm,pcie-msi-inten; |
| 330 | 330 | }; |
| 331 | 331 | }; |
| @@ -336,7 +336,7 @@ · 4 unmodified lines | ||
| 336 | 336 | |
| 337 | 337 | #interrupt-cells = <1>; |
| 338 | 338 | interrupt-map-mask = <0 0 0 0>; |
| 339 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 192 IRQ_TYPE_NONE>; | |
| 339 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>; | |
| 340 | 340 | |
| 341 | 341 | linux,pci-domain = <1>; |
| 342 | 342 | |
| @@ -358,10 +358,10 @@ · 15 unmodified lines | ||
| 358 | 358 | compatible = "brcm,iproc-msi"; |
| 359 | 359 | msi-controller; |
| 360 | 360 | interrupt-parent = <&gic>; |
| 361 | − interrupts = <GIC_SPI 188 IRQ_TYPE_NONE>, | |
| 362 | − <GIC_SPI 189 IRQ_TYPE_NONE>, | |
| 363 | − <GIC_SPI 190 IRQ_TYPE_NONE>, | |
| 364 | − <GIC_SPI 191 IRQ_TYPE_NONE>; | |
| 361 | + interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>, | |
| 362 | + <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>, | |
| 363 | + <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>, | |
| 364 | + <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>; | |
| 365 | 365 | brcm,pcie-msi-inten; |
| 366 | 366 | }; |
| 367 | 367 | }; |
| @@ -391,7 +391,7 @@ · 390 unmodified lines | ||
| 391 | 391 | reg = <0x38000 0x50>; |
| 392 | 392 | #address-cells = <1>; |
| 393 | 393 | #size-cells = <0>; |
| 394 | − interrupts = <GIC_SPI 89 IRQ_TYPE_NONE>; | |
| 394 | + interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>; | |
| 395 | 395 | clock-frequency = <100000>; |
| 396 | 396 | dma-coherent; |
| 397 | 397 | status = "disabled"; |
| @@ -496,7 +496,7 @@ · 98 unmodified lines | ||
| 496 | 496 | |
| 497 | 497 | #interrupt-cells = <1>; |
| 498 | 498 | interrupt-map-mask = <0 0 0 0>; |
| 499 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 131 IRQ_TYPE_NONE>; | |
| 499 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>; | |
| 500 | 500 | |
| 501 | 501 | linux,pci-domain = <0>; |
| 502 | 502 | |
| @@ -519,10 +519,10 @@ · 16 unmodified lines | ||
| 519 | 519 | compatible = "brcm,iproc-msi"; |
| 520 | 520 | msi-controller; |
| 521 | 521 | interrupt-parent = <&gic>; |
| 522 | − interrupts = <GIC_SPI 127 IRQ_TYPE_NONE>, | |
| 523 | − <GIC_SPI 128 IRQ_TYPE_NONE>, | |
| 524 | − <GIC_SPI 129 IRQ_TYPE_NONE>, | |
| 525 | − <GIC_SPI 130 IRQ_TYPE_NONE>; | |
| 522 | + interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>, | |
| 523 | + <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>, | |
| 524 | + <GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>, | |
| 525 | + <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>; | |
| 526 | 526 | brcm,pcie-msi-inten; |
| 527 | 527 | }; |
| 528 | 528 | }; |
| @@ -533,7 +533,7 @@ · 4 unmodified lines | ||
| 533 | 533 | |
| 534 | 534 | #interrupt-cells = <1>; |
| 535 | 535 | interrupt-map-mask = <0 0 0 0>; |
| 536 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 137 IRQ_TYPE_NONE>; | |
| 536 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>; | |
| 537 | 537 | |
| 538 | 538 | linux,pci-domain = <1>; |
| 539 | 539 | |
| @@ -556,10 +556,10 @@ · 16 unmodified lines | ||
| 556 | 556 | compatible = "brcm,iproc-msi"; |
| 557 | 557 | msi-controller; |
| 558 | 558 | interrupt-parent = <&gic>; |
| 559 | − interrupts = <GIC_SPI 133 IRQ_TYPE_NONE>, | |
| 560 | − <GIC_SPI 134 IRQ_TYPE_NONE>, | |
| 561 | − <GIC_SPI 135 IRQ_TYPE_NONE>, | |
| 562 | − <GIC_SPI 136 IRQ_TYPE_NONE>; | |
| 559 | + interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>, | |
| 560 | + <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>, | |
| 561 | + <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>, | |
| 562 | + <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>; | |
| 563 | 563 | brcm,pcie-msi-inten; |
| 564 | 564 | }; |
| 565 | 565 | }; |
| @@ -570,7 +570,7 @@ · 4 unmodified lines | ||
| 570 | 570 | |
| 571 | 571 | #interrupt-cells = <1>; |
| 572 | 572 | interrupt-map-mask = <0 0 0 0>; |
| 573 | − interrupt-map = <0 0 0 0 &gic GIC_SPI 143 IRQ_TYPE_NONE>; | |
| 573 | + interrupt-map = <0 0 0 0 &gic GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; | |
| 574 | 574 | |
| 575 | 575 | linux,pci-domain = <2>; |
| 576 | 576 | |
| @@ -593,10 +593,10 @@ · 16 unmodified lines | ||
| 593 | 593 | compatible = "brcm,iproc-msi"; |
| 594 | 594 | msi-controller; |
| 595 | 595 | interrupt-parent = <&gic>; |
| 596 | − interrupts = <GIC_SPI 139 IRQ_TYPE_NONE>, | |
| 597 | − <GIC_SPI 140 IRQ_TYPE_NONE>, | |
| 598 | − <GIC_SPI 141 IRQ_TYPE_NONE>, | |
| 599 | − <GIC_SPI 142 IRQ_TYPE_NONE>; | |
| 596 | + interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>, | |
| 597 | + <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>, | |
| 598 | + <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>, | |
| 599 | + <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>; | |
| 600 | 600 | brcm,pcie-msi-inten; |
| 601 | 601 | }; |
| 602 | 602 | }; |
| @@ -365,7 +365,7 @@ · 364 unmodified lines | ||
| 365 | 365 | i2c0: i2c@18009000 { |
| 366 | 366 | compatible = "brcm,iproc-i2c"; |
| 367 | 367 | reg = <0x18009000 0x50>; |
| 368 | − interrupts = <GIC_SPI 121 IRQ_TYPE_NONE>; | |
| 368 | + interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>; | |
| 369 | 369 | #address-cells = <1>; |
| 370 | 370 | #size-cells = <0>; |
| 371 | 371 | clock-frequency = <100000>; |
| @@ -549,11 +549,7 @@ · 548 unmodified lines | ||
| 549 | 549 | gpio-controller; |
| 550 | 550 | #gpio-cells = <2>; |
| 551 | 551 | reg = <0x226000 0x1000>; |
| 552 | − interrupts = <42 IRQ_TYPE_EDGE_BOTH | |
| 553 | − 43 IRQ_TYPE_EDGE_BOTH 44 IRQ_TYPE_EDGE_BOTH | |
| 554 | − 45 IRQ_TYPE_EDGE_BOTH 46 IRQ_TYPE_EDGE_BOTH | |
| 555 | − 47 IRQ_TYPE_EDGE_BOTH 48 IRQ_TYPE_EDGE_BOTH | |
| 556 | − 49 IRQ_TYPE_EDGE_BOTH 50 IRQ_TYPE_EDGE_BOTH>; | |
| 552 | + interrupts = <42 43 44 45 46 47 48 49 50>; | |
| 557 | 553 | ti,ngpio = <144>; |
| 558 | 554 | ti,davinci-gpio-unbanked = <0>; |
| 559 | 555 | status = "disabled"; |
| @@ -90,7 +90,7 @@ · 89 unmodified lines | ||
| 90 | 90 | clocks = <&clks IMX6Q_CLK_ECSPI5>, |
| 91 | 91 | <&clks IMX6Q_CLK_ECSPI5>; |
| 92 | 92 | clock-names = "ipg", "per"; |
| 93 | − dmas = <&sdma 11 7 1>, <&sdma 12 7 2>; | |
| 93 | + dmas = <&sdma 11 8 1>, <&sdma 12 8 2>; | |
| 94 | 94 | dma-names = "rx", "tx"; |
| 95 | 95 | status = "disabled"; |
| 96 | 96 | }; |
| @@ -1344,7 +1344,7 @@ · 1343 unmodified lines | ||
| 1344 | 1344 | ranges = <0x81000000 0 0 0x08f80000 0 0x00010000 /* downstream I/O */ |
| 1345 | 1345 | 0x82000000 0 0x08000000 0x08000000 0 0x00f00000>; /* non-prefetchable memory */ |
| 1346 | 1346 | num-lanes = <1>; |
| 1347 | − interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>; | |
| 1347 | + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; | |
| 1348 | 1348 | interrupt-names = "msi"; |
| 1349 | 1349 | #interrupt-cells = <1>; |
| 1350 | 1350 | interrupt-map-mask = <0 0 0 0x7>; |
| @@ -748,13 +748,13 @@ · 747 unmodified lines | ||
| 748 | 748 | nand0: nand@ff900000 { |
| 749 | 749 | #address-cells = <0x1>; |
| 750 | 750 | #size-cells = <0x1>; |
| 751 | − compatible = "denali,denali-nand-dt"; | |
| 751 | + compatible = "altr,socfpga-denali-nand"; | |
| 752 | 752 | reg = <0xff900000 0x100000>, |
| 753 | 753 | <0xffb80000 0x10000>; |
| 754 | 754 | reg-names = "nand_data", "denali_reg"; |
| 755 | 755 | interrupts = <0x0 0x90 0x4>; |
| 756 | 756 | dma-mask = <0xffffffff>; |
| 757 | − clocks = <&nand_clk>; | |
| 757 | + clocks = <&nand_x_clk>; | |
| 758 | 758 | status = "disabled"; |
| 759 | 759 | }; |
| 760 | 760 | |
| @@ -593,8 +593,7 @@ · 592 unmodified lines | ||
| 593 | 593 | #size-cells = <0>; |
| 594 | 594 | reg = <0xffda5000 0x100>; |
| 595 | 595 | interrupts = <0 102 4>; |
| 596 | − num-chipselect = <4>; | |
| 597 | − bus-num = <0>; | |
| 596 | + num-cs = <4>; | |
| 598 | 597 | /*32bit_access;*/ |
| 599 | 598 | tx-dma-channel = <&pdma 16>; |
| 600 | 599 | rx-dma-channel = <&pdma 17>; |
| @@ -633,7 +632,7 @@ · 32 unmodified lines | ||
| 633 | 632 | nand: nand@ffb90000 { |
| 634 | 633 | #address-cells = <1>; |
| 635 | 634 | #size-cells = <1>; |
| 636 | − compatible = "denali,denali-nand-dt", "altr,socfpga-denali-nand"; | |
| 635 | + compatible = "altr,socfpga-denali-nand"; | |
| 637 | 636 | reg = <0xffb90000 0x72000>, |
| 638 | 637 | <0xffb80000 0x10000>; |
| 639 | 638 | reg-names = "nand_data", "denali_reg"; |
| @@ -10,7 +10,7 @@ obj-$(CONFIG_DMABOUNCE) += dmabounce.o · 9 unmodified lines | ||
| 10 | 10 | obj-$(CONFIG_SHARP_LOCOMO) += locomo.o |
| 11 | 11 | obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o |
| 12 | 12 | obj-$(CONFIG_SHARP_SCOOP) += scoop.o |
| 13 | −obj-$(CONFIG_SMP) += secure_cntvoff.o | |
| 13 | +obj-$(CONFIG_CPU_V7) += secure_cntvoff.o | |
| 14 | 14 | obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o |
| 15 | 15 | obj-$(CONFIG_MCPM) += mcpm_head.o mcpm_entry.o mcpm_platsmp.o vlock.o |
| 16 | 16 | CFLAGS_REMOVE_mcpm_entry.o = -pg |
| @@ -1,5 +1,4 @@ | ||
| 1 | 1 | CONFIG_SYSVIPC=y |
| 2 | −CONFIG_FHANDLE=y | |
| 3 | 2 | CONFIG_NO_HZ=y |
| 4 | 3 | CONFIG_HIGH_RES_TIMERS=y |
| 5 | 4 | CONFIG_CGROUPS=y |
| @@ -10,20 +9,10 @@ CONFIG_MODULES=y · 4 unmodified lines | ||
| 10 | 9 | CONFIG_MODULE_UNLOAD=y |
| 11 | 10 | CONFIG_PARTITION_ADVANCED=y |
| 12 | 11 | CONFIG_CMDLINE_PARTITION=y |
| 13 | −CONFIG_ARCH_MULTI_V7=y | |
| 14 | −# CONFIG_ARCH_MULTI_V5 is not set | |
| 15 | −# CONFIG_ARCH_MULTI_V4 is not set | |
| 16 | 12 | CONFIG_ARCH_VIRT=y |
| 17 | 13 | CONFIG_ARCH_ALPINE=y |
| 18 | 14 | CONFIG_ARCH_ARTPEC=y |
| 19 | 15 | CONFIG_MACH_ARTPEC6=y |
| 20 | −CONFIG_ARCH_MVEBU=y | |
| 21 | −CONFIG_MACH_ARMADA_370=y | |
| 22 | −CONFIG_MACH_ARMADA_375=y | |
| 23 | −CONFIG_MACH_ARMADA_38X=y | |
| 24 | −CONFIG_MACH_ARMADA_39X=y | |
| 25 | −CONFIG_MACH_ARMADA_XP=y | |
| 26 | −CONFIG_MACH_DOVE=y | |
| 27 | 16 | CONFIG_ARCH_AT91=y |
| 28 | 17 | CONFIG_SOC_SAMA5D2=y |
| 29 | 18 | CONFIG_SOC_SAMA5D3=y |
| @@ -32,9 +21,9 @@ CONFIG_ARCH_BCM=y · 2 unmodified lines | ||
| 32 | 21 | CONFIG_ARCH_BCM_CYGNUS=y |
| 33 | 22 | CONFIG_ARCH_BCM_HR2=y |
| 34 | 23 | CONFIG_ARCH_BCM_NSP=y |
| 35 | −CONFIG_ARCH_BCM_21664=y | |
| 36 | −CONFIG_ARCH_BCM_281XX=y | |
| 37 | 24 | CONFIG_ARCH_BCM_5301X=y |
| 25 | +CONFIG_ARCH_BCM_281XX=y | |
| 26 | +CONFIG_ARCH_BCM_21664=y | |
| 38 | 27 | CONFIG_ARCH_BCM2835=y |
| 39 | 28 | CONFIG_ARCH_BCM_63XX=y |
| 40 | 29 | CONFIG_ARCH_BRCMSTB=y |
| @@ -43,14 +32,14 @@ CONFIG_MACH_BERLIN_BG2=y · 2 unmodified lines | ||
| 43 | 32 | CONFIG_MACH_BERLIN_BG2CD=y |
| 44 | 33 | CONFIG_MACH_BERLIN_BG2Q=y |
| 45 | 34 | CONFIG_ARCH_DIGICOLOR=y |
| 35 | +CONFIG_ARCH_EXYNOS=y | |
| 36 | +CONFIG_EXYNOS5420_MCPM=y | |
| 46 | 37 | CONFIG_ARCH_HIGHBANK=y |
| 47 | 38 | CONFIG_ARCH_HISI=y |
| 48 | 39 | CONFIG_ARCH_HI3xxx=y |
| 49 | −CONFIG_ARCH_HIX5HD2=y | |
| 50 | 40 | CONFIG_ARCH_HIP01=y |
| 51 | 41 | CONFIG_ARCH_HIP04=y |
| 52 | −CONFIG_ARCH_KEYSTONE=y | |
| 53 | −CONFIG_ARCH_MESON=y | |
| 42 | +CONFIG_ARCH_HIX5HD2=y | |
| 54 | 43 | CONFIG_ARCH_MXC=y |
| 55 | 44 | CONFIG_SOC_IMX50=y |
| 56 | 45 | CONFIG_SOC_IMX51=y |
| @@ -60,29 +49,30 @@ CONFIG_SOC_IMX6SL=y · 3 unmodified lines | ||
| 60 | 49 | CONFIG_SOC_IMX6SX=y |
| 61 | 50 | CONFIG_SOC_IMX6UL=y |
| 62 | 51 | CONFIG_SOC_IMX7D=y |
| 63 | −CONFIG_SOC_VF610=y | |
| 64 | 52 | CONFIG_SOC_LS1021A=y |
| 53 | +CONFIG_SOC_VF610=y | |
| 54 | +CONFIG_ARCH_KEYSTONE=y | |
| 55 | +CONFIG_ARCH_MEDIATEK=y | |
| 56 | +CONFIG_ARCH_MESON=y | |
| 57 | +CONFIG_ARCH_MVEBU=y | |
| 58 | +CONFIG_MACH_ARMADA_370=y | |
| 59 | +CONFIG_MACH_ARMADA_375=y | |
| 60 | +CONFIG_MACH_ARMADA_38X=y | |
| 61 | +CONFIG_MACH_ARMADA_39X=y | |
| 62 | +CONFIG_MACH_ARMADA_XP=y | |
| 63 | +CONFIG_MACH_DOVE=y | |
| 65 | 64 | CONFIG_ARCH_OMAP3=y |
| 66 | 65 | CONFIG_ARCH_OMAP4=y |
| 67 | 66 | CONFIG_SOC_OMAP5=y |
| 68 | 67 | CONFIG_SOC_AM33XX=y |
| 69 | 68 | CONFIG_SOC_AM43XX=y |
| 70 | 69 | CONFIG_SOC_DRA7XX=y |
| 70 | +CONFIG_ARCH_SIRF=y | |
| 71 | 71 | CONFIG_ARCH_QCOM=y |
| 72 | −CONFIG_ARCH_MEDIATEK=y | |
| 73 | 72 | CONFIG_ARCH_MSM8X60=y |
| 74 | 73 | CONFIG_ARCH_MSM8960=y |
| 75 | 74 | CONFIG_ARCH_MSM8974=y |
| 76 | 75 | CONFIG_ARCH_ROCKCHIP=y |
| 77 | −CONFIG_ARCH_SOCFPGA=y | |
| 78 | −CONFIG_PLAT_SPEAR=y | |
| 79 | −CONFIG_ARCH_SPEAR13XX=y | |
| 80 | −CONFIG_MACH_SPEAR1310=y | |
| 81 | −CONFIG_MACH_SPEAR1340=y | |
| 82 | −CONFIG_ARCH_STI=y | |
| 83 | −CONFIG_ARCH_STM32=y | |
| 84 | −CONFIG_ARCH_EXYNOS=y | |
| 85 | −CONFIG_EXYNOS5420_MCPM=y | |
| 86 | 76 | CONFIG_ARCH_RENESAS=y |
| 87 | 77 | CONFIG_ARCH_EMEV2=y |
| 88 | 78 | CONFIG_ARCH_R7S72100=y |
| @@ -99,40 +89,33 @@ CONFIG_ARCH_R8A7792=y · 10 unmodified lines | ||
| 99 | 89 | CONFIG_ARCH_R8A7793=y |
| 100 | 90 | CONFIG_ARCH_R8A7794=y |
| 101 | 91 | CONFIG_ARCH_SH73A0=y |
| 92 | +CONFIG_ARCH_SOCFPGA=y | |
| 93 | +CONFIG_PLAT_SPEAR=y | |
| 94 | +CONFIG_ARCH_SPEAR13XX=y | |
| 95 | +CONFIG_MACH_SPEAR1310=y | |
| 96 | +CONFIG_MACH_SPEAR1340=y | |
| 97 | +CONFIG_ARCH_STI=y | |
| 98 | +CONFIG_ARCH_STM32=y | |
| 102 | 99 | CONFIG_ARCH_SUNXI=y |
| 103 | −CONFIG_ARCH_SIRF=y | |
| 104 | 100 | CONFIG_ARCH_TEGRA=y |
| 105 | −CONFIG_ARCH_TEGRA_2x_SOC=y | |
| 106 | −CONFIG_ARCH_TEGRA_3x_SOC=y | |
| 107 | −CONFIG_ARCH_TEGRA_114_SOC=y | |
| 108 | −CONFIG_ARCH_TEGRA_124_SOC=y | |
| 109 | 101 | CONFIG_ARCH_UNIPHIER=y |
| 110 | 102 | CONFIG_ARCH_U8500=y |
| 111 | −CONFIG_MACH_HREFV60=y | |
| 112 | −CONFIG_MACH_SNOWBALL=y | |
| 113 | 103 | CONFIG_ARCH_VEXPRESS=y |
| 114 | 104 | CONFIG_ARCH_VEXPRESS_TC2_PM=y |
| 115 | 105 | CONFIG_ARCH_WM8850=y |
| 116 | 106 | CONFIG_ARCH_ZYNQ=y |
| 117 | −CONFIG_TRUSTED_FOUNDATIONS=y | |
| 118 | −CONFIG_PCI=y | |
| 119 | −CONFIG_PCI_HOST_GENERIC=y | |
| 120 | −CONFIG_PCI_DRA7XX=y | |
| 121 | −CONFIG_PCI_DRA7XX_EP=y | |
| 122 | −CONFIG_PCI_KEYSTONE=y | |
| 123 | −CONFIG_PCI_MSI=y | |
| 107 | +CONFIG_PCIEPORTBUS=y | |
| 124 | 108 | CONFIG_PCI_MVEBU=y |
| 125 | 109 | CONFIG_PCI_TEGRA=y |
| 126 | 110 | CONFIG_PCI_RCAR_GEN2=y |
| 127 | 111 | CONFIG_PCIE_RCAR=y |
| 128 | −CONFIG_PCIEPORTBUS=y | |
| 112 | +CONFIG_PCI_DRA7XX_EP=y | |
| 113 | +CONFIG_PCI_KEYSTONE=y | |
| 129 | 114 | CONFIG_PCI_ENDPOINT=y |
| 130 | 115 | CONFIG_PCI_ENDPOINT_CONFIGFS=y |
| 131 | 116 | CONFIG_PCI_EPF_TEST=m |
| 132 | 117 | CONFIG_SMP=y |
| 133 | 118 | CONFIG_NR_CPUS=16 |
| 134 | −CONFIG_HIGHPTE=y | |
| 135 | −CONFIG_CMA=y | |
| 136 | 119 | CONFIG_SECCOMP=y |
| 137 | 120 | CONFIG_ARM_APPENDED_DTB=y |
| 138 | 121 | CONFIG_ARM_ATAG_DTB_COMPAT=y |
| @@ -145,14 +128,14 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=m · 6 unmodified lines | ||
| 145 | 128 | CONFIG_CPU_FREQ_GOV_USERSPACE=m |
| 146 | 129 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m |
| 147 | 130 | CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y |
| 131 | +CONFIG_CPUFREQ_DT=y | |
| 148 | 132 | CONFIG_ARM_IMX6Q_CPUFREQ=y |
| 149 | 133 | CONFIG_QORIQ_CPUFREQ=y |
| 150 | 134 | CONFIG_CPU_IDLE=y |
| 151 | 135 | CONFIG_ARM_CPUIDLE=y |
| 152 | −CONFIG_NEON=y | |
| 153 | −CONFIG_KERNEL_MODE_NEON=y | |
| 154 | 136 | CONFIG_ARM_ZYNQ_CPUIDLE=y |
| 155 | 137 | CONFIG_ARM_EXYNOS_CPUIDLE=y |
| 138 | +CONFIG_KERNEL_MODE_NEON=y | |
| 156 | 139 | CONFIG_NET=y |
| 157 | 140 | CONFIG_PACKET=y |
| 158 | 141 | CONFIG_UNIX=y |
| @@ -170,23 +153,13 @@ CONFIG_IPV6_MIP6=m · 11 unmodified lines | ||
| 170 | 153 | CONFIG_IPV6_TUNNEL=m |
| 171 | 154 | CONFIG_IPV6_MULTIPLE_TABLES=y |
| 172 | 155 | CONFIG_NET_DSA=m |
| 173 | −CONFIG_NET_SWITCHDEV=y | |
| 174 | 156 | CONFIG_CAN=y |
| 175 | −CONFIG_CAN_RAW=y | |
| 176 | −CONFIG_CAN_BCM=y | |
| 177 | −CONFIG_CAN_DEV=y | |
| 178 | 157 | CONFIG_CAN_AT91=m |
| 179 | 158 | CONFIG_CAN_FLEXCAN=m |
| 180 | −CONFIG_CAN_RCAR=m | |
| 159 | +CONFIG_CAN_SUN4I=y | |
| 181 | 160 | CONFIG_CAN_XILINXCAN=y |
| 161 | +CONFIG_CAN_RCAR=m | |
| 182 | 162 | CONFIG_CAN_MCP251X=y |
| 183 | −CONFIG_NET_DSA_BCM_SF2=m | |
| 184 | −CONFIG_B53=m | |
| 185 | −CONFIG_B53_SPI_DRIVER=m | |
| 186 | −CONFIG_B53_MDIO_DRIVER=m | |
| 187 | −CONFIG_B53_MMAP_DRIVER=m | |
| 188 | −CONFIG_B53_SRAB_DRIVER=m | |
| 189 | −CONFIG_CAN_SUN4I=y | |
| 190 | 163 | CONFIG_BT=m |
| 191 | 164 | CONFIG_BT_HCIUART=m |
| 192 | 165 | CONFIG_BT_HCIUART_BCM=y |
| @@ -199,11 +172,9 @@ CONFIG_RFKILL_INPUT=y · 6 unmodified lines | ||
| 199 | 172 | CONFIG_RFKILL_GPIO=y |
| 200 | 173 | CONFIG_DEVTMPFS=y |
| 201 | 174 | CONFIG_DEVTMPFS_MOUNT=y |
| 202 | −CONFIG_DMA_CMA=y | |
| 203 | 175 | CONFIG_CMA_SIZE_MBYTES=64 |
| 204 | 176 | CONFIG_OMAP_OCP2SCP=y |
| 205 | 177 | CONFIG_SIMPLE_PM_BUS=y |
| 206 | −CONFIG_SUNXI_RSB=y | |
| 207 | 178 | CONFIG_MTD=y |
| 208 | 179 | CONFIG_MTD_CMDLINE_PARTS=y |
| 209 | 180 | CONFIG_MTD_BLOCK=y |
| @@ -236,7 +207,6 @@ CONFIG_PCI_ENDPOINT_TEST=m · 26 unmodified lines | ||
| 236 | 207 | CONFIG_EEPROM_AT24=y |
| 237 | 208 | CONFIG_BLK_DEV_SD=y |
| 238 | 209 | CONFIG_BLK_DEV_SR=y |
| 239 | −CONFIG_SCSI_MULTI_LUN=y | |
| 240 | 210 | CONFIG_ATA=y |
| 241 | 211 | CONFIG_SATA_AHCI=y |
| 242 | 212 | CONFIG_SATA_AHCI_PLATFORM=y |
| @@ -251,14 +221,20 @@ CONFIG_SATA_MV=y · 8 unmodified lines | ||
| 251 | 221 | CONFIG_SATA_RCAR=y |
| 252 | 222 | CONFIG_NETDEVICES=y |
| 253 | 223 | CONFIG_VIRTIO_NET=y |
| 254 | −CONFIG_HIX5HD2_GMAC=y | |
| 224 | +CONFIG_B53_SPI_DRIVER=m | |
| 225 | +CONFIG_B53_MDIO_DRIVER=m | |
| 226 | +CONFIG_B53_MMAP_DRIVER=m | |
| 227 | +CONFIG_B53_SRAB_DRIVER=m | |
| 228 | +CONFIG_NET_DSA_BCM_SF2=m | |
| 255 | 229 | CONFIG_SUN4I_EMAC=y |
| 256 | −CONFIG_MACB=y | |
| 257 | 230 | CONFIG_BCMGENET=m |
| 258 | 231 | CONFIG_BGMAC_BCMA=y |
| 259 | 232 | CONFIG_SYSTEMPORT=m |
| 233 | +CONFIG_MACB=y | |
| 260 | 234 | CONFIG_NET_CALXEDA_XGMAC=y |
| 261 | 235 | CONFIG_GIANFAR=y |
| 236 | +CONFIG_HIX5HD2_GMAC=y | |
| 237 | +CONFIG_E1000E=y | |
| 262 | 238 | CONFIG_IGB=y |
| 263 | 239 | CONFIG_MV643XX_ETH=y |
| 264 | 240 | CONFIG_MVNETA=y |
| @@ -268,19 +244,17 @@ CONFIG_R8169=y · 3 unmodified lines | ||
| 268 | 244 | CONFIG_SH_ETH=y |
| 269 | 245 | CONFIG_SMSC911X=y |
| 270 | 246 | CONFIG_STMMAC_ETH=y |
| 271 | −CONFIG_STMMAC_PLATFORM=y | |
| 272 | 247 | CONFIG_DWMAC_DWC_QOS_ETH=y |
| 273 | 248 | CONFIG_TI_CPSW=y |
| 274 | 249 | CONFIG_XILINX_EMACLITE=y |
| 275 | 250 | CONFIG_AT803X_PHY=y |
| 276 | −CONFIG_MARVELL_PHY=y | |
| 277 | −CONFIG_SMSC_PHY=y | |
| 278 | 251 | CONFIG_BROADCOM_PHY=y |
| 279 | 252 | CONFIG_ICPLUS_PHY=y |
| 280 | −CONFIG_REALTEK_PHY=y | |
| 253 | +CONFIG_MARVELL_PHY=y | |
| 281 | 254 | CONFIG_MICREL_PHY=y |
| 282 | −CONFIG_FIXED_PHY=y | |
| 255 | +CONFIG_REALTEK_PHY=y | |
| 283 | 256 | CONFIG_ROCKCHIP_PHY=y |
| 257 | +CONFIG_SMSC_PHY=y | |
| 284 | 258 | CONFIG_USB_PEGASUS=y |
| 285 | 259 | CONFIG_USB_RTL8152=m |
| 286 | 260 | CONFIG_USB_LAN78XX=m |
| @@ -288,29 +262,29 @@ CONFIG_USB_USBNET=y · 1 unmodified line | ||
| 288 | 262 | CONFIG_USB_NET_SMSC75XX=y |
| 289 | 263 | CONFIG_USB_NET_SMSC95XX=y |
| 290 | 264 | CONFIG_BRCMFMAC=m |
| 291 | −CONFIG_RT2X00=m | |
| 292 | −CONFIG_RT2800USB=m | |
| 293 | 265 | CONFIG_MWIFIEX=m |
| 294 | 266 | CONFIG_MWIFIEX_SDIO=m |
| 267 | +CONFIG_RT2X00=m | |
| 268 | +CONFIG_RT2800USB=m | |
| 295 | 269 | CONFIG_INPUT_JOYDEV=y |
| 296 | 270 | CONFIG_INPUT_EVDEV=y |
| 297 | 271 | CONFIG_KEYBOARD_QT1070=m |
| 298 | 272 | CONFIG_KEYBOARD_GPIO=y |
| 299 | 273 | CONFIG_KEYBOARD_TEGRA=y |
| 300 | −CONFIG_KEYBOARD_SPEAR=y | |
| 274 | +CONFIG_KEYBOARD_SAMSUNG=m | |
| 301 | 275 | CONFIG_KEYBOARD_ST_KEYSCAN=y |
| 276 | +CONFIG_KEYBOARD_SPEAR=y | |
| 302 | 277 | CONFIG_KEYBOARD_CROS_EC=m |
| 303 | −CONFIG_KEYBOARD_SAMSUNG=m | |
| 304 | 278 | CONFIG_MOUSE_PS2_ELANTECH=y |
| 305 | 279 | CONFIG_MOUSE_CYAPA=m |
| 306 | 280 | CONFIG_MOUSE_ELAN_I2C=y |
| 307 | 281 | CONFIG_INPUT_TOUCHSCREEN=y |
| 308 | 282 | CONFIG_TOUCHSCREEN_ATMEL_MXT=m |
| 309 | 283 | CONFIG_TOUCHSCREEN_MMS114=m |
| 284 | +CONFIG_TOUCHSCREEN_WM97XX=m | |
| 310 | 285 | CONFIG_TOUCHSCREEN_ST1232=m |
| 311 | 286 | CONFIG_TOUCHSCREEN_STMPE=y |
| 312 | 287 | CONFIG_TOUCHSCREEN_SUN4I=y |
| 313 | −CONFIG_TOUCHSCREEN_WM97XX=m | |
| 314 | 288 | CONFIG_INPUT_MISC=y |
| 315 | 289 | CONFIG_INPUT_MAX77693_HAPTIC=m |
| 316 | 290 | CONFIG_INPUT_MAX8997_HAPTIC=m |
| @@ -327,13 +301,12 @@ CONFIG_SERIAL_8250_DW=y · 10 unmodified lines | ||
| 327 | 301 | CONFIG_SERIAL_8250_EM=y |
| 328 | 302 | CONFIG_SERIAL_8250_MT6577=y |
| 329 | 303 | CONFIG_SERIAL_8250_UNIPHIER=y |
| 304 | +CONFIG_SERIAL_OF_PLATFORM=y | |
| 330 | 305 | CONFIG_SERIAL_AMBA_PL011=y |
| 331 | 306 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y |
| 332 | 307 | CONFIG_SERIAL_ATMEL=y |
| 333 | 308 | CONFIG_SERIAL_ATMEL_CONSOLE=y |
| 334 | 309 | CONFIG_SERIAL_ATMEL_TTYAT=y |
| 335 | −CONFIG_SERIAL_BCM63XX=y | |
| 336 | −CONFIG_SERIAL_BCM63XX_CONSOLE=y | |
| 337 | 310 | CONFIG_SERIAL_MESON=y |
| 338 | 311 | CONFIG_SERIAL_MESON_CONSOLE=y |
| 339 | 312 | CONFIG_SERIAL_SAMSUNG=y |
| @@ -345,15 +318,14 @@ CONFIG_SERIAL_IMX=y · 5 unmodified lines | ||
| 345 | 318 | CONFIG_SERIAL_IMX_CONSOLE=y |
| 346 | 319 | CONFIG_SERIAL_SH_SCI=y |
| 347 | 320 | CONFIG_SERIAL_SH_SCI_NR_UARTS=20 |
| 348 | −CONFIG_SERIAL_SH_SCI_CONSOLE=y | |
| 349 | −CONFIG_SERIAL_SH_SCI_DMA=y | |
| 350 | 321 | CONFIG_SERIAL_MSM=y |
| 351 | 322 | CONFIG_SERIAL_MSM_CONSOLE=y |
| 352 | 323 | CONFIG_SERIAL_VT8500=y |
| 353 | 324 | CONFIG_SERIAL_VT8500_CONSOLE=y |
| 354 | −CONFIG_SERIAL_OF_PLATFORM=y | |
| 355 | 325 | CONFIG_SERIAL_OMAP=y |
| 356 | 326 | CONFIG_SERIAL_OMAP_CONSOLE=y |
| 327 | +CONFIG_SERIAL_BCM63XX=y | |
| 328 | +CONFIG_SERIAL_BCM63XX_CONSOLE=y | |
| 357 | 329 | CONFIG_SERIAL_XILINX_PS_UART=y |
| 358 | 330 | CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y |
| 359 | 331 | CONFIG_SERIAL_FSL_LPUART=y |
| @@ -365,12 +337,10 @@ CONFIG_SERIAL_ST_ASC_CONSOLE=y · 5 unmodified lines | ||
| 365 | 337 | CONFIG_SERIAL_STM32=y |
| 366 | 338 | CONFIG_SERIAL_STM32_CONSOLE=y |
| 367 | 339 | CONFIG_SERIAL_DEV_BUS=y |
| 368 | −CONFIG_HVC_DRIVER=y | |
| 369 | 340 | CONFIG_VIRTIO_CONSOLE=y |
| 341 | +CONFIG_HW_RANDOM=y | |
| 342 | +CONFIG_HW_RANDOM_ST=y | |
| 370 | 343 | CONFIG_I2C_CHARDEV=y |
| 371 | −CONFIG_I2C_DAVINCI=y | |
| 372 | −CONFIG_I2C_MESON=y | |
| 373 | −CONFIG_I2C_MUX=y | |
| 374 | 344 | CONFIG_I2C_ARB_GPIO_CHALLENGE=m |
| 375 | 345 | CONFIG_I2C_MUX_PCA954x=y |
| 376 | 346 | CONFIG_I2C_MUX_PINCTRL=y |
| @@ -378,12 +348,13 @@ CONFIG_I2C_DEMUX_PINCTRL=y · 1 unmodified line | ||
| 378 | 348 | CONFIG_I2C_AT91=m |
| 379 | 349 | CONFIG_I2C_BCM2835=y |
| 380 | 350 | CONFIG_I2C_CADENCE=y |
| 351 | +CONFIG_I2C_DAVINCI=y | |
| 381 | 352 | CONFIG_I2C_DESIGNWARE_PLATFORM=y |
| 382 | 353 | CONFIG_I2C_DIGICOLOR=m |
| 383 | 354 | CONFIG_I2C_EMEV2=m |
| 384 | 355 | CONFIG_I2C_GPIO=m |
| 385 | −CONFIG_I2C_EXYNOS5=y | |
| 386 | 356 | CONFIG_I2C_IMX=y |
| 357 | +CONFIG_I2C_MESON=y | |
| 387 | 358 | CONFIG_I2C_MV64XXX=y |
| 388 | 359 | CONFIG_I2C_RIIC=y |
| 389 | 360 | CONFIG_I2C_RK3X=y |
| @@ -427,7 +398,6 @@ CONFIG_SPI_SPIDEV=y · 37 unmodified lines | ||
| 427 | 398 | CONFIG_SPMI=y |
| 428 | 399 | CONFIG_PINCTRL_AS3722=y |
| 429 | 400 | CONFIG_PINCTRL_PALMAS=y |
| 430 | −CONFIG_PINCTRL_BCM2835=y | |
| 431 | 401 | CONFIG_PINCTRL_APQ8064=y |
| 432 | 402 | CONFIG_PINCTRL_APQ8084=y |
| 433 | 403 | CONFIG_PINCTRL_IPQ8064=y |
| @@ -437,25 +407,33 @@ CONFIG_PINCTRL_MSM8X74=y · 3 unmodified lines | ||
| 437 | 407 | CONFIG_PINCTRL_MSM8916=y |
| 438 | 408 | CONFIG_PINCTRL_QCOM_SPMI_PMIC=y |
| 439 | 409 | CONFIG_PINCTRL_QCOM_SSBI_PMIC=y |
| 440 | −CONFIG_GPIO_GENERIC_PLATFORM=y | |
| 441 | 410 | CONFIG_GPIO_DAVINCI=y |
| 442 | 411 | CONFIG_GPIO_DWAPB=y |
| 443 | 412 | CONFIG_GPIO_EM=y |
| 444 | 413 | CONFIG_GPIO_RCAR=y |
| 414 | +CONFIG_GPIO_SYSCON=y | |
| 445 | 415 | CONFIG_GPIO_UNIPHIER=y |
| 446 | 416 | CONFIG_GPIO_XILINX=y |
| 447 | 417 | CONFIG_GPIO_ZYNQ=y |
| 448 | 418 | CONFIG_GPIO_PCA953X=y |
| 449 | 419 | CONFIG_GPIO_PCA953X_IRQ=y |
| 450 | 420 | CONFIG_GPIO_PCF857X=y |
| 451 | −CONFIG_GPIO_TWL4030=y | |
| 452 | 421 | CONFIG_GPIO_PALMAS=y |
| 453 | −CONFIG_GPIO_SYSCON=y | |
| 454 | 422 | CONFIG_GPIO_TPS6586X=y |
| 455 | 423 | CONFIG_GPIO_TPS65910=y |
| 424 | +CONFIG_GPIO_TWL4030=y | |
| 425 | +CONFIG_POWER_AVS=y | |
| 426 | +CONFIG_ROCKCHIP_IODOMAIN=y | |
| 427 | +CONFIG_POWER_RESET_AS3722=y | |
| 428 | +CONFIG_POWER_RESET_GPIO=y | |
| 429 | +CONFIG_POWER_RESET_GPIO_RESTART=y | |
| 430 | +CONFIG_POWER_RESET_ST=y | |
| 431 | +CONFIG_POWER_RESET_KEYSTONE=y | |
| 432 | +CONFIG_POWER_RESET_RMOBILE=y | |
| 456 | 433 | CONFIG_BATTERY_ACT8945A=y |
| 457 | 434 | CONFIG_BATTERY_CPCAP=m |
| 458 | 435 | CONFIG_BATTERY_SBS=y |
| 436 | +CONFIG_AXP20X_POWER=m | |
| 459 | 437 | CONFIG_BATTERY_MAX17040=m |
| 460 | 438 | CONFIG_BATTERY_MAX17042=m |
| 461 | 439 | CONFIG_CHARGER_CPCAP=m |
| @@ -464,15 +442,6 @@ CONFIG_CHARGER_MAX77693=m · 2 unmodified lines | ||
| 464 | 442 | CONFIG_CHARGER_MAX8997=m |
| 465 | 443 | CONFIG_CHARGER_MAX8998=m |
| 466 | 444 | CONFIG_CHARGER_TPS65090=y |
| 467 | −CONFIG_AXP20X_POWER=m | |
| 468 | −CONFIG_POWER_RESET_AS3722=y | |
| 469 | −CONFIG_POWER_RESET_GPIO=y | |
| 470 | −CONFIG_POWER_RESET_GPIO_RESTART=y | |
| 471 | −CONFIG_POWER_RESET_KEYSTONE=y | |
| 472 | −CONFIG_POWER_RESET_RMOBILE=y | |
| 473 | −CONFIG_POWER_RESET_ST=y | |
| 474 | −CONFIG_POWER_AVS=y | |
| 475 | −CONFIG_ROCKCHIP_IODOMAIN=y | |
| 476 | 445 | CONFIG_SENSORS_IIO_HWMON=y |
| 477 | 446 | CONFIG_SENSORS_LM90=y |
| 478 | 447 | CONFIG_SENSORS_LM95245=y |
| @@ -480,14 +449,12 @@ CONFIG_SENSORS_NTC_THERMISTOR=m · 1 unmodified line | ||
| 480 | 449 | CONFIG_SENSORS_PWM_FAN=m |
| 481 | 450 | CONFIG_SENSORS_INA2XX=m |
| 482 | 451 | CONFIG_CPU_THERMAL=y |
| 483 | −CONFIG_BCM2835_THERMAL=m | |
| 484 | −CONFIG_BRCMSTB_THERMAL=m | |
| 485 | 452 | CONFIG_IMX_THERMAL=y |
| 486 | 453 | CONFIG_ROCKCHIP_THERMAL=y |
| 487 | 454 | CONFIG_RCAR_THERMAL=y |
| 488 | 455 | CONFIG_ARMADA_THERMAL=y |
| 489 | −CONFIG_DAVINCI_WATCHDOG=m | |
| 490 | −CONFIG_EXYNOS_THERMAL=m | |
| 456 | +CONFIG_BCM2835_THERMAL=m | |
| 457 | +CONFIG_BRCMSTB_THERMAL=m | |
| 491 | 458 | CONFIG_ST_THERMAL_MEMMAP=y |
| 492 | 459 | CONFIG_WATCHDOG=y |
| 493 | 460 | CONFIG_DA9063_WATCHDOG=m |
| @@ -495,20 +462,24 @@ CONFIG_XILINX_WATCHDOG=y · 1 unmodified line | ||
| 495 | 462 | CONFIG_ARM_SP805_WATCHDOG=y |
| 496 | 463 | CONFIG_AT91SAM9X_WATCHDOG=y |
| 497 | 464 | CONFIG_SAMA5D4_WATCHDOG=y |
| 465 | +CONFIG_DW_WATCHDOG=y | |
| 466 | +CONFIG_DAVINCI_WATCHDOG=m | |
| 498 | 467 | CONFIG_ORION_WATCHDOG=y |
| 499 | 468 | CONFIG_RN5T618_WATCHDOG=y |
| 500 | −CONFIG_ST_LPC_WATCHDOG=y | |
| 501 | 469 | CONFIG_SUNXI_WATCHDOG=y |
| 502 | 470 | CONFIG_IMX2_WDT=y |
| 471 | +CONFIG_ST_LPC_WATCHDOG=y | |
| 503 | 472 | CONFIG_TEGRA_WATCHDOG=m |
| 504 | 473 | CONFIG_MESON_WATCHDOG=y |
| 505 | −CONFIG_DW_WATCHDOG=y | |
| 506 | 474 | CONFIG_DIGICOLOR_WATCHDOG=y |
| 507 | 475 | CONFIG_RENESAS_WDT=m |
| 508 | −CONFIG_BCM2835_WDT=y | |
| 509 | 476 | CONFIG_BCM47XX_WDT=y |
| 510 | −CONFIG_BCM7038_WDT=m | |
| 477 | +CONFIG_BCM2835_WDT=y | |
| 511 | 478 | CONFIG_BCM_KONA_WDT=y |
| 479 | +CONFIG_BCM7038_WDT=m | |
| 480 | +CONFIG_BCMA_HOST_SOC=y | |
| 481 | +CONFIG_BCMA_DRIVER_GMAC_CMN=y | |
| 482 | +CONFIG_BCMA_DRIVER_GPIO=y | |
| 512 | 483 | CONFIG_MFD_ACT8945A=y |
| 513 | 484 | CONFIG_MFD_AS3711=y |
| 514 | 485 | CONFIG_MFD_AS3722=y |
| @@ -516,7 +487,6 @@ CONFIG_MFD_ATMEL_FLEXCOM=y · 1 unmodified line | ||
| 516 | 487 | CONFIG_MFD_ATMEL_HLCDC=m |
| 517 | 488 | CONFIG_MFD_BCM590XX=y |
| 518 | 489 | CONFIG_MFD_AC100=y |
| 519 | −CONFIG_MFD_AXP20X=y | |
| 520 | 490 | CONFIG_MFD_AXP20X_I2C=y |
| 521 | 491 | CONFIG_MFD_AXP20X_RSB=y |
| 522 | 492 | CONFIG_MFD_CROS_EC=m |
| @@ -529,11 +499,11 @@ CONFIG_MFD_MAX77693=m · 6 unmodified lines | ||
| 529 | 499 | CONFIG_MFD_MAX8907=y |
| 530 | 500 | CONFIG_MFD_MAX8997=y |
| 531 | 501 | CONFIG_MFD_MAX8998=y |
| 532 | −CONFIG_MFD_RK808=y | |
| 533 | 502 | CONFIG_MFD_CPCAP=y |
| 534 | 503 | CONFIG_MFD_PM8XXX=y |
| 535 | 504 | CONFIG_MFD_QCOM_RPM=y |
| 536 | 505 | CONFIG_MFD_SPMI_PMIC=y |
| 506 | +CONFIG_MFD_RK808=y | |
| 537 | 507 | CONFIG_MFD_RN5T618=y |
| 538 | 508 | CONFIG_MFD_SEC_CORE=y |
| 539 | 509 | CONFIG_MFD_STMPE=y |
| @@ -543,10 +513,10 @@ CONFIG_MFD_TPS65217=y · 3 unmodified lines | ||
| 543 | 513 | CONFIG_MFD_TPS65218=y |
| 544 | 514 | CONFIG_MFD_TPS6586X=y |
| 545 | 515 | CONFIG_MFD_TPS65910=y |
| 546 | −CONFIG_REGULATOR_ACT8945A=y | |
| 547 | −CONFIG_REGULATOR_AB8500=y | |
| 548 | 516 | CONFIG_REGULATOR_ACT8865=y |
| 517 | +CONFIG_REGULATOR_ACT8945A=y | |
| 549 | 518 | CONFIG_REGULATOR_ANATOP=y |
| 519 | +CONFIG_REGULATOR_AB8500=y | |
| 550 | 520 | CONFIG_REGULATOR_AS3711=y |
| 551 | 521 | CONFIG_REGULATOR_AS3722=y |
| 552 | 522 | CONFIG_REGULATOR_AXP20X=y |
| @@ -554,10 +524,7 @@ CONFIG_REGULATOR_BCM590XX=y · 1 unmodified line | ||
| 554 | 524 | CONFIG_REGULATOR_CPCAP=y |
| 555 | 525 | CONFIG_REGULATOR_DA9210=y |
| 556 | 526 | CONFIG_REGULATOR_FAN53555=y |
| 557 | −CONFIG_REGULATOR_RK808=y | |
| 558 | 527 | CONFIG_REGULATOR_GPIO=y |
| 559 | −CONFIG_MFD_SYSCON=y | |
| 560 | −CONFIG_POWER_RESET_SYSCON=y | |
| 561 | 528 | CONFIG_REGULATOR_LP872X=y |
| 562 | 529 | CONFIG_REGULATOR_MAX14577=m |
| 563 | 530 | CONFIG_REGULATOR_MAX8907=y |
| @@ -571,7 +538,8 @@ CONFIG_REGULATOR_PALMAS=y · 7 unmodified lines | ||
| 571 | 538 | CONFIG_REGULATOR_PBIAS=y |
| 572 | 539 | CONFIG_REGULATOR_PWM=y |
| 573 | 540 | CONFIG_REGULATOR_QCOM_RPM=y |
| 574 | −CONFIG_REGULATOR_QCOM_SMD_RPM=y | |
| 541 | +CONFIG_REGULATOR_QCOM_SMD_RPM=m | |
| 542 | +CONFIG_REGULATOR_RK808=y | |
| 575 | 543 | CONFIG_REGULATOR_RN5T618=y |
| 576 | 544 | CONFIG_REGULATOR_S2MPS11=y |
| 577 | 545 | CONFIG_REGULATOR_S5M8767=y |
| @@ -592,18 +560,17 @@ CONFIG_MEDIA_CEC_SUPPORT=y · 14 unmodified lines | ||
| 592 | 560 | CONFIG_MEDIA_CONTROLLER=y |
| 593 | 561 | CONFIG_VIDEO_V4L2_SUBDEV_API=y |
| 594 | 562 | CONFIG_MEDIA_USB_SUPPORT=y |
| 595 | −CONFIG_USB_VIDEO_CLASS=y | |
| 596 | −CONFIG_USB_GSPCA=y | |
| 563 | +CONFIG_USB_VIDEO_CLASS=m | |
| 597 | 564 | CONFIG_V4L_PLATFORM_DRIVERS=y |
| 598 | 565 | CONFIG_SOC_CAMERA=m |
| 599 | 566 | CONFIG_SOC_CAMERA_PLATFORM=m |
| 600 | −CONFIG_VIDEO_RCAR_VIN=m | |
| 601 | −CONFIG_VIDEO_ATMEL_ISI=m | |
| 602 | 567 | CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS=m |
| 603 | 568 | CONFIG_VIDEO_S5P_FIMC=m |
| 604 | 569 | CONFIG_VIDEO_S5P_MIPI_CSIS=m |
| 605 | 570 | CONFIG_VIDEO_EXYNOS_FIMC_LITE=m |
| 606 | 571 | CONFIG_VIDEO_EXYNOS4_FIMC_IS=m |
| 572 | +CONFIG_VIDEO_RCAR_VIN=m | |
| 573 | +CONFIG_VIDEO_ATMEL_ISI=m | |
| 607 | 574 | CONFIG_V4L_MEM2MEM_DRIVERS=y |
| 608 | 575 | CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m |
| 609 | 576 | CONFIG_VIDEO_SAMSUNG_S5P_MFC=m |
| @@ -614,19 +581,15 @@ CONFIG_VIDEO_STI_DELTA=m · 4 unmodified lines | ||
| 614 | 581 | CONFIG_VIDEO_RENESAS_JPU=m |
| 615 | 582 | CONFIG_VIDEO_RENESAS_VSP1=m |
| 616 | 583 | CONFIG_V4L_TEST_DRIVERS=y |
| 584 | +CONFIG_VIDEO_VIVID=m | |
| 617 | 585 | CONFIG_CEC_PLATFORM_DRIVERS=y |
| 618 | 586 | CONFIG_VIDEO_SAMSUNG_S5P_CEC=m |
| 619 | 587 | # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set |
| 620 | 588 | CONFIG_VIDEO_ADV7180=m |
| 621 | 589 | CONFIG_VIDEO_ML86V7667=m |
| 622 | 590 | CONFIG_DRM=y |
| 623 | −CONFIG_DRM_I2C_ADV7511=m | |
| 624 | −CONFIG_DRM_I2C_ADV7511_AUDIO=y | |
| 625 | 591 | # CONFIG_DRM_I2C_CH7006 is not set |
| 626 | 592 | # CONFIG_DRM_I2C_SIL164 is not set |
| 627 | −CONFIG_DRM_DUMB_VGA_DAC=m | |
| 628 | −CONFIG_DRM_NXP_PTN3460=m | |
| 629 | −CONFIG_DRM_PARADE_PS8622=m | |
| 630 | 593 | CONFIG_DRM_NOUVEAU=m |
| 631 | 594 | CONFIG_DRM_EXYNOS=m |
| 632 | 595 | CONFIG_DRM_EXYNOS_FIMD=y |
| @@ -645,13 +608,18 @@ CONFIG_DRM_RCAR_LVDS=y · 12 unmodified lines | ||
| 645 | 608 | CONFIG_DRM_SUN4I=m |
| 646 | 609 | CONFIG_DRM_FSL_DCU=m |
| 647 | 610 | CONFIG_DRM_TEGRA=y |
| 611 | +CONFIG_DRM_PANEL_SIMPLE=y | |
| 648 | 612 | CONFIG_DRM_PANEL_SAMSUNG_LD9040=m |
| 649 | 613 | CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03=m |
| 650 | 614 | CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=m |
| 651 | −CONFIG_DRM_PANEL_SIMPLE=y | |
| 615 | +CONFIG_DRM_DUMB_VGA_DAC=m | |
| 616 | +CONFIG_DRM_NXP_PTN3460=m | |
| 617 | +CONFIG_DRM_PARADE_PS8622=m | |
| 652 | 618 | CONFIG_DRM_SII9234=m |
| 619 | +CONFIG_DRM_I2C_ADV7511=m | |
| 620 | +CONFIG_DRM_I2C_ADV7511_AUDIO=y | |
| 653 | 621 | CONFIG_DRM_STI=m |
| 654 | −CONFIG_DRM_VC4=y | |
| 622 | +CONFIG_DRM_VC4=m | |
| 655 | 623 | CONFIG_DRM_ETNAVIV=m |
| 656 | 624 | CONFIG_DRM_MXSFB=m |
| 657 | 625 | CONFIG_FB_ARMCLCD=y |
| @@ -659,8 +627,6 @@ CONFIG_FB_EFI=y · 1 unmodified line | ||
| 659 | 627 | CONFIG_FB_WM8505=y |
| 660 | 628 | CONFIG_FB_SH_MOBILE_LCDC=y |
| 661 | 629 | CONFIG_FB_SIMPLE=y |
| 662 | −CONFIG_BACKLIGHT_LCD_SUPPORT=y | |
| 663 | −CONFIG_BACKLIGHT_CLASS_DEVICE=y | |
| 664 | 630 | CONFIG_LCD_PLATFORM=m |
| 665 | 631 | CONFIG_BACKLIGHT_PWM=y |
| 666 | 632 | CONFIG_BACKLIGHT_AS3711=y |
| @@ -668,7 +634,6 @@ CONFIG_FRAMEBUFFER_CONSOLE=y · 1 unmodified line | ||
| 668 | 634 | CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y |
| 669 | 635 | CONFIG_SOUND=m |
| 670 | 636 | CONFIG_SND=m |
| 671 | −CONFIG_SND_DYNAMIC_MINORS=y | |
| 672 | 637 | CONFIG_SND_HDA_TEGRA=m |
| 673 | 638 | CONFIG_SND_HDA_INPUT_BEEP=y |
| 674 | 639 | CONFIG_SND_HDA_PATCH_LOADER=y |
| @@ -692,7 +657,7 @@ CONFIG_SND_SOC_SNOW=m · 17 unmodified lines | ||
| 692 | 657 | CONFIG_SND_SOC_ODROID=m |
| 693 | 658 | CONFIG_SND_SOC_SH4_FSI=m |
| 694 | 659 | CONFIG_SND_SOC_RCAR=m |
| 695 | −CONFIG_SND_SIMPLE_SCU_CARD=m | |
| 660 | +CONFIG_SND_SOC_STI=m | |
| 696 | 661 | CONFIG_SND_SUN4I_CODEC=m |
| 697 | 662 | CONFIG_SND_SOC_TEGRA=m |
| 698 | 663 | CONFIG_SND_SOC_TEGRA20_I2S=m |
| @@ -703,31 +668,25 @@ CONFIG_SND_SOC_TEGRA_WM8903=m · 4 unmodified lines | ||
| 703 | 668 | CONFIG_SND_SOC_TEGRA_WM9712=m |
| 704 | 669 | CONFIG_SND_SOC_TEGRA_TRIMSLICE=m |
| 705 | 670 | CONFIG_SND_SOC_TEGRA_ALC5632=m |
| 706 | −CONFIG_SND_SOC_CPCAP=m | |
| 707 | 671 | CONFIG_SND_SOC_TEGRA_MAX98090=m |
| 708 | 672 | CONFIG_SND_SOC_AK4642=m |
| 673 | +CONFIG_SND_SOC_CPCAP=m | |
| 709 | 674 | CONFIG_SND_SOC_SGTL5000=m |
| 710 | 675 | CONFIG_SND_SOC_SPDIF=m |
| 711 | −CONFIG_SND_SOC_WM8978=m | |
| 712 | −CONFIG_SND_SOC_STI=m | |
| 713 | 676 | CONFIG_SND_SOC_STI_SAS=m |
| 714 | −CONFIG_SND_SIMPLE_CARD=m | |
| 677 | +CONFIG_SND_SOC_WM8978=m | |
| 678 | +CONFIG_SND_SIMPLE_SCU_CARD=m | |
| 715 | 679 | CONFIG_USB=y |
| 716 | 680 | CONFIG_USB_OTG=y |
| 717 | 681 | CONFIG_USB_XHCI_HCD=y |
| 718 | 682 | CONFIG_USB_XHCI_MVEBU=y |
| 719 | −CONFIG_USB_XHCI_RCAR=m | |
| 720 | 683 | CONFIG_USB_XHCI_TEGRA=m |
| 721 | 684 | CONFIG_USB_EHCI_HCD=y |
| 722 | −CONFIG_USB_EHCI_MSM=m | |
| 723 | −CONFIG_USB_EHCI_EXYNOS=y | |
| 724 | −CONFIG_USB_EHCI_TEGRA=y | |
| 725 | 685 | CONFIG_USB_EHCI_HCD_STI=y |
| 726 | −CONFIG_USB_EHCI_HCD_PLATFORM=y | |
| 727 | −CONFIG_USB_ISP1760=y | |
| 686 | +CONFIG_USB_EHCI_TEGRA=y | |
| 687 | +CONFIG_USB_EHCI_EXYNOS=y | |
| 728 | 688 | CONFIG_USB_OHCI_HCD=y |
| 729 | 689 | CONFIG_USB_OHCI_HCD_STI=y |
| 730 | −CONFIG_USB_OHCI_HCD_PLATFORM=y | |
| 731 | 690 | CONFIG_USB_OHCI_EXYNOS=m |
| 732 | 691 | CONFIG_USB_R8A66597_HCD=m |
| 733 | 692 | CONFIG_USB_RENESAS_USBHS=m |
| @@ -746,18 +705,18 @@ CONFIG_USB_TI_CPPI41_DMA=y · 12 unmodified lines | ||
| 746 | 705 | CONFIG_USB_TUSB_OMAP_DMA=y |
| 747 | 706 | CONFIG_USB_DWC3=y |
| 748 | 707 | CONFIG_USB_DWC2=y |
| 749 | −CONFIG_USB_HSIC_USB3503=y | |
| 750 | 708 | CONFIG_USB_CHIPIDEA=y |
| 751 | 709 | CONFIG_USB_CHIPIDEA_UDC=y |
| 752 | 710 | CONFIG_USB_CHIPIDEA_HOST=y |
| 711 | +CONFIG_USB_ISP1760=y | |
| 712 | +CONFIG_USB_HSIC_USB3503=y | |
| 753 | 713 | CONFIG_AB8500_USB=y |
| 754 | −CONFIG_KEYSTONE_USB_PHY=y | |
| 714 | +CONFIG_KEYSTONE_USB_PHY=m | |
| 755 | 715 | CONFIG_NOP_USB_XCEIV=m |
| 756 | 716 | CONFIG_AM335X_PHY_USB=m |
| 757 | 717 | CONFIG_TWL6030_USB=m |
| 758 | 718 | CONFIG_USB_GPIO_VBUS=y |
| 759 | 719 | CONFIG_USB_ISP1301=y |
| 760 | −CONFIG_USB_MSM_OTG=m | |
| 761 | 720 | CONFIG_USB_MXS_PHY=y |
| 762 | 721 | CONFIG_USB_GADGET=y |
| 763 | 722 | CONFIG_USB_FSL_USB2=y |
| @@ -793,21 +752,20 @@ CONFIG_MMC_SDHCI_OF_ESDHC=y · 29 unmodified lines | ||
| 793 | 752 | CONFIG_MMC_SDHCI_ESDHC_IMX=y |
| 794 | 753 | CONFIG_MMC_SDHCI_DOVE=y |
| 795 | 754 | CONFIG_MMC_SDHCI_TEGRA=y |
| 755 | +CONFIG_MMC_SDHCI_S3C=y | |
| 796 | 756 | CONFIG_MMC_SDHCI_PXAV3=y |
| 797 | 757 | CONFIG_MMC_SDHCI_SPEAR=y |
| 798 | −CONFIG_MMC_SDHCI_S3C=y | |
| 799 | 758 | CONFIG_MMC_SDHCI_S3C_DMA=y |
| 800 | 759 | CONFIG_MMC_SDHCI_BCM_KONA=y |
| 760 | +CONFIG_MMC_MESON_MX_SDIO=y | |
| 801 | 761 | CONFIG_MMC_SDHCI_ST=y |
| 802 | 762 | CONFIG_MMC_OMAP=y |
| 803 | 763 | CONFIG_MMC_OMAP_HS=y |
| 804 | 764 | CONFIG_MMC_ATMELMCI=y |
| 805 | 765 | CONFIG_MMC_SDHCI_MSM=y |
| 806 | −CONFIG_MMC_MESON_MX_SDIO=y | |
| 807 | 766 | CONFIG_MMC_MVSDIO=y |
| 808 | 767 | CONFIG_MMC_SDHI=y |
| 809 | 768 | CONFIG_MMC_DW=y |
| 810 | −CONFIG_MMC_DW_PLTFM=y | |
| 811 | 769 | CONFIG_MMC_DW_EXYNOS=y |
| 812 | 770 | CONFIG_MMC_DW_ROCKCHIP=y |
| 813 | 771 | CONFIG_MMC_SH_MMCIF=y |
| @@ -847,94 +805,85 @@ CONFIG_RTC_DRV_MAX77686=y · 33 unmodified lines | ||
| 847 | 805 | CONFIG_RTC_DRV_RK808=m |
| 848 | 806 | CONFIG_RTC_DRV_RS5C372=m |
| 849 | 807 | CONFIG_RTC_DRV_BQ32K=m |
| 850 | −CONFIG_RTC_DRV_PALMAS=y | |
| 851 | −CONFIG_RTC_DRV_ST_LPC=y | |
| 852 | 808 | CONFIG_RTC_DRV_TWL4030=y |
| 809 | +CONFIG_RTC_DRV_PALMAS=y | |
| 853 | 810 | CONFIG_RTC_DRV_TPS6586X=y |
| 854 | 811 | CONFIG_RTC_DRV_TPS65910=y |
| 855 | 812 | CONFIG_RTC_DRV_S35390A=m |
| 856 | 813 | CONFIG_RTC_DRV_RX8581=m |
| 857 | 814 | CONFIG_RTC_DRV_EM3027=y |
| 815 | +CONFIG_RTC_DRV_S5M=m | |
| 858 | 816 | CONFIG_RTC_DRV_DA9063=m |
| 859 | 817 | CONFIG_RTC_DRV_EFI=m |
| 860 | 818 | CONFIG_RTC_DRV_DIGICOLOR=m |
| 861 | −CONFIG_RTC_DRV_S5M=m | |
| 862 | 819 | CONFIG_RTC_DRV_S3C=m |
| 863 | 820 | CONFIG_RTC_DRV_PL031=y |
| 864 | 821 | CONFIG_RTC_DRV_AT91RM9200=m |
| 865 | 822 | CONFIG_RTC_DRV_AT91SAM9=m |
| 866 | 823 | CONFIG_RTC_DRV_VT8500=y |
| 867 | −CONFIG_RTC_DRV_SUN6I=y | |
| 868 | 824 | CONFIG_RTC_DRV_SUNXI=y |
| 869 | 825 | CONFIG_RTC_DRV_MV=y |
| 870 | 826 | CONFIG_RTC_DRV_TEGRA=y |
| 827 | +CONFIG_RTC_DRV_ST_LPC=y | |
| 871 | 828 | CONFIG_RTC_DRV_CPCAP=m |
| 872 | 829 | CONFIG_DMADEVICES=y |
| 873 | −CONFIG_DW_DMAC=y | |
| 874 | 830 | CONFIG_AT_HDMAC=y |
| 875 | 831 | CONFIG_AT_XDMAC=y |
| 832 | +CONFIG_DMA_BCM2835=y | |
| 833 | +CONFIG_DMA_SUN6I=y | |
| 876 | 834 | CONFIG_FSL_EDMA=y |
| 835 | +CONFIG_IMX_DMA=y | |
| 836 | +CONFIG_IMX_SDMA=y | |
| 877 | 837 | CONFIG_MV_XOR=y |
| 838 | +CONFIG_MXS_DMA=y | |
| 839 | +CONFIG_PL330_DMA=y | |
| 840 | +CONFIG_SIRF_DMA=y | |
| 841 | +CONFIG_STE_DMA40=y | |
| 842 | +CONFIG_ST_FDMA=m | |
| 878 | 843 | CONFIG_TEGRA20_APB_DMA=y |
| 844 | +CONFIG_XILINX_DMA=y | |
| 845 | +CONFIG_QCOM_BAM_DMA=y | |
| 846 | +CONFIG_DW_DMAC=y | |
| 879 | 847 | CONFIG_SH_DMAE=y |
| 880 | 848 | CONFIG_RCAR_DMAC=y |
| 881 | 849 | CONFIG_RENESAS_USB_DMAC=m |
| 882 | −CONFIG_STE_DMA40=y | |
| 883 | −CONFIG_SIRF_DMA=y | |
| 884 | −CONFIG_TI_EDMA=y | |
| 885 | −CONFIG_PL330_DMA=y | |
| 886 | −CONFIG_IMX_SDMA=y | |
| 887 | −CONFIG_IMX_DMA=y | |
| 888 | −CONFIG_MXS_DMA=y | |
| 889 | −CONFIG_DMA_BCM2835=y | |
| 890 | −CONFIG_DMA_OMAP=y | |
| 891 | −CONFIG_QCOM_BAM_DMA=y | |
| 892 | −CONFIG_XILINX_DMA=y | |
| 893 | −CONFIG_DMA_SUN6I=y | |
| 894 | −CONFIG_ST_FDMA=m | |
| 850 | +CONFIG_VIRTIO_PCI=y | |
| 851 | +CONFIG_VIRTIO_MMIO=y | |
| 895 | 852 | CONFIG_STAGING=y |
| 896 | −CONFIG_SENSORS_ISL29018=y | |
| 897 | −CONFIG_SENSORS_ISL29028=y | |
| 898 | 853 | CONFIG_MFD_NVEC=y |
| 899 | 854 | CONFIG_KEYBOARD_NVEC=y |
| 900 | 855 | CONFIG_SERIO_NVEC_PS2=y |
| 901 | 856 | CONFIG_NVEC_POWER=y |
| 902 | 857 | CONFIG_NVEC_PAZ00=y |
| 903 | −CONFIG_BCMA=y | |
| 904 | −CONFIG_BCMA_HOST_SOC=y | |
| 905 | −CONFIG_BCMA_DRIVER_GMAC_CMN=y | |
| 906 | −CONFIG_BCMA_DRIVER_GPIO=y | |
| 907 | −CONFIG_QCOM_GSBI=y | |
| 908 | −CONFIG_QCOM_PM=y | |
| 909 | −CONFIG_QCOM_SMEM=y | |
| 910 | −CONFIG_QCOM_SMD_RPM=y | |
| 911 | −CONFIG_QCOM_SMP2P=y | |
| 912 | −CONFIG_QCOM_SMSM=y | |
| 913 | −CONFIG_QCOM_WCNSS_CTRL=m | |
| 914 | −CONFIG_ROCKCHIP_PM_DOMAINS=y | |
| 915 | −CONFIG_COMMON_CLK_QCOM=y | |
| 916 | −CONFIG_QCOM_CLK_RPM=y | |
| 917 | −CONFIG_CHROME_PLATFORMS=y | |
| 918 | 858 | CONFIG_STAGING_BOARD=y |
| 919 | −CONFIG_CROS_EC_CHARDEV=m | |
| 920 | 859 | CONFIG_COMMON_CLK_MAX77686=y |
| 921 | 860 | CONFIG_COMMON_CLK_RK808=m |
| 922 | 861 | CONFIG_COMMON_CLK_S2MPS11=m |
| 862 | +CONFIG_COMMON_CLK_QCOM=y | |
| 863 | +CONFIG_QCOM_CLK_RPM=y | |
| 923 | 864 | CONFIG_APQ_MMCC_8084=y |
| 924 | 865 | CONFIG_MSM_GCC_8660=y |
| 925 | 866 | CONFIG_MSM_MMCC_8960=y |
| 926 | 867 | CONFIG_MSM_MMCC_8974=y |
| 927 | −CONFIG_HWSPINLOCK_QCOM=y | |
| 868 | +CONFIG_BCM2835_MBOX=y | |
| 928 | 869 | CONFIG_ROCKCHIP_IOMMU=y |
| 929 | 870 | CONFIG_TEGRA_IOMMU_GART=y |
| 930 | 871 | CONFIG_TEGRA_IOMMU_SMMU=y |
| 931 | 872 | CONFIG_REMOTEPROC=m |
| 932 | 873 | CONFIG_ST_REMOTEPROC=m |
| 933 | 874 | CONFIG_RPMSG_VIRTIO=m |
| 875 | +CONFIG_RASPBERRYPI_POWER=y | |
| 876 | +CONFIG_QCOM_GSBI=y | |
| 877 | +CONFIG_QCOM_PM=y | |
| 878 | +CONFIG_QCOM_SMD_RPM=m | |
| 879 | +CONFIG_QCOM_WCNSS_CTRL=m | |
| 880 | +CONFIG_ROCKCHIP_PM_DOMAINS=y | |
| 881 | +CONFIG_ARCH_TEGRA_2x_SOC=y | |
| 882 | +CONFIG_ARCH_TEGRA_3x_SOC=y | |
| 883 | +CONFIG_ARCH_TEGRA_114_SOC=y | |
| 884 | +CONFIG_ARCH_TEGRA_124_SOC=y | |
| 934 | 885 | CONFIG_PM_DEVFREQ=y |
| 935 | 886 | CONFIG_ARM_TEGRA_DEVFREQ=m |
| 936 | −CONFIG_MEMORY=y | |
| 937 | −CONFIG_EXTCON=y | |
| 938 | 887 | CONFIG_TI_AEMIF=y |
| 939 | 888 | CONFIG_IIO=y |
| 940 | 889 | CONFIG_IIO_SW_TRIGGER=y |
| @@ -947,56 +896,54 @@ CONFIG_VF610_ADC=m · 6 unmodified lines | ||
| 947 | 896 | CONFIG_XILINX_XADC=y |
| 948 | 897 | CONFIG_MPU3050_I2C=y |
| 949 | 898 | CONFIG_CM36651=m |
| 899 | +CONFIG_SENSORS_ISL29018=y | |
| 900 | +CONFIG_SENSORS_ISL29028=y | |
| 950 | 901 | CONFIG_AK8975=y |
| 951 | −CONFIG_RASPBERRYPI_POWER=y | |
| 952 | 902 | CONFIG_IIO_HRTIMER_TRIGGER=y |
| 953 | 903 | CONFIG_PWM=y |
| 954 | 904 | CONFIG_PWM_ATMEL=m |
| 955 | 905 | CONFIG_PWM_ATMEL_HLCDC_PWM=m |
| 956 | 906 | CONFIG_PWM_ATMEL_TCB=m |
| 907 | +CONFIG_PWM_BCM2835=y | |
| 908 | +CONFIG_PWM_BRCMSTB=m | |
| 957 | 909 | CONFIG_PWM_FSL_FTM=m |
| 958 | 910 | CONFIG_PWM_MESON=m |
| 959 | 911 | CONFIG_PWM_RCAR=m |
| 960 | 912 | CONFIG_PWM_RENESAS_TPU=y |
| 961 | 913 | CONFIG_PWM_ROCKCHIP=m |
| 962 | 914 | CONFIG_PWM_SAMSUNG=m |
| 915 | +CONFIG_PWM_STI=y | |
| 963 | 916 | CONFIG_PWM_SUN4I=y |
| 964 | 917 | CONFIG_PWM_TEGRA=y |
| 965 | 918 | CONFIG_PWM_VT8500=y |
| 919 | +CONFIG_KEYSTONE_IRQ=y | |
| 920 | +CONFIG_PHY_SUN4I_USB=y | |
| 921 | +CONFIG_PHY_SUN9I_USB=y | |
| 966 | 922 | CONFIG_PHY_HIX5HD2_SATA=y |
| 967 | −CONFIG_E1000E=y | |
| 968 | −CONFIG_PWM_STI=y | |
| 969 | −CONFIG_PWM_BCM2835=y | |
| 970 | −CONFIG_PWM_BRCMSTB=m | |
| 971 | −CONFIG_PHY_DM816X_USB=m | |
| 972 | −CONFIG_OMAP_USB2=y | |
| 973 | −CONFIG_TI_PIPE3=y | |
| 974 | −CONFIG_TWL4030_USB=m | |
| 923 | +CONFIG_PHY_BERLIN_SATA=y | |
| 975 | 924 | CONFIG_PHY_BERLIN_USB=y |
| 976 | 925 | CONFIG_PHY_CPCAP_USB=m |
| 977 | −CONFIG_PHY_BERLIN_SATA=y | |
| 926 | +CONFIG_PHY_QCOM_APQ8064_SATA=m | |
| 927 | +CONFIG_PHY_RCAR_GEN2=m | |
| 978 | 928 | CONFIG_PHY_ROCKCHIP_DP=m |
| 979 | 929 | CONFIG_PHY_ROCKCHIP_USB=y |
| 980 | −CONFIG_PHY_QCOM_APQ8064_SATA=m | |
| 930 | +CONFIG_PHY_SAMSUNG_USB2=m | |
| 981 | 931 | CONFIG_PHY_MIPHY28LP=y |
| 982 | −CONFIG_PHY_RCAR_GEN2=m | |
| 983 | 932 | CONFIG_PHY_STIH407_USB=y |
| 984 | 933 | CONFIG_PHY_STM32_USBPHYC=y |
| 985 | −CONFIG_PHY_SUN4I_USB=y | |
| 986 | −CONFIG_PHY_SUN9I_USB=y | |
| 987 | −CONFIG_PHY_SAMSUNG_USB2=m | |
| 988 | 934 | CONFIG_PHY_TEGRA_XUSB=y |
| 989 | −CONFIG_PHY_BRCM_SATA=y | |
| 990 | −CONFIG_NVMEM=y | |
| 935 | +CONFIG_PHY_DM816X_USB=m | |
| 936 | +CONFIG_OMAP_USB2=y | |
| 937 | +CONFIG_TI_PIPE3=y | |
| 938 | +CONFIG_TWL4030_USB=m | |
| 991 | 939 | CONFIG_NVMEM_IMX_OCOTP=y |
| 992 | 940 | CONFIG_NVMEM_SUNXI_SID=y |
| 993 | 941 | CONFIG_NVMEM_VF610_OCOTP=y |
| 994 | −CONFIG_BCM2835_MBOX=y | |
| 995 | 942 | CONFIG_RASPBERRYPI_FIRMWARE=y |
| 996 | −CONFIG_EFI_VARS=m | |
| 997 | −CONFIG_EFI_CAPSULE_LOADER=m | |
| 998 | 943 | CONFIG_BCM47XX_NVRAM=y |
| 999 | 944 | CONFIG_BCM47XX_SPROM=y |
| 945 | +CONFIG_EFI_VARS=m | |
| 946 | +CONFIG_EFI_CAPSULE_LOADER=m | |
| 1000 | 947 | CONFIG_EXT4_FS=y |
| 1001 | 948 | CONFIG_AUTOFS4_FS=y |
| 1002 | 949 | CONFIG_MSDOS_FS=y |
| @@ -1004,7 +951,6 @@ CONFIG_VFAT_FS=y · 1 unmodified line | ||
| 1004 | 951 | CONFIG_NTFS_FS=y |
| 1005 | 952 | CONFIG_TMPFS_POSIX_ACL=y |
| 1006 | 953 | CONFIG_UBIFS_FS=y |
| 1007 | −CONFIG_TMPFS=y | |
| 1008 | 954 | CONFIG_SQUASHFS=y |
| 1009 | 955 | CONFIG_SQUASHFS_LZO=y |
| 1010 | 956 | CONFIG_SQUASHFS_XZ=y |
| @@ -1020,13 +966,7 @@ CONFIG_NLS_CODEPAGE_437=y · 9 unmodified lines | ||
| 1020 | 966 | CONFIG_NLS_ISO8859_1=y |
| 1021 | 967 | CONFIG_NLS_UTF8=y |
| 1022 | 968 | CONFIG_PRINTK_TIME=y |
| 1023 | −CONFIG_DEBUG_FS=y | |
| 1024 | 969 | CONFIG_MAGIC_SYSRQ=y |
| 1025 | −CONFIG_LOCKUP_DETECTOR=y | |
| 1026 | −CONFIG_CPUFREQ_DT=y | |
| 1027 | −CONFIG_KEYSTONE_IRQ=y | |
| 1028 | −CONFIG_HW_RANDOM=y | |
| 1029 | −CONFIG_HW_RANDOM_ST=y | |
| 1030 | 970 | CONFIG_CRYPTO_USER=m |
| 1031 | 971 | CONFIG_CRYPTO_USER_API_HASH=m |
| 1032 | 972 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| @@ -1035,27 +975,19 @@ CONFIG_CRYPTO_USER_API_AEAD=m · 2 unmodified lines | ||
| 1035 | 975 | CONFIG_CRYPTO_DEV_MARVELL_CESA=m |
| 1036 | 976 | CONFIG_CRYPTO_DEV_EXYNOS_RNG=m |
| 1037 | 977 | CONFIG_CRYPTO_DEV_S5P=m |
| 978 | +CONFIG_CRYPTO_DEV_ATMEL_AES=m | |
| 979 | +CONFIG_CRYPTO_DEV_ATMEL_TDES=m | |
| 980 | +CONFIG_CRYPTO_DEV_ATMEL_SHA=m | |
| 1038 | 981 | CONFIG_CRYPTO_DEV_SUN4I_SS=m |
| 1039 | 982 | CONFIG_CRYPTO_DEV_ROCKCHIP=m |
| 1040 | 983 | CONFIG_ARM_CRYPTO=y |
| 1041 | −CONFIG_CRYPTO_SHA1_ARM=m | |
| 1042 | 984 | CONFIG_CRYPTO_SHA1_ARM_NEON=m |
| 1043 | 985 | CONFIG_CRYPTO_SHA1_ARM_CE=m |
| 1044 | 986 | CONFIG_CRYPTO_SHA2_ARM_CE=m |
| 1045 | −CONFIG_CRYPTO_SHA256_ARM=m | |
| 1046 | 987 | CONFIG_CRYPTO_SHA512_ARM=m |
| 1047 | 988 | CONFIG_CRYPTO_AES_ARM=m |
| 1048 | 989 | CONFIG_CRYPTO_AES_ARM_BS=m |
| 1049 | 990 | CONFIG_CRYPTO_AES_ARM_CE=m |
| 1050 | −CONFIG_CRYPTO_CHACHA20_NEON=m | |
| 1051 | −CONFIG_CRYPTO_CRC32_ARM_CE=m | |
| 1052 | −CONFIG_CRYPTO_CRCT10DIF_ARM_CE=m | |
| 1053 | 991 | CONFIG_CRYPTO_GHASH_ARM_CE=m |
| 1054 | −CONFIG_CRYPTO_DEV_ATMEL_AES=m | |
| 1055 | −CONFIG_CRYPTO_DEV_ATMEL_TDES=m | |
| 1056 | −CONFIG_CRYPTO_DEV_ATMEL_SHA=m | |
| 1057 | −CONFIG_VIDEO_VIVID=m | |
| 1058 | −CONFIG_VIRTIO=y | |
| 1059 | −CONFIG_VIRTIO_PCI=y | |
| 1060 | −CONFIG_VIRTIO_PCI_LEGACY=y | |
| 1061 | −CONFIG_VIRTIO_MMIO=y | |
| 992 | +CONFIG_CRYPTO_CRC32_ARM_CE=m | |
| 993 | +CONFIG_CRYPTO_CHACHA20_NEON=m | |
| @@ -544,7 +544,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) · 543 unmodified lines | ||
| 544 | 544 | * Increment event counter and perform fixup for the pre-signal |
| 545 | 545 | * frame. |
| 546 | 546 | */ |
| 547 | − rseq_signal_deliver(regs); | |
| 547 | + rseq_signal_deliver(ksig, regs); | |
| 548 | 548 | |
| 549 | 549 | /* |
| 550 | 550 | * Set up the stack frame |
| @@ -666,7 +666,7 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) · 115 unmodified lines | ||
| 666 | 666 | } else { |
| 667 | 667 | clear_thread_flag(TIF_NOTIFY_RESUME); |
| 668 | 668 | tracehook_notify_resume(regs); |
| 669 | − rseq_handle_notify_resume(regs); | |
| 669 | + rseq_handle_notify_resume(NULL, regs); | |
| 670 | 670 | } |
| 671 | 671 | } |
| 672 | 672 | local_irq_disable(); |
| @@ -20,6 +20,7 @@ config ARCH_BCM_IPROC · 19 unmodified lines | ||
| 20 | 20 | select GPIOLIB |
| 21 | 21 | select ARM_AMBA |
| 22 | 22 | select PINCTRL |
| 23 | + select PCI_DOMAINS if PCI | |
| 23 | 24 | help |
| 24 | 25 | This enables support for systems based on Broadcom IPROC architected SoCs. |
| 25 | 26 | The IPROC complex contains one or more ARM CPUs along with common |
| @@ -774,7 +774,7 @@ static struct gpiod_lookup_table mmc_gpios_table = { · 773 unmodified lines | ||
| 774 | 774 | GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_CD_PIN, "cd", |
| 775 | 775 | GPIO_ACTIVE_LOW), |
| 776 | 776 | GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_WP_PIN, "wp", |
| 777 | − GPIO_ACTIVE_LOW), | |
| 777 | + GPIO_ACTIVE_HIGH), | |
| 778 | 778 | }, |
| 779 | 779 | }; |
| 780 | 780 | |
| @@ -10,6 +10,7 @@ menuconfig ARCH_SOCFPGA · 9 unmodified lines | ||
| 10 | 10 | select HAVE_ARM_SCU |
| 11 | 11 | select HAVE_ARM_TWD if SMP |
| 12 | 12 | select MFD_SYSCON |
| 13 | + select PCI_DOMAINS if PCI | |
| 13 | 14 | |
| 14 | 15 | if ARCH_SOCFPGA |
| 15 | 16 | config SOCFPGA_SUSPEND |
| @@ -59,6 +59,9 @@ struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS] __initdata; · 58 unmodified lines | ||
| 59 | 59 | |
| 60 | 60 | static __read_mostly unsigned int xen_events_irq; |
| 61 | 61 | |
| 62 | +uint32_t xen_start_flags; | |
| 63 | +EXPORT_SYMBOL(xen_start_flags); | |
| 64 | + | |
| 62 | 65 | int xen_remap_domain_gfn_array(struct vm_area_struct *vma, |
| 63 | 66 | unsigned long addr, |
| 64 | 67 | xen_pfn_t *gfn, int nr, |
| @@ -293,9 +296,7 @@ void __init xen_early_init(void) · 228 unmodified lines | ||
| 293 | 296 | xen_setup_features(); |
| 294 | 297 | |
| 295 | 298 | if (xen_feature(XENFEAT_dom0)) |
| 296 | − xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED; | |
| 297 | − else | |
| 298 | − xen_start_info->flags &= ~(SIF_INITDOMAIN|SIF_PRIVILEGED); | |
| 299 | + xen_start_flags |= SIF_INITDOMAIN|SIF_PRIVILEGED; | |
| 299 | 300 | |
| 300 | 301 | if (!console_set_on_cmdline && !xen_initial_domain()) |
| 301 | 302 | add_preferred_console("hvc", 0, NULL); |
| @@ -309,8 +309,7 @@ · 308 unmodified lines | ||
| 309 | 309 | interrupts = <0 99 4>; |
| 310 | 310 | resets = <&rst SPIM0_RESET>; |
| 311 | 311 | reg-io-width = <4>; |
| 312 | − num-chipselect = <4>; | |
| 313 | − bus-num = <0>; | |
| 312 | + num-cs = <4>; | |
| 314 | 313 | status = "disabled"; |
| 315 | 314 | }; |
| 316 | 315 | |
| @@ -322,8 +321,7 @@ · 5 unmodified lines | ||
| 322 | 321 | interrupts = <0 100 4>; |
| 323 | 322 | resets = <&rst SPIM1_RESET>; |
| 324 | 323 | reg-io-width = <4>; |
| 325 | − num-chipselect = <4>; | |
| 326 | − bus-num = <0>; | |
| 324 | + num-cs = <4>; | |
| 327 | 325 | status = "disabled"; |
| 328 | 326 | }; |
| 329 | 327 | |
| @@ -66,9 +66,22 @@ · 65 unmodified lines | ||
| 66 | 66 | |
| 67 | 67 | ðmac { |
| 68 | 68 | status = "okay"; |
| 69 | − phy-mode = "rgmii"; | |
| 70 | 69 | pinctrl-0 = <ð_rgmii_y_pins>; |
| 71 | 70 | pinctrl-names = "default"; |
| 71 | + phy-handle = <ð_phy0>; | |
| 72 | + phy-mode = "rgmii"; | |
| 73 | + | |
| 74 | + mdio { | |
| 75 | + compatible = "snps,dwmac-mdio"; | |
| 76 | + #address-cells = <1>; | |
| 77 | + #size-cells = <0>; | |
| 78 | + | |
| 79 | + eth_phy0: ethernet-phy@0 { | |
| 80 | + /* Realtek RTL8211F (0x001cc916) */ | |
| 81 | + reg = <0>; | |
| 82 | + eee-broken-1000t; | |
| 83 | + }; | |
| 84 | + }; | |
| 72 | 85 | }; |
| 73 | 86 | |
| 74 | 87 | &uart_A { |
| @@ -132,7 +132,7 @@ · 131 unmodified lines | ||
| 132 | 132 | |
| 133 | 133 | sd_emmc_b: sd@5000 { |
| 134 | 134 | compatible = "amlogic,meson-axg-mmc"; |
| 135 | − reg = <0x0 0x5000 0x0 0x2000>; | |
| 135 | + reg = <0x0 0x5000 0x0 0x800>; | |
| 136 | 136 | interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>; |
| 137 | 137 | status = "disabled"; |
| 138 | 138 | clocks = <&clkc CLKID_SD_EMMC_B>, |
| @@ -144,7 +144,7 @@ · 5 unmodified lines | ||
| 144 | 144 | |
| 145 | 145 | sd_emmc_c: mmc@7000 { |
| 146 | 146 | compatible = "amlogic,meson-axg-mmc"; |
| 147 | − reg = <0x0 0x7000 0x0 0x2000>; | |
| 147 | + reg = <0x0 0x7000 0x0 0x800>; | |
| 148 | 148 | interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>; |
| 149 | 149 | status = "disabled"; |
| 150 | 150 | clocks = <&clkc CLKID_SD_EMMC_C>, |
| @@ -35,6 +35,12 @@ · 34 unmodified lines | ||
| 35 | 35 | no-map; |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | + /* Alternate 3 MiB reserved for ARM Trusted Firmware (BL31) */ | |
| 39 | + secmon_reserved_alt: secmon@5000000 { | |
| 40 | + reg = <0x0 0x05000000 0x0 0x300000>; | |
| 41 | + no-map; | |
| 42 | + }; | |
| 43 | + | |
| 38 | 44 | linux,cma { |
| 39 | 45 | compatible = "shared-dma-pool"; |
| 40 | 46 | reusable; |
| @@ -457,21 +463,21 @@ · 416 unmodified lines | ||
| 457 | 463 | |
| 458 | 464 | sd_emmc_a: mmc@70000 { |
| 459 | 465 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; |
| 460 | − reg = <0x0 0x70000 0x0 0x2000>; | |
| 466 | + reg = <0x0 0x70000 0x0 0x800>; | |
| 461 | 467 | interrupts = <GIC_SPI 216 IRQ_TYPE_EDGE_RISING>; |
| 462 | 468 | status = "disabled"; |
| 463 | 469 | }; |
| 464 | 470 | |
| 465 | 471 | sd_emmc_b: mmc@72000 { |
| 466 | 472 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; |
| 467 | − reg = <0x0 0x72000 0x0 0x2000>; | |
| 473 | + reg = <0x0 0x72000 0x0 0x800>; | |
| 468 | 474 | interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>; |
| 469 | 475 | status = "disabled"; |
| 470 | 476 | }; |
| 471 | 477 | |
| 472 | 478 | sd_emmc_c: mmc@74000 { |
| 473 | 479 | compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; |
| 474 | − reg = <0x0 0x74000 0x0 0x2000>; | |
| 480 | + reg = <0x0 0x74000 0x0 0x800>; | |
| 475 | 481 | interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>; |
| 476 | 482 | status = "disabled"; |
| 477 | 483 | }; |
| @@ -6,7 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | |
| 7 | 7 | &apb { |
| 8 | 8 | mali: gpu@c0000 { |
| 9 | − compatible = "amlogic,meson-gxbb-mali", "arm,mali-450"; | |
| 9 | + compatible = "amlogic,meson-gxl-mali", "arm,mali-450"; | |
| 10 | 10 | reg = <0x0 0xc0000 0x0 0x40000>; |
| 11 | 11 | interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>, |
| 12 | 12 | <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>, |
| @@ -234,9 +234,6 @@ · 233 unmodified lines | ||
| 234 | 234 | |
| 235 | 235 | bus-width = <4>; |
| 236 | 236 | cap-sd-highspeed; |
| 237 | − sd-uhs-sdr12; | |
| 238 | − sd-uhs-sdr25; | |
| 239 | − sd-uhs-sdr50; | |
| 240 | 237 | max-frequency = <100000000>; |
| 241 | 238 | disable-wp; |
| 242 | 239 | |
| @@ -189,3 +189,10 @@ · 188 unmodified lines | ||
| 189 | 189 | &usb0 { |
| 190 | 190 | status = "okay"; |
| 191 | 191 | }; |
| 192 | + | |
| 193 | +&usb2_phy0 { | |
| 194 | + /* | |
| 195 | + * HDMI_5V is also used as supply for the USB VBUS. | |
| 196 | + */ | |
| 197 | + phy-supply = <&hdmi_5v>; | |
| 198 | +}; | |
| @@ -13,14 +13,6 @@ · 12 unmodified lines | ||
| 13 | 13 | / { |
| 14 | 14 | compatible = "amlogic,meson-gxl"; |
| 15 | 15 | |
| 16 | − reserved-memory { | |
| 17 | − /* Alternate 3 MiB reserved for ARM Trusted Firmware (BL31) */ | |
| 18 | − secmon_reserved_alt: secmon@5000000 { | |
| 19 | − reg = <0x0 0x05000000 0x0 0x300000>; | |
| 20 | − no-map; | |
| 21 | − }; | |
| 22 | − }; | |
| 23 | − | |
| 24 | 16 | soc { |
| 25 | 17 | usb0: usb@c9000000 { |
| 26 | 18 | status = "disabled"; |
| @@ -118,7 +118,7 @@ · 117 unmodified lines | ||
| 118 | 118 | |
| 119 | 119 | #interrupt-cells = <1>; |
| 120 | 120 | interrupt-map-mask = <0 0 0 0>; |
| 121 | − interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 281 IRQ_TYPE_NONE>; | |
| 121 | + interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 281 IRQ_TYPE_LEVEL_HIGH>; | |
| 122 | 122 | |
| 123 | 123 | linux,pci-domain = <0>; |
| 124 | 124 | |
| @@ -149,7 +149,7 @@ · 24 unmodified lines | ||
| 149 | 149 | |
| 150 | 150 | #interrupt-cells = <1>; |
| 151 | 151 | interrupt-map-mask = <0 0 0 0>; |
| 152 | − interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 305 IRQ_TYPE_NONE>; | |
| 152 | + interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>; | |
| 153 | 153 | |
| 154 | 154 | linux,pci-domain = <4>; |
| 155 | 155 | |
| @@ -566,7 +566,7 @@ · 410 unmodified lines | ||
| 566 | 566 | reg = <0x66080000 0x100>; |
| 567 | 567 | #address-cells = <1>; |
| 568 | 568 | #size-cells = <0>; |
| 569 | − interrupts = <GIC_SPI 394 IRQ_TYPE_NONE>; | |
| 569 | + interrupts = <GIC_SPI 394 IRQ_TYPE_LEVEL_HIGH>; | |
| 570 | 570 | clock-frequency = <100000>; |
| 571 | 571 | status = "disabled"; |
| 572 | 572 | }; |
| @@ -594,7 +594,7 @@ · 21 unmodified lines | ||
| 594 | 594 | reg = <0x660b0000 0x100>; |
| 595 | 595 | #address-cells = <1>; |
| 596 | 596 | #size-cells = <0>; |
| 597 | − interrupts = <GIC_SPI 395 IRQ_TYPE_NONE>; | |
| 597 | + interrupts = <GIC_SPI 395 IRQ_TYPE_LEVEL_HIGH>; | |
| 598 | 598 | clock-frequency = <100000>; |
| 599 | 599 | status = "disabled"; |
| 600 | 600 | }; |
| @@ -43,6 +43,10 @@ · 42 unmodified lines | ||
| 43 | 43 | enet-phy-lane-swap; |
| 44 | 44 | }; |
| 45 | 45 | |
| 46 | +&sdio0 { | |
| 47 | + mmc-ddr-1_8v; | |
| 48 | +}; | |
| 49 | + | |
| 46 | 50 | &uart2 { |
| 47 | 51 | status = "okay"; |
| 48 | 52 | }; |
| @@ -42,3 +42,7 @@ · 41 unmodified lines | ||
| 42 | 42 | &gphy0 { |
| 43 | 43 | enet-phy-lane-swap; |
| 44 | 44 | }; |
| 45 | + | |
| 46 | +&sdio0 { | |
| 47 | + mmc-ddr-1_8v; | |
| 48 | +}; | |
| @@ -409,7 +409,7 @@ · 408 unmodified lines | ||
| 409 | 409 | reg = <0x000b0000 0x100>; |
| 410 | 410 | #address-cells = <1>; |
| 411 | 411 | #size-cells = <0>; |
| 412 | − interrupts = <GIC_SPI 177 IRQ_TYPE_NONE>; | |
| 412 | + interrupts = <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH>; | |
| 413 | 413 | clock-frequency = <100000>; |
| 414 | 414 | status = "disabled"; |
| 415 | 415 | }; |
| @@ -453,7 +453,7 @@ · 37 unmodified lines | ||
| 453 | 453 | reg = <0x000e0000 0x100>; |
| 454 | 454 | #address-cells = <1>; |
| 455 | 455 | #size-cells = <0>; |
| 456 | − interrupts = <GIC_SPI 178 IRQ_TYPE_NONE>; | |
| 456 | + interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>; | |
| 457 | 457 | clock-frequency = <100000>; |
| 458 | 458 | status = "disabled"; |
| 459 | 459 | }; |
| @@ -585,6 +585,8 @@ · 584 unmodified lines | ||
| 585 | 585 | vmmc-supply = <&wlan_en>; |
| 586 | 586 | ti,non-removable; |
| 587 | 587 | non-removable; |
| 588 | + cap-power-off-card; | |
| 589 | + keep-power-in-suspend; | |
| 588 | 590 | #address-cells = <0x1>; |
| 589 | 591 | #size-cells = <0x0>; |
| 590 | 592 | status = "ok"; |
| @@ -322,6 +322,8 @@ · 321 unmodified lines | ||
| 322 | 322 | dwmmc_2: dwmmc2@f723f000 { |
| 323 | 323 | bus-width = <0x4>; |
| 324 | 324 | non-removable; |
| 325 | + cap-power-off-card; | |
| 326 | + keep-power-in-suspend; | |
| 325 | 327 | vmmc-supply = <®_vdd_3v3>; |
| 326 | 328 | mmc-pwrseq = <&wl1835_pwrseq>; |
| 327 | 329 | |
| @@ -149,7 +149,7 @@ · 148 unmodified lines | ||
| 149 | 149 | |
| 150 | 150 | CP110_LABEL(icu): interrupt-controller@1e0000 { |
| 151 | 151 | compatible = "marvell,cp110-icu"; |
| 152 | − reg = <0x1e0000 0x10>; | |
| 152 | + reg = <0x1e0000 0x440>; | |
| 153 | 153 | #interrupt-cells = <3>; |
| 154 | 154 | interrupt-controller; |
| 155 | 155 | msi-parent = <&gicp>; |
| @@ -75,7 +75,7 @@ · 74 unmodified lines | ||
| 75 | 75 | |
| 76 | 76 | serial@75b1000 { |
| 77 | 77 | label = "LS-UART0"; |
| 78 | − status = "okay"; | |
| 78 | + status = "disabled"; | |
| 79 | 79 | pinctrl-names = "default", "sleep"; |
| 80 | 80 | pinctrl-0 = <&blsp2_uart2_4pins_default>; |
| 81 | 81 | pinctrl-1 = <&blsp2_uart2_4pins_sleep>; |
| @@ -1191,14 +1191,14 @@ · 1190 unmodified lines | ||
| 1191 | 1191 | |
| 1192 | 1192 | port@0 { |
| 1193 | 1193 | reg = <0>; |
| 1194 | − etf_out: endpoint { | |
| 1194 | + etf_in: endpoint { | |
| 1195 | 1195 | slave-mode; |
| 1196 | 1196 | remote-endpoint = <&funnel0_out>; |
| 1197 | 1197 | }; |
| 1198 | 1198 | }; |
| 1199 | 1199 | port@1 { |
| 1200 | 1200 | reg = <0>; |
| 1201 | − etf_in: endpoint { | |
| 1201 | + etf_out: endpoint { | |
| 1202 | 1202 | remote-endpoint = <&replicator_in>; |
| 1203 | 1203 | }; |
| 1204 | 1204 | }; |
| @@ -54,7 +54,7 @@ · 53 unmodified lines | ||
| 54 | 54 | sound { |
| 55 | 55 | compatible = "audio-graph-card"; |
| 56 | 56 | label = "UniPhier LD11"; |
| 57 | − widgets = "Headphone", "Headphone Jack"; | |
| 57 | + widgets = "Headphone", "Headphones"; | |
| 58 | 58 | dais = <&i2s_port2 |
| 59 | 59 | &i2s_port3 |
| 60 | 60 | &i2s_port4 |
| @@ -54,7 +54,7 @@ · 53 unmodified lines | ||
| 54 | 54 | sound { |
| 55 | 55 | compatible = "audio-graph-card"; |
| 56 | 56 | label = "UniPhier LD20"; |
| 57 | − widgets = "Headphone", "Headphone Jack"; | |
| 57 | + widgets = "Headphone", "Headphones"; | |
| 58 | 58 | dais = <&i2s_port2 |
| 59 | 59 | &i2s_port3 |
| 60 | 60 | &i2s_port4 |
| @@ -47,6 +47,7 @@ CONFIG_ARCH_MVEBU=y · 46 unmodified lines | ||
| 47 | 47 | CONFIG_ARCH_QCOM=y |
| 48 | 48 | CONFIG_ARCH_ROCKCHIP=y |
| 49 | 49 | CONFIG_ARCH_SEATTLE=y |
| 50 | +CONFIG_ARCH_SYNQUACER=y | |
| 50 | 51 | CONFIG_ARCH_RENESAS=y |
| 51 | 52 | CONFIG_ARCH_R8A7795=y |
| 52 | 53 | CONFIG_ARCH_R8A7796=y |
| @@ -58,7 +59,6 @@ CONFIG_ARCH_R8A77995=y · 5 unmodified lines | ||
| 58 | 59 | CONFIG_ARCH_STRATIX10=y |
| 59 | 60 | CONFIG_ARCH_TEGRA=y |
| 60 | 61 | CONFIG_ARCH_SPRD=y |
| 61 | −CONFIG_ARCH_SYNQUACER=y | |
| 62 | 62 | CONFIG_ARCH_THUNDER=y |
| 63 | 63 | CONFIG_ARCH_THUNDER2=y |
| 64 | 64 | CONFIG_ARCH_UNIPHIER=y |
| @@ -67,25 +67,23 @@ CONFIG_ARCH_XGENE=y · 2 unmodified lines | ||
| 67 | 67 | CONFIG_ARCH_ZX=y |
| 68 | 68 | CONFIG_ARCH_ZYNQMP=y |
| 69 | 69 | CONFIG_PCI=y |
| 70 | −CONFIG_HOTPLUG_PCI_PCIE=y | |
| 71 | 70 | CONFIG_PCI_IOV=y |
| 72 | 71 | CONFIG_HOTPLUG_PCI=y |
| 73 | 72 | CONFIG_HOTPLUG_PCI_ACPI=y |
| 74 | −CONFIG_PCI_LAYERSCAPE=y | |
| 75 | −CONFIG_PCI_HISI=y | |
| 76 | −CONFIG_PCIE_QCOM=y | |
| 77 | −CONFIG_PCIE_KIRIN=y | |
| 78 | −CONFIG_PCIE_ARMADA_8K=y | |
| 79 | −CONFIG_PCIE_HISI_STB=y | |
| 80 | 73 | CONFIG_PCI_AARDVARK=y |
| 81 | 74 | CONFIG_PCI_TEGRA=y |
| 82 | 75 | CONFIG_PCIE_RCAR=y |
| 83 | −CONFIG_PCIE_ROCKCHIP=y | |
| 84 | −CONFIG_PCIE_ROCKCHIP_HOST=m | |
| 85 | 76 | CONFIG_PCI_HOST_GENERIC=y |
| 86 | 77 | CONFIG_PCI_XGENE=y |
| 87 | 78 | CONFIG_PCI_HOST_THUNDER_PEM=y |
| 88 | 79 | CONFIG_PCI_HOST_THUNDER_ECAM=y |
| 80 | +CONFIG_PCIE_ROCKCHIP_HOST=m | |
| 81 | +CONFIG_PCI_LAYERSCAPE=y | |
| 82 | +CONFIG_PCI_HISI=y | |
| 83 | +CONFIG_PCIE_QCOM=y | |
| 84 | +CONFIG_PCIE_ARMADA_8K=y | |
| 85 | +CONFIG_PCIE_KIRIN=y | |
| 86 | +CONFIG_PCIE_HISI_STB=y | |
| 89 | 87 | CONFIG_ARM64_VA_BITS_48=y |
| 90 | 88 | CONFIG_SCHED_MC=y |
| 91 | 89 | CONFIG_NUMA=y |
| @@ -104,8 +102,6 @@ CONFIG_HIBERNATION=y · 12 unmodified lines | ||
| 104 | 102 | CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y |
| 105 | 103 | CONFIG_ARM_CPUIDLE=y |
| 106 | 104 | CONFIG_CPU_FREQ=y |
| 107 | −CONFIG_CPU_FREQ_GOV_ATTR_SET=y | |
| 108 | −CONFIG_CPU_FREQ_GOV_COMMON=y | |
| 109 | 105 | CONFIG_CPU_FREQ_STAT=y |
| 110 | 106 | CONFIG_CPU_FREQ_GOV_POWERSAVE=m |
| 111 | 107 | CONFIG_CPU_FREQ_GOV_USERSPACE=y |
| @@ -113,11 +109,11 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=y · 1 unmodified line | ||
| 113 | 109 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m |
| 114 | 110 | CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y |
| 115 | 111 | CONFIG_CPUFREQ_DT=y |
| 112 | +CONFIG_ACPI_CPPC_CPUFREQ=m | |
| 116 | 113 | CONFIG_ARM_ARMADA_37XX_CPUFREQ=y |
| 117 | 114 | CONFIG_ARM_BIG_LITTLE_CPUFREQ=y |
| 118 | 115 | CONFIG_ARM_SCPI_CPUFREQ=y |
| 119 | 116 | CONFIG_ARM_TEGRA186_CPUFREQ=y |
| 120 | −CONFIG_ACPI_CPPC_CPUFREQ=m | |
| 121 | 117 | CONFIG_NET=y |
| 122 | 118 | CONFIG_PACKET=y |
| 123 | 119 | CONFIG_UNIX=y |
| @@ -236,11 +232,6 @@ CONFIG_SMSC911X=y · 112 unmodified lines | ||
| 236 | 232 | CONFIG_SNI_AVE=y |
| 237 | 233 | CONFIG_SNI_NETSEC=y |
| 238 | 234 | CONFIG_STMMAC_ETH=m |
| 239 | −CONFIG_DWMAC_IPQ806X=m | |
| 240 | −CONFIG_DWMAC_MESON=m | |
| 241 | −CONFIG_DWMAC_ROCKCHIP=m | |
| 242 | −CONFIG_DWMAC_SUNXI=m | |
| 243 | −CONFIG_DWMAC_SUN8I=m | |
| 244 | 235 | CONFIG_MDIO_BUS_MUX_MMIOREG=y |
| 245 | 236 | CONFIG_AT803X_PHY=m |
| 246 | 237 | CONFIG_MARVELL_PHY=m |
| @@ -269,8 +260,8 @@ CONFIG_WL18XX=m · 22 unmodified lines | ||
| 269 | 260 | CONFIG_WLCORE_SDIO=m |
| 270 | 261 | CONFIG_INPUT_EVDEV=y |
| 271 | 262 | CONFIG_KEYBOARD_ADC=m |
| 272 | −CONFIG_KEYBOARD_CROS_EC=y | |
| 273 | 263 | CONFIG_KEYBOARD_GPIO=y |
| 264 | +CONFIG_KEYBOARD_CROS_EC=y | |
| 274 | 265 | CONFIG_INPUT_TOUCHSCREEN=y |
| 275 | 266 | CONFIG_TOUCHSCREEN_ATMEL_MXT=m |
| 276 | 267 | CONFIG_INPUT_MISC=y |
| @@ -296,17 +287,13 @@ CONFIG_SERIAL_SAMSUNG=y · 19 unmodified lines | ||
| 296 | 287 | CONFIG_SERIAL_SAMSUNG_CONSOLE=y |
| 297 | 288 | CONFIG_SERIAL_TEGRA=y |
| 298 | 289 | CONFIG_SERIAL_SH_SCI=y |
| 299 | −CONFIG_SERIAL_SH_SCI_NR_UARTS=11 | |
| 300 | −CONFIG_SERIAL_SH_SCI_CONSOLE=y | |
| 301 | 290 | CONFIG_SERIAL_MSM=y |
| 302 | 291 | CONFIG_SERIAL_MSM_CONSOLE=y |
| 303 | 292 | CONFIG_SERIAL_XILINX_PS_UART=y |
| 304 | 293 | CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y |
| 305 | 294 | CONFIG_SERIAL_MVEBU_UART=y |
| 306 | 295 | CONFIG_SERIAL_DEV_BUS=y |
| 307 | −CONFIG_SERIAL_DEV_CTRL_TTYPORT=y | |
| 308 | 296 | CONFIG_VIRTIO_CONSOLE=y |
| 309 | −CONFIG_I2C_HID=m | |
| 310 | 297 | CONFIG_I2C_CHARDEV=y |
| 311 | 298 | CONFIG_I2C_MUX=y |
| 312 | 299 | CONFIG_I2C_MUX_PCA954x=y |
| @@ -325,26 +312,26 @@ CONFIG_I2C_RCAR=y · 12 unmodified lines | ||
| 325 | 312 | CONFIG_I2C_CROS_EC_TUNNEL=y |
| 326 | 313 | CONFIG_SPI=y |
| 327 | 314 | CONFIG_SPI_ARMADA_3700=y |
| 328 | −CONFIG_SPI_MESON_SPICC=m | |
| 329 | −CONFIG_SPI_MESON_SPIFC=m | |
| 330 | 315 | CONFIG_SPI_BCM2835=m |
| 331 | 316 | CONFIG_SPI_BCM2835AUX=m |
| 317 | +CONFIG_SPI_MESON_SPICC=m | |
| 318 | +CONFIG_SPI_MESON_SPIFC=m | |
| 332 | 319 | CONFIG_SPI_ORION=y |
| 333 | 320 | CONFIG_SPI_PL022=y |
| 334 | −CONFIG_SPI_QUP=y | |
| 335 | 321 | CONFIG_SPI_ROCKCHIP=y |
| 322 | +CONFIG_SPI_QUP=y | |
| 336 | 323 | CONFIG_SPI_S3C64XX=y |
| 337 | 324 | CONFIG_SPI_SPIDEV=m |
| 338 | 325 | CONFIG_SPMI=y |
| 339 | −CONFIG_PINCTRL_IPQ8074=y | |
| 340 | 326 | CONFIG_PINCTRL_SINGLE=y |
| 341 | 327 | CONFIG_PINCTRL_MAX77620=y |
| 328 | +CONFIG_PINCTRL_IPQ8074=y | |
| 342 | 329 | CONFIG_PINCTRL_MSM8916=y |
| 343 | 330 | CONFIG_PINCTRL_MSM8994=y |
| 344 | 331 | CONFIG_PINCTRL_MSM8996=y |
| 345 | −CONFIG_PINCTRL_MT7622=y | |
| 346 | 332 | CONFIG_PINCTRL_QDF2XXX=y |
| 347 | 333 | CONFIG_PINCTRL_QCOM_SPMI_PMIC=y |
| 334 | +CONFIG_PINCTRL_MT7622=y | |
| 348 | 335 | CONFIG_GPIO_DWAPB=y |
| 349 | 336 | CONFIG_GPIO_MB86S7X=y |
| 350 | 337 | CONFIG_GPIO_PL061=y |
| @@ -368,13 +355,13 @@ CONFIG_SENSORS_INA2XX=m · 17 unmodified lines | ||
| 368 | 355 | CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y |
| 369 | 356 | CONFIG_CPU_THERMAL=y |
| 370 | 357 | CONFIG_THERMAL_EMULATION=y |
| 358 | +CONFIG_ROCKCHIP_THERMAL=m | |
| 359 | +CONFIG_RCAR_GEN3_THERMAL=y | |
| 371 | 360 | CONFIG_ARMADA_THERMAL=y |
| 372 | 361 | CONFIG_BRCMSTB_THERMAL=m |
| 373 | 362 | CONFIG_EXYNOS_THERMAL=y |
| 374 | −CONFIG_RCAR_GEN3_THERMAL=y | |
| 375 | −CONFIG_QCOM_TSENS=y | |
| 376 | −CONFIG_ROCKCHIP_THERMAL=m | |
| 377 | 363 | CONFIG_TEGRA_BPMP_THERMAL=m |
| 364 | +CONFIG_QCOM_TSENS=y | |
| 378 | 365 | CONFIG_UNIPHIER_THERMAL=y |
| 379 | 366 | CONFIG_WATCHDOG=y |
| 380 | 367 | CONFIG_S3C2410_WATCHDOG=y |
| @@ -395,9 +382,9 @@ CONFIG_MFD_MAX77620=y · 14 unmodified lines | ||
| 395 | 382 | CONFIG_MFD_SPMI_PMIC=y |
| 396 | 383 | CONFIG_MFD_RK808=y |
| 397 | 384 | CONFIG_MFD_SEC_CORE=y |
| 385 | +CONFIG_REGULATOR_FIXED_VOLTAGE=y | |
| 398 | 386 | CONFIG_REGULATOR_AXP20X=y |
| 399 | 387 | CONFIG_REGULATOR_FAN53555=y |
| 400 | −CONFIG_REGULATOR_FIXED_VOLTAGE=y | |
| 401 | 388 | CONFIG_REGULATOR_GPIO=y |
| 402 | 389 | CONFIG_REGULATOR_HI6421V530=y |
| 403 | 390 | CONFIG_REGULATOR_HI655X=y |
| @@ -407,16 +394,15 @@ CONFIG_REGULATOR_QCOM_SMD_RPM=y · 3 unmodified lines | ||
| 407 | 394 | CONFIG_REGULATOR_QCOM_SPMI=y |
| 408 | 395 | CONFIG_REGULATOR_RK808=y |
| 409 | 396 | CONFIG_REGULATOR_S2MPS11=y |
| 397 | +CONFIG_RC_CORE=m | |
| 398 | +CONFIG_RC_DECODERS=y | |
| 399 | +CONFIG_RC_DEVICES=y | |
| 400 | +CONFIG_IR_MESON=m | |
| 410 | 401 | CONFIG_MEDIA_SUPPORT=m |
| 411 | 402 | CONFIG_MEDIA_CAMERA_SUPPORT=y |
| 412 | 403 | CONFIG_MEDIA_ANALOG_TV_SUPPORT=y |
| 413 | 404 | CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y |
| 414 | 405 | CONFIG_MEDIA_CONTROLLER=y |
| 415 | −CONFIG_MEDIA_RC_SUPPORT=y | |
| 416 | −CONFIG_RC_CORE=m | |
| 417 | −CONFIG_RC_DEVICES=y | |
| 418 | −CONFIG_RC_DECODERS=y | |
| 419 | −CONFIG_IR_MESON=m | |
| 420 | 406 | CONFIG_VIDEO_V4L2_SUBDEV_API=y |
| 421 | 407 | # CONFIG_DVB_NET is not set |
| 422 | 408 | CONFIG_V4L_MEM2MEM_DRIVERS=y |
| @@ -441,8 +427,7 @@ CONFIG_ROCKCHIP_DW_HDMI=y · 18 unmodified lines | ||
| 441 | 427 | CONFIG_ROCKCHIP_DW_MIPI_DSI=y |
| 442 | 428 | CONFIG_ROCKCHIP_INNO_HDMI=y |
| 443 | 429 | CONFIG_DRM_RCAR_DU=m |
| 444 | −CONFIG_DRM_RCAR_LVDS=y | |
| 445 | −CONFIG_DRM_RCAR_VSP=y | |
| 430 | +CONFIG_DRM_RCAR_LVDS=m | |
| 446 | 431 | CONFIG_DRM_TEGRA=m |
| 447 | 432 | CONFIG_DRM_PANEL_SIMPLE=m |
| 448 | 433 | CONFIG_DRM_I2C_ADV7511=m |
| @@ -455,7 +440,6 @@ CONFIG_FB_ARMCLCD=y · 6 unmodified lines | ||
| 455 | 440 | CONFIG_BACKLIGHT_GENERIC=m |
| 456 | 441 | CONFIG_BACKLIGHT_PWM=m |
| 457 | 442 | CONFIG_BACKLIGHT_LP855X=m |
| 458 | −CONFIG_FRAMEBUFFER_CONSOLE=y | |
| 459 | 443 | CONFIG_LOGO=y |
| 460 | 444 | # CONFIG_LOGO_LINUX_MONO is not set |
| 461 | 445 | # CONFIG_LOGO_LINUX_VGA16 is not set |
| @@ -468,6 +452,7 @@ CONFIG_SND_SOC_RCAR=m · 6 unmodified lines | ||
| 468 | 452 | CONFIG_SND_SOC_AK4613=m |
| 469 | 453 | CONFIG_SND_SIMPLE_CARD=m |
| 470 | 454 | CONFIG_SND_AUDIO_GRAPH_CARD=m |
| 455 | +CONFIG_I2C_HID=m | |
| 471 | 456 | CONFIG_USB=y |
| 472 | 457 | CONFIG_USB_OTG=y |
| 473 | 458 | CONFIG_USB_XHCI_HCD=y |
| @@ -501,12 +486,12 @@ CONFIG_MMC_BLOCK_MINORS=32 · 27 unmodified lines | ||
| 501 | 486 | CONFIG_MMC_ARMMMCI=y |
| 502 | 487 | CONFIG_MMC_SDHCI=y |
| 503 | 488 | CONFIG_MMC_SDHCI_ACPI=y |
| 504 | −CONFIG_MMC_SDHCI_F_SDH30=y | |
| 505 | 489 | CONFIG_MMC_SDHCI_PLTFM=y |
| 506 | 490 | CONFIG_MMC_SDHCI_OF_ARASAN=y |
| 507 | 491 | CONFIG_MMC_SDHCI_OF_ESDHC=y |
| 508 | 492 | CONFIG_MMC_SDHCI_CADENCE=y |
| 509 | 493 | CONFIG_MMC_SDHCI_TEGRA=y |
| 494 | +CONFIG_MMC_SDHCI_F_SDH30=y | |
| 510 | 495 | CONFIG_MMC_MESON_GX=y |
| 511 | 496 | CONFIG_MMC_SDHCI_MSM=y |
| 512 | 497 | CONFIG_MMC_SPI=y |
| @@ -524,11 +509,11 @@ CONFIG_LEDS_CLASS=y · 11 unmodified lines | ||
| 524 | 509 | CONFIG_LEDS_GPIO=y |
| 525 | 510 | CONFIG_LEDS_PWM=y |
| 526 | 511 | CONFIG_LEDS_SYSCON=y |
| 512 | +CONFIG_LEDS_TRIGGER_DISK=y | |
| 527 | 513 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
| 528 | 514 | CONFIG_LEDS_TRIGGER_CPU=y |
| 529 | 515 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y |
| 530 | 516 | CONFIG_LEDS_TRIGGER_PANIC=y |
| 531 | −CONFIG_LEDS_TRIGGER_DISK=y | |
| 532 | 517 | CONFIG_EDAC=y |
| 533 | 518 | CONFIG_EDAC_GHES=y |
| 534 | 519 | CONFIG_RTC_CLASS=y |
| @@ -537,13 +522,13 @@ CONFIG_RTC_DRV_RK808=m · 2 unmodified lines | ||
| 537 | 522 | CONFIG_RTC_DRV_S5M=y |
| 538 | 523 | CONFIG_RTC_DRV_DS3232=y |
| 539 | 524 | CONFIG_RTC_DRV_EFI=y |
| 525 | +CONFIG_RTC_DRV_CROS_EC=y | |
| 540 | 526 | CONFIG_RTC_DRV_S3C=y |
| 541 | 527 | CONFIG_RTC_DRV_PL031=y |
| 542 | 528 | CONFIG_RTC_DRV_SUN6I=y |
| 543 | 529 | CONFIG_RTC_DRV_ARMADA38X=y |
| 544 | 530 | CONFIG_RTC_DRV_TEGRA=y |
| 545 | 531 | CONFIG_RTC_DRV_XGENE=y |
| 546 | −CONFIG_RTC_DRV_CROS_EC=y | |
| 547 | 532 | CONFIG_DMADEVICES=y |
| 548 | 533 | CONFIG_DMA_BCM2835=m |
| 549 | 534 | CONFIG_K3_DMA=y |
| @@ -579,7 +564,6 @@ CONFIG_HWSPINLOCK_QCOM=y · 29 unmodified lines | ||
| 579 | 564 | CONFIG_ARM_MHU=y |
| 580 | 565 | CONFIG_PLATFORM_MHU=y |
| 581 | 566 | CONFIG_BCM2835_MBOX=y |
| 582 | −CONFIG_HI6220_MBOX=y | |
| 583 | 567 | CONFIG_QCOM_APCS_IPC=y |
| 584 | 568 | CONFIG_ROCKCHIP_IOMMU=y |
| 585 | 569 | CONFIG_TEGRA_IOMMU_SMMU=y |
| @@ -602,7 +586,6 @@ CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y · 16 unmodified lines | ||
| 602 | 586 | CONFIG_EXTCON_USB_GPIO=y |
| 603 | 587 | CONFIG_EXTCON_USBC_CROS_EC=y |
| 604 | 588 | CONFIG_MEMORY=y |
| 605 | −CONFIG_TEGRA_MC=y | |
| 606 | 589 | CONFIG_IIO=y |
| 607 | 590 | CONFIG_EXYNOS_ADC=y |
| 608 | 591 | CONFIG_ROCKCHIP_SARADC=m |
| @@ -618,27 +601,27 @@ CONFIG_PWM_RCAR=m · 9 unmodified lines | ||
| 618 | 601 | CONFIG_PWM_ROCKCHIP=y |
| 619 | 602 | CONFIG_PWM_SAMSUNG=y |
| 620 | 603 | CONFIG_PWM_TEGRA=m |
| 604 | +CONFIG_PHY_XGENE=y | |
| 605 | +CONFIG_PHY_SUN4I_USB=y | |
| 606 | +CONFIG_PHY_HI6220_USB=y | |
| 621 | 607 | CONFIG_PHY_HISTB_COMBPHY=y |
| 622 | 608 | CONFIG_PHY_HISI_INNO_USB2=y |
| 623 | −CONFIG_PHY_RCAR_GEN3_USB2=y | |
| 624 | −CONFIG_PHY_RCAR_GEN3_USB3=m | |
| 625 | −CONFIG_PHY_HI6220_USB=y | |
| 626 | −CONFIG_PHY_QCOM_USB_HS=y | |
| 627 | −CONFIG_PHY_SUN4I_USB=y | |
| 628 | 609 | CONFIG_PHY_MVEBU_CP110_COMPHY=y |
| 629 | 610 | CONFIG_PHY_QCOM_QMP=m |
| 630 | −CONFIG_PHY_ROCKCHIP_INNO_USB2=y | |
| 611 | +CONFIG_PHY_QCOM_USB_HS=y | |
| 612 | +CONFIG_PHY_RCAR_GEN3_USB2=y | |
| 613 | +CONFIG_PHY_RCAR_GEN3_USB3=m | |
| 631 | 614 | CONFIG_PHY_ROCKCHIP_EMMC=y |
| 615 | +CONFIG_PHY_ROCKCHIP_INNO_USB2=y | |
| 632 | 616 | CONFIG_PHY_ROCKCHIP_PCIE=m |
| 633 | 617 | CONFIG_PHY_ROCKCHIP_TYPEC=y |
| 634 | −CONFIG_PHY_XGENE=y | |
| 635 | 618 | CONFIG_PHY_TEGRA_XUSB=y |
| 636 | 619 | CONFIG_QCOM_L2_PMU=y |
| 637 | 620 | CONFIG_QCOM_L3_PMU=y |
| 638 | −CONFIG_MESON_EFUSE=m | |
| 639 | 621 | CONFIG_QCOM_QFPROM=y |
| 640 | 622 | CONFIG_ROCKCHIP_EFUSE=y |
| 641 | 623 | CONFIG_UNIPHIER_EFUSE=y |
| 624 | +CONFIG_MESON_EFUSE=m | |
| 642 | 625 | CONFIG_TEE=y |
| 643 | 626 | CONFIG_OPTEE=y |
| 644 | 627 | CONFIG_ARM_SCPI_PROTOCOL=y |
| @@ -647,7 +630,6 @@ CONFIG_EFI_CAPSULE_LOADER=y · 2 unmodified lines | ||
| 647 | 630 | CONFIG_ACPI=y |
| 648 | 631 | CONFIG_ACPI_APEI=y |
| 649 | 632 | CONFIG_ACPI_APEI_GHES=y |
| 650 | −CONFIG_ACPI_APEI_PCIEAER=y | |
| 651 | 633 | CONFIG_ACPI_APEI_MEMORY_FAILURE=y |
| 652 | 634 | CONFIG_ACPI_APEI_EINJ=y |
| 653 | 635 | CONFIG_EXT2_FS=y |
| @@ -682,7 +664,6 @@ CONFIG_DEBUG_INFO=y · 28 unmodified lines | ||
| 682 | 664 | CONFIG_DEBUG_FS=y |
| 683 | 665 | CONFIG_MAGIC_SYSRQ=y |
| 684 | 666 | CONFIG_DEBUG_KERNEL=y |
| 685 | −CONFIG_LOCKUP_DETECTOR=y | |
| 686 | 667 | # CONFIG_SCHED_DEBUG is not set |
| 687 | 668 | # CONFIG_DEBUG_PREEMPT is not set |
| 688 | 669 | # CONFIG_FTRACE is not set |
| @@ -691,20 +672,15 @@ CONFIG_SECURITY=y · 2 unmodified lines | ||
| 691 | 672 | CONFIG_CRYPTO_ECHAINIV=y |
| 692 | 673 | CONFIG_CRYPTO_ANSI_CPRNG=y |
| 693 | 674 | CONFIG_ARM64_CRYPTO=y |
| 694 | −CONFIG_CRYPTO_SHA256_ARM64=m | |
| 695 | −CONFIG_CRYPTO_SHA512_ARM64=m | |
| 696 | 675 | CONFIG_CRYPTO_SHA1_ARM64_CE=y |
| 697 | 676 | CONFIG_CRYPTO_SHA2_ARM64_CE=y |
| 677 | +CONFIG_CRYPTO_SHA512_ARM64_CE=m | |
| 678 | +CONFIG_CRYPTO_SHA3_ARM64=m | |
| 679 | +CONFIG_CRYPTO_SM3_ARM64_CE=m | |
| 698 | 680 | CONFIG_CRYPTO_GHASH_ARM64_CE=y |
| 699 | 681 | CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=m |
| 700 | 682 | CONFIG_CRYPTO_CRC32_ARM64_CE=m |
| 701 | −CONFIG_CRYPTO_AES_ARM64=m | |
| 702 | −CONFIG_CRYPTO_AES_ARM64_CE=m | |
| 703 | 683 | CONFIG_CRYPTO_AES_ARM64_CE_CCM=y |
| 704 | 684 | CONFIG_CRYPTO_AES_ARM64_CE_BLK=y |
| 705 | −CONFIG_CRYPTO_AES_ARM64_NEON_BLK=m | |
| 706 | 685 | CONFIG_CRYPTO_CHACHA20_NEON=m |
| 707 | 686 | CONFIG_CRYPTO_AES_ARM64_BS=m |
| 708 | −CONFIG_CRYPTO_SHA512_ARM64_CE=m | |
| 709 | −CONFIG_CRYPTO_SHA3_ARM64=m | |
| 710 | −CONFIG_CRYPTO_SM3_ARM64_CE=m | |
| @@ -223,8 +223,8 @@ static int ctr_encrypt(struct skcipher_request *req) · 222 unmodified lines | ||
| 223 | 223 | kernel_neon_begin(); |
| 224 | 224 | aes_ctr_encrypt(walk.dst.virt.addr, walk.src.virt.addr, |
| 225 | 225 | (u8 *)ctx->key_enc, rounds, blocks, walk.iv); |
| 226 | − err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE); | |
| 227 | 226 | kernel_neon_end(); |
| 227 | + err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE); | |
| 228 | 228 | } |
| 229 | 229 | if (walk.nbytes) { |
| 230 | 230 | u8 __aligned(8) tail[AES_BLOCK_SIZE]; |
| @@ -28,7 +28,12 @@ typedef void (*alternative_cb_t)(struct alt_instr *alt, · 27 unmodified lines | ||
| 28 | 28 | __le32 *origptr, __le32 *updptr, int nr_inst); |
| 29 | 29 | |
| 30 | 30 | void __init apply_alternatives_all(void); |
| 31 | −void apply_alternatives(void *start, size_t length); | |
| 31 | + | |
| 32 | +#ifdef CONFIG_MODULES | |
| 33 | +void apply_alternatives_module(void *start, size_t length); | |
| 34 | +#else | |
| 35 | +static inline void apply_alternatives_module(void *start, size_t length) { } | |
| 36 | +#endif | |
| 32 | 37 | |
| 33 | 38 | #define ALTINSTR_ENTRY(feature,cb) \ |
| 34 | 39 | " .word 661b - .\n" /* label */ \ |
| @@ -306,6 +306,7 @@ struct kvm_vcpu_arch { · 305 unmodified lines | ||
| 306 | 306 | #define KVM_ARM64_FP_ENABLED (1 << 1) /* guest FP regs loaded */ |
| 307 | 307 | #define KVM_ARM64_FP_HOST (1 << 2) /* host FP regs loaded */ |
| 308 | 308 | #define KVM_ARM64_HOST_SVE_IN_USE (1 << 3) /* backup for host TIF_SVE */ |
| 309 | +#define KVM_ARM64_HOST_SVE_ENABLED (1 << 4) /* SVE enabled for EL0 */ | |
| 309 | 310 | |
| 310 | 311 | #define vcpu_gp_regs(v) (&(v)->arch.ctxt.gp_regs) |
| 311 | 312 | |
| @@ -224,10 +224,8 @@ static inline void set_pte(pte_t *ptep, pte_t pte) · 223 unmodified lines | ||
| 224 | 224 | * Only if the new pte is valid and kernel, otherwise TLB maintenance |
| 225 | 225 | * or update_mmu_cache() have the necessary barriers. |
| 226 | 226 | */ |
| 227 | − if (pte_valid_not_user(pte)) { | |
| 227 | + if (pte_valid_not_user(pte)) | |
| 228 | 228 | dsb(ishst); |
| 229 | − isb(); | |
| 230 | − } | |
| 231 | 229 | } |
| 232 | 230 | |
| 233 | 231 | extern void __sync_icache_dcache(pte_t pteval); |
| @@ -434,7 +432,6 @@ static inline void set_pmd(pmd_t *pmdp, pmd_t pmd) · 200 unmodified lines | ||
| 434 | 432 | { |
| 435 | 433 | WRITE_ONCE(*pmdp, pmd); |
| 436 | 434 | dsb(ishst); |
| 437 | − isb(); | |
| 438 | 435 | } |
| 439 | 436 | |
| 440 | 437 | static inline void pmd_clear(pmd_t *pmdp) |
| @@ -485,7 +482,6 @@ static inline void set_pud(pud_t *pudp, pud_t pud) · 44 unmodified lines | ||
| 485 | 482 | { |
| 486 | 483 | WRITE_ONCE(*pudp, pud); |
| 487 | 484 | dsb(ishst); |
| 488 | − isb(); | |
| 489 | 485 | } |
| 490 | 486 | |
| 491 | 487 | static inline void pud_clear(pud_t *pudp) |
| @@ -728,6 +728,17 @@ asm( · 727 unmodified lines | ||
| 728 | 728 | asm volatile("msr_s " __stringify(r) ", %x0" : : "rZ" (__val)); \ |
| 729 | 729 | } while (0) |
| 730 | 730 | |
| 731 | +/* | |
| 732 | + * Modify bits in a sysreg. Bits in the clear mask are zeroed, then bits in the | |
| 733 | + * set mask are set. Other bits are left as-is. | |
| 734 | + */ | |
| 735 | +#define sysreg_clear_set(sysreg, clear, set) do { \ | |
| 736 | + u64 __scs_val = read_sysreg(sysreg); \ | |
| 737 | + u64 __scs_new = (__scs_val & ~(u64)(clear)) | (set); \ | |
| 738 | + if (__scs_new != __scs_val) \ | |
| 739 | + write_sysreg(__scs_new, sysreg); \ | |
| 740 | +} while (0) | |
| 741 | + | |
| 731 | 742 | static inline void config_sctlr_el1(u32 clear, u32 set) |
| 732 | 743 | { |
| 733 | 744 | u32 val; |
| @@ -122,7 +122,30 @@ static void patch_alternative(struct alt_instr *alt, · 121 unmodified lines | ||
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | −static void __apply_alternatives(void *alt_region, bool use_linear_alias) | |
| 125 | +/* | |
| 126 | + * We provide our own, private D-cache cleaning function so that we don't | |
| 127 | + * accidentally call into the cache.S code, which is patched by us at | |
| 128 | + * runtime. | |
| 129 | + */ | |
| 130 | +static void clean_dcache_range_nopatch(u64 start, u64 end) | |
| 131 | +{ | |
| 132 | + u64 cur, d_size, ctr_el0; | |
| 133 | + | |
| 134 | + ctr_el0 = read_sanitised_ftr_reg(SYS_CTR_EL0); | |
| 135 | + d_size = 4 << cpuid_feature_extract_unsigned_field(ctr_el0, | |
| 136 | + CTR_DMINLINE_SHIFT); | |
| 137 | + cur = start & ~(d_size - 1); | |
| 138 | + do { | |
| 139 | + /* | |
| 140 | + * We must clean+invalidate to the PoC in order to avoid | |
| 141 | + * Cortex-A53 errata 826319, 827319, 824069 and 819472 | |
| 142 | + * (this corresponds to ARM64_WORKAROUND_CLEAN_CACHE) | |
| 143 | + */ | |
| 144 | + asm volatile("dc civac, %0" : : "r" (cur) : "memory"); | |
| 145 | + } while (cur += d_size, cur < end); | |
| 146 | +} | |
| 147 | + | |
| 148 | +static void __apply_alternatives(void *alt_region, bool is_module) | |
| 126 | 149 | { |
| 127 | 150 | struct alt_instr *alt; |
| 128 | 151 | struct alt_region *region = alt_region; |
| @@ -145,7 +168,7 @@ static void __apply_alternatives(void *alt_region, bool use_linear_alias) · 16 unmodified lines | ||
| 145 | 168 | pr_info_once("patching kernel code\n"); |
| 146 | 169 | |
| 147 | 170 | origptr = ALT_ORIG_PTR(alt); |
| 148 | − updptr = use_linear_alias ? lm_alias(origptr) : origptr; | |
| 171 | + updptr = is_module ? origptr : lm_alias(origptr); | |
| 149 | 172 | nr_inst = alt->orig_len / AARCH64_INSN_SIZE; |
| 150 | 173 | |
| 151 | 174 | if (alt->cpufeature < ARM64_CB_PATCH) |
| @@ -155,8 +178,20 @@ static void __apply_alternatives(void *alt_region, bool use_linear_alias) · 3 unmodified lines | ||
| 155 | 178 | |
| 156 | 179 | alt_cb(alt, origptr, updptr, nr_inst); |
| 157 | 180 | |
| 158 | − flush_icache_range((uintptr_t)origptr, | |
| 159 | − (uintptr_t)(origptr + nr_inst)); | |
| 181 | + if (!is_module) { | |
| 182 | + clean_dcache_range_nopatch((u64)origptr, | |
| 183 | + (u64)(origptr + nr_inst)); | |
| 184 | + } | |
| 185 | + } | |
| 186 | + | |
| 187 | + /* | |
| 188 | + * The core module code takes care of cache maintenance in | |
| 189 | + * flush_module_icache(). | |
| 190 | + */ | |
| 191 | + if (!is_module) { | |
| 192 | + dsb(ish); | |
| 193 | + __flush_icache_all(); | |
| 194 | + isb(); | |
| 160 | 195 | } |
| 161 | 196 | } |
| 162 | 197 | |
| @@ -178,7 +213,7 @@ static int __apply_alternatives_multi_stop(void *unused) · 15 unmodified lines | ||
| 178 | 213 | isb(); |
| 179 | 214 | } else { |
| 180 | 215 | BUG_ON(alternatives_applied); |
| 181 | − __apply_alternatives(®ion, true); | |
| 216 | + __apply_alternatives(®ion, false); | |
| 182 | 217 | /* Barriers provided by the cache flushing */ |
| 183 | 218 | WRITE_ONCE(alternatives_applied, 1); |
| 184 | 219 | } |
| @@ -192,12 +227,14 @@ void __init apply_alternatives_all(void) · 7 unmodified lines | ||
| 192 | 227 | stop_machine(__apply_alternatives_multi_stop, NULL, cpu_online_mask); |
| 193 | 228 | } |
| 194 | 229 | |
| 195 | −void apply_alternatives(void *start, size_t length) | |
| 230 | +#ifdef CONFIG_MODULES | |
| 231 | +void apply_alternatives_module(void *start, size_t length) | |
| 196 | 232 | { |
| 197 | 233 | struct alt_region region = { |
| 198 | 234 | .begin = start, |
| 199 | 235 | .end = start + length, |
| 200 | 236 | }; |
| 201 | 237 | |
| 202 | − __apply_alternatives(®ion, false); | |
| 238 | + __apply_alternatives(®ion, true); | |
| 203 | 239 | } |
| 240 | +#endif | |
| @@ -937,7 +937,7 @@ static int __init parse_kpti(char *str) · 936 unmodified lines | ||
| 937 | 937 | __kpti_forced = enabled ? 1 : -1; |
| 938 | 938 | return 0; |
| 939 | 939 | } |
| 940 | −__setup("kpti=", parse_kpti); | |
| 940 | +early_param("kpti", parse_kpti); | |
| 941 | 941 | #endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */ |
| 942 | 942 | |
| 943 | 943 | #ifdef CONFIG_ARM64_HW_AFDBM |
| @@ -448,9 +448,8 @@ int module_finalize(const Elf_Ehdr *hdr, · 447 unmodified lines | ||
| 448 | 448 | const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; |
| 449 | 449 | |
| 450 | 450 | for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) { |
| 451 | − if (strcmp(".altinstructions", secstrs + s->sh_name) == 0) { | |
| 452 | − apply_alternatives((void *)s->sh_addr, s->sh_size); | |
| 453 | − } | |
| 451 | + if (strcmp(".altinstructions", secstrs + s->sh_name) == 0) | |
| 452 | + apply_alternatives_module((void *)s->sh_addr, s->sh_size); | |
| 454 | 453 | #ifdef CONFIG_ARM64_MODULE_PLTS |
| 455 | 454 | if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE) && |
| 456 | 455 | !strcmp(".text.ftrace_trampoline", secstrs + s->sh_name)) |
| @@ -179,7 +179,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) · 178 unmodified lines | ||
| 179 | 179 | * This is the secondary CPU boot entry. We're using this CPUs |
| 180 | 180 | * idle thread stack, but a set of temporary page tables. |
| 181 | 181 | */ |
| 182 | −asmlinkage void secondary_start_kernel(void) | |
| 182 | +asmlinkage notrace void secondary_start_kernel(void) | |
| 183 | 183 | { |
| 184 | 184 | u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK; |
| 185 | 185 | struct mm_struct *mm = &init_mm; |
| @@ -5,13 +5,14 @@ · 4 unmodified lines | ||
| 5 | 5 | * Copyright 2018 Arm Limited |
| 6 | 6 | * Author: Dave Martin <Dave.Martin@arm.com> |
| 7 | 7 | */ |
| 8 | −#include <linux/bottom_half.h> | |
| 8 | +#include <linux/irqflags.h> | |
| 9 | 9 | #include <linux/sched.h> |
| 10 | 10 | #include <linux/thread_info.h> |
| 11 | 11 | #include <linux/kvm_host.h> |
| 12 | 12 | #include <asm/kvm_asm.h> |
| 13 | 13 | #include <asm/kvm_host.h> |
| 14 | 14 | #include <asm/kvm_mmu.h> |
| 15 | +#include <asm/sysreg.h> | |
| 15 | 16 | |
| 16 | 17 | /* |
| 17 | 18 | * Called on entry to KVM_RUN unless this vcpu previously ran at least |
| @@ -61,10 +62,16 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu) · 43 unmodified lines | ||
| 61 | 62 | { |
| 62 | 63 | BUG_ON(!current->mm); |
| 63 | 64 | |
| 64 | − vcpu->arch.flags &= ~(KVM_ARM64_FP_ENABLED | KVM_ARM64_HOST_SVE_IN_USE); | |
| 65 | + vcpu->arch.flags &= ~(KVM_ARM64_FP_ENABLED | | |
| 66 | + KVM_ARM64_HOST_SVE_IN_USE | | |
| 67 | + KVM_ARM64_HOST_SVE_ENABLED); | |
| 65 | 68 | vcpu->arch.flags |= KVM_ARM64_FP_HOST; |
| 69 | + | |
| 66 | 70 | if (test_thread_flag(TIF_SVE)) |
| 67 | 71 | vcpu->arch.flags |= KVM_ARM64_HOST_SVE_IN_USE; |
| 72 | + | |
| 73 | + if (read_sysreg(cpacr_el1) & CPACR_EL1_ZEN_EL0EN) | |
| 74 | + vcpu->arch.flags |= KVM_ARM64_HOST_SVE_ENABLED; | |
| 68 | 75 | } |
| 69 | 76 | |
| 70 | 77 | /* |
| @@ -92,19 +99,30 @@ void kvm_arch_vcpu_ctxsync_fp(struct kvm_vcpu *vcpu) · 21 unmodified lines | ||
| 92 | 99 | */ |
| 93 | 100 | void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu) |
| 94 | 101 | { |
| 95 | − local_bh_disable(); | |
| 102 | + unsigned long flags; | |
| 96 | 103 | |
| 97 | − update_thread_flag(TIF_SVE, | |
| 98 | − vcpu->arch.flags & KVM_ARM64_HOST_SVE_IN_USE); | |
| 104 | + local_irq_save(flags); | |
| 99 | 105 | |
| 100 | 106 | if (vcpu->arch.flags & KVM_ARM64_FP_ENABLED) { |
| 101 | 107 | /* Clean guest FP state to memory and invalidate cpu view */ |
| 102 | 108 | fpsimd_save(); |
| 103 | 109 | fpsimd_flush_cpu_state(); |
| 104 | − } else if (!test_thread_flag(TIF_FOREIGN_FPSTATE)) { | |
| 105 | − /* Ensure user trap controls are correctly restored */ | |
| 106 | − fpsimd_bind_task_to_cpu(); | |
| 110 | + } else if (system_supports_sve()) { | |
| 111 | + /* | |
| 112 | + * The FPSIMD/SVE state in the CPU has not been touched, and we | |
| 113 | + * have SVE (and VHE): CPACR_EL1 (alias CPTR_EL2) has been | |
| 114 | + * reset to CPACR_EL1_DEFAULT by the Hyp code, disabling SVE | |
| 115 | + * for EL0. To avoid spurious traps, restore the trap state | |
| 116 | + * seen by kvm_arch_vcpu_load_fp(): | |
| 117 | + */ | |
| 118 | + if (vcpu->arch.flags & KVM_ARM64_HOST_SVE_ENABLED) | |
| 119 | + sysreg_clear_set(CPACR_EL1, 0, CPACR_EL1_ZEN_EL0EN); | |
| 120 | + else | |
| 121 | + sysreg_clear_set(CPACR_EL1, CPACR_EL1_ZEN_EL0EN, 0); | |
| 107 | 122 | } |
| 108 | 123 | |
| 109 | − local_bh_enable(); | |
| 124 | + update_thread_flag(TIF_SVE, | |
| 125 | + vcpu->arch.flags & KVM_ARM64_HOST_SVE_IN_USE); | |
| 126 | + | |
| 127 | + local_irq_restore(flags); | |
| 110 | 128 | } |
| @@ -583,13 +583,14 @@ static void *__iommu_alloc_attrs(struct device *dev, size_t size, · 582 unmodified lines | ||
| 583 | 583 | size >> PAGE_SHIFT); |
| 584 | 584 | return NULL; |
| 585 | 585 | } |
| 586 | − if (!coherent) | |
| 587 | − __dma_flush_area(page_to_virt(page), iosize); | |
| 588 | − | |
| 589 | 586 | addr = dma_common_contiguous_remap(page, size, VM_USERMAP, |
| 590 | 587 | prot, |
| 591 | 588 | __builtin_return_address(0)); |
| 592 | − if (!addr) { | |
| 589 | + if (addr) { | |
| 590 | + memset(addr, 0, size); | |
| 591 | + if (!coherent) | |
| 592 | + __dma_flush_area(page_to_virt(page), iosize); | |
| 593 | + } else { | |
| 593 | 594 | iommu_dma_unmap_page(dev, *handle, iosize, 0, attrs); |
| 594 | 595 | dma_release_from_contiguous(dev, page, |
| 595 | 596 | size >> PAGE_SHIFT); |
| @@ -217,8 +217,9 @@ ENDPROC(idmap_cpu_replace_ttbr1) · 216 unmodified lines | ||
| 217 | 217 | |
| 218 | 218 | .macro __idmap_kpti_put_pgtable_ent_ng, type |
| 219 | 219 | orr \type, \type, #PTE_NG // Same bit for blocks and pages |
| 220 | − str \type, [cur_\()\type\()p] // Update the entry and ensure it | |
| 221 | − dc civac, cur_\()\type\()p // is visible to all CPUs. | |
| 220 | + str \type, [cur_\()\type\()p] // Update the entry and ensure | |
| 221 | + dmb sy // that it is visible to all | |
| 222 | + dc civac, cur_\()\type\()p // CPUs. | |
| 222 | 223 | .endm |
| 223 | 224 | |
| 224 | 225 | /* |
| @@ -8,11 +8,4 @@ config TRACE_IRQFLAGS_SUPPORT · 7 unmodified lines | ||
| 8 | 8 | |
| 9 | 9 | source "lib/Kconfig.debug" |
| 10 | 10 | |
| 11 | −config HEART_BEAT | |
| 12 | − bool "Heart beat function for kernel" | |
| 13 | − default n | |
| 14 | − help | |
| 15 | − This option turns on/off heart beat kernel functionality. | |
| 16 | − First GPIO node is taken. | |
| 17 | − | |
| 18 | 11 | endmenu |
| @@ -19,15 +19,10 @@ extern char cmd_line[COMMAND_LINE_SIZE]; · 18 unmodified lines | ||
| 19 | 19 | |
| 20 | 20 | extern char *klimit; |
| 21 | 21 | |
| 22 | −void microblaze_heartbeat(void); | |
| 23 | −void microblaze_setup_heartbeat(void); | |
| 24 | − | |
| 25 | 22 | # ifdef CONFIG_MMU |
| 26 | 23 | extern void mmu_reset(void); |
| 27 | 24 | # endif /* CONFIG_MMU */ |
| 28 | 25 | |
| 29 | −extern void of_platform_reset_gpio_probe(void); | |
| 30 | − | |
| 31 | 26 | void time_init(void); |
| 32 | 27 | void init_IRQ(void); |
| 33 | 28 | void machine_early_init(const char *cmdline, unsigned int ram, |
| @@ -38,6 +38,6 @@ · 37 unmodified lines | ||
| 38 | 38 | |
| 39 | 39 | #endif /* __ASSEMBLY__ */ |
| 40 | 40 | |
| 41 | −#define __NR_syscalls 399 | |
| 41 | +#define __NR_syscalls 401 | |
| 42 | 42 | |
| 43 | 43 | #endif /* _ASM_MICROBLAZE_UNISTD_H */ |
| @@ -415,5 +415,7 @@ · 414 unmodified lines | ||
| 415 | 415 | #define __NR_pkey_alloc 396 |
| 416 | 416 | #define __NR_pkey_free 397 |
| 417 | 417 | #define __NR_statx 398 |
| 418 | +#define __NR_io_pgetevents 399 | |
| 419 | +#define __NR_rseq 400 | |
| 418 | 420 | |
| 419 | 421 | #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ |
| @@ -8,7 +8,6 @@ ifdef CONFIG_FUNCTION_TRACER · 7 unmodified lines | ||
| 8 | 8 | CFLAGS_REMOVE_timer.o = -pg |
| 9 | 9 | CFLAGS_REMOVE_intc.o = -pg |
| 10 | 10 | CFLAGS_REMOVE_early_printk.o = -pg |
| 11 | −CFLAGS_REMOVE_heartbeat.o = -pg | |
| 12 | 11 | CFLAGS_REMOVE_ftrace.o = -pg |
| 13 | 12 | CFLAGS_REMOVE_process.o = -pg |
| 14 | 13 | endif |
| @@ -17,12 +16,11 @@ extra-y := head.o vmlinux.lds · 2 unmodified lines | ||
| 17 | 16 | |
| 18 | 17 | obj-y += dma.o exceptions.o \ |
| 19 | 18 | hw_exception_handler.o irq.o \ |
| 20 | − platform.o process.o prom.o ptrace.o \ | |
| 19 | + process.o prom.o ptrace.o \ | |
| 21 | 20 | reset.o setup.o signal.o sys_microblaze.o timer.o traps.o unwind.o |
| 22 | 21 | |
| 23 | 22 | obj-y += cpu/ |
| 24 | 23 | |
| 25 | −obj-$(CONFIG_HEART_BEAT) += heartbeat.o | |
| 26 | 24 | obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o |
| 27 | 25 | obj-$(CONFIG_MMU) += misc.o |
| 28 | 26 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
| @@ -1,72 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu> | |
| 3 | − * Copyright (C) 2007-2009 PetaLogix | |
| 4 | − * Copyright (C) 2006 Atmark Techno, Inc. | |
| 5 | − * | |
| 6 | − * This file is subject to the terms and conditions of the GNU General Public | |
| 7 | − * License. See the file "COPYING" in the main directory of this archive | |
| 8 | − * for more details. | |
| 9 | − */ | |
| 10 | − | |
| 11 | −#include <linux/sched.h> | |
| 12 | −#include <linux/sched/loadavg.h> | |
| 13 | −#include <linux/io.h> | |
| 14 | − | |
| 15 | −#include <asm/setup.h> | |
| 16 | −#include <asm/page.h> | |
| 17 | −#include <asm/prom.h> | |
| 18 | − | |
| 19 | −static unsigned int base_addr; | |
| 20 | − | |
| 21 | −void microblaze_heartbeat(void) | |
| 22 | −{ | |
| 23 | − static unsigned int cnt, period, dist; | |
| 24 | − | |
| 25 | − if (base_addr) { | |
| 26 | − if (cnt == 0 || cnt == dist) | |
| 27 | − out_be32(base_addr, 1); | |
| 28 | − else if (cnt == 7 || cnt == dist + 7) | |
| 29 | − out_be32(base_addr, 0); | |
| 30 | − | |
| 31 | − if (++cnt > period) { | |
| 32 | − cnt = 0; | |
| 33 | − /* | |
| 34 | − * The hyperbolic function below modifies the heartbeat | |
| 35 | − * period length in dependency of the current (5min) | |
| 36 | − * load. It goes through the points f(0)=126, f(1)=86, | |
| 37 | − * f(5)=51, f(inf)->30. | |
| 38 | − */ | |
| 39 | − period = ((672 << FSHIFT) / (5 * avenrun[0] + | |
| 40 | − (7 << FSHIFT))) + 30; | |
| 41 | − dist = period / 4; | |
| 42 | − } | |
| 43 | − } | |
| 44 | −} | |
| 45 | − | |
| 46 | −void microblaze_setup_heartbeat(void) | |
| 47 | −{ | |
| 48 | − struct device_node *gpio = NULL; | |
| 49 | − int *prop; | |
| 50 | − int j; | |
| 51 | − const char * const gpio_list[] = { | |
| 52 | − "xlnx,xps-gpio-1.00.a", | |
| 53 | − NULL | |
| 54 | − }; | |
| 55 | − | |
| 56 | − for (j = 0; gpio_list[j] != NULL; j++) { | |
| 57 | − gpio = of_find_compatible_node(NULL, NULL, gpio_list[j]); | |
| 58 | − if (gpio) | |
| 59 | − break; | |
| 60 | − } | |
| 61 | − | |
| 62 | − if (gpio) { | |
| 63 | − base_addr = be32_to_cpup(of_get_property(gpio, "reg", NULL)); | |
| 64 | − base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE); | |
| 65 | − pr_notice("Heartbeat GPIO at 0x%x\n", base_addr); | |
| 66 | − | |
| 67 | − /* GPIO is configured as output */ | |
| 68 | − prop = (int *) of_get_property(gpio, "xlnx,is-bidir", NULL); | |
| 69 | − if (prop) | |
| 70 | − out_be32(base_addr + 4, 0); | |
| 71 | − } | |
| 72 | −} | |
| @@ -1,29 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − * Copyright 2008 Michal Simek <monstr@monstr.eu> | |
| 3 | − * | |
| 4 | − * based on virtex.c file | |
| 5 | − * | |
| 6 | − * Copyright 2007 Secret Lab Technologies Ltd. | |
| 7 | − * | |
| 8 | − * This file is licensed under the terms of the GNU General Public License | |
| 9 | − * version 2. This program is licensed "as is" without any warranty of any | |
| 10 | − * kind, whether express or implied. | |
| 11 | − */ | |
| 12 | − | |
| 13 | −#include <linux/init.h> | |
| 14 | −#include <linux/of_platform.h> | |
| 15 | −#include <asm/setup.h> | |
| 16 | − | |
| 17 | −static struct of_device_id xilinx_of_bus_ids[] __initdata = { | |
| 18 | − { .compatible = "simple-bus", }, | |
| 19 | − { .compatible = "xlnx,compound", }, | |
| 20 | − {} | |
| 21 | −}; | |
| 22 | − | |
| 23 | −static int __init microblaze_device_probe(void) | |
| 24 | −{ | |
| 25 | − of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL); | |
| 26 | − of_platform_reset_gpio_probe(); | |
| 27 | − return 0; | |
| 28 | −} | |
| 29 | −device_initcall(microblaze_device_probe); | |
| @@ -18,7 +18,7 @@ · 17 unmodified lines | ||
| 18 | 18 | static int handle; /* reset pin handle */ |
| 19 | 19 | static unsigned int reset_val; |
| 20 | 20 | |
| 21 | −void of_platform_reset_gpio_probe(void) | |
| 21 | +static int of_platform_reset_gpio_probe(void) | |
| 22 | 22 | { |
| 23 | 23 | int ret; |
| 24 | 24 | handle = of_get_named_gpio(of_find_node_by_path("/"), |
| @@ -27,13 +27,13 @@ void of_platform_reset_gpio_probe(void) · 2 unmodified lines | ||
| 27 | 27 | if (!gpio_is_valid(handle)) { |
| 28 | 28 | pr_info("Skipping unavailable RESET gpio %d (%s)\n", |
| 29 | 29 | handle, "reset"); |
| 30 | − return; | |
| 30 | + return -ENODEV; | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | ret = gpio_request(handle, "reset"); |
| 34 | 34 | if (ret < 0) { |
| 35 | 35 | pr_info("GPIO pin is already allocated\n"); |
| 36 | − return; | |
| 36 | + return ret; | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /* get current setup value */ |
| @@ -51,11 +51,12 @@ void of_platform_reset_gpio_probe(void) · 11 unmodified lines | ||
| 51 | 51 | |
| 52 | 52 | pr_info("RESET: Registered gpio device: %d, current val: %d\n", |
| 53 | 53 | handle, reset_val); |
| 54 | − return; | |
| 54 | + return 0; | |
| 55 | 55 | err: |
| 56 | 56 | gpio_free(handle); |
| 57 | − return; | |
| 57 | + return ret; | |
| 58 | 58 | } |
| 59 | +device_initcall(of_platform_reset_gpio_probe); | |
| 59 | 60 | |
| 60 | 61 | |
| 61 | 62 | static void gpio_system_reset(void) |
| @@ -400,3 +400,5 @@ ENTRY(sys_call_table) · 399 unmodified lines | ||
| 400 | 400 | .long sys_pkey_alloc |
| 401 | 401 | .long sys_pkey_free |
| 402 | 402 | .long sys_statx |
| 403 | + .long sys_io_pgetevents | |
| 404 | + .long sys_rseq | |
| @@ -156,9 +156,6 @@ static inline void timer_ack(void) · 155 unmodified lines | ||
| 156 | 156 | static irqreturn_t timer_interrupt(int irq, void *dev_id) |
| 157 | 157 | { |
| 158 | 158 | struct clock_event_device *evt = &clockevent_xilinx_timer; |
| 159 | −#ifdef CONFIG_HEART_BEAT | |
| 160 | − microblaze_heartbeat(); | |
| 161 | −#endif | |
| 162 | 159 | timer_ack(); |
| 163 | 160 | evt->event_handler(evt); |
| 164 | 161 | return IRQ_HANDLED; |
| @@ -318,10 +315,6 @@ static int __init xilinx_timer_init(struct device_node *timer) · 153 unmodified lines | ||
| 318 | 315 | return ret; |
| 319 | 316 | } |
| 320 | 317 | |
| 321 | −#ifdef CONFIG_HEART_BEAT | |
| 322 | − microblaze_setup_heartbeat(); | |
| 323 | −#endif | |
| 324 | − | |
| 325 | 318 | ret = xilinx_clocksource_init(); |
| 326 | 319 | if (ret) |
| 327 | 320 | return ret; |
| @@ -65,6 +65,7 @@ config MIPS · 64 unmodified lines | ||
| 65 | 65 | select HAVE_OPROFILE |
| 66 | 66 | select HAVE_PERF_EVENTS |
| 67 | 67 | select HAVE_REGS_AND_STACK_ACCESS_API |
| 68 | + select HAVE_RSEQ | |
| 68 | 69 | select HAVE_STACKPROTECTOR |
| 69 | 70 | select HAVE_SYSCALL_TRACEPOINTS |
| 70 | 71 | select HAVE_VIRT_CPU_ACCOUNTING_GEN if 64BIT || !SMP |
| @@ -34,7 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | #define PB44_KEYS_DEBOUNCE_INTERVAL (3 * PB44_KEYS_POLL_INTERVAL) |
| 35 | 35 | |
| 36 | 36 | static struct gpiod_lookup_table pb44_i2c_gpiod_table = { |
| 37 | − .dev_id = "i2c-gpio", | |
| 37 | + .dev_id = "i2c-gpio.0", | |
| 38 | 38 | .table = { |
| 39 | 39 | GPIO_LOOKUP_IDX("ath79-gpio", PB44_GPIO_I2C_SDA, |
| 40 | 40 | NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), |
| @@ -212,6 +212,12 @@ static int __init bcm47xx_cpu_fixes(void) · 211 unmodified lines | ||
| 212 | 212 | */ |
| 213 | 213 | if (bcm47xx_bus.bcma.bus.chipinfo.id == BCMA_CHIP_ID_BCM4706) |
| 214 | 214 | cpu_wait = NULL; |
| 215 | + | |
| 216 | + /* | |
| 217 | + * BCM47XX Erratum "R10: PCIe Transactions Periodically Fail" | |
| 218 | + * Enable ExternalSync for sync instruction to take effect | |
| 219 | + */ | |
| 220 | + set_c0_config7(MIPS_CONF7_ES); | |
| 215 | 221 | break; |
| 216 | 222 | #endif |
| 217 | 223 | } |
| @@ -414,6 +414,8 @@ static inline type pfx##in##bwlq##p(unsigned long port) \ · 413 unmodified lines | ||
| 414 | 414 | __val = *__addr; \ |
| 415 | 415 | slow; \ |
| 416 | 416 | \ |
| 417 | + /* prevent prefetching of coherent DMA data prematurely */ \ | |
| 418 | + rmb(); \ | |
| 417 | 419 | return pfx##ioswab##bwlq(__addr, __val); \ |
| 418 | 420 | } |
| 419 | 421 | |
| @@ -681,6 +681,8 @@ · 680 unmodified lines | ||
| 681 | 681 | #define MIPS_CONF7_WII (_ULCAST_(1) << 31) |
| 682 | 682 | |
| 683 | 683 | #define MIPS_CONF7_RPS (_ULCAST_(1) << 2) |
| 684 | +/* ExternalSync */ | |
| 685 | +#define MIPS_CONF7_ES (_ULCAST_(1) << 8) | |
| 684 | 686 | |
| 685 | 687 | #define MIPS_CONF7_IAR (_ULCAST_(1) << 10) |
| 686 | 688 | #define MIPS_CONF7_AR (_ULCAST_(1) << 16) |
| @@ -2765,6 +2767,7 @@ __BUILD_SET_C0(status) · 2078 unmodified lines | ||
| 2765 | 2767 | __BUILD_SET_C0(cause) |
| 2766 | 2768 | __BUILD_SET_C0(config) |
| 2767 | 2769 | __BUILD_SET_C0(config5) |
| 2770 | +__BUILD_SET_C0(config7) | |
| 2768 | 2771 | __BUILD_SET_C0(intcontrol) |
| 2769 | 2772 | __BUILD_SET_C0(intctl) |
| 2770 | 2773 | __BUILD_SET_C0(srsmap) |
| @@ -388,17 +388,19 @@ · 387 unmodified lines | ||
| 388 | 388 | #define __NR_pkey_alloc (__NR_Linux + 364) |
| 389 | 389 | #define __NR_pkey_free (__NR_Linux + 365) |
| 390 | 390 | #define __NR_statx (__NR_Linux + 366) |
| 391 | +#define __NR_rseq (__NR_Linux + 367) | |
| 392 | +#define __NR_io_pgetevents (__NR_Linux + 368) | |
| 391 | 393 | |
| 392 | 394 | |
| 393 | 395 | /* |
| 394 | 396 | * Offset of the last Linux o32 flavoured syscall |
| 395 | 397 | */ |
| 396 | −#define __NR_Linux_syscalls 366 | |
| 398 | +#define __NR_Linux_syscalls 368 | |
| 397 | 399 | |
| 398 | 400 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
| 399 | 401 | |
| 400 | 402 | #define __NR_O32_Linux 4000 |
| 401 | −#define __NR_O32_Linux_syscalls 366 | |
| 403 | +#define __NR_O32_Linux_syscalls 368 | |
| 402 | 404 | |
| 403 | 405 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
| 404 | 406 | |
| @@ -733,16 +735,18 @@ · 328 unmodified lines | ||
| 733 | 735 | #define __NR_pkey_alloc (__NR_Linux + 324) |
| 734 | 736 | #define __NR_pkey_free (__NR_Linux + 325) |
| 735 | 737 | #define __NR_statx (__NR_Linux + 326) |
| 738 | +#define __NR_rseq (__NR_Linux + 327) | |
| 739 | +#define __NR_io_pgetevents (__NR_Linux + 328) | |
| 736 | 740 | |
| 737 | 741 | /* |
| 738 | 742 | * Offset of the last Linux 64-bit flavoured syscall |
| 739 | 743 | */ |
| 740 | −#define __NR_Linux_syscalls 326 | |
| 744 | +#define __NR_Linux_syscalls 328 | |
| 741 | 745 | |
| 742 | 746 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
| 743 | 747 | |
| 744 | 748 | #define __NR_64_Linux 5000 |
| 745 | −#define __NR_64_Linux_syscalls 326 | |
| 749 | +#define __NR_64_Linux_syscalls 328 | |
| 746 | 750 | |
| 747 | 751 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
| 748 | 752 | |
| @@ -1081,15 +1085,17 @@ · 332 unmodified lines | ||
| 1081 | 1085 | #define __NR_pkey_alloc (__NR_Linux + 328) |
| 1082 | 1086 | #define __NR_pkey_free (__NR_Linux + 329) |
| 1083 | 1087 | #define __NR_statx (__NR_Linux + 330) |
| 1088 | +#define __NR_rseq (__NR_Linux + 331) | |
| 1089 | +#define __NR_io_pgetevents (__NR_Linux + 332) | |
| 1084 | 1090 | |
| 1085 | 1091 | /* |
| 1086 | 1092 | * Offset of the last N32 flavoured syscall |
| 1087 | 1093 | */ |
| 1088 | −#define __NR_Linux_syscalls 330 | |
| 1094 | +#define __NR_Linux_syscalls 332 | |
| 1089 | 1095 | |
| 1090 | 1096 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
| 1091 | 1097 | |
| 1092 | 1098 | #define __NR_N32_Linux 6000 |
| 1093 | −#define __NR_N32_Linux_syscalls 330 | |
| 1099 | +#define __NR_N32_Linux_syscalls 332 | |
| 1094 | 1100 | |
| 1095 | 1101 | #endif /* _UAPI_ASM_UNISTD_H */ |
| @@ -79,6 +79,10 @@ FEXPORT(ret_from_fork) · 78 unmodified lines | ||
| 79 | 79 | jal schedule_tail # a0 = struct task_struct *prev |
| 80 | 80 | |
| 81 | 81 | FEXPORT(syscall_exit) |
| 82 | +#ifdef CONFIG_DEBUG_RSEQ | |
| 83 | + move a0, sp | |
| 84 | + jal rseq_syscall | |
| 85 | +#endif | |
| 82 | 86 | local_irq_disable # make sure need_resched and |
| 83 | 87 | # signals dont change between |
| 84 | 88 | # sampling and return |
| @@ -141,6 +145,10 @@ work_notifysig: # deal with pending signals and · 56 unmodified lines | ||
| 141 | 145 | j resume_userspace_check |
| 142 | 146 | |
| 143 | 147 | FEXPORT(syscall_exit_partial) |
| 148 | +#ifdef CONFIG_DEBUG_RSEQ | |
| 149 | + move a0, sp | |
| 150 | + jal rseq_syscall | |
| 151 | +#endif | |
| 144 | 152 | local_irq_disable # make sure need_resched doesn't |
| 145 | 153 | # change between and return |
| 146 | 154 | LONG_L a2, TI_FLAGS($28) # current->work |
| @@ -119,10 +119,20 @@ NESTED(_mcount, PT_SIZE, ra) · 118 unmodified lines | ||
| 119 | 119 | EXPORT_SYMBOL(_mcount) |
| 120 | 120 | PTR_LA t1, ftrace_stub |
| 121 | 121 | PTR_L t2, ftrace_trace_function /* Prepare t2 for (1) */ |
| 122 | − bne t1, t2, static_trace | |
| 122 | + beq t1, t2, fgraph_trace | |
| 123 | 123 | nop |
| 124 | 124 | |
| 125 | + MCOUNT_SAVE_REGS | |
| 126 | + | |
| 127 | + move a0, ra /* arg1: self return address */ | |
| 128 | + jalr t2 /* (1) call *ftrace_trace_function */ | |
| 129 | + move a1, AT /* arg2: parent's return address */ | |
| 130 | + | |
| 131 | + MCOUNT_RESTORE_REGS | |
| 132 | + | |
| 133 | +fgraph_trace: | |
| 125 | 134 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 135 | + PTR_LA t1, ftrace_stub | |
| 126 | 136 | PTR_L t3, ftrace_graph_return |
| 127 | 137 | bne t1, t3, ftrace_graph_caller |
| 128 | 138 | nop |
| @@ -131,24 +141,11 @@ EXPORT_SYMBOL(_mcount) · 2 unmodified lines | ||
| 131 | 141 | bne t1, t3, ftrace_graph_caller |
| 132 | 142 | nop |
| 133 | 143 | #endif |
| 134 | − b ftrace_stub | |
| 135 | −#ifdef CONFIG_32BIT | |
| 136 | − addiu sp, sp, 8 | |
| 137 | −#else | |
| 138 | − nop | |
| 139 | −#endif | |
| 140 | 144 | |
| 141 | −static_trace: | |
| 142 | − MCOUNT_SAVE_REGS | |
| 143 | − | |
| 144 | − move a0, ra /* arg1: self return address */ | |
| 145 | − jalr t2 /* (1) call *ftrace_trace_function */ | |
| 146 | − move a1, AT /* arg2: parent's return address */ | |
| 147 | − | |
| 148 | − MCOUNT_RESTORE_REGS | |
| 149 | 145 | #ifdef CONFIG_32BIT |
| 150 | 146 | addiu sp, sp, 8 |
| 151 | 147 | #endif |
| 148 | + | |
| 152 | 149 | .globl ftrace_stub |
| 153 | 150 | ftrace_stub: |
| 154 | 151 | RETURN_BACK |
| @@ -590,3 +590,5 @@ EXPORT(sys_call_table) · 589 unmodified lines | ||
| 590 | 590 | PTR sys_pkey_alloc |
| 591 | 591 | PTR sys_pkey_free /* 4365 */ |
| 592 | 592 | PTR sys_statx |
| 593 | + PTR sys_rseq | |
| 594 | + PTR sys_io_pgetevents | |
| @@ -439,4 +439,6 @@ EXPORT(sys_call_table) · 438 unmodified lines | ||
| 439 | 439 | PTR sys_pkey_alloc |
| 440 | 440 | PTR sys_pkey_free /* 5325 */ |
| 441 | 441 | PTR sys_statx |
| 442 | + PTR sys_rseq | |
| 443 | + PTR sys_io_pgetevents | |
| 442 | 444 | .size sys_call_table,.-sys_call_table |
| @@ -434,4 +434,6 @@ EXPORT(sysn32_call_table) · 433 unmodified lines | ||
| 434 | 434 | PTR sys_pkey_alloc |
| 435 | 435 | PTR sys_pkey_free |
| 436 | 436 | PTR sys_statx /* 6330 */ |
| 437 | + PTR sys_rseq | |
| 438 | + PTR compat_sys_io_pgetevents | |
| 437 | 439 | .size sysn32_call_table,.-sysn32_call_table |
| @@ -583,4 +583,6 @@ EXPORT(sys32_call_table) · 582 unmodified lines | ||
| 583 | 583 | PTR sys_pkey_alloc |
| 584 | 584 | PTR sys_pkey_free /* 4365 */ |
| 585 | 585 | PTR sys_statx |
| 586 | + PTR sys_rseq | |
| 587 | + PTR compat_sys_io_pgetevents | |
| 586 | 588 | .size sys32_call_table,.-sys32_call_table |
| @@ -801,6 +801,8 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) · 800 unmodified lines | ||
| 801 | 801 | regs->regs[0] = 0; /* Don't deal with this again. */ |
| 802 | 802 | } |
| 803 | 803 | |
| 804 | + rseq_signal_deliver(ksig, regs); | |
| 805 | + | |
| 804 | 806 | if (sig_uses_siginfo(&ksig->ka, abi)) |
| 805 | 807 | ret = abi->setup_rt_frame(vdso + abi->vdso->off_rt_sigreturn, |
| 806 | 808 | ksig, regs, oldset); |
| @@ -868,6 +870,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused, · 61 unmodified lines | ||
| 868 | 870 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { |
| 869 | 871 | clear_thread_flag(TIF_NOTIFY_RESUME); |
| 870 | 872 | tracehook_notify_resume(regs); |
| 873 | + rseq_handle_notify_resume(NULL, regs); | |
| 871 | 874 | } |
| 872 | 875 | |
| 873 | 876 | user_enter(); |
| @@ -244,11 +244,11 @@ config PARISC_PAGE_SIZE_4KB · 243 unmodified lines | ||
| 244 | 244 | |
| 245 | 245 | config PARISC_PAGE_SIZE_16KB |
| 246 | 246 | bool "16KB" |
| 247 | − depends on PA8X00 | |
| 247 | + depends on PA8X00 && BROKEN | |
| 248 | 248 | |
| 249 | 249 | config PARISC_PAGE_SIZE_64KB |
| 250 | 250 | bool "64KB" |
| 251 | − depends on PA8X00 | |
| 251 | + depends on PA8X00 && BROKEN | |
| 252 | 252 | |
| 253 | 253 | endchoice |
| 254 | 254 | |
| @@ -347,7 +347,7 @@ config NR_CPUS · 92 unmodified lines | ||
| 347 | 347 | int "Maximum number of CPUs (2-32)" |
| 348 | 348 | range 2 32 |
| 349 | 349 | depends on SMP |
| 350 | − default "32" | |
| 350 | + default "4" | |
| 351 | 351 | |
| 352 | 352 | endmenu |
| 353 | 353 | |
| @@ -65,10 +65,6 @@ endif · 64 unmodified lines | ||
| 65 | 65 | # kernel. |
| 66 | 66 | cflags-y += -mdisable-fpregs |
| 67 | 67 | |
| 68 | −# Without this, "ld -r" results in .text sections that are too big | |
| 69 | −# (> 0x40000) for branches to reach stubs. | |
| 70 | −cflags-y += -ffunction-sections | |
| 71 | − | |
| 72 | 68 | # Use long jumps instead of long branches (needed if your linker fails to |
| 73 | 69 | # link a too big vmlinux executable). Not enabled for building modules. |
| 74 | 70 | ifdef CONFIG_MLONGCALLS |
| @@ -21,14 +21,6 @@ typedef struct { · 20 unmodified lines | ||
| 21 | 21 | unsigned long sig[_NSIG_WORDS]; |
| 22 | 22 | } sigset_t; |
| 23 | 23 | |
| 24 | −#ifndef __KERNEL__ | |
| 25 | −struct sigaction { | |
| 26 | − __sighandler_t sa_handler; | |
| 27 | − unsigned long sa_flags; | |
| 28 | − sigset_t sa_mask; /* mask last for extensibility */ | |
| 29 | −}; | |
| 30 | −#endif | |
| 31 | − | |
| 32 | 24 | #include <asm/sigcontext.h> |
| 33 | 25 | |
| 34 | 26 | #endif /* !__ASSEMBLY */ |
| @@ -364,8 +364,9 @@ · 363 unmodified lines | ||
| 364 | 364 | #define __NR_preadv2 (__NR_Linux + 347) |
| 365 | 365 | #define __NR_pwritev2 (__NR_Linux + 348) |
| 366 | 366 | #define __NR_statx (__NR_Linux + 349) |
| 367 | +#define __NR_io_pgetevents (__NR_Linux + 350) | |
| 367 | 368 | |
| 368 | −#define __NR_Linux_syscalls (__NR_statx + 1) | |
| 369 | +#define __NR_Linux_syscalls (__NR_io_pgetevents + 1) | |
| 369 | 370 | |
| 370 | 371 | |
| 371 | 372 | #define __IGNORE_select /* newselect */ |
| @@ -154,17 +154,14 @@ int register_parisc_driver(struct parisc_driver *driver) · 153 unmodified lines | ||
| 154 | 154 | { |
| 155 | 155 | /* FIXME: we need this because apparently the sti |
| 156 | 156 | * driver can be registered twice */ |
| 157 | − if(driver->drv.name) { | |
| 158 | − printk(KERN_WARNING | |
| 159 | − "BUG: skipping previously registered driver %s\n", | |
| 160 | − driver->name); | |
| 157 | + if (driver->drv.name) { | |
| 158 | + pr_warn("BUG: skipping previously registered driver %s\n", | |
| 159 | + driver->name); | |
| 161 | 160 | return 1; |
| 162 | 161 | } |
| 163 | 162 | |
| 164 | 163 | if (!driver->probe) { |
| 165 | − printk(KERN_WARNING | |
| 166 | − "BUG: driver %s has no probe routine\n", | |
| 167 | − driver->name); | |
| 164 | + pr_warn("BUG: driver %s has no probe routine\n", driver->name); | |
| 168 | 165 | return 1; |
| 169 | 166 | } |
| 170 | 167 | |
| @@ -491,12 +488,9 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) · 320 unmodified lines | ||
| 491 | 488 | |
| 492 | 489 | dev = create_parisc_device(mod_path); |
| 493 | 490 | if (dev->id.hw_type != HPHW_FAULTY) { |
| 494 | − printk(KERN_ERR "Two devices have hardware path [%s]. " | |
| 495 | − "IODC data for second device: " | |
| 496 | − "%02x%02x%02x%02x%02x%02x\n" | |
| 497 | − "Rearranging GSC cards sometimes helps\n", | |
| 498 | − parisc_pathname(dev), iodc_data[0], iodc_data[1], | |
| 499 | − iodc_data[3], iodc_data[4], iodc_data[5], iodc_data[6]); | |
| 491 | + pr_err("Two devices have hardware path [%s]. IODC data for second device: %7phN\n" | |
| 492 | + "Rearranging GSC cards sometimes helps\n", | |
| 493 | + parisc_pathname(dev), iodc_data); | |
| 500 | 494 | return NULL; |
| 501 | 495 | } |
| 502 | 496 | |
| @@ -528,8 +522,7 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) · 25 unmodified lines | ||
| 528 | 522 | * the keyboard controller |
| 529 | 523 | */ |
| 530 | 524 | if ((hpa & 0xfff) == 0 && insert_resource(&iomem_resource, &dev->hpa)) |
| 531 | − printk("Unable to claim HPA %lx for device %s\n", | |
| 532 | − hpa, name); | |
| 525 | + pr_warn("Unable to claim HPA %lx for device %s\n", hpa, name); | |
| 533 | 526 | |
| 534 | 527 | return dev; |
| 535 | 528 | } |
| @@ -875,7 +868,7 @@ static void print_parisc_device(struct parisc_device *dev) · 339 unmodified lines | ||
| 875 | 868 | static int count; |
| 876 | 869 | |
| 877 | 870 | print_pa_hwpath(dev, hw_path); |
| 878 | − printk(KERN_INFO "%d. %s at 0x%px [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }", | |
| 871 | + pr_info("%d. %s at 0x%px [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }", | |
| 879 | 872 | ++count, dev->name, (void*) dev->hpa.start, hw_path, dev->id.hw_type, |
| 880 | 873 | dev->id.hversion_rev, dev->id.hversion, dev->id.sversion); |
| 881 | 874 | |
| @@ -445,6 +445,7 @@ · 444 unmodified lines | ||
| 445 | 445 | ENTRY_COMP(preadv2) |
| 446 | 446 | ENTRY_COMP(pwritev2) |
| 447 | 447 | ENTRY_SAME(statx) |
| 448 | + ENTRY_COMP(io_pgetevents) /* 350 */ | |
| 448 | 449 | |
| 449 | 450 | |
| 450 | 451 | .ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b)) |
| @@ -25,7 +25,7 @@ · 24 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | /* #define DEBUG 1 */ |
| 27 | 27 | #ifdef DEBUG |
| 28 | −#define dbg(x...) printk(x) | |
| 28 | +#define dbg(x...) pr_debug(x) | |
| 29 | 29 | #else |
| 30 | 30 | #define dbg(x...) |
| 31 | 31 | #endif |
| @@ -182,7 +182,7 @@ int __init unwind_init(void) · 150 unmodified lines | ||
| 182 | 182 | start = (long)&__start___unwind[0]; |
| 183 | 183 | stop = (long)&__stop___unwind[0]; |
| 184 | 184 | |
| 185 | − printk("unwind_init: start = 0x%lx, end = 0x%lx, entries = %lu\n", | |
| 185 | + dbg("unwind_init: start = 0x%lx, end = 0x%lx, entries = %lu\n", | |
| 186 | 186 | start, stop, |
| 187 | 187 | (stop - start) / sizeof(struct unwind_table_entry)); |
| 188 | 188 | |
| @@ -244,6 +244,7 @@ cpu-as-$(CONFIG_4xx) += -Wa,-m405 · 243 unmodified lines | ||
| 244 | 244 | cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec) |
| 245 | 245 | cpu-as-$(CONFIG_E200) += -Wa,-me200 |
| 246 | 246 | cpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower4 |
| 247 | +cpu-as-$(CONFIG_PPC_E500MC) += $(call as-option,-Wa$(comma)-me500mc) | |
| 247 | 248 | |
| 248 | 249 | KBUILD_AFLAGS += $(cpu-as-y) |
| 249 | 250 | KBUILD_CFLAGS += $(cpu-as-y) |
| @@ -108,6 +108,7 @@ static inline void pgtable_free(void *table, unsigned index_size) · 107 unmodified lines | ||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | #define check_pgt_cache() do { } while (0) |
| 111 | +#define get_hugepd_cache_index(x) (x) | |
| 111 | 112 | |
| 112 | 113 | #ifdef CONFIG_SMP |
| 113 | 114 | static inline void pgtable_free_tlb(struct mmu_gather *tlb, |
| @@ -137,7 +138,6 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb, · 23 unmodified lines | ||
| 137 | 138 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, |
| 138 | 139 | unsigned long address) |
| 139 | 140 | { |
| 140 | − pgtable_page_dtor(table); | |
| 141 | 141 | pgtable_free_tlb(tlb, page_address(table), 0); |
| 142 | 142 | } |
| 143 | 143 | #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */ |
| @@ -49,6 +49,27 @@ static inline int hugepd_ok(hugepd_t hpd) · 48 unmodified lines | ||
| 49 | 49 | } |
| 50 | 50 | #define is_hugepd(hpd) (hugepd_ok(hpd)) |
| 51 | 51 | |
| 52 | +/* | |
| 53 | + * 16M and 16G huge page directory tables are allocated from slab cache | |
| 54 | + * | |
| 55 | + */ | |
| 56 | +#define H_16M_CACHE_INDEX (PAGE_SHIFT + H_PTE_INDEX_SIZE + H_PMD_INDEX_SIZE - 24) | |
| 57 | +#define H_16G_CACHE_INDEX \ | |
| 58 | + (PAGE_SHIFT + H_PTE_INDEX_SIZE + H_PMD_INDEX_SIZE + H_PUD_INDEX_SIZE - 34) | |
| 59 | + | |
| 60 | +static inline int get_hugepd_cache_index(int index) | |
| 61 | +{ | |
| 62 | + switch (index) { | |
| 63 | + case H_16M_CACHE_INDEX: | |
| 64 | + return HTLB_16M_INDEX; | |
| 65 | + case H_16G_CACHE_INDEX: | |
| 66 | + return HTLB_16G_INDEX; | |
| 67 | + default: | |
| 68 | + BUG(); | |
| 69 | + } | |
| 70 | + /* should not reach */ | |
| 71 | +} | |
| 72 | + | |
| 52 | 73 | #else /* !CONFIG_HUGETLB_PAGE */ |
| 53 | 74 | static inline int pmd_huge(pmd_t pmd) { return 0; } |
| 54 | 75 | static inline int pud_huge(pud_t pud) { return 0; } |
| @@ -45,8 +45,17 @@ static inline int hugepd_ok(hugepd_t hpd) · 44 unmodified lines | ||
| 45 | 45 | { |
| 46 | 46 | return 0; |
| 47 | 47 | } |
| 48 | + | |
| 48 | 49 | #define is_hugepd(pdep) 0 |
| 49 | 50 | |
| 51 | +/* | |
| 52 | + * This should never get called | |
| 53 | + */ | |
| 54 | +static inline int get_hugepd_cache_index(int index) | |
| 55 | +{ | |
| 56 | + BUG(); | |
| 57 | +} | |
| 58 | + | |
| 50 | 59 | #else /* !CONFIG_HUGETLB_PAGE */ |
| 51 | 60 | static inline int pmd_huge(pmd_t pmd) { return 0; } |
| 52 | 61 | static inline int pud_huge(pud_t pud) { return 0; } |
| @@ -287,6 +287,11 @@ enum pgtable_index { · 286 unmodified lines | ||
| 287 | 287 | PMD_INDEX, |
| 288 | 288 | PUD_INDEX, |
| 289 | 289 | PGD_INDEX, |
| 290 | + /* | |
| 291 | + * Below are used with 4k page size and hugetlb | |
| 292 | + */ | |
| 293 | + HTLB_16M_INDEX, | |
| 294 | + HTLB_16G_INDEX, | |
| 290 | 295 | }; |
| 291 | 296 | |
| 292 | 297 | extern unsigned long __vmalloc_start; |
| @@ -8,7 +8,7 @@ extern void arch_touch_nmi_watchdog(void); · 7 unmodified lines | ||
| 8 | 8 | static inline void arch_touch_nmi_watchdog(void) {} |
| 9 | 9 | #endif |
| 10 | 10 | |
| 11 | −#if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_STACKTRACE) | |
| 11 | +#if defined(CONFIG_NMI_IPI) && defined(CONFIG_STACKTRACE) | |
| 12 | 12 | extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask, |
| 13 | 13 | bool exclude_self); |
| 14 | 14 | #define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace |
| @@ -109,6 +109,7 @@ static inline void pgtable_free(void *table, unsigned index_size) · 108 unmodified lines | ||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | #define check_pgt_cache() do { } while (0) |
| 112 | +#define get_hugepd_cache_index(x) (x) | |
| 112 | 113 | |
| 113 | 114 | #ifdef CONFIG_SMP |
| 114 | 115 | static inline void pgtable_free_tlb(struct mmu_gather *tlb, |
| @@ -139,7 +140,6 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, · 24 unmodified lines | ||
| 139 | 140 | unsigned long address) |
| 140 | 141 | { |
| 141 | 142 | tlb_flush_pgtable(tlb, address); |
| 142 | − pgtable_page_dtor(table); | |
| 143 | 143 | pgtable_free_tlb(tlb, page_address(table), 0); |
| 144 | 144 | } |
| 145 | 145 | #endif /* _ASM_POWERPC_PGALLOC_32_H */ |
| @@ -141,6 +141,7 @@ static inline void pgtable_free(void *table, int shift) · 140 unmodified lines | ||
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | +#define get_hugepd_cache_index(x) (x) | |
| 144 | 145 | #ifdef CONFIG_SMP |
| 145 | 146 | static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift) |
| 146 | 147 | { |
| @@ -393,3 +393,4 @@ SYSCALL(pkey_alloc) · 392 unmodified lines | ||
| 393 | 393 | SYSCALL(pkey_free) |
| 394 | 394 | SYSCALL(pkey_mprotect) |
| 395 | 395 | SYSCALL(rseq) |
| 396 | +COMPAT_SYS(io_pgetevents) | |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | #include <uapi/asm/unistd.h> |
| 13 | 13 | |
| 14 | 14 | |
| 15 | −#define NR_syscalls 388 | |
| 15 | +#define NR_syscalls 389 | |
| 16 | 16 | |
| 17 | 17 | #define __NR__exit __NR_exit |
| 18 | 18 | |
| @@ -399,5 +399,6 @@ · 398 unmodified lines | ||
| 399 | 399 | #define __NR_pkey_free 385 |
| 400 | 400 | #define __NR_pkey_mprotect 386 |
| 401 | 401 | #define __NR_rseq 387 |
| 402 | +#define __NR_io_pgetevents 388 | |
| 402 | 403 | |
| 403 | 404 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
| @@ -711,7 +711,8 @@ static __init void cpufeatures_cpu_quirks(void) · 710 unmodified lines | ||
| 711 | 711 | cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_HV_ASSIST; |
| 712 | 712 | cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_XER_SO_BUG; |
| 713 | 713 | cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1; |
| 714 | − } else /* DD2.1 and up have DD2_1 */ | |
| 714 | + } else if ((version & 0xffff0000) == 0x004e0000) | |
| 715 | + /* DD2.1 and up have DD2_1 */ | |
| 715 | 716 | cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1; |
| 716 | 717 | |
| 717 | 718 | if ((version & 0xffff0000) == 0x004e0000) { |
| @@ -285,9 +285,6 @@ pci_bus_to_hose(int bus) · 284 unmodified lines | ||
| 285 | 285 | * Note that the returned IO or memory base is a physical address |
| 286 | 286 | */ |
| 287 | 287 | |
| 288 | −#pragma GCC diagnostic push | |
| 289 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 290 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 291 | 288 | SYSCALL_DEFINE3(pciconfig_iobase, long, which, |
| 292 | 289 | unsigned long, bus, unsigned long, devfn) |
| 293 | 290 | { |
| @@ -313,4 +310,3 @@ SYSCALL_DEFINE3(pciconfig_iobase, long, which, · 19 unmodified lines | ||
| 313 | 310 | |
| 314 | 311 | return result; |
| 315 | 312 | } |
| 316 | −#pragma GCC diagnostic pop | |
| @@ -203,9 +203,6 @@ void pcibios_setup_phb_io_space(struct pci_controller *hose) · 202 unmodified lines | ||
| 203 | 203 | #define IOBASE_ISA_IO 3 |
| 204 | 204 | #define IOBASE_ISA_MEM 4 |
| 205 | 205 | |
| 206 | −#pragma GCC diagnostic push | |
| 207 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 208 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 209 | 206 | SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus, |
| 210 | 207 | unsigned long, in_devfn) |
| 211 | 208 | { |
| @@ -259,7 +256,6 @@ SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus, · 47 unmodified lines | ||
| 259 | 256 | |
| 260 | 257 | return -EOPNOTSUPP; |
| 261 | 258 | } |
| 262 | −#pragma GCC diagnostic pop | |
| 263 | 259 | |
| 264 | 260 | #ifdef CONFIG_NUMA |
| 265 | 261 | int pcibus_to_node(struct pci_bus *bus) |
| @@ -1051,9 +1051,6 @@ struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log, · 1050 unmodified lines | ||
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | 1053 | /* We assume to be passed big endian arguments */ |
| 1054 | −#pragma GCC diagnostic push | |
| 1055 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 1056 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 1057 | 1054 | SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) |
| 1058 | 1055 | { |
| 1059 | 1056 | struct rtas_args args; |
| @@ -1140,7 +1137,6 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) · 80 unmodified lines | ||
| 1140 | 1137 | |
| 1141 | 1138 | return 0; |
| 1142 | 1139 | } |
| 1143 | −#pragma GCC diagnostic pop | |
| 1144 | 1140 | |
| 1145 | 1141 | /* |
| 1146 | 1142 | * Call early during boot, before mem init, to retrieve the RTAS |
| @@ -700,12 +700,19 @@ EXPORT_SYMBOL(check_legacy_ioport); · 699 unmodified lines | ||
| 700 | 700 | static int ppc_panic_event(struct notifier_block *this, |
| 701 | 701 | unsigned long event, void *ptr) |
| 702 | 702 | { |
| 703 | + /* | |
| 704 | + * panic does a local_irq_disable, but we really | |
| 705 | + * want interrupts to be hard disabled. | |
| 706 | + */ | |
| 707 | + hard_irq_disable(); | |
| 708 | + | |
| 703 | 709 | /* |
| 704 | 710 | * If firmware-assisted dump has been registered then trigger |
| 705 | 711 | * firmware-assisted dump and let firmware handle everything else. |
| 706 | 712 | */ |
| 707 | 713 | crash_fadump(NULL, ptr); |
| 708 | − ppc_md.panic(ptr); /* May not return */ | |
| 714 | + if (ppc_md.panic) | |
| 715 | + ppc_md.panic(ptr); /* May not return */ | |
| 709 | 716 | return NOTIFY_DONE; |
| 710 | 717 | } |
| 711 | 718 | |
| @@ -716,7 +723,8 @@ static struct notifier_block ppc_panic_block = { · 4 unmodified lines | ||
| 716 | 723 | |
| 717 | 724 | void __init setup_panic(void) |
| 718 | 725 | { |
| 719 | − if (!ppc_md.panic) | |
| 726 | + /* PPC64 always does a hard irq disable in its panic handler */ | |
| 727 | + if (!IS_ENABLED(CONFIG_PPC64) && !ppc_md.panic) | |
| 720 | 728 | return; |
| 721 | 729 | atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block); |
| 722 | 730 | } |
| @@ -387,6 +387,14 @@ void early_setup_secondary(void) · 386 unmodified lines | ||
| 387 | 387 | |
| 388 | 388 | #endif /* CONFIG_SMP */ |
| 389 | 389 | |
| 390 | +void panic_smp_self_stop(void) | |
| 391 | +{ | |
| 392 | + hard_irq_disable(); | |
| 393 | + spin_begin(); | |
| 394 | + while (1) | |
| 395 | + spin_cpu_relax(); | |
| 396 | +} | |
| 397 | + | |
| 390 | 398 | #if defined(CONFIG_SMP) || defined(CONFIG_KEXEC_CORE) |
| 391 | 399 | static bool use_spinloop(void) |
| 392 | 400 | { |
| @@ -134,7 +134,7 @@ static void do_signal(struct task_struct *tsk) · 133 unmodified lines | ||
| 134 | 134 | /* Re-enable the breakpoints for the signal stack */ |
| 135 | 135 | thread_change_pc(tsk, tsk->thread.regs); |
| 136 | 136 | |
| 137 | − rseq_signal_deliver(tsk->thread.regs); | |
| 137 | + rseq_signal_deliver(&ksig, tsk->thread.regs); | |
| 138 | 138 | |
| 139 | 139 | if (is32) { |
| 140 | 140 | if (ksig.ka.sa.sa_flags & SA_SIGINFO) |
| @@ -170,7 +170,7 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) · 29 unmodified lines | ||
| 170 | 170 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { |
| 171 | 171 | clear_thread_flag(TIF_NOTIFY_RESUME); |
| 172 | 172 | tracehook_notify_resume(regs); |
| 173 | − rseq_handle_notify_resume(regs); | |
| 173 | + rseq_handle_notify_resume(NULL, regs); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | user_enter(); |
| @@ -1038,9 +1038,6 @@ static int do_setcontext_tm(struct ucontext __user *ucp, · 1037 unmodified lines | ||
| 1038 | 1038 | } |
| 1039 | 1039 | #endif |
| 1040 | 1040 | |
| 1041 | −#pragma GCC diagnostic push | |
| 1042 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 1043 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 1044 | 1041 | #ifdef CONFIG_PPC64 |
| 1045 | 1042 | COMPAT_SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, |
| 1046 | 1043 | struct ucontext __user *, new_ctx, int, ctx_size) |
| @@ -1134,7 +1131,6 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, · 87 unmodified lines | ||
| 1134 | 1131 | set_thread_flag(TIF_RESTOREALL); |
| 1135 | 1132 | return 0; |
| 1136 | 1133 | } |
| 1137 | −#pragma GCC diagnostic pop | |
| 1138 | 1134 | |
| 1139 | 1135 | #ifdef CONFIG_PPC64 |
| 1140 | 1136 | COMPAT_SYSCALL_DEFINE0(rt_sigreturn) |
| @@ -1231,9 +1227,6 @@ SYSCALL_DEFINE0(rt_sigreturn) · 90 unmodified lines | ||
| 1231 | 1227 | return 0; |
| 1232 | 1228 | } |
| 1233 | 1229 | |
| 1234 | −#pragma GCC diagnostic push | |
| 1235 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 1236 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 1237 | 1230 | #ifdef CONFIG_PPC32 |
| 1238 | 1231 | SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, |
| 1239 | 1232 | int, ndbg, struct sig_dbg_op __user *, dbg) |
| @@ -1337,7 +1330,6 @@ SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, · 97 unmodified lines | ||
| 1337 | 1330 | return 0; |
| 1338 | 1331 | } |
| 1339 | 1332 | #endif |
| 1340 | −#pragma GCC diagnostic pop | |
| 1341 | 1333 | |
| 1342 | 1334 | /* |
| 1343 | 1335 | * OK, we're invoking a handler |
| @@ -625,9 +625,6 @@ static long setup_trampoline(unsigned int syscall, unsigned int __user *tramp) · 624 unmodified lines | ||
| 625 | 625 | /* |
| 626 | 626 | * Handle {get,set,swap}_context operations |
| 627 | 627 | */ |
| 628 | −#pragma GCC diagnostic push | |
| 629 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 630 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 631 | 628 | SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, |
| 632 | 629 | struct ucontext __user *, new_ctx, long, ctx_size) |
| 633 | 630 | { |
| @@ -693,7 +690,6 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, · 59 unmodified lines | ||
| 693 | 690 | set_thread_flag(TIF_RESTOREALL); |
| 694 | 691 | return 0; |
| 695 | 692 | } |
| 696 | −#pragma GCC diagnostic pop | |
| 697 | 693 | |
| 698 | 694 | |
| 699 | 695 | /* |
| @@ -600,9 +600,6 @@ static void nmi_stop_this_cpu(struct pt_regs *regs) · 599 unmodified lines | ||
| 600 | 600 | nmi_ipi_busy_count--; |
| 601 | 601 | nmi_ipi_unlock(); |
| 602 | 602 | |
| 603 | − /* Remove this CPU */ | |
| 604 | − set_cpu_online(smp_processor_id(), false); | |
| 605 | − | |
| 606 | 603 | spin_begin(); |
| 607 | 604 | while (1) |
| 608 | 605 | spin_cpu_relax(); |
| @@ -617,9 +614,6 @@ void smp_send_stop(void) · 8 unmodified lines | ||
| 617 | 614 | |
| 618 | 615 | static void stop_this_cpu(void *dummy) |
| 619 | 616 | { |
| 620 | − /* Remove this CPU */ | |
| 621 | − set_cpu_online(smp_processor_id(), false); | |
| 622 | − | |
| 623 | 617 | hard_irq_disable(); |
| 624 | 618 | spin_begin(); |
| 625 | 619 | while (1) |
| @@ -196,7 +196,7 @@ save_stack_trace_tsk_reliable(struct task_struct *tsk, · 195 unmodified lines | ||
| 196 | 196 | EXPORT_SYMBOL_GPL(save_stack_trace_tsk_reliable); |
| 197 | 197 | #endif /* CONFIG_HAVE_RELIABLE_STACKTRACE */ |
| 198 | 198 | |
| 199 | −#ifdef CONFIG_PPC_BOOK3S_64 | |
| 199 | +#if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_NMI_IPI) | |
| 200 | 200 | static void handle_backtrace_ipi(struct pt_regs *regs) |
| 201 | 201 | { |
| 202 | 202 | nmi_cpu_backtrace(regs); |
| @@ -242,4 +242,4 @@ void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self) · 39 unmodified lines | ||
| 242 | 242 | { |
| 243 | 243 | nmi_trigger_cpumask_backtrace(mask, exclude_self, raise_backtrace_ipi); |
| 244 | 244 | } |
| 245 | −#endif /* CONFIG_PPC64 */ | |
| 245 | +#endif /* defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_NMI_IPI) */ | |
| @@ -62,9 +62,6 @@ out: · 61 unmodified lines | ||
| 62 | 62 | return ret; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | −#pragma GCC diagnostic push | |
| 66 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 67 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 68 | 65 | SYSCALL_DEFINE6(mmap2, unsigned long, addr, size_t, len, |
| 69 | 66 | unsigned long, prot, unsigned long, flags, |
| 70 | 67 | unsigned long, fd, unsigned long, pgoff) |
| @@ -78,7 +75,6 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, size_t, len, · 7 unmodified lines | ||
| 78 | 75 | { |
| 79 | 76 | return do_mmap2(addr, len, prot, flags, fd, offset, PAGE_SHIFT); |
| 80 | 77 | } |
| 81 | −#pragma GCC diagnostic pop | |
| 82 | 78 | |
| 83 | 79 | #ifdef CONFIG_PPC32 |
| 84 | 80 | /* |
| @@ -337,7 +337,8 @@ static void free_hugepd_range(struct mmu_gather *tlb, hugepd_t *hpdp, int pdshif · 336 unmodified lines | ||
| 337 | 337 | if (shift >= pdshift) |
| 338 | 338 | hugepd_free(tlb, hugepte); |
| 339 | 339 | else |
| 340 | − pgtable_free_tlb(tlb, hugepte, pdshift - shift); | |
| 340 | + pgtable_free_tlb(tlb, hugepte, | |
| 341 | + get_hugepd_cache_index(pdshift - shift)); | |
| 341 | 342 | } |
| 342 | 343 | |
| 343 | 344 | static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud, |
| @@ -409,6 +409,18 @@ static inline void pgtable_free(void *table, int index) · 408 unmodified lines | ||
| 409 | 409 | case PUD_INDEX: |
| 410 | 410 | kmem_cache_free(PGT_CACHE(PUD_CACHE_INDEX), table); |
| 411 | 411 | break; |
| 412 | +#if defined(CONFIG_PPC_4K_PAGES) && defined(CONFIG_HUGETLB_PAGE) | |
| 413 | + /* 16M hugepd directory at pud level */ | |
| 414 | + case HTLB_16M_INDEX: | |
| 415 | + BUILD_BUG_ON(H_16M_CACHE_INDEX <= 0); | |
| 416 | + kmem_cache_free(PGT_CACHE(H_16M_CACHE_INDEX), table); | |
| 417 | + break; | |
| 418 | + /* 16G hugepd directory at the pgd level */ | |
| 419 | + case HTLB_16G_INDEX: | |
| 420 | + BUILD_BUG_ON(H_16G_CACHE_INDEX <= 0); | |
| 421 | + kmem_cache_free(PGT_CACHE(H_16G_CACHE_INDEX), table); | |
| 422 | + break; | |
| 423 | +#endif | |
| 412 | 424 | /* We don't free pgd table via RCU callback */ |
| 413 | 425 | default: |
| 414 | 426 | BUG(); |
| @@ -186,9 +186,6 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr, · 185 unmodified lines | ||
| 186 | 186 | * in a 2-bit field won't allow writes to a page that is otherwise |
| 187 | 187 | * write-protected. |
| 188 | 188 | */ |
| 189 | −#pragma GCC diagnostic push | |
| 190 | −#pragma GCC diagnostic ignored "-Wpragmas" | |
| 191 | −#pragma GCC diagnostic ignored "-Wattribute-alias" | |
| 192 | 189 | SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, |
| 193 | 190 | unsigned long, len, u32 __user *, map) |
| 194 | 191 | { |
| @@ -272,4 +269,3 @@ SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, · 77 unmodified lines | ||
| 272 | 269 | up_write(&mm->mmap_sem); |
| 273 | 270 | return err; |
| 274 | 271 | } |
| 275 | −#pragma GCC diagnostic pop | |
| @@ -689,22 +689,17 @@ EXPORT_SYMBOL(radix__flush_tlb_kernel_range); · 688 unmodified lines | ||
| 689 | 689 | static unsigned long tlb_single_page_flush_ceiling __read_mostly = 33; |
| 690 | 690 | static unsigned long tlb_local_single_page_flush_ceiling __read_mostly = POWER9_TLB_SETS_RADIX * 2; |
| 691 | 691 | |
| 692 | −void radix__flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | |
| 693 | − unsigned long end) | |
| 692 | +static inline void __radix__flush_tlb_range(struct mm_struct *mm, | |
| 693 | + unsigned long start, unsigned long end, | |
| 694 | + bool flush_all_sizes) | |
| 694 | 695 | |
| 695 | 696 | { |
| 696 | − struct mm_struct *mm = vma->vm_mm; | |
| 697 | 697 | unsigned long pid; |
| 698 | 698 | unsigned int page_shift = mmu_psize_defs[mmu_virtual_psize].shift; |
| 699 | 699 | unsigned long page_size = 1UL << page_shift; |
| 700 | 700 | unsigned long nr_pages = (end - start) >> page_shift; |
| 701 | 701 | bool local, full; |
| 702 | 702 | |
| 703 | −#ifdef CONFIG_HUGETLB_PAGE | |
| 704 | − if (is_vm_hugetlb_page(vma)) | |
| 705 | − return radix__flush_hugetlb_tlb_range(vma, start, end); | |
| 706 | −#endif | |
| 707 | − | |
| 708 | 703 | pid = mm->context.id; |
| 709 | 704 | if (unlikely(pid == MMU_NO_CONTEXT)) |
| 710 | 705 | return; |
| @@ -738,37 +733,64 @@ is_local: · 27 unmodified lines | ||
| 738 | 733 | _tlbie_pid(pid, RIC_FLUSH_TLB); |
| 739 | 734 | } |
| 740 | 735 | } else { |
| 741 | − bool hflush = false; | |
| 736 | + bool hflush = flush_all_sizes; | |
| 737 | + bool gflush = flush_all_sizes; | |
| 742 | 738 | unsigned long hstart, hend; |
| 739 | + unsigned long gstart, gend; | |
| 743 | 740 | |
| 744 | −#ifdef CONFIG_TRANSPARENT_HUGEPAGE | |
| 745 | − hstart = (start + HPAGE_PMD_SIZE - 1) >> HPAGE_PMD_SHIFT; | |
| 746 | − hend = end >> HPAGE_PMD_SHIFT; | |
| 747 | − if (hstart < hend) { | |
| 748 | − hstart <<= HPAGE_PMD_SHIFT; | |
| 749 | − hend <<= HPAGE_PMD_SHIFT; | |
| 741 | + if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) | |
| 750 | 742 | hflush = true; |
| 743 | + | |
| 744 | + if (hflush) { | |
| 745 | + hstart = (start + PMD_SIZE - 1) & PMD_MASK; | |
| 746 | + hend = end & PMD_MASK; | |
| 747 | + if (hstart == hend) | |
| 748 | + hflush = false; | |
| 749 | + } | |
| 750 | + | |
| 751 | + if (gflush) { | |
| 752 | + gstart = (start + PUD_SIZE - 1) & PUD_MASK; | |
| 753 | + gend = end & PUD_MASK; | |
| 754 | + if (gstart == gend) | |
| 755 | + gflush = false; | |
| 751 | 756 | } |
| 752 | −#endif | |
| 753 | 757 | |
| 754 | 758 | asm volatile("ptesync": : :"memory"); |
| 755 | 759 | if (local) { |
| 756 | 760 | __tlbiel_va_range(start, end, pid, page_size, mmu_virtual_psize); |
| 757 | 761 | if (hflush) |
| 758 | 762 | __tlbiel_va_range(hstart, hend, pid, |
| 759 | − HPAGE_PMD_SIZE, MMU_PAGE_2M); | |
| 763 | + PMD_SIZE, MMU_PAGE_2M); | |
| 764 | + if (gflush) | |
| 765 | + __tlbiel_va_range(gstart, gend, pid, | |
| 766 | + PUD_SIZE, MMU_PAGE_1G); | |
| 760 | 767 | asm volatile("ptesync": : :"memory"); |
| 761 | 768 | } else { |
| 762 | 769 | __tlbie_va_range(start, end, pid, page_size, mmu_virtual_psize); |
| 763 | 770 | if (hflush) |
| 764 | 771 | __tlbie_va_range(hstart, hend, pid, |
| 765 | − HPAGE_PMD_SIZE, MMU_PAGE_2M); | |
| 772 | + PMD_SIZE, MMU_PAGE_2M); | |
| 773 | + if (gflush) | |
| 774 | + __tlbie_va_range(gstart, gend, pid, | |
| 775 | + PUD_SIZE, MMU_PAGE_1G); | |
| 766 | 776 | fixup_tlbie(); |
| 767 | 777 | asm volatile("eieio; tlbsync; ptesync": : :"memory"); |
| 768 | 778 | } |
| 769 | 779 | } |
| 770 | 780 | preempt_enable(); |
| 771 | 781 | } |
| 782 | + | |
| 783 | +void radix__flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | |
| 784 | + unsigned long end) | |
| 785 | + | |
| 786 | +{ | |
| 787 | +#ifdef CONFIG_HUGETLB_PAGE | |
| 788 | + if (is_vm_hugetlb_page(vma)) | |
| 789 | + return radix__flush_hugetlb_tlb_range(vma, start, end); | |
| 790 | +#endif | |
| 791 | + | |
| 792 | + __radix__flush_tlb_range(vma->vm_mm, start, end, false); | |
| 793 | +} | |
| 772 | 794 | EXPORT_SYMBOL(radix__flush_tlb_range); |
| 773 | 795 | |
| 774 | 796 | static int radix_get_mmu_psize(int page_size) |
| @@ -837,6 +859,8 @@ void radix__tlb_flush(struct mmu_gather *tlb) · 62 unmodified lines | ||
| 837 | 859 | int psize = 0; |
| 838 | 860 | struct mm_struct *mm = tlb->mm; |
| 839 | 861 | int page_size = tlb->page_size; |
| 862 | + unsigned long start = tlb->start; | |
| 863 | + unsigned long end = tlb->end; | |
| 840 | 864 | |
| 841 | 865 | /* |
| 842 | 866 | * if page size is not something we understand, do a full mm flush |
| @@ -847,15 +871,45 @@ void radix__tlb_flush(struct mmu_gather *tlb) · 4 unmodified lines | ||
| 847 | 871 | */ |
| 848 | 872 | if (tlb->fullmm) { |
| 849 | 873 | __flush_all_mm(mm, true); |
| 874 | +#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLB_PAGE) | |
| 875 | + } else if (mm_tlb_flush_nested(mm)) { | |
| 876 | + /* | |
| 877 | + * If there is a concurrent invalidation that is clearing ptes, | |
| 878 | + * then it's possible this invalidation will miss one of those | |
| 879 | + * cleared ptes and miss flushing the TLB. If this invalidate | |
| 880 | + * returns before the other one flushes TLBs, that can result | |
| 881 | + * in it returning while there are still valid TLBs inside the | |
| 882 | + * range to be invalidated. | |
| 883 | + * | |
| 884 | + * See mm/memory.c:tlb_finish_mmu() for more details. | |
| 885 | + * | |
| 886 | + * The solution to this is ensure the entire range is always | |
| 887 | + * flushed here. The problem for powerpc is that the flushes | |
| 888 | + * are page size specific, so this "forced flush" would not | |
| 889 | + * do the right thing if there are a mix of page sizes in | |
| 890 | + * the range to be invalidated. So use __flush_tlb_range | |
| 891 | + * which invalidates all possible page sizes in the range. | |
| 892 | + * | |
| 893 | + * PWC flush probably is not be required because the core code | |
| 894 | + * shouldn't free page tables in this path, but accounting | |
| 895 | + * for the possibility makes us a bit more robust. | |
| 896 | + * | |
| 897 | + * need_flush_all is an uncommon case because page table | |
| 898 | + * teardown should be done with exclusive locks held (but | |
| 899 | + * after locks are dropped another invalidate could come | |
| 900 | + * in), it could be optimized further if necessary. | |
| 901 | + */ | |
| 902 | + if (!tlb->need_flush_all) | |
| 903 | + __radix__flush_tlb_range(mm, start, end, true); | |
| 904 | + else | |
| 905 | + radix__flush_all_mm(mm); | |
| 906 | +#endif | |
| 850 | 907 | } else if ( (psize = radix_get_mmu_psize(page_size)) == -1) { |
| 851 | 908 | if (!tlb->need_flush_all) |
| 852 | 909 | radix__flush_tlb_mm(mm); |
| 853 | 910 | else |
| 854 | 911 | radix__flush_all_mm(mm); |
| 855 | 912 | } else { |
| 856 | − unsigned long start = tlb->start; | |
| 857 | − unsigned long end = tlb->end; | |
| 858 | − | |
| 859 | 913 | if (!tlb->need_flush_all) |
| 860 | 914 | radix__flush_tlb_range_psize(mm, start, end, psize); |
| 861 | 915 | else |
| @@ -1043,6 +1097,8 @@ extern void radix_kvm_prefetch_workaround(struct mm_struct *mm) · 181 unmodified lines | ||
| 1043 | 1097 | for (; sib <= cpu_last_thread_sibling(cpu) && !flush; sib++) { |
| 1044 | 1098 | if (sib == cpu) |
| 1045 | 1099 | continue; |
| 1100 | + if (!cpu_possible(sib)) | |
| 1101 | + continue; | |
| 1046 | 1102 | if (paca_ptrs[sib]->kvm_hstate.kvm_vcpu) |
| 1047 | 1103 | flush = true; |
| 1048 | 1104 | } |
| @@ -42,7 +42,11 @@ · 41 unmodified lines | ||
| 42 | 42 | #define DBG(x...) |
| 43 | 43 | #endif |
| 44 | 44 | |
| 45 | −/* Apparently the RTC stores seconds since 1 Jan 1904 */ | |
| 45 | +/* | |
| 46 | + * Offset between Unix time (1970-based) and Mac time (1904-based). Cuda and PMU | |
| 47 | + * times wrap in 2040. If we need to handle later times, the read_time functions | |
| 48 | + * need to be changed to interpret wrapped times as post-2040. | |
| 49 | + */ | |
| 46 | 50 | #define RTC_OFFSET 2082844800 |
| 47 | 51 | |
| 48 | 52 | /* |
| @@ -97,8 +101,11 @@ static time64_t cuda_get_time(void) · 48 unmodified lines | ||
| 97 | 101 | if (req.reply_len != 7) |
| 98 | 102 | printk(KERN_ERR "cuda_get_time: got %d byte reply\n", |
| 99 | 103 | req.reply_len); |
| 100 | − now = (req.reply[3] << 24) + (req.reply[4] << 16) | |
| 101 | − + (req.reply[5] << 8) + req.reply[6]; | |
| 104 | + now = (u32)((req.reply[3] << 24) + (req.reply[4] << 16) + | |
| 105 | + (req.reply[5] << 8) + req.reply[6]); | |
| 106 | + /* it's either after year 2040, or the RTC has gone backwards */ | |
| 107 | + WARN_ON(now < RTC_OFFSET); | |
| 108 | + | |
| 102 | 109 | return now - RTC_OFFSET; |
| 103 | 110 | } |
| 104 | 111 | |
| @@ -106,10 +113,10 @@ static time64_t cuda_get_time(void) · 1 unmodified line | ||
| 106 | 113 | |
| 107 | 114 | static int cuda_set_rtc_time(struct rtc_time *tm) |
| 108 | 115 | { |
| 109 | − time64_t nowtime; | |
| 116 | + u32 nowtime; | |
| 110 | 117 | struct adb_request req; |
| 111 | 118 | |
| 112 | − nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET; | |
| 119 | + nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET); | |
| 113 | 120 | if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, |
| 114 | 121 | nowtime >> 24, nowtime >> 16, nowtime >> 8, |
| 115 | 122 | nowtime) < 0) |
| @@ -140,8 +147,12 @@ static time64_t pmu_get_time(void) · 24 unmodified lines | ||
| 140 | 147 | if (req.reply_len != 4) |
| 141 | 148 | printk(KERN_ERR "pmu_get_time: got %d byte reply from PMU\n", |
| 142 | 149 | req.reply_len); |
| 143 | − now = (req.reply[0] << 24) + (req.reply[1] << 16) | |
| 144 | − + (req.reply[2] << 8) + req.reply[3]; | |
| 150 | + now = (u32)((req.reply[0] << 24) + (req.reply[1] << 16) + | |
| 151 | + (req.reply[2] << 8) + req.reply[3]); | |
| 152 | + | |
| 153 | + /* it's either after year 2040, or the RTC has gone backwards */ | |
| 154 | + WARN_ON(now < RTC_OFFSET); | |
| 155 | + | |
| 145 | 156 | return now - RTC_OFFSET; |
| 146 | 157 | } |
| 147 | 158 | |
| @@ -149,10 +160,10 @@ static time64_t pmu_get_time(void) · 1 unmodified line | ||
| 149 | 160 | |
| 150 | 161 | static int pmu_set_rtc_time(struct rtc_time *tm) |
| 151 | 162 | { |
| 152 | − time64_t nowtime; | |
| 163 | + u32 nowtime; | |
| 153 | 164 | struct adb_request req; |
| 154 | 165 | |
| 155 | − nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET; | |
| 166 | + nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET); | |
| 156 | 167 | if (pmu_request(&req, NULL, 5, PMU_SET_RTC, nowtime >> 24, |
| 157 | 168 | nowtime >> 16, nowtime >> 8, nowtime) < 0) |
| 158 | 169 | return -ENXIO; |
| @@ -6,36 +6,38 @@ · 5 unmodified lines | ||
| 6 | 6 | |
| 7 | 7 | struct css_general_char { |
| 8 | 8 | u64 : 12; |
| 9 | − u32 dynio : 1; /* bit 12 */ | |
| 10 | − u32 : 4; | |
| 11 | − u32 eadm : 1; /* bit 17 */ | |
| 12 | − u32 : 23; | |
| 13 | − u32 aif : 1; /* bit 41 */ | |
| 14 | − u32 : 3; | |
| 15 | − u32 mcss : 1; /* bit 45 */ | |
| 16 | − u32 fcs : 1; /* bit 46 */ | |
| 17 | − u32 : 1; | |
| 18 | − u32 ext_mb : 1; /* bit 48 */ | |
| 19 | − u32 : 7; | |
| 20 | − u32 aif_tdd : 1; /* bit 56 */ | |
| 21 | − u32 : 1; | |
| 22 | − u32 qebsm : 1; /* bit 58 */ | |
| 23 | − u32 : 2; | |
| 24 | − u32 aiv : 1; /* bit 61 */ | |
| 25 | − u32 : 5; | |
| 26 | − u32 aif_osa : 1; /* bit 67 */ | |
| 27 | − u32 : 12; | |
| 28 | − u32 eadm_rf : 1; /* bit 80 */ | |
| 29 | − u32 : 1; | |
| 30 | − u32 cib : 1; /* bit 82 */ | |
| 31 | − u32 : 5; | |
| 32 | − u32 fcx : 1; /* bit 88 */ | |
| 33 | − u32 : 19; | |
| 34 | − u32 alt_ssi : 1; /* bit 108 */ | |
| 35 | − u32 : 1; | |
| 36 | − u32 narf : 1; /* bit 110 */ | |
| 37 | − u32 : 12; | |
| 38 | − u32 util_str : 1;/* bit 123 */ | |
| 9 | + u64 dynio : 1; /* bit 12 */ | |
| 10 | + u64 : 4; | |
| 11 | + u64 eadm : 1; /* bit 17 */ | |
| 12 | + u64 : 23; | |
| 13 | + u64 aif : 1; /* bit 41 */ | |
| 14 | + u64 : 3; | |
| 15 | + u64 mcss : 1; /* bit 45 */ | |
| 16 | + u64 fcs : 1; /* bit 46 */ | |
| 17 | + u64 : 1; | |
| 18 | + u64 ext_mb : 1; /* bit 48 */ | |
| 19 | + u64 : 7; | |
| 20 | + u64 aif_tdd : 1; /* bit 56 */ | |
| 21 | + u64 : 1; | |
| 22 | + u64 qebsm : 1; /* bit 58 */ | |
| 23 | + u64 : 2; | |
| 24 | + u64 aiv : 1; /* bit 61 */ | |
| 25 | + u64 : 2; | |
| 26 | + | |
| 27 | + u64 : 3; | |
| 28 | + u64 aif_osa : 1; /* bit 67 */ | |
| 29 | + u64 : 12; | |
| 30 | + u64 eadm_rf : 1; /* bit 80 */ | |
| 31 | + u64 : 1; | |
| 32 | + u64 cib : 1; /* bit 82 */ | |
| 33 | + u64 : 5; | |
| 34 | + u64 fcx : 1; /* bit 88 */ | |
| 35 | + u64 : 19; | |
| 36 | + u64 alt_ssi : 1; /* bit 108 */ | |
| 37 | + u64 : 1; | |
| 38 | + u64 narf : 1; /* bit 110 */ | |
| 39 | + u64 : 12; | |
| 40 | + u64 util_str : 1;/* bit 123 */ | |
| 39 | 41 | } __packed; |
| 40 | 42 | |
| 41 | 43 | extern struct css_general_char css_general_characteristics; |
| @@ -258,11 +258,6 @@ archscripts: scripts_basic · 257 unmodified lines | ||
| 258 | 258 | archheaders: |
| 259 | 259 | $(Q)$(MAKE) $(build)=arch/x86/entry/syscalls all |
| 260 | 260 | |
| 261 | −archprepare: | |
| 262 | −ifeq ($(CONFIG_KEXEC_FILE),y) | |
| 263 | − $(Q)$(MAKE) $(build)=arch/x86/purgatory arch/x86/purgatory/kexec-purgatory.c | |
| 264 | −endif | |
| 265 | − | |
| 266 | 261 | ### |
| 267 | 262 | # Kernel objects |
| 268 | 263 | |
| @@ -327,7 +322,6 @@ archclean: · 58 unmodified lines | ||
| 327 | 322 | $(Q)rm -rf $(objtree)/arch/x86_64 |
| 328 | 323 | $(Q)$(MAKE) $(clean)=$(boot) |
| 329 | 324 | $(Q)$(MAKE) $(clean)=arch/x86/tools |
| 330 | − $(Q)$(MAKE) $(clean)=arch/x86/purgatory | |
| 331 | 325 | |
| 332 | 326 | define archhelp |
| 333 | 327 | echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)' |
| @@ -118,7 +118,7 @@ __setup_efi_pci(efi_pci_io_protocol_t *pci, struct pci_setup_rom **__rom) · 117 unmodified lines | ||
| 118 | 118 | void *romimage; |
| 119 | 119 | |
| 120 | 120 | status = efi_call_proto(efi_pci_io_protocol, attributes, pci, |
| 121 | − EfiPciIoAttributeOperationGet, 0, 0, | |
| 121 | + EfiPciIoAttributeOperationGet, 0ULL, | |
| 122 | 122 | &attributes); |
| 123 | 123 | if (status != EFI_SUCCESS) |
| 124 | 124 | return status; |
| @@ -164,7 +164,7 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) · 163 unmodified lines | ||
| 164 | 164 | if (cached_flags & _TIF_NOTIFY_RESUME) { |
| 165 | 165 | clear_thread_flag(TIF_NOTIFY_RESUME); |
| 166 | 166 | tracehook_notify_resume(regs); |
| 167 | − rseq_handle_notify_resume(regs); | |
| 167 | + rseq_handle_notify_resume(NULL, regs); | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | if (cached_flags & _TIF_USER_RETURN_NOTIFY) |
| @@ -477,7 +477,7 @@ ENTRY(entry_SYSENTER_32) · 476 unmodified lines | ||
| 477 | 477 | * whereas POPF does not.) |
| 478 | 478 | */ |
| 479 | 479 | addl $PT_EFLAGS-PT_DS, %esp /* point esp at pt_regs->flags */ |
| 480 | − btr $X86_EFLAGS_IF_BIT, (%esp) | |
| 480 | + btrl $X86_EFLAGS_IF_BIT, (%esp) | |
| 481 | 481 | popfl |
| 482 | 482 | |
| 483 | 483 | /* |
| @@ -84,13 +84,13 @@ ENTRY(entry_SYSENTER_compat) · 83 unmodified lines | ||
| 84 | 84 | pushq %rdx /* pt_regs->dx */ |
| 85 | 85 | pushq %rcx /* pt_regs->cx */ |
| 86 | 86 | pushq $-ENOSYS /* pt_regs->ax */ |
| 87 | − pushq %r8 /* pt_regs->r8 */ | |
| 87 | + pushq $0 /* pt_regs->r8 = 0 */ | |
| 88 | 88 | xorl %r8d, %r8d /* nospec r8 */ |
| 89 | − pushq %r9 /* pt_regs->r9 */ | |
| 89 | + pushq $0 /* pt_regs->r9 = 0 */ | |
| 90 | 90 | xorl %r9d, %r9d /* nospec r9 */ |
| 91 | − pushq %r10 /* pt_regs->r10 */ | |
| 91 | + pushq $0 /* pt_regs->r10 = 0 */ | |
| 92 | 92 | xorl %r10d, %r10d /* nospec r10 */ |
| 93 | − pushq %r11 /* pt_regs->r11 */ | |
| 93 | + pushq $0 /* pt_regs->r11 = 0 */ | |
| 94 | 94 | xorl %r11d, %r11d /* nospec r11 */ |
| 95 | 95 | pushq %rbx /* pt_regs->rbx */ |
| 96 | 96 | xorl %ebx, %ebx /* nospec rbx */ |
| @@ -374,13 +374,13 @@ ENTRY(entry_INT80_compat) · 277 unmodified lines | ||
| 374 | 374 | pushq %rcx /* pt_regs->cx */ |
| 375 | 375 | xorl %ecx, %ecx /* nospec cx */ |
| 376 | 376 | pushq $-ENOSYS /* pt_regs->ax */ |
| 377 | − pushq $0 /* pt_regs->r8 = 0 */ | |
| 377 | + pushq %r8 /* pt_regs->r8 */ | |
| 378 | 378 | xorl %r8d, %r8d /* nospec r8 */ |
| 379 | − pushq $0 /* pt_regs->r9 = 0 */ | |
| 379 | + pushq %r9 /* pt_regs->r9 */ | |
| 380 | 380 | xorl %r9d, %r9d /* nospec r9 */ |
| 381 | − pushq $0 /* pt_regs->r10 = 0 */ | |
| 381 | + pushq %r10 /* pt_regs->r10*/ | |
| 382 | 382 | xorl %r10d, %r10d /* nospec r10 */ |
| 383 | − pushq $0 /* pt_regs->r11 = 0 */ | |
| 383 | + pushq %r11 /* pt_regs->r11 */ | |
| 384 | 384 | xorl %r11d, %r11d /* nospec r11 */ |
| 385 | 385 | pushq %rbx /* pt_regs->rbx */ |
| 386 | 386 | xorl %ebx, %ebx /* nospec rbx */ |
| @@ -38,7 +38,7 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, · 37 unmodified lines | ||
| 38 | 38 | { |
| 39 | 39 | unsigned long mask; |
| 40 | 40 | |
| 41 | − asm ("cmp %1,%2; sbb %0,%0;" | |
| 41 | + asm volatile ("cmp %1,%2; sbb %0,%0;" | |
| 42 | 42 | :"=r" (mask) |
| 43 | 43 | :"g"(size),"r" (index) |
| 44 | 44 | :"cc"); |
| @@ -184,6 +184,9 @@ static inline p4d_t *p4d_alloc_one(struct mm_struct *mm, unsigned long addr) · 183 unmodified lines | ||
| 184 | 184 | |
| 185 | 185 | static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d) |
| 186 | 186 | { |
| 187 | + if (!pgtable_l5_enabled()) | |
| 188 | + return; | |
| 189 | + | |
| 187 | 190 | BUG_ON((unsigned long)p4d & (PAGE_SIZE-1)); |
| 188 | 191 | free_page((unsigned long)p4d); |
| 189 | 192 | } |
| @@ -898,7 +898,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd) · 897 unmodified lines | ||
| 898 | 898 | #define pgd_page(pgd) pfn_to_page(pgd_pfn(pgd)) |
| 899 | 899 | |
| 900 | 900 | /* to find an entry in a page-table-directory. */ |
| 901 | −static __always_inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address) | |
| 901 | +static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address) | |
| 902 | 902 | { |
| 903 | 903 | if (!pgtable_l5_enabled()) |
| 904 | 904 | return (p4d_t *)pgd; |
| @@ -216,7 +216,7 @@ static inline pgd_t pti_set_user_pgd(pgd_t *pgdp, pgd_t pgd) · 215 unmodified lines | ||
| 216 | 216 | } |
| 217 | 217 | #endif |
| 218 | 218 | |
| 219 | −static __always_inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) | |
| 219 | +static inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) | |
| 220 | 220 | { |
| 221 | 221 | pgd_t pgd; |
| 222 | 222 | |
| @@ -230,7 +230,7 @@ static __always_inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) · 7 unmodified lines | ||
| 230 | 230 | *p4dp = native_make_p4d(native_pgd_val(pgd)); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | −static __always_inline void native_p4d_clear(p4d_t *p4d) | |
| 233 | +static inline void native_p4d_clear(p4d_t *p4d) | |
| 234 | 234 | { |
| 235 | 235 | native_set_p4d(p4d, native_make_p4d(0)); |
| 236 | 236 | } |
| @@ -114,6 +114,7 @@ · 113 unmodified lines | ||
| 114 | 114 | #define VMX_MISC_PREEMPTION_TIMER_RATE_MASK 0x0000001f |
| 115 | 115 | #define VMX_MISC_SAVE_EFER_LMA 0x00000020 |
| 116 | 116 | #define VMX_MISC_ACTIVITY_HLT 0x00000040 |
| 117 | +#define VMX_MISC_ZERO_LEN_INS 0x40000000 | |
| 117 | 118 | |
| 118 | 119 | /* VMFUNC functions */ |
| 119 | 120 | #define VMX_VMFUNC_EPTP_SWITCHING 0x00000001 |
| @@ -351,11 +352,13 @@ enum vmcs_field { · 231 unmodified lines | ||
| 351 | 352 | #define VECTORING_INFO_VALID_MASK INTR_INFO_VALID_MASK |
| 352 | 353 | |
| 353 | 354 | #define INTR_TYPE_EXT_INTR (0 << 8) /* external interrupt */ |
| 355 | +#define INTR_TYPE_RESERVED (1 << 8) /* reserved */ | |
| 354 | 356 | #define INTR_TYPE_NMI_INTR (2 << 8) /* NMI */ |
| 355 | 357 | #define INTR_TYPE_HARD_EXCEPTION (3 << 8) /* processor exception */ |
| 356 | 358 | #define INTR_TYPE_SOFT_INTR (4 << 8) /* software interrupt */ |
| 357 | 359 | #define INTR_TYPE_PRIV_SW_EXCEPTION (5 << 8) /* ICE breakpoint - undocumented */ |
| 358 | 360 | #define INTR_TYPE_SOFT_EXCEPTION (6 << 8) /* software exception */ |
| 361 | +#define INTR_TYPE_OTHER_EVENT (7 << 8) /* other event */ | |
| 359 | 362 | |
| 360 | 363 | /* GUEST_INTERRUPTIBILITY_INFO flags. */ |
| 361 | 364 | #define GUEST_INTR_STATE_STI 0x00000001 |
| @@ -26,6 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | #include <linux/delay.h> |
| 27 | 27 | #include <linux/crash_dump.h> |
| 28 | 28 | #include <linux/reboot.h> |
| 29 | +#include <linux/memory.h> | |
| 29 | 30 | |
| 30 | 31 | #include <asm/uv/uv_mmrs.h> |
| 31 | 32 | #include <asm/uv/uv_hub.h> |
| @@ -392,6 +393,51 @@ extern int uv_hub_info_version(void) · 360 unmodified lines | ||
| 392 | 393 | } |
| 393 | 394 | EXPORT_SYMBOL(uv_hub_info_version); |
| 394 | 395 | |
| 396 | +/* Default UV memory block size is 2GB */ | |
| 397 | +static unsigned long mem_block_size = (2UL << 30); | |
| 398 | + | |
| 399 | +/* Kernel parameter to specify UV mem block size */ | |
| 400 | +static int parse_mem_block_size(char *ptr) | |
| 401 | +{ | |
| 402 | + unsigned long size = memparse(ptr, NULL); | |
| 403 | + | |
| 404 | + /* Size will be rounded down by set_block_size() below */ | |
| 405 | + mem_block_size = size; | |
| 406 | + return 0; | |
| 407 | +} | |
| 408 | +early_param("uv_memblksize", parse_mem_block_size); | |
| 409 | + | |
| 410 | +static __init int adj_blksize(u32 lgre) | |
| 411 | +{ | |
| 412 | + unsigned long base = (unsigned long)lgre << UV_GAM_RANGE_SHFT; | |
| 413 | + unsigned long size; | |
| 414 | + | |
| 415 | + for (size = mem_block_size; size > MIN_MEMORY_BLOCK_SIZE; size >>= 1) | |
| 416 | + if (IS_ALIGNED(base, size)) | |
| 417 | + break; | |
| 418 | + | |
| 419 | + if (size >= mem_block_size) | |
| 420 | + return 0; | |
| 421 | + | |
| 422 | + mem_block_size = size; | |
| 423 | + return 1; | |
| 424 | +} | |
| 425 | + | |
| 426 | +static __init void set_block_size(void) | |
| 427 | +{ | |
| 428 | + unsigned int order = ffs(mem_block_size); | |
| 429 | + | |
| 430 | + if (order) { | |
| 431 | + /* adjust for ffs return of 1..64 */ | |
| 432 | + set_memory_block_size_order(order - 1); | |
| 433 | + pr_info("UV: mem_block_size set to 0x%lx\n", mem_block_size); | |
| 434 | + } else { | |
| 435 | + /* bad or zero value, default to 1UL << 31 (2GB) */ | |
| 436 | + pr_err("UV: mem_block_size error with 0x%lx\n", mem_block_size); | |
| 437 | + set_memory_block_size_order(31); | |
| 438 | + } | |
| 439 | +} | |
| 440 | + | |
| 395 | 441 | /* Build GAM range lookup table: */ |
| 396 | 442 | static __init void build_uv_gr_table(void) |
| 397 | 443 | { |
| @@ -1180,23 +1226,30 @@ static void __init decode_gam_rng_tbl(unsigned long ptr) · 782 unmodified lines | ||
| 1180 | 1226 | << UV_GAM_RANGE_SHFT); |
| 1181 | 1227 | int order = 0; |
| 1182 | 1228 | char suffix[] = " KMGTPE"; |
| 1229 | + int flag = ' '; | |
| 1183 | 1230 | |
| 1184 | 1231 | while (size > 9999 && order < sizeof(suffix)) { |
| 1185 | 1232 | size /= 1024; |
| 1186 | 1233 | order++; |
| 1187 | 1234 | } |
| 1188 | 1235 | |
| 1236 | + /* adjust max block size to current range start */ | |
| 1237 | + if (gre->type == 1 || gre->type == 2) | |
| 1238 | + if (adj_blksize(lgre)) | |
| 1239 | + flag = '*'; | |
| 1240 | + | |
| 1189 | 1241 | if (!index) { |
| 1190 | 1242 | pr_info("UV: GAM Range Table...\n"); |
| 1191 | − pr_info("UV: # %20s %14s %5s %4s %5s %3s %2s\n", "Range", "", "Size", "Type", "NASID", "SID", "PN"); | |
| 1243 | + pr_info("UV: # %20s %14s %6s %4s %5s %3s %2s\n", "Range", "", "Size", "Type", "NASID", "SID", "PN"); | |
| 1192 | 1244 | } |
| 1193 | − pr_info("UV: %2d: 0x%014lx-0x%014lx %5lu%c %3d %04x %02x %02x\n", | |
| 1245 | + pr_info("UV: %2d: 0x%014lx-0x%014lx%c %5lu%c %3d %04x %02x %02x\n", | |
| 1194 | 1246 | index++, |
| 1195 | 1247 | (unsigned long)lgre << UV_GAM_RANGE_SHFT, |
| 1196 | 1248 | (unsigned long)gre->limit << UV_GAM_RANGE_SHFT, |
| 1197 | − size, suffix[order], | |
| 1249 | + flag, size, suffix[order], | |
| 1198 | 1250 | gre->type, gre->nasid, gre->sockid, gre->pnode); |
| 1199 | 1251 | |
| 1252 | + /* update to next range start */ | |
| 1200 | 1253 | lgre = gre->limit; |
| 1201 | 1254 | if (sock_min > gre->sockid) |
| 1202 | 1255 | sock_min = gre->sockid; |
| @@ -1427,6 +1480,7 @@ static void __init uv_system_init_hub(void) · 224 unmodified lines | ||
| 1427 | 1480 | |
| 1428 | 1481 | build_socket_tables(); |
| 1429 | 1482 | build_uv_gr_table(); |
| 1483 | + set_block_size(); | |
| 1430 | 1484 | uv_init_hub_info(&hub_info); |
| 1431 | 1485 | uv_possible_blades = num_possible_nodes(); |
| 1432 | 1486 | if (!_node_to_pnode) |
| @@ -27,6 +27,7 @@ · 26 unmodified lines | ||
| 27 | 27 | #include <asm/pgtable.h> |
| 28 | 28 | #include <asm/set_memory.h> |
| 29 | 29 | #include <asm/intel-family.h> |
| 30 | +#include <asm/hypervisor.h> | |
| 30 | 31 | |
| 31 | 32 | static void __init spectre_v2_select_mitigation(void); |
| 32 | 33 | static void __init ssb_select_mitigation(void); |
| @@ -664,6 +665,9 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr · 631 unmodified lines | ||
| 664 | 665 | if (boot_cpu_has(X86_FEATURE_PTI)) |
| 665 | 666 | return sprintf(buf, "Mitigation: PTI\n"); |
| 666 | 667 | |
| 668 | + if (hypervisor_is_type(X86_HYPER_XEN_PV)) | |
| 669 | + return sprintf(buf, "Unknown (XEN PV detected, hypervisor mitigation required)\n"); | |
| 670 | + | |
| 667 | 671 | break; |
| 668 | 672 | |
| 669 | 673 | case X86_BUG_SPECTRE_V1: |
| @@ -671,7 +671,7 @@ void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id) · 670 unmodified lines | ||
| 671 | 671 | num_sharing_cache = ((eax >> 14) & 0xfff) + 1; |
| 672 | 672 | |
| 673 | 673 | if (num_sharing_cache) { |
| 674 | − int bits = get_count_order(num_sharing_cache) - 1; | |
| 674 | + int bits = get_count_order(num_sharing_cache); | |
| 675 | 675 | |
| 676 | 676 | per_cpu(cpu_llc_id, cpu) = c->apicid >> bits; |
| 677 | 677 | } |
| @@ -1,3 +1,6 @@ | ||
| 1 | +/* cpu_feature_enabled() cannot be used this early */ | |
| 2 | +#define USE_EARLY_PGTABLE_L5 | |
| 3 | + | |
| 1 | 4 | #include <linux/bootmem.h> |
| 2 | 5 | #include <linux/linkage.h> |
| 3 | 6 | #include <linux/bitops.h> |
| @@ -160,6 +160,11 @@ static struct severity { · 159 unmodified lines | ||
| 160 | 160 | SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR|MCI_ADDR|MCACOD, MCI_UC_SAR|MCI_ADDR|MCACOD_INSTR), |
| 161 | 161 | USER |
| 162 | 162 | ), |
| 163 | + MCESEV( | |
| 164 | + PANIC, "Data load in unrecoverable area of kernel", | |
| 165 | + SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR|MCI_ADDR|MCACOD, MCI_UC_SAR|MCI_ADDR|MCACOD_DATA), | |
| 166 | + KERNEL | |
| 167 | + ), | |
| 163 | 168 | #endif |
| 164 | 169 | MCESEV( |
| 165 | 170 | PANIC, "Action required: unknown MCACOD", |
| @@ -772,23 +772,25 @@ EXPORT_SYMBOL_GPL(machine_check_poll); · 771 unmodified lines | ||
| 772 | 772 | static int mce_no_way_out(struct mce *m, char **msg, unsigned long *validp, |
| 773 | 773 | struct pt_regs *regs) |
| 774 | 774 | { |
| 775 | − int i, ret = 0; | |
| 776 | 775 | char *tmp; |
| 776 | + int i; | |
| 777 | 777 | |
| 778 | 778 | for (i = 0; i < mca_cfg.banks; i++) { |
| 779 | 779 | m->status = mce_rdmsrl(msr_ops.status(i)); |
| 780 | − if (m->status & MCI_STATUS_VAL) { | |
| 781 | − __set_bit(i, validp); | |
| 782 | − if (quirk_no_way_out) | |
| 783 | − quirk_no_way_out(i, m, regs); | |
| 784 | − } | |
| 780 | + if (!(m->status & MCI_STATUS_VAL)) | |
| 781 | + continue; | |
| 782 | + | |
| 783 | + __set_bit(i, validp); | |
| 784 | + if (quirk_no_way_out) | |
| 785 | + quirk_no_way_out(i, m, regs); | |
| 785 | 786 | |
| 786 | 787 | if (mce_severity(m, mca_cfg.tolerant, &tmp, true) >= MCE_PANIC_SEVERITY) { |
| 788 | + mce_read_aux(m, i); | |
| 787 | 789 | *msg = tmp; |
| 788 | − ret = 1; | |
| 790 | + return 1; | |
| 789 | 791 | } |
| 790 | 792 | } |
| 791 | − return ret; | |
| 793 | + return 0; | |
| 792 | 794 | } |
| 793 | 795 | |
| 794 | 796 | /* |
| @@ -1205,13 +1207,18 @@ void do_machine_check(struct pt_regs *regs, long error_code) · 410 unmodified lines | ||
| 1205 | 1207 | lmce = m.mcgstatus & MCG_STATUS_LMCES; |
| 1206 | 1208 | |
| 1207 | 1209 | /* |
| 1210 | + * Local machine check may already know that we have to panic. | |
| 1211 | + * Broadcast machine check begins rendezvous in mce_start() | |
| 1208 | 1212 | * Go through all banks in exclusion of the other CPUs. This way we |
| 1209 | 1213 | * don't report duplicated events on shared banks because the first one |
| 1210 | − * to see it will clear it. If this is a Local MCE, then no need to | |
| 1211 | − * perform rendezvous. | |
| 1214 | + * to see it will clear it. | |
| 1212 | 1215 | */ |
| 1213 | − if (!lmce) | |
| 1216 | + if (lmce) { | |
| 1217 | + if (no_way_out) | |
| 1218 | + mce_panic("Fatal local machine check", &m, msg); | |
| 1219 | + } else { | |
| 1214 | 1220 | order = mce_start(&no_way_out); |
| 1221 | + } | |
| 1215 | 1222 | |
| 1216 | 1223 | for (i = 0; i < cfg->banks; i++) { |
| 1217 | 1224 | __clear_bit(i, toclear); |
| @@ -1287,12 +1294,17 @@ void do_machine_check(struct pt_regs *regs, long error_code) · 69 unmodified lines | ||
| 1287 | 1294 | no_way_out = worst >= MCE_PANIC_SEVERITY; |
| 1288 | 1295 | } else { |
| 1289 | 1296 | /* |
| 1290 | − * Local MCE skipped calling mce_reign() | |
| 1291 | − * If we found a fatal error, we need to panic here. | |
| 1297 | + * If there was a fatal machine check we should have | |
| 1298 | + * already called mce_panic earlier in this function. | |
| 1299 | + * Since we re-read the banks, we might have found | |
| 1300 | + * something new. Check again to see if we found a | |
| 1301 | + * fatal error. We call "mce_severity()" again to | |
| 1302 | + * make sure we have the right "msg". | |
| 1292 | 1303 | */ |
| 1293 | − if (worst >= MCE_PANIC_SEVERITY && mca_cfg.tolerant < 3) | |
| 1294 | − mce_panic("Machine check from unknown source", | |
| 1295 | − NULL, NULL); | |
| 1304 | + if (worst >= MCE_PANIC_SEVERITY && mca_cfg.tolerant < 3) { | |
| 1305 | + mce_severity(&m, cfg->tolerant, &msg, true); | |
| 1306 | + mce_panic("Local fatal machine check!", &m, msg); | |
| 1307 | + } | |
| 1296 | 1308 | } |
| 1297 | 1309 | |
| 1298 | 1310 | /* |
| @@ -190,8 +190,11 @@ static void save_microcode_patch(void *data, unsigned int size) · 189 unmodified lines | ||
| 190 | 190 | p = memdup_patch(data, size); |
| 191 | 191 | if (!p) |
| 192 | 192 | pr_err("Error allocating buffer %p\n", data); |
| 193 | − else | |
| 193 | + else { | |
| 194 | 194 | list_replace(&iter->plist, &p->plist); |
| 195 | + kfree(iter->data); | |
| 196 | + kfree(iter); | |
| 197 | + } | |
| 195 | 198 | } |
| 196 | 199 | } |
| 197 | 200 | |
| @@ -1248,6 +1248,7 @@ void __init e820__memblock_setup(void) · 1247 unmodified lines | ||
| 1248 | 1248 | { |
| 1249 | 1249 | int i; |
| 1250 | 1250 | u64 end; |
| 1251 | + u64 addr = 0; | |
| 1251 | 1252 | |
| 1252 | 1253 | /* |
| 1253 | 1254 | * The bootstrap memblock region count maximum is 128 entries |
| @@ -1264,13 +1265,21 @@ void __init e820__memblock_setup(void) · 10 unmodified lines | ||
| 1264 | 1265 | struct e820_entry *entry = &e820_table->entries[i]; |
| 1265 | 1266 | |
| 1266 | 1267 | end = entry->addr + entry->size; |
| 1268 | + if (addr < entry->addr) | |
| 1269 | + memblock_reserve(addr, entry->addr - addr); | |
| 1270 | + addr = end; | |
| 1267 | 1271 | if (end != (resource_size_t)end) |
| 1268 | 1272 | continue; |
| 1269 | 1273 | |
| 1274 | + /* | |
| 1275 | + * all !E820_TYPE_RAM ranges (including gap ranges) are put | |
| 1276 | + * into memblock.reserved to make sure that struct pages in | |
| 1277 | + * such regions are not left uninitialized after bootup. | |
| 1278 | + */ | |
| 1270 | 1279 | if (entry->type != E820_TYPE_RAM && entry->type != E820_TYPE_RESERVED_KERN) |
| 1271 | − continue; | |
| 1272 | − | |
| 1273 | − memblock_add(entry->addr, entry->size); | |
| 1280 | + memblock_reserve(entry->addr, entry->size); | |
| 1281 | + else | |
| 1282 | + memblock_add(entry->addr, entry->size); | |
| 1274 | 1283 | } |
| 1275 | 1284 | |
| 1276 | 1285 | /* Throw away partial pages: */ |
| @@ -44,7 +44,7 @@ static unsigned int __initdata next_early_pgt; · 43 unmodified lines | ||
| 44 | 44 | pmdval_t early_pmd_flags = __PAGE_KERNEL_LARGE & ~(_PAGE_GLOBAL | _PAGE_NX); |
| 45 | 45 | |
| 46 | 46 | #ifdef CONFIG_X86_5LEVEL |
| 47 | −unsigned int __pgtable_l5_enabled __initdata; | |
| 47 | +unsigned int __pgtable_l5_enabled __ro_after_init; | |
| 48 | 48 | unsigned int pgdir_shift __ro_after_init = 39; |
| 49 | 49 | EXPORT_SYMBOL(pgdir_shift); |
| 50 | 50 | unsigned int ptrs_per_p4d __ro_after_init = 1; |
| @@ -645,12 +645,19 @@ static void quirk_intel_brickland_xeon_ras_cap(struct pci_dev *pdev) · 644 unmodified lines | ||
| 645 | 645 | /* Skylake */ |
| 646 | 646 | static void quirk_intel_purley_xeon_ras_cap(struct pci_dev *pdev) |
| 647 | 647 | { |
| 648 | − u32 capid0; | |
| 648 | + u32 capid0, capid5; | |
| 649 | 649 | |
| 650 | 650 | pci_read_config_dword(pdev, 0x84, &capid0); |
| 651 | + pci_read_config_dword(pdev, 0x98, &capid5); | |
| 651 | 652 | |
| 652 | − if ((capid0 & 0xc0) == 0xc0) | |
| 653 | + /* | |
| 654 | + * CAPID0{7:6} indicate whether this is an advanced RAS SKU | |
| 655 | + * CAPID5{8:5} indicate that various NVDIMM usage modes are | |
| 656 | + * enabled, so memory machine check recovery is also enabled. | |
| 657 | + */ | |
| 658 | + if ((capid0 & 0xc0) == 0xc0 || (capid5 & 0x1e0)) | |
| 653 | 659 | static_branch_inc(&mcsafe_key); |
| 660 | + | |
| 654 | 661 | } |
| 655 | 662 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x0ec3, quirk_intel_brickland_xeon_ras_cap); |
| 656 | 663 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, quirk_intel_brickland_xeon_ras_cap); |
| @@ -692,7 +692,7 @@ setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) · 691 unmodified lines | ||
| 692 | 692 | * Increment event counter and perform fixup for the pre-signal |
| 693 | 693 | * frame. |
| 694 | 694 | */ |
| 695 | − rseq_signal_deliver(regs); | |
| 695 | + rseq_signal_deliver(ksig, regs); | |
| 696 | 696 | |
| 697 | 697 | /* Set up the stack frame */ |
| 698 | 698 | if (is_ia32_frame(ksig)) { |
| @@ -835,16 +835,18 @@ static void math_error(struct pt_regs *regs, int error_code, int trapnr) · 834 unmodified lines | ||
| 835 | 835 | char *str = (trapnr == X86_TRAP_MF) ? "fpu exception" : |
| 836 | 836 | "simd exception"; |
| 837 | 837 | |
| 838 | − if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, SIGFPE) == NOTIFY_STOP) | |
| 839 | − return; | |
| 840 | 838 | cond_local_irq_enable(regs); |
| 841 | 839 | |
| 842 | 840 | if (!user_mode(regs)) { |
| 843 | − if (!fixup_exception(regs, trapnr)) { | |
| 844 | − task->thread.error_code = error_code; | |
| 845 | − task->thread.trap_nr = trapnr; | |
| 841 | + if (fixup_exception(regs, trapnr)) | |
| 842 | + return; | |
| 843 | + | |
| 844 | + task->thread.error_code = error_code; | |
| 845 | + task->thread.trap_nr = trapnr; | |
| 846 | + | |
| 847 | + if (notify_die(DIE_TRAP, str, regs, error_code, | |
| 848 | + trapnr, SIGFPE) != NOTIFY_STOP) | |
| 846 | 849 | die(str, regs, error_code); |
| 847 | − } | |
| 848 | 850 | return; |
| 849 | 851 | } |
| 850 | 852 | |
| @@ -293,7 +293,7 @@ static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool · 292 unmodified lines | ||
| 293 | 293 | insn_init(insn, auprobe->insn, sizeof(auprobe->insn), x86_64); |
| 294 | 294 | /* has the side-effect of processing the entire instruction */ |
| 295 | 295 | insn_get_length(insn); |
| 296 | − if (WARN_ON_ONCE(!insn_complete(insn))) | |
| 296 | + if (!insn_complete(insn)) | |
| 297 | 297 | return -ENOEXEC; |
| 298 | 298 | |
| 299 | 299 | if (is_prefix_bad(insn)) |
| @@ -1705,6 +1705,17 @@ static inline bool nested_cpu_has_vmwrite_any_field(struct kvm_vcpu *vcpu) · 1704 unmodified lines | ||
| 1705 | 1705 | MSR_IA32_VMX_MISC_VMWRITE_SHADOW_RO_FIELDS; |
| 1706 | 1706 | } |
| 1707 | 1707 | |
| 1708 | +static inline bool nested_cpu_has_zero_length_injection(struct kvm_vcpu *vcpu) | |
| 1709 | +{ | |
| 1710 | + return to_vmx(vcpu)->nested.msrs.misc_low & VMX_MISC_ZERO_LEN_INS; | |
| 1711 | +} | |
| 1712 | + | |
| 1713 | +static inline bool nested_cpu_supports_monitor_trap_flag(struct kvm_vcpu *vcpu) | |
| 1714 | +{ | |
| 1715 | + return to_vmx(vcpu)->nested.msrs.procbased_ctls_high & | |
| 1716 | + CPU_BASED_MONITOR_TRAP_FLAG; | |
| 1717 | +} | |
| 1718 | + | |
| 1708 | 1719 | static inline bool nested_cpu_has(struct vmcs12 *vmcs12, u32 bit) |
| 1709 | 1720 | { |
| 1710 | 1721 | return vmcs12->cpu_based_vm_exec_control & bit; |
| @@ -11620,6 +11631,62 @@ static int check_vmentry_prereqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) · 9909 unmodified lines | ||
| 11620 | 11631 | !nested_cr3_valid(vcpu, vmcs12->host_cr3)) |
| 11621 | 11632 | return VMXERR_ENTRY_INVALID_HOST_STATE_FIELD; |
| 11622 | 11633 | |
| 11634 | + /* | |
| 11635 | + * From the Intel SDM, volume 3: | |
| 11636 | + * Fields relevant to VM-entry event injection must be set properly. | |
| 11637 | + * These fields are the VM-entry interruption-information field, the | |
| 11638 | + * VM-entry exception error code, and the VM-entry instruction length. | |
| 11639 | + */ | |
| 11640 | + if (vmcs12->vm_entry_intr_info_field & INTR_INFO_VALID_MASK) { | |
| 11641 | + u32 intr_info = vmcs12->vm_entry_intr_info_field; | |
| 11642 | + u8 vector = intr_info & INTR_INFO_VECTOR_MASK; | |
| 11643 | + u32 intr_type = intr_info & INTR_INFO_INTR_TYPE_MASK; | |
| 11644 | + bool has_error_code = intr_info & INTR_INFO_DELIVER_CODE_MASK; | |
| 11645 | + bool should_have_error_code; | |
| 11646 | + bool urg = nested_cpu_has2(vmcs12, | |
| 11647 | + SECONDARY_EXEC_UNRESTRICTED_GUEST); | |
| 11648 | + bool prot_mode = !urg || vmcs12->guest_cr0 & X86_CR0_PE; | |
| 11649 | + | |
| 11650 | + /* VM-entry interruption-info field: interruption type */ | |
| 11651 | + if (intr_type == INTR_TYPE_RESERVED || | |
| 11652 | + (intr_type == INTR_TYPE_OTHER_EVENT && | |
| 11653 | + !nested_cpu_supports_monitor_trap_flag(vcpu))) | |
| 11654 | + return VMXERR_ENTRY_INVALID_CONTROL_FIELD; | |
| 11655 | + | |
| 11656 | + /* VM-entry interruption-info field: vector */ | |
| 11657 | + if ((intr_type == INTR_TYPE_NMI_INTR && vector != NMI_VECTOR) || | |
| 11658 | + (intr_type == INTR_TYPE_HARD_EXCEPTION && vector > 31) || | |
| 11659 | + (intr_type == INTR_TYPE_OTHER_EVENT && vector != 0)) | |
| 11660 | + return VMXERR_ENTRY_INVALID_CONTROL_FIELD; | |
| 11661 | + | |
| 11662 | + /* VM-entry interruption-info field: deliver error code */ | |
| 11663 | + should_have_error_code = | |
| 11664 | + intr_type == INTR_TYPE_HARD_EXCEPTION && prot_mode && | |
| 11665 | + x86_exception_has_error_code(vector); | |
| 11666 | + if (has_error_code != should_have_error_code) | |
| 11667 | + return VMXERR_ENTRY_INVALID_CONTROL_FIELD; | |
| 11668 | + | |
| 11669 | + /* VM-entry exception error code */ | |
| 11670 | + if (has_error_code && | |
| 11671 | + vmcs12->vm_entry_exception_error_code & GENMASK(31, 15)) | |
| 11672 | + return VMXERR_ENTRY_INVALID_CONTROL_FIELD; | |
| 11673 | + | |
| 11674 | + /* VM-entry interruption-info field: reserved bits */ | |
| 11675 | + if (intr_info & INTR_INFO_RESVD_BITS_MASK) | |
| 11676 | + return VMXERR_ENTRY_INVALID_CONTROL_FIELD; | |
| 11677 | + | |
| 11678 | + /* VM-entry instruction length */ | |
| 11679 | + switch (intr_type) { | |
| 11680 | + case INTR_TYPE_SOFT_EXCEPTION: | |
| 11681 | + case INTR_TYPE_SOFT_INTR: | |
| 11682 | + case INTR_TYPE_PRIV_SW_EXCEPTION: | |
| 11683 | + if ((vmcs12->vm_entry_instruction_len > 15) || | |
| 11684 | + (vmcs12->vm_entry_instruction_len == 0 && | |
| 11685 | + !nested_cpu_has_zero_length_injection(vcpu))) | |
| 11686 | + return VMXERR_ENTRY_INVALID_CONTROL_FIELD; | |
| 11687 | + } | |
| 11688 | + } | |
| 11689 | + | |
| 11623 | 11690 | return 0; |
| 11624 | 11691 | } |
| 11625 | 11692 | |
| @@ -110,6 +110,15 @@ static inline bool is_la57_mode(struct kvm_vcpu *vcpu) · 109 unmodified lines | ||
| 110 | 110 | #endif |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | +static inline bool x86_exception_has_error_code(unsigned int vector) | |
| 114 | +{ | |
| 115 | + static u32 exception_has_error_code = BIT(DF_VECTOR) | BIT(TS_VECTOR) | | |
| 116 | + BIT(NP_VECTOR) | BIT(SS_VECTOR) | BIT(GP_VECTOR) | | |
| 117 | + BIT(PF_VECTOR) | BIT(AC_VECTOR); | |
| 118 | + | |
| 119 | + return (1U << vector) & exception_has_error_code; | |
| 120 | +} | |
| 121 | + | |
| 113 | 122 | static inline bool mmu_is_nested(struct kvm_vcpu *vcpu) |
| 114 | 123 | { |
| 115 | 124 | return vcpu->arch.walk_mmu == &vcpu->arch.nested_mmu; |
| @@ -641,11 +641,6 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) · 640 unmodified lines | ||
| 641 | 641 | return 0; |
| 642 | 642 | } |
| 643 | 643 | |
| 644 | −static const char nx_warning[] = KERN_CRIT | |
| 645 | −"kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n"; | |
| 646 | −static const char smep_warning[] = KERN_CRIT | |
| 647 | −"unable to execute userspace code (SMEP?) (uid: %d)\n"; | |
| 648 | − | |
| 649 | 644 | static void |
| 650 | 645 | show_fault_oops(struct pt_regs *regs, unsigned long error_code, |
| 651 | 646 | unsigned long address) |
| @@ -664,20 +659,18 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, · 12 unmodified lines | ||
| 664 | 659 | pte = lookup_address_in_pgd(pgd, address, &level); |
| 665 | 660 | |
| 666 | 661 | if (pte && pte_present(*pte) && !pte_exec(*pte)) |
| 667 | − printk(nx_warning, from_kuid(&init_user_ns, current_uid())); | |
| 662 | + pr_crit("kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n", | |
| 663 | + from_kuid(&init_user_ns, current_uid())); | |
| 668 | 664 | if (pte && pte_present(*pte) && pte_exec(*pte) && |
| 669 | 665 | (pgd_flags(*pgd) & _PAGE_USER) && |
| 670 | 666 | (__read_cr4() & X86_CR4_SMEP)) |
| 671 | − printk(smep_warning, from_kuid(&init_user_ns, current_uid())); | |
| 667 | + pr_crit("unable to execute userspace code (SMEP?) (uid: %d)\n", | |
| 668 | + from_kuid(&init_user_ns, current_uid())); | |
| 672 | 669 | } |
| 673 | 670 | |
| 674 | − printk(KERN_ALERT "BUG: unable to handle kernel "); | |
| 675 | − if (address < PAGE_SIZE) | |
| 676 | − printk(KERN_CONT "NULL pointer dereference"); | |
| 677 | − else | |
| 678 | − printk(KERN_CONT "paging request"); | |
| 679 | − | |
| 680 | − printk(KERN_CONT " at %px\n", (void *) address); | |
| 671 | + pr_alert("BUG: unable to handle kernel %s at %px\n", | |
| 672 | + address < PAGE_SIZE ? "NULL pointer dereference" : "paging request", | |
| 673 | + (void *)address); | |
| 681 | 674 | |
| 682 | 675 | dump_pagetable(address); |
| 683 | 676 | } |
| @@ -1350,16 +1350,28 @@ int kern_addr_valid(unsigned long addr) · 1349 unmodified lines | ||
| 1350 | 1350 | /* Amount of ram needed to start using large blocks */ |
| 1351 | 1351 | #define MEM_SIZE_FOR_LARGE_BLOCK (64UL << 30) |
| 1352 | 1352 | |
| 1353 | +/* Adjustable memory block size */ | |
| 1354 | +static unsigned long set_memory_block_size; | |
| 1355 | +int __init set_memory_block_size_order(unsigned int order) | |
| 1356 | +{ | |
| 1357 | + unsigned long size = 1UL << order; | |
| 1358 | + | |
| 1359 | + if (size > MEM_SIZE_FOR_LARGE_BLOCK || size < MIN_MEMORY_BLOCK_SIZE) | |
| 1360 | + return -EINVAL; | |
| 1361 | + | |
| 1362 | + set_memory_block_size = size; | |
| 1363 | + return 0; | |
| 1364 | +} | |
| 1365 | + | |
| 1353 | 1366 | static unsigned long probe_memory_block_size(void) |
| 1354 | 1367 | { |
| 1355 | 1368 | unsigned long boot_mem_end = max_pfn << PAGE_SHIFT; |
| 1356 | 1369 | unsigned long bz; |
| 1357 | 1370 | |
| 1358 | − /* If this is UV system, always set 2G block size */ | |
| 1359 | − if (is_uv_system()) { | |
| 1360 | − bz = MAX_BLOCK_SIZE; | |
| 1371 | + /* If memory block size has been set, then use it */ | |
| 1372 | + bz = set_memory_block_size; | |
| 1373 | + if (bz) | |
| 1361 | 1374 | goto done; |
| 1362 | − } | |
| 1363 | 1375 | |
| 1364 | 1376 | /* Use regular block if RAM is smaller than MEM_SIZE_FOR_LARGE_BLOCK */ |
| 1365 | 1377 | if (boot_mem_end < MEM_SIZE_FOR_LARGE_BLOCK) { |
| @@ -166,14 +166,14 @@ void __init efi_call_phys_epilog(pgd_t *save_pgd) · 165 unmodified lines | ||
| 166 | 166 | pgd = pgd_offset_k(pgd_idx * PGDIR_SIZE); |
| 167 | 167 | set_pgd(pgd_offset_k(pgd_idx * PGDIR_SIZE), save_pgd[pgd_idx]); |
| 168 | 168 | |
| 169 | − if (!(pgd_val(*pgd) & _PAGE_PRESENT)) | |
| 169 | + if (!pgd_present(*pgd)) | |
| 170 | 170 | continue; |
| 171 | 171 | |
| 172 | 172 | for (i = 0; i < PTRS_PER_P4D; i++) { |
| 173 | 173 | p4d = p4d_offset(pgd, |
| 174 | 174 | pgd_idx * PGDIR_SIZE + i * P4D_SIZE); |
| 175 | 175 | |
| 176 | − if (!(p4d_val(*p4d) & _PAGE_PRESENT)) | |
| 176 | + if (!p4d_present(*p4d)) | |
| 177 | 177 | continue; |
| 178 | 178 | |
| 179 | 179 | pud = (pud_t *)p4d_page_vaddr(*p4d); |
| @@ -64,6 +64,13 @@ struct shared_info xen_dummy_shared_info; · 63 unmodified lines | ||
| 64 | 64 | __read_mostly int xen_have_vector_callback; |
| 65 | 65 | EXPORT_SYMBOL_GPL(xen_have_vector_callback); |
| 66 | 66 | |
| 67 | +/* | |
| 68 | + * NB: needs to live in .data because it's used by xen_prepare_pvh which runs | |
| 69 | + * before clearing the bss. | |
| 70 | + */ | |
| 71 | +uint32_t xen_start_flags __attribute__((section(".data"))) = 0; | |
| 72 | +EXPORT_SYMBOL(xen_start_flags); | |
| 73 | + | |
| 67 | 74 | /* |
| 68 | 75 | * Point at some empty memory to start with. We map the real shared_info |
| 69 | 76 | * page as soon as fixmap is up and running. |
| @@ -1203,6 +1203,7 @@ asmlinkage __visible void __init xen_start_kernel(void) · 1202 unmodified lines | ||
| 1203 | 1203 | return; |
| 1204 | 1204 | |
| 1205 | 1205 | xen_domain_type = XEN_PV_DOMAIN; |
| 1206 | + xen_start_flags = xen_start_info->flags; | |
| 1206 | 1207 | |
| 1207 | 1208 | xen_setup_features(); |
| 1208 | 1209 | |
| @@ -97,6 +97,7 @@ void __init xen_prepare_pvh(void) · 96 unmodified lines | ||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | xen_pvh = 1; |
| 100 | + xen_start_flags = pvh_start_info.flags; | |
| 100 | 101 | |
| 101 | 102 | msr = cpuid_ebx(xen_cpuid_base() + 2); |
| 102 | 103 | pfn = __pa(hypercall_page); |
| @@ -32,6 +32,7 @@ · 31 unmodified lines | ||
| 32 | 32 | #include <xen/interface/vcpu.h> |
| 33 | 33 | #include <xen/interface/xenpmu.h> |
| 34 | 34 | |
| 35 | +#include <asm/spec-ctrl.h> | |
| 35 | 36 | #include <asm/xen/interface.h> |
| 36 | 37 | #include <asm/xen/hypercall.h> |
| 37 | 38 | |
| @@ -70,6 +71,8 @@ static void cpu_bringup(void) · 32 unmodified lines | ||
| 70 | 71 | cpu_data(cpu).x86_max_cores = 1; |
| 71 | 72 | set_cpu_sibling_map(cpu); |
| 72 | 73 | |
| 74 | + speculative_store_bypass_ht_init(); | |
| 75 | + | |
| 73 | 76 | xen_setup_cpu_clockevents(); |
| 74 | 77 | |
| 75 | 78 | notify_cpu_starting(cpu); |
| @@ -250,6 +253,8 @@ static void __init xen_pv_smp_prepare_cpus(unsigned int max_cpus) · 174 unmodified lines | ||
| 250 | 253 | } |
| 251 | 254 | set_cpu_sibling_map(0); |
| 252 | 255 | |
| 256 | + speculative_store_bypass_ht_init(); | |
| 257 | + | |
| 253 | 258 | xen_pmu_init(0); |
| 254 | 259 | |
| 255 | 260 | if (xen_smp_intr_init(0) || xen_smp_intr_init_pv(0)) |
| @@ -1807,9 +1807,6 @@ again: · 1806 unmodified lines | ||
| 1807 | 1807 | if (!bio_integrity_endio(bio)) |
| 1808 | 1808 | return; |
| 1809 | 1809 | |
| 1810 | − if (WARN_ONCE(bio->bi_next, "driver left bi_next not NULL")) | |
| 1811 | − bio->bi_next = NULL; | |
| 1812 | − | |
| 1813 | 1810 | /* |
| 1814 | 1811 | * Need to have a real endio function for chained bios, otherwise |
| 1815 | 1812 | * various corner cases will break (like stacking block devices that |
| @@ -273,10 +273,6 @@ static void req_bio_endio(struct request *rq, struct bio *bio, · 272 unmodified lines | ||
| 273 | 273 | bio_advance(bio, nbytes); |
| 274 | 274 | |
| 275 | 275 | /* don't actually finish bio if it's part of flush sequence */ |
| 276 | − /* | |
| 277 | − * XXX this code looks suspicious - it's not consistent with advancing | |
| 278 | − * req->bio in caller | |
| 279 | − */ | |
| 280 | 276 | if (bio->bi_iter.bi_size == 0 && !(rq->rq_flags & RQF_FLUSH_SEQ)) |
| 281 | 277 | bio_endio(bio); |
| 282 | 278 | } |
| @@ -3081,10 +3077,8 @@ bool blk_update_request(struct request *req, blk_status_t error, · 2798 unmodified lines | ||
| 3081 | 3077 | struct bio *bio = req->bio; |
| 3082 | 3078 | unsigned bio_bytes = min(bio->bi_iter.bi_size, nr_bytes); |
| 3083 | 3079 | |
| 3084 | − if (bio_bytes == bio->bi_iter.bi_size) { | |
| 3080 | + if (bio_bytes == bio->bi_iter.bi_size) | |
| 3085 | 3081 | req->bio = bio->bi_next; |
| 3086 | − bio->bi_next = NULL; | |
| 3087 | − } | |
| 3088 | 3082 | |
| 3089 | 3083 | /* Completion has already been traced */ |
| 3090 | 3084 | bio_clear_flag(bio, BIO_TRACE_COMPLETION); |
| @@ -3479,6 +3473,10 @@ static void __blk_rq_prep_clone(struct request *dst, struct request *src) · 388 unmodified lines | ||
| 3479 | 3473 | dst->cpu = src->cpu; |
| 3480 | 3474 | dst->__sector = blk_rq_pos(src); |
| 3481 | 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 | + } | |
| 3482 | 3480 | dst->nr_phys_segments = src->nr_phys_segments; |
| 3483 | 3481 | dst->ioprio = src->ioprio; |
| 3484 | 3482 | dst->extra_len = src->extra_len; |
| @@ -356,7 +356,7 @@ static const char *const blk_mq_rq_state_name_array[] = { · 355 unmodified lines | ||
| 356 | 356 | |
| 357 | 357 | static const char *blk_mq_rq_state_name(enum mq_rq_state rq_state) |
| 358 | 358 | { |
| 359 | − if (WARN_ON_ONCE((unsigned int)rq_state > | |
| 359 | + if (WARN_ON_ONCE((unsigned int)rq_state >= | |
| 360 | 360 | ARRAY_SIZE(blk_mq_rq_state_name_array))) |
| 361 | 361 | return "(?)"; |
| 362 | 362 | return blk_mq_rq_state_name_array[rq_state]; |
| @@ -781,7 +781,6 @@ static void blk_mq_rq_timed_out(struct request *req, bool reserved) · 780 unmodified lines | ||
| 781 | 781 | WARN_ON_ONCE(ret != BLK_EH_RESET_TIMER); |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | − req->rq_flags &= ~RQF_TIMED_OUT; | |
| 785 | 784 | blk_add_timer(req); |
| 786 | 785 | } |
| 787 | 786 | |
| @@ -1076,6 +1075,9 @@ static bool blk_mq_mark_tag_wait(struct blk_mq_hw_ctx **hctx, · 288 unmodified lines | ||
| 1076 | 1075 | |
| 1077 | 1076 | #define BLK_MQ_RESOURCE_DELAY 3 /* ms units */ |
| 1078 | 1077 | |
| 1078 | +/* | |
| 1079 | + * Returns true if we did some work AND can potentially do more. | |
| 1080 | + */ | |
| 1079 | 1081 | bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, |
| 1080 | 1082 | bool got_budget) |
| 1081 | 1083 | { |
| @@ -1206,8 +1208,17 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, · 124 unmodified lines | ||
| 1206 | 1208 | blk_mq_run_hw_queue(hctx, true); |
| 1207 | 1209 | else if (needs_restart && (ret == BLK_STS_RESOURCE)) |
| 1208 | 1210 | blk_mq_delay_run_hw_queue(hctx, BLK_MQ_RESOURCE_DELAY); |
| 1211 | + | |
| 1212 | + return false; | |
| 1209 | 1213 | } |
| 1210 | 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 | + | |
| 1211 | 1222 | return (queued + errors) != 0; |
| 1212 | 1223 | } |
| 1213 | 1224 | |
| @@ -144,6 +144,7 @@ do_local: · 143 unmodified lines | ||
| 144 | 144 | |
| 145 | 145 | local_irq_restore(flags); |
| 146 | 146 | } |
| 147 | +EXPORT_SYMBOL(__blk_complete_request); | |
| 147 | 148 | |
| 148 | 149 | /** |
| 149 | 150 | * blk_complete_request - end I/O on a request |
| @@ -210,6 +210,7 @@ void blk_add_timer(struct request *req) · 209 unmodified lines | ||
| 210 | 210 | if (!req->timeout) |
| 211 | 211 | req->timeout = q->rq_timeout; |
| 212 | 212 | |
| 213 | + req->rq_flags &= ~RQF_TIMED_OUT; | |
| 213 | 214 | blk_rq_set_deadline(req, jiffies + req->timeout); |
| 214 | 215 | |
| 215 | 216 | /* |
| @@ -877,7 +877,7 @@ static size_t response_get_string(const struct parsed_resp *resp, int n, · 876 unmodified lines | ||
| 877 | 877 | return 0; |
| 878 | 878 | } |
| 879 | 879 | |
| 880 | − if (n > resp->num) { | |
| 880 | + if (n >= resp->num) { | |
| 881 | 881 | pr_debug("Response has %d tokens. Can't access %d\n", |
| 882 | 882 | resp->num, n); |
| 883 | 883 | return 0; |
| @@ -916,7 +916,7 @@ static u64 response_get_u64(const struct parsed_resp *resp, int n) · 32 unmodified lines | ||
| 916 | 916 | return 0; |
| 917 | 917 | } |
| 918 | 918 | |
| 919 | − if (n > resp->num) { | |
| 919 | + if (n >= resp->num) { | |
| 920 | 920 | pr_debug("Response has %d tokens. Can't access %d\n", |
| 921 | 921 | resp->num, n); |
| 922 | 922 | return 0; |
| @@ -1,3 +1,3 @@ | ||
| 1 | 1 | #include <linux/kernel.h> |
| 2 | 2 | |
| 3 | −extern const char __initdata *const blacklist_hashes[]; | |
| 3 | +extern const char __initconst *const blacklist_hashes[]; | |
| @@ -1060,12 +1060,19 @@ void af_alg_async_cb(struct crypto_async_request *_req, int err) · 1059 unmodified lines | ||
| 1060 | 1060 | } |
| 1061 | 1061 | EXPORT_SYMBOL_GPL(af_alg_async_cb); |
| 1062 | 1062 | |
| 1063 | −__poll_t af_alg_poll_mask(struct socket *sock, __poll_t events) | |
| 1063 | +/** | |
| 1064 | + * af_alg_poll - poll system call handler | |
| 1065 | + */ | |
| 1066 | +__poll_t af_alg_poll(struct file *file, struct socket *sock, | |
| 1067 | + poll_table *wait) | |
| 1064 | 1068 | { |
| 1065 | 1069 | struct sock *sk = sock->sk; |
| 1066 | 1070 | struct alg_sock *ask = alg_sk(sk); |
| 1067 | 1071 | struct af_alg_ctx *ctx = ask->private; |
| 1068 | − __poll_t mask = 0; | |
| 1072 | + __poll_t mask; | |
| 1073 | + | |
| 1074 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 1075 | + mask = 0; | |
| 1069 | 1076 | |
| 1070 | 1077 | if (!ctx->more || ctx->used) |
| 1071 | 1078 | mask |= EPOLLIN | EPOLLRDNORM; |
| @@ -1075,7 +1082,7 @@ __poll_t af_alg_poll_mask(struct socket *sock, __poll_t events) · 3 unmodified lines | ||
| 1075 | 1082 | |
| 1076 | 1083 | return mask; |
| 1077 | 1084 | } |
| 1078 | −EXPORT_SYMBOL_GPL(af_alg_poll_mask); | |
| 1085 | +EXPORT_SYMBOL_GPL(af_alg_poll); | |
| 1079 | 1086 | |
| 1080 | 1087 | /** |
| 1081 | 1088 | * af_alg_alloc_areq - allocate struct af_alg_async_req |
| @@ -375,7 +375,7 @@ static struct proto_ops algif_aead_ops = { · 374 unmodified lines | ||
| 375 | 375 | .sendmsg = aead_sendmsg, |
| 376 | 376 | .sendpage = af_alg_sendpage, |
| 377 | 377 | .recvmsg = aead_recvmsg, |
| 378 | − .poll_mask = af_alg_poll_mask, | |
| 378 | + .poll = af_alg_poll, | |
| 379 | 379 | }; |
| 380 | 380 | |
| 381 | 381 | static int aead_check_key(struct socket *sock) |
| @@ -471,7 +471,7 @@ static struct proto_ops algif_aead_ops_nokey = { · 89 unmodified lines | ||
| 471 | 471 | .sendmsg = aead_sendmsg_nokey, |
| 472 | 472 | .sendpage = aead_sendpage_nokey, |
| 473 | 473 | .recvmsg = aead_recvmsg_nokey, |
| 474 | − .poll_mask = af_alg_poll_mask, | |
| 474 | + .poll = af_alg_poll, | |
| 475 | 475 | }; |
| 476 | 476 | |
| 477 | 477 | static void *aead_bind(const char *name, u32 type, u32 mask) |
| @@ -206,7 +206,7 @@ static struct proto_ops algif_skcipher_ops = { · 205 unmodified lines | ||
| 206 | 206 | .sendmsg = skcipher_sendmsg, |
| 207 | 207 | .sendpage = af_alg_sendpage, |
| 208 | 208 | .recvmsg = skcipher_recvmsg, |
| 209 | − .poll_mask = af_alg_poll_mask, | |
| 209 | + .poll = af_alg_poll, | |
| 210 | 210 | }; |
| 211 | 211 | |
| 212 | 212 | static int skcipher_check_key(struct socket *sock) |
| @@ -302,7 +302,7 @@ static struct proto_ops algif_skcipher_ops_nokey = { · 89 unmodified lines | ||
| 302 | 302 | .sendmsg = skcipher_sendmsg_nokey, |
| 303 | 303 | .sendpage = skcipher_sendpage_nokey, |
| 304 | 304 | .recvmsg = skcipher_recvmsg_nokey, |
| 305 | − .poll_mask = af_alg_poll_mask, | |
| 305 | + .poll = af_alg_poll, | |
| 306 | 306 | }; |
| 307 | 307 | |
| 308 | 308 | static void *skcipher_bind(const char *name, u32 type, u32 mask) |
| @@ -249,6 +249,15 @@ int x509_note_signature(void *context, size_t hdrlen, · 248 unmodified lines | ||
| 249 | 249 | return -EINVAL; |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | + if (strcmp(ctx->cert->sig->pkey_algo, "rsa") == 0) { | |
| 253 | + /* Discard the BIT STRING metadata */ | |
| 254 | + if (vlen < 1 || *(const u8 *)value != 0) | |
| 255 | + return -EBADMSG; | |
| 256 | + | |
| 257 | + value++; | |
| 258 | + vlen--; | |
| 259 | + } | |
| 260 | + | |
| 252 | 261 | ctx->cert->raw_sig = value; |
| 253 | 262 | ctx->cert->raw_sig_size = vlen; |
| 254 | 263 | return 0; |
| @@ -274,8 +274,9 @@ static void crypto_morus640_decrypt_chunk(struct morus640_state *state, u8 *dst, · 273 unmodified lines | ||
| 274 | 274 | union morus640_block_in tail; |
| 275 | 275 | |
| 276 | 276 | memcpy(tail.bytes, src, size); |
| 277 | + memset(tail.bytes + size, 0, MORUS640_BLOCK_SIZE - size); | |
| 277 | 278 | |
| 278 | − crypto_morus640_load_a(&m, src); | |
| 279 | + crypto_morus640_load_a(&m, tail.bytes); | |
| 279 | 280 | crypto_morus640_core(state, &m); |
| 280 | 281 | crypto_morus640_store_a(tail.bytes, &m); |
| 281 | 282 | memset(tail.bytes + size, 0, MORUS640_BLOCK_SIZE - size); |
| @@ -152,7 +152,7 @@ static SHA3_INLINE void keccakf_round(u64 st[25]) · 151 unmodified lines | ||
| 152 | 152 | st[24] ^= bc[ 4]; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | −static void __optimize("O3") keccakf(u64 st[25]) | |
| 155 | +static void keccakf(u64 st[25]) | |
| 156 | 156 | { |
| 157 | 157 | int round; |
| 158 | 158 | |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #include <linux/pm_domain.h> |
| 23 | 23 | #include <linux/pm_runtime.h> |
| 24 | 24 | #include <linux/pwm.h> |
| 25 | +#include <linux/suspend.h> | |
| 25 | 26 | #include <linux/delay.h> |
| 26 | 27 | |
| 27 | 28 | #include "internal.h" |
| @@ -946,9 +947,10 @@ static void lpss_iosf_exit_d3_state(void) · 918 unmodified lines | ||
| 946 | 947 | mutex_unlock(&lpss_iosf_mutex); |
| 947 | 948 | } |
| 948 | 949 | |
| 949 | −static int acpi_lpss_suspend(struct device *dev, bool wakeup) | |
| 950 | +static int acpi_lpss_suspend(struct device *dev, bool runtime) | |
| 950 | 951 | { |
| 951 | 952 | struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); |
| 953 | + bool wakeup = runtime || device_may_wakeup(dev); | |
| 952 | 954 | int ret; |
| 953 | 955 | |
| 954 | 956 | if (pdata->dev_desc->flags & LPSS_SAVE_CTX) |
| @@ -961,13 +963,14 @@ static int acpi_lpss_suspend(struct device *dev, bool wakeup) · 6 unmodified lines | ||
| 961 | 963 | * wrong status for devices being about to be powered off. See |
| 962 | 964 | * lpss_iosf_enter_d3_state() for further information. |
| 963 | 965 | */ |
| 964 | − if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) | |
| 966 | + if ((runtime || !pm_suspend_via_firmware()) && | |
| 967 | + lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) | |
| 965 | 968 | lpss_iosf_enter_d3_state(); |
| 966 | 969 | |
| 967 | 970 | return ret; |
| 968 | 971 | } |
| 969 | 972 | |
| 970 | −static int acpi_lpss_resume(struct device *dev) | |
| 973 | +static int acpi_lpss_resume(struct device *dev, bool runtime) | |
| 971 | 974 | { |
| 972 | 975 | struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); |
| 973 | 976 | int ret; |
| @@ -976,7 +979,8 @@ static int acpi_lpss_resume(struct device *dev) · 2 unmodified lines | ||
| 976 | 979 | * This call is kept first to be in symmetry with |
| 977 | 980 | * acpi_lpss_runtime_suspend() one. |
| 978 | 981 | */ |
| 979 | − if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) | |
| 982 | + if ((runtime || !pm_resume_via_firmware()) && | |
| 983 | + lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) | |
| 980 | 984 | lpss_iosf_exit_d3_state(); |
| 981 | 985 | |
| 982 | 986 | ret = acpi_dev_resume(dev); |
| @@ -1000,12 +1004,12 @@ static int acpi_lpss_suspend_late(struct device *dev) · 17 unmodified lines | ||
| 1000 | 1004 | return 0; |
| 1001 | 1005 | |
| 1002 | 1006 | ret = pm_generic_suspend_late(dev); |
| 1003 | − return ret ? ret : acpi_lpss_suspend(dev, device_may_wakeup(dev)); | |
| 1007 | + return ret ? ret : acpi_lpss_suspend(dev, false); | |
| 1004 | 1008 | } |
| 1005 | 1009 | |
| 1006 | 1010 | static int acpi_lpss_resume_early(struct device *dev) |
| 1007 | 1011 | { |
| 1008 | − int ret = acpi_lpss_resume(dev); | |
| 1012 | + int ret = acpi_lpss_resume(dev, false); | |
| 1009 | 1013 | |
| 1010 | 1014 | return ret ? ret : pm_generic_resume_early(dev); |
| 1011 | 1015 | } |
| @@ -1020,7 +1024,7 @@ static int acpi_lpss_runtime_suspend(struct device *dev) · 8 unmodified lines | ||
| 1020 | 1024 | |
| 1021 | 1025 | static int acpi_lpss_runtime_resume(struct device *dev) |
| 1022 | 1026 | { |
| 1023 | − int ret = acpi_lpss_resume(dev); | |
| 1027 | + int ret = acpi_lpss_resume(dev, true); | |
| 1024 | 1028 | |
| 1025 | 1029 | return ret ? ret : pm_generic_runtime_resume(dev); |
| 1026 | 1030 | } |
| @@ -2037,6 +2037,17 @@ static inline void acpi_ec_query_exit(void) · 2036 unmodified lines | ||
| 2037 | 2037 | } |
| 2038 | 2038 | } |
| 2039 | 2039 | |
| 2040 | +static const struct dmi_system_id acpi_ec_no_wakeup[] = { | |
| 2041 | + { | |
| 2042 | + .ident = "Thinkpad X1 Carbon 6th", | |
| 2043 | + .matches = { | |
| 2044 | + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | |
| 2045 | + DMI_MATCH(DMI_PRODUCT_NAME, "20KGS3JF01"), | |
| 2046 | + }, | |
| 2047 | + }, | |
| 2048 | + { }, | |
| 2049 | +}; | |
| 2050 | + | |
| 2040 | 2051 | int __init acpi_ec_init(void) |
| 2041 | 2052 | { |
| 2042 | 2053 | int result; |
| @@ -2047,6 +2058,15 @@ int __init acpi_ec_init(void) · 4 unmodified lines | ||
| 2047 | 2058 | if (result) |
| 2048 | 2059 | return result; |
| 2049 | 2060 | |
| 2061 | + /* | |
| 2062 | + * Disable EC wakeup on following systems to prevent periodic | |
| 2063 | + * wakeup from EC GPE. | |
| 2064 | + */ | |
| 2065 | + if (dmi_check_system(acpi_ec_no_wakeup)) { | |
| 2066 | + ec_no_wakeup = true; | |
| 2067 | + pr_debug("Disabling EC wakeup on suspend-to-idle\n"); | |
| 2068 | + } | |
| 2069 | + | |
| 2050 | 2070 | /* Drivers must be started after acpi_ec_query_init() */ |
| 2051 | 2071 | dsdt_fail = acpi_bus_register_driver(&acpi_ec_driver); |
| 2052 | 2072 | /* |
| @@ -45,6 +45,8 @@ · 44 unmodified lines | ||
| 45 | 45 | #include <linux/uaccess.h> |
| 46 | 46 | #include <linux/io-64-nonatomic-lo-hi.h> |
| 47 | 47 | |
| 48 | +#include "acpica/accommon.h" | |
| 49 | +#include "acpica/acnamesp.h" | |
| 48 | 50 | #include "internal.h" |
| 49 | 51 | |
| 50 | 52 | #define _COMPONENT ACPI_OS_SERVICES |
| @@ -1490,6 +1492,76 @@ int acpi_check_region(resource_size_t start, resource_size_t n, · 1439 unmodified lines | ||
| 1490 | 1492 | } |
| 1491 | 1493 | EXPORT_SYMBOL(acpi_check_region); |
| 1492 | 1494 | |
| 1495 | +static acpi_status acpi_deactivate_mem_region(acpi_handle handle, u32 level, | |
| 1496 | + void *_res, void **return_value) | |
| 1497 | +{ | |
| 1498 | + struct acpi_mem_space_context **mem_ctx; | |
| 1499 | + union acpi_operand_object *handler_obj; | |
| 1500 | + union acpi_operand_object *region_obj2; | |
| 1501 | + union acpi_operand_object *region_obj; | |
| 1502 | + struct resource *res = _res; | |
| 1503 | + acpi_status status; | |
| 1504 | + | |
| 1505 | + region_obj = acpi_ns_get_attached_object(handle); | |
| 1506 | + if (!region_obj) | |
| 1507 | + return AE_OK; | |
| 1508 | + | |
| 1509 | + handler_obj = region_obj->region.handler; | |
| 1510 | + if (!handler_obj) | |
| 1511 | + return AE_OK; | |
| 1512 | + | |
| 1513 | + if (region_obj->region.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) | |
| 1514 | + return AE_OK; | |
| 1515 | + | |
| 1516 | + if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) | |
| 1517 | + return AE_OK; | |
| 1518 | + | |
| 1519 | + region_obj2 = acpi_ns_get_secondary_object(region_obj); | |
| 1520 | + if (!region_obj2) | |
| 1521 | + return AE_OK; | |
| 1522 | + | |
| 1523 | + mem_ctx = (void *)®ion_obj2->extra.region_context; | |
| 1524 | + | |
| 1525 | + if (!(mem_ctx[0]->address >= res->start && | |
| 1526 | + mem_ctx[0]->address < res->end)) | |
| 1527 | + return AE_OK; | |
| 1528 | + | |
| 1529 | + status = handler_obj->address_space.setup(region_obj, | |
| 1530 | + ACPI_REGION_DEACTIVATE, | |
| 1531 | + NULL, (void **)mem_ctx); | |
| 1532 | + if (ACPI_SUCCESS(status)) | |
| 1533 | + region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE); | |
| 1534 | + | |
| 1535 | + return status; | |
| 1536 | +} | |
| 1537 | + | |
| 1538 | +/** | |
| 1539 | + * acpi_release_memory - Release any mappings done to a memory region | |
| 1540 | + * @handle: Handle to namespace node | |
| 1541 | + * @res: Memory resource | |
| 1542 | + * @level: A level that terminates the search | |
| 1543 | + * | |
| 1544 | + * Walks through @handle and unmaps all SystemMemory Operation Regions that | |
| 1545 | + * overlap with @res and that have already been activated (mapped). | |
| 1546 | + * | |
| 1547 | + * This is a helper that allows drivers to place special requirements on memory | |
| 1548 | + * region that may overlap with operation regions, primarily allowing them to | |
| 1549 | + * safely map the region as non-cached memory. | |
| 1550 | + * | |
| 1551 | + * The unmapped Operation Regions will be automatically remapped next time they | |
| 1552 | + * are called, so the drivers do not need to do anything else. | |
| 1553 | + */ | |
| 1554 | +acpi_status acpi_release_memory(acpi_handle handle, struct resource *res, | |
| 1555 | + u32 level) | |
| 1556 | +{ | |
| 1557 | + if (!(res->flags & IORESOURCE_MEM)) | |
| 1558 | + return AE_TYPE; | |
| 1559 | + | |
| 1560 | + return acpi_walk_namespace(ACPI_TYPE_REGION, handle, level, | |
| 1561 | + acpi_deactivate_mem_region, NULL, res, NULL); | |
| 1562 | +} | |
| 1563 | +EXPORT_SYMBOL_GPL(acpi_release_memory); | |
| 1564 | + | |
| 1493 | 1565 | /* |
| 1494 | 1566 | * Let drivers know whether the resource checks are effective |
| 1495 | 1567 | */ |
| @@ -8,10 +8,7 @@ obj-y := component.o core.o bus.o dd.o syscore.o \ · 7 unmodified lines | ||
| 8 | 8 | topology.o container.o property.o cacheinfo.o \ |
| 9 | 9 | devcon.o |
| 10 | 10 | obj-$(CONFIG_DEVTMPFS) += devtmpfs.o |
| 11 | −obj-$(CONFIG_DMA_CMA) += dma-contiguous.o | |
| 12 | 11 | obj-y += power/ |
| 13 | −obj-$(CONFIG_HAS_DMA) += dma-mapping.o | |
| 14 | −obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o | |
| 15 | 12 | obj-$(CONFIG_ISA_BUS_API) += isa.o |
| 16 | 13 | obj-y += firmware_loader/ |
| 17 | 14 | obj-$(CONFIG_NUMA) += node.o |
| @@ -236,6 +236,13 @@ struct device_link *device_link_add(struct device *consumer, · 235 unmodified lines | ||
| 236 | 236 | link->rpm_active = true; |
| 237 | 237 | } |
| 238 | 238 | pm_runtime_new_link(consumer); |
| 239 | + /* | |
| 240 | + * If the link is being added by the consumer driver at probe | |
| 241 | + * time, balance the decrementation of the supplier's runtime PM | |
| 242 | + * usage counter after consumer probe in driver_probe_device(). | |
| 243 | + */ | |
| 244 | + if (consumer->links.status == DL_DEV_PROBING) | |
| 245 | + pm_runtime_get_noresume(supplier); | |
| 239 | 246 | } |
| 240 | 247 | get_device(supplier); |
| 241 | 248 | link->supplier = supplier; |
| @@ -255,12 +262,12 @@ struct device_link *device_link_add(struct device *consumer, · 13 unmodified lines | ||
| 255 | 262 | switch (consumer->links.status) { |
| 256 | 263 | case DL_DEV_PROBING: |
| 257 | 264 | /* |
| 258 | − * Balance the decrementation of the supplier's | |
| 259 | − * runtime PM usage counter after consumer probe | |
| 260 | − * in driver_probe_device(). | |
| 265 | + * Some callers expect the link creation during | |
| 266 | + * consumer driver probe to resume the supplier | |
| 267 | + * even without DL_FLAG_RPM_ACTIVE. | |
| 261 | 268 | */ |
| 262 | 269 | if (flags & DL_FLAG_PM_RUNTIME) |
| 263 | − pm_runtime_get_sync(supplier); | |
| 270 | + pm_runtime_resume(supplier); | |
| 264 | 271 | |
| 265 | 272 | link->status = DL_STATE_CONSUMER_PROBE; |
| 266 | 273 | break; |
| @@ -2487,10 +2487,9 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); · 2486 unmodified lines | ||
| 2487 | 2487 | * power domain corresponding to a DT node's "required-opps" property. |
| 2488 | 2488 | * |
| 2489 | 2489 | * @dev: Device for which the performance-state needs to be found. |
| 2490 | − * @opp_node: DT node where the "required-opps" property is present. This can be | |
| 2490 | + * @np: DT node where the "required-opps" property is present. This can be | |
| 2491 | 2491 | * the device node itself (if it doesn't have an OPP table) or a node |
| 2492 | 2492 | * within the OPP table of a device (if device has an OPP table). |
| 2493 | − * @state: Pointer to return performance state. | |
| 2494 | 2493 | * |
| 2495 | 2494 | * Returns performance state corresponding to the "required-opps" property of |
| 2496 | 2495 | * a DT node. This calls platform specific genpd->opp_to_performance_state() |
| @@ -2499,7 +2498,7 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); · 2 unmodified lines | ||
| 2499 | 2498 | * Returns performance state on success and 0 on failure. |
| 2500 | 2499 | */ |
| 2501 | 2500 | unsigned int of_genpd_opp_to_performance_state(struct device *dev, |
| 2502 | − struct device_node *opp_node) | |
| 2501 | + struct device_node *np) | |
| 2503 | 2502 | { |
| 2504 | 2503 | struct generic_pm_domain *genpd; |
| 2505 | 2504 | struct dev_pm_opp *opp; |
| @@ -2514,7 +2513,7 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev, · 8 unmodified lines | ||
| 2514 | 2513 | |
| 2515 | 2514 | genpd_lock(genpd); |
| 2516 | 2515 | |
| 2517 | − opp = of_dev_pm_opp_find_required_opp(&genpd->dev, opp_node); | |
| 2516 | + opp = of_dev_pm_opp_find_required_opp(&genpd->dev, np); | |
| 2518 | 2517 | if (IS_ERR(opp)) { |
| 2519 | 2518 | dev_err(dev, "Failed to find required OPP: %ld\n", |
| 2520 | 2519 | PTR_ERR(opp)); |
| @@ -1244,8 +1244,8 @@ drbd_request_prepare(struct drbd_device *device, struct bio *bio, unsigned long · 1243 unmodified lines | ||
| 1244 | 1244 | _drbd_start_io_acct(device, req); |
| 1245 | 1245 | |
| 1246 | 1246 | /* process discards always from our submitter thread */ |
| 1247 | − if ((bio_op(bio) & REQ_OP_WRITE_ZEROES) || | |
| 1248 | − (bio_op(bio) & REQ_OP_DISCARD)) | |
| 1247 | + if (bio_op(bio) == REQ_OP_WRITE_ZEROES || | |
| 1248 | + bio_op(bio) == REQ_OP_DISCARD) | |
| 1249 | 1249 | goto queue_for_submitter_thread; |
| 1250 | 1250 | |
| 1251 | 1251 | if (rw == WRITE && req->private_bio && req->i.size |
| @@ -76,6 +76,7 @@ struct link_dead_args { · 75 unmodified lines | ||
| 76 | 76 | #define NBD_HAS_CONFIG_REF 4 |
| 77 | 77 | #define NBD_BOUND 5 |
| 78 | 78 | #define NBD_DESTROY_ON_DISCONNECT 6 |
| 79 | +#define NBD_DISCONNECT_ON_CLOSE 7 | |
| 79 | 80 | |
| 80 | 81 | struct nbd_config { |
| 81 | 82 | u32 flags; |
| @@ -138,6 +139,7 @@ static void nbd_config_put(struct nbd_device *nbd); · 56 unmodified lines | ||
| 138 | 139 | static void nbd_connect_reply(struct genl_info *info, int index); |
| 139 | 140 | static int nbd_genl_status(struct sk_buff *skb, struct genl_info *info); |
| 140 | 141 | static void nbd_dead_link_work(struct work_struct *work); |
| 142 | +static void nbd_disconnect_and_put(struct nbd_device *nbd); | |
| 141 | 143 | |
| 142 | 144 | static inline struct device *nbd_to_dev(struct nbd_device *nbd) |
| 143 | 145 | { |
| @@ -1305,6 +1307,12 @@ out: · 1161 unmodified lines | ||
| 1305 | 1307 | static void nbd_release(struct gendisk *disk, fmode_t mode) |
| 1306 | 1308 | { |
| 1307 | 1309 | struct nbd_device *nbd = disk->private_data; |
| 1310 | + struct block_device *bdev = bdget_disk(disk, 0); | |
| 1311 | + | |
| 1312 | + if (test_bit(NBD_DISCONNECT_ON_CLOSE, &nbd->config->runtime_flags) && | |
| 1313 | + bdev->bd_openers == 0) | |
| 1314 | + nbd_disconnect_and_put(nbd); | |
| 1315 | + | |
| 1308 | 1316 | nbd_config_put(nbd); |
| 1309 | 1317 | nbd_put(nbd); |
| 1310 | 1318 | } |
| @@ -1705,6 +1713,10 @@ again: · 394 unmodified lines | ||
| 1705 | 1713 | &config->runtime_flags); |
| 1706 | 1714 | put_dev = true; |
| 1707 | 1715 | } |
| 1716 | + if (flags & NBD_CFLAG_DISCONNECT_ON_CLOSE) { | |
| 1717 | + set_bit(NBD_DISCONNECT_ON_CLOSE, | |
| 1718 | + &config->runtime_flags); | |
| 1719 | + } | |
| 1708 | 1720 | } |
| 1709 | 1721 | |
| 1710 | 1722 | if (info->attrs[NBD_ATTR_SOCKETS]) { |
| @@ -1749,6 +1761,17 @@ out: · 38 unmodified lines | ||
| 1749 | 1761 | return ret; |
| 1750 | 1762 | } |
| 1751 | 1763 | |
| 1764 | +static void nbd_disconnect_and_put(struct nbd_device *nbd) | |
| 1765 | +{ | |
| 1766 | + mutex_lock(&nbd->config_lock); | |
| 1767 | + nbd_disconnect(nbd); | |
| 1768 | + nbd_clear_sock(nbd); | |
| 1769 | + mutex_unlock(&nbd->config_lock); | |
| 1770 | + if (test_and_clear_bit(NBD_HAS_CONFIG_REF, | |
| 1771 | + &nbd->config->runtime_flags)) | |
| 1772 | + nbd_config_put(nbd); | |
| 1773 | +} | |
| 1774 | + | |
| 1752 | 1775 | static int nbd_genl_disconnect(struct sk_buff *skb, struct genl_info *info) |
| 1753 | 1776 | { |
| 1754 | 1777 | struct nbd_device *nbd; |
| @@ -1781,13 +1804,7 @@ static int nbd_genl_disconnect(struct sk_buff *skb, struct genl_info *info) · 26 unmodified lines | ||
| 1781 | 1804 | nbd_put(nbd); |
| 1782 | 1805 | return 0; |
| 1783 | 1806 | } |
| 1784 | − mutex_lock(&nbd->config_lock); | |
| 1785 | − nbd_disconnect(nbd); | |
| 1786 | − nbd_clear_sock(nbd); | |
| 1787 | − mutex_unlock(&nbd->config_lock); | |
| 1788 | − if (test_and_clear_bit(NBD_HAS_CONFIG_REF, | |
| 1789 | − &nbd->config->runtime_flags)) | |
| 1790 | − nbd_config_put(nbd); | |
| 1807 | + nbd_disconnect_and_put(nbd); | |
| 1791 | 1808 | nbd_config_put(nbd); |
| 1792 | 1809 | nbd_put(nbd); |
| 1793 | 1810 | return 0; |
| @@ -1798,7 +1815,7 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info) · 4 unmodified lines | ||
| 1798 | 1815 | struct nbd_device *nbd = NULL; |
| 1799 | 1816 | struct nbd_config *config; |
| 1800 | 1817 | int index; |
| 1801 | − int ret = -EINVAL; | |
| 1818 | + int ret = 0; | |
| 1802 | 1819 | bool put_dev = false; |
| 1803 | 1820 | |
| 1804 | 1821 | if (!netlink_capable(skb, CAP_SYS_ADMIN)) |
| @@ -1838,6 +1855,7 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info) · 33 unmodified lines | ||
| 1838 | 1855 | !nbd->task_recv) { |
| 1839 | 1856 | dev_err(nbd_to_dev(nbd), |
| 1840 | 1857 | "not configured, cannot reconfigure\n"); |
| 1858 | + ret = -EINVAL; | |
| 1841 | 1859 | goto out; |
| 1842 | 1860 | } |
| 1843 | 1861 | |
| @@ -1862,6 +1880,14 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info) · 18 unmodified lines | ||
| 1862 | 1880 | &config->runtime_flags)) |
| 1863 | 1881 | refcount_inc(&nbd->refs); |
| 1864 | 1882 | } |
| 1883 | + | |
| 1884 | + if (flags & NBD_CFLAG_DISCONNECT_ON_CLOSE) { | |
| 1885 | + set_bit(NBD_DISCONNECT_ON_CLOSE, | |
| 1886 | + &config->runtime_flags); | |
| 1887 | + } else { | |
| 1888 | + clear_bit(NBD_DISCONNECT_ON_CLOSE, | |
| 1889 | + &config->runtime_flags); | |
| 1890 | + } | |
| 1865 | 1891 | } |
| 1866 | 1892 | |
| 1867 | 1893 | if (info->attrs[NBD_ATTR_SOCKETS]) { |
| @@ -1365,7 +1365,7 @@ static blk_qc_t null_queue_bio(struct request_queue *q, struct bio *bio) · 1364 unmodified lines | ||
| 1365 | 1365 | static enum blk_eh_timer_return null_rq_timed_out_fn(struct request *rq) |
| 1366 | 1366 | { |
| 1367 | 1367 | pr_info("null: rq %p timed out\n", rq); |
| 1368 | − blk_mq_complete_request(rq); | |
| 1368 | + __blk_complete_request(rq); | |
| 1369 | 1369 | return BLK_EH_DONE; |
| 1370 | 1370 | } |
| 1371 | 1371 | |
| @@ -29,7 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | #include <linux/slab.h> |
| 30 | 30 | #include <linux/string.h> |
| 31 | 31 | #include <linux/types.h> |
| 32 | −#include <linux/unaligned/le_struct.h> | |
| 32 | +#include <asm/unaligned.h> | |
| 33 | 33 | #include <net/bluetooth/bluetooth.h> |
| 34 | 34 | #include <net/bluetooth/hci_core.h> |
| 35 | 35 | |
| @@ -516,11 +516,18 @@ EXPORT_SYMBOL_GPL(hwrng_register); · 515 unmodified lines | ||
| 516 | 516 | |
| 517 | 517 | void hwrng_unregister(struct hwrng *rng) |
| 518 | 518 | { |
| 519 | + int err; | |
| 520 | + | |
| 519 | 521 | mutex_lock(&rng_mutex); |
| 520 | 522 | |
| 521 | 523 | list_del(&rng->list); |
| 522 | − if (current_rng == rng) | |
| 523 | − enable_best_rng(); | |
| 524 | + if (current_rng == rng) { | |
| 525 | + err = enable_best_rng(); | |
| 526 | + if (err) { | |
| 527 | + drop_current_rng(); | |
| 528 | + cur_rng_set_by_user = 0; | |
| 529 | + } | |
| 530 | + } | |
| 524 | 531 | |
| 525 | 532 | if (list_empty(&rng_list)) { |
| 526 | 533 | mutex_unlock(&rng_mutex); |
| @@ -402,7 +402,8 @@ static struct poolinfo { · 401 unmodified lines | ||
| 402 | 402 | /* |
| 403 | 403 | * Static global variables |
| 404 | 404 | */ |
| 405 | −static DECLARE_WAIT_QUEUE_HEAD(random_wait); | |
| 405 | +static DECLARE_WAIT_QUEUE_HEAD(random_read_wait); | |
| 406 | +static DECLARE_WAIT_QUEUE_HEAD(random_write_wait); | |
| 406 | 407 | static struct fasync_struct *fasync; |
| 407 | 408 | |
| 408 | 409 | static DEFINE_SPINLOCK(random_ready_list_lock); |
| @@ -721,8 +722,8 @@ retry: · 312 unmodified lines | ||
| 721 | 722 | |
| 722 | 723 | /* should we wake readers? */ |
| 723 | 724 | if (entropy_bits >= random_read_wakeup_bits && |
| 724 | − wq_has_sleeper(&random_wait)) { | |
| 725 | − wake_up_interruptible_poll(&random_wait, POLLIN); | |
| 725 | + wq_has_sleeper(&random_read_wait)) { | |
| 726 | + wake_up_interruptible(&random_read_wait); | |
| 726 | 727 | kill_fasync(&fasync, SIGIO, POLL_IN); |
| 727 | 728 | } |
| 728 | 729 | /* If the input pool is getting full, send some |
| @@ -1396,7 +1397,7 @@ retry: · 667 unmodified lines | ||
| 1396 | 1397 | trace_debit_entropy(r->name, 8 * ibytes); |
| 1397 | 1398 | if (ibytes && |
| 1398 | 1399 | (r->entropy_count >> ENTROPY_SHIFT) < random_write_wakeup_bits) { |
| 1399 | − wake_up_interruptible_poll(&random_wait, POLLOUT); | |
| 1400 | + wake_up_interruptible(&random_write_wait); | |
| 1400 | 1401 | kill_fasync(&fasync, SIGIO, POLL_OUT); |
| 1401 | 1402 | } |
| 1402 | 1403 | |
| @@ -1838,7 +1839,7 @@ _random_read(int nonblock, char __user *buf, size_t nbytes) · 435 unmodified lines | ||
| 1838 | 1839 | if (nonblock) |
| 1839 | 1840 | return -EAGAIN; |
| 1840 | 1841 | |
| 1841 | − wait_event_interruptible(random_wait, | |
| 1842 | + wait_event_interruptible(random_read_wait, | |
| 1842 | 1843 | ENTROPY_BITS(&input_pool) >= |
| 1843 | 1844 | random_read_wakeup_bits); |
| 1844 | 1845 | if (signal_pending(current)) |
| @@ -1875,17 +1876,14 @@ urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) · 30 unmodified lines | ||
| 1875 | 1876 | return ret; |
| 1876 | 1877 | } |
| 1877 | 1878 | |
| 1878 | −static struct wait_queue_head * | |
| 1879 | −random_get_poll_head(struct file *file, __poll_t events) | |
| 1880 | −{ | |
| 1881 | − return &random_wait; | |
| 1882 | −} | |
| 1883 | − | |
| 1884 | 1879 | static __poll_t |
| 1885 | −random_poll_mask(struct file *file, __poll_t events) | |
| 1880 | +random_poll(struct file *file, poll_table * wait) | |
| 1886 | 1881 | { |
| 1887 | − __poll_t mask = 0; | |
| 1882 | + __poll_t mask; | |
| 1888 | 1883 | |
| 1884 | + poll_wait(file, &random_read_wait, wait); | |
| 1885 | + poll_wait(file, &random_write_wait, wait); | |
| 1886 | + mask = 0; | |
| 1889 | 1887 | if (ENTROPY_BITS(&input_pool) >= random_read_wakeup_bits) |
| 1890 | 1888 | mask |= EPOLLIN | EPOLLRDNORM; |
| 1891 | 1889 | if (ENTROPY_BITS(&input_pool) < random_write_wakeup_bits) |
| @@ -1992,8 +1990,7 @@ static int random_fasync(int fd, struct file *filp, int on) · 100 unmodified lines | ||
| 1992 | 1990 | const struct file_operations random_fops = { |
| 1993 | 1991 | .read = random_read, |
| 1994 | 1992 | .write = random_write, |
| 1995 | − .get_poll_head = random_get_poll_head, | |
| 1996 | − .poll_mask = random_poll_mask, | |
| 1993 | + .poll = random_poll, | |
| 1997 | 1994 | .unlocked_ioctl = random_ioctl, |
| 1998 | 1995 | .fasync = random_fasync, |
| 1999 | 1996 | .llseek = noop_llseek, |
| @@ -2326,7 +2323,7 @@ void add_hwgenerator_randomness(const char *buffer, size_t count, · 326 unmodified lines | ||
| 2326 | 2323 | * We'll be woken up again once below random_write_wakeup_thresh, |
| 2327 | 2324 | * or when the calling thread is about to terminate. |
| 2328 | 2325 | */ |
| 2329 | − wait_event_interruptible(random_wait, kthread_should_stop() || | |
| 2326 | + wait_event_interruptible(random_write_wait, kthread_should_stop() || | |
| 2330 | 2327 | ENTROPY_BITS(&input_pool) <= random_write_wakeup_bits); |
| 2331 | 2328 | mix_pool_bytes(poolp, buffer, count); |
| 2332 | 2329 | credit_entropy_bits(poolp, entropy); |
| @@ -304,8 +304,10 @@ static int __init stm32_timer_init(struct device_node *node) · 303 unmodified lines | ||
| 304 | 304 | |
| 305 | 305 | to->private_data = kzalloc(sizeof(struct stm32_timer_private), |
| 306 | 306 | GFP_KERNEL); |
| 307 | − if (!to->private_data) | |
| 307 | + if (!to->private_data) { | |
| 308 | + ret = -ENOMEM; | |
| 308 | 309 | goto deinit; |
| 310 | + } | |
| 309 | 311 | |
| 310 | 312 | rstc = of_reset_control_get(node, NULL); |
| 311 | 313 | if (!IS_ERR(rstc)) { |
| @@ -294,6 +294,7 @@ struct pstate_funcs { · 293 unmodified lines | ||
| 294 | 294 | static struct pstate_funcs pstate_funcs __read_mostly; |
| 295 | 295 | |
| 296 | 296 | static int hwp_active __read_mostly; |
| 297 | +static int hwp_mode_bdw __read_mostly; | |
| 297 | 298 | static bool per_cpu_limits __read_mostly; |
| 298 | 299 | static bool hwp_boost __read_mostly; |
| 299 | 300 | |
| @@ -1413,7 +1414,15 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) · 1113 unmodified lines | ||
| 1413 | 1414 | cpu->pstate.turbo_pstate = pstate_funcs.get_turbo(); |
| 1414 | 1415 | cpu->pstate.scaling = pstate_funcs.get_scaling(); |
| 1415 | 1416 | cpu->pstate.max_freq = cpu->pstate.max_pstate * cpu->pstate.scaling; |
| 1416 | − cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * cpu->pstate.scaling; | |
| 1417 | + | |
| 1418 | + if (hwp_active && !hwp_mode_bdw) { | |
| 1419 | + unsigned int phy_max, current_max; | |
| 1420 | + | |
| 1421 | + intel_pstate_get_hwp_max(cpu->cpu, &phy_max, ¤t_max); | |
| 1422 | + cpu->pstate.turbo_freq = phy_max * cpu->pstate.scaling; | |
| 1423 | + } else { | |
| 1424 | + cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * cpu->pstate.scaling; | |
| 1425 | + } | |
| 1417 | 1426 | |
| 1418 | 1427 | if (pstate_funcs.get_aperf_mperf_shift) |
| 1419 | 1428 | cpu->aperf_mperf_shift = pstate_funcs.get_aperf_mperf_shift(); |
| @@ -2467,28 +2476,36 @@ static inline bool intel_pstate_has_acpi_ppc(void) { return false; } · 1047 unmodified lines | ||
| 2467 | 2476 | static inline void intel_pstate_request_control_from_smm(void) {} |
| 2468 | 2477 | #endif /* CONFIG_ACPI */ |
| 2469 | 2478 | |
| 2479 | +#define INTEL_PSTATE_HWP_BROADWELL 0x01 | |
| 2480 | + | |
| 2481 | +#define ICPU_HWP(model, hwp_mode) \ | |
| 2482 | + { X86_VENDOR_INTEL, 6, model, X86_FEATURE_HWP, hwp_mode } | |
| 2483 | + | |
| 2470 | 2484 | static const struct x86_cpu_id hwp_support_ids[] __initconst = { |
| 2471 | − { X86_VENDOR_INTEL, 6, X86_MODEL_ANY, X86_FEATURE_HWP }, | |
| 2485 | + ICPU_HWP(INTEL_FAM6_BROADWELL_X, INTEL_PSTATE_HWP_BROADWELL), | |
| 2486 | + ICPU_HWP(INTEL_FAM6_BROADWELL_XEON_D, INTEL_PSTATE_HWP_BROADWELL), | |
| 2487 | + ICPU_HWP(X86_MODEL_ANY, 0), | |
| 2472 | 2488 | {} |
| 2473 | 2489 | }; |
| 2474 | 2490 | |
| 2475 | 2491 | static int __init intel_pstate_init(void) |
| 2476 | 2492 | { |
| 2493 | + const struct x86_cpu_id *id; | |
| 2477 | 2494 | int rc; |
| 2478 | 2495 | |
| 2479 | 2496 | if (no_load) |
| 2480 | 2497 | return -ENODEV; |
| 2481 | 2498 | |
| 2482 | − if (x86_match_cpu(hwp_support_ids)) { | |
| 2499 | + id = x86_match_cpu(hwp_support_ids); | |
| 2500 | + if (id) { | |
| 2483 | 2501 | copy_cpu_funcs(&core_funcs); |
| 2484 | 2502 | if (!no_hwp) { |
| 2485 | 2503 | hwp_active++; |
| 2504 | + hwp_mode_bdw = id->driver_data; | |
| 2486 | 2505 | intel_pstate.attr = hwp_cpufreq_attrs; |
| 2487 | 2506 | goto hwp_cpu_matched; |
| 2488 | 2507 | } |
| 2489 | 2508 | } else { |
| 2490 | − const struct x86_cpu_id *id; | |
| 2491 | − | |
| 2492 | 2509 | id = x86_match_cpu(intel_pstate_cpu_ids); |
| 2493 | 2510 | if (!id) |
| 2494 | 2511 | return -ENODEV; |
| @@ -42,6 +42,8 @@ enum _msm8996_version { · 41 unmodified lines | ||
| 42 | 42 | NUM_OF_MSM8996_VERSIONS, |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | +struct platform_device *cpufreq_dt_pdev, *kryo_cpufreq_pdev; | |
| 46 | + | |
| 45 | 47 | static enum _msm8996_version __init qcom_cpufreq_kryo_get_msm_id(void) |
| 46 | 48 | { |
| 47 | 49 | size_t len; |
| @@ -74,7 +76,6 @@ static enum _msm8996_version __init qcom_cpufreq_kryo_get_msm_id(void) · 26 unmodified lines | ||
| 74 | 76 | static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) |
| 75 | 77 | { |
| 76 | 78 | struct opp_table *opp_tables[NR_CPUS] = {0}; |
| 77 | − struct platform_device *cpufreq_dt_pdev; | |
| 78 | 79 | enum _msm8996_version msm8996_version; |
| 79 | 80 | struct nvmem_cell *speedbin_nvmem; |
| 80 | 81 | struct device_node *np; |
| @@ -86,8 +87,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 5 unmodified lines | ||
| 86 | 87 | int ret; |
| 87 | 88 | |
| 88 | 89 | cpu_dev = get_cpu_device(0); |
| 89 | − if (NULL == cpu_dev) | |
| 90 | − ret = -ENODEV; | |
| 90 | + if (!cpu_dev) | |
| 91 | + return -ENODEV; | |
| 91 | 92 | |
| 92 | 93 | msm8996_version = qcom_cpufreq_kryo_get_msm_id(); |
| 93 | 94 | if (NUM_OF_MSM8996_VERSIONS == msm8996_version) { |
| @@ -96,8 +97,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 2 unmodified lines | ||
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | np = dev_pm_opp_of_get_opp_desc_node(cpu_dev); |
| 99 | − if (IS_ERR(np)) | |
| 100 | − return PTR_ERR(np); | |
| 100 | + if (!np) | |
| 101 | + return -ENOENT; | |
| 101 | 102 | |
| 102 | 103 | ret = of_device_is_compatible(np, "operating-points-v2-kryo-cpu"); |
| 103 | 104 | if (!ret) { |
| @@ -115,6 +116,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 11 unmodified lines | ||
| 115 | 116 | |
| 116 | 117 | speedbin = nvmem_cell_read(speedbin_nvmem, &len); |
| 117 | 118 | nvmem_cell_put(speedbin_nvmem); |
| 119 | + if (IS_ERR(speedbin)) | |
| 120 | + return PTR_ERR(speedbin); | |
| 118 | 121 | |
| 119 | 122 | switch (msm8996_version) { |
| 120 | 123 | case MSM8996_V3: |
| @@ -127,6 +130,7 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 6 unmodified lines | ||
| 127 | 130 | BUG(); |
| 128 | 131 | break; |
| 129 | 132 | } |
| 133 | + kfree(speedbin); | |
| 130 | 134 | |
| 131 | 135 | for_each_possible_cpu(cpu) { |
| 132 | 136 | cpu_dev = get_cpu_device(cpu); |
| @@ -162,8 +166,15 @@ free_opp: · 29 unmodified lines | ||
| 162 | 166 | return ret; |
| 163 | 167 | } |
| 164 | 168 | |
| 169 | +static int qcom_cpufreq_kryo_remove(struct platform_device *pdev) | |
| 170 | +{ | |
| 171 | + platform_device_unregister(cpufreq_dt_pdev); | |
| 172 | + return 0; | |
| 173 | +} | |
| 174 | + | |
| 165 | 175 | static struct platform_driver qcom_cpufreq_kryo_driver = { |
| 166 | 176 | .probe = qcom_cpufreq_kryo_probe, |
| 177 | + .remove = qcom_cpufreq_kryo_remove, | |
| 167 | 178 | .driver = { |
| 168 | 179 | .name = "qcom-cpufreq-kryo", |
| 169 | 180 | }, |
| @@ -198,8 +209,9 @@ static int __init qcom_cpufreq_kryo_init(void) · 28 unmodified lines | ||
| 198 | 209 | if (unlikely(ret < 0)) |
| 199 | 210 | return ret; |
| 200 | 211 | |
| 201 | − ret = PTR_ERR_OR_ZERO(platform_device_register_simple( | |
| 202 | − "qcom-cpufreq-kryo", -1, NULL, 0)); | |
| 212 | + kryo_cpufreq_pdev = platform_device_register_simple( | |
| 213 | + "qcom-cpufreq-kryo", -1, NULL, 0); | |
| 214 | + ret = PTR_ERR_OR_ZERO(kryo_cpufreq_pdev); | |
| 203 | 215 | if (0 == ret) |
| 204 | 216 | return 0; |
| 205 | 217 | |
| @@ -208,5 +220,12 @@ static int __init qcom_cpufreq_kryo_init(void) · 2 unmodified lines | ||
| 208 | 220 | } |
| 209 | 221 | module_init(qcom_cpufreq_kryo_init); |
| 210 | 222 | |
| 223 | +static void __init qcom_cpufreq_kryo_exit(void) | |
| 224 | +{ | |
| 225 | + platform_device_unregister(kryo_cpufreq_pdev); | |
| 226 | + platform_driver_unregister(&qcom_cpufreq_kryo_driver); | |
| 227 | +} | |
| 228 | +module_exit(qcom_cpufreq_kryo_exit); | |
| 229 | + | |
| 211 | 230 | MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Kryo CPUfreq driver"); |
| 212 | 231 | MODULE_LICENSE("GPL v2"); |
| @@ -1548,15 +1548,14 @@ skip_copy: · 1547 unmodified lines | ||
| 1548 | 1548 | tp->urg_data = 0; |
| 1549 | 1549 | |
| 1550 | 1550 | if ((avail + offset) >= skb->len) { |
| 1551 | − if (likely(skb)) | |
| 1552 | − chtls_free_skb(sk, skb); | |
| 1553 | − buffers_freed++; | |
| 1554 | 1551 | if (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_TLS_HDR) { |
| 1555 | 1552 | tp->copied_seq += skb->len; |
| 1556 | 1553 | hws->rcvpld = skb->hdr_len; |
| 1557 | 1554 | } else { |
| 1558 | 1555 | tp->copied_seq += hws->rcvpld; |
| 1559 | 1556 | } |
| 1557 | + chtls_free_skb(sk, skb); | |
| 1558 | + buffers_freed++; | |
| 1560 | 1559 | hws->copied_seq = 0; |
| 1561 | 1560 | if (copied >= target && |
| 1562 | 1561 | !skb_peek(&sk->sk_receive_queue)) |
| @@ -86,6 +86,7 @@ bool __bdev_dax_supported(struct block_device *bdev, int blocksize) · 85 unmodified lines | ||
| 86 | 86 | { |
| 87 | 87 | struct dax_device *dax_dev; |
| 88 | 88 | bool dax_enabled = false; |
| 89 | + struct request_queue *q; | |
| 89 | 90 | pgoff_t pgoff; |
| 90 | 91 | int err, id; |
| 91 | 92 | void *kaddr; |
| @@ -99,6 +100,13 @@ bool __bdev_dax_supported(struct block_device *bdev, int blocksize) · 7 unmodified lines | ||
| 99 | 100 | return false; |
| 100 | 101 | } |
| 101 | 102 | |
| 103 | + q = bdev_get_queue(bdev); | |
| 104 | + if (!q || !blk_queue_dax(q)) { | |
| 105 | + pr_debug("%s: error: request queue doesn't support dax\n", | |
| 106 | + bdevname(bdev, buf)); | |
| 107 | + return false; | |
| 108 | + } | |
| 109 | + | |
| 102 | 110 | err = bdev_dax_pgoff(bdev, 0, PAGE_SIZE, &pgoff); |
| 103 | 111 | if (err) { |
| 104 | 112 | pr_debug("%s: error: unaligned partition for dax\n", |
| @@ -47,6 +47,7 @@ DEFINE_DMI_ATTR_WITH_SHOW(product_name, 0444, DMI_PRODUCT_NAME); · 46 unmodified lines | ||
| 47 | 47 | DEFINE_DMI_ATTR_WITH_SHOW(product_version, 0444, DMI_PRODUCT_VERSION); |
| 48 | 48 | DEFINE_DMI_ATTR_WITH_SHOW(product_serial, 0400, DMI_PRODUCT_SERIAL); |
| 49 | 49 | DEFINE_DMI_ATTR_WITH_SHOW(product_uuid, 0400, DMI_PRODUCT_UUID); |
| 50 | +DEFINE_DMI_ATTR_WITH_SHOW(product_sku, 0444, DMI_PRODUCT_SKU); | |
| 50 | 51 | DEFINE_DMI_ATTR_WITH_SHOW(product_family, 0444, DMI_PRODUCT_FAMILY); |
| 51 | 52 | DEFINE_DMI_ATTR_WITH_SHOW(board_vendor, 0444, DMI_BOARD_VENDOR); |
| 52 | 53 | DEFINE_DMI_ATTR_WITH_SHOW(board_name, 0444, DMI_BOARD_NAME); |
| @@ -193,6 +194,7 @@ static void __init dmi_id_init_attr_table(void) · 140 unmodified lines | ||
| 193 | 194 | ADD_DMI_ATTR(product_serial, DMI_PRODUCT_SERIAL); |
| 194 | 195 | ADD_DMI_ATTR(product_uuid, DMI_PRODUCT_UUID); |
| 195 | 196 | ADD_DMI_ATTR(product_family, DMI_PRODUCT_FAMILY); |
| 197 | + ADD_DMI_ATTR(product_sku, DMI_PRODUCT_SKU); | |
| 196 | 198 | ADD_DMI_ATTR(board_vendor, DMI_BOARD_VENDOR); |
| 197 | 199 | ADD_DMI_ATTR(board_name, DMI_BOARD_NAME); |
| 198 | 200 | ADD_DMI_ATTR(board_version, DMI_BOARD_VERSION); |
| @@ -447,6 +447,7 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy) · 446 unmodified lines | ||
| 447 | 447 | dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6); |
| 448 | 448 | dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7); |
| 449 | 449 | dmi_save_uuid(dm, DMI_PRODUCT_UUID, 8); |
| 450 | + dmi_save_ident(dm, DMI_PRODUCT_SKU, 25); | |
| 450 | 451 | dmi_save_ident(dm, DMI_PRODUCT_FAMILY, 26); |
| 451 | 452 | break; |
| 452 | 453 | case 2: /* Base Board Information */ |
| @@ -64,7 +64,7 @@ static void efi_retrieve_tpm2_eventlog_1_2(efi_system_table_t *sys_table_arg) · 63 unmodified lines | ||
| 64 | 64 | efi_guid_t tcg2_guid = EFI_TCG2_PROTOCOL_GUID; |
| 65 | 65 | efi_guid_t linux_eventlog_guid = LINUX_EFI_TPM_EVENT_LOG_GUID; |
| 66 | 66 | efi_status_t status; |
| 67 | − efi_physical_addr_t log_location, log_last_entry; | |
| 67 | + efi_physical_addr_t log_location = 0, log_last_entry = 0; | |
| 68 | 68 | struct linux_efi_tpm_eventlog *log_tbl = NULL; |
| 69 | 69 | unsigned long first_entry_addr, last_entry_addr; |
| 70 | 70 | size_t log_size, last_entry_size; |
| @@ -2157,10 +2157,18 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) · 2156 unmodified lines | ||
| 2157 | 2157 | switch (asic_type) { |
| 2158 | 2158 | #if defined(CONFIG_DRM_AMD_DC) |
| 2159 | 2159 | case CHIP_BONAIRE: |
| 2160 | − case CHIP_HAWAII: | |
| 2161 | 2160 | case CHIP_KAVERI: |
| 2162 | 2161 | case CHIP_KABINI: |
| 2163 | 2162 | case CHIP_MULLINS: |
| 2163 | + /* | |
| 2164 | + * We have systems in the wild with these ASICs that require | |
| 2165 | + * LVDS and VGA support which is not supported with DC. | |
| 2166 | + * | |
| 2167 | + * Fallback to the non-DC driver here by default so as not to | |
| 2168 | + * cause regressions. | |
| 2169 | + */ | |
| 2170 | + return amdgpu_dc > 0; | |
| 2171 | + case CHIP_HAWAII: | |
| 2164 | 2172 | case CHIP_CARRIZO: |
| 2165 | 2173 | case CHIP_STONEY: |
| 2166 | 2174 | case CHIP_POLARIS10: |
| @@ -376,7 +376,7 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring, · 375 unmodified lines | ||
| 376 | 376 | struct amdgpu_device *adev = ring->adev; |
| 377 | 377 | uint64_t index; |
| 378 | 378 | |
| 379 | − if (ring != &adev->uvd.inst[ring->me].ring) { | |
| 379 | + if (ring->funcs->type != AMDGPU_RING_TYPE_UVD) { | |
| 380 | 380 | ring->fence_drv.cpu_addr = &adev->wb.wb[ring->fence_offs]; |
| 381 | 381 | ring->fence_drv.gpu_addr = adev->wb.gpu_addr + (ring->fence_offs * 4); |
| 382 | 382 | } else { |
| @@ -918,8 +918,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, · 917 unmodified lines | ||
| 918 | 918 | domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type); |
| 919 | 919 | if (domain == AMDGPU_GEM_DOMAIN_VRAM) { |
| 920 | 920 | adev->vram_pin_size += amdgpu_bo_size(bo); |
| 921 | − if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) | |
| 922 | − adev->invisible_pin_size += amdgpu_bo_size(bo); | |
| 921 | + adev->invisible_pin_size += amdgpu_vram_mgr_bo_invisible_size(bo); | |
| 923 | 922 | } else if (domain == AMDGPU_GEM_DOMAIN_GTT) { |
| 924 | 923 | adev->gart_pin_size += amdgpu_bo_size(bo); |
| 925 | 924 | } |
| @@ -969,25 +968,22 @@ int amdgpu_bo_unpin(struct amdgpu_bo *bo) · 43 unmodified lines | ||
| 969 | 968 | bo->pin_count--; |
| 970 | 969 | if (bo->pin_count) |
| 971 | 970 | return 0; |
| 972 | − for (i = 0; i < bo->placement.num_placement; i++) { | |
| 973 | − bo->placements[i].lpfn = 0; | |
| 974 | − bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT; | |
| 975 | − } | |
| 976 | − r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); | |
| 977 | − if (unlikely(r)) { | |
| 978 | − dev_err(adev->dev, "%p validate failed for unpin\n", bo); | |
| 979 | − goto error; | |
| 980 | − } | |
| 981 | 971 | |
| 982 | 972 | if (bo->tbo.mem.mem_type == TTM_PL_VRAM) { |
| 983 | 973 | adev->vram_pin_size -= amdgpu_bo_size(bo); |
| 984 | − if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) | |
| 985 | − adev->invisible_pin_size -= amdgpu_bo_size(bo); | |
| 974 | + adev->invisible_pin_size -= amdgpu_vram_mgr_bo_invisible_size(bo); | |
| 986 | 975 | } else if (bo->tbo.mem.mem_type == TTM_PL_TT) { |
| 987 | 976 | adev->gart_pin_size -= amdgpu_bo_size(bo); |
| 988 | 977 | } |
| 989 | 978 | |
| 990 | −error: | |
| 979 | + for (i = 0; i < bo->placement.num_placement; i++) { | |
| 980 | + bo->placements[i].lpfn = 0; | |
| 981 | + bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT; | |
| 982 | + } | |
| 983 | + r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); | |
| 984 | + if (unlikely(r)) | |
| 985 | + dev_err(adev->dev, "%p validate failed for unpin\n", bo); | |
| 986 | + | |
| 991 | 987 | return r; |
| 992 | 988 | } |
| 993 | 989 | |
| @@ -73,6 +73,7 @@ bool amdgpu_gtt_mgr_has_gart_addr(struct ttm_mem_reg *mem); · 72 unmodified lines | ||
| 73 | 73 | uint64_t amdgpu_gtt_mgr_usage(struct ttm_mem_type_manager *man); |
| 74 | 74 | int amdgpu_gtt_mgr_recover(struct ttm_mem_type_manager *man); |
| 75 | 75 | |
| 76 | +u64 amdgpu_vram_mgr_bo_invisible_size(struct amdgpu_bo *bo); | |
| 76 | 77 | uint64_t amdgpu_vram_mgr_usage(struct ttm_mem_type_manager *man); |
| 77 | 78 | uint64_t amdgpu_vram_mgr_vis_usage(struct ttm_mem_type_manager *man); |
| 78 | 79 | |
| @@ -130,7 +130,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) · 129 unmodified lines | ||
| 130 | 130 | unsigned family_id; |
| 131 | 131 | int i, j, r; |
| 132 | 132 | |
| 133 | − INIT_DELAYED_WORK(&adev->uvd.inst->idle_work, amdgpu_uvd_idle_work_handler); | |
| 133 | + INIT_DELAYED_WORK(&adev->uvd.idle_work, amdgpu_uvd_idle_work_handler); | |
| 134 | 134 | |
| 135 | 135 | switch (adev->asic_type) { |
| 136 | 136 | #ifdef CONFIG_DRM_AMDGPU_CIK |
| @@ -331,12 +331,12 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev) · 194 unmodified lines | ||
| 331 | 331 | void *ptr; |
| 332 | 332 | int i, j; |
| 333 | 333 | |
| 334 | + cancel_delayed_work_sync(&adev->uvd.idle_work); | |
| 335 | + | |
| 334 | 336 | for (j = 0; j < adev->uvd.num_uvd_inst; ++j) { |
| 335 | 337 | if (adev->uvd.inst[j].vcpu_bo == NULL) |
| 336 | 338 | continue; |
| 337 | 339 | |
| 338 | − cancel_delayed_work_sync(&adev->uvd.inst[j].idle_work); | |
| 339 | − | |
| 340 | 340 | /* only valid for physical mode */ |
| 341 | 341 | if (adev->asic_type < CHIP_POLARIS10) { |
| 342 | 342 | for (i = 0; i < adev->uvd.max_handles; ++i) |
| @@ -1162,7 +1162,7 @@ int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, · 819 unmodified lines | ||
| 1162 | 1162 | static void amdgpu_uvd_idle_work_handler(struct work_struct *work) |
| 1163 | 1163 | { |
| 1164 | 1164 | struct amdgpu_device *adev = |
| 1165 | − container_of(work, struct amdgpu_device, uvd.inst->idle_work.work); | |
| 1165 | + container_of(work, struct amdgpu_device, uvd.idle_work.work); | |
| 1166 | 1166 | unsigned fences = 0, i, j; |
| 1167 | 1167 | |
| 1168 | 1168 | for (i = 0; i < adev->uvd.num_uvd_inst; ++i) { |
| @@ -1184,7 +1184,7 @@ static void amdgpu_uvd_idle_work_handler(struct work_struct *work) · 15 unmodified lines | ||
| 1184 | 1184 | AMD_CG_STATE_GATE); |
| 1185 | 1185 | } |
| 1186 | 1186 | } else { |
| 1187 | − schedule_delayed_work(&adev->uvd.inst->idle_work, UVD_IDLE_TIMEOUT); | |
| 1187 | + schedule_delayed_work(&adev->uvd.idle_work, UVD_IDLE_TIMEOUT); | |
| 1188 | 1188 | } |
| 1189 | 1189 | } |
| 1190 | 1190 | |
| @@ -1196,7 +1196,7 @@ void amdgpu_uvd_ring_begin_use(struct amdgpu_ring *ring) · 5 unmodified lines | ||
| 1196 | 1196 | if (amdgpu_sriov_vf(adev)) |
| 1197 | 1197 | return; |
| 1198 | 1198 | |
| 1199 | − set_clocks = !cancel_delayed_work_sync(&adev->uvd.inst->idle_work); | |
| 1199 | + set_clocks = !cancel_delayed_work_sync(&adev->uvd.idle_work); | |
| 1200 | 1200 | if (set_clocks) { |
| 1201 | 1201 | if (adev->pm.dpm_enabled) { |
| 1202 | 1202 | amdgpu_dpm_enable_uvd(adev, true); |
| @@ -1213,7 +1213,7 @@ void amdgpu_uvd_ring_begin_use(struct amdgpu_ring *ring) · 10 unmodified lines | ||
| 1213 | 1213 | void amdgpu_uvd_ring_end_use(struct amdgpu_ring *ring) |
| 1214 | 1214 | { |
| 1215 | 1215 | if (!amdgpu_sriov_vf(ring->adev)) |
| 1216 | − schedule_delayed_work(&ring->adev->uvd.inst->idle_work, UVD_IDLE_TIMEOUT); | |
| 1216 | + schedule_delayed_work(&ring->adev->uvd.idle_work, UVD_IDLE_TIMEOUT); | |
| 1217 | 1217 | } |
| 1218 | 1218 | |
| 1219 | 1219 | /** |
| @@ -44,7 +44,6 @@ struct amdgpu_uvd_inst { · 43 unmodified lines | ||
| 44 | 44 | void *saved_bo; |
| 45 | 45 | atomic_t handles[AMDGPU_MAX_UVD_HANDLES]; |
| 46 | 46 | struct drm_file *filp[AMDGPU_MAX_UVD_HANDLES]; |
| 47 | − struct delayed_work idle_work; | |
| 48 | 47 | struct amdgpu_ring ring; |
| 49 | 48 | struct amdgpu_ring ring_enc[AMDGPU_MAX_UVD_ENC_RINGS]; |
| 50 | 49 | struct amdgpu_irq_src irq; |
| @@ -62,6 +61,7 @@ struct amdgpu_uvd { · 11 unmodified lines | ||
| 62 | 61 | bool address_64_bit; |
| 63 | 62 | bool use_ctx_buf; |
| 64 | 63 | struct amdgpu_uvd_inst inst[AMDGPU_MAX_UVD_INSTANCES]; |
| 64 | + struct delayed_work idle_work; | |
| 65 | 65 | }; |
| 66 | 66 | |
| 67 | 67 | int amdgpu_uvd_sw_init(struct amdgpu_device *adev); |
| @@ -52,7 +52,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · 51 unmodified lines | ||
| 52 | 52 | unsigned long bo_size; |
| 53 | 53 | const char *fw_name; |
| 54 | 54 | const struct common_firmware_header *hdr; |
| 55 | − unsigned version_major, version_minor, family_id; | |
| 55 | + unsigned char fw_check; | |
| 56 | 56 | int r; |
| 57 | 57 | |
| 58 | 58 | INIT_DELAYED_WORK(&adev->vcn.idle_work, amdgpu_vcn_idle_work_handler); |
| @@ -83,12 +83,33 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · 24 unmodified lines | ||
| 83 | 83 | |
| 84 | 84 | hdr = (const struct common_firmware_header *)adev->vcn.fw->data; |
| 85 | 85 | adev->vcn.fw_version = le32_to_cpu(hdr->ucode_version); |
| 86 | − family_id = le32_to_cpu(hdr->ucode_version) & 0xff; | |
| 87 | − version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff; | |
| 88 | − version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; | |
| 89 | − DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n", | |
| 90 | − version_major, version_minor, family_id); | |
| 91 | 86 | |
| 87 | + /* Bit 20-23, it is encode major and non-zero for new naming convention. | |
| 88 | + * This field is part of version minor and DRM_DISABLED_FLAG in old naming | |
| 89 | + * convention. Since the l:wq!atest version minor is 0x5B and DRM_DISABLED_FLAG | |
| 90 | + * is zero in old naming convention, this field is always zero so far. | |
| 91 | + * These four bits are used to tell which naming convention is present. | |
| 92 | + */ | |
| 93 | + fw_check = (le32_to_cpu(hdr->ucode_version) >> 20) & 0xf; | |
| 94 | + if (fw_check) { | |
| 95 | + unsigned int dec_ver, enc_major, enc_minor, vep, fw_rev; | |
| 96 | + | |
| 97 | + fw_rev = le32_to_cpu(hdr->ucode_version) & 0xfff; | |
| 98 | + enc_minor = (le32_to_cpu(hdr->ucode_version) >> 12) & 0xff; | |
| 99 | + enc_major = fw_check; | |
| 100 | + dec_ver = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xf; | |
| 101 | + vep = (le32_to_cpu(hdr->ucode_version) >> 28) & 0xf; | |
| 102 | + DRM_INFO("Found VCN firmware Version ENC: %hu.%hu DEC: %hu VEP: %hu Revision: %hu\n", | |
| 103 | + enc_major, enc_minor, dec_ver, vep, fw_rev); | |
| 104 | + } else { | |
| 105 | + unsigned int version_major, version_minor, family_id; | |
| 106 | + | |
| 107 | + family_id = le32_to_cpu(hdr->ucode_version) & 0xff; | |
| 108 | + version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff; | |
| 109 | + version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; | |
| 110 | + DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n", | |
| 111 | + version_major, version_minor, family_id); | |
| 112 | + } | |
| 92 | 113 | |
| 93 | 114 | bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8) |
| 94 | 115 | + AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_HEAP_SIZE |
| @@ -1577,7 +1577,9 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 1576 unmodified lines | ||
| 1577 | 1577 | uint64_t count; |
| 1578 | 1578 | |
| 1579 | 1579 | max_entries = min(max_entries, 16ull * 1024ull); |
| 1580 | − for (count = 1; count < max_entries; ++count) { | |
| 1580 | + for (count = 1; | |
| 1581 | + count < max_entries / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE); | |
| 1582 | + ++count) { | |
| 1581 | 1583 | uint64_t idx = pfn + count; |
| 1582 | 1584 | |
| 1583 | 1585 | if (pages_addr[idx] != |
| @@ -1590,7 +1592,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 6 unmodified lines | ||
| 1590 | 1592 | dma_addr = pages_addr; |
| 1591 | 1593 | } else { |
| 1592 | 1594 | addr = pages_addr[pfn]; |
| 1593 | − max_entries = count; | |
| 1595 | + max_entries = count * (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE); | |
| 1594 | 1596 | } |
| 1595 | 1597 | |
| 1596 | 1598 | } else if (flags & AMDGPU_PTE_VALID) { |
| @@ -1605,7 +1607,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 8 unmodified lines | ||
| 1605 | 1607 | if (r) |
| 1606 | 1608 | return r; |
| 1607 | 1609 | |
| 1608 | − pfn += last - start + 1; | |
| 1610 | + pfn += (last - start + 1) / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE); | |
| 1609 | 1611 | if (nodes && nodes->size == pfn) { |
| 1610 | 1612 | pfn = 0; |
| 1611 | 1613 | ++nodes; |
| @@ -96,6 +96,38 @@ static u64 amdgpu_vram_mgr_vis_size(struct amdgpu_device *adev, · 95 unmodified lines | ||
| 96 | 96 | adev->gmc.visible_vram_size : end) - start; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | +/** | |
| 100 | + * amdgpu_vram_mgr_bo_invisible_size - CPU invisible BO size | |
| 101 | + * | |
| 102 | + * @bo: &amdgpu_bo buffer object (must be in VRAM) | |
| 103 | + * | |
| 104 | + * Returns: | |
| 105 | + * How much of the given &amdgpu_bo buffer object lies in CPU invisible VRAM. | |
| 106 | + */ | |
| 107 | +u64 amdgpu_vram_mgr_bo_invisible_size(struct amdgpu_bo *bo) | |
| 108 | +{ | |
| 109 | + struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); | |
| 110 | + struct ttm_mem_reg *mem = &bo->tbo.mem; | |
| 111 | + struct drm_mm_node *nodes = mem->mm_node; | |
| 112 | + unsigned pages = mem->num_pages; | |
| 113 | + u64 usage = 0; | |
| 114 | + | |
| 115 | + if (adev->gmc.visible_vram_size == adev->gmc.real_vram_size) | |
| 116 | + return 0; | |
| 117 | + | |
| 118 | + if (mem->start >= adev->gmc.visible_vram_size >> PAGE_SHIFT) | |
| 119 | + return amdgpu_bo_size(bo); | |
| 120 | + | |
| 121 | + while (nodes && pages) { | |
| 122 | + usage += nodes->size << PAGE_SHIFT; | |
| 123 | + usage -= amdgpu_vram_mgr_vis_size(adev, nodes); | |
| 124 | + pages -= nodes->size; | |
| 125 | + ++nodes; | |
| 126 | + } | |
| 127 | + | |
| 128 | + return usage; | |
| 129 | +} | |
| 130 | + | |
| 99 | 131 | /** |
| 100 | 132 | * amdgpu_vram_mgr_new - allocate new ranges |
| 101 | 133 | * |
| @@ -135,7 +167,8 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man, · 33 unmodified lines | ||
| 135 | 167 | num_nodes = DIV_ROUND_UP(mem->num_pages, pages_per_node); |
| 136 | 168 | } |
| 137 | 169 | |
| 138 | − nodes = kcalloc(num_nodes, sizeof(*nodes), GFP_KERNEL); | |
| 170 | + nodes = kvmalloc_array(num_nodes, sizeof(*nodes), | |
| 171 | + GFP_KERNEL | __GFP_ZERO); | |
| 139 | 172 | if (!nodes) |
| 140 | 173 | return -ENOMEM; |
| 141 | 174 | |
| @@ -190,7 +223,7 @@ error: · 48 unmodified lines | ||
| 190 | 223 | drm_mm_remove_node(&nodes[i]); |
| 191 | 224 | spin_unlock(&mgr->lock); |
| 192 | 225 | |
| 193 | − kfree(nodes); | |
| 226 | + kvfree(nodes); | |
| 194 | 227 | return r == -ENOSPC ? 0 : r; |
| 195 | 228 | } |
| 196 | 229 | |
| @@ -229,7 +262,7 @@ static void amdgpu_vram_mgr_del(struct ttm_mem_type_manager *man, · 32 unmodified lines | ||
| 229 | 262 | atomic64_sub(usage, &mgr->usage); |
| 230 | 263 | atomic64_sub(vis_usage, &mgr->vis_usage); |
| 231 | 264 | |
| 232 | − kfree(mem->mm_node); | |
| 265 | + kvfree(mem->mm_node); | |
| 233 | 266 | mem->mm_node = NULL; |
| 234 | 267 | } |
| 235 | 268 | |
| @@ -3927,10 +3927,11 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc, · 3926 unmodified lines | ||
| 3927 | 3927 | if (acrtc->base.state->event) |
| 3928 | 3928 | prepare_flip_isr(acrtc); |
| 3929 | 3929 | |
| 3930 | + spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | |
| 3931 | + | |
| 3930 | 3932 | surface_updates->surface = dc_stream_get_status(acrtc_state->stream)->plane_states[0]; |
| 3931 | 3933 | surface_updates->flip_addr = &addr; |
| 3932 | 3934 | |
| 3933 | − | |
| 3934 | 3935 | dc_commit_updates_for_stream(adev->dm.dc, |
| 3935 | 3936 | surface_updates, |
| 3936 | 3937 | 1, |
| @@ -3943,9 +3944,6 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc, · 6 unmodified lines | ||
| 3943 | 3944 | __func__, |
| 3944 | 3945 | addr.address.grph.addr.high_part, |
| 3945 | 3946 | addr.address.grph.addr.low_part); |
| 3946 | − | |
| 3947 | − | |
| 3948 | − spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | |
| 3949 | 3947 | } |
| 3950 | 3948 | |
| 3951 | 3949 | /* |
| @@ -4205,6 +4203,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 253 unmodified lines | ||
| 4205 | 4203 | struct drm_connector *connector; |
| 4206 | 4204 | struct drm_connector_state *old_con_state, *new_con_state; |
| 4207 | 4205 | struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state; |
| 4206 | + int crtc_disable_count = 0; | |
| 4208 | 4207 | |
| 4209 | 4208 | drm_atomic_helper_update_legacy_modeset_state(dev, state); |
| 4210 | 4209 | |
| @@ -4409,6 +4408,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 198 unmodified lines | ||
| 4409 | 4408 | struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); |
| 4410 | 4409 | bool modeset_needed; |
| 4411 | 4410 | |
| 4411 | + if (old_crtc_state->active && !new_crtc_state->active) | |
| 4412 | + crtc_disable_count++; | |
| 4413 | + | |
| 4412 | 4414 | dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); |
| 4413 | 4415 | dm_old_crtc_state = to_dm_crtc_state(old_crtc_state); |
| 4414 | 4416 | modeset_needed = modeset_required( |
| @@ -4462,11 +4464,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 47 unmodified lines | ||
| 4462 | 4464 | * so we can put the GPU into runtime suspend if we're not driving any |
| 4463 | 4465 | * displays anymore |
| 4464 | 4466 | */ |
| 4467 | + for (i = 0; i < crtc_disable_count; i++) | |
| 4468 | + pm_runtime_put_autosuspend(dev->dev); | |
| 4465 | 4469 | pm_runtime_mark_last_busy(dev->dev); |
| 4466 | − for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { | |
| 4467 | − if (old_crtc_state->active && !new_crtc_state->active) | |
| 4468 | − pm_runtime_put_autosuspend(dev->dev); | |
| 4469 | − } | |
| 4470 | 4470 | } |
| 4471 | 4471 | |
| 4472 | 4472 | |
| @@ -1090,7 +1090,7 @@ static int vega10_disable_se_edc_config(struct pp_hwmgr *hwmgr) · 1089 unmodified lines | ||
| 1090 | 1090 | static int vega10_enable_psm_gc_edc_config(struct pp_hwmgr *hwmgr) |
| 1091 | 1091 | { |
| 1092 | 1092 | struct amdgpu_device *adev = hwmgr->adev; |
| 1093 | − int result; | |
| 1093 | + int result = 0; | |
| 1094 | 1094 | uint32_t num_se = 0; |
| 1095 | 1095 | uint32_t count, data; |
| 1096 | 1096 | |
| @@ -278,7 +278,6 @@ static int malidp_init(struct drm_device *drm) · 277 unmodified lines | ||
| 278 | 278 | |
| 279 | 279 | static void malidp_fini(struct drm_device *drm) |
| 280 | 280 | { |
| 281 | − drm_atomic_helper_shutdown(drm); | |
| 282 | 281 | drm_mode_config_cleanup(drm); |
| 283 | 282 | } |
| 284 | 283 | |
| @@ -646,6 +645,7 @@ vblank_fail: · 361 unmodified lines | ||
| 646 | 645 | malidp_de_irq_fini(drm); |
| 647 | 646 | drm->irq_enabled = false; |
| 648 | 647 | irq_init_fail: |
| 648 | + drm_atomic_helper_shutdown(drm); | |
| 649 | 649 | component_unbind_all(dev, drm); |
| 650 | 650 | bind_fail: |
| 651 | 651 | of_node_put(malidp->crtc.port); |
| @@ -681,6 +681,7 @@ static void malidp_unbind(struct device *dev) · 29 unmodified lines | ||
| 681 | 681 | malidp_se_irq_fini(drm); |
| 682 | 682 | malidp_de_irq_fini(drm); |
| 683 | 683 | drm->irq_enabled = false; |
| 684 | + drm_atomic_helper_shutdown(drm); | |
| 684 | 685 | component_unbind_all(dev, drm); |
| 685 | 686 | of_node_put(malidp->crtc.port); |
| 686 | 687 | malidp->crtc.port = NULL; |
| @@ -634,7 +634,8 @@ const struct malidp_hw malidp_device[MALIDP_MAX_DEVICES] = { · 633 unmodified lines | ||
| 634 | 634 | .vsync_irq = MALIDP500_DE_IRQ_VSYNC, |
| 635 | 635 | }, |
| 636 | 636 | .se_irq_map = { |
| 637 | − .irq_mask = MALIDP500_SE_IRQ_CONF_MODE, | |
| 637 | + .irq_mask = MALIDP500_SE_IRQ_CONF_MODE | | |
| 638 | + MALIDP500_SE_IRQ_GLOBAL, | |
| 638 | 639 | .vsync_irq = 0, |
| 639 | 640 | }, |
| 640 | 641 | .dc_irq_map = { |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | |
| 24 | 24 | /* Layer specific register offsets */ |
| 25 | 25 | #define MALIDP_LAYER_FORMAT 0x000 |
| 26 | +#define LAYER_FORMAT_MASK 0x3f | |
| 26 | 27 | #define MALIDP_LAYER_CONTROL 0x004 |
| 27 | 28 | #define LAYER_ENABLE (1 << 0) |
| 28 | 29 | #define LAYER_FLOWCFG_MASK 7 |
| @@ -235,8 +236,8 @@ static int malidp_de_plane_check(struct drm_plane *plane, · 206 unmodified lines | ||
| 235 | 236 | if (state->rotation & MALIDP_ROTATED_MASK) { |
| 236 | 237 | int val; |
| 237 | 238 | |
| 238 | − val = mp->hwdev->hw->rotmem_required(mp->hwdev, state->crtc_h, | |
| 239 | − state->crtc_w, | |
| 239 | + val = mp->hwdev->hw->rotmem_required(mp->hwdev, state->crtc_w, | |
| 240 | + state->crtc_h, | |
| 240 | 241 | fb->format->format); |
| 241 | 242 | if (val < 0) |
| 242 | 243 | return val; |
| @@ -337,7 +338,9 @@ static void malidp_de_plane_update(struct drm_plane *plane, · 94 unmodified lines | ||
| 337 | 338 | dest_w = plane->state->crtc_w; |
| 338 | 339 | dest_h = plane->state->crtc_h; |
| 339 | 340 | |
| 340 | − malidp_hw_write(mp->hwdev, ms->format, mp->layer->base); | |
| 341 | + val = malidp_hw_read(mp->hwdev, mp->layer->base); | |
| 342 | + val = (val & ~LAYER_FORMAT_MASK) | ms->format; | |
| 343 | + malidp_hw_write(mp->hwdev, val, mp->layer->base); | |
| 341 | 344 | |
| 342 | 345 | for (i = 0; i < ms->n_planes; i++) { |
| 343 | 346 | /* calculate the offset for the layer's plane registers */ |
| @@ -830,7 +830,7 @@ static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane) · 829 unmodified lines | ||
| 830 | 830 | return ret; |
| 831 | 831 | } |
| 832 | 832 | |
| 833 | − if (desc->layout.xstride && desc->layout.pstride) { | |
| 833 | + if (desc->layout.xstride[0] && desc->layout.pstride[0]) { | |
| 834 | 834 | int ret; |
| 835 | 835 | |
| 836 | 836 | ret = drm_plane_create_rotation_property(&plane->base, |
| @@ -36,8 +36,11 @@ · 35 unmodified lines | ||
| 36 | 36 | |
| 37 | 37 | #define SII8620_BURST_BUF_LEN 288 |
| 38 | 38 | #define VAL_RX_HDMI_CTRL2_DEFVAL VAL_RX_HDMI_CTRL2_IDLE_CNT(3) |
| 39 | −#define MHL1_MAX_LCLK 225000 | |
| 40 | −#define MHL3_MAX_LCLK 600000 | |
| 39 | + | |
| 40 | +#define MHL1_MAX_PCLK 75000 | |
| 41 | +#define MHL1_MAX_PCLK_PP_MODE 150000 | |
| 42 | +#define MHL3_MAX_PCLK 200000 | |
| 43 | +#define MHL3_MAX_PCLK_PP_MODE 300000 | |
| 41 | 44 | |
| 42 | 45 | enum sii8620_mode { |
| 43 | 46 | CM_DISCONNECTED, |
| @@ -80,6 +83,9 @@ struct sii8620 { · 36 unmodified lines | ||
| 80 | 83 | u8 devcap[MHL_DCAP_SIZE]; |
| 81 | 84 | u8 xdevcap[MHL_XDC_SIZE]; |
| 82 | 85 | u8 avif[HDMI_INFOFRAME_SIZE(AVI)]; |
| 86 | + bool feature_complete; | |
| 87 | + bool devcap_read; | |
| 88 | + bool sink_detected; | |
| 83 | 89 | struct edid *edid; |
| 84 | 90 | unsigned int gen2_write_burst:1; |
| 85 | 91 | enum sii8620_mt_state mt_state; |
| @@ -476,7 +482,7 @@ static void sii8620_update_array(u8 *dst, u8 *src, int count) · 390 unmodified lines | ||
| 476 | 482 | } |
| 477 | 483 | } |
| 478 | 484 | |
| 479 | −static void sii8620_sink_detected(struct sii8620 *ctx, int ret) | |
| 485 | +static void sii8620_identify_sink(struct sii8620 *ctx) | |
| 480 | 486 | { |
| 481 | 487 | static const char * const sink_str[] = { |
| 482 | 488 | [SINK_NONE] = "NONE", |
| @@ -487,7 +493,7 @@ static void sii8620_sink_detected(struct sii8620 *ctx, int ret) · 4 unmodified lines | ||
| 487 | 493 | char sink_name[20]; |
| 488 | 494 | struct device *dev = ctx->dev; |
| 489 | 495 | |
| 490 | − if (ret < 0) | |
| 496 | + if (!ctx->sink_detected || !ctx->devcap_read) | |
| 491 | 497 | return; |
| 492 | 498 | |
| 493 | 499 | sii8620_fetch_edid(ctx); |
| @@ -496,6 +502,7 @@ static void sii8620_sink_detected(struct sii8620 *ctx, int ret) · 2 unmodified lines | ||
| 496 | 502 | sii8620_mhl_disconnected(ctx); |
| 497 | 503 | return; |
| 498 | 504 | } |
| 505 | + sii8620_set_upstream_edid(ctx); | |
| 499 | 506 | |
| 500 | 507 | if (drm_detect_hdmi_monitor(ctx->edid)) |
| 501 | 508 | ctx->sink_type = SINK_HDMI; |
| @@ -508,53 +515,6 @@ static void sii8620_sink_detected(struct sii8620 *ctx, int ret) · 6 unmodified lines | ||
| 508 | 515 | sink_str[ctx->sink_type], sink_name); |
| 509 | 516 | } |
| 510 | 517 | |
| 511 | −static void sii8620_hsic_init(struct sii8620 *ctx) | |
| 512 | −{ | |
| 513 | − if (!sii8620_is_mhl3(ctx)) | |
| 514 | − return; | |
| 515 | − | |
| 516 | − sii8620_write(ctx, REG_FCGC, | |
| 517 | − BIT_FCGC_HSIC_HOSTMODE | BIT_FCGC_HSIC_ENABLE); | |
| 518 | − sii8620_setbits(ctx, REG_HRXCTRL3, | |
| 519 | − BIT_HRXCTRL3_HRX_STAY_RESET | BIT_HRXCTRL3_STATUS_EN, ~0); | |
| 520 | − sii8620_setbits(ctx, REG_TTXNUMB, MSK_TTXNUMB_TTX_NUMBPS, 4); | |
| 521 | − sii8620_setbits(ctx, REG_TRXCTRL, BIT_TRXCTRL_TRX_FROM_SE_COC, ~0); | |
| 522 | − sii8620_setbits(ctx, REG_HTXCTRL, BIT_HTXCTRL_HTX_DRVCONN1, 0); | |
| 523 | − sii8620_setbits(ctx, REG_KEEPER, MSK_KEEPER_MODE, VAL_KEEPER_MODE_HOST); | |
| 524 | − sii8620_write_seq_static(ctx, | |
| 525 | − REG_TDMLLCTL, 0, | |
| 526 | − REG_UTSRST, BIT_UTSRST_HRX_SRST | BIT_UTSRST_HTX_SRST | | |
| 527 | − BIT_UTSRST_KEEPER_SRST | BIT_UTSRST_FC_SRST, | |
| 528 | − REG_UTSRST, BIT_UTSRST_HRX_SRST | BIT_UTSRST_HTX_SRST, | |
| 529 | − REG_HRXINTL, 0xff, | |
| 530 | − REG_HRXINTH, 0xff, | |
| 531 | − REG_TTXINTL, 0xff, | |
| 532 | − REG_TTXINTH, 0xff, | |
| 533 | − REG_TRXINTL, 0xff, | |
| 534 | − REG_TRXINTH, 0xff, | |
| 535 | − REG_HTXINTL, 0xff, | |
| 536 | − REG_HTXINTH, 0xff, | |
| 537 | − REG_FCINTR0, 0xff, | |
| 538 | − REG_FCINTR1, 0xff, | |
| 539 | − REG_FCINTR2, 0xff, | |
| 540 | − REG_FCINTR3, 0xff, | |
| 541 | − REG_FCINTR4, 0xff, | |
| 542 | − REG_FCINTR5, 0xff, | |
| 543 | − REG_FCINTR6, 0xff, | |
| 544 | − REG_FCINTR7, 0xff | |
| 545 | − ); | |
| 546 | −} | |
| 547 | − | |
| 548 | −static void sii8620_edid_read(struct sii8620 *ctx, int ret) | |
| 549 | −{ | |
| 550 | − if (ret < 0) | |
| 551 | − return; | |
| 552 | − | |
| 553 | − sii8620_set_upstream_edid(ctx); | |
| 554 | − sii8620_hsic_init(ctx); | |
| 555 | − sii8620_enable_hpd(ctx); | |
| 556 | −} | |
| 557 | − | |
| 558 | 518 | static void sii8620_mr_devcap(struct sii8620 *ctx) |
| 559 | 519 | { |
| 560 | 520 | u8 dcap[MHL_DCAP_SIZE]; |
| @@ -570,6 +530,8 @@ static void sii8620_mr_devcap(struct sii8620 *ctx) · 9 unmodified lines | ||
| 570 | 530 | dcap[MHL_DCAP_ADOPTER_ID_H], dcap[MHL_DCAP_ADOPTER_ID_L], |
| 571 | 531 | dcap[MHL_DCAP_DEVICE_ID_H], dcap[MHL_DCAP_DEVICE_ID_L]); |
| 572 | 532 | sii8620_update_array(ctx->devcap, dcap, MHL_DCAP_SIZE); |
| 533 | + ctx->devcap_read = true; | |
| 534 | + sii8620_identify_sink(ctx); | |
| 573 | 535 | } |
| 574 | 536 | |
| 575 | 537 | static void sii8620_mr_xdevcap(struct sii8620 *ctx) |
| @@ -807,6 +769,7 @@ static void sii8620_burst_rx_all(struct sii8620 *ctx) · 231 unmodified lines | ||
| 807 | 769 | static void sii8620_fetch_edid(struct sii8620 *ctx) |
| 808 | 770 | { |
| 809 | 771 | u8 lm_ddc, ddc_cmd, int3, cbus; |
| 772 | + unsigned long timeout; | |
| 810 | 773 | int fetched, i; |
| 811 | 774 | int edid_len = EDID_LENGTH; |
| 812 | 775 | u8 *edid; |
| @@ -856,23 +819,31 @@ static void sii8620_fetch_edid(struct sii8620 *ctx) · 43 unmodified lines | ||
| 856 | 819 | REG_DDC_CMD, ddc_cmd | VAL_DDC_CMD_ENH_DDC_READ_NO_ACK |
| 857 | 820 | ); |
| 858 | 821 | |
| 859 | − do { | |
| 860 | − int3 = sii8620_readb(ctx, REG_INTR3); | |
| 822 | + int3 = 0; | |
| 823 | + timeout = jiffies + msecs_to_jiffies(200); | |
| 824 | + for (;;) { | |
| 861 | 825 | cbus = sii8620_readb(ctx, REG_CBUS_STATUS); |
| 862 | − | |
| 863 | − if (int3 & BIT_DDC_CMD_DONE) | |
| 864 | − break; | |
| 865 | − | |
| 866 | − if (!(cbus & BIT_CBUS_STATUS_CBUS_CONNECTED)) { | |
| 826 | + if (~cbus & BIT_CBUS_STATUS_CBUS_CONNECTED) { | |
| 827 | + kfree(edid); | |
| 828 | + edid = NULL; | |
| 829 | + goto end; | |
| 830 | + } | |
| 831 | + if (int3 & BIT_DDC_CMD_DONE) { | |
| 832 | + if (sii8620_readb(ctx, REG_DDC_DOUT_CNT) | |
| 833 | + >= FETCH_SIZE) | |
| 834 | + break; | |
| 835 | + } else { | |
| 836 | + int3 = sii8620_readb(ctx, REG_INTR3); | |
| 837 | + } | |
| 838 | + if (time_is_before_jiffies(timeout)) { | |
| 839 | + ctx->error = -ETIMEDOUT; | |
| 840 | + dev_err(ctx->dev, "timeout during EDID read\n"); | |
| 867 | 841 | kfree(edid); |
| 868 | 842 | edid = NULL; |
| 869 | 843 | goto end; |
| 870 | 844 | } |
| 871 | − } while (1); | |
| 872 | − | |
| 873 | − sii8620_readb(ctx, REG_DDC_STATUS); | |
| 874 | − while (sii8620_readb(ctx, REG_DDC_DOUT_CNT) < FETCH_SIZE) | |
| 875 | 845 | usleep_range(10, 20); |
| 846 | + } | |
| 876 | 847 | |
| 877 | 848 | sii8620_read_buf(ctx, REG_DDC_DATA, edid + fetched, FETCH_SIZE); |
| 878 | 849 | if (fetched + FETCH_SIZE == EDID_LENGTH) { |
| @@ -971,8 +942,17 @@ static int sii8620_hw_on(struct sii8620 *ctx) · 92 unmodified lines | ||
| 971 | 942 | ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); |
| 972 | 943 | if (ret) |
| 973 | 944 | return ret; |
| 945 | + | |
| 974 | 946 | usleep_range(10000, 20000); |
| 975 | − return clk_prepare_enable(ctx->clk_xtal); | |
| 947 | + ret = clk_prepare_enable(ctx->clk_xtal); | |
| 948 | + if (ret) | |
| 949 | + return ret; | |
| 950 | + | |
| 951 | + msleep(100); | |
| 952 | + gpiod_set_value(ctx->gpio_reset, 0); | |
| 953 | + msleep(100); | |
| 954 | + | |
| 955 | + return 0; | |
| 976 | 956 | } |
| 977 | 957 | |
| 978 | 958 | static int sii8620_hw_off(struct sii8620 *ctx) |
| @@ -982,17 +962,6 @@ static int sii8620_hw_off(struct sii8620 *ctx) · 3 unmodified lines | ||
| 982 | 962 | return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); |
| 983 | 963 | } |
| 984 | 964 | |
| 985 | −static void sii8620_hw_reset(struct sii8620 *ctx) | |
| 986 | −{ | |
| 987 | − usleep_range(10000, 20000); | |
| 988 | − gpiod_set_value(ctx->gpio_reset, 0); | |
| 989 | − usleep_range(5000, 20000); | |
| 990 | − gpiod_set_value(ctx->gpio_reset, 1); | |
| 991 | − usleep_range(10000, 20000); | |
| 992 | − gpiod_set_value(ctx->gpio_reset, 0); | |
| 993 | − msleep(300); | |
| 994 | −} | |
| 995 | − | |
| 996 | 965 | static void sii8620_cbus_reset(struct sii8620 *ctx) |
| 997 | 966 | { |
| 998 | 967 | sii8620_write(ctx, REG_PWD_SRST, BIT_PWD_SRST_CBUS_RST |
| @@ -1048,20 +1017,11 @@ static void sii8620_stop_video(struct sii8620 *ctx) · 49 unmodified lines | ||
| 1048 | 1017 | |
| 1049 | 1018 | static void sii8620_set_format(struct sii8620 *ctx) |
| 1050 | 1019 | { |
| 1051 | − u8 out_fmt; | |
| 1052 | − | |
| 1053 | 1020 | if (sii8620_is_mhl3(ctx)) { |
| 1054 | 1021 | sii8620_setbits(ctx, REG_M3_P0CTRL, |
| 1055 | 1022 | BIT_M3_P0CTRL_MHL3_P0_PIXEL_MODE_PACKED, |
| 1056 | 1023 | ctx->use_packed_pixel ? ~0 : 0); |
| 1057 | 1024 | } else { |
| 1058 | − if (ctx->use_packed_pixel) | |
| 1059 | − sii8620_write_seq_static(ctx, | |
| 1060 | − REG_VID_MODE, BIT_VID_MODE_M1080P, | |
| 1061 | − REG_MHL_TOP_CTL, BIT_MHL_TOP_CTL_MHL_PP_SEL | 1, | |
| 1062 | − REG_MHLTX_CTL6, 0x60 | |
| 1063 | − ); | |
| 1064 | − else | |
| 1065 | 1025 | sii8620_write_seq_static(ctx, |
| 1066 | 1026 | REG_VID_MODE, 0, |
| 1067 | 1027 | REG_MHL_TOP_CTL, 1, |
| @@ -1069,15 +1029,9 @@ static void sii8620_set_format(struct sii8620 *ctx) · 1 unmodified line | ||
| 1069 | 1029 | ); |
| 1070 | 1030 | } |
| 1071 | 1031 | |
| 1072 | − if (ctx->use_packed_pixel) | |
| 1073 | − out_fmt = VAL_TPI_FORMAT(YCBCR422, FULL) | | |
| 1074 | − BIT_TPI_OUTPUT_CSCMODE709; | |
| 1075 | − else | |
| 1076 | − out_fmt = VAL_TPI_FORMAT(RGB, FULL); | |
| 1077 | − | |
| 1078 | 1032 | sii8620_write_seq(ctx, |
| 1079 | 1033 | REG_TPI_INPUT, VAL_TPI_FORMAT(RGB, FULL), |
| 1080 | − REG_TPI_OUTPUT, out_fmt, | |
| 1034 | + REG_TPI_OUTPUT, VAL_TPI_FORMAT(RGB, FULL), | |
| 1081 | 1035 | ); |
| 1082 | 1036 | } |
| 1083 | 1037 | |
| @@ -1216,7 +1170,7 @@ static void sii8620_start_video(struct sii8620 *ctx) · 132 unmodified lines | ||
| 1216 | 1170 | int clk = ctx->pixel_clock * (ctx->use_packed_pixel ? 2 : 3); |
| 1217 | 1171 | int i; |
| 1218 | 1172 | |
| 1219 | − for (i = 0; i < ARRAY_SIZE(clk_spec); ++i) | |
| 1173 | + for (i = 0; i < ARRAY_SIZE(clk_spec) - 1; ++i) | |
| 1220 | 1174 | if (clk < clk_spec[i].max_clk) |
| 1221 | 1175 | break; |
| 1222 | 1176 | |
| @@ -1534,6 +1488,16 @@ static void sii8620_set_mode(struct sii8620 *ctx, enum sii8620_mode mode) · 311 unmodified lines | ||
| 1534 | 1488 | ); |
| 1535 | 1489 | } |
| 1536 | 1490 | |
| 1491 | +static void sii8620_hpd_unplugged(struct sii8620 *ctx) | |
| 1492 | +{ | |
| 1493 | + sii8620_disable_hpd(ctx); | |
| 1494 | + ctx->sink_type = SINK_NONE; | |
| 1495 | + ctx->sink_detected = false; | |
| 1496 | + ctx->feature_complete = false; | |
| 1497 | + kfree(ctx->edid); | |
| 1498 | + ctx->edid = NULL; | |
| 1499 | +} | |
| 1500 | + | |
| 1537 | 1501 | static void sii8620_disconnect(struct sii8620 *ctx) |
| 1538 | 1502 | { |
| 1539 | 1503 | sii8620_disable_gen2_write_burst(ctx); |
| @@ -1561,7 +1525,7 @@ static void sii8620_disconnect(struct sii8620 *ctx) · 21 unmodified lines | ||
| 1561 | 1525 | REG_MHL_DP_CTL6, 0x2A, |
| 1562 | 1526 | REG_MHL_DP_CTL7, 0x03 |
| 1563 | 1527 | ); |
| 1564 | − sii8620_disable_hpd(ctx); | |
| 1528 | + sii8620_hpd_unplugged(ctx); | |
| 1565 | 1529 | sii8620_write_seq_static(ctx, |
| 1566 | 1530 | REG_M3_CTRL, VAL_M3_CTRL_MHL3_VALUE, |
| 1567 | 1531 | REG_MHL_COC_CTL1, 0x07, |
| @@ -1609,10 +1573,8 @@ static void sii8620_disconnect(struct sii8620 *ctx) · 41 unmodified lines | ||
| 1609 | 1573 | memset(ctx->xstat, 0, sizeof(ctx->xstat)); |
| 1610 | 1574 | memset(ctx->devcap, 0, sizeof(ctx->devcap)); |
| 1611 | 1575 | memset(ctx->xdevcap, 0, sizeof(ctx->xdevcap)); |
| 1576 | + ctx->devcap_read = false; | |
| 1612 | 1577 | ctx->cbus_status = 0; |
| 1613 | − ctx->sink_type = SINK_NONE; | |
| 1614 | − kfree(ctx->edid); | |
| 1615 | − ctx->edid = NULL; | |
| 1616 | 1578 | sii8620_mt_cleanup(ctx); |
| 1617 | 1579 | } |
| 1618 | 1580 | |
| @@ -1703,9 +1665,6 @@ static void sii8620_status_changed_path(struct sii8620 *ctx) · 84 unmodified lines | ||
| 1703 | 1665 | sii8620_mt_write_stat(ctx, MHL_DST_REG(LINK_MODE), |
| 1704 | 1666 | MHL_DST_LM_CLK_MODE_NORMAL |
| 1705 | 1667 | | MHL_DST_LM_PATH_ENABLED); |
| 1706 | − if (!sii8620_is_mhl3(ctx)) | |
| 1707 | − sii8620_mt_read_devcap(ctx, false); | |
| 1708 | − sii8620_mt_set_cont(ctx, sii8620_sink_detected); | |
| 1709 | 1668 | } else { |
| 1710 | 1669 | sii8620_mt_write_stat(ctx, MHL_DST_REG(LINK_MODE), |
| 1711 | 1670 | MHL_DST_LM_CLK_MODE_NORMAL); |
| @@ -1722,9 +1681,14 @@ static void sii8620_msc_mr_write_stat(struct sii8620 *ctx) · 10 unmodified lines | ||
| 1722 | 1681 | sii8620_update_array(ctx->stat, st, MHL_DST_SIZE); |
| 1723 | 1682 | sii8620_update_array(ctx->xstat, xst, MHL_XDS_SIZE); |
| 1724 | 1683 | |
| 1725 | − if (ctx->stat[MHL_DST_CONNECTED_RDY] & MHL_DST_CONN_DCAP_RDY) | |
| 1684 | + if (ctx->stat[MHL_DST_CONNECTED_RDY] & st[MHL_DST_CONNECTED_RDY] & | |
| 1685 | + MHL_DST_CONN_DCAP_RDY) { | |
| 1726 | 1686 | sii8620_status_dcap_ready(ctx); |
| 1727 | 1687 | |
| 1688 | + if (!sii8620_is_mhl3(ctx)) | |
| 1689 | + sii8620_mt_read_devcap(ctx, false); | |
| 1690 | + } | |
| 1691 | + | |
| 1728 | 1692 | if (st[MHL_DST_LINK_MODE] & MHL_DST_LM_PATH_ENABLED) |
| 1729 | 1693 | sii8620_status_changed_path(ctx); |
| 1730 | 1694 | } |
| @@ -1808,8 +1772,11 @@ static void sii8620_msc_mr_set_int(struct sii8620 *ctx) · 77 unmodified lines | ||
| 1808 | 1772 | } |
| 1809 | 1773 | if (ints[MHL_INT_RCHANGE] & MHL_INT_RC_FEAT_REQ) |
| 1810 | 1774 | sii8620_send_features(ctx); |
| 1811 | − if (ints[MHL_INT_RCHANGE] & MHL_INT_RC_FEAT_COMPLETE) | |
| 1812 | − sii8620_edid_read(ctx, 0); | |
| 1775 | + if (ints[MHL_INT_RCHANGE] & MHL_INT_RC_FEAT_COMPLETE) { | |
| 1776 | + ctx->feature_complete = true; | |
| 1777 | + if (ctx->edid) | |
| 1778 | + sii8620_enable_hpd(ctx); | |
| 1779 | + } | |
| 1813 | 1780 | } |
| 1814 | 1781 | |
| 1815 | 1782 | static struct sii8620_mt_msg *sii8620_msc_msg_first(struct sii8620 *ctx) |
| @@ -1884,6 +1851,15 @@ static void sii8620_irq_msc(struct sii8620 *ctx) · 68 unmodified lines | ||
| 1884 | 1851 | if (stat & BIT_CBUS_MSC_MR_WRITE_STAT) |
| 1885 | 1852 | sii8620_msc_mr_write_stat(ctx); |
| 1886 | 1853 | |
| 1854 | + if (stat & BIT_CBUS_HPD_CHG) { | |
| 1855 | + if (ctx->cbus_status & BIT_CBUS_STATUS_CBUS_HPD) { | |
| 1856 | + ctx->sink_detected = true; | |
| 1857 | + sii8620_identify_sink(ctx); | |
| 1858 | + } else { | |
| 1859 | + sii8620_hpd_unplugged(ctx); | |
| 1860 | + } | |
| 1861 | + } | |
| 1862 | + | |
| 1887 | 1863 | if (stat & BIT_CBUS_MSC_MR_SET_INT) |
| 1888 | 1864 | sii8620_msc_mr_set_int(ctx); |
| 1889 | 1865 | |
| @@ -1931,14 +1907,6 @@ static void sii8620_irq_edid(struct sii8620 *ctx) · 41 unmodified lines | ||
| 1931 | 1907 | ctx->mt_state = MT_STATE_DONE; |
| 1932 | 1908 | } |
| 1933 | 1909 | |
| 1934 | −static void sii8620_scdt_high(struct sii8620 *ctx) | |
| 1935 | −{ | |
| 1936 | − sii8620_write_seq_static(ctx, | |
| 1937 | − REG_INTR8_MASK, BIT_CEA_NEW_AVI | BIT_CEA_NEW_VSI, | |
| 1938 | − REG_TPI_SC, BIT_TPI_SC_TPI_OUTPUT_MODE_0_HDMI, | |
| 1939 | − ); | |
| 1940 | −} | |
| 1941 | − | |
| 1942 | 1910 | static void sii8620_irq_scdt(struct sii8620 *ctx) |
| 1943 | 1911 | { |
| 1944 | 1912 | u8 stat = sii8620_readb(ctx, REG_INTR5); |
| @@ -1946,53 +1914,13 @@ static void sii8620_irq_scdt(struct sii8620 *ctx) · 1 unmodified line | ||
| 1946 | 1914 | if (stat & BIT_INTR_SCDT_CHANGE) { |
| 1947 | 1915 | u8 cstat = sii8620_readb(ctx, REG_TMDS_CSTAT_P3); |
| 1948 | 1916 | |
| 1949 | − if (cstat & BIT_TMDS_CSTAT_P3_SCDT) { | |
| 1950 | − if (ctx->sink_type == SINK_HDMI) | |
| 1951 | − /* enable infoframe interrupt */ | |
| 1952 | − sii8620_scdt_high(ctx); | |
| 1953 | − else | |
| 1954 | − sii8620_start_video(ctx); | |
| 1955 | − } | |
| 1917 | + if (cstat & BIT_TMDS_CSTAT_P3_SCDT) | |
| 1918 | + sii8620_start_video(ctx); | |
| 1956 | 1919 | } |
| 1957 | 1920 | |
| 1958 | 1921 | sii8620_write(ctx, REG_INTR5, stat); |
| 1959 | 1922 | } |
| 1960 | 1923 | |
| 1961 | −static void sii8620_new_vsi(struct sii8620 *ctx) | |
| 1962 | −{ | |
| 1963 | − u8 vsif[11]; | |
| 1964 | − | |
| 1965 | − sii8620_write(ctx, REG_RX_HDMI_CTRL2, | |
| 1966 | − VAL_RX_HDMI_CTRL2_DEFVAL | | |
| 1967 | − BIT_RX_HDMI_CTRL2_VSI_MON_SEL_VSI); | |
| 1968 | − sii8620_read_buf(ctx, REG_RX_HDMI_MON_PKT_HEADER1, vsif, | |
| 1969 | − ARRAY_SIZE(vsif)); | |
| 1970 | −} | |
| 1971 | − | |
| 1972 | −static void sii8620_new_avi(struct sii8620 *ctx) | |
| 1973 | −{ | |
| 1974 | − sii8620_write(ctx, REG_RX_HDMI_CTRL2, VAL_RX_HDMI_CTRL2_DEFVAL); | |
| 1975 | − sii8620_read_buf(ctx, REG_RX_HDMI_MON_PKT_HEADER1, ctx->avif, | |
| 1976 | − ARRAY_SIZE(ctx->avif)); | |
| 1977 | −} | |
| 1978 | − | |
| 1979 | −static void sii8620_irq_infr(struct sii8620 *ctx) | |
| 1980 | −{ | |
| 1981 | − u8 stat = sii8620_readb(ctx, REG_INTR8) | |
| 1982 | − & (BIT_CEA_NEW_VSI | BIT_CEA_NEW_AVI); | |
| 1983 | − | |
| 1984 | − sii8620_write(ctx, REG_INTR8, stat); | |
| 1985 | − | |
| 1986 | − if (stat & BIT_CEA_NEW_VSI) | |
| 1987 | − sii8620_new_vsi(ctx); | |
| 1988 | − | |
| 1989 | − if (stat & BIT_CEA_NEW_AVI) | |
| 1990 | − sii8620_new_avi(ctx); | |
| 1991 | − | |
| 1992 | − if (stat & (BIT_CEA_NEW_VSI | BIT_CEA_NEW_AVI)) | |
| 1993 | − sii8620_start_video(ctx); | |
| 1994 | −} | |
| 1995 | − | |
| 1996 | 1924 | static void sii8620_got_xdevcap(struct sii8620 *ctx, int ret) |
| 1997 | 1925 | { |
| 1998 | 1926 | if (ret < 0) |
| @@ -2043,11 +1971,11 @@ static void sii8620_irq_ddc(struct sii8620 *ctx) · 44 unmodified lines | ||
| 2043 | 1971 | |
| 2044 | 1972 | if (stat & BIT_DDC_CMD_DONE) { |
| 2045 | 1973 | sii8620_write(ctx, REG_INTR3_MASK, 0); |
| 2046 | − if (sii8620_is_mhl3(ctx)) | |
| 1974 | + if (sii8620_is_mhl3(ctx) && !ctx->feature_complete) | |
| 2047 | 1975 | sii8620_mt_set_int(ctx, MHL_INT_REG(RCHANGE), |
| 2048 | 1976 | MHL_INT_RC_FEAT_REQ); |
| 2049 | 1977 | else |
| 2050 | − sii8620_edid_read(ctx, 0); | |
| 1978 | + sii8620_enable_hpd(ctx); | |
| 2051 | 1979 | } |
| 2052 | 1980 | sii8620_write(ctx, REG_INTR3, stat); |
| 2053 | 1981 | } |
| @@ -2074,7 +2002,6 @@ static irqreturn_t sii8620_irq_thread(int irq, void *data) · 20 unmodified lines | ||
| 2074 | 2002 | { BIT_FAST_INTR_STAT_EDID, sii8620_irq_edid }, |
| 2075 | 2003 | { BIT_FAST_INTR_STAT_DDC, sii8620_irq_ddc }, |
| 2076 | 2004 | { BIT_FAST_INTR_STAT_SCDT, sii8620_irq_scdt }, |
| 2077 | − { BIT_FAST_INTR_STAT_INFR, sii8620_irq_infr }, | |
| 2078 | 2005 | }; |
| 2079 | 2006 | struct sii8620 *ctx = data; |
| 2080 | 2007 | u8 stats[LEN_FAST_INTR_STAT]; |
| @@ -2112,7 +2039,6 @@ static void sii8620_cable_in(struct sii8620 *ctx) · 31 unmodified lines | ||
| 2112 | 2039 | dev_err(dev, "Error powering on, %d.\n", ret); |
| 2113 | 2040 | return; |
| 2114 | 2041 | } |
| 2115 | − sii8620_hw_reset(ctx); | |
| 2116 | 2042 | |
| 2117 | 2043 | sii8620_read_buf(ctx, REG_VND_IDL, ver, ARRAY_SIZE(ver)); |
| 2118 | 2044 | ret = sii8620_clear_error(ctx); |
| @@ -2268,17 +2194,43 @@ static void sii8620_detach(struct drm_bridge *bridge) · 149 unmodified lines | ||
| 2268 | 2194 | rc_unregister_device(ctx->rc_dev); |
| 2269 | 2195 | } |
| 2270 | 2196 | |
| 2197 | +static int sii8620_is_packing_required(struct sii8620 *ctx, | |
| 2198 | + const struct drm_display_mode *mode) | |
| 2199 | +{ | |
| 2200 | + int max_pclk, max_pclk_pp_mode; | |
| 2201 | + | |
| 2202 | + if (sii8620_is_mhl3(ctx)) { | |
| 2203 | + max_pclk = MHL3_MAX_PCLK; | |
| 2204 | + max_pclk_pp_mode = MHL3_MAX_PCLK_PP_MODE; | |
| 2205 | + } else { | |
| 2206 | + max_pclk = MHL1_MAX_PCLK; | |
| 2207 | + max_pclk_pp_mode = MHL1_MAX_PCLK_PP_MODE; | |
| 2208 | + } | |
| 2209 | + | |
| 2210 | + if (mode->clock < max_pclk) | |
| 2211 | + return 0; | |
| 2212 | + else if (mode->clock < max_pclk_pp_mode) | |
| 2213 | + return 1; | |
| 2214 | + else | |
| 2215 | + return -1; | |
| 2216 | +} | |
| 2217 | + | |
| 2271 | 2218 | static enum drm_mode_status sii8620_mode_valid(struct drm_bridge *bridge, |
| 2272 | 2219 | const struct drm_display_mode *mode) |
| 2273 | 2220 | { |
| 2274 | 2221 | struct sii8620 *ctx = bridge_to_sii8620(bridge); |
| 2222 | + int pack_required = sii8620_is_packing_required(ctx, mode); | |
| 2275 | 2223 | bool can_pack = ctx->devcap[MHL_DCAP_VID_LINK_MODE] & |
| 2276 | 2224 | MHL_DCAP_VID_LINK_PPIXEL; |
| 2277 | − unsigned int max_pclk = sii8620_is_mhl3(ctx) ? MHL3_MAX_LCLK : | |
| 2278 | − MHL1_MAX_LCLK; | |
| 2279 | − max_pclk /= can_pack ? 2 : 3; | |
| 2280 | 2225 | |
| 2281 | − return (mode->clock > max_pclk) ? MODE_CLOCK_HIGH : MODE_OK; | |
| 2226 | + switch (pack_required) { | |
| 2227 | + case 0: | |
| 2228 | + return MODE_OK; | |
| 2229 | + case 1: | |
| 2230 | + return (can_pack) ? MODE_OK : MODE_CLOCK_HIGH; | |
| 2231 | + default: | |
| 2232 | + return MODE_CLOCK_HIGH; | |
| 2233 | + } | |
| 2282 | 2234 | } |
| 2283 | 2235 | |
| 2284 | 2236 | static bool sii8620_mode_fixup(struct drm_bridge *bridge, |
| @@ -2286,43 +2238,16 @@ static bool sii8620_mode_fixup(struct drm_bridge *bridge, · 1 unmodified line | ||
| 2286 | 2238 | struct drm_display_mode *adjusted_mode) |
| 2287 | 2239 | { |
| 2288 | 2240 | struct sii8620 *ctx = bridge_to_sii8620(bridge); |
| 2289 | − int max_lclk; | |
| 2290 | − bool ret = true; | |
| 2291 | 2241 | |
| 2292 | 2242 | mutex_lock(&ctx->lock); |
| 2293 | 2243 | |
| 2294 | − max_lclk = sii8620_is_mhl3(ctx) ? MHL3_MAX_LCLK : MHL1_MAX_LCLK; | |
| 2295 | − if (max_lclk > 3 * adjusted_mode->clock) { | |
| 2296 | − ctx->use_packed_pixel = 0; | |
| 2297 | − goto end; | |
| 2298 | − } | |
| 2299 | − if ((ctx->devcap[MHL_DCAP_VID_LINK_MODE] & MHL_DCAP_VID_LINK_PPIXEL) && | |
| 2300 | − max_lclk > 2 * adjusted_mode->clock) { | |
| 2301 | − ctx->use_packed_pixel = 1; | |
| 2302 | − goto end; | |
| 2303 | − } | |
| 2304 | − ret = false; | |
| 2305 | −end: | |
| 2306 | − if (ret) { | |
| 2307 | − u8 vic = drm_match_cea_mode(adjusted_mode); | |
| 2308 | − | |
| 2309 | − if (!vic) { | |
| 2310 | − union hdmi_infoframe frm; | |
| 2311 | − u8 mhl_vic[] = { 0, 95, 94, 93, 98 }; | |
| 2312 | − | |
| 2313 | − /* FIXME: We need the connector here */ | |
| 2314 | − drm_hdmi_vendor_infoframe_from_display_mode( | |
| 2315 | − &frm.vendor.hdmi, NULL, adjusted_mode); | |
| 2316 | − vic = frm.vendor.hdmi.vic; | |
| 2317 | − if (vic >= ARRAY_SIZE(mhl_vic)) | |
| 2318 | − vic = 0; | |
| 2319 | − vic = mhl_vic[vic]; | |
| 2320 | − } | |
| 2321 | − ctx->video_code = vic; | |
| 2322 | − ctx->pixel_clock = adjusted_mode->clock; | |
| 2323 | − } | |
| 2244 | + 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 | + | |
| 2324 | 2248 | mutex_unlock(&ctx->lock); |
| 2325 | − return ret; | |
| 2249 | + | |
| 2250 | + return true; | |
| 2326 | 2251 | } |
| 2327 | 2252 | |
| 2328 | 2253 | static const struct drm_bridge_funcs sii8620_bridge_funcs = { |
| @@ -369,13 +369,6 @@ EXPORT_SYMBOL(drm_dev_exit); · 368 unmodified lines | ||
| 369 | 369 | */ |
| 370 | 370 | void drm_dev_unplug(struct drm_device *dev) |
| 371 | 371 | { |
| 372 | − drm_dev_unregister(dev); | |
| 373 | − | |
| 374 | − mutex_lock(&drm_global_mutex); | |
| 375 | − if (dev->open_count == 0) | |
| 376 | − drm_dev_put(dev); | |
| 377 | − mutex_unlock(&drm_global_mutex); | |
| 378 | − | |
| 379 | 372 | /* |
| 380 | 373 | * After synchronizing any critical read section is guaranteed to see |
| 381 | 374 | * the new value of ->unplugged, and any critical section which might |
| @@ -384,6 +377,13 @@ void drm_dev_unplug(struct drm_device *dev) · 2 unmodified lines | ||
| 384 | 377 | */ |
| 385 | 378 | dev->unplugged = true; |
| 386 | 379 | synchronize_srcu(&drm_unplug_srcu); |
| 380 | + | |
| 381 | + drm_dev_unregister(dev); | |
| 382 | + | |
| 383 | + mutex_lock(&drm_global_mutex); | |
| 384 | + if (dev->open_count == 0) | |
| 385 | + drm_dev_put(dev); | |
| 386 | + mutex_unlock(&drm_global_mutex); | |
| 387 | 387 | } |
| 388 | 388 | EXPORT_SYMBOL(drm_dev_unplug); |
| 389 | 389 | |
| @@ -2261,9 +2261,6 @@ static inline struct scatterlist *____sg_next(struct scatterlist *sg) · 2260 unmodified lines | ||
| 2261 | 2261 | **/ |
| 2262 | 2262 | static inline struct scatterlist *__sg_next(struct scatterlist *sg) |
| 2263 | 2263 | { |
| 2264 | −#ifdef CONFIG_DEBUG_SG | |
| 2265 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 2266 | −#endif | |
| 2267 | 2264 | return sg_is_last(sg) ? NULL : ____sg_next(sg); |
| 2268 | 2265 | } |
| 2269 | 2266 | |
| @@ -197,8 +197,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) · 196 unmodified lines | ||
| 197 | 197 | priv->io_base = regs; |
| 198 | 198 | |
| 199 | 199 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hhi"); |
| 200 | − if (!res) | |
| 201 | − return -EINVAL; | |
| 200 | + if (!res) { | |
| 201 | + ret = -EINVAL; | |
| 202 | + goto free_drm; | |
| 203 | + } | |
| 202 | 204 | /* Simply ioremap since it may be a shared register zone */ |
| 203 | 205 | regs = devm_ioremap(dev, res->start, resource_size(res)); |
| 204 | 206 | if (!regs) { |
| @@ -215,8 +217,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) · 10 unmodified lines | ||
| 215 | 217 | } |
| 216 | 218 | |
| 217 | 219 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmc"); |
| 218 | − if (!res) | |
| 219 | − return -EINVAL; | |
| 220 | + if (!res) { | |
| 221 | + ret = -EINVAL; | |
| 222 | + goto free_drm; | |
| 223 | + } | |
| 220 | 224 | /* Simply ioremap since it may be a shared register zone */ |
| 221 | 225 | regs = devm_ioremap(dev, res->start, resource_size(res)); |
| 222 | 226 | if (!regs) { |
| @@ -132,7 +132,7 @@ curs507a_new_(const struct nv50_wimm_func *func, struct nouveau_drm *drm, · 131 unmodified lines | ||
| 132 | 132 | |
| 133 | 133 | nvif_object_map(&wndw->wimm.base.user, NULL, 0); |
| 134 | 134 | wndw->immd = func; |
| 135 | − wndw->ctxdma.parent = &disp->core->chan.base.user; | |
| 135 | + wndw->ctxdma.parent = NULL; | |
| 136 | 136 | return 0; |
| 137 | 137 | } |
| 138 | 138 | |
| @@ -444,14 +444,17 @@ nv50_wndw_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state) · 443 unmodified lines | ||
| 444 | 444 | if (ret) |
| 445 | 445 | return ret; |
| 446 | 446 | |
| 447 | − ctxdma = nv50_wndw_ctxdma_new(wndw, fb); | |
| 448 | − if (IS_ERR(ctxdma)) { | |
| 449 | − nouveau_bo_unpin(fb->nvbo); | |
| 450 | − return PTR_ERR(ctxdma); | |
| 447 | + if (wndw->ctxdma.parent) { | |
| 448 | + ctxdma = nv50_wndw_ctxdma_new(wndw, fb); | |
| 449 | + if (IS_ERR(ctxdma)) { | |
| 450 | + nouveau_bo_unpin(fb->nvbo); | |
| 451 | + return PTR_ERR(ctxdma); | |
| 452 | + } | |
| 453 | + | |
| 454 | + asyw->image.handle[0] = ctxdma->object.handle; | |
| 451 | 455 | } |
| 452 | 456 | |
| 453 | 457 | asyw->state.fence = reservation_object_get_excl_rcu(fb->nvbo->bo.resv); |
| 454 | − asyw->image.handle[0] = ctxdma->object.handle; | |
| 455 | 458 | asyw->image.offset[0] = fb->nvbo->bo.offset; |
| 456 | 459 | |
| 457 | 460 | if (wndw->func->prepare) { |
| @@ -623,7 +623,7 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane, · 622 unmodified lines | ||
| 623 | 623 | struct qxl_cursor_cmd *cmd; |
| 624 | 624 | struct qxl_cursor *cursor; |
| 625 | 625 | struct drm_gem_object *obj; |
| 626 | − struct qxl_bo *cursor_bo = NULL, *user_bo = NULL; | |
| 626 | + struct qxl_bo *cursor_bo = NULL, *user_bo = NULL, *old_cursor_bo = NULL; | |
| 627 | 627 | int ret; |
| 628 | 628 | void *user_ptr; |
| 629 | 629 | int size = 64*64*4; |
| @@ -677,7 +677,7 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane, · 47 unmodified lines | ||
| 677 | 677 | cursor_bo, 0); |
| 678 | 678 | cmd->type = QXL_CURSOR_SET; |
| 679 | 679 | |
| 680 | − qxl_bo_unref(&qcrtc->cursor_bo); | |
| 680 | + old_cursor_bo = qcrtc->cursor_bo; | |
| 681 | 681 | qcrtc->cursor_bo = cursor_bo; |
| 682 | 682 | cursor_bo = NULL; |
| 683 | 683 | } else { |
| @@ -697,6 +697,9 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane, · 13 unmodified lines | ||
| 697 | 697 | qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false); |
| 698 | 698 | qxl_release_fence_buffer_objects(release); |
| 699 | 699 | |
| 700 | + if (old_cursor_bo) | |
| 701 | + qxl_bo_unref(&old_cursor_bo); | |
| 702 | + | |
| 700 | 703 | qxl_bo_unref(&cursor_bo); |
| 701 | 704 | |
| 702 | 705 | return; |
| @@ -17,7 +17,6 @@ · 16 unmodified lines | ||
| 17 | 17 | #include <drm/drm_encoder.h> |
| 18 | 18 | #include <drm/drm_modes.h> |
| 19 | 19 | #include <drm/drm_of.h> |
| 20 | −#include <drm/drm_panel.h> | |
| 21 | 20 | |
| 22 | 21 | #include <uapi/drm/drm_mode.h> |
| 23 | 22 | |
| @@ -418,9 +417,6 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon, · 394 unmodified lines | ||
| 418 | 417 | static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon, |
| 419 | 418 | const struct drm_display_mode *mode) |
| 420 | 419 | { |
| 421 | − struct drm_panel *panel = tcon->panel; | |
| 422 | − struct drm_connector *connector = panel->connector; | |
| 423 | − struct drm_display_info display_info = connector->display_info; | |
| 424 | 420 | unsigned int bp, hsync, vsync; |
| 425 | 421 | u8 clk_delay; |
| 426 | 422 | u32 val = 0; |
| @@ -478,27 +474,6 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon, · 51 unmodified lines | ||
| 478 | 474 | if (mode->flags & DRM_MODE_FLAG_PVSYNC) |
| 479 | 475 | val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE; |
| 480 | 476 | |
| 481 | − /* | |
| 482 | − * On A20 and similar SoCs, the only way to achieve Positive Edge | |
| 483 | − * (Rising Edge), is setting dclk clock phase to 2/3(240°). | |
| 484 | − * By default TCON works in Negative Edge(Falling Edge), | |
| 485 | − * this is why phase is set to 0 in that case. | |
| 486 | − * Unfortunately there's no way to logically invert dclk through | |
| 487 | − * IO_POL register. | |
| 488 | − * The only acceptable way to work, triple checked with scope, | |
| 489 | − * is using clock phase set to 0° for Negative Edge and set to 240° | |
| 490 | − * for Positive Edge. | |
| 491 | − * On A33 and similar SoCs there would be a 90° phase option, | |
| 492 | − * but it divides also dclk by 2. | |
| 493 | − * Following code is a way to avoid quirks all around TCON | |
| 494 | − * and DOTCLOCK drivers. | |
| 495 | − */ | |
| 496 | − if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE) | |
| 497 | − clk_set_phase(tcon->dclk, 240); | |
| 498 | − | |
| 499 | − if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE) | |
| 500 | − clk_set_phase(tcon->dclk, 0); | |
| 501 | − | |
| 502 | 477 | regmap_update_bits(tcon->regs, SUN4I_TCON0_IO_POL_REG, |
| 503 | 478 | SUN4I_TCON0_IO_POL_HSYNC_POSITIVE | SUN4I_TCON0_IO_POL_VSYNC_POSITIVE, |
| 504 | 479 | val); |
| @@ -124,6 +124,8 @@ static const struct hid_device_id hammer_devices[] = { · 123 unmodified lines | ||
| 124 | 124 | USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_STAFF) }, |
| 125 | 125 | { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, |
| 126 | 126 | USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_WAND) }, |
| 127 | + { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, | |
| 128 | + USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_WHISKERS) }, | |
| 127 | 129 | { } |
| 128 | 130 | }; |
| 129 | 131 | MODULE_DEVICE_TABLE(hid, hammer_devices); |
| @@ -452,6 +452,7 @@ · 451 unmodified lines | ||
| 452 | 452 | #define USB_DEVICE_ID_GOOGLE_TOUCH_ROSE 0x5028 |
| 453 | 453 | #define USB_DEVICE_ID_GOOGLE_STAFF 0x502b |
| 454 | 454 | #define USB_DEVICE_ID_GOOGLE_WAND 0x502d |
| 455 | +#define USB_DEVICE_ID_GOOGLE_WHISKERS 0x5030 | |
| 455 | 456 | |
| 456 | 457 | #define USB_VENDOR_ID_GOTOP 0x08f2 |
| 457 | 458 | #define USB_DEVICE_ID_SUPER_Q2 0x007f |
| @@ -573,7 +573,7 @@ static bool steam_is_valve_interface(struct hid_device *hdev) · 572 unmodified lines | ||
| 573 | 573 | |
| 574 | 574 | static int steam_client_ll_parse(struct hid_device *hdev) |
| 575 | 575 | { |
| 576 | − struct steam_device *steam = hid_get_drvdata(hdev); | |
| 576 | + struct steam_device *steam = hdev->driver_data; | |
| 577 | 577 | |
| 578 | 578 | return hid_parse_report(hdev, steam->hdev->dev_rdesc, |
| 579 | 579 | steam->hdev->dev_rsize); |
| @@ -590,7 +590,7 @@ static void steam_client_ll_stop(struct hid_device *hdev) · 10 unmodified lines | ||
| 590 | 590 | |
| 591 | 591 | static int steam_client_ll_open(struct hid_device *hdev) |
| 592 | 592 | { |
| 593 | − struct steam_device *steam = hid_get_drvdata(hdev); | |
| 593 | + struct steam_device *steam = hdev->driver_data; | |
| 594 | 594 | int ret; |
| 595 | 595 | |
| 596 | 596 | ret = hid_hw_open(steam->hdev); |
| @@ -605,7 +605,7 @@ static int steam_client_ll_open(struct hid_device *hdev) · 8 unmodified lines | ||
| 605 | 605 | |
| 606 | 606 | static void steam_client_ll_close(struct hid_device *hdev) |
| 607 | 607 | { |
| 608 | − struct steam_device *steam = hid_get_drvdata(hdev); | |
| 608 | + struct steam_device *steam = hdev->driver_data; | |
| 609 | 609 | |
| 610 | 610 | mutex_lock(&steam->mutex); |
| 611 | 611 | steam->client_opened = false; |
| @@ -623,7 +623,7 @@ static int steam_client_ll_raw_request(struct hid_device *hdev, · 11 unmodified lines | ||
| 623 | 623 | size_t count, unsigned char report_type, |
| 624 | 624 | int reqtype) |
| 625 | 625 | { |
| 626 | − struct steam_device *steam = hid_get_drvdata(hdev); | |
| 626 | + struct steam_device *steam = hdev->driver_data; | |
| 627 | 627 | |
| 628 | 628 | return hid_hw_raw_request(steam->hdev, reportnum, buf, count, |
| 629 | 629 | report_type, reqtype); |
| @@ -710,7 +710,7 @@ static int steam_probe(struct hid_device *hdev, · 80 unmodified lines | ||
| 710 | 710 | ret = PTR_ERR(steam->client_hdev); |
| 711 | 711 | goto client_hdev_fail; |
| 712 | 712 | } |
| 713 | − hid_set_drvdata(steam->client_hdev, steam); | |
| 713 | + steam->client_hdev->driver_data = steam; | |
| 714 | 714 | |
| 715 | 715 | /* |
| 716 | 716 | * With the real steam controller interface, do not connect hidraw. |
| @@ -205,8 +205,7 @@ static void ish_remove(struct pci_dev *pdev) · 204 unmodified lines | ||
| 205 | 205 | kfree(ishtp_dev); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | −#ifdef CONFIG_PM | |
| 209 | −static struct device *ish_resume_device; | |
| 208 | +static struct device __maybe_unused *ish_resume_device; | |
| 210 | 209 | |
| 211 | 210 | /* 50ms to get resume response */ |
| 212 | 211 | #define WAIT_FOR_RESUME_ACK_MS 50 |
| @@ -220,7 +219,7 @@ static struct device *ish_resume_device; · 7 unmodified lines | ||
| 220 | 219 | * in that case a simple resume message is enough, others we need |
| 221 | 220 | * a reset sequence. |
| 222 | 221 | */ |
| 223 | −static void ish_resume_handler(struct work_struct *work) | |
| 222 | +static void __maybe_unused ish_resume_handler(struct work_struct *work) | |
| 224 | 223 | { |
| 225 | 224 | struct pci_dev *pdev = to_pci_dev(ish_resume_device); |
| 226 | 225 | struct ishtp_device *dev = pci_get_drvdata(pdev); |
| @@ -262,7 +261,7 @@ static void ish_resume_handler(struct work_struct *work) · 35 unmodified lines | ||
| 262 | 261 | * |
| 263 | 262 | * Return: 0 to the pm core |
| 264 | 263 | */ |
| 265 | −static int ish_suspend(struct device *device) | |
| 264 | +static int __maybe_unused ish_suspend(struct device *device) | |
| 266 | 265 | { |
| 267 | 266 | struct pci_dev *pdev = to_pci_dev(device); |
| 268 | 267 | struct ishtp_device *dev = pci_get_drvdata(pdev); |
| @@ -288,7 +287,7 @@ static int ish_suspend(struct device *device) · 19 unmodified lines | ||
| 288 | 287 | return 0; |
| 289 | 288 | } |
| 290 | 289 | |
| 291 | −static DECLARE_WORK(resume_work, ish_resume_handler); | |
| 290 | +static __maybe_unused DECLARE_WORK(resume_work, ish_resume_handler); | |
| 292 | 291 | /** |
| 293 | 292 | * ish_resume() - ISH resume callback |
| 294 | 293 | * @device: device pointer |
| @@ -297,7 +296,7 @@ static DECLARE_WORK(resume_work, ish_resume_handler); · 2 unmodified lines | ||
| 297 | 296 | * |
| 298 | 297 | * Return: 0 to the pm core |
| 299 | 298 | */ |
| 300 | −static int ish_resume(struct device *device) | |
| 299 | +static int __maybe_unused ish_resume(struct device *device) | |
| 301 | 300 | { |
| 302 | 301 | struct pci_dev *pdev = to_pci_dev(device); |
| 303 | 302 | struct ishtp_device *dev = pci_get_drvdata(pdev); |
| @@ -311,21 +310,14 @@ static int ish_resume(struct device *device) · 7 unmodified lines | ||
| 311 | 310 | return 0; |
| 312 | 311 | } |
| 313 | 312 | |
| 314 | −static const struct dev_pm_ops ish_pm_ops = { | |
| 315 | − .suspend = ish_suspend, | |
| 316 | − .resume = ish_resume, | |
| 317 | −}; | |
| 318 | −#define ISHTP_ISH_PM_OPS (&ish_pm_ops) | |
| 319 | −#else | |
| 320 | −#define ISHTP_ISH_PM_OPS NULL | |
| 321 | −#endif /* CONFIG_PM */ | |
| 313 | +static SIMPLE_DEV_PM_OPS(ish_pm_ops, ish_suspend, ish_resume); | |
| 322 | 314 | |
| 323 | 315 | static struct pci_driver ish_driver = { |
| 324 | 316 | .name = KBUILD_MODNAME, |
| 325 | 317 | .id_table = ish_pci_tbl, |
| 326 | 318 | .probe = ish_probe, |
| 327 | 319 | .remove = ish_remove, |
| 328 | − .driver.pm = ISHTP_ISH_PM_OPS, | |
| 320 | + .driver.pm = &ish_pm_ops, | |
| 329 | 321 | }; |
| 330 | 322 | |
| 331 | 323 | module_pci_driver(ish_driver); |
| @@ -395,6 +395,14 @@ static void wacom_usage_mapping(struct hid_device *hdev, · 394 unmodified lines | ||
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | + /* 2nd-generation Intuos Pro Large has incorrect Y maximum */ | |
| 399 | + if (hdev->vendor == USB_VENDOR_ID_WACOM && | |
| 400 | + hdev->product == 0x0358 && | |
| 401 | + WACOM_PEN_FIELD(field) && | |
| 402 | + wacom_equivalent_usage(usage->hid) == HID_GD_Y) { | |
| 403 | + field->logical_maximum = 43200; | |
| 404 | + } | |
| 405 | + | |
| 398 | 406 | switch (usage->hid) { |
| 399 | 407 | case HID_GD_X: |
| 400 | 408 | features->x_max = field->logical_maximum; |
| @@ -1074,6 +1074,13 @@ static struct dmi_system_id i8k_blacklist_fan_support_dmi_table[] __initdata = { · 1073 unmodified lines | ||
| 1074 | 1074 | DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Vostro 3360"), |
| 1075 | 1075 | }, |
| 1076 | 1076 | }, |
| 1077 | + { | |
| 1078 | + .ident = "Dell XPS13 9333", | |
| 1079 | + .matches = { | |
| 1080 | + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | |
| 1081 | + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS13 9333"), | |
| 1082 | + }, | |
| 1083 | + }, | |
| 1077 | 1084 | { } |
| 1078 | 1085 | }; |
| 1079 | 1086 | |
| @@ -4175,7 +4175,7 @@ static int nct6775_probe(struct platform_device *pdev) · 4174 unmodified lines | ||
| 4175 | 4175 | * The temperature is already monitored if the respective bit in <mask> |
| 4176 | 4176 | * is set. |
| 4177 | 4177 | */ |
| 4178 | − for (i = 0; i < 32; i++) { | |
| 4178 | + for (i = 0; i < 31; i++) { | |
| 4179 | 4179 | if (!(data->temp_mask & BIT(i + 1))) |
| 4180 | 4180 | continue; |
| 4181 | 4181 | if (!reg_temp_alternate[i]) |
| @@ -647,10 +647,10 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap, · 646 unmodified lines | ||
| 647 | 647 | if (bit_adap->getscl == NULL) |
| 648 | 648 | adap->quirks = &i2c_bit_quirk_no_clk_stretch; |
| 649 | 649 | |
| 650 | − /* Bring bus to a known state. Looks like STOP if bus is not free yet */ | |
| 651 | − setscl(bit_adap, 1); | |
| 652 | − udelay(bit_adap->udelay); | |
| 653 | − setsda(bit_adap, 1); | |
| 650 | + /* | |
| 651 | + * We tried forcing SCL/SDA to an initial state here. But that caused a | |
| 652 | + * regression, sadly. Check Bugzilla #200045 for details. | |
| 653 | + */ | |
| 654 | 654 | |
| 655 | 655 | ret = add_adapter(adap); |
| 656 | 656 | if (ret < 0) |
| @@ -279,9 +279,9 @@ static int i2c_gpio_probe(struct platform_device *pdev) · 278 unmodified lines | ||
| 279 | 279 | * required for an I2C bus. |
| 280 | 280 | */ |
| 281 | 281 | if (pdata->scl_is_open_drain) |
| 282 | − gflags = GPIOD_OUT_LOW; | |
| 282 | + gflags = GPIOD_OUT_HIGH; | |
| 283 | 283 | else |
| 284 | − gflags = GPIOD_OUT_LOW_OPEN_DRAIN; | |
| 284 | + gflags = GPIOD_OUT_HIGH_OPEN_DRAIN; | |
| 285 | 285 | priv->scl = i2c_gpio_get_desc(dev, "scl", 1, gflags); |
| 286 | 286 | if (IS_ERR(priv->scl)) |
| 287 | 287 | return PTR_ERR(priv->scl); |
| @@ -465,15 +465,18 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, · 464 unmodified lines | ||
| 465 | 465 | |
| 466 | 466 | status = i2c_transfer(adapter, msg, num); |
| 467 | 467 | if (status < 0) |
| 468 | − return status; | |
| 469 | − if (status != num) | |
| 470 | − return -EIO; | |
| 468 | + goto cleanup; | |
| 469 | + if (status != num) { | |
| 470 | + status = -EIO; | |
| 471 | + goto cleanup; | |
| 472 | + } | |
| 473 | + status = 0; | |
| 471 | 474 | |
| 472 | 475 | /* Check PEC if last message is a read */ |
| 473 | 476 | if (i && (msg[num-1].flags & I2C_M_RD)) { |
| 474 | 477 | status = i2c_smbus_check_pec(partial_pec, &msg[num-1]); |
| 475 | 478 | if (status < 0) |
| 476 | − return status; | |
| 479 | + goto cleanup; | |
| 477 | 480 | } |
| 478 | 481 | |
| 479 | 482 | if (read_write == I2C_SMBUS_READ) |
| @@ -499,12 +502,13 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, · 19 unmodified lines | ||
| 499 | 502 | break; |
| 500 | 503 | } |
| 501 | 504 | |
| 505 | +cleanup: | |
| 502 | 506 | if (msg[0].flags & I2C_M_DMA_SAFE) |
| 503 | 507 | kfree(msg[0].buf); |
| 504 | 508 | if (msg[1].flags & I2C_M_DMA_SAFE) |
| 505 | 509 | kfree(msg[1].buf); |
| 506 | 510 | |
| 507 | − return 0; | |
| 511 | + return status; | |
| 508 | 512 | } |
| 509 | 513 | |
| 510 | 514 | /** |
| @@ -1053,7 +1053,7 @@ static irqreturn_t mma8452_interrupt(int irq, void *p) · 1052 unmodified lines | ||
| 1053 | 1053 | if (src < 0) |
| 1054 | 1054 | return IRQ_NONE; |
| 1055 | 1055 | |
| 1056 | − if (!(src & data->chip_info->enabled_events)) | |
| 1056 | + if (!(src & (data->chip_info->enabled_events | MMA8452_INT_DRDY))) | |
| 1057 | 1057 | return IRQ_NONE; |
| 1058 | 1058 | |
| 1059 | 1059 | if (src & MMA8452_INT_DRDY) { |
| @@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, · 958 unmodified lines | ||
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | irq_type = irqd_get_trigger_type(desc); |
| 962 | + if (!irq_type) | |
| 963 | + irq_type = IRQF_TRIGGER_RISING; | |
| 962 | 964 | if (irq_type == IRQF_TRIGGER_RISING) |
| 963 | 965 | st->irq_mask = INV_MPU6050_ACTIVE_HIGH; |
| 964 | 966 | else if (irq_type == IRQF_TRIGGER_FALLING) |
| @@ -582,6 +582,8 @@ static int tsl2772_als_calibrate(struct iio_dev *indio_dev) · 581 unmodified lines | ||
| 582 | 582 | "%s: failed to get lux\n", __func__); |
| 583 | 583 | return lux_val; |
| 584 | 584 | } |
| 585 | + if (lux_val == 0) | |
| 586 | + return -ERANGE; | |
| 585 | 587 | |
| 586 | 588 | ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) / |
| 587 | 589 | lux_val; |
| @@ -415,10 +415,9 @@ static int bmp280_read_humid(struct bmp280_data *data, int *val, int *val2) · 414 unmodified lines | ||
| 415 | 415 | } |
| 416 | 416 | comp_humidity = bmp280_compensate_humidity(data, adc_humidity); |
| 417 | 417 | |
| 418 | − *val = comp_humidity; | |
| 419 | − *val2 = 1024; | |
| 418 | + *val = comp_humidity * 1000 / 1024; | |
| 420 | 419 | |
| 421 | − return IIO_VAL_FRACTIONAL; | |
| 420 | + return IIO_VAL_INT; | |
| 422 | 421 | } |
| 423 | 422 | |
| 424 | 423 | static int bmp280_read_raw(struct iio_dev *indio_dev, |
| @@ -736,10 +736,6 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, · 735 unmodified lines | ||
| 736 | 736 | if (ret) |
| 737 | 737 | return ret; |
| 738 | 738 | |
| 739 | − if (!file->ucontext && | |
| 740 | − (command != IB_USER_VERBS_CMD_GET_CONTEXT || extended)) | |
| 741 | − return -EINVAL; | |
| 742 | − | |
| 743 | 739 | if (extended) { |
| 744 | 740 | if (count < (sizeof(hdr) + sizeof(ex_hdr))) |
| 745 | 741 | return -EINVAL; |
| @@ -759,6 +755,16 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, · 13 unmodified lines | ||
| 759 | 755 | goto out; |
| 760 | 756 | } |
| 761 | 757 | |
| 758 | + /* | |
| 759 | + * Must be after the ib_dev check, as once the RCU clears ib_dev == | |
| 760 | + * NULL means ucontext == NULL | |
| 761 | + */ | |
| 762 | + if (!file->ucontext && | |
| 763 | + (command != IB_USER_VERBS_CMD_GET_CONTEXT || extended)) { | |
| 764 | + ret = -EINVAL; | |
| 765 | + goto out; | |
| 766 | + } | |
| 767 | + | |
| 762 | 768 | if (!verify_command_mask(ib_dev, command, extended)) { |
| 763 | 769 | ret = -EOPNOTSUPP; |
| 764 | 770 | goto out; |
| @@ -1562,11 +1562,12 @@ EXPORT_SYMBOL(ib_destroy_qp); · 1561 unmodified lines | ||
| 1562 | 1562 | |
| 1563 | 1563 | /* Completion queues */ |
| 1564 | 1564 | |
| 1565 | −struct ib_cq *ib_create_cq(struct ib_device *device, | |
| 1566 | − ib_comp_handler comp_handler, | |
| 1567 | − void (*event_handler)(struct ib_event *, void *), | |
| 1568 | − void *cq_context, | |
| 1569 | − const struct ib_cq_init_attr *cq_attr) | |
| 1565 | +struct ib_cq *__ib_create_cq(struct ib_device *device, | |
| 1566 | + ib_comp_handler comp_handler, | |
| 1567 | + void (*event_handler)(struct ib_event *, void *), | |
| 1568 | + void *cq_context, | |
| 1569 | + const struct ib_cq_init_attr *cq_attr, | |
| 1570 | + const char *caller) | |
| 1570 | 1571 | { |
| 1571 | 1572 | struct ib_cq *cq; |
| 1572 | 1573 | |
| @@ -1580,12 +1581,13 @@ struct ib_cq *ib_create_cq(struct ib_device *device, · 7 unmodified lines | ||
| 1580 | 1581 | cq->cq_context = cq_context; |
| 1581 | 1582 | atomic_set(&cq->usecnt, 0); |
| 1582 | 1583 | cq->res.type = RDMA_RESTRACK_CQ; |
| 1584 | + cq->res.kern_name = caller; | |
| 1583 | 1585 | rdma_restrack_add(&cq->res); |
| 1584 | 1586 | } |
| 1585 | 1587 | |
| 1586 | 1588 | return cq; |
| 1587 | 1589 | } |
| 1588 | −EXPORT_SYMBOL(ib_create_cq); | |
| 1590 | +EXPORT_SYMBOL(__ib_create_cq); | |
| 1589 | 1591 | |
| 1590 | 1592 | int rdma_set_cq_moderation(struct ib_cq *cq, u16 cq_count, u16 cq_period) |
| 1591 | 1593 | { |
| @@ -486,8 +486,11 @@ int mlx4_ib_rereg_user_mr(struct ib_mr *mr, int flags, · 485 unmodified lines | ||
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | if (flags & IB_MR_REREG_ACCESS) { |
| 489 | − if (ib_access_writable(mr_access_flags) && !mmr->umem->writable) | |
| 490 | − return -EPERM; | |
| 489 | + if (ib_access_writable(mr_access_flags) && | |
| 490 | + !mmr->umem->writable) { | |
| 491 | + err = -EPERM; | |
| 492 | + goto release_mpt_entry; | |
| 493 | + } | |
| 491 | 494 | |
| 492 | 495 | err = mlx4_mr_hw_change_access(dev->dev, *pmpt_entry, |
| 493 | 496 | convert_access(mr_access_flags)); |
| @@ -3199,8 +3199,8 @@ static int flow_counters_set_data(struct ib_counters *ibcounters, · 3198 unmodified lines | ||
| 3199 | 3199 | if (!mcounters->hw_cntrs_hndl) { |
| 3200 | 3200 | mcounters->hw_cntrs_hndl = mlx5_fc_create( |
| 3201 | 3201 | to_mdev(ibcounters->device)->mdev, false); |
| 3202 | − if (!mcounters->hw_cntrs_hndl) { | |
| 3203 | − ret = -ENOMEM; | |
| 3202 | + if (IS_ERR(mcounters->hw_cntrs_hndl)) { | |
| 3203 | + ret = PTR_ERR(mcounters->hw_cntrs_hndl); | |
| 3204 | 3204 | goto free; |
| 3205 | 3205 | } |
| 3206 | 3206 | hw_hndl = true; |
| @@ -3546,29 +3546,35 @@ static struct ib_flow *mlx5_ib_create_flow(struct ib_qp *qp, · 339 unmodified lines | ||
| 3546 | 3546 | return ERR_PTR(-ENOMEM); |
| 3547 | 3547 | |
| 3548 | 3548 | err = ib_copy_from_udata(ucmd, udata, required_ucmd_sz); |
| 3549 | − if (err) { | |
| 3550 | − kfree(ucmd); | |
| 3551 | − return ERR_PTR(err); | |
| 3552 | − } | |
| 3549 | + if (err) | |
| 3550 | + goto free_ucmd; | |
| 3553 | 3551 | } |
| 3554 | 3552 | |
| 3555 | − if (flow_attr->priority > MLX5_IB_FLOW_LAST_PRIO) | |
| 3556 | − return ERR_PTR(-ENOMEM); | |
| 3553 | + if (flow_attr->priority > MLX5_IB_FLOW_LAST_PRIO) { | |
| 3554 | + err = -ENOMEM; | |
| 3555 | + goto free_ucmd; | |
| 3556 | + } | |
| 3557 | 3557 | |
| 3558 | 3558 | if (domain != IB_FLOW_DOMAIN_USER || |
| 3559 | 3559 | flow_attr->port > dev->num_ports || |
| 3560 | 3560 | (flow_attr->flags & ~(IB_FLOW_ATTR_FLAGS_DONT_TRAP | |
| 3561 | − IB_FLOW_ATTR_FLAGS_EGRESS))) | |
| 3562 | − return ERR_PTR(-EINVAL); | |
| 3561 | + IB_FLOW_ATTR_FLAGS_EGRESS))) { | |
| 3562 | + err = -EINVAL; | |
| 3563 | + goto free_ucmd; | |
| 3564 | + } | |
| 3563 | 3565 | |
| 3564 | 3566 | if (is_egress && |
| 3565 | 3567 | (flow_attr->type == IB_FLOW_ATTR_ALL_DEFAULT || |
| 3566 | − flow_attr->type == IB_FLOW_ATTR_MC_DEFAULT)) | |
| 3567 | − return ERR_PTR(-EINVAL); | |
| 3568 | + flow_attr->type == IB_FLOW_ATTR_MC_DEFAULT)) { | |
| 3569 | + err = -EINVAL; | |
| 3570 | + goto free_ucmd; | |
| 3571 | + } | |
| 3568 | 3572 | |
| 3569 | 3573 | dst = kzalloc(sizeof(*dst), GFP_KERNEL); |
| 3570 | − if (!dst) | |
| 3571 | − return ERR_PTR(-ENOMEM); | |
| 3574 | + if (!dst) { | |
| 3575 | + err = -ENOMEM; | |
| 3576 | + goto free_ucmd; | |
| 3577 | + } | |
| 3572 | 3578 | |
| 3573 | 3579 | mutex_lock(&dev->flow_db->lock); |
| 3574 | 3580 | |
| @@ -3637,8 +3643,8 @@ destroy_ft: · 62 unmodified lines | ||
| 3637 | 3643 | unlock: |
| 3638 | 3644 | mutex_unlock(&dev->flow_db->lock); |
| 3639 | 3645 | kfree(dst); |
| 3646 | +free_ucmd: | |
| 3640 | 3647 | kfree(ucmd); |
| 3641 | − kfree(handler); | |
| 3642 | 3648 | return ERR_PTR(err); |
| 3643 | 3649 | } |
| 3644 | 3650 | |
| @@ -1957,6 +1957,9 @@ int qedr_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, · 1956 unmodified lines | ||
| 1957 | 1957 | } |
| 1958 | 1958 | |
| 1959 | 1959 | if (attr_mask & (IB_QP_AV | IB_QP_PATH_MTU)) { |
| 1960 | + if (rdma_protocol_iwarp(&dev->ibdev, 1)) | |
| 1961 | + return -EINVAL; | |
| 1962 | + | |
| 1960 | 1963 | if (attr_mask & IB_QP_PATH_MTU) { |
| 1961 | 1964 | if (attr->path_mtu < IB_MTU_256 || |
| 1962 | 1965 | attr->path_mtu > IB_MTU_4096) { |
| @@ -645,6 +645,9 @@ next_wqe: · 644 unmodified lines | ||
| 645 | 645 | } else { |
| 646 | 646 | goto exit; |
| 647 | 647 | } |
| 648 | + if ((wqe->wr.send_flags & IB_SEND_SIGNALED) || | |
| 649 | + qp->sq_sig_type == IB_SIGNAL_ALL_WR) | |
| 650 | + rxe_run_task(&qp->comp.task, 1); | |
| 648 | 651 | qp->req.wqe_index = next_index(qp->sq.queue, |
| 649 | 652 | qp->req.wqe_index); |
| 650 | 653 | goto next_wqe; |
| @@ -709,6 +712,7 @@ next_wqe: · 58 unmodified lines | ||
| 709 | 712 | |
| 710 | 713 | if (fill_packet(qp, wqe, &pkt, skb, payload)) { |
| 711 | 714 | pr_debug("qp#%d Error during fill packet\n", qp_num(qp)); |
| 715 | + kfree_skb(skb); | |
| 712 | 716 | goto err; |
| 713 | 717 | } |
| 714 | 718 | |
| @@ -740,7 +744,6 @@ next_wqe: · 25 unmodified lines | ||
| 740 | 744 | goto next_wqe; |
| 741 | 745 | |
| 742 | 746 | err: |
| 743 | − kfree_skb(skb); | |
| 744 | 747 | wqe->status = IB_WC_LOC_PROT_ERR; |
| 745 | 748 | wqe->state = wqe_state_error; |
| 746 | 749 | __rxe_do_task(&qp->comp.task); |
| @@ -131,8 +131,10 @@ EXPORT_SYMBOL(input_mt_destroy_slots); · 130 unmodified lines | ||
| 131 | 131 | * inactive, or if the tool type is changed, a new tracking id is |
| 132 | 132 | * assigned to the slot. The tool type is only reported if the |
| 133 | 133 | * corresponding absbit field is set. |
| 134 | + * | |
| 135 | + * Returns true if contact is active. | |
| 134 | 136 | */ |
| 135 | −void input_mt_report_slot_state(struct input_dev *dev, | |
| 137 | +bool input_mt_report_slot_state(struct input_dev *dev, | |
| 136 | 138 | unsigned int tool_type, bool active) |
| 137 | 139 | { |
| 138 | 140 | struct input_mt *mt = dev->mt; |
| @@ -140,22 +142,24 @@ void input_mt_report_slot_state(struct input_dev *dev, · 1 unmodified line | ||
| 140 | 142 | int id; |
| 141 | 143 | |
| 142 | 144 | if (!mt) |
| 143 | − return; | |
| 145 | + return false; | |
| 144 | 146 | |
| 145 | 147 | slot = &mt->slots[mt->slot]; |
| 146 | 148 | slot->frame = mt->frame; |
| 147 | 149 | |
| 148 | 150 | if (!active) { |
| 149 | 151 | input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1); |
| 150 | − return; | |
| 152 | + return false; | |
| 151 | 153 | } |
| 152 | 154 | |
| 153 | 155 | id = input_mt_get_value(slot, ABS_MT_TRACKING_ID); |
| 154 | − if (id < 0 || input_mt_get_value(slot, ABS_MT_TOOL_TYPE) != tool_type) | |
| 156 | + if (id < 0) | |
| 155 | 157 | id = input_mt_new_trkid(mt); |
| 156 | 158 | |
| 157 | 159 | input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, id); |
| 158 | 160 | input_event(dev, EV_ABS, ABS_MT_TOOL_TYPE, tool_type); |
| 161 | + | |
| 162 | + return true; | |
| 159 | 163 | } |
| 160 | 164 | EXPORT_SYMBOL(input_mt_report_slot_state); |
| 161 | 165 | |
| @@ -125,7 +125,7 @@ static const struct xpad_device { · 124 unmodified lines | ||
| 125 | 125 | u8 mapping; |
| 126 | 126 | u8 xtype; |
| 127 | 127 | } xpad_device[] = { |
| 128 | − { 0x0079, 0x18d4, "GPD Win 2 Controller", 0, XTYPE_XBOX360 }, | |
| 128 | + { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 }, | |
| 129 | 129 | { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX }, |
| 130 | 130 | { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX }, |
| 131 | 131 | { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX }, |
| @@ -45,7 +45,7 @@ struct event_dev { · 44 unmodified lines | ||
| 45 | 45 | static irqreturn_t events_interrupt(int irq, void *dev_id) |
| 46 | 46 | { |
| 47 | 47 | struct event_dev *edev = dev_id; |
| 48 | − unsigned type, code, value; | |
| 48 | + unsigned int type, code, value; | |
| 49 | 49 | |
| 50 | 50 | type = __raw_readl(edev->addr + REG_READ); |
| 51 | 51 | code = __raw_readl(edev->addr + REG_READ); |
| @@ -57,7 +57,7 @@ static irqreturn_t events_interrupt(int irq, void *dev_id) · 5 unmodified lines | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static void events_import_bits(struct event_dev *edev, |
| 60 | − unsigned long bits[], unsigned type, size_t count) | |
| 60 | + unsigned long bits[], unsigned int type, size_t count) | |
| 61 | 61 | { |
| 62 | 62 | void __iomem *addr = edev->addr; |
| 63 | 63 | int i, j; |
| @@ -99,6 +99,7 @@ static void events_import_abs_params(struct event_dev *edev) · 35 unmodified lines | ||
| 99 | 99 | |
| 100 | 100 | for (j = 0; j < ARRAY_SIZE(val); j++) { |
| 101 | 101 | int offset = (i * ARRAY_SIZE(val) + j) * sizeof(u32); |
| 102 | + | |
| 102 | 103 | val[j] = __raw_readl(edev->addr + REG_DATA + offset); |
| 103 | 104 | } |
| 104 | 105 | |
| @@ -112,7 +113,7 @@ static int events_probe(struct platform_device *pdev) · 7 unmodified lines | ||
| 112 | 113 | struct input_dev *input_dev; |
| 113 | 114 | struct event_dev *edev; |
| 114 | 115 | struct resource *res; |
| 115 | − unsigned keymapnamelen; | |
| 116 | + unsigned int keymapnamelen; | |
| 116 | 117 | void __iomem *addr; |
| 117 | 118 | int irq; |
| 118 | 119 | int i; |
| @@ -150,7 +151,7 @@ static int events_probe(struct platform_device *pdev) · 31 unmodified lines | ||
| 150 | 151 | for (i = 0; i < keymapnamelen; i++) |
| 151 | 152 | edev->name[i] = __raw_readb(edev->addr + REG_DATA + i); |
| 152 | 153 | |
| 153 | − pr_debug("events_probe() keymap=%s\n", edev->name); | |
| 154 | + pr_debug("%s: keymap=%s\n", __func__, edev->name); | |
| 154 | 155 | |
| 155 | 156 | input_dev->name = edev->name; |
| 156 | 157 | input_dev->id.bustype = BUS_HOST; |
| @@ -841,4 +841,14 @@ config INPUT_RAVE_SP_PWRBUTTON · 840 unmodified lines | ||
| 841 | 841 | To compile this driver as a module, choose M here: the |
| 842 | 842 | module will be called rave-sp-pwrbutton. |
| 843 | 843 | |
| 844 | +config INPUT_SC27XX_VIBRA | |
| 845 | + tristate "Spreadtrum sc27xx vibrator support" | |
| 846 | + depends on MFD_SC27XX_PMIC || COMPILE_TEST | |
| 847 | + select INPUT_FF_MEMLESS | |
| 848 | + help | |
| 849 | + This option enables support for Spreadtrum sc27xx vibrator driver. | |
| 850 | + | |
| 851 | + To compile this driver as a module, choose M here. The module will | |
| 852 | + be called sc27xx_vibra. | |
| 853 | + | |
| 844 | 854 | endif |
| @@ -66,6 +66,7 @@ obj-$(CONFIG_INPUT_RETU_PWRBUTTON) += retu-pwrbutton.o · 65 unmodified lines | ||
| 66 | 66 | obj-$(CONFIG_INPUT_AXP20X_PEK) += axp20x-pek.o |
| 67 | 67 | obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o |
| 68 | 68 | obj-$(CONFIG_INPUT_RK805_PWRKEY) += rk805-pwrkey.o |
| 69 | +obj-$(CONFIG_INPUT_SC27XX_VIBRA) += sc27xx-vibra.o | |
| 69 | 70 | obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o |
| 70 | 71 | obj-$(CONFIG_INPUT_SIRFSOC_ONKEY) += sirfsoc-onkey.o |
| 71 | 72 | obj-$(CONFIG_INPUT_SOC_BUTTON_ARRAY) += soc_button_array.o |
| @@ -0,0 +1,154 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 2 | +/* | |
| 3 | + * Copyright (C) 2018 Spreadtrum Communications Inc. | |
| 4 | + */ | |
| 5 | + | |
| 6 | +#include <linux/module.h> | |
| 7 | +#include <linux/of_address.h> | |
| 8 | +#include <linux/platform_device.h> | |
| 9 | +#include <linux/regmap.h> | |
| 10 | +#include <linux/input.h> | |
| 11 | +#include <linux/workqueue.h> | |
| 12 | + | |
| 13 | +#define CUR_DRV_CAL_SEL GENMASK(13, 12) | |
| 14 | +#define SLP_LDOVIBR_PD_EN BIT(9) | |
| 15 | +#define LDO_VIBR_PD BIT(8) | |
| 16 | + | |
| 17 | +struct vibra_info { | |
| 18 | + struct input_dev *input_dev; | |
| 19 | + struct work_struct play_work; | |
| 20 | + struct regmap *regmap; | |
| 21 | + u32 base; | |
| 22 | + u32 strength; | |
| 23 | + bool enabled; | |
| 24 | +}; | |
| 25 | + | |
| 26 | +static void sc27xx_vibra_set(struct vibra_info *info, bool on) | |
| 27 | +{ | |
| 28 | + if (on) { | |
| 29 | + regmap_update_bits(info->regmap, info->base, LDO_VIBR_PD, 0); | |
| 30 | + regmap_update_bits(info->regmap, info->base, | |
| 31 | + SLP_LDOVIBR_PD_EN, 0); | |
| 32 | + info->enabled = true; | |
| 33 | + } else { | |
| 34 | + regmap_update_bits(info->regmap, info->base, LDO_VIBR_PD, | |
| 35 | + LDO_VIBR_PD); | |
| 36 | + regmap_update_bits(info->regmap, info->base, | |
| 37 | + SLP_LDOVIBR_PD_EN, SLP_LDOVIBR_PD_EN); | |
| 38 | + info->enabled = false; | |
| 39 | + } | |
| 40 | +} | |
| 41 | + | |
| 42 | +static int sc27xx_vibra_hw_init(struct vibra_info *info) | |
| 43 | +{ | |
| 44 | + return regmap_update_bits(info->regmap, info->base, CUR_DRV_CAL_SEL, 0); | |
| 45 | +} | |
| 46 | + | |
| 47 | +static void sc27xx_vibra_play_work(struct work_struct *work) | |
| 48 | +{ | |
| 49 | + struct vibra_info *info = container_of(work, struct vibra_info, | |
| 50 | + play_work); | |
| 51 | + | |
| 52 | + if (info->strength && !info->enabled) | |
| 53 | + sc27xx_vibra_set(info, true); | |
| 54 | + else if (info->strength == 0 && info->enabled) | |
| 55 | + sc27xx_vibra_set(info, false); | |
| 56 | +} | |
| 57 | + | |
| 58 | +static int sc27xx_vibra_play(struct input_dev *input, void *data, | |
| 59 | + struct ff_effect *effect) | |
| 60 | +{ | |
| 61 | + struct vibra_info *info = input_get_drvdata(input); | |
| 62 | + | |
| 63 | + info->strength = effect->u.rumble.weak_magnitude; | |
| 64 | + schedule_work(&info->play_work); | |
| 65 | + | |
| 66 | + return 0; | |
| 67 | +} | |
| 68 | + | |
| 69 | +static void sc27xx_vibra_close(struct input_dev *input) | |
| 70 | +{ | |
| 71 | + struct vibra_info *info = input_get_drvdata(input); | |
| 72 | + | |
| 73 | + cancel_work_sync(&info->play_work); | |
| 74 | + if (info->enabled) | |
| 75 | + sc27xx_vibra_set(info, false); | |
| 76 | +} | |
| 77 | + | |
| 78 | +static int sc27xx_vibra_probe(struct platform_device *pdev) | |
| 79 | +{ | |
| 80 | + struct vibra_info *info; | |
| 81 | + int error; | |
| 82 | + | |
| 83 | + info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); | |
| 84 | + if (!info) | |
| 85 | + return -ENOMEM; | |
| 86 | + | |
| 87 | + info->regmap = dev_get_regmap(pdev->dev.parent, NULL); | |
| 88 | + if (!info->regmap) { | |
| 89 | + dev_err(&pdev->dev, "failed to get vibrator regmap.\n"); | |
| 90 | + return -ENODEV; | |
| 91 | + } | |
| 92 | + | |
| 93 | + error = device_property_read_u32(&pdev->dev, "reg", &info->base); | |
| 94 | + if (error) { | |
| 95 | + dev_err(&pdev->dev, "failed to get vibrator base address.\n"); | |
| 96 | + return error; | |
| 97 | + } | |
| 98 | + | |
| 99 | + info->input_dev = devm_input_allocate_device(&pdev->dev); | |
| 100 | + if (!info->input_dev) { | |
| 101 | + dev_err(&pdev->dev, "failed to allocate input device.\n"); | |
| 102 | + return -ENOMEM; | |
| 103 | + } | |
| 104 | + | |
| 105 | + info->input_dev->name = "sc27xx:vibrator"; | |
| 106 | + info->input_dev->id.version = 0; | |
| 107 | + info->input_dev->close = sc27xx_vibra_close; | |
| 108 | + | |
| 109 | + input_set_drvdata(info->input_dev, info); | |
| 110 | + input_set_capability(info->input_dev, EV_FF, FF_RUMBLE); | |
| 111 | + INIT_WORK(&info->play_work, sc27xx_vibra_play_work); | |
| 112 | + info->enabled = false; | |
| 113 | + | |
| 114 | + error = sc27xx_vibra_hw_init(info); | |
| 115 | + if (error) { | |
| 116 | + dev_err(&pdev->dev, "failed to initialize the vibrator.\n"); | |
| 117 | + return error; | |
| 118 | + } | |
| 119 | + | |
| 120 | + error = input_ff_create_memless(info->input_dev, NULL, | |
| 121 | + sc27xx_vibra_play); | |
| 122 | + if (error) { | |
| 123 | + dev_err(&pdev->dev, "failed to register vibrator to FF.\n"); | |
| 124 | + return error; | |
| 125 | + } | |
| 126 | + | |
| 127 | + error = input_register_device(info->input_dev); | |
| 128 | + if (error) { | |
| 129 | + dev_err(&pdev->dev, "failed to register input device.\n"); | |
| 130 | + return error; | |
| 131 | + } | |
| 132 | + | |
| 133 | + return 0; | |
| 134 | +} | |
| 135 | + | |
| 136 | +static const struct of_device_id sc27xx_vibra_of_match[] = { | |
| 137 | + { .compatible = "sprd,sc2731-vibrator", }, | |
| 138 | + {} | |
| 139 | +}; | |
| 140 | +MODULE_DEVICE_TABLE(of, sc27xx_vibra_of_match); | |
| 141 | + | |
| 142 | +static struct platform_driver sc27xx_vibra_driver = { | |
| 143 | + .driver = { | |
| 144 | + .name = "sc27xx-vibrator", | |
| 145 | + .of_match_table = sc27xx_vibra_of_match, | |
| 146 | + }, | |
| 147 | + .probe = sc27xx_vibra_probe, | |
| 148 | +}; | |
| 149 | + | |
| 150 | +module_platform_driver(sc27xx_vibra_driver); | |
| 151 | + | |
| 152 | +MODULE_DESCRIPTION("Spreadtrum SC27xx Vibrator Driver"); | |
| 153 | +MODULE_LICENSE("GPL v2"); | |
| 154 | +MODULE_AUTHOR("Xiaotong Lu <xiaotong.lu@spreadtrum.com>"); | |
| @@ -27,6 +27,8 @@ · 26 unmodified lines | ||
| 27 | 27 | #define ETP_DISABLE_POWER 0x0001 |
| 28 | 28 | #define ETP_PRESSURE_OFFSET 25 |
| 29 | 29 | |
| 30 | +#define ETP_CALIBRATE_MAX_LEN 3 | |
| 31 | + | |
| 30 | 32 | /* IAP Firmware handling */ |
| 31 | 33 | #define ETP_PRODUCT_ID_FORMAT_STRING "%d.0" |
| 32 | 34 | #define ETP_FW_NAME "elan_i2c_" ETP_PRODUCT_ID_FORMAT_STRING ".bin" |
| @@ -613,7 +613,7 @@ static ssize_t calibrate_store(struct device *dev, · 612 unmodified lines | ||
| 613 | 613 | int tries = 20; |
| 614 | 614 | int retval; |
| 615 | 615 | int error; |
| 616 | − u8 val[3]; | |
| 616 | + u8 val[ETP_CALIBRATE_MAX_LEN]; | |
| 617 | 617 | |
| 618 | 618 | retval = mutex_lock_interruptible(&data->sysfs_mutex); |
| 619 | 619 | if (retval) |
| @@ -1345,6 +1345,7 @@ static const struct acpi_device_id elan_acpi_id[] = { · 725 unmodified lines | ||
| 1345 | 1345 | { "ELAN060C", 0 }, |
| 1346 | 1346 | { "ELAN0611", 0 }, |
| 1347 | 1347 | { "ELAN0612", 0 }, |
| 1348 | + { "ELAN0618", 0 }, | |
| 1348 | 1349 | { "ELAN1000", 0 }, |
| 1349 | 1350 | { } |
| 1350 | 1351 | }; |
| @@ -56,7 +56,7 @@ · 55 unmodified lines | ||
| 56 | 56 | static int elan_smbus_initialize(struct i2c_client *client) |
| 57 | 57 | { |
| 58 | 58 | u8 check[ETP_SMBUS_HELLOPACKET_LEN] = { 0x55, 0x55, 0x55, 0x55, 0x55 }; |
| 59 | − u8 values[ETP_SMBUS_HELLOPACKET_LEN] = { 0, 0, 0, 0, 0 }; | |
| 59 | + u8 values[I2C_SMBUS_BLOCK_MAX] = {0}; | |
| 60 | 60 | int len, error; |
| 61 | 61 | |
| 62 | 62 | /* Get hello packet */ |
| @@ -117,12 +117,16 @@ static int elan_smbus_calibrate(struct i2c_client *client) · 54 unmodified lines | ||
| 117 | 117 | static int elan_smbus_calibrate_result(struct i2c_client *client, u8 *val) |
| 118 | 118 | { |
| 119 | 119 | int error; |
| 120 | + u8 buf[I2C_SMBUS_BLOCK_MAX] = {0}; | |
| 121 | + | |
| 122 | + BUILD_BUG_ON(ETP_CALIBRATE_MAX_LEN > sizeof(buf)); | |
| 120 | 123 | |
| 121 | 124 | error = i2c_smbus_read_block_data(client, |
| 122 | − ETP_SMBUS_CALIBRATE_QUERY, val); | |
| 125 | + ETP_SMBUS_CALIBRATE_QUERY, buf); | |
| 123 | 126 | if (error < 0) |
| 124 | 127 | return error; |
| 125 | 128 | |
| 129 | + memcpy(val, buf, ETP_CALIBRATE_MAX_LEN); | |
| 126 | 130 | return 0; |
| 127 | 131 | } |
| 128 | 132 | |
| @@ -472,6 +476,8 @@ static int elan_smbus_get_report(struct i2c_client *client, u8 *report) · 343 unmodified lines | ||
| 472 | 476 | { |
| 473 | 477 | int len; |
| 474 | 478 | |
| 479 | + BUILD_BUG_ON(I2C_SMBUS_BLOCK_MAX > ETP_SMBUS_REPORT_LEN); | |
| 480 | + | |
| 475 | 481 | len = i2c_smbus_read_block_data(client, |
| 476 | 482 | ETP_SMBUS_PACKET_QUERY, |
| 477 | 483 | &report[ETP_SMBUS_REPORT_OFFSET]); |
| @@ -799,7 +799,7 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) · 798 unmodified lines | ||
| 799 | 799 | else if (ic_version == 7 && etd->info.samples[1] == 0x2A) |
| 800 | 800 | sanity_check = ((packet[3] & 0x1c) == 0x10); |
| 801 | 801 | else |
| 802 | − sanity_check = ((packet[0] & 0x0c) == 0x04 && | |
| 802 | + sanity_check = ((packet[0] & 0x08) == 0x00 && | |
| 803 | 803 | (packet[3] & 0x1c) == 0x10); |
| 804 | 804 | |
| 805 | 805 | if (!sanity_check) |
| @@ -1175,6 +1175,12 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = { · 369 unmodified lines | ||
| 1175 | 1175 | { } |
| 1176 | 1176 | }; |
| 1177 | 1177 | |
| 1178 | +static const char * const middle_button_pnp_ids[] = { | |
| 1179 | + "LEN2131", /* ThinkPad P52 w/ NFC */ | |
| 1180 | + "LEN2132", /* ThinkPad P52 */ | |
| 1181 | + NULL | |
| 1182 | +}; | |
| 1183 | + | |
| 1178 | 1184 | /* |
| 1179 | 1185 | * Set the appropriate event bits for the input subsystem |
| 1180 | 1186 | */ |
| @@ -1194,7 +1200,8 @@ static int elantech_set_input_params(struct psmouse *psmouse) · 13 unmodified lines | ||
| 1194 | 1200 | __clear_bit(EV_REL, dev->evbit); |
| 1195 | 1201 | |
| 1196 | 1202 | __set_bit(BTN_LEFT, dev->keybit); |
| 1197 | − if (dmi_check_system(elantech_dmi_has_middle_button)) | |
| 1203 | + if (dmi_check_system(elantech_dmi_has_middle_button) || | |
| 1204 | + psmouse_matches_pnp_id(psmouse, middle_button_pnp_ids)) | |
| 1198 | 1205 | __set_bit(BTN_MIDDLE, dev->keybit); |
| 1199 | 1206 | __set_bit(BTN_RIGHT, dev->keybit); |
| 1200 | 1207 | |
| @@ -192,8 +192,8 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) · 191 unmodified lines | ||
| 192 | 192 | else |
| 193 | 193 | input_report_rel(dev, REL_WHEEL, -wheel); |
| 194 | 194 | |
| 195 | − input_report_key(dev, BTN_SIDE, BIT(4)); | |
| 196 | − input_report_key(dev, BTN_EXTRA, BIT(5)); | |
| 195 | + input_report_key(dev, BTN_SIDE, packet[3] & BIT(4)); | |
| 196 | + input_report_key(dev, BTN_EXTRA, packet[3] & BIT(5)); | |
| 197 | 197 | break; |
| 198 | 198 | } |
| 199 | 199 | break; |
| @@ -203,13 +203,13 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) · 3 unmodified lines | ||
| 203 | 203 | input_report_rel(dev, REL_WHEEL, -(s8) packet[3]); |
| 204 | 204 | |
| 205 | 205 | /* Extra buttons on Genius NewNet 3D */ |
| 206 | − input_report_key(dev, BTN_SIDE, BIT(6)); | |
| 207 | − input_report_key(dev, BTN_EXTRA, BIT(7)); | |
| 206 | + input_report_key(dev, BTN_SIDE, packet[0] & BIT(6)); | |
| 207 | + input_report_key(dev, BTN_EXTRA, packet[0] & BIT(7)); | |
| 208 | 208 | break; |
| 209 | 209 | |
| 210 | 210 | case PSMOUSE_THINKPS: |
| 211 | 211 | /* Extra button on ThinkingMouse */ |
| 212 | − input_report_key(dev, BTN_EXTRA, BIT(3)); | |
| 212 | + input_report_key(dev, BTN_EXTRA, packet[0] & BIT(3)); | |
| 213 | 213 | |
| 214 | 214 | /* |
| 215 | 215 | * Without this bit of weirdness moving up gives wildly |
| @@ -223,7 +223,7 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) · 7 unmodified lines | ||
| 223 | 223 | * Cortron PS2 Trackball reports SIDE button in the |
| 224 | 224 | * 4th bit of the first byte. |
| 225 | 225 | */ |
| 226 | − input_report_key(dev, BTN_SIDE, BIT(3)); | |
| 226 | + input_report_key(dev, BTN_SIDE, packet[0] & BIT(3)); | |
| 227 | 227 | packet[0] |= BIT(3); |
| 228 | 228 | break; |
| 229 | 229 | |
| @@ -3,6 +3,7 @@ · 2 unmodified lines | ||
| 3 | 3 | # |
| 4 | 4 | config RMI4_CORE |
| 5 | 5 | tristate "Synaptics RMI4 bus support" |
| 6 | + select IRQ_DOMAIN | |
| 6 | 7 | help |
| 7 | 8 | Say Y here if you want to support the Synaptics RMI4 bus. This is |
| 8 | 9 | required for all RMI4 device support. |
| @@ -32,15 +32,15 @@ void rmi_2d_sensor_abs_process(struct rmi_2d_sensor *sensor, · 31 unmodified lines | ||
| 32 | 32 | if (obj->type == RMI_2D_OBJECT_NONE) |
| 33 | 33 | return; |
| 34 | 34 | |
| 35 | − if (axis_align->swap_axes) | |
| 36 | − swap(obj->x, obj->y); | |
| 37 | − | |
| 38 | 35 | if (axis_align->flip_x) |
| 39 | 36 | obj->x = sensor->max_x - obj->x; |
| 40 | 37 | |
| 41 | 38 | if (axis_align->flip_y) |
| 42 | 39 | obj->y = sensor->max_y - obj->y; |
| 43 | 40 | |
| 41 | + if (axis_align->swap_axes) | |
| 42 | + swap(obj->x, obj->y); | |
| 43 | + | |
| 44 | 44 | /* |
| 45 | 45 | * Here checking if X offset or y offset are specified is |
| 46 | 46 | * redundant. We just add the offsets or clip the values. |
| @@ -120,15 +120,15 @@ void rmi_2d_sensor_rel_report(struct rmi_2d_sensor *sensor, int x, int y) · 73 unmodified lines | ||
| 120 | 120 | x = min(RMI_2D_REL_POS_MAX, max(RMI_2D_REL_POS_MIN, (int)x)); |
| 121 | 121 | y = min(RMI_2D_REL_POS_MAX, max(RMI_2D_REL_POS_MIN, (int)y)); |
| 122 | 122 | |
| 123 | − if (axis_align->swap_axes) | |
| 124 | − swap(x, y); | |
| 125 | − | |
| 126 | 123 | if (axis_align->flip_x) |
| 127 | 124 | x = min(RMI_2D_REL_POS_MAX, -x); |
| 128 | 125 | |
| 129 | 126 | if (axis_align->flip_y) |
| 130 | 127 | y = min(RMI_2D_REL_POS_MAX, -y); |
| 131 | 128 | |
| 129 | + if (axis_align->swap_axes) | |
| 130 | + swap(x, y); | |
| 131 | + | |
| 132 | 132 | if (x || y) { |
| 133 | 133 | input_report_rel(sensor->input, REL_X, x); |
| 134 | 134 | input_report_rel(sensor->input, REL_Y, y); |
| @@ -141,17 +141,10 @@ static void rmi_2d_sensor_set_input_params(struct rmi_2d_sensor *sensor) · 6 unmodified lines | ||
| 141 | 141 | struct input_dev *input = sensor->input; |
| 142 | 142 | int res_x; |
| 143 | 143 | int res_y; |
| 144 | + int max_x, max_y; | |
| 144 | 145 | int input_flags = 0; |
| 145 | 146 | |
| 146 | 147 | if (sensor->report_abs) { |
| 147 | − if (sensor->axis_align.swap_axes) { | |
| 148 | − swap(sensor->max_x, sensor->max_y); | |
| 149 | − swap(sensor->axis_align.clip_x_low, | |
| 150 | − sensor->axis_align.clip_y_low); | |
| 151 | − swap(sensor->axis_align.clip_x_high, | |
| 152 | − sensor->axis_align.clip_y_high); | |
| 153 | − } | |
| 154 | − | |
| 155 | 148 | sensor->min_x = sensor->axis_align.clip_x_low; |
| 156 | 149 | if (sensor->axis_align.clip_x_high) |
| 157 | 150 | sensor->max_x = min(sensor->max_x, |
| @@ -163,14 +156,19 @@ static void rmi_2d_sensor_set_input_params(struct rmi_2d_sensor *sensor) · 5 unmodified lines | ||
| 163 | 156 | sensor->axis_align.clip_y_high); |
| 164 | 157 | |
| 165 | 158 | set_bit(EV_ABS, input->evbit); |
| 166 | − input_set_abs_params(input, ABS_MT_POSITION_X, 0, sensor->max_x, | |
| 167 | − 0, 0); | |
| 168 | − input_set_abs_params(input, ABS_MT_POSITION_Y, 0, sensor->max_y, | |
| 169 | − 0, 0); | |
| 159 | + | |
| 160 | + max_x = sensor->max_x; | |
| 161 | + max_y = sensor->max_y; | |
| 162 | + if (sensor->axis_align.swap_axes) | |
| 163 | + swap(max_x, max_y); | |
| 164 | + input_set_abs_params(input, ABS_MT_POSITION_X, 0, max_x, 0, 0); | |
| 165 | + input_set_abs_params(input, ABS_MT_POSITION_Y, 0, max_y, 0, 0); | |
| 170 | 166 | |
| 171 | 167 | if (sensor->x_mm && sensor->y_mm) { |
| 172 | 168 | res_x = (sensor->max_x - sensor->min_x) / sensor->x_mm; |
| 173 | 169 | res_y = (sensor->max_y - sensor->min_y) / sensor->y_mm; |
| 170 | + if (sensor->axis_align.swap_axes) | |
| 171 | + swap(res_x, res_y); | |
| 174 | 172 | |
| 175 | 173 | input_abs_set_res(input, ABS_X, res_x); |
| 176 | 174 | input_abs_set_res(input, ABS_Y, res_y); |
| @@ -9,6 +9,8 @@ · 8 unmodified lines | ||
| 9 | 9 | |
| 10 | 10 | #include <linux/kernel.h> |
| 11 | 11 | #include <linux/device.h> |
| 12 | +#include <linux/irq.h> | |
| 13 | +#include <linux/irqdomain.h> | |
| 12 | 14 | #include <linux/list.h> |
| 13 | 15 | #include <linux/pm.h> |
| 14 | 16 | #include <linux/rmi.h> |
| @@ -167,6 +169,39 @@ static inline void rmi_function_of_probe(struct rmi_function *fn) · 152 unmodified lines | ||
| 167 | 169 | {} |
| 168 | 170 | #endif |
| 169 | 171 | |
| 172 | +static struct irq_chip rmi_irq_chip = { | |
| 173 | + .name = "rmi4", | |
| 174 | +}; | |
| 175 | + | |
| 176 | +static int rmi_create_function_irq(struct rmi_function *fn, | |
| 177 | + struct rmi_function_handler *handler) | |
| 178 | +{ | |
| 179 | + struct rmi_driver_data *drvdata = dev_get_drvdata(&fn->rmi_dev->dev); | |
| 180 | + int i, error; | |
| 181 | + | |
| 182 | + for (i = 0; i < fn->num_of_irqs; i++) { | |
| 183 | + set_bit(fn->irq_pos + i, fn->irq_mask); | |
| 184 | + | |
| 185 | + fn->irq[i] = irq_create_mapping(drvdata->irqdomain, | |
| 186 | + fn->irq_pos + i); | |
| 187 | + | |
| 188 | + irq_set_chip_data(fn->irq[i], fn); | |
| 189 | + irq_set_chip_and_handler(fn->irq[i], &rmi_irq_chip, | |
| 190 | + handle_simple_irq); | |
| 191 | + irq_set_nested_thread(fn->irq[i], 1); | |
| 192 | + | |
| 193 | + error = devm_request_threaded_irq(&fn->dev, fn->irq[i], NULL, | |
| 194 | + handler->attention, IRQF_ONESHOT, | |
| 195 | + dev_name(&fn->dev), fn); | |
| 196 | + if (error) { | |
| 197 | + dev_err(&fn->dev, "Error %d registering IRQ\n", error); | |
| 198 | + return error; | |
| 199 | + } | |
| 200 | + } | |
| 201 | + | |
| 202 | + return 0; | |
| 203 | +} | |
| 204 | + | |
| 170 | 205 | static int rmi_function_probe(struct device *dev) |
| 171 | 206 | { |
| 172 | 207 | struct rmi_function *fn = to_rmi_function(dev); |
| @@ -178,7 +213,14 @@ static int rmi_function_probe(struct device *dev) · 5 unmodified lines | ||
| 178 | 213 | |
| 179 | 214 | if (handler->probe) { |
| 180 | 215 | error = handler->probe(fn); |
| 181 | − return error; | |
| 216 | + if (error) | |
| 217 | + return error; | |
| 218 | + } | |
| 219 | + | |
| 220 | + if (fn->num_of_irqs && handler->attention) { | |
| 221 | + error = rmi_create_function_irq(fn, handler); | |
| 222 | + if (error) | |
| 223 | + return error; | |
| 182 | 224 | } |
| 183 | 225 | |
| 184 | 226 | return 0; |
| @@ -230,12 +272,18 @@ err_put_device: · 45 unmodified lines | ||
| 230 | 272 | |
| 231 | 273 | void rmi_unregister_function(struct rmi_function *fn) |
| 232 | 274 | { |
| 275 | + int i; | |
| 276 | + | |
| 233 | 277 | rmi_dbg(RMI_DEBUG_CORE, &fn->dev, "Unregistering F%02X.\n", |
| 234 | 278 | fn->fd.function_number); |
| 235 | 279 | |
| 236 | 280 | device_del(&fn->dev); |
| 237 | 281 | of_node_put(fn->dev.of_node); |
| 238 | 282 | put_device(&fn->dev); |
| 283 | + | |
| 284 | + for (i = 0; i < fn->num_of_irqs; i++) | |
| 285 | + irq_dispose_mapping(fn->irq[i]); | |
| 286 | + | |
| 239 | 287 | } |
| 240 | 288 | |
| 241 | 289 | /** |
| @@ -14,6 +14,12 @@ · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | struct rmi_device; |
| 16 | 16 | |
| 17 | +/* | |
| 18 | + * The interrupt source count in the function descriptor can represent up to | |
| 19 | + * 6 interrupt sources in the normal manner. | |
| 20 | + */ | |
| 21 | +#define RMI_FN_MAX_IRQS 6 | |
| 22 | + | |
| 17 | 23 | /** |
| 18 | 24 | * struct rmi_function - represents the implementation of an RMI4 |
| 19 | 25 | * function for a particular device (basically, a driver for that RMI4 function) |
| @@ -26,6 +32,7 @@ struct rmi_device; · 6 unmodified lines | ||
| 26 | 32 | * @irq_pos: The position in the irq bitfield this function holds |
| 27 | 33 | * @irq_mask: For convenience, can be used to mask IRQ bits off during ATTN |
| 28 | 34 | * interrupt handling. |
| 35 | + * @irqs: assigned virq numbers (up to num_of_irqs) | |
| 29 | 36 | * |
| 30 | 37 | * @node: entry in device's list of functions |
| 31 | 38 | */ |
| @@ -36,6 +43,7 @@ struct rmi_function { · 4 unmodified lines | ||
| 36 | 43 | struct list_head node; |
| 37 | 44 | |
| 38 | 45 | unsigned int num_of_irqs; |
| 46 | + int irq[RMI_FN_MAX_IRQS]; | |
| 39 | 47 | unsigned int irq_pos; |
| 40 | 48 | unsigned long irq_mask[]; |
| 41 | 49 | }; |
| @@ -76,7 +84,7 @@ struct rmi_function_handler { · 34 unmodified lines | ||
| 76 | 84 | void (*remove)(struct rmi_function *fn); |
| 77 | 85 | int (*config)(struct rmi_function *fn); |
| 78 | 86 | int (*reset)(struct rmi_function *fn); |
| 79 | − int (*attention)(struct rmi_function *fn, unsigned long *irq_bits); | |
| 87 | + irqreturn_t (*attention)(int irq, void *ctx); | |
| 80 | 88 | int (*suspend)(struct rmi_function *fn); |
| 81 | 89 | int (*resume)(struct rmi_function *fn); |
| 82 | 90 | }; |
| @@ -21,6 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #include <linux/pm.h> |
| 22 | 22 | #include <linux/slab.h> |
| 23 | 23 | #include <linux/of.h> |
| 24 | +#include <linux/irqdomain.h> | |
| 24 | 25 | #include <uapi/linux/input.h> |
| 25 | 26 | #include <linux/rmi.h> |
| 26 | 27 | #include "rmi_bus.h" |
| @@ -127,28 +128,11 @@ static int rmi_driver_process_config_requests(struct rmi_device *rmi_dev) · 100 unmodified lines | ||
| 127 | 128 | return 0; |
| 128 | 129 | } |
| 129 | 130 | |
| 130 | −static void process_one_interrupt(struct rmi_driver_data *data, | |
| 131 | − struct rmi_function *fn) | |
| 132 | −{ | |
| 133 | − struct rmi_function_handler *fh; | |
| 134 | − | |
| 135 | − if (!fn || !fn->dev.driver) | |
| 136 | − return; | |
| 137 | − | |
| 138 | − fh = to_rmi_function_handler(fn->dev.driver); | |
| 139 | − if (fh->attention) { | |
| 140 | − bitmap_and(data->fn_irq_bits, data->irq_status, fn->irq_mask, | |
| 141 | − data->irq_count); | |
| 142 | − if (!bitmap_empty(data->fn_irq_bits, data->irq_count)) | |
| 143 | − fh->attention(fn, data->fn_irq_bits); | |
| 144 | − } | |
| 145 | −} | |
| 146 | − | |
| 147 | 131 | static int rmi_process_interrupt_requests(struct rmi_device *rmi_dev) |
| 148 | 132 | { |
| 149 | 133 | struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev); |
| 150 | 134 | struct device *dev = &rmi_dev->dev; |
| 151 | − struct rmi_function *entry; | |
| 135 | + int i; | |
| 152 | 136 | int error; |
| 153 | 137 | |
| 154 | 138 | if (!data) |
| @@ -173,16 +157,8 @@ static int rmi_process_interrupt_requests(struct rmi_device *rmi_dev) · 18 unmodified lines | ||
| 173 | 157 | */ |
| 174 | 158 | mutex_unlock(&data->irq_mutex); |
| 175 | 159 | |
| 176 | − /* | |
| 177 | − * It would be nice to be able to use irq_chip to handle these | |
| 178 | − * nested IRQs. Unfortunately, most of the current customers for | |
| 179 | − * this driver are using older kernels (3.0.x) that don't support | |
| 180 | − * the features required for that. Once they've shifted to more | |
| 181 | − * recent kernels (say, 3.3 and higher), this should be switched to | |
| 182 | − * use irq_chip. | |
| 183 | − */ | |
| 184 | − list_for_each_entry(entry, &data->function_list, node) | |
| 185 | − process_one_interrupt(data, entry); | |
| 160 | + for_each_set_bit(i, data->irq_status, data->irq_count) | |
| 161 | + handle_nested_irq(irq_find_mapping(data->irqdomain, i)); | |
| 186 | 162 | |
| 187 | 163 | if (data->input) |
| 188 | 164 | input_sync(data->input); |
| @@ -1001,9 +977,13 @@ EXPORT_SYMBOL_GPL(rmi_driver_resume); · 812 unmodified lines | ||
| 1001 | 977 | static int rmi_driver_remove(struct device *dev) |
| 1002 | 978 | { |
| 1003 | 979 | struct rmi_device *rmi_dev = to_rmi_device(dev); |
| 980 | + struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev); | |
| 1004 | 981 | |
| 1005 | 982 | rmi_disable_irq(rmi_dev, false); |
| 1006 | 983 | |
| 984 | + irq_domain_remove(data->irqdomain); | |
| 985 | + data->irqdomain = NULL; | |
| 986 | + | |
| 1007 | 987 | rmi_f34_remove_sysfs(rmi_dev); |
| 1008 | 988 | rmi_free_function_list(rmi_dev); |
| 1009 | 989 | |
| @@ -1035,7 +1015,8 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) · 25 unmodified lines | ||
| 1035 | 1015 | { |
| 1036 | 1016 | struct rmi_device *rmi_dev = data->rmi_dev; |
| 1037 | 1017 | struct device *dev = &rmi_dev->dev; |
| 1038 | − int irq_count; | |
| 1018 | + struct fwnode_handle *fwnode = rmi_dev->xport->dev->fwnode; | |
| 1019 | + int irq_count = 0; | |
| 1039 | 1020 | size_t size; |
| 1040 | 1021 | int retval; |
| 1041 | 1022 | |
| @@ -1046,7 +1027,6 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) · 4 unmodified lines | ||
| 1046 | 1027 | * being accessed. |
| 1047 | 1028 | */ |
| 1048 | 1029 | rmi_dbg(RMI_DEBUG_CORE, dev, "%s: Counting IRQs.\n", __func__); |
| 1049 | − irq_count = 0; | |
| 1050 | 1030 | data->bootloader_mode = false; |
| 1051 | 1031 | |
| 1052 | 1032 | retval = rmi_scan_pdt(rmi_dev, &irq_count, rmi_count_irqs); |
| @@ -1058,6 +1038,15 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) · 5 unmodified lines | ||
| 1058 | 1038 | if (data->bootloader_mode) |
| 1059 | 1039 | dev_warn(dev, "Device in bootloader mode.\n"); |
| 1060 | 1040 | |
| 1041 | + /* Allocate and register a linear revmap irq_domain */ | |
| 1042 | + data->irqdomain = irq_domain_create_linear(fwnode, irq_count, | |
| 1043 | + &irq_domain_simple_ops, | |
| 1044 | + data); | |
| 1045 | + if (!data->irqdomain) { | |
| 1046 | + dev_err(&rmi_dev->dev, "Failed to create IRQ domain\n"); | |
| 1047 | + return -ENOMEM; | |
| 1048 | + } | |
| 1049 | + | |
| 1061 | 1050 | data->irq_count = irq_count; |
| 1062 | 1051 | data->num_of_irq_regs = (data->irq_count + 7) / 8; |
| 1063 | 1052 | |
| @@ -1080,10 +1069,9 @@ int rmi_init_functions(struct rmi_driver_data *data) · 16 unmodified lines | ||
| 1080 | 1069 | { |
| 1081 | 1070 | struct rmi_device *rmi_dev = data->rmi_dev; |
| 1082 | 1071 | struct device *dev = &rmi_dev->dev; |
| 1083 | − int irq_count; | |
| 1072 | + int irq_count = 0; | |
| 1084 | 1073 | int retval; |
| 1085 | 1074 | |
| 1086 | − irq_count = 0; | |
| 1087 | 1075 | rmi_dbg(RMI_DEBUG_CORE, dev, "%s: Creating functions.\n", __func__); |
| 1088 | 1076 | retval = rmi_scan_pdt(rmi_dev, &irq_count, rmi_create_function); |
| 1089 | 1077 | if (retval < 0) { |
| @@ -681,9 +681,9 @@ static int rmi_f01_resume(struct rmi_function *fn) · 680 unmodified lines | ||
| 681 | 681 | return 0; |
| 682 | 682 | } |
| 683 | 683 | |
| 684 | −static int rmi_f01_attention(struct rmi_function *fn, | |
| 685 | − unsigned long *irq_bits) | |
| 684 | +static irqreturn_t rmi_f01_attention(int irq, void *ctx) | |
| 686 | 685 | { |
| 686 | + struct rmi_function *fn = ctx; | |
| 687 | 687 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 688 | 688 | int error; |
| 689 | 689 | u8 device_status; |
| @@ -692,7 +692,7 @@ static int rmi_f01_attention(struct rmi_function *fn, · 2 unmodified lines | ||
| 692 | 692 | if (error) { |
| 693 | 693 | dev_err(&fn->dev, |
| 694 | 694 | "Failed to read device status: %d.\n", error); |
| 695 | − return error; | |
| 695 | + return IRQ_RETVAL(error); | |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | if (RMI_F01_STATUS_BOOTLOADER(device_status)) |
| @@ -704,11 +704,11 @@ static int rmi_f01_attention(struct rmi_function *fn, · 5 unmodified lines | ||
| 704 | 704 | error = rmi_dev->driver->reset_handler(rmi_dev); |
| 705 | 705 | if (error) { |
| 706 | 706 | dev_err(&fn->dev, "Device reset failed: %d\n", error); |
| 707 | − return error; | |
| 707 | + return IRQ_RETVAL(error); | |
| 708 | 708 | } |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | − return 0; | |
| 711 | + return IRQ_HANDLED; | |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | struct rmi_function_handler rmi_f01_handler = { |
| @@ -244,8 +244,9 @@ static int rmi_f03_config(struct rmi_function *fn) · 243 unmodified lines | ||
| 244 | 244 | return 0; |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | −static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits) | |
| 247 | +static irqreturn_t rmi_f03_attention(int irq, void *ctx) | |
| 248 | 248 | { |
| 249 | + struct rmi_function *fn = ctx; | |
| 249 | 250 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 250 | 251 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); |
| 251 | 252 | struct f03_data *f03 = dev_get_drvdata(&fn->dev); |
| @@ -262,7 +263,7 @@ static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits) · 10 unmodified lines | ||
| 262 | 263 | /* First grab the data passed by the transport device */ |
| 263 | 264 | if (drvdata->attn_data.size < ob_len) { |
| 264 | 265 | dev_warn(&fn->dev, "F03 interrupted, but data is missing!\n"); |
| 265 | − return 0; | |
| 266 | + return IRQ_HANDLED; | |
| 266 | 267 | } |
| 267 | 268 | |
| 268 | 269 | memcpy(obs, drvdata->attn_data.data, ob_len); |
| @@ -277,7 +278,7 @@ static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits) · 8 unmodified lines | ||
| 277 | 278 | "%s: Failed to read F03 output buffers: %d\n", |
| 278 | 279 | __func__, error); |
| 279 | 280 | serio_interrupt(f03->serio, 0, SERIO_TIMEOUT); |
| 280 | − return error; | |
| 281 | + return IRQ_RETVAL(error); | |
| 281 | 282 | } |
| 282 | 283 | } |
| 283 | 284 | |
| @@ -303,7 +304,7 @@ static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits) · 19 unmodified lines | ||
| 303 | 304 | serio_interrupt(f03->serio, ob_data, serio_flags); |
| 304 | 305 | } |
| 305 | 306 | |
| 306 | − return 0; | |
| 307 | + return IRQ_HANDLED; | |
| 307 | 308 | } |
| 308 | 309 | |
| 309 | 310 | static void rmi_f03_remove(struct rmi_function *fn) |
| @@ -570,9 +570,7 @@ static inline u8 rmi_f11_parse_finger_state(const u8 *f_state, u8 n_finger) · 569 unmodified lines | ||
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | static void rmi_f11_finger_handler(struct f11_data *f11, |
| 573 | − struct rmi_2d_sensor *sensor, | |
| 574 | − unsigned long *irq_bits, int num_irq_regs, | |
| 575 | − int size) | |
| 573 | + struct rmi_2d_sensor *sensor, int size) | |
| 576 | 574 | { |
| 577 | 575 | const u8 *f_state = f11->data.f_state; |
| 578 | 576 | u8 finger_state; |
| @@ -581,12 +579,7 @@ static void rmi_f11_finger_handler(struct f11_data *f11, · 2 unmodified lines | ||
| 581 | 579 | int rel_fingers; |
| 582 | 580 | int abs_size = sensor->nbr_fingers * RMI_F11_ABS_BYTES; |
| 583 | 581 | |
| 584 | − int abs_bits = bitmap_and(f11->result_bits, irq_bits, f11->abs_mask, | |
| 585 | − num_irq_regs * 8); | |
| 586 | − int rel_bits = bitmap_and(f11->result_bits, irq_bits, f11->rel_mask, | |
| 587 | − num_irq_regs * 8); | |
| 588 | − | |
| 589 | − if (abs_bits) { | |
| 582 | + if (sensor->report_abs) { | |
| 590 | 583 | if (abs_size > size) |
| 591 | 584 | abs_fingers = size / RMI_F11_ABS_BYTES; |
| 592 | 585 | else |
| @@ -604,19 +597,7 @@ static void rmi_f11_finger_handler(struct f11_data *f11, · 11 unmodified lines | ||
| 604 | 597 | rmi_f11_abs_pos_process(f11, sensor, &sensor->objs[i], |
| 605 | 598 | finger_state, i); |
| 606 | 599 | } |
| 607 | − } | |
| 608 | 600 | |
| 609 | − if (rel_bits) { | |
| 610 | − if ((abs_size + sensor->nbr_fingers * RMI_F11_REL_BYTES) > size) | |
| 611 | − rel_fingers = (size - abs_size) / RMI_F11_REL_BYTES; | |
| 612 | − else | |
| 613 | − rel_fingers = sensor->nbr_fingers; | |
| 614 | − | |
| 615 | − for (i = 0; i < rel_fingers; i++) | |
| 616 | − rmi_f11_rel_pos_report(f11, i); | |
| 617 | − } | |
| 618 | − | |
| 619 | − if (abs_bits) { | |
| 620 | 601 | /* |
| 621 | 602 | * the absolute part is made in 2 parts to allow the kernel |
| 622 | 603 | * tracking to take place. |
| @@ -638,7 +619,16 @@ static void rmi_f11_finger_handler(struct f11_data *f11, · 15 unmodified lines | ||
| 638 | 619 | } |
| 639 | 620 | |
| 640 | 621 | input_mt_sync_frame(sensor->input); |
| 622 | + } else if (sensor->report_rel) { | |
| 623 | + if ((abs_size + sensor->nbr_fingers * RMI_F11_REL_BYTES) > size) | |
| 624 | + rel_fingers = (size - abs_size) / RMI_F11_REL_BYTES; | |
| 625 | + else | |
| 626 | + rel_fingers = sensor->nbr_fingers; | |
| 627 | + | |
| 628 | + for (i = 0; i < rel_fingers; i++) | |
| 629 | + rmi_f11_rel_pos_report(f11, i); | |
| 641 | 630 | } |
| 631 | + | |
| 642 | 632 | } |
| 643 | 633 | |
| 644 | 634 | static int f11_2d_construct_data(struct f11_data *f11) |
| @@ -1276,8 +1266,9 @@ static int rmi_f11_config(struct rmi_function *fn) · 631 unmodified lines | ||
| 1276 | 1266 | return 0; |
| 1277 | 1267 | } |
| 1278 | 1268 | |
| 1279 | −static int rmi_f11_attention(struct rmi_function *fn, unsigned long *irq_bits) | |
| 1269 | +static irqreturn_t rmi_f11_attention(int irq, void *ctx) | |
| 1280 | 1270 | { |
| 1271 | + struct rmi_function *fn = ctx; | |
| 1281 | 1272 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 1282 | 1273 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); |
| 1283 | 1274 | struct f11_data *f11 = dev_get_drvdata(&fn->dev); |
| @@ -1303,13 +1294,12 @@ static int rmi_f11_attention(struct rmi_function *fn, unsigned long *irq_bits) · 19 unmodified lines | ||
| 1303 | 1294 | data_base_addr, f11->sensor.data_pkt, |
| 1304 | 1295 | f11->sensor.pkt_size); |
| 1305 | 1296 | if (error < 0) |
| 1306 | − return error; | |
| 1297 | + return IRQ_RETVAL(error); | |
| 1307 | 1298 | } |
| 1308 | 1299 | |
| 1309 | − rmi_f11_finger_handler(f11, &f11->sensor, irq_bits, | |
| 1310 | − drvdata->num_of_irq_regs, valid_bytes); | |
| 1300 | + rmi_f11_finger_handler(f11, &f11->sensor, valid_bytes); | |
| 1311 | 1301 | |
| 1312 | − return 0; | |
| 1302 | + return IRQ_HANDLED; | |
| 1313 | 1303 | } |
| 1314 | 1304 | |
| 1315 | 1305 | static int rmi_f11_resume(struct rmi_function *fn) |
| @@ -197,10 +197,10 @@ static void rmi_f12_process_objects(struct f12_data *f12, u8 *data1, int size) · 196 unmodified lines | ||
| 197 | 197 | rmi_2d_sensor_abs_report(sensor, &sensor->objs[i], i); |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | −static int rmi_f12_attention(struct rmi_function *fn, | |
| 201 | − unsigned long *irq_nr_regs) | |
| 200 | +static irqreturn_t rmi_f12_attention(int irq, void *ctx) | |
| 202 | 201 | { |
| 203 | 202 | int retval; |
| 203 | + struct rmi_function *fn = ctx; | |
| 204 | 204 | struct rmi_device *rmi_dev = fn->rmi_dev; |
| 205 | 205 | struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev); |
| 206 | 206 | struct f12_data *f12 = dev_get_drvdata(&fn->dev); |
| @@ -222,7 +222,7 @@ static int rmi_f12_attention(struct rmi_function *fn, · 15 unmodified lines | ||
| 222 | 222 | if (retval < 0) { |
| 223 | 223 | dev_err(&fn->dev, "Failed to read object data. Code: %d.\n", |
| 224 | 224 | retval); |
| 225 | − return retval; | |
| 225 | + return IRQ_RETVAL(retval); | |
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
| @@ -232,7 +232,7 @@ static int rmi_f12_attention(struct rmi_function *fn, · 3 unmodified lines | ||
| 232 | 232 | |
| 233 | 233 | input_mt_sync_frame(sensor->input); |
| 234 | 234 | |
| 235 | − return 0; | |
| 235 | + return IRQ_HANDLED; | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | static int rmi_f12_write_control_regs(struct rmi_function *fn) |
| @@ -122,8 +122,9 @@ static void rmi_f30_report_button(struct rmi_function *fn, · 121 unmodified lines | ||
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | −static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) | |
| 125 | +static irqreturn_t rmi_f30_attention(int irq, void *ctx) | |
| 126 | 126 | { |
| 127 | + struct rmi_function *fn = ctx; | |
| 127 | 128 | struct f30_data *f30 = dev_get_drvdata(&fn->dev); |
| 128 | 129 | struct rmi_driver_data *drvdata = dev_get_drvdata(&fn->rmi_dev->dev); |
| 129 | 130 | int error; |
| @@ -134,7 +135,7 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) · 4 unmodified lines | ||
| 134 | 135 | if (drvdata->attn_data.size < f30->register_count) { |
| 135 | 136 | dev_warn(&fn->dev, |
| 136 | 137 | "F30 interrupted, but data is missing\n"); |
| 137 | − return 0; | |
| 138 | + return IRQ_HANDLED; | |
| 138 | 139 | } |
| 139 | 140 | memcpy(f30->data_regs, drvdata->attn_data.data, |
| 140 | 141 | f30->register_count); |
| @@ -147,7 +148,7 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) · 6 unmodified lines | ||
| 147 | 148 | dev_err(&fn->dev, |
| 148 | 149 | "%s: Failed to read F30 data registers: %d\n", |
| 149 | 150 | __func__, error); |
| 150 | − return error; | |
| 151 | + return IRQ_RETVAL(error); | |
| 151 | 152 | } |
| 152 | 153 | } |
| 153 | 154 | |
| @@ -159,7 +160,7 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) · 5 unmodified lines | ||
| 159 | 160 | rmi_f03_commit_buttons(f30->f03); |
| 160 | 161 | } |
| 161 | 162 | |
| 162 | − return 0; | |
| 163 | + return IRQ_HANDLED; | |
| 163 | 164 | } |
| 164 | 165 | |
| 165 | 166 | static int rmi_f30_config(struct rmi_function *fn) |
| @@ -100,8 +100,9 @@ static int rmi_f34_command(struct f34_data *f34, u8 command, · 99 unmodified lines | ||
| 100 | 100 | return 0; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | −static int rmi_f34_attention(struct rmi_function *fn, unsigned long *irq_bits) | |
| 103 | +static irqreturn_t rmi_f34_attention(int irq, void *ctx) | |
| 104 | 104 | { |
| 105 | + struct rmi_function *fn = ctx; | |
| 105 | 106 | struct f34_data *f34 = dev_get_drvdata(&fn->dev); |
| 106 | 107 | int ret; |
| 107 | 108 | u8 status; |
| @@ -126,7 +127,7 @@ static int rmi_f34_attention(struct rmi_function *fn, unsigned long *irq_bits) · 18 unmodified lines | ||
| 126 | 127 | complete(&f34->v7.cmd_done); |
| 127 | 128 | } |
| 128 | 129 | |
| 129 | − return 0; | |
| 130 | + return IRQ_HANDLED; | |
| 130 | 131 | } |
| 131 | 132 | |
| 132 | 133 | static int rmi_f34_write_blocks(struct f34_data *f34, const void *data, |
| @@ -610,11 +610,6 @@ error: · 609 unmodified lines | ||
| 610 | 610 | mutex_unlock(&f54->data_mutex); |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | −static int rmi_f54_attention(struct rmi_function *fn, unsigned long *irqbits) | |
| 614 | −{ | |
| 615 | − return 0; | |
| 616 | −} | |
| 617 | − | |
| 618 | 613 | static int rmi_f54_config(struct rmi_function *fn) |
| 619 | 614 | { |
| 620 | 615 | struct rmi_driver *drv = fn->rmi_dev->driver; |
| @@ -756,6 +751,5 @@ struct rmi_function_handler rmi_f54_handler = { · 135 unmodified lines | ||
| 756 | 751 | .func = 0x54, |
| 757 | 752 | .probe = rmi_f54_probe, |
| 758 | 753 | .config = rmi_f54_config, |
| 759 | − .attention = rmi_f54_attention, | |
| 760 | 754 | .remove = rmi_f54_remove, |
| 761 | 755 | }; |
| @@ -603,6 +603,7 @@ static const struct acpi_device_id silead_ts_acpi_match[] = { · 602 unmodified lines | ||
| 603 | 603 | { "GSL3692", 0 }, |
| 604 | 604 | { "MSSL1680", 0 }, |
| 605 | 605 | { "MSSL0001", 0 }, |
| 606 | + { "MSSL0002", 0 }, | |
| 606 | 607 | { } |
| 607 | 608 | }; |
| 608 | 609 | MODULE_DEVICE_TABLE(acpi, silead_ts_acpi_match); |
| @@ -199,7 +199,7 @@ static int gicv2m_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, · 198 unmodified lines | ||
| 199 | 199 | |
| 200 | 200 | fail: |
| 201 | 201 | irq_domain_free_irqs_parent(domain, virq, nr_irqs); |
| 202 | − gicv2m_unalloc_msi(v2m, hwirq, get_count_order(nr_irqs)); | |
| 202 | + gicv2m_unalloc_msi(v2m, hwirq, nr_irqs); | |
| 203 | 203 | return err; |
| 204 | 204 | } |
| 205 | 205 | |
| @@ -182,6 +182,22 @@ static struct its_collection *dev_event_to_col(struct its_device *its_dev, · 181 unmodified lines | ||
| 182 | 182 | return its->collections + its_dev->event_map.col_map[event]; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | +static struct its_collection *valid_col(struct its_collection *col) | |
| 186 | +{ | |
| 187 | + if (WARN_ON_ONCE(col->target_address & GENMASK_ULL(0, 15))) | |
| 188 | + return NULL; | |
| 189 | + | |
| 190 | + return col; | |
| 191 | +} | |
| 192 | + | |
| 193 | +static struct its_vpe *valid_vpe(struct its_node *its, struct its_vpe *vpe) | |
| 194 | +{ | |
| 195 | + if (valid_col(its->collections + vpe->col_idx)) | |
| 196 | + return vpe; | |
| 197 | + | |
| 198 | + return NULL; | |
| 199 | +} | |
| 200 | + | |
| 185 | 201 | /* |
| 186 | 202 | * ITS command descriptors - parameters to be encoded in a command |
| 187 | 203 | * block. |
| @@ -439,7 +455,7 @@ static struct its_collection *its_build_mapti_cmd(struct its_node *its, · 251 unmodified lines | ||
| 439 | 455 | |
| 440 | 456 | its_fixup_cmd(cmd); |
| 441 | 457 | |
| 442 | − return col; | |
| 458 | + return valid_col(col); | |
| 443 | 459 | } |
| 444 | 460 | |
| 445 | 461 | static struct its_collection *its_build_movi_cmd(struct its_node *its, |
| @@ -458,7 +474,7 @@ static struct its_collection *its_build_movi_cmd(struct its_node *its, · 12 unmodified lines | ||
| 458 | 474 | |
| 459 | 475 | its_fixup_cmd(cmd); |
| 460 | 476 | |
| 461 | − return col; | |
| 477 | + return valid_col(col); | |
| 462 | 478 | } |
| 463 | 479 | |
| 464 | 480 | static struct its_collection *its_build_discard_cmd(struct its_node *its, |
| @@ -476,7 +492,7 @@ static struct its_collection *its_build_discard_cmd(struct its_node *its, · 11 unmodified lines | ||
| 476 | 492 | |
| 477 | 493 | its_fixup_cmd(cmd); |
| 478 | 494 | |
| 479 | − return col; | |
| 495 | + return valid_col(col); | |
| 480 | 496 | } |
| 481 | 497 | |
| 482 | 498 | static struct its_collection *its_build_inv_cmd(struct its_node *its, |
| @@ -494,7 +510,7 @@ static struct its_collection *its_build_inv_cmd(struct its_node *its, · 11 unmodified lines | ||
| 494 | 510 | |
| 495 | 511 | its_fixup_cmd(cmd); |
| 496 | 512 | |
| 497 | − return col; | |
| 513 | + return valid_col(col); | |
| 498 | 514 | } |
| 499 | 515 | |
| 500 | 516 | static struct its_collection *its_build_int_cmd(struct its_node *its, |
| @@ -512,7 +528,7 @@ static struct its_collection *its_build_int_cmd(struct its_node *its, · 11 unmodified lines | ||
| 512 | 528 | |
| 513 | 529 | its_fixup_cmd(cmd); |
| 514 | 530 | |
| 515 | − return col; | |
| 531 | + return valid_col(col); | |
| 516 | 532 | } |
| 517 | 533 | |
| 518 | 534 | static struct its_collection *its_build_clear_cmd(struct its_node *its, |
| @@ -530,7 +546,7 @@ static struct its_collection *its_build_clear_cmd(struct its_node *its, · 11 unmodified lines | ||
| 530 | 546 | |
| 531 | 547 | its_fixup_cmd(cmd); |
| 532 | 548 | |
| 533 | − return col; | |
| 549 | + return valid_col(col); | |
| 534 | 550 | } |
| 535 | 551 | |
| 536 | 552 | static struct its_collection *its_build_invall_cmd(struct its_node *its, |
| @@ -554,7 +570,7 @@ static struct its_vpe *its_build_vinvall_cmd(struct its_node *its, · 17 unmodified lines | ||
| 554 | 570 | |
| 555 | 571 | its_fixup_cmd(cmd); |
| 556 | 572 | |
| 557 | − return desc->its_vinvall_cmd.vpe; | |
| 573 | + return valid_vpe(its, desc->its_vinvall_cmd.vpe); | |
| 558 | 574 | } |
| 559 | 575 | |
| 560 | 576 | static struct its_vpe *its_build_vmapp_cmd(struct its_node *its, |
| @@ -576,7 +592,7 @@ static struct its_vpe *its_build_vmapp_cmd(struct its_node *its, · 15 unmodified lines | ||
| 576 | 592 | |
| 577 | 593 | its_fixup_cmd(cmd); |
| 578 | 594 | |
| 579 | − return desc->its_vmapp_cmd.vpe; | |
| 595 | + return valid_vpe(its, desc->its_vmapp_cmd.vpe); | |
| 580 | 596 | } |
| 581 | 597 | |
| 582 | 598 | static struct its_vpe *its_build_vmapti_cmd(struct its_node *its, |
| @@ -599,7 +615,7 @@ static struct its_vpe *its_build_vmapti_cmd(struct its_node *its, · 16 unmodified lines | ||
| 599 | 615 | |
| 600 | 616 | its_fixup_cmd(cmd); |
| 601 | 617 | |
| 602 | − return desc->its_vmapti_cmd.vpe; | |
| 618 | + return valid_vpe(its, desc->its_vmapti_cmd.vpe); | |
| 603 | 619 | } |
| 604 | 620 | |
| 605 | 621 | static struct its_vpe *its_build_vmovi_cmd(struct its_node *its, |
| @@ -622,7 +638,7 @@ static struct its_vpe *its_build_vmovi_cmd(struct its_node *its, · 16 unmodified lines | ||
| 622 | 638 | |
| 623 | 639 | its_fixup_cmd(cmd); |
| 624 | 640 | |
| 625 | − return desc->its_vmovi_cmd.vpe; | |
| 641 | + return valid_vpe(its, desc->its_vmovi_cmd.vpe); | |
| 626 | 642 | } |
| 627 | 643 | |
| 628 | 644 | static struct its_vpe *its_build_vmovp_cmd(struct its_node *its, |
| @@ -640,7 +656,7 @@ static struct its_vpe *its_build_vmovp_cmd(struct its_node *its, · 11 unmodified lines | ||
| 640 | 656 | |
| 641 | 657 | its_fixup_cmd(cmd); |
| 642 | 658 | |
| 643 | − return desc->its_vmovp_cmd.vpe; | |
| 659 | + return valid_vpe(its, desc->its_vmovp_cmd.vpe); | |
| 644 | 660 | } |
| 645 | 661 | |
| 646 | 662 | static u64 its_cmd_ptr_to_offset(struct its_node *its, |
| @@ -1824,11 +1840,16 @@ static int its_alloc_tables(struct its_node *its) · 1177 unmodified lines | ||
| 1824 | 1840 | |
| 1825 | 1841 | static int its_alloc_collections(struct its_node *its) |
| 1826 | 1842 | { |
| 1843 | + int i; | |
| 1844 | + | |
| 1827 | 1845 | its->collections = kcalloc(nr_cpu_ids, sizeof(*its->collections), |
| 1828 | 1846 | GFP_KERNEL); |
| 1829 | 1847 | if (!its->collections) |
| 1830 | 1848 | return -ENOMEM; |
| 1831 | 1849 | |
| 1850 | + for (i = 0; i < nr_cpu_ids; i++) | |
| 1851 | + its->collections[i].target_address = ~0ULL; | |
| 1852 | + | |
| 1832 | 1853 | return 0; |
| 1833 | 1854 | } |
| 1834 | 1855 | |
| @@ -2310,7 +2331,14 @@ static int its_irq_domain_activate(struct irq_domain *domain, · 475 unmodified lines | ||
| 2310 | 2331 | cpu_mask = cpumask_of_node(its_dev->its->numa_node); |
| 2311 | 2332 | |
| 2312 | 2333 | /* Bind the LPI to the first possible CPU */ |
| 2313 | − cpu = cpumask_first(cpu_mask); | |
| 2334 | + cpu = cpumask_first_and(cpu_mask, cpu_online_mask); | |
| 2335 | + if (cpu >= nr_cpu_ids) { | |
| 2336 | + if (its_dev->its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144) | |
| 2337 | + return -EINVAL; | |
| 2338 | + | |
| 2339 | + cpu = cpumask_first(cpu_online_mask); | |
| 2340 | + } | |
| 2341 | + | |
| 2314 | 2342 | its_dev->event_map.col_map[event] = cpu; |
| 2315 | 2343 | irq_data_update_effective_affinity(d, cpumask_of(cpu)); |
| 2316 | 2344 | |
| @@ -3399,6 +3427,16 @@ static int redist_disable_lpis(void) · 1082 unmodified lines | ||
| 3399 | 3427 | u64 timeout = USEC_PER_SEC; |
| 3400 | 3428 | u64 val; |
| 3401 | 3429 | |
| 3430 | + /* | |
| 3431 | + * If coming via a CPU hotplug event, we don't need to disable | |
| 3432 | + * LPIs before trying to re-enable them. They are already | |
| 3433 | + * configured and all is well in the world. Detect this case | |
| 3434 | + * by checking the allocation of the pending table for the | |
| 3435 | + * current CPU. | |
| 3436 | + */ | |
| 3437 | + if (gic_data_rdist()->pend_page) | |
| 3438 | + return 0; | |
| 3439 | + | |
| 3402 | 3440 | if (!gic_rdists_supports_plpis()) { |
| 3403 | 3441 | pr_info("CPU%d: LPIs not supported\n", smp_processor_id()); |
| 3404 | 3442 | return -ENXIO; |
| @@ -93,8 +93,12 @@ static void ls_scfg_msi_compose_msg(struct irq_data *data, struct msi_msg *msg) · 92 unmodified lines | ||
| 93 | 93 | msg->address_lo = lower_32_bits(msi_data->msiir_addr); |
| 94 | 94 | msg->data = data->hwirq; |
| 95 | 95 | |
| 96 | − if (msi_affinity_flag) | |
| 97 | − msg->data |= cpumask_first(data->common->affinity); | |
| 96 | + if (msi_affinity_flag) { | |
| 97 | + const struct cpumask *mask; | |
| 98 | + | |
| 99 | + mask = irq_data_get_effective_affinity_mask(data); | |
| 100 | + msg->data |= cpumask_first(mask); | |
| 101 | + } | |
| 98 | 102 | |
| 99 | 103 | iommu_dma_map_msi_msg(data->irq, msg); |
| 100 | 104 | } |
| @@ -121,7 +125,7 @@ static int ls_scfg_msi_set_affinity(struct irq_data *irq_data, · 20 unmodified lines | ||
| 121 | 125 | return -EINVAL; |
| 122 | 126 | } |
| 123 | 127 | |
| 124 | − cpumask_copy(irq_data->common->affinity, mask); | |
| 128 | + irq_data_update_effective_affinity(irq_data, cpumask_of(cpu)); | |
| 125 | 129 | |
| 126 | 130 | return IRQ_SET_MASK_OK; |
| 127 | 131 | } |
| @@ -588,7 +588,7 @@ static const struct proto_ops data_sock_ops = { · 587 unmodified lines | ||
| 588 | 588 | .getname = data_sock_getname, |
| 589 | 589 | .sendmsg = mISDN_sock_sendmsg, |
| 590 | 590 | .recvmsg = mISDN_sock_recvmsg, |
| 591 | − .poll_mask = datagram_poll_mask, | |
| 591 | + .poll = datagram_poll, | |
| 592 | 592 | .listen = sock_no_listen, |
| 593 | 593 | .shutdown = sock_no_shutdown, |
| 594 | 594 | .setsockopt = data_sock_setsockopt, |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | |
| 5 | 5 | menuconfig NVM |
| 6 | 6 | bool "Open-Channel SSD target support" |
| 7 | − depends on BLOCK && HAS_DMA && PCI | |
| 7 | + depends on BLOCK && PCI | |
| 8 | 8 | select BLK_DEV_NVME |
| 9 | 9 | help |
| 10 | 10 | Say Y here to get to enable Open-channel SSDs. |
| @@ -588,7 +588,7 @@ static const char *raid10_md_layout_to_format(int layout) · 587 unmodified lines | ||
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | /* Return md raid10 algorithm for @name */ |
| 591 | −static const int raid10_name_to_format(const char *name) | |
| 591 | +static int raid10_name_to_format(const char *name) | |
| 592 | 592 | { |
| 593 | 593 | if (!strcasecmp(name, "near")) |
| 594 | 594 | return ALGORITHM_RAID10_NEAR; |
| @@ -885,9 +885,7 @@ EXPORT_SYMBOL_GPL(dm_table_set_type); · 884 unmodified lines | ||
| 885 | 885 | static int device_supports_dax(struct dm_target *ti, struct dm_dev *dev, |
| 886 | 886 | sector_t start, sector_t len, void *data) |
| 887 | 887 | { |
| 888 | − struct request_queue *q = bdev_get_queue(dev->bdev); | |
| 889 | − | |
| 890 | − return q && blk_queue_dax(q); | |
| 888 | + return bdev_dax_supported(dev->bdev, PAGE_SIZE); | |
| 891 | 889 | } |
| 892 | 890 | |
| 893 | 891 | static bool dm_table_supports_dax(struct dm_table *t) |
| @@ -1907,6 +1905,9 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, · 1013 unmodified lines | ||
| 1907 | 1905 | |
| 1908 | 1906 | if (dm_table_supports_dax(t)) |
| 1909 | 1907 | blk_queue_flag_set(QUEUE_FLAG_DAX, q); |
| 1908 | + else | |
| 1909 | + blk_queue_flag_clear(QUEUE_FLAG_DAX, q); | |
| 1910 | + | |
| 1910 | 1911 | if (dm_table_supports_dax_write_cache(t)) |
| 1911 | 1912 | dax_write_cache(t->md->dax_dev, true); |
| 1912 | 1913 | |
| @@ -776,7 +776,6 @@ static int __write_changed_details(struct dm_pool_metadata *pmd) · 775 unmodified lines | ||
| 776 | 776 | static int __commit_transaction(struct dm_pool_metadata *pmd) |
| 777 | 777 | { |
| 778 | 778 | int r; |
| 779 | − size_t metadata_len, data_len; | |
| 780 | 779 | struct thin_disk_superblock *disk_super; |
| 781 | 780 | struct dm_block *sblock; |
| 782 | 781 | |
| @@ -797,14 +796,6 @@ static int __commit_transaction(struct dm_pool_metadata *pmd) · 14 unmodified lines | ||
| 797 | 796 | if (r < 0) |
| 798 | 797 | return r; |
| 799 | 798 | |
| 800 | − r = dm_sm_root_size(pmd->metadata_sm, &metadata_len); | |
| 801 | − if (r < 0) | |
| 802 | − return r; | |
| 803 | − | |
| 804 | − r = dm_sm_root_size(pmd->data_sm, &data_len); | |
| 805 | − if (r < 0) | |
| 806 | − return r; | |
| 807 | − | |
| 808 | 799 | r = save_sm_roots(pmd); |
| 809 | 800 | if (r < 0) |
| 810 | 801 | return r; |
| @@ -1386,6 +1386,8 @@ static void schedule_external_copy(struct thin_c *tc, dm_block_t virt_block, · 1385 unmodified lines | ||
| 1386 | 1386 | |
| 1387 | 1387 | static void set_pool_mode(struct pool *pool, enum pool_mode new_mode); |
| 1388 | 1388 | |
| 1389 | +static void requeue_bios(struct pool *pool); | |
| 1390 | + | |
| 1389 | 1391 | static void check_for_space(struct pool *pool) |
| 1390 | 1392 | { |
| 1391 | 1393 | int r; |
| @@ -1398,8 +1400,10 @@ static void check_for_space(struct pool *pool) · 6 unmodified lines | ||
| 1398 | 1400 | if (r) |
| 1399 | 1401 | return; |
| 1400 | 1402 | |
| 1401 | − if (nr_free) | |
| 1403 | + if (nr_free) { | |
| 1402 | 1404 | set_pool_mode(pool, PM_WRITE); |
| 1405 | + requeue_bios(pool); | |
| 1406 | + } | |
| 1403 | 1407 | } |
| 1404 | 1408 | |
| 1405 | 1409 | /* |
| @@ -1476,7 +1480,10 @@ static int alloc_data_block(struct thin_c *tc, dm_block_t *result) · 70 unmodified lines | ||
| 1476 | 1480 | |
| 1477 | 1481 | r = dm_pool_alloc_data_block(pool->pmd, result); |
| 1478 | 1482 | if (r) { |
| 1479 | − metadata_operation_failed(pool, "dm_pool_alloc_data_block", r); | |
| 1483 | + if (r == -ENOSPC) | |
| 1484 | + set_pool_mode(pool, PM_OUT_OF_DATA_SPACE); | |
| 1485 | + else | |
| 1486 | + metadata_operation_failed(pool, "dm_pool_alloc_data_block", r); | |
| 1480 | 1487 | return r; |
| 1481 | 1488 | } |
| 1482 | 1489 | |
| @@ -259,7 +259,7 @@ static int persistent_memory_claim(struct dm_writecache *wc) · 258 unmodified lines | ||
| 259 | 259 | if (da != p) { |
| 260 | 260 | long i; |
| 261 | 261 | wc->memory_map = NULL; |
| 262 | − pages = kvmalloc(p * sizeof(struct page *), GFP_KERNEL); | |
| 262 | + pages = kvmalloc_array(p, sizeof(struct page *), GFP_KERNEL); | |
| 263 | 263 | if (!pages) { |
| 264 | 264 | r = -ENOMEM; |
| 265 | 265 | goto err2; |
| @@ -859,7 +859,7 @@ static int writecache_alloc_entries(struct dm_writecache *wc) · 593 unmodified lines | ||
| 859 | 859 | |
| 860 | 860 | if (wc->entries) |
| 861 | 861 | return 0; |
| 862 | − wc->entries = vmalloc(sizeof(struct wc_entry) * wc->n_blocks); | |
| 862 | + wc->entries = vmalloc(array_size(sizeof(struct wc_entry), wc->n_blocks)); | |
| 863 | 863 | if (!wc->entries) |
| 864 | 864 | return -ENOMEM; |
| 865 | 865 | for (b = 0; b < wc->n_blocks; b++) { |
| @@ -1481,9 +1481,9 @@ static void __writecache_writeback_pmem(struct dm_writecache *wc, struct writeba · 615 unmodified lines | ||
| 1481 | 1481 | wb->bio.bi_iter.bi_sector = read_original_sector(wc, e); |
| 1482 | 1482 | wb->page_offset = PAGE_SIZE; |
| 1483 | 1483 | if (max_pages <= WB_LIST_INLINE || |
| 1484 | − unlikely(!(wb->wc_list = kmalloc(max_pages * sizeof(struct wc_entry *), | |
| 1485 | − GFP_NOIO | __GFP_NORETRY | | |
| 1486 | − __GFP_NOMEMALLOC | __GFP_NOWARN)))) { | |
| 1484 | + unlikely(!(wb->wc_list = kmalloc_array(max_pages, sizeof(struct wc_entry *), | |
| 1485 | + GFP_NOIO | __GFP_NORETRY | | |
| 1486 | + __GFP_NOMEMALLOC | __GFP_NOWARN)))) { | |
| 1487 | 1487 | wb->wc_list = wb->wc_list_inline; |
| 1488 | 1488 | max_pages = WB_LIST_INLINE; |
| 1489 | 1489 | } |
| @@ -787,7 +787,7 @@ static int dmz_ctr(struct dm_target *ti, unsigned int argc, char **argv) · 786 unmodified lines | ||
| 787 | 787 | |
| 788 | 788 | /* Chunk BIO work */ |
| 789 | 789 | mutex_init(&dmz->chunk_lock); |
| 790 | − INIT_RADIX_TREE(&dmz->chunk_rxtree, GFP_KERNEL); | |
| 790 | + INIT_RADIX_TREE(&dmz->chunk_rxtree, GFP_NOIO); | |
| 791 | 791 | dmz->chunk_wq = alloc_workqueue("dmz_cwq_%s", WQ_MEM_RECLAIM | WQ_UNBOUND, |
| 792 | 792 | 0, dev->name); |
| 793 | 793 | if (!dmz->chunk_wq) { |
| @@ -1056,8 +1056,7 @@ static long dm_dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, · 1055 unmodified lines | ||
| 1056 | 1056 | if (len < 1) |
| 1057 | 1057 | goto out; |
| 1058 | 1058 | nr_pages = min(len, nr_pages); |
| 1059 | − if (ti->type->direct_access) | |
| 1060 | − ret = ti->type->direct_access(ti, pgoff, nr_pages, kaddr, pfn); | |
| 1059 | + ret = ti->type->direct_access(ti, pgoff, nr_pages, kaddr, pfn); | |
| 1061 | 1060 | |
| 1062 | 1061 | out: |
| 1063 | 1062 | dm_put_live_table(md, srcu_idx); |
| @@ -1606,10 +1605,9 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, · 542 unmodified lines | ||
| 1606 | 1605 | * the usage of io->orig_bio in dm_remap_zone_report() |
| 1607 | 1606 | * won't be affected by this reassignment. |
| 1608 | 1607 | */ |
| 1609 | − struct bio *b = bio_clone_bioset(bio, GFP_NOIO, | |
| 1610 | − &md->queue->bio_split); | |
| 1608 | + struct bio *b = bio_split(bio, bio_sectors(bio) - ci.sector_count, | |
| 1609 | + GFP_NOIO, &md->queue->bio_split); | |
| 1611 | 1610 | ci.io->orig_bio = b; |
| 1612 | − bio_advance(bio, (bio_sectors(bio) - ci.sector_count) << 9); | |
| 1613 | 1611 | bio_chain(b, bio); |
| 1614 | 1612 | ret = generic_make_request(bio); |
| 1615 | 1613 | break; |
| @@ -2526,7 +2526,7 @@ static int cfi_atmel_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) · 2525 unmodified lines | ||
| 2526 | 2526 | |
| 2527 | 2527 | struct ppb_lock { |
| 2528 | 2528 | struct flchip *chip; |
| 2529 | − loff_t offset; | |
| 2529 | + unsigned long adr; | |
| 2530 | 2530 | int locked; |
| 2531 | 2531 | }; |
| 2532 | 2532 | |
| @@ -2544,8 +2544,9 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, · 11 unmodified lines | ||
| 2544 | 2544 | unsigned long timeo; |
| 2545 | 2545 | int ret; |
| 2546 | 2546 | |
| 2547 | + adr += chip->start; | |
| 2547 | 2548 | mutex_lock(&chip->mutex); |
| 2548 | − ret = get_chip(map, chip, adr + chip->start, FL_LOCKING); | |
| 2549 | + ret = get_chip(map, chip, adr, FL_LOCKING); | |
| 2549 | 2550 | if (ret) { |
| 2550 | 2551 | mutex_unlock(&chip->mutex); |
| 2551 | 2552 | return ret; |
| @@ -2563,8 +2564,8 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, · 11 unmodified lines | ||
| 2563 | 2564 | |
| 2564 | 2565 | if (thunk == DO_XXLOCK_ONEBLOCK_LOCK) { |
| 2565 | 2566 | chip->state = FL_LOCKING; |
| 2566 | − map_write(map, CMD(0xA0), chip->start + adr); | |
| 2567 | − map_write(map, CMD(0x00), chip->start + adr); | |
| 2567 | + map_write(map, CMD(0xA0), adr); | |
| 2568 | + map_write(map, CMD(0x00), adr); | |
| 2568 | 2569 | } else if (thunk == DO_XXLOCK_ONEBLOCK_UNLOCK) { |
| 2569 | 2570 | /* |
| 2570 | 2571 | * Unlocking of one specific sector is not supported, so we |
| @@ -2602,7 +2603,7 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, · 31 unmodified lines | ||
| 2602 | 2603 | map_write(map, CMD(0x00), chip->start); |
| 2603 | 2604 | |
| 2604 | 2605 | chip->state = FL_READY; |
| 2605 | − put_chip(map, chip, adr + chip->start); | |
| 2606 | + put_chip(map, chip, adr); | |
| 2606 | 2607 | mutex_unlock(&chip->mutex); |
| 2607 | 2608 | |
| 2608 | 2609 | return ret; |
| @@ -2659,9 +2660,9 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, · 50 unmodified lines | ||
| 2659 | 2660 | * sectors shall be unlocked, so lets keep their locking |
| 2660 | 2661 | * status at "unlocked" (locked=0) for the final re-locking. |
| 2661 | 2662 | */ |
| 2662 | − if ((adr < ofs) || (adr >= (ofs + len))) { | |
| 2663 | + if ((offset < ofs) || (offset >= (ofs + len))) { | |
| 2663 | 2664 | sect[sectors].chip = &cfi->chips[chipnum]; |
| 2664 | − sect[sectors].offset = offset; | |
| 2665 | + sect[sectors].adr = adr; | |
| 2665 | 2666 | sect[sectors].locked = do_ppb_xxlock( |
| 2666 | 2667 | map, &cfi->chips[chipnum], adr, 0, |
| 2667 | 2668 | DO_XXLOCK_ONEBLOCK_GETLOCK); |
| @@ -2675,6 +2676,8 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, · 7 unmodified lines | ||
| 2675 | 2676 | i++; |
| 2676 | 2677 | |
| 2677 | 2678 | if (adr >> cfi->chipshift) { |
| 2679 | + if (offset >= (ofs + len)) | |
| 2680 | + break; | |
| 2678 | 2681 | adr = 0; |
| 2679 | 2682 | chipnum++; |
| 2680 | 2683 | |
| @@ -2705,7 +2708,7 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, · 24 unmodified lines | ||
| 2705 | 2708 | */ |
| 2706 | 2709 | for (i = 0; i < sectors; i++) { |
| 2707 | 2710 | if (sect[i].locked) |
| 2708 | − do_ppb_xxlock(map, sect[i].chip, sect[i].offset, 0, | |
| 2711 | + do_ppb_xxlock(map, sect[i].chip, sect[i].adr, 0, | |
| 2709 | 2712 | DO_XXLOCK_ONEBLOCK_LOCK); |
| 2710 | 2713 | } |
| 2711 | 2714 | |
| @@ -733,8 +733,8 @@ static struct flash_info dataflash_data[] = { · 732 unmodified lines | ||
| 733 | 733 | { "AT45DB642x", 0x1f2800, 8192, 1056, 11, SUP_POW2PS}, |
| 734 | 734 | { "at45db642d", 0x1f2800, 8192, 1024, 10, SUP_POW2PS | IS_POW2PS}, |
| 735 | 735 | |
| 736 | − { "AT45DB641E", 0x1f28000100, 32768, 264, 9, SUP_EXTID | SUP_POW2PS}, | |
| 737 | − { "at45db641e", 0x1f28000100, 32768, 256, 8, SUP_EXTID | SUP_POW2PS | IS_POW2PS}, | |
| 736 | + { "AT45DB641E", 0x1f28000100ULL, 32768, 264, 9, SUP_EXTID | SUP_POW2PS}, | |
| 737 | + { "at45db641e", 0x1f28000100ULL, 32768, 256, 8, SUP_EXTID | SUP_POW2PS | IS_POW2PS}, | |
| 738 | 738 | }; |
| 739 | 739 | |
| 740 | 740 | static struct flash_info *jedec_lookup(struct spi_device *spi, |
| @@ -123,7 +123,11 @@ static int denali_dt_probe(struct platform_device *pdev) · 122 unmodified lines | ||
| 123 | 123 | if (ret) |
| 124 | 124 | return ret; |
| 125 | 125 | |
| 126 | − denali->clk_x_rate = clk_get_rate(dt->clk); | |
| 126 | + /* | |
| 127 | + * Hardcode the clock rate for the backward compatibility. | |
| 128 | + * This works for both SOCFPGA and UniPhier. | |
| 129 | + */ | |
| 130 | + denali->clk_x_rate = 200000000; | |
| 127 | 131 | |
| 128 | 132 | ret = denali_init(denali); |
| 129 | 133 | if (ret) |
| @@ -48,7 +48,7 @@ · 47 unmodified lines | ||
| 48 | 48 | #define NFC_V1_V2_CONFIG (host->regs + 0x0a) |
| 49 | 49 | #define NFC_V1_V2_ECC_STATUS_RESULT (host->regs + 0x0c) |
| 50 | 50 | #define NFC_V1_V2_RSLTMAIN_AREA (host->regs + 0x0e) |
| 51 | −#define NFC_V1_V2_RSLTSPARE_AREA (host->regs + 0x10) | |
| 51 | +#define NFC_V21_RSLTSPARE_AREA (host->regs + 0x10) | |
| 52 | 52 | #define NFC_V1_V2_WRPROT (host->regs + 0x12) |
| 53 | 53 | #define NFC_V1_UNLOCKSTART_BLKADDR (host->regs + 0x14) |
| 54 | 54 | #define NFC_V1_UNLOCKEND_BLKADDR (host->regs + 0x16) |
| @@ -1274,6 +1274,9 @@ static void preset_v2(struct mtd_info *mtd) · 1219 unmodified lines | ||
| 1274 | 1274 | writew(config1, NFC_V1_V2_CONFIG1); |
| 1275 | 1275 | /* preset operation */ |
| 1276 | 1276 | |
| 1277 | + /* spare area size in 16-bit half-words */ | |
| 1278 | + writew(mtd->oobsize / 2, NFC_V21_RSLTSPARE_AREA); | |
| 1279 | + | |
| 1277 | 1280 | /* Unlock the internal RAM Buffer */ |
| 1278 | 1281 | writew(0x2, NFC_V1_V2_CONFIG); |
| 1279 | 1282 | |
| @@ -440,7 +440,7 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs) · 439 unmodified lines | ||
| 440 | 440 | |
| 441 | 441 | for (; page < page_end; page++) { |
| 442 | 442 | res = chip->ecc.read_oob(mtd, chip, page); |
| 443 | − if (res) | |
| 443 | + if (res < 0) | |
| 444 | 444 | return res; |
| 445 | 445 | |
| 446 | 446 | bad = chip->oob_poi[chip->badblockpos]; |
| @@ -17,23 +17,47 @@ · 16 unmodified lines | ||
| 17 | 17 | |
| 18 | 18 | #include <linux/mtd/rawnand.h> |
| 19 | 19 | |
| 20 | +/* | |
| 21 | + * Macronix AC series does not support using SET/GET_FEATURES to change | |
| 22 | + * the timings unlike what is declared in the parameter page. Unflag | |
| 23 | + * this feature to avoid unnecessary downturns. | |
| 24 | + */ | |
| 25 | +static void macronix_nand_fix_broken_get_timings(struct nand_chip *chip) | |
| 26 | +{ | |
| 27 | + unsigned int i; | |
| 28 | + static const char * const broken_get_timings[] = { | |
| 29 | + "MX30LF1G18AC", | |
| 30 | + "MX30LF1G28AC", | |
| 31 | + "MX30LF2G18AC", | |
| 32 | + "MX30LF2G28AC", | |
| 33 | + "MX30LF4G18AC", | |
| 34 | + "MX30LF4G28AC", | |
| 35 | + "MX60LF8G18AC", | |
| 36 | + }; | |
| 37 | + | |
| 38 | + if (!chip->parameters.supports_set_get_features) | |
| 39 | + return; | |
| 40 | + | |
| 41 | + for (i = 0; i < ARRAY_SIZE(broken_get_timings); i++) { | |
| 42 | + if (!strcmp(broken_get_timings[i], chip->parameters.model)) | |
| 43 | + break; | |
| 44 | + } | |
| 45 | + | |
| 46 | + if (i == ARRAY_SIZE(broken_get_timings)) | |
| 47 | + return; | |
| 48 | + | |
| 49 | + bitmap_clear(chip->parameters.get_feature_list, | |
| 50 | + ONFI_FEATURE_ADDR_TIMING_MODE, 1); | |
| 51 | + bitmap_clear(chip->parameters.set_feature_list, | |
| 52 | + ONFI_FEATURE_ADDR_TIMING_MODE, 1); | |
| 53 | +} | |
| 54 | + | |
| 20 | 55 | static int macronix_nand_init(struct nand_chip *chip) |
| 21 | 56 | { |
| 22 | 57 | if (nand_is_slc(chip)) |
| 23 | 58 | chip->bbt_options |= NAND_BBT_SCAN2NDPAGE; |
| 24 | 59 | |
| 25 | − /* | |
| 26 | − * MX30LF2G18AC chip does not support using SET/GET_FEATURES to change | |
| 27 | − * the timings unlike what is declared in the parameter page. Unflag | |
| 28 | − * this feature to avoid unnecessary downturns. | |
| 29 | − */ | |
| 30 | − if (chip->parameters.supports_set_get_features && | |
| 31 | − !strcmp("MX30LF2G18AC", chip->parameters.model)) { | |
| 32 | − bitmap_clear(chip->parameters.get_feature_list, | |
| 33 | − ONFI_FEATURE_ADDR_TIMING_MODE, 1); | |
| 34 | − bitmap_clear(chip->parameters.set_feature_list, | |
| 35 | − ONFI_FEATURE_ADDR_TIMING_MODE, 1); | |
| 36 | − } | |
| 60 | + macronix_nand_fix_broken_get_timings(chip); | |
| 37 | 61 | |
| 38 | 62 | return 0; |
| 39 | 63 | } |
| @@ -66,7 +66,9 @@ static int micron_nand_onfi_init(struct nand_chip *chip) · 65 unmodified lines | ||
| 66 | 66 | |
| 67 | 67 | if (p->supports_set_get_features) { |
| 68 | 68 | set_bit(ONFI_FEATURE_ADDR_READ_RETRY, p->set_feature_list); |
| 69 | + set_bit(ONFI_FEATURE_ON_DIE_ECC, p->set_feature_list); | |
| 69 | 70 | set_bit(ONFI_FEATURE_ADDR_READ_RETRY, p->get_feature_list); |
| 71 | + set_bit(ONFI_FEATURE_ON_DIE_ECC, p->get_feature_list); | |
| 70 | 72 | } |
| 71 | 73 | |
| 72 | 74 | return 0; |
| @@ -173,7 +173,7 @@ config SUNLANCE · 172 unmodified lines | ||
| 173 | 173 | |
| 174 | 174 | config AMD_XGBE |
| 175 | 175 | tristate "AMD 10GbE Ethernet driver" |
| 176 | − depends on ((OF_NET && OF_ADDRESS) || ACPI || PCI) && HAS_IOMEM && HAS_DMA | |
| 176 | + depends on ((OF_NET && OF_ADDRESS) || ACPI || PCI) && HAS_IOMEM | |
| 177 | 177 | depends on X86 || ARM64 || COMPILE_TEST |
| 178 | 178 | select BITREVERSE |
| 179 | 179 | select CRC32 |
| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | config NET_XGENE_V2 |
| 2 | 2 | tristate "APM X-Gene SoC Ethernet-v2 Driver" |
| 3 | − depends on HAS_DMA | |
| 4 | 3 | depends on ARCH_XGENE || COMPILE_TEST |
| 5 | 4 | help |
| 6 | 5 | This is the Ethernet driver for the on-chip ethernet interface |
| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | config NET_XGENE |
| 2 | 2 | tristate "APM X-Gene SoC Ethernet Driver" |
| 3 | − depends on HAS_DMA | |
| 4 | 3 | depends on ARCH_XGENE || COMPILE_TEST |
| 5 | 4 | select PHYLIB |
| 6 | 5 | select MDIO_XGENE |
| @@ -24,7 +24,8 @@ config ARC_EMAC_CORE · 23 unmodified lines | ||
| 24 | 24 | config ARC_EMAC |
| 25 | 25 | tristate "ARC EMAC support" |
| 26 | 26 | select ARC_EMAC_CORE |
| 27 | − depends on OF_IRQ && OF_NET && HAS_DMA && (ARC || COMPILE_TEST) | |
| 27 | + depends on OF_IRQ && OF_NET | |
| 28 | + depends on ARC || COMPILE_TEST | |
| 28 | 29 | ---help--- |
| 29 | 30 | On some legacy ARC (Synopsys) FPGA boards such as ARCAngel4/ML50x |
| 30 | 31 | non-standard on-chip ethernet device ARC EMAC 10/100 is used. |
| @@ -33,7 +34,8 @@ config ARC_EMAC · 2 unmodified lines | ||
| 33 | 34 | config EMAC_ROCKCHIP |
| 34 | 35 | tristate "Rockchip EMAC support" |
| 35 | 36 | select ARC_EMAC_CORE |
| 36 | − depends on OF_IRQ && OF_NET && REGULATOR && HAS_DMA && (ARCH_ROCKCHIP || COMPILE_TEST) | |
| 37 | + depends on OF_IRQ && OF_NET && REGULATOR | |
| 38 | + depends on ARCH_ROCKCHIP || COMPILE_TEST | |
| 37 | 39 | ---help--- |
| 38 | 40 | Support for Rockchip RK3036/RK3066/RK3188 EMAC ethernet controllers. |
| 39 | 41 | This selects Rockchip SoC glue layer support for the |
| @@ -157,7 +157,6 @@ config BGMAC · 156 unmodified lines | ||
| 157 | 157 | config BGMAC_BCMA |
| 158 | 158 | tristate "Broadcom iProc GBit BCMA support" |
| 159 | 159 | depends on BCMA && BCMA_HOST_SOC |
| 160 | − depends on HAS_DMA | |
| 161 | 160 | depends on BCM47XX || ARCH_BCM_5301X || COMPILE_TEST |
| 162 | 161 | select BGMAC |
| 163 | 162 | select PHYLIB |
| @@ -170,7 +169,6 @@ config BGMAC_BCMA · 6 unmodified lines | ||
| 170 | 169 | |
| 171 | 170 | config BGMAC_PLATFORM |
| 172 | 171 | tristate "Broadcom iProc GBit platform support" |
| 173 | − depends on HAS_DMA | |
| 174 | 172 | depends on ARCH_BCM_IPROC || COMPILE_TEST |
| 175 | 173 | depends on OF |
| 176 | 174 | select BGMAC |
| @@ -170,10 +170,7 @@ static int gem_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) · 169 unmodified lines | ||
| 170 | 170 | |
| 171 | 171 | if (delta > TSU_NSEC_MAX_VAL) { |
| 172 | 172 | gem_tsu_get_time(&bp->ptp_clock_info, &now); |
| 173 | − if (sign) | |
| 174 | − now = timespec64_sub(now, then); | |
| 175 | − else | |
| 176 | − now = timespec64_add(now, then); | |
| 173 | + now = timespec64_add(now, then); | |
| 177 | 174 | |
| 178 | 175 | gem_tsu_set_time(&bp->ptp_clock_info, |
| 179 | 176 | (const struct timespec64 *)&now); |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | config NET_CALXEDA_XGMAC |
| 2 | 2 | tristate "Calxeda 1G/10G XGMAC Ethernet driver" |
| 3 | − depends on HAS_IOMEM && HAS_DMA | |
| 3 | + depends on HAS_IOMEM | |
| 4 | 4 | depends on ARCH_HIGHBANK || COMPILE_TEST |
| 5 | 5 | select CRC32 |
| 6 | 6 | help |
| @@ -263,7 +263,7 @@ static void dcb_tx_queue_prio_enable(struct net_device *dev, int enable) · 262 unmodified lines | ||
| 263 | 263 | "Can't %s DCB Priority on port %d, TX Queue %d: err=%d\n", |
| 264 | 264 | enable ? "set" : "unset", pi->port_id, i, -err); |
| 265 | 265 | else |
| 266 | − txq->dcb_prio = value; | |
| 266 | + txq->dcb_prio = enable ? value : 0; | |
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
| @@ -79,7 +79,6 @@ void enic_rfs_flw_tbl_init(struct enic *enic) · 78 unmodified lines | ||
| 79 | 79 | enic->rfs_h.max = enic->config.num_arfs; |
| 80 | 80 | enic->rfs_h.free = enic->rfs_h.max; |
| 81 | 81 | enic->rfs_h.toclean = 0; |
| 82 | − enic_rfs_timer_start(enic); | |
| 83 | 82 | } |
| 84 | 83 | |
| 85 | 84 | void enic_rfs_flw_tbl_free(struct enic *enic) |
| @@ -88,7 +87,6 @@ void enic_rfs_flw_tbl_free(struct enic *enic) · 2 unmodified lines | ||
| 88 | 87 | |
| 89 | 88 | enic_rfs_timer_stop(enic); |
| 90 | 89 | spin_lock_bh(&enic->rfs_h.lock); |
| 91 | − enic->rfs_h.free = 0; | |
| 92 | 90 | for (i = 0; i < (1 << ENIC_RFS_FLW_BITSHIFT); i++) { |
| 93 | 91 | struct hlist_head *hhead; |
| 94 | 92 | struct hlist_node *tmp; |
| @@ -99,6 +97,7 @@ void enic_rfs_flw_tbl_free(struct enic *enic) · 4 unmodified lines | ||
| 99 | 97 | enic_delfltr(enic, n->fltr_id); |
| 100 | 98 | hlist_del(&n->node); |
| 101 | 99 | kfree(n); |
| 100 | + enic->rfs_h.free++; | |
| 102 | 101 | } |
| 103 | 102 | } |
| 104 | 103 | spin_unlock_bh(&enic->rfs_h.lock); |
| @@ -1920,7 +1920,7 @@ static int enic_open(struct net_device *netdev) · 1919 unmodified lines | ||
| 1920 | 1920 | { |
| 1921 | 1921 | struct enic *enic = netdev_priv(netdev); |
| 1922 | 1922 | unsigned int i; |
| 1923 | − int err; | |
| 1923 | + int err, ret; | |
| 1924 | 1924 | |
| 1925 | 1925 | err = enic_request_intr(enic); |
| 1926 | 1926 | if (err) { |
| @@ -1971,16 +1971,15 @@ static int enic_open(struct net_device *netdev) · 44 unmodified lines | ||
| 1971 | 1971 | vnic_intr_unmask(&enic->intr[i]); |
| 1972 | 1972 | |
| 1973 | 1973 | enic_notify_timer_start(enic); |
| 1974 | − enic_rfs_flw_tbl_init(enic); | |
| 1974 | + enic_rfs_timer_start(enic); | |
| 1975 | 1975 | |
| 1976 | 1976 | return 0; |
| 1977 | 1977 | |
| 1978 | 1978 | err_out_free_rq: |
| 1979 | 1979 | for (i = 0; i < enic->rq_count; i++) { |
| 1980 | − err = vnic_rq_disable(&enic->rq[i]); | |
| 1981 | − if (err) | |
| 1982 | − return err; | |
| 1983 | − vnic_rq_clean(&enic->rq[i], enic_free_rq_buf); | |
| 1980 | + ret = vnic_rq_disable(&enic->rq[i]); | |
| 1981 | + if (!ret) | |
| 1982 | + vnic_rq_clean(&enic->rq[i], enic_free_rq_buf); | |
| 1984 | 1983 | } |
| 1985 | 1984 | enic_dev_notify_unset(enic); |
| 1986 | 1985 | err_out_free_intr: |
| @@ -2904,6 +2903,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 917 unmodified lines | ||
| 2904 | 2903 | |
| 2905 | 2904 | timer_setup(&enic->notify_timer, enic_notify_timer, 0); |
| 2906 | 2905 | |
| 2906 | + enic_rfs_flw_tbl_init(enic); | |
| 2907 | 2907 | enic_set_rx_coal_setting(enic); |
| 2908 | 2908 | INIT_WORK(&enic->reset, enic_reset); |
| 2909 | 2909 | INIT_WORK(&enic->tx_hang_reset, enic_tx_hang_reset); |
| @@ -1735,8 +1735,8 @@ static void ftgmac100_ncsi_handler(struct ncsi_dev *nd) · 1734 unmodified lines | ||
| 1735 | 1735 | if (unlikely(nd->state != ncsi_dev_state_functional)) |
| 1736 | 1736 | return; |
| 1737 | 1737 | |
| 1738 | − netdev_info(nd->dev, "NCSI interface %s\n", | |
| 1739 | − nd->link_up ? "up" : "down"); | |
| 1738 | + netdev_dbg(nd->dev, "NCSI interface %s\n", | |
| 1739 | + nd->link_up ? "up" : "down"); | |
| 1740 | 1740 | } |
| 1741 | 1741 | |
| 1742 | 1742 | static void ftgmac100_setup_clk(struct ftgmac100 *priv) |
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | config NET_VENDOR_HISILICON |
| 6 | 6 | bool "Hisilicon devices" |
| 7 | 7 | default y |
| 8 | − depends on (OF || ACPI) && HAS_DMA | |
| 8 | + depends on OF || ACPI | |
| 9 | 9 | depends on ARM || ARM64 || COMPILE_TEST |
| 10 | 10 | ---help--- |
| 11 | 11 | If you have a network (Ethernet) card belonging to this class, say Y. |
| @@ -2103,9 +2103,8 @@ static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring, · 2102 unmodified lines | ||
| 2103 | 2103 | unsigned int truesize = i40e_rx_pg_size(rx_ring) / 2; |
| 2104 | 2104 | #else |
| 2105 | 2105 | unsigned int truesize = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) + |
| 2106 | − SKB_DATA_ALIGN(I40E_SKB_PAD + | |
| 2107 | − (xdp->data_end - | |
| 2108 | − xdp->data_hard_start)); | |
| 2106 | + SKB_DATA_ALIGN(xdp->data_end - | |
| 2107 | + xdp->data_hard_start); | |
| 2109 | 2108 | #endif |
| 2110 | 2109 | struct sk_buff *skb; |
| 2111 | 2110 | |
| @@ -2124,7 +2123,7 @@ static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring, · 12 unmodified lines | ||
| 2124 | 2123 | return NULL; |
| 2125 | 2124 | |
| 2126 | 2125 | /* update pointers within the skb to store the data */ |
| 2127 | − skb_reserve(skb, I40E_SKB_PAD + (xdp->data - xdp->data_hard_start)); | |
| 2126 | + skb_reserve(skb, xdp->data - xdp->data_hard_start); | |
| 2128 | 2127 | __skb_put(skb, xdp->data_end - xdp->data); |
| 2129 | 2128 | if (metasize) |
| 2130 | 2129 | skb_metadata_set(skb, metasize); |
| @@ -18,8 +18,8 @@ if NET_VENDOR_MARVELL · 17 unmodified lines | ||
| 18 | 18 | |
| 19 | 19 | config MV643XX_ETH |
| 20 | 20 | tristate "Marvell Discovery (643XX) and Orion ethernet support" |
| 21 | − depends on (MV64X60 || PPC32 || PLAT_ORION || COMPILE_TEST) && INET | |
| 22 | − depends on HAS_DMA | |
| 21 | + depends on MV64X60 || PPC32 || PLAT_ORION || COMPILE_TEST | |
| 22 | + depends on INET | |
| 23 | 23 | select PHYLIB |
| 24 | 24 | select MVMDIO |
| 25 | 25 | ---help--- |
| @@ -58,7 +58,6 @@ config MVNETA_BM_ENABLE · 32 unmodified lines | ||
| 58 | 58 | config MVNETA |
| 59 | 59 | tristate "Marvell Armada 370/38x/XP/37xx network interface support" |
| 60 | 60 | depends on ARCH_MVEBU || COMPILE_TEST |
| 61 | − depends on HAS_DMA | |
| 62 | 61 | select MVMDIO |
| 63 | 62 | select PHYLINK |
| 64 | 63 | ---help--- |
| @@ -84,7 +83,6 @@ config MVNETA_BM · 19 unmodified lines | ||
| 84 | 83 | config MVPP2 |
| 85 | 84 | tristate "Marvell Armada 375/7K/8K network interface support" |
| 86 | 85 | depends on ARCH_MVEBU || COMPILE_TEST |
| 87 | − depends on HAS_DMA | |
| 88 | 86 | select MVMDIO |
| 89 | 87 | select PHYLINK |
| 90 | 88 | ---help--- |
| @@ -93,7 +91,7 @@ config MVPP2 · 2 unmodified lines | ||
| 93 | 91 | |
| 94 | 92 | config PXA168_ETH |
| 95 | 93 | tristate "Marvell pxa168 ethernet support" |
| 96 | − depends on HAS_IOMEM && HAS_DMA | |
| 94 | + depends on HAS_IOMEM | |
| 97 | 95 | depends on CPU_PXA168 || ARCH_BERLIN || COMPILE_TEST |
| 98 | 96 | select PHYLIB |
| 99 | 97 | ---help--- |
| @@ -1932,7 +1932,7 @@ static int mvneta_rx_swbm(struct mvneta_port *pp, int rx_todo, · 1931 unmodified lines | ||
| 1932 | 1932 | rx_bytes = rx_desc->data_size - (ETH_FCS_LEN + MVNETA_MH_SIZE); |
| 1933 | 1933 | index = rx_desc - rxq->descs; |
| 1934 | 1934 | data = rxq->buf_virt_addr[index]; |
| 1935 | − phys_addr = rx_desc->buf_phys_addr; | |
| 1935 | + phys_addr = rx_desc->buf_phys_addr - pp->rx_offset_correction; | |
| 1936 | 1936 | |
| 1937 | 1937 | if (!mvneta_rxq_desc_is_first_last(rx_status) || |
| 1938 | 1938 | (rx_status & MVNETA_RXD_ERR_SUMMARY)) { |
| @@ -30,7 +30,7 @@ config MLXSW_CORE_THERMAL · 29 unmodified lines | ||
| 30 | 30 | |
| 31 | 31 | config MLXSW_PCI |
| 32 | 32 | tristate "PCI bus implementation for Mellanox Technologies Switch ASICs" |
| 33 | − depends on PCI && HAS_DMA && HAS_IOMEM && MLXSW_CORE | |
| 33 | + depends on PCI && HAS_IOMEM && MLXSW_CORE | |
| 34 | 34 | default m |
| 35 | 35 | ---help--- |
| 36 | 36 | This is PCI bus implementation for Mellanox Technologies Switch ASICs. |
| @@ -344,10 +344,9 @@ static int ocelot_port_stop(struct net_device *dev) · 343 unmodified lines | ||
| 344 | 344 | static int ocelot_gen_ifh(u32 *ifh, struct frame_info *info) |
| 345 | 345 | { |
| 346 | 346 | ifh[0] = IFH_INJ_BYPASS; |
| 347 | − ifh[1] = (0xff00 & info->port) >> 8; | |
| 347 | + ifh[1] = (0xf00 & info->port) >> 8; | |
| 348 | 348 | ifh[2] = (0xff & info->port) << 24; |
| 349 | − ifh[3] = IFH_INJ_POP_CNT_DISABLE | (info->cpuq << 20) | | |
| 350 | − (info->tag_type << 16) | info->vid; | |
| 349 | + ifh[3] = (info->tag_type << 16) | info->vid; | |
| 351 | 350 | |
| 352 | 351 | return 0; |
| 353 | 352 | } |
| @@ -370,11 +369,13 @@ static int ocelot_port_xmit(struct sk_buff *skb, struct net_device *dev) · 16 unmodified lines | ||
| 370 | 369 | QS_INJ_CTRL_SOF, QS_INJ_CTRL, grp); |
| 371 | 370 | |
| 372 | 371 | info.port = BIT(port->chip_port); |
| 373 | − info.cpuq = 0xff; | |
| 372 | + info.tag_type = IFH_TAG_TYPE_C; | |
| 373 | + info.vid = skb_vlan_tag_get(skb); | |
| 374 | 374 | ocelot_gen_ifh(ifh, &info); |
| 375 | 375 | |
| 376 | 376 | for (i = 0; i < IFH_LEN; i++) |
| 377 | − ocelot_write_rix(ocelot, ifh[i], QS_INJ_WR, grp); | |
| 377 | + ocelot_write_rix(ocelot, (__force u32)cpu_to_be32(ifh[i]), | |
| 378 | + QS_INJ_WR, grp); | |
| 378 | 379 | |
| 379 | 380 | count = (skb->len + 3) / 4; |
| 380 | 381 | last = skb->len % 4; |
| @@ -255,9 +255,8 @@ qed_dcbx_get_app_protocol_type(struct qed_hwfn *p_hwfn, · 254 unmodified lines | ||
| 255 | 255 | *type = DCBX_PROTOCOL_ROCE_V2; |
| 256 | 256 | } else { |
| 257 | 257 | *type = DCBX_MAX_PROTOCOL_TYPE; |
| 258 | − DP_ERR(p_hwfn, | |
| 259 | − "No action required, App TLV id = 0x%x app_prio_bitmap = 0x%x\n", | |
| 260 | − id, app_prio_bitmap); | |
| 258 | + DP_ERR(p_hwfn, "No action required, App TLV entry = 0x%x\n", | |
| 259 | + app_prio_bitmap); | |
| 261 | 260 | return false; |
| 262 | 261 | } |
| 263 | 262 | |
| @@ -1479,8 +1478,8 @@ static u8 qed_dcbnl_getcap(struct qed_dev *cdev, int capid, u8 *cap) · 1215 unmodified lines | ||
| 1479 | 1478 | *cap = 0x80; |
| 1480 | 1479 | break; |
| 1481 | 1480 | case DCB_CAP_ATTR_DCBX: |
| 1482 | − *cap = (DCB_CAP_DCBX_LLD_MANAGED | DCB_CAP_DCBX_VER_CEE | | |
| 1483 | − DCB_CAP_DCBX_VER_IEEE | DCB_CAP_DCBX_STATIC); | |
| 1481 | + *cap = (DCB_CAP_DCBX_VER_CEE | DCB_CAP_DCBX_VER_IEEE | | |
| 1482 | + DCB_CAP_DCBX_STATIC); | |
| 1484 | 1483 | break; |
| 1485 | 1484 | default: |
| 1486 | 1485 | *cap = false; |
| @@ -1548,8 +1547,6 @@ static u8 qed_dcbnl_getdcbx(struct qed_dev *cdev) · 61 unmodified lines | ||
| 1548 | 1547 | if (!dcbx_info) |
| 1549 | 1548 | return 0; |
| 1550 | 1549 | |
| 1551 | − if (dcbx_info->operational.enabled) | |
| 1552 | − mode |= DCB_CAP_DCBX_LLD_MANAGED; | |
| 1553 | 1550 | if (dcbx_info->operational.ieee) |
| 1554 | 1551 | mode |= DCB_CAP_DCBX_VER_IEEE; |
| 1555 | 1552 | if (dcbx_info->operational.cee) |
| @@ -201,8 +201,9 @@ void qed_ll2b_complete_rx_packet(void *cxt, struct qed_ll2_comp_rx_data *data) · 200 unmodified lines | ||
| 201 | 201 | |
| 202 | 202 | skb = build_skb(buffer->data, 0); |
| 203 | 203 | if (!skb) { |
| 204 | − rc = -ENOMEM; | |
| 205 | − goto out_post; | |
| 204 | + DP_INFO(cdev, "Failed to build SKB\n"); | |
| 205 | + kfree(buffer->data); | |
| 206 | + goto out_post1; | |
| 206 | 207 | } |
| 207 | 208 | |
| 208 | 209 | data->u.placement_offset += NET_SKB_PAD; |
| @@ -224,8 +225,14 @@ void qed_ll2b_complete_rx_packet(void *cxt, struct qed_ll2_comp_rx_data *data) · 15 unmodified lines | ||
| 224 | 225 | cdev->ll2->cbs->rx_cb(cdev->ll2->cb_cookie, skb, |
| 225 | 226 | data->opaque_data_0, |
| 226 | 227 | data->opaque_data_1); |
| 228 | + } else { | |
| 229 | + DP_VERBOSE(p_hwfn, (NETIF_MSG_RX_STATUS | NETIF_MSG_PKTDATA | | |
| 230 | + QED_MSG_LL2 | QED_MSG_STORAGE), | |
| 231 | + "Dropping the packet\n"); | |
| 232 | + kfree(buffer->data); | |
| 227 | 233 | } |
| 228 | 234 | |
| 235 | +out_post1: | |
| 229 | 236 | /* Update Buffer information and update FW producer */ |
| 230 | 237 | buffer->data = new_data; |
| 231 | 238 | buffer->phys_addr = new_phys_addr; |
| @@ -567,8 +567,16 @@ static irqreturn_t qed_single_int(int irq, void *dev_instance) · 566 unmodified lines | ||
| 567 | 567 | /* Fastpath interrupts */ |
| 568 | 568 | for (j = 0; j < 64; j++) { |
| 569 | 569 | if ((0x2ULL << j) & status) { |
| 570 | − hwfn->simd_proto_handler[j].func( | |
| 571 | − hwfn->simd_proto_handler[j].token); | |
| 570 | + struct qed_simd_fp_handler *p_handler = | |
| 571 | + &hwfn->simd_proto_handler[j]; | |
| 572 | + | |
| 573 | + if (p_handler->func) | |
| 574 | + p_handler->func(p_handler->token); | |
| 575 | + else | |
| 576 | + DP_NOTICE(hwfn, | |
| 577 | + "Not calling fastpath handler as it is NULL [handler #%d, status 0x%llx]\n", | |
| 578 | + j, status); | |
| 579 | + | |
| 572 | 580 | status &= ~(0x2ULL << j); |
| 573 | 581 | rc = IRQ_HANDLED; |
| 574 | 582 | } |
| @@ -7148,7 +7148,7 @@ static void rtl8169_netpoll(struct net_device *dev) · 7147 unmodified lines | ||
| 7148 | 7148 | { |
| 7149 | 7149 | struct rtl8169_private *tp = netdev_priv(dev); |
| 7150 | 7150 | |
| 7151 | − rtl8169_interrupt(pci_irq_vector(tp->pci_dev, 0), dev); | |
| 7151 | + rtl8169_interrupt(pci_irq_vector(tp->pci_dev, 0), tp); | |
| 7152 | 7152 | } |
| 7153 | 7153 | #endif |
| 7154 | 7154 | |
| @@ -17,7 +17,6 @@ if NET_VENDOR_RENESAS · 16 unmodified lines | ||
| 17 | 17 | |
| 18 | 18 | config SH_ETH |
| 19 | 19 | tristate "Renesas SuperH Ethernet support" |
| 20 | − depends on HAS_DMA | |
| 21 | 20 | depends on ARCH_RENESAS || SUPERH || COMPILE_TEST |
| 22 | 21 | select CRC32 |
| 23 | 22 | select MII |
| @@ -31,7 +30,6 @@ config SH_ETH · 7 unmodified lines | ||
| 31 | 30 | |
| 32 | 31 | config RAVB |
| 33 | 32 | tristate "Renesas Ethernet AVB support" |
| 34 | − depends on HAS_DMA | |
| 35 | 33 | depends on ARCH_RENESAS || COMPILE_TEST |
| 36 | 34 | select CRC32 |
| 37 | 35 | select MII |
| @@ -3180,6 +3180,7 @@ bool efx_rps_check_rule(struct efx_arfs_rule *rule, unsigned int filter_idx, · 3179 unmodified lines | ||
| 3180 | 3180 | return true; |
| 3181 | 3181 | } |
| 3182 | 3182 | |
| 3183 | +static | |
| 3183 | 3184 | struct hlist_head *efx_rps_hash_bucket(struct efx_nic *efx, |
| 3184 | 3185 | const struct efx_filter_spec *spec) |
| 3185 | 3186 | { |
| @@ -111,7 +111,7 @@ config DWMAC_ROCKCHIP · 110 unmodified lines | ||
| 111 | 111 | config DWMAC_SOCFPGA |
| 112 | 112 | tristate "SOCFPGA dwmac support" |
| 113 | 113 | default ARCH_SOCFPGA |
| 114 | − depends on OF && (ARCH_SOCFPGA || COMPILE_TEST) | |
| 114 | + depends on OF && (ARCH_SOCFPGA || ARCH_STRATIX10 || COMPILE_TEST) | |
| 115 | 115 | select MFD_SYSCON |
| 116 | 116 | help |
| 117 | 117 | Support for ethernet controller on Altera SOCFPGA |
| @@ -55,6 +55,7 @@ struct socfpga_dwmac { · 54 unmodified lines | ||
| 55 | 55 | struct device *dev; |
| 56 | 56 | struct regmap *sys_mgr_base_addr; |
| 57 | 57 | struct reset_control *stmmac_rst; |
| 58 | + struct reset_control *stmmac_ocp_rst; | |
| 58 | 59 | void __iomem *splitter_base; |
| 59 | 60 | bool f2h_ptp_ref_clk; |
| 60 | 61 | struct tse_pcs pcs; |
| @@ -262,8 +263,8 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac) · 201 unmodified lines | ||
| 262 | 263 | val = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII; |
| 263 | 264 | |
| 264 | 265 | /* Assert reset to the enet controller before changing the phy mode */ |
| 265 | − if (dwmac->stmmac_rst) | |
| 266 | − reset_control_assert(dwmac->stmmac_rst); | |
| 266 | + reset_control_assert(dwmac->stmmac_ocp_rst); | |
| 267 | + reset_control_assert(dwmac->stmmac_rst); | |
| 267 | 268 | |
| 268 | 269 | regmap_read(sys_mgr_base_addr, reg_offset, &ctrl); |
| 269 | 270 | ctrl &= ~(SYSMGR_EMACGRP_CTRL_PHYSEL_MASK << reg_shift); |
| @@ -288,8 +289,8 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac) · 18 unmodified lines | ||
| 288 | 289 | /* Deassert reset for the phy configuration to be sampled by |
| 289 | 290 | * the enet controller, and operation to start in requested mode |
| 290 | 291 | */ |
| 291 | − if (dwmac->stmmac_rst) | |
| 292 | − reset_control_deassert(dwmac->stmmac_rst); | |
| 292 | + reset_control_deassert(dwmac->stmmac_ocp_rst); | |
| 293 | + reset_control_deassert(dwmac->stmmac_rst); | |
| 293 | 294 | if (phymode == PHY_INTERFACE_MODE_SGMII) { |
| 294 | 295 | if (tse_pcs_init(dwmac->pcs.tse_pcs_base, &dwmac->pcs) != 0) { |
| 295 | 296 | dev_err(dwmac->dev, "Unable to initialize TSE PCS"); |
| @@ -324,6 +325,15 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) · 28 unmodified lines | ||
| 324 | 325 | goto err_remove_config_dt; |
| 325 | 326 | } |
| 326 | 327 | |
| 328 | + dwmac->stmmac_ocp_rst = devm_reset_control_get_optional(dev, "stmmaceth-ocp"); | |
| 329 | + if (IS_ERR(dwmac->stmmac_ocp_rst)) { | |
| 330 | + ret = PTR_ERR(dwmac->stmmac_ocp_rst); | |
| 331 | + dev_err(dev, "error getting reset control of ocp %d\n", ret); | |
| 332 | + goto err_remove_config_dt; | |
| 333 | + } | |
| 334 | + | |
| 335 | + reset_control_deassert(dwmac->stmmac_ocp_rst); | |
| 336 | + | |
| 327 | 337 | ret = socfpga_dwmac_parse_data(dwmac, dev); |
| 328 | 338 | if (ret) { |
| 329 | 339 | dev_err(dev, "Unable to parse OF data\n"); |
| @@ -928,6 +928,7 @@ static void stmmac_check_pcs_mode(struct stmmac_priv *priv) · 927 unmodified lines | ||
| 928 | 928 | static int stmmac_init_phy(struct net_device *dev) |
| 929 | 929 | { |
| 930 | 930 | struct stmmac_priv *priv = netdev_priv(dev); |
| 931 | + u32 tx_cnt = priv->plat->tx_queues_to_use; | |
| 931 | 932 | struct phy_device *phydev; |
| 932 | 933 | char phy_id_fmt[MII_BUS_ID_SIZE + 3]; |
| 933 | 934 | char bus_id[MII_BUS_ID_SIZE]; |
| @@ -968,6 +969,15 @@ static int stmmac_init_phy(struct net_device *dev) · 34 unmodified lines | ||
| 968 | 969 | phydev->advertising &= ~(SUPPORTED_1000baseT_Half | |
| 969 | 970 | SUPPORTED_1000baseT_Full); |
| 970 | 971 | |
| 972 | + /* | |
| 973 | + * Half-duplex mode not supported with multiqueue | |
| 974 | + * half-duplex can only works with single queue | |
| 975 | + */ | |
| 976 | + if (tx_cnt > 1) | |
| 977 | + phydev->supported &= ~(SUPPORTED_1000baseT_Half | | |
| 978 | + SUPPORTED_100baseT_Half | | |
| 979 | + SUPPORTED_10baseT_Half); | |
| 980 | + | |
| 971 | 981 | /* |
| 972 | 982 | * Broken HW is sometimes missing the pull-up resistor on the |
| 973 | 983 | * MDIO line, which results in reads to non-existent devices returning |
| @@ -60,8 +60,7 @@ · 59 unmodified lines | ||
| 60 | 60 | #include <linux/sungem_phy.h> |
| 61 | 61 | #include "sungem.h" |
| 62 | 62 | |
| 63 | −/* Stripping FCS is causing problems, disabled for now */ | |
| 64 | −#undef STRIP_FCS | |
| 63 | +#define STRIP_FCS | |
| 65 | 64 | |
| 66 | 65 | #define DEFAULT_MSG (NETIF_MSG_DRV | \ |
| 67 | 66 | NETIF_MSG_PROBE | \ |
| @@ -435,7 +434,7 @@ static int gem_rxmac_reset(struct gem *gp) · 367 unmodified lines | ||
| 435 | 434 | writel(desc_dma & 0xffffffff, gp->regs + RXDMA_DBLOW); |
| 436 | 435 | writel(RX_RING_SIZE - 4, gp->regs + RXDMA_KICK); |
| 437 | 436 | val = (RXDMA_CFG_BASE | (RX_OFFSET << 10) | |
| 438 | − ((14 / 2) << 13) | RXDMA_CFG_FTHRESH_128); | |
| 437 | + (ETH_HLEN << 13) | RXDMA_CFG_FTHRESH_128); | |
| 439 | 438 | writel(val, gp->regs + RXDMA_CFG); |
| 440 | 439 | if (readl(gp->regs + GREG_BIFCFG) & GREG_BIFCFG_M66EN) |
| 441 | 440 | writel(((5 & RXDMA_BLANK_IPKTS) | |
| @@ -760,7 +759,6 @@ static int gem_rx(struct gem *gp, int work_to_do) · 318 unmodified lines | ||
| 760 | 759 | struct net_device *dev = gp->dev; |
| 761 | 760 | int entry, drops, work_done = 0; |
| 762 | 761 | u32 done; |
| 763 | − __sum16 csum; | |
| 764 | 762 | |
| 765 | 763 | if (netif_msg_rx_status(gp)) |
| 766 | 764 | printk(KERN_DEBUG "%s: rx interrupt, done: %d, rx_new: %d\n", |
| @@ -855,9 +853,13 @@ static int gem_rx(struct gem *gp, int work_to_do) · 88 unmodified lines | ||
| 855 | 853 | skb = copy_skb; |
| 856 | 854 | } |
| 857 | 855 | |
| 858 | − csum = (__force __sum16)htons((status & RXDCTRL_TCPCSUM) ^ 0xffff); | |
| 859 | − skb->csum = csum_unfold(csum); | |
| 860 | − skb->ip_summed = CHECKSUM_COMPLETE; | |
| 856 | + if (likely(dev->features & NETIF_F_RXCSUM)) { | |
| 857 | + __sum16 csum; | |
| 858 | + | |
| 859 | + csum = (__force __sum16)htons((status & RXDCTRL_TCPCSUM) ^ 0xffff); | |
| 860 | + skb->csum = csum_unfold(csum); | |
| 861 | + skb->ip_summed = CHECKSUM_COMPLETE; | |
| 862 | + } | |
| 861 | 863 | skb->protocol = eth_type_trans(skb, gp->dev); |
| 862 | 864 | |
| 863 | 865 | napi_gro_receive(&gp->napi, skb); |
| @@ -1761,7 +1763,7 @@ static void gem_init_dma(struct gem *gp) · 897 unmodified lines | ||
| 1761 | 1763 | writel(0, gp->regs + TXDMA_KICK); |
| 1762 | 1764 | |
| 1763 | 1765 | val = (RXDMA_CFG_BASE | (RX_OFFSET << 10) | |
| 1764 | − ((14 / 2) << 13) | RXDMA_CFG_FTHRESH_128); | |
| 1766 | + (ETH_HLEN << 13) | RXDMA_CFG_FTHRESH_128); | |
| 1765 | 1767 | writel(val, gp->regs + RXDMA_CFG); |
| 1766 | 1768 | |
| 1767 | 1769 | writel(desc_dma >> 32, gp->regs + RXDMA_DBHI); |
| @@ -2985,8 +2987,8 @@ static int gem_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 1217 unmodified lines | ||
| 2985 | 2987 | pci_set_drvdata(pdev, dev); |
| 2986 | 2988 | |
| 2987 | 2989 | /* We can do scatter/gather and HW checksum */ |
| 2988 | − dev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM; | |
| 2989 | − dev->features |= dev->hw_features | NETIF_F_RXCSUM; | |
| 2990 | + dev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM; | |
| 2991 | + dev->features = dev->hw_features; | |
| 2990 | 2992 | if (pci_using_dac) |
| 2991 | 2993 | dev->features |= NETIF_F_HIGHDMA; |
| 2992 | 2994 | |
| @@ -205,7 +205,7 @@ static void cpdma_desc_pool_destroy(struct cpdma_ctlr *ctlr) · 204 unmodified lines | ||
| 205 | 205 | * devices (e.g. cpsw switches) use plain old memory. Descriptor pools |
| 206 | 206 | * abstract out these details |
| 207 | 207 | */ |
| 208 | −int cpdma_desc_pool_create(struct cpdma_ctlr *ctlr) | |
| 208 | +static int cpdma_desc_pool_create(struct cpdma_ctlr *ctlr) | |
| 209 | 209 | { |
| 210 | 210 | struct cpdma_params *cpdma_params = &ctlr->params; |
| 211 | 211 | struct cpdma_desc_pool *pool; |
| @@ -1385,6 +1385,15 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd) · 1384 unmodified lines | ||
| 1385 | 1385 | return -EOPNOTSUPP; |
| 1386 | 1386 | } |
| 1387 | 1387 | |
| 1388 | +static int match_first_device(struct device *dev, void *data) | |
| 1389 | +{ | |
| 1390 | + if (dev->parent && dev->parent->of_node) | |
| 1391 | + return of_device_is_compatible(dev->parent->of_node, | |
| 1392 | + "ti,davinci_mdio"); | |
| 1393 | + | |
| 1394 | + return !strncmp(dev_name(dev), "davinci_mdio", 12); | |
| 1395 | +} | |
| 1396 | + | |
| 1388 | 1397 | /** |
| 1389 | 1398 | * emac_dev_open - EMAC device open |
| 1390 | 1399 | * @ndev: The DaVinci EMAC network adapter |
| @@ -1484,8 +1493,14 @@ static int emac_dev_open(struct net_device *ndev) · 93 unmodified lines | ||
| 1484 | 1493 | |
| 1485 | 1494 | /* use the first phy on the bus if pdata did not give us a phy id */ |
| 1486 | 1495 | if (!phydev && !priv->phy_id) { |
| 1487 | − phy = bus_find_device_by_name(&mdio_bus_type, NULL, | |
| 1488 | − "davinci_mdio"); | |
| 1496 | + /* NOTE: we can't use bus_find_device_by_name() here because | |
| 1497 | + * the device name is not guaranteed to be 'davinci_mdio'. On | |
| 1498 | + * some systems it can be 'davinci_mdio.0' so we need to use | |
| 1499 | + * strncmp() against the first part of the string to correctly | |
| 1500 | + * match it. | |
| 1501 | + */ | |
| 1502 | + phy = bus_find_device(&mdio_bus_type, NULL, NULL, | |
| 1503 | + match_first_device); | |
| 1489 | 1504 | if (phy) { |
| 1490 | 1505 | priv->phy_id = dev_name(phy); |
| 1491 | 1506 | if (!priv->phy_id || !*priv->phy_id) |
| @@ -89,10 +89,6 @@ · 88 unmodified lines | ||
| 89 | 89 | static const char banner[] __initconst = KERN_INFO \ |
| 90 | 90 | "AX.25: bpqether driver version 004\n"; |
| 91 | 91 | |
| 92 | −static char bcast_addr[6]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; | |
| 93 | − | |
| 94 | −static char bpq_eth_addr[6]; | |
| 95 | − | |
| 96 | 92 | static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); |
| 97 | 93 | static int bpq_device_event(struct notifier_block *, unsigned long, void *); |
| 98 | 94 | |
| @@ -501,8 +497,8 @@ static int bpq_new_device(struct net_device *edev) · 402 unmodified lines | ||
| 501 | 497 | bpq->ethdev = edev; |
| 502 | 498 | bpq->axdev = ndev; |
| 503 | 499 | |
| 504 | − memcpy(bpq->dest_addr, bcast_addr, sizeof(bpq_eth_addr)); | |
| 505 | − memcpy(bpq->acpt_addr, bcast_addr, sizeof(bpq_eth_addr)); | |
| 500 | + eth_broadcast_addr(bpq->dest_addr); | |
| 501 | + eth_broadcast_addr(bpq->acpt_addr); | |
| 506 | 502 | |
| 507 | 503 | err = register_netdevice(ndev); |
| 508 | 504 | if (err) |
| @@ -594,7 +594,8 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev, · 593 unmodified lines | ||
| 594 | 594 | ipvlan->phy_dev = phy_dev; |
| 595 | 595 | ipvlan->dev = dev; |
| 596 | 596 | ipvlan->sfeatures = IPVLAN_FEATURES; |
| 597 | − ipvlan_adjust_mtu(ipvlan, phy_dev); | |
| 597 | + if (!tb[IFLA_MTU]) | |
| 598 | + ipvlan_adjust_mtu(ipvlan, phy_dev); | |
| 598 | 599 | INIT_LIST_HEAD(&ipvlan->addrs); |
| 599 | 600 | spin_lock_init(&ipvlan->addrs_lock); |
| 600 | 601 | |
| @@ -693,6 +694,7 @@ void ipvlan_link_setup(struct net_device *dev) · 92 unmodified lines | ||
| 693 | 694 | { |
| 694 | 695 | ether_setup(dev); |
| 695 | 696 | |
| 697 | + dev->max_mtu = ETH_MAX_MTU; | |
| 696 | 698 | dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING); |
| 697 | 699 | dev->priv_flags |= IFF_UNICAST_FLT | IFF_NO_QUEUE; |
| 698 | 700 | dev->netdev_ops = &ipvlan_netdev_ops; |
| @@ -527,7 +527,7 @@ static int net_failover_slave_register(struct net_device *slave_dev, · 526 unmodified lines | ||
| 527 | 527 | |
| 528 | 528 | netif_addr_lock_bh(failover_dev); |
| 529 | 529 | dev_uc_sync_multiple(slave_dev, failover_dev); |
| 530 | − dev_uc_sync_multiple(slave_dev, failover_dev); | |
| 530 | + dev_mc_sync_multiple(slave_dev, failover_dev); | |
| 531 | 531 | netif_addr_unlock_bh(failover_dev); |
| 532 | 532 | |
| 533 | 533 | err = vlan_vids_add_by_dev(slave_dev, failover_dev); |
| @@ -1107,7 +1107,7 @@ static const struct proto_ops pppoe_ops = { · 1106 unmodified lines | ||
| 1107 | 1107 | .socketpair = sock_no_socketpair, |
| 1108 | 1108 | .accept = sock_no_accept, |
| 1109 | 1109 | .getname = pppoe_getname, |
| 1110 | − .poll_mask = datagram_poll_mask, | |
| 1110 | + .poll = datagram_poll, | |
| 1111 | 1111 | .listen = sock_no_listen, |
| 1112 | 1112 | .shutdown = sock_no_shutdown, |
| 1113 | 1113 | .setsockopt = sock_no_setsockopt, |
| @@ -967,8 +967,7 @@ void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf) · 966 unmodified lines | ||
| 967 | 967 | |
| 968 | 968 | atomic_set(&ctx->stop, 1); |
| 969 | 969 | |
| 970 | − if (hrtimer_active(&ctx->tx_timer)) | |
| 971 | − hrtimer_cancel(&ctx->tx_timer); | |
| 970 | + hrtimer_cancel(&ctx->tx_timer); | |
| 972 | 971 | |
| 973 | 972 | tasklet_kill(&ctx->bh); |
| 974 | 973 | |
| @@ -1246,6 +1246,7 @@ static const struct usb_device_id products[] = { · 1245 unmodified lines | ||
| 1246 | 1246 | {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ |
| 1247 | 1247 | {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ |
| 1248 | 1248 | {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ |
| 1249 | + {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e */ | |
| 1249 | 1250 | {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */ |
| 1250 | 1251 | {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */ |
| 1251 | 1252 | {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */ |
| @@ -60,7 +60,6 @@ config BRCMFMAC_PCIE · 59 unmodified lines | ||
| 60 | 60 | bool "PCIE bus interface support for FullMAC driver" |
| 61 | 61 | depends on BRCMFMAC |
| 62 | 62 | depends on PCI |
| 63 | − depends on HAS_DMA | |
| 64 | 63 | select BRCMFMAC_PROTO_MSGBUF |
| 65 | 64 | select FW_LOADER |
| 66 | 65 | ---help--- |
| @@ -7,7 +7,7 @@ config QTNFMAC · 6 unmodified lines | ||
| 7 | 7 | config QTNFMAC_PEARL_PCIE |
| 8 | 8 | tristate "Quantenna QSR10g PCIe support" |
| 9 | 9 | default n |
| 10 | − depends on HAS_DMA && PCI && CFG80211 | |
| 10 | + depends on PCI && CFG80211 | |
| 11 | 11 | select QTNFMAC |
| 12 | 12 | select FW_LOADER |
| 13 | 13 | select CRC32 |
| @@ -1810,7 +1810,7 @@ static int talk_to_netback(struct xenbus_device *dev, · 1809 unmodified lines | ||
| 1810 | 1810 | err = xen_net_read_mac(dev, info->netdev->dev_addr); |
| 1811 | 1811 | if (err) { |
| 1812 | 1812 | xenbus_dev_fatal(dev, err, "parsing %s/mac", dev->nodename); |
| 1813 | − goto out; | |
| 1813 | + goto out_unlocked; | |
| 1814 | 1814 | } |
| 1815 | 1815 | |
| 1816 | 1816 | rtnl_lock(); |
| @@ -1925,6 +1925,7 @@ abort_transaction_no_dev_fatal: · 108 unmodified lines | ||
| 1925 | 1925 | xennet_destroy_queues(info); |
| 1926 | 1926 | out: |
| 1927 | 1927 | rtnl_unlock(); |
| 1928 | +out_unlocked: | |
| 1928 | 1929 | device_unregister(&dev->dev); |
| 1929 | 1930 | return err; |
| 1930 | 1931 | } |
| @@ -1950,10 +1951,6 @@ static int xennet_connect(struct net_device *dev) · 19 unmodified lines | ||
| 1950 | 1951 | /* talk_to_netback() sets the correct number of queues */ |
| 1951 | 1952 | num_queues = dev->real_num_tx_queues; |
| 1952 | 1953 | |
| 1953 | − rtnl_lock(); | |
| 1954 | − netdev_update_features(dev); | |
| 1955 | − rtnl_unlock(); | |
| 1956 | − | |
| 1957 | 1954 | if (dev->reg_state == NETREG_UNINITIALIZED) { |
| 1958 | 1955 | err = register_netdev(dev); |
| 1959 | 1956 | if (err) { |
| @@ -1963,6 +1960,10 @@ static int xennet_connect(struct net_device *dev) · 3 unmodified lines | ||
| 1963 | 1960 | } |
| 1964 | 1961 | } |
| 1965 | 1962 | |
| 1963 | + rtnl_lock(); | |
| 1964 | + netdev_update_features(dev); | |
| 1965 | + rtnl_unlock(); | |
| 1966 | + | |
| 1966 | 1967 | /* |
| 1967 | 1968 | * All public and private state should now be sane. Get |
| 1968 | 1969 | * ready to start sending and receiving packets and give the driver |
| @@ -74,7 +74,7 @@ static void pn533_recv_response(struct urb *urb) · 73 unmodified lines | ||
| 74 | 74 | struct sk_buff *skb = NULL; |
| 75 | 75 | |
| 76 | 76 | if (!urb->status) { |
| 77 | − skb = alloc_skb(urb->actual_length, GFP_KERNEL); | |
| 77 | + skb = alloc_skb(urb->actual_length, GFP_ATOMIC); | |
| 78 | 78 | if (!skb) { |
| 79 | 79 | nfc_err(&phy->udev->dev, "failed to alloc memory\n"); |
| 80 | 80 | } else { |
| @@ -186,7 +186,7 @@ static int pn533_usb_send_frame(struct pn533 *dev, · 105 unmodified lines | ||
| 186 | 186 | |
| 187 | 187 | if (dev->protocol_type == PN533_PROTO_REQ_RESP) { |
| 188 | 188 | /* request for response for sent packet directly */ |
| 189 | − rc = pn533_submit_urb_for_response(phy, GFP_ATOMIC); | |
| 189 | + rc = pn533_submit_urb_for_response(phy, GFP_KERNEL); | |
| 190 | 190 | if (rc) |
| 191 | 191 | goto error; |
| 192 | 192 | } else if (dev->protocol_type == PN533_PROTO_REQ_ACK_RESP) { |
| @@ -414,7 +414,8 @@ static int pmem_attach_disk(struct device *dev, · 413 unmodified lines | ||
| 414 | 414 | blk_queue_logical_block_size(q, pmem_sector_size(ndns)); |
| 415 | 415 | blk_queue_max_hw_sectors(q, UINT_MAX); |
| 416 | 416 | blk_queue_flag_set(QUEUE_FLAG_NONROT, q); |
| 417 | − blk_queue_flag_set(QUEUE_FLAG_DAX, q); | |
| 417 | + if (pmem->pfn_flags & PFN_MAP) | |
| 418 | + blk_queue_flag_set(QUEUE_FLAG_DAX, q); | |
| 418 | 419 | q->queuedata = pmem; |
| 419 | 420 | |
| 420 | 421 | disk = alloc_disk_node(0, nid); |
| @@ -1808,6 +1808,7 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, · 1807 unmodified lines | ||
| 1808 | 1808 | u32 max_segments = |
| 1809 | 1809 | (ctrl->max_hw_sectors / (ctrl->page_size >> 9)) + 1; |
| 1810 | 1810 | |
| 1811 | + max_segments = min_not_zero(max_segments, ctrl->max_segments); | |
| 1811 | 1812 | blk_queue_max_hw_sectors(q, ctrl->max_hw_sectors); |
| 1812 | 1813 | blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX)); |
| 1813 | 1814 | } |
| @@ -2790,6 +2790,9 @@ nvme_fc_delete_association(struct nvme_fc_ctrl *ctrl) · 2789 unmodified lines | ||
| 2790 | 2790 | /* re-enable the admin_q so anything new can fast fail */ |
| 2791 | 2791 | blk_mq_unquiesce_queue(ctrl->ctrl.admin_q); |
| 2792 | 2792 | |
| 2793 | + /* resume the io queues so that things will fast fail */ | |
| 2794 | + nvme_start_queues(&ctrl->ctrl); | |
| 2795 | + | |
| 2793 | 2796 | nvme_fc_ctlr_inactive_on_rport(ctrl); |
| 2794 | 2797 | } |
| 2795 | 2798 | |
| @@ -2804,9 +2807,6 @@ nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl) · 8 unmodified lines | ||
| 2804 | 2807 | * waiting for io to terminate |
| 2805 | 2808 | */ |
| 2806 | 2809 | nvme_fc_delete_association(ctrl); |
| 2807 | − | |
| 2808 | − /* resume the io queues so that things will fast fail */ | |
| 2809 | − nvme_start_queues(nctrl); | |
| 2810 | 2810 | } |
| 2811 | 2811 | |
| 2812 | 2812 | static void |
| @@ -170,6 +170,7 @@ struct nvme_ctrl { · 169 unmodified lines | ||
| 170 | 170 | u64 cap; |
| 171 | 171 | u32 page_size; |
| 172 | 172 | u32 max_hw_sectors; |
| 173 | + u32 max_segments; | |
| 173 | 174 | u16 oncs; |
| 174 | 175 | u16 oacs; |
| 175 | 176 | u16 nssa; |
| @@ -38,6 +38,13 @@ · 37 unmodified lines | ||
| 38 | 38 | |
| 39 | 39 | #define SGES_PER_PAGE (PAGE_SIZE / sizeof(struct nvme_sgl_desc)) |
| 40 | 40 | |
| 41 | +/* | |
| 42 | + * These can be higher, but we need to ensure that any command doesn't | |
| 43 | + * require an sg allocation that needs more than a page of data. | |
| 44 | + */ | |
| 45 | +#define NVME_MAX_KB_SZ 4096 | |
| 46 | +#define NVME_MAX_SEGS 127 | |
| 47 | + | |
| 41 | 48 | static int use_threaded_interrupts; |
| 42 | 49 | module_param(use_threaded_interrupts, int, 0); |
| 43 | 50 | |
| @@ -100,6 +107,8 @@ struct nvme_dev { · 56 unmodified lines | ||
| 100 | 107 | struct nvme_ctrl ctrl; |
| 101 | 108 | struct completion ioq_wait; |
| 102 | 109 | |
| 110 | + mempool_t *iod_mempool; | |
| 111 | + | |
| 103 | 112 | /* shadow doorbell buffer support: */ |
| 104 | 113 | u32 *dbbuf_dbs; |
| 105 | 114 | dma_addr_t dbbuf_dbs_dma_addr; |
| @@ -477,10 +486,7 @@ static blk_status_t nvme_init_iod(struct request *rq, struct nvme_dev *dev) · 371 unmodified lines | ||
| 477 | 486 | iod->use_sgl = nvme_pci_use_sgls(dev, rq); |
| 478 | 487 | |
| 479 | 488 | if (nseg > NVME_INT_PAGES || size > NVME_INT_BYTES(dev)) { |
| 480 | − size_t alloc_size = nvme_pci_iod_alloc_size(dev, size, nseg, | |
| 481 | − iod->use_sgl); | |
| 482 | − | |
| 483 | − iod->sg = kmalloc(alloc_size, GFP_ATOMIC); | |
| 489 | + iod->sg = mempool_alloc(dev->iod_mempool, GFP_ATOMIC); | |
| 484 | 490 | if (!iod->sg) |
| 485 | 491 | return BLK_STS_RESOURCE; |
| 486 | 492 | } else { |
| @@ -526,7 +532,7 @@ static void nvme_free_iod(struct nvme_dev *dev, struct request *req) · 39 unmodified lines | ||
| 526 | 532 | } |
| 527 | 533 | |
| 528 | 534 | if (iod->sg != iod->inline_sg) |
| 529 | − kfree(iod->sg); | |
| 535 | + mempool_free(iod->sg, dev->iod_mempool); | |
| 530 | 536 | } |
| 531 | 537 | |
| 532 | 538 | #ifdef CONFIG_BLK_DEV_INTEGRITY |
| @@ -2280,6 +2286,7 @@ static void nvme_pci_free_ctrl(struct nvme_ctrl *ctrl) · 1747 unmodified lines | ||
| 2280 | 2286 | blk_put_queue(dev->ctrl.admin_q); |
| 2281 | 2287 | kfree(dev->queues); |
| 2282 | 2288 | free_opal_dev(dev->ctrl.opal_dev); |
| 2289 | + mempool_destroy(dev->iod_mempool); | |
| 2283 | 2290 | kfree(dev); |
| 2284 | 2291 | } |
| 2285 | 2292 | |
| @@ -2289,6 +2296,7 @@ static void nvme_remove_dead_ctrl(struct nvme_dev *dev, int status) · 3 unmodified lines | ||
| 2289 | 2296 | |
| 2290 | 2297 | nvme_get_ctrl(&dev->ctrl); |
| 2291 | 2298 | nvme_dev_disable(dev, false); |
| 2299 | + nvme_kill_queues(&dev->ctrl); | |
| 2292 | 2300 | if (!queue_work(nvme_wq, &dev->remove_work)) |
| 2293 | 2301 | nvme_put_ctrl(&dev->ctrl); |
| 2294 | 2302 | } |
| @@ -2333,6 +2341,13 @@ static void nvme_reset_work(struct work_struct *work) · 38 unmodified lines | ||
| 2333 | 2341 | if (result) |
| 2334 | 2342 | goto out; |
| 2335 | 2343 | |
| 2344 | + /* | |
| 2345 | + * Limit the max command size to prevent iod->sg allocations going | |
| 2346 | + * over a single page. | |
| 2347 | + */ | |
| 2348 | + dev->ctrl.max_hw_sectors = NVME_MAX_KB_SZ << 1; | |
| 2349 | + dev->ctrl.max_segments = NVME_MAX_SEGS; | |
| 2350 | + | |
| 2336 | 2351 | result = nvme_init_identify(&dev->ctrl); |
| 2337 | 2352 | if (result) |
| 2338 | 2353 | goto out; |
| @@ -2405,7 +2420,6 @@ static void nvme_remove_dead_ctrl_work(struct work_struct *work) · 66 unmodified lines | ||
| 2405 | 2420 | struct nvme_dev *dev = container_of(work, struct nvme_dev, remove_work); |
| 2406 | 2421 | struct pci_dev *pdev = to_pci_dev(dev->dev); |
| 2407 | 2422 | |
| 2408 | − nvme_kill_queues(&dev->ctrl); | |
| 2409 | 2423 | if (pci_get_drvdata(pdev)) |
| 2410 | 2424 | device_release_driver(&pdev->dev); |
| 2411 | 2425 | nvme_put_ctrl(&dev->ctrl); |
| @@ -2509,6 +2523,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 97 unmodified lines | ||
| 2509 | 2523 | int node, result = -ENOMEM; |
| 2510 | 2524 | struct nvme_dev *dev; |
| 2511 | 2525 | unsigned long quirks = id->driver_data; |
| 2526 | + size_t alloc_size; | |
| 2512 | 2527 | |
| 2513 | 2528 | node = dev_to_node(&pdev->dev); |
| 2514 | 2529 | if (node == NUMA_NO_NODE) |
| @@ -2546,6 +2561,23 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 31 unmodified lines | ||
| 2546 | 2561 | if (result) |
| 2547 | 2562 | goto release_pools; |
| 2548 | 2563 | |
| 2564 | + /* | |
| 2565 | + * Double check that our mempool alloc size will cover the biggest | |
| 2566 | + * command we support. | |
| 2567 | + */ | |
| 2568 | + alloc_size = nvme_pci_iod_alloc_size(dev, NVME_MAX_KB_SZ, | |
| 2569 | + NVME_MAX_SEGS, true); | |
| 2570 | + WARN_ON_ONCE(alloc_size > PAGE_SIZE); | |
| 2571 | + | |
| 2572 | + dev->iod_mempool = mempool_create_node(1, mempool_kmalloc, | |
| 2573 | + mempool_kfree, | |
| 2574 | + (void *) alloc_size, | |
| 2575 | + GFP_KERNEL, node); | |
| 2576 | + if (!dev->iod_mempool) { | |
| 2577 | + result = -ENOMEM; | |
| 2578 | + goto release_pools; | |
| 2579 | + } | |
| 2580 | + | |
| 2549 | 2581 | dev_info(dev->ctrl.device, "pci function %s\n", dev_name(&pdev->dev)); |
| 2550 | 2582 | |
| 2551 | 2583 | nvme_get_ctrl(&dev->ctrl); |
| @@ -560,12 +560,6 @@ static void nvme_rdma_free_queue(struct nvme_rdma_queue *queue) · 559 unmodified lines | ||
| 560 | 560 | if (!test_and_clear_bit(NVME_RDMA_Q_ALLOCATED, &queue->flags)) |
| 561 | 561 | return; |
| 562 | 562 | |
| 563 | − if (nvme_rdma_queue_idx(queue) == 0) { | |
| 564 | − nvme_rdma_free_qe(queue->device->dev, | |
| 565 | − &queue->ctrl->async_event_sqe, | |
| 566 | − sizeof(struct nvme_command), DMA_TO_DEVICE); | |
| 567 | − } | |
| 568 | − | |
| 569 | 563 | nvme_rdma_destroy_queue_ib(queue); |
| 570 | 564 | rdma_destroy_id(queue->cm_id); |
| 571 | 565 | } |
| @@ -698,7 +692,7 @@ static struct blk_mq_tag_set *nvme_rdma_alloc_tagset(struct nvme_ctrl *nctrl, · 126 unmodified lines | ||
| 698 | 692 | set = &ctrl->tag_set; |
| 699 | 693 | memset(set, 0, sizeof(*set)); |
| 700 | 694 | set->ops = &nvme_rdma_mq_ops; |
| 701 | − set->queue_depth = nctrl->opts->queue_size; | |
| 695 | + set->queue_depth = nctrl->sqsize + 1; | |
| 702 | 696 | set->reserved_tags = 1; /* fabric connect */ |
| 703 | 697 | set->numa_node = NUMA_NO_NODE; |
| 704 | 698 | set->flags = BLK_MQ_F_SHOULD_MERGE; |
| @@ -734,11 +728,15 @@ out: · 29 unmodified lines | ||
| 734 | 728 | static void nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl, |
| 735 | 729 | bool remove) |
| 736 | 730 | { |
| 737 | − nvme_rdma_stop_queue(&ctrl->queues[0]); | |
| 738 | 731 | if (remove) { |
| 739 | 732 | blk_cleanup_queue(ctrl->ctrl.admin_q); |
| 740 | 733 | nvme_rdma_free_tagset(&ctrl->ctrl, ctrl->ctrl.admin_tagset); |
| 741 | 734 | } |
| 735 | + if (ctrl->async_event_sqe.data) { | |
| 736 | + nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe, | |
| 737 | + sizeof(struct nvme_command), DMA_TO_DEVICE); | |
| 738 | + ctrl->async_event_sqe.data = NULL; | |
| 739 | + } | |
| 742 | 740 | nvme_rdma_free_queue(&ctrl->queues[0]); |
| 743 | 741 | } |
| 744 | 742 | |
| @@ -755,11 +753,16 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl, · 10 unmodified lines | ||
| 755 | 753 | |
| 756 | 754 | ctrl->max_fr_pages = nvme_rdma_get_max_fr_pages(ctrl->device->dev); |
| 757 | 755 | |
| 756 | + error = nvme_rdma_alloc_qe(ctrl->device->dev, &ctrl->async_event_sqe, | |
| 757 | + sizeof(struct nvme_command), DMA_TO_DEVICE); | |
| 758 | + if (error) | |
| 759 | + goto out_free_queue; | |
| 760 | + | |
| 758 | 761 | if (new) { |
| 759 | 762 | ctrl->ctrl.admin_tagset = nvme_rdma_alloc_tagset(&ctrl->ctrl, true); |
| 760 | 763 | if (IS_ERR(ctrl->ctrl.admin_tagset)) { |
| 761 | 764 | error = PTR_ERR(ctrl->ctrl.admin_tagset); |
| 762 | − goto out_free_queue; | |
| 765 | + goto out_free_async_qe; | |
| 763 | 766 | } |
| 764 | 767 | |
| 765 | 768 | ctrl->ctrl.admin_q = blk_mq_init_queue(&ctrl->admin_tag_set); |
| @@ -795,12 +798,6 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl, · 29 unmodified lines | ||
| 795 | 798 | if (error) |
| 796 | 799 | goto out_stop_queue; |
| 797 | 800 | |
| 798 | − error = nvme_rdma_alloc_qe(ctrl->queues[0].device->dev, | |
| 799 | − &ctrl->async_event_sqe, sizeof(struct nvme_command), | |
| 800 | − DMA_TO_DEVICE); | |
| 801 | − if (error) | |
| 802 | − goto out_stop_queue; | |
| 803 | − | |
| 804 | 801 | return 0; |
| 805 | 802 | |
| 806 | 803 | out_stop_queue: |
| @@ -811,6 +808,9 @@ out_cleanup_queue: · 4 unmodified lines | ||
| 811 | 808 | out_free_tagset: |
| 812 | 809 | if (new) |
| 813 | 810 | nvme_rdma_free_tagset(&ctrl->ctrl, ctrl->ctrl.admin_tagset); |
| 811 | +out_free_async_qe: | |
| 812 | + nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe, | |
| 813 | + sizeof(struct nvme_command), DMA_TO_DEVICE); | |
| 814 | 814 | out_free_queue: |
| 815 | 815 | nvme_rdma_free_queue(&ctrl->queues[0]); |
| 816 | 816 | return error; |
| @@ -819,7 +819,6 @@ out_free_queue: · 2 unmodified lines | ||
| 819 | 819 | static void nvme_rdma_destroy_io_queues(struct nvme_rdma_ctrl *ctrl, |
| 820 | 820 | bool remove) |
| 821 | 821 | { |
| 822 | − nvme_rdma_stop_io_queues(ctrl); | |
| 823 | 822 | if (remove) { |
| 824 | 823 | blk_cleanup_queue(ctrl->ctrl.connect_q); |
| 825 | 824 | nvme_rdma_free_tagset(&ctrl->ctrl, ctrl->ctrl.tagset); |
| @@ -888,9 +887,9 @@ static void nvme_rdma_free_ctrl(struct nvme_ctrl *nctrl) · 62 unmodified lines | ||
| 888 | 887 | list_del(&ctrl->list); |
| 889 | 888 | mutex_unlock(&nvme_rdma_ctrl_mutex); |
| 890 | 889 | |
| 891 | − kfree(ctrl->queues); | |
| 892 | 890 | nvmf_free_options(nctrl->opts); |
| 893 | 891 | free_ctrl: |
| 892 | + kfree(ctrl->queues); | |
| 894 | 893 | kfree(ctrl); |
| 895 | 894 | } |
| 896 | 895 | |
| @@ -949,6 +948,7 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work) · 52 unmodified lines | ||
| 949 | 948 | return; |
| 950 | 949 | |
| 951 | 950 | destroy_admin: |
| 951 | + nvme_rdma_stop_queue(&ctrl->queues[0]); | |
| 952 | 952 | nvme_rdma_destroy_admin_queue(ctrl, false); |
| 953 | 953 | requeue: |
| 954 | 954 | dev_info(ctrl->ctrl.device, "Failed reconnect attempt %d\n", |
| @@ -965,12 +965,14 @@ static void nvme_rdma_error_recovery_work(struct work_struct *work) · 10 unmodified lines | ||
| 965 | 965 | |
| 966 | 966 | if (ctrl->ctrl.queue_count > 1) { |
| 967 | 967 | nvme_stop_queues(&ctrl->ctrl); |
| 968 | + nvme_rdma_stop_io_queues(ctrl); | |
| 968 | 969 | blk_mq_tagset_busy_iter(&ctrl->tag_set, |
| 969 | 970 | nvme_cancel_request, &ctrl->ctrl); |
| 970 | 971 | nvme_rdma_destroy_io_queues(ctrl, false); |
| 971 | 972 | } |
| 972 | 973 | |
| 973 | 974 | blk_mq_quiesce_queue(ctrl->ctrl.admin_q); |
| 975 | + nvme_rdma_stop_queue(&ctrl->queues[0]); | |
| 974 | 976 | blk_mq_tagset_busy_iter(&ctrl->admin_tag_set, |
| 975 | 977 | nvme_cancel_request, &ctrl->ctrl); |
| 976 | 978 | nvme_rdma_destroy_admin_queue(ctrl, false); |
| @@ -1736,6 +1738,7 @@ static void nvme_rdma_shutdown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown) · 759 unmodified lines | ||
| 1736 | 1738 | { |
| 1737 | 1739 | if (ctrl->ctrl.queue_count > 1) { |
| 1738 | 1740 | nvme_stop_queues(&ctrl->ctrl); |
| 1741 | + nvme_rdma_stop_io_queues(ctrl); | |
| 1739 | 1742 | blk_mq_tagset_busy_iter(&ctrl->tag_set, |
| 1740 | 1743 | nvme_cancel_request, &ctrl->ctrl); |
| 1741 | 1744 | nvme_rdma_destroy_io_queues(ctrl, shutdown); |
| @@ -1747,6 +1750,7 @@ static void nvme_rdma_shutdown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown) · 5 unmodified lines | ||
| 1747 | 1750 | nvme_disable_ctrl(&ctrl->ctrl, ctrl->ctrl.cap); |
| 1748 | 1751 | |
| 1749 | 1752 | blk_mq_quiesce_queue(ctrl->ctrl.admin_q); |
| 1753 | + nvme_rdma_stop_queue(&ctrl->queues[0]); | |
| 1750 | 1754 | blk_mq_tagset_busy_iter(&ctrl->admin_tag_set, |
| 1751 | 1755 | nvme_cancel_request, &ctrl->ctrl); |
| 1752 | 1756 | blk_mq_unquiesce_queue(ctrl->ctrl.admin_q); |
| @@ -1932,11 +1936,6 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev, · 179 unmodified lines | ||
| 1932 | 1936 | goto out_free_ctrl; |
| 1933 | 1937 | } |
| 1934 | 1938 | |
| 1935 | − ret = nvme_init_ctrl(&ctrl->ctrl, dev, &nvme_rdma_ctrl_ops, | |
| 1936 | − 0 /* no quirks, we're perfect! */); | |
| 1937 | − if (ret) | |
| 1938 | − goto out_free_ctrl; | |
| 1939 | − | |
| 1940 | 1939 | INIT_DELAYED_WORK(&ctrl->reconnect_work, |
| 1941 | 1940 | nvme_rdma_reconnect_ctrl_work); |
| 1942 | 1941 | INIT_WORK(&ctrl->err_work, nvme_rdma_error_recovery_work); |
| @@ -1950,14 +1949,19 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev, · 7 unmodified lines | ||
| 1950 | 1949 | ctrl->queues = kcalloc(ctrl->ctrl.queue_count, sizeof(*ctrl->queues), |
| 1951 | 1950 | GFP_KERNEL); |
| 1952 | 1951 | if (!ctrl->queues) |
| 1953 | − goto out_uninit_ctrl; | |
| 1952 | + goto out_free_ctrl; | |
| 1953 | + | |
| 1954 | + ret = nvme_init_ctrl(&ctrl->ctrl, dev, &nvme_rdma_ctrl_ops, | |
| 1955 | + 0 /* no quirks, we're perfect! */); | |
| 1956 | + if (ret) | |
| 1957 | + goto out_kfree_queues; | |
| 1954 | 1958 | |
| 1955 | 1959 | changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING); |
| 1956 | 1960 | WARN_ON_ONCE(!changed); |
| 1957 | 1961 | |
| 1958 | 1962 | ret = nvme_rdma_configure_admin_queue(ctrl, true); |
| 1959 | 1963 | if (ret) |
| 1960 | − goto out_kfree_queues; | |
| 1964 | + goto out_uninit_ctrl; | |
| 1961 | 1965 | |
| 1962 | 1966 | /* sanity check icdoff */ |
| 1963 | 1967 | if (ctrl->ctrl.icdoff) { |
| @@ -1974,20 +1978,19 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev, · 10 unmodified lines | ||
| 1974 | 1978 | goto out_remove_admin_queue; |
| 1975 | 1979 | } |
| 1976 | 1980 | |
| 1977 | − if (opts->queue_size > ctrl->ctrl.maxcmd) { | |
| 1978 | − /* warn if maxcmd is lower than queue_size */ | |
| 1979 | − dev_warn(ctrl->ctrl.device, | |
| 1980 | − "queue_size %zu > ctrl maxcmd %u, clamping down\n", | |
| 1981 | − opts->queue_size, ctrl->ctrl.maxcmd); | |
| 1982 | − opts->queue_size = ctrl->ctrl.maxcmd; | |
| 1983 | − } | |
| 1984 | − | |
| 1981 | + /* only warn if argument is too large here, will clamp later */ | |
| 1985 | 1982 | if (opts->queue_size > ctrl->ctrl.sqsize + 1) { |
| 1986 | − /* warn if sqsize is lower than queue_size */ | |
| 1987 | 1983 | dev_warn(ctrl->ctrl.device, |
| 1988 | 1984 | "queue_size %zu > ctrl sqsize %u, clamping down\n", |
| 1989 | 1985 | opts->queue_size, ctrl->ctrl.sqsize + 1); |
| 1990 | − opts->queue_size = ctrl->ctrl.sqsize + 1; | |
| 1986 | + } | |
| 1987 | + | |
| 1988 | + /* warn if maxcmd is lower than sqsize+1 */ | |
| 1989 | + if (ctrl->ctrl.sqsize + 1 > ctrl->ctrl.maxcmd) { | |
| 1990 | + dev_warn(ctrl->ctrl.device, | |
| 1991 | + "sqsize %u > ctrl maxcmd %u, clamping down\n", | |
| 1992 | + ctrl->ctrl.sqsize + 1, ctrl->ctrl.maxcmd); | |
| 1993 | + ctrl->ctrl.sqsize = ctrl->ctrl.maxcmd - 1; | |
| 1991 | 1994 | } |
| 1992 | 1995 | |
| 1993 | 1996 | if (opts->nr_io_queues) { |
| @@ -2013,15 +2016,16 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev, · 19 unmodified lines | ||
| 2013 | 2016 | return &ctrl->ctrl; |
| 2014 | 2017 | |
| 2015 | 2018 | out_remove_admin_queue: |
| 2019 | + nvme_rdma_stop_queue(&ctrl->queues[0]); | |
| 2016 | 2020 | nvme_rdma_destroy_admin_queue(ctrl, true); |
| 2017 | −out_kfree_queues: | |
| 2018 | − kfree(ctrl->queues); | |
| 2019 | 2021 | out_uninit_ctrl: |
| 2020 | 2022 | nvme_uninit_ctrl(&ctrl->ctrl); |
| 2021 | 2023 | nvme_put_ctrl(&ctrl->ctrl); |
| 2022 | 2024 | if (ret > 0) |
| 2023 | 2025 | ret = -EIO; |
| 2024 | 2026 | return ERR_PTR(ret); |
| 2027 | +out_kfree_queues: | |
| 2028 | + kfree(ctrl->queues); | |
| 2025 | 2029 | out_free_ctrl: |
| 2026 | 2030 | kfree(ctrl); |
| 2027 | 2031 | return ERR_PTR(ret); |
| @@ -686,6 +686,14 @@ static void nvmet_start_ctrl(struct nvmet_ctrl *ctrl) · 685 unmodified lines | ||
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | ctrl->csts = NVME_CSTS_RDY; |
| 689 | + | |
| 690 | + /* | |
| 691 | + * Controllers that are not yet enabled should not really enforce the | |
| 692 | + * keep alive timeout, but we still want to track a timeout and cleanup | |
| 693 | + * in case a host died before it enabled the controller. Hence, simply | |
| 694 | + * reset the keep alive timer when the controller is enabled. | |
| 695 | + */ | |
| 696 | + mod_delayed_work(system_wq, &ctrl->ka_work, ctrl->kato * HZ); | |
| 689 | 697 | } |
| 690 | 698 | |
| 691 | 699 | static void nvmet_clear_ctrl(struct nvmet_ctrl *ctrl) |
| @@ -598,7 +598,7 @@ static int _generic_set_opp_regulator(const struct opp_table *opp_table, · 597 unmodified lines | ||
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | /* Scaling up? Scale voltage before frequency */ |
| 601 | − if (freq > old_freq) { | |
| 601 | + if (freq >= old_freq) { | |
| 602 | 602 | ret = _set_opp_voltage(dev, reg, new_supply); |
| 603 | 603 | if (ret) |
| 604 | 604 | goto restore_voltage; |
| @@ -28,10 +28,10 @@ obj-$(CONFIG_PCI_PF_STUB) += pci-pf-stub.o · 27 unmodified lines | ||
| 28 | 28 | obj-$(CONFIG_PCI_ECAM) += ecam.o |
| 29 | 29 | obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o |
| 30 | 30 | |
| 31 | −obj-y += controller/ | |
| 32 | −obj-y += switch/ | |
| 33 | − | |
| 34 | 31 | # Endpoint library must be initialized before its users |
| 35 | 32 | obj-$(CONFIG_PCI_ENDPOINT) += endpoint/ |
| 36 | 33 | |
| 34 | +obj-y += controller/ | |
| 35 | +obj-y += switch/ | |
| 36 | + | |
| 37 | 37 | ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG |
| @@ -96,7 +96,6 @@ config PCI_HOST_GENERIC · 95 unmodified lines | ||
| 96 | 96 | depends on OF |
| 97 | 97 | select PCI_HOST_COMMON |
| 98 | 98 | select IRQ_DOMAIN |
| 99 | − select PCI_DOMAINS | |
| 100 | 99 | help |
| 101 | 100 | Say Y here if you want to support a simple generic PCI host |
| 102 | 101 | controller, such as the one emulated by kvmtool. |
| @@ -138,7 +137,6 @@ config PCI_VERSATILE · 35 unmodified lines | ||
| 138 | 137 | |
| 139 | 138 | config PCIE_IPROC |
| 140 | 139 | tristate |
| 141 | − select PCI_DOMAINS | |
| 142 | 140 | help |
| 143 | 141 | This enables the iProc PCIe core controller support for Broadcom's |
| 144 | 142 | iProc family of SoCs. An appropriate bus interface driver needs |
| @@ -176,7 +174,6 @@ config PCIE_IPROC_MSI · 31 unmodified lines | ||
| 176 | 174 | config PCIE_ALTERA |
| 177 | 175 | bool "Altera PCIe controller" |
| 178 | 176 | depends on ARM || NIOS2 || COMPILE_TEST |
| 179 | − select PCI_DOMAINS | |
| 180 | 177 | help |
| 181 | 178 | Say Y here if you want to enable PCIe controller support on Altera |
| 182 | 179 | FPGA. |
| @@ -7,7 +7,6 @@ · 6 unmodified lines | ||
| 7 | 7 | * All rights reserved. |
| 8 | 8 | * |
| 9 | 9 | * Send feedback to <kristen.c.accardi@intel.com> |
| 10 | − * | |
| 11 | 10 | */ |
| 12 | 11 | |
| 13 | 12 | #include <linux/module.h> |
| @@ -87,8 +86,17 @@ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *pdev) · 73 unmodified lines | ||
| 87 | 86 | return 0; |
| 88 | 87 | |
| 89 | 88 | /* If _OSC exists, we should not evaluate OSHP */ |
| 89 | + | |
| 90 | + /* | |
| 91 | + * If there's no ACPI host bridge (i.e., ACPI support is compiled | |
| 92 | + * into the kernel but the hardware platform doesn't support ACPI), | |
| 93 | + * there's nothing to do here. | |
| 94 | + */ | |
| 90 | 95 | host = pci_find_host_bridge(pdev->bus); |
| 91 | 96 | root = acpi_pci_find_root(ACPI_HANDLE(&host->dev)); |
| 97 | + if (!root) | |
| 98 | + return 0; | |
| 99 | + | |
| 92 | 100 | if (root->osc_support_set) |
| 93 | 101 | goto no_control; |
| 94 | 102 | |
| @@ -1463,7 +1463,7 @@ static char *xgene_pmu_dev_name(struct device *dev, u32 type, int id) · 1462 unmodified lines | ||
| 1463 | 1463 | case PMU_TYPE_IOB: |
| 1464 | 1464 | return devm_kasprintf(dev, GFP_KERNEL, "iob%d", id); |
| 1465 | 1465 | case PMU_TYPE_IOB_SLOW: |
| 1466 | − return devm_kasprintf(dev, GFP_KERNEL, "iob-slow%d", id); | |
| 1466 | + return devm_kasprintf(dev, GFP_KERNEL, "iob_slow%d", id); | |
| 1467 | 1467 | case PMU_TYPE_MCB: |
| 1468 | 1468 | return devm_kasprintf(dev, GFP_KERNEL, "mcb%d", id); |
| 1469 | 1469 | case PMU_TYPE_MC: |
| @@ -333,7 +333,7 @@ static int owl_pin_config_set(struct pinctrl_dev *pctrldev, · 332 unmodified lines | ||
| 333 | 333 | unsigned long flags; |
| 334 | 334 | unsigned int param; |
| 335 | 335 | u32 reg, bit, width, arg; |
| 336 | − int ret, i; | |
| 336 | + int ret = 0, i; | |
| 337 | 337 | |
| 338 | 338 | info = &pctrl->soc->padinfo[pin]; |
| 339 | 339 | |
| @@ -101,10 +101,11 @@ struct pinctrl_dev *of_pinctrl_get(struct device_node *np) · 100 unmodified lines | ||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static int dt_to_map_one_config(struct pinctrl *p, |
| 104 | − struct pinctrl_dev *pctldev, | |
| 104 | + struct pinctrl_dev *hog_pctldev, | |
| 105 | 105 | const char *statename, |
| 106 | 106 | struct device_node *np_config) |
| 107 | 107 | { |
| 108 | + struct pinctrl_dev *pctldev = NULL; | |
| 108 | 109 | struct device_node *np_pctldev; |
| 109 | 110 | const struct pinctrl_ops *ops; |
| 110 | 111 | int ret; |
| @@ -123,8 +124,10 @@ static int dt_to_map_one_config(struct pinctrl *p, · 12 unmodified lines | ||
| 123 | 124 | return -EPROBE_DEFER; |
| 124 | 125 | } |
| 125 | 126 | /* If we're creating a hog we can use the passed pctldev */ |
| 126 | − if (pctldev && (np_pctldev == p->dev->of_node)) | |
| 127 | + if (hog_pctldev && (np_pctldev == p->dev->of_node)) { | |
| 128 | + pctldev = hog_pctldev; | |
| 127 | 129 | break; |
| 130 | + } | |
| 128 | 131 | pctldev = get_pinctrl_dev_from_of_node(np_pctldev); |
| 129 | 132 | if (pctldev) |
| 130 | 133 | break; |
| @@ -1459,6 +1459,9 @@ static int mtk_gpio_to_irq(struct gpio_chip *chip, unsigned int offset) · 1458 unmodified lines | ||
| 1459 | 1459 | struct mtk_pinctrl *hw = gpiochip_get_data(chip); |
| 1460 | 1460 | unsigned long eint_n; |
| 1461 | 1461 | |
| 1462 | + if (!hw->eint) | |
| 1463 | + return -ENOTSUPP; | |
| 1464 | + | |
| 1462 | 1465 | eint_n = offset; |
| 1463 | 1466 | |
| 1464 | 1467 | return mtk_eint_find_irq(hw->eint, eint_n); |
| @@ -1471,7 +1474,8 @@ static int mtk_gpio_set_config(struct gpio_chip *chip, unsigned int offset, · 6 unmodified lines | ||
| 1471 | 1474 | unsigned long eint_n; |
| 1472 | 1475 | u32 debounce; |
| 1473 | 1476 | |
| 1474 | − if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE) | |
| 1477 | + if (!hw->eint || | |
| 1478 | + pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE) | |
| 1475 | 1479 | return -ENOTSUPP; |
| 1476 | 1480 | |
| 1477 | 1481 | debounce = pinconf_to_config_argument(config); |
| @@ -1000,11 +1000,6 @@ static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev) · 999 unmodified lines | ||
| 1000 | 1000 | return -ENOMEM; |
| 1001 | 1001 | |
| 1002 | 1002 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 1003 | − if (!res) { | |
| 1004 | − dev_err(&pdev->dev, "Unable to get eint resource\n"); | |
| 1005 | − return -ENODEV; | |
| 1006 | − } | |
| 1007 | − | |
| 1008 | 1003 | pctl->eint->base = devm_ioremap_resource(&pdev->dev, res); |
| 1009 | 1004 | if (IS_ERR(pctl->eint->base)) |
| 1010 | 1005 | return PTR_ERR(pctl->eint->base); |
| @@ -1590,8 +1590,11 @@ static int pcs_save_context(struct pcs_device *pcs) · 1589 unmodified lines | ||
| 1590 | 1590 | |
| 1591 | 1591 | mux_bytes = pcs->width / BITS_PER_BYTE; |
| 1592 | 1592 | |
| 1593 | − if (!pcs->saved_vals) | |
| 1593 | + if (!pcs->saved_vals) { | |
| 1594 | 1594 | pcs->saved_vals = devm_kzalloc(pcs->dev, pcs->size, GFP_ATOMIC); |
| 1595 | + if (!pcs->saved_vals) | |
| 1596 | + return -ENOMEM; | |
| 1597 | + } | |
| 1595 | 1598 | |
| 1596 | 1599 | switch (pcs->width) { |
| 1597 | 1600 | case 64: |
| @@ -1651,8 +1654,13 @@ static int pinctrl_single_suspend(struct platform_device *pdev, · 53 unmodified lines | ||
| 1651 | 1654 | if (!pcs) |
| 1652 | 1655 | return -EINVAL; |
| 1653 | 1656 | |
| 1654 | − if (pcs->flags & PCS_CONTEXT_LOSS_OFF) | |
| 1655 | − pcs_save_context(pcs); | |
| 1657 | + if (pcs->flags & PCS_CONTEXT_LOSS_OFF) { | |
| 1658 | + int ret; | |
| 1659 | + | |
| 1660 | + ret = pcs_save_context(pcs); | |
| 1661 | + if (ret < 0) | |
| 1662 | + return ret; | |
| 1663 | + } | |
| 1656 | 1664 | |
| 1657 | 1665 | return pinctrl_force_sleep(pcs->pctl); |
| 1658 | 1666 | } |
| @@ -221,7 +221,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg) · 220 unmodified lines | ||
| 221 | 221 | } |
| 222 | 222 | pct = &sysoff->ts[0]; |
| 223 | 223 | for (i = 0; i < sysoff->n_samples; i++) { |
| 224 | − getnstimeofday64(&ts); | |
| 224 | + ktime_get_real_ts64(&ts); | |
| 225 | 225 | pct->sec = ts.tv_sec; |
| 226 | 226 | pct->nsec = ts.tv_nsec; |
| 227 | 227 | pct++; |
| @@ -230,7 +230,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg) · 2 unmodified lines | ||
| 230 | 230 | pct->nsec = ts.tv_nsec; |
| 231 | 231 | pct++; |
| 232 | 232 | } |
| 233 | − getnstimeofday64(&ts); | |
| 233 | + ktime_get_real_ts64(&ts); | |
| 234 | 234 | pct->sec = ts.tv_sec; |
| 235 | 235 | pct->nsec = ts.tv_nsec; |
| 236 | 236 | if (copy_to_user((void __user *)arg, sysoff, sizeof(*sysoff))) |
| @@ -374,7 +374,7 @@ static int qoriq_ptp_probe(struct platform_device *dev) · 373 unmodified lines | ||
| 374 | 374 | pr_err("ioremap ptp registers failed\n"); |
| 375 | 375 | goto no_ioremap; |
| 376 | 376 | } |
| 377 | − getnstimeofday64(&now); | |
| 377 | + ktime_get_real_ts64(&now); | |
| 378 | 378 | ptp_qoriq_settime(&qoriq_ptp->caps, &now); |
| 379 | 379 | |
| 380 | 380 | tmr_ctrl = |
| @@ -1222,80 +1222,37 @@ static void dasd_hosts_init(struct dentry *base_dentry, · 1221 unmodified lines | ||
| 1222 | 1222 | device->hosts_dentry = pde; |
| 1223 | 1223 | } |
| 1224 | 1224 | |
| 1225 | −/* | |
| 1226 | − * Allocate memory for a channel program with 'cplength' channel | |
| 1227 | − * command words and 'datasize' additional space. There are two | |
| 1228 | − * variantes: 1) dasd_kmalloc_request uses kmalloc to get the needed | |
| 1229 | − * memory and 2) dasd_smalloc_request uses the static ccw memory | |
| 1230 | − * that gets allocated for each device. | |
| 1231 | − */ | |
| 1232 | −struct dasd_ccw_req *dasd_kmalloc_request(int magic, int cplength, | |
| 1233 | − int datasize, | |
| 1234 | − struct dasd_device *device) | |
| 1235 | −{ | |
| 1236 | − struct dasd_ccw_req *cqr; | |
| 1237 | − | |
| 1238 | − /* Sanity checks */ | |
| 1239 | − BUG_ON(datasize > PAGE_SIZE || | |
| 1240 | − (cplength*sizeof(struct ccw1)) > PAGE_SIZE); | |
| 1241 | − | |
| 1242 | − cqr = kzalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC); | |
| 1243 | − if (cqr == NULL) | |
| 1244 | − return ERR_PTR(-ENOMEM); | |
| 1245 | − cqr->cpaddr = NULL; | |
| 1246 | − if (cplength > 0) { | |
| 1247 | − cqr->cpaddr = kcalloc(cplength, sizeof(struct ccw1), | |
| 1248 | − GFP_ATOMIC | GFP_DMA); | |
| 1249 | − if (cqr->cpaddr == NULL) { | |
| 1250 | − kfree(cqr); | |
| 1251 | − return ERR_PTR(-ENOMEM); | |
| 1252 | − } | |
| 1253 | − } | |
| 1254 | − cqr->data = NULL; | |
| 1255 | − if (datasize > 0) { | |
| 1256 | − cqr->data = kzalloc(datasize, GFP_ATOMIC | GFP_DMA); | |
| 1257 | − if (cqr->data == NULL) { | |
| 1258 | − kfree(cqr->cpaddr); | |
| 1259 | − kfree(cqr); | |
| 1260 | − return ERR_PTR(-ENOMEM); | |
| 1261 | − } | |
| 1262 | − } | |
| 1263 | − cqr->magic = magic; | |
| 1264 | − set_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags); | |
| 1265 | − dasd_get_device(device); | |
| 1266 | − return cqr; | |
| 1267 | −} | |
| 1268 | −EXPORT_SYMBOL(dasd_kmalloc_request); | |
| 1269 | − | |
| 1270 | −struct dasd_ccw_req *dasd_smalloc_request(int magic, int cplength, | |
| 1271 | − int datasize, | |
| 1272 | − struct dasd_device *device) | |
| 1225 | +struct dasd_ccw_req *dasd_smalloc_request(int magic, int cplength, int datasize, | |
| 1226 | + struct dasd_device *device, | |
| 1227 | + struct dasd_ccw_req *cqr) | |
| 1273 | 1228 | { |
| 1274 | 1229 | unsigned long flags; |
| 1275 | − struct dasd_ccw_req *cqr; | |
| 1276 | − char *data; | |
| 1277 | − int size; | |
| 1230 | + char *data, *chunk; | |
| 1231 | + int size = 0; | |
| 1278 | 1232 | |
| 1279 | − size = (sizeof(struct dasd_ccw_req) + 7L) & -8L; | |
| 1280 | 1233 | if (cplength > 0) |
| 1281 | 1234 | size += cplength * sizeof(struct ccw1); |
| 1282 | 1235 | if (datasize > 0) |
| 1283 | 1236 | size += datasize; |
| 1237 | + if (!cqr) | |
| 1238 | + size += (sizeof(*cqr) + 7L) & -8L; | |
| 1239 | + | |
| 1284 | 1240 | spin_lock_irqsave(&device->mem_lock, flags); |
| 1285 | − cqr = (struct dasd_ccw_req *) | |
| 1286 | − dasd_alloc_chunk(&device->ccw_chunks, size); | |
| 1241 | + data = chunk = dasd_alloc_chunk(&device->ccw_chunks, size); | |
| 1287 | 1242 | spin_unlock_irqrestore(&device->mem_lock, flags); |
| 1288 | − if (cqr == NULL) | |
| 1243 | + if (!chunk) | |
| 1289 | 1244 | return ERR_PTR(-ENOMEM); |
| 1290 | − memset(cqr, 0, sizeof(struct dasd_ccw_req)); | |
| 1291 | − data = (char *) cqr + ((sizeof(struct dasd_ccw_req) + 7L) & -8L); | |
| 1292 | − cqr->cpaddr = NULL; | |
| 1245 | + if (!cqr) { | |
| 1246 | + cqr = (void *) data; | |
| 1247 | + data += (sizeof(*cqr) + 7L) & -8L; | |
| 1248 | + } | |
| 1249 | + memset(cqr, 0, sizeof(*cqr)); | |
| 1250 | + cqr->mem_chunk = chunk; | |
| 1293 | 1251 | if (cplength > 0) { |
| 1294 | − cqr->cpaddr = (struct ccw1 *) data; | |
| 1295 | − data += cplength*sizeof(struct ccw1); | |
| 1296 | − memset(cqr->cpaddr, 0, cplength*sizeof(struct ccw1)); | |
| 1252 | + cqr->cpaddr = data; | |
| 1253 | + data += cplength * sizeof(struct ccw1); | |
| 1254 | + memset(cqr->cpaddr, 0, cplength * sizeof(struct ccw1)); | |
| 1297 | 1255 | } |
| 1298 | − cqr->data = NULL; | |
| 1299 | 1256 | if (datasize > 0) { |
| 1300 | 1257 | cqr->data = data; |
| 1301 | 1258 | memset(cqr->data, 0, datasize); |
| @@ -1307,33 +1264,12 @@ struct dasd_ccw_req *dasd_smalloc_request(int magic, int cplength, · 5 unmodified lines | ||
| 1307 | 1264 | } |
| 1308 | 1265 | EXPORT_SYMBOL(dasd_smalloc_request); |
| 1309 | 1266 | |
| 1310 | −/* | |
| 1311 | − * Free memory of a channel program. This function needs to free all the | |
| 1312 | − * idal lists that might have been created by dasd_set_cda and the | |
| 1313 | − * struct dasd_ccw_req itself. | |
| 1314 | − */ | |
| 1315 | −void dasd_kfree_request(struct dasd_ccw_req *cqr, struct dasd_device *device) | |
| 1316 | −{ | |
| 1317 | − struct ccw1 *ccw; | |
| 1318 | − | |
| 1319 | − /* Clear any idals used for the request. */ | |
| 1320 | − ccw = cqr->cpaddr; | |
| 1321 | − do { | |
| 1322 | − clear_normalized_cda(ccw); | |
| 1323 | − } while (ccw++->flags & (CCW_FLAG_CC | CCW_FLAG_DC)); | |
| 1324 | − kfree(cqr->cpaddr); | |
| 1325 | − kfree(cqr->data); | |
| 1326 | − kfree(cqr); | |
| 1327 | − dasd_put_device(device); | |
| 1328 | −} | |
| 1329 | −EXPORT_SYMBOL(dasd_kfree_request); | |
| 1330 | − | |
| 1331 | 1267 | void dasd_sfree_request(struct dasd_ccw_req *cqr, struct dasd_device *device) |
| 1332 | 1268 | { |
| 1333 | 1269 | unsigned long flags; |
| 1334 | 1270 | |
| 1335 | 1271 | spin_lock_irqsave(&device->mem_lock, flags); |
| 1336 | − dasd_free_chunk(&device->ccw_chunks, cqr); | |
| 1272 | + dasd_free_chunk(&device->ccw_chunks, cqr->mem_chunk); | |
| 1337 | 1273 | spin_unlock_irqrestore(&device->mem_lock, flags); |
| 1338 | 1274 | dasd_put_device(device); |
| 1339 | 1275 | } |
| @@ -1885,6 +1821,33 @@ static void __dasd_device_process_ccw_queue(struct dasd_device *device, · 545 unmodified lines | ||
| 1885 | 1821 | } |
| 1886 | 1822 | } |
| 1887 | 1823 | |
| 1824 | +static void __dasd_process_cqr(struct dasd_device *device, | |
| 1825 | + struct dasd_ccw_req *cqr) | |
| 1826 | +{ | |
| 1827 | + char errorstring[ERRORLENGTH]; | |
| 1828 | + | |
| 1829 | + switch (cqr->status) { | |
| 1830 | + case DASD_CQR_SUCCESS: | |
| 1831 | + cqr->status = DASD_CQR_DONE; | |
| 1832 | + break; | |
| 1833 | + case DASD_CQR_ERROR: | |
| 1834 | + cqr->status = DASD_CQR_NEED_ERP; | |
| 1835 | + break; | |
| 1836 | + case DASD_CQR_CLEARED: | |
| 1837 | + cqr->status = DASD_CQR_TERMINATED; | |
| 1838 | + break; | |
| 1839 | + default: | |
| 1840 | + /* internal error 12 - wrong cqr status*/ | |
| 1841 | + snprintf(errorstring, ERRORLENGTH, "12 %p %x02", cqr, cqr->status); | |
| 1842 | + dev_err(&device->cdev->dev, | |
| 1843 | + "An error occurred in the DASD device driver, " | |
| 1844 | + "reason=%s\n", errorstring); | |
| 1845 | + BUG(); | |
| 1846 | + } | |
| 1847 | + if (cqr->callback) | |
| 1848 | + cqr->callback(cqr, cqr->callback_data); | |
| 1849 | +} | |
| 1850 | + | |
| 1888 | 1851 | /* |
| 1889 | 1852 | * the cqrs from the final queue are returned to the upper layer |
| 1890 | 1853 | * by setting a dasd_block state and calling the callback function |
| @@ -1895,40 +1858,18 @@ static void __dasd_device_process_final_queue(struct dasd_device *device, · 4 unmodified lines | ||
| 1895 | 1858 | struct list_head *l, *n; |
| 1896 | 1859 | struct dasd_ccw_req *cqr; |
| 1897 | 1860 | struct dasd_block *block; |
| 1898 | − void (*callback)(struct dasd_ccw_req *, void *data); | |
| 1899 | − void *callback_data; | |
| 1900 | − char errorstring[ERRORLENGTH]; | |
| 1901 | 1861 | |
| 1902 | 1862 | list_for_each_safe(l, n, final_queue) { |
| 1903 | 1863 | cqr = list_entry(l, struct dasd_ccw_req, devlist); |
| 1904 | 1864 | list_del_init(&cqr->devlist); |
| 1905 | 1865 | block = cqr->block; |
| 1906 | − callback = cqr->callback; | |
| 1907 | − callback_data = cqr->callback_data; | |
| 1908 | − if (block) | |
| 1866 | + if (!block) { | |
| 1867 | + __dasd_process_cqr(device, cqr); | |
| 1868 | + } else { | |
| 1909 | 1869 | spin_lock_bh(&block->queue_lock); |
| 1910 | − switch (cqr->status) { | |
| 1911 | − case DASD_CQR_SUCCESS: | |
| 1912 | − cqr->status = DASD_CQR_DONE; | |
| 1913 | − break; | |
| 1914 | − case DASD_CQR_ERROR: | |
| 1915 | − cqr->status = DASD_CQR_NEED_ERP; | |
| 1916 | − break; | |
| 1917 | − case DASD_CQR_CLEARED: | |
| 1918 | − cqr->status = DASD_CQR_TERMINATED; | |
| 1919 | − break; | |
| 1920 | − default: | |
| 1921 | − /* internal error 12 - wrong cqr status*/ | |
| 1922 | − snprintf(errorstring, ERRORLENGTH, "12 %p %x02", cqr, cqr->status); | |
| 1923 | − dev_err(&device->cdev->dev, | |
| 1924 | − "An error occurred in the DASD device driver, " | |
| 1925 | − "reason=%s\n", errorstring); | |
| 1926 | − BUG(); | |
| 1927 | − } | |
| 1928 | − if (cqr->callback != NULL) | |
| 1929 | − (callback)(cqr, callback_data); | |
| 1930 | − if (block) | |
| 1870 | + __dasd_process_cqr(device, cqr); | |
| 1931 | 1871 | spin_unlock_bh(&block->queue_lock); |
| 1872 | + } | |
| 1932 | 1873 | } |
| 1933 | 1874 | } |
| 1934 | 1875 | |
| @@ -3041,7 +2982,6 @@ static blk_status_t do_dasd_request(struct blk_mq_hw_ctx *hctx, · 1106 unmodified lines | ||
| 3041 | 2982 | cqr->callback_data = req; |
| 3042 | 2983 | cqr->status = DASD_CQR_FILLED; |
| 3043 | 2984 | cqr->dq = dq; |
| 3044 | − *((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req)) = cqr; | |
| 3045 | 2985 | |
| 3046 | 2986 | blk_mq_start_request(req); |
| 3047 | 2987 | spin_lock(&block->queue_lock); |
| @@ -3072,7 +3012,7 @@ enum blk_eh_timer_return dasd_times_out(struct request *req, bool reserved) · 24 unmodified lines | ||
| 3072 | 3012 | unsigned long flags; |
| 3073 | 3013 | int rc = 0; |
| 3074 | 3014 | |
| 3075 | − cqr = *((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req)); | |
| 3015 | + cqr = blk_mq_rq_to_pdu(req); | |
| 3076 | 3016 | if (!cqr) |
| 3077 | 3017 | return BLK_EH_DONE; |
| 3078 | 3018 | |
| @@ -3174,7 +3114,7 @@ static int dasd_alloc_queue(struct dasd_block *block) · 95 unmodified lines | ||
| 3174 | 3114 | int rc; |
| 3175 | 3115 | |
| 3176 | 3116 | block->tag_set.ops = &dasd_mq_ops; |
| 3177 | − block->tag_set.cmd_size = sizeof(struct dasd_ccw_req *); | |
| 3117 | + block->tag_set.cmd_size = sizeof(struct dasd_ccw_req); | |
| 3178 | 3118 | block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES; |
| 3179 | 3119 | block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV; |
| 3180 | 3120 | block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; |
| @@ -4038,7 +3978,8 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, · 857 unmodified lines | ||
| 4038 | 3978 | struct ccw1 *ccw; |
| 4039 | 3979 | unsigned long *idaw; |
| 4040 | 3980 | |
| 4041 | − cqr = dasd_smalloc_request(magic, 1 /* RDC */, rdc_buffer_size, device); | |
| 3981 | + cqr = dasd_smalloc_request(magic, 1 /* RDC */, rdc_buffer_size, device, | |
| 3982 | + NULL); | |
| 4042 | 3983 | |
| 4043 | 3984 | if (IS_ERR(cqr)) { |
| 4044 | 3985 | /* internal error 13 - Allocating the RDC request failed*/ |
| @@ -407,9 +407,9 @@ static int read_unit_address_configuration(struct dasd_device *device, · 406 unmodified lines | ||
| 407 | 407 | int rc; |
| 408 | 408 | unsigned long flags; |
| 409 | 409 | |
| 410 | − cqr = dasd_kmalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */, | |
| 410 | + cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */, | |
| 411 | 411 | (sizeof(struct dasd_psf_prssd_data)), |
| 412 | − device); | |
| 412 | + device, NULL); | |
| 413 | 413 | if (IS_ERR(cqr)) |
| 414 | 414 | return PTR_ERR(cqr); |
| 415 | 415 | cqr->startdev = device; |
| @@ -457,7 +457,7 @@ static int read_unit_address_configuration(struct dasd_device *device, · 41 unmodified lines | ||
| 457 | 457 | lcu->flags |= NEED_UAC_UPDATE; |
| 458 | 458 | spin_unlock_irqrestore(&lcu->lock, flags); |
| 459 | 459 | } |
| 460 | − dasd_kfree_request(cqr, cqr->memdev); | |
| 460 | + dasd_sfree_request(cqr, cqr->memdev); | |
| 461 | 461 | return rc; |
| 462 | 462 | } |
| 463 | 463 | |
| @@ -536,7 +536,8 @@ static struct dasd_ccw_req *dasd_diag_build_cp(struct dasd_device *memdev, · 535 unmodified lines | ||
| 536 | 536 | /* Build the request */ |
| 537 | 537 | datasize = sizeof(struct dasd_diag_req) + |
| 538 | 538 | count*sizeof(struct dasd_diag_bio); |
| 539 | − cqr = dasd_smalloc_request(DASD_DIAG_MAGIC, 0, datasize, memdev); | |
| 539 | + cqr = dasd_smalloc_request(DASD_DIAG_MAGIC, 0, datasize, memdev, | |
| 540 | + blk_mq_rq_to_pdu(req)); | |
| 540 | 541 | if (IS_ERR(cqr)) |
| 541 | 542 | return cqr; |
| 542 | 543 | |
| @@ -886,7 +886,7 @@ static int dasd_eckd_read_conf_lpm(struct dasd_device *device, · 885 unmodified lines | ||
| 886 | 886 | } |
| 887 | 887 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* RCD */, |
| 888 | 888 | 0, /* use rcd_buf as data ara */ |
| 889 | − device); | |
| 889 | + device, NULL); | |
| 890 | 890 | if (IS_ERR(cqr)) { |
| 891 | 891 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
| 892 | 892 | "Could not allocate RCD request"); |
| @@ -1442,7 +1442,7 @@ static int dasd_eckd_read_features(struct dasd_device *device) · 549 unmodified lines | ||
| 1442 | 1442 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */, |
| 1443 | 1443 | (sizeof(struct dasd_psf_prssd_data) + |
| 1444 | 1444 | sizeof(struct dasd_rssd_features)), |
| 1445 | − device); | |
| 1445 | + device, NULL); | |
| 1446 | 1446 | if (IS_ERR(cqr)) { |
| 1447 | 1447 | DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s", "Could not " |
| 1448 | 1448 | "allocate initialization request"); |
| @@ -1504,7 +1504,7 @@ static struct dasd_ccw_req *dasd_eckd_build_psf_ssc(struct dasd_device *device, · 55 unmodified lines | ||
| 1504 | 1504 | |
| 1505 | 1505 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ , |
| 1506 | 1506 | sizeof(struct dasd_psf_ssc_data), |
| 1507 | − device); | |
| 1507 | + device, NULL); | |
| 1508 | 1508 | |
| 1509 | 1509 | if (IS_ERR(cqr)) { |
| 1510 | 1510 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
| @@ -1815,7 +1815,8 @@ dasd_eckd_analysis_ccw(struct dasd_device *device) · 304 unmodified lines | ||
| 1815 | 1815 | |
| 1816 | 1816 | cplength = 8; |
| 1817 | 1817 | datasize = sizeof(struct DE_eckd_data) + 2*sizeof(struct LO_eckd_data); |
| 1818 | − cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, device); | |
| 1818 | + cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, device, | |
| 1819 | + NULL); | |
| 1819 | 1820 | if (IS_ERR(cqr)) |
| 1820 | 1821 | return cqr; |
| 1821 | 1822 | ccw = cqr->cpaddr; |
| @@ -2092,7 +2093,8 @@ dasd_eckd_build_check_tcw(struct dasd_device *base, struct format_data_t *fdata, · 270 unmodified lines | ||
| 2092 | 2093 | */ |
| 2093 | 2094 | itcw_size = itcw_calc_size(0, count, 0); |
| 2094 | 2095 | |
| 2095 | − cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev); | |
| 2096 | + cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev, | |
| 2097 | + NULL); | |
| 2096 | 2098 | if (IS_ERR(cqr)) |
| 2097 | 2099 | return cqr; |
| 2098 | 2100 | |
| @@ -2186,7 +2188,7 @@ dasd_eckd_build_check(struct dasd_device *base, struct format_data_t *fdata, · 87 unmodified lines | ||
| 2186 | 2188 | cplength += count; |
| 2187 | 2189 | |
| 2188 | 2190 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, |
| 2189 | − startdev); | |
| 2191 | + startdev, NULL); | |
| 2190 | 2192 | if (IS_ERR(cqr)) |
| 2191 | 2193 | return cqr; |
| 2192 | 2194 | |
| @@ -2332,7 +2334,7 @@ dasd_eckd_build_format(struct dasd_device *base, · 139 unmodified lines | ||
| 2332 | 2334 | } |
| 2333 | 2335 | /* Allocate the format ccw request. */ |
| 2334 | 2336 | fcp = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, |
| 2335 | − datasize, startdev); | |
| 2337 | + datasize, startdev, NULL); | |
| 2336 | 2338 | if (IS_ERR(fcp)) |
| 2337 | 2339 | return fcp; |
| 2338 | 2340 | |
| @@ -3103,7 +3105,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_cmd_single( · 764 unmodified lines | ||
| 3103 | 3105 | } |
| 3104 | 3106 | /* Allocate the ccw request. */ |
| 3105 | 3107 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, |
| 3106 | − startdev); | |
| 3108 | + startdev, blk_mq_rq_to_pdu(req)); | |
| 3107 | 3109 | if (IS_ERR(cqr)) |
| 3108 | 3110 | return cqr; |
| 3109 | 3111 | ccw = cqr->cpaddr; |
| @@ -3262,7 +3264,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_cmd_track( · 152 unmodified lines | ||
| 3262 | 3264 | |
| 3263 | 3265 | /* Allocate the ccw request. */ |
| 3264 | 3266 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, |
| 3265 | − startdev); | |
| 3267 | + startdev, blk_mq_rq_to_pdu(req)); | |
| 3266 | 3268 | if (IS_ERR(cqr)) |
| 3267 | 3269 | return cqr; |
| 3268 | 3270 | ccw = cqr->cpaddr; |
| @@ -3595,7 +3597,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 326 unmodified lines | ||
| 3595 | 3597 | |
| 3596 | 3598 | /* Allocate the ccw request. */ |
| 3597 | 3599 | itcw_size = itcw_calc_size(0, ctidaw, 0); |
| 3598 | − cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev); | |
| 3600 | + cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev, | |
| 3601 | + blk_mq_rq_to_pdu(req)); | |
| 3599 | 3602 | if (IS_ERR(cqr)) |
| 3600 | 3603 | return cqr; |
| 3601 | 3604 | |
| @@ -3862,7 +3865,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev, · 260 unmodified lines | ||
| 3862 | 3865 | |
| 3863 | 3866 | /* Allocate the ccw request. */ |
| 3864 | 3867 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, |
| 3865 | − datasize, startdev); | |
| 3868 | + datasize, startdev, blk_mq_rq_to_pdu(req)); | |
| 3866 | 3869 | if (IS_ERR(cqr)) |
| 3867 | 3870 | return cqr; |
| 3868 | 3871 | |
| @@ -4102,7 +4105,7 @@ dasd_eckd_release(struct dasd_device *device) · 233 unmodified lines | ||
| 4102 | 4105 | return -EACCES; |
| 4103 | 4106 | |
| 4104 | 4107 | useglobal = 0; |
| 4105 | − cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device); | |
| 4108 | + cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device, NULL); | |
| 4106 | 4109 | if (IS_ERR(cqr)) { |
| 4107 | 4110 | mutex_lock(&dasd_reserve_mutex); |
| 4108 | 4111 | useglobal = 1; |
| @@ -4157,7 +4160,7 @@ dasd_eckd_reserve(struct dasd_device *device) · 48 unmodified lines | ||
| 4157 | 4160 | return -EACCES; |
| 4158 | 4161 | |
| 4159 | 4162 | useglobal = 0; |
| 4160 | − cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device); | |
| 4163 | + cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device, NULL); | |
| 4161 | 4164 | if (IS_ERR(cqr)) { |
| 4162 | 4165 | mutex_lock(&dasd_reserve_mutex); |
| 4163 | 4166 | useglobal = 1; |
| @@ -4211,7 +4214,7 @@ dasd_eckd_steal_lock(struct dasd_device *device) · 47 unmodified lines | ||
| 4211 | 4214 | return -EACCES; |
| 4212 | 4215 | |
| 4213 | 4216 | useglobal = 0; |
| 4214 | − cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device); | |
| 4217 | + cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device, NULL); | |
| 4215 | 4218 | if (IS_ERR(cqr)) { |
| 4216 | 4219 | mutex_lock(&dasd_reserve_mutex); |
| 4217 | 4220 | useglobal = 1; |
| @@ -4271,7 +4274,8 @@ static int dasd_eckd_snid(struct dasd_device *device, · 53 unmodified lines | ||
| 4271 | 4274 | |
| 4272 | 4275 | useglobal = 0; |
| 4273 | 4276 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, |
| 4274 | − sizeof(struct dasd_snid_data), device); | |
| 4277 | + sizeof(struct dasd_snid_data), device, | |
| 4278 | + NULL); | |
| 4275 | 4279 | if (IS_ERR(cqr)) { |
| 4276 | 4280 | mutex_lock(&dasd_reserve_mutex); |
| 4277 | 4281 | useglobal = 1; |
| @@ -4331,7 +4335,7 @@ dasd_eckd_performance(struct dasd_device *device, void __user *argp) · 53 unmodified lines | ||
| 4331 | 4335 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */, |
| 4332 | 4336 | (sizeof(struct dasd_psf_prssd_data) + |
| 4333 | 4337 | sizeof(struct dasd_rssd_perf_stats_t)), |
| 4334 | − device); | |
| 4338 | + device, NULL); | |
| 4335 | 4339 | if (IS_ERR(cqr)) { |
| 4336 | 4340 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
| 4337 | 4341 | "Could not allocate initialization request"); |
| @@ -4477,7 +4481,7 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp) · 139 unmodified lines | ||
| 4477 | 4481 | psf1 = psf_data[1]; |
| 4478 | 4482 | |
| 4479 | 4483 | /* setup CCWs for PSF + RSSD */ |
| 4480 | − cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 2 , 0, device); | |
| 4484 | + cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 2, 0, device, NULL); | |
| 4481 | 4485 | if (IS_ERR(cqr)) { |
| 4482 | 4486 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
| 4483 | 4487 | "Could not allocate initialization request"); |
| @@ -5037,7 +5041,7 @@ static int dasd_eckd_read_message_buffer(struct dasd_device *device, · 553 unmodified lines | ||
| 5037 | 5041 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */, |
| 5038 | 5042 | (sizeof(struct dasd_psf_prssd_data) + |
| 5039 | 5043 | sizeof(struct dasd_rssd_messages)), |
| 5040 | − device); | |
| 5044 | + device, NULL); | |
| 5041 | 5045 | if (IS_ERR(cqr)) { |
| 5042 | 5046 | DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s", |
| 5043 | 5047 | "Could not allocate read message buffer request"); |
| @@ -5126,7 +5130,7 @@ static int dasd_eckd_query_host_access(struct dasd_device *device, · 82 unmodified lines | ||
| 5126 | 5130 | |
| 5127 | 5131 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */, |
| 5128 | 5132 | sizeof(struct dasd_psf_prssd_data) + 1, |
| 5129 | − device); | |
| 5133 | + device, NULL); | |
| 5130 | 5134 | if (IS_ERR(cqr)) { |
| 5131 | 5135 | DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s", |
| 5132 | 5136 | "Could not allocate read message buffer request"); |
| @@ -5284,8 +5288,8 @@ dasd_eckd_psf_cuir_response(struct dasd_device *device, int response, · 151 unmodified lines | ||
| 5284 | 5288 | int rc; |
| 5285 | 5289 | |
| 5286 | 5290 | cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ , |
| 5287 | − sizeof(struct dasd_psf_cuir_response), | |
| 5288 | − device); | |
| 5291 | + sizeof(struct dasd_psf_cuir_response), | |
| 5292 | + device, NULL); | |
| 5289 | 5293 | |
| 5290 | 5294 | if (IS_ERR(cqr)) { |
| 5291 | 5295 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
| @@ -447,7 +447,7 @@ static void dasd_eer_snss_cb(struct dasd_ccw_req *cqr, void *data) · 446 unmodified lines | ||
| 447 | 447 | * is a new ccw in device->eer_cqr. Free the "old" |
| 448 | 448 | * snss request now. |
| 449 | 449 | */ |
| 450 | − dasd_kfree_request(cqr, device); | |
| 450 | + dasd_sfree_request(cqr, device); | |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | /* |
| @@ -472,8 +472,8 @@ int dasd_eer_enable(struct dasd_device *device) · 18 unmodified lines | ||
| 472 | 472 | if (rc) |
| 473 | 473 | goto out; |
| 474 | 474 | |
| 475 | − cqr = dasd_kmalloc_request(DASD_ECKD_MAGIC, 1 /* SNSS */, | |
| 476 | − SNSS_DATA_SIZE, device); | |
| 475 | + cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* SNSS */, | |
| 476 | + SNSS_DATA_SIZE, device, NULL); | |
| 477 | 477 | if (IS_ERR(cqr)) { |
| 478 | 478 | rc = -ENOMEM; |
| 479 | 479 | cqr = NULL; |
| @@ -505,7 +505,7 @@ out: · 25 unmodified lines | ||
| 505 | 505 | spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags); |
| 506 | 506 | |
| 507 | 507 | if (cqr) |
| 508 | − dasd_kfree_request(cqr, device); | |
| 508 | + dasd_sfree_request(cqr, device); | |
| 509 | 509 | |
| 510 | 510 | return rc; |
| 511 | 511 | } |
| @@ -528,7 +528,7 @@ void dasd_eer_disable(struct dasd_device *device) · 16 unmodified lines | ||
| 528 | 528 | in_use = test_and_clear_bit(DASD_FLAG_EER_IN_USE, &device->flags); |
| 529 | 529 | spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags); |
| 530 | 530 | if (cqr && !in_use) |
| 531 | − dasd_kfree_request(cqr, device); | |
| 531 | + dasd_sfree_request(cqr, device); | |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | /* |
| @@ -356,7 +356,8 @@ static struct dasd_ccw_req *dasd_fba_build_cp_discard( · 355 unmodified lines | ||
| 356 | 356 | datasize = sizeof(struct DE_fba_data) + |
| 357 | 357 | nr_ccws * (sizeof(struct LO_fba_data) + sizeof(struct ccw1)); |
| 358 | 358 | |
| 359 | − cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev); | |
| 359 | + cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev, | |
| 360 | + blk_mq_rq_to_pdu(req)); | |
| 360 | 361 | if (IS_ERR(cqr)) |
| 361 | 362 | return cqr; |
| 362 | 363 | |
| @@ -490,7 +491,8 @@ static struct dasd_ccw_req *dasd_fba_build_cp_regular( · 127 unmodified lines | ||
| 490 | 491 | datasize += (count - 1)*sizeof(struct LO_fba_data); |
| 491 | 492 | } |
| 492 | 493 | /* Allocate the ccw request. */ |
| 493 | − cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev); | |
| 494 | + cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev, | |
| 495 | + blk_mq_rq_to_pdu(req)); | |
| 494 | 496 | if (IS_ERR(cqr)) |
| 495 | 497 | return cqr; |
| 496 | 498 | ccw = cqr->cpaddr; |
| @@ -158,40 +158,33 @@ do { \ · 157 unmodified lines | ||
| 158 | 158 | |
| 159 | 159 | struct dasd_ccw_req { |
| 160 | 160 | unsigned int magic; /* Eye catcher */ |
| 161 | + int intrc; /* internal error, e.g. from start_IO */ | |
| 161 | 162 | struct list_head devlist; /* for dasd_device request queue */ |
| 162 | 163 | struct list_head blocklist; /* for dasd_block request queue */ |
| 163 | − | |
| 164 | − /* Where to execute what... */ | |
| 165 | 164 | struct dasd_block *block; /* the originating block device */ |
| 166 | 165 | struct dasd_device *memdev; /* the device used to allocate this */ |
| 167 | 166 | struct dasd_device *startdev; /* device the request is started on */ |
| 168 | 167 | struct dasd_device *basedev; /* base device if no block->base */ |
| 169 | 168 | void *cpaddr; /* address of ccw or tcw */ |
| 169 | + short retries; /* A retry counter */ | |
| 170 | 170 | unsigned char cpmode; /* 0 = cmd mode, 1 = itcw */ |
| 171 | 171 | char status; /* status of this request */ |
| 172 | − short retries; /* A retry counter */ | |
| 172 | + char lpm; /* logical path mask */ | |
| 173 | 173 | unsigned long flags; /* flags of this request */ |
| 174 | 174 | struct dasd_queue *dq; |
| 175 | − | |
| 176 | − /* ... and how */ | |
| 177 | 175 | unsigned long starttime; /* jiffies time of request start */ |
| 178 | 176 | unsigned long expires; /* expiration period in jiffies */ |
| 179 | − char lpm; /* logical path mask */ | |
| 180 | 177 | void *data; /* pointer to data area */ |
| 181 | − | |
| 182 | − /* these are important for recovering erroneous requests */ | |
| 183 | − int intrc; /* internal error, e.g. from start_IO */ | |
| 184 | 178 | struct irb irb; /* device status in case of an error */ |
| 185 | 179 | struct dasd_ccw_req *refers; /* ERP-chain queueing. */ |
| 186 | 180 | void *function; /* originating ERP action */ |
| 181 | + void *mem_chunk; | |
| 187 | 182 | |
| 188 | − /* these are for statistics only */ | |
| 189 | 183 | unsigned long buildclk; /* TOD-clock of request generation */ |
| 190 | 184 | unsigned long startclk; /* TOD-clock of request start */ |
| 191 | 185 | unsigned long stopclk; /* TOD-clock of request interrupt */ |
| 192 | 186 | unsigned long endclk; /* TOD-clock of request termination */ |
| 193 | 187 | |
| 194 | − /* Callback that is called after reaching final status. */ | |
| 195 | 188 | void (*callback)(struct dasd_ccw_req *, void *data); |
| 196 | 189 | void *callback_data; |
| 197 | 190 | }; |
| @@ -714,19 +707,10 @@ extern const struct block_device_operations dasd_device_operations; · 516 unmodified lines | ||
| 714 | 707 | extern struct kmem_cache *dasd_page_cache; |
| 715 | 708 | |
| 716 | 709 | struct dasd_ccw_req * |
| 717 | −dasd_kmalloc_request(int , int, int, struct dasd_device *); | |
| 718 | −struct dasd_ccw_req * | |
| 719 | −dasd_smalloc_request(int , int, int, struct dasd_device *); | |
| 720 | −void dasd_kfree_request(struct dasd_ccw_req *, struct dasd_device *); | |
| 710 | +dasd_smalloc_request(int, int, int, struct dasd_device *, struct dasd_ccw_req *); | |
| 721 | 711 | void dasd_sfree_request(struct dasd_ccw_req *, struct dasd_device *); |
| 722 | 712 | void dasd_wakeup_cb(struct dasd_ccw_req *, void *); |
| 723 | 713 | |
| 724 | −static inline int | |
| 725 | −dasd_kmalloc_set_cda(struct ccw1 *ccw, void *cda, struct dasd_device *device) | |
| 726 | −{ | |
| 727 | − return set_normalized_cda(ccw, cda); | |
| 728 | −} | |
| 729 | − | |
| 730 | 714 | struct dasd_device *dasd_alloc_device(void); |
| 731 | 715 | void dasd_free_device(struct dasd_device *); |
| 732 | 716 | |
| @@ -5,6 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | |
| 6 | 6 | # The following is required for define_trace.h to find ./trace.h |
| 7 | 7 | CFLAGS_trace.o := -I$(src) |
| 8 | +CFLAGS_vfio_ccw_fsm.o := -I$(src) | |
| 8 | 9 | |
| 9 | 10 | obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o idset.o isc.o \ |
| 10 | 11 | fcx.o itcw.o crw.o ccwreq.o trace.o ioasm.o |
| @@ -23,9 +23,13 @@ · 22 unmodified lines | ||
| 23 | 23 | #define CCWCHAIN_LEN_MAX 256 |
| 24 | 24 | |
| 25 | 25 | struct pfn_array { |
| 26 | + /* Starting guest physical I/O address. */ | |
| 26 | 27 | unsigned long pa_iova; |
| 28 | + /* Array that stores PFNs of the pages need to pin. */ | |
| 27 | 29 | unsigned long *pa_iova_pfn; |
| 30 | + /* Array that receives PFNs of the pages pinned. */ | |
| 28 | 31 | unsigned long *pa_pfn; |
| 32 | + /* Number of pages pinned from @pa_iova. */ | |
| 29 | 33 | int pa_nr; |
| 30 | 34 | }; |
| 31 | 35 | |
| @@ -46,70 +50,33 @@ struct ccwchain { · 14 unmodified lines | ||
| 46 | 50 | }; |
| 47 | 51 | |
| 48 | 52 | /* |
| 49 | − * pfn_array_pin() - pin user pages in memory | |
| 53 | + * pfn_array_alloc_pin() - alloc memory for PFNs, then pin user pages in memory | |
| 50 | 54 | * @pa: pfn_array on which to perform the operation |
| 51 | 55 | * @mdev: the mediated device to perform pin/unpin operations |
| 56 | + * @iova: target guest physical address | |
| 57 | + * @len: number of bytes that should be pinned from @iova | |
| 52 | 58 | * |
| 53 | − * Attempt to pin user pages in memory. | |
| 59 | + * Attempt to allocate memory for PFNs, and pin user pages in memory. | |
| 54 | 60 | * |
| 55 | 61 | * Usage of pfn_array: |
| 56 | − * @pa->pa_iova starting guest physical I/O address. Assigned by caller. | |
| 57 | − * @pa->pa_iova_pfn array that stores PFNs of the pages need to pin. Allocated | |
| 58 | − * by caller. | |
| 59 | − * @pa->pa_pfn array that receives PFNs of the pages pinned. Allocated by | |
| 60 | − * caller. | |
| 61 | − * @pa->pa_nr number of pages from @pa->pa_iova to pin. Assigned by | |
| 62 | − * caller. | |
| 63 | − * number of pages pinned. Assigned by callee. | |
| 62 | + * We expect (pa_nr == 0) and (pa_iova_pfn == NULL), any field in | |
| 63 | + * this structure will be filled in by this function. | |
| 64 | 64 | * |
| 65 | 65 | * Returns: |
| 66 | 66 | * Number of pages pinned on success. |
| 67 | − * If @pa->pa_nr is 0 or negative, returns 0. | |
| 67 | + * If @pa->pa_nr is not 0, or @pa->pa_iova_pfn is not NULL initially, | |
| 68 | + * returns -EINVAL. | |
| 68 | 69 | * If no pages were pinned, returns -errno. |
| 69 | 70 | */ |
| 70 | −static int pfn_array_pin(struct pfn_array *pa, struct device *mdev) | |
| 71 | −{ | |
| 72 | − int i, ret; | |
| 73 | − | |
| 74 | − if (pa->pa_nr <= 0) { | |
| 75 | − pa->pa_nr = 0; | |
| 76 | − return 0; | |
| 77 | − } | |
| 78 | − | |
| 79 | − pa->pa_iova_pfn[0] = pa->pa_iova >> PAGE_SHIFT; | |
| 80 | − for (i = 1; i < pa->pa_nr; i++) | |
| 81 | − pa->pa_iova_pfn[i] = pa->pa_iova_pfn[i - 1] + 1; | |
| 82 | − | |
| 83 | − ret = vfio_pin_pages(mdev, pa->pa_iova_pfn, pa->pa_nr, | |
| 84 | − IOMMU_READ | IOMMU_WRITE, pa->pa_pfn); | |
| 85 | − | |
| 86 | − if (ret > 0 && ret != pa->pa_nr) { | |
| 87 | − vfio_unpin_pages(mdev, pa->pa_iova_pfn, ret); | |
| 88 | − pa->pa_nr = 0; | |
| 89 | − return 0; | |
| 90 | − } | |
| 91 | − | |
| 92 | − return ret; | |
| 93 | −} | |
| 94 | − | |
| 95 | −/* Unpin the pages before releasing the memory. */ | |
| 96 | −static void pfn_array_unpin_free(struct pfn_array *pa, struct device *mdev) | |
| 97 | −{ | |
| 98 | − vfio_unpin_pages(mdev, pa->pa_iova_pfn, pa->pa_nr); | |
| 99 | − pa->pa_nr = 0; | |
| 100 | − kfree(pa->pa_iova_pfn); | |
| 101 | −} | |
| 102 | − | |
| 103 | −/* Alloc memory for PFNs, then pin pages with them. */ | |
| 104 | 71 | static int pfn_array_alloc_pin(struct pfn_array *pa, struct device *mdev, |
| 105 | 72 | u64 iova, unsigned int len) |
| 106 | 73 | { |
| 107 | − int ret = 0; | |
| 74 | + int i, ret = 0; | |
| 108 | 75 | |
| 109 | 76 | if (!len) |
| 110 | 77 | return 0; |
| 111 | 78 | |
| 112 | − if (pa->pa_nr) | |
| 79 | + if (pa->pa_nr || pa->pa_iova_pfn) | |
| 113 | 80 | return -EINVAL; |
| 114 | 81 | |
| 115 | 82 | pa->pa_iova = iova; |
| @@ -126,18 +93,39 @@ static int pfn_array_alloc_pin(struct pfn_array *pa, struct device *mdev, · 10 unmodified lines | ||
| 126 | 93 | return -ENOMEM; |
| 127 | 94 | pa->pa_pfn = pa->pa_iova_pfn + pa->pa_nr; |
| 128 | 95 | |
| 129 | − ret = pfn_array_pin(pa, mdev); | |
| 96 | + pa->pa_iova_pfn[0] = pa->pa_iova >> PAGE_SHIFT; | |
| 97 | + for (i = 1; i < pa->pa_nr; i++) | |
| 98 | + pa->pa_iova_pfn[i] = pa->pa_iova_pfn[i - 1] + 1; | |
| 130 | 99 | |
| 131 | − if (ret > 0) | |
| 132 | − return ret; | |
| 133 | − else if (!ret) | |
| 100 | + ret = vfio_pin_pages(mdev, pa->pa_iova_pfn, pa->pa_nr, | |
| 101 | + IOMMU_READ | IOMMU_WRITE, pa->pa_pfn); | |
| 102 | + | |
| 103 | + if (ret < 0) { | |
| 104 | + goto err_out; | |
| 105 | + } else if (ret > 0 && ret != pa->pa_nr) { | |
| 106 | + vfio_unpin_pages(mdev, pa->pa_iova_pfn, ret); | |
| 134 | 107 | ret = -EINVAL; |
| 108 | + goto err_out; | |
| 109 | + } | |
| 135 | 110 | |
| 111 | + return ret; | |
| 112 | + | |
| 113 | +err_out: | |
| 114 | + pa->pa_nr = 0; | |
| 136 | 115 | kfree(pa->pa_iova_pfn); |
| 116 | + pa->pa_iova_pfn = NULL; | |
| 137 | 117 | |
| 138 | 118 | return ret; |
| 139 | 119 | } |
| 140 | 120 | |
| 121 | +/* Unpin the pages before releasing the memory. */ | |
| 122 | +static void pfn_array_unpin_free(struct pfn_array *pa, struct device *mdev) | |
| 123 | +{ | |
| 124 | + vfio_unpin_pages(mdev, pa->pa_iova_pfn, pa->pa_nr); | |
| 125 | + pa->pa_nr = 0; | |
| 126 | + kfree(pa->pa_iova_pfn); | |
| 127 | +} | |
| 128 | + | |
| 141 | 129 | static int pfn_array_table_init(struct pfn_array_table *pat, int nr) |
| 142 | 130 | { |
| 143 | 131 | pat->pat_pa = kcalloc(nr, sizeof(*pat->pat_pa), GFP_KERNEL); |
| @@ -365,6 +353,9 @@ static void cp_unpin_free(struct channel_program *cp) · 221 unmodified lines | ||
| 365 | 353 | * This is the chain length not considering any TICs. |
| 366 | 354 | * You need to do a new round for each TIC target. |
| 367 | 355 | * |
| 356 | + * The program is also validated for absence of not yet supported | |
| 357 | + * indirect data addressing scenarios. | |
| 358 | + * | |
| 368 | 359 | * Returns: the length of the ccw chain or -errno. |
| 369 | 360 | */ |
| 370 | 361 | static int ccwchain_calc_length(u64 iova, struct channel_program *cp) |
| @@ -391,6 +382,14 @@ static int ccwchain_calc_length(u64 iova, struct channel_program *cp) · 20 unmodified lines | ||
| 391 | 382 | do { |
| 392 | 383 | cnt++; |
| 393 | 384 | |
| 385 | + /* | |
| 386 | + * As we don't want to fail direct addressing even if the | |
| 387 | + * orb specified one of the unsupported formats, we defer | |
| 388 | + * checking for IDAWs in unsupported formats to here. | |
| 389 | + */ | |
| 390 | + if ((!cp->orb.cmd.c64 || cp->orb.cmd.i2k) && ccw_is_idal(ccw)) | |
| 391 | + return -EOPNOTSUPP; | |
| 392 | + | |
| 394 | 393 | if ((!ccw_is_chain(ccw)) && (!ccw_is_tic(ccw))) |
| 395 | 394 | break; |
| 396 | 395 | |
| @@ -503,7 +502,7 @@ static int ccwchain_fetch_direct(struct ccwchain *chain, · 106 unmodified lines | ||
| 503 | 502 | struct ccw1 *ccw; |
| 504 | 503 | struct pfn_array_table *pat; |
| 505 | 504 | unsigned long *idaws; |
| 506 | − int idaw_nr; | |
| 505 | + int ret; | |
| 507 | 506 | |
| 508 | 507 | ccw = chain->ch_ccw + idx; |
| 509 | 508 | |
| @@ -523,18 +522,19 @@ static int ccwchain_fetch_direct(struct ccwchain *chain, · 13 unmodified lines | ||
| 523 | 522 | * needed when translating a direct ccw to a idal ccw. |
| 524 | 523 | */ |
| 525 | 524 | pat = chain->ch_pat + idx; |
| 526 | − if (pfn_array_table_init(pat, 1)) | |
| 527 | − return -ENOMEM; | |
| 528 | − idaw_nr = pfn_array_alloc_pin(pat->pat_pa, cp->mdev, | |
| 529 | − ccw->cda, ccw->count); | |
| 530 | − if (idaw_nr < 0) | |
| 531 | − return idaw_nr; | |
| 525 | + ret = pfn_array_table_init(pat, 1); | |
| 526 | + if (ret) | |
| 527 | + goto out_init; | |
| 528 | + | |
| 529 | + ret = pfn_array_alloc_pin(pat->pat_pa, cp->mdev, ccw->cda, ccw->count); | |
| 530 | + if (ret < 0) | |
| 531 | + goto out_init; | |
| 532 | 532 | |
| 533 | 533 | /* Translate this direct ccw to a idal ccw. */ |
| 534 | − idaws = kcalloc(idaw_nr, sizeof(*idaws), GFP_DMA | GFP_KERNEL); | |
| 534 | + idaws = kcalloc(ret, sizeof(*idaws), GFP_DMA | GFP_KERNEL); | |
| 535 | 535 | if (!idaws) { |
| 536 | − pfn_array_table_unpin_free(pat, cp->mdev); | |
| 537 | − return -ENOMEM; | |
| 536 | + ret = -ENOMEM; | |
| 537 | + goto out_unpin; | |
| 538 | 538 | } |
| 539 | 539 | ccw->cda = (__u32) virt_to_phys(idaws); |
| 540 | 540 | ccw->flags |= CCW_FLAG_IDA; |
| @@ -542,6 +542,12 @@ static int ccwchain_fetch_direct(struct ccwchain *chain, · 1 unmodified line | ||
| 542 | 542 | pfn_array_table_idal_create_words(pat, idaws); |
| 543 | 543 | |
| 544 | 544 | return 0; |
| 545 | + | |
| 546 | +out_unpin: | |
| 547 | + pfn_array_table_unpin_free(pat, cp->mdev); | |
| 548 | +out_init: | |
| 549 | + ccw->cda = 0; | |
| 550 | + return ret; | |
| 545 | 551 | } |
| 546 | 552 | |
| 547 | 553 | static int ccwchain_fetch_idal(struct ccwchain *chain, |
| @@ -571,7 +577,7 @@ static int ccwchain_fetch_idal(struct ccwchain *chain, · 23 unmodified lines | ||
| 571 | 577 | pat = chain->ch_pat + idx; |
| 572 | 578 | ret = pfn_array_table_init(pat, idaw_nr); |
| 573 | 579 | if (ret) |
| 574 | − return ret; | |
| 580 | + goto out_init; | |
| 575 | 581 | |
| 576 | 582 | /* Translate idal ccw to use new allocated idaws. */ |
| 577 | 583 | idaws = kzalloc(idaw_len, GFP_DMA | GFP_KERNEL); |
| @@ -603,6 +609,8 @@ out_free_idaws: · 25 unmodified lines | ||
| 603 | 609 | kfree(idaws); |
| 604 | 610 | out_unpin: |
| 605 | 611 | pfn_array_table_unpin_free(pat, cp->mdev); |
| 612 | +out_init: | |
| 613 | + ccw->cda = 0; | |
| 606 | 614 | return ret; |
| 607 | 615 | } |
| 608 | 616 | |
| @@ -656,10 +664,8 @@ int cp_init(struct channel_program *cp, struct device *mdev, union orb *orb) · 47 unmodified lines | ||
| 656 | 664 | /* |
| 657 | 665 | * XXX: |
| 658 | 666 | * Only support prefetch enable mode now. |
| 659 | − * Only support 64bit addressing idal. | |
| 660 | − * Only support 4k IDAW. | |
| 661 | 667 | */ |
| 662 | − if (!orb->cmd.pfch || !orb->cmd.c64 || orb->cmd.i2k) | |
| 668 | + if (!orb->cmd.pfch) | |
| 663 | 669 | return -EOPNOTSUPP; |
| 664 | 670 | |
| 665 | 671 | INIT_LIST_HEAD(&cp->ccwchain_list); |
| @@ -688,6 +694,10 @@ int cp_init(struct channel_program *cp, struct device *mdev, union orb *orb) · 22 unmodified lines | ||
| 688 | 694 | ret = ccwchain_loop_tic(chain, cp); |
| 689 | 695 | if (ret) |
| 690 | 696 | cp_unpin_free(cp); |
| 697 | + /* It is safe to force: if not set but idals used | |
| 698 | + * ccwchain_calc_length returns an error. | |
| 699 | + */ | |
| 700 | + cp->orb.cmd.c64 = 1; | |
| 691 | 701 | |
| 692 | 702 | return ret; |
| 693 | 703 | } |
| @@ -177,6 +177,7 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) · 176 unmodified lines | ||
| 177 | 177 | { |
| 178 | 178 | struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); |
| 179 | 179 | unsigned long flags; |
| 180 | + int rc = -EAGAIN; | |
| 180 | 181 | |
| 181 | 182 | spin_lock_irqsave(sch->lock, flags); |
| 182 | 183 | if (!device_is_registered(&sch->dev)) |
| @@ -187,6 +188,7 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) · 4 unmodified lines | ||
| 187 | 188 | |
| 188 | 189 | if (cio_update_schib(sch)) { |
| 189 | 190 | vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER); |
| 191 | + rc = 0; | |
| 190 | 192 | goto out_unlock; |
| 191 | 193 | } |
| 192 | 194 | |
| @@ -195,11 +197,12 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) · 2 unmodified lines | ||
| 195 | 197 | private->state = private->mdev ? VFIO_CCW_STATE_IDLE : |
| 196 | 198 | VFIO_CCW_STATE_STANDBY; |
| 197 | 199 | } |
| 200 | + rc = 0; | |
| 198 | 201 | |
| 199 | 202 | out_unlock: |
| 200 | 203 | spin_unlock_irqrestore(sch->lock, flags); |
| 201 | 204 | |
| 202 | − return 0; | |
| 205 | + return rc; | |
| 203 | 206 | } |
| 204 | 207 | |
| 205 | 208 | static struct css_device_id vfio_ccw_sch_ids[] = { |
| @@ -13,6 +13,9 @@ · 12 unmodified lines | ||
| 13 | 13 | #include "ioasm.h" |
| 14 | 14 | #include "vfio_ccw_private.h" |
| 15 | 15 | |
| 16 | +#define CREATE_TRACE_POINTS | |
| 17 | +#include "vfio_ccw_trace.h" | |
| 18 | + | |
| 16 | 19 | static int fsm_io_helper(struct vfio_ccw_private *private) |
| 17 | 20 | { |
| 18 | 21 | struct subchannel *sch; |
| @@ -110,6 +113,10 @@ static void fsm_disabled_irq(struct vfio_ccw_private *private, · 91 unmodified lines | ||
| 110 | 113 | */ |
| 111 | 114 | cio_disable_subchannel(sch); |
| 112 | 115 | } |
| 116 | +inline struct subchannel_id get_schid(struct vfio_ccw_private *p) | |
| 117 | +{ | |
| 118 | + return p->sch->schid; | |
| 119 | +} | |
| 113 | 120 | |
| 114 | 121 | /* |
| 115 | 122 | * Deal with the ccw command request from the userspace. |
| @@ -121,6 +128,7 @@ static void fsm_io_request(struct vfio_ccw_private *private, · 5 unmodified lines | ||
| 121 | 128 | union scsw *scsw = &private->scsw; |
| 122 | 129 | struct ccw_io_region *io_region = &private->io_region; |
| 123 | 130 | struct mdev_device *mdev = private->mdev; |
| 131 | + char *errstr = "request"; | |
| 124 | 132 | |
| 125 | 133 | private->state = VFIO_CCW_STATE_BOXED; |
| 126 | 134 | |
| @@ -132,15 +140,19 @@ static void fsm_io_request(struct vfio_ccw_private *private, · 5 unmodified lines | ||
| 132 | 140 | /* Don't try to build a cp if transport mode is specified. */ |
| 133 | 141 | if (orb->tm.b) { |
| 134 | 142 | io_region->ret_code = -EOPNOTSUPP; |
| 143 | + errstr = "transport mode"; | |
| 135 | 144 | goto err_out; |
| 136 | 145 | } |
| 137 | 146 | io_region->ret_code = cp_init(&private->cp, mdev_dev(mdev), |
| 138 | 147 | orb); |
| 139 | − if (io_region->ret_code) | |
| 148 | + if (io_region->ret_code) { | |
| 149 | + errstr = "cp init"; | |
| 140 | 150 | goto err_out; |
| 151 | + } | |
| 141 | 152 | |
| 142 | 153 | io_region->ret_code = cp_prefetch(&private->cp); |
| 143 | 154 | if (io_region->ret_code) { |
| 155 | + errstr = "cp prefetch"; | |
| 144 | 156 | cp_free(&private->cp); |
| 145 | 157 | goto err_out; |
| 146 | 158 | } |
| @@ -148,6 +160,7 @@ static void fsm_io_request(struct vfio_ccw_private *private, · 1 unmodified line | ||
| 148 | 160 | /* Start channel program and wait for I/O interrupt. */ |
| 149 | 161 | io_region->ret_code = fsm_io_helper(private); |
| 150 | 162 | if (io_region->ret_code) { |
| 163 | + errstr = "cp fsm_io_helper"; | |
| 151 | 164 | cp_free(&private->cp); |
| 152 | 165 | goto err_out; |
| 153 | 166 | } |
| @@ -164,6 +177,8 @@ static void fsm_io_request(struct vfio_ccw_private *private, · 10 unmodified lines | ||
| 164 | 177 | |
| 165 | 178 | err_out: |
| 166 | 179 | private->state = VFIO_CCW_STATE_IDLE; |
| 180 | + trace_vfio_ccw_io_fctl(scsw->cmd.fctl, get_schid(private), | |
| 181 | + io_region->ret_code, errstr); | |
| 167 | 182 | } |
| 168 | 183 | |
| 169 | 184 | /* |
| @@ -0,0 +1,54 @@ | ||
| 1 | +/* SPDX-License-Identifier: GPL-2.0 | |
| 2 | + * Tracepoints for vfio_ccw driver | |
| 3 | + * | |
| 4 | + * Copyright IBM Corp. 2018 | |
| 5 | + * | |
| 6 | + * Author(s): Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> | |
| 7 | + * Halil Pasic <pasic@linux.vnet.ibm.com> | |
| 8 | + */ | |
| 9 | + | |
| 10 | +#undef TRACE_SYSTEM | |
| 11 | +#define TRACE_SYSTEM vfio_ccw | |
| 12 | + | |
| 13 | +#if !defined(_VFIO_CCW_TRACE_) || defined(TRACE_HEADER_MULTI_READ) | |
| 14 | +#define _VFIO_CCW_TRACE_ | |
| 15 | + | |
| 16 | +#include <linux/tracepoint.h> | |
| 17 | + | |
| 18 | +TRACE_EVENT(vfio_ccw_io_fctl, | |
| 19 | + TP_PROTO(int fctl, struct subchannel_id schid, int errno, char *errstr), | |
| 20 | + TP_ARGS(fctl, schid, errno, errstr), | |
| 21 | + | |
| 22 | + TP_STRUCT__entry( | |
| 23 | + __field(int, fctl) | |
| 24 | + __field_struct(struct subchannel_id, schid) | |
| 25 | + __field(int, errno) | |
| 26 | + __field(char*, errstr) | |
| 27 | + ), | |
| 28 | + | |
| 29 | + TP_fast_assign( | |
| 30 | + __entry->fctl = fctl; | |
| 31 | + __entry->schid = schid; | |
| 32 | + __entry->errno = errno; | |
| 33 | + __entry->errstr = errstr; | |
| 34 | + ), | |
| 35 | + | |
| 36 | + TP_printk("schid=%x.%x.%04x fctl=%x errno=%d info=%s", | |
| 37 | + __entry->schid.cssid, | |
| 38 | + __entry->schid.ssid, | |
| 39 | + __entry->schid.sch_no, | |
| 40 | + __entry->fctl, | |
| 41 | + __entry->errno, | |
| 42 | + __entry->errstr) | |
| 43 | +); | |
| 44 | + | |
| 45 | +#endif /* _VFIO_CCW_TRACE_ */ | |
| 46 | + | |
| 47 | +/* This part must be outside protection */ | |
| 48 | + | |
| 49 | +#undef TRACE_INCLUDE_PATH | |
| 50 | +#define TRACE_INCLUDE_PATH . | |
| 51 | +#undef TRACE_INCLUDE_FILE | |
| 52 | +#define TRACE_INCLUDE_FILE vfio_ccw_trace | |
| 53 | + | |
| 54 | +#include <trace/define_trace.h> | |
| @@ -760,7 +760,6 @@ static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg, · 759 unmodified lines | ||
| 760 | 760 | ioa_cfg->hrrq[i].allow_interrupts = 0; |
| 761 | 761 | spin_unlock(&ioa_cfg->hrrq[i]._lock); |
| 762 | 762 | } |
| 763 | − wmb(); | |
| 764 | 763 | |
| 765 | 764 | /* Set interrupt mask to stop all new interrupts */ |
| 766 | 765 | if (ioa_cfg->sis64) |
| @@ -8403,7 +8402,6 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd) · 7636 unmodified lines | ||
| 8403 | 8402 | ioa_cfg->hrrq[i].allow_interrupts = 1; |
| 8404 | 8403 | spin_unlock(&ioa_cfg->hrrq[i]._lock); |
| 8405 | 8404 | } |
| 8406 | − wmb(); | |
| 8407 | 8405 | if (ioa_cfg->sis64) { |
| 8408 | 8406 | /* Set the adapter to the correct endian mode. */ |
| 8409 | 8407 | writel(IPR_ENDIAN_SWAP_KEY, ioa_cfg->regs.endian_swap_reg); |
| @@ -1224,7 +1224,6 @@ static void qla24xx_chk_fcp_state(struct fc_port *sess) · 1223 unmodified lines | ||
| 1224 | 1224 | void qlt_schedule_sess_for_deletion(struct fc_port *sess) |
| 1225 | 1225 | { |
| 1226 | 1226 | struct qla_tgt *tgt = sess->tgt; |
| 1227 | − struct qla_hw_data *ha = sess->vha->hw; | |
| 1228 | 1227 | unsigned long flags; |
| 1229 | 1228 | |
| 1230 | 1229 | if (sess->disc_state == DSC_DELETE_PEND) |
| @@ -1241,16 +1240,16 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) · 10 unmodified lines | ||
| 1241 | 1240 | return; |
| 1242 | 1241 | } |
| 1243 | 1242 | |
| 1244 | − spin_lock_irqsave(&ha->tgt.sess_lock, flags); | |
| 1245 | 1243 | if (sess->deleted == QLA_SESS_DELETED) |
| 1246 | 1244 | sess->logout_on_delete = 0; |
| 1247 | 1245 | |
| 1246 | + spin_lock_irqsave(&sess->vha->work_lock, flags); | |
| 1248 | 1247 | if (sess->deleted == QLA_SESS_DELETION_IN_PROGRESS) { |
| 1249 | − spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); | |
| 1248 | + spin_unlock_irqrestore(&sess->vha->work_lock, flags); | |
| 1250 | 1249 | return; |
| 1251 | 1250 | } |
| 1252 | 1251 | sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; |
| 1253 | − spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); | |
| 1252 | + spin_unlock_irqrestore(&sess->vha->work_lock, flags); | |
| 1254 | 1253 | |
| 1255 | 1254 | sess->disc_state = DSC_DELETE_PEND; |
| 1256 | 1255 | |
| @@ -5507,9 +5507,9 @@ static void __exit scsi_debug_exit(void) · 5506 unmodified lines | ||
| 5507 | 5507 | int k = sdebug_add_host; |
| 5508 | 5508 | |
| 5509 | 5509 | stop_all_queued(); |
| 5510 | − free_all_queued(); | |
| 5511 | 5510 | for (; k; k--) |
| 5512 | 5511 | sdebug_remove_adapter(); |
| 5512 | + free_all_queued(); | |
| 5513 | 5513 | driver_unregister(&sdebug_driverfs_driver); |
| 5514 | 5514 | bus_unregister(&pseudo_lld_bus); |
| 5515 | 5515 | root_device_unregister(pseudo_primary); |
| @@ -3592,7 +3592,7 @@ fc_bsg_job_timeout(struct request *req) · 3591 unmodified lines | ||
| 3592 | 3592 | |
| 3593 | 3593 | /* the blk_end_sync_io() doesn't check the error */ |
| 3594 | 3594 | if (inflight) |
| 3595 | − blk_mq_complete_request(req); | |
| 3595 | + __blk_complete_request(req); | |
| 3596 | 3596 | return BLK_EH_DONE; |
| 3597 | 3597 | } |
| 3598 | 3598 | |
| @@ -654,10 +654,17 @@ static int scsifront_dev_reset_handler(struct scsi_cmnd *sc) · 653 unmodified lines | ||
| 654 | 654 | static int scsifront_sdev_configure(struct scsi_device *sdev) |
| 655 | 655 | { |
| 656 | 656 | struct vscsifrnt_info *info = shost_priv(sdev->host); |
| 657 | + int err; | |
| 657 | 658 | |
| 658 | − if (info && current == info->curr) | |
| 659 | − xenbus_printf(XBT_NIL, info->dev->nodename, | |
| 659 | + if (info && current == info->curr) { | |
| 660 | + err = xenbus_printf(XBT_NIL, info->dev->nodename, | |
| 660 | 661 | info->dev_state_path, "%d", XenbusStateConnected); |
| 662 | + if (err) { | |
| 663 | + xenbus_dev_error(info->dev, err, | |
| 664 | + "%s: writing dev_state_path", __func__); | |
| 665 | + return err; | |
| 666 | + } | |
| 667 | + } | |
| 661 | 668 | |
| 662 | 669 | return 0; |
| 663 | 670 | } |
| @@ -665,10 +672,15 @@ static int scsifront_sdev_configure(struct scsi_device *sdev) · 1 unmodified line | ||
| 665 | 672 | static void scsifront_sdev_destroy(struct scsi_device *sdev) |
| 666 | 673 | { |
| 667 | 674 | struct vscsifrnt_info *info = shost_priv(sdev->host); |
| 675 | + int err; | |
| 668 | 676 | |
| 669 | − if (info && current == info->curr) | |
| 670 | − xenbus_printf(XBT_NIL, info->dev->nodename, | |
| 677 | + if (info && current == info->curr) { | |
| 678 | + err = xenbus_printf(XBT_NIL, info->dev->nodename, | |
| 671 | 679 | info->dev_state_path, "%d", XenbusStateClosed); |
| 680 | + if (err) | |
| 681 | + xenbus_dev_error(info->dev, err, | |
| 682 | + "%s: writing dev_state_path", __func__); | |
| 683 | + } | |
| 672 | 684 | } |
| 673 | 685 | |
| 674 | 686 | static struct scsi_host_template scsifront_sht = { |
| @@ -1003,9 +1015,12 @@ static void scsifront_do_lun_hotplug(struct vscsifrnt_info *info, int op) · 328 unmodified lines | ||
| 1003 | 1015 | |
| 1004 | 1016 | if (scsi_add_device(info->host, chn, tgt, lun)) { |
| 1005 | 1017 | dev_err(&dev->dev, "scsi_add_device\n"); |
| 1006 | − xenbus_printf(XBT_NIL, dev->nodename, | |
| 1018 | + err = xenbus_printf(XBT_NIL, dev->nodename, | |
| 1007 | 1019 | info->dev_state_path, |
| 1008 | 1020 | "%d", XenbusStateClosed); |
| 1021 | + if (err) | |
| 1022 | + xenbus_dev_error(dev, err, | |
| 1023 | + "%s: writing dev_state_path", __func__); | |
| 1009 | 1024 | } |
| 1010 | 1025 | break; |
| 1011 | 1026 | case VSCSIFRONT_OP_DEL_LUN: |
| @@ -1019,10 +1034,14 @@ static void scsifront_do_lun_hotplug(struct vscsifrnt_info *info, int op) · 7 unmodified lines | ||
| 1019 | 1034 | } |
| 1020 | 1035 | break; |
| 1021 | 1036 | case VSCSIFRONT_OP_READD_LUN: |
| 1022 | − if (device_state == XenbusStateConnected) | |
| 1023 | − xenbus_printf(XBT_NIL, dev->nodename, | |
| 1037 | + if (device_state == XenbusStateConnected) { | |
| 1038 | + err = xenbus_printf(XBT_NIL, dev->nodename, | |
| 1024 | 1039 | info->dev_state_path, |
| 1025 | 1040 | "%d", XenbusStateConnected); |
| 1041 | + if (err) | |
| 1042 | + xenbus_dev_error(dev, err, | |
| 1043 | + "%s: writing dev_state_path", __func__); | |
| 1044 | + } | |
| 1026 | 1045 | break; |
| 1027 | 1046 | default: |
| 1028 | 1047 | break; |
| @@ -39,10 +39,15 @@ · 38 unmodified lines | ||
| 39 | 39 | |
| 40 | 40 | #define GPC_M4_PU_PDN_FLG 0x1bc |
| 41 | 41 | |
| 42 | − | |
| 43 | −#define PGC_MIPI 4 | |
| 44 | −#define PGC_PCIE 5 | |
| 45 | −#define PGC_USB_HSIC 8 | |
| 42 | +/* | |
| 43 | + * The PGC offset values in Reference Manual | |
| 44 | + * (Rev. 1, 01/2018 and the older ones) GPC chapter's | |
| 45 | + * GPC_PGC memory map are incorrect, below offset | |
| 46 | + * values are from design RTL. | |
| 47 | + */ | |
| 48 | +#define PGC_MIPI 16 | |
| 49 | +#define PGC_PCIE 17 | |
| 50 | +#define PGC_USB_HSIC 20 | |
| 46 | 51 | #define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40) |
| 47 | 52 | #define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0xc) |
| 48 | 53 | |
| @@ -5,7 +5,8 @@ menu "Qualcomm SoC drivers" · 4 unmodified lines | ||
| 5 | 5 | |
| 6 | 6 | config QCOM_COMMAND_DB |
| 7 | 7 | bool "Qualcomm Command DB" |
| 8 | − depends on (ARCH_QCOM && OF) || COMPILE_TEST | |
| 8 | + depends on ARCH_QCOM || COMPILE_TEST | |
| 9 | + depends on OF_RESERVED_MEM | |
| 9 | 10 | help |
| 10 | 11 | Command DB queries shared memory by key string for shared system |
| 11 | 12 | resources. Platform drivers that require to set state of a shared |
| @@ -194,11 +194,12 @@ static int rcar_sysc_pd_power_on(struct generic_pm_domain *genpd) · 193 unmodified lines | ||
| 194 | 194 | |
| 195 | 195 | static bool has_cpg_mstp; |
| 196 | 196 | |
| 197 | −static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd) | |
| 197 | +static int __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd) | |
| 198 | 198 | { |
| 199 | 199 | struct generic_pm_domain *genpd = &pd->genpd; |
| 200 | 200 | const char *name = pd->genpd.name; |
| 201 | 201 | struct dev_power_governor *gov = &simple_qos_governor; |
| 202 | + int error; | |
| 202 | 203 | |
| 203 | 204 | if (pd->flags & PD_CPU) { |
| 204 | 205 | /* |
| @@ -251,7 +252,11 @@ static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd) · 46 unmodified lines | ||
| 251 | 252 | rcar_sysc_power_up(&pd->ch); |
| 252 | 253 | |
| 253 | 254 | finalize: |
| 254 | − pm_genpd_init(genpd, gov, false); | |
| 255 | + error = pm_genpd_init(genpd, gov, false); | |
| 256 | + if (error) | |
| 257 | + pr_err("Failed to init PM domain %s: %d\n", name, error); | |
| 258 | + | |
| 259 | + return error; | |
| 255 | 260 | } |
| 256 | 261 | |
| 257 | 262 | static const struct of_device_id rcar_sysc_matches[] __initconst = { |
| @@ -375,6 +380,9 @@ static int __init rcar_sysc_pd_init(void) · 117 unmodified lines | ||
| 375 | 380 | pr_debug("%pOF: syscier = 0x%08x\n", np, syscier); |
| 376 | 381 | iowrite32(syscier, base + SYSCIER); |
| 377 | 382 | |
| 383 | + /* | |
| 384 | + * First, create all PM domains | |
| 385 | + */ | |
| 378 | 386 | for (i = 0; i < info->num_areas; i++) { |
| 379 | 387 | const struct rcar_sysc_area *area = &info->areas[i]; |
| 380 | 388 | struct rcar_sysc_pd *pd; |
| @@ -397,14 +405,29 @@ static int __init rcar_sysc_pd_init(void) · 16 unmodified lines | ||
| 397 | 405 | pd->ch.isr_bit = area->isr_bit; |
| 398 | 406 | pd->flags = area->flags; |
| 399 | 407 | |
| 400 | − rcar_sysc_pd_setup(pd); | |
| 401 | − if (area->parent >= 0) | |
| 402 | − pm_genpd_add_subdomain(domains->domains[area->parent], | |
| 403 | − &pd->genpd); | |
| 408 | + error = rcar_sysc_pd_setup(pd); | |
| 409 | + if (error) | |
| 410 | + goto out_put; | |
| 404 | 411 | |
| 405 | 412 | domains->domains[area->isr_bit] = &pd->genpd; |
| 406 | 413 | } |
| 407 | 414 | |
| 415 | + /* | |
| 416 | + * Second, link all PM domains to their parents | |
| 417 | + */ | |
| 418 | + for (i = 0; i < info->num_areas; i++) { | |
| 419 | + const struct rcar_sysc_area *area = &info->areas[i]; | |
| 420 | + | |
| 421 | + if (!area->name || area->parent < 0) | |
| 422 | + continue; | |
| 423 | + | |
| 424 | + error = pm_genpd_add_subdomain(domains->domains[area->parent], | |
| 425 | + domains->domains[area->isr_bit]); | |
| 426 | + if (error) | |
| 427 | + pr_warn("Failed to add PM subdomain %s to parent %u\n", | |
| 428 | + area->name, area->parent); | |
| 429 | + } | |
| 430 | + | |
| 408 | 431 | error = of_genpd_add_provider_onecell(np, &domains->onecell_data); |
| 409 | 432 | |
| 410 | 433 | out_put: |
| @@ -30,7 +30,7 @@ void *ion_heap_map_kernel(struct ion_heap *heap, · 29 unmodified lines | ||
| 30 | 30 | struct page **tmp = pages; |
| 31 | 31 | |
| 32 | 32 | if (!pages) |
| 33 | − return NULL; | |
| 33 | + return ERR_PTR(-ENOMEM); | |
| 34 | 34 | |
| 35 | 35 | if (buffer->flags & ION_FLAG_CACHED) |
| 36 | 36 | pgprot = PAGE_KERNEL; |
| @@ -642,7 +642,7 @@ static int daqp_ao_insn_write(struct comedi_device *dev, · 641 unmodified lines | ||
| 642 | 642 | /* Make sure D/A update mode is direct update */ |
| 643 | 643 | outb(0, dev->iobase + DAQP_AUX_REG); |
| 644 | 644 | |
| 645 | − for (i = 0; i > insn->n; i++) { | |
| 645 | + for (i = 0; i < insn->n; i++) { | |
| 646 | 646 | unsigned int val = data[i]; |
| 647 | 647 | int ret; |
| 648 | 648 | |
| @@ -11,6 +11,7 @@ config TYPEC_TCPCI · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | config TYPEC_RT1711H |
| 13 | 13 | tristate "Richtek RT1711H Type-C chip driver" |
| 14 | + depends on I2C | |
| 14 | 15 | select TYPEC_TCPCI |
| 15 | 16 | help |
| 16 | 17 | Richtek RT1711H Type-C chip driver that works with |
| @@ -656,7 +656,7 @@ static void scatter_data_area(struct tcmu_dev *udev, · 655 unmodified lines | ||
| 656 | 656 | } |
| 657 | 657 | |
| 658 | 658 | static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, |
| 659 | − bool bidi) | |
| 659 | + bool bidi, uint32_t read_len) | |
| 660 | 660 | { |
| 661 | 661 | struct se_cmd *se_cmd = cmd->se_cmd; |
| 662 | 662 | int i, dbi; |
| @@ -689,7 +689,7 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, · 26 unmodified lines | ||
| 689 | 689 | for_each_sg(data_sg, sg, data_nents, i) { |
| 690 | 690 | int sg_remaining = sg->length; |
| 691 | 691 | to = kmap_atomic(sg_page(sg)) + sg->offset; |
| 692 | − while (sg_remaining > 0) { | |
| 692 | + while (sg_remaining > 0 && read_len > 0) { | |
| 693 | 693 | if (block_remaining == 0) { |
| 694 | 694 | if (from) |
| 695 | 695 | kunmap_atomic(from); |
| @@ -701,6 +701,8 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, · 5 unmodified lines | ||
| 701 | 701 | } |
| 702 | 702 | copy_bytes = min_t(size_t, sg_remaining, |
| 703 | 703 | block_remaining); |
| 704 | + if (read_len < copy_bytes) | |
| 705 | + copy_bytes = read_len; | |
| 704 | 706 | offset = DATA_BLOCK_SIZE - block_remaining; |
| 705 | 707 | tcmu_flush_dcache_range(from, copy_bytes); |
| 706 | 708 | memcpy(to + sg->length - sg_remaining, from + offset, |
| @@ -708,8 +710,11 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, · 1 unmodified line | ||
| 708 | 710 | |
| 709 | 711 | sg_remaining -= copy_bytes; |
| 710 | 712 | block_remaining -= copy_bytes; |
| 713 | + read_len -= copy_bytes; | |
| 711 | 714 | } |
| 712 | 715 | kunmap_atomic(to - sg->offset); |
| 716 | + if (read_len == 0) | |
| 717 | + break; | |
| 713 | 718 | } |
| 714 | 719 | if (from) |
| 715 | 720 | kunmap_atomic(from); |
| @@ -1042,6 +1047,8 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * · 326 unmodified lines | ||
| 1042 | 1047 | { |
| 1043 | 1048 | struct se_cmd *se_cmd = cmd->se_cmd; |
| 1044 | 1049 | struct tcmu_dev *udev = cmd->tcmu_dev; |
| 1050 | + bool read_len_valid = false; | |
| 1051 | + uint32_t read_len = se_cmd->data_length; | |
| 1045 | 1052 | |
| 1046 | 1053 | /* |
| 1047 | 1054 | * cmd has been completed already from timeout, just reclaim |
| @@ -1056,13 +1063,28 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * · 8 unmodified lines | ||
| 1056 | 1063 | pr_warn("TCMU: Userspace set UNKNOWN_OP flag on se_cmd %p\n", |
| 1057 | 1064 | cmd->se_cmd); |
| 1058 | 1065 | entry->rsp.scsi_status = SAM_STAT_CHECK_CONDITION; |
| 1059 | − } else if (entry->rsp.scsi_status == SAM_STAT_CHECK_CONDITION) { | |
| 1066 | + goto done; | |
| 1067 | + } | |
| 1068 | + | |
| 1069 | + if (se_cmd->data_direction == DMA_FROM_DEVICE && | |
| 1070 | + (entry->hdr.uflags & TCMU_UFLAG_READ_LEN) && entry->rsp.read_len) { | |
| 1071 | + read_len_valid = true; | |
| 1072 | + if (entry->rsp.read_len < read_len) | |
| 1073 | + read_len = entry->rsp.read_len; | |
| 1074 | + } | |
| 1075 | + | |
| 1076 | + if (entry->rsp.scsi_status == SAM_STAT_CHECK_CONDITION) { | |
| 1060 | 1077 | transport_copy_sense_to_cmd(se_cmd, entry->rsp.sense_buffer); |
| 1061 | − } else if (se_cmd->se_cmd_flags & SCF_BIDI) { | |
| 1078 | + if (!read_len_valid ) | |
| 1079 | + goto done; | |
| 1080 | + else | |
| 1081 | + se_cmd->se_cmd_flags |= SCF_TREAT_READ_AS_NORMAL; | |
| 1082 | + } | |
| 1083 | + if (se_cmd->se_cmd_flags & SCF_BIDI) { | |
| 1062 | 1084 | /* Get Data-In buffer before clean up */ |
| 1063 | − gather_data_area(udev, cmd, true); | |
| 1085 | + gather_data_area(udev, cmd, true, read_len); | |
| 1064 | 1086 | } else if (se_cmd->data_direction == DMA_FROM_DEVICE) { |
| 1065 | − gather_data_area(udev, cmd, false); | |
| 1087 | + gather_data_area(udev, cmd, false, read_len); | |
| 1066 | 1088 | } else if (se_cmd->data_direction == DMA_TO_DEVICE) { |
| 1067 | 1089 | /* TODO: */ |
| 1068 | 1090 | } else if (se_cmd->data_direction != DMA_NONE) { |
| @@ -1070,7 +1092,13 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * · 1 unmodified line | ||
| 1070 | 1092 | se_cmd->data_direction); |
| 1071 | 1093 | } |
| 1072 | 1094 | |
| 1073 | − target_complete_cmd(cmd->se_cmd, entry->rsp.scsi_status); | |
| 1095 | +done: | |
| 1096 | + if (read_len_valid) { | |
| 1097 | + pr_debug("read_len = %d\n", read_len); | |
| 1098 | + target_complete_cmd_with_length(cmd->se_cmd, | |
| 1099 | + entry->rsp.scsi_status, read_len); | |
| 1100 | + } else | |
| 1101 | + target_complete_cmd(cmd->se_cmd, entry->rsp.scsi_status); | |
| 1074 | 1102 | |
| 1075 | 1103 | out: |
| 1076 | 1104 | cmd->se_cmd = NULL; |
| @@ -1740,7 +1768,7 @@ static int tcmu_configure_device(struct se_device *dev) · 663 unmodified lines | ||
| 1740 | 1768 | /* Initialise the mailbox of the ring buffer */ |
| 1741 | 1769 | mb = udev->mb_addr; |
| 1742 | 1770 | mb->version = TCMU_MAILBOX_VERSION; |
| 1743 | − mb->flags = TCMU_MAILBOX_FLAG_CAP_OOOC; | |
| 1771 | + mb->flags = TCMU_MAILBOX_FLAG_CAP_OOOC | TCMU_MAILBOX_FLAG_CAP_READ_LEN; | |
| 1744 | 1772 | mb->cmdr_off = CMDR_OFF; |
| 1745 | 1773 | mb->cmdr_size = udev->cmdr_size; |
| 1746 | 1774 | |
| @@ -124,6 +124,8 @@ struct n_tty_data { · 123 unmodified lines | ||
| 124 | 124 | struct mutex output_lock; |
| 125 | 125 | }; |
| 126 | 126 | |
| 127 | +#define MASK(x) ((x) & (N_TTY_BUF_SIZE - 1)) | |
| 128 | + | |
| 127 | 129 | static inline size_t read_cnt(struct n_tty_data *ldata) |
| 128 | 130 | { |
| 129 | 131 | return ldata->read_head - ldata->read_tail; |
| @@ -141,6 +143,7 @@ static inline unsigned char *read_buf_addr(struct n_tty_data *ldata, size_t i) · 11 unmodified lines | ||
| 141 | 143 | |
| 142 | 144 | static inline unsigned char echo_buf(struct n_tty_data *ldata, size_t i) |
| 143 | 145 | { |
| 146 | + smp_rmb(); /* Matches smp_wmb() in add_echo_byte(). */ | |
| 144 | 147 | return ldata->echo_buf[i & (N_TTY_BUF_SIZE - 1)]; |
| 145 | 148 | } |
| 146 | 149 | |
| @@ -316,9 +319,7 @@ static inline void put_tty_queue(unsigned char c, struct n_tty_data *ldata) · 169 unmodified lines | ||
| 316 | 319 | static void reset_buffer_flags(struct n_tty_data *ldata) |
| 317 | 320 | { |
| 318 | 321 | ldata->read_head = ldata->canon_head = ldata->read_tail = 0; |
| 319 | − ldata->echo_head = ldata->echo_tail = ldata->echo_commit = 0; | |
| 320 | 322 | ldata->commit_head = 0; |
| 321 | − ldata->echo_mark = 0; | |
| 322 | 323 | ldata->line_start = 0; |
| 323 | 324 | |
| 324 | 325 | ldata->erasing = 0; |
| @@ -617,12 +618,19 @@ static size_t __process_echoes(struct tty_struct *tty) · 292 unmodified lines | ||
| 617 | 618 | old_space = space = tty_write_room(tty); |
| 618 | 619 | |
| 619 | 620 | tail = ldata->echo_tail; |
| 620 | − while (ldata->echo_commit != tail) { | |
| 621 | + while (MASK(ldata->echo_commit) != MASK(tail)) { | |
| 621 | 622 | c = echo_buf(ldata, tail); |
| 622 | 623 | if (c == ECHO_OP_START) { |
| 623 | 624 | unsigned char op; |
| 624 | 625 | int no_space_left = 0; |
| 625 | 626 | |
| 627 | + /* | |
| 628 | + * Since add_echo_byte() is called without holding | |
| 629 | + * output_lock, we might see only portion of multi-byte | |
| 630 | + * operation. | |
| 631 | + */ | |
| 632 | + if (MASK(ldata->echo_commit) == MASK(tail + 1)) | |
| 633 | + goto not_yet_stored; | |
| 626 | 634 | /* |
| 627 | 635 | * If the buffer byte is the start of a multi-byte |
| 628 | 636 | * operation, get the next byte, which is either the |
| @@ -634,6 +642,8 @@ static size_t __process_echoes(struct tty_struct *tty) · 5 unmodified lines | ||
| 634 | 642 | unsigned int num_chars, num_bs; |
| 635 | 643 | |
| 636 | 644 | case ECHO_OP_ERASE_TAB: |
| 645 | + if (MASK(ldata->echo_commit) == MASK(tail + 2)) | |
| 646 | + goto not_yet_stored; | |
| 637 | 647 | num_chars = echo_buf(ldata, tail + 2); |
| 638 | 648 | |
| 639 | 649 | /* |
| @@ -728,7 +738,8 @@ static size_t __process_echoes(struct tty_struct *tty) · 88 unmodified lines | ||
| 728 | 738 | /* If the echo buffer is nearly full (so that the possibility exists |
| 729 | 739 | * of echo overrun before the next commit), then discard enough |
| 730 | 740 | * data at the tail to prevent a subsequent overrun */ |
| 731 | − while (ldata->echo_commit - tail >= ECHO_DISCARD_WATERMARK) { | |
| 741 | + while (ldata->echo_commit > tail && | |
| 742 | + ldata->echo_commit - tail >= ECHO_DISCARD_WATERMARK) { | |
| 732 | 743 | if (echo_buf(ldata, tail) == ECHO_OP_START) { |
| 733 | 744 | if (echo_buf(ldata, tail + 1) == ECHO_OP_ERASE_TAB) |
| 734 | 745 | tail += 3; |
| @@ -738,6 +749,7 @@ static size_t __process_echoes(struct tty_struct *tty) · 3 unmodified lines | ||
| 738 | 749 | tail++; |
| 739 | 750 | } |
| 740 | 751 | |
| 752 | + not_yet_stored: | |
| 741 | 753 | ldata->echo_tail = tail; |
| 742 | 754 | return old_space - space; |
| 743 | 755 | } |
| @@ -748,6 +760,7 @@ static void commit_echoes(struct tty_struct *tty) · 4 unmodified lines | ||
| 748 | 760 | size_t nr, old, echoed; |
| 749 | 761 | size_t head; |
| 750 | 762 | |
| 763 | + mutex_lock(&ldata->output_lock); | |
| 751 | 764 | head = ldata->echo_head; |
| 752 | 765 | ldata->echo_mark = head; |
| 753 | 766 | old = ldata->echo_commit - ldata->echo_tail; |
| @@ -756,10 +769,12 @@ static void commit_echoes(struct tty_struct *tty) · 2 unmodified lines | ||
| 756 | 769 | * is over the threshold (and try again each time another |
| 757 | 770 | * block is accumulated) */ |
| 758 | 771 | nr = head - ldata->echo_tail; |
| 759 | − if (nr < ECHO_COMMIT_WATERMARK || (nr % ECHO_BLOCK > old % ECHO_BLOCK)) | |
| 772 | + if (nr < ECHO_COMMIT_WATERMARK || | |
| 773 | + (nr % ECHO_BLOCK > old % ECHO_BLOCK)) { | |
| 774 | + mutex_unlock(&ldata->output_lock); | |
| 760 | 775 | return; |
| 776 | + } | |
| 761 | 777 | |
| 762 | − mutex_lock(&ldata->output_lock); | |
| 763 | 778 | ldata->echo_commit = head; |
| 764 | 779 | echoed = __process_echoes(tty); |
| 765 | 780 | mutex_unlock(&ldata->output_lock); |
| @@ -810,7 +825,9 @@ static void flush_echoes(struct tty_struct *tty) · 44 unmodified lines | ||
| 810 | 825 | |
| 811 | 826 | static inline void add_echo_byte(unsigned char c, struct n_tty_data *ldata) |
| 812 | 827 | { |
| 813 | − *echo_buf_addr(ldata, ldata->echo_head++) = c; | |
| 828 | + *echo_buf_addr(ldata, ldata->echo_head) = c; | |
| 829 | + smp_wmb(); /* Matches smp_rmb() in echo_buf(). */ | |
| 830 | + ldata->echo_head++; | |
| 814 | 831 | } |
| 815 | 832 | |
| 816 | 833 | /** |
| @@ -978,14 +995,15 @@ static void eraser(unsigned char c, struct tty_struct *tty) · 161 unmodified lines | ||
| 978 | 995 | } |
| 979 | 996 | |
| 980 | 997 | seen_alnums = 0; |
| 981 | − while (ldata->read_head != ldata->canon_head) { | |
| 998 | + while (MASK(ldata->read_head) != MASK(ldata->canon_head)) { | |
| 982 | 999 | head = ldata->read_head; |
| 983 | 1000 | |
| 984 | 1001 | /* erase a single possibly multibyte character */ |
| 985 | 1002 | do { |
| 986 | 1003 | head--; |
| 987 | 1004 | c = read_buf(ldata, head); |
| 988 | − } while (is_continuation(c, tty) && head != ldata->canon_head); | |
| 1005 | + } while (is_continuation(c, tty) && | |
| 1006 | + MASK(head) != MASK(ldata->canon_head)); | |
| 989 | 1007 | |
| 990 | 1008 | /* do not partially erase */ |
| 991 | 1009 | if (is_continuation(c, tty)) |
| @@ -1027,7 +1045,7 @@ static void eraser(unsigned char c, struct tty_struct *tty) · 35 unmodified lines | ||
| 1027 | 1045 | * This info is used to go back the correct |
| 1028 | 1046 | * number of columns. |
| 1029 | 1047 | */ |
| 1030 | − while (tail != ldata->canon_head) { | |
| 1048 | + while (MASK(tail) != MASK(ldata->canon_head)) { | |
| 1031 | 1049 | tail--; |
| 1032 | 1050 | c = read_buf(ldata, tail); |
| 1033 | 1051 | if (c == '\t') { |
| @@ -1302,7 +1320,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c) · 268 unmodified lines | ||
| 1302 | 1320 | finish_erasing(ldata); |
| 1303 | 1321 | echo_char(c, tty); |
| 1304 | 1322 | echo_char_raw('\n', ldata); |
| 1305 | − while (tail != ldata->read_head) { | |
| 1323 | + while (MASK(tail) != MASK(ldata->read_head)) { | |
| 1306 | 1324 | echo_char(read_buf(ldata, tail), tty); |
| 1307 | 1325 | tail++; |
| 1308 | 1326 | } |
| @@ -1878,30 +1896,21 @@ static int n_tty_open(struct tty_struct *tty) · 569 unmodified lines | ||
| 1878 | 1896 | struct n_tty_data *ldata; |
| 1879 | 1897 | |
| 1880 | 1898 | /* Currently a malloc failure here can panic */ |
| 1881 | − ldata = vmalloc(sizeof(*ldata)); | |
| 1899 | + ldata = vzalloc(sizeof(*ldata)); | |
| 1882 | 1900 | if (!ldata) |
| 1883 | − goto err; | |
| 1901 | + return -ENOMEM; | |
| 1884 | 1902 | |
| 1885 | 1903 | ldata->overrun_time = jiffies; |
| 1886 | 1904 | mutex_init(&ldata->atomic_read_lock); |
| 1887 | 1905 | mutex_init(&ldata->output_lock); |
| 1888 | 1906 | |
| 1889 | 1907 | tty->disc_data = ldata; |
| 1890 | − reset_buffer_flags(tty->disc_data); | |
| 1891 | − ldata->column = 0; | |
| 1892 | − ldata->canon_column = 0; | |
| 1893 | − ldata->num_overrun = 0; | |
| 1894 | − ldata->no_room = 0; | |
| 1895 | − ldata->lnext = 0; | |
| 1896 | 1908 | tty->closing = 0; |
| 1897 | 1909 | /* indicate buffer work may resume */ |
| 1898 | 1910 | clear_bit(TTY_LDISC_HALTED, &tty->flags); |
| 1899 | 1911 | n_tty_set_termios(tty, NULL); |
| 1900 | 1912 | tty_unthrottle(tty); |
| 1901 | − | |
| 1902 | 1913 | return 0; |
| 1903 | −err: | |
| 1904 | − return -ENOMEM; | |
| 1905 | 1914 | } |
| 1906 | 1915 | |
| 1907 | 1916 | static inline int input_available_p(struct tty_struct *tty, int poll) |
| @@ -2411,7 +2420,7 @@ static unsigned long inq_canon(struct n_tty_data *ldata) · 503 unmodified lines | ||
| 2411 | 2420 | tail = ldata->read_tail; |
| 2412 | 2421 | nr = head - tail; |
| 2413 | 2422 | /* Skip EOF-chars.. */ |
| 2414 | − while (head != tail) { | |
| 2423 | + while (MASK(head) != MASK(tail)) { | |
| 2415 | 2424 | if (test_bit(tail & (N_TTY_BUF_SIZE - 1), ldata->read_flags) && |
| 2416 | 2425 | read_buf(ldata, tail) == __DISABLED_CHAR) |
| 2417 | 2426 | nr--; |
| @@ -617,6 +617,7 @@ EXPORT_SYMBOL_GPL(__serdev_device_driver_register); · 616 unmodified lines | ||
| 617 | 617 | static void __exit serdev_exit(void) |
| 618 | 618 | { |
| 619 | 619 | bus_unregister(&serdev_bus_type); |
| 620 | + ida_destroy(&ctrl_ida); | |
| 620 | 621 | } |
| 621 | 622 | module_exit(serdev_exit); |
| 622 | 623 | |
| @@ -3339,9 +3339,7 @@ static const struct pci_device_id blacklist[] = { · 3338 unmodified lines | ||
| 3339 | 3339 | /* multi-io cards handled by parport_serial */ |
| 3340 | 3340 | { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */ |
| 3341 | 3341 | { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */ |
| 3342 | − { PCI_DEVICE(0x4348, 0x7173), }, /* WCH CH355 4S */ | |
| 3343 | 3342 | { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */ |
| 3344 | − { PCI_DEVICE(0x1c00, 0x3470), }, /* WCH CH384 4S */ | |
| 3345 | 3343 | |
| 3346 | 3344 | /* Moxa Smartio MUE boards handled by 8250_moxa */ |
| 3347 | 3345 | { PCI_VDEVICE(MOXA, 0x1024), }, |
| @@ -784,7 +784,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ · 783 unmodified lines | ||
| 784 | 784 | if (!*vc->vc_uni_pagedir_loc) |
| 785 | 785 | con_set_default_unimap(vc); |
| 786 | 786 | |
| 787 | − vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL); | |
| 787 | + vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_KERNEL); | |
| 788 | 788 | if (!vc->vc_screenbuf) |
| 789 | 789 | goto err_free; |
| 790 | 790 | |
| @@ -871,7 +871,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, · 80 unmodified lines | ||
| 871 | 871 | |
| 872 | 872 | if (new_screen_size > (4 << 20)) |
| 873 | 873 | return -EINVAL; |
| 874 | − newscreen = kmalloc(new_screen_size, GFP_USER); | |
| 874 | + newscreen = kzalloc(new_screen_size, GFP_USER); | |
| 875 | 875 | if (!newscreen) |
| 876 | 876 | return -ENOMEM; |
| 877 | 877 | |
| @@ -124,8 +124,11 @@ static int host_start(struct ci_hdrc *ci) · 123 unmodified lines | ||
| 124 | 124 | |
| 125 | 125 | hcd->power_budget = ci->platdata->power_budget; |
| 126 | 126 | hcd->tpl_support = ci->platdata->tpl_support; |
| 127 | − if (ci->phy || ci->usb_phy) | |
| 127 | + if (ci->phy || ci->usb_phy) { | |
| 128 | 128 | hcd->skip_phy_initialization = 1; |
| 129 | + if (ci->usb_phy) | |
| 130 | + hcd->usb_phy = ci->usb_phy; | |
| 131 | + } | |
| 129 | 132 | |
| 130 | 133 | ehci = hcd_to_ehci(hcd); |
| 131 | 134 | ehci->caps = ci->hw_bank.cap; |
| @@ -1758,6 +1758,9 @@ static const struct usb_device_id acm_ids[] = { · 1757 unmodified lines | ||
| 1758 | 1758 | { USB_DEVICE(0x11ca, 0x0201), /* VeriFone Mx870 Gadget Serial */ |
| 1759 | 1759 | .driver_info = SINGLE_RX_URB, |
| 1760 | 1760 | }, |
| 1761 | + { USB_DEVICE(0x1965, 0x0018), /* Uniden UBC125XLT */ | |
| 1762 | + .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ | |
| 1763 | + }, | |
| 1761 | 1764 | { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */ |
| 1762 | 1765 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ |
| 1763 | 1766 | }, |
| @@ -1004,6 +1004,7 @@ struct dwc2_hregs_backup { · 1003 unmodified lines | ||
| 1004 | 1004 | * @frame_list_sz: Frame list size |
| 1005 | 1005 | * @desc_gen_cache: Kmem cache for generic descriptors |
| 1006 | 1006 | * @desc_hsisoc_cache: Kmem cache for hs isochronous descriptors |
| 1007 | + * @unaligned_cache: Kmem cache for DMA mode to handle non-aligned buf | |
| 1007 | 1008 | * |
| 1008 | 1009 | * These are for peripheral mode: |
| 1009 | 1010 | * |
| @@ -1177,6 +1178,8 @@ struct dwc2_hsotg { · 167 unmodified lines | ||
| 1177 | 1178 | u32 frame_list_sz; |
| 1178 | 1179 | struct kmem_cache *desc_gen_cache; |
| 1179 | 1180 | struct kmem_cache *desc_hsisoc_cache; |
| 1181 | + struct kmem_cache *unaligned_cache; | |
| 1182 | +#define DWC2_KMEM_UNALIGNED_BUF_SIZE 1024 | |
| 1180 | 1183 | |
| 1181 | 1184 | #endif /* CONFIG_USB_DWC2_HOST || CONFIG_USB_DWC2_DUAL_ROLE */ |
| 1182 | 1185 | |
| @@ -812,6 +812,7 @@ static int dwc2_gadget_fill_isoc_desc(struct dwc2_hsotg_ep *hs_ep, · 811 unmodified lines | ||
| 812 | 812 | u32 index; |
| 813 | 813 | u32 maxsize = 0; |
| 814 | 814 | u32 mask = 0; |
| 815 | + u8 pid = 0; | |
| 815 | 816 | |
| 816 | 817 | maxsize = dwc2_gadget_get_desc_params(hs_ep, &mask); |
| 817 | 818 | |
| @@ -840,7 +841,11 @@ static int dwc2_gadget_fill_isoc_desc(struct dwc2_hsotg_ep *hs_ep, · 22 unmodified lines | ||
| 840 | 841 | ((len << DEV_DMA_NBYTES_SHIFT) & mask)); |
| 841 | 842 | |
| 842 | 843 | if (hs_ep->dir_in) { |
| 843 | − desc->status |= ((hs_ep->mc << DEV_DMA_ISOC_PID_SHIFT) & | |
| 844 | + if (len) | |
| 845 | + pid = DIV_ROUND_UP(len, hs_ep->ep.maxpacket); | |
| 846 | + else | |
| 847 | + pid = 1; | |
| 848 | + desc->status |= ((pid << DEV_DMA_ISOC_PID_SHIFT) & | |
| 844 | 849 | DEV_DMA_ISOC_PID_MASK) | |
| 845 | 850 | ((len % hs_ep->ep.maxpacket) ? |
| 846 | 851 | DEV_DMA_SHORT : 0) | |
| @@ -884,6 +889,7 @@ static void dwc2_gadget_start_isoc_ddma(struct dwc2_hsotg_ep *hs_ep) · 37 unmodified lines | ||
| 884 | 889 | struct dwc2_dma_desc *desc; |
| 885 | 890 | |
| 886 | 891 | if (list_empty(&hs_ep->queue)) { |
| 892 | + hs_ep->target_frame = TARGET_FRAME_INITIAL; | |
| 887 | 893 | dev_dbg(hsotg->dev, "%s: No requests in queue\n", __func__); |
| 888 | 894 | return; |
| 889 | 895 | } |
| @@ -2755,8 +2761,6 @@ static void dwc2_gadget_handle_out_token_ep_disabled(struct dwc2_hsotg_ep *ep) · 1865 unmodified lines | ||
| 2755 | 2761 | */ |
| 2756 | 2762 | tmp = dwc2_hsotg_read_frameno(hsotg); |
| 2757 | 2763 | |
| 2758 | − dwc2_hsotg_complete_request(hsotg, ep, get_ep_head(ep), 0); | |
| 2759 | − | |
| 2760 | 2764 | if (using_desc_dma(hsotg)) { |
| 2761 | 2765 | if (ep->target_frame == TARGET_FRAME_INITIAL) { |
| 2762 | 2766 | /* Start first ISO Out */ |
| @@ -2817,9 +2821,6 @@ static void dwc2_gadget_handle_nak(struct dwc2_hsotg_ep *hs_ep) · 54 unmodified lines | ||
| 2817 | 2821 | |
| 2818 | 2822 | tmp = dwc2_hsotg_read_frameno(hsotg); |
| 2819 | 2823 | if (using_desc_dma(hsotg)) { |
| 2820 | − dwc2_hsotg_complete_request(hsotg, hs_ep, | |
| 2821 | − get_ep_head(hs_ep), 0); | |
| 2822 | − | |
| 2823 | 2824 | hs_ep->target_frame = tmp; |
| 2824 | 2825 | dwc2_gadget_incr_frame_num(hs_ep); |
| 2825 | 2826 | dwc2_gadget_start_isoc_ddma(hs_ep); |
| @@ -4739,9 +4740,11 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg) · 1913 unmodified lines | ||
| 4739 | 4740 | } |
| 4740 | 4741 | |
| 4741 | 4742 | ret = usb_add_gadget_udc(dev, &hsotg->gadget); |
| 4742 | − if (ret) | |
| 4743 | + if (ret) { | |
| 4744 | + dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, | |
| 4745 | + hsotg->ctrl_req); | |
| 4743 | 4746 | return ret; |
| 4744 | − | |
| 4747 | + } | |
| 4745 | 4748 | dwc2_hsotg_dump(hsotg); |
| 4746 | 4749 | |
| 4747 | 4750 | return 0; |
| @@ -4755,6 +4758,7 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg) · 7 unmodified lines | ||
| 4755 | 4758 | int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg) |
| 4756 | 4759 | { |
| 4757 | 4760 | usb_del_gadget_udc(&hsotg->gadget); |
| 4761 | + dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, hsotg->ctrl_req); | |
| 4758 | 4762 | |
| 4759 | 4763 | return 0; |
| 4760 | 4764 | } |
| @@ -1567,11 +1567,20 @@ static void dwc2_hc_start_transfer(struct dwc2_hsotg *hsotg, · 1566 unmodified lines | ||
| 1567 | 1567 | } |
| 1568 | 1568 | |
| 1569 | 1569 | if (hsotg->params.host_dma) { |
| 1570 | − dwc2_writel((u32)chan->xfer_dma, | |
| 1571 | − hsotg->regs + HCDMA(chan->hc_num)); | |
| 1570 | + dma_addr_t dma_addr; | |
| 1571 | + | |
| 1572 | + if (chan->align_buf) { | |
| 1573 | + if (dbg_hc(chan)) | |
| 1574 | + dev_vdbg(hsotg->dev, "align_buf\n"); | |
| 1575 | + dma_addr = chan->align_buf; | |
| 1576 | + } else { | |
| 1577 | + dma_addr = chan->xfer_dma; | |
| 1578 | + } | |
| 1579 | + dwc2_writel((u32)dma_addr, hsotg->regs + HCDMA(chan->hc_num)); | |
| 1580 | + | |
| 1572 | 1581 | if (dbg_hc(chan)) |
| 1573 | 1582 | dev_vdbg(hsotg->dev, "Wrote %08lx to HCDMA(%d)\n", |
| 1574 | − (unsigned long)chan->xfer_dma, chan->hc_num); | |
| 1583 | + (unsigned long)dma_addr, chan->hc_num); | |
| 1575 | 1584 | } |
| 1576 | 1585 | |
| 1577 | 1586 | /* Start the split */ |
| @@ -2625,6 +2634,35 @@ static void dwc2_hc_init_xfer(struct dwc2_hsotg *hsotg, · 1047 unmodified lines | ||
| 2625 | 2634 | } |
| 2626 | 2635 | } |
| 2627 | 2636 | |
| 2637 | +static int dwc2_alloc_split_dma_aligned_buf(struct dwc2_hsotg *hsotg, | |
| 2638 | + struct dwc2_qh *qh, | |
| 2639 | + struct dwc2_host_chan *chan) | |
| 2640 | +{ | |
| 2641 | + if (!hsotg->unaligned_cache || | |
| 2642 | + chan->max_packet > DWC2_KMEM_UNALIGNED_BUF_SIZE) | |
| 2643 | + return -ENOMEM; | |
| 2644 | + | |
| 2645 | + if (!qh->dw_align_buf) { | |
| 2646 | + qh->dw_align_buf = kmem_cache_alloc(hsotg->unaligned_cache, | |
| 2647 | + GFP_ATOMIC | GFP_DMA); | |
| 2648 | + if (!qh->dw_align_buf) | |
| 2649 | + return -ENOMEM; | |
| 2650 | + } | |
| 2651 | + | |
| 2652 | + qh->dw_align_buf_dma = dma_map_single(hsotg->dev, qh->dw_align_buf, | |
| 2653 | + DWC2_KMEM_UNALIGNED_BUF_SIZE, | |
| 2654 | + DMA_FROM_DEVICE); | |
| 2655 | + | |
| 2656 | + if (dma_mapping_error(hsotg->dev, qh->dw_align_buf_dma)) { | |
| 2657 | + dev_err(hsotg->dev, "can't map align_buf\n"); | |
| 2658 | + chan->align_buf = 0; | |
| 2659 | + return -EINVAL; | |
| 2660 | + } | |
| 2661 | + | |
| 2662 | + chan->align_buf = qh->dw_align_buf_dma; | |
| 2663 | + return 0; | |
| 2664 | +} | |
| 2665 | + | |
| 2628 | 2666 | #define DWC2_USB_DMA_ALIGN 4 |
| 2629 | 2667 | |
| 2630 | 2668 | struct dma_aligned_buffer { |
| @@ -2802,6 +2840,32 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) · 171 unmodified lines | ||
| 2802 | 2840 | /* Set the transfer attributes */ |
| 2803 | 2841 | dwc2_hc_init_xfer(hsotg, chan, qtd); |
| 2804 | 2842 | |
| 2843 | + /* For non-dword aligned buffers */ | |
| 2844 | + if (hsotg->params.host_dma && qh->do_split && | |
| 2845 | + chan->ep_is_in && (chan->xfer_dma & 0x3)) { | |
| 2846 | + dev_vdbg(hsotg->dev, "Non-aligned buffer\n"); | |
| 2847 | + if (dwc2_alloc_split_dma_aligned_buf(hsotg, qh, chan)) { | |
| 2848 | + dev_err(hsotg->dev, | |
| 2849 | + "Failed to allocate memory to handle non-aligned buffer\n"); | |
| 2850 | + /* Add channel back to free list */ | |
| 2851 | + chan->align_buf = 0; | |
| 2852 | + chan->multi_count = 0; | |
| 2853 | + list_add_tail(&chan->hc_list_entry, | |
| 2854 | + &hsotg->free_hc_list); | |
| 2855 | + qtd->in_process = 0; | |
| 2856 | + qh->channel = NULL; | |
| 2857 | + return -ENOMEM; | |
| 2858 | + } | |
| 2859 | + } else { | |
| 2860 | + /* | |
| 2861 | + * We assume that DMA is always aligned in non-split | |
| 2862 | + * case or split out case. Warn if not. | |
| 2863 | + */ | |
| 2864 | + WARN_ON_ONCE(hsotg->params.host_dma && | |
| 2865 | + (chan->xfer_dma & 0x3)); | |
| 2866 | + chan->align_buf = 0; | |
| 2867 | + } | |
| 2868 | + | |
| 2805 | 2869 | if (chan->ep_type == USB_ENDPOINT_XFER_INT || |
| 2806 | 2870 | chan->ep_type == USB_ENDPOINT_XFER_ISOC) |
| 2807 | 2871 | /* |
| @@ -5246,6 +5310,19 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) · 2438 unmodified lines | ||
| 5246 | 5310 | } |
| 5247 | 5311 | } |
| 5248 | 5312 | |
| 5313 | + if (hsotg->params.host_dma) { | |
| 5314 | + /* | |
| 5315 | + * Create kmem caches to handle non-aligned buffer | |
| 5316 | + * in Buffer DMA mode. | |
| 5317 | + */ | |
| 5318 | + hsotg->unaligned_cache = kmem_cache_create("dwc2-unaligned-dma", | |
| 5319 | + DWC2_KMEM_UNALIGNED_BUF_SIZE, 4, | |
| 5320 | + SLAB_CACHE_DMA, NULL); | |
| 5321 | + if (!hsotg->unaligned_cache) | |
| 5322 | + dev_err(hsotg->dev, | |
| 5323 | + "unable to create dwc2 unaligned cache\n"); | |
| 5324 | + } | |
| 5325 | + | |
| 5249 | 5326 | hsotg->otg_port = 1; |
| 5250 | 5327 | hsotg->frame_list = NULL; |
| 5251 | 5328 | hsotg->frame_list_dma = 0; |
| @@ -5280,8 +5357,9 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) · 28 unmodified lines | ||
| 5280 | 5357 | return 0; |
| 5281 | 5358 | |
| 5282 | 5359 | error4: |
| 5283 | − kmem_cache_destroy(hsotg->desc_gen_cache); | |
| 5360 | + kmem_cache_destroy(hsotg->unaligned_cache); | |
| 5284 | 5361 | kmem_cache_destroy(hsotg->desc_hsisoc_cache); |
| 5362 | + kmem_cache_destroy(hsotg->desc_gen_cache); | |
| 5285 | 5363 | error3: |
| 5286 | 5364 | dwc2_hcd_release(hsotg); |
| 5287 | 5365 | error2: |
| @@ -5322,8 +5400,9 @@ void dwc2_hcd_remove(struct dwc2_hsotg *hsotg) · 34 unmodified lines | ||
| 5322 | 5400 | usb_remove_hcd(hcd); |
| 5323 | 5401 | hsotg->priv = NULL; |
| 5324 | 5402 | |
| 5325 | − kmem_cache_destroy(hsotg->desc_gen_cache); | |
| 5403 | + kmem_cache_destroy(hsotg->unaligned_cache); | |
| 5326 | 5404 | kmem_cache_destroy(hsotg->desc_hsisoc_cache); |
| 5405 | + kmem_cache_destroy(hsotg->desc_gen_cache); | |
| 5327 | 5406 | |
| 5328 | 5407 | dwc2_hcd_release(hsotg); |
| 5329 | 5408 | usb_put_hcd(hcd); |
| @@ -5435,7 +5514,7 @@ int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg) · 105 unmodified lines | ||
| 5435 | 5514 | dwc2_writel(hprt0, hsotg->regs + HPRT0); |
| 5436 | 5515 | |
| 5437 | 5516 | /* Wait for the HPRT0.PrtSusp register field to be set */ |
| 5438 | − if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 300)) | |
| 5517 | + if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 3000)) | |
| 5439 | 5518 | dev_warn(hsotg->dev, "Suspend wasn't generated\n"); |
| 5440 | 5519 | |
| 5441 | 5520 | /* |
| @@ -5616,6 +5695,8 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, · 174 unmodified lines | ||
| 5616 | 5695 | return ret; |
| 5617 | 5696 | } |
| 5618 | 5697 | |
| 5698 | + dwc2_hcd_rem_wakeup(hsotg); | |
| 5699 | + | |
| 5619 | 5700 | hsotg->hibernated = 0; |
| 5620 | 5701 | hsotg->bus_suspended = 0; |
| 5621 | 5702 | hsotg->lx_state = DWC2_L0; |
| @@ -76,6 +76,8 @@ struct dwc2_qh; · 75 unmodified lines | ||
| 76 | 76 | * (micro)frame |
| 77 | 77 | * @xfer_buf: Pointer to current transfer buffer position |
| 78 | 78 | * @xfer_dma: DMA address of xfer_buf |
| 79 | + * @align_buf: In Buffer DMA mode this will be used if xfer_buf is not | |
| 80 | + * DWORD aligned | |
| 79 | 81 | * @xfer_len: Total number of bytes to transfer |
| 80 | 82 | * @xfer_count: Number of bytes transferred so far |
| 81 | 83 | * @start_pkt_count: Packet count at start of transfer |
| @@ -133,6 +135,7 @@ struct dwc2_host_chan { · 51 unmodified lines | ||
| 133 | 135 | |
| 134 | 136 | u8 *xfer_buf; |
| 135 | 137 | dma_addr_t xfer_dma; |
| 138 | + dma_addr_t align_buf; | |
| 136 | 139 | u32 xfer_len; |
| 137 | 140 | u32 xfer_count; |
| 138 | 141 | u16 start_pkt_count; |
| @@ -302,6 +305,9 @@ struct dwc2_hs_transfer_time { · 163 unmodified lines | ||
| 302 | 305 | * speed. Note that this is in "schedule slice" which |
| 303 | 306 | * is tightly packed. |
| 304 | 307 | * @ntd: Actual number of transfer descriptors in a list |
| 308 | + * @dw_align_buf: Used instead of original buffer if its physical address | |
| 309 | + * is not dword-aligned | |
| 310 | + * @dw_align_buf_dma: DMA address for dw_align_buf | |
| 305 | 311 | * @qtd_list: List of QTDs for this QH |
| 306 | 312 | * @channel: Host channel currently processing transfers for this QH |
| 307 | 313 | * @qh_list_entry: Entry for QH in either the periodic or non-periodic |
| @@ -350,6 +356,8 @@ struct dwc2_qh { · 42 unmodified lines | ||
| 350 | 356 | struct dwc2_hs_transfer_time hs_transfers[DWC2_HS_SCHEDULE_UFRAMES]; |
| 351 | 357 | u32 ls_start_schedule_slice; |
| 352 | 358 | u16 ntd; |
| 359 | + u8 *dw_align_buf; | |
| 360 | + dma_addr_t dw_align_buf_dma; | |
| 353 | 361 | struct list_head qtd_list; |
| 354 | 362 | struct dwc2_host_chan *channel; |
| 355 | 363 | struct list_head qh_list_entry; |
| @@ -942,14 +942,21 @@ static int dwc2_xfercomp_isoc_split_in(struct dwc2_hsotg *hsotg, · 941 unmodified lines | ||
| 942 | 942 | frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index]; |
| 943 | 943 | len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd, |
| 944 | 944 | DWC2_HC_XFER_COMPLETE, NULL); |
| 945 | − if (!len) { | |
| 945 | + if (!len && !qtd->isoc_split_offset) { | |
| 946 | 946 | qtd->complete_split = 0; |
| 947 | − qtd->isoc_split_offset = 0; | |
| 948 | 947 | return 0; |
| 949 | 948 | } |
| 950 | 949 | |
| 951 | 950 | frame_desc->actual_length += len; |
| 952 | 951 | |
| 952 | + if (chan->align_buf) { | |
| 953 | + dev_vdbg(hsotg->dev, "non-aligned buffer\n"); | |
| 954 | + dma_unmap_single(hsotg->dev, chan->qh->dw_align_buf_dma, | |
| 955 | + DWC2_KMEM_UNALIGNED_BUF_SIZE, DMA_FROM_DEVICE); | |
| 956 | + memcpy(qtd->urb->buf + (chan->xfer_dma - qtd->urb->dma), | |
| 957 | + chan->qh->dw_align_buf, len); | |
| 958 | + } | |
| 959 | + | |
| 953 | 960 | qtd->isoc_split_offset += len; |
| 954 | 961 | |
| 955 | 962 | hctsiz = dwc2_readl(hsotg->regs + HCTSIZ(chnum)); |
| @@ -383,7 +383,7 @@ static unsigned long *dwc2_get_ls_map(struct dwc2_hsotg *hsotg, · 382 unmodified lines | ||
| 383 | 383 | /* Get the map and adjust if this is a multi_tt hub */ |
| 384 | 384 | map = qh->dwc_tt->periodic_bitmaps; |
| 385 | 385 | if (qh->dwc_tt->usb_tt->multi) |
| 386 | − map += DWC2_ELEMENTS_PER_LS_BITMAP * qh->ttport; | |
| 386 | + map += DWC2_ELEMENTS_PER_LS_BITMAP * (qh->ttport - 1); | |
| 387 | 387 | |
| 388 | 388 | return map; |
| 389 | 389 | } |
| @@ -1696,6 +1696,9 @@ void dwc2_hcd_qh_free(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) · 1306 unmodified lines | ||
| 1696 | 1696 | |
| 1697 | 1697 | if (qh->desc_list) |
| 1698 | 1698 | dwc2_hcd_qh_free_ddma(hsotg, qh); |
| 1699 | + else if (hsotg->unaligned_cache && qh->dw_align_buf) | |
| 1700 | + kmem_cache_free(hsotg->unaligned_cache, qh->dw_align_buf); | |
| 1701 | + | |
| 1699 | 1702 | kfree(qh); |
| 1700 | 1703 | } |
| 1701 | 1704 | |
| @@ -1272,7 +1272,6 @@ static int dwc3_probe(struct platform_device *pdev) · 1271 unmodified lines | ||
| 1272 | 1272 | if (!dwc->clks) |
| 1273 | 1273 | return -ENOMEM; |
| 1274 | 1274 | |
| 1275 | − dwc->num_clks = ARRAY_SIZE(dwc3_core_clks); | |
| 1276 | 1275 | dwc->dev = dev; |
| 1277 | 1276 | |
| 1278 | 1277 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| @@ -1307,15 +1306,19 @@ static int dwc3_probe(struct platform_device *pdev) · 28 unmodified lines | ||
| 1307 | 1306 | if (IS_ERR(dwc->reset)) |
| 1308 | 1307 | return PTR_ERR(dwc->reset); |
| 1309 | 1308 | |
| 1310 | − ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks); | |
| 1311 | − if (ret == -EPROBE_DEFER) | |
| 1312 | − return ret; | |
| 1313 | − /* | |
| 1314 | − * Clocks are optional, but new DT platforms should support all clocks | |
| 1315 | − * as required by the DT-binding. | |
| 1316 | − */ | |
| 1317 | − if (ret) | |
| 1318 | − dwc->num_clks = 0; | |
| 1309 | + if (dev->of_node) { | |
| 1310 | + dwc->num_clks = ARRAY_SIZE(dwc3_core_clks); | |
| 1311 | + | |
| 1312 | + ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks); | |
| 1313 | + if (ret == -EPROBE_DEFER) | |
| 1314 | + return ret; | |
| 1315 | + /* | |
| 1316 | + * Clocks are optional, but new DT platforms should support all | |
| 1317 | + * clocks as required by the DT-binding. | |
| 1318 | + */ | |
| 1319 | + if (ret) | |
| 1320 | + dwc->num_clks = 0; | |
| 1321 | + } | |
| 1319 | 1322 | |
| 1320 | 1323 | ret = reset_control_deassert(dwc->reset); |
| 1321 | 1324 | if (ret) |
| @@ -165,8 +165,9 @@ static int dwc3_of_simple_remove(struct platform_device *pdev) · 164 unmodified lines | ||
| 165 | 165 | |
| 166 | 166 | reset_control_put(simple->resets); |
| 167 | 167 | |
| 168 | − pm_runtime_put_sync(dev); | |
| 169 | 168 | pm_runtime_disable(dev); |
| 169 | + pm_runtime_put_noidle(dev); | |
| 170 | + pm_runtime_set_suspended(dev); | |
| 170 | 171 | |
| 171 | 172 | return 0; |
| 172 | 173 | } |
| @@ -34,6 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | #define PCI_DEVICE_ID_INTEL_GLK 0x31aa |
| 35 | 35 | #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee |
| 36 | 36 | #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e |
| 37 | +#define PCI_DEVICE_ID_INTEL_ICLLP 0x34ee | |
| 37 | 38 | |
| 38 | 39 | #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" |
| 39 | 40 | #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 |
| @@ -289,6 +290,7 @@ static const struct pci_device_id dwc3_pci_id_table[] = { · 249 unmodified lines | ||
| 289 | 290 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK), }, |
| 290 | 291 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPLP), }, |
| 291 | 292 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPH), }, |
| 293 | + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICLLP), }, | |
| 292 | 294 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, |
| 293 | 295 | { } /* Terminating Entry */ |
| 294 | 296 | }; |
| @@ -490,6 +490,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev) · 489 unmodified lines | ||
| 490 | 490 | qcom->dwc3 = of_find_device_by_node(dwc3_np); |
| 491 | 491 | if (!qcom->dwc3) { |
| 492 | 492 | dev_err(&pdev->dev, "failed to get dwc3 platform device\n"); |
| 493 | + ret = -ENODEV; | |
| 493 | 494 | goto depopulate; |
| 494 | 495 | } |
| 495 | 496 | |
| @@ -547,8 +548,7 @@ static int dwc3_qcom_remove(struct platform_device *pdev) · 51 unmodified lines | ||
| 547 | 548 | return 0; |
| 548 | 549 | } |
| 549 | 550 | |
| 550 | −#ifdef CONFIG_PM_SLEEP | |
| 551 | −static int dwc3_qcom_pm_suspend(struct device *dev) | |
| 551 | +static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev) | |
| 552 | 552 | { |
| 553 | 553 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 554 | 554 | int ret = 0; |
| @@ -560,7 +560,7 @@ static int dwc3_qcom_pm_suspend(struct device *dev) · 5 unmodified lines | ||
| 560 | 560 | return ret; |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | −static int dwc3_qcom_pm_resume(struct device *dev) | |
| 563 | +static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev) | |
| 564 | 564 | { |
| 565 | 565 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 566 | 566 | int ret; |
| @@ -571,23 +571,20 @@ static int dwc3_qcom_pm_resume(struct device *dev) · 4 unmodified lines | ||
| 571 | 571 | |
| 572 | 572 | return ret; |
| 573 | 573 | } |
| 574 | −#endif | |
| 575 | 574 | |
| 576 | −#ifdef CONFIG_PM | |
| 577 | −static int dwc3_qcom_runtime_suspend(struct device *dev) | |
| 575 | +static int __maybe_unused dwc3_qcom_runtime_suspend(struct device *dev) | |
| 578 | 576 | { |
| 579 | 577 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 580 | 578 | |
| 581 | 579 | return dwc3_qcom_suspend(qcom); |
| 582 | 580 | } |
| 583 | 581 | |
| 584 | −static int dwc3_qcom_runtime_resume(struct device *dev) | |
| 582 | +static int __maybe_unused dwc3_qcom_runtime_resume(struct device *dev) | |
| 585 | 583 | { |
| 586 | 584 | struct dwc3_qcom *qcom = dev_get_drvdata(dev); |
| 587 | 585 | |
| 588 | 586 | return dwc3_qcom_resume(qcom); |
| 589 | 587 | } |
| 590 | −#endif | |
| 591 | 588 | |
| 592 | 589 | static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = { |
| 593 | 590 | SET_SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume) |
| @@ -1719,6 +1719,8 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) · 1718 unmodified lines | ||
| 1719 | 1719 | */ |
| 1720 | 1720 | if (w_value && !f->get_alt) |
| 1721 | 1721 | break; |
| 1722 | + | |
| 1723 | + spin_lock(&cdev->lock); | |
| 1722 | 1724 | value = f->set_alt(f, w_index, w_value); |
| 1723 | 1725 | if (value == USB_GADGET_DELAYED_STATUS) { |
| 1724 | 1726 | DBG(cdev, |
| @@ -1728,6 +1730,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) · 3 unmodified lines | ||
| 1728 | 1730 | DBG(cdev, "delayed_status count %d\n", |
| 1729 | 1731 | cdev->delayed_status); |
| 1730 | 1732 | } |
| 1733 | + spin_unlock(&cdev->lock); | |
| 1731 | 1734 | break; |
| 1732 | 1735 | case USB_REQ_GET_INTERFACE: |
| 1733 | 1736 | if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE)) |
| @@ -215,6 +215,7 @@ struct ffs_io_data { · 214 unmodified lines | ||
| 215 | 215 | |
| 216 | 216 | struct mm_struct *mm; |
| 217 | 217 | struct work_struct work; |
| 218 | + struct work_struct cancellation_work; | |
| 218 | 219 | |
| 219 | 220 | struct usb_ep *ep; |
| 220 | 221 | struct usb_request *req; |
| @@ -1072,22 +1073,31 @@ ffs_epfile_open(struct inode *inode, struct file *file) · 851 unmodified lines | ||
| 1072 | 1073 | return 0; |
| 1073 | 1074 | } |
| 1074 | 1075 | |
| 1076 | +static void ffs_aio_cancel_worker(struct work_struct *work) | |
| 1077 | +{ | |
| 1078 | + struct ffs_io_data *io_data = container_of(work, struct ffs_io_data, | |
| 1079 | + cancellation_work); | |
| 1080 | + | |
| 1081 | + ENTER(); | |
| 1082 | + | |
| 1083 | + usb_ep_dequeue(io_data->ep, io_data->req); | |
| 1084 | +} | |
| 1085 | + | |
| 1075 | 1086 | static int ffs_aio_cancel(struct kiocb *kiocb) |
| 1076 | 1087 | { |
| 1077 | 1088 | struct ffs_io_data *io_data = kiocb->private; |
| 1078 | − struct ffs_epfile *epfile = kiocb->ki_filp->private_data; | |
| 1089 | + struct ffs_data *ffs = io_data->ffs; | |
| 1079 | 1090 | int value; |
| 1080 | 1091 | |
| 1081 | 1092 | ENTER(); |
| 1082 | 1093 | |
| 1083 | − spin_lock_irq(&epfile->ffs->eps_lock); | |
| 1084 | − | |
| 1085 | − if (likely(io_data && io_data->ep && io_data->req)) | |
| 1086 | − value = usb_ep_dequeue(io_data->ep, io_data->req); | |
| 1087 | − else | |
| 1094 | + if (likely(io_data && io_data->ep && io_data->req)) { | |
| 1095 | + INIT_WORK(&io_data->cancellation_work, ffs_aio_cancel_worker); | |
| 1096 | + queue_work(ffs->io_completion_wq, &io_data->cancellation_work); | |
| 1097 | + value = -EINPROGRESS; | |
| 1098 | + } else { | |
| 1088 | 1099 | value = -EINVAL; |
| 1089 | − | |
| 1090 | − spin_unlock_irq(&epfile->ffs->eps_lock); | |
| 1100 | + } | |
| 1091 | 1101 | |
| 1092 | 1102 | return value; |
| 1093 | 1103 | } |
| @@ -886,12 +886,12 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id) · 885 unmodified lines | ||
| 886 | 886 | |
| 887 | 887 | dev = xhci->devs[slot_id]; |
| 888 | 888 | |
| 889 | − trace_xhci_free_virt_device(dev); | |
| 890 | − | |
| 891 | 889 | xhci->dcbaa->dev_context_ptrs[slot_id] = 0; |
| 892 | 890 | if (!dev) |
| 893 | 891 | return; |
| 894 | 892 | |
| 893 | + trace_xhci_free_virt_device(dev); | |
| 894 | + | |
| 895 | 895 | if (dev->tt_info) |
| 896 | 896 | old_active_eps = dev->tt_info->active_eps; |
| 897 | 897 | |
| @@ -481,7 +481,7 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra, · 480 unmodified lines | ||
| 481 | 481 | unsigned long mask; |
| 482 | 482 | unsigned int port; |
| 483 | 483 | bool idle, enable; |
| 484 | − int err; | |
| 484 | + int err = 0; | |
| 485 | 485 | |
| 486 | 486 | memset(&rsp, 0, sizeof(rsp)); |
| 487 | 487 | |
| @@ -1223,10 +1223,10 @@ disable_rpm: · 735 unmodified lines | ||
| 1223 | 1223 | pm_runtime_disable(&pdev->dev); |
| 1224 | 1224 | usb_put_hcd(tegra->hcd); |
| 1225 | 1225 | disable_xusbc: |
| 1226 | − if (!&pdev->dev.pm_domain) | |
| 1226 | + if (!pdev->dev.pm_domain) | |
| 1227 | 1227 | tegra_powergate_power_off(TEGRA_POWERGATE_XUSBC); |
| 1228 | 1228 | disable_xusba: |
| 1229 | − if (!&pdev->dev.pm_domain) | |
| 1229 | + if (!pdev->dev.pm_domain) | |
| 1230 | 1230 | tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA); |
| 1231 | 1231 | put_padctl: |
| 1232 | 1232 | tegra_xusb_padctl_put(tegra->padctl); |
| @@ -171,6 +171,37 @@ DEFINE_EVENT(xhci_log_trb, xhci_dbc_gadget_ep_queue, · 170 unmodified lines | ||
| 171 | 171 | TP_ARGS(ring, trb) |
| 172 | 172 | ); |
| 173 | 173 | |
| 174 | +DECLARE_EVENT_CLASS(xhci_log_free_virt_dev, | |
| 175 | + TP_PROTO(struct xhci_virt_device *vdev), | |
| 176 | + TP_ARGS(vdev), | |
| 177 | + TP_STRUCT__entry( | |
| 178 | + __field(void *, vdev) | |
| 179 | + __field(unsigned long long, out_ctx) | |
| 180 | + __field(unsigned long long, in_ctx) | |
| 181 | + __field(u8, fake_port) | |
| 182 | + __field(u8, real_port) | |
| 183 | + __field(u16, current_mel) | |
| 184 | + | |
| 185 | + ), | |
| 186 | + TP_fast_assign( | |
| 187 | + __entry->vdev = vdev; | |
| 188 | + __entry->in_ctx = (unsigned long long) vdev->in_ctx->dma; | |
| 189 | + __entry->out_ctx = (unsigned long long) vdev->out_ctx->dma; | |
| 190 | + __entry->fake_port = (u8) vdev->fake_port; | |
| 191 | + __entry->real_port = (u8) vdev->real_port; | |
| 192 | + __entry->current_mel = (u16) vdev->current_mel; | |
| 193 | + ), | |
| 194 | + TP_printk("vdev %p ctx %llx | %llx fake_port %d real_port %d current_mel %d", | |
| 195 | + __entry->vdev, __entry->in_ctx, __entry->out_ctx, | |
| 196 | + __entry->fake_port, __entry->real_port, __entry->current_mel | |
| 197 | + ) | |
| 198 | +); | |
| 199 | + | |
| 200 | +DEFINE_EVENT(xhci_log_free_virt_dev, xhci_free_virt_device, | |
| 201 | + TP_PROTO(struct xhci_virt_device *vdev), | |
| 202 | + TP_ARGS(vdev) | |
| 203 | +); | |
| 204 | + | |
| 174 | 205 | DECLARE_EVENT_CLASS(xhci_log_virt_dev, |
| 175 | 206 | TP_PROTO(struct xhci_virt_device *vdev), |
| 176 | 207 | TP_ARGS(vdev), |
| @@ -208,11 +239,6 @@ DEFINE_EVENT(xhci_log_virt_dev, xhci_alloc_virt_device, · 31 unmodified lines | ||
| 208 | 239 | TP_ARGS(vdev) |
| 209 | 240 | ); |
| 210 | 241 | |
| 211 | −DEFINE_EVENT(xhci_log_virt_dev, xhci_free_virt_device, | |
| 212 | − TP_PROTO(struct xhci_virt_device *vdev), | |
| 213 | − TP_ARGS(vdev) | |
| 214 | −); | |
| 215 | − | |
| 216 | 242 | DEFINE_EVENT(xhci_log_virt_dev, xhci_setup_device, |
| 217 | 243 | TP_PROTO(struct xhci_virt_device *vdev), |
| 218 | 244 | TP_ARGS(vdev) |
| @@ -908,6 +908,41 @@ static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci) · 907 unmodified lines | ||
| 908 | 908 | spin_unlock_irqrestore(&xhci->lock, flags); |
| 909 | 909 | } |
| 910 | 910 | |
| 911 | +static bool xhci_pending_portevent(struct xhci_hcd *xhci) | |
| 912 | +{ | |
| 913 | + struct xhci_port **ports; | |
| 914 | + int port_index; | |
| 915 | + u32 status; | |
| 916 | + u32 portsc; | |
| 917 | + | |
| 918 | + status = readl(&xhci->op_regs->status); | |
| 919 | + if (status & STS_EINT) | |
| 920 | + return true; | |
| 921 | + /* | |
| 922 | + * Checking STS_EINT is not enough as there is a lag between a change | |
| 923 | + * bit being set and the Port Status Change Event that it generated | |
| 924 | + * being written to the Event Ring. See note in xhci 1.1 section 4.19.2. | |
| 925 | + */ | |
| 926 | + | |
| 927 | + port_index = xhci->usb2_rhub.num_ports; | |
| 928 | + ports = xhci->usb2_rhub.ports; | |
| 929 | + while (port_index--) { | |
| 930 | + portsc = readl(ports[port_index]->addr); | |
| 931 | + if (portsc & PORT_CHANGE_MASK || | |
| 932 | + (portsc & PORT_PLS_MASK) == XDEV_RESUME) | |
| 933 | + return true; | |
| 934 | + } | |
| 935 | + port_index = xhci->usb3_rhub.num_ports; | |
| 936 | + ports = xhci->usb3_rhub.ports; | |
| 937 | + while (port_index--) { | |
| 938 | + portsc = readl(ports[port_index]->addr); | |
| 939 | + if (portsc & PORT_CHANGE_MASK || | |
| 940 | + (portsc & PORT_PLS_MASK) == XDEV_RESUME) | |
| 941 | + return true; | |
| 942 | + } | |
| 943 | + return false; | |
| 944 | +} | |
| 945 | + | |
| 911 | 946 | /* |
| 912 | 947 | * Stop HC (not bus-specific) |
| 913 | 948 | * |
| @@ -1009,7 +1044,7 @@ EXPORT_SYMBOL_GPL(xhci_suspend); · 95 unmodified lines | ||
| 1009 | 1044 | */ |
| 1010 | 1045 | int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
| 1011 | 1046 | { |
| 1012 | − u32 command, temp = 0, status; | |
| 1047 | + u32 command, temp = 0; | |
| 1013 | 1048 | struct usb_hcd *hcd = xhci_to_hcd(xhci); |
| 1014 | 1049 | struct usb_hcd *secondary_hcd; |
| 1015 | 1050 | int retval = 0; |
| @@ -1043,8 +1078,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) · 27 unmodified lines | ||
| 1043 | 1078 | command = readl(&xhci->op_regs->command); |
| 1044 | 1079 | command |= CMD_CRS; |
| 1045 | 1080 | writel(command, &xhci->op_regs->command); |
| 1081 | + /* | |
| 1082 | + * Some controllers take up to 55+ ms to complete the controller | |
| 1083 | + * restore so setting the timeout to 100ms. Xhci specification | |
| 1084 | + * doesn't mention any timeout value. | |
| 1085 | + */ | |
| 1046 | 1086 | if (xhci_handshake(&xhci->op_regs->status, |
| 1047 | − STS_RESTORE, 0, 10 * 1000)) { | |
| 1087 | + STS_RESTORE, 0, 100 * 1000)) { | |
| 1048 | 1088 | xhci_warn(xhci, "WARN: xHC restore state timeout\n"); |
| 1049 | 1089 | spin_unlock_irq(&xhci->lock); |
| 1050 | 1090 | return -ETIMEDOUT; |
| @@ -1134,8 +1174,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) · 83 unmodified lines | ||
| 1134 | 1174 | done: |
| 1135 | 1175 | if (retval == 0) { |
| 1136 | 1176 | /* Resume root hubs only when have pending events. */ |
| 1137 | − status = readl(&xhci->op_regs->status); | |
| 1138 | − if (status & STS_EINT) { | |
| 1177 | + if (xhci_pending_portevent(xhci)) { | |
| 1139 | 1178 | usb_hcd_resume_root_hub(xhci->shared_hcd); |
| 1140 | 1179 | usb_hcd_resume_root_hub(hcd); |
| 1141 | 1180 | } |
| @@ -382,6 +382,10 @@ struct xhci_op_regs { · 381 unmodified lines | ||
| 382 | 382 | #define PORT_PLC (1 << 22) |
| 383 | 383 | /* port configure error change - port failed to configure its link partner */ |
| 384 | 384 | #define PORT_CEC (1 << 23) |
| 385 | +#define PORT_CHANGE_MASK (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \ | |
| 386 | + PORT_RC | PORT_PLC | PORT_CEC) | |
| 387 | + | |
| 388 | + | |
| 385 | 389 | /* Cold Attach Status - xHC can set this bit to report device attached during |
| 386 | 390 | * Sx state. Warm port reset should be perfomed to clear this bit and move port |
| 387 | 391 | * to connected state. |
| @@ -95,6 +95,9 @@ static const struct usb_device_id id_table[] = { · 94 unmodified lines | ||
| 95 | 95 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ |
| 96 | 96 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ |
| 97 | 97 | { USB_DEVICE(0x10C4, 0x815F) }, /* Timewave HamLinkUSB */ |
| 98 | + { USB_DEVICE(0x10C4, 0x817C) }, /* CESINEL MEDCAL N Power Quality Monitor */ | |
| 99 | + { USB_DEVICE(0x10C4, 0x817D) }, /* CESINEL MEDCAL NT Power Quality Monitor */ | |
| 100 | + { USB_DEVICE(0x10C4, 0x817E) }, /* CESINEL MEDCAL S Power Quality Monitor */ | |
| 98 | 101 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ |
| 99 | 102 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ |
| 100 | 103 | { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ |
| @@ -112,6 +115,9 @@ static const struct usb_device_id id_table[] = { · 11 unmodified lines | ||
| 112 | 115 | { USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demonstration module */ |
| 113 | 116 | { USB_DEVICE(0x10C4, 0x8281) }, /* Nanotec Plug & Drive */ |
| 114 | 117 | { USB_DEVICE(0x10C4, 0x8293) }, /* Telegesis ETRX2USB */ |
| 118 | + { USB_DEVICE(0x10C4, 0x82EF) }, /* CESINEL FALCO 6105 AC Power Supply */ | |
| 119 | + { USB_DEVICE(0x10C4, 0x82F1) }, /* CESINEL MEDCAL EFD Earth Fault Detector */ | |
| 120 | + { USB_DEVICE(0x10C4, 0x82F2) }, /* CESINEL MEDCAL ST Network Analyzer */ | |
| 115 | 121 | { USB_DEVICE(0x10C4, 0x82F4) }, /* Starizona MicroTouch */ |
| 116 | 122 | { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */ |
| 117 | 123 | { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ |
| @@ -124,7 +130,9 @@ static const struct usb_device_id id_table[] = { · 6 unmodified lines | ||
| 124 | 130 | { USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */ |
| 125 | 131 | { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ |
| 126 | 132 | { USB_DEVICE(0x10C4, 0x84B6) }, /* Starizona Hyperion */ |
| 133 | + { USB_DEVICE(0x10C4, 0x851E) }, /* CESINEL MEDCAL PT Network Analyzer */ | |
| 127 | 134 | { USB_DEVICE(0x10C4, 0x85A7) }, /* LifeScan OneTouch Verio IQ */ |
| 135 | + { USB_DEVICE(0x10C4, 0x85B8) }, /* CESINEL ReCon T Energy Logger */ | |
| 128 | 136 | { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */ |
| 129 | 137 | { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */ |
| 130 | 138 | { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ |
| @@ -134,17 +142,23 @@ static const struct usb_device_id id_table[] = { · 3 unmodified lines | ||
| 134 | 142 | { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ |
| 135 | 143 | { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ |
| 136 | 144 | { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ |
| 145 | + { USB_DEVICE(0x10C4, 0x88FB) }, /* CESINEL MEDCAL STII Network Analyzer */ | |
| 146 | + { USB_DEVICE(0x10C4, 0x8938) }, /* CESINEL MEDCAL S II Network Analyzer */ | |
| 137 | 147 | { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ |
| 138 | 148 | { USB_DEVICE(0x10C4, 0x8962) }, /* Brim Brothers charging dock */ |
| 139 | 149 | { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ |
| 140 | 150 | { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ |
| 151 | + { USB_DEVICE(0x10C4, 0x89A4) }, /* CESINEL FTBC Flexible Thyristor Bridge Controller */ | |
| 141 | 152 | { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ |
| 142 | 153 | { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ |
| 143 | 154 | { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ |
| 144 | 155 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ |
| 145 | 156 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ |
| 157 | + { USB_DEVICE(0x10C4, 0xEA63) }, /* Silicon Labs Windows Update (CP2101-4/CP2102N) */ | |
| 146 | 158 | { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ |
| 147 | 159 | { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */ |
| 160 | + { USB_DEVICE(0x10C4, 0xEA7A) }, /* Silicon Labs Windows Update (CP2105) */ | |
| 161 | + { USB_DEVICE(0x10C4, 0xEA7B) }, /* Silicon Labs Windows Update (CP2108) */ | |
| 148 | 162 | { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ |
| 149 | 163 | { USB_DEVICE(0x10C4, 0xF002) }, /* Elan Digital Systems USBwave12 */ |
| 150 | 164 | { USB_DEVICE(0x10C4, 0xF003) }, /* Elan Digital Systems USBpulse100 */ |
| @@ -418,17 +418,18 @@ static void _tcpm_log(struct tcpm_port *port, const char *fmt, va_list args) · 417 unmodified lines | ||
| 418 | 418 | u64 ts_nsec = local_clock(); |
| 419 | 419 | unsigned long rem_nsec; |
| 420 | 420 | |
| 421 | + mutex_lock(&port->logbuffer_lock); | |
| 421 | 422 | if (!port->logbuffer[port->logbuffer_head]) { |
| 422 | 423 | port->logbuffer[port->logbuffer_head] = |
| 423 | 424 | kzalloc(LOG_BUFFER_ENTRY_SIZE, GFP_KERNEL); |
| 424 | − if (!port->logbuffer[port->logbuffer_head]) | |
| 425 | + if (!port->logbuffer[port->logbuffer_head]) { | |
| 426 | + mutex_unlock(&port->logbuffer_lock); | |
| 425 | 427 | return; |
| 428 | + } | |
| 426 | 429 | } |
| 427 | 430 | |
| 428 | 431 | vsnprintf(tmpbuffer, sizeof(tmpbuffer), fmt, args); |
| 429 | 432 | |
| 430 | − mutex_lock(&port->logbuffer_lock); | |
| 431 | − | |
| 432 | 433 | if (tcpm_log_full(port)) { |
| 433 | 434 | port->logbuffer_head = max(port->logbuffer_head - 1, 0); |
| 434 | 435 | strcpy(tmpbuffer, "overflow"); |
| @@ -3043,7 +3044,8 @@ static void run_state_machine(struct tcpm_port *port) · 2608 unmodified lines | ||
| 3043 | 3044 | tcpm_port_is_sink(port) && |
| 3044 | 3045 | time_is_after_jiffies(port->delayed_runtime)) { |
| 3045 | 3046 | tcpm_set_state(port, SNK_DISCOVERY, |
| 3046 | − port->delayed_runtime - jiffies); | |
| 3047 | + jiffies_to_msecs(port->delayed_runtime - | |
| 3048 | + jiffies)); | |
| 3047 | 3049 | break; |
| 3048 | 3050 | } |
| 3049 | 3051 | tcpm_set_state(port, unattached_state(port), 0); |
| @@ -350,6 +350,19 @@ static void ucsi_connector_change(struct work_struct *work) · 349 unmodified lines | ||
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | if (con->status.change & UCSI_CONSTAT_CONNECT_CHANGE) { |
| 353 | + typec_set_pwr_role(con->port, con->status.pwr_dir); | |
| 354 | + | |
| 355 | + switch (con->status.partner_type) { | |
| 356 | + case UCSI_CONSTAT_PARTNER_TYPE_UFP: | |
| 357 | + typec_set_data_role(con->port, TYPEC_HOST); | |
| 358 | + break; | |
| 359 | + case UCSI_CONSTAT_PARTNER_TYPE_DFP: | |
| 360 | + typec_set_data_role(con->port, TYPEC_DEVICE); | |
| 361 | + break; | |
| 362 | + default: | |
| 363 | + break; | |
| 364 | + } | |
| 365 | + | |
| 353 | 366 | if (con->status.connected) |
| 354 | 367 | ucsi_register_partner(con); |
| 355 | 368 | else |
| @@ -79,6 +79,11 @@ static int ucsi_acpi_probe(struct platform_device *pdev) · 78 unmodified lines | ||
| 79 | 79 | return -ENODEV; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | + /* This will make sure we can use ioremap_nocache() */ | |
| 83 | + status = acpi_release_memory(ACPI_HANDLE(&pdev->dev), res, 1); | |
| 84 | + if (ACPI_FAILURE(status)) | |
| 85 | + return -ENOMEM; | |
| 86 | + | |
| 82 | 87 | /* |
| 83 | 88 | * NOTE: The memory region for the data structures is used also in an |
| 84 | 89 | * operation region, which means ACPI has already reserved it. Therefore |
| @@ -1226,7 +1226,8 @@ err_used: · 1225 unmodified lines | ||
| 1226 | 1226 | if (ubufs) |
| 1227 | 1227 | vhost_net_ubuf_put_wait_and_free(ubufs); |
| 1228 | 1228 | err_ubufs: |
| 1229 | − sockfd_put(sock); | |
| 1229 | + if (sock) | |
| 1230 | + sockfd_put(sock); | |
| 1230 | 1231 | err_vq: |
| 1231 | 1232 | mutex_unlock(&vq->mutex); |
| 1232 | 1233 | err: |
| @@ -41,4 +41,4 @@ obj-$(CONFIG_XEN_PVCALLS_FRONTEND) += pvcalls-front.o · 40 unmodified lines | ||
| 41 | 41 | xen-evtchn-y := evtchn.o |
| 42 | 42 | xen-gntdev-y := gntdev.o |
| 43 | 43 | xen-gntalloc-y := gntalloc.o |
| 44 | −xen-privcmd-y := privcmd.o | |
| 44 | +xen-privcmd-y := privcmd.o privcmd-buf.o | |
| @@ -628,8 +628,6 @@ static void __unbind_from_irq(unsigned int irq) · 627 unmodified lines | ||
| 628 | 628 | xen_irq_info_cleanup(info); |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | − BUG_ON(info_for_irq(irq)->type == IRQT_UNBOUND); | |
| 632 | − | |
| 633 | 631 | xen_free_irq(irq); |
| 634 | 632 | } |
| 635 | 633 | |
| @@ -799,7 +799,7 @@ int gnttab_alloc_pages(int nr_pages, struct page **pages) · 798 unmodified lines | ||
| 799 | 799 | |
| 800 | 800 | return 0; |
| 801 | 801 | } |
| 802 | −EXPORT_SYMBOL(gnttab_alloc_pages); | |
| 802 | +EXPORT_SYMBOL_GPL(gnttab_alloc_pages); | |
| 803 | 803 | |
| 804 | 804 | /** |
| 805 | 805 | * gnttab_free_pages - free pages allocated by gnttab_alloc_pages() |
| @@ -820,7 +820,7 @@ void gnttab_free_pages(int nr_pages, struct page **pages) · 14 unmodified lines | ||
| 820 | 820 | } |
| 821 | 821 | free_xenballooned_pages(nr_pages, pages); |
| 822 | 822 | } |
| 823 | −EXPORT_SYMBOL(gnttab_free_pages); | |
| 823 | +EXPORT_SYMBOL_GPL(gnttab_free_pages); | |
| 824 | 824 | |
| 825 | 825 | /* Handling of paged out grant targets (GNTST_eagain) */ |
| 826 | 826 | #define MAX_DELAY 256 |
| @@ -289,8 +289,15 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path, · 288 unmodified lines | ||
| 289 | 289 | return; |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | − if (sysrq_key != '\0') | |
| 293 | − xenbus_printf(xbt, "control", "sysrq", "%c", '\0'); | |
| 292 | + if (sysrq_key != '\0') { | |
| 293 | + err = xenbus_printf(xbt, "control", "sysrq", "%c", '\0'); | |
| 294 | + if (err) { | |
| 295 | + pr_err("%s: Error %d writing sysrq in control/sysrq\n", | |
| 296 | + __func__, err); | |
| 297 | + xenbus_transaction_end(xbt, 1); | |
| 298 | + return; | |
| 299 | + } | |
| 300 | + } | |
| 294 | 301 | |
| 295 | 302 | err = xenbus_transaction_end(xbt, 0); |
| 296 | 303 | if (err == -EAGAIN) |
| @@ -342,7 +349,12 @@ static int setup_shutdown_watcher(void) · 45 unmodified lines | ||
| 342 | 349 | continue; |
| 343 | 350 | snprintf(node, FEATURE_PATH_SIZE, "feature-%s", |
| 344 | 351 | shutdown_handlers[idx].command); |
| 345 | − xenbus_printf(XBT_NIL, "control", node, "%u", 1); | |
| 352 | + err = xenbus_printf(XBT_NIL, "control", node, "%u", 1); | |
| 353 | + if (err) { | |
| 354 | + pr_err("%s: Error %d writing %s\n", __func__, | |
| 355 | + err, node); | |
| 356 | + return err; | |
| 357 | + } | |
| 346 | 358 | } |
| 347 | 359 | |
| 348 | 360 | return 0; |
| @@ -0,0 +1,210 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 OR MIT | |
| 2 | + | |
| 3 | +/****************************************************************************** | |
| 4 | + * privcmd-buf.c | |
| 5 | + * | |
| 6 | + * Mmap of hypercall buffers. | |
| 7 | + * | |
| 8 | + * Copyright (c) 2018 Juergen Gross | |
| 9 | + */ | |
| 10 | + | |
| 11 | +#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt | |
| 12 | + | |
| 13 | +#include <linux/kernel.h> | |
| 14 | +#include <linux/module.h> | |
| 15 | +#include <linux/list.h> | |
| 16 | +#include <linux/miscdevice.h> | |
| 17 | +#include <linux/mm.h> | |
| 18 | +#include <linux/slab.h> | |
| 19 | + | |
| 20 | +#include "privcmd.h" | |
| 21 | + | |
| 22 | +MODULE_LICENSE("GPL"); | |
| 23 | + | |
| 24 | +static unsigned int limit = 64; | |
| 25 | +module_param(limit, uint, 0644); | |
| 26 | +MODULE_PARM_DESC(limit, "Maximum number of pages that may be allocated by " | |
| 27 | + "the privcmd-buf device per open file"); | |
| 28 | + | |
| 29 | +struct privcmd_buf_private { | |
| 30 | + struct mutex lock; | |
| 31 | + struct list_head list; | |
| 32 | + unsigned int allocated; | |
| 33 | +}; | |
| 34 | + | |
| 35 | +struct privcmd_buf_vma_private { | |
| 36 | + struct privcmd_buf_private *file_priv; | |
| 37 | + struct list_head list; | |
| 38 | + unsigned int users; | |
| 39 | + unsigned int n_pages; | |
| 40 | + struct page *pages[]; | |
| 41 | +}; | |
| 42 | + | |
| 43 | +static int privcmd_buf_open(struct inode *ino, struct file *file) | |
| 44 | +{ | |
| 45 | + struct privcmd_buf_private *file_priv; | |
| 46 | + | |
| 47 | + file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); | |
| 48 | + if (!file_priv) | |
| 49 | + return -ENOMEM; | |
| 50 | + | |
| 51 | + mutex_init(&file_priv->lock); | |
| 52 | + INIT_LIST_HEAD(&file_priv->list); | |
| 53 | + | |
| 54 | + file->private_data = file_priv; | |
| 55 | + | |
| 56 | + return 0; | |
| 57 | +} | |
| 58 | + | |
| 59 | +static void privcmd_buf_vmapriv_free(struct privcmd_buf_vma_private *vma_priv) | |
| 60 | +{ | |
| 61 | + unsigned int i; | |
| 62 | + | |
| 63 | + vma_priv->file_priv->allocated -= vma_priv->n_pages; | |
| 64 | + | |
| 65 | + list_del(&vma_priv->list); | |
| 66 | + | |
| 67 | + for (i = 0; i < vma_priv->n_pages; i++) | |
| 68 | + if (vma_priv->pages[i]) | |
| 69 | + __free_page(vma_priv->pages[i]); | |
| 70 | + | |
| 71 | + kfree(vma_priv); | |
| 72 | +} | |
| 73 | + | |
| 74 | +static int privcmd_buf_release(struct inode *ino, struct file *file) | |
| 75 | +{ | |
| 76 | + struct privcmd_buf_private *file_priv = file->private_data; | |
| 77 | + struct privcmd_buf_vma_private *vma_priv; | |
| 78 | + | |
| 79 | + mutex_lock(&file_priv->lock); | |
| 80 | + | |
| 81 | + while (!list_empty(&file_priv->list)) { | |
| 82 | + vma_priv = list_first_entry(&file_priv->list, | |
| 83 | + struct privcmd_buf_vma_private, | |
| 84 | + list); | |
| 85 | + privcmd_buf_vmapriv_free(vma_priv); | |
| 86 | + } | |
| 87 | + | |
| 88 | + mutex_unlock(&file_priv->lock); | |
| 89 | + | |
| 90 | + kfree(file_priv); | |
| 91 | + | |
| 92 | + return 0; | |
| 93 | +} | |
| 94 | + | |
| 95 | +static void privcmd_buf_vma_open(struct vm_area_struct *vma) | |
| 96 | +{ | |
| 97 | + struct privcmd_buf_vma_private *vma_priv = vma->vm_private_data; | |
| 98 | + | |
| 99 | + if (!vma_priv) | |
| 100 | + return; | |
| 101 | + | |
| 102 | + mutex_lock(&vma_priv->file_priv->lock); | |
| 103 | + vma_priv->users++; | |
| 104 | + mutex_unlock(&vma_priv->file_priv->lock); | |
| 105 | +} | |
| 106 | + | |
| 107 | +static void privcmd_buf_vma_close(struct vm_area_struct *vma) | |
| 108 | +{ | |
| 109 | + struct privcmd_buf_vma_private *vma_priv = vma->vm_private_data; | |
| 110 | + struct privcmd_buf_private *file_priv; | |
| 111 | + | |
| 112 | + if (!vma_priv) | |
| 113 | + return; | |
| 114 | + | |
| 115 | + file_priv = vma_priv->file_priv; | |
| 116 | + | |
| 117 | + mutex_lock(&file_priv->lock); | |
| 118 | + | |
| 119 | + vma_priv->users--; | |
| 120 | + if (!vma_priv->users) | |
| 121 | + privcmd_buf_vmapriv_free(vma_priv); | |
| 122 | + | |
| 123 | + mutex_unlock(&file_priv->lock); | |
| 124 | +} | |
| 125 | + | |
| 126 | +static vm_fault_t privcmd_buf_vma_fault(struct vm_fault *vmf) | |
| 127 | +{ | |
| 128 | + pr_debug("fault: vma=%p %lx-%lx, pgoff=%lx, uv=%p\n", | |
| 129 | + vmf->vma, vmf->vma->vm_start, vmf->vma->vm_end, | |
| 130 | + vmf->pgoff, (void *)vmf->address); | |
| 131 | + | |
| 132 | + return VM_FAULT_SIGBUS; | |
| 133 | +} | |
| 134 | + | |
| 135 | +static const struct vm_operations_struct privcmd_buf_vm_ops = { | |
| 136 | + .open = privcmd_buf_vma_open, | |
| 137 | + .close = privcmd_buf_vma_close, | |
| 138 | + .fault = privcmd_buf_vma_fault, | |
| 139 | +}; | |
| 140 | + | |
| 141 | +static int privcmd_buf_mmap(struct file *file, struct vm_area_struct *vma) | |
| 142 | +{ | |
| 143 | + struct privcmd_buf_private *file_priv = file->private_data; | |
| 144 | + struct privcmd_buf_vma_private *vma_priv; | |
| 145 | + unsigned long count = vma_pages(vma); | |
| 146 | + unsigned int i; | |
| 147 | + int ret = 0; | |
| 148 | + | |
| 149 | + if (!(vma->vm_flags & VM_SHARED) || count > limit || | |
| 150 | + file_priv->allocated + count > limit) | |
| 151 | + return -EINVAL; | |
| 152 | + | |
| 153 | + vma_priv = kzalloc(sizeof(*vma_priv) + count * sizeof(void *), | |
| 154 | + GFP_KERNEL); | |
| 155 | + if (!vma_priv) | |
| 156 | + return -ENOMEM; | |
| 157 | + | |
| 158 | + vma_priv->n_pages = count; | |
| 159 | + count = 0; | |
| 160 | + for (i = 0; i < vma_priv->n_pages; i++) { | |
| 161 | + vma_priv->pages[i] = alloc_page(GFP_KERNEL | __GFP_ZERO); | |
| 162 | + if (!vma_priv->pages[i]) | |
| 163 | + break; | |
| 164 | + count++; | |
| 165 | + } | |
| 166 | + | |
| 167 | + mutex_lock(&file_priv->lock); | |
| 168 | + | |
| 169 | + file_priv->allocated += count; | |
| 170 | + | |
| 171 | + vma_priv->file_priv = file_priv; | |
| 172 | + vma_priv->users = 1; | |
| 173 | + | |
| 174 | + vma->vm_flags |= VM_IO | VM_DONTEXPAND; | |
| 175 | + vma->vm_ops = &privcmd_buf_vm_ops; | |
| 176 | + vma->vm_private_data = vma_priv; | |
| 177 | + | |
| 178 | + list_add(&vma_priv->list, &file_priv->list); | |
| 179 | + | |
| 180 | + if (vma_priv->n_pages != count) | |
| 181 | + ret = -ENOMEM; | |
| 182 | + else | |
| 183 | + for (i = 0; i < vma_priv->n_pages; i++) { | |
| 184 | + ret = vm_insert_page(vma, vma->vm_start + i * PAGE_SIZE, | |
| 185 | + vma_priv->pages[i]); | |
| 186 | + if (ret) | |
| 187 | + break; | |
| 188 | + } | |
| 189 | + | |
| 190 | + if (ret) | |
| 191 | + privcmd_buf_vmapriv_free(vma_priv); | |
| 192 | + | |
| 193 | + mutex_unlock(&file_priv->lock); | |
| 194 | + | |
| 195 | + return ret; | |
| 196 | +} | |
| 197 | + | |
| 198 | +const struct file_operations xen_privcmdbuf_fops = { | |
| 199 | + .owner = THIS_MODULE, | |
| 200 | + .open = privcmd_buf_open, | |
| 201 | + .release = privcmd_buf_release, | |
| 202 | + .mmap = privcmd_buf_mmap, | |
| 203 | +}; | |
| 204 | +EXPORT_SYMBOL_GPL(xen_privcmdbuf_fops); | |
| 205 | + | |
| 206 | +struct miscdevice xen_privcmdbuf_dev = { | |
| 207 | + .minor = MISC_DYNAMIC_MINOR, | |
| 208 | + .name = "xen/hypercall", | |
| 209 | + .fops = &xen_privcmdbuf_fops, | |
| 210 | +}; | |
| @@ -1007,12 +1007,21 @@ static int __init privcmd_init(void) · 1006 unmodified lines | ||
| 1007 | 1007 | pr_err("Could not register Xen privcmd device\n"); |
| 1008 | 1008 | return err; |
| 1009 | 1009 | } |
| 1010 | + | |
| 1011 | + err = misc_register(&xen_privcmdbuf_dev); | |
| 1012 | + if (err != 0) { | |
| 1013 | + pr_err("Could not register Xen hypercall-buf device\n"); | |
| 1014 | + misc_deregister(&privcmd_dev); | |
| 1015 | + return err; | |
| 1016 | + } | |
| 1017 | + | |
| 1010 | 1018 | return 0; |
| 1011 | 1019 | } |
| 1012 | 1020 | |
| 1013 | 1021 | static void __exit privcmd_exit(void) |
| 1014 | 1022 | { |
| 1015 | 1023 | misc_deregister(&privcmd_dev); |
| 1024 | + misc_deregister(&xen_privcmdbuf_dev); | |
| 1016 | 1025 | } |
| 1017 | 1026 | |
| 1018 | 1027 | module_init(privcmd_init); |
| @@ -1,3 +1,6 @@ | ||
| 1 | 1 | #include <linux/fs.h> |
| 2 | 2 | |
| 3 | 3 | extern const struct file_operations xen_privcmd_fops; |
| 4 | +extern const struct file_operations xen_privcmdbuf_fops; | |
| 5 | + | |
| 6 | +extern struct miscdevice xen_privcmdbuf_dev; | |
| @@ -1012,6 +1012,7 @@ static void scsiback_do_add_lun(struct vscsibk_info *info, const char *state, · 1011 unmodified lines | ||
| 1012 | 1012 | { |
| 1013 | 1013 | struct v2p_entry *entry; |
| 1014 | 1014 | unsigned long flags; |
| 1015 | + int err; | |
| 1015 | 1016 | |
| 1016 | 1017 | if (try) { |
| 1017 | 1018 | spin_lock_irqsave(&info->v2p_lock, flags); |
| @@ -1027,8 +1028,11 @@ static void scsiback_do_add_lun(struct vscsibk_info *info, const char *state, · 9 unmodified lines | ||
| 1027 | 1028 | scsiback_del_translation_entry(info, vir); |
| 1028 | 1029 | } |
| 1029 | 1030 | } else if (!try) { |
| 1030 | − xenbus_printf(XBT_NIL, info->dev->nodename, state, | |
| 1031 | + err = xenbus_printf(XBT_NIL, info->dev->nodename, state, | |
| 1031 | 1032 | "%d", XenbusStateClosed); |
| 1033 | + if (err) | |
| 1034 | + xenbus_dev_error(info->dev, err, | |
| 1035 | + "%s: writing %s", __func__, state); | |
| 1032 | 1036 | } |
| 1033 | 1037 | } |
| 1034 | 1038 | |
| @@ -1067,8 +1071,11 @@ static void scsiback_do_1lun_hotplug(struct vscsibk_info *info, int op, · 32 unmodified lines | ||
| 1067 | 1071 | snprintf(str, sizeof(str), "vscsi-devs/%s/p-dev", ent); |
| 1068 | 1072 | val = xenbus_read(XBT_NIL, dev->nodename, str, NULL); |
| 1069 | 1073 | if (IS_ERR(val)) { |
| 1070 | − xenbus_printf(XBT_NIL, dev->nodename, state, | |
| 1074 | + err = xenbus_printf(XBT_NIL, dev->nodename, state, | |
| 1071 | 1075 | "%d", XenbusStateClosed); |
| 1076 | + if (err) | |
| 1077 | + xenbus_dev_error(info->dev, err, | |
| 1078 | + "%s: writing %s", __func__, state); | |
| 1072 | 1079 | return; |
| 1073 | 1080 | } |
| 1074 | 1081 | strlcpy(phy, val, VSCSI_NAMELEN); |
| @@ -1079,8 +1086,11 @@ static void scsiback_do_1lun_hotplug(struct vscsibk_info *info, int op, · 4 unmodified lines | ||
| 1079 | 1086 | err = xenbus_scanf(XBT_NIL, dev->nodename, str, "%u:%u:%u:%u", |
| 1080 | 1087 | &vir.hst, &vir.chn, &vir.tgt, &vir.lun); |
| 1081 | 1088 | if (XENBUS_EXIST_ERR(err)) { |
| 1082 | − xenbus_printf(XBT_NIL, dev->nodename, state, | |
| 1089 | + err = xenbus_printf(XBT_NIL, dev->nodename, state, | |
| 1083 | 1090 | "%d", XenbusStateClosed); |
| 1091 | + if (err) | |
| 1092 | + xenbus_dev_error(info->dev, err, | |
| 1093 | + "%s: writing %s", __func__, state); | |
| 1084 | 1094 | return; |
| 1085 | 1095 | } |
| 1086 | 1096 | |
| @@ -5,7 +5,6 @@ · 4 unmodified lines | ||
| 5 | 5 | * Implements an efficient asynchronous io interface. |
| 6 | 6 | * |
| 7 | 7 | * Copyright 2000, 2001, 2002 Red Hat, Inc. All Rights Reserved. |
| 8 | − * Copyright 2018 Christoph Hellwig. | |
| 9 | 8 | * |
| 10 | 9 | * See ../COPYING for licensing terms. |
| 11 | 10 | */ |
| @@ -165,22 +164,10 @@ struct fsync_iocb { · 153 unmodified lines | ||
| 165 | 164 | bool datasync; |
| 166 | 165 | }; |
| 167 | 166 | |
| 168 | −struct poll_iocb { | |
| 169 | − struct file *file; | |
| 170 | − __poll_t events; | |
| 171 | − struct wait_queue_head *head; | |
| 172 | − | |
| 173 | − union { | |
| 174 | − struct wait_queue_entry wait; | |
| 175 | − struct work_struct work; | |
| 176 | − }; | |
| 177 | −}; | |
| 178 | − | |
| 179 | 167 | struct aio_kiocb { |
| 180 | 168 | union { |
| 181 | 169 | struct kiocb rw; |
| 182 | 170 | struct fsync_iocb fsync; |
| 183 | − struct poll_iocb poll; | |
| 184 | 171 | }; |
| 185 | 172 | |
| 186 | 173 | struct kioctx *ki_ctx; |
| @@ -1590,6 +1577,7 @@ static int aio_fsync(struct fsync_iocb *req, struct iocb *iocb, bool datasync) · 1403 unmodified lines | ||
| 1590 | 1577 | if (unlikely(iocb->aio_buf || iocb->aio_offset || iocb->aio_nbytes || |
| 1591 | 1578 | iocb->aio_rw_flags)) |
| 1592 | 1579 | return -EINVAL; |
| 1580 | + | |
| 1593 | 1581 | req->file = fget(iocb->aio_fildes); |
| 1594 | 1582 | if (unlikely(!req->file)) |
| 1595 | 1583 | return -EBADF; |
| @@ -1604,137 +1592,6 @@ static int aio_fsync(struct fsync_iocb *req, struct iocb *iocb, bool datasync) · 8 unmodified lines | ||
| 1604 | 1592 | return 0; |
| 1605 | 1593 | } |
| 1606 | 1594 | |
| 1607 | −/* need to use list_del_init so we can check if item was present */ | |
| 1608 | −static inline bool __aio_poll_remove(struct poll_iocb *req) | |
| 1609 | −{ | |
| 1610 | − if (list_empty(&req->wait.entry)) | |
| 1611 | − return false; | |
| 1612 | − list_del_init(&req->wait.entry); | |
| 1613 | − return true; | |
| 1614 | −} | |
| 1615 | − | |
| 1616 | −static inline void __aio_poll_complete(struct aio_kiocb *iocb, __poll_t mask) | |
| 1617 | −{ | |
| 1618 | − fput(iocb->poll.file); | |
| 1619 | − aio_complete(iocb, mangle_poll(mask), 0); | |
| 1620 | −} | |
| 1621 | − | |
| 1622 | −static void aio_poll_work(struct work_struct *work) | |
| 1623 | −{ | |
| 1624 | − struct aio_kiocb *iocb = container_of(work, struct aio_kiocb, poll.work); | |
| 1625 | − | |
| 1626 | − if (!list_empty_careful(&iocb->ki_list)) | |
| 1627 | − aio_remove_iocb(iocb); | |
| 1628 | − __aio_poll_complete(iocb, iocb->poll.events); | |
| 1629 | −} | |
| 1630 | − | |
| 1631 | −static int aio_poll_cancel(struct kiocb *iocb) | |
| 1632 | −{ | |
| 1633 | − struct aio_kiocb *aiocb = container_of(iocb, struct aio_kiocb, rw); | |
| 1634 | − struct poll_iocb *req = &aiocb->poll; | |
| 1635 | − struct wait_queue_head *head = req->head; | |
| 1636 | − bool found = false; | |
| 1637 | − | |
| 1638 | − spin_lock(&head->lock); | |
| 1639 | − found = __aio_poll_remove(req); | |
| 1640 | − spin_unlock(&head->lock); | |
| 1641 | − | |
| 1642 | − if (found) { | |
| 1643 | − req->events = 0; | |
| 1644 | − INIT_WORK(&req->work, aio_poll_work); | |
| 1645 | − schedule_work(&req->work); | |
| 1646 | − } | |
| 1647 | − return 0; | |
| 1648 | −} | |
| 1649 | − | |
| 1650 | −static int aio_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync, | |
| 1651 | − void *key) | |
| 1652 | −{ | |
| 1653 | − struct poll_iocb *req = container_of(wait, struct poll_iocb, wait); | |
| 1654 | − struct aio_kiocb *iocb = container_of(req, struct aio_kiocb, poll); | |
| 1655 | − struct file *file = req->file; | |
| 1656 | − __poll_t mask = key_to_poll(key); | |
| 1657 | − | |
| 1658 | − assert_spin_locked(&req->head->lock); | |
| 1659 | − | |
| 1660 | − /* for instances that support it check for an event match first: */ | |
| 1661 | − if (mask && !(mask & req->events)) | |
| 1662 | − return 0; | |
| 1663 | − | |
| 1664 | − mask = file->f_op->poll_mask(file, req->events) & req->events; | |
| 1665 | − if (!mask) | |
| 1666 | − return 0; | |
| 1667 | − | |
| 1668 | − __aio_poll_remove(req); | |
| 1669 | − | |
| 1670 | − /* | |
| 1671 | − * Try completing without a context switch if we can acquire ctx_lock | |
| 1672 | − * without spinning. Otherwise we need to defer to a workqueue to | |
| 1673 | − * avoid a deadlock due to the lock order. | |
| 1674 | − */ | |
| 1675 | − if (spin_trylock(&iocb->ki_ctx->ctx_lock)) { | |
| 1676 | − list_del_init(&iocb->ki_list); | |
| 1677 | − spin_unlock(&iocb->ki_ctx->ctx_lock); | |
| 1678 | − | |
| 1679 | − __aio_poll_complete(iocb, mask); | |
| 1680 | − } else { | |
| 1681 | − req->events = mask; | |
| 1682 | − INIT_WORK(&req->work, aio_poll_work); | |
| 1683 | − schedule_work(&req->work); | |
| 1684 | − } | |
| 1685 | − | |
| 1686 | − return 1; | |
| 1687 | −} | |
| 1688 | − | |
| 1689 | −static ssize_t aio_poll(struct aio_kiocb *aiocb, struct iocb *iocb) | |
| 1690 | −{ | |
| 1691 | − struct kioctx *ctx = aiocb->ki_ctx; | |
| 1692 | − struct poll_iocb *req = &aiocb->poll; | |
| 1693 | − __poll_t mask; | |
| 1694 | − | |
| 1695 | − /* reject any unknown events outside the normal event mask. */ | |
| 1696 | − if ((u16)iocb->aio_buf != iocb->aio_buf) | |
| 1697 | − return -EINVAL; | |
| 1698 | − /* reject fields that are not defined for poll */ | |
| 1699 | − if (iocb->aio_offset || iocb->aio_nbytes || iocb->aio_rw_flags) | |
| 1700 | − return -EINVAL; | |
| 1701 | − | |
| 1702 | − req->events = demangle_poll(iocb->aio_buf) | EPOLLERR | EPOLLHUP; | |
| 1703 | − req->file = fget(iocb->aio_fildes); | |
| 1704 | − if (unlikely(!req->file)) | |
| 1705 | − return -EBADF; | |
| 1706 | − if (!file_has_poll_mask(req->file)) | |
| 1707 | − goto out_fail; | |
| 1708 | − | |
| 1709 | − req->head = req->file->f_op->get_poll_head(req->file, req->events); | |
| 1710 | − if (!req->head) | |
| 1711 | − goto out_fail; | |
| 1712 | − if (IS_ERR(req->head)) { | |
| 1713 | − mask = EPOLLERR; | |
| 1714 | − goto done; | |
| 1715 | − } | |
| 1716 | − | |
| 1717 | − init_waitqueue_func_entry(&req->wait, aio_poll_wake); | |
| 1718 | − aiocb->ki_cancel = aio_poll_cancel; | |
| 1719 | − | |
| 1720 | − spin_lock_irq(&ctx->ctx_lock); | |
| 1721 | − spin_lock(&req->head->lock); | |
| 1722 | − mask = req->file->f_op->poll_mask(req->file, req->events) & req->events; | |
| 1723 | − if (!mask) { | |
| 1724 | − __add_wait_queue(req->head, &req->wait); | |
| 1725 | − list_add_tail(&aiocb->ki_list, &ctx->active_reqs); | |
| 1726 | − } | |
| 1727 | − spin_unlock(&req->head->lock); | |
| 1728 | − spin_unlock_irq(&ctx->ctx_lock); | |
| 1729 | −done: | |
| 1730 | − if (mask) | |
| 1731 | − __aio_poll_complete(aiocb, mask); | |
| 1732 | − return 0; | |
| 1733 | −out_fail: | |
| 1734 | − fput(req->file); | |
| 1735 | − return -EINVAL; /* same as no support for IOCB_CMD_POLL */ | |
| 1736 | −} | |
| 1737 | − | |
| 1738 | 1595 | static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, |
| 1739 | 1596 | bool compat) |
| 1740 | 1597 | { |
| @@ -1808,9 +1665,6 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, · 67 unmodified lines | ||
| 1808 | 1665 | case IOCB_CMD_FDSYNC: |
| 1809 | 1666 | ret = aio_fsync(&req->fsync, &iocb, true); |
| 1810 | 1667 | break; |
| 1811 | − case IOCB_CMD_POLL: | |
| 1812 | − ret = aio_poll(req, &iocb); | |
| 1813 | − break; | |
| 1814 | 1668 | default: |
| 1815 | 1669 | pr_debug("invalid aio operation %d\n", iocb.aio_lio_opcode); |
| 1816 | 1670 | ret = -EINVAL; |
| @@ -4542,8 +4542,11 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, · 4541 unmodified lines | ||
| 4542 | 4542 | offset_in_extent = em_start - em->start; |
| 4543 | 4543 | em_end = extent_map_end(em); |
| 4544 | 4544 | em_len = em_end - em_start; |
| 4545 | − disko = em->block_start + offset_in_extent; | |
| 4546 | 4545 | flags = 0; |
| 4546 | + if (em->block_start < EXTENT_MAP_LAST_BYTE) | |
| 4547 | + disko = em->block_start + offset_in_extent; | |
| 4548 | + else | |
| 4549 | + disko = 0; | |
| 4547 | 4550 | |
| 4548 | 4551 | /* |
| 4549 | 4552 | * bump off for our next call to get_extent |
| @@ -9005,13 +9005,14 @@ again: · 9004 unmodified lines | ||
| 9005 | 9005 | |
| 9006 | 9006 | unlock_extent_cached(io_tree, page_start, page_end, &cached_state); |
| 9007 | 9007 | |
| 9008 | −out_unlock: | |
| 9009 | 9008 | if (!ret2) { |
| 9010 | 9009 | btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, true); |
| 9011 | 9010 | sb_end_pagefault(inode->i_sb); |
| 9012 | 9011 | extent_changeset_free(data_reserved); |
| 9013 | 9012 | return VM_FAULT_LOCKED; |
| 9014 | 9013 | } |
| 9014 | + | |
| 9015 | +out_unlock: | |
| 9015 | 9016 | unlock_page(page); |
| 9016 | 9017 | out: |
| 9017 | 9018 | btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, (ret != 0)); |
| @@ -9443,6 +9444,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 425 unmodified lines | ||
| 9443 | 9444 | u64 new_idx = 0; |
| 9444 | 9445 | u64 root_objectid; |
| 9445 | 9446 | int ret; |
| 9447 | + int ret2; | |
| 9446 | 9448 | bool root_log_pinned = false; |
| 9447 | 9449 | bool dest_log_pinned = false; |
| 9448 | 9450 | |
| @@ -9639,7 +9641,8 @@ out_fail: · 190 unmodified lines | ||
| 9639 | 9641 | dest_log_pinned = false; |
| 9640 | 9642 | } |
| 9641 | 9643 | } |
| 9642 | − ret = btrfs_end_transaction(trans); | |
| 9644 | + ret2 = btrfs_end_transaction(trans); | |
| 9645 | + ret = ret ? ret : ret2; | |
| 9643 | 9646 | out_notrans: |
| 9644 | 9647 | if (new_ino == BTRFS_FIRST_FREE_OBJECTID) |
| 9645 | 9648 | up_read(&fs_info->subvol_sem); |
| @@ -3577,7 +3577,7 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, · 3576 unmodified lines | ||
| 3577 | 3577 | ret = btrfs_extent_same_range(src, loff, BTRFS_MAX_DEDUPE_LEN, |
| 3578 | 3578 | dst, dst_loff, &cmp); |
| 3579 | 3579 | if (ret) |
| 3580 | − goto out_unlock; | |
| 3580 | + goto out_free; | |
| 3581 | 3581 | |
| 3582 | 3582 | loff += BTRFS_MAX_DEDUPE_LEN; |
| 3583 | 3583 | dst_loff += BTRFS_MAX_DEDUPE_LEN; |
| @@ -3587,16 +3587,16 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, · 3 unmodified lines | ||
| 3587 | 3587 | ret = btrfs_extent_same_range(src, loff, tail_len, dst, |
| 3588 | 3588 | dst_loff, &cmp); |
| 3589 | 3589 | |
| 3590 | +out_free: | |
| 3591 | + kvfree(cmp.src_pages); | |
| 3592 | + kvfree(cmp.dst_pages); | |
| 3593 | + | |
| 3590 | 3594 | out_unlock: |
| 3591 | 3595 | if (same_inode) |
| 3592 | 3596 | inode_unlock(src); |
| 3593 | 3597 | else |
| 3594 | 3598 | btrfs_double_inode_unlock(src, dst); |
| 3595 | 3599 | |
| 3596 | −out_free: | |
| 3597 | − kvfree(cmp.src_pages); | |
| 3598 | − kvfree(cmp.dst_pages); | |
| 3599 | − | |
| 3600 | 3600 | return ret; |
| 3601 | 3601 | } |
| 3602 | 3602 | |
| @@ -2680,8 +2680,10 @@ out: · 2679 unmodified lines | ||
| 2680 | 2680 | free_extent_buffer(scratch_leaf); |
| 2681 | 2681 | } |
| 2682 | 2682 | |
| 2683 | − if (done && !ret) | |
| 2683 | + if (done && !ret) { | |
| 2684 | 2684 | ret = 1; |
| 2685 | + fs_info->qgroup_rescan_progress.objectid = (u64)-1; | |
| 2686 | + } | |
| 2685 | 2687 | return ret; |
| 2686 | 2688 | } |
| 2687 | 2689 | |
| @@ -2784,13 +2786,20 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid, · 96 unmodified lines | ||
| 2784 | 2786 | |
| 2785 | 2787 | if (!init_flags) { |
| 2786 | 2788 | /* we're resuming qgroup rescan at mount time */ |
| 2787 | − if (!(fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_RESCAN)) | |
| 2789 | + if (!(fs_info->qgroup_flags & | |
| 2790 | + BTRFS_QGROUP_STATUS_FLAG_RESCAN)) { | |
| 2788 | 2791 | btrfs_warn(fs_info, |
| 2789 | 2792 | "qgroup rescan init failed, qgroup is not enabled"); |
| 2790 | − else if (!(fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_ON)) | |
| 2793 | + ret = -EINVAL; | |
| 2794 | + } else if (!(fs_info->qgroup_flags & | |
| 2795 | + BTRFS_QGROUP_STATUS_FLAG_ON)) { | |
| 2791 | 2796 | btrfs_warn(fs_info, |
| 2792 | 2797 | "qgroup rescan init failed, qgroup rescan is not queued"); |
| 2793 | − return -EINVAL; | |
| 2798 | + ret = -EINVAL; | |
| 2799 | + } | |
| 2800 | + | |
| 2801 | + if (ret) | |
| 2802 | + return ret; | |
| 2794 | 2803 | } |
| 2795 | 2804 | |
| 2796 | 2805 | mutex_lock(&fs_info->qgroup_rescan_lock); |
| @@ -1135,6 +1135,7 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in) · 1134 unmodified lines | ||
| 1135 | 1135 | if (IS_ERR(realdn)) { |
| 1136 | 1136 | pr_err("splice_dentry error %ld %p inode %p ino %llx.%llx\n", |
| 1137 | 1137 | PTR_ERR(realdn), dn, in, ceph_vinop(in)); |
| 1138 | + dput(dn); | |
| 1138 | 1139 | dn = realdn; /* note realdn contains the error */ |
| 1139 | 1140 | goto out; |
| 1140 | 1141 | } else if (realdn) { |
| @@ -126,6 +126,25 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon) · 125 unmodified lines | ||
| 126 | 126 | seq_putc(m, '\n'); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | +static void | |
| 130 | +cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface) | |
| 131 | +{ | |
| 132 | + struct sockaddr_in *ipv4 = (struct sockaddr_in *)&iface->sockaddr; | |
| 133 | + struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&iface->sockaddr; | |
| 134 | + | |
| 135 | + seq_printf(m, "\t\tSpeed: %zu bps\n", iface->speed); | |
| 136 | + seq_puts(m, "\t\tCapabilities: "); | |
| 137 | + if (iface->rdma_capable) | |
| 138 | + seq_puts(m, "rdma "); | |
| 139 | + if (iface->rss_capable) | |
| 140 | + seq_puts(m, "rss "); | |
| 141 | + seq_putc(m, '\n'); | |
| 142 | + if (iface->sockaddr.ss_family == AF_INET) | |
| 143 | + seq_printf(m, "\t\tIPv4: %pI4\n", &ipv4->sin_addr); | |
| 144 | + else if (iface->sockaddr.ss_family == AF_INET6) | |
| 145 | + seq_printf(m, "\t\tIPv6: %pI6\n", &ipv6->sin6_addr); | |
| 146 | +} | |
| 147 | + | |
| 129 | 148 | static int cifs_debug_data_proc_show(struct seq_file *m, void *v) |
| 130 | 149 | { |
| 131 | 150 | struct list_head *tmp1, *tmp2, *tmp3; |
| @@ -312,6 +331,16 @@ skip_rdma: · 180 unmodified lines | ||
| 312 | 331 | mid_entry->mid); |
| 313 | 332 | } |
| 314 | 333 | spin_unlock(&GlobalMid_Lock); |
| 334 | + | |
| 335 | + spin_lock(&ses->iface_lock); | |
| 336 | + if (ses->iface_count) | |
| 337 | + seq_printf(m, "\n\tServer interfaces: %zu\n", | |
| 338 | + ses->iface_count); | |
| 339 | + for (j = 0; j < ses->iface_count; j++) { | |
| 340 | + seq_printf(m, "\t%d)\n", j); | |
| 341 | + cifs_dump_iface(m, &ses->iface_list[j]); | |
| 342 | + } | |
| 343 | + spin_unlock(&ses->iface_lock); | |
| 315 | 344 | } |
| 316 | 345 | } |
| 317 | 346 | spin_unlock(&cifs_tcp_ses_lock); |
| @@ -37,7 +37,6 @@ · 36 unmodified lines | ||
| 37 | 37 | #include <crypto/aead.h> |
| 38 | 38 | |
| 39 | 39 | int __cifs_calc_signature(struct smb_rqst *rqst, |
| 40 | − int start, | |
| 41 | 40 | struct TCP_Server_Info *server, char *signature, |
| 42 | 41 | struct shash_desc *shash) |
| 43 | 42 | { |
| @@ -45,16 +44,27 @@ int __cifs_calc_signature(struct smb_rqst *rqst, · 1 unmodified line | ||
| 45 | 44 | int rc; |
| 46 | 45 | struct kvec *iov = rqst->rq_iov; |
| 47 | 46 | int n_vec = rqst->rq_nvec; |
| 47 | + int is_smb2 = server->vals->header_preamble_size == 0; | |
| 48 | 48 | |
| 49 | − for (i = start; i < n_vec; i++) { | |
| 49 | + /* iov[0] is actual data and not the rfc1002 length for SMB2+ */ | |
| 50 | + if (is_smb2) { | |
| 51 | + if (iov[0].iov_len <= 4) | |
| 52 | + return -EIO; | |
| 53 | + i = 0; | |
| 54 | + } else { | |
| 55 | + if (n_vec < 2 || iov[0].iov_len != 4) | |
| 56 | + return -EIO; | |
| 57 | + i = 1; /* skip rfc1002 length */ | |
| 58 | + } | |
| 59 | + | |
| 60 | + for (; i < n_vec; i++) { | |
| 50 | 61 | if (iov[i].iov_len == 0) |
| 51 | 62 | continue; |
| 52 | 63 | if (iov[i].iov_base == NULL) { |
| 53 | 64 | cifs_dbg(VFS, "null iovec entry\n"); |
| 54 | 65 | return -EIO; |
| 55 | 66 | } |
| 56 | − if (i == 1 && iov[1].iov_len <= 4) | |
| 57 | − break; /* nothing to sign or corrupt header */ | |
| 67 | + | |
| 58 | 68 | rc = crypto_shash_update(shash, |
| 59 | 69 | iov[i].iov_base, iov[i].iov_len); |
| 60 | 70 | if (rc) { |
| @@ -118,7 +128,7 @@ static int cifs_calc_signature(struct smb_rqst *rqst, · 57 unmodified lines | ||
| 118 | 128 | return rc; |
| 119 | 129 | } |
| 120 | 130 | |
| 121 | − return __cifs_calc_signature(rqst, 1, server, signature, | |
| 131 | + return __cifs_calc_signature(rqst, server, signature, | |
| 122 | 132 | &server->secmech.sdescmd5->shash); |
| 123 | 133 | } |
| 124 | 134 | |
| @@ -33,6 +33,9 @@ · 32 unmodified lines | ||
| 33 | 33 | |
| 34 | 34 | #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ |
| 35 | 35 | |
| 36 | +#define CIFS_PORT 445 | |
| 37 | +#define RFC1001_PORT 139 | |
| 38 | + | |
| 36 | 39 | /* |
| 37 | 40 | * The sizes of various internal tables and strings |
| 38 | 41 | */ |
| @@ -312,6 +315,10 @@ struct smb_version_operations { · 273 unmodified lines | ||
| 312 | 315 | /* send echo request */ |
| 313 | 316 | int (*echo)(struct TCP_Server_Info *); |
| 314 | 317 | /* create directory */ |
| 318 | + int (*posix_mkdir)(const unsigned int xid, struct inode *inode, | |
| 319 | + umode_t mode, struct cifs_tcon *tcon, | |
| 320 | + const char *full_path, | |
| 321 | + struct cifs_sb_info *cifs_sb); | |
| 315 | 322 | int (*mkdir)(const unsigned int, struct cifs_tcon *, const char *, |
| 316 | 323 | struct cifs_sb_info *); |
| 317 | 324 | /* set info on created directory */ |
| @@ -838,6 +845,13 @@ static inline void cifs_set_net_ns(struct TCP_Server_Info *srv, struct net *net) · 520 unmodified lines | ||
| 838 | 845 | |
| 839 | 846 | #endif |
| 840 | 847 | |
| 848 | +struct cifs_server_iface { | |
| 849 | + size_t speed; | |
| 850 | + unsigned int rdma_capable : 1; | |
| 851 | + unsigned int rss_capable : 1; | |
| 852 | + struct sockaddr_storage sockaddr; | |
| 853 | +}; | |
| 854 | + | |
| 841 | 855 | /* |
| 842 | 856 | * Session structure. One of these for each uid session with a particular host |
| 843 | 857 | */ |
| @@ -875,6 +889,20 @@ struct cifs_ses { · 31 unmodified lines | ||
| 875 | 889 | #ifdef CONFIG_CIFS_SMB311 |
| 876 | 890 | __u8 preauth_sha_hash[SMB2_PREAUTH_HASH_SIZE]; |
| 877 | 891 | #endif /* 3.1.1 */ |
| 892 | + | |
| 893 | + /* | |
| 894 | + * Network interfaces available on the server this session is | |
| 895 | + * connected to. | |
| 896 | + * | |
| 897 | + * Other channels can be opened by connecting and binding this | |
| 898 | + * session to interfaces from this list. | |
| 899 | + * | |
| 900 | + * iface_lock should be taken when accessing any of these fields | |
| 901 | + */ | |
| 902 | + spinlock_t iface_lock; | |
| 903 | + struct cifs_server_iface *iface_list; | |
| 904 | + size_t iface_count; | |
| 905 | + unsigned long iface_last_update; /* jiffies */ | |
| 878 | 906 | }; |
| 879 | 907 | |
| 880 | 908 | static inline bool |
| @@ -883,6 +911,14 @@ cap_unix(struct cifs_ses *ses) · 2 unmodified lines | ||
| 883 | 911 | return ses->server->vals->cap_unix & ses->capabilities; |
| 884 | 912 | } |
| 885 | 913 | |
| 914 | +struct cached_fid { | |
| 915 | + bool is_valid:1; /* Do we have a useable root fid */ | |
| 916 | + struct cifs_fid *fid; | |
| 917 | + struct mutex fid_mutex; | |
| 918 | + struct cifs_tcon *tcon; | |
| 919 | + struct work_struct lease_break; | |
| 920 | +}; | |
| 921 | + | |
| 886 | 922 | /* |
| 887 | 923 | * there is one of these for each connection to a resource on a particular |
| 888 | 924 | * session |
| @@ -987,9 +1023,7 @@ struct cifs_tcon { · 98 unmodified lines | ||
| 987 | 1023 | struct fscache_cookie *fscache; /* cookie for share */ |
| 988 | 1024 | #endif |
| 989 | 1025 | struct list_head pending_opens; /* list of incomplete opens */ |
| 990 | − bool valid_root_fid:1; /* Do we have a useable root fid */ | |
| 991 | − struct mutex prfid_mutex; /* prevents reopen race after dead ses*/ | |
| 992 | − struct cifs_fid *prfid; /* handle to the directory at top of share */ | |
| 1026 | + struct cached_fid crfid; /* Cached root fid */ | |
| 993 | 1027 | /* BB add field for back pointer to sb struct(s)? */ |
| 994 | 1028 | }; |
| 995 | 1029 | |
| @@ -112,10 +112,6 @@ extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *, · 111 unmodified lines | ||
| 112 | 112 | struct kvec *, int /* nvec to send */, |
| 113 | 113 | int * /* type of buf returned */, const int flags, |
| 114 | 114 | struct kvec * /* resp vec */); |
| 115 | −extern int smb2_send_recv(const unsigned int xid, struct cifs_ses *pses, | |
| 116 | − struct kvec *pkvec, int nvec_to_send, | |
| 117 | − int *pbuftype, const int flags, | |
| 118 | − struct kvec *presp); | |
| 119 | 115 | extern int SendReceiveBlockingLock(const unsigned int xid, |
| 120 | 116 | struct cifs_tcon *ptcon, |
| 121 | 117 | struct smb_hdr *in_buf , |
| @@ -544,7 +540,7 @@ int cifs_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon, · 422 unmodified lines | ||
| 544 | 540 | struct cifs_sb_info *cifs_sb, |
| 545 | 541 | const unsigned char *path, char *pbuf, |
| 546 | 542 | unsigned int *pbytes_written); |
| 547 | −int __cifs_calc_signature(struct smb_rqst *rqst, int start, | |
| 543 | +int __cifs_calc_signature(struct smb_rqst *rqst, | |
| 548 | 544 | struct TCP_Server_Info *server, char *signature, |
| 549 | 545 | struct shash_desc *shash); |
| 550 | 546 | enum securityEnum cifs_select_sectype(struct TCP_Server_Info *, |
| @@ -552,6 +548,7 @@ enum securityEnum cifs_select_sectype(struct TCP_Server_Info *, · 1 unmodified line | ||
| 552 | 548 | struct cifs_aio_ctx *cifs_aio_ctx_alloc(void); |
| 553 | 549 | void cifs_aio_ctx_release(struct kref *refcount); |
| 554 | 550 | int setup_aio_ctx_iter(struct cifs_aio_ctx *ctx, struct iov_iter *iter, int rw); |
| 551 | +void smb2_cached_lease_break(struct work_struct *work); | |
| 555 | 552 | |
| 556 | 553 | int cifs_alloc_hash(const char *name, struct crypto_shash **shash, |
| 557 | 554 | struct sdesc **sdesc); |
| @@ -107,10 +107,10 @@ cifs_mark_open_files_invalid(struct cifs_tcon *tcon) · 106 unmodified lines | ||
| 107 | 107 | } |
| 108 | 108 | spin_unlock(&tcon->open_file_lock); |
| 109 | 109 | |
| 110 | − mutex_lock(&tcon->prfid_mutex); | |
| 111 | − tcon->valid_root_fid = false; | |
| 112 | − memset(tcon->prfid, 0, sizeof(struct cifs_fid)); | |
| 113 | − mutex_unlock(&tcon->prfid_mutex); | |
| 110 | + mutex_lock(&tcon->crfid.fid_mutex); | |
| 111 | + tcon->crfid.is_valid = false; | |
| 112 | + memset(tcon->crfid.fid, 0, sizeof(struct cifs_fid)); | |
| 113 | + mutex_unlock(&tcon->crfid.fid_mutex); | |
| 114 | 114 | |
| 115 | 115 | /* |
| 116 | 116 | * BB Add call to invalidate_inodes(sb) for all superblocks mounted |
| @@ -57,9 +57,6 @@ · 56 unmodified lines | ||
| 57 | 57 | #include "smb2proto.h" |
| 58 | 58 | #include "smbdirect.h" |
| 59 | 59 | |
| 60 | −#define CIFS_PORT 445 | |
| 61 | −#define RFC1001_PORT 139 | |
| 62 | − | |
| 63 | 60 | extern mempool_t *cifs_req_poolp; |
| 64 | 61 | extern bool disable_legacy_dialects; |
| 65 | 62 | |
| @@ -3029,8 +3026,11 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) · 2963 unmodified lines | ||
| 3029 | 3026 | |
| 3030 | 3027 | #ifdef CONFIG_CIFS_SMB311 |
| 3031 | 3028 | if ((volume_info->linux_ext) && (ses->server->posix_ext_supported)) { |
| 3032 | − if (ses->server->vals->protocol_id == SMB311_PROT_ID) | |
| 3029 | + if (ses->server->vals->protocol_id == SMB311_PROT_ID) { | |
| 3033 | 3030 | tcon->posix_extensions = true; |
| 3031 | + printk_once(KERN_WARNING | |
| 3032 | + "SMB3.11 POSIX Extensions are experimental\n"); | |
| 3033 | + } | |
| 3034 | 3034 | } |
| 3035 | 3035 | #endif /* 311 */ |
| 3036 | 3036 | |
| @@ -1575,6 +1575,17 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) · 1574 unmodified lines | ||
| 1575 | 1575 | goto mkdir_out; |
| 1576 | 1576 | } |
| 1577 | 1577 | |
| 1578 | + server = tcon->ses->server; | |
| 1579 | + | |
| 1580 | +#ifdef CONFIG_CIFS_SMB311 | |
| 1581 | + if ((server->ops->posix_mkdir) && (tcon->posix_extensions)) { | |
| 1582 | + rc = server->ops->posix_mkdir(xid, inode, mode, tcon, full_path, | |
| 1583 | + cifs_sb); | |
| 1584 | + d_drop(direntry); /* for time being always refresh inode info */ | |
| 1585 | + goto mkdir_out; | |
| 1586 | + } | |
| 1587 | +#endif /* SMB311 */ | |
| 1588 | + | |
| 1578 | 1589 | if (cap_unix(tcon->ses) && (CIFS_UNIX_POSIX_PATH_OPS_CAP & |
| 1579 | 1590 | le64_to_cpu(tcon->fsUnixInfo.Capability))) { |
| 1580 | 1591 | rc = cifs_posix_mkdir(inode, direntry, mode, full_path, cifs_sb, |
| @@ -1583,8 +1594,6 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) · 2 unmodified lines | ||
| 1583 | 1594 | goto mkdir_out; |
| 1584 | 1595 | } |
| 1585 | 1596 | |
| 1586 | − server = tcon->ses->server; | |
| 1587 | − | |
| 1588 | 1597 | if (!server->ops->mkdir) { |
| 1589 | 1598 | rc = -ENOSYS; |
| 1590 | 1599 | goto mkdir_out; |
| @@ -82,6 +82,7 @@ sesInfoAlloc(void) · 81 unmodified lines | ||
| 82 | 82 | INIT_LIST_HEAD(&ret_buf->smb_ses_list); |
| 83 | 83 | INIT_LIST_HEAD(&ret_buf->tcon_list); |
| 84 | 84 | mutex_init(&ret_buf->session_mutex); |
| 85 | + spin_lock_init(&ret_buf->iface_lock); | |
| 85 | 86 | } |
| 86 | 87 | return ret_buf; |
| 87 | 88 | } |
| @@ -102,6 +103,7 @@ sesInfoFree(struct cifs_ses *buf_to_free) · 14 unmodified lines | ||
| 102 | 103 | kfree(buf_to_free->user_name); |
| 103 | 104 | kfree(buf_to_free->domainName); |
| 104 | 105 | kzfree(buf_to_free->auth_key.response); |
| 106 | + kfree(buf_to_free->iface_list); | |
| 105 | 107 | kzfree(buf_to_free); |
| 106 | 108 | } |
| 107 | 109 | |
| @@ -117,8 +119,9 @@ tconInfoAlloc(void) · 9 unmodified lines | ||
| 117 | 119 | INIT_LIST_HEAD(&ret_buf->openFileList); |
| 118 | 120 | INIT_LIST_HEAD(&ret_buf->tcon_list); |
| 119 | 121 | spin_lock_init(&ret_buf->open_file_lock); |
| 120 | − mutex_init(&ret_buf->prfid_mutex); | |
| 121 | − ret_buf->prfid = kzalloc(sizeof(struct cifs_fid), GFP_KERNEL); | |
| 122 | + mutex_init(&ret_buf->crfid.fid_mutex); | |
| 123 | + ret_buf->crfid.fid = kzalloc(sizeof(struct cifs_fid), | |
| 124 | + GFP_KERNEL); | |
| 122 | 125 | #ifdef CONFIG_CIFS_STATS |
| 123 | 126 | spin_lock_init(&ret_buf->stat_lock); |
| 124 | 127 | #endif |
| @@ -136,7 +139,7 @@ tconInfoFree(struct cifs_tcon *buf_to_free) · 11 unmodified lines | ||
| 136 | 139 | atomic_dec(&tconInfoAllocCount); |
| 137 | 140 | kfree(buf_to_free->nativeFileSystem); |
| 138 | 141 | kzfree(buf_to_free->password); |
| 139 | − kfree(buf_to_free->prfid); | |
| 142 | + kfree(buf_to_free->crfid.fid); | |
| 140 | 143 | kfree(buf_to_free); |
| 141 | 144 | } |
| 142 | 145 | |
| @@ -454,7 +454,8 @@ cifs_convert_path_to_utf16(const char *from, struct cifs_sb_info *cifs_sb) · 453 unmodified lines | ||
| 454 | 454 | #ifdef CONFIG_CIFS_SMB311 |
| 455 | 455 | /* SMB311 POSIX extensions paths do not include leading slash */ |
| 456 | 456 | else if (cifs_sb_master_tlink(cifs_sb) && |
| 457 | − cifs_sb_master_tcon(cifs_sb)->posix_extensions) { | |
| 457 | + cifs_sb_master_tcon(cifs_sb)->posix_extensions && | |
| 458 | + (from[0] == '/')) { | |
| 458 | 459 | start_of_path = from + 1; |
| 459 | 460 | } |
| 460 | 461 | #endif /* 311 */ |
| @@ -492,10 +493,11 @@ cifs_ses_oplock_break(struct work_struct *work) · 31 unmodified lines | ||
| 492 | 493 | { |
| 493 | 494 | struct smb2_lease_break_work *lw = container_of(work, |
| 494 | 495 | struct smb2_lease_break_work, lease_break); |
| 495 | − int rc; | |
| 496 | + int rc = 0; | |
| 496 | 497 | |
| 497 | 498 | rc = SMB2_lease_break(0, tlink_tcon(lw->tlink), lw->lease_key, |
| 498 | 499 | lw->lease_state); |
| 500 | + | |
| 499 | 501 | cifs_dbg(FYI, "Lease release rc %d\n", rc); |
| 500 | 502 | cifs_put_tlink(lw->tlink); |
| 501 | 503 | kfree(lw); |
| @@ -561,6 +563,7 @@ smb2_tcon_has_lease(struct cifs_tcon *tcon, struct smb2_lease_break *rsp, · 59 unmodified lines | ||
| 561 | 563 | |
| 562 | 564 | open->oplock = lease_state; |
| 563 | 565 | } |
| 566 | + | |
| 564 | 567 | return found; |
| 565 | 568 | } |
| 566 | 569 | |
| @@ -603,6 +606,18 @@ smb2_is_valid_lease_break(char *buffer) · 36 unmodified lines | ||
| 603 | 606 | return true; |
| 604 | 607 | } |
| 605 | 608 | spin_unlock(&tcon->open_file_lock); |
| 609 | + | |
| 610 | + if (tcon->crfid.is_valid && | |
| 611 | + !memcmp(rsp->LeaseKey, | |
| 612 | + tcon->crfid.fid->lease_key, | |
| 613 | + SMB2_LEASE_KEY_SIZE)) { | |
| 614 | + INIT_WORK(&tcon->crfid.lease_break, | |
| 615 | + smb2_cached_lease_break); | |
| 616 | + queue_work(cifsiod_wq, | |
| 617 | + &tcon->crfid.lease_break); | |
| 618 | + spin_unlock(&cifs_tcp_ses_lock); | |
| 619 | + return true; | |
| 620 | + } | |
| 606 | 621 | } |
| 607 | 622 | } |
| 608 | 623 | } |
| @@ -294,34 +294,191 @@ smb2_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *volume_info) · 293 unmodified lines | ||
| 294 | 294 | return rsize; |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | −#ifdef CONFIG_CIFS_STATS2 | |
| 297 | + | |
| 298 | +static int | |
| 299 | +parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf, | |
| 300 | + size_t buf_len, | |
| 301 | + struct cifs_server_iface **iface_list, | |
| 302 | + size_t *iface_count) | |
| 303 | +{ | |
| 304 | + struct network_interface_info_ioctl_rsp *p; | |
| 305 | + struct sockaddr_in *addr4; | |
| 306 | + struct sockaddr_in6 *addr6; | |
| 307 | + struct iface_info_ipv4 *p4; | |
| 308 | + struct iface_info_ipv6 *p6; | |
| 309 | + struct cifs_server_iface *info; | |
| 310 | + ssize_t bytes_left; | |
| 311 | + size_t next = 0; | |
| 312 | + int nb_iface = 0; | |
| 313 | + int rc = 0; | |
| 314 | + | |
| 315 | + *iface_list = NULL; | |
| 316 | + *iface_count = 0; | |
| 317 | + | |
| 318 | + /* | |
| 319 | + * Fist pass: count and sanity check | |
| 320 | + */ | |
| 321 | + | |
| 322 | + bytes_left = buf_len; | |
| 323 | + p = buf; | |
| 324 | + while (bytes_left >= sizeof(*p)) { | |
| 325 | + nb_iface++; | |
| 326 | + next = le32_to_cpu(p->Next); | |
| 327 | + if (!next) { | |
| 328 | + bytes_left -= sizeof(*p); | |
| 329 | + break; | |
| 330 | + } | |
| 331 | + p = (struct network_interface_info_ioctl_rsp *)((u8 *)p+next); | |
| 332 | + bytes_left -= next; | |
| 333 | + } | |
| 334 | + | |
| 335 | + if (!nb_iface) { | |
| 336 | + cifs_dbg(VFS, "%s: malformed interface info\n", __func__); | |
| 337 | + rc = -EINVAL; | |
| 338 | + goto out; | |
| 339 | + } | |
| 340 | + | |
| 341 | + if (bytes_left || p->Next) | |
| 342 | + cifs_dbg(VFS, "%s: incomplete interface info\n", __func__); | |
| 343 | + | |
| 344 | + | |
| 345 | + /* | |
| 346 | + * Second pass: extract info to internal structure | |
| 347 | + */ | |
| 348 | + | |
| 349 | + *iface_list = kcalloc(nb_iface, sizeof(**iface_list), GFP_KERNEL); | |
| 350 | + if (!*iface_list) { | |
| 351 | + rc = -ENOMEM; | |
| 352 | + goto out; | |
| 353 | + } | |
| 354 | + | |
| 355 | + info = *iface_list; | |
| 356 | + bytes_left = buf_len; | |
| 357 | + p = buf; | |
| 358 | + while (bytes_left >= sizeof(*p)) { | |
| 359 | + info->speed = le64_to_cpu(p->LinkSpeed); | |
| 360 | + info->rdma_capable = le32_to_cpu(p->Capability & RDMA_CAPABLE); | |
| 361 | + info->rss_capable = le32_to_cpu(p->Capability & RSS_CAPABLE); | |
| 362 | + | |
| 363 | + cifs_dbg(FYI, "%s: adding iface %zu\n", __func__, *iface_count); | |
| 364 | + cifs_dbg(FYI, "%s: speed %zu bps\n", __func__, info->speed); | |
| 365 | + cifs_dbg(FYI, "%s: capabilities 0x%08x\n", __func__, | |
| 366 | + le32_to_cpu(p->Capability)); | |
| 367 | + | |
| 368 | + switch (p->Family) { | |
| 369 | + /* | |
| 370 | + * The kernel and wire socket structures have the same | |
| 371 | + * layout and use network byte order but make the | |
| 372 | + * conversion explicit in case either one changes. | |
| 373 | + */ | |
| 374 | + case INTERNETWORK: | |
| 375 | + addr4 = (struct sockaddr_in *)&info->sockaddr; | |
| 376 | + p4 = (struct iface_info_ipv4 *)p->Buffer; | |
| 377 | + addr4->sin_family = AF_INET; | |
| 378 | + memcpy(&addr4->sin_addr, &p4->IPv4Address, 4); | |
| 379 | + | |
| 380 | + /* [MS-SMB2] 2.2.32.5.1.1 Clients MUST ignore these */ | |
| 381 | + addr4->sin_port = cpu_to_be16(CIFS_PORT); | |
| 382 | + | |
| 383 | + cifs_dbg(FYI, "%s: ipv4 %pI4\n", __func__, | |
| 384 | + &addr4->sin_addr); | |
| 385 | + break; | |
| 386 | + case INTERNETWORKV6: | |
| 387 | + addr6 = (struct sockaddr_in6 *)&info->sockaddr; | |
| 388 | + p6 = (struct iface_info_ipv6 *)p->Buffer; | |
| 389 | + addr6->sin6_family = AF_INET6; | |
| 390 | + memcpy(&addr6->sin6_addr, &p6->IPv6Address, 16); | |
| 391 | + | |
| 392 | + /* [MS-SMB2] 2.2.32.5.1.2 Clients MUST ignore these */ | |
| 393 | + addr6->sin6_flowinfo = 0; | |
| 394 | + addr6->sin6_scope_id = 0; | |
| 395 | + addr6->sin6_port = cpu_to_be16(CIFS_PORT); | |
| 396 | + | |
| 397 | + cifs_dbg(FYI, "%s: ipv6 %pI6\n", __func__, | |
| 398 | + &addr6->sin6_addr); | |
| 399 | + break; | |
| 400 | + default: | |
| 401 | + cifs_dbg(VFS, | |
| 402 | + "%s: skipping unsupported socket family\n", | |
| 403 | + __func__); | |
| 404 | + goto next_iface; | |
| 405 | + } | |
| 406 | + | |
| 407 | + (*iface_count)++; | |
| 408 | + info++; | |
| 409 | +next_iface: | |
| 410 | + next = le32_to_cpu(p->Next); | |
| 411 | + if (!next) | |
| 412 | + break; | |
| 413 | + p = (struct network_interface_info_ioctl_rsp *)((u8 *)p+next); | |
| 414 | + bytes_left -= next; | |
| 415 | + } | |
| 416 | + | |
| 417 | + if (!*iface_count) { | |
| 418 | + rc = -EINVAL; | |
| 419 | + goto out; | |
| 420 | + } | |
| 421 | + | |
| 422 | +out: | |
| 423 | + if (rc) { | |
| 424 | + kfree(*iface_list); | |
| 425 | + *iface_count = 0; | |
| 426 | + *iface_list = NULL; | |
| 427 | + } | |
| 428 | + return rc; | |
| 429 | +} | |
| 430 | + | |
| 431 | + | |
| 298 | 432 | static int |
| 299 | 433 | SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon) |
| 300 | 434 | { |
| 301 | 435 | int rc; |
| 302 | 436 | unsigned int ret_data_len = 0; |
| 303 | − struct network_interface_info_ioctl_rsp *out_buf; | |
| 437 | + struct network_interface_info_ioctl_rsp *out_buf = NULL; | |
| 438 | + struct cifs_server_iface *iface_list; | |
| 439 | + size_t iface_count; | |
| 440 | + struct cifs_ses *ses = tcon->ses; | |
| 304 | 441 | |
| 305 | 442 | rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID, |
| 306 | 443 | FSCTL_QUERY_NETWORK_INTERFACE_INFO, true /* is_fsctl */, |
| 307 | 444 | NULL /* no data input */, 0 /* no data input */, |
| 308 | 445 | (char **)&out_buf, &ret_data_len); |
| 309 | − if (rc != 0) | |
| 446 | + if (rc != 0) { | |
| 310 | 447 | cifs_dbg(VFS, "error %d on ioctl to get interface list\n", rc); |
| 311 | − else if (ret_data_len < sizeof(struct network_interface_info_ioctl_rsp)) { | |
| 312 | − cifs_dbg(VFS, "server returned bad net interface info buf\n"); | |
| 313 | − rc = -EINVAL; | |
| 314 | − } else { | |
| 315 | − /* Dump info on first interface */ | |
| 316 | − cifs_dbg(FYI, "Adapter Capability 0x%x\t", | |
| 317 | − le32_to_cpu(out_buf->Capability)); | |
| 318 | − cifs_dbg(FYI, "Link Speed %lld\n", | |
| 319 | − le64_to_cpu(out_buf->LinkSpeed)); | |
| 448 | + goto out; | |
| 320 | 449 | } |
| 450 | + | |
| 451 | + rc = parse_server_interfaces(out_buf, ret_data_len, | |
| 452 | + &iface_list, &iface_count); | |
| 453 | + if (rc) | |
| 454 | + goto out; | |
| 455 | + | |
| 456 | + spin_lock(&ses->iface_lock); | |
| 457 | + kfree(ses->iface_list); | |
| 458 | + ses->iface_list = iface_list; | |
| 459 | + ses->iface_count = iface_count; | |
| 460 | + ses->iface_last_update = jiffies; | |
| 461 | + spin_unlock(&ses->iface_lock); | |
| 462 | + | |
| 463 | +out: | |
| 321 | 464 | kfree(out_buf); |
| 322 | 465 | return rc; |
| 323 | 466 | } |
| 324 | −#endif /* STATS2 */ | |
| 467 | + | |
| 468 | +void | |
| 469 | +smb2_cached_lease_break(struct work_struct *work) | |
| 470 | +{ | |
| 471 | + struct cached_fid *cfid = container_of(work, | |
| 472 | + struct cached_fid, lease_break); | |
| 473 | + mutex_lock(&cfid->fid_mutex); | |
| 474 | + if (cfid->is_valid) { | |
| 475 | + cifs_dbg(FYI, "clear cached root file handle\n"); | |
| 476 | + SMB2_close(0, cfid->tcon, cfid->fid->persistent_fid, | |
| 477 | + cfid->fid->volatile_fid); | |
| 478 | + cfid->is_valid = false; | |
| 479 | + } | |
| 480 | + mutex_unlock(&cfid->fid_mutex); | |
| 481 | +} | |
| 325 | 482 | |
| 326 | 483 | /* |
| 327 | 484 | * Open the directory at the root of a share |
| @@ -331,13 +488,13 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *pfid) · 3 unmodified lines | ||
| 331 | 488 | struct cifs_open_parms oparams; |
| 332 | 489 | int rc; |
| 333 | 490 | __le16 srch_path = 0; /* Null - since an open of top of share */ |
| 334 | − u8 oplock = SMB2_OPLOCK_LEVEL_NONE; | |
| 491 | + u8 oplock = SMB2_OPLOCK_LEVEL_II; | |
| 335 | 492 | |
| 336 | − mutex_lock(&tcon->prfid_mutex); | |
| 337 | − if (tcon->valid_root_fid) { | |
| 493 | + mutex_lock(&tcon->crfid.fid_mutex); | |
| 494 | + if (tcon->crfid.is_valid) { | |
| 338 | 495 | cifs_dbg(FYI, "found a cached root file handle\n"); |
| 339 | − memcpy(pfid, tcon->prfid, sizeof(struct cifs_fid)); | |
| 340 | − mutex_unlock(&tcon->prfid_mutex); | |
| 496 | + memcpy(pfid, tcon->crfid.fid, sizeof(struct cifs_fid)); | |
| 497 | + mutex_unlock(&tcon->crfid.fid_mutex); | |
| 341 | 498 | return 0; |
| 342 | 499 | } |
| 343 | 500 | |
| @@ -350,10 +507,11 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *pfid) · 6 unmodified lines | ||
| 350 | 507 | |
| 351 | 508 | rc = SMB2_open(xid, &oparams, &srch_path, &oplock, NULL, NULL, NULL); |
| 352 | 509 | if (rc == 0) { |
| 353 | − memcpy(tcon->prfid, pfid, sizeof(struct cifs_fid)); | |
| 354 | − tcon->valid_root_fid = true; | |
| 510 | + memcpy(tcon->crfid.fid, pfid, sizeof(struct cifs_fid)); | |
| 511 | + tcon->crfid.tcon = tcon; | |
| 512 | + tcon->crfid.is_valid = true; | |
| 355 | 513 | } |
| 356 | − mutex_unlock(&tcon->prfid_mutex); | |
| 514 | + mutex_unlock(&tcon->crfid.fid_mutex); | |
| 357 | 515 | return rc; |
| 358 | 516 | } |
| 359 | 517 | |
| @@ -383,9 +541,7 @@ smb3_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon) · 23 unmodified lines | ||
| 383 | 541 | if (rc) |
| 384 | 542 | return; |
| 385 | 543 | |
| 386 | −#ifdef CONFIG_CIFS_STATS2 | |
| 387 | 544 | SMB3_request_interfaces(xid, tcon); |
| 388 | −#endif /* STATS2 */ | |
| 389 | 545 | |
| 390 | 546 | SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid, |
| 391 | 547 | FS_ATTRIBUTE_INFORMATION); |
| @@ -436,7 +592,7 @@ smb2_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon, · 44 unmodified lines | ||
| 436 | 592 | struct cifs_open_parms oparms; |
| 437 | 593 | struct cifs_fid fid; |
| 438 | 594 | |
| 439 | − if ((*full_path == 0) && tcon->valid_root_fid) | |
| 595 | + if ((*full_path == 0) && tcon->crfid.is_valid) | |
| 440 | 596 | return 0; |
| 441 | 597 | |
| 442 | 598 | utf16_path = cifs_convert_path_to_utf16(full_path, cifs_sb); |
| @@ -2151,7 +2307,7 @@ fill_transform_hdr(struct smb2_transform_hdr *tr_hdr, unsigned int orig_len, · 1708 unmodified lines | ||
| 2151 | 2307 | struct smb_rqst *old_rq) |
| 2152 | 2308 | { |
| 2153 | 2309 | struct smb2_sync_hdr *shdr = |
| 2154 | − (struct smb2_sync_hdr *)old_rq->rq_iov[1].iov_base; | |
| 2310 | + (struct smb2_sync_hdr *)old_rq->rq_iov[0].iov_base; | |
| 2155 | 2311 | |
| 2156 | 2312 | memset(tr_hdr, 0, sizeof(struct smb2_transform_hdr)); |
| 2157 | 2313 | tr_hdr->ProtocolId = SMB2_TRANSFORM_PROTO_NUM; |
| @@ -2171,14 +2327,13 @@ static inline void smb2_sg_set_buf(struct scatterlist *sg, const void *buf, · 13 unmodified lines | ||
| 2171 | 2327 | } |
| 2172 | 2328 | |
| 2173 | 2329 | /* Assumes: |
| 2174 | − * rqst->rq_iov[0] is rfc1002 length | |
| 2175 | − * rqst->rq_iov[1] is tranform header | |
| 2176 | − * rqst->rq_iov[2+] data to be encrypted/decrypted | |
| 2330 | + * rqst->rq_iov[0] is transform header | |
| 2331 | + * rqst->rq_iov[1+] data to be encrypted/decrypted | |
| 2177 | 2332 | */ |
| 2178 | 2333 | static struct scatterlist * |
| 2179 | 2334 | init_sg(struct smb_rqst *rqst, u8 *sign) |
| 2180 | 2335 | { |
| 2181 | − unsigned int sg_len = rqst->rq_nvec + rqst->rq_npages; | |
| 2336 | + unsigned int sg_len = rqst->rq_nvec + rqst->rq_npages + 1; | |
| 2182 | 2337 | unsigned int assoc_data_len = sizeof(struct smb2_transform_hdr) - 20; |
| 2183 | 2338 | struct scatterlist *sg; |
| 2184 | 2339 | unsigned int i; |
| @@ -2189,10 +2344,10 @@ init_sg(struct smb_rqst *rqst, u8 *sign) · 4 unmodified lines | ||
| 2189 | 2344 | return NULL; |
| 2190 | 2345 | |
| 2191 | 2346 | sg_init_table(sg, sg_len); |
| 2192 | − smb2_sg_set_buf(&sg[0], rqst->rq_iov[1].iov_base + 20, assoc_data_len); | |
| 2193 | − for (i = 1; i < rqst->rq_nvec - 1; i++) | |
| 2194 | − smb2_sg_set_buf(&sg[i], rqst->rq_iov[i+1].iov_base, | |
| 2195 | − rqst->rq_iov[i+1].iov_len); | |
| 2347 | + smb2_sg_set_buf(&sg[0], rqst->rq_iov[0].iov_base + 20, assoc_data_len); | |
| 2348 | + for (i = 1; i < rqst->rq_nvec; i++) | |
| 2349 | + smb2_sg_set_buf(&sg[i], rqst->rq_iov[i].iov_base, | |
| 2350 | + rqst->rq_iov[i].iov_len); | |
| 2196 | 2351 | for (j = 0; i < sg_len - 1; i++, j++) { |
| 2197 | 2352 | unsigned int len, offset; |
| 2198 | 2353 | |
| @@ -2224,18 +2379,17 @@ smb2_get_enc_key(struct TCP_Server_Info *server, __u64 ses_id, int enc, u8 *key) · 25 unmodified lines | ||
| 2224 | 2379 | return 1; |
| 2225 | 2380 | } |
| 2226 | 2381 | /* |
| 2227 | − * Encrypt or decrypt @rqst message. @rqst has the following format: | |
| 2228 | − * iov[0] - rfc1002 length | |
| 2229 | − * iov[1] - transform header (associate data), | |
| 2230 | − * iov[2-N] and pages - data to encrypt. | |
| 2231 | − * On success return encrypted data in iov[2-N] and pages, leave iov[0-1] | |
| 2382 | + * Encrypt or decrypt @rqst message. @rqst[0] has the following format: | |
| 2383 | + * iov[0] - transform header (associate data), | |
| 2384 | + * iov[1-N] - SMB2 header and pages - data to encrypt. | |
| 2385 | + * On success return encrypted data in iov[1-N] and pages, leave iov[0] | |
| 2232 | 2386 | * untouched. |
| 2233 | 2387 | */ |
| 2234 | 2388 | static int |
| 2235 | 2389 | crypt_message(struct TCP_Server_Info *server, struct smb_rqst *rqst, int enc) |
| 2236 | 2390 | { |
| 2237 | 2391 | struct smb2_transform_hdr *tr_hdr = |
| 2238 | − (struct smb2_transform_hdr *)rqst->rq_iov[1].iov_base; | |
| 2392 | + (struct smb2_transform_hdr *)rqst->rq_iov[0].iov_base; | |
| 2239 | 2393 | unsigned int assoc_data_len = sizeof(struct smb2_transform_hdr) - 20; |
| 2240 | 2394 | int rc = 0; |
| 2241 | 2395 | struct scatterlist *sg; |
| @@ -2323,10 +2477,6 @@ free_req: · 81 unmodified lines | ||
| 2323 | 2477 | return rc; |
| 2324 | 2478 | } |
| 2325 | 2479 | |
| 2326 | −/* | |
| 2327 | − * This is called from smb_send_rqst. At this point we have the rfc1002 | |
| 2328 | − * header as the first element in the vector. | |
| 2329 | − */ | |
| 2330 | 2480 | static int |
| 2331 | 2481 | smb3_init_transform_rq(struct TCP_Server_Info *server, struct smb_rqst *new_rq, |
| 2332 | 2482 | struct smb_rqst *old_rq) |
| @@ -2335,7 +2485,7 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, struct smb_rqst *new_rq, · 2 unmodified lines | ||
| 2335 | 2485 | struct page **pages; |
| 2336 | 2486 | struct smb2_transform_hdr *tr_hdr; |
| 2337 | 2487 | unsigned int npages = old_rq->rq_npages; |
| 2338 | − unsigned int orig_len = get_rfc1002_length(old_rq->rq_iov[0].iov_base); | |
| 2488 | + unsigned int orig_len; | |
| 2339 | 2489 | int i; |
| 2340 | 2490 | int rc = -ENOMEM; |
| 2341 | 2491 | |
| @@ -2355,18 +2505,14 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, struct smb_rqst *new_rq, · 13 unmodified lines | ||
| 2355 | 2505 | goto err_free_pages; |
| 2356 | 2506 | } |
| 2357 | 2507 | |
| 2358 | − /* Make space for one extra iov to hold the transform header */ | |
| 2359 | 2508 | iov = kmalloc_array(old_rq->rq_nvec + 1, sizeof(struct kvec), |
| 2360 | 2509 | GFP_KERNEL); |
| 2361 | 2510 | if (!iov) |
| 2362 | 2511 | goto err_free_pages; |
| 2363 | 2512 | |
| 2364 | − /* copy all iovs from the old except the 1st one (rfc1002 length) */ | |
| 2365 | − memcpy(&iov[2], &old_rq->rq_iov[1], | |
| 2366 | − sizeof(struct kvec) * (old_rq->rq_nvec - 1)); | |
| 2367 | − /* copy the rfc1002 iov */ | |
| 2368 | − iov[0].iov_base = old_rq->rq_iov[0].iov_base; | |
| 2369 | − iov[0].iov_len = old_rq->rq_iov[0].iov_len; | |
| 2513 | + /* copy all iovs from the old */ | |
| 2514 | + memcpy(&iov[1], &old_rq->rq_iov[0], | |
| 2515 | + sizeof(struct kvec) * old_rq->rq_nvec); | |
| 2370 | 2516 | |
| 2371 | 2517 | new_rq->rq_iov = iov; |
| 2372 | 2518 | new_rq->rq_nvec = old_rq->rq_nvec + 1; |
| @@ -2375,14 +2521,12 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, struct smb_rqst *new_rq, · 2 unmodified lines | ||
| 2375 | 2521 | if (!tr_hdr) |
| 2376 | 2522 | goto err_free_iov; |
| 2377 | 2523 | |
| 2524 | + orig_len = smb2_rqst_len(old_rq, false); | |
| 2525 | + | |
| 2378 | 2526 | /* fill the 2nd iov with a transform header */ |
| 2379 | 2527 | fill_transform_hdr(tr_hdr, orig_len, old_rq); |
| 2380 | − new_rq->rq_iov[1].iov_base = tr_hdr; | |
| 2381 | − new_rq->rq_iov[1].iov_len = sizeof(struct smb2_transform_hdr); | |
| 2382 | − | |
| 2383 | − /* Update rfc1002 header */ | |
| 2384 | − inc_rfc1001_len(new_rq->rq_iov[0].iov_base, | |
| 2385 | − sizeof(struct smb2_transform_hdr)); | |
| 2528 | + new_rq->rq_iov[0].iov_base = tr_hdr; | |
| 2529 | + new_rq->rq_iov[0].iov_len = sizeof(struct smb2_transform_hdr); | |
| 2386 | 2530 | |
| 2387 | 2531 | /* copy pages form the old */ |
| 2388 | 2532 | for (i = 0; i < npages; i++) { |
| @@ -2426,7 +2570,7 @@ smb3_free_transform_rq(struct smb_rqst *rqst) · 37 unmodified lines | ||
| 2426 | 2570 | put_page(rqst->rq_pages[i]); |
| 2427 | 2571 | kfree(rqst->rq_pages); |
| 2428 | 2572 | /* free transform header */ |
| 2429 | − kfree(rqst->rq_iov[1].iov_base); | |
| 2573 | + kfree(rqst->rq_iov[0].iov_base); | |
| 2430 | 2574 | kfree(rqst->rq_iov); |
| 2431 | 2575 | } |
| 2432 | 2576 | |
| @@ -2443,19 +2587,17 @@ decrypt_raw_data(struct TCP_Server_Info *server, char *buf, · 10 unmodified lines | ||
| 2443 | 2587 | unsigned int buf_data_size, struct page **pages, |
| 2444 | 2588 | unsigned int npages, unsigned int page_data_size) |
| 2445 | 2589 | { |
| 2446 | − struct kvec iov[3]; | |
| 2590 | + struct kvec iov[2]; | |
| 2447 | 2591 | struct smb_rqst rqst = {NULL}; |
| 2448 | 2592 | int rc; |
| 2449 | 2593 | |
| 2450 | − iov[0].iov_base = NULL; | |
| 2451 | − iov[0].iov_len = 0; | |
| 2452 | − iov[1].iov_base = buf; | |
| 2453 | − iov[1].iov_len = sizeof(struct smb2_transform_hdr); | |
| 2454 | − iov[2].iov_base = buf + sizeof(struct smb2_transform_hdr); | |
| 2455 | − iov[2].iov_len = buf_data_size; | |
| 2594 | + iov[0].iov_base = buf; | |
| 2595 | + iov[0].iov_len = sizeof(struct smb2_transform_hdr); | |
| 2596 | + iov[1].iov_base = buf + sizeof(struct smb2_transform_hdr); | |
| 2597 | + iov[1].iov_len = buf_data_size; | |
| 2456 | 2598 | |
| 2457 | 2599 | rqst.rq_iov = iov; |
| 2458 | − rqst.rq_nvec = 3; | |
| 2600 | + rqst.rq_nvec = 2; | |
| 2459 | 2601 | rqst.rq_pages = pages; |
| 2460 | 2602 | rqst.rq_npages = npages; |
| 2461 | 2603 | rqst.rq_pagesz = PAGE_SIZE; |
| @@ -2467,7 +2609,7 @@ decrypt_raw_data(struct TCP_Server_Info *server, char *buf, · 5 unmodified lines | ||
| 2467 | 2609 | if (rc) |
| 2468 | 2610 | return rc; |
| 2469 | 2611 | |
| 2470 | − memmove(buf, iov[2].iov_base, buf_data_size); | |
| 2612 | + memmove(buf, iov[1].iov_base, buf_data_size); | |
| 2471 | 2613 | |
| 2472 | 2614 | server->total_read = buf_data_size + page_data_size; |
| 2473 | 2615 | |
| @@ -3170,6 +3312,7 @@ struct smb_version_operations smb311_operations = { · 696 unmodified lines | ||
| 3170 | 3312 | .set_compression = smb2_set_compression, |
| 3171 | 3313 | .mkdir = smb2_mkdir, |
| 3172 | 3314 | .mkdir_setinfo = smb2_mkdir_setinfo, |
| 3315 | + .posix_mkdir = smb311_posix_mkdir, | |
| 3173 | 3316 | .rmdir = smb2_rmdir, |
| 3174 | 3317 | .unlink = smb2_unlink, |
| 3175 | 3318 | .rename = smb2_rename_path, |
| @@ -602,6 +602,7 @@ static void assemble_neg_contexts(struct smb2_negotiate_req *req, · 601 unmodified lines | ||
| 602 | 602 | int |
| 603 | 603 | SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) |
| 604 | 604 | { |
| 605 | + struct smb_rqst rqst; | |
| 605 | 606 | struct smb2_negotiate_req *req; |
| 606 | 607 | struct smb2_negotiate_rsp *rsp; |
| 607 | 608 | struct kvec iov[1]; |
| @@ -673,7 +674,11 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) · 65 unmodified lines | ||
| 673 | 674 | iov[0].iov_base = (char *)req; |
| 674 | 675 | iov[0].iov_len = total_len; |
| 675 | 676 | |
| 676 | − rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov); | |
| 677 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 678 | + rqst.rq_iov = iov; | |
| 679 | + rqst.rq_nvec = 1; | |
| 680 | + | |
| 681 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov); | |
| 677 | 682 | cifs_small_buf_release(req); |
| 678 | 683 | rsp = (struct smb2_negotiate_rsp *)rsp_iov.iov_base; |
| 679 | 684 | /* |
| @@ -990,8 +995,9 @@ SMB2_sess_alloc_buffer(struct SMB2_sess_data *sess_data) · 310 unmodified lines | ||
| 990 | 995 | req->PreviousSessionId = sess_data->previous_session; |
| 991 | 996 | |
| 992 | 997 | req->Flags = 0; /* MBZ */ |
| 993 | − /* to enable echos and oplocks */ | |
| 994 | − req->sync_hdr.CreditRequest = cpu_to_le16(3); | |
| 998 | + | |
| 999 | + /* enough to enable echos and oplocks and one max size write */ | |
| 1000 | + req->sync_hdr.CreditRequest = cpu_to_le16(130); | |
| 995 | 1001 | |
| 996 | 1002 | /* only one of SMB2 signing flags may be set in SMB2 request */ |
| 997 | 1003 | if (server->sign) |
| @@ -1027,6 +1033,7 @@ static int · 29 unmodified lines | ||
| 1027 | 1033 | SMB2_sess_sendreceive(struct SMB2_sess_data *sess_data) |
| 1028 | 1034 | { |
| 1029 | 1035 | int rc; |
| 1036 | + struct smb_rqst rqst; | |
| 1030 | 1037 | struct smb2_sess_setup_req *req = sess_data->iov[0].iov_base; |
| 1031 | 1038 | struct kvec rsp_iov = { NULL, 0 }; |
| 1032 | 1039 | |
| @@ -1035,10 +1042,13 @@ SMB2_sess_sendreceive(struct SMB2_sess_data *sess_data) · 2 unmodified lines | ||
| 1035 | 1042 | cpu_to_le16(sizeof(struct smb2_sess_setup_req) - 1 /* pad */); |
| 1036 | 1043 | req->SecurityBufferLength = cpu_to_le16(sess_data->iov[1].iov_len); |
| 1037 | 1044 | |
| 1038 | − /* BB add code to build os and lm fields */ | |
| 1045 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 1046 | + rqst.rq_iov = sess_data->iov; | |
| 1047 | + rqst.rq_nvec = 2; | |
| 1039 | 1048 | |
| 1040 | − rc = smb2_send_recv(sess_data->xid, sess_data->ses, | |
| 1041 | − sess_data->iov, 2, | |
| 1049 | + /* BB add code to build os and lm fields */ | |
| 1050 | + rc = cifs_send_recv(sess_data->xid, sess_data->ses, | |
| 1051 | + &rqst, | |
| 1042 | 1052 | &sess_data->buf0_type, |
| 1043 | 1053 | CIFS_LOG_ERROR | CIFS_NEG_OP, &rsp_iov); |
| 1044 | 1054 | cifs_small_buf_release(sess_data->iov[0].iov_base); |
| @@ -1376,6 +1386,7 @@ out: · 331 unmodified lines | ||
| 1376 | 1386 | int |
| 1377 | 1387 | SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) |
| 1378 | 1388 | { |
| 1389 | + struct smb_rqst rqst; | |
| 1379 | 1390 | struct smb2_logoff_req *req; /* response is also trivial struct */ |
| 1380 | 1391 | int rc = 0; |
| 1381 | 1392 | struct TCP_Server_Info *server; |
| @@ -1413,7 +1424,11 @@ SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) · 31 unmodified lines | ||
| 1413 | 1424 | iov[0].iov_base = (char *)req; |
| 1414 | 1425 | iov[0].iov_len = total_len; |
| 1415 | 1426 | |
| 1416 | − rc = smb2_send_recv(xid, ses, iov, 1, &resp_buf_type, flags, &rsp_iov); | |
| 1427 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 1428 | + rqst.rq_iov = iov; | |
| 1429 | + rqst.rq_nvec = 1; | |
| 1430 | + | |
| 1431 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buf_type, flags, &rsp_iov); | |
| 1417 | 1432 | cifs_small_buf_release(req); |
| 1418 | 1433 | /* |
| 1419 | 1434 | * No tcon so can't do |
| @@ -1443,6 +1458,7 @@ int · 23 unmodified lines | ||
| 1443 | 1458 | SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, |
| 1444 | 1459 | struct cifs_tcon *tcon, const struct nls_table *cp) |
| 1445 | 1460 | { |
| 1461 | + struct smb_rqst rqst; | |
| 1446 | 1462 | struct smb2_tree_connect_req *req; |
| 1447 | 1463 | struct smb2_tree_connect_rsp *rsp = NULL; |
| 1448 | 1464 | struct kvec iov[2]; |
| @@ -1499,7 +1515,11 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, · 50 unmodified lines | ||
| 1499 | 1515 | !smb3_encryption_required(tcon)) |
| 1500 | 1516 | req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED; |
| 1501 | 1517 | |
| 1502 | − rc = smb2_send_recv(xid, ses, iov, 2, &resp_buftype, flags, &rsp_iov); | |
| 1518 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 1519 | + rqst.rq_iov = iov; | |
| 1520 | + rqst.rq_nvec = 2; | |
| 1521 | + | |
| 1522 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov); | |
| 1503 | 1523 | cifs_small_buf_release(req); |
| 1504 | 1524 | rsp = (struct smb2_tree_connect_rsp *)rsp_iov.iov_base; |
| 1505 | 1525 | |
| @@ -1563,6 +1583,7 @@ tcon_error_exit: · 57 unmodified lines | ||
| 1563 | 1583 | int |
| 1564 | 1584 | SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon) |
| 1565 | 1585 | { |
| 1586 | + struct smb_rqst rqst; | |
| 1566 | 1587 | struct smb2_tree_disconnect_req *req; /* response is trivial */ |
| 1567 | 1588 | int rc = 0; |
| 1568 | 1589 | struct cifs_ses *ses = tcon->ses; |
| @@ -1593,7 +1614,11 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon) · 24 unmodified lines | ||
| 1593 | 1614 | iov[0].iov_base = (char *)req; |
| 1594 | 1615 | iov[0].iov_len = total_len; |
| 1595 | 1616 | |
| 1596 | − rc = smb2_send_recv(xid, ses, iov, 1, &resp_buf_type, flags, &rsp_iov); | |
| 1617 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 1618 | + rqst.rq_iov = iov; | |
| 1619 | + rqst.rq_nvec = 1; | |
| 1620 | + | |
| 1621 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buf_type, flags, &rsp_iov); | |
| 1597 | 1622 | cifs_small_buf_release(req); |
| 1598 | 1623 | if (rc) |
| 1599 | 1624 | cifs_stats_fail_inc(tcon, SMB2_TREE_DISCONNECT_HE); |
| @@ -1886,11 +1911,165 @@ alloc_path_with_tree_prefix(__le16 **out_path, int *out_size, int *out_len, · 286 unmodified lines | ||
| 1886 | 1911 | return 0; |
| 1887 | 1912 | } |
| 1888 | 1913 | |
| 1914 | +#ifdef CONFIG_CIFS_SMB311 | |
| 1915 | +int smb311_posix_mkdir(const unsigned int xid, struct inode *inode, | |
| 1916 | + umode_t mode, struct cifs_tcon *tcon, | |
| 1917 | + const char *full_path, | |
| 1918 | + struct cifs_sb_info *cifs_sb) | |
| 1919 | +{ | |
| 1920 | + struct smb_rqst rqst; | |
| 1921 | + struct smb2_create_req *req; | |
| 1922 | + struct smb2_create_rsp *rsp; | |
| 1923 | + struct TCP_Server_Info *server; | |
| 1924 | + struct cifs_ses *ses = tcon->ses; | |
| 1925 | + struct kvec iov[3]; /* make sure at least one for each open context */ | |
| 1926 | + struct kvec rsp_iov = {NULL, 0}; | |
| 1927 | + int resp_buftype; | |
| 1928 | + int uni_path_len; | |
| 1929 | + __le16 *copy_path = NULL; | |
| 1930 | + int copy_size; | |
| 1931 | + int rc = 0; | |
| 1932 | + unsigned int n_iov = 2; | |
| 1933 | + __u32 file_attributes = 0; | |
| 1934 | + char *pc_buf = NULL; | |
| 1935 | + int flags = 0; | |
| 1936 | + unsigned int total_len; | |
| 1937 | + __le16 *path = cifs_convert_path_to_utf16(full_path, cifs_sb); | |
| 1938 | + | |
| 1939 | + if (!path) | |
| 1940 | + return -ENOMEM; | |
| 1941 | + | |
| 1942 | + cifs_dbg(FYI, "mkdir\n"); | |
| 1943 | + | |
| 1944 | + if (ses && (ses->server)) | |
| 1945 | + server = ses->server; | |
| 1946 | + else | |
| 1947 | + return -EIO; | |
| 1948 | + | |
| 1949 | + rc = smb2_plain_req_init(SMB2_CREATE, tcon, (void **) &req, &total_len); | |
| 1950 | + | |
| 1951 | + if (rc) | |
| 1952 | + return rc; | |
| 1953 | + | |
| 1954 | + if (smb3_encryption_required(tcon)) | |
| 1955 | + flags |= CIFS_TRANSFORM_REQ; | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + req->ImpersonationLevel = IL_IMPERSONATION; | |
| 1959 | + req->DesiredAccess = cpu_to_le32(FILE_WRITE_ATTRIBUTES); | |
| 1960 | + /* File attributes ignored on open (used in create though) */ | |
| 1961 | + req->FileAttributes = cpu_to_le32(file_attributes); | |
| 1962 | + req->ShareAccess = FILE_SHARE_ALL_LE; | |
| 1963 | + req->CreateDisposition = cpu_to_le32(FILE_CREATE); | |
| 1964 | + req->CreateOptions = cpu_to_le32(CREATE_NOT_FILE); | |
| 1965 | + | |
| 1966 | + iov[0].iov_base = (char *)req; | |
| 1967 | + /* -1 since last byte is buf[0] which is sent below (path) */ | |
| 1968 | + iov[0].iov_len = total_len - 1; | |
| 1969 | + | |
| 1970 | + req->NameOffset = cpu_to_le16(sizeof(struct smb2_create_req)); | |
| 1971 | + | |
| 1972 | + /* [MS-SMB2] 2.2.13 NameOffset: | |
| 1973 | + * If SMB2_FLAGS_DFS_OPERATIONS is set in the Flags field of | |
| 1974 | + * the SMB2 header, the file name includes a prefix that will | |
| 1975 | + * be processed during DFS name normalization as specified in | |
| 1976 | + * section 3.3.5.9. Otherwise, the file name is relative to | |
| 1977 | + * the share that is identified by the TreeId in the SMB2 | |
| 1978 | + * header. | |
| 1979 | + */ | |
| 1980 | + if (tcon->share_flags & SHI1005_FLAGS_DFS) { | |
| 1981 | + int name_len; | |
| 1982 | + | |
| 1983 | + req->sync_hdr.Flags |= SMB2_FLAGS_DFS_OPERATIONS; | |
| 1984 | + rc = alloc_path_with_tree_prefix(©_path, ©_size, | |
| 1985 | + &name_len, | |
| 1986 | + tcon->treeName, path); | |
| 1987 | + if (rc) { | |
| 1988 | + cifs_small_buf_release(req); | |
| 1989 | + return rc; | |
| 1990 | + } | |
| 1991 | + req->NameLength = cpu_to_le16(name_len * 2); | |
| 1992 | + uni_path_len = copy_size; | |
| 1993 | + path = copy_path; | |
| 1994 | + } else { | |
| 1995 | + uni_path_len = (2 * UniStrnlen((wchar_t *)path, PATH_MAX)) + 2; | |
| 1996 | + /* MUST set path len (NameLength) to 0 opening root of share */ | |
| 1997 | + req->NameLength = cpu_to_le16(uni_path_len - 2); | |
| 1998 | + if (uni_path_len % 8 != 0) { | |
| 1999 | + copy_size = roundup(uni_path_len, 8); | |
| 2000 | + copy_path = kzalloc(copy_size, GFP_KERNEL); | |
| 2001 | + if (!copy_path) { | |
| 2002 | + cifs_small_buf_release(req); | |
| 2003 | + return -ENOMEM; | |
| 2004 | + } | |
| 2005 | + memcpy((char *)copy_path, (const char *)path, | |
| 2006 | + uni_path_len); | |
| 2007 | + uni_path_len = copy_size; | |
| 2008 | + path = copy_path; | |
| 2009 | + } | |
| 2010 | + } | |
| 2011 | + | |
| 2012 | + iov[1].iov_len = uni_path_len; | |
| 2013 | + iov[1].iov_base = path; | |
| 2014 | + req->RequestedOplockLevel = SMB2_OPLOCK_LEVEL_NONE; | |
| 2015 | + | |
| 2016 | + if (tcon->posix_extensions) { | |
| 2017 | + if (n_iov > 2) { | |
| 2018 | + struct create_context *ccontext = | |
| 2019 | + (struct create_context *)iov[n_iov-1].iov_base; | |
| 2020 | + ccontext->Next = | |
| 2021 | + cpu_to_le32(iov[n_iov-1].iov_len); | |
| 2022 | + } | |
| 2023 | + | |
| 2024 | + rc = add_posix_context(iov, &n_iov, mode); | |
| 2025 | + if (rc) { | |
| 2026 | + cifs_small_buf_release(req); | |
| 2027 | + kfree(copy_path); | |
| 2028 | + return rc; | |
| 2029 | + } | |
| 2030 | + pc_buf = iov[n_iov-1].iov_base; | |
| 2031 | + } | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 2035 | + rqst.rq_iov = iov; | |
| 2036 | + rqst.rq_nvec = n_iov; | |
| 2037 | + | |
| 2038 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, | |
| 2039 | + &rsp_iov); | |
| 2040 | + | |
| 2041 | + cifs_small_buf_release(req); | |
| 2042 | + rsp = (struct smb2_create_rsp *)rsp_iov.iov_base; | |
| 2043 | + | |
| 2044 | + if (rc != 0) { | |
| 2045 | + cifs_stats_fail_inc(tcon, SMB2_CREATE_HE); | |
| 2046 | + trace_smb3_posix_mkdir_err(xid, tcon->tid, ses->Suid, | |
| 2047 | + CREATE_NOT_FILE, FILE_WRITE_ATTRIBUTES, rc); | |
| 2048 | + goto smb311_mkdir_exit; | |
| 2049 | + } else | |
| 2050 | + trace_smb3_posix_mkdir_done(xid, rsp->PersistentFileId, tcon->tid, | |
| 2051 | + ses->Suid, CREATE_NOT_FILE, | |
| 2052 | + FILE_WRITE_ATTRIBUTES); | |
| 2053 | + | |
| 2054 | + SMB2_close(xid, tcon, rsp->PersistentFileId, rsp->VolatileFileId); | |
| 2055 | + | |
| 2056 | + /* Eventually save off posix specific response info and timestaps */ | |
| 2057 | + | |
| 2058 | +smb311_mkdir_exit: | |
| 2059 | + kfree(copy_path); | |
| 2060 | + kfree(pc_buf); | |
| 2061 | + free_rsp_buf(resp_buftype, rsp); | |
| 2062 | + return rc; | |
| 2063 | + | |
| 2064 | +} | |
| 2065 | +#endif /* SMB311 */ | |
| 2066 | + | |
| 1889 | 2067 | int |
| 1890 | 2068 | SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, |
| 1891 | 2069 | __u8 *oplock, struct smb2_file_all_info *buf, |
| 1892 | 2070 | struct kvec *err_iov, int *buftype) |
| 1893 | 2071 | { |
| 2072 | + struct smb_rqst rqst; | |
| 1894 | 2073 | struct smb2_create_req *req; |
| 1895 | 2074 | struct smb2_create_rsp *rsp; |
| 1896 | 2075 | struct TCP_Server_Info *server; |
| @@ -2043,7 +2222,11 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, · 146 unmodified lines | ||
| 2043 | 2222 | } |
| 2044 | 2223 | #endif /* SMB311 */ |
| 2045 | 2224 | |
| 2046 | − rc = smb2_send_recv(xid, ses, iov, n_iov, &resp_buftype, flags, | |
| 2225 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 2226 | + rqst.rq_iov = iov; | |
| 2227 | + rqst.rq_nvec = n_iov; | |
| 2228 | + | |
| 2229 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, | |
| 2047 | 2230 | &rsp_iov); |
| 2048 | 2231 | cifs_small_buf_release(req); |
| 2049 | 2232 | rsp = (struct smb2_create_rsp *)rsp_iov.iov_base; |
| @@ -2099,6 +2282,7 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, · 49 unmodified lines | ||
| 2099 | 2282 | char *in_data, u32 indatalen, |
| 2100 | 2283 | char **out_data, u32 *plen /* returned data len */) |
| 2101 | 2284 | { |
| 2285 | + struct smb_rqst rqst; | |
| 2102 | 2286 | struct smb2_ioctl_req *req; |
| 2103 | 2287 | struct smb2_ioctl_rsp *rsp; |
| 2104 | 2288 | struct cifs_ses *ses; |
| @@ -2189,7 +2373,11 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, · 84 unmodified lines | ||
| 2189 | 2373 | if (opcode == FSCTL_VALIDATE_NEGOTIATE_INFO) |
| 2190 | 2374 | req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED; |
| 2191 | 2375 | |
| 2192 | − rc = smb2_send_recv(xid, ses, iov, n_iov, &resp_buftype, flags, | |
| 2376 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 2377 | + rqst.rq_iov = iov; | |
| 2378 | + rqst.rq_nvec = n_iov; | |
| 2379 | + | |
| 2380 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, | |
| 2193 | 2381 | &rsp_iov); |
| 2194 | 2382 | cifs_small_buf_release(req); |
| 2195 | 2383 | rsp = (struct smb2_ioctl_rsp *)rsp_iov.iov_base; |
| @@ -2274,6 +2462,7 @@ int · 78 unmodified lines | ||
| 2274 | 2462 | SMB2_close_flags(const unsigned int xid, struct cifs_tcon *tcon, |
| 2275 | 2463 | u64 persistent_fid, u64 volatile_fid, int flags) |
| 2276 | 2464 | { |
| 2465 | + struct smb_rqst rqst; | |
| 2277 | 2466 | struct smb2_close_req *req; |
| 2278 | 2467 | struct smb2_close_rsp *rsp; |
| 2279 | 2468 | struct cifs_ses *ses = tcon->ses; |
| @@ -2301,7 +2490,11 @@ SMB2_close_flags(const unsigned int xid, struct cifs_tcon *tcon, · 21 unmodified lines | ||
| 2301 | 2490 | iov[0].iov_base = (char *)req; |
| 2302 | 2491 | iov[0].iov_len = total_len; |
| 2303 | 2492 | |
| 2304 | − rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov); | |
| 2493 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 2494 | + rqst.rq_iov = iov; | |
| 2495 | + rqst.rq_nvec = 1; | |
| 2496 | + | |
| 2497 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov); | |
| 2305 | 2498 | cifs_small_buf_release(req); |
| 2306 | 2499 | rsp = (struct smb2_close_rsp *)rsp_iov.iov_base; |
| 2307 | 2500 | |
| @@ -2387,6 +2580,7 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon, · 79 unmodified lines | ||
| 2387 | 2580 | u32 additional_info, size_t output_len, size_t min_len, void **data, |
| 2388 | 2581 | u32 *dlen) |
| 2389 | 2582 | { |
| 2583 | + struct smb_rqst rqst; | |
| 2390 | 2584 | struct smb2_query_info_req *req; |
| 2391 | 2585 | struct smb2_query_info_rsp *rsp = NULL; |
| 2392 | 2586 | struct kvec iov[2]; |
| @@ -2427,7 +2621,11 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon, · 34 unmodified lines | ||
| 2427 | 2621 | /* 1 for Buffer */ |
| 2428 | 2622 | iov[0].iov_len = total_len - 1; |
| 2429 | 2623 | |
| 2430 | − rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov); | |
| 2624 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 2625 | + rqst.rq_iov = iov; | |
| 2626 | + rqst.rq_nvec = 1; | |
| 2627 | + | |
| 2628 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov); | |
| 2431 | 2629 | cifs_small_buf_release(req); |
| 2432 | 2630 | rsp = (struct smb2_query_info_rsp *)rsp_iov.iov_base; |
| 2433 | 2631 | |
| @@ -2594,11 +2792,10 @@ SMB2_echo(struct TCP_Server_Info *server) · 160 unmodified lines | ||
| 2594 | 2792 | { |
| 2595 | 2793 | struct smb2_echo_req *req; |
| 2596 | 2794 | int rc = 0; |
| 2597 | − struct kvec iov[2]; | |
| 2795 | + struct kvec iov[1]; | |
| 2598 | 2796 | struct smb_rqst rqst = { .rq_iov = iov, |
| 2599 | − .rq_nvec = 2 }; | |
| 2797 | + .rq_nvec = 1 }; | |
| 2600 | 2798 | unsigned int total_len; |
| 2601 | − __be32 rfc1002_marker; | |
| 2602 | 2799 | |
| 2603 | 2800 | cifs_dbg(FYI, "In echo request\n"); |
| 2604 | 2801 | |
| @@ -2614,11 +2811,8 @@ SMB2_echo(struct TCP_Server_Info *server) · 9 unmodified lines | ||
| 2614 | 2811 | |
| 2615 | 2812 | req->sync_hdr.CreditRequest = cpu_to_le16(1); |
| 2616 | 2813 | |
| 2617 | − iov[0].iov_len = 4; | |
| 2618 | − rfc1002_marker = cpu_to_be32(total_len); | |
| 2619 | − iov[0].iov_base = &rfc1002_marker; | |
| 2620 | − iov[1].iov_len = total_len; | |
| 2621 | − iov[1].iov_base = (char *)req; | |
| 2814 | + iov[0].iov_len = total_len; | |
| 2815 | + iov[0].iov_base = (char *)req; | |
| 2622 | 2816 | |
| 2623 | 2817 | rc = cifs_call_async(server, &rqst, NULL, smb2_echo_callback, NULL, |
| 2624 | 2818 | server, CIFS_ECHO_OP); |
| @@ -2633,6 +2827,7 @@ int · 8 unmodified lines | ||
| 2633 | 2827 | SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, |
| 2634 | 2828 | u64 volatile_fid) |
| 2635 | 2829 | { |
| 2830 | + struct smb_rqst rqst; | |
| 2636 | 2831 | struct smb2_flush_req *req; |
| 2637 | 2832 | struct cifs_ses *ses = tcon->ses; |
| 2638 | 2833 | struct kvec iov[1]; |
| @@ -2660,7 +2855,11 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, · 21 unmodified lines | ||
| 2660 | 2855 | iov[0].iov_base = (char *)req; |
| 2661 | 2856 | iov[0].iov_len = total_len; |
| 2662 | 2857 | |
| 2663 | − rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov); | |
| 2858 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 2859 | + rqst.rq_iov = iov; | |
| 2860 | + rqst.rq_nvec = 1; | |
| 2861 | + | |
| 2862 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov); | |
| 2664 | 2863 | cifs_small_buf_release(req); |
| 2665 | 2864 | |
| 2666 | 2865 | if (rc != 0) { |
| @@ -2848,10 +3047,9 @@ smb2_async_readv(struct cifs_readdata *rdata) · 181 unmodified lines | ||
| 2848 | 3047 | struct smb2_sync_hdr *shdr; |
| 2849 | 3048 | struct cifs_io_parms io_parms; |
| 2850 | 3049 | struct smb_rqst rqst = { .rq_iov = rdata->iov, |
| 2851 | − .rq_nvec = 2 }; | |
| 3050 | + .rq_nvec = 1 }; | |
| 2852 | 3051 | struct TCP_Server_Info *server; |
| 2853 | 3052 | unsigned int total_len; |
| 2854 | − __be32 req_len; | |
| 2855 | 3053 | |
| 2856 | 3054 | cifs_dbg(FYI, "%s: offset=%llu bytes=%u\n", |
| 2857 | 3055 | __func__, rdata->offset, rdata->bytes); |
| @@ -2882,12 +3080,8 @@ smb2_async_readv(struct cifs_readdata *rdata) · 24 unmodified lines | ||
| 2882 | 3080 | if (smb3_encryption_required(io_parms.tcon)) |
| 2883 | 3081 | flags |= CIFS_TRANSFORM_REQ; |
| 2884 | 3082 | |
| 2885 | − req_len = cpu_to_be32(total_len); | |
| 2886 | − | |
| 2887 | − rdata->iov[0].iov_base = &req_len; | |
| 2888 | − rdata->iov[0].iov_len = sizeof(__be32); | |
| 2889 | − rdata->iov[1].iov_base = buf; | |
| 2890 | − rdata->iov[1].iov_len = total_len; | |
| 3083 | + rdata->iov[0].iov_base = buf; | |
| 3084 | + rdata->iov[0].iov_len = total_len; | |
| 2891 | 3085 | |
| 2892 | 3086 | shdr = (struct smb2_sync_hdr *)buf; |
| 2893 | 3087 | |
| @@ -2926,6 +3120,7 @@ int · 32 unmodified lines | ||
| 2926 | 3120 | SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, |
| 2927 | 3121 | unsigned int *nbytes, char **buf, int *buf_type) |
| 2928 | 3122 | { |
| 3123 | + struct smb_rqst rqst; | |
| 2929 | 3124 | int resp_buftype, rc = -EACCES; |
| 2930 | 3125 | struct smb2_read_plain_req *req = NULL; |
| 2931 | 3126 | struct smb2_read_rsp *rsp = NULL; |
| @@ -2946,7 +3141,11 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, · 14 unmodified lines | ||
| 2946 | 3141 | iov[0].iov_base = (char *)req; |
| 2947 | 3142 | iov[0].iov_len = total_len; |
| 2948 | 3143 | |
| 2949 | − rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov); | |
| 3144 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 3145 | + rqst.rq_iov = iov; | |
| 3146 | + rqst.rq_nvec = 1; | |
| 3147 | + | |
| 3148 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov); | |
| 2950 | 3149 | cifs_small_buf_release(req); |
| 2951 | 3150 | |
| 2952 | 3151 | rsp = (struct smb2_read_rsp *)rsp_iov.iov_base; |
| @@ -3062,10 +3261,9 @@ smb2_async_writev(struct cifs_writedata *wdata, · 109 unmodified lines | ||
| 3062 | 3261 | struct smb2_sync_hdr *shdr; |
| 3063 | 3262 | struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink); |
| 3064 | 3263 | struct TCP_Server_Info *server = tcon->ses->server; |
| 3065 | − struct kvec iov[2]; | |
| 3264 | + struct kvec iov[1]; | |
| 3066 | 3265 | struct smb_rqst rqst = { }; |
| 3067 | 3266 | unsigned int total_len; |
| 3068 | − __be32 rfc1002_marker; | |
| 3069 | 3267 | |
| 3070 | 3268 | rc = smb2_plain_req_init(SMB2_WRITE, tcon, (void **) &req, &total_len); |
| 3071 | 3269 | if (rc) { |
| @@ -3137,15 +3335,11 @@ smb2_async_writev(struct cifs_writedata *wdata, · 65 unmodified lines | ||
| 3137 | 3335 | v1->length = cpu_to_le32(wdata->mr->mr->length); |
| 3138 | 3336 | } |
| 3139 | 3337 | #endif |
| 3140 | − /* 4 for rfc1002 length field and 1 for Buffer */ | |
| 3141 | − iov[0].iov_len = 4; | |
| 3142 | − rfc1002_marker = cpu_to_be32(total_len - 1 + wdata->bytes); | |
| 3143 | − iov[0].iov_base = &rfc1002_marker; | |
| 3144 | − iov[1].iov_len = total_len - 1; | |
| 3145 | − iov[1].iov_base = (char *)req; | |
| 3338 | + iov[0].iov_len = total_len - 1; | |
| 3339 | + iov[0].iov_base = (char *)req; | |
| 3146 | 3340 | |
| 3147 | 3341 | rqst.rq_iov = iov; |
| 3148 | − rqst.rq_nvec = 2; | |
| 3342 | + rqst.rq_nvec = 1; | |
| 3149 | 3343 | rqst.rq_pages = wdata->pages; |
| 3150 | 3344 | rqst.rq_offset = wdata->page_offset; |
| 3151 | 3345 | rqst.rq_npages = wdata->nr_pages; |
| @@ -3153,7 +3347,7 @@ smb2_async_writev(struct cifs_writedata *wdata, · 1 unmodified line | ||
| 3153 | 3347 | rqst.rq_tailsz = wdata->tailsz; |
| 3154 | 3348 | #ifdef CONFIG_CIFS_SMB_DIRECT |
| 3155 | 3349 | if (wdata->mr) { |
| 3156 | − iov[1].iov_len += sizeof(struct smbd_buffer_descriptor_v1); | |
| 3350 | + iov[0].iov_len += sizeof(struct smbd_buffer_descriptor_v1); | |
| 3157 | 3351 | rqst.rq_npages = 0; |
| 3158 | 3352 | } |
| 3159 | 3353 | #endif |
| @@ -3210,6 +3404,7 @@ int · 50 unmodified lines | ||
| 3210 | 3404 | SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, |
| 3211 | 3405 | unsigned int *nbytes, struct kvec *iov, int n_vec) |
| 3212 | 3406 | { |
| 3407 | + struct smb_rqst rqst; | |
| 3213 | 3408 | int rc = 0; |
| 3214 | 3409 | struct smb2_write_req *req = NULL; |
| 3215 | 3410 | struct smb2_write_rsp *rsp = NULL; |
| @@ -3251,7 +3446,11 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, · 35 unmodified lines | ||
| 3251 | 3446 | /* 1 for Buffer */ |
| 3252 | 3447 | iov[0].iov_len = total_len - 1; |
| 3253 | 3448 | |
| 3254 | − rc = smb2_send_recv(xid, io_parms->tcon->ses, iov, n_vec + 1, | |
| 3449 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 3450 | + rqst.rq_iov = iov; | |
| 3451 | + rqst.rq_nvec = n_vec + 1; | |
| 3452 | + | |
| 3453 | + rc = cifs_send_recv(xid, io_parms->tcon->ses, &rqst, | |
| 3255 | 3454 | &resp_buftype, flags, &rsp_iov); |
| 3256 | 3455 | cifs_small_buf_release(req); |
| 3257 | 3456 | rsp = (struct smb2_write_rsp *)rsp_iov.iov_base; |
| @@ -3323,6 +3522,7 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, · 65 unmodified lines | ||
| 3323 | 3522 | u64 persistent_fid, u64 volatile_fid, int index, |
| 3324 | 3523 | struct cifs_search_info *srch_inf) |
| 3325 | 3524 | { |
| 3525 | + struct smb_rqst rqst; | |
| 3326 | 3526 | struct smb2_query_directory_req *req; |
| 3327 | 3527 | struct smb2_query_directory_rsp *rsp = NULL; |
| 3328 | 3528 | struct kvec iov[2]; |
| @@ -3395,7 +3595,11 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, · 66 unmodified lines | ||
| 3395 | 3595 | iov[1].iov_base = (char *)(req->Buffer); |
| 3396 | 3596 | iov[1].iov_len = len; |
| 3397 | 3597 | |
| 3398 | − rc = smb2_send_recv(xid, ses, iov, 2, &resp_buftype, flags, &rsp_iov); | |
| 3598 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 3599 | + rqst.rq_iov = iov; | |
| 3600 | + rqst.rq_nvec = 2; | |
| 3601 | + | |
| 3602 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov); | |
| 3399 | 3603 | cifs_small_buf_release(req); |
| 3400 | 3604 | rsp = (struct smb2_query_directory_rsp *)rsp_iov.iov_base; |
| 3401 | 3605 | |
| @@ -3454,6 +3658,7 @@ send_set_info(const unsigned int xid, struct cifs_tcon *tcon, · 52 unmodified lines | ||
| 3454 | 3658 | u8 info_type, u32 additional_info, unsigned int num, |
| 3455 | 3659 | void **data, unsigned int *size) |
| 3456 | 3660 | { |
| 3661 | + struct smb_rqst rqst; | |
| 3457 | 3662 | struct smb2_set_info_req *req; |
| 3458 | 3663 | struct smb2_set_info_rsp *rsp = NULL; |
| 3459 | 3664 | struct kvec *iov; |
| @@ -3509,7 +3714,11 @@ send_set_info(const unsigned int xid, struct cifs_tcon *tcon, · 49 unmodified lines | ||
| 3509 | 3714 | iov[i].iov_len = size[i]; |
| 3510 | 3715 | } |
| 3511 | 3716 | |
| 3512 | − rc = smb2_send_recv(xid, ses, iov, num, &resp_buftype, flags, | |
| 3717 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 3718 | + rqst.rq_iov = iov; | |
| 3719 | + rqst.rq_nvec = num; | |
| 3720 | + | |
| 3721 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, | |
| 3513 | 3722 | &rsp_iov); |
| 3514 | 3723 | cifs_small_buf_release(req); |
| 3515 | 3724 | rsp = (struct smb2_set_info_rsp *)rsp_iov.iov_base; |
| @@ -3664,6 +3873,7 @@ SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon, · 148 unmodified lines | ||
| 3664 | 3873 | const u64 persistent_fid, const u64 volatile_fid, |
| 3665 | 3874 | __u8 oplock_level) |
| 3666 | 3875 | { |
| 3876 | + struct smb_rqst rqst; | |
| 3667 | 3877 | int rc; |
| 3668 | 3878 | struct smb2_oplock_break *req = NULL; |
| 3669 | 3879 | struct cifs_ses *ses = tcon->ses; |
| @@ -3692,7 +3902,11 @@ SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon, · 22 unmodified lines | ||
| 3692 | 3902 | iov[0].iov_base = (char *)req; |
| 3693 | 3903 | iov[0].iov_len = total_len; |
| 3694 | 3904 | |
| 3695 | − rc = smb2_send_recv(xid, ses, iov, 1, &resp_buf_type, flags, &rsp_iov); | |
| 3905 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 3906 | + rqst.rq_iov = iov; | |
| 3907 | + rqst.rq_nvec = 1; | |
| 3908 | + | |
| 3909 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buf_type, flags, &rsp_iov); | |
| 3696 | 3910 | cifs_small_buf_release(req); |
| 3697 | 3911 | |
| 3698 | 3912 | if (rc) { |
| @@ -3755,6 +3969,7 @@ int · 56 unmodified lines | ||
| 3755 | 3969 | SMB2_QFS_info(const unsigned int xid, struct cifs_tcon *tcon, |
| 3756 | 3970 | u64 persistent_fid, u64 volatile_fid, struct kstatfs *fsdata) |
| 3757 | 3971 | { |
| 3972 | + struct smb_rqst rqst; | |
| 3758 | 3973 | struct smb2_query_info_rsp *rsp = NULL; |
| 3759 | 3974 | struct kvec iov; |
| 3760 | 3975 | struct kvec rsp_iov; |
| @@ -3773,7 +3988,11 @@ SMB2_QFS_info(const unsigned int xid, struct cifs_tcon *tcon, · 12 unmodified lines | ||
| 3773 | 3988 | if (smb3_encryption_required(tcon)) |
| 3774 | 3989 | flags |= CIFS_TRANSFORM_REQ; |
| 3775 | 3990 | |
| 3776 | − rc = smb2_send_recv(xid, ses, &iov, 1, &resp_buftype, flags, &rsp_iov); | |
| 3991 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 3992 | + rqst.rq_iov = &iov; | |
| 3993 | + rqst.rq_nvec = 1; | |
| 3994 | + | |
| 3995 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov); | |
| 3777 | 3996 | cifs_small_buf_release(iov.iov_base); |
| 3778 | 3997 | if (rc) { |
| 3779 | 3998 | cifs_stats_fail_inc(tcon, SMB2_QUERY_INFO_HE); |
| @@ -3798,6 +4017,7 @@ int · 18 unmodified lines | ||
| 3798 | 4017 | SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon, |
| 3799 | 4018 | u64 persistent_fid, u64 volatile_fid, int level) |
| 3800 | 4019 | { |
| 4020 | + struct smb_rqst rqst; | |
| 3801 | 4021 | struct smb2_query_info_rsp *rsp = NULL; |
| 3802 | 4022 | struct kvec iov; |
| 3803 | 4023 | struct kvec rsp_iov; |
| @@ -3829,7 +4049,11 @@ SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon, · 25 unmodified lines | ||
| 3829 | 4049 | if (smb3_encryption_required(tcon)) |
| 3830 | 4050 | flags |= CIFS_TRANSFORM_REQ; |
| 3831 | 4051 | |
| 3832 | − rc = smb2_send_recv(xid, ses, &iov, 1, &resp_buftype, flags, &rsp_iov); | |
| 4052 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 4053 | + rqst.rq_iov = &iov; | |
| 4054 | + rqst.rq_nvec = 1; | |
| 4055 | + | |
| 4056 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov); | |
| 3833 | 4057 | cifs_small_buf_release(iov.iov_base); |
| 3834 | 4058 | if (rc) { |
| 3835 | 4059 | cifs_stats_fail_inc(tcon, SMB2_QUERY_INFO_HE); |
| @@ -3868,6 +4092,7 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, · 32 unmodified lines | ||
| 3868 | 4092 | const __u64 persist_fid, const __u64 volatile_fid, const __u32 pid, |
| 3869 | 4093 | const __u32 num_lock, struct smb2_lock_element *buf) |
| 3870 | 4094 | { |
| 4095 | + struct smb_rqst rqst; | |
| 3871 | 4096 | int rc = 0; |
| 3872 | 4097 | struct smb2_lock_req *req = NULL; |
| 3873 | 4098 | struct kvec iov[2]; |
| @@ -3900,7 +4125,12 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, · 26 unmodified lines | ||
| 3900 | 4125 | iov[1].iov_len = count; |
| 3901 | 4126 | |
| 3902 | 4127 | cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); |
| 3903 | − rc = smb2_send_recv(xid, tcon->ses, iov, 2, &resp_buf_type, flags, | |
| 4128 | + | |
| 4129 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 4130 | + rqst.rq_iov = iov; | |
| 4131 | + rqst.rq_nvec = 2; | |
| 4132 | + | |
| 4133 | + rc = cifs_send_recv(xid, tcon->ses, &rqst, &resp_buf_type, flags, | |
| 3904 | 4134 | &rsp_iov); |
| 3905 | 4135 | cifs_small_buf_release(req); |
| 3906 | 4136 | if (rc) { |
| @@ -3934,6 +4164,7 @@ int · 27 unmodified lines | ||
| 3934 | 4164 | SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon, |
| 3935 | 4165 | __u8 *lease_key, const __le32 lease_state) |
| 3936 | 4166 | { |
| 4167 | + struct smb_rqst rqst; | |
| 3937 | 4168 | int rc; |
| 3938 | 4169 | struct smb2_lease_ack *req = NULL; |
| 3939 | 4170 | struct cifs_ses *ses = tcon->ses; |
| @@ -3964,7 +4195,11 @@ SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon, · 24 unmodified lines | ||
| 3964 | 4195 | iov[0].iov_base = (char *)req; |
| 3965 | 4196 | iov[0].iov_len = total_len; |
| 3966 | 4197 | |
| 3967 | − rc = smb2_send_recv(xid, ses, iov, 1, &resp_buf_type, flags, &rsp_iov); | |
| 4198 | + memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 4199 | + rqst.rq_iov = iov; | |
| 4200 | + rqst.rq_nvec = 1; | |
| 4201 | + | |
| 4202 | + rc = cifs_send_recv(xid, ses, &rqst, &resp_buf_type, flags, &rsp_iov); | |
| 3968 | 4203 | cifs_small_buf_release(req); |
| 3969 | 4204 | |
| 3970 | 4205 | if (rc) { |
| @@ -851,8 +851,11 @@ struct validate_negotiate_info_rsp { · 850 unmodified lines | ||
| 851 | 851 | __le16 Dialect; /* Dialect in use for the connection */ |
| 852 | 852 | } __packed; |
| 853 | 853 | |
| 854 | −#define RSS_CAPABLE 0x00000001 | |
| 855 | −#define RDMA_CAPABLE 0x00000002 | |
| 854 | +#define RSS_CAPABLE cpu_to_le32(0x00000001) | |
| 855 | +#define RDMA_CAPABLE cpu_to_le32(0x00000002) | |
| 856 | + | |
| 857 | +#define INTERNETWORK cpu_to_le16(0x0002) | |
| 858 | +#define INTERNETWORKV6 cpu_to_le16(0x0017) | |
| 856 | 859 | |
| 857 | 860 | struct network_interface_info_ioctl_rsp { |
| 858 | 861 | __le32 Next; /* next interface. zero if this is last one */ |
| @@ -860,7 +863,21 @@ struct network_interface_info_ioctl_rsp { · 1 unmodified line | ||
| 860 | 863 | __le32 Capability; /* RSS or RDMA Capable */ |
| 861 | 864 | __le32 Reserved; |
| 862 | 865 | __le64 LinkSpeed; |
| 863 | − char SockAddr_Storage[128]; | |
| 866 | + __le16 Family; | |
| 867 | + __u8 Buffer[126]; | |
| 868 | +} __packed; | |
| 869 | + | |
| 870 | +struct iface_info_ipv4 { | |
| 871 | + __be16 Port; | |
| 872 | + __be32 IPv4Address; | |
| 873 | + __be64 Reserved; | |
| 874 | +} __packed; | |
| 875 | + | |
| 876 | +struct iface_info_ipv6 { | |
| 877 | + __be16 Port; | |
| 878 | + __be32 FlowInfo; | |
| 879 | + __u8 IPv6Address[16]; | |
| 880 | + __be32 ScopeId; | |
| 864 | 881 | } __packed; |
| 865 | 882 | |
| 866 | 883 | #define NO_FILE_ID 0xFFFFFFFFFFFFFFFFULL /* general ioctls to srv not to file */ |
| @@ -79,6 +79,10 @@ extern int smb2_set_path_size(const unsigned int xid, struct cifs_tcon *tcon, · 78 unmodified lines | ||
| 79 | 79 | struct cifs_sb_info *cifs_sb, bool set_alloc); |
| 80 | 80 | extern int smb2_set_file_info(struct inode *inode, const char *full_path, |
| 81 | 81 | FILE_BASIC_INFO *buf, const unsigned int xid); |
| 82 | +extern int smb311_posix_mkdir(const unsigned int xid, struct inode *inode, | |
| 83 | + umode_t mode, struct cifs_tcon *tcon, | |
| 84 | + const char *full_path, | |
| 85 | + struct cifs_sb_info *cifs_sb); | |
| 82 | 86 | extern int smb2_mkdir(const unsigned int xid, struct cifs_tcon *tcon, |
| 83 | 87 | const char *name, struct cifs_sb_info *cifs_sb); |
| 84 | 88 | extern void smb2_mkdir_setinfo(struct inode *inode, const char *full_path, |
| @@ -109,6 +113,8 @@ extern int smb2_unlock_range(struct cifsFileInfo *cfile, · 24 unmodified lines | ||
| 109 | 113 | extern int smb2_push_mandatory_locks(struct cifsFileInfo *cfile); |
| 110 | 114 | extern void smb2_reconnect_server(struct work_struct *work); |
| 111 | 115 | extern int smb3_crypto_aead_allocate(struct TCP_Server_Info *server); |
| 116 | +extern unsigned long | |
| 117 | +smb2_rqst_len(struct smb_rqst *rqst, bool skip_rfc1002_marker); | |
| 112 | 118 | |
| 113 | 119 | /* |
| 114 | 120 | * SMB2 Worker functions - most of protocol specific implementation details |
| @@ -171,9 +171,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) · 170 unmodified lines | ||
| 171 | 171 | unsigned char smb2_signature[SMB2_HMACSHA256_SIZE]; |
| 172 | 172 | unsigned char *sigptr = smb2_signature; |
| 173 | 173 | struct kvec *iov = rqst->rq_iov; |
| 174 | − int iov_hdr_index = rqst->rq_nvec > 1 ? 1 : 0; | |
| 175 | − struct smb2_sync_hdr *shdr = | |
| 176 | − (struct smb2_sync_hdr *)iov[iov_hdr_index].iov_base; | |
| 174 | + struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)iov[0].iov_base; | |
| 177 | 175 | struct cifs_ses *ses; |
| 178 | 176 | |
| 179 | 177 | ses = smb2_find_smb_ses(server, shdr->SessionId); |
| @@ -204,7 +202,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) · 24 unmodified lines | ||
| 204 | 202 | return rc; |
| 205 | 203 | } |
| 206 | 204 | |
| 207 | − rc = __cifs_calc_signature(rqst, iov_hdr_index, server, sigptr, | |
| 205 | + rc = __cifs_calc_signature(rqst, server, sigptr, | |
| 208 | 206 | &server->secmech.sdeschmacsha256->shash); |
| 209 | 207 | |
| 210 | 208 | if (!rc) |
| @@ -414,9 +412,7 @@ smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) · 203 unmodified lines | ||
| 414 | 412 | unsigned char smb3_signature[SMB2_CMACAES_SIZE]; |
| 415 | 413 | unsigned char *sigptr = smb3_signature; |
| 416 | 414 | struct kvec *iov = rqst->rq_iov; |
| 417 | − int iov_hdr_index = rqst->rq_nvec > 1 ? 1 : 0; | |
| 418 | − struct smb2_sync_hdr *shdr = | |
| 419 | − (struct smb2_sync_hdr *)iov[iov_hdr_index].iov_base; | |
| 415 | + struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)iov[0].iov_base; | |
| 420 | 416 | struct cifs_ses *ses; |
| 421 | 417 | |
| 422 | 418 | ses = smb2_find_smb_ses(server, shdr->SessionId); |
| @@ -447,7 +443,7 @@ smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) · 24 unmodified lines | ||
| 447 | 443 | return rc; |
| 448 | 444 | } |
| 449 | 445 | |
| 450 | − rc = __cifs_calc_signature(rqst, iov_hdr_index, server, sigptr, | |
| 446 | + rc = __cifs_calc_signature(rqst, server, sigptr, | |
| 451 | 447 | &server->secmech.sdesccmacaes->shash); |
| 452 | 448 | |
| 453 | 449 | if (!rc) |
| @@ -462,7 +458,7 @@ smb2_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server) · 8 unmodified lines | ||
| 462 | 458 | { |
| 463 | 459 | int rc = 0; |
| 464 | 460 | struct smb2_sync_hdr *shdr = |
| 465 | − (struct smb2_sync_hdr *)rqst->rq_iov[1].iov_base; | |
| 461 | + (struct smb2_sync_hdr *)rqst->rq_iov[0].iov_base; | |
| 466 | 462 | |
| 467 | 463 | if (!(shdr->Flags & SMB2_FLAGS_SIGNED) || |
| 468 | 464 | server->tcpStatus == CifsNeedNegotiate) |
| @@ -635,7 +631,7 @@ smb2_setup_request(struct cifs_ses *ses, struct smb_rqst *rqst) · 166 unmodified lines | ||
| 635 | 631 | { |
| 636 | 632 | int rc; |
| 637 | 633 | struct smb2_sync_hdr *shdr = |
| 638 | − (struct smb2_sync_hdr *)rqst->rq_iov[1].iov_base; | |
| 634 | + (struct smb2_sync_hdr *)rqst->rq_iov[0].iov_base; | |
| 639 | 635 | struct mid_q_entry *mid; |
| 640 | 636 | |
| 641 | 637 | smb2_seq_num_into_buf(ses->server, shdr); |
| @@ -656,7 +652,7 @@ smb2_setup_async_request(struct TCP_Server_Info *server, struct smb_rqst *rqst) · 14 unmodified lines | ||
| 656 | 652 | { |
| 657 | 653 | int rc; |
| 658 | 654 | struct smb2_sync_hdr *shdr = |
| 659 | − (struct smb2_sync_hdr *)rqst->rq_iov[1].iov_base; | |
| 655 | + (struct smb2_sync_hdr *)rqst->rq_iov[0].iov_base; | |
| 660 | 656 | struct mid_q_entry *mid; |
| 661 | 657 | |
| 662 | 658 | smb2_seq_num_into_buf(server, shdr); |
| @@ -18,6 +18,7 @@ · 17 unmodified lines | ||
| 18 | 18 | #include "smbdirect.h" |
| 19 | 19 | #include "cifs_debug.h" |
| 20 | 20 | #include "cifsproto.h" |
| 21 | +#include "smb2proto.h" | |
| 21 | 22 | |
| 22 | 23 | static struct smbd_response *get_empty_queue_buffer( |
| 23 | 24 | struct smbd_connection *info); |
| @@ -2087,7 +2088,7 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) · 2063 unmodified lines | ||
| 2087 | 2088 | struct kvec vec; |
| 2088 | 2089 | int nvecs; |
| 2089 | 2090 | int size; |
| 2090 | − unsigned int buflen = 0, remaining_data_length; | |
| 2091 | + unsigned int buflen, remaining_data_length; | |
| 2091 | 2092 | int start, i, j; |
| 2092 | 2093 | int max_iov_size = |
| 2093 | 2094 | info->max_send_size - sizeof(struct smbd_data_transfer); |
| @@ -2111,25 +2112,13 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) · 17 unmodified lines | ||
| 2111 | 2112 | log_write(ERR, "expected the pdu length in 1st iov, but got %zu\n", rqst->rq_iov[0].iov_len); |
| 2112 | 2113 | return -EINVAL; |
| 2113 | 2114 | } |
| 2114 | − iov = &rqst->rq_iov[1]; | |
| 2115 | − | |
| 2116 | − /* total up iov array first */ | |
| 2117 | − for (i = 0; i < rqst->rq_nvec-1; i++) { | |
| 2118 | − buflen += iov[i].iov_len; | |
| 2119 | − } | |
| 2120 | 2115 | |
| 2121 | 2116 | /* |
| 2122 | 2117 | * Add in the page array if there is one. The caller needs to set |
| 2123 | 2118 | * rq_tailsz to PAGE_SIZE when the buffer has multiple pages and |
| 2124 | 2119 | * ends at page boundary |
| 2125 | 2120 | */ |
| 2126 | − if (rqst->rq_npages) { | |
| 2127 | − if (rqst->rq_npages == 1) | |
| 2128 | − buflen += rqst->rq_tailsz; | |
| 2129 | − else | |
| 2130 | − buflen += rqst->rq_pagesz * (rqst->rq_npages - 1) - | |
| 2131 | − rqst->rq_offset + rqst->rq_tailsz; | |
| 2132 | − } | |
| 2121 | + buflen = smb2_rqst_len(rqst, true); | |
| 2133 | 2122 | |
| 2134 | 2123 | if (buflen + sizeof(struct smbd_data_transfer) > |
| 2135 | 2124 | info->max_fragmented_send_size) { |
| @@ -2139,6 +2128,8 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) · 3 unmodified lines | ||
| 2139 | 2128 | goto done; |
| 2140 | 2129 | } |
| 2141 | 2130 | |
| 2131 | + iov = &rqst->rq_iov[1]; | |
| 2132 | + | |
| 2142 | 2133 | cifs_dbg(FYI, "Sending smb (RDMA): smb_len=%u\n", buflen); |
| 2143 | 2134 | for (i = 0; i < rqst->rq_nvec-1; i++) |
| 2144 | 2135 | dump_smb(iov[i].iov_base, iov[i].iov_len); |
| @@ -378,7 +378,7 @@ DEFINE_EVENT(smb3_open_err_class, smb3_##name, \ · 377 unmodified lines | ||
| 378 | 378 | TP_ARGS(xid, tid, sesid, create_options, desired_access, rc)) |
| 379 | 379 | |
| 380 | 380 | DEFINE_SMB3_OPEN_ERR_EVENT(open_err); |
| 381 | − | |
| 381 | +DEFINE_SMB3_OPEN_ERR_EVENT(posix_mkdir_err); | |
| 382 | 382 | |
| 383 | 383 | DECLARE_EVENT_CLASS(smb3_open_done_class, |
| 384 | 384 | TP_PROTO(unsigned int xid, |
| @@ -420,6 +420,7 @@ DEFINE_EVENT(smb3_open_done_class, smb3_##name, \ · 35 unmodified lines | ||
| 420 | 420 | TP_ARGS(xid, fid, tid, sesid, create_options, desired_access)) |
| 421 | 421 | |
| 422 | 422 | DEFINE_SMB3_OPEN_DONE_EVENT(open_done); |
| 423 | +DEFINE_SMB3_OPEN_DONE_EVENT(posix_mkdir_done); | |
| 423 | 424 | |
| 424 | 425 | #endif /* _CIFS_TRACE_H */ |
| 425 | 426 | |
| @@ -201,15 +201,24 @@ smb_send_kvec(struct TCP_Server_Info *server, struct msghdr *smb_msg, · 200 unmodified lines | ||
| 201 | 201 | return 0; |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | −static unsigned long | |
| 205 | −rqst_len(struct smb_rqst *rqst) | |
| 204 | +unsigned long | |
| 205 | +smb2_rqst_len(struct smb_rqst *rqst, bool skip_rfc1002_marker) | |
| 206 | 206 | { |
| 207 | 207 | unsigned int i; |
| 208 | − struct kvec *iov = rqst->rq_iov; | |
| 208 | + struct kvec *iov; | |
| 209 | + int nvec; | |
| 209 | 210 | unsigned long buflen = 0; |
| 210 | 211 | |
| 212 | + if (skip_rfc1002_marker && rqst->rq_iov[0].iov_len == 4) { | |
| 213 | + iov = &rqst->rq_iov[1]; | |
| 214 | + nvec = rqst->rq_nvec - 1; | |
| 215 | + } else { | |
| 216 | + iov = rqst->rq_iov; | |
| 217 | + nvec = rqst->rq_nvec; | |
| 218 | + } | |
| 219 | + | |
| 211 | 220 | /* total up iov array first */ |
| 212 | − for (i = 0; i < rqst->rq_nvec; i++) | |
| 221 | + for (i = 0; i < nvec; i++) | |
| 213 | 222 | buflen += iov[i].iov_len; |
| 214 | 223 | |
| 215 | 224 | /* |
| @@ -236,18 +245,20 @@ rqst_len(struct smb_rqst *rqst) · 20 unmodified lines | ||
| 236 | 245 | } |
| 237 | 246 | |
| 238 | 247 | static int |
| 239 | −__smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst) | |
| 248 | +__smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, | |
| 249 | + struct smb_rqst *rqst) | |
| 240 | 250 | { |
| 241 | − int rc; | |
| 242 | − struct kvec *iov = rqst->rq_iov; | |
| 243 | − int n_vec = rqst->rq_nvec; | |
| 244 | − unsigned int smb_buf_length = get_rfc1002_length(iov[0].iov_base); | |
| 245 | − unsigned long send_length; | |
| 246 | − unsigned int i; | |
| 251 | + int rc = 0; | |
| 252 | + struct kvec *iov; | |
| 253 | + int n_vec; | |
| 254 | + unsigned int send_length = 0; | |
| 255 | + unsigned int i, j; | |
| 247 | 256 | size_t total_len = 0, sent, size; |
| 248 | 257 | struct socket *ssocket = server->ssocket; |
| 249 | 258 | struct msghdr smb_msg; |
| 250 | 259 | int val = 1; |
| 260 | + __be32 rfc1002_marker; | |
| 261 | + | |
| 251 | 262 | if (cifs_rdma_enabled(server) && server->smbd_conn) { |
| 252 | 263 | rc = smbd_send(server->smbd_conn, rqst); |
| 253 | 264 | goto smbd_done; |
| @@ -255,51 +266,67 @@ __smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst) · 1 unmodified line | ||
| 255 | 266 | if (ssocket == NULL) |
| 256 | 267 | return -ENOTSOCK; |
| 257 | 268 | |
| 258 | − /* sanity check send length */ | |
| 259 | − send_length = rqst_len(rqst); | |
| 260 | − if (send_length != smb_buf_length + 4) { | |
| 261 | − WARN(1, "Send length mismatch(send_length=%lu smb_buf_length=%u)\n", | |
| 262 | − send_length, smb_buf_length); | |
| 263 | − return -EIO; | |
| 264 | − } | |
| 265 | − | |
| 266 | − if (n_vec < 2) | |
| 267 | − return -EIO; | |
| 268 | − | |
| 269 | − cifs_dbg(FYI, "Sending smb: smb_len=%u\n", smb_buf_length); | |
| 270 | − dump_smb(iov[0].iov_base, iov[0].iov_len); | |
| 271 | − dump_smb(iov[1].iov_base, iov[1].iov_len); | |
| 272 | − | |
| 273 | 269 | /* cork the socket */ |
| 274 | 270 | kernel_setsockopt(ssocket, SOL_TCP, TCP_CORK, |
| 275 | 271 | (char *)&val, sizeof(val)); |
| 276 | 272 | |
| 277 | − size = 0; | |
| 278 | − for (i = 0; i < n_vec; i++) | |
| 279 | − size += iov[i].iov_len; | |
| 273 | + for (j = 0; j < num_rqst; j++) | |
| 274 | + send_length += smb2_rqst_len(&rqst[j], true); | |
| 275 | + rfc1002_marker = cpu_to_be32(send_length); | |
| 280 | 276 | |
| 281 | − iov_iter_kvec(&smb_msg.msg_iter, WRITE | ITER_KVEC, iov, n_vec, size); | |
| 277 | + /* Generate a rfc1002 marker for SMB2+ */ | |
| 278 | + if (server->vals->header_preamble_size == 0) { | |
| 279 | + struct kvec hiov = { | |
| 280 | + .iov_base = &rfc1002_marker, | |
| 281 | + .iov_len = 4 | |
| 282 | + }; | |
| 283 | + iov_iter_kvec(&smb_msg.msg_iter, WRITE | ITER_KVEC, &hiov, | |
| 284 | + 1, 4); | |
| 285 | + rc = smb_send_kvec(server, &smb_msg, &sent); | |
| 286 | + if (rc < 0) | |
| 287 | + goto uncork; | |
| 282 | 288 | |
| 283 | − rc = smb_send_kvec(server, &smb_msg, &sent); | |
| 284 | − if (rc < 0) | |
| 285 | − goto uncork; | |
| 289 | + total_len += sent; | |
| 290 | + send_length += 4; | |
| 291 | + } | |
| 286 | 292 | |
| 287 | − total_len += sent; | |
| 293 | + cifs_dbg(FYI, "Sending smb: smb_len=%u\n", send_length); | |
| 288 | 294 | |
| 289 | − /* now walk the page array and send each page in it */ | |
| 290 | − for (i = 0; i < rqst->rq_npages; i++) { | |
| 291 | − struct bio_vec bvec; | |
| 295 | + for (j = 0; j < num_rqst; j++) { | |
| 296 | + iov = rqst[j].rq_iov; | |
| 297 | + n_vec = rqst[j].rq_nvec; | |
| 292 | 298 | |
| 293 | − bvec.bv_page = rqst->rq_pages[i]; | |
| 294 | − rqst_page_get_length(rqst, i, &bvec.bv_len, &bvec.bv_offset); | |
| 299 | + size = 0; | |
| 300 | + for (i = 0; i < n_vec; i++) { | |
| 301 | + dump_smb(iov[i].iov_base, iov[i].iov_len); | |
| 302 | + size += iov[i].iov_len; | |
| 303 | + } | |
| 304 | + | |
| 305 | + iov_iter_kvec(&smb_msg.msg_iter, WRITE | ITER_KVEC, | |
| 306 | + iov, n_vec, size); | |
| 295 | 307 | |
| 296 | − iov_iter_bvec(&smb_msg.msg_iter, WRITE | ITER_BVEC, | |
| 297 | − &bvec, 1, bvec.bv_len); | |
| 298 | 308 | rc = smb_send_kvec(server, &smb_msg, &sent); |
| 299 | 309 | if (rc < 0) |
| 300 | − break; | |
| 310 | + goto uncork; | |
| 301 | 311 | |
| 302 | 312 | total_len += sent; |
| 313 | + | |
| 314 | + /* now walk the page array and send each page in it */ | |
| 315 | + for (i = 0; i < rqst[j].rq_npages; i++) { | |
| 316 | + struct bio_vec bvec; | |
| 317 | + | |
| 318 | + bvec.bv_page = rqst[j].rq_pages[i]; | |
| 319 | + rqst_page_get_length(&rqst[j], i, &bvec.bv_len, | |
| 320 | + &bvec.bv_offset); | |
| 321 | + | |
| 322 | + iov_iter_bvec(&smb_msg.msg_iter, WRITE | ITER_BVEC, | |
| 323 | + &bvec, 1, bvec.bv_len); | |
| 324 | + rc = smb_send_kvec(server, &smb_msg, &sent); | |
| 325 | + if (rc < 0) | |
| 326 | + break; | |
| 327 | + | |
| 328 | + total_len += sent; | |
| 329 | + } | |
| 303 | 330 | } |
| 304 | 331 | |
| 305 | 332 | uncork: |
| @@ -308,9 +335,9 @@ uncork: · 2 unmodified lines | ||
| 308 | 335 | kernel_setsockopt(ssocket, SOL_TCP, TCP_CORK, |
| 309 | 336 | (char *)&val, sizeof(val)); |
| 310 | 337 | |
| 311 | − if ((total_len > 0) && (total_len != smb_buf_length + 4)) { | |
| 338 | + if ((total_len > 0) && (total_len != send_length)) { | |
| 312 | 339 | cifs_dbg(FYI, "partial send (wanted=%u sent=%zu): terminating session\n", |
| 313 | − smb_buf_length + 4, total_len); | |
| 340 | + send_length, total_len); | |
| 314 | 341 | /* |
| 315 | 342 | * If we have only sent part of an SMB then the next SMB could |
| 316 | 343 | * be taken as the remainder of this one. We need to kill the |
| @@ -335,7 +362,7 @@ smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst, int flags) · 18 unmodified lines | ||
| 335 | 362 | int rc; |
| 336 | 363 | |
| 337 | 364 | if (!(flags & CIFS_TRANSFORM_REQ)) |
| 338 | − return __smb_send_rqst(server, rqst); | |
| 365 | + return __smb_send_rqst(server, 1, rqst); | |
| 339 | 366 | |
| 340 | 367 | if (!server->ops->init_transform_rq || |
| 341 | 368 | !server->ops->free_transform_rq) { |
| @@ -347,7 +374,7 @@ smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst, int flags) · 5 unmodified lines | ||
| 347 | 374 | if (rc) |
| 348 | 375 | return rc; |
| 349 | 376 | |
| 350 | − rc = __smb_send_rqst(server, &cur_rqst); | |
| 377 | + rc = __smb_send_rqst(server, 1, &cur_rqst); | |
| 351 | 378 | server->ops->free_transform_rq(&cur_rqst); |
| 352 | 379 | return rc; |
| 353 | 380 | } |
| @@ -365,7 +392,7 @@ smb_send(struct TCP_Server_Info *server, struct smb_hdr *smb_buffer, · 11 unmodified lines | ||
| 365 | 392 | iov[1].iov_base = (char *)smb_buffer + 4; |
| 366 | 393 | iov[1].iov_len = smb_buf_length; |
| 367 | 394 | |
| 368 | − return __smb_send_rqst(server, &rqst); | |
| 395 | + return __smb_send_rqst(server, 1, &rqst); | |
| 369 | 396 | } |
| 370 | 397 | |
| 371 | 398 | static int |
| @@ -730,7 +757,6 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses, · 358 unmodified lines | ||
| 730 | 757 | * to the same server. We may make this configurable later or |
| 731 | 758 | * use ses->maxReq. |
| 732 | 759 | */ |
| 733 | − | |
| 734 | 760 | rc = wait_for_free_request(ses->server, timeout, optype); |
| 735 | 761 | if (rc) |
| 736 | 762 | return rc; |
| @@ -766,8 +792,8 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses, · 29 unmodified lines | ||
| 766 | 792 | |
| 767 | 793 | #ifdef CONFIG_CIFS_SMB311 |
| 768 | 794 | if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP)) |
| 769 | − smb311_update_preauth_hash(ses, rqst->rq_iov+1, | |
| 770 | − rqst->rq_nvec-1); | |
| 795 | + smb311_update_preauth_hash(ses, rqst->rq_iov, | |
| 796 | + rqst->rq_nvec); | |
| 771 | 797 | #endif |
| 772 | 798 | |
| 773 | 799 | if (timeout == CIFS_ASYNC_OP) |
| @@ -812,8 +838,8 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses, · 38 unmodified lines | ||
| 812 | 838 | #ifdef CONFIG_CIFS_SMB311 |
| 813 | 839 | if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP)) { |
| 814 | 840 | struct kvec iov = { |
| 815 | − .iov_base = buf, | |
| 816 | − .iov_len = midQ->resp_buf_size | |
| 841 | + .iov_base = resp_iov->iov_base, | |
| 842 | + .iov_len = resp_iov->iov_len | |
| 817 | 843 | }; |
| 818 | 844 | smb311_update_preauth_hash(ses, &iov, 1); |
| 819 | 845 | } |
| @@ -872,49 +898,6 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses, · 52 unmodified lines | ||
| 872 | 898 | return rc; |
| 873 | 899 | } |
| 874 | 900 | |
| 875 | −/* Like SendReceive2 but iov[0] does not contain an rfc1002 header */ | |
| 876 | −int | |
| 877 | −smb2_send_recv(const unsigned int xid, struct cifs_ses *ses, | |
| 878 | − struct kvec *iov, int n_vec, int *resp_buf_type /* ret */, | |
| 879 | − const int flags, struct kvec *resp_iov) | |
| 880 | −{ | |
| 881 | − struct smb_rqst rqst; | |
| 882 | − struct kvec s_iov[CIFS_MAX_IOV_SIZE], *new_iov; | |
| 883 | − int rc; | |
| 884 | − int i; | |
| 885 | − __u32 count; | |
| 886 | − __be32 rfc1002_marker; | |
| 887 | − | |
| 888 | − if (n_vec + 1 > CIFS_MAX_IOV_SIZE) { | |
| 889 | − new_iov = kmalloc_array(n_vec + 1, sizeof(struct kvec), | |
| 890 | − GFP_KERNEL); | |
| 891 | − if (!new_iov) | |
| 892 | − return -ENOMEM; | |
| 893 | − } else | |
| 894 | − new_iov = s_iov; | |
| 895 | − | |
| 896 | − /* 1st iov is an RFC1002 Session Message length */ | |
| 897 | − memcpy(new_iov + 1, iov, (sizeof(struct kvec) * n_vec)); | |
| 898 | − | |
| 899 | − count = 0; | |
| 900 | − for (i = 1; i < n_vec + 1; i++) | |
| 901 | − count += new_iov[i].iov_len; | |
| 902 | − | |
| 903 | − rfc1002_marker = cpu_to_be32(count); | |
| 904 | − | |
| 905 | − new_iov[0].iov_base = &rfc1002_marker; | |
| 906 | − new_iov[0].iov_len = 4; | |
| 907 | − | |
| 908 | − memset(&rqst, 0, sizeof(struct smb_rqst)); | |
| 909 | − rqst.rq_iov = new_iov; | |
| 910 | − rqst.rq_nvec = n_vec + 1; | |
| 911 | − | |
| 912 | − rc = cifs_send_recv(xid, ses, &rqst, resp_buf_type, flags, resp_iov); | |
| 913 | − if (n_vec + 1 > CIFS_MAX_IOV_SIZE) | |
| 914 | − kfree(new_iov); | |
| 915 | − return rc; | |
| 916 | −} | |
| 917 | − | |
| 918 | 901 | int |
| 919 | 902 | SendReceive(const unsigned int xid, struct cifs_ses *ses, |
| 920 | 903 | struct smb_hdr *in_buf, struct smb_hdr *out_buf, |
| @@ -101,20 +101,14 @@ static int eventfd_release(struct inode *inode, struct file *file) · 100 unmodified lines | ||
| 101 | 101 | return 0; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | −static struct wait_queue_head * | |
| 105 | −eventfd_get_poll_head(struct file *file, __poll_t events) | |
| 106 | −{ | |
| 107 | − struct eventfd_ctx *ctx = file->private_data; | |
| 108 | − | |
| 109 | − return &ctx->wqh; | |
| 110 | −} | |
| 111 | − | |
| 112 | −static __poll_t eventfd_poll_mask(struct file *file, __poll_t eventmask) | |
| 104 | +static __poll_t eventfd_poll(struct file *file, poll_table *wait) | |
| 113 | 105 | { |
| 114 | 106 | struct eventfd_ctx *ctx = file->private_data; |
| 115 | 107 | __poll_t events = 0; |
| 116 | 108 | u64 count; |
| 117 | 109 | |
| 110 | + poll_wait(file, &ctx->wqh, wait); | |
| 111 | + | |
| 118 | 112 | /* |
| 119 | 113 | * All writes to ctx->count occur within ctx->wqh.lock. This read |
| 120 | 114 | * can be done outside ctx->wqh.lock because we know that poll_wait |
| @@ -156,11 +150,11 @@ static __poll_t eventfd_poll_mask(struct file *file, __poll_t eventmask) · 35 unmodified lines | ||
| 156 | 150 | count = READ_ONCE(ctx->count); |
| 157 | 151 | |
| 158 | 152 | if (count > 0) |
| 159 | − events |= (EPOLLIN & eventmask); | |
| 153 | + events |= EPOLLIN; | |
| 160 | 154 | if (count == ULLONG_MAX) |
| 161 | 155 | events |= EPOLLERR; |
| 162 | 156 | if (ULLONG_MAX - 1 > count) |
| 163 | − events |= (EPOLLOUT & eventmask); | |
| 157 | + events |= EPOLLOUT; | |
| 164 | 158 | |
| 165 | 159 | return events; |
| 166 | 160 | } |
| @@ -311,8 +305,7 @@ static const struct file_operations eventfd_fops = { · 144 unmodified lines | ||
| 311 | 305 | .show_fdinfo = eventfd_show_fdinfo, |
| 312 | 306 | #endif |
| 313 | 307 | .release = eventfd_release, |
| 314 | − .get_poll_head = eventfd_get_poll_head, | |
| 315 | − .poll_mask = eventfd_poll_mask, | |
| 308 | + .poll = eventfd_poll, | |
| 316 | 309 | .read = eventfd_read, |
| 317 | 310 | .write = eventfd_write, |
| 318 | 311 | .llseek = noop_llseek, |
| @@ -922,18 +922,14 @@ static __poll_t ep_read_events_proc(struct eventpoll *ep, struct list_head *head · 921 unmodified lines | ||
| 922 | 922 | return 0; |
| 923 | 923 | } |
| 924 | 924 | |
| 925 | −static struct wait_queue_head *ep_eventpoll_get_poll_head(struct file *file, | |
| 926 | − __poll_t eventmask) | |
| 927 | −{ | |
| 928 | − struct eventpoll *ep = file->private_data; | |
| 929 | − return &ep->poll_wait; | |
| 930 | −} | |
| 931 | − | |
| 932 | −static __poll_t ep_eventpoll_poll_mask(struct file *file, __poll_t eventmask) | |
| 925 | +static __poll_t ep_eventpoll_poll(struct file *file, poll_table *wait) | |
| 933 | 926 | { |
| 934 | 927 | struct eventpoll *ep = file->private_data; |
| 935 | 928 | int depth = 0; |
| 936 | 929 | |
| 930 | + /* Insert inside our poll wait queue */ | |
| 931 | + poll_wait(file, &ep->poll_wait, wait); | |
| 932 | + | |
| 937 | 933 | /* |
| 938 | 934 | * Proceed to find out if wanted events are really available inside |
| 939 | 935 | * the ready list. |
| @@ -972,8 +968,7 @@ static const struct file_operations eventpoll_fops = { · 32 unmodified lines | ||
| 972 | 968 | .show_fdinfo = ep_show_fdinfo, |
| 973 | 969 | #endif |
| 974 | 970 | .release = ep_eventpoll_release, |
| 975 | − .get_poll_head = ep_eventpoll_get_poll_head, | |
| 976 | − .poll_mask = ep_eventpoll_poll_mask, | |
| 971 | + .poll = ep_eventpoll_poll, | |
| 977 | 972 | .llseek = noop_llseek, |
| 978 | 973 | }; |
| 979 | 974 | |
| @@ -748,7 +748,6 @@ extern void ext2_free_blocks (struct inode *, unsigned long, · 747 unmodified lines | ||
| 748 | 748 | unsigned long); |
| 749 | 749 | extern unsigned long ext2_count_free_blocks (struct super_block *); |
| 750 | 750 | extern unsigned long ext2_count_dirs (struct super_block *); |
| 751 | −extern void ext2_check_blocks_bitmap (struct super_block *); | |
| 752 | 751 | extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb, |
| 753 | 752 | unsigned int block_group, |
| 754 | 753 | struct buffer_head ** bh); |
| @@ -771,7 +770,6 @@ extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page · 16 unmodified lines | ||
| 771 | 770 | extern struct inode * ext2_new_inode (struct inode *, umode_t, const struct qstr *); |
| 772 | 771 | extern void ext2_free_inode (struct inode *); |
| 773 | 772 | extern unsigned long ext2_count_free_inodes (struct super_block *); |
| 774 | −extern void ext2_check_inodes_bitmap (struct super_block *); | |
| 775 | 773 | extern unsigned long ext2_count_free (struct buffer_head *, unsigned); |
| 776 | 774 | |
| 777 | 775 | /* inode.c */ |
| @@ -557,6 +557,9 @@ static int parse_options(char *options, struct super_block *sb, · 556 unmodified lines | ||
| 557 | 557 | set_opt (opts->s_mount_opt, NO_UID32); |
| 558 | 558 | break; |
| 559 | 559 | case Opt_nocheck: |
| 560 | + ext2_msg(sb, KERN_WARNING, | |
| 561 | + "Option nocheck/check=none is deprecated and" | |
| 562 | + " will be removed in June 2020."); | |
| 560 | 563 | clear_opt (opts->s_mount_opt, CHECK); |
| 561 | 564 | break; |
| 562 | 565 | case Opt_debug: |
| @@ -1335,9 +1338,6 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) · 772 unmodified lines | ||
| 1335 | 1338 | new_opts.s_resgid = sbi->s_resgid; |
| 1336 | 1339 | spin_unlock(&sbi->s_lock); |
| 1337 | 1340 | |
| 1338 | − /* | |
| 1339 | − * Allow the "check" option to be passed as a remount option. | |
| 1340 | − */ | |
| 1341 | 1341 | if (!parse_options(data, sb, &new_opts)) |
| 1342 | 1342 | return -EINVAL; |
| 1343 | 1343 | |
| @@ -491,15 +491,17 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size) · 490 unmodified lines | ||
| 491 | 491 | if (size > PSIZE) { |
| 492 | 492 | /* |
| 493 | 493 | * To keep the rest of the code simple. Allocate a |
| 494 | − * contiguous buffer to work with | |
| 494 | + * contiguous buffer to work with. Make the buffer large | |
| 495 | + * enough to make use of the whole extent. | |
| 495 | 496 | */ |
| 496 | − ea_buf->xattr = kmalloc(size, GFP_KERNEL); | |
| 497 | + ea_buf->max_size = (size + sb->s_blocksize - 1) & | |
| 498 | + ~(sb->s_blocksize - 1); | |
| 499 | + | |
| 500 | + ea_buf->xattr = kmalloc(ea_buf->max_size, GFP_KERNEL); | |
| 497 | 501 | if (ea_buf->xattr == NULL) |
| 498 | 502 | return -ENOMEM; |
| 499 | 503 | |
| 500 | 504 | ea_buf->flag = EA_MALLOC; |
| 501 | − ea_buf->max_size = (size + sb->s_blocksize - 1) & | |
| 502 | − ~(sb->s_blocksize - 1); | |
| 503 | 505 | |
| 504 | 506 | if (ea_size == 0) |
| 505 | 507 | return 0; |
| @@ -883,8 +883,10 @@ struct inode *nfs_delegation_find_inode(struct nfs_client *clp, · 882 unmodified lines | ||
| 883 | 883 | rcu_read_lock(); |
| 884 | 884 | list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) { |
| 885 | 885 | res = nfs_delegation_find_inode_server(server, fhandle); |
| 886 | − if (res != ERR_PTR(-ENOENT)) | |
| 886 | + if (res != ERR_PTR(-ENOENT)) { | |
| 887 | + rcu_read_unlock(); | |
| 887 | 888 | return res; |
| 889 | + } | |
| 888 | 890 | } |
| 889 | 891 | rcu_read_unlock(); |
| 890 | 892 | return ERR_PTR(-ENOENT); |
| @@ -1243,17 +1243,18 @@ static int ff_layout_read_done_cb(struct rpc_task *task, · 1242 unmodified lines | ||
| 1243 | 1243 | hdr->ds_clp, hdr->lseg, |
| 1244 | 1244 | hdr->pgio_mirror_idx); |
| 1245 | 1245 | |
| 1246 | + clear_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); | |
| 1247 | + clear_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); | |
| 1246 | 1248 | switch (err) { |
| 1247 | 1249 | case -NFS4ERR_RESET_TO_PNFS: |
| 1248 | 1250 | if (ff_layout_choose_best_ds_for_read(hdr->lseg, |
| 1249 | 1251 | hdr->pgio_mirror_idx + 1, |
| 1250 | 1252 | &hdr->pgio_mirror_idx)) |
| 1251 | 1253 | goto out_eagain; |
| 1252 | − ff_layout_read_record_layoutstats_done(task, hdr); | |
| 1253 | − pnfs_read_resend_pnfs(hdr); | |
| 1254 | + set_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); | |
| 1254 | 1255 | return task->tk_status; |
| 1255 | 1256 | case -NFS4ERR_RESET_TO_MDS: |
| 1256 | − ff_layout_reset_read(hdr); | |
| 1257 | + set_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); | |
| 1257 | 1258 | return task->tk_status; |
| 1258 | 1259 | case -EAGAIN: |
| 1259 | 1260 | goto out_eagain; |
| @@ -1403,6 +1404,10 @@ static void ff_layout_read_release(void *data) · 143 unmodified lines | ||
| 1403 | 1404 | struct nfs_pgio_header *hdr = data; |
| 1404 | 1405 | |
| 1405 | 1406 | ff_layout_read_record_layoutstats_done(&hdr->task, hdr); |
| 1407 | + if (test_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags)) | |
| 1408 | + pnfs_read_resend_pnfs(hdr); | |
| 1409 | + else if (test_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags)) | |
| 1410 | + ff_layout_reset_read(hdr); | |
| 1406 | 1411 | pnfs_generic_rw_release(data); |
| 1407 | 1412 | } |
| 1408 | 1413 | |
| @@ -1423,12 +1428,14 @@ static int ff_layout_write_done_cb(struct rpc_task *task, · 14 unmodified lines | ||
| 1423 | 1428 | hdr->ds_clp, hdr->lseg, |
| 1424 | 1429 | hdr->pgio_mirror_idx); |
| 1425 | 1430 | |
| 1431 | + clear_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); | |
| 1432 | + clear_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); | |
| 1426 | 1433 | switch (err) { |
| 1427 | 1434 | case -NFS4ERR_RESET_TO_PNFS: |
| 1428 | − ff_layout_reset_write(hdr, true); | |
| 1435 | + set_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags); | |
| 1429 | 1436 | return task->tk_status; |
| 1430 | 1437 | case -NFS4ERR_RESET_TO_MDS: |
| 1431 | − ff_layout_reset_write(hdr, false); | |
| 1438 | + set_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags); | |
| 1432 | 1439 | return task->tk_status; |
| 1433 | 1440 | case -EAGAIN: |
| 1434 | 1441 | return -EAGAIN; |
| @@ -1575,6 +1582,10 @@ static void ff_layout_write_release(void *data) · 140 unmodified lines | ||
| 1575 | 1582 | struct nfs_pgio_header *hdr = data; |
| 1576 | 1583 | |
| 1577 | 1584 | ff_layout_write_record_layoutstats_done(&hdr->task, hdr); |
| 1585 | + if (test_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags)) | |
| 1586 | + ff_layout_reset_write(hdr, true); | |
| 1587 | + else if (test_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags)) | |
| 1588 | + ff_layout_reset_write(hdr, false); | |
| 1578 | 1589 | pnfs_generic_rw_release(data); |
| 1579 | 1590 | } |
| 1580 | 1591 | |
| @@ -3294,6 +3294,7 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) · 3293 unmodified lines | ||
| 3294 | 3294 | struct nfs4_closedata *calldata = data; |
| 3295 | 3295 | struct nfs4_state *state = calldata->state; |
| 3296 | 3296 | struct inode *inode = calldata->inode; |
| 3297 | + struct pnfs_layout_hdr *lo; | |
| 3297 | 3298 | bool is_rdonly, is_wronly, is_rdwr; |
| 3298 | 3299 | int call_close = 0; |
| 3299 | 3300 | |
| @@ -3337,6 +3338,12 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) · 37 unmodified lines | ||
| 3337 | 3338 | goto out_wait; |
| 3338 | 3339 | } |
| 3339 | 3340 | |
| 3341 | + lo = calldata->arg.lr_args ? calldata->arg.lr_args->layout : NULL; | |
| 3342 | + if (lo && !pnfs_layout_is_valid(lo)) { | |
| 3343 | + calldata->arg.lr_args = NULL; | |
| 3344 | + calldata->res.lr_res = NULL; | |
| 3345 | + } | |
| 3346 | + | |
| 3340 | 3347 | if (calldata->arg.fmode == 0) |
| 3341 | 3348 | task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE]; |
| 3342 | 3349 | |
| @@ -5972,12 +5979,19 @@ static void nfs4_delegreturn_release(void *calldata) · 2629 unmodified lines | ||
| 5972 | 5979 | static void nfs4_delegreturn_prepare(struct rpc_task *task, void *data) |
| 5973 | 5980 | { |
| 5974 | 5981 | struct nfs4_delegreturndata *d_data; |
| 5982 | + struct pnfs_layout_hdr *lo; | |
| 5975 | 5983 | |
| 5976 | 5984 | d_data = (struct nfs4_delegreturndata *)data; |
| 5977 | 5985 | |
| 5978 | 5986 | if (!d_data->lr.roc && nfs4_wait_on_layoutreturn(d_data->inode, task)) |
| 5979 | 5987 | return; |
| 5980 | 5988 | |
| 5989 | + lo = d_data->args.lr_args ? d_data->args.lr_args->layout : NULL; | |
| 5990 | + if (lo && !pnfs_layout_is_valid(lo)) { | |
| 5991 | + d_data->args.lr_args = NULL; | |
| 5992 | + d_data->res.lr_res = NULL; | |
| 5993 | + } | |
| 5994 | + | |
| 5981 | 5995 | nfs4_setup_sequence(d_data->res.server->nfs_client, |
| 5982 | 5996 | &d_data->args.seq_args, |
| 5983 | 5997 | &d_data->res.seq_res, |
| @@ -8650,6 +8664,8 @@ nfs4_layoutget_handle_exception(struct rpc_task *task, · 2666 unmodified lines | ||
| 8650 | 8664 | |
| 8651 | 8665 | dprintk("--> %s tk_status => %d\n", __func__, -task->tk_status); |
| 8652 | 8666 | |
| 8667 | + nfs4_sequence_free_slot(&lgp->res.seq_res); | |
| 8668 | + | |
| 8653 | 8669 | switch (nfs4err) { |
| 8654 | 8670 | case 0: |
| 8655 | 8671 | goto out; |
| @@ -8714,7 +8730,6 @@ nfs4_layoutget_handle_exception(struct rpc_task *task, · 58 unmodified lines | ||
| 8714 | 8730 | goto out; |
| 8715 | 8731 | } |
| 8716 | 8732 | |
| 8717 | − nfs4_sequence_free_slot(&lgp->res.seq_res); | |
| 8718 | 8733 | err = nfs4_handle_exception(server, nfs4err, exception); |
| 8719 | 8734 | if (!status) { |
| 8720 | 8735 | if (exception->retry) |
| @@ -8786,20 +8801,22 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout) · 65 unmodified lines | ||
| 8786 | 8801 | if (IS_ERR(task)) |
| 8787 | 8802 | return ERR_CAST(task); |
| 8788 | 8803 | status = rpc_wait_for_completion_task(task); |
| 8789 | − if (status == 0) { | |
| 8804 | + if (status != 0) | |
| 8805 | + goto out; | |
| 8806 | + | |
| 8807 | + /* if layoutp->len is 0, nfs4_layoutget_prepare called rpc_exit */ | |
| 8808 | + if (task->tk_status < 0 || lgp->res.layoutp->len == 0) { | |
| 8790 | 8809 | status = nfs4_layoutget_handle_exception(task, lgp, &exception); |
| 8791 | 8810 | *timeout = exception.timeout; |
| 8792 | − } | |
| 8793 | − | |
| 8811 | + } else | |
| 8812 | + lseg = pnfs_layout_process(lgp); | |
| 8813 | +out: | |
| 8794 | 8814 | trace_nfs4_layoutget(lgp->args.ctx, |
| 8795 | 8815 | &lgp->args.range, |
| 8796 | 8816 | &lgp->res.range, |
| 8797 | 8817 | &lgp->res.stateid, |
| 8798 | 8818 | status); |
| 8799 | 8819 | |
| 8800 | − /* if layoutp->len is 0, nfs4_layoutget_prepare called rpc_exit */ | |
| 8801 | − if (status == 0 && lgp->res.layoutp->len) | |
| 8802 | − lseg = pnfs_layout_process(lgp); | |
| 8803 | 8820 | rpc_put_task(task); |
| 8804 | 8821 | dprintk("<-- %s status=%d\n", __func__, status); |
| 8805 | 8822 | if (status) |
| @@ -8817,6 +8834,8 @@ nfs4_layoutreturn_prepare(struct rpc_task *task, void *calldata) · 11 unmodified lines | ||
| 8817 | 8834 | &lrp->args.seq_args, |
| 8818 | 8835 | &lrp->res.seq_res, |
| 8819 | 8836 | task); |
| 8837 | + if (!pnfs_layout_is_valid(lrp->args.layout)) | |
| 8838 | + rpc_exit(task, 0); | |
| 8820 | 8839 | } |
| 8821 | 8840 | |
| 8822 | 8841 | static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata) |
| @@ -801,6 +801,11 @@ static inline void nfs4_lgopen_release(struct nfs4_layoutget *lgp) · 800 unmodified lines | ||
| 801 | 801 | { |
| 802 | 802 | } |
| 803 | 803 | |
| 804 | +static inline bool pnfs_layout_is_valid(const struct pnfs_layout_hdr *lo) | |
| 805 | +{ | |
| 806 | + return false; | |
| 807 | +} | |
| 808 | + | |
| 804 | 809 | #endif /* CONFIG_NFS_V4_1 */ |
| 805 | 810 | |
| 806 | 811 | #if IS_ENABLED(CONFIG_NFS_V4_2) |
| @@ -509,22 +509,19 @@ static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · 508 unmodified lines | ||
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | −static struct wait_queue_head * | |
| 513 | −pipe_get_poll_head(struct file *filp, __poll_t events) | |
| 514 | −{ | |
| 515 | − struct pipe_inode_info *pipe = filp->private_data; | |
| 516 | − | |
| 517 | − return &pipe->wait; | |
| 518 | −} | |
| 519 | − | |
| 520 | 512 | /* No kernel lock held - fine */ |
| 521 | −static __poll_t pipe_poll_mask(struct file *filp, __poll_t events) | |
| 513 | +static __poll_t | |
| 514 | +pipe_poll(struct file *filp, poll_table *wait) | |
| 522 | 515 | { |
| 516 | + __poll_t mask; | |
| 523 | 517 | struct pipe_inode_info *pipe = filp->private_data; |
| 524 | − int nrbufs = pipe->nrbufs; | |
| 525 | − __poll_t mask = 0; | |
| 518 | + int nrbufs; | |
| 519 | + | |
| 520 | + poll_wait(filp, &pipe->wait, wait); | |
| 526 | 521 | |
| 527 | 522 | /* Reading only -- no need for acquiring the semaphore. */ |
| 523 | + nrbufs = pipe->nrbufs; | |
| 524 | + mask = 0; | |
| 528 | 525 | if (filp->f_mode & FMODE_READ) { |
| 529 | 526 | mask = (nrbufs > 0) ? EPOLLIN | EPOLLRDNORM : 0; |
| 530 | 527 | if (!pipe->writers && filp->f_version != pipe->w_counter) |
| @@ -1023,8 +1020,7 @@ const struct file_operations pipefifo_fops = { · 492 unmodified lines | ||
| 1023 | 1020 | .llseek = no_llseek, |
| 1024 | 1021 | .read_iter = pipe_read, |
| 1025 | 1022 | .write_iter = pipe_write, |
| 1026 | − .get_poll_head = pipe_get_poll_head, | |
| 1027 | − .poll_mask = pipe_poll_mask, | |
| 1023 | + .poll = pipe_poll, | |
| 1028 | 1024 | .unlocked_ioctl = pipe_ioctl, |
| 1029 | 1025 | .release = pipe_release, |
| 1030 | 1026 | .fasync = pipe_fasync, |
| @@ -235,6 +235,10 @@ static ssize_t get_mm_cmdline(struct mm_struct *mm, char __user *buf, · 234 unmodified lines | ||
| 235 | 235 | if (env_start != arg_end || env_start >= env_end) |
| 236 | 236 | env_start = env_end = arg_end; |
| 237 | 237 | |
| 238 | + /* .. and limit it to a maximum of one page of slop */ | |
| 239 | + if (env_end >= arg_end + PAGE_SIZE) | |
| 240 | + env_end = arg_end + PAGE_SIZE - 1; | |
| 241 | + | |
| 238 | 242 | /* We're not going to care if "*ppos" has high bits set */ |
| 239 | 243 | pos = arg_start + *ppos; |
| 240 | 244 | |
| @@ -254,10 +258,19 @@ static ssize_t get_mm_cmdline(struct mm_struct *mm, char __user *buf, · 13 unmodified lines | ||
| 254 | 258 | while (count) { |
| 255 | 259 | int got; |
| 256 | 260 | size_t size = min_t(size_t, PAGE_SIZE, count); |
| 261 | + long offset; | |
| 257 | 262 | |
| 258 | − got = access_remote_vm(mm, pos, page, size, FOLL_ANON); | |
| 259 | − if (got <= 0) | |
| 263 | + /* | |
| 264 | + * Are we already starting past the official end? | |
| 265 | + * We always include the last byte that is *supposed* | |
| 266 | + * to be NUL | |
| 267 | + */ | |
| 268 | + offset = (pos >= arg_end) ? pos - arg_end + 1 : 0; | |
| 269 | + | |
| 270 | + got = access_remote_vm(mm, pos - offset, page, size + offset, FOLL_ANON); | |
| 271 | + if (got <= offset) | |
| 260 | 272 | break; |
| 273 | + got -= offset; | |
| 261 | 274 | |
| 262 | 275 | /* Don't walk past a NUL character once you hit arg_end */ |
| 263 | 276 | if (pos + got >= arg_end) { |
| @@ -276,12 +289,17 @@ static ssize_t get_mm_cmdline(struct mm_struct *mm, char __user *buf, · 12 unmodified lines | ||
| 276 | 289 | n = arg_end - pos - 1; |
| 277 | 290 | |
| 278 | 291 | /* Cut off at first NUL after 'n' */ |
| 279 | − got = n + strnlen(page+n, got-n); | |
| 280 | − if (!got) | |
| 292 | + got = n + strnlen(page+n, offset+got-n); | |
| 293 | + if (got < offset) | |
| 281 | 294 | break; |
| 295 | + got -= offset; | |
| 296 | + | |
| 297 | + /* Include the NUL if it existed */ | |
| 298 | + if (got < size) | |
| 299 | + got++; | |
| 282 | 300 | } |
| 283 | 301 | |
| 284 | − got -= copy_to_user(buf, page, got); | |
| 302 | + got -= copy_to_user(buf, page+offset, got); | |
| 285 | 303 | if (unlikely(!got)) { |
| 286 | 304 | if (!len) |
| 287 | 305 | len = -EFAULT; |
| @@ -564,11 +564,20 @@ static int proc_seq_open(struct inode *inode, struct file *file) · 563 unmodified lines | ||
| 564 | 564 | return seq_open(file, de->seq_ops); |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | +static int proc_seq_release(struct inode *inode, struct file *file) | |
| 568 | +{ | |
| 569 | + struct proc_dir_entry *de = PDE(inode); | |
| 570 | + | |
| 571 | + if (de->state_size) | |
| 572 | + return seq_release_private(inode, file); | |
| 573 | + return seq_release(inode, file); | |
| 574 | +} | |
| 575 | + | |
| 567 | 576 | static const struct file_operations proc_seq_fops = { |
| 568 | 577 | .open = proc_seq_open, |
| 569 | 578 | .read = seq_read, |
| 570 | 579 | .llseek = seq_lseek, |
| 571 | − .release = seq_release, | |
| 580 | + .release = proc_seq_release, | |
| 572 | 581 | }; |
| 573 | 582 | |
| 574 | 583 | struct proc_dir_entry *proc_create_seq_private(const char *name, umode_t mode, |
| @@ -711,21 +711,18 @@ EXPORT_SYMBOL(dquot_quota_sync); · 710 unmodified lines | ||
| 711 | 711 | static unsigned long |
| 712 | 712 | dqcache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) |
| 713 | 713 | { |
| 714 | − struct list_head *head; | |
| 715 | 714 | struct dquot *dquot; |
| 716 | 715 | unsigned long freed = 0; |
| 717 | 716 | |
| 718 | 717 | spin_lock(&dq_list_lock); |
| 719 | − head = free_dquots.prev; | |
| 720 | − while (head != &free_dquots && sc->nr_to_scan) { | |
| 721 | − dquot = list_entry(head, struct dquot, dq_free); | |
| 718 | + while (!list_empty(&free_dquots) && sc->nr_to_scan) { | |
| 719 | + dquot = list_first_entry(&free_dquots, struct dquot, dq_free); | |
| 722 | 720 | remove_dquot_hash(dquot); |
| 723 | 721 | remove_free_dquot(dquot); |
| 724 | 722 | remove_inuse(dquot); |
| 725 | 723 | do_destroy_dquot(dquot); |
| 726 | 724 | sc->nr_to_scan--; |
| 727 | 725 | freed++; |
| 728 | − head = free_dquots.prev; | |
| 729 | 726 | } |
| 730 | 727 | spin_unlock(&dq_list_lock); |
| 731 | 728 | return freed; |
| @@ -34,29 +34,6 @@ · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | #include <linux/uaccess.h> |
| 36 | 36 | |
| 37 | −__poll_t vfs_poll(struct file *file, struct poll_table_struct *pt) | |
| 38 | −{ | |
| 39 | − if (file->f_op->poll) { | |
| 40 | − return file->f_op->poll(file, pt); | |
| 41 | − } else if (file_has_poll_mask(file)) { | |
| 42 | − unsigned int events = poll_requested_events(pt); | |
| 43 | − struct wait_queue_head *head; | |
| 44 | − | |
| 45 | − if (pt && pt->_qproc) { | |
| 46 | − head = file->f_op->get_poll_head(file, events); | |
| 47 | − if (!head) | |
| 48 | − return DEFAULT_POLLMASK; | |
| 49 | − if (IS_ERR(head)) | |
| 50 | − return EPOLLERR; | |
| 51 | − pt->_qproc(file, head, pt); | |
| 52 | − } | |
| 53 | − | |
| 54 | − return file->f_op->poll_mask(file, events); | |
| 55 | − } else { | |
| 56 | − return DEFAULT_POLLMASK; | |
| 57 | − } | |
| 58 | −} | |
| 59 | −EXPORT_SYMBOL_GPL(vfs_poll); | |
| 60 | 37 | |
| 61 | 38 | /* |
| 62 | 39 | * Estimate expected accuracy in ns from a timeval. |
| @@ -226,20 +226,21 @@ static int timerfd_release(struct inode *inode, struct file *file) · 225 unmodified lines | ||
| 226 | 226 | kfree_rcu(ctx, rcu); |
| 227 | 227 | return 0; |
| 228 | 228 | } |
| 229 | − | |
| 230 | −static struct wait_queue_head *timerfd_get_poll_head(struct file *file, | |
| 231 | − __poll_t eventmask) | |
| 229 | + | |
| 230 | +static __poll_t timerfd_poll(struct file *file, poll_table *wait) | |
| 232 | 231 | { |
| 233 | 232 | struct timerfd_ctx *ctx = file->private_data; |
| 233 | + __poll_t events = 0; | |
| 234 | + unsigned long flags; | |
| 234 | 235 | |
| 235 | − return &ctx->wqh; | |
| 236 | −} | |
| 236 | + poll_wait(file, &ctx->wqh, wait); | |
| 237 | 237 | |
| 238 | −static __poll_t timerfd_poll_mask(struct file *file, __poll_t eventmask) | |
| 239 | −{ | |
| 240 | − struct timerfd_ctx *ctx = file->private_data; | |
| 238 | + spin_lock_irqsave(&ctx->wqh.lock, flags); | |
| 239 | + if (ctx->ticks) | |
| 240 | + events |= EPOLLIN; | |
| 241 | + spin_unlock_irqrestore(&ctx->wqh.lock, flags); | |
| 241 | 242 | |
| 242 | − return ctx->ticks ? EPOLLIN : 0; | |
| 243 | + return events; | |
| 243 | 244 | } |
| 244 | 245 | |
| 245 | 246 | static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count, |
| @@ -363,8 +364,7 @@ static long timerfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg · 117 unmodified lines | ||
| 363 | 364 | |
| 364 | 365 | static const struct file_operations timerfd_fops = { |
| 365 | 366 | .release = timerfd_release, |
| 366 | − .get_poll_head = timerfd_get_poll_head, | |
| 367 | − .poll_mask = timerfd_poll_mask, | |
| 367 | + .poll = timerfd_poll, | |
| 368 | 368 | .read = timerfd_read, |
| 369 | 369 | .llseek = noop_llseek, |
| 370 | 370 | .show_fdinfo = timerfd_show, |
| @@ -533,8 +533,7 @@ static int udf_table_prealloc_blocks(struct super_block *sb, · 532 unmodified lines | ||
| 533 | 533 | udf_write_aext(table, &epos, &eloc, |
| 534 | 534 | (etype << 30) | elen, 1); |
| 535 | 535 | } else |
| 536 | − udf_delete_aext(table, epos, eloc, | |
| 537 | − (etype << 30) | elen); | |
| 536 | + udf_delete_aext(table, epos); | |
| 538 | 537 | } else { |
| 539 | 538 | alloc_count = 0; |
| 540 | 539 | } |
| @@ -630,7 +629,7 @@ static udf_pblk_t udf_table_new_block(struct super_block *sb, · 89 unmodified lines | ||
| 630 | 629 | if (goal_elen) |
| 631 | 630 | udf_write_aext(table, &goal_epos, &goal_eloc, goal_elen, 1); |
| 632 | 631 | else |
| 633 | − udf_delete_aext(table, goal_epos, goal_eloc, goal_elen); | |
| 632 | + udf_delete_aext(table, goal_epos); | |
| 634 | 633 | brelse(goal_epos.bh); |
| 635 | 634 | |
| 636 | 635 | udf_add_free_space(sb, partition, -1); |
| @@ -141,10 +141,7 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos, · 140 unmodified lines | ||
| 141 | 141 | fibh->ebh->b_data, |
| 142 | 142 | sizeof(struct fileIdentDesc) + fibh->soffset); |
| 143 | 143 | |
| 144 | − fi_len = (sizeof(struct fileIdentDesc) + | |
| 145 | − cfi->lengthFileIdent + | |
| 146 | − le16_to_cpu(cfi->lengthOfImpUse) + 3) & ~3; | |
| 147 | − | |
| 144 | + fi_len = udf_dir_entry_len(cfi); | |
| 148 | 145 | *nf_pos += fi_len - (fibh->eoffset - fibh->soffset); |
| 149 | 146 | fibh->eoffset = fibh->soffset + fi_len; |
| 150 | 147 | } else { |
| @@ -152,6 +149,9 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos, · 1 unmodified line | ||
| 152 | 149 | sizeof(struct fileIdentDesc)); |
| 153 | 150 | } |
| 154 | 151 | } |
| 152 | + /* Got last entry outside of dir size - fs is corrupted! */ | |
| 153 | + if (*nf_pos > dir->i_size) | |
| 154 | + return NULL; | |
| 155 | 155 | return fi; |
| 156 | 156 | } |
| 157 | 157 | |
| @@ -1147,8 +1147,7 @@ static void udf_update_extents(struct inode *inode, struct kernel_long_ad *laarr · 1146 unmodified lines | ||
| 1147 | 1147 | |
| 1148 | 1148 | if (startnum > endnum) { |
| 1149 | 1149 | for (i = 0; i < (startnum - endnum); i++) |
| 1150 | − udf_delete_aext(inode, *epos, laarr[i].extLocation, | |
| 1151 | − laarr[i].extLength); | |
| 1150 | + udf_delete_aext(inode, *epos); | |
| 1152 | 1151 | } else if (startnum < endnum) { |
| 1153 | 1152 | for (i = 0; i < (endnum - startnum); i++) { |
| 1154 | 1153 | udf_insert_aext(inode, *epos, laarr[i].extLocation, |
| @@ -2176,14 +2175,15 @@ static int8_t udf_insert_aext(struct inode *inode, struct extent_position epos, · 1021 unmodified lines | ||
| 2176 | 2175 | return (nelen >> 30); |
| 2177 | 2176 | } |
| 2178 | 2177 | |
| 2179 | −int8_t udf_delete_aext(struct inode *inode, struct extent_position epos, | |
| 2180 | − struct kernel_lb_addr eloc, uint32_t elen) | |
| 2178 | +int8_t udf_delete_aext(struct inode *inode, struct extent_position epos) | |
| 2181 | 2179 | { |
| 2182 | 2180 | struct extent_position oepos; |
| 2183 | 2181 | int adsize; |
| 2184 | 2182 | int8_t etype; |
| 2185 | 2183 | struct allocExtDesc *aed; |
| 2186 | 2184 | struct udf_inode_info *iinfo; |
| 2185 | + struct kernel_lb_addr eloc; | |
| 2186 | + uint32_t elen; | |
| 2187 | 2187 | |
| 2188 | 2188 | if (epos.bh) { |
| 2189 | 2189 | get_bh(epos.bh); |
| @@ -351,8 +351,6 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, · 350 unmodified lines | ||
| 351 | 351 | loff_t f_pos; |
| 352 | 352 | loff_t size = udf_ext0_offset(dir) + dir->i_size; |
| 353 | 353 | int nfidlen; |
| 354 | − uint8_t lfi; | |
| 355 | − uint16_t liu; | |
| 356 | 354 | udf_pblk_t block; |
| 357 | 355 | struct kernel_lb_addr eloc; |
| 358 | 356 | uint32_t elen = 0; |
| @@ -383,7 +381,7 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, · 24 unmodified lines | ||
| 383 | 381 | namelen = 0; |
| 384 | 382 | } |
| 385 | 383 | |
| 386 | − nfidlen = (sizeof(struct fileIdentDesc) + namelen + 3) & ~3; | |
| 384 | + nfidlen = ALIGN(sizeof(struct fileIdentDesc) + namelen, UDF_NAME_PAD); | |
| 387 | 385 | |
| 388 | 386 | f_pos = udf_ext0_offset(dir); |
| 389 | 387 | |
| @@ -424,12 +422,8 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, · 34 unmodified lines | ||
| 424 | 422 | goto out_err; |
| 425 | 423 | } |
| 426 | 424 | |
| 427 | − liu = le16_to_cpu(cfi->lengthOfImpUse); | |
| 428 | − lfi = cfi->lengthFileIdent; | |
| 429 | − | |
| 430 | 425 | if ((cfi->fileCharacteristics & FID_FILE_CHAR_DELETED) != 0) { |
| 431 | − if (((sizeof(struct fileIdentDesc) + | |
| 432 | − liu + lfi + 3) & ~3) == nfidlen) { | |
| 426 | + if (udf_dir_entry_len(cfi) == nfidlen) { | |
| 433 | 427 | cfi->descTag.tagSerialNum = cpu_to_le16(1); |
| 434 | 428 | cfi->fileVersionNum = cpu_to_le16(1); |
| 435 | 429 | cfi->fileCharacteristics = 0; |
| @@ -1201,9 +1195,7 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry, · 765 unmodified lines | ||
| 1201 | 1195 | |
| 1202 | 1196 | if (dir_fi) { |
| 1203 | 1197 | dir_fi->icb.extLocation = cpu_to_lelb(UDF_I(new_dir)->i_location); |
| 1204 | − udf_update_tag((char *)dir_fi, | |
| 1205 | − (sizeof(struct fileIdentDesc) + | |
| 1206 | − le16_to_cpu(dir_fi->lengthOfImpUse) + 3) & ~3); | |
| 1198 | + udf_update_tag((char *)dir_fi, udf_dir_entry_len(dir_fi)); | |
| 1207 | 1199 | if (old_iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) |
| 1208 | 1200 | mark_inode_dirty(old_inode); |
| 1209 | 1201 | else |
| @@ -132,6 +132,12 @@ struct inode *udf_find_metadata_inode_efe(struct super_block *sb, · 131 unmodified lines | ||
| 132 | 132 | extern int udf_write_fi(struct inode *inode, struct fileIdentDesc *, |
| 133 | 133 | struct fileIdentDesc *, struct udf_fileident_bh *, |
| 134 | 134 | uint8_t *, uint8_t *); |
| 135 | +static inline unsigned int udf_dir_entry_len(struct fileIdentDesc *cfi) | |
| 136 | +{ | |
| 137 | + return ALIGN(sizeof(struct fileIdentDesc) + | |
| 138 | + le16_to_cpu(cfi->lengthOfImpUse) + cfi->lengthFileIdent, | |
| 139 | + UDF_NAME_PAD); | |
| 140 | +} | |
| 135 | 141 | |
| 136 | 142 | /* file.c */ |
| 137 | 143 | extern long udf_ioctl(struct file *, unsigned int, unsigned long); |
| @@ -167,8 +173,7 @@ extern int udf_add_aext(struct inode *, struct extent_position *, · 29 unmodified lines | ||
| 167 | 173 | struct kernel_lb_addr *, uint32_t, int); |
| 168 | 174 | extern void udf_write_aext(struct inode *, struct extent_position *, |
| 169 | 175 | struct kernel_lb_addr *, uint32_t, int); |
| 170 | −extern int8_t udf_delete_aext(struct inode *, struct extent_position, | |
| 171 | − struct kernel_lb_addr, uint32_t); | |
| 176 | +extern int8_t udf_delete_aext(struct inode *, struct extent_position); | |
| 172 | 177 | extern int8_t udf_next_aext(struct inode *, struct extent_position *, |
| 173 | 178 | struct kernel_lb_addr *, uint32_t *, int); |
| 174 | 179 | extern int8_t udf_current_aext(struct inode *, struct extent_position *, |
| @@ -157,6 +157,7 @@ __xfs_ag_resv_free( · 156 unmodified lines | ||
| 157 | 157 | error = xfs_mod_fdblocks(pag->pag_mount, oldresv, true); |
| 158 | 158 | resv->ar_reserved = 0; |
| 159 | 159 | resv->ar_asked = 0; |
| 160 | + resv->ar_orig_reserved = 0; | |
| 160 | 161 | |
| 161 | 162 | if (error) |
| 162 | 163 | trace_xfs_ag_resv_free_error(pag->pag_mount, pag->pag_agno, |
| @@ -189,13 +190,34 @@ __xfs_ag_resv_init( · 26 unmodified lines | ||
| 189 | 190 | struct xfs_mount *mp = pag->pag_mount; |
| 190 | 191 | struct xfs_ag_resv *resv; |
| 191 | 192 | int error; |
| 192 | − xfs_extlen_t reserved; | |
| 193 | + xfs_extlen_t hidden_space; | |
| 193 | 194 | |
| 194 | 195 | if (used > ask) |
| 195 | 196 | ask = used; |
| 196 | − reserved = ask - used; | |
| 197 | 197 | |
| 198 | − error = xfs_mod_fdblocks(mp, -(int64_t)reserved, true); | |
| 198 | + switch (type) { | |
| 199 | + case XFS_AG_RESV_RMAPBT: | |
| 200 | + /* | |
| 201 | + * Space taken by the rmapbt is not subtracted from fdblocks | |
| 202 | + * because the rmapbt lives in the free space. Here we must | |
| 203 | + * subtract the entire reservation from fdblocks so that we | |
| 204 | + * always have blocks available for rmapbt expansion. | |
| 205 | + */ | |
| 206 | + hidden_space = ask; | |
| 207 | + break; | |
| 208 | + case XFS_AG_RESV_METADATA: | |
| 209 | + /* | |
| 210 | + * Space taken by all other metadata btrees are accounted | |
| 211 | + * on-disk as used space. We therefore only hide the space | |
| 212 | + * that is reserved but not used by the trees. | |
| 213 | + */ | |
| 214 | + hidden_space = ask - used; | |
| 215 | + break; | |
| 216 | + default: | |
| 217 | + ASSERT(0); | |
| 218 | + return -EINVAL; | |
| 219 | + } | |
| 220 | + error = xfs_mod_fdblocks(mp, -(int64_t)hidden_space, true); | |
| 199 | 221 | if (error) { |
| 200 | 222 | trace_xfs_ag_resv_init_error(pag->pag_mount, pag->pag_agno, |
| 201 | 223 | error, _RET_IP_); |
| @@ -216,7 +238,8 @@ __xfs_ag_resv_init( · 14 unmodified lines | ||
| 216 | 238 | |
| 217 | 239 | resv = xfs_perag_resv(pag, type); |
| 218 | 240 | resv->ar_asked = ask; |
| 219 | − resv->ar_reserved = resv->ar_orig_reserved = reserved; | |
| 241 | + resv->ar_orig_reserved = hidden_space; | |
| 242 | + resv->ar_reserved = ask - used; | |
| 220 | 243 | |
| 221 | 244 | trace_xfs_ag_resv_init(pag, type, ask); |
| 222 | 245 | return 0; |
| @@ -5780,6 +5780,32 @@ del_cursor: · 5779 unmodified lines | ||
| 5780 | 5780 | return error; |
| 5781 | 5781 | } |
| 5782 | 5782 | |
| 5783 | +/* Make sure we won't be right-shifting an extent past the maximum bound. */ | |
| 5784 | +int | |
| 5785 | +xfs_bmap_can_insert_extents( | |
| 5786 | + struct xfs_inode *ip, | |
| 5787 | + xfs_fileoff_t off, | |
| 5788 | + xfs_fileoff_t shift) | |
| 5789 | +{ | |
| 5790 | + struct xfs_bmbt_irec got; | |
| 5791 | + int is_empty; | |
| 5792 | + int error = 0; | |
| 5793 | + | |
| 5794 | + ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); | |
| 5795 | + | |
| 5796 | + if (XFS_FORCED_SHUTDOWN(ip->i_mount)) | |
| 5797 | + return -EIO; | |
| 5798 | + | |
| 5799 | + xfs_ilock(ip, XFS_ILOCK_EXCL); | |
| 5800 | + error = xfs_bmap_last_extent(NULL, ip, XFS_DATA_FORK, &got, &is_empty); | |
| 5801 | + if (!error && !is_empty && got.br_startoff >= off && | |
| 5802 | + ((got.br_startoff + shift) & BMBT_STARTOFF_MASK) < got.br_startoff) | |
| 5803 | + error = -EINVAL; | |
| 5804 | + xfs_iunlock(ip, XFS_ILOCK_EXCL); | |
| 5805 | + | |
| 5806 | + return error; | |
| 5807 | +} | |
| 5808 | + | |
| 5783 | 5809 | int |
| 5784 | 5810 | xfs_bmap_insert_extents( |
| 5785 | 5811 | struct xfs_trans *tp, |
| @@ -227,6 +227,8 @@ int xfs_bmap_collapse_extents(struct xfs_trans *tp, struct xfs_inode *ip, · 226 unmodified lines | ||
| 227 | 227 | xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb, |
| 228 | 228 | bool *done, xfs_fsblock_t *firstblock, |
| 229 | 229 | struct xfs_defer_ops *dfops); |
| 230 | +int xfs_bmap_can_insert_extents(struct xfs_inode *ip, xfs_fileoff_t off, | |
| 231 | + xfs_fileoff_t shift); | |
| 230 | 232 | int xfs_bmap_insert_extents(struct xfs_trans *tp, struct xfs_inode *ip, |
| 231 | 233 | xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb, |
| 232 | 234 | bool *done, xfs_fileoff_t stop_fsb, xfs_fsblock_t *firstblock, |
| @@ -962,6 +962,9 @@ typedef enum xfs_dinode_fmt { · 961 unmodified lines | ||
| 962 | 962 | XFS_DFORK_DSIZE(dip, mp) : \ |
| 963 | 963 | XFS_DFORK_ASIZE(dip, mp)) |
| 964 | 964 | |
| 965 | +#define XFS_DFORK_MAXEXT(dip, mp, w) \ | |
| 966 | + (XFS_DFORK_SIZE(dip, mp, w) / sizeof(struct xfs_bmbt_rec)) | |
| 967 | + | |
| 965 | 968 | /* |
| 966 | 969 | * Return pointers to the data or attribute forks. |
| 967 | 970 | */ |
| @@ -1526,6 +1529,8 @@ typedef struct xfs_bmdr_block { · 558 unmodified lines | ||
| 1526 | 1529 | #define BMBT_STARTBLOCK_BITLEN 52 |
| 1527 | 1530 | #define BMBT_BLOCKCOUNT_BITLEN 21 |
| 1528 | 1531 | |
| 1532 | +#define BMBT_STARTOFF_MASK ((1ULL << BMBT_STARTOFF_BITLEN) - 1) | |
| 1533 | + | |
| 1529 | 1534 | typedef struct xfs_bmbt_rec { |
| 1530 | 1535 | __be64 l0, l1; |
| 1531 | 1536 | } xfs_bmbt_rec_t; |
| @@ -374,6 +374,47 @@ xfs_log_dinode_to_disk( · 373 unmodified lines | ||
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | +static xfs_failaddr_t | |
| 378 | +xfs_dinode_verify_fork( | |
| 379 | + struct xfs_dinode *dip, | |
| 380 | + struct xfs_mount *mp, | |
| 381 | + int whichfork) | |
| 382 | +{ | |
| 383 | + uint32_t di_nextents = XFS_DFORK_NEXTENTS(dip, whichfork); | |
| 384 | + | |
| 385 | + switch (XFS_DFORK_FORMAT(dip, whichfork)) { | |
| 386 | + case XFS_DINODE_FMT_LOCAL: | |
| 387 | + /* | |
| 388 | + * no local regular files yet | |
| 389 | + */ | |
| 390 | + if (whichfork == XFS_DATA_FORK) { | |
| 391 | + if (S_ISREG(be16_to_cpu(dip->di_mode))) | |
| 392 | + return __this_address; | |
| 393 | + if (be64_to_cpu(dip->di_size) > | |
| 394 | + XFS_DFORK_SIZE(dip, mp, whichfork)) | |
| 395 | + return __this_address; | |
| 396 | + } | |
| 397 | + if (di_nextents) | |
| 398 | + return __this_address; | |
| 399 | + break; | |
| 400 | + case XFS_DINODE_FMT_EXTENTS: | |
| 401 | + if (di_nextents > XFS_DFORK_MAXEXT(dip, mp, whichfork)) | |
| 402 | + return __this_address; | |
| 403 | + break; | |
| 404 | + case XFS_DINODE_FMT_BTREE: | |
| 405 | + if (whichfork == XFS_ATTR_FORK) { | |
| 406 | + if (di_nextents > MAXAEXTNUM) | |
| 407 | + return __this_address; | |
| 408 | + } else if (di_nextents > MAXEXTNUM) { | |
| 409 | + return __this_address; | |
| 410 | + } | |
| 411 | + break; | |
| 412 | + default: | |
| 413 | + return __this_address; | |
| 414 | + } | |
| 415 | + return NULL; | |
| 416 | +} | |
| 417 | + | |
| 377 | 418 | xfs_failaddr_t |
| 378 | 419 | xfs_dinode_verify( |
| 379 | 420 | struct xfs_mount *mp, |
| @@ -441,24 +482,9 @@ xfs_dinode_verify( · 61 unmodified lines | ||
| 441 | 482 | case S_IFREG: |
| 442 | 483 | case S_IFLNK: |
| 443 | 484 | case S_IFDIR: |
| 444 | − switch (dip->di_format) { | |
| 445 | − case XFS_DINODE_FMT_LOCAL: | |
| 446 | − /* | |
| 447 | − * no local regular files yet | |
| 448 | − */ | |
| 449 | − if (S_ISREG(mode)) | |
| 450 | − return __this_address; | |
| 451 | − if (di_size > XFS_DFORK_DSIZE(dip, mp)) | |
| 452 | − return __this_address; | |
| 453 | − if (dip->di_nextents) | |
| 454 | − return __this_address; | |
| 455 | − /* fall through */ | |
| 456 | − case XFS_DINODE_FMT_EXTENTS: | |
| 457 | − case XFS_DINODE_FMT_BTREE: | |
| 458 | − break; | |
| 459 | − default: | |
| 460 | − return __this_address; | |
| 461 | − } | |
| 485 | + fa = xfs_dinode_verify_fork(dip, mp, XFS_DATA_FORK); | |
| 486 | + if (fa) | |
| 487 | + return fa; | |
| 462 | 488 | break; |
| 463 | 489 | case 0: |
| 464 | 490 | /* Uninitialized inode ok. */ |
| @@ -468,17 +494,9 @@ xfs_dinode_verify( · 3 unmodified lines | ||
| 468 | 494 | } |
| 469 | 495 | |
| 470 | 496 | if (XFS_DFORK_Q(dip)) { |
| 471 | − switch (dip->di_aformat) { | |
| 472 | − case XFS_DINODE_FMT_LOCAL: | |
| 473 | − if (dip->di_anextents) | |
| 474 | − return __this_address; | |
| 475 | − /* fall through */ | |
| 476 | − case XFS_DINODE_FMT_EXTENTS: | |
| 477 | − case XFS_DINODE_FMT_BTREE: | |
| 478 | − break; | |
| 479 | − default: | |
| 480 | − return __this_address; | |
| 481 | − } | |
| 497 | + fa = xfs_dinode_verify_fork(dip, mp, XFS_ATTR_FORK); | |
| 498 | + if (fa) | |
| 499 | + return fa; | |
| 482 | 500 | } else { |
| 483 | 501 | /* |
| 484 | 502 | * If there is no fork offset, this may be a freshly-made inode |
| @@ -1029,8 +1029,8 @@ xfs_rtalloc_query_range( · 1028 unmodified lines | ||
| 1029 | 1029 | if (low_rec->ar_startext >= mp->m_sb.sb_rextents || |
| 1030 | 1030 | low_rec->ar_startext == high_rec->ar_startext) |
| 1031 | 1031 | return 0; |
| 1032 | − if (high_rec->ar_startext >= mp->m_sb.sb_rextents) | |
| 1033 | − high_rec->ar_startext = mp->m_sb.sb_rextents - 1; | |
| 1032 | + if (high_rec->ar_startext > mp->m_sb.sb_rextents) | |
| 1033 | + high_rec->ar_startext = mp->m_sb.sb_rextents; | |
| 1034 | 1034 | |
| 1035 | 1035 | /* Iterate the bitmap, looking for discrepancies. */ |
| 1036 | 1036 | rtstart = low_rec->ar_startext; |
| @@ -685,12 +685,10 @@ out_unlock_iolock: · 684 unmodified lines | ||
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | /* |
| 688 | − * dead simple method of punching delalyed allocation blocks from a range in | |
| 689 | − * the inode. Walks a block at a time so will be slow, but is only executed in | |
| 690 | − * rare error cases so the overhead is not critical. This will always punch out | |
| 691 | − * both the start and end blocks, even if the ranges only partially overlap | |
| 692 | − * them, so it is up to the caller to ensure that partial blocks are not | |
| 693 | − * passed in. | |
| 688 | + * Dead simple method of punching delalyed allocation blocks from a range in | |
| 689 | + * the inode. This will always punch out both the start and end blocks, even | |
| 690 | + * if the ranges only partially overlap them, so it is up to the caller to | |
| 691 | + * ensure that partial blocks are not passed in. | |
| 694 | 692 | */ |
| 695 | 693 | int |
| 696 | 694 | xfs_bmap_punch_delalloc_range( |
| @@ -698,63 +696,44 @@ xfs_bmap_punch_delalloc_range( · 1 unmodified line | ||
| 698 | 696 | xfs_fileoff_t start_fsb, |
| 699 | 697 | xfs_fileoff_t length) |
| 700 | 698 | { |
| 701 | − xfs_fileoff_t remaining = length; | |
| 699 | + struct xfs_ifork *ifp = &ip->i_df; | |
| 700 | + xfs_fileoff_t end_fsb = start_fsb + length; | |
| 701 | + struct xfs_bmbt_irec got, del; | |
| 702 | + struct xfs_iext_cursor icur; | |
| 702 | 703 | int error = 0; |
| 703 | 704 | |
| 704 | 705 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); |
| 705 | 706 | |
| 706 | − do { | |
| 707 | − int done; | |
| 708 | − xfs_bmbt_irec_t imap; | |
| 709 | − int nimaps = 1; | |
| 710 | − xfs_fsblock_t firstblock; | |
| 711 | − struct xfs_defer_ops dfops; | |
| 707 | + if (!(ifp->if_flags & XFS_IFEXTENTS)) { | |
| 708 | + error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK); | |
| 709 | + if (error) | |
| 710 | + return error; | |
| 711 | + } | |
| 712 | 712 | |
| 713 | − /* | |
| 714 | − * Map the range first and check that it is a delalloc extent | |
| 715 | − * before trying to unmap the range. Otherwise we will be | |
| 716 | − * trying to remove a real extent (which requires a | |
| 717 | − * transaction) or a hole, which is probably a bad idea... | |
| 718 | − */ | |
| 719 | − error = xfs_bmapi_read(ip, start_fsb, 1, &imap, &nimaps, | |
| 720 | − XFS_BMAPI_ENTIRE); | |
| 713 | + if (!xfs_iext_lookup_extent_before(ip, ifp, &end_fsb, &icur, &got)) | |
| 714 | + return 0; | |
| 721 | 715 | |
| 722 | − if (error) { | |
| 723 | − /* something screwed, just bail */ | |
| 724 | − if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { | |
| 725 | − xfs_alert(ip->i_mount, | |
| 726 | − "Failed delalloc mapping lookup ino %lld fsb %lld.", | |
| 727 | − ip->i_ino, start_fsb); | |
| 728 | − } | |
| 729 | − break; | |
| 730 | − } | |
| 731 | − if (!nimaps) { | |
| 732 | − /* nothing there */ | |
| 733 | − goto next_block; | |
| 734 | − } | |
| 735 | − if (imap.br_startblock != DELAYSTARTBLOCK) { | |
| 736 | − /* been converted, ignore */ | |
| 737 | − goto next_block; | |
| 738 | − } | |
| 739 | − WARN_ON(imap.br_blockcount == 0); | |
| 716 | + while (got.br_startoff + got.br_blockcount > start_fsb) { | |
| 717 | + del = got; | |
| 718 | + xfs_trim_extent(&del, start_fsb, length); | |
| 740 | 719 | |
| 741 | 720 | /* |
| 742 | − * Note: while we initialise the firstblock/dfops pair, they | |
| 743 | − * should never be used because blocks should never be | |
| 744 | − * allocated or freed for a delalloc extent and hence we need | |
| 745 | − * don't cancel or finish them after the xfs_bunmapi() call. | |
| 721 | + * A delete can push the cursor forward. Step back to the | |
| 722 | + * previous extent on non-delalloc or extents outside the | |
| 723 | + * target range. | |
| 746 | 724 | */ |
| 747 | − xfs_defer_init(&dfops, &firstblock); | |
| 748 | − error = xfs_bunmapi(NULL, ip, start_fsb, 1, 0, 1, &firstblock, | |
| 749 | − &dfops, &done); | |
| 750 | − if (error) | |
| 751 | − break; | |
| 725 | + if (!del.br_blockcount || | |
| 726 | + !isnullstartblock(del.br_startblock)) { | |
| 727 | + if (!xfs_iext_prev_extent(ifp, &icur, &got)) | |
| 728 | + break; | |
| 729 | + continue; | |
| 730 | + } | |
| 752 | 731 | |
| 753 | − ASSERT(!xfs_defer_has_unfinished_work(&dfops)); | |
| 754 | −next_block: | |
| 755 | − start_fsb++; | |
| 756 | − remaining--; | |
| 757 | − } while(remaining > 0); | |
| 732 | + error = xfs_bmap_del_extent_delay(ip, XFS_DATA_FORK, &icur, | |
| 733 | + &got, &del); | |
| 734 | + if (error || !xfs_iext_get_extent(ifp, &icur, &got)) | |
| 735 | + break; | |
| 736 | + } | |
| 758 | 737 | |
| 759 | 738 | return error; |
| 760 | 739 | } |
| @@ -1208,7 +1187,22 @@ xfs_free_file_space( · 447 unmodified lines | ||
| 1208 | 1187 | return 0; |
| 1209 | 1188 | if (offset + len > XFS_ISIZE(ip)) |
| 1210 | 1189 | len = XFS_ISIZE(ip) - offset; |
| 1211 | − return iomap_zero_range(VFS_I(ip), offset, len, NULL, &xfs_iomap_ops); | |
| 1190 | + error = iomap_zero_range(VFS_I(ip), offset, len, NULL, &xfs_iomap_ops); | |
| 1191 | + if (error) | |
| 1192 | + return error; | |
| 1193 | + | |
| 1194 | + /* | |
| 1195 | + * If we zeroed right up to EOF and EOF straddles a page boundary we | |
| 1196 | + * must make sure that the post-EOF area is also zeroed because the | |
| 1197 | + * page could be mmap'd and iomap_zero_range doesn't do that for us. | |
| 1198 | + * Writeback of the eof page will do this, albeit clumsily. | |
| 1199 | + */ | |
| 1200 | + if (offset + len >= XFS_ISIZE(ip) && ((offset + len) & PAGE_MASK)) { | |
| 1201 | + error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, | |
| 1202 | + (offset + len) & ~PAGE_MASK, LLONG_MAX); | |
| 1203 | + } | |
| 1204 | + | |
| 1205 | + return error; | |
| 1212 | 1206 | } |
| 1213 | 1207 | |
| 1214 | 1208 | /* |
| @@ -1404,6 +1398,10 @@ xfs_insert_file_space( · 189 unmodified lines | ||
| 1404 | 1398 | |
| 1405 | 1399 | trace_xfs_insert_file_space(ip); |
| 1406 | 1400 | |
| 1401 | + error = xfs_bmap_can_insert_extents(ip, stop_fsb, shift_fsb); | |
| 1402 | + if (error) | |
| 1403 | + return error; | |
| 1404 | + | |
| 1407 | 1405 | error = xfs_prepare_shift(ip, offset); |
| 1408 | 1406 | if (error) |
| 1409 | 1407 | return error; |
| @@ -513,8 +513,8 @@ xfs_getfsmap_rtdev_rtbitmap_query( · 512 unmodified lines | ||
| 513 | 513 | struct xfs_trans *tp, |
| 514 | 514 | struct xfs_getfsmap_info *info) |
| 515 | 515 | { |
| 516 | − struct xfs_rtalloc_rec alow; | |
| 517 | − struct xfs_rtalloc_rec ahigh; | |
| 516 | + struct xfs_rtalloc_rec alow = { 0 }; | |
| 517 | + struct xfs_rtalloc_rec ahigh = { 0 }; | |
| 518 | 518 | int error; |
| 519 | 519 | |
| 520 | 520 | xfs_ilock(tp->t_mountp->m_rbmip, XFS_ILOCK_SHARED); |
| @@ -387,7 +387,7 @@ xfs_reserve_blocks( · 386 unmodified lines | ||
| 387 | 387 | do { |
| 388 | 388 | free = percpu_counter_sum(&mp->m_fdblocks) - |
| 389 | 389 | mp->m_alloc_set_aside; |
| 390 | − if (!free) | |
| 390 | + if (free <= 0) | |
| 391 | 391 | break; |
| 392 | 392 | |
| 393 | 393 | delta = request - mp->m_resblks; |
| @@ -3236,7 +3236,6 @@ xfs_iflush_cluster( · 3235 unmodified lines | ||
| 3236 | 3236 | struct xfs_inode *cip; |
| 3237 | 3237 | int nr_found; |
| 3238 | 3238 | int clcount = 0; |
| 3239 | − int bufwasdelwri; | |
| 3240 | 3239 | int i; |
| 3241 | 3240 | |
| 3242 | 3241 | pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); |
| @@ -3360,37 +3359,22 @@ cluster_corrupt_out: · 117 unmodified lines | ||
| 3360 | 3359 | * inode buffer and shut down the filesystem. |
| 3361 | 3360 | */ |
| 3362 | 3361 | rcu_read_unlock(); |
| 3363 | − /* | |
| 3364 | − * Clean up the buffer. If it was delwri, just release it -- | |
| 3365 | − * brelse can handle it with no problems. If not, shut down the | |
| 3366 | − * filesystem before releasing the buffer. | |
| 3367 | − */ | |
| 3368 | − bufwasdelwri = (bp->b_flags & _XBF_DELWRI_Q); | |
| 3369 | − if (bufwasdelwri) | |
| 3370 | − xfs_buf_relse(bp); | |
| 3371 | − | |
| 3372 | 3362 | xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); |
| 3373 | 3363 | |
| 3374 | − if (!bufwasdelwri) { | |
| 3375 | − /* | |
| 3376 | − * Just like incore_relse: if we have b_iodone functions, | |
| 3377 | − * mark the buffer as an error and call them. Otherwise | |
| 3378 | − * mark it as stale and brelse. | |
| 3379 | − */ | |
| 3380 | − if (bp->b_iodone) { | |
| 3381 | − bp->b_flags &= ~XBF_DONE; | |
| 3382 | − xfs_buf_stale(bp); | |
| 3383 | − xfs_buf_ioerror(bp, -EIO); | |
| 3384 | − xfs_buf_ioend(bp); | |
| 3385 | − } else { | |
| 3386 | − xfs_buf_stale(bp); | |
| 3387 | − xfs_buf_relse(bp); | |
| 3388 | − } | |
| 3389 | − } | |
| 3390 | − | |
| 3391 | 3364 | /* |
| 3392 | − * Unlocks the flush lock | |
| 3365 | + * We'll always have an inode attached to the buffer for completion | |
| 3366 | + * process by the time we are called from xfs_iflush(). Hence we have | |
| 3367 | + * always need to do IO completion processing to abort the inodes | |
| 3368 | + * attached to the buffer. handle them just like the shutdown case in | |
| 3369 | + * xfs_buf_submit(). | |
| 3393 | 3370 | */ |
| 3371 | + ASSERT(bp->b_iodone); | |
| 3372 | + bp->b_flags &= ~XBF_DONE; | |
| 3373 | + xfs_buf_stale(bp); | |
| 3374 | + xfs_buf_ioerror(bp, -EIO); | |
| 3375 | + xfs_buf_ioend(bp); | |
| 3376 | + | |
| 3377 | + /* abort the corrupt inode, as it was not attached to the buffer */ | |
| 3394 | 3378 | xfs_iflush_abort(cip, false); |
| 3395 | 3379 | kmem_free(cilist); |
| 3396 | 3380 | xfs_perag_put(pag); |
| @@ -3486,12 +3470,17 @@ xfs_iflush( · 89 unmodified lines | ||
| 3486 | 3470 | xfs_log_force(mp, 0); |
| 3487 | 3471 | |
| 3488 | 3472 | /* |
| 3489 | − * inode clustering: | |
| 3490 | − * see if other inodes can be gathered into this write | |
| 3473 | + * inode clustering: try to gather other inodes into this write | |
| 3474 | + * | |
| 3475 | + * Note: Any error during clustering will result in the filesystem | |
| 3476 | + * being shut down and completion callbacks run on the cluster buffer. | |
| 3477 | + * As we have already flushed and attached this inode to the buffer, | |
| 3478 | + * it has already been aborted and released by xfs_iflush_cluster() and | |
| 3479 | + * so we have no further error handling to do here. | |
| 3491 | 3480 | */ |
| 3492 | 3481 | error = xfs_iflush_cluster(ip, bp); |
| 3493 | 3482 | if (error) |
| 3494 | − goto cluster_corrupt_out; | |
| 3483 | + return error; | |
| 3495 | 3484 | |
| 3496 | 3485 | *bpp = bp; |
| 3497 | 3486 | return 0; |
| @@ -3500,12 +3489,8 @@ corrupt_out: · 2 unmodified lines | ||
| 3500 | 3489 | if (bp) |
| 3501 | 3490 | xfs_buf_relse(bp); |
| 3502 | 3491 | xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); |
| 3503 | −cluster_corrupt_out: | |
| 3504 | − error = -EFSCORRUPTED; | |
| 3505 | 3492 | abort_out: |
| 3506 | − /* | |
| 3507 | − * Unlocks the flush lock | |
| 3508 | − */ | |
| 3493 | + /* abort the corrupt inode, as it was not attached to the buffer */ | |
| 3509 | 3494 | xfs_iflush_abort(ip, false); |
| 3510 | 3495 | return error; |
| 3511 | 3496 | } |
| @@ -963,12 +963,13 @@ xfs_ilock_for_iomap( · 962 unmodified lines | ||
| 963 | 963 | unsigned *lockmode) |
| 964 | 964 | { |
| 965 | 965 | unsigned mode = XFS_ILOCK_SHARED; |
| 966 | + bool is_write = flags & (IOMAP_WRITE | IOMAP_ZERO); | |
| 966 | 967 | |
| 967 | 968 | /* |
| 968 | 969 | * COW writes may allocate delalloc space or convert unwritten COW |
| 969 | 970 | * extents, so we need to make sure to take the lock exclusively here. |
| 970 | 971 | */ |
| 971 | − if (xfs_is_reflink_inode(ip) && (flags & (IOMAP_WRITE | IOMAP_ZERO))) { | |
| 972 | + if (xfs_is_reflink_inode(ip) && is_write) { | |
| 972 | 973 | /* |
| 973 | 974 | * FIXME: It could still overwrite on unshared extents and not |
| 974 | 975 | * need allocation. |
| @@ -989,6 +990,7 @@ xfs_ilock_for_iomap( · 14 unmodified lines | ||
| 989 | 990 | mode = XFS_ILOCK_EXCL; |
| 990 | 991 | } |
| 991 | 992 | |
| 993 | +relock: | |
| 992 | 994 | if (flags & IOMAP_NOWAIT) { |
| 993 | 995 | if (!xfs_ilock_nowait(ip, mode)) |
| 994 | 996 | return -EAGAIN; |
| @@ -996,6 +998,17 @@ xfs_ilock_for_iomap( · 1 unmodified line | ||
| 996 | 998 | xfs_ilock(ip, mode); |
| 997 | 999 | } |
| 998 | 1000 | |
| 1001 | + /* | |
| 1002 | + * The reflink iflag could have changed since the earlier unlocked | |
| 1003 | + * check, so if we got ILOCK_SHARED for a write and but we're now a | |
| 1004 | + * reflink inode we have to switch to ILOCK_EXCL and relock. | |
| 1005 | + */ | |
| 1006 | + if (mode == XFS_ILOCK_SHARED && is_write && xfs_is_reflink_inode(ip)) { | |
| 1007 | + xfs_iunlock(ip, mode); | |
| 1008 | + mode = XFS_ILOCK_EXCL; | |
| 1009 | + goto relock; | |
| 1010 | + } | |
| 1011 | + | |
| 999 | 1012 | *lockmode = mode; |
| 1000 | 1013 | return 0; |
| 1001 | 1014 | } |
| @@ -258,7 +258,12 @@ xfs_trans_alloc( · 257 unmodified lines | ||
| 258 | 258 | if (!(flags & XFS_TRANS_NO_WRITECOUNT)) |
| 259 | 259 | sb_start_intwrite(mp->m_super); |
| 260 | 260 | |
| 261 | − WARN_ON(mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE); | |
| 261 | + /* | |
| 262 | + * Zero-reservation ("empty") transactions can't modify anything, so | |
| 263 | + * they're allowed to run while we're frozen. | |
| 264 | + */ | |
| 265 | + WARN_ON(resp->tr_logres > 0 && | |
| 266 | + mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE); | |
| 262 | 267 | atomic_inc(&mp->m_active_trans); |
| 263 | 268 | |
| 264 | 269 | tp = kmem_zone_zalloc(xfs_trans_zone, |
| @@ -309,7 +309,7 @@ static inline void acpi_processor_ppc_exit(void) · 308 unmodified lines | ||
| 309 | 309 | { |
| 310 | 310 | return; |
| 311 | 311 | } |
| 312 | −static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr, | |
| 312 | +static inline void acpi_processor_ppc_has_changed(struct acpi_processor *pr, | |
| 313 | 313 | int event_flag) |
| 314 | 314 | { |
| 315 | 315 | static unsigned int printout = 1; |
| @@ -320,7 +320,6 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr, · 4 unmodified lines | ||
| 320 | 320 | "Consider compiling CPUfreq support into your kernel.\n"); |
| 321 | 321 | printout = 0; |
| 322 | 322 | } |
| 323 | − return 0; | |
| 324 | 323 | } |
| 325 | 324 | static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit) |
| 326 | 325 | { |
| @@ -63,7 +63,7 @@ typedef struct qspinlock { · 62 unmodified lines | ||
| 63 | 63 | /* |
| 64 | 64 | * Initializier |
| 65 | 65 | */ |
| 66 | −#define __ARCH_SPIN_LOCK_UNLOCKED { .val = ATOMIC_INIT(0) } | |
| 66 | +#define __ARCH_SPIN_LOCK_UNLOCKED { { .val = ATOMIC_INIT(0) } } | |
| 67 | 67 | |
| 68 | 68 | /* |
| 69 | 69 | * Bitfields in the atomic value: |
| @@ -245,7 +245,8 @@ ssize_t af_alg_sendpage(struct socket *sock, struct page *page, · 244 unmodified lines | ||
| 245 | 245 | int offset, size_t size, int flags); |
| 246 | 246 | void af_alg_free_resources(struct af_alg_async_req *areq); |
| 247 | 247 | void af_alg_async_cb(struct crypto_async_request *_req, int err); |
| 248 | −__poll_t af_alg_poll_mask(struct socket *sock, __poll_t events); | |
| 248 | +__poll_t af_alg_poll(struct file *file, struct socket *sock, | |
| 249 | + poll_table *wait); | |
| 249 | 250 | struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk, |
| 250 | 251 | unsigned int areqlen); |
| 251 | 252 | int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags, |
| @@ -443,6 +443,9 @@ int acpi_check_resource_conflict(const struct resource *res); · 442 unmodified lines | ||
| 443 | 443 | int acpi_check_region(resource_size_t start, resource_size_t n, |
| 444 | 444 | const char *name); |
| 445 | 445 | |
| 446 | +acpi_status acpi_release_memory(acpi_handle handle, struct resource *res, | |
| 447 | + u32 level); | |
| 448 | + | |
| 446 | 449 | int acpi_resources_are_enforced(void); |
| 447 | 450 | |
| 448 | 451 | #ifdef CONFIG_HIBERNATION |
| @@ -214,6 +214,7 @@ struct atmphy_ops { · 213 unmodified lines | ||
| 214 | 214 | struct atm_skb_data { |
| 215 | 215 | struct atm_vcc *vcc; /* ATM VCC */ |
| 216 | 216 | unsigned long atm_options; /* ATM layer options */ |
| 217 | + unsigned int acct_truesize; /* truesize accounted to vcc */ | |
| 217 | 218 | }; |
| 218 | 219 | |
| 219 | 220 | #define VCC_HTABLE_SIZE 32 |
| @@ -241,6 +242,20 @@ void vcc_insert_socket(struct sock *sk); · 21 unmodified lines | ||
| 241 | 242 | |
| 242 | 243 | void atm_dev_release_vccs(struct atm_dev *dev); |
| 243 | 244 | |
| 245 | +static inline void atm_account_tx(struct atm_vcc *vcc, struct sk_buff *skb) | |
| 246 | +{ | |
| 247 | + /* | |
| 248 | + * Because ATM skbs may not belong to a sock (and we don't | |
| 249 | + * necessarily want to), skb->truesize may be adjusted, | |
| 250 | + * escaping the hack in pskb_expand_head() which avoids | |
| 251 | + * doing so for some cases. So stash the value of truesize | |
| 252 | + * at the time we accounted it, and atm_pop_raw() can use | |
| 253 | + * that value later, in case it changes. | |
| 254 | + */ | |
| 255 | + refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); | |
| 256 | + ATM_SKB(skb)->acct_truesize = skb->truesize; | |
| 257 | + ATM_SKB(skb)->atm_options = vcc->atm_options; | |
| 258 | +} | |
| 244 | 259 | |
| 245 | 260 | static inline void atm_force_charge(struct atm_vcc *vcc,int truesize) |
| 246 | 261 | { |
| @@ -22,7 +22,6 @@ struct dentry; · 21 unmodified lines | ||
| 22 | 22 | */ |
| 23 | 23 | enum wb_state { |
| 24 | 24 | WB_registered, /* bdi_register() was done */ |
| 25 | − WB_shutting_down, /* wb_shutdown() in progress */ | |
| 26 | 25 | WB_writeback_running, /* Writeback is in progress */ |
| 27 | 26 | WB_has_dirty_io, /* Dirty inodes on ->b_{dirty|io|more_io} */ |
| 28 | 27 | WB_start_all, /* nr_pages == 0 (all) work pending */ |
| @@ -189,6 +188,7 @@ struct backing_dev_info { · 160 unmodified lines | ||
| 189 | 188 | #ifdef CONFIG_CGROUP_WRITEBACK |
| 190 | 189 | struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */ |
| 191 | 190 | struct rb_root cgwb_congested_tree; /* their congested states */ |
| 191 | + struct mutex cgwb_release_mutex; /* protect shutdown of wb structs */ | |
| 192 | 192 | #else |
| 193 | 193 | struct bdi_writeback_congested *wb_congested; |
| 194 | 194 | #endif |
| @@ -1119,8 +1119,8 @@ static inline unsigned int blk_max_size_offset(struct request_queue *q, · 1118 unmodified lines | ||
| 1119 | 1119 | if (!q->limits.chunk_sectors) |
| 1120 | 1120 | return q->limits.max_sectors; |
| 1121 | 1121 | |
| 1122 | − return q->limits.chunk_sectors - | |
| 1123 | − (offset & (q->limits.chunk_sectors - 1)); | |
| 1122 | + return min(q->limits.max_sectors, (unsigned int)(q->limits.chunk_sectors - | |
| 1123 | + (offset & (q->limits.chunk_sectors - 1)))); | |
| 1124 | 1124 | } |
| 1125 | 1125 | |
| 1126 | 1126 | static inline unsigned int blk_rq_get_max_sectors(struct request *rq, |
| @@ -488,12 +488,15 @@ void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth); · 487 unmodified lines | ||
| 488 | 488 | |
| 489 | 489 | /* Map specifics */ |
| 490 | 490 | struct xdp_buff; |
| 491 | +struct sk_buff; | |
| 491 | 492 | |
| 492 | 493 | struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key); |
| 493 | 494 | void __dev_map_insert_ctx(struct bpf_map *map, u32 index); |
| 494 | 495 | void __dev_map_flush(struct bpf_map *map); |
| 495 | 496 | int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, |
| 496 | 497 | struct net_device *dev_rx); |
| 498 | +int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb, | |
| 499 | + struct bpf_prog *xdp_prog); | |
| 497 | 500 | |
| 498 | 501 | struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key); |
| 499 | 502 | void __cpu_map_insert_ctx(struct bpf_map *map, u32 index); |
| @@ -586,6 +589,15 @@ int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, · 86 unmodified lines | ||
| 586 | 589 | return 0; |
| 587 | 590 | } |
| 588 | 591 | |
| 592 | +struct sk_buff; | |
| 593 | + | |
| 594 | +static inline int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, | |
| 595 | + struct sk_buff *skb, | |
| 596 | + struct bpf_prog *xdp_prog) | |
| 597 | +{ | |
| 598 | + return 0; | |
| 599 | +} | |
| 600 | + | |
| 589 | 601 | static inline |
| 590 | 602 | struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key) |
| 591 | 603 | { |
| @@ -72,6 +72,9 @@ · 71 unmodified lines | ||
| 72 | 72 | */ |
| 73 | 73 | #ifndef COMPAT_SYSCALL_DEFINEx |
| 74 | 74 | #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ |
| 75 | + __diag_push(); \ | |
| 76 | + __diag_ignore(GCC, 8, "-Wattribute-alias", \ | |
| 77 | + "Type aliasing is used to sanitize syscall arguments");\ | |
| 75 | 78 | asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ |
| 76 | 79 | asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ |
| 77 | 80 | __attribute__((alias(__stringify(__se_compat_sys##name)))); \ |
| @@ -80,8 +83,11 @@ · 2 unmodified lines | ||
| 80 | 83 | asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ |
| 81 | 84 | asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ |
| 82 | 85 | { \ |
| 83 | − return __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\ | |
| 86 | + long ret = __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\ | |
| 87 | + __MAP(x,__SC_TEST,__VA_ARGS__); \ | |
| 88 | + return ret; \ | |
| 84 | 89 | } \ |
| 90 | + __diag_pop(); \ | |
| 85 | 91 | static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) |
| 86 | 92 | #endif /* COMPAT_SYSCALL_DEFINEx */ |
| 87 | 93 | |
| @@ -347,3 +347,28 @@ · 346 unmodified lines | ||
| 347 | 347 | #if GCC_VERSION >= 50100 |
| 348 | 348 | #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 |
| 349 | 349 | #endif |
| 350 | + | |
| 351 | +/* | |
| 352 | + * Turn individual warnings and errors on and off locally, depending | |
| 353 | + * on version. | |
| 354 | + */ | |
| 355 | +#define __diag_GCC(version, severity, s) \ | |
| 356 | + __diag_GCC_ ## version(__diag_GCC_ ## severity s) | |
| 357 | + | |
| 358 | +/* Severity used in pragma directives */ | |
| 359 | +#define __diag_GCC_ignore ignored | |
| 360 | +#define __diag_GCC_warn warning | |
| 361 | +#define __diag_GCC_error error | |
| 362 | + | |
| 363 | +/* Compilers before gcc-4.6 do not understand "#pragma GCC diagnostic push" */ | |
| 364 | +#if GCC_VERSION >= 40600 | |
| 365 | +#define __diag_str1(s) #s | |
| 366 | +#define __diag_str(s) __diag_str1(s) | |
| 367 | +#define __diag(s) _Pragma(__diag_str(GCC diagnostic s)) | |
| 368 | +#endif | |
| 369 | + | |
| 370 | +#if GCC_VERSION >= 80000 | |
| 371 | +#define __diag_GCC_8(s) __diag(s) | |
| 372 | +#else | |
| 373 | +#define __diag_GCC_8(s) | |
| 374 | +#endif | |
| @@ -271,4 +271,22 @@ struct ftrace_likely_data { · 270 unmodified lines | ||
| 271 | 271 | # define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) |
| 272 | 272 | #endif |
| 273 | 273 | |
| 274 | +#ifndef __diag | |
| 275 | +#define __diag(string) | |
| 276 | +#endif | |
| 277 | + | |
| 278 | +#ifndef __diag_GCC | |
| 279 | +#define __diag_GCC(version, severity, string) | |
| 280 | +#endif | |
| 281 | + | |
| 282 | +#define __diag_push() __diag(push) | |
| 283 | +#define __diag_pop() __diag(pop) | |
| 284 | + | |
| 285 | +#define __diag_ignore(compiler, version, option, comment) \ | |
| 286 | + __diag_ ## compiler(version, ignore, option) | |
| 287 | +#define __diag_warn(compiler, version, option, comment) \ | |
| 288 | + __diag_ ## compiler(version, warn, option) | |
| 289 | +#define __diag_error(compiler, version, option, comment) \ | |
| 290 | + __diag_ ## compiler(version, error, option) | |
| 291 | + | |
| 274 | 292 | #endif /* __LINUX_COMPILER_TYPES_H */ |
| @@ -135,7 +135,7 @@ void dax_flush(struct dax_device *dax_dev, void *addr, size_t size); · 134 unmodified lines | ||
| 135 | 135 | |
| 136 | 136 | ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, |
| 137 | 137 | const struct iomap_ops *ops); |
| 138 | −int dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size, | |
| 138 | +vm_fault_t dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size, | |
| 139 | 139 | pfn_t *pfnp, int *errp, const struct iomap_ops *ops); |
| 140 | 140 | vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf, |
| 141 | 141 | enum page_entry_size pe_size, pfn_t pfn); |
| @@ -48,7 +48,7 @@ · 47 unmodified lines | ||
| 48 | 48 | * CMA should not be used by the device drivers directly. It is |
| 49 | 49 | * only a helper framework for dma-mapping subsystem. |
| 50 | 50 | * |
| 51 | − * For more information, see kernel-docs in drivers/base/dma-contiguous.c | |
| 51 | + * For more information, see kernel-docs in kernel/dma/contiguous.c | |
| 52 | 52 | */ |
| 53 | 53 | |
| 54 | 54 | #ifdef __KERNEL__ |
| @@ -19,6 +19,7 @@ · 18 unmodified lines | ||
| 19 | 19 | #include <linux/cryptohash.h> |
| 20 | 20 | #include <linux/set_memory.h> |
| 21 | 21 | #include <linux/kallsyms.h> |
| 22 | +#include <linux/if_vlan.h> | |
| 22 | 23 | |
| 23 | 24 | #include <net/sch_generic.h> |
| 24 | 25 | |
| @@ -469,8 +470,11 @@ struct sock_fprog_kern { · 444 unmodified lines | ||
| 469 | 470 | }; |
| 470 | 471 | |
| 471 | 472 | struct bpf_binary_header { |
| 472 | − unsigned int pages; | |
| 473 | − u8 image[]; | |
| 473 | + u16 pages; | |
| 474 | + u16 locked:1; | |
| 475 | + | |
| 476 | + /* Some arches need word alignment for their instructions */ | |
| 477 | + u8 image[] __aligned(4); | |
| 474 | 478 | }; |
| 475 | 479 | |
| 476 | 480 | struct bpf_prog { |
| @@ -671,15 +675,18 @@ bpf_ctx_narrow_access_ok(u32 off, u32 size, u32 size_default) · 194 unmodified lines | ||
| 671 | 675 | |
| 672 | 676 | #define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0])) |
| 673 | 677 | |
| 674 | −#ifdef CONFIG_ARCH_HAS_SET_MEMORY | |
| 675 | 678 | static inline void bpf_prog_lock_ro(struct bpf_prog *fp) |
| 676 | 679 | { |
| 680 | +#ifdef CONFIG_ARCH_HAS_SET_MEMORY | |
| 677 | 681 | fp->locked = 1; |
| 678 | − WARN_ON_ONCE(set_memory_ro((unsigned long)fp, fp->pages)); | |
| 682 | + if (set_memory_ro((unsigned long)fp, fp->pages)) | |
| 683 | + fp->locked = 0; | |
| 684 | +#endif | |
| 679 | 685 | } |
| 680 | 686 | |
| 681 | 687 | static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) |
| 682 | 688 | { |
| 689 | +#ifdef CONFIG_ARCH_HAS_SET_MEMORY | |
| 683 | 690 | if (fp->locked) { |
| 684 | 691 | WARN_ON_ONCE(set_memory_rw((unsigned long)fp, fp->pages)); |
| 685 | 692 | /* In case set_memory_rw() fails, we want to be the first |
| @@ -687,34 +694,30 @@ static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) · 1 unmodified line | ||
| 687 | 694 | */ |
| 688 | 695 | fp->locked = 0; |
| 689 | 696 | } |
| 697 | +#endif | |
| 690 | 698 | } |
| 691 | 699 | |
| 692 | 700 | static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr) |
| 693 | 701 | { |
| 694 | − WARN_ON_ONCE(set_memory_ro((unsigned long)hdr, hdr->pages)); | |
| 695 | −} | |
| 696 | − | |
| 697 | −static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr) | |
| 698 | −{ | |
| 699 | − WARN_ON_ONCE(set_memory_rw((unsigned long)hdr, hdr->pages)); | |
| 700 | −} | |
| 701 | −#else | |
| 702 | −static inline void bpf_prog_lock_ro(struct bpf_prog *fp) | |
| 703 | −{ | |
| 704 | −} | |
| 705 | − | |
| 706 | −static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) | |
| 707 | −{ | |
| 708 | −} | |
| 709 | − | |
| 710 | −static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr) | |
| 711 | −{ | |
| 702 | +#ifdef CONFIG_ARCH_HAS_SET_MEMORY | |
| 703 | + hdr->locked = 1; | |
| 704 | + if (set_memory_ro((unsigned long)hdr, hdr->pages)) | |
| 705 | + hdr->locked = 0; | |
| 706 | +#endif | |
| 712 | 707 | } |
| 713 | 708 | |
| 714 | 709 | static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr) |
| 715 | 710 | { |
| 711 | +#ifdef CONFIG_ARCH_HAS_SET_MEMORY | |
| 712 | + if (hdr->locked) { | |
| 713 | + WARN_ON_ONCE(set_memory_rw((unsigned long)hdr, hdr->pages)); | |
| 714 | + /* In case set_memory_rw() fails, we want to be the first | |
| 715 | + * to crash here instead of some random place later on. | |
| 716 | + */ | |
| 717 | + hdr->locked = 0; | |
| 718 | + } | |
| 719 | +#endif | |
| 716 | 720 | } |
| 717 | −#endif /* CONFIG_ARCH_HAS_SET_MEMORY */ | |
| 718 | 721 | |
| 719 | 722 | static inline struct bpf_binary_header * |
| 720 | 723 | bpf_jit_binary_hdr(const struct bpf_prog *fp) |
| @@ -725,6 +728,22 @@ bpf_jit_binary_hdr(const struct bpf_prog *fp) · 4 unmodified lines | ||
| 725 | 728 | return (void *)addr; |
| 726 | 729 | } |
| 727 | 730 | |
| 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 | + | |
| 728 | 747 | int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap); |
| 729 | 748 | static inline int sk_filter(struct sock *sk, struct sk_buff *skb) |
| 730 | 749 | { |
| @@ -786,6 +805,21 @@ static inline bool bpf_dump_raw_ok(void) · 55 unmodified lines | ||
| 786 | 805 | struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, |
| 787 | 806 | const struct bpf_insn *patch, u32 len); |
| 788 | 807 | |
| 808 | +static inline int __xdp_generic_ok_fwd_dev(struct sk_buff *skb, | |
| 809 | + struct net_device *fwd) | |
| 810 | +{ | |
| 811 | + unsigned int len; | |
| 812 | + | |
| 813 | + if (unlikely(!(fwd->flags & IFF_UP))) | |
| 814 | + return -ENETDOWN; | |
| 815 | + | |
| 816 | + len = fwd->mtu + fwd->hard_header_len + VLAN_HLEN; | |
| 817 | + if (skb->len > len) | |
| 818 | + return -EMSGSIZE; | |
| 819 | + | |
| 820 | + return 0; | |
| 821 | +} | |
| 822 | + | |
| 789 | 823 | /* The pair of xdp_do_redirect and xdp_do_flush_map MUST be called in the |
| 790 | 824 | * same cpu context. Further for best results no more than a single map |
| 791 | 825 | * for the do_redirect/do_flush pair should be used. This limitation is |
| @@ -961,6 +995,9 @@ static inline void bpf_prog_kallsyms_del(struct bpf_prog *fp) · 169 unmodified lines | ||
| 961 | 995 | } |
| 962 | 996 | #endif /* CONFIG_BPF_JIT */ |
| 963 | 997 | |
| 998 | +void bpf_prog_kallsyms_del_subprogs(struct bpf_prog *fp); | |
| 999 | +void bpf_prog_kallsyms_del_all(struct bpf_prog *fp); | |
| 1000 | + | |
| 964 | 1001 | #define BPF_ANC BIT(15) |
| 965 | 1002 | |
| 966 | 1003 | static inline bool bpf_needs_clear_a(const struct sock_filter *first) |
| @@ -1720,8 +1720,6 @@ struct file_operations { · 1719 unmodified lines | ||
| 1720 | 1720 | int (*iterate) (struct file *, struct dir_context *); |
| 1721 | 1721 | int (*iterate_shared) (struct file *, struct dir_context *); |
| 1722 | 1722 | __poll_t (*poll) (struct file *, struct poll_table_struct *); |
| 1723 | − struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t); | |
| 1724 | − __poll_t (*poll_mask) (struct file *, __poll_t); | |
| 1725 | 1723 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
| 1726 | 1724 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
| 1727 | 1725 | int (*mmap) (struct file *, struct vm_area_struct *); |
| @@ -141,7 +141,7 @@ int iio_dma_buffer_read(struct iio_buffer *buffer, size_t n, · 140 unmodified lines | ||
| 141 | 141 | char __user *user_buffer); |
| 142 | 142 | size_t iio_dma_buffer_data_available(struct iio_buffer *buffer); |
| 143 | 143 | int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd); |
| 144 | −int iio_dma_buffer_set_length(struct iio_buffer *buffer, int length); | |
| 144 | +int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length); | |
| 145 | 145 | int iio_dma_buffer_request_update(struct iio_buffer *buffer); |
| 146 | 146 | |
| 147 | 147 | int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, |
| @@ -100,7 +100,7 @@ static inline bool input_is_mt_axis(int axis) · 99 unmodified lines | ||
| 100 | 100 | return axis == ABS_MT_SLOT || input_is_mt_value(axis); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | −void input_mt_report_slot_state(struct input_dev *dev, | |
| 103 | +bool input_mt_report_slot_state(struct input_dev *dev, | |
| 104 | 104 | unsigned int tool_type, bool active); |
| 105 | 105 | |
| 106 | 106 | void input_mt_report_finger_count(struct input_dev *dev, int count); |
| @@ -503,6 +503,7 @@ struct irq_chip { · 502 unmodified lines | ||
| 503 | 503 | * IRQCHIP_SKIP_SET_WAKE: Skip chip.irq_set_wake(), for this irq chip |
| 504 | 504 | * IRQCHIP_ONESHOT_SAFE: One shot does not require mask/unmask |
| 505 | 505 | * IRQCHIP_EOI_THREADED: Chip requires eoi() on unmask in threaded mode |
| 506 | + * IRQCHIP_SUPPORTS_LEVEL_MSI Chip can provide two doorbells for Level MSIs | |
| 506 | 507 | */ |
| 507 | 508 | enum { |
| 508 | 509 | IRQCHIP_SET_TYPE_MASKED = (1 << 0), |
| @@ -145,11 +145,6 @@ static inline void *irq_desc_get_handler_data(struct irq_desc *desc) · 144 unmodified lines | ||
| 145 | 145 | return desc->irq_common_data.handler_data; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | −static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc) | |
| 149 | −{ | |
| 150 | − return desc->irq_common_data.msi_desc; | |
| 151 | −} | |
| 152 | − | |
| 153 | 148 | /* |
| 154 | 149 | * Architectures call this to let the generic IRQ layer |
| 155 | 150 | * handle an interrupt. |
| @@ -666,7 +666,7 @@ do { \ · 665 unmodified lines | ||
| 666 | 666 | * your code. (Extra memory is used for special buffers that are |
| 667 | 667 | * allocated when trace_printk() is used.) |
| 668 | 668 | * |
| 669 | − * A little optization trick is done here. If there's only one | |
| 669 | + * A little optimization trick is done here. If there's only one | |
| 670 | 670 | * argument, there's no need to scan the string for printf formats. |
| 671 | 671 | * The trace_puts() will suffice. But how can we take advantage of |
| 672 | 672 | * using trace_puts() when trace_printk() has only one argument? |
| @@ -38,6 +38,7 @@ struct memory_block { · 37 unmodified lines | ||
| 38 | 38 | |
| 39 | 39 | int arch_get_memory_phys_device(unsigned long start_pfn); |
| 40 | 40 | unsigned long memory_block_size_bytes(void); |
| 41 | +int set_memory_block_size_order(unsigned int order); | |
| 41 | 42 | |
| 42 | 43 | /* These states are exposed to userspace as text strings in sysfs */ |
| 43 | 44 | #define MEM_ONLINE (1<<0) /* exposed to userspace */ |
| @@ -501,6 +501,7 @@ enum dmi_field { · 500 unmodified lines | ||
| 501 | 501 | DMI_PRODUCT_VERSION, |
| 502 | 502 | DMI_PRODUCT_SERIAL, |
| 503 | 503 | DMI_PRODUCT_UUID, |
| 504 | + DMI_PRODUCT_SKU, | |
| 504 | 505 | DMI_PRODUCT_FAMILY, |
| 505 | 506 | DMI_BOARD_VENDOR, |
| 506 | 507 | DMI_BOARD_NAME, |
| @@ -147,7 +147,6 @@ struct proto_ops { · 146 unmodified lines | ||
| 147 | 147 | int (*getname) (struct socket *sock, |
| 148 | 148 | struct sockaddr *addr, |
| 149 | 149 | int peer); |
| 150 | − __poll_t (*poll_mask) (struct socket *sock, __poll_t events); | |
| 151 | 150 | __poll_t (*poll) (struct file *file, struct socket *sock, |
| 152 | 151 | struct poll_table_struct *wait); |
| 153 | 152 | int (*ioctl) (struct socket *sock, unsigned int cmd, |
| @@ -1438,6 +1438,8 @@ enum { · 1437 unmodified lines | ||
| 1438 | 1438 | NFS_IOHDR_EOF, |
| 1439 | 1439 | NFS_IOHDR_REDO, |
| 1440 | 1440 | NFS_IOHDR_STAT, |
| 1441 | + NFS_IOHDR_RESEND_PNFS, | |
| 1442 | + NFS_IOHDR_RESEND_MDS, | |
| 1441 | 1443 | }; |
| 1442 | 1444 | |
| 1443 | 1445 | struct nfs_io_completion; |
| @@ -234,7 +234,7 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); · 233 unmodified lines | ||
| 234 | 234 | int of_genpd_parse_idle_states(struct device_node *dn, |
| 235 | 235 | struct genpd_power_state **states, int *n); |
| 236 | 236 | unsigned int of_genpd_opp_to_performance_state(struct device *dev, |
| 237 | − struct device_node *opp_node); | |
| 237 | + struct device_node *np); | |
| 238 | 238 | |
| 239 | 239 | int genpd_dev_pm_attach(struct device *dev); |
| 240 | 240 | struct device *genpd_dev_pm_attach_by_id(struct device *dev, |
| @@ -274,9 +274,9 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn, · 33 unmodified lines | ||
| 274 | 274 | |
| 275 | 275 | static inline unsigned int |
| 276 | 276 | of_genpd_opp_to_performance_state(struct device *dev, |
| 277 | − struct device_node *opp_node) | |
| 277 | + struct device_node *np) | |
| 278 | 278 | { |
| 279 | − return -ENODEV; | |
| 279 | + return 0; | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | static inline int genpd_dev_pm_attach(struct device *dev) |
| @@ -74,18 +74,18 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) · 73 unmodified lines | ||
| 74 | 74 | pt->_key = ~(__poll_t)0; /* all events enabled */ |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | −static inline bool file_has_poll_mask(struct file *file) | |
| 77 | +static inline bool file_can_poll(struct file *file) | |
| 78 | 78 | { |
| 79 | − return file->f_op->get_poll_head && file->f_op->poll_mask; | |
| 79 | + return file->f_op->poll; | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | −static inline bool file_can_poll(struct file *file) | |
| 82 | +static inline __poll_t vfs_poll(struct file *file, struct poll_table_struct *pt) | |
| 83 | 83 | { |
| 84 | − return file->f_op->poll || file_has_poll_mask(file); | |
| 84 | + if (unlikely(!file->f_op->poll)) | |
| 85 | + return DEFAULT_POLLMASK; | |
| 86 | + return file->f_op->poll(file, pt); | |
| 85 | 87 | } |
| 86 | 88 | |
| 87 | −__poll_t vfs_poll(struct file *file, struct poll_table_struct *pt); | |
| 88 | − | |
| 89 | 89 | struct poll_table_entry { |
| 90 | 90 | struct file *filp; |
| 91 | 91 | __poll_t key; |
| @@ -98,5 +98,7 @@ extern __must_check bool refcount_dec_if_one(refcount_t *r); · 97 unmodified lines | ||
| 98 | 98 | extern __must_check bool refcount_dec_not_one(refcount_t *r); |
| 99 | 99 | extern __must_check bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock); |
| 100 | 100 | extern __must_check bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock); |
| 101 | − | |
| 101 | +extern __must_check bool refcount_dec_and_lock_irqsave(refcount_t *r, | |
| 102 | + spinlock_t *lock, | |
| 103 | + unsigned long *flags); | |
| 102 | 104 | #endif /* _LINUX_REFCOUNT_H */ |
| @@ -354,6 +354,8 @@ struct rmi_driver_data { · 353 unmodified lines | ||
| 354 | 354 | struct mutex irq_mutex; |
| 355 | 355 | struct input_dev *input; |
| 356 | 356 | |
| 357 | + struct irq_domain *irqdomain; | |
| 358 | + | |
| 357 | 359 | u8 pdt_props; |
| 358 | 360 | |
| 359 | 361 | u8 num_rx_electrodes; |
| @@ -9,9 +9,6 @@ · 8 unmodified lines | ||
| 9 | 9 | #include <asm/io.h> |
| 10 | 10 | |
| 11 | 11 | struct scatterlist { |
| 12 | −#ifdef CONFIG_DEBUG_SG | |
| 13 | − unsigned long sg_magic; | |
| 14 | −#endif | |
| 15 | 12 | unsigned long page_link; |
| 16 | 13 | unsigned int offset; |
| 17 | 14 | unsigned int length; |
| @@ -64,7 +61,6 @@ struct sg_table { · 46 unmodified lines | ||
| 64 | 61 | * |
| 65 | 62 | */ |
| 66 | 63 | |
| 67 | −#define SG_MAGIC 0x87654321 | |
| 68 | 64 | #define SG_CHAIN 0x01UL |
| 69 | 65 | #define SG_END 0x02UL |
| 70 | 66 | |
| @@ -98,7 +94,6 @@ static inline void sg_assign_page(struct scatterlist *sg, struct page *page) · 27 unmodified lines | ||
| 98 | 94 | */ |
| 99 | 95 | BUG_ON((unsigned long) page & (SG_CHAIN | SG_END)); |
| 100 | 96 | #ifdef CONFIG_DEBUG_SG |
| 101 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 102 | 97 | BUG_ON(sg_is_chain(sg)); |
| 103 | 98 | #endif |
| 104 | 99 | sg->page_link = page_link | (unsigned long) page; |
| @@ -129,7 +124,6 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page, · 24 unmodified lines | ||
| 129 | 124 | static inline struct page *sg_page(struct scatterlist *sg) |
| 130 | 125 | { |
| 131 | 126 | #ifdef CONFIG_DEBUG_SG |
| 132 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 133 | 127 | BUG_ON(sg_is_chain(sg)); |
| 134 | 128 | #endif |
| 135 | 129 | return (struct page *)((sg)->page_link & ~(SG_CHAIN | SG_END)); |
| @@ -195,9 +189,6 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, · 59 unmodified lines | ||
| 195 | 189 | **/ |
| 196 | 190 | static inline void sg_mark_end(struct scatterlist *sg) |
| 197 | 191 | { |
| 198 | −#ifdef CONFIG_DEBUG_SG | |
| 199 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 200 | −#endif | |
| 201 | 192 | /* |
| 202 | 193 | * Set termination bit, clear potential chain bit |
| 203 | 194 | */ |
| @@ -215,9 +206,6 @@ static inline void sg_mark_end(struct scatterlist *sg) · 11 unmodified lines | ||
| 215 | 206 | **/ |
| 216 | 207 | static inline void sg_unmark_end(struct scatterlist *sg) |
| 217 | 208 | { |
| 218 | −#ifdef CONFIG_DEBUG_SG | |
| 219 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 220 | −#endif | |
| 221 | 209 | sg->page_link &= ~SG_END; |
| 222 | 210 | } |
| 223 | 211 | |
| @@ -260,12 +248,6 @@ static inline void *sg_virt(struct scatterlist *sg) · 36 unmodified lines | ||
| 260 | 248 | static inline void sg_init_marker(struct scatterlist *sgl, |
| 261 | 249 | unsigned int nents) |
| 262 | 250 | { |
| 263 | −#ifdef CONFIG_DEBUG_SG | |
| 264 | − unsigned int i; | |
| 265 | − | |
| 266 | − for (i = 0; i < nents; i++) | |
| 267 | − sgl[i].sg_magic = SG_MAGIC; | |
| 268 | −#endif | |
| 269 | 251 | sg_mark_end(&sgl[nents - 1]); |
| 270 | 252 | } |
| 271 | 253 | |
| @@ -1799,20 +1799,22 @@ static inline void rseq_set_notify_resume(struct task_struct *t) · 1798 unmodified lines | ||
| 1799 | 1799 | set_tsk_thread_flag(t, TIF_NOTIFY_RESUME); |
| 1800 | 1800 | } |
| 1801 | 1801 | |
| 1802 | −void __rseq_handle_notify_resume(struct pt_regs *regs); | |
| 1802 | +void __rseq_handle_notify_resume(struct ksignal *sig, struct pt_regs *regs); | |
| 1803 | 1803 | |
| 1804 | −static inline void rseq_handle_notify_resume(struct pt_regs *regs) | |
| 1804 | +static inline void rseq_handle_notify_resume(struct ksignal *ksig, | |
| 1805 | + struct pt_regs *regs) | |
| 1805 | 1806 | { |
| 1806 | 1807 | if (current->rseq) |
| 1807 | − __rseq_handle_notify_resume(regs); | |
| 1808 | + __rseq_handle_notify_resume(ksig, regs); | |
| 1808 | 1809 | } |
| 1809 | 1810 | |
| 1810 | −static inline void rseq_signal_deliver(struct pt_regs *regs) | |
| 1811 | +static inline void rseq_signal_deliver(struct ksignal *ksig, | |
| 1812 | + struct pt_regs *regs) | |
| 1811 | 1813 | { |
| 1812 | 1814 | preempt_disable(); |
| 1813 | 1815 | __set_bit(RSEQ_EVENT_SIGNAL_BIT, ¤t->rseq_event_mask); |
| 1814 | 1816 | preempt_enable(); |
| 1815 | − rseq_handle_notify_resume(regs); | |
| 1817 | + rseq_handle_notify_resume(ksig, regs); | |
| 1816 | 1818 | } |
| 1817 | 1819 | |
| 1818 | 1820 | /* rseq_preempt() requires preemption to be disabled. */ |
| @@ -1831,9 +1833,7 @@ static inline void rseq_migrate(struct task_struct *t) · 12 unmodified lines | ||
| 1831 | 1833 | |
| 1832 | 1834 | /* |
| 1833 | 1835 | * If parent process has a registered restartable sequences area, the |
| 1834 | − * child inherits. Only applies when forking a process, not a thread. In | |
| 1835 | − * case a parent fork() in the middle of a restartable sequence, set the | |
| 1836 | − * resume notifier to force the child to retry. | |
| 1836 | + * child inherits. Only applies when forking a process, not a thread. | |
| 1837 | 1837 | */ |
| 1838 | 1838 | static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) |
| 1839 | 1839 | { |
| @@ -1847,7 +1847,6 @@ static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) · 7 unmodified lines | ||
| 1847 | 1847 | t->rseq_len = current->rseq_len; |
| 1848 | 1848 | t->rseq_sig = current->rseq_sig; |
| 1849 | 1849 | t->rseq_event_mask = current->rseq_event_mask; |
| 1850 | − rseq_preempt(t); | |
| 1851 | 1850 | } |
| 1852 | 1851 | } |
| 1853 | 1852 | |
| @@ -1864,10 +1863,12 @@ static inline void rseq_execve(struct task_struct *t) · 10 unmodified lines | ||
| 1864 | 1863 | static inline void rseq_set_notify_resume(struct task_struct *t) |
| 1865 | 1864 | { |
| 1866 | 1865 | } |
| 1867 | −static inline void rseq_handle_notify_resume(struct pt_regs *regs) | |
| 1866 | +static inline void rseq_handle_notify_resume(struct ksignal *ksig, | |
| 1867 | + struct pt_regs *regs) | |
| 1868 | 1868 | { |
| 1869 | 1869 | } |
| 1870 | −static inline void rseq_signal_deliver(struct pt_regs *regs) | |
| 1870 | +static inline void rseq_signal_deliver(struct ksignal *ksig, | |
| 1871 | + struct pt_regs *regs) | |
| 1871 | 1872 | { |
| 1872 | 1873 | } |
| 1873 | 1874 | static inline void rseq_preempt(struct task_struct *t) |
| @@ -3252,7 +3252,8 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, · 3251 unmodified lines | ||
| 3252 | 3252 | int *peeked, int *off, int *err); |
| 3253 | 3253 | struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, |
| 3254 | 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 | 3257 | int skb_copy_datagram_iter(const struct sk_buff *from, int offset, |
| 3257 | 3258 | struct iov_iter *to, int size); |
| 3258 | 3259 | static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset, |
| @@ -155,8 +155,12 @@ struct kmem_cache { · 154 unmodified lines | ||
| 155 | 155 | |
| 156 | 156 | #ifdef CONFIG_SYSFS |
| 157 | 157 | #define SLAB_SUPPORTS_SYSFS |
| 158 | +void sysfs_slab_unlink(struct kmem_cache *); | |
| 158 | 159 | void sysfs_slab_release(struct kmem_cache *); |
| 159 | 160 | #else |
| 161 | +static inline void sysfs_slab_unlink(struct kmem_cache *s) | |
| 162 | +{ | |
| 163 | +} | |
| 160 | 164 | static inline void sysfs_slab_release(struct kmem_cache *s) |
| 161 | 165 | { |
| 162 | 166 | } |
| @@ -427,6 +427,11 @@ extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); · 426 unmodified lines | ||
| 427 | 427 | #define atomic_dec_and_lock(atomic, lock) \ |
| 428 | 428 | __cond_lock(lock, _atomic_dec_and_lock(atomic, lock)) |
| 429 | 429 | |
| 430 | +extern int _atomic_dec_and_lock_irqsave(atomic_t *atomic, spinlock_t *lock, | |
| 431 | + unsigned long *flags); | |
| 432 | +#define atomic_dec_and_lock_irqsave(atomic, lock, flags) \ | |
| 433 | + __cond_lock(lock, _atomic_dec_and_lock_irqsave(atomic, lock, &(flags))) | |
| 434 | + | |
| 430 | 435 | int alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask, |
| 431 | 436 | size_t max_size, unsigned int cpu_mult, |
| 432 | 437 | gfp_t gfp); |
| @@ -231,6 +231,9 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) · 230 unmodified lines | ||
| 231 | 231 | */ |
| 232 | 232 | #ifndef __SYSCALL_DEFINEx |
| 233 | 233 | #define __SYSCALL_DEFINEx(x, name, ...) \ |
| 234 | + __diag_push(); \ | |
| 235 | + __diag_ignore(GCC, 8, "-Wattribute-alias", \ | |
| 236 | + "Type aliasing is used to sanitize syscall arguments");\ | |
| 234 | 237 | asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ |
| 235 | 238 | __attribute__((alias(__stringify(__se_sys##name)))); \ |
| 236 | 239 | ALLOW_ERROR_INJECTION(sys##name, ERRNO); \ |
| @@ -243,6 +246,7 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) · 6 unmodified lines | ||
| 243 | 246 | __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ |
| 244 | 247 | return ret; \ |
| 245 | 248 | } \ |
| 249 | + __diag_pop(); \ | |
| 246 | 250 | static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) |
| 247 | 251 | #endif /* __SYSCALL_DEFINEx */ |
| 248 | 252 | |
| @@ -271,7 +271,7 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, · 270 unmodified lines | ||
| 271 | 271 | int flags); |
| 272 | 272 | int bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg, |
| 273 | 273 | size_t len, int flags); |
| 274 | −__poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events); | |
| 274 | +__poll_t bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait); | |
| 275 | 275 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 276 | 276 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); |
| 277 | 277 | int bt_sock_wait_ready(struct sock *sk, unsigned long flags); |
| @@ -170,6 +170,7 @@ struct fib6_info { · 169 unmodified lines | ||
| 170 | 170 | unused:3; |
| 171 | 171 | |
| 172 | 172 | struct fib6_nh fib6_nh; |
| 173 | + struct rcu_head rcu; | |
| 173 | 174 | }; |
| 174 | 175 | |
| 175 | 176 | struct rt6_info { |
| @@ -273,7 +274,7 @@ static inline void ip6_rt_put(struct rt6_info *rt) · 97 unmodified lines | ||
| 273 | 274 | } |
| 274 | 275 | |
| 275 | 276 | struct fib6_info *fib6_info_alloc(gfp_t gfp_flags); |
| 276 | −void fib6_info_destroy(struct fib6_info *f6i); | |
| 277 | +void fib6_info_destroy_rcu(struct rcu_head *head); | |
| 277 | 278 | |
| 278 | 279 | static inline void fib6_info_hold(struct fib6_info *f6i) |
| 279 | 280 | { |
| @@ -283,7 +284,7 @@ static inline void fib6_info_hold(struct fib6_info *f6i) · 3 unmodified lines | ||
| 283 | 284 | static inline void fib6_info_release(struct fib6_info *f6i) |
| 284 | 285 | { |
| 285 | 286 | if (f6i && atomic_dec_and_test(&f6i->fib6_ref)) |
| 286 | − fib6_info_destroy(f6i); | |
| 287 | + call_rcu(&f6i->rcu, fib6_info_destroy_rcu); | |
| 287 | 288 | } |
| 288 | 289 | |
| 289 | 290 | enum fib6_walk_state { |
| @@ -153,6 +153,8 @@ struct iucv_sock_list { · 152 unmodified lines | ||
| 153 | 153 | atomic_t autobind_name; |
| 154 | 154 | }; |
| 155 | 155 | |
| 156 | +__poll_t iucv_sock_poll(struct file *file, struct socket *sock, | |
| 157 | + poll_table *wait); | |
| 156 | 158 | void iucv_sock_link(struct iucv_sock_list *l, struct sock *s); |
| 157 | 159 | void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s); |
| 158 | 160 | void iucv_accept_enqueue(struct sock *parent, struct sock *sk); |
| @@ -109,7 +109,8 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); · 108 unmodified lines | ||
| 109 | 109 | int sctp_inet_listen(struct socket *sock, int backlog); |
| 110 | 110 | void sctp_write_space(struct sock *sk); |
| 111 | 111 | void sctp_data_ready(struct sock *sk); |
| 112 | −__poll_t sctp_poll_mask(struct socket *sock, __poll_t events); | |
| 112 | +__poll_t sctp_poll(struct file *file, struct socket *sock, | |
| 113 | + poll_table *wait); | |
| 113 | 114 | void sctp_sock_rfree(struct sk_buff *skb); |
| 114 | 115 | void sctp_copy_sock(struct sock *newsk, struct sock *sk, |
| 115 | 116 | struct sctp_association *asoc); |
| @@ -388,7 +388,8 @@ bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst); · 387 unmodified lines | ||
| 388 | 388 | void tcp_close(struct sock *sk, long timeout); |
| 389 | 389 | void tcp_init_sock(struct sock *sk); |
| 390 | 390 | void tcp_init_transfer(struct sock *sk, int bpf_op); |
| 391 | −__poll_t tcp_poll_mask(struct socket *sock, __poll_t events); | |
| 391 | +__poll_t tcp_poll(struct file *file, struct socket *sock, | |
| 392 | + struct poll_table_struct *wait); | |
| 392 | 393 | int tcp_getsockopt(struct sock *sk, int level, int optname, |
| 393 | 394 | char __user *optval, int __user *optlen); |
| 394 | 395 | int tcp_setsockopt(struct sock *sk, int level, int optname, |
| @@ -109,7 +109,8 @@ struct tls_sw_context_rx { · 108 unmodified lines | ||
| 109 | 109 | |
| 110 | 110 | struct strparser strp; |
| 111 | 111 | void (*saved_data_ready)(struct sock *sk); |
| 112 | − __poll_t (*sk_poll_mask)(struct socket *sock, __poll_t events); | |
| 112 | + unsigned int (*sk_poll)(struct file *file, struct socket *sock, | |
| 113 | + struct poll_table_struct *wait); | |
| 113 | 114 | struct sk_buff *recv_pkt; |
| 114 | 115 | u8 control; |
| 115 | 116 | bool decrypted; |
| @@ -224,7 +225,8 @@ void tls_sw_free_resources_tx(struct sock *sk); · 108 unmodified lines | ||
| 224 | 225 | void tls_sw_free_resources_rx(struct sock *sk); |
| 225 | 226 | int tls_sw_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, |
| 226 | 227 | int nonblock, int flags, int *addr_len); |
| 227 | −__poll_t tls_sw_poll_mask(struct socket *sock, __poll_t events); | |
| 228 | +unsigned int tls_sw_poll(struct file *file, struct socket *sock, | |
| 229 | + struct poll_table_struct *wait); | |
| 228 | 230 | ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos, |
| 229 | 231 | struct pipe_inode_info *pipe, |
| 230 | 232 | size_t len, unsigned int flags); |
| @@ -285,7 +285,7 @@ int udp_init_sock(struct sock *sk); · 284 unmodified lines | ||
| 285 | 285 | int udp_pre_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); |
| 286 | 286 | int __udp_disconnect(struct sock *sk, int flags); |
| 287 | 287 | int udp_disconnect(struct sock *sk, int flags); |
| 288 | −__poll_t udp_poll_mask(struct socket *sock, __poll_t events); | |
| 288 | +__poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait); | |
| 289 | 289 | struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, |
| 290 | 290 | netdev_features_t features, |
| 291 | 291 | bool is_ipv6); |
| @@ -3391,11 +3391,14 @@ int ib_process_cq_direct(struct ib_cq *cq, int budget); · 3390 unmodified lines | ||
| 3391 | 3391 | * |
| 3392 | 3392 | * Users can examine the cq structure to determine the actual CQ size. |
| 3393 | 3393 | */ |
| 3394 | −struct ib_cq *ib_create_cq(struct ib_device *device, | |
| 3395 | − ib_comp_handler comp_handler, | |
| 3396 | − void (*event_handler)(struct ib_event *, void *), | |
| 3397 | − void *cq_context, | |
| 3398 | − const struct ib_cq_init_attr *cq_attr); | |
| 3394 | +struct ib_cq *__ib_create_cq(struct ib_device *device, | |
| 3395 | + ib_comp_handler comp_handler, | |
| 3396 | + void (*event_handler)(struct ib_event *, void *), | |
| 3397 | + void *cq_context, | |
| 3398 | + const struct ib_cq_init_attr *cq_attr, | |
| 3399 | + const char *caller); | |
| 3400 | +#define ib_create_cq(device, cmp_hndlr, evt_hndlr, cq_ctxt, cq_attr) \ | |
| 3401 | + __ib_create_cq((device), (cmp_hndlr), (evt_hndlr), (cq_ctxt), (cq_attr), KBUILD_MODNAME) | |
| 3399 | 3402 | |
| 3400 | 3403 | /** |
| 3401 | 3404 | * ib_resize_cq - Modifies the capacity of the CQ. |
| @@ -39,8 +39,10 @@ enum { · 38 unmodified lines | ||
| 39 | 39 | IOCB_CMD_PWRITE = 1, |
| 40 | 40 | IOCB_CMD_FSYNC = 2, |
| 41 | 41 | IOCB_CMD_FDSYNC = 3, |
| 42 | − /* 4 was the experimental IOCB_CMD_PREADX */ | |
| 43 | − IOCB_CMD_POLL = 5, | |
| 42 | + /* These two are experimental. | |
| 43 | + * IOCB_CMD_PREADX = 4, | |
| 44 | + * IOCB_CMD_POLL = 5, | |
| 45 | + */ | |
| 44 | 46 | IOCB_CMD_NOOP = 6, |
| 45 | 47 | IOCB_CMD_PREADV = 7, |
| 46 | 48 | IOCB_CMD_PWRITEV = 8, |
| @@ -53,6 +53,9 @@ enum { · 52 unmodified lines | ||
| 53 | 53 | /* These are client behavior specific flags. */ |
| 54 | 54 | #define NBD_CFLAG_DESTROY_ON_DISCONNECT (1 << 0) /* delete the nbd device on |
| 55 | 55 | disconnect. */ |
| 56 | +#define NBD_CFLAG_DISCONNECT_ON_CLOSE (1 << 1) /* disconnect the nbd device on | |
| 57 | + * close by last opener. | |
| 58 | + */ | |
| 56 | 59 | |
| 57 | 60 | /* userspace doesn't need the nbd_device structure */ |
| 58 | 61 | |
| @@ -44,6 +44,7 @@ · 43 unmodified lines | ||
| 44 | 44 | #define TCMU_MAILBOX_VERSION 2 |
| 45 | 45 | #define ALIGN_SIZE 64 /* Should be enough for most CPUs */ |
| 46 | 46 | #define TCMU_MAILBOX_FLAG_CAP_OOOC (1 << 0) /* Out-of-order completions */ |
| 47 | +#define TCMU_MAILBOX_FLAG_CAP_READ_LEN (1 << 1) /* Read data length */ | |
| 47 | 48 | |
| 48 | 49 | struct tcmu_mailbox { |
| 49 | 50 | __u16 version; |
| @@ -71,6 +72,7 @@ struct tcmu_cmd_entry_hdr { · 21 unmodified lines | ||
| 71 | 72 | __u16 cmd_id; |
| 72 | 73 | __u8 kflags; |
| 73 | 74 | #define TCMU_UFLAG_UNKNOWN_OP 0x1 |
| 75 | +#define TCMU_UFLAG_READ_LEN 0x2 | |
| 74 | 76 | __u8 uflags; |
| 75 | 77 | |
| 76 | 78 | } __packed; |
| @@ -119,7 +121,7 @@ struct tcmu_cmd_entry { · 42 unmodified lines | ||
| 119 | 121 | __u8 scsi_status; |
| 120 | 122 | __u8 __pad1; |
| 121 | 123 | __u16 __pad2; |
| 122 | − __u32 __pad3; | |
| 124 | + __u32 read_len; | |
| 123 | 125 | char sense_buffer[TCMU_SENSE_BUFFERSIZE]; |
| 124 | 126 | } rsp; |
| 125 | 127 | }; |
| @@ -25,12 +25,16 @@ extern bool xen_pvh; · 24 unmodified lines | ||
| 25 | 25 | #define xen_hvm_domain() (xen_domain_type == XEN_HVM_DOMAIN) |
| 26 | 26 | #define xen_pvh_domain() (xen_pvh) |
| 27 | 27 | |
| 28 | +#include <linux/types.h> | |
| 29 | + | |
| 30 | +extern uint32_t xen_start_flags; | |
| 31 | + | |
| 28 | 32 | #ifdef CONFIG_XEN_DOM0 |
| 29 | 33 | #include <xen/interface/xen.h> |
| 30 | 34 | #include <asm/xen/hypervisor.h> |
| 31 | 35 | |
| 32 | 36 | #define xen_initial_domain() (xen_domain() && \ |
| 33 | − xen_start_info && xen_start_info->flags & SIF_INITDOMAIN) | |
| 37 | + (xen_start_flags & SIF_INITDOMAIN)) | |
| 34 | 38 | #else /* !CONFIG_XEN_DOM0 */ |
| 35 | 39 | #define xen_initial_domain() (0) |
| 36 | 40 | #endif /* CONFIG_XEN_DOM0 */ |
| @@ -1051,10 +1051,9 @@ config LD_DEAD_CODE_DATA_ELIMINATION · 1050 unmodified lines | ||
| 1051 | 1051 | depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION |
| 1052 | 1052 | depends on EXPERT |
| 1053 | 1053 | help |
| 1054 | − Select this if the architecture wants to do dead code and | |
| 1055 | − data elimination with the linker by compiling with | |
| 1056 | − -ffunction-sections -fdata-sections, and linking with | |
| 1057 | − --gc-sections. | |
| 1054 | + Enable this if you want to do dead code and data elimination with | |
| 1055 | + the linker by compiling with -ffunction-sections -fdata-sections, | |
| 1056 | + and linking with --gc-sections. | |
| 1058 | 1057 | |
| 1059 | 1058 | This can reduce on disk and in-memory size of the kernel |
| 1060 | 1059 | code and static data, particularly for small configs and |
| @@ -1719,10 +1718,6 @@ source "arch/Kconfig" · 658 unmodified lines | ||
| 1719 | 1718 | |
| 1720 | 1719 | endmenu # General setup |
| 1721 | 1720 | |
| 1722 | −config HAVE_GENERIC_DMA_COHERENT | |
| 1723 | − bool | |
| 1724 | − default n | |
| 1725 | − | |
| 1726 | 1721 | config RT_MUTEXES |
| 1727 | 1722 | bool |
| 1728 | 1723 | |
| @@ -41,6 +41,7 @@ obj-y += printk/ · 40 unmodified lines | ||
| 41 | 41 | obj-y += irq/ |
| 42 | 42 | obj-y += rcu/ |
| 43 | 43 | obj-y += livepatch/ |
| 44 | +obj-y += dma/ | |
| 44 | 45 | |
| 45 | 46 | obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o |
| 46 | 47 | obj-$(CONFIG_FREEZER) += freezer.o |
| @@ -350,6 +350,20 @@ struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, · 349 unmodified lines | ||
| 350 | 350 | return prog_adj; |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | +void bpf_prog_kallsyms_del_subprogs(struct bpf_prog *fp) | |
| 354 | +{ | |
| 355 | + int i; | |
| 356 | + | |
| 357 | + for (i = 0; i < fp->aux->func_cnt; i++) | |
| 358 | + bpf_prog_kallsyms_del(fp->aux->func[i]); | |
| 359 | +} | |
| 360 | + | |
| 361 | +void bpf_prog_kallsyms_del_all(struct bpf_prog *fp) | |
| 362 | +{ | |
| 363 | + bpf_prog_kallsyms_del_subprogs(fp); | |
| 364 | + bpf_prog_kallsyms_del(fp); | |
| 365 | +} | |
| 366 | + | |
| 353 | 367 | #ifdef CONFIG_BPF_JIT |
| 354 | 368 | /* All BPF JIT sysctl knobs here. */ |
| 355 | 369 | int bpf_jit_enable __read_mostly = IS_BUILTIN(CONFIG_BPF_JIT_ALWAYS_ON); |
| @@ -584,6 +598,8 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr, · 228 unmodified lines | ||
| 584 | 598 | bpf_fill_ill_insns(hdr, size); |
| 585 | 599 | |
| 586 | 600 | hdr->pages = size / PAGE_SIZE; |
| 601 | + hdr->locked = 0; | |
| 602 | + | |
| 587 | 603 | hole = min_t(unsigned int, size - (proglen + sizeof(*hdr)), |
| 588 | 604 | PAGE_SIZE - sizeof(*hdr)); |
| 589 | 605 | start = (get_random_int() % hole) & ~(alignment - 1); |
| @@ -1434,6 +1450,33 @@ static int bpf_check_tail_call(const struct bpf_prog *fp) · 844 unmodified lines | ||
| 1434 | 1450 | return 0; |
| 1435 | 1451 | } |
| 1436 | 1452 | |
| 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) | |
| 1470 | +{ | |
| 1471 | +#ifndef CONFIG_BPF_JIT_ALWAYS_ON | |
| 1472 | + u32 stack_depth = max_t(u32, fp->aux->stack_depth, 1); | |
| 1473 | + | |
| 1474 | + fp->bpf_func = interpreters[(round_up(stack_depth, 32) / 32) - 1]; | |
| 1475 | +#else | |
| 1476 | + fp->bpf_func = __bpf_prog_ret0_warn; | |
| 1477 | +#endif | |
| 1478 | +} | |
| 1479 | + | |
| 1437 | 1480 | /** |
| 1438 | 1481 | * bpf_prog_select_runtime - select exec runtime for BPF program |
| 1439 | 1482 | * @fp: bpf_prog populated with internal BPF program |
| @@ -1444,13 +1487,13 @@ static int bpf_check_tail_call(const struct bpf_prog *fp) · 4 unmodified lines | ||
| 1444 | 1487 | */ |
| 1445 | 1488 | struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err) |
| 1446 | 1489 | { |
| 1447 | −#ifndef CONFIG_BPF_JIT_ALWAYS_ON | |
| 1448 | − u32 stack_depth = max_t(u32, fp->aux->stack_depth, 1); | |
| 1490 | + /* In case of BPF to BPF calls, verifier did all the prep | |
| 1491 | + * work with regards to JITing, etc. | |
| 1492 | + */ | |
| 1493 | + if (fp->bpf_func) | |
| 1494 | + goto finalize; | |
| 1449 | 1495 | |
| 1450 | − fp->bpf_func = interpreters[(round_up(stack_depth, 32) / 32) - 1]; | |
| 1451 | −#else | |
| 1452 | − fp->bpf_func = __bpf_prog_ret0_warn; | |
| 1453 | −#endif | |
| 1496 | + bpf_prog_select_func(fp); | |
| 1454 | 1497 | |
| 1455 | 1498 | /* eBPF JITs can rewrite the program in case constant |
| 1456 | 1499 | * blinding is active. However, in case of error during |
| @@ -1471,6 +1514,8 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err) · 14 unmodified lines | ||
| 1471 | 1514 | if (*err) |
| 1472 | 1515 | return fp; |
| 1473 | 1516 | } |
| 1517 | + | |
| 1518 | +finalize: | |
| 1474 | 1519 | bpf_prog_lock_ro(fp); |
| 1475 | 1520 | |
| 1476 | 1521 | /* The tail call compatibility check can only be done at |
| @@ -1479,7 +1524,17 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err) · 2 unmodified lines | ||
| 1479 | 1524 | * all eBPF JITs might immediately support all features. |
| 1480 | 1525 | */ |
| 1481 | 1526 | *err = bpf_check_tail_call(fp); |
| 1482 | − | |
| 1527 | + if (*err) | |
| 1528 | + return fp; | |
| 1529 | + | |
| 1530 | + /* Checkpoint: at this point onwards any cBPF -> eBPF or | |
| 1531 | + * native eBPF program is read-only. If we failed to change | |
| 1532 | + * the page attributes (e.g. allocation failure from | |
| 1533 | + * splitting large pages), then reject the whole program | |
| 1534 | + * in order to guarantee not ending up with any W+X pages | |
| 1535 | + * from BPF side in kernel. | |
| 1536 | + */ | |
| 1537 | + *err = bpf_prog_check_pages_ro_locked(fp); | |
| 1483 | 1538 | return fp; |
| 1484 | 1539 | } |
| 1485 | 1540 | EXPORT_SYMBOL_GPL(bpf_prog_select_runtime); |
| @@ -345,6 +345,20 @@ int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, · 344 unmodified lines | ||
| 345 | 345 | return bq_enqueue(dst, xdpf, dev_rx); |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | +int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb, | |
| 349 | + struct bpf_prog *xdp_prog) | |
| 350 | +{ | |
| 351 | + int err; | |
| 352 | + | |
| 353 | + err = __xdp_generic_ok_fwd_dev(skb, dst->dev); | |
| 354 | + if (unlikely(err)) | |
| 355 | + return err; | |
| 356 | + skb->dev = dst->dev; | |
| 357 | + generic_xdp_tx(skb, xdp_prog); | |
| 358 | + | |
| 359 | + return 0; | |
| 360 | +} | |
| 361 | + | |
| 348 | 362 | static void *dev_map_lookup_elem(struct bpf_map *map, void *key) |
| 349 | 363 | { |
| 350 | 364 | struct bpf_dtab_netdev *obj = __dev_map_lookup_elem(map, *(u32 *)key); |
| @@ -1034,14 +1034,9 @@ static void __bpf_prog_put_rcu(struct rcu_head *rcu) · 1033 unmodified lines | ||
| 1034 | 1034 | static void __bpf_prog_put(struct bpf_prog *prog, bool do_idr_lock) |
| 1035 | 1035 | { |
| 1036 | 1036 | if (atomic_dec_and_test(&prog->aux->refcnt)) { |
| 1037 | − int i; | |
| 1038 | − | |
| 1039 | 1037 | /* bpf_prog_free_id() must be called first */ |
| 1040 | 1038 | bpf_prog_free_id(prog, do_idr_lock); |
| 1041 | − | |
| 1042 | − for (i = 0; i < prog->aux->func_cnt; i++) | |
| 1043 | − bpf_prog_kallsyms_del(prog->aux->func[i]); | |
| 1044 | − bpf_prog_kallsyms_del(prog); | |
| 1039 | + bpf_prog_kallsyms_del_all(prog); | |
| 1045 | 1040 | |
| 1046 | 1041 | call_rcu(&prog->aux->rcu, __bpf_prog_put_rcu); |
| 1047 | 1042 | } |
| @@ -1358,9 +1353,7 @@ static int bpf_prog_load(union bpf_attr *attr) · 310 unmodified lines | ||
| 1358 | 1353 | if (err < 0) |
| 1359 | 1354 | goto free_used_maps; |
| 1360 | 1355 | |
| 1361 | − /* eBPF program is ready to be JITed */ | |
| 1362 | − if (!prog->bpf_func) | |
| 1363 | − prog = bpf_prog_select_runtime(prog, &err); | |
| 1356 | + prog = bpf_prog_select_runtime(prog, &err); | |
| 1364 | 1357 | if (err < 0) |
| 1365 | 1358 | goto free_used_maps; |
| 1366 | 1359 | |
| @@ -1384,6 +1377,7 @@ static int bpf_prog_load(union bpf_attr *attr) · 17 unmodified lines | ||
| 1384 | 1377 | return err; |
| 1385 | 1378 | |
| 1386 | 1379 | free_used_maps: |
| 1380 | + bpf_prog_kallsyms_del_subprogs(prog); | |
| 1387 | 1381 | free_used_maps(prog->aux); |
| 1388 | 1382 | free_prog: |
| 1389 | 1383 | bpf_prog_uncharge_memlock(prog); |
| @@ -0,0 +1,50 @@ | ||
| 1 | + | |
| 2 | +config HAS_DMA | |
| 3 | + bool | |
| 4 | + depends on !NO_DMA | |
| 5 | + default y | |
| 6 | + | |
| 7 | +config NEED_SG_DMA_LENGTH | |
| 8 | + bool | |
| 9 | + | |
| 10 | +config NEED_DMA_MAP_STATE | |
| 11 | + bool | |
| 12 | + | |
| 13 | +config ARCH_DMA_ADDR_T_64BIT | |
| 14 | + def_bool 64BIT || PHYS_ADDR_T_64BIT | |
| 15 | + | |
| 16 | +config HAVE_GENERIC_DMA_COHERENT | |
| 17 | + bool | |
| 18 | + | |
| 19 | +config ARCH_HAS_SYNC_DMA_FOR_DEVICE | |
| 20 | + bool | |
| 21 | + | |
| 22 | +config ARCH_HAS_SYNC_DMA_FOR_CPU | |
| 23 | + bool | |
| 24 | + select NEED_DMA_MAP_STATE | |
| 25 | + | |
| 26 | +config DMA_DIRECT_OPS | |
| 27 | + bool | |
| 28 | + depends on HAS_DMA | |
| 29 | + | |
| 30 | +config DMA_NONCOHERENT_OPS | |
| 31 | + bool | |
| 32 | + depends on HAS_DMA | |
| 33 | + select DMA_DIRECT_OPS | |
| 34 | + | |
| 35 | +config DMA_NONCOHERENT_MMAP | |
| 36 | + bool | |
| 37 | + depends on DMA_NONCOHERENT_OPS | |
| 38 | + | |
| 39 | +config DMA_NONCOHERENT_CACHE_SYNC | |
| 40 | + bool | |
| 41 | + depends on DMA_NONCOHERENT_OPS | |
| 42 | + | |
| 43 | +config DMA_VIRT_OPS | |
| 44 | + bool | |
| 45 | + depends on HAS_DMA | |
| 46 | + | |
| 47 | +config SWIOTLB | |
| 48 | + bool | |
| 49 | + select DMA_DIRECT_OPS | |
| 50 | + select NEED_DMA_MAP_STATE | |
| @@ -0,0 +1,11 @@ | ||
| 1 | +# SPDX-License-Identifier: GPL-2.0 | |
| 2 | + | |
| 3 | +obj-$(CONFIG_HAS_DMA) += mapping.o | |
| 4 | +obj-$(CONFIG_DMA_CMA) += contiguous.o | |
| 5 | +obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += coherent.o | |
| 6 | +obj-$(CONFIG_DMA_DIRECT_OPS) += direct.o | |
| 7 | +obj-$(CONFIG_DMA_NONCOHERENT_OPS) += noncoherent.o | |
| 8 | +obj-$(CONFIG_DMA_VIRT_OPS) += virt.o | |
| 9 | +obj-$(CONFIG_DMA_API_DEBUG) += debug.o | |
| 10 | +obj-$(CONFIG_SWIOTLB) += swiotlb.o | |
| 11 | + | |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | /* |
| 3 | − * drivers/base/dma-mapping.c - arch-independent dma-mapping routines | |
| 3 | + * arch-independent dma-mapping routines | |
| 4 | 4 | * |
| 5 | 5 | * Copyright (c) 2006 SUSE Linux Products GmbH |
| 6 | 6 | * Copyright (c) 2006 Tejun Heo <teheo@suse.de> |
File renamed without changes.
| @@ -1085,3 +1085,4 @@ const struct dma_map_ops swiotlb_dma_ops = { · 1084 unmodified lines | ||
| 1085 | 1085 | .unmap_page = swiotlb_unmap_page, |
| 1086 | 1086 | .dma_supported = dma_direct_supported, |
| 1087 | 1087 | }; |
| 1088 | +EXPORT_SYMBOL(swiotlb_dma_ops); | |
| @@ -1,7 +1,5 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | /* |
| 3 | − * lib/dma-virt.c | |
| 4 | − * | |
| 5 | 3 | * DMA operations that map to virtual addresses without flushing memory. |
| 6 | 4 | */ |
| 7 | 5 | #include <linux/export.h> |
| @@ -6482,7 +6482,7 @@ void perf_prepare_sample(struct perf_event_header *header, · 6481 unmodified lines | ||
| 6482 | 6482 | data->phys_addr = perf_virt_to_phys(data->addr); |
| 6483 | 6483 | } |
| 6484 | 6484 | |
| 6485 | −static void __always_inline | |
| 6485 | +static __always_inline void | |
| 6486 | 6486 | __perf_event_output(struct perf_event *event, |
| 6487 | 6487 | struct perf_sample_data *data, |
| 6488 | 6488 | struct pt_regs *regs, |
| @@ -103,7 +103,7 @@ out: · 102 unmodified lines | ||
| 103 | 103 | preempt_enable(); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | −static bool __always_inline | |
| 106 | +static __always_inline bool | |
| 107 | 107 | ring_buffer_has_space(unsigned long head, unsigned long tail, |
| 108 | 108 | unsigned long data_size, unsigned int size, |
| 109 | 109 | bool backward) |
| @@ -114,7 +114,7 @@ ring_buffer_has_space(unsigned long head, unsigned long tail, · 4 unmodified lines | ||
| 114 | 114 | return CIRC_SPACE(tail, head, data_size) >= size; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | −static int __always_inline | |
| 117 | +static __always_inline int | |
| 118 | 118 | __perf_output_begin(struct perf_output_handle *handle, |
| 119 | 119 | struct perf_event *event, unsigned int size, |
| 120 | 120 | bool backward) |
| @@ -414,7 +414,7 @@ err: · 293 unmodified lines | ||
| 414 | 414 | } |
| 415 | 415 | EXPORT_SYMBOL_GPL(perf_aux_output_begin); |
| 416 | 416 | |
| 417 | −static bool __always_inline rb_need_aux_wakeup(struct ring_buffer *rb) | |
| 417 | +static __always_inline bool rb_need_aux_wakeup(struct ring_buffer *rb) | |
| 418 | 418 | { |
| 419 | 419 | if (rb->aux_overwrite) |
| 420 | 420 | return false; |
| @@ -55,6 +55,7 @@ static const struct irq_bit_descr irqchip_flags[] = { · 54 unmodified lines | ||
| 55 | 55 | BIT_MASK_DESCR(IRQCHIP_SKIP_SET_WAKE), |
| 56 | 56 | BIT_MASK_DESCR(IRQCHIP_ONESHOT_SAFE), |
| 57 | 57 | BIT_MASK_DESCR(IRQCHIP_EOI_THREADED), |
| 58 | + BIT_MASK_DESCR(IRQCHIP_SUPPORTS_LEVEL_MSI), | |
| 58 | 59 | }; |
| 59 | 60 | |
| 60 | 61 | static void |
| @@ -1265,11 +1265,11 @@ unsigned long lockdep_count_forward_deps(struct lock_class *class) · 1264 unmodified lines | ||
| 1265 | 1265 | this.parent = NULL; |
| 1266 | 1266 | this.class = class; |
| 1267 | 1267 | |
| 1268 | − local_irq_save(flags); | |
| 1268 | + raw_local_irq_save(flags); | |
| 1269 | 1269 | arch_spin_lock(&lockdep_lock); |
| 1270 | 1270 | ret = __lockdep_count_forward_deps(&this); |
| 1271 | 1271 | arch_spin_unlock(&lockdep_lock); |
| 1272 | − local_irq_restore(flags); | |
| 1272 | + raw_local_irq_restore(flags); | |
| 1273 | 1273 | |
| 1274 | 1274 | return ret; |
| 1275 | 1275 | } |
| @@ -1292,11 +1292,11 @@ unsigned long lockdep_count_backward_deps(struct lock_class *class) · 16 unmodified lines | ||
| 1292 | 1292 | this.parent = NULL; |
| 1293 | 1293 | this.class = class; |
| 1294 | 1294 | |
| 1295 | − local_irq_save(flags); | |
| 1295 | + raw_local_irq_save(flags); | |
| 1296 | 1296 | arch_spin_lock(&lockdep_lock); |
| 1297 | 1297 | ret = __lockdep_count_backward_deps(&this); |
| 1298 | 1298 | arch_spin_unlock(&lockdep_lock); |
| 1299 | − local_irq_restore(flags); | |
| 1299 | + raw_local_irq_restore(flags); | |
| 1300 | 1300 | |
| 1301 | 1301 | return ret; |
| 1302 | 1302 | } |
| @@ -4411,7 +4411,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len) · 3108 unmodified lines | ||
| 4411 | 4411 | if (unlikely(!debug_locks)) |
| 4412 | 4412 | return; |
| 4413 | 4413 | |
| 4414 | − local_irq_save(flags); | |
| 4414 | + raw_local_irq_save(flags); | |
| 4415 | 4415 | for (i = 0; i < curr->lockdep_depth; i++) { |
| 4416 | 4416 | hlock = curr->held_locks + i; |
| 4417 | 4417 | |
| @@ -4422,7 +4422,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len) · 4 unmodified lines | ||
| 4422 | 4422 | print_freed_lock_bug(curr, mem_from, mem_from + mem_len, hlock); |
| 4423 | 4423 | break; |
| 4424 | 4424 | } |
| 4425 | − local_irq_restore(flags); | |
| 4425 | + raw_local_irq_restore(flags); | |
| 4426 | 4426 | } |
| 4427 | 4427 | EXPORT_SYMBOL_GPL(debug_check_no_locks_freed); |
| 4428 | 4428 | |
| @@ -181,6 +181,7 @@ void down_read_non_owner(struct rw_semaphore *sem) · 180 unmodified lines | ||
| 181 | 181 | might_sleep(); |
| 182 | 182 | |
| 183 | 183 | __down_read(sem); |
| 184 | + rwsem_set_reader_owned(sem); | |
| 184 | 185 | } |
| 185 | 186 | |
| 186 | 187 | EXPORT_SYMBOL(down_read_non_owner); |
| @@ -251,10 +251,10 @@ static int rseq_ip_fixup(struct pt_regs *regs) · 250 unmodified lines | ||
| 251 | 251 | * respect to other threads scheduled on the same CPU, and with respect |
| 252 | 252 | * to signal handlers. |
| 253 | 253 | */ |
| 254 | −void __rseq_handle_notify_resume(struct pt_regs *regs) | |
| 254 | +void __rseq_handle_notify_resume(struct ksignal *ksig, struct pt_regs *regs) | |
| 255 | 255 | { |
| 256 | 256 | struct task_struct *t = current; |
| 257 | − int ret; | |
| 257 | + int ret, sig; | |
| 258 | 258 | |
| 259 | 259 | if (unlikely(t->flags & PF_EXITING)) |
| 260 | 260 | return; |
| @@ -268,7 +268,8 @@ void __rseq_handle_notify_resume(struct pt_regs *regs) · 7 unmodified lines | ||
| 268 | 268 | return; |
| 269 | 269 | |
| 270 | 270 | error: |
| 271 | − force_sig(SIGSEGV, t); | |
| 271 | + sig = ksig ? ksig->sig : 0; | |
| 272 | + force_sigsegv(sig, t); | |
| 272 | 273 | } |
| 273 | 274 | |
| 274 | 275 | #ifdef CONFIG_DEBUG_RSEQ |
| @@ -139,9 +139,13 @@ static void __local_bh_enable(unsigned int cnt) · 138 unmodified lines | ||
| 139 | 139 | { |
| 140 | 140 | lockdep_assert_irqs_disabled(); |
| 141 | 141 | |
| 142 | + if (preempt_count() == cnt) | |
| 143 | + trace_preempt_on(CALLER_ADDR0, get_lock_parent_ip()); | |
| 144 | + | |
| 142 | 145 | if (softirq_count() == (cnt & SOFTIRQ_MASK)) |
| 143 | 146 | trace_softirqs_on(_RET_IP_); |
| 144 | − preempt_count_sub(cnt); | |
| 147 | + | |
| 148 | + __preempt_count_sub(cnt); | |
| 145 | 149 | } |
| 146 | 150 | |
| 147 | 151 | /* |
| @@ -1659,7 +1659,7 @@ EXPORT_SYMBOL_GPL(hrtimer_init_sleeper); · 1658 unmodified lines | ||
| 1659 | 1659 | int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts) |
| 1660 | 1660 | { |
| 1661 | 1661 | switch(restart->nanosleep.type) { |
| 1662 | −#ifdef CONFIG_COMPAT | |
| 1662 | +#ifdef CONFIG_COMPAT_32BIT_TIME | |
| 1663 | 1663 | case TT_COMPAT: |
| 1664 | 1664 | if (compat_put_timespec64(ts, restart->nanosleep.compat_rmtp)) |
| 1665 | 1665 | return -EFAULT; |
| @@ -604,7 +604,6 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags, · 603 unmodified lines | ||
| 604 | 604 | /* |
| 605 | 605 | * Disarm any old timer after extracting its expiry time. |
| 606 | 606 | */ |
| 607 | − lockdep_assert_irqs_disabled(); | |
| 608 | 607 | |
| 609 | 608 | ret = 0; |
| 610 | 609 | old_incr = timer->it.cpu.incr; |
| @@ -1049,7 +1048,6 @@ static void posix_cpu_timer_rearm(struct k_itimer *timer) · 438 unmodified lines | ||
| 1049 | 1048 | /* |
| 1050 | 1049 | * Now re-arm for the new expiry time. |
| 1051 | 1050 | */ |
| 1052 | − lockdep_assert_irqs_disabled(); | |
| 1053 | 1051 | arm_timer(timer); |
| 1054 | 1052 | unlock: |
| 1055 | 1053 | unlock_task_sighand(p, &flags); |
| @@ -28,6 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | */ |
| 29 | 29 | |
| 30 | 30 | #include <linux/export.h> |
| 31 | +#include <linux/kernel.h> | |
| 31 | 32 | #include <linux/timex.h> |
| 32 | 33 | #include <linux/capability.h> |
| 33 | 34 | #include <linux/timekeeper_internal.h> |
| @@ -314,9 +315,10 @@ unsigned int jiffies_to_msecs(const unsigned long j) · 280 unmodified lines | ||
| 314 | 315 | return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC); |
| 315 | 316 | #else |
| 316 | 317 | # if BITS_PER_LONG == 32 |
| 317 | − return (HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32; | |
| 318 | + return (HZ_TO_MSEC_MUL32 * j + (1ULL << HZ_TO_MSEC_SHR32) - 1) >> | |
| 319 | + HZ_TO_MSEC_SHR32; | |
| 318 | 320 | # else |
| 319 | − return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN; | |
| 321 | + return DIV_ROUND_UP(j * HZ_TO_MSEC_NUM, HZ_TO_MSEC_DEN); | |
| 320 | 322 | # endif |
| 321 | 323 | #endif |
| 322 | 324 | } |
| @@ -1360,8 +1360,6 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) · 1359 unmodified lines | ||
| 1360 | 1360 | void |
| 1361 | 1361 | update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) |
| 1362 | 1362 | { |
| 1363 | − struct ring_buffer *buf; | |
| 1364 | − | |
| 1365 | 1363 | if (tr->stop_count) |
| 1366 | 1364 | return; |
| 1367 | 1365 | |
| @@ -1375,9 +1373,7 @@ update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) · 7 unmodified lines | ||
| 1375 | 1373 | |
| 1376 | 1374 | arch_spin_lock(&tr->max_lock); |
| 1377 | 1375 | |
| 1378 | − buf = tr->trace_buffer.buffer; | |
| 1379 | − tr->trace_buffer.buffer = tr->max_buffer.buffer; | |
| 1380 | − tr->max_buffer.buffer = buf; | |
| 1376 | + swap(tr->trace_buffer.buffer, tr->max_buffer.buffer); | |
| 1381 | 1377 | |
| 1382 | 1378 | __update_max_tr(tr, tsk, cpu); |
| 1383 | 1379 | arch_spin_unlock(&tr->max_lock); |
| @@ -78,7 +78,8 @@ static const char * ops[] = { OPS }; · 77 unmodified lines | ||
| 78 | 78 | C(TOO_MANY_PREDS, "Too many terms in predicate expression"), \ |
| 79 | 79 | C(INVALID_FILTER, "Meaningless filter expression"), \ |
| 80 | 80 | C(IP_FIELD_ONLY, "Only 'ip' field is supported for function trace"), \ |
| 81 | − C(INVALID_VALUE, "Invalid value (did you forget quotes)?"), | |
| 81 | + C(INVALID_VALUE, "Invalid value (did you forget quotes)?"), \ | |
| 82 | + C(NO_FILTER, "No filter found"), | |
| 82 | 83 | |
| 83 | 84 | #undef C |
| 84 | 85 | #define C(a, b) FILT_ERR_##a |
| @@ -550,6 +551,13 @@ predicate_parse(const char *str, int nr_parens, int nr_preds, · 465 unmodified lines | ||
| 550 | 551 | goto out_free; |
| 551 | 552 | } |
| 552 | 553 | |
| 554 | + if (!N) { | |
| 555 | + /* No program? */ | |
| 556 | + ret = -EINVAL; | |
| 557 | + parse_error(pe, FILT_ERR_NO_FILTER, ptr - str); | |
| 558 | + goto out_free; | |
| 559 | + } | |
| 560 | + | |
| 553 | 561 | prog[N].pred = NULL; /* #13 */ |
| 554 | 562 | prog[N].target = 1; /* TRUE */ |
| 555 | 563 | prog[N+1].pred = NULL; |
| @@ -420,60 +420,15 @@ config HAS_IOPORT_MAP · 419 unmodified lines | ||
| 420 | 420 | depends on HAS_IOMEM && !NO_IOPORT_MAP |
| 421 | 421 | default y |
| 422 | 422 | |
| 423 | −config HAS_DMA | |
| 424 | − bool | |
| 425 | − depends on !NO_DMA | |
| 426 | − default y | |
| 423 | +source "kernel/dma/Kconfig" | |
| 427 | 424 | |
| 428 | 425 | config SGL_ALLOC |
| 429 | 426 | bool |
| 430 | 427 | default n |
| 431 | 428 | |
| 432 | −config NEED_SG_DMA_LENGTH | |
| 433 | − bool | |
| 434 | − | |
| 435 | −config NEED_DMA_MAP_STATE | |
| 436 | − bool | |
| 437 | − | |
| 438 | −config ARCH_DMA_ADDR_T_64BIT | |
| 439 | − def_bool 64BIT || PHYS_ADDR_T_64BIT | |
| 440 | − | |
| 441 | 429 | config IOMMU_HELPER |
| 442 | 430 | bool |
| 443 | 431 | |
| 444 | −config ARCH_HAS_SYNC_DMA_FOR_DEVICE | |
| 445 | − bool | |
| 446 | − | |
| 447 | −config ARCH_HAS_SYNC_DMA_FOR_CPU | |
| 448 | − bool | |
| 449 | − select NEED_DMA_MAP_STATE | |
| 450 | − | |
| 451 | −config DMA_DIRECT_OPS | |
| 452 | − bool | |
| 453 | − depends on HAS_DMA | |
| 454 | − | |
| 455 | −config DMA_NONCOHERENT_OPS | |
| 456 | − bool | |
| 457 | − depends on HAS_DMA | |
| 458 | − select DMA_DIRECT_OPS | |
| 459 | − | |
| 460 | −config DMA_NONCOHERENT_MMAP | |
| 461 | − bool | |
| 462 | − depends on DMA_NONCOHERENT_OPS | |
| 463 | − | |
| 464 | −config DMA_NONCOHERENT_CACHE_SYNC | |
| 465 | − bool | |
| 466 | − depends on DMA_NONCOHERENT_OPS | |
| 467 | − | |
| 468 | −config DMA_VIRT_OPS | |
| 469 | − bool | |
| 470 | − depends on HAS_DMA | |
| 471 | − | |
| 472 | −config SWIOTLB | |
| 473 | − bool | |
| 474 | − select DMA_DIRECT_OPS | |
| 475 | − select NEED_DMA_MAP_STATE | |
| 476 | − | |
| 477 | 432 | config CHECK_SIGNATURE |
| 478 | 433 | bool |
| 479 | 434 | |
| @@ -6,6 +6,7 @@ if HAVE_ARCH_KASAN · 5 unmodified lines | ||
| 6 | 6 | config KASAN |
| 7 | 7 | bool "KASan: runtime memory debugger" |
| 8 | 8 | depends on SLUB || (SLAB && !DEBUG_SLAB) |
| 9 | + select SLUB_DEBUG if SLUB | |
| 9 | 10 | select CONSTRUCTORS |
| 10 | 11 | select STACKDEPOT |
| 11 | 12 | help |
| @@ -23,15 +23,12 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \ · 22 unmodified lines | ||
| 23 | 23 | sha1.o chacha20.o irq_regs.o argv_split.o \ |
| 24 | 24 | flex_proportions.o ratelimit.o show_mem.o \ |
| 25 | 25 | is_single_threaded.o plist.o decompress.o kobject_uevent.o \ |
| 26 | − earlycpio.o seq_buf.o siphash.o \ | |
| 26 | + earlycpio.o seq_buf.o siphash.o dec_and_lock.o \ | |
| 27 | 27 | nmi_backtrace.o nodemask.o win_minmax.o |
| 28 | 28 | |
| 29 | 29 | lib-$(CONFIG_PRINTK) += dump_stack.o |
| 30 | 30 | lib-$(CONFIG_MMU) += ioremap.o |
| 31 | 31 | lib-$(CONFIG_SMP) += cpumask.o |
| 32 | −lib-$(CONFIG_DMA_DIRECT_OPS) += dma-direct.o | |
| 33 | −lib-$(CONFIG_DMA_NONCOHERENT_OPS) += dma-noncoherent.o | |
| 34 | −lib-$(CONFIG_DMA_VIRT_OPS) += dma-virt.o | |
| 35 | 32 | |
| 36 | 33 | lib-y += kobject.o klist.o |
| 37 | 34 | obj-y += lockref.o |
| @@ -98,10 +95,6 @@ obj-$(CONFIG_DEBUG_PREEMPT) += smp_processor_id.o · 60 unmodified lines | ||
| 98 | 95 | obj-$(CONFIG_DEBUG_LIST) += list_debug.o |
| 99 | 96 | obj-$(CONFIG_DEBUG_OBJECTS) += debugobjects.o |
| 100 | 97 | |
| 101 | −ifneq ($(CONFIG_HAVE_DEC_LOCK),y) | |
| 102 | − lib-y += dec_and_lock.o | |
| 103 | −endif | |
| 104 | − | |
| 105 | 98 | obj-$(CONFIG_BITREVERSE) += bitrev.o |
| 106 | 99 | obj-$(CONFIG_RATIONAL) += rational.o |
| 107 | 100 | obj-$(CONFIG_CRC_CCITT) += crc-ccitt.o |
| @@ -148,7 +141,6 @@ obj-$(CONFIG_SMP) += percpu_counter.o · 40 unmodified lines | ||
| 148 | 141 | obj-$(CONFIG_AUDIT_GENERIC) += audit.o |
| 149 | 142 | obj-$(CONFIG_AUDIT_COMPAT_GENERIC) += compat_audit.o |
| 150 | 143 | |
| 151 | −obj-$(CONFIG_SWIOTLB) += swiotlb.o | |
| 152 | 144 | obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o |
| 153 | 145 | obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o |
| 154 | 146 | obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o |
| @@ -169,8 +161,6 @@ obj-$(CONFIG_NLATTR) += nlattr.o · 14 unmodified lines | ||
| 169 | 161 | |
| 170 | 162 | obj-$(CONFIG_LRU_CACHE) += lru_cache.o |
| 171 | 163 | |
| 172 | −obj-$(CONFIG_DMA_API_DEBUG) += dma-debug.o | |
| 173 | − | |
| 174 | 164 | obj-$(CONFIG_GENERIC_CSUM) += checksum.o |
| 175 | 165 | |
| 176 | 166 | obj-$(CONFIG_GENERIC_ATOMIC64) += atomic64.o |
| @@ -33,3 +33,19 @@ int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) · 32 unmodified lines | ||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | EXPORT_SYMBOL(_atomic_dec_and_lock); |
| 36 | + | |
| 37 | +int _atomic_dec_and_lock_irqsave(atomic_t *atomic, spinlock_t *lock, | |
| 38 | + unsigned long *flags) | |
| 39 | +{ | |
| 40 | + /* Subtract 1 from counter unless that drops it to 0 (ie. it was 1) */ | |
| 41 | + if (atomic_add_unless(atomic, -1, 1)) | |
| 42 | + return 0; | |
| 43 | + | |
| 44 | + /* Otherwise do it the slow way */ | |
| 45 | + spin_lock_irqsave(lock, *flags); | |
| 46 | + if (atomic_dec_and_test(atomic)) | |
| 47 | + return 1; | |
| 48 | + spin_unlock_irqrestore(lock, *flags); | |
| 49 | + return 0; | |
| 50 | +} | |
| 51 | +EXPORT_SYMBOL(_atomic_dec_and_lock_irqsave); | |
| @@ -141,7 +141,7 @@ int percpu_ida_alloc(struct percpu_ida *pool, int state) · 140 unmodified lines | ||
| 141 | 141 | spin_lock_irqsave(&tags->lock, flags); |
| 142 | 142 | |
| 143 | 143 | /* Fastpath */ |
| 144 | − if (likely(tags->nr_free >= 0)) { | |
| 144 | + if (likely(tags->nr_free)) { | |
| 145 | 145 | tag = tags->freelist[--tags->nr_free]; |
| 146 | 146 | spin_unlock_irqrestore(&tags->lock, flags); |
| 147 | 147 | return tag; |
| @@ -350,3 +350,31 @@ bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock) · 349 unmodified lines | ||
| 350 | 350 | } |
| 351 | 351 | EXPORT_SYMBOL(refcount_dec_and_lock); |
| 352 | 352 | |
| 353 | +/** | |
| 354 | + * refcount_dec_and_lock_irqsave - return holding spinlock with disabled | |
| 355 | + * interrupts if able to decrement refcount to 0 | |
| 356 | + * @r: the refcount | |
| 357 | + * @lock: the spinlock to be locked | |
| 358 | + * @flags: saved IRQ-flags if the is acquired | |
| 359 | + * | |
| 360 | + * Same as refcount_dec_and_lock() above except that the spinlock is acquired | |
| 361 | + * with disabled interupts. | |
| 362 | + * | |
| 363 | + * Return: true and hold spinlock if able to decrement refcount to 0, false | |
| 364 | + * otherwise | |
| 365 | + */ | |
| 366 | +bool refcount_dec_and_lock_irqsave(refcount_t *r, spinlock_t *lock, | |
| 367 | + unsigned long *flags) | |
| 368 | +{ | |
| 369 | + if (refcount_dec_not_one(r)) | |
| 370 | + return false; | |
| 371 | + | |
| 372 | + spin_lock_irqsave(lock, *flags); | |
| 373 | + if (!refcount_dec_and_test(r)) { | |
| 374 | + spin_unlock_irqrestore(lock, *flags); | |
| 375 | + return false; | |
| 376 | + } | |
| 377 | + | |
| 378 | + return true; | |
| 379 | +} | |
| 380 | +EXPORT_SYMBOL(refcount_dec_and_lock_irqsave); | |
| @@ -24,9 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | **/ |
| 25 | 25 | struct scatterlist *sg_next(struct scatterlist *sg) |
| 26 | 26 | { |
| 27 | −#ifdef CONFIG_DEBUG_SG | |
| 28 | − BUG_ON(sg->sg_magic != SG_MAGIC); | |
| 29 | −#endif | |
| 30 | 27 | if (sg_is_last(sg)) |
| 31 | 28 | return NULL; |
| 32 | 29 | |
| @@ -111,10 +108,7 @@ struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents) · 78 unmodified lines | ||
| 111 | 108 | for_each_sg(sgl, sg, nents, i) |
| 112 | 109 | ret = sg; |
| 113 | 110 | |
| 114 | −#ifdef CONFIG_DEBUG_SG | |
| 115 | − BUG_ON(sgl[0].sg_magic != SG_MAGIC); | |
| 116 | 111 | BUG_ON(!sg_is_last(ret)); |
| 117 | −#endif | |
| 118 | 112 | return ret; |
| 119 | 113 | } |
| 120 | 114 | EXPORT_SYMBOL(sg_last); |
| @@ -260,13 +260,6 @@ plain(void) · 259 unmodified lines | ||
| 260 | 260 | { |
| 261 | 261 | int err; |
| 262 | 262 | |
| 263 | − /* | |
| 264 | − * Make sure crng is ready. Otherwise we get "(ptrval)" instead | |
| 265 | − * of a hashed address when printing '%p' in plain_hash() and | |
| 266 | − * plain_format(). | |
| 267 | − */ | |
| 268 | − wait_for_random_bytes(); | |
| 269 | − | |
| 270 | 263 | err = plain_hash(); |
| 271 | 264 | if (err) { |
| 272 | 265 | pr_warn("plain 'p' does not appear to be hashed\n"); |
| @@ -359,15 +359,8 @@ static void wb_shutdown(struct bdi_writeback *wb) · 358 unmodified lines | ||
| 359 | 359 | spin_lock_bh(&wb->work_lock); |
| 360 | 360 | if (!test_and_clear_bit(WB_registered, &wb->state)) { |
| 361 | 361 | spin_unlock_bh(&wb->work_lock); |
| 362 | − /* | |
| 363 | − * Wait for wb shutdown to finish if someone else is just | |
| 364 | − * running wb_shutdown(). Otherwise we could proceed to wb / | |
| 365 | − * bdi destruction before wb_shutdown() is finished. | |
| 366 | − */ | |
| 367 | − wait_on_bit(&wb->state, WB_shutting_down, TASK_UNINTERRUPTIBLE); | |
| 368 | 362 | return; |
| 369 | 363 | } |
| 370 | − set_bit(WB_shutting_down, &wb->state); | |
| 371 | 364 | spin_unlock_bh(&wb->work_lock); |
| 372 | 365 | |
| 373 | 366 | cgwb_remove_from_bdi_list(wb); |
| @@ -379,12 +372,6 @@ static void wb_shutdown(struct bdi_writeback *wb) · 5 unmodified lines | ||
| 379 | 372 | mod_delayed_work(bdi_wq, &wb->dwork, 0); |
| 380 | 373 | flush_delayed_work(&wb->dwork); |
| 381 | 374 | WARN_ON(!list_empty(&wb->work_list)); |
| 382 | − /* | |
| 383 | − * Make sure bit gets cleared after shutdown is finished. Matches with | |
| 384 | − * the barrier provided by test_and_clear_bit() above. | |
| 385 | − */ | |
| 386 | − smp_wmb(); | |
| 387 | − clear_and_wake_up_bit(WB_shutting_down, &wb->state); | |
| 388 | 375 | } |
| 389 | 376 | |
| 390 | 377 | static void wb_exit(struct bdi_writeback *wb) |
| @@ -508,10 +495,12 @@ static void cgwb_release_workfn(struct work_struct *work) · 117 unmodified lines | ||
| 508 | 495 | struct bdi_writeback *wb = container_of(work, struct bdi_writeback, |
| 509 | 496 | release_work); |
| 510 | 497 | |
| 498 | + mutex_lock(&wb->bdi->cgwb_release_mutex); | |
| 511 | 499 | wb_shutdown(wb); |
| 512 | 500 | |
| 513 | 501 | css_put(wb->memcg_css); |
| 514 | 502 | css_put(wb->blkcg_css); |
| 503 | + mutex_unlock(&wb->bdi->cgwb_release_mutex); | |
| 515 | 504 | |
| 516 | 505 | fprop_local_destroy_percpu(&wb->memcg_completions); |
| 517 | 506 | percpu_ref_exit(&wb->refcnt); |
| @@ -697,6 +686,7 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi) · 179 unmodified lines | ||
| 697 | 686 | |
| 698 | 687 | INIT_RADIX_TREE(&bdi->cgwb_tree, GFP_ATOMIC); |
| 699 | 688 | bdi->cgwb_congested_tree = RB_ROOT; |
| 689 | + mutex_init(&bdi->cgwb_release_mutex); | |
| 700 | 690 | |
| 701 | 691 | ret = wb_init(&bdi->wb, bdi, 1, GFP_KERNEL); |
| 702 | 692 | if (!ret) { |
| @@ -717,7 +707,10 @@ static void cgwb_bdi_unregister(struct backing_dev_info *bdi) · 14 unmodified lines | ||
| 717 | 707 | spin_lock_irq(&cgwb_lock); |
| 718 | 708 | radix_tree_for_each_slot(slot, &bdi->cgwb_tree, &iter, 0) |
| 719 | 709 | cgwb_kill(*slot); |
| 710 | + spin_unlock_irq(&cgwb_lock); | |
| 720 | 711 | |
| 712 | + mutex_lock(&bdi->cgwb_release_mutex); | |
| 713 | + spin_lock_irq(&cgwb_lock); | |
| 721 | 714 | while (!list_empty(&bdi->wb_list)) { |
| 722 | 715 | wb = list_first_entry(&bdi->wb_list, struct bdi_writeback, |
| 723 | 716 | bdi_node); |
| @@ -726,6 +719,7 @@ static void cgwb_bdi_unregister(struct backing_dev_info *bdi) · 2 unmodified lines | ||
| 726 | 719 | spin_lock_irq(&cgwb_lock); |
| 727 | 720 | } |
| 728 | 721 | spin_unlock_irq(&cgwb_lock); |
| 722 | + mutex_unlock(&bdi->cgwb_release_mutex); | |
| 729 | 723 | } |
| 730 | 724 | |
| 731 | 725 | /** |
| @@ -20,7 +20,6 @@ · 19 unmodified lines | ||
| 20 | 20 | #include <linux/kmemleak.h> |
| 21 | 21 | #include <linux/seq_file.h> |
| 22 | 22 | #include <linux/memblock.h> |
| 23 | −#include <linux/bootmem.h> | |
| 24 | 23 | |
| 25 | 24 | #include <asm/sections.h> |
| 26 | 25 | #include <linux/io.h> |
| @@ -567,10 +567,14 @@ static int shutdown_cache(struct kmem_cache *s) · 566 unmodified lines | ||
| 567 | 567 | list_del(&s->list); |
| 568 | 568 | |
| 569 | 569 | if (s->flags & SLAB_TYPESAFE_BY_RCU) { |
| 570 | +#ifdef SLAB_SUPPORTS_SYSFS | |
| 571 | + sysfs_slab_unlink(s); | |
| 572 | +#endif | |
| 570 | 573 | list_add_tail(&s->list, &slab_caches_to_rcu_destroy); |
| 571 | 574 | schedule_work(&slab_caches_to_rcu_destroy_work); |
| 572 | 575 | } else { |
| 573 | 576 | #ifdef SLAB_SUPPORTS_SYSFS |
| 577 | + sysfs_slab_unlink(s); | |
| 574 | 578 | sysfs_slab_release(s); |
| 575 | 579 | #else |
| 576 | 580 | slab_kmem_cache_release(s); |
| @@ -5667,7 +5667,6 @@ static void sysfs_slab_remove_workfn(struct work_struct *work) · 5666 unmodified lines | ||
| 5667 | 5667 | kset_unregister(s->memcg_kset); |
| 5668 | 5668 | #endif |
| 5669 | 5669 | kobject_uevent(&s->kobj, KOBJ_REMOVE); |
| 5670 | − kobject_del(&s->kobj); | |
| 5671 | 5670 | out: |
| 5672 | 5671 | kobject_put(&s->kobj); |
| 5673 | 5672 | } |
| @@ -5752,6 +5751,12 @@ static void sysfs_slab_remove(struct kmem_cache *s) · 78 unmodified lines | ||
| 5752 | 5751 | schedule_work(&s->kobj_remove_work); |
| 5753 | 5752 | } |
| 5754 | 5753 | |
| 5754 | +void sysfs_slab_unlink(struct kmem_cache *s) | |
| 5755 | +{ | |
| 5756 | + if (slab_state >= FULL) | |
| 5757 | + kobject_del(&s->kobj); | |
| 5758 | +} | |
| 5759 | + | |
| 5755 | 5760 | void sysfs_slab_release(struct kmem_cache *s) |
| 5756 | 5761 | { |
| 5757 | 5762 | if (slab_state >= FULL) |
| @@ -1796,11 +1796,9 @@ static void vmstat_update(struct work_struct *w) · 1795 unmodified lines | ||
| 1796 | 1796 | * to occur in the future. Keep on running the |
| 1797 | 1797 | * update worker thread. |
| 1798 | 1798 | */ |
| 1799 | − preempt_disable(); | |
| 1800 | 1799 | queue_delayed_work_on(smp_processor_id(), mm_percpu_wq, |
| 1801 | 1800 | this_cpu_ptr(&vmstat_work), |
| 1802 | 1801 | round_jiffies_relative(sysctl_stat_interval)); |
| 1803 | − preempt_enable(); | |
| 1804 | 1802 | } |
| 1805 | 1803 | } |
| 1806 | 1804 | |
| @@ -1869,7 +1869,7 @@ static const struct proto_ops atalk_dgram_ops = { · 1868 unmodified lines | ||
| 1869 | 1869 | .socketpair = sock_no_socketpair, |
| 1870 | 1870 | .accept = sock_no_accept, |
| 1871 | 1871 | .getname = atalk_getname, |
| 1872 | − .poll_mask = datagram_poll_mask, | |
| 1872 | + .poll = datagram_poll, | |
| 1873 | 1873 | .ioctl = atalk_ioctl, |
| 1874 | 1874 | #ifdef CONFIG_COMPAT |
| 1875 | 1875 | .compat_ioctl = atalk_compat_ioctl, |
| @@ -252,8 +252,7 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct net_device *dev, · 251 unmodified lines | ||
| 252 | 252 | |
| 253 | 253 | ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc; |
| 254 | 254 | pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev); |
| 255 | − refcount_add(skb->truesize, &sk_atm(atmvcc)->sk_wmem_alloc); | |
| 256 | − ATM_SKB(skb)->atm_options = atmvcc->atm_options; | |
| 255 | + atm_account_tx(atmvcc, skb); | |
| 257 | 256 | dev->stats.tx_packets++; |
| 258 | 257 | dev->stats.tx_bytes += skb->len; |
| 259 | 258 | |
| @@ -381,8 +381,7 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb, · 380 unmodified lines | ||
| 381 | 381 | memcpy(here, llc_oui, sizeof(llc_oui)); |
| 382 | 382 | ((__be16 *) here)[3] = skb->protocol; |
| 383 | 383 | } |
| 384 | − refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); | |
| 385 | − ATM_SKB(skb)->atm_options = vcc->atm_options; | |
| 384 | + atm_account_tx(vcc, skb); | |
| 386 | 385 | entry->vccs->last_use = jiffies; |
| 387 | 386 | pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, vcc, vcc->dev); |
| 388 | 387 | old = xchg(&entry->vccs->xoff, 1); /* assume XOFF ... */ |
| @@ -630,10 +630,9 @@ int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t size) · 629 unmodified lines | ||
| 630 | 630 | goto out; |
| 631 | 631 | } |
| 632 | 632 | pr_debug("%d += %d\n", sk_wmem_alloc_get(sk), skb->truesize); |
| 633 | − refcount_add(skb->truesize, &sk->sk_wmem_alloc); | |
| 633 | + atm_account_tx(vcc, skb); | |
| 634 | 634 | |
| 635 | 635 | skb->dev = NULL; /* for paths shared with net_device interfaces */ |
| 636 | − ATM_SKB(skb)->atm_options = vcc->atm_options; | |
| 637 | 636 | if (!copy_from_iter_full(skb_put(skb, size), size, &m->msg_iter)) { |
| 638 | 637 | kfree_skb(skb); |
| 639 | 638 | error = -EFAULT; |
| @@ -648,11 +647,16 @@ out: · 8 unmodified lines | ||
| 648 | 647 | return error; |
| 649 | 648 | } |
| 650 | 649 | |
| 651 | −__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) | |
| 652 | 651 | { |
| 653 | 652 | struct sock *sk = sock->sk; |
| 654 | − struct atm_vcc *vcc = ATM_SD(sock); | |
| 655 | − __poll_t mask = 0; | |
| 653 | + struct atm_vcc *vcc; | |
| 654 | + __poll_t mask; | |
| 655 | + | |
| 656 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 657 | + mask = 0; | |
| 658 | + | |
| 659 | + vcc = ATM_SD(sock); | |
| 656 | 660 | |
| 657 | 661 | /* exceptional events */ |
| 658 | 662 | if (sk->sk_err) |
| @@ -17,7 +17,7 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci); · 16 unmodified lines | ||
| 17 | 17 | int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, |
| 18 | 18 | int flags); |
| 19 | 19 | int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len); |
| 20 | −__poll_t vcc_poll_mask(struct socket *sock, __poll_t events); | |
| 20 | +__poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait); | |
| 21 | 21 | int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 22 | 22 | int vcc_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 23 | 23 | int vcc_setsockopt(struct socket *sock, int level, int optname, |
| @@ -182,9 +182,8 @@ lec_send(struct atm_vcc *vcc, struct sk_buff *skb) · 181 unmodified lines | ||
| 182 | 182 | struct net_device *dev = skb->dev; |
| 183 | 183 | |
| 184 | 184 | ATM_SKB(skb)->vcc = vcc; |
| 185 | − ATM_SKB(skb)->atm_options = vcc->atm_options; | |
| 185 | + atm_account_tx(vcc, skb); | |
| 186 | 186 | |
| 187 | − refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); | |
| 188 | 187 | if (vcc->send(vcc, skb) < 0) { |
| 189 | 188 | dev->stats.tx_dropped++; |
| 190 | 189 | return; |
| @@ -555,8 +555,7 @@ static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc) · 554 unmodified lines | ||
| 555 | 555 | sizeof(struct llc_snap_hdr)); |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | − refcount_add(skb->truesize, &sk_atm(entry->shortcut)->sk_wmem_alloc); | |
| 559 | − ATM_SKB(skb)->atm_options = entry->shortcut->atm_options; | |
| 558 | + atm_account_tx(entry->shortcut, skb); | |
| 560 | 559 | entry->shortcut->send(entry->shortcut, skb); |
| 561 | 560 | entry->packets_fwded++; |
| 562 | 561 | mpc->in_ops->put(entry); |
| @@ -350,8 +350,7 @@ static int pppoatm_send(struct ppp_channel *chan, struct sk_buff *skb) · 349 unmodified lines | ||
| 350 | 350 | return 1; |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | − refcount_add(skb->truesize, &sk_atm(ATM_SKB(skb)->vcc)->sk_wmem_alloc); | |
| 354 | − ATM_SKB(skb)->atm_options = ATM_SKB(skb)->vcc->atm_options; | |
| 353 | + atm_account_tx(vcc, skb); | |
| 355 | 354 | pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", |
| 356 | 355 | skb, ATM_SKB(skb)->vcc, ATM_SKB(skb)->vcc->dev); |
| 357 | 356 | ret = ATM_SKB(skb)->vcc->send(ATM_SKB(skb)->vcc, skb) |
| @@ -113,7 +113,7 @@ static const struct proto_ops pvc_proto_ops = { · 112 unmodified lines | ||
| 113 | 113 | .socketpair = sock_no_socketpair, |
| 114 | 114 | .accept = sock_no_accept, |
| 115 | 115 | .getname = pvc_getname, |
| 116 | − .poll_mask = vcc_poll_mask, | |
| 116 | + .poll = vcc_poll, | |
| 117 | 117 | .ioctl = vcc_ioctl, |
| 118 | 118 | #ifdef CONFIG_COMPAT |
| 119 | 119 | .compat_ioctl = vcc_compat_ioctl, |
| @@ -35,8 +35,8 @@ static void atm_pop_raw(struct atm_vcc *vcc, struct sk_buff *skb) · 34 unmodified lines | ||
| 35 | 35 | struct sock *sk = sk_atm(vcc); |
| 36 | 36 | |
| 37 | 37 | pr_debug("(%d) %d -= %d\n", |
| 38 | − vcc->vci, sk_wmem_alloc_get(sk), skb->truesize); | |
| 39 | − WARN_ON(refcount_sub_and_test(skb->truesize, &sk->sk_wmem_alloc)); | |
| 38 | + vcc->vci, sk_wmem_alloc_get(sk), ATM_SKB(skb)->acct_truesize); | |
| 39 | + WARN_ON(refcount_sub_and_test(ATM_SKB(skb)->acct_truesize, &sk->sk_wmem_alloc)); | |
| 40 | 40 | dev_kfree_skb_any(skb); |
| 41 | 41 | sk->sk_write_space(sk); |
| 42 | 42 | } |
| @@ -636,7 +636,7 @@ static const struct proto_ops svc_proto_ops = { · 635 unmodified lines | ||
| 636 | 636 | .socketpair = sock_no_socketpair, |
| 637 | 637 | .accept = svc_accept, |
| 638 | 638 | .getname = svc_getname, |
| 639 | − .poll_mask = vcc_poll_mask, | |
| 639 | + .poll = vcc_poll, | |
| 640 | 640 | .ioctl = svc_ioctl, |
| 641 | 641 | #ifdef CONFIG_COMPAT |
| 642 | 642 | .compat_ioctl = svc_compat_ioctl, |
| @@ -1941,7 +1941,7 @@ static const struct proto_ops ax25_proto_ops = { · 1940 unmodified lines | ||
| 1941 | 1941 | .socketpair = sock_no_socketpair, |
| 1942 | 1942 | .accept = ax25_accept, |
| 1943 | 1943 | .getname = ax25_getname, |
| 1944 | − .poll_mask = datagram_poll_mask, | |
| 1944 | + .poll = datagram_poll, | |
| 1945 | 1945 | .ioctl = ax25_ioctl, |
| 1946 | 1946 | .listen = ax25_listen, |
| 1947 | 1947 | .shutdown = ax25_shutdown, |
| @@ -437,13 +437,16 @@ static inline __poll_t bt_accept_poll(struct sock *parent) · 436 unmodified lines | ||
| 437 | 437 | return 0; |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | −__poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events) | |
| 440 | +__poll_t bt_sock_poll(struct file *file, struct socket *sock, | |
| 441 | + poll_table *wait) | |
| 441 | 442 | { |
| 442 | 443 | struct sock *sk = sock->sk; |
| 443 | 444 | __poll_t mask = 0; |
| 444 | 445 | |
| 445 | 446 | BT_DBG("sock %p, sk %p", sock, sk); |
| 446 | 447 | |
| 448 | + poll_wait(file, sk_sleep(sk), wait); | |
| 449 | + | |
| 447 | 450 | if (sk->sk_state == BT_LISTEN) |
| 448 | 451 | return bt_accept_poll(sk); |
| 449 | 452 | |
| @@ -475,7 +478,7 @@ __poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events) · 25 unmodified lines | ||
| 475 | 478 | |
| 476 | 479 | return mask; |
| 477 | 480 | } |
| 478 | −EXPORT_SYMBOL(bt_sock_poll_mask); | |
| 481 | +EXPORT_SYMBOL(bt_sock_poll); | |
| 479 | 482 | |
| 480 | 483 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) |
| 481 | 484 | { |
| @@ -1975,7 +1975,7 @@ static const struct proto_ops hci_sock_ops = { · 1974 unmodified lines | ||
| 1975 | 1975 | .sendmsg = hci_sock_sendmsg, |
| 1976 | 1976 | .recvmsg = hci_sock_recvmsg, |
| 1977 | 1977 | .ioctl = hci_sock_ioctl, |
| 1978 | − .poll_mask = datagram_poll_mask, | |
| 1978 | + .poll = datagram_poll, | |
| 1979 | 1979 | .listen = sock_no_listen, |
| 1980 | 1980 | .shutdown = sock_no_shutdown, |
| 1981 | 1981 | .setsockopt = hci_sock_setsockopt, |
| @@ -1653,7 +1653,7 @@ static const struct proto_ops l2cap_sock_ops = { · 1652 unmodified lines | ||
| 1653 | 1653 | .getname = l2cap_sock_getname, |
| 1654 | 1654 | .sendmsg = l2cap_sock_sendmsg, |
| 1655 | 1655 | .recvmsg = l2cap_sock_recvmsg, |
| 1656 | − .poll_mask = bt_sock_poll_mask, | |
| 1656 | + .poll = bt_sock_poll, | |
| 1657 | 1657 | .ioctl = bt_sock_ioctl, |
| 1658 | 1658 | .mmap = sock_no_mmap, |
| 1659 | 1659 | .socketpair = sock_no_socketpair, |
| @@ -1049,7 +1049,7 @@ static const struct proto_ops rfcomm_sock_ops = { · 1048 unmodified lines | ||
| 1049 | 1049 | .setsockopt = rfcomm_sock_setsockopt, |
| 1050 | 1050 | .getsockopt = rfcomm_sock_getsockopt, |
| 1051 | 1051 | .ioctl = rfcomm_sock_ioctl, |
| 1052 | − .poll_mask = bt_sock_poll_mask, | |
| 1052 | + .poll = bt_sock_poll, | |
| 1053 | 1053 | .socketpair = sock_no_socketpair, |
| 1054 | 1054 | .mmap = sock_no_mmap |
| 1055 | 1055 | }; |
| @@ -1197,7 +1197,7 @@ static const struct proto_ops sco_sock_ops = { · 1196 unmodified lines | ||
| 1197 | 1197 | .getname = sco_sock_getname, |
| 1198 | 1198 | .sendmsg = sco_sock_sendmsg, |
| 1199 | 1199 | .recvmsg = sco_sock_recvmsg, |
| 1200 | − .poll_mask = bt_sock_poll_mask, | |
| 1200 | + .poll = bt_sock_poll, | |
| 1201 | 1201 | .ioctl = bt_sock_ioctl, |
| 1202 | 1202 | .mmap = sock_no_mmap, |
| 1203 | 1203 | .socketpair = sock_no_socketpair, |
| @@ -0,0 +1 @@ | ||
| 1 | +bpfilter_umh | |
| @@ -21,8 +21,10 @@ endif · 20 unmodified lines | ||
| 21 | 21 | # which bpfilter_kern.c passes further into umh blob loader at run-time |
| 22 | 22 | quiet_cmd_copy_umh = GEN $@ |
| 23 | 23 | cmd_copy_umh = echo ':' > $(obj)/.bpfilter_umh.o.cmd; \ |
| 24 | − $(OBJCOPY) -I binary -O `$(OBJDUMP) -f $<|grep format|cut -d' ' -f8` \ | |
| 25 | − -B `$(OBJDUMP) -f $<|grep architecture|cut -d, -f1|cut -d' ' -f2` \ | |
| 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}'` \ | |
| 26 | 28 | --rename-section .data=.init.rodata $< $@ |
| 27 | 29 | |
| 28 | 30 | $(obj)/bpfilter_umh.o: $(obj)/bpfilter_umh |
| @@ -934,11 +934,15 @@ static int caif_release(struct socket *sock) · 933 unmodified lines | ||
| 934 | 934 | } |
| 935 | 935 | |
| 936 | 936 | /* Copied from af_unix.c:unix_poll(), added CAIF tx_flow handling */ |
| 937 | −static __poll_t caif_poll_mask(struct socket *sock, __poll_t events) | |
| 937 | +static __poll_t caif_poll(struct file *file, | |
| 938 | + struct socket *sock, poll_table *wait) | |
| 938 | 939 | { |
| 939 | 940 | struct sock *sk = sock->sk; |
| 941 | + __poll_t mask; | |
| 940 | 942 | struct caifsock *cf_sk = container_of(sk, struct caifsock, sk); |
| 941 | − __poll_t mask = 0; | |
| 943 | + | |
| 944 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 945 | + mask = 0; | |
| 942 | 946 | |
| 943 | 947 | /* exceptional events? */ |
| 944 | 948 | if (sk->sk_err) |
| @@ -972,7 +976,7 @@ static const struct proto_ops caif_seqpacket_ops = { · 27 unmodified lines | ||
| 972 | 976 | .socketpair = sock_no_socketpair, |
| 973 | 977 | .accept = sock_no_accept, |
| 974 | 978 | .getname = sock_no_getname, |
| 975 | − .poll_mask = caif_poll_mask, | |
| 979 | + .poll = caif_poll, | |
| 976 | 980 | .ioctl = sock_no_ioctl, |
| 977 | 981 | .listen = sock_no_listen, |
| 978 | 982 | .shutdown = sock_no_shutdown, |
| @@ -993,7 +997,7 @@ static const struct proto_ops caif_stream_ops = { · 14 unmodified lines | ||
| 993 | 997 | .socketpair = sock_no_socketpair, |
| 994 | 998 | .accept = sock_no_accept, |
| 995 | 999 | .getname = sock_no_getname, |
| 996 | − .poll_mask = caif_poll_mask, | |
| 1000 | + .poll = caif_poll, | |
| 997 | 1001 | .ioctl = sock_no_ioctl, |
| 998 | 1002 | .listen = sock_no_listen, |
| 999 | 1003 | .shutdown = sock_no_shutdown, |
| @@ -1660,7 +1660,7 @@ static const struct proto_ops bcm_ops = { · 1659 unmodified lines | ||
| 1660 | 1660 | .socketpair = sock_no_socketpair, |
| 1661 | 1661 | .accept = sock_no_accept, |
| 1662 | 1662 | .getname = sock_no_getname, |
| 1663 | − .poll_mask = datagram_poll_mask, | |
| 1663 | + .poll = datagram_poll, | |
| 1664 | 1664 | .ioctl = can_ioctl, /* use can_ioctl() from af_can.c */ |
| 1665 | 1665 | .listen = sock_no_listen, |
| 1666 | 1666 | .shutdown = sock_no_shutdown, |
| @@ -843,7 +843,7 @@ static const struct proto_ops raw_ops = { · 842 unmodified lines | ||
| 843 | 843 | .socketpair = sock_no_socketpair, |
| 844 | 844 | .accept = sock_no_accept, |
| 845 | 845 | .getname = raw_getname, |
| 846 | − .poll_mask = datagram_poll_mask, | |
| 846 | + .poll = datagram_poll, | |
| 847 | 847 | .ioctl = can_ioctl, /* use can_ioctl() from af_can.c */ |
| 848 | 848 | .listen = sock_no_listen, |
| 849 | 849 | .shutdown = sock_no_shutdown, |
| @@ -819,8 +819,9 @@ EXPORT_SYMBOL(skb_copy_and_csum_datagram_msg); · 818 unmodified lines | ||
| 819 | 819 | |
| 820 | 820 | /** |
| 821 | 821 | * datagram_poll - generic datagram poll |
| 822 | + * @file: file struct | |
| 822 | 823 | * @sock: socket |
| 823 | − * @events to wait for | |
| 824 | + * @wait: poll table | |
| 824 | 825 | * |
| 825 | 826 | * Datagram poll: Again totally generic. This also handles |
| 826 | 827 | * sequenced packet sockets providing the socket receive queue |
| @@ -830,10 +831,14 @@ EXPORT_SYMBOL(skb_copy_and_csum_datagram_msg); · 3 unmodified lines | ||
| 830 | 831 | * and you use a different write policy from sock_writeable() |
| 831 | 832 | * then please supply your own write_space callback. |
| 832 | 833 | */ |
| 833 | −__poll_t datagram_poll_mask(struct socket *sock, __poll_t events) | |
| 834 | +__poll_t datagram_poll(struct file *file, struct socket *sock, | |
| 835 | + poll_table *wait) | |
| 834 | 836 | { |
| 835 | 837 | struct sock *sk = sock->sk; |
| 836 | − __poll_t mask = 0; | |
| 838 | + __poll_t mask; | |
| 839 | + | |
| 840 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 841 | + mask = 0; | |
| 837 | 842 | |
| 838 | 843 | /* exceptional events? */ |
| 839 | 844 | if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) |
| @@ -866,4 +871,4 @@ __poll_t datagram_poll_mask(struct socket *sock, __poll_t events) · 26 unmodified lines | ||
| 866 | 871 | |
| 867 | 872 | return mask; |
| 868 | 873 | } |
| 869 | −EXPORT_SYMBOL(datagram_poll_mask); | |
| 874 | +EXPORT_SYMBOL(datagram_poll); | |
| @@ -8643,7 +8643,8 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char · 8642 unmodified lines | ||
| 8643 | 8643 | /* We get here if we can't use the current device name */ |
| 8644 | 8644 | if (!pat) |
| 8645 | 8645 | goto out; |
| 8646 | − if (dev_get_valid_name(net, dev, pat) < 0) | |
| 8646 | + err = dev_get_valid_name(net, dev, pat); | |
| 8647 | + if (err < 0) | |
| 8647 | 8648 | goto out; |
| 8648 | 8649 | } |
| 8649 | 8650 | |
| @@ -8655,7 +8656,6 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char · 5 unmodified lines | ||
| 8655 | 8656 | dev_close(dev); |
| 8656 | 8657 | |
| 8657 | 8658 | /* And unlink it from device chain */ |
| 8658 | − err = -ENODEV; | |
| 8659 | 8659 | unlist_netdevice(dev); |
| 8660 | 8660 | |
| 8661 | 8661 | synchronize_net(); |
| @@ -3214,20 +3214,6 @@ err: · 3213 unmodified lines | ||
| 3214 | 3214 | } |
| 3215 | 3215 | EXPORT_SYMBOL_GPL(xdp_do_redirect); |
| 3216 | 3216 | |
| 3217 | −static int __xdp_generic_ok_fwd_dev(struct sk_buff *skb, struct net_device *fwd) | |
| 3218 | −{ | |
| 3219 | − unsigned int len; | |
| 3220 | − | |
| 3221 | − if (unlikely(!(fwd->flags & IFF_UP))) | |
| 3222 | − return -ENETDOWN; | |
| 3223 | − | |
| 3224 | − len = fwd->mtu + fwd->hard_header_len + VLAN_HLEN; | |
| 3225 | − if (skb->len > len) | |
| 3226 | − return -EMSGSIZE; | |
| 3227 | − | |
| 3228 | − return 0; | |
| 3229 | −} | |
| 3230 | − | |
| 3231 | 3217 | static int xdp_do_generic_redirect_map(struct net_device *dev, |
| 3232 | 3218 | struct sk_buff *skb, |
| 3233 | 3219 | struct xdp_buff *xdp, |
| @@ -3256,10 +3242,11 @@ static int xdp_do_generic_redirect_map(struct net_device *dev, · 22 unmodified lines | ||
| 3256 | 3242 | } |
| 3257 | 3243 | |
| 3258 | 3244 | if (map->map_type == BPF_MAP_TYPE_DEVMAP) { |
| 3259 | − if (unlikely((err = __xdp_generic_ok_fwd_dev(skb, fwd)))) | |
| 3245 | + struct bpf_dtab_netdev *dst = fwd; | |
| 3246 | + | |
| 3247 | + err = dev_map_generic_redirect(dst, skb, xdp_prog); | |
| 3248 | + if (unlikely(err)) | |
| 3260 | 3249 | goto err; |
| 3261 | − skb->dev = fwd; | |
| 3262 | − generic_xdp_tx(skb, xdp_prog); | |
| 3263 | 3250 | } else if (map->map_type == BPF_MAP_TYPE_XSKMAP) { |
| 3264 | 3251 | struct xdp_sock *xs = fwd; |
| 3265 | 3252 | |
| @@ -600,7 +600,7 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk, · 599 unmodified lines | ||
| 600 | 600 | { |
| 601 | 601 | struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk); |
| 602 | 602 | struct dccp_sock *dp = dccp_sk(sk); |
| 603 | − ktime_t now = ktime_get_real(); | |
| 603 | + ktime_t now = ktime_get(); | |
| 604 | 604 | s64 delta = 0; |
| 605 | 605 | |
| 606 | 606 | switch (fbtype) { |
| @@ -625,15 +625,14 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk, · 18 unmodified lines | ||
| 625 | 625 | case CCID3_FBACK_PERIODIC: |
| 626 | 626 | delta = ktime_us_delta(now, hc->rx_tstamp_last_feedback); |
| 627 | 627 | if (delta <= 0) |
| 628 | − DCCP_BUG("delta (%ld) <= 0", (long)delta); | |
| 629 | − else | |
| 630 | − hc->rx_x_recv = scaled_div32(hc->rx_bytes_recv, delta); | |
| 628 | + delta = 1; | |
| 629 | + hc->rx_x_recv = scaled_div32(hc->rx_bytes_recv, delta); | |
| 631 | 630 | break; |
| 632 | 631 | default: |
| 633 | 632 | return; |
| 634 | 633 | } |
| 635 | 634 | |
| 636 | − ccid3_pr_debug("Interval %ldusec, X_recv=%u, 1/p=%u\n", (long)delta, | |
| 635 | + ccid3_pr_debug("Interval %lldusec, X_recv=%u, 1/p=%u\n", delta, | |
| 637 | 636 | hc->rx_x_recv, hc->rx_pinv); |
| 638 | 637 | |
| 639 | 638 | hc->rx_tstamp_last_feedback = now; |
| @@ -680,7 +679,8 @@ static int ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb) · 40 unmodified lines | ||
| 680 | 679 | static u32 ccid3_first_li(struct sock *sk) |
| 681 | 680 | { |
| 682 | 681 | struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk); |
| 683 | − u32 x_recv, p, delta; | |
| 682 | + u32 x_recv, p; | |
| 683 | + s64 delta; | |
| 684 | 684 | u64 fval; |
| 685 | 685 | |
| 686 | 686 | if (hc->rx_rtt == 0) { |
| @@ -688,7 +688,9 @@ static u32 ccid3_first_li(struct sock *sk) · 1 unmodified line | ||
| 688 | 688 | hc->rx_rtt = DCCP_FALLBACK_RTT; |
| 689 | 689 | } |
| 690 | 690 | |
| 691 | − delta = ktime_to_us(net_timedelta(hc->rx_tstamp_last_feedback)); | |
| 691 | + delta = ktime_us_delta(ktime_get(), hc->rx_tstamp_last_feedback); | |
| 692 | + if (delta <= 0) | |
| 693 | + delta = 1; | |
| 692 | 694 | x_recv = scaled_div32(hc->rx_bytes_recv, delta); |
| 693 | 695 | if (x_recv == 0) { /* would also trigger divide-by-zero */ |
| 694 | 696 | DCCP_WARN("X_recv==0\n"); |
| @@ -316,7 +316,8 @@ int dccp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, · 315 unmodified lines | ||
| 316 | 316 | int flags, int *addr_len); |
| 317 | 317 | void dccp_shutdown(struct sock *sk, int how); |
| 318 | 318 | int inet_dccp_listen(struct socket *sock, int backlog); |
| 319 | −__poll_t dccp_poll_mask(struct socket *sock, __poll_t events); | |
| 319 | +__poll_t dccp_poll(struct file *file, struct socket *sock, | |
| 320 | + poll_table *wait); | |
| 320 | 321 | int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); |
| 321 | 322 | void dccp_req_err(struct sock *sk, u64 seq); |
| 322 | 323 | |
| @@ -984,7 +984,7 @@ static const struct proto_ops inet_dccp_ops = { · 983 unmodified lines | ||
| 984 | 984 | .accept = inet_accept, |
| 985 | 985 | .getname = inet_getname, |
| 986 | 986 | /* FIXME: work on tcp_poll to rename it to inet_csk_poll */ |
| 987 | − .poll_mask = dccp_poll_mask, | |
| 987 | + .poll = dccp_poll, | |
| 988 | 988 | .ioctl = inet_ioctl, |
| 989 | 989 | /* FIXME: work on inet_listen to rename it to sock_common_listen */ |
| 990 | 990 | .listen = inet_dccp_listen, |
| @@ -1070,7 +1070,7 @@ static const struct proto_ops inet6_dccp_ops = { · 1069 unmodified lines | ||
| 1070 | 1070 | .socketpair = sock_no_socketpair, |
| 1071 | 1071 | .accept = inet_accept, |
| 1072 | 1072 | .getname = inet6_getname, |
| 1073 | − .poll_mask = dccp_poll_mask, | |
| 1073 | + .poll = dccp_poll, | |
| 1074 | 1074 | .ioctl = inet6_ioctl, |
| 1075 | 1075 | .listen = inet_dccp_listen, |
| 1076 | 1076 | .shutdown = inet_shutdown, |
| @@ -312,11 +312,20 @@ int dccp_disconnect(struct sock *sk, int flags) · 311 unmodified lines | ||
| 312 | 312 | |
| 313 | 313 | EXPORT_SYMBOL_GPL(dccp_disconnect); |
| 314 | 314 | |
| 315 | −__poll_t dccp_poll_mask(struct socket *sock, __poll_t events) | |
| 315 | +/* | |
| 316 | + * Wait for a DCCP event. | |
| 317 | + * | |
| 318 | + * Note that we don't need to lock the socket, as the upper poll layers | |
| 319 | + * take care of normal races (between the test and the event) and we don't | |
| 320 | + * go look at any of the socket buffers directly. | |
| 321 | + */ | |
| 322 | +__poll_t dccp_poll(struct file *file, struct socket *sock, | |
| 323 | + poll_table *wait) | |
| 316 | 324 | { |
| 317 | 325 | __poll_t mask; |
| 318 | 326 | struct sock *sk = sock->sk; |
| 319 | 327 | |
| 328 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 320 | 329 | if (sk->sk_state == DCCP_LISTEN) |
| 321 | 330 | return inet_csk_listen_poll(sk); |
| 322 | 331 | |
| @@ -358,7 +367,7 @@ __poll_t dccp_poll_mask(struct socket *sock, __poll_t events) · 35 unmodified lines | ||
| 358 | 367 | return mask; |
| 359 | 368 | } |
| 360 | 369 | |
| 361 | −EXPORT_SYMBOL_GPL(dccp_poll_mask); | |
| 370 | +EXPORT_SYMBOL_GPL(dccp_poll); | |
| 362 | 371 | |
| 363 | 372 | int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg) |
| 364 | 373 | { |
| @@ -1207,11 +1207,11 @@ static int dn_getname(struct socket *sock, struct sockaddr *uaddr,int peer) · 1206 unmodified lines | ||
| 1207 | 1207 | } |
| 1208 | 1208 | |
| 1209 | 1209 | |
| 1210 | −static __poll_t dn_poll_mask(struct socket *sock, __poll_t events) | |
| 1210 | +static __poll_t dn_poll(struct file *file, struct socket *sock, poll_table *wait) | |
| 1211 | 1211 | { |
| 1212 | 1212 | struct sock *sk = sock->sk; |
| 1213 | 1213 | struct dn_scp *scp = DN_SK(sk); |
| 1214 | − __poll_t mask = datagram_poll_mask(sock, events); | |
| 1214 | + __poll_t mask = datagram_poll(file, sock, wait); | |
| 1215 | 1215 | |
| 1216 | 1216 | if (!skb_queue_empty(&scp->other_receive_queue)) |
| 1217 | 1217 | mask |= EPOLLRDBAND; |
| @@ -2331,7 +2331,7 @@ static const struct proto_ops dn_proto_ops = { · 1113 unmodified lines | ||
| 2331 | 2331 | .socketpair = sock_no_socketpair, |
| 2332 | 2332 | .accept = dn_accept, |
| 2333 | 2333 | .getname = dn_getname, |
| 2334 | − .poll_mask = dn_poll_mask, | |
| 2334 | + .poll = dn_poll, | |
| 2335 | 2335 | .ioctl = dn_ioctl, |
| 2336 | 2336 | .listen = dn_listen, |
| 2337 | 2337 | .shutdown = dn_shutdown, |
| @@ -423,7 +423,7 @@ static const struct proto_ops ieee802154_raw_ops = { · 422 unmodified lines | ||
| 423 | 423 | .socketpair = sock_no_socketpair, |
| 424 | 424 | .accept = sock_no_accept, |
| 425 | 425 | .getname = sock_no_getname, |
| 426 | − .poll_mask = datagram_poll_mask, | |
| 426 | + .poll = datagram_poll, | |
| 427 | 427 | .ioctl = ieee802154_sock_ioctl, |
| 428 | 428 | .listen = sock_no_listen, |
| 429 | 429 | .shutdown = sock_no_shutdown, |
| @@ -969,7 +969,7 @@ static const struct proto_ops ieee802154_dgram_ops = { · 539 unmodified lines | ||
| 969 | 969 | .socketpair = sock_no_socketpair, |
| 970 | 970 | .accept = sock_no_accept, |
| 971 | 971 | .getname = sock_no_getname, |
| 972 | − .poll_mask = datagram_poll_mask, | |
| 972 | + .poll = datagram_poll, | |
| 973 | 973 | .ioctl = ieee802154_sock_ioctl, |
| 974 | 974 | .listen = sock_no_listen, |
| 975 | 975 | .shutdown = sock_no_shutdown, |
| @@ -986,7 +986,7 @@ const struct proto_ops inet_stream_ops = { · 985 unmodified lines | ||
| 986 | 986 | .socketpair = sock_no_socketpair, |
| 987 | 987 | .accept = inet_accept, |
| 988 | 988 | .getname = inet_getname, |
| 989 | − .poll_mask = tcp_poll_mask, | |
| 989 | + .poll = tcp_poll, | |
| 990 | 990 | .ioctl = inet_ioctl, |
| 991 | 991 | .listen = inet_listen, |
| 992 | 992 | .shutdown = inet_shutdown, |
| @@ -1021,7 +1021,7 @@ const struct proto_ops inet_dgram_ops = { · 28 unmodified lines | ||
| 1021 | 1021 | .socketpair = sock_no_socketpair, |
| 1022 | 1022 | .accept = sock_no_accept, |
| 1023 | 1023 | .getname = inet_getname, |
| 1024 | − .poll_mask = udp_poll_mask, | |
| 1024 | + .poll = udp_poll, | |
| 1025 | 1025 | .ioctl = inet_ioctl, |
| 1026 | 1026 | .listen = sock_no_listen, |
| 1027 | 1027 | .shutdown = inet_shutdown, |
| @@ -1042,7 +1042,7 @@ EXPORT_SYMBOL(inet_dgram_ops); · 14 unmodified lines | ||
| 1042 | 1042 | |
| 1043 | 1043 | /* |
| 1044 | 1044 | * For SOCK_RAW sockets; should be the same as inet_dgram_ops but without |
| 1045 | − * udp_poll_mask | |
| 1045 | + * udp_poll | |
| 1046 | 1046 | */ |
| 1047 | 1047 | static const struct proto_ops inet_sockraw_ops = { |
| 1048 | 1048 | .family = PF_INET, |
| @@ -1053,7 +1053,7 @@ static const struct proto_ops inet_sockraw_ops = { · 4 unmodified lines | ||
| 1053 | 1053 | .socketpair = sock_no_socketpair, |
| 1054 | 1054 | .accept = sock_no_accept, |
| 1055 | 1055 | .getname = inet_getname, |
| 1056 | − .poll_mask = datagram_poll_mask, | |
| 1056 | + .poll = datagram_poll, | |
| 1057 | 1057 | .ioctl = inet_ioctl, |
| 1058 | 1058 | .listen = sock_no_listen, |
| 1059 | 1059 | .shutdown = inet_shutdown, |
| @@ -243,9 +243,9 @@ static inline int compute_score(struct sock *sk, struct net *net, · 242 unmodified lines | ||
| 243 | 243 | bool dev_match = (sk->sk_bound_dev_if == dif || |
| 244 | 244 | sk->sk_bound_dev_if == sdif); |
| 245 | 245 | |
| 246 | − if (exact_dif && !dev_match) | |
| 246 | + if (!dev_match) | |
| 247 | 247 | return -1; |
| 248 | − if (sk->sk_bound_dev_if && dev_match) | |
| 248 | + if (sk->sk_bound_dev_if) | |
| 249 | 249 | score += 4; |
| 250 | 250 | } |
| 251 | 251 | if (sk->sk_incoming_cpu == raw_smp_processor_id()) |
| @@ -1145,7 +1145,8 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork, · 1144 unmodified lines | ||
| 1145 | 1145 | cork->fragsize = ip_sk_use_pmtu(sk) ? |
| 1146 | 1146 | dst_mtu(&rt->dst) : rt->dst.dev->mtu; |
| 1147 | 1147 | |
| 1148 | − cork->gso_size = sk->sk_type == SOCK_DGRAM ? ipc->gso_size : 0; | |
| 1148 | + cork->gso_size = sk->sk_type == SOCK_DGRAM && | |
| 1149 | + sk->sk_protocol == IPPROTO_UDP ? ipc->gso_size : 0; | |
| 1149 | 1150 | cork->dst = &rt->dst; |
| 1150 | 1151 | cork->length = 0; |
| 1151 | 1152 | cork->ttl = ipc->ttl; |
| @@ -494,21 +494,32 @@ static inline bool tcp_stream_is_readable(const struct tcp_sock *tp, · 493 unmodified lines | ||
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | /* |
| 497 | − * Socket is not locked. We are protected from async events by poll logic and | |
| 498 | − * correct handling of state changes made by other threads is impossible in | |
| 499 | − * any case. | |
| 497 | + * Wait for a TCP event. | |
| 498 | + * | |
| 499 | + * Note that we don't need to lock the socket, as the upper poll layers | |
| 500 | + * take care of normal races (between the test and the event) and we don't | |
| 501 | + * go look at any of the socket buffers directly. | |
| 500 | 502 | */ |
| 501 | −__poll_t tcp_poll_mask(struct socket *sock, __poll_t events) | |
| 503 | +__poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait) | |
| 502 | 504 | { |
| 505 | + __poll_t mask; | |
| 503 | 506 | struct sock *sk = sock->sk; |
| 504 | 507 | const struct tcp_sock *tp = tcp_sk(sk); |
| 505 | − __poll_t mask = 0; | |
| 506 | 508 | int state; |
| 507 | 509 | |
| 510 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 511 | + | |
| 508 | 512 | state = inet_sk_state_load(sk); |
| 509 | 513 | if (state == TCP_LISTEN) |
| 510 | 514 | return inet_csk_listen_poll(sk); |
| 511 | 515 | |
| 516 | + /* Socket is not locked. We are protected from async events | |
| 517 | + * by poll logic and correct handling of state changes | |
| 518 | + * made by other threads is impossible in any case. | |
| 519 | + */ | |
| 520 | + | |
| 521 | + mask = 0; | |
| 522 | + | |
| 512 | 523 | /* |
| 513 | 524 | * EPOLLHUP is certainly not done right. But poll() doesn't |
| 514 | 525 | * have a notion of HUP in just one direction, and for a |
| @@ -589,7 +600,7 @@ __poll_t tcp_poll_mask(struct socket *sock, __poll_t events) · 74 unmodified lines | ||
| 589 | 600 | |
| 590 | 601 | return mask; |
| 591 | 602 | } |
| 592 | −EXPORT_SYMBOL(tcp_poll_mask); | |
| 603 | +EXPORT_SYMBOL(tcp_poll); | |
| 593 | 604 | |
| 594 | 605 | int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg) |
| 595 | 606 | { |
| @@ -2591,7 +2591,7 @@ int compat_udp_getsockopt(struct sock *sk, int level, int optname, · 2590 unmodified lines | ||
| 2591 | 2591 | * udp_poll - wait for a UDP event. |
| 2592 | 2592 | * @file - file struct |
| 2593 | 2593 | * @sock - socket |
| 2594 | − * @events - events to wait for | |
| 2594 | + * @wait - poll table | |
| 2595 | 2595 | * |
| 2596 | 2596 | * This is same as datagram poll, except for the special case of |
| 2597 | 2597 | * blocking sockets. If application is using a blocking fd |
| @@ -2600,23 +2600,23 @@ int compat_udp_getsockopt(struct sock *sk, int level, int optname, · 2 unmodified lines | ||
| 2600 | 2600 | * but then block when reading it. Add special case code |
| 2601 | 2601 | * to work around these arguably broken applications. |
| 2602 | 2602 | */ |
| 2603 | −__poll_t udp_poll_mask(struct socket *sock, __poll_t events) | |
| 2603 | +__poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait) | |
| 2604 | 2604 | { |
| 2605 | − __poll_t mask = datagram_poll_mask(sock, events); | |
| 2605 | + __poll_t mask = datagram_poll(file, sock, wait); | |
| 2606 | 2606 | struct sock *sk = sock->sk; |
| 2607 | 2607 | |
| 2608 | 2608 | if (!skb_queue_empty(&udp_sk(sk)->reader_queue)) |
| 2609 | 2609 | mask |= EPOLLIN | EPOLLRDNORM; |
| 2610 | 2610 | |
| 2611 | 2611 | /* Check for false positives due to checksum errors */ |
| 2612 | − if ((mask & EPOLLRDNORM) && !(sock->file->f_flags & O_NONBLOCK) && | |
| 2612 | + if ((mask & EPOLLRDNORM) && !(file->f_flags & O_NONBLOCK) && | |
| 2613 | 2613 | !(sk->sk_shutdown & RCV_SHUTDOWN) && first_packet_length(sk) == -1) |
| 2614 | 2614 | mask &= ~(EPOLLIN | EPOLLRDNORM); |
| 2615 | 2615 | |
| 2616 | 2616 | return mask; |
| 2617 | 2617 | |
| 2618 | 2618 | } |
| 2619 | −EXPORT_SYMBOL(udp_poll_mask); | |
| 2619 | +EXPORT_SYMBOL(udp_poll); | |
| 2620 | 2620 | |
| 2621 | 2621 | int udp_abort(struct sock *sk, int err) |
| 2622 | 2622 | { |
| @@ -570,7 +570,7 @@ const struct proto_ops inet6_stream_ops = { · 569 unmodified lines | ||
| 570 | 570 | .socketpair = sock_no_socketpair, /* a do nothing */ |
| 571 | 571 | .accept = inet_accept, /* ok */ |
| 572 | 572 | .getname = inet6_getname, |
| 573 | − .poll_mask = tcp_poll_mask, /* ok */ | |
| 573 | + .poll = tcp_poll, /* ok */ | |
| 574 | 574 | .ioctl = inet6_ioctl, /* must change */ |
| 575 | 575 | .listen = inet_listen, /* ok */ |
| 576 | 576 | .shutdown = inet_shutdown, /* ok */ |
| @@ -603,7 +603,7 @@ const struct proto_ops inet6_dgram_ops = { · 26 unmodified lines | ||
| 603 | 603 | .socketpair = sock_no_socketpair, /* a do nothing */ |
| 604 | 604 | .accept = sock_no_accept, /* a do nothing */ |
| 605 | 605 | .getname = inet6_getname, |
| 606 | − .poll_mask = udp_poll_mask, /* ok */ | |
| 606 | + .poll = udp_poll, /* ok */ | |
| 607 | 607 | .ioctl = inet6_ioctl, /* must change */ |
| 608 | 608 | .listen = sock_no_listen, /* ok */ |
| 609 | 609 | .shutdown = inet_shutdown, /* ok */ |
| @@ -113,9 +113,9 @@ static inline int compute_score(struct sock *sk, struct net *net, · 112 unmodified lines | ||
| 113 | 113 | bool dev_match = (sk->sk_bound_dev_if == dif || |
| 114 | 114 | sk->sk_bound_dev_if == sdif); |
| 115 | 115 | |
| 116 | − if (exact_dif && !dev_match) | |
| 116 | + if (!dev_match) | |
| 117 | 117 | return -1; |
| 118 | − if (sk->sk_bound_dev_if && dev_match) | |
| 118 | + if (sk->sk_bound_dev_if) | |
| 119 | 119 | score++; |
| 120 | 120 | } |
| 121 | 121 | if (sk->sk_incoming_cpu == raw_smp_processor_id()) |
| @@ -167,8 +167,9 @@ struct fib6_info *fib6_info_alloc(gfp_t gfp_flags) · 166 unmodified lines | ||
| 167 | 167 | return f6i; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | −void fib6_info_destroy(struct fib6_info *f6i) | |
| 170 | +void fib6_info_destroy_rcu(struct rcu_head *head) | |
| 171 | 171 | { |
| 172 | + struct fib6_info *f6i = container_of(head, struct fib6_info, rcu); | |
| 172 | 173 | struct rt6_exception_bucket *bucket; |
| 173 | 174 | struct dst_metrics *m; |
| 174 | 175 | |
| @@ -206,7 +207,7 @@ void fib6_info_destroy(struct fib6_info *f6i) · 31 unmodified lines | ||
| 206 | 207 | |
| 207 | 208 | kfree(f6i); |
| 208 | 209 | } |
| 209 | −EXPORT_SYMBOL_GPL(fib6_info_destroy); | |
| 210 | +EXPORT_SYMBOL_GPL(fib6_info_destroy_rcu); | |
| 210 | 211 | |
| 211 | 212 | static struct fib6_node *node_alloc(struct net *net) |
| 212 | 213 | { |
| @@ -1219,7 +1219,8 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork, · 1218 unmodified lines | ||
| 1219 | 1219 | if (mtu < IPV6_MIN_MTU) |
| 1220 | 1220 | return -EINVAL; |
| 1221 | 1221 | cork->base.fragsize = mtu; |
| 1222 | − cork->base.gso_size = sk->sk_type == SOCK_DGRAM ? ipc6->gso_size : 0; | |
| 1222 | + cork->base.gso_size = sk->sk_type == SOCK_DGRAM && | |
| 1223 | + sk->sk_protocol == IPPROTO_UDP ? ipc6->gso_size : 0; | |
| 1223 | 1224 | |
| 1224 | 1225 | if (dst_allfrag(xfrm_dst_path(&rt->dst))) |
| 1225 | 1226 | cork->base.flags |= IPCORK_ALLFRAG; |
| @@ -2082,7 +2082,8 @@ void ipv6_mc_dad_complete(struct inet6_dev *idev) · 2081 unmodified lines | ||
| 2082 | 2082 | mld_send_initial_cr(idev); |
| 2083 | 2083 | idev->mc_dad_count--; |
| 2084 | 2084 | if (idev->mc_dad_count) |
| 2085 | − mld_dad_start_timer(idev, idev->mc_maxdelay); | |
| 2085 | + mld_dad_start_timer(idev, | |
| 2086 | + unsolicited_report_interval(idev)); | |
| 2086 | 2087 | } |
| 2087 | 2088 | } |
| 2088 | 2089 | |
| @@ -2094,7 +2095,8 @@ static void mld_dad_timer_expire(struct timer_list *t) · 5 unmodified lines | ||
| 2094 | 2095 | if (idev->mc_dad_count) { |
| 2095 | 2096 | idev->mc_dad_count--; |
| 2096 | 2097 | if (idev->mc_dad_count) |
| 2097 | − mld_dad_start_timer(idev, idev->mc_maxdelay); | |
| 2098 | + mld_dad_start_timer(idev, | |
| 2099 | + unsolicited_report_interval(idev)); | |
| 2098 | 2100 | } |
| 2099 | 2101 | in6_dev_put(idev); |
| 2100 | 2102 | } |
| @@ -2452,7 +2454,8 @@ static void mld_ifc_timer_expire(struct timer_list *t) · 351 unmodified lines | ||
| 2452 | 2454 | if (idev->mc_ifc_count) { |
| 2453 | 2455 | idev->mc_ifc_count--; |
| 2454 | 2456 | if (idev->mc_ifc_count) |
| 2455 | − mld_ifc_start_timer(idev, idev->mc_maxdelay); | |
| 2457 | + mld_ifc_start_timer(idev, | |
| 2458 | + unsolicited_report_interval(idev)); | |
| 2456 | 2459 | } |
| 2457 | 2460 | in6_dev_put(idev); |
| 2458 | 2461 | } |
| @@ -1334,7 +1334,7 @@ void raw6_proc_exit(void) · 1333 unmodified lines | ||
| 1334 | 1334 | } |
| 1335 | 1335 | #endif /* CONFIG_PROC_FS */ |
| 1336 | 1336 | |
| 1337 | −/* Same as inet6_dgram_ops, sans udp_poll_mask. */ | |
| 1337 | +/* Same as inet6_dgram_ops, sans udp_poll. */ | |
| 1338 | 1338 | const struct proto_ops inet6_sockraw_ops = { |
| 1339 | 1339 | .family = PF_INET6, |
| 1340 | 1340 | .owner = THIS_MODULE, |
| @@ -1344,7 +1344,7 @@ const struct proto_ops inet6_sockraw_ops = { · 3 unmodified lines | ||
| 1344 | 1344 | .socketpair = sock_no_socketpair, /* a do nothing */ |
| 1345 | 1345 | .accept = sock_no_accept, /* a do nothing */ |
| 1346 | 1346 | .getname = inet6_getname, |
| 1347 | − .poll_mask = datagram_poll_mask, /* ok */ | |
| 1347 | + .poll = datagram_poll, /* ok */ | |
| 1348 | 1348 | .ioctl = inet6_ioctl, /* must change */ |
| 1349 | 1349 | .listen = sock_no_listen, /* ok */ |
| 1350 | 1350 | .shutdown = inet_shutdown, /* ok */ |
| @@ -1488,11 +1488,14 @@ static inline __poll_t iucv_accept_poll(struct sock *parent) · 1487 unmodified lines | ||
| 1488 | 1488 | return 0; |
| 1489 | 1489 | } |
| 1490 | 1490 | |
| 1491 | −static __poll_t iucv_sock_poll_mask(struct socket *sock, __poll_t events) | |
| 1491 | +__poll_t iucv_sock_poll(struct file *file, struct socket *sock, | |
| 1492 | + poll_table *wait) | |
| 1492 | 1493 | { |
| 1493 | 1494 | struct sock *sk = sock->sk; |
| 1494 | 1495 | __poll_t mask = 0; |
| 1495 | 1496 | |
| 1497 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 1498 | + | |
| 1496 | 1499 | if (sk->sk_state == IUCV_LISTEN) |
| 1497 | 1500 | return iucv_accept_poll(sk); |
| 1498 | 1501 | |
| @@ -2385,7 +2388,7 @@ static const struct proto_ops iucv_sock_ops = { · 886 unmodified lines | ||
| 2385 | 2388 | .getname = iucv_sock_getname, |
| 2386 | 2389 | .sendmsg = iucv_sock_sendmsg, |
| 2387 | 2390 | .recvmsg = iucv_sock_recvmsg, |
| 2388 | − .poll_mask = iucv_sock_poll_mask, | |
| 2391 | + .poll = iucv_sock_poll, | |
| 2389 | 2392 | .ioctl = sock_no_ioctl, |
| 2390 | 2393 | .mmap = sock_no_mmap, |
| 2391 | 2394 | .socketpair = sock_no_socketpair, |
| @@ -1336,9 +1336,9 @@ static void init_kcm_sock(struct kcm_sock *kcm, struct kcm_mux *mux) · 1335 unmodified lines | ||
| 1336 | 1336 | struct list_head *head; |
| 1337 | 1337 | int index = 0; |
| 1338 | 1338 | |
| 1339 | − /* For SOCK_SEQPACKET sock type, datagram_poll_mask checks the sk_state, | |
| 1340 | − * so we set sk_state, otherwise epoll_wait always returns right away | |
| 1341 | − * with EPOLLHUP | |
| 1339 | + /* For SOCK_SEQPACKET sock type, datagram_poll checks the sk_state, so | |
| 1340 | + * we set sk_state, otherwise epoll_wait always returns right away with | |
| 1341 | + * EPOLLHUP | |
| 1342 | 1342 | */ |
| 1343 | 1343 | kcm->sk.sk_state = TCP_ESTABLISHED; |
| 1344 | 1344 | |
| @@ -1903,7 +1903,7 @@ static const struct proto_ops kcm_dgram_ops = { · 558 unmodified lines | ||
| 1903 | 1903 | .socketpair = sock_no_socketpair, |
| 1904 | 1904 | .accept = sock_no_accept, |
| 1905 | 1905 | .getname = sock_no_getname, |
| 1906 | − .poll_mask = datagram_poll_mask, | |
| 1906 | + .poll = datagram_poll, | |
| 1907 | 1907 | .ioctl = kcm_ioctl, |
| 1908 | 1908 | .listen = sock_no_listen, |
| 1909 | 1909 | .shutdown = sock_no_shutdown, |
| @@ -1924,7 +1924,7 @@ static const struct proto_ops kcm_seqpacket_ops = { · 14 unmodified lines | ||
| 1924 | 1924 | .socketpair = sock_no_socketpair, |
| 1925 | 1925 | .accept = sock_no_accept, |
| 1926 | 1926 | .getname = sock_no_getname, |
| 1927 | − .poll_mask = datagram_poll_mask, | |
| 1927 | + .poll = datagram_poll, | |
| 1928 | 1928 | .ioctl = kcm_ioctl, |
| 1929 | 1929 | .listen = sock_no_listen, |
| 1930 | 1930 | .shutdown = sock_no_shutdown, |
| @@ -3751,7 +3751,7 @@ static const struct proto_ops pfkey_ops = { · 3750 unmodified lines | ||
| 3751 | 3751 | |
| 3752 | 3752 | /* Now the operations that really occur. */ |
| 3753 | 3753 | .release = pfkey_release, |
| 3754 | − .poll_mask = datagram_poll_mask, | |
| 3754 | + .poll = datagram_poll, | |
| 3755 | 3755 | .sendmsg = pfkey_sendmsg, |
| 3756 | 3756 | .recvmsg = pfkey_recvmsg, |
| 3757 | 3757 | }; |
| @@ -613,7 +613,7 @@ static const struct proto_ops l2tp_ip_ops = { · 612 unmodified lines | ||
| 613 | 613 | .socketpair = sock_no_socketpair, |
| 614 | 614 | .accept = sock_no_accept, |
| 615 | 615 | .getname = l2tp_ip_getname, |
| 616 | − .poll_mask = datagram_poll_mask, | |
| 616 | + .poll = datagram_poll, | |
| 617 | 617 | .ioctl = inet_ioctl, |
| 618 | 618 | .listen = sock_no_listen, |
| 619 | 619 | .shutdown = inet_shutdown, |
| @@ -754,7 +754,7 @@ static const struct proto_ops l2tp_ip6_ops = { · 753 unmodified lines | ||
| 754 | 754 | .socketpair = sock_no_socketpair, |
| 755 | 755 | .accept = sock_no_accept, |
| 756 | 756 | .getname = l2tp_ip6_getname, |
| 757 | − .poll_mask = datagram_poll_mask, | |
| 757 | + .poll = datagram_poll, | |
| 758 | 758 | .ioctl = inet6_ioctl, |
| 759 | 759 | .listen = sock_no_listen, |
| 760 | 760 | .shutdown = inet_shutdown, |
| @@ -1818,7 +1818,7 @@ static const struct proto_ops pppol2tp_ops = { · 1817 unmodified lines | ||
| 1818 | 1818 | .socketpair = sock_no_socketpair, |
| 1819 | 1819 | .accept = sock_no_accept, |
| 1820 | 1820 | .getname = pppol2tp_getname, |
| 1821 | − .poll_mask = datagram_poll_mask, | |
| 1821 | + .poll = datagram_poll, | |
| 1822 | 1822 | .listen = sock_no_listen, |
| 1823 | 1823 | .shutdown = sock_no_shutdown, |
| 1824 | 1824 | .setsockopt = pppol2tp_setsockopt, |
| @@ -1192,7 +1192,7 @@ static const struct proto_ops llc_ui_ops = { · 1191 unmodified lines | ||
| 1192 | 1192 | .socketpair = sock_no_socketpair, |
| 1193 | 1193 | .accept = llc_ui_accept, |
| 1194 | 1194 | .getname = llc_ui_getname, |
| 1195 | − .poll_mask = datagram_poll_mask, | |
| 1195 | + .poll = datagram_poll, | |
| 1196 | 1196 | .ioctl = llc_ui_ioctl, |
| 1197 | 1197 | .listen = llc_ui_listen, |
| 1198 | 1198 | .shutdown = llc_ui_shutdown, |
| @@ -73,8 +73,8 @@ static int ncsi_aen_handler_lsc(struct ncsi_dev_priv *ndp, · 72 unmodified lines | ||
| 73 | 73 | ncm->data[2] = data; |
| 74 | 74 | ncm->data[4] = ntohl(lsc->oem_status); |
| 75 | 75 | |
| 76 | − netdev_info(ndp->ndev.dev, "NCSI: LSC AEN - channel %u state %s\n", | |
| 77 | − nc->id, data & 0x1 ? "up" : "down"); | |
| 76 | + netdev_dbg(ndp->ndev.dev, "NCSI: LSC AEN - channel %u state %s\n", | |
| 77 | + nc->id, data & 0x1 ? "up" : "down"); | |
| 78 | 78 | |
| 79 | 79 | chained = !list_empty(&nc->link); |
| 80 | 80 | state = nc->state; |
| @@ -148,9 +148,9 @@ static int ncsi_aen_handler_hncdsc(struct ncsi_dev_priv *ndp, · 67 unmodified lines | ||
| 148 | 148 | hncdsc = (struct ncsi_aen_hncdsc_pkt *)h; |
| 149 | 149 | ncm->data[3] = ntohl(hncdsc->status); |
| 150 | 150 | spin_unlock_irqrestore(&nc->lock, flags); |
| 151 | − netdev_printk(KERN_DEBUG, ndp->ndev.dev, | |
| 152 | − "NCSI: host driver %srunning on channel %u\n", | |
| 153 | − ncm->data[3] & 0x1 ? "" : "not ", nc->id); | |
| 151 | + netdev_dbg(ndp->ndev.dev, | |
| 152 | + "NCSI: host driver %srunning on channel %u\n", | |
| 153 | + ncm->data[3] & 0x1 ? "" : "not ", nc->id); | |
| 154 | 154 | |
| 155 | 155 | return 0; |
| 156 | 156 | } |
| @@ -788,8 +788,8 @@ static void ncsi_configure_channel(struct ncsi_dev_priv *ndp) · 787 unmodified lines | ||
| 788 | 788 | } |
| 789 | 789 | break; |
| 790 | 790 | case ncsi_dev_state_config_done: |
| 791 | − netdev_printk(KERN_DEBUG, ndp->ndev.dev, | |
| 792 | − "NCSI: channel %u config done\n", nc->id); | |
| 791 | + netdev_dbg(ndp->ndev.dev, "NCSI: channel %u config done\n", | |
| 792 | + nc->id); | |
| 793 | 793 | spin_lock_irqsave(&nc->lock, flags); |
| 794 | 794 | if (nc->reconfigure_needed) { |
| 795 | 795 | /* This channel's configuration has been updated |
| @@ -804,8 +804,7 @@ static void ncsi_configure_channel(struct ncsi_dev_priv *ndp) · 8 unmodified lines | ||
| 804 | 804 | list_add_tail_rcu(&nc->link, &ndp->channel_queue); |
| 805 | 805 | spin_unlock_irqrestore(&ndp->lock, flags); |
| 806 | 806 | |
| 807 | − netdev_printk(KERN_DEBUG, dev, | |
| 808 | − "Dirty NCSI channel state reset\n"); | |
| 807 | + netdev_dbg(dev, "Dirty NCSI channel state reset\n"); | |
| 809 | 808 | ncsi_process_next_channel(ndp); |
| 810 | 809 | break; |
| 811 | 810 | } |
| @@ -816,9 +815,9 @@ static void ncsi_configure_channel(struct ncsi_dev_priv *ndp) · 4 unmodified lines | ||
| 816 | 815 | } else { |
| 817 | 816 | hot_nc = NULL; |
| 818 | 817 | nc->state = NCSI_CHANNEL_INACTIVE; |
| 819 | − netdev_warn(ndp->ndev.dev, | |
| 820 | − "NCSI: channel %u link down after config\n", | |
| 821 | − nc->id); | |
| 818 | + netdev_dbg(ndp->ndev.dev, | |
| 819 | + "NCSI: channel %u link down after config\n", | |
| 820 | + nc->id); | |
| 822 | 821 | } |
| 823 | 822 | spin_unlock_irqrestore(&nc->lock, flags); |
| 824 | 823 | |
| @@ -908,9 +907,9 @@ static int ncsi_choose_active_channel(struct ncsi_dev_priv *ndp) · 83 unmodified lines | ||
| 908 | 907 | } |
| 909 | 908 | |
| 910 | 909 | ncm = &found->modes[NCSI_MODE_LINK]; |
| 911 | − netdev_printk(KERN_DEBUG, ndp->ndev.dev, | |
| 912 | − "NCSI: Channel %u added to queue (link %s)\n", | |
| 913 | − found->id, ncm->data[2] & 0x1 ? "up" : "down"); | |
| 910 | + netdev_dbg(ndp->ndev.dev, | |
| 911 | + "NCSI: Channel %u added to queue (link %s)\n", | |
| 912 | + found->id, ncm->data[2] & 0x1 ? "up" : "down"); | |
| 914 | 913 | |
| 915 | 914 | out: |
| 916 | 915 | spin_lock_irqsave(&ndp->lock, flags); |
| @@ -1199,14 +1198,14 @@ int ncsi_process_next_channel(struct ncsi_dev_priv *ndp) · 282 unmodified lines | ||
| 1199 | 1198 | switch (old_state) { |
| 1200 | 1199 | case NCSI_CHANNEL_INACTIVE: |
| 1201 | 1200 | ndp->ndev.state = ncsi_dev_state_config; |
| 1202 | − netdev_info(ndp->ndev.dev, "NCSI: configuring channel %u\n", | |
| 1203 | − nc->id); | |
| 1201 | + netdev_dbg(ndp->ndev.dev, "NCSI: configuring channel %u\n", | |
| 1202 | + nc->id); | |
| 1204 | 1203 | ncsi_configure_channel(ndp); |
| 1205 | 1204 | break; |
| 1206 | 1205 | case NCSI_CHANNEL_ACTIVE: |
| 1207 | 1206 | ndp->ndev.state = ncsi_dev_state_suspend; |
| 1208 | − netdev_info(ndp->ndev.dev, "NCSI: suspending channel %u\n", | |
| 1209 | − nc->id); | |
| 1207 | + netdev_dbg(ndp->ndev.dev, "NCSI: suspending channel %u\n", | |
| 1208 | + nc->id); | |
| 1210 | 1209 | ncsi_suspend_channel(ndp); |
| 1211 | 1210 | break; |
| 1212 | 1211 | default: |
| @@ -1226,8 +1225,6 @@ out: · 13 unmodified lines | ||
| 1226 | 1225 | return ncsi_choose_active_channel(ndp); |
| 1227 | 1226 | } |
| 1228 | 1227 | |
| 1229 | − netdev_printk(KERN_DEBUG, ndp->ndev.dev, | |
| 1230 | − "NCSI: No more channels to process\n"); | |
| 1231 | 1228 | ncsi_report_link(ndp, false); |
| 1232 | 1229 | return -ENODEV; |
| 1233 | 1230 | } |
| @@ -1318,9 +1315,9 @@ static int ncsi_kick_channels(struct ncsi_dev_priv *ndp) · 84 unmodified lines | ||
| 1318 | 1315 | if ((ndp->ndev.state & 0xff00) == |
| 1319 | 1316 | ncsi_dev_state_config || |
| 1320 | 1317 | !list_empty(&nc->link)) { |
| 1321 | − netdev_printk(KERN_DEBUG, nd->dev, | |
| 1322 | − "NCSI: channel %p marked dirty\n", | |
| 1323 | − nc); | |
| 1318 | + netdev_dbg(nd->dev, | |
| 1319 | + "NCSI: channel %p marked dirty\n", | |
| 1320 | + nc); | |
| 1324 | 1321 | nc->reconfigure_needed = true; |
| 1325 | 1322 | } |
| 1326 | 1323 | spin_unlock_irqrestore(&nc->lock, flags); |
| @@ -1338,8 +1335,7 @@ static int ncsi_kick_channels(struct ncsi_dev_priv *ndp) · 11 unmodified lines | ||
| 1338 | 1335 | list_add_tail_rcu(&nc->link, &ndp->channel_queue); |
| 1339 | 1336 | spin_unlock_irqrestore(&ndp->lock, flags); |
| 1340 | 1337 | |
| 1341 | − netdev_printk(KERN_DEBUG, nd->dev, | |
| 1342 | − "NCSI: kicked channel %p\n", nc); | |
| 1338 | + netdev_dbg(nd->dev, "NCSI: kicked channel %p\n", nc); | |
| 1343 | 1339 | n++; |
| 1344 | 1340 | } |
| 1345 | 1341 | } |
| @@ -1370,8 +1366,8 @@ int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) · 24 unmodified lines | ||
| 1370 | 1366 | list_for_each_entry_rcu(vlan, &ndp->vlan_vids, list) { |
| 1371 | 1367 | n_vids++; |
| 1372 | 1368 | if (vlan->vid == vid) { |
| 1373 | − netdev_printk(KERN_DEBUG, dev, | |
| 1374 | − "NCSI: vid %u already registered\n", vid); | |
| 1369 | + netdev_dbg(dev, "NCSI: vid %u already registered\n", | |
| 1370 | + vid); | |
| 1375 | 1371 | return 0; |
| 1376 | 1372 | } |
| 1377 | 1373 | } |
| @@ -1390,7 +1386,7 @@ int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) · 12 unmodified lines | ||
| 1390 | 1386 | vlan->vid = vid; |
| 1391 | 1387 | list_add_rcu(&vlan->list, &ndp->vlan_vids); |
| 1392 | 1388 | |
| 1393 | − netdev_printk(KERN_DEBUG, dev, "NCSI: Added new vid %u\n", vid); | |
| 1389 | + netdev_dbg(dev, "NCSI: Added new vid %u\n", vid); | |
| 1394 | 1390 | |
| 1395 | 1391 | found = ncsi_kick_channels(ndp) != 0; |
| 1396 | 1392 | |
| @@ -1419,8 +1415,7 @@ int ncsi_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid) · 22 unmodified lines | ||
| 1419 | 1415 | /* Remove the VLAN id from our internal list */ |
| 1420 | 1416 | list_for_each_entry_safe(vlan, tmp, &ndp->vlan_vids, list) |
| 1421 | 1417 | if (vlan->vid == vid) { |
| 1422 | − netdev_printk(KERN_DEBUG, dev, | |
| 1423 | − "NCSI: vid %u found, removing\n", vid); | |
| 1418 | + netdev_dbg(dev, "NCSI: vid %u found, removing\n", vid); | |
| 1424 | 1419 | list_del_rcu(&vlan->list); |
| 1425 | 1420 | found = true; |
| 1426 | 1421 | kfree(vlan); |
| @@ -1547,7 +1542,7 @@ void ncsi_stop_dev(struct ncsi_dev *nd) · 120 unmodified lines | ||
| 1547 | 1542 | } |
| 1548 | 1543 | } |
| 1549 | 1544 | |
| 1550 | − netdev_printk(KERN_DEBUG, ndp->ndev.dev, "NCSI: Stopping device\n"); | |
| 1545 | + netdev_dbg(ndp->ndev.dev, "NCSI: Stopping device\n"); | |
| 1551 | 1546 | ncsi_report_link(ndp, true); |
| 1552 | 1547 | } |
| 1553 | 1548 | EXPORT_SYMBOL_GPL(ncsi_stop_dev); |
| @@ -2658,7 +2658,7 @@ static const struct proto_ops netlink_ops = { · 2657 unmodified lines | ||
| 2658 | 2658 | .socketpair = sock_no_socketpair, |
| 2659 | 2659 | .accept = sock_no_accept, |
| 2660 | 2660 | .getname = netlink_getname, |
| 2661 | − .poll_mask = datagram_poll_mask, | |
| 2661 | + .poll = datagram_poll, | |
| 2662 | 2662 | .ioctl = netlink_ioctl, |
| 2663 | 2663 | .listen = sock_no_listen, |
| 2664 | 2664 | .shutdown = sock_no_shutdown, |
| @@ -1355,7 +1355,7 @@ static const struct proto_ops nr_proto_ops = { · 1354 unmodified lines | ||
| 1355 | 1355 | .socketpair = sock_no_socketpair, |
| 1356 | 1356 | .accept = nr_accept, |
| 1357 | 1357 | .getname = nr_getname, |
| 1358 | − .poll_mask = datagram_poll_mask, | |
| 1358 | + .poll = datagram_poll, | |
| 1359 | 1359 | .ioctl = nr_ioctl, |
| 1360 | 1360 | .listen = nr_listen, |
| 1361 | 1361 | .shutdown = sock_no_shutdown, |
| @@ -548,13 +548,16 @@ static inline __poll_t llcp_accept_poll(struct sock *parent) · 547 unmodified lines | ||
| 548 | 548 | return 0; |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | −static __poll_t llcp_sock_poll_mask(struct socket *sock, __poll_t events) | |
| 551 | +static __poll_t llcp_sock_poll(struct file *file, struct socket *sock, | |
| 552 | + poll_table *wait) | |
| 552 | 553 | { |
| 553 | 554 | struct sock *sk = sock->sk; |
| 554 | 555 | __poll_t mask = 0; |
| 555 | 556 | |
| 556 | 557 | pr_debug("%p\n", sk); |
| 557 | 558 | |
| 559 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 560 | + | |
| 558 | 561 | if (sk->sk_state == LLCP_LISTEN) |
| 559 | 562 | return llcp_accept_poll(sk); |
| 560 | 563 | |
| @@ -896,7 +899,7 @@ static const struct proto_ops llcp_sock_ops = { · 335 unmodified lines | ||
| 896 | 899 | .socketpair = sock_no_socketpair, |
| 897 | 900 | .accept = llcp_sock_accept, |
| 898 | 901 | .getname = llcp_sock_getname, |
| 899 | − .poll_mask = llcp_sock_poll_mask, | |
| 902 | + .poll = llcp_sock_poll, | |
| 900 | 903 | .ioctl = sock_no_ioctl, |
| 901 | 904 | .listen = llcp_sock_listen, |
| 902 | 905 | .shutdown = sock_no_shutdown, |
| @@ -916,7 +919,7 @@ static const struct proto_ops llcp_rawsock_ops = { · 13 unmodified lines | ||
| 916 | 919 | .socketpair = sock_no_socketpair, |
| 917 | 920 | .accept = sock_no_accept, |
| 918 | 921 | .getname = llcp_sock_getname, |
| 919 | − .poll_mask = llcp_sock_poll_mask, | |
| 922 | + .poll = llcp_sock_poll, | |
| 920 | 923 | .ioctl = sock_no_ioctl, |
| 921 | 924 | .listen = sock_no_listen, |
| 922 | 925 | .shutdown = sock_no_shutdown, |
| @@ -284,7 +284,7 @@ static const struct proto_ops rawsock_ops = { · 283 unmodified lines | ||
| 284 | 284 | .socketpair = sock_no_socketpair, |
| 285 | 285 | .accept = sock_no_accept, |
| 286 | 286 | .getname = sock_no_getname, |
| 287 | − .poll_mask = datagram_poll_mask, | |
| 287 | + .poll = datagram_poll, | |
| 288 | 288 | .ioctl = sock_no_ioctl, |
| 289 | 289 | .listen = sock_no_listen, |
| 290 | 290 | .shutdown = sock_no_shutdown, |
| @@ -304,7 +304,7 @@ static const struct proto_ops rawsock_raw_ops = { · 13 unmodified lines | ||
| 304 | 304 | .socketpair = sock_no_socketpair, |
| 305 | 305 | .accept = sock_no_accept, |
| 306 | 306 | .getname = sock_no_getname, |
| 307 | − .poll_mask = datagram_poll_mask, | |
| 307 | + .poll = datagram_poll, | |
| 308 | 308 | .ioctl = sock_no_ioctl, |
| 309 | 309 | .listen = sock_no_listen, |
| 310 | 310 | .shutdown = sock_no_shutdown, |
| @@ -2262,6 +2262,13 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, · 2261 unmodified lines | ||
| 2262 | 2262 | if (po->stats.stats1.tp_drops) |
| 2263 | 2263 | status |= TP_STATUS_LOSING; |
| 2264 | 2264 | } |
| 2265 | + | |
| 2266 | + if (do_vnet && | |
| 2267 | + virtio_net_hdr_from_skb(skb, h.raw + macoff - | |
| 2268 | + sizeof(struct virtio_net_hdr), | |
| 2269 | + vio_le(), true, 0)) | |
| 2270 | + goto drop_n_account; | |
| 2271 | + | |
| 2265 | 2272 | po->stats.stats1.tp_packets++; |
| 2266 | 2273 | if (copy_skb) { |
| 2267 | 2274 | status |= TP_STATUS_COPY; |
| @@ -2269,15 +2276,6 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, · 1 unmodified line | ||
| 2269 | 2276 | } |
| 2270 | 2277 | spin_unlock(&sk->sk_receive_queue.lock); |
| 2271 | 2278 | |
| 2272 | − if (do_vnet) { | |
| 2273 | − if (virtio_net_hdr_from_skb(skb, h.raw + macoff - | |
| 2274 | − sizeof(struct virtio_net_hdr), | |
| 2275 | − vio_le(), true, 0)) { | |
| 2276 | − spin_lock(&sk->sk_receive_queue.lock); | |
| 2277 | − goto drop_n_account; | |
| 2278 | − } | |
| 2279 | − } | |
| 2280 | − | |
| 2281 | 2279 | skb_copy_bits(skb, 0, h.raw + macoff, snaplen); |
| 2282 | 2280 | |
| 2283 | 2281 | if (!(ts_status = tpacket_get_timestamp(skb, &ts, po->tp_tstamp))) |
| @@ -4078,11 +4076,12 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd, · 1794 unmodified lines | ||
| 4078 | 4076 | return 0; |
| 4079 | 4077 | } |
| 4080 | 4078 | |
| 4081 | −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) | |
| 4082 | 4081 | { |
| 4083 | 4082 | struct sock *sk = sock->sk; |
| 4084 | 4083 | struct packet_sock *po = pkt_sk(sk); |
| 4085 | − __poll_t mask = datagram_poll_mask(sock, events); | |
| 4084 | + __poll_t mask = datagram_poll(file, sock, wait); | |
| 4086 | 4085 | |
| 4087 | 4086 | spin_lock_bh(&sk->sk_receive_queue.lock); |
| 4088 | 4087 | if (po->rx_ring.pg_vec) { |
| @@ -4424,7 +4423,7 @@ static const struct proto_ops packet_ops_spkt = { · 335 unmodified lines | ||
| 4424 | 4423 | .socketpair = sock_no_socketpair, |
| 4425 | 4424 | .accept = sock_no_accept, |
| 4426 | 4425 | .getname = packet_getname_spkt, |
| 4427 | − .poll_mask = datagram_poll_mask, | |
| 4426 | + .poll = datagram_poll, | |
| 4428 | 4427 | .ioctl = packet_ioctl, |
| 4429 | 4428 | .listen = sock_no_listen, |
| 4430 | 4429 | .shutdown = sock_no_shutdown, |
| @@ -4445,7 +4444,7 @@ static const struct proto_ops packet_ops = { · 14 unmodified lines | ||
| 4445 | 4444 | .socketpair = sock_no_socketpair, |
| 4446 | 4445 | .accept = sock_no_accept, |
| 4447 | 4446 | .getname = packet_getname, |
| 4448 | − .poll_mask = packet_poll_mask, | |
| 4447 | + .poll = packet_poll, | |
| 4449 | 4448 | .ioctl = packet_ioctl, |
| 4450 | 4449 | .listen = sock_no_listen, |
| 4451 | 4450 | .shutdown = sock_no_shutdown, |
| @@ -340,12 +340,15 @@ static int pn_socket_getname(struct socket *sock, struct sockaddr *addr, · 339 unmodified lines | ||
| 340 | 340 | return sizeof(struct sockaddr_pn); |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | −static __poll_t pn_socket_poll_mask(struct socket *sock, __poll_t events) | |
| 343 | +static __poll_t pn_socket_poll(struct file *file, struct socket *sock, | |
| 344 | + poll_table *wait) | |
| 344 | 345 | { |
| 345 | 346 | struct sock *sk = sock->sk; |
| 346 | 347 | struct pep_sock *pn = pep_sk(sk); |
| 347 | 348 | __poll_t mask = 0; |
| 348 | 349 | |
| 350 | + poll_wait(file, sk_sleep(sk), wait); | |
| 351 | + | |
| 349 | 352 | if (sk->sk_state == TCP_CLOSE) |
| 350 | 353 | return EPOLLERR; |
| 351 | 354 | if (!skb_queue_empty(&sk->sk_receive_queue)) |
| @@ -445,7 +448,7 @@ const struct proto_ops phonet_dgram_ops = { · 93 unmodified lines | ||
| 445 | 448 | .socketpair = sock_no_socketpair, |
| 446 | 449 | .accept = sock_no_accept, |
| 447 | 450 | .getname = pn_socket_getname, |
| 448 | − .poll_mask = datagram_poll_mask, | |
| 451 | + .poll = datagram_poll, | |
| 449 | 452 | .ioctl = pn_socket_ioctl, |
| 450 | 453 | .listen = sock_no_listen, |
| 451 | 454 | .shutdown = sock_no_shutdown, |
| @@ -470,7 +473,7 @@ const struct proto_ops phonet_stream_ops = { · 18 unmodified lines | ||
| 470 | 473 | .socketpair = sock_no_socketpair, |
| 471 | 474 | .accept = pn_socket_accept, |
| 472 | 475 | .getname = pn_socket_getname, |
| 473 | − .poll_mask = pn_socket_poll_mask, | |
| 476 | + .poll = pn_socket_poll, | |
| 474 | 477 | .ioctl = pn_socket_ioctl, |
| 475 | 478 | .listen = pn_socket_listen, |
| 476 | 479 | .shutdown = sock_no_shutdown, |
| @@ -1023,7 +1023,7 @@ static const struct proto_ops qrtr_proto_ops = { · 1022 unmodified lines | ||
| 1023 | 1023 | .recvmsg = qrtr_recvmsg, |
| 1024 | 1024 | .getname = qrtr_getname, |
| 1025 | 1025 | .ioctl = qrtr_ioctl, |
| 1026 | − .poll_mask = datagram_poll_mask, | |
| 1026 | + .poll = datagram_poll, | |
| 1027 | 1027 | .shutdown = sock_no_shutdown, |
| 1028 | 1028 | .setsockopt = sock_no_setsockopt, |
| 1029 | 1029 | .getsockopt = sock_no_getsockopt, |
| @@ -1470,7 +1470,7 @@ static const struct proto_ops rose_proto_ops = { · 1469 unmodified lines | ||
| 1470 | 1470 | .socketpair = sock_no_socketpair, |
| 1471 | 1471 | .accept = rose_accept, |
| 1472 | 1472 | .getname = rose_getname, |
| 1473 | − .poll_mask = datagram_poll_mask, | |
| 1473 | + .poll = datagram_poll, | |
| 1474 | 1474 | .ioctl = rose_ioctl, |
| 1475 | 1475 | .listen = rose_listen, |
| 1476 | 1476 | .shutdown = sock_no_shutdown, |
| @@ -734,11 +734,15 @@ static int rxrpc_getsockopt(struct socket *sock, int level, int optname, · 733 unmodified lines | ||
| 734 | 734 | /* |
| 735 | 735 | * permit an RxRPC socket to be polled |
| 736 | 736 | */ |
| 737 | −static __poll_t rxrpc_poll_mask(struct socket *sock, __poll_t events) | |
| 737 | +static __poll_t rxrpc_poll(struct file *file, struct socket *sock, | |
| 738 | + poll_table *wait) | |
| 738 | 739 | { |
| 739 | 740 | struct sock *sk = sock->sk; |
| 740 | 741 | struct rxrpc_sock *rx = rxrpc_sk(sk); |
| 741 | − __poll_t mask = 0; | |
| 742 | + __poll_t mask; | |
| 743 | + | |
| 744 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 745 | + mask = 0; | |
| 742 | 746 | |
| 743 | 747 | /* the socket is readable if there are any messages waiting on the Rx |
| 744 | 748 | * queue */ |
| @@ -945,7 +949,7 @@ static const struct proto_ops rxrpc_rpc_ops = { · 200 unmodified lines | ||
| 945 | 949 | .socketpair = sock_no_socketpair, |
| 946 | 950 | .accept = sock_no_accept, |
| 947 | 951 | .getname = sock_no_getname, |
| 948 | − .poll_mask = rxrpc_poll_mask, | |
| 952 | + .poll = rxrpc_poll, | |
| 949 | 953 | .ioctl = sock_no_ioctl, |
| 950 | 954 | .listen = rxrpc_listen, |
| 951 | 955 | .shutdown = rxrpc_shutdown, |
| @@ -415,7 +415,8 @@ static void tcf_ife_cleanup(struct tc_action *a) · 414 unmodified lines | ||
| 415 | 415 | spin_unlock_bh(&ife->tcf_lock); |
| 416 | 416 | |
| 417 | 417 | p = rcu_dereference_protected(ife->params, 1); |
| 418 | − kfree_rcu(p, rcu); | |
| 418 | + if (p) | |
| 419 | + kfree_rcu(p, rcu); | |
| 419 | 420 | } |
| 420 | 421 | |
| 421 | 422 | /* under ife->tcf_lock for existing action */ |
| @@ -516,8 +517,6 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, · 94 unmodified lines | ||
| 516 | 517 | saddr = nla_data(tb[TCA_IFE_SMAC]); |
| 517 | 518 | } |
| 518 | 519 | |
| 519 | − ife->tcf_action = parm->action; | |
| 520 | − | |
| 521 | 520 | if (parm->flags & IFE_ENCODE) { |
| 522 | 521 | if (daddr) |
| 523 | 522 | ether_addr_copy(p->eth_dst, daddr); |
| @@ -543,10 +542,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, · 19 unmodified lines | ||
| 543 | 542 | NULL, NULL); |
| 544 | 543 | if (err) { |
| 545 | 544 | metadata_parse_err: |
| 546 | − if (exists) | |
| 547 | − tcf_idr_release(*a, bind); | |
| 548 | 545 | if (ret == ACT_P_CREATED) |
| 549 | − _tcf_ife_cleanup(*a); | |
| 546 | + tcf_idr_release(*a, bind); | |
| 550 | 547 | |
| 551 | 548 | if (exists) |
| 552 | 549 | spin_unlock_bh(&ife->tcf_lock); |
| @@ -567,7 +564,7 @@ metadata_parse_err: · 14 unmodified lines | ||
| 567 | 564 | err = use_all_metadata(ife); |
| 568 | 565 | if (err) { |
| 569 | 566 | if (ret == ACT_P_CREATED) |
| 570 | − _tcf_ife_cleanup(*a); | |
| 567 | + tcf_idr_release(*a, bind); | |
| 571 | 568 | |
| 572 | 569 | if (exists) |
| 573 | 570 | spin_unlock_bh(&ife->tcf_lock); |
| @@ -576,6 +573,7 @@ metadata_parse_err: · 2 unmodified lines | ||
| 576 | 573 | } |
| 577 | 574 | } |
| 578 | 575 | |
| 576 | + ife->tcf_action = parm->action; | |
| 579 | 577 | if (exists) |
| 580 | 578 | spin_unlock_bh(&ife->tcf_lock); |
| 581 | 579 | |
| @@ -66,7 +66,7 @@ struct fl_flow_mask { · 65 unmodified lines | ||
| 66 | 66 | struct rhashtable_params filter_ht_params; |
| 67 | 67 | struct flow_dissector dissector; |
| 68 | 68 | struct list_head filters; |
| 69 | − struct rcu_head rcu; | |
| 69 | + struct rcu_work rwork; | |
| 70 | 70 | struct list_head list; |
| 71 | 71 | }; |
| 72 | 72 | |
| @@ -203,6 +203,20 @@ static int fl_init(struct tcf_proto *tp) · 130 unmodified lines | ||
| 203 | 203 | return rhashtable_init(&head->ht, &mask_ht_params); |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | +static void fl_mask_free(struct fl_flow_mask *mask) | |
| 207 | +{ | |
| 208 | + rhashtable_destroy(&mask->ht); | |
| 209 | + kfree(mask); | |
| 210 | +} | |
| 211 | + | |
| 212 | +static void fl_mask_free_work(struct work_struct *work) | |
| 213 | +{ | |
| 214 | + struct fl_flow_mask *mask = container_of(to_rcu_work(work), | |
| 215 | + struct fl_flow_mask, rwork); | |
| 216 | + | |
| 217 | + fl_mask_free(mask); | |
| 218 | +} | |
| 219 | + | |
| 206 | 220 | static bool fl_mask_put(struct cls_fl_head *head, struct fl_flow_mask *mask, |
| 207 | 221 | bool async) |
| 208 | 222 | { |
| @@ -210,12 +224,11 @@ static bool fl_mask_put(struct cls_fl_head *head, struct fl_flow_mask *mask, · 1 unmodified line | ||
| 210 | 224 | return false; |
| 211 | 225 | |
| 212 | 226 | rhashtable_remove_fast(&head->ht, &mask->ht_node, mask_ht_params); |
| 213 | − rhashtable_destroy(&mask->ht); | |
| 214 | 227 | list_del_rcu(&mask->list); |
| 215 | 228 | if (async) |
| 216 | − kfree_rcu(mask, rcu); | |
| 229 | + tcf_queue_work(&mask->rwork, fl_mask_free_work); | |
| 217 | 230 | else |
| 218 | − kfree(mask); | |
| 231 | + fl_mask_free(mask); | |
| 219 | 232 | |
| 220 | 233 | return true; |
| 221 | 234 | } |
| @@ -21,7 +21,7 @@ static int blackhole_enqueue(struct sk_buff *skb, struct Qdisc *sch, · 20 unmodified lines | ||
| 21 | 21 | struct sk_buff **to_free) |
| 22 | 22 | { |
| 23 | 23 | qdisc_drop(skb, sch, to_free); |
| 24 | − return NET_XMIT_SUCCESS; | |
| 24 | + return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | static struct sk_buff *blackhole_dequeue(struct Qdisc *sch) |
| @@ -1385,8 +1385,8 @@ hfsc_schedule_watchdog(struct Qdisc *sch) · 1384 unmodified lines | ||
| 1385 | 1385 | if (next_time == 0 || next_time > q->root.cl_cfmin) |
| 1386 | 1386 | next_time = q->root.cl_cfmin; |
| 1387 | 1387 | } |
| 1388 | − WARN_ON(next_time == 0); | |
| 1389 | − qdisc_watchdog_schedule(&q->watchdog, next_time); | |
| 1388 | + if (next_time) | |
| 1389 | + qdisc_watchdog_schedule(&q->watchdog, next_time); | |
| 1390 | 1390 | } |
| 1391 | 1391 | |
| 1392 | 1392 | static int |
| @@ -237,7 +237,9 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, · 236 unmodified lines | ||
| 237 | 237 | /* Account for a different sized first fragment */ |
| 238 | 238 | if (msg_len >= first_len) { |
| 239 | 239 | msg->can_delay = 0; |
| 240 | − SCTP_INC_STATS(sock_net(asoc->base.sk), SCTP_MIB_FRAGUSRMSGS); | |
| 240 | + if (msg_len > first_len) | |
| 241 | + SCTP_INC_STATS(sock_net(asoc->base.sk), | |
| 242 | + SCTP_MIB_FRAGUSRMSGS); | |
| 241 | 243 | } else { |
| 242 | 244 | /* Which may be the only one... */ |
| 243 | 245 | first_len = msg_len; |
| @@ -1010,7 +1010,7 @@ static const struct proto_ops inet6_seqpacket_ops = { · 1009 unmodified lines | ||
| 1010 | 1010 | .socketpair = sock_no_socketpair, |
| 1011 | 1011 | .accept = inet_accept, |
| 1012 | 1012 | .getname = sctp_getname, |
| 1013 | − .poll_mask = sctp_poll_mask, | |
| 1013 | + .poll = sctp_poll, | |
| 1014 | 1014 | .ioctl = inet6_ioctl, |
| 1015 | 1015 | .listen = sctp_inet_listen, |
| 1016 | 1016 | .shutdown = inet_shutdown, |
| @@ -1016,7 +1016,7 @@ static const struct proto_ops inet_seqpacket_ops = { · 1015 unmodified lines | ||
| 1016 | 1016 | .socketpair = sock_no_socketpair, |
| 1017 | 1017 | .accept = inet_accept, |
| 1018 | 1018 | .getname = inet_getname, /* Semantics are different. */ |
| 1019 | − .poll_mask = sctp_poll_mask, | |
| 1019 | + .poll = sctp_poll, | |
| 1020 | 1020 | .ioctl = inet_ioctl, |
| 1021 | 1021 | .listen = sctp_inet_listen, |
| 1022 | 1022 | .shutdown = inet_shutdown, /* Looks harmless. */ |
| @@ -7717,12 +7717,14 @@ out: · 7716 unmodified lines | ||
| 7717 | 7717 | * here, again, by modeling the current TCP/UDP code. We don't have |
| 7718 | 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 | 7722 | struct sock *sk = sock->sk; |
| 7723 | 7723 | struct sctp_sock *sp = sctp_sk(sk); |
| 7724 | 7724 | __poll_t mask; |
| 7725 | 7725 | |
| 7726 | + poll_wait(file, sk_sleep(sk), wait); | |
| 7727 | + | |
| 7726 | 7728 | sock_rps_record_flow(sk); |
| 7727 | 7729 | |
| 7728 | 7730 | /* A TCP-style listening socket becomes readable when the accept queue |
| @@ -1273,7 +1273,8 @@ static __poll_t smc_accept_poll(struct sock *parent) · 1272 unmodified lines | ||
| 1273 | 1273 | return mask; |
| 1274 | 1274 | } |
| 1275 | 1275 | |
| 1276 | −static __poll_t smc_poll_mask(struct socket *sock, __poll_t events) | |
| 1276 | +static __poll_t smc_poll(struct file *file, struct socket *sock, | |
| 1277 | + poll_table *wait) | |
| 1277 | 1278 | { |
| 1278 | 1279 | struct sock *sk = sock->sk; |
| 1279 | 1280 | __poll_t mask = 0; |
| @@ -1289,7 +1290,7 @@ static __poll_t smc_poll_mask(struct socket *sock, __poll_t events) · 9 unmodified lines | ||
| 1289 | 1290 | if ((sk->sk_state == SMC_INIT) || smc->use_fallback) { |
| 1290 | 1291 | /* delegate to CLC child sock */ |
| 1291 | 1292 | release_sock(sk); |
| 1292 | − mask = smc->clcsock->ops->poll_mask(smc->clcsock, events); | |
| 1293 | + mask = smc->clcsock->ops->poll(file, smc->clcsock, wait); | |
| 1293 | 1294 | lock_sock(sk); |
| 1294 | 1295 | sk->sk_err = smc->clcsock->sk->sk_err; |
| 1295 | 1296 | if (sk->sk_err) { |
| @@ -1307,6 +1308,11 @@ static __poll_t smc_poll_mask(struct socket *sock, __poll_t events) · 11 unmodified lines | ||
| 1307 | 1308 | } |
| 1308 | 1309 | } |
| 1309 | 1310 | } else { |
| 1311 | + if (sk->sk_state != SMC_CLOSED) { | |
| 1312 | + release_sock(sk); | |
| 1313 | + sock_poll_wait(file, sk_sleep(sk), wait); | |
| 1314 | + lock_sock(sk); | |
| 1315 | + } | |
| 1310 | 1316 | if (sk->sk_err) |
| 1311 | 1317 | mask |= EPOLLERR; |
| 1312 | 1318 | if ((sk->sk_shutdown == SHUTDOWN_MASK) || |
| @@ -1619,7 +1625,7 @@ static const struct proto_ops smc_sock_ops = { · 306 unmodified lines | ||
| 1619 | 1625 | .socketpair = sock_no_socketpair, |
| 1620 | 1626 | .accept = smc_accept, |
| 1621 | 1627 | .getname = smc_getname, |
| 1622 | − .poll_mask = smc_poll_mask, | |
| 1628 | + .poll = smc_poll, | |
| 1623 | 1629 | .ioctl = smc_ioctl, |
| 1624 | 1630 | .listen = smc_listen, |
| 1625 | 1631 | .shutdown = smc_shutdown, |
| @@ -117,10 +117,8 @@ static ssize_t sock_write_iter(struct kiocb *iocb, struct iov_iter *from); · 116 unmodified lines | ||
| 117 | 117 | static int sock_mmap(struct file *file, struct vm_area_struct *vma); |
| 118 | 118 | |
| 119 | 119 | static int sock_close(struct inode *inode, struct file *file); |
| 120 | −static struct wait_queue_head *sock_get_poll_head(struct file *file, | |
71 more lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 56 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 83 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 142 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 165 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 63 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 84 lines aren’t shown here.
This diff is large: its 175 lines aren’t shown here.
This diff is large: its 78 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 138 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 431 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 5 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 726 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
File mode changed from 100644 to 100755.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 5 lines aren’t shown here.
This diff is large: its 64 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 84 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.