diff options
699 files changed, 6355 insertions, 3495 deletions
| @@ -3554,12 +3554,12 @@ E: cvance@nai.com | |||
| 3554 | D: portions of the Linux Security Module (LSM) framework and security modules | 3554 | D: portions of the Linux Security Module (LSM) framework and security modules |
| 3555 | 3555 | ||
| 3556 | N: Petr Vandrovec | 3556 | N: Petr Vandrovec |
| 3557 | E: vandrove@vc.cvut.cz | 3557 | E: petr@vandrovec.name |
| 3558 | D: Small contributions to ncpfs | 3558 | D: Small contributions to ncpfs |
| 3559 | D: Matrox framebuffer driver | 3559 | D: Matrox framebuffer driver |
| 3560 | S: Chudenicka 8 | 3560 | S: 21513 Conradia Ct |
| 3561 | S: 10200 Prague 10, Hostivar | 3561 | S: Cupertino, CA 95014 |
| 3562 | S: Czech Republic | 3562 | S: USA |
| 3563 | 3563 | ||
| 3564 | N: Thibaut Varene | 3564 | N: Thibaut Varene |
| 3565 | E: T-Bone@parisc-linux.org | 3565 | E: T-Bone@parisc-linux.org |
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface index ff45d1f837c8..48ceabedf55d 100644 --- a/Documentation/hwmon/sysfs-interface +++ b/Documentation/hwmon/sysfs-interface | |||
| @@ -91,12 +91,11 @@ name The chip name. | |||
| 91 | I2C devices get this attribute created automatically. | 91 | I2C devices get this attribute created automatically. |
| 92 | RO | 92 | RO |
| 93 | 93 | ||
| 94 | update_rate The rate at which the chip will update readings. | 94 | update_interval The interval at which the chip will update readings. |
| 95 | Unit: millisecond | 95 | Unit: millisecond |
| 96 | RW | 96 | RW |
| 97 | Some devices have a variable update rate. This attribute | 97 | Some devices have a variable update rate or interval. |
| 98 | can be used to change the update rate to the desired | 98 | This attribute can be used to change it to the desired value. |
| 99 | frequency. | ||
| 100 | 99 | ||
| 101 | 100 | ||
| 102 | ************ | 101 | ************ |
diff --git a/Documentation/networking/e1000.txt b/Documentation/networking/e1000.txt index 2df71861e578..d9271e74e488 100644 --- a/Documentation/networking/e1000.txt +++ b/Documentation/networking/e1000.txt | |||
| @@ -1,82 +1,35 @@ | |||
| 1 | Linux* Base Driver for the Intel(R) PRO/1000 Family of Adapters | 1 | Linux* Base Driver for the Intel(R) PRO/1000 Family of Adapters |
| 2 | =============================================================== | 2 | =============================================================== |
| 3 | 3 | ||
| 4 | September 26, 2006 | 4 | Intel Gigabit Linux driver. |
| 5 | 5 | Copyright(c) 1999 - 2010 Intel Corporation. | |
| 6 | 6 | ||
| 7 | Contents | 7 | Contents |
| 8 | ======== | 8 | ======== |
| 9 | 9 | ||
| 10 | - In This Release | ||
| 11 | - Identifying Your Adapter | 10 | - Identifying Your Adapter |
| 12 | - Building and Installation | ||
| 13 | - Command Line Parameters | 11 | - Command Line Parameters |
| 14 | - Speed and Duplex Configuration | 12 | - Speed and Duplex Configuration |
| 15 | - Additional Configurations | 13 | - Additional Configurations |
| 16 | - Known Issues | ||
| 17 | - Support | 14 | - Support |
| 18 | 15 | ||
| 19 | |||
| 20 | In This Release | ||
| 21 | =============== | ||
| 22 | |||
| 23 | This file describes the Linux* Base Driver for the Intel(R) PRO/1000 Family | ||
| 24 | of Adapters. This driver includes support for Itanium(R)2-based systems. | ||
| 25 | |||
| 26 | For questions related to hardware requirements, refer to the documentation | ||
| 27 | supplied with your Intel PRO/1000 adapter. All hardware requirements listed | ||
| 28 | apply to use with Linux. | ||
| 29 | |||
| 30 | The following features are now available in supported kernels: | ||
| 31 | - Native VLANs | ||
| 32 | - Channel Bonding (teaming) | ||
| 33 | - SNMP | ||
| 34 | |||
| 35 | Channel Bonding documentation can be found in the Linux kernel source: | ||
| 36 | /Documentation/networking/bonding.txt | ||
| 37 | |||
| 38 | The driver information previously displayed in the /proc filesystem is not | ||
| 39 | supported in this release. Alternatively, you can use ethtool (version 1.6 | ||
| 40 | or later), lspci, and ifconfig to obtain the same information. | ||
| 41 | |||
| 42 | Instructions on updating ethtool can be found in the section "Additional | ||
| 43 | Configurations" later in this document. | ||
| 44 | |||
| 45 | NOTE: The Intel(R) 82562v 10/100 Network Connection only provides 10/100 | ||
| 46 | support. | ||
| 47 | |||
| 48 | |||
| 49 | Identifying Your Adapter | 16 | Identifying Your Adapter |
| 50 | ======================== | 17 | ======================== |
| 51 | 18 | ||
| 52 | For more information on how to identify your adapter, go to the Adapter & | 19 | For more information on how to identify your adapter, go to the Adapter & |
| 53 | Driver ID Guide at: | 20 | Driver ID Guide at: |
| 54 | 21 | ||
| 55 | http://support.intel.com/support/network/adapter/pro100/21397.htm | 22 | http://support.intel.com/support/go/network/adapter/idguide.htm |
| 56 | 23 | ||
| 57 | For the latest Intel network drivers for Linux, refer to the following | 24 | For the latest Intel network drivers for Linux, refer to the following |
| 58 | website. In the search field, enter your adapter name or type, or use the | 25 | website. In the search field, enter your adapter name or type, or use the |
| 59 | networking link on the left to search for your adapter: | 26 | networking link on the left to search for your adapter: |
| 60 | 27 | ||
| 61 | http://downloadfinder.intel.com/scripts-df/support_intel.asp | 28 | http://support.intel.com/support/go/network/adapter/home.htm |
| 62 | |||
| 63 | 29 | ||
| 64 | Command Line Parameters | 30 | Command Line Parameters |
| 65 | ======================= | 31 | ======================= |
| 66 | 32 | ||
| 67 | If the driver is built as a module, the following optional parameters | ||
| 68 | are used by entering them on the command line with the modprobe command | ||
| 69 | using this syntax: | ||
| 70 | |||
| 71 | modprobe e1000 [<option>=<VAL1>,<VAL2>,...] | ||
| 72 | |||
| 73 | For example, with two PRO/1000 PCI adapters, entering: | ||
| 74 | |||
| 75 | modprobe e1000 TxDescriptors=80,128 | ||
| 76 | |||
| 77 | loads the e1000 driver with 80 TX descriptors for the first adapter and | ||
| 78 | 128 TX descriptors for the second adapter. | ||
| 79 | |||
| 80 | The default value for each parameter is generally the recommended setting, | 33 | The default value for each parameter is generally the recommended setting, |
| 81 | unless otherwise noted. | 34 | unless otherwise noted. |
| 82 | 35 | ||
| @@ -89,10 +42,6 @@ NOTES: For more information about the AutoNeg, Duplex, and Speed | |||
| 89 | parameters, see the application note at: | 42 | parameters, see the application note at: |
| 90 | http://www.intel.com/design/network/applnots/ap450.htm | 43 | http://www.intel.com/design/network/applnots/ap450.htm |
| 91 | 44 | ||
| 92 | A descriptor describes a data buffer and attributes related to | ||
| 93 | the data buffer. This information is accessed by the hardware. | ||
| 94 | |||
| 95 | |||
| 96 | AutoNeg | 45 | AutoNeg |
| 97 | ------- | 46 | ------- |
| 98 | (Supported only on adapters with copper connections) | 47 | (Supported only on adapters with copper connections) |
| @@ -106,7 +55,6 @@ Duplex parameters must not be specified. | |||
| 106 | NOTE: Refer to the Speed and Duplex section of this readme for more | 55 | NOTE: Refer to the Speed and Duplex section of this readme for more |
| 107 | information on the AutoNeg parameter. | 56 | information on the AutoNeg parameter. |
| 108 | 57 | ||
| 109 | |||
| 110 | Duplex | 58 | Duplex |
| 111 | ------ | 59 | ------ |
| 112 | (Supported only on adapters with copper connections) | 60 | (Supported only on adapters with copper connections) |
| @@ -119,7 +67,6 @@ set to auto-negotiate, the board auto-detects the correct duplex. If the | |||
| 119 | link partner is forced (either full or half), Duplex defaults to half- | 67 | link partner is forced (either full or half), Duplex defaults to half- |
| 120 | duplex. | 68 | duplex. |
| 121 | 69 | ||
| 122 | |||
| 123 | FlowControl | 70 | FlowControl |
| 124 | ----------- | 71 | ----------- |
| 125 | Valid Range: 0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx) | 72 | Valid Range: 0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx) |
| @@ -128,16 +75,16 @@ Default Value: Reads flow control settings from the EEPROM | |||
| 128 | This parameter controls the automatic generation(Tx) and response(Rx) | 75 | This parameter controls the automatic generation(Tx) and response(Rx) |
| 129 | to Ethernet PAUSE frames. | 76 | to Ethernet PAUSE frames. |
| 130 | 77 | ||
| 131 | |||
| 132 | InterruptThrottleRate | 78 | InterruptThrottleRate |
| 133 | --------------------- | 79 | --------------------- |
| 134 | (not supported on Intel(R) 82542, 82543 or 82544-based adapters) | 80 | (not supported on Intel(R) 82542, 82543 or 82544-based adapters) |
| 135 | Valid Range: 0,1,3,100-100000 (0=off, 1=dynamic, 3=dynamic conservative) | 81 | Valid Range: 0,1,3,4,100-100000 (0=off, 1=dynamic, 3=dynamic conservative, |
| 82 | 4=simplified balancing) | ||
| 136 | Default Value: 3 | 83 | Default Value: 3 |
| 137 | 84 | ||
| 138 | The driver can limit the amount of interrupts per second that the adapter | 85 | The driver can limit the amount of interrupts per second that the adapter |
| 139 | will generate for incoming packets. It does this by writing a value to the | 86 | will generate for incoming packets. It does this by writing a value to the |
| 140 | adapter that is based on the maximum amount of interrupts that the adapter | 87 | adapter that is based on the maximum amount of interrupts that the adapter |
| 141 | will generate per second. | 88 | will generate per second. |
| 142 | 89 | ||
| 143 | Setting InterruptThrottleRate to a value greater or equal to 100 | 90 | Setting InterruptThrottleRate to a value greater or equal to 100 |
| @@ -146,37 +93,43 @@ per second, even if more packets have come in. This reduces interrupt | |||
| 146 | load on the system and can lower CPU utilization under heavy load, | 93 | load on the system and can lower CPU utilization under heavy load, |
| 147 | but will increase latency as packets are not processed as quickly. | 94 | but will increase latency as packets are not processed as quickly. |
| 148 | 95 | ||
| 149 | The default behaviour of the driver previously assumed a static | 96 | The default behaviour of the driver previously assumed a static |
| 150 | InterruptThrottleRate value of 8000, providing a good fallback value for | 97 | InterruptThrottleRate value of 8000, providing a good fallback value for |
| 151 | all traffic types,but lacking in small packet performance and latency. | 98 | all traffic types,but lacking in small packet performance and latency. |
| 152 | The hardware can handle many more small packets per second however, and | 99 | The hardware can handle many more small packets per second however, and |
| 153 | for this reason an adaptive interrupt moderation algorithm was implemented. | 100 | for this reason an adaptive interrupt moderation algorithm was implemented. |
| 154 | 101 | ||
| 155 | Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in which | 102 | Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in which |
| 156 | it dynamically adjusts the InterruptThrottleRate value based on the traffic | 103 | it dynamically adjusts the InterruptThrottleRate value based on the traffic |
| 157 | that it receives. After determining the type of incoming traffic in the last | 104 | that it receives. After determining the type of incoming traffic in the last |
| 158 | timeframe, it will adjust the InterruptThrottleRate to an appropriate value | 105 | timeframe, it will adjust the InterruptThrottleRate to an appropriate value |
| 159 | for that traffic. | 106 | for that traffic. |
| 160 | 107 | ||
| 161 | The algorithm classifies the incoming traffic every interval into | 108 | The algorithm classifies the incoming traffic every interval into |
| 162 | classes. Once the class is determined, the InterruptThrottleRate value is | 109 | classes. Once the class is determined, the InterruptThrottleRate value is |
| 163 | adjusted to suit that traffic type the best. There are three classes defined: | 110 | adjusted to suit that traffic type the best. There are three classes defined: |
| 164 | "Bulk traffic", for large amounts of packets of normal size; "Low latency", | 111 | "Bulk traffic", for large amounts of packets of normal size; "Low latency", |
| 165 | for small amounts of traffic and/or a significant percentage of small | 112 | for small amounts of traffic and/or a significant percentage of small |
| 166 | packets; and "Lowest latency", for almost completely small packets or | 113 | packets; and "Lowest latency", for almost completely small packets or |
| 167 | minimal traffic. | 114 | minimal traffic. |
| 168 | 115 | ||
| 169 | In dynamic conservative mode, the InterruptThrottleRate value is set to 4000 | 116 | In dynamic conservative mode, the InterruptThrottleRate value is set to 4000 |
| 170 | for traffic that falls in class "Bulk traffic". If traffic falls in the "Low | 117 | for traffic that falls in class "Bulk traffic". If traffic falls in the "Low |
| 171 | latency" or "Lowest latency" class, the InterruptThrottleRate is increased | 118 | latency" or "Lowest latency" class, the InterruptThrottleRate is increased |
| 172 | stepwise to 20000. This default mode is suitable for most applications. | 119 | stepwise to 20000. This default mode is suitable for most applications. |
| 173 | 120 | ||
| 174 | For situations where low latency is vital such as cluster or | 121 | For situations where low latency is vital such as cluster or |
| 175 | grid computing, the algorithm can reduce latency even more when | 122 | grid computing, the algorithm can reduce latency even more when |
| 176 | InterruptThrottleRate is set to mode 1. In this mode, which operates | 123 | InterruptThrottleRate is set to mode 1. In this mode, which operates |
| 177 | the same as mode 3, the InterruptThrottleRate will be increased stepwise to | 124 | the same as mode 3, the InterruptThrottleRate will be increased stepwise to |
| 178 | 70000 for traffic in class "Lowest latency". | 125 | 70000 for traffic in class "Lowest latency". |
| 179 | 126 | ||
| 127 | In simplified mode the interrupt rate is based on the ratio of Tx and | ||
| 128 | Rx traffic. If the bytes per second rate is approximately equal, the | ||
| 129 | interrupt rate will drop as low as 2000 interrupts per second. If the | ||
| 130 | traffic is mostly transmit or mostly receive, the interrupt rate could | ||
| 131 | be as high as 8000. | ||
| 132 | |||
| 180 | Setting InterruptThrottleRate to 0 turns off any interrupt moderation | 133 | Setting InterruptThrottleRate to 0 turns off any interrupt moderation |
| 181 | and may improve small packet latency, but is generally not suitable | 134 | and may improve small packet latency, but is generally not suitable |
| 182 | for bulk throughput traffic. | 135 | for bulk throughput traffic. |
| @@ -212,8 +165,6 @@ NOTE: When e1000 is loaded with default settings and multiple adapters | |||
| 212 | be platform-specific. If CPU utilization is not a concern, use | 165 | be platform-specific. If CPU utilization is not a concern, use |
| 213 | RX_POLLING (NAPI) and default driver settings. | 166 | RX_POLLING (NAPI) and default driver settings. |
| 214 | 167 | ||
| 215 | |||
| 216 | |||
| 217 | RxDescriptors | 168 | RxDescriptors |
| 218 | ------------- | 169 | ------------- |
| 219 | Valid Range: 80-256 for 82542 and 82543-based adapters | 170 | Valid Range: 80-256 for 82542 and 82543-based adapters |
| @@ -225,15 +176,14 @@ by the driver. Increasing this value allows the driver to buffer more | |||
| 225 | incoming packets, at the expense of increased system memory utilization. | 176 | incoming packets, at the expense of increased system memory utilization. |
| 226 | 177 | ||
| 227 | Each descriptor is 16 bytes. A receive buffer is also allocated for each | 178 | Each descriptor is 16 bytes. A receive buffer is also allocated for each |
| 228 | descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending | 179 | descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending |
| 229 | on the MTU setting. The maximum MTU size is 16110. | 180 | on the MTU setting. The maximum MTU size is 16110. |
| 230 | 181 | ||
| 231 | NOTE: MTU designates the frame size. It only needs to be set for Jumbo | 182 | NOTE: MTU designates the frame size. It only needs to be set for Jumbo |
| 232 | Frames. Depending on the available system resources, the request | 183 | Frames. Depending on the available system resources, the request |
| 233 | for a higher number of receive descriptors may be denied. In this | 184 | for a higher number of receive descriptors may be denied. In this |
| 234 | case, use a lower number. | 185 | case, use a lower number. |
| 235 | 186 | ||
| 236 | |||
| 237 | RxIntDelay | 187 | RxIntDelay |
| 238 | ---------- | 188 | ---------- |
| 239 | Valid Range: 0-65535 (0=off) | 189 | Valid Range: 0-65535 (0=off) |
| @@ -254,7 +204,6 @@ CAUTION: When setting RxIntDelay to a value other than 0, adapters may | |||
| 254 | restoring the network connection. To eliminate the potential | 204 | restoring the network connection. To eliminate the potential |
| 255 | for the hang ensure that RxIntDelay is set to 0. | 205 | for the hang ensure that RxIntDelay is set to 0. |
| 256 | 206 | ||
| 257 | |||
| 258 | RxAbsIntDelay | 207 | RxAbsIntDelay |
| 259 | ------------- | 208 | ------------- |
| 260 | (This parameter is supported only on 82540, 82545 and later adapters.) | 209 | (This parameter is supported only on 82540, 82545 and later adapters.) |
| @@ -268,7 +217,6 @@ packet is received within the set amount of time. Proper tuning, | |||
| 268 | along with RxIntDelay, may improve traffic throughput in specific network | 217 | along with RxIntDelay, may improve traffic throughput in specific network |
| 269 | conditions. | 218 | conditions. |
| 270 | 219 | ||
| 271 | |||
| 272 | Speed | 220 | Speed |
| 273 | ----- | 221 | ----- |
| 274 | (This parameter is supported only on adapters with copper connections.) | 222 | (This parameter is supported only on adapters with copper connections.) |
| @@ -280,7 +228,6 @@ Speed forces the line speed to the specified value in megabits per second | |||
| 280 | partner is set to auto-negotiate, the board will auto-detect the correct | 228 | partner is set to auto-negotiate, the board will auto-detect the correct |
| 281 | speed. Duplex should also be set when Speed is set to either 10 or 100. | 229 | speed. Duplex should also be set when Speed is set to either 10 or 100. |
| 282 | 230 | ||
| 283 | |||
| 284 | TxDescriptors | 231 | TxDescriptors |
| 285 | ------------- | 232 | ------------- |
| 286 | Valid Range: 80-256 for 82542 and 82543-based adapters | 233 | Valid Range: 80-256 for 82542 and 82543-based adapters |
| @@ -295,6 +242,36 @@ NOTE: Depending on the available system resources, the request for a | |||
| 295 | higher number of transmit descriptors may be denied. In this case, | 242 | higher number of transmit descriptors may be denied. In this case, |
| 296 | use a lower number. | 243 | use a lower number. |
| 297 | 244 | ||
| 245 | TxDescriptorStep | ||
| 246 | ---------------- | ||
| 247 | Valid Range: 1 (use every Tx Descriptor) | ||
| 248 | 4 (use every 4th Tx Descriptor) | ||
| 249 | |||
| 250 | Default Value: 1 (use every Tx Descriptor) | ||
| 251 | |||
| 252 | On certain non-Intel architectures, it has been observed that intense TX | ||
| 253 | traffic bursts of short packets may result in an improper descriptor | ||
| 254 | writeback. If this occurs, the driver will report a "TX Timeout" and reset | ||
| 255 | the adapter, after which the transmit flow will restart, though data may | ||
| 256 | have stalled for as much as 10 seconds before it resumes. | ||
| 257 | |||
| 258 | The improper writeback does not occur on the first descriptor in a system | ||
| 259 | memory cache-line, which is typically 32 bytes, or 4 descriptors long. | ||
| 260 | |||
| 261 | Setting TxDescriptorStep to a value of 4 will ensure that all TX descriptors | ||
| 262 | are aligned to the start of a system memory cache line, and so this problem | ||
| 263 | will not occur. | ||
| 264 | |||
| 265 | NOTES: Setting TxDescriptorStep to 4 effectively reduces the number of | ||
| 266 | TxDescriptors available for transmits to 1/4 of the normal allocation. | ||
| 267 | This has a possible negative performance impact, which may be | ||
| 268 | compensated for by allocating more descriptors using the TxDescriptors | ||
| 269 | module parameter. | ||
| 270 | |||
| 271 | There are other conditions which may result in "TX Timeout", which will | ||
| 272 | not be resolved by the use of the TxDescriptorStep parameter. As the | ||
| 273 | issue addressed by this parameter has never been observed on Intel | ||
| 274 | Architecture platforms, it should not be used on Intel platforms. | ||
| 298 | 275 | ||
| 299 | TxIntDelay | 276 | TxIntDelay |
| 300 | ---------- | 277 | ---------- |
| @@ -307,7 +284,6 @@ efficiency if properly tuned for specific network traffic. If the | |||
| 307 | system is reporting dropped transmits, this value may be set too high | 284 | system is reporting dropped transmits, this value may be set too high |
| 308 | causing the driver to run out of available transmit descriptors. | 285 | causing the driver to run out of available transmit descriptors. |
| 309 | 286 | ||
| 310 | |||
| 311 | TxAbsIntDelay | 287 | TxAbsIntDelay |
| 312 | ------------- | 288 | ------------- |
| 313 | (This parameter is supported only on 82540, 82545 and later adapters.) | 289 | (This parameter is supported only on 82540, 82545 and later adapters.) |
| @@ -330,6 +306,35 @@ Default Value: 1 | |||
| 330 | A value of '1' indicates that the driver should enable IP checksum | 306 | A value of '1' indicates that the driver should enable IP checksum |
| 331 | offload for received packets (both UDP and TCP) to the adapter hardware. | 307 | offload for received packets (both UDP and TCP) to the adapter hardware. |
| 332 | 308 | ||
| 309 | Copybreak | ||
| 310 | --------- | ||
| 311 | Valid Range: 0-xxxxxxx (0=off) | ||
| 312 | Default Value: 256 | ||
| 313 | Usage: insmod e1000.ko copybreak=128 | ||
| 314 | |||
| 315 | Driver copies all packets below or equaling this size to a fresh Rx | ||
| 316 | buffer before handing it up the stack. | ||
| 317 | |||
| 318 | This parameter is different than other parameters, in that it is a | ||
| 319 | single (not 1,1,1 etc.) parameter applied to all driver instances and | ||
| 320 | it is also available during runtime at | ||
| 321 | /sys/module/e1000/parameters/copybreak | ||
| 322 | |||
| 323 | SmartPowerDownEnable | ||
| 324 | -------------------- | ||
| 325 | Valid Range: 0-1 | ||
| 326 | Default Value: 0 (disabled) | ||
| 327 | |||
| 328 | Allows PHY to turn off in lower power states. The user can turn off | ||
| 329 | this parameter in supported chipsets. | ||
| 330 | |||
| 331 | KumeranLockLoss | ||
| 332 | --------------- | ||
| 333 | Valid Range: 0-1 | ||
| 334 | Default Value: 1 (enabled) | ||
| 335 | |||
| 336 | This workaround skips resetting the PHY at shutdown for the initial | ||
| 337 | silicon releases of ICH8 systems. | ||
| 333 | 338 | ||
| 334 | Speed and Duplex Configuration | 339 | Speed and Duplex Configuration |
| 335 | ============================== | 340 | ============================== |
| @@ -385,40 +390,9 @@ If the link partner is forced to a specific speed and duplex, then this | |||
| 385 | parameter should not be used. Instead, use the Speed and Duplex parameters | 390 | parameter should not be used. Instead, use the Speed and Duplex parameters |
| 386 | previously mentioned to force the adapter to the same speed and duplex. | 391 | previously mentioned to force the adapter to the same speed and duplex. |
| 387 | 392 | ||
| 388 | |||
| 389 | Additional Configurations | 393 | Additional Configurations |
| 390 | ========================= | 394 | ========================= |
| 391 | 395 | ||
| 392 | Configuring the Driver on Different Distributions | ||
| 393 | ------------------------------------------------- | ||
| 394 | Configuring a network driver to load properly when the system is started | ||
| 395 | is distribution dependent. Typically, the configuration process involves | ||
| 396 | adding an alias line to /etc/modules.conf or /etc/modprobe.conf as well | ||
| 397 | as editing other system startup scripts and/or configuration files. Many | ||
| 398 | popular Linux distributions ship with tools to make these changes for you. | ||
| 399 | To learn the proper way to configure a network device for your system, | ||
| 400 | refer to your distribution documentation. If during this process you are | ||
| 401 | asked for the driver or module name, the name for the Linux Base Driver | ||
| 402 | for the Intel(R) PRO/1000 Family of Adapters is e1000. | ||
| 403 | |||
| 404 | As an example, if you install the e1000 driver for two PRO/1000 adapters | ||
| 405 | (eth0 and eth1) and set the speed and duplex to 10full and 100half, add | ||
| 406 | the following to modules.conf or or modprobe.conf: | ||
| 407 | |||
| 408 | alias eth0 e1000 | ||
| 409 | alias eth1 e1000 | ||
| 410 | options e1000 Speed=10,100 Duplex=2,1 | ||
| 411 | |||
| 412 | Viewing Link Messages | ||
| 413 | --------------------- | ||
| 414 | Link messages will not be displayed to the console if the distribution is | ||
| 415 | restricting system messages. In order to see network driver link messages | ||
| 416 | on your console, set dmesg to eight by entering the following: | ||
| 417 | |||
| 418 | dmesg -n 8 | ||
| 419 | |||
| 420 | NOTE: This setting is not saved across reboots. | ||
| 421 | |||
| 422 | Jumbo Frames | 396 | Jumbo Frames |
| 423 | ------------ | 397 | ------------ |
| 424 | Jumbo Frames support is enabled by changing the MTU to a value larger than | 398 | Jumbo Frames support is enabled by changing the MTU to a value larger than |
| @@ -437,9 +411,11 @@ Additional Configurations | |||
| 437 | setting in a different location. | 411 | setting in a different location. |
| 438 | 412 | ||
| 439 | Notes: | 413 | Notes: |
| 440 | 414 | Degradation in throughput performance may be observed in some Jumbo frames | |
| 441 | - To enable Jumbo Frames, increase the MTU size on the interface beyond | 415 | environments. If this is observed, increasing the application's socket buffer |
| 442 | 1500. | 416 | size and/or increasing the /proc/sys/net/ipv4/tcp_*mem entry values may help. |
| 417 | See the specific application manual and /usr/src/linux*/Documentation/ | ||
| 418 | networking/ip-sysctl.txt for more details. | ||
| 443 | 419 | ||
| 444 | - The maximum MTU setting for Jumbo Frames is 16110. This value coincides | 420 | - The maximum MTU setting for Jumbo Frames is 16110. This value coincides |
| 445 | with the maximum Jumbo Frames size of 16128. | 421 | with the maximum Jumbo Frames size of 16128. |
| @@ -447,40 +423,11 @@ Additional Configurations | |||
| 447 | - Using Jumbo Frames at 10 or 100 Mbps may result in poor performance or | 423 | - Using Jumbo Frames at 10 or 100 Mbps may result in poor performance or |
| 448 | loss of link. | 424 | loss of link. |
| 449 | 425 | ||
| 450 | - Some Intel gigabit adapters that support Jumbo Frames have a frame size | ||
| 451 | limit of 9238 bytes, with a corresponding MTU size limit of 9216 bytes. | ||
| 452 | The adapters with this limitation are based on the Intel(R) 82571EB, | ||
| 453 | 82572EI, 82573L and 80003ES2LAN controller. These correspond to the | ||
| 454 | following product names: | ||
| 455 | Intel(R) PRO/1000 PT Server Adapter | ||
| 456 | Intel(R) PRO/1000 PT Desktop Adapter | ||
| 457 | Intel(R) PRO/1000 PT Network Connection | ||
| 458 | Intel(R) PRO/1000 PT Dual Port Server Adapter | ||
| 459 | Intel(R) PRO/1000 PT Dual Port Network Connection | ||
| 460 | Intel(R) PRO/1000 PF Server Adapter | ||
| 461 | Intel(R) PRO/1000 PF Network Connection | ||
| 462 | Intel(R) PRO/1000 PF Dual Port Server Adapter | ||
| 463 | Intel(R) PRO/1000 PB Server Connection | ||
| 464 | Intel(R) PRO/1000 PL Network Connection | ||
| 465 | Intel(R) PRO/1000 EB Network Connection with I/O Acceleration | ||
| 466 | Intel(R) PRO/1000 EB Backplane Connection with I/O Acceleration | ||
| 467 | Intel(R) PRO/1000 PT Quad Port Server Adapter | ||
| 468 | |||
| 469 | - Adapters based on the Intel(R) 82542 and 82573V/E controller do not | 426 | - Adapters based on the Intel(R) 82542 and 82573V/E controller do not |
| 470 | support Jumbo Frames. These correspond to the following product names: | 427 | support Jumbo Frames. These correspond to the following product names: |
| 471 | Intel(R) PRO/1000 Gigabit Server Adapter | 428 | Intel(R) PRO/1000 Gigabit Server Adapter |
| 472 | Intel(R) PRO/1000 PM Network Connection | 429 | Intel(R) PRO/1000 PM Network Connection |
| 473 | 430 | ||
| 474 | - The following adapters do not support Jumbo Frames: | ||
| 475 | Intel(R) 82562V 10/100 Network Connection | ||
| 476 | Intel(R) 82566DM Gigabit Network Connection | ||
| 477 | Intel(R) 82566DC Gigabit Network Connection | ||
| 478 | Intel(R) 82566MM Gigabit Network Connection | ||
| 479 | Intel(R) 82566MC Gigabit Network Connection | ||
| 480 | Intel(R) 82562GT 10/100 Network Connection | ||
| 481 | Intel(R) 82562G 10/100 Network Connection | ||
| 482 | |||
| 483 | |||
| 484 | Ethtool | 431 | Ethtool |
| 485 | ------- | 432 | ------- |
| 486 | The driver utilizes the ethtool interface for driver configuration and | 433 | The driver utilizes the ethtool interface for driver configuration and |
| @@ -490,142 +437,14 @@ Additional Configurations | |||
| 490 | The latest release of ethtool can be found from | 437 | The latest release of ethtool can be found from |
| 491 | http://sourceforge.net/projects/gkernel. | 438 | http://sourceforge.net/projects/gkernel. |
| 492 | 439 | ||
| 493 | NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support | ||
| 494 | for a more complete ethtool feature set can be enabled by upgrading | ||
| 495 | ethtool to ethtool-1.8.1. | ||
| 496 | |||
| 497 | Enabling Wake on LAN* (WoL) | 440 | Enabling Wake on LAN* (WoL) |
| 498 | --------------------------- | 441 | --------------------------- |
| 499 | WoL is configured through the Ethtool* utility. Ethtool is included with | 442 | WoL is configured through the Ethtool* utility. |
| 500 | all versions of Red Hat after Red Hat 7.2. For other Linux distributions, | ||
| 501 | download and install Ethtool from the following website: | ||
| 502 | http://sourceforge.net/projects/gkernel. | ||
| 503 | |||
| 504 | For instructions on enabling WoL with Ethtool, refer to the website listed | ||
| 505 | above. | ||
| 506 | 443 | ||
| 507 | WoL will be enabled on the system during the next shut down or reboot. | 444 | WoL will be enabled on the system during the next shut down or reboot. |
| 508 | For this driver version, in order to enable WoL, the e1000 driver must be | 445 | For this driver version, in order to enable WoL, the e1000 driver must be |
| 509 | loaded when shutting down or rebooting the system. | 446 | loaded when shutting down or rebooting the system. |
| 510 | 447 | ||
| 511 | Wake On LAN is only supported on port A for the following devices: | ||
| 512 | Intel(R) PRO/1000 PT Dual Port Network Connection | ||
| 513 | Intel(R) PRO/1000 PT Dual Port Server Connection | ||
| 514 | Intel(R) PRO/1000 PT Dual Port Server Adapter | ||
| 515 | Intel(R) PRO/1000 PF Dual Port Server Adapter | ||
| 516 | Intel(R) PRO/1000 PT Quad Port Server Adapter | ||
| 517 | |||
| 518 | NAPI | ||
| 519 | ---- | ||
| 520 | NAPI (Rx polling mode) is enabled in the e1000 driver. | ||
| 521 | |||
| 522 | See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. | ||
| 523 | |||
| 524 | |||
| 525 | Known Issues | ||
| 526 | ============ | ||
| 527 | |||
| 528 | Dropped Receive Packets on Half-duplex 10/100 Networks | ||
| 529 | ------------------------------------------------------ | ||
| 530 | If you have an Intel PCI Express adapter running at 10mbps or 100mbps, half- | ||
| 531 | duplex, you may observe occasional dropped receive packets. There are no | ||
| 532 | workarounds for this problem in this network configuration. The network must | ||
| 533 | be updated to operate in full-duplex, and/or 1000mbps only. | ||
| 534 | |||
| 535 | Jumbo Frames System Requirement | ||
| 536 | ------------------------------- | ||
| 537 | Memory allocation failures have been observed on Linux systems with 64 MB | ||
| 538 | of RAM or less that are running Jumbo Frames. If you are using Jumbo | ||
| 539 | Frames, your system may require more than the advertised minimum | ||
| 540 | requirement of 64 MB of system memory. | ||
| 541 | |||
| 542 | Performance Degradation with Jumbo Frames | ||
| 543 | ----------------------------------------- | ||
| 544 | Degradation in throughput performance may be observed in some Jumbo frames | ||
| 545 | environments. If this is observed, increasing the application's socket | ||
| 546 | buffer size and/or increasing the /proc/sys/net/ipv4/tcp_*mem entry values | ||
| 547 | may help. See the specific application manual and | ||
| 548 | /usr/src/linux*/Documentation/ | ||
| 549 | networking/ip-sysctl.txt for more details. | ||
| 550 | |||
| 551 | Jumbo Frames on Foundry BigIron 8000 switch | ||
| 552 | ------------------------------------------- | ||
| 553 | There is a known issue using Jumbo frames when connected to a Foundry | ||
| 554 | BigIron 8000 switch. This is a 3rd party limitation. If you experience | ||
| 555 | loss of packets, lower the MTU size. | ||
| 556 | |||
| 557 | Allocating Rx Buffers when Using Jumbo Frames | ||
| 558 | --------------------------------------------- | ||
| 559 | Allocating Rx buffers when using Jumbo Frames on 2.6.x kernels may fail if | ||
| 560 | the available memory is heavily fragmented. This issue may be seen with PCI-X | ||
| 561 | adapters or with packet split disabled. This can be reduced or eliminated | ||
| 562 | by changing the amount of available memory for receive buffer allocation, by | ||
| 563 | increasing /proc/sys/vm/min_free_kbytes. | ||
| 564 | |||
| 565 | Multiple Interfaces on Same Ethernet Broadcast Network | ||
| 566 | ------------------------------------------------------ | ||
| 567 | Due to the default ARP behavior on Linux, it is not possible to have | ||
| 568 | one system on two IP networks in the same Ethernet broadcast domain | ||
| 569 | (non-partitioned switch) behave as expected. All Ethernet interfaces | ||
| 570 | will respond to IP traffic for any IP address assigned to the system. | ||
| 571 | This results in unbalanced receive traffic. | ||
| 572 | |||
| 573 | If you have multiple interfaces in a server, either turn on ARP | ||
| 574 | filtering by entering: | ||
| 575 | |||
| 576 | echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter | ||
| 577 | (this only works if your kernel's version is higher than 2.4.5), | ||
| 578 | |||
| 579 | NOTE: This setting is not saved across reboots. The configuration | ||
| 580 | change can be made permanent by adding the line: | ||
| 581 | net.ipv4.conf.all.arp_filter = 1 | ||
| 582 | to the file /etc/sysctl.conf | ||
| 583 | |||
| 584 | or, | ||
| 585 | |||
| 586 | install the interfaces in separate broadcast domains (either in | ||
| 587 | different switches or in a switch partitioned to VLANs). | ||
| 588 | |||
| 589 | 82541/82547 can't link or are slow to link with some link partners | ||
| 590 | ----------------------------------------------------------------- | ||
| 591 | There is a known compatibility issue with 82541/82547 and some | ||
| 592 | low-end switches where the link will not be established, or will | ||
| 593 | be slow to establish. In particular, these switches are known to | ||
| 594 | be incompatible with 82541/82547: | ||
| 595 | |||
| 596 | Planex FXG-08TE | ||
| 597 | I-O Data ETG-SH8 | ||
| 598 | |||
| 599 | To workaround this issue, the driver can be compiled with an override | ||
| 600 | of the PHY's master/slave setting. Forcing master or forcing slave | ||
| 601 | mode will improve time-to-link. | ||
| 602 | |||
| 603 | # make CFLAGS_EXTRA=-DE1000_MASTER_SLAVE=<n> | ||
| 604 | |||
| 605 | Where <n> is: | ||
| 606 | |||
| 607 | 0 = Hardware default | ||
| 608 | 1 = Master mode | ||
| 609 | 2 = Slave mode | ||
| 610 | 3 = Auto master/slave | ||
| 611 | |||
| 612 | Disable rx flow control with ethtool | ||
| 613 | ------------------------------------ | ||
| 614 | In order to disable receive flow control using ethtool, you must turn | ||
| 615 | off auto-negotiation on the same command line. | ||
| 616 | |||
| 617 | For example: | ||
| 618 | |||
| 619 | ethtool -A eth? autoneg off rx off | ||
| 620 | |||
| 621 | Unplugging network cable while ethtool -p is running | ||
| 622 | ---------------------------------------------------- | ||
| 623 | In kernel versions 2.5.50 and later (including 2.6 kernel), unplugging | ||
| 624 | the network cable while ethtool -p is running will cause the system to | ||
| 625 | become unresponsive to keyboard commands, except for control-alt-delete. | ||
| 626 | Restarting the system appears to be the only remedy. | ||
| 627 | |||
| 628 | |||
| 629 | Support | 448 | Support |
| 630 | ======= | 449 | ======= |
| 631 | 450 | ||
diff --git a/Documentation/networking/e1000e.txt b/Documentation/networking/e1000e.txt new file mode 100644 index 000000000000..6aa048badf32 --- /dev/null +++ b/Documentation/networking/e1000e.txt | |||
| @@ -0,0 +1,302 @@ | |||
| 1 | Linux* Driver for Intel(R) Network Connection | ||
| 2 | =============================================================== | ||
| 3 | |||
| 4 | Intel Gigabit Linux driver. | ||
| 5 | Copyright(c) 1999 - 2010 Intel Corporation. | ||
| 6 | |||
| 7 | Contents | ||
| 8 | ======== | ||
| 9 | |||
| 10 | - Identifying Your Adapter | ||
| 11 | - Command Line Parameters | ||
| 12 | - Additional Configurations | ||
| 13 | - Support | ||
| 14 | |||
| 15 | Identifying Your Adapter | ||
| 16 | ======================== | ||
| 17 | |||
| 18 | The e1000e driver supports all PCI Express Intel(R) Gigabit Network | ||
| 19 | Connections, except those that are 82575, 82576 and 82580-based*. | ||
| 20 | |||
| 21 | * NOTE: The Intel(R) PRO/1000 P Dual Port Server Adapter is supported by | ||
| 22 | the e1000 driver, not the e1000e driver due to the 82546 part being used | ||
| 23 | behind a PCI Express bridge. | ||
| 24 | |||
| 25 | For more information on how to identify your adapter, go to the Adapter & | ||
| 26 | Driver ID Guide at: | ||
| 27 | |||
| 28 | http://support.intel.com/support/go/network/adapter/idguide.htm | ||
| 29 | |||
| 30 | For the latest Intel network drivers for Linux, refer to the following | ||
| 31 | website. In the search field, enter your adapter name or type, or use the | ||
| 32 | networking link on the left to search for your adapter: | ||
| 33 | |||
| 34 | http://support.intel.com/support/go/network/adapter/home.htm | ||
| 35 | |||
| 36 | Command Line Parameters | ||
| 37 | ======================= | ||
| 38 | |||
| 39 | The default value for each parameter is generally the recommended setting, | ||
| 40 | unless otherwise noted. | ||
| 41 | |||
| 42 | NOTES: For more information about the InterruptThrottleRate, | ||
| 43 | RxIntDelay, TxIntDelay, RxAbsIntDelay, and TxAbsIntDelay | ||
| 44 | parameters, see the application note at: | ||
| 45 | http://www.intel.com/design/network/applnots/ap450.htm | ||
| 46 | |||
| 47 | InterruptThrottleRate | ||
| 48 | --------------------- | ||
| 49 | Valid Range: 0,1,3,4,100-100000 (0=off, 1=dynamic, 3=dynamic conservative, | ||
| 50 | 4=simplified balancing) | ||
| 51 | Default Value: 3 | ||
| 52 | |||
| 53 | The driver can limit the amount of interrupts per second that the adapter | ||
| 54 | will generate for incoming packets. It does this by writing a value to the | ||
| 55 | adapter that is based on the maximum amount of interrupts that the adapter | ||
| 56 | will generate per second. | ||
| 57 | |||
| 58 | Setting InterruptThrottleRate to a value greater or equal to 100 | ||
| 59 | will program the adapter to send out a maximum of that many interrupts | ||
| 60 | per second, even if more packets have come in. This reduces interrupt | ||
| 61 | load on the system and can lower CPU utilization under heavy load, | ||
| 62 | but will increase latency as packets are not processed as quickly. | ||
| 63 | |||
| 64 | The driver has two adaptive modes (setting 1 or 3) in which | ||
| 65 | it dynamically adjusts the InterruptThrottleRate value based on the traffic | ||
| 66 | that it receives. After determining the type of incoming traffic in the last | ||
| 67 | timeframe, it will adjust the InterruptThrottleRate to an appropriate value | ||
| 68 | for that traffic. | ||
| 69 | |||
| 70 | The algorithm classifies the incoming traffic every interval into | ||
| 71 | classes. Once the class is determined, the InterruptThrottleRate value is | ||
| 72 | adjusted to suit that traffic type the best. There are three classes defined: | ||
| 73 | "Bulk traffic", for large amounts of packets of normal size; "Low latency", | ||
| 74 | for small amounts of traffic and/or a significant percentage of small | ||
| 75 | packets; and "Lowest latency", for almost completely small packets or | ||
| 76 | minimal traffic. | ||
| 77 | |||
| 78 | In dynamic conservative mode, the InterruptThrottleRate value is set to 4000 | ||
| 79 | for traffic that falls in class "Bulk traffic". If traffic falls in the "Low | ||
| 80 | latency" or "Lowest latency" class, the InterruptThrottleRate is increased | ||
| 81 | stepwise to 20000. This default mode is suitable for most applications. | ||
| 82 | |||
| 83 | For situations where low latency is vital such as cluster or | ||
| 84 | grid computing, the algorithm can reduce latency even more when | ||
| 85 | InterruptThrottleRate is set to mode 1. In this mode, which operates | ||
| 86 | the same as mode 3, the InterruptThrottleRate will be increased stepwise to | ||
| 87 | 70000 for traffic in class "Lowest latency". | ||
| 88 | |||
| 89 | In simplified mode the interrupt rate is based on the ratio of Tx and | ||
| 90 | Rx traffic. If the bytes per second rate is approximately equal the | ||
| 91 | interrupt rate will drop as low as 2000 interrupts per second. If the | ||
| 92 | traffic is mostly transmit or mostly receive, the interrupt rate could | ||
| 93 | be as high as 8000. | ||
| 94 | |||
| 95 | Setting InterruptThrottleRate to 0 turns off any interrupt moderation | ||
| 96 | and may improve small packet latency, but is generally not suitable | ||
| 97 | for bulk throughput traffic. | ||
| 98 | |||
| 99 | NOTE: InterruptThrottleRate takes precedence over the TxAbsIntDelay and | ||
| 100 | RxAbsIntDelay parameters. In other words, minimizing the receive | ||
| 101 | and/or transmit absolute delays does not force the controller to | ||
| 102 | generate more interrupts than what the Interrupt Throttle Rate | ||
| 103 | allows. | ||
| 104 | |||
| 105 | NOTE: When e1000e is loaded with default settings and multiple adapters | ||
| 106 | are in use simultaneously, the CPU utilization may increase non- | ||
| 107 | linearly. In order to limit the CPU utilization without impacting | ||
| 108 | the overall throughput, we recommend that you load the driver as | ||
| 109 | follows: | ||
| 110 | |||
| 111 | modprobe e1000e InterruptThrottleRate=3000,3000,3000 | ||
| 112 | |||
| 113 | This sets the InterruptThrottleRate to 3000 interrupts/sec for | ||
| 114 | the first, second, and third instances of the driver. The range | ||
| 115 | of 2000 to 3000 interrupts per second works on a majority of | ||
| 116 | systems and is a good starting point, but the optimal value will | ||
| 117 | be platform-specific. If CPU utilization is not a concern, use | ||
| 118 | RX_POLLING (NAPI) and default driver settings. | ||
| 119 | |||
| 120 | RxIntDelay | ||
| 121 | ---------- | ||
| 122 | Valid Range: 0-65535 (0=off) | ||
| 123 | Default Value: 0 | ||
| 124 | |||
| 125 | This value delays the generation of receive interrupts in units of 1.024 | ||
| 126 | microseconds. Receive interrupt reduction can improve CPU efficiency if | ||
| 127 | properly tuned for specific network traffic. Increasing this value adds | ||
| 128 | extra latency to frame reception and can end up decreasing the throughput | ||
| 129 | of TCP traffic. If the system is reporting dropped receives, this value | ||
| 130 | may be set too high, causing the driver to run out of available receive | ||
| 131 | descriptors. | ||
| 132 | |||
| 133 | CAUTION: When setting RxIntDelay to a value other than 0, adapters may | ||
| 134 | hang (stop transmitting) under certain network conditions. If | ||
| 135 | this occurs a NETDEV WATCHDOG message is logged in the system | ||
| 136 | event log. In addition, the controller is automatically reset, | ||
| 137 | restoring the network connection. To eliminate the potential | ||
| 138 | for the hang ensure that RxIntDelay is set to 0. | ||
| 139 | |||
| 140 | RxAbsIntDelay | ||
| 141 | ------------- | ||
| 142 | Valid Range: 0-65535 (0=off) | ||
| 143 | Default Value: 8 | ||
| 144 | |||
| 145 | This value, in units of 1.024 microseconds, limits the delay in which a | ||
| 146 | receive interrupt is generated. Useful only if RxIntDelay is non-zero, | ||
| 147 | this value ensures that an interrupt is generated after the initial | ||
| 148 | packet is received within the set amount of time. Proper tuning, | ||
| 149 | along with RxIntDelay, may improve traffic throughput in specific network | ||
| 150 | conditions. | ||
| 151 | |||
| 152 | TxIntDelay | ||
| 153 | ---------- | ||
| 154 | Valid Range: 0-65535 (0=off) | ||
| 155 | Default Value: 8 | ||
| 156 | |||
| 157 | This value delays the generation of transmit interrupts in units of | ||
| 158 | 1.024 microseconds. Transmit interrupt reduction can improve CPU | ||
| 159 | efficiency if properly tuned for specific network traffic. If the | ||
| 160 | system is reporting dropped transmits, this value may be set too high | ||
| 161 | causing the driver to run out of available transmit descriptors. | ||
| 162 | |||
| 163 | TxAbsIntDelay | ||
| 164 | ------------- | ||
| 165 | Valid Range: 0-65535 (0=off) | ||
| 166 | Default Value: 32 | ||
| 167 | |||
| 168 | This value, in units of 1.024 microseconds, limits the delay in which a | ||
| 169 | transmit interrupt is generated. Useful only if TxIntDelay is non-zero, | ||
| 170 | this value ensures that an interrupt is generated after the initial | ||
| 171 | packet is sent on the wire within the set amount of time. Proper tuning, | ||
| 172 | along with TxIntDelay, may improve traffic throughput in specific | ||
| 173 | network conditions. | ||
| 174 | |||
| 175 | Copybreak | ||
| 176 | --------- | ||
| 177 | Valid Range: 0-xxxxxxx (0=off) | ||
| 178 | Default Value: 256 | ||
| 179 | |||
| 180 | Driver copies all packets below or equaling this size to a fresh Rx | ||
| 181 | buffer before handing it up the stack. | ||
| 182 | |||
| 183 | This parameter is different than other parameters, in that it is a | ||
| 184 | single (not 1,1,1 etc.) parameter applied to all driver instances and | ||
| 185 | it is also available during runtime at | ||
| 186 | /sys/module/e1000e/parameters/copybreak | ||
| 187 | |||
| 188 | SmartPowerDownEnable | ||
| 189 | -------------------- | ||
| 190 | Valid Range: 0-1 | ||
| 191 | Default Value: 0 (disabled) | ||
| 192 | |||
| 193 | Allows PHY to turn off in lower power states. The user can set this parameter | ||
| 194 | in supported chipsets. | ||
| 195 | |||
| 196 | KumeranLockLoss | ||
| 197 | --------------- | ||
| 198 | Valid Range: 0-1 | ||
| 199 | Default Value: 1 (enabled) | ||
| 200 | |||
| 201 | This workaround skips resetting the PHY at shutdown for the initial | ||
| 202 | silicon releases of ICH8 systems. | ||
| 203 | |||
| 204 | IntMode | ||
| 205 | ------- | ||
| 206 | Valid Range: 0-2 (0=legacy, 1=MSI, 2=MSI-X) | ||
| 207 | Default Value: 2 | ||
| 208 | |||
| 209 | Allows changing the interrupt mode at module load time, without requiring a | ||
| 210 | recompile. If the driver load fails to enable a specific interrupt mode, the | ||
| 211 | driver will try other interrupt modes, from least to most compatible. The | ||
| 212 | interrupt order is MSI-X, MSI, Legacy. If specifying MSI (IntMode=1) | ||
| 213 | interrupts, only MSI and Legacy will be attempted. | ||
| 214 | |||
| 215 | CrcStripping | ||
| 216 | ------------ | ||
| 217 | Valid Range: 0-1 | ||
| 218 | Default Value: 1 (enabled) | ||
| 219 | |||
| 220 | Strip the CRC from received packets before sending up the network stack. If | ||
| 221 | you have a machine with a BMC enabled but cannot receive IPMI traffic after | ||
| 222 | loading or enabling the driver, try disabling this feature. | ||
| 223 | |||
| 224 | WriteProtectNVM | ||
| 225 | --------------- | ||
| 226 | Valid Range: 0-1 | ||
| 227 | Default Value: 1 (enabled) | ||
| 228 | |||
| 229 | Set the hardware to ignore all write/erase cycles to the GbE region in the | ||
| 230 | ICHx NVM (non-volatile memory). This feature can be disabled by the | ||
| 231 | WriteProtectNVM module parameter (enabled by default) only after a hardware | ||
| 232 | reset, but the machine must be power cycled before trying to enable writes. | ||
| 233 | |||
| 234 | Note: the kernel boot option iomem=relaxed may need to be set if the kernel | ||
| 235 | config option CONFIG_STRICT_DEVMEM=y, if the root user wants to write the | ||
| 236 | NVM from user space via ethtool. | ||
| 237 | |||
| 238 | Additional Configurations | ||
| 239 | ========================= | ||
| 240 | |||
| 241 | Jumbo Frames | ||
| 242 | ------------ | ||
| 243 | Jumbo Frames support is enabled by changing the MTU to a value larger than | ||
| 244 | the default of 1500. Use the ifconfig command to increase the MTU size. | ||
| 245 | For example: | ||
| 246 | |||
| 247 | ifconfig eth<x> mtu 9000 up | ||
| 248 | |||
| 249 | This setting is not saved across reboots. | ||
| 250 | |||
| 251 | Notes: | ||
| 252 | |||
| 253 | - The maximum MTU setting for Jumbo Frames is 9216. This value coincides | ||
| 254 | with the maximum Jumbo Frames size of 9234 bytes. | ||
| 255 | |||
| 256 | - Using Jumbo Frames at 10 or 100 Mbps is not supported and may result in | ||
| 257 | poor performance or loss of link. | ||
| 258 | |||
| 259 | - Some adapters limit Jumbo Frames sized packets to a maximum of | ||
| 260 | 4096 bytes and some adapters do not support Jumbo Frames. | ||
| 261 | |||
| 262 | |||
| 263 | Ethtool | ||
| 264 | ------- | ||
| 265 | The driver utilizes the ethtool interface for driver configuration and | ||
| 266 | diagnostics, as well as displaying statistical information. We | ||
| 267 | strongly recommend downloading the latest version of Ethtool at: | ||
| 268 | |||
| 269 | http://sourceforge.net/projects/gkernel. | ||
| 270 | |||
| 271 | Speed and Duplex | ||
| 272 | ---------------- | ||
| 273 | Speed and Duplex are configured through the Ethtool* utility. For | ||
| 274 | instructions, refer to the Ethtool man page. | ||
| 275 | |||
| 276 | Enabling Wake on LAN* (WoL) | ||
| 277 | --------------------------- | ||
| 278 | WoL is configured through the Ethtool* utility. For instructions on | ||
| 279 | enabling WoL with Ethtool, refer to the Ethtool man page. | ||
| 280 | |||
| 281 | WoL will be enabled on the system during the next shut down or reboot. | ||
| 282 | For this driver version, in order to enable WoL, the e1000e driver must be | ||
| 283 | loaded when shutting down or rebooting the system. | ||
| 284 | |||
| 285 | In most cases Wake On LAN is only supported on port A for multiple port | ||
| 286 | adapters. To verify if a port supports Wake on LAN run ethtool eth<X>. | ||
| 287 | |||
| 288 | |||
| 289 | Support | ||
| 290 | ======= | ||
| 291 | |||
| 292 | For general information, go to the Intel support website at: | ||
| 293 | |||
| 294 | www.intel.com/support/ | ||
| 295 | |||
| 296 | or the Intel Wired Networking project hosted by Sourceforge at: | ||
| 297 | |||
| 298 | http://sourceforge.net/projects/e1000 | ||
| 299 | |||
| 300 | If an issue is identified with the released source code on the supported | ||
| 301 | kernel with a supported adapter, email the specific information related | ||
| 302 | to the issue to e1000-devel@lists.sf.net | ||
diff --git a/Documentation/networking/ixgbevf.txt b/Documentation/networking/ixgbevf.txt index 19015de6725f..21dd5d15b6b4 100755..100644 --- a/Documentation/networking/ixgbevf.txt +++ b/Documentation/networking/ixgbevf.txt | |||
| @@ -1,19 +1,16 @@ | |||
| 1 | Linux* Base Driver for Intel(R) Network Connection | 1 | Linux* Base Driver for Intel(R) Network Connection |
| 2 | ================================================== | 2 | ================================================== |
| 3 | 3 | ||
| 4 | November 24, 2009 | 4 | Intel Gigabit Linux driver. |
| 5 | Copyright(c) 1999 - 2010 Intel Corporation. | ||
| 5 | 6 | ||
| 6 | Contents | 7 | Contents |
| 7 | ======== | 8 | ======== |
| 8 | 9 | ||
| 9 | - In This Release | ||
| 10 | - Identifying Your Adapter | 10 | - Identifying Your Adapter |
| 11 | - Known Issues/Troubleshooting | 11 | - Known Issues/Troubleshooting |
| 12 | - Support | 12 | - Support |
| 13 | 13 | ||
| 14 | In This Release | ||
| 15 | =============== | ||
| 16 | |||
| 17 | This file describes the ixgbevf Linux* Base Driver for Intel Network | 14 | This file describes the ixgbevf Linux* Base Driver for Intel Network |
| 18 | Connection. | 15 | Connection. |
| 19 | 16 | ||
| @@ -33,7 +30,7 @@ Identifying Your Adapter | |||
| 33 | For more information on how to identify your adapter, go to the Adapter & | 30 | For more information on how to identify your adapter, go to the Adapter & |
| 34 | Driver ID Guide at: | 31 | Driver ID Guide at: |
| 35 | 32 | ||
| 36 | http://support.intel.com/support/network/sb/CS-008441.htm | 33 | http://support.intel.com/support/go/network/adapter/idguide.htm |
| 37 | 34 | ||
| 38 | Known Issues/Troubleshooting | 35 | Known Issues/Troubleshooting |
| 39 | ============================ | 36 | ============================ |
| @@ -57,34 +54,3 @@ or the Intel Wired Networking project hosted by Sourceforge at: | |||
| 57 | If an issue is identified with the released source code on the supported | 54 | If an issue is identified with the released source code on the supported |
| 58 | kernel with a supported adapter, email the specific information related | 55 | kernel with a supported adapter, email the specific information related |
| 59 | to the issue to e1000-devel@lists.sf.net | 56 | to the issue to e1000-devel@lists.sf.net |
| 60 | |||
| 61 | License | ||
| 62 | ======= | ||
| 63 | |||
| 64 | Intel 10 Gigabit Linux driver. | ||
| 65 | Copyright(c) 1999 - 2009 Intel Corporation. | ||
| 66 | |||
| 67 | This program is free software; you can redistribute it and/or modify it | ||
| 68 | under the terms and conditions of the GNU General Public License, | ||
| 69 | version 2, as published by the Free Software Foundation. | ||
| 70 | |||
| 71 | This program is distributed in the hope it will be useful, but WITHOUT | ||
| 72 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 73 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 74 | more details. | ||
| 75 | |||
| 76 | You should have received a copy of the GNU General Public License along with | ||
| 77 | this program; if not, write to the Free Software Foundation, Inc., | ||
| 78 | 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 79 | |||
| 80 | The full GNU General Public License is included in this distribution in | ||
| 81 | the file called "COPYING". | ||
| 82 | |||
| 83 | Trademarks | ||
| 84 | ========== | ||
| 85 | |||
| 86 | Intel, Itanium, and Pentium are trademarks or registered trademarks of | ||
| 87 | Intel Corporation or its subsidiaries in the United States and other | ||
| 88 | countries. | ||
| 89 | |||
| 90 | * Other names and brands may be claimed as the property of others. | ||
diff --git a/Documentation/power/regulator/overview.txt b/Documentation/power/regulator/overview.txt index 9363e056188a..8ed17587a74b 100644 --- a/Documentation/power/regulator/overview.txt +++ b/Documentation/power/regulator/overview.txt | |||
| @@ -13,7 +13,7 @@ regulators (where voltage output is controllable) and current sinks (where | |||
| 13 | current limit is controllable). | 13 | current limit is controllable). |
| 14 | 14 | ||
| 15 | (C) 2008 Wolfson Microelectronics PLC. | 15 | (C) 2008 Wolfson Microelectronics PLC. |
| 16 | Author: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 16 | Author: Liam Girdwood <lrg@slimlogic.co.uk> |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | Nomenclature | 19 | Nomenclature |
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c index ccd951fa94ee..cc96ee2666f2 100644 --- a/Documentation/vm/page-types.c +++ b/Documentation/vm/page-types.c | |||
| @@ -478,7 +478,7 @@ static void prepare_hwpoison_fd(void) | |||
| 478 | } | 478 | } |
| 479 | 479 | ||
| 480 | if (opt_unpoison && !hwpoison_forget_fd) { | 480 | if (opt_unpoison && !hwpoison_forget_fd) { |
| 481 | sprintf(buf, "%s/renew-pfn", hwpoison_debug_fs); | 481 | sprintf(buf, "%s/unpoison-pfn", hwpoison_debug_fs); |
| 482 | hwpoison_forget_fd = checked_open(buf, O_WRONLY); | 482 | hwpoison_forget_fd = checked_open(buf, O_WRONLY); |
| 483 | } | 483 | } |
| 484 | } | 484 | } |
diff --git a/Documentation/workqueue.txt b/Documentation/workqueue.txt new file mode 100644 index 000000000000..e4498a2872c3 --- /dev/null +++ b/Documentation/workqueue.txt | |||
| @@ -0,0 +1,380 @@ | |||
| 1 | |||
| 2 | Concurrency Managed Workqueue (cmwq) | ||
| 3 | |||
| 4 | September, 2010 Tejun Heo <tj@kernel.org> | ||
| 5 | Florian Mickler <florian@mickler.org> | ||
| 6 | |||
| 7 | CONTENTS | ||
| 8 | |||
| 9 | 1. Introduction | ||
| 10 | 2. Why cmwq? | ||
| 11 | 3. The Design | ||
| 12 | 4. Application Programming Interface (API) | ||
| 13 | 5. Example Execution Scenarios | ||
| 14 | 6. Guidelines | ||
| 15 | |||
| 16 | |||
| 17 | 1. Introduction | ||
| 18 | |||
| 19 | There are many cases where an asynchronous process execution context | ||
| 20 | is needed and the workqueue (wq) API is the most commonly used | ||
| 21 | mechanism for such cases. | ||
| 22 | |||
| 23 | When such an asynchronous execution context is needed, a work item | ||
| 24 | describing which function to execute is put on a queue. An | ||
| 25 | independent thread serves as the asynchronous execution context. The | ||
| 26 | queue is called workqueue and the thread is called worker. | ||
| 27 | |||
| 28 | While there are work items on the workqueue the worker executes the | ||
| 29 | functions associated with the work items one after the other. When | ||
| 30 | there is no work item left on the workqueue the worker becomes idle. | ||
| 31 | When a new work item gets queued, the worker begins executing again. | ||
| 32 | |||
| 33 | |||
| 34 | 2. Why cmwq? | ||
| 35 | |||
| 36 | In the original wq implementation, a multi threaded (MT) wq had one | ||
| 37 | worker thread per CPU and a single threaded (ST) wq had one worker | ||
| 38 | thread system-wide. A single MT wq needed to keep around the same | ||
| 39 | number of workers as the number of CPUs. The kernel grew a lot of MT | ||
| 40 | wq users over the years and with the number of CPU cores continuously | ||
| 41 | rising, some systems saturated the default 32k PID space just booting | ||
| 42 | up. | ||
| 43 | |||
| 44 | Although MT wq wasted a lot of resource, the level of concurrency | ||
| 45 | provided was unsatisfactory. The limitation was common to both ST and | ||
| 46 | MT wq albeit less severe on MT. Each wq maintained its own separate | ||
| 47 | worker pool. A MT wq could provide only one execution context per CPU | ||
| 48 | while a ST wq one for the whole system. Work items had to compete for | ||
| 49 | those very limited execution contexts leading to various problems | ||
| 50 | including proneness to deadlocks around the single execution context. | ||
| 51 | |||
| 52 | The tension between the provided level of concurrency and resource | ||
| 53 | usage also forced its users to make unnecessary tradeoffs like libata | ||
| 54 | choosing to use ST wq for polling PIOs and accepting an unnecessary | ||
| 55 | limitation that no two polling PIOs can progress at the same time. As | ||
| 56 | MT wq don't provide much better concurrency, users which require | ||
| 57 | higher level of concurrency, like async or fscache, had to implement | ||
| 58 | their own thread pool. | ||
| 59 | |||
| 60 | Concurrency Managed Workqueue (cmwq) is a reimplementation of wq with | ||
| 61 | focus on the following goals. | ||
| 62 | |||
| 63 | * Maintain compatibility with the original workqueue API. | ||
| 64 | |||
| 65 | * Use per-CPU unified worker pools shared by all wq to provide | ||
| 66 | flexible level of concurrency on demand without wasting a lot of | ||
| 67 | resource. | ||
| 68 | |||
| 69 | * Automatically regulate worker pool and level of concurrency so that | ||
| 70 | the API users don't need to worry about such details. | ||
| 71 | |||
| 72 | |||
| 73 | 3. The Design | ||
| 74 | |||
| 75 | In order to ease the asynchronous execution of functions a new | ||
| 76 | abstraction, the work item, is introduced. | ||
| 77 | |||
| 78 | A work item is a simple struct that holds a pointer to the function | ||
| 79 | that is to be executed asynchronously. Whenever a driver or subsystem | ||
| 80 | wants a function to be executed asynchronously it has to set up a work | ||
| 81 | item pointing to that function and queue that work item on a | ||
| 82 | workqueue. | ||
| 83 | |||
| 84 | Special purpose threads, called worker threads, execute the functions | ||
| 85 | off of the queue, one after the other. If no work is queued, the | ||
| 86 | worker threads become idle. These worker threads are managed in so | ||
| 87 | called thread-pools. | ||
| 88 | |||
| 89 | The cmwq design differentiates between the user-facing workqueues that | ||
| 90 | subsystems and drivers queue work items on and the backend mechanism | ||
| 91 | which manages thread-pool and processes the queued work items. | ||
| 92 | |||
| 93 | The backend is called gcwq. There is one gcwq for each possible CPU | ||
| 94 | and one gcwq to serve work items queued on unbound workqueues. | ||
| 95 | |||
| 96 | Subsystems and drivers can create and queue work items through special | ||
| 97 | workqueue API functions as they see fit. They can influence some | ||
| 98 | aspects of the way the work items are executed by setting flags on the | ||
| 99 | workqueue they are putting the work item on. These flags include | ||
| 100 | things like CPU locality, reentrancy, concurrency limits and more. To | ||
| 101 | get a detailed overview refer to the API description of | ||
| 102 | alloc_workqueue() below. | ||
| 103 | |||
| 104 | When a work item is queued to a workqueue, the target gcwq is | ||
| 105 | determined according to the queue parameters and workqueue attributes | ||
| 106 | and appended on the shared worklist of the gcwq. For example, unless | ||
| 107 | specifically overridden, a work item of a bound workqueue will be | ||
| 108 | queued on the worklist of exactly that gcwq that is associated to the | ||
| 109 | CPU the issuer is running on. | ||
| 110 | |||
| 111 | For any worker pool implementation, managing the concurrency level | ||
| 112 | (how many execution contexts are active) is an important issue. cmwq | ||
| 113 | tries to keep the concurrency at a minimal but sufficient level. | ||
| 114 | Minimal to save resources and sufficient in that the system is used at | ||
| 115 | its full capacity. | ||
| 116 | |||
| 117 | Each gcwq bound to an actual CPU implements concurrency management by | ||
| 118 | hooking into the scheduler. The gcwq is notified whenever an active | ||
| 119 | worker wakes up or sleeps and keeps track of the number of the | ||
| 120 | currently runnable workers. Generally, work items are not expected to | ||
| 121 | hog a CPU and consume many cycles. That means maintaining just enough | ||
| 122 | concurrency to prevent work processing from stalling should be | ||
| 123 | optimal. As long as there are one or more runnable workers on the | ||
| 124 | CPU, the gcwq doesn't start execution of a new work, but, when the | ||
| 125 | last running worker goes to sleep, it immediately schedules a new | ||
| 126 | worker so that the CPU doesn't sit idle while there are pending work | ||
| 127 | items. This allows using a minimal number of workers without losing | ||
| 128 | execution bandwidth. | ||
| 129 | |||
| 130 | Keeping idle workers around doesn't cost other than the memory space | ||
| 131 | for kthreads, so cmwq holds onto idle ones for a while before killing | ||
| 132 | them. | ||
| 133 | |||
| 134 | For an unbound wq, the above concurrency management doesn't apply and | ||
| 135 | the gcwq for the pseudo unbound CPU tries to start executing all work | ||
| 136 | items as soon as possible. The responsibility of regulating | ||
| 137 | concurrency level is on the users. There is also a flag to mark a | ||
| 138 | bound wq to ignore the concurrency management. Please refer to the | ||
| 139 | API section for details. | ||
| 140 | |||
| 141 | Forward progress guarantee relies on that workers can be created when | ||
| 142 | more execution contexts are necessary, which in turn is guaranteed | ||
| 143 | through the use of rescue workers. All work items which might be used | ||
| 144 | on code paths that handle memory reclaim are required to be queued on | ||
| 145 | wq's that have a rescue-worker reserved for execution under memory | ||
| 146 | pressure. Else it is possible that the thread-pool deadlocks waiting | ||
| 147 | for execution contexts to free up. | ||
| 148 | |||
| 149 | |||
| 150 | 4. Application Programming Interface (API) | ||
| 151 | |||
| 152 | alloc_workqueue() allocates a wq. The original create_*workqueue() | ||
| 153 | functions are deprecated and scheduled for removal. alloc_workqueue() | ||
| 154 | takes three arguments - @name, @flags and @max_active. @name is the | ||
| 155 | name of the wq and also used as the name of the rescuer thread if | ||
| 156 | there is one. | ||
| 157 | |||
| 158 | A wq no longer manages execution resources but serves as a domain for | ||
| 159 | forward progress guarantee, flush and work item attributes. @flags | ||
| 160 | and @max_active control how work items are assigned execution | ||
| 161 | resources, scheduled and executed. | ||
| 162 | |||
| 163 | @flags: | ||
| 164 | |||
| 165 | WQ_NON_REENTRANT | ||
| 166 | |||
| 167 | By default, a wq guarantees non-reentrance only on the same | ||
| 168 | CPU. A work item may not be executed concurrently on the same | ||
| 169 | CPU by multiple workers but is allowed to be executed | ||
| 170 | concurrently on multiple CPUs. This flag makes sure | ||
| 171 | non-reentrance is enforced across all CPUs. Work items queued | ||
| 172 | to a non-reentrant wq are guaranteed to be executed by at most | ||
| 173 | one worker system-wide at any given time. | ||
| 174 | |||
| 175 | WQ_UNBOUND | ||
| 176 | |||
| 177 | Work items queued to an unbound wq are served by a special | ||
| 178 | gcwq which hosts workers which are not bound to any specific | ||
| 179 | CPU. This makes the wq behave as a simple execution context | ||
| 180 | provider without concurrency management. The unbound gcwq | ||
| 181 | tries to start execution of work items as soon as possible. | ||
| 182 | Unbound wq sacrifices locality but is useful for the following | ||
| 183 | cases. | ||
| 184 | |||
| 185 | * Wide fluctuation in the concurrency level requirement is | ||
| 186 | expected and using bound wq may end up creating large number | ||
| 187 | of mostly unused workers across different CPUs as the issuer | ||
| 188 | hops through different CPUs. | ||
| 189 | |||
| 190 | * Long running CPU intensive workloads which can be better | ||
| 191 | managed by the system scheduler. | ||
| 192 | |||
| 193 | WQ_FREEZEABLE | ||
| 194 | |||
| 195 | A freezeable wq participates in the freeze phase of the system | ||
| 196 | suspend operations. Work items on the wq are drained and no | ||
| 197 | new work item starts execution until thawed. | ||
| 198 | |||
| 199 | WQ_RESCUER | ||
| 200 | |||
| 201 | All wq which might be used in the memory reclaim paths _MUST_ | ||
| 202 | have this flag set. This reserves one worker exclusively for | ||
| 203 | the execution of this wq under memory pressure. | ||
| 204 | |||
| 205 | WQ_HIGHPRI | ||
| 206 | |||
| 207 | Work items of a highpri wq are queued at the head of the | ||
| 208 | worklist of the target gcwq and start execution regardless of | ||
| 209 | the current concurrency level. In other words, highpri work | ||
| 210 | items will always start execution as soon as execution | ||
| 211 | resource is available. | ||
| 212 | |||
| 213 | Ordering among highpri work items is preserved - a highpri | ||
| 214 | work item queued after another highpri work item will start | ||
| 215 | execution after the earlier highpri work item starts. | ||
| 216 | |||
| 217 | Although highpri work items are not held back by other | ||
| 218 | runnable work items, they still contribute to the concurrency | ||
| 219 | level. Highpri work items in runnable state will prevent | ||
| 220 | non-highpri work items from starting execution. | ||
| 221 | |||
| 222 | This flag is meaningless for unbound wq. | ||
| 223 | |||
| 224 | WQ_CPU_INTENSIVE | ||
| 225 | |||
| 226 | Work items of a CPU intensive wq do not contribute to the | ||
| 227 | concurrency level. In other words, runnable CPU intensive | ||
| 228 | work items will not prevent other work items from starting | ||
| 229 | execution. This is useful for bound work items which are | ||
| 230 | expected to hog CPU cycles so that their execution is | ||
| 231 | regulated by the system scheduler. | ||
| 232 | |||
| 233 | Although CPU intensive work items don't contribute to the | ||
| 234 | concurrency level, start of their executions is still | ||
| 235 | regulated by the concurrency management and runnable | ||
| 236 | non-CPU-intensive work items can delay execution of CPU | ||
| 237 | intensive work items. | ||
| 238 | |||
| 239 | This flag is meaningless for unbound wq. | ||
| 240 | |||
| 241 | WQ_HIGHPRI | WQ_CPU_INTENSIVE | ||
| 242 | |||
| 243 | This combination makes the wq avoid interaction with | ||
| 244 | concurrency management completely and behave as a simple | ||
| 245 | per-CPU execution context provider. Work items queued on a | ||
| 246 | highpri CPU-intensive wq start execution as soon as resources | ||
| 247 | are available and don't affect execution of other work items. | ||
| 248 | |||
| 249 | @max_active: | ||
| 250 | |||
| 251 | @max_active determines the maximum number of execution contexts per | ||
| 252 | CPU which can be assigned to the work items of a wq. For example, | ||
| 253 | with @max_active of 16, at most 16 work items of the wq can be | ||
| 254 | executing at the same time per CPU. | ||
| 255 | |||
| 256 | Currently, for a bound wq, the maximum limit for @max_active is 512 | ||
| 257 | and the default value used when 0 is specified is 256. For an unbound | ||
| 258 | wq, the limit is higher of 512 and 4 * num_possible_cpus(). These | ||
| 259 | values are chosen sufficiently high such that they are not the | ||
| 260 | limiting factor while providing protection in runaway cases. | ||
| 261 | |||
| 262 | The number of active work items of a wq is usually regulated by the | ||
| 263 | users of the wq, more specifically, by how many work items the users | ||
| 264 | may queue at the same time. Unless there is a specific need for | ||
| 265 | throttling the number of active work items, specifying '0' is | ||
| 266 | recommended. | ||
| 267 | |||
| 268 | Some users depend on the strict execution ordering of ST wq. The | ||
| 269 | combination of @max_active of 1 and WQ_UNBOUND is used to achieve this | ||
| 270 | behavior. Work items on such wq are always queued to the unbound gcwq | ||
| 271 | and only one work item can be active at any given time thus achieving | ||
| 272 | the same ordering property as ST wq. | ||
| 273 | |||
| 274 | |||
| 275 | 5. Example Execution Scenarios | ||
| 276 | |||
| 277 | The following example execution scenarios try to illustrate how cmwq | ||
| 278 | behave under different configurations. | ||
| 279 | |||
| 280 | Work items w0, w1, w2 are queued to a bound wq q0 on the same CPU. | ||
| 281 | w0 burns CPU for 5ms then sleeps for 10ms then burns CPU for 5ms | ||
| 282 | again before finishing. w1 and w2 burn CPU for 5ms then sleep for | ||
| 283 | 10ms. | ||
| 284 | |||
| 285 | Ignoring all other tasks, works and processing overhead, and assuming | ||
| 286 | simple FIFO scheduling, the following is one highly simplified version | ||
| 287 | of possible sequences of events with the original wq. | ||
| 288 | |||
| 289 | TIME IN MSECS EVENT | ||
| 290 | 0 w0 starts and burns CPU | ||
| 291 | 5 w0 sleeps | ||
| 292 | 15 w0 wakes up and burns CPU | ||
| 293 | 20 w0 finishes | ||
| 294 | 20 w1 starts and burns CPU | ||
| 295 | 25 w1 sleeps | ||
| 296 | 35 w1 wakes up and finishes | ||
| 297 | 35 w2 starts and burns CPU | ||
| 298 | 40 w2 sleeps | ||
| 299 | 50 w2 wakes up and finishes | ||
| 300 | |||
| 301 | And with cmwq with @max_active >= 3, | ||
| 302 | |||
| 303 | TIME IN MSECS EVENT | ||
| 304 | 0 w0 starts and burns CPU | ||
| 305 | 5 w0 sleeps | ||
| 306 | 5 w1 starts and burns CPU | ||
| 307 | 10 w1 sleeps | ||
| 308 | 10 w2 starts and burns CPU | ||
| 309 | 15 w2 sleeps | ||
| 310 | 15 w0 wakes up and burns CPU | ||
| 311 | 20 w0 finishes | ||
| 312 | 20 w1 wakes up and finishes | ||
| 313 | 25 w2 wakes up and finishes | ||
| 314 | |||
| 315 | If @max_active == 2, | ||
| 316 | |||
| 317 | TIME IN MSECS EVENT | ||
| 318 | 0 w0 starts and burns CPU | ||
| 319 | 5 w0 sleeps | ||
| 320 | 5 w1 starts and burns CPU | ||
| 321 | 10 w1 sleeps | ||
| 322 | 15 w0 wakes up and burns CPU | ||
| 323 | 20 w0 finishes | ||
| 324 | 20 w1 wakes up and finishes | ||
| 325 | 20 w2 starts and burns CPU | ||
| 326 | 25 w2 sleeps | ||
| 327 | 35 w2 wakes up and finishes | ||
| 328 | |||
| 329 | Now, let's assume w1 and w2 are queued to a different wq q1 which has | ||
| 330 | WQ_HIGHPRI set, | ||
| 331 | |||
| 332 | TIME IN MSECS EVENT | ||
| 333 | 0 w1 and w2 start and burn CPU | ||
| 334 | 5 w1 sleeps | ||
| 335 | 10 w2 sleeps | ||
| 336 | 10 w0 starts and burns CPU | ||
| 337 | 15 w0 sleeps | ||
| 338 | 15 w1 wakes up and finishes | ||
| 339 | 20 w2 wakes up and finishes | ||
| 340 | 25 w0 wakes up and burns CPU | ||
| 341 | 30 w0 finishes | ||
| 342 | |||
| 343 | If q1 has WQ_CPU_INTENSIVE set, | ||
| 344 | |||
| 345 | TIME IN MSECS EVENT | ||
| 346 | 0 w0 starts and burns CPU | ||
| 347 | 5 w0 sleeps | ||
| 348 | 5 w1 and w2 start and burn CPU | ||
| 349 | 10 w1 sleeps | ||
| 350 | 15 w2 sleeps | ||
| 351 | 15 w0 wakes up and burns CPU | ||
| 352 | 20 w0 finishes | ||
| 353 | 20 w1 wakes up and finishes | ||
| 354 | 25 w2 wakes up and finishes | ||
| 355 | |||
| 356 | |||
| 357 | 6. Guidelines | ||
| 358 | |||
| 359 | * Do not forget to use WQ_RESCUER if a wq may process work items which | ||
| 360 | are used during memory reclaim. Each wq with WQ_RESCUER set has one | ||
| 361 | rescuer thread reserved for it. If there is dependency among | ||
| 362 | multiple work items used during memory reclaim, they should be | ||
| 363 | queued to separate wq each with WQ_RESCUER. | ||
| 364 | |||
| 365 | * Unless strict ordering is required, there is no need to use ST wq. | ||
| 366 | |||
| 367 | * Unless there is a specific need, using 0 for @max_active is | ||
| 368 | recommended. In most use cases, concurrency level usually stays | ||
| 369 | well under the default limit. | ||
| 370 | |||
| 371 | * A wq serves as a domain for forward progress guarantee (WQ_RESCUER), | ||
| 372 | flush and work item attributes. Work items which are not involved | ||
| 373 | in memory reclaim and don't need to be flushed as a part of a group | ||
| 374 | of work items, and don't require any special attribute, can use one | ||
| 375 | of the system wq. There is no difference in execution | ||
| 376 | characteristics between using a dedicated wq and a system wq. | ||
| 377 | |||
| 378 | * Unless work items are expected to consume a huge amount of CPU | ||
| 379 | cycles, using a bound wq is usually beneficial due to the increased | ||
| 380 | level of locality in wq operations and work item execution. | ||
diff --git a/MAINTAINERS b/MAINTAINERS index e7c528ff1013..7679bf32f7bb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -962,6 +962,23 @@ W: http://www.fluff.org/ben/linux/ | |||
| 962 | S: Maintained | 962 | S: Maintained |
| 963 | F: arch/arm/mach-s3c6410/ | 963 | F: arch/arm/mach-s3c6410/ |
| 964 | 964 | ||
| 965 | ARM/S5P ARM ARCHITECTURES | ||
| 966 | M: Kukjin Kim <kgene.kim@samsung.com> | ||
| 967 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | ||
| 968 | L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers) | ||
| 969 | S: Maintained | ||
| 970 | F: arch/arm/mach-s5p*/ | ||
| 971 | |||
| 972 | ARM/SAMSUNG S5P SERIES FIMC SUPPORT | ||
| 973 | M: Kyungmin Park <kyungmin.park@samsung.com> | ||
| 974 | M: Sylwester Nawrocki <s.nawrocki@samsung.com> | ||
| 975 | L: linux-arm-kernel@lists.infradead.org | ||
| 976 | L: linux-media@vger.kernel.org | ||
| 977 | S: Maintained | ||
| 978 | F: arch/arm/plat-s5p/dev-fimc* | ||
| 979 | F: arch/arm/plat-samsung/include/plat/*fimc* | ||
| 980 | F: drivers/media/video/s5p-fimc/ | ||
| 981 | |||
| 965 | ARM/SHMOBILE ARM ARCHITECTURE | 982 | ARM/SHMOBILE ARM ARCHITECTURE |
| 966 | M: Paul Mundt <lethal@linux-sh.org> | 983 | M: Paul Mundt <lethal@linux-sh.org> |
| 967 | M: Magnus Damm <magnus.damm@gmail.com> | 984 | M: Magnus Damm <magnus.damm@gmail.com> |
| @@ -1135,7 +1152,7 @@ ATLX ETHERNET DRIVERS | |||
| 1135 | M: Jay Cliburn <jcliburn@gmail.com> | 1152 | M: Jay Cliburn <jcliburn@gmail.com> |
| 1136 | M: Chris Snook <chris.snook@gmail.com> | 1153 | M: Chris Snook <chris.snook@gmail.com> |
| 1137 | M: Jie Yang <jie.yang@atheros.com> | 1154 | M: Jie Yang <jie.yang@atheros.com> |
| 1138 | L: atl1-devel@lists.sourceforge.net | 1155 | L: netdev@vger.kernel.org |
| 1139 | W: http://sourceforge.net/projects/atl1 | 1156 | W: http://sourceforge.net/projects/atl1 |
| 1140 | W: http://atl1.sourceforge.net | 1157 | W: http://atl1.sourceforge.net |
| 1141 | S: Maintained | 1158 | S: Maintained |
| @@ -1220,7 +1237,7 @@ F: drivers/auxdisplay/ | |||
| 1220 | F: include/linux/cfag12864b.h | 1237 | F: include/linux/cfag12864b.h |
| 1221 | 1238 | ||
| 1222 | AVR32 ARCHITECTURE | 1239 | AVR32 ARCHITECTURE |
| 1223 | M: Haavard Skinnemoen <hskinnemoen@atmel.com> | 1240 | M: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> |
| 1224 | W: http://www.atmel.com/products/AVR32/ | 1241 | W: http://www.atmel.com/products/AVR32/ |
| 1225 | W: http://avr32linux.org/ | 1242 | W: http://avr32linux.org/ |
| 1226 | W: http://avrfreaks.net/ | 1243 | W: http://avrfreaks.net/ |
| @@ -1228,7 +1245,7 @@ S: Supported | |||
| 1228 | F: arch/avr32/ | 1245 | F: arch/avr32/ |
| 1229 | 1246 | ||
| 1230 | AVR32/AT32AP MACHINE SUPPORT | 1247 | AVR32/AT32AP MACHINE SUPPORT |
| 1231 | M: Haavard Skinnemoen <hskinnemoen@atmel.com> | 1248 | M: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> |
| 1232 | S: Supported | 1249 | S: Supported |
| 1233 | F: arch/avr32/mach-at32ap/ | 1250 | F: arch/avr32/mach-at32ap/ |
| 1234 | 1251 | ||
| @@ -2199,6 +2216,12 @@ W: http://acpi4asus.sf.net | |||
| 2199 | S: Maintained | 2216 | S: Maintained |
| 2200 | F: drivers/platform/x86/eeepc-laptop.c | 2217 | F: drivers/platform/x86/eeepc-laptop.c |
| 2201 | 2218 | ||
| 2219 | EFIFB FRAMEBUFFER DRIVER | ||
| 2220 | L: linux-fbdev@vger.kernel.org | ||
| 2221 | M: Peter Jones <pjones@redhat.com> | ||
| 2222 | S: Maintained | ||
| 2223 | F: drivers/video/efifb.c | ||
| 2224 | |||
| 2202 | EFS FILESYSTEM | 2225 | EFS FILESYSTEM |
| 2203 | W: http://aeschi.ch.eu.org/efs/ | 2226 | W: http://aeschi.ch.eu.org/efs/ |
| 2204 | S: Orphan | 2227 | S: Orphan |
| @@ -2522,7 +2545,7 @@ S: Supported | |||
| 2522 | F: drivers/scsi/gdt* | 2545 | F: drivers/scsi/gdt* |
| 2523 | 2546 | ||
| 2524 | GENERIC GPIO I2C DRIVER | 2547 | GENERIC GPIO I2C DRIVER |
| 2525 | M: Haavard Skinnemoen <hskinnemoen@atmel.com> | 2548 | M: Haavard Skinnemoen <hskinnemoen@gmail.com> |
| 2526 | S: Supported | 2549 | S: Supported |
| 2527 | F: drivers/i2c/busses/i2c-gpio.c | 2550 | F: drivers/i2c/busses/i2c-gpio.c |
| 2528 | F: include/linux/i2c-gpio.h | 2551 | F: include/linux/i2c-gpio.h |
| @@ -2657,9 +2680,14 @@ S: Maintained | |||
| 2657 | F: drivers/media/video/gspca/ | 2680 | F: drivers/media/video/gspca/ |
| 2658 | 2681 | ||
| 2659 | HARDWARE MONITORING | 2682 | HARDWARE MONITORING |
| 2683 | M: Jean Delvare <khali@linux-fr.org> | ||
| 2684 | M: Guenter Roeck <guenter.roeck@ericsson.com> | ||
| 2660 | L: lm-sensors@lm-sensors.org | 2685 | L: lm-sensors@lm-sensors.org |
| 2661 | W: http://www.lm-sensors.org/ | 2686 | W: http://www.lm-sensors.org/ |
| 2662 | S: Orphan | 2687 | T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/ |
| 2688 | T: quilt kernel.org/pub/linux/kernel/people/groeck/linux-staging/ | ||
| 2689 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git | ||
| 2690 | S: Maintained | ||
| 2663 | F: Documentation/hwmon/ | 2691 | F: Documentation/hwmon/ |
| 2664 | F: drivers/hwmon/ | 2692 | F: drivers/hwmon/ |
| 2665 | F: include/linux/hwmon*.h | 2693 | F: include/linux/hwmon*.h |
| @@ -3045,16 +3073,27 @@ L: netdev@vger.kernel.org | |||
| 3045 | S: Maintained | 3073 | S: Maintained |
| 3046 | F: drivers/net/ixp2000/ | 3074 | F: drivers/net/ixp2000/ |
| 3047 | 3075 | ||
| 3048 | INTEL ETHERNET DRIVERS (e100/e1000/e1000e/igb/igbvf/ixgb/ixgbe) | 3076 | INTEL ETHERNET DRIVERS (e100/e1000/e1000e/igb/igbvf/ixgb/ixgbe/ixgbevf) |
| 3049 | M: Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 3077 | M: Jeff Kirsher <jeffrey.t.kirsher@intel.com> |
| 3050 | M: Jesse Brandeburg <jesse.brandeburg@intel.com> | 3078 | M: Jesse Brandeburg <jesse.brandeburg@intel.com> |
| 3051 | M: Bruce Allan <bruce.w.allan@intel.com> | 3079 | M: Bruce Allan <bruce.w.allan@intel.com> |
| 3052 | M: Alex Duyck <alexander.h.duyck@intel.com> | 3080 | M: Carolyn Wyborny <carolyn.wyborny@intel.com> |
| 3081 | M: Don Skidmore <donald.c.skidmore@intel.com> | ||
| 3082 | M: Greg Rose <gregory.v.rose@intel.com> | ||
| 3053 | M: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com> | 3083 | M: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com> |
| 3084 | M: Alex Duyck <alexander.h.duyck@intel.com> | ||
| 3054 | M: John Ronciak <john.ronciak@intel.com> | 3085 | M: John Ronciak <john.ronciak@intel.com> |
| 3055 | L: e1000-devel@lists.sourceforge.net | 3086 | L: e1000-devel@lists.sourceforge.net |
| 3056 | W: http://e1000.sourceforge.net/ | 3087 | W: http://e1000.sourceforge.net/ |
| 3057 | S: Supported | 3088 | S: Supported |
| 3089 | F: Documentation/networking/e100.txt | ||
| 3090 | F: Documentation/networking/e1000.txt | ||
| 3091 | F: Documentation/networking/e1000e.txt | ||
| 3092 | F: Documentation/networking/igb.txt | ||
| 3093 | F: Documentation/networking/igbvf.txt | ||
| 3094 | F: Documentation/networking/ixgb.txt | ||
| 3095 | F: Documentation/networking/ixgbe.txt | ||
| 3096 | F: Documentation/networking/ixgbevf.txt | ||
| 3058 | F: drivers/net/e100.c | 3097 | F: drivers/net/e100.c |
| 3059 | F: drivers/net/e1000/ | 3098 | F: drivers/net/e1000/ |
| 3060 | F: drivers/net/e1000e/ | 3099 | F: drivers/net/e1000e/ |
| @@ -3062,6 +3101,7 @@ F: drivers/net/igb/ | |||
| 3062 | F: drivers/net/igbvf/ | 3101 | F: drivers/net/igbvf/ |
| 3063 | F: drivers/net/ixgb/ | 3102 | F: drivers/net/ixgb/ |
| 3064 | F: drivers/net/ixgbe/ | 3103 | F: drivers/net/ixgbe/ |
| 3104 | F: drivers/net/ixgbevf/ | ||
| 3065 | 3105 | ||
| 3066 | INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT | 3106 | INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT |
| 3067 | L: linux-wireless@vger.kernel.org | 3107 | L: linux-wireless@vger.kernel.org |
| @@ -3770,9 +3810,8 @@ W: http://www.syskonnect.com | |||
| 3770 | S: Supported | 3810 | S: Supported |
| 3771 | 3811 | ||
| 3772 | MATROX FRAMEBUFFER DRIVER | 3812 | MATROX FRAMEBUFFER DRIVER |
| 3773 | M: Petr Vandrovec <vandrove@vc.cvut.cz> | ||
| 3774 | L: linux-fbdev@vger.kernel.org | 3813 | L: linux-fbdev@vger.kernel.org |
| 3775 | S: Maintained | 3814 | S: Orphan |
| 3776 | F: drivers/video/matrox/matroxfb_* | 3815 | F: drivers/video/matrox/matroxfb_* |
| 3777 | F: include/linux/matroxfb.h | 3816 | F: include/linux/matroxfb.h |
| 3778 | 3817 | ||
| @@ -3896,10 +3935,8 @@ F: Documentation/serial/moxa-smartio | |||
| 3896 | F: drivers/char/mxser.* | 3935 | F: drivers/char/mxser.* |
| 3897 | 3936 | ||
| 3898 | MSI LAPTOP SUPPORT | 3937 | MSI LAPTOP SUPPORT |
| 3899 | M: Lennart Poettering <mzxreary@0pointer.de> | 3938 | M: Lee, Chun-Yi <jlee@novell.com> |
| 3900 | L: platform-driver-x86@vger.kernel.org | 3939 | L: platform-driver-x86@vger.kernel.org |
| 3901 | W: https://tango.0pointer.de/mailman/listinfo/s270-linux | ||
| 3902 | W: http://0pointer.de/lennart/tchibo.html | ||
| 3903 | S: Maintained | 3940 | S: Maintained |
| 3904 | F: drivers/platform/x86/msi-laptop.c | 3941 | F: drivers/platform/x86/msi-laptop.c |
| 3905 | 3942 | ||
| @@ -3916,8 +3953,10 @@ S: Supported | |||
| 3916 | F: drivers/mfd/ | 3953 | F: drivers/mfd/ |
| 3917 | 3954 | ||
| 3918 | MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM | 3955 | MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM |
| 3919 | S: Orphan | 3956 | M: Chris Ball <cjb@laptop.org> |
| 3920 | L: linux-mmc@vger.kernel.org | 3957 | L: linux-mmc@vger.kernel.org |
| 3958 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git | ||
| 3959 | S: Maintained | ||
| 3921 | F: drivers/mmc/ | 3960 | F: drivers/mmc/ |
| 3922 | F: include/linux/mmc/ | 3961 | F: include/linux/mmc/ |
| 3923 | 3962 | ||
| @@ -3939,7 +3978,7 @@ F: drivers/char/isicom.c | |||
| 3939 | F: include/linux/isicom.h | 3978 | F: include/linux/isicom.h |
| 3940 | 3979 | ||
| 3941 | MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER | 3980 | MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER |
| 3942 | M: Felipe Balbi <felipe.balbi@nokia.com> | 3981 | M: Felipe Balbi <balbi@ti.com> |
| 3943 | L: linux-usb@vger.kernel.org | 3982 | L: linux-usb@vger.kernel.org |
| 3944 | T: git git://gitorious.org/usb/usb.git | 3983 | T: git git://gitorious.org/usb/usb.git |
| 3945 | S: Maintained | 3984 | S: Maintained |
| @@ -3959,8 +3998,8 @@ S: Maintained | |||
| 3959 | F: drivers/net/natsemi.c | 3998 | F: drivers/net/natsemi.c |
| 3960 | 3999 | ||
| 3961 | NCP FILESYSTEM | 4000 | NCP FILESYSTEM |
| 3962 | M: Petr Vandrovec <vandrove@vc.cvut.cz> | 4001 | M: Petr Vandrovec <petr@vandrovec.name> |
| 3963 | S: Maintained | 4002 | S: Odd Fixes |
| 3964 | F: fs/ncpfs/ | 4003 | F: fs/ncpfs/ |
| 3965 | 4004 | ||
| 3966 | NCR DUAL 700 SCSI DRIVER (MICROCHANNEL) | 4005 | NCR DUAL 700 SCSI DRIVER (MICROCHANNEL) |
| @@ -4237,7 +4276,7 @@ S: Maintained | |||
| 4237 | F: drivers/char/hw_random/omap-rng.c | 4276 | F: drivers/char/hw_random/omap-rng.c |
| 4238 | 4277 | ||
| 4239 | OMAP USB SUPPORT | 4278 | OMAP USB SUPPORT |
| 4240 | M: Felipe Balbi <felipe.balbi@nokia.com> | 4279 | M: Felipe Balbi <balbi@ti.com> |
| 4241 | M: David Brownell <dbrownell@users.sourceforge.net> | 4280 | M: David Brownell <dbrownell@users.sourceforge.net> |
| 4242 | L: linux-usb@vger.kernel.org | 4281 | L: linux-usb@vger.kernel.org |
| 4243 | L: linux-omap@vger.kernel.org | 4282 | L: linux-omap@vger.kernel.org |
| @@ -4991,6 +5030,12 @@ F: drivers/media/common/saa7146* | |||
| 4991 | F: drivers/media/video/*7146* | 5030 | F: drivers/media/video/*7146* |
| 4992 | F: include/media/*7146* | 5031 | F: include/media/*7146* |
| 4993 | 5032 | ||
| 5033 | SAMSUNG AUDIO (ASoC) DRIVERS | ||
| 5034 | M: Jassi Brar <jassi.brar@samsung.com> | ||
| 5035 | L: alsa-devel@alsa-project.org (moderated for non-subscribers) | ||
| 5036 | S: Supported | ||
| 5037 | F: sound/soc/s3c24xx | ||
| 5038 | |||
| 4994 | TLG2300 VIDEO4LINUX-2 DRIVER | 5039 | TLG2300 VIDEO4LINUX-2 DRIVER |
| 4995 | M: Huang Shijie <shijie8@gmail.com> | 5040 | M: Huang Shijie <shijie8@gmail.com> |
| 4996 | M: Kang Yong <kangyong@telegent.com> | 5041 | M: Kang Yong <kangyong@telegent.com> |
| @@ -5088,8 +5133,10 @@ S: Maintained | |||
| 5088 | F: drivers/mmc/host/sdricoh_cs.c | 5133 | F: drivers/mmc/host/sdricoh_cs.c |
| 5089 | 5134 | ||
| 5090 | SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER | 5135 | SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER |
| 5091 | S: Orphan | 5136 | M: Chris Ball <cjb@laptop.org> |
| 5092 | L: linux-mmc@vger.kernel.org | 5137 | L: linux-mmc@vger.kernel.org |
| 5138 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git | ||
| 5139 | S: Maintained | ||
| 5093 | F: drivers/mmc/host/sdhci.* | 5140 | F: drivers/mmc/host/sdhci.* |
| 5094 | 5141 | ||
| 5095 | SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF) | 5142 | SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF) |
| @@ -6431,8 +6478,10 @@ F: include/linux/wm97xx.h | |||
| 6431 | WOLFSON MICROELECTRONICS DRIVERS | 6478 | WOLFSON MICROELECTRONICS DRIVERS |
| 6432 | M: Mark Brown <broonie@opensource.wolfsonmicro.com> | 6479 | M: Mark Brown <broonie@opensource.wolfsonmicro.com> |
| 6433 | M: Ian Lartey <ian@opensource.wolfsonmicro.com> | 6480 | M: Ian Lartey <ian@opensource.wolfsonmicro.com> |
| 6481 | M: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> | ||
| 6482 | T: git git://opensource.wolfsonmicro.com/linux-2.6-asoc | ||
| 6434 | T: git git://opensource.wolfsonmicro.com/linux-2.6-audioplus | 6483 | T: git git://opensource.wolfsonmicro.com/linux-2.6-audioplus |
| 6435 | W: http://opensource.wolfsonmicro.com/node/8 | 6484 | W: http://opensource.wolfsonmicro.com/content/linux-drivers-wolfson-devices |
| 6436 | S: Supported | 6485 | S: Supported |
| 6437 | F: Documentation/hwmon/wm83?? | 6486 | F: Documentation/hwmon/wm83?? |
| 6438 | F: drivers/leds/leds-wm83*.c | 6487 | F: drivers/leds/leds-wm83*.c |
| @@ -1,8 +1,8 @@ | |||
| 1 | VERSION = 2 | 1 | VERSION = 2 |
| 2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
| 3 | SUBLEVEL = 36 | 3 | SUBLEVEL = 36 |
| 4 | EXTRAVERSION = -rc4 | 4 | EXTRAVERSION = -rc8 |
| 5 | NAME = Sheep on Meth | 5 | NAME = Flesh-Eating Bats with Fangs |
| 6 | 6 | ||
| 7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
| 8 | # To see a list of typical targets execute "make help" | 8 | # To see a list of typical targets execute "make help" |
diff --git a/arch/Kconfig b/arch/Kconfig index 4877a8c8ee16..fe48fc7a3eba 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
| @@ -32,8 +32,9 @@ config HAVE_OPROFILE | |||
| 32 | 32 | ||
| 33 | config KPROBES | 33 | config KPROBES |
| 34 | bool "Kprobes" | 34 | bool "Kprobes" |
| 35 | depends on KALLSYMS && MODULES | 35 | depends on MODULES |
| 36 | depends on HAVE_KPROBES | 36 | depends on HAVE_KPROBES |
| 37 | select KALLSYMS | ||
| 37 | help | 38 | help |
| 38 | Kprobes allows you to trap at almost any kernel address and | 39 | Kprobes allows you to trap at almost any kernel address and |
| 39 | execute a callback function. register_kprobe() establishes | 40 | execute a callback function. register_kprobe() establishes |
| @@ -45,7 +46,6 @@ config OPTPROBES | |||
| 45 | def_bool y | 46 | def_bool y |
| 46 | depends on KPROBES && HAVE_OPTPROBES | 47 | depends on KPROBES && HAVE_OPTPROBES |
| 47 | depends on !PREEMPT | 48 | depends on !PREEMPT |
| 48 | select KALLSYMS_ALL | ||
| 49 | 49 | ||
| 50 | config HAVE_EFFICIENT_UNALIGNED_ACCESS | 50 | config HAVE_EFFICIENT_UNALIGNED_ACCESS |
| 51 | bool | 51 | bool |
diff --git a/arch/alpha/include/asm/cacheflush.h b/arch/alpha/include/asm/cacheflush.h index 01d71e1c8a9e..012f1243b1c1 100644 --- a/arch/alpha/include/asm/cacheflush.h +++ b/arch/alpha/include/asm/cacheflush.h | |||
| @@ -43,6 +43,8 @@ extern void smp_imb(void); | |||
| 43 | /* ??? Ought to use this in arch/alpha/kernel/signal.c too. */ | 43 | /* ??? Ought to use this in arch/alpha/kernel/signal.c too. */ |
| 44 | 44 | ||
| 45 | #ifndef CONFIG_SMP | 45 | #ifndef CONFIG_SMP |
| 46 | #include <linux/sched.h> | ||
| 47 | |||
| 46 | extern void __load_new_mm_context(struct mm_struct *); | 48 | extern void __load_new_mm_context(struct mm_struct *); |
| 47 | static inline void | 49 | static inline void |
| 48 | flush_icache_user_range(struct vm_area_struct *vma, struct page *page, | 50 | flush_icache_user_range(struct vm_area_struct *vma, struct page *page, |
diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h index 804e5311c841..058937bf5a77 100644 --- a/arch/alpha/include/asm/unistd.h +++ b/arch/alpha/include/asm/unistd.h | |||
| @@ -449,10 +449,13 @@ | |||
| 449 | #define __NR_pwritev 491 | 449 | #define __NR_pwritev 491 |
| 450 | #define __NR_rt_tgsigqueueinfo 492 | 450 | #define __NR_rt_tgsigqueueinfo 492 |
| 451 | #define __NR_perf_event_open 493 | 451 | #define __NR_perf_event_open 493 |
| 452 | #define __NR_fanotify_init 494 | ||
| 453 | #define __NR_fanotify_mark 495 | ||
| 454 | #define __NR_prlimit64 496 | ||
| 452 | 455 | ||
| 453 | #ifdef __KERNEL__ | 456 | #ifdef __KERNEL__ |
| 454 | 457 | ||
| 455 | #define NR_SYSCALLS 494 | 458 | #define NR_SYSCALLS 497 |
| 456 | 459 | ||
| 457 | #define __ARCH_WANT_IPC_PARSE_VERSION | 460 | #define __ARCH_WANT_IPC_PARSE_VERSION |
| 458 | #define __ARCH_WANT_OLD_READDIR | 461 | #define __ARCH_WANT_OLD_READDIR |
| @@ -463,6 +466,7 @@ | |||
| 463 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | 466 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT |
| 464 | #define __ARCH_WANT_SYS_OLDUMOUNT | 467 | #define __ARCH_WANT_SYS_OLDUMOUNT |
| 465 | #define __ARCH_WANT_SYS_SIGPENDING | 468 | #define __ARCH_WANT_SYS_SIGPENDING |
| 469 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | ||
| 466 | 470 | ||
| 467 | /* "Conditional" syscalls. What we want is | 471 | /* "Conditional" syscalls. What we want is |
| 468 | 472 | ||
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S index b45d913a51c3..6d159cee5f2f 100644 --- a/arch/alpha/kernel/entry.S +++ b/arch/alpha/kernel/entry.S | |||
| @@ -73,8 +73,6 @@ | |||
| 73 | ldq $20, HAE_REG($19); \ | 73 | ldq $20, HAE_REG($19); \ |
| 74 | stq $21, HAE_CACHE($19); \ | 74 | stq $21, HAE_CACHE($19); \ |
| 75 | stq $21, 0($20); \ | 75 | stq $21, 0($20); \ |
| 76 | ldq $0, 0($sp); \ | ||
| 77 | ldq $1, 8($sp); \ | ||
| 78 | 99:; \ | 76 | 99:; \ |
| 79 | ldq $19, 72($sp); \ | 77 | ldq $19, 72($sp); \ |
| 80 | ldq $20, 80($sp); \ | 78 | ldq $20, 80($sp); \ |
| @@ -316,19 +314,24 @@ ret_from_sys_call: | |||
| 316 | cmovne $26, 0, $19 /* $19 = 0 => non-restartable */ | 314 | cmovne $26, 0, $19 /* $19 = 0 => non-restartable */ |
| 317 | ldq $0, SP_OFF($sp) | 315 | ldq $0, SP_OFF($sp) |
| 318 | and $0, 8, $0 | 316 | and $0, 8, $0 |
| 319 | beq $0, restore_all | 317 | beq $0, ret_to_kernel |
| 320 | ret_from_reschedule: | 318 | ret_to_user: |
| 321 | /* Make sure need_resched and sigpending don't change between | 319 | /* Make sure need_resched and sigpending don't change between |
| 322 | sampling and the rti. */ | 320 | sampling and the rti. */ |
| 323 | lda $16, 7 | 321 | lda $16, 7 |
| 324 | call_pal PAL_swpipl | 322 | call_pal PAL_swpipl |
| 325 | ldl $5, TI_FLAGS($8) | 323 | ldl $5, TI_FLAGS($8) |
| 326 | and $5, _TIF_WORK_MASK, $2 | 324 | and $5, _TIF_WORK_MASK, $2 |
| 327 | bne $5, work_pending | 325 | bne $2, work_pending |
| 328 | restore_all: | 326 | restore_all: |
| 329 | RESTORE_ALL | 327 | RESTORE_ALL |
| 330 | call_pal PAL_rti | 328 | call_pal PAL_rti |
| 331 | 329 | ||
| 330 | ret_to_kernel: | ||
| 331 | lda $16, 7 | ||
| 332 | call_pal PAL_swpipl | ||
| 333 | br restore_all | ||
| 334 | |||
| 332 | .align 3 | 335 | .align 3 |
| 333 | $syscall_error: | 336 | $syscall_error: |
| 334 | /* | 337 | /* |
| @@ -363,7 +366,7 @@ $ret_success: | |||
| 363 | * $8: current. | 366 | * $8: current. |
| 364 | * $19: The old syscall number, or zero if this is not a return | 367 | * $19: The old syscall number, or zero if this is not a return |
| 365 | * from a syscall that errored and is possibly restartable. | 368 | * from a syscall that errored and is possibly restartable. |
| 366 | * $20: Error indication. | 369 | * $20: The old a3 value |
| 367 | */ | 370 | */ |
| 368 | 371 | ||
| 369 | .align 4 | 372 | .align 4 |
| @@ -392,12 +395,18 @@ $work_resched: | |||
| 392 | 395 | ||
| 393 | $work_notifysig: | 396 | $work_notifysig: |
| 394 | mov $sp, $16 | 397 | mov $sp, $16 |
| 395 | br $1, do_switch_stack | 398 | bsr $1, do_switch_stack |
| 396 | mov $sp, $17 | 399 | mov $sp, $17 |
| 397 | mov $5, $18 | 400 | mov $5, $18 |
| 401 | mov $19, $9 /* save old syscall number */ | ||
| 402 | mov $20, $10 /* save old a3 */ | ||
| 403 | and $5, _TIF_SIGPENDING, $2 | ||
| 404 | cmovne $2, 0, $9 /* we don't want double syscall restarts */ | ||
| 398 | jsr $26, do_notify_resume | 405 | jsr $26, do_notify_resume |
| 406 | mov $9, $19 | ||
| 407 | mov $10, $20 | ||
| 399 | bsr $1, undo_switch_stack | 408 | bsr $1, undo_switch_stack |
| 400 | br restore_all | 409 | br ret_to_user |
| 401 | .end work_pending | 410 | .end work_pending |
| 402 | 411 | ||
| 403 | /* | 412 | /* |
| @@ -430,6 +439,7 @@ strace: | |||
| 430 | beq $1, 1f | 439 | beq $1, 1f |
| 431 | ldq $27, 0($2) | 440 | ldq $27, 0($2) |
| 432 | 1: jsr $26, ($27), sys_gettimeofday | 441 | 1: jsr $26, ($27), sys_gettimeofday |
| 442 | ret_from_straced: | ||
| 433 | ldgp $gp, 0($26) | 443 | ldgp $gp, 0($26) |
| 434 | 444 | ||
| 435 | /* check return.. */ | 445 | /* check return.. */ |
| @@ -650,7 +660,7 @@ kernel_thread: | |||
| 650 | /* We don't actually care for a3 success widgetry in the kernel. | 660 | /* We don't actually care for a3 success widgetry in the kernel. |
| 651 | Not for positive errno values. */ | 661 | Not for positive errno values. */ |
| 652 | stq $0, 0($sp) /* $0 */ | 662 | stq $0, 0($sp) /* $0 */ |
| 653 | br restore_all | 663 | br ret_to_kernel |
| 654 | .end kernel_thread | 664 | .end kernel_thread |
| 655 | 665 | ||
| 656 | /* | 666 | /* |
| @@ -757,11 +767,15 @@ sys_vfork: | |||
| 757 | .ent sys_sigreturn | 767 | .ent sys_sigreturn |
| 758 | sys_sigreturn: | 768 | sys_sigreturn: |
| 759 | .prologue 0 | 769 | .prologue 0 |
| 770 | lda $9, ret_from_straced | ||
| 771 | cmpult $26, $9, $9 | ||
| 760 | mov $sp, $17 | 772 | mov $sp, $17 |
| 761 | lda $18, -SWITCH_STACK_SIZE($sp) | 773 | lda $18, -SWITCH_STACK_SIZE($sp) |
| 762 | lda $sp, -SWITCH_STACK_SIZE($sp) | 774 | lda $sp, -SWITCH_STACK_SIZE($sp) |
| 763 | jsr $26, do_sigreturn | 775 | jsr $26, do_sigreturn |
| 764 | br $1, undo_switch_stack | 776 | bne $9, 1f |
| 777 | jsr $26, syscall_trace | ||
| 778 | 1: br $1, undo_switch_stack | ||
| 765 | br ret_from_sys_call | 779 | br ret_from_sys_call |
| 766 | .end sys_sigreturn | 780 | .end sys_sigreturn |
| 767 | 781 | ||
| @@ -770,47 +784,19 @@ sys_sigreturn: | |||
| 770 | .ent sys_rt_sigreturn | 784 | .ent sys_rt_sigreturn |
| 771 | sys_rt_sigreturn: | 785 | sys_rt_sigreturn: |
| 772 | .prologue 0 | 786 | .prologue 0 |
| 787 | lda $9, ret_from_straced | ||
| 788 | cmpult $26, $9, $9 | ||
| 773 | mov $sp, $17 | 789 | mov $sp, $17 |
| 774 | lda $18, -SWITCH_STACK_SIZE($sp) | 790 | lda $18, -SWITCH_STACK_SIZE($sp) |
| 775 | lda $sp, -SWITCH_STACK_SIZE($sp) | 791 | lda $sp, -SWITCH_STACK_SIZE($sp) |
| 776 | jsr $26, do_rt_sigreturn | 792 | jsr $26, do_rt_sigreturn |
| 777 | br $1, undo_switch_stack | 793 | bne $9, 1f |
| 794 | jsr $26, syscall_trace | ||
| 795 | 1: br $1, undo_switch_stack | ||
| 778 | br ret_from_sys_call | 796 | br ret_from_sys_call |
| 779 | .end sys_rt_sigreturn | 797 | .end sys_rt_sigreturn |
| 780 | 798 | ||
| 781 | .align 4 | 799 | .align 4 |
| 782 | .globl sys_sigsuspend | ||
| 783 | .ent sys_sigsuspend | ||
| 784 | sys_sigsuspend: | ||
| 785 | .prologue 0 | ||
| 786 | mov $sp, $17 | ||
| 787 | br $1, do_switch_stack | ||
| 788 | mov $sp, $18 | ||
| 789 | subq $sp, 16, $sp | ||
| 790 | stq $26, 0($sp) | ||
| 791 | jsr $26, do_sigsuspend | ||
| 792 | ldq $26, 0($sp) | ||
| 793 | lda $sp, SWITCH_STACK_SIZE+16($sp) | ||
| 794 | ret | ||
| 795 | .end sys_sigsuspend | ||
| 796 | |||
| 797 | .align 4 | ||
| 798 | .globl sys_rt_sigsuspend | ||
| 799 | .ent sys_rt_sigsuspend | ||
| 800 | sys_rt_sigsuspend: | ||
| 801 | .prologue 0 | ||
| 802 | mov $sp, $18 | ||
| 803 | br $1, do_switch_stack | ||
| 804 | mov $sp, $19 | ||
| 805 | subq $sp, 16, $sp | ||
| 806 | stq $26, 0($sp) | ||
| 807 | jsr $26, do_rt_sigsuspend | ||
| 808 | ldq $26, 0($sp) | ||
| 809 | lda $sp, SWITCH_STACK_SIZE+16($sp) | ||
| 810 | ret | ||
| 811 | .end sys_rt_sigsuspend | ||
| 812 | |||
| 813 | .align 4 | ||
| 814 | .globl sys_sethae | 800 | .globl sys_sethae |
| 815 | .ent sys_sethae | 801 | .ent sys_sethae |
| 816 | sys_sethae: | 802 | sys_sethae: |
| @@ -929,15 +915,6 @@ sys_execve: | |||
| 929 | .end sys_execve | 915 | .end sys_execve |
| 930 | 916 | ||
| 931 | .align 4 | 917 | .align 4 |
| 932 | .globl osf_sigprocmask | ||
| 933 | .ent osf_sigprocmask | ||
| 934 | osf_sigprocmask: | ||
| 935 | .prologue 0 | ||
| 936 | mov $sp, $18 | ||
| 937 | jmp $31, sys_osf_sigprocmask | ||
| 938 | .end osf_sigprocmask | ||
| 939 | |||
| 940 | .align 4 | ||
| 941 | .globl alpha_ni_syscall | 918 | .globl alpha_ni_syscall |
| 942 | .ent alpha_ni_syscall | 919 | .ent alpha_ni_syscall |
| 943 | alpha_ni_syscall: | 920 | alpha_ni_syscall: |
diff --git a/arch/alpha/kernel/err_ev6.c b/arch/alpha/kernel/err_ev6.c index 8ca6345bf131..253cf1a87481 100644 --- a/arch/alpha/kernel/err_ev6.c +++ b/arch/alpha/kernel/err_ev6.c | |||
| @@ -90,11 +90,13 @@ static int | |||
| 90 | ev6_parse_cbox(u64 c_addr, u64 c1_syn, u64 c2_syn, | 90 | ev6_parse_cbox(u64 c_addr, u64 c1_syn, u64 c2_syn, |
| 91 | u64 c_stat, u64 c_sts, int print) | 91 | u64 c_stat, u64 c_sts, int print) |
| 92 | { | 92 | { |
| 93 | char *sourcename[] = { "UNKNOWN", "UNKNOWN", "UNKNOWN", | 93 | static const char * const sourcename[] = { |
| 94 | "MEMORY", "BCACHE", "DCACHE", | 94 | "UNKNOWN", "UNKNOWN", "UNKNOWN", |
| 95 | "BCACHE PROBE", "BCACHE PROBE" }; | 95 | "MEMORY", "BCACHE", "DCACHE", |
| 96 | char *streamname[] = { "D", "I" }; | 96 | "BCACHE PROBE", "BCACHE PROBE" |
| 97 | char *bitsname[] = { "SINGLE", "DOUBLE" }; | 97 | }; |
| 98 | static const char * const streamname[] = { "D", "I" }; | ||
| 99 | static const char * const bitsname[] = { "SINGLE", "DOUBLE" }; | ||
| 98 | int status = MCHK_DISPOSITION_REPORT; | 100 | int status = MCHK_DISPOSITION_REPORT; |
| 99 | int source = -1, stream = -1, bits = -1; | 101 | int source = -1, stream = -1, bits = -1; |
| 100 | 102 | ||
diff --git a/arch/alpha/kernel/err_marvel.c b/arch/alpha/kernel/err_marvel.c index 5c905aaaeccd..648ae88aeb8a 100644 --- a/arch/alpha/kernel/err_marvel.c +++ b/arch/alpha/kernel/err_marvel.c | |||
| @@ -589,22 +589,23 @@ marvel_print_pox_spl_cmplt(u64 spl_cmplt) | |||
| 589 | static void | 589 | static void |
| 590 | marvel_print_pox_trans_sum(u64 trans_sum) | 590 | marvel_print_pox_trans_sum(u64 trans_sum) |
| 591 | { | 591 | { |
| 592 | char *pcix_cmd[] = { "Interrupt Acknowledge", | 592 | static const char * const pcix_cmd[] = { |
| 593 | "Special Cycle", | 593 | "Interrupt Acknowledge", |
| 594 | "I/O Read", | 594 | "Special Cycle", |
| 595 | "I/O Write", | 595 | "I/O Read", |
| 596 | "Reserved", | 596 | "I/O Write", |
| 597 | "Reserved / Device ID Message", | 597 | "Reserved", |
| 598 | "Memory Read", | 598 | "Reserved / Device ID Message", |
| 599 | "Memory Write", | 599 | "Memory Read", |
| 600 | "Reserved / Alias to Memory Read Block", | 600 | "Memory Write", |
| 601 | "Reserved / Alias to Memory Write Block", | 601 | "Reserved / Alias to Memory Read Block", |
| 602 | "Configuration Read", | 602 | "Reserved / Alias to Memory Write Block", |
| 603 | "Configuration Write", | 603 | "Configuration Read", |
| 604 | "Memory Read Multiple / Split Completion", | 604 | "Configuration Write", |
| 605 | "Dual Address Cycle", | 605 | "Memory Read Multiple / Split Completion", |
| 606 | "Memory Read Line / Memory Read Block", | 606 | "Dual Address Cycle", |
| 607 | "Memory Write and Invalidate / Memory Write Block" | 607 | "Memory Read Line / Memory Read Block", |
| 608 | "Memory Write and Invalidate / Memory Write Block" | ||
| 608 | }; | 609 | }; |
| 609 | 610 | ||
| 610 | #define IO7__POX_TRANSUM__PCI_ADDR__S (0) | 611 | #define IO7__POX_TRANSUM__PCI_ADDR__S (0) |
diff --git a/arch/alpha/kernel/err_titan.c b/arch/alpha/kernel/err_titan.c index f7ed97ce0dfd..c3b3781a03de 100644 --- a/arch/alpha/kernel/err_titan.c +++ b/arch/alpha/kernel/err_titan.c | |||
| @@ -75,8 +75,12 @@ titan_parse_p_serror(int which, u64 serror, int print) | |||
| 75 | int status = MCHK_DISPOSITION_REPORT; | 75 | int status = MCHK_DISPOSITION_REPORT; |
| 76 | 76 | ||
| 77 | #ifdef CONFIG_VERBOSE_MCHECK | 77 | #ifdef CONFIG_VERBOSE_MCHECK |
| 78 | char *serror_src[] = {"GPCI", "APCI", "AGP HP", "AGP LP"}; | 78 | static const char * const serror_src[] = { |
| 79 | char *serror_cmd[] = {"DMA Read", "DMA RMW", "SGTE Read", "Reserved"}; | 79 | "GPCI", "APCI", "AGP HP", "AGP LP" |
| 80 | }; | ||
| 81 | static const char * const serror_cmd[] = { | ||
| 82 | "DMA Read", "DMA RMW", "SGTE Read", "Reserved" | ||
| 83 | }; | ||
| 80 | #endif /* CONFIG_VERBOSE_MCHECK */ | 84 | #endif /* CONFIG_VERBOSE_MCHECK */ |
| 81 | 85 | ||
| 82 | #define TITAN__PCHIP_SERROR__LOST_UECC (1UL << 0) | 86 | #define TITAN__PCHIP_SERROR__LOST_UECC (1UL << 0) |
| @@ -140,14 +144,15 @@ titan_parse_p_perror(int which, int port, u64 perror, int print) | |||
| 140 | int status = MCHK_DISPOSITION_REPORT; | 144 | int status = MCHK_DISPOSITION_REPORT; |
| 141 | 145 | ||
| 142 | #ifdef CONFIG_VERBOSE_MCHECK | 146 | #ifdef CONFIG_VERBOSE_MCHECK |
| 143 | char *perror_cmd[] = { "Interrupt Acknowledge", "Special Cycle", | 147 | static const char * const perror_cmd[] = { |
| 144 | "I/O Read", "I/O Write", | 148 | "Interrupt Acknowledge", "Special Cycle", |
| 145 | "Reserved", "Reserved", | 149 | "I/O Read", "I/O Write", |
| 146 | "Memory Read", "Memory Write", | 150 | "Reserved", "Reserved", |
| 147 | "Reserved", "Reserved", | 151 | "Memory Read", "Memory Write", |
| 148 | "Configuration Read", "Configuration Write", | 152 | "Reserved", "Reserved", |
| 149 | "Memory Read Multiple", "Dual Address Cycle", | 153 | "Configuration Read", "Configuration Write", |
| 150 | "Memory Read Line","Memory Write and Invalidate" | 154 | "Memory Read Multiple", "Dual Address Cycle", |
| 155 | "Memory Read Line", "Memory Write and Invalidate" | ||
| 151 | }; | 156 | }; |
| 152 | #endif /* CONFIG_VERBOSE_MCHECK */ | 157 | #endif /* CONFIG_VERBOSE_MCHECK */ |
| 153 | 158 | ||
| @@ -273,11 +278,11 @@ titan_parse_p_agperror(int which, u64 agperror, int print) | |||
| 273 | int cmd, len; | 278 | int cmd, len; |
| 274 | unsigned long addr; | 279 | unsigned long addr; |
| 275 | 280 | ||
| 276 | char *agperror_cmd[] = { "Read (low-priority)", "Read (high-priority)", | 281 | static const char * const agperror_cmd[] = { |
| 277 | "Write (low-priority)", | 282 | "Read (low-priority)", "Read (high-priority)", |
| 278 | "Write (high-priority)", | 283 | "Write (low-priority)", "Write (high-priority)", |
| 279 | "Reserved", "Reserved", | 284 | "Reserved", "Reserved", |
| 280 | "Flush", "Fence" | 285 | "Flush", "Fence" |
| 281 | }; | 286 | }; |
| 282 | #endif /* CONFIG_VERBOSE_MCHECK */ | 287 | #endif /* CONFIG_VERBOSE_MCHECK */ |
| 283 | 288 | ||
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 5d1e6d6ce684..547e8b84b2f7 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
| 16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
| 17 | #include <linux/smp.h> | 17 | #include <linux/smp.h> |
| 18 | #include <linux/smp_lock.h> | ||
| 19 | #include <linux/stddef.h> | 18 | #include <linux/stddef.h> |
| 20 | #include <linux/syscalls.h> | 19 | #include <linux/syscalls.h> |
| 21 | #include <linux/unistd.h> | 20 | #include <linux/unistd.h> |
| @@ -69,7 +68,6 @@ SYSCALL_DEFINE4(osf_set_program_attributes, unsigned long, text_start, | |||
| 69 | { | 68 | { |
| 70 | struct mm_struct *mm; | 69 | struct mm_struct *mm; |
| 71 | 70 | ||
| 72 | lock_kernel(); | ||
| 73 | mm = current->mm; | 71 | mm = current->mm; |
| 74 | mm->end_code = bss_start + bss_len; | 72 | mm->end_code = bss_start + bss_len; |
| 75 | mm->start_brk = bss_start + bss_len; | 73 | mm->start_brk = bss_start + bss_len; |
| @@ -78,7 +76,6 @@ SYSCALL_DEFINE4(osf_set_program_attributes, unsigned long, text_start, | |||
| 78 | printk("set_program_attributes(%lx %lx %lx %lx)\n", | 76 | printk("set_program_attributes(%lx %lx %lx %lx)\n", |
| 79 | text_start, text_len, bss_start, bss_len); | 77 | text_start, text_len, bss_start, bss_len); |
| 80 | #endif | 78 | #endif |
| 81 | unlock_kernel(); | ||
| 82 | return 0; | 79 | return 0; |
| 83 | } | 80 | } |
| 84 | 81 | ||
| @@ -517,7 +514,6 @@ SYSCALL_DEFINE2(osf_proplist_syscall, enum pl_code, code, | |||
| 517 | long error; | 514 | long error; |
| 518 | int __user *min_buf_size_ptr; | 515 | int __user *min_buf_size_ptr; |
| 519 | 516 | ||
| 520 | lock_kernel(); | ||
| 521 | switch (code) { | 517 | switch (code) { |
| 522 | case PL_SET: | 518 | case PL_SET: |
| 523 | if (get_user(error, &args->set.nbytes)) | 519 | if (get_user(error, &args->set.nbytes)) |
| @@ -547,7 +543,6 @@ SYSCALL_DEFINE2(osf_proplist_syscall, enum pl_code, code, | |||
| 547 | error = -EOPNOTSUPP; | 543 | error = -EOPNOTSUPP; |
| 548 | break; | 544 | break; |
| 549 | }; | 545 | }; |
| 550 | unlock_kernel(); | ||
| 551 | return error; | 546 | return error; |
| 552 | } | 547 | } |
| 553 | 548 | ||
| @@ -594,7 +589,7 @@ SYSCALL_DEFINE2(osf_sigstack, struct sigstack __user *, uss, | |||
| 594 | 589 | ||
| 595 | SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count) | 590 | SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count) |
| 596 | { | 591 | { |
| 597 | char *sysinfo_table[] = { | 592 | const char *sysinfo_table[] = { |
| 598 | utsname()->sysname, | 593 | utsname()->sysname, |
| 599 | utsname()->nodename, | 594 | utsname()->nodename, |
| 600 | utsname()->release, | 595 | utsname()->release, |
| @@ -606,7 +601,7 @@ SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count) | |||
| 606 | "dummy", /* secure RPC domain */ | 601 | "dummy", /* secure RPC domain */ |
| 607 | }; | 602 | }; |
| 608 | unsigned long offset; | 603 | unsigned long offset; |
| 609 | char *res; | 604 | const char *res; |
| 610 | long len, err = -EINVAL; | 605 | long len, err = -EINVAL; |
| 611 | 606 | ||
| 612 | offset = command-1; | 607 | offset = command-1; |
diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c index 738fc824e2ea..b899e95f79fd 100644 --- a/arch/alpha/kernel/pci-sysfs.c +++ b/arch/alpha/kernel/pci-sysfs.c | |||
| @@ -66,7 +66,7 @@ static int pci_mmap_resource(struct kobject *kobj, | |||
| 66 | { | 66 | { |
| 67 | struct pci_dev *pdev = to_pci_dev(container_of(kobj, | 67 | struct pci_dev *pdev = to_pci_dev(container_of(kobj, |
| 68 | struct device, kobj)); | 68 | struct device, kobj)); |
| 69 | struct resource *res = (struct resource *)attr->private; | 69 | struct resource *res = attr->private; |
| 70 | enum pci_mmap_state mmap_type; | 70 | enum pci_mmap_state mmap_type; |
| 71 | struct pci_bus_region bar; | 71 | struct pci_bus_region bar; |
| 72 | int i; | 72 | int i; |
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 842dba308eab..3ec35066f1dc 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
| @@ -356,7 +356,7 @@ dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt, struct thread_info *ti) | |||
| 356 | dest[27] = pt->r27; | 356 | dest[27] = pt->r27; |
| 357 | dest[28] = pt->r28; | 357 | dest[28] = pt->r28; |
| 358 | dest[29] = pt->gp; | 358 | dest[29] = pt->gp; |
| 359 | dest[30] = rdusp(); | 359 | dest[30] = ti == current_thread_info() ? rdusp() : ti->pcb.usp; |
| 360 | dest[31] = pt->pc; | 360 | dest[31] = pt->pc; |
| 361 | 361 | ||
| 362 | /* Once upon a time this was the PS value. Which is stupid | 362 | /* Once upon a time this was the PS value. Which is stupid |
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c index 0932dbb1ef8e..6f7feb5db271 100644 --- a/arch/alpha/kernel/signal.c +++ b/arch/alpha/kernel/signal.c | |||
| @@ -41,46 +41,20 @@ static void do_signal(struct pt_regs *, struct switch_stack *, | |||
| 41 | /* | 41 | /* |
| 42 | * The OSF/1 sigprocmask calling sequence is different from the | 42 | * The OSF/1 sigprocmask calling sequence is different from the |
| 43 | * C sigprocmask() sequence.. | 43 | * C sigprocmask() sequence.. |
| 44 | * | ||
| 45 | * how: | ||
| 46 | * 1 - SIG_BLOCK | ||
| 47 | * 2 - SIG_UNBLOCK | ||
| 48 | * 3 - SIG_SETMASK | ||
| 49 | * | ||
| 50 | * We change the range to -1 .. 1 in order to let gcc easily | ||
| 51 | * use the conditional move instructions. | ||
| 52 | * | ||
| 53 | * Note that we don't need to acquire the kernel lock for SMP | ||
| 54 | * operation, as all of this is local to this thread. | ||
| 55 | */ | 44 | */ |
| 56 | SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask, | 45 | SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask) |
| 57 | struct pt_regs *, regs) | ||
| 58 | { | 46 | { |
| 59 | unsigned long oldmask = -EINVAL; | 47 | sigset_t oldmask; |
| 60 | 48 | sigset_t mask; | |
| 61 | if ((unsigned long)how-1 <= 2) { | 49 | unsigned long res; |
| 62 | long sign = how-2; /* -1 .. 1 */ | 50 | |
| 63 | unsigned long block, unblock; | 51 | siginitset(&mask, newmask & _BLOCKABLE); |
| 64 | 52 | res = sigprocmask(how, &mask, &oldmask); | |
| 65 | newmask &= _BLOCKABLE; | 53 | if (!res) { |
| 66 | spin_lock_irq(¤t->sighand->siglock); | 54 | force_successful_syscall_return(); |
| 67 | oldmask = current->blocked.sig[0]; | 55 | res = oldmask.sig[0]; |
| 68 | |||
| 69 | unblock = oldmask & ~newmask; | ||
| 70 | block = oldmask | newmask; | ||
| 71 | if (!sign) | ||
| 72 | block = unblock; | ||
| 73 | if (sign <= 0) | ||
| 74 | newmask = block; | ||
| 75 | if (_NSIG_WORDS > 1 && sign > 0) | ||
| 76 | sigemptyset(¤t->blocked); | ||
| 77 | current->blocked.sig[0] = newmask; | ||
| 78 | recalc_sigpending(); | ||
| 79 | spin_unlock_irq(¤t->sighand->siglock); | ||
| 80 | |||
| 81 | regs->r0 = 0; /* special no error return */ | ||
| 82 | } | 56 | } |
| 83 | return oldmask; | 57 | return res; |
| 84 | } | 58 | } |
| 85 | 59 | ||
| 86 | SYSCALL_DEFINE3(osf_sigaction, int, sig, | 60 | SYSCALL_DEFINE3(osf_sigaction, int, sig, |
| @@ -94,9 +68,9 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig, | |||
| 94 | old_sigset_t mask; | 68 | old_sigset_t mask; |
| 95 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | 69 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || |
| 96 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | 70 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || |
| 97 | __get_user(new_ka.sa.sa_flags, &act->sa_flags)) | 71 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || |
| 72 | __get_user(mask, &act->sa_mask)) | ||
| 98 | return -EFAULT; | 73 | return -EFAULT; |
| 99 | __get_user(mask, &act->sa_mask); | ||
| 100 | siginitset(&new_ka.sa.sa_mask, mask); | 74 | siginitset(&new_ka.sa.sa_mask, mask); |
| 101 | new_ka.ka_restorer = NULL; | 75 | new_ka.ka_restorer = NULL; |
| 102 | } | 76 | } |
| @@ -106,9 +80,9 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig, | |||
| 106 | if (!ret && oact) { | 80 | if (!ret && oact) { |
| 107 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | 81 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || |
| 108 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | 82 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || |
| 109 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags)) | 83 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || |
| 84 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
| 110 | return -EFAULT; | 85 | return -EFAULT; |
| 111 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); | ||
| 112 | } | 86 | } |
| 113 | 87 | ||
| 114 | return ret; | 88 | return ret; |
| @@ -144,8 +118,7 @@ SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act, | |||
| 144 | /* | 118 | /* |
| 145 | * Atomically swap in the new signal mask, and wait for a signal. | 119 | * Atomically swap in the new signal mask, and wait for a signal. |
| 146 | */ | 120 | */ |
| 147 | asmlinkage int | 121 | SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask) |
| 148 | do_sigsuspend(old_sigset_t mask, struct pt_regs *regs, struct switch_stack *sw) | ||
| 149 | { | 122 | { |
| 150 | mask &= _BLOCKABLE; | 123 | mask &= _BLOCKABLE; |
| 151 | spin_lock_irq(¤t->sighand->siglock); | 124 | spin_lock_irq(¤t->sighand->siglock); |
| @@ -154,41 +127,6 @@ do_sigsuspend(old_sigset_t mask, struct pt_regs *regs, struct switch_stack *sw) | |||
| 154 | recalc_sigpending(); | 127 | recalc_sigpending(); |
| 155 | spin_unlock_irq(¤t->sighand->siglock); | 128 | spin_unlock_irq(¤t->sighand->siglock); |
| 156 | 129 | ||
| 157 | /* Indicate EINTR on return from any possible signal handler, | ||
| 158 | which will not come back through here, but via sigreturn. */ | ||
| 159 | regs->r0 = EINTR; | ||
| 160 | regs->r19 = 1; | ||
| 161 | |||
| 162 | current->state = TASK_INTERRUPTIBLE; | ||
| 163 | schedule(); | ||
| 164 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
| 165 | return -ERESTARTNOHAND; | ||
| 166 | } | ||
| 167 | |||
| 168 | asmlinkage int | ||
| 169 | do_rt_sigsuspend(sigset_t __user *uset, size_t sigsetsize, | ||
| 170 | struct pt_regs *regs, struct switch_stack *sw) | ||
| 171 | { | ||
| 172 | sigset_t set; | ||
| 173 | |||
| 174 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
| 175 | if (sigsetsize != sizeof(sigset_t)) | ||
| 176 | return -EINVAL; | ||
| 177 | if (copy_from_user(&set, uset, sizeof(set))) | ||
| 178 | return -EFAULT; | ||
| 179 | |||
| 180 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
| 181 | spin_lock_irq(¤t->sighand->siglock); | ||
| 182 | current->saved_sigmask = current->blocked; | ||
| 183 | current->blocked = set; | ||
| 184 | recalc_sigpending(); | ||
| 185 | spin_unlock_irq(¤t->sighand->siglock); | ||
| 186 | |||
| 187 | /* Indicate EINTR on return from any possible signal handler, | ||
| 188 | which will not come back through here, but via sigreturn. */ | ||
| 189 | regs->r0 = EINTR; | ||
| 190 | regs->r19 = 1; | ||
| 191 | |||
| 192 | current->state = TASK_INTERRUPTIBLE; | 130 | current->state = TASK_INTERRUPTIBLE; |
| 193 | schedule(); | 131 | schedule(); |
| 194 | set_thread_flag(TIF_RESTORE_SIGMASK); | 132 | set_thread_flag(TIF_RESTORE_SIGMASK); |
| @@ -239,6 +177,8 @@ restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, | |||
| 239 | unsigned long usp; | 177 | unsigned long usp; |
| 240 | long i, err = __get_user(regs->pc, &sc->sc_pc); | 178 | long i, err = __get_user(regs->pc, &sc->sc_pc); |
| 241 | 179 | ||
| 180 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | ||
| 181 | |||
| 242 | sw->r26 = (unsigned long) ret_from_sys_call; | 182 | sw->r26 = (unsigned long) ret_from_sys_call; |
| 243 | 183 | ||
| 244 | err |= __get_user(regs->r0, sc->sc_regs+0); | 184 | err |= __get_user(regs->r0, sc->sc_regs+0); |
| @@ -591,7 +531,6 @@ syscall_restart(unsigned long r0, unsigned long r19, | |||
| 591 | regs->pc -= 4; | 531 | regs->pc -= 4; |
| 592 | break; | 532 | break; |
| 593 | case ERESTART_RESTARTBLOCK: | 533 | case ERESTART_RESTARTBLOCK: |
| 594 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | ||
| 595 | regs->r0 = EINTR; | 534 | regs->r0 = EINTR; |
| 596 | break; | 535 | break; |
| 597 | } | 536 | } |
diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c index 4afc1a1e2e5a..f0df3fbd8402 100644 --- a/arch/alpha/kernel/srm_env.c +++ b/arch/alpha/kernel/srm_env.c | |||
| @@ -87,7 +87,7 @@ static int srm_env_proc_show(struct seq_file *m, void *v) | |||
| 87 | srm_env_t *entry; | 87 | srm_env_t *entry; |
| 88 | char *page; | 88 | char *page; |
| 89 | 89 | ||
| 90 | entry = (srm_env_t *)m->private; | 90 | entry = m->private; |
| 91 | page = (char *)__get_free_page(GFP_USER); | 91 | page = (char *)__get_free_page(GFP_USER); |
| 92 | if (!page) | 92 | if (!page) |
| 93 | return -ENOMEM; | 93 | return -ENOMEM; |
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S index 09acb786e72b..a6a1de9db16f 100644 --- a/arch/alpha/kernel/systbls.S +++ b/arch/alpha/kernel/systbls.S | |||
| @@ -58,7 +58,7 @@ sys_call_table: | |||
| 58 | .quad sys_open /* 45 */ | 58 | .quad sys_open /* 45 */ |
| 59 | .quad alpha_ni_syscall | 59 | .quad alpha_ni_syscall |
| 60 | .quad sys_getxgid | 60 | .quad sys_getxgid |
| 61 | .quad osf_sigprocmask | 61 | .quad sys_osf_sigprocmask |
| 62 | .quad alpha_ni_syscall | 62 | .quad alpha_ni_syscall |
| 63 | .quad alpha_ni_syscall /* 50 */ | 63 | .quad alpha_ni_syscall /* 50 */ |
| 64 | .quad sys_acct | 64 | .quad sys_acct |
| @@ -512,6 +512,9 @@ sys_call_table: | |||
| 512 | .quad sys_pwritev | 512 | .quad sys_pwritev |
| 513 | .quad sys_rt_tgsigqueueinfo | 513 | .quad sys_rt_tgsigqueueinfo |
| 514 | .quad sys_perf_event_open | 514 | .quad sys_perf_event_open |
| 515 | .quad sys_fanotify_init | ||
| 516 | .quad sys_fanotify_mark /* 495 */ | ||
| 517 | .quad sys_prlimit64 | ||
| 515 | 518 | ||
| 516 | .size sys_call_table, . - sys_call_table | 519 | .size sys_call_table, . - sys_call_table |
| 517 | .type sys_call_table, @object | 520 | .type sys_call_table, @object |
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index eacceb26d9c8..396af1799ea4 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c | |||
| @@ -191,16 +191,16 @@ irqreturn_t timer_interrupt(int irq, void *dev) | |||
| 191 | 191 | ||
| 192 | write_sequnlock(&xtime_lock); | 192 | write_sequnlock(&xtime_lock); |
| 193 | 193 | ||
| 194 | #ifndef CONFIG_SMP | ||
| 195 | while (nticks--) | ||
| 196 | update_process_times(user_mode(get_irq_regs())); | ||
| 197 | #endif | ||
| 198 | |||
| 199 | if (test_perf_event_pending()) { | 194 | if (test_perf_event_pending()) { |
| 200 | clear_perf_event_pending(); | 195 | clear_perf_event_pending(); |
| 201 | perf_event_do_pending(); | 196 | perf_event_do_pending(); |
| 202 | } | 197 | } |
| 203 | 198 | ||
| 199 | #ifndef CONFIG_SMP | ||
| 200 | while (nticks--) | ||
| 201 | update_process_times(user_mode(get_irq_regs())); | ||
| 202 | #endif | ||
| 203 | |||
| 204 | return IRQ_HANDLED; | 204 | return IRQ_HANDLED; |
| 205 | } | 205 | } |
| 206 | 206 | ||
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index b14f015008ad..0414e021a91c 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
| 14 | #include <linux/tty.h> | 14 | #include <linux/tty.h> |
| 15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
| 16 | #include <linux/smp_lock.h> | ||
| 17 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| 18 | #include <linux/init.h> | 17 | #include <linux/init.h> |
| 19 | #include <linux/kallsyms.h> | 18 | #include <linux/kallsyms.h> |
| @@ -623,7 +622,6 @@ do_entUna(void * va, unsigned long opcode, unsigned long reg, | |||
| 623 | return; | 622 | return; |
| 624 | } | 623 | } |
| 625 | 624 | ||
| 626 | lock_kernel(); | ||
| 627 | printk("Bad unaligned kernel access at %016lx: %p %lx %lu\n", | 625 | printk("Bad unaligned kernel access at %016lx: %p %lx %lu\n", |
| 628 | pc, va, opcode, reg); | 626 | pc, va, opcode, reg); |
| 629 | do_exit(SIGSEGV); | 627 | do_exit(SIGSEGV); |
| @@ -646,7 +644,6 @@ got_exception: | |||
| 646 | * Yikes! No one to forward the exception to. | 644 | * Yikes! No one to forward the exception to. |
| 647 | * Since the registers are in a weird format, dump them ourselves. | 645 | * Since the registers are in a weird format, dump them ourselves. |
| 648 | */ | 646 | */ |
| 649 | lock_kernel(); | ||
| 650 | 647 | ||
| 651 | printk("%s(%d): unhandled unaligned exception\n", | 648 | printk("%s(%d): unhandled unaligned exception\n", |
| 652 | current->comm, task_pid_nr(current)); | 649 | current->comm, task_pid_nr(current)); |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 553b7cf17bfb..9c26ba7244fb 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -271,7 +271,6 @@ config ARCH_AT91 | |||
| 271 | bool "Atmel AT91" | 271 | bool "Atmel AT91" |
| 272 | select ARCH_REQUIRE_GPIOLIB | 272 | select ARCH_REQUIRE_GPIOLIB |
| 273 | select HAVE_CLK | 273 | select HAVE_CLK |
| 274 | select ARCH_USES_GETTIMEOFFSET | ||
| 275 | help | 274 | help |
| 276 | This enables support for systems based on the Atmel AT91RM9200, | 275 | This enables support for systems based on the Atmel AT91RM9200, |
| 277 | AT91SAM9 and AT91CAP9 processors. | 276 | AT91SAM9 and AT91CAP9 processors. |
| @@ -1051,6 +1050,32 @@ config ARM_ERRATA_460075 | |||
| 1051 | ACTLR register. Note that setting specific bits in the ACTLR register | 1050 | ACTLR register. Note that setting specific bits in the ACTLR register |
| 1052 | may not be available in non-secure mode. | 1051 | may not be available in non-secure mode. |
| 1053 | 1052 | ||
| 1053 | config ARM_ERRATA_742230 | ||
| 1054 | bool "ARM errata: DMB operation may be faulty" | ||
| 1055 | depends on CPU_V7 && SMP | ||
| 1056 | help | ||
| 1057 | This option enables the workaround for the 742230 Cortex-A9 | ||
| 1058 | (r1p0..r2p2) erratum. Under rare circumstances, a DMB instruction | ||
| 1059 | between two write operations may not ensure the correct visibility | ||
| 1060 | ordering of the two writes. This workaround sets a specific bit in | ||
| 1061 | the diagnostic register of the Cortex-A9 which causes the DMB | ||
| 1062 | instruction to behave as a DSB, ensuring the correct behaviour of | ||
| 1063 | the two writes. | ||
| 1064 | |||
| 1065 | config ARM_ERRATA_742231 | ||
| 1066 | bool "ARM errata: Incorrect hazard handling in the SCU may lead to data corruption" | ||
| 1067 | depends on CPU_V7 && SMP | ||
| 1068 | help | ||
| 1069 | This option enables the workaround for the 742231 Cortex-A9 | ||
| 1070 | (r2p0..r2p2) erratum. Under certain conditions, specific to the | ||
| 1071 | Cortex-A9 MPCore micro-architecture, two CPUs working in SMP mode, | ||
| 1072 | accessing some data located in the same cache line, may get corrupted | ||
| 1073 | data due to bad handling of the address hazard when the line gets | ||
| 1074 | replaced from one of the CPUs at the same time as another CPU is | ||
| 1075 | accessing it. This workaround sets specific bits in the diagnostic | ||
| 1076 | register of the Cortex-A9 which reduces the linefill issuing | ||
| 1077 | capabilities of the processor. | ||
| 1078 | |||
| 1054 | config PL310_ERRATA_588369 | 1079 | config PL310_ERRATA_588369 |
| 1055 | bool "Clean & Invalidate maintenance operations do not invalidate clean lines" | 1080 | bool "Clean & Invalidate maintenance operations do not invalidate clean lines" |
| 1056 | depends on CACHE_L2X0 && ARCH_OMAP4 | 1081 | depends on CACHE_L2X0 && ARCH_OMAP4 |
| @@ -1076,6 +1101,20 @@ config ARM_ERRATA_720789 | |||
| 1076 | invalidated are not, resulting in an incoherency in the system page | 1101 | invalidated are not, resulting in an incoherency in the system page |
| 1077 | tables. The workaround changes the TLB flushing routines to invalidate | 1102 | tables. The workaround changes the TLB flushing routines to invalidate |
| 1078 | entries regardless of the ASID. | 1103 | entries regardless of the ASID. |
| 1104 | |||
| 1105 | config ARM_ERRATA_743622 | ||
| 1106 | bool "ARM errata: Faulty hazard checking in the Store Buffer may lead to data corruption" | ||
| 1107 | depends on CPU_V7 | ||
| 1108 | help | ||
| 1109 | This option enables the workaround for the 743622 Cortex-A9 | ||
| 1110 | (r2p0..r2p2) erratum. Under very rare conditions, a faulty | ||
| 1111 | optimisation in the Cortex-A9 Store Buffer may lead to data | ||
| 1112 | corruption. This workaround sets a specific bit in the diagnostic | ||
| 1113 | register of the Cortex-A9 which disables the Store Buffer | ||
| 1114 | optimisation, preventing the defect from occurring. This has no | ||
| 1115 | visible impact on the overall performance or power consumption of the | ||
| 1116 | processor. | ||
| 1117 | |||
| 1079 | endmenu | 1118 | endmenu |
| 1080 | 1119 | ||
| 1081 | source "arch/arm/common/Kconfig" | 1120 | source "arch/arm/common/Kconfig" |
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index b23f6bc46cfa..65a7c1c588a9 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
| @@ -116,5 +116,5 @@ CFLAGS_font.o := -Dstatic= | |||
| 116 | $(obj)/font.c: $(FONTC) | 116 | $(obj)/font.c: $(FONTC) |
| 117 | $(call cmd,shipped) | 117 | $(call cmd,shipped) |
| 118 | 118 | ||
| 119 | $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config | 119 | $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG) |
| 120 | @sed "$(SEDFLAGS)" < $< > $@ | 120 | @sed "$(SEDFLAGS)" < $< > $@ |
diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c index 7974baacafce..1bec96e85196 100644 --- a/arch/arm/common/it8152.c +++ b/arch/arm/common/it8152.c | |||
| @@ -271,6 +271,14 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size) | |||
| 271 | ((dma_addr + size - PHYS_OFFSET) >= SZ_64M); | 271 | ((dma_addr + size - PHYS_OFFSET) >= SZ_64M); |
| 272 | } | 272 | } |
| 273 | 273 | ||
| 274 | int dma_set_coherent_mask(struct device *dev, u64 mask) | ||
| 275 | { | ||
| 276 | if (mask >= PHYS_OFFSET + SZ_64M - 1) | ||
| 277 | return 0; | ||
| 278 | |||
| 279 | return -EIO; | ||
| 280 | } | ||
| 281 | |||
| 274 | int __init it8152_pci_setup(int nr, struct pci_sys_data *sys) | 282 | int __init it8152_pci_setup(int nr, struct pci_sys_data *sys) |
| 275 | { | 283 | { |
| 276 | it8152_io.start = IT8152_IO_BASE + 0x12000; | 284 | it8152_io.start = IT8152_IO_BASE + 0x12000; |
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index ab68cf1ef80f..e90b167ea848 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
| @@ -317,6 +317,10 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | |||
| 317 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE | 317 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE |
| 318 | #define pgprot_dmacoherent(prot) \ | 318 | #define pgprot_dmacoherent(prot) \ |
| 319 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) | 319 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) |
| 320 | #define __HAVE_PHYS_MEM_ACCESS_PROT | ||
| 321 | struct file; | ||
| 322 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | ||
| 323 | unsigned long size, pgprot_t vma_prot); | ||
| 320 | #else | 324 | #else |
| 321 | #define pgprot_dmacoherent(prot) \ | 325 | #define pgprot_dmacoherent(prot) \ |
| 322 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_UNCACHED) | 326 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_UNCACHED) |
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index f05a35a59694..7885722bdf4e 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
| @@ -48,6 +48,8 @@ work_pending: | |||
| 48 | beq no_work_pending | 48 | beq no_work_pending |
| 49 | mov r0, sp @ 'regs' | 49 | mov r0, sp @ 'regs' |
| 50 | mov r2, why @ 'syscall' | 50 | mov r2, why @ 'syscall' |
| 51 | tst r1, #_TIF_SIGPENDING @ delivering a signal? | ||
| 52 | movne why, #0 @ prevent further restarts | ||
| 51 | bl do_notify_resume | 53 | bl do_notify_resume |
| 52 | b ret_slow_syscall @ Check work again | 54 | b ret_slow_syscall @ Check work again |
| 53 | 55 | ||
| @@ -418,11 +420,13 @@ ENDPROC(sys_clone_wrapper) | |||
| 418 | 420 | ||
| 419 | sys_sigreturn_wrapper: | 421 | sys_sigreturn_wrapper: |
| 420 | add r0, sp, #S_OFF | 422 | add r0, sp, #S_OFF |
| 423 | mov why, #0 @ prevent syscall restart handling | ||
| 421 | b sys_sigreturn | 424 | b sys_sigreturn |
| 422 | ENDPROC(sys_sigreturn_wrapper) | 425 | ENDPROC(sys_sigreturn_wrapper) |
| 423 | 426 | ||
| 424 | sys_rt_sigreturn_wrapper: | 427 | sys_rt_sigreturn_wrapper: |
| 425 | add r0, sp, #S_OFF | 428 | add r0, sp, #S_OFF |
| 429 | mov why, #0 @ prevent syscall restart handling | ||
| 426 | b sys_rt_sigreturn | 430 | b sys_rt_sigreturn |
| 427 | ENDPROC(sys_rt_sigreturn_wrapper) | 431 | ENDPROC(sys_rt_sigreturn_wrapper) |
| 428 | 432 | ||
diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c index 8bccbfa693ff..2c1f0050c9c4 100644 --- a/arch/arm/kernel/kprobes-decode.c +++ b/arch/arm/kernel/kprobes-decode.c | |||
| @@ -1162,11 +1162,12 @@ space_cccc_001x(kprobe_opcode_t insn, struct arch_specific_insn *asi) | |||
| 1162 | { | 1162 | { |
| 1163 | /* | 1163 | /* |
| 1164 | * MSR : cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx | 1164 | * MSR : cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx |
| 1165 | * Undef : cccc 0011 0x00 xxxx xxxx xxxx xxxx xxxx | 1165 | * Undef : cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx |
| 1166 | * ALU op with S bit and Rd == 15 : | 1166 | * ALU op with S bit and Rd == 15 : |
| 1167 | * cccc 001x xxx1 xxxx 1111 xxxx xxxx xxxx | 1167 | * cccc 001x xxx1 xxxx 1111 xxxx xxxx xxxx |
| 1168 | */ | 1168 | */ |
| 1169 | if ((insn & 0x0f900000) == 0x03200000 || /* MSR & Undef */ | 1169 | if ((insn & 0x0fb00000) == 0x03200000 || /* MSR */ |
| 1170 | (insn & 0x0ff00000) == 0x03400000 || /* Undef */ | ||
| 1170 | (insn & 0x0e10f000) == 0x0210f000) /* ALU s-bit, R15 */ | 1171 | (insn & 0x0e10f000) == 0x0210f000) /* ALU s-bit, R15 */ |
| 1171 | return INSN_REJECTED; | 1172 | return INSN_REJECTED; |
| 1172 | 1173 | ||
| @@ -1177,7 +1178,7 @@ space_cccc_001x(kprobe_opcode_t insn, struct arch_specific_insn *asi) | |||
| 1177 | * *S (bit 20) updates condition codes | 1178 | * *S (bit 20) updates condition codes |
| 1178 | * ADC/SBC/RSC reads the C flag | 1179 | * ADC/SBC/RSC reads the C flag |
| 1179 | */ | 1180 | */ |
| 1180 | insn &= 0xfff00fff; /* Rn = r0, Rd = r0 */ | 1181 | insn &= 0xffff0fff; /* Rd = r0 */ |
| 1181 | asi->insn[0] = insn; | 1182 | asi->insn[0] = insn; |
| 1182 | asi->insn_handler = (insn & (1 << 20)) ? /* S-bit */ | 1183 | asi->insn_handler = (insn & (1 << 20)) ? /* S-bit */ |
| 1183 | emulate_alu_imm_rwflags : emulate_alu_imm_rflags; | 1184 | emulate_alu_imm_rwflags : emulate_alu_imm_rflags; |
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index 5e71ccd5e7d3..1276babf84d5 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
| @@ -426,7 +426,7 @@ static struct i2c_gpio_platform_data pdata_i2c0 = { | |||
| 426 | .sda_is_open_drain = 1, | 426 | .sda_is_open_drain = 1, |
| 427 | .scl_pin = AT91_PIN_PA21, | 427 | .scl_pin = AT91_PIN_PA21, |
| 428 | .scl_is_open_drain = 1, | 428 | .scl_is_open_drain = 1, |
| 429 | .udelay = 2, /* ~100 kHz */ | 429 | .udelay = 5, /* ~100 kHz */ |
| 430 | }; | 430 | }; |
| 431 | 431 | ||
| 432 | static struct platform_device at91sam9g45_twi0_device = { | 432 | static struct platform_device at91sam9g45_twi0_device = { |
| @@ -440,7 +440,7 @@ static struct i2c_gpio_platform_data pdata_i2c1 = { | |||
| 440 | .sda_is_open_drain = 1, | 440 | .sda_is_open_drain = 1, |
| 441 | .scl_pin = AT91_PIN_PB11, | 441 | .scl_pin = AT91_PIN_PB11, |
| 442 | .scl_is_open_drain = 1, | 442 | .scl_is_open_drain = 1, |
| 443 | .udelay = 2, /* ~100 kHz */ | 443 | .udelay = 5, /* ~100 kHz */ |
| 444 | }; | 444 | }; |
| 445 | 445 | ||
| 446 | static struct platform_device at91sam9g45_twi1_device = { | 446 | static struct platform_device at91sam9g45_twi1_device = { |
diff --git a/arch/arm/mach-at91/include/mach/system.h b/arch/arm/mach-at91/include/mach/system.h index c80e090b3670..ee8db152592e 100644 --- a/arch/arm/mach-at91/include/mach/system.h +++ b/arch/arm/mach-at91/include/mach/system.h | |||
| @@ -28,17 +28,16 @@ | |||
| 28 | 28 | ||
| 29 | static inline void arch_idle(void) | 29 | static inline void arch_idle(void) |
| 30 | { | 30 | { |
| 31 | #ifndef CONFIG_DEBUG_KERNEL | ||
| 32 | /* | 31 | /* |
| 33 | * Disable the processor clock. The processor will be automatically | 32 | * Disable the processor clock. The processor will be automatically |
| 34 | * re-enabled by an interrupt or by a reset. | 33 | * re-enabled by an interrupt or by a reset. |
| 35 | */ | 34 | */ |
| 36 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | 35 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); |
| 37 | #else | 36 | #ifndef CONFIG_CPU_ARM920T |
| 38 | /* | 37 | /* |
| 39 | * Set the processor (CP15) into 'Wait for Interrupt' mode. | 38 | * Set the processor (CP15) into 'Wait for Interrupt' mode. |
| 40 | * Unlike disabling the processor clock via the PMC (above) | 39 | * Post-RM9200 processors need this in conjunction with the above |
| 41 | * this allows the processor to be woken via JTAG. | 40 | * to save power when idle. |
| 42 | */ | 41 | */ |
| 43 | cpu_do_idle(); | 42 | cpu_do_idle(); |
| 44 | #endif | 43 | #endif |
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index 3d996b659ff4..9be261beae7d 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c | |||
| @@ -769,8 +769,7 @@ static struct map_desc dm355_io_desc[] = { | |||
| 769 | .virtual = SRAM_VIRT, | 769 | .virtual = SRAM_VIRT, |
| 770 | .pfn = __phys_to_pfn(0x00010000), | 770 | .pfn = __phys_to_pfn(0x00010000), |
| 771 | .length = SZ_32K, | 771 | .length = SZ_32K, |
| 772 | /* MT_MEMORY_NONCACHED requires supersection alignment */ | 772 | .type = MT_MEMORY_NONCACHED, |
| 773 | .type = MT_DEVICE, | ||
| 774 | }, | 773 | }, |
| 775 | }; | 774 | }; |
| 776 | 775 | ||
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 6b6f4c643709..7781e35daec3 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c | |||
| @@ -969,8 +969,7 @@ static struct map_desc dm365_io_desc[] = { | |||
| 969 | .virtual = SRAM_VIRT, | 969 | .virtual = SRAM_VIRT, |
| 970 | .pfn = __phys_to_pfn(0x00010000), | 970 | .pfn = __phys_to_pfn(0x00010000), |
| 971 | .length = SZ_32K, | 971 | .length = SZ_32K, |
| 972 | /* MT_MEMORY_NONCACHED requires supersection alignment */ | 972 | .type = MT_MEMORY_NONCACHED, |
| 973 | .type = MT_DEVICE, | ||
| 974 | }, | 973 | }, |
| 975 | }; | 974 | }; |
| 976 | 975 | ||
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 40fec315c99a..5e5b0a7831fb 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
| @@ -653,8 +653,7 @@ static struct map_desc dm644x_io_desc[] = { | |||
| 653 | .virtual = SRAM_VIRT, | 653 | .virtual = SRAM_VIRT, |
| 654 | .pfn = __phys_to_pfn(0x00008000), | 654 | .pfn = __phys_to_pfn(0x00008000), |
| 655 | .length = SZ_16K, | 655 | .length = SZ_16K, |
| 656 | /* MT_MEMORY_NONCACHED requires supersection alignment */ | 656 | .type = MT_MEMORY_NONCACHED, |
| 657 | .type = MT_DEVICE, | ||
| 658 | }, | 657 | }, |
| 659 | }; | 658 | }; |
| 660 | 659 | ||
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index e4a3df1872ac..26e8a9c7f50b 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c | |||
| @@ -737,8 +737,7 @@ static struct map_desc dm646x_io_desc[] = { | |||
| 737 | .virtual = SRAM_VIRT, | 737 | .virtual = SRAM_VIRT, |
| 738 | .pfn = __phys_to_pfn(0x00010000), | 738 | .pfn = __phys_to_pfn(0x00010000), |
| 739 | .length = SZ_32K, | 739 | .length = SZ_32K, |
| 740 | /* MT_MEMORY_NONCACHED requires supersection alignment */ | 740 | .type = MT_MEMORY_NONCACHED, |
| 741 | .type = MT_DEVICE, | ||
| 742 | }, | 741 | }, |
| 743 | }; | 742 | }; |
| 744 | 743 | ||
diff --git a/arch/arm/mach-dove/include/mach/io.h b/arch/arm/mach-dove/include/mach/io.h index 3b3e4721ce2e..eb4936ff90ad 100644 --- a/arch/arm/mach-dove/include/mach/io.h +++ b/arch/arm/mach-dove/include/mach/io.h | |||
| @@ -13,8 +13,8 @@ | |||
| 13 | 13 | ||
| 14 | #define IO_SPACE_LIMIT 0xffffffff | 14 | #define IO_SPACE_LIMIT 0xffffffff |
| 15 | 15 | ||
| 16 | #define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_PHYS_BASE) +\ | 16 | #define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \ |
| 17 | DOVE_PCIE0_IO_VIRT_BASE)) | 17 | DOVE_PCIE0_IO_VIRT_BASE)) |
| 18 | #define __mem_pci(a) (a) | 18 | #define __mem_pci(a) (a) |
| 19 | 19 | ||
| 20 | #endif | 20 | #endif |
diff --git a/arch/arm/mach-ep93xx/dma-m2p.c b/arch/arm/mach-ep93xx/dma-m2p.c index 8904ca4e2e24..a696d354b1f8 100644 --- a/arch/arm/mach-ep93xx/dma-m2p.c +++ b/arch/arm/mach-ep93xx/dma-m2p.c | |||
| @@ -276,7 +276,7 @@ static void channel_disable(struct m2p_channel *ch) | |||
| 276 | v &= ~(M2P_CONTROL_STALL_IRQ_EN | M2P_CONTROL_NFB_IRQ_EN); | 276 | v &= ~(M2P_CONTROL_STALL_IRQ_EN | M2P_CONTROL_NFB_IRQ_EN); |
| 277 | m2p_set_control(ch, v); | 277 | m2p_set_control(ch, v); |
| 278 | 278 | ||
| 279 | while (m2p_channel_state(ch) == STATE_ON) | 279 | while (m2p_channel_state(ch) >= STATE_ON) |
| 280 | cpu_relax(); | 280 | cpu_relax(); |
| 281 | 281 | ||
| 282 | m2p_set_control(ch, 0x0); | 282 | m2p_set_control(ch, 0x0); |
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index c5c0369bb481..2f7e2728970d 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
| @@ -122,6 +122,7 @@ config MACH_CPUIMX27 | |||
| 122 | select IMX_HAVE_PLATFORM_IMX_I2C | 122 | select IMX_HAVE_PLATFORM_IMX_I2C |
| 123 | select IMX_HAVE_PLATFORM_IMX_UART | 123 | select IMX_HAVE_PLATFORM_IMX_UART |
| 124 | select IMX_HAVE_PLATFORM_MXC_NAND | 124 | select IMX_HAVE_PLATFORM_MXC_NAND |
| 125 | select MXC_ULPI if USB_ULPI | ||
| 125 | help | 126 | help |
| 126 | Include support for Eukrea CPUIMX27 platform. This includes | 127 | Include support for Eukrea CPUIMX27 platform. This includes |
| 127 | specific configurations for the module and its peripherals. | 128 | specific configurations for the module and its peripherals. |
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c index 339150ab0ea5..6830afd1d2ba 100644 --- a/arch/arm/mach-imx/mach-cpuimx27.c +++ b/arch/arm/mach-imx/mach-cpuimx27.c | |||
| @@ -259,7 +259,7 @@ static void __init eukrea_cpuimx27_init(void) | |||
| 259 | i2c_register_board_info(0, eukrea_cpuimx27_i2c_devices, | 259 | i2c_register_board_info(0, eukrea_cpuimx27_i2c_devices, |
| 260 | ARRAY_SIZE(eukrea_cpuimx27_i2c_devices)); | 260 | ARRAY_SIZE(eukrea_cpuimx27_i2c_devices)); |
| 261 | 261 | ||
| 262 | imx27_add_i2c_imx1(&cpuimx27_i2c1_data); | 262 | imx27_add_i2c_imx0(&cpuimx27_i2c1_data); |
| 263 | 263 | ||
| 264 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 264 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
| 265 | 265 | ||
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c index 61cd4d64b985..24498a932ba6 100644 --- a/arch/arm/mach-ixp4xx/common-pci.c +++ b/arch/arm/mach-ixp4xx/common-pci.c | |||
| @@ -503,6 +503,14 @@ struct pci_bus * __devinit ixp4xx_scan_bus(int nr, struct pci_sys_data *sys) | |||
| 503 | return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys); | 503 | return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys); |
| 504 | } | 504 | } |
| 505 | 505 | ||
| 506 | int dma_set_coherent_mask(struct device *dev, u64 mask) | ||
| 507 | { | ||
| 508 | if (mask >= SZ_64M - 1) | ||
| 509 | return 0; | ||
| 510 | |||
| 511 | return -EIO; | ||
| 512 | } | ||
| 513 | |||
| 506 | EXPORT_SYMBOL(ixp4xx_pci_read); | 514 | EXPORT_SYMBOL(ixp4xx_pci_read); |
| 507 | EXPORT_SYMBOL(ixp4xx_pci_write); | 515 | EXPORT_SYMBOL(ixp4xx_pci_write); |
| 508 | 516 | ||
diff --git a/arch/arm/mach-ixp4xx/include/mach/hardware.h b/arch/arm/mach-ixp4xx/include/mach/hardware.h index f91ca6d4fbe8..8138371c406e 100644 --- a/arch/arm/mach-ixp4xx/include/mach/hardware.h +++ b/arch/arm/mach-ixp4xx/include/mach/hardware.h | |||
| @@ -26,6 +26,8 @@ | |||
| 26 | #define PCIBIOS_MAX_MEM 0x4BFFFFFF | 26 | #define PCIBIOS_MAX_MEM 0x4BFFFFFF |
| 27 | #endif | 27 | #endif |
| 28 | 28 | ||
| 29 | #define ARCH_HAS_DMA_SET_COHERENT_MASK | ||
| 30 | |||
| 29 | #define pcibios_assign_all_busses() 1 | 31 | #define pcibios_assign_all_busses() 1 |
| 30 | 32 | ||
| 31 | /* Register locations and bits */ | 33 | /* Register locations and bits */ |
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index 93fc2ec95e76..6e924b398919 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h | |||
| @@ -38,7 +38,7 @@ | |||
| 38 | 38 | ||
| 39 | #define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000 | 39 | #define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000 |
| 40 | #define KIRKWOOD_PCIE1_IO_VIRT_BASE 0xfef00000 | 40 | #define KIRKWOOD_PCIE1_IO_VIRT_BASE 0xfef00000 |
| 41 | #define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00000000 | 41 | #define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00100000 |
| 42 | #define KIRKWOOD_PCIE1_IO_SIZE SZ_1M | 42 | #define KIRKWOOD_PCIE1_IO_SIZE SZ_1M |
| 43 | 43 | ||
| 44 | #define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 | 44 | #define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 |
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index 55e7f00836b7..513ad3102d7c 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c | |||
| @@ -117,7 +117,7 @@ static void __init pcie0_ioresources_init(struct pcie_port *pp) | |||
| 117 | * IORESOURCE_IO | 117 | * IORESOURCE_IO |
| 118 | */ | 118 | */ |
| 119 | pp->res[0].name = "PCIe 0 I/O Space"; | 119 | pp->res[0].name = "PCIe 0 I/O Space"; |
| 120 | pp->res[0].start = KIRKWOOD_PCIE_IO_PHYS_BASE; | 120 | pp->res[0].start = KIRKWOOD_PCIE_IO_BUS_BASE; |
| 121 | pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1; | 121 | pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1; |
| 122 | pp->res[0].flags = IORESOURCE_IO; | 122 | pp->res[0].flags = IORESOURCE_IO; |
| 123 | 123 | ||
| @@ -139,7 +139,7 @@ static void __init pcie1_ioresources_init(struct pcie_port *pp) | |||
| 139 | * IORESOURCE_IO | 139 | * IORESOURCE_IO |
| 140 | */ | 140 | */ |
| 141 | pp->res[0].name = "PCIe 1 I/O Space"; | 141 | pp->res[0].name = "PCIe 1 I/O Space"; |
| 142 | pp->res[0].start = KIRKWOOD_PCIE1_IO_PHYS_BASE; | 142 | pp->res[0].start = KIRKWOOD_PCIE1_IO_BUS_BASE; |
| 143 | pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE1_IO_SIZE - 1; | 143 | pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE1_IO_SIZE - 1; |
| 144 | pp->res[0].flags = IORESOURCE_IO; | 144 | pp->res[0].flags = IORESOURCE_IO; |
| 145 | 145 | ||
diff --git a/arch/arm/mach-mmp/include/mach/system.h b/arch/arm/mach-mmp/include/mach/system.h index 4f5b0e0ce6cf..1a8a25edb1b4 100644 --- a/arch/arm/mach-mmp/include/mach/system.h +++ b/arch/arm/mach-mmp/include/mach/system.h | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #ifndef __ASM_MACH_SYSTEM_H | 9 | #ifndef __ASM_MACH_SYSTEM_H |
| 10 | #define __ASM_MACH_SYSTEM_H | 10 | #define __ASM_MACH_SYSTEM_H |
| 11 | 11 | ||
| 12 | #include <mach/cputype.h> | ||
| 13 | |||
| 12 | static inline void arch_idle(void) | 14 | static inline void arch_idle(void) |
| 13 | { | 15 | { |
| 14 | cpu_do_idle(); | 16 | cpu_do_idle(); |
| @@ -16,6 +18,9 @@ static inline void arch_idle(void) | |||
| 16 | 18 | ||
| 17 | static inline void arch_reset(char mode, const char *cmd) | 19 | static inline void arch_reset(char mode, const char *cmd) |
| 18 | { | 20 | { |
| 19 | cpu_reset(0); | 21 | if (cpu_is_pxa168()) |
| 22 | cpu_reset(0xffff0000); | ||
| 23 | else | ||
| 24 | cpu_reset(0); | ||
| 20 | } | 25 | } |
| 21 | #endif /* __ASM_MACH_SYSTEM_H */ | 26 | #endif /* __ASM_MACH_SYSTEM_H */ |
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c index 50d5939a78f1..58093d9e07be 100644 --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c | |||
| @@ -312,8 +312,7 @@ static int pxa_set_target(struct cpufreq_policy *policy, | |||
| 312 | freqs.cpu = policy->cpu; | 312 | freqs.cpu = policy->cpu; |
| 313 | 313 | ||
| 314 | if (freq_debug) | 314 | if (freq_debug) |
| 315 | pr_debug(KERN_INFO "Changing CPU frequency to %d Mhz, " | 315 | pr_debug("Changing CPU frequency to %d Mhz, (SDRAM %d Mhz)\n", |
| 316 | "(SDRAM %d Mhz)\n", | ||
| 317 | freqs.new / 1000, (pxa_freq_settings[idx].div2) ? | 316 | freqs.new / 1000, (pxa_freq_settings[idx].div2) ? |
| 318 | (new_freq_mem / 2000) : (new_freq_mem / 1000)); | 317 | (new_freq_mem / 2000) : (new_freq_mem / 1000)); |
| 319 | 318 | ||
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h index 7f64d24cd564..814f1458a06a 100644 --- a/arch/arm/mach-pxa/include/mach/hardware.h +++ b/arch/arm/mach-pxa/include/mach/hardware.h | |||
| @@ -264,23 +264,35 @@ | |||
| 264 | * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x | 264 | * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x |
| 265 | * == 0x3 for pxa300/pxa310/pxa320 | 265 | * == 0x3 for pxa300/pxa310/pxa320 |
| 266 | */ | 266 | */ |
| 267 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | ||
| 267 | #define __cpu_is_pxa2xx(id) \ | 268 | #define __cpu_is_pxa2xx(id) \ |
| 268 | ({ \ | 269 | ({ \ |
| 269 | unsigned int _id = (id) >> 13 & 0x7; \ | 270 | unsigned int _id = (id) >> 13 & 0x7; \ |
| 270 | _id <= 0x2; \ | 271 | _id <= 0x2; \ |
| 271 | }) | 272 | }) |
| 273 | #else | ||
| 274 | #define __cpu_is_pxa2xx(id) (0) | ||
| 275 | #endif | ||
| 272 | 276 | ||
| 277 | #ifdef CONFIG_PXA3xx | ||
| 273 | #define __cpu_is_pxa3xx(id) \ | 278 | #define __cpu_is_pxa3xx(id) \ |
| 274 | ({ \ | 279 | ({ \ |
| 275 | unsigned int _id = (id) >> 13 & 0x7; \ | 280 | unsigned int _id = (id) >> 13 & 0x7; \ |
| 276 | _id == 0x3; \ | 281 | _id == 0x3; \ |
| 277 | }) | 282 | }) |
| 283 | #else | ||
| 284 | #define __cpu_is_pxa3xx(id) (0) | ||
| 285 | #endif | ||
| 278 | 286 | ||
| 287 | #if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935) | ||
| 279 | #define __cpu_is_pxa93x(id) \ | 288 | #define __cpu_is_pxa93x(id) \ |
| 280 | ({ \ | 289 | ({ \ |
| 281 | unsigned int _id = (id) >> 4 & 0xfff; \ | 290 | unsigned int _id = (id) >> 4 & 0xfff; \ |
| 282 | _id == 0x683 || _id == 0x693; \ | 291 | _id == 0x683 || _id == 0x693; \ |
| 283 | }) | 292 | }) |
| 293 | #else | ||
| 294 | #define __cpu_is_pxa93x(id) (0) | ||
| 295 | #endif | ||
| 284 | 296 | ||
| 285 | #define cpu_is_pxa2xx() \ | 297 | #define cpu_is_pxa2xx() \ |
| 286 | ({ \ | 298 | ({ \ |
| @@ -309,7 +321,7 @@ extern unsigned long get_clock_tick_rate(void); | |||
| 309 | #define PCIBIOS_MIN_IO 0 | 321 | #define PCIBIOS_MIN_IO 0 |
| 310 | #define PCIBIOS_MIN_MEM 0 | 322 | #define PCIBIOS_MIN_MEM 0 |
| 311 | #define pcibios_assign_all_busses() 1 | 323 | #define pcibios_assign_all_busses() 1 |
| 324 | #define ARCH_HAS_DMA_SET_COHERENT_MASK | ||
| 312 | #endif | 325 | #endif |
| 313 | 326 | ||
| 314 | |||
| 315 | #endif /* _ASM_ARCH_HARDWARE_H */ | 327 | #endif /* _ASM_ARCH_HARDWARE_H */ |
diff --git a/arch/arm/mach-pxa/include/mach/io.h b/arch/arm/mach-pxa/include/mach/io.h index 262691fb97d8..fdca3be47d9b 100644 --- a/arch/arm/mach-pxa/include/mach/io.h +++ b/arch/arm/mach-pxa/include/mach/io.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | #ifndef __ASM_ARM_ARCH_IO_H | 6 | #ifndef __ASM_ARM_ARCH_IO_H |
| 7 | #define __ASM_ARM_ARCH_IO_H | 7 | #define __ASM_ARM_ARCH_IO_H |
| 8 | 8 | ||
| 9 | #include <mach/hardware.h> | ||
| 10 | |||
| 9 | #define IO_SPACE_LIMIT 0xffffffff | 11 | #define IO_SPACE_LIMIT 0xffffffff |
| 10 | 12 | ||
| 11 | /* | 13 | /* |
diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c index 77ad6d34ab5b..405b92a29793 100644 --- a/arch/arm/mach-pxa/palm27x.c +++ b/arch/arm/mach-pxa/palm27x.c | |||
| @@ -469,9 +469,13 @@ static struct i2c_board_info __initdata palm27x_pi2c_board_info[] = { | |||
| 469 | }, | 469 | }, |
| 470 | }; | 470 | }; |
| 471 | 471 | ||
| 472 | static struct i2c_pxa_platform_data palm27x_i2c_power_info = { | ||
| 473 | .use_pio = 1, | ||
| 474 | }; | ||
| 475 | |||
| 472 | void __init palm27x_pmic_init(void) | 476 | void __init palm27x_pmic_init(void) |
| 473 | { | 477 | { |
| 474 | i2c_register_board_info(1, ARRAY_AND_SIZE(palm27x_pi2c_board_info)); | 478 | i2c_register_board_info(1, ARRAY_AND_SIZE(palm27x_pi2c_board_info)); |
| 475 | pxa27x_set_i2c_power_info(NULL); | 479 | pxa27x_set_i2c_power_info(&palm27x_i2c_power_info); |
| 476 | } | 480 | } |
| 477 | #endif | 481 | #endif |
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c index c9b747cedea8..37d6173bbb66 100644 --- a/arch/arm/mach-pxa/vpac270.c +++ b/arch/arm/mach-pxa/vpac270.c | |||
| @@ -240,6 +240,7 @@ static void __init vpac270_onenand_init(void) {} | |||
| 240 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | 240 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
| 241 | static struct pxamci_platform_data vpac270_mci_platform_data = { | 241 | static struct pxamci_platform_data vpac270_mci_platform_data = { |
| 242 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 242 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
| 243 | .gpio_power = -1, | ||
| 243 | .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N, | 244 | .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N, |
| 244 | .gpio_card_ro = GPIO52_VPAC270_SD_READONLY, | 245 | .gpio_card_ro = GPIO52_VPAC270_SD_READONLY, |
| 245 | .detect_delay_ms = 200, | 246 | .detect_delay_ms = 200, |
diff --git a/arch/arm/mach-s3c64xx/dev-spi.c b/arch/arm/mach-s3c64xx/dev-spi.c index a492b982aa06..405e62128917 100644 --- a/arch/arm/mach-s3c64xx/dev-spi.c +++ b/arch/arm/mach-s3c64xx/dev-spi.c | |||
| @@ -18,10 +18,11 @@ | |||
| 18 | #include <mach/map.h> | 18 | #include <mach/map.h> |
| 19 | #include <mach/gpio-bank-c.h> | 19 | #include <mach/gpio-bank-c.h> |
| 20 | #include <mach/spi-clocks.h> | 20 | #include <mach/spi-clocks.h> |
| 21 | #include <mach/irqs.h> | ||
| 21 | 22 | ||
| 22 | #include <plat/s3c64xx-spi.h> | 23 | #include <plat/s3c64xx-spi.h> |
| 23 | #include <plat/gpio-cfg.h> | 24 | #include <plat/gpio-cfg.h> |
| 24 | #include <plat/irqs.h> | 25 | #include <plat/devs.h> |
| 25 | 26 | ||
| 26 | static char *spi_src_clks[] = { | 27 | static char *spi_src_clks[] = { |
| 27 | [S3C64XX_SPI_SRCCLK_PCLK] = "pclk", | 28 | [S3C64XX_SPI_SRCCLK_PCLK] = "pclk", |
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c index 5c07d013b23d..e130379ba0e8 100644 --- a/arch/arm/mach-s3c64xx/mach-real6410.c +++ b/arch/arm/mach-s3c64xx/mach-real6410.c | |||
| @@ -30,73 +30,73 @@ | |||
| 30 | #include <plat/devs.h> | 30 | #include <plat/devs.h> |
| 31 | #include <plat/regs-serial.h> | 31 | #include <plat/regs-serial.h> |
| 32 | 32 | ||
| 33 | #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK | 33 | #define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) |
| 34 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB | 34 | #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) |
| 35 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE | 35 | #define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) |
| 36 | 36 | ||
| 37 | static struct s3c2410_uartcfg real6410_uartcfgs[] __initdata = { | 37 | static struct s3c2410_uartcfg real6410_uartcfgs[] __initdata = { |
| 38 | [0] = { | 38 | [0] = { |
| 39 | .hwport = 0, | 39 | .hwport = 0, |
| 40 | .flags = 0, | 40 | .flags = 0, |
| 41 | .ucon = UCON, | 41 | .ucon = UCON, |
| 42 | .ulcon = ULCON, | 42 | .ulcon = ULCON, |
| 43 | .ufcon = UFCON, | 43 | .ufcon = UFCON, |
| 44 | }, | 44 | }, |
| 45 | [1] = { | 45 | [1] = { |
| 46 | .hwport = 1, | 46 | .hwport = 1, |
| 47 | .flags = 0, | 47 | .flags = 0, |
| 48 | .ucon = UCON, | 48 | .ucon = UCON, |
| 49 | .ulcon = ULCON, | 49 | .ulcon = ULCON, |
| 50 | .ufcon = UFCON, | 50 | .ufcon = UFCON, |
| 51 | }, | 51 | }, |
| 52 | [2] = { | 52 | [2] = { |
| 53 | .hwport = 2, | 53 | .hwport = 2, |
| 54 | .flags = 0, | 54 | .flags = 0, |
| 55 | .ucon = UCON, | 55 | .ucon = UCON, |
| 56 | .ulcon = ULCON, | 56 | .ulcon = ULCON, |
| 57 | .ufcon = UFCON, | 57 | .ufcon = UFCON, |
| 58 | }, | 58 | }, |
| 59 | [3] = { | 59 | [3] = { |
| 60 | .hwport = 3, | 60 | .hwport = 3, |
| 61 | .flags = 0, | 61 | .flags = 0, |
| 62 | .ucon = UCON, | 62 | .ucon = UCON, |
| 63 | .ulcon = ULCON, | 63 | .ulcon = ULCON, |
| 64 | .ufcon = UFCON, | 64 | .ufcon = UFCON, |
| 65 | }, | 65 | }, |
| 66 | }; | 66 | }; |
| 67 | 67 | ||
| 68 | /* DM9000AEP 10/100 ethernet controller */ | 68 | /* DM9000AEP 10/100 ethernet controller */ |
| 69 | 69 | ||
| 70 | static struct resource real6410_dm9k_resource[] = { | 70 | static struct resource real6410_dm9k_resource[] = { |
| 71 | [0] = { | 71 | [0] = { |
| 72 | .start = S3C64XX_PA_XM0CSN1, | 72 | .start = S3C64XX_PA_XM0CSN1, |
| 73 | .end = S3C64XX_PA_XM0CSN1 + 1, | 73 | .end = S3C64XX_PA_XM0CSN1 + 1, |
| 74 | .flags = IORESOURCE_MEM | 74 | .flags = IORESOURCE_MEM |
| 75 | }, | 75 | }, |
| 76 | [1] = { | 76 | [1] = { |
| 77 | .start = S3C64XX_PA_XM0CSN1 + 4, | 77 | .start = S3C64XX_PA_XM0CSN1 + 4, |
| 78 | .end = S3C64XX_PA_XM0CSN1 + 5, | 78 | .end = S3C64XX_PA_XM0CSN1 + 5, |
| 79 | .flags = IORESOURCE_MEM | 79 | .flags = IORESOURCE_MEM |
| 80 | }, | 80 | }, |
| 81 | [2] = { | 81 | [2] = { |
| 82 | .start = S3C_EINT(7), | 82 | .start = S3C_EINT(7), |
| 83 | .end = S3C_EINT(7), | 83 | .end = S3C_EINT(7), |
| 84 | .flags = IORESOURCE_IRQ, | 84 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL |
| 85 | } | 85 | } |
| 86 | }; | 86 | }; |
| 87 | 87 | ||
| 88 | static struct dm9000_plat_data real6410_dm9k_pdata = { | 88 | static struct dm9000_plat_data real6410_dm9k_pdata = { |
| 89 | .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM), | 89 | .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM), |
| 90 | }; | 90 | }; |
| 91 | 91 | ||
| 92 | static struct platform_device real6410_device_eth = { | 92 | static struct platform_device real6410_device_eth = { |
| 93 | .name = "dm9000", | 93 | .name = "dm9000", |
| 94 | .id = -1, | 94 | .id = -1, |
| 95 | .num_resources = ARRAY_SIZE(real6410_dm9k_resource), | 95 | .num_resources = ARRAY_SIZE(real6410_dm9k_resource), |
| 96 | .resource = real6410_dm9k_resource, | 96 | .resource = real6410_dm9k_resource, |
| 97 | .dev = { | 97 | .dev = { |
| 98 | .platform_data = &real6410_dm9k_pdata, | 98 | .platform_data = &real6410_dm9k_pdata, |
| 99 | }, | 99 | }, |
| 100 | }; | 100 | }; |
| 101 | 101 | ||
| 102 | static struct platform_device *real6410_devices[] __initdata = { | 102 | static struct platform_device *real6410_devices[] __initdata = { |
| @@ -129,12 +129,12 @@ static void __init real6410_machine_init(void) | |||
| 129 | /* set timing for nCS1 suitable for ethernet chip */ | 129 | /* set timing for nCS1 suitable for ethernet chip */ |
| 130 | 130 | ||
| 131 | __raw_writel((0 << S3C64XX_SROM_BCX__PMC__SHIFT) | | 131 | __raw_writel((0 << S3C64XX_SROM_BCX__PMC__SHIFT) | |
| 132 | (6 << S3C64XX_SROM_BCX__TACP__SHIFT) | | 132 | (6 << S3C64XX_SROM_BCX__TACP__SHIFT) | |
| 133 | (4 << S3C64XX_SROM_BCX__TCAH__SHIFT) | | 133 | (4 << S3C64XX_SROM_BCX__TCAH__SHIFT) | |
| 134 | (1 << S3C64XX_SROM_BCX__TCOH__SHIFT) | | 134 | (1 << S3C64XX_SROM_BCX__TCOH__SHIFT) | |
| 135 | (13 << S3C64XX_SROM_BCX__TACC__SHIFT) | | 135 | (13 << S3C64XX_SROM_BCX__TACC__SHIFT) | |
| 136 | (4 << S3C64XX_SROM_BCX__TCOS__SHIFT) | | 136 | (4 << S3C64XX_SROM_BCX__TCOS__SHIFT) | |
| 137 | (0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1); | 137 | (0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1); |
| 138 | 138 | ||
| 139 | platform_add_devices(real6410_devices, ARRAY_SIZE(real6410_devices)); | 139 | platform_add_devices(real6410_devices, ARRAY_SIZE(real6410_devices)); |
| 140 | } | 140 | } |
diff --git a/arch/arm/mach-s5p6440/cpu.c b/arch/arm/mach-s5p6440/cpu.c index 526f33adb31d..ec592e866054 100644 --- a/arch/arm/mach-s5p6440/cpu.c +++ b/arch/arm/mach-s5p6440/cpu.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/sysdev.h> | 19 | #include <linux/sysdev.h> |
| 20 | #include <linux/serial_core.h> | 20 | #include <linux/serial_core.h> |
| 21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
| 22 | #include <linux/sched.h> | ||
| 22 | 23 | ||
| 23 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
| 24 | #include <asm/mach/map.h> | 25 | #include <asm/mach/map.h> |
diff --git a/arch/arm/mach-s5p6442/cpu.c b/arch/arm/mach-s5p6442/cpu.c index a48fb553fd01..70ac681af72b 100644 --- a/arch/arm/mach-s5p6442/cpu.c +++ b/arch/arm/mach-s5p6442/cpu.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/sysdev.h> | 19 | #include <linux/sysdev.h> |
| 20 | #include <linux/serial_core.h> | 20 | #include <linux/serial_core.h> |
| 21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
| 22 | #include <linux/sched.h> | ||
| 22 | 23 | ||
| 23 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
| 24 | #include <asm/mach/map.h> | 25 | #include <asm/mach/map.h> |
diff --git a/arch/arm/mach-s5pc100/cpu.c b/arch/arm/mach-s5pc100/cpu.c index 251c92ac5b22..cd1afbce83e2 100644 --- a/arch/arm/mach-s5pc100/cpu.c +++ b/arch/arm/mach-s5pc100/cpu.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/sysdev.h> | 21 | #include <linux/sysdev.h> |
| 22 | #include <linux/serial_core.h> | 22 | #include <linux/serial_core.h> |
| 23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
| 24 | #include <linux/sched.h> | ||
| 24 | 25 | ||
| 25 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
| 26 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c index af91fefef2c6..d562670e1b0b 100644 --- a/arch/arm/mach-s5pv210/clock.c +++ b/arch/arm/mach-s5pv210/clock.c | |||
| @@ -173,11 +173,6 @@ static int s5pv210_clk_ip3_ctrl(struct clk *clk, int enable) | |||
| 173 | return s5p_gatectrl(S5P_CLKGATE_IP3, clk, enable); | 173 | return s5p_gatectrl(S5P_CLKGATE_IP3, clk, enable); |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | static int s5pv210_clk_ip4_ctrl(struct clk *clk, int enable) | ||
| 177 | { | ||
| 178 | return s5p_gatectrl(S5P_CLKGATE_IP4, clk, enable); | ||
| 179 | } | ||
| 180 | |||
| 181 | static int s5pv210_clk_mask0_ctrl(struct clk *clk, int enable) | 176 | static int s5pv210_clk_mask0_ctrl(struct clk *clk, int enable) |
| 182 | { | 177 | { |
| 183 | return s5p_gatectrl(S5P_CLK_SRC_MASK0, clk, enable); | 178 | return s5p_gatectrl(S5P_CLK_SRC_MASK0, clk, enable); |
| @@ -281,6 +276,24 @@ static struct clk init_clocks_disable[] = { | |||
| 281 | .enable = s5pv210_clk_ip0_ctrl, | 276 | .enable = s5pv210_clk_ip0_ctrl, |
| 282 | .ctrlbit = (1<<29), | 277 | .ctrlbit = (1<<29), |
| 283 | }, { | 278 | }, { |
| 279 | .name = "fimc", | ||
| 280 | .id = 0, | ||
| 281 | .parent = &clk_hclk_dsys.clk, | ||
| 282 | .enable = s5pv210_clk_ip0_ctrl, | ||
| 283 | .ctrlbit = (1 << 24), | ||
| 284 | }, { | ||
| 285 | .name = "fimc", | ||
| 286 | .id = 1, | ||
| 287 | .parent = &clk_hclk_dsys.clk, | ||
| 288 | .enable = s5pv210_clk_ip0_ctrl, | ||
| 289 | .ctrlbit = (1 << 25), | ||
| 290 | }, { | ||
| 291 | .name = "fimc", | ||
| 292 | .id = 2, | ||
| 293 | .parent = &clk_hclk_dsys.clk, | ||
| 294 | .enable = s5pv210_clk_ip0_ctrl, | ||
| 295 | .ctrlbit = (1 << 26), | ||
| 296 | }, { | ||
| 284 | .name = "otg", | 297 | .name = "otg", |
| 285 | .id = -1, | 298 | .id = -1, |
| 286 | .parent = &clk_hclk_psys.clk, | 299 | .parent = &clk_hclk_psys.clk, |
| @@ -357,7 +370,7 @@ static struct clk init_clocks_disable[] = { | |||
| 357 | .id = 1, | 370 | .id = 1, |
| 358 | .parent = &clk_pclk_psys.clk, | 371 | .parent = &clk_pclk_psys.clk, |
| 359 | .enable = s5pv210_clk_ip3_ctrl, | 372 | .enable = s5pv210_clk_ip3_ctrl, |
| 360 | .ctrlbit = (1<<8), | 373 | .ctrlbit = (1 << 10), |
| 361 | }, { | 374 | }, { |
| 362 | .name = "i2c", | 375 | .name = "i2c", |
| 363 | .id = 2, | 376 | .id = 2, |
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c index b9f4d677cf55..245b82b53df4 100644 --- a/arch/arm/mach-s5pv210/cpu.c +++ b/arch/arm/mach-s5pv210/cpu.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
| 20 | #include <linux/sysdev.h> | 20 | #include <linux/sysdev.h> |
| 21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
| 22 | #include <linux/sched.h> | ||
| 22 | 23 | ||
| 23 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
| 24 | #include <asm/mach/map.h> | 25 | #include <asm/mach/map.h> |
| @@ -47,7 +48,7 @@ static struct map_desc s5pv210_iodesc[] __initdata = { | |||
| 47 | { | 48 | { |
| 48 | .virtual = (unsigned long)S5P_VA_SYSTIMER, | 49 | .virtual = (unsigned long)S5P_VA_SYSTIMER, |
| 49 | .pfn = __phys_to_pfn(S5PV210_PA_SYSTIMER), | 50 | .pfn = __phys_to_pfn(S5PV210_PA_SYSTIMER), |
| 50 | .length = SZ_1M, | 51 | .length = SZ_4K, |
| 51 | .type = MT_DEVICE, | 52 | .type = MT_DEVICE, |
| 52 | }, { | 53 | }, { |
| 53 | .virtual = (unsigned long)VA_VIC2, | 54 | .virtual = (unsigned long)VA_VIC2, |
diff --git a/arch/arm/mach-u300/include/mach/gpio.h b/arch/arm/mach-u300/include/mach/gpio.h index 7b1fc984abb6..d5a71abcbaea 100644 --- a/arch/arm/mach-u300/include/mach/gpio.h +++ b/arch/arm/mach-u300/include/mach/gpio.h | |||
| @@ -273,6 +273,9 @@ extern void gpio_pullup(unsigned gpio, int value); | |||
| 273 | extern int gpio_get_value(unsigned gpio); | 273 | extern int gpio_get_value(unsigned gpio); |
| 274 | extern void gpio_set_value(unsigned gpio, int value); | 274 | extern void gpio_set_value(unsigned gpio, int value); |
| 275 | 275 | ||
| 276 | #define gpio_get_value_cansleep gpio_get_value | ||
| 277 | #define gpio_set_value_cansleep gpio_set_value | ||
| 278 | |||
| 276 | /* wrappers to sleep-enable the previous two functions */ | 279 | /* wrappers to sleep-enable the previous two functions */ |
| 277 | static inline unsigned gpio_to_irq(unsigned gpio) | 280 | static inline unsigned gpio_to_irq(unsigned gpio) |
| 278 | { | 281 | { |
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c index 577df6cccb08..71fb17349520 100644 --- a/arch/arm/mach-vexpress/ct-ca9x4.c +++ b/arch/arm/mach-vexpress/ct-ca9x4.c | |||
| @@ -68,7 +68,7 @@ static void __init ct_ca9x4_init_irq(void) | |||
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | #if 0 | 70 | #if 0 |
| 71 | static void ct_ca9x4_timer_init(void) | 71 | static void __init ct_ca9x4_timer_init(void) |
| 72 | { | 72 | { |
| 73 | writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL); | 73 | writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL); |
| 74 | writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL); | 74 | writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL); |
| @@ -222,12 +222,18 @@ static struct platform_device pmu_device = { | |||
| 222 | .resource = pmu_resources, | 222 | .resource = pmu_resources, |
| 223 | }; | 223 | }; |
| 224 | 224 | ||
| 225 | static void ct_ca9x4_init(void) | 225 | static void __init ct_ca9x4_init(void) |
| 226 | { | 226 | { |
| 227 | int i; | 227 | int i; |
| 228 | 228 | ||
| 229 | #ifdef CONFIG_CACHE_L2X0 | 229 | #ifdef CONFIG_CACHE_L2X0 |
| 230 | l2x0_init(MMIO_P2V(CT_CA9X4_L2CC), 0x00000000, 0xfe0fffff); | 230 | void __iomem *l2x0_base = MMIO_P2V(CT_CA9X4_L2CC); |
| 231 | |||
| 232 | /* set RAM latencies to 1 cycle for this core tile. */ | ||
| 233 | writel(0, l2x0_base + L2X0_TAG_LATENCY_CTRL); | ||
| 234 | writel(0, l2x0_base + L2X0_DATA_LATENCY_CTRL); | ||
| 235 | |||
| 236 | l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff); | ||
| 231 | #endif | 237 | #endif |
| 232 | 238 | ||
| 233 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 239 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index 817f0ad38a0b..7eaa232180a5 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
| @@ -48,7 +48,7 @@ void __init v2m_map_io(struct map_desc *tile, size_t num) | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | 50 | ||
| 51 | static void v2m_timer_init(void) | 51 | static void __init v2m_timer_init(void) |
| 52 | { | 52 | { |
| 53 | writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL); | 53 | writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL); |
| 54 | writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL); | 54 | writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL); |
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index d073b64ae87e..724ba3bce72c 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
| @@ -885,8 +885,23 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
| 885 | 885 | ||
| 886 | if (ai_usermode & UM_SIGNAL) | 886 | if (ai_usermode & UM_SIGNAL) |
| 887 | force_sig(SIGBUS, current); | 887 | force_sig(SIGBUS, current); |
| 888 | else | 888 | else { |
| 889 | set_cr(cr_no_alignment); | 889 | /* |
| 890 | * We're about to disable the alignment trap and return to | ||
| 891 | * user space. But if an interrupt occurs before actually | ||
| 892 | * reaching user space, then the IRQ vector entry code will | ||
| 893 | * notice that we were still in kernel space and therefore | ||
| 894 | * the alignment trap won't be re-enabled in that case as it | ||
| 895 | * is presumed to be always on from kernel space. | ||
| 896 | * Let's prevent that race by disabling interrupts here (they | ||
| 897 | * are disabled on the way back to user space anyway in | ||
| 898 | * entry-common.S) and disable the alignment trap only if | ||
| 899 | * there is no work pending for this thread. | ||
| 900 | */ | ||
| 901 | raw_local_irq_disable(); | ||
| 902 | if (!(current_thread_info()->flags & _TIF_WORK_MASK)) | ||
| 903 | set_cr(cr_no_alignment); | ||
| 904 | } | ||
| 890 | 905 | ||
| 891 | return 0; | 906 | return 0; |
| 892 | } | 907 | } |
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index ab506272b2d3..17e7b0b57e49 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c | |||
| @@ -204,8 +204,12 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn, | |||
| 204 | /* | 204 | /* |
| 205 | * Don't allow RAM to be mapped - this causes problems with ARMv6+ | 205 | * Don't allow RAM to be mapped - this causes problems with ARMv6+ |
| 206 | */ | 206 | */ |
| 207 | if (WARN_ON(pfn_valid(pfn))) | 207 | if (pfn_valid(pfn)) { |
| 208 | return NULL; | 208 | printk(KERN_WARNING "BUG: Your driver calls ioremap() on system memory. This leads\n" |
| 209 | KERN_WARNING "to architecturally unpredictable behaviour on ARMv6+, and ioremap()\n" | ||
| 210 | KERN_WARNING "will fail in the next kernel release. Please fix your driver.\n"); | ||
| 211 | WARN_ON(1); | ||
| 212 | } | ||
| 209 | 213 | ||
| 210 | type = get_mem_type(mtype); | 214 | type = get_mem_type(mtype); |
| 211 | if (!type) | 215 | if (!type) |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 6e1c4f6a2b3f..e8ed9dc461fe 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/nodemask.h> | 15 | #include <linux/nodemask.h> |
| 16 | #include <linux/memblock.h> | 16 | #include <linux/memblock.h> |
| 17 | #include <linux/sort.h> | 17 | #include <linux/sort.h> |
| 18 | #include <linux/fs.h> | ||
| 18 | 19 | ||
| 19 | #include <asm/cputype.h> | 20 | #include <asm/cputype.h> |
| 20 | #include <asm/sections.h> | 21 | #include <asm/sections.h> |
| @@ -246,6 +247,9 @@ static struct mem_type mem_types[] = { | |||
| 246 | .domain = DOMAIN_USER, | 247 | .domain = DOMAIN_USER, |
| 247 | }, | 248 | }, |
| 248 | [MT_MEMORY] = { | 249 | [MT_MEMORY] = { |
| 250 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | | ||
| 251 | L_PTE_WRITE | L_PTE_EXEC, | ||
| 252 | .prot_l1 = PMD_TYPE_TABLE, | ||
| 249 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, | 253 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, |
| 250 | .domain = DOMAIN_KERNEL, | 254 | .domain = DOMAIN_KERNEL, |
| 251 | }, | 255 | }, |
| @@ -254,6 +258,9 @@ static struct mem_type mem_types[] = { | |||
| 254 | .domain = DOMAIN_KERNEL, | 258 | .domain = DOMAIN_KERNEL, |
| 255 | }, | 259 | }, |
| 256 | [MT_MEMORY_NONCACHED] = { | 260 | [MT_MEMORY_NONCACHED] = { |
| 261 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | | ||
| 262 | L_PTE_WRITE | L_PTE_EXEC | L_PTE_MT_BUFFERABLE, | ||
| 263 | .prot_l1 = PMD_TYPE_TABLE, | ||
| 257 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, | 264 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, |
| 258 | .domain = DOMAIN_KERNEL, | 265 | .domain = DOMAIN_KERNEL, |
| 259 | }, | 266 | }, |
| @@ -411,9 +418,12 @@ static void __init build_mem_type_table(void) | |||
| 411 | * Enable CPU-specific coherency if supported. | 418 | * Enable CPU-specific coherency if supported. |
| 412 | * (Only available on XSC3 at the moment.) | 419 | * (Only available on XSC3 at the moment.) |
| 413 | */ | 420 | */ |
| 414 | if (arch_is_coherent() && cpu_is_xsc3()) | 421 | if (arch_is_coherent() && cpu_is_xsc3()) { |
| 415 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; | 422 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; |
| 416 | 423 | mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED; | |
| 424 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S; | ||
| 425 | mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED; | ||
| 426 | } | ||
| 417 | /* | 427 | /* |
| 418 | * ARMv6 and above have extended page tables. | 428 | * ARMv6 and above have extended page tables. |
| 419 | */ | 429 | */ |
| @@ -438,7 +448,9 @@ static void __init build_mem_type_table(void) | |||
| 438 | mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S; | 448 | mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S; |
| 439 | mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED; | 449 | mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED; |
| 440 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; | 450 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; |
| 451 | mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED; | ||
| 441 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S; | 452 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S; |
| 453 | mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED; | ||
| 442 | #endif | 454 | #endif |
| 443 | } | 455 | } |
| 444 | 456 | ||
| @@ -475,6 +487,8 @@ static void __init build_mem_type_table(void) | |||
| 475 | mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; | 487 | mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; |
| 476 | mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; | 488 | mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; |
| 477 | mem_types[MT_MEMORY].prot_sect |= ecc_mask | cp->pmd; | 489 | mem_types[MT_MEMORY].prot_sect |= ecc_mask | cp->pmd; |
| 490 | mem_types[MT_MEMORY].prot_pte |= kern_pgprot; | ||
| 491 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= ecc_mask; | ||
| 478 | mem_types[MT_ROM].prot_sect |= cp->pmd; | 492 | mem_types[MT_ROM].prot_sect |= cp->pmd; |
| 479 | 493 | ||
| 480 | switch (cp->pmd) { | 494 | switch (cp->pmd) { |
| @@ -498,6 +512,19 @@ static void __init build_mem_type_table(void) | |||
| 498 | } | 512 | } |
| 499 | } | 513 | } |
| 500 | 514 | ||
| 515 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE | ||
| 516 | pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | ||
| 517 | unsigned long size, pgprot_t vma_prot) | ||
| 518 | { | ||
| 519 | if (!pfn_valid(pfn)) | ||
| 520 | return pgprot_noncached(vma_prot); | ||
| 521 | else if (file->f_flags & O_SYNC) | ||
| 522 | return pgprot_writecombine(vma_prot); | ||
| 523 | return vma_prot; | ||
| 524 | } | ||
| 525 | EXPORT_SYMBOL(phys_mem_access_prot); | ||
| 526 | #endif | ||
| 527 | |||
| 501 | #define vectors_base() (vectors_high() ? 0xffff0000 : 0) | 528 | #define vectors_base() (vectors_high() ? 0xffff0000 : 0) |
| 502 | 529 | ||
| 503 | static void __init *early_alloc(unsigned long sz) | 530 | static void __init *early_alloc(unsigned long sz) |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 6a8506d99ee9..197f21bed5e9 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
| @@ -186,13 +186,14 @@ cpu_v7_name: | |||
| 186 | * It is assumed that: | 186 | * It is assumed that: |
| 187 | * - cache type register is implemented | 187 | * - cache type register is implemented |
| 188 | */ | 188 | */ |
| 189 | __v7_setup: | 189 | __v7_ca9mp_setup: |
| 190 | #ifdef CONFIG_SMP | 190 | #ifdef CONFIG_SMP |
| 191 | mrc p15, 0, r0, c1, c0, 1 | 191 | mrc p15, 0, r0, c1, c0, 1 |
| 192 | tst r0, #(1 << 6) @ SMP/nAMP mode enabled? | 192 | tst r0, #(1 << 6) @ SMP/nAMP mode enabled? |
| 193 | orreq r0, r0, #(1 << 6) | (1 << 0) @ Enable SMP/nAMP mode and | 193 | orreq r0, r0, #(1 << 6) | (1 << 0) @ Enable SMP/nAMP mode and |
| 194 | mcreq p15, 0, r0, c1, c0, 1 @ TLB ops broadcasting | 194 | mcreq p15, 0, r0, c1, c0, 1 @ TLB ops broadcasting |
| 195 | #endif | 195 | #endif |
| 196 | __v7_setup: | ||
| 196 | adr r12, __v7_setup_stack @ the local stack | 197 | adr r12, __v7_setup_stack @ the local stack |
| 197 | stmia r12, {r0-r5, r7, r9, r11, lr} | 198 | stmia r12, {r0-r5, r7, r9, r11, lr} |
| 198 | bl v7_flush_dcache_all | 199 | bl v7_flush_dcache_all |
| @@ -201,11 +202,16 @@ __v7_setup: | |||
| 201 | mrc p15, 0, r0, c0, c0, 0 @ read main ID register | 202 | mrc p15, 0, r0, c0, c0, 0 @ read main ID register |
| 202 | and r10, r0, #0xff000000 @ ARM? | 203 | and r10, r0, #0xff000000 @ ARM? |
| 203 | teq r10, #0x41000000 | 204 | teq r10, #0x41000000 |
| 204 | bne 2f | 205 | bne 3f |
| 205 | and r5, r0, #0x00f00000 @ variant | 206 | and r5, r0, #0x00f00000 @ variant |
| 206 | and r6, r0, #0x0000000f @ revision | 207 | and r6, r0, #0x0000000f @ revision |
| 207 | orr r0, r6, r5, lsr #20-4 @ combine variant and revision | 208 | orr r6, r6, r5, lsr #20-4 @ combine variant and revision |
| 209 | ubfx r0, r0, #4, #12 @ primary part number | ||
| 208 | 210 | ||
| 211 | /* Cortex-A8 Errata */ | ||
| 212 | ldr r10, =0x00000c08 @ Cortex-A8 primary part number | ||
| 213 | teq r0, r10 | ||
| 214 | bne 2f | ||
| 209 | #ifdef CONFIG_ARM_ERRATA_430973 | 215 | #ifdef CONFIG_ARM_ERRATA_430973 |
| 210 | teq r5, #0x00100000 @ only present in r1p* | 216 | teq r5, #0x00100000 @ only present in r1p* |
| 211 | mrceq p15, 0, r10, c1, c0, 1 @ read aux control register | 217 | mrceq p15, 0, r10, c1, c0, 1 @ read aux control register |
| @@ -213,21 +219,50 @@ __v7_setup: | |||
| 213 | mcreq p15, 0, r10, c1, c0, 1 @ write aux control register | 219 | mcreq p15, 0, r10, c1, c0, 1 @ write aux control register |
| 214 | #endif | 220 | #endif |
| 215 | #ifdef CONFIG_ARM_ERRATA_458693 | 221 | #ifdef CONFIG_ARM_ERRATA_458693 |
| 216 | teq r0, #0x20 @ only present in r2p0 | 222 | teq r6, #0x20 @ only present in r2p0 |
| 217 | mrceq p15, 0, r10, c1, c0, 1 @ read aux control register | 223 | mrceq p15, 0, r10, c1, c0, 1 @ read aux control register |
| 218 | orreq r10, r10, #(1 << 5) @ set L1NEON to 1 | 224 | orreq r10, r10, #(1 << 5) @ set L1NEON to 1 |
| 219 | orreq r10, r10, #(1 << 9) @ set PLDNOP to 1 | 225 | orreq r10, r10, #(1 << 9) @ set PLDNOP to 1 |
| 220 | mcreq p15, 0, r10, c1, c0, 1 @ write aux control register | 226 | mcreq p15, 0, r10, c1, c0, 1 @ write aux control register |
| 221 | #endif | 227 | #endif |
| 222 | #ifdef CONFIG_ARM_ERRATA_460075 | 228 | #ifdef CONFIG_ARM_ERRATA_460075 |
| 223 | teq r0, #0x20 @ only present in r2p0 | 229 | teq r6, #0x20 @ only present in r2p0 |
| 224 | mrceq p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register | 230 | mrceq p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register |
| 225 | tsteq r10, #1 << 22 | 231 | tsteq r10, #1 << 22 |
| 226 | orreq r10, r10, #(1 << 22) @ set the Write Allocate disable bit | 232 | orreq r10, r10, #(1 << 22) @ set the Write Allocate disable bit |
| 227 | mcreq p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register | 233 | mcreq p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register |
| 228 | #endif | 234 | #endif |
| 235 | b 3f | ||
| 229 | 236 | ||
| 230 | 2: mov r10, #0 | 237 | /* Cortex-A9 Errata */ |
| 238 | 2: ldr r10, =0x00000c09 @ Cortex-A9 primary part number | ||
| 239 | teq r0, r10 | ||
| 240 | bne 3f | ||
| 241 | #ifdef CONFIG_ARM_ERRATA_742230 | ||
| 242 | cmp r6, #0x22 @ only present up to r2p2 | ||
| 243 | mrcle p15, 0, r10, c15, c0, 1 @ read diagnostic register | ||
| 244 | orrle r10, r10, #1 << 4 @ set bit #4 | ||
| 245 | mcrle p15, 0, r10, c15, c0, 1 @ write diagnostic register | ||
| 246 | #endif | ||
| 247 | #ifdef CONFIG_ARM_ERRATA_742231 | ||
| 248 | teq r6, #0x20 @ present in r2p0 | ||
| 249 | teqne r6, #0x21 @ present in r2p1 | ||
| 250 | teqne r6, #0x22 @ present in r2p2 | ||
| 251 | mrceq p15, 0, r10, c15, c0, 1 @ read diagnostic register | ||
| 252 | orreq r10, r10, #1 << 12 @ set bit #12 | ||
| 253 | orreq r10, r10, #1 << 22 @ set bit #22 | ||
| 254 | mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register | ||
| 255 | #endif | ||
| 256 | #ifdef CONFIG_ARM_ERRATA_743622 | ||
| 257 | teq r6, #0x20 @ present in r2p0 | ||
| 258 | teqne r6, #0x21 @ present in r2p1 | ||
| 259 | teqne r6, #0x22 @ present in r2p2 | ||
| 260 | mrceq p15, 0, r10, c15, c0, 1 @ read diagnostic register | ||
| 261 | orreq r10, r10, #1 << 6 @ set bit #6 | ||
| 262 | mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register | ||
| 263 | #endif | ||
| 264 | |||
| 265 | 3: mov r10, #0 | ||
| 231 | #ifdef HARVARD_CACHE | 266 | #ifdef HARVARD_CACHE |
| 232 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate | 267 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate |
| 233 | #endif | 268 | #endif |
| @@ -323,6 +358,29 @@ cpu_elf_name: | |||
| 323 | 358 | ||
| 324 | .section ".proc.info.init", #alloc, #execinstr | 359 | .section ".proc.info.init", #alloc, #execinstr |
| 325 | 360 | ||
| 361 | .type __v7_ca9mp_proc_info, #object | ||
| 362 | __v7_ca9mp_proc_info: | ||
| 363 | .long 0x410fc090 @ Required ID value | ||
| 364 | .long 0xff0ffff0 @ Mask for ID | ||
| 365 | .long PMD_TYPE_SECT | \ | ||
| 366 | PMD_SECT_AP_WRITE | \ | ||
| 367 | PMD_SECT_AP_READ | \ | ||
| 368 | PMD_FLAGS | ||
| 369 | .long PMD_TYPE_SECT | \ | ||
| 370 | PMD_SECT_XN | \ | ||
| 371 | PMD_SECT_AP_WRITE | \ | ||
| 372 | PMD_SECT_AP_READ | ||
| 373 | b __v7_ca9mp_setup | ||
| 374 | .long cpu_arch_name | ||
| 375 | .long cpu_elf_name | ||
| 376 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_TLS | ||
| 377 | .long cpu_v7_name | ||
| 378 | .long v7_processor_functions | ||
| 379 | .long v7wbi_tlb_fns | ||
| 380 | .long v6_user_fns | ||
| 381 | .long v7_cache_fns | ||
| 382 | .size __v7_ca9mp_proc_info, . - __v7_ca9mp_proc_info | ||
| 383 | |||
| 326 | /* | 384 | /* |
| 327 | * Match any ARMv7 processor core. | 385 | * Match any ARMv7 processor core. |
| 328 | */ | 386 | */ |
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c index 0691176899ff..72e09eb642dd 100644 --- a/arch/arm/oprofile/common.c +++ b/arch/arm/oprofile/common.c | |||
| @@ -102,6 +102,7 @@ static int op_create_counter(int cpu, int event) | |||
| 102 | if (IS_ERR(pevent)) { | 102 | if (IS_ERR(pevent)) { |
| 103 | ret = PTR_ERR(pevent); | 103 | ret = PTR_ERR(pevent); |
| 104 | } else if (pevent->state != PERF_EVENT_STATE_ACTIVE) { | 104 | } else if (pevent->state != PERF_EVENT_STATE_ACTIVE) { |
| 105 | perf_event_release_kernel(pevent); | ||
| 105 | pr_warning("oprofile: failed to enable event %d " | 106 | pr_warning("oprofile: failed to enable event %d " |
| 106 | "on CPU %d\n", event, cpu); | 107 | "on CPU %d\n", event, cpu); |
| 107 | ret = -EBUSY; | 108 | ret = -EBUSY; |
| @@ -365,6 +366,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
| 365 | ret = init_driverfs(); | 366 | ret = init_driverfs(); |
| 366 | if (ret) { | 367 | if (ret) { |
| 367 | kfree(counter_config); | 368 | kfree(counter_config); |
| 369 | counter_config = NULL; | ||
| 368 | return ret; | 370 | return ret; |
| 369 | } | 371 | } |
| 370 | 372 | ||
| @@ -402,7 +404,6 @@ void oprofile_arch_exit(void) | |||
| 402 | struct perf_event *event; | 404 | struct perf_event *event; |
| 403 | 405 | ||
| 404 | if (*perf_events) { | 406 | if (*perf_events) { |
| 405 | exit_driverfs(); | ||
| 406 | for_each_possible_cpu(cpu) { | 407 | for_each_possible_cpu(cpu) { |
| 407 | for (id = 0; id < perf_num_counters; ++id) { | 408 | for (id = 0; id < perf_num_counters; ++id) { |
| 408 | event = perf_events[cpu][id]; | 409 | event = perf_events[cpu][id]; |
| @@ -413,8 +414,10 @@ void oprofile_arch_exit(void) | |||
| 413 | } | 414 | } |
| 414 | } | 415 | } |
| 415 | 416 | ||
| 416 | if (counter_config) | 417 | if (counter_config) { |
| 417 | kfree(counter_config); | 418 | kfree(counter_config); |
| 419 | exit_driverfs(); | ||
| 420 | } | ||
| 418 | } | 421 | } |
| 419 | #else | 422 | #else |
| 420 | int __init oprofile_arch_init(struct oprofile_operations *ops) | 423 | int __init oprofile_arch_init(struct oprofile_operations *ops) |
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index ea3ca86c5283..aedf9c1d645e 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/arch/arm/mach-nomadik/timer.c | 2 | * linux/arch/arm/plat-nomadik/timer.c |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2008 STMicroelectronics | 4 | * Copyright (C) 2008 STMicroelectronics |
| 5 | * Copyright (C) 2010 Alessandro Rubini | 5 | * Copyright (C) 2010 Alessandro Rubini |
| @@ -75,7 +75,7 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode, | |||
| 75 | cr = readl(mtu_base + MTU_CR(1)); | 75 | cr = readl(mtu_base + MTU_CR(1)); |
| 76 | writel(0, mtu_base + MTU_LR(1)); | 76 | writel(0, mtu_base + MTU_LR(1)); |
| 77 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1)); | 77 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1)); |
| 78 | writel(0x2, mtu_base + MTU_IMSC); | 78 | writel(1 << 1, mtu_base + MTU_IMSC); |
| 79 | break; | 79 | break; |
| 80 | case CLOCK_EVT_MODE_SHUTDOWN: | 80 | case CLOCK_EVT_MODE_SHUTDOWN: |
| 81 | case CLOCK_EVT_MODE_UNUSED: | 81 | case CLOCK_EVT_MODE_UNUSED: |
| @@ -131,25 +131,23 @@ void __init nmdk_timer_init(void) | |||
| 131 | { | 131 | { |
| 132 | unsigned long rate; | 132 | unsigned long rate; |
| 133 | struct clk *clk0; | 133 | struct clk *clk0; |
| 134 | struct clk *clk1; | 134 | u32 cr = MTU_CRn_32BITS; |
| 135 | u32 cr; | ||
| 136 | 135 | ||
| 137 | clk0 = clk_get_sys("mtu0", NULL); | 136 | clk0 = clk_get_sys("mtu0", NULL); |
| 138 | BUG_ON(IS_ERR(clk0)); | 137 | BUG_ON(IS_ERR(clk0)); |
| 139 | 138 | ||
| 140 | clk1 = clk_get_sys("mtu1", NULL); | ||
| 141 | BUG_ON(IS_ERR(clk1)); | ||
| 142 | |||
| 143 | clk_enable(clk0); | 139 | clk_enable(clk0); |
| 144 | clk_enable(clk1); | ||
| 145 | 140 | ||
| 146 | /* | 141 | /* |
| 147 | * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500: | 142 | * Tick rate is 2.4MHz for Nomadik and 2.4Mhz, 100MHz or 133 MHz |
| 148 | * use a divide-by-16 counter if it's more than 16MHz | 143 | * for ux500. |
| 144 | * Use a divide-by-16 counter if the tick rate is more than 32MHz. | ||
| 145 | * At 32 MHz, the timer (with 32 bit counter) can be programmed | ||
| 146 | * to wake-up at a max 127s a head in time. Dividing a 2.4 MHz timer | ||
| 147 | * with 16 gives too low timer resolution. | ||
| 149 | */ | 148 | */ |
| 150 | cr = MTU_CRn_32BITS;; | ||
| 151 | rate = clk_get_rate(clk0); | 149 | rate = clk_get_rate(clk0); |
| 152 | if (rate > 16 << 20) { | 150 | if (rate > 32000000) { |
| 153 | rate /= 16; | 151 | rate /= 16; |
| 154 | cr |= MTU_CRn_PRESCALE_16; | 152 | cr |= MTU_CRn_PRESCALE_16; |
| 155 | } else { | 153 | } else { |
| @@ -170,15 +168,8 @@ void __init nmdk_timer_init(void) | |||
| 170 | pr_err("timer: failed to initialize clock source %s\n", | 168 | pr_err("timer: failed to initialize clock source %s\n", |
| 171 | nmdk_clksrc.name); | 169 | nmdk_clksrc.name); |
| 172 | 170 | ||
| 173 | /* Timer 1 is used for events, fix according to rate */ | 171 | /* Timer 1 is used for events */ |
| 174 | cr = MTU_CRn_32BITS; | 172 | |
| 175 | rate = clk_get_rate(clk1); | ||
| 176 | if (rate > 16 << 20) { | ||
| 177 | rate /= 16; | ||
| 178 | cr |= MTU_CRn_PRESCALE_16; | ||
| 179 | } else { | ||
| 180 | cr |= MTU_CRn_PRESCALE_1; | ||
| 181 | } | ||
| 182 | clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE); | 173 | clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE); |
| 183 | 174 | ||
| 184 | writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */ | 175 | writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */ |
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index e39a417a368d..a92cb499313f 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
| @@ -33,7 +33,7 @@ config OMAP_DEBUG_DEVICES | |||
| 33 | config OMAP_DEBUG_LEDS | 33 | config OMAP_DEBUG_LEDS |
| 34 | bool | 34 | bool |
| 35 | depends on OMAP_DEBUG_DEVICES | 35 | depends on OMAP_DEBUG_DEVICES |
| 36 | default y if LEDS | 36 | default y if LEDS_CLASS |
| 37 | 37 | ||
| 38 | config OMAP_RESET_CLOCKS | 38 | config OMAP_RESET_CLOCKS |
| 39 | bool "Reset unused clocks during boot" | 39 | bool "Reset unused clocks during boot" |
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index a202a2ce6e3d..6cd151b31bc5 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c | |||
| @@ -320,6 +320,7 @@ void flush_iotlb_page(struct iommu *obj, u32 da) | |||
| 320 | if ((start <= da) && (da < start + bytes)) { | 320 | if ((start <= da) && (da < start + bytes)) { |
| 321 | dev_dbg(obj->dev, "%s: %08x<=%08x(%x)\n", | 321 | dev_dbg(obj->dev, "%s: %08x<=%08x(%x)\n", |
| 322 | __func__, start, da, bytes); | 322 | __func__, start, da, bytes); |
| 323 | iotlb_load_cr(obj, &cr); | ||
| 323 | iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY); | 324 | iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY); |
| 324 | } | 325 | } |
| 325 | } | 326 | } |
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index e31496e35b0f..0c8612fd8312 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
| @@ -156,7 +156,7 @@ static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id) | |||
| 156 | /* Writing zero to RSYNC_ERR clears the IRQ */ | 156 | /* Writing zero to RSYNC_ERR clears the IRQ */ |
| 157 | MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1)); | 157 | MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1)); |
| 158 | } else { | 158 | } else { |
| 159 | complete(&mcbsp_rx->tx_irq_completion); | 159 | complete(&mcbsp_rx->rx_irq_completion); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | return IRQ_HANDLED; | 162 | return IRQ_HANDLED; |
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 226b2e858d6c..10b3b4c63372 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
| @@ -220,20 +220,7 @@ void __init omap_map_sram(void) | |||
| 220 | if (omap_sram_size == 0) | 220 | if (omap_sram_size == 0) |
| 221 | return; | 221 | return; |
| 222 | 222 | ||
| 223 | if (cpu_is_omap24xx()) { | ||
| 224 | omap_sram_io_desc[0].virtual = OMAP2_SRAM_VA; | ||
| 225 | |||
| 226 | base = OMAP2_SRAM_PA; | ||
| 227 | base = ROUND_DOWN(base, PAGE_SIZE); | ||
| 228 | omap_sram_io_desc[0].pfn = __phys_to_pfn(base); | ||
| 229 | } | ||
| 230 | |||
| 231 | if (cpu_is_omap34xx()) { | 223 | if (cpu_is_omap34xx()) { |
| 232 | omap_sram_io_desc[0].virtual = OMAP3_SRAM_VA; | ||
| 233 | base = OMAP3_SRAM_PA; | ||
| 234 | base = ROUND_DOWN(base, PAGE_SIZE); | ||
| 235 | omap_sram_io_desc[0].pfn = __phys_to_pfn(base); | ||
| 236 | |||
| 237 | /* | 224 | /* |
| 238 | * SRAM must be marked as non-cached on OMAP3 since the | 225 | * SRAM must be marked as non-cached on OMAP3 since the |
| 239 | * CORE DPLL M2 divider change code (in SRAM) runs with the | 226 | * CORE DPLL M2 divider change code (in SRAM) runs with the |
| @@ -244,13 +231,11 @@ void __init omap_map_sram(void) | |||
| 244 | omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED; | 231 | omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED; |
| 245 | } | 232 | } |
| 246 | 233 | ||
| 247 | if (cpu_is_omap44xx()) { | 234 | omap_sram_io_desc[0].virtual = omap_sram_base; |
| 248 | omap_sram_io_desc[0].virtual = OMAP4_SRAM_VA; | 235 | base = omap_sram_start; |
| 249 | base = OMAP4_SRAM_PA; | 236 | base = ROUND_DOWN(base, PAGE_SIZE); |
| 250 | base = ROUND_DOWN(base, PAGE_SIZE); | 237 | omap_sram_io_desc[0].pfn = __phys_to_pfn(base); |
| 251 | omap_sram_io_desc[0].pfn = __phys_to_pfn(base); | 238 | omap_sram_io_desc[0].length = ROUND_DOWN(omap_sram_size, PAGE_SIZE); |
| 252 | } | ||
| 253 | omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */ | ||
| 254 | iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc)); | 239 | iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc)); |
| 255 | 240 | ||
| 256 | printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n", | 241 | printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n", |
diff --git a/arch/arm/plat-s5p/dev-fimc0.c b/arch/arm/plat-s5p/dev-fimc0.c index d3f1a9b5d2b5..608770fc1531 100644 --- a/arch/arm/plat-s5p/dev-fimc0.c +++ b/arch/arm/plat-s5p/dev-fimc0.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
| 13 | #include <linux/dma-mapping.h> | ||
| 13 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
| 14 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
| 15 | #include <linux/ioport.h> | 16 | #include <linux/ioport.h> |
| @@ -18,7 +19,7 @@ | |||
| 18 | static struct resource s5p_fimc0_resource[] = { | 19 | static struct resource s5p_fimc0_resource[] = { |
| 19 | [0] = { | 20 | [0] = { |
| 20 | .start = S5P_PA_FIMC0, | 21 | .start = S5P_PA_FIMC0, |
| 21 | .end = S5P_PA_FIMC0 + SZ_1M - 1, | 22 | .end = S5P_PA_FIMC0 + SZ_4K - 1, |
| 22 | .flags = IORESOURCE_MEM, | 23 | .flags = IORESOURCE_MEM, |
| 23 | }, | 24 | }, |
| 24 | [1] = { | 25 | [1] = { |
| @@ -28,9 +29,15 @@ static struct resource s5p_fimc0_resource[] = { | |||
| 28 | }, | 29 | }, |
| 29 | }; | 30 | }; |
| 30 | 31 | ||
| 32 | static u64 s5p_fimc0_dma_mask = DMA_BIT_MASK(32); | ||
| 33 | |||
| 31 | struct platform_device s5p_device_fimc0 = { | 34 | struct platform_device s5p_device_fimc0 = { |
| 32 | .name = "s5p-fimc", | 35 | .name = "s5p-fimc", |
| 33 | .id = 0, | 36 | .id = 0, |
| 34 | .num_resources = ARRAY_SIZE(s5p_fimc0_resource), | 37 | .num_resources = ARRAY_SIZE(s5p_fimc0_resource), |
| 35 | .resource = s5p_fimc0_resource, | 38 | .resource = s5p_fimc0_resource, |
| 39 | .dev = { | ||
| 40 | .dma_mask = &s5p_fimc0_dma_mask, | ||
| 41 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
| 42 | }, | ||
| 36 | }; | 43 | }; |
diff --git a/arch/arm/plat-s5p/dev-fimc1.c b/arch/arm/plat-s5p/dev-fimc1.c index 41bd6986d0ad..76e3a97a87d3 100644 --- a/arch/arm/plat-s5p/dev-fimc1.c +++ b/arch/arm/plat-s5p/dev-fimc1.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
| 13 | #include <linux/dma-mapping.h> | ||
| 13 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
| 14 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
| 15 | #include <linux/ioport.h> | 16 | #include <linux/ioport.h> |
| @@ -18,7 +19,7 @@ | |||
| 18 | static struct resource s5p_fimc1_resource[] = { | 19 | static struct resource s5p_fimc1_resource[] = { |
| 19 | [0] = { | 20 | [0] = { |
| 20 | .start = S5P_PA_FIMC1, | 21 | .start = S5P_PA_FIMC1, |
| 21 | .end = S5P_PA_FIMC1 + SZ_1M - 1, | 22 | .end = S5P_PA_FIMC1 + SZ_4K - 1, |
| 22 | .flags = IORESOURCE_MEM, | 23 | .flags = IORESOURCE_MEM, |
| 23 | }, | 24 | }, |
| 24 | [1] = { | 25 | [1] = { |
| @@ -28,9 +29,15 @@ static struct resource s5p_fimc1_resource[] = { | |||
| 28 | }, | 29 | }, |
| 29 | }; | 30 | }; |
| 30 | 31 | ||
| 32 | static u64 s5p_fimc1_dma_mask = DMA_BIT_MASK(32); | ||
| 33 | |||
| 31 | struct platform_device s5p_device_fimc1 = { | 34 | struct platform_device s5p_device_fimc1 = { |
| 32 | .name = "s5p-fimc", | 35 | .name = "s5p-fimc", |
| 33 | .id = 1, | 36 | .id = 1, |
| 34 | .num_resources = ARRAY_SIZE(s5p_fimc1_resource), | 37 | .num_resources = ARRAY_SIZE(s5p_fimc1_resource), |
| 35 | .resource = s5p_fimc1_resource, | 38 | .resource = s5p_fimc1_resource, |
| 39 | .dev = { | ||
| 40 | .dma_mask = &s5p_fimc1_dma_mask, | ||
| 41 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
| 42 | }, | ||
| 36 | }; | 43 | }; |
diff --git a/arch/arm/plat-s5p/dev-fimc2.c b/arch/arm/plat-s5p/dev-fimc2.c index dfddeda6d4a3..24d29816fa2c 100644 --- a/arch/arm/plat-s5p/dev-fimc2.c +++ b/arch/arm/plat-s5p/dev-fimc2.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
| 13 | #include <linux/dma-mapping.h> | ||
| 13 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
| 14 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
| 15 | #include <linux/ioport.h> | 16 | #include <linux/ioport.h> |
| @@ -18,7 +19,7 @@ | |||
| 18 | static struct resource s5p_fimc2_resource[] = { | 19 | static struct resource s5p_fimc2_resource[] = { |
| 19 | [0] = { | 20 | [0] = { |
| 20 | .start = S5P_PA_FIMC2, | 21 | .start = S5P_PA_FIMC2, |
| 21 | .end = S5P_PA_FIMC2 + SZ_1M - 1, | 22 | .end = S5P_PA_FIMC2 + SZ_4K - 1, |
| 22 | .flags = IORESOURCE_MEM, | 23 | .flags = IORESOURCE_MEM, |
| 23 | }, | 24 | }, |
| 24 | [1] = { | 25 | [1] = { |
| @@ -28,9 +29,15 @@ static struct resource s5p_fimc2_resource[] = { | |||
| 28 | }, | 29 | }, |
| 29 | }; | 30 | }; |
| 30 | 31 | ||
| 32 | static u64 s5p_fimc2_dma_mask = DMA_BIT_MASK(32); | ||
| 33 | |||
| 31 | struct platform_device s5p_device_fimc2 = { | 34 | struct platform_device s5p_device_fimc2 = { |
| 32 | .name = "s5p-fimc", | 35 | .name = "s5p-fimc", |
| 33 | .id = 2, | 36 | .id = 2, |
| 34 | .num_resources = ARRAY_SIZE(s5p_fimc2_resource), | 37 | .num_resources = ARRAY_SIZE(s5p_fimc2_resource), |
| 35 | .resource = s5p_fimc2_resource, | 38 | .resource = s5p_fimc2_resource, |
| 39 | .dev = { | ||
| 40 | .dma_mask = &s5p_fimc2_dma_mask, | ||
| 41 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
| 42 | }, | ||
| 36 | }; | 43 | }; |
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index 04d9521ddc9f..e8f2be2d67f2 100644 --- a/arch/arm/plat-samsung/adc.c +++ b/arch/arm/plat-samsung/adc.c | |||
| @@ -435,7 +435,6 @@ static int s3c_adc_suspend(struct platform_device *pdev, pm_message_t state) | |||
| 435 | static int s3c_adc_resume(struct platform_device *pdev) | 435 | static int s3c_adc_resume(struct platform_device *pdev) |
| 436 | { | 436 | { |
| 437 | struct adc_device *adc = platform_get_drvdata(pdev); | 437 | struct adc_device *adc = platform_get_drvdata(pdev); |
| 438 | unsigned long flags; | ||
| 439 | 438 | ||
| 440 | clk_enable(adc->clk); | 439 | clk_enable(adc->clk); |
| 441 | enable_irq(adc->irq); | 440 | enable_irq(adc->irq); |
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index 90a20512d68d..e8d20b0bc50e 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c | |||
| @@ -48,6 +48,9 @@ | |||
| 48 | #include <plat/clock.h> | 48 | #include <plat/clock.h> |
| 49 | #include <plat/cpu.h> | 49 | #include <plat/cpu.h> |
| 50 | 50 | ||
| 51 | #include <linux/serial_core.h> | ||
| 52 | #include <plat/regs-serial.h> /* for s3c24xx_uart_devs */ | ||
| 53 | |||
| 51 | /* clock information */ | 54 | /* clock information */ |
| 52 | 55 | ||
| 53 | static LIST_HEAD(clocks); | 56 | static LIST_HEAD(clocks); |
| @@ -65,6 +68,28 @@ static int clk_null_enable(struct clk *clk, int enable) | |||
| 65 | return 0; | 68 | return 0; |
| 66 | } | 69 | } |
| 67 | 70 | ||
| 71 | static int dev_is_s3c_uart(struct device *dev) | ||
| 72 | { | ||
| 73 | struct platform_device **pdev = s3c24xx_uart_devs; | ||
| 74 | int i; | ||
| 75 | for (i = 0; i < ARRAY_SIZE(s3c24xx_uart_devs); i++, pdev++) | ||
| 76 | if (*pdev && dev == &(*pdev)->dev) | ||
| 77 | return 1; | ||
| 78 | return 0; | ||
| 79 | } | ||
| 80 | |||
| 81 | /* | ||
| 82 | * Serial drivers call get_clock() very early, before platform bus | ||
| 83 | * has been set up, this requires a special check to let them get | ||
| 84 | * a proper clock | ||
| 85 | */ | ||
| 86 | |||
| 87 | static int dev_is_platform_device(struct device *dev) | ||
| 88 | { | ||
| 89 | return dev->bus == &platform_bus_type || | ||
| 90 | (dev->bus == NULL && dev_is_s3c_uart(dev)); | ||
| 91 | } | ||
| 92 | |||
| 68 | /* Clock API calls */ | 93 | /* Clock API calls */ |
| 69 | 94 | ||
| 70 | struct clk *clk_get(struct device *dev, const char *id) | 95 | struct clk *clk_get(struct device *dev, const char *id) |
| @@ -73,7 +98,7 @@ struct clk *clk_get(struct device *dev, const char *id) | |||
| 73 | struct clk *clk = ERR_PTR(-ENOENT); | 98 | struct clk *clk = ERR_PTR(-ENOENT); |
| 74 | int idno; | 99 | int idno; |
| 75 | 100 | ||
| 76 | if (dev == NULL || dev->bus != &platform_bus_type) | 101 | if (dev == NULL || !dev_is_platform_device(dev)) |
| 77 | idno = -1; | 102 | idno = -1; |
| 78 | else | 103 | else |
| 79 | idno = to_platform_device(dev)->id; | 104 | idno = to_platform_device(dev)->id; |
diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c index 57b68a50f45e..e3d41eaed1ff 100644 --- a/arch/arm/plat-samsung/gpio-config.c +++ b/arch/arm/plat-samsung/gpio-config.c | |||
| @@ -273,13 +273,13 @@ s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin) | |||
| 273 | if (!chip) | 273 | if (!chip) |
| 274 | return -EINVAL; | 274 | return -EINVAL; |
| 275 | 275 | ||
| 276 | off = chip->chip.base - pin; | 276 | off = pin - chip->chip.base; |
| 277 | shift = off * 2; | 277 | shift = off * 2; |
| 278 | reg = chip->base + 0x0C; | 278 | reg = chip->base + 0x0C; |
| 279 | 279 | ||
| 280 | drvstr = __raw_readl(reg); | 280 | drvstr = __raw_readl(reg); |
| 281 | drvstr = 0xffff & (0x3 << shift); | ||
| 282 | drvstr = drvstr >> shift; | 281 | drvstr = drvstr >> shift; |
| 282 | drvstr &= 0x3; | ||
| 283 | 283 | ||
| 284 | return (__force s5p_gpio_drvstr_t)drvstr; | 284 | return (__force s5p_gpio_drvstr_t)drvstr; |
| 285 | } | 285 | } |
| @@ -296,11 +296,12 @@ int s5p_gpio_set_drvstr(unsigned int pin, s5p_gpio_drvstr_t drvstr) | |||
| 296 | if (!chip) | 296 | if (!chip) |
| 297 | return -EINVAL; | 297 | return -EINVAL; |
| 298 | 298 | ||
| 299 | off = chip->chip.base - pin; | 299 | off = pin - chip->chip.base; |
| 300 | shift = off * 2; | 300 | shift = off * 2; |
| 301 | reg = chip->base + 0x0C; | 301 | reg = chip->base + 0x0C; |
| 302 | 302 | ||
| 303 | tmp = __raw_readl(reg); | 303 | tmp = __raw_readl(reg); |
| 304 | tmp &= ~(0x3 << shift); | ||
| 304 | tmp |= drvstr << shift; | 305 | tmp |= drvstr << shift; |
| 305 | 306 | ||
| 306 | __raw_writel(tmp, reg); | 307 | __raw_writel(tmp, reg); |
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h index db4112c6f2be..1c6b92947c5d 100644 --- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h | |||
| @@ -143,12 +143,12 @@ extern s3c_gpio_pull_t s3c_gpio_getpull(unsigned int pin); | |||
| 143 | /* Define values for the drvstr available for each gpio pin. | 143 | /* Define values for the drvstr available for each gpio pin. |
| 144 | * | 144 | * |
| 145 | * These values control the value of the output signal driver strength, | 145 | * These values control the value of the output signal driver strength, |
| 146 | * configurable on most pins on the S5C series. | 146 | * configurable on most pins on the S5P series. |
| 147 | */ | 147 | */ |
| 148 | #define S5P_GPIO_DRVSTR_LV1 ((__force s5p_gpio_drvstr_t)0x00) | 148 | #define S5P_GPIO_DRVSTR_LV1 ((__force s5p_gpio_drvstr_t)0x0) |
| 149 | #define S5P_GPIO_DRVSTR_LV2 ((__force s5p_gpio_drvstr_t)0x01) | 149 | #define S5P_GPIO_DRVSTR_LV2 ((__force s5p_gpio_drvstr_t)0x2) |
| 150 | #define S5P_GPIO_DRVSTR_LV3 ((__force s5p_gpio_drvstr_t)0x10) | 150 | #define S5P_GPIO_DRVSTR_LV3 ((__force s5p_gpio_drvstr_t)0x1) |
| 151 | #define S5P_GPIO_DRVSTR_LV4 ((__force s5p_gpio_drvstr_t)0x11) | 151 | #define S5P_GPIO_DRVSTR_LV4 ((__force s5p_gpio_drvstr_t)0x3) |
| 152 | 152 | ||
| 153 | /** | 153 | /** |
| 154 | * s5c_gpio_get_drvstr() - get the driver streght value of a gpio pin | 154 | * s5c_gpio_get_drvstr() - get the driver streght value of a gpio pin |
diff --git a/arch/avr32/kernel/module.c b/arch/avr32/kernel/module.c index 98f94d041d9c..a727f54d64d6 100644 --- a/arch/avr32/kernel/module.c +++ b/arch/avr32/kernel/module.c | |||
| @@ -314,10 +314,9 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, | |||
| 314 | vfree(module->arch.syminfo); | 314 | vfree(module->arch.syminfo); |
| 315 | module->arch.syminfo = NULL; | 315 | module->arch.syminfo = NULL; |
| 316 | 316 | ||
| 317 | return module_bug_finalize(hdr, sechdrs, module); | 317 | return 0; |
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | void module_arch_cleanup(struct module *module) | 320 | void module_arch_cleanup(struct module *module) |
| 321 | { | 321 | { |
| 322 | module_bug_cleanup(module); | ||
| 323 | } | 322 | } |
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c index 0974c0ecc594..bab01298b58e 100644 --- a/arch/frv/kernel/signal.c +++ b/arch/frv/kernel/signal.c | |||
| @@ -121,6 +121,9 @@ static int restore_sigcontext(struct sigcontext __user *sc, int *_gr8) | |||
| 121 | struct user_context *user = current->thread.user; | 121 | struct user_context *user = current->thread.user; |
| 122 | unsigned long tbr, psr; | 122 | unsigned long tbr, psr; |
| 123 | 123 | ||
| 124 | /* Always make any pending restarted system calls return -EINTR */ | ||
| 125 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | ||
| 126 | |||
| 124 | tbr = user->i.tbr; | 127 | tbr = user->i.tbr; |
| 125 | psr = user->i.psr; | 128 | psr = user->i.psr; |
| 126 | if (copy_from_user(user, &sc->sc_context, sizeof(sc->sc_context))) | 129 | if (copy_from_user(user, &sc->sc_context, sizeof(sc->sc_context))) |
| @@ -250,6 +253,8 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set) | |||
| 250 | struct sigframe __user *frame; | 253 | struct sigframe __user *frame; |
| 251 | int rsig; | 254 | int rsig; |
| 252 | 255 | ||
| 256 | set_fs(USER_DS); | ||
| 257 | |||
| 253 | frame = get_sigframe(ka, sizeof(*frame)); | 258 | frame = get_sigframe(ka, sizeof(*frame)); |
| 254 | 259 | ||
| 255 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) | 260 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
| @@ -293,22 +298,23 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set) | |||
| 293 | (unsigned long) (frame->retcode + 2)); | 298 | (unsigned long) (frame->retcode + 2)); |
| 294 | } | 299 | } |
| 295 | 300 | ||
| 296 | /* set up registers for signal handler */ | 301 | /* Set up registers for the signal handler */ |
| 297 | __frame->sp = (unsigned long) frame; | ||
| 298 | __frame->lr = (unsigned long) &frame->retcode; | ||
| 299 | __frame->gr8 = sig; | ||
| 300 | |||
| 301 | if (current->personality & FDPIC_FUNCPTRS) { | 302 | if (current->personality & FDPIC_FUNCPTRS) { |
| 302 | struct fdpic_func_descriptor __user *funcptr = | 303 | struct fdpic_func_descriptor __user *funcptr = |
| 303 | (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; | 304 | (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; |
| 304 | __get_user(__frame->pc, &funcptr->text); | 305 | struct fdpic_func_descriptor desc; |
| 305 | __get_user(__frame->gr15, &funcptr->GOT); | 306 | if (copy_from_user(&desc, funcptr, sizeof(desc))) |
| 307 | goto give_sigsegv; | ||
| 308 | __frame->pc = desc.text; | ||
| 309 | __frame->gr15 = desc.GOT; | ||
| 306 | } else { | 310 | } else { |
| 307 | __frame->pc = (unsigned long) ka->sa.sa_handler; | 311 | __frame->pc = (unsigned long) ka->sa.sa_handler; |
| 308 | __frame->gr15 = 0; | 312 | __frame->gr15 = 0; |
| 309 | } | 313 | } |
| 310 | 314 | ||
| 311 | set_fs(USER_DS); | 315 | __frame->sp = (unsigned long) frame; |
| 316 | __frame->lr = (unsigned long) &frame->retcode; | ||
| 317 | __frame->gr8 = sig; | ||
| 312 | 318 | ||
| 313 | /* the tracer may want to single-step inside the handler */ | 319 | /* the tracer may want to single-step inside the handler */ |
| 314 | if (test_thread_flag(TIF_SINGLESTEP)) | 320 | if (test_thread_flag(TIF_SINGLESTEP)) |
| @@ -323,7 +329,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set) | |||
| 323 | return 0; | 329 | return 0; |
| 324 | 330 | ||
| 325 | give_sigsegv: | 331 | give_sigsegv: |
| 326 | force_sig(SIGSEGV, current); | 332 | force_sigsegv(sig, current); |
| 327 | return -EFAULT; | 333 | return -EFAULT; |
| 328 | 334 | ||
| 329 | } /* end setup_frame() */ | 335 | } /* end setup_frame() */ |
| @@ -338,6 +344,8 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 338 | struct rt_sigframe __user *frame; | 344 | struct rt_sigframe __user *frame; |
| 339 | int rsig; | 345 | int rsig; |
| 340 | 346 | ||
| 347 | set_fs(USER_DS); | ||
| 348 | |||
| 341 | frame = get_sigframe(ka, sizeof(*frame)); | 349 | frame = get_sigframe(ka, sizeof(*frame)); |
| 342 | 350 | ||
| 343 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) | 351 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
| @@ -392,22 +400,23 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 392 | } | 400 | } |
| 393 | 401 | ||
| 394 | /* Set up registers for signal handler */ | 402 | /* Set up registers for signal handler */ |
| 395 | __frame->sp = (unsigned long) frame; | ||
| 396 | __frame->lr = (unsigned long) &frame->retcode; | ||
| 397 | __frame->gr8 = sig; | ||
| 398 | __frame->gr9 = (unsigned long) &frame->info; | ||
| 399 | |||
| 400 | if (current->personality & FDPIC_FUNCPTRS) { | 403 | if (current->personality & FDPIC_FUNCPTRS) { |
| 401 | struct fdpic_func_descriptor __user *funcptr = | 404 | struct fdpic_func_descriptor __user *funcptr = |
| 402 | (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; | 405 | (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; |
| 403 | __get_user(__frame->pc, &funcptr->text); | 406 | struct fdpic_func_descriptor desc; |
| 404 | __get_user(__frame->gr15, &funcptr->GOT); | 407 | if (copy_from_user(&desc, funcptr, sizeof(desc))) |
| 408 | goto give_sigsegv; | ||
| 409 | __frame->pc = desc.text; | ||
| 410 | __frame->gr15 = desc.GOT; | ||
| 405 | } else { | 411 | } else { |
| 406 | __frame->pc = (unsigned long) ka->sa.sa_handler; | 412 | __frame->pc = (unsigned long) ka->sa.sa_handler; |
| 407 | __frame->gr15 = 0; | 413 | __frame->gr15 = 0; |
| 408 | } | 414 | } |
| 409 | 415 | ||
| 410 | set_fs(USER_DS); | 416 | __frame->sp = (unsigned long) frame; |
| 417 | __frame->lr = (unsigned long) &frame->retcode; | ||
| 418 | __frame->gr8 = sig; | ||
| 419 | __frame->gr9 = (unsigned long) &frame->info; | ||
| 411 | 420 | ||
| 412 | /* the tracer may want to single-step inside the handler */ | 421 | /* the tracer may want to single-step inside the handler */ |
| 413 | if (test_thread_flag(TIF_SINGLESTEP)) | 422 | if (test_thread_flag(TIF_SINGLESTEP)) |
| @@ -422,7 +431,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 422 | return 0; | 431 | return 0; |
| 423 | 432 | ||
| 424 | give_sigsegv: | 433 | give_sigsegv: |
| 425 | force_sig(SIGSEGV, current); | 434 | force_sigsegv(sig, current); |
| 426 | return -EFAULT; | 435 | return -EFAULT; |
| 427 | 436 | ||
| 428 | } /* end setup_rt_frame() */ | 437 | } /* end setup_rt_frame() */ |
| @@ -437,7 +446,7 @@ static int handle_signal(unsigned long sig, siginfo_t *info, | |||
| 437 | int ret; | 446 | int ret; |
| 438 | 447 | ||
| 439 | /* Are we from a system call? */ | 448 | /* Are we from a system call? */ |
| 440 | if (in_syscall(__frame)) { | 449 | if (__frame->syscallno != -1) { |
| 441 | /* If so, check system call restarting.. */ | 450 | /* If so, check system call restarting.. */ |
| 442 | switch (__frame->gr8) { | 451 | switch (__frame->gr8) { |
| 443 | case -ERESTART_RESTARTBLOCK: | 452 | case -ERESTART_RESTARTBLOCK: |
| @@ -456,6 +465,7 @@ static int handle_signal(unsigned long sig, siginfo_t *info, | |||
| 456 | __frame->gr8 = __frame->orig_gr8; | 465 | __frame->gr8 = __frame->orig_gr8; |
| 457 | __frame->pc -= 4; | 466 | __frame->pc -= 4; |
| 458 | } | 467 | } |
| 468 | __frame->syscallno = -1; | ||
| 459 | } | 469 | } |
| 460 | 470 | ||
| 461 | /* Set up the stack frame */ | 471 | /* Set up the stack frame */ |
| @@ -538,10 +548,11 @@ no_signal: | |||
| 538 | break; | 548 | break; |
| 539 | 549 | ||
| 540 | case -ERESTART_RESTARTBLOCK: | 550 | case -ERESTART_RESTARTBLOCK: |
| 541 | __frame->gr8 = __NR_restart_syscall; | 551 | __frame->gr7 = __NR_restart_syscall; |
| 542 | __frame->pc -= 4; | 552 | __frame->pc -= 4; |
| 543 | break; | 553 | break; |
| 544 | } | 554 | } |
| 555 | __frame->syscallno = -1; | ||
| 545 | } | 556 | } |
| 546 | 557 | ||
| 547 | /* if there's no signal to deliver, we just put the saved sigmask | 558 | /* if there's no signal to deliver, we just put the saved sigmask |
diff --git a/arch/h8300/kernel/module.c b/arch/h8300/kernel/module.c index 0865e291c20d..db4953dc4e1b 100644 --- a/arch/h8300/kernel/module.c +++ b/arch/h8300/kernel/module.c | |||
| @@ -112,10 +112,9 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 112 | const Elf_Shdr *sechdrs, | 112 | const Elf_Shdr *sechdrs, |
| 113 | struct module *me) | 113 | struct module *me) |
| 114 | { | 114 | { |
| 115 | return module_bug_finalize(hdr, sechdrs, me); | 115 | return 0; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | void module_arch_cleanup(struct module *mod) | 118 | void module_arch_cleanup(struct module *mod) |
| 119 | { | 119 | { |
| 120 | module_bug_cleanup(mod); | ||
| 121 | } | 120 | } |
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S index 471a1e783aca..331d42bda77a 100644 --- a/arch/ia64/kernel/fsys.S +++ b/arch/ia64/kernel/fsys.S | |||
| @@ -420,34 +420,31 @@ EX(.fail_efault, ld8 r14=[r33]) // r14 <- *set | |||
| 420 | ;; | 420 | ;; |
| 421 | 421 | ||
| 422 | RSM_PSR_I(p0, r18, r19) // mask interrupt delivery | 422 | RSM_PSR_I(p0, r18, r19) // mask interrupt delivery |
| 423 | mov ar.ccv=0 | ||
| 424 | andcm r14=r14,r17 // filter out SIGKILL & SIGSTOP | 423 | andcm r14=r14,r17 // filter out SIGKILL & SIGSTOP |
| 424 | mov r8=EINVAL // default to EINVAL | ||
| 425 | 425 | ||
| 426 | #ifdef CONFIG_SMP | 426 | #ifdef CONFIG_SMP |
| 427 | // __ticket_spin_trylock(r31) | 427 | // __ticket_spin_trylock(r31) |
| 428 | ld4 r17=[r31] | 428 | ld4 r17=[r31] |
| 429 | mov r8=EINVAL // default to EINVAL | ||
| 430 | ;; | ||
| 431 | extr r9=r17,17,15 | ||
| 432 | ;; | 429 | ;; |
| 433 | xor r18=r17,r9 | 430 | mov.m ar.ccv=r17 |
| 431 | extr.u r9=r17,17,15 | ||
| 434 | adds r19=1,r17 | 432 | adds r19=1,r17 |
| 433 | extr.u r18=r17,0,15 | ||
| 435 | ;; | 434 | ;; |
| 436 | extr.u r18=r18,0,15 | 435 | cmp.eq p6,p7=r9,r18 |
| 437 | ;; | 436 | ;; |
| 438 | cmp.eq p0,p7=0,r18 | 437 | (p6) cmpxchg4.acq r9=[r31],r19,ar.ccv |
| 438 | (p6) dep.z r20=r19,1,15 // next serving ticket for unlock | ||
| 439 | (p7) br.cond.spnt.many .lock_contention | 439 | (p7) br.cond.spnt.many .lock_contention |
| 440 | mov.m ar.ccv=r17 | ||
| 441 | ;; | ||
| 442 | cmpxchg4.acq r9=[r31],r19,ar.ccv | ||
| 443 | ;; | 440 | ;; |
| 444 | cmp4.eq p0,p7=r9,r17 | 441 | cmp4.eq p0,p7=r9,r17 |
| 442 | adds r31=2,r31 | ||
| 445 | (p7) br.cond.spnt.many .lock_contention | 443 | (p7) br.cond.spnt.many .lock_contention |
| 446 | ld8 r3=[r2] // re-read current->blocked now that we hold the lock | 444 | ld8 r3=[r2] // re-read current->blocked now that we hold the lock |
| 447 | ;; | 445 | ;; |
| 448 | #else | 446 | #else |
| 449 | ld8 r3=[r2] // re-read current->blocked now that we hold the lock | 447 | ld8 r3=[r2] // re-read current->blocked now that we hold the lock |
| 450 | mov r8=EINVAL // default to EINVAL | ||
| 451 | #endif | 448 | #endif |
| 452 | add r18=IA64_TASK_PENDING_OFFSET+IA64_SIGPENDING_SIGNAL_OFFSET,r16 | 449 | add r18=IA64_TASK_PENDING_OFFSET+IA64_SIGPENDING_SIGNAL_OFFSET,r16 |
| 453 | add r19=IA64_TASK_SIGNAL_OFFSET,r16 | 450 | add r19=IA64_TASK_SIGNAL_OFFSET,r16 |
| @@ -503,16 +500,8 @@ EX(.fail_efault, ld8 r14=[r33]) // r14 <- *set | |||
| 503 | 500 | ||
| 504 | #ifdef CONFIG_SMP | 501 | #ifdef CONFIG_SMP |
| 505 | // __ticket_spin_unlock(r31) | 502 | // __ticket_spin_unlock(r31) |
| 506 | adds r31=2,r31 | 503 | st2.rel [r31]=r20 |
| 507 | ;; | 504 | mov r20=0 // i must not leak kernel bits... |
| 508 | ld2.bias r2=[r31] | ||
| 509 | mov r3=65534 | ||
| 510 | ;; | ||
| 511 | adds r2=2,r2 | ||
| 512 | ;; | ||
| 513 | and r3=r3,r2 | ||
| 514 | ;; | ||
| 515 | st2.rel [r31]=r3 | ||
| 516 | #endif | 505 | #endif |
| 517 | SSM_PSR_I(p0, p9, r31) | 506 | SSM_PSR_I(p0, p9, r31) |
| 518 | ;; | 507 | ;; |
| @@ -535,16 +524,7 @@ EX(.fail_efault, (p15) st8 [r34]=r3) | |||
| 535 | .sig_pending: | 524 | .sig_pending: |
| 536 | #ifdef CONFIG_SMP | 525 | #ifdef CONFIG_SMP |
| 537 | // __ticket_spin_unlock(r31) | 526 | // __ticket_spin_unlock(r31) |
| 538 | adds r31=2,r31 | 527 | st2.rel [r31]=r20 // release the lock |
| 539 | ;; | ||
| 540 | ld2.bias r2=[r31] | ||
| 541 | mov r3=65534 | ||
| 542 | ;; | ||
| 543 | adds r2=2,r2 | ||
| 544 | ;; | ||
| 545 | and r3=r3,r2 | ||
| 546 | ;; | ||
| 547 | st2.rel [r31]=r3 | ||
| 548 | #endif | 528 | #endif |
| 549 | SSM_PSR_I(p0, p9, r17) | 529 | SSM_PSR_I(p0, p9, r17) |
| 550 | ;; | 530 | ;; |
diff --git a/arch/m32r/include/asm/elf.h b/arch/m32r/include/asm/elf.h index 2f85412ef730..b8da7d0574d2 100644 --- a/arch/m32r/include/asm/elf.h +++ b/arch/m32r/include/asm/elf.h | |||
| @@ -82,9 +82,9 @@ typedef elf_fpreg_t elf_fpregset_t; | |||
| 82 | * These are used to set parameters in the core dumps. | 82 | * These are used to set parameters in the core dumps. |
| 83 | */ | 83 | */ |
| 84 | #define ELF_CLASS ELFCLASS32 | 84 | #define ELF_CLASS ELFCLASS32 |
| 85 | #if defined(__LITTLE_ENDIAN) | 85 | #if defined(__LITTLE_ENDIAN__) |
| 86 | #define ELF_DATA ELFDATA2LSB | 86 | #define ELF_DATA ELFDATA2LSB |
| 87 | #elif defined(__BIG_ENDIAN) | 87 | #elif defined(__BIG_ENDIAN__) |
| 88 | #define ELF_DATA ELFDATA2MSB | 88 | #define ELF_DATA ELFDATA2MSB |
| 89 | #else | 89 | #else |
| 90 | #error no endian defined | 90 | #error no endian defined |
diff --git a/arch/m32r/include/asm/signal.h b/arch/m32r/include/asm/signal.h index 9c1acb2b1a92..b2eeb0de1c8d 100644 --- a/arch/m32r/include/asm/signal.h +++ b/arch/m32r/include/asm/signal.h | |||
| @@ -157,7 +157,6 @@ typedef struct sigaltstack { | |||
| 157 | #undef __HAVE_ARCH_SIG_BITOPS | 157 | #undef __HAVE_ARCH_SIG_BITOPS |
| 158 | 158 | ||
| 159 | struct pt_regs; | 159 | struct pt_regs; |
| 160 | extern int do_signal(struct pt_regs *regs, sigset_t *oldset); | ||
| 161 | 160 | ||
| 162 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | 161 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) |
| 163 | 162 | ||
diff --git a/arch/m32r/include/asm/unistd.h b/arch/m32r/include/asm/unistd.h index 76125777483c..c70545689da8 100644 --- a/arch/m32r/include/asm/unistd.h +++ b/arch/m32r/include/asm/unistd.h | |||
| @@ -351,6 +351,7 @@ | |||
| 351 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/ | 351 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/ |
| 352 | #define __ARCH_WANT_SYS_OLDUMOUNT | 352 | #define __ARCH_WANT_SYS_OLDUMOUNT |
| 353 | #define __ARCH_WANT_SYS_RT_SIGACTION | 353 | #define __ARCH_WANT_SYS_RT_SIGACTION |
| 354 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | ||
| 354 | 355 | ||
| 355 | #define __IGNORE_lchown | 356 | #define __IGNORE_lchown |
| 356 | #define __IGNORE_setuid | 357 | #define __IGNORE_setuid |
diff --git a/arch/m32r/kernel/.gitignore b/arch/m32r/kernel/.gitignore new file mode 100644 index 000000000000..c5f676c3c224 --- /dev/null +++ b/arch/m32r/kernel/.gitignore | |||
| @@ -0,0 +1 @@ | |||
| vmlinux.lds | |||
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S index 403869833b98..225412bc227e 100644 --- a/arch/m32r/kernel/entry.S +++ b/arch/m32r/kernel/entry.S | |||
| @@ -235,10 +235,9 @@ work_resched: | |||
| 235 | work_notifysig: ; deal with pending signals and | 235 | work_notifysig: ; deal with pending signals and |
| 236 | ; notify-resume requests | 236 | ; notify-resume requests |
| 237 | mv r0, sp ; arg1 : struct pt_regs *regs | 237 | mv r0, sp ; arg1 : struct pt_regs *regs |
| 238 | ldi r1, #0 ; arg2 : sigset_t *oldset | 238 | mv r1, r9 ; arg2 : __u32 thread_info_flags |
| 239 | mv r2, r9 ; arg3 : __u32 thread_info_flags | ||
| 240 | bl do_notify_resume | 239 | bl do_notify_resume |
| 241 | bra restore_all | 240 | bra resume_userspace |
| 242 | 241 | ||
| 243 | ; perform syscall exit tracing | 242 | ; perform syscall exit tracing |
| 244 | ALIGN | 243 | ALIGN |
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c index e555091eb97c..0021ade4cba8 100644 --- a/arch/m32r/kernel/ptrace.c +++ b/arch/m32r/kernel/ptrace.c | |||
| @@ -592,16 +592,17 @@ void user_enable_single_step(struct task_struct *child) | |||
| 592 | 592 | ||
| 593 | if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0) | 593 | if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0) |
| 594 | != sizeof(insn)) | 594 | != sizeof(insn)) |
| 595 | break; | 595 | return -EIO; |
| 596 | 596 | ||
| 597 | compute_next_pc(insn, pc, &next_pc, child); | 597 | compute_next_pc(insn, pc, &next_pc, child); |
| 598 | if (next_pc & 0x80000000) | 598 | if (next_pc & 0x80000000) |
| 599 | break; | 599 | return -EIO; |
| 600 | 600 | ||
| 601 | if (embed_debug_trap(child, next_pc)) | 601 | if (embed_debug_trap(child, next_pc)) |
| 602 | break; | 602 | return -EIO; |
| 603 | 603 | ||
| 604 | invalidate_cache(); | 604 | invalidate_cache(); |
| 605 | return 0; | ||
| 605 | } | 606 | } |
| 606 | 607 | ||
| 607 | void user_disable_single_step(struct task_struct *child) | 608 | void user_disable_single_step(struct task_struct *child) |
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c index 144b0f124fc7..a08697f0886d 100644 --- a/arch/m32r/kernel/signal.c +++ b/arch/m32r/kernel/signal.c | |||
| @@ -30,35 +30,6 @@ | |||
| 30 | 30 | ||
| 31 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 31 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) |
| 32 | 32 | ||
| 33 | int do_signal(struct pt_regs *, sigset_t *); | ||
| 34 | |||
| 35 | asmlinkage int | ||
| 36 | sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, | ||
| 37 | unsigned long r2, unsigned long r3, unsigned long r4, | ||
| 38 | unsigned long r5, unsigned long r6, struct pt_regs *regs) | ||
| 39 | { | ||
| 40 | sigset_t newset; | ||
| 41 | |||
| 42 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
| 43 | if (sigsetsize != sizeof(sigset_t)) | ||
| 44 | return -EINVAL; | ||
| 45 | |||
| 46 | if (copy_from_user(&newset, unewset, sizeof(newset))) | ||
| 47 | return -EFAULT; | ||
| 48 | sigdelsetmask(&newset, sigmask(SIGKILL)|sigmask(SIGSTOP)); | ||
| 49 | |||
| 50 | spin_lock_irq(¤t->sighand->siglock); | ||
| 51 | current->saved_sigmask = current->blocked; | ||
| 52 | current->blocked = newset; | ||
| 53 | recalc_sigpending(); | ||
| 54 | spin_unlock_irq(¤t->sighand->siglock); | ||
| 55 | |||
| 56 | current->state = TASK_INTERRUPTIBLE; | ||
| 57 | schedule(); | ||
| 58 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
| 59 | return -ERESTARTNOHAND; | ||
| 60 | } | ||
| 61 | |||
| 62 | asmlinkage int | 33 | asmlinkage int |
| 63 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | 34 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, |
| 64 | unsigned long r2, unsigned long r3, unsigned long r4, | 35 | unsigned long r2, unsigned long r3, unsigned long r4, |
| @@ -218,7 +189,7 @@ get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size) | |||
| 218 | return (void __user *)((sp - frame_size) & -8ul); | 189 | return (void __user *)((sp - frame_size) & -8ul); |
| 219 | } | 190 | } |
| 220 | 191 | ||
| 221 | static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | 192 | static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, |
| 222 | sigset_t *set, struct pt_regs *regs) | 193 | sigset_t *set, struct pt_regs *regs) |
| 223 | { | 194 | { |
| 224 | struct rt_sigframe __user *frame; | 195 | struct rt_sigframe __user *frame; |
| @@ -275,22 +246,34 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 275 | current->comm, current->pid, frame, regs->pc); | 246 | current->comm, current->pid, frame, regs->pc); |
| 276 | #endif | 247 | #endif |
| 277 | 248 | ||
| 278 | return; | 249 | return 0; |
| 279 | 250 | ||
| 280 | give_sigsegv: | 251 | give_sigsegv: |
| 281 | force_sigsegv(sig, current); | 252 | force_sigsegv(sig, current); |
| 253 | return -EFAULT; | ||
| 254 | } | ||
| 255 | |||
| 256 | static int prev_insn(struct pt_regs *regs) | ||
| 257 | { | ||
| 258 | u16 inst; | ||
| 259 | if (get_user(inst, (u16 __user *)(regs->bpc - 2))) | ||
| 260 | return -EFAULT; | ||
| 261 | if ((inst & 0xfff0) == 0x10f0) /* trap ? */ | ||
| 262 | regs->bpc -= 2; | ||
| 263 | else | ||
| 264 | regs->bpc -= 4; | ||
| 265 | regs->syscall_nr = -1; | ||
| 266 | return 0; | ||
| 282 | } | 267 | } |
| 283 | 268 | ||
| 284 | /* | 269 | /* |
| 285 | * OK, we're invoking a handler | 270 | * OK, we're invoking a handler |
| 286 | */ | 271 | */ |
| 287 | 272 | ||
| 288 | static void | 273 | static int |
| 289 | handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | 274 | handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, |
| 290 | sigset_t *oldset, struct pt_regs *regs) | 275 | sigset_t *oldset, struct pt_regs *regs) |
| 291 | { | 276 | { |
| 292 | unsigned short inst; | ||
| 293 | |||
| 294 | /* Are we from a system call? */ | 277 | /* Are we from a system call? */ |
| 295 | if (regs->syscall_nr >= 0) { | 278 | if (regs->syscall_nr >= 0) { |
| 296 | /* If so, check system call restarting.. */ | 279 | /* If so, check system call restarting.. */ |
| @@ -308,16 +291,14 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 308 | /* fallthrough */ | 291 | /* fallthrough */ |
| 309 | case -ERESTARTNOINTR: | 292 | case -ERESTARTNOINTR: |
| 310 | regs->r0 = regs->orig_r0; | 293 | regs->r0 = regs->orig_r0; |
| 311 | inst = *(unsigned short *)(regs->bpc - 2); | 294 | if (prev_insn(regs) < 0) |
| 312 | if ((inst & 0xfff0) == 0x10f0) /* trap ? */ | 295 | return -EFAULT; |
| 313 | regs->bpc -= 2; | ||
| 314 | else | ||
| 315 | regs->bpc -= 4; | ||
| 316 | } | 296 | } |
| 317 | } | 297 | } |
| 318 | 298 | ||
| 319 | /* Set up the stack frame */ | 299 | /* Set up the stack frame */ |
| 320 | setup_rt_frame(sig, ka, info, oldset, regs); | 300 | if (setup_rt_frame(sig, ka, info, oldset, regs)) |
| 301 | return -EFAULT; | ||
| 321 | 302 | ||
| 322 | spin_lock_irq(¤t->sighand->siglock); | 303 | spin_lock_irq(¤t->sighand->siglock); |
| 323 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); | 304 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); |
| @@ -325,6 +306,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 325 | sigaddset(¤t->blocked,sig); | 306 | sigaddset(¤t->blocked,sig); |
| 326 | recalc_sigpending(); | 307 | recalc_sigpending(); |
| 327 | spin_unlock_irq(¤t->sighand->siglock); | 308 | spin_unlock_irq(¤t->sighand->siglock); |
| 309 | return 0; | ||
| 328 | } | 310 | } |
| 329 | 311 | ||
| 330 | /* | 312 | /* |
| @@ -332,12 +314,12 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 332 | * want to handle. Thus you cannot kill init even with a SIGKILL even by | 314 | * want to handle. Thus you cannot kill init even with a SIGKILL even by |
| 333 | * mistake. | 315 | * mistake. |
| 334 | */ | 316 | */ |
| 335 | int do_signal(struct pt_regs *regs, sigset_t *oldset) | 317 | static void do_signal(struct pt_regs *regs) |
| 336 | { | 318 | { |
| 337 | siginfo_t info; | 319 | siginfo_t info; |
| 338 | int signr; | 320 | int signr; |
| 339 | struct k_sigaction ka; | 321 | struct k_sigaction ka; |
| 340 | unsigned short inst; | 322 | sigset_t *oldset; |
| 341 | 323 | ||
| 342 | /* | 324 | /* |
| 343 | * We want the common case to go fast, which | 325 | * We want the common case to go fast, which |
| @@ -346,12 +328,14 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) | |||
| 346 | * if so. | 328 | * if so. |
| 347 | */ | 329 | */ |
| 348 | if (!user_mode(regs)) | 330 | if (!user_mode(regs)) |
| 349 | return 1; | 331 | return; |
| 350 | 332 | ||
| 351 | if (try_to_freeze()) | 333 | if (try_to_freeze()) |
| 352 | goto no_signal; | 334 | goto no_signal; |
| 353 | 335 | ||
| 354 | if (!oldset) | 336 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) |
| 337 | oldset = ¤t->saved_sigmask; | ||
| 338 | else | ||
| 355 | oldset = ¤t->blocked; | 339 | oldset = ¤t->blocked; |
| 356 | 340 | ||
| 357 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 341 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
| @@ -363,8 +347,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) | |||
| 363 | */ | 347 | */ |
| 364 | 348 | ||
| 365 | /* Whee! Actually deliver the signal. */ | 349 | /* Whee! Actually deliver the signal. */ |
| 366 | handle_signal(signr, &ka, &info, oldset, regs); | 350 | if (handle_signal(signr, &ka, &info, oldset, regs) == 0) |
| 367 | return 1; | 351 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
| 352 | |||
| 353 | return; | ||
| 368 | } | 354 | } |
| 369 | 355 | ||
| 370 | no_signal: | 356 | no_signal: |
| @@ -375,31 +361,24 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) | |||
| 375 | regs->r0 == -ERESTARTSYS || | 361 | regs->r0 == -ERESTARTSYS || |
| 376 | regs->r0 == -ERESTARTNOINTR) { | 362 | regs->r0 == -ERESTARTNOINTR) { |
| 377 | regs->r0 = regs->orig_r0; | 363 | regs->r0 = regs->orig_r0; |
| 378 | inst = *(unsigned short *)(regs->bpc - 2); | 364 | prev_insn(regs); |
| 379 | if ((inst & 0xfff0) == 0x10f0) /* trap ? */ | 365 | } else if (regs->r0 == -ERESTART_RESTARTBLOCK){ |
| 380 | regs->bpc -= 2; | ||
| 381 | else | ||
| 382 | regs->bpc -= 4; | ||
| 383 | } | ||
| 384 | if (regs->r0 == -ERESTART_RESTARTBLOCK){ | ||
| 385 | regs->r0 = regs->orig_r0; | 366 | regs->r0 = regs->orig_r0; |
| 386 | regs->r7 = __NR_restart_syscall; | 367 | regs->r7 = __NR_restart_syscall; |
| 387 | inst = *(unsigned short *)(regs->bpc - 2); | 368 | prev_insn(regs); |
| 388 | if ((inst & 0xfff0) == 0x10f0) /* trap ? */ | ||
| 389 | regs->bpc -= 2; | ||
| 390 | else | ||
| 391 | regs->bpc -= 4; | ||
| 392 | } | 369 | } |
| 393 | } | 370 | } |
| 394 | return 0; | 371 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { |
| 372 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
| 373 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
| 374 | } | ||
| 395 | } | 375 | } |
| 396 | 376 | ||
| 397 | /* | 377 | /* |
| 398 | * notification of userspace execution resumption | 378 | * notification of userspace execution resumption |
| 399 | * - triggered by current->work.notify_resume | 379 | * - triggered by current->work.notify_resume |
| 400 | */ | 380 | */ |
| 401 | void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, | 381 | void do_notify_resume(struct pt_regs *regs, __u32 thread_info_flags) |
| 402 | __u32 thread_info_flags) | ||
| 403 | { | 382 | { |
| 404 | /* Pending single-step? */ | 383 | /* Pending single-step? */ |
| 405 | if (thread_info_flags & _TIF_SINGLESTEP) | 384 | if (thread_info_flags & _TIF_SINGLESTEP) |
| @@ -407,7 +386,7 @@ void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, | |||
| 407 | 386 | ||
| 408 | /* deal with pending signal delivery */ | 387 | /* deal with pending signal delivery */ |
| 409 | if (thread_info_flags & _TIF_SIGPENDING) | 388 | if (thread_info_flags & _TIF_SIGPENDING) |
| 410 | do_signal(regs,oldset); | 389 | do_signal(regs); |
| 411 | 390 | ||
| 412 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { | 391 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { |
| 413 | clear_thread_flag(TIF_NOTIFY_RESUME); | 392 | clear_thread_flag(TIF_NOTIFY_RESUME); |
diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c index 8f0640847ad2..05285d08e547 100644 --- a/arch/m68k/mac/macboing.c +++ b/arch/m68k/mac/macboing.c | |||
| @@ -162,7 +162,7 @@ static void mac_init_asc( void ) | |||
| 162 | void mac_mksound( unsigned int freq, unsigned int length ) | 162 | void mac_mksound( unsigned int freq, unsigned int length ) |
| 163 | { | 163 | { |
| 164 | __u32 cfreq = ( freq << 5 ) / 468; | 164 | __u32 cfreq = ( freq << 5 ) / 468; |
| 165 | __u32 flags; | 165 | unsigned long flags; |
| 166 | int i; | 166 | int i; |
| 167 | 167 | ||
| 168 | if ( mac_special_bell == NULL ) | 168 | if ( mac_special_bell == NULL ) |
| @@ -224,7 +224,7 @@ static void mac_nosound( unsigned long ignored ) | |||
| 224 | */ | 224 | */ |
| 225 | static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsigned int volume ) | 225 | static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsigned int volume ) |
| 226 | { | 226 | { |
| 227 | __u32 flags; | 227 | unsigned long flags; |
| 228 | 228 | ||
| 229 | /* if the bell is already ringing, ring longer */ | 229 | /* if the bell is already ringing, ring longer */ |
| 230 | if ( mac_bell_duration > 0 ) | 230 | if ( mac_bell_duration > 0 ) |
| @@ -271,7 +271,7 @@ static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsig | |||
| 271 | static void mac_quadra_ring_bell( unsigned long ignored ) | 271 | static void mac_quadra_ring_bell( unsigned long ignored ) |
| 272 | { | 272 | { |
| 273 | int i, count = mac_asc_samplespersec / HZ; | 273 | int i, count = mac_asc_samplespersec / HZ; |
| 274 | __u32 flags; | 274 | unsigned long flags; |
| 275 | 275 | ||
| 276 | /* | 276 | /* |
| 277 | * we neither want a sound buffer overflow nor underflow, so we need to match | 277 | * we neither want a sound buffer overflow nor underflow, so we need to match |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 3ad59dde4852..4c9f402295dd 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
| @@ -13,6 +13,7 @@ config MIPS | |||
| 13 | select HAVE_KPROBES | 13 | select HAVE_KPROBES |
| 14 | select HAVE_KRETPROBES | 14 | select HAVE_KRETPROBES |
| 15 | select RTC_LIB if !MACH_LOONGSON | 15 | select RTC_LIB if !MACH_LOONGSON |
| 16 | select GENERIC_ATOMIC64 if !64BIT | ||
| 16 | 17 | ||
| 17 | mainmenu "Linux/MIPS Kernel Configuration" | 18 | mainmenu "Linux/MIPS Kernel Configuration" |
| 18 | 19 | ||
| @@ -880,11 +881,15 @@ config NO_IOPORT | |||
| 880 | config GENERIC_ISA_DMA | 881 | config GENERIC_ISA_DMA |
| 881 | bool | 882 | bool |
| 882 | select ZONE_DMA if GENERIC_ISA_DMA_SUPPORT_BROKEN=n | 883 | select ZONE_DMA if GENERIC_ISA_DMA_SUPPORT_BROKEN=n |
| 884 | select ISA_DMA_API | ||
| 883 | 885 | ||
| 884 | config GENERIC_ISA_DMA_SUPPORT_BROKEN | 886 | config GENERIC_ISA_DMA_SUPPORT_BROKEN |
| 885 | bool | 887 | bool |
| 886 | select GENERIC_ISA_DMA | 888 | select GENERIC_ISA_DMA |
| 887 | 889 | ||
| 890 | config ISA_DMA_API | ||
| 891 | bool | ||
| 892 | |||
| 888 | config GENERIC_GPIO | 893 | config GENERIC_GPIO |
| 889 | bool | 894 | bool |
| 890 | 895 | ||
| @@ -1646,8 +1651,16 @@ config MIPS_MT_SMP | |||
| 1646 | select SYS_SUPPORTS_SMP | 1651 | select SYS_SUPPORTS_SMP |
| 1647 | select SMP_UP | 1652 | select SMP_UP |
| 1648 | help | 1653 | help |
| 1649 | This is a kernel model which is also known a VSMP or lately | 1654 | This is a kernel model which is known a VSMP but lately has been |
| 1650 | has been marketesed into SMVP. | 1655 | marketesed into SMVP. |
| 1656 | Virtual SMP uses the processor's VPEs to implement virtual | ||
| 1657 | processors. In currently available configuration of the 34K processor | ||
| 1658 | this allows for a dual processor. Both processors will share the same | ||
| 1659 | primary caches; each will obtain the half of the TLB for it's own | ||
| 1660 | exclusive use. For a layman this model can be described as similar to | ||
| 1661 | what Intel calls Hyperthreading. | ||
| 1662 | |||
| 1663 | For further information see http://www.linux-mips.org/wiki/34K#VSMP | ||
| 1651 | 1664 | ||
| 1652 | config MIPS_MT_SMTC | 1665 | config MIPS_MT_SMTC |
| 1653 | bool "SMTC: Use all TCs on all VPEs for SMP" | 1666 | bool "SMTC: Use all TCs on all VPEs for SMP" |
| @@ -1664,6 +1677,14 @@ config MIPS_MT_SMTC | |||
| 1664 | help | 1677 | help |
| 1665 | This is a kernel model which is known a SMTC or lately has been | 1678 | This is a kernel model which is known a SMTC or lately has been |
| 1666 | marketesed into SMVP. | 1679 | marketesed into SMVP. |
| 1680 | is presenting the available TC's of the core as processors to Linux. | ||
| 1681 | On currently available 34K processors this means a Linux system will | ||
| 1682 | see up to 5 processors. The implementation of the SMTC kernel differs | ||
| 1683 | significantly from VSMP and cannot efficiently coexist in the same | ||
| 1684 | kernel binary so the choice between VSMP and SMTC is a compile time | ||
| 1685 | decision. | ||
| 1686 | |||
| 1687 | For further information see http://www.linux-mips.org/wiki/34K#SMTC | ||
| 1667 | 1688 | ||
| 1668 | endchoice | 1689 | endchoice |
| 1669 | 1690 | ||
diff --git a/arch/mips/alchemy/common/prom.c b/arch/mips/alchemy/common/prom.c index c29511b11d44..534021059629 100644 --- a/arch/mips/alchemy/common/prom.c +++ b/arch/mips/alchemy/common/prom.c | |||
| @@ -43,7 +43,7 @@ int prom_argc; | |||
| 43 | char **prom_argv; | 43 | char **prom_argv; |
| 44 | char **prom_envp; | 44 | char **prom_envp; |
| 45 | 45 | ||
| 46 | void prom_init_cmdline(void) | 46 | void __init prom_init_cmdline(void) |
| 47 | { | 47 | { |
| 48 | int i; | 48 | int i; |
| 49 | 49 | ||
| @@ -104,7 +104,7 @@ static inline void str2eaddr(unsigned char *ea, unsigned char *str) | |||
| 104 | } | 104 | } |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | int prom_get_ethernet_addr(char *ethernet_addr) | 107 | int __init prom_get_ethernet_addr(char *ethernet_addr) |
| 108 | { | 108 | { |
| 109 | char *ethaddr_str; | 109 | char *ethaddr_str; |
| 110 | 110 | ||
| @@ -123,7 +123,6 @@ int prom_get_ethernet_addr(char *ethernet_addr) | |||
| 123 | 123 | ||
| 124 | return 0; | 124 | return 0; |
| 125 | } | 125 | } |
| 126 | EXPORT_SYMBOL(prom_get_ethernet_addr); | ||
| 127 | 126 | ||
| 128 | void __init prom_free_prom_memory(void) | 127 | void __init prom_free_prom_memory(void) |
| 129 | { | 128 | { |
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index ed9bb709c9a3..5042d51b0512 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile | |||
| @@ -59,7 +59,7 @@ $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE | |||
| 59 | hostprogs-y := calc_vmlinuz_load_addr | 59 | hostprogs-y := calc_vmlinuz_load_addr |
| 60 | 60 | ||
| 61 | VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \ | 61 | VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \ |
| 62 | $(objtree)/$(KBUILD_IMAGE) $(VMLINUX_LOAD_ADDRESS)) | 62 | $(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS)) |
| 63 | 63 | ||
| 64 | vmlinuzobjs-y += $(obj)/piggy.o | 64 | vmlinuzobjs-y += $(obj)/piggy.o |
| 65 | 65 | ||
| @@ -105,4 +105,4 @@ OBJCOPYFLAGS_vmlinuz.srec := $(OBJCOPYFLAGS) -S -O srec | |||
| 105 | vmlinuz.srec: vmlinuz | 105 | vmlinuz.srec: vmlinuz |
| 106 | $(call cmd,objcopy) | 106 | $(call cmd,objcopy) |
| 107 | 107 | ||
| 108 | clean-files := $(objtree)/vmlinuz.* | 108 | clean-files := $(objtree)/vmlinuz $(objtree)/vmlinuz.{32,ecoff,bin,srec} |
diff --git a/arch/mips/cavium-octeon/Kconfig b/arch/mips/cavium-octeon/Kconfig index 094c17e38e16..47323ca452dc 100644 --- a/arch/mips/cavium-octeon/Kconfig +++ b/arch/mips/cavium-octeon/Kconfig | |||
| @@ -83,3 +83,7 @@ config ARCH_SPARSEMEM_ENABLE | |||
| 83 | def_bool y | 83 | def_bool y |
| 84 | select SPARSEMEM_STATIC | 84 | select SPARSEMEM_STATIC |
| 85 | depends on CPU_CAVIUM_OCTEON | 85 | depends on CPU_CAVIUM_OCTEON |
| 86 | |||
| 87 | config CAVIUM_OCTEON_HELPER | ||
| 88 | def_bool y | ||
| 89 | depends on OCTEON_ETHERNET || PCI | ||
diff --git a/arch/mips/cavium-octeon/cpu.c b/arch/mips/cavium-octeon/cpu.c index c664c8cc2b42..a5b427909b5c 100644 --- a/arch/mips/cavium-octeon/cpu.c +++ b/arch/mips/cavium-octeon/cpu.c | |||
| @@ -41,7 +41,7 @@ static int cnmips_cu2_call(struct notifier_block *nfb, unsigned long action, | |||
| 41 | return NOTIFY_OK; /* Let default notifier send signals */ | 41 | return NOTIFY_OK; /* Let default notifier send signals */ |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | static int cnmips_cu2_setup(void) | 44 | static int __init cnmips_cu2_setup(void) |
| 45 | { | 45 | { |
| 46 | return cu2_notifier(cnmips_cu2_call, 0); | 46 | return cu2_notifier(cnmips_cu2_call, 0); |
| 47 | } | 47 | } |
diff --git a/arch/mips/cavium-octeon/executive/Makefile b/arch/mips/cavium-octeon/executive/Makefile index 2fd66db6939e..7f41c5be2190 100644 --- a/arch/mips/cavium-octeon/executive/Makefile +++ b/arch/mips/cavium-octeon/executive/Makefile | |||
| @@ -11,4 +11,4 @@ | |||
| 11 | 11 | ||
| 12 | obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o | 12 | obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o |
| 13 | 13 | ||
| 14 | obj-$(CONFIG_PCI) += cvmx-helper-errata.o cvmx-helper-jtag.o | 14 | obj-$(CONFIG_CAVIUM_OCTEON_HELPER) += cvmx-helper-errata.o cvmx-helper-jtag.o |
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h index c63c56bfd184..47d87da379f9 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h | |||
| @@ -782,6 +782,10 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | |||
| 782 | */ | 782 | */ |
| 783 | #define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0) | 783 | #define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0) |
| 784 | 784 | ||
| 785 | #else /* !CONFIG_64BIT */ | ||
| 786 | |||
| 787 | #include <asm-generic/atomic64.h> | ||
| 788 | |||
| 785 | #endif /* CONFIG_64BIT */ | 789 | #endif /* CONFIG_64BIT */ |
| 786 | 790 | ||
| 787 | /* | 791 | /* |
diff --git a/arch/mips/include/asm/cop2.h b/arch/mips/include/asm/cop2.h index 2cb2f0c2c4f8..3532e2c5f098 100644 --- a/arch/mips/include/asm/cop2.h +++ b/arch/mips/include/asm/cop2.h | |||
| @@ -24,7 +24,7 @@ extern int cu2_notifier_call_chain(unsigned long val, void *v); | |||
| 24 | 24 | ||
| 25 | #define cu2_notifier(fn, pri) \ | 25 | #define cu2_notifier(fn, pri) \ |
| 26 | ({ \ | 26 | ({ \ |
| 27 | static struct notifier_block fn##_nb __cpuinitdata = { \ | 27 | static struct notifier_block fn##_nb = { \ |
| 28 | .notifier_call = fn, \ | 28 | .notifier_call = fn, \ |
| 29 | .priority = pri \ | 29 | .priority = pri \ |
| 30 | }; \ | 30 | }; \ |
diff --git a/arch/mips/include/asm/fcntl.h b/arch/mips/include/asm/fcntl.h index e482fe90fe88..75eddedcfc3e 100644 --- a/arch/mips/include/asm/fcntl.h +++ b/arch/mips/include/asm/fcntl.h | |||
| @@ -56,6 +56,7 @@ | |||
| 56 | */ | 56 | */ |
| 57 | 57 | ||
| 58 | #ifdef CONFIG_32BIT | 58 | #ifdef CONFIG_32BIT |
| 59 | #include <linux/types.h> | ||
| 59 | 60 | ||
| 60 | struct flock { | 61 | struct flock { |
| 61 | short l_type; | 62 | short l_type; |
diff --git a/arch/mips/include/asm/gic.h b/arch/mips/include/asm/gic.h index 9b9436a4d816..86548da650e7 100644 --- a/arch/mips/include/asm/gic.h +++ b/arch/mips/include/asm/gic.h | |||
| @@ -321,6 +321,7 @@ struct gic_intrmask_regs { | |||
| 321 | */ | 321 | */ |
| 322 | struct gic_intr_map { | 322 | struct gic_intr_map { |
| 323 | unsigned int cpunum; /* Directed to this CPU */ | 323 | unsigned int cpunum; /* Directed to this CPU */ |
| 324 | #define GIC_UNUSED 0xdead /* Dummy data */ | ||
| 324 | unsigned int pin; /* Directed to this Pin */ | 325 | unsigned int pin; /* Directed to this Pin */ |
| 325 | unsigned int polarity; /* Polarity : +/- */ | 326 | unsigned int polarity; /* Polarity : +/- */ |
| 326 | unsigned int trigtype; /* Trigger : Edge/Levl */ | 327 | unsigned int trigtype; /* Trigger : Edge/Levl */ |
diff --git a/arch/mips/include/asm/mach-tx49xx/kmalloc.h b/arch/mips/include/asm/mach-tx49xx/kmalloc.h index b74caf65482b..ff9a8b86cb93 100644 --- a/arch/mips/include/asm/mach-tx49xx/kmalloc.h +++ b/arch/mips/include/asm/mach-tx49xx/kmalloc.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #ifndef __ASM_MACH_TX49XX_KMALLOC_H | 1 | #ifndef __ASM_MACH_TX49XX_KMALLOC_H |
| 2 | #define __ASM_MACH_TX49XX_KMALLOC_H | 2 | #define __ASM_MACH_TX49XX_KMALLOC_H |
| 3 | 3 | ||
| 4 | #define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES | 4 | #define ARCH_DMA_MINALIGN L1_CACHE_BYTES |
| 5 | 5 | ||
| 6 | #endif /* __ASM_MACH_TX49XX_KMALLOC_H */ | 6 | #endif /* __ASM_MACH_TX49XX_KMALLOC_H */ |
diff --git a/arch/mips/include/asm/mips-boards/maltaint.h b/arch/mips/include/asm/mips-boards/maltaint.h index cea872fc6f5c..d11aa02a956a 100644 --- a/arch/mips/include/asm/mips-boards/maltaint.h +++ b/arch/mips/include/asm/mips-boards/maltaint.h | |||
| @@ -88,9 +88,6 @@ | |||
| 88 | 88 | ||
| 89 | #define GIC_EXT_INTR(x) x | 89 | #define GIC_EXT_INTR(x) x |
| 90 | 90 | ||
| 91 | /* Dummy data */ | ||
| 92 | #define X 0xdead | ||
| 93 | |||
| 94 | /* External Interrupts used for IPI */ | 91 | /* External Interrupts used for IPI */ |
| 95 | #define GIC_IPI_EXT_INTR_RESCHED_VPE0 16 | 92 | #define GIC_IPI_EXT_INTR_RESCHED_VPE0 16 |
| 96 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE0 17 | 93 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE0 17 |
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h index a16beafcea91..e59cd1ac09c2 100644 --- a/arch/mips/include/asm/page.h +++ b/arch/mips/include/asm/page.h | |||
| @@ -150,6 +150,20 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
| 150 | ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) | 150 | ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) |
| 151 | #endif | 151 | #endif |
| 152 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) | 152 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) |
| 153 | |||
| 154 | /* | ||
| 155 | * RELOC_HIDE was originally added by 6007b903dfe5f1d13e0c711ac2894bdd4a61b1ad | ||
| 156 | * (lmo) rsp. 8431fd094d625b94d364fe393076ccef88e6ce18 (kernel.org). The | ||
| 157 | * discussion can be found in lkml posting | ||
| 158 | * <a2ebde260608230500o3407b108hc03debb9da6e62c@mail.gmail.com> which is | ||
| 159 | * archived at http://lists.linuxcoding.com/kernel/2006-q3/msg17360.html | ||
| 160 | * | ||
| 161 | * It is unclear if the misscompilations mentioned in | ||
| 162 | * http://lkml.org/lkml/2010/8/8/138 also affect MIPS so we keep this one | ||
| 163 | * until GCC 3.x has been retired before we can apply | ||
| 164 | * https://patchwork.linux-mips.org/patch/1541/ | ||
| 165 | */ | ||
| 166 | |||
| 153 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) | 167 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) |
| 154 | 168 | ||
| 155 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 169 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
diff --git a/arch/mips/include/asm/siginfo.h b/arch/mips/include/asm/siginfo.h index 96e28f18dad1..1ca64b4d33d9 100644 --- a/arch/mips/include/asm/siginfo.h +++ b/arch/mips/include/asm/siginfo.h | |||
| @@ -88,6 +88,7 @@ typedef struct siginfo { | |||
| 88 | #ifdef __ARCH_SI_TRAPNO | 88 | #ifdef __ARCH_SI_TRAPNO |
| 89 | int _trapno; /* TRAP # which caused the signal */ | 89 | int _trapno; /* TRAP # which caused the signal */ |
| 90 | #endif | 90 | #endif |
| 91 | short _addr_lsb; | ||
| 91 | } _sigfault; | 92 | } _sigfault; |
| 92 | 93 | ||
| 93 | /* SIGPOLL, SIGXFSZ (To do ...) */ | 94 | /* SIGPOLL, SIGXFSZ (To do ...) */ |
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h index 2376f2e06e47..70df9c0d3c5b 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h | |||
| @@ -146,7 +146,8 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
| 146 | #define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH) | 146 | #define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH) |
| 147 | 147 | ||
| 148 | /* work to do on interrupt/exception return */ | 148 | /* work to do on interrupt/exception return */ |
| 149 | #define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP) | 149 | #define _TIF_WORK_MASK (0x0000ffef & \ |
| 150 | ~(_TIF_SECCOMP | _TIF_SYSCALL_AUDIT)) | ||
| 150 | /* work to do on any return to u-space */ | 151 | /* work to do on any return to u-space */ |
| 151 | #define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP) | 152 | #define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP) |
| 152 | 153 | ||
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index baa318a59c97..550725b881d5 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h | |||
| @@ -356,16 +356,19 @@ | |||
| 356 | #define __NR_perf_event_open (__NR_Linux + 333) | 356 | #define __NR_perf_event_open (__NR_Linux + 333) |
| 357 | #define __NR_accept4 (__NR_Linux + 334) | 357 | #define __NR_accept4 (__NR_Linux + 334) |
| 358 | #define __NR_recvmmsg (__NR_Linux + 335) | 358 | #define __NR_recvmmsg (__NR_Linux + 335) |
| 359 | #define __NR_fanotify_init (__NR_Linux + 336) | ||
| 360 | #define __NR_fanotify_mark (__NR_Linux + 337) | ||
| 361 | #define __NR_prlimit64 (__NR_Linux + 338) | ||
| 359 | 362 | ||
| 360 | /* | 363 | /* |
| 361 | * Offset of the last Linux o32 flavoured syscall | 364 | * Offset of the last Linux o32 flavoured syscall |
| 362 | */ | 365 | */ |
| 363 | #define __NR_Linux_syscalls 335 | 366 | #define __NR_Linux_syscalls 338 |
| 364 | 367 | ||
| 365 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 368 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
| 366 | 369 | ||
| 367 | #define __NR_O32_Linux 4000 | 370 | #define __NR_O32_Linux 4000 |
| 368 | #define __NR_O32_Linux_syscalls 335 | 371 | #define __NR_O32_Linux_syscalls 338 |
| 369 | 372 | ||
| 370 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 373 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
| 371 | 374 | ||
| @@ -668,16 +671,19 @@ | |||
| 668 | #define __NR_perf_event_open (__NR_Linux + 292) | 671 | #define __NR_perf_event_open (__NR_Linux + 292) |
| 669 | #define __NR_accept4 (__NR_Linux + 293) | 672 | #define __NR_accept4 (__NR_Linux + 293) |
| 670 | #define __NR_recvmmsg (__NR_Linux + 294) | 673 | #define __NR_recvmmsg (__NR_Linux + 294) |
| 674 | #define __NR_fanotify_init (__NR_Linux + 295) | ||
| 675 | #define __NR_fanotify_mark (__NR_Linux + 296) | ||
| 676 | #define __NR_prlimit64 (__NR_Linux + 297) | ||
| 671 | 677 | ||
| 672 | /* | 678 | /* |
| 673 | * Offset of the last Linux 64-bit flavoured syscall | 679 | * Offset of the last Linux 64-bit flavoured syscall |
| 674 | */ | 680 | */ |
| 675 | #define __NR_Linux_syscalls 294 | 681 | #define __NR_Linux_syscalls 297 |
| 676 | 682 | ||
| 677 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 683 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
| 678 | 684 | ||
| 679 | #define __NR_64_Linux 5000 | 685 | #define __NR_64_Linux 5000 |
| 680 | #define __NR_64_Linux_syscalls 294 | 686 | #define __NR_64_Linux_syscalls 297 |
| 681 | 687 | ||
| 682 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 688 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
| 683 | 689 | ||
| @@ -985,16 +991,19 @@ | |||
| 985 | #define __NR_accept4 (__NR_Linux + 297) | 991 | #define __NR_accept4 (__NR_Linux + 297) |
| 986 | #define __NR_recvmmsg (__NR_Linux + 298) | 992 | #define __NR_recvmmsg (__NR_Linux + 298) |
| 987 | #define __NR_getdents64 (__NR_Linux + 299) | 993 | #define __NR_getdents64 (__NR_Linux + 299) |
| 994 | #define __NR_fanotify_init (__NR_Linux + 300) | ||
| 995 | #define __NR_fanotify_mark (__NR_Linux + 301) | ||
| 996 | #define __NR_prlimit64 (__NR_Linux + 302) | ||
| 988 | 997 | ||
| 989 | /* | 998 | /* |
| 990 | * Offset of the last N32 flavoured syscall | 999 | * Offset of the last N32 flavoured syscall |
| 991 | */ | 1000 | */ |
| 992 | #define __NR_Linux_syscalls 299 | 1001 | #define __NR_Linux_syscalls 302 |
| 993 | 1002 | ||
| 994 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 1003 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
| 995 | 1004 | ||
| 996 | #define __NR_N32_Linux 6000 | 1005 | #define __NR_N32_Linux 6000 |
| 997 | #define __NR_N32_Linux_syscalls 299 | 1006 | #define __NR_N32_Linux_syscalls 302 |
| 998 | 1007 | ||
| 999 | #ifdef __KERNEL__ | 1008 | #ifdef __KERNEL__ |
| 1000 | 1009 | ||
diff --git a/arch/mips/kernel/branch.c b/arch/mips/kernel/branch.c index 0176ed015c89..32103cc2a257 100644 --- a/arch/mips/kernel/branch.c +++ b/arch/mips/kernel/branch.c | |||
| @@ -40,7 +40,6 @@ int __compute_return_epc(struct pt_regs *regs) | |||
| 40 | return -EFAULT; | 40 | return -EFAULT; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | regs->regs[0] = 0; | ||
| 44 | switch (insn.i_format.opcode) { | 43 | switch (insn.i_format.opcode) { |
| 45 | /* | 44 | /* |
| 46 | * jr and jalr are in r_format format. | 45 | * jr and jalr are in r_format format. |
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c index b181f2f0ea8e..82ba9f62f49e 100644 --- a/arch/mips/kernel/irq-gic.c +++ b/arch/mips/kernel/irq-gic.c | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | #include <asm/io.h> | 7 | #include <asm/io.h> |
| 8 | #include <asm/gic.h> | 8 | #include <asm/gic.h> |
| 9 | #include <asm/gcmpregs.h> | 9 | #include <asm/gcmpregs.h> |
| 10 | #include <asm/mips-boards/maltaint.h> | ||
| 11 | #include <asm/irq.h> | 10 | #include <asm/irq.h> |
| 12 | #include <linux/hardirq.h> | 11 | #include <linux/hardirq.h> |
| 13 | #include <asm-generic/bitops/find.h> | 12 | #include <asm-generic/bitops/find.h> |
| @@ -131,7 +130,7 @@ static int gic_set_affinity(unsigned int irq, const struct cpumask *cpumask) | |||
| 131 | int i; | 130 | int i; |
| 132 | 131 | ||
| 133 | irq -= _irqbase; | 132 | irq -= _irqbase; |
| 134 | pr_debug(KERN_DEBUG "%s(%d) called\n", __func__, irq); | 133 | pr_debug("%s(%d) called\n", __func__, irq); |
| 135 | cpumask_and(&tmp, cpumask, cpu_online_mask); | 134 | cpumask_and(&tmp, cpumask, cpu_online_mask); |
| 136 | if (cpus_empty(tmp)) | 135 | if (cpus_empty(tmp)) |
| 137 | return -1; | 136 | return -1; |
| @@ -222,7 +221,7 @@ static void __init gic_basic_init(int numintrs, int numvpes, | |||
| 222 | /* Setup specifics */ | 221 | /* Setup specifics */ |
| 223 | for (i = 0; i < mapsize; i++) { | 222 | for (i = 0; i < mapsize; i++) { |
| 224 | cpu = intrmap[i].cpunum; | 223 | cpu = intrmap[i].cpunum; |
| 225 | if (cpu == X) | 224 | if (cpu == GIC_UNUSED) |
| 226 | continue; | 225 | continue; |
| 227 | if (cpu == 0 && i != 0 && intrmap[i].flags == 0) | 226 | if (cpu == 0 && i != 0 && intrmap[i].flags == 0) |
| 228 | continue; | 227 | continue; |
diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c index 1f4e2fa64140..f4546e97c60d 100644 --- a/arch/mips/kernel/kgdb.c +++ b/arch/mips/kernel/kgdb.c | |||
| @@ -283,7 +283,7 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd, | |||
| 283 | struct pt_regs *regs = args->regs; | 283 | struct pt_regs *regs = args->regs; |
| 284 | int trap = (regs->cp0_cause & 0x7c) >> 2; | 284 | int trap = (regs->cp0_cause & 0x7c) >> 2; |
| 285 | 285 | ||
| 286 | /* Userpace events, ignore. */ | 286 | /* Userspace events, ignore. */ |
| 287 | if (user_mode(regs)) | 287 | if (user_mode(regs)) |
| 288 | return NOTIFY_DONE; | 288 | return NOTIFY_DONE; |
| 289 | 289 | ||
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c index 80e2ba694bab..29811f043399 100644 --- a/arch/mips/kernel/kspd.c +++ b/arch/mips/kernel/kspd.c | |||
| @@ -251,7 +251,7 @@ void sp_work_handle_request(void) | |||
| 251 | memset(&tz, 0, sizeof(tz)); | 251 | memset(&tz, 0, sizeof(tz)); |
| 252 | if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv, | 252 | if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv, |
| 253 | (int)&tz, 0, 0)) == 0) | 253 | (int)&tz, 0, 0)) == 0) |
| 254 | ret.retval = tv.tv_sec; | 254 | ret.retval = tv.tv_sec; |
| 255 | break; | 255 | break; |
| 256 | 256 | ||
| 257 | case MTSP_SYSCALL_EXIT: | 257 | case MTSP_SYSCALL_EXIT: |
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index c2dab140dc98..6343b4a5b835 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
| @@ -341,3 +341,10 @@ asmlinkage long sys32_lookup_dcookie(u32 a0, u32 a1, char __user *buf, | |||
| 341 | { | 341 | { |
| 342 | return sys_lookup_dcookie(merge_64(a0, a1), buf, len); | 342 | return sys_lookup_dcookie(merge_64(a0, a1), buf, len); |
| 343 | } | 343 | } |
| 344 | |||
| 345 | SYSCALL_DEFINE6(32_fanotify_mark, int, fanotify_fd, unsigned int, flags, | ||
| 346 | u64, a3, u64, a4, int, dfd, const char __user *, pathname) | ||
| 347 | { | ||
| 348 | return sys_fanotify_mark(fanotify_fd, flags, merge_64(a3, a4), | ||
| 349 | dfd, pathname); | ||
| 350 | } | ||
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index c51b95ff8644..c8777333e198 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c | |||
| @@ -536,7 +536,7 @@ asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) | |||
| 536 | { | 536 | { |
| 537 | /* do the secure computing check first */ | 537 | /* do the secure computing check first */ |
| 538 | if (!entryexit) | 538 | if (!entryexit) |
| 539 | secure_computing(regs->regs[0]); | 539 | secure_computing(regs->regs[2]); |
| 540 | 540 | ||
| 541 | if (unlikely(current->audit_context) && entryexit) | 541 | if (unlikely(current->audit_context) && entryexit) |
| 542 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[2]), | 542 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[2]), |
| @@ -565,7 +565,7 @@ asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) | |||
| 565 | 565 | ||
| 566 | out: | 566 | out: |
| 567 | if (unlikely(current->audit_context) && !entryexit) | 567 | if (unlikely(current->audit_context) && !entryexit) |
| 568 | audit_syscall_entry(audit_arch(), regs->regs[0], | 568 | audit_syscall_entry(audit_arch(), regs->regs[2], |
| 569 | regs->regs[4], regs->regs[5], | 569 | regs->regs[4], regs->regs[5], |
| 570 | regs->regs[6], regs->regs[7]); | 570 | regs->regs[6], regs->regs[7]); |
| 571 | } | 571 | } |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 17202bbe843f..fbaabad0e6e2 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
| @@ -63,9 +63,9 @@ stack_done: | |||
| 63 | sw t0, PT_R7(sp) # set error flag | 63 | sw t0, PT_R7(sp) # set error flag |
| 64 | beqz t0, 1f | 64 | beqz t0, 1f |
| 65 | 65 | ||
| 66 | lw t1, PT_R2(sp) # syscall number | ||
| 66 | negu v0 # error | 67 | negu v0 # error |
| 67 | sw v0, PT_R0(sp) # set flag for syscall | 68 | sw t1, PT_R0(sp) # save it for syscall restarting |
| 68 | # restarting | ||
| 69 | 1: sw v0, PT_R2(sp) # result | 69 | 1: sw v0, PT_R2(sp) # result |
| 70 | 70 | ||
| 71 | o32_syscall_exit: | 71 | o32_syscall_exit: |
| @@ -104,9 +104,9 @@ syscall_trace_entry: | |||
| 104 | sw t0, PT_R7(sp) # set error flag | 104 | sw t0, PT_R7(sp) # set error flag |
| 105 | beqz t0, 1f | 105 | beqz t0, 1f |
| 106 | 106 | ||
| 107 | lw t1, PT_R2(sp) # syscall number | ||
| 107 | negu v0 # error | 108 | negu v0 # error |
| 108 | sw v0, PT_R0(sp) # set flag for syscall | 109 | sw t1, PT_R0(sp) # save it for syscall restarting |
| 109 | # restarting | ||
| 110 | 1: sw v0, PT_R2(sp) # result | 110 | 1: sw v0, PT_R2(sp) # result |
| 111 | 111 | ||
| 112 | j syscall_exit | 112 | j syscall_exit |
| @@ -169,8 +169,7 @@ stackargs: | |||
| 169 | * We probably should handle this case a bit more drastic. | 169 | * We probably should handle this case a bit more drastic. |
| 170 | */ | 170 | */ |
| 171 | bad_stack: | 171 | bad_stack: |
| 172 | negu v0 # error | 172 | li v0, EFAULT |
| 173 | sw v0, PT_R0(sp) | ||
| 174 | sw v0, PT_R2(sp) | 173 | sw v0, PT_R2(sp) |
| 175 | li t0, 1 # set error flag | 174 | li t0, 1 # set error flag |
| 176 | sw t0, PT_R7(sp) | 175 | sw t0, PT_R7(sp) |
| @@ -583,7 +582,10 @@ einval: li v0, -ENOSYS | |||
| 583 | sys sys_rt_tgsigqueueinfo 4 | 582 | sys sys_rt_tgsigqueueinfo 4 |
| 584 | sys sys_perf_event_open 5 | 583 | sys sys_perf_event_open 5 |
| 585 | sys sys_accept4 4 | 584 | sys sys_accept4 4 |
| 586 | sys sys_recvmmsg 5 | 585 | sys sys_recvmmsg 5 /* 4335 */ |
| 586 | sys sys_fanotify_init 2 | ||
| 587 | sys sys_fanotify_mark 6 | ||
| 588 | sys sys_prlimit64 4 | ||
| 587 | .endm | 589 | .endm |
| 588 | 590 | ||
| 589 | /* We pre-compute the number of _instruction_ bytes needed to | 591 | /* We pre-compute the number of _instruction_ bytes needed to |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index a8a6c596eb04..3f4179283207 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
| @@ -66,9 +66,9 @@ NESTED(handle_sys64, PT_SIZE, sp) | |||
| 66 | sd t0, PT_R7(sp) # set error flag | 66 | sd t0, PT_R7(sp) # set error flag |
| 67 | beqz t0, 1f | 67 | beqz t0, 1f |
| 68 | 68 | ||
| 69 | ld t1, PT_R2(sp) # syscall number | ||
| 69 | dnegu v0 # error | 70 | dnegu v0 # error |
| 70 | sd v0, PT_R0(sp) # set flag for syscall | 71 | sd t1, PT_R0(sp) # save it for syscall restarting |
| 71 | # restarting | ||
| 72 | 1: sd v0, PT_R2(sp) # result | 72 | 1: sd v0, PT_R2(sp) # result |
| 73 | 73 | ||
| 74 | n64_syscall_exit: | 74 | n64_syscall_exit: |
| @@ -109,8 +109,9 @@ syscall_trace_entry: | |||
| 109 | sd t0, PT_R7(sp) # set error flag | 109 | sd t0, PT_R7(sp) # set error flag |
| 110 | beqz t0, 1f | 110 | beqz t0, 1f |
| 111 | 111 | ||
| 112 | ld t1, PT_R2(sp) # syscall number | ||
| 112 | dnegu v0 # error | 113 | dnegu v0 # error |
| 113 | sd v0, PT_R0(sp) # set flag for syscall restarting | 114 | sd t1, PT_R0(sp) # save it for syscall restarting |
| 114 | 1: sd v0, PT_R2(sp) # result | 115 | 1: sd v0, PT_R2(sp) # result |
| 115 | 116 | ||
| 116 | j syscall_exit | 117 | j syscall_exit |
| @@ -416,9 +417,12 @@ sys_call_table: | |||
| 416 | PTR sys_pipe2 | 417 | PTR sys_pipe2 |
| 417 | PTR sys_inotify_init1 | 418 | PTR sys_inotify_init1 |
| 418 | PTR sys_preadv | 419 | PTR sys_preadv |
| 419 | PTR sys_pwritev /* 5390 */ | 420 | PTR sys_pwritev /* 5290 */ |
| 420 | PTR sys_rt_tgsigqueueinfo | 421 | PTR sys_rt_tgsigqueueinfo |
| 421 | PTR sys_perf_event_open | 422 | PTR sys_perf_event_open |
| 422 | PTR sys_accept4 | 423 | PTR sys_accept4 |
| 423 | PTR sys_recvmmsg | 424 | PTR sys_recvmmsg |
| 425 | PTR sys_fanotify_init /* 5295 */ | ||
| 426 | PTR sys_fanotify_mark | ||
| 427 | PTR sys_prlimit64 | ||
| 424 | .size sys_call_table,.-sys_call_table | 428 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index a3d66137731a..38b226938db3 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
| @@ -65,8 +65,9 @@ NESTED(handle_sysn32, PT_SIZE, sp) | |||
| 65 | sd t0, PT_R7(sp) # set error flag | 65 | sd t0, PT_R7(sp) # set error flag |
| 66 | beqz t0, 1f | 66 | beqz t0, 1f |
| 67 | 67 | ||
| 68 | ld t1, PT_R2(sp) # syscall number | ||
| 68 | dnegu v0 # error | 69 | dnegu v0 # error |
| 69 | sd v0, PT_R0(sp) # set flag for syscall restarting | 70 | sd t1, PT_R0(sp) # save it for syscall restarting |
| 70 | 1: sd v0, PT_R2(sp) # result | 71 | 1: sd v0, PT_R2(sp) # result |
| 71 | 72 | ||
| 72 | local_irq_disable # make sure need_resched and | 73 | local_irq_disable # make sure need_resched and |
| @@ -106,8 +107,9 @@ n32_syscall_trace_entry: | |||
| 106 | sd t0, PT_R7(sp) # set error flag | 107 | sd t0, PT_R7(sp) # set error flag |
| 107 | beqz t0, 1f | 108 | beqz t0, 1f |
| 108 | 109 | ||
| 110 | ld t1, PT_R2(sp) # syscall number | ||
| 109 | dnegu v0 # error | 111 | dnegu v0 # error |
| 110 | sd v0, PT_R0(sp) # set flag for syscall restarting | 112 | sd t1, PT_R0(sp) # save it for syscall restarting |
| 111 | 1: sd v0, PT_R2(sp) # result | 113 | 1: sd v0, PT_R2(sp) # result |
| 112 | 114 | ||
| 113 | j syscall_exit | 115 | j syscall_exit |
| @@ -419,5 +421,8 @@ EXPORT(sysn32_call_table) | |||
| 419 | PTR sys_perf_event_open | 421 | PTR sys_perf_event_open |
| 420 | PTR sys_accept4 | 422 | PTR sys_accept4 |
| 421 | PTR compat_sys_recvmmsg | 423 | PTR compat_sys_recvmmsg |
| 422 | PTR sys_getdents | 424 | PTR sys_getdents64 |
| 425 | PTR sys_fanotify_init /* 6300 */ | ||
| 426 | PTR sys_fanotify_mark | ||
| 427 | PTR sys_prlimit64 | ||
| 423 | .size sysn32_call_table,.-sysn32_call_table | 428 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 813689ef2384..42fe14b52a33 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
| @@ -93,8 +93,9 @@ NESTED(handle_sys, PT_SIZE, sp) | |||
| 93 | sd t0, PT_R7(sp) # set error flag | 93 | sd t0, PT_R7(sp) # set error flag |
| 94 | beqz t0, 1f | 94 | beqz t0, 1f |
| 95 | 95 | ||
| 96 | ld t1, PT_R2(sp) # syscall number | ||
| 96 | dnegu v0 # error | 97 | dnegu v0 # error |
| 97 | sd v0, PT_R0(sp) # flag for syscall restarting | 98 | sd t1, PT_R0(sp) # save it for syscall restarting |
| 98 | 1: sd v0, PT_R2(sp) # result | 99 | 1: sd v0, PT_R2(sp) # result |
| 99 | 100 | ||
| 100 | o32_syscall_exit: | 101 | o32_syscall_exit: |
| @@ -142,8 +143,9 @@ trace_a_syscall: | |||
| 142 | sd t0, PT_R7(sp) # set error flag | 143 | sd t0, PT_R7(sp) # set error flag |
| 143 | beqz t0, 1f | 144 | beqz t0, 1f |
| 144 | 145 | ||
| 146 | ld t1, PT_R2(sp) # syscall number | ||
| 145 | dnegu v0 # error | 147 | dnegu v0 # error |
| 146 | sd v0, PT_R0(sp) # set flag for syscall restarting | 148 | sd t1, PT_R0(sp) # save it for syscall restarting |
| 147 | 1: sd v0, PT_R2(sp) # result | 149 | 1: sd v0, PT_R2(sp) # result |
| 148 | 150 | ||
| 149 | j syscall_exit | 151 | j syscall_exit |
| @@ -154,8 +156,7 @@ trace_a_syscall: | |||
| 154 | * The stackpointer for a call with more than 4 arguments is bad. | 156 | * The stackpointer for a call with more than 4 arguments is bad. |
| 155 | */ | 157 | */ |
| 156 | bad_stack: | 158 | bad_stack: |
| 157 | dnegu v0 # error | 159 | li v0, EFAULT |
| 158 | sd v0, PT_R0(sp) | ||
| 159 | sd v0, PT_R2(sp) | 160 | sd v0, PT_R2(sp) |
| 160 | li t0, 1 # set error flag | 161 | li t0, 1 # set error flag |
| 161 | sd t0, PT_R7(sp) | 162 | sd t0, PT_R7(sp) |
| @@ -538,5 +539,8 @@ sys_call_table: | |||
| 538 | PTR compat_sys_rt_tgsigqueueinfo | 539 | PTR compat_sys_rt_tgsigqueueinfo |
| 539 | PTR sys_perf_event_open | 540 | PTR sys_perf_event_open |
| 540 | PTR sys_accept4 | 541 | PTR sys_accept4 |
| 541 | PTR compat_sys_recvmmsg | 542 | PTR compat_sys_recvmmsg /* 4335 */ |
| 543 | PTR sys_fanotify_init | ||
| 544 | PTR sys_32_fanotify_mark | ||
| 545 | PTR sys_prlimit64 | ||
| 542 | .size sys_call_table,.-sys_call_table | 546 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 2099d5a4c4b7..5922342bca39 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
| @@ -390,7 +390,6 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
| 390 | { | 390 | { |
| 391 | struct rt_sigframe __user *frame; | 391 | struct rt_sigframe __user *frame; |
| 392 | sigset_t set; | 392 | sigset_t set; |
| 393 | stack_t st; | ||
| 394 | int sig; | 393 | int sig; |
| 395 | 394 | ||
| 396 | frame = (struct rt_sigframe __user *) regs.regs[29]; | 395 | frame = (struct rt_sigframe __user *) regs.regs[29]; |
| @@ -411,11 +410,9 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
| 411 | else if (sig) | 410 | else if (sig) |
| 412 | force_sig(sig, current); | 411 | force_sig(sig, current); |
| 413 | 412 | ||
| 414 | if (__copy_from_user(&st, &frame->rs_uc.uc_stack, sizeof(st))) | ||
| 415 | goto badframe; | ||
| 416 | /* It is more difficult to avoid calling this function than to | 413 | /* It is more difficult to avoid calling this function than to |
| 417 | call it and ignore errors. */ | 414 | call it and ignore errors. */ |
| 418 | do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]); | 415 | do_sigaltstack(&frame->rs_uc.uc_stack, NULL, regs.regs[29]); |
| 419 | 416 | ||
| 420 | /* | 417 | /* |
| 421 | * Don't let your children do this ... | 418 | * Don't let your children do this ... |
| @@ -550,23 +547,26 @@ static int handle_signal(unsigned long sig, siginfo_t *info, | |||
| 550 | struct mips_abi *abi = current->thread.abi; | 547 | struct mips_abi *abi = current->thread.abi; |
| 551 | void *vdso = current->mm->context.vdso; | 548 | void *vdso = current->mm->context.vdso; |
| 552 | 549 | ||
| 553 | switch(regs->regs[0]) { | 550 | if (regs->regs[0]) { |
| 554 | case ERESTART_RESTARTBLOCK: | 551 | switch(regs->regs[2]) { |
| 555 | case ERESTARTNOHAND: | 552 | case ERESTART_RESTARTBLOCK: |
| 556 | regs->regs[2] = EINTR; | 553 | case ERESTARTNOHAND: |
| 557 | break; | ||
| 558 | case ERESTARTSYS: | ||
| 559 | if (!(ka->sa.sa_flags & SA_RESTART)) { | ||
| 560 | regs->regs[2] = EINTR; | 554 | regs->regs[2] = EINTR; |
| 561 | break; | 555 | break; |
| 556 | case ERESTARTSYS: | ||
| 557 | if (!(ka->sa.sa_flags & SA_RESTART)) { | ||
| 558 | regs->regs[2] = EINTR; | ||
| 559 | break; | ||
| 560 | } | ||
| 561 | /* fallthrough */ | ||
| 562 | case ERESTARTNOINTR: | ||
| 563 | regs->regs[7] = regs->regs[26]; | ||
| 564 | regs->regs[2] = regs->regs[0]; | ||
| 565 | regs->cp0_epc -= 4; | ||
| 562 | } | 566 | } |
| 563 | /* fallthrough */ | ||
| 564 | case ERESTARTNOINTR: /* Userland will reload $v0. */ | ||
| 565 | regs->regs[7] = regs->regs[26]; | ||
| 566 | regs->cp0_epc -= 8; | ||
| 567 | } | ||
| 568 | 567 | ||
| 569 | regs->regs[0] = 0; /* Don't deal with this again. */ | 568 | regs->regs[0] = 0; /* Don't deal with this again. */ |
| 569 | } | ||
| 570 | 570 | ||
| 571 | if (sig_uses_siginfo(ka)) | 571 | if (sig_uses_siginfo(ka)) |
| 572 | ret = abi->setup_rt_frame(vdso + abi->rt_signal_return_offset, | 572 | ret = abi->setup_rt_frame(vdso + abi->rt_signal_return_offset, |
| @@ -575,6 +575,9 @@ static int handle_signal(unsigned long sig, siginfo_t *info, | |||
| 575 | ret = abi->setup_frame(vdso + abi->signal_return_offset, | 575 | ret = abi->setup_frame(vdso + abi->signal_return_offset, |
| 576 | ka, regs, sig, oldset); | 576 | ka, regs, sig, oldset); |
| 577 | 577 | ||
| 578 | if (ret) | ||
| 579 | return ret; | ||
| 580 | |||
| 578 | spin_lock_irq(¤t->sighand->siglock); | 581 | spin_lock_irq(¤t->sighand->siglock); |
| 579 | sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); | 582 | sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); |
| 580 | if (!(ka->sa.sa_flags & SA_NODEFER)) | 583 | if (!(ka->sa.sa_flags & SA_NODEFER)) |
| @@ -622,17 +625,13 @@ static void do_signal(struct pt_regs *regs) | |||
| 622 | return; | 625 | return; |
| 623 | } | 626 | } |
| 624 | 627 | ||
| 625 | /* | ||
| 626 | * Who's code doesn't conform to the restartable syscall convention | ||
| 627 | * dies here!!! The li instruction, a single machine instruction, | ||
| 628 | * must directly be followed by the syscall instruction. | ||
| 629 | */ | ||
| 630 | if (regs->regs[0]) { | 628 | if (regs->regs[0]) { |
| 631 | if (regs->regs[2] == ERESTARTNOHAND || | 629 | if (regs->regs[2] == ERESTARTNOHAND || |
| 632 | regs->regs[2] == ERESTARTSYS || | 630 | regs->regs[2] == ERESTARTSYS || |
| 633 | regs->regs[2] == ERESTARTNOINTR) { | 631 | regs->regs[2] == ERESTARTNOINTR) { |
| 632 | regs->regs[2] = regs->regs[0]; | ||
| 634 | regs->regs[7] = regs->regs[26]; | 633 | regs->regs[7] = regs->regs[26]; |
| 635 | regs->cp0_epc -= 8; | 634 | regs->cp0_epc -= 4; |
| 636 | } | 635 | } |
| 637 | if (regs->regs[2] == ERESTART_RESTARTBLOCK) { | 636 | if (regs->regs[2] == ERESTART_RESTARTBLOCK) { |
| 638 | regs->regs[2] = current->thread.abi->restart; | 637 | regs->regs[2] = current->thread.abi->restart; |
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c index 2c5df818c65a..ee24d814d5b9 100644 --- a/arch/mips/kernel/signal_n32.c +++ b/arch/mips/kernel/signal_n32.c | |||
| @@ -109,6 +109,7 @@ asmlinkage int sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
| 109 | asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | 109 | asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) |
| 110 | { | 110 | { |
| 111 | struct rt_sigframe_n32 __user *frame; | 111 | struct rt_sigframe_n32 __user *frame; |
| 112 | mm_segment_t old_fs; | ||
| 112 | sigset_t set; | 113 | sigset_t set; |
| 113 | stack_t st; | 114 | stack_t st; |
| 114 | s32 sp; | 115 | s32 sp; |
| @@ -143,7 +144,11 @@ asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
| 143 | 144 | ||
| 144 | /* It is more difficult to avoid calling this function than to | 145 | /* It is more difficult to avoid calling this function than to |
| 145 | call it and ignore errors. */ | 146 | call it and ignore errors. */ |
| 147 | old_fs = get_fs(); | ||
| 148 | set_fs(KERNEL_DS); | ||
| 146 | do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]); | 149 | do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]); |
| 150 | set_fs(old_fs); | ||
| 151 | |||
| 147 | 152 | ||
| 148 | /* | 153 | /* |
| 149 | * Don't let your children do this ... | 154 | * Don't let your children do this ... |
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c index 69b039ca8d83..33d5a5ce4a29 100644 --- a/arch/mips/kernel/unaligned.c +++ b/arch/mips/kernel/unaligned.c | |||
| @@ -109,8 +109,6 @@ static void emulate_load_store_insn(struct pt_regs *regs, | |||
| 109 | unsigned long value; | 109 | unsigned long value; |
| 110 | unsigned int res; | 110 | unsigned int res; |
| 111 | 111 | ||
| 112 | regs->regs[0] = 0; | ||
| 113 | |||
| 114 | /* | 112 | /* |
| 115 | * This load never faults. | 113 | * This load never faults. |
| 116 | */ | 114 | */ |
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index 7ba890860d98..469d4019f795 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c | |||
| @@ -44,27 +44,39 @@ static inline int cpu_is_noncoherent_r10000(struct device *dev) | |||
| 44 | 44 | ||
| 45 | static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp) | 45 | static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp) |
| 46 | { | 46 | { |
| 47 | gfp_t dma_flag; | ||
| 48 | |||
| 47 | /* ignore region specifiers */ | 49 | /* ignore region specifiers */ |
| 48 | gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); | 50 | gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); |
| 49 | 51 | ||
| 50 | #ifdef CONFIG_ZONE_DMA | 52 | #ifdef CONFIG_ISA |
| 51 | if (dev == NULL) | 53 | if (dev == NULL) |
| 52 | gfp |= __GFP_DMA; | 54 | dma_flag = __GFP_DMA; |
| 53 | else if (dev->coherent_dma_mask < DMA_BIT_MASK(24)) | ||
| 54 | gfp |= __GFP_DMA; | ||
| 55 | else | 55 | else |
| 56 | #endif | 56 | #endif |
| 57 | #ifdef CONFIG_ZONE_DMA32 | 57 | #if defined(CONFIG_ZONE_DMA32) && defined(CONFIG_ZONE_DMA) |
| 58 | if (dev->coherent_dma_mask < DMA_BIT_MASK(32)) | 58 | if (dev->coherent_dma_mask < DMA_BIT_MASK(32)) |
| 59 | gfp |= __GFP_DMA32; | 59 | dma_flag = __GFP_DMA; |
| 60 | else if (dev->coherent_dma_mask < DMA_BIT_MASK(64)) | ||
| 61 | dma_flag = __GFP_DMA32; | ||
| 62 | else | ||
| 63 | #endif | ||
| 64 | #if defined(CONFIG_ZONE_DMA32) && !defined(CONFIG_ZONE_DMA) | ||
| 65 | if (dev->coherent_dma_mask < DMA_BIT_MASK(64)) | ||
| 66 | dma_flag = __GFP_DMA32; | ||
| 67 | else | ||
| 68 | #endif | ||
| 69 | #if defined(CONFIG_ZONE_DMA) && !defined(CONFIG_ZONE_DMA32) | ||
| 70 | if (dev->coherent_dma_mask < DMA_BIT_MASK(64)) | ||
| 71 | dma_flag = __GFP_DMA; | ||
| 60 | else | 72 | else |
| 61 | #endif | 73 | #endif |
| 62 | ; | 74 | dma_flag = 0; |
| 63 | 75 | ||
| 64 | /* Don't invoke OOM killer */ | 76 | /* Don't invoke OOM killer */ |
| 65 | gfp |= __GFP_NORETRY; | 77 | gfp |= __GFP_NORETRY; |
| 66 | 78 | ||
| 67 | return gfp; | 79 | return gfp | dma_flag; |
| 68 | } | 80 | } |
| 69 | 81 | ||
| 70 | void *dma_alloc_noncoherent(struct device *dev, size_t size, | 82 | void *dma_alloc_noncoherent(struct device *dev, size_t size, |
diff --git a/arch/mips/mm/sc-rm7k.c b/arch/mips/mm/sc-rm7k.c index 1ef75cd80a0d..274af3be1442 100644 --- a/arch/mips/mm/sc-rm7k.c +++ b/arch/mips/mm/sc-rm7k.c | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | #define tc_lsize 32 | 30 | #define tc_lsize 32 |
| 31 | 31 | ||
| 32 | extern unsigned long icache_way_size, dcache_way_size; | 32 | extern unsigned long icache_way_size, dcache_way_size; |
| 33 | unsigned long tcache_size; | 33 | static unsigned long tcache_size; |
| 34 | 34 | ||
| 35 | #include <asm/r4kcache.h> | 35 | #include <asm/r4kcache.h> |
| 36 | 36 | ||
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c index 15949b0be811..b79b24afe3a2 100644 --- a/arch/mips/mti-malta/malta-int.c +++ b/arch/mips/mti-malta/malta-int.c | |||
| @@ -385,6 +385,8 @@ static int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap); | |||
| 385 | */ | 385 | */ |
| 386 | 386 | ||
| 387 | #define GIC_CPU_NMI GIC_MAP_TO_NMI_MSK | 387 | #define GIC_CPU_NMI GIC_MAP_TO_NMI_MSK |
| 388 | #define X GIC_UNUSED | ||
| 389 | |||
| 388 | static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = { | 390 | static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = { |
| 389 | { X, X, X, X, 0 }, | 391 | { X, X, X, X, 0 }, |
| 390 | { X, X, X, X, 0 }, | 392 | { X, X, X, X, 0 }, |
| @@ -404,6 +406,7 @@ static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = { | |||
| 404 | { X, X, X, X, 0 }, | 406 | { X, X, X, X, 0 }, |
| 405 | /* The remainder of this table is initialised by fill_ipi_map */ | 407 | /* The remainder of this table is initialised by fill_ipi_map */ |
| 406 | }; | 408 | }; |
| 409 | #undef X | ||
| 407 | 410 | ||
| 408 | /* | 411 | /* |
| 409 | * GCMP needs to be detected before any SMP initialisation | 412 | * GCMP needs to be detected before any SMP initialisation |
diff --git a/arch/mips/pci/pci-rc32434.c b/arch/mips/pci/pci-rc32434.c index 71f7d27b0d4c..f31218e17d3c 100644 --- a/arch/mips/pci/pci-rc32434.c +++ b/arch/mips/pci/pci-rc32434.c | |||
| @@ -118,7 +118,7 @@ static int __init rc32434_pcibridge_init(void) | |||
| 118 | if (!((pcicvalue == PCIM_H_EA) || | 118 | if (!((pcicvalue == PCIM_H_EA) || |
| 119 | (pcicvalue == PCIM_H_IA_FIX) || | 119 | (pcicvalue == PCIM_H_IA_FIX) || |
| 120 | (pcicvalue == PCIM_H_IA_RR))) { | 120 | (pcicvalue == PCIM_H_IA_RR))) { |
| 121 | pr_err(KERN_ERR "PCI init error!!!\n"); | 121 | pr_err("PCI init error!!!\n"); |
| 122 | /* Not in Host Mode, return ERROR */ | 122 | /* Not in Host Mode, return ERROR */ |
| 123 | return -1; | 123 | return -1; |
| 124 | } | 124 | } |
diff --git a/arch/mips/pnx8550/common/reset.c b/arch/mips/pnx8550/common/reset.c index fadd8744a6bc..e7a12ff304b9 100644 --- a/arch/mips/pnx8550/common/reset.c +++ b/arch/mips/pnx8550/common/reset.c | |||
| @@ -22,29 +22,19 @@ | |||
| 22 | */ | 22 | */ |
| 23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
| 24 | 24 | ||
| 25 | #include <asm/processor.h> | ||
| 25 | #include <asm/reboot.h> | 26 | #include <asm/reboot.h> |
| 26 | #include <glb.h> | 27 | #include <glb.h> |
| 27 | 28 | ||
| 28 | void pnx8550_machine_restart(char *command) | 29 | void pnx8550_machine_restart(char *command) |
| 29 | { | 30 | { |
| 30 | char head[] = "************* Machine restart *************"; | ||
| 31 | char foot[] = "*******************************************"; | ||
| 32 | |||
| 33 | printk("\n\n"); | ||
| 34 | printk("%s\n", head); | ||
| 35 | if (command != NULL) | ||
| 36 | printk("* %s\n", command); | ||
| 37 | printk("%s\n", foot); | ||
| 38 | |||
| 39 | PNX8550_RST_CTL = PNX8550_RST_DO_SW_RST; | 31 | PNX8550_RST_CTL = PNX8550_RST_DO_SW_RST; |
| 40 | } | 32 | } |
| 41 | 33 | ||
| 42 | void pnx8550_machine_halt(void) | 34 | void pnx8550_machine_halt(void) |
| 43 | { | 35 | { |
| 44 | printk("*** Machine halt. (Not implemented) ***\n"); | 36 | while (1) { |
| 45 | } | 37 | if (cpu_wait) |
| 46 | 38 | cpu_wait(); | |
| 47 | void pnx8550_machine_power_off(void) | 39 | } |
| 48 | { | ||
| 49 | printk("*** Machine power off. (Not implemented) ***\n"); | ||
| 50 | } | 40 | } |
diff --git a/arch/mips/pnx8550/common/setup.c b/arch/mips/pnx8550/common/setup.c index 64246c9c875c..43cb3945fdbf 100644 --- a/arch/mips/pnx8550/common/setup.c +++ b/arch/mips/pnx8550/common/setup.c | |||
| @@ -44,7 +44,6 @@ | |||
| 44 | extern void __init board_setup(void); | 44 | extern void __init board_setup(void); |
| 45 | extern void pnx8550_machine_restart(char *); | 45 | extern void pnx8550_machine_restart(char *); |
| 46 | extern void pnx8550_machine_halt(void); | 46 | extern void pnx8550_machine_halt(void); |
| 47 | extern void pnx8550_machine_power_off(void); | ||
| 48 | extern struct resource ioport_resource; | 47 | extern struct resource ioport_resource; |
| 49 | extern struct resource iomem_resource; | 48 | extern struct resource iomem_resource; |
| 50 | extern char *prom_getcmdline(void); | 49 | extern char *prom_getcmdline(void); |
| @@ -100,7 +99,7 @@ void __init plat_mem_setup(void) | |||
| 100 | 99 | ||
| 101 | _machine_restart = pnx8550_machine_restart; | 100 | _machine_restart = pnx8550_machine_restart; |
| 102 | _machine_halt = pnx8550_machine_halt; | 101 | _machine_halt = pnx8550_machine_halt; |
| 103 | pm_power_off = pnx8550_machine_power_off; | 102 | pm_power_off = pnx8550_machine_halt; |
| 104 | 103 | ||
| 105 | /* Clear the Global 2 Register, PCI Inta Output Enable Registers | 104 | /* Clear the Global 2 Register, PCI Inta Output Enable Registers |
| 106 | Bit 1:Enable DAC Powerdown | 105 | Bit 1:Enable DAC Powerdown |
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index 444b9f918fdf..7c2a2f7f8dc1 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig | |||
| @@ -8,7 +8,6 @@ mainmenu "Linux Kernel Configuration" | |||
| 8 | config MN10300 | 8 | config MN10300 |
| 9 | def_bool y | 9 | def_bool y |
| 10 | select HAVE_OPROFILE | 10 | select HAVE_OPROFILE |
| 11 | select HAVE_ARCH_TRACEHOOK | ||
| 12 | 11 | ||
| 13 | config AM33 | 12 | config AM33 |
| 14 | def_bool y | 13 | def_bool y |
diff --git a/arch/mn10300/Kconfig.debug b/arch/mn10300/Kconfig.debug index ff80e86b9bd2..ce83c74b3fd7 100644 --- a/arch/mn10300/Kconfig.debug +++ b/arch/mn10300/Kconfig.debug | |||
| @@ -101,7 +101,7 @@ config GDBSTUB_DEBUG_BREAKPOINT | |||
| 101 | 101 | ||
| 102 | choice | 102 | choice |
| 103 | prompt "GDB stub port" | 103 | prompt "GDB stub port" |
| 104 | default GDBSTUB_TTYSM0 | 104 | default GDBSTUB_ON_TTYSM0 |
| 105 | depends on GDBSTUB | 105 | depends on GDBSTUB |
| 106 | help | 106 | help |
| 107 | Select the serial port used for GDB-stub. | 107 | Select the serial port used for GDB-stub. |
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h index f49ac49e09ad..3f50e9661076 100644 --- a/arch/mn10300/include/asm/bitops.h +++ b/arch/mn10300/include/asm/bitops.h | |||
| @@ -229,9 +229,9 @@ int ffs(int x) | |||
| 229 | #include <asm-generic/bitops/hweight.h> | 229 | #include <asm-generic/bitops/hweight.h> |
| 230 | 230 | ||
| 231 | #define ext2_set_bit_atomic(lock, nr, addr) \ | 231 | #define ext2_set_bit_atomic(lock, nr, addr) \ |
| 232 | test_and_set_bit((nr) ^ 0x18, (addr)) | 232 | test_and_set_bit((nr), (addr)) |
| 233 | #define ext2_clear_bit_atomic(lock, nr, addr) \ | 233 | #define ext2_clear_bit_atomic(lock, nr, addr) \ |
| 234 | test_and_clear_bit((nr) ^ 0x18, (addr)) | 234 | test_and_clear_bit((nr), (addr)) |
| 235 | 235 | ||
| 236 | #include <asm-generic/bitops/ext2-non-atomic.h> | 236 | #include <asm-generic/bitops/ext2-non-atomic.h> |
| 237 | #include <asm-generic/bitops/minix-le.h> | 237 | #include <asm-generic/bitops/minix-le.h> |
diff --git a/arch/mn10300/include/asm/signal.h b/arch/mn10300/include/asm/signal.h index 7e891fce2370..1865d72a86ff 100644 --- a/arch/mn10300/include/asm/signal.h +++ b/arch/mn10300/include/asm/signal.h | |||
| @@ -78,7 +78,7 @@ typedef unsigned long sigset_t; | |||
| 78 | 78 | ||
| 79 | /* These should not be considered constants from userland. */ | 79 | /* These should not be considered constants from userland. */ |
| 80 | #define SIGRTMIN 32 | 80 | #define SIGRTMIN 32 |
| 81 | #define SIGRTMAX (_NSIG-1) | 81 | #define SIGRTMAX _NSIG |
| 82 | 82 | ||
| 83 | /* | 83 | /* |
| 84 | * SA_FLAGS values: | 84 | * SA_FLAGS values: |
diff --git a/arch/mn10300/kernel/module.c b/arch/mn10300/kernel/module.c index 6aea7fd76993..196a111e2e29 100644 --- a/arch/mn10300/kernel/module.c +++ b/arch/mn10300/kernel/module.c | |||
| @@ -206,7 +206,7 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 206 | const Elf_Shdr *sechdrs, | 206 | const Elf_Shdr *sechdrs, |
| 207 | struct module *me) | 207 | struct module *me) |
| 208 | { | 208 | { |
| 209 | return module_bug_finalize(hdr, sechdrs, me); | 209 | return 0; |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | /* | 212 | /* |
| @@ -214,5 +214,4 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 214 | */ | 214 | */ |
| 215 | void module_arch_cleanup(struct module *mod) | 215 | void module_arch_cleanup(struct module *mod) |
| 216 | { | 216 | { |
| 217 | module_bug_cleanup(mod); | ||
| 218 | } | 217 | } |
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c index 717db14c2cc3..d4de05ab7864 100644 --- a/arch/mn10300/kernel/signal.c +++ b/arch/mn10300/kernel/signal.c | |||
| @@ -65,10 +65,10 @@ asmlinkage long sys_sigaction(int sig, | |||
| 65 | old_sigset_t mask; | 65 | old_sigset_t mask; |
| 66 | if (verify_area(VERIFY_READ, act, sizeof(*act)) || | 66 | if (verify_area(VERIFY_READ, act, sizeof(*act)) || |
| 67 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | 67 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || |
| 68 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) | 68 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || |
| 69 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
| 70 | __get_user(mask, &act->sa_mask)) | ||
| 69 | return -EFAULT; | 71 | return -EFAULT; |
| 70 | __get_user(new_ka.sa.sa_flags, &act->sa_flags); | ||
| 71 | __get_user(mask, &act->sa_mask); | ||
| 72 | siginitset(&new_ka.sa.sa_mask, mask); | 72 | siginitset(&new_ka.sa.sa_mask, mask); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| @@ -77,10 +77,10 @@ asmlinkage long sys_sigaction(int sig, | |||
| 77 | if (!ret && oact) { | 77 | if (!ret && oact) { |
| 78 | if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || | 78 | if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || |
| 79 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | 79 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || |
| 80 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) | 80 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || |
| 81 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
| 82 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
| 81 | return -EFAULT; | 83 | return -EFAULT; |
| 82 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags); | ||
| 83 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); | ||
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | return ret; | 86 | return ret; |
| @@ -102,6 +102,9 @@ static int restore_sigcontext(struct pt_regs *regs, | |||
| 102 | { | 102 | { |
| 103 | unsigned int err = 0; | 103 | unsigned int err = 0; |
| 104 | 104 | ||
| 105 | /* Always make any pending restarted system calls return -EINTR */ | ||
| 106 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | ||
| 107 | |||
| 105 | if (is_using_fpu(current)) | 108 | if (is_using_fpu(current)) |
| 106 | fpu_kill_state(current); | 109 | fpu_kill_state(current); |
| 107 | 110 | ||
| @@ -330,8 +333,6 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, | |||
| 330 | regs->d0 = sig; | 333 | regs->d0 = sig; |
| 331 | regs->d1 = (unsigned long) &frame->sc; | 334 | regs->d1 = (unsigned long) &frame->sc; |
| 332 | 335 | ||
| 333 | set_fs(USER_DS); | ||
| 334 | |||
| 335 | /* the tracer may want to single-step inside the handler */ | 336 | /* the tracer may want to single-step inside the handler */ |
| 336 | if (test_thread_flag(TIF_SINGLESTEP)) | 337 | if (test_thread_flag(TIF_SINGLESTEP)) |
| 337 | ptrace_notify(SIGTRAP); | 338 | ptrace_notify(SIGTRAP); |
| @@ -345,7 +346,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, | |||
| 345 | return 0; | 346 | return 0; |
| 346 | 347 | ||
| 347 | give_sigsegv: | 348 | give_sigsegv: |
| 348 | force_sig(SIGSEGV, current); | 349 | force_sigsegv(sig, current); |
| 349 | return -EFAULT; | 350 | return -EFAULT; |
| 350 | } | 351 | } |
| 351 | 352 | ||
| @@ -413,8 +414,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 413 | regs->d0 = sig; | 414 | regs->d0 = sig; |
| 414 | regs->d1 = (long) &frame->info; | 415 | regs->d1 = (long) &frame->info; |
| 415 | 416 | ||
| 416 | set_fs(USER_DS); | ||
| 417 | |||
| 418 | /* the tracer may want to single-step inside the handler */ | 417 | /* the tracer may want to single-step inside the handler */ |
| 419 | if (test_thread_flag(TIF_SINGLESTEP)) | 418 | if (test_thread_flag(TIF_SINGLESTEP)) |
| 420 | ptrace_notify(SIGTRAP); | 419 | ptrace_notify(SIGTRAP); |
| @@ -428,10 +427,16 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 428 | return 0; | 427 | return 0; |
| 429 | 428 | ||
| 430 | give_sigsegv: | 429 | give_sigsegv: |
| 431 | force_sig(SIGSEGV, current); | 430 | force_sigsegv(sig, current); |
| 432 | return -EFAULT; | 431 | return -EFAULT; |
| 433 | } | 432 | } |
| 434 | 433 | ||
| 434 | static inline void stepback(struct pt_regs *regs) | ||
| 435 | { | ||
| 436 | regs->pc -= 2; | ||
| 437 | regs->orig_d0 = -1; | ||
| 438 | } | ||
| 439 | |||
| 435 | /* | 440 | /* |
| 436 | * handle the actual delivery of a signal to userspace | 441 | * handle the actual delivery of a signal to userspace |
| 437 | */ | 442 | */ |
| @@ -459,7 +464,7 @@ static int handle_signal(int sig, | |||
| 459 | /* fallthrough */ | 464 | /* fallthrough */ |
| 460 | case -ERESTARTNOINTR: | 465 | case -ERESTARTNOINTR: |
| 461 | regs->d0 = regs->orig_d0; | 466 | regs->d0 = regs->orig_d0; |
| 462 | regs->pc -= 2; | 467 | stepback(regs); |
| 463 | } | 468 | } |
| 464 | } | 469 | } |
| 465 | 470 | ||
| @@ -527,12 +532,12 @@ static void do_signal(struct pt_regs *regs) | |||
| 527 | case -ERESTARTSYS: | 532 | case -ERESTARTSYS: |
| 528 | case -ERESTARTNOINTR: | 533 | case -ERESTARTNOINTR: |
| 529 | regs->d0 = regs->orig_d0; | 534 | regs->d0 = regs->orig_d0; |
| 530 | regs->pc -= 2; | 535 | stepback(regs); |
| 531 | break; | 536 | break; |
| 532 | 537 | ||
| 533 | case -ERESTART_RESTARTBLOCK: | 538 | case -ERESTART_RESTARTBLOCK: |
| 534 | regs->d0 = __NR_restart_syscall; | 539 | regs->d0 = __NR_restart_syscall; |
| 535 | regs->pc -= 2; | 540 | stepback(regs); |
| 536 | break; | 541 | break; |
| 537 | } | 542 | } |
| 538 | } | 543 | } |
diff --git a/arch/mn10300/mm/Makefile b/arch/mn10300/mm/Makefile index 28b9d983db0c..1557277fbc5c 100644 --- a/arch/mn10300/mm/Makefile +++ b/arch/mn10300/mm/Makefile | |||
| @@ -2,13 +2,11 @@ | |||
| 2 | # Makefile for the MN10300-specific memory management code | 2 | # Makefile for the MN10300-specific memory management code |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | cacheflush-y := cache.o cache-mn10300.o | ||
| 6 | cacheflush-$(CONFIG_MN10300_CACHE_WBACK) += cache-flush-mn10300.o | ||
| 7 | |||
| 8 | cacheflush-$(CONFIG_MN10300_CACHE_DISABLED) := cache-disabled.o | ||
| 9 | |||
| 5 | obj-y := \ | 10 | obj-y := \ |
| 6 | init.o fault.o pgtable.o extable.o tlb-mn10300.o mmu-context.o \ | 11 | init.o fault.o pgtable.o extable.o tlb-mn10300.o mmu-context.o \ |
| 7 | misalignment.o dma-alloc.o | 12 | misalignment.o dma-alloc.o $(cacheflush-y) |
| 8 | |||
| 9 | ifneq ($(CONFIG_MN10300_CACHE_DISABLED),y) | ||
| 10 | obj-y += cache.o cache-mn10300.o | ||
| 11 | ifeq ($(CONFIG_MN10300_CACHE_WBACK),y) | ||
| 12 | obj-y += cache-flush-mn10300.o | ||
| 13 | endif | ||
| 14 | endif | ||
diff --git a/arch/mn10300/mm/cache-disabled.c b/arch/mn10300/mm/cache-disabled.c new file mode 100644 index 000000000000..f669ea42aba6 --- /dev/null +++ b/arch/mn10300/mm/cache-disabled.c | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* Handle the cache being disabled | ||
| 2 | * | ||
| 3 | * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public Licence | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the Licence, or (at your option) any later version. | ||
| 10 | */ | ||
| 11 | #include <linux/mm.h> | ||
| 12 | |||
| 13 | /* | ||
| 14 | * allow userspace to flush the instruction cache | ||
| 15 | */ | ||
| 16 | asmlinkage long sys_cacheflush(unsigned long start, unsigned long end) | ||
| 17 | { | ||
| 18 | if (end < start) | ||
| 19 | return -EINVAL; | ||
| 20 | return 0; | ||
| 21 | } | ||
diff --git a/arch/mn10300/mm/cache.c b/arch/mn10300/mm/cache.c index 1b76719ec1c3..9261217e8d2c 100644 --- a/arch/mn10300/mm/cache.c +++ b/arch/mn10300/mm/cache.c | |||
| @@ -54,13 +54,30 @@ EXPORT_SYMBOL(flush_icache_page); | |||
| 54 | void flush_icache_range(unsigned long start, unsigned long end) | 54 | void flush_icache_range(unsigned long start, unsigned long end) |
| 55 | { | 55 | { |
| 56 | #ifdef CONFIG_MN10300_CACHE_WBACK | 56 | #ifdef CONFIG_MN10300_CACHE_WBACK |
| 57 | unsigned long addr, size, off; | 57 | unsigned long addr, size, base, off; |
| 58 | struct page *page; | 58 | struct page *page; |
| 59 | pgd_t *pgd; | 59 | pgd_t *pgd; |
| 60 | pud_t *pud; | 60 | pud_t *pud; |
| 61 | pmd_t *pmd; | 61 | pmd_t *pmd; |
| 62 | pte_t *ppte, pte; | 62 | pte_t *ppte, pte; |
| 63 | 63 | ||
| 64 | if (end > 0x80000000UL) { | ||
| 65 | /* addresses above 0xa0000000 do not go through the cache */ | ||
| 66 | if (end > 0xa0000000UL) { | ||
| 67 | end = 0xa0000000UL; | ||
| 68 | if (start >= end) | ||
| 69 | return; | ||
| 70 | } | ||
| 71 | |||
| 72 | /* kernel addresses between 0x80000000 and 0x9fffffff do not | ||
| 73 | * require page tables, so we just map such addresses directly */ | ||
| 74 | base = (start >= 0x80000000UL) ? start : 0x80000000UL; | ||
| 75 | mn10300_dcache_flush_range(base, end); | ||
| 76 | if (base == start) | ||
| 77 | goto invalidate; | ||
| 78 | end = base; | ||
| 79 | } | ||
| 80 | |||
| 64 | for (; start < end; start += size) { | 81 | for (; start < end; start += size) { |
| 65 | /* work out how much of the page to flush */ | 82 | /* work out how much of the page to flush */ |
| 66 | off = start & (PAGE_SIZE - 1); | 83 | off = start & (PAGE_SIZE - 1); |
| @@ -104,6 +121,7 @@ void flush_icache_range(unsigned long start, unsigned long end) | |||
| 104 | } | 121 | } |
| 105 | #endif | 122 | #endif |
| 106 | 123 | ||
| 124 | invalidate: | ||
| 107 | mn10300_icache_inv(); | 125 | mn10300_icache_inv(); |
| 108 | } | 126 | } |
| 109 | EXPORT_SYMBOL(flush_icache_range); | 127 | EXPORT_SYMBOL(flush_icache_range); |
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index 159a2b81e90c..6e81bb596e5b 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c | |||
| @@ -941,11 +941,10 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 941 | nsyms = newptr - (Elf_Sym *)symhdr->sh_addr; | 941 | nsyms = newptr - (Elf_Sym *)symhdr->sh_addr; |
| 942 | DEBUGP("NEW num_symtab %lu\n", nsyms); | 942 | DEBUGP("NEW num_symtab %lu\n", nsyms); |
| 943 | symhdr->sh_size = nsyms * sizeof(Elf_Sym); | 943 | symhdr->sh_size = nsyms * sizeof(Elf_Sym); |
| 944 | return module_bug_finalize(hdr, sechdrs, me); | 944 | return 0; |
| 945 | } | 945 | } |
| 946 | 946 | ||
| 947 | void module_arch_cleanup(struct module *mod) | 947 | void module_arch_cleanup(struct module *mod) |
| 948 | { | 948 | { |
| 949 | deregister_unwind_table(mod); | 949 | deregister_unwind_table(mod); |
| 950 | module_bug_cleanup(mod); | ||
| 951 | } | 950 | } |
diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c index 477c663e0140..49cee9df225b 100644 --- a/arch/powerpc/kernel/module.c +++ b/arch/powerpc/kernel/module.c | |||
| @@ -63,11 +63,6 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 63 | const Elf_Shdr *sechdrs, struct module *me) | 63 | const Elf_Shdr *sechdrs, struct module *me) |
| 64 | { | 64 | { |
| 65 | const Elf_Shdr *sect; | 65 | const Elf_Shdr *sect; |
| 66 | int err; | ||
| 67 | |||
| 68 | err = module_bug_finalize(hdr, sechdrs, me); | ||
| 69 | if (err) | ||
| 70 | return err; | ||
| 71 | 66 | ||
| 72 | /* Apply feature fixups */ | 67 | /* Apply feature fixups */ |
| 73 | sect = find_section(hdr, sechdrs, "__ftr_fixup"); | 68 | sect = find_section(hdr, sechdrs, "__ftr_fixup"); |
| @@ -101,5 +96,4 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 101 | 96 | ||
| 102 | void module_arch_cleanup(struct module *mod) | 97 | void module_arch_cleanup(struct module *mod) |
| 103 | { | 98 | { |
| 104 | module_bug_cleanup(mod); | ||
| 105 | } | 99 | } |
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c index 7109f5b1baa8..2300426e531a 100644 --- a/arch/powerpc/kernel/signal.c +++ b/arch/powerpc/kernel/signal.c | |||
| @@ -138,6 +138,7 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs) | |||
| 138 | ti->local_flags &= ~_TLF_RESTORE_SIGMASK; | 138 | ti->local_flags &= ~_TLF_RESTORE_SIGMASK; |
| 139 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | 139 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); |
| 140 | } | 140 | } |
| 141 | regs->trap = 0; | ||
| 141 | return 0; /* no signals delivered */ | 142 | return 0; /* no signals delivered */ |
| 142 | } | 143 | } |
| 143 | 144 | ||
| @@ -164,6 +165,7 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs) | |||
| 164 | ret = handle_rt_signal64(signr, &ka, &info, oldset, regs); | 165 | ret = handle_rt_signal64(signr, &ka, &info, oldset, regs); |
| 165 | } | 166 | } |
| 166 | 167 | ||
| 168 | regs->trap = 0; | ||
| 167 | if (ret) { | 169 | if (ret) { |
| 168 | spin_lock_irq(¤t->sighand->siglock); | 170 | spin_lock_irq(¤t->sighand->siglock); |
| 169 | sigorsets(¤t->blocked, ¤t->blocked, | 171 | sigorsets(¤t->blocked, ¤t->blocked, |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 266610119f66..b96a3a010c26 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
| @@ -511,6 +511,7 @@ static long restore_user_regs(struct pt_regs *regs, | |||
| 511 | if (!sig) | 511 | if (!sig) |
| 512 | save_r2 = (unsigned int)regs->gpr[2]; | 512 | save_r2 = (unsigned int)regs->gpr[2]; |
| 513 | err = restore_general_regs(regs, sr); | 513 | err = restore_general_regs(regs, sr); |
| 514 | regs->trap = 0; | ||
| 514 | err |= __get_user(msr, &sr->mc_gregs[PT_MSR]); | 515 | err |= __get_user(msr, &sr->mc_gregs[PT_MSR]); |
| 515 | if (!sig) | 516 | if (!sig) |
| 516 | regs->gpr[2] = (unsigned long) save_r2; | 517 | regs->gpr[2] = (unsigned long) save_r2; |
| @@ -884,7 +885,6 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, | |||
| 884 | regs->nip = (unsigned long) ka->sa.sa_handler; | 885 | regs->nip = (unsigned long) ka->sa.sa_handler; |
| 885 | /* enter the signal handler in big-endian mode */ | 886 | /* enter the signal handler in big-endian mode */ |
| 886 | regs->msr &= ~MSR_LE; | 887 | regs->msr &= ~MSR_LE; |
| 887 | regs->trap = 0; | ||
| 888 | return 1; | 888 | return 1; |
| 889 | 889 | ||
| 890 | badframe: | 890 | badframe: |
| @@ -1228,7 +1228,6 @@ int handle_signal32(unsigned long sig, struct k_sigaction *ka, | |||
| 1228 | regs->nip = (unsigned long) ka->sa.sa_handler; | 1228 | regs->nip = (unsigned long) ka->sa.sa_handler; |
| 1229 | /* enter the signal handler in big-endian mode */ | 1229 | /* enter the signal handler in big-endian mode */ |
| 1230 | regs->msr &= ~MSR_LE; | 1230 | regs->msr &= ~MSR_LE; |
| 1231 | regs->trap = 0; | ||
| 1232 | 1231 | ||
| 1233 | return 1; | 1232 | return 1; |
| 1234 | 1233 | ||
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 2fe6fc64b614..27c4a4584f80 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
| @@ -178,7 +178,7 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, | |||
| 178 | err |= __get_user(regs->xer, &sc->gp_regs[PT_XER]); | 178 | err |= __get_user(regs->xer, &sc->gp_regs[PT_XER]); |
| 179 | err |= __get_user(regs->ccr, &sc->gp_regs[PT_CCR]); | 179 | err |= __get_user(regs->ccr, &sc->gp_regs[PT_CCR]); |
| 180 | /* skip SOFTE */ | 180 | /* skip SOFTE */ |
| 181 | err |= __get_user(regs->trap, &sc->gp_regs[PT_TRAP]); | 181 | regs->trap = 0; |
| 182 | err |= __get_user(regs->dar, &sc->gp_regs[PT_DAR]); | 182 | err |= __get_user(regs->dar, &sc->gp_regs[PT_DAR]); |
| 183 | err |= __get_user(regs->dsisr, &sc->gp_regs[PT_DSISR]); | 183 | err |= __get_user(regs->dsisr, &sc->gp_regs[PT_DSISR]); |
| 184 | err |= __get_user(regs->result, &sc->gp_regs[PT_RESULT]); | 184 | err |= __get_user(regs->result, &sc->gp_regs[PT_RESULT]); |
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c index 5b243bd3eb3b..3dc2a8d262b8 100644 --- a/arch/powerpc/platforms/512x/clock.c +++ b/arch/powerpc/platforms/512x/clock.c | |||
| @@ -57,7 +57,7 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id) | |||
| 57 | int id_match = 0; | 57 | int id_match = 0; |
| 58 | 58 | ||
| 59 | if (dev == NULL || id == NULL) | 59 | if (dev == NULL || id == NULL) |
| 60 | return NULL; | 60 | return clk; |
| 61 | 61 | ||
| 62 | mutex_lock(&clocks_mutex); | 62 | mutex_lock(&clocks_mutex); |
| 63 | list_for_each_entry(p, &clocks, node) { | 63 | list_for_each_entry(p, &clocks, node) { |
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c index 45c0cb9b67e6..18c104820198 100644 --- a/arch/powerpc/platforms/52xx/efika.c +++ b/arch/powerpc/platforms/52xx/efika.c | |||
| @@ -99,7 +99,7 @@ static void __init efika_pcisetup(void) | |||
| 99 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 99 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
| 100 | printk(KERN_WARNING EFIKA_PLATFORM_NAME | 100 | printk(KERN_WARNING EFIKA_PLATFORM_NAME |
| 101 | ": Can't get bus-range for %s\n", pcictrl->full_name); | 101 | ": Can't get bus-range for %s\n", pcictrl->full_name); |
| 102 | return; | 102 | goto out_put; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | if (bus_range[1] == bus_range[0]) | 105 | if (bus_range[1] == bus_range[0]) |
| @@ -111,12 +111,12 @@ static void __init efika_pcisetup(void) | |||
| 111 | printk(" controlled by %s\n", pcictrl->full_name); | 111 | printk(" controlled by %s\n", pcictrl->full_name); |
| 112 | printk("\n"); | 112 | printk("\n"); |
| 113 | 113 | ||
| 114 | hose = pcibios_alloc_controller(of_node_get(pcictrl)); | 114 | hose = pcibios_alloc_controller(pcictrl); |
| 115 | if (!hose) { | 115 | if (!hose) { |
| 116 | printk(KERN_WARNING EFIKA_PLATFORM_NAME | 116 | printk(KERN_WARNING EFIKA_PLATFORM_NAME |
| 117 | ": Can't allocate PCI controller structure for %s\n", | 117 | ": Can't allocate PCI controller structure for %s\n", |
| 118 | pcictrl->full_name); | 118 | pcictrl->full_name); |
| 119 | return; | 119 | goto out_put; |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | hose->first_busno = bus_range[0]; | 122 | hose->first_busno = bus_range[0]; |
| @@ -124,6 +124,9 @@ static void __init efika_pcisetup(void) | |||
| 124 | hose->ops = &rtas_pci_ops; | 124 | hose->ops = &rtas_pci_ops; |
| 125 | 125 | ||
| 126 | pci_process_bridge_OF_ranges(hose, pcictrl, 0); | 126 | pci_process_bridge_OF_ranges(hose, pcictrl, 0); |
| 127 | return; | ||
| 128 | out_put: | ||
| 129 | of_node_put(pcictrl); | ||
| 127 | } | 130 | } |
| 128 | 131 | ||
| 129 | #else | 132 | #else |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c index 6e905314ad5d..41f3a7eda1de 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_common.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c | |||
| @@ -325,12 +325,16 @@ int mpc5200_psc_ac97_gpio_reset(int psc_number) | |||
| 325 | clrbits32(&simple_gpio->simple_dvo, sync | out); | 325 | clrbits32(&simple_gpio->simple_dvo, sync | out); |
| 326 | clrbits8(&wkup_gpio->wkup_dvo, reset); | 326 | clrbits8(&wkup_gpio->wkup_dvo, reset); |
| 327 | 327 | ||
| 328 | /* wait at lease 1 us */ | 328 | /* wait for 1 us */ |
| 329 | udelay(2); | 329 | udelay(1); |
| 330 | 330 | ||
| 331 | /* Deassert reset */ | 331 | /* Deassert reset */ |
| 332 | setbits8(&wkup_gpio->wkup_dvo, reset); | 332 | setbits8(&wkup_gpio->wkup_dvo, reset); |
| 333 | 333 | ||
| 334 | /* wait at least 200ns */ | ||
| 335 | /* 7 ~= (200ns * timebase) / ns2sec */ | ||
| 336 | __delay(7); | ||
| 337 | |||
| 334 | /* Restore pin-muxing */ | 338 | /* Restore pin-muxing */ |
| 335 | out_be32(&simple_gpio->port_config, mux); | 339 | out_be32(&simple_gpio->port_config, mux); |
| 336 | 340 | ||
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c index 22cfd634c355..f7167ee4604c 100644 --- a/arch/s390/kernel/module.c +++ b/arch/s390/kernel/module.c | |||
| @@ -407,10 +407,9 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 407 | { | 407 | { |
| 408 | vfree(me->arch.syminfo); | 408 | vfree(me->arch.syminfo); |
| 409 | me->arch.syminfo = NULL; | 409 | me->arch.syminfo = NULL; |
| 410 | return module_bug_finalize(hdr, sechdrs, me); | 410 | return 0; |
| 411 | } | 411 | } |
| 412 | 412 | ||
| 413 | void module_arch_cleanup(struct module *mod) | 413 | void module_arch_cleanup(struct module *mod) |
| 414 | { | 414 | { |
| 415 | module_bug_cleanup(mod); | ||
| 416 | } | 415 | } |
diff --git a/arch/sh/kernel/module.c b/arch/sh/kernel/module.c index 43adddfe4c04..ae0be697a89e 100644 --- a/arch/sh/kernel/module.c +++ b/arch/sh/kernel/module.c | |||
| @@ -149,13 +149,11 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 149 | int ret = 0; | 149 | int ret = 0; |
| 150 | 150 | ||
| 151 | ret |= module_dwarf_finalize(hdr, sechdrs, me); | 151 | ret |= module_dwarf_finalize(hdr, sechdrs, me); |
| 152 | ret |= module_bug_finalize(hdr, sechdrs, me); | ||
| 153 | 152 | ||
| 154 | return ret; | 153 | return ret; |
| 155 | } | 154 | } |
| 156 | 155 | ||
| 157 | void module_arch_cleanup(struct module *mod) | 156 | void module_arch_cleanup(struct module *mod) |
| 158 | { | 157 | { |
| 159 | module_bug_cleanup(mod); | ||
| 160 | module_dwarf_cleanup(mod); | 158 | module_dwarf_cleanup(mod); |
| 161 | } | 159 | } |
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 357ced3c33ff..6318e622cfb0 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
| @@ -1038,6 +1038,7 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
| 1038 | if (atomic_read(&nmi_active) < 0) | 1038 | if (atomic_read(&nmi_active) < 0) |
| 1039 | return -ENODEV; | 1039 | return -ENODEV; |
| 1040 | 1040 | ||
| 1041 | pmap = NULL; | ||
| 1041 | if (attr->type == PERF_TYPE_HARDWARE) { | 1042 | if (attr->type == PERF_TYPE_HARDWARE) { |
| 1042 | if (attr->config >= sparc_pmu->max_events) | 1043 | if (attr->config >= sparc_pmu->max_events) |
| 1043 | return -EINVAL; | 1044 | return -EINVAL; |
| @@ -1046,9 +1047,18 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
| 1046 | pmap = sparc_map_cache_event(attr->config); | 1047 | pmap = sparc_map_cache_event(attr->config); |
| 1047 | if (IS_ERR(pmap)) | 1048 | if (IS_ERR(pmap)) |
| 1048 | return PTR_ERR(pmap); | 1049 | return PTR_ERR(pmap); |
| 1049 | } else | 1050 | } else if (attr->type != PERF_TYPE_RAW) |
| 1050 | return -EOPNOTSUPP; | 1051 | return -EOPNOTSUPP; |
| 1051 | 1052 | ||
| 1053 | if (pmap) { | ||
| 1054 | hwc->event_base = perf_event_encode(pmap); | ||
| 1055 | } else { | ||
| 1056 | /* User gives us "(encoding << 16) | pic_mask" for | ||
| 1057 | * PERF_TYPE_RAW events. | ||
| 1058 | */ | ||
| 1059 | hwc->event_base = attr->config; | ||
| 1060 | } | ||
| 1061 | |||
| 1052 | /* We save the enable bits in the config_base. */ | 1062 | /* We save the enable bits in the config_base. */ |
| 1053 | hwc->config_base = sparc_pmu->irq_bit; | 1063 | hwc->config_base = sparc_pmu->irq_bit; |
| 1054 | if (!attr->exclude_user) | 1064 | if (!attr->exclude_user) |
| @@ -1058,8 +1068,6 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
| 1058 | if (!attr->exclude_hv) | 1068 | if (!attr->exclude_hv) |
| 1059 | hwc->config_base |= sparc_pmu->hv_bit; | 1069 | hwc->config_base |= sparc_pmu->hv_bit; |
| 1060 | 1070 | ||
| 1061 | hwc->event_base = perf_event_encode(pmap); | ||
| 1062 | |||
| 1063 | n = 0; | 1071 | n = 0; |
| 1064 | if (event->group_leader != event) { | 1072 | if (event->group_leader != event) { |
| 1065 | n = collect_events(event->group_leader, | 1073 | n = collect_events(event->group_leader, |
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index ea22cd373c64..75fad425e249 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c | |||
| @@ -453,8 +453,66 @@ static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | |||
| 453 | return err; | 453 | return err; |
| 454 | } | 454 | } |
| 455 | 455 | ||
| 456 | static void setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | 456 | /* The I-cache flush instruction only works in the primary ASI, which |
| 457 | int signo, sigset_t *oldset) | 457 | * right now is the nucleus, aka. kernel space. |
| 458 | * | ||
| 459 | * Therefore we have to kick the instructions out using the kernel | ||
| 460 | * side linear mapping of the physical address backing the user | ||
| 461 | * instructions. | ||
| 462 | */ | ||
| 463 | static void flush_signal_insns(unsigned long address) | ||
| 464 | { | ||
| 465 | unsigned long pstate, paddr; | ||
| 466 | pte_t *ptep, pte; | ||
| 467 | pgd_t *pgdp; | ||
| 468 | pud_t *pudp; | ||
| 469 | pmd_t *pmdp; | ||
| 470 | |||
| 471 | /* Commit all stores of the instructions we are about to flush. */ | ||
| 472 | wmb(); | ||
| 473 | |||
| 474 | /* Disable cross-call reception. In this way even a very wide | ||
| 475 | * munmap() on another cpu can't tear down the page table | ||
| 476 | * hierarchy from underneath us, since that can't complete | ||
| 477 | * until the IPI tlb flush returns. | ||
| 478 | */ | ||
| 479 | |||
| 480 | __asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate)); | ||
| 481 | __asm__ __volatile__("wrpr %0, %1, %%pstate" | ||
| 482 | : : "r" (pstate), "i" (PSTATE_IE)); | ||
| 483 | |||
| 484 | pgdp = pgd_offset(current->mm, address); | ||
| 485 | if (pgd_none(*pgdp)) | ||
| 486 | goto out_irqs_on; | ||
| 487 | pudp = pud_offset(pgdp, address); | ||
| 488 | if (pud_none(*pudp)) | ||
| 489 | goto out_irqs_on; | ||
| 490 | pmdp = pmd_offset(pudp, address); | ||
| 491 | if (pmd_none(*pmdp)) | ||
| 492 | goto out_irqs_on; | ||
| 493 | |||
| 494 | ptep = pte_offset_map(pmdp, address); | ||
| 495 | pte = *ptep; | ||
| 496 | if (!pte_present(pte)) | ||
| 497 | goto out_unmap; | ||
| 498 | |||
| 499 | paddr = (unsigned long) page_address(pte_page(pte)); | ||
| 500 | |||
| 501 | __asm__ __volatile__("flush %0 + %1" | ||
| 502 | : /* no outputs */ | ||
| 503 | : "r" (paddr), | ||
| 504 | "r" (address & (PAGE_SIZE - 1)) | ||
| 505 | : "memory"); | ||
| 506 | |||
| 507 | out_unmap: | ||
| 508 | pte_unmap(ptep); | ||
| 509 | out_irqs_on: | ||
| 510 | __asm__ __volatile__("wrpr %0, 0x0, %%pstate" : : "r" (pstate)); | ||
| 511 | |||
| 512 | } | ||
| 513 | |||
| 514 | static int setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | ||
| 515 | int signo, sigset_t *oldset) | ||
| 458 | { | 516 | { |
| 459 | struct signal_frame32 __user *sf; | 517 | struct signal_frame32 __user *sf; |
| 460 | int sigframe_size; | 518 | int sigframe_size; |
| @@ -547,13 +605,7 @@ static void setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
| 547 | if (ka->ka_restorer) { | 605 | if (ka->ka_restorer) { |
| 548 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; | 606 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; |
| 549 | } else { | 607 | } else { |
| 550 | /* Flush instruction space. */ | ||
| 551 | unsigned long address = ((unsigned long)&(sf->insns[0])); | 608 | unsigned long address = ((unsigned long)&(sf->insns[0])); |
| 552 | pgd_t *pgdp = pgd_offset(current->mm, address); | ||
| 553 | pud_t *pudp = pud_offset(pgdp, address); | ||
| 554 | pmd_t *pmdp = pmd_offset(pudp, address); | ||
| 555 | pte_t *ptep; | ||
| 556 | pte_t pte; | ||
| 557 | 609 | ||
| 558 | regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); | 610 | regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); |
| 559 | 611 | ||
| @@ -562,34 +614,22 @@ static void setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
| 562 | if (err) | 614 | if (err) |
| 563 | goto sigsegv; | 615 | goto sigsegv; |
| 564 | 616 | ||
| 565 | preempt_disable(); | 617 | flush_signal_insns(address); |
| 566 | ptep = pte_offset_map(pmdp, address); | ||
| 567 | pte = *ptep; | ||
| 568 | if (pte_present(pte)) { | ||
| 569 | unsigned long page = (unsigned long) | ||
| 570 | page_address(pte_page(pte)); | ||
| 571 | |||
| 572 | wmb(); | ||
| 573 | __asm__ __volatile__("flush %0 + %1" | ||
| 574 | : /* no outputs */ | ||
| 575 | : "r" (page), | ||
| 576 | "r" (address & (PAGE_SIZE - 1)) | ||
| 577 | : "memory"); | ||
| 578 | } | ||
| 579 | pte_unmap(ptep); | ||
| 580 | preempt_enable(); | ||
| 581 | } | 618 | } |
| 582 | return; | 619 | return 0; |
| 583 | 620 | ||
| 584 | sigill: | 621 | sigill: |
| 585 | do_exit(SIGILL); | 622 | do_exit(SIGILL); |
| 623 | return -EINVAL; | ||
| 624 | |||
| 586 | sigsegv: | 625 | sigsegv: |
| 587 | force_sigsegv(signo, current); | 626 | force_sigsegv(signo, current); |
| 627 | return -EFAULT; | ||
| 588 | } | 628 | } |
| 589 | 629 | ||
| 590 | static void setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, | 630 | static int setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, |
| 591 | unsigned long signr, sigset_t *oldset, | 631 | unsigned long signr, sigset_t *oldset, |
| 592 | siginfo_t *info) | 632 | siginfo_t *info) |
| 593 | { | 633 | { |
| 594 | struct rt_signal_frame32 __user *sf; | 634 | struct rt_signal_frame32 __user *sf; |
| 595 | int sigframe_size; | 635 | int sigframe_size; |
| @@ -687,12 +727,7 @@ static void setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
| 687 | if (ka->ka_restorer) | 727 | if (ka->ka_restorer) |
| 688 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; | 728 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; |
| 689 | else { | 729 | else { |
| 690 | /* Flush instruction space. */ | ||
| 691 | unsigned long address = ((unsigned long)&(sf->insns[0])); | 730 | unsigned long address = ((unsigned long)&(sf->insns[0])); |
| 692 | pgd_t *pgdp = pgd_offset(current->mm, address); | ||
| 693 | pud_t *pudp = pud_offset(pgdp, address); | ||
| 694 | pmd_t *pmdp = pmd_offset(pudp, address); | ||
| 695 | pte_t *ptep; | ||
| 696 | 731 | ||
| 697 | regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); | 732 | regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); |
| 698 | 733 | ||
| @@ -704,38 +739,32 @@ static void setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
| 704 | if (err) | 739 | if (err) |
| 705 | goto sigsegv; | 740 | goto sigsegv; |
| 706 | 741 | ||
| 707 | preempt_disable(); | 742 | flush_signal_insns(address); |
| 708 | ptep = pte_offset_map(pmdp, address); | ||
| 709 | if (pte_present(*ptep)) { | ||
| 710 | unsigned long page = (unsigned long) | ||
| 711 | page_address(pte_page(*ptep)); | ||
| 712 | |||
| 713 | wmb(); | ||
| 714 | __asm__ __volatile__("flush %0 + %1" | ||
| 715 | : /* no outputs */ | ||
| 716 | : "r" (page), | ||
| 717 | "r" (address & (PAGE_SIZE - 1)) | ||
| 718 | : "memory"); | ||
| 719 | } | ||
| 720 | pte_unmap(ptep); | ||
| 721 | preempt_enable(); | ||
| 722 | } | 743 | } |
| 723 | return; | 744 | return 0; |
| 724 | 745 | ||
| 725 | sigill: | 746 | sigill: |
| 726 | do_exit(SIGILL); | 747 | do_exit(SIGILL); |
| 748 | return -EINVAL; | ||
| 749 | |||
| 727 | sigsegv: | 750 | sigsegv: |
| 728 | force_sigsegv(signr, current); | 751 | force_sigsegv(signr, current); |
| 752 | return -EFAULT; | ||
| 729 | } | 753 | } |
| 730 | 754 | ||
| 731 | static inline void handle_signal32(unsigned long signr, struct k_sigaction *ka, | 755 | static inline int handle_signal32(unsigned long signr, struct k_sigaction *ka, |
| 732 | siginfo_t *info, | 756 | siginfo_t *info, |
| 733 | sigset_t *oldset, struct pt_regs *regs) | 757 | sigset_t *oldset, struct pt_regs *regs) |
| 734 | { | 758 | { |
| 759 | int err; | ||
| 760 | |||
| 735 | if (ka->sa.sa_flags & SA_SIGINFO) | 761 | if (ka->sa.sa_flags & SA_SIGINFO) |
| 736 | setup_rt_frame32(ka, regs, signr, oldset, info); | 762 | err = setup_rt_frame32(ka, regs, signr, oldset, info); |
| 737 | else | 763 | else |
| 738 | setup_frame32(ka, regs, signr, oldset); | 764 | err = setup_frame32(ka, regs, signr, oldset); |
| 765 | |||
| 766 | if (err) | ||
| 767 | return err; | ||
| 739 | 768 | ||
| 740 | spin_lock_irq(¤t->sighand->siglock); | 769 | spin_lock_irq(¤t->sighand->siglock); |
| 741 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); | 770 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); |
| @@ -743,6 +772,10 @@ static inline void handle_signal32(unsigned long signr, struct k_sigaction *ka, | |||
| 743 | sigaddset(¤t->blocked,signr); | 772 | sigaddset(¤t->blocked,signr); |
| 744 | recalc_sigpending(); | 773 | recalc_sigpending(); |
| 745 | spin_unlock_irq(¤t->sighand->siglock); | 774 | spin_unlock_irq(¤t->sighand->siglock); |
| 775 | |||
| 776 | tracehook_signal_handler(signr, info, ka, regs, 0); | ||
| 777 | |||
| 778 | return 0; | ||
| 746 | } | 779 | } |
| 747 | 780 | ||
| 748 | static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs, | 781 | static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs, |
| @@ -789,16 +822,14 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, | |||
| 789 | if (signr > 0) { | 822 | if (signr > 0) { |
| 790 | if (restart_syscall) | 823 | if (restart_syscall) |
| 791 | syscall_restart32(orig_i0, regs, &ka.sa); | 824 | syscall_restart32(orig_i0, regs, &ka.sa); |
| 792 | handle_signal32(signr, &ka, &info, oldset, regs); | 825 | if (handle_signal32(signr, &ka, &info, oldset, regs) == 0) { |
| 793 | 826 | /* A signal was successfully delivered; the saved | |
| 794 | /* A signal was successfully delivered; the saved | 827 | * sigmask will have been stored in the signal frame, |
| 795 | * sigmask will have been stored in the signal frame, | 828 | * and will be restored by sigreturn, so we can simply |
| 796 | * and will be restored by sigreturn, so we can simply | 829 | * clear the TS_RESTORE_SIGMASK flag. |
| 797 | * clear the TS_RESTORE_SIGMASK flag. | 830 | */ |
| 798 | */ | 831 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
| 799 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | 832 | } |
| 800 | |||
| 801 | tracehook_signal_handler(signr, &info, &ka, regs, 0); | ||
| 802 | return; | 833 | return; |
| 803 | } | 834 | } |
| 804 | if (restart_syscall && | 835 | if (restart_syscall && |
| @@ -809,12 +840,14 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, | |||
| 809 | regs->u_regs[UREG_I0] = orig_i0; | 840 | regs->u_regs[UREG_I0] = orig_i0; |
| 810 | regs->tpc -= 4; | 841 | regs->tpc -= 4; |
| 811 | regs->tnpc -= 4; | 842 | regs->tnpc -= 4; |
| 843 | pt_regs_clear_syscall(regs); | ||
| 812 | } | 844 | } |
| 813 | if (restart_syscall && | 845 | if (restart_syscall && |
| 814 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { | 846 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { |
| 815 | regs->u_regs[UREG_G1] = __NR_restart_syscall; | 847 | regs->u_regs[UREG_G1] = __NR_restart_syscall; |
| 816 | regs->tpc -= 4; | 848 | regs->tpc -= 4; |
| 817 | regs->tnpc -= 4; | 849 | regs->tnpc -= 4; |
| 850 | pt_regs_clear_syscall(regs); | ||
| 818 | } | 851 | } |
| 819 | 852 | ||
| 820 | /* If there's no signal to deliver, we just put the saved sigmask | 853 | /* If there's no signal to deliver, we just put the saved sigmask |
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index 9882df92ba0a..5e5c5fd03783 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
| @@ -315,8 +315,8 @@ save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | |||
| 315 | return err; | 315 | return err; |
| 316 | } | 316 | } |
| 317 | 317 | ||
| 318 | static void setup_frame(struct k_sigaction *ka, struct pt_regs *regs, | 318 | static int setup_frame(struct k_sigaction *ka, struct pt_regs *regs, |
| 319 | int signo, sigset_t *oldset) | 319 | int signo, sigset_t *oldset) |
| 320 | { | 320 | { |
| 321 | struct signal_frame __user *sf; | 321 | struct signal_frame __user *sf; |
| 322 | int sigframe_size, err; | 322 | int sigframe_size, err; |
| @@ -384,16 +384,19 @@ static void setup_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
| 384 | /* Flush instruction space. */ | 384 | /* Flush instruction space. */ |
| 385 | flush_sig_insns(current->mm, (unsigned long) &(sf->insns[0])); | 385 | flush_sig_insns(current->mm, (unsigned long) &(sf->insns[0])); |
| 386 | } | 386 | } |
| 387 | return; | 387 | return 0; |
| 388 | 388 | ||
| 389 | sigill_and_return: | 389 | sigill_and_return: |
| 390 | do_exit(SIGILL); | 390 | do_exit(SIGILL); |
| 391 | return -EINVAL; | ||
| 392 | |||
| 391 | sigsegv: | 393 | sigsegv: |
| 392 | force_sigsegv(signo, current); | 394 | force_sigsegv(signo, current); |
| 395 | return -EFAULT; | ||
| 393 | } | 396 | } |
| 394 | 397 | ||
| 395 | static void setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | 398 | static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, |
| 396 | int signo, sigset_t *oldset, siginfo_t *info) | 399 | int signo, sigset_t *oldset, siginfo_t *info) |
| 397 | { | 400 | { |
| 398 | struct rt_signal_frame __user *sf; | 401 | struct rt_signal_frame __user *sf; |
| 399 | int sigframe_size; | 402 | int sigframe_size; |
| @@ -466,22 +469,30 @@ static void setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
| 466 | /* Flush instruction space. */ | 469 | /* Flush instruction space. */ |
| 467 | flush_sig_insns(current->mm, (unsigned long) &(sf->insns[0])); | 470 | flush_sig_insns(current->mm, (unsigned long) &(sf->insns[0])); |
| 468 | } | 471 | } |
| 469 | return; | 472 | return 0; |
| 470 | 473 | ||
| 471 | sigill: | 474 | sigill: |
| 472 | do_exit(SIGILL); | 475 | do_exit(SIGILL); |
| 476 | return -EINVAL; | ||
| 477 | |||
| 473 | sigsegv: | 478 | sigsegv: |
| 474 | force_sigsegv(signo, current); | 479 | force_sigsegv(signo, current); |
| 480 | return -EFAULT; | ||
| 475 | } | 481 | } |
| 476 | 482 | ||
| 477 | static inline void | 483 | static inline int |
| 478 | handle_signal(unsigned long signr, struct k_sigaction *ka, | 484 | handle_signal(unsigned long signr, struct k_sigaction *ka, |
| 479 | siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) | 485 | siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) |
| 480 | { | 486 | { |
| 487 | int err; | ||
| 488 | |||
| 481 | if (ka->sa.sa_flags & SA_SIGINFO) | 489 | if (ka->sa.sa_flags & SA_SIGINFO) |
| 482 | setup_rt_frame(ka, regs, signr, oldset, info); | 490 | err = setup_rt_frame(ka, regs, signr, oldset, info); |
| 483 | else | 491 | else |
| 484 | setup_frame(ka, regs, signr, oldset); | 492 | err = setup_frame(ka, regs, signr, oldset); |
| 493 | |||
| 494 | if (err) | ||
| 495 | return err; | ||
| 485 | 496 | ||
| 486 | spin_lock_irq(¤t->sighand->siglock); | 497 | spin_lock_irq(¤t->sighand->siglock); |
| 487 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); | 498 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); |
| @@ -489,6 +500,10 @@ handle_signal(unsigned long signr, struct k_sigaction *ka, | |||
| 489 | sigaddset(¤t->blocked, signr); | 500 | sigaddset(¤t->blocked, signr); |
| 490 | recalc_sigpending(); | 501 | recalc_sigpending(); |
| 491 | spin_unlock_irq(¤t->sighand->siglock); | 502 | spin_unlock_irq(¤t->sighand->siglock); |
| 503 | |||
| 504 | tracehook_signal_handler(signr, info, ka, regs, 0); | ||
| 505 | |||
| 506 | return 0; | ||
| 492 | } | 507 | } |
| 493 | 508 | ||
| 494 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, | 509 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, |
| @@ -546,17 +561,15 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
| 546 | if (signr > 0) { | 561 | if (signr > 0) { |
| 547 | if (restart_syscall) | 562 | if (restart_syscall) |
| 548 | syscall_restart(orig_i0, regs, &ka.sa); | 563 | syscall_restart(orig_i0, regs, &ka.sa); |
| 549 | handle_signal(signr, &ka, &info, oldset, regs); | 564 | if (handle_signal(signr, &ka, &info, oldset, regs) == 0) { |
| 550 | 565 | /* a signal was successfully delivered; the saved | |
| 551 | /* a signal was successfully delivered; the saved | 566 | * sigmask will have been stored in the signal frame, |
| 552 | * sigmask will have been stored in the signal frame, | 567 | * and will be restored by sigreturn, so we can simply |
| 553 | * and will be restored by sigreturn, so we can simply | 568 | * clear the TIF_RESTORE_SIGMASK flag. |
| 554 | * clear the TIF_RESTORE_SIGMASK flag. | 569 | */ |
| 555 | */ | 570 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) |
| 556 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | 571 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
| 557 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 572 | } |
| 558 | |||
| 559 | tracehook_signal_handler(signr, &info, &ka, regs, 0); | ||
| 560 | return; | 573 | return; |
| 561 | } | 574 | } |
| 562 | if (restart_syscall && | 575 | if (restart_syscall && |
| @@ -567,12 +580,14 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
| 567 | regs->u_regs[UREG_I0] = orig_i0; | 580 | regs->u_regs[UREG_I0] = orig_i0; |
| 568 | regs->pc -= 4; | 581 | regs->pc -= 4; |
| 569 | regs->npc -= 4; | 582 | regs->npc -= 4; |
| 583 | pt_regs_clear_syscall(regs); | ||
| 570 | } | 584 | } |
| 571 | if (restart_syscall && | 585 | if (restart_syscall && |
| 572 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { | 586 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { |
| 573 | regs->u_regs[UREG_G1] = __NR_restart_syscall; | 587 | regs->u_regs[UREG_G1] = __NR_restart_syscall; |
| 574 | regs->pc -= 4; | 588 | regs->pc -= 4; |
| 575 | regs->npc -= 4; | 589 | regs->npc -= 4; |
| 590 | pt_regs_clear_syscall(regs); | ||
| 576 | } | 591 | } |
| 577 | 592 | ||
| 578 | /* if there's no signal to deliver, we just put the saved sigmask | 593 | /* if there's no signal to deliver, we just put the saved sigmask |
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index 9fa48c30037e..006fe4515886 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c | |||
| @@ -409,7 +409,7 @@ static inline void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs * | |||
| 409 | return (void __user *) sp; | 409 | return (void __user *) sp; |
| 410 | } | 410 | } |
| 411 | 411 | ||
| 412 | static inline void | 412 | static inline int |
| 413 | setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | 413 | setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, |
| 414 | int signo, sigset_t *oldset, siginfo_t *info) | 414 | int signo, sigset_t *oldset, siginfo_t *info) |
| 415 | { | 415 | { |
| @@ -483,26 +483,37 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
| 483 | } | 483 | } |
| 484 | /* 4. return to kernel instructions */ | 484 | /* 4. return to kernel instructions */ |
| 485 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; | 485 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; |
| 486 | return; | 486 | return 0; |
| 487 | 487 | ||
| 488 | sigill: | 488 | sigill: |
| 489 | do_exit(SIGILL); | 489 | do_exit(SIGILL); |
| 490 | return -EINVAL; | ||
| 491 | |||
| 490 | sigsegv: | 492 | sigsegv: |
| 491 | force_sigsegv(signo, current); | 493 | force_sigsegv(signo, current); |
| 494 | return -EFAULT; | ||
| 492 | } | 495 | } |
| 493 | 496 | ||
| 494 | static inline void handle_signal(unsigned long signr, struct k_sigaction *ka, | 497 | static inline int handle_signal(unsigned long signr, struct k_sigaction *ka, |
| 495 | siginfo_t *info, | 498 | siginfo_t *info, |
| 496 | sigset_t *oldset, struct pt_regs *regs) | 499 | sigset_t *oldset, struct pt_regs *regs) |
| 497 | { | 500 | { |
| 498 | setup_rt_frame(ka, regs, signr, oldset, | 501 | int err; |
| 499 | (ka->sa.sa_flags & SA_SIGINFO) ? info : NULL); | 502 | |
| 503 | err = setup_rt_frame(ka, regs, signr, oldset, | ||
| 504 | (ka->sa.sa_flags & SA_SIGINFO) ? info : NULL); | ||
| 505 | if (err) | ||
| 506 | return err; | ||
| 500 | spin_lock_irq(¤t->sighand->siglock); | 507 | spin_lock_irq(¤t->sighand->siglock); |
| 501 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); | 508 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); |
| 502 | if (!(ka->sa.sa_flags & SA_NOMASK)) | 509 | if (!(ka->sa.sa_flags & SA_NOMASK)) |
| 503 | sigaddset(¤t->blocked,signr); | 510 | sigaddset(¤t->blocked,signr); |
| 504 | recalc_sigpending(); | 511 | recalc_sigpending(); |
| 505 | spin_unlock_irq(¤t->sighand->siglock); | 512 | spin_unlock_irq(¤t->sighand->siglock); |
| 513 | |||
| 514 | tracehook_signal_handler(signr, info, ka, regs, 0); | ||
| 515 | |||
| 516 | return 0; | ||
| 506 | } | 517 | } |
| 507 | 518 | ||
| 508 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, | 519 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, |
| @@ -571,16 +582,14 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
| 571 | if (signr > 0) { | 582 | if (signr > 0) { |
| 572 | if (restart_syscall) | 583 | if (restart_syscall) |
| 573 | syscall_restart(orig_i0, regs, &ka.sa); | 584 | syscall_restart(orig_i0, regs, &ka.sa); |
| 574 | handle_signal(signr, &ka, &info, oldset, regs); | 585 | if (handle_signal(signr, &ka, &info, oldset, regs) == 0) { |
| 575 | 586 | /* A signal was successfully delivered; the saved | |
| 576 | /* A signal was successfully delivered; the saved | 587 | * sigmask will have been stored in the signal frame, |
| 577 | * sigmask will have been stored in the signal frame, | 588 | * and will be restored by sigreturn, so we can simply |
| 578 | * and will be restored by sigreturn, so we can simply | 589 | * clear the TS_RESTORE_SIGMASK flag. |
| 579 | * clear the TS_RESTORE_SIGMASK flag. | 590 | */ |
| 580 | */ | 591 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
| 581 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | 592 | } |
| 582 | |||
| 583 | tracehook_signal_handler(signr, &info, &ka, regs, 0); | ||
| 584 | return; | 593 | return; |
| 585 | } | 594 | } |
| 586 | if (restart_syscall && | 595 | if (restart_syscall && |
| @@ -591,12 +600,14 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
| 591 | regs->u_regs[UREG_I0] = orig_i0; | 600 | regs->u_regs[UREG_I0] = orig_i0; |
| 592 | regs->tpc -= 4; | 601 | regs->tpc -= 4; |
| 593 | regs->tnpc -= 4; | 602 | regs->tnpc -= 4; |
| 603 | pt_regs_clear_syscall(regs); | ||
| 594 | } | 604 | } |
| 595 | if (restart_syscall && | 605 | if (restart_syscall && |
| 596 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { | 606 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { |
| 597 | regs->u_regs[UREG_G1] = __NR_restart_syscall; | 607 | regs->u_regs[UREG_G1] = __NR_restart_syscall; |
| 598 | regs->tpc -= 4; | 608 | regs->tpc -= 4; |
| 599 | regs->tnpc -= 4; | 609 | regs->tnpc -= 4; |
| 610 | pt_regs_clear_syscall(regs); | ||
| 600 | } | 611 | } |
| 601 | 612 | ||
| 602 | /* If there's no signal to deliver, we just put the saved sigmask | 613 | /* If there's no signal to deliver, we just put the saved sigmask |
diff --git a/arch/tile/include/arch/chip_tile64.h b/arch/tile/include/arch/chip_tile64.h index 1246573be59e..261aaba092d4 100644 --- a/arch/tile/include/arch/chip_tile64.h +++ b/arch/tile/include/arch/chip_tile64.h | |||
| @@ -150,6 +150,9 @@ | |||
| 150 | /** Is the PROC_STATUS SPR supported? */ | 150 | /** Is the PROC_STATUS SPR supported? */ |
| 151 | #define CHIP_HAS_PROC_STATUS_SPR() 0 | 151 | #define CHIP_HAS_PROC_STATUS_SPR() 0 |
| 152 | 152 | ||
| 153 | /** Is the DSTREAM_PF SPR supported? */ | ||
| 154 | #define CHIP_HAS_DSTREAM_PF() 0 | ||
| 155 | |||
| 153 | /** Log of the number of mshims we have. */ | 156 | /** Log of the number of mshims we have. */ |
| 154 | #define CHIP_LOG_NUM_MSHIMS() 2 | 157 | #define CHIP_LOG_NUM_MSHIMS() 2 |
| 155 | 158 | ||
diff --git a/arch/tile/include/arch/chip_tilepro.h b/arch/tile/include/arch/chip_tilepro.h index e864c47fc89c..70017699a74c 100644 --- a/arch/tile/include/arch/chip_tilepro.h +++ b/arch/tile/include/arch/chip_tilepro.h | |||
| @@ -150,6 +150,9 @@ | |||
| 150 | /** Is the PROC_STATUS SPR supported? */ | 150 | /** Is the PROC_STATUS SPR supported? */ |
| 151 | #define CHIP_HAS_PROC_STATUS_SPR() 1 | 151 | #define CHIP_HAS_PROC_STATUS_SPR() 1 |
| 152 | 152 | ||
| 153 | /** Is the DSTREAM_PF SPR supported? */ | ||
| 154 | #define CHIP_HAS_DSTREAM_PF() 0 | ||
| 155 | |||
| 153 | /** Log of the number of mshims we have. */ | 156 | /** Log of the number of mshims we have. */ |
| 154 | #define CHIP_LOG_NUM_MSHIMS() 2 | 157 | #define CHIP_LOG_NUM_MSHIMS() 2 |
| 155 | 158 | ||
diff --git a/arch/tile/include/asm/compat.h b/arch/tile/include/asm/compat.h index 345d81ce44bb..8b60ec8b2d19 100644 --- a/arch/tile/include/asm/compat.h +++ b/arch/tile/include/asm/compat.h | |||
| @@ -214,8 +214,9 @@ extern int compat_setup_rt_frame(int sig, struct k_sigaction *ka, | |||
| 214 | struct compat_sigaction; | 214 | struct compat_sigaction; |
| 215 | struct compat_siginfo; | 215 | struct compat_siginfo; |
| 216 | struct compat_sigaltstack; | 216 | struct compat_sigaltstack; |
| 217 | long compat_sys_execve(char __user *path, compat_uptr_t __user *argv, | 217 | long compat_sys_execve(const char __user *path, |
| 218 | compat_uptr_t __user *envp); | 218 | const compat_uptr_t __user *argv, |
| 219 | const compat_uptr_t __user *envp); | ||
| 219 | long compat_sys_rt_sigaction(int sig, struct compat_sigaction __user *act, | 220 | long compat_sys_rt_sigaction(int sig, struct compat_sigaction __user *act, |
| 220 | struct compat_sigaction __user *oact, | 221 | struct compat_sigaction __user *oact, |
| 221 | size_t sigsetsize); | 222 | size_t sigsetsize); |
diff --git a/arch/tile/include/asm/io.h b/arch/tile/include/asm/io.h index 8c95bef3fa45..ee43328713ab 100644 --- a/arch/tile/include/asm/io.h +++ b/arch/tile/include/asm/io.h | |||
| @@ -164,22 +164,22 @@ static inline void _tile_writeq(u64 val, unsigned long addr) | |||
| 164 | #define iowrite32 writel | 164 | #define iowrite32 writel |
| 165 | #define iowrite64 writeq | 165 | #define iowrite64 writeq |
| 166 | 166 | ||
| 167 | static inline void *memcpy_fromio(void *dst, void *src, int len) | 167 | static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, |
| 168 | size_t len) | ||
| 168 | { | 169 | { |
| 169 | int x; | 170 | int x; |
| 170 | BUG_ON((unsigned long)src & 0x3); | 171 | BUG_ON((unsigned long)src & 0x3); |
| 171 | for (x = 0; x < len; x += 4) | 172 | for (x = 0; x < len; x += 4) |
| 172 | *(u32 *)(dst + x) = readl(src + x); | 173 | *(u32 *)(dst + x) = readl(src + x); |
| 173 | return dst; | ||
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | static inline void *memcpy_toio(void *dst, void *src, int len) | 176 | static inline void memcpy_toio(volatile void __iomem *dst, const void *src, |
| 177 | size_t len) | ||
| 177 | { | 178 | { |
| 178 | int x; | 179 | int x; |
| 179 | BUG_ON((unsigned long)dst & 0x3); | 180 | BUG_ON((unsigned long)dst & 0x3); |
| 180 | for (x = 0; x < len; x += 4) | 181 | for (x = 0; x < len; x += 4) |
| 181 | writel(*(u32 *)(src + x), dst + x); | 182 | writel(*(u32 *)(src + x), dst + x); |
| 182 | return dst; | ||
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | /* | 185 | /* |
diff --git a/arch/tile/include/asm/processor.h b/arch/tile/include/asm/processor.h index d942d09b252e..ccd5f8425688 100644 --- a/arch/tile/include/asm/processor.h +++ b/arch/tile/include/asm/processor.h | |||
| @@ -103,6 +103,18 @@ struct thread_struct { | |||
| 103 | /* Any other miscellaneous processor state bits */ | 103 | /* Any other miscellaneous processor state bits */ |
| 104 | unsigned long proc_status; | 104 | unsigned long proc_status; |
| 105 | #endif | 105 | #endif |
| 106 | #if !CHIP_HAS_FIXED_INTVEC_BASE() | ||
| 107 | /* Interrupt base for PL0 interrupts */ | ||
| 108 | unsigned long interrupt_vector_base; | ||
| 109 | #endif | ||
| 110 | #if CHIP_HAS_TILE_RTF_HWM() | ||
| 111 | /* Tile cache retry fifo high-water mark */ | ||
| 112 | unsigned long tile_rtf_hwm; | ||
| 113 | #endif | ||
| 114 | #if CHIP_HAS_DSTREAM_PF() | ||
| 115 | /* Data stream prefetch control */ | ||
| 116 | unsigned long dstream_pf; | ||
| 117 | #endif | ||
| 106 | #ifdef CONFIG_HARDWALL | 118 | #ifdef CONFIG_HARDWALL |
| 107 | /* Is this task tied to an activated hardwall? */ | 119 | /* Is this task tied to an activated hardwall? */ |
| 108 | struct hardwall_info *hardwall; | 120 | struct hardwall_info *hardwall; |
diff --git a/arch/tile/include/asm/ptrace.h b/arch/tile/include/asm/ptrace.h index acdae814e016..4a02bb073979 100644 --- a/arch/tile/include/asm/ptrace.h +++ b/arch/tile/include/asm/ptrace.h | |||
| @@ -51,10 +51,7 @@ typedef uint_reg_t pt_reg_t; | |||
| 51 | 51 | ||
| 52 | /* | 52 | /* |
| 53 | * This struct defines the way the registers are stored on the stack during a | 53 | * This struct defines the way the registers are stored on the stack during a |
| 54 | * system call/exception. It should be a multiple of 8 bytes to preserve | 54 | * system call or exception. "struct sigcontext" has the same shape. |
| 55 | * normal stack alignment rules. | ||
| 56 | * | ||
| 57 | * Must track <sys/ucontext.h> and <sys/procfs.h> | ||
| 58 | */ | 55 | */ |
| 59 | struct pt_regs { | 56 | struct pt_regs { |
| 60 | /* Saved main processor registers; 56..63 are special. */ | 57 | /* Saved main processor registers; 56..63 are special. */ |
| @@ -80,11 +77,6 @@ struct pt_regs { | |||
| 80 | 77 | ||
| 81 | #endif /* __ASSEMBLY__ */ | 78 | #endif /* __ASSEMBLY__ */ |
| 82 | 79 | ||
| 83 | /* Flag bits in pt_regs.flags */ | ||
| 84 | #define PT_FLAGS_DISABLE_IRQ 1 /* on return to kernel, disable irqs */ | ||
| 85 | #define PT_FLAGS_CALLER_SAVES 2 /* caller-save registers are valid */ | ||
| 86 | #define PT_FLAGS_RESTORE_REGS 4 /* restore callee-save regs on return */ | ||
| 87 | |||
| 88 | #define PTRACE_GETREGS 12 | 80 | #define PTRACE_GETREGS 12 |
| 89 | #define PTRACE_SETREGS 13 | 81 | #define PTRACE_SETREGS 13 |
| 90 | #define PTRACE_GETFPREGS 14 | 82 | #define PTRACE_GETFPREGS 14 |
| @@ -101,6 +93,11 @@ struct pt_regs { | |||
| 101 | 93 | ||
| 102 | #ifdef __KERNEL__ | 94 | #ifdef __KERNEL__ |
| 103 | 95 | ||
| 96 | /* Flag bits in pt_regs.flags */ | ||
| 97 | #define PT_FLAGS_DISABLE_IRQ 1 /* on return to kernel, disable irqs */ | ||
| 98 | #define PT_FLAGS_CALLER_SAVES 2 /* caller-save registers are valid */ | ||
| 99 | #define PT_FLAGS_RESTORE_REGS 4 /* restore callee-save regs on return */ | ||
| 100 | |||
| 104 | #ifndef __ASSEMBLY__ | 101 | #ifndef __ASSEMBLY__ |
| 105 | 102 | ||
| 106 | #define instruction_pointer(regs) ((regs)->pc) | 103 | #define instruction_pointer(regs) ((regs)->pc) |
diff --git a/arch/tile/include/asm/sigcontext.h b/arch/tile/include/asm/sigcontext.h index 7cd7672e3ad4..5e2d03336f53 100644 --- a/arch/tile/include/asm/sigcontext.h +++ b/arch/tile/include/asm/sigcontext.h | |||
| @@ -15,13 +15,21 @@ | |||
| 15 | #ifndef _ASM_TILE_SIGCONTEXT_H | 15 | #ifndef _ASM_TILE_SIGCONTEXT_H |
| 16 | #define _ASM_TILE_SIGCONTEXT_H | 16 | #define _ASM_TILE_SIGCONTEXT_H |
| 17 | 17 | ||
| 18 | /* NOTE: we can't include <linux/ptrace.h> due to #include dependencies. */ | 18 | #include <arch/abi.h> |
| 19 | #include <asm/ptrace.h> | ||
| 20 | |||
| 21 | /* Must track <sys/ucontext.h> */ | ||
| 22 | 19 | ||
| 20 | /* | ||
| 21 | * struct sigcontext has the same shape as struct pt_regs, | ||
| 22 | * but is simplified since we know the fault is from userspace. | ||
| 23 | */ | ||
| 23 | struct sigcontext { | 24 | struct sigcontext { |
| 24 | struct pt_regs regs; | 25 | uint_reg_t gregs[53]; /* General-purpose registers. */ |
| 26 | uint_reg_t tp; /* Aliases gregs[TREG_TP]. */ | ||
| 27 | uint_reg_t sp; /* Aliases gregs[TREG_SP]. */ | ||
| 28 | uint_reg_t lr; /* Aliases gregs[TREG_LR]. */ | ||
| 29 | uint_reg_t pc; /* Program counter. */ | ||
| 30 | uint_reg_t ics; /* In Interrupt Critical Section? */ | ||
| 31 | uint_reg_t faultnum; /* Fault number. */ | ||
| 32 | uint_reg_t pad[5]; | ||
| 25 | }; | 33 | }; |
| 26 | 34 | ||
| 27 | #endif /* _ASM_TILE_SIGCONTEXT_H */ | 35 | #endif /* _ASM_TILE_SIGCONTEXT_H */ |
diff --git a/arch/tile/include/asm/signal.h b/arch/tile/include/asm/signal.h index eb0253f32202..c1ee1d61d44c 100644 --- a/arch/tile/include/asm/signal.h +++ b/arch/tile/include/asm/signal.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <asm-generic/signal.h> | 24 | #include <asm-generic/signal.h> |
| 25 | 25 | ||
| 26 | #if defined(__KERNEL__) && !defined(__ASSEMBLY__) | 26 | #if defined(__KERNEL__) && !defined(__ASSEMBLY__) |
| 27 | struct pt_regs; | ||
| 27 | int restore_sigcontext(struct pt_regs *, struct sigcontext __user *, long *); | 28 | int restore_sigcontext(struct pt_regs *, struct sigcontext __user *, long *); |
| 28 | int setup_sigcontext(struct sigcontext __user *, struct pt_regs *); | 29 | int setup_sigcontext(struct sigcontext __user *, struct pt_regs *); |
| 29 | void do_signal(struct pt_regs *regs); | 30 | void do_signal(struct pt_regs *regs); |
diff --git a/arch/tile/include/asm/syscalls.h b/arch/tile/include/asm/syscalls.h index af165a74537f..ce99ffefeacf 100644 --- a/arch/tile/include/asm/syscalls.h +++ b/arch/tile/include/asm/syscalls.h | |||
| @@ -62,10 +62,12 @@ long sys_fork(void); | |||
| 62 | long _sys_fork(struct pt_regs *regs); | 62 | long _sys_fork(struct pt_regs *regs); |
| 63 | long sys_vfork(void); | 63 | long sys_vfork(void); |
| 64 | long _sys_vfork(struct pt_regs *regs); | 64 | long _sys_vfork(struct pt_regs *regs); |
| 65 | long sys_execve(char __user *filename, char __user * __user *argv, | 65 | long sys_execve(const char __user *filename, |
| 66 | char __user * __user *envp); | 66 | const char __user *const __user *argv, |
| 67 | long _sys_execve(char __user *filename, char __user * __user *argv, | 67 | const char __user *const __user *envp); |
| 68 | char __user * __user *envp, struct pt_regs *regs); | 68 | long _sys_execve(const char __user *filename, |
| 69 | const char __user *const __user *argv, | ||
| 70 | const char __user *const __user *envp, struct pt_regs *regs); | ||
| 69 | 71 | ||
| 70 | /* kernel/signal.c */ | 72 | /* kernel/signal.c */ |
| 71 | long sys_sigaltstack(const stack_t __user *, stack_t __user *); | 73 | long sys_sigaltstack(const stack_t __user *, stack_t __user *); |
| @@ -86,10 +88,13 @@ int _sys_cmpxchg_badaddr(unsigned long address, struct pt_regs *); | |||
| 86 | #endif | 88 | #endif |
| 87 | 89 | ||
| 88 | #ifdef CONFIG_COMPAT | 90 | #ifdef CONFIG_COMPAT |
| 89 | long compat_sys_execve(char __user *path, compat_uptr_t __user *argv, | 91 | long compat_sys_execve(const char __user *path, |
| 90 | compat_uptr_t __user *envp); | 92 | const compat_uptr_t __user *argv, |
| 91 | long _compat_sys_execve(char __user *path, compat_uptr_t __user *argv, | 93 | const compat_uptr_t __user *envp); |
| 92 | compat_uptr_t __user *envp, struct pt_regs *regs); | 94 | long _compat_sys_execve(const char __user *path, |
| 95 | const compat_uptr_t __user *argv, | ||
| 96 | const compat_uptr_t __user *envp, | ||
| 97 | struct pt_regs *regs); | ||
| 93 | long compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, | 98 | long compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, |
| 94 | struct compat_sigaltstack __user *uoss_ptr); | 99 | struct compat_sigaltstack __user *uoss_ptr); |
| 95 | long _compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, | 100 | long _compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, |
diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S index 84f296ca9e63..8f58bdff20d7 100644 --- a/arch/tile/kernel/intvec_32.S +++ b/arch/tile/kernel/intvec_32.S | |||
| @@ -1506,13 +1506,6 @@ handle_ill: | |||
| 1506 | } | 1506 | } |
| 1507 | STD_ENDPROC(handle_ill) | 1507 | STD_ENDPROC(handle_ill) |
| 1508 | 1508 | ||
| 1509 | .pushsection .rodata, "a" | ||
| 1510 | .align 8 | ||
| 1511 | bpt_code: | ||
| 1512 | bpt | ||
| 1513 | ENDPROC(bpt_code) | ||
| 1514 | .popsection | ||
| 1515 | |||
| 1516 | /* Various stub interrupt handlers and syscall handlers */ | 1509 | /* Various stub interrupt handlers and syscall handlers */ |
| 1517 | 1510 | ||
| 1518 | STD_ENTRY_LOCAL(_kernel_double_fault) | 1511 | STD_ENTRY_LOCAL(_kernel_double_fault) |
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c index 985cc28c74c5..84c29111756c 100644 --- a/arch/tile/kernel/process.c +++ b/arch/tile/kernel/process.c | |||
| @@ -408,6 +408,15 @@ static void save_arch_state(struct thread_struct *t) | |||
| 408 | #if CHIP_HAS_PROC_STATUS_SPR() | 408 | #if CHIP_HAS_PROC_STATUS_SPR() |
| 409 | t->proc_status = __insn_mfspr(SPR_PROC_STATUS); | 409 | t->proc_status = __insn_mfspr(SPR_PROC_STATUS); |
| 410 | #endif | 410 | #endif |
| 411 | #if !CHIP_HAS_FIXED_INTVEC_BASE() | ||
| 412 | t->interrupt_vector_base = __insn_mfspr(SPR_INTERRUPT_VECTOR_BASE_0); | ||
| 413 | #endif | ||
| 414 | #if CHIP_HAS_TILE_RTF_HWM() | ||
| 415 | t->tile_rtf_hwm = __insn_mfspr(SPR_TILE_RTF_HWM); | ||
| 416 | #endif | ||
| 417 | #if CHIP_HAS_DSTREAM_PF() | ||
| 418 | t->dstream_pf = __insn_mfspr(SPR_DSTREAM_PF); | ||
| 419 | #endif | ||
| 411 | } | 420 | } |
| 412 | 421 | ||
| 413 | static void restore_arch_state(const struct thread_struct *t) | 422 | static void restore_arch_state(const struct thread_struct *t) |
| @@ -428,14 +437,14 @@ static void restore_arch_state(const struct thread_struct *t) | |||
| 428 | #if CHIP_HAS_PROC_STATUS_SPR() | 437 | #if CHIP_HAS_PROC_STATUS_SPR() |
| 429 | __insn_mtspr(SPR_PROC_STATUS, t->proc_status); | 438 | __insn_mtspr(SPR_PROC_STATUS, t->proc_status); |
| 430 | #endif | 439 | #endif |
| 440 | #if !CHIP_HAS_FIXED_INTVEC_BASE() | ||
| 441 | __insn_mtspr(SPR_INTERRUPT_VECTOR_BASE_0, t->interrupt_vector_base); | ||
| 442 | #endif | ||
| 431 | #if CHIP_HAS_TILE_RTF_HWM() | 443 | #if CHIP_HAS_TILE_RTF_HWM() |
| 432 | /* | 444 | __insn_mtspr(SPR_TILE_RTF_HWM, t->tile_rtf_hwm); |
| 433 | * Clear this whenever we switch back to a process in case | 445 | #endif |
| 434 | * the previous process was monkeying with it. Even if enabled | 446 | #if CHIP_HAS_DSTREAM_PF() |
| 435 | * in CBOX_MSR1 via TILE_RTF_HWM_MIN, it's still just a | 447 | __insn_mtspr(SPR_DSTREAM_PF, t->dstream_pf); |
| 436 | * performance hint, so isn't worth a full save/restore. | ||
| 437 | */ | ||
| 438 | __insn_mtspr(SPR_TILE_RTF_HWM, 0); | ||
| 439 | #endif | 448 | #endif |
| 440 | } | 449 | } |
| 441 | 450 | ||
| @@ -561,8 +570,9 @@ out: | |||
| 561 | } | 570 | } |
| 562 | 571 | ||
| 563 | #ifdef CONFIG_COMPAT | 572 | #ifdef CONFIG_COMPAT |
| 564 | long _compat_sys_execve(char __user *path, compat_uptr_t __user *argv, | 573 | long _compat_sys_execve(const char __user *path, |
| 565 | compat_uptr_t __user *envp, struct pt_regs *regs) | 574 | const compat_uptr_t __user *argv, |
| 575 | const compat_uptr_t __user *envp, struct pt_regs *regs) | ||
| 566 | { | 576 | { |
| 567 | long error; | 577 | long error; |
| 568 | char *filename; | 578 | char *filename; |
| @@ -657,7 +667,7 @@ void show_regs(struct pt_regs *regs) | |||
| 657 | regs->regs[51], regs->regs[52], regs->tp); | 667 | regs->regs[51], regs->regs[52], regs->tp); |
| 658 | pr_err(" sp : "REGFMT" lr : "REGFMT"\n", regs->sp, regs->lr); | 668 | pr_err(" sp : "REGFMT" lr : "REGFMT"\n", regs->sp, regs->lr); |
| 659 | #else | 669 | #else |
| 660 | for (i = 0; i < 52; i += 3) | 670 | for (i = 0; i < 52; i += 4) |
| 661 | pr_err(" r%-2d: "REGFMT" r%-2d: "REGFMT | 671 | pr_err(" r%-2d: "REGFMT" r%-2d: "REGFMT |
| 662 | " r%-2d: "REGFMT" r%-2d: "REGFMT"\n", | 672 | " r%-2d: "REGFMT" r%-2d: "REGFMT"\n", |
| 663 | i, regs->regs[i], i+1, regs->regs[i+1], | 673 | i, regs->regs[i], i+1, regs->regs[i+1], |
diff --git a/arch/tile/kernel/signal.c b/arch/tile/kernel/signal.c index 45b66a3c991f..ce183aa1492c 100644 --- a/arch/tile/kernel/signal.c +++ b/arch/tile/kernel/signal.c | |||
| @@ -61,13 +61,19 @@ int restore_sigcontext(struct pt_regs *regs, | |||
| 61 | /* Always make any pending restarted system calls return -EINTR */ | 61 | /* Always make any pending restarted system calls return -EINTR */ |
| 62 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | 62 | current_thread_info()->restart_block.fn = do_no_restart_syscall; |
| 63 | 63 | ||
| 64 | /* | ||
| 65 | * Enforce that sigcontext is like pt_regs, and doesn't mess | ||
| 66 | * up our stack alignment rules. | ||
| 67 | */ | ||
| 68 | BUILD_BUG_ON(sizeof(struct sigcontext) != sizeof(struct pt_regs)); | ||
| 69 | BUILD_BUG_ON(sizeof(struct sigcontext) % 8 != 0); | ||
| 70 | |||
| 64 | for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i) | 71 | for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i) |
| 65 | err |= __get_user(((long *)regs)[i], | 72 | err |= __get_user(regs->regs[i], &sc->gregs[i]); |
| 66 | &((long __user *)(&sc->regs))[i]); | ||
| 67 | 73 | ||
| 68 | regs->faultnum = INT_SWINT_1_SIGRETURN; | 74 | regs->faultnum = INT_SWINT_1_SIGRETURN; |
| 69 | 75 | ||
| 70 | err |= __get_user(*pr0, &sc->regs.regs[0]); | 76 | err |= __get_user(*pr0, &sc->gregs[0]); |
| 71 | return err; | 77 | return err; |
| 72 | } | 78 | } |
| 73 | 79 | ||
| @@ -112,8 +118,7 @@ int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs) | |||
| 112 | int i, err = 0; | 118 | int i, err = 0; |
| 113 | 119 | ||
| 114 | for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i) | 120 | for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i) |
| 115 | err |= __put_user(((long *)regs)[i], | 121 | err |= __put_user(regs->regs[i], &sc->gregs[i]); |
| 116 | &((long __user *)(&sc->regs))[i]); | ||
| 117 | 122 | ||
| 118 | return err; | 123 | return err; |
| 119 | } | 124 | } |
| @@ -203,19 +208,17 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 203 | * Set up registers for signal handler. | 208 | * Set up registers for signal handler. |
| 204 | * Registers that we don't modify keep the value they had from | 209 | * Registers that we don't modify keep the value they had from |
| 205 | * user-space at the time we took the signal. | 210 | * user-space at the time we took the signal. |
| 211 | * We always pass siginfo and mcontext, regardless of SA_SIGINFO, | ||
| 212 | * since some things rely on this (e.g. glibc's debug/segfault.c). | ||
| 206 | */ | 213 | */ |
| 207 | regs->pc = (unsigned long) ka->sa.sa_handler; | 214 | regs->pc = (unsigned long) ka->sa.sa_handler; |
| 208 | regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */ | 215 | regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */ |
| 209 | regs->sp = (unsigned long) frame; | 216 | regs->sp = (unsigned long) frame; |
| 210 | regs->lr = restorer; | 217 | regs->lr = restorer; |
| 211 | regs->regs[0] = (unsigned long) usig; | 218 | regs->regs[0] = (unsigned long) usig; |
| 212 | 219 | regs->regs[1] = (unsigned long) &frame->info; | |
| 213 | if (ka->sa.sa_flags & SA_SIGINFO) { | 220 | regs->regs[2] = (unsigned long) &frame->uc; |
| 214 | /* Need extra arguments, so mark to restore caller-saves. */ | 221 | regs->flags |= PT_FLAGS_CALLER_SAVES; |
| 215 | regs->regs[1] = (unsigned long) &frame->info; | ||
| 216 | regs->regs[2] = (unsigned long) &frame->uc; | ||
| 217 | regs->flags |= PT_FLAGS_CALLER_SAVES; | ||
| 218 | } | ||
| 219 | 222 | ||
| 220 | /* | 223 | /* |
| 221 | * Notify any tracer that was single-stepping it. | 224 | * Notify any tracer that was single-stepping it. |
diff --git a/arch/tile/kernel/stack.c b/arch/tile/kernel/stack.c index 38a68b0b4581..ea2e0ce28380 100644 --- a/arch/tile/kernel/stack.c +++ b/arch/tile/kernel/stack.c | |||
| @@ -175,7 +175,7 @@ static struct pt_regs *valid_sigframe(struct KBacktraceIterator* kbt) | |||
| 175 | pr_err(" <received signal %d>\n", | 175 | pr_err(" <received signal %d>\n", |
| 176 | frame->info.si_signo); | 176 | frame->info.si_signo); |
| 177 | } | 177 | } |
| 178 | return &frame->uc.uc_mcontext.regs; | 178 | return (struct pt_regs *)&frame->uc.uc_mcontext; |
| 179 | } | 179 | } |
| 180 | return NULL; | 180 | return NULL; |
| 181 | } | 181 | } |
diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c index 0c46e398cd8f..63c740a85b4c 100644 --- a/arch/um/drivers/hostaudio_kern.c +++ b/arch/um/drivers/hostaudio_kern.c | |||
| @@ -40,6 +40,11 @@ static char *mixer = HOSTAUDIO_DEV_MIXER; | |||
| 40 | " This is used to specify the host mixer device to the hostaudio driver.\n"\ | 40 | " This is used to specify the host mixer device to the hostaudio driver.\n"\ |
| 41 | " The default is \"" HOSTAUDIO_DEV_MIXER "\".\n\n" | 41 | " The default is \"" HOSTAUDIO_DEV_MIXER "\".\n\n" |
| 42 | 42 | ||
| 43 | module_param(dsp, charp, 0644); | ||
| 44 | MODULE_PARM_DESC(dsp, DSP_HELP); | ||
| 45 | module_param(mixer, charp, 0644); | ||
| 46 | MODULE_PARM_DESC(mixer, MIXER_HELP); | ||
| 47 | |||
| 43 | #ifndef MODULE | 48 | #ifndef MODULE |
| 44 | static int set_dsp(char *name, int *add) | 49 | static int set_dsp(char *name, int *add) |
| 45 | { | 50 | { |
| @@ -56,15 +61,6 @@ static int set_mixer(char *name, int *add) | |||
| 56 | } | 61 | } |
| 57 | 62 | ||
| 58 | __uml_setup("mixer=", set_mixer, "mixer=<mixer device>\n" MIXER_HELP); | 63 | __uml_setup("mixer=", set_mixer, "mixer=<mixer device>\n" MIXER_HELP); |
| 59 | |||
| 60 | #else /*MODULE*/ | ||
| 61 | |||
| 62 | module_param(dsp, charp, 0644); | ||
| 63 | MODULE_PARM_DESC(dsp, DSP_HELP); | ||
| 64 | |||
| 65 | module_param(mixer, charp, 0644); | ||
| 66 | MODULE_PARM_DESC(mixer, MIXER_HELP); | ||
| 67 | |||
| 68 | #endif | 64 | #endif |
| 69 | 65 | ||
| 70 | /* /dev/dsp file operations */ | 66 | /* /dev/dsp file operations */ |
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 2ab233ba32c1..47d0c37897d5 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
| @@ -255,18 +255,6 @@ static void uml_net_tx_timeout(struct net_device *dev) | |||
| 255 | netif_wake_queue(dev); | 255 | netif_wake_queue(dev); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | static int uml_net_set_mac(struct net_device *dev, void *addr) | ||
| 259 | { | ||
| 260 | struct uml_net_private *lp = netdev_priv(dev); | ||
| 261 | struct sockaddr *hwaddr = addr; | ||
| 262 | |||
| 263 | spin_lock_irq(&lp->lock); | ||
| 264 | eth_mac_addr(dev, hwaddr->sa_data); | ||
| 265 | spin_unlock_irq(&lp->lock); | ||
| 266 | |||
| 267 | return 0; | ||
| 268 | } | ||
| 269 | |||
| 270 | static int uml_net_change_mtu(struct net_device *dev, int new_mtu) | 258 | static int uml_net_change_mtu(struct net_device *dev, int new_mtu) |
| 271 | { | 259 | { |
| 272 | dev->mtu = new_mtu; | 260 | dev->mtu = new_mtu; |
| @@ -373,7 +361,7 @@ static const struct net_device_ops uml_netdev_ops = { | |||
| 373 | .ndo_start_xmit = uml_net_start_xmit, | 361 | .ndo_start_xmit = uml_net_start_xmit, |
| 374 | .ndo_set_multicast_list = uml_net_set_multicast_list, | 362 | .ndo_set_multicast_list = uml_net_set_multicast_list, |
| 375 | .ndo_tx_timeout = uml_net_tx_timeout, | 363 | .ndo_tx_timeout = uml_net_tx_timeout, |
| 376 | .ndo_set_mac_address = uml_net_set_mac, | 364 | .ndo_set_mac_address = eth_mac_addr, |
| 377 | .ndo_change_mtu = uml_net_change_mtu, | 365 | .ndo_change_mtu = uml_net_change_mtu, |
| 378 | .ndo_validate_addr = eth_validate_addr, | 366 | .ndo_validate_addr = eth_validate_addr, |
| 379 | }; | 367 | }; |
| @@ -472,7 +460,8 @@ static void eth_configure(int n, void *init, char *mac, | |||
| 472 | ((*transport->user->init)(&lp->user, dev) != 0)) | 460 | ((*transport->user->init)(&lp->user, dev) != 0)) |
| 473 | goto out_unregister; | 461 | goto out_unregister; |
| 474 | 462 | ||
| 475 | eth_mac_addr(dev, device->mac); | 463 | /* don't use eth_mac_addr, it will not work here */ |
| 464 | memcpy(dev->dev_addr, device->mac, ETH_ALEN); | ||
| 476 | dev->mtu = transport->user->mtu; | 465 | dev->mtu = transport->user->mtu; |
| 477 | dev->netdev_ops = ¨_netdev_ops; | 466 | dev->netdev_ops = ¨_netdev_ops; |
| 478 | dev->ethtool_ops = ¨_net_ethtool_ops; | 467 | dev->ethtool_ops = ¨_net_ethtool_ops; |
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 1bcd208c459f..9734994cba1e 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
| @@ -163,6 +163,7 @@ struct ubd { | |||
| 163 | struct scatterlist sg[MAX_SG]; | 163 | struct scatterlist sg[MAX_SG]; |
| 164 | struct request *request; | 164 | struct request *request; |
| 165 | int start_sg, end_sg; | 165 | int start_sg, end_sg; |
| 166 | sector_t rq_pos; | ||
| 166 | }; | 167 | }; |
| 167 | 168 | ||
| 168 | #define DEFAULT_COW { \ | 169 | #define DEFAULT_COW { \ |
| @@ -187,6 +188,7 @@ struct ubd { | |||
| 187 | .request = NULL, \ | 188 | .request = NULL, \ |
| 188 | .start_sg = 0, \ | 189 | .start_sg = 0, \ |
| 189 | .end_sg = 0, \ | 190 | .end_sg = 0, \ |
| 191 | .rq_pos = 0, \ | ||
| 190 | } | 192 | } |
| 191 | 193 | ||
| 192 | /* Protected by ubd_lock */ | 194 | /* Protected by ubd_lock */ |
| @@ -1228,7 +1230,6 @@ static void do_ubd_request(struct request_queue *q) | |||
| 1228 | { | 1230 | { |
| 1229 | struct io_thread_req *io_req; | 1231 | struct io_thread_req *io_req; |
| 1230 | struct request *req; | 1232 | struct request *req; |
| 1231 | sector_t sector; | ||
| 1232 | int n; | 1233 | int n; |
| 1233 | 1234 | ||
| 1234 | while(1){ | 1235 | while(1){ |
| @@ -1239,12 +1240,12 @@ static void do_ubd_request(struct request_queue *q) | |||
| 1239 | return; | 1240 | return; |
| 1240 | 1241 | ||
| 1241 | dev->request = req; | 1242 | dev->request = req; |
| 1243 | dev->rq_pos = blk_rq_pos(req); | ||
| 1242 | dev->start_sg = 0; | 1244 | dev->start_sg = 0; |
| 1243 | dev->end_sg = blk_rq_map_sg(q, req, dev->sg); | 1245 | dev->end_sg = blk_rq_map_sg(q, req, dev->sg); |
| 1244 | } | 1246 | } |
| 1245 | 1247 | ||
| 1246 | req = dev->request; | 1248 | req = dev->request; |
| 1247 | sector = blk_rq_pos(req); | ||
| 1248 | while(dev->start_sg < dev->end_sg){ | 1249 | while(dev->start_sg < dev->end_sg){ |
| 1249 | struct scatterlist *sg = &dev->sg[dev->start_sg]; | 1250 | struct scatterlist *sg = &dev->sg[dev->start_sg]; |
| 1250 | 1251 | ||
| @@ -1256,10 +1257,9 @@ static void do_ubd_request(struct request_queue *q) | |||
| 1256 | return; | 1257 | return; |
| 1257 | } | 1258 | } |
| 1258 | prepare_request(req, io_req, | 1259 | prepare_request(req, io_req, |
| 1259 | (unsigned long long)sector << 9, | 1260 | (unsigned long long)dev->rq_pos << 9, |
| 1260 | sg->offset, sg->length, sg_page(sg)); | 1261 | sg->offset, sg->length, sg_page(sg)); |
| 1261 | 1262 | ||
| 1262 | sector += sg->length >> 9; | ||
| 1263 | n = os_write_file(thread_fd, &io_req, | 1263 | n = os_write_file(thread_fd, &io_req, |
| 1264 | sizeof(struct io_thread_req *)); | 1264 | sizeof(struct io_thread_req *)); |
| 1265 | if(n != sizeof(struct io_thread_req *)){ | 1265 | if(n != sizeof(struct io_thread_req *)){ |
| @@ -1272,6 +1272,7 @@ static void do_ubd_request(struct request_queue *q) | |||
| 1272 | return; | 1272 | return; |
| 1273 | } | 1273 | } |
| 1274 | 1274 | ||
| 1275 | dev->rq_pos += sg->length >> 9; | ||
| 1275 | dev->start_sg++; | 1276 | dev->start_sg++; |
| 1276 | } | 1277 | } |
| 1277 | dev->end_sg = 0; | 1278 | dev->end_sg = 0; |
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index cd145eda3579..49b5e1eb3262 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c | |||
| @@ -62,7 +62,7 @@ static long execve1(const char *file, | |||
| 62 | return error; | 62 | return error; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | long um_execve(const char *file, char __user *__user *argv, char __user *__user *env) | 65 | long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env) |
| 66 | { | 66 | { |
| 67 | long err; | 67 | long err; |
| 68 | 68 | ||
| @@ -72,8 +72,8 @@ long um_execve(const char *file, char __user *__user *argv, char __user *__user | |||
| 72 | return err; | 72 | return err; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | long sys_execve(const char __user *file, char __user *__user *argv, | 75 | long sys_execve(const char __user *file, const char __user *const __user *argv, |
| 76 | char __user *__user *env) | 76 | const char __user *const __user *env) |
| 77 | { | 77 | { |
| 78 | long error; | 78 | long error; |
| 79 | char *filename; | 79 | char *filename; |
diff --git a/arch/um/kernel/internal.h b/arch/um/kernel/internal.h index 1303a105fe91..5bf97db24a04 100644 --- a/arch/um/kernel/internal.h +++ b/arch/um/kernel/internal.h | |||
| @@ -1 +1 @@ | |||
| extern long um_execve(const char *file, char __user *__user *argv, char __user *__user *env); | extern long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env); | ||
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index 5ddb246626db..f958cb876ee3 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c | |||
| @@ -60,8 +60,8 @@ int kernel_execve(const char *filename, | |||
| 60 | 60 | ||
| 61 | fs = get_fs(); | 61 | fs = get_fs(); |
| 62 | set_fs(KERNEL_DS); | 62 | set_fs(KERNEL_DS); |
| 63 | ret = um_execve(filename, (char __user *__user *)argv, | 63 | ret = um_execve(filename, (const char __user *const __user *)argv, |
| 64 | (char __user *__user *) envp); | 64 | (const char __user *const __user *) envp); |
| 65 | set_fs(fs); | 65 | set_fs(fs); |
| 66 | 66 | ||
| 67 | return ret; | 67 | return ret; |
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 8aa1b59b9074..e8c8881351b3 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
| @@ -74,7 +74,7 @@ endif | |||
| 74 | 74 | ||
| 75 | ifdef CONFIG_CC_STACKPROTECTOR | 75 | ifdef CONFIG_CC_STACKPROTECTOR |
| 76 | cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh | 76 | cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh |
| 77 | ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(biarch)),y) | 77 | ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(KBUILD_CPPFLAGS) $(biarch)),y) |
| 78 | stackp-y := -fstack-protector | 78 | stackp-y := -fstack-protector |
| 79 | KBUILD_CFLAGS += $(stackp-y) | 79 | KBUILD_CFLAGS += $(stackp-y) |
| 80 | else | 80 | else |
diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c index 030f4b93e255..5df2869c874b 100644 --- a/arch/x86/boot/early_serial_console.c +++ b/arch/x86/boot/early_serial_console.c | |||
| @@ -58,7 +58,19 @@ static void parse_earlyprintk(void) | |||
| 58 | if (arg[pos] == ',') | 58 | if (arg[pos] == ',') |
| 59 | pos++; | 59 | pos++; |
| 60 | 60 | ||
| 61 | if (!strncmp(arg, "ttyS", 4)) { | 61 | /* |
| 62 | * make sure we have | ||
| 63 | * "serial,0x3f8,115200" | ||
| 64 | * "serial,ttyS0,115200" | ||
| 65 | * "ttyS0,115200" | ||
| 66 | */ | ||
| 67 | if (pos == 7 && !strncmp(arg + pos, "0x", 2)) { | ||
| 68 | port = simple_strtoull(arg + pos, &e, 16); | ||
| 69 | if (port == 0 || arg + pos == e) | ||
| 70 | port = DEFAULT_SERIAL_PORT; | ||
| 71 | else | ||
| 72 | pos = e - arg; | ||
| 73 | } else if (!strncmp(arg + pos, "ttyS", 4)) { | ||
| 62 | static const int bases[] = { 0x3f8, 0x2f8 }; | 74 | static const int bases[] = { 0x3f8, 0x2f8 }; |
| 63 | int idx = 0; | 75 | int idx = 0; |
| 64 | 76 | ||
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c index 0350311906ae..2d93bdbc9ac0 100644 --- a/arch/x86/ia32/ia32_aout.c +++ b/arch/x86/ia32/ia32_aout.c | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | #include <asm/ia32.h> | 34 | #include <asm/ia32.h> |
| 35 | 35 | ||
| 36 | #undef WARN_OLD | 36 | #undef WARN_OLD |
| 37 | #undef CORE_DUMP /* probably broken */ | 37 | #undef CORE_DUMP /* definitely broken */ |
| 38 | 38 | ||
| 39 | static int load_aout_binary(struct linux_binprm *, struct pt_regs *regs); | 39 | static int load_aout_binary(struct linux_binprm *, struct pt_regs *regs); |
| 40 | static int load_aout_library(struct file *); | 40 | static int load_aout_library(struct file *); |
| @@ -131,21 +131,15 @@ static void set_brk(unsigned long start, unsigned long end) | |||
| 131 | * macros to write out all the necessary info. | 131 | * macros to write out all the necessary info. |
| 132 | */ | 132 | */ |
| 133 | 133 | ||
| 134 | static int dump_write(struct file *file, const void *addr, int nr) | 134 | #include <linux/coredump.h> |
| 135 | { | ||
| 136 | return file->f_op->write(file, addr, nr, &file->f_pos) == nr; | ||
| 137 | } | ||
| 138 | 135 | ||
| 139 | #define DUMP_WRITE(addr, nr) \ | 136 | #define DUMP_WRITE(addr, nr) \ |
| 140 | if (!dump_write(file, (void *)(addr), (nr))) \ | 137 | if (!dump_write(file, (void *)(addr), (nr))) \ |
| 141 | goto end_coredump; | 138 | goto end_coredump; |
| 142 | 139 | ||
| 143 | #define DUMP_SEEK(offset) \ | 140 | #define DUMP_SEEK(offset) \ |
| 144 | if (file->f_op->llseek) { \ | 141 | if (!dump_seek(file, offset)) \ |
| 145 | if (file->f_op->llseek(file, (offset), 0) != (offset)) \ | 142 | goto end_coredump; |
| 146 | goto end_coredump; \ | ||
| 147 | } else \ | ||
| 148 | file->f_pos = (offset) | ||
| 149 | 143 | ||
| 150 | #define START_DATA() (u.u_tsize << PAGE_SHIFT) | 144 | #define START_DATA() (u.u_tsize << PAGE_SHIFT) |
| 151 | #define START_STACK(u) (u.start_stack) | 145 | #define START_STACK(u) (u.start_stack) |
| @@ -217,12 +211,6 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, | |||
| 217 | dump_size = dump.u_ssize << PAGE_SHIFT; | 211 | dump_size = dump.u_ssize << PAGE_SHIFT; |
| 218 | DUMP_WRITE(dump_start, dump_size); | 212 | DUMP_WRITE(dump_start, dump_size); |
| 219 | } | 213 | } |
| 220 | /* | ||
| 221 | * Finally dump the task struct. Not be used by gdb, but | ||
| 222 | * could be useful | ||
| 223 | */ | ||
| 224 | set_fs(KERNEL_DS); | ||
| 225 | DUMP_WRITE(current, sizeof(*current)); | ||
| 226 | end_coredump: | 214 | end_coredump: |
| 227 | set_fs(fs); | 215 | set_fs(fs); |
| 228 | return has_dumped; | 216 | return has_dumped; |
diff --git a/arch/x86/include/asm/amd_iommu_proto.h b/arch/x86/include/asm/amd_iommu_proto.h index d2544f1d705d..cb030374b90a 100644 --- a/arch/x86/include/asm/amd_iommu_proto.h +++ b/arch/x86/include/asm/amd_iommu_proto.h | |||
| @@ -38,4 +38,10 @@ static inline void amd_iommu_stats_init(void) { } | |||
| 38 | 38 | ||
| 39 | #endif /* !CONFIG_AMD_IOMMU_STATS */ | 39 | #endif /* !CONFIG_AMD_IOMMU_STATS */ |
| 40 | 40 | ||
| 41 | static inline bool is_rd890_iommu(struct pci_dev *pdev) | ||
| 42 | { | ||
| 43 | return (pdev->vendor == PCI_VENDOR_ID_ATI) && | ||
| 44 | (pdev->device == PCI_DEVICE_ID_RD890_IOMMU); | ||
| 45 | } | ||
| 46 | |||
| 41 | #endif /* _ASM_X86_AMD_IOMMU_PROTO_H */ | 47 | #endif /* _ASM_X86_AMD_IOMMU_PROTO_H */ |
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h index 7014e88bc779..08616180deaf 100644 --- a/arch/x86/include/asm/amd_iommu_types.h +++ b/arch/x86/include/asm/amd_iommu_types.h | |||
| @@ -368,6 +368,9 @@ struct amd_iommu { | |||
| 368 | /* capabilities of that IOMMU read from ACPI */ | 368 | /* capabilities of that IOMMU read from ACPI */ |
| 369 | u32 cap; | 369 | u32 cap; |
| 370 | 370 | ||
| 371 | /* flags read from acpi table */ | ||
| 372 | u8 acpi_flags; | ||
| 373 | |||
| 371 | /* | 374 | /* |
| 372 | * Capability pointer. There could be more than one IOMMU per PCI | 375 | * Capability pointer. There could be more than one IOMMU per PCI |
| 373 | * device function if there are more than one AMD IOMMU capability | 376 | * device function if there are more than one AMD IOMMU capability |
| @@ -411,6 +414,15 @@ struct amd_iommu { | |||
| 411 | 414 | ||
| 412 | /* default dma_ops domain for that IOMMU */ | 415 | /* default dma_ops domain for that IOMMU */ |
| 413 | struct dma_ops_domain *default_dom; | 416 | struct dma_ops_domain *default_dom; |
| 417 | |||
| 418 | /* | ||
| 419 | * This array is required to work around a potential BIOS bug. | ||
| 420 | * The BIOS may miss to restore parts of the PCI configuration | ||
| 421 | * space when the system resumes from S3. The result is that the | ||
| 422 | * IOMMU does not execute commands anymore which leads to system | ||
| 423 | * failure. | ||
| 424 | */ | ||
| 425 | u32 cache_cfg[4]; | ||
| 414 | }; | 426 | }; |
| 415 | 427 | ||
| 416 | /* | 428 | /* |
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index 545776efeb16..bafd80defa43 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h | |||
| @@ -309,7 +309,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr) | |||
| 309 | static __always_inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr) | 309 | static __always_inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr) |
| 310 | { | 310 | { |
| 311 | return ((1UL << (nr % BITS_PER_LONG)) & | 311 | return ((1UL << (nr % BITS_PER_LONG)) & |
| 312 | (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0; | 312 | (addr[nr / BITS_PER_LONG])) != 0; |
| 313 | } | 313 | } |
| 314 | 314 | ||
| 315 | static inline int variable_test_bit(int nr, volatile const unsigned long *addr) | 315 | static inline int variable_test_bit(int nr, volatile const unsigned long *addr) |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 781a50b29a49..3f76523589af 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
| @@ -168,6 +168,7 @@ | |||
| 168 | #define X86_FEATURE_XSAVEOPT (7*32+ 4) /* Optimized Xsave */ | 168 | #define X86_FEATURE_XSAVEOPT (7*32+ 4) /* Optimized Xsave */ |
| 169 | #define X86_FEATURE_PLN (7*32+ 5) /* Intel Power Limit Notification */ | 169 | #define X86_FEATURE_PLN (7*32+ 5) /* Intel Power Limit Notification */ |
| 170 | #define X86_FEATURE_PTS (7*32+ 6) /* Intel Package Thermal Status */ | 170 | #define X86_FEATURE_PTS (7*32+ 6) /* Intel Package Thermal Status */ |
| 171 | #define X86_FEATURE_DTS (7*32+ 7) /* Digital Thermal Sensor */ | ||
| 171 | 172 | ||
| 172 | /* Virtualization flags: Linux defined, word 8 */ | 173 | /* Virtualization flags: Linux defined, word 8 */ |
| 173 | #define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */ | 174 | #define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */ |
| @@ -296,6 +297,7 @@ extern const char * const x86_power_flags[32]; | |||
| 296 | 297 | ||
| 297 | #endif /* CONFIG_X86_64 */ | 298 | #endif /* CONFIG_X86_64 */ |
| 298 | 299 | ||
| 300 | #if __GNUC__ >= 4 | ||
| 299 | /* | 301 | /* |
| 300 | * Static testing of CPU features. Used the same as boot_cpu_has(). | 302 | * Static testing of CPU features. Used the same as boot_cpu_has(). |
| 301 | * These are only valid after alternatives have run, but will statically | 303 | * These are only valid after alternatives have run, but will statically |
| @@ -304,7 +306,7 @@ extern const char * const x86_power_flags[32]; | |||
| 304 | */ | 306 | */ |
| 305 | static __always_inline __pure bool __static_cpu_has(u16 bit) | 307 | static __always_inline __pure bool __static_cpu_has(u16 bit) |
| 306 | { | 308 | { |
| 307 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) | 309 | #if __GNUC__ > 4 || __GNUC_MINOR__ >= 5 |
| 308 | asm goto("1: jmp %l[t_no]\n" | 310 | asm goto("1: jmp %l[t_no]\n" |
| 309 | "2:\n" | 311 | "2:\n" |
| 310 | ".section .altinstructions,\"a\"\n" | 312 | ".section .altinstructions,\"a\"\n" |
| @@ -345,7 +347,6 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) | |||
| 345 | #endif | 347 | #endif |
| 346 | } | 348 | } |
| 347 | 349 | ||
| 348 | #if __GNUC__ >= 4 | ||
| 349 | #define static_cpu_has(bit) \ | 350 | #define static_cpu_has(bit) \ |
| 350 | ( \ | 351 | ( \ |
| 351 | __builtin_constant_p(boot_cpu_has(bit)) ? \ | 352 | __builtin_constant_p(boot_cpu_has(bit)) ? \ |
diff --git a/arch/x86/include/asm/hpet.h b/arch/x86/include/asm/hpet.h index 004e6e25e913..1d5c08a1bdfd 100644 --- a/arch/x86/include/asm/hpet.h +++ b/arch/x86/include/asm/hpet.h | |||
| @@ -68,7 +68,6 @@ extern unsigned long force_hpet_address; | |||
| 68 | extern u8 hpet_blockid; | 68 | extern u8 hpet_blockid; |
| 69 | extern int hpet_force_user; | 69 | extern int hpet_force_user; |
| 70 | extern u8 hpet_msi_disable; | 70 | extern u8 hpet_msi_disable; |
| 71 | extern u8 hpet_readback_cmp; | ||
| 72 | extern int is_hpet_enabled(void); | 71 | extern int is_hpet_enabled(void); |
| 73 | extern int hpet_enable(void); | 72 | extern int hpet_enable(void); |
| 74 | extern void hpet_disable(void); | 73 | extern void hpet_disable(void); |
diff --git a/arch/x86/include/asm/hw_breakpoint.h b/arch/x86/include/asm/hw_breakpoint.h index 528a11e8d3e3..824ca07860d0 100644 --- a/arch/x86/include/asm/hw_breakpoint.h +++ b/arch/x86/include/asm/hw_breakpoint.h | |||
| @@ -20,7 +20,7 @@ struct arch_hw_breakpoint { | |||
| 20 | #include <linux/list.h> | 20 | #include <linux/list.h> |
| 21 | 21 | ||
| 22 | /* Available HW breakpoint length encodings */ | 22 | /* Available HW breakpoint length encodings */ |
| 23 | #define X86_BREAKPOINT_LEN_X 0x00 | 23 | #define X86_BREAKPOINT_LEN_X 0x40 |
| 24 | #define X86_BREAKPOINT_LEN_1 0x40 | 24 | #define X86_BREAKPOINT_LEN_1 0x40 |
| 25 | #define X86_BREAKPOINT_LEN_2 0x44 | 25 | #define X86_BREAKPOINT_LEN_2 0x44 |
| 26 | #define X86_BREAKPOINT_LEN_4 0x4c | 26 | #define X86_BREAKPOINT_LEN_4 0x4c |
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 502e53f999cf..c52e2eb40a1e 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
| @@ -652,20 +652,6 @@ static inline struct kvm_mmu_page *page_header(hpa_t shadow_page) | |||
| 652 | return (struct kvm_mmu_page *)page_private(page); | 652 | return (struct kvm_mmu_page *)page_private(page); |
| 653 | } | 653 | } |
| 654 | 654 | ||
| 655 | static inline u16 kvm_read_fs(void) | ||
| 656 | { | ||
| 657 | u16 seg; | ||
| 658 | asm("mov %%fs, %0" : "=g"(seg)); | ||
| 659 | return seg; | ||
| 660 | } | ||
| 661 | |||
| 662 | static inline u16 kvm_read_gs(void) | ||
| 663 | { | ||
| 664 | u16 seg; | ||
| 665 | asm("mov %%gs, %0" : "=g"(seg)); | ||
| 666 | return seg; | ||
| 667 | } | ||
| 668 | |||
| 669 | static inline u16 kvm_read_ldt(void) | 655 | static inline u16 kvm_read_ldt(void) |
| 670 | { | 656 | { |
| 671 | u16 ldt; | 657 | u16 ldt; |
| @@ -673,16 +659,6 @@ static inline u16 kvm_read_ldt(void) | |||
| 673 | return ldt; | 659 | return ldt; |
| 674 | } | 660 | } |
| 675 | 661 | ||
| 676 | static inline void kvm_load_fs(u16 sel) | ||
| 677 | { | ||
| 678 | asm("mov %0, %%fs" : : "rm"(sel)); | ||
| 679 | } | ||
| 680 | |||
| 681 | static inline void kvm_load_gs(u16 sel) | ||
| 682 | { | ||
| 683 | asm("mov %0, %%gs" : : "rm"(sel)); | ||
| 684 | } | ||
| 685 | |||
| 686 | static inline void kvm_load_ldt(u16 sel) | 662 | static inline void kvm_load_ldt(u16 sel) |
| 687 | { | 663 | { |
| 688 | asm("lldt %0" : : "rm"(sel)); | 664 | asm("lldt %0" : : "rm"(sel)); |
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 0925676266bd..fedf32a8c3ec 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
| @@ -11,6 +11,8 @@ ifdef CONFIG_FUNCTION_TRACER | |||
| 11 | CFLAGS_REMOVE_tsc.o = -pg | 11 | CFLAGS_REMOVE_tsc.o = -pg |
| 12 | CFLAGS_REMOVE_rtc.o = -pg | 12 | CFLAGS_REMOVE_rtc.o = -pg |
| 13 | CFLAGS_REMOVE_paravirt-spinlocks.o = -pg | 13 | CFLAGS_REMOVE_paravirt-spinlocks.o = -pg |
| 14 | CFLAGS_REMOVE_pvclock.o = -pg | ||
| 15 | CFLAGS_REMOVE_kvmclock.o = -pg | ||
| 14 | CFLAGS_REMOVE_ftrace.o = -pg | 16 | CFLAGS_REMOVE_ftrace.o = -pg |
| 15 | CFLAGS_REMOVE_early_printk.o = -pg | 17 | CFLAGS_REMOVE_early_printk.o = -pg |
| 16 | endif | 18 | endif |
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index fb7a5f052e2b..fb16f17e59be 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c | |||
| @@ -61,7 +61,7 @@ struct cstate_entry { | |||
| 61 | unsigned int ecx; | 61 | unsigned int ecx; |
| 62 | } states[ACPI_PROCESSOR_MAX_POWER]; | 62 | } states[ACPI_PROCESSOR_MAX_POWER]; |
| 63 | }; | 63 | }; |
| 64 | static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */ | 64 | static struct cstate_entry __percpu *cpu_cstate_entry; /* per CPU ptr */ |
| 65 | 65 | ||
| 66 | static short mwait_supported[ACPI_PROCESSOR_MAX_POWER]; | 66 | static short mwait_supported[ACPI_PROCESSOR_MAX_POWER]; |
| 67 | 67 | ||
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index fa044e1e30a2..679b6450382b 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
| @@ -1953,6 +1953,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom, | |||
| 1953 | size_t size, | 1953 | size_t size, |
| 1954 | int dir) | 1954 | int dir) |
| 1955 | { | 1955 | { |
| 1956 | dma_addr_t flush_addr; | ||
| 1956 | dma_addr_t i, start; | 1957 | dma_addr_t i, start; |
| 1957 | unsigned int pages; | 1958 | unsigned int pages; |
| 1958 | 1959 | ||
| @@ -1960,6 +1961,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom, | |||
| 1960 | (dma_addr + size > dma_dom->aperture_size)) | 1961 | (dma_addr + size > dma_dom->aperture_size)) |
| 1961 | return; | 1962 | return; |
| 1962 | 1963 | ||
| 1964 | flush_addr = dma_addr; | ||
| 1963 | pages = iommu_num_pages(dma_addr, size, PAGE_SIZE); | 1965 | pages = iommu_num_pages(dma_addr, size, PAGE_SIZE); |
| 1964 | dma_addr &= PAGE_MASK; | 1966 | dma_addr &= PAGE_MASK; |
| 1965 | start = dma_addr; | 1967 | start = dma_addr; |
| @@ -1974,7 +1976,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom, | |||
| 1974 | dma_ops_free_addresses(dma_dom, dma_addr, pages); | 1976 | dma_ops_free_addresses(dma_dom, dma_addr, pages); |
| 1975 | 1977 | ||
| 1976 | if (amd_iommu_unmap_flush || dma_dom->need_flush) { | 1978 | if (amd_iommu_unmap_flush || dma_dom->need_flush) { |
| 1977 | iommu_flush_pages(&dma_dom->domain, dma_addr, size); | 1979 | iommu_flush_pages(&dma_dom->domain, flush_addr, size); |
| 1978 | dma_dom->need_flush = false; | 1980 | dma_dom->need_flush = false; |
| 1979 | } | 1981 | } |
| 1980 | } | 1982 | } |
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 3cc63e2b8dd4..5a170cbbbed8 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
| @@ -632,6 +632,13 @@ static void __init init_iommu_from_pci(struct amd_iommu *iommu) | |||
| 632 | iommu->last_device = calc_devid(MMIO_GET_BUS(range), | 632 | iommu->last_device = calc_devid(MMIO_GET_BUS(range), |
| 633 | MMIO_GET_LD(range)); | 633 | MMIO_GET_LD(range)); |
| 634 | iommu->evt_msi_num = MMIO_MSI_NUM(misc); | 634 | iommu->evt_msi_num = MMIO_MSI_NUM(misc); |
| 635 | |||
| 636 | if (is_rd890_iommu(iommu->dev)) { | ||
| 637 | pci_read_config_dword(iommu->dev, 0xf0, &iommu->cache_cfg[0]); | ||
| 638 | pci_read_config_dword(iommu->dev, 0xf4, &iommu->cache_cfg[1]); | ||
| 639 | pci_read_config_dword(iommu->dev, 0xf8, &iommu->cache_cfg[2]); | ||
| 640 | pci_read_config_dword(iommu->dev, 0xfc, &iommu->cache_cfg[3]); | ||
| 641 | } | ||
| 635 | } | 642 | } |
| 636 | 643 | ||
| 637 | /* | 644 | /* |
| @@ -649,29 +656,9 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu, | |||
| 649 | struct ivhd_entry *e; | 656 | struct ivhd_entry *e; |
| 650 | 657 | ||
| 651 | /* | 658 | /* |
| 652 | * First set the recommended feature enable bits from ACPI | 659 | * First save the recommended feature enable bits from ACPI |
| 653 | * into the IOMMU control registers | ||
| 654 | */ | 660 | */ |
| 655 | h->flags & IVHD_FLAG_HT_TUN_EN_MASK ? | 661 | iommu->acpi_flags = h->flags; |
| 656 | iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) : | ||
| 657 | iommu_feature_disable(iommu, CONTROL_HT_TUN_EN); | ||
| 658 | |||
| 659 | h->flags & IVHD_FLAG_PASSPW_EN_MASK ? | ||
| 660 | iommu_feature_enable(iommu, CONTROL_PASSPW_EN) : | ||
| 661 | iommu_feature_disable(iommu, CONTROL_PASSPW_EN); | ||
| 662 | |||
| 663 | h->flags & IVHD_FLAG_RESPASSPW_EN_MASK ? | ||
| 664 | iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) : | ||
| 665 | iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN); | ||
| 666 | |||
| 667 | h->flags & IVHD_FLAG_ISOC_EN_MASK ? | ||
| 668 | iommu_feature_enable(iommu, CONTROL_ISOC_EN) : | ||
| 669 | iommu_feature_disable(iommu, CONTROL_ISOC_EN); | ||
| 670 | |||
| 671 | /* | ||
| 672 | * make IOMMU memory accesses cache coherent | ||
| 673 | */ | ||
| 674 | iommu_feature_enable(iommu, CONTROL_COHERENT_EN); | ||
| 675 | 662 | ||
| 676 | /* | 663 | /* |
| 677 | * Done. Now parse the device entries | 664 | * Done. Now parse the device entries |
| @@ -1116,6 +1103,40 @@ static void init_device_table(void) | |||
| 1116 | } | 1103 | } |
| 1117 | } | 1104 | } |
| 1118 | 1105 | ||
| 1106 | static void iommu_init_flags(struct amd_iommu *iommu) | ||
| 1107 | { | ||
| 1108 | iommu->acpi_flags & IVHD_FLAG_HT_TUN_EN_MASK ? | ||
| 1109 | iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) : | ||
| 1110 | iommu_feature_disable(iommu, CONTROL_HT_TUN_EN); | ||
| 1111 | |||
| 1112 | iommu->acpi_flags & IVHD_FLAG_PASSPW_EN_MASK ? | ||
| 1113 | iommu_feature_enable(iommu, CONTROL_PASSPW_EN) : | ||
| 1114 | iommu_feature_disable(iommu, CONTROL_PASSPW_EN); | ||
| 1115 | |||
| 1116 | iommu->acpi_flags & IVHD_FLAG_RESPASSPW_EN_MASK ? | ||
| 1117 | iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) : | ||
| 1118 | iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN); | ||
| 1119 | |||
| 1120 | iommu->acpi_flags & IVHD_FLAG_ISOC_EN_MASK ? | ||
| 1121 | iommu_feature_enable(iommu, CONTROL_ISOC_EN) : | ||
| 1122 | iommu_feature_disable(iommu, CONTROL_ISOC_EN); | ||
| 1123 | |||
| 1124 | /* | ||
| 1125 | * make IOMMU memory accesses cache coherent | ||
| 1126 | */ | ||
| 1127 | iommu_feature_enable(iommu, CONTROL_COHERENT_EN); | ||
| 1128 | } | ||
| 1129 | |||
| 1130 | static void iommu_apply_quirks(struct amd_iommu *iommu) | ||
| 1131 | { | ||
| 1132 | if (is_rd890_iommu(iommu->dev)) { | ||
| 1133 | pci_write_config_dword(iommu->dev, 0xf0, iommu->cache_cfg[0]); | ||
| 1134 | pci_write_config_dword(iommu->dev, 0xf4, iommu->cache_cfg[1]); | ||
| 1135 | pci_write_config_dword(iommu->dev, 0xf8, iommu->cache_cfg[2]); | ||
| 1136 | pci_write_config_dword(iommu->dev, 0xfc, iommu->cache_cfg[3]); | ||
| 1137 | } | ||
| 1138 | } | ||
| 1139 | |||
| 1119 | /* | 1140 | /* |
| 1120 | * This function finally enables all IOMMUs found in the system after | 1141 | * This function finally enables all IOMMUs found in the system after |
| 1121 | * they have been initialized | 1142 | * they have been initialized |
| @@ -1126,6 +1147,8 @@ static void enable_iommus(void) | |||
| 1126 | 1147 | ||
| 1127 | for_each_iommu(iommu) { | 1148 | for_each_iommu(iommu) { |
| 1128 | iommu_disable(iommu); | 1149 | iommu_disable(iommu); |
| 1150 | iommu_apply_quirks(iommu); | ||
| 1151 | iommu_init_flags(iommu); | ||
| 1129 | iommu_set_device_table(iommu); | 1152 | iommu_set_device_table(iommu); |
| 1130 | iommu_enable_command_buffer(iommu); | 1153 | iommu_enable_command_buffer(iommu); |
| 1131 | iommu_enable_event_buffer(iommu); | 1154 | iommu_enable_event_buffer(iommu); |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index f1efebaf5510..5c5b8f3dddb5 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
| @@ -306,14 +306,19 @@ void arch_init_copy_chip_data(struct irq_desc *old_desc, | |||
| 306 | 306 | ||
| 307 | old_cfg = old_desc->chip_data; | 307 | old_cfg = old_desc->chip_data; |
| 308 | 308 | ||
| 309 | memcpy(cfg, old_cfg, sizeof(struct irq_cfg)); | 309 | cfg->vector = old_cfg->vector; |
| 310 | cfg->move_in_progress = old_cfg->move_in_progress; | ||
| 311 | cpumask_copy(cfg->domain, old_cfg->domain); | ||
| 312 | cpumask_copy(cfg->old_domain, old_cfg->old_domain); | ||
| 310 | 313 | ||
| 311 | init_copy_irq_2_pin(old_cfg, cfg, node); | 314 | init_copy_irq_2_pin(old_cfg, cfg, node); |
| 312 | } | 315 | } |
| 313 | 316 | ||
| 314 | static void free_irq_cfg(struct irq_cfg *old_cfg) | 317 | static void free_irq_cfg(struct irq_cfg *cfg) |
| 315 | { | 318 | { |
| 316 | kfree(old_cfg); | 319 | free_cpumask_var(cfg->domain); |
| 320 | free_cpumask_var(cfg->old_domain); | ||
| 321 | kfree(cfg); | ||
| 317 | } | 322 | } |
| 318 | 323 | ||
| 319 | void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc) | 324 | void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc) |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 7b598b84c902..f744f54cb248 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
| @@ -698,9 +698,11 @@ void __init uv_system_init(void) | |||
| 698 | for (j = 0; j < 64; j++) { | 698 | for (j = 0; j < 64; j++) { |
| 699 | if (!test_bit(j, &present)) | 699 | if (!test_bit(j, &present)) |
| 700 | continue; | 700 | continue; |
| 701 | uv_blade_info[blade].pnode = (i * 64 + j); | 701 | pnode = (i * 64 + j); |
| 702 | uv_blade_info[blade].pnode = pnode; | ||
| 702 | uv_blade_info[blade].nr_possible_cpus = 0; | 703 | uv_blade_info[blade].nr_possible_cpus = 0; |
| 703 | uv_blade_info[blade].nr_online_cpus = 0; | 704 | uv_blade_info[blade].nr_online_cpus = 0; |
| 705 | max_pnode = max(pnode, max_pnode); | ||
| 704 | blade++; | 706 | blade++; |
| 705 | } | 707 | } |
| 706 | } | 708 | } |
| @@ -738,7 +740,6 @@ void __init uv_system_init(void) | |||
| 738 | uv_cpu_hub_info(cpu)->scir.offset = uv_scir_offset(apicid); | 740 | uv_cpu_hub_info(cpu)->scir.offset = uv_scir_offset(apicid); |
| 739 | uv_node_to_blade[nid] = blade; | 741 | uv_node_to_blade[nid] = blade; |
| 740 | uv_cpu_to_blade[cpu] = blade; | 742 | uv_cpu_to_blade[cpu] = blade; |
| 741 | max_pnode = max(pnode, max_pnode); | ||
| 742 | } | 743 | } |
| 743 | 744 | ||
| 744 | /* Add blade/pnode info for nodes without cpus */ | 745 | /* Add blade/pnode info for nodes without cpus */ |
| @@ -750,7 +751,6 @@ void __init uv_system_init(void) | |||
| 750 | pnode = (paddr >> m_val) & pnode_mask; | 751 | pnode = (paddr >> m_val) & pnode_mask; |
| 751 | blade = boot_pnode_to_blade(pnode); | 752 | blade = boot_pnode_to_blade(pnode); |
| 752 | uv_node_to_blade[nid] = blade; | 753 | uv_node_to_blade[nid] = blade; |
| 753 | max_pnode = max(pnode, max_pnode); | ||
| 754 | } | 754 | } |
| 755 | 755 | ||
| 756 | map_gru_high(max_pnode); | 756 | map_gru_high(max_pnode); |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 490dac63c2d2..f2f9ac7da25c 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
| @@ -545,7 +545,7 @@ void __cpuinit cpu_detect(struct cpuinfo_x86 *c) | |||
| 545 | } | 545 | } |
| 546 | } | 546 | } |
| 547 | 547 | ||
| 548 | static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) | 548 | void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) |
| 549 | { | 549 | { |
| 550 | u32 tfms, xlvl; | 550 | u32 tfms, xlvl; |
| 551 | u32 ebx; | 551 | u32 ebx; |
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h index 3624e8a0f71b..f668bb1f7d43 100644 --- a/arch/x86/kernel/cpu/cpu.h +++ b/arch/x86/kernel/cpu/cpu.h | |||
| @@ -33,5 +33,6 @@ extern const struct cpu_dev *const __x86_cpu_dev_start[], | |||
| 33 | *const __x86_cpu_dev_end[]; | 33 | *const __x86_cpu_dev_end[]; |
| 34 | 34 | ||
| 35 | extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); | 35 | extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); |
| 36 | extern void get_cpu_cap(struct cpuinfo_x86 *c); | ||
| 36 | 37 | ||
| 37 | #endif | 38 | #endif |
diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index 994230d4dc4e..4f6f679f2799 100644 --- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | |||
| @@ -368,16 +368,22 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle) | |||
| 368 | return -ENODEV; | 368 | return -ENODEV; |
| 369 | 369 | ||
| 370 | out_obj = output.pointer; | 370 | out_obj = output.pointer; |
| 371 | if (out_obj->type != ACPI_TYPE_BUFFER) | 371 | if (out_obj->type != ACPI_TYPE_BUFFER) { |
| 372 | return -ENODEV; | 372 | ret = -ENODEV; |
| 373 | goto out_free; | ||
| 374 | } | ||
| 373 | 375 | ||
| 374 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); | 376 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
| 375 | if (errors) | 377 | if (errors) { |
| 376 | return -ENODEV; | 378 | ret = -ENODEV; |
| 379 | goto out_free; | ||
| 380 | } | ||
| 377 | 381 | ||
| 378 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); | 382 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); |
| 379 | if (!(supported & 0x1)) | 383 | if (!(supported & 0x1)) { |
| 380 | return -ENODEV; | 384 | ret = -ENODEV; |
| 385 | goto out_free; | ||
| 386 | } | ||
| 381 | 387 | ||
| 382 | out_free: | 388 | out_free: |
| 383 | kfree(output.pointer); | 389 | kfree(output.pointer); |
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 85f69cdeae10..b4389441efbb 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
| @@ -39,6 +39,7 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) | |||
| 39 | misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID; | 39 | misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID; |
| 40 | wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable); | 40 | wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable); |
| 41 | c->cpuid_level = cpuid_eax(0); | 41 | c->cpuid_level = cpuid_eax(0); |
| 42 | get_cpu_cap(c); | ||
| 42 | } | 43 | } |
| 43 | } | 44 | } |
| 44 | 45 | ||
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index 5e975298fa81..39aaee5c1ab2 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c | |||
| @@ -141,6 +141,7 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c) | |||
| 141 | address = (low & MASK_BLKPTR_LO) >> 21; | 141 | address = (low & MASK_BLKPTR_LO) >> 21; |
| 142 | if (!address) | 142 | if (!address) |
| 143 | break; | 143 | break; |
| 144 | |||
| 144 | address += MCG_XBLK_ADDR; | 145 | address += MCG_XBLK_ADDR; |
| 145 | } else | 146 | } else |
| 146 | ++address; | 147 | ++address; |
| @@ -148,12 +149,8 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c) | |||
| 148 | if (rdmsr_safe(address, &low, &high)) | 149 | if (rdmsr_safe(address, &low, &high)) |
| 149 | break; | 150 | break; |
| 150 | 151 | ||
| 151 | if (!(high & MASK_VALID_HI)) { | 152 | if (!(high & MASK_VALID_HI)) |
| 152 | if (block) | 153 | continue; |
| 153 | continue; | ||
| 154 | else | ||
| 155 | break; | ||
| 156 | } | ||
| 157 | 154 | ||
| 158 | if (!(high & MASK_CNTP_HI) || | 155 | if (!(high & MASK_CNTP_HI) || |
| 159 | (high & MASK_LOCKED_HI)) | 156 | (high & MASK_LOCKED_HI)) |
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index d9368eeda309..169d8804a9f8 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c | |||
| @@ -216,7 +216,7 @@ static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev, | |||
| 216 | err = sysfs_add_file_to_group(&sys_dev->kobj, | 216 | err = sysfs_add_file_to_group(&sys_dev->kobj, |
| 217 | &attr_core_power_limit_count.attr, | 217 | &attr_core_power_limit_count.attr, |
| 218 | thermal_attr_group.name); | 218 | thermal_attr_group.name); |
| 219 | if (cpu_has(c, X86_FEATURE_PTS)) | 219 | if (cpu_has(c, X86_FEATURE_PTS)) { |
| 220 | err = sysfs_add_file_to_group(&sys_dev->kobj, | 220 | err = sysfs_add_file_to_group(&sys_dev->kobj, |
| 221 | &attr_package_throttle_count.attr, | 221 | &attr_package_throttle_count.attr, |
| 222 | thermal_attr_group.name); | 222 | thermal_attr_group.name); |
| @@ -224,6 +224,7 @@ static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev, | |||
| 224 | err = sysfs_add_file_to_group(&sys_dev->kobj, | 224 | err = sysfs_add_file_to_group(&sys_dev->kobj, |
| 225 | &attr_package_power_limit_count.attr, | 225 | &attr_package_power_limit_count.attr, |
| 226 | thermal_attr_group.name); | 226 | thermal_attr_group.name); |
| 227 | } | ||
| 227 | 228 | ||
| 228 | return err; | 229 | return err; |
| 229 | } | 230 | } |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 3efdf2870a35..03a5b0385ad6 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
| @@ -102,6 +102,7 @@ struct cpu_hw_events { | |||
| 102 | */ | 102 | */ |
| 103 | struct perf_event *events[X86_PMC_IDX_MAX]; /* in counter order */ | 103 | struct perf_event *events[X86_PMC_IDX_MAX]; /* in counter order */ |
| 104 | unsigned long active_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; | 104 | unsigned long active_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; |
| 105 | unsigned long running[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; | ||
| 105 | int enabled; | 106 | int enabled; |
| 106 | 107 | ||
| 107 | int n_events; | 108 | int n_events; |
| @@ -1010,6 +1011,7 @@ static int x86_pmu_start(struct perf_event *event) | |||
| 1010 | x86_perf_event_set_period(event); | 1011 | x86_perf_event_set_period(event); |
| 1011 | cpuc->events[idx] = event; | 1012 | cpuc->events[idx] = event; |
| 1012 | __set_bit(idx, cpuc->active_mask); | 1013 | __set_bit(idx, cpuc->active_mask); |
| 1014 | __set_bit(idx, cpuc->running); | ||
| 1013 | x86_pmu.enable(event); | 1015 | x86_pmu.enable(event); |
| 1014 | perf_event_update_userpage(event); | 1016 | perf_event_update_userpage(event); |
| 1015 | 1017 | ||
| @@ -1141,8 +1143,16 @@ static int x86_pmu_handle_irq(struct pt_regs *regs) | |||
| 1141 | cpuc = &__get_cpu_var(cpu_hw_events); | 1143 | cpuc = &__get_cpu_var(cpu_hw_events); |
| 1142 | 1144 | ||
| 1143 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { | 1145 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { |
| 1144 | if (!test_bit(idx, cpuc->active_mask)) | 1146 | if (!test_bit(idx, cpuc->active_mask)) { |
| 1147 | /* | ||
| 1148 | * Though we deactivated the counter some cpus | ||
| 1149 | * might still deliver spurious interrupts still | ||
| 1150 | * in flight. Catch them: | ||
| 1151 | */ | ||
| 1152 | if (__test_and_clear_bit(idx, cpuc->running)) | ||
| 1153 | handled++; | ||
| 1145 | continue; | 1154 | continue; |
| 1155 | } | ||
| 1146 | 1156 | ||
| 1147 | event = cpuc->events[idx]; | 1157 | event = cpuc->events[idx]; |
| 1148 | hwc = &event->hw; | 1158 | hwc = &event->hw; |
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index b560db3305be..249015173992 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
| @@ -660,8 +660,12 @@ static int p4_pmu_handle_irq(struct pt_regs *regs) | |||
| 660 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { | 660 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { |
| 661 | int overflow; | 661 | int overflow; |
| 662 | 662 | ||
| 663 | if (!test_bit(idx, cpuc->active_mask)) | 663 | if (!test_bit(idx, cpuc->active_mask)) { |
| 664 | /* catch in-flight IRQs */ | ||
| 665 | if (__test_and_clear_bit(idx, cpuc->running)) | ||
| 666 | handled++; | ||
| 664 | continue; | 667 | continue; |
| 668 | } | ||
| 665 | 669 | ||
| 666 | event = cpuc->events[idx]; | 670 | event = cpuc->events[idx]; |
| 667 | hwc = &event->hw; | 671 | hwc = &event->hw; |
diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c index 34b4dad6f0b8..d49079515122 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c | |||
| @@ -31,6 +31,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c) | |||
| 31 | const struct cpuid_bit *cb; | 31 | const struct cpuid_bit *cb; |
| 32 | 32 | ||
| 33 | static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { | 33 | static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { |
| 34 | { X86_FEATURE_DTS, CR_EAX, 0, 0x00000006, 0 }, | ||
| 34 | { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006, 0 }, | 35 | { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006, 0 }, |
| 35 | { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006, 0 }, | 36 | { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006, 0 }, |
| 36 | { X86_FEATURE_PLN, CR_EAX, 4, 0x00000006, 0 }, | 37 | { X86_FEATURE_PLN, CR_EAX, 4, 0x00000006, 0 }, |
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index e5cc7e82e60d..ebdb85cf2686 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <asm/apic.h> | 18 | #include <asm/apic.h> |
| 19 | #include <asm/iommu.h> | 19 | #include <asm/iommu.h> |
| 20 | #include <asm/gart.h> | 20 | #include <asm/gart.h> |
| 21 | #include <asm/hpet.h> | ||
| 22 | 21 | ||
| 23 | static void __init fix_hypertransport_config(int num, int slot, int func) | 22 | static void __init fix_hypertransport_config(int num, int slot, int func) |
| 24 | { | 23 | { |
| @@ -192,21 +191,6 @@ static void __init ati_bugs_contd(int num, int slot, int func) | |||
| 192 | } | 191 | } |
| 193 | #endif | 192 | #endif |
| 194 | 193 | ||
| 195 | /* | ||
| 196 | * Force the read back of the CMP register in hpet_next_event() | ||
| 197 | * to work around the problem that the CMP register write seems to be | ||
| 198 | * delayed. See hpet_next_event() for details. | ||
| 199 | * | ||
| 200 | * We do this on all SMBUS incarnations for now until we have more | ||
| 201 | * information about the affected chipsets. | ||
| 202 | */ | ||
| 203 | static void __init ati_hpet_bugs(int num, int slot, int func) | ||
| 204 | { | ||
| 205 | #ifdef CONFIG_HPET_TIMER | ||
| 206 | hpet_readback_cmp = 1; | ||
| 207 | #endif | ||
| 208 | } | ||
| 209 | |||
| 210 | #define QFLAG_APPLY_ONCE 0x1 | 194 | #define QFLAG_APPLY_ONCE 0x1 |
| 211 | #define QFLAG_APPLIED 0x2 | 195 | #define QFLAG_APPLIED 0x2 |
| 212 | #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) | 196 | #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) |
| @@ -236,8 +220,6 @@ static struct chipset early_qrk[] __initdata = { | |||
| 236 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs }, | 220 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs }, |
| 237 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, | 221 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, |
| 238 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd }, | 222 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd }, |
| 239 | { PCI_VENDOR_ID_ATI, PCI_ANY_ID, | ||
| 240 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_hpet_bugs }, | ||
| 241 | {} | 223 | {} |
| 242 | }; | 224 | }; |
| 243 | 225 | ||
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 351f9c0fea1f..7494999141b3 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
| @@ -35,7 +35,6 @@ | |||
| 35 | unsigned long hpet_address; | 35 | unsigned long hpet_address; |
| 36 | u8 hpet_blockid; /* OS timer block num */ | 36 | u8 hpet_blockid; /* OS timer block num */ |
| 37 | u8 hpet_msi_disable; | 37 | u8 hpet_msi_disable; |
| 38 | u8 hpet_readback_cmp; | ||
| 39 | 38 | ||
| 40 | #ifdef CONFIG_PCI_MSI | 39 | #ifdef CONFIG_PCI_MSI |
| 41 | static unsigned long hpet_num_timers; | 40 | static unsigned long hpet_num_timers; |
| @@ -395,23 +394,27 @@ static int hpet_next_event(unsigned long delta, | |||
| 395 | * at that point and we would wait for the next hpet interrupt | 394 | * at that point and we would wait for the next hpet interrupt |
| 396 | * forever. We found out that reading the CMP register back | 395 | * forever. We found out that reading the CMP register back |
| 397 | * forces the transfer so we can rely on the comparison with | 396 | * forces the transfer so we can rely on the comparison with |
| 398 | * the counter register below. | 397 | * the counter register below. If the read back from the |
| 398 | * compare register does not match the value we programmed | ||
| 399 | * then we might have a real hardware problem. We can not do | ||
| 400 | * much about it here, but at least alert the user/admin with | ||
| 401 | * a prominent warning. | ||
| 399 | * | 402 | * |
| 400 | * That works fine on those ATI chipsets, but on newer Intel | 403 | * An erratum on some chipsets (ICH9,..), results in |
| 401 | * chipsets (ICH9...) this triggers due to an erratum: Reading | 404 | * comparator read immediately following a write returning old |
| 402 | * the comparator immediately following a write is returning | 405 | * value. Workaround for this is to read this value second |
| 403 | * the old value. | 406 | * time, when first read returns old value. |
| 404 | * | 407 | * |
| 405 | * We restrict the read back to the affected ATI chipsets (set | 408 | * In fact the write to the comparator register is delayed up |
| 406 | * by quirks) and also run it with hpet=verbose for debugging | 409 | * to two HPET cycles so the workaround we tried to restrict |
| 407 | * purposes. | 410 | * the readback to those known to be borked ATI chipsets |
| 411 | * failed miserably. So we give up on optimizations forever | ||
| 412 | * and penalize all HPET incarnations unconditionally. | ||
| 408 | */ | 413 | */ |
| 409 | if (hpet_readback_cmp || hpet_verbose) { | 414 | if (unlikely((u32)hpet_readl(HPET_Tn_CMP(timer)) != cnt)) { |
| 410 | u32 cmp = hpet_readl(HPET_Tn_CMP(timer)); | 415 | if (hpet_readl(HPET_Tn_CMP(timer)) != cnt) |
| 411 | |||
| 412 | if (cmp != cnt) | ||
| 413 | printk_once(KERN_WARNING | 416 | printk_once(KERN_WARNING |
| 414 | "hpet: compare register read back failed.\n"); | 417 | "hpet: compare register read back failed.\n"); |
| 415 | } | 418 | } |
| 416 | 419 | ||
| 417 | return (s32)(hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0; | 420 | return (s32)(hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0; |
| @@ -503,7 +506,7 @@ static int hpet_assign_irq(struct hpet_dev *dev) | |||
| 503 | { | 506 | { |
| 504 | unsigned int irq; | 507 | unsigned int irq; |
| 505 | 508 | ||
| 506 | irq = create_irq(); | 509 | irq = create_irq_nr(0, -1); |
| 507 | if (!irq) | 510 | if (!irq) |
| 508 | return -EINVAL; | 511 | return -EINVAL; |
| 509 | 512 | ||
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c index a474ec37c32f..ff15c9dcc25d 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c | |||
| @@ -206,11 +206,27 @@ int arch_check_bp_in_kernelspace(struct perf_event *bp) | |||
| 206 | int arch_bp_generic_fields(int x86_len, int x86_type, | 206 | int arch_bp_generic_fields(int x86_len, int x86_type, |
| 207 | int *gen_len, int *gen_type) | 207 | int *gen_len, int *gen_type) |
| 208 | { | 208 | { |
| 209 | /* Len */ | 209 | /* Type */ |
| 210 | switch (x86_len) { | 210 | switch (x86_type) { |
| 211 | case X86_BREAKPOINT_LEN_X: | 211 | case X86_BREAKPOINT_EXECUTE: |
| 212 | if (x86_len != X86_BREAKPOINT_LEN_X) | ||
| 213 | return -EINVAL; | ||
| 214 | |||
| 215 | *gen_type = HW_BREAKPOINT_X; | ||
| 212 | *gen_len = sizeof(long); | 216 | *gen_len = sizeof(long); |
| 217 | return 0; | ||
| 218 | case X86_BREAKPOINT_WRITE: | ||
| 219 | *gen_type = HW_BREAKPOINT_W; | ||
| 213 | break; | 220 | break; |
| 221 | case X86_BREAKPOINT_RW: | ||
| 222 | *gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R; | ||
| 223 | break; | ||
| 224 | default: | ||
| 225 | return -EINVAL; | ||
| 226 | } | ||
| 227 | |||
| 228 | /* Len */ | ||
| 229 | switch (x86_len) { | ||
| 214 | case X86_BREAKPOINT_LEN_1: | 230 | case X86_BREAKPOINT_LEN_1: |
| 215 | *gen_len = HW_BREAKPOINT_LEN_1; | 231 | *gen_len = HW_BREAKPOINT_LEN_1; |
| 216 | break; | 232 | break; |
| @@ -229,21 +245,6 @@ int arch_bp_generic_fields(int x86_len, int x86_type, | |||
| 229 | return -EINVAL; | 245 | return -EINVAL; |
| 230 | } | 246 | } |
| 231 | 247 | ||
| 232 | /* Type */ | ||
| 233 | switch (x86_type) { | ||
| 234 | case X86_BREAKPOINT_EXECUTE: | ||
| 235 | *gen_type = HW_BREAKPOINT_X; | ||
| 236 | break; | ||
| 237 | case X86_BREAKPOINT_WRITE: | ||
| 238 | *gen_type = HW_BREAKPOINT_W; | ||
| 239 | break; | ||
| 240 | case X86_BREAKPOINT_RW: | ||
| 241 | *gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R; | ||
| 242 | break; | ||
| 243 | default: | ||
| 244 | return -EINVAL; | ||
| 245 | } | ||
| 246 | |||
| 247 | return 0; | 248 | return 0; |
| 248 | } | 249 | } |
| 249 | 250 | ||
| @@ -316,9 +317,6 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) | |||
| 316 | ret = -EINVAL; | 317 | ret = -EINVAL; |
| 317 | 318 | ||
| 318 | switch (info->len) { | 319 | switch (info->len) { |
| 319 | case X86_BREAKPOINT_LEN_X: | ||
| 320 | align = sizeof(long) -1; | ||
| 321 | break; | ||
| 322 | case X86_BREAKPOINT_LEN_1: | 320 | case X86_BREAKPOINT_LEN_1: |
| 323 | align = 0; | 321 | align = 0; |
| 324 | break; | 322 | break; |
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c index e0bc186d7501..1c355c550960 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c | |||
| @@ -239,11 +239,10 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 239 | apply_paravirt(pseg, pseg + para->sh_size); | 239 | apply_paravirt(pseg, pseg + para->sh_size); |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | return module_bug_finalize(hdr, sechdrs, me); | 242 | return 0; |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | void module_arch_cleanup(struct module *mod) | 245 | void module_arch_cleanup(struct module *mod) |
| 246 | { | 246 | { |
| 247 | alternatives_smp_module_del(mod); | 247 | alternatives_smp_module_del(mod); |
| 248 | module_bug_cleanup(mod); | ||
| 249 | } | 248 | } |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index bc5b9b8d4a33..8a3f9f64f86f 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
| @@ -766,7 +766,6 @@ static void init_vmcb(struct vcpu_svm *svm) | |||
| 766 | 766 | ||
| 767 | control->iopm_base_pa = iopm_base; | 767 | control->iopm_base_pa = iopm_base; |
| 768 | control->msrpm_base_pa = __pa(svm->msrpm); | 768 | control->msrpm_base_pa = __pa(svm->msrpm); |
| 769 | control->tsc_offset = 0; | ||
| 770 | control->int_ctl = V_INTR_MASKING_MASK; | 769 | control->int_ctl = V_INTR_MASKING_MASK; |
| 771 | 770 | ||
| 772 | init_seg(&save->es); | 771 | init_seg(&save->es); |
| @@ -902,6 +901,7 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) | |||
| 902 | svm->vmcb_pa = page_to_pfn(page) << PAGE_SHIFT; | 901 | svm->vmcb_pa = page_to_pfn(page) << PAGE_SHIFT; |
| 903 | svm->asid_generation = 0; | 902 | svm->asid_generation = 0; |
| 904 | init_vmcb(svm); | 903 | init_vmcb(svm); |
| 904 | svm->vmcb->control.tsc_offset = 0-native_read_tsc(); | ||
| 905 | 905 | ||
| 906 | err = fx_init(&svm->vcpu); | 906 | err = fx_init(&svm->vcpu); |
| 907 | if (err) | 907 | if (err) |
| @@ -3163,8 +3163,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) | |||
| 3163 | sync_lapic_to_cr8(vcpu); | 3163 | sync_lapic_to_cr8(vcpu); |
| 3164 | 3164 | ||
| 3165 | save_host_msrs(vcpu); | 3165 | save_host_msrs(vcpu); |
| 3166 | fs_selector = kvm_read_fs(); | 3166 | savesegment(fs, fs_selector); |
| 3167 | gs_selector = kvm_read_gs(); | 3167 | savesegment(gs, gs_selector); |
| 3168 | ldt_selector = kvm_read_ldt(); | 3168 | ldt_selector = kvm_read_ldt(); |
| 3169 | svm->vmcb->save.cr2 = vcpu->arch.cr2; | 3169 | svm->vmcb->save.cr2 = vcpu->arch.cr2; |
| 3170 | /* required for live migration with NPT */ | 3170 | /* required for live migration with NPT */ |
| @@ -3251,10 +3251,15 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) | |||
| 3251 | vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp; | 3251 | vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp; |
| 3252 | vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; | 3252 | vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; |
| 3253 | 3253 | ||
| 3254 | kvm_load_fs(fs_selector); | ||
| 3255 | kvm_load_gs(gs_selector); | ||
| 3256 | kvm_load_ldt(ldt_selector); | ||
| 3257 | load_host_msrs(vcpu); | 3254 | load_host_msrs(vcpu); |
| 3255 | loadsegment(fs, fs_selector); | ||
| 3256 | #ifdef CONFIG_X86_64 | ||
| 3257 | load_gs_index(gs_selector); | ||
| 3258 | wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs); | ||
| 3259 | #else | ||
| 3260 | loadsegment(gs, gs_selector); | ||
| 3261 | #endif | ||
| 3262 | kvm_load_ldt(ldt_selector); | ||
| 3258 | 3263 | ||
| 3259 | reload_tss(vcpu); | 3264 | reload_tss(vcpu); |
| 3260 | 3265 | ||
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 49b25eee25ac..7bddfab12013 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
| @@ -803,7 +803,7 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu) | |||
| 803 | */ | 803 | */ |
| 804 | vmx->host_state.ldt_sel = kvm_read_ldt(); | 804 | vmx->host_state.ldt_sel = kvm_read_ldt(); |
| 805 | vmx->host_state.gs_ldt_reload_needed = vmx->host_state.ldt_sel; | 805 | vmx->host_state.gs_ldt_reload_needed = vmx->host_state.ldt_sel; |
| 806 | vmx->host_state.fs_sel = kvm_read_fs(); | 806 | savesegment(fs, vmx->host_state.fs_sel); |
| 807 | if (!(vmx->host_state.fs_sel & 7)) { | 807 | if (!(vmx->host_state.fs_sel & 7)) { |
| 808 | vmcs_write16(HOST_FS_SELECTOR, vmx->host_state.fs_sel); | 808 | vmcs_write16(HOST_FS_SELECTOR, vmx->host_state.fs_sel); |
| 809 | vmx->host_state.fs_reload_needed = 0; | 809 | vmx->host_state.fs_reload_needed = 0; |
| @@ -811,7 +811,7 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu) | |||
| 811 | vmcs_write16(HOST_FS_SELECTOR, 0); | 811 | vmcs_write16(HOST_FS_SELECTOR, 0); |
| 812 | vmx->host_state.fs_reload_needed = 1; | 812 | vmx->host_state.fs_reload_needed = 1; |
| 813 | } | 813 | } |
| 814 | vmx->host_state.gs_sel = kvm_read_gs(); | 814 | savesegment(gs, vmx->host_state.gs_sel); |
| 815 | if (!(vmx->host_state.gs_sel & 7)) | 815 | if (!(vmx->host_state.gs_sel & 7)) |
| 816 | vmcs_write16(HOST_GS_SELECTOR, vmx->host_state.gs_sel); | 816 | vmcs_write16(HOST_GS_SELECTOR, vmx->host_state.gs_sel); |
| 817 | else { | 817 | else { |
| @@ -841,27 +841,21 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu) | |||
| 841 | 841 | ||
| 842 | static void __vmx_load_host_state(struct vcpu_vmx *vmx) | 842 | static void __vmx_load_host_state(struct vcpu_vmx *vmx) |
| 843 | { | 843 | { |
| 844 | unsigned long flags; | ||
| 845 | |||
| 846 | if (!vmx->host_state.loaded) | 844 | if (!vmx->host_state.loaded) |
| 847 | return; | 845 | return; |
| 848 | 846 | ||
| 849 | ++vmx->vcpu.stat.host_state_reload; | 847 | ++vmx->vcpu.stat.host_state_reload; |
| 850 | vmx->host_state.loaded = 0; | 848 | vmx->host_state.loaded = 0; |
| 851 | if (vmx->host_state.fs_reload_needed) | 849 | if (vmx->host_state.fs_reload_needed) |
| 852 | kvm_load_fs(vmx->host_state.fs_sel); | 850 | loadsegment(fs, vmx->host_state.fs_sel); |
| 853 | if (vmx->host_state.gs_ldt_reload_needed) { | 851 | if (vmx->host_state.gs_ldt_reload_needed) { |
| 854 | kvm_load_ldt(vmx->host_state.ldt_sel); | 852 | kvm_load_ldt(vmx->host_state.ldt_sel); |
| 855 | /* | ||
| 856 | * If we have to reload gs, we must take care to | ||
| 857 | * preserve our gs base. | ||
| 858 | */ | ||
| 859 | local_irq_save(flags); | ||
| 860 | kvm_load_gs(vmx->host_state.gs_sel); | ||
| 861 | #ifdef CONFIG_X86_64 | 853 | #ifdef CONFIG_X86_64 |
| 862 | wrmsrl(MSR_GS_BASE, vmcs_readl(HOST_GS_BASE)); | 854 | load_gs_index(vmx->host_state.gs_sel); |
| 855 | wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs); | ||
| 856 | #else | ||
| 857 | loadsegment(gs, vmx->host_state.gs_sel); | ||
| 863 | #endif | 858 | #endif |
| 864 | local_irq_restore(flags); | ||
| 865 | } | 859 | } |
| 866 | reload_tss(); | 860 | reload_tss(); |
| 867 | #ifdef CONFIG_X86_64 | 861 | #ifdef CONFIG_X86_64 |
| @@ -2589,8 +2583,8 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) | |||
| 2589 | vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */ | 2583 | vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */ |
| 2590 | vmcs_write16(HOST_DS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ | 2584 | vmcs_write16(HOST_DS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ |
| 2591 | vmcs_write16(HOST_ES_SELECTOR, __KERNEL_DS); /* 22.2.4 */ | 2585 | vmcs_write16(HOST_ES_SELECTOR, __KERNEL_DS); /* 22.2.4 */ |
| 2592 | vmcs_write16(HOST_FS_SELECTOR, kvm_read_fs()); /* 22.2.4 */ | 2586 | vmcs_write16(HOST_FS_SELECTOR, 0); /* 22.2.4 */ |
| 2593 | vmcs_write16(HOST_GS_SELECTOR, kvm_read_gs()); /* 22.2.4 */ | 2587 | vmcs_write16(HOST_GS_SELECTOR, 0); /* 22.2.4 */ |
| 2594 | vmcs_write16(HOST_SS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ | 2588 | vmcs_write16(HOST_SS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ |
| 2595 | #ifdef CONFIG_X86_64 | 2589 | #ifdef CONFIG_X86_64 |
| 2596 | rdmsrl(MSR_FS_BASE, a); | 2590 | rdmsrl(MSR_FS_BASE, a); |
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index 9257510b4836..9d5f55848455 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
| @@ -324,9 +324,8 @@ static void lguest_load_gdt(const struct desc_ptr *desc) | |||
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | /* | 326 | /* |
| 327 | * For a single GDT entry which changes, we do the lazy thing: alter our GDT, | 327 | * For a single GDT entry which changes, we simply change our copy and |
| 328 | * then tell the Host to reload the entire thing. This operation is so rare | 328 | * then tell the host about it. |
| 329 | * that this naive implementation is reasonable. | ||
| 330 | */ | 329 | */ |
| 331 | static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum, | 330 | static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum, |
| 332 | const void *desc, int type) | 331 | const void *desc, int type) |
| @@ -338,9 +337,13 @@ static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum, | |||
| 338 | } | 337 | } |
| 339 | 338 | ||
| 340 | /* | 339 | /* |
| 341 | * OK, I lied. There are three "thread local storage" GDT entries which change | 340 | * There are three "thread local storage" GDT entries which change |
| 342 | * on every context switch (these three entries are how glibc implements | 341 | * on every context switch (these three entries are how glibc implements |
| 343 | * __thread variables). So we have a hypercall specifically for this case. | 342 | * __thread variables). As an optimization, we have a hypercall |
| 343 | * specifically for this case. | ||
| 344 | * | ||
| 345 | * Wouldn't it be nicer to have a general LOAD_GDT_ENTRIES hypercall | ||
| 346 | * which took a range of entries? | ||
| 344 | */ | 347 | */ |
| 345 | static void lguest_load_tls(struct thread_struct *t, unsigned int cpu) | 348 | static void lguest_load_tls(struct thread_struct *t, unsigned int cpu) |
| 346 | { | 349 | { |
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index f9897f7a9ef1..9c0d0d399c30 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c | |||
| @@ -420,9 +420,11 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) | |||
| 420 | return -1; | 420 | return -1; |
| 421 | } | 421 | } |
| 422 | 422 | ||
| 423 | for_each_node_mask(i, nodes_parsed) | 423 | for (i = 0; i < num_node_memblks; i++) |
| 424 | e820_register_active_regions(i, nodes[i].start >> PAGE_SHIFT, | 424 | e820_register_active_regions(memblk_nodeid[i], |
| 425 | nodes[i].end >> PAGE_SHIFT); | 425 | node_memblk_range[i].start >> PAGE_SHIFT, |
| 426 | node_memblk_range[i].end >> PAGE_SHIFT); | ||
| 427 | |||
| 426 | /* for out of order entries in SRAT */ | 428 | /* for out of order entries in SRAT */ |
| 427 | sort_node_map(); | 429 | sort_node_map(); |
| 428 | if (!nodes_cover_memory(nodes)) { | 430 | if (!nodes_cover_memory(nodes)) { |
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index cfe4faabb0f6..f1575c9a2572 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
| @@ -671,7 +671,10 @@ static int __init ppro_init(char **cpu_type) | |||
| 671 | case 14: | 671 | case 14: |
| 672 | *cpu_type = "i386/core"; | 672 | *cpu_type = "i386/core"; |
| 673 | break; | 673 | break; |
| 674 | case 15: case 23: | 674 | case 0x0f: |
| 675 | case 0x16: | ||
| 676 | case 0x17: | ||
| 677 | case 0x1d: | ||
| 675 | *cpu_type = "i386/core_2"; | 678 | *cpu_type = "i386/core_2"; |
| 676 | break; | 679 | break; |
| 677 | case 0x1a: | 680 | case 0x1a: |
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 1a5353a753fc..b2bb5aa3b054 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
| @@ -489,8 +489,9 @@ static void xen_hvm_setup_cpu_clockevents(void) | |||
| 489 | __init void xen_hvm_init_time_ops(void) | 489 | __init void xen_hvm_init_time_ops(void) |
| 490 | { | 490 | { |
| 491 | /* vector callback is needed otherwise we cannot receive interrupts | 491 | /* vector callback is needed otherwise we cannot receive interrupts |
| 492 | * on cpu > 0 */ | 492 | * on cpu > 0 and at this point we don't know how many cpus are |
| 493 | if (!xen_have_vector_callback && num_present_cpus() > 1) | 493 | * available */ |
| 494 | if (!xen_have_vector_callback) | ||
| 494 | return; | 495 | return; |
| 495 | if (!xen_feature(XENFEAT_hvm_safe_pvclock)) { | 496 | if (!xen_feature(XENFEAT_hvm_safe_pvclock)) { |
| 496 | printk(KERN_INFO "Xen doesn't support pvclock on HVM," | 497 | printk(KERN_INFO "Xen doesn't support pvclock on HVM," |
diff --git a/block/blk-map.c b/block/blk-map.c index c65d7593f7f1..ade0a08c9099 100644 --- a/block/blk-map.c +++ b/block/blk-map.c | |||
| @@ -307,7 +307,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf, | |||
| 307 | return PTR_ERR(bio); | 307 | return PTR_ERR(bio); |
| 308 | 308 | ||
| 309 | if (rq_data_dir(rq) == WRITE) | 309 | if (rq_data_dir(rq) == WRITE) |
| 310 | bio->bi_rw |= (1 << REQ_WRITE); | 310 | bio->bi_rw |= REQ_WRITE; |
| 311 | 311 | ||
| 312 | if (do_copy) | 312 | if (do_copy) |
| 313 | rq->cmd_flags |= REQ_COPY_USER; | 313 | rq->cmd_flags |= REQ_COPY_USER; |
diff --git a/block/blk-merge.c b/block/blk-merge.c index 3b0cd4249671..eafc94f68d79 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c | |||
| @@ -362,6 +362,18 @@ static int attempt_merge(struct request_queue *q, struct request *req, | |||
| 362 | return 0; | 362 | return 0; |
| 363 | 363 | ||
| 364 | /* | 364 | /* |
| 365 | * Don't merge file system requests and discard requests | ||
| 366 | */ | ||
| 367 | if ((req->cmd_flags & REQ_DISCARD) != (next->cmd_flags & REQ_DISCARD)) | ||
| 368 | return 0; | ||
| 369 | |||
| 370 | /* | ||
| 371 | * Don't merge discard requests and secure discard requests | ||
| 372 | */ | ||
| 373 | if ((req->cmd_flags & REQ_SECURE) != (next->cmd_flags & REQ_SECURE)) | ||
| 374 | return 0; | ||
| 375 | |||
| 376 | /* | ||
| 365 | * not contiguous | 377 | * not contiguous |
| 366 | */ | 378 | */ |
| 367 | if (blk_rq_pos(req) + blk_rq_sectors(req) != blk_rq_pos(next)) | 379 | if (blk_rq_pos(req) + blk_rq_sectors(req) != blk_rq_pos(next)) |
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index f65c6f01c475..9eba291eb6fd 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
| @@ -1019,10 +1019,20 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create) | |||
| 1019 | */ | 1019 | */ |
| 1020 | atomic_set(&cfqg->ref, 1); | 1020 | atomic_set(&cfqg->ref, 1); |
| 1021 | 1021 | ||
| 1022 | /* Add group onto cgroup list */ | 1022 | /* |
| 1023 | sscanf(dev_name(bdi->dev), "%u:%u", &major, &minor); | 1023 | * Add group onto cgroup list. It might happen that bdi->dev is |
| 1024 | cfq_blkiocg_add_blkio_group(blkcg, &cfqg->blkg, (void *)cfqd, | 1024 | * not initiliazed yet. Initialize this new group without major |
| 1025 | * and minor info and this info will be filled in once a new thread | ||
| 1026 | * comes for IO. See code above. | ||
| 1027 | */ | ||
| 1028 | if (bdi->dev) { | ||
| 1029 | sscanf(dev_name(bdi->dev), "%u:%u", &major, &minor); | ||
| 1030 | cfq_blkiocg_add_blkio_group(blkcg, &cfqg->blkg, (void *)cfqd, | ||
| 1025 | MKDEV(major, minor)); | 1031 | MKDEV(major, minor)); |
| 1032 | } else | ||
| 1033 | cfq_blkiocg_add_blkio_group(blkcg, &cfqg->blkg, (void *)cfqd, | ||
| 1034 | 0); | ||
| 1035 | |||
| 1026 | cfqg->weight = blkcg_get_weight(blkcg, cfqg->blkg.dev); | 1036 | cfqg->weight = blkcg_get_weight(blkcg, cfqg->blkg.dev); |
| 1027 | 1037 | ||
| 1028 | /* Add group on cfqd list */ | 1038 | /* Add group on cfqd list */ |
diff --git a/block/elevator.c b/block/elevator.c index 205b09a5bd9e..4e11559aa2b0 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
| @@ -938,6 +938,7 @@ int elv_register_queue(struct request_queue *q) | |||
| 938 | } | 938 | } |
| 939 | } | 939 | } |
| 940 | kobject_uevent(&e->kobj, KOBJ_ADD); | 940 | kobject_uevent(&e->kobj, KOBJ_ADD); |
| 941 | e->registered = 1; | ||
| 941 | } | 942 | } |
| 942 | return error; | 943 | return error; |
| 943 | } | 944 | } |
| @@ -947,6 +948,7 @@ static void __elv_unregister_queue(struct elevator_queue *e) | |||
| 947 | { | 948 | { |
| 948 | kobject_uevent(&e->kobj, KOBJ_REMOVE); | 949 | kobject_uevent(&e->kobj, KOBJ_REMOVE); |
| 949 | kobject_del(&e->kobj); | 950 | kobject_del(&e->kobj); |
| 951 | e->registered = 0; | ||
| 950 | } | 952 | } |
| 951 | 953 | ||
| 952 | void elv_unregister_queue(struct request_queue *q) | 954 | void elv_unregister_queue(struct request_queue *q) |
| @@ -1042,11 +1044,13 @@ static int elevator_switch(struct request_queue *q, struct elevator_type *new_e) | |||
| 1042 | 1044 | ||
| 1043 | spin_unlock_irq(q->queue_lock); | 1045 | spin_unlock_irq(q->queue_lock); |
| 1044 | 1046 | ||
| 1045 | __elv_unregister_queue(old_elevator); | 1047 | if (old_elevator->registered) { |
| 1048 | __elv_unregister_queue(old_elevator); | ||
| 1046 | 1049 | ||
| 1047 | err = elv_register_queue(q); | 1050 | err = elv_register_queue(q); |
| 1048 | if (err) | 1051 | if (err) |
| 1049 | goto fail_register; | 1052 | goto fail_register; |
| 1053 | } | ||
| 1050 | 1054 | ||
| 1051 | /* | 1055 | /* |
| 1052 | * finally exit old elevator and turn off BYPASS. | 1056 | * finally exit old elevator and turn off BYPASS. |
diff --git a/drivers/Makefile b/drivers/Makefile index ae473445ad6d..a2aea53a75ed 100644 --- a/drivers/Makefile +++ b/drivers/Makefile | |||
| @@ -50,7 +50,7 @@ obj-$(CONFIG_SPI) += spi/ | |||
| 50 | obj-y += net/ | 50 | obj-y += net/ |
| 51 | obj-$(CONFIG_ATM) += atm/ | 51 | obj-$(CONFIG_ATM) += atm/ |
| 52 | obj-$(CONFIG_FUSION) += message/ | 52 | obj-$(CONFIG_FUSION) += message/ |
| 53 | obj-$(CONFIG_FIREWIRE) += firewire/ | 53 | obj-y += firewire/ |
| 54 | obj-y += ieee1394/ | 54 | obj-y += ieee1394/ |
| 55 | obj-$(CONFIG_UIO) += uio/ | 55 | obj-$(CONFIG_UIO) += uio/ |
| 56 | obj-y += cdrom/ | 56 | obj-y += cdrom/ |
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index b811f2173f6f..88681aca88c5 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
| @@ -105,7 +105,7 @@ config ACPI_EC_DEBUGFS | |||
| 105 | 105 | ||
| 106 | Be aware that using this interface can confuse your Embedded | 106 | Be aware that using this interface can confuse your Embedded |
| 107 | Controller in a way that a normal reboot is not enough. You then | 107 | Controller in a way that a normal reboot is not enough. You then |
| 108 | have to power of your system, and remove the laptop battery for | 108 | have to power off your system, and remove the laptop battery for |
| 109 | some seconds. | 109 | some seconds. |
| 110 | An Embedded Controller typically is available on laptops and reads | 110 | An Embedded Controller typically is available on laptops and reads |
| 111 | sensor values like battery state and temperature. | 111 | sensor values like battery state and temperature. |
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index b76848c80be3..6b115f6c4313 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c | |||
| @@ -382,31 +382,32 @@ static void acpi_pad_remove_sysfs(struct acpi_device *device) | |||
| 382 | device_remove_file(&device->dev, &dev_attr_rrtime); | 382 | device_remove_file(&device->dev, &dev_attr_rrtime); |
| 383 | } | 383 | } |
| 384 | 384 | ||
| 385 | /* Query firmware how many CPUs should be idle */ | 385 | /* |
| 386 | static int acpi_pad_pur(acpi_handle handle, int *num_cpus) | 386 | * Query firmware how many CPUs should be idle |
| 387 | * return -1 on failure | ||
| 388 | */ | ||
| 389 | static int acpi_pad_pur(acpi_handle handle) | ||
| 387 | { | 390 | { |
| 388 | struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; | 391 | struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; |
| 389 | union acpi_object *package; | 392 | union acpi_object *package; |
| 390 | int rev, num, ret = -EINVAL; | 393 | int num = -1; |
| 391 | 394 | ||
| 392 | if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer))) | 395 | if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer))) |
| 393 | return -EINVAL; | 396 | return num; |
| 394 | 397 | ||
| 395 | if (!buffer.length || !buffer.pointer) | 398 | if (!buffer.length || !buffer.pointer) |
| 396 | return -EINVAL; | 399 | return num; |
| 397 | 400 | ||
| 398 | package = buffer.pointer; | 401 | package = buffer.pointer; |
| 399 | if (package->type != ACPI_TYPE_PACKAGE || package->package.count != 2) | 402 | |
| 400 | goto out; | 403 | if (package->type == ACPI_TYPE_PACKAGE && |
| 401 | rev = package->package.elements[0].integer.value; | 404 | package->package.count == 2 && |
| 402 | num = package->package.elements[1].integer.value; | 405 | package->package.elements[0].integer.value == 1) /* rev 1 */ |
| 403 | if (rev != 1 || num < 0) | 406 | |
| 404 | goto out; | 407 | num = package->package.elements[1].integer.value; |
| 405 | *num_cpus = num; | 408 | |
| 406 | ret = 0; | ||
| 407 | out: | ||
| 408 | kfree(buffer.pointer); | 409 | kfree(buffer.pointer); |
| 409 | return ret; | 410 | return num; |
| 410 | } | 411 | } |
| 411 | 412 | ||
| 412 | /* Notify firmware how many CPUs are idle */ | 413 | /* Notify firmware how many CPUs are idle */ |
| @@ -433,7 +434,8 @@ static void acpi_pad_handle_notify(acpi_handle handle) | |||
| 433 | uint32_t idle_cpus; | 434 | uint32_t idle_cpus; |
| 434 | 435 | ||
| 435 | mutex_lock(&isolated_cpus_lock); | 436 | mutex_lock(&isolated_cpus_lock); |
| 436 | if (acpi_pad_pur(handle, &num_cpus)) { | 437 | num_cpus = acpi_pad_pur(handle); |
| 438 | if (num_cpus < 0) { | ||
| 437 | mutex_unlock(&isolated_cpus_lock); | 439 | mutex_unlock(&isolated_cpus_lock); |
| 438 | return; | 440 | return; |
| 439 | } | 441 | } |
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index df85b53a674f..7dad9160f209 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
| @@ -854,6 +854,7 @@ struct acpi_bit_register_info { | |||
| 854 | ACPI_BITMASK_POWER_BUTTON_STATUS | \ | 854 | ACPI_BITMASK_POWER_BUTTON_STATUS | \ |
| 855 | ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ | 855 | ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ |
| 856 | ACPI_BITMASK_RT_CLOCK_STATUS | \ | 856 | ACPI_BITMASK_RT_CLOCK_STATUS | \ |
| 857 | ACPI_BITMASK_PCIEXP_WAKE_DISABLE | \ | ||
| 857 | ACPI_BITMASK_WAKE_STATUS) | 858 | ACPI_BITMASK_WAKE_STATUS) |
| 858 | 859 | ||
| 859 | #define ACPI_BITMASK_TIMER_ENABLE 0x0001 | 860 | #define ACPI_BITMASK_TIMER_ENABLE 0x0001 |
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c index 74c24d517f81..4093522eed45 100644 --- a/drivers/acpi/acpica/exutils.c +++ b/drivers/acpi/acpica/exutils.c | |||
| @@ -109,7 +109,7 @@ void acpi_ex_enter_interpreter(void) | |||
| 109 | * | 109 | * |
| 110 | * DESCRIPTION: Reacquire the interpreter execution region from within the | 110 | * DESCRIPTION: Reacquire the interpreter execution region from within the |
| 111 | * interpreter code. Failure to enter the interpreter region is a | 111 | * interpreter code. Failure to enter the interpreter region is a |
| 112 | * fatal system error. Used in conjuction with | 112 | * fatal system error. Used in conjunction with |
| 113 | * relinquish_interpreter | 113 | * relinquish_interpreter |
| 114 | * | 114 | * |
| 115 | ******************************************************************************/ | 115 | ******************************************************************************/ |
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c index 22cfcfbd9fff..491191e6cf69 100644 --- a/drivers/acpi/acpica/rsutils.c +++ b/drivers/acpi/acpica/rsutils.c | |||
| @@ -149,7 +149,7 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type) | |||
| 149 | 149 | ||
| 150 | /* | 150 | /* |
| 151 | * 16-, 32-, and 64-bit cases must use the move macros that perform | 151 | * 16-, 32-, and 64-bit cases must use the move macros that perform |
| 152 | * endian conversion and/or accomodate hardware that cannot perform | 152 | * endian conversion and/or accommodate hardware that cannot perform |
| 153 | * misaligned memory transfers | 153 | * misaligned memory transfers |
| 154 | */ | 154 | */ |
| 155 | case ACPI_RSC_MOVE16: | 155 | case ACPI_RSC_MOVE16: |
diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig index 907e350f1c7d..fca34ccfd294 100644 --- a/drivers/acpi/apei/Kconfig +++ b/drivers/acpi/apei/Kconfig | |||
| @@ -34,6 +34,6 @@ config ACPI_APEI_ERST_DEBUG | |||
| 34 | depends on ACPI_APEI | 34 | depends on ACPI_APEI |
| 35 | help | 35 | help |
| 36 | ERST is a way provided by APEI to save and retrieve hardware | 36 | ERST is a way provided by APEI to save and retrieve hardware |
| 37 | error infomation to and from a persistent store. Enable this | 37 | error information to and from a persistent store. Enable this |
| 38 | if you want to debugging and testing the ERST kernel support | 38 | if you want to debugging and testing the ERST kernel support |
| 39 | and firmware implementation. | 39 | and firmware implementation. |
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c index 73fd0c7487c1..4a904a4bf05f 100644 --- a/drivers/acpi/apei/apei-base.c +++ b/drivers/acpi/apei/apei-base.c | |||
| @@ -445,11 +445,15 @@ EXPORT_SYMBOL_GPL(apei_resources_sub); | |||
| 445 | int apei_resources_request(struct apei_resources *resources, | 445 | int apei_resources_request(struct apei_resources *resources, |
| 446 | const char *desc) | 446 | const char *desc) |
| 447 | { | 447 | { |
| 448 | struct apei_res *res, *res_bak; | 448 | struct apei_res *res, *res_bak = NULL; |
| 449 | struct resource *r; | 449 | struct resource *r; |
| 450 | int rc; | ||
| 450 | 451 | ||
| 451 | apei_resources_sub(resources, &apei_resources_all); | 452 | rc = apei_resources_sub(resources, &apei_resources_all); |
| 453 | if (rc) | ||
| 454 | return rc; | ||
| 452 | 455 | ||
| 456 | rc = -EINVAL; | ||
| 453 | list_for_each_entry(res, &resources->iomem, list) { | 457 | list_for_each_entry(res, &resources->iomem, list) { |
| 454 | r = request_mem_region(res->start, res->end - res->start, | 458 | r = request_mem_region(res->start, res->end - res->start, |
| 455 | desc); | 459 | desc); |
| @@ -475,7 +479,11 @@ int apei_resources_request(struct apei_resources *resources, | |||
| 475 | } | 479 | } |
| 476 | } | 480 | } |
| 477 | 481 | ||
| 478 | apei_resources_merge(&apei_resources_all, resources); | 482 | rc = apei_resources_merge(&apei_resources_all, resources); |
| 483 | if (rc) { | ||
| 484 | pr_err(APEI_PFX "Fail to merge resources!\n"); | ||
| 485 | goto err_unmap_ioport; | ||
| 486 | } | ||
| 479 | 487 | ||
| 480 | return 0; | 488 | return 0; |
| 481 | err_unmap_ioport: | 489 | err_unmap_ioport: |
| @@ -491,12 +499,13 @@ err_unmap_iomem: | |||
| 491 | break; | 499 | break; |
| 492 | release_mem_region(res->start, res->end - res->start); | 500 | release_mem_region(res->start, res->end - res->start); |
| 493 | } | 501 | } |
| 494 | return -EINVAL; | 502 | return rc; |
| 495 | } | 503 | } |
| 496 | EXPORT_SYMBOL_GPL(apei_resources_request); | 504 | EXPORT_SYMBOL_GPL(apei_resources_request); |
| 497 | 505 | ||
| 498 | void apei_resources_release(struct apei_resources *resources) | 506 | void apei_resources_release(struct apei_resources *resources) |
| 499 | { | 507 | { |
| 508 | int rc; | ||
| 500 | struct apei_res *res; | 509 | struct apei_res *res; |
| 501 | 510 | ||
| 502 | list_for_each_entry(res, &resources->iomem, list) | 511 | list_for_each_entry(res, &resources->iomem, list) |
| @@ -504,7 +513,9 @@ void apei_resources_release(struct apei_resources *resources) | |||
| 504 | list_for_each_entry(res, &resources->ioport, list) | 513 | list_for_each_entry(res, &resources->ioport, list) |
| 505 | release_region(res->start, res->end - res->start); | 514 | release_region(res->start, res->end - res->start); |
| 506 | 515 | ||
| 507 | apei_resources_sub(&apei_resources_all, resources); | 516 | rc = apei_resources_sub(&apei_resources_all, resources); |
| 517 | if (rc) | ||
| 518 | pr_err(APEI_PFX "Fail to sub resources!\n"); | ||
| 508 | } | 519 | } |
| 509 | EXPORT_SYMBOL_GPL(apei_resources_release); | 520 | EXPORT_SYMBOL_GPL(apei_resources_release); |
| 510 | 521 | ||
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index 465c885938ee..cf29df69380b 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c | |||
| @@ -426,7 +426,9 @@ DEFINE_SIMPLE_ATTRIBUTE(error_inject_fops, NULL, | |||
| 426 | 426 | ||
| 427 | static int einj_check_table(struct acpi_table_einj *einj_tab) | 427 | static int einj_check_table(struct acpi_table_einj *einj_tab) |
| 428 | { | 428 | { |
| 429 | if (einj_tab->header_length != sizeof(struct acpi_table_einj)) | 429 | if ((einj_tab->header_length != |
| 430 | (sizeof(struct acpi_table_einj) - sizeof(einj_tab->header))) | ||
| 431 | && (einj_tab->header_length != sizeof(struct acpi_table_einj))) | ||
| 430 | return -EINVAL; | 432 | return -EINVAL; |
| 431 | if (einj_tab->header.length < sizeof(struct acpi_table_einj)) | 433 | if (einj_tab->header.length < sizeof(struct acpi_table_einj)) |
| 432 | return -EINVAL; | 434 | return -EINVAL; |
diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c index 5281ddda2777..da1228a9a544 100644 --- a/drivers/acpi/apei/erst-dbg.c +++ b/drivers/acpi/apei/erst-dbg.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * APEI Error Record Serialization Table debug support | 2 | * APEI Error Record Serialization Table debug support |
| 3 | * | 3 | * |
| 4 | * ERST is a way provided by APEI to save and retrieve hardware error | 4 | * ERST is a way provided by APEI to save and retrieve hardware error |
| 5 | * infomation to and from a persistent store. This file provide the | 5 | * information to and from a persistent store. This file provide the |
| 6 | * debugging/testing support for ERST kernel support and firmware | 6 | * debugging/testing support for ERST kernel support and firmware |
| 7 | * implementation. | 7 | * implementation. |
| 8 | * | 8 | * |
| @@ -111,11 +111,13 @@ retry: | |||
| 111 | goto out; | 111 | goto out; |
| 112 | } | 112 | } |
| 113 | if (len > erst_dbg_buf_len) { | 113 | if (len > erst_dbg_buf_len) { |
| 114 | kfree(erst_dbg_buf); | 114 | void *p; |
| 115 | rc = -ENOMEM; | 115 | rc = -ENOMEM; |
| 116 | erst_dbg_buf = kmalloc(len, GFP_KERNEL); | 116 | p = kmalloc(len, GFP_KERNEL); |
| 117 | if (!erst_dbg_buf) | 117 | if (!p) |
| 118 | goto out; | 118 | goto out; |
| 119 | kfree(erst_dbg_buf); | ||
| 120 | erst_dbg_buf = p; | ||
| 119 | erst_dbg_buf_len = len; | 121 | erst_dbg_buf_len = len; |
| 120 | goto retry; | 122 | goto retry; |
| 121 | } | 123 | } |
| @@ -150,11 +152,13 @@ static ssize_t erst_dbg_write(struct file *filp, const char __user *ubuf, | |||
| 150 | if (mutex_lock_interruptible(&erst_dbg_mutex)) | 152 | if (mutex_lock_interruptible(&erst_dbg_mutex)) |
| 151 | return -EINTR; | 153 | return -EINTR; |
| 152 | if (usize > erst_dbg_buf_len) { | 154 | if (usize > erst_dbg_buf_len) { |
| 153 | kfree(erst_dbg_buf); | 155 | void *p; |
| 154 | rc = -ENOMEM; | 156 | rc = -ENOMEM; |
| 155 | erst_dbg_buf = kmalloc(usize, GFP_KERNEL); | 157 | p = kmalloc(usize, GFP_KERNEL); |
| 156 | if (!erst_dbg_buf) | 158 | if (!p) |
| 157 | goto out; | 159 | goto out; |
| 160 | kfree(erst_dbg_buf); | ||
| 161 | erst_dbg_buf = p; | ||
| 158 | erst_dbg_buf_len = usize; | 162 | erst_dbg_buf_len = usize; |
| 159 | } | 163 | } |
| 160 | rc = copy_from_user(erst_dbg_buf, ubuf, usize); | 164 | rc = copy_from_user(erst_dbg_buf, ubuf, usize); |
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index 18645f4e83cd..1211c03149e8 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * APEI Error Record Serialization Table support | 2 | * APEI Error Record Serialization Table support |
| 3 | * | 3 | * |
| 4 | * ERST is a way provided by APEI to save and retrieve hardware error | 4 | * ERST is a way provided by APEI to save and retrieve hardware error |
| 5 | * infomation to and from a persistent store. | 5 | * information to and from a persistent store. |
| 6 | * | 6 | * |
| 7 | * For more information about ERST, please refer to ACPI Specification | 7 | * For more information about ERST, please refer to ACPI Specification |
| 8 | * version 4.0, section 17.4. | 8 | * version 4.0, section 17.4. |
| @@ -266,13 +266,30 @@ static int erst_exec_move_data(struct apei_exec_context *ctx, | |||
| 266 | { | 266 | { |
| 267 | int rc; | 267 | int rc; |
| 268 | u64 offset; | 268 | u64 offset; |
| 269 | void *src, *dst; | ||
| 270 | |||
| 271 | /* ioremap does not work in interrupt context */ | ||
| 272 | if (in_interrupt()) { | ||
| 273 | pr_warning(ERST_PFX | ||
| 274 | "MOVE_DATA can not be used in interrupt context"); | ||
| 275 | return -EBUSY; | ||
| 276 | } | ||
| 269 | 277 | ||
| 270 | rc = __apei_exec_read_register(entry, &offset); | 278 | rc = __apei_exec_read_register(entry, &offset); |
| 271 | if (rc) | 279 | if (rc) |
| 272 | return rc; | 280 | return rc; |
| 273 | memmove((void *)ctx->dst_base + offset, | 281 | |
| 274 | (void *)ctx->src_base + offset, | 282 | src = ioremap(ctx->src_base + offset, ctx->var2); |
| 275 | ctx->var2); | 283 | if (!src) |
| 284 | return -ENOMEM; | ||
| 285 | dst = ioremap(ctx->dst_base + offset, ctx->var2); | ||
| 286 | if (!dst) | ||
| 287 | return -ENOMEM; | ||
| 288 | |||
| 289 | memmove(dst, src, ctx->var2); | ||
| 290 | |||
| 291 | iounmap(src); | ||
| 292 | iounmap(dst); | ||
| 276 | 293 | ||
| 277 | return 0; | 294 | return 0; |
| 278 | } | 295 | } |
| @@ -750,7 +767,9 @@ __setup("erst_disable", setup_erst_disable); | |||
| 750 | 767 | ||
| 751 | static int erst_check_table(struct acpi_table_erst *erst_tab) | 768 | static int erst_check_table(struct acpi_table_erst *erst_tab) |
| 752 | { | 769 | { |
| 753 | if (erst_tab->header_length != sizeof(struct acpi_table_erst)) | 770 | if ((erst_tab->header_length != |
| 771 | (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header))) | ||
| 772 | && (erst_tab->header_length != sizeof(struct acpi_table_einj))) | ||
| 754 | return -EINVAL; | 773 | return -EINVAL; |
| 755 | if (erst_tab->header.length < sizeof(struct acpi_table_erst)) | 774 | if (erst_tab->header.length < sizeof(struct acpi_table_erst)) |
| 756 | return -EINVAL; | 775 | return -EINVAL; |
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 385a6059714a..0d505e59214d 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c | |||
| @@ -302,7 +302,7 @@ static int __devinit ghes_probe(struct platform_device *ghes_dev) | |||
| 302 | struct ghes *ghes = NULL; | 302 | struct ghes *ghes = NULL; |
| 303 | int rc = -EINVAL; | 303 | int rc = -EINVAL; |
| 304 | 304 | ||
| 305 | generic = ghes_dev->dev.platform_data; | 305 | generic = *(struct acpi_hest_generic **)ghes_dev->dev.platform_data; |
| 306 | if (!generic->enabled) | 306 | if (!generic->enabled) |
| 307 | return -ENODEV; | 307 | return -ENODEV; |
| 308 | 308 | ||
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c index 343168d18266..1a3508a7fe03 100644 --- a/drivers/acpi/apei/hest.c +++ b/drivers/acpi/apei/hest.c | |||
| @@ -137,20 +137,23 @@ static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data) | |||
| 137 | 137 | ||
| 138 | static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data) | 138 | static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data) |
| 139 | { | 139 | { |
| 140 | struct acpi_hest_generic *generic; | ||
| 141 | struct platform_device *ghes_dev; | 140 | struct platform_device *ghes_dev; |
| 142 | struct ghes_arr *ghes_arr = data; | 141 | struct ghes_arr *ghes_arr = data; |
| 143 | int rc; | 142 | int rc; |
| 144 | 143 | ||
| 145 | if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR) | 144 | if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR) |
| 146 | return 0; | 145 | return 0; |
| 147 | generic = (struct acpi_hest_generic *)hest_hdr; | 146 | |
| 148 | if (!generic->enabled) | 147 | if (!((struct acpi_hest_generic *)hest_hdr)->enabled) |
| 149 | return 0; | 148 | return 0; |
| 150 | ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id); | 149 | ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id); |
| 151 | if (!ghes_dev) | 150 | if (!ghes_dev) |
| 152 | return -ENOMEM; | 151 | return -ENOMEM; |
| 153 | ghes_dev->dev.platform_data = generic; | 152 | |
| 153 | rc = platform_device_add_data(ghes_dev, &hest_hdr, sizeof(void *)); | ||
| 154 | if (rc) | ||
| 155 | goto err; | ||
| 156 | |||
| 154 | rc = platform_device_add(ghes_dev); | 157 | rc = platform_device_add(ghes_dev); |
| 155 | if (rc) | 158 | if (rc) |
| 156 | goto err; | 159 | goto err; |
diff --git a/drivers/acpi/atomicio.c b/drivers/acpi/atomicio.c index 8f8bd736d4ff..542e53903891 100644 --- a/drivers/acpi/atomicio.c +++ b/drivers/acpi/atomicio.c | |||
| @@ -142,7 +142,7 @@ static void __iomem *acpi_pre_map(phys_addr_t paddr, | |||
| 142 | list_add_tail_rcu(&map->list, &acpi_iomaps); | 142 | list_add_tail_rcu(&map->list, &acpi_iomaps); |
| 143 | spin_unlock_irqrestore(&acpi_iomaps_lock, flags); | 143 | spin_unlock_irqrestore(&acpi_iomaps_lock, flags); |
| 144 | 144 | ||
| 145 | return vaddr + (paddr - pg_off); | 145 | return map->vaddr + (paddr - map->paddr); |
| 146 | err_unmap: | 146 | err_unmap: |
| 147 | iounmap(vaddr); | 147 | iounmap(vaddr); |
| 148 | return NULL; | 148 | return NULL; |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index dc58402b0a17..98417201e9ce 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
| @@ -273,7 +273,6 @@ static enum power_supply_property energy_battery_props[] = { | |||
| 273 | POWER_SUPPLY_PROP_CYCLE_COUNT, | 273 | POWER_SUPPLY_PROP_CYCLE_COUNT, |
| 274 | POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, | 274 | POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, |
| 275 | POWER_SUPPLY_PROP_VOLTAGE_NOW, | 275 | POWER_SUPPLY_PROP_VOLTAGE_NOW, |
| 276 | POWER_SUPPLY_PROP_CURRENT_NOW, | ||
| 277 | POWER_SUPPLY_PROP_POWER_NOW, | 276 | POWER_SUPPLY_PROP_POWER_NOW, |
| 278 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, | 277 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, |
| 279 | POWER_SUPPLY_PROP_ENERGY_FULL, | 278 | POWER_SUPPLY_PROP_ENERGY_FULL, |
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index 2bb28b9d91c4..af308d03f492 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c | |||
| @@ -183,6 +183,8 @@ static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) | |||
| 183 | { | 183 | { |
| 184 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); | 184 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); |
| 185 | acpi_osi_setup("!Windows 2006"); | 185 | acpi_osi_setup("!Windows 2006"); |
| 186 | acpi_osi_setup("!Windows 2006 SP1"); | ||
| 187 | acpi_osi_setup("!Windows 2006 SP2"); | ||
| 186 | return 0; | 188 | return 0; |
| 187 | } | 189 | } |
| 188 | static int __init dmi_disable_osi_win7(const struct dmi_system_id *d) | 190 | static int __init dmi_disable_osi_win7(const struct dmi_system_id *d) |
| @@ -202,6 +204,23 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
| 202 | }, | 204 | }, |
| 203 | }, | 205 | }, |
| 204 | { | 206 | { |
| 207 | /* | ||
| 208 | * There have a NVIF method in MSI GX723 DSDT need call by Nvidia | ||
| 209 | * driver (e.g. nouveau) when user press brightness hotkey. | ||
| 210 | * Currently, nouveau driver didn't do the job and it causes there | ||
| 211 | * have a infinite while loop in DSDT when user press hotkey. | ||
| 212 | * We add MSI GX723's dmi information to this table for workaround | ||
| 213 | * this issue. | ||
| 214 | * Will remove MSI GX723 from the table after nouveau grows support. | ||
| 215 | */ | ||
| 216 | .callback = dmi_disable_osi_vista, | ||
| 217 | .ident = "MSI GX723", | ||
| 218 | .matches = { | ||
| 219 | DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), | ||
| 220 | DMI_MATCH(DMI_PRODUCT_NAME, "GX723"), | ||
| 221 | }, | ||
| 222 | }, | ||
| 223 | { | ||
| 205 | .callback = dmi_disable_osi_vista, | 224 | .callback = dmi_disable_osi_vista, |
| 206 | .ident = "Sony VGN-NS10J_S", | 225 | .ident = "Sony VGN-NS10J_S", |
| 207 | .matches = { | 226 | .matches = { |
| @@ -226,6 +245,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
| 226 | }, | 245 | }, |
| 227 | }, | 246 | }, |
| 228 | { | 247 | { |
| 248 | .callback = dmi_disable_osi_vista, | ||
| 249 | .ident = "Toshiba Satellite L355", | ||
| 250 | .matches = { | ||
| 251 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
| 252 | DMI_MATCH(DMI_PRODUCT_VERSION, "Satellite L355"), | ||
| 253 | }, | ||
| 254 | }, | ||
| 255 | { | ||
| 229 | .callback = dmi_disable_osi_win7, | 256 | .callback = dmi_disable_osi_win7, |
| 230 | .ident = "ASUS K50IJ", | 257 | .ident = "ASUS K50IJ", |
| 231 | .matches = { | 258 | .matches = { |
| @@ -233,6 +260,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
| 233 | DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"), | 260 | DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"), |
| 234 | }, | 261 | }, |
| 235 | }, | 262 | }, |
| 263 | { | ||
| 264 | .callback = dmi_disable_osi_vista, | ||
| 265 | .ident = "Toshiba P305D", | ||
| 266 | .matches = { | ||
| 267 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
| 268 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P305D"), | ||
| 269 | }, | ||
| 270 | }, | ||
| 236 | 271 | ||
| 237 | /* | 272 | /* |
| 238 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. | 273 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 5c221ab535d5..310e3b9749cb 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
| @@ -55,7 +55,7 @@ EXPORT_SYMBOL(acpi_root_dir); | |||
| 55 | static int set_power_nocheck(const struct dmi_system_id *id) | 55 | static int set_power_nocheck(const struct dmi_system_id *id) |
| 56 | { | 56 | { |
| 57 | printk(KERN_NOTICE PREFIX "%s detected - " | 57 | printk(KERN_NOTICE PREFIX "%s detected - " |
| 58 | "disable power check in power transistion\n", id->ident); | 58 | "disable power check in power transition\n", id->ident); |
| 59 | acpi_power_nocheck = 1; | 59 | acpi_power_nocheck = 1; |
| 60 | return 0; | 60 | return 0; |
| 61 | } | 61 | } |
| @@ -80,23 +80,15 @@ static int set_copy_dsdt(const struct dmi_system_id *id) | |||
| 80 | 80 | ||
| 81 | static struct dmi_system_id dsdt_dmi_table[] __initdata = { | 81 | static struct dmi_system_id dsdt_dmi_table[] __initdata = { |
| 82 | /* | 82 | /* |
| 83 | * Insyde BIOS on some TOSHIBA machines corrupt the DSDT. | 83 | * Invoke DSDT corruption work-around on all Toshiba Satellite. |
| 84 | * https://bugzilla.kernel.org/show_bug.cgi?id=14679 | 84 | * https://bugzilla.kernel.org/show_bug.cgi?id=14679 |
| 85 | */ | 85 | */ |
| 86 | { | 86 | { |
| 87 | .callback = set_copy_dsdt, | 87 | .callback = set_copy_dsdt, |
| 88 | .ident = "TOSHIBA Satellite A505", | 88 | .ident = "TOSHIBA Satellite", |
| 89 | .matches = { | 89 | .matches = { |
| 90 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 90 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
| 91 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A505"), | 91 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"), |
| 92 | }, | ||
| 93 | }, | ||
| 94 | { | ||
| 95 | .callback = set_copy_dsdt, | ||
| 96 | .ident = "TOSHIBA Satellite L505D", | ||
| 97 | .matches = { | ||
| 98 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
| 99 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L505D"), | ||
| 100 | }, | 92 | }, |
| 101 | }, | 93 | }, |
| 102 | {} | 94 | {} |
| @@ -1027,7 +1019,7 @@ static int __init acpi_init(void) | |||
| 1027 | 1019 | ||
| 1028 | /* | 1020 | /* |
| 1029 | * If the laptop falls into the DMI check table, the power state check | 1021 | * If the laptop falls into the DMI check table, the power state check |
| 1030 | * will be disabled in the course of device power transistion. | 1022 | * will be disabled in the course of device power transition. |
| 1031 | */ | 1023 | */ |
| 1032 | dmi_check_system(power_nocheck_dmi_table); | 1024 | dmi_check_system(power_nocheck_dmi_table); |
| 1033 | 1025 | ||
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 8a3b840c0bb2..d94d2953c974 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
| @@ -369,7 +369,9 @@ static void __exit acpi_fan_exit(void) | |||
| 369 | 369 | ||
| 370 | acpi_bus_unregister_driver(&acpi_fan_driver); | 370 | acpi_bus_unregister_driver(&acpi_fan_driver); |
| 371 | 371 | ||
| 372 | #ifdef CONFIG_ACPI_PROCFS | ||
| 372 | remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); | 373 | remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); |
| 374 | #endif | ||
| 373 | 375 | ||
| 374 | return; | 376 | return; |
| 375 | } | 377 | } |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index e9699aaed109..bec561c14beb 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
| @@ -29,12 +29,6 @@ static int set_no_mwait(const struct dmi_system_id *id) | |||
| 29 | 29 | ||
| 30 | static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = { | 30 | static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = { |
| 31 | { | 31 | { |
| 32 | set_no_mwait, "IFL91 board", { | ||
| 33 | DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"), | ||
| 34 | DMI_MATCH(DMI_SYS_VENDOR, "ZEPTO"), | ||
| 35 | DMI_MATCH(DMI_PRODUCT_VERSION, "3215W"), | ||
| 36 | DMI_MATCH(DMI_BOARD_NAME, "IFL91") }, NULL}, | ||
| 37 | { | ||
| 38 | set_no_mwait, "Extensa 5220", { | 32 | set_no_mwait, "Extensa 5220", { |
| 39 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), | 33 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), |
| 40 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | 34 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
| @@ -352,4 +346,5 @@ void __init acpi_early_processor_set_pdc(void) | |||
| 352 | acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, | 346 | acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, |
| 353 | ACPI_UINT32_MAX, | 347 | ACPI_UINT32_MAX, |
| 354 | early_init_pdc, NULL, NULL, NULL); | 348 | early_init_pdc, NULL, NULL, NULL); |
| 349 | acpi_get_devices("ACPI0007", early_init_pdc, NULL, NULL); | ||
| 355 | } | 350 | } |
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 156021892389..347eb21b2353 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
| @@ -850,7 +850,7 @@ static int __init acpi_processor_init(void) | |||
| 850 | printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", | 850 | printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", |
| 851 | acpi_idle_driver.name); | 851 | acpi_idle_driver.name); |
| 852 | } else { | 852 | } else { |
| 853 | printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s", | 853 | printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s\n", |
| 854 | cpuidle_get_driver()->name); | 854 | cpuidle_get_driver()->name); |
| 855 | } | 855 | } |
| 856 | 856 | ||
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index ba1bd263d903..3a73a93596e8 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
| @@ -447,8 +447,8 @@ int acpi_processor_notify_smm(struct module *calling_module) | |||
| 447 | if (!try_module_get(calling_module)) | 447 | if (!try_module_get(calling_module)) |
| 448 | return -EINVAL; | 448 | return -EINVAL; |
| 449 | 449 | ||
| 450 | /* is_done is set to negative if an error occured, | 450 | /* is_done is set to negative if an error occurred, |
| 451 | * and to postitive if _no_ error occured, but SMM | 451 | * and to postitive if _no_ error occurred, but SMM |
| 452 | * was already notified. This avoids double notification | 452 | * was already notified. This avoids double notification |
| 453 | * which might lead to unexpected results... | 453 | * which might lead to unexpected results... |
| 454 | */ | 454 | */ |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index cf82989ae756..4754ff6e70e6 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
| @@ -363,6 +363,12 @@ static int __init init_old_suspend_ordering(const struct dmi_system_id *d) | |||
| 363 | return 0; | 363 | return 0; |
| 364 | } | 364 | } |
| 365 | 365 | ||
| 366 | static int __init init_nvs_nosave(const struct dmi_system_id *d) | ||
| 367 | { | ||
| 368 | acpi_nvs_nosave(); | ||
| 369 | return 0; | ||
| 370 | } | ||
| 371 | |||
| 366 | static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | 372 | static struct dmi_system_id __initdata acpisleep_dmi_table[] = { |
| 367 | { | 373 | { |
| 368 | .callback = init_old_suspend_ordering, | 374 | .callback = init_old_suspend_ordering, |
| @@ -397,6 +403,22 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
| 397 | DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), | 403 | DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), |
| 398 | }, | 404 | }, |
| 399 | }, | 405 | }, |
| 406 | { | ||
| 407 | .callback = init_nvs_nosave, | ||
| 408 | .ident = "Sony Vaio VGN-SR11M", | ||
| 409 | .matches = { | ||
| 410 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
| 411 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"), | ||
| 412 | }, | ||
| 413 | }, | ||
| 414 | { | ||
| 415 | .callback = init_nvs_nosave, | ||
| 416 | .ident = "Everex StepNote Series", | ||
| 417 | .matches = { | ||
| 418 | DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."), | ||
| 419 | DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"), | ||
| 420 | }, | ||
| 421 | }, | ||
| 400 | {}, | 422 | {}, |
| 401 | }; | 423 | }; |
| 402 | #endif /* CONFIG_SUSPEND */ | 424 | #endif /* CONFIG_SUSPEND */ |
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 68e2e4582fa2..f8588f81048a 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c | |||
| @@ -100,7 +100,7 @@ static const struct acpi_dlevel acpi_debug_levels[] = { | |||
| 100 | ACPI_DEBUG_INIT(ACPI_LV_EVENTS), | 100 | ACPI_DEBUG_INIT(ACPI_LV_EVENTS), |
| 101 | }; | 101 | }; |
| 102 | 102 | ||
| 103 | static int param_get_debug_layer(char *buffer, struct kernel_param *kp) | 103 | static int param_get_debug_layer(char *buffer, const struct kernel_param *kp) |
| 104 | { | 104 | { |
| 105 | int result = 0; | 105 | int result = 0; |
| 106 | int i; | 106 | int i; |
| @@ -128,7 +128,7 @@ static int param_get_debug_layer(char *buffer, struct kernel_param *kp) | |||
| 128 | return result; | 128 | return result; |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | static int param_get_debug_level(char *buffer, struct kernel_param *kp) | 131 | static int param_get_debug_level(char *buffer, const struct kernel_param *kp) |
| 132 | { | 132 | { |
| 133 | int result = 0; | 133 | int result = 0; |
| 134 | int i; | 134 | int i; |
| @@ -149,10 +149,18 @@ static int param_get_debug_level(char *buffer, struct kernel_param *kp) | |||
| 149 | return result; | 149 | return result; |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | module_param_call(debug_layer, param_set_uint, param_get_debug_layer, | 152 | static struct kernel_param_ops param_ops_debug_layer = { |
| 153 | &acpi_dbg_layer, 0644); | 153 | .set = param_set_uint, |
| 154 | module_param_call(debug_level, param_set_uint, param_get_debug_level, | 154 | .get = param_get_debug_layer, |
| 155 | &acpi_dbg_level, 0644); | 155 | }; |
| 156 | |||
| 157 | static struct kernel_param_ops param_ops_debug_level = { | ||
| 158 | .set = param_set_uint, | ||
| 159 | .get = param_get_debug_level, | ||
| 160 | }; | ||
| 161 | |||
| 162 | module_param_cb(debug_layer, ¶m_ops_debug_layer, &acpi_dbg_layer, 0644); | ||
| 163 | module_param_cb(debug_level, ¶m_ops_debug_level, &acpi_dbg_level, 0644); | ||
| 156 | 164 | ||
| 157 | static char trace_method_name[6]; | 165 | static char trace_method_name[6]; |
| 158 | module_param_string(trace_method_name, trace_method_name, 6, 0644); | 166 | module_param_string(trace_method_name, trace_method_name, 6, 0644); |
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index c5fef01b3c95..b83676126598 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c | |||
| @@ -59,8 +59,8 @@ acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context, | |||
| 59 | "support\n")); | 59 | "support\n")); |
| 60 | *cap |= ACPI_VIDEO_BACKLIGHT; | 60 | *cap |= ACPI_VIDEO_BACKLIGHT; |
| 61 | if (ACPI_FAILURE(acpi_get_handle(handle, "_BQC", &h_dummy))) | 61 | if (ACPI_FAILURE(acpi_get_handle(handle, "_BQC", &h_dummy))) |
| 62 | printk(KERN_WARNING FW_BUG PREFIX "ACPI brightness " | 62 | printk(KERN_WARNING FW_BUG PREFIX "No _BQC method, " |
| 63 | "control misses _BQC function\n"); | 63 | "cannot determine initial brightness\n"); |
| 64 | /* We have backlight support, no need to scan further */ | 64 | /* We have backlight support, no need to scan further */ |
| 65 | return AE_CTRL_TERMINATE; | 65 | return AE_CTRL_TERMINATE; |
| 66 | } | 66 | } |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index ff1c945fba98..99d0e5a51148 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
| @@ -90,6 +90,10 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); | |||
| 90 | static int ahci_pci_device_resume(struct pci_dev *pdev); | 90 | static int ahci_pci_device_resume(struct pci_dev *pdev); |
| 91 | #endif | 91 | #endif |
| 92 | 92 | ||
| 93 | static struct scsi_host_template ahci_sht = { | ||
| 94 | AHCI_SHT("ahci"), | ||
| 95 | }; | ||
| 96 | |||
| 93 | static struct ata_port_operations ahci_vt8251_ops = { | 97 | static struct ata_port_operations ahci_vt8251_ops = { |
| 94 | .inherits = &ahci_ops, | 98 | .inherits = &ahci_ops, |
| 95 | .hardreset = ahci_vt8251_hardreset, | 99 | .hardreset = ahci_vt8251_hardreset, |
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 474427b6f99f..e5fdeebf9ef0 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h | |||
| @@ -298,7 +298,17 @@ struct ahci_host_priv { | |||
| 298 | 298 | ||
| 299 | extern int ahci_ignore_sss; | 299 | extern int ahci_ignore_sss; |
| 300 | 300 | ||
| 301 | extern struct scsi_host_template ahci_sht; | 301 | extern struct device_attribute *ahci_shost_attrs[]; |
| 302 | extern struct device_attribute *ahci_sdev_attrs[]; | ||
| 303 | |||
| 304 | #define AHCI_SHT(drv_name) \ | ||
| 305 | ATA_NCQ_SHT(drv_name), \ | ||
| 306 | .can_queue = AHCI_MAX_CMDS - 1, \ | ||
| 307 | .sg_tablesize = AHCI_MAX_SG, \ | ||
| 308 | .dma_boundary = AHCI_DMA_BOUNDARY, \ | ||
| 309 | .shost_attrs = ahci_shost_attrs, \ | ||
| 310 | .sdev_attrs = ahci_sdev_attrs | ||
| 311 | |||
| 302 | extern struct ata_port_operations ahci_ops; | 312 | extern struct ata_port_operations ahci_ops; |
| 303 | 313 | ||
| 304 | void ahci_save_initial_config(struct device *dev, | 314 | void ahci_save_initial_config(struct device *dev, |
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 4e97f33cca44..84b643270e7a 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c | |||
| @@ -23,6 +23,10 @@ | |||
| 23 | #include <linux/ahci_platform.h> | 23 | #include <linux/ahci_platform.h> |
| 24 | #include "ahci.h" | 24 | #include "ahci.h" |
| 25 | 25 | ||
| 26 | static struct scsi_host_template ahci_platform_sht = { | ||
| 27 | AHCI_SHT("ahci_platform"), | ||
| 28 | }; | ||
| 29 | |||
| 26 | static int __init ahci_probe(struct platform_device *pdev) | 30 | static int __init ahci_probe(struct platform_device *pdev) |
| 27 | { | 31 | { |
| 28 | struct device *dev = &pdev->dev; | 32 | struct device *dev = &pdev->dev; |
| @@ -145,7 +149,7 @@ static int __init ahci_probe(struct platform_device *pdev) | |||
| 145 | ahci_print_info(host, "platform"); | 149 | ahci_print_info(host, "platform"); |
| 146 | 150 | ||
| 147 | rc = ata_host_activate(host, irq, ahci_interrupt, IRQF_SHARED, | 151 | rc = ata_host_activate(host, irq, ahci_interrupt, IRQF_SHARED, |
| 148 | &ahci_sht); | 152 | &ahci_platform_sht); |
| 149 | if (rc) | 153 | if (rc) |
| 150 | goto err0; | 154 | goto err0; |
| 151 | 155 | ||
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 68dc6785472f..8eea309ea212 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
| @@ -121,7 +121,7 @@ static DEVICE_ATTR(ahci_port_cmd, S_IRUGO, ahci_show_port_cmd, NULL); | |||
| 121 | static DEVICE_ATTR(em_buffer, S_IWUSR | S_IRUGO, | 121 | static DEVICE_ATTR(em_buffer, S_IWUSR | S_IRUGO, |
| 122 | ahci_read_em_buffer, ahci_store_em_buffer); | 122 | ahci_read_em_buffer, ahci_store_em_buffer); |
| 123 | 123 | ||
| 124 | static struct device_attribute *ahci_shost_attrs[] = { | 124 | struct device_attribute *ahci_shost_attrs[] = { |
| 125 | &dev_attr_link_power_management_policy, | 125 | &dev_attr_link_power_management_policy, |
| 126 | &dev_attr_em_message_type, | 126 | &dev_attr_em_message_type, |
| 127 | &dev_attr_em_message, | 127 | &dev_attr_em_message, |
| @@ -132,22 +132,14 @@ static struct device_attribute *ahci_shost_attrs[] = { | |||
| 132 | &dev_attr_em_buffer, | 132 | &dev_attr_em_buffer, |
| 133 | NULL | 133 | NULL |
| 134 | }; | 134 | }; |
| 135 | EXPORT_SYMBOL_GPL(ahci_shost_attrs); | ||
| 135 | 136 | ||
| 136 | static struct device_attribute *ahci_sdev_attrs[] = { | 137 | struct device_attribute *ahci_sdev_attrs[] = { |
| 137 | &dev_attr_sw_activity, | 138 | &dev_attr_sw_activity, |
| 138 | &dev_attr_unload_heads, | 139 | &dev_attr_unload_heads, |
| 139 | NULL | 140 | NULL |
| 140 | }; | 141 | }; |
| 141 | 142 | EXPORT_SYMBOL_GPL(ahci_sdev_attrs); | |
| 142 | struct scsi_host_template ahci_sht = { | ||
| 143 | ATA_NCQ_SHT("ahci"), | ||
| 144 | .can_queue = AHCI_MAX_CMDS - 1, | ||
| 145 | .sg_tablesize = AHCI_MAX_SG, | ||
| 146 | .dma_boundary = AHCI_DMA_BOUNDARY, | ||
| 147 | .shost_attrs = ahci_shost_attrs, | ||
| 148 | .sdev_attrs = ahci_sdev_attrs, | ||
| 149 | }; | ||
| 150 | EXPORT_SYMBOL_GPL(ahci_sht); | ||
| 151 | 143 | ||
| 152 | struct ata_port_operations ahci_ops = { | 144 | struct ata_port_operations ahci_ops = { |
| 153 | .inherits = &sata_pmp_port_ops, | 145 | .inherits = &sata_pmp_port_ops, |
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index ee9ddeb53417..8cb0347dec28 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
| @@ -3156,7 +3156,6 @@ static int __devinit ia_init_one(struct pci_dev *pdev, | |||
| 3156 | { | 3156 | { |
| 3157 | struct atm_dev *dev; | 3157 | struct atm_dev *dev; |
| 3158 | IADEV *iadev; | 3158 | IADEV *iadev; |
| 3159 | unsigned long flags; | ||
| 3160 | int ret; | 3159 | int ret; |
| 3161 | 3160 | ||
| 3162 | iadev = kzalloc(sizeof(*iadev), GFP_KERNEL); | 3161 | iadev = kzalloc(sizeof(*iadev), GFP_KERNEL); |
| @@ -3188,19 +3187,14 @@ static int __devinit ia_init_one(struct pci_dev *pdev, | |||
| 3188 | ia_dev[iadev_count] = iadev; | 3187 | ia_dev[iadev_count] = iadev; |
| 3189 | _ia_dev[iadev_count] = dev; | 3188 | _ia_dev[iadev_count] = dev; |
| 3190 | iadev_count++; | 3189 | iadev_count++; |
| 3191 | spin_lock_init(&iadev->misc_lock); | ||
| 3192 | /* First fixes first. I don't want to think about this now. */ | ||
| 3193 | spin_lock_irqsave(&iadev->misc_lock, flags); | ||
| 3194 | if (ia_init(dev) || ia_start(dev)) { | 3190 | if (ia_init(dev) || ia_start(dev)) { |
| 3195 | IF_INIT(printk("IA register failed!\n");) | 3191 | IF_INIT(printk("IA register failed!\n");) |
| 3196 | iadev_count--; | 3192 | iadev_count--; |
| 3197 | ia_dev[iadev_count] = NULL; | 3193 | ia_dev[iadev_count] = NULL; |
| 3198 | _ia_dev[iadev_count] = NULL; | 3194 | _ia_dev[iadev_count] = NULL; |
| 3199 | spin_unlock_irqrestore(&iadev->misc_lock, flags); | ||
| 3200 | ret = -EINVAL; | 3195 | ret = -EINVAL; |
| 3201 | goto err_out_deregister_dev; | 3196 | goto err_out_deregister_dev; |
| 3202 | } | 3197 | } |
| 3203 | spin_unlock_irqrestore(&iadev->misc_lock, flags); | ||
| 3204 | IF_EVENT(printk("iadev_count = %d\n", iadev_count);) | 3198 | IF_EVENT(printk("iadev_count = %d\n", iadev_count);) |
| 3205 | 3199 | ||
| 3206 | iadev->next_board = ia_boards; | 3200 | iadev->next_board = ia_boards; |
diff --git a/drivers/atm/iphase.h b/drivers/atm/iphase.h index b2cd20f549cb..077735e0e04b 100644 --- a/drivers/atm/iphase.h +++ b/drivers/atm/iphase.h | |||
| @@ -1022,7 +1022,7 @@ typedef struct iadev_t { | |||
| 1022 | struct dle_q rx_dle_q; | 1022 | struct dle_q rx_dle_q; |
| 1023 | struct free_desc_q *rx_free_desc_qhead; | 1023 | struct free_desc_q *rx_free_desc_qhead; |
| 1024 | struct sk_buff_head rx_dma_q; | 1024 | struct sk_buff_head rx_dma_q; |
| 1025 | spinlock_t rx_lock, misc_lock; | 1025 | spinlock_t rx_lock; |
| 1026 | struct atm_vcc **rx_open; /* list of all open VCs */ | 1026 | struct atm_vcc **rx_open; /* list of all open VCs */ |
| 1027 | u16 num_rx_desc, rx_buf_sz, rxing; | 1027 | u16 num_rx_desc, rx_buf_sz, rxing; |
| 1028 | u32 rx_pkt_ram, rx_tmp_cnt; | 1028 | u32 rx_pkt_ram, rx_tmp_cnt; |
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index f916ddf63938..f46138ab38b6 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c | |||
| @@ -444,6 +444,7 @@ static ssize_t console_show(struct device *dev, struct device_attribute *attr, | |||
| 444 | struct atm_dev *atmdev = container_of(dev, struct atm_dev, class_dev); | 444 | struct atm_dev *atmdev = container_of(dev, struct atm_dev, class_dev); |
| 445 | struct solos_card *card = atmdev->dev_data; | 445 | struct solos_card *card = atmdev->dev_data; |
| 446 | struct sk_buff *skb; | 446 | struct sk_buff *skb; |
| 447 | unsigned int len; | ||
| 447 | 448 | ||
| 448 | spin_lock(&card->cli_queue_lock); | 449 | spin_lock(&card->cli_queue_lock); |
| 449 | skb = skb_dequeue(&card->cli_queue[SOLOS_CHAN(atmdev)]); | 450 | skb = skb_dequeue(&card->cli_queue[SOLOS_CHAN(atmdev)]); |
| @@ -451,11 +452,12 @@ static ssize_t console_show(struct device *dev, struct device_attribute *attr, | |||
| 451 | if(skb == NULL) | 452 | if(skb == NULL) |
| 452 | return sprintf(buf, "No data.\n"); | 453 | return sprintf(buf, "No data.\n"); |
| 453 | 454 | ||
| 454 | memcpy(buf, skb->data, skb->len); | 455 | len = skb->len; |
| 455 | dev_dbg(&card->dev->dev, "len: %d\n", skb->len); | 456 | memcpy(buf, skb->data, len); |
| 457 | dev_dbg(&card->dev->dev, "len: %d\n", len); | ||
| 456 | 458 | ||
| 457 | kfree_skb(skb); | 459 | kfree_skb(skb); |
| 458 | return skb->len; | 460 | return len; |
| 459 | } | 461 | } |
| 460 | 462 | ||
| 461 | static int send_command(struct solos_card *card, int dev, const char *buf, size_t size) | 463 | static int send_command(struct solos_card *card, int dev, const char *buf, size_t size) |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 6124c2fd2d33..5e4fadcdece9 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
| @@ -4792,7 +4792,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
| 4792 | clean4: | 4792 | clean4: |
| 4793 | kfree(h->cmd_pool_bits); | 4793 | kfree(h->cmd_pool_bits); |
| 4794 | /* Free up sg elements */ | 4794 | /* Free up sg elements */ |
| 4795 | for (k = 0; k < h->nr_cmds; k++) | 4795 | for (k-- ; k >= 0; k--) |
| 4796 | kfree(h->scatter_list[k]); | 4796 | kfree(h->scatter_list[k]); |
| 4797 | kfree(h->scatter_list); | 4797 | kfree(h->scatter_list); |
| 4798 | cciss_free_sg_chain_blocks(h->cmd_sg_list, h->nr_cmds); | 4798 | cciss_free_sg_chain_blocks(h->cmd_sg_list, h->nr_cmds); |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index b1cbeb59bb76..37a2bb595076 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
| @@ -2369,7 +2369,7 @@ static void pkt_release_dev(struct pktcdvd_device *pd, int flush) | |||
| 2369 | pkt_shrink_pktlist(pd); | 2369 | pkt_shrink_pktlist(pd); |
| 2370 | } | 2370 | } |
| 2371 | 2371 | ||
| 2372 | static struct pktcdvd_device *pkt_find_dev_from_minor(int dev_minor) | 2372 | static struct pktcdvd_device *pkt_find_dev_from_minor(unsigned int dev_minor) |
| 2373 | { | 2373 | { |
| 2374 | if (dev_minor >= MAX_WRITERS) | 2374 | if (dev_minor >= MAX_WRITERS) |
| 2375 | return NULL; | 2375 | return NULL; |
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index e9da874d0419..03688c2da319 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c | |||
| @@ -113,7 +113,7 @@ static void ps3disk_scatter_gather(struct ps3_storage_device *dev, | |||
| 113 | memcpy(buf, dev->bounce_buf+offset, size); | 113 | memcpy(buf, dev->bounce_buf+offset, size); |
| 114 | offset += size; | 114 | offset += size; |
| 115 | flush_kernel_dcache_page(bvec->bv_page); | 115 | flush_kernel_dcache_page(bvec->bv_page); |
| 116 | bvec_kunmap_irq(bvec, &flags); | 116 | bvec_kunmap_irq(buf, &flags); |
| 117 | i++; | 117 | i++; |
| 118 | } | 118 | } |
| 119 | } | 119 | } |
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 2aafafca2b13..1101e251a629 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c | |||
| @@ -202,6 +202,7 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str) | |||
| 202 | struct virtio_blk *vblk = disk->private_data; | 202 | struct virtio_blk *vblk = disk->private_data; |
| 203 | struct request *req; | 203 | struct request *req; |
| 204 | struct bio *bio; | 204 | struct bio *bio; |
| 205 | int err; | ||
| 205 | 206 | ||
| 206 | bio = bio_map_kern(vblk->disk->queue, id_str, VIRTIO_BLK_ID_BYTES, | 207 | bio = bio_map_kern(vblk->disk->queue, id_str, VIRTIO_BLK_ID_BYTES, |
| 207 | GFP_KERNEL); | 208 | GFP_KERNEL); |
| @@ -215,7 +216,10 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str) | |||
| 215 | } | 216 | } |
| 216 | 217 | ||
| 217 | req->cmd_type = REQ_TYPE_SPECIAL; | 218 | req->cmd_type = REQ_TYPE_SPECIAL; |
| 218 | return blk_execute_rq(vblk->disk->queue, vblk->disk, req, false); | 219 | err = blk_execute_rq(vblk->disk->queue, vblk->disk, req, false); |
| 220 | blk_put_request(req); | ||
| 221 | |||
| 222 | return err; | ||
| 219 | } | 223 | } |
| 220 | 224 | ||
| 221 | static int virtblk_locked_ioctl(struct block_device *bdev, fmode_t mode, | 225 | static int virtblk_locked_ioctl(struct block_device *bdev, fmode_t mode, |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index eab58db5f91c..cd18493c9527 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
| @@ -806,6 +806,8 @@ static const struct intel_driver_description { | |||
| 806 | "G45/G43", NULL, &intel_i965_driver }, | 806 | "G45/G43", NULL, &intel_i965_driver }, |
| 807 | { PCI_DEVICE_ID_INTEL_B43_HB, PCI_DEVICE_ID_INTEL_B43_IG, | 807 | { PCI_DEVICE_ID_INTEL_B43_HB, PCI_DEVICE_ID_INTEL_B43_IG, |
| 808 | "B43", NULL, &intel_i965_driver }, | 808 | "B43", NULL, &intel_i965_driver }, |
| 809 | { PCI_DEVICE_ID_INTEL_B43_1_HB, PCI_DEVICE_ID_INTEL_B43_1_IG, | ||
| 810 | "B43", NULL, &intel_i965_driver }, | ||
| 809 | { PCI_DEVICE_ID_INTEL_G41_HB, PCI_DEVICE_ID_INTEL_G41_IG, | 811 | { PCI_DEVICE_ID_INTEL_G41_HB, PCI_DEVICE_ID_INTEL_G41_IG, |
| 810 | "G41", NULL, &intel_i965_driver }, | 812 | "G41", NULL, &intel_i965_driver }, |
| 811 | { PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG, | 813 | { PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG, |
diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h index ee189c74d345..d09b1ab7e8ab 100644 --- a/drivers/char/agp/intel-agp.h +++ b/drivers/char/agp/intel-agp.h | |||
| @@ -186,6 +186,8 @@ | |||
| 186 | #define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2 | 186 | #define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2 |
| 187 | #define PCI_DEVICE_ID_INTEL_B43_HB 0x2E40 | 187 | #define PCI_DEVICE_ID_INTEL_B43_HB 0x2E40 |
| 188 | #define PCI_DEVICE_ID_INTEL_B43_IG 0x2E42 | 188 | #define PCI_DEVICE_ID_INTEL_B43_IG 0x2E42 |
| 189 | #define PCI_DEVICE_ID_INTEL_B43_1_HB 0x2E90 | ||
| 190 | #define PCI_DEVICE_ID_INTEL_B43_1_IG 0x2E92 | ||
| 189 | #define PCI_DEVICE_ID_INTEL_GM45_HB 0x2A40 | 191 | #define PCI_DEVICE_ID_INTEL_GM45_HB 0x2A40 |
| 190 | #define PCI_DEVICE_ID_INTEL_GM45_IG 0x2A42 | 192 | #define PCI_DEVICE_ID_INTEL_GM45_IG 0x2A42 |
| 191 | #define PCI_DEVICE_ID_INTEL_EAGLELAKE_HB 0x2E00 | 193 | #define PCI_DEVICE_ID_INTEL_EAGLELAKE_HB 0x2E00 |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 3822b4f49c84..7bd7c45b53ef 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
| @@ -305,6 +305,9 @@ static int num_force_kipmid; | |||
| 305 | #ifdef CONFIG_PCI | 305 | #ifdef CONFIG_PCI |
| 306 | static int pci_registered; | 306 | static int pci_registered; |
| 307 | #endif | 307 | #endif |
| 308 | #ifdef CONFIG_ACPI | ||
| 309 | static int pnp_registered; | ||
| 310 | #endif | ||
| 308 | #ifdef CONFIG_PPC_OF | 311 | #ifdef CONFIG_PPC_OF |
| 309 | static int of_registered; | 312 | static int of_registered; |
| 310 | #endif | 313 | #endif |
| @@ -2126,7 +2129,7 @@ static int __devinit ipmi_pnp_probe(struct pnp_dev *dev, | |||
| 2126 | { | 2129 | { |
| 2127 | struct acpi_device *acpi_dev; | 2130 | struct acpi_device *acpi_dev; |
| 2128 | struct smi_info *info; | 2131 | struct smi_info *info; |
| 2129 | struct resource *res; | 2132 | struct resource *res, *res_second; |
| 2130 | acpi_handle handle; | 2133 | acpi_handle handle; |
| 2131 | acpi_status status; | 2134 | acpi_status status; |
| 2132 | unsigned long long tmp; | 2135 | unsigned long long tmp; |
| @@ -2182,13 +2185,13 @@ static int __devinit ipmi_pnp_probe(struct pnp_dev *dev, | |||
| 2182 | info->io.addr_data = res->start; | 2185 | info->io.addr_data = res->start; |
| 2183 | 2186 | ||
| 2184 | info->io.regspacing = DEFAULT_REGSPACING; | 2187 | info->io.regspacing = DEFAULT_REGSPACING; |
| 2185 | res = pnp_get_resource(dev, | 2188 | res_second = pnp_get_resource(dev, |
| 2186 | (info->io.addr_type == IPMI_IO_ADDR_SPACE) ? | 2189 | (info->io.addr_type == IPMI_IO_ADDR_SPACE) ? |
| 2187 | IORESOURCE_IO : IORESOURCE_MEM, | 2190 | IORESOURCE_IO : IORESOURCE_MEM, |
| 2188 | 1); | 2191 | 1); |
| 2189 | if (res) { | 2192 | if (res_second) { |
| 2190 | if (res->start > info->io.addr_data) | 2193 | if (res_second->start > info->io.addr_data) |
| 2191 | info->io.regspacing = res->start - info->io.addr_data; | 2194 | info->io.regspacing = res_second->start - info->io.addr_data; |
| 2192 | } | 2195 | } |
| 2193 | info->io.regsize = DEFAULT_REGSPACING; | 2196 | info->io.regsize = DEFAULT_REGSPACING; |
| 2194 | info->io.regshift = 0; | 2197 | info->io.regshift = 0; |
| @@ -3359,6 +3362,7 @@ static __devinit int init_ipmi_si(void) | |||
| 3359 | 3362 | ||
| 3360 | #ifdef CONFIG_ACPI | 3363 | #ifdef CONFIG_ACPI |
| 3361 | pnp_register_driver(&ipmi_pnp_driver); | 3364 | pnp_register_driver(&ipmi_pnp_driver); |
| 3365 | pnp_registered = 1; | ||
| 3362 | #endif | 3366 | #endif |
| 3363 | 3367 | ||
| 3364 | #ifdef CONFIG_DMI | 3368 | #ifdef CONFIG_DMI |
| @@ -3526,7 +3530,8 @@ static __exit void cleanup_ipmi_si(void) | |||
| 3526 | pci_unregister_driver(&ipmi_pci_driver); | 3530 | pci_unregister_driver(&ipmi_pci_driver); |
| 3527 | #endif | 3531 | #endif |
| 3528 | #ifdef CONFIG_ACPI | 3532 | #ifdef CONFIG_ACPI |
| 3529 | pnp_unregister_driver(&ipmi_pnp_driver); | 3533 | if (pnp_registered) |
| 3534 | pnp_unregister_driver(&ipmi_pnp_driver); | ||
| 3530 | #endif | 3535 | #endif |
| 3531 | 3536 | ||
| 3532 | #ifdef CONFIG_PPC_OF | 3537 | #ifdef CONFIG_PPC_OF |
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index a398ecdbd758..1f528fad3516 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
| @@ -788,10 +788,11 @@ static const struct file_operations zero_fops = { | |||
| 788 | /* | 788 | /* |
| 789 | * capabilities for /dev/zero | 789 | * capabilities for /dev/zero |
| 790 | * - permits private mappings, "copies" are taken of the source of zeros | 790 | * - permits private mappings, "copies" are taken of the source of zeros |
| 791 | * - no writeback happens | ||
| 791 | */ | 792 | */ |
| 792 | static struct backing_dev_info zero_bdi = { | 793 | static struct backing_dev_info zero_bdi = { |
| 793 | .name = "char/mem", | 794 | .name = "char/mem", |
| 794 | .capabilities = BDI_CAP_MAP_COPY, | 795 | .capabilities = BDI_CAP_MAP_COPY | BDI_CAP_NO_ACCT_AND_WRITEBACK, |
| 795 | }; | 796 | }; |
| 796 | 797 | ||
| 797 | static const struct file_operations full_fops = { | 798 | static const struct file_operations full_fops = { |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 942a9826bd23..c810481a5bc2 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
| @@ -596,6 +596,10 @@ static ssize_t port_fops_write(struct file *filp, const char __user *ubuf, | |||
| 596 | ssize_t ret; | 596 | ssize_t ret; |
| 597 | bool nonblock; | 597 | bool nonblock; |
| 598 | 598 | ||
| 599 | /* Userspace could be out to fool us */ | ||
| 600 | if (!count) | ||
| 601 | return 0; | ||
| 602 | |||
| 599 | port = filp->private_data; | 603 | port = filp->private_data; |
| 600 | 604 | ||
| 601 | nonblock = filp->f_flags & O_NONBLOCK; | 605 | nonblock = filp->f_flags & O_NONBLOCK; |
| @@ -642,7 +646,7 @@ static unsigned int port_fops_poll(struct file *filp, poll_table *wait) | |||
| 642 | poll_wait(filp, &port->waitqueue, wait); | 646 | poll_wait(filp, &port->waitqueue, wait); |
| 643 | 647 | ||
| 644 | ret = 0; | 648 | ret = 0; |
| 645 | if (port->inbuf) | 649 | if (!will_read_block(port)) |
| 646 | ret |= POLLIN | POLLRDNORM; | 650 | ret |= POLLIN | POLLRDNORM; |
| 647 | if (!will_write_block(port)) | 651 | if (!will_write_block(port)) |
| 648 | ret |= POLLOUT; | 652 | ret |= POLLOUT; |
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index c2408bbe9c2e..f508690eb958 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c | |||
| @@ -80,7 +80,7 @@ | |||
| 80 | * Limiting Performance Impact | 80 | * Limiting Performance Impact |
| 81 | * --------------------------- | 81 | * --------------------------- |
| 82 | * C states, especially those with large exit latencies, can have a real | 82 | * C states, especially those with large exit latencies, can have a real |
| 83 | * noticable impact on workloads, which is not acceptable for most sysadmins, | 83 | * noticeable impact on workloads, which is not acceptable for most sysadmins, |
| 84 | * and in addition, less performance has a power price of its own. | 84 | * and in addition, less performance has a power price of its own. |
| 85 | * | 85 | * |
| 86 | * As a general rule of thumb, menu assumes that the following heuristic | 86 | * As a general rule of thumb, menu assumes that the following heuristic |
diff --git a/drivers/dca/dca-core.c b/drivers/dca/dca-core.c index 8661c84a105d..b98c67664ae7 100644 --- a/drivers/dca/dca-core.c +++ b/drivers/dca/dca-core.c | |||
| @@ -39,6 +39,10 @@ static DEFINE_SPINLOCK(dca_lock); | |||
| 39 | 39 | ||
| 40 | static LIST_HEAD(dca_domains); | 40 | static LIST_HEAD(dca_domains); |
| 41 | 41 | ||
| 42 | static BLOCKING_NOTIFIER_HEAD(dca_provider_chain); | ||
| 43 | |||
| 44 | static int dca_providers_blocked; | ||
| 45 | |||
| 42 | static struct pci_bus *dca_pci_rc_from_dev(struct device *dev) | 46 | static struct pci_bus *dca_pci_rc_from_dev(struct device *dev) |
| 43 | { | 47 | { |
| 44 | struct pci_dev *pdev = to_pci_dev(dev); | 48 | struct pci_dev *pdev = to_pci_dev(dev); |
| @@ -70,6 +74,60 @@ static void dca_free_domain(struct dca_domain *domain) | |||
| 70 | kfree(domain); | 74 | kfree(domain); |
| 71 | } | 75 | } |
| 72 | 76 | ||
| 77 | static int dca_provider_ioat_ver_3_0(struct device *dev) | ||
| 78 | { | ||
| 79 | struct pci_dev *pdev = to_pci_dev(dev); | ||
| 80 | |||
| 81 | return ((pdev->vendor == PCI_VENDOR_ID_INTEL) && | ||
| 82 | ((pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG0) || | ||
| 83 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG1) || | ||
| 84 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG2) || | ||
| 85 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG3) || | ||
| 86 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG4) || | ||
| 87 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG5) || | ||
| 88 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG6) || | ||
| 89 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG7))); | ||
| 90 | } | ||
| 91 | |||
| 92 | static void unregister_dca_providers(void) | ||
| 93 | { | ||
| 94 | struct dca_provider *dca, *_dca; | ||
| 95 | struct list_head unregistered_providers; | ||
| 96 | struct dca_domain *domain; | ||
| 97 | unsigned long flags; | ||
| 98 | |||
| 99 | blocking_notifier_call_chain(&dca_provider_chain, | ||
| 100 | DCA_PROVIDER_REMOVE, NULL); | ||
| 101 | |||
| 102 | INIT_LIST_HEAD(&unregistered_providers); | ||
| 103 | |||
| 104 | spin_lock_irqsave(&dca_lock, flags); | ||
| 105 | |||
| 106 | if (list_empty(&dca_domains)) { | ||
| 107 | spin_unlock_irqrestore(&dca_lock, flags); | ||
| 108 | return; | ||
| 109 | } | ||
| 110 | |||
| 111 | /* at this point only one domain in the list is expected */ | ||
| 112 | domain = list_first_entry(&dca_domains, struct dca_domain, node); | ||
| 113 | if (!domain) | ||
| 114 | return; | ||
| 115 | |||
| 116 | list_for_each_entry_safe(dca, _dca, &domain->dca_providers, node) { | ||
| 117 | list_del(&dca->node); | ||
| 118 | list_add(&dca->node, &unregistered_providers); | ||
| 119 | } | ||
| 120 | |||
| 121 | dca_free_domain(domain); | ||
| 122 | |||
| 123 | spin_unlock_irqrestore(&dca_lock, flags); | ||
| 124 | |||
| 125 | list_for_each_entry_safe(dca, _dca, &unregistered_providers, node) { | ||
| 126 | dca_sysfs_remove_provider(dca); | ||
| 127 | list_del(&dca->node); | ||
| 128 | } | ||
| 129 | } | ||
| 130 | |||
| 73 | static struct dca_domain *dca_find_domain(struct pci_bus *rc) | 131 | static struct dca_domain *dca_find_domain(struct pci_bus *rc) |
| 74 | { | 132 | { |
| 75 | struct dca_domain *domain; | 133 | struct dca_domain *domain; |
| @@ -90,9 +148,13 @@ static struct dca_domain *dca_get_domain(struct device *dev) | |||
| 90 | domain = dca_find_domain(rc); | 148 | domain = dca_find_domain(rc); |
| 91 | 149 | ||
| 92 | if (!domain) { | 150 | if (!domain) { |
| 93 | domain = dca_allocate_domain(rc); | 151 | if (dca_provider_ioat_ver_3_0(dev) && !list_empty(&dca_domains)) { |
| 94 | if (domain) | 152 | dca_providers_blocked = 1; |
| 95 | list_add(&domain->node, &dca_domains); | 153 | } else { |
| 154 | domain = dca_allocate_domain(rc); | ||
| 155 | if (domain) | ||
| 156 | list_add(&domain->node, &dca_domains); | ||
| 157 | } | ||
| 96 | } | 158 | } |
| 97 | 159 | ||
| 98 | return domain; | 160 | return domain; |
| @@ -293,8 +355,6 @@ void free_dca_provider(struct dca_provider *dca) | |||
| 293 | } | 355 | } |
| 294 | EXPORT_SYMBOL_GPL(free_dca_provider); | 356 | EXPORT_SYMBOL_GPL(free_dca_provider); |
| 295 | 357 | ||
| 296 | static BLOCKING_NOTIFIER_HEAD(dca_provider_chain); | ||
| 297 | |||
| 298 | /** | 358 | /** |
| 299 | * register_dca_provider - register a dca provider | 359 | * register_dca_provider - register a dca provider |
| 300 | * @dca - struct created by alloc_dca_provider() | 360 | * @dca - struct created by alloc_dca_provider() |
| @@ -306,6 +366,13 @@ int register_dca_provider(struct dca_provider *dca, struct device *dev) | |||
| 306 | unsigned long flags; | 366 | unsigned long flags; |
| 307 | struct dca_domain *domain; | 367 | struct dca_domain *domain; |
| 308 | 368 | ||
| 369 | spin_lock_irqsave(&dca_lock, flags); | ||
| 370 | if (dca_providers_blocked) { | ||
| 371 | spin_unlock_irqrestore(&dca_lock, flags); | ||
| 372 | return -ENODEV; | ||
| 373 | } | ||
| 374 | spin_unlock_irqrestore(&dca_lock, flags); | ||
| 375 | |||
| 309 | err = dca_sysfs_add_provider(dca, dev); | 376 | err = dca_sysfs_add_provider(dca, dev); |
| 310 | if (err) | 377 | if (err) |
| 311 | return err; | 378 | return err; |
| @@ -313,7 +380,13 @@ int register_dca_provider(struct dca_provider *dca, struct device *dev) | |||
| 313 | spin_lock_irqsave(&dca_lock, flags); | 380 | spin_lock_irqsave(&dca_lock, flags); |
| 314 | domain = dca_get_domain(dev); | 381 | domain = dca_get_domain(dev); |
| 315 | if (!domain) { | 382 | if (!domain) { |
| 316 | spin_unlock_irqrestore(&dca_lock, flags); | 383 | if (dca_providers_blocked) { |
| 384 | spin_unlock_irqrestore(&dca_lock, flags); | ||
| 385 | dca_sysfs_remove_provider(dca); | ||
| 386 | unregister_dca_providers(); | ||
| 387 | } else { | ||
| 388 | spin_unlock_irqrestore(&dca_lock, flags); | ||
| 389 | } | ||
| 317 | return -ENODEV; | 390 | return -ENODEV; |
| 318 | } | 391 | } |
| 319 | list_add(&dca->node, &domain->dca_providers); | 392 | list_add(&dca->node, &domain->dca_providers); |
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c index 216f9d383b5b..effd140fc042 100644 --- a/drivers/dma/ioat/dma_v2.c +++ b/drivers/dma/ioat/dma_v2.c | |||
| @@ -879,7 +879,7 @@ int __devinit ioat2_dma_probe(struct ioatdma_device *device, int dca) | |||
| 879 | dma->device_issue_pending = ioat2_issue_pending; | 879 | dma->device_issue_pending = ioat2_issue_pending; |
| 880 | dma->device_alloc_chan_resources = ioat2_alloc_chan_resources; | 880 | dma->device_alloc_chan_resources = ioat2_alloc_chan_resources; |
| 881 | dma->device_free_chan_resources = ioat2_free_chan_resources; | 881 | dma->device_free_chan_resources = ioat2_free_chan_resources; |
| 882 | dma->device_tx_status = ioat_tx_status; | 882 | dma->device_tx_status = ioat_dma_tx_status; |
| 883 | 883 | ||
| 884 | err = ioat_probe(device); | 884 | err = ioat_probe(device); |
| 885 | if (err) | 885 | if (err) |
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index 86c5ae9fde34..411d5bf50fc4 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
| @@ -162,7 +162,7 @@ static int mv_is_err_intr(u32 intr_cause) | |||
| 162 | 162 | ||
| 163 | static void mv_xor_device_clear_eoc_cause(struct mv_xor_chan *chan) | 163 | static void mv_xor_device_clear_eoc_cause(struct mv_xor_chan *chan) |
| 164 | { | 164 | { |
| 165 | u32 val = (1 << (1 + (chan->idx * 16))); | 165 | u32 val = ~(1 << (chan->idx * 16)); |
| 166 | dev_dbg(chan->device->common.dev, "%s, val 0x%08x\n", __func__, val); | 166 | dev_dbg(chan->device->common.dev, "%s, val 0x%08x\n", __func__, val); |
| 167 | __raw_writel(val, XOR_INTR_CAUSE(chan)); | 167 | __raw_writel(val, XOR_INTR_CAUSE(chan)); |
| 168 | } | 168 | } |
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index fb64cf36ba61..eb6b54dbb806 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c | |||
| @@ -580,7 +580,6 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg( | |||
| 580 | 580 | ||
| 581 | sh_chan = to_sh_chan(chan); | 581 | sh_chan = to_sh_chan(chan); |
| 582 | param = chan->private; | 582 | param = chan->private; |
| 583 | slave_addr = param->config->addr; | ||
| 584 | 583 | ||
| 585 | /* Someone calling slave DMA on a public channel? */ | 584 | /* Someone calling slave DMA on a public channel? */ |
| 586 | if (!param || !sg_len) { | 585 | if (!param || !sg_len) { |
| @@ -589,6 +588,8 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg( | |||
| 589 | return NULL; | 588 | return NULL; |
| 590 | } | 589 | } |
| 591 | 590 | ||
| 591 | slave_addr = param->config->addr; | ||
| 592 | |||
| 592 | /* | 593 | /* |
| 593 | * if (param != NULL), this is a successfully requested slave channel, | 594 | * if (param != NULL), this is a successfully requested slave channel, |
| 594 | * therefore param->config != NULL too. | 595 | * therefore param->config != NULL too. |
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 3630308e7b81..6b21e25f7a84 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
| @@ -339,6 +339,9 @@ static void edac_mc_workq_teardown(struct mem_ctl_info *mci) | |||
| 339 | { | 339 | { |
| 340 | int status; | 340 | int status; |
| 341 | 341 | ||
| 342 | if (mci->op_state != OP_RUNNING_POLL) | ||
| 343 | return; | ||
| 344 | |||
| 342 | status = cancel_delayed_work(&mci->work); | 345 | status = cancel_delayed_work(&mci->work); |
| 343 | if (status == 0) { | 346 | if (status == 0) { |
| 344 | debugf0("%s() not canceled, flush the queue\n", | 347 | debugf0("%s() not canceled, flush the queue\n", |
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index e0187d16dd7c..0fd5b85a0f75 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
| @@ -1140,6 +1140,7 @@ static struct mcidev_sysfs_attribute i7core_udimm_counters_attrs[] = { | |||
| 1140 | ATTR_COUNTER(0), | 1140 | ATTR_COUNTER(0), |
| 1141 | ATTR_COUNTER(1), | 1141 | ATTR_COUNTER(1), |
| 1142 | ATTR_COUNTER(2), | 1142 | ATTR_COUNTER(2), |
| 1143 | { .attr = { .name = NULL } } | ||
| 1143 | }; | 1144 | }; |
| 1144 | 1145 | ||
| 1145 | static struct mcidev_sysfs_group i7core_udimm_counters = { | 1146 | static struct mcidev_sysfs_group i7core_udimm_counters = { |
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index be29b0bb2471..9dcb17d51aee 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
| @@ -263,6 +263,7 @@ static const struct { | |||
| 263 | {PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_FW, QUIRK_NO_MSI}, | 263 | {PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_FW, QUIRK_NO_MSI}, |
| 264 | {PCI_VENDOR_ID_NEC, PCI_ANY_ID, QUIRK_CYCLE_TIMER}, | 264 | {PCI_VENDOR_ID_NEC, PCI_ANY_ID, QUIRK_CYCLE_TIMER}, |
| 265 | {PCI_VENDOR_ID_VIA, PCI_ANY_ID, QUIRK_CYCLE_TIMER}, | 265 | {PCI_VENDOR_ID_VIA, PCI_ANY_ID, QUIRK_CYCLE_TIMER}, |
| 266 | {PCI_VENDOR_ID_RICOH, PCI_ANY_ID, QUIRK_CYCLE_TIMER}, | ||
| 266 | {PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_FW, QUIRK_BE_HEADERS}, | 267 | {PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_FW, QUIRK_BE_HEADERS}, |
| 267 | }; | 268 | }; |
| 268 | 269 | ||
| @@ -2839,7 +2840,7 @@ static int __devinit pci_probe(struct pci_dev *dev, | |||
| 2839 | const struct pci_device_id *ent) | 2840 | const struct pci_device_id *ent) |
| 2840 | { | 2841 | { |
| 2841 | struct fw_ohci *ohci; | 2842 | struct fw_ohci *ohci; |
| 2842 | u32 bus_options, max_receive, link_speed, version, link_enh; | 2843 | u32 bus_options, max_receive, link_speed, version; |
| 2843 | u64 guid; | 2844 | u64 guid; |
| 2844 | int i, err, n_ir, n_it; | 2845 | int i, err, n_ir, n_it; |
| 2845 | size_t size; | 2846 | size_t size; |
| @@ -2893,23 +2894,6 @@ static int __devinit pci_probe(struct pci_dev *dev, | |||
| 2893 | if (param_quirks) | 2894 | if (param_quirks) |
| 2894 | ohci->quirks = param_quirks; | 2895 | ohci->quirks = param_quirks; |
| 2895 | 2896 | ||
| 2896 | /* TI OHCI-Lynx and compatible: set recommended configuration bits. */ | ||
| 2897 | if (dev->vendor == PCI_VENDOR_ID_TI) { | ||
| 2898 | pci_read_config_dword(dev, PCI_CFG_TI_LinkEnh, &link_enh); | ||
| 2899 | |||
| 2900 | /* adjust latency of ATx FIFO: use 1.7 KB threshold */ | ||
| 2901 | link_enh &= ~TI_LinkEnh_atx_thresh_mask; | ||
| 2902 | link_enh |= TI_LinkEnh_atx_thresh_1_7K; | ||
| 2903 | |||
| 2904 | /* use priority arbitration for asynchronous responses */ | ||
| 2905 | link_enh |= TI_LinkEnh_enab_unfair; | ||
| 2906 | |||
| 2907 | /* required for aPhyEnhanceEnable to work */ | ||
| 2908 | link_enh |= TI_LinkEnh_enab_accel; | ||
| 2909 | |||
| 2910 | pci_write_config_dword(dev, PCI_CFG_TI_LinkEnh, link_enh); | ||
| 2911 | } | ||
| 2912 | |||
| 2913 | ar_context_init(&ohci->ar_request_ctx, ohci, | 2897 | ar_context_init(&ohci->ar_request_ctx, ohci, |
| 2914 | OHCI1394_AsReqRcvContextControlSet); | 2898 | OHCI1394_AsReqRcvContextControlSet); |
| 2915 | 2899 | ||
diff --git a/drivers/firewire/ohci.h b/drivers/firewire/ohci.h index 0e6c5a466908..ef5e7336da68 100644 --- a/drivers/firewire/ohci.h +++ b/drivers/firewire/ohci.h | |||
| @@ -155,12 +155,4 @@ | |||
| 155 | 155 | ||
| 156 | #define OHCI1394_phy_tcode 0xe | 156 | #define OHCI1394_phy_tcode 0xe |
| 157 | 157 | ||
| 158 | /* TI extensions */ | ||
| 159 | |||
| 160 | #define PCI_CFG_TI_LinkEnh 0xf4 | ||
| 161 | #define TI_LinkEnh_enab_accel 0x00000002 | ||
| 162 | #define TI_LinkEnh_enab_unfair 0x00000080 | ||
| 163 | #define TI_LinkEnh_atx_thresh_mask 0x00003000 | ||
| 164 | #define TI_LinkEnh_atx_thresh_1_7K 0x00001000 | ||
| 165 | |||
| 166 | #endif /* _FIREWIRE_OHCI_H */ | 158 | #endif /* _FIREWIRE_OHCI_H */ |
diff --git a/drivers/gpu/drm/drm_buffer.c b/drivers/gpu/drm/drm_buffer.c index 55d03ed05000..529a0dbe9fc6 100644 --- a/drivers/gpu/drm/drm_buffer.c +++ b/drivers/gpu/drm/drm_buffer.c | |||
| @@ -98,8 +98,8 @@ EXPORT_SYMBOL(drm_buffer_alloc); | |||
| 98 | * user_data: A pointer the data that is copied to the buffer. | 98 | * user_data: A pointer the data that is copied to the buffer. |
| 99 | * size: The Number of bytes to copy. | 99 | * size: The Number of bytes to copy. |
| 100 | */ | 100 | */ |
| 101 | extern int drm_buffer_copy_from_user(struct drm_buffer *buf, | 101 | int drm_buffer_copy_from_user(struct drm_buffer *buf, |
| 102 | void __user *user_data, int size) | 102 | void __user *user_data, int size) |
| 103 | { | 103 | { |
| 104 | int nr_pages = size / PAGE_SIZE + 1; | 104 | int nr_pages = size / PAGE_SIZE + 1; |
| 105 | int idx; | 105 | int idx; |
| @@ -163,7 +163,7 @@ void *drm_buffer_read_object(struct drm_buffer *buf, | |||
| 163 | { | 163 | { |
| 164 | int idx = drm_buffer_index(buf); | 164 | int idx = drm_buffer_index(buf); |
| 165 | int page = drm_buffer_page(buf); | 165 | int page = drm_buffer_page(buf); |
| 166 | void *obj = 0; | 166 | void *obj = NULL; |
| 167 | 167 | ||
| 168 | if (idx + objsize <= PAGE_SIZE) { | 168 | if (idx + objsize <= PAGE_SIZE) { |
| 169 | obj = &buf->data[page][idx]; | 169 | obj = &buf->data[page][idx]; |
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index d2ab01e90a96..dcbeb98f195a 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
| @@ -103,8 +103,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, | |||
| 103 | if (connector->funcs->force) | 103 | if (connector->funcs->force) |
| 104 | connector->funcs->force(connector); | 104 | connector->funcs->force(connector); |
| 105 | } else { | 105 | } else { |
| 106 | connector->status = connector->funcs->detect(connector); | 106 | connector->status = connector->funcs->detect(connector, true); |
| 107 | drm_helper_hpd_irq_event(dev); | 107 | drm_kms_helper_poll_enable(dev); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | if (connector->status == connector_status_disconnected) { | 110 | if (connector->status == connector_status_disconnected) { |
| @@ -637,13 +637,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
| 637 | mode_changed = true; | 637 | mode_changed = true; |
| 638 | 638 | ||
| 639 | if (mode_changed) { | 639 | if (mode_changed) { |
| 640 | old_fb = set->crtc->fb; | ||
| 641 | set->crtc->fb = set->fb; | ||
| 642 | set->crtc->enabled = (set->mode != NULL); | 640 | set->crtc->enabled = (set->mode != NULL); |
| 643 | if (set->mode != NULL) { | 641 | if (set->mode != NULL) { |
| 644 | DRM_DEBUG_KMS("attempting to set mode from" | 642 | DRM_DEBUG_KMS("attempting to set mode from" |
| 645 | " userspace\n"); | 643 | " userspace\n"); |
| 646 | drm_mode_debug_printmodeline(set->mode); | 644 | drm_mode_debug_printmodeline(set->mode); |
| 645 | old_fb = set->crtc->fb; | ||
| 646 | set->crtc->fb = set->fb; | ||
| 647 | if (!drm_crtc_helper_set_mode(set->crtc, set->mode, | 647 | if (!drm_crtc_helper_set_mode(set->crtc, set->mode, |
| 648 | set->x, set->y, | 648 | set->x, set->y, |
| 649 | old_fb)) { | 649 | old_fb)) { |
| @@ -866,7 +866,7 @@ static void output_poll_execute(struct work_struct *work) | |||
| 866 | !(connector->polled & DRM_CONNECTOR_POLL_HPD)) | 866 | !(connector->polled & DRM_CONNECTOR_POLL_HPD)) |
| 867 | continue; | 867 | continue; |
| 868 | 868 | ||
| 869 | status = connector->funcs->detect(connector); | 869 | status = connector->funcs->detect(connector, false); |
| 870 | if (old_status != status) | 870 | if (old_status != status) |
| 871 | changed = true; | 871 | changed = true; |
| 872 | } | 872 | } |
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index bf92d07510df..5663d2719063 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c | |||
| @@ -148,7 +148,7 @@ int drm_gem_object_init(struct drm_device *dev, | |||
| 148 | return -ENOMEM; | 148 | return -ENOMEM; |
| 149 | 149 | ||
| 150 | kref_init(&obj->refcount); | 150 | kref_init(&obj->refcount); |
| 151 | kref_init(&obj->handlecount); | 151 | atomic_set(&obj->handle_count, 0); |
| 152 | obj->size = size; | 152 | obj->size = size; |
| 153 | 153 | ||
| 154 | atomic_inc(&dev->object_count); | 154 | atomic_inc(&dev->object_count); |
| @@ -462,28 +462,6 @@ drm_gem_object_free(struct kref *kref) | |||
| 462 | } | 462 | } |
| 463 | EXPORT_SYMBOL(drm_gem_object_free); | 463 | EXPORT_SYMBOL(drm_gem_object_free); |
| 464 | 464 | ||
| 465 | /** | ||
| 466 | * Called after the last reference to the object has been lost. | ||
| 467 | * Must be called without holding struct_mutex | ||
| 468 | * | ||
| 469 | * Frees the object | ||
| 470 | */ | ||
| 471 | void | ||
| 472 | drm_gem_object_free_unlocked(struct kref *kref) | ||
| 473 | { | ||
| 474 | struct drm_gem_object *obj = (struct drm_gem_object *) kref; | ||
| 475 | struct drm_device *dev = obj->dev; | ||
| 476 | |||
| 477 | if (dev->driver->gem_free_object_unlocked != NULL) | ||
| 478 | dev->driver->gem_free_object_unlocked(obj); | ||
| 479 | else if (dev->driver->gem_free_object != NULL) { | ||
| 480 | mutex_lock(&dev->struct_mutex); | ||
| 481 | dev->driver->gem_free_object(obj); | ||
| 482 | mutex_unlock(&dev->struct_mutex); | ||
| 483 | } | ||
| 484 | } | ||
| 485 | EXPORT_SYMBOL(drm_gem_object_free_unlocked); | ||
| 486 | |||
| 487 | static void drm_gem_object_ref_bug(struct kref *list_kref) | 465 | static void drm_gem_object_ref_bug(struct kref *list_kref) |
| 488 | { | 466 | { |
| 489 | BUG(); | 467 | BUG(); |
| @@ -496,12 +474,8 @@ static void drm_gem_object_ref_bug(struct kref *list_kref) | |||
| 496 | * called before drm_gem_object_free or we'll be touching | 474 | * called before drm_gem_object_free or we'll be touching |
| 497 | * freed memory | 475 | * freed memory |
| 498 | */ | 476 | */ |
| 499 | void | 477 | void drm_gem_object_handle_free(struct drm_gem_object *obj) |
| 500 | drm_gem_object_handle_free(struct kref *kref) | ||
| 501 | { | 478 | { |
| 502 | struct drm_gem_object *obj = container_of(kref, | ||
| 503 | struct drm_gem_object, | ||
| 504 | handlecount); | ||
| 505 | struct drm_device *dev = obj->dev; | 479 | struct drm_device *dev = obj->dev; |
| 506 | 480 | ||
| 507 | /* Remove any name for this object */ | 481 | /* Remove any name for this object */ |
| @@ -528,6 +502,10 @@ void drm_gem_vm_open(struct vm_area_struct *vma) | |||
| 528 | struct drm_gem_object *obj = vma->vm_private_data; | 502 | struct drm_gem_object *obj = vma->vm_private_data; |
| 529 | 503 | ||
| 530 | drm_gem_object_reference(obj); | 504 | drm_gem_object_reference(obj); |
| 505 | |||
| 506 | mutex_lock(&obj->dev->struct_mutex); | ||
| 507 | drm_vm_open_locked(vma); | ||
| 508 | mutex_unlock(&obj->dev->struct_mutex); | ||
| 531 | } | 509 | } |
| 532 | EXPORT_SYMBOL(drm_gem_vm_open); | 510 | EXPORT_SYMBOL(drm_gem_vm_open); |
| 533 | 511 | ||
| @@ -535,7 +513,10 @@ void drm_gem_vm_close(struct vm_area_struct *vma) | |||
| 535 | { | 513 | { |
| 536 | struct drm_gem_object *obj = vma->vm_private_data; | 514 | struct drm_gem_object *obj = vma->vm_private_data; |
| 537 | 515 | ||
| 538 | drm_gem_object_unreference_unlocked(obj); | 516 | mutex_lock(&obj->dev->struct_mutex); |
| 517 | drm_vm_close_locked(vma); | ||
| 518 | drm_gem_object_unreference(obj); | ||
| 519 | mutex_unlock(&obj->dev->struct_mutex); | ||
| 539 | } | 520 | } |
| 540 | EXPORT_SYMBOL(drm_gem_vm_close); | 521 | EXPORT_SYMBOL(drm_gem_vm_close); |
| 541 | 522 | ||
diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c index 2ef2c7827243..974e970ce3f8 100644 --- a/drivers/gpu/drm/drm_info.c +++ b/drivers/gpu/drm/drm_info.c | |||
| @@ -255,7 +255,7 @@ int drm_gem_one_name_info(int id, void *ptr, void *data) | |||
| 255 | 255 | ||
| 256 | seq_printf(m, "%6d %8zd %7d %8d\n", | 256 | seq_printf(m, "%6d %8zd %7d %8d\n", |
| 257 | obj->name, obj->size, | 257 | obj->name, obj->size, |
| 258 | atomic_read(&obj->handlecount.refcount), | 258 | atomic_read(&obj->handle_count), |
| 259 | atomic_read(&obj->refcount.refcount)); | 259 | atomic_read(&obj->refcount.refcount)); |
| 260 | return 0; | 260 | return 0; |
| 261 | } | 261 | } |
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index e20f78b542a7..f5bd9e590c80 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c | |||
| @@ -164,6 +164,8 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, | |||
| 164 | dev->hose = pdev->sysdata; | 164 | dev->hose = pdev->sysdata; |
| 165 | #endif | 165 | #endif |
| 166 | 166 | ||
| 167 | mutex_lock(&drm_global_mutex); | ||
| 168 | |||
| 167 | if ((ret = drm_fill_in_dev(dev, ent, driver))) { | 169 | if ((ret = drm_fill_in_dev(dev, ent, driver))) { |
| 168 | printk(KERN_ERR "DRM: Fill_in_dev failed.\n"); | 170 | printk(KERN_ERR "DRM: Fill_in_dev failed.\n"); |
| 169 | goto err_g2; | 171 | goto err_g2; |
| @@ -199,6 +201,7 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, | |||
| 199 | driver->name, driver->major, driver->minor, driver->patchlevel, | 201 | driver->name, driver->major, driver->minor, driver->patchlevel, |
| 200 | driver->date, pci_name(pdev), dev->primary->index); | 202 | driver->date, pci_name(pdev), dev->primary->index); |
| 201 | 203 | ||
| 204 | mutex_unlock(&drm_global_mutex); | ||
| 202 | return 0; | 205 | return 0; |
| 203 | 206 | ||
| 204 | err_g4: | 207 | err_g4: |
| @@ -210,6 +213,7 @@ err_g2: | |||
| 210 | pci_disable_device(pdev); | 213 | pci_disable_device(pdev); |
| 211 | err_g1: | 214 | err_g1: |
| 212 | kfree(dev); | 215 | kfree(dev); |
| 216 | mutex_unlock(&drm_global_mutex); | ||
| 213 | return ret; | 217 | return ret; |
| 214 | } | 218 | } |
| 215 | EXPORT_SYMBOL(drm_get_pci_dev); | 219 | EXPORT_SYMBOL(drm_get_pci_dev); |
diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c index 460e9a3afa8d..92d1d0fb7b75 100644 --- a/drivers/gpu/drm/drm_platform.c +++ b/drivers/gpu/drm/drm_platform.c | |||
| @@ -53,6 +53,8 @@ int drm_get_platform_dev(struct platform_device *platdev, | |||
| 53 | dev->platformdev = platdev; | 53 | dev->platformdev = platdev; |
| 54 | dev->dev = &platdev->dev; | 54 | dev->dev = &platdev->dev; |
| 55 | 55 | ||
| 56 | mutex_lock(&drm_global_mutex); | ||
| 57 | |||
| 56 | ret = drm_fill_in_dev(dev, NULL, driver); | 58 | ret = drm_fill_in_dev(dev, NULL, driver); |
| 57 | 59 | ||
| 58 | if (ret) { | 60 | if (ret) { |
| @@ -87,6 +89,8 @@ int drm_get_platform_dev(struct platform_device *platdev, | |||
| 87 | 89 | ||
| 88 | list_add_tail(&dev->driver_item, &driver->device_list); | 90 | list_add_tail(&dev->driver_item, &driver->device_list); |
| 89 | 91 | ||
| 92 | mutex_unlock(&drm_global_mutex); | ||
| 93 | |||
| 90 | DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", | 94 | DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", |
| 91 | driver->name, driver->major, driver->minor, driver->patchlevel, | 95 | driver->name, driver->major, driver->minor, driver->patchlevel, |
| 92 | driver->date, dev->primary->index); | 96 | driver->date, dev->primary->index); |
| @@ -100,6 +104,7 @@ err_g2: | |||
| 100 | drm_put_minor(&dev->control); | 104 | drm_put_minor(&dev->control); |
| 101 | err_g1: | 105 | err_g1: |
| 102 | kfree(dev); | 106 | kfree(dev); |
| 107 | mutex_unlock(&drm_global_mutex); | ||
| 103 | return ret; | 108 | return ret; |
| 104 | } | 109 | } |
| 105 | EXPORT_SYMBOL(drm_get_platform_dev); | 110 | EXPORT_SYMBOL(drm_get_platform_dev); |
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 86118a742231..85da4c40694c 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c | |||
| @@ -159,7 +159,7 @@ static ssize_t status_show(struct device *device, | |||
| 159 | struct drm_connector *connector = to_drm_connector(device); | 159 | struct drm_connector *connector = to_drm_connector(device); |
| 160 | enum drm_connector_status status; | 160 | enum drm_connector_status status; |
| 161 | 161 | ||
| 162 | status = connector->funcs->detect(connector); | 162 | status = connector->funcs->detect(connector, true); |
| 163 | return snprintf(buf, PAGE_SIZE, "%s\n", | 163 | return snprintf(buf, PAGE_SIZE, "%s\n", |
| 164 | drm_get_connector_status_name(status)); | 164 | drm_get_connector_status_name(status)); |
| 165 | } | 165 | } |
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index fda67468e603..5df450683aab 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c | |||
| @@ -433,15 +433,7 @@ static void drm_vm_open(struct vm_area_struct *vma) | |||
| 433 | mutex_unlock(&dev->struct_mutex); | 433 | mutex_unlock(&dev->struct_mutex); |
| 434 | } | 434 | } |
| 435 | 435 | ||
| 436 | /** | 436 | void drm_vm_close_locked(struct vm_area_struct *vma) |
| 437 | * \c close method for all virtual memory types. | ||
| 438 | * | ||
| 439 | * \param vma virtual memory area. | ||
| 440 | * | ||
| 441 | * Search the \p vma private data entry in drm_device::vmalist, unlink it, and | ||
| 442 | * free it. | ||
| 443 | */ | ||
| 444 | static void drm_vm_close(struct vm_area_struct *vma) | ||
| 445 | { | 437 | { |
| 446 | struct drm_file *priv = vma->vm_file->private_data; | 438 | struct drm_file *priv = vma->vm_file->private_data; |
| 447 | struct drm_device *dev = priv->minor->dev; | 439 | struct drm_device *dev = priv->minor->dev; |
| @@ -451,7 +443,6 @@ static void drm_vm_close(struct vm_area_struct *vma) | |||
| 451 | vma->vm_start, vma->vm_end - vma->vm_start); | 443 | vma->vm_start, vma->vm_end - vma->vm_start); |
| 452 | atomic_dec(&dev->vma_count); | 444 | atomic_dec(&dev->vma_count); |
| 453 | 445 | ||
| 454 | mutex_lock(&dev->struct_mutex); | ||
| 455 | list_for_each_entry_safe(pt, temp, &dev->vmalist, head) { | 446 | list_for_each_entry_safe(pt, temp, &dev->vmalist, head) { |
| 456 | if (pt->vma == vma) { | 447 | if (pt->vma == vma) { |
| 457 | list_del(&pt->head); | 448 | list_del(&pt->head); |
| @@ -459,6 +450,23 @@ static void drm_vm_close(struct vm_area_struct *vma) | |||
| 459 | break; | 450 | break; |
| 460 | } | 451 | } |
| 461 | } | 452 | } |
| 453 | } | ||
| 454 | |||
| 455 | /** | ||
| 456 | * \c close method for all virtual memory types. | ||
| 457 | * | ||
| 458 | * \param vma virtual memory area. | ||
| 459 | * | ||
| 460 | * Search the \p vma private data entry in drm_device::vmalist, unlink it, and | ||
| 461 | * free it. | ||
| 462 | */ | ||
| 463 | static void drm_vm_close(struct vm_area_struct *vma) | ||
| 464 | { | ||
| 465 | struct drm_file *priv = vma->vm_file->private_data; | ||
| 466 | struct drm_device *dev = priv->minor->dev; | ||
| 467 | |||
| 468 | mutex_lock(&dev->struct_mutex); | ||
| 469 | drm_vm_close_locked(vma); | ||
| 462 | mutex_unlock(&dev->struct_mutex); | 470 | mutex_unlock(&dev->struct_mutex); |
| 463 | } | 471 | } |
| 464 | 472 | ||
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c index 61b4caf220fa..fb07e73581e8 100644 --- a/drivers/gpu/drm/i810/i810_dma.c +++ b/drivers/gpu/drm/i810/i810_dma.c | |||
| @@ -116,7 +116,7 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) | |||
| 116 | static const struct file_operations i810_buffer_fops = { | 116 | static const struct file_operations i810_buffer_fops = { |
| 117 | .open = drm_open, | 117 | .open = drm_open, |
| 118 | .release = drm_release, | 118 | .release = drm_release, |
| 119 | .unlocked_ioctl = drm_ioctl, | 119 | .unlocked_ioctl = i810_ioctl, |
| 120 | .mmap = i810_mmap_buffers, | 120 | .mmap = i810_mmap_buffers, |
| 121 | .fasync = drm_fasync, | 121 | .fasync = drm_fasync, |
| 122 | }; | 122 | }; |
diff --git a/drivers/gpu/drm/i830/i830_dma.c b/drivers/gpu/drm/i830/i830_dma.c index 671aa18415ac..cc92c7e6236f 100644 --- a/drivers/gpu/drm/i830/i830_dma.c +++ b/drivers/gpu/drm/i830/i830_dma.c | |||
| @@ -118,7 +118,7 @@ static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) | |||
| 118 | static const struct file_operations i830_buffer_fops = { | 118 | static const struct file_operations i830_buffer_fops = { |
| 119 | .open = drm_open, | 119 | .open = drm_open, |
| 120 | .release = drm_release, | 120 | .release = drm_release, |
| 121 | .unlocked_ioctl = drm_ioctl, | 121 | .unlocked_ioctl = i830_ioctl, |
| 122 | .mmap = i830_mmap_buffers, | 122 | .mmap = i830_mmap_buffers, |
| 123 | .fasync = drm_fasync, | 123 | .fasync = drm_fasync, |
| 124 | }; | 124 | }; |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 9d67b4853030..2dd2c93ebfa3 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
| @@ -1787,9 +1787,9 @@ unsigned long i915_chipset_val(struct drm_i915_private *dev_priv) | |||
| 1787 | } | 1787 | } |
| 1788 | } | 1788 | } |
| 1789 | 1789 | ||
| 1790 | div_u64(diff, diff1); | 1790 | diff = div_u64(diff, diff1); |
| 1791 | ret = ((m * diff) + c); | 1791 | ret = ((m * diff) + c); |
| 1792 | div_u64(ret, 10); | 1792 | ret = div_u64(ret, 10); |
| 1793 | 1793 | ||
| 1794 | dev_priv->last_count1 = total_count; | 1794 | dev_priv->last_count1 = total_count; |
| 1795 | dev_priv->last_time1 = now; | 1795 | dev_priv->last_time1 = now; |
| @@ -1858,7 +1858,7 @@ void i915_update_gfx_val(struct drm_i915_private *dev_priv) | |||
| 1858 | 1858 | ||
| 1859 | /* More magic constants... */ | 1859 | /* More magic constants... */ |
| 1860 | diff = diff * 1181; | 1860 | diff = diff * 1181; |
| 1861 | div_u64(diff, diffms * 10); | 1861 | diff = div_u64(diff, diffms * 10); |
| 1862 | dev_priv->gfx_power = diff; | 1862 | dev_priv->gfx_power = diff; |
| 1863 | } | 1863 | } |
| 1864 | 1864 | ||
| @@ -2231,6 +2231,9 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
| 2231 | dev_priv->mchdev_lock = &mchdev_lock; | 2231 | dev_priv->mchdev_lock = &mchdev_lock; |
| 2232 | spin_unlock(&mchdev_lock); | 2232 | spin_unlock(&mchdev_lock); |
| 2233 | 2233 | ||
| 2234 | /* XXX Prevent module unload due to memory corruption bugs. */ | ||
| 2235 | __module_get(THIS_MODULE); | ||
| 2236 | |||
| 2234 | return 0; | 2237 | return 0; |
| 2235 | 2238 | ||
| 2236 | out_workqueue_free: | 2239 | out_workqueue_free: |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 216deb579785..6dbe14cc4f74 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
| @@ -170,6 +170,7 @@ static const struct pci_device_id pciidlist[] = { /* aka */ | |||
| 170 | INTEL_VGA_DEVICE(0x2e22, &intel_g45_info), /* G45_G */ | 170 | INTEL_VGA_DEVICE(0x2e22, &intel_g45_info), /* G45_G */ |
| 171 | INTEL_VGA_DEVICE(0x2e32, &intel_g45_info), /* G41_G */ | 171 | INTEL_VGA_DEVICE(0x2e32, &intel_g45_info), /* G41_G */ |
| 172 | INTEL_VGA_DEVICE(0x2e42, &intel_g45_info), /* B43_G */ | 172 | INTEL_VGA_DEVICE(0x2e42, &intel_g45_info), /* B43_G */ |
| 173 | INTEL_VGA_DEVICE(0x2e92, &intel_g45_info), /* B43_G.1 */ | ||
| 173 | INTEL_VGA_DEVICE(0xa001, &intel_pineview_info), | 174 | INTEL_VGA_DEVICE(0xa001, &intel_pineview_info), |
| 174 | INTEL_VGA_DEVICE(0xa011, &intel_pineview_info), | 175 | INTEL_VGA_DEVICE(0xa011, &intel_pineview_info), |
| 175 | INTEL_VGA_DEVICE(0x0042, &intel_ironlake_d_info), | 176 | INTEL_VGA_DEVICE(0x0042, &intel_ironlake_d_info), |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 16fca1d1799a..90b1d6753b9d 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -136,14 +136,12 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data, | |||
| 136 | return -ENOMEM; | 136 | return -ENOMEM; |
| 137 | 137 | ||
| 138 | ret = drm_gem_handle_create(file_priv, obj, &handle); | 138 | ret = drm_gem_handle_create(file_priv, obj, &handle); |
| 139 | /* drop reference from allocate - handle holds it now */ | ||
| 140 | drm_gem_object_unreference_unlocked(obj); | ||
| 139 | if (ret) { | 141 | if (ret) { |
| 140 | drm_gem_object_unreference_unlocked(obj); | ||
| 141 | return ret; | 142 | return ret; |
| 142 | } | 143 | } |
| 143 | 144 | ||
| 144 | /* Sink the floating reference from kref_init(handlecount) */ | ||
| 145 | drm_gem_object_handle_unreference_unlocked(obj); | ||
| 146 | |||
| 147 | args->handle = handle; | 145 | args->handle = handle; |
| 148 | return 0; | 146 | return 0; |
| 149 | } | 147 | } |
| @@ -471,14 +469,17 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data, | |||
| 471 | return -ENOENT; | 469 | return -ENOENT; |
| 472 | obj_priv = to_intel_bo(obj); | 470 | obj_priv = to_intel_bo(obj); |
| 473 | 471 | ||
| 474 | /* Bounds check source. | 472 | /* Bounds check source. */ |
| 475 | * | 473 | if (args->offset > obj->size || args->size > obj->size - args->offset) { |
| 476 | * XXX: This could use review for overflow issues... | 474 | ret = -EINVAL; |
| 477 | */ | 475 | goto err; |
| 478 | if (args->offset > obj->size || args->size > obj->size || | 476 | } |
| 479 | args->offset + args->size > obj->size) { | 477 | |
| 480 | drm_gem_object_unreference_unlocked(obj); | 478 | if (!access_ok(VERIFY_WRITE, |
| 481 | return -EINVAL; | 479 | (char __user *)(uintptr_t)args->data_ptr, |
| 480 | args->size)) { | ||
| 481 | ret = -EFAULT; | ||
| 482 | goto err; | ||
| 482 | } | 483 | } |
| 483 | 484 | ||
| 484 | if (i915_gem_object_needs_bit17_swizzle(obj)) { | 485 | if (i915_gem_object_needs_bit17_swizzle(obj)) { |
| @@ -490,8 +491,8 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data, | |||
| 490 | file_priv); | 491 | file_priv); |
| 491 | } | 492 | } |
| 492 | 493 | ||
| 494 | err: | ||
| 493 | drm_gem_object_unreference_unlocked(obj); | 495 | drm_gem_object_unreference_unlocked(obj); |
| 494 | |||
| 495 | return ret; | 496 | return ret; |
| 496 | } | 497 | } |
| 497 | 498 | ||
| @@ -580,8 +581,6 @@ i915_gem_gtt_pwrite_fast(struct drm_device *dev, struct drm_gem_object *obj, | |||
| 580 | 581 | ||
| 581 | user_data = (char __user *) (uintptr_t) args->data_ptr; | 582 | user_data = (char __user *) (uintptr_t) args->data_ptr; |
| 582 | remain = args->size; | 583 | remain = args->size; |
| 583 | if (!access_ok(VERIFY_READ, user_data, remain)) | ||
| 584 | return -EFAULT; | ||
| 585 | 584 | ||
| 586 | 585 | ||
| 587 | mutex_lock(&dev->struct_mutex); | 586 | mutex_lock(&dev->struct_mutex); |
| @@ -934,14 +933,17 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, | |||
| 934 | return -ENOENT; | 933 | return -ENOENT; |
| 935 | obj_priv = to_intel_bo(obj); | 934 | obj_priv = to_intel_bo(obj); |
| 936 | 935 | ||
| 937 | /* Bounds check destination. | 936 | /* Bounds check destination. */ |
| 938 | * | 937 | if (args->offset > obj->size || args->size > obj->size - args->offset) { |
| 939 | * XXX: This could use review for overflow issues... | 938 | ret = -EINVAL; |
| 940 | */ | 939 | goto err; |
| 941 | if (args->offset > obj->size || args->size > obj->size || | 940 | } |
| 942 | args->offset + args->size > obj->size) { | 941 | |
| 943 | drm_gem_object_unreference_unlocked(obj); | 942 | if (!access_ok(VERIFY_READ, |
| 944 | return -EINVAL; | 943 | (char __user *)(uintptr_t)args->data_ptr, |
| 944 | args->size)) { | ||
| 945 | ret = -EFAULT; | ||
| 946 | goto err; | ||
| 945 | } | 947 | } |
| 946 | 948 | ||
| 947 | /* We can only do the GTT pwrite on untiled buffers, as otherwise | 949 | /* We can only do the GTT pwrite on untiled buffers, as otherwise |
| @@ -975,8 +977,8 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, | |||
| 975 | DRM_INFO("pwrite failed %d\n", ret); | 977 | DRM_INFO("pwrite failed %d\n", ret); |
| 976 | #endif | 978 | #endif |
| 977 | 979 | ||
| 980 | err: | ||
| 978 | drm_gem_object_unreference_unlocked(obj); | 981 | drm_gem_object_unreference_unlocked(obj); |
| 979 | |||
| 980 | return ret; | 982 | return ret; |
| 981 | } | 983 | } |
| 982 | 984 | ||
| @@ -2351,14 +2353,21 @@ i915_gem_object_get_fence_reg(struct drm_gem_object *obj) | |||
| 2351 | 2353 | ||
| 2352 | reg->obj = obj; | 2354 | reg->obj = obj; |
| 2353 | 2355 | ||
| 2354 | if (IS_GEN6(dev)) | 2356 | switch (INTEL_INFO(dev)->gen) { |
| 2357 | case 6: | ||
| 2355 | sandybridge_write_fence_reg(reg); | 2358 | sandybridge_write_fence_reg(reg); |
| 2356 | else if (IS_I965G(dev)) | 2359 | break; |
| 2360 | case 5: | ||
| 2361 | case 4: | ||
| 2357 | i965_write_fence_reg(reg); | 2362 | i965_write_fence_reg(reg); |
| 2358 | else if (IS_I9XX(dev)) | 2363 | break; |
| 2364 | case 3: | ||
| 2359 | i915_write_fence_reg(reg); | 2365 | i915_write_fence_reg(reg); |
| 2360 | else | 2366 | break; |
| 2367 | case 2: | ||
| 2361 | i830_write_fence_reg(reg); | 2368 | i830_write_fence_reg(reg); |
| 2369 | break; | ||
| 2370 | } | ||
| 2362 | 2371 | ||
| 2363 | trace_i915_gem_object_get_fence(obj, obj_priv->fence_reg, | 2372 | trace_i915_gem_object_get_fence(obj, obj_priv->fence_reg, |
| 2364 | obj_priv->tiling_mode); | 2373 | obj_priv->tiling_mode); |
| @@ -2381,22 +2390,26 @@ i915_gem_clear_fence_reg(struct drm_gem_object *obj) | |||
| 2381 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); | 2390 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); |
| 2382 | struct drm_i915_fence_reg *reg = | 2391 | struct drm_i915_fence_reg *reg = |
| 2383 | &dev_priv->fence_regs[obj_priv->fence_reg]; | 2392 | &dev_priv->fence_regs[obj_priv->fence_reg]; |
| 2393 | uint32_t fence_reg; | ||
| 2384 | 2394 | ||
| 2385 | if (IS_GEN6(dev)) { | 2395 | switch (INTEL_INFO(dev)->gen) { |
| 2396 | case 6: | ||
| 2386 | I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 + | 2397 | I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 + |
| 2387 | (obj_priv->fence_reg * 8), 0); | 2398 | (obj_priv->fence_reg * 8), 0); |
| 2388 | } else if (IS_I965G(dev)) { | 2399 | break; |
| 2400 | case 5: | ||
| 2401 | case 4: | ||
| 2389 | I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0); | 2402 | I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0); |
| 2390 | } else { | 2403 | break; |
| 2391 | uint32_t fence_reg; | 2404 | case 3: |
| 2392 | 2405 | if (obj_priv->fence_reg >= 8) | |
| 2393 | if (obj_priv->fence_reg < 8) | 2406 | fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - 8) * 4; |
| 2394 | fence_reg = FENCE_REG_830_0 + obj_priv->fence_reg * 4; | ||
| 2395 | else | 2407 | else |
| 2396 | fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - | 2408 | case 2: |
| 2397 | 8) * 4; | 2409 | fence_reg = FENCE_REG_830_0 + obj_priv->fence_reg * 4; |
| 2398 | 2410 | ||
| 2399 | I915_WRITE(fence_reg, 0); | 2411 | I915_WRITE(fence_reg, 0); |
| 2412 | break; | ||
| 2400 | } | 2413 | } |
| 2401 | 2414 | ||
| 2402 | reg->obj = NULL; | 2415 | reg->obj = NULL; |
| @@ -3247,6 +3260,8 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, | |||
| 3247 | (int) reloc->offset, | 3260 | (int) reloc->offset, |
| 3248 | reloc->read_domains, | 3261 | reloc->read_domains, |
| 3249 | reloc->write_domain); | 3262 | reloc->write_domain); |
| 3263 | drm_gem_object_unreference(target_obj); | ||
| 3264 | i915_gem_object_unpin(obj); | ||
| 3250 | return -EINVAL; | 3265 | return -EINVAL; |
| 3251 | } | 3266 | } |
| 3252 | if (reloc->write_domain & I915_GEM_DOMAIN_CPU || | 3267 | if (reloc->write_domain & I915_GEM_DOMAIN_CPU || |
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c index 72cae3cccad8..5c428fa3e0b3 100644 --- a/drivers/gpu/drm/i915/i915_gem_evict.c +++ b/drivers/gpu/drm/i915/i915_gem_evict.c | |||
| @@ -79,6 +79,7 @@ mark_free(struct drm_i915_gem_object *obj_priv, | |||
| 79 | struct list_head *unwind) | 79 | struct list_head *unwind) |
| 80 | { | 80 | { |
| 81 | list_add(&obj_priv->evict_list, unwind); | 81 | list_add(&obj_priv->evict_list, unwind); |
| 82 | drm_gem_object_reference(&obj_priv->base); | ||
| 82 | return drm_mm_scan_add_block(obj_priv->gtt_space); | 83 | return drm_mm_scan_add_block(obj_priv->gtt_space); |
| 83 | } | 84 | } |
| 84 | 85 | ||
| @@ -92,7 +93,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen | |||
| 92 | { | 93 | { |
| 93 | drm_i915_private_t *dev_priv = dev->dev_private; | 94 | drm_i915_private_t *dev_priv = dev->dev_private; |
| 94 | struct list_head eviction_list, unwind_list; | 95 | struct list_head eviction_list, unwind_list; |
| 95 | struct drm_i915_gem_object *obj_priv, *tmp_obj_priv; | 96 | struct drm_i915_gem_object *obj_priv; |
| 96 | struct list_head *render_iter, *bsd_iter; | 97 | struct list_head *render_iter, *bsd_iter; |
| 97 | int ret = 0; | 98 | int ret = 0; |
| 98 | 99 | ||
| @@ -165,6 +166,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen | |||
| 165 | list_for_each_entry(obj_priv, &unwind_list, evict_list) { | 166 | list_for_each_entry(obj_priv, &unwind_list, evict_list) { |
| 166 | ret = drm_mm_scan_remove_block(obj_priv->gtt_space); | 167 | ret = drm_mm_scan_remove_block(obj_priv->gtt_space); |
| 167 | BUG_ON(ret); | 168 | BUG_ON(ret); |
| 169 | drm_gem_object_unreference(&obj_priv->base); | ||
| 168 | } | 170 | } |
| 169 | 171 | ||
| 170 | /* We expect the caller to unpin, evict all and try again, or give up. | 172 | /* We expect the caller to unpin, evict all and try again, or give up. |
| @@ -173,36 +175,34 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen | |||
| 173 | return -ENOSPC; | 175 | return -ENOSPC; |
| 174 | 176 | ||
| 175 | found: | 177 | found: |
| 178 | /* drm_mm doesn't allow any other other operations while | ||
| 179 | * scanning, therefore store to be evicted objects on a | ||
| 180 | * temporary list. */ | ||
| 176 | INIT_LIST_HEAD(&eviction_list); | 181 | INIT_LIST_HEAD(&eviction_list); |
| 177 | list_for_each_entry_safe(obj_priv, tmp_obj_priv, | 182 | while (!list_empty(&unwind_list)) { |
| 178 | &unwind_list, evict_list) { | 183 | obj_priv = list_first_entry(&unwind_list, |
| 184 | struct drm_i915_gem_object, | ||
| 185 | evict_list); | ||
| 179 | if (drm_mm_scan_remove_block(obj_priv->gtt_space)) { | 186 | if (drm_mm_scan_remove_block(obj_priv->gtt_space)) { |
| 180 | /* drm_mm doesn't allow any other other operations while | ||
| 181 | * scanning, therefore store to be evicted objects on a | ||
| 182 | * temporary list. */ | ||
| 183 | list_move(&obj_priv->evict_list, &eviction_list); | 187 | list_move(&obj_priv->evict_list, &eviction_list); |
| 188 | continue; | ||
| 184 | } | 189 | } |
| 190 | list_del(&obj_priv->evict_list); | ||
| 191 | drm_gem_object_unreference(&obj_priv->base); | ||
| 185 | } | 192 | } |
| 186 | 193 | ||
| 187 | /* Unbinding will emit any required flushes */ | 194 | /* Unbinding will emit any required flushes */ |
| 188 | list_for_each_entry_safe(obj_priv, tmp_obj_priv, | 195 | while (!list_empty(&eviction_list)) { |
| 189 | &eviction_list, evict_list) { | 196 | obj_priv = list_first_entry(&eviction_list, |
| 190 | #if WATCH_LRU | 197 | struct drm_i915_gem_object, |
| 191 | DRM_INFO("%s: evicting %p\n", __func__, obj); | 198 | evict_list); |
| 192 | #endif | 199 | if (ret == 0) |
| 193 | ret = i915_gem_object_unbind(&obj_priv->base); | 200 | ret = i915_gem_object_unbind(&obj_priv->base); |
| 194 | if (ret) | 201 | list_del(&obj_priv->evict_list); |
| 195 | return ret; | 202 | drm_gem_object_unreference(&obj_priv->base); |
| 196 | } | 203 | } |
| 197 | 204 | ||
| 198 | /* The just created free hole should be on the top of the free stack | 205 | return ret; |
| 199 | * maintained by drm_mm, so this BUG_ON actually executes in O(1). | ||
| 200 | * Furthermore all accessed data has just recently been used, so it | ||
| 201 | * should be really fast, too. */ | ||
| 202 | BUG_ON(!drm_mm_search_free(&dev_priv->mm.gtt_space, min_size, | ||
| 203 | alignment, 0)); | ||
| 204 | |||
| 205 | return 0; | ||
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | int | 208 | int |
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 2c6b98f2440e..31f08581e93a 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c | |||
| @@ -789,16 +789,25 @@ int i915_save_state(struct drm_device *dev) | |||
| 789 | dev_priv->saveSWF2[i] = I915_READ(SWF30 + (i << 2)); | 789 | dev_priv->saveSWF2[i] = I915_READ(SWF30 + (i << 2)); |
| 790 | 790 | ||
| 791 | /* Fences */ | 791 | /* Fences */ |
| 792 | if (IS_I965G(dev)) { | 792 | switch (INTEL_INFO(dev)->gen) { |
| 793 | case 6: | ||
| 794 | for (i = 0; i < 16; i++) | ||
| 795 | dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_SANDYBRIDGE_0 + (i * 8)); | ||
| 796 | break; | ||
| 797 | case 5: | ||
| 798 | case 4: | ||
| 793 | for (i = 0; i < 16; i++) | 799 | for (i = 0; i < 16; i++) |
| 794 | dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_965_0 + (i * 8)); | 800 | dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_965_0 + (i * 8)); |
| 795 | } else { | 801 | break; |
| 796 | for (i = 0; i < 8; i++) | 802 | case 3: |
| 797 | dev_priv->saveFENCE[i] = I915_READ(FENCE_REG_830_0 + (i * 4)); | ||
| 798 | |||
| 799 | if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) | 803 | if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) |
| 800 | for (i = 0; i < 8; i++) | 804 | for (i = 0; i < 8; i++) |
| 801 | dev_priv->saveFENCE[i+8] = I915_READ(FENCE_REG_945_8 + (i * 4)); | 805 | dev_priv->saveFENCE[i+8] = I915_READ(FENCE_REG_945_8 + (i * 4)); |
| 806 | case 2: | ||
| 807 | for (i = 0; i < 8; i++) | ||
| 808 | dev_priv->saveFENCE[i] = I915_READ(FENCE_REG_830_0 + (i * 4)); | ||
| 809 | break; | ||
| 810 | |||
| 802 | } | 811 | } |
| 803 | 812 | ||
| 804 | return 0; | 813 | return 0; |
| @@ -815,15 +824,24 @@ int i915_restore_state(struct drm_device *dev) | |||
| 815 | I915_WRITE(HWS_PGA, dev_priv->saveHWS); | 824 | I915_WRITE(HWS_PGA, dev_priv->saveHWS); |
| 816 | 825 | ||
| 817 | /* Fences */ | 826 | /* Fences */ |
| 818 | if (IS_I965G(dev)) { | 827 | switch (INTEL_INFO(dev)->gen) { |
| 828 | case 6: | ||
| 829 | for (i = 0; i < 16; i++) | ||
| 830 | I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 + (i * 8), dev_priv->saveFENCE[i]); | ||
| 831 | break; | ||
| 832 | case 5: | ||
| 833 | case 4: | ||
| 819 | for (i = 0; i < 16; i++) | 834 | for (i = 0; i < 16; i++) |
| 820 | I915_WRITE64(FENCE_REG_965_0 + (i * 8), dev_priv->saveFENCE[i]); | 835 | I915_WRITE64(FENCE_REG_965_0 + (i * 8), dev_priv->saveFENCE[i]); |
| 821 | } else { | 836 | break; |
| 822 | for (i = 0; i < 8; i++) | 837 | case 3: |
| 823 | I915_WRITE(FENCE_REG_830_0 + (i * 4), dev_priv->saveFENCE[i]); | 838 | case 2: |
| 824 | if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) | 839 | if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) |
| 825 | for (i = 0; i < 8; i++) | 840 | for (i = 0; i < 8; i++) |
| 826 | I915_WRITE(FENCE_REG_945_8 + (i * 4), dev_priv->saveFENCE[i+8]); | 841 | I915_WRITE(FENCE_REG_945_8 + (i * 4), dev_priv->saveFENCE[i+8]); |
| 842 | for (i = 0; i < 8; i++) | ||
| 843 | I915_WRITE(FENCE_REG_830_0 + (i * 4), dev_priv->saveFENCE[i]); | ||
| 844 | break; | ||
| 827 | } | 845 | } |
| 828 | 846 | ||
| 829 | i915_restore_display(dev); | 847 | i915_restore_display(dev); |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 4b7735196cd5..197d4f32585a 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
| @@ -188,7 +188,7 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) | |||
| 188 | 188 | ||
| 189 | if (wait_for((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0, | 189 | if (wait_for((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0, |
| 190 | 1000, 1)) | 190 | 1000, 1)) |
| 191 | DRM_ERROR("timed out waiting for FORCE_TRIGGER"); | 191 | DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER"); |
| 192 | 192 | ||
| 193 | if (turn_off_dac) { | 193 | if (turn_off_dac) { |
| 194 | I915_WRITE(PCH_ADPA, temp); | 194 | I915_WRITE(PCH_ADPA, temp); |
| @@ -245,7 +245,7 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) | |||
| 245 | if (wait_for((I915_READ(PORT_HOTPLUG_EN) & | 245 | if (wait_for((I915_READ(PORT_HOTPLUG_EN) & |
| 246 | CRT_HOTPLUG_FORCE_DETECT) == 0, | 246 | CRT_HOTPLUG_FORCE_DETECT) == 0, |
| 247 | 1000, 1)) | 247 | 1000, 1)) |
| 248 | DRM_ERROR("timed out waiting for FORCE_DETECT to go off"); | 248 | DRM_DEBUG_KMS("timed out waiting for FORCE_DETECT to go off"); |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | stat = I915_READ(PORT_HOTPLUG_STAT); | 251 | stat = I915_READ(PORT_HOTPLUG_STAT); |
| @@ -400,7 +400,8 @@ intel_crt_load_detect(struct drm_crtc *crtc, struct intel_encoder *intel_encoder | |||
| 400 | return status; | 400 | return status; |
| 401 | } | 401 | } |
| 402 | 402 | ||
| 403 | static enum drm_connector_status intel_crt_detect(struct drm_connector *connector) | 403 | static enum drm_connector_status |
| 404 | intel_crt_detect(struct drm_connector *connector, bool force) | ||
| 404 | { | 405 | { |
| 405 | struct drm_device *dev = connector->dev; | 406 | struct drm_device *dev = connector->dev; |
| 406 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 407 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
| @@ -419,6 +420,9 @@ static enum drm_connector_status intel_crt_detect(struct drm_connector *connecto | |||
| 419 | if (intel_crt_detect_ddc(encoder)) | 420 | if (intel_crt_detect_ddc(encoder)) |
| 420 | return connector_status_connected; | 421 | return connector_status_connected; |
| 421 | 422 | ||
| 423 | if (!force) | ||
| 424 | return connector->status; | ||
| 425 | |||
| 422 | /* for pre-945g platforms use load detect */ | 426 | /* for pre-945g platforms use load detect */ |
| 423 | if (encoder->crtc && encoder->crtc->enabled) { | 427 | if (encoder->crtc && encoder->crtc->enabled) { |
| 424 | status = intel_crt_load_detect(encoder->crtc, intel_encoder); | 428 | status = intel_crt_load_detect(encoder->crtc, intel_encoder); |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 19daead5b525..979228594599 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -1013,8 +1013,8 @@ void intel_wait_for_vblank(struct drm_device *dev, int pipe) | |||
| 1013 | DRM_DEBUG_KMS("vblank wait timed out\n"); | 1013 | DRM_DEBUG_KMS("vblank wait timed out\n"); |
| 1014 | } | 1014 | } |
| 1015 | 1015 | ||
| 1016 | /** | 1016 | /* |
| 1017 | * intel_wait_for_vblank_off - wait for vblank after disabling a pipe | 1017 | * intel_wait_for_pipe_off - wait for pipe to turn off |
| 1018 | * @dev: drm device | 1018 | * @dev: drm device |
| 1019 | * @pipe: pipe to wait for | 1019 | * @pipe: pipe to wait for |
| 1020 | * | 1020 | * |
| @@ -1022,25 +1022,39 @@ void intel_wait_for_vblank(struct drm_device *dev, int pipe) | |||
| 1022 | * spinning on the vblank interrupt status bit, since we won't actually | 1022 | * spinning on the vblank interrupt status bit, since we won't actually |
| 1023 | * see an interrupt when the pipe is disabled. | 1023 | * see an interrupt when the pipe is disabled. |
| 1024 | * | 1024 | * |
| 1025 | * So this function waits for the display line value to settle (it | 1025 | * On Gen4 and above: |
| 1026 | * usually ends up stopping at the start of the next frame). | 1026 | * wait for the pipe register state bit to turn off |
| 1027 | * | ||
| 1028 | * Otherwise: | ||
| 1029 | * wait for the display line value to settle (it usually | ||
| 1030 | * ends up stopping at the start of the next frame). | ||
| 1031 | * | ||
| 1027 | */ | 1032 | */ |
| 1028 | void intel_wait_for_vblank_off(struct drm_device *dev, int pipe) | 1033 | static void intel_wait_for_pipe_off(struct drm_device *dev, int pipe) |
| 1029 | { | 1034 | { |
| 1030 | struct drm_i915_private *dev_priv = dev->dev_private; | 1035 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 1031 | int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL); | 1036 | |
| 1032 | unsigned long timeout = jiffies + msecs_to_jiffies(100); | 1037 | if (INTEL_INFO(dev)->gen >= 4) { |
| 1033 | u32 last_line; | 1038 | int pipeconf_reg = (pipe == 0 ? PIPEACONF : PIPEBCONF); |
| 1034 | 1039 | ||
| 1035 | /* Wait for the display line to settle */ | 1040 | /* Wait for the Pipe State to go off */ |
| 1036 | do { | 1041 | if (wait_for((I915_READ(pipeconf_reg) & I965_PIPECONF_ACTIVE) == 0, |
| 1037 | last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK; | 1042 | 100, 0)) |
| 1038 | mdelay(5); | 1043 | DRM_DEBUG_KMS("pipe_off wait timed out\n"); |
| 1039 | } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) && | 1044 | } else { |
| 1040 | time_after(timeout, jiffies)); | 1045 | u32 last_line; |
| 1041 | 1046 | int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL); | |
| 1042 | if (time_after(jiffies, timeout)) | 1047 | unsigned long timeout = jiffies + msecs_to_jiffies(100); |
| 1043 | DRM_DEBUG_KMS("vblank wait timed out\n"); | 1048 | |
| 1049 | /* Wait for the display line to settle */ | ||
| 1050 | do { | ||
| 1051 | last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK; | ||
| 1052 | mdelay(5); | ||
| 1053 | } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) && | ||
| 1054 | time_after(timeout, jiffies)); | ||
| 1055 | if (time_after(jiffies, timeout)) | ||
| 1056 | DRM_DEBUG_KMS("pipe_off wait timed out\n"); | ||
| 1057 | } | ||
| 1044 | } | 1058 | } |
| 1045 | 1059 | ||
| 1046 | /* Parameters have changed, update FBC info */ | 1060 | /* Parameters have changed, update FBC info */ |
| @@ -2328,13 +2342,13 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 2328 | I915_READ(dspbase_reg); | 2342 | I915_READ(dspbase_reg); |
| 2329 | } | 2343 | } |
| 2330 | 2344 | ||
| 2331 | /* Wait for vblank for the disable to take effect */ | ||
| 2332 | intel_wait_for_vblank_off(dev, pipe); | ||
| 2333 | |||
| 2334 | /* Don't disable pipe A or pipe A PLLs if needed */ | 2345 | /* Don't disable pipe A or pipe A PLLs if needed */ |
| 2335 | if (pipeconf_reg == PIPEACONF && | 2346 | if (pipeconf_reg == PIPEACONF && |
| 2336 | (dev_priv->quirks & QUIRK_PIPEA_FORCE)) | 2347 | (dev_priv->quirks & QUIRK_PIPEA_FORCE)) { |
| 2348 | /* Wait for vblank for the disable to take effect */ | ||
| 2349 | intel_wait_for_vblank(dev, pipe); | ||
| 2337 | goto skip_pipe_off; | 2350 | goto skip_pipe_off; |
| 2351 | } | ||
| 2338 | 2352 | ||
| 2339 | /* Next, disable display pipes */ | 2353 | /* Next, disable display pipes */ |
| 2340 | temp = I915_READ(pipeconf_reg); | 2354 | temp = I915_READ(pipeconf_reg); |
| @@ -2343,8 +2357,8 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 2343 | I915_READ(pipeconf_reg); | 2357 | I915_READ(pipeconf_reg); |
| 2344 | } | 2358 | } |
| 2345 | 2359 | ||
| 2346 | /* Wait for vblank for the disable to take effect. */ | 2360 | /* Wait for the pipe to turn off */ |
| 2347 | intel_wait_for_vblank_off(dev, pipe); | 2361 | intel_wait_for_pipe_off(dev, pipe); |
| 2348 | 2362 | ||
| 2349 | temp = I915_READ(dpll_reg); | 2363 | temp = I915_READ(dpll_reg); |
| 2350 | if ((temp & DPLL_VCO_ENABLE) != 0) { | 2364 | if ((temp & DPLL_VCO_ENABLE) != 0) { |
| @@ -2463,11 +2477,19 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, | |||
| 2463 | struct drm_display_mode *adjusted_mode) | 2477 | struct drm_display_mode *adjusted_mode) |
| 2464 | { | 2478 | { |
| 2465 | struct drm_device *dev = crtc->dev; | 2479 | struct drm_device *dev = crtc->dev; |
| 2480 | |||
| 2466 | if (HAS_PCH_SPLIT(dev)) { | 2481 | if (HAS_PCH_SPLIT(dev)) { |
| 2467 | /* FDI link clock is fixed at 2.7G */ | 2482 | /* FDI link clock is fixed at 2.7G */ |
| 2468 | if (mode->clock * 3 > IRONLAKE_FDI_FREQ * 4) | 2483 | if (mode->clock * 3 > IRONLAKE_FDI_FREQ * 4) |
| 2469 | return false; | 2484 | return false; |
| 2470 | } | 2485 | } |
| 2486 | |||
| 2487 | /* XXX some encoders set the crtcinfo, others don't. | ||
| 2488 | * Obviously we need some form of conflict resolution here... | ||
| 2489 | */ | ||
| 2490 | if (adjusted_mode->crtc_htotal == 0) | ||
| 2491 | drm_mode_set_crtcinfo(adjusted_mode, 0); | ||
| 2492 | |||
| 2471 | return true; | 2493 | return true; |
| 2472 | } | 2494 | } |
| 2473 | 2495 | ||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 51d142939a26..9ab8708ac6ba 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -1138,18 +1138,14 @@ static bool | |||
| 1138 | intel_dp_set_link_train(struct intel_dp *intel_dp, | 1138 | intel_dp_set_link_train(struct intel_dp *intel_dp, |
| 1139 | uint32_t dp_reg_value, | 1139 | uint32_t dp_reg_value, |
| 1140 | uint8_t dp_train_pat, | 1140 | uint8_t dp_train_pat, |
| 1141 | uint8_t train_set[4], | 1141 | uint8_t train_set[4]) |
| 1142 | bool first) | ||
| 1143 | { | 1142 | { |
| 1144 | struct drm_device *dev = intel_dp->base.enc.dev; | 1143 | struct drm_device *dev = intel_dp->base.enc.dev; |
| 1145 | struct drm_i915_private *dev_priv = dev->dev_private; | 1144 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 1146 | struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc); | ||
| 1147 | int ret; | 1145 | int ret; |
| 1148 | 1146 | ||
| 1149 | I915_WRITE(intel_dp->output_reg, dp_reg_value); | 1147 | I915_WRITE(intel_dp->output_reg, dp_reg_value); |
| 1150 | POSTING_READ(intel_dp->output_reg); | 1148 | POSTING_READ(intel_dp->output_reg); |
| 1151 | if (first) | ||
| 1152 | intel_wait_for_vblank(dev, intel_crtc->pipe); | ||
| 1153 | 1149 | ||
| 1154 | intel_dp_aux_native_write_1(intel_dp, | 1150 | intel_dp_aux_native_write_1(intel_dp, |
| 1155 | DP_TRAINING_PATTERN_SET, | 1151 | DP_TRAINING_PATTERN_SET, |
| @@ -1174,10 +1170,15 @@ intel_dp_link_train(struct intel_dp *intel_dp) | |||
| 1174 | uint8_t voltage; | 1170 | uint8_t voltage; |
| 1175 | bool clock_recovery = false; | 1171 | bool clock_recovery = false; |
| 1176 | bool channel_eq = false; | 1172 | bool channel_eq = false; |
| 1177 | bool first = true; | ||
| 1178 | int tries; | 1173 | int tries; |
| 1179 | u32 reg; | 1174 | u32 reg; |
| 1180 | uint32_t DP = intel_dp->DP; | 1175 | uint32_t DP = intel_dp->DP; |
| 1176 | struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc); | ||
| 1177 | |||
| 1178 | /* Enable output, wait for it to become active */ | ||
| 1179 | I915_WRITE(intel_dp->output_reg, intel_dp->DP); | ||
| 1180 | POSTING_READ(intel_dp->output_reg); | ||
| 1181 | intel_wait_for_vblank(dev, intel_crtc->pipe); | ||
| 1181 | 1182 | ||
| 1182 | /* Write the link configuration data */ | 1183 | /* Write the link configuration data */ |
| 1183 | intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, | 1184 | intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, |
| @@ -1210,9 +1211,8 @@ intel_dp_link_train(struct intel_dp *intel_dp) | |||
| 1210 | reg = DP | DP_LINK_TRAIN_PAT_1; | 1211 | reg = DP | DP_LINK_TRAIN_PAT_1; |
| 1211 | 1212 | ||
| 1212 | if (!intel_dp_set_link_train(intel_dp, reg, | 1213 | if (!intel_dp_set_link_train(intel_dp, reg, |
| 1213 | DP_TRAINING_PATTERN_1, train_set, first)) | 1214 | DP_TRAINING_PATTERN_1, train_set)) |
| 1214 | break; | 1215 | break; |
| 1215 | first = false; | ||
| 1216 | /* Set training pattern 1 */ | 1216 | /* Set training pattern 1 */ |
| 1217 | 1217 | ||
| 1218 | udelay(100); | 1218 | udelay(100); |
| @@ -1266,8 +1266,7 @@ intel_dp_link_train(struct intel_dp *intel_dp) | |||
| 1266 | 1266 | ||
| 1267 | /* channel eq pattern */ | 1267 | /* channel eq pattern */ |
| 1268 | if (!intel_dp_set_link_train(intel_dp, reg, | 1268 | if (!intel_dp_set_link_train(intel_dp, reg, |
| 1269 | DP_TRAINING_PATTERN_2, train_set, | 1269 | DP_TRAINING_PATTERN_2, train_set)) |
| 1270 | false)) | ||
| 1271 | break; | 1270 | break; |
| 1272 | 1271 | ||
| 1273 | udelay(400); | 1272 | udelay(400); |
| @@ -1386,7 +1385,7 @@ ironlake_dp_detect(struct drm_connector *connector) | |||
| 1386 | * \return false if DP port is disconnected. | 1385 | * \return false if DP port is disconnected. |
| 1387 | */ | 1386 | */ |
| 1388 | static enum drm_connector_status | 1387 | static enum drm_connector_status |
| 1389 | intel_dp_detect(struct drm_connector *connector) | 1388 | intel_dp_detect(struct drm_connector *connector, bool force) |
| 1390 | { | 1389 | { |
| 1391 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 1390 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
| 1392 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); | 1391 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index ad312ca6b3e5..8828b3ac6414 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
| @@ -229,7 +229,6 @@ extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, | |||
| 229 | struct drm_crtc *crtc); | 229 | struct drm_crtc *crtc); |
| 230 | int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, | 230 | int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, |
| 231 | struct drm_file *file_priv); | 231 | struct drm_file *file_priv); |
| 232 | extern void intel_wait_for_vblank_off(struct drm_device *dev, int pipe); | ||
| 233 | extern void intel_wait_for_vblank(struct drm_device *dev, int pipe); | 232 | extern void intel_wait_for_vblank(struct drm_device *dev, int pipe); |
| 234 | extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe); | 233 | extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe); |
| 235 | extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder, | 234 | extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder, |
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c index a399f4b2c1c5..7c9ec1472d46 100644 --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c | |||
| @@ -221,7 +221,8 @@ static void intel_dvo_mode_set(struct drm_encoder *encoder, | |||
| 221 | * | 221 | * |
| 222 | * Unimplemented. | 222 | * Unimplemented. |
| 223 | */ | 223 | */ |
| 224 | static enum drm_connector_status intel_dvo_detect(struct drm_connector *connector) | 224 | static enum drm_connector_status |
| 225 | intel_dvo_detect(struct drm_connector *connector, bool force) | ||
| 225 | { | 226 | { |
| 226 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 227 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
| 227 | struct intel_dvo *intel_dvo = enc_to_intel_dvo(encoder); | 228 | struct intel_dvo *intel_dvo = enc_to_intel_dvo(encoder); |
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index 7bdc96256bf5..b61966c126d3 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
| @@ -237,8 +237,10 @@ int intel_fbdev_destroy(struct drm_device *dev, | |||
| 237 | drm_fb_helper_fini(&ifbdev->helper); | 237 | drm_fb_helper_fini(&ifbdev->helper); |
| 238 | 238 | ||
| 239 | drm_framebuffer_cleanup(&ifb->base); | 239 | drm_framebuffer_cleanup(&ifb->base); |
| 240 | if (ifb->obj) | 240 | if (ifb->obj) { |
| 241 | drm_gem_object_unreference(ifb->obj); | 241 | drm_gem_object_unreference(ifb->obj); |
| 242 | ifb->obj = NULL; | ||
| 243 | } | ||
| 242 | 244 | ||
| 243 | return 0; | 245 | return 0; |
| 244 | } | 246 | } |
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index ccd4c97e6524..926934a482ec 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
| @@ -139,7 +139,7 @@ static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder, | |||
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | static enum drm_connector_status | 141 | static enum drm_connector_status |
| 142 | intel_hdmi_detect(struct drm_connector *connector) | 142 | intel_hdmi_detect(struct drm_connector *connector, bool force) |
| 143 | { | 143 | { |
| 144 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 144 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
| 145 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); | 145 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 4fbb0165b26f..6ec39a86ed06 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
| @@ -445,7 +445,8 @@ static void intel_lvds_mode_set(struct drm_encoder *encoder, | |||
| 445 | * connected and closed means disconnected. We also send hotplug events as | 445 | * connected and closed means disconnected. We also send hotplug events as |
| 446 | * needed, using lid status notification from the input layer. | 446 | * needed, using lid status notification from the input layer. |
| 447 | */ | 447 | */ |
| 448 | static enum drm_connector_status intel_lvds_detect(struct drm_connector *connector) | 448 | static enum drm_connector_status |
| 449 | intel_lvds_detect(struct drm_connector *connector, bool force) | ||
| 449 | { | 450 | { |
| 450 | struct drm_device *dev = connector->dev; | 451 | struct drm_device *dev = connector->dev; |
| 451 | enum drm_connector_status status = connector_status_connected; | 452 | enum drm_connector_status status = connector_status_connected; |
| @@ -540,7 +541,9 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val, | |||
| 540 | * the LID nofication event. | 541 | * the LID nofication event. |
| 541 | */ | 542 | */ |
| 542 | if (connector) | 543 | if (connector) |
| 543 | connector->status = connector->funcs->detect(connector); | 544 | connector->status = connector->funcs->detect(connector, |
| 545 | false); | ||
| 546 | |||
| 544 | /* Don't force modeset on machines where it causes a GPU lockup */ | 547 | /* Don't force modeset on machines where it causes a GPU lockup */ |
| 545 | if (dmi_check_system(intel_no_modeset_on_lid)) | 548 | if (dmi_check_system(intel_no_modeset_on_lid)) |
| 546 | return NOTIFY_OK; | 549 | return NOTIFY_OK; |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index e3b7a7ee39cb..ee73e428a84a 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
| @@ -1417,7 +1417,7 @@ intel_analog_is_connected(struct drm_device *dev) | |||
| 1417 | if (!analog_connector) | 1417 | if (!analog_connector) |
| 1418 | return false; | 1418 | return false; |
| 1419 | 1419 | ||
| 1420 | if (analog_connector->funcs->detect(analog_connector) == | 1420 | if (analog_connector->funcs->detect(analog_connector, false) == |
| 1421 | connector_status_disconnected) | 1421 | connector_status_disconnected) |
| 1422 | return false; | 1422 | return false; |
| 1423 | 1423 | ||
| @@ -1486,7 +1486,8 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector) | |||
| 1486 | return status; | 1486 | return status; |
| 1487 | } | 1487 | } |
| 1488 | 1488 | ||
| 1489 | static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connector) | 1489 | static enum drm_connector_status |
| 1490 | intel_sdvo_detect(struct drm_connector *connector, bool force) | ||
| 1490 | { | 1491 | { |
| 1491 | uint16_t response; | 1492 | uint16_t response; |
| 1492 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 1493 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
| @@ -2169,8 +2170,7 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) | |||
| 2169 | return true; | 2170 | return true; |
| 2170 | 2171 | ||
| 2171 | err: | 2172 | err: |
| 2172 | intel_sdvo_destroy_enhance_property(connector); | 2173 | intel_sdvo_destroy(connector); |
| 2173 | kfree(intel_sdvo_connector); | ||
| 2174 | return false; | 2174 | return false; |
| 2175 | } | 2175 | } |
| 2176 | 2176 | ||
| @@ -2242,8 +2242,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) | |||
| 2242 | return true; | 2242 | return true; |
| 2243 | 2243 | ||
| 2244 | err: | 2244 | err: |
| 2245 | intel_sdvo_destroy_enhance_property(connector); | 2245 | intel_sdvo_destroy(connector); |
| 2246 | kfree(intel_sdvo_connector); | ||
| 2247 | return false; | 2246 | return false; |
| 2248 | } | 2247 | } |
| 2249 | 2248 | ||
| @@ -2521,11 +2520,10 @@ static bool intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo, | |||
| 2521 | uint16_t response; | 2520 | uint16_t response; |
| 2522 | } enhancements; | 2521 | } enhancements; |
| 2523 | 2522 | ||
| 2524 | if (!intel_sdvo_get_value(intel_sdvo, | 2523 | enhancements.response = 0; |
| 2525 | SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS, | 2524 | intel_sdvo_get_value(intel_sdvo, |
| 2526 | &enhancements, sizeof(enhancements))) | 2525 | SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS, |
| 2527 | return false; | 2526 | &enhancements, sizeof(enhancements)); |
| 2528 | |||
| 2529 | if (enhancements.response == 0) { | 2527 | if (enhancements.response == 0) { |
| 2530 | DRM_DEBUG_KMS("No enhancement is supported\n"); | 2528 | DRM_DEBUG_KMS("No enhancement is supported\n"); |
| 2531 | return true; | 2529 | return true; |
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index c671f60ce80b..4a117e318a73 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c | |||
| @@ -1341,7 +1341,7 @@ static void intel_tv_find_better_format(struct drm_connector *connector) | |||
| 1341 | * we have a pipe programmed in order to probe the TV. | 1341 | * we have a pipe programmed in order to probe the TV. |
| 1342 | */ | 1342 | */ |
| 1343 | static enum drm_connector_status | 1343 | static enum drm_connector_status |
| 1344 | intel_tv_detect(struct drm_connector *connector) | 1344 | intel_tv_detect(struct drm_connector *connector, bool force) |
| 1345 | { | 1345 | { |
| 1346 | struct drm_display_mode mode; | 1346 | struct drm_display_mode mode; |
| 1347 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 1347 | struct drm_encoder *encoder = intel_attached_encoder(connector); |
| @@ -1353,7 +1353,7 @@ intel_tv_detect(struct drm_connector *connector) | |||
| 1353 | 1353 | ||
| 1354 | if (encoder->crtc && encoder->crtc->enabled) { | 1354 | if (encoder->crtc && encoder->crtc->enabled) { |
| 1355 | type = intel_tv_detect_type(intel_tv); | 1355 | type = intel_tv_detect_type(intel_tv); |
| 1356 | } else { | 1356 | } else if (force) { |
| 1357 | struct drm_crtc *crtc; | 1357 | struct drm_crtc *crtc; |
| 1358 | int dpms_mode; | 1358 | int dpms_mode; |
| 1359 | 1359 | ||
| @@ -1364,10 +1364,9 @@ intel_tv_detect(struct drm_connector *connector) | |||
| 1364 | intel_release_load_detect_pipe(&intel_tv->base, connector, | 1364 | intel_release_load_detect_pipe(&intel_tv->base, connector, |
| 1365 | dpms_mode); | 1365 | dpms_mode); |
| 1366 | } else | 1366 | } else |
| 1367 | type = -1; | 1367 | return connector_status_unknown; |
| 1368 | } | 1368 | } else |
| 1369 | 1369 | return connector->status; | |
| 1370 | intel_tv->type = type; | ||
| 1371 | 1370 | ||
| 1372 | if (type < 0) | 1371 | if (type < 0) |
| 1373 | return connector_status_disconnected; | 1372 | return connector_status_disconnected; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index a1473fff06ac..fc737037f751 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c | |||
| @@ -168,7 +168,7 @@ nouveau_connector_set_encoder(struct drm_connector *connector, | |||
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | static enum drm_connector_status | 170 | static enum drm_connector_status |
| 171 | nouveau_connector_detect(struct drm_connector *connector) | 171 | nouveau_connector_detect(struct drm_connector *connector, bool force) |
| 172 | { | 172 | { |
| 173 | struct drm_device *dev = connector->dev; | 173 | struct drm_device *dev = connector->dev; |
| 174 | struct nouveau_connector *nv_connector = nouveau_connector(connector); | 174 | struct nouveau_connector *nv_connector = nouveau_connector(connector); |
| @@ -246,7 +246,7 @@ detect_analog: | |||
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | static enum drm_connector_status | 248 | static enum drm_connector_status |
| 249 | nouveau_connector_detect_lvds(struct drm_connector *connector) | 249 | nouveau_connector_detect_lvds(struct drm_connector *connector, bool force) |
| 250 | { | 250 | { |
| 251 | struct drm_device *dev = connector->dev; | 251 | struct drm_device *dev = connector->dev; |
| 252 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 252 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| @@ -267,7 +267,7 @@ nouveau_connector_detect_lvds(struct drm_connector *connector) | |||
| 267 | 267 | ||
| 268 | /* Try retrieving EDID via DDC */ | 268 | /* Try retrieving EDID via DDC */ |
| 269 | if (!dev_priv->vbios.fp_no_ddc) { | 269 | if (!dev_priv->vbios.fp_no_ddc) { |
| 270 | status = nouveau_connector_detect(connector); | 270 | status = nouveau_connector_detect(connector, force); |
| 271 | if (status == connector_status_connected) | 271 | if (status == connector_status_connected) |
| 272 | goto out; | 272 | goto out; |
| 273 | } | 273 | } |
| @@ -558,8 +558,10 @@ nouveau_connector_get_modes(struct drm_connector *connector) | |||
| 558 | if (nv_encoder->dcb->type == OUTPUT_LVDS && | 558 | if (nv_encoder->dcb->type == OUTPUT_LVDS && |
| 559 | (nv_encoder->dcb->lvdsconf.use_straps_for_mode || | 559 | (nv_encoder->dcb->lvdsconf.use_straps_for_mode || |
| 560 | dev_priv->vbios.fp_no_ddc) && nouveau_bios_fp_mode(dev, NULL)) { | 560 | dev_priv->vbios.fp_no_ddc) && nouveau_bios_fp_mode(dev, NULL)) { |
| 561 | nv_connector->native_mode = drm_mode_create(dev); | 561 | struct drm_display_mode mode; |
| 562 | nouveau_bios_fp_mode(dev, nv_connector->native_mode); | 562 | |
| 563 | nouveau_bios_fp_mode(dev, &mode); | ||
| 564 | nv_connector->native_mode = drm_mode_duplicate(dev, &mode); | ||
| 563 | } | 565 | } |
| 564 | 566 | ||
| 565 | /* Find the native mode if this is a digital panel, if we didn't | 567 | /* Find the native mode if this is a digital panel, if we didn't |
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index ead7b8fc53fc..19620a6709f5 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c | |||
| @@ -167,11 +167,9 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, | |||
| 167 | goto out; | 167 | goto out; |
| 168 | 168 | ||
| 169 | ret = drm_gem_handle_create(file_priv, nvbo->gem, &req->info.handle); | 169 | ret = drm_gem_handle_create(file_priv, nvbo->gem, &req->info.handle); |
| 170 | /* drop reference from allocate - handle holds it now */ | ||
| 171 | drm_gem_object_unreference_unlocked(nvbo->gem); | ||
| 170 | out: | 172 | out: |
| 171 | drm_gem_object_handle_unreference_unlocked(nvbo->gem); | ||
| 172 | |||
| 173 | if (ret) | ||
| 174 | drm_gem_object_unreference_unlocked(nvbo->gem); | ||
| 175 | return ret; | 173 | return ret; |
| 176 | } | 174 | } |
| 177 | 175 | ||
diff --git a/drivers/gpu/drm/radeon/atombios.h b/drivers/gpu/drm/radeon/atombios.h index 1bc72c3190a9..fe359a239df3 100644 --- a/drivers/gpu/drm/radeon/atombios.h +++ b/drivers/gpu/drm/radeon/atombios.h | |||
| @@ -4999,7 +4999,7 @@ typedef struct _SW_I2C_IO_DATA_PARAMETERS | |||
| 4999 | #define SW_I2C_CNTL_WRITE1BIT 6 | 4999 | #define SW_I2C_CNTL_WRITE1BIT 6 |
| 5000 | 5000 | ||
| 5001 | //==============================VESA definition Portion=============================== | 5001 | //==============================VESA definition Portion=============================== |
| 5002 | #define VESA_OEM_PRODUCT_REV '01.00' | 5002 | #define VESA_OEM_PRODUCT_REV "01.00" |
| 5003 | #define VESA_MODE_ATTRIBUTE_MODE_SUPPORT 0xBB //refer to VBE spec p.32, no TTY support | 5003 | #define VESA_MODE_ATTRIBUTE_MODE_SUPPORT 0xBB //refer to VBE spec p.32, no TTY support |
| 5004 | #define VESA_MODE_WIN_ATTRIBUTE 7 | 5004 | #define VESA_MODE_WIN_ATTRIBUTE 7 |
| 5005 | #define VESA_WIN_SIZE 64 | 5005 | #define VESA_WIN_SIZE 64 |
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 464a81a1990f..cd0290f946cf 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
| @@ -539,14 +539,15 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
| 539 | pll->algo = PLL_ALGO_LEGACY; | 539 | pll->algo = PLL_ALGO_LEGACY; |
| 540 | pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER; | 540 | pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER; |
| 541 | } | 541 | } |
| 542 | /* There is some evidence (often anecdotal) that RV515 LVDS | 542 | /* There is some evidence (often anecdotal) that RV515/RV620 LVDS |
| 543 | * (on some boards at least) prefers the legacy algo. I'm not | 543 | * (on some boards at least) prefers the legacy algo. I'm not |
| 544 | * sure whether this should handled generically or on a | 544 | * sure whether this should handled generically or on a |
| 545 | * case-by-case quirk basis. Both algos should work fine in the | 545 | * case-by-case quirk basis. Both algos should work fine in the |
| 546 | * majority of cases. | 546 | * majority of cases. |
| 547 | */ | 547 | */ |
| 548 | if ((radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) && | 548 | if ((radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) && |
| 549 | (rdev->family == CHIP_RV515)) { | 549 | ((rdev->family == CHIP_RV515) || |
| 550 | (rdev->family == CHIP_RV620))) { | ||
| 550 | /* allow the user to overrride just in case */ | 551 | /* allow the user to overrride just in case */ |
| 551 | if (radeon_new_pll == 1) | 552 | if (radeon_new_pll == 1) |
| 552 | pll->algo = PLL_ALGO_NEW; | 553 | pll->algo = PLL_ALGO_NEW; |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index b8b7f010b25f..2f93d46ae69a 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
| @@ -1137,7 +1137,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev) | |||
| 1137 | 1137 | ||
| 1138 | WREG32(RCU_IND_INDEX, 0x203); | 1138 | WREG32(RCU_IND_INDEX, 0x203); |
| 1139 | efuse_straps_3 = RREG32(RCU_IND_DATA); | 1139 | efuse_straps_3 = RREG32(RCU_IND_DATA); |
| 1140 | efuse_box_bit_127_124 = (u8)(efuse_straps_3 & 0xF0000000) >> 28; | 1140 | efuse_box_bit_127_124 = (u8)((efuse_straps_3 & 0xF0000000) >> 28); |
| 1141 | 1141 | ||
| 1142 | switch(efuse_box_bit_127_124) { | 1142 | switch(efuse_box_bit_127_124) { |
| 1143 | case 0x0: | 1143 | case 0x0: |
| @@ -1160,14 +1160,25 @@ static void evergreen_gpu_init(struct radeon_device *rdev) | |||
| 1160 | EVERGREEN_MAX_BACKENDS_MASK)); | 1160 | EVERGREEN_MAX_BACKENDS_MASK)); |
| 1161 | break; | 1161 | break; |
| 1162 | } | 1162 | } |
| 1163 | } else | 1163 | } else { |
| 1164 | gb_backend_map = | 1164 | switch (rdev->family) { |
| 1165 | evergreen_get_tile_pipe_to_backend_map(rdev, | 1165 | case CHIP_CYPRESS: |
| 1166 | rdev->config.evergreen.max_tile_pipes, | 1166 | case CHIP_HEMLOCK: |
| 1167 | rdev->config.evergreen.max_backends, | 1167 | gb_backend_map = 0x66442200; |
| 1168 | ((EVERGREEN_MAX_BACKENDS_MASK << | 1168 | break; |
| 1169 | rdev->config.evergreen.max_backends) & | 1169 | case CHIP_JUNIPER: |
| 1170 | EVERGREEN_MAX_BACKENDS_MASK)); | 1170 | gb_backend_map = 0x00006420; |
| 1171 | break; | ||
| 1172 | default: | ||
| 1173 | gb_backend_map = | ||
| 1174 | evergreen_get_tile_pipe_to_backend_map(rdev, | ||
| 1175 | rdev->config.evergreen.max_tile_pipes, | ||
| 1176 | rdev->config.evergreen.max_backends, | ||
| 1177 | ((EVERGREEN_MAX_BACKENDS_MASK << | ||
| 1178 | rdev->config.evergreen.max_backends) & | ||
| 1179 | EVERGREEN_MAX_BACKENDS_MASK)); | ||
| 1180 | } | ||
| 1181 | } | ||
| 1171 | 1182 | ||
| 1172 | rdev->config.evergreen.tile_config = gb_addr_config; | 1183 | rdev->config.evergreen.tile_config = gb_addr_config; |
| 1173 | WREG32(GB_BACKEND_MAP, gb_backend_map); | 1184 | WREG32(GB_BACKEND_MAP, gb_backend_map); |
| @@ -1396,6 +1407,7 @@ int evergreen_mc_init(struct radeon_device *rdev) | |||
| 1396 | rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; | 1407 | rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; |
| 1397 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; | 1408 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; |
| 1398 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 1409 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
| 1410 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
| 1399 | r600_vram_gtt_location(rdev, &rdev->mc); | 1411 | r600_vram_gtt_location(rdev, &rdev->mc); |
| 1400 | radeon_update_bandwidth_info(rdev); | 1412 | radeon_update_bandwidth_info(rdev); |
| 1401 | 1413 | ||
| @@ -1509,7 +1521,7 @@ void evergreen_disable_interrupt_state(struct radeon_device *rdev) | |||
| 1509 | { | 1521 | { |
| 1510 | u32 tmp; | 1522 | u32 tmp; |
| 1511 | 1523 | ||
| 1512 | WREG32(CP_INT_CNTL, 0); | 1524 | WREG32(CP_INT_CNTL, CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE); |
| 1513 | WREG32(GRBM_INT_CNTL, 0); | 1525 | WREG32(GRBM_INT_CNTL, 0); |
| 1514 | WREG32(INT_MASK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); | 1526 | WREG32(INT_MASK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0); |
| 1515 | WREG32(INT_MASK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); | 1527 | WREG32(INT_MASK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0); |
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index e817a0bb5eb4..e59422320bb6 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
| @@ -1030,6 +1030,7 @@ int r100_cp_init(struct radeon_device *rdev, unsigned ring_size) | |||
| 1030 | return r; | 1030 | return r; |
| 1031 | } | 1031 | } |
| 1032 | rdev->cp.ready = true; | 1032 | rdev->cp.ready = true; |
| 1033 | rdev->mc.active_vram_size = rdev->mc.real_vram_size; | ||
| 1033 | return 0; | 1034 | return 0; |
| 1034 | } | 1035 | } |
| 1035 | 1036 | ||
| @@ -1047,6 +1048,7 @@ void r100_cp_fini(struct radeon_device *rdev) | |||
| 1047 | void r100_cp_disable(struct radeon_device *rdev) | 1048 | void r100_cp_disable(struct radeon_device *rdev) |
| 1048 | { | 1049 | { |
| 1049 | /* Disable ring */ | 1050 | /* Disable ring */ |
| 1051 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
| 1050 | rdev->cp.ready = false; | 1052 | rdev->cp.ready = false; |
| 1051 | WREG32(RADEON_CP_CSQ_MODE, 0); | 1053 | WREG32(RADEON_CP_CSQ_MODE, 0); |
| 1052 | WREG32(RADEON_CP_CSQ_CNTL, 0); | 1054 | WREG32(RADEON_CP_CSQ_CNTL, 0); |
| @@ -2020,18 +2022,7 @@ bool r100_gpu_cp_is_lockup(struct radeon_device *rdev, struct r100_gpu_lockup *l | |||
| 2020 | return false; | 2022 | return false; |
| 2021 | } | 2023 | } |
| 2022 | elapsed = jiffies_to_msecs(cjiffies - lockup->last_jiffies); | 2024 | elapsed = jiffies_to_msecs(cjiffies - lockup->last_jiffies); |
| 2023 | if (elapsed >= 3000) { | 2025 | if (elapsed >= 10000) { |
| 2024 | /* very likely the improbable case where current | ||
| 2025 | * rptr is equal to last recorded, a while ago, rptr | ||
| 2026 | * this is more likely a false positive update tracking | ||
| 2027 | * information which should force us to be recall at | ||
| 2028 | * latter point | ||
| 2029 | */ | ||
| 2030 | lockup->last_cp_rptr = cp->rptr; | ||
| 2031 | lockup->last_jiffies = jiffies; | ||
| 2032 | return false; | ||
| 2033 | } | ||
| 2034 | if (elapsed >= 1000) { | ||
| 2035 | dev_err(rdev->dev, "GPU lockup CP stall for more than %lumsec\n", elapsed); | 2026 | dev_err(rdev->dev, "GPU lockup CP stall for more than %lumsec\n", elapsed); |
| 2036 | return true; | 2027 | return true; |
| 2037 | } | 2028 | } |
| @@ -2306,6 +2297,7 @@ void r100_vram_init_sizes(struct radeon_device *rdev) | |||
| 2306 | /* FIXME we don't use the second aperture yet when we could use it */ | 2297 | /* FIXME we don't use the second aperture yet when we could use it */ |
| 2307 | if (rdev->mc.visible_vram_size > rdev->mc.aper_size) | 2298 | if (rdev->mc.visible_vram_size > rdev->mc.aper_size) |
| 2308 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 2299 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
| 2300 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
| 2309 | config_aper_size = RREG32(RADEON_CONFIG_APER_SIZE); | 2301 | config_aper_size = RREG32(RADEON_CONFIG_APER_SIZE); |
| 2310 | if (rdev->flags & RADEON_IS_IGP) { | 2302 | if (rdev->flags & RADEON_IS_IGP) { |
| 2311 | uint32_t tom; | 2303 | uint32_t tom; |
| @@ -3308,13 +3300,14 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track) | |||
| 3308 | unsigned long size; | 3300 | unsigned long size; |
| 3309 | unsigned prim_walk; | 3301 | unsigned prim_walk; |
| 3310 | unsigned nverts; | 3302 | unsigned nverts; |
| 3303 | unsigned num_cb = track->num_cb; | ||
| 3311 | 3304 | ||
| 3312 | for (i = 0; i < track->num_cb; i++) { | 3305 | if (!track->zb_cb_clear && !track->color_channel_mask && |
| 3306 | !track->blend_read_enable) | ||
| 3307 | num_cb = 0; | ||
| 3308 | |||
| 3309 | for (i = 0; i < num_cb; i++) { | ||
| 3313 | if (track->cb[i].robj == NULL) { | 3310 | if (track->cb[i].robj == NULL) { |
| 3314 | if (!(track->zb_cb_clear || track->color_channel_mask || | ||
| 3315 | track->blend_read_enable)) { | ||
| 3316 | continue; | ||
| 3317 | } | ||
| 3318 | DRM_ERROR("[drm] No buffer for color buffer %d !\n", i); | 3311 | DRM_ERROR("[drm] No buffer for color buffer %d !\n", i); |
| 3319 | return -EINVAL; | 3312 | return -EINVAL; |
| 3320 | } | 3313 | } |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index afc18d87fdca..7b65e4efe8af 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
| @@ -1248,6 +1248,7 @@ int r600_mc_init(struct radeon_device *rdev) | |||
| 1248 | rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); | 1248 | rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); |
| 1249 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); | 1249 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); |
| 1250 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 1250 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
| 1251 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
| 1251 | r600_vram_gtt_location(rdev, &rdev->mc); | 1252 | r600_vram_gtt_location(rdev, &rdev->mc); |
| 1252 | 1253 | ||
| 1253 | if (rdev->flags & RADEON_IS_IGP) { | 1254 | if (rdev->flags & RADEON_IS_IGP) { |
| @@ -1917,6 +1918,7 @@ void r600_pciep_wreg(struct radeon_device *rdev, u32 reg, u32 v) | |||
| 1917 | */ | 1918 | */ |
| 1918 | void r600_cp_stop(struct radeon_device *rdev) | 1919 | void r600_cp_stop(struct radeon_device *rdev) |
| 1919 | { | 1920 | { |
| 1921 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
| 1920 | WREG32(R_0086D8_CP_ME_CNTL, S_0086D8_CP_ME_HALT(1)); | 1922 | WREG32(R_0086D8_CP_ME_CNTL, S_0086D8_CP_ME_HALT(1)); |
| 1921 | } | 1923 | } |
| 1922 | 1924 | ||
| @@ -2729,7 +2731,7 @@ int r600_ib_test(struct radeon_device *rdev) | |||
| 2729 | if (i < rdev->usec_timeout) { | 2731 | if (i < rdev->usec_timeout) { |
| 2730 | DRM_INFO("ib test succeeded in %u usecs\n", i); | 2732 | DRM_INFO("ib test succeeded in %u usecs\n", i); |
| 2731 | } else { | 2733 | } else { |
| 2732 | DRM_ERROR("radeon: ib test failed (sracth(0x%04X)=0x%08X)\n", | 2734 | DRM_ERROR("radeon: ib test failed (scratch(0x%04X)=0x%08X)\n", |
| 2733 | scratch, tmp); | 2735 | scratch, tmp); |
| 2734 | r = -EINVAL; | 2736 | r = -EINVAL; |
| 2735 | } | 2737 | } |
| @@ -2910,7 +2912,7 @@ static void r600_disable_interrupt_state(struct radeon_device *rdev) | |||
| 2910 | { | 2912 | { |
| 2911 | u32 tmp; | 2913 | u32 tmp; |
| 2912 | 2914 | ||
| 2913 | WREG32(CP_INT_CNTL, 0); | 2915 | WREG32(CP_INT_CNTL, CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE); |
| 2914 | WREG32(GRBM_INT_CNTL, 0); | 2916 | WREG32(GRBM_INT_CNTL, 0); |
| 2915 | WREG32(DxMODE_INT_MASK, 0); | 2917 | WREG32(DxMODE_INT_MASK, 0); |
| 2916 | if (ASIC_IS_DCE3(rdev)) { | 2918 | if (ASIC_IS_DCE3(rdev)) { |
| @@ -3528,7 +3530,8 @@ void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo) | |||
| 3528 | /* r7xx hw bug. write to HDP_DEBUG1 followed by fb read | 3530 | /* r7xx hw bug. write to HDP_DEBUG1 followed by fb read |
| 3529 | * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL | 3531 | * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL |
| 3530 | */ | 3532 | */ |
| 3531 | if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740)) { | 3533 | if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740) && |
| 3534 | rdev->vram_scratch.ptr) { | ||
| 3532 | void __iomem *ptr = (void *)rdev->vram_scratch.ptr; | 3535 | void __iomem *ptr = (void *)rdev->vram_scratch.ptr; |
| 3533 | u32 tmp; | 3536 | u32 tmp; |
| 3534 | 3537 | ||
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c index d13622ae74e9..3473c00781ff 100644 --- a/drivers/gpu/drm/radeon/r600_blit_kms.c +++ b/drivers/gpu/drm/radeon/r600_blit_kms.c | |||
| @@ -1,3 +1,28 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2009 Advanced Micro Devices, Inc. | ||
| 3 | * Copyright 2009 Red Hat Inc. | ||
| 4 | * | ||
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 6 | * copy of this software and associated documentation files (the "Software"), | ||
| 7 | * to deal in the Software without restriction, including without limitation | ||
| 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 9 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 10 | * Software is furnished to do so, subject to the following conditions: | ||
| 11 | * | ||
| 12 | * The above copyright notice and this permission notice (including the next | ||
| 13 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 14 | * Software. | ||
| 15 | * | ||
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 19 | * THE COPYRIGHT HOLDER(S) AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 20 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 21 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 22 | * DEALINGS IN THE SOFTWARE. | ||
| 23 | * | ||
| 24 | */ | ||
| 25 | |||
| 1 | #include "drmP.h" | 26 | #include "drmP.h" |
| 2 | #include "drm.h" | 27 | #include "drm.h" |
| 3 | #include "radeon_drm.h" | 28 | #include "radeon_drm.h" |
| @@ -507,6 +532,7 @@ int r600_blit_init(struct radeon_device *rdev) | |||
| 507 | memcpy(ptr + rdev->r600_blit.ps_offset, r6xx_ps, r6xx_ps_size * 4); | 532 | memcpy(ptr + rdev->r600_blit.ps_offset, r6xx_ps, r6xx_ps_size * 4); |
| 508 | radeon_bo_kunmap(rdev->r600_blit.shader_obj); | 533 | radeon_bo_kunmap(rdev->r600_blit.shader_obj); |
| 509 | radeon_bo_unreserve(rdev->r600_blit.shader_obj); | 534 | radeon_bo_unreserve(rdev->r600_blit.shader_obj); |
| 535 | rdev->mc.active_vram_size = rdev->mc.real_vram_size; | ||
| 510 | return 0; | 536 | return 0; |
| 511 | } | 537 | } |
| 512 | 538 | ||
| @@ -514,6 +540,7 @@ void r600_blit_fini(struct radeon_device *rdev) | |||
| 514 | { | 540 | { |
| 515 | int r; | 541 | int r; |
| 516 | 542 | ||
| 543 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
| 517 | if (rdev->r600_blit.shader_obj == NULL) | 544 | if (rdev->r600_blit.shader_obj == NULL) |
| 518 | return; | 545 | return; |
| 519 | /* If we can't reserve the bo, unref should be enough to destroy | 546 | /* If we can't reserve the bo, unref should be enough to destroy |
diff --git a/drivers/gpu/drm/radeon/r600_blit_shaders.h b/drivers/gpu/drm/radeon/r600_blit_shaders.h index fdc3b378cbb0..f437d36dd98c 100644 --- a/drivers/gpu/drm/radeon/r600_blit_shaders.h +++ b/drivers/gpu/drm/radeon/r600_blit_shaders.h | |||
| @@ -1,3 +1,27 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2009 Advanced Micro Devices, Inc. | ||
| 3 | * Copyright 2009 Red Hat Inc. | ||
| 4 | * | ||
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 6 | * copy of this software and associated documentation files (the "Software"), | ||
| 7 | * to deal in the Software without restriction, including without limitation | ||
| 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 9 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 10 | * Software is furnished to do so, subject to the following conditions: | ||
| 11 | * | ||
| 12 | * The above copyright notice and this permission notice (including the next | ||
| 13 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 14 | * Software. | ||
| 15 | * | ||
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 19 | * THE COPYRIGHT HOLDER(S) AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 20 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 21 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 22 | * DEALINGS IN THE SOFTWARE. | ||
| 23 | * | ||
| 24 | */ | ||
| 1 | 25 | ||
| 2 | #ifndef R600_BLIT_SHADERS_H | 26 | #ifndef R600_BLIT_SHADERS_H |
| 3 | #define R600_BLIT_SHADERS_H | 27 | #define R600_BLIT_SHADERS_H |
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index d8864949e387..250a3a918193 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c | |||
| @@ -1170,9 +1170,8 @@ static inline int r600_check_texture_resource(struct radeon_cs_parser *p, u32 i | |||
| 1170 | /* using get ib will give us the offset into the mipmap bo */ | 1170 | /* using get ib will give us the offset into the mipmap bo */ |
| 1171 | word0 = radeon_get_ib_value(p, idx + 3) << 8; | 1171 | word0 = radeon_get_ib_value(p, idx + 3) << 8; |
| 1172 | if ((mipmap_size + word0) > radeon_bo_size(mipmap)) { | 1172 | if ((mipmap_size + word0) > radeon_bo_size(mipmap)) { |
| 1173 | dev_warn(p->dev, "mipmap bo too small (%d %d %d %d %d %d -> %d have %ld)\n", | 1173 | /*dev_warn(p->dev, "mipmap bo too small (%d %d %d %d %d %d -> %d have %ld)\n", |
| 1174 | w0, h0, bpe, blevel, nlevels, word0, mipmap_size, radeon_bo_size(texture)); | 1174 | w0, h0, bpe, blevel, nlevels, word0, mipmap_size, radeon_bo_size(texture));*/ |
| 1175 | return -EINVAL; | ||
| 1176 | } | 1175 | } |
| 1177 | return 0; | 1176 | return 0; |
| 1178 | } | 1177 | } |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index a168d644bf9e..9ff38c99a6ea 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
| @@ -344,6 +344,7 @@ struct radeon_mc { | |||
| 344 | * about vram size near mc fb location */ | 344 | * about vram size near mc fb location */ |
| 345 | u64 mc_vram_size; | 345 | u64 mc_vram_size; |
| 346 | u64 visible_vram_size; | 346 | u64 visible_vram_size; |
| 347 | u64 active_vram_size; | ||
| 347 | u64 gtt_size; | 348 | u64 gtt_size; |
| 348 | u64 gtt_start; | 349 | u64 gtt_start; |
| 349 | u64 gtt_end; | 350 | u64 gtt_end; |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index ebae14c4b768..8e43ddae70cc 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
| @@ -317,6 +317,15 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, | |||
| 317 | *connector_type = DRM_MODE_CONNECTOR_DVID; | 317 | *connector_type = DRM_MODE_CONNECTOR_DVID; |
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | /* MSI K9A2GM V2/V3 board has no HDMI or DVI */ | ||
| 321 | if ((dev->pdev->device == 0x796e) && | ||
| 322 | (dev->pdev->subsystem_vendor == 0x1462) && | ||
| 323 | (dev->pdev->subsystem_device == 0x7302)) { | ||
| 324 | if ((supported_device == ATOM_DEVICE_DFP2_SUPPORT) || | ||
| 325 | (supported_device == ATOM_DEVICE_DFP3_SUPPORT)) | ||
| 326 | return false; | ||
| 327 | } | ||
| 328 | |||
| 320 | /* a-bit f-i90hd - ciaranm on #radeonhd - this board has no DVI */ | 329 | /* a-bit f-i90hd - ciaranm on #radeonhd - this board has no DVI */ |
| 321 | if ((dev->pdev->device == 0x7941) && | 330 | if ((dev->pdev->device == 0x7941) && |
| 322 | (dev->pdev->subsystem_vendor == 0x147b) && | 331 | (dev->pdev->subsystem_vendor == 0x147b) && |
| @@ -1549,39 +1558,39 @@ radeon_atombios_get_tv_info(struct radeon_device *rdev) | |||
| 1549 | switch (tv_info->ucTV_BootUpDefaultStandard) { | 1558 | switch (tv_info->ucTV_BootUpDefaultStandard) { |
| 1550 | case ATOM_TV_NTSC: | 1559 | case ATOM_TV_NTSC: |
| 1551 | tv_std = TV_STD_NTSC; | 1560 | tv_std = TV_STD_NTSC; |
| 1552 | DRM_INFO("Default TV standard: NTSC\n"); | 1561 | DRM_DEBUG_KMS("Default TV standard: NTSC\n"); |
| 1553 | break; | 1562 | break; |
| 1554 | case ATOM_TV_NTSCJ: | 1563 | case ATOM_TV_NTSCJ: |
| 1555 | tv_std = TV_STD_NTSC_J; | 1564 | tv_std = TV_STD_NTSC_J; |
| 1556 | DRM_INFO("Default TV standard: NTSC-J\n"); | 1565 | DRM_DEBUG_KMS("Default TV standard: NTSC-J\n"); |
| 1557 | break; | 1566 | break; |
| 1558 | case ATOM_TV_PAL: | 1567 | case ATOM_TV_PAL: |
| 1559 | tv_std = TV_STD_PAL; | 1568 | tv_std = TV_STD_PAL; |
| 1560 | DRM_INFO("Default TV standard: PAL\n"); | 1569 | DRM_DEBUG_KMS("Default TV standard: PAL\n"); |
| 1561 | break; | 1570 | break; |
| 1562 | case ATOM_TV_PALM: | 1571 | case ATOM_TV_PALM: |
| 1563 | tv_std = TV_STD_PAL_M; | 1572 | tv_std = TV_STD_PAL_M; |
| 1564 | DRM_INFO("Default TV standard: PAL-M\n"); | 1573 | DRM_DEBUG_KMS("Default TV standard: PAL-M\n"); |
| 1565 | break; | 1574 | break; |
| 1566 | case ATOM_TV_PALN: | 1575 | case ATOM_TV_PALN: |
| 1567 | tv_std = TV_STD_PAL_N; | 1576 | tv_std = TV_STD_PAL_N; |
| 1568 | DRM_INFO("Default TV standard: PAL-N\n"); | 1577 | DRM_DEBUG_KMS("Default TV standard: PAL-N\n"); |
| 1569 | break; | 1578 | break; |
| 1570 | case ATOM_TV_PALCN: | 1579 | case ATOM_TV_PALCN: |
| 1571 | tv_std = TV_STD_PAL_CN; | 1580 | tv_std = TV_STD_PAL_CN; |
| 1572 | DRM_INFO("Default TV standard: PAL-CN\n"); | 1581 | DRM_DEBUG_KMS("Default TV standard: PAL-CN\n"); |
| 1573 | break; | 1582 | break; |
| 1574 | case ATOM_TV_PAL60: | 1583 | case ATOM_TV_PAL60: |
| 1575 | tv_std = TV_STD_PAL_60; | 1584 | tv_std = TV_STD_PAL_60; |
| 1576 | DRM_INFO("Default TV standard: PAL-60\n"); | 1585 | DRM_DEBUG_KMS("Default TV standard: PAL-60\n"); |
| 1577 | break; | 1586 | break; |
| 1578 | case ATOM_TV_SECAM: | 1587 | case ATOM_TV_SECAM: |
| 1579 | tv_std = TV_STD_SECAM; | 1588 | tv_std = TV_STD_SECAM; |
| 1580 | DRM_INFO("Default TV standard: SECAM\n"); | 1589 | DRM_DEBUG_KMS("Default TV standard: SECAM\n"); |
| 1581 | break; | 1590 | break; |
| 1582 | default: | 1591 | default: |
| 1583 | tv_std = TV_STD_NTSC; | 1592 | tv_std = TV_STD_NTSC; |
| 1584 | DRM_INFO("Unknown TV standard; defaulting to NTSC\n"); | 1593 | DRM_DEBUG_KMS("Unknown TV standard; defaulting to NTSC\n"); |
| 1585 | break; | 1594 | break; |
| 1586 | } | 1595 | } |
| 1587 | } | 1596 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index bd74e428bd14..7b7ea269549c 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
| @@ -913,47 +913,47 @@ radeon_combios_get_tv_info(struct radeon_device *rdev) | |||
| 913 | switch (RBIOS8(tv_info + 7) & 0xf) { | 913 | switch (RBIOS8(tv_info + 7) & 0xf) { |
| 914 | case 1: | 914 | case 1: |
| 915 | tv_std = TV_STD_NTSC; | 915 | tv_std = TV_STD_NTSC; |
| 916 | DRM_INFO("Default TV standard: NTSC\n"); | 916 | DRM_DEBUG_KMS("Default TV standard: NTSC\n"); |
| 917 | break; | 917 | break; |
| 918 | case 2: | 918 | case 2: |
| 919 | tv_std = TV_STD_PAL; | 919 | tv_std = TV_STD_PAL; |
| 920 | DRM_INFO("Default TV standard: PAL\n"); | 920 | DRM_DEBUG_KMS("Default TV standard: PAL\n"); |
| 921 | break; | 921 | break; |
| 922 | case 3: | 922 | case 3: |
| 923 | tv_std = TV_STD_PAL_M; | 923 | tv_std = TV_STD_PAL_M; |
| 924 | DRM_INFO("Default TV standard: PAL-M\n"); | 924 | DRM_DEBUG_KMS("Default TV standard: PAL-M\n"); |
| 925 | break; | 925 | break; |
| 926 | case 4: | 926 | case 4: |
| 927 | tv_std = TV_STD_PAL_60; | 927 | tv_std = TV_STD_PAL_60; |
| 928 | DRM_INFO("Default TV standard: PAL-60\n"); | 928 | DRM_DEBUG_KMS("Default TV standard: PAL-60\n"); |
| 929 | break; | 929 | break; |
| 930 | case 5: | 930 | case 5: |
| 931 | tv_std = TV_STD_NTSC_J; | 931 | tv_std = TV_STD_NTSC_J; |
| 932 | DRM_INFO("Default TV standard: NTSC-J\n"); | 932 | DRM_DEBUG_KMS("Default TV standard: NTSC-J\n"); |
| 933 | break; | 933 | break; |
| 934 | case 6: | 934 | case 6: |
| 935 | tv_std = TV_STD_SCART_PAL; | 935 | tv_std = TV_STD_SCART_PAL; |
| 936 | DRM_INFO("Default TV standard: SCART-PAL\n"); | 936 | DRM_DEBUG_KMS("Default TV standard: SCART-PAL\n"); |
| 937 | break; | 937 | break; |
| 938 | default: | 938 | default: |
| 939 | tv_std = TV_STD_NTSC; | 939 | tv_std = TV_STD_NTSC; |
| 940 | DRM_INFO | 940 | DRM_DEBUG_KMS |
| 941 | ("Unknown TV standard; defaulting to NTSC\n"); | 941 | ("Unknown TV standard; defaulting to NTSC\n"); |
| 942 | break; | 942 | break; |
| 943 | } | 943 | } |
| 944 | 944 | ||
| 945 | switch ((RBIOS8(tv_info + 9) >> 2) & 0x3) { | 945 | switch ((RBIOS8(tv_info + 9) >> 2) & 0x3) { |
| 946 | case 0: | 946 | case 0: |
| 947 | DRM_INFO("29.498928713 MHz TV ref clk\n"); | 947 | DRM_DEBUG_KMS("29.498928713 MHz TV ref clk\n"); |
| 948 | break; | 948 | break; |
| 949 | case 1: | 949 | case 1: |
| 950 | DRM_INFO("28.636360000 MHz TV ref clk\n"); | 950 | DRM_DEBUG_KMS("28.636360000 MHz TV ref clk\n"); |
| 951 | break; | 951 | break; |
| 952 | case 2: | 952 | case 2: |
| 953 | DRM_INFO("14.318180000 MHz TV ref clk\n"); | 953 | DRM_DEBUG_KMS("14.318180000 MHz TV ref clk\n"); |
| 954 | break; | 954 | break; |
| 955 | case 3: | 955 | case 3: |
| 956 | DRM_INFO("27.000000000 MHz TV ref clk\n"); | 956 | DRM_DEBUG_KMS("27.000000000 MHz TV ref clk\n"); |
| 957 | break; | 957 | break; |
| 958 | default: | 958 | default: |
| 959 | break; | 959 | break; |
| @@ -1324,7 +1324,7 @@ bool radeon_legacy_get_tmds_info_from_combios(struct radeon_encoder *encoder, | |||
| 1324 | 1324 | ||
| 1325 | if (tmds_info) { | 1325 | if (tmds_info) { |
| 1326 | ver = RBIOS8(tmds_info); | 1326 | ver = RBIOS8(tmds_info); |
| 1327 | DRM_INFO("DFP table revision: %d\n", ver); | 1327 | DRM_DEBUG_KMS("DFP table revision: %d\n", ver); |
| 1328 | if (ver == 3) { | 1328 | if (ver == 3) { |
| 1329 | n = RBIOS8(tmds_info + 5) + 1; | 1329 | n = RBIOS8(tmds_info + 5) + 1; |
| 1330 | if (n > 4) | 1330 | if (n > 4) |
| @@ -1408,7 +1408,7 @@ bool radeon_legacy_get_ext_tmds_info_from_combios(struct radeon_encoder *encoder | |||
| 1408 | offset = combios_get_table_offset(dev, COMBIOS_EXT_TMDS_INFO_TABLE); | 1408 | offset = combios_get_table_offset(dev, COMBIOS_EXT_TMDS_INFO_TABLE); |
| 1409 | if (offset) { | 1409 | if (offset) { |
| 1410 | ver = RBIOS8(offset); | 1410 | ver = RBIOS8(offset); |
| 1411 | DRM_INFO("External TMDS Table revision: %d\n", ver); | 1411 | DRM_DEBUG_KMS("External TMDS Table revision: %d\n", ver); |
| 1412 | tmds->slave_addr = RBIOS8(offset + 4 + 2); | 1412 | tmds->slave_addr = RBIOS8(offset + 4 + 2); |
| 1413 | tmds->slave_addr >>= 1; /* 7 bit addressing */ | 1413 | tmds->slave_addr >>= 1; /* 7 bit addressing */ |
| 1414 | gpio = RBIOS8(offset + 4 + 3); | 1414 | gpio = RBIOS8(offset + 4 + 3); |
| @@ -1485,6 +1485,11 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1485 | /* PowerMac8,1 ? */ | 1485 | /* PowerMac8,1 ? */ |
| 1486 | /* imac g5 isight */ | 1486 | /* imac g5 isight */ |
| 1487 | rdev->mode_info.connector_table = CT_IMAC_G5_ISIGHT; | 1487 | rdev->mode_info.connector_table = CT_IMAC_G5_ISIGHT; |
| 1488 | } else if ((rdev->pdev->device == 0x4a48) && | ||
| 1489 | (rdev->pdev->subsystem_vendor == 0x1002) && | ||
| 1490 | (rdev->pdev->subsystem_device == 0x4a48)) { | ||
| 1491 | /* Mac X800 */ | ||
| 1492 | rdev->mode_info.connector_table = CT_MAC_X800; | ||
| 1488 | } else | 1493 | } else |
| 1489 | #endif /* CONFIG_PPC_PMAC */ | 1494 | #endif /* CONFIG_PPC_PMAC */ |
| 1490 | #ifdef CONFIG_PPC64 | 1495 | #ifdef CONFIG_PPC64 |
| @@ -1961,6 +1966,48 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1961 | CONNECTOR_OBJECT_ID_VGA, | 1966 | CONNECTOR_OBJECT_ID_VGA, |
| 1962 | &hpd); | 1967 | &hpd); |
| 1963 | break; | 1968 | break; |
| 1969 | case CT_MAC_X800: | ||
| 1970 | DRM_INFO("Connector Table: %d (mac x800)\n", | ||
| 1971 | rdev->mode_info.connector_table); | ||
| 1972 | /* DVI - primary dac, internal tmds */ | ||
| 1973 | ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); | ||
| 1974 | hpd.hpd = RADEON_HPD_1; /* ??? */ | ||
| 1975 | radeon_add_legacy_encoder(dev, | ||
| 1976 | radeon_get_encoder_enum(dev, | ||
| 1977 | ATOM_DEVICE_DFP1_SUPPORT, | ||
| 1978 | 0), | ||
| 1979 | ATOM_DEVICE_DFP1_SUPPORT); | ||
| 1980 | radeon_add_legacy_encoder(dev, | ||
| 1981 | radeon_get_encoder_enum(dev, | ||
| 1982 | ATOM_DEVICE_CRT1_SUPPORT, | ||
| 1983 | 1), | ||
| 1984 | ATOM_DEVICE_CRT1_SUPPORT); | ||
| 1985 | radeon_add_legacy_connector(dev, 0, | ||
| 1986 | ATOM_DEVICE_DFP1_SUPPORT | | ||
| 1987 | ATOM_DEVICE_CRT1_SUPPORT, | ||
| 1988 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, | ||
| 1989 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I, | ||
| 1990 | &hpd); | ||
| 1991 | /* DVI - tv dac, dvo */ | ||
| 1992 | ddc_i2c = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0); | ||
| 1993 | hpd.hpd = RADEON_HPD_2; /* ??? */ | ||
| 1994 | radeon_add_legacy_encoder(dev, | ||
| 1995 | radeon_get_encoder_enum(dev, | ||
| 1996 | ATOM_DEVICE_DFP2_SUPPORT, | ||
| 1997 | 0), | ||
| 1998 | ATOM_DEVICE_DFP2_SUPPORT); | ||
| 1999 | radeon_add_legacy_encoder(dev, | ||
| 2000 | radeon_get_encoder_enum(dev, | ||
| 2001 | ATOM_DEVICE_CRT2_SUPPORT, | ||
| 2002 | 2), | ||
| 2003 | ATOM_DEVICE_CRT2_SUPPORT); | ||
| 2004 | radeon_add_legacy_connector(dev, 1, | ||
| 2005 | ATOM_DEVICE_DFP2_SUPPORT | | ||
| 2006 | ATOM_DEVICE_CRT2_SUPPORT, | ||
| 2007 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, | ||
| 2008 | CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I, | ||
| 2009 | &hpd); | ||
| 2010 | break; | ||
| 1964 | default: | 2011 | default: |
| 1965 | DRM_INFO("Connector table: %d (invalid)\n", | 2012 | DRM_INFO("Connector table: %d (invalid)\n", |
| 1966 | rdev->mode_info.connector_table); | 2013 | rdev->mode_info.connector_table); |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index a9dd7847d96e..ecc1a8fafbfd 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
| @@ -481,7 +481,8 @@ static int radeon_lvds_mode_valid(struct drm_connector *connector, | |||
| 481 | return MODE_OK; | 481 | return MODE_OK; |
| 482 | } | 482 | } |
| 483 | 483 | ||
| 484 | static enum drm_connector_status radeon_lvds_detect(struct drm_connector *connector) | 484 | static enum drm_connector_status |
| 485 | radeon_lvds_detect(struct drm_connector *connector, bool force) | ||
| 485 | { | 486 | { |
| 486 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 487 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
| 487 | struct drm_encoder *encoder = radeon_best_single_encoder(connector); | 488 | struct drm_encoder *encoder = radeon_best_single_encoder(connector); |
| @@ -594,7 +595,8 @@ static int radeon_vga_mode_valid(struct drm_connector *connector, | |||
| 594 | return MODE_OK; | 595 | return MODE_OK; |
| 595 | } | 596 | } |
| 596 | 597 | ||
| 597 | static enum drm_connector_status radeon_vga_detect(struct drm_connector *connector) | 598 | static enum drm_connector_status |
| 599 | radeon_vga_detect(struct drm_connector *connector, bool force) | ||
| 598 | { | 600 | { |
| 599 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 601 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
| 600 | struct drm_encoder *encoder; | 602 | struct drm_encoder *encoder; |
| @@ -691,7 +693,8 @@ static int radeon_tv_mode_valid(struct drm_connector *connector, | |||
| 691 | return MODE_OK; | 693 | return MODE_OK; |
| 692 | } | 694 | } |
| 693 | 695 | ||
| 694 | static enum drm_connector_status radeon_tv_detect(struct drm_connector *connector) | 696 | static enum drm_connector_status |
| 697 | radeon_tv_detect(struct drm_connector *connector, bool force) | ||
| 695 | { | 698 | { |
| 696 | struct drm_encoder *encoder; | 699 | struct drm_encoder *encoder; |
| 697 | struct drm_encoder_helper_funcs *encoder_funcs; | 700 | struct drm_encoder_helper_funcs *encoder_funcs; |
| @@ -748,7 +751,8 @@ static int radeon_dvi_get_modes(struct drm_connector *connector) | |||
| 748 | * we have to check if this analog encoder is shared with anyone else (TV) | 751 | * we have to check if this analog encoder is shared with anyone else (TV) |
| 749 | * if its shared we have to set the other connector to disconnected. | 752 | * if its shared we have to set the other connector to disconnected. |
| 750 | */ | 753 | */ |
| 751 | static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connector) | 754 | static enum drm_connector_status |
| 755 | radeon_dvi_detect(struct drm_connector *connector, bool force) | ||
| 752 | { | 756 | { |
| 753 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 757 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
| 754 | struct drm_encoder *encoder = NULL; | 758 | struct drm_encoder *encoder = NULL; |
| @@ -972,7 +976,8 @@ static int radeon_dp_get_modes(struct drm_connector *connector) | |||
| 972 | return ret; | 976 | return ret; |
| 973 | } | 977 | } |
| 974 | 978 | ||
| 975 | static enum drm_connector_status radeon_dp_detect(struct drm_connector *connector) | 979 | static enum drm_connector_status |
| 980 | radeon_dp_detect(struct drm_connector *connector, bool force) | ||
| 976 | { | 981 | { |
| 977 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 982 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
| 978 | enum drm_connector_status ret = connector_status_disconnected; | 983 | enum drm_connector_status ret = connector_status_disconnected; |
diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c index 5731fc9b1ae3..3eef567b0421 100644 --- a/drivers/gpu/drm/radeon/radeon_cursor.c +++ b/drivers/gpu/drm/radeon/radeon_cursor.c | |||
| @@ -203,6 +203,7 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc, | |||
| 203 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | 203 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
| 204 | struct radeon_device *rdev = crtc->dev->dev_private; | 204 | struct radeon_device *rdev = crtc->dev->dev_private; |
| 205 | int xorigin = 0, yorigin = 0; | 205 | int xorigin = 0, yorigin = 0; |
| 206 | int w = radeon_crtc->cursor_width; | ||
| 206 | 207 | ||
| 207 | if (x < 0) | 208 | if (x < 0) |
| 208 | xorigin = -x + 1; | 209 | xorigin = -x + 1; |
| @@ -213,22 +214,7 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc, | |||
| 213 | if (yorigin >= CURSOR_HEIGHT) | 214 | if (yorigin >= CURSOR_HEIGHT) |
| 214 | yorigin = CURSOR_HEIGHT - 1; | 215 | yorigin = CURSOR_HEIGHT - 1; |
| 215 | 216 | ||
| 216 | radeon_lock_cursor(crtc, true); | 217 | if (ASIC_IS_AVIVO(rdev)) { |
| 217 | if (ASIC_IS_DCE4(rdev)) { | ||
| 218 | /* cursors are offset into the total surface */ | ||
| 219 | x += crtc->x; | ||
| 220 | y += crtc->y; | ||
| 221 | DRM_DEBUG("x %d y %d c->x %d c->y %d\n", x, y, crtc->x, crtc->y); | ||
| 222 | |||
| 223 | /* XXX: check if evergreen has the same issues as avivo chips */ | ||
| 224 | WREG32(EVERGREEN_CUR_POSITION + radeon_crtc->crtc_offset, | ||
| 225 | ((xorigin ? 0 : x) << 16) | | ||
| 226 | (yorigin ? 0 : y)); | ||
| 227 | WREG32(EVERGREEN_CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin); | ||
| 228 | WREG32(EVERGREEN_CUR_SIZE + radeon_crtc->crtc_offset, | ||
| 229 | ((radeon_crtc->cursor_width - 1) << 16) | (radeon_crtc->cursor_height - 1)); | ||
| 230 | } else if (ASIC_IS_AVIVO(rdev)) { | ||
| 231 | int w = radeon_crtc->cursor_width; | ||
| 232 | int i = 0; | 218 | int i = 0; |
| 233 | struct drm_crtc *crtc_p; | 219 | struct drm_crtc *crtc_p; |
| 234 | 220 | ||
| @@ -260,7 +246,17 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc, | |||
| 260 | if (w <= 0) | 246 | if (w <= 0) |
| 261 | w = 1; | 247 | w = 1; |
| 262 | } | 248 | } |
| 249 | } | ||
| 263 | 250 | ||
| 251 | radeon_lock_cursor(crtc, true); | ||
| 252 | if (ASIC_IS_DCE4(rdev)) { | ||
| 253 | WREG32(EVERGREEN_CUR_POSITION + radeon_crtc->crtc_offset, | ||
| 254 | ((xorigin ? 0 : x) << 16) | | ||
| 255 | (yorigin ? 0 : y)); | ||
| 256 | WREG32(EVERGREEN_CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin); | ||
| 257 | WREG32(EVERGREEN_CUR_SIZE + radeon_crtc->crtc_offset, | ||
| 258 | ((w - 1) << 16) | (radeon_crtc->cursor_height - 1)); | ||
| 259 | } else if (ASIC_IS_AVIVO(rdev)) { | ||
| 264 | WREG32(AVIVO_D1CUR_POSITION + radeon_crtc->crtc_offset, | 260 | WREG32(AVIVO_D1CUR_POSITION + radeon_crtc->crtc_offset, |
| 265 | ((xorigin ? 0 : x) << 16) | | 261 | ((xorigin ? 0 : x) << 16) | |
| 266 | (yorigin ? 0 : y)); | 262 | (yorigin ? 0 : y)); |
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 6dd434ad2429..b92d2f2fcbed 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
| @@ -349,6 +349,8 @@ static void radeon_print_display_setup(struct drm_device *dev) | |||
| 349 | DRM_INFO(" DFP4: %s\n", encoder_names[radeon_encoder->encoder_id]); | 349 | DRM_INFO(" DFP4: %s\n", encoder_names[radeon_encoder->encoder_id]); |
| 350 | if (devices & ATOM_DEVICE_DFP5_SUPPORT) | 350 | if (devices & ATOM_DEVICE_DFP5_SUPPORT) |
| 351 | DRM_INFO(" DFP5: %s\n", encoder_names[radeon_encoder->encoder_id]); | 351 | DRM_INFO(" DFP5: %s\n", encoder_names[radeon_encoder->encoder_id]); |
| 352 | if (devices & ATOM_DEVICE_DFP6_SUPPORT) | ||
| 353 | DRM_INFO(" DFP6: %s\n", encoder_names[radeon_encoder->encoder_id]); | ||
| 352 | if (devices & ATOM_DEVICE_TV1_SUPPORT) | 354 | if (devices & ATOM_DEVICE_TV1_SUPPORT) |
| 353 | DRM_INFO(" TV1: %s\n", encoder_names[radeon_encoder->encoder_id]); | 355 | DRM_INFO(" TV1: %s\n", encoder_names[radeon_encoder->encoder_id]); |
| 354 | if (devices & ATOM_DEVICE_CV_SUPPORT) | 356 | if (devices & ATOM_DEVICE_CV_SUPPORT) |
| @@ -841,8 +843,9 @@ static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb) | |||
| 841 | { | 843 | { |
| 842 | struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb); | 844 | struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb); |
| 843 | 845 | ||
| 844 | if (radeon_fb->obj) | 846 | if (radeon_fb->obj) { |
| 845 | drm_gem_object_unreference_unlocked(radeon_fb->obj); | 847 | drm_gem_object_unreference_unlocked(radeon_fb->obj); |
| 848 | } | ||
| 846 | drm_framebuffer_cleanup(fb); | 849 | drm_framebuffer_cleanup(fb); |
| 847 | kfree(radeon_fb); | 850 | kfree(radeon_fb); |
| 848 | } | 851 | } |
| @@ -1140,17 +1143,18 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc, | |||
| 1140 | radeon_crtc->rmx_type = radeon_encoder->rmx_type; | 1143 | radeon_crtc->rmx_type = radeon_encoder->rmx_type; |
| 1141 | else | 1144 | else |
| 1142 | radeon_crtc->rmx_type = RMX_OFF; | 1145 | radeon_crtc->rmx_type = RMX_OFF; |
| 1143 | src_v = crtc->mode.vdisplay; | ||
| 1144 | dst_v = radeon_crtc->native_mode.vdisplay; | ||
| 1145 | src_h = crtc->mode.hdisplay; | ||
| 1146 | dst_h = radeon_crtc->native_mode.vdisplay; | ||
| 1147 | /* copy native mode */ | 1146 | /* copy native mode */ |
| 1148 | memcpy(&radeon_crtc->native_mode, | 1147 | memcpy(&radeon_crtc->native_mode, |
| 1149 | &radeon_encoder->native_mode, | 1148 | &radeon_encoder->native_mode, |
| 1150 | sizeof(struct drm_display_mode)); | 1149 | sizeof(struct drm_display_mode)); |
| 1150 | src_v = crtc->mode.vdisplay; | ||
| 1151 | dst_v = radeon_crtc->native_mode.vdisplay; | ||
| 1152 | src_h = crtc->mode.hdisplay; | ||
| 1153 | dst_h = radeon_crtc->native_mode.hdisplay; | ||
| 1151 | 1154 | ||
| 1152 | /* fix up for overscan on hdmi */ | 1155 | /* fix up for overscan on hdmi */ |
| 1153 | if (ASIC_IS_AVIVO(rdev) && | 1156 | if (ASIC_IS_AVIVO(rdev) && |
| 1157 | (!(mode->flags & DRM_MODE_FLAG_INTERLACE)) && | ||
| 1154 | ((radeon_encoder->underscan_type == UNDERSCAN_ON) || | 1158 | ((radeon_encoder->underscan_type == UNDERSCAN_ON) || |
| 1155 | ((radeon_encoder->underscan_type == UNDERSCAN_AUTO) && | 1159 | ((radeon_encoder->underscan_type == UNDERSCAN_AUTO) && |
| 1156 | drm_detect_hdmi_monitor(radeon_connector->edid) && | 1160 | drm_detect_hdmi_monitor(radeon_connector->edid) && |
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index c74a8b20d941..40b0c087b592 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c | |||
| @@ -94,6 +94,7 @@ static void radeonfb_destroy_pinned_object(struct drm_gem_object *gobj) | |||
| 94 | ret = radeon_bo_reserve(rbo, false); | 94 | ret = radeon_bo_reserve(rbo, false); |
| 95 | if (likely(ret == 0)) { | 95 | if (likely(ret == 0)) { |
| 96 | radeon_bo_kunmap(rbo); | 96 | radeon_bo_kunmap(rbo); |
| 97 | radeon_bo_unpin(rbo); | ||
| 97 | radeon_bo_unreserve(rbo); | 98 | radeon_bo_unreserve(rbo); |
| 98 | } | 99 | } |
| 99 | drm_gem_object_unreference_unlocked(gobj); | 100 | drm_gem_object_unreference_unlocked(gobj); |
| @@ -325,8 +326,6 @@ static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfb | |||
| 325 | { | 326 | { |
| 326 | struct fb_info *info; | 327 | struct fb_info *info; |
| 327 | struct radeon_framebuffer *rfb = &rfbdev->rfb; | 328 | struct radeon_framebuffer *rfb = &rfbdev->rfb; |
| 328 | struct radeon_bo *rbo; | ||
| 329 | int r; | ||
| 330 | 329 | ||
| 331 | if (rfbdev->helper.fbdev) { | 330 | if (rfbdev->helper.fbdev) { |
| 332 | info = rfbdev->helper.fbdev; | 331 | info = rfbdev->helper.fbdev; |
| @@ -338,14 +337,8 @@ static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfb | |||
| 338 | } | 337 | } |
| 339 | 338 | ||
| 340 | if (rfb->obj) { | 339 | if (rfb->obj) { |
| 341 | rbo = rfb->obj->driver_private; | 340 | radeonfb_destroy_pinned_object(rfb->obj); |
| 342 | r = radeon_bo_reserve(rbo, false); | 341 | rfb->obj = NULL; |
| 343 | if (likely(r == 0)) { | ||
| 344 | radeon_bo_kunmap(rbo); | ||
| 345 | radeon_bo_unpin(rbo); | ||
| 346 | radeon_bo_unreserve(rbo); | ||
| 347 | } | ||
| 348 | drm_gem_object_unreference_unlocked(rfb->obj); | ||
| 349 | } | 342 | } |
| 350 | drm_fb_helper_fini(&rfbdev->helper); | 343 | drm_fb_helper_fini(&rfbdev->helper); |
| 351 | drm_framebuffer_cleanup(&rfb->base); | 344 | drm_framebuffer_cleanup(&rfb->base); |
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index c578f265b24c..d1e595d91723 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c | |||
| @@ -201,11 +201,11 @@ int radeon_gem_create_ioctl(struct drm_device *dev, void *data, | |||
| 201 | return r; | 201 | return r; |
| 202 | } | 202 | } |
| 203 | r = drm_gem_handle_create(filp, gobj, &handle); | 203 | r = drm_gem_handle_create(filp, gobj, &handle); |
| 204 | /* drop reference from allocate - handle holds it now */ | ||
| 205 | drm_gem_object_unreference_unlocked(gobj); | ||
| 204 | if (r) { | 206 | if (r) { |
| 205 | drm_gem_object_unreference_unlocked(gobj); | ||
| 206 | return r; | 207 | return r; |
| 207 | } | 208 | } |
| 208 | drm_gem_object_handle_unreference_unlocked(gobj); | ||
| 209 | args->handle = handle; | 209 | args->handle = handle; |
| 210 | return 0; | 210 | return 0; |
| 211 | } | 211 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 5eee3c41d124..8fbbe1c6ebbd 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
| @@ -203,6 +203,10 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) | |||
| 203 | */ | 203 | */ |
| 204 | int radeon_driver_firstopen_kms(struct drm_device *dev) | 204 | int radeon_driver_firstopen_kms(struct drm_device *dev) |
| 205 | { | 205 | { |
| 206 | struct radeon_device *rdev = dev->dev_private; | ||
| 207 | |||
| 208 | if (rdev->powered_down) | ||
| 209 | return -EINVAL; | ||
| 206 | return 0; | 210 | return 0; |
| 207 | } | 211 | } |
| 208 | 212 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index efbe975312dc..17a6602b5885 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
| @@ -204,7 +204,7 @@ struct radeon_i2c_chan { | |||
| 204 | 204 | ||
| 205 | /* mostly for macs, but really any system without connector tables */ | 205 | /* mostly for macs, but really any system without connector tables */ |
| 206 | enum radeon_connector_table { | 206 | enum radeon_connector_table { |
| 207 | CT_NONE, | 207 | CT_NONE = 0, |
| 208 | CT_GENERIC, | 208 | CT_GENERIC, |
| 209 | CT_IBOOK, | 209 | CT_IBOOK, |
| 210 | CT_POWERBOOK_EXTERNAL, | 210 | CT_POWERBOOK_EXTERNAL, |
| @@ -215,6 +215,7 @@ enum radeon_connector_table { | |||
| 215 | CT_IMAC_G5_ISIGHT, | 215 | CT_IMAC_G5_ISIGHT, |
| 216 | CT_EMAC, | 216 | CT_EMAC, |
| 217 | CT_RN50_POWER, | 217 | CT_RN50_POWER, |
| 218 | CT_MAC_X800, | ||
| 218 | }; | 219 | }; |
| 219 | 220 | ||
| 220 | enum radeon_dvo_chip { | 221 | enum radeon_dvo_chip { |
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 0afd1e62347d..b3b5306bb578 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c | |||
| @@ -69,7 +69,7 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain) | |||
| 69 | u32 c = 0; | 69 | u32 c = 0; |
| 70 | 70 | ||
| 71 | rbo->placement.fpfn = 0; | 71 | rbo->placement.fpfn = 0; |
| 72 | rbo->placement.lpfn = 0; | 72 | rbo->placement.lpfn = rbo->rdev->mc.active_vram_size >> PAGE_SHIFT; |
| 73 | rbo->placement.placement = rbo->placements; | 73 | rbo->placement.placement = rbo->placements; |
| 74 | rbo->placement.busy_placement = rbo->placements; | 74 | rbo->placement.busy_placement = rbo->placements; |
| 75 | if (domain & RADEON_GEM_DOMAIN_VRAM) | 75 | if (domain & RADEON_GEM_DOMAIN_VRAM) |
diff --git a/drivers/gpu/drm/radeon/radeon_object.h b/drivers/gpu/drm/radeon/radeon_object.h index 353998dc2c03..3481bc7f6f58 100644 --- a/drivers/gpu/drm/radeon/radeon_object.h +++ b/drivers/gpu/drm/radeon/radeon_object.h | |||
| @@ -124,11 +124,8 @@ static inline int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, | |||
| 124 | int r; | 124 | int r; |
| 125 | 125 | ||
| 126 | r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); | 126 | r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); |
| 127 | if (unlikely(r != 0)) { | 127 | if (unlikely(r != 0)) |
| 128 | if (r != -ERESTARTSYS) | ||
| 129 | dev_err(bo->rdev->dev, "%p reserve failed for wait\n", bo); | ||
| 130 | return r; | 128 | return r; |
| 131 | } | ||
| 132 | spin_lock(&bo->tbo.lock); | 129 | spin_lock(&bo->tbo.lock); |
| 133 | if (mem_type) | 130 | if (mem_type) |
| 134 | *mem_type = bo->tbo.mem.mem_type; | 131 | *mem_type = bo->tbo.mem.mem_type; |
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index cc05b230d7ef..51d5f7b5ab21 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
| @@ -693,6 +693,7 @@ void rs600_mc_init(struct radeon_device *rdev) | |||
| 693 | rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE); | 693 | rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE); |
| 694 | rdev->mc.mc_vram_size = rdev->mc.real_vram_size; | 694 | rdev->mc.mc_vram_size = rdev->mc.real_vram_size; |
| 695 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 695 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
| 696 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
| 696 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); | 697 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); |
| 697 | base = RREG32_MC(R_000004_MC_FB_LOCATION); | 698 | base = RREG32_MC(R_000004_MC_FB_LOCATION); |
| 698 | base = G_000004_MC_FB_START(base) << 16; | 699 | base = G_000004_MC_FB_START(base) << 16; |
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index 3e3f75718be3..4dc2a87ea680 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c | |||
| @@ -157,6 +157,7 @@ void rs690_mc_init(struct radeon_device *rdev) | |||
| 157 | rdev->mc.aper_base = pci_resource_start(rdev->pdev, 0); | 157 | rdev->mc.aper_base = pci_resource_start(rdev->pdev, 0); |
| 158 | rdev->mc.aper_size = pci_resource_len(rdev->pdev, 0); | 158 | rdev->mc.aper_size = pci_resource_len(rdev->pdev, 0); |
| 159 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 159 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
| 160 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
| 160 | base = RREG32_MC(R_000100_MCCFG_FB_LOCATION); | 161 | base = RREG32_MC(R_000100_MCCFG_FB_LOCATION); |
| 161 | base = G_000100_MC_FB_START(base) << 16; | 162 | base = G_000100_MC_FB_START(base) << 16; |
| 162 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); | 163 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index bfa59db374d2..9490da700749 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
| @@ -267,6 +267,7 @@ static void rv770_mc_program(struct radeon_device *rdev) | |||
| 267 | */ | 267 | */ |
| 268 | void r700_cp_stop(struct radeon_device *rdev) | 268 | void r700_cp_stop(struct radeon_device *rdev) |
| 269 | { | 269 | { |
| 270 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
| 270 | WREG32(CP_ME_CNTL, (CP_ME_HALT | CP_PFP_HALT)); | 271 | WREG32(CP_ME_CNTL, (CP_ME_HALT | CP_PFP_HALT)); |
| 271 | } | 272 | } |
| 272 | 273 | ||
| @@ -992,6 +993,7 @@ int rv770_mc_init(struct radeon_device *rdev) | |||
| 992 | rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); | 993 | rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); |
| 993 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); | 994 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); |
| 994 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 995 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
| 996 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | ||
| 995 | r600_vram_gtt_location(rdev, &rdev->mc); | 997 | r600_vram_gtt_location(rdev, &rdev->mc); |
| 996 | radeon_update_bandwidth_info(rdev); | 998 | radeon_update_bandwidth_info(rdev); |
| 997 | 999 | ||
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index cb4cf7ef4d1e..db809e034cc4 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
| @@ -442,6 +442,43 @@ out_err: | |||
| 442 | } | 442 | } |
| 443 | 443 | ||
| 444 | /** | 444 | /** |
| 445 | * Call bo::reserved and with the lru lock held. | ||
| 446 | * Will release GPU memory type usage on destruction. | ||
| 447 | * This is the place to put in driver specific hooks. | ||
| 448 | * Will release the bo::reserved lock and the | ||
| 449 | * lru lock on exit. | ||
| 450 | */ | ||
| 451 | |||
| 452 | static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo) | ||
| 453 | { | ||
| 454 | struct ttm_bo_global *glob = bo->glob; | ||
| 455 | |||
| 456 | if (bo->ttm) { | ||
| 457 | |||
| 458 | /** | ||
| 459 | * Release the lru_lock, since we don't want to have | ||
| 460 | * an atomic requirement on ttm_tt[unbind|destroy]. | ||
| 461 | */ | ||
| 462 | |||
| 463 | spin_unlock(&glob->lru_lock); | ||
| 464 | ttm_tt_unbind(bo->ttm); | ||
| 465 | ttm_tt_destroy(bo->ttm); | ||
| 466 | bo->ttm = NULL; | ||
| 467 | spin_lock(&glob->lru_lock); | ||
| 468 | } | ||
| 469 | |||
| 470 | if (bo->mem.mm_node) { | ||
| 471 | drm_mm_put_block(bo->mem.mm_node); | ||
| 472 | bo->mem.mm_node = NULL; | ||
| 473 | } | ||
| 474 | |||
| 475 | atomic_set(&bo->reserved, 0); | ||
| 476 | wake_up_all(&bo->event_queue); | ||
| 477 | spin_unlock(&glob->lru_lock); | ||
| 478 | } | ||
| 479 | |||
| 480 | |||
| 481 | /** | ||
| 445 | * If bo idle, remove from delayed- and lru lists, and unref. | 482 | * If bo idle, remove from delayed- and lru lists, and unref. |
| 446 | * If not idle, and already on delayed list, do nothing. | 483 | * If not idle, and already on delayed list, do nothing. |
| 447 | * If not idle, and not on delayed list, put on delayed list, | 484 | * If not idle, and not on delayed list, put on delayed list, |
| @@ -456,6 +493,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo, bool remove_all) | |||
| 456 | int ret; | 493 | int ret; |
| 457 | 494 | ||
| 458 | spin_lock(&bo->lock); | 495 | spin_lock(&bo->lock); |
| 496 | retry: | ||
| 459 | (void) ttm_bo_wait(bo, false, false, !remove_all); | 497 | (void) ttm_bo_wait(bo, false, false, !remove_all); |
| 460 | 498 | ||
| 461 | if (!bo->sync_obj) { | 499 | if (!bo->sync_obj) { |
| @@ -464,31 +502,52 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo, bool remove_all) | |||
| 464 | spin_unlock(&bo->lock); | 502 | spin_unlock(&bo->lock); |
| 465 | 503 | ||
| 466 | spin_lock(&glob->lru_lock); | 504 | spin_lock(&glob->lru_lock); |
| 467 | put_count = ttm_bo_del_from_lru(bo); | 505 | ret = ttm_bo_reserve_locked(bo, false, !remove_all, false, 0); |
| 506 | |||
| 507 | /** | ||
| 508 | * Someone else has the object reserved. Bail and retry. | ||
| 509 | */ | ||
| 468 | 510 | ||
| 469 | ret = ttm_bo_reserve_locked(bo, false, false, false, 0); | 511 | if (unlikely(ret == -EBUSY)) { |
| 470 | BUG_ON(ret); | 512 | spin_unlock(&glob->lru_lock); |
| 471 | if (bo->ttm) | 513 | spin_lock(&bo->lock); |
| 472 | ttm_tt_unbind(bo->ttm); | 514 | goto requeue; |
| 515 | } | ||
| 516 | |||
| 517 | /** | ||
| 518 | * We can re-check for sync object without taking | ||
| 519 | * the bo::lock since setting the sync object requires | ||
| 520 | * also bo::reserved. A busy object at this point may | ||
| 521 | * be caused by another thread starting an accelerated | ||
| 522 | * eviction. | ||
| 523 | */ | ||
| 524 | |||
| 525 | if (unlikely(bo->sync_obj)) { | ||
| 526 | atomic_set(&bo->reserved, 0); | ||
| 527 | wake_up_all(&bo->event_queue); | ||
| 528 | spin_unlock(&glob->lru_lock); | ||
| 529 | spin_lock(&bo->lock); | ||
| 530 | if (remove_all) | ||
| 531 | goto retry; | ||
| 532 | else | ||
| 533 | goto requeue; | ||
| 534 | } | ||
| 535 | |||
| 536 | put_count = ttm_bo_del_from_lru(bo); | ||
| 473 | 537 | ||
| 474 | if (!list_empty(&bo->ddestroy)) { | 538 | if (!list_empty(&bo->ddestroy)) { |
| 475 | list_del_init(&bo->ddestroy); | 539 | list_del_init(&bo->ddestroy); |
| 476 | ++put_count; | 540 | ++put_count; |
| 477 | } | 541 | } |
| 478 | if (bo->mem.mm_node) { | ||
| 479 | drm_mm_put_block(bo->mem.mm_node); | ||
| 480 | bo->mem.mm_node = NULL; | ||
| 481 | } | ||
| 482 | spin_unlock(&glob->lru_lock); | ||
| 483 | 542 | ||
| 484 | atomic_set(&bo->reserved, 0); | 543 | ttm_bo_cleanup_memtype_use(bo); |
| 485 | 544 | ||
| 486 | while (put_count--) | 545 | while (put_count--) |
| 487 | kref_put(&bo->list_kref, ttm_bo_ref_bug); | 546 | kref_put(&bo->list_kref, ttm_bo_ref_bug); |
| 488 | 547 | ||
| 489 | return 0; | 548 | return 0; |
| 490 | } | 549 | } |
| 491 | 550 | requeue: | |
| 492 | spin_lock(&glob->lru_lock); | 551 | spin_lock(&glob->lru_lock); |
| 493 | if (list_empty(&bo->ddestroy)) { | 552 | if (list_empty(&bo->ddestroy)) { |
| 494 | void *sync_obj = bo->sync_obj; | 553 | void *sync_obj = bo->sync_obj; |
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 7cffb3e04232..3451a82adba7 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c | |||
| @@ -351,6 +351,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, | |||
| 351 | INIT_LIST_HEAD(&fbo->lru); | 351 | INIT_LIST_HEAD(&fbo->lru); |
| 352 | INIT_LIST_HEAD(&fbo->swap); | 352 | INIT_LIST_HEAD(&fbo->swap); |
| 353 | fbo->vm_node = NULL; | 353 | fbo->vm_node = NULL; |
| 354 | atomic_set(&fbo->cpu_writers, 0); | ||
| 354 | 355 | ||
| 355 | fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj); | 356 | fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj); |
| 356 | kref_init(&fbo->list_kref); | 357 | kref_init(&fbo->list_kref); |
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index ca904799f018..b1e02fffd3cc 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c | |||
| @@ -69,7 +69,7 @@ struct ttm_page_pool { | |||
| 69 | spinlock_t lock; | 69 | spinlock_t lock; |
| 70 | bool fill_lock; | 70 | bool fill_lock; |
| 71 | struct list_head list; | 71 | struct list_head list; |
| 72 | int gfp_flags; | 72 | gfp_t gfp_flags; |
| 73 | unsigned npages; | 73 | unsigned npages; |
| 74 | char *name; | 74 | char *name; |
| 75 | unsigned long nfrees; | 75 | unsigned long nfrees; |
| @@ -475,7 +475,7 @@ static void ttm_handle_caching_state_failure(struct list_head *pages, | |||
| 475 | * This function is reentrant if caller updates count depending on number of | 475 | * This function is reentrant if caller updates count depending on number of |
| 476 | * pages returned in pages array. | 476 | * pages returned in pages array. |
| 477 | */ | 477 | */ |
| 478 | static int ttm_alloc_new_pages(struct list_head *pages, int gfp_flags, | 478 | static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags, |
| 479 | int ttm_flags, enum ttm_caching_state cstate, unsigned count) | 479 | int ttm_flags, enum ttm_caching_state cstate, unsigned count) |
| 480 | { | 480 | { |
| 481 | struct page **caching_array; | 481 | struct page **caching_array; |
| @@ -666,7 +666,7 @@ int ttm_get_pages(struct list_head *pages, int flags, | |||
| 666 | { | 666 | { |
| 667 | struct ttm_page_pool *pool = ttm_get_pool(flags, cstate); | 667 | struct ttm_page_pool *pool = ttm_get_pool(flags, cstate); |
| 668 | struct page *p = NULL; | 668 | struct page *p = NULL; |
| 669 | int gfp_flags = GFP_USER; | 669 | gfp_t gfp_flags = GFP_USER; |
| 670 | int r; | 670 | int r; |
| 671 | 671 | ||
| 672 | /* set zero flag for page allocation if required */ | 672 | /* set zero flag for page allocation if required */ |
| @@ -818,7 +818,7 @@ int ttm_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages) | |||
| 818 | return 0; | 818 | return 0; |
| 819 | } | 819 | } |
| 820 | 820 | ||
| 821 | void ttm_page_alloc_fini() | 821 | void ttm_page_alloc_fini(void) |
| 822 | { | 822 | { |
| 823 | int i; | 823 | int i; |
| 824 | 824 | ||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 72ec2e2b6e97..a96ed6d9d010 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | |||
| @@ -148,13 +148,16 @@ static struct pci_device_id vmw_pci_id_list[] = { | |||
| 148 | {0, 0, 0} | 148 | {0, 0, 0} |
| 149 | }; | 149 | }; |
| 150 | 150 | ||
| 151 | static char *vmw_devname = "vmwgfx"; | 151 | static int enable_fbdev; |
| 152 | 152 | ||
| 153 | static int vmw_probe(struct pci_dev *, const struct pci_device_id *); | 153 | static int vmw_probe(struct pci_dev *, const struct pci_device_id *); |
| 154 | static void vmw_master_init(struct vmw_master *); | 154 | static void vmw_master_init(struct vmw_master *); |
| 155 | static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val, | 155 | static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val, |
| 156 | void *ptr); | 156 | void *ptr); |
| 157 | 157 | ||
| 158 | MODULE_PARM_DESC(enable_fbdev, "Enable vmwgfx fbdev"); | ||
| 159 | module_param_named(enable_fbdev, enable_fbdev, int, 0600); | ||
| 160 | |||
| 158 | static void vmw_print_capabilities(uint32_t capabilities) | 161 | static void vmw_print_capabilities(uint32_t capabilities) |
| 159 | { | 162 | { |
| 160 | DRM_INFO("Capabilities:\n"); | 163 | DRM_INFO("Capabilities:\n"); |
| @@ -192,8 +195,6 @@ static int vmw_request_device(struct vmw_private *dev_priv) | |||
| 192 | { | 195 | { |
| 193 | int ret; | 196 | int ret; |
| 194 | 197 | ||
| 195 | vmw_kms_save_vga(dev_priv); | ||
| 196 | |||
| 197 | ret = vmw_fifo_init(dev_priv, &dev_priv->fifo); | 198 | ret = vmw_fifo_init(dev_priv, &dev_priv->fifo); |
| 198 | if (unlikely(ret != 0)) { | 199 | if (unlikely(ret != 0)) { |
| 199 | DRM_ERROR("Unable to initialize FIFO.\n"); | 200 | DRM_ERROR("Unable to initialize FIFO.\n"); |
| @@ -206,9 +207,35 @@ static int vmw_request_device(struct vmw_private *dev_priv) | |||
| 206 | static void vmw_release_device(struct vmw_private *dev_priv) | 207 | static void vmw_release_device(struct vmw_private *dev_priv) |
| 207 | { | 208 | { |
| 208 | vmw_fifo_release(dev_priv, &dev_priv->fifo); | 209 | vmw_fifo_release(dev_priv, &dev_priv->fifo); |
| 209 | vmw_kms_restore_vga(dev_priv); | ||
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | int vmw_3d_resource_inc(struct vmw_private *dev_priv) | ||
| 213 | { | ||
| 214 | int ret = 0; | ||
| 215 | |||
| 216 | mutex_lock(&dev_priv->release_mutex); | ||
| 217 | if (unlikely(dev_priv->num_3d_resources++ == 0)) { | ||
| 218 | ret = vmw_request_device(dev_priv); | ||
| 219 | if (unlikely(ret != 0)) | ||
| 220 | --dev_priv->num_3d_resources; | ||
| 221 | } | ||
| 222 | mutex_unlock(&dev_priv->release_mutex); | ||
| 223 | return ret; | ||
| 224 | } | ||
| 225 | |||
| 226 | |||
| 227 | void vmw_3d_resource_dec(struct vmw_private *dev_priv) | ||
| 228 | { | ||
| 229 | int32_t n3d; | ||
| 230 | |||
| 231 | mutex_lock(&dev_priv->release_mutex); | ||
| 232 | if (unlikely(--dev_priv->num_3d_resources == 0)) | ||
| 233 | vmw_release_device(dev_priv); | ||
| 234 | n3d = (int32_t) dev_priv->num_3d_resources; | ||
| 235 | mutex_unlock(&dev_priv->release_mutex); | ||
| 236 | |||
| 237 | BUG_ON(n3d < 0); | ||
| 238 | } | ||
| 212 | 239 | ||
| 213 | static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) | 240 | static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) |
| 214 | { | 241 | { |
| @@ -228,6 +255,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) | |||
| 228 | dev_priv->last_read_sequence = (uint32_t) -100; | 255 | dev_priv->last_read_sequence = (uint32_t) -100; |
| 229 | mutex_init(&dev_priv->hw_mutex); | 256 | mutex_init(&dev_priv->hw_mutex); |
| 230 | mutex_init(&dev_priv->cmdbuf_mutex); | 257 | mutex_init(&dev_priv->cmdbuf_mutex); |
| 258 | mutex_init(&dev_priv->release_mutex); | ||
| 231 | rwlock_init(&dev_priv->resource_lock); | 259 | rwlock_init(&dev_priv->resource_lock); |
| 232 | idr_init(&dev_priv->context_idr); | 260 | idr_init(&dev_priv->context_idr); |
| 233 | idr_init(&dev_priv->surface_idr); | 261 | idr_init(&dev_priv->surface_idr); |
| @@ -244,6 +272,8 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) | |||
| 244 | dev_priv->vram_start = pci_resource_start(dev->pdev, 1); | 272 | dev_priv->vram_start = pci_resource_start(dev->pdev, 1); |
| 245 | dev_priv->mmio_start = pci_resource_start(dev->pdev, 2); | 273 | dev_priv->mmio_start = pci_resource_start(dev->pdev, 2); |
| 246 | 274 | ||
| 275 | dev_priv->enable_fb = enable_fbdev; | ||
| 276 | |||
| 247 | mutex_lock(&dev_priv->hw_mutex); | 277 | mutex_lock(&dev_priv->hw_mutex); |
| 248 | 278 | ||
| 249 | vmw_write(dev_priv, SVGA_REG_ID, SVGA_ID_2); | 279 | vmw_write(dev_priv, SVGA_REG_ID, SVGA_ID_2); |
| @@ -343,17 +373,6 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) | |||
| 343 | 373 | ||
| 344 | dev->dev_private = dev_priv; | 374 | dev->dev_private = dev_priv; |
| 345 | 375 | ||
| 346 | if (!dev->devname) | ||
| 347 | dev->devname = vmw_devname; | ||
| 348 | |||
| 349 | if (dev_priv->capabilities & SVGA_CAP_IRQMASK) { | ||
| 350 | ret = drm_irq_install(dev); | ||
| 351 | if (unlikely(ret != 0)) { | ||
| 352 | DRM_ERROR("Failed installing irq: %d\n", ret); | ||
| 353 | goto out_no_irq; | ||
| 354 | } | ||
| 355 | } | ||
| 356 | |||
| 357 | ret = pci_request_regions(dev->pdev, "vmwgfx probe"); | 376 | ret = pci_request_regions(dev->pdev, "vmwgfx probe"); |
| 358 | dev_priv->stealth = (ret != 0); | 377 | dev_priv->stealth = (ret != 0); |
| 359 | if (dev_priv->stealth) { | 378 | if (dev_priv->stealth) { |
| @@ -369,26 +388,52 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) | |||
| 369 | goto out_no_device; | 388 | goto out_no_device; |
| 370 | } | 389 | } |
| 371 | } | 390 | } |
| 372 | ret = vmw_request_device(dev_priv); | 391 | ret = vmw_kms_init(dev_priv); |
| 373 | if (unlikely(ret != 0)) | 392 | if (unlikely(ret != 0)) |
| 374 | goto out_no_device; | 393 | goto out_no_kms; |
| 375 | vmw_kms_init(dev_priv); | ||
| 376 | vmw_overlay_init(dev_priv); | 394 | vmw_overlay_init(dev_priv); |
| 377 | vmw_fb_init(dev_priv); | 395 | if (dev_priv->enable_fb) { |
| 396 | ret = vmw_3d_resource_inc(dev_priv); | ||
| 397 | if (unlikely(ret != 0)) | ||
| 398 | goto out_no_fifo; | ||
| 399 | vmw_kms_save_vga(dev_priv); | ||
| 400 | vmw_fb_init(dev_priv); | ||
| 401 | DRM_INFO("%s", vmw_fifo_have_3d(dev_priv) ? | ||
| 402 | "Detected device 3D availability.\n" : | ||
| 403 | "Detected no device 3D availability.\n"); | ||
| 404 | } else { | ||
| 405 | DRM_INFO("Delayed 3D detection since we're not " | ||
| 406 | "running the device in SVGA mode yet.\n"); | ||
| 407 | } | ||
| 408 | |||
| 409 | if (dev_priv->capabilities & SVGA_CAP_IRQMASK) { | ||
| 410 | ret = drm_irq_install(dev); | ||
| 411 | if (unlikely(ret != 0)) { | ||
| 412 | DRM_ERROR("Failed installing irq: %d\n", ret); | ||
| 413 | goto out_no_irq; | ||
| 414 | } | ||
| 415 | } | ||
| 378 | 416 | ||
| 379 | dev_priv->pm_nb.notifier_call = vmwgfx_pm_notifier; | 417 | dev_priv->pm_nb.notifier_call = vmwgfx_pm_notifier; |
| 380 | register_pm_notifier(&dev_priv->pm_nb); | 418 | register_pm_notifier(&dev_priv->pm_nb); |
| 381 | 419 | ||
| 382 | DRM_INFO("%s", vmw_fifo_have_3d(dev_priv) ? "Have 3D\n" : "No 3D\n"); | ||
| 383 | |||
| 384 | return 0; | 420 | return 0; |
| 385 | 421 | ||
| 386 | out_no_device: | ||
| 387 | if (dev_priv->capabilities & SVGA_CAP_IRQMASK) | ||
| 388 | drm_irq_uninstall(dev_priv->dev); | ||
| 389 | if (dev->devname == vmw_devname) | ||
| 390 | dev->devname = NULL; | ||
| 391 | out_no_irq: | 422 | out_no_irq: |
| 423 | if (dev_priv->enable_fb) { | ||
| 424 | vmw_fb_close(dev_priv); | ||
| 425 | vmw_kms_restore_vga(dev_priv); | ||
| 426 | vmw_3d_resource_dec(dev_priv); | ||
| 427 | } | ||
| 428 | out_no_fifo: | ||
| 429 | vmw_overlay_close(dev_priv); | ||
| 430 | vmw_kms_close(dev_priv); | ||
| 431 | out_no_kms: | ||
| 432 | if (dev_priv->stealth) | ||
| 433 | pci_release_region(dev->pdev, 2); | ||
| 434 | else | ||
| 435 | pci_release_regions(dev->pdev); | ||
| 436 | out_no_device: | ||
| 392 | ttm_object_device_release(&dev_priv->tdev); | 437 | ttm_object_device_release(&dev_priv->tdev); |
| 393 | out_err4: | 438 | out_err4: |
| 394 | iounmap(dev_priv->mmio_virt); | 439 | iounmap(dev_priv->mmio_virt); |
| @@ -415,19 +460,20 @@ static int vmw_driver_unload(struct drm_device *dev) | |||
| 415 | 460 | ||
| 416 | unregister_pm_notifier(&dev_priv->pm_nb); | 461 | unregister_pm_notifier(&dev_priv->pm_nb); |
| 417 | 462 | ||
| 418 | vmw_fb_close(dev_priv); | 463 | if (dev_priv->capabilities & SVGA_CAP_IRQMASK) |
| 464 | drm_irq_uninstall(dev_priv->dev); | ||
| 465 | if (dev_priv->enable_fb) { | ||
| 466 | vmw_fb_close(dev_priv); | ||
| 467 | vmw_kms_restore_vga(dev_priv); | ||
| 468 | vmw_3d_resource_dec(dev_priv); | ||
| 469 | } | ||
| 419 | vmw_kms_close(dev_priv); | 470 | vmw_kms_close(dev_priv); |
| 420 | vmw_overlay_close(dev_priv); | 471 | vmw_overlay_close(dev_priv); |
| 421 | vmw_release_device(dev_priv); | ||
| 422 | if (dev_priv->stealth) | 472 | if (dev_priv->stealth) |
| 423 | pci_release_region(dev->pdev, 2); | 473 | pci_release_region(dev->pdev, 2); |
| 424 | else | 474 | else |
| 425 | pci_release_regions(dev->pdev); | 475 | pci_release_regions(dev->pdev); |
| 426 | 476 | ||
| 427 | if (dev_priv->capabilities & SVGA_CAP_IRQMASK) | ||
| 428 | drm_irq_uninstall(dev_priv->dev); | ||
| 429 | if (dev->devname == vmw_devname) | ||
| 430 | dev->devname = NULL; | ||
| 431 | ttm_object_device_release(&dev_priv->tdev); | 477 | ttm_object_device_release(&dev_priv->tdev); |
| 432 | iounmap(dev_priv->mmio_virt); | 478 | iounmap(dev_priv->mmio_virt); |
| 433 | drm_mtrr_del(dev_priv->mmio_mtrr, dev_priv->mmio_start, | 479 | drm_mtrr_del(dev_priv->mmio_mtrr, dev_priv->mmio_start, |
| @@ -500,7 +546,7 @@ static long vmw_unlocked_ioctl(struct file *filp, unsigned int cmd, | |||
| 500 | struct drm_ioctl_desc *ioctl = | 546 | struct drm_ioctl_desc *ioctl = |
| 501 | &vmw_ioctls[nr - DRM_COMMAND_BASE]; | 547 | &vmw_ioctls[nr - DRM_COMMAND_BASE]; |
| 502 | 548 | ||
| 503 | if (unlikely(ioctl->cmd != cmd)) { | 549 | if (unlikely(ioctl->cmd_drv != cmd)) { |
| 504 | DRM_ERROR("Invalid command format, ioctl %d\n", | 550 | DRM_ERROR("Invalid command format, ioctl %d\n", |
| 505 | nr - DRM_COMMAND_BASE); | 551 | nr - DRM_COMMAND_BASE); |
| 506 | return -EINVAL; | 552 | return -EINVAL; |
| @@ -589,6 +635,16 @@ static int vmw_master_set(struct drm_device *dev, | |||
| 589 | struct vmw_master *vmaster = vmw_master(file_priv->master); | 635 | struct vmw_master *vmaster = vmw_master(file_priv->master); |
| 590 | int ret = 0; | 636 | int ret = 0; |
| 591 | 637 | ||
| 638 | if (!dev_priv->enable_fb) { | ||
| 639 | ret = vmw_3d_resource_inc(dev_priv); | ||
| 640 | if (unlikely(ret != 0)) | ||
| 641 | return ret; | ||
| 642 | vmw_kms_save_vga(dev_priv); | ||
| 643 | mutex_lock(&dev_priv->hw_mutex); | ||
| 644 | vmw_write(dev_priv, SVGA_REG_TRACES, 0); | ||
| 645 | mutex_unlock(&dev_priv->hw_mutex); | ||
| 646 | } | ||
| 647 | |||
| 592 | if (active) { | 648 | if (active) { |
| 593 | BUG_ON(active != &dev_priv->fbdev_master); | 649 | BUG_ON(active != &dev_priv->fbdev_master); |
| 594 | ret = ttm_vt_lock(&active->lock, false, vmw_fp->tfile); | 650 | ret = ttm_vt_lock(&active->lock, false, vmw_fp->tfile); |
| @@ -617,7 +673,13 @@ static int vmw_master_set(struct drm_device *dev, | |||
| 617 | return 0; | 673 | return 0; |
| 618 | 674 | ||
| 619 | out_no_active_lock: | 675 | out_no_active_lock: |
| 620 | vmw_release_device(dev_priv); | 676 | if (!dev_priv->enable_fb) { |
| 677 | mutex_lock(&dev_priv->hw_mutex); | ||
| 678 | vmw_write(dev_priv, SVGA_REG_TRACES, 1); | ||
| 679 | mutex_unlock(&dev_priv->hw_mutex); | ||
| 680 | vmw_kms_restore_vga(dev_priv); | ||
| 681 | vmw_3d_resource_dec(dev_priv); | ||
| 682 | } | ||
| 621 | return ret; | 683 | return ret; |
| 622 | } | 684 | } |
| 623 | 685 | ||
| @@ -645,11 +707,23 @@ static void vmw_master_drop(struct drm_device *dev, | |||
| 645 | 707 | ||
| 646 | ttm_lock_set_kill(&vmaster->lock, true, SIGTERM); | 708 | ttm_lock_set_kill(&vmaster->lock, true, SIGTERM); |
| 647 | 709 | ||
| 710 | if (!dev_priv->enable_fb) { | ||
| 711 | ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM); | ||
| 712 | if (unlikely(ret != 0)) | ||
| 713 | DRM_ERROR("Unable to clean VRAM on master drop.\n"); | ||
| 714 | mutex_lock(&dev_priv->hw_mutex); | ||
| 715 | vmw_write(dev_priv, SVGA_REG_TRACES, 1); | ||
| 716 | mutex_unlock(&dev_priv->hw_mutex); | ||
| 717 | vmw_kms_restore_vga(dev_priv); | ||
| 718 | vmw_3d_resource_dec(dev_priv); | ||
| 719 | } | ||
| 720 | |||
| 648 | dev_priv->active_master = &dev_priv->fbdev_master; | 721 | dev_priv->active_master = &dev_priv->fbdev_master; |
| 649 | ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM); | 722 | ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM); |
| 650 | ttm_vt_unlock(&dev_priv->fbdev_master.lock); | 723 | ttm_vt_unlock(&dev_priv->fbdev_master.lock); |
| 651 | 724 | ||
| 652 | vmw_fb_on(dev_priv); | 725 | if (dev_priv->enable_fb) |
| 726 | vmw_fb_on(dev_priv); | ||
| 653 | } | 727 | } |
| 654 | 728 | ||
| 655 | 729 | ||
| @@ -722,6 +796,7 @@ static struct drm_driver driver = { | |||
| 722 | .irq_postinstall = vmw_irq_postinstall, | 796 | .irq_postinstall = vmw_irq_postinstall, |
| 723 | .irq_uninstall = vmw_irq_uninstall, | 797 | .irq_uninstall = vmw_irq_uninstall, |
| 724 | .irq_handler = vmw_irq_handler, | 798 | .irq_handler = vmw_irq_handler, |
| 799 | .get_vblank_counter = vmw_get_vblank_counter, | ||
| 725 | .reclaim_buffers_locked = NULL, | 800 | .reclaim_buffers_locked = NULL, |
| 726 | .get_map_ofs = drm_core_get_map_ofs, | 801 | .get_map_ofs = drm_core_get_map_ofs, |
| 727 | .get_reg_ofs = drm_core_get_reg_ofs, | 802 | .get_reg_ofs = drm_core_get_reg_ofs, |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 429f917b60bf..58de6393f611 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | |||
| @@ -277,6 +277,7 @@ struct vmw_private { | |||
| 277 | 277 | ||
| 278 | bool stealth; | 278 | bool stealth; |
| 279 | bool is_opened; | 279 | bool is_opened; |
| 280 | bool enable_fb; | ||
| 280 | 281 | ||
| 281 | /** | 282 | /** |
| 282 | * Master management. | 283 | * Master management. |
| @@ -285,6 +286,9 @@ struct vmw_private { | |||
| 285 | struct vmw_master *active_master; | 286 | struct vmw_master *active_master; |
| 286 | struct vmw_master fbdev_master; | 287 | struct vmw_master fbdev_master; |
| 287 | struct notifier_block pm_nb; | 288 | struct notifier_block pm_nb; |
| 289 | |||
| 290 | struct mutex release_mutex; | ||
| 291 | uint32_t num_3d_resources; | ||
| 288 | }; | 292 | }; |
| 289 | 293 | ||
| 290 | static inline struct vmw_private *vmw_priv(struct drm_device *dev) | 294 | static inline struct vmw_private *vmw_priv(struct drm_device *dev) |
| @@ -319,6 +323,9 @@ static inline uint32_t vmw_read(struct vmw_private *dev_priv, | |||
| 319 | return val; | 323 | return val; |
| 320 | } | 324 | } |
| 321 | 325 | ||
| 326 | int vmw_3d_resource_inc(struct vmw_private *dev_priv); | ||
| 327 | void vmw_3d_resource_dec(struct vmw_private *dev_priv); | ||
| 328 | |||
| 322 | /** | 329 | /** |
| 323 | * GMR utilities - vmwgfx_gmr.c | 330 | * GMR utilities - vmwgfx_gmr.c |
| 324 | */ | 331 | */ |
| @@ -511,6 +518,7 @@ void vmw_kms_write_svga(struct vmw_private *vmw_priv, | |||
| 511 | unsigned bbp, unsigned depth); | 518 | unsigned bbp, unsigned depth); |
| 512 | int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, | 519 | int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, |
| 513 | struct drm_file *file_priv); | 520 | struct drm_file *file_priv); |
| 521 | u32 vmw_get_vblank_counter(struct drm_device *dev, int crtc); | ||
| 514 | 522 | ||
| 515 | /** | 523 | /** |
| 516 | * Overlay control - vmwgfx_overlay.c | 524 | * Overlay control - vmwgfx_overlay.c |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index 870967a97c15..409e172f4abf 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | |||
| @@ -615,6 +615,11 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private *vmw_priv, | |||
| 615 | if (unlikely(ret != 0)) | 615 | if (unlikely(ret != 0)) |
| 616 | goto err_unlock; | 616 | goto err_unlock; |
| 617 | 617 | ||
| 618 | if (bo->mem.mem_type == TTM_PL_VRAM && | ||
| 619 | bo->mem.mm_node->start < bo->num_pages) | ||
| 620 | (void) ttm_bo_validate(bo, &vmw_sys_placement, false, | ||
| 621 | false, false); | ||
| 622 | |||
| 618 | ret = ttm_bo_validate(bo, &ne_placement, false, false, false); | 623 | ret = ttm_bo_validate(bo, &ne_placement, false, false, false); |
| 619 | 624 | ||
| 620 | /* Could probably bug on */ | 625 | /* Could probably bug on */ |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c index e6a1eb7ea954..0fe31766e4cf 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | |||
| @@ -106,6 +106,7 @@ int vmw_fifo_init(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo) | |||
| 106 | mutex_lock(&dev_priv->hw_mutex); | 106 | mutex_lock(&dev_priv->hw_mutex); |
| 107 | dev_priv->enable_state = vmw_read(dev_priv, SVGA_REG_ENABLE); | 107 | dev_priv->enable_state = vmw_read(dev_priv, SVGA_REG_ENABLE); |
| 108 | dev_priv->config_done_state = vmw_read(dev_priv, SVGA_REG_CONFIG_DONE); | 108 | dev_priv->config_done_state = vmw_read(dev_priv, SVGA_REG_CONFIG_DONE); |
| 109 | dev_priv->traces_state = vmw_read(dev_priv, SVGA_REG_TRACES); | ||
| 109 | vmw_write(dev_priv, SVGA_REG_ENABLE, 1); | 110 | vmw_write(dev_priv, SVGA_REG_ENABLE, 1); |
| 110 | 111 | ||
| 111 | min = 4; | 112 | min = 4; |
| @@ -175,6 +176,8 @@ void vmw_fifo_release(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo) | |||
| 175 | dev_priv->config_done_state); | 176 | dev_priv->config_done_state); |
| 176 | vmw_write(dev_priv, SVGA_REG_ENABLE, | 177 | vmw_write(dev_priv, SVGA_REG_ENABLE, |
| 177 | dev_priv->enable_state); | 178 | dev_priv->enable_state); |
| 179 | vmw_write(dev_priv, SVGA_REG_TRACES, | ||
| 180 | dev_priv->traces_state); | ||
| 178 | 181 | ||
| 179 | mutex_unlock(&dev_priv->hw_mutex); | 182 | mutex_unlock(&dev_priv->hw_mutex); |
| 180 | vmw_fence_queue_takedown(&fifo->fence_queue); | 183 | vmw_fence_queue_takedown(&fifo->fence_queue); |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 64d7f47df868..e882ba099f0c 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |||
| @@ -898,7 +898,19 @@ int vmw_kms_save_vga(struct vmw_private *vmw_priv) | |||
| 898 | save->width = vmw_read(vmw_priv, SVGA_REG_DISPLAY_WIDTH); | 898 | save->width = vmw_read(vmw_priv, SVGA_REG_DISPLAY_WIDTH); |
| 899 | save->height = vmw_read(vmw_priv, SVGA_REG_DISPLAY_HEIGHT); | 899 | save->height = vmw_read(vmw_priv, SVGA_REG_DISPLAY_HEIGHT); |
| 900 | vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID); | 900 | vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID); |
| 901 | if (i == 0 && vmw_priv->num_displays == 1 && | ||
| 902 | save->width == 0 && save->height == 0) { | ||
| 903 | |||
| 904 | /* | ||
| 905 | * It should be fairly safe to assume that these | ||
| 906 | * values are uninitialized. | ||
| 907 | */ | ||
| 908 | |||
| 909 | save->width = vmw_priv->vga_width - save->pos_x; | ||
| 910 | save->height = vmw_priv->vga_height - save->pos_y; | ||
| 911 | } | ||
| 901 | } | 912 | } |
| 913 | |||
| 902 | return 0; | 914 | return 0; |
| 903 | } | 915 | } |
| 904 | 916 | ||
| @@ -984,3 +996,8 @@ out_unlock: | |||
| 984 | ttm_read_unlock(&vmaster->lock); | 996 | ttm_read_unlock(&vmaster->lock); |
| 985 | return ret; | 997 | return ret; |
| 986 | } | 998 | } |
| 999 | |||
| 1000 | u32 vmw_get_vblank_counter(struct drm_device *dev, int crtc) | ||
| 1001 | { | ||
| 1002 | return 0; | ||
| 1003 | } | ||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index 2ff5cf78235f..11cb39e3accb 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | |||
| @@ -27,6 +27,8 @@ | |||
| 27 | 27 | ||
| 28 | #include "vmwgfx_kms.h" | 28 | #include "vmwgfx_kms.h" |
| 29 | 29 | ||
| 30 | #define VMWGFX_LDU_NUM_DU 8 | ||
| 31 | |||
| 30 | #define vmw_crtc_to_ldu(x) \ | 32 | #define vmw_crtc_to_ldu(x) \ |
| 31 | container_of(x, struct vmw_legacy_display_unit, base.crtc) | 33 | container_of(x, struct vmw_legacy_display_unit, base.crtc) |
| 32 | #define vmw_encoder_to_ldu(x) \ | 34 | #define vmw_encoder_to_ldu(x) \ |
| @@ -335,7 +337,8 @@ static void vmw_ldu_connector_restore(struct drm_connector *connector) | |||
| 335 | } | 337 | } |
| 336 | 338 | ||
| 337 | static enum drm_connector_status | 339 | static enum drm_connector_status |
| 338 | vmw_ldu_connector_detect(struct drm_connector *connector) | 340 | vmw_ldu_connector_detect(struct drm_connector *connector, |
| 341 | bool force) | ||
| 339 | { | 342 | { |
| 340 | if (vmw_connector_to_ldu(connector)->pref_active) | 343 | if (vmw_connector_to_ldu(connector)->pref_active) |
| 341 | return connector_status_connected; | 344 | return connector_status_connected; |
| @@ -516,7 +519,7 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit) | |||
| 516 | 519 | ||
| 517 | drm_connector_init(dev, connector, &vmw_legacy_connector_funcs, | 520 | drm_connector_init(dev, connector, &vmw_legacy_connector_funcs, |
| 518 | DRM_MODE_CONNECTOR_LVDS); | 521 | DRM_MODE_CONNECTOR_LVDS); |
| 519 | connector->status = vmw_ldu_connector_detect(connector); | 522 | connector->status = vmw_ldu_connector_detect(connector, true); |
| 520 | 523 | ||
| 521 | drm_encoder_init(dev, encoder, &vmw_legacy_encoder_funcs, | 524 | drm_encoder_init(dev, encoder, &vmw_legacy_encoder_funcs, |
| 522 | DRM_MODE_ENCODER_LVDS); | 525 | DRM_MODE_ENCODER_LVDS); |
| @@ -535,6 +538,10 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit) | |||
| 535 | 538 | ||
| 536 | int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv) | 539 | int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv) |
| 537 | { | 540 | { |
| 541 | struct drm_device *dev = dev_priv->dev; | ||
| 542 | int i; | ||
| 543 | int ret; | ||
| 544 | |||
| 538 | if (dev_priv->ldu_priv) { | 545 | if (dev_priv->ldu_priv) { |
| 539 | DRM_INFO("ldu system already on\n"); | 546 | DRM_INFO("ldu system already on\n"); |
| 540 | return -EINVAL; | 547 | return -EINVAL; |
| @@ -552,23 +559,24 @@ int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv) | |||
| 552 | 559 | ||
| 553 | drm_mode_create_dirty_info_property(dev_priv->dev); | 560 | drm_mode_create_dirty_info_property(dev_priv->dev); |
| 554 | 561 | ||
| 555 | vmw_ldu_init(dev_priv, 0); | ||
| 556 | /* for old hardware without multimon only enable one display */ | ||
| 557 | if (dev_priv->capabilities & SVGA_CAP_MULTIMON) { | 562 | if (dev_priv->capabilities & SVGA_CAP_MULTIMON) { |
| 558 | vmw_ldu_init(dev_priv, 1); | 563 | for (i = 0; i < VMWGFX_LDU_NUM_DU; ++i) |
| 559 | vmw_ldu_init(dev_priv, 2); | 564 | vmw_ldu_init(dev_priv, i); |
| 560 | vmw_ldu_init(dev_priv, 3); | 565 | ret = drm_vblank_init(dev, VMWGFX_LDU_NUM_DU); |
| 561 | vmw_ldu_init(dev_priv, 4); | 566 | } else { |
| 562 | vmw_ldu_init(dev_priv, 5); | 567 | /* for old hardware without multimon only enable one display */ |
| 563 | vmw_ldu_init(dev_priv, 6); | 568 | vmw_ldu_init(dev_priv, 0); |
| 564 | vmw_ldu_init(dev_priv, 7); | 569 | ret = drm_vblank_init(dev, 1); |
| 565 | } | 570 | } |
| 566 | 571 | ||
| 567 | return 0; | 572 | return ret; |
| 568 | } | 573 | } |
| 569 | 574 | ||
| 570 | int vmw_kms_close_legacy_display_system(struct vmw_private *dev_priv) | 575 | int vmw_kms_close_legacy_display_system(struct vmw_private *dev_priv) |
| 571 | { | 576 | { |
| 577 | struct drm_device *dev = dev_priv->dev; | ||
| 578 | |||
| 579 | drm_vblank_cleanup(dev); | ||
| 572 | if (!dev_priv->ldu_priv) | 580 | if (!dev_priv->ldu_priv) |
| 573 | return -ENOSYS; | 581 | return -ENOSYS; |
| 574 | 582 | ||
| @@ -610,7 +618,7 @@ int vmw_kms_ldu_update_layout(struct vmw_private *dev_priv, unsigned num, | |||
| 610 | ldu->pref_height = 600; | 618 | ldu->pref_height = 600; |
| 611 | ldu->pref_active = false; | 619 | ldu->pref_active = false; |
| 612 | } | 620 | } |
| 613 | con->status = vmw_ldu_connector_detect(con); | 621 | con->status = vmw_ldu_connector_detect(con, true); |
| 614 | } | 622 | } |
| 615 | 623 | ||
| 616 | mutex_unlock(&dev->mode_config.mutex); | 624 | mutex_unlock(&dev->mode_config.mutex); |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c index 5f2d5df01e5c..c8c40e9979db 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | |||
| @@ -211,6 +211,7 @@ static void vmw_hw_context_destroy(struct vmw_resource *res) | |||
| 211 | cmd->body.cid = cpu_to_le32(res->id); | 211 | cmd->body.cid = cpu_to_le32(res->id); |
| 212 | 212 | ||
| 213 | vmw_fifo_commit(dev_priv, sizeof(*cmd)); | 213 | vmw_fifo_commit(dev_priv, sizeof(*cmd)); |
| 214 | vmw_3d_resource_dec(dev_priv); | ||
| 214 | } | 215 | } |
| 215 | 216 | ||
| 216 | static int vmw_context_init(struct vmw_private *dev_priv, | 217 | static int vmw_context_init(struct vmw_private *dev_priv, |
| @@ -247,6 +248,7 @@ static int vmw_context_init(struct vmw_private *dev_priv, | |||
| 247 | cmd->body.cid = cpu_to_le32(res->id); | 248 | cmd->body.cid = cpu_to_le32(res->id); |
| 248 | 249 | ||
| 249 | vmw_fifo_commit(dev_priv, sizeof(*cmd)); | 250 | vmw_fifo_commit(dev_priv, sizeof(*cmd)); |
| 251 | (void) vmw_3d_resource_inc(dev_priv); | ||
| 250 | vmw_resource_activate(res, vmw_hw_context_destroy); | 252 | vmw_resource_activate(res, vmw_hw_context_destroy); |
| 251 | return 0; | 253 | return 0; |
| 252 | } | 254 | } |
| @@ -406,6 +408,7 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res) | |||
| 406 | cmd->body.sid = cpu_to_le32(res->id); | 408 | cmd->body.sid = cpu_to_le32(res->id); |
| 407 | 409 | ||
| 408 | vmw_fifo_commit(dev_priv, sizeof(*cmd)); | 410 | vmw_fifo_commit(dev_priv, sizeof(*cmd)); |
| 411 | vmw_3d_resource_dec(dev_priv); | ||
| 409 | } | 412 | } |
| 410 | 413 | ||
| 411 | void vmw_surface_res_free(struct vmw_resource *res) | 414 | void vmw_surface_res_free(struct vmw_resource *res) |
| @@ -473,6 +476,7 @@ int vmw_surface_init(struct vmw_private *dev_priv, | |||
| 473 | } | 476 | } |
| 474 | 477 | ||
| 475 | vmw_fifo_commit(dev_priv, submit_size); | 478 | vmw_fifo_commit(dev_priv, submit_size); |
| 479 | (void) vmw_3d_resource_inc(dev_priv); | ||
| 476 | vmw_resource_activate(res, vmw_hw_surface_destroy); | 480 | vmw_resource_activate(res, vmw_hw_surface_destroy); |
| 477 | return 0; | 481 | return 0; |
| 478 | } | 482 | } |
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index b87569e96b16..f366f968155a 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c | |||
| @@ -598,7 +598,7 @@ static inline void vga_update_device_decodes(struct vga_device *vgadev, | |||
| 598 | pr_debug("vgaarb: decoding count now is: %d\n", vga_decode_count); | 598 | pr_debug("vgaarb: decoding count now is: %d\n", vga_decode_count); |
| 599 | } | 599 | } |
| 600 | 600 | ||
| 601 | void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace) | 601 | static void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace) |
| 602 | { | 602 | { |
| 603 | struct vga_device *vgadev; | 603 | struct vga_device *vgadev; |
| 604 | unsigned long flags; | 604 | unsigned long flags; |
diff --git a/drivers/hid/hid-cando.c b/drivers/hid/hid-cando.c index 4267a6fdc277..5925bdcd417d 100644 --- a/drivers/hid/hid-cando.c +++ b/drivers/hid/hid-cando.c | |||
| @@ -237,6 +237,8 @@ static const struct hid_device_id cando_devices[] = { | |||
| 237 | USB_DEVICE_ID_CANDO_MULTI_TOUCH) }, | 237 | USB_DEVICE_ID_CANDO_MULTI_TOUCH) }, |
| 238 | { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, | 238 | { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, |
| 239 | USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) }, | 239 | USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) }, |
| 240 | { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, | ||
| 241 | USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) }, | ||
| 240 | { } | 242 | { } |
| 241 | }; | 243 | }; |
| 242 | MODULE_DEVICE_TABLE(hid, cando_devices); | 244 | MODULE_DEVICE_TABLE(hid, cando_devices); |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 3f7292486024..a0dea3d1296e 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
| @@ -1292,6 +1292,7 @@ static const struct hid_device_id hid_blacklist[] = { | |||
| 1292 | { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE_2) }, | 1292 | { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE_2) }, |
| 1293 | { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH) }, | 1293 | { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH) }, |
| 1294 | { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) }, | 1294 | { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) }, |
| 1295 | { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) }, | ||
| 1295 | { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) }, | 1296 | { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) }, |
| 1296 | { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR) }, | 1297 | { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR) }, |
| 1297 | { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) }, | 1298 | { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 765a4f53eb5c..c5ae5f1545bd 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
| @@ -134,6 +134,7 @@ | |||
| 134 | #define USB_VENDOR_ID_CANDO 0x2087 | 134 | #define USB_VENDOR_ID_CANDO 0x2087 |
| 135 | #define USB_DEVICE_ID_CANDO_MULTI_TOUCH 0x0a01 | 135 | #define USB_DEVICE_ID_CANDO_MULTI_TOUCH 0x0a01 |
| 136 | #define USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6 0x0b03 | 136 | #define USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6 0x0b03 |
| 137 | #define USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6 0x0f01 | ||
| 137 | 138 | ||
| 138 | #define USB_VENDOR_ID_CH 0x068e | 139 | #define USB_VENDOR_ID_CH 0x068e |
| 139 | #define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2 | 140 | #define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2 |
| @@ -503,6 +504,7 @@ | |||
| 503 | 504 | ||
| 504 | #define USB_VENDOR_ID_TURBOX 0x062a | 505 | #define USB_VENDOR_ID_TURBOX 0x062a |
| 505 | #define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201 | 506 | #define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201 |
| 507 | #define USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART 0x7100 | ||
| 506 | 508 | ||
| 507 | #define USB_VENDOR_ID_TWINHAN 0x6253 | 509 | #define USB_VENDOR_ID_TWINHAN 0x6253 |
| 508 | #define USB_DEVICE_ID_TWINHAN_IR_REMOTE 0x0100 | 510 | #define USB_DEVICE_ID_TWINHAN_IR_REMOTE 0x0100 |
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index 47d70c523d93..a3866b5c0c43 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c | |||
| @@ -109,6 +109,12 @@ static ssize_t hidraw_write(struct file *file, const char __user *buffer, size_t | |||
| 109 | int ret = 0; | 109 | int ret = 0; |
| 110 | 110 | ||
| 111 | mutex_lock(&minors_lock); | 111 | mutex_lock(&minors_lock); |
| 112 | |||
| 113 | if (!hidraw_table[minor]) { | ||
| 114 | ret = -ENODEV; | ||
| 115 | goto out; | ||
| 116 | } | ||
| 117 | |||
| 112 | dev = hidraw_table[minor]->hid; | 118 | dev = hidraw_table[minor]->hid; |
| 113 | 119 | ||
| 114 | if (!dev->hid_output_raw_report) { | 120 | if (!dev->hid_output_raw_report) { |
| @@ -244,6 +250,10 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd, | |||
| 244 | 250 | ||
| 245 | mutex_lock(&minors_lock); | 251 | mutex_lock(&minors_lock); |
| 246 | dev = hidraw_table[minor]; | 252 | dev = hidraw_table[minor]; |
| 253 | if (!dev) { | ||
| 254 | ret = -ENODEV; | ||
| 255 | goto out; | ||
| 256 | } | ||
| 247 | 257 | ||
| 248 | switch (cmd) { | 258 | switch (cmd) { |
| 249 | case HIDIOCGRDESCSIZE: | 259 | case HIDIOCGRDESCSIZE: |
| @@ -317,6 +327,7 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd, | |||
| 317 | 327 | ||
| 318 | ret = -ENOTTY; | 328 | ret = -ENOTTY; |
| 319 | } | 329 | } |
| 330 | out: | ||
| 320 | mutex_unlock(&minors_lock); | 331 | mutex_unlock(&minors_lock); |
| 321 | return ret; | 332 | return ret; |
| 322 | } | 333 | } |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 70da3181c8a0..f0260c699adb 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
| @@ -36,6 +36,7 @@ static const struct hid_blacklist { | |||
| 36 | { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET }, | 36 | { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET }, |
| 37 | { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH, HID_QUIRK_MULTI_INPUT }, | 37 | { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH, HID_QUIRK_MULTI_INPUT }, |
| 38 | { USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER, HID_QUIRK_MULTI_INPUT }, | 38 | { USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER, HID_QUIRK_MULTI_INPUT }, |
| 39 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART, HID_QUIRK_MULTI_INPUT }, | ||
| 39 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 40 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
| 40 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 41 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
| 41 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 42 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 4d4d09bdec0a..97499d00615a 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
| @@ -409,7 +409,7 @@ config SENSORS_CORETEMP | |||
| 409 | 409 | ||
| 410 | config SENSORS_PKGTEMP | 410 | config SENSORS_PKGTEMP |
| 411 | tristate "Intel processor package temperature sensor" | 411 | tristate "Intel processor package temperature sensor" |
| 412 | depends on X86 && PCI && EXPERIMENTAL | 412 | depends on X86 && EXPERIMENTAL |
| 413 | help | 413 | help |
| 414 | If you say yes here you get support for the package level temperature | 414 | If you say yes here you get support for the package level temperature |
| 415 | sensor inside your CPU. Check documentation/driver for details. | 415 | sensor inside your CPU. Check documentation/driver for details. |
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c index 15c1a9616af3..0683e6be662c 100644 --- a/drivers/hwmon/adm1031.c +++ b/drivers/hwmon/adm1031.c | |||
| @@ -79,7 +79,7 @@ struct adm1031_data { | |||
| 79 | int chip_type; | 79 | int chip_type; |
| 80 | char valid; /* !=0 if following fields are valid */ | 80 | char valid; /* !=0 if following fields are valid */ |
| 81 | unsigned long last_updated; /* In jiffies */ | 81 | unsigned long last_updated; /* In jiffies */ |
| 82 | unsigned int update_rate; /* In milliseconds */ | 82 | unsigned int update_interval; /* In milliseconds */ |
| 83 | /* The chan_select_table contains the possible configurations for | 83 | /* The chan_select_table contains the possible configurations for |
| 84 | * auto fan control. | 84 | * auto fan control. |
| 85 | */ | 85 | */ |
| @@ -743,23 +743,23 @@ static SENSOR_DEVICE_ATTR(temp3_crit_alarm, S_IRUGO, show_alarm, NULL, 12); | |||
| 743 | static SENSOR_DEVICE_ATTR(temp3_fault, S_IRUGO, show_alarm, NULL, 13); | 743 | static SENSOR_DEVICE_ATTR(temp3_fault, S_IRUGO, show_alarm, NULL, 13); |
| 744 | static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL, 14); | 744 | static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL, 14); |
| 745 | 745 | ||
| 746 | /* Update Rate */ | 746 | /* Update Interval */ |
| 747 | static const unsigned int update_rates[] = { | 747 | static const unsigned int update_intervals[] = { |
| 748 | 16000, 8000, 4000, 2000, 1000, 500, 250, 125, | 748 | 16000, 8000, 4000, 2000, 1000, 500, 250, 125, |
| 749 | }; | 749 | }; |
| 750 | 750 | ||
| 751 | static ssize_t show_update_rate(struct device *dev, | 751 | static ssize_t show_update_interval(struct device *dev, |
| 752 | struct device_attribute *attr, char *buf) | 752 | struct device_attribute *attr, char *buf) |
| 753 | { | 753 | { |
| 754 | struct i2c_client *client = to_i2c_client(dev); | 754 | struct i2c_client *client = to_i2c_client(dev); |
| 755 | struct adm1031_data *data = i2c_get_clientdata(client); | 755 | struct adm1031_data *data = i2c_get_clientdata(client); |
| 756 | 756 | ||
| 757 | return sprintf(buf, "%u\n", data->update_rate); | 757 | return sprintf(buf, "%u\n", data->update_interval); |
| 758 | } | 758 | } |
| 759 | 759 | ||
| 760 | static ssize_t set_update_rate(struct device *dev, | 760 | static ssize_t set_update_interval(struct device *dev, |
| 761 | struct device_attribute *attr, | 761 | struct device_attribute *attr, |
| 762 | const char *buf, size_t count) | 762 | const char *buf, size_t count) |
| 763 | { | 763 | { |
| 764 | struct i2c_client *client = to_i2c_client(dev); | 764 | struct i2c_client *client = to_i2c_client(dev); |
| 765 | struct adm1031_data *data = i2c_get_clientdata(client); | 765 | struct adm1031_data *data = i2c_get_clientdata(client); |
| @@ -771,12 +771,15 @@ static ssize_t set_update_rate(struct device *dev, | |||
| 771 | if (err) | 771 | if (err) |
| 772 | return err; | 772 | return err; |
| 773 | 773 | ||
| 774 | /* find the nearest update rate from the table */ | 774 | /* |
| 775 | for (i = 0; i < ARRAY_SIZE(update_rates) - 1; i++) { | 775 | * Find the nearest update interval from the table. |
| 776 | if (val >= update_rates[i]) | 776 | * Use it to determine the matching update rate. |
| 777 | */ | ||
| 778 | for (i = 0; i < ARRAY_SIZE(update_intervals) - 1; i++) { | ||
| 779 | if (val >= update_intervals[i]) | ||
| 777 | break; | 780 | break; |
| 778 | } | 781 | } |
| 779 | /* if not found, we point to the last entry (lowest update rate) */ | 782 | /* if not found, we point to the last entry (lowest update interval) */ |
| 780 | 783 | ||
| 781 | /* set the new update rate while preserving other settings */ | 784 | /* set the new update rate while preserving other settings */ |
| 782 | reg = adm1031_read_value(client, ADM1031_REG_FAN_FILTER); | 785 | reg = adm1031_read_value(client, ADM1031_REG_FAN_FILTER); |
| @@ -785,14 +788,14 @@ static ssize_t set_update_rate(struct device *dev, | |||
| 785 | adm1031_write_value(client, ADM1031_REG_FAN_FILTER, reg); | 788 | adm1031_write_value(client, ADM1031_REG_FAN_FILTER, reg); |
| 786 | 789 | ||
| 787 | mutex_lock(&data->update_lock); | 790 | mutex_lock(&data->update_lock); |
| 788 | data->update_rate = update_rates[i]; | 791 | data->update_interval = update_intervals[i]; |
| 789 | mutex_unlock(&data->update_lock); | 792 | mutex_unlock(&data->update_lock); |
| 790 | 793 | ||
| 791 | return count; | 794 | return count; |
| 792 | } | 795 | } |
| 793 | 796 | ||
| 794 | static DEVICE_ATTR(update_rate, S_IRUGO | S_IWUSR, show_update_rate, | 797 | static DEVICE_ATTR(update_interval, S_IRUGO | S_IWUSR, show_update_interval, |
| 795 | set_update_rate); | 798 | set_update_interval); |
| 796 | 799 | ||
| 797 | static struct attribute *adm1031_attributes[] = { | 800 | static struct attribute *adm1031_attributes[] = { |
| 798 | &sensor_dev_attr_fan1_input.dev_attr.attr, | 801 | &sensor_dev_attr_fan1_input.dev_attr.attr, |
| @@ -830,7 +833,7 @@ static struct attribute *adm1031_attributes[] = { | |||
| 830 | 833 | ||
| 831 | &sensor_dev_attr_auto_fan1_min_pwm.dev_attr.attr, | 834 | &sensor_dev_attr_auto_fan1_min_pwm.dev_attr.attr, |
| 832 | 835 | ||
| 833 | &dev_attr_update_rate.attr, | 836 | &dev_attr_update_interval.attr, |
| 834 | &dev_attr_alarms.attr, | 837 | &dev_attr_alarms.attr, |
| 835 | 838 | ||
| 836 | NULL | 839 | NULL |
| @@ -981,7 +984,8 @@ static void adm1031_init_client(struct i2c_client *client) | |||
| 981 | mask = ADM1031_UPDATE_RATE_MASK; | 984 | mask = ADM1031_UPDATE_RATE_MASK; |
| 982 | read_val = adm1031_read_value(client, ADM1031_REG_FAN_FILTER); | 985 | read_val = adm1031_read_value(client, ADM1031_REG_FAN_FILTER); |
| 983 | i = (read_val & mask) >> ADM1031_UPDATE_RATE_SHIFT; | 986 | i = (read_val & mask) >> ADM1031_UPDATE_RATE_SHIFT; |
| 984 | data->update_rate = update_rates[i]; | 987 | /* Save it as update interval */ |
| 988 | data->update_interval = update_intervals[i]; | ||
| 985 | } | 989 | } |
| 986 | 990 | ||
| 987 | static struct adm1031_data *adm1031_update_device(struct device *dev) | 991 | static struct adm1031_data *adm1031_update_device(struct device *dev) |
| @@ -993,7 +997,8 @@ static struct adm1031_data *adm1031_update_device(struct device *dev) | |||
| 993 | 997 | ||
| 994 | mutex_lock(&data->update_lock); | 998 | mutex_lock(&data->update_lock); |
| 995 | 999 | ||
| 996 | next_update = data->last_updated + msecs_to_jiffies(data->update_rate); | 1000 | next_update = data->last_updated |
| 1001 | + msecs_to_jiffies(data->update_interval); | ||
| 997 | if (time_after(jiffies, next_update) || !data->valid) { | 1002 | if (time_after(jiffies, next_update) || !data->valid) { |
| 998 | 1003 | ||
| 999 | dev_dbg(&client->dev, "Starting adm1031 update\n"); | 1004 | dev_dbg(&client->dev, "Starting adm1031 update\n"); |
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index de8111114f46..a23b17a78ace 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/pci.h> | 36 | #include <linux/pci.h> |
| 37 | #include <asm/msr.h> | 37 | #include <asm/msr.h> |
| 38 | #include <asm/processor.h> | 38 | #include <asm/processor.h> |
| 39 | #include <asm/smp.h> | ||
| 39 | 40 | ||
| 40 | #define DRVNAME "coretemp" | 41 | #define DRVNAME "coretemp" |
| 41 | 42 | ||
| @@ -423,9 +424,18 @@ static int __cpuinit coretemp_device_add(unsigned int cpu) | |||
| 423 | int err; | 424 | int err; |
| 424 | struct platform_device *pdev; | 425 | struct platform_device *pdev; |
| 425 | struct pdev_entry *pdev_entry; | 426 | struct pdev_entry *pdev_entry; |
| 426 | #ifdef CONFIG_SMP | ||
| 427 | struct cpuinfo_x86 *c = &cpu_data(cpu); | 427 | struct cpuinfo_x86 *c = &cpu_data(cpu); |
| 428 | #endif | 428 | |
| 429 | /* | ||
| 430 | * CPUID.06H.EAX[0] indicates whether the CPU has thermal | ||
| 431 | * sensors. We check this bit only, all the early CPUs | ||
| 432 | * without thermal sensors will be filtered out. | ||
| 433 | */ | ||
| 434 | if (!cpu_has(c, X86_FEATURE_DTS)) { | ||
| 435 | printk(KERN_INFO DRVNAME ": CPU (model=0x%x)" | ||
| 436 | " has no thermal sensor.\n", c->x86_model); | ||
| 437 | return 0; | ||
| 438 | } | ||
| 429 | 439 | ||
| 430 | mutex_lock(&pdev_list_mutex); | 440 | mutex_lock(&pdev_list_mutex); |
| 431 | 441 | ||
| @@ -482,14 +492,22 @@ exit: | |||
| 482 | 492 | ||
| 483 | static void coretemp_device_remove(unsigned int cpu) | 493 | static void coretemp_device_remove(unsigned int cpu) |
| 484 | { | 494 | { |
| 485 | struct pdev_entry *p, *n; | 495 | struct pdev_entry *p; |
| 496 | unsigned int i; | ||
| 497 | |||
| 486 | mutex_lock(&pdev_list_mutex); | 498 | mutex_lock(&pdev_list_mutex); |
| 487 | list_for_each_entry_safe(p, n, &pdev_list, list) { | 499 | list_for_each_entry(p, &pdev_list, list) { |
| 488 | if (p->cpu == cpu) { | 500 | if (p->cpu != cpu) |
| 489 | platform_device_unregister(p->pdev); | 501 | continue; |
| 490 | list_del(&p->list); | 502 | |
| 491 | kfree(p); | 503 | platform_device_unregister(p->pdev); |
| 492 | } | 504 | list_del(&p->list); |
| 505 | mutex_unlock(&pdev_list_mutex); | ||
| 506 | kfree(p); | ||
| 507 | for_each_cpu(i, cpu_sibling_mask(cpu)) | ||
| 508 | if (i != cpu && !coretemp_device_add(i)) | ||
| 509 | break; | ||
| 510 | return; | ||
| 493 | } | 511 | } |
| 494 | mutex_unlock(&pdev_list_mutex); | 512 | mutex_unlock(&pdev_list_mutex); |
| 495 | } | 513 | } |
| @@ -527,30 +545,21 @@ static int __init coretemp_init(void) | |||
| 527 | if (err) | 545 | if (err) |
| 528 | goto exit; | 546 | goto exit; |
| 529 | 547 | ||
| 530 | for_each_online_cpu(i) { | 548 | for_each_online_cpu(i) |
| 531 | struct cpuinfo_x86 *c = &cpu_data(i); | 549 | coretemp_device_add(i); |
| 532 | /* | 550 | |
| 533 | * CPUID.06H.EAX[0] indicates whether the CPU has thermal | 551 | #ifndef CONFIG_HOTPLUG_CPU |
| 534 | * sensors. We check this bit only, all the early CPUs | ||
| 535 | * without thermal sensors will be filtered out. | ||
| 536 | */ | ||
| 537 | if (c->cpuid_level >= 6 && (cpuid_eax(0x06) & 0x01)) | ||
| 538 | coretemp_device_add(i); | ||
| 539 | else { | ||
| 540 | printk(KERN_INFO DRVNAME ": CPU (model=0x%x)" | ||
| 541 | " has no thermal sensor.\n", c->x86_model); | ||
| 542 | } | ||
| 543 | } | ||
| 544 | if (list_empty(&pdev_list)) { | 552 | if (list_empty(&pdev_list)) { |
| 545 | err = -ENODEV; | 553 | err = -ENODEV; |
| 546 | goto exit_driver_unreg; | 554 | goto exit_driver_unreg; |
| 547 | } | 555 | } |
| 556 | #endif | ||
| 548 | 557 | ||
| 549 | register_hotcpu_notifier(&coretemp_cpu_notifier); | 558 | register_hotcpu_notifier(&coretemp_cpu_notifier); |
| 550 | return 0; | 559 | return 0; |
| 551 | 560 | ||
| 552 | exit_driver_unreg: | ||
| 553 | #ifndef CONFIG_HOTPLUG_CPU | 561 | #ifndef CONFIG_HOTPLUG_CPU |
| 562 | exit_driver_unreg: | ||
| 554 | platform_driver_unregister(&coretemp_driver); | 563 | platform_driver_unregister(&coretemp_driver); |
| 555 | #endif | 564 | #endif |
| 556 | exit: | 565 | exit: |
diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c index 5b58b20dead1..8dee3f38fdfb 100644 --- a/drivers/hwmon/emc1403.c +++ b/drivers/hwmon/emc1403.c | |||
| @@ -308,7 +308,6 @@ static int emc1403_probe(struct i2c_client *client, | |||
| 308 | res = sysfs_create_group(&client->dev.kobj, &m_thermal_gr); | 308 | res = sysfs_create_group(&client->dev.kobj, &m_thermal_gr); |
| 309 | if (res) { | 309 | if (res) { |
| 310 | dev_warn(&client->dev, "create group failed\n"); | 310 | dev_warn(&client->dev, "create group failed\n"); |
| 311 | hwmon_device_unregister(data->hwmon_dev); | ||
| 312 | goto thermal_error1; | 311 | goto thermal_error1; |
| 313 | } | 312 | } |
| 314 | data->hwmon_dev = hwmon_device_register(&client->dev); | 313 | data->hwmon_dev = hwmon_device_register(&client->dev); |
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c index 537841ef44b9..75afb3b0e076 100644 --- a/drivers/hwmon/f71882fg.c +++ b/drivers/hwmon/f71882fg.c | |||
| @@ -111,7 +111,7 @@ static struct platform_device *f71882fg_pdev; | |||
| 111 | /* Super-I/O Function prototypes */ | 111 | /* Super-I/O Function prototypes */ |
| 112 | static inline int superio_inb(int base, int reg); | 112 | static inline int superio_inb(int base, int reg); |
| 113 | static inline int superio_inw(int base, int reg); | 113 | static inline int superio_inw(int base, int reg); |
| 114 | static inline void superio_enter(int base); | 114 | static inline int superio_enter(int base); |
| 115 | static inline void superio_select(int base, int ld); | 115 | static inline void superio_select(int base, int ld); |
| 116 | static inline void superio_exit(int base); | 116 | static inline void superio_exit(int base); |
| 117 | 117 | ||
| @@ -861,11 +861,20 @@ static int superio_inw(int base, int reg) | |||
| 861 | return val; | 861 | return val; |
| 862 | } | 862 | } |
| 863 | 863 | ||
| 864 | static inline void superio_enter(int base) | 864 | static inline int superio_enter(int base) |
| 865 | { | 865 | { |
| 866 | /* Don't step on other drivers' I/O space by accident */ | ||
| 867 | if (!request_muxed_region(base, 2, DRVNAME)) { | ||
| 868 | printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n", | ||
| 869 | base); | ||
| 870 | return -EBUSY; | ||
| 871 | } | ||
| 872 | |||
| 866 | /* according to the datasheet the key must be send twice! */ | 873 | /* according to the datasheet the key must be send twice! */ |
| 867 | outb(SIO_UNLOCK_KEY, base); | 874 | outb(SIO_UNLOCK_KEY, base); |
| 868 | outb(SIO_UNLOCK_KEY, base); | 875 | outb(SIO_UNLOCK_KEY, base); |
| 876 | |||
| 877 | return 0; | ||
| 869 | } | 878 | } |
| 870 | 879 | ||
| 871 | static inline void superio_select(int base, int ld) | 880 | static inline void superio_select(int base, int ld) |
| @@ -877,6 +886,7 @@ static inline void superio_select(int base, int ld) | |||
| 877 | static inline void superio_exit(int base) | 886 | static inline void superio_exit(int base) |
| 878 | { | 887 | { |
| 879 | outb(SIO_LOCK_KEY, base); | 888 | outb(SIO_LOCK_KEY, base); |
| 889 | release_region(base, 2); | ||
| 880 | } | 890 | } |
| 881 | 891 | ||
| 882 | static inline int fan_from_reg(u16 reg) | 892 | static inline int fan_from_reg(u16 reg) |
| @@ -2175,21 +2185,15 @@ static int f71882fg_remove(struct platform_device *pdev) | |||
| 2175 | static int __init f71882fg_find(int sioaddr, unsigned short *address, | 2185 | static int __init f71882fg_find(int sioaddr, unsigned short *address, |
| 2176 | struct f71882fg_sio_data *sio_data) | 2186 | struct f71882fg_sio_data *sio_data) |
| 2177 | { | 2187 | { |
| 2178 | int err = -ENODEV; | ||
| 2179 | u16 devid; | 2188 | u16 devid; |
| 2180 | 2189 | int err = superio_enter(sioaddr); | |
| 2181 | /* Don't step on other drivers' I/O space by accident */ | 2190 | if (err) |
| 2182 | if (!request_region(sioaddr, 2, DRVNAME)) { | 2191 | return err; |
| 2183 | printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n", | ||
| 2184 | (int)sioaddr); | ||
| 2185 | return -EBUSY; | ||
| 2186 | } | ||
| 2187 | |||
| 2188 | superio_enter(sioaddr); | ||
| 2189 | 2192 | ||
| 2190 | devid = superio_inw(sioaddr, SIO_REG_MANID); | 2193 | devid = superio_inw(sioaddr, SIO_REG_MANID); |
| 2191 | if (devid != SIO_FINTEK_ID) { | 2194 | if (devid != SIO_FINTEK_ID) { |
| 2192 | pr_debug(DRVNAME ": Not a Fintek device\n"); | 2195 | pr_debug(DRVNAME ": Not a Fintek device\n"); |
| 2196 | err = -ENODEV; | ||
| 2193 | goto exit; | 2197 | goto exit; |
| 2194 | } | 2198 | } |
| 2195 | 2199 | ||
| @@ -2213,6 +2217,7 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address, | |||
| 2213 | default: | 2217 | default: |
| 2214 | printk(KERN_INFO DRVNAME ": Unsupported Fintek device: %04x\n", | 2218 | printk(KERN_INFO DRVNAME ": Unsupported Fintek device: %04x\n", |
| 2215 | (unsigned int)devid); | 2219 | (unsigned int)devid); |
| 2220 | err = -ENODEV; | ||
| 2216 | goto exit; | 2221 | goto exit; |
| 2217 | } | 2222 | } |
| 2218 | 2223 | ||
| @@ -2223,12 +2228,14 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address, | |||
| 2223 | 2228 | ||
| 2224 | if (!(superio_inb(sioaddr, SIO_REG_ENABLE) & 0x01)) { | 2229 | if (!(superio_inb(sioaddr, SIO_REG_ENABLE) & 0x01)) { |
| 2225 | printk(KERN_WARNING DRVNAME ": Device not activated\n"); | 2230 | printk(KERN_WARNING DRVNAME ": Device not activated\n"); |
| 2231 | err = -ENODEV; | ||
| 2226 | goto exit; | 2232 | goto exit; |
| 2227 | } | 2233 | } |
| 2228 | 2234 | ||
| 2229 | *address = superio_inw(sioaddr, SIO_REG_ADDR); | 2235 | *address = superio_inw(sioaddr, SIO_REG_ADDR); |
| 2230 | if (*address == 0) { | 2236 | if (*address == 0) { |
| 2231 | printk(KERN_WARNING DRVNAME ": Base address not set\n"); | 2237 | printk(KERN_WARNING DRVNAME ": Base address not set\n"); |
| 2238 | err = -ENODEV; | ||
| 2232 | goto exit; | 2239 | goto exit; |
| 2233 | } | 2240 | } |
| 2234 | *address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */ | 2241 | *address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */ |
| @@ -2239,7 +2246,6 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address, | |||
| 2239 | (int)superio_inb(sioaddr, SIO_REG_DEVREV)); | 2246 | (int)superio_inb(sioaddr, SIO_REG_DEVREV)); |
| 2240 | exit: | 2247 | exit: |
| 2241 | superio_exit(sioaddr); | 2248 | superio_exit(sioaddr); |
| 2242 | release_region(sioaddr, 2); | ||
| 2243 | return err; | 2249 | return err; |
| 2244 | } | 2250 | } |
| 2245 | 2251 | ||
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c index 0f58ecc5334d..9638d58f99fd 100644 --- a/drivers/hwmon/f75375s.c +++ b/drivers/hwmon/f75375s.c | |||
| @@ -79,7 +79,7 @@ enum chips { f75373, f75375 }; | |||
| 79 | #define F75375_REG_PWM2_DROP_DUTY 0x6C | 79 | #define F75375_REG_PWM2_DROP_DUTY 0x6C |
| 80 | 80 | ||
| 81 | #define FAN_CTRL_LINEAR(nr) (4 + nr) | 81 | #define FAN_CTRL_LINEAR(nr) (4 + nr) |
| 82 | #define FAN_CTRL_MODE(nr) (5 + ((nr) * 2)) | 82 | #define FAN_CTRL_MODE(nr) (4 + ((nr) * 2)) |
| 83 | 83 | ||
| 84 | /* | 84 | /* |
| 85 | * Data structures and manipulation thereof | 85 | * Data structures and manipulation thereof |
| @@ -298,7 +298,7 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) | |||
| 298 | return -EINVAL; | 298 | return -EINVAL; |
| 299 | 299 | ||
| 300 | fanmode = f75375_read8(client, F75375_REG_FAN_TIMER); | 300 | fanmode = f75375_read8(client, F75375_REG_FAN_TIMER); |
| 301 | fanmode = ~(3 << FAN_CTRL_MODE(nr)); | 301 | fanmode &= ~(3 << FAN_CTRL_MODE(nr)); |
| 302 | 302 | ||
| 303 | switch (val) { | 303 | switch (val) { |
| 304 | case 0: /* Full speed */ | 304 | case 0: /* Full speed */ |
| @@ -350,7 +350,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr, | |||
| 350 | 350 | ||
| 351 | mutex_lock(&data->update_lock); | 351 | mutex_lock(&data->update_lock); |
| 352 | conf = f75375_read8(client, F75375_REG_CONFIG1); | 352 | conf = f75375_read8(client, F75375_REG_CONFIG1); |
| 353 | conf = ~(1 << FAN_CTRL_LINEAR(nr)); | 353 | conf &= ~(1 << FAN_CTRL_LINEAR(nr)); |
| 354 | 354 | ||
| 355 | if (val == 0) | 355 | if (val == 0) |
| 356 | conf |= (1 << FAN_CTRL_LINEAR(nr)) ; | 356 | conf |= (1 << FAN_CTRL_LINEAR(nr)) ; |
diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c index 6138f036b159..fc591ae53107 100644 --- a/drivers/hwmon/lis3lv02d.c +++ b/drivers/hwmon/lis3lv02d.c | |||
| @@ -277,7 +277,7 @@ static irqreturn_t lis302dl_interrupt(int irq, void *dummy) | |||
| 277 | wake_up_interruptible(&lis3_dev.misc_wait); | 277 | wake_up_interruptible(&lis3_dev.misc_wait); |
| 278 | kill_fasync(&lis3_dev.async_queue, SIGIO, POLL_IN); | 278 | kill_fasync(&lis3_dev.async_queue, SIGIO, POLL_IN); |
| 279 | out: | 279 | out: |
| 280 | if (lis3_dev.whoami == WAI_8B && lis3_dev.idev && | 280 | if (lis3_dev.pdata && lis3_dev.whoami == WAI_8B && lis3_dev.idev && |
| 281 | lis3_dev.idev->input->users) | 281 | lis3_dev.idev->input->users) |
| 282 | return IRQ_WAKE_THREAD; | 282 | return IRQ_WAKE_THREAD; |
| 283 | return IRQ_HANDLED; | 283 | return IRQ_HANDLED; |
| @@ -718,7 +718,7 @@ int lis3lv02d_init_device(struct lis3lv02d *dev) | |||
| 718 | * io-apic is not configurable (and generates a warning) but I keep it | 718 | * io-apic is not configurable (and generates a warning) but I keep it |
| 719 | * in case of support for other hardware. | 719 | * in case of support for other hardware. |
| 720 | */ | 720 | */ |
| 721 | if (dev->whoami == WAI_8B) | 721 | if (dev->pdata && dev->whoami == WAI_8B) |
| 722 | thread_fn = lis302dl_interrupt_thread1_8b; | 722 | thread_fn = lis302dl_interrupt_thread1_8b; |
| 723 | else | 723 | else |
| 724 | thread_fn = NULL; | 724 | thread_fn = NULL; |
diff --git a/drivers/hwmon/lis3lv02d_i2c.c b/drivers/hwmon/lis3lv02d_i2c.c index dc1f5402c1d7..8e5933b72d19 100644 --- a/drivers/hwmon/lis3lv02d_i2c.c +++ b/drivers/hwmon/lis3lv02d_i2c.c | |||
| @@ -121,7 +121,7 @@ static int lis3lv02d_i2c_suspend(struct i2c_client *client, pm_message_t mesg) | |||
| 121 | { | 121 | { |
| 122 | struct lis3lv02d *lis3 = i2c_get_clientdata(client); | 122 | struct lis3lv02d *lis3 = i2c_get_clientdata(client); |
| 123 | 123 | ||
| 124 | if (!lis3->pdata->wakeup_flags) | 124 | if (!lis3->pdata || !lis3->pdata->wakeup_flags) |
| 125 | lis3lv02d_poweroff(lis3); | 125 | lis3lv02d_poweroff(lis3); |
| 126 | return 0; | 126 | return 0; |
| 127 | } | 127 | } |
| @@ -130,7 +130,7 @@ static int lis3lv02d_i2c_resume(struct i2c_client *client) | |||
| 130 | { | 130 | { |
| 131 | struct lis3lv02d *lis3 = i2c_get_clientdata(client); | 131 | struct lis3lv02d *lis3 = i2c_get_clientdata(client); |
| 132 | 132 | ||
| 133 | if (!lis3->pdata->wakeup_flags) | 133 | if (!lis3->pdata || !lis3->pdata->wakeup_flags) |
| 134 | lis3lv02d_poweron(lis3); | 134 | lis3lv02d_poweron(lis3); |
| 135 | return 0; | 135 | return 0; |
| 136 | } | 136 | } |
diff --git a/drivers/hwmon/lis3lv02d_spi.c b/drivers/hwmon/lis3lv02d_spi.c index 82b16808a274..b9be5e3a22b3 100644 --- a/drivers/hwmon/lis3lv02d_spi.c +++ b/drivers/hwmon/lis3lv02d_spi.c | |||
| @@ -92,7 +92,7 @@ static int lis3lv02d_spi_suspend(struct spi_device *spi, pm_message_t mesg) | |||
| 92 | { | 92 | { |
| 93 | struct lis3lv02d *lis3 = spi_get_drvdata(spi); | 93 | struct lis3lv02d *lis3 = spi_get_drvdata(spi); |
| 94 | 94 | ||
| 95 | if (!lis3->pdata->wakeup_flags) | 95 | if (!lis3->pdata || !lis3->pdata->wakeup_flags) |
| 96 | lis3lv02d_poweroff(&lis3_dev); | 96 | lis3lv02d_poweroff(&lis3_dev); |
| 97 | 97 | ||
| 98 | return 0; | 98 | return 0; |
| @@ -102,7 +102,7 @@ static int lis3lv02d_spi_resume(struct spi_device *spi) | |||
| 102 | { | 102 | { |
| 103 | struct lis3lv02d *lis3 = spi_get_drvdata(spi); | 103 | struct lis3lv02d *lis3 = spi_get_drvdata(spi); |
| 104 | 104 | ||
| 105 | if (!lis3->pdata->wakeup_flags) | 105 | if (!lis3->pdata || !lis3->pdata->wakeup_flags) |
| 106 | lis3lv02d_poweron(lis3); | 106 | lis3lv02d_poweron(lis3); |
| 107 | 107 | ||
| 108 | return 0; | 108 | return 0; |
diff --git a/drivers/hwmon/lm95241.c b/drivers/hwmon/lm95241.c index 94741d42112d..464340f25496 100644 --- a/drivers/hwmon/lm95241.c +++ b/drivers/hwmon/lm95241.c | |||
| @@ -91,7 +91,7 @@ static struct lm95241_data *lm95241_update_device(struct device *dev); | |||
| 91 | struct lm95241_data { | 91 | struct lm95241_data { |
| 92 | struct device *hwmon_dev; | 92 | struct device *hwmon_dev; |
| 93 | struct mutex update_lock; | 93 | struct mutex update_lock; |
| 94 | unsigned long last_updated, rate; /* in jiffies */ | 94 | unsigned long last_updated, interval; /* in jiffies */ |
| 95 | char valid; /* zero until following fields are valid */ | 95 | char valid; /* zero until following fields are valid */ |
| 96 | /* registers values */ | 96 | /* registers values */ |
| 97 | u8 local_h, local_l; /* local */ | 97 | u8 local_h, local_l; /* local */ |
| @@ -114,23 +114,23 @@ show_temp(local); | |||
| 114 | show_temp(remote1); | 114 | show_temp(remote1); |
| 115 | show_temp(remote2); | 115 | show_temp(remote2); |
| 116 | 116 | ||
| 117 | static ssize_t show_rate(struct device *dev, struct device_attribute *attr, | 117 | static ssize_t show_interval(struct device *dev, struct device_attribute *attr, |
| 118 | char *buf) | 118 | char *buf) |
| 119 | { | 119 | { |
| 120 | struct lm95241_data *data = lm95241_update_device(dev); | 120 | struct lm95241_data *data = lm95241_update_device(dev); |
| 121 | 121 | ||
| 122 | snprintf(buf, PAGE_SIZE - 1, "%lu\n", 1000 * data->rate / HZ); | 122 | snprintf(buf, PAGE_SIZE - 1, "%lu\n", 1000 * data->interval / HZ); |
| 123 | return strlen(buf); | 123 | return strlen(buf); |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | static ssize_t set_rate(struct device *dev, struct device_attribute *attr, | 126 | static ssize_t set_interval(struct device *dev, struct device_attribute *attr, |
| 127 | const char *buf, size_t count) | 127 | const char *buf, size_t count) |
| 128 | { | 128 | { |
| 129 | struct i2c_client *client = to_i2c_client(dev); | 129 | struct i2c_client *client = to_i2c_client(dev); |
| 130 | struct lm95241_data *data = i2c_get_clientdata(client); | 130 | struct lm95241_data *data = i2c_get_clientdata(client); |
| 131 | 131 | ||
| 132 | strict_strtol(buf, 10, &data->rate); | 132 | strict_strtol(buf, 10, &data->interval); |
| 133 | data->rate = data->rate * HZ / 1000; | 133 | data->interval = data->interval * HZ / 1000; |
| 134 | 134 | ||
| 135 | return count; | 135 | return count; |
| 136 | } | 136 | } |
| @@ -286,7 +286,8 @@ static DEVICE_ATTR(temp2_min, S_IWUSR | S_IRUGO, show_min1, set_min1); | |||
| 286 | static DEVICE_ATTR(temp3_min, S_IWUSR | S_IRUGO, show_min2, set_min2); | 286 | static DEVICE_ATTR(temp3_min, S_IWUSR | S_IRUGO, show_min2, set_min2); |
| 287 | static DEVICE_ATTR(temp2_max, S_IWUSR | S_IRUGO, show_max1, set_max1); | 287 | static DEVICE_ATTR(temp2_max, S_IWUSR | S_IRUGO, show_max1, set_max1); |
| 288 | static DEVICE_ATTR(temp3_max, S_IWUSR | S_IRUGO, show_max2, set_max2); | 288 | static DEVICE_ATTR(temp3_max, S_IWUSR | S_IRUGO, show_max2, set_max2); |
| 289 | static DEVICE_ATTR(rate, S_IWUSR | S_IRUGO, show_rate, set_rate); | 289 | static DEVICE_ATTR(update_interval, S_IWUSR | S_IRUGO, show_interval, |
| 290 | set_interval); | ||
| 290 | 291 | ||
| 291 | static struct attribute *lm95241_attributes[] = { | 292 | static struct attribute *lm95241_attributes[] = { |
| 292 | &dev_attr_temp1_input.attr, | 293 | &dev_attr_temp1_input.attr, |
| @@ -298,7 +299,7 @@ static struct attribute *lm95241_attributes[] = { | |||
| 298 | &dev_attr_temp3_min.attr, | 299 | &dev_attr_temp3_min.attr, |
| 299 | &dev_attr_temp2_max.attr, | 300 | &dev_attr_temp2_max.attr, |
| 300 | &dev_attr_temp3_max.attr, | 301 | &dev_attr_temp3_max.attr, |
| 301 | &dev_attr_rate.attr, | 302 | &dev_attr_update_interval.attr, |
| 302 | NULL | 303 | NULL |
| 303 | }; | 304 | }; |
| 304 | 305 | ||
| @@ -376,7 +377,7 @@ static void lm95241_init_client(struct i2c_client *client) | |||
| 376 | { | 377 | { |
| 377 | struct lm95241_data *data = i2c_get_clientdata(client); | 378 | struct lm95241_data *data = i2c_get_clientdata(client); |
| 378 | 379 | ||
| 379 | data->rate = HZ; /* 1 sec default */ | 380 | data->interval = HZ; /* 1 sec default */ |
| 380 | data->valid = 0; | 381 | data->valid = 0; |
| 381 | data->config = CFG_CR0076; | 382 | data->config = CFG_CR0076; |
| 382 | data->model = 0; | 383 | data->model = 0; |
| @@ -410,7 +411,7 @@ static struct lm95241_data *lm95241_update_device(struct device *dev) | |||
| 410 | 411 | ||
| 411 | mutex_lock(&data->update_lock); | 412 | mutex_lock(&data->update_lock); |
| 412 | 413 | ||
| 413 | if (time_after(jiffies, data->last_updated + data->rate) || | 414 | if (time_after(jiffies, data->last_updated + data->interval) || |
| 414 | !data->valid) { | 415 | !data->valid) { |
| 415 | dev_dbg(&client->dev, "Updating lm95241 data.\n"); | 416 | dev_dbg(&client->dev, "Updating lm95241 data.\n"); |
| 416 | data->local_h = | 417 | data->local_h = |
diff --git a/drivers/hwmon/pkgtemp.c b/drivers/hwmon/pkgtemp.c index 74157fcda6ed..f11903936c8b 100644 --- a/drivers/hwmon/pkgtemp.c +++ b/drivers/hwmon/pkgtemp.c | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | #include <linux/list.h> | 33 | #include <linux/list.h> |
| 34 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
| 35 | #include <linux/cpu.h> | 35 | #include <linux/cpu.h> |
| 36 | #include <linux/pci.h> | ||
| 37 | #include <asm/msr.h> | 36 | #include <asm/msr.h> |
| 38 | #include <asm/processor.h> | 37 | #include <asm/processor.h> |
| 39 | 38 | ||
| @@ -224,7 +223,7 @@ static int __devinit pkgtemp_probe(struct platform_device *pdev) | |||
| 224 | 223 | ||
| 225 | err = sysfs_create_group(&pdev->dev.kobj, &pkgtemp_group); | 224 | err = sysfs_create_group(&pdev->dev.kobj, &pkgtemp_group); |
| 226 | if (err) | 225 | if (err) |
| 227 | goto exit_free; | 226 | goto exit_dev; |
| 228 | 227 | ||
| 229 | data->hwmon_dev = hwmon_device_register(&pdev->dev); | 228 | data->hwmon_dev = hwmon_device_register(&pdev->dev); |
| 230 | if (IS_ERR(data->hwmon_dev)) { | 229 | if (IS_ERR(data->hwmon_dev)) { |
| @@ -238,6 +237,8 @@ static int __devinit pkgtemp_probe(struct platform_device *pdev) | |||
| 238 | 237 | ||
| 239 | exit_class: | 238 | exit_class: |
| 240 | sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group); | 239 | sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group); |
| 240 | exit_dev: | ||
| 241 | device_remove_file(&pdev->dev, &sensor_dev_attr_temp1_max.dev_attr); | ||
| 241 | exit_free: | 242 | exit_free: |
| 242 | kfree(data); | 243 | kfree(data); |
| 243 | exit: | 244 | exit: |
| @@ -250,6 +251,7 @@ static int __devexit pkgtemp_remove(struct platform_device *pdev) | |||
| 250 | 251 | ||
| 251 | hwmon_device_unregister(data->hwmon_dev); | 252 | hwmon_device_unregister(data->hwmon_dev); |
| 252 | sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group); | 253 | sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group); |
| 254 | device_remove_file(&pdev->dev, &sensor_dev_attr_temp1_max.dev_attr); | ||
| 253 | platform_set_drvdata(pdev, NULL); | 255 | platform_set_drvdata(pdev, NULL); |
| 254 | kfree(data); | 256 | kfree(data); |
| 255 | return 0; | 257 | return 0; |
| @@ -281,9 +283,10 @@ static int __cpuinit pkgtemp_device_add(unsigned int cpu) | |||
| 281 | int err; | 283 | int err; |
| 282 | struct platform_device *pdev; | 284 | struct platform_device *pdev; |
| 283 | struct pdev_entry *pdev_entry; | 285 | struct pdev_entry *pdev_entry; |
| 284 | #ifdef CONFIG_SMP | ||
| 285 | struct cpuinfo_x86 *c = &cpu_data(cpu); | 286 | struct cpuinfo_x86 *c = &cpu_data(cpu); |
| 286 | #endif | 287 | |
| 288 | if (!cpu_has(c, X86_FEATURE_PTS)) | ||
| 289 | return 0; | ||
| 287 | 290 | ||
| 288 | mutex_lock(&pdev_list_mutex); | 291 | mutex_lock(&pdev_list_mutex); |
| 289 | 292 | ||
| @@ -339,17 +342,18 @@ exit: | |||
| 339 | #ifdef CONFIG_HOTPLUG_CPU | 342 | #ifdef CONFIG_HOTPLUG_CPU |
| 340 | static void pkgtemp_device_remove(unsigned int cpu) | 343 | static void pkgtemp_device_remove(unsigned int cpu) |
| 341 | { | 344 | { |
| 342 | struct pdev_entry *p, *n; | 345 | struct pdev_entry *p; |
| 343 | unsigned int i; | 346 | unsigned int i; |
| 344 | int err; | 347 | int err; |
| 345 | 348 | ||
| 346 | mutex_lock(&pdev_list_mutex); | 349 | mutex_lock(&pdev_list_mutex); |
| 347 | list_for_each_entry_safe(p, n, &pdev_list, list) { | 350 | list_for_each_entry(p, &pdev_list, list) { |
| 348 | if (p->cpu != cpu) | 351 | if (p->cpu != cpu) |
| 349 | continue; | 352 | continue; |
| 350 | 353 | ||
| 351 | platform_device_unregister(p->pdev); | 354 | platform_device_unregister(p->pdev); |
| 352 | list_del(&p->list); | 355 | list_del(&p->list); |
| 356 | mutex_unlock(&pdev_list_mutex); | ||
| 353 | kfree(p); | 357 | kfree(p); |
| 354 | for_each_cpu(i, cpu_core_mask(cpu)) { | 358 | for_each_cpu(i, cpu_core_mask(cpu)) { |
| 355 | if (i != cpu) { | 359 | if (i != cpu) { |
| @@ -358,7 +362,7 @@ static void pkgtemp_device_remove(unsigned int cpu) | |||
| 358 | break; | 362 | break; |
| 359 | } | 363 | } |
| 360 | } | 364 | } |
| 361 | break; | 365 | return; |
| 362 | } | 366 | } |
| 363 | mutex_unlock(&pdev_list_mutex); | 367 | mutex_unlock(&pdev_list_mutex); |
| 364 | } | 368 | } |
| @@ -399,11 +403,6 @@ static int __init pkgtemp_init(void) | |||
| 399 | goto exit; | 403 | goto exit; |
| 400 | 404 | ||
| 401 | for_each_online_cpu(i) { | 405 | for_each_online_cpu(i) { |
| 402 | struct cpuinfo_x86 *c = &cpu_data(i); | ||
| 403 | |||
| 404 | if (!cpu_has(c, X86_FEATURE_PTS)) | ||
| 405 | continue; | ||
| 406 | |||
| 407 | err = pkgtemp_device_add(i); | 406 | err = pkgtemp_device_add(i); |
| 408 | if (err) | 407 | if (err) |
| 409 | goto exit_devices_unreg; | 408 | goto exit_devices_unreg; |
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index e96e69dd36fb..072c58008a63 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c | |||
| @@ -127,6 +127,7 @@ superio_enter(int ioreg) | |||
| 127 | static inline void | 127 | static inline void |
| 128 | superio_exit(int ioreg) | 128 | superio_exit(int ioreg) |
| 129 | { | 129 | { |
| 130 | outb(0xaa, ioreg); | ||
| 130 | outb(0x02, ioreg); | 131 | outb(0x02, ioreg); |
| 131 | outb(0x02, ioreg + 1); | 132 | outb(0x02, ioreg + 1); |
| 132 | } | 133 | } |
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c index f7bd2613cecc..f2de3be35df3 100644 --- a/drivers/i2c/busses/i2c-cpm.c +++ b/drivers/i2c/busses/i2c-cpm.c | |||
| @@ -677,6 +677,11 @@ static int __devinit cpm_i2c_probe(struct platform_device *ofdev, | |||
| 677 | dev_dbg(&ofdev->dev, "hw routines for %s registered.\n", | 677 | dev_dbg(&ofdev->dev, "hw routines for %s registered.\n", |
| 678 | cpm->adap.name); | 678 | cpm->adap.name); |
| 679 | 679 | ||
| 680 | /* | ||
| 681 | * register OF I2C devices | ||
| 682 | */ | ||
| 683 | of_i2c_register_devices(&cpm->adap); | ||
| 684 | |||
| 680 | return 0; | 685 | return 0; |
| 681 | out_shut: | 686 | out_shut: |
| 682 | cpm_i2c_shutdown(cpm); | 687 | cpm_i2c_shutdown(cpm); |
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index 2222c87876b9..5795c8398c7c 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c | |||
| @@ -331,21 +331,16 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) | |||
| 331 | INIT_COMPLETION(dev->cmd_complete); | 331 | INIT_COMPLETION(dev->cmd_complete); |
| 332 | dev->cmd_err = 0; | 332 | dev->cmd_err = 0; |
| 333 | 333 | ||
| 334 | /* Take I2C out of reset, configure it as master and set the | 334 | /* Take I2C out of reset and configure it as master */ |
| 335 | * start bit */ | 335 | flag = DAVINCI_I2C_MDR_IRS | DAVINCI_I2C_MDR_MST; |
| 336 | flag = DAVINCI_I2C_MDR_IRS | DAVINCI_I2C_MDR_MST | DAVINCI_I2C_MDR_STT; | ||
| 337 | 336 | ||
| 338 | /* if the slave address is ten bit address, enable XA bit */ | 337 | /* if the slave address is ten bit address, enable XA bit */ |
| 339 | if (msg->flags & I2C_M_TEN) | 338 | if (msg->flags & I2C_M_TEN) |
| 340 | flag |= DAVINCI_I2C_MDR_XA; | 339 | flag |= DAVINCI_I2C_MDR_XA; |
| 341 | if (!(msg->flags & I2C_M_RD)) | 340 | if (!(msg->flags & I2C_M_RD)) |
| 342 | flag |= DAVINCI_I2C_MDR_TRX; | 341 | flag |= DAVINCI_I2C_MDR_TRX; |
| 343 | if (stop) | 342 | if (msg->len == 0) |
| 344 | flag |= DAVINCI_I2C_MDR_STP; | ||
| 345 | if (msg->len == 0) { | ||
| 346 | flag |= DAVINCI_I2C_MDR_RM; | 343 | flag |= DAVINCI_I2C_MDR_RM; |
| 347 | flag &= ~DAVINCI_I2C_MDR_STP; | ||
| 348 | } | ||
| 349 | 344 | ||
| 350 | /* Enable receive or transmit interrupts */ | 345 | /* Enable receive or transmit interrupts */ |
| 351 | w = davinci_i2c_read_reg(dev, DAVINCI_I2C_IMR_REG); | 346 | w = davinci_i2c_read_reg(dev, DAVINCI_I2C_IMR_REG); |
| @@ -357,7 +352,11 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) | |||
| 357 | 352 | ||
| 358 | dev->terminate = 0; | 353 | dev->terminate = 0; |
| 359 | 354 | ||
| 360 | /* write the data into mode register */ | 355 | /* |
| 356 | * Write mode register first as needed for correct behaviour | ||
| 357 | * on OMAP-L138, but don't set STT yet to avoid a race with XRDY | ||
| 358 | * occuring before we have loaded DXR | ||
| 359 | */ | ||
| 361 | davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag); | 360 | davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag); |
| 362 | 361 | ||
| 363 | /* | 362 | /* |
| @@ -365,12 +364,19 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) | |||
| 365 | * because transmit-data-ready interrupt can come before | 364 | * because transmit-data-ready interrupt can come before |
| 366 | * NACK-interrupt during sending of previous message and | 365 | * NACK-interrupt during sending of previous message and |
| 367 | * ICDXR may have wrong data | 366 | * ICDXR may have wrong data |
| 367 | * It also saves us one interrupt, slightly faster | ||
| 368 | */ | 368 | */ |
| 369 | if ((!(msg->flags & I2C_M_RD)) && dev->buf_len) { | 369 | if ((!(msg->flags & I2C_M_RD)) && dev->buf_len) { |
| 370 | davinci_i2c_write_reg(dev, DAVINCI_I2C_DXR_REG, *dev->buf++); | 370 | davinci_i2c_write_reg(dev, DAVINCI_I2C_DXR_REG, *dev->buf++); |
| 371 | dev->buf_len--; | 371 | dev->buf_len--; |
| 372 | } | 372 | } |
| 373 | 373 | ||
| 374 | /* Set STT to begin transmit now DXR is loaded */ | ||
| 375 | flag |= DAVINCI_I2C_MDR_STT; | ||
| 376 | if (stop && msg->len != 0) | ||
| 377 | flag |= DAVINCI_I2C_MDR_STP; | ||
| 378 | davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag); | ||
| 379 | |||
| 374 | r = wait_for_completion_interruptible_timeout(&dev->cmd_complete, | 380 | r = wait_for_completion_interruptible_timeout(&dev->cmd_complete, |
| 375 | dev->adapter.timeout); | 381 | dev->adapter.timeout); |
| 376 | if (r == 0) { | 382 | if (r == 0) { |
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c index 43ca32fddde2..89eedf45d30e 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c | |||
| @@ -761,6 +761,9 @@ static int __devinit iic_probe(struct platform_device *ofdev, | |||
| 761 | dev_info(&ofdev->dev, "using %s mode\n", | 761 | dev_info(&ofdev->dev, "using %s mode\n", |
| 762 | dev->fast_mode ? "fast (400 kHz)" : "standard (100 kHz)"); | 762 | dev->fast_mode ? "fast (400 kHz)" : "standard (100 kHz)"); |
| 763 | 763 | ||
| 764 | /* Now register all the child nodes */ | ||
| 765 | of_i2c_register_devices(adap); | ||
| 766 | |||
| 764 | return 0; | 767 | return 0; |
| 765 | 768 | ||
| 766 | error_cleanup: | 769 | error_cleanup: |
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index d1ff9408dc1f..4c2a62b75b5c 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c | |||
| @@ -159,15 +159,9 @@ static int i2c_imx_bus_busy(struct imx_i2c_struct *i2c_imx, int for_busy) | |||
| 159 | 159 | ||
| 160 | static int i2c_imx_trx_complete(struct imx_i2c_struct *i2c_imx) | 160 | static int i2c_imx_trx_complete(struct imx_i2c_struct *i2c_imx) |
| 161 | { | 161 | { |
| 162 | int result; | 162 | wait_event_timeout(i2c_imx->queue, i2c_imx->i2csr & I2SR_IIF, HZ / 10); |
| 163 | |||
| 164 | result = wait_event_interruptible_timeout(i2c_imx->queue, | ||
| 165 | i2c_imx->i2csr & I2SR_IIF, HZ / 10); | ||
| 166 | 163 | ||
| 167 | if (unlikely(result < 0)) { | 164 | if (unlikely(!(i2c_imx->i2csr & I2SR_IIF))) { |
| 168 | dev_dbg(&i2c_imx->adapter.dev, "<%s> result < 0\n", __func__); | ||
| 169 | return result; | ||
| 170 | } else if (unlikely(!(i2c_imx->i2csr & I2SR_IIF))) { | ||
| 171 | dev_dbg(&i2c_imx->adapter.dev, "<%s> Timeout\n", __func__); | 165 | dev_dbg(&i2c_imx->adapter.dev, "<%s> Timeout\n", __func__); |
| 172 | return -ETIMEDOUT; | 166 | return -ETIMEDOUT; |
| 173 | } | 167 | } |
| @@ -295,7 +289,7 @@ static irqreturn_t i2c_imx_isr(int irq, void *dev_id) | |||
| 295 | i2c_imx->i2csr = temp; | 289 | i2c_imx->i2csr = temp; |
| 296 | temp &= ~I2SR_IIF; | 290 | temp &= ~I2SR_IIF; |
| 297 | writeb(temp, i2c_imx->base + IMX_I2C_I2SR); | 291 | writeb(temp, i2c_imx->base + IMX_I2C_I2SR); |
| 298 | wake_up_interruptible(&i2c_imx->queue); | 292 | wake_up(&i2c_imx->queue); |
| 299 | return IRQ_HANDLED; | 293 | return IRQ_HANDLED; |
| 300 | } | 294 | } |
| 301 | 295 | ||
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index a1c419a716af..b74e6dc6886c 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c | |||
| @@ -632,6 +632,7 @@ static int __devinit fsl_i2c_probe(struct platform_device *op, | |||
| 632 | dev_err(i2c->dev, "failed to add adapter\n"); | 632 | dev_err(i2c->dev, "failed to add adapter\n"); |
| 633 | goto fail_add; | 633 | goto fail_add; |
| 634 | } | 634 | } |
| 635 | of_i2c_register_devices(&i2c->adap); | ||
| 635 | 636 | ||
| 636 | return result; | 637 | return result; |
| 637 | 638 | ||
diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c index 0e9f85d0a835..56dbe54e8811 100644 --- a/drivers/i2c/busses/i2c-octeon.c +++ b/drivers/i2c/busses/i2c-octeon.c | |||
| @@ -218,7 +218,7 @@ static int octeon_i2c_wait(struct octeon_i2c *i2c) | |||
| 218 | return result; | 218 | return result; |
| 219 | } else if (result == 0) { | 219 | } else if (result == 0) { |
| 220 | dev_dbg(i2c->dev, "%s: timeout\n", __func__); | 220 | dev_dbg(i2c->dev, "%s: timeout\n", __func__); |
| 221 | result = -ETIMEDOUT; | 221 | return -ETIMEDOUT; |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | return 0; | 224 | return 0; |
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 7674efb55378..b33c78586bfc 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
| @@ -680,6 +680,8 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) | |||
| 680 | 680 | ||
| 681 | if (r == 0) | 681 | if (r == 0) |
| 682 | r = num; | 682 | r = num; |
| 683 | |||
| 684 | omap_i2c_wait_for_bb(dev); | ||
| 683 | out: | 685 | out: |
| 684 | omap_i2c_idle(dev); | 686 | omap_i2c_idle(dev); |
| 685 | return r; | 687 | return r; |
diff --git a/drivers/i2c/busses/i2c-pca-isa.c b/drivers/i2c/busses/i2c-pca-isa.c index bbd77603a417..29933f87d8fa 100644 --- a/drivers/i2c/busses/i2c-pca-isa.c +++ b/drivers/i2c/busses/i2c-pca-isa.c | |||
| @@ -71,8 +71,8 @@ static int pca_isa_readbyte(void *pd, int reg) | |||
| 71 | 71 | ||
| 72 | static int pca_isa_waitforcompletion(void *pd) | 72 | static int pca_isa_waitforcompletion(void *pd) |
| 73 | { | 73 | { |
| 74 | long ret = ~0; | ||
| 75 | unsigned long timeout; | 74 | unsigned long timeout; |
| 75 | long ret; | ||
| 76 | 76 | ||
| 77 | if (irq > -1) { | 77 | if (irq > -1) { |
| 78 | ret = wait_event_timeout(pca_wait, | 78 | ret = wait_event_timeout(pca_wait, |
| @@ -81,11 +81,15 @@ static int pca_isa_waitforcompletion(void *pd) | |||
| 81 | } else { | 81 | } else { |
| 82 | /* Do polling */ | 82 | /* Do polling */ |
| 83 | timeout = jiffies + pca_isa_ops.timeout; | 83 | timeout = jiffies + pca_isa_ops.timeout; |
| 84 | while (((pca_isa_readbyte(pd, I2C_PCA_CON) | 84 | do { |
| 85 | & I2C_PCA_CON_SI) == 0) | 85 | ret = time_before(jiffies, timeout); |
| 86 | && (ret = time_before(jiffies, timeout))) | 86 | if (pca_isa_readbyte(pd, I2C_PCA_CON) |
| 87 | & I2C_PCA_CON_SI) | ||
| 88 | break; | ||
| 87 | udelay(100); | 89 | udelay(100); |
| 90 | } while (ret); | ||
| 88 | } | 91 | } |
| 92 | |||
| 89 | return ret > 0; | 93 | return ret > 0; |
| 90 | } | 94 | } |
| 91 | 95 | ||
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c index ef5c78487eb7..5f6d7f89e225 100644 --- a/drivers/i2c/busses/i2c-pca-platform.c +++ b/drivers/i2c/busses/i2c-pca-platform.c | |||
| @@ -80,8 +80,8 @@ static void i2c_pca_pf_writebyte32(void *pd, int reg, int val) | |||
| 80 | static int i2c_pca_pf_waitforcompletion(void *pd) | 80 | static int i2c_pca_pf_waitforcompletion(void *pd) |
| 81 | { | 81 | { |
| 82 | struct i2c_pca_pf_data *i2c = pd; | 82 | struct i2c_pca_pf_data *i2c = pd; |
| 83 | long ret = ~0; | ||
| 84 | unsigned long timeout; | 83 | unsigned long timeout; |
| 84 | long ret; | ||
| 85 | 85 | ||
| 86 | if (i2c->irq) { | 86 | if (i2c->irq) { |
| 87 | ret = wait_event_timeout(i2c->wait, | 87 | ret = wait_event_timeout(i2c->wait, |
| @@ -90,10 +90,13 @@ static int i2c_pca_pf_waitforcompletion(void *pd) | |||
| 90 | } else { | 90 | } else { |
| 91 | /* Do polling */ | 91 | /* Do polling */ |
| 92 | timeout = jiffies + i2c->adap.timeout; | 92 | timeout = jiffies + i2c->adap.timeout; |
| 93 | while (((i2c->algo_data.read_byte(i2c, I2C_PCA_CON) | 93 | do { |
| 94 | & I2C_PCA_CON_SI) == 0) | 94 | ret = time_before(jiffies, timeout); |
| 95 | && (ret = time_before(jiffies, timeout))) | 95 | if (i2c->algo_data.read_byte(i2c, I2C_PCA_CON) |
| 96 | & I2C_PCA_CON_SI) | ||
| 97 | break; | ||
| 96 | udelay(100); | 98 | udelay(100); |
| 99 | } while (ret); | ||
| 97 | } | 100 | } |
| 98 | 101 | ||
| 99 | return ret > 0; | 102 | return ret > 0; |
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 72902e0bbfa7..bf831bf81587 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
| @@ -662,8 +662,8 @@ static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got) | |||
| 662 | unsigned long sda_delay; | 662 | unsigned long sda_delay; |
| 663 | 663 | ||
| 664 | if (pdata->sda_delay) { | 664 | if (pdata->sda_delay) { |
| 665 | sda_delay = (freq / 1000) * pdata->sda_delay; | 665 | sda_delay = clkin * pdata->sda_delay; |
| 666 | sda_delay /= 1000000; | 666 | sda_delay = DIV_ROUND_UP(sda_delay, 1000000); |
| 667 | sda_delay = DIV_ROUND_UP(sda_delay, 5); | 667 | sda_delay = DIV_ROUND_UP(sda_delay, 5); |
| 668 | if (sda_delay > 3) | 668 | if (sda_delay > 3) |
| 669 | sda_delay = 3; | 669 | sda_delay = 3; |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 6649176de940..bea4c5021d26 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
| @@ -32,7 +32,6 @@ | |||
| 32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
| 33 | #include <linux/idr.h> | 33 | #include <linux/idr.h> |
| 34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
| 35 | #include <linux/of_i2c.h> | ||
| 36 | #include <linux/of_device.h> | 35 | #include <linux/of_device.h> |
| 37 | #include <linux/completion.h> | 36 | #include <linux/completion.h> |
| 38 | #include <linux/hardirq.h> | 37 | #include <linux/hardirq.h> |
| @@ -197,11 +196,12 @@ static int i2c_device_pm_suspend(struct device *dev) | |||
| 197 | { | 196 | { |
| 198 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; | 197 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; |
| 199 | 198 | ||
| 200 | if (pm_runtime_suspended(dev)) | 199 | if (pm) { |
| 201 | return 0; | 200 | if (pm_runtime_suspended(dev)) |
| 202 | 201 | return 0; | |
| 203 | if (pm) | 202 | else |
| 204 | return pm->suspend ? pm->suspend(dev) : 0; | 203 | return pm->suspend ? pm->suspend(dev) : 0; |
| 204 | } | ||
| 205 | 205 | ||
| 206 | return i2c_legacy_suspend(dev, PMSG_SUSPEND); | 206 | return i2c_legacy_suspend(dev, PMSG_SUSPEND); |
| 207 | } | 207 | } |
| @@ -216,12 +216,6 @@ static int i2c_device_pm_resume(struct device *dev) | |||
| 216 | else | 216 | else |
| 217 | ret = i2c_legacy_resume(dev); | 217 | ret = i2c_legacy_resume(dev); |
| 218 | 218 | ||
| 219 | if (!ret) { | ||
| 220 | pm_runtime_disable(dev); | ||
| 221 | pm_runtime_set_active(dev); | ||
| 222 | pm_runtime_enable(dev); | ||
| 223 | } | ||
| 224 | |||
| 225 | return ret; | 219 | return ret; |
| 226 | } | 220 | } |
| 227 | 221 | ||
| @@ -229,11 +223,12 @@ static int i2c_device_pm_freeze(struct device *dev) | |||
| 229 | { | 223 | { |
| 230 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; | 224 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; |
| 231 | 225 | ||
| 232 | if (pm_runtime_suspended(dev)) | 226 | if (pm) { |
| 233 | return 0; | 227 | if (pm_runtime_suspended(dev)) |
| 234 | 228 | return 0; | |
| 235 | if (pm) | 229 | else |
| 236 | return pm->freeze ? pm->freeze(dev) : 0; | 230 | return pm->freeze ? pm->freeze(dev) : 0; |
| 231 | } | ||
| 237 | 232 | ||
| 238 | return i2c_legacy_suspend(dev, PMSG_FREEZE); | 233 | return i2c_legacy_suspend(dev, PMSG_FREEZE); |
| 239 | } | 234 | } |
| @@ -242,11 +237,12 @@ static int i2c_device_pm_thaw(struct device *dev) | |||
| 242 | { | 237 | { |
| 243 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; | 238 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; |
| 244 | 239 | ||
| 245 | if (pm_runtime_suspended(dev)) | 240 | if (pm) { |
| 246 | return 0; | 241 | if (pm_runtime_suspended(dev)) |
| 247 | 242 | return 0; | |
| 248 | if (pm) | 243 | else |
| 249 | return pm->thaw ? pm->thaw(dev) : 0; | 244 | return pm->thaw ? pm->thaw(dev) : 0; |
| 245 | } | ||
| 250 | 246 | ||
| 251 | return i2c_legacy_resume(dev); | 247 | return i2c_legacy_resume(dev); |
| 252 | } | 248 | } |
| @@ -255,11 +251,12 @@ static int i2c_device_pm_poweroff(struct device *dev) | |||
| 255 | { | 251 | { |
| 256 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; | 252 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; |
| 257 | 253 | ||
| 258 | if (pm_runtime_suspended(dev)) | 254 | if (pm) { |
| 259 | return 0; | 255 | if (pm_runtime_suspended(dev)) |
| 260 | 256 | return 0; | |
| 261 | if (pm) | 257 | else |
| 262 | return pm->poweroff ? pm->poweroff(dev) : 0; | 258 | return pm->poweroff ? pm->poweroff(dev) : 0; |
| 259 | } | ||
| 263 | 260 | ||
| 264 | return i2c_legacy_suspend(dev, PMSG_HIBERNATE); | 261 | return i2c_legacy_suspend(dev, PMSG_HIBERNATE); |
| 265 | } | 262 | } |
| @@ -876,9 +873,6 @@ static int i2c_register_adapter(struct i2c_adapter *adap) | |||
| 876 | if (adap->nr < __i2c_first_dynamic_bus_num) | 873 | if (adap->nr < __i2c_first_dynamic_bus_num) |
| 877 | i2c_scan_static_board_info(adap); | 874 | i2c_scan_static_board_info(adap); |
| 878 | 875 | ||
| 879 | /* Register devices from the device tree */ | ||
| 880 | of_i2c_register_devices(adap); | ||
| 881 | |||
| 882 | /* Notify drivers */ | 876 | /* Notify drivers */ |
| 883 | mutex_lock(&core_lock); | 877 | mutex_lock(&core_lock); |
| 884 | bus_for_each_drv(&i2c_bus_type, NULL, adap, __process_new_adapter); | 878 | bus_for_each_drv(&i2c_bus_type, NULL, adap, __process_new_adapter); |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 4c3d1bfec0c5..068cef0a987a 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
| @@ -1448,19 +1448,13 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d, | |||
| 1448 | if (hwif == NULL) | 1448 | if (hwif == NULL) |
| 1449 | continue; | 1449 | continue; |
| 1450 | 1450 | ||
| 1451 | if (hwif->present) | ||
| 1452 | hwif_register_devices(hwif); | ||
| 1453 | } | ||
| 1454 | |||
| 1455 | ide_host_for_each_port(i, hwif, host) { | ||
| 1456 | if (hwif == NULL) | ||
| 1457 | continue; | ||
| 1458 | |||
| 1459 | ide_sysfs_register_port(hwif); | 1451 | ide_sysfs_register_port(hwif); |
| 1460 | ide_proc_register_port(hwif); | 1452 | ide_proc_register_port(hwif); |
| 1461 | 1453 | ||
| 1462 | if (hwif->present) | 1454 | if (hwif->present) { |
| 1463 | ide_proc_port_register_devices(hwif); | 1455 | ide_proc_port_register_devices(hwif); |
| 1456 | hwif_register_devices(hwif); | ||
| 1457 | } | ||
| 1464 | } | 1458 | } |
| 1465 | 1459 | ||
| 1466 | return j ? 0 : -1; | 1460 | return j ? 0 : -1; |
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index a10152bb1427..c37ef64d1465 100755..100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
| @@ -83,7 +83,7 @@ static unsigned int mwait_substates; | |||
| 83 | /* Reliable LAPIC Timer States, bit 1 for C1 etc. */ | 83 | /* Reliable LAPIC Timer States, bit 1 for C1 etc. */ |
| 84 | static unsigned int lapic_timer_reliable_states; | 84 | static unsigned int lapic_timer_reliable_states; |
| 85 | 85 | ||
| 86 | static struct cpuidle_device *intel_idle_cpuidle_devices; | 86 | static struct cpuidle_device __percpu *intel_idle_cpuidle_devices; |
| 87 | static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state); | 87 | static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state); |
| 88 | 88 | ||
| 89 | static struct cpuidle_state *cpuidle_state_table; | 89 | static struct cpuidle_state *cpuidle_state_table; |
| @@ -108,7 +108,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = { | |||
| 108 | .name = "NHM-C3", | 108 | .name = "NHM-C3", |
| 109 | .desc = "MWAIT 0x10", | 109 | .desc = "MWAIT 0x10", |
| 110 | .driver_data = (void *) 0x10, | 110 | .driver_data = (void *) 0x10, |
| 111 | .flags = CPUIDLE_FLAG_TIME_VALID, | 111 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, |
| 112 | .exit_latency = 20, | 112 | .exit_latency = 20, |
| 113 | .power_usage = 500, | 113 | .power_usage = 500, |
| 114 | .target_residency = 80, | 114 | .target_residency = 80, |
| @@ -117,7 +117,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = { | |||
| 117 | .name = "NHM-C6", | 117 | .name = "NHM-C6", |
| 118 | .desc = "MWAIT 0x20", | 118 | .desc = "MWAIT 0x20", |
| 119 | .driver_data = (void *) 0x20, | 119 | .driver_data = (void *) 0x20, |
| 120 | .flags = CPUIDLE_FLAG_TIME_VALID, | 120 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, |
| 121 | .exit_latency = 200, | 121 | .exit_latency = 200, |
| 122 | .power_usage = 350, | 122 | .power_usage = 350, |
| 123 | .target_residency = 800, | 123 | .target_residency = 800, |
| @@ -149,7 +149,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { | |||
| 149 | .name = "ATM-C4", | 149 | .name = "ATM-C4", |
| 150 | .desc = "MWAIT 0x30", | 150 | .desc = "MWAIT 0x30", |
| 151 | .driver_data = (void *) 0x30, | 151 | .driver_data = (void *) 0x30, |
| 152 | .flags = CPUIDLE_FLAG_TIME_VALID, | 152 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, |
| 153 | .exit_latency = 100, | 153 | .exit_latency = 100, |
| 154 | .power_usage = 250, | 154 | .power_usage = 250, |
| 155 | .target_residency = 400, | 155 | .target_residency = 400, |
| @@ -157,13 +157,13 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { | |||
| 157 | { /* MWAIT C5 */ }, | 157 | { /* MWAIT C5 */ }, |
| 158 | { /* MWAIT C6 */ | 158 | { /* MWAIT C6 */ |
| 159 | .name = "ATM-C6", | 159 | .name = "ATM-C6", |
| 160 | .desc = "MWAIT 0x40", | 160 | .desc = "MWAIT 0x52", |
| 161 | .driver_data = (void *) 0x40, | 161 | .driver_data = (void *) 0x52, |
| 162 | .flags = CPUIDLE_FLAG_TIME_VALID, | 162 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, |
| 163 | .exit_latency = 200, | 163 | .exit_latency = 140, |
| 164 | .power_usage = 150, | 164 | .power_usage = 150, |
| 165 | .target_residency = 800, | 165 | .target_residency = 560, |
| 166 | .enter = NULL }, /* disabled */ | 166 | .enter = &intel_idle }, |
| 167 | }; | 167 | }; |
| 168 | 168 | ||
| 169 | /** | 169 | /** |
| @@ -185,6 +185,16 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state) | |||
| 185 | 185 | ||
| 186 | local_irq_disable(); | 186 | local_irq_disable(); |
| 187 | 187 | ||
| 188 | /* | ||
| 189 | * If the state flag indicates that the TLB will be flushed or if this | ||
| 190 | * is the deepest c-state supported, do a voluntary leave mm to avoid | ||
| 191 | * costly and mostly unnecessary wakeups for flushing the user TLB's | ||
| 192 | * associated with the active mm. | ||
| 193 | */ | ||
| 194 | if (state->flags & CPUIDLE_FLAG_TLB_FLUSHED || | ||
| 195 | (&dev->states[dev->state_count - 1] == state)) | ||
| 196 | leave_mm(cpu); | ||
| 197 | |||
| 188 | if (!(lapic_timer_reliable_states & (1 << (cstate)))) | 198 | if (!(lapic_timer_reliable_states & (1 << (cstate)))) |
| 189 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu); | 199 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu); |
| 190 | 200 | ||
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index d88077a21994..13c88871dc3b 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
| @@ -463,7 +463,8 @@ static int send_connect(struct iwch_ep *ep) | |||
| 463 | V_MSS_IDX(mtu_idx) | | 463 | V_MSS_IDX(mtu_idx) | |
| 464 | V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx); | 464 | V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx); |
| 465 | opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10); | 465 | opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10); |
| 466 | opt2 = V_FLAVORS_VALID(1) | V_CONG_CONTROL_FLAVOR(cong_flavor); | 466 | opt2 = F_RX_COALESCE_VALID | V_RX_COALESCE(0) | V_FLAVORS_VALID(1) | |
| 467 | V_CONG_CONTROL_FLAVOR(cong_flavor); | ||
| 467 | skb->priority = CPL_PRIORITY_SETUP; | 468 | skb->priority = CPL_PRIORITY_SETUP; |
| 468 | set_arp_failure_handler(skb, act_open_req_arp_failure); | 469 | set_arp_failure_handler(skb, act_open_req_arp_failure); |
| 469 | 470 | ||
| @@ -1280,7 +1281,8 @@ static void accept_cr(struct iwch_ep *ep, __be32 peer_ip, struct sk_buff *skb) | |||
| 1280 | V_MSS_IDX(mtu_idx) | | 1281 | V_MSS_IDX(mtu_idx) | |
| 1281 | V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx); | 1282 | V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx); |
| 1282 | opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10); | 1283 | opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10); |
| 1283 | opt2 = V_FLAVORS_VALID(1) | V_CONG_CONTROL_FLAVOR(cong_flavor); | 1284 | opt2 = F_RX_COALESCE_VALID | V_RX_COALESCE(0) | V_FLAVORS_VALID(1) | |
| 1285 | V_CONG_CONTROL_FLAVOR(cong_flavor); | ||
| 1284 | 1286 | ||
| 1285 | rpl = cplhdr(skb); | 1287 | rpl = cplhdr(skb); |
| 1286 | rpl->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); | 1288 | rpl->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); |
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index c908c5f83645..9ddafc30f432 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
| @@ -669,6 +669,9 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, | |||
| 669 | 669 | ||
| 670 | if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCGABS(0))) { | 670 | if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCGABS(0))) { |
| 671 | 671 | ||
| 672 | if (!dev->absinfo) | ||
| 673 | return -EINVAL; | ||
| 674 | |||
| 672 | t = _IOC_NR(cmd) & ABS_MAX; | 675 | t = _IOC_NR(cmd) & ABS_MAX; |
| 673 | abs = dev->absinfo[t]; | 676 | abs = dev->absinfo[t]; |
| 674 | 677 | ||
| @@ -680,10 +683,13 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, | |||
| 680 | } | 683 | } |
| 681 | } | 684 | } |
| 682 | 685 | ||
| 683 | if (_IOC_DIR(cmd) == _IOC_READ) { | 686 | if (_IOC_DIR(cmd) == _IOC_WRITE) { |
| 684 | 687 | ||
| 685 | if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0))) { | 688 | if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0))) { |
| 686 | 689 | ||
| 690 | if (!dev->absinfo) | ||
| 691 | return -EINVAL; | ||
| 692 | |||
| 687 | t = _IOC_NR(cmd) & ABS_MAX; | 693 | t = _IOC_NR(cmd) & ABS_MAX; |
| 688 | 694 | ||
| 689 | if (copy_from_user(&abs, p, min_t(size_t, | 695 | if (copy_from_user(&abs, p, min_t(size_t, |
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index d85bd8a7967d..22239e988498 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
| @@ -483,6 +483,9 @@ static int joydev_handle_JSIOCSAXMAP(struct joydev *joydev, | |||
| 483 | 483 | ||
| 484 | memcpy(joydev->abspam, abspam, len); | 484 | memcpy(joydev->abspam, abspam, len); |
| 485 | 485 | ||
| 486 | for (i = 0; i < joydev->nabs; i++) | ||
| 487 | joydev->absmap[joydev->abspam[i]] = i; | ||
| 488 | |||
| 486 | out: | 489 | out: |
| 487 | kfree(abspam); | 490 | kfree(abspam); |
| 488 | return retval; | 491 | return retval; |
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 0d4266a533a5..360698553eb5 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c | |||
| @@ -404,6 +404,13 @@ static int uinput_setup_device(struct uinput_device *udev, const char __user *bu | |||
| 404 | retval = uinput_validate_absbits(dev); | 404 | retval = uinput_validate_absbits(dev); |
| 405 | if (retval < 0) | 405 | if (retval < 0) |
| 406 | goto exit; | 406 | goto exit; |
| 407 | if (test_bit(ABS_MT_SLOT, dev->absbit)) { | ||
| 408 | int nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1; | ||
| 409 | input_mt_create_slots(dev, nslot); | ||
| 410 | input_set_events_per_packet(dev, 6 * nslot); | ||
| 411 | } else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) { | ||
| 412 | input_set_events_per_packet(dev, 60); | ||
| 413 | } | ||
| 407 | } | 414 | } |
| 408 | 415 | ||
| 409 | udev->state = UIST_SETUP_COMPLETE; | 416 | udev->state = UIST_SETUP_COMPLETE; |
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 42ba3691d908..b35876ee6908 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
| @@ -103,27 +103,26 @@ static void wacom_sys_irq(struct urb *urb) | |||
| 103 | static int wacom_open(struct input_dev *dev) | 103 | static int wacom_open(struct input_dev *dev) |
| 104 | { | 104 | { |
| 105 | struct wacom *wacom = input_get_drvdata(dev); | 105 | struct wacom *wacom = input_get_drvdata(dev); |
| 106 | int retval = 0; | ||
| 106 | 107 | ||
| 107 | mutex_lock(&wacom->lock); | 108 | if (usb_autopm_get_interface(wacom->intf) < 0) |
| 108 | |||
| 109 | wacom->irq->dev = wacom->usbdev; | ||
| 110 | |||
| 111 | if (usb_autopm_get_interface(wacom->intf) < 0) { | ||
| 112 | mutex_unlock(&wacom->lock); | ||
| 113 | return -EIO; | 109 | return -EIO; |
| 114 | } | 110 | |
| 111 | mutex_lock(&wacom->lock); | ||
| 115 | 112 | ||
| 116 | if (usb_submit_urb(wacom->irq, GFP_KERNEL)) { | 113 | if (usb_submit_urb(wacom->irq, GFP_KERNEL)) { |
| 117 | usb_autopm_put_interface(wacom->intf); | 114 | retval = -EIO; |
| 118 | mutex_unlock(&wacom->lock); | 115 | goto out; |
| 119 | return -EIO; | ||
| 120 | } | 116 | } |
| 121 | 117 | ||
| 122 | wacom->open = true; | 118 | wacom->open = true; |
| 123 | wacom->intf->needs_remote_wakeup = 1; | 119 | wacom->intf->needs_remote_wakeup = 1; |
| 124 | 120 | ||
| 121 | out: | ||
| 125 | mutex_unlock(&wacom->lock); | 122 | mutex_unlock(&wacom->lock); |
| 126 | return 0; | 123 | if (retval) |
| 124 | usb_autopm_put_interface(wacom->intf); | ||
| 125 | return retval; | ||
| 127 | } | 126 | } |
| 128 | 127 | ||
| 129 | static void wacom_close(struct input_dev *dev) | 128 | static void wacom_close(struct input_dev *dev) |
| @@ -135,6 +134,8 @@ static void wacom_close(struct input_dev *dev) | |||
| 135 | wacom->open = false; | 134 | wacom->open = false; |
| 136 | wacom->intf->needs_remote_wakeup = 0; | 135 | wacom->intf->needs_remote_wakeup = 0; |
| 137 | mutex_unlock(&wacom->lock); | 136 | mutex_unlock(&wacom->lock); |
| 137 | |||
| 138 | usb_autopm_put_interface(wacom->intf); | ||
| 138 | } | 139 | } |
| 139 | 140 | ||
| 140 | static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc, | 141 | static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc, |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 6e29badb969e..47fd7a041c52 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
| @@ -442,8 +442,10 @@ static void wacom_intuos_general(struct wacom_wac *wacom) | |||
| 442 | /* general pen packet */ | 442 | /* general pen packet */ |
| 443 | if ((data[1] & 0xb8) == 0xa0) { | 443 | if ((data[1] & 0xb8) == 0xa0) { |
| 444 | t = (data[6] << 2) | ((data[7] >> 6) & 3); | 444 | t = (data[6] << 2) | ((data[7] >> 6) & 3); |
| 445 | if (features->type >= INTUOS4S && features->type <= INTUOS4L) | 445 | if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || |
| 446 | features->type == WACOM_21UX2) { | ||
| 446 | t = (t << 1) | (data[1] & 1); | 447 | t = (t << 1) | (data[1] & 1); |
| 448 | } | ||
| 447 | input_report_abs(input, ABS_PRESSURE, t); | 449 | input_report_abs(input, ABS_PRESSURE, t); |
| 448 | input_report_abs(input, ABS_TILT_X, | 450 | input_report_abs(input, ABS_TILT_X, |
| 449 | ((data[7] << 1) & 0x7e) | (data[8] >> 7)); | 451 | ((data[7] << 1) & 0x7e) | (data[8] >> 7)); |
diff --git a/drivers/isdn/sc/interrupt.c b/drivers/isdn/sc/interrupt.c index 485be8b1e1b3..f0225bc0f267 100644 --- a/drivers/isdn/sc/interrupt.c +++ b/drivers/isdn/sc/interrupt.c | |||
| @@ -112,11 +112,19 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst) | |||
| 112 | } | 112 | } |
| 113 | else if(callid>=0x0000 && callid<=0x7FFF) | 113 | else if(callid>=0x0000 && callid<=0x7FFF) |
| 114 | { | 114 | { |
| 115 | int len; | ||
| 116 | |||
| 115 | pr_debug("%s: Got Incoming Call\n", | 117 | pr_debug("%s: Got Incoming Call\n", |
| 116 | sc_adapter[card]->devicename); | 118 | sc_adapter[card]->devicename); |
| 117 | strcpy(setup.phone,&(rcvmsg.msg_data.byte_array[4])); | 119 | len = strlcpy(setup.phone, &(rcvmsg.msg_data.byte_array[4]), |
| 118 | strcpy(setup.eazmsn, | 120 | sizeof(setup.phone)); |
| 119 | sc_adapter[card]->channel[rcvmsg.phy_link_no-1].dn); | 121 | if (len >= sizeof(setup.phone)) |
| 122 | continue; | ||
| 123 | len = strlcpy(setup.eazmsn, | ||
| 124 | sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn, | ||
| 125 | sizeof(setup.eazmsn)); | ||
| 126 | if (len >= sizeof(setup.eazmsn)) | ||
| 127 | continue; | ||
| 120 | setup.si1 = 7; | 128 | setup.si1 = 7; |
| 121 | setup.si2 = 0; | 129 | setup.si2 = 0; |
| 122 | setup.plan = 0; | 130 | setup.plan = 0; |
| @@ -176,7 +184,9 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst) | |||
| 176 | * Handle a GetMyNumber Rsp | 184 | * Handle a GetMyNumber Rsp |
| 177 | */ | 185 | */ |
| 178 | if (IS_CE_MESSAGE(rcvmsg,Call,0,GetMyNumber)){ | 186 | if (IS_CE_MESSAGE(rcvmsg,Call,0,GetMyNumber)){ |
| 179 | strcpy(sc_adapter[card]->channel[rcvmsg.phy_link_no-1].dn,rcvmsg.msg_data.byte_array); | 187 | strlcpy(sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn, |
| 188 | rcvmsg.msg_data.byte_array, | ||
| 189 | sizeof(rcvmsg.msg_data.byte_array)); | ||
| 180 | continue; | 190 | continue; |
| 181 | } | 191 | } |
| 182 | 192 | ||
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c index 74dce4ba0262..350eb34f049c 100644 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c | |||
| @@ -81,7 +81,7 @@ static int ns2_led_get_mode(struct ns2_led_data *led_dat, | |||
| 81 | int cmd_level; | 81 | int cmd_level; |
| 82 | int slow_level; | 82 | int slow_level; |
| 83 | 83 | ||
| 84 | read_lock(&led_dat->rw_lock); | 84 | read_lock_irq(&led_dat->rw_lock); |
| 85 | 85 | ||
| 86 | cmd_level = gpio_get_value(led_dat->cmd); | 86 | cmd_level = gpio_get_value(led_dat->cmd); |
| 87 | slow_level = gpio_get_value(led_dat->slow); | 87 | slow_level = gpio_get_value(led_dat->slow); |
| @@ -95,7 +95,7 @@ static int ns2_led_get_mode(struct ns2_led_data *led_dat, | |||
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | read_unlock(&led_dat->rw_lock); | 98 | read_unlock_irq(&led_dat->rw_lock); |
| 99 | 99 | ||
| 100 | return ret; | 100 | return ret; |
| 101 | } | 101 | } |
| @@ -104,8 +104,9 @@ static void ns2_led_set_mode(struct ns2_led_data *led_dat, | |||
| 104 | enum ns2_led_modes mode) | 104 | enum ns2_led_modes mode) |
| 105 | { | 105 | { |
| 106 | int i; | 106 | int i; |
| 107 | unsigned long flags; | ||
| 107 | 108 | ||
| 108 | write_lock(&led_dat->rw_lock); | 109 | write_lock_irqsave(&led_dat->rw_lock, flags); |
| 109 | 110 | ||
| 110 | for (i = 0; i < ARRAY_SIZE(ns2_led_modval); i++) { | 111 | for (i = 0; i < ARRAY_SIZE(ns2_led_modval); i++) { |
| 111 | if (mode == ns2_led_modval[i].mode) { | 112 | if (mode == ns2_led_modval[i].mode) { |
| @@ -116,7 +117,7 @@ static void ns2_led_set_mode(struct ns2_led_data *led_dat, | |||
| 116 | } | 117 | } |
| 117 | } | 118 | } |
| 118 | 119 | ||
| 119 | write_unlock(&led_dat->rw_lock); | 120 | write_unlock_irqrestore(&led_dat->rw_lock, flags); |
| 120 | } | 121 | } |
| 121 | 122 | ||
| 122 | static void ns2_led_set(struct led_classdev *led_cdev, | 123 | static void ns2_led_set(struct led_classdev *led_cdev, |
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index ed4900ade93a..e4fb58db5454 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
| @@ -1000,10 +1000,11 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start) | |||
| 1000 | page = bitmap->sb_page; | 1000 | page = bitmap->sb_page; |
| 1001 | offset = sizeof(bitmap_super_t); | 1001 | offset = sizeof(bitmap_super_t); |
| 1002 | if (!file) | 1002 | if (!file) |
| 1003 | read_sb_page(bitmap->mddev, | 1003 | page = read_sb_page( |
| 1004 | bitmap->mddev->bitmap_info.offset, | 1004 | bitmap->mddev, |
| 1005 | page, | 1005 | bitmap->mddev->bitmap_info.offset, |
| 1006 | index, count); | 1006 | page, |
| 1007 | index, count); | ||
| 1007 | } else if (file) { | 1008 | } else if (file) { |
| 1008 | page = read_page(file, index, bitmap, count); | 1009 | page = read_page(file, index, bitmap, count); |
| 1009 | offset = 0; | 1010 | offset = 0; |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 43cf9cc9c1df..f20d13e717d5 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
| @@ -1643,7 +1643,9 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev) | |||
| 1643 | bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1; | 1643 | bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1; |
| 1644 | if (rdev->sb_size & bmask) | 1644 | if (rdev->sb_size & bmask) |
| 1645 | rdev->sb_size = (rdev->sb_size | bmask) + 1; | 1645 | rdev->sb_size = (rdev->sb_size | bmask) + 1; |
| 1646 | } | 1646 | } else |
| 1647 | max_dev = le32_to_cpu(sb->max_dev); | ||
| 1648 | |||
| 1647 | for (i=0; i<max_dev;i++) | 1649 | for (i=0; i<max_dev;i++) |
| 1648 | sb->dev_roles[i] = cpu_to_le16(0xfffe); | 1650 | sb->dev_roles[i] = cpu_to_le16(0xfffe); |
| 1649 | 1651 | ||
| @@ -7069,7 +7071,7 @@ void md_check_recovery(mddev_t *mddev) | |||
| 7069 | if (mddev->ro && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) | 7071 | if (mddev->ro && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) |
| 7070 | return; | 7072 | return; |
| 7071 | if ( ! ( | 7073 | if ( ! ( |
| 7072 | (mddev->flags && !mddev->external) || | 7074 | (mddev->flags & ~ (1<<MD_CHANGE_PENDING)) || |
| 7073 | test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || | 7075 | test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || |
| 7074 | test_bit(MD_RECOVERY_DONE, &mddev->recovery) || | 7076 | test_bit(MD_RECOVERY_DONE, &mddev->recovery) || |
| 7075 | (mddev->external == 0 && mddev->safemode == 1) || | 7077 | (mddev->external == 0 && mddev->safemode == 1) || |
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index ad83a4dcadc3..0b830bbe1d8b 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
| @@ -1839,7 +1839,9 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
| 1839 | 1839 | ||
| 1840 | /* take from bio_init */ | 1840 | /* take from bio_init */ |
| 1841 | bio->bi_next = NULL; | 1841 | bio->bi_next = NULL; |
| 1842 | bio->bi_flags &= ~(BIO_POOL_MASK-1); | ||
| 1842 | bio->bi_flags |= 1 << BIO_UPTODATE; | 1843 | bio->bi_flags |= 1 << BIO_UPTODATE; |
| 1844 | bio->bi_comp_cpu = -1; | ||
| 1843 | bio->bi_rw = READ; | 1845 | bio->bi_rw = READ; |
| 1844 | bio->bi_vcnt = 0; | 1846 | bio->bi_vcnt = 0; |
| 1845 | bio->bi_idx = 0; | 1847 | bio->bi_idx = 0; |
| @@ -1912,7 +1914,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
| 1912 | !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) | 1914 | !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) |
| 1913 | break; | 1915 | break; |
| 1914 | BUG_ON(sync_blocks < (PAGE_SIZE>>9)); | 1916 | BUG_ON(sync_blocks < (PAGE_SIZE>>9)); |
| 1915 | if (len > (sync_blocks<<9)) | 1917 | if ((len >> 9) > sync_blocks) |
| 1916 | len = sync_blocks<<9; | 1918 | len = sync_blocks<<9; |
| 1917 | } | 1919 | } |
| 1918 | 1920 | ||
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 7e82a9df726b..7961d59f5cac 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c | |||
| @@ -319,7 +319,7 @@ static void ir_timer_keyup(unsigned long cookie) | |||
| 319 | * a keyup event might follow immediately after the keydown. | 319 | * a keyup event might follow immediately after the keydown. |
| 320 | */ | 320 | */ |
| 321 | spin_lock_irqsave(&ir->keylock, flags); | 321 | spin_lock_irqsave(&ir->keylock, flags); |
| 322 | if (time_is_after_eq_jiffies(ir->keyup_jiffies)) | 322 | if (time_is_before_eq_jiffies(ir->keyup_jiffies)) |
| 323 | ir_keyup(ir); | 323 | ir_keyup(ir); |
| 324 | spin_unlock_irqrestore(&ir->keylock, flags); | 324 | spin_unlock_irqrestore(&ir->keylock, flags); |
| 325 | } | 325 | } |
| @@ -510,6 +510,13 @@ int __ir_input_register(struct input_dev *input_dev, | |||
| 510 | (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_IR_RAW) ? | 510 | (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_IR_RAW) ? |
| 511 | " in raw mode" : ""); | 511 | " in raw mode" : ""); |
| 512 | 512 | ||
| 513 | /* | ||
| 514 | * Default delay of 250ms is too short for some protocols, expecially | ||
| 515 | * since the timeout is currently set to 250ms. Increase it to 500ms, | ||
| 516 | * to avoid wrong repetition of the keycodes. | ||
| 517 | */ | ||
| 518 | input_dev->rep[REP_DELAY] = 500; | ||
| 519 | |||
| 513 | return 0; | 520 | return 0; |
| 514 | 521 | ||
| 515 | out_event: | 522 | out_event: |
diff --git a/drivers/media/IR/ir-lirc-codec.c b/drivers/media/IR/ir-lirc-codec.c index 77b5946413c0..e63f757d5d72 100644 --- a/drivers/media/IR/ir-lirc-codec.c +++ b/drivers/media/IR/ir-lirc-codec.c | |||
| @@ -267,7 +267,7 @@ static int ir_lirc_register(struct input_dev *input_dev) | |||
| 267 | features |= LIRC_CAN_SET_SEND_CARRIER; | 267 | features |= LIRC_CAN_SET_SEND_CARRIER; |
| 268 | 268 | ||
| 269 | if (ir_dev->props->s_tx_duty_cycle) | 269 | if (ir_dev->props->s_tx_duty_cycle) |
| 270 | features |= LIRC_CAN_SET_REC_DUTY_CYCLE; | 270 | features |= LIRC_CAN_SET_SEND_DUTY_CYCLE; |
| 271 | } | 271 | } |
| 272 | 272 | ||
| 273 | if (ir_dev->props->s_rx_carrier_range) | 273 | if (ir_dev->props->s_rx_carrier_range) |
diff --git a/drivers/media/IR/ir-raw-event.c b/drivers/media/IR/ir-raw-event.c index 43094e7eccfa..8e0e1b1f8c87 100644 --- a/drivers/media/IR/ir-raw-event.c +++ b/drivers/media/IR/ir-raw-event.c | |||
| @@ -279,9 +279,11 @@ int ir_raw_event_register(struct input_dev *input_dev) | |||
| 279 | "rc%u", (unsigned int)ir->devno); | 279 | "rc%u", (unsigned int)ir->devno); |
| 280 | 280 | ||
| 281 | if (IS_ERR(ir->raw->thread)) { | 281 | if (IS_ERR(ir->raw->thread)) { |
| 282 | int ret = PTR_ERR(ir->raw->thread); | ||
| 283 | |||
| 282 | kfree(ir->raw); | 284 | kfree(ir->raw); |
| 283 | ir->raw = NULL; | 285 | ir->raw = NULL; |
| 284 | return PTR_ERR(ir->raw->thread); | 286 | return ret; |
| 285 | } | 287 | } |
| 286 | 288 | ||
| 287 | mutex_lock(&ir_raw_handler_lock); | 289 | mutex_lock(&ir_raw_handler_lock); |
diff --git a/drivers/media/IR/ir-sysfs.c b/drivers/media/IR/ir-sysfs.c index 96dafc425c8e..46d42467f9b4 100644 --- a/drivers/media/IR/ir-sysfs.c +++ b/drivers/media/IR/ir-sysfs.c | |||
| @@ -67,13 +67,14 @@ static ssize_t show_protocols(struct device *d, | |||
| 67 | char *tmp = buf; | 67 | char *tmp = buf; |
| 68 | int i; | 68 | int i; |
| 69 | 69 | ||
| 70 | if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) { | 70 | if (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_SCANCODE) { |
| 71 | enabled = ir_dev->rc_tab.ir_type; | 71 | enabled = ir_dev->rc_tab.ir_type; |
| 72 | allowed = ir_dev->props->allowed_protos; | 72 | allowed = ir_dev->props->allowed_protos; |
| 73 | } else { | 73 | } else if (ir_dev->raw) { |
| 74 | enabled = ir_dev->raw->enabled_protocols; | 74 | enabled = ir_dev->raw->enabled_protocols; |
| 75 | allowed = ir_raw_get_allowed_protocols(); | 75 | allowed = ir_raw_get_allowed_protocols(); |
| 76 | } | 76 | } else |
| 77 | return sprintf(tmp, "[builtin]\n"); | ||
| 77 | 78 | ||
| 78 | IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n", | 79 | IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n", |
| 79 | (long long)allowed, | 80 | (long long)allowed, |
| @@ -121,10 +122,14 @@ static ssize_t store_protocols(struct device *d, | |||
| 121 | int rc, i, count = 0; | 122 | int rc, i, count = 0; |
| 122 | unsigned long flags; | 123 | unsigned long flags; |
| 123 | 124 | ||
| 124 | if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) | 125 | if (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_SCANCODE) |
| 125 | type = ir_dev->rc_tab.ir_type; | 126 | type = ir_dev->rc_tab.ir_type; |
| 126 | else | 127 | else if (ir_dev->raw) |
| 127 | type = ir_dev->raw->enabled_protocols; | 128 | type = ir_dev->raw->enabled_protocols; |
| 129 | else { | ||
| 130 | IR_dprintk(1, "Protocol switching not supported\n"); | ||
| 131 | return -EINVAL; | ||
| 132 | } | ||
| 128 | 133 | ||
| 129 | while ((tmp = strsep((char **) &data, " \n")) != NULL) { | 134 | while ((tmp = strsep((char **) &data, " \n")) != NULL) { |
| 130 | if (!*tmp) | 135 | if (!*tmp) |
| @@ -185,7 +190,7 @@ static ssize_t store_protocols(struct device *d, | |||
| 185 | } | 190 | } |
| 186 | } | 191 | } |
| 187 | 192 | ||
| 188 | if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) { | 193 | if (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_SCANCODE) { |
| 189 | spin_lock_irqsave(&ir_dev->rc_tab.lock, flags); | 194 | spin_lock_irqsave(&ir_dev->rc_tab.lock, flags); |
| 190 | ir_dev->rc_tab.ir_type = type; | 195 | ir_dev->rc_tab.ir_type = type; |
| 191 | spin_unlock_irqrestore(&ir_dev->rc_tab.lock, flags); | 196 | spin_unlock_irqrestore(&ir_dev->rc_tab.lock, flags); |
diff --git a/drivers/media/IR/keymaps/rc-rc6-mce.c b/drivers/media/IR/keymaps/rc-rc6-mce.c index 64264f7f838f..39557ad401b6 100644 --- a/drivers/media/IR/keymaps/rc-rc6-mce.c +++ b/drivers/media/IR/keymaps/rc-rc6-mce.c | |||
| @@ -19,6 +19,7 @@ static struct ir_scancode rc6_mce[] = { | |||
| 19 | 19 | ||
| 20 | { 0x800f0416, KEY_PLAY }, | 20 | { 0x800f0416, KEY_PLAY }, |
| 21 | { 0x800f0418, KEY_PAUSE }, | 21 | { 0x800f0418, KEY_PAUSE }, |
| 22 | { 0x800f046e, KEY_PLAYPAUSE }, | ||
| 22 | { 0x800f0419, KEY_STOP }, | 23 | { 0x800f0419, KEY_STOP }, |
| 23 | { 0x800f0417, KEY_RECORD }, | 24 | { 0x800f0417, KEY_RECORD }, |
| 24 | 25 | ||
| @@ -37,6 +38,8 @@ static struct ir_scancode rc6_mce[] = { | |||
| 37 | { 0x800f0411, KEY_VOLUMEDOWN }, | 38 | { 0x800f0411, KEY_VOLUMEDOWN }, |
| 38 | { 0x800f0412, KEY_CHANNELUP }, | 39 | { 0x800f0412, KEY_CHANNELUP }, |
| 39 | { 0x800f0413, KEY_CHANNELDOWN }, | 40 | { 0x800f0413, KEY_CHANNELDOWN }, |
| 41 | { 0x800f043a, KEY_BRIGHTNESSUP }, | ||
| 42 | { 0x800f0480, KEY_BRIGHTNESSDOWN }, | ||
| 40 | 43 | ||
| 41 | { 0x800f0401, KEY_NUMERIC_1 }, | 44 | { 0x800f0401, KEY_NUMERIC_1 }, |
| 42 | { 0x800f0402, KEY_NUMERIC_2 }, | 45 | { 0x800f0402, KEY_NUMERIC_2 }, |
diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c index ac6bb2c01a48..bc620e10ef77 100644 --- a/drivers/media/IR/mceusb.c +++ b/drivers/media/IR/mceusb.c | |||
| @@ -120,6 +120,10 @@ static struct usb_device_id mceusb_dev_table[] = { | |||
| 120 | { USB_DEVICE(VENDOR_PHILIPS, 0x0613) }, | 120 | { USB_DEVICE(VENDOR_PHILIPS, 0x0613) }, |
| 121 | /* Philips eHome Infrared Transceiver */ | 121 | /* Philips eHome Infrared Transceiver */ |
| 122 | { USB_DEVICE(VENDOR_PHILIPS, 0x0815) }, | 122 | { USB_DEVICE(VENDOR_PHILIPS, 0x0815) }, |
| 123 | /* Philips/Spinel plus IR transceiver for ASUS */ | ||
| 124 | { USB_DEVICE(VENDOR_PHILIPS, 0x206c) }, | ||
| 125 | /* Philips/Spinel plus IR transceiver for ASUS */ | ||
| 126 | { USB_DEVICE(VENDOR_PHILIPS, 0x2088) }, | ||
| 123 | /* Realtek MCE IR Receiver */ | 127 | /* Realtek MCE IR Receiver */ |
| 124 | { USB_DEVICE(VENDOR_REALTEK, 0x0161) }, | 128 | { USB_DEVICE(VENDOR_REALTEK, 0x0161) }, |
| 125 | /* SMK/Toshiba G83C0004D410 */ | 129 | /* SMK/Toshiba G83C0004D410 */ |
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c index fe818348b8a3..48397f103d32 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_core.c +++ b/drivers/media/dvb/dvb-usb/dib0700_core.c | |||
| @@ -673,9 +673,6 @@ static int dib0700_probe(struct usb_interface *intf, | |||
| 673 | else | 673 | else |
| 674 | dev->props.rc.core.bulk_mode = false; | 674 | dev->props.rc.core.bulk_mode = false; |
| 675 | 675 | ||
| 676 | /* Need a higher delay, to avoid wrong repeat */ | ||
| 677 | dev->rc_input_dev->rep[REP_DELAY] = 500; | ||
| 678 | |||
| 679 | dib0700_rc_setup(dev); | 676 | dib0700_rc_setup(dev); |
| 680 | 677 | ||
| 681 | return 0; | 678 | return 0; |
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index f634d2e784b2..e06acd1fecb6 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c | |||
| @@ -940,6 +940,58 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) | |||
| 940 | return adap->fe == NULL ? -ENODEV : 0; | 940 | return adap->fe == NULL ? -ENODEV : 0; |
| 941 | } | 941 | } |
| 942 | 942 | ||
| 943 | /* STK7770P */ | ||
| 944 | static struct dib7000p_config dib7770p_dib7000p_config = { | ||
| 945 | .output_mpeg2_in_188_bytes = 1, | ||
| 946 | |||
| 947 | .agc_config_count = 1, | ||
| 948 | .agc = &dib7070_agc_config, | ||
| 949 | .bw = &dib7070_bw_config_12_mhz, | ||
| 950 | .tuner_is_baseband = 1, | ||
| 951 | .spur_protect = 1, | ||
| 952 | |||
| 953 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, | ||
| 954 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, | ||
| 955 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, | ||
| 956 | |||
| 957 | .hostbus_diversity = 1, | ||
| 958 | .enable_current_mirror = 1, | ||
| 959 | .disable_sample_and_hold = 0, | ||
| 960 | }; | ||
| 961 | |||
| 962 | static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap) | ||
| 963 | { | ||
| 964 | struct usb_device_descriptor *p = &adap->dev->udev->descriptor; | ||
| 965 | if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) && | ||
| 966 | p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E)) | ||
| 967 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); | ||
| 968 | else | ||
| 969 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); | ||
| 970 | msleep(10); | ||
| 971 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); | ||
| 972 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); | ||
| 973 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); | ||
| 974 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); | ||
| 975 | |||
| 976 | dib0700_ctrl_clock(adap->dev, 72, 1); | ||
| 977 | |||
| 978 | msleep(10); | ||
| 979 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); | ||
| 980 | msleep(10); | ||
| 981 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | ||
| 982 | |||
| 983 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, | ||
| 984 | &dib7770p_dib7000p_config) != 0) { | ||
| 985 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", | ||
| 986 | __func__); | ||
| 987 | return -ENODEV; | ||
| 988 | } | ||
| 989 | |||
| 990 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, | ||
| 991 | &dib7770p_dib7000p_config); | ||
| 992 | return adap->fe == NULL ? -ENODEV : 0; | ||
| 993 | } | ||
| 994 | |||
| 943 | /* DIB807x generic */ | 995 | /* DIB807x generic */ |
| 944 | static struct dibx000_agc_config dib807x_agc_config[2] = { | 996 | static struct dibx000_agc_config dib807x_agc_config[2] = { |
| 945 | { | 997 | { |
| @@ -1781,7 +1833,7 @@ struct usb_device_id dib0700_usb_id_table[] = { | |||
| 1781 | /* 60 */{ USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS_2) }, | 1833 | /* 60 */{ USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS_2) }, |
| 1782 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XPVR) }, | 1834 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XPVR) }, |
| 1783 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XP) }, | 1835 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XP) }, |
| 1784 | { USB_DEVICE(USB_VID_PIXELVIEW, USB_PID_PIXELVIEW_SBTVD) }, | 1836 | { USB_DEVICE_VER(USB_VID_PIXELVIEW, USB_PID_PIXELVIEW_SBTVD, 0x000, 0x3f00) }, |
| 1785 | { USB_DEVICE(USB_VID_EVOLUTEPC, USB_PID_TVWAY_PLUS) }, | 1837 | { USB_DEVICE(USB_VID_EVOLUTEPC, USB_PID_TVWAY_PLUS) }, |
| 1786 | /* 65 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73ESE) }, | 1838 | /* 65 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73ESE) }, |
| 1787 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV282E) }, | 1839 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV282E) }, |
| @@ -2406,7 +2458,7 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
| 2406 | .pid_filter_count = 32, | 2458 | .pid_filter_count = 32, |
| 2407 | .pid_filter = stk70x0p_pid_filter, | 2459 | .pid_filter = stk70x0p_pid_filter, |
| 2408 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, | 2460 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
| 2409 | .frontend_attach = stk7070p_frontend_attach, | 2461 | .frontend_attach = stk7770p_frontend_attach, |
| 2410 | .tuner_attach = dib7770p_tuner_attach, | 2462 | .tuner_attach = dib7770p_tuner_attach, |
| 2411 | 2463 | ||
| 2412 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), | 2464 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
diff --git a/drivers/media/dvb/dvb-usb/opera1.c b/drivers/media/dvb/dvb-usb/opera1.c index 6b22ec64ab0c..f896337b4535 100644 --- a/drivers/media/dvb/dvb-usb/opera1.c +++ b/drivers/media/dvb/dvb-usb/opera1.c | |||
| @@ -483,9 +483,7 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev, | |||
| 483 | } | 483 | } |
| 484 | } | 484 | } |
| 485 | kfree(p); | 485 | kfree(p); |
| 486 | if (fw) { | 486 | release_firmware(fw); |
| 487 | release_firmware(fw); | ||
| 488 | } | ||
| 489 | return ret; | 487 | return ret; |
| 490 | } | 488 | } |
| 491 | 489 | ||
diff --git a/drivers/media/dvb/frontends/dib7000p.c b/drivers/media/dvb/frontends/dib7000p.c index 2e28b973dfd3..3aed0d433921 100644 --- a/drivers/media/dvb/frontends/dib7000p.c +++ b/drivers/media/dvb/frontends/dib7000p.c | |||
| @@ -260,6 +260,9 @@ static void dib7000p_set_adc_state(struct dib7000p_state *state, enum dibx000_ad | |||
| 260 | 260 | ||
| 261 | // dprintk( "908: %x, 909: %x\n", reg_908, reg_909); | 261 | // dprintk( "908: %x, 909: %x\n", reg_908, reg_909); |
| 262 | 262 | ||
| 263 | reg_909 |= (state->cfg.disable_sample_and_hold & 1) << 4; | ||
| 264 | reg_908 |= (state->cfg.enable_current_mirror & 1) << 7; | ||
| 265 | |||
| 263 | dib7000p_write_word(state, 908, reg_908); | 266 | dib7000p_write_word(state, 908, reg_908); |
| 264 | dib7000p_write_word(state, 909, reg_909); | 267 | dib7000p_write_word(state, 909, reg_909); |
| 265 | } | 268 | } |
| @@ -778,7 +781,10 @@ static void dib7000p_set_channel(struct dib7000p_state *state, struct dvb_fronte | |||
| 778 | default: | 781 | default: |
| 779 | case GUARD_INTERVAL_1_32: value *= 1; break; | 782 | case GUARD_INTERVAL_1_32: value *= 1; break; |
| 780 | } | 783 | } |
| 781 | state->div_sync_wait = (value * 3) / 2 + 32; // add 50% SFN margin + compensate for one DVSY-fifo TODO | 784 | if (state->cfg.diversity_delay == 0) |
| 785 | state->div_sync_wait = (value * 3) / 2 + 48; // add 50% SFN margin + compensate for one DVSY-fifo | ||
| 786 | else | ||
| 787 | state->div_sync_wait = (value * 3) / 2 + state->cfg.diversity_delay; // add 50% SFN margin + compensate for one DVSY-fifo | ||
| 782 | 788 | ||
| 783 | /* deactive the possibility of diversity reception if extended interleaver */ | 789 | /* deactive the possibility of diversity reception if extended interleaver */ |
| 784 | state->div_force_off = !1 && ch->u.ofdm.transmission_mode != TRANSMISSION_MODE_8K; | 790 | state->div_force_off = !1 && ch->u.ofdm.transmission_mode != TRANSMISSION_MODE_8K; |
diff --git a/drivers/media/dvb/frontends/dib7000p.h b/drivers/media/dvb/frontends/dib7000p.h index 805dd13a97ee..da17345bf5bd 100644 --- a/drivers/media/dvb/frontends/dib7000p.h +++ b/drivers/media/dvb/frontends/dib7000p.h | |||
| @@ -33,6 +33,11 @@ struct dib7000p_config { | |||
| 33 | int (*agc_control) (struct dvb_frontend *, u8 before); | 33 | int (*agc_control) (struct dvb_frontend *, u8 before); |
| 34 | 34 | ||
| 35 | u8 output_mode; | 35 | u8 output_mode; |
| 36 | u8 disable_sample_and_hold : 1; | ||
| 37 | |||
| 38 | u8 enable_current_mirror : 1; | ||
| 39 | u8 diversity_delay; | ||
| 40 | |||
| 36 | }; | 41 | }; |
| 37 | 42 | ||
| 38 | #define DEFAULT_DIB7000P_I2C_ADDRESS 18 | 43 | #define DEFAULT_DIB7000P_I2C_ADDRESS 18 |
diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c index d93468cd3a85..ff3b0fa901b3 100644 --- a/drivers/media/dvb/siano/smscoreapi.c +++ b/drivers/media/dvb/siano/smscoreapi.c | |||
| @@ -1098,33 +1098,26 @@ EXPORT_SYMBOL_GPL(smscore_onresponse); | |||
| 1098 | * | 1098 | * |
| 1099 | * @return pointer to descriptor on success, NULL on error. | 1099 | * @return pointer to descriptor on success, NULL on error. |
| 1100 | */ | 1100 | */ |
| 1101 | struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev) | 1101 | |
| 1102 | struct smscore_buffer_t *get_entry(struct smscore_device_t *coredev) | ||
| 1102 | { | 1103 | { |
| 1103 | struct smscore_buffer_t *cb = NULL; | 1104 | struct smscore_buffer_t *cb = NULL; |
| 1104 | unsigned long flags; | 1105 | unsigned long flags; |
| 1105 | 1106 | ||
| 1106 | DEFINE_WAIT(wait); | ||
| 1107 | |||
| 1108 | spin_lock_irqsave(&coredev->bufferslock, flags); | 1107 | spin_lock_irqsave(&coredev->bufferslock, flags); |
| 1109 | 1108 | if (!list_empty(&coredev->buffers)) { | |
| 1110 | /* This function must return a valid buffer, since the buffer list is | 1109 | cb = (struct smscore_buffer_t *) coredev->buffers.next; |
| 1111 | * finite, we check that there is an available buffer, if not, we wait | 1110 | list_del(&cb->entry); |
| 1112 | * until such buffer become available. | ||
| 1113 | */ | ||
| 1114 | |||
| 1115 | prepare_to_wait(&coredev->buffer_mng_waitq, &wait, TASK_INTERRUPTIBLE); | ||
| 1116 | if (list_empty(&coredev->buffers)) { | ||
| 1117 | spin_unlock_irqrestore(&coredev->bufferslock, flags); | ||
| 1118 | schedule(); | ||
| 1119 | spin_lock_irqsave(&coredev->bufferslock, flags); | ||
| 1120 | } | 1111 | } |
| 1112 | spin_unlock_irqrestore(&coredev->bufferslock, flags); | ||
| 1113 | return cb; | ||
| 1114 | } | ||
| 1121 | 1115 | ||
| 1122 | finish_wait(&coredev->buffer_mng_waitq, &wait); | 1116 | struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev) |
| 1123 | 1117 | { | |
| 1124 | cb = (struct smscore_buffer_t *) coredev->buffers.next; | 1118 | struct smscore_buffer_t *cb = NULL; |
| 1125 | list_del(&cb->entry); | ||
| 1126 | 1119 | ||
| 1127 | spin_unlock_irqrestore(&coredev->bufferslock, flags); | 1120 | wait_event(coredev->buffer_mng_waitq, (cb = get_entry(coredev))); |
| 1128 | 1121 | ||
| 1129 | return cb; | 1122 | return cb; |
| 1130 | } | 1123 | } |
diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c index 67a4ec8768a6..4ce541a5eb47 100644 --- a/drivers/media/radio/si470x/radio-si470x-i2c.c +++ b/drivers/media/radio/si470x/radio-si470x-i2c.c | |||
| @@ -395,7 +395,7 @@ static int __devinit si470x_i2c_probe(struct i2c_client *client, | |||
| 395 | radio->registers[POWERCFG] = POWERCFG_ENABLE; | 395 | radio->registers[POWERCFG] = POWERCFG_ENABLE; |
| 396 | if (si470x_set_register(radio, POWERCFG) < 0) { | 396 | if (si470x_set_register(radio, POWERCFG) < 0) { |
| 397 | retval = -EIO; | 397 | retval = -EIO; |
| 398 | goto err_all; | 398 | goto err_video; |
| 399 | } | 399 | } |
| 400 | msleep(110); | 400 | msleep(110); |
| 401 | 401 | ||
diff --git a/drivers/media/video/cx231xx/Makefile b/drivers/media/video/cx231xx/Makefile index 755dd0ce65ff..6f2b57384488 100644 --- a/drivers/media/video/cx231xx/Makefile +++ b/drivers/media/video/cx231xx/Makefile | |||
| @@ -11,4 +11,5 @@ EXTRA_CFLAGS += -Idrivers/media/video | |||
| 11 | EXTRA_CFLAGS += -Idrivers/media/common/tuners | 11 | EXTRA_CFLAGS += -Idrivers/media/common/tuners |
| 12 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core | 12 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core |
| 13 | EXTRA_CFLAGS += -Idrivers/media/dvb/frontends | 13 | EXTRA_CFLAGS += -Idrivers/media/dvb/frontends |
| 14 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-usb | ||
| 14 | 15 | ||
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c index 6bdc0ef18119..f2a4900014bc 100644 --- a/drivers/media/video/cx231xx/cx231xx-cards.c +++ b/drivers/media/video/cx231xx/cx231xx-cards.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <media/v4l2-chip-ident.h> | 32 | #include <media/v4l2-chip-ident.h> |
| 33 | 33 | ||
| 34 | #include <media/cx25840.h> | 34 | #include <media/cx25840.h> |
| 35 | #include "dvb-usb-ids.h" | ||
| 35 | #include "xc5000.h" | 36 | #include "xc5000.h" |
| 36 | 37 | ||
| 37 | #include "cx231xx.h" | 38 | #include "cx231xx.h" |
| @@ -175,6 +176,8 @@ struct usb_device_id cx231xx_id_table[] = { | |||
| 175 | .driver_info = CX231XX_BOARD_CNXT_RDE_250}, | 176 | .driver_info = CX231XX_BOARD_CNXT_RDE_250}, |
| 176 | {USB_DEVICE(0x0572, 0x58A1), | 177 | {USB_DEVICE(0x0572, 0x58A1), |
| 177 | .driver_info = CX231XX_BOARD_CNXT_RDU_250}, | 178 | .driver_info = CX231XX_BOARD_CNXT_RDU_250}, |
| 179 | {USB_DEVICE_VER(USB_VID_PIXELVIEW, USB_PID_PIXELVIEW_SBTVD, 0x4000,0x4fff), | ||
| 180 | .driver_info = CX231XX_BOARD_UNKNOWN}, | ||
| 178 | {}, | 181 | {}, |
| 179 | }; | 182 | }; |
| 180 | 183 | ||
| @@ -226,14 +229,16 @@ void cx231xx_pre_card_setup(struct cx231xx *dev) | |||
| 226 | dev->board.name, dev->model); | 229 | dev->board.name, dev->model); |
| 227 | 230 | ||
| 228 | /* set the direction for GPIO pins */ | 231 | /* set the direction for GPIO pins */ |
| 229 | cx231xx_set_gpio_direction(dev, dev->board.tuner_gpio->bit, 1); | 232 | if (dev->board.tuner_gpio) { |
| 230 | cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit, 1); | 233 | cx231xx_set_gpio_direction(dev, dev->board.tuner_gpio->bit, 1); |
| 231 | cx231xx_set_gpio_direction(dev, dev->board.tuner_sif_gpio, 1); | 234 | cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit, 1); |
| 235 | cx231xx_set_gpio_direction(dev, dev->board.tuner_sif_gpio, 1); | ||
| 232 | 236 | ||
| 233 | /* request some modules if any required */ | 237 | /* request some modules if any required */ |
| 234 | 238 | ||
| 235 | /* reset the Tuner */ | 239 | /* reset the Tuner */ |
| 236 | cx231xx_gpio_set(dev, dev->board.tuner_gpio); | 240 | cx231xx_gpio_set(dev, dev->board.tuner_gpio); |
| 241 | } | ||
| 237 | 242 | ||
| 238 | /* set the mode to Analog mode initially */ | 243 | /* set the mode to Analog mode initially */ |
| 239 | cx231xx_set_mode(dev, CX231XX_ANALOG_MODE); | 244 | cx231xx_set_mode(dev, CX231XX_ANALOG_MODE); |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 86ca8c2359dd..f5a3e74c3c7c 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
| @@ -1996,7 +1996,7 @@ static int cx25840_probe(struct i2c_client *client, | |||
| 1996 | 1996 | ||
| 1997 | state->volume = v4l2_ctrl_new_std(&state->hdl, | 1997 | state->volume = v4l2_ctrl_new_std(&state->hdl, |
| 1998 | &cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_VOLUME, | 1998 | &cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_VOLUME, |
| 1999 | 0, 65335, 65535 / 100, default_volume); | 1999 | 0, 65535, 65535 / 100, default_volume); |
| 2000 | state->mute = v4l2_ctrl_new_std(&state->hdl, | 2000 | state->mute = v4l2_ctrl_new_std(&state->hdl, |
| 2001 | &cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_MUTE, | 2001 | &cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_MUTE, |
| 2002 | 0, 1, 1, 0); | 2002 | 0, 1, 1, 0); |
diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig index 99dbae117591..0fa85cbefbb1 100644 --- a/drivers/media/video/cx88/Kconfig +++ b/drivers/media/video/cx88/Kconfig | |||
| @@ -17,7 +17,7 @@ config VIDEO_CX88 | |||
| 17 | 17 | ||
| 18 | config VIDEO_CX88_ALSA | 18 | config VIDEO_CX88_ALSA |
| 19 | tristate "Conexant 2388x DMA audio support" | 19 | tristate "Conexant 2388x DMA audio support" |
| 20 | depends on VIDEO_CX88 && SND && EXPERIMENTAL | 20 | depends on VIDEO_CX88 && SND |
| 21 | select SND_PCM | 21 | select SND_PCM |
| 22 | ---help--- | 22 | ---help--- |
| 23 | This is a video4linux driver for direct (DMA) audio on | 23 | This is a video4linux driver for direct (DMA) audio on |
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index b9846106913e..78abc1c1f9d5 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
| @@ -223,6 +223,7 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev, | |||
| 223 | usb_rcvintpipe(dev, ep->bEndpointAddress), | 223 | usb_rcvintpipe(dev, ep->bEndpointAddress), |
| 224 | buffer, buffer_len, | 224 | buffer, buffer_len, |
| 225 | int_irq, (void *)gspca_dev, interval); | 225 | int_irq, (void *)gspca_dev, interval); |
| 226 | urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | ||
| 226 | gspca_dev->int_urb = urb; | 227 | gspca_dev->int_urb = urb; |
| 227 | ret = usb_submit_urb(urb, GFP_KERNEL); | 228 | ret = usb_submit_urb(urb, GFP_KERNEL); |
| 228 | if (ret < 0) { | 229 | if (ret < 0) { |
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index 83a718f0f3f9..9052d5702556 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c | |||
| @@ -2357,8 +2357,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
| 2357 | (data[33] << 10); | 2357 | (data[33] << 10); |
| 2358 | avg_lum >>= 9; | 2358 | avg_lum >>= 9; |
| 2359 | atomic_set(&sd->avg_lum, avg_lum); | 2359 | atomic_set(&sd->avg_lum, avg_lum); |
| 2360 | gspca_frame_add(gspca_dev, LAST_PACKET, | 2360 | gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0); |
| 2361 | data, len); | ||
| 2362 | return; | 2361 | return; |
| 2363 | } | 2362 | } |
| 2364 | if (gspca_dev->last_packet_type == LAST_PACKET) { | 2363 | if (gspca_dev->last_packet_type == LAST_PACKET) { |
diff --git a/drivers/media/video/ivtv/ivtvfb.c b/drivers/media/video/ivtv/ivtvfb.c index be03a712731c..f0316d02f09f 100644 --- a/drivers/media/video/ivtv/ivtvfb.c +++ b/drivers/media/video/ivtv/ivtvfb.c | |||
| @@ -466,6 +466,8 @@ static int ivtvfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long ar | |||
| 466 | struct fb_vblank vblank; | 466 | struct fb_vblank vblank; |
| 467 | u32 trace; | 467 | u32 trace; |
| 468 | 468 | ||
| 469 | memset(&vblank, 0, sizeof(struct fb_vblank)); | ||
| 470 | |||
| 469 | vblank.flags = FB_VBLANK_HAVE_COUNT |FB_VBLANK_HAVE_VCOUNT | | 471 | vblank.flags = FB_VBLANK_HAVE_COUNT |FB_VBLANK_HAVE_VCOUNT | |
| 470 | FB_VBLANK_HAVE_VSYNC; | 472 | FB_VBLANK_HAVE_VSYNC; |
| 471 | trace = read_reg(IVTV_REG_DEC_LINE_FIELD) >> 16; | 473 | trace = read_reg(IVTV_REG_DEC_LINE_FIELD) >> 16; |
diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c index 4525335f9bd4..a7210d981388 100644 --- a/drivers/media/video/mem2mem_testdev.c +++ b/drivers/media/video/mem2mem_testdev.c | |||
| @@ -239,7 +239,7 @@ static int device_process(struct m2mtest_ctx *ctx, | |||
| 239 | return -EFAULT; | 239 | return -EFAULT; |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | if (in_buf->vb.size < out_buf->vb.size) { | 242 | if (in_buf->vb.size > out_buf->vb.size) { |
| 243 | v4l2_err(&dev->v4l2_dev, "Output buffer is too small\n"); | 243 | v4l2_err(&dev->v4l2_dev, "Output buffer is too small\n"); |
| 244 | return -EINVAL; | 244 | return -EINVAL; |
| 245 | } | 245 | } |
| @@ -1014,6 +1014,7 @@ static int m2mtest_remove(struct platform_device *pdev) | |||
| 1014 | v4l2_m2m_release(dev->m2m_dev); | 1014 | v4l2_m2m_release(dev->m2m_dev); |
| 1015 | del_timer_sync(&dev->timer); | 1015 | del_timer_sync(&dev->timer); |
| 1016 | video_unregister_device(dev->vfd); | 1016 | video_unregister_device(dev->vfd); |
| 1017 | video_device_release(dev->vfd); | ||
| 1017 | v4l2_device_unregister(&dev->v4l2_dev); | 1018 | v4l2_device_unregister(&dev->v4l2_dev); |
| 1018 | kfree(dev); | 1019 | kfree(dev); |
| 1019 | 1020 | ||
diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index 758a4db27d65..c71af4e0e517 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c | |||
| @@ -447,6 +447,9 @@ static int mt9m111_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) | |||
| 447 | dev_dbg(&client->dev, "%s left=%d, top=%d, width=%d, height=%d\n", | 447 | dev_dbg(&client->dev, "%s left=%d, top=%d, width=%d, height=%d\n", |
| 448 | __func__, rect.left, rect.top, rect.width, rect.height); | 448 | __func__, rect.left, rect.top, rect.width, rect.height); |
| 449 | 449 | ||
| 450 | if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | ||
| 451 | return -EINVAL; | ||
| 452 | |||
| 450 | ret = mt9m111_make_rect(client, &rect); | 453 | ret = mt9m111_make_rect(client, &rect); |
| 451 | if (!ret) | 454 | if (!ret) |
| 452 | mt9m111->rect = rect; | 455 | mt9m111->rect = rect; |
| @@ -466,12 +469,14 @@ static int mt9m111_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) | |||
| 466 | 469 | ||
| 467 | static int mt9m111_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a) | 470 | static int mt9m111_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a) |
| 468 | { | 471 | { |
| 472 | if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | ||
| 473 | return -EINVAL; | ||
| 474 | |||
| 469 | a->bounds.left = MT9M111_MIN_DARK_COLS; | 475 | a->bounds.left = MT9M111_MIN_DARK_COLS; |
| 470 | a->bounds.top = MT9M111_MIN_DARK_ROWS; | 476 | a->bounds.top = MT9M111_MIN_DARK_ROWS; |
| 471 | a->bounds.width = MT9M111_MAX_WIDTH; | 477 | a->bounds.width = MT9M111_MAX_WIDTH; |
| 472 | a->bounds.height = MT9M111_MAX_HEIGHT; | 478 | a->bounds.height = MT9M111_MAX_HEIGHT; |
| 473 | a->defrect = a->bounds; | 479 | a->defrect = a->bounds; |
| 474 | a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | ||
| 475 | a->pixelaspect.numerator = 1; | 480 | a->pixelaspect.numerator = 1; |
| 476 | a->pixelaspect.denominator = 1; | 481 | a->pixelaspect.denominator = 1; |
| 477 | 482 | ||
| @@ -487,6 +492,7 @@ static int mt9m111_g_fmt(struct v4l2_subdev *sd, | |||
| 487 | mf->width = mt9m111->rect.width; | 492 | mf->width = mt9m111->rect.width; |
| 488 | mf->height = mt9m111->rect.height; | 493 | mf->height = mt9m111->rect.height; |
| 489 | mf->code = mt9m111->fmt->code; | 494 | mf->code = mt9m111->fmt->code; |
| 495 | mf->colorspace = mt9m111->fmt->colorspace; | ||
| 490 | mf->field = V4L2_FIELD_NONE; | 496 | mf->field = V4L2_FIELD_NONE; |
| 491 | 497 | ||
| 492 | return 0; | 498 | return 0; |
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c index e7cd23cd6394..b48473c7896b 100644 --- a/drivers/media/video/mt9v022.c +++ b/drivers/media/video/mt9v022.c | |||
| @@ -402,9 +402,6 @@ static int mt9v022_s_fmt(struct v4l2_subdev *sd, | |||
| 402 | if (mt9v022->model != V4L2_IDENT_MT9V022IX7ATC) | 402 | if (mt9v022->model != V4L2_IDENT_MT9V022IX7ATC) |
| 403 | return -EINVAL; | 403 | return -EINVAL; |
| 404 | break; | 404 | break; |
| 405 | case 0: | ||
| 406 | /* No format change, only geometry */ | ||
| 407 | break; | ||
| 408 | default: | 405 | default: |
| 409 | return -EINVAL; | 406 | return -EINVAL; |
| 410 | } | 407 | } |
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index 66ff174151b5..b6ea67221d1d 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c | |||
| @@ -378,6 +378,9 @@ static void mx25_camera_frame_done(struct mx2_camera_dev *pcdev, int fb, | |||
| 378 | 378 | ||
| 379 | spin_lock_irqsave(&pcdev->lock, flags); | 379 | spin_lock_irqsave(&pcdev->lock, flags); |
| 380 | 380 | ||
| 381 | if (*fb_active == NULL) | ||
| 382 | goto out; | ||
| 383 | |||
| 381 | vb = &(*fb_active)->vb; | 384 | vb = &(*fb_active)->vb; |
| 382 | dev_dbg(pcdev->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, | 385 | dev_dbg(pcdev->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, |
| 383 | vb, vb->baddr, vb->bsize); | 386 | vb, vb->baddr, vb->bsize); |
| @@ -402,6 +405,7 @@ static void mx25_camera_frame_done(struct mx2_camera_dev *pcdev, int fb, | |||
| 402 | 405 | ||
| 403 | *fb_active = buf; | 406 | *fb_active = buf; |
| 404 | 407 | ||
| 408 | out: | ||
| 405 | spin_unlock_irqrestore(&pcdev->lock, flags); | 409 | spin_unlock_irqrestore(&pcdev->lock, flags); |
| 406 | } | 410 | } |
| 407 | 411 | ||
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c index 1b992b847198..55ea914c7fcd 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c +++ b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c | |||
| @@ -513,7 +513,7 @@ int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *cptr, | |||
| 513 | if (ret >= 0) { | 513 | if (ret >= 0) { |
| 514 | ret = pvr2_ctrl_range_check(cptr,*valptr); | 514 | ret = pvr2_ctrl_range_check(cptr,*valptr); |
| 515 | } | 515 | } |
| 516 | if (maskptr) *maskptr = ~0; | 516 | *maskptr = ~0; |
| 517 | } else if (cptr->info->type == pvr2_ctl_bool) { | 517 | } else if (cptr->info->type == pvr2_ctl_bool) { |
| 518 | ret = parse_token(ptr,len,valptr,boolNames, | 518 | ret = parse_token(ptr,len,valptr,boolNames, |
| 519 | ARRAY_SIZE(boolNames)); | 519 | ARRAY_SIZE(boolNames)); |
| @@ -522,7 +522,7 @@ int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *cptr, | |||
| 522 | } else if (ret == 0) { | 522 | } else if (ret == 0) { |
| 523 | *valptr = (*valptr & 1) ? !0 : 0; | 523 | *valptr = (*valptr & 1) ? !0 : 0; |
| 524 | } | 524 | } |
| 525 | if (maskptr) *maskptr = 1; | 525 | *maskptr = 1; |
| 526 | } else if (cptr->info->type == pvr2_ctl_enum) { | 526 | } else if (cptr->info->type == pvr2_ctl_enum) { |
| 527 | ret = parse_token( | 527 | ret = parse_token( |
| 528 | ptr,len,valptr, | 528 | ptr,len,valptr, |
| @@ -531,7 +531,7 @@ int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *cptr, | |||
| 531 | if (ret >= 0) { | 531 | if (ret >= 0) { |
| 532 | ret = pvr2_ctrl_range_check(cptr,*valptr); | 532 | ret = pvr2_ctrl_range_check(cptr,*valptr); |
| 533 | } | 533 | } |
| 534 | if (maskptr) *maskptr = ~0; | 534 | *maskptr = ~0; |
| 535 | } else if (cptr->info->type == pvr2_ctl_bitmask) { | 535 | } else if (cptr->info->type == pvr2_ctl_bitmask) { |
| 536 | ret = parse_tlist( | 536 | ret = parse_tlist( |
| 537 | ptr,len,maskptr,valptr, | 537 | ptr,len,maskptr,valptr, |
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c index b151c7be8a50..6961c55baf9b 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.c +++ b/drivers/media/video/s5p-fimc/fimc-core.c | |||
| @@ -393,6 +393,37 @@ static void fimc_set_yuv_order(struct fimc_ctx *ctx) | |||
| 393 | dbg("ctx->out_order_1p= %d", ctx->out_order_1p); | 393 | dbg("ctx->out_order_1p= %d", ctx->out_order_1p); |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | static void fimc_prepare_dma_offset(struct fimc_ctx *ctx, struct fimc_frame *f) | ||
| 397 | { | ||
| 398 | struct samsung_fimc_variant *variant = ctx->fimc_dev->variant; | ||
| 399 | |||
| 400 | f->dma_offset.y_h = f->offs_h; | ||
| 401 | if (!variant->pix_hoff) | ||
| 402 | f->dma_offset.y_h *= (f->fmt->depth >> 3); | ||
| 403 | |||
| 404 | f->dma_offset.y_v = f->offs_v; | ||
| 405 | |||
| 406 | f->dma_offset.cb_h = f->offs_h; | ||
| 407 | f->dma_offset.cb_v = f->offs_v; | ||
| 408 | |||
| 409 | f->dma_offset.cr_h = f->offs_h; | ||
| 410 | f->dma_offset.cr_v = f->offs_v; | ||
| 411 | |||
| 412 | if (!variant->pix_hoff) { | ||
| 413 | if (f->fmt->planes_cnt == 3) { | ||
| 414 | f->dma_offset.cb_h >>= 1; | ||
| 415 | f->dma_offset.cr_h >>= 1; | ||
| 416 | } | ||
| 417 | if (f->fmt->color == S5P_FIMC_YCBCR420) { | ||
| 418 | f->dma_offset.cb_v >>= 1; | ||
| 419 | f->dma_offset.cr_v >>= 1; | ||
| 420 | } | ||
| 421 | } | ||
| 422 | |||
| 423 | dbg("in_offset: color= %d, y_h= %d, y_v= %d", | ||
| 424 | f->fmt->color, f->dma_offset.y_h, f->dma_offset.y_v); | ||
| 425 | } | ||
| 426 | |||
| 396 | /** | 427 | /** |
| 397 | * fimc_prepare_config - check dimensions, operation and color mode | 428 | * fimc_prepare_config - check dimensions, operation and color mode |
| 398 | * and pre-calculate offset and the scaling coefficients. | 429 | * and pre-calculate offset and the scaling coefficients. |
| @@ -406,7 +437,6 @@ static int fimc_prepare_config(struct fimc_ctx *ctx, u32 flags) | |||
| 406 | { | 437 | { |
| 407 | struct fimc_frame *s_frame, *d_frame; | 438 | struct fimc_frame *s_frame, *d_frame; |
| 408 | struct fimc_vid_buffer *buf = NULL; | 439 | struct fimc_vid_buffer *buf = NULL; |
| 409 | struct samsung_fimc_variant *variant = ctx->fimc_dev->variant; | ||
| 410 | int ret = 0; | 440 | int ret = 0; |
| 411 | 441 | ||
| 412 | s_frame = &ctx->s_frame; | 442 | s_frame = &ctx->s_frame; |
| @@ -419,61 +449,16 @@ static int fimc_prepare_config(struct fimc_ctx *ctx, u32 flags) | |||
| 419 | swap(d_frame->width, d_frame->height); | 449 | swap(d_frame->width, d_frame->height); |
| 420 | } | 450 | } |
| 421 | 451 | ||
| 422 | /* Prepare the output offset ratios for scaler. */ | 452 | /* Prepare the DMA offset ratios for scaler. */ |
| 423 | d_frame->dma_offset.y_h = d_frame->offs_h; | 453 | fimc_prepare_dma_offset(ctx, &ctx->s_frame); |
| 424 | if (!variant->pix_hoff) | 454 | fimc_prepare_dma_offset(ctx, &ctx->d_frame); |
| 425 | d_frame->dma_offset.y_h *= (d_frame->fmt->depth >> 3); | ||
| 426 | |||
| 427 | d_frame->dma_offset.y_v = d_frame->offs_v; | ||
| 428 | |||
| 429 | d_frame->dma_offset.cb_h = d_frame->offs_h; | ||
| 430 | d_frame->dma_offset.cb_v = d_frame->offs_v; | ||
| 431 | |||
| 432 | d_frame->dma_offset.cr_h = d_frame->offs_h; | ||
| 433 | d_frame->dma_offset.cr_v = d_frame->offs_v; | ||
| 434 | 455 | ||
| 435 | if (!variant->pix_hoff && d_frame->fmt->planes_cnt == 3) { | ||
| 436 | d_frame->dma_offset.cb_h >>= 1; | ||
| 437 | d_frame->dma_offset.cb_v >>= 1; | ||
| 438 | d_frame->dma_offset.cr_h >>= 1; | ||
| 439 | d_frame->dma_offset.cr_v >>= 1; | ||
| 440 | } | ||
| 441 | |||
| 442 | dbg("out offset: color= %d, y_h= %d, y_v= %d", | ||
| 443 | d_frame->fmt->color, | ||
| 444 | d_frame->dma_offset.y_h, d_frame->dma_offset.y_v); | ||
| 445 | |||
| 446 | /* Prepare the input offset ratios for scaler. */ | ||
| 447 | s_frame->dma_offset.y_h = s_frame->offs_h; | ||
| 448 | if (!variant->pix_hoff) | ||
| 449 | s_frame->dma_offset.y_h *= (s_frame->fmt->depth >> 3); | ||
| 450 | s_frame->dma_offset.y_v = s_frame->offs_v; | ||
| 451 | |||
| 452 | s_frame->dma_offset.cb_h = s_frame->offs_h; | ||
| 453 | s_frame->dma_offset.cb_v = s_frame->offs_v; | ||
| 454 | |||
| 455 | s_frame->dma_offset.cr_h = s_frame->offs_h; | ||
| 456 | s_frame->dma_offset.cr_v = s_frame->offs_v; | ||
| 457 | |||
| 458 | if (!variant->pix_hoff && s_frame->fmt->planes_cnt == 3) { | ||
| 459 | s_frame->dma_offset.cb_h >>= 1; | ||
| 460 | s_frame->dma_offset.cb_v >>= 1; | ||
| 461 | s_frame->dma_offset.cr_h >>= 1; | ||
| 462 | s_frame->dma_offset.cr_v >>= 1; | ||
| 463 | } | ||
| 464 | |||
| 465 | dbg("in offset: color= %d, y_h= %d, y_v= %d", | ||
| 466 | s_frame->fmt->color, s_frame->dma_offset.y_h, | ||
| 467 | s_frame->dma_offset.y_v); | ||
| 468 | |||
| 469 | fimc_set_yuv_order(ctx); | ||
| 470 | |||
| 471 | /* Check against the scaler ratio. */ | ||
| 472 | if (s_frame->height > (SCALER_MAX_VRATIO * d_frame->height) || | 456 | if (s_frame->height > (SCALER_MAX_VRATIO * d_frame->height) || |
| 473 | s_frame->width > (SCALER_MAX_HRATIO * d_frame->width)) { | 457 | s_frame->width > (SCALER_MAX_HRATIO * d_frame->width)) { |
| 474 | err("out of scaler range"); | 458 | err("out of scaler range"); |
| 475 | return -EINVAL; | 459 | return -EINVAL; |
| 476 | } | 460 | } |
| 461 | fimc_set_yuv_order(ctx); | ||
| 477 | } | 462 | } |
| 478 | 463 | ||
| 479 | /* Input DMA mode is not allowed when the scaler is disabled. */ | 464 | /* Input DMA mode is not allowed when the scaler is disabled. */ |
| @@ -822,7 +807,8 @@ static int fimc_m2m_s_fmt(struct file *file, void *priv, struct v4l2_format *f) | |||
| 822 | } else { | 807 | } else { |
| 823 | v4l2_err(&ctx->fimc_dev->m2m.v4l2_dev, | 808 | v4l2_err(&ctx->fimc_dev->m2m.v4l2_dev, |
| 824 | "Wrong buffer/video queue type (%d)\n", f->type); | 809 | "Wrong buffer/video queue type (%d)\n", f->type); |
| 825 | return -EINVAL; | 810 | ret = -EINVAL; |
| 811 | goto s_fmt_out; | ||
| 826 | } | 812 | } |
| 827 | 813 | ||
| 828 | pix = &f->fmt.pix; | 814 | pix = &f->fmt.pix; |
| @@ -1414,8 +1400,10 @@ static int fimc_probe(struct platform_device *pdev) | |||
| 1414 | } | 1400 | } |
| 1415 | 1401 | ||
| 1416 | fimc->work_queue = create_workqueue(dev_name(&fimc->pdev->dev)); | 1402 | fimc->work_queue = create_workqueue(dev_name(&fimc->pdev->dev)); |
| 1417 | if (!fimc->work_queue) | 1403 | if (!fimc->work_queue) { |
| 1404 | ret = -ENOMEM; | ||
| 1418 | goto err_irq; | 1405 | goto err_irq; |
| 1406 | } | ||
| 1419 | 1407 | ||
| 1420 | ret = fimc_register_m2m_device(fimc); | 1408 | ret = fimc_register_m2m_device(fimc); |
| 1421 | if (ret) | 1409 | if (ret) |
| @@ -1492,6 +1480,7 @@ static struct samsung_fimc_variant fimc2_variant_s5p = { | |||
| 1492 | }; | 1480 | }; |
| 1493 | 1481 | ||
| 1494 | static struct samsung_fimc_variant fimc01_variant_s5pv210 = { | 1482 | static struct samsung_fimc_variant fimc01_variant_s5pv210 = { |
| 1483 | .pix_hoff = 1, | ||
| 1495 | .has_inp_rot = 1, | 1484 | .has_inp_rot = 1, |
| 1496 | .has_out_rot = 1, | 1485 | .has_out_rot = 1, |
| 1497 | .min_inp_pixsize = 16, | 1486 | .min_inp_pixsize = 16, |
| @@ -1506,6 +1495,7 @@ static struct samsung_fimc_variant fimc01_variant_s5pv210 = { | |||
| 1506 | }; | 1495 | }; |
| 1507 | 1496 | ||
| 1508 | static struct samsung_fimc_variant fimc2_variant_s5pv210 = { | 1497 | static struct samsung_fimc_variant fimc2_variant_s5pv210 = { |
| 1498 | .pix_hoff = 1, | ||
| 1509 | .min_inp_pixsize = 16, | 1499 | .min_inp_pixsize = 16, |
| 1510 | .min_out_pixsize = 32, | 1500 | .min_out_pixsize = 32, |
| 1511 | 1501 | ||
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index ec697fcd406e..bb8d83d8ddaf 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
| @@ -4323,13 +4323,13 @@ struct saa7134_board saa7134_boards[] = { | |||
| 4323 | }, | 4323 | }, |
| 4324 | [SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM] = { | 4324 | [SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM] = { |
| 4325 | /* Beholder Intl. Ltd. 2008 */ | 4325 | /* Beholder Intl. Ltd. 2008 */ |
| 4326 | /*Dmitry Belimov <d.belimov@gmail.com> */ | 4326 | /* Dmitry Belimov <d.belimov@gmail.com> */ |
| 4327 | .name = "Beholder BeholdTV Columbus TVFM", | 4327 | .name = "Beholder BeholdTV Columbus TV/FM", |
| 4328 | .audio_clock = 0x00187de7, | 4328 | .audio_clock = 0x00187de7, |
| 4329 | .tuner_type = TUNER_ALPS_TSBE5_PAL, | 4329 | .tuner_type = TUNER_ALPS_TSBE5_PAL, |
| 4330 | .radio_type = UNSET, | 4330 | .radio_type = TUNER_TEA5767, |
| 4331 | .tuner_addr = ADDR_UNSET, | 4331 | .tuner_addr = 0xc2 >> 1, |
| 4332 | .radio_addr = ADDR_UNSET, | 4332 | .radio_addr = 0xc0 >> 1, |
| 4333 | .tda9887_conf = TDA9887_PRESENT, | 4333 | .tda9887_conf = TDA9887_PRESENT, |
| 4334 | .gpiomask = 0x000A8004, | 4334 | .gpiomask = 0x000A8004, |
| 4335 | .inputs = {{ | 4335 | .inputs = {{ |
diff --git a/drivers/media/video/saa7164/saa7164-buffer.c b/drivers/media/video/saa7164/saa7164-buffer.c index 5713f3a4b76c..ddd25d32723d 100644 --- a/drivers/media/video/saa7164/saa7164-buffer.c +++ b/drivers/media/video/saa7164/saa7164-buffer.c | |||
| @@ -136,10 +136,11 @@ ret: | |||
| 136 | int saa7164_buffer_dealloc(struct saa7164_tsport *port, | 136 | int saa7164_buffer_dealloc(struct saa7164_tsport *port, |
| 137 | struct saa7164_buffer *buf) | 137 | struct saa7164_buffer *buf) |
| 138 | { | 138 | { |
| 139 | struct saa7164_dev *dev = port->dev; | 139 | struct saa7164_dev *dev; |
| 140 | 140 | ||
| 141 | if ((buf == 0) || (port == 0)) | 141 | if (!buf || !port) |
| 142 | return SAA_ERR_BAD_PARAMETER; | 142 | return SAA_ERR_BAD_PARAMETER; |
| 143 | dev = port->dev; | ||
| 143 | 144 | ||
| 144 | dprintk(DBGLVL_BUF, "%s() deallocating buffer @ 0x%p\n", __func__, buf); | 145 | dprintk(DBGLVL_BUF, "%s() deallocating buffer @ 0x%p\n", __func__, buf); |
| 145 | 146 | ||
diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c index 8bdd940f32e6..2ac85d8984f0 100644 --- a/drivers/media/video/uvc/uvc_driver.c +++ b/drivers/media/video/uvc/uvc_driver.c | |||
| @@ -486,6 +486,12 @@ static int uvc_parse_format(struct uvc_device *dev, | |||
| 486 | max(frame->dwFrameInterval[0], | 486 | max(frame->dwFrameInterval[0], |
| 487 | frame->dwDefaultFrameInterval)); | 487 | frame->dwDefaultFrameInterval)); |
| 488 | 488 | ||
| 489 | if (dev->quirks & UVC_QUIRK_RESTRICT_FRAME_RATE) { | ||
| 490 | frame->bFrameIntervalType = 1; | ||
| 491 | frame->dwFrameInterval[0] = | ||
| 492 | frame->dwDefaultFrameInterval; | ||
| 493 | } | ||
| 494 | |||
| 489 | uvc_trace(UVC_TRACE_DESCR, "- %ux%u (%u.%u fps)\n", | 495 | uvc_trace(UVC_TRACE_DESCR, "- %ux%u (%u.%u fps)\n", |
| 490 | frame->wWidth, frame->wHeight, | 496 | frame->wWidth, frame->wHeight, |
| 491 | 10000000/frame->dwDefaultFrameInterval, | 497 | 10000000/frame->dwDefaultFrameInterval, |
| @@ -2026,6 +2032,15 @@ static struct usb_device_id uvc_ids[] = { | |||
| 2026 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC, | 2032 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC, |
| 2027 | .bInterfaceSubClass = 1, | 2033 | .bInterfaceSubClass = 1, |
| 2028 | .bInterfaceProtocol = 0 }, | 2034 | .bInterfaceProtocol = 0 }, |
| 2035 | /* Chicony CNF7129 (Asus EEE 100HE) */ | ||
| 2036 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | ||
| 2037 | | USB_DEVICE_ID_MATCH_INT_INFO, | ||
| 2038 | .idVendor = 0x04f2, | ||
| 2039 | .idProduct = 0xb071, | ||
| 2040 | .bInterfaceClass = USB_CLASS_VIDEO, | ||
| 2041 | .bInterfaceSubClass = 1, | ||
| 2042 | .bInterfaceProtocol = 0, | ||
| 2043 | .driver_info = UVC_QUIRK_RESTRICT_FRAME_RATE }, | ||
| 2029 | /* Alcor Micro AU3820 (Future Boy PC USB Webcam) */ | 2044 | /* Alcor Micro AU3820 (Future Boy PC USB Webcam) */ |
| 2030 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2045 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
| 2031 | | USB_DEVICE_ID_MATCH_INT_INFO, | 2046 | | USB_DEVICE_ID_MATCH_INT_INFO, |
| @@ -2091,6 +2106,15 @@ static struct usb_device_id uvc_ids[] = { | |||
| 2091 | .bInterfaceProtocol = 0, | 2106 | .bInterfaceProtocol = 0, |
| 2092 | .driver_info = UVC_QUIRK_PROBE_MINMAX | 2107 | .driver_info = UVC_QUIRK_PROBE_MINMAX |
| 2093 | | UVC_QUIRK_PROBE_DEF }, | 2108 | | UVC_QUIRK_PROBE_DEF }, |
| 2109 | /* IMC Networks (Medion Akoya) */ | ||
| 2110 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | ||
| 2111 | | USB_DEVICE_ID_MATCH_INT_INFO, | ||
| 2112 | .idVendor = 0x13d3, | ||
| 2113 | .idProduct = 0x5103, | ||
| 2114 | .bInterfaceClass = USB_CLASS_VIDEO, | ||
| 2115 | .bInterfaceSubClass = 1, | ||
| 2116 | .bInterfaceProtocol = 0, | ||
| 2117 | .driver_info = UVC_QUIRK_STREAM_NO_FID }, | ||
| 2094 | /* Syntek (HP Spartan) */ | 2118 | /* Syntek (HP Spartan) */ |
| 2095 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2119 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
| 2096 | | USB_DEVICE_ID_MATCH_INT_INFO, | 2120 | | USB_DEVICE_ID_MATCH_INT_INFO, |
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h index bdacf3beabf5..892e0e51916c 100644 --- a/drivers/media/video/uvc/uvcvideo.h +++ b/drivers/media/video/uvc/uvcvideo.h | |||
| @@ -182,6 +182,7 @@ struct uvc_xu_control { | |||
| 182 | #define UVC_QUIRK_IGNORE_SELECTOR_UNIT 0x00000020 | 182 | #define UVC_QUIRK_IGNORE_SELECTOR_UNIT 0x00000020 |
| 183 | #define UVC_QUIRK_FIX_BANDWIDTH 0x00000080 | 183 | #define UVC_QUIRK_FIX_BANDWIDTH 0x00000080 |
| 184 | #define UVC_QUIRK_PROBE_DEF 0x00000100 | 184 | #define UVC_QUIRK_PROBE_DEF 0x00000100 |
| 185 | #define UVC_QUIRK_RESTRICT_FRAME_RATE 0x00000200 | ||
| 185 | 186 | ||
| 186 | /* Format flags */ | 187 | /* Format flags */ |
| 187 | #define UVC_FMT_FLAG_COMPRESSED 0x00000001 | 188 | #define UVC_FMT_FLAG_COMPRESSED 0x00000001 |
diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c index 073f01390cdd..86294ed35c9b 100644 --- a/drivers/media/video/v4l2-compat-ioctl32.c +++ b/drivers/media/video/v4l2-compat-ioctl32.c | |||
| @@ -193,17 +193,24 @@ static int put_video_window32(struct video_window *kp, struct video_window32 __u | |||
| 193 | struct video_code32 { | 193 | struct video_code32 { |
| 194 | char loadwhat[16]; /* name or tag of file being passed */ | 194 | char loadwhat[16]; /* name or tag of file being passed */ |
| 195 | compat_int_t datasize; | 195 | compat_int_t datasize; |
| 196 | unsigned char *data; | 196 | compat_uptr_t data; |
| 197 | }; | 197 | }; |
| 198 | 198 | ||
| 199 | static int get_microcode32(struct video_code *kp, struct video_code32 __user *up) | 199 | static struct video_code __user *get_microcode32(struct video_code32 *kp) |
| 200 | { | 200 | { |
| 201 | if (!access_ok(VERIFY_READ, up, sizeof(struct video_code32)) || | 201 | struct video_code __user *up; |
| 202 | copy_from_user(kp->loadwhat, up->loadwhat, sizeof(up->loadwhat)) || | 202 | |
| 203 | get_user(kp->datasize, &up->datasize) || | 203 | up = compat_alloc_user_space(sizeof(*up)); |
| 204 | copy_from_user(kp->data, up->data, up->datasize)) | 204 | |
| 205 | return -EFAULT; | 205 | /* |
| 206 | return 0; | 206 | * NOTE! We don't actually care if these fail. If the |
| 207 | * user address is invalid, the native ioctl will do | ||
| 208 | * the error handling for us | ||
| 209 | */ | ||
| 210 | (void) copy_to_user(up->loadwhat, kp->loadwhat, sizeof(up->loadwhat)); | ||
| 211 | (void) put_user(kp->datasize, &up->datasize); | ||
| 212 | (void) put_user(compat_ptr(kp->data), &up->data); | ||
| 213 | return up; | ||
| 207 | } | 214 | } |
| 208 | 215 | ||
| 209 | #define VIDIOCGTUNER32 _IOWR('v', 4, struct video_tuner32) | 216 | #define VIDIOCGTUNER32 _IOWR('v', 4, struct video_tuner32) |
| @@ -739,7 +746,7 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar | |||
| 739 | struct video_tuner vt; | 746 | struct video_tuner vt; |
| 740 | struct video_buffer vb; | 747 | struct video_buffer vb; |
| 741 | struct video_window vw; | 748 | struct video_window vw; |
| 742 | struct video_code vc; | 749 | struct video_code32 vc; |
| 743 | struct video_audio va; | 750 | struct video_audio va; |
| 744 | #endif | 751 | #endif |
| 745 | struct v4l2_format v2f; | 752 | struct v4l2_format v2f; |
| @@ -818,8 +825,11 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar | |||
| 818 | break; | 825 | break; |
| 819 | 826 | ||
| 820 | case VIDIOCSMICROCODE: | 827 | case VIDIOCSMICROCODE: |
| 821 | err = get_microcode32(&karg.vc, up); | 828 | /* Copy the 32-bit "video_code32" to kernel space */ |
| 822 | compatible_arg = 0; | 829 | if (copy_from_user(&karg.vc, up, sizeof(karg.vc))) |
| 830 | return -EFAULT; | ||
| 831 | /* Convert the 32-bit version to a 64-bit version in user space */ | ||
| 832 | up = get_microcode32(&karg.vc); | ||
| 823 | break; | 833 | break; |
| 824 | 834 | ||
| 825 | case VIDIOCSFREQ: | 835 | case VIDIOCSFREQ: |
diff --git a/drivers/media/video/videobuf-dma-contig.c b/drivers/media/video/videobuf-dma-contig.c index 372b87efcd05..6ff9e4bac3ea 100644 --- a/drivers/media/video/videobuf-dma-contig.c +++ b/drivers/media/video/videobuf-dma-contig.c | |||
| @@ -393,8 +393,10 @@ void videobuf_dma_contig_free(struct videobuf_queue *q, | |||
| 393 | } | 393 | } |
| 394 | 394 | ||
| 395 | /* read() method */ | 395 | /* read() method */ |
| 396 | dma_free_coherent(q->dev, mem->size, mem->vaddr, mem->dma_handle); | 396 | if (mem->vaddr) { |
| 397 | mem->vaddr = NULL; | 397 | dma_free_coherent(q->dev, mem->size, mem->vaddr, mem->dma_handle); |
| 398 | mem->vaddr = NULL; | ||
| 399 | } | ||
| 398 | } | 400 | } |
| 399 | EXPORT_SYMBOL_GPL(videobuf_dma_contig_free); | 401 | EXPORT_SYMBOL_GPL(videobuf_dma_contig_free); |
| 400 | 402 | ||
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c index 06f9a9c2a39a..2ad0bc252b0e 100644 --- a/drivers/media/video/videobuf-dma-sg.c +++ b/drivers/media/video/videobuf-dma-sg.c | |||
| @@ -94,7 +94,7 @@ err: | |||
| 94 | * must free the memory. | 94 | * must free the memory. |
| 95 | */ | 95 | */ |
| 96 | static struct scatterlist *videobuf_pages_to_sg(struct page **pages, | 96 | static struct scatterlist *videobuf_pages_to_sg(struct page **pages, |
| 97 | int nr_pages, int offset) | 97 | int nr_pages, int offset, size_t size) |
| 98 | { | 98 | { |
| 99 | struct scatterlist *sglist; | 99 | struct scatterlist *sglist; |
| 100 | int i; | 100 | int i; |
| @@ -110,12 +110,14 @@ static struct scatterlist *videobuf_pages_to_sg(struct page **pages, | |||
| 110 | /* DMA to highmem pages might not work */ | 110 | /* DMA to highmem pages might not work */ |
| 111 | goto highmem; | 111 | goto highmem; |
| 112 | sg_set_page(&sglist[0], pages[0], PAGE_SIZE - offset, offset); | 112 | sg_set_page(&sglist[0], pages[0], PAGE_SIZE - offset, offset); |
| 113 | size -= PAGE_SIZE - offset; | ||
| 113 | for (i = 1; i < nr_pages; i++) { | 114 | for (i = 1; i < nr_pages; i++) { |
| 114 | if (NULL == pages[i]) | 115 | if (NULL == pages[i]) |
| 115 | goto nopage; | 116 | goto nopage; |
| 116 | if (PageHighMem(pages[i])) | 117 | if (PageHighMem(pages[i])) |
| 117 | goto highmem; | 118 | goto highmem; |
| 118 | sg_set_page(&sglist[i], pages[i], PAGE_SIZE, 0); | 119 | sg_set_page(&sglist[i], pages[i], min(PAGE_SIZE, size), 0); |
| 120 | size -= min(PAGE_SIZE, size); | ||
| 119 | } | 121 | } |
| 120 | return sglist; | 122 | return sglist; |
| 121 | 123 | ||
| @@ -170,7 +172,8 @@ static int videobuf_dma_init_user_locked(struct videobuf_dmabuf *dma, | |||
| 170 | 172 | ||
| 171 | first = (data & PAGE_MASK) >> PAGE_SHIFT; | 173 | first = (data & PAGE_MASK) >> PAGE_SHIFT; |
| 172 | last = ((data+size-1) & PAGE_MASK) >> PAGE_SHIFT; | 174 | last = ((data+size-1) & PAGE_MASK) >> PAGE_SHIFT; |
| 173 | dma->offset = data & ~PAGE_MASK; | 175 | dma->offset = data & ~PAGE_MASK; |
| 176 | dma->size = size; | ||
| 174 | dma->nr_pages = last-first+1; | 177 | dma->nr_pages = last-first+1; |
| 175 | dma->pages = kmalloc(dma->nr_pages * sizeof(struct page *), GFP_KERNEL); | 178 | dma->pages = kmalloc(dma->nr_pages * sizeof(struct page *), GFP_KERNEL); |
| 176 | if (NULL == dma->pages) | 179 | if (NULL == dma->pages) |
| @@ -252,7 +255,7 @@ int videobuf_dma_map(struct device *dev, struct videobuf_dmabuf *dma) | |||
| 252 | 255 | ||
| 253 | if (dma->pages) { | 256 | if (dma->pages) { |
| 254 | dma->sglist = videobuf_pages_to_sg(dma->pages, dma->nr_pages, | 257 | dma->sglist = videobuf_pages_to_sg(dma->pages, dma->nr_pages, |
| 255 | dma->offset); | 258 | dma->offset, dma->size); |
| 256 | } | 259 | } |
| 257 | if (dma->vaddr) { | 260 | if (dma->vaddr) { |
| 258 | dma->sglist = videobuf_vmalloc_to_sg(dma->vaddr, | 261 | dma->sglist = videobuf_vmalloc_to_sg(dma->vaddr, |
diff --git a/drivers/mfd/max8925-core.c b/drivers/mfd/max8925-core.c index 04028a9ee082..428377a5a6f5 100644 --- a/drivers/mfd/max8925-core.c +++ b/drivers/mfd/max8925-core.c | |||
| @@ -429,24 +429,25 @@ static void max8925_irq_sync_unlock(unsigned int irq) | |||
| 429 | irq_tsc = cache_tsc; | 429 | irq_tsc = cache_tsc; |
| 430 | for (i = 0; i < ARRAY_SIZE(max8925_irqs); i++) { | 430 | for (i = 0; i < ARRAY_SIZE(max8925_irqs); i++) { |
| 431 | irq_data = &max8925_irqs[i]; | 431 | irq_data = &max8925_irqs[i]; |
| 432 | /* 1 -- disable, 0 -- enable */ | ||
| 432 | switch (irq_data->mask_reg) { | 433 | switch (irq_data->mask_reg) { |
| 433 | case MAX8925_CHG_IRQ1_MASK: | 434 | case MAX8925_CHG_IRQ1_MASK: |
| 434 | irq_chg[0] &= irq_data->enable; | 435 | irq_chg[0] &= ~irq_data->enable; |
| 435 | break; | 436 | break; |
| 436 | case MAX8925_CHG_IRQ2_MASK: | 437 | case MAX8925_CHG_IRQ2_MASK: |
| 437 | irq_chg[1] &= irq_data->enable; | 438 | irq_chg[1] &= ~irq_data->enable; |
| 438 | break; | 439 | break; |
| 439 | case MAX8925_ON_OFF_IRQ1_MASK: | 440 | case MAX8925_ON_OFF_IRQ1_MASK: |
| 440 | irq_on[0] &= irq_data->enable; | 441 | irq_on[0] &= ~irq_data->enable; |
| 441 | break; | 442 | break; |
| 442 | case MAX8925_ON_OFF_IRQ2_MASK: | 443 | case MAX8925_ON_OFF_IRQ2_MASK: |
| 443 | irq_on[1] &= irq_data->enable; | 444 | irq_on[1] &= ~irq_data->enable; |
| 444 | break; | 445 | break; |
| 445 | case MAX8925_RTC_IRQ_MASK: | 446 | case MAX8925_RTC_IRQ_MASK: |
| 446 | irq_rtc &= irq_data->enable; | 447 | irq_rtc &= ~irq_data->enable; |
| 447 | break; | 448 | break; |
| 448 | case MAX8925_TSC_IRQ_MASK: | 449 | case MAX8925_TSC_IRQ_MASK: |
| 449 | irq_tsc &= irq_data->enable; | 450 | irq_tsc &= ~irq_data->enable; |
| 450 | break; | 451 | break; |
| 451 | default: | 452 | default: |
| 452 | dev_err(chip->dev, "wrong IRQ\n"); | 453 | dev_err(chip->dev, "wrong IRQ\n"); |
diff --git a/drivers/mfd/wm831x-irq.c b/drivers/mfd/wm831x-irq.c index 7dabe4dbd373..294183b6260b 100644 --- a/drivers/mfd/wm831x-irq.c +++ b/drivers/mfd/wm831x-irq.c | |||
| @@ -394,8 +394,13 @@ static int wm831x_irq_set_type(unsigned int irq, unsigned int type) | |||
| 394 | 394 | ||
| 395 | irq = irq - wm831x->irq_base; | 395 | irq = irq - wm831x->irq_base; |
| 396 | 396 | ||
| 397 | if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11) | 397 | if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11) { |
| 398 | return -EINVAL; | 398 | /* Ignore internal-only IRQs */ |
| 399 | if (irq >= 0 && irq < WM831X_NUM_IRQS) | ||
| 400 | return 0; | ||
| 401 | else | ||
| 402 | return -EINVAL; | ||
| 403 | } | ||
| 399 | 404 | ||
| 400 | switch (type) { | 405 | switch (type) { |
| 401 | case IRQ_TYPE_EDGE_BOTH: | 406 | case IRQ_TYPE_EDGE_BOTH: |
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 0b591b658243..b74331260744 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig | |||
| @@ -368,7 +368,7 @@ config VMWARE_BALLOON | |||
| 368 | If unsure, say N. | 368 | If unsure, say N. |
| 369 | 369 | ||
| 370 | To compile this driver as a module, choose M here: the | 370 | To compile this driver as a module, choose M here: the |
| 371 | module will be called vmware_balloon. | 371 | module will be called vmw_balloon. |
| 372 | 372 | ||
| 373 | config ARM_CHARLCD | 373 | config ARM_CHARLCD |
| 374 | bool "ARM Ltd. Character LCD Driver" | 374 | bool "ARM Ltd. Character LCD Driver" |
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 255a80dc9d73..42eab95cde2a 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile | |||
| @@ -33,5 +33,5 @@ obj-$(CONFIG_IWMC3200TOP) += iwmc3200top/ | |||
| 33 | obj-$(CONFIG_HMC6352) += hmc6352.o | 33 | obj-$(CONFIG_HMC6352) += hmc6352.o |
| 34 | obj-y += eeprom/ | 34 | obj-y += eeprom/ |
| 35 | obj-y += cb710/ | 35 | obj-y += cb710/ |
| 36 | obj-$(CONFIG_VMWARE_BALLOON) += vmware_balloon.o | 36 | obj-$(CONFIG_VMWARE_BALLOON) += vmw_balloon.o |
| 37 | obj-$(CONFIG_ARM_CHARLCD) += arm-charlcd.o | 37 | obj-$(CONFIG_ARM_CHARLCD) += arm-charlcd.o |
diff --git a/drivers/misc/bh1780gli.c b/drivers/misc/bh1780gli.c index 714c6b487313..d5f3a3fd2319 100644 --- a/drivers/misc/bh1780gli.c +++ b/drivers/misc/bh1780gli.c | |||
| @@ -190,7 +190,6 @@ static int __devexit bh1780_remove(struct i2c_client *client) | |||
| 190 | 190 | ||
| 191 | ddata = i2c_get_clientdata(client); | 191 | ddata = i2c_get_clientdata(client); |
| 192 | sysfs_remove_group(&client->dev.kobj, &bh1780_attr_group); | 192 | sysfs_remove_group(&client->dev.kobj, &bh1780_attr_group); |
| 193 | i2c_set_clientdata(client, NULL); | ||
| 194 | kfree(ddata); | 193 | kfree(ddata); |
| 195 | 194 | ||
| 196 | return 0; | 195 | return 0; |
diff --git a/drivers/misc/vmware_balloon.c b/drivers/misc/vmw_balloon.c index 2a1e804a71aa..2a1e804a71aa 100644 --- a/drivers/misc/vmware_balloon.c +++ b/drivers/misc/vmw_balloon.c | |||
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 5db49b124ffa..09eee6df0653 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
| @@ -1631,6 +1631,19 @@ int mmc_suspend_host(struct mmc_host *host) | |||
| 1631 | if (host->bus_ops && !host->bus_dead) { | 1631 | if (host->bus_ops && !host->bus_dead) { |
| 1632 | if (host->bus_ops->suspend) | 1632 | if (host->bus_ops->suspend) |
| 1633 | err = host->bus_ops->suspend(host); | 1633 | err = host->bus_ops->suspend(host); |
| 1634 | if (err == -ENOSYS || !host->bus_ops->resume) { | ||
| 1635 | /* | ||
| 1636 | * We simply "remove" the card in this case. | ||
| 1637 | * It will be redetected on resume. | ||
| 1638 | */ | ||
| 1639 | if (host->bus_ops->remove) | ||
| 1640 | host->bus_ops->remove(host); | ||
| 1641 | mmc_claim_host(host); | ||
| 1642 | mmc_detach_bus(host); | ||
| 1643 | mmc_release_host(host); | ||
| 1644 | host->pm_flags = 0; | ||
| 1645 | err = 0; | ||
| 1646 | } | ||
| 1634 | } | 1647 | } |
| 1635 | mmc_bus_put(host); | 1648 | mmc_bus_put(host); |
| 1636 | 1649 | ||
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 71ad4163b95e..aacb862ecc8a 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
| @@ -241,8 +241,10 @@ static struct sdhci_ops sdhci_s3c_ops = { | |||
| 241 | static void sdhci_s3c_notify_change(struct platform_device *dev, int state) | 241 | static void sdhci_s3c_notify_change(struct platform_device *dev, int state) |
| 242 | { | 242 | { |
| 243 | struct sdhci_host *host = platform_get_drvdata(dev); | 243 | struct sdhci_host *host = platform_get_drvdata(dev); |
| 244 | unsigned long flags; | ||
| 245 | |||
| 244 | if (host) { | 246 | if (host) { |
| 245 | spin_lock(&host->lock); | 247 | spin_lock_irqsave(&host->lock, flags); |
| 246 | if (state) { | 248 | if (state) { |
| 247 | dev_dbg(&dev->dev, "card inserted.\n"); | 249 | dev_dbg(&dev->dev, "card inserted.\n"); |
| 248 | host->flags &= ~SDHCI_DEVICE_DEAD; | 250 | host->flags &= ~SDHCI_DEVICE_DEAD; |
| @@ -253,7 +255,7 @@ static void sdhci_s3c_notify_change(struct platform_device *dev, int state) | |||
| 253 | host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; | 255 | host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; |
| 254 | } | 256 | } |
| 255 | tasklet_schedule(&host->card_tasklet); | 257 | tasklet_schedule(&host->card_tasklet); |
| 256 | spin_unlock(&host->lock); | 258 | spin_unlock_irqrestore(&host->lock, flags); |
| 257 | } | 259 | } |
| 258 | } | 260 | } |
| 259 | 261 | ||
| @@ -481,8 +483,10 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) | |||
| 481 | sdhci_remove_host(host, 1); | 483 | sdhci_remove_host(host, 1); |
| 482 | 484 | ||
| 483 | for (ptr = 0; ptr < 3; ptr++) { | 485 | for (ptr = 0; ptr < 3; ptr++) { |
| 484 | clk_disable(sc->clk_bus[ptr]); | 486 | if (sc->clk_bus[ptr]) { |
| 485 | clk_put(sc->clk_bus[ptr]); | 487 | clk_disable(sc->clk_bus[ptr]); |
| 488 | clk_put(sc->clk_bus[ptr]); | ||
| 489 | } | ||
| 486 | } | 490 | } |
| 487 | clk_disable(sc->clk_io); | 491 | clk_disable(sc->clk_io); |
| 488 | clk_put(sc->clk_io); | 492 | clk_put(sc->clk_io); |
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index b2828e84d243..214b03afdd48 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | #include <linux/clk.h> | 30 | #include <linux/clk.h> |
| 31 | #include <linux/err.h> | 31 | #include <linux/err.h> |
| 32 | #include <linux/io.h> | 32 | #include <linux/io.h> |
| 33 | #include <linux/irq.h> | ||
| 34 | #include <linux/completion.h> | ||
| 33 | 35 | ||
| 34 | #include <asm/mach/flash.h> | 36 | #include <asm/mach/flash.h> |
| 35 | #include <mach/mxc_nand.h> | 37 | #include <mach/mxc_nand.h> |
| @@ -151,7 +153,7 @@ struct mxc_nand_host { | |||
| 151 | int irq; | 153 | int irq; |
| 152 | int eccsize; | 154 | int eccsize; |
| 153 | 155 | ||
| 154 | wait_queue_head_t irq_waitq; | 156 | struct completion op_completion; |
| 155 | 157 | ||
| 156 | uint8_t *data_buf; | 158 | uint8_t *data_buf; |
| 157 | unsigned int buf_start; | 159 | unsigned int buf_start; |
| @@ -164,6 +166,7 @@ struct mxc_nand_host { | |||
| 164 | void (*send_read_id)(struct mxc_nand_host *); | 166 | void (*send_read_id)(struct mxc_nand_host *); |
| 165 | uint16_t (*get_dev_status)(struct mxc_nand_host *); | 167 | uint16_t (*get_dev_status)(struct mxc_nand_host *); |
| 166 | int (*check_int)(struct mxc_nand_host *); | 168 | int (*check_int)(struct mxc_nand_host *); |
| 169 | void (*irq_control)(struct mxc_nand_host *, int); | ||
| 167 | }; | 170 | }; |
| 168 | 171 | ||
| 169 | /* OOB placement block for use with hardware ecc generation */ | 172 | /* OOB placement block for use with hardware ecc generation */ |
| @@ -216,9 +219,12 @@ static irqreturn_t mxc_nfc_irq(int irq, void *dev_id) | |||
| 216 | { | 219 | { |
| 217 | struct mxc_nand_host *host = dev_id; | 220 | struct mxc_nand_host *host = dev_id; |
| 218 | 221 | ||
| 219 | disable_irq_nosync(irq); | 222 | if (!host->check_int(host)) |
| 223 | return IRQ_NONE; | ||
| 220 | 224 | ||
| 221 | wake_up(&host->irq_waitq); | 225 | host->irq_control(host, 0); |
| 226 | |||
| 227 | complete(&host->op_completion); | ||
| 222 | 228 | ||
| 223 | return IRQ_HANDLED; | 229 | return IRQ_HANDLED; |
| 224 | } | 230 | } |
| @@ -245,11 +251,54 @@ static int check_int_v1_v2(struct mxc_nand_host *host) | |||
| 245 | if (!(tmp & NFC_V1_V2_CONFIG2_INT)) | 251 | if (!(tmp & NFC_V1_V2_CONFIG2_INT)) |
| 246 | return 0; | 252 | return 0; |
| 247 | 253 | ||
| 248 | writew(tmp & ~NFC_V1_V2_CONFIG2_INT, NFC_V1_V2_CONFIG2); | 254 | if (!cpu_is_mx21()) |
| 255 | writew(tmp & ~NFC_V1_V2_CONFIG2_INT, NFC_V1_V2_CONFIG2); | ||
| 249 | 256 | ||
| 250 | return 1; | 257 | return 1; |
| 251 | } | 258 | } |
| 252 | 259 | ||
| 260 | /* | ||
| 261 | * It has been observed that the i.MX21 cannot read the CONFIG2:INT bit | ||
| 262 | * if interrupts are masked (CONFIG1:INT_MSK is set). To handle this, the | ||
| 263 | * driver can enable/disable the irq line rather than simply masking the | ||
| 264 | * interrupts. | ||
| 265 | */ | ||
| 266 | static void irq_control_mx21(struct mxc_nand_host *host, int activate) | ||
| 267 | { | ||
| 268 | if (activate) | ||
| 269 | enable_irq(host->irq); | ||
| 270 | else | ||
| 271 | disable_irq_nosync(host->irq); | ||
| 272 | } | ||
| 273 | |||
| 274 | static void irq_control_v1_v2(struct mxc_nand_host *host, int activate) | ||
| 275 | { | ||
| 276 | uint16_t tmp; | ||
| 277 | |||
| 278 | tmp = readw(NFC_V1_V2_CONFIG1); | ||
| 279 | |||
| 280 | if (activate) | ||
| 281 | tmp &= ~NFC_V1_V2_CONFIG1_INT_MSK; | ||
| 282 | else | ||
| 283 | tmp |= NFC_V1_V2_CONFIG1_INT_MSK; | ||
| 284 | |||
| 285 | writew(tmp, NFC_V1_V2_CONFIG1); | ||
| 286 | } | ||
| 287 | |||
| 288 | static void irq_control_v3(struct mxc_nand_host *host, int activate) | ||
| 289 | { | ||
| 290 | uint32_t tmp; | ||
| 291 | |||
| 292 | tmp = readl(NFC_V3_CONFIG2); | ||
| 293 | |||
| 294 | if (activate) | ||
| 295 | tmp &= ~NFC_V3_CONFIG2_INT_MSK; | ||
| 296 | else | ||
| 297 | tmp |= NFC_V3_CONFIG2_INT_MSK; | ||
| 298 | |||
| 299 | writel(tmp, NFC_V3_CONFIG2); | ||
| 300 | } | ||
| 301 | |||
| 253 | /* This function polls the NANDFC to wait for the basic operation to | 302 | /* This function polls the NANDFC to wait for the basic operation to |
| 254 | * complete by checking the INT bit of config2 register. | 303 | * complete by checking the INT bit of config2 register. |
| 255 | */ | 304 | */ |
| @@ -259,10 +308,9 @@ static void wait_op_done(struct mxc_nand_host *host, int useirq) | |||
| 259 | 308 | ||
| 260 | if (useirq) { | 309 | if (useirq) { |
| 261 | if (!host->check_int(host)) { | 310 | if (!host->check_int(host)) { |
| 262 | 311 | INIT_COMPLETION(host->op_completion); | |
| 263 | enable_irq(host->irq); | 312 | host->irq_control(host, 1); |
| 264 | 313 | wait_for_completion(&host->op_completion); | |
| 265 | wait_event(host->irq_waitq, host->check_int(host)); | ||
| 266 | } | 314 | } |
| 267 | } else { | 315 | } else { |
| 268 | while (max_retries-- > 0) { | 316 | while (max_retries-- > 0) { |
| @@ -799,6 +847,7 @@ static void preset_v3(struct mtd_info *mtd) | |||
| 799 | NFC_V3_CONFIG2_2CMD_PHASES | | 847 | NFC_V3_CONFIG2_2CMD_PHASES | |
| 800 | NFC_V3_CONFIG2_SPAS(mtd->oobsize >> 1) | | 848 | NFC_V3_CONFIG2_SPAS(mtd->oobsize >> 1) | |
| 801 | NFC_V3_CONFIG2_ST_CMD(0x70) | | 849 | NFC_V3_CONFIG2_ST_CMD(0x70) | |
| 850 | NFC_V3_CONFIG2_INT_MSK | | ||
| 802 | NFC_V3_CONFIG2_NUM_ADDR_PHASE0; | 851 | NFC_V3_CONFIG2_NUM_ADDR_PHASE0; |
| 803 | 852 | ||
| 804 | if (chip->ecc.mode == NAND_ECC_HW) | 853 | if (chip->ecc.mode == NAND_ECC_HW) |
| @@ -1024,6 +1073,10 @@ static int __init mxcnd_probe(struct platform_device *pdev) | |||
| 1024 | host->send_read_id = send_read_id_v1_v2; | 1073 | host->send_read_id = send_read_id_v1_v2; |
| 1025 | host->get_dev_status = get_dev_status_v1_v2; | 1074 | host->get_dev_status = get_dev_status_v1_v2; |
| 1026 | host->check_int = check_int_v1_v2; | 1075 | host->check_int = check_int_v1_v2; |
| 1076 | if (cpu_is_mx21()) | ||
| 1077 | host->irq_control = irq_control_mx21; | ||
| 1078 | else | ||
| 1079 | host->irq_control = irq_control_v1_v2; | ||
| 1027 | } | 1080 | } |
| 1028 | 1081 | ||
| 1029 | if (nfc_is_v21()) { | 1082 | if (nfc_is_v21()) { |
| @@ -1062,6 +1115,7 @@ static int __init mxcnd_probe(struct platform_device *pdev) | |||
| 1062 | host->send_read_id = send_read_id_v3; | 1115 | host->send_read_id = send_read_id_v3; |
| 1063 | host->check_int = check_int_v3; | 1116 | host->check_int = check_int_v3; |
| 1064 | host->get_dev_status = get_dev_status_v3; | 1117 | host->get_dev_status = get_dev_status_v3; |
| 1118 | host->irq_control = irq_control_v3; | ||
| 1065 | oob_smallpage = &nandv2_hw_eccoob_smallpage; | 1119 | oob_smallpage = &nandv2_hw_eccoob_smallpage; |
| 1066 | oob_largepage = &nandv2_hw_eccoob_largepage; | 1120 | oob_largepage = &nandv2_hw_eccoob_largepage; |
| 1067 | } else | 1121 | } else |
| @@ -1093,14 +1147,34 @@ static int __init mxcnd_probe(struct platform_device *pdev) | |||
| 1093 | this->options |= NAND_USE_FLASH_BBT; | 1147 | this->options |= NAND_USE_FLASH_BBT; |
| 1094 | } | 1148 | } |
| 1095 | 1149 | ||
| 1096 | init_waitqueue_head(&host->irq_waitq); | 1150 | init_completion(&host->op_completion); |
| 1097 | 1151 | ||
| 1098 | host->irq = platform_get_irq(pdev, 0); | 1152 | host->irq = platform_get_irq(pdev, 0); |
| 1099 | 1153 | ||
| 1154 | /* | ||
| 1155 | * mask the interrupt. For i.MX21 explicitely call | ||
| 1156 | * irq_control_v1_v2 to use the mask bit. We can't call | ||
| 1157 | * disable_irq_nosync() for an interrupt we do not own yet. | ||
| 1158 | */ | ||
| 1159 | if (cpu_is_mx21()) | ||
| 1160 | irq_control_v1_v2(host, 0); | ||
| 1161 | else | ||
| 1162 | host->irq_control(host, 0); | ||
| 1163 | |||
| 1100 | err = request_irq(host->irq, mxc_nfc_irq, IRQF_DISABLED, DRIVER_NAME, host); | 1164 | err = request_irq(host->irq, mxc_nfc_irq, IRQF_DISABLED, DRIVER_NAME, host); |
| 1101 | if (err) | 1165 | if (err) |
| 1102 | goto eirq; | 1166 | goto eirq; |
| 1103 | 1167 | ||
| 1168 | host->irq_control(host, 0); | ||
| 1169 | |||
| 1170 | /* | ||
| 1171 | * Now that the interrupt is disabled make sure the interrupt | ||
| 1172 | * mask bit is cleared on i.MX21. Otherwise we can't read | ||
| 1173 | * the interrupt status bit on this machine. | ||
| 1174 | */ | ||
| 1175 | if (cpu_is_mx21()) | ||
| 1176 | irq_control_v1_v2(host, 1); | ||
| 1177 | |||
| 1104 | /* first scan to find the device and get the page size */ | 1178 | /* first scan to find the device and get the page size */ |
| 1105 | if (nand_scan_ident(mtd, 1, NULL)) { | 1179 | if (nand_scan_ident(mtd, 1, NULL)) { |
| 1106 | err = -ENXIO; | 1180 | err = -ENXIO; |
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 133d51528f8d..513e0a76a4a7 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
| @@ -413,7 +413,7 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
| 413 | prefetch_status = gpmc_read_status(GPMC_PREFETCH_COUNT); | 413 | prefetch_status = gpmc_read_status(GPMC_PREFETCH_COUNT); |
| 414 | } while (prefetch_status); | 414 | } while (prefetch_status); |
| 415 | /* disable and stop the PFPW engine */ | 415 | /* disable and stop the PFPW engine */ |
| 416 | gpmc_prefetch_reset(); | 416 | gpmc_prefetch_reset(info->gpmc_cs); |
| 417 | 417 | ||
| 418 | dma_unmap_single(&info->pdev->dev, dma_addr, len, dir); | 418 | dma_unmap_single(&info->pdev->dev, dma_addr, len, dir); |
| 419 | return 0; | 419 | return 0; |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 85671adae455..179871d9e71f 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
| @@ -635,6 +635,9 @@ struct vortex_private { | |||
| 635 | must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */ | 635 | must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */ |
| 636 | large_frames:1, /* accept large frames */ | 636 | large_frames:1, /* accept large frames */ |
| 637 | handling_irq:1; /* private in_irq indicator */ | 637 | handling_irq:1; /* private in_irq indicator */ |
| 638 | /* {get|set}_wol operations are already serialized by rtnl. | ||
| 639 | * no additional locking is required for the enable_wol and acpi_set_WOL() | ||
| 640 | */ | ||
| 638 | int drv_flags; | 641 | int drv_flags; |
| 639 | u16 status_enable; | 642 | u16 status_enable; |
| 640 | u16 intr_enable; | 643 | u16 intr_enable; |
| @@ -2939,28 +2942,31 @@ static void vortex_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
| 2939 | { | 2942 | { |
| 2940 | struct vortex_private *vp = netdev_priv(dev); | 2943 | struct vortex_private *vp = netdev_priv(dev); |
| 2941 | 2944 | ||
| 2942 | spin_lock_irq(&vp->lock); | 2945 | if (!VORTEX_PCI(vp)) |
| 2946 | return; | ||
| 2947 | |||
| 2943 | wol->supported = WAKE_MAGIC; | 2948 | wol->supported = WAKE_MAGIC; |
| 2944 | 2949 | ||
| 2945 | wol->wolopts = 0; | 2950 | wol->wolopts = 0; |
| 2946 | if (vp->enable_wol) | 2951 | if (vp->enable_wol) |
| 2947 | wol->wolopts |= WAKE_MAGIC; | 2952 | wol->wolopts |= WAKE_MAGIC; |
| 2948 | spin_unlock_irq(&vp->lock); | ||
| 2949 | } | 2953 | } |
| 2950 | 2954 | ||
| 2951 | static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | 2955 | static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) |
| 2952 | { | 2956 | { |
| 2953 | struct vortex_private *vp = netdev_priv(dev); | 2957 | struct vortex_private *vp = netdev_priv(dev); |
| 2958 | |||
| 2959 | if (!VORTEX_PCI(vp)) | ||
| 2960 | return -EOPNOTSUPP; | ||
| 2961 | |||
| 2954 | if (wol->wolopts & ~WAKE_MAGIC) | 2962 | if (wol->wolopts & ~WAKE_MAGIC) |
| 2955 | return -EINVAL; | 2963 | return -EINVAL; |
| 2956 | 2964 | ||
| 2957 | spin_lock_irq(&vp->lock); | ||
| 2958 | if (wol->wolopts & WAKE_MAGIC) | 2965 | if (wol->wolopts & WAKE_MAGIC) |
| 2959 | vp->enable_wol = 1; | 2966 | vp->enable_wol = 1; |
| 2960 | else | 2967 | else |
| 2961 | vp->enable_wol = 0; | 2968 | vp->enable_wol = 0; |
| 2962 | acpi_set_WOL(dev); | 2969 | acpi_set_WOL(dev); |
| 2963 | spin_unlock_irq(&vp->lock); | ||
| 2964 | 2970 | ||
| 2965 | return 0; | 2971 | return 0; |
| 2966 | } | 2972 | } |
| @@ -3202,6 +3208,9 @@ static void acpi_set_WOL(struct net_device *dev) | |||
| 3202 | return; | 3208 | return; |
| 3203 | } | 3209 | } |
| 3204 | 3210 | ||
| 3211 | if (VORTEX_PCI(vp)->current_state < PCI_D3hot) | ||
| 3212 | return; | ||
| 3213 | |||
| 3205 | /* Change the power state to D3; RxEnable doesn't take effect. */ | 3214 | /* Change the power state to D3; RxEnable doesn't take effect. */ |
| 3206 | pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot); | 3215 | pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot); |
| 3207 | } | 3216 | } |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 2cc81a54cbf3..5db667c0b371 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
| @@ -2428,7 +2428,7 @@ config UGETH_TX_ON_DEMAND | |||
| 2428 | 2428 | ||
| 2429 | config MV643XX_ETH | 2429 | config MV643XX_ETH |
| 2430 | tristate "Marvell Discovery (643XX) and Orion ethernet support" | 2430 | tristate "Marvell Discovery (643XX) and Orion ethernet support" |
| 2431 | depends on MV64X60 || PPC32 || PLAT_ORION | 2431 | depends on (MV64X60 || PPC32 || PLAT_ORION) && INET |
| 2432 | select INET_LRO | 2432 | select INET_LRO |
| 2433 | select PHYLIB | 2433 | select PHYLIB |
| 2434 | help | 2434 | help |
| @@ -2803,7 +2803,7 @@ config NIU | |||
| 2803 | 2803 | ||
| 2804 | config PASEMI_MAC | 2804 | config PASEMI_MAC |
| 2805 | tristate "PA Semi 1/10Gbit MAC" | 2805 | tristate "PA Semi 1/10Gbit MAC" |
| 2806 | depends on PPC_PASEMI && PCI | 2806 | depends on PPC_PASEMI && PCI && INET |
| 2807 | select PHYLIB | 2807 | select PHYLIB |
| 2808 | select INET_LRO | 2808 | select INET_LRO |
| 2809 | help | 2809 | help |
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 63b9ba0cc67e..c73be2848319 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
| @@ -1251,6 +1251,12 @@ static void atl1_free_ring_resources(struct atl1_adapter *adapter) | |||
| 1251 | 1251 | ||
| 1252 | rrd_ring->desc = NULL; | 1252 | rrd_ring->desc = NULL; |
| 1253 | rrd_ring->dma = 0; | 1253 | rrd_ring->dma = 0; |
| 1254 | |||
| 1255 | adapter->cmb.dma = 0; | ||
| 1256 | adapter->cmb.cmb = NULL; | ||
| 1257 | |||
| 1258 | adapter->smb.dma = 0; | ||
| 1259 | adapter->smb.smb = NULL; | ||
| 1254 | } | 1260 | } |
| 1255 | 1261 | ||
| 1256 | static void atl1_setup_mac_ctrl(struct atl1_adapter *adapter) | 1262 | static void atl1_setup_mac_ctrl(struct atl1_adapter *adapter) |
| @@ -2847,10 +2853,11 @@ static int atl1_resume(struct pci_dev *pdev) | |||
| 2847 | pci_enable_wake(pdev, PCI_D3cold, 0); | 2853 | pci_enable_wake(pdev, PCI_D3cold, 0); |
| 2848 | 2854 | ||
| 2849 | atl1_reset_hw(&adapter->hw); | 2855 | atl1_reset_hw(&adapter->hw); |
| 2850 | adapter->cmb.cmb->int_stats = 0; | ||
| 2851 | 2856 | ||
| 2852 | if (netif_running(netdev)) | 2857 | if (netif_running(netdev)) { |
| 2858 | adapter->cmb.cmb->int_stats = 0; | ||
| 2853 | atl1_up(adapter); | 2859 | atl1_up(adapter); |
| 2860 | } | ||
| 2854 | netif_device_attach(netdev); | 2861 | netif_device_attach(netdev); |
| 2855 | 2862 | ||
| 2856 | return 0; | 2863 | return 0; |
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 1e620e287ae0..efeffdf9e5fa 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
| @@ -2170,8 +2170,6 @@ static int __devinit b44_init_one(struct ssb_device *sdev, | |||
| 2170 | dev->irq = sdev->irq; | 2170 | dev->irq = sdev->irq; |
| 2171 | SET_ETHTOOL_OPS(dev, &b44_ethtool_ops); | 2171 | SET_ETHTOOL_OPS(dev, &b44_ethtool_ops); |
| 2172 | 2172 | ||
| 2173 | netif_carrier_off(dev); | ||
| 2174 | |||
| 2175 | err = ssb_bus_powerup(sdev->bus, 0); | 2173 | err = ssb_bus_powerup(sdev->bus, 0); |
| 2176 | if (err) { | 2174 | if (err) { |
| 2177 | dev_err(sdev->dev, | 2175 | dev_err(sdev->dev, |
| @@ -2213,6 +2211,8 @@ static int __devinit b44_init_one(struct ssb_device *sdev, | |||
| 2213 | goto err_out_powerdown; | 2211 | goto err_out_powerdown; |
| 2214 | } | 2212 | } |
| 2215 | 2213 | ||
| 2214 | netif_carrier_off(dev); | ||
| 2215 | |||
| 2216 | ssb_set_drvdata(sdev, dev); | 2216 | ssb_set_drvdata(sdev, dev); |
| 2217 | 2217 | ||
| 2218 | /* Chip reset provides power to the b44 MAC & PCI cores, which | 2218 | /* Chip reset provides power to the b44 MAC & PCI cores, which |
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 822f586d72af..0ddf4c66afe2 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
| @@ -2466,6 +2466,9 @@ int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct pac | |||
| 2466 | if (!(dev->flags & IFF_MASTER)) | 2466 | if (!(dev->flags & IFF_MASTER)) |
| 2467 | goto out; | 2467 | goto out; |
| 2468 | 2468 | ||
| 2469 | if (!pskb_may_pull(skb, sizeof(struct lacpdu))) | ||
| 2470 | goto out; | ||
| 2471 | |||
| 2469 | read_lock(&bond->lock); | 2472 | read_lock(&bond->lock); |
| 2470 | slave = bond_get_slave_by_dev((struct bonding *)netdev_priv(dev), | 2473 | slave = bond_get_slave_by_dev((struct bonding *)netdev_priv(dev), |
| 2471 | orig_dev); | 2474 | orig_dev); |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index c746b331771d..26bb118c4533 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
| @@ -362,6 +362,9 @@ static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct | |||
| 362 | goto out; | 362 | goto out; |
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | if (!pskb_may_pull(skb, arp_hdr_len(bond_dev))) | ||
| 366 | goto out; | ||
| 367 | |||
| 365 | if (skb->len < sizeof(struct arp_pkt)) { | 368 | if (skb->len < sizeof(struct arp_pkt)) { |
| 366 | pr_debug("Packet is too small to be an ARP\n"); | 369 | pr_debug("Packet is too small to be an ARP\n"); |
| 367 | goto out; | 370 | goto out; |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 3b16f62d5606..e953c6ad6e6d 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -5164,6 +5164,15 @@ int bond_create(struct net *net, const char *name) | |||
| 5164 | res = dev_alloc_name(bond_dev, "bond%d"); | 5164 | res = dev_alloc_name(bond_dev, "bond%d"); |
| 5165 | if (res < 0) | 5165 | if (res < 0) |
| 5166 | goto out; | 5166 | goto out; |
| 5167 | } else { | ||
| 5168 | /* | ||
| 5169 | * If we're given a name to register | ||
| 5170 | * we need to ensure that its not already | ||
| 5171 | * registered | ||
| 5172 | */ | ||
| 5173 | res = -EEXIST; | ||
| 5174 | if (__dev_get_by_name(net, name) != NULL) | ||
| 5175 | goto out; | ||
| 5167 | } | 5176 | } |
| 5168 | 5177 | ||
| 5169 | res = register_netdevice(bond_dev); | 5178 | res = register_netdevice(bond_dev); |
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index ad19585d960b..f208712c0b90 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
| @@ -2296,6 +2296,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr) | |||
| 2296 | case CHELSIO_GET_QSET_NUM:{ | 2296 | case CHELSIO_GET_QSET_NUM:{ |
| 2297 | struct ch_reg edata; | 2297 | struct ch_reg edata; |
| 2298 | 2298 | ||
| 2299 | memset(&edata, 0, sizeof(struct ch_reg)); | ||
| 2300 | |||
| 2299 | edata.cmd = CHELSIO_GET_QSET_NUM; | 2301 | edata.cmd = CHELSIO_GET_QSET_NUM; |
| 2300 | edata.val = pi->nqsets; | 2302 | edata.val = pi->nqsets; |
| 2301 | if (copy_to_user(useraddr, &edata, sizeof(edata))) | 2303 | if (copy_to_user(useraddr, &edata, sizeof(edata))) |
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h index 66ed08f726fb..ba302a5c2c30 100644 --- a/drivers/net/e1000e/hw.h +++ b/drivers/net/e1000e/hw.h | |||
| @@ -57,6 +57,7 @@ enum e1e_registers { | |||
| 57 | E1000_SCTL = 0x00024, /* SerDes Control - RW */ | 57 | E1000_SCTL = 0x00024, /* SerDes Control - RW */ |
| 58 | E1000_FCAL = 0x00028, /* Flow Control Address Low - RW */ | 58 | E1000_FCAL = 0x00028, /* Flow Control Address Low - RW */ |
| 59 | E1000_FCAH = 0x0002C, /* Flow Control Address High -RW */ | 59 | E1000_FCAH = 0x0002C, /* Flow Control Address High -RW */ |
| 60 | E1000_FEXTNVM4 = 0x00024, /* Future Extended NVM 4 - RW */ | ||
| 60 | E1000_FEXTNVM = 0x00028, /* Future Extended NVM - RW */ | 61 | E1000_FEXTNVM = 0x00028, /* Future Extended NVM - RW */ |
| 61 | E1000_FCT = 0x00030, /* Flow Control Type - RW */ | 62 | E1000_FCT = 0x00030, /* Flow Control Type - RW */ |
| 62 | E1000_VET = 0x00038, /* VLAN Ether Type - RW */ | 63 | E1000_VET = 0x00038, /* VLAN Ether Type - RW */ |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 63930d12711c..57b5435599ab 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
| @@ -105,6 +105,10 @@ | |||
| 105 | #define E1000_FEXTNVM_SW_CONFIG 1 | 105 | #define E1000_FEXTNVM_SW_CONFIG 1 |
| 106 | #define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */ | 106 | #define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */ |
| 107 | 107 | ||
| 108 | #define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7 | ||
| 109 | #define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7 | ||
| 110 | #define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3 | ||
| 111 | |||
| 108 | #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL | 112 | #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL |
| 109 | 113 | ||
| 110 | #define E1000_ICH_RAR_ENTRIES 7 | 114 | #define E1000_ICH_RAR_ENTRIES 7 |
| @@ -125,6 +129,7 @@ | |||
| 125 | 129 | ||
| 126 | /* SMBus Address Phy Register */ | 130 | /* SMBus Address Phy Register */ |
| 127 | #define HV_SMB_ADDR PHY_REG(768, 26) | 131 | #define HV_SMB_ADDR PHY_REG(768, 26) |
| 132 | #define HV_SMB_ADDR_MASK 0x007F | ||
| 128 | #define HV_SMB_ADDR_PEC_EN 0x0200 | 133 | #define HV_SMB_ADDR_PEC_EN 0x0200 |
| 129 | #define HV_SMB_ADDR_VALID 0x0080 | 134 | #define HV_SMB_ADDR_VALID 0x0080 |
| 130 | 135 | ||
| @@ -237,6 +242,8 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); | |||
| 237 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); | 242 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); |
| 238 | static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); | 243 | static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); |
| 239 | static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); | 244 | static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); |
| 245 | static s32 e1000_k1_workaround_lv(struct e1000_hw *hw); | ||
| 246 | static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate); | ||
| 240 | 247 | ||
| 241 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) | 248 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) |
| 242 | { | 249 | { |
| @@ -272,7 +279,7 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val) | |||
| 272 | static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | 279 | static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) |
| 273 | { | 280 | { |
| 274 | struct e1000_phy_info *phy = &hw->phy; | 281 | struct e1000_phy_info *phy = &hw->phy; |
| 275 | u32 ctrl; | 282 | u32 ctrl, fwsm; |
| 276 | s32 ret_val = 0; | 283 | s32 ret_val = 0; |
| 277 | 284 | ||
| 278 | phy->addr = 1; | 285 | phy->addr = 1; |
| @@ -294,7 +301,8 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
| 294 | * disabled, then toggle the LANPHYPC Value bit to force | 301 | * disabled, then toggle the LANPHYPC Value bit to force |
| 295 | * the interconnect to PCIe mode. | 302 | * the interconnect to PCIe mode. |
| 296 | */ | 303 | */ |
| 297 | if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { | 304 | fwsm = er32(FWSM); |
| 305 | if (!(fwsm & E1000_ICH_FWSM_FW_VALID)) { | ||
| 298 | ctrl = er32(CTRL); | 306 | ctrl = er32(CTRL); |
| 299 | ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE; | 307 | ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE; |
| 300 | ctrl &= ~E1000_CTRL_LANPHYPC_VALUE; | 308 | ctrl &= ~E1000_CTRL_LANPHYPC_VALUE; |
| @@ -303,6 +311,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
| 303 | ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE; | 311 | ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE; |
| 304 | ew32(CTRL, ctrl); | 312 | ew32(CTRL, ctrl); |
| 305 | msleep(50); | 313 | msleep(50); |
| 314 | |||
| 315 | /* | ||
| 316 | * Gate automatic PHY configuration by hardware on | ||
| 317 | * non-managed 82579 | ||
| 318 | */ | ||
| 319 | if (hw->mac.type == e1000_pch2lan) | ||
| 320 | e1000_gate_hw_phy_config_ich8lan(hw, true); | ||
| 306 | } | 321 | } |
| 307 | 322 | ||
| 308 | /* | 323 | /* |
| @@ -315,6 +330,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
| 315 | if (ret_val) | 330 | if (ret_val) |
| 316 | goto out; | 331 | goto out; |
| 317 | 332 | ||
| 333 | /* Ungate automatic PHY configuration on non-managed 82579 */ | ||
| 334 | if ((hw->mac.type == e1000_pch2lan) && | ||
| 335 | !(fwsm & E1000_ICH_FWSM_FW_VALID)) { | ||
| 336 | msleep(10); | ||
| 337 | e1000_gate_hw_phy_config_ich8lan(hw, false); | ||
| 338 | } | ||
| 339 | |||
| 318 | phy->id = e1000_phy_unknown; | 340 | phy->id = e1000_phy_unknown; |
| 319 | ret_val = e1000e_get_phy_id(hw); | 341 | ret_val = e1000e_get_phy_id(hw); |
| 320 | if (ret_val) | 342 | if (ret_val) |
| @@ -561,13 +583,10 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter) | |||
| 561 | if (mac->type == e1000_ich8lan) | 583 | if (mac->type == e1000_ich8lan) |
| 562 | e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); | 584 | e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); |
| 563 | 585 | ||
| 564 | /* Disable PHY configuration by hardware, config by software */ | 586 | /* Gate automatic PHY configuration by hardware on managed 82579 */ |
| 565 | if (mac->type == e1000_pch2lan) { | 587 | if ((mac->type == e1000_pch2lan) && |
| 566 | u32 extcnf_ctrl = er32(EXTCNF_CTRL); | 588 | (er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) |
| 567 | 589 | e1000_gate_hw_phy_config_ich8lan(hw, true); | |
| 568 | extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG; | ||
| 569 | ew32(EXTCNF_CTRL, extcnf_ctrl); | ||
| 570 | } | ||
| 571 | 590 | ||
| 572 | return 0; | 591 | return 0; |
| 573 | } | 592 | } |
| @@ -652,6 +671,12 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) | |||
| 652 | goto out; | 671 | goto out; |
| 653 | } | 672 | } |
| 654 | 673 | ||
| 674 | if (hw->mac.type == e1000_pch2lan) { | ||
| 675 | ret_val = e1000_k1_workaround_lv(hw); | ||
| 676 | if (ret_val) | ||
| 677 | goto out; | ||
| 678 | } | ||
| 679 | |||
| 655 | /* | 680 | /* |
| 656 | * Check if there was DownShift, must be checked | 681 | * Check if there was DownShift, must be checked |
| 657 | * immediately after link-up | 682 | * immediately after link-up |
| @@ -895,6 +920,34 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) | |||
| 895 | } | 920 | } |
| 896 | 921 | ||
| 897 | /** | 922 | /** |
| 923 | * e1000_write_smbus_addr - Write SMBus address to PHY needed during Sx states | ||
| 924 | * @hw: pointer to the HW structure | ||
| 925 | * | ||
| 926 | * Assumes semaphore already acquired. | ||
| 927 | * | ||
| 928 | **/ | ||
| 929 | static s32 e1000_write_smbus_addr(struct e1000_hw *hw) | ||
| 930 | { | ||
| 931 | u16 phy_data; | ||
| 932 | u32 strap = er32(STRAP); | ||
| 933 | s32 ret_val = 0; | ||
| 934 | |||
| 935 | strap &= E1000_STRAP_SMBUS_ADDRESS_MASK; | ||
| 936 | |||
| 937 | ret_val = e1000_read_phy_reg_hv_locked(hw, HV_SMB_ADDR, &phy_data); | ||
| 938 | if (ret_val) | ||
| 939 | goto out; | ||
| 940 | |||
| 941 | phy_data &= ~HV_SMB_ADDR_MASK; | ||
| 942 | phy_data |= (strap >> E1000_STRAP_SMBUS_ADDRESS_SHIFT); | ||
| 943 | phy_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; | ||
| 944 | ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, phy_data); | ||
| 945 | |||
| 946 | out: | ||
| 947 | return ret_val; | ||
| 948 | } | ||
| 949 | |||
| 950 | /** | ||
| 898 | * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration | 951 | * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration |
| 899 | * @hw: pointer to the HW structure | 952 | * @hw: pointer to the HW structure |
| 900 | * | 953 | * |
| @@ -903,7 +956,6 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) | |||
| 903 | **/ | 956 | **/ |
| 904 | static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | 957 | static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) |
| 905 | { | 958 | { |
| 906 | struct e1000_adapter *adapter = hw->adapter; | ||
| 907 | struct e1000_phy_info *phy = &hw->phy; | 959 | struct e1000_phy_info *phy = &hw->phy; |
| 908 | u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask; | 960 | u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask; |
| 909 | s32 ret_val = 0; | 961 | s32 ret_val = 0; |
| @@ -921,7 +973,8 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
| 921 | if (phy->type != e1000_phy_igp_3) | 973 | if (phy->type != e1000_phy_igp_3) |
| 922 | return ret_val; | 974 | return ret_val; |
| 923 | 975 | ||
| 924 | if (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) { | 976 | if ((hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) || |
| 977 | (hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_C)) { | ||
| 925 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; | 978 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; |
| 926 | break; | 979 | break; |
| 927 | } | 980 | } |
| @@ -961,21 +1014,16 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
| 961 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; | 1014 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; |
| 962 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; | 1015 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; |
| 963 | 1016 | ||
| 964 | if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && | 1017 | if ((!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && |
| 965 | ((hw->mac.type == e1000_pchlan) || | 1018 | (hw->mac.type == e1000_pchlan)) || |
| 966 | (hw->mac.type == e1000_pch2lan))) { | 1019 | (hw->mac.type == e1000_pch2lan)) { |
| 967 | /* | 1020 | /* |
| 968 | * HW configures the SMBus address and LEDs when the | 1021 | * HW configures the SMBus address and LEDs when the |
| 969 | * OEM and LCD Write Enable bits are set in the NVM. | 1022 | * OEM and LCD Write Enable bits are set in the NVM. |
| 970 | * When both NVM bits are cleared, SW will configure | 1023 | * When both NVM bits are cleared, SW will configure |
| 971 | * them instead. | 1024 | * them instead. |
| 972 | */ | 1025 | */ |
| 973 | data = er32(STRAP); | 1026 | ret_val = e1000_write_smbus_addr(hw); |
| 974 | data &= E1000_STRAP_SMBUS_ADDRESS_MASK; | ||
| 975 | reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT; | ||
| 976 | reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; | ||
| 977 | ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, | ||
| 978 | reg_data); | ||
| 979 | if (ret_val) | 1027 | if (ret_val) |
| 980 | goto out; | 1028 | goto out; |
| 981 | 1029 | ||
| @@ -1440,10 +1488,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
| 1440 | goto out; | 1488 | goto out; |
| 1441 | 1489 | ||
| 1442 | /* Enable jumbo frame workaround in the PHY */ | 1490 | /* Enable jumbo frame workaround in the PHY */ |
| 1443 | e1e_rphy(hw, PHY_REG(769, 20), &data); | ||
| 1444 | ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14)); | ||
| 1445 | if (ret_val) | ||
| 1446 | goto out; | ||
| 1447 | e1e_rphy(hw, PHY_REG(769, 23), &data); | 1491 | e1e_rphy(hw, PHY_REG(769, 23), &data); |
| 1448 | data &= ~(0x7F << 5); | 1492 | data &= ~(0x7F << 5); |
| 1449 | data |= (0x37 << 5); | 1493 | data |= (0x37 << 5); |
| @@ -1452,7 +1496,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
| 1452 | goto out; | 1496 | goto out; |
| 1453 | e1e_rphy(hw, PHY_REG(769, 16), &data); | 1497 | e1e_rphy(hw, PHY_REG(769, 16), &data); |
| 1454 | data &= ~(1 << 13); | 1498 | data &= ~(1 << 13); |
| 1455 | data |= (1 << 12); | ||
| 1456 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); | 1499 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); |
| 1457 | if (ret_val) | 1500 | if (ret_val) |
| 1458 | goto out; | 1501 | goto out; |
| @@ -1477,7 +1520,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
| 1477 | 1520 | ||
| 1478 | mac_reg = er32(RCTL); | 1521 | mac_reg = er32(RCTL); |
| 1479 | mac_reg &= ~E1000_RCTL_SECRC; | 1522 | mac_reg &= ~E1000_RCTL_SECRC; |
| 1480 | ew32(FFLT_DBG, mac_reg); | 1523 | ew32(RCTL, mac_reg); |
| 1481 | 1524 | ||
| 1482 | ret_val = e1000e_read_kmrn_reg(hw, | 1525 | ret_val = e1000e_read_kmrn_reg(hw, |
| 1483 | E1000_KMRNCTRLSTA_CTRL_OFFSET, | 1526 | E1000_KMRNCTRLSTA_CTRL_OFFSET, |
| @@ -1503,17 +1546,12 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
| 1503 | goto out; | 1546 | goto out; |
| 1504 | 1547 | ||
| 1505 | /* Write PHY register values back to h/w defaults */ | 1548 | /* Write PHY register values back to h/w defaults */ |
| 1506 | e1e_rphy(hw, PHY_REG(769, 20), &data); | ||
| 1507 | ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14)); | ||
| 1508 | if (ret_val) | ||
| 1509 | goto out; | ||
| 1510 | e1e_rphy(hw, PHY_REG(769, 23), &data); | 1549 | e1e_rphy(hw, PHY_REG(769, 23), &data); |
| 1511 | data &= ~(0x7F << 5); | 1550 | data &= ~(0x7F << 5); |
| 1512 | ret_val = e1e_wphy(hw, PHY_REG(769, 23), data); | 1551 | ret_val = e1e_wphy(hw, PHY_REG(769, 23), data); |
| 1513 | if (ret_val) | 1552 | if (ret_val) |
| 1514 | goto out; | 1553 | goto out; |
| 1515 | e1e_rphy(hw, PHY_REG(769, 16), &data); | 1554 | e1e_rphy(hw, PHY_REG(769, 16), &data); |
| 1516 | data &= ~(1 << 12); | ||
| 1517 | data |= (1 << 13); | 1555 | data |= (1 << 13); |
| 1518 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); | 1556 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); |
| 1519 | if (ret_val) | 1557 | if (ret_val) |
| @@ -1559,6 +1597,69 @@ out: | |||
| 1559 | } | 1597 | } |
| 1560 | 1598 | ||
| 1561 | /** | 1599 | /** |
| 1600 | * e1000_k1_gig_workaround_lv - K1 Si workaround | ||
| 1601 | * @hw: pointer to the HW structure | ||
| 1602 | * | ||
| 1603 | * Workaround to set the K1 beacon duration for 82579 parts | ||
| 1604 | **/ | ||
| 1605 | static s32 e1000_k1_workaround_lv(struct e1000_hw *hw) | ||
| 1606 | { | ||
| 1607 | s32 ret_val = 0; | ||
| 1608 | u16 status_reg = 0; | ||
| 1609 | u32 mac_reg; | ||
| 1610 | |||
| 1611 | if (hw->mac.type != e1000_pch2lan) | ||
| 1612 | goto out; | ||
| 1613 | |||
| 1614 | /* Set K1 beacon duration based on 1Gbps speed or otherwise */ | ||
| 1615 | ret_val = e1e_rphy(hw, HV_M_STATUS, &status_reg); | ||
| 1616 | if (ret_val) | ||
| 1617 | goto out; | ||
| 1618 | |||
| 1619 | if ((status_reg & (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE)) | ||
| 1620 | == (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE)) { | ||
| 1621 | mac_reg = er32(FEXTNVM4); | ||
| 1622 | mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK; | ||
| 1623 | |||
| 1624 | if (status_reg & HV_M_STATUS_SPEED_1000) | ||
| 1625 | mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_8USEC; | ||
| 1626 | else | ||
| 1627 | mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_16USEC; | ||
| 1628 | |||
| 1629 | ew32(FEXTNVM4, mac_reg); | ||
| 1630 | } | ||
| 1631 | |||
| 1632 | out: | ||
| 1633 | return ret_val; | ||
| 1634 | } | ||
| 1635 | |||
| 1636 | /** | ||
| 1637 | * e1000_gate_hw_phy_config_ich8lan - disable PHY config via hardware | ||
| 1638 | * @hw: pointer to the HW structure | ||
| 1639 | * @gate: boolean set to true to gate, false to ungate | ||
| 1640 | * | ||
| 1641 | * Gate/ungate the automatic PHY configuration via hardware; perform | ||
| 1642 | * the configuration via software instead. | ||
| 1643 | **/ | ||
| 1644 | static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate) | ||
| 1645 | { | ||
| 1646 | u32 extcnf_ctrl; | ||
| 1647 | |||
| 1648 | if (hw->mac.type != e1000_pch2lan) | ||
| 1649 | return; | ||
| 1650 | |||
| 1651 | extcnf_ctrl = er32(EXTCNF_CTRL); | ||
| 1652 | |||
| 1653 | if (gate) | ||
| 1654 | extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG; | ||
| 1655 | else | ||
| 1656 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_GATE_PHY_CFG; | ||
| 1657 | |||
| 1658 | ew32(EXTCNF_CTRL, extcnf_ctrl); | ||
| 1659 | return; | ||
| 1660 | } | ||
| 1661 | |||
| 1662 | /** | ||
| 1562 | * e1000_lan_init_done_ich8lan - Check for PHY config completion | 1663 | * e1000_lan_init_done_ich8lan - Check for PHY config completion |
| 1563 | * @hw: pointer to the HW structure | 1664 | * @hw: pointer to the HW structure |
| 1564 | * | 1665 | * |
| @@ -1602,6 +1703,9 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw) | |||
| 1602 | if (e1000_check_reset_block(hw)) | 1703 | if (e1000_check_reset_block(hw)) |
| 1603 | goto out; | 1704 | goto out; |
| 1604 | 1705 | ||
| 1706 | /* Allow time for h/w to get to quiescent state after reset */ | ||
| 1707 | msleep(10); | ||
| 1708 | |||
| 1605 | /* Perform any necessary post-reset workarounds */ | 1709 | /* Perform any necessary post-reset workarounds */ |
| 1606 | switch (hw->mac.type) { | 1710 | switch (hw->mac.type) { |
| 1607 | case e1000_pchlan: | 1711 | case e1000_pchlan: |
| @@ -1630,6 +1734,13 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw) | |||
| 1630 | /* Configure the LCD with the OEM bits in NVM */ | 1734 | /* Configure the LCD with the OEM bits in NVM */ |
| 1631 | ret_val = e1000_oem_bits_config_ich8lan(hw, true); | 1735 | ret_val = e1000_oem_bits_config_ich8lan(hw, true); |
| 1632 | 1736 | ||
| 1737 | /* Ungate automatic PHY configuration on non-managed 82579 */ | ||
| 1738 | if ((hw->mac.type == e1000_pch2lan) && | ||
| 1739 | !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { | ||
| 1740 | msleep(10); | ||
| 1741 | e1000_gate_hw_phy_config_ich8lan(hw, false); | ||
| 1742 | } | ||
| 1743 | |||
| 1633 | out: | 1744 | out: |
| 1634 | return ret_val; | 1745 | return ret_val; |
| 1635 | } | 1746 | } |
| @@ -1646,6 +1757,11 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | |||
| 1646 | { | 1757 | { |
| 1647 | s32 ret_val = 0; | 1758 | s32 ret_val = 0; |
| 1648 | 1759 | ||
| 1760 | /* Gate automatic PHY configuration by hardware on non-managed 82579 */ | ||
| 1761 | if ((hw->mac.type == e1000_pch2lan) && | ||
| 1762 | !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) | ||
| 1763 | e1000_gate_hw_phy_config_ich8lan(hw, true); | ||
| 1764 | |||
| 1649 | ret_val = e1000e_phy_hw_reset_generic(hw); | 1765 | ret_val = e1000e_phy_hw_reset_generic(hw); |
| 1650 | if (ret_val) | 1766 | if (ret_val) |
| 1651 | goto out; | 1767 | goto out; |
| @@ -2910,6 +3026,14 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
| 2910 | * external PHY is reset. | 3026 | * external PHY is reset. |
| 2911 | */ | 3027 | */ |
| 2912 | ctrl |= E1000_CTRL_PHY_RST; | 3028 | ctrl |= E1000_CTRL_PHY_RST; |
| 3029 | |||
| 3030 | /* | ||
| 3031 | * Gate automatic PHY configuration by hardware on | ||
| 3032 | * non-managed 82579 | ||
| 3033 | */ | ||
| 3034 | if ((hw->mac.type == e1000_pch2lan) && | ||
| 3035 | !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) | ||
| 3036 | e1000_gate_hw_phy_config_ich8lan(hw, true); | ||
| 2913 | } | 3037 | } |
| 2914 | ret_val = e1000_acquire_swflag_ich8lan(hw); | 3038 | ret_val = e1000_acquire_swflag_ich8lan(hw); |
| 2915 | e_dbg("Issuing a global reset to ich8lan\n"); | 3039 | e_dbg("Issuing a global reset to ich8lan\n"); |
| @@ -3460,13 +3584,20 @@ void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw) | |||
| 3460 | void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw) | 3584 | void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw) |
| 3461 | { | 3585 | { |
| 3462 | u32 phy_ctrl; | 3586 | u32 phy_ctrl; |
| 3587 | s32 ret_val; | ||
| 3463 | 3588 | ||
| 3464 | phy_ctrl = er32(PHY_CTRL); | 3589 | phy_ctrl = er32(PHY_CTRL); |
| 3465 | phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | E1000_PHY_CTRL_GBE_DISABLE; | 3590 | phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | E1000_PHY_CTRL_GBE_DISABLE; |
| 3466 | ew32(PHY_CTRL, phy_ctrl); | 3591 | ew32(PHY_CTRL, phy_ctrl); |
| 3467 | 3592 | ||
| 3468 | if (hw->mac.type >= e1000_pchlan) | 3593 | if (hw->mac.type >= e1000_pchlan) { |
| 3469 | e1000_phy_hw_reset_ich8lan(hw); | 3594 | e1000_oem_bits_config_ich8lan(hw, true); |
| 3595 | ret_val = hw->phy.ops.acquire(hw); | ||
| 3596 | if (ret_val) | ||
| 3597 | return; | ||
| 3598 | e1000_write_smbus_addr(hw); | ||
| 3599 | hw->phy.ops.release(hw); | ||
| 3600 | } | ||
| 3470 | } | 3601 | } |
| 3471 | 3602 | ||
| 3472 | /** | 3603 | /** |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 2b8ef44bd2b1..e561d15c3eb1 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
| @@ -2704,6 +2704,16 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) | |||
| 2704 | u32 psrctl = 0; | 2704 | u32 psrctl = 0; |
| 2705 | u32 pages = 0; | 2705 | u32 pages = 0; |
| 2706 | 2706 | ||
| 2707 | /* Workaround Si errata on 82579 - configure jumbo frame flow */ | ||
| 2708 | if (hw->mac.type == e1000_pch2lan) { | ||
| 2709 | s32 ret_val; | ||
| 2710 | |||
| 2711 | if (adapter->netdev->mtu > ETH_DATA_LEN) | ||
| 2712 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); | ||
| 2713 | else | ||
| 2714 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); | ||
| 2715 | } | ||
| 2716 | |||
| 2707 | /* Program MC offset vector base */ | 2717 | /* Program MC offset vector base */ |
| 2708 | rctl = er32(RCTL); | 2718 | rctl = er32(RCTL); |
| 2709 | rctl &= ~(3 << E1000_RCTL_MO_SHIFT); | 2719 | rctl &= ~(3 << E1000_RCTL_MO_SHIFT); |
| @@ -2744,16 +2754,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) | |||
| 2744 | e1e_wphy(hw, 22, phy_data); | 2754 | e1e_wphy(hw, 22, phy_data); |
| 2745 | } | 2755 | } |
| 2746 | 2756 | ||
| 2747 | /* Workaround Si errata on 82579 - configure jumbo frame flow */ | ||
| 2748 | if (hw->mac.type == e1000_pch2lan) { | ||
| 2749 | s32 ret_val; | ||
| 2750 | |||
| 2751 | if (rctl & E1000_RCTL_LPE) | ||
| 2752 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); | ||
| 2753 | else | ||
| 2754 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); | ||
| 2755 | } | ||
| 2756 | |||
| 2757 | /* Setup buffer sizes */ | 2757 | /* Setup buffer sizes */ |
| 2758 | rctl &= ~E1000_RCTL_SZ_4096; | 2758 | rctl &= ~E1000_RCTL_SZ_4096; |
| 2759 | rctl |= E1000_RCTL_BSEX; | 2759 | rctl |= E1000_RCTL_BSEX; |
| @@ -4833,6 +4833,15 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
| 4833 | return -EINVAL; | 4833 | return -EINVAL; |
| 4834 | } | 4834 | } |
| 4835 | 4835 | ||
| 4836 | /* Jumbo frame workaround on 82579 requires CRC be stripped */ | ||
| 4837 | if ((adapter->hw.mac.type == e1000_pch2lan) && | ||
| 4838 | !(adapter->flags2 & FLAG2_CRC_STRIPPING) && | ||
| 4839 | (new_mtu > ETH_DATA_LEN)) { | ||
| 4840 | e_err("Jumbo Frames not supported on 82579 when CRC " | ||
| 4841 | "stripping is disabled.\n"); | ||
| 4842 | return -EINVAL; | ||
| 4843 | } | ||
| 4844 | |||
| 4836 | /* 82573 Errata 17 */ | 4845 | /* 82573 Errata 17 */ |
| 4837 | if (((adapter->hw.mac.type == e1000_82573) || | 4846 | if (((adapter->hw.mac.type == e1000_82573) || |
| 4838 | (adapter->hw.mac.type == e1000_82574)) && | 4847 | (adapter->hw.mac.type == e1000_82574)) && |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index a333b42111b8..6372610ed240 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
| @@ -533,8 +533,15 @@ static inline void ehea_fill_skb(struct net_device *dev, | |||
| 533 | int length = cqe->num_bytes_transfered - 4; /*remove CRC */ | 533 | int length = cqe->num_bytes_transfered - 4; /*remove CRC */ |
| 534 | 534 | ||
| 535 | skb_put(skb, length); | 535 | skb_put(skb, length); |
| 536 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
| 537 | skb->protocol = eth_type_trans(skb, dev); | 536 | skb->protocol = eth_type_trans(skb, dev); |
| 537 | |||
| 538 | /* The packet was not an IPV4 packet so a complemented checksum was | ||
| 539 | calculated. The value is found in the Internet Checksum field. */ | ||
| 540 | if (cqe->status & EHEA_CQE_BLIND_CKSUM) { | ||
| 541 | skb->ip_summed = CHECKSUM_COMPLETE; | ||
| 542 | skb->csum = csum_unfold(~cqe->inet_checksum_value); | ||
| 543 | } else | ||
| 544 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
| 538 | } | 545 | } |
| 539 | 546 | ||
| 540 | static inline struct sk_buff *get_skb_by_index(struct sk_buff **skb_array, | 547 | static inline struct sk_buff *get_skb_by_index(struct sk_buff **skb_array, |
diff --git a/drivers/net/ehea/ehea_qmr.h b/drivers/net/ehea/ehea_qmr.h index f608a6c54af5..38104734a3be 100644 --- a/drivers/net/ehea/ehea_qmr.h +++ b/drivers/net/ehea/ehea_qmr.h | |||
| @@ -150,6 +150,7 @@ struct ehea_rwqe { | |||
| 150 | #define EHEA_CQE_TYPE_RQ 0x60 | 150 | #define EHEA_CQE_TYPE_RQ 0x60 |
| 151 | #define EHEA_CQE_STAT_ERR_MASK 0x700F | 151 | #define EHEA_CQE_STAT_ERR_MASK 0x700F |
| 152 | #define EHEA_CQE_STAT_FAT_ERR_MASK 0xF | 152 | #define EHEA_CQE_STAT_FAT_ERR_MASK 0xF |
| 153 | #define EHEA_CQE_BLIND_CKSUM 0x8000 | ||
| 153 | #define EHEA_CQE_STAT_ERR_TCP 0x4000 | 154 | #define EHEA_CQE_STAT_ERR_TCP 0x4000 |
| 154 | #define EHEA_CQE_STAT_ERR_IP 0x2000 | 155 | #define EHEA_CQE_STAT_ERR_IP 0x2000 |
| 155 | #define EHEA_CQE_STAT_ERR_CRC 0x1000 | 156 | #define EHEA_CQE_STAT_ERR_CRC 0x1000 |
diff --git a/drivers/net/eql.c b/drivers/net/eql.c index dda2c7944da9..0cb1cf9cf4b0 100644 --- a/drivers/net/eql.c +++ b/drivers/net/eql.c | |||
| @@ -555,6 +555,8 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mcp) | |||
| 555 | equalizer_t *eql; | 555 | equalizer_t *eql; |
| 556 | master_config_t mc; | 556 | master_config_t mc; |
| 557 | 557 | ||
| 558 | memset(&mc, 0, sizeof(master_config_t)); | ||
| 559 | |||
| 558 | if (eql_is_master(dev)) { | 560 | if (eql_is_master(dev)) { |
| 559 | eql = netdev_priv(dev); | 561 | eql = netdev_priv(dev); |
| 560 | mc.max_slaves = eql->max_slaves; | 562 | mc.max_slaves = eql->max_slaves; |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 768b840aeb6b..cce32d43175f 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
| @@ -678,24 +678,37 @@ static int fec_enet_mii_probe(struct net_device *dev) | |||
| 678 | { | 678 | { |
| 679 | struct fec_enet_private *fep = netdev_priv(dev); | 679 | struct fec_enet_private *fep = netdev_priv(dev); |
| 680 | struct phy_device *phy_dev = NULL; | 680 | struct phy_device *phy_dev = NULL; |
| 681 | int ret; | 681 | char mdio_bus_id[MII_BUS_ID_SIZE]; |
| 682 | char phy_name[MII_BUS_ID_SIZE + 3]; | ||
| 683 | int phy_id; | ||
| 682 | 684 | ||
| 683 | fep->phy_dev = NULL; | 685 | fep->phy_dev = NULL; |
| 684 | 686 | ||
| 685 | /* find the first phy */ | 687 | /* check for attached phy */ |
| 686 | phy_dev = phy_find_first(fep->mii_bus); | 688 | for (phy_id = 0; (phy_id < PHY_MAX_ADDR); phy_id++) { |
| 687 | if (!phy_dev) { | 689 | if ((fep->mii_bus->phy_mask & (1 << phy_id))) |
| 688 | printk(KERN_ERR "%s: no PHY found\n", dev->name); | 690 | continue; |
| 689 | return -ENODEV; | 691 | if (fep->mii_bus->phy_map[phy_id] == NULL) |
| 692 | continue; | ||
| 693 | if (fep->mii_bus->phy_map[phy_id]->phy_id == 0) | ||
| 694 | continue; | ||
| 695 | strncpy(mdio_bus_id, fep->mii_bus->id, MII_BUS_ID_SIZE); | ||
| 696 | break; | ||
| 690 | } | 697 | } |
| 691 | 698 | ||
| 692 | /* attach the mac to the phy */ | 699 | if (phy_id >= PHY_MAX_ADDR) { |
| 693 | ret = phy_connect_direct(dev, phy_dev, | 700 | printk(KERN_INFO "%s: no PHY, assuming direct connection " |
| 694 | &fec_enet_adjust_link, 0, | 701 | "to switch\n", dev->name); |
| 695 | PHY_INTERFACE_MODE_MII); | 702 | strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); |
| 696 | if (ret) { | 703 | phy_id = 0; |
| 697 | printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); | 704 | } |
| 698 | return ret; | 705 | |
| 706 | snprintf(phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); | ||
| 707 | phy_dev = phy_connect(dev, phy_name, &fec_enet_adjust_link, 0, | ||
| 708 | PHY_INTERFACE_MODE_MII); | ||
| 709 | if (IS_ERR(phy_dev)) { | ||
| 710 | printk(KERN_ERR "%s: could not attach to PHY\n", dev->name); | ||
| 711 | return PTR_ERR(phy_dev); | ||
| 699 | } | 712 | } |
| 700 | 713 | ||
| 701 | /* mask with MAC supported features */ | 714 | /* mask with MAC supported features */ |
| @@ -738,7 +751,7 @@ static int fec_enet_mii_init(struct platform_device *pdev) | |||
| 738 | fep->mii_bus->read = fec_enet_mdio_read; | 751 | fep->mii_bus->read = fec_enet_mdio_read; |
| 739 | fep->mii_bus->write = fec_enet_mdio_write; | 752 | fep->mii_bus->write = fec_enet_mdio_write; |
| 740 | fep->mii_bus->reset = fec_enet_mdio_reset; | 753 | fep->mii_bus->reset = fec_enet_mdio_reset; |
| 741 | snprintf(fep->mii_bus->id, MII_BUS_ID_SIZE, "%x", pdev->id); | 754 | snprintf(fep->mii_bus->id, MII_BUS_ID_SIZE, "%x", pdev->id + 1); |
| 742 | fep->mii_bus->priv = fep; | 755 | fep->mii_bus->priv = fep; |
| 743 | fep->mii_bus->parent = &pdev->dev; | 756 | fep->mii_bus->parent = &pdev->dev; |
| 744 | 757 | ||
| @@ -1311,6 +1324,9 @@ fec_probe(struct platform_device *pdev) | |||
| 1311 | if (ret) | 1324 | if (ret) |
| 1312 | goto failed_mii_init; | 1325 | goto failed_mii_init; |
| 1313 | 1326 | ||
| 1327 | /* Carrier starts down, phylib will bring it up */ | ||
| 1328 | netif_carrier_off(ndev); | ||
| 1329 | |||
| 1314 | ret = register_netdev(ndev); | 1330 | ret = register_netdev(ndev); |
| 1315 | if (ret) | 1331 | if (ret) |
| 1316 | goto failed_register; | 1332 | goto failed_register; |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 3506fd6ad726..519e19e23955 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
| @@ -2928,7 +2928,7 @@ static int __devinit emac_probe(struct platform_device *ofdev, | |||
| 2928 | if (dev->emac_irq != NO_IRQ) | 2928 | if (dev->emac_irq != NO_IRQ) |
| 2929 | irq_dispose_mapping(dev->emac_irq); | 2929 | irq_dispose_mapping(dev->emac_irq); |
| 2930 | err_free: | 2930 | err_free: |
| 2931 | kfree(ndev); | 2931 | free_netdev(ndev); |
| 2932 | err_gone: | 2932 | err_gone: |
| 2933 | /* if we were on the bootlist, remove us as we won't show up and | 2933 | /* if we were on the bootlist, remove us as we won't show up and |
| 2934 | * wake up all waiters to notify them in case they were waiting | 2934 | * wake up all waiters to notify them in case they were waiting |
| @@ -2971,7 +2971,7 @@ static int __devexit emac_remove(struct platform_device *ofdev) | |||
| 2971 | if (dev->emac_irq != NO_IRQ) | 2971 | if (dev->emac_irq != NO_IRQ) |
| 2972 | irq_dispose_mapping(dev->emac_irq); | 2972 | irq_dispose_mapping(dev->emac_irq); |
| 2973 | 2973 | ||
| 2974 | kfree(dev->ndev); | 2974 | free_netdev(dev->ndev); |
| 2975 | 2975 | ||
| 2976 | return 0; | 2976 | return 0; |
| 2977 | } | 2977 | } |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index cabae7bb1fc6..b075a35b85d4 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
| @@ -1540,7 +1540,6 @@ netxen_process_rcv(struct netxen_adapter *adapter, | |||
| 1540 | if (pkt_offset) | 1540 | if (pkt_offset) |
| 1541 | skb_pull(skb, pkt_offset); | 1541 | skb_pull(skb, pkt_offset); |
| 1542 | 1542 | ||
| 1543 | skb->truesize = skb->len + sizeof(struct sk_buff); | ||
| 1544 | skb->protocol = eth_type_trans(skb, netdev); | 1543 | skb->protocol = eth_type_trans(skb, netdev); |
| 1545 | 1544 | ||
| 1546 | napi_gro_receive(&sds_ring->napi, skb); | 1545 | napi_gro_receive(&sds_ring->napi, skb); |
| @@ -1602,8 +1601,6 @@ netxen_process_lro(struct netxen_adapter *adapter, | |||
| 1602 | 1601 | ||
| 1603 | skb_put(skb, lro_length + data_offset); | 1602 | skb_put(skb, lro_length + data_offset); |
| 1604 | 1603 | ||
| 1605 | skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb); | ||
| 1606 | |||
| 1607 | skb_pull(skb, l2_hdr_offset); | 1604 | skb_pull(skb, l2_hdr_offset); |
| 1608 | skb->protocol = eth_type_trans(skb, netdev); | 1605 | skb->protocol = eth_type_trans(skb, netdev); |
| 1609 | 1606 | ||
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 49279b0ee526..f9b509a6b09a 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
| @@ -508,7 +508,8 @@ static int pcnet_confcheck(struct pcmcia_device *p_dev, | |||
| 508 | unsigned int vcc, | 508 | unsigned int vcc, |
| 509 | void *priv_data) | 509 | void *priv_data) |
| 510 | { | 510 | { |
| 511 | int *has_shmem = priv_data; | 511 | int *priv = priv_data; |
| 512 | int try = (*priv & 0x1); | ||
| 512 | int i; | 513 | int i; |
| 513 | cistpl_io_t *io = &cfg->io; | 514 | cistpl_io_t *io = &cfg->io; |
| 514 | 515 | ||
| @@ -525,77 +526,103 @@ static int pcnet_confcheck(struct pcmcia_device *p_dev, | |||
| 525 | i = p_dev->resource[1]->end = 0; | 526 | i = p_dev->resource[1]->end = 0; |
| 526 | } | 527 | } |
| 527 | 528 | ||
| 528 | *has_shmem = ((cfg->mem.nwin == 1) && | 529 | *priv &= ((cfg->mem.nwin == 1) && |
| 529 | (cfg->mem.win[0].len >= 0x4000)); | 530 | (cfg->mem.win[0].len >= 0x4000)) ? 0x10 : ~0x10; |
| 531 | |||
| 530 | p_dev->resource[0]->start = io->win[i].base; | 532 | p_dev->resource[0]->start = io->win[i].base; |
| 531 | p_dev->resource[0]->end = io->win[i].len; | 533 | p_dev->resource[0]->end = io->win[i].len; |
| 532 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; | 534 | if (!try) |
| 535 | p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; | ||
| 536 | else | ||
| 537 | p_dev->io_lines = 16; | ||
| 533 | if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32) | 538 | if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32) |
| 534 | return try_io_port(p_dev); | 539 | return try_io_port(p_dev); |
| 535 | 540 | ||
| 536 | return 0; | 541 | return -EINVAL; |
| 542 | } | ||
| 543 | |||
| 544 | static hw_info_t *pcnet_try_config(struct pcmcia_device *link, | ||
| 545 | int *has_shmem, int try) | ||
| 546 | { | ||
| 547 | struct net_device *dev = link->priv; | ||
| 548 | hw_info_t *local_hw_info; | ||
| 549 | pcnet_dev_t *info = PRIV(dev); | ||
| 550 | int priv = try; | ||
| 551 | int ret; | ||
| 552 | |||
| 553 | ret = pcmcia_loop_config(link, pcnet_confcheck, &priv); | ||
| 554 | if (ret) { | ||
| 555 | dev_warn(&link->dev, "no useable port range found\n"); | ||
| 556 | return NULL; | ||
| 557 | } | ||
| 558 | *has_shmem = (priv & 0x10); | ||
| 559 | |||
| 560 | if (!link->irq) | ||
| 561 | return NULL; | ||
| 562 | |||
| 563 | if (resource_size(link->resource[1]) == 8) { | ||
| 564 | link->conf.Attributes |= CONF_ENABLE_SPKR; | ||
| 565 | link->conf.Status = CCSR_AUDIO_ENA; | ||
| 566 | } | ||
| 567 | if ((link->manf_id == MANFID_IBM) && | ||
| 568 | (link->card_id == PRODID_IBM_HOME_AND_AWAY)) | ||
| 569 | link->conf.ConfigIndex |= 0x10; | ||
| 570 | |||
| 571 | ret = pcmcia_request_configuration(link, &link->conf); | ||
| 572 | if (ret) | ||
| 573 | return NULL; | ||
| 574 | |||
| 575 | dev->irq = link->irq; | ||
| 576 | dev->base_addr = link->resource[0]->start; | ||
| 577 | |||
| 578 | if (info->flags & HAS_MISC_REG) { | ||
| 579 | if ((if_port == 1) || (if_port == 2)) | ||
| 580 | dev->if_port = if_port; | ||
| 581 | else | ||
| 582 | dev_notice(&link->dev, "invalid if_port requested\n"); | ||
| 583 | } else | ||
| 584 | dev->if_port = 0; | ||
| 585 | |||
| 586 | if ((link->conf.ConfigBase == 0x03c0) && | ||
| 587 | (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) { | ||
| 588 | dev_info(&link->dev, | ||
| 589 | "this is an AX88190 card - use axnet_cs instead.\n"); | ||
| 590 | return NULL; | ||
| 591 | } | ||
| 592 | |||
| 593 | local_hw_info = get_hwinfo(link); | ||
| 594 | if (!local_hw_info) | ||
| 595 | local_hw_info = get_prom(link); | ||
| 596 | if (!local_hw_info) | ||
| 597 | local_hw_info = get_dl10019(link); | ||
| 598 | if (!local_hw_info) | ||
| 599 | local_hw_info = get_ax88190(link); | ||
| 600 | if (!local_hw_info) | ||
| 601 | local_hw_info = get_hwired(link); | ||
| 602 | |||
| 603 | return local_hw_info; | ||
| 537 | } | 604 | } |
| 538 | 605 | ||
| 539 | static int pcnet_config(struct pcmcia_device *link) | 606 | static int pcnet_config(struct pcmcia_device *link) |
| 540 | { | 607 | { |
| 541 | struct net_device *dev = link->priv; | 608 | struct net_device *dev = link->priv; |
| 542 | pcnet_dev_t *info = PRIV(dev); | 609 | pcnet_dev_t *info = PRIV(dev); |
| 543 | int ret, start_pg, stop_pg, cm_offset; | 610 | int start_pg, stop_pg, cm_offset; |
| 544 | int has_shmem = 0; | 611 | int has_shmem = 0; |
| 545 | hw_info_t *local_hw_info; | 612 | hw_info_t *local_hw_info; |
| 546 | 613 | ||
| 547 | dev_dbg(&link->dev, "pcnet_config\n"); | 614 | dev_dbg(&link->dev, "pcnet_config\n"); |
| 548 | 615 | ||
| 549 | ret = pcmcia_loop_config(link, pcnet_confcheck, &has_shmem); | 616 | local_hw_info = pcnet_try_config(link, &has_shmem, 0); |
| 550 | if (ret) | 617 | if (!local_hw_info) { |
| 551 | goto failed; | 618 | /* check whether forcing io_lines to 16 helps... */ |
| 552 | 619 | pcmcia_disable_device(link); | |
| 553 | if (!link->irq) | 620 | local_hw_info = pcnet_try_config(link, &has_shmem, 1); |
| 554 | goto failed; | 621 | if (local_hw_info == NULL) { |
| 555 | 622 | dev_notice(&link->dev, "unable to read hardware net" | |
| 556 | if (resource_size(link->resource[1]) == 8) { | 623 | " address for io base %#3lx\n", dev->base_addr); |
| 557 | link->conf.Attributes |= CONF_ENABLE_SPKR; | 624 | goto failed; |
| 558 | link->conf.Status = CCSR_AUDIO_ENA; | 625 | } |
| 559 | } | ||
| 560 | if ((link->manf_id == MANFID_IBM) && | ||
| 561 | (link->card_id == PRODID_IBM_HOME_AND_AWAY)) | ||
| 562 | link->conf.ConfigIndex |= 0x10; | ||
| 563 | |||
| 564 | ret = pcmcia_request_configuration(link, &link->conf); | ||
| 565 | if (ret) | ||
| 566 | goto failed; | ||
| 567 | dev->irq = link->irq; | ||
| 568 | dev->base_addr = link->resource[0]->start; | ||
| 569 | if (info->flags & HAS_MISC_REG) { | ||
| 570 | if ((if_port == 1) || (if_port == 2)) | ||
| 571 | dev->if_port = if_port; | ||
| 572 | else | ||
| 573 | printk(KERN_NOTICE "pcnet_cs: invalid if_port requested\n"); | ||
| 574 | } else { | ||
| 575 | dev->if_port = 0; | ||
| 576 | } | ||
| 577 | |||
| 578 | if ((link->conf.ConfigBase == 0x03c0) && | ||
| 579 | (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) { | ||
| 580 | printk(KERN_INFO "pcnet_cs: this is an AX88190 card!\n"); | ||
| 581 | printk(KERN_INFO "pcnet_cs: use axnet_cs instead.\n"); | ||
| 582 | goto failed; | ||
| 583 | } | ||
| 584 | |||
| 585 | local_hw_info = get_hwinfo(link); | ||
| 586 | if (local_hw_info == NULL) | ||
| 587 | local_hw_info = get_prom(link); | ||
| 588 | if (local_hw_info == NULL) | ||
| 589 | local_hw_info = get_dl10019(link); | ||
| 590 | if (local_hw_info == NULL) | ||
| 591 | local_hw_info = get_ax88190(link); | ||
| 592 | if (local_hw_info == NULL) | ||
| 593 | local_hw_info = get_hwired(link); | ||
| 594 | |||
| 595 | if (local_hw_info == NULL) { | ||
| 596 | printk(KERN_NOTICE "pcnet_cs: unable to read hardware net" | ||
| 597 | " address for io base %#3lx\n", dev->base_addr); | ||
| 598 | goto failed; | ||
| 599 | } | 626 | } |
| 600 | 627 | ||
| 601 | info->flags = local_hw_info->flags; | 628 | info->flags = local_hw_info->flags; |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 6a6b8199a0d6..6c58da2b882c 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
| @@ -308,7 +308,7 @@ static int mdio_bus_suspend(struct device *dev) | |||
| 308 | * may call phy routines that try to grab the same lock, and that may | 308 | * may call phy routines that try to grab the same lock, and that may |
| 309 | * lead to a deadlock. | 309 | * lead to a deadlock. |
| 310 | */ | 310 | */ |
| 311 | if (phydev->attached_dev) | 311 | if (phydev->attached_dev && phydev->adjust_link) |
| 312 | phy_stop_machine(phydev); | 312 | phy_stop_machine(phydev); |
| 313 | 313 | ||
| 314 | if (!mdio_bus_phy_may_suspend(phydev)) | 314 | if (!mdio_bus_phy_may_suspend(phydev)) |
| @@ -331,7 +331,7 @@ static int mdio_bus_resume(struct device *dev) | |||
| 331 | return ret; | 331 | return ret; |
| 332 | 332 | ||
| 333 | no_resume: | 333 | no_resume: |
| 334 | if (phydev->attached_dev) | 334 | if (phydev->attached_dev && phydev->adjust_link) |
| 335 | phy_start_machine(phydev, NULL); | 335 | phy_start_machine(phydev, NULL); |
| 336 | 336 | ||
| 337 | return 0; | 337 | return 0; |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 6695a51e09e9..736b91703b3e 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
| @@ -1314,8 +1314,13 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb) | |||
| 1314 | hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; | 1314 | hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; |
| 1315 | i = 0; | 1315 | i = 0; |
| 1316 | list_for_each_entry(pch, &ppp->channels, clist) { | 1316 | list_for_each_entry(pch, &ppp->channels, clist) { |
| 1317 | navail += pch->avail = (pch->chan != NULL); | 1317 | if (pch->chan) { |
| 1318 | pch->speed = pch->chan->speed; | 1318 | pch->avail = 1; |
| 1319 | navail++; | ||
| 1320 | pch->speed = pch->chan->speed; | ||
| 1321 | } else { | ||
| 1322 | pch->avail = 0; | ||
| 1323 | } | ||
| 1319 | if (pch->avail) { | 1324 | if (pch->avail) { |
| 1320 | if (skb_queue_empty(&pch->file.xq) || | 1325 | if (skb_queue_empty(&pch->file.xq) || |
| 1321 | !pch->had_frag) { | 1326 | !pch->had_frag) { |
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c index 75ba744b173c..2c7cf0b64811 100644 --- a/drivers/net/qlcnic/qlcnic_init.c +++ b/drivers/net/qlcnic/qlcnic_init.c | |||
| @@ -1316,7 +1316,7 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter, | |||
| 1316 | return -ENOMEM; | 1316 | return -ENOMEM; |
| 1317 | } | 1317 | } |
| 1318 | 1318 | ||
| 1319 | skb_reserve(skb, 2); | 1319 | skb_reserve(skb, NET_IP_ALIGN); |
| 1320 | 1320 | ||
| 1321 | dma = pci_map_single(pdev, skb->data, | 1321 | dma = pci_map_single(pdev, skb->data, |
| 1322 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); | 1322 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); |
| @@ -1404,7 +1404,6 @@ qlcnic_process_rcv(struct qlcnic_adapter *adapter, | |||
| 1404 | if (pkt_offset) | 1404 | if (pkt_offset) |
| 1405 | skb_pull(skb, pkt_offset); | 1405 | skb_pull(skb, pkt_offset); |
| 1406 | 1406 | ||
| 1407 | skb->truesize = skb->len + sizeof(struct sk_buff); | ||
| 1408 | skb->protocol = eth_type_trans(skb, netdev); | 1407 | skb->protocol = eth_type_trans(skb, netdev); |
| 1409 | 1408 | ||
| 1410 | napi_gro_receive(&sds_ring->napi, skb); | 1409 | napi_gro_receive(&sds_ring->napi, skb); |
| @@ -1466,8 +1465,6 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter, | |||
| 1466 | 1465 | ||
| 1467 | skb_put(skb, lro_length + data_offset); | 1466 | skb_put(skb, lro_length + data_offset); |
| 1468 | 1467 | ||
| 1469 | skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb); | ||
| 1470 | |||
| 1471 | skb_pull(skb, l2_hdr_offset); | 1468 | skb_pull(skb, l2_hdr_offset); |
| 1472 | skb->protocol = eth_type_trans(skb, netdev); | 1469 | skb->protocol = eth_type_trans(skb, netdev); |
| 1473 | 1470 | ||
| @@ -1700,8 +1697,6 @@ qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, | |||
| 1700 | if (pkt_offset) | 1697 | if (pkt_offset) |
| 1701 | skb_pull(skb, pkt_offset); | 1698 | skb_pull(skb, pkt_offset); |
| 1702 | 1699 | ||
| 1703 | skb->truesize = skb->len + sizeof(struct sk_buff); | ||
| 1704 | |||
| 1705 | if (!qlcnic_check_loopback_buff(skb->data)) | 1700 | if (!qlcnic_check_loopback_buff(skb->data)) |
| 1706 | adapter->diag_cnt++; | 1701 | adapter->diag_cnt++; |
| 1707 | 1702 | ||
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 078bbf4e6f19..992db2fa136e 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
| @@ -1212,7 +1212,8 @@ static void rtl8169_update_counters(struct net_device *dev) | |||
| 1212 | if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0) | 1212 | if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0) |
| 1213 | return; | 1213 | return; |
| 1214 | 1214 | ||
| 1215 | counters = pci_alloc_consistent(tp->pci_dev, sizeof(*counters), &paddr); | 1215 | counters = dma_alloc_coherent(&tp->pci_dev->dev, sizeof(*counters), |
| 1216 | &paddr, GFP_KERNEL); | ||
| 1216 | if (!counters) | 1217 | if (!counters) |
| 1217 | return; | 1218 | return; |
| 1218 | 1219 | ||
| @@ -1233,7 +1234,8 @@ static void rtl8169_update_counters(struct net_device *dev) | |||
| 1233 | RTL_W32(CounterAddrLow, 0); | 1234 | RTL_W32(CounterAddrLow, 0); |
| 1234 | RTL_W32(CounterAddrHigh, 0); | 1235 | RTL_W32(CounterAddrHigh, 0); |
| 1235 | 1236 | ||
| 1236 | pci_free_consistent(tp->pci_dev, sizeof(*counters), counters, paddr); | 1237 | dma_free_coherent(&tp->pci_dev->dev, sizeof(*counters), counters, |
| 1238 | paddr); | ||
| 1237 | } | 1239 | } |
| 1238 | 1240 | ||
| 1239 | static void rtl8169_get_ethtool_stats(struct net_device *dev, | 1241 | static void rtl8169_get_ethtool_stats(struct net_device *dev, |
| @@ -2934,7 +2936,7 @@ static const struct rtl_cfg_info { | |||
| 2934 | .hw_start = rtl_hw_start_8168, | 2936 | .hw_start = rtl_hw_start_8168, |
| 2935 | .region = 2, | 2937 | .region = 2, |
| 2936 | .align = 8, | 2938 | .align = 8, |
| 2937 | .intr_event = SYSErr | LinkChg | RxOverflow | | 2939 | .intr_event = SYSErr | RxFIFOOver | LinkChg | RxOverflow | |
| 2938 | TxErr | TxOK | RxOK | RxErr, | 2940 | TxErr | TxOK | RxOK | RxErr, |
| 2939 | .napi_event = TxErr | TxOK | RxOK | RxOverflow, | 2941 | .napi_event = TxErr | TxOK | RxOK | RxOverflow, |
| 2940 | .features = RTL_FEATURE_GMII | RTL_FEATURE_MSI, | 2942 | .features = RTL_FEATURE_GMII | RTL_FEATURE_MSI, |
| @@ -3292,15 +3294,15 @@ static int rtl8169_open(struct net_device *dev) | |||
| 3292 | 3294 | ||
| 3293 | /* | 3295 | /* |
| 3294 | * Rx and Tx desscriptors needs 256 bytes alignment. | 3296 | * Rx and Tx desscriptors needs 256 bytes alignment. |
| 3295 | * pci_alloc_consistent provides more. | 3297 | * dma_alloc_coherent provides more. |
| 3296 | */ | 3298 | */ |
| 3297 | tp->TxDescArray = pci_alloc_consistent(pdev, R8169_TX_RING_BYTES, | 3299 | tp->TxDescArray = dma_alloc_coherent(&pdev->dev, R8169_TX_RING_BYTES, |
| 3298 | &tp->TxPhyAddr); | 3300 | &tp->TxPhyAddr, GFP_KERNEL); |
| 3299 | if (!tp->TxDescArray) | 3301 | if (!tp->TxDescArray) |
| 3300 | goto err_pm_runtime_put; | 3302 | goto err_pm_runtime_put; |
| 3301 | 3303 | ||
| 3302 | tp->RxDescArray = pci_alloc_consistent(pdev, R8169_RX_RING_BYTES, | 3304 | tp->RxDescArray = dma_alloc_coherent(&pdev->dev, R8169_RX_RING_BYTES, |
| 3303 | &tp->RxPhyAddr); | 3305 | &tp->RxPhyAddr, GFP_KERNEL); |
| 3304 | if (!tp->RxDescArray) | 3306 | if (!tp->RxDescArray) |
| 3305 | goto err_free_tx_0; | 3307 | goto err_free_tx_0; |
| 3306 | 3308 | ||
| @@ -3334,12 +3336,12 @@ out: | |||
| 3334 | err_release_ring_2: | 3336 | err_release_ring_2: |
| 3335 | rtl8169_rx_clear(tp); | 3337 | rtl8169_rx_clear(tp); |
| 3336 | err_free_rx_1: | 3338 | err_free_rx_1: |
| 3337 | pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, | 3339 | dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, |
| 3338 | tp->RxPhyAddr); | 3340 | tp->RxPhyAddr); |
| 3339 | tp->RxDescArray = NULL; | 3341 | tp->RxDescArray = NULL; |
| 3340 | err_free_tx_0: | 3342 | err_free_tx_0: |
| 3341 | pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, | 3343 | dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray, |
| 3342 | tp->TxPhyAddr); | 3344 | tp->TxPhyAddr); |
| 3343 | tp->TxDescArray = NULL; | 3345 | tp->TxDescArray = NULL; |
| 3344 | err_pm_runtime_put: | 3346 | err_pm_runtime_put: |
| 3345 | pm_runtime_put_noidle(&pdev->dev); | 3347 | pm_runtime_put_noidle(&pdev->dev); |
| @@ -3975,7 +3977,7 @@ static void rtl8169_free_rx_skb(struct rtl8169_private *tp, | |||
| 3975 | { | 3977 | { |
| 3976 | struct pci_dev *pdev = tp->pci_dev; | 3978 | struct pci_dev *pdev = tp->pci_dev; |
| 3977 | 3979 | ||
| 3978 | pci_unmap_single(pdev, le64_to_cpu(desc->addr), tp->rx_buf_sz, | 3980 | dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), tp->rx_buf_sz, |
| 3979 | PCI_DMA_FROMDEVICE); | 3981 | PCI_DMA_FROMDEVICE); |
| 3980 | dev_kfree_skb(*sk_buff); | 3982 | dev_kfree_skb(*sk_buff); |
| 3981 | *sk_buff = NULL; | 3983 | *sk_buff = NULL; |
| @@ -4000,7 +4002,7 @@ static inline void rtl8169_map_to_asic(struct RxDesc *desc, dma_addr_t mapping, | |||
| 4000 | static struct sk_buff *rtl8169_alloc_rx_skb(struct pci_dev *pdev, | 4002 | static struct sk_buff *rtl8169_alloc_rx_skb(struct pci_dev *pdev, |
| 4001 | struct net_device *dev, | 4003 | struct net_device *dev, |
| 4002 | struct RxDesc *desc, int rx_buf_sz, | 4004 | struct RxDesc *desc, int rx_buf_sz, |
| 4003 | unsigned int align) | 4005 | unsigned int align, gfp_t gfp) |
| 4004 | { | 4006 | { |
| 4005 | struct sk_buff *skb; | 4007 | struct sk_buff *skb; |
| 4006 | dma_addr_t mapping; | 4008 | dma_addr_t mapping; |
| @@ -4008,13 +4010,13 @@ static struct sk_buff *rtl8169_alloc_rx_skb(struct pci_dev *pdev, | |||
| 4008 | 4010 | ||
| 4009 | pad = align ? align : NET_IP_ALIGN; | 4011 | pad = align ? align : NET_IP_ALIGN; |
| 4010 | 4012 | ||
| 4011 | skb = netdev_alloc_skb(dev, rx_buf_sz + pad); | 4013 | skb = __netdev_alloc_skb(dev, rx_buf_sz + pad, gfp); |
| 4012 | if (!skb) | 4014 | if (!skb) |
| 4013 | goto err_out; | 4015 | goto err_out; |
| 4014 | 4016 | ||
| 4015 | skb_reserve(skb, align ? ((pad - 1) & (unsigned long)skb->data) : pad); | 4017 | skb_reserve(skb, align ? ((pad - 1) & (unsigned long)skb->data) : pad); |
| 4016 | 4018 | ||
| 4017 | mapping = pci_map_single(pdev, skb->data, rx_buf_sz, | 4019 | mapping = dma_map_single(&pdev->dev, skb->data, rx_buf_sz, |
| 4018 | PCI_DMA_FROMDEVICE); | 4020 | PCI_DMA_FROMDEVICE); |
| 4019 | 4021 | ||
| 4020 | rtl8169_map_to_asic(desc, mapping, rx_buf_sz); | 4022 | rtl8169_map_to_asic(desc, mapping, rx_buf_sz); |
| @@ -4039,7 +4041,7 @@ static void rtl8169_rx_clear(struct rtl8169_private *tp) | |||
| 4039 | } | 4041 | } |
| 4040 | 4042 | ||
| 4041 | static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev, | 4043 | static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev, |
| 4042 | u32 start, u32 end) | 4044 | u32 start, u32 end, gfp_t gfp) |
| 4043 | { | 4045 | { |
| 4044 | u32 cur; | 4046 | u32 cur; |
| 4045 | 4047 | ||
| @@ -4054,7 +4056,7 @@ static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev, | |||
| 4054 | 4056 | ||
| 4055 | skb = rtl8169_alloc_rx_skb(tp->pci_dev, dev, | 4057 | skb = rtl8169_alloc_rx_skb(tp->pci_dev, dev, |
| 4056 | tp->RxDescArray + i, | 4058 | tp->RxDescArray + i, |
| 4057 | tp->rx_buf_sz, tp->align); | 4059 | tp->rx_buf_sz, tp->align, gfp); |
| 4058 | if (!skb) | 4060 | if (!skb) |
| 4059 | break; | 4061 | break; |
| 4060 | 4062 | ||
| @@ -4082,7 +4084,7 @@ static int rtl8169_init_ring(struct net_device *dev) | |||
| 4082 | memset(tp->tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info)); | 4084 | memset(tp->tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info)); |
| 4083 | memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *)); | 4085 | memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *)); |
| 4084 | 4086 | ||
| 4085 | if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC) != NUM_RX_DESC) | 4087 | if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC, GFP_KERNEL) != NUM_RX_DESC) |
| 4086 | goto err_out; | 4088 | goto err_out; |
| 4087 | 4089 | ||
| 4088 | rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1); | 4090 | rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1); |
| @@ -4099,7 +4101,8 @@ static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb, | |||
| 4099 | { | 4101 | { |
| 4100 | unsigned int len = tx_skb->len; | 4102 | unsigned int len = tx_skb->len; |
| 4101 | 4103 | ||
| 4102 | pci_unmap_single(pdev, le64_to_cpu(desc->addr), len, PCI_DMA_TODEVICE); | 4104 | dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), len, |
| 4105 | PCI_DMA_TODEVICE); | ||
| 4103 | desc->opts1 = 0x00; | 4106 | desc->opts1 = 0x00; |
| 4104 | desc->opts2 = 0x00; | 4107 | desc->opts2 = 0x00; |
| 4105 | desc->addr = 0x00; | 4108 | desc->addr = 0x00; |
| @@ -4243,7 +4246,8 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb, | |||
| 4243 | txd = tp->TxDescArray + entry; | 4246 | txd = tp->TxDescArray + entry; |
| 4244 | len = frag->size; | 4247 | len = frag->size; |
| 4245 | addr = ((void *) page_address(frag->page)) + frag->page_offset; | 4248 | addr = ((void *) page_address(frag->page)) + frag->page_offset; |
| 4246 | mapping = pci_map_single(tp->pci_dev, addr, len, PCI_DMA_TODEVICE); | 4249 | mapping = dma_map_single(&tp->pci_dev->dev, addr, len, |
| 4250 | PCI_DMA_TODEVICE); | ||
| 4247 | 4251 | ||
| 4248 | /* anti gcc 2.95.3 bugware (sic) */ | 4252 | /* anti gcc 2.95.3 bugware (sic) */ |
| 4249 | status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC)); | 4253 | status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC)); |
| @@ -4313,7 +4317,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, | |||
| 4313 | tp->tx_skb[entry].skb = skb; | 4317 | tp->tx_skb[entry].skb = skb; |
| 4314 | } | 4318 | } |
| 4315 | 4319 | ||
| 4316 | mapping = pci_map_single(tp->pci_dev, skb->data, len, PCI_DMA_TODEVICE); | 4320 | mapping = dma_map_single(&tp->pci_dev->dev, skb->data, len, |
| 4321 | PCI_DMA_TODEVICE); | ||
| 4317 | 4322 | ||
| 4318 | tp->tx_skb[entry].len = len; | 4323 | tp->tx_skb[entry].len = len; |
| 4319 | txd->addr = cpu_to_le64(mapping); | 4324 | txd->addr = cpu_to_le64(mapping); |
| @@ -4477,8 +4482,8 @@ static inline bool rtl8169_try_rx_copy(struct sk_buff **sk_buff, | |||
| 4477 | if (!skb) | 4482 | if (!skb) |
| 4478 | goto out; | 4483 | goto out; |
| 4479 | 4484 | ||
| 4480 | pci_dma_sync_single_for_cpu(tp->pci_dev, addr, pkt_size, | 4485 | dma_sync_single_for_cpu(&tp->pci_dev->dev, addr, pkt_size, |
| 4481 | PCI_DMA_FROMDEVICE); | 4486 | PCI_DMA_FROMDEVICE); |
| 4482 | skb_copy_from_linear_data(*sk_buff, skb->data, pkt_size); | 4487 | skb_copy_from_linear_data(*sk_buff, skb->data, pkt_size); |
| 4483 | *sk_buff = skb; | 4488 | *sk_buff = skb; |
| 4484 | done = true; | 4489 | done = true; |
| @@ -4549,11 +4554,11 @@ static int rtl8169_rx_interrupt(struct net_device *dev, | |||
| 4549 | rtl8169_rx_csum(skb, desc); | 4554 | rtl8169_rx_csum(skb, desc); |
| 4550 | 4555 | ||
| 4551 | if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) { | 4556 | if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) { |
| 4552 | pci_dma_sync_single_for_device(pdev, addr, | 4557 | dma_sync_single_for_device(&pdev->dev, addr, |
| 4553 | pkt_size, PCI_DMA_FROMDEVICE); | 4558 | pkt_size, PCI_DMA_FROMDEVICE); |
| 4554 | rtl8169_mark_to_asic(desc, tp->rx_buf_sz); | 4559 | rtl8169_mark_to_asic(desc, tp->rx_buf_sz); |
| 4555 | } else { | 4560 | } else { |
| 4556 | pci_unmap_single(pdev, addr, tp->rx_buf_sz, | 4561 | dma_unmap_single(&pdev->dev, addr, tp->rx_buf_sz, |
| 4557 | PCI_DMA_FROMDEVICE); | 4562 | PCI_DMA_FROMDEVICE); |
| 4558 | tp->Rx_skbuff[entry] = NULL; | 4563 | tp->Rx_skbuff[entry] = NULL; |
| 4559 | } | 4564 | } |
| @@ -4583,7 +4588,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev, | |||
| 4583 | count = cur_rx - tp->cur_rx; | 4588 | count = cur_rx - tp->cur_rx; |
| 4584 | tp->cur_rx = cur_rx; | 4589 | tp->cur_rx = cur_rx; |
| 4585 | 4590 | ||
| 4586 | delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx); | 4591 | delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx, GFP_ATOMIC); |
| 4587 | if (!delta && count) | 4592 | if (!delta && count) |
| 4588 | netif_info(tp, intr, dev, "no Rx buffer allocated\n"); | 4593 | netif_info(tp, intr, dev, "no Rx buffer allocated\n"); |
| 4589 | tp->dirty_rx += delta; | 4594 | tp->dirty_rx += delta; |
| @@ -4625,8 +4630,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) | |||
| 4625 | } | 4630 | } |
| 4626 | 4631 | ||
| 4627 | /* Work around for rx fifo overflow */ | 4632 | /* Work around for rx fifo overflow */ |
| 4628 | if (unlikely(status & RxFIFOOver) && | 4633 | if (unlikely(status & RxFIFOOver)) { |
| 4629 | (tp->mac_version == RTL_GIGA_MAC_VER_11)) { | ||
| 4630 | netif_stop_queue(dev); | 4634 | netif_stop_queue(dev); |
| 4631 | rtl8169_tx_timeout(dev); | 4635 | rtl8169_tx_timeout(dev); |
| 4632 | break; | 4636 | break; |
| @@ -4770,10 +4774,10 @@ static int rtl8169_close(struct net_device *dev) | |||
| 4770 | 4774 | ||
| 4771 | free_irq(dev->irq, dev); | 4775 | free_irq(dev->irq, dev); |
| 4772 | 4776 | ||
| 4773 | pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, | 4777 | dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, |
| 4774 | tp->RxPhyAddr); | 4778 | tp->RxPhyAddr); |
| 4775 | pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, | 4779 | dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray, |
| 4776 | tp->TxPhyAddr); | 4780 | tp->TxPhyAddr); |
| 4777 | tp->TxDescArray = NULL; | 4781 | tp->TxDescArray = NULL; |
| 4778 | tp->RxDescArray = NULL; | 4782 | tp->RxDescArray = NULL; |
| 4779 | 4783 | ||
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c index 07eb884ff982..44150f2f7bfd 100644 --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c | |||
| @@ -384,7 +384,7 @@ static void rionet_remove(struct rio_dev *rdev) | |||
| 384 | free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? | 384 | free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? |
| 385 | __ilog2(sizeof(void *)) + 4 : 0); | 385 | __ilog2(sizeof(void *)) + 4 : 0); |
| 386 | unregister_netdev(ndev); | 386 | unregister_netdev(ndev); |
| 387 | kfree(ndev); | 387 | free_netdev(ndev); |
| 388 | 388 | ||
| 389 | list_for_each_entry_safe(peer, tmp, &rionet_peers, node) { | 389 | list_for_each_entry_safe(peer, tmp, &rionet_peers, node) { |
| 390 | list_del(&peer->node); | 390 | list_del(&peer->node); |
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c index cc4bd8c65f8b..9265315baa0b 100644 --- a/drivers/net/sgiseeq.c +++ b/drivers/net/sgiseeq.c | |||
| @@ -804,7 +804,7 @@ static int __devinit sgiseeq_probe(struct platform_device *pdev) | |||
| 804 | err_out_free_page: | 804 | err_out_free_page: |
| 805 | free_page((unsigned long) sp->srings); | 805 | free_page((unsigned long) sp->srings); |
| 806 | err_out_free_dev: | 806 | err_out_free_dev: |
| 807 | kfree(dev); | 807 | free_netdev(dev); |
| 808 | 808 | ||
| 809 | err_out: | 809 | err_out: |
| 810 | return err; | 810 | return err; |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 40e5c46e7571..465ae7e84507 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #include <linux/seq_file.h> | 43 | #include <linux/seq_file.h> |
| 44 | #include <linux/mii.h> | 44 | #include <linux/mii.h> |
| 45 | #include <linux/slab.h> | 45 | #include <linux/slab.h> |
| 46 | #include <linux/dmi.h> | ||
| 46 | #include <asm/irq.h> | 47 | #include <asm/irq.h> |
| 47 | 48 | ||
| 48 | #include "skge.h" | 49 | #include "skge.h" |
| @@ -3868,6 +3869,8 @@ static void __devinit skge_show_addr(struct net_device *dev) | |||
| 3868 | netif_info(skge, probe, skge->netdev, "addr %pM\n", dev->dev_addr); | 3869 | netif_info(skge, probe, skge->netdev, "addr %pM\n", dev->dev_addr); |
| 3869 | } | 3870 | } |
| 3870 | 3871 | ||
| 3872 | static int only_32bit_dma; | ||
| 3873 | |||
| 3871 | static int __devinit skge_probe(struct pci_dev *pdev, | 3874 | static int __devinit skge_probe(struct pci_dev *pdev, |
| 3872 | const struct pci_device_id *ent) | 3875 | const struct pci_device_id *ent) |
| 3873 | { | 3876 | { |
| @@ -3889,7 +3892,7 @@ static int __devinit skge_probe(struct pci_dev *pdev, | |||
| 3889 | 3892 | ||
| 3890 | pci_set_master(pdev); | 3893 | pci_set_master(pdev); |
| 3891 | 3894 | ||
| 3892 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { | 3895 | if (!only_32bit_dma && !pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { |
| 3893 | using_dac = 1; | 3896 | using_dac = 1; |
| 3894 | err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); | 3897 | err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); |
| 3895 | } else if (!(err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) { | 3898 | } else if (!(err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) { |
| @@ -4147,8 +4150,21 @@ static struct pci_driver skge_driver = { | |||
| 4147 | .shutdown = skge_shutdown, | 4150 | .shutdown = skge_shutdown, |
| 4148 | }; | 4151 | }; |
| 4149 | 4152 | ||
| 4153 | static struct dmi_system_id skge_32bit_dma_boards[] = { | ||
| 4154 | { | ||
| 4155 | .ident = "Gigabyte nForce boards", | ||
| 4156 | .matches = { | ||
| 4157 | DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co"), | ||
| 4158 | DMI_MATCH(DMI_BOARD_NAME, "nForce"), | ||
| 4159 | }, | ||
| 4160 | }, | ||
| 4161 | {} | ||
| 4162 | }; | ||
| 4163 | |||
| 4150 | static int __init skge_init_module(void) | 4164 | static int __init skge_init_module(void) |
| 4151 | { | 4165 | { |
| 4166 | if (dmi_check_system(skge_32bit_dma_boards)) | ||
| 4167 | only_32bit_dma = 1; | ||
| 4152 | skge_debug_init(); | 4168 | skge_debug_init(); |
| 4153 | return pci_register_driver(&skge_driver); | 4169 | return pci_register_driver(&skge_driver); |
| 4154 | } | 4170 | } |
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 0909ae934ad0..8150ba154116 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
| @@ -58,6 +58,7 @@ | |||
| 58 | 58 | ||
| 59 | MODULE_LICENSE("GPL"); | 59 | MODULE_LICENSE("GPL"); |
| 60 | MODULE_VERSION(SMSC_DRV_VERSION); | 60 | MODULE_VERSION(SMSC_DRV_VERSION); |
| 61 | MODULE_ALIAS("platform:smsc911x"); | ||
| 61 | 62 | ||
| 62 | #if USE_DEBUG > 0 | 63 | #if USE_DEBUG > 0 |
| 63 | static int debug = 16; | 64 | static int debug = 16; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index bc3af78a869f..1ec4b9e0239a 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
| @@ -4666,7 +4666,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) | |||
| 4666 | desc_idx, *post_ptr); | 4666 | desc_idx, *post_ptr); |
| 4667 | drop_it_no_recycle: | 4667 | drop_it_no_recycle: |
| 4668 | /* Other statistics kept track of by card. */ | 4668 | /* Other statistics kept track of by card. */ |
| 4669 | tp->net_stats.rx_dropped++; | 4669 | tp->rx_dropped++; |
| 4670 | goto next_pkt; | 4670 | goto next_pkt; |
| 4671 | } | 4671 | } |
| 4672 | 4672 | ||
| @@ -4726,7 +4726,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) | |||
| 4726 | if (len > (tp->dev->mtu + ETH_HLEN) && | 4726 | if (len > (tp->dev->mtu + ETH_HLEN) && |
| 4727 | skb->protocol != htons(ETH_P_8021Q)) { | 4727 | skb->protocol != htons(ETH_P_8021Q)) { |
| 4728 | dev_kfree_skb(skb); | 4728 | dev_kfree_skb(skb); |
| 4729 | goto next_pkt; | 4729 | goto drop_it_no_recycle; |
| 4730 | } | 4730 | } |
| 4731 | 4731 | ||
| 4732 | if (desc->type_flags & RXD_FLAG_VLAN && | 4732 | if (desc->type_flags & RXD_FLAG_VLAN && |
| @@ -9240,6 +9240,8 @@ static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev, | |||
| 9240 | stats->rx_missed_errors = old_stats->rx_missed_errors + | 9240 | stats->rx_missed_errors = old_stats->rx_missed_errors + |
| 9241 | get_stat64(&hw_stats->rx_discards); | 9241 | get_stat64(&hw_stats->rx_discards); |
| 9242 | 9242 | ||
| 9243 | stats->rx_dropped = tp->rx_dropped; | ||
| 9244 | |||
| 9243 | return stats; | 9245 | return stats; |
| 9244 | } | 9246 | } |
| 9245 | 9247 | ||
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 4937bd190964..be7ff138a7f9 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
| @@ -2759,7 +2759,7 @@ struct tg3 { | |||
| 2759 | 2759 | ||
| 2760 | 2760 | ||
| 2761 | /* begin "everything else" cacheline(s) section */ | 2761 | /* begin "everything else" cacheline(s) section */ |
| 2762 | struct rtnl_link_stats64 net_stats; | 2762 | unsigned long rx_dropped; |
| 2763 | struct rtnl_link_stats64 net_stats_prev; | 2763 | struct rtnl_link_stats64 net_stats_prev; |
| 2764 | struct tg3_ethtool_stats estats; | 2764 | struct tg3_ethtool_stats estats; |
| 2765 | struct tg3_ethtool_stats estats_prev; | 2765 | struct tg3_ethtool_stats estats_prev; |
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 5efa57757a2c..6888e3d41462 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
| @@ -243,6 +243,7 @@ enum { | |||
| 243 | NWayState = (1 << 14) | (1 << 13) | (1 << 12), | 243 | NWayState = (1 << 14) | (1 << 13) | (1 << 12), |
| 244 | NWayRestart = (1 << 12), | 244 | NWayRestart = (1 << 12), |
| 245 | NonselPortActive = (1 << 9), | 245 | NonselPortActive = (1 << 9), |
| 246 | SelPortActive = (1 << 8), | ||
| 246 | LinkFailStatus = (1 << 2), | 247 | LinkFailStatus = (1 << 2), |
| 247 | NetCxnErr = (1 << 1), | 248 | NetCxnErr = (1 << 1), |
| 248 | }; | 249 | }; |
| @@ -363,7 +364,9 @@ static u16 t21040_csr15[] = { 0, 0, 0x0006, 0x0000, 0x0000, }; | |||
| 363 | 364 | ||
| 364 | /* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/ | 365 | /* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/ |
| 365 | static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, }; | 366 | static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, }; |
| 366 | static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, }; | 367 | static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, }; |
| 368 | /* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */ | ||
| 369 | static u16 t21041_csr14_brk[] = { 0xFF3F, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, }; | ||
| 367 | static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; | 370 | static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; |
| 368 | 371 | ||
| 369 | 372 | ||
| @@ -1064,6 +1067,9 @@ static void de21041_media_timer (unsigned long data) | |||
| 1064 | unsigned int carrier; | 1067 | unsigned int carrier; |
| 1065 | unsigned long flags; | 1068 | unsigned long flags; |
| 1066 | 1069 | ||
| 1070 | /* clear port active bits */ | ||
| 1071 | dw32(SIAStatus, NonselPortActive | SelPortActive); | ||
| 1072 | |||
| 1067 | carrier = (status & NetCxnErr) ? 0 : 1; | 1073 | carrier = (status & NetCxnErr) ? 0 : 1; |
| 1068 | 1074 | ||
| 1069 | if (carrier) { | 1075 | if (carrier) { |
| @@ -1158,14 +1164,29 @@ no_link_yet: | |||
| 1158 | static void de_media_interrupt (struct de_private *de, u32 status) | 1164 | static void de_media_interrupt (struct de_private *de, u32 status) |
| 1159 | { | 1165 | { |
| 1160 | if (status & LinkPass) { | 1166 | if (status & LinkPass) { |
| 1167 | /* Ignore if current media is AUI or BNC and we can't use TP */ | ||
| 1168 | if ((de->media_type == DE_MEDIA_AUI || | ||
| 1169 | de->media_type == DE_MEDIA_BNC) && | ||
| 1170 | (de->media_lock || | ||
| 1171 | !de_ok_to_advertise(de, DE_MEDIA_TP_AUTO))) | ||
| 1172 | return; | ||
| 1173 | /* If current media is not TP, change it to TP */ | ||
| 1174 | if ((de->media_type == DE_MEDIA_AUI || | ||
| 1175 | de->media_type == DE_MEDIA_BNC)) { | ||
| 1176 | de->media_type = DE_MEDIA_TP_AUTO; | ||
| 1177 | de_stop_rxtx(de); | ||
| 1178 | de_set_media(de); | ||
| 1179 | de_start_rxtx(de); | ||
| 1180 | } | ||
| 1161 | de_link_up(de); | 1181 | de_link_up(de); |
| 1162 | mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK); | 1182 | mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK); |
| 1163 | return; | 1183 | return; |
| 1164 | } | 1184 | } |
| 1165 | 1185 | ||
| 1166 | BUG_ON(!(status & LinkFail)); | 1186 | BUG_ON(!(status & LinkFail)); |
| 1167 | 1187 | /* Mark the link as down only if current media is TP */ | |
| 1168 | if (netif_carrier_ok(de->dev)) { | 1188 | if (netif_carrier_ok(de->dev) && de->media_type != DE_MEDIA_AUI && |
| 1189 | de->media_type != DE_MEDIA_BNC) { | ||
| 1169 | de_link_down(de); | 1190 | de_link_down(de); |
| 1170 | mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK); | 1191 | mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK); |
| 1171 | } | 1192 | } |
| @@ -1229,6 +1250,7 @@ static void de_adapter_sleep (struct de_private *de) | |||
| 1229 | if (de->de21040) | 1250 | if (de->de21040) |
| 1230 | return; | 1251 | return; |
| 1231 | 1252 | ||
| 1253 | dw32(CSR13, 0); /* Reset phy */ | ||
| 1232 | pci_read_config_dword(de->pdev, PCIPM, &pmctl); | 1254 | pci_read_config_dword(de->pdev, PCIPM, &pmctl); |
| 1233 | pmctl |= PM_Sleep; | 1255 | pmctl |= PM_Sleep; |
| 1234 | pci_write_config_dword(de->pdev, PCIPM, pmctl); | 1256 | pci_write_config_dword(de->pdev, PCIPM, pmctl); |
| @@ -1574,12 +1596,15 @@ static int __de_set_settings(struct de_private *de, struct ethtool_cmd *ecmd) | |||
| 1574 | return 0; /* nothing to change */ | 1596 | return 0; /* nothing to change */ |
| 1575 | 1597 | ||
| 1576 | de_link_down(de); | 1598 | de_link_down(de); |
| 1599 | mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK); | ||
| 1577 | de_stop_rxtx(de); | 1600 | de_stop_rxtx(de); |
| 1578 | 1601 | ||
| 1579 | de->media_type = new_media; | 1602 | de->media_type = new_media; |
| 1580 | de->media_lock = media_lock; | 1603 | de->media_lock = media_lock; |
| 1581 | de->media_advertise = ecmd->advertising; | 1604 | de->media_advertise = ecmd->advertising; |
| 1582 | de_set_media(de); | 1605 | de_set_media(de); |
| 1606 | if (netif_running(de->dev)) | ||
| 1607 | de_start_rxtx(de); | ||
| 1583 | 1608 | ||
| 1584 | return 0; | 1609 | return 0; |
| 1585 | } | 1610 | } |
| @@ -1911,8 +1936,14 @@ fill_defaults: | |||
| 1911 | for (i = 0; i < DE_MAX_MEDIA; i++) { | 1936 | for (i = 0; i < DE_MAX_MEDIA; i++) { |
| 1912 | if (de->media[i].csr13 == 0xffff) | 1937 | if (de->media[i].csr13 == 0xffff) |
| 1913 | de->media[i].csr13 = t21041_csr13[i]; | 1938 | de->media[i].csr13 = t21041_csr13[i]; |
| 1914 | if (de->media[i].csr14 == 0xffff) | 1939 | if (de->media[i].csr14 == 0xffff) { |
| 1915 | de->media[i].csr14 = t21041_csr14[i]; | 1940 | /* autonegotiation is broken at least on some chip |
| 1941 | revisions - rev. 0x21 works, 0x11 does not */ | ||
| 1942 | if (de->pdev->revision < 0x20) | ||
| 1943 | de->media[i].csr14 = t21041_csr14_brk[i]; | ||
| 1944 | else | ||
| 1945 | de->media[i].csr14 = t21041_csr14[i]; | ||
| 1946 | } | ||
| 1916 | if (de->media[i].csr15 == 0xffff) | 1947 | if (de->media[i].csr15 == 0xffff) |
| 1917 | de->media[i].csr15 = t21041_csr15[i]; | 1948 | de->media[i].csr15 = t21041_csr15[i]; |
| 1918 | } | 1949 | } |
| @@ -2158,6 +2189,8 @@ static int de_resume (struct pci_dev *pdev) | |||
| 2158 | dev_err(&dev->dev, "pci_enable_device failed in resume\n"); | 2189 | dev_err(&dev->dev, "pci_enable_device failed in resume\n"); |
| 2159 | goto out; | 2190 | goto out; |
| 2160 | } | 2191 | } |
| 2192 | pci_set_master(pdev); | ||
| 2193 | de_init_rings(de); | ||
| 2161 | de_init_hw(de); | 2194 | de_init_hw(de); |
| 2162 | out_attach: | 2195 | out_attach: |
| 2163 | netif_device_attach(dev); | 2196 | netif_device_attach(dev); |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 6efca66b8766..1cd752f9a6e1 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
| @@ -1652,6 +1652,8 @@ static int hso_get_count(struct hso_serial *serial, | |||
| 1652 | struct uart_icount cnow; | 1652 | struct uart_icount cnow; |
| 1653 | struct hso_tiocmget *tiocmget = serial->tiocmget; | 1653 | struct hso_tiocmget *tiocmget = serial->tiocmget; |
| 1654 | 1654 | ||
| 1655 | memset(&icount, 0, sizeof(struct serial_icounter_struct)); | ||
| 1656 | |||
| 1655 | if (!tiocmget) | 1657 | if (!tiocmget) |
| 1656 | return -ENOENT; | 1658 | return -ENOENT; |
| 1657 | spin_lock_irq(&serial->serial_lock); | 1659 | spin_lock_irq(&serial->serial_lock); |
diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c index 8cc9e319f435..1737d1488b35 100644 --- a/drivers/net/wimax/i2400m/rx.c +++ b/drivers/net/wimax/i2400m/rx.c | |||
| @@ -1244,16 +1244,16 @@ int i2400m_rx(struct i2400m *i2400m, struct sk_buff *skb) | |||
| 1244 | int i, result; | 1244 | int i, result; |
| 1245 | struct device *dev = i2400m_dev(i2400m); | 1245 | struct device *dev = i2400m_dev(i2400m); |
| 1246 | const struct i2400m_msg_hdr *msg_hdr; | 1246 | const struct i2400m_msg_hdr *msg_hdr; |
| 1247 | size_t pl_itr, pl_size, skb_len; | 1247 | size_t pl_itr, pl_size; |
| 1248 | unsigned long flags; | 1248 | unsigned long flags; |
| 1249 | unsigned num_pls, single_last; | 1249 | unsigned num_pls, single_last, skb_len; |
| 1250 | 1250 | ||
| 1251 | skb_len = skb->len; | 1251 | skb_len = skb->len; |
| 1252 | d_fnstart(4, dev, "(i2400m %p skb %p [size %zu])\n", | 1252 | d_fnstart(4, dev, "(i2400m %p skb %p [size %u])\n", |
| 1253 | i2400m, skb, skb_len); | 1253 | i2400m, skb, skb_len); |
| 1254 | result = -EIO; | 1254 | result = -EIO; |
| 1255 | msg_hdr = (void *) skb->data; | 1255 | msg_hdr = (void *) skb->data; |
| 1256 | result = i2400m_rx_msg_hdr_check(i2400m, msg_hdr, skb->len); | 1256 | result = i2400m_rx_msg_hdr_check(i2400m, msg_hdr, skb_len); |
| 1257 | if (result < 0) | 1257 | if (result < 0) |
| 1258 | goto error_msg_hdr_check; | 1258 | goto error_msg_hdr_check; |
| 1259 | result = -EIO; | 1259 | result = -EIO; |
| @@ -1261,10 +1261,10 @@ int i2400m_rx(struct i2400m *i2400m, struct sk_buff *skb) | |||
| 1261 | pl_itr = sizeof(*msg_hdr) + /* Check payload descriptor(s) */ | 1261 | pl_itr = sizeof(*msg_hdr) + /* Check payload descriptor(s) */ |
| 1262 | num_pls * sizeof(msg_hdr->pld[0]); | 1262 | num_pls * sizeof(msg_hdr->pld[0]); |
| 1263 | pl_itr = ALIGN(pl_itr, I2400M_PL_ALIGN); | 1263 | pl_itr = ALIGN(pl_itr, I2400M_PL_ALIGN); |
| 1264 | if (pl_itr > skb->len) { /* got all the payload descriptors? */ | 1264 | if (pl_itr > skb_len) { /* got all the payload descriptors? */ |
| 1265 | dev_err(dev, "RX: HW BUG? message too short (%u bytes) for " | 1265 | dev_err(dev, "RX: HW BUG? message too short (%u bytes) for " |
| 1266 | "%u payload descriptors (%zu each, total %zu)\n", | 1266 | "%u payload descriptors (%zu each, total %zu)\n", |
| 1267 | skb->len, num_pls, sizeof(msg_hdr->pld[0]), pl_itr); | 1267 | skb_len, num_pls, sizeof(msg_hdr->pld[0]), pl_itr); |
| 1268 | goto error_pl_descr_short; | 1268 | goto error_pl_descr_short; |
| 1269 | } | 1269 | } |
| 1270 | /* Walk each payload payload--check we really got it */ | 1270 | /* Walk each payload payload--check we really got it */ |
| @@ -1272,7 +1272,7 @@ int i2400m_rx(struct i2400m *i2400m, struct sk_buff *skb) | |||
| 1272 | /* work around old gcc warnings */ | 1272 | /* work around old gcc warnings */ |
| 1273 | pl_size = i2400m_pld_size(&msg_hdr->pld[i]); | 1273 | pl_size = i2400m_pld_size(&msg_hdr->pld[i]); |
| 1274 | result = i2400m_rx_pl_descr_check(i2400m, &msg_hdr->pld[i], | 1274 | result = i2400m_rx_pl_descr_check(i2400m, &msg_hdr->pld[i], |
| 1275 | pl_itr, skb->len); | 1275 | pl_itr, skb_len); |
| 1276 | if (result < 0) | 1276 | if (result < 0) |
| 1277 | goto error_pl_descr_check; | 1277 | goto error_pl_descr_check; |
| 1278 | single_last = num_pls == 1 || i == num_pls - 1; | 1278 | single_last = num_pls == 1 || i == num_pls - 1; |
| @@ -1290,16 +1290,16 @@ int i2400m_rx(struct i2400m *i2400m, struct sk_buff *skb) | |||
| 1290 | if (i < i2400m->rx_pl_min) | 1290 | if (i < i2400m->rx_pl_min) |
| 1291 | i2400m->rx_pl_min = i; | 1291 | i2400m->rx_pl_min = i; |
| 1292 | i2400m->rx_num++; | 1292 | i2400m->rx_num++; |
| 1293 | i2400m->rx_size_acc += skb->len; | 1293 | i2400m->rx_size_acc += skb_len; |
| 1294 | if (skb->len < i2400m->rx_size_min) | 1294 | if (skb_len < i2400m->rx_size_min) |
| 1295 | i2400m->rx_size_min = skb->len; | 1295 | i2400m->rx_size_min = skb_len; |
| 1296 | if (skb->len > i2400m->rx_size_max) | 1296 | if (skb_len > i2400m->rx_size_max) |
| 1297 | i2400m->rx_size_max = skb->len; | 1297 | i2400m->rx_size_max = skb_len; |
| 1298 | spin_unlock_irqrestore(&i2400m->rx_lock, flags); | 1298 | spin_unlock_irqrestore(&i2400m->rx_lock, flags); |
| 1299 | error_pl_descr_check: | 1299 | error_pl_descr_check: |
| 1300 | error_pl_descr_short: | 1300 | error_pl_descr_short: |
| 1301 | error_msg_hdr_check: | 1301 | error_msg_hdr_check: |
| 1302 | d_fnend(4, dev, "(i2400m %p skb %p [size %zu]) = %d\n", | 1302 | d_fnend(4, dev, "(i2400m %p skb %p [size %u]) = %d\n", |
| 1303 | i2400m, skb, skb_len, result); | 1303 | i2400m, skb, skb_len, result); |
| 1304 | return result; | 1304 | return result; |
| 1305 | } | 1305 | } |
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c index cc648b6ae31c..a3d95cca8f0c 100644 --- a/drivers/net/wireless/ath/ath9k/ani.c +++ b/drivers/net/wireless/ath/ath9k/ani.c | |||
| @@ -543,7 +543,7 @@ static u8 ath9k_hw_chan_2_clockrate_mhz(struct ath_hw *ah) | |||
| 543 | if (conf_is_ht40(conf)) | 543 | if (conf_is_ht40(conf)) |
| 544 | return clockrate * 2; | 544 | return clockrate * 2; |
| 545 | 545 | ||
| 546 | return clockrate * 2; | 546 | return clockrate; |
| 547 | } | 547 | } |
| 548 | 548 | ||
| 549 | static int32_t ath9k_hw_ani_get_listen_time(struct ath_hw *ah) | 549 | static int32_t ath9k_hw_ani_get_listen_time(struct ath_hw *ah) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 9dd9e64c2b0b..8fd00a6e5120 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
| @@ -1411,7 +1411,7 @@ void iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
| 1411 | clear_bit(STATUS_SCAN_HW, &priv->status); | 1411 | clear_bit(STATUS_SCAN_HW, &priv->status); |
| 1412 | clear_bit(STATUS_SCANNING, &priv->status); | 1412 | clear_bit(STATUS_SCANNING, &priv->status); |
| 1413 | /* inform mac80211 scan aborted */ | 1413 | /* inform mac80211 scan aborted */ |
| 1414 | queue_work(priv->workqueue, &priv->scan_completed); | 1414 | queue_work(priv->workqueue, &priv->abort_scan); |
| 1415 | } | 1415 | } |
| 1416 | 1416 | ||
| 1417 | int iwlagn_manage_ibss_station(struct iwl_priv *priv, | 1417 | int iwlagn_manage_ibss_station(struct iwl_priv *priv, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 07dbc2796448..e23c4060a0f0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
| @@ -2613,6 +2613,11 @@ int iwl_force_reset(struct iwl_priv *priv, int mode, bool external) | |||
| 2613 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 2613 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
| 2614 | return -EINVAL; | 2614 | return -EINVAL; |
| 2615 | 2615 | ||
| 2616 | if (test_bit(STATUS_SCANNING, &priv->status)) { | ||
| 2617 | IWL_DEBUG_INFO(priv, "scan in progress.\n"); | ||
| 2618 | return -EINVAL; | ||
| 2619 | } | ||
| 2620 | |||
| 2616 | if (mode >= IWL_MAX_FORCE_RESET) { | 2621 | if (mode >= IWL_MAX_FORCE_RESET) { |
| 2617 | IWL_DEBUG_INFO(priv, "invalid reset request.\n"); | 2622 | IWL_DEBUG_INFO(priv, "invalid reset request.\n"); |
| 2618 | return -EINVAL; | 2623 | return -EINVAL; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 59a308b02f95..d31661c1ce77 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
| @@ -3018,7 +3018,7 @@ void iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
| 3018 | clear_bit(STATUS_SCANNING, &priv->status); | 3018 | clear_bit(STATUS_SCANNING, &priv->status); |
| 3019 | 3019 | ||
| 3020 | /* inform mac80211 scan aborted */ | 3020 | /* inform mac80211 scan aborted */ |
| 3021 | queue_work(priv->workqueue, &priv->scan_completed); | 3021 | queue_work(priv->workqueue, &priv->abort_scan); |
| 3022 | } | 3022 | } |
| 3023 | 3023 | ||
| 3024 | static void iwl3945_bg_restart(struct work_struct *data) | 3024 | static void iwl3945_bg_restart(struct work_struct *data) |
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index c3ceebb5be84..4789f8e8bf7a 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
| @@ -71,6 +71,49 @@ | |||
| 71 | #define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32)) | 71 | #define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32)) |
| 72 | #define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64)) | 72 | #define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64)) |
| 73 | 73 | ||
| 74 | /* page table handling */ | ||
| 75 | #define LEVEL_STRIDE (9) | ||
| 76 | #define LEVEL_MASK (((u64)1 << LEVEL_STRIDE) - 1) | ||
| 77 | |||
| 78 | static inline int agaw_to_level(int agaw) | ||
| 79 | { | ||
| 80 | return agaw + 2; | ||
| 81 | } | ||
| 82 | |||
| 83 | static inline int agaw_to_width(int agaw) | ||
| 84 | { | ||
| 85 | return 30 + agaw * LEVEL_STRIDE; | ||
| 86 | } | ||
| 87 | |||
| 88 | static inline int width_to_agaw(int width) | ||
| 89 | { | ||
| 90 | return (width - 30) / LEVEL_STRIDE; | ||
| 91 | } | ||
| 92 | |||
| 93 | static inline unsigned int level_to_offset_bits(int level) | ||
| 94 | { | ||
| 95 | return (level - 1) * LEVEL_STRIDE; | ||
| 96 | } | ||
| 97 | |||
| 98 | static inline int pfn_level_offset(unsigned long pfn, int level) | ||
| 99 | { | ||
| 100 | return (pfn >> level_to_offset_bits(level)) & LEVEL_MASK; | ||
| 101 | } | ||
| 102 | |||
| 103 | static inline unsigned long level_mask(int level) | ||
| 104 | { | ||
| 105 | return -1UL << level_to_offset_bits(level); | ||
| 106 | } | ||
| 107 | |||
| 108 | static inline unsigned long level_size(int level) | ||
| 109 | { | ||
| 110 | return 1UL << level_to_offset_bits(level); | ||
| 111 | } | ||
| 112 | |||
| 113 | static inline unsigned long align_to_level(unsigned long pfn, int level) | ||
| 114 | { | ||
| 115 | return (pfn + level_size(level) - 1) & level_mask(level); | ||
| 116 | } | ||
| 74 | 117 | ||
| 75 | /* VT-d pages must always be _smaller_ than MM pages. Otherwise things | 118 | /* VT-d pages must always be _smaller_ than MM pages. Otherwise things |
| 76 | are never going to work. */ | 119 | are never going to work. */ |
| @@ -434,8 +477,6 @@ void free_iova_mem(struct iova *iova) | |||
| 434 | } | 477 | } |
| 435 | 478 | ||
| 436 | 479 | ||
| 437 | static inline int width_to_agaw(int width); | ||
| 438 | |||
| 439 | static int __iommu_calculate_agaw(struct intel_iommu *iommu, int max_gaw) | 480 | static int __iommu_calculate_agaw(struct intel_iommu *iommu, int max_gaw) |
| 440 | { | 481 | { |
| 441 | unsigned long sagaw; | 482 | unsigned long sagaw; |
| @@ -646,51 +687,6 @@ out: | |||
| 646 | spin_unlock_irqrestore(&iommu->lock, flags); | 687 | spin_unlock_irqrestore(&iommu->lock, flags); |
| 647 | } | 688 | } |
| 648 | 689 | ||
| 649 | /* page table handling */ | ||
| 650 | #define LEVEL_STRIDE (9) | ||
| 651 | #define LEVEL_MASK (((u64)1 << LEVEL_STRIDE) - 1) | ||
| 652 | |||
| 653 | static inline int agaw_to_level(int agaw) | ||
| 654 | { | ||
| 655 | return agaw + 2; | ||
| 656 | } | ||
| 657 | |||
| 658 | static inline int agaw_to_width(int agaw) | ||
| 659 | { | ||
| 660 | return 30 + agaw * LEVEL_STRIDE; | ||
| 661 | |||
| 662 | } | ||
| 663 | |||
| 664 | static inline int width_to_agaw(int width) | ||
| 665 | { | ||
| 666 | return (width - 30) / LEVEL_STRIDE; | ||
| 667 | } | ||
| 668 | |||
| 669 | static inline unsigned int level_to_offset_bits(int level) | ||
| 670 | { | ||
| 671 | return (level - 1) * LEVEL_STRIDE; | ||
| 672 | } | ||
| 673 | |||
| 674 | static inline int pfn_level_offset(unsigned long pfn, int level) | ||
| 675 | { | ||
| 676 | return (pfn >> level_to_offset_bits(level)) & LEVEL_MASK; | ||
| 677 | } | ||
| 678 | |||
| 679 | static inline unsigned long level_mask(int level) | ||
| 680 | { | ||
| 681 | return -1UL << level_to_offset_bits(level); | ||
| 682 | } | ||
| 683 | |||
| 684 | static inline unsigned long level_size(int level) | ||
| 685 | { | ||
| 686 | return 1UL << level_to_offset_bits(level); | ||
| 687 | } | ||
| 688 | |||
| 689 | static inline unsigned long align_to_level(unsigned long pfn, int level) | ||
| 690 | { | ||
| 691 | return (pfn + level_size(level) - 1) & level_mask(level); | ||
| 692 | } | ||
| 693 | |||
| 694 | static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain, | 690 | static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain, |
| 695 | unsigned long pfn) | 691 | unsigned long pfn) |
| 696 | { | 692 | { |
| @@ -3761,6 +3757,33 @@ static void __devinit quirk_iommu_rwbf(struct pci_dev *dev) | |||
| 3761 | 3757 | ||
| 3762 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf); | 3758 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf); |
| 3763 | 3759 | ||
| 3760 | #define GGC 0x52 | ||
| 3761 | #define GGC_MEMORY_SIZE_MASK (0xf << 8) | ||
| 3762 | #define GGC_MEMORY_SIZE_NONE (0x0 << 8) | ||
| 3763 | #define GGC_MEMORY_SIZE_1M (0x1 << 8) | ||
| 3764 | #define GGC_MEMORY_SIZE_2M (0x3 << 8) | ||
| 3765 | #define GGC_MEMORY_VT_ENABLED (0x8 << 8) | ||
| 3766 | #define GGC_MEMORY_SIZE_2M_VT (0x9 << 8) | ||
| 3767 | #define GGC_MEMORY_SIZE_3M_VT (0xa << 8) | ||
| 3768 | #define GGC_MEMORY_SIZE_4M_VT (0xb << 8) | ||
| 3769 | |||
| 3770 | static void __devinit quirk_calpella_no_shadow_gtt(struct pci_dev *dev) | ||
| 3771 | { | ||
| 3772 | unsigned short ggc; | ||
| 3773 | |||
| 3774 | if (pci_read_config_word(dev, GGC, &ggc)) | ||
| 3775 | return; | ||
| 3776 | |||
| 3777 | if (!(ggc & GGC_MEMORY_VT_ENABLED)) { | ||
| 3778 | printk(KERN_INFO "DMAR: BIOS has allocated no shadow GTT; disabling IOMMU for graphics\n"); | ||
| 3779 | dmar_map_gfx = 0; | ||
| 3780 | } | ||
| 3781 | } | ||
| 3782 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0040, quirk_calpella_no_shadow_gtt); | ||
| 3783 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_gtt); | ||
| 3784 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt); | ||
| 3785 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt); | ||
| 3786 | |||
| 3764 | /* On Tylersburg chipsets, some BIOSes have been known to enable the | 3787 | /* On Tylersburg chipsets, some BIOSes have been known to enable the |
| 3765 | ISOCH DMAR unit for the Azalia sound device, but not give it any | 3788 | ISOCH DMAR unit for the Azalia sound device, but not give it any |
| 3766 | TLB entries, which causes it to deadlock. Check for that. We do | 3789 | TLB entries, which causes it to deadlock. Check for that. We do |
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index ce6a3666b3d9..553d8ee55c1c 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c | |||
| @@ -608,7 +608,7 @@ int pci_iov_resource_bar(struct pci_dev *dev, int resno, | |||
| 608 | * the VF BAR size multiplied by the number of VFs. The alignment | 608 | * the VF BAR size multiplied by the number of VFs. The alignment |
| 609 | * is just the VF BAR size. | 609 | * is just the VF BAR size. |
| 610 | */ | 610 | */ |
| 611 | int pci_sriov_resource_alignment(struct pci_dev *dev, int resno) | 611 | resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno) |
| 612 | { | 612 | { |
| 613 | struct resource tmp; | 613 | struct resource tmp; |
| 614 | enum pci_bar_type type; | 614 | enum pci_bar_type type; |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 7754a678ab15..6beb11b617a9 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
| @@ -264,7 +264,8 @@ extern int pci_iov_init(struct pci_dev *dev); | |||
| 264 | extern void pci_iov_release(struct pci_dev *dev); | 264 | extern void pci_iov_release(struct pci_dev *dev); |
| 265 | extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, | 265 | extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, |
| 266 | enum pci_bar_type *type); | 266 | enum pci_bar_type *type); |
| 267 | extern int pci_sriov_resource_alignment(struct pci_dev *dev, int resno); | 267 | extern resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, |
| 268 | int resno); | ||
| 268 | extern void pci_restore_iov_state(struct pci_dev *dev); | 269 | extern void pci_restore_iov_state(struct pci_dev *dev); |
| 269 | extern int pci_iov_bus_range(struct pci_bus *bus); | 270 | extern int pci_iov_bus_range(struct pci_bus *bus); |
| 270 | 271 | ||
| @@ -320,7 +321,7 @@ static inline int pci_ats_enabled(struct pci_dev *dev) | |||
| 320 | } | 321 | } |
| 321 | #endif /* CONFIG_PCI_IOV */ | 322 | #endif /* CONFIG_PCI_IOV */ |
| 322 | 323 | ||
| 323 | static inline int pci_resource_alignment(struct pci_dev *dev, | 324 | static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, |
| 324 | struct resource *res) | 325 | struct resource *res) |
| 325 | { | 326 | { |
| 326 | #ifdef CONFIG_PCI_IOV | 327 | #ifdef CONFIG_PCI_IOV |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 89ed181cd90c..857ae01734a6 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
| @@ -163,6 +163,26 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_d | |||
| 163 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs); | 163 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs); |
| 164 | 164 | ||
| 165 | /* | 165 | /* |
| 166 | * Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear | ||
| 167 | * for some HT machines to use C4 w/o hanging. | ||
| 168 | */ | ||
| 169 | static void __devinit quirk_tigerpoint_bm_sts(struct pci_dev *dev) | ||
| 170 | { | ||
| 171 | u32 pmbase; | ||
| 172 | u16 pm1a; | ||
| 173 | |||
| 174 | pci_read_config_dword(dev, 0x40, &pmbase); | ||
| 175 | pmbase = pmbase & 0xff80; | ||
| 176 | pm1a = inw(pmbase); | ||
| 177 | |||
| 178 | if (pm1a & 0x10) { | ||
| 179 | dev_info(&dev->dev, FW_BUG "TigerPoint LPC.BM_STS cleared\n"); | ||
| 180 | outw(0x10, pmbase); | ||
| 181 | } | ||
| 182 | } | ||
| 183 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk_tigerpoint_bm_sts); | ||
| 184 | |||
| 185 | /* | ||
| 166 | * Chipsets where PCI->PCI transfers vanish or hang | 186 | * Chipsets where PCI->PCI transfers vanish or hang |
| 167 | */ | 187 | */ |
| 168 | static void __devinit quirk_nopcipci(struct pci_dev *dev) | 188 | static void __devinit quirk_nopcipci(struct pci_dev *dev) |
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 54aa1c238cb3..9ba4dade69a4 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
| @@ -163,7 +163,7 @@ static int pcmcia_access_config(struct pcmcia_device *p_dev, | |||
| 163 | c = p_dev->function_config; | 163 | c = p_dev->function_config; |
| 164 | 164 | ||
| 165 | if (!(c->state & CONFIG_LOCKED)) { | 165 | if (!(c->state & CONFIG_LOCKED)) { |
| 166 | dev_dbg(&s->dev, "Configuration isnt't locked\n"); | 166 | dev_dbg(&p_dev->dev, "Configuration isnt't locked\n"); |
| 167 | mutex_unlock(&s->ops_mutex); | 167 | mutex_unlock(&s->ops_mutex); |
| 168 | return -EACCES; | 168 | return -EACCES; |
| 169 | } | 169 | } |
| @@ -220,7 +220,7 @@ int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh, | |||
| 220 | s->win[w].card_start = offset; | 220 | s->win[w].card_start = offset; |
| 221 | ret = s->ops->set_mem_map(s, &s->win[w]); | 221 | ret = s->ops->set_mem_map(s, &s->win[w]); |
| 222 | if (ret) | 222 | if (ret) |
| 223 | dev_warn(&s->dev, "failed to set_mem_map\n"); | 223 | dev_warn(&p_dev->dev, "failed to set_mem_map\n"); |
| 224 | mutex_unlock(&s->ops_mutex); | 224 | mutex_unlock(&s->ops_mutex); |
| 225 | return ret; | 225 | return ret; |
| 226 | } /* pcmcia_map_mem_page */ | 226 | } /* pcmcia_map_mem_page */ |
| @@ -244,18 +244,18 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev, | |||
| 244 | c = p_dev->function_config; | 244 | c = p_dev->function_config; |
| 245 | 245 | ||
| 246 | if (!(s->state & SOCKET_PRESENT)) { | 246 | if (!(s->state & SOCKET_PRESENT)) { |
| 247 | dev_dbg(&s->dev, "No card present\n"); | 247 | dev_dbg(&p_dev->dev, "No card present\n"); |
| 248 | ret = -ENODEV; | 248 | ret = -ENODEV; |
| 249 | goto unlock; | 249 | goto unlock; |
| 250 | } | 250 | } |
| 251 | if (!(c->state & CONFIG_LOCKED)) { | 251 | if (!(c->state & CONFIG_LOCKED)) { |
| 252 | dev_dbg(&s->dev, "Configuration isnt't locked\n"); | 252 | dev_dbg(&p_dev->dev, "Configuration isnt't locked\n"); |
| 253 | ret = -EACCES; | 253 | ret = -EACCES; |
| 254 | goto unlock; | 254 | goto unlock; |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | if (mod->Attributes & (CONF_IRQ_CHANGE_VALID | CONF_VCC_CHANGE_VALID)) { | 257 | if (mod->Attributes & (CONF_IRQ_CHANGE_VALID | CONF_VCC_CHANGE_VALID)) { |
| 258 | dev_dbg(&s->dev, | 258 | dev_dbg(&p_dev->dev, |
| 259 | "changing Vcc or IRQ is not allowed at this time\n"); | 259 | "changing Vcc or IRQ is not allowed at this time\n"); |
| 260 | ret = -EINVAL; | 260 | ret = -EINVAL; |
| 261 | goto unlock; | 261 | goto unlock; |
| @@ -265,20 +265,22 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev, | |||
| 265 | if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) && | 265 | if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) && |
| 266 | (mod->Attributes & CONF_VPP2_CHANGE_VALID)) { | 266 | (mod->Attributes & CONF_VPP2_CHANGE_VALID)) { |
| 267 | if (mod->Vpp1 != mod->Vpp2) { | 267 | if (mod->Vpp1 != mod->Vpp2) { |
| 268 | dev_dbg(&s->dev, "Vpp1 and Vpp2 must be the same\n"); | 268 | dev_dbg(&p_dev->dev, |
| 269 | "Vpp1 and Vpp2 must be the same\n"); | ||
| 269 | ret = -EINVAL; | 270 | ret = -EINVAL; |
| 270 | goto unlock; | 271 | goto unlock; |
| 271 | } | 272 | } |
| 272 | s->socket.Vpp = mod->Vpp1; | 273 | s->socket.Vpp = mod->Vpp1; |
| 273 | if (s->ops->set_socket(s, &s->socket)) { | 274 | if (s->ops->set_socket(s, &s->socket)) { |
| 274 | dev_printk(KERN_WARNING, &s->dev, | 275 | dev_printk(KERN_WARNING, &p_dev->dev, |
| 275 | "Unable to set VPP\n"); | 276 | "Unable to set VPP\n"); |
| 276 | ret = -EIO; | 277 | ret = -EIO; |
| 277 | goto unlock; | 278 | goto unlock; |
| 278 | } | 279 | } |
| 279 | } else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) || | 280 | } else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) || |
| 280 | (mod->Attributes & CONF_VPP2_CHANGE_VALID)) { | 281 | (mod->Attributes & CONF_VPP2_CHANGE_VALID)) { |
| 281 | dev_dbg(&s->dev, "changing Vcc is not allowed at this time\n"); | 282 | dev_dbg(&p_dev->dev, |
| 283 | "changing Vcc is not allowed at this time\n"); | ||
| 282 | ret = -EINVAL; | 284 | ret = -EINVAL; |
| 283 | goto unlock; | 285 | goto unlock; |
| 284 | } | 286 | } |
| @@ -401,7 +403,7 @@ int pcmcia_release_window(struct pcmcia_device *p_dev, struct resource *res) | |||
| 401 | win = &s->win[w]; | 403 | win = &s->win[w]; |
| 402 | 404 | ||
| 403 | if (!(p_dev->_win & CLIENT_WIN_REQ(w))) { | 405 | if (!(p_dev->_win & CLIENT_WIN_REQ(w))) { |
| 404 | dev_dbg(&s->dev, "not releasing unknown window\n"); | 406 | dev_dbg(&p_dev->dev, "not releasing unknown window\n"); |
| 405 | mutex_unlock(&s->ops_mutex); | 407 | mutex_unlock(&s->ops_mutex); |
| 406 | return -EINVAL; | 408 | return -EINVAL; |
| 407 | } | 409 | } |
| @@ -439,7 +441,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, | |||
| 439 | return -ENODEV; | 441 | return -ENODEV; |
| 440 | 442 | ||
| 441 | if (req->IntType & INT_CARDBUS) { | 443 | if (req->IntType & INT_CARDBUS) { |
| 442 | dev_dbg(&s->dev, "IntType may not be INT_CARDBUS\n"); | 444 | dev_dbg(&p_dev->dev, "IntType may not be INT_CARDBUS\n"); |
| 443 | return -EINVAL; | 445 | return -EINVAL; |
| 444 | } | 446 | } |
| 445 | 447 | ||
| @@ -447,7 +449,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, | |||
| 447 | c = p_dev->function_config; | 449 | c = p_dev->function_config; |
| 448 | if (c->state & CONFIG_LOCKED) { | 450 | if (c->state & CONFIG_LOCKED) { |
| 449 | mutex_unlock(&s->ops_mutex); | 451 | mutex_unlock(&s->ops_mutex); |
| 450 | dev_dbg(&s->dev, "Configuration is locked\n"); | 452 | dev_dbg(&p_dev->dev, "Configuration is locked\n"); |
| 451 | return -EACCES; | 453 | return -EACCES; |
| 452 | } | 454 | } |
| 453 | 455 | ||
| @@ -455,7 +457,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, | |||
| 455 | s->socket.Vpp = req->Vpp; | 457 | s->socket.Vpp = req->Vpp; |
| 456 | if (s->ops->set_socket(s, &s->socket)) { | 458 | if (s->ops->set_socket(s, &s->socket)) { |
| 457 | mutex_unlock(&s->ops_mutex); | 459 | mutex_unlock(&s->ops_mutex); |
| 458 | dev_printk(KERN_WARNING, &s->dev, | 460 | dev_printk(KERN_WARNING, &p_dev->dev, |
| 459 | "Unable to set socket state\n"); | 461 | "Unable to set socket state\n"); |
| 460 | return -EINVAL; | 462 | return -EINVAL; |
| 461 | } | 463 | } |
| @@ -569,19 +571,20 @@ int pcmcia_request_io(struct pcmcia_device *p_dev) | |||
| 569 | int ret = -EINVAL; | 571 | int ret = -EINVAL; |
| 570 | 572 | ||
| 571 | mutex_lock(&s->ops_mutex); | 573 | mutex_lock(&s->ops_mutex); |
| 572 | dev_dbg(&s->dev, "pcmcia_request_io: %pR , %pR", &c->io[0], &c->io[1]); | 574 | dev_dbg(&p_dev->dev, "pcmcia_request_io: %pR , %pR", |
| 575 | &c->io[0], &c->io[1]); | ||
| 573 | 576 | ||
| 574 | if (!(s->state & SOCKET_PRESENT)) { | 577 | if (!(s->state & SOCKET_PRESENT)) { |
| 575 | dev_dbg(&s->dev, "pcmcia_request_io: No card present\n"); | 578 | dev_dbg(&p_dev->dev, "pcmcia_request_io: No card present\n"); |
| 576 | goto out; | 579 | goto out; |
| 577 | } | 580 | } |
| 578 | 581 | ||
| 579 | if (c->state & CONFIG_LOCKED) { | 582 | if (c->state & CONFIG_LOCKED) { |
| 580 | dev_dbg(&s->dev, "Configuration is locked\n"); | 583 | dev_dbg(&p_dev->dev, "Configuration is locked\n"); |
| 581 | goto out; | 584 | goto out; |
| 582 | } | 585 | } |
| 583 | if (c->state & CONFIG_IO_REQ) { | 586 | if (c->state & CONFIG_IO_REQ) { |
| 584 | dev_dbg(&s->dev, "IO already configured\n"); | 587 | dev_dbg(&p_dev->dev, "IO already configured\n"); |
| 585 | goto out; | 588 | goto out; |
| 586 | } | 589 | } |
| 587 | 590 | ||
| @@ -592,7 +595,13 @@ int pcmcia_request_io(struct pcmcia_device *p_dev) | |||
| 592 | if (c->io[1].end) { | 595 | if (c->io[1].end) { |
| 593 | ret = alloc_io_space(s, &c->io[1], p_dev->io_lines); | 596 | ret = alloc_io_space(s, &c->io[1], p_dev->io_lines); |
| 594 | if (ret) { | 597 | if (ret) { |
| 598 | struct resource tmp = c->io[0]; | ||
| 599 | /* release the previously allocated resource */ | ||
| 595 | release_io_space(s, &c->io[0]); | 600 | release_io_space(s, &c->io[0]); |
| 601 | /* but preserve the settings, for they worked... */ | ||
| 602 | c->io[0].end = resource_size(&tmp); | ||
| 603 | c->io[0].start = tmp.start; | ||
| 604 | c->io[0].flags = tmp.flags; | ||
| 596 | goto out; | 605 | goto out; |
| 597 | } | 606 | } |
| 598 | } else | 607 | } else |
| @@ -601,7 +610,7 @@ int pcmcia_request_io(struct pcmcia_device *p_dev) | |||
| 601 | c->state |= CONFIG_IO_REQ; | 610 | c->state |= CONFIG_IO_REQ; |
| 602 | p_dev->_io = 1; | 611 | p_dev->_io = 1; |
| 603 | 612 | ||
| 604 | dev_dbg(&s->dev, "pcmcia_request_io succeeded: %pR , %pR", | 613 | dev_dbg(&p_dev->dev, "pcmcia_request_io succeeded: %pR , %pR", |
| 605 | &c->io[0], &c->io[1]); | 614 | &c->io[0], &c->io[1]); |
| 606 | out: | 615 | out: |
| 607 | mutex_unlock(&s->ops_mutex); | 616 | mutex_unlock(&s->ops_mutex); |
| @@ -800,7 +809,7 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_ha | |||
| 800 | int w; | 809 | int w; |
| 801 | 810 | ||
| 802 | if (!(s->state & SOCKET_PRESENT)) { | 811 | if (!(s->state & SOCKET_PRESENT)) { |
| 803 | dev_dbg(&s->dev, "No card present\n"); | 812 | dev_dbg(&p_dev->dev, "No card present\n"); |
| 804 | return -ENODEV; | 813 | return -ENODEV; |
| 805 | } | 814 | } |
| 806 | 815 | ||
| @@ -809,12 +818,12 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_ha | |||
| 809 | req->Size = s->map_size; | 818 | req->Size = s->map_size; |
| 810 | align = (s->features & SS_CAP_MEM_ALIGN) ? req->Size : s->map_size; | 819 | align = (s->features & SS_CAP_MEM_ALIGN) ? req->Size : s->map_size; |
| 811 | if (req->Size & (s->map_size-1)) { | 820 | if (req->Size & (s->map_size-1)) { |
| 812 | dev_dbg(&s->dev, "invalid map size\n"); | 821 | dev_dbg(&p_dev->dev, "invalid map size\n"); |
| 813 | return -EINVAL; | 822 | return -EINVAL; |
| 814 | } | 823 | } |
| 815 | if ((req->Base && (s->features & SS_CAP_STATIC_MAP)) || | 824 | if ((req->Base && (s->features & SS_CAP_STATIC_MAP)) || |
| 816 | (req->Base & (align-1))) { | 825 | (req->Base & (align-1))) { |
| 817 | dev_dbg(&s->dev, "invalid base address\n"); | 826 | dev_dbg(&p_dev->dev, "invalid base address\n"); |
| 818 | return -EINVAL; | 827 | return -EINVAL; |
| 819 | } | 828 | } |
| 820 | if (req->Base) | 829 | if (req->Base) |
| @@ -826,7 +835,7 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_ha | |||
| 826 | if (!(s->state & SOCKET_WIN_REQ(w))) | 835 | if (!(s->state & SOCKET_WIN_REQ(w))) |
| 827 | break; | 836 | break; |
| 828 | if (w == MAX_WIN) { | 837 | if (w == MAX_WIN) { |
| 829 | dev_dbg(&s->dev, "all windows are used already\n"); | 838 | dev_dbg(&p_dev->dev, "all windows are used already\n"); |
| 830 | mutex_unlock(&s->ops_mutex); | 839 | mutex_unlock(&s->ops_mutex); |
| 831 | return -EINVAL; | 840 | return -EINVAL; |
| 832 | } | 841 | } |
| @@ -837,7 +846,7 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_ha | |||
| 837 | win->res = pcmcia_find_mem_region(req->Base, req->Size, align, | 846 | win->res = pcmcia_find_mem_region(req->Base, req->Size, align, |
| 838 | 0, s); | 847 | 0, s); |
| 839 | if (!win->res) { | 848 | if (!win->res) { |
| 840 | dev_dbg(&s->dev, "allocating mem region failed\n"); | 849 | dev_dbg(&p_dev->dev, "allocating mem region failed\n"); |
| 841 | mutex_unlock(&s->ops_mutex); | 850 | mutex_unlock(&s->ops_mutex); |
| 842 | return -EINVAL; | 851 | return -EINVAL; |
| 843 | } | 852 | } |
| @@ -851,7 +860,7 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_ha | |||
| 851 | win->card_start = 0; | 860 | win->card_start = 0; |
| 852 | 861 | ||
| 853 | if (s->ops->set_mem_map(s, win) != 0) { | 862 | if (s->ops->set_mem_map(s, win) != 0) { |
| 854 | dev_dbg(&s->dev, "failed to set memory mapping\n"); | 863 | dev_dbg(&p_dev->dev, "failed to set memory mapping\n"); |
| 855 | mutex_unlock(&s->ops_mutex); | 864 | mutex_unlock(&s->ops_mutex); |
| 856 | return -EIO; | 865 | return -EIO; |
| 857 | } | 866 | } |
| @@ -874,7 +883,7 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_ha | |||
| 874 | if (win->res) | 883 | if (win->res) |
| 875 | request_resource(&iomem_resource, res); | 884 | request_resource(&iomem_resource, res); |
| 876 | 885 | ||
| 877 | dev_dbg(&s->dev, "request_window results in %pR\n", res); | 886 | dev_dbg(&p_dev->dev, "request_window results in %pR\n", res); |
| 878 | 887 | ||
| 879 | mutex_unlock(&s->ops_mutex); | 888 | mutex_unlock(&s->ops_mutex); |
| 880 | *wh = res; | 889 | *wh = res; |
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c index b8a869af0f44..deef6656ab7b 100644 --- a/drivers/pcmcia/pd6729.c +++ b/drivers/pcmcia/pd6729.c | |||
| @@ -646,7 +646,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev, | |||
| 646 | if (!pci_resource_start(dev, 0)) { | 646 | if (!pci_resource_start(dev, 0)) { |
| 647 | dev_warn(&dev->dev, "refusing to load the driver as the " | 647 | dev_warn(&dev->dev, "refusing to load the driver as the " |
| 648 | "io_base is NULL.\n"); | 648 | "io_base is NULL.\n"); |
| 649 | goto err_out_free_mem; | 649 | goto err_out_disable; |
| 650 | } | 650 | } |
| 651 | 651 | ||
| 652 | dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx " | 652 | dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx " |
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index 9024480a8228..c44a5e8b8b82 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c | |||
| @@ -51,7 +51,6 @@ | |||
| 51 | * TODO: | 51 | * TODO: |
| 52 | * - handle CPU hotplug | 52 | * - handle CPU hotplug |
| 53 | * - provide turbo enable/disable api | 53 | * - provide turbo enable/disable api |
| 54 | * - make sure we can write turbo enable/disable reg based on MISC_EN | ||
| 55 | * | 54 | * |
| 56 | * Related documents: | 55 | * Related documents: |
| 57 | * - CDI 403777, 403778 - Auburndale EDS vol 1 & 2 | 56 | * - CDI 403777, 403778 - Auburndale EDS vol 1 & 2 |
| @@ -230,7 +229,7 @@ | |||
| 230 | #define THM_TC2 0xac | 229 | #define THM_TC2 0xac |
| 231 | #define THM_DTV 0xb0 | 230 | #define THM_DTV 0xb0 |
| 232 | #define THM_ITV 0xd8 | 231 | #define THM_ITV 0xd8 |
| 233 | #define ITV_ME_SEQNO_MASK 0x000f0000 /* ME should update every ~200ms */ | 232 | #define ITV_ME_SEQNO_MASK 0x00ff0000 /* ME should update every ~200ms */ |
| 234 | #define ITV_ME_SEQNO_SHIFT (16) | 233 | #define ITV_ME_SEQNO_SHIFT (16) |
| 235 | #define ITV_MCH_TEMP_MASK 0x0000ff00 | 234 | #define ITV_MCH_TEMP_MASK 0x0000ff00 |
| 236 | #define ITV_MCH_TEMP_SHIFT (8) | 235 | #define ITV_MCH_TEMP_SHIFT (8) |
| @@ -325,6 +324,7 @@ struct ips_driver { | |||
| 325 | bool gpu_preferred; | 324 | bool gpu_preferred; |
| 326 | bool poll_turbo_status; | 325 | bool poll_turbo_status; |
| 327 | bool second_cpu; | 326 | bool second_cpu; |
| 327 | bool turbo_toggle_allowed; | ||
| 328 | struct ips_mcp_limits *limits; | 328 | struct ips_mcp_limits *limits; |
| 329 | 329 | ||
| 330 | /* Optional MCH interfaces for if i915 is in use */ | 330 | /* Optional MCH interfaces for if i915 is in use */ |
| @@ -415,7 +415,7 @@ static void ips_cpu_lower(struct ips_driver *ips) | |||
| 415 | new_limit = cur_limit - 8; /* 1W decrease */ | 415 | new_limit = cur_limit - 8; /* 1W decrease */ |
| 416 | 416 | ||
| 417 | /* Clamp to SKU TDP limit */ | 417 | /* Clamp to SKU TDP limit */ |
| 418 | if (((new_limit * 10) / 8) < (ips->orig_turbo_limit & TURBO_TDP_MASK)) | 418 | if (new_limit < (ips->orig_turbo_limit & TURBO_TDP_MASK)) |
| 419 | new_limit = ips->orig_turbo_limit & TURBO_TDP_MASK; | 419 | new_limit = ips->orig_turbo_limit & TURBO_TDP_MASK; |
| 420 | 420 | ||
| 421 | thm_writew(THM_MPCPC, (new_limit * 10) / 8); | 421 | thm_writew(THM_MPCPC, (new_limit * 10) / 8); |
| @@ -461,7 +461,8 @@ static void ips_enable_cpu_turbo(struct ips_driver *ips) | |||
| 461 | if (ips->__cpu_turbo_on) | 461 | if (ips->__cpu_turbo_on) |
| 462 | return; | 462 | return; |
| 463 | 463 | ||
| 464 | on_each_cpu(do_enable_cpu_turbo, ips, 1); | 464 | if (ips->turbo_toggle_allowed) |
| 465 | on_each_cpu(do_enable_cpu_turbo, ips, 1); | ||
| 465 | 466 | ||
| 466 | ips->__cpu_turbo_on = true; | 467 | ips->__cpu_turbo_on = true; |
| 467 | } | 468 | } |
| @@ -498,7 +499,8 @@ static void ips_disable_cpu_turbo(struct ips_driver *ips) | |||
| 498 | if (!ips->__cpu_turbo_on) | 499 | if (!ips->__cpu_turbo_on) |
| 499 | return; | 500 | return; |
| 500 | 501 | ||
| 501 | on_each_cpu(do_disable_cpu_turbo, ips, 1); | 502 | if (ips->turbo_toggle_allowed) |
| 503 | on_each_cpu(do_disable_cpu_turbo, ips, 1); | ||
| 502 | 504 | ||
| 503 | ips->__cpu_turbo_on = false; | 505 | ips->__cpu_turbo_on = false; |
| 504 | } | 506 | } |
| @@ -598,17 +600,29 @@ static bool mcp_exceeded(struct ips_driver *ips) | |||
| 598 | { | 600 | { |
| 599 | unsigned long flags; | 601 | unsigned long flags; |
| 600 | bool ret = false; | 602 | bool ret = false; |
| 603 | u32 temp_limit; | ||
| 604 | u32 avg_power; | ||
| 605 | const char *msg = "MCP limit exceeded: "; | ||
| 601 | 606 | ||
| 602 | spin_lock_irqsave(&ips->turbo_status_lock, flags); | 607 | spin_lock_irqsave(&ips->turbo_status_lock, flags); |
| 603 | if (ips->mcp_avg_temp > (ips->mcp_temp_limit * 100)) | 608 | |
| 604 | ret = true; | 609 | temp_limit = ips->mcp_temp_limit * 100; |
| 605 | if (ips->cpu_avg_power + ips->mch_avg_power > ips->mcp_power_limit) | 610 | if (ips->mcp_avg_temp > temp_limit) { |
| 611 | dev_info(&ips->dev->dev, | ||
| 612 | "%sAvg temp %u, limit %u\n", msg, ips->mcp_avg_temp, | ||
| 613 | temp_limit); | ||
| 606 | ret = true; | 614 | ret = true; |
| 607 | spin_unlock_irqrestore(&ips->turbo_status_lock, flags); | 615 | } |
| 608 | 616 | ||
| 609 | if (ret) | 617 | avg_power = ips->cpu_avg_power + ips->mch_avg_power; |
| 618 | if (avg_power > ips->mcp_power_limit) { | ||
| 610 | dev_info(&ips->dev->dev, | 619 | dev_info(&ips->dev->dev, |
| 611 | "MCP power or thermal limit exceeded\n"); | 620 | "%sAvg power %u, limit %u\n", msg, avg_power, |
| 621 | ips->mcp_power_limit); | ||
| 622 | ret = true; | ||
| 623 | } | ||
| 624 | |||
| 625 | spin_unlock_irqrestore(&ips->turbo_status_lock, flags); | ||
| 612 | 626 | ||
| 613 | return ret; | 627 | return ret; |
| 614 | } | 628 | } |
| @@ -663,6 +677,27 @@ static bool mch_exceeded(struct ips_driver *ips) | |||
| 663 | } | 677 | } |
| 664 | 678 | ||
| 665 | /** | 679 | /** |
| 680 | * verify_limits - verify BIOS provided limits | ||
| 681 | * @ips: IPS structure | ||
| 682 | * | ||
| 683 | * BIOS can optionally provide non-default limits for power and temp. Check | ||
| 684 | * them here and use the defaults if the BIOS values are not provided or | ||
| 685 | * are otherwise unusable. | ||
| 686 | */ | ||
| 687 | static void verify_limits(struct ips_driver *ips) | ||
| 688 | { | ||
| 689 | if (ips->mcp_power_limit < ips->limits->mcp_power_limit || | ||
| 690 | ips->mcp_power_limit > 35000) | ||
| 691 | ips->mcp_power_limit = ips->limits->mcp_power_limit; | ||
| 692 | |||
| 693 | if (ips->mcp_temp_limit < ips->limits->core_temp_limit || | ||
| 694 | ips->mcp_temp_limit < ips->limits->mch_temp_limit || | ||
| 695 | ips->mcp_temp_limit > 150) | ||
| 696 | ips->mcp_temp_limit = min(ips->limits->core_temp_limit, | ||
| 697 | ips->limits->mch_temp_limit); | ||
| 698 | } | ||
| 699 | |||
| 700 | /** | ||
| 666 | * update_turbo_limits - get various limits & settings from regs | 701 | * update_turbo_limits - get various limits & settings from regs |
| 667 | * @ips: IPS driver struct | 702 | * @ips: IPS driver struct |
| 668 | * | 703 | * |
| @@ -680,12 +715,21 @@ static void update_turbo_limits(struct ips_driver *ips) | |||
| 680 | u32 hts = thm_readl(THM_HTS); | 715 | u32 hts = thm_readl(THM_HTS); |
| 681 | 716 | ||
| 682 | ips->cpu_turbo_enabled = !(hts & HTS_PCTD_DIS); | 717 | ips->cpu_turbo_enabled = !(hts & HTS_PCTD_DIS); |
| 683 | ips->gpu_turbo_enabled = !(hts & HTS_GTD_DIS); | 718 | /* |
| 719 | * Disable turbo for now, until we can figure out why the power figures | ||
| 720 | * are wrong | ||
| 721 | */ | ||
| 722 | ips->cpu_turbo_enabled = false; | ||
| 723 | |||
| 724 | if (ips->gpu_busy) | ||
| 725 | ips->gpu_turbo_enabled = !(hts & HTS_GTD_DIS); | ||
| 726 | |||
| 684 | ips->core_power_limit = thm_readw(THM_MPCPC); | 727 | ips->core_power_limit = thm_readw(THM_MPCPC); |
| 685 | ips->mch_power_limit = thm_readw(THM_MMGPC); | 728 | ips->mch_power_limit = thm_readw(THM_MMGPC); |
| 686 | ips->mcp_temp_limit = thm_readw(THM_PTL); | 729 | ips->mcp_temp_limit = thm_readw(THM_PTL); |
| 687 | ips->mcp_power_limit = thm_readw(THM_MPPC); | 730 | ips->mcp_power_limit = thm_readw(THM_MPPC); |
| 688 | 731 | ||
| 732 | verify_limits(ips); | ||
| 689 | /* Ignore BIOS CPU vs GPU pref */ | 733 | /* Ignore BIOS CPU vs GPU pref */ |
| 690 | } | 734 | } |
| 691 | 735 | ||
| @@ -858,7 +902,7 @@ static u32 get_cpu_power(struct ips_driver *ips, u32 *last, int period) | |||
| 858 | ret = (ret * 1000) / 65535; | 902 | ret = (ret * 1000) / 65535; |
| 859 | *last = val; | 903 | *last = val; |
| 860 | 904 | ||
| 861 | return ret; | 905 | return 0; |
| 862 | } | 906 | } |
| 863 | 907 | ||
| 864 | static const u16 temp_decay_factor = 2; | 908 | static const u16 temp_decay_factor = 2; |
| @@ -940,7 +984,6 @@ static int ips_monitor(void *data) | |||
| 940 | kfree(mch_samples); | 984 | kfree(mch_samples); |
| 941 | kfree(cpu_samples); | 985 | kfree(cpu_samples); |
| 942 | kfree(mchp_samples); | 986 | kfree(mchp_samples); |
| 943 | kthread_stop(ips->adjust); | ||
| 944 | return -ENOMEM; | 987 | return -ENOMEM; |
| 945 | } | 988 | } |
| 946 | 989 | ||
| @@ -948,7 +991,7 @@ static int ips_monitor(void *data) | |||
| 948 | ITV_ME_SEQNO_SHIFT; | 991 | ITV_ME_SEQNO_SHIFT; |
| 949 | seqno_timestamp = get_jiffies_64(); | 992 | seqno_timestamp = get_jiffies_64(); |
| 950 | 993 | ||
| 951 | old_cpu_power = thm_readl(THM_CEC) / 65535; | 994 | old_cpu_power = thm_readl(THM_CEC); |
| 952 | schedule_timeout_interruptible(msecs_to_jiffies(IPS_SAMPLE_PERIOD)); | 995 | schedule_timeout_interruptible(msecs_to_jiffies(IPS_SAMPLE_PERIOD)); |
| 953 | 996 | ||
| 954 | /* Collect an initial average */ | 997 | /* Collect an initial average */ |
| @@ -1150,11 +1193,18 @@ static irqreturn_t ips_irq_handler(int irq, void *arg) | |||
| 1150 | STS_GPL_SHIFT; | 1193 | STS_GPL_SHIFT; |
| 1151 | /* ignore EC CPU vs GPU pref */ | 1194 | /* ignore EC CPU vs GPU pref */ |
| 1152 | ips->cpu_turbo_enabled = !(sts & STS_PCTD_DIS); | 1195 | ips->cpu_turbo_enabled = !(sts & STS_PCTD_DIS); |
| 1153 | ips->gpu_turbo_enabled = !(sts & STS_GTD_DIS); | 1196 | /* |
| 1197 | * Disable turbo for now, until we can figure | ||
| 1198 | * out why the power figures are wrong | ||
| 1199 | */ | ||
| 1200 | ips->cpu_turbo_enabled = false; | ||
| 1201 | if (ips->gpu_busy) | ||
| 1202 | ips->gpu_turbo_enabled = !(sts & STS_GTD_DIS); | ||
| 1154 | ips->mcp_temp_limit = (sts & STS_PTL_MASK) >> | 1203 | ips->mcp_temp_limit = (sts & STS_PTL_MASK) >> |
| 1155 | STS_PTL_SHIFT; | 1204 | STS_PTL_SHIFT; |
| 1156 | ips->mcp_power_limit = (tc1 & STS_PPL_MASK) >> | 1205 | ips->mcp_power_limit = (tc1 & STS_PPL_MASK) >> |
| 1157 | STS_PPL_SHIFT; | 1206 | STS_PPL_SHIFT; |
| 1207 | verify_limits(ips); | ||
| 1158 | spin_unlock(&ips->turbo_status_lock); | 1208 | spin_unlock(&ips->turbo_status_lock); |
| 1159 | 1209 | ||
| 1160 | thm_writeb(THM_SEC, SEC_ACK); | 1210 | thm_writeb(THM_SEC, SEC_ACK); |
| @@ -1333,8 +1383,10 @@ static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips) | |||
| 1333 | * turbo manually or we'll get an illegal MSR access, even though | 1383 | * turbo manually or we'll get an illegal MSR access, even though |
| 1334 | * turbo will still be available. | 1384 | * turbo will still be available. |
| 1335 | */ | 1385 | */ |
| 1336 | if (!(misc_en & IA32_MISC_TURBO_EN)) | 1386 | if (misc_en & IA32_MISC_TURBO_EN) |
| 1337 | ; /* add turbo MSR write allowed flag if necessary */ | 1387 | ips->turbo_toggle_allowed = true; |
| 1388 | else | ||
| 1389 | ips->turbo_toggle_allowed = false; | ||
| 1338 | 1390 | ||
| 1339 | if (strstr(boot_cpu_data.x86_model_id, "CPU M")) | 1391 | if (strstr(boot_cpu_data.x86_model_id, "CPU M")) |
| 1340 | limits = &ips_sv_limits; | 1392 | limits = &ips_sv_limits; |
| @@ -1351,9 +1403,10 @@ static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips) | |||
| 1351 | tdp = turbo_power & TURBO_TDP_MASK; | 1403 | tdp = turbo_power & TURBO_TDP_MASK; |
| 1352 | 1404 | ||
| 1353 | /* Sanity check TDP against CPU */ | 1405 | /* Sanity check TDP against CPU */ |
| 1354 | if (limits->mcp_power_limit != (tdp / 8) * 1000) { | 1406 | if (limits->core_power_limit != (tdp / 8) * 1000) { |
| 1355 | dev_warn(&ips->dev->dev, "Warning: CPU TDP doesn't match expected value (found %d, expected %d)\n", | 1407 | dev_info(&ips->dev->dev, "CPU TDP doesn't match expected value (found %d, expected %d)\n", |
| 1356 | tdp / 8, limits->mcp_power_limit / 1000); | 1408 | tdp / 8, limits->core_power_limit / 1000); |
| 1409 | limits->core_power_limit = (tdp / 8) * 1000; | ||
| 1357 | } | 1410 | } |
| 1358 | 1411 | ||
| 1359 | out: | 1412 | out: |
| @@ -1390,7 +1443,7 @@ static bool ips_get_i915_syms(struct ips_driver *ips) | |||
| 1390 | return true; | 1443 | return true; |
| 1391 | 1444 | ||
| 1392 | out_put_busy: | 1445 | out_put_busy: |
| 1393 | symbol_put(i915_gpu_turbo_disable); | 1446 | symbol_put(i915_gpu_busy); |
| 1394 | out_put_lower: | 1447 | out_put_lower: |
| 1395 | symbol_put(i915_gpu_lower); | 1448 | symbol_put(i915_gpu_lower); |
| 1396 | out_put_raise: | 1449 | out_put_raise: |
| @@ -1532,22 +1585,27 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 1532 | /* Save turbo limits & ratios */ | 1585 | /* Save turbo limits & ratios */ |
| 1533 | rdmsrl(TURBO_POWER_CURRENT_LIMIT, ips->orig_turbo_limit); | 1586 | rdmsrl(TURBO_POWER_CURRENT_LIMIT, ips->orig_turbo_limit); |
| 1534 | 1587 | ||
| 1535 | ips_enable_cpu_turbo(ips); | 1588 | ips_disable_cpu_turbo(ips); |
| 1536 | ips->cpu_turbo_enabled = true; | 1589 | ips->cpu_turbo_enabled = false; |
| 1537 | 1590 | ||
| 1538 | /* Set up the work queue and monitor/adjust threads */ | 1591 | /* Create thermal adjust thread */ |
| 1539 | ips->monitor = kthread_run(ips_monitor, ips, "ips-monitor"); | 1592 | ips->adjust = kthread_create(ips_adjust, ips, "ips-adjust"); |
| 1540 | if (IS_ERR(ips->monitor)) { | 1593 | if (IS_ERR(ips->adjust)) { |
| 1541 | dev_err(&dev->dev, | 1594 | dev_err(&dev->dev, |
| 1542 | "failed to create thermal monitor thread, aborting\n"); | 1595 | "failed to create thermal adjust thread, aborting\n"); |
| 1543 | ret = -ENOMEM; | 1596 | ret = -ENOMEM; |
| 1544 | goto error_free_irq; | 1597 | goto error_free_irq; |
| 1598 | |||
| 1545 | } | 1599 | } |
| 1546 | 1600 | ||
| 1547 | ips->adjust = kthread_create(ips_adjust, ips, "ips-adjust"); | 1601 | /* |
| 1548 | if (IS_ERR(ips->adjust)) { | 1602 | * Set up the work queue and monitor thread. The monitor thread |
| 1603 | * will wake up ips_adjust thread. | ||
| 1604 | */ | ||
| 1605 | ips->monitor = kthread_run(ips_monitor, ips, "ips-monitor"); | ||
| 1606 | if (IS_ERR(ips->monitor)) { | ||
| 1549 | dev_err(&dev->dev, | 1607 | dev_err(&dev->dev, |
| 1550 | "failed to create thermal adjust thread, aborting\n"); | 1608 | "failed to create thermal monitor thread, aborting\n"); |
| 1551 | ret = -ENOMEM; | 1609 | ret = -ENOMEM; |
| 1552 | goto error_thread_cleanup; | 1610 | goto error_thread_cleanup; |
| 1553 | } | 1611 | } |
| @@ -1566,7 +1624,7 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 1566 | return ret; | 1624 | return ret; |
| 1567 | 1625 | ||
| 1568 | error_thread_cleanup: | 1626 | error_thread_cleanup: |
| 1569 | kthread_stop(ips->monitor); | 1627 | kthread_stop(ips->adjust); |
| 1570 | error_free_irq: | 1628 | error_free_irq: |
| 1571 | free_irq(ips->dev->irq, ips); | 1629 | free_irq(ips->dev->irq, ips); |
| 1572 | error_unmap: | 1630 | error_unmap: |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index e35ed128bdef..2d61186ad5a2 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
| @@ -3093,7 +3093,8 @@ static const struct tpacpi_quirk tpacpi_hotkey_qtable[] __initconst = { | |||
| 3093 | TPACPI_Q_IBM('1', 'D', TPACPI_HK_Q_INIMASK), /* X22, X23, X24 */ | 3093 | TPACPI_Q_IBM('1', 'D', TPACPI_HK_Q_INIMASK), /* X22, X23, X24 */ |
| 3094 | }; | 3094 | }; |
| 3095 | 3095 | ||
| 3096 | typedef u16 tpacpi_keymap_t[TPACPI_HOTKEY_MAP_LEN]; | 3096 | typedef u16 tpacpi_keymap_entry_t; |
| 3097 | typedef tpacpi_keymap_entry_t tpacpi_keymap_t[TPACPI_HOTKEY_MAP_LEN]; | ||
| 3097 | 3098 | ||
| 3098 | static int __init hotkey_init(struct ibm_init_struct *iibm) | 3099 | static int __init hotkey_init(struct ibm_init_struct *iibm) |
| 3099 | { | 3100 | { |
| @@ -3230,7 +3231,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
| 3230 | }; | 3231 | }; |
| 3231 | 3232 | ||
| 3232 | #define TPACPI_HOTKEY_MAP_SIZE sizeof(tpacpi_keymap_t) | 3233 | #define TPACPI_HOTKEY_MAP_SIZE sizeof(tpacpi_keymap_t) |
| 3233 | #define TPACPI_HOTKEY_MAP_TYPESIZE sizeof(tpacpi_keymap_t[0]) | 3234 | #define TPACPI_HOTKEY_MAP_TYPESIZE sizeof(tpacpi_keymap_entry_t) |
| 3234 | 3235 | ||
| 3235 | int res, i; | 3236 | int res, i; |
| 3236 | int status; | 3237 | int status; |
diff --git a/drivers/power/apm_power.c b/drivers/power/apm_power.c index 936bae560fa1..dc628cb2e762 100644 --- a/drivers/power/apm_power.c +++ b/drivers/power/apm_power.c | |||
| @@ -233,6 +233,7 @@ static int calculate_capacity(enum apm_source source) | |||
| 233 | empty_design_prop = POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN; | 233 | empty_design_prop = POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN; |
| 234 | now_prop = POWER_SUPPLY_PROP_ENERGY_NOW; | 234 | now_prop = POWER_SUPPLY_PROP_ENERGY_NOW; |
| 235 | avg_prop = POWER_SUPPLY_PROP_ENERGY_AVG; | 235 | avg_prop = POWER_SUPPLY_PROP_ENERGY_AVG; |
| 236 | break; | ||
| 236 | case SOURCE_VOLTAGE: | 237 | case SOURCE_VOLTAGE: |
| 237 | full_prop = POWER_SUPPLY_PROP_VOLTAGE_MAX; | 238 | full_prop = POWER_SUPPLY_PROP_VOLTAGE_MAX; |
| 238 | empty_prop = POWER_SUPPLY_PROP_VOLTAGE_MIN; | 239 | empty_prop = POWER_SUPPLY_PROP_VOLTAGE_MIN; |
diff --git a/drivers/power/intel_mid_battery.c b/drivers/power/intel_mid_battery.c index c61ffec2ff10..2a10cd361181 100644 --- a/drivers/power/intel_mid_battery.c +++ b/drivers/power/intel_mid_battery.c | |||
| @@ -185,8 +185,8 @@ static int pmic_scu_ipc_battery_property_get(struct battery_property *prop) | |||
| 185 | { | 185 | { |
| 186 | u32 data[3]; | 186 | u32 data[3]; |
| 187 | u8 *p = (u8 *)&data[1]; | 187 | u8 *p = (u8 *)&data[1]; |
| 188 | int err = intel_scu_ipc_command(IPC_CMD_BATTERY_PROPERTY, | 188 | int err = intel_scu_ipc_command(IPCMSG_BATTERY, |
| 189 | IPCMSG_BATTERY, NULL, 0, data, 3); | 189 | IPC_CMD_BATTERY_PROPERTY, NULL, 0, data, 3); |
| 190 | 190 | ||
| 191 | prop->capacity = data[0]; | 191 | prop->capacity = data[0]; |
| 192 | prop->crnt = *p++; | 192 | prop->crnt = *p++; |
| @@ -207,7 +207,7 @@ static int pmic_scu_ipc_battery_property_get(struct battery_property *prop) | |||
| 207 | 207 | ||
| 208 | static int pmic_scu_ipc_set_charger(int charger) | 208 | static int pmic_scu_ipc_set_charger(int charger) |
| 209 | { | 209 | { |
| 210 | return intel_scu_ipc_simple_command(charger, IPCMSG_BATTERY); | 210 | return intel_scu_ipc_simple_command(IPCMSG_BATTERY, charger); |
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | /** | 213 | /** |
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c index 7d149a8d8d9b..2ce2eb71d0f5 100644 --- a/drivers/regulator/88pm8607.c +++ b/drivers/regulator/88pm8607.c | |||
| @@ -215,7 +215,7 @@ static int pm8607_list_voltage(struct regulator_dev *rdev, unsigned index) | |||
| 215 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); | 215 | struct pm8607_regulator_info *info = rdev_get_drvdata(rdev); |
| 216 | int ret = -EINVAL; | 216 | int ret = -EINVAL; |
| 217 | 217 | ||
| 218 | if (info->vol_table && (index < (2 << info->vol_nbits))) { | 218 | if (info->vol_table && (index < (1 << info->vol_nbits))) { |
| 219 | ret = info->vol_table[index]; | 219 | ret = info->vol_table[index]; |
| 220 | if (info->slope_double) | 220 | if (info->slope_double) |
| 221 | ret <<= 1; | 221 | ret <<= 1; |
| @@ -233,7 +233,7 @@ static int choose_voltage(struct regulator_dev *rdev, int min_uV, int max_uV) | |||
| 233 | max_uV = max_uV >> 1; | 233 | max_uV = max_uV >> 1; |
| 234 | } | 234 | } |
| 235 | if (info->vol_table) { | 235 | if (info->vol_table) { |
| 236 | for (i = 0; i < (2 << info->vol_nbits); i++) { | 236 | for (i = 0; i < (1 << info->vol_nbits); i++) { |
| 237 | if (!info->vol_table[i]) | 237 | if (!info->vol_table[i]) |
| 238 | break; | 238 | break; |
| 239 | if ((min_uV <= info->vol_table[i]) | 239 | if ((min_uV <= info->vol_table[i]) |
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c index 11790990277a..b349266a43de 100644 --- a/drivers/regulator/ab3100.c +++ b/drivers/regulator/ab3100.c | |||
| @@ -634,12 +634,9 @@ static int __devinit ab3100_regulators_probe(struct platform_device *pdev) | |||
| 634 | "%s: failed to register regulator %s err %d\n", | 634 | "%s: failed to register regulator %s err %d\n", |
| 635 | __func__, ab3100_regulator_desc[i].name, | 635 | __func__, ab3100_regulator_desc[i].name, |
| 636 | err); | 636 | err); |
| 637 | i--; | ||
| 638 | /* remove the already registered regulators */ | 637 | /* remove the already registered regulators */ |
| 639 | while (i > 0) { | 638 | while (--i >= 0) |
| 640 | regulator_unregister(ab3100_regulators[i].rdev); | 639 | regulator_unregister(ab3100_regulators[i].rdev); |
| 641 | i--; | ||
| 642 | } | ||
| 643 | return err; | 640 | return err; |
| 644 | } | 641 | } |
| 645 | 642 | ||
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index dc3f1a491675..28c7ae67cec9 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c | |||
| @@ -157,7 +157,7 @@ static int ab8500_list_voltage(struct regulator_dev *rdev, unsigned selector) | |||
| 157 | if (info->fixed_uV) | 157 | if (info->fixed_uV) |
| 158 | return info->fixed_uV; | 158 | return info->fixed_uV; |
| 159 | 159 | ||
| 160 | if (selector > info->voltages_len) | 160 | if (selector >= info->voltages_len) |
| 161 | return -EINVAL; | 161 | return -EINVAL; |
| 162 | 162 | ||
| 163 | return info->supported_voltages[selector]; | 163 | return info->supported_voltages[selector]; |
| @@ -344,13 +344,14 @@ static inline struct ab8500_regulator_info *find_regulator_info(int id) | |||
| 344 | static __devinit int ab8500_regulator_probe(struct platform_device *pdev) | 344 | static __devinit int ab8500_regulator_probe(struct platform_device *pdev) |
| 345 | { | 345 | { |
| 346 | struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); | 346 | struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); |
| 347 | struct ab8500_platform_data *pdata = dev_get_platdata(ab8500->dev); | 347 | struct ab8500_platform_data *pdata; |
| 348 | int i, err; | 348 | int i, err; |
| 349 | 349 | ||
| 350 | if (!ab8500) { | 350 | if (!ab8500) { |
| 351 | dev_err(&pdev->dev, "null mfd parent\n"); | 351 | dev_err(&pdev->dev, "null mfd parent\n"); |
| 352 | return -EINVAL; | 352 | return -EINVAL; |
| 353 | } | 353 | } |
| 354 | pdata = dev_get_platdata(ab8500->dev); | ||
| 354 | 355 | ||
| 355 | /* register all regulators */ | 356 | /* register all regulators */ |
| 356 | for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) { | 357 | for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) { |
| @@ -368,11 +369,9 @@ static __devinit int ab8500_regulator_probe(struct platform_device *pdev) | |||
| 368 | dev_err(&pdev->dev, "failed to register regulator %s\n", | 369 | dev_err(&pdev->dev, "failed to register regulator %s\n", |
| 369 | info->desc.name); | 370 | info->desc.name); |
| 370 | /* when we fail, un-register all earlier regulators */ | 371 | /* when we fail, un-register all earlier regulators */ |
| 371 | i--; | 372 | while (--i >= 0) { |
| 372 | while (i > 0) { | ||
| 373 | info = &ab8500_regulator_info[i]; | 373 | info = &ab8500_regulator_info[i]; |
| 374 | regulator_unregister(info->regulator); | 374 | regulator_unregister(info->regulator); |
| 375 | i--; | ||
| 376 | } | 375 | } |
| 377 | return err; | 376 | return err; |
| 378 | } | 377 | } |
diff --git a/drivers/regulator/ad5398.c b/drivers/regulator/ad5398.c index d59d2f2314af..a4be41614eeb 100644 --- a/drivers/regulator/ad5398.c +++ b/drivers/regulator/ad5398.c | |||
| @@ -25,7 +25,7 @@ struct ad5398_chip_info { | |||
| 25 | unsigned int current_level; | 25 | unsigned int current_level; |
| 26 | unsigned int current_mask; | 26 | unsigned int current_mask; |
| 27 | unsigned int current_offset; | 27 | unsigned int current_offset; |
| 28 | struct regulator_dev rdev; | 28 | struct regulator_dev *rdev; |
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | static int ad5398_calc_current(struct ad5398_chip_info *chip, | 31 | static int ad5398_calc_current(struct ad5398_chip_info *chip, |
| @@ -211,7 +211,6 @@ MODULE_DEVICE_TABLE(i2c, ad5398_id); | |||
| 211 | static int __devinit ad5398_probe(struct i2c_client *client, | 211 | static int __devinit ad5398_probe(struct i2c_client *client, |
| 212 | const struct i2c_device_id *id) | 212 | const struct i2c_device_id *id) |
| 213 | { | 213 | { |
| 214 | struct regulator_dev *rdev; | ||
| 215 | struct regulator_init_data *init_data = client->dev.platform_data; | 214 | struct regulator_init_data *init_data = client->dev.platform_data; |
| 216 | struct ad5398_chip_info *chip; | 215 | struct ad5398_chip_info *chip; |
| 217 | const struct ad5398_current_data_format *df = | 216 | const struct ad5398_current_data_format *df = |
| @@ -233,9 +232,10 @@ static int __devinit ad5398_probe(struct i2c_client *client, | |||
| 233 | chip->current_offset = df->current_offset; | 232 | chip->current_offset = df->current_offset; |
| 234 | chip->current_mask = (chip->current_level - 1) << chip->current_offset; | 233 | chip->current_mask = (chip->current_level - 1) << chip->current_offset; |
| 235 | 234 | ||
| 236 | rdev = regulator_register(&ad5398_reg, &client->dev, init_data, chip); | 235 | chip->rdev = regulator_register(&ad5398_reg, &client->dev, |
| 237 | if (IS_ERR(rdev)) { | 236 | init_data, chip); |
| 238 | ret = PTR_ERR(rdev); | 237 | if (IS_ERR(chip->rdev)) { |
| 238 | ret = PTR_ERR(chip->rdev); | ||
| 239 | dev_err(&client->dev, "failed to register %s %s\n", | 239 | dev_err(&client->dev, "failed to register %s %s\n", |
| 240 | id->name, ad5398_reg.name); | 240 | id->name, ad5398_reg.name); |
| 241 | goto err; | 241 | goto err; |
| @@ -254,9 +254,8 @@ static int __devexit ad5398_remove(struct i2c_client *client) | |||
| 254 | { | 254 | { |
| 255 | struct ad5398_chip_info *chip = i2c_get_clientdata(client); | 255 | struct ad5398_chip_info *chip = i2c_get_clientdata(client); |
| 256 | 256 | ||
| 257 | regulator_unregister(&chip->rdev); | 257 | regulator_unregister(chip->rdev); |
| 258 | kfree(chip); | 258 | kfree(chip); |
| 259 | i2c_set_clientdata(client, NULL); | ||
| 260 | 259 | ||
| 261 | return 0; | 260 | return 0; |
| 262 | } | 261 | } |
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 422a709d271d..cc8b337b9119 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
| @@ -700,7 +700,7 @@ static void print_constraints(struct regulator_dev *rdev) | |||
| 700 | constraints->min_uA != constraints->max_uA) { | 700 | constraints->min_uA != constraints->max_uA) { |
| 701 | ret = _regulator_get_current_limit(rdev); | 701 | ret = _regulator_get_current_limit(rdev); |
| 702 | if (ret > 0) | 702 | if (ret > 0) |
| 703 | count += sprintf(buf + count, "at %d uA ", ret / 1000); | 703 | count += sprintf(buf + count, "at %d mA ", ret / 1000); |
| 704 | } | 704 | } |
| 705 | 705 | ||
| 706 | if (constraints->valid_modes_mask & REGULATOR_MODE_FAST) | 706 | if (constraints->valid_modes_mask & REGULATOR_MODE_FAST) |
| @@ -2302,8 +2302,10 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | |||
| 2302 | dev_set_name(&rdev->dev, "regulator.%d", | 2302 | dev_set_name(&rdev->dev, "regulator.%d", |
| 2303 | atomic_inc_return(®ulator_no) - 1); | 2303 | atomic_inc_return(®ulator_no) - 1); |
| 2304 | ret = device_register(&rdev->dev); | 2304 | ret = device_register(&rdev->dev); |
| 2305 | if (ret != 0) | 2305 | if (ret != 0) { |
| 2306 | put_device(&rdev->dev); | ||
| 2306 | goto clean; | 2307 | goto clean; |
| 2308 | } | ||
| 2307 | 2309 | ||
| 2308 | dev_set_drvdata(&rdev->dev, rdev); | 2310 | dev_set_drvdata(&rdev->dev, rdev); |
| 2309 | 2311 | ||
diff --git a/drivers/regulator/isl6271a-regulator.c b/drivers/regulator/isl6271a-regulator.c index e49d2bd393f2..b8cc6389a541 100644 --- a/drivers/regulator/isl6271a-regulator.c +++ b/drivers/regulator/isl6271a-regulator.c | |||
| @@ -165,7 +165,7 @@ static int __devinit isl6271a_probe(struct i2c_client *i2c, | |||
| 165 | mutex_init(&pmic->mtx); | 165 | mutex_init(&pmic->mtx); |
| 166 | 166 | ||
| 167 | for (i = 0; i < 3; i++) { | 167 | for (i = 0; i < 3; i++) { |
| 168 | pmic->rdev[i] = regulator_register(&isl_rd[0], &i2c->dev, | 168 | pmic->rdev[i] = regulator_register(&isl_rd[i], &i2c->dev, |
| 169 | init_data, pmic); | 169 | init_data, pmic); |
| 170 | if (IS_ERR(pmic->rdev[i])) { | 170 | if (IS_ERR(pmic->rdev[i])) { |
| 171 | dev_err(&i2c->dev, "failed to register %s\n", id->name); | 171 | dev_err(&i2c->dev, "failed to register %s\n", id->name); |
| @@ -191,8 +191,6 @@ static int __devexit isl6271a_remove(struct i2c_client *i2c) | |||
| 191 | struct isl_pmic *pmic = i2c_get_clientdata(i2c); | 191 | struct isl_pmic *pmic = i2c_get_clientdata(i2c); |
| 192 | int i; | 192 | int i; |
| 193 | 193 | ||
| 194 | i2c_set_clientdata(i2c, NULL); | ||
| 195 | |||
| 196 | for (i = 0; i < 3; i++) | 194 | for (i = 0; i < 3; i++) |
| 197 | regulator_unregister(pmic->rdev[i]); | 195 | regulator_unregister(pmic->rdev[i]); |
| 198 | 196 | ||
diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index 8867c2710a6d..559cfa271a44 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c | |||
| @@ -121,14 +121,14 @@ static int max1586_v6_set(struct regulator_dev *rdev, int min_uV, int max_uV) | |||
| 121 | if (max_uV < MAX1586_V6_MIN_UV || max_uV > MAX1586_V6_MAX_UV) | 121 | if (max_uV < MAX1586_V6_MIN_UV || max_uV > MAX1586_V6_MAX_UV) |
| 122 | return -EINVAL; | 122 | return -EINVAL; |
| 123 | 123 | ||
| 124 | if (min_uV >= 3000000) | ||
| 125 | selector = 3; | ||
| 126 | if (min_uV < 3000000) | ||
| 127 | selector = 2; | ||
| 128 | if (min_uV < 2500000) | ||
| 129 | selector = 1; | ||
| 130 | if (min_uV < 1800000) | 124 | if (min_uV < 1800000) |
| 131 | selector = 0; | 125 | selector = 0; |
| 126 | else if (min_uV < 2500000) | ||
| 127 | selector = 1; | ||
| 128 | else if (min_uV < 3000000) | ||
| 129 | selector = 2; | ||
| 130 | else if (min_uV >= 3000000) | ||
| 131 | selector = 3; | ||
| 132 | 132 | ||
| 133 | if (max1586_v6_calc_voltage(selector) > max_uV) | 133 | if (max1586_v6_calc_voltage(selector) > max_uV) |
| 134 | return -EINVAL; | 134 | return -EINVAL; |
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c index 4520ace3f7e7..6b60a9c0366b 100644 --- a/drivers/regulator/max8649.c +++ b/drivers/regulator/max8649.c | |||
| @@ -330,7 +330,7 @@ static int __devinit max8649_regulator_probe(struct i2c_client *client, | |||
| 330 | /* set external clock frequency */ | 330 | /* set external clock frequency */ |
| 331 | info->extclk_freq = pdata->extclk_freq; | 331 | info->extclk_freq = pdata->extclk_freq; |
| 332 | max8649_set_bits(info->i2c, MAX8649_SYNC, MAX8649_EXT_MASK, | 332 | max8649_set_bits(info->i2c, MAX8649_SYNC, MAX8649_EXT_MASK, |
| 333 | info->extclk_freq); | 333 | info->extclk_freq << 6); |
| 334 | } | 334 | } |
| 335 | 335 | ||
| 336 | if (pdata->ramp_timing) { | 336 | if (pdata->ramp_timing) { |
diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c index ab67298799f9..a1baf1fbe004 100644 --- a/drivers/regulator/max8998.c +++ b/drivers/regulator/max8998.c | |||
| @@ -549,7 +549,7 @@ static __devinit int max8998_pmic_probe(struct platform_device *pdev) | |||
| 549 | if (!max8998) | 549 | if (!max8998) |
| 550 | return -ENOMEM; | 550 | return -ENOMEM; |
| 551 | 551 | ||
| 552 | size = sizeof(struct regulator_dev *) * (pdata->num_regulators + 1); | 552 | size = sizeof(struct regulator_dev *) * pdata->num_regulators; |
| 553 | max8998->rdev = kzalloc(size, GFP_KERNEL); | 553 | max8998->rdev = kzalloc(size, GFP_KERNEL); |
| 554 | if (!max8998->rdev) { | 554 | if (!max8998->rdev) { |
| 555 | kfree(max8998); | 555 | kfree(max8998); |
| @@ -557,7 +557,9 @@ static __devinit int max8998_pmic_probe(struct platform_device *pdev) | |||
| 557 | } | 557 | } |
| 558 | 558 | ||
| 559 | rdev = max8998->rdev; | 559 | rdev = max8998->rdev; |
| 560 | max8998->dev = &pdev->dev; | ||
| 560 | max8998->iodev = iodev; | 561 | max8998->iodev = iodev; |
| 562 | max8998->num_regulators = pdata->num_regulators; | ||
| 561 | platform_set_drvdata(pdev, max8998); | 563 | platform_set_drvdata(pdev, max8998); |
| 562 | 564 | ||
| 563 | for (i = 0; i < pdata->num_regulators; i++) { | 565 | for (i = 0; i < pdata->num_regulators; i++) { |
| @@ -583,7 +585,7 @@ static __devinit int max8998_pmic_probe(struct platform_device *pdev) | |||
| 583 | 585 | ||
| 584 | return 0; | 586 | return 0; |
| 585 | err: | 587 | err: |
| 586 | for (i = 0; i <= max8998->num_regulators; i++) | 588 | for (i = 0; i < max8998->num_regulators; i++) |
| 587 | if (rdev[i]) | 589 | if (rdev[i]) |
| 588 | regulator_unregister(rdev[i]); | 590 | regulator_unregister(rdev[i]); |
| 589 | 591 | ||
| @@ -599,7 +601,7 @@ static int __devexit max8998_pmic_remove(struct platform_device *pdev) | |||
| 599 | struct regulator_dev **rdev = max8998->rdev; | 601 | struct regulator_dev **rdev = max8998->rdev; |
| 600 | int i; | 602 | int i; |
| 601 | 603 | ||
| 602 | for (i = 0; i <= max8998->num_regulators; i++) | 604 | for (i = 0; i < max8998->num_regulators; i++) |
| 603 | if (rdev[i]) | 605 | if (rdev[i]) |
| 604 | regulator_unregister(rdev[i]); | 606 | regulator_unregister(rdev[i]); |
| 605 | 607 | ||
diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index c239f42aa4a3..020f5878d7ff 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c | |||
| @@ -626,12 +626,6 @@ fail: | |||
| 626 | return error; | 626 | return error; |
| 627 | } | 627 | } |
| 628 | 628 | ||
| 629 | /** | ||
| 630 | * tps6507x_remove - TPS6507x driver i2c remove handler | ||
| 631 | * @client: i2c driver client device structure | ||
| 632 | * | ||
| 633 | * Unregister TPS driver as an i2c client device driver | ||
| 634 | */ | ||
| 635 | static int __devexit tps6507x_pmic_remove(struct platform_device *pdev) | 629 | static int __devexit tps6507x_pmic_remove(struct platform_device *pdev) |
| 636 | { | 630 | { |
| 637 | struct tps6507x_dev *tps6507x_dev = platform_get_drvdata(pdev); | 631 | struct tps6507x_dev *tps6507x_dev = platform_get_drvdata(pdev); |
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c index 8cff1413a147..51237fbb1bbb 100644 --- a/drivers/regulator/tps6586x-regulator.c +++ b/drivers/regulator/tps6586x-regulator.c | |||
| @@ -133,7 +133,7 @@ static int tps6586x_ldo_get_voltage(struct regulator_dev *rdev) | |||
| 133 | mask = ((1 << ri->volt_nbits) - 1) << ri->volt_shift; | 133 | mask = ((1 << ri->volt_nbits) - 1) << ri->volt_shift; |
| 134 | val = (val & mask) >> ri->volt_shift; | 134 | val = (val & mask) >> ri->volt_shift; |
| 135 | 135 | ||
| 136 | if (val > ri->desc.n_voltages) | 136 | if (val >= ri->desc.n_voltages) |
| 137 | BUG(); | 137 | BUG(); |
| 138 | 138 | ||
| 139 | return ri->voltages[val] * 1000; | 139 | return ri->voltages[val] * 1000; |
| @@ -150,7 +150,7 @@ static int tps6586x_dvm_set_voltage(struct regulator_dev *rdev, | |||
| 150 | if (ret) | 150 | if (ret) |
| 151 | return ret; | 151 | return ret; |
| 152 | 152 | ||
| 153 | return tps6586x_set_bits(parent, ri->go_reg, ri->go_bit); | 153 | return tps6586x_set_bits(parent, ri->go_reg, 1 << ri->go_bit); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | static int tps6586x_regulator_enable(struct regulator_dev *rdev) | 156 | static int tps6586x_regulator_enable(struct regulator_dev *rdev) |
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c index e686cdb61b97..9edf8f692341 100644 --- a/drivers/regulator/wm831x-ldo.c +++ b/drivers/regulator/wm831x-ldo.c | |||
| @@ -215,8 +215,7 @@ static int wm831x_gp_ldo_set_mode(struct regulator_dev *rdev, | |||
| 215 | 215 | ||
| 216 | case REGULATOR_MODE_IDLE: | 216 | case REGULATOR_MODE_IDLE: |
| 217 | ret = wm831x_set_bits(wm831x, ctrl_reg, | 217 | ret = wm831x_set_bits(wm831x, ctrl_reg, |
| 218 | WM831X_LDO1_LP_MODE, | 218 | WM831X_LDO1_LP_MODE, 0); |
| 219 | WM831X_LDO1_LP_MODE); | ||
| 220 | if (ret < 0) | 219 | if (ret < 0) |
| 221 | return ret; | 220 | return ret; |
| 222 | 221 | ||
| @@ -225,10 +224,12 @@ static int wm831x_gp_ldo_set_mode(struct regulator_dev *rdev, | |||
| 225 | WM831X_LDO1_ON_MODE); | 224 | WM831X_LDO1_ON_MODE); |
| 226 | if (ret < 0) | 225 | if (ret < 0) |
| 227 | return ret; | 226 | return ret; |
| 227 | break; | ||
| 228 | 228 | ||
| 229 | case REGULATOR_MODE_STANDBY: | 229 | case REGULATOR_MODE_STANDBY: |
| 230 | ret = wm831x_set_bits(wm831x, ctrl_reg, | 230 | ret = wm831x_set_bits(wm831x, ctrl_reg, |
| 231 | WM831X_LDO1_LP_MODE, 0); | 231 | WM831X_LDO1_LP_MODE, |
| 232 | WM831X_LDO1_LP_MODE); | ||
| 232 | if (ret < 0) | 233 | if (ret < 0) |
| 233 | return ret; | 234 | return ret; |
| 234 | 235 | ||
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 0e6ed7db9364..fe4b8a8a9dfd 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c | |||
| @@ -1129,7 +1129,7 @@ static unsigned int wm8350_dcdc_get_mode(struct regulator_dev *rdev) | |||
| 1129 | mode = REGULATOR_MODE_NORMAL; | 1129 | mode = REGULATOR_MODE_NORMAL; |
| 1130 | } else if (!active && !sleep) | 1130 | } else if (!active && !sleep) |
| 1131 | mode = REGULATOR_MODE_IDLE; | 1131 | mode = REGULATOR_MODE_IDLE; |
| 1132 | else if (!sleep) | 1132 | else if (sleep) |
| 1133 | mode = REGULATOR_MODE_STANDBY; | 1133 | mode = REGULATOR_MODE_STANDBY; |
| 1134 | 1134 | ||
| 1135 | return mode; | 1135 | return mode; |
diff --git a/drivers/rtc/rtc-ab3100.c b/drivers/rtc/rtc-ab3100.c index d26780ea254b..261a07e0fb24 100644 --- a/drivers/rtc/rtc-ab3100.c +++ b/drivers/rtc/rtc-ab3100.c | |||
| @@ -235,6 +235,7 @@ static int __init ab3100_rtc_probe(struct platform_device *pdev) | |||
| 235 | err = PTR_ERR(rtc); | 235 | err = PTR_ERR(rtc); |
| 236 | return err; | 236 | return err; |
| 237 | } | 237 | } |
| 238 | platform_set_drvdata(pdev, rtc); | ||
| 238 | 239 | ||
| 239 | return 0; | 240 | return 0; |
| 240 | } | 241 | } |
| @@ -244,6 +245,7 @@ static int __exit ab3100_rtc_remove(struct platform_device *pdev) | |||
| 244 | struct rtc_device *rtc = platform_get_drvdata(pdev); | 245 | struct rtc_device *rtc = platform_get_drvdata(pdev); |
| 245 | 246 | ||
| 246 | rtc_device_unregister(rtc); | 247 | rtc_device_unregister(rtc); |
| 248 | platform_set_drvdata(pdev, NULL); | ||
| 247 | return 0; | 249 | return 0; |
| 248 | } | 250 | } |
| 249 | 251 | ||
diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c index 9daed8db83d3..9de8516e3531 100644 --- a/drivers/rtc/rtc-ds3232.c +++ b/drivers/rtc/rtc-ds3232.c | |||
| @@ -268,7 +268,6 @@ out_irq: | |||
| 268 | free_irq(client->irq, client); | 268 | free_irq(client->irq, client); |
| 269 | 269 | ||
| 270 | out_free: | 270 | out_free: |
| 271 | i2c_set_clientdata(client, NULL); | ||
| 272 | kfree(ds3232); | 271 | kfree(ds3232); |
| 273 | return ret; | 272 | return ret; |
| 274 | } | 273 | } |
| @@ -287,7 +286,6 @@ static int __devexit ds3232_remove(struct i2c_client *client) | |||
| 287 | } | 286 | } |
| 288 | 287 | ||
| 289 | rtc_device_unregister(ds3232->rtc); | 288 | rtc_device_unregister(ds3232->rtc); |
| 290 | i2c_set_clientdata(client, NULL); | ||
| 291 | kfree(ds3232); | 289 | kfree(ds3232); |
| 292 | return 0; | 290 | return 0; |
| 293 | } | 291 | } |
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index a0d3ec89d412..f57a87f4ae96 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c | |||
| @@ -310,11 +310,6 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
| 310 | 310 | ||
| 311 | s3c_rtc_setaie(alrm->enabled); | 311 | s3c_rtc_setaie(alrm->enabled); |
| 312 | 312 | ||
| 313 | if (alrm->enabled) | ||
| 314 | enable_irq_wake(s3c_rtc_alarmno); | ||
| 315 | else | ||
| 316 | disable_irq_wake(s3c_rtc_alarmno); | ||
| 317 | |||
| 318 | return 0; | 313 | return 0; |
| 319 | } | 314 | } |
| 320 | 315 | ||
| @@ -587,6 +582,10 @@ static int s3c_rtc_suspend(struct platform_device *pdev, pm_message_t state) | |||
| 587 | ticnt_en_save &= S3C64XX_RTCCON_TICEN; | 582 | ticnt_en_save &= S3C64XX_RTCCON_TICEN; |
| 588 | } | 583 | } |
| 589 | s3c_rtc_enable(pdev, 0); | 584 | s3c_rtc_enable(pdev, 0); |
| 585 | |||
| 586 | if (device_may_wakeup(&pdev->dev)) | ||
| 587 | enable_irq_wake(s3c_rtc_alarmno); | ||
| 588 | |||
| 590 | return 0; | 589 | return 0; |
| 591 | } | 590 | } |
| 592 | 591 | ||
| @@ -600,6 +599,10 @@ static int s3c_rtc_resume(struct platform_device *pdev) | |||
| 600 | tmp = readb(s3c_rtc_base + S3C2410_RTCCON); | 599 | tmp = readb(s3c_rtc_base + S3C2410_RTCCON); |
| 601 | writeb(tmp | ticnt_en_save, s3c_rtc_base + S3C2410_RTCCON); | 600 | writeb(tmp | ticnt_en_save, s3c_rtc_base + S3C2410_RTCCON); |
| 602 | } | 601 | } |
| 602 | |||
| 603 | if (device_may_wakeup(&pdev->dev)) | ||
| 604 | disable_irq_wake(s3c_rtc_alarmno); | ||
| 605 | |||
| 603 | return 0; | 606 | return 0; |
| 604 | } | 607 | } |
| 605 | #else | 608 | #else |
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 6edf20b62de5..2c7d2d9be4d0 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c | |||
| @@ -1154,7 +1154,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv) | |||
| 1154 | dev_fsm, dev_fsm_len, GFP_KERNEL); | 1154 | dev_fsm, dev_fsm_len, GFP_KERNEL); |
| 1155 | if (priv->fsm == NULL) { | 1155 | if (priv->fsm == NULL) { |
| 1156 | CTCMY_DBF_DEV(SETUP, dev, "init_fsm error"); | 1156 | CTCMY_DBF_DEV(SETUP, dev, "init_fsm error"); |
| 1157 | kfree(dev); | 1157 | free_netdev(dev); |
| 1158 | return NULL; | 1158 | return NULL; |
| 1159 | } | 1159 | } |
| 1160 | fsm_newstate(priv->fsm, DEV_STATE_STOPPED); | 1160 | fsm_newstate(priv->fsm, DEV_STATE_STOPPED); |
| @@ -1165,7 +1165,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv) | |||
| 1165 | grp = ctcmpc_init_mpc_group(priv); | 1165 | grp = ctcmpc_init_mpc_group(priv); |
| 1166 | if (grp == NULL) { | 1166 | if (grp == NULL) { |
| 1167 | MPC_DBF_DEV(SETUP, dev, "init_mpc_group error"); | 1167 | MPC_DBF_DEV(SETUP, dev, "init_mpc_group error"); |
| 1168 | kfree(dev); | 1168 | free_netdev(dev); |
| 1169 | return NULL; | 1169 | return NULL; |
| 1170 | } | 1170 | } |
| 1171 | tasklet_init(&grp->mpc_tasklet2, | 1171 | tasklet_init(&grp->mpc_tasklet2, |
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index 50441ffe8e38..2904aa044126 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c | |||
| @@ -472,14 +472,9 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios, | |||
| 472 | spin_unlock_irqrestore(&uap->port.lock, flags); | 472 | spin_unlock_irqrestore(&uap->port.lock, flags); |
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | static void pl010_set_ldisc(struct uart_port *port) | 475 | static void pl010_set_ldisc(struct uart_port *port, int new) |
| 476 | { | 476 | { |
| 477 | int line = port->line; | 477 | if (new == N_PPS) { |
| 478 | |||
| 479 | if (line >= port->state->port.tty->driver->num) | ||
| 480 | return; | ||
| 481 | |||
| 482 | if (port->state->port.tty->ldisc->ops->num == N_PPS) { | ||
| 483 | port->flags |= UPF_HARDPPS_CD; | 478 | port->flags |= UPF_HARDPPS_CD; |
| 484 | pl010_enable_ms(port); | 479 | pl010_enable_ms(port); |
| 485 | } else | 480 | } else |
diff --git a/drivers/serial/mfd.c b/drivers/serial/mfd.c index bc9af503907f..5dff45c76d32 100644 --- a/drivers/serial/mfd.c +++ b/drivers/serial/mfd.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
| 28 | #include <linux/console.h> | 28 | #include <linux/console.h> |
| 29 | #include <linux/sysrq.h> | 29 | #include <linux/sysrq.h> |
| 30 | #include <linux/slab.h> | ||
| 30 | #include <linux/serial_reg.h> | 31 | #include <linux/serial_reg.h> |
| 31 | #include <linux/circ_buf.h> | 32 | #include <linux/circ_buf.h> |
| 32 | #include <linux/delay.h> | 33 | #include <linux/delay.h> |
| @@ -1423,7 +1424,6 @@ static void hsu_global_init(void) | |||
| 1423 | } | 1424 | } |
| 1424 | 1425 | ||
| 1425 | phsu = hsu; | 1426 | phsu = hsu; |
| 1426 | |||
| 1427 | hsu_debugfs_init(hsu); | 1427 | hsu_debugfs_init(hsu); |
| 1428 | return; | 1428 | return; |
| 1429 | 1429 | ||
| @@ -1435,18 +1435,20 @@ err_free_region: | |||
| 1435 | 1435 | ||
| 1436 | static void serial_hsu_remove(struct pci_dev *pdev) | 1436 | static void serial_hsu_remove(struct pci_dev *pdev) |
| 1437 | { | 1437 | { |
| 1438 | struct hsu_port *hsu; | 1438 | void *priv = pci_get_drvdata(pdev); |
| 1439 | int i; | 1439 | struct uart_hsu_port *up; |
| 1440 | 1440 | ||
| 1441 | hsu = pci_get_drvdata(pdev); | 1441 | if (!priv) |
| 1442 | if (!hsu) | ||
| 1443 | return; | 1442 | return; |
| 1444 | 1443 | ||
| 1445 | for (i = 0; i < 3; i++) | 1444 | /* For port 0/1/2, priv is the address of uart_hsu_port */ |
| 1446 | uart_remove_one_port(&serial_hsu_reg, &hsu->port[i].port); | 1445 | if (pdev->device != 0x081E) { |
| 1446 | up = priv; | ||
| 1447 | uart_remove_one_port(&serial_hsu_reg, &up->port); | ||
| 1448 | } | ||
| 1447 | 1449 | ||
| 1448 | pci_set_drvdata(pdev, NULL); | 1450 | pci_set_drvdata(pdev, NULL); |
| 1449 | free_irq(hsu->irq, hsu); | 1451 | free_irq(pdev->irq, priv); |
| 1450 | pci_disable_device(pdev); | 1452 | pci_disable_device(pdev); |
| 1451 | } | 1453 | } |
| 1452 | 1454 | ||
diff --git a/drivers/serial/mrst_max3110.c b/drivers/serial/mrst_max3110.c index f6ad1ecbff79..51c15f58e01e 100644 --- a/drivers/serial/mrst_max3110.c +++ b/drivers/serial/mrst_max3110.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
| 31 | #include <linux/ioport.h> | 31 | #include <linux/ioport.h> |
| 32 | #include <linux/irq.h> | ||
| 32 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 33 | #include <linux/console.h> | 34 | #include <linux/console.h> |
| 34 | #include <linux/sysrq.h> | 35 | #include <linux/sysrq.h> |
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index 141c69554bd4..7d475b2a79e8 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c | |||
| @@ -335,8 +335,6 @@ static int serial_probe(struct pcmcia_device *link) | |||
| 335 | info->p_dev = link; | 335 | info->p_dev = link; |
| 336 | link->priv = info; | 336 | link->priv = info; |
| 337 | 337 | ||
| 338 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; | ||
| 339 | link->resource[0]->end = 8; | ||
| 340 | link->conf.Attributes = CONF_ENABLE_IRQ; | 338 | link->conf.Attributes = CONF_ENABLE_IRQ; |
| 341 | if (do_sound) { | 339 | if (do_sound) { |
| 342 | link->conf.Attributes |= CONF_ENABLE_SPKR; | 340 | link->conf.Attributes |= CONF_ENABLE_SPKR; |
| @@ -411,6 +409,27 @@ static int setup_serial(struct pcmcia_device *handle, struct serial_info * info, | |||
| 411 | 409 | ||
| 412 | /*====================================================================*/ | 410 | /*====================================================================*/ |
| 413 | 411 | ||
| 412 | static int pfc_config(struct pcmcia_device *p_dev) | ||
| 413 | { | ||
| 414 | unsigned int port = 0; | ||
| 415 | struct serial_info *info = p_dev->priv; | ||
| 416 | |||
| 417 | if ((p_dev->resource[1]->end != 0) && | ||
| 418 | (resource_size(p_dev->resource[1]) == 8)) { | ||
| 419 | port = p_dev->resource[1]->start; | ||
| 420 | info->slave = 1; | ||
| 421 | } else if ((info->manfid == MANFID_OSITECH) && | ||
| 422 | (resource_size(p_dev->resource[0]) == 0x40)) { | ||
| 423 | port = p_dev->resource[0]->start + 0x28; | ||
| 424 | info->slave = 1; | ||
| 425 | } | ||
| 426 | if (info->slave) | ||
| 427 | return setup_serial(p_dev, info, port, p_dev->irq); | ||
| 428 | |||
| 429 | dev_warn(&p_dev->dev, "no usable port range found, giving up\n"); | ||
| 430 | return -ENODEV; | ||
| 431 | } | ||
| 432 | |||
| 414 | static int simple_config_check(struct pcmcia_device *p_dev, | 433 | static int simple_config_check(struct pcmcia_device *p_dev, |
| 415 | cistpl_cftable_entry_t *cf, | 434 | cistpl_cftable_entry_t *cf, |
| 416 | cistpl_cftable_entry_t *dflt, | 435 | cistpl_cftable_entry_t *dflt, |
| @@ -461,23 +480,8 @@ static int simple_config(struct pcmcia_device *link) | |||
| 461 | struct serial_info *info = link->priv; | 480 | struct serial_info *info = link->priv; |
| 462 | int i = -ENODEV, try; | 481 | int i = -ENODEV, try; |
| 463 | 482 | ||
| 464 | /* If the card is already configured, look up the port and irq */ | 483 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
| 465 | if (link->function_config) { | 484 | link->resource[0]->end = 8; |
| 466 | unsigned int port = 0; | ||
| 467 | if ((link->resource[1]->end != 0) && | ||
| 468 | (resource_size(link->resource[1]) == 8)) { | ||
| 469 | port = link->resource[1]->end; | ||
| 470 | info->slave = 1; | ||
| 471 | } else if ((info->manfid == MANFID_OSITECH) && | ||
| 472 | (resource_size(link->resource[0]) == 0x40)) { | ||
| 473 | port = link->resource[0]->start + 0x28; | ||
| 474 | info->slave = 1; | ||
| 475 | } | ||
| 476 | if (info->slave) { | ||
| 477 | return setup_serial(link, info, port, | ||
| 478 | link->irq); | ||
| 479 | } | ||
| 480 | } | ||
| 481 | 485 | ||
| 482 | /* First pass: look for a config entry that looks normal. | 486 | /* First pass: look for a config entry that looks normal. |
| 483 | * Two tries: without IO aliases, then with aliases */ | 487 | * Two tries: without IO aliases, then with aliases */ |
| @@ -491,8 +495,7 @@ static int simple_config(struct pcmcia_device *link) | |||
| 491 | if (!pcmcia_loop_config(link, simple_config_check_notpicky, NULL)) | 495 | if (!pcmcia_loop_config(link, simple_config_check_notpicky, NULL)) |
| 492 | goto found_port; | 496 | goto found_port; |
| 493 | 497 | ||
| 494 | printk(KERN_NOTICE | 498 | dev_warn(&link->dev, "no usable port range found, giving up\n"); |
| 495 | "serial_cs: no usable port range found, giving up\n"); | ||
| 496 | return -1; | 499 | return -1; |
| 497 | 500 | ||
| 498 | found_port: | 501 | found_port: |
| @@ -558,6 +561,7 @@ static int multi_config(struct pcmcia_device *link) | |||
| 558 | int i, base2 = 0; | 561 | int i, base2 = 0; |
| 559 | 562 | ||
| 560 | /* First, look for a generic full-sized window */ | 563 | /* First, look for a generic full-sized window */ |
| 564 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; | ||
| 561 | link->resource[0]->end = info->multi * 8; | 565 | link->resource[0]->end = info->multi * 8; |
| 562 | if (pcmcia_loop_config(link, multi_config_check, &base2)) { | 566 | if (pcmcia_loop_config(link, multi_config_check, &base2)) { |
| 563 | /* If that didn't work, look for two windows */ | 567 | /* If that didn't work, look for two windows */ |
| @@ -565,15 +569,14 @@ static int multi_config(struct pcmcia_device *link) | |||
| 565 | info->multi = 2; | 569 | info->multi = 2; |
| 566 | if (pcmcia_loop_config(link, multi_config_check_notpicky, | 570 | if (pcmcia_loop_config(link, multi_config_check_notpicky, |
| 567 | &base2)) { | 571 | &base2)) { |
| 568 | printk(KERN_NOTICE "serial_cs: no usable port range" | 572 | dev_warn(&link->dev, "no usable port range " |
| 569 | "found, giving up\n"); | 573 | "found, giving up\n"); |
| 570 | return -ENODEV; | 574 | return -ENODEV; |
| 571 | } | 575 | } |
| 572 | } | 576 | } |
| 573 | 577 | ||
| 574 | if (!link->irq) | 578 | if (!link->irq) |
| 575 | dev_warn(&link->dev, | 579 | dev_warn(&link->dev, "no usable IRQ found, continuing...\n"); |
| 576 | "serial_cs: no usable IRQ found, continuing...\n"); | ||
| 577 | 580 | ||
| 578 | /* | 581 | /* |
| 579 | * Apply any configuration quirks. | 582 | * Apply any configuration quirks. |
| @@ -675,6 +678,7 @@ static int serial_config(struct pcmcia_device * link) | |||
| 675 | multifunction cards that ask for appropriate IO port ranges */ | 678 | multifunction cards that ask for appropriate IO port ranges */ |
| 676 | if ((info->multi == 0) && | 679 | if ((info->multi == 0) && |
| 677 | (link->has_func_id) && | 680 | (link->has_func_id) && |
| 681 | (link->socket->pcmcia_pfc == 0) && | ||
| 678 | ((link->func_id == CISTPL_FUNCID_MULTI) || | 682 | ((link->func_id == CISTPL_FUNCID_MULTI) || |
| 679 | (link->func_id == CISTPL_FUNCID_SERIAL))) | 683 | (link->func_id == CISTPL_FUNCID_SERIAL))) |
| 680 | pcmcia_loop_config(link, serial_check_for_multi, info); | 684 | pcmcia_loop_config(link, serial_check_for_multi, info); |
| @@ -685,7 +689,13 @@ static int serial_config(struct pcmcia_device * link) | |||
| 685 | if (info->quirk && info->quirk->multi != -1) | 689 | if (info->quirk && info->quirk->multi != -1) |
| 686 | info->multi = info->quirk->multi; | 690 | info->multi = info->quirk->multi; |
| 687 | 691 | ||
| 688 | if (info->multi > 1) | 692 | dev_info(&link->dev, |
| 693 | "trying to set up [0x%04x:0x%04x] (pfc: %d, multi: %d, quirk: %p)\n", | ||
| 694 | link->manf_id, link->card_id, | ||
| 695 | link->socket->pcmcia_pfc, info->multi, info->quirk); | ||
| 696 | if (link->socket->pcmcia_pfc) | ||
| 697 | i = pfc_config(link); | ||
| 698 | else if (info->multi > 1) | ||
| 689 | i = multi_config(link); | 699 | i = multi_config(link); |
| 690 | else | 700 | else |
| 691 | i = simple_config(link); | 701 | i = simple_config(link); |
| @@ -704,7 +714,7 @@ static int serial_config(struct pcmcia_device * link) | |||
| 704 | return 0; | 714 | return 0; |
| 705 | 715 | ||
| 706 | failed: | 716 | failed: |
| 707 | dev_warn(&link->dev, "serial_cs: failed to initialize\n"); | 717 | dev_warn(&link->dev, "failed to initialize\n"); |
| 708 | serial_remove(link); | 718 | serial_remove(link); |
| 709 | return -ENODEV; | 719 | return -ENODEV; |
| 710 | } | 720 | } |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 0bcf4c1601a2..b5a78a1f4421 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
| 24 | #include <linux/cache.h> | 24 | #include <linux/cache.h> |
| 25 | #include <linux/mutex.h> | 25 | #include <linux/mutex.h> |
| 26 | #include <linux/of_device.h> | ||
| 26 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
| 27 | #include <linux/mod_devicetable.h> | 28 | #include <linux/mod_devicetable.h> |
| 28 | #include <linux/spi/spi.h> | 29 | #include <linux/spi/spi.h> |
| @@ -86,6 +87,10 @@ static int spi_match_device(struct device *dev, struct device_driver *drv) | |||
| 86 | const struct spi_device *spi = to_spi_device(dev); | 87 | const struct spi_device *spi = to_spi_device(dev); |
| 87 | const struct spi_driver *sdrv = to_spi_driver(drv); | 88 | const struct spi_driver *sdrv = to_spi_driver(drv); |
| 88 | 89 | ||
| 90 | /* Attempt an OF style match */ | ||
| 91 | if (of_driver_match_device(dev, drv)) | ||
| 92 | return 1; | ||
| 93 | |||
| 89 | if (sdrv->id_table) | 94 | if (sdrv->id_table) |
| 90 | return !!spi_match_id(sdrv->id_table, spi); | 95 | return !!spi_match_id(sdrv->id_table, spi); |
| 91 | 96 | ||
diff --git a/drivers/spi/spi_gpio.c b/drivers/spi/spi_gpio.c index e24a63498acb..63e51b011d50 100644 --- a/drivers/spi/spi_gpio.c +++ b/drivers/spi/spi_gpio.c | |||
| @@ -350,7 +350,7 @@ static int __init spi_gpio_probe(struct platform_device *pdev) | |||
| 350 | spi_gpio->bitbang.master = spi_master_get(master); | 350 | spi_gpio->bitbang.master = spi_master_get(master); |
| 351 | spi_gpio->bitbang.chipselect = spi_gpio_chipselect; | 351 | spi_gpio->bitbang.chipselect = spi_gpio_chipselect; |
| 352 | 352 | ||
| 353 | if ((master_flags & (SPI_MASTER_NO_RX | SPI_MASTER_NO_RX)) == 0) { | 353 | if ((master_flags & (SPI_MASTER_NO_TX | SPI_MASTER_NO_RX)) == 0) { |
| 354 | spi_gpio->bitbang.txrx_word[SPI_MODE_0] = spi_gpio_txrx_word_mode0; | 354 | spi_gpio->bitbang.txrx_word[SPI_MODE_0] = spi_gpio_txrx_word_mode0; |
| 355 | spi_gpio->bitbang.txrx_word[SPI_MODE_1] = spi_gpio_txrx_word_mode1; | 355 | spi_gpio->bitbang.txrx_word[SPI_MODE_1] = spi_gpio_txrx_word_mode1; |
| 356 | spi_gpio->bitbang.txrx_word[SPI_MODE_2] = spi_gpio_txrx_word_mode2; | 356 | spi_gpio->bitbang.txrx_word[SPI_MODE_2] = spi_gpio_txrx_word_mode2; |
diff --git a/drivers/spi/spi_mpc8xxx.c b/drivers/spi/spi_mpc8xxx.c index d31b57f7baaf..1dd86b835cd8 100644 --- a/drivers/spi/spi_mpc8xxx.c +++ b/drivers/spi/spi_mpc8xxx.c | |||
| @@ -408,11 +408,17 @@ static void mpc8xxx_spi_cpm_bufs_start(struct mpc8xxx_spi *mspi) | |||
| 408 | 408 | ||
| 409 | xfer_ofs = mspi->xfer_in_progress->len - mspi->count; | 409 | xfer_ofs = mspi->xfer_in_progress->len - mspi->count; |
| 410 | 410 | ||
| 411 | out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma + xfer_ofs); | 411 | if (mspi->rx_dma == mspi->dma_dummy_rx) |
| 412 | out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma); | ||
| 413 | else | ||
| 414 | out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma + xfer_ofs); | ||
| 412 | out_be16(&rx_bd->cbd_datlen, 0); | 415 | out_be16(&rx_bd->cbd_datlen, 0); |
| 413 | out_be16(&rx_bd->cbd_sc, BD_SC_EMPTY | BD_SC_INTRPT | BD_SC_WRAP); | 416 | out_be16(&rx_bd->cbd_sc, BD_SC_EMPTY | BD_SC_INTRPT | BD_SC_WRAP); |
| 414 | 417 | ||
| 415 | out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma + xfer_ofs); | 418 | if (mspi->tx_dma == mspi->dma_dummy_tx) |
| 419 | out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma); | ||
| 420 | else | ||
| 421 | out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma + xfer_ofs); | ||
| 416 | out_be16(&tx_bd->cbd_datlen, xfer_len); | 422 | out_be16(&tx_bd->cbd_datlen, xfer_len); |
| 417 | out_be16(&tx_bd->cbd_sc, BD_SC_READY | BD_SC_INTRPT | BD_SC_WRAP | | 423 | out_be16(&tx_bd->cbd_sc, BD_SC_READY | BD_SC_INTRPT | BD_SC_WRAP | |
| 418 | BD_SC_LAST); | 424 | BD_SC_LAST); |
diff --git a/drivers/staging/batman-adv/hard-interface.c b/drivers/staging/batman-adv/hard-interface.c index baa8b05b9e8d..6e973a79aa25 100644 --- a/drivers/staging/batman-adv/hard-interface.c +++ b/drivers/staging/batman-adv/hard-interface.c | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | #include "hash.h" | 30 | #include "hash.h" |
| 31 | 31 | ||
| 32 | #include <linux/if_arp.h> | 32 | #include <linux/if_arp.h> |
| 33 | #include <linux/netfilter_bridge.h> | ||
| 34 | 33 | ||
| 35 | #define MIN(x, y) ((x) < (y) ? (x) : (y)) | 34 | #define MIN(x, y) ((x) < (y) ? (x) : (y)) |
| 36 | 35 | ||
| @@ -431,11 +430,6 @@ out: | |||
| 431 | return NOTIFY_DONE; | 430 | return NOTIFY_DONE; |
| 432 | } | 431 | } |
| 433 | 432 | ||
| 434 | static int batman_skb_recv_finish(struct sk_buff *skb) | ||
| 435 | { | ||
| 436 | return NF_ACCEPT; | ||
| 437 | } | ||
| 438 | |||
| 439 | /* receive a packet with the batman ethertype coming on a hard | 433 | /* receive a packet with the batman ethertype coming on a hard |
| 440 | * interface */ | 434 | * interface */ |
| 441 | int batman_skb_recv(struct sk_buff *skb, struct net_device *dev, | 435 | int batman_skb_recv(struct sk_buff *skb, struct net_device *dev, |
| @@ -456,13 +450,6 @@ int batman_skb_recv(struct sk_buff *skb, struct net_device *dev, | |||
| 456 | if (atomic_read(&module_state) != MODULE_ACTIVE) | 450 | if (atomic_read(&module_state) != MODULE_ACTIVE) |
| 457 | goto err_free; | 451 | goto err_free; |
| 458 | 452 | ||
| 459 | /* if netfilter/ebtables wants to block incoming batman | ||
| 460 | * packets then give them a chance to do so here */ | ||
| 461 | ret = NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, dev, NULL, | ||
| 462 | batman_skb_recv_finish); | ||
| 463 | if (ret != 1) | ||
| 464 | goto err_out; | ||
| 465 | |||
| 466 | /* packet should hold at least type and version */ | 453 | /* packet should hold at least type and version */ |
| 467 | if (unlikely(skb_headlen(skb) < 2)) | 454 | if (unlikely(skb_headlen(skb) < 2)) |
| 468 | goto err_free; | 455 | goto err_free; |
diff --git a/drivers/staging/batman-adv/send.c b/drivers/staging/batman-adv/send.c index 055edee7b4e4..da3c82e47bbd 100644 --- a/drivers/staging/batman-adv/send.c +++ b/drivers/staging/batman-adv/send.c | |||
| @@ -29,7 +29,6 @@ | |||
| 29 | #include "vis.h" | 29 | #include "vis.h" |
| 30 | #include "aggregation.h" | 30 | #include "aggregation.h" |
| 31 | 31 | ||
| 32 | #include <linux/netfilter_bridge.h> | ||
| 33 | 32 | ||
| 34 | static void send_outstanding_bcast_packet(struct work_struct *work); | 33 | static void send_outstanding_bcast_packet(struct work_struct *work); |
| 35 | 34 | ||
| @@ -92,12 +91,9 @@ int send_skb_packet(struct sk_buff *skb, | |||
| 92 | 91 | ||
| 93 | /* dev_queue_xmit() returns a negative result on error. However on | 92 | /* dev_queue_xmit() returns a negative result on error. However on |
| 94 | * congestion and traffic shaping, it drops and returns NET_XMIT_DROP | 93 | * congestion and traffic shaping, it drops and returns NET_XMIT_DROP |
| 95 | * (which is > 0). This will not be treated as an error. | 94 | * (which is > 0). This will not be treated as an error. */ |
| 96 | * Also, if netfilter/ebtables wants to block outgoing batman | ||
| 97 | * packets then giving them a chance to do so here */ | ||
| 98 | 95 | ||
| 99 | return NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, | 96 | return dev_queue_xmit(skb); |
| 100 | dev_queue_xmit); | ||
| 101 | send_skb_err: | 97 | send_skb_err: |
| 102 | kfree_skb(skb); | 98 | kfree_skb(skb); |
| 103 | return NET_XMIT_DROP; | 99 | return NET_XMIT_DROP; |
diff --git a/drivers/staging/ti-st/st.h b/drivers/staging/ti-st/st.h index 9952579425b9..1b3060eb2921 100644 --- a/drivers/staging/ti-st/st.h +++ b/drivers/staging/ti-st/st.h | |||
| @@ -80,5 +80,4 @@ struct st_proto_s { | |||
| 80 | extern long st_register(struct st_proto_s *); | 80 | extern long st_register(struct st_proto_s *); |
| 81 | extern long st_unregister(enum proto_type); | 81 | extern long st_unregister(enum proto_type); |
| 82 | 82 | ||
| 83 | extern struct platform_device *st_get_plat_device(void); | ||
| 84 | #endif /* ST_H */ | 83 | #endif /* ST_H */ |
diff --git a/drivers/staging/ti-st/st_core.c b/drivers/staging/ti-st/st_core.c index 063c9b1db1ab..b85d8bfdf600 100644 --- a/drivers/staging/ti-st/st_core.c +++ b/drivers/staging/ti-st/st_core.c | |||
| @@ -38,7 +38,6 @@ | |||
| 38 | #include "st_ll.h" | 38 | #include "st_ll.h" |
| 39 | #include "st.h" | 39 | #include "st.h" |
| 40 | 40 | ||
| 41 | #define VERBOSE | ||
| 42 | /* strings to be used for rfkill entries and by | 41 | /* strings to be used for rfkill entries and by |
| 43 | * ST Core to be used for sysfs debug entry | 42 | * ST Core to be used for sysfs debug entry |
| 44 | */ | 43 | */ |
| @@ -581,7 +580,7 @@ long st_register(struct st_proto_s *new_proto) | |||
| 581 | long err = 0; | 580 | long err = 0; |
| 582 | unsigned long flags = 0; | 581 | unsigned long flags = 0; |
| 583 | 582 | ||
| 584 | st_kim_ref(&st_gdata); | 583 | st_kim_ref(&st_gdata, 0); |
| 585 | pr_info("%s(%d) ", __func__, new_proto->type); | 584 | pr_info("%s(%d) ", __func__, new_proto->type); |
| 586 | if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL | 585 | if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL |
| 587 | || new_proto->reg_complete_cb == NULL) { | 586 | || new_proto->reg_complete_cb == NULL) { |
| @@ -713,7 +712,7 @@ long st_unregister(enum proto_type type) | |||
| 713 | 712 | ||
| 714 | pr_debug("%s: %d ", __func__, type); | 713 | pr_debug("%s: %d ", __func__, type); |
| 715 | 714 | ||
| 716 | st_kim_ref(&st_gdata); | 715 | st_kim_ref(&st_gdata, 0); |
| 717 | if (type < ST_BT || type >= ST_MAX) { | 716 | if (type < ST_BT || type >= ST_MAX) { |
| 718 | pr_err(" protocol %d not supported", type); | 717 | pr_err(" protocol %d not supported", type); |
| 719 | return -EPROTONOSUPPORT; | 718 | return -EPROTONOSUPPORT; |
| @@ -767,7 +766,7 @@ long st_write(struct sk_buff *skb) | |||
| 767 | #endif | 766 | #endif |
| 768 | long len; | 767 | long len; |
| 769 | 768 | ||
| 770 | st_kim_ref(&st_gdata); | 769 | st_kim_ref(&st_gdata, 0); |
| 771 | if (unlikely(skb == NULL || st_gdata == NULL | 770 | if (unlikely(skb == NULL || st_gdata == NULL |
| 772 | || st_gdata->tty == NULL)) { | 771 | || st_gdata->tty == NULL)) { |
| 773 | pr_err("data/tty unavailable to perform write"); | 772 | pr_err("data/tty unavailable to perform write"); |
| @@ -818,7 +817,7 @@ static int st_tty_open(struct tty_struct *tty) | |||
| 818 | struct st_data_s *st_gdata; | 817 | struct st_data_s *st_gdata; |
| 819 | pr_info("%s ", __func__); | 818 | pr_info("%s ", __func__); |
| 820 | 819 | ||
| 821 | st_kim_ref(&st_gdata); | 820 | st_kim_ref(&st_gdata, 0); |
| 822 | st_gdata->tty = tty; | 821 | st_gdata->tty = tty; |
| 823 | tty->disc_data = st_gdata; | 822 | tty->disc_data = st_gdata; |
| 824 | 823 | ||
diff --git a/drivers/staging/ti-st/st_core.h b/drivers/staging/ti-st/st_core.h index e0c32d149f5f..8601320a679e 100644 --- a/drivers/staging/ti-st/st_core.h +++ b/drivers/staging/ti-st/st_core.h | |||
| @@ -117,7 +117,7 @@ int st_core_init(struct st_data_s **); | |||
| 117 | void st_core_exit(struct st_data_s *); | 117 | void st_core_exit(struct st_data_s *); |
| 118 | 118 | ||
| 119 | /* ask for reference from KIM */ | 119 | /* ask for reference from KIM */ |
| 120 | void st_kim_ref(struct st_data_s **); | 120 | void st_kim_ref(struct st_data_s **, int); |
| 121 | 121 | ||
| 122 | #define GPS_STUB_TEST | 122 | #define GPS_STUB_TEST |
| 123 | #ifdef GPS_STUB_TEST | 123 | #ifdef GPS_STUB_TEST |
diff --git a/drivers/staging/ti-st/st_kim.c b/drivers/staging/ti-st/st_kim.c index b4a6c7fdc4e6..9e99463f76e8 100644 --- a/drivers/staging/ti-st/st_kim.c +++ b/drivers/staging/ti-st/st_kim.c | |||
| @@ -72,11 +72,26 @@ const unsigned char *protocol_names[] = { | |||
| 72 | PROTO_ENTRY(ST_GPS, "GPS"), | 72 | PROTO_ENTRY(ST_GPS, "GPS"), |
| 73 | }; | 73 | }; |
| 74 | 74 | ||
| 75 | #define MAX_ST_DEVICES 3 /* Imagine 1 on each UART for now */ | ||
| 76 | struct platform_device *st_kim_devices[MAX_ST_DEVICES]; | ||
| 75 | 77 | ||
| 76 | /**********************************************************************/ | 78 | /**********************************************************************/ |
| 77 | /* internal functions */ | 79 | /* internal functions */ |
| 78 | 80 | ||
| 79 | /** | 81 | /** |
| 82 | * st_get_plat_device - | ||
| 83 | * function which returns the reference to the platform device | ||
| 84 | * requested by id. As of now only 1 such device exists (id=0) | ||
| 85 | * the context requesting for reference can get the id to be | ||
| 86 | * requested by a. The protocol driver which is registering or | ||
| 87 | * b. the tty device which is opened. | ||
| 88 | */ | ||
| 89 | static struct platform_device *st_get_plat_device(int id) | ||
| 90 | { | ||
| 91 | return st_kim_devices[id]; | ||
| 92 | } | ||
| 93 | |||
| 94 | /** | ||
| 80 | * validate_firmware_response - | 95 | * validate_firmware_response - |
| 81 | * function to return whether the firmware response was proper | 96 | * function to return whether the firmware response was proper |
| 82 | * in case of error don't complete so that waiting for proper | 97 | * in case of error don't complete so that waiting for proper |
| @@ -353,7 +368,7 @@ void st_kim_chip_toggle(enum proto_type type, enum kim_gpio_state state) | |||
| 353 | struct kim_data_s *kim_gdata; | 368 | struct kim_data_s *kim_gdata; |
| 354 | pr_info(" %s ", __func__); | 369 | pr_info(" %s ", __func__); |
| 355 | 370 | ||
| 356 | kim_pdev = st_get_plat_device(); | 371 | kim_pdev = st_get_plat_device(0); |
| 357 | kim_gdata = dev_get_drvdata(&kim_pdev->dev); | 372 | kim_gdata = dev_get_drvdata(&kim_pdev->dev); |
| 358 | 373 | ||
| 359 | if (kim_gdata->gpios[type] == -1) { | 374 | if (kim_gdata->gpios[type] == -1) { |
| @@ -574,12 +589,12 @@ static int kim_toggle_radio(void *data, bool blocked) | |||
| 574 | * This would enable multiple such platform devices to exist | 589 | * This would enable multiple such platform devices to exist |
| 575 | * on a given platform | 590 | * on a given platform |
| 576 | */ | 591 | */ |
| 577 | void st_kim_ref(struct st_data_s **core_data) | 592 | void st_kim_ref(struct st_data_s **core_data, int id) |
| 578 | { | 593 | { |
| 579 | struct platform_device *pdev; | 594 | struct platform_device *pdev; |
| 580 | struct kim_data_s *kim_gdata; | 595 | struct kim_data_s *kim_gdata; |
| 581 | /* get kim_gdata reference from platform device */ | 596 | /* get kim_gdata reference from platform device */ |
| 582 | pdev = st_get_plat_device(); | 597 | pdev = st_get_plat_device(id); |
| 583 | kim_gdata = dev_get_drvdata(&pdev->dev); | 598 | kim_gdata = dev_get_drvdata(&pdev->dev); |
| 584 | *core_data = kim_gdata->core_data; | 599 | *core_data = kim_gdata->core_data; |
| 585 | } | 600 | } |
| @@ -623,6 +638,7 @@ static int kim_probe(struct platform_device *pdev) | |||
| 623 | long *gpios = pdev->dev.platform_data; | 638 | long *gpios = pdev->dev.platform_data; |
| 624 | struct kim_data_s *kim_gdata; | 639 | struct kim_data_s *kim_gdata; |
| 625 | 640 | ||
| 641 | st_kim_devices[pdev->id] = pdev; | ||
| 626 | kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_ATOMIC); | 642 | kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_ATOMIC); |
| 627 | if (!kim_gdata) { | 643 | if (!kim_gdata) { |
| 628 | pr_err("no mem to allocate"); | 644 | pr_err("no mem to allocate"); |
diff --git a/drivers/staging/tm6000/Kconfig b/drivers/staging/tm6000/Kconfig index c725356cc346..de7ebb99d8f6 100644 --- a/drivers/staging/tm6000/Kconfig +++ b/drivers/staging/tm6000/Kconfig | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | config VIDEO_TM6000 | 1 | config VIDEO_TM6000 |
| 2 | tristate "TV Master TM5600/6000/6010 driver" | 2 | tristate "TV Master TM5600/6000/6010 driver" |
| 3 | depends on VIDEO_DEV && I2C && INPUT && USB && EXPERIMENTAL | 3 | depends on VIDEO_DEV && I2C && INPUT && IR_CORE && USB && EXPERIMENTAL |
| 4 | select VIDEO_TUNER | 4 | select VIDEO_TUNER |
| 5 | select MEDIA_TUNER_XC2028 | 5 | select MEDIA_TUNER_XC2028 |
| 6 | select MEDIA_TUNER_XC5000 | 6 | select MEDIA_TUNER_XC5000 |
diff --git a/drivers/staging/tm6000/tm6000-input.c b/drivers/staging/tm6000/tm6000-input.c index 32f7a0af6938..54f7667cc706 100644 --- a/drivers/staging/tm6000/tm6000-input.c +++ b/drivers/staging/tm6000/tm6000-input.c | |||
| @@ -46,7 +46,7 @@ MODULE_PARM_DESC(enable_ir, "enable ir (default is enable"); | |||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | struct tm6000_ir_poll_result { | 48 | struct tm6000_ir_poll_result { |
| 49 | u8 rc_data[4]; | 49 | u16 rc_data; |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | struct tm6000_IR { | 52 | struct tm6000_IR { |
| @@ -60,9 +60,9 @@ struct tm6000_IR { | |||
| 60 | int polling; | 60 | int polling; |
| 61 | struct delayed_work work; | 61 | struct delayed_work work; |
| 62 | u8 wait:1; | 62 | u8 wait:1; |
| 63 | u8 key:1; | ||
| 63 | struct urb *int_urb; | 64 | struct urb *int_urb; |
| 64 | u8 *urb_data; | 65 | u8 *urb_data; |
| 65 | u8 key:1; | ||
| 66 | 66 | ||
| 67 | int (*get_key) (struct tm6000_IR *, struct tm6000_ir_poll_result *); | 67 | int (*get_key) (struct tm6000_IR *, struct tm6000_ir_poll_result *); |
| 68 | 68 | ||
| @@ -122,13 +122,14 @@ static void tm6000_ir_urb_received(struct urb *urb) | |||
| 122 | 122 | ||
| 123 | if (urb->status != 0) | 123 | if (urb->status != 0) |
| 124 | printk(KERN_INFO "not ready\n"); | 124 | printk(KERN_INFO "not ready\n"); |
| 125 | else if (urb->actual_length > 0) | 125 | else if (urb->actual_length > 0) { |
| 126 | memcpy(ir->urb_data, urb->transfer_buffer, urb->actual_length); | 126 | memcpy(ir->urb_data, urb->transfer_buffer, urb->actual_length); |
| 127 | 127 | ||
| 128 | dprintk("data %02x %02x %02x %02x\n", ir->urb_data[0], | 128 | dprintk("data %02x %02x %02x %02x\n", ir->urb_data[0], |
| 129 | ir->urb_data[1], ir->urb_data[2], ir->urb_data[3]); | 129 | ir->urb_data[1], ir->urb_data[2], ir->urb_data[3]); |
| 130 | 130 | ||
| 131 | ir->key = 1; | 131 | ir->key = 1; |
| 132 | } | ||
| 132 | 133 | ||
| 133 | rc = usb_submit_urb(urb, GFP_ATOMIC); | 134 | rc = usb_submit_urb(urb, GFP_ATOMIC); |
| 134 | } | 135 | } |
| @@ -140,30 +141,47 @@ static int default_polling_getkey(struct tm6000_IR *ir, | |||
| 140 | int rc; | 141 | int rc; |
| 141 | u8 buf[2]; | 142 | u8 buf[2]; |
| 142 | 143 | ||
| 143 | if (ir->wait && !&dev->int_in) { | 144 | if (ir->wait && !&dev->int_in) |
| 144 | poll_result->rc_data[0] = 0xff; | ||
| 145 | return 0; | 145 | return 0; |
| 146 | } | ||
| 147 | 146 | ||
| 148 | if (&dev->int_in) { | 147 | if (&dev->int_in) { |
| 149 | poll_result->rc_data[0] = ir->urb_data[0]; | 148 | if (ir->ir.ir_type == IR_TYPE_RC5) |
| 150 | poll_result->rc_data[1] = ir->urb_data[1]; | 149 | poll_result->rc_data = ir->urb_data[0]; |
| 150 | else | ||
| 151 | poll_result->rc_data = ir->urb_data[0] | ir->urb_data[1] << 8; | ||
| 151 | } else { | 152 | } else { |
| 152 | tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT, 2, 0); | 153 | tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT, 2, 0); |
| 153 | msleep(10); | 154 | msleep(10); |
| 154 | tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT, 2, 1); | 155 | tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT, 2, 1); |
| 155 | msleep(10); | 156 | msleep(10); |
| 156 | 157 | ||
| 157 | rc = tm6000_read_write_usb(dev, USB_DIR_IN | USB_TYPE_VENDOR | | 158 | if (ir->ir.ir_type == IR_TYPE_RC5) { |
| 158 | USB_RECIP_DEVICE, REQ_02_GET_IR_CODE, 0, 0, buf, 1); | 159 | rc = tm6000_read_write_usb(dev, USB_DIR_IN | |
| 160 | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
| 161 | REQ_02_GET_IR_CODE, 0, 0, buf, 1); | ||
| 159 | 162 | ||
| 160 | msleep(10); | 163 | msleep(10); |
| 161 | 164 | ||
| 162 | dprintk("read data=%02x\n", buf[0]); | 165 | dprintk("read data=%02x\n", buf[0]); |
| 163 | if (rc < 0) | 166 | if (rc < 0) |
| 164 | return rc; | 167 | return rc; |
| 165 | 168 | ||
| 166 | poll_result->rc_data[0] = buf[0]; | 169 | poll_result->rc_data = buf[0]; |
| 170 | } else { | ||
| 171 | rc = tm6000_read_write_usb(dev, USB_DIR_IN | | ||
| 172 | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
| 173 | REQ_02_GET_IR_CODE, 0, 0, buf, 2); | ||
| 174 | |||
| 175 | msleep(10); | ||
| 176 | |||
| 177 | dprintk("read data=%04x\n", buf[0] | buf[1] << 8); | ||
| 178 | if (rc < 0) | ||
| 179 | return rc; | ||
| 180 | |||
| 181 | poll_result->rc_data = buf[0] | buf[1] << 8; | ||
| 182 | } | ||
| 183 | if ((poll_result->rc_data & 0x00ff) != 0xff) | ||
| 184 | ir->key = 1; | ||
| 167 | } | 185 | } |
| 168 | return 0; | 186 | return 0; |
| 169 | } | 187 | } |
| @@ -180,12 +198,11 @@ static void tm6000_ir_handle_key(struct tm6000_IR *ir) | |||
| 180 | return; | 198 | return; |
| 181 | } | 199 | } |
| 182 | 200 | ||
| 183 | dprintk("ir->get_key result data=%02x %02x\n", | 201 | dprintk("ir->get_key result data=%04x\n", poll_result.rc_data); |
| 184 | poll_result.rc_data[0], poll_result.rc_data[1]); | ||
| 185 | 202 | ||
| 186 | if (poll_result.rc_data[0] != 0xff && ir->key == 1) { | 203 | if (ir->key) { |
| 187 | ir_input_keydown(ir->input->input_dev, &ir->ir, | 204 | ir_input_keydown(ir->input->input_dev, &ir->ir, |
| 188 | poll_result.rc_data[0] | poll_result.rc_data[1] << 8); | 205 | (u32)poll_result.rc_data); |
| 189 | 206 | ||
| 190 | ir_input_nokey(ir->input->input_dev, &ir->ir); | 207 | ir_input_nokey(ir->input->input_dev, &ir->ir); |
| 191 | ir->key = 0; | 208 | ir->key = 0; |
diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c index 0142338bcafe..4bdb8362de82 100644 --- a/drivers/staging/vt6655/wpactl.c +++ b/drivers/staging/vt6655/wpactl.c | |||
| @@ -766,9 +766,14 @@ static int wpa_set_associate(PSDevice pDevice, | |||
| 766 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wpa_ie_len = %d\n", param->u.wpa_associate.wpa_ie_len); | 766 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wpa_ie_len = %d\n", param->u.wpa_associate.wpa_ie_len); |
| 767 | 767 | ||
| 768 | 768 | ||
| 769 | if (param->u.wpa_associate.wpa_ie && | 769 | if (param->u.wpa_associate.wpa_ie_len) { |
| 770 | copy_from_user(&abyWPAIE[0], param->u.wpa_associate.wpa_ie, param->u.wpa_associate.wpa_ie_len)) | 770 | if (!param->u.wpa_associate.wpa_ie) |
| 771 | return -EINVAL; | 771 | return -EINVAL; |
| 772 | if (param->u.wpa_associate.wpa_ie_len > sizeof(abyWPAIE)) | ||
| 773 | return -EINVAL; | ||
| 774 | if (copy_from_user(&abyWPAIE[0], param->u.wpa_associate.wpa_ie, param->u.wpa_associate.wpa_ie_len)) | ||
| 775 | return -EFAULT; | ||
| 776 | } | ||
| 772 | 777 | ||
| 773 | if (param->u.wpa_associate.mode == 1) | 778 | if (param->u.wpa_associate.mode == 1) |
| 774 | pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA; | 779 | pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA; |
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index 7e594449600e..9eed5b52d9de 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig | |||
| @@ -91,12 +91,12 @@ config USB_DYNAMIC_MINORS | |||
| 91 | If you are unsure about this, say N here. | 91 | If you are unsure about this, say N here. |
| 92 | 92 | ||
| 93 | config USB_SUSPEND | 93 | config USB_SUSPEND |
| 94 | bool "USB runtime power management (suspend/resume and wakeup)" | 94 | bool "USB runtime power management (autosuspend) and wakeup" |
| 95 | depends on USB && PM_RUNTIME | 95 | depends on USB && PM_RUNTIME |
| 96 | help | 96 | help |
| 97 | If you say Y here, you can use driver calls or the sysfs | 97 | If you say Y here, you can use driver calls or the sysfs |
| 98 | "power/level" file to suspend or resume individual USB | 98 | "power/control" file to enable or disable autosuspend for |
| 99 | peripherals and to enable or disable autosuspend (see | 99 | individual USB peripherals (see |
| 100 | Documentation/usb/power-management.txt for more details). | 100 | Documentation/usb/power-management.txt for more details). |
| 101 | 101 | ||
| 102 | Also, USB "remote wakeup" signaling is supported, whereby some | 102 | Also, USB "remote wakeup" signaling is supported, whereby some |
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index f06f5dbc8cdc..1e6ccef2cf0c 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c | |||
| @@ -159,9 +159,9 @@ void usb_major_cleanup(void) | |||
| 159 | int usb_register_dev(struct usb_interface *intf, | 159 | int usb_register_dev(struct usb_interface *intf, |
| 160 | struct usb_class_driver *class_driver) | 160 | struct usb_class_driver *class_driver) |
| 161 | { | 161 | { |
| 162 | int retval = -EINVAL; | 162 | int retval; |
| 163 | int minor_base = class_driver->minor_base; | 163 | int minor_base = class_driver->minor_base; |
| 164 | int minor = 0; | 164 | int minor; |
| 165 | char name[20]; | 165 | char name[20]; |
| 166 | char *temp; | 166 | char *temp; |
| 167 | 167 | ||
| @@ -173,12 +173,17 @@ int usb_register_dev(struct usb_interface *intf, | |||
| 173 | */ | 173 | */ |
| 174 | minor_base = 0; | 174 | minor_base = 0; |
| 175 | #endif | 175 | #endif |
| 176 | intf->minor = -1; | ||
| 177 | |||
| 178 | dbg ("looking for a minor, starting at %d", minor_base); | ||
| 179 | 176 | ||
| 180 | if (class_driver->fops == NULL) | 177 | if (class_driver->fops == NULL) |
| 181 | goto exit; | 178 | return -EINVAL; |
| 179 | if (intf->minor >= 0) | ||
| 180 | return -EADDRINUSE; | ||
| 181 | |||
| 182 | retval = init_usb_class(); | ||
| 183 | if (retval) | ||
| 184 | return retval; | ||
| 185 | |||
| 186 | dev_dbg(&intf->dev, "looking for a minor, starting at %d", minor_base); | ||
| 182 | 187 | ||
| 183 | down_write(&minor_rwsem); | 188 | down_write(&minor_rwsem); |
| 184 | for (minor = minor_base; minor < MAX_USB_MINORS; ++minor) { | 189 | for (minor = minor_base; minor < MAX_USB_MINORS; ++minor) { |
| @@ -186,20 +191,12 @@ int usb_register_dev(struct usb_interface *intf, | |||
| 186 | continue; | 191 | continue; |
| 187 | 192 | ||
| 188 | usb_minors[minor] = class_driver->fops; | 193 | usb_minors[minor] = class_driver->fops; |
| 189 | 194 | intf->minor = minor; | |
| 190 | retval = 0; | ||
| 191 | break; | 195 | break; |
| 192 | } | 196 | } |
| 193 | up_write(&minor_rwsem); | 197 | up_write(&minor_rwsem); |
| 194 | 198 | if (intf->minor < 0) | |
| 195 | if (retval) | 199 | return -EXFULL; |
| 196 | goto exit; | ||
| 197 | |||
| 198 | retval = init_usb_class(); | ||
| 199 | if (retval) | ||
| 200 | goto exit; | ||
| 201 | |||
| 202 | intf->minor = minor; | ||
| 203 | 200 | ||
| 204 | /* create a usb class device for this usb interface */ | 201 | /* create a usb class device for this usb interface */ |
| 205 | snprintf(name, sizeof(name), class_driver->name, minor - minor_base); | 202 | snprintf(name, sizeof(name), class_driver->name, minor - minor_base); |
| @@ -213,11 +210,11 @@ int usb_register_dev(struct usb_interface *intf, | |||
| 213 | "%s", temp); | 210 | "%s", temp); |
| 214 | if (IS_ERR(intf->usb_dev)) { | 211 | if (IS_ERR(intf->usb_dev)) { |
| 215 | down_write(&minor_rwsem); | 212 | down_write(&minor_rwsem); |
| 216 | usb_minors[intf->minor] = NULL; | 213 | usb_minors[minor] = NULL; |
| 214 | intf->minor = -1; | ||
| 217 | up_write(&minor_rwsem); | 215 | up_write(&minor_rwsem); |
| 218 | retval = PTR_ERR(intf->usb_dev); | 216 | retval = PTR_ERR(intf->usb_dev); |
| 219 | } | 217 | } |
| 220 | exit: | ||
| 221 | return retval; | 218 | return retval; |
| 222 | } | 219 | } |
| 223 | EXPORT_SYMBOL_GPL(usb_register_dev); | 220 | EXPORT_SYMBOL_GPL(usb_register_dev); |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 844683e50383..9f0ce7de0e36 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
| @@ -1802,6 +1802,7 @@ free_interfaces: | |||
| 1802 | intf->dev.groups = usb_interface_groups; | 1802 | intf->dev.groups = usb_interface_groups; |
| 1803 | intf->dev.dma_mask = dev->dev.dma_mask; | 1803 | intf->dev.dma_mask = dev->dev.dma_mask; |
| 1804 | INIT_WORK(&intf->reset_ws, __usb_queue_reset_device); | 1804 | INIT_WORK(&intf->reset_ws, __usb_queue_reset_device); |
| 1805 | intf->minor = -1; | ||
| 1805 | device_initialize(&intf->dev); | 1806 | device_initialize(&intf->dev); |
| 1806 | dev_set_name(&intf->dev, "%d-%s:%d.%d", | 1807 | dev_set_name(&intf->dev, "%d-%s:%d.%d", |
| 1807 | dev->bus->busnum, dev->devpath, | 1808 | dev->bus->busnum, dev->devpath, |
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 58b72d741d93..a1e8d273103f 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
| @@ -119,6 +119,11 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
| 119 | ehci->broken_periodic = 1; | 119 | ehci->broken_periodic = 1; |
| 120 | ehci_info(ehci, "using broken periodic workaround\n"); | 120 | ehci_info(ehci, "using broken periodic workaround\n"); |
| 121 | } | 121 | } |
| 122 | if (pdev->device == 0x0806 || pdev->device == 0x0811 | ||
| 123 | || pdev->device == 0x0829) { | ||
| 124 | ehci_info(ehci, "disable lpm for langwell/penwell\n"); | ||
| 125 | ehci->has_lpm = 0; | ||
| 126 | } | ||
| 122 | break; | 127 | break; |
| 123 | case PCI_VENDOR_ID_TDI: | 128 | case PCI_VENDOR_ID_TDI: |
| 124 | if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { | 129 | if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { |
diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c index 59dc3d351b60..5ab5bb89bae3 100644 --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c | |||
| @@ -322,6 +322,7 @@ cppi_channel_allocate(struct dma_controller *c, | |||
| 322 | index, transmit ? 'T' : 'R', cppi_ch); | 322 | index, transmit ? 'T' : 'R', cppi_ch); |
| 323 | cppi_ch->hw_ep = ep; | 323 | cppi_ch->hw_ep = ep; |
| 324 | cppi_ch->channel.status = MUSB_DMA_STATUS_FREE; | 324 | cppi_ch->channel.status = MUSB_DMA_STATUS_FREE; |
| 325 | cppi_ch->channel.max_len = 0x7fffffff; | ||
| 325 | 326 | ||
| 326 | DBG(4, "Allocate CPPI%d %cX\n", index, transmit ? 'T' : 'R'); | 327 | DBG(4, "Allocate CPPI%d %cX\n", index, transmit ? 'T' : 'R'); |
| 327 | return &cppi_ch->channel; | 328 | return &cppi_ch->channel; |
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c index c79a5e30d437..9e8639d4e862 100644 --- a/drivers/usb/musb/musb_debugfs.c +++ b/drivers/usb/musb/musb_debugfs.c | |||
| @@ -195,15 +195,14 @@ static const struct file_operations musb_regdump_fops = { | |||
| 195 | 195 | ||
| 196 | static int musb_test_mode_open(struct inode *inode, struct file *file) | 196 | static int musb_test_mode_open(struct inode *inode, struct file *file) |
| 197 | { | 197 | { |
| 198 | file->private_data = inode->i_private; | ||
| 199 | |||
| 200 | return single_open(file, musb_test_mode_show, inode->i_private); | 198 | return single_open(file, musb_test_mode_show, inode->i_private); |
| 201 | } | 199 | } |
| 202 | 200 | ||
| 203 | static ssize_t musb_test_mode_write(struct file *file, | 201 | static ssize_t musb_test_mode_write(struct file *file, |
| 204 | const char __user *ubuf, size_t count, loff_t *ppos) | 202 | const char __user *ubuf, size_t count, loff_t *ppos) |
| 205 | { | 203 | { |
| 206 | struct musb *musb = file->private_data; | 204 | struct seq_file *s = file->private_data; |
| 205 | struct musb *musb = s->private; | ||
| 207 | u8 test = 0; | 206 | u8 test = 0; |
| 208 | char buf[18]; | 207 | char buf[18]; |
| 209 | 208 | ||
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 6fca870e957e..d065e23f123e 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
| @@ -300,6 +300,11 @@ static void txstate(struct musb *musb, struct musb_request *req) | |||
| 300 | #ifndef CONFIG_MUSB_PIO_ONLY | 300 | #ifndef CONFIG_MUSB_PIO_ONLY |
| 301 | if (is_dma_capable() && musb_ep->dma) { | 301 | if (is_dma_capable() && musb_ep->dma) { |
| 302 | struct dma_controller *c = musb->dma_controller; | 302 | struct dma_controller *c = musb->dma_controller; |
| 303 | size_t request_size; | ||
| 304 | |||
| 305 | /* setup DMA, then program endpoint CSR */ | ||
| 306 | request_size = min_t(size_t, request->length - request->actual, | ||
| 307 | musb_ep->dma->max_len); | ||
| 303 | 308 | ||
| 304 | use_dma = (request->dma != DMA_ADDR_INVALID); | 309 | use_dma = (request->dma != DMA_ADDR_INVALID); |
| 305 | 310 | ||
| @@ -307,11 +312,6 @@ static void txstate(struct musb *musb, struct musb_request *req) | |||
| 307 | 312 | ||
| 308 | #ifdef CONFIG_USB_INVENTRA_DMA | 313 | #ifdef CONFIG_USB_INVENTRA_DMA |
| 309 | { | 314 | { |
| 310 | size_t request_size; | ||
| 311 | |||
| 312 | /* setup DMA, then program endpoint CSR */ | ||
| 313 | request_size = min_t(size_t, request->length, | ||
| 314 | musb_ep->dma->max_len); | ||
| 315 | if (request_size < musb_ep->packet_sz) | 315 | if (request_size < musb_ep->packet_sz) |
| 316 | musb_ep->dma->desired_mode = 0; | 316 | musb_ep->dma->desired_mode = 0; |
| 317 | else | 317 | else |
| @@ -373,8 +373,8 @@ static void txstate(struct musb *musb, struct musb_request *req) | |||
| 373 | use_dma = use_dma && c->channel_program( | 373 | use_dma = use_dma && c->channel_program( |
| 374 | musb_ep->dma, musb_ep->packet_sz, | 374 | musb_ep->dma, musb_ep->packet_sz, |
| 375 | 0, | 375 | 0, |
| 376 | request->dma, | 376 | request->dma + request->actual, |
| 377 | request->length); | 377 | request_size); |
| 378 | if (!use_dma) { | 378 | if (!use_dma) { |
| 379 | c->channel_release(musb_ep->dma); | 379 | c->channel_release(musb_ep->dma); |
| 380 | musb_ep->dma = NULL; | 380 | musb_ep->dma = NULL; |
| @@ -386,8 +386,8 @@ static void txstate(struct musb *musb, struct musb_request *req) | |||
| 386 | use_dma = use_dma && c->channel_program( | 386 | use_dma = use_dma && c->channel_program( |
| 387 | musb_ep->dma, musb_ep->packet_sz, | 387 | musb_ep->dma, musb_ep->packet_sz, |
| 388 | request->zero, | 388 | request->zero, |
| 389 | request->dma, | 389 | request->dma + request->actual, |
| 390 | request->length); | 390 | request_size); |
| 391 | #endif | 391 | #endif |
| 392 | } | 392 | } |
| 393 | #endif | 393 | #endif |
| @@ -501,26 +501,14 @@ void musb_g_tx(struct musb *musb, u8 epnum) | |||
| 501 | request->zero = 0; | 501 | request->zero = 0; |
| 502 | } | 502 | } |
| 503 | 503 | ||
| 504 | /* ... or if not, then complete it. */ | 504 | if (request->actual == request->length) { |
| 505 | musb_g_giveback(musb_ep, request, 0); | 505 | musb_g_giveback(musb_ep, request, 0); |
| 506 | 506 | request = musb_ep->desc ? next_request(musb_ep) : NULL; | |
| 507 | /* | 507 | if (!request) { |
| 508 | * Kickstart next transfer if appropriate; | 508 | DBG(4, "%s idle now\n", |
| 509 | * the packet that just completed might not | 509 | musb_ep->end_point.name); |
| 510 | * be transmitted for hours or days. | 510 | return; |
| 511 | * REVISIT for double buffering... | 511 | } |
| 512 | * FIXME revisit for stalls too... | ||
| 513 | */ | ||
| 514 | musb_ep_select(mbase, epnum); | ||
| 515 | csr = musb_readw(epio, MUSB_TXCSR); | ||
| 516 | if (csr & MUSB_TXCSR_FIFONOTEMPTY) | ||
| 517 | return; | ||
| 518 | |||
| 519 | request = musb_ep->desc ? next_request(musb_ep) : NULL; | ||
| 520 | if (!request) { | ||
| 521 | DBG(4, "%s idle now\n", | ||
| 522 | musb_ep->end_point.name); | ||
| 523 | return; | ||
| 524 | } | 512 | } |
| 525 | } | 513 | } |
| 526 | 514 | ||
| @@ -568,11 +556,19 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
| 568 | { | 556 | { |
| 569 | const u8 epnum = req->epnum; | 557 | const u8 epnum = req->epnum; |
| 570 | struct usb_request *request = &req->request; | 558 | struct usb_request *request = &req->request; |
| 571 | struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; | 559 | struct musb_ep *musb_ep; |
| 572 | void __iomem *epio = musb->endpoints[epnum].regs; | 560 | void __iomem *epio = musb->endpoints[epnum].regs; |
| 573 | unsigned fifo_count = 0; | 561 | unsigned fifo_count = 0; |
| 574 | u16 len = musb_ep->packet_sz; | 562 | u16 len; |
| 575 | u16 csr = musb_readw(epio, MUSB_RXCSR); | 563 | u16 csr = musb_readw(epio, MUSB_RXCSR); |
| 564 | struct musb_hw_ep *hw_ep = &musb->endpoints[epnum]; | ||
| 565 | |||
| 566 | if (hw_ep->is_shared_fifo) | ||
| 567 | musb_ep = &hw_ep->ep_in; | ||
| 568 | else | ||
| 569 | musb_ep = &hw_ep->ep_out; | ||
| 570 | |||
| 571 | len = musb_ep->packet_sz; | ||
| 576 | 572 | ||
| 577 | /* We shouldn't get here while DMA is active, but we do... */ | 573 | /* We shouldn't get here while DMA is active, but we do... */ |
| 578 | if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) { | 574 | if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) { |
| @@ -647,8 +643,8 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
| 647 | */ | 643 | */ |
| 648 | 644 | ||
| 649 | csr |= MUSB_RXCSR_DMAENAB; | 645 | csr |= MUSB_RXCSR_DMAENAB; |
| 650 | #ifdef USE_MODE1 | ||
| 651 | csr |= MUSB_RXCSR_AUTOCLEAR; | 646 | csr |= MUSB_RXCSR_AUTOCLEAR; |
| 647 | #ifdef USE_MODE1 | ||
| 652 | /* csr |= MUSB_RXCSR_DMAMODE; */ | 648 | /* csr |= MUSB_RXCSR_DMAMODE; */ |
| 653 | 649 | ||
| 654 | /* this special sequence (enabling and then | 650 | /* this special sequence (enabling and then |
| @@ -663,10 +659,11 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
| 663 | if (request->actual < request->length) { | 659 | if (request->actual < request->length) { |
| 664 | int transfer_size = 0; | 660 | int transfer_size = 0; |
| 665 | #ifdef USE_MODE1 | 661 | #ifdef USE_MODE1 |
| 666 | transfer_size = min(request->length, | 662 | transfer_size = min(request->length - request->actual, |
| 667 | channel->max_len); | 663 | channel->max_len); |
| 668 | #else | 664 | #else |
| 669 | transfer_size = len; | 665 | transfer_size = min(request->length - request->actual, |
| 666 | (unsigned)len); | ||
| 670 | #endif | 667 | #endif |
| 671 | if (transfer_size <= musb_ep->packet_sz) | 668 | if (transfer_size <= musb_ep->packet_sz) |
| 672 | musb_ep->dma->desired_mode = 0; | 669 | musb_ep->dma->desired_mode = 0; |
| @@ -740,9 +737,15 @@ void musb_g_rx(struct musb *musb, u8 epnum) | |||
| 740 | u16 csr; | 737 | u16 csr; |
| 741 | struct usb_request *request; | 738 | struct usb_request *request; |
| 742 | void __iomem *mbase = musb->mregs; | 739 | void __iomem *mbase = musb->mregs; |
| 743 | struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; | 740 | struct musb_ep *musb_ep; |
| 744 | void __iomem *epio = musb->endpoints[epnum].regs; | 741 | void __iomem *epio = musb->endpoints[epnum].regs; |
| 745 | struct dma_channel *dma; | 742 | struct dma_channel *dma; |
| 743 | struct musb_hw_ep *hw_ep = &musb->endpoints[epnum]; | ||
| 744 | |||
| 745 | if (hw_ep->is_shared_fifo) | ||
| 746 | musb_ep = &hw_ep->ep_in; | ||
| 747 | else | ||
| 748 | musb_ep = &hw_ep->ep_out; | ||
| 746 | 749 | ||
| 747 | musb_ep_select(mbase, epnum); | 750 | musb_ep_select(mbase, epnum); |
| 748 | 751 | ||
| @@ -1081,7 +1084,7 @@ struct free_record { | |||
| 1081 | /* | 1084 | /* |
| 1082 | * Context: controller locked, IRQs blocked. | 1085 | * Context: controller locked, IRQs blocked. |
| 1083 | */ | 1086 | */ |
| 1084 | static void musb_ep_restart(struct musb *musb, struct musb_request *req) | 1087 | void musb_ep_restart(struct musb *musb, struct musb_request *req) |
| 1085 | { | 1088 | { |
| 1086 | DBG(3, "<== %s request %p len %u on hw_ep%d\n", | 1089 | DBG(3, "<== %s request %p len %u on hw_ep%d\n", |
| 1087 | req->tx ? "TX/IN" : "RX/OUT", | 1090 | req->tx ? "TX/IN" : "RX/OUT", |
diff --git a/drivers/usb/musb/musb_gadget.h b/drivers/usb/musb/musb_gadget.h index c8b140325d82..572b1da7f2dc 100644 --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h | |||
| @@ -105,4 +105,6 @@ extern void musb_gadget_cleanup(struct musb *); | |||
| 105 | 105 | ||
| 106 | extern void musb_g_giveback(struct musb_ep *, struct usb_request *, int); | 106 | extern void musb_g_giveback(struct musb_ep *, struct usb_request *, int); |
| 107 | 107 | ||
| 108 | extern void musb_ep_restart(struct musb *, struct musb_request *); | ||
| 109 | |||
| 108 | #endif /* __MUSB_GADGET_H */ | 110 | #endif /* __MUSB_GADGET_H */ |
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c index 59bef8f3a358..6dd03f4c5f49 100644 --- a/drivers/usb/musb/musb_gadget_ep0.c +++ b/drivers/usb/musb/musb_gadget_ep0.c | |||
| @@ -261,6 +261,7 @@ __acquires(musb->lock) | |||
| 261 | ctrlrequest->wIndex & 0x0f; | 261 | ctrlrequest->wIndex & 0x0f; |
| 262 | struct musb_ep *musb_ep; | 262 | struct musb_ep *musb_ep; |
| 263 | struct musb_hw_ep *ep; | 263 | struct musb_hw_ep *ep; |
| 264 | struct musb_request *request; | ||
| 264 | void __iomem *regs; | 265 | void __iomem *regs; |
| 265 | int is_in; | 266 | int is_in; |
| 266 | u16 csr; | 267 | u16 csr; |
| @@ -302,6 +303,14 @@ __acquires(musb->lock) | |||
| 302 | musb_writew(regs, MUSB_RXCSR, csr); | 303 | musb_writew(regs, MUSB_RXCSR, csr); |
| 303 | } | 304 | } |
| 304 | 305 | ||
| 306 | /* Maybe start the first request in the queue */ | ||
| 307 | request = to_musb_request( | ||
| 308 | next_request(musb_ep)); | ||
| 309 | if (!musb_ep->busy && request) { | ||
| 310 | DBG(3, "restarting the request\n"); | ||
| 311 | musb_ep_restart(musb, request); | ||
| 312 | } | ||
| 313 | |||
| 305 | /* select ep0 again */ | 314 | /* select ep0 again */ |
| 306 | musb_ep_select(mbase, 0); | 315 | musb_ep_select(mbase, 0); |
| 307 | } break; | 316 | } break; |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 877d20b1dff9..9e65c47cc98b 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
| @@ -660,6 +660,12 @@ static bool musb_tx_dma_program(struct dma_controller *dma, | |||
| 660 | 660 | ||
| 661 | qh->segsize = length; | 661 | qh->segsize = length; |
| 662 | 662 | ||
| 663 | /* | ||
| 664 | * Ensure the data reaches to main memory before starting | ||
| 665 | * DMA transfer | ||
| 666 | */ | ||
| 667 | wmb(); | ||
| 668 | |||
| 663 | if (!dma->channel_program(channel, pkt_size, mode, | 669 | if (!dma->channel_program(channel, pkt_size, mode, |
| 664 | urb->transfer_dma + offset, length)) { | 670 | urb->transfer_dma + offset, length)) { |
| 665 | dma->channel_release(channel); | 671 | dma->channel_release(channel); |
diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c index 05aaac1c3861..0bc97698af15 100644 --- a/drivers/usb/otg/twl4030-usb.c +++ b/drivers/usb/otg/twl4030-usb.c | |||
| @@ -347,11 +347,20 @@ static void twl4030_i2c_access(struct twl4030_usb *twl, int on) | |||
| 347 | } | 347 | } |
| 348 | } | 348 | } |
| 349 | 349 | ||
| 350 | static void twl4030_phy_power(struct twl4030_usb *twl, int on) | 350 | static void __twl4030_phy_power(struct twl4030_usb *twl, int on) |
| 351 | { | 351 | { |
| 352 | u8 pwr; | 352 | u8 pwr = twl4030_usb_read(twl, PHY_PWR_CTRL); |
| 353 | |||
| 354 | if (on) | ||
| 355 | pwr &= ~PHY_PWR_PHYPWD; | ||
| 356 | else | ||
| 357 | pwr |= PHY_PWR_PHYPWD; | ||
| 353 | 358 | ||
| 354 | pwr = twl4030_usb_read(twl, PHY_PWR_CTRL); | 359 | WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0); |
| 360 | } | ||
| 361 | |||
| 362 | static void twl4030_phy_power(struct twl4030_usb *twl, int on) | ||
| 363 | { | ||
| 355 | if (on) { | 364 | if (on) { |
| 356 | regulator_enable(twl->usb3v1); | 365 | regulator_enable(twl->usb3v1); |
| 357 | regulator_enable(twl->usb1v8); | 366 | regulator_enable(twl->usb1v8); |
| @@ -365,15 +374,13 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on) | |||
| 365 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, | 374 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, |
| 366 | VUSB_DEDICATED2); | 375 | VUSB_DEDICATED2); |
| 367 | regulator_enable(twl->usb1v5); | 376 | regulator_enable(twl->usb1v5); |
| 368 | pwr &= ~PHY_PWR_PHYPWD; | 377 | __twl4030_phy_power(twl, 1); |
| 369 | WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0); | ||
| 370 | twl4030_usb_write(twl, PHY_CLK_CTRL, | 378 | twl4030_usb_write(twl, PHY_CLK_CTRL, |
| 371 | twl4030_usb_read(twl, PHY_CLK_CTRL) | | 379 | twl4030_usb_read(twl, PHY_CLK_CTRL) | |
| 372 | (PHY_CLK_CTRL_CLOCKGATING_EN | | 380 | (PHY_CLK_CTRL_CLOCKGATING_EN | |
| 373 | PHY_CLK_CTRL_CLK32K_EN)); | 381 | PHY_CLK_CTRL_CLK32K_EN)); |
| 374 | } else { | 382 | } else { |
| 375 | pwr |= PHY_PWR_PHYPWD; | 383 | __twl4030_phy_power(twl, 0); |
| 376 | WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0); | ||
| 377 | regulator_disable(twl->usb1v5); | 384 | regulator_disable(twl->usb1v5); |
| 378 | regulator_disable(twl->usb1v8); | 385 | regulator_disable(twl->usb1v8); |
| 379 | regulator_disable(twl->usb3v1); | 386 | regulator_disable(twl->usb3v1); |
| @@ -387,19 +394,25 @@ static void twl4030_phy_suspend(struct twl4030_usb *twl, int controller_off) | |||
| 387 | 394 | ||
| 388 | twl4030_phy_power(twl, 0); | 395 | twl4030_phy_power(twl, 0); |
| 389 | twl->asleep = 1; | 396 | twl->asleep = 1; |
| 397 | dev_dbg(twl->dev, "%s\n", __func__); | ||
| 390 | } | 398 | } |
| 391 | 399 | ||
| 392 | static void twl4030_phy_resume(struct twl4030_usb *twl) | 400 | static void __twl4030_phy_resume(struct twl4030_usb *twl) |
| 393 | { | 401 | { |
| 394 | if (!twl->asleep) | ||
| 395 | return; | ||
| 396 | |||
| 397 | twl4030_phy_power(twl, 1); | 402 | twl4030_phy_power(twl, 1); |
| 398 | twl4030_i2c_access(twl, 1); | 403 | twl4030_i2c_access(twl, 1); |
| 399 | twl4030_usb_set_mode(twl, twl->usb_mode); | 404 | twl4030_usb_set_mode(twl, twl->usb_mode); |
| 400 | if (twl->usb_mode == T2_USB_MODE_ULPI) | 405 | if (twl->usb_mode == T2_USB_MODE_ULPI) |
| 401 | twl4030_i2c_access(twl, 0); | 406 | twl4030_i2c_access(twl, 0); |
| 407 | } | ||
| 408 | |||
| 409 | static void twl4030_phy_resume(struct twl4030_usb *twl) | ||
| 410 | { | ||
| 411 | if (!twl->asleep) | ||
| 412 | return; | ||
| 413 | __twl4030_phy_resume(twl); | ||
| 402 | twl->asleep = 0; | 414 | twl->asleep = 0; |
| 415 | dev_dbg(twl->dev, "%s\n", __func__); | ||
| 403 | } | 416 | } |
| 404 | 417 | ||
| 405 | static int twl4030_usb_ldo_init(struct twl4030_usb *twl) | 418 | static int twl4030_usb_ldo_init(struct twl4030_usb *twl) |
| @@ -408,8 +421,8 @@ static int twl4030_usb_ldo_init(struct twl4030_usb *twl) | |||
| 408 | twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0xC0, PROTECT_KEY); | 421 | twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0xC0, PROTECT_KEY); |
| 409 | twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0x0C, PROTECT_KEY); | 422 | twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0x0C, PROTECT_KEY); |
| 410 | 423 | ||
| 411 | /* put VUSB3V1 LDO in active state */ | 424 | /* Keep VUSB3V1 LDO in sleep state until VBUS/ID change detected*/ |
| 412 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2); | 425 | /*twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2);*/ |
| 413 | 426 | ||
| 414 | /* input to VUSB3V1 LDO is from VBAT, not VBUS */ | 427 | /* input to VUSB3V1 LDO is from VBAT, not VBUS */ |
| 415 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x14, VUSB_DEDICATED1); | 428 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x14, VUSB_DEDICATED1); |
| @@ -502,6 +515,26 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl) | |||
| 502 | return IRQ_HANDLED; | 515 | return IRQ_HANDLED; |
| 503 | } | 516 | } |
| 504 | 517 | ||
| 518 | static void twl4030_usb_phy_init(struct twl4030_usb *twl) | ||
| 519 | { | ||
| 520 | int status; | ||
| 521 | |||
| 522 | status = twl4030_usb_linkstat(twl); | ||
| 523 | if (status >= 0) { | ||
| 524 | if (status == USB_EVENT_NONE) { | ||
| 525 | __twl4030_phy_power(twl, 0); | ||
| 526 | twl->asleep = 1; | ||
| 527 | } else { | ||
| 528 | __twl4030_phy_resume(twl); | ||
| 529 | twl->asleep = 0; | ||
| 530 | } | ||
| 531 | |||
| 532 | blocking_notifier_call_chain(&twl->otg.notifier, status, | ||
| 533 | twl->otg.gadget); | ||
| 534 | } | ||
| 535 | sysfs_notify(&twl->dev->kobj, NULL, "vbus"); | ||
| 536 | } | ||
| 537 | |||
| 505 | static int twl4030_set_suspend(struct otg_transceiver *x, int suspend) | 538 | static int twl4030_set_suspend(struct otg_transceiver *x, int suspend) |
| 506 | { | 539 | { |
| 507 | struct twl4030_usb *twl = xceiv_to_twl(x); | 540 | struct twl4030_usb *twl = xceiv_to_twl(x); |
| @@ -550,7 +583,6 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev) | |||
| 550 | struct twl4030_usb_data *pdata = pdev->dev.platform_data; | 583 | struct twl4030_usb_data *pdata = pdev->dev.platform_data; |
| 551 | struct twl4030_usb *twl; | 584 | struct twl4030_usb *twl; |
| 552 | int status, err; | 585 | int status, err; |
| 553 | u8 pwr; | ||
| 554 | 586 | ||
| 555 | if (!pdata) { | 587 | if (!pdata) { |
| 556 | dev_dbg(&pdev->dev, "platform_data not available\n"); | 588 | dev_dbg(&pdev->dev, "platform_data not available\n"); |
| @@ -569,10 +601,7 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev) | |||
| 569 | twl->otg.set_peripheral = twl4030_set_peripheral; | 601 | twl->otg.set_peripheral = twl4030_set_peripheral; |
| 570 | twl->otg.set_suspend = twl4030_set_suspend; | 602 | twl->otg.set_suspend = twl4030_set_suspend; |
| 571 | twl->usb_mode = pdata->usb_mode; | 603 | twl->usb_mode = pdata->usb_mode; |
| 572 | 604 | twl->asleep = 1; | |
| 573 | pwr = twl4030_usb_read(twl, PHY_PWR_CTRL); | ||
| 574 | |||
| 575 | twl->asleep = (pwr & PHY_PWR_PHYPWD); | ||
| 576 | 605 | ||
| 577 | /* init spinlock for workqueue */ | 606 | /* init spinlock for workqueue */ |
| 578 | spin_lock_init(&twl->lock); | 607 | spin_lock_init(&twl->lock); |
| @@ -610,15 +639,10 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev) | |||
| 610 | return status; | 639 | return status; |
| 611 | } | 640 | } |
| 612 | 641 | ||
| 613 | /* The IRQ handler just handles changes from the previous states | 642 | /* Power down phy or make it work according to |
| 614 | * of the ID and VBUS pins ... in probe() we must initialize that | 643 | * current link state. |
| 615 | * previous state. The easy way: fake an IRQ. | ||
| 616 | * | ||
| 617 | * REVISIT: a real IRQ might have happened already, if PREEMPT is | ||
| 618 | * enabled. Else the IRQ may not yet be configured or enabled, | ||
| 619 | * because of scheduling delays. | ||
| 620 | */ | 644 | */ |
| 621 | twl4030_usb_irq(twl->irq, twl); | 645 | twl4030_usb_phy_init(twl); |
| 622 | 646 | ||
| 623 | dev_info(&pdev->dev, "Initialized TWL4030 USB module\n"); | 647 | dev_info(&pdev->dev, "Initialized TWL4030 USB module\n"); |
| 624 | return 0; | 648 | return 0; |
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index 30922a7e3347..aa665817a272 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
| @@ -2024,6 +2024,9 @@ static int mos7720_ioctl(struct tty_struct *tty, struct file *file, | |||
| 2024 | 2024 | ||
| 2025 | case TIOCGICOUNT: | 2025 | case TIOCGICOUNT: |
| 2026 | cnow = mos7720_port->icount; | 2026 | cnow = mos7720_port->icount; |
| 2027 | |||
| 2028 | memset(&icount, 0, sizeof(struct serial_icounter_struct)); | ||
| 2029 | |||
| 2027 | icount.cts = cnow.cts; | 2030 | icount.cts = cnow.cts; |
| 2028 | icount.dsr = cnow.dsr; | 2031 | icount.dsr = cnow.dsr; |
| 2029 | icount.rng = cnow.rng; | 2032 | icount.rng = cnow.rng; |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 1c9b6e9b2386..1a42bc213799 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
| @@ -2285,6 +2285,9 @@ static int mos7840_ioctl(struct tty_struct *tty, struct file *file, | |||
| 2285 | case TIOCGICOUNT: | 2285 | case TIOCGICOUNT: |
| 2286 | cnow = mos7840_port->icount; | 2286 | cnow = mos7840_port->icount; |
| 2287 | smp_rmb(); | 2287 | smp_rmb(); |
| 2288 | |||
| 2289 | memset(&icount, 0, sizeof(struct serial_icounter_struct)); | ||
| 2290 | |||
| 2288 | icount.cts = cnow.cts; | 2291 | icount.cts = cnow.cts; |
| 2289 | icount.dsr = cnow.dsr; | 2292 | icount.dsr = cnow.dsr; |
| 2290 | icount.rng = cnow.rng; | 2293 | icount.rng = cnow.rng; |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 29e850a7a2f9..7c8008225ee3 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
| @@ -243,7 +243,7 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, | |||
| 243 | int r, nlogs = 0; | 243 | int r, nlogs = 0; |
| 244 | 244 | ||
| 245 | while (datalen > 0) { | 245 | while (datalen > 0) { |
| 246 | if (unlikely(headcount >= VHOST_NET_MAX_SG)) { | 246 | if (unlikely(seg >= VHOST_NET_MAX_SG)) { |
| 247 | r = -ENOBUFS; | 247 | r = -ENOBUFS; |
| 248 | goto err; | 248 | goto err; |
| 249 | } | 249 | } |
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c579dcc9200c..dd3d6f7406f8 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
| @@ -858,11 +858,12 @@ int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, | |||
| 858 | if (r < 0) | 858 | if (r < 0) |
| 859 | return r; | 859 | return r; |
| 860 | len -= l; | 860 | len -= l; |
| 861 | if (!len) | 861 | if (!len) { |
| 862 | if (vq->log_ctx) | ||
| 863 | eventfd_signal(vq->log_ctx, 1); | ||
| 862 | return 0; | 864 | return 0; |
| 865 | } | ||
| 863 | } | 866 | } |
| 864 | if (vq->log_ctx) | ||
| 865 | eventfd_signal(vq->log_ctx, 1); | ||
| 866 | /* Length written exceeds what we have stored. This is a bug. */ | 867 | /* Length written exceeds what we have stored. This is a bug. */ |
| 867 | BUG(); | 868 | BUG(); |
| 868 | return 0; | 869 | return 0; |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 84f842331dfa..7ccc967831f0 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
| @@ -3508,7 +3508,7 @@ static void fbcon_exit(void) | |||
| 3508 | softback_buf = 0UL; | 3508 | softback_buf = 0UL; |
| 3509 | 3509 | ||
| 3510 | for (i = 0; i < FB_MAX; i++) { | 3510 | for (i = 0; i < FB_MAX; i++) { |
| 3511 | int pending; | 3511 | int pending = 0; |
| 3512 | 3512 | ||
| 3513 | mapped = 0; | 3513 | mapped = 0; |
| 3514 | info = registered_fb[i]; | 3514 | info = registered_fb[i]; |
| @@ -3516,7 +3516,8 @@ static void fbcon_exit(void) | |||
| 3516 | if (info == NULL) | 3516 | if (info == NULL) |
| 3517 | continue; | 3517 | continue; |
| 3518 | 3518 | ||
| 3519 | pending = cancel_work_sync(&info->queue); | 3519 | if (info->queue.func) |
| 3520 | pending = cancel_work_sync(&info->queue); | ||
| 3520 | DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" : | 3521 | DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" : |
| 3521 | "no")); | 3522 | "no")); |
| 3522 | 3523 | ||
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c index 815f84b07933..70477c2e4b61 100644 --- a/drivers/video/efifb.c +++ b/drivers/video/efifb.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/screen_info.h> | 14 | #include <linux/screen_info.h> |
| 15 | #include <linux/dmi.h> | 15 | #include <linux/dmi.h> |
| 16 | 16 | #include <linux/pci.h> | |
| 17 | #include <video/vga.h> | 17 | #include <video/vga.h> |
| 18 | 18 | ||
| 19 | static struct fb_var_screeninfo efifb_defined __devinitdata = { | 19 | static struct fb_var_screeninfo efifb_defined __devinitdata = { |
| @@ -39,17 +39,31 @@ enum { | |||
| 39 | M_I20, /* 20-Inch iMac */ | 39 | M_I20, /* 20-Inch iMac */ |
| 40 | M_I20_SR, /* 20-Inch iMac (Santa Rosa) */ | 40 | M_I20_SR, /* 20-Inch iMac (Santa Rosa) */ |
| 41 | M_I24, /* 24-Inch iMac */ | 41 | M_I24, /* 24-Inch iMac */ |
| 42 | M_I24_8_1, /* 24-Inch iMac, 8,1th gen */ | ||
| 43 | M_I24_10_1, /* 24-Inch iMac, 10,1th gen */ | ||
| 44 | M_I27_11_1, /* 27-Inch iMac, 11,1th gen */ | ||
| 42 | M_MINI, /* Mac Mini */ | 45 | M_MINI, /* Mac Mini */ |
| 46 | M_MINI_3_1, /* Mac Mini, 3,1th gen */ | ||
| 47 | M_MINI_4_1, /* Mac Mini, 4,1th gen */ | ||
| 43 | M_MB, /* MacBook */ | 48 | M_MB, /* MacBook */ |
| 44 | M_MB_2, /* MacBook, 2nd rev. */ | 49 | M_MB_2, /* MacBook, 2nd rev. */ |
| 45 | M_MB_3, /* MacBook, 3rd rev. */ | 50 | M_MB_3, /* MacBook, 3rd rev. */ |
| 51 | M_MB_5_1, /* MacBook, 5th rev. */ | ||
| 52 | M_MB_6_1, /* MacBook, 6th rev. */ | ||
| 53 | M_MB_7_1, /* MacBook, 7th rev. */ | ||
| 46 | M_MB_SR, /* MacBook, 2nd gen, (Santa Rosa) */ | 54 | M_MB_SR, /* MacBook, 2nd gen, (Santa Rosa) */ |
| 47 | M_MBA, /* MacBook Air */ | 55 | M_MBA, /* MacBook Air */ |
| 48 | M_MBP, /* MacBook Pro */ | 56 | M_MBP, /* MacBook Pro */ |
| 49 | M_MBP_2, /* MacBook Pro 2nd gen */ | 57 | M_MBP_2, /* MacBook Pro 2nd gen */ |
| 58 | M_MBP_2_2, /* MacBook Pro 2,2nd gen */ | ||
| 50 | M_MBP_SR, /* MacBook Pro (Santa Rosa) */ | 59 | M_MBP_SR, /* MacBook Pro (Santa Rosa) */ |
| 51 | M_MBP_4, /* MacBook Pro, 4th gen */ | 60 | M_MBP_4, /* MacBook Pro, 4th gen */ |
| 52 | M_MBP_5_1, /* MacBook Pro, 5,1th gen */ | 61 | M_MBP_5_1, /* MacBook Pro, 5,1th gen */ |
| 62 | M_MBP_5_2, /* MacBook Pro, 5,2th gen */ | ||
| 63 | M_MBP_5_3, /* MacBook Pro, 5,3rd gen */ | ||
| 64 | M_MBP_6_1, /* MacBook Pro, 6,1th gen */ | ||
| 65 | M_MBP_6_2, /* MacBook Pro, 6,2th gen */ | ||
| 66 | M_MBP_7_1, /* MacBook Pro, 7,1th gen */ | ||
| 53 | M_UNKNOWN /* placeholder */ | 67 | M_UNKNOWN /* placeholder */ |
| 54 | }; | 68 | }; |
| 55 | 69 | ||
| @@ -64,14 +78,28 @@ static struct efifb_dmi_info { | |||
| 64 | [M_I20] = { "i20", 0x80010000, 1728 * 4, 1680, 1050 }, /* guess */ | 78 | [M_I20] = { "i20", 0x80010000, 1728 * 4, 1680, 1050 }, /* guess */ |
| 65 | [M_I20_SR] = { "imac7", 0x40010000, 1728 * 4, 1680, 1050 }, | 79 | [M_I20_SR] = { "imac7", 0x40010000, 1728 * 4, 1680, 1050 }, |
| 66 | [M_I24] = { "i24", 0x80010000, 2048 * 4, 1920, 1200 }, /* guess */ | 80 | [M_I24] = { "i24", 0x80010000, 2048 * 4, 1920, 1200 }, /* guess */ |
| 81 | [M_I24_8_1] = { "imac8", 0xc0060000, 2048 * 4, 1920, 1200 }, | ||
| 82 | [M_I24_10_1] = { "imac10", 0xc0010000, 2048 * 4, 1920, 1080 }, | ||
| 83 | [M_I27_11_1] = { "imac11", 0xc0010000, 2560 * 4, 2560, 1440 }, | ||
| 67 | [M_MINI]= { "mini", 0x80000000, 2048 * 4, 1024, 768 }, | 84 | [M_MINI]= { "mini", 0x80000000, 2048 * 4, 1024, 768 }, |
| 85 | [M_MINI_3_1] = { "mini31", 0x40010000, 1024 * 4, 1024, 768 }, | ||
| 86 | [M_MINI_4_1] = { "mini41", 0xc0010000, 2048 * 4, 1920, 1200 }, | ||
| 68 | [M_MB] = { "macbook", 0x80000000, 2048 * 4, 1280, 800 }, | 87 | [M_MB] = { "macbook", 0x80000000, 2048 * 4, 1280, 800 }, |
| 88 | [M_MB_5_1] = { "macbook51", 0x80010000, 2048 * 4, 1280, 800 }, | ||
| 89 | [M_MB_6_1] = { "macbook61", 0x80010000, 2048 * 4, 1280, 800 }, | ||
| 90 | [M_MB_7_1] = { "macbook71", 0x80010000, 2048 * 4, 1280, 800 }, | ||
| 69 | [M_MBA] = { "mba", 0x80000000, 2048 * 4, 1280, 800 }, | 91 | [M_MBA] = { "mba", 0x80000000, 2048 * 4, 1280, 800 }, |
| 70 | [M_MBP] = { "mbp", 0x80010000, 1472 * 4, 1440, 900 }, | 92 | [M_MBP] = { "mbp", 0x80010000, 1472 * 4, 1440, 900 }, |
| 71 | [M_MBP_2] = { "mbp2", 0, 0, 0, 0 }, /* placeholder */ | 93 | [M_MBP_2] = { "mbp2", 0, 0, 0, 0 }, /* placeholder */ |
| 94 | [M_MBP_2_2] = { "mbp22", 0x80010000, 1472 * 4, 1440, 900 }, | ||
| 72 | [M_MBP_SR] = { "mbp3", 0x80030000, 2048 * 4, 1440, 900 }, | 95 | [M_MBP_SR] = { "mbp3", 0x80030000, 2048 * 4, 1440, 900 }, |
| 73 | [M_MBP_4] = { "mbp4", 0xc0060000, 2048 * 4, 1920, 1200 }, | 96 | [M_MBP_4] = { "mbp4", 0xc0060000, 2048 * 4, 1920, 1200 }, |
| 74 | [M_MBP_5_1] = { "mbp51", 0xc0010000, 2048 * 4, 1440, 900 }, | 97 | [M_MBP_5_1] = { "mbp51", 0xc0010000, 2048 * 4, 1440, 900 }, |
| 98 | [M_MBP_5_2] = { "mbp52", 0xc0010000, 2048 * 4, 1920, 1200 }, | ||
| 99 | [M_MBP_5_3] = { "mbp53", 0xd0010000, 2048 * 4, 1440, 900 }, | ||
| 100 | [M_MBP_6_1] = { "mbp61", 0x90030000, 2048 * 4, 1920, 1200 }, | ||
| 101 | [M_MBP_6_2] = { "mbp62", 0x90030000, 2048 * 4, 1680, 1050 }, | ||
| 102 | [M_MBP_7_1] = { "mbp71", 0xc0010000, 2048 * 4, 1280, 800 }, | ||
| 75 | [M_UNKNOWN] = { NULL, 0, 0, 0, 0 } | 103 | [M_UNKNOWN] = { NULL, 0, 0, 0, 0 } |
| 76 | }; | 104 | }; |
| 77 | 105 | ||
| @@ -92,7 +120,12 @@ static const struct dmi_system_id dmi_system_table[] __initconst = { | |||
| 92 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "iMac6,1", M_I24), | 120 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "iMac6,1", M_I24), |
| 93 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac6,1", M_I24), | 121 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac6,1", M_I24), |
| 94 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac7,1", M_I20_SR), | 122 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac7,1", M_I20_SR), |
| 123 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac8,1", M_I24_8_1), | ||
| 124 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac10,1", M_I24_10_1), | ||
| 125 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac11,1", M_I27_11_1), | ||
| 95 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "Macmini1,1", M_MINI), | 126 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "Macmini1,1", M_MINI), |
| 127 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "Macmini3,1", M_MINI_3_1), | ||
| 128 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "Macmini4,1", M_MINI_4_1), | ||
| 96 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook1,1", M_MB), | 129 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook1,1", M_MB), |
| 97 | /* At least one of these two will be right; maybe both? */ | 130 | /* At least one of these two will be right; maybe both? */ |
| 98 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook2,1", M_MB), | 131 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook2,1", M_MB), |
| @@ -101,14 +134,23 @@ static const struct dmi_system_id dmi_system_table[] __initconst = { | |||
| 101 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook3,1", M_MB), | 134 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook3,1", M_MB), |
| 102 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook3,1", M_MB), | 135 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook3,1", M_MB), |
| 103 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook4,1", M_MB), | 136 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook4,1", M_MB), |
| 137 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook5,1", M_MB_5_1), | ||
| 138 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook6,1", M_MB_6_1), | ||
| 139 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook7,1", M_MB_7_1), | ||
| 104 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookAir1,1", M_MBA), | 140 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookAir1,1", M_MBA), |
| 105 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro1,1", M_MBP), | 141 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro1,1", M_MBP), |
| 106 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,1", M_MBP_2), | 142 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,1", M_MBP_2), |
| 143 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,2", M_MBP_2_2), | ||
| 107 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro2,1", M_MBP_2), | 144 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro2,1", M_MBP_2), |
| 108 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro3,1", M_MBP_SR), | 145 | EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro3,1", M_MBP_SR), |
| 109 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro3,1", M_MBP_SR), | 146 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro3,1", M_MBP_SR), |
| 110 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro4,1", M_MBP_4), | 147 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro4,1", M_MBP_4), |
| 111 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,1", M_MBP_5_1), | 148 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,1", M_MBP_5_1), |
| 149 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,2", M_MBP_5_2), | ||
| 150 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,3", M_MBP_5_3), | ||
| 151 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro6,1", M_MBP_6_1), | ||
| 152 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro6,2", M_MBP_6_2), | ||
| 153 | EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro7,1", M_MBP_7_1), | ||
| 112 | {}, | 154 | {}, |
| 113 | }; | 155 | }; |
| 114 | 156 | ||
| @@ -116,7 +158,7 @@ static int set_system(const struct dmi_system_id *id) | |||
| 116 | { | 158 | { |
| 117 | struct efifb_dmi_info *info = id->driver_data; | 159 | struct efifb_dmi_info *info = id->driver_data; |
| 118 | if (info->base == 0) | 160 | if (info->base == 0) |
| 119 | return -ENODEV; | 161 | return 0; |
| 120 | 162 | ||
| 121 | printk(KERN_INFO "efifb: dmi detected %s - framebuffer at %p " | 163 | printk(KERN_INFO "efifb: dmi detected %s - framebuffer at %p " |
| 122 | "(%dx%d, stride %d)\n", id->ident, | 164 | "(%dx%d, stride %d)\n", id->ident, |
| @@ -124,18 +166,55 @@ static int set_system(const struct dmi_system_id *id) | |||
| 124 | info->stride); | 166 | info->stride); |
| 125 | 167 | ||
| 126 | /* Trust the bootloader over the DMI tables */ | 168 | /* Trust the bootloader over the DMI tables */ |
| 127 | if (screen_info.lfb_base == 0) | 169 | if (screen_info.lfb_base == 0) { |
| 170 | #if defined(CONFIG_PCI) | ||
| 171 | struct pci_dev *dev = NULL; | ||
| 172 | int found_bar = 0; | ||
| 173 | #endif | ||
| 128 | screen_info.lfb_base = info->base; | 174 | screen_info.lfb_base = info->base; |
| 129 | if (screen_info.lfb_linelength == 0) | ||
| 130 | screen_info.lfb_linelength = info->stride; | ||
| 131 | if (screen_info.lfb_width == 0) | ||
| 132 | screen_info.lfb_width = info->width; | ||
| 133 | if (screen_info.lfb_height == 0) | ||
| 134 | screen_info.lfb_height = info->height; | ||
| 135 | if (screen_info.orig_video_isVGA == 0) | ||
| 136 | screen_info.orig_video_isVGA = VIDEO_TYPE_EFI; | ||
| 137 | 175 | ||
| 138 | return 0; | 176 | #if defined(CONFIG_PCI) |
| 177 | /* make sure that the address in the table is actually on a | ||
| 178 | * VGA device's PCI BAR */ | ||
| 179 | |||
| 180 | for_each_pci_dev(dev) { | ||
| 181 | int i; | ||
| 182 | if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) | ||
| 183 | continue; | ||
| 184 | for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { | ||
| 185 | resource_size_t start, end; | ||
| 186 | |||
| 187 | start = pci_resource_start(dev, i); | ||
| 188 | if (start == 0) | ||
| 189 | break; | ||
| 190 | end = pci_resource_end(dev, i); | ||
| 191 | if (screen_info.lfb_base >= start && | ||
| 192 | screen_info.lfb_base < end) { | ||
| 193 | found_bar = 1; | ||
| 194 | } | ||
| 195 | } | ||
| 196 | } | ||
| 197 | if (!found_bar) | ||
| 198 | screen_info.lfb_base = 0; | ||
| 199 | #endif | ||
| 200 | } | ||
| 201 | if (screen_info.lfb_base) { | ||
| 202 | if (screen_info.lfb_linelength == 0) | ||
| 203 | screen_info.lfb_linelength = info->stride; | ||
| 204 | if (screen_info.lfb_width == 0) | ||
| 205 | screen_info.lfb_width = info->width; | ||
| 206 | if (screen_info.lfb_height == 0) | ||
| 207 | screen_info.lfb_height = info->height; | ||
| 208 | if (screen_info.orig_video_isVGA == 0) | ||
| 209 | screen_info.orig_video_isVGA = VIDEO_TYPE_EFI; | ||
| 210 | } else { | ||
| 211 | screen_info.lfb_linelength = 0; | ||
| 212 | screen_info.lfb_width = 0; | ||
| 213 | screen_info.lfb_height = 0; | ||
| 214 | screen_info.orig_video_isVGA = 0; | ||
| 215 | return 0; | ||
| 216 | } | ||
| 217 | return 1; | ||
| 139 | } | 218 | } |
| 140 | 219 | ||
| 141 | static int efifb_setcolreg(unsigned regno, unsigned red, unsigned green, | 220 | static int efifb_setcolreg(unsigned regno, unsigned red, unsigned green, |
diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c index 5d786bd3e304..a31a77ff6f3d 100644 --- a/drivers/video/pxa168fb.c +++ b/drivers/video/pxa168fb.c | |||
| @@ -298,8 +298,8 @@ static void set_dma_control0(struct pxa168fb_info *fbi) | |||
| 298 | * Set bit to enable graphics DMA. | 298 | * Set bit to enable graphics DMA. |
| 299 | */ | 299 | */ |
| 300 | x = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0); | 300 | x = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0); |
| 301 | x |= fbi->active ? 0x00000100 : 0; | 301 | x &= ~CFG_GRA_ENA_MASK; |
| 302 | fbi->active = 0; | 302 | x |= fbi->active ? CFG_GRA_ENA(1) : CFG_GRA_ENA(0); |
| 303 | 303 | ||
| 304 | /* | 304 | /* |
| 305 | * If we are in a pseudo-color mode, we need to enable | 305 | * If we are in a pseudo-color mode, we need to enable |
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c index 559bf1727a2b..b52f8e4ef1fd 100644 --- a/drivers/video/sis/sis_main.c +++ b/drivers/video/sis/sis_main.c | |||
| @@ -1701,6 +1701,9 @@ static int sisfb_ioctl(struct fb_info *info, unsigned int cmd, | |||
| 1701 | break; | 1701 | break; |
| 1702 | 1702 | ||
| 1703 | case FBIOGET_VBLANK: | 1703 | case FBIOGET_VBLANK: |
| 1704 | |||
| 1705 | memset(&sisvbblank, 0, sizeof(struct fb_vblank)); | ||
| 1706 | |||
| 1704 | sisvbblank.count = 0; | 1707 | sisvbblank.count = 0; |
| 1705 | sisvbblank.flags = sisfb_setupvbblankflags(ivideo, &sisvbblank.vcount, &sisvbblank.hcount); | 1708 | sisvbblank.flags = sisfb_setupvbblankflags(ivideo, &sisvbblank.vcount, &sisvbblank.hcount); |
| 1706 | 1709 | ||
diff --git a/drivers/video/via/ioctl.c b/drivers/video/via/ioctl.c index da03c074e32a..4d553d0b8d7a 100644 --- a/drivers/video/via/ioctl.c +++ b/drivers/video/via/ioctl.c | |||
| @@ -25,6 +25,8 @@ int viafb_ioctl_get_viafb_info(u_long arg) | |||
| 25 | { | 25 | { |
| 26 | struct viafb_ioctl_info viainfo; | 26 | struct viafb_ioctl_info viainfo; |
| 27 | 27 | ||
| 28 | memset(&viainfo, 0, sizeof(struct viafb_ioctl_info)); | ||
| 29 | |||
| 28 | viainfo.viafb_id = VIAID; | 30 | viainfo.viafb_id = VIAID; |
| 29 | viainfo.vendor_id = PCI_VIA_VENDOR_ID; | 31 | viainfo.vendor_id = PCI_VIA_VENDOR_ID; |
| 30 | 32 | ||
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index b036677df8c4..24efd8ea41bb 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
| @@ -213,11 +213,11 @@ config OMAP_WATCHDOG | |||
| 213 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. | 213 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. |
| 214 | 214 | ||
| 215 | config PNX4008_WATCHDOG | 215 | config PNX4008_WATCHDOG |
| 216 | tristate "PNX4008 Watchdog" | 216 | tristate "PNX4008 and LPC32XX Watchdog" |
| 217 | depends on ARCH_PNX4008 | 217 | depends on ARCH_PNX4008 || ARCH_LPC32XX |
| 218 | help | 218 | help |
| 219 | Say Y here if to include support for the watchdog timer | 219 | Say Y here if to include support for the watchdog timer |
| 220 | in the PNX4008 processor. | 220 | in the PNX4008 or LPC32XX processor. |
| 221 | This driver can be built as a module by choosing M. The module | 221 | This driver can be built as a module by choosing M. The module |
| 222 | will be called pnx4008_wdt. | 222 | will be called pnx4008_wdt. |
| 223 | 223 | ||
diff --git a/drivers/watchdog/sb_wdog.c b/drivers/watchdog/sb_wdog.c index 88c83aa57303..f31493e65b38 100644 --- a/drivers/watchdog/sb_wdog.c +++ b/drivers/watchdog/sb_wdog.c | |||
| @@ -305,7 +305,7 @@ static int __init sbwdog_init(void) | |||
| 305 | if (ret) { | 305 | if (ret) { |
| 306 | printk(KERN_ERR "%s: failed to request irq 1 - %d\n", | 306 | printk(KERN_ERR "%s: failed to request irq 1 - %d\n", |
| 307 | ident.identity, ret); | 307 | ident.identity, ret); |
| 308 | return ret; | 308 | goto out; |
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | ret = misc_register(&sbwdog_miscdev); | 311 | ret = misc_register(&sbwdog_miscdev); |
| @@ -313,14 +313,20 @@ static int __init sbwdog_init(void) | |||
| 313 | printk(KERN_INFO "%s: timeout is %ld.%ld secs\n", | 313 | printk(KERN_INFO "%s: timeout is %ld.%ld secs\n", |
| 314 | ident.identity, | 314 | ident.identity, |
| 315 | timeout / 1000000, (timeout / 100000) % 10); | 315 | timeout / 1000000, (timeout / 100000) % 10); |
| 316 | } else | 316 | return 0; |
| 317 | free_irq(1, (void *)user_dog); | 317 | } |
| 318 | free_irq(1, (void *)user_dog); | ||
| 319 | out: | ||
| 320 | unregister_reboot_notifier(&sbwdog_notifier); | ||
| 321 | |||
| 318 | return ret; | 322 | return ret; |
| 319 | } | 323 | } |
| 320 | 324 | ||
| 321 | static void __exit sbwdog_exit(void) | 325 | static void __exit sbwdog_exit(void) |
| 322 | { | 326 | { |
| 323 | misc_deregister(&sbwdog_miscdev); | 327 | misc_deregister(&sbwdog_miscdev); |
| 328 | free_irq(1, (void *)user_dog); | ||
| 329 | unregister_reboot_notifier(&sbwdog_notifier); | ||
| 324 | } | 330 | } |
| 325 | 331 | ||
| 326 | module_init(sbwdog_init); | 332 | module_init(sbwdog_init); |
diff --git a/drivers/watchdog/ts72xx_wdt.c b/drivers/watchdog/ts72xx_wdt.c index 458c499c1223..18cdeb4c4258 100644 --- a/drivers/watchdog/ts72xx_wdt.c +++ b/drivers/watchdog/ts72xx_wdt.c | |||
| @@ -449,6 +449,9 @@ static __devinit int ts72xx_wdt_probe(struct platform_device *pdev) | |||
| 449 | wdt->pdev = pdev; | 449 | wdt->pdev = pdev; |
| 450 | mutex_init(&wdt->lock); | 450 | mutex_init(&wdt->lock); |
| 451 | 451 | ||
| 452 | /* make sure that the watchdog is disabled */ | ||
| 453 | ts72xx_wdt_stop(wdt); | ||
| 454 | |||
| 452 | error = misc_register(&ts72xx_wdt_miscdev); | 455 | error = misc_register(&ts72xx_wdt_miscdev); |
| 453 | if (error) { | 456 | if (error) { |
| 454 | dev_err(&pdev->dev, "failed to register miscdev\n"); | 457 | dev_err(&pdev->dev, "failed to register miscdev\n"); |
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 29bac5118877..d409495876f1 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c | |||
| @@ -755,7 +755,10 @@ int register_xenstore_notifier(struct notifier_block *nb) | |||
| 755 | { | 755 | { |
| 756 | int ret = 0; | 756 | int ret = 0; |
| 757 | 757 | ||
| 758 | blocking_notifier_chain_register(&xenstore_chain, nb); | 758 | if (xenstored_ready > 0) |
| 759 | ret = nb->notifier_call(nb, 0, NULL); | ||
| 760 | else | ||
| 761 | blocking_notifier_chain_register(&xenstore_chain, nb); | ||
| 759 | 762 | ||
| 760 | return ret; | 763 | return ret; |
| 761 | } | 764 | } |
| @@ -769,7 +772,7 @@ EXPORT_SYMBOL_GPL(unregister_xenstore_notifier); | |||
| 769 | 772 | ||
| 770 | void xenbus_probe(struct work_struct *unused) | 773 | void xenbus_probe(struct work_struct *unused) |
| 771 | { | 774 | { |
| 772 | BUG_ON((xenstored_ready <= 0)); | 775 | xenstored_ready = 1; |
| 773 | 776 | ||
| 774 | /* Enumerate devices in xenstore and watch for changes. */ | 777 | /* Enumerate devices in xenstore and watch for changes. */ |
| 775 | xenbus_probe_devices(&xenbus_frontend); | 778 | xenbus_probe_devices(&xenbus_frontend); |
| @@ -835,8 +838,8 @@ static int __init xenbus_init(void) | |||
| 835 | xen_store_evtchn = xen_start_info->store_evtchn; | 838 | xen_store_evtchn = xen_start_info->store_evtchn; |
| 836 | xen_store_mfn = xen_start_info->store_mfn; | 839 | xen_store_mfn = xen_start_info->store_mfn; |
| 837 | xen_store_interface = mfn_to_virt(xen_store_mfn); | 840 | xen_store_interface = mfn_to_virt(xen_store_mfn); |
| 841 | xenstored_ready = 1; | ||
| 838 | } | 842 | } |
| 839 | xenstored_ready = 1; | ||
| 840 | } | 843 | } |
| 841 | 844 | ||
| 842 | /* Initialize the interface to xenstore. */ | 845 | /* Initialize the interface to xenstore. */ |
| @@ -712,8 +712,16 @@ static ssize_t aio_run_iocb(struct kiocb *iocb) | |||
| 712 | */ | 712 | */ |
| 713 | ret = retry(iocb); | 713 | ret = retry(iocb); |
| 714 | 714 | ||
| 715 | if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) | 715 | if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) { |
| 716 | /* | ||
| 717 | * There's no easy way to restart the syscall since other AIO's | ||
| 718 | * may be already running. Just fail this IO with EINTR. | ||
| 719 | */ | ||
| 720 | if (unlikely(ret == -ERESTARTSYS || ret == -ERESTARTNOINTR || | ||
| 721 | ret == -ERESTARTNOHAND || ret == -ERESTART_RESTARTBLOCK)) | ||
| 722 | ret = -EINTR; | ||
| 716 | aio_complete(iocb, ret, 0); | 723 | aio_complete(iocb, ret, 0); |
| 724 | } | ||
| 717 | out: | 725 | out: |
| 718 | spin_lock_irq(&ctx->ctx_lock); | 726 | spin_lock_irq(&ctx->ctx_lock); |
| 719 | 727 | ||
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c index f96eff04e11a..a6395bdb26ae 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c | |||
| @@ -134,10 +134,6 @@ static int aout_core_dump(struct coredump_params *cprm) | |||
| 134 | if (!dump_write(file, dump_start, dump_size)) | 134 | if (!dump_write(file, dump_start, dump_size)) |
| 135 | goto end_coredump; | 135 | goto end_coredump; |
| 136 | } | 136 | } |
| 137 | /* Finally dump the task struct. Not be used by gdb, but could be useful */ | ||
| 138 | set_fs(KERNEL_DS); | ||
| 139 | if (!dump_write(file, current, sizeof(*current))) | ||
| 140 | goto end_coredump; | ||
| 141 | end_coredump: | 137 | end_coredump: |
| 142 | set_fs(fs); | 138 | set_fs(fs); |
| 143 | return has_dumped; | 139 | return has_dumped; |
diff --git a/fs/ceph/Kconfig b/fs/ceph/Kconfig index bc87b9c1d27e..0fcd2640c23f 100644 --- a/fs/ceph/Kconfig +++ b/fs/ceph/Kconfig | |||
| @@ -3,6 +3,7 @@ config CEPH_FS | |||
| 3 | depends on INET && EXPERIMENTAL | 3 | depends on INET && EXPERIMENTAL |
| 4 | select LIBCRC32C | 4 | select LIBCRC32C |
| 5 | select CRYPTO_AES | 5 | select CRYPTO_AES |
| 6 | select CRYPTO | ||
| 6 | help | 7 | help |
| 7 | Choose Y or M here to include support for mounting the | 8 | Choose Y or M here to include support for mounting the |
| 8 | experimental Ceph distributed file system. Ceph is an extremely | 9 | experimental Ceph distributed file system. Ceph is an extremely |
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 4cfce1ee31fa..efbc604001c8 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
| @@ -411,8 +411,8 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc) | |||
| 411 | if (i_size < page_off + len) | 411 | if (i_size < page_off + len) |
| 412 | len = i_size - page_off; | 412 | len = i_size - page_off; |
| 413 | 413 | ||
| 414 | dout("writepage %p page %p index %lu on %llu~%u\n", | 414 | dout("writepage %p page %p index %lu on %llu~%u snapc %p\n", |
| 415 | inode, page, page->index, page_off, len); | 415 | inode, page, page->index, page_off, len, snapc); |
| 416 | 416 | ||
| 417 | writeback_stat = atomic_long_inc_return(&client->writeback_count); | 417 | writeback_stat = atomic_long_inc_return(&client->writeback_count); |
| 418 | if (writeback_stat > | 418 | if (writeback_stat > |
| @@ -766,7 +766,8 @@ get_more_pages: | |||
| 766 | /* ok */ | 766 | /* ok */ |
| 767 | if (locked_pages == 0) { | 767 | if (locked_pages == 0) { |
| 768 | /* prepare async write request */ | 768 | /* prepare async write request */ |
| 769 | offset = page->index << PAGE_CACHE_SHIFT; | 769 | offset = (unsigned long long)page->index |
| 770 | << PAGE_CACHE_SHIFT; | ||
| 770 | len = wsize; | 771 | len = wsize; |
| 771 | req = ceph_osdc_new_request(&client->osdc, | 772 | req = ceph_osdc_new_request(&client->osdc, |
| 772 | &ci->i_layout, | 773 | &ci->i_layout, |
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index a2069b6680ae..5e9da996a151 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
| @@ -814,7 +814,7 @@ int __ceph_caps_used(struct ceph_inode_info *ci) | |||
| 814 | used |= CEPH_CAP_PIN; | 814 | used |= CEPH_CAP_PIN; |
| 815 | if (ci->i_rd_ref) | 815 | if (ci->i_rd_ref) |
| 816 | used |= CEPH_CAP_FILE_RD; | 816 | used |= CEPH_CAP_FILE_RD; |
| 817 | if (ci->i_rdcache_ref || ci->i_rdcache_gen) | 817 | if (ci->i_rdcache_ref || ci->vfs_inode.i_data.nrpages) |
| 818 | used |= CEPH_CAP_FILE_CACHE; | 818 | used |= CEPH_CAP_FILE_CACHE; |
| 819 | if (ci->i_wr_ref) | 819 | if (ci->i_wr_ref) |
| 820 | used |= CEPH_CAP_FILE_WR; | 820 | used |= CEPH_CAP_FILE_WR; |
| @@ -1195,10 +1195,14 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, | |||
| 1195 | * asynchronously back to the MDS once sync writes complete and dirty | 1195 | * asynchronously back to the MDS once sync writes complete and dirty |
| 1196 | * data is written out. | 1196 | * data is written out. |
| 1197 | * | 1197 | * |
| 1198 | * Unless @again is true, skip cap_snaps that were already sent to | ||
| 1199 | * the MDS (i.e., during this session). | ||
| 1200 | * | ||
| 1198 | * Called under i_lock. Takes s_mutex as needed. | 1201 | * Called under i_lock. Takes s_mutex as needed. |
| 1199 | */ | 1202 | */ |
| 1200 | void __ceph_flush_snaps(struct ceph_inode_info *ci, | 1203 | void __ceph_flush_snaps(struct ceph_inode_info *ci, |
| 1201 | struct ceph_mds_session **psession) | 1204 | struct ceph_mds_session **psession, |
| 1205 | int again) | ||
| 1202 | __releases(ci->vfs_inode->i_lock) | 1206 | __releases(ci->vfs_inode->i_lock) |
| 1203 | __acquires(ci->vfs_inode->i_lock) | 1207 | __acquires(ci->vfs_inode->i_lock) |
| 1204 | { | 1208 | { |
| @@ -1227,7 +1231,7 @@ retry: | |||
| 1227 | * pages to be written out. | 1231 | * pages to be written out. |
| 1228 | */ | 1232 | */ |
| 1229 | if (capsnap->dirty_pages || capsnap->writing) | 1233 | if (capsnap->dirty_pages || capsnap->writing) |
| 1230 | continue; | 1234 | break; |
| 1231 | 1235 | ||
| 1232 | /* | 1236 | /* |
| 1233 | * if cap writeback already occurred, we should have dropped | 1237 | * if cap writeback already occurred, we should have dropped |
| @@ -1240,6 +1244,13 @@ retry: | |||
| 1240 | dout("no auth cap (migrating?), doing nothing\n"); | 1244 | dout("no auth cap (migrating?), doing nothing\n"); |
| 1241 | goto out; | 1245 | goto out; |
| 1242 | } | 1246 | } |
| 1247 | |||
| 1248 | /* only flush each capsnap once */ | ||
| 1249 | if (!again && !list_empty(&capsnap->flushing_item)) { | ||
| 1250 | dout("already flushed %p, skipping\n", capsnap); | ||
| 1251 | continue; | ||
| 1252 | } | ||
| 1253 | |||
| 1243 | mds = ci->i_auth_cap->session->s_mds; | 1254 | mds = ci->i_auth_cap->session->s_mds; |
| 1244 | mseq = ci->i_auth_cap->mseq; | 1255 | mseq = ci->i_auth_cap->mseq; |
| 1245 | 1256 | ||
| @@ -1276,8 +1287,8 @@ retry: | |||
| 1276 | &session->s_cap_snaps_flushing); | 1287 | &session->s_cap_snaps_flushing); |
| 1277 | spin_unlock(&inode->i_lock); | 1288 | spin_unlock(&inode->i_lock); |
| 1278 | 1289 | ||
| 1279 | dout("flush_snaps %p cap_snap %p follows %lld size %llu\n", | 1290 | dout("flush_snaps %p cap_snap %p follows %lld tid %llu\n", |
| 1280 | inode, capsnap, next_follows, capsnap->size); | 1291 | inode, capsnap, capsnap->follows, capsnap->flush_tid); |
| 1281 | send_cap_msg(session, ceph_vino(inode).ino, 0, | 1292 | send_cap_msg(session, ceph_vino(inode).ino, 0, |
| 1282 | CEPH_CAP_OP_FLUSHSNAP, capsnap->issued, 0, | 1293 | CEPH_CAP_OP_FLUSHSNAP, capsnap->issued, 0, |
| 1283 | capsnap->dirty, 0, capsnap->flush_tid, 0, mseq, | 1294 | capsnap->dirty, 0, capsnap->flush_tid, 0, mseq, |
| @@ -1314,7 +1325,7 @@ static void ceph_flush_snaps(struct ceph_inode_info *ci) | |||
| 1314 | struct inode *inode = &ci->vfs_inode; | 1325 | struct inode *inode = &ci->vfs_inode; |
| 1315 | 1326 | ||
| 1316 | spin_lock(&inode->i_lock); | 1327 | spin_lock(&inode->i_lock); |
| 1317 | __ceph_flush_snaps(ci, NULL); | 1328 | __ceph_flush_snaps(ci, NULL, 0); |
| 1318 | spin_unlock(&inode->i_lock); | 1329 | spin_unlock(&inode->i_lock); |
| 1319 | } | 1330 | } |
| 1320 | 1331 | ||
| @@ -1477,7 +1488,7 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags, | |||
| 1477 | 1488 | ||
| 1478 | /* flush snaps first time around only */ | 1489 | /* flush snaps first time around only */ |
| 1479 | if (!list_empty(&ci->i_cap_snaps)) | 1490 | if (!list_empty(&ci->i_cap_snaps)) |
| 1480 | __ceph_flush_snaps(ci, &session); | 1491 | __ceph_flush_snaps(ci, &session, 0); |
| 1481 | goto retry_locked; | 1492 | goto retry_locked; |
| 1482 | retry: | 1493 | retry: |
| 1483 | spin_lock(&inode->i_lock); | 1494 | spin_lock(&inode->i_lock); |
| @@ -1894,7 +1905,7 @@ static void kick_flushing_capsnaps(struct ceph_mds_client *mdsc, | |||
| 1894 | if (cap && cap->session == session) { | 1905 | if (cap && cap->session == session) { |
| 1895 | dout("kick_flushing_caps %p cap %p capsnap %p\n", inode, | 1906 | dout("kick_flushing_caps %p cap %p capsnap %p\n", inode, |
| 1896 | cap, capsnap); | 1907 | cap, capsnap); |
| 1897 | __ceph_flush_snaps(ci, &session); | 1908 | __ceph_flush_snaps(ci, &session, 1); |
| 1898 | } else { | 1909 | } else { |
| 1899 | pr_err("%p auth cap %p not mds%d ???\n", inode, | 1910 | pr_err("%p auth cap %p not mds%d ???\n", inode, |
| 1900 | cap, session->s_mds); | 1911 | cap, session->s_mds); |
| @@ -2272,7 +2283,8 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
| 2272 | { | 2283 | { |
| 2273 | struct ceph_inode_info *ci = ceph_inode(inode); | 2284 | struct ceph_inode_info *ci = ceph_inode(inode); |
| 2274 | int mds = session->s_mds; | 2285 | int mds = session->s_mds; |
| 2275 | int seq = le32_to_cpu(grant->seq); | 2286 | unsigned seq = le32_to_cpu(grant->seq); |
| 2287 | unsigned issue_seq = le32_to_cpu(grant->issue_seq); | ||
| 2276 | int newcaps = le32_to_cpu(grant->caps); | 2288 | int newcaps = le32_to_cpu(grant->caps); |
| 2277 | int issued, implemented, used, wanted, dirty; | 2289 | int issued, implemented, used, wanted, dirty; |
| 2278 | u64 size = le64_to_cpu(grant->size); | 2290 | u64 size = le64_to_cpu(grant->size); |
| @@ -2284,8 +2296,8 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
| 2284 | int revoked_rdcache = 0; | 2296 | int revoked_rdcache = 0; |
| 2285 | int queue_invalidate = 0; | 2297 | int queue_invalidate = 0; |
| 2286 | 2298 | ||
| 2287 | dout("handle_cap_grant inode %p cap %p mds%d seq %d %s\n", | 2299 | dout("handle_cap_grant inode %p cap %p mds%d seq %u/%u %s\n", |
| 2288 | inode, cap, mds, seq, ceph_cap_string(newcaps)); | 2300 | inode, cap, mds, seq, issue_seq, ceph_cap_string(newcaps)); |
| 2289 | dout(" size %llu max_size %llu, i_size %llu\n", size, max_size, | 2301 | dout(" size %llu max_size %llu, i_size %llu\n", size, max_size, |
| 2290 | inode->i_size); | 2302 | inode->i_size); |
| 2291 | 2303 | ||
| @@ -2381,6 +2393,7 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
| 2381 | } | 2393 | } |
| 2382 | 2394 | ||
| 2383 | cap->seq = seq; | 2395 | cap->seq = seq; |
| 2396 | cap->issue_seq = issue_seq; | ||
| 2384 | 2397 | ||
| 2385 | /* file layout may have changed */ | 2398 | /* file layout may have changed */ |
| 2386 | ci->i_layout = grant->layout; | 2399 | ci->i_layout = grant->layout; |
| @@ -2763,15 +2776,7 @@ void ceph_handle_caps(struct ceph_mds_session *session, | |||
| 2763 | if (op == CEPH_CAP_OP_IMPORT) | 2776 | if (op == CEPH_CAP_OP_IMPORT) |
| 2764 | __queue_cap_release(session, vino.ino, cap_id, | 2777 | __queue_cap_release(session, vino.ino, cap_id, |
| 2765 | mseq, seq); | 2778 | mseq, seq); |
| 2766 | 2779 | goto flush_cap_releases; | |
| 2767 | /* | ||
| 2768 | * send any full release message to try to move things | ||
| 2769 | * along for the mds (who clearly thinks we still have this | ||
| 2770 | * cap). | ||
| 2771 | */ | ||
| 2772 | ceph_add_cap_releases(mdsc, session); | ||
| 2773 | ceph_send_cap_releases(mdsc, session); | ||
| 2774 | goto done; | ||
| 2775 | } | 2780 | } |
| 2776 | 2781 | ||
| 2777 | /* these will work even if we don't have a cap yet */ | 2782 | /* these will work even if we don't have a cap yet */ |
| @@ -2799,7 +2804,7 @@ void ceph_handle_caps(struct ceph_mds_session *session, | |||
| 2799 | dout(" no cap on %p ino %llx.%llx from mds%d\n", | 2804 | dout(" no cap on %p ino %llx.%llx from mds%d\n", |
| 2800 | inode, ceph_ino(inode), ceph_snap(inode), mds); | 2805 | inode, ceph_ino(inode), ceph_snap(inode), mds); |
| 2801 | spin_unlock(&inode->i_lock); | 2806 | spin_unlock(&inode->i_lock); |
| 2802 | goto done; | 2807 | goto flush_cap_releases; |
| 2803 | } | 2808 | } |
| 2804 | 2809 | ||
| 2805 | /* note that each of these drops i_lock for us */ | 2810 | /* note that each of these drops i_lock for us */ |
| @@ -2823,6 +2828,17 @@ void ceph_handle_caps(struct ceph_mds_session *session, | |||
| 2823 | ceph_cap_op_name(op)); | 2828 | ceph_cap_op_name(op)); |
| 2824 | } | 2829 | } |
| 2825 | 2830 | ||
| 2831 | goto done; | ||
| 2832 | |||
| 2833 | flush_cap_releases: | ||
| 2834 | /* | ||
| 2835 | * send any full release message to try to move things | ||
| 2836 | * along for the mds (who clearly thinks we still have this | ||
| 2837 | * cap). | ||
| 2838 | */ | ||
| 2839 | ceph_add_cap_releases(mdsc, session); | ||
| 2840 | ceph_send_cap_releases(mdsc, session); | ||
| 2841 | |||
| 2826 | done: | 2842 | done: |
| 2827 | mutex_unlock(&session->s_mutex); | 2843 | mutex_unlock(&session->s_mutex); |
| 2828 | done_unlocked: | 2844 | done_unlocked: |
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 6e4f43ff23ec..a1986eb52045 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
| @@ -1021,11 +1021,15 @@ out_touch: | |||
| 1021 | static void ceph_dentry_release(struct dentry *dentry) | 1021 | static void ceph_dentry_release(struct dentry *dentry) |
| 1022 | { | 1022 | { |
| 1023 | struct ceph_dentry_info *di = ceph_dentry(dentry); | 1023 | struct ceph_dentry_info *di = ceph_dentry(dentry); |
| 1024 | struct inode *parent_inode = dentry->d_parent->d_inode; | 1024 | struct inode *parent_inode = NULL; |
| 1025 | u64 snapid = ceph_snap(parent_inode); | 1025 | u64 snapid = CEPH_NOSNAP; |
| 1026 | 1026 | ||
| 1027 | if (!IS_ROOT(dentry)) { | ||
| 1028 | parent_inode = dentry->d_parent->d_inode; | ||
| 1029 | if (parent_inode) | ||
| 1030 | snapid = ceph_snap(parent_inode); | ||
| 1031 | } | ||
| 1027 | dout("dentry_release %p parent %p\n", dentry, parent_inode); | 1032 | dout("dentry_release %p parent %p\n", dentry, parent_inode); |
| 1028 | |||
| 1029 | if (parent_inode && snapid != CEPH_SNAPDIR) { | 1033 | if (parent_inode && snapid != CEPH_SNAPDIR) { |
| 1030 | struct ceph_inode_info *ci = ceph_inode(parent_inode); | 1034 | struct ceph_inode_info *ci = ceph_inode(parent_inode); |
| 1031 | 1035 | ||
diff --git a/fs/ceph/export.c b/fs/ceph/export.c index 4480cb1c63e7..e38423e82f2e 100644 --- a/fs/ceph/export.c +++ b/fs/ceph/export.c | |||
| @@ -42,32 +42,37 @@ struct ceph_nfs_confh { | |||
| 42 | static int ceph_encode_fh(struct dentry *dentry, u32 *rawfh, int *max_len, | 42 | static int ceph_encode_fh(struct dentry *dentry, u32 *rawfh, int *max_len, |
| 43 | int connectable) | 43 | int connectable) |
| 44 | { | 44 | { |
| 45 | int type; | ||
| 45 | struct ceph_nfs_fh *fh = (void *)rawfh; | 46 | struct ceph_nfs_fh *fh = (void *)rawfh; |
| 46 | struct ceph_nfs_confh *cfh = (void *)rawfh; | 47 | struct ceph_nfs_confh *cfh = (void *)rawfh; |
| 47 | struct dentry *parent = dentry->d_parent; | 48 | struct dentry *parent = dentry->d_parent; |
| 48 | struct inode *inode = dentry->d_inode; | 49 | struct inode *inode = dentry->d_inode; |
| 49 | int type; | 50 | int connected_handle_length = sizeof(*cfh)/4; |
| 51 | int handle_length = sizeof(*fh)/4; | ||
| 50 | 52 | ||
| 51 | /* don't re-export snaps */ | 53 | /* don't re-export snaps */ |
| 52 | if (ceph_snap(inode) != CEPH_NOSNAP) | 54 | if (ceph_snap(inode) != CEPH_NOSNAP) |
| 53 | return -EINVAL; | 55 | return -EINVAL; |
| 54 | 56 | ||
| 55 | if (*max_len >= sizeof(*cfh)) { | 57 | if (*max_len >= connected_handle_length) { |
| 56 | dout("encode_fh %p connectable\n", dentry); | 58 | dout("encode_fh %p connectable\n", dentry); |
| 57 | cfh->ino = ceph_ino(dentry->d_inode); | 59 | cfh->ino = ceph_ino(dentry->d_inode); |
| 58 | cfh->parent_ino = ceph_ino(parent->d_inode); | 60 | cfh->parent_ino = ceph_ino(parent->d_inode); |
| 59 | cfh->parent_name_hash = parent->d_name.hash; | 61 | cfh->parent_name_hash = parent->d_name.hash; |
| 60 | *max_len = sizeof(*cfh); | 62 | *max_len = connected_handle_length; |
| 61 | type = 2; | 63 | type = 2; |
| 62 | } else if (*max_len > sizeof(*fh)) { | 64 | } else if (*max_len >= handle_length) { |
| 63 | if (connectable) | 65 | if (connectable) { |
| 64 | return -ENOSPC; | 66 | *max_len = connected_handle_length; |
| 67 | return 255; | ||
| 68 | } | ||
| 65 | dout("encode_fh %p\n", dentry); | 69 | dout("encode_fh %p\n", dentry); |
| 66 | fh->ino = ceph_ino(dentry->d_inode); | 70 | fh->ino = ceph_ino(dentry->d_inode); |
| 67 | *max_len = sizeof(*fh); | 71 | *max_len = handle_length; |
| 68 | type = 1; | 72 | type = 1; |
| 69 | } else { | 73 | } else { |
| 70 | return -ENOSPC; | 74 | *max_len = handle_length; |
| 75 | return 255; | ||
| 71 | } | 76 | } |
| 72 | return type; | 77 | return type; |
| 73 | } | 78 | } |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 8c044a4f0457..66e4da6dba22 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
| @@ -697,7 +697,7 @@ more: | |||
| 697 | * start_request so that a tid has been assigned. | 697 | * start_request so that a tid has been assigned. |
| 698 | */ | 698 | */ |
| 699 | spin_lock(&ci->i_unsafe_lock); | 699 | spin_lock(&ci->i_unsafe_lock); |
| 700 | list_add(&ci->i_unsafe_writes, &req->r_unsafe_item); | 700 | list_add(&req->r_unsafe_item, &ci->i_unsafe_writes); |
| 701 | spin_unlock(&ci->i_unsafe_lock); | 701 | spin_unlock(&ci->i_unsafe_lock); |
| 702 | ceph_get_cap_refs(ci, CEPH_CAP_FILE_WR); | 702 | ceph_get_cap_refs(ci, CEPH_CAP_FILE_WR); |
| 703 | } | 703 | } |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index e7cca414da03..62377ec37edf 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
| @@ -845,7 +845,7 @@ static void ceph_set_dentry_offset(struct dentry *dn) | |||
| 845 | * the caller) if we fail. | 845 | * the caller) if we fail. |
| 846 | */ | 846 | */ |
| 847 | static struct dentry *splice_dentry(struct dentry *dn, struct inode *in, | 847 | static struct dentry *splice_dentry(struct dentry *dn, struct inode *in, |
| 848 | bool *prehash) | 848 | bool *prehash, bool set_offset) |
| 849 | { | 849 | { |
| 850 | struct dentry *realdn; | 850 | struct dentry *realdn; |
| 851 | 851 | ||
| @@ -877,7 +877,8 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in, | |||
| 877 | } | 877 | } |
| 878 | if ((!prehash || *prehash) && d_unhashed(dn)) | 878 | if ((!prehash || *prehash) && d_unhashed(dn)) |
| 879 | d_rehash(dn); | 879 | d_rehash(dn); |
| 880 | ceph_set_dentry_offset(dn); | 880 | if (set_offset) |
| 881 | ceph_set_dentry_offset(dn); | ||
| 881 | out: | 882 | out: |
| 882 | return dn; | 883 | return dn; |
| 883 | } | 884 | } |
| @@ -1062,7 +1063,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req, | |||
| 1062 | d_delete(dn); | 1063 | d_delete(dn); |
| 1063 | goto done; | 1064 | goto done; |
| 1064 | } | 1065 | } |
| 1065 | dn = splice_dentry(dn, in, &have_lease); | 1066 | dn = splice_dentry(dn, in, &have_lease, true); |
| 1066 | if (IS_ERR(dn)) { | 1067 | if (IS_ERR(dn)) { |
| 1067 | err = PTR_ERR(dn); | 1068 | err = PTR_ERR(dn); |
| 1068 | goto done; | 1069 | goto done; |
| @@ -1105,7 +1106,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req, | |||
| 1105 | goto done; | 1106 | goto done; |
| 1106 | } | 1107 | } |
| 1107 | dout(" linking snapped dir %p to dn %p\n", in, dn); | 1108 | dout(" linking snapped dir %p to dn %p\n", in, dn); |
| 1108 | dn = splice_dentry(dn, in, NULL); | 1109 | dn = splice_dentry(dn, in, NULL, true); |
| 1109 | if (IS_ERR(dn)) { | 1110 | if (IS_ERR(dn)) { |
| 1110 | err = PTR_ERR(dn); | 1111 | err = PTR_ERR(dn); |
| 1111 | goto done; | 1112 | goto done; |
| @@ -1237,7 +1238,7 @@ retry_lookup: | |||
| 1237 | err = PTR_ERR(in); | 1238 | err = PTR_ERR(in); |
| 1238 | goto out; | 1239 | goto out; |
| 1239 | } | 1240 | } |
| 1240 | dn = splice_dentry(dn, in, NULL); | 1241 | dn = splice_dentry(dn, in, NULL, false); |
| 1241 | if (IS_ERR(dn)) | 1242 | if (IS_ERR(dn)) |
| 1242 | dn = NULL; | 1243 | dn = NULL; |
| 1243 | } | 1244 | } |
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index f091b1351786..fad95f8f2608 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
| @@ -2374,6 +2374,8 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, | |||
| 2374 | num_fcntl_locks, | 2374 | num_fcntl_locks, |
| 2375 | num_flock_locks); | 2375 | num_flock_locks); |
| 2376 | unlock_kernel(); | 2376 | unlock_kernel(); |
| 2377 | } else { | ||
| 2378 | err = ceph_pagelist_append(pagelist, &rec, reclen); | ||
| 2377 | } | 2379 | } |
| 2378 | 2380 | ||
| 2379 | out_free: | 2381 | out_free: |
diff --git a/fs/ceph/osd_client.c b/fs/ceph/osd_client.c index dfced1dacbcd..3b5571b8ce22 100644 --- a/fs/ceph/osd_client.c +++ b/fs/ceph/osd_client.c | |||
| @@ -549,7 +549,7 @@ static void __unregister_request(struct ceph_osd_client *osdc, | |||
| 549 | */ | 549 | */ |
| 550 | static void __cancel_request(struct ceph_osd_request *req) | 550 | static void __cancel_request(struct ceph_osd_request *req) |
| 551 | { | 551 | { |
| 552 | if (req->r_sent) { | 552 | if (req->r_sent && req->r_osd) { |
| 553 | ceph_con_revoke(&req->r_osd->o_con, req->r_request); | 553 | ceph_con_revoke(&req->r_osd->o_con, req->r_request); |
| 554 | req->r_sent = 0; | 554 | req->r_sent = 0; |
| 555 | } | 555 | } |
diff --git a/fs/ceph/pagelist.c b/fs/ceph/pagelist.c index b6859f47d364..46a368b6dce5 100644 --- a/fs/ceph/pagelist.c +++ b/fs/ceph/pagelist.c | |||
| @@ -5,10 +5,18 @@ | |||
| 5 | 5 | ||
| 6 | #include "pagelist.h" | 6 | #include "pagelist.h" |
| 7 | 7 | ||
| 8 | static void ceph_pagelist_unmap_tail(struct ceph_pagelist *pl) | ||
| 9 | { | ||
| 10 | struct page *page = list_entry(pl->head.prev, struct page, | ||
| 11 | lru); | ||
| 12 | kunmap(page); | ||
| 13 | } | ||
| 14 | |||
| 8 | int ceph_pagelist_release(struct ceph_pagelist *pl) | 15 | int ceph_pagelist_release(struct ceph_pagelist *pl) |
| 9 | { | 16 | { |
| 10 | if (pl->mapped_tail) | 17 | if (pl->mapped_tail) |
| 11 | kunmap(pl->mapped_tail); | 18 | ceph_pagelist_unmap_tail(pl); |
| 19 | |||
| 12 | while (!list_empty(&pl->head)) { | 20 | while (!list_empty(&pl->head)) { |
| 13 | struct page *page = list_first_entry(&pl->head, struct page, | 21 | struct page *page = list_first_entry(&pl->head, struct page, |
| 14 | lru); | 22 | lru); |
| @@ -26,7 +34,7 @@ static int ceph_pagelist_addpage(struct ceph_pagelist *pl) | |||
| 26 | pl->room += PAGE_SIZE; | 34 | pl->room += PAGE_SIZE; |
| 27 | list_add_tail(&page->lru, &pl->head); | 35 | list_add_tail(&page->lru, &pl->head); |
| 28 | if (pl->mapped_tail) | 36 | if (pl->mapped_tail) |
| 29 | kunmap(pl->mapped_tail); | 37 | ceph_pagelist_unmap_tail(pl); |
| 30 | pl->mapped_tail = kmap(page); | 38 | pl->mapped_tail = kmap(page); |
| 31 | return 0; | 39 | return 0; |
| 32 | } | 40 | } |
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index 4868b9dcac5a..190b6c4a6f2b 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c | |||
| @@ -119,6 +119,7 @@ static struct ceph_snap_realm *ceph_create_snap_realm( | |||
| 119 | INIT_LIST_HEAD(&realm->children); | 119 | INIT_LIST_HEAD(&realm->children); |
| 120 | INIT_LIST_HEAD(&realm->child_item); | 120 | INIT_LIST_HEAD(&realm->child_item); |
| 121 | INIT_LIST_HEAD(&realm->empty_item); | 121 | INIT_LIST_HEAD(&realm->empty_item); |
| 122 | INIT_LIST_HEAD(&realm->dirty_item); | ||
| 122 | INIT_LIST_HEAD(&realm->inodes_with_caps); | 123 | INIT_LIST_HEAD(&realm->inodes_with_caps); |
| 123 | spin_lock_init(&realm->inodes_with_caps_lock); | 124 | spin_lock_init(&realm->inodes_with_caps_lock); |
| 124 | __insert_snap_realm(&mdsc->snap_realms, realm); | 125 | __insert_snap_realm(&mdsc->snap_realms, realm); |
| @@ -467,7 +468,7 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci) | |||
| 467 | INIT_LIST_HEAD(&capsnap->ci_item); | 468 | INIT_LIST_HEAD(&capsnap->ci_item); |
| 468 | INIT_LIST_HEAD(&capsnap->flushing_item); | 469 | INIT_LIST_HEAD(&capsnap->flushing_item); |
| 469 | 470 | ||
| 470 | capsnap->follows = snapc->seq - 1; | 471 | capsnap->follows = snapc->seq; |
| 471 | capsnap->issued = __ceph_caps_issued(ci, NULL); | 472 | capsnap->issued = __ceph_caps_issued(ci, NULL); |
| 472 | capsnap->dirty = dirty; | 473 | capsnap->dirty = dirty; |
| 473 | 474 | ||
| @@ -604,6 +605,7 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc, | |||
| 604 | struct ceph_snap_realm *realm; | 605 | struct ceph_snap_realm *realm; |
| 605 | int invalidate = 0; | 606 | int invalidate = 0; |
| 606 | int err = -ENOMEM; | 607 | int err = -ENOMEM; |
| 608 | LIST_HEAD(dirty_realms); | ||
| 607 | 609 | ||
| 608 | dout("update_snap_trace deletion=%d\n", deletion); | 610 | dout("update_snap_trace deletion=%d\n", deletion); |
| 609 | more: | 611 | more: |
| @@ -626,24 +628,6 @@ more: | |||
| 626 | } | 628 | } |
| 627 | } | 629 | } |
| 628 | 630 | ||
| 629 | if (le64_to_cpu(ri->seq) > realm->seq) { | ||
| 630 | dout("update_snap_trace updating %llx %p %lld -> %lld\n", | ||
| 631 | realm->ino, realm, realm->seq, le64_to_cpu(ri->seq)); | ||
| 632 | /* | ||
| 633 | * if the realm seq has changed, queue a cap_snap for every | ||
| 634 | * inode with open caps. we do this _before_ we update | ||
| 635 | * the realm info so that we prepare for writeback under the | ||
| 636 | * _previous_ snap context. | ||
| 637 | * | ||
| 638 | * ...unless it's a snap deletion! | ||
| 639 | */ | ||
| 640 | if (!deletion) | ||
| 641 | queue_realm_cap_snaps(realm); | ||
| 642 | } else { | ||
| 643 | dout("update_snap_trace %llx %p seq %lld unchanged\n", | ||
| 644 | realm->ino, realm, realm->seq); | ||
| 645 | } | ||
| 646 | |||
| 647 | /* ensure the parent is correct */ | 631 | /* ensure the parent is correct */ |
| 648 | err = adjust_snap_realm_parent(mdsc, realm, le64_to_cpu(ri->parent)); | 632 | err = adjust_snap_realm_parent(mdsc, realm, le64_to_cpu(ri->parent)); |
| 649 | if (err < 0) | 633 | if (err < 0) |
| @@ -651,6 +635,8 @@ more: | |||
| 651 | invalidate += err; | 635 | invalidate += err; |
| 652 | 636 | ||
| 653 | if (le64_to_cpu(ri->seq) > realm->seq) { | 637 | if (le64_to_cpu(ri->seq) > realm->seq) { |
| 638 | dout("update_snap_trace updating %llx %p %lld -> %lld\n", | ||
| 639 | realm->ino, realm, realm->seq, le64_to_cpu(ri->seq)); | ||
| 654 | /* update realm parameters, snap lists */ | 640 | /* update realm parameters, snap lists */ |
| 655 | realm->seq = le64_to_cpu(ri->seq); | 641 | realm->seq = le64_to_cpu(ri->seq); |
| 656 | realm->created = le64_to_cpu(ri->created); | 642 | realm->created = le64_to_cpu(ri->created); |
| @@ -668,9 +654,17 @@ more: | |||
| 668 | if (err < 0) | 654 | if (err < 0) |
| 669 | goto fail; | 655 | goto fail; |
| 670 | 656 | ||
| 657 | /* queue realm for cap_snap creation */ | ||
| 658 | list_add(&realm->dirty_item, &dirty_realms); | ||
| 659 | |||
| 671 | invalidate = 1; | 660 | invalidate = 1; |
| 672 | } else if (!realm->cached_context) { | 661 | } else if (!realm->cached_context) { |
| 662 | dout("update_snap_trace %llx %p seq %lld new\n", | ||
| 663 | realm->ino, realm, realm->seq); | ||
| 673 | invalidate = 1; | 664 | invalidate = 1; |
| 665 | } else { | ||
| 666 | dout("update_snap_trace %llx %p seq %lld unchanged\n", | ||
| 667 | realm->ino, realm, realm->seq); | ||
| 674 | } | 668 | } |
| 675 | 669 | ||
| 676 | dout("done with %llx %p, invalidated=%d, %p %p\n", realm->ino, | 670 | dout("done with %llx %p, invalidated=%d, %p %p\n", realm->ino, |
| @@ -683,6 +677,14 @@ more: | |||
| 683 | if (invalidate) | 677 | if (invalidate) |
| 684 | rebuild_snap_realms(realm); | 678 | rebuild_snap_realms(realm); |
| 685 | 679 | ||
| 680 | /* | ||
| 681 | * queue cap snaps _after_ we've built the new snap contexts, | ||
| 682 | * so that i_head_snapc can be set appropriately. | ||
| 683 | */ | ||
| 684 | list_for_each_entry(realm, &dirty_realms, dirty_item) { | ||
| 685 | queue_realm_cap_snaps(realm); | ||
| 686 | } | ||
| 687 | |||
| 686 | __cleanup_empty_realms(mdsc); | 688 | __cleanup_empty_realms(mdsc); |
| 687 | return 0; | 689 | return 0; |
| 688 | 690 | ||
| @@ -715,7 +717,7 @@ static void flush_snaps(struct ceph_mds_client *mdsc) | |||
| 715 | igrab(inode); | 717 | igrab(inode); |
| 716 | spin_unlock(&mdsc->snap_flush_lock); | 718 | spin_unlock(&mdsc->snap_flush_lock); |
| 717 | spin_lock(&inode->i_lock); | 719 | spin_lock(&inode->i_lock); |
| 718 | __ceph_flush_snaps(ci, &session); | 720 | __ceph_flush_snaps(ci, &session, 0); |
| 719 | spin_unlock(&inode->i_lock); | 721 | spin_unlock(&inode->i_lock); |
| 720 | iput(inode); | 722 | iput(inode); |
| 721 | spin_lock(&mdsc->snap_flush_lock); | 723 | spin_lock(&mdsc->snap_flush_lock); |
| @@ -816,6 +818,7 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc, | |||
| 816 | }; | 818 | }; |
| 817 | struct inode *inode = ceph_find_inode(sb, vino); | 819 | struct inode *inode = ceph_find_inode(sb, vino); |
| 818 | struct ceph_inode_info *ci; | 820 | struct ceph_inode_info *ci; |
| 821 | struct ceph_snap_realm *oldrealm; | ||
| 819 | 822 | ||
| 820 | if (!inode) | 823 | if (!inode) |
| 821 | continue; | 824 | continue; |
| @@ -841,18 +844,19 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc, | |||
| 841 | dout(" will move %p to split realm %llx %p\n", | 844 | dout(" will move %p to split realm %llx %p\n", |
| 842 | inode, realm->ino, realm); | 845 | inode, realm->ino, realm); |
| 843 | /* | 846 | /* |
| 844 | * Remove the inode from the realm's inode | 847 | * Move the inode to the new realm |
| 845 | * list, but don't add it to the new realm | ||
| 846 | * yet. We don't want the cap_snap to be | ||
| 847 | * queued (again) by ceph_update_snap_trace() | ||
| 848 | * below. Queue it _now_, under the old context. | ||
| 849 | */ | 848 | */ |
| 850 | spin_lock(&realm->inodes_with_caps_lock); | 849 | spin_lock(&realm->inodes_with_caps_lock); |
| 851 | list_del_init(&ci->i_snap_realm_item); | 850 | list_del_init(&ci->i_snap_realm_item); |
| 851 | list_add(&ci->i_snap_realm_item, | ||
| 852 | &realm->inodes_with_caps); | ||
| 853 | oldrealm = ci->i_snap_realm; | ||
| 854 | ci->i_snap_realm = realm; | ||
| 852 | spin_unlock(&realm->inodes_with_caps_lock); | 855 | spin_unlock(&realm->inodes_with_caps_lock); |
| 853 | spin_unlock(&inode->i_lock); | 856 | spin_unlock(&inode->i_lock); |
| 854 | 857 | ||
| 855 | ceph_queue_cap_snap(ci); | 858 | ceph_get_snap_realm(mdsc, realm); |
| 859 | ceph_put_snap_realm(mdsc, oldrealm); | ||
| 856 | 860 | ||
| 857 | iput(inode); | 861 | iput(inode); |
| 858 | continue; | 862 | continue; |
| @@ -880,43 +884,9 @@ skip_inode: | |||
| 880 | ceph_update_snap_trace(mdsc, p, e, | 884 | ceph_update_snap_trace(mdsc, p, e, |
| 881 | op == CEPH_SNAP_OP_DESTROY); | 885 | op == CEPH_SNAP_OP_DESTROY); |
| 882 | 886 | ||
| 883 | if (op == CEPH_SNAP_OP_SPLIT) { | 887 | if (op == CEPH_SNAP_OP_SPLIT) |
| 884 | /* | ||
| 885 | * ok, _now_ add the inodes into the new realm. | ||
| 886 | */ | ||
| 887 | for (i = 0; i < num_split_inos; i++) { | ||
| 888 | struct ceph_vino vino = { | ||
| 889 | .ino = le64_to_cpu(split_inos[i]), | ||
| 890 | .snap = CEPH_NOSNAP, | ||
| 891 | }; | ||
| 892 | struct inode *inode = ceph_find_inode(sb, vino); | ||
| 893 | struct ceph_inode_info *ci; | ||
| 894 | |||
| 895 | if (!inode) | ||
| 896 | continue; | ||
| 897 | ci = ceph_inode(inode); | ||
| 898 | spin_lock(&inode->i_lock); | ||
| 899 | if (list_empty(&ci->i_snap_realm_item)) { | ||
| 900 | struct ceph_snap_realm *oldrealm = | ||
| 901 | ci->i_snap_realm; | ||
| 902 | |||
| 903 | dout(" moving %p to split realm %llx %p\n", | ||
| 904 | inode, realm->ino, realm); | ||
| 905 | spin_lock(&realm->inodes_with_caps_lock); | ||
| 906 | list_add(&ci->i_snap_realm_item, | ||
| 907 | &realm->inodes_with_caps); | ||
| 908 | ci->i_snap_realm = realm; | ||
| 909 | spin_unlock(&realm->inodes_with_caps_lock); | ||
| 910 | ceph_get_snap_realm(mdsc, realm); | ||
| 911 | ceph_put_snap_realm(mdsc, oldrealm); | ||
| 912 | } | ||
| 913 | spin_unlock(&inode->i_lock); | ||
| 914 | iput(inode); | ||
| 915 | } | ||
| 916 | |||
| 917 | /* we took a reference when we created the realm, above */ | 888 | /* we took a reference when we created the realm, above */ |
| 918 | ceph_put_snap_realm(mdsc, realm); | 889 | ceph_put_snap_realm(mdsc, realm); |
| 919 | } | ||
| 920 | 890 | ||
| 921 | __cleanup_empty_realms(mdsc); | 891 | __cleanup_empty_realms(mdsc); |
| 922 | 892 | ||
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index c33897ae5725..b87638e84c4b 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
| @@ -690,6 +690,8 @@ struct ceph_snap_realm { | |||
| 690 | 690 | ||
| 691 | struct list_head empty_item; /* if i have ref==0 */ | 691 | struct list_head empty_item; /* if i have ref==0 */ |
| 692 | 692 | ||
| 693 | struct list_head dirty_item; /* if realm needs new context */ | ||
| 694 | |||
| 693 | /* the current set of snaps for this realm */ | 695 | /* the current set of snaps for this realm */ |
| 694 | struct ceph_snap_context *cached_context; | 696 | struct ceph_snap_context *cached_context; |
| 695 | 697 | ||
| @@ -826,7 +828,8 @@ extern void ceph_put_cap_refs(struct ceph_inode_info *ci, int had); | |||
| 826 | extern void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr, | 828 | extern void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr, |
| 827 | struct ceph_snap_context *snapc); | 829 | struct ceph_snap_context *snapc); |
| 828 | extern void __ceph_flush_snaps(struct ceph_inode_info *ci, | 830 | extern void __ceph_flush_snaps(struct ceph_inode_info *ci, |
| 829 | struct ceph_mds_session **psession); | 831 | struct ceph_mds_session **psession, |
| 832 | int again); | ||
| 830 | extern void ceph_check_caps(struct ceph_inode_info *ci, int flags, | 833 | extern void ceph_check_caps(struct ceph_inode_info *ci, int flags, |
| 831 | struct ceph_mds_session *session); | 834 | struct ceph_mds_session *session); |
| 832 | extern void ceph_check_delayed_caps(struct ceph_mds_client *mdsc); | 835 | extern void ceph_check_delayed_caps(struct ceph_mds_client *mdsc); |
diff --git a/fs/char_dev.c b/fs/char_dev.c index f80a4f25123c..143d393881cb 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c | |||
| @@ -40,7 +40,9 @@ struct backing_dev_info directly_mappable_cdev_bdi = { | |||
| 40 | #endif | 40 | #endif |
| 41 | /* permit direct mmap, for read, write or exec */ | 41 | /* permit direct mmap, for read, write or exec */ |
| 42 | BDI_CAP_MAP_DIRECT | | 42 | BDI_CAP_MAP_DIRECT | |
| 43 | BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP), | 43 | BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP | |
| 44 | /* no writeback happens */ | ||
| 45 | BDI_CAP_NO_ACCT_AND_WRITEBACK), | ||
| 44 | }; | 46 | }; |
| 45 | 47 | ||
| 46 | static struct kobj_map *cdev_map; | 48 | static struct kobj_map *cdev_map; |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index c65c3419dd37..7e83b356cc9e 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
| @@ -232,7 +232,7 @@ static int | |||
| 232 | small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, | 232 | small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, |
| 233 | void **request_buf) | 233 | void **request_buf) |
| 234 | { | 234 | { |
| 235 | int rc = 0; | 235 | int rc; |
| 236 | 236 | ||
| 237 | rc = cifs_reconnect_tcon(tcon, smb_command); | 237 | rc = cifs_reconnect_tcon(tcon, smb_command); |
| 238 | if (rc) | 238 | if (rc) |
| @@ -250,7 +250,7 @@ small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, | |||
| 250 | if (tcon != NULL) | 250 | if (tcon != NULL) |
| 251 | cifs_stats_inc(&tcon->num_smbs_sent); | 251 | cifs_stats_inc(&tcon->num_smbs_sent); |
| 252 | 252 | ||
| 253 | return rc; | 253 | return 0; |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | int | 256 | int |
| @@ -281,16 +281,9 @@ small_smb_init_no_tc(const int smb_command, const int wct, | |||
| 281 | 281 | ||
| 282 | /* If the return code is zero, this function must fill in request_buf pointer */ | 282 | /* If the return code is zero, this function must fill in request_buf pointer */ |
| 283 | static int | 283 | static int |
| 284 | smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, | 284 | __smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, |
| 285 | void **request_buf /* returned */ , | 285 | void **request_buf, void **response_buf) |
| 286 | void **response_buf /* returned */ ) | ||
| 287 | { | 286 | { |
| 288 | int rc = 0; | ||
| 289 | |||
| 290 | rc = cifs_reconnect_tcon(tcon, smb_command); | ||
| 291 | if (rc) | ||
| 292 | return rc; | ||
| 293 | |||
| 294 | *request_buf = cifs_buf_get(); | 287 | *request_buf = cifs_buf_get(); |
| 295 | if (*request_buf == NULL) { | 288 | if (*request_buf == NULL) { |
| 296 | /* BB should we add a retry in here if not a writepage? */ | 289 | /* BB should we add a retry in here if not a writepage? */ |
| @@ -309,7 +302,31 @@ smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, | |||
| 309 | if (tcon != NULL) | 302 | if (tcon != NULL) |
| 310 | cifs_stats_inc(&tcon->num_smbs_sent); | 303 | cifs_stats_inc(&tcon->num_smbs_sent); |
| 311 | 304 | ||
| 312 | return rc; | 305 | return 0; |
| 306 | } | ||
| 307 | |||
| 308 | /* If the return code is zero, this function must fill in request_buf pointer */ | ||
| 309 | static int | ||
| 310 | smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, | ||
| 311 | void **request_buf, void **response_buf) | ||
| 312 | { | ||
| 313 | int rc; | ||
| 314 | |||
| 315 | rc = cifs_reconnect_tcon(tcon, smb_command); | ||
| 316 | if (rc) | ||
| 317 | return rc; | ||
| 318 | |||
| 319 | return __smb_init(smb_command, wct, tcon, request_buf, response_buf); | ||
| 320 | } | ||
| 321 | |||
| 322 | static int | ||
| 323 | smb_init_no_reconnect(int smb_command, int wct, struct cifsTconInfo *tcon, | ||
| 324 | void **request_buf, void **response_buf) | ||
| 325 | { | ||
| 326 | if (tcon->ses->need_reconnect || tcon->need_reconnect) | ||
| 327 | return -EHOSTDOWN; | ||
| 328 | |||
| 329 | return __smb_init(smb_command, wct, tcon, request_buf, response_buf); | ||
| 313 | } | 330 | } |
| 314 | 331 | ||
| 315 | static int validate_t2(struct smb_t2_rsp *pSMB) | 332 | static int validate_t2(struct smb_t2_rsp *pSMB) |
| @@ -4534,8 +4551,8 @@ CIFSSMBQFSUnixInfo(const int xid, struct cifsTconInfo *tcon) | |||
| 4534 | 4551 | ||
| 4535 | cFYI(1, "In QFSUnixInfo"); | 4552 | cFYI(1, "In QFSUnixInfo"); |
| 4536 | QFSUnixRetry: | 4553 | QFSUnixRetry: |
| 4537 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 4554 | rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon, |
| 4538 | (void **) &pSMBr); | 4555 | (void **) &pSMB, (void **) &pSMBr); |
| 4539 | if (rc) | 4556 | if (rc) |
| 4540 | return rc; | 4557 | return rc; |
| 4541 | 4558 | ||
| @@ -4604,8 +4621,8 @@ CIFSSMBSetFSUnixInfo(const int xid, struct cifsTconInfo *tcon, __u64 cap) | |||
| 4604 | cFYI(1, "In SETFSUnixInfo"); | 4621 | cFYI(1, "In SETFSUnixInfo"); |
| 4605 | SETFSUnixRetry: | 4622 | SETFSUnixRetry: |
| 4606 | /* BB switch to small buf init to save memory */ | 4623 | /* BB switch to small buf init to save memory */ |
| 4607 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 4624 | rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon, |
| 4608 | (void **) &pSMBr); | 4625 | (void **) &pSMB, (void **) &pSMBr); |
| 4609 | if (rc) | 4626 | if (rc) |
| 4610 | return rc; | 4627 | return rc; |
| 4611 | 4628 | ||
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 67dad54fbfa1..88c84a38bccb 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
| @@ -1706,9 +1706,6 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) | |||
| 1706 | if (ses) { | 1706 | if (ses) { |
| 1707 | cFYI(1, "Existing smb sess found (status=%d)", ses->status); | 1707 | cFYI(1, "Existing smb sess found (status=%d)", ses->status); |
| 1708 | 1708 | ||
| 1709 | /* existing SMB ses has a server reference already */ | ||
| 1710 | cifs_put_tcp_session(server); | ||
| 1711 | |||
| 1712 | mutex_lock(&ses->session_mutex); | 1709 | mutex_lock(&ses->session_mutex); |
| 1713 | rc = cifs_negotiate_protocol(xid, ses); | 1710 | rc = cifs_negotiate_protocol(xid, ses); |
| 1714 | if (rc) { | 1711 | if (rc) { |
| @@ -1731,6 +1728,9 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) | |||
| 1731 | } | 1728 | } |
| 1732 | } | 1729 | } |
| 1733 | mutex_unlock(&ses->session_mutex); | 1730 | mutex_unlock(&ses->session_mutex); |
| 1731 | |||
| 1732 | /* existing SMB ses has a server reference already */ | ||
| 1733 | cifs_put_tcp_session(server); | ||
| 1734 | FreeXid(xid); | 1734 | FreeXid(xid); |
| 1735 | return ses; | 1735 | return ses; |
| 1736 | } | 1736 | } |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 93f77d438d3c..53cce8cc2224 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
| @@ -801,6 +801,8 @@ retry_iget5_locked: | |||
| 801 | inode->i_flags |= S_NOATIME | S_NOCMTIME; | 801 | inode->i_flags |= S_NOATIME | S_NOCMTIME; |
| 802 | if (inode->i_state & I_NEW) { | 802 | if (inode->i_state & I_NEW) { |
| 803 | inode->i_ino = hash; | 803 | inode->i_ino = hash; |
| 804 | if (S_ISREG(inode->i_mode)) | ||
| 805 | inode->i_data.backing_dev_info = sb->s_bdi; | ||
| 804 | #ifdef CONFIG_CIFS_FSCACHE | 806 | #ifdef CONFIG_CIFS_FSCACHE |
| 805 | /* initialize per-inode cache cookie pointer */ | 807 | /* initialize per-inode cache cookie pointer */ |
| 806 | CIFS_I(inode)->fscache = NULL; | 808 | CIFS_I(inode)->fscache = NULL; |
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index de89645777c7..116af7546cf0 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c | |||
| @@ -184,8 +184,8 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf, | |||
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | /* adjust outsize. is this useful ?? */ | 186 | /* adjust outsize. is this useful ?? */ |
| 187 | req->uc_outSize = nbytes; | 187 | req->uc_outSize = nbytes; |
| 188 | req->uc_flags |= REQ_WRITE; | 188 | req->uc_flags |= CODA_REQ_WRITE; |
| 189 | count = nbytes; | 189 | count = nbytes; |
| 190 | 190 | ||
| 191 | /* Convert filedescriptor into a file handle */ | 191 | /* Convert filedescriptor into a file handle */ |
diff --git a/fs/compat.c b/fs/compat.c index 718c7062aec1..0644a154672b 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
| @@ -1153,7 +1153,7 @@ static ssize_t compat_do_readv_writev(int type, struct file *file, | |||
| 1153 | { | 1153 | { |
| 1154 | compat_ssize_t tot_len; | 1154 | compat_ssize_t tot_len; |
| 1155 | struct iovec iovstack[UIO_FASTIOV]; | 1155 | struct iovec iovstack[UIO_FASTIOV]; |
| 1156 | struct iovec *iov; | 1156 | struct iovec *iov = iovstack; |
| 1157 | ssize_t ret; | 1157 | ssize_t ret; |
| 1158 | io_fn_t fn; | 1158 | io_fn_t fn; |
| 1159 | iov_fn_t fnv; | 1159 | iov_fn_t fnv; |
| @@ -2014,3 +2014,43 @@ fail_creds: | |||
| 2014 | fail: | 2014 | fail: |
| 2015 | return; | 2015 | return; |
| 2016 | } | 2016 | } |
| 2017 | |||
| 2018 | /* | ||
| 2019 | * Core dumping helper functions. These are the only things you should | ||
| 2020 | * do on a core-file: use only these functions to write out all the | ||
| 2021 | * necessary info. | ||
| 2022 | */ | ||
| 2023 | int dump_write(struct file *file, const void *addr, int nr) | ||
| 2024 | { | ||
| 2025 | return access_ok(VERIFY_READ, addr, nr) && file->f_op->write(file, addr, nr, &file->f_pos) == nr; | ||
| 2026 | } | ||
| 2027 | EXPORT_SYMBOL(dump_write); | ||
| 2028 | |||
| 2029 | int dump_seek(struct file *file, loff_t off) | ||
| 2030 | { | ||
| 2031 | int ret = 1; | ||
| 2032 | |||
| 2033 | if (file->f_op->llseek && file->f_op->llseek != no_llseek) { | ||
| 2034 | if (file->f_op->llseek(file, off, SEEK_CUR) < 0) | ||
| 2035 | return 0; | ||
| 2036 | } else { | ||
| 2037 | char *buf = (char *)get_zeroed_page(GFP_KERNEL); | ||
| 2038 | |||
| 2039 | if (!buf) | ||
| 2040 | return 0; | ||
| 2041 | while (off > 0) { | ||
| 2042 | unsigned long n = off; | ||
| 2043 | |||
| 2044 | if (n > PAGE_SIZE) | ||
| 2045 | n = PAGE_SIZE; | ||
| 2046 | if (!dump_write(file, buf, n)) { | ||
| 2047 | ret = 0; | ||
| 2048 | break; | ||
| 2049 | } | ||
| 2050 | off -= n; | ||
| 2051 | } | ||
| 2052 | free_page((unsigned long)buf); | ||
| 2053 | } | ||
| 2054 | return ret; | ||
| 2055 | } | ||
| 2056 | EXPORT_SYMBOL(dump_seek); | ||
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index eb7368ebd8cd..3eadd97324b1 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c | |||
| @@ -54,6 +54,9 @@ struct page_collect { | |||
| 54 | unsigned nr_pages; | 54 | unsigned nr_pages; |
| 55 | unsigned long length; | 55 | unsigned long length; |
| 56 | loff_t pg_first; /* keep 64bit also in 32-arches */ | 56 | loff_t pg_first; /* keep 64bit also in 32-arches */ |
| 57 | bool read_4_write; /* This means two things: that the read is sync | ||
| 58 | * And the pages should not be unlocked. | ||
| 59 | */ | ||
| 57 | }; | 60 | }; |
| 58 | 61 | ||
| 59 | static void _pcol_init(struct page_collect *pcol, unsigned expected_pages, | 62 | static void _pcol_init(struct page_collect *pcol, unsigned expected_pages, |
| @@ -71,6 +74,7 @@ static void _pcol_init(struct page_collect *pcol, unsigned expected_pages, | |||
| 71 | pcol->nr_pages = 0; | 74 | pcol->nr_pages = 0; |
| 72 | pcol->length = 0; | 75 | pcol->length = 0; |
| 73 | pcol->pg_first = -1; | 76 | pcol->pg_first = -1; |
| 77 | pcol->read_4_write = false; | ||
| 74 | } | 78 | } |
| 75 | 79 | ||
| 76 | static void _pcol_reset(struct page_collect *pcol) | 80 | static void _pcol_reset(struct page_collect *pcol) |
| @@ -347,7 +351,8 @@ static int readpage_strip(void *data, struct page *page) | |||
| 347 | if (PageError(page)) | 351 | if (PageError(page)) |
| 348 | ClearPageError(page); | 352 | ClearPageError(page); |
| 349 | 353 | ||
| 350 | unlock_page(page); | 354 | if (!pcol->read_4_write) |
| 355 | unlock_page(page); | ||
| 351 | EXOFS_DBGMSG("readpage_strip(0x%lx, 0x%lx) empty page," | 356 | EXOFS_DBGMSG("readpage_strip(0x%lx, 0x%lx) empty page," |
| 352 | " splitting\n", inode->i_ino, page->index); | 357 | " splitting\n", inode->i_ino, page->index); |
| 353 | 358 | ||
| @@ -428,6 +433,7 @@ static int _readpage(struct page *page, bool is_sync) | |||
| 428 | /* readpage_strip might call read_exec(,is_sync==false) at several | 433 | /* readpage_strip might call read_exec(,is_sync==false) at several |
| 429 | * places but not if we have a single page. | 434 | * places but not if we have a single page. |
| 430 | */ | 435 | */ |
| 436 | pcol.read_4_write = is_sync; | ||
| 431 | ret = readpage_strip(&pcol, page); | 437 | ret = readpage_strip(&pcol, page); |
| 432 | if (ret) { | 438 | if (ret) { |
| 433 | EXOFS_ERR("_readpage => %d\n", ret); | 439 | EXOFS_ERR("_readpage => %d\n", ret); |
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 81e086d8aa57..ab38fef1c9a1 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
| @@ -52,8 +52,6 @@ struct wb_writeback_work { | |||
| 52 | #define CREATE_TRACE_POINTS | 52 | #define CREATE_TRACE_POINTS |
| 53 | #include <trace/events/writeback.h> | 53 | #include <trace/events/writeback.h> |
| 54 | 54 | ||
| 55 | #define inode_to_bdi(inode) ((inode)->i_mapping->backing_dev_info) | ||
| 56 | |||
| 57 | /* | 55 | /* |
| 58 | * We don't actually have pdflush, but this one is exported though /proc... | 56 | * We don't actually have pdflush, but this one is exported though /proc... |
| 59 | */ | 57 | */ |
| @@ -71,6 +69,16 @@ int writeback_in_progress(struct backing_dev_info *bdi) | |||
| 71 | return test_bit(BDI_writeback_running, &bdi->state); | 69 | return test_bit(BDI_writeback_running, &bdi->state); |
| 72 | } | 70 | } |
| 73 | 71 | ||
| 72 | static inline struct backing_dev_info *inode_to_bdi(struct inode *inode) | ||
| 73 | { | ||
| 74 | struct super_block *sb = inode->i_sb; | ||
| 75 | |||
| 76 | if (strcmp(sb->s_type->name, "bdev") == 0) | ||
| 77 | return inode->i_mapping->backing_dev_info; | ||
| 78 | |||
| 79 | return sb->s_bdi; | ||
| 80 | } | ||
| 81 | |||
| 74 | static void bdi_queue_work(struct backing_dev_info *bdi, | 82 | static void bdi_queue_work(struct backing_dev_info *bdi, |
| 75 | struct wb_writeback_work *work) | 83 | struct wb_writeback_work *work) |
| 76 | { | 84 | { |
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index d367af1514ef..cde755cca564 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
| @@ -1354,7 +1354,7 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode, | |||
| 1354 | loff_t file_size; | 1354 | loff_t file_size; |
| 1355 | unsigned int num; | 1355 | unsigned int num; |
| 1356 | unsigned int offset; | 1356 | unsigned int offset; |
| 1357 | size_t total_len; | 1357 | size_t total_len = 0; |
| 1358 | 1358 | ||
| 1359 | req = fuse_get_req(fc); | 1359 | req = fuse_get_req(fc); |
| 1360 | if (IS_ERR(req)) | 1360 | if (IS_ERR(req)) |
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index cde1248a6225..ac750bd31a6f 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c | |||
| @@ -932,7 +932,7 @@ int gfs2_logd(void *data) | |||
| 932 | 932 | ||
| 933 | do { | 933 | do { |
| 934 | prepare_to_wait(&sdp->sd_logd_waitq, &wait, | 934 | prepare_to_wait(&sdp->sd_logd_waitq, &wait, |
| 935 | TASK_UNINTERRUPTIBLE); | 935 | TASK_INTERRUPTIBLE); |
| 936 | if (!gfs2_ail_flush_reqd(sdp) && | 936 | if (!gfs2_ail_flush_reqd(sdp) && |
| 937 | !gfs2_jrnl_flush_reqd(sdp) && | 937 | !gfs2_jrnl_flush_reqd(sdp) && |
| 938 | !kthread_should_stop()) | 938 | !kthread_should_stop()) |
diff --git a/fs/nfsd/nfsfh.h b/fs/nfsd/nfsfh.h index cdfb8c6a4206..c16f8d8331b5 100644 --- a/fs/nfsd/nfsfh.h +++ b/fs/nfsd/nfsfh.h | |||
| @@ -196,8 +196,6 @@ fh_lock(struct svc_fh *fhp) | |||
| 196 | static inline void | 196 | static inline void |
| 197 | fh_unlock(struct svc_fh *fhp) | 197 | fh_unlock(struct svc_fh *fhp) |
| 198 | { | 198 | { |
| 199 | BUG_ON(!fhp->fh_dentry); | ||
| 200 | |||
| 201 | if (fhp->fh_locked) { | 199 | if (fhp->fh_locked) { |
| 202 | fill_post_wcc(fhp); | 200 | fill_post_wcc(fhp); |
| 203 | mutex_unlock(&fhp->fh_dentry->d_inode->i_mutex); | 201 | mutex_unlock(&fhp->fh_dentry->d_inode->i_mutex); |
diff --git a/fs/notify/Kconfig b/fs/notify/Kconfig index 22c629eedd82..b388443c3a09 100644 --- a/fs/notify/Kconfig +++ b/fs/notify/Kconfig | |||
| @@ -3,4 +3,4 @@ config FSNOTIFY | |||
| 3 | 3 | ||
| 4 | source "fs/notify/dnotify/Kconfig" | 4 | source "fs/notify/dnotify/Kconfig" |
| 5 | source "fs/notify/inotify/Kconfig" | 5 | source "fs/notify/inotify/Kconfig" |
| 6 | source "fs/notify/fanotify/Kconfig" | 6 | #source "fs/notify/fanotify/Kconfig" |
diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index a76e0aa5cd3f..391915093fe1 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c | |||
| @@ -209,7 +209,10 @@ static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head *di_bh, | |||
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | inode->i_mode = new_mode; | 211 | inode->i_mode = new_mode; |
| 212 | inode->i_ctime = CURRENT_TIME; | ||
| 212 | di->i_mode = cpu_to_le16(inode->i_mode); | 213 | di->i_mode = cpu_to_le16(inode->i_mode); |
| 214 | di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); | ||
| 215 | di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); | ||
| 213 | 216 | ||
| 214 | ocfs2_journal_dirty(handle, di_bh); | 217 | ocfs2_journal_dirty(handle, di_bh); |
| 215 | 218 | ||
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index 1361997cf205..cbe2f057cc28 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
| @@ -977,7 +977,7 @@ static int o2net_tx_can_proceed(struct o2net_node *nn, | |||
| 977 | int o2net_send_message_vec(u32 msg_type, u32 key, struct kvec *caller_vec, | 977 | int o2net_send_message_vec(u32 msg_type, u32 key, struct kvec *caller_vec, |
| 978 | size_t caller_veclen, u8 target_node, int *status) | 978 | size_t caller_veclen, u8 target_node, int *status) |
| 979 | { | 979 | { |
| 980 | int ret; | 980 | int ret = 0; |
| 981 | struct o2net_msg *msg = NULL; | 981 | struct o2net_msg *msg = NULL; |
| 982 | size_t veclen, caller_bytes = 0; | 982 | size_t veclen, caller_bytes = 0; |
| 983 | struct kvec *vec = NULL; | 983 | struct kvec *vec = NULL; |
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index f04ebcfffc4a..c49f6de0e7ab 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
| @@ -3931,6 +3931,15 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, | |||
| 3931 | goto out_commit; | 3931 | goto out_commit; |
| 3932 | } | 3932 | } |
| 3933 | 3933 | ||
| 3934 | cpos = split_hash; | ||
| 3935 | ret = ocfs2_dx_dir_new_cluster(dir, &et, cpos, handle, | ||
| 3936 | data_ac, meta_ac, new_dx_leaves, | ||
| 3937 | num_dx_leaves); | ||
| 3938 | if (ret) { | ||
| 3939 | mlog_errno(ret); | ||
| 3940 | goto out_commit; | ||
| 3941 | } | ||
| 3942 | |||
| 3934 | for (i = 0; i < num_dx_leaves; i++) { | 3943 | for (i = 0; i < num_dx_leaves; i++) { |
| 3935 | ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), | 3944 | ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), |
| 3936 | orig_dx_leaves[i], | 3945 | orig_dx_leaves[i], |
| @@ -3939,15 +3948,14 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, | |||
| 3939 | mlog_errno(ret); | 3948 | mlog_errno(ret); |
| 3940 | goto out_commit; | 3949 | goto out_commit; |
| 3941 | } | 3950 | } |
| 3942 | } | ||
| 3943 | 3951 | ||
| 3944 | cpos = split_hash; | 3952 | ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), |
| 3945 | ret = ocfs2_dx_dir_new_cluster(dir, &et, cpos, handle, | 3953 | new_dx_leaves[i], |
| 3946 | data_ac, meta_ac, new_dx_leaves, | 3954 | OCFS2_JOURNAL_ACCESS_WRITE); |
| 3947 | num_dx_leaves); | 3955 | if (ret) { |
| 3948 | if (ret) { | 3956 | mlog_errno(ret); |
| 3949 | mlog_errno(ret); | 3957 | goto out_commit; |
| 3950 | goto out_commit; | 3958 | } |
| 3951 | } | 3959 | } |
| 3952 | 3960 | ||
| 3953 | ocfs2_dx_dir_transfer_leaf(dir, split_hash, handle, tmp_dx_leaf, | 3961 | ocfs2_dx_dir_transfer_leaf(dir, split_hash, handle, tmp_dx_leaf, |
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h index 4b6ae2c13b47..765298908f1d 100644 --- a/fs/ocfs2/dlm/dlmcommon.h +++ b/fs/ocfs2/dlm/dlmcommon.h | |||
| @@ -1030,6 +1030,7 @@ int dlm_drop_lockres_ref(struct dlm_ctxt *dlm, | |||
| 1030 | struct dlm_lock_resource *res); | 1030 | struct dlm_lock_resource *res); |
| 1031 | void dlm_clean_master_list(struct dlm_ctxt *dlm, | 1031 | void dlm_clean_master_list(struct dlm_ctxt *dlm, |
| 1032 | u8 dead_node); | 1032 | u8 dead_node); |
| 1033 | void dlm_force_free_mles(struct dlm_ctxt *dlm); | ||
| 1033 | int dlm_lock_basts_flushed(struct dlm_ctxt *dlm, struct dlm_lock *lock); | 1034 | int dlm_lock_basts_flushed(struct dlm_ctxt *dlm, struct dlm_lock *lock); |
| 1034 | int __dlm_lockres_has_locks(struct dlm_lock_resource *res); | 1035 | int __dlm_lockres_has_locks(struct dlm_lock_resource *res); |
| 1035 | int __dlm_lockres_unused(struct dlm_lock_resource *res); | 1036 | int __dlm_lockres_unused(struct dlm_lock_resource *res); |
diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c index 5efdd37dfe48..901ca52bf86b 100644 --- a/fs/ocfs2/dlm/dlmdebug.c +++ b/fs/ocfs2/dlm/dlmdebug.c | |||
| @@ -636,8 +636,14 @@ static void *lockres_seq_start(struct seq_file *m, loff_t *pos) | |||
| 636 | spin_lock(&dlm->track_lock); | 636 | spin_lock(&dlm->track_lock); |
| 637 | if (oldres) | 637 | if (oldres) |
| 638 | track_list = &oldres->tracking; | 638 | track_list = &oldres->tracking; |
| 639 | else | 639 | else { |
| 640 | track_list = &dlm->tracking_list; | 640 | track_list = &dlm->tracking_list; |
| 641 | if (list_empty(track_list)) { | ||
| 642 | dl = NULL; | ||
| 643 | spin_unlock(&dlm->track_lock); | ||
| 644 | goto bail; | ||
| 645 | } | ||
| 646 | } | ||
| 641 | 647 | ||
| 642 | list_for_each_entry(res, track_list, tracking) { | 648 | list_for_each_entry(res, track_list, tracking) { |
| 643 | if (&res->tracking == &dlm->tracking_list) | 649 | if (&res->tracking == &dlm->tracking_list) |
| @@ -660,6 +666,7 @@ static void *lockres_seq_start(struct seq_file *m, loff_t *pos) | |||
| 660 | } else | 666 | } else |
| 661 | dl = NULL; | 667 | dl = NULL; |
| 662 | 668 | ||
| 669 | bail: | ||
| 663 | /* passed to seq_show */ | 670 | /* passed to seq_show */ |
| 664 | return dl; | 671 | return dl; |
| 665 | } | 672 | } |
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index 153abb5abef0..11a5c87fd7f7 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c | |||
| @@ -693,6 +693,7 @@ void dlm_unregister_domain(struct dlm_ctxt *dlm) | |||
| 693 | 693 | ||
| 694 | dlm_mark_domain_leaving(dlm); | 694 | dlm_mark_domain_leaving(dlm); |
| 695 | dlm_leave_domain(dlm); | 695 | dlm_leave_domain(dlm); |
| 696 | dlm_force_free_mles(dlm); | ||
| 696 | dlm_complete_dlm_shutdown(dlm); | 697 | dlm_complete_dlm_shutdown(dlm); |
| 697 | } | 698 | } |
| 698 | dlm_put(dlm); | 699 | dlm_put(dlm); |
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index ffb4c68dafa4..f564b0e5f80d 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
| @@ -3433,3 +3433,43 @@ void dlm_lockres_release_ast(struct dlm_ctxt *dlm, | |||
| 3433 | wake_up(&res->wq); | 3433 | wake_up(&res->wq); |
| 3434 | wake_up(&dlm->migration_wq); | 3434 | wake_up(&dlm->migration_wq); |
| 3435 | } | 3435 | } |
| 3436 | |||
| 3437 | void dlm_force_free_mles(struct dlm_ctxt *dlm) | ||
| 3438 | { | ||
| 3439 | int i; | ||
| 3440 | struct hlist_head *bucket; | ||
| 3441 | struct dlm_master_list_entry *mle; | ||
| 3442 | struct hlist_node *tmp, *list; | ||
| 3443 | |||
| 3444 | /* | ||
| 3445 | * We notified all other nodes that we are exiting the domain and | ||
| 3446 | * marked the dlm state to DLM_CTXT_LEAVING. If any mles are still | ||
| 3447 | * around we force free them and wake any processes that are waiting | ||
| 3448 | * on the mles | ||
| 3449 | */ | ||
| 3450 | spin_lock(&dlm->spinlock); | ||
| 3451 | spin_lock(&dlm->master_lock); | ||
| 3452 | |||
| 3453 | BUG_ON(dlm->dlm_state != DLM_CTXT_LEAVING); | ||
| 3454 | BUG_ON((find_next_bit(dlm->domain_map, O2NM_MAX_NODES, 0) < O2NM_MAX_NODES)); | ||
| 3455 | |||
| 3456 | for (i = 0; i < DLM_HASH_BUCKETS; i++) { | ||
| 3457 | bucket = dlm_master_hash(dlm, i); | ||
| 3458 | hlist_for_each_safe(list, tmp, bucket) { | ||
| 3459 | mle = hlist_entry(list, struct dlm_master_list_entry, | ||
| 3460 | master_hash_node); | ||
| 3461 | if (mle->type != DLM_MLE_BLOCK) { | ||
| 3462 | mlog(ML_ERROR, "bad mle: %p\n", mle); | ||
| 3463 | dlm_print_one_mle(mle); | ||
| 3464 | } | ||
| 3465 | atomic_set(&mle->woken, 1); | ||
| 3466 | wake_up(&mle->wq); | ||
| 3467 | |||
| 3468 | __dlm_unlink_mle(dlm, mle); | ||
| 3469 | __dlm_mle_detach_hb_events(dlm, mle); | ||
| 3470 | __dlm_put_mle(mle); | ||
| 3471 | } | ||
| 3472 | } | ||
| 3473 | spin_unlock(&dlm->master_lock); | ||
| 3474 | spin_unlock(&dlm->spinlock); | ||
| 3475 | } | ||
diff --git a/fs/ocfs2/dlmglue.h b/fs/ocfs2/dlmglue.h index d1ce48e1b3d6..1d596d8c4a4a 100644 --- a/fs/ocfs2/dlmglue.h +++ b/fs/ocfs2/dlmglue.h | |||
| @@ -84,6 +84,7 @@ enum { | |||
| 84 | OI_LS_PARENT, | 84 | OI_LS_PARENT, |
| 85 | OI_LS_RENAME1, | 85 | OI_LS_RENAME1, |
| 86 | OI_LS_RENAME2, | 86 | OI_LS_RENAME2, |
| 87 | OI_LS_REFLINK_TARGET, | ||
| 87 | }; | 88 | }; |
| 88 | 89 | ||
| 89 | int ocfs2_dlm_init(struct ocfs2_super *osb); | 90 | int ocfs2_dlm_init(struct ocfs2_super *osb); |
diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h index 33f1c9a8258d..fa31d05e41b7 100644 --- a/fs/ocfs2/ocfs2_fs.h +++ b/fs/ocfs2/ocfs2_fs.h | |||
| @@ -235,18 +235,31 @@ | |||
| 235 | #define OCFS2_HAS_REFCOUNT_FL (0x0010) | 235 | #define OCFS2_HAS_REFCOUNT_FL (0x0010) |
| 236 | 236 | ||
| 237 | /* Inode attributes, keep in sync with EXT2 */ | 237 | /* Inode attributes, keep in sync with EXT2 */ |
| 238 | #define OCFS2_SECRM_FL (0x00000001) /* Secure deletion */ | 238 | #define OCFS2_SECRM_FL FS_SECRM_FL /* Secure deletion */ |
| 239 | #define OCFS2_UNRM_FL (0x00000002) /* Undelete */ | 239 | #define OCFS2_UNRM_FL FS_UNRM_FL /* Undelete */ |
| 240 | #define OCFS2_COMPR_FL (0x00000004) /* Compress file */ | 240 | #define OCFS2_COMPR_FL FS_COMPR_FL /* Compress file */ |
| 241 | #define OCFS2_SYNC_FL (0x00000008) /* Synchronous updates */ | 241 | #define OCFS2_SYNC_FL FS_SYNC_FL /* Synchronous updates */ |
| 242 | #define OCFS2_IMMUTABLE_FL (0x00000010) /* Immutable file */ | 242 | #define OCFS2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */ |
| 243 | #define OCFS2_APPEND_FL (0x00000020) /* writes to file may only append */ | 243 | #define OCFS2_APPEND_FL FS_APPEND_FL /* writes to file may only append */ |
| 244 | #define OCFS2_NODUMP_FL (0x00000040) /* do not dump file */ | 244 | #define OCFS2_NODUMP_FL FS_NODUMP_FL /* do not dump file */ |
| 245 | #define OCFS2_NOATIME_FL (0x00000080) /* do not update atime */ | 245 | #define OCFS2_NOATIME_FL FS_NOATIME_FL /* do not update atime */ |
| 246 | #define OCFS2_DIRSYNC_FL (0x00010000) /* dirsync behaviour (directories only) */ | 246 | /* Reserved for compression usage... */ |
| 247 | 247 | #define OCFS2_DIRTY_FL FS_DIRTY_FL | |
| 248 | #define OCFS2_FL_VISIBLE (0x000100FF) /* User visible flags */ | 248 | #define OCFS2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */ |
| 249 | #define OCFS2_FL_MODIFIABLE (0x000100FF) /* User modifiable flags */ | 249 | #define OCFS2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */ |
| 250 | #define OCFS2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */ | ||
| 251 | /* End compression flags --- maybe not all used */ | ||
| 252 | #define OCFS2_BTREE_FL FS_BTREE_FL /* btree format dir */ | ||
| 253 | #define OCFS2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */ | ||
| 254 | #define OCFS2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */ | ||
| 255 | #define OCFS2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */ | ||
| 256 | #define OCFS2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */ | ||
| 257 | #define OCFS2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */ | ||
| 258 | #define OCFS2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/ | ||
| 259 | #define OCFS2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */ | ||
| 260 | |||
| 261 | #define OCFS2_FL_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */ | ||
| 262 | #define OCFS2_FL_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */ | ||
| 250 | 263 | ||
| 251 | /* | 264 | /* |
| 252 | * Extent record flags (e_node.leaf.flags) | 265 | * Extent record flags (e_node.leaf.flags) |
diff --git a/fs/ocfs2/ocfs2_ioctl.h b/fs/ocfs2/ocfs2_ioctl.h index 2d3420af1a83..5d241505690b 100644 --- a/fs/ocfs2/ocfs2_ioctl.h +++ b/fs/ocfs2/ocfs2_ioctl.h | |||
| @@ -23,10 +23,10 @@ | |||
| 23 | /* | 23 | /* |
| 24 | * ioctl commands | 24 | * ioctl commands |
| 25 | */ | 25 | */ |
| 26 | #define OCFS2_IOC_GETFLAGS _IOR('f', 1, long) | 26 | #define OCFS2_IOC_GETFLAGS FS_IOC_GETFLAGS |
| 27 | #define OCFS2_IOC_SETFLAGS _IOW('f', 2, long) | 27 | #define OCFS2_IOC_SETFLAGS FS_IOC_SETFLAGS |
| 28 | #define OCFS2_IOC32_GETFLAGS _IOR('f', 1, int) | 28 | #define OCFS2_IOC32_GETFLAGS FS_IOC32_GETFLAGS |
| 29 | #define OCFS2_IOC32_SETFLAGS _IOW('f', 2, int) | 29 | #define OCFS2_IOC32_SETFLAGS FS_IOC32_SETFLAGS |
| 30 | 30 | ||
| 31 | /* | 31 | /* |
| 32 | * Space reservation / allocation / free ioctls and argument structure | 32 | * Space reservation / allocation / free ioctls and argument structure |
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 0afeda83120f..efdd75607406 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c | |||
| @@ -4201,8 +4201,9 @@ static int __ocfs2_reflink(struct dentry *old_dentry, | |||
| 4201 | goto out; | 4201 | goto out; |
| 4202 | } | 4202 | } |
| 4203 | 4203 | ||
| 4204 | mutex_lock(&new_inode->i_mutex); | 4204 | mutex_lock_nested(&new_inode->i_mutex, I_MUTEX_CHILD); |
| 4205 | ret = ocfs2_inode_lock(new_inode, &new_bh, 1); | 4205 | ret = ocfs2_inode_lock_nested(new_inode, &new_bh, 1, |
| 4206 | OI_LS_REFLINK_TARGET); | ||
| 4206 | if (ret) { | 4207 | if (ret) { |
| 4207 | mlog_errno(ret); | 4208 | mlog_errno(ret); |
| 4208 | goto out_unlock; | 4209 | goto out_unlock; |
diff --git a/fs/ocfs2/reservations.c b/fs/ocfs2/reservations.c index d8b6e4259b80..3e78db361bc7 100644 --- a/fs/ocfs2/reservations.c +++ b/fs/ocfs2/reservations.c | |||
| @@ -732,25 +732,23 @@ int ocfs2_resmap_resv_bits(struct ocfs2_reservation_map *resmap, | |||
| 732 | struct ocfs2_alloc_reservation *resv, | 732 | struct ocfs2_alloc_reservation *resv, |
| 733 | int *cstart, int *clen) | 733 | int *cstart, int *clen) |
| 734 | { | 734 | { |
| 735 | unsigned int wanted = *clen; | ||
| 736 | |||
| 737 | if (resv == NULL || ocfs2_resmap_disabled(resmap)) | 735 | if (resv == NULL || ocfs2_resmap_disabled(resmap)) |
| 738 | return -ENOSPC; | 736 | return -ENOSPC; |
| 739 | 737 | ||
| 740 | spin_lock(&resv_lock); | 738 | spin_lock(&resv_lock); |
| 741 | 739 | ||
| 742 | /* | ||
| 743 | * We don't want to over-allocate for temporary | ||
| 744 | * windows. Otherwise, we run the risk of fragmenting the | ||
| 745 | * allocation space. | ||
| 746 | */ | ||
| 747 | wanted = ocfs2_resv_window_bits(resmap, resv); | ||
| 748 | if ((resv->r_flags & OCFS2_RESV_FLAG_TMP) || wanted < *clen) | ||
| 749 | wanted = *clen; | ||
| 750 | |||
| 751 | if (ocfs2_resv_empty(resv)) { | 740 | if (ocfs2_resv_empty(resv)) { |
| 752 | mlog(0, "empty reservation, find new window\n"); | 741 | /* |
| 742 | * We don't want to over-allocate for temporary | ||
| 743 | * windows. Otherwise, we run the risk of fragmenting the | ||
| 744 | * allocation space. | ||
| 745 | */ | ||
| 746 | unsigned int wanted = ocfs2_resv_window_bits(resmap, resv); | ||
| 753 | 747 | ||
| 748 | if ((resv->r_flags & OCFS2_RESV_FLAG_TMP) || wanted < *clen) | ||
| 749 | wanted = *clen; | ||
| 750 | |||
| 751 | mlog(0, "empty reservation, find new window\n"); | ||
| 754 | /* | 752 | /* |
| 755 | * Try to get a window here. If it works, we must fall | 753 | * Try to get a window here. If it works, we must fall |
| 756 | * through and test the bitmap . This avoids some | 754 | * through and test the bitmap . This avoids some |
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 8a286f54dca1..849c2f0e0a0e 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
| @@ -357,7 +357,7 @@ out: | |||
| 357 | static void ocfs2_bg_discontig_add_extent(struct ocfs2_super *osb, | 357 | static void ocfs2_bg_discontig_add_extent(struct ocfs2_super *osb, |
| 358 | struct ocfs2_group_desc *bg, | 358 | struct ocfs2_group_desc *bg, |
| 359 | struct ocfs2_chain_list *cl, | 359 | struct ocfs2_chain_list *cl, |
| 360 | u64 p_blkno, u32 clusters) | 360 | u64 p_blkno, unsigned int clusters) |
| 361 | { | 361 | { |
| 362 | struct ocfs2_extent_list *el = &bg->bg_list; | 362 | struct ocfs2_extent_list *el = &bg->bg_list; |
| 363 | struct ocfs2_extent_rec *rec; | 363 | struct ocfs2_extent_rec *rec; |
| @@ -369,7 +369,7 @@ static void ocfs2_bg_discontig_add_extent(struct ocfs2_super *osb, | |||
| 369 | rec->e_blkno = cpu_to_le64(p_blkno); | 369 | rec->e_blkno = cpu_to_le64(p_blkno); |
| 370 | rec->e_cpos = cpu_to_le32(le16_to_cpu(bg->bg_bits) / | 370 | rec->e_cpos = cpu_to_le32(le16_to_cpu(bg->bg_bits) / |
| 371 | le16_to_cpu(cl->cl_bpc)); | 371 | le16_to_cpu(cl->cl_bpc)); |
| 372 | rec->e_leaf_clusters = cpu_to_le32(clusters); | 372 | rec->e_leaf_clusters = cpu_to_le16(clusters); |
| 373 | le16_add_cpu(&bg->bg_bits, clusters * le16_to_cpu(cl->cl_bpc)); | 373 | le16_add_cpu(&bg->bg_bits, clusters * le16_to_cpu(cl->cl_bpc)); |
| 374 | le16_add_cpu(&bg->bg_free_bits_count, | 374 | le16_add_cpu(&bg->bg_free_bits_count, |
| 375 | clusters * le16_to_cpu(cl->cl_bpc)); | 375 | clusters * le16_to_cpu(cl->cl_bpc)); |
diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c index 32499d213fc4..9975457c981f 100644 --- a/fs/ocfs2/symlink.c +++ b/fs/ocfs2/symlink.c | |||
| @@ -128,7 +128,7 @@ static void *ocfs2_fast_follow_link(struct dentry *dentry, | |||
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | /* Fast symlinks can't be large */ | 130 | /* Fast symlinks can't be large */ |
| 131 | len = strlen(target); | 131 | len = strnlen(target, ocfs2_fast_symlink_chars(inode->i_sb)); |
| 132 | link = kzalloc(len + 1, GFP_NOFS); | 132 | link = kzalloc(len + 1, GFP_NOFS); |
| 133 | if (!link) { | 133 | if (!link) { |
| 134 | status = -ENOMEM; | 134 | status = -ENOMEM; |
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index d03469f61801..06fa5e77c40e 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
| @@ -1286,13 +1286,11 @@ int ocfs2_xattr_get_nolock(struct inode *inode, | |||
| 1286 | xis.inode_bh = xbs.inode_bh = di_bh; | 1286 | xis.inode_bh = xbs.inode_bh = di_bh; |
| 1287 | di = (struct ocfs2_dinode *)di_bh->b_data; | 1287 | di = (struct ocfs2_dinode *)di_bh->b_data; |
| 1288 | 1288 | ||
| 1289 | down_read(&oi->ip_xattr_sem); | ||
| 1290 | ret = ocfs2_xattr_ibody_get(inode, name_index, name, buffer, | 1289 | ret = ocfs2_xattr_ibody_get(inode, name_index, name, buffer, |
| 1291 | buffer_size, &xis); | 1290 | buffer_size, &xis); |
| 1292 | if (ret == -ENODATA && di->i_xattr_loc) | 1291 | if (ret == -ENODATA && di->i_xattr_loc) |
| 1293 | ret = ocfs2_xattr_block_get(inode, name_index, name, buffer, | 1292 | ret = ocfs2_xattr_block_get(inode, name_index, name, buffer, |
| 1294 | buffer_size, &xbs); | 1293 | buffer_size, &xbs); |
| 1295 | up_read(&oi->ip_xattr_sem); | ||
| 1296 | 1294 | ||
| 1297 | return ret; | 1295 | return ret; |
| 1298 | } | 1296 | } |
| @@ -1316,8 +1314,10 @@ static int ocfs2_xattr_get(struct inode *inode, | |||
| 1316 | mlog_errno(ret); | 1314 | mlog_errno(ret); |
| 1317 | return ret; | 1315 | return ret; |
| 1318 | } | 1316 | } |
| 1317 | down_read(&OCFS2_I(inode)->ip_xattr_sem); | ||
| 1319 | ret = ocfs2_xattr_get_nolock(inode, di_bh, name_index, | 1318 | ret = ocfs2_xattr_get_nolock(inode, di_bh, name_index, |
| 1320 | name, buffer, buffer_size); | 1319 | name, buffer, buffer_size); |
| 1320 | up_read(&OCFS2_I(inode)->ip_xattr_sem); | ||
| 1321 | 1321 | ||
| 1322 | ocfs2_inode_unlock(inode, 0); | 1322 | ocfs2_inode_unlock(inode, 0); |
| 1323 | 1323 | ||
diff --git a/fs/proc/base.c b/fs/proc/base.c index a1c43e7c8a7b..8e4addaa5424 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
| @@ -2675,7 +2675,7 @@ static const struct pid_entry tgid_base_stuff[] = { | |||
| 2675 | INF("auxv", S_IRUSR, proc_pid_auxv), | 2675 | INF("auxv", S_IRUSR, proc_pid_auxv), |
| 2676 | ONE("status", S_IRUGO, proc_pid_status), | 2676 | ONE("status", S_IRUGO, proc_pid_status), |
| 2677 | ONE("personality", S_IRUSR, proc_pid_personality), | 2677 | ONE("personality", S_IRUSR, proc_pid_personality), |
| 2678 | INF("limits", S_IRUSR, proc_pid_limits), | 2678 | INF("limits", S_IRUGO, proc_pid_limits), |
| 2679 | #ifdef CONFIG_SCHED_DEBUG | 2679 | #ifdef CONFIG_SCHED_DEBUG |
| 2680 | REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), | 2680 | REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), |
| 2681 | #endif | 2681 | #endif |
| @@ -3011,7 +3011,7 @@ static const struct pid_entry tid_base_stuff[] = { | |||
| 3011 | INF("auxv", S_IRUSR, proc_pid_auxv), | 3011 | INF("auxv", S_IRUSR, proc_pid_auxv), |
| 3012 | ONE("status", S_IRUGO, proc_pid_status), | 3012 | ONE("status", S_IRUGO, proc_pid_status), |
| 3013 | ONE("personality", S_IRUSR, proc_pid_personality), | 3013 | ONE("personality", S_IRUSR, proc_pid_personality), |
| 3014 | INF("limits", S_IRUSR, proc_pid_limits), | 3014 | INF("limits", S_IRUGO, proc_pid_limits), |
| 3015 | #ifdef CONFIG_SCHED_DEBUG | 3015 | #ifdef CONFIG_SCHED_DEBUG |
| 3016 | REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), | 3016 | REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations), |
| 3017 | #endif | 3017 | #endif |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 271afc48b9a5..1dbca4e8cc16 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
| @@ -363,13 +363,13 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, | |||
| 363 | mss->referenced += PAGE_SIZE; | 363 | mss->referenced += PAGE_SIZE; |
| 364 | mapcount = page_mapcount(page); | 364 | mapcount = page_mapcount(page); |
| 365 | if (mapcount >= 2) { | 365 | if (mapcount >= 2) { |
| 366 | if (pte_dirty(ptent)) | 366 | if (pte_dirty(ptent) || PageDirty(page)) |
| 367 | mss->shared_dirty += PAGE_SIZE; | 367 | mss->shared_dirty += PAGE_SIZE; |
| 368 | else | 368 | else |
| 369 | mss->shared_clean += PAGE_SIZE; | 369 | mss->shared_clean += PAGE_SIZE; |
| 370 | mss->pss += (PAGE_SIZE << PSS_SHIFT) / mapcount; | 370 | mss->pss += (PAGE_SIZE << PSS_SHIFT) / mapcount; |
| 371 | } else { | 371 | } else { |
| 372 | if (pte_dirty(ptent)) | 372 | if (pte_dirty(ptent) || PageDirty(page)) |
| 373 | mss->private_dirty += PAGE_SIZE; | 373 | mss->private_dirty += PAGE_SIZE; |
| 374 | else | 374 | else |
| 375 | mss->private_clean += PAGE_SIZE; | 375 | mss->private_clean += PAGE_SIZE; |
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index 91c817ff02c3..2367fb3f70bc 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c | |||
| @@ -163,7 +163,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer, | |||
| 163 | 163 | ||
| 164 | static const struct file_operations proc_vmcore_operations = { | 164 | static const struct file_operations proc_vmcore_operations = { |
| 165 | .read = read_vmcore, | 165 | .read = read_vmcore, |
| 166 | .llseek = generic_file_llseek, | 166 | .llseek = default_llseek, |
| 167 | }; | 167 | }; |
| 168 | 168 | ||
| 169 | static struct vmcore* __init get_new_element(void) | 169 | static struct vmcore* __init get_new_element(void) |
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c index f53505de0712..5cbb81e134ac 100644 --- a/fs/reiserfs/ioctl.c +++ b/fs/reiserfs/ioctl.c | |||
| @@ -170,6 +170,7 @@ int reiserfs_prepare_write(struct file *f, struct page *page, | |||
| 170 | int reiserfs_unpack(struct inode *inode, struct file *filp) | 170 | int reiserfs_unpack(struct inode *inode, struct file *filp) |
| 171 | { | 171 | { |
| 172 | int retval = 0; | 172 | int retval = 0; |
| 173 | int depth; | ||
| 173 | int index; | 174 | int index; |
| 174 | struct page *page; | 175 | struct page *page; |
| 175 | struct address_space *mapping; | 176 | struct address_space *mapping; |
| @@ -188,8 +189,8 @@ int reiserfs_unpack(struct inode *inode, struct file *filp) | |||
| 188 | /* we need to make sure nobody is changing the file size beneath | 189 | /* we need to make sure nobody is changing the file size beneath |
| 189 | ** us | 190 | ** us |
| 190 | */ | 191 | */ |
| 191 | mutex_lock(&inode->i_mutex); | 192 | reiserfs_mutex_lock_safe(&inode->i_mutex, inode->i_sb); |
| 192 | reiserfs_write_lock(inode->i_sb); | 193 | depth = reiserfs_write_lock_once(inode->i_sb); |
| 193 | 194 | ||
| 194 | write_from = inode->i_size & (blocksize - 1); | 195 | write_from = inode->i_size & (blocksize - 1); |
| 195 | /* if we are on a block boundary, we are already unpacked. */ | 196 | /* if we are on a block boundary, we are already unpacked. */ |
| @@ -224,6 +225,6 @@ int reiserfs_unpack(struct inode *inode, struct file *filp) | |||
| 224 | 225 | ||
| 225 | out: | 226 | out: |
| 226 | mutex_unlock(&inode->i_mutex); | 227 | mutex_unlock(&inode->i_mutex); |
| 227 | reiserfs_write_unlock(inode->i_sb); | 228 | reiserfs_write_unlock_once(inode->i_sb, depth); |
| 228 | return retval; | 229 | return retval; |
| 229 | } | 230 | } |
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index d59c4a65d492..81976ffed7d6 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c | |||
| @@ -668,14 +668,11 @@ xfs_inode_set_reclaim_tag( | |||
| 668 | xfs_perag_put(pag); | 668 | xfs_perag_put(pag); |
| 669 | } | 669 | } |
| 670 | 670 | ||
| 671 | void | 671 | STATIC void |
| 672 | __xfs_inode_clear_reclaim_tag( | 672 | __xfs_inode_clear_reclaim( |
| 673 | xfs_mount_t *mp, | ||
| 674 | xfs_perag_t *pag, | 673 | xfs_perag_t *pag, |
| 675 | xfs_inode_t *ip) | 674 | xfs_inode_t *ip) |
| 676 | { | 675 | { |
| 677 | radix_tree_tag_clear(&pag->pag_ici_root, | ||
| 678 | XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG); | ||
| 679 | pag->pag_ici_reclaimable--; | 676 | pag->pag_ici_reclaimable--; |
| 680 | if (!pag->pag_ici_reclaimable) { | 677 | if (!pag->pag_ici_reclaimable) { |
| 681 | /* clear the reclaim tag from the perag radix tree */ | 678 | /* clear the reclaim tag from the perag radix tree */ |
| @@ -689,6 +686,17 @@ __xfs_inode_clear_reclaim_tag( | |||
| 689 | } | 686 | } |
| 690 | } | 687 | } |
| 691 | 688 | ||
| 689 | void | ||
| 690 | __xfs_inode_clear_reclaim_tag( | ||
| 691 | xfs_mount_t *mp, | ||
| 692 | xfs_perag_t *pag, | ||
| 693 | xfs_inode_t *ip) | ||
| 694 | { | ||
| 695 | radix_tree_tag_clear(&pag->pag_ici_root, | ||
| 696 | XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG); | ||
| 697 | __xfs_inode_clear_reclaim(pag, ip); | ||
| 698 | } | ||
| 699 | |||
| 692 | /* | 700 | /* |
| 693 | * Inodes in different states need to be treated differently, and the return | 701 | * Inodes in different states need to be treated differently, and the return |
| 694 | * value of xfs_iflush is not sufficient to get this right. The following table | 702 | * value of xfs_iflush is not sufficient to get this right. The following table |
| @@ -838,6 +846,7 @@ reclaim: | |||
| 838 | if (!radix_tree_delete(&pag->pag_ici_root, | 846 | if (!radix_tree_delete(&pag->pag_ici_root, |
| 839 | XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino))) | 847 | XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino))) |
| 840 | ASSERT(0); | 848 | ASSERT(0); |
| 849 | __xfs_inode_clear_reclaim(pag, ip); | ||
| 841 | write_unlock(&pag->pag_ici_lock); | 850 | write_unlock(&pag->pag_ici_lock); |
| 842 | 851 | ||
| 843 | /* | 852 | /* |
diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c index ed575fb4b495..7e206fc1fa36 100644 --- a/fs/xfs/xfs_log_cil.c +++ b/fs/xfs/xfs_log_cil.c | |||
| @@ -405,9 +405,15 @@ xlog_cil_push( | |||
| 405 | new_ctx = kmem_zalloc(sizeof(*new_ctx), KM_SLEEP|KM_NOFS); | 405 | new_ctx = kmem_zalloc(sizeof(*new_ctx), KM_SLEEP|KM_NOFS); |
| 406 | new_ctx->ticket = xlog_cil_ticket_alloc(log); | 406 | new_ctx->ticket = xlog_cil_ticket_alloc(log); |
| 407 | 407 | ||
| 408 | /* lock out transaction commit, but don't block on background push */ | 408 | /* |
| 409 | * Lock out transaction commit, but don't block for background pushes | ||
| 410 | * unless we are well over the CIL space limit. See the definition of | ||
| 411 | * XLOG_CIL_HARD_SPACE_LIMIT() for the full explanation of the logic | ||
| 412 | * used here. | ||
| 413 | */ | ||
| 409 | if (!down_write_trylock(&cil->xc_ctx_lock)) { | 414 | if (!down_write_trylock(&cil->xc_ctx_lock)) { |
| 410 | if (!push_seq) | 415 | if (!push_seq && |
| 416 | cil->xc_ctx->space_used < XLOG_CIL_HARD_SPACE_LIMIT(log)) | ||
| 411 | goto out_free_ticket; | 417 | goto out_free_ticket; |
| 412 | down_write(&cil->xc_ctx_lock); | 418 | down_write(&cil->xc_ctx_lock); |
| 413 | } | 419 | } |
| @@ -422,7 +428,7 @@ xlog_cil_push( | |||
| 422 | goto out_skip; | 428 | goto out_skip; |
| 423 | 429 | ||
| 424 | /* check for a previously pushed seqeunce */ | 430 | /* check for a previously pushed seqeunce */ |
| 425 | if (push_seq < cil->xc_ctx->sequence) | 431 | if (push_seq && push_seq < cil->xc_ctx->sequence) |
| 426 | goto out_skip; | 432 | goto out_skip; |
| 427 | 433 | ||
| 428 | /* | 434 | /* |
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h index ced52b98b322..edcdfe01617f 100644 --- a/fs/xfs/xfs_log_priv.h +++ b/fs/xfs/xfs_log_priv.h | |||
| @@ -426,13 +426,13 @@ struct xfs_cil { | |||
| 426 | }; | 426 | }; |
| 427 | 427 | ||
| 428 | /* | 428 | /* |
| 429 | * The amount of log space we should the CIL to aggregate is difficult to size. | 429 | * The amount of log space we allow the CIL to aggregate is difficult to size. |
| 430 | * Whatever we chose we have to make we can get a reservation for the log space | 430 | * Whatever we choose, we have to make sure we can get a reservation for the |
| 431 | * effectively, that it is large enough to capture sufficient relogging to | 431 | * log space effectively, that it is large enough to capture sufficient |
| 432 | * reduce log buffer IO significantly, but it is not too large for the log or | 432 | * relogging to reduce log buffer IO significantly, but it is not too large for |
| 433 | * induces too much latency when writing out through the iclogs. We track both | 433 | * the log or induces too much latency when writing out through the iclogs. We |
| 434 | * space consumed and the number of vectors in the checkpoint context, so we | 434 | * track both space consumed and the number of vectors in the checkpoint |
| 435 | * need to decide which to use for limiting. | 435 | * context, so we need to decide which to use for limiting. |
| 436 | * | 436 | * |
| 437 | * Every log buffer we write out during a push needs a header reserved, which | 437 | * Every log buffer we write out during a push needs a header reserved, which |
| 438 | * is at least one sector and more for v2 logs. Hence we need a reservation of | 438 | * is at least one sector and more for v2 logs. Hence we need a reservation of |
| @@ -459,16 +459,21 @@ struct xfs_cil { | |||
| 459 | * checkpoint transaction ticket is specific to the checkpoint context, rather | 459 | * checkpoint transaction ticket is specific to the checkpoint context, rather |
| 460 | * than the CIL itself. | 460 | * than the CIL itself. |
| 461 | * | 461 | * |
| 462 | * With dynamic reservations, we can basically make up arbitrary limits for the | 462 | * With dynamic reservations, we can effectively make up arbitrary limits for |
| 463 | * checkpoint size so long as they don't violate any other size rules. Hence | 463 | * the checkpoint size so long as they don't violate any other size rules. |
| 464 | * the initial maximum size for the checkpoint transaction will be set to a | 464 | * Recovery imposes a rule that no transaction exceed half the log, so we are |
| 465 | * quarter of the log or 8MB, which ever is smaller. 8MB is an arbitrary limit | 465 | * limited by that. Furthermore, the log transaction reservation subsystem |
| 466 | * right now based on the latency of writing out a large amount of data through | 466 | * tries to keep 25% of the log free, so we need to keep below that limit or we |
| 467 | * the circular iclog buffers. | 467 | * risk running out of free log space to start any new transactions. |
| 468 | * | ||
| 469 | * In order to keep background CIL push efficient, we will set a lower | ||
| 470 | * threshold at which background pushing is attempted without blocking current | ||
| 471 | * transaction commits. A separate, higher bound defines when CIL pushes are | ||
| 472 | * enforced to ensure we stay within our maximum checkpoint size bounds. | ||
| 473 | * threshold, yet give us plenty of space for aggregation on large logs. | ||
| 468 | */ | 474 | */ |
| 469 | 475 | #define XLOG_CIL_SPACE_LIMIT(log) (log->l_logsize >> 3) | |
| 470 | #define XLOG_CIL_SPACE_LIMIT(log) \ | 476 | #define XLOG_CIL_HARD_SPACE_LIMIT(log) (3 * (log->l_logsize >> 4)) |
| 471 | (min((log->l_logsize >> 2), (8 * 1024 * 1024))) | ||
| 472 | 477 | ||
| 473 | /* | 478 | /* |
| 474 | * The reservation head lsn is not made up of a cycle number and block number. | 479 | * The reservation head lsn is not made up of a cycle number and block number. |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index c0786d446a00..984cdc62e30b 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
| @@ -55,7 +55,7 @@ | |||
| 55 | extern u8 acpi_gbl_permanent_mmap; | 55 | extern u8 acpi_gbl_permanent_mmap; |
| 56 | 56 | ||
| 57 | /* | 57 | /* |
| 58 | * Globals that are publically available, allowing for | 58 | * Globals that are publicly available, allowing for |
| 59 | * run time configuration | 59 | * run time configuration |
| 60 | */ | 60 | */ |
| 61 | extern u32 acpi_dbg_level; | 61 | extern u32 acpi_dbg_level; |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 7809d230adee..4c9461a4f9e6 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -612,7 +612,7 @@ struct drm_gem_object { | |||
| 612 | struct kref refcount; | 612 | struct kref refcount; |
| 613 | 613 | ||
| 614 | /** Handle count of this object. Each handle also holds a reference */ | 614 | /** Handle count of this object. Each handle also holds a reference */ |
| 615 | struct kref handlecount; | 615 | atomic_t handle_count; /* number of handles on this object */ |
| 616 | 616 | ||
| 617 | /** Related drm device */ | 617 | /** Related drm device */ |
| 618 | struct drm_device *dev; | 618 | struct drm_device *dev; |
| @@ -808,7 +808,6 @@ struct drm_driver { | |||
| 808 | */ | 808 | */ |
| 809 | int (*gem_init_object) (struct drm_gem_object *obj); | 809 | int (*gem_init_object) (struct drm_gem_object *obj); |
| 810 | void (*gem_free_object) (struct drm_gem_object *obj); | 810 | void (*gem_free_object) (struct drm_gem_object *obj); |
| 811 | void (*gem_free_object_unlocked) (struct drm_gem_object *obj); | ||
| 812 | 811 | ||
| 813 | /* vga arb irq handler */ | 812 | /* vga arb irq handler */ |
| 814 | void (*vgaarb_irq)(struct drm_device *dev, bool state); | 813 | void (*vgaarb_irq)(struct drm_device *dev, bool state); |
| @@ -1175,6 +1174,7 @@ extern int drm_release(struct inode *inode, struct file *filp); | |||
| 1175 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); | 1174 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); |
| 1176 | extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); | 1175 | extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); |
| 1177 | extern void drm_vm_open_locked(struct vm_area_struct *vma); | 1176 | extern void drm_vm_open_locked(struct vm_area_struct *vma); |
| 1177 | extern void drm_vm_close_locked(struct vm_area_struct *vma); | ||
| 1178 | extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map); | 1178 | extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map); |
| 1179 | extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev); | 1179 | extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev); |
| 1180 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); | 1180 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); |
| @@ -1455,12 +1455,11 @@ int drm_gem_init(struct drm_device *dev); | |||
| 1455 | void drm_gem_destroy(struct drm_device *dev); | 1455 | void drm_gem_destroy(struct drm_device *dev); |
| 1456 | void drm_gem_object_release(struct drm_gem_object *obj); | 1456 | void drm_gem_object_release(struct drm_gem_object *obj); |
| 1457 | void drm_gem_object_free(struct kref *kref); | 1457 | void drm_gem_object_free(struct kref *kref); |
| 1458 | void drm_gem_object_free_unlocked(struct kref *kref); | ||
| 1459 | struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev, | 1458 | struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev, |
| 1460 | size_t size); | 1459 | size_t size); |
| 1461 | int drm_gem_object_init(struct drm_device *dev, | 1460 | int drm_gem_object_init(struct drm_device *dev, |
| 1462 | struct drm_gem_object *obj, size_t size); | 1461 | struct drm_gem_object *obj, size_t size); |
| 1463 | void drm_gem_object_handle_free(struct kref *kref); | 1462 | void drm_gem_object_handle_free(struct drm_gem_object *obj); |
| 1464 | void drm_gem_vm_open(struct vm_area_struct *vma); | 1463 | void drm_gem_vm_open(struct vm_area_struct *vma); |
| 1465 | void drm_gem_vm_close(struct vm_area_struct *vma); | 1464 | void drm_gem_vm_close(struct vm_area_struct *vma); |
| 1466 | int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); | 1465 | int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); |
| @@ -1483,8 +1482,12 @@ drm_gem_object_unreference(struct drm_gem_object *obj) | |||
| 1483 | static inline void | 1482 | static inline void |
| 1484 | drm_gem_object_unreference_unlocked(struct drm_gem_object *obj) | 1483 | drm_gem_object_unreference_unlocked(struct drm_gem_object *obj) |
| 1485 | { | 1484 | { |
| 1486 | if (obj != NULL) | 1485 | if (obj != NULL) { |
| 1487 | kref_put(&obj->refcount, drm_gem_object_free_unlocked); | 1486 | struct drm_device *dev = obj->dev; |
| 1487 | mutex_lock(&dev->struct_mutex); | ||
| 1488 | kref_put(&obj->refcount, drm_gem_object_free); | ||
| 1489 | mutex_unlock(&dev->struct_mutex); | ||
| 1490 | } | ||
| 1488 | } | 1491 | } |
| 1489 | 1492 | ||
| 1490 | int drm_gem_handle_create(struct drm_file *file_priv, | 1493 | int drm_gem_handle_create(struct drm_file *file_priv, |
| @@ -1495,7 +1498,7 @@ static inline void | |||
| 1495 | drm_gem_object_handle_reference(struct drm_gem_object *obj) | 1498 | drm_gem_object_handle_reference(struct drm_gem_object *obj) |
| 1496 | { | 1499 | { |
| 1497 | drm_gem_object_reference(obj); | 1500 | drm_gem_object_reference(obj); |
| 1498 | kref_get(&obj->handlecount); | 1501 | atomic_inc(&obj->handle_count); |
| 1499 | } | 1502 | } |
| 1500 | 1503 | ||
| 1501 | static inline void | 1504 | static inline void |
| @@ -1504,12 +1507,15 @@ drm_gem_object_handle_unreference(struct drm_gem_object *obj) | |||
| 1504 | if (obj == NULL) | 1507 | if (obj == NULL) |
| 1505 | return; | 1508 | return; |
| 1506 | 1509 | ||
| 1510 | if (atomic_read(&obj->handle_count) == 0) | ||
| 1511 | return; | ||
| 1507 | /* | 1512 | /* |
| 1508 | * Must bump handle count first as this may be the last | 1513 | * Must bump handle count first as this may be the last |
| 1509 | * ref, in which case the object would disappear before we | 1514 | * ref, in which case the object would disappear before we |
| 1510 | * checked for a name | 1515 | * checked for a name |
| 1511 | */ | 1516 | */ |
| 1512 | kref_put(&obj->handlecount, drm_gem_object_handle_free); | 1517 | if (atomic_dec_and_test(&obj->handle_count)) |
| 1518 | drm_gem_object_handle_free(obj); | ||
| 1513 | drm_gem_object_unreference(obj); | 1519 | drm_gem_object_unreference(obj); |
| 1514 | } | 1520 | } |
| 1515 | 1521 | ||
| @@ -1519,12 +1525,17 @@ drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj) | |||
| 1519 | if (obj == NULL) | 1525 | if (obj == NULL) |
| 1520 | return; | 1526 | return; |
| 1521 | 1527 | ||
| 1528 | if (atomic_read(&obj->handle_count) == 0) | ||
| 1529 | return; | ||
| 1530 | |||
| 1522 | /* | 1531 | /* |
| 1523 | * Must bump handle count first as this may be the last | 1532 | * Must bump handle count first as this may be the last |
| 1524 | * ref, in which case the object would disappear before we | 1533 | * ref, in which case the object would disappear before we |
| 1525 | * checked for a name | 1534 | * checked for a name |
| 1526 | */ | 1535 | */ |
| 1527 | kref_put(&obj->handlecount, drm_gem_object_handle_free); | 1536 | |
| 1537 | if (atomic_dec_and_test(&obj->handle_count)) | ||
| 1538 | drm_gem_object_handle_free(obj); | ||
| 1528 | drm_gem_object_unreference_unlocked(obj); | 1539 | drm_gem_object_unreference_unlocked(obj); |
| 1529 | } | 1540 | } |
| 1530 | 1541 | ||
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index c9f3cc5949a8..3e5a51af757c 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
| @@ -386,7 +386,15 @@ struct drm_connector_funcs { | |||
| 386 | void (*dpms)(struct drm_connector *connector, int mode); | 386 | void (*dpms)(struct drm_connector *connector, int mode); |
| 387 | void (*save)(struct drm_connector *connector); | 387 | void (*save)(struct drm_connector *connector); |
| 388 | void (*restore)(struct drm_connector *connector); | 388 | void (*restore)(struct drm_connector *connector); |
| 389 | enum drm_connector_status (*detect)(struct drm_connector *connector); | 389 | |
| 390 | /* Check to see if anything is attached to the connector. | ||
| 391 | * @force is set to false whilst polling, true when checking the | ||
| 392 | * connector due to user request. @force can be used by the driver | ||
| 393 | * to avoid expensive, destructive operations during automated | ||
| 394 | * probing. | ||
| 395 | */ | ||
| 396 | enum drm_connector_status (*detect)(struct drm_connector *connector, | ||
| 397 | bool force); | ||
| 390 | int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height); | 398 | int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height); |
| 391 | int (*set_property)(struct drm_connector *connector, struct drm_property *property, | 399 | int (*set_property)(struct drm_connector *connector, struct drm_property *property, |
| 392 | uint64_t val); | 400 | uint64_t val); |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index 3a9940ef728b..883c1d439899 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
| @@ -85,7 +85,6 @@ | |||
| 85 | {0x1002, 0x5460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ | 85 | {0x1002, 0x5460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ |
| 86 | {0x1002, 0x5462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ | 86 | {0x1002, 0x5462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ |
| 87 | {0x1002, 0x5464, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ | 87 | {0x1002, 0x5464, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ |
| 88 | {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ | ||
| 89 | {0x1002, 0x5548, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ | 88 | {0x1002, 0x5548, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ |
| 90 | {0x1002, 0x5549, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ | 89 | {0x1002, 0x5549, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ |
| 91 | {0x1002, 0x554A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ | 90 | {0x1002, 0x554A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \ |
| @@ -103,6 +102,7 @@ | |||
| 103 | {0x1002, 0x564F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 102 | {0x1002, 0x564F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 104 | {0x1002, 0x5652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 103 | {0x1002, 0x5652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 105 | {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 104 | {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 105 | {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ | ||
| 106 | {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \ | 106 | {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \ |
| 107 | {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ | 107 | {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ |
| 108 | {0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ | 108 | {0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 267a86c74e2e..2040e6c4f172 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
| @@ -246,9 +246,11 @@ struct ttm_buffer_object { | |||
| 246 | 246 | ||
| 247 | atomic_t reserved; | 247 | atomic_t reserved; |
| 248 | 248 | ||
| 249 | |||
| 250 | /** | 249 | /** |
| 251 | * Members protected by the bo::lock | 250 | * Members protected by the bo::lock |
| 251 | * In addition, setting sync_obj to anything else | ||
| 252 | * than NULL requires bo::reserved to be held. This allows for | ||
| 253 | * checking NULL while reserved but not holding bo::lock. | ||
| 252 | */ | 254 | */ |
| 253 | 255 | ||
| 254 | void *sync_obj_arg; | 256 | void *sync_obj_arg; |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 626b629429ff..4e8ea8c8ec1e 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -118,7 +118,6 @@ header-y += eventpoll.h | |||
| 118 | header-y += ext2_fs.h | 118 | header-y += ext2_fs.h |
| 119 | header-y += fadvise.h | 119 | header-y += fadvise.h |
| 120 | header-y += falloc.h | 120 | header-y += falloc.h |
| 121 | header-y += fanotify.h | ||
| 122 | header-y += fb.h | 121 | header-y += fb.h |
| 123 | header-y += fcntl.h | 122 | header-y += fcntl.h |
| 124 | header-y += fd.h | 123 | header-y += fd.h |
diff --git a/include/linux/coredump.h b/include/linux/coredump.h index 8ba66a9d9022..ba4b85a6d9b8 100644 --- a/include/linux/coredump.h +++ b/include/linux/coredump.h | |||
| @@ -9,37 +9,7 @@ | |||
| 9 | * These are the only things you should do on a core-file: use only these | 9 | * These are the only things you should do on a core-file: use only these |
| 10 | * functions to write out all the necessary info. | 10 | * functions to write out all the necessary info. |
| 11 | */ | 11 | */ |
| 12 | static inline int dump_write(struct file *file, const void *addr, int nr) | 12 | extern int dump_write(struct file *file, const void *addr, int nr); |
| 13 | { | 13 | extern int dump_seek(struct file *file, loff_t off); |
| 14 | return file->f_op->write(file, addr, nr, &file->f_pos) == nr; | ||
| 15 | } | ||
| 16 | |||
| 17 | static inline int dump_seek(struct file *file, loff_t off) | ||
| 18 | { | ||
| 19 | int ret = 1; | ||
| 20 | |||
| 21 | if (file->f_op->llseek && file->f_op->llseek != no_llseek) { | ||
| 22 | if (file->f_op->llseek(file, off, SEEK_CUR) < 0) | ||
| 23 | return 0; | ||
| 24 | } else { | ||
| 25 | char *buf = (char *)get_zeroed_page(GFP_KERNEL); | ||
| 26 | |||
| 27 | if (!buf) | ||
| 28 | return 0; | ||
| 29 | while (off > 0) { | ||
| 30 | unsigned long n = off; | ||
| 31 | |||
| 32 | if (n > PAGE_SIZE) | ||
| 33 | n = PAGE_SIZE; | ||
| 34 | if (!dump_write(file, buf, n)) { | ||
| 35 | ret = 0; | ||
| 36 | break; | ||
| 37 | } | ||
| 38 | off -= n; | ||
| 39 | } | ||
| 40 | free_page((unsigned long)buf); | ||
| 41 | } | ||
| 42 | return ret; | ||
| 43 | } | ||
| 44 | 14 | ||
| 45 | #endif /* _LINUX_COREDUMP_H */ | 15 | #endif /* _LINUX_COREDUMP_H */ |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 36ca9721a0c2..1be416bbbb82 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
| @@ -53,6 +53,7 @@ struct cpuidle_state { | |||
| 53 | #define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ | 53 | #define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ |
| 54 | #define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ | 54 | #define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ |
| 55 | #define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */ | 55 | #define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */ |
| 56 | #define CPUIDLE_FLAG_TLB_FLUSHED (0x200) /* tlb will be flushed */ | ||
| 56 | 57 | ||
| 57 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) | 58 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) |
| 58 | 59 | ||
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index ce29b8151198..ba8319ae5fcc 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
| @@ -102,6 +102,9 @@ static inline u64 dma_get_mask(struct device *dev) | |||
| 102 | return DMA_BIT_MASK(32); | 102 | return DMA_BIT_MASK(32); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | #ifdef ARCH_HAS_DMA_SET_COHERENT_MASK | ||
| 106 | int dma_set_coherent_mask(struct device *dev, u64 mask); | ||
| 107 | #else | ||
| 105 | static inline int dma_set_coherent_mask(struct device *dev, u64 mask) | 108 | static inline int dma_set_coherent_mask(struct device *dev, u64 mask) |
| 106 | { | 109 | { |
| 107 | if (!dma_supported(dev, mask)) | 110 | if (!dma_supported(dev, mask)) |
| @@ -109,6 +112,7 @@ static inline int dma_set_coherent_mask(struct device *dev, u64 mask) | |||
| 109 | dev->coherent_dma_mask = mask; | 112 | dev->coherent_dma_mask = mask; |
| 110 | return 0; | 113 | return 0; |
| 111 | } | 114 | } |
| 115 | #endif | ||
| 112 | 116 | ||
| 113 | extern u64 dma_get_required_mask(struct device *dev); | 117 | extern u64 dma_get_required_mask(struct device *dev); |
| 114 | 118 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index c61d4ca27bcc..e2106495cc11 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -548,7 +548,7 @@ static inline bool dma_dev_has_pq_continue(struct dma_device *dma) | |||
| 548 | return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE; | 548 | return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE; |
| 549 | } | 549 | } |
| 550 | 550 | ||
| 551 | static unsigned short dma_dev_to_maxpq(struct dma_device *dma) | 551 | static inline unsigned short dma_dev_to_maxpq(struct dma_device *dma) |
| 552 | { | 552 | { |
| 553 | return dma->max_pq & ~DMA_HAS_PQ_CONTINUE; | 553 | return dma->max_pq & ~DMA_HAS_PQ_CONTINUE; |
| 554 | } | 554 | } |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 926b50322a46..4fd978e7eb83 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
| @@ -93,6 +93,7 @@ struct elevator_queue | |||
| 93 | struct elevator_type *elevator_type; | 93 | struct elevator_type *elevator_type; |
| 94 | struct mutex sysfs_lock; | 94 | struct mutex sysfs_lock; |
| 95 | struct hlist_head *hash; | 95 | struct hlist_head *hash; |
| 96 | unsigned int registered:1; | ||
| 96 | }; | 97 | }; |
| 97 | 98 | ||
| 98 | /* | 99 | /* |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 76041b614758..63d069bd80b7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1093,6 +1093,10 @@ struct file_lock { | |||
| 1093 | 1093 | ||
| 1094 | #include <linux/fcntl.h> | 1094 | #include <linux/fcntl.h> |
| 1095 | 1095 | ||
| 1096 | /* temporary stubs for BKL removal */ | ||
| 1097 | #define lock_flocks() lock_kernel() | ||
| 1098 | #define unlock_flocks() unlock_kernel() | ||
| 1099 | |||
| 1096 | extern void send_sigio(struct fown_struct *fown, int fd, int band); | 1100 | extern void send_sigio(struct fown_struct *fown, int fd, int band); |
| 1097 | 1101 | ||
| 1098 | #ifdef CONFIG_FILE_LOCKING | 1102 | #ifdef CONFIG_FILE_LOCKING |
diff --git a/include/linux/module.h b/include/linux/module.h index 8a6b9fdc7ffa..aace066bad8f 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -686,17 +686,16 @@ extern int module_sysfs_initialized; | |||
| 686 | 686 | ||
| 687 | 687 | ||
| 688 | #ifdef CONFIG_GENERIC_BUG | 688 | #ifdef CONFIG_GENERIC_BUG |
| 689 | int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, | 689 | void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, |
| 690 | struct module *); | 690 | struct module *); |
| 691 | void module_bug_cleanup(struct module *); | 691 | void module_bug_cleanup(struct module *); |
| 692 | 692 | ||
| 693 | #else /* !CONFIG_GENERIC_BUG */ | 693 | #else /* !CONFIG_GENERIC_BUG */ |
| 694 | 694 | ||
| 695 | static inline int module_bug_finalize(const Elf_Ehdr *hdr, | 695 | static inline void module_bug_finalize(const Elf_Ehdr *hdr, |
| 696 | const Elf_Shdr *sechdrs, | 696 | const Elf_Shdr *sechdrs, |
| 697 | struct module *mod) | 697 | struct module *mod) |
| 698 | { | 698 | { |
| 699 | return 0; | ||
| 700 | } | 699 | } |
| 701 | static inline void module_bug_cleanup(struct module *mod) {} | 700 | static inline void module_bug_cleanup(struct module *mod) {} |
| 702 | #endif /* CONFIG_GENERIC_BUG */ | 701 | #endif /* CONFIG_GENERIC_BUG */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 59d066936ab9..123566912d73 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
| @@ -27,8 +27,6 @@ | |||
| 27 | 27 | ||
| 28 | #define MAX_LINKS 32 | 28 | #define MAX_LINKS 32 |
| 29 | 29 | ||
| 30 | struct net; | ||
| 31 | |||
| 32 | struct sockaddr_nl { | 30 | struct sockaddr_nl { |
| 33 | sa_family_t nl_family; /* AF_NETLINK */ | 31 | sa_family_t nl_family; /* AF_NETLINK */ |
| 34 | unsigned short nl_pad; /* zero */ | 32 | unsigned short nl_pad; /* zero */ |
| @@ -151,6 +149,8 @@ struct nlattr { | |||
| 151 | #include <linux/capability.h> | 149 | #include <linux/capability.h> |
| 152 | #include <linux/skbuff.h> | 150 | #include <linux/skbuff.h> |
| 153 | 151 | ||
| 152 | struct net; | ||
| 153 | |||
| 154 | static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb) | 154 | static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb) |
| 155 | { | 155 | { |
| 156 | return (struct nlmsghdr *)skb->data; | 156 | return (struct nlmsghdr *)skb->data; |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 791d5109f34c..50d8009be86c 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
| @@ -63,20 +63,20 @@ static inline bool netpoll_rx(struct sk_buff *skb) | |||
| 63 | unsigned long flags; | 63 | unsigned long flags; |
| 64 | bool ret = false; | 64 | bool ret = false; |
| 65 | 65 | ||
| 66 | rcu_read_lock_bh(); | 66 | local_irq_save(flags); |
| 67 | npinfo = rcu_dereference_bh(skb->dev->npinfo); | 67 | npinfo = rcu_dereference_bh(skb->dev->npinfo); |
| 68 | 68 | ||
| 69 | if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) | 69 | if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) |
| 70 | goto out; | 70 | goto out; |
| 71 | 71 | ||
| 72 | spin_lock_irqsave(&npinfo->rx_lock, flags); | 72 | spin_lock(&npinfo->rx_lock); |
| 73 | /* check rx_flags again with the lock held */ | 73 | /* check rx_flags again with the lock held */ |
| 74 | if (npinfo->rx_flags && __netpoll_rx(skb)) | 74 | if (npinfo->rx_flags && __netpoll_rx(skb)) |
| 75 | ret = true; | 75 | ret = true; |
| 76 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); | 76 | spin_unlock(&npinfo->rx_lock); |
| 77 | 77 | ||
| 78 | out: | 78 | out: |
| 79 | rcu_read_unlock_bh(); | 79 | local_irq_restore(flags); |
| 80 | return ret; | 80 | return ret; |
| 81 | } | 81 | } |
| 82 | 82 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 10d33309e9a6..570fddeb0388 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -393,6 +393,9 @@ | |||
| 393 | #define PCI_DEVICE_ID_VLSI_82C147 0x0105 | 393 | #define PCI_DEVICE_ID_VLSI_82C147 0x0105 |
| 394 | #define PCI_DEVICE_ID_VLSI_VAS96011 0x0702 | 394 | #define PCI_DEVICE_ID_VLSI_VAS96011 0x0702 |
| 395 | 395 | ||
| 396 | /* AMD RD890 Chipset */ | ||
| 397 | #define PCI_DEVICE_ID_RD890_IOMMU 0x5a23 | ||
| 398 | |||
| 396 | #define PCI_VENDOR_ID_ADL 0x1005 | 399 | #define PCI_VENDOR_ID_ADL 0x1005 |
| 397 | #define PCI_DEVICE_ID_ADL_2301 0x2301 | 400 | #define PCI_DEVICE_ID_ADL_2301 0x2301 |
| 398 | 401 | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 9fbc54a2585d..83af1f8d8b74 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -454,7 +454,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
| 454 | * Makes rcu_dereference_check() do the dirty work. | 454 | * Makes rcu_dereference_check() do the dirty work. |
| 455 | */ | 455 | */ |
| 456 | #define rcu_dereference_bh(p) \ | 456 | #define rcu_dereference_bh(p) \ |
| 457 | rcu_dereference_check(p, rcu_read_lock_bh_held()) | 457 | rcu_dereference_check(p, rcu_read_lock_bh_held() || irqs_disabled()) |
| 458 | 458 | ||
| 459 | /** | 459 | /** |
| 460 | * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched | 460 | * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched |
diff --git a/include/linux/socket.h b/include/linux/socket.h index a2fada9becb6..a8f56e1ec760 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -322,7 +322,7 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | |||
| 322 | int offset, | 322 | int offset, |
| 323 | unsigned int len, __wsum *csump); | 323 | unsigned int len, __wsum *csump); |
| 324 | 324 | ||
| 325 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); | 325 | extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); |
| 326 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); | 326 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); |
| 327 | extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, | 327 | extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, |
| 328 | int offset, int len); | 328 | int offset, int len); |
diff --git a/include/linux/types.h b/include/linux/types.h index 01a082f56ef4..357dbc19606f 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
| @@ -121,7 +121,15 @@ typedef __u64 u_int64_t; | |||
| 121 | typedef __s64 int64_t; | 121 | typedef __s64 int64_t; |
| 122 | #endif | 122 | #endif |
| 123 | 123 | ||
| 124 | /* this is a special 64bit data type that is 8-byte aligned */ | 124 | /* |
| 125 | * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid | ||
| 126 | * common 32/64-bit compat problems. | ||
| 127 | * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other | ||
| 128 | * architectures) and to 8-byte boundaries on 64-bit architetures. The new | ||
| 129 | * aligned_64 type enforces 8-byte alignment so that structs containing | ||
| 130 | * aligned_64 values have the same alignment on 32-bit and 64-bit architectures. | ||
| 131 | * No conversions are necessary between 32-bit user-space and a 64-bit kernel. | ||
| 132 | */ | ||
| 125 | #define aligned_u64 __u64 __attribute__((aligned(8))) | 133 | #define aligned_u64 __u64 __attribute__((aligned(8))) |
| 126 | #define aligned_be64 __be64 __attribute__((aligned(8))) | 134 | #define aligned_be64 __be64 __attribute__((aligned(8))) |
| 127 | #define aligned_le64 __le64 __attribute__((aligned(8))) | 135 | #define aligned_le64 __le64 __attribute__((aligned(8))) |
| @@ -178,6 +186,11 @@ typedef __u64 __bitwise __be64; | |||
| 178 | typedef __u16 __bitwise __sum16; | 186 | typedef __u16 __bitwise __sum16; |
| 179 | typedef __u32 __bitwise __wsum; | 187 | typedef __u32 __bitwise __wsum; |
| 180 | 188 | ||
| 189 | /* this is a special 64bit data type that is 8-byte aligned */ | ||
| 190 | #define __aligned_u64 __u64 __attribute__((aligned(8))) | ||
| 191 | #define __aligned_be64 __be64 __attribute__((aligned(8))) | ||
| 192 | #define __aligned_le64 __le64 __attribute__((aligned(8))) | ||
| 193 | |||
| 181 | #ifdef __KERNEL__ | 194 | #ifdef __KERNEL__ |
| 182 | typedef unsigned __bitwise__ gfp_t; | 195 | typedef unsigned __bitwise__ gfp_t; |
| 183 | typedef unsigned __bitwise__ fmode_t; | 196 | typedef unsigned __bitwise__ fmode_t; |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 0836ccc57121..3efc9f3f43a0 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -614,6 +614,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |||
| 614 | (wait)->private = current; \ | 614 | (wait)->private = current; \ |
| 615 | (wait)->func = autoremove_wake_function; \ | 615 | (wait)->func = autoremove_wake_function; \ |
| 616 | INIT_LIST_HEAD(&(wait)->task_list); \ | 616 | INIT_LIST_HEAD(&(wait)->task_list); \ |
| 617 | (wait)->flags = 0; \ | ||
| 617 | } while (0) | 618 | } while (0) |
| 618 | 619 | ||
| 619 | /** | 620 | /** |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index f11100f96482..25e02c941bac 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -235,6 +235,10 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
| 235 | #define work_clear_pending(work) \ | 235 | #define work_clear_pending(work) \ |
| 236 | clear_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work)) | 236 | clear_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work)) |
| 237 | 237 | ||
| 238 | /* | ||
| 239 | * Workqueue flags and constants. For details, please refer to | ||
| 240 | * Documentation/workqueue.txt. | ||
| 241 | */ | ||
| 238 | enum { | 242 | enum { |
| 239 | WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ | 243 | WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ |
| 240 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ | 244 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ |
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h index 97e07f46a0fa..aa4ebb42a565 100644 --- a/include/media/videobuf-dma-sg.h +++ b/include/media/videobuf-dma-sg.h | |||
| @@ -48,6 +48,7 @@ struct videobuf_dmabuf { | |||
| 48 | 48 | ||
| 49 | /* for userland buffer */ | 49 | /* for userland buffer */ |
| 50 | int offset; | 50 | int offset; |
| 51 | size_t size; | ||
| 51 | struct page **pages; | 52 | struct page **pages; |
| 52 | 53 | ||
| 53 | /* for kernel buffers */ | 54 | /* for kernel buffers */ |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 45375b41a2a0..4d40c4d0230b 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
| @@ -121,6 +121,7 @@ static inline int addrconf_finite_timeout(unsigned long timeout) | |||
| 121 | * IPv6 Address Label subsystem (addrlabel.c) | 121 | * IPv6 Address Label subsystem (addrlabel.c) |
| 122 | */ | 122 | */ |
| 123 | extern int ipv6_addr_label_init(void); | 123 | extern int ipv6_addr_label_init(void); |
| 124 | extern void ipv6_addr_label_cleanup(void); | ||
| 124 | extern void ipv6_addr_label_rtnl_register(void); | 125 | extern void ipv6_addr_label_rtnl_register(void); |
| 125 | extern u32 ipv6_addr_label(struct net *net, | 126 | extern u32 ipv6_addr_label(struct net *net, |
| 126 | const struct in6_addr *addr, | 127 | const struct in6_addr *addr, |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 27a902d9b3a9..30fce0128dd7 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -161,12 +161,30 @@ static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, unsigned long l | |||
| 161 | { | 161 | { |
| 162 | struct sk_buff *skb; | 162 | struct sk_buff *skb; |
| 163 | 163 | ||
| 164 | release_sock(sk); | ||
| 164 | if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) { | 165 | if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) { |
| 165 | skb_reserve(skb, BT_SKB_RESERVE); | 166 | skb_reserve(skb, BT_SKB_RESERVE); |
| 166 | bt_cb(skb)->incoming = 0; | 167 | bt_cb(skb)->incoming = 0; |
| 167 | } | 168 | } |
| 169 | lock_sock(sk); | ||
| 170 | |||
| 171 | if (!skb && *err) | ||
| 172 | return NULL; | ||
| 173 | |||
| 174 | *err = sock_error(sk); | ||
| 175 | if (*err) | ||
| 176 | goto out; | ||
| 177 | |||
| 178 | if (sk->sk_shutdown) { | ||
| 179 | *err = -ECONNRESET; | ||
| 180 | goto out; | ||
| 181 | } | ||
| 168 | 182 | ||
| 169 | return skb; | 183 | return skb; |
| 184 | |||
| 185 | out: | ||
| 186 | kfree_skb(skb); | ||
| 187 | return NULL; | ||
| 170 | } | 188 | } |
| 171 | 189 | ||
| 172 | int bt_err(__u16 code); | 190 | int bt_err(__u16 code); |
diff --git a/include/net/dst.h b/include/net/dst.h index 81d1413a8701..02386505033d 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -242,6 +242,7 @@ static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) | |||
| 242 | dev->stats.rx_packets++; | 242 | dev->stats.rx_packets++; |
| 243 | dev->stats.rx_bytes += skb->len; | 243 | dev->stats.rx_bytes += skb->len; |
| 244 | skb->rxhash = 0; | 244 | skb->rxhash = 0; |
| 245 | skb_set_queue_mapping(skb, 0); | ||
| 245 | skb_dst_drop(skb); | 246 | skb_dst_drop(skb); |
| 246 | nf_reset(skb); | 247 | nf_reset(skb); |
| 247 | } | 248 | } |
diff --git a/include/net/route.h b/include/net/route.h index bd732d62e1c3..7e5e73bfa4de 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -199,6 +199,8 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol, | |||
| 199 | fl.fl_ip_sport = sport; | 199 | fl.fl_ip_sport = sport; |
| 200 | fl.fl_ip_dport = dport; | 200 | fl.fl_ip_dport = dport; |
| 201 | fl.proto = protocol; | 201 | fl.proto = protocol; |
| 202 | if (inet_sk(sk)->transparent) | ||
| 203 | fl.flags |= FLOWI_FLAG_ANYSRC; | ||
| 202 | ip_rt_put(*rp); | 204 | ip_rt_put(*rp); |
| 203 | *rp = NULL; | 205 | *rp = NULL; |
| 204 | security_sk_classify_flow(sk, &fl); | 206 | security_sk_classify_flow(sk, &fl); |
diff --git a/include/net/tcp.h b/include/net/tcp.h index eaa9582779d0..3e4b33e36602 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -475,8 +475,22 @@ extern unsigned int tcp_current_mss(struct sock *sk); | |||
| 475 | /* Bound MSS / TSO packet size with the half of the window */ | 475 | /* Bound MSS / TSO packet size with the half of the window */ |
| 476 | static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) | 476 | static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) |
| 477 | { | 477 | { |
| 478 | if (tp->max_window && pktsize > (tp->max_window >> 1)) | 478 | int cutoff; |
| 479 | return max(tp->max_window >> 1, 68U - tp->tcp_header_len); | 479 | |
| 480 | /* When peer uses tiny windows, there is no use in packetizing | ||
| 481 | * to sub-MSS pieces for the sake of SWS or making sure there | ||
| 482 | * are enough packets in the pipe for fast recovery. | ||
| 483 | * | ||
| 484 | * On the other hand, for extremely large MSS devices, handling | ||
| 485 | * smaller than MSS windows in this way does make sense. | ||
| 486 | */ | ||
| 487 | if (tp->max_window >= 512) | ||
| 488 | cutoff = (tp->max_window >> 1); | ||
| 489 | else | ||
| 490 | cutoff = tp->max_window; | ||
| 491 | |||
| 492 | if (cutoff && pktsize > cutoff) | ||
| 493 | return max_t(int, cutoff, 68U - tp->tcp_header_len); | ||
| 480 | else | 494 | else |
| 481 | return pktsize; | 495 | return pktsize; |
| 482 | } | 496 | } |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index fc8f36dd0f5c..4f53532d4c2f 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -298,8 +298,8 @@ struct xfrm_state_afinfo { | |||
| 298 | const struct xfrm_type *type_map[IPPROTO_MAX]; | 298 | const struct xfrm_type *type_map[IPPROTO_MAX]; |
| 299 | struct xfrm_mode *mode_map[XFRM_MODE_MAX]; | 299 | struct xfrm_mode *mode_map[XFRM_MODE_MAX]; |
| 300 | int (*init_flags)(struct xfrm_state *x); | 300 | int (*init_flags)(struct xfrm_state *x); |
| 301 | void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, | 301 | void (*init_tempsel)(struct xfrm_selector *sel, struct flowi *fl); |
| 302 | struct xfrm_tmpl *tmpl, | 302 | void (*init_temprop)(struct xfrm_state *x, struct xfrm_tmpl *tmpl, |
| 303 | xfrm_address_t *daddr, xfrm_address_t *saddr); | 303 | xfrm_address_t *daddr, xfrm_address_t *saddr); |
| 304 | int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n); | 304 | int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n); |
| 305 | int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n); | 305 | int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n); |
| @@ -743,6 +743,8 @@ static unsigned long copy_semid_to_user(void __user *buf, struct semid64_ds *in, | |||
| 743 | { | 743 | { |
| 744 | struct semid_ds out; | 744 | struct semid_ds out; |
| 745 | 745 | ||
| 746 | memset(&out, 0, sizeof(out)); | ||
| 747 | |||
| 746 | ipc64_perm_to_ipc_perm(&in->sem_perm, &out.sem_perm); | 748 | ipc64_perm_to_ipc_perm(&in->sem_perm, &out.sem_perm); |
| 747 | 749 | ||
| 748 | out.sem_otime = in->sem_otime; | 750 | out.sem_otime = in->sem_otime; |
diff --git a/kernel/fork.c b/kernel/fork.c index b7e9d60a675d..c445f8cc408d 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
| @@ -356,10 +356,10 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) | |||
| 356 | if (IS_ERR(pol)) | 356 | if (IS_ERR(pol)) |
| 357 | goto fail_nomem_policy; | 357 | goto fail_nomem_policy; |
| 358 | vma_set_policy(tmp, pol); | 358 | vma_set_policy(tmp, pol); |
| 359 | tmp->vm_mm = mm; | ||
| 359 | if (anon_vma_fork(tmp, mpnt)) | 360 | if (anon_vma_fork(tmp, mpnt)) |
| 360 | goto fail_nomem_anon_vma_fork; | 361 | goto fail_nomem_anon_vma_fork; |
| 361 | tmp->vm_flags &= ~VM_LOCKED; | 362 | tmp->vm_flags &= ~VM_LOCKED; |
| 362 | tmp->vm_mm = mm; | ||
| 363 | tmp->vm_next = tmp->vm_prev = NULL; | 363 | tmp->vm_next = tmp->vm_prev = NULL; |
| 364 | file = tmp->vm_file; | 364 | file = tmp->vm_file; |
| 365 | if (file) { | 365 | if (file) { |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 1decafbb6b1a..72206cf5c6cf 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
| @@ -931,6 +931,7 @@ static inline int | |||
| 931 | remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base) | 931 | remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base) |
| 932 | { | 932 | { |
| 933 | if (hrtimer_is_queued(timer)) { | 933 | if (hrtimer_is_queued(timer)) { |
| 934 | unsigned long state; | ||
| 934 | int reprogram; | 935 | int reprogram; |
| 935 | 936 | ||
| 936 | /* | 937 | /* |
| @@ -944,8 +945,13 @@ remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base) | |||
| 944 | debug_deactivate(timer); | 945 | debug_deactivate(timer); |
| 945 | timer_stats_hrtimer_clear_start_info(timer); | 946 | timer_stats_hrtimer_clear_start_info(timer); |
| 946 | reprogram = base->cpu_base == &__get_cpu_var(hrtimer_bases); | 947 | reprogram = base->cpu_base == &__get_cpu_var(hrtimer_bases); |
| 947 | __remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, | 948 | /* |
| 948 | reprogram); | 949 | * We must preserve the CALLBACK state flag here, |
| 950 | * otherwise we could move the timer base in | ||
| 951 | * switch_hrtimer_base. | ||
| 952 | */ | ||
| 953 | state = timer->state & HRTIMER_STATE_CALLBACK; | ||
| 954 | __remove_hrtimer(timer, base, state, reprogram); | ||
| 949 | return 1; | 955 | return 1; |
| 950 | } | 956 | } |
| 951 | return 0; | 957 | return 0; |
| @@ -1231,6 +1237,9 @@ static void __run_hrtimer(struct hrtimer *timer, ktime_t *now) | |||
| 1231 | BUG_ON(timer->state != HRTIMER_STATE_CALLBACK); | 1237 | BUG_ON(timer->state != HRTIMER_STATE_CALLBACK); |
| 1232 | enqueue_hrtimer(timer, base); | 1238 | enqueue_hrtimer(timer, base); |
| 1233 | } | 1239 | } |
| 1240 | |||
| 1241 | WARN_ON_ONCE(!(timer->state & HRTIMER_STATE_CALLBACK)); | ||
| 1242 | |||
| 1234 | timer->state &= ~HRTIMER_STATE_CALLBACK; | 1243 | timer->state &= ~HRTIMER_STATE_CALLBACK; |
| 1235 | } | 1244 | } |
| 1236 | 1245 | ||
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c index d71a987fd2bf..c7c2aed9e2dc 100644 --- a/kernel/hw_breakpoint.c +++ b/kernel/hw_breakpoint.c | |||
| @@ -433,7 +433,8 @@ register_user_hw_breakpoint(struct perf_event_attr *attr, | |||
| 433 | perf_overflow_handler_t triggered, | 433 | perf_overflow_handler_t triggered, |
| 434 | struct task_struct *tsk) | 434 | struct task_struct *tsk) |
| 435 | { | 435 | { |
| 436 | return perf_event_create_kernel_counter(attr, -1, tsk->pid, triggered); | 436 | return perf_event_create_kernel_counter(attr, -1, task_pid_vnr(tsk), |
| 437 | triggered); | ||
| 437 | } | 438 | } |
| 438 | EXPORT_SYMBOL_GPL(register_user_hw_breakpoint); | 439 | EXPORT_SYMBOL_GPL(register_user_hw_breakpoint); |
| 439 | 440 | ||
diff --git a/kernel/kfifo.c b/kernel/kfifo.c index 6b5580c57644..01a0700e873f 100644 --- a/kernel/kfifo.c +++ b/kernel/kfifo.c | |||
| @@ -365,8 +365,6 @@ static unsigned int setup_sgl(struct __kfifo *fifo, struct scatterlist *sgl, | |||
| 365 | n = setup_sgl_buf(sgl, fifo->data + off, nents, l); | 365 | n = setup_sgl_buf(sgl, fifo->data + off, nents, l); |
| 366 | n += setup_sgl_buf(sgl + n, fifo->data, nents - n, len - l); | 366 | n += setup_sgl_buf(sgl + n, fifo->data, nents - n, len - l); |
| 367 | 367 | ||
| 368 | if (n) | ||
| 369 | sg_mark_end(sgl + n - 1); | ||
| 370 | return n; | 368 | return n; |
| 371 | } | 369 | } |
| 372 | 370 | ||
diff --git a/kernel/module.c b/kernel/module.c index d0b5f8db11b4..ccd641991842 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -1537,6 +1537,7 @@ static int __unlink_module(void *_mod) | |||
| 1537 | { | 1537 | { |
| 1538 | struct module *mod = _mod; | 1538 | struct module *mod = _mod; |
| 1539 | list_del(&mod->list); | 1539 | list_del(&mod->list); |
| 1540 | module_bug_cleanup(mod); | ||
| 1540 | return 0; | 1541 | return 0; |
| 1541 | } | 1542 | } |
| 1542 | 1543 | ||
| @@ -2625,6 +2626,7 @@ static struct module *load_module(void __user *umod, | |||
| 2625 | if (err < 0) | 2626 | if (err < 0) |
| 2626 | goto ddebug; | 2627 | goto ddebug; |
| 2627 | 2628 | ||
| 2629 | module_bug_finalize(info.hdr, info.sechdrs, mod); | ||
| 2628 | list_add_rcu(&mod->list, &modules); | 2630 | list_add_rcu(&mod->list, &modules); |
| 2629 | mutex_unlock(&module_mutex); | 2631 | mutex_unlock(&module_mutex); |
| 2630 | 2632 | ||
| @@ -2650,6 +2652,8 @@ static struct module *load_module(void __user *umod, | |||
| 2650 | mutex_lock(&module_mutex); | 2652 | mutex_lock(&module_mutex); |
| 2651 | /* Unlink carefully: kallsyms could be walking list. */ | 2653 | /* Unlink carefully: kallsyms could be walking list. */ |
| 2652 | list_del_rcu(&mod->list); | 2654 | list_del_rcu(&mod->list); |
| 2655 | module_bug_cleanup(mod); | ||
| 2656 | |||
| 2653 | ddebug: | 2657 | ddebug: |
| 2654 | if (!mod->taints) | 2658 | if (!mod->taints) |
| 2655 | dynamic_debug_remove(info.debug); | 2659 | dynamic_debug_remove(info.debug); |
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index db5b56064687..b98bed3d8182 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
| @@ -2202,15 +2202,13 @@ static void perf_event_for_each(struct perf_event *event, | |||
| 2202 | static int perf_event_period(struct perf_event *event, u64 __user *arg) | 2202 | static int perf_event_period(struct perf_event *event, u64 __user *arg) |
| 2203 | { | 2203 | { |
| 2204 | struct perf_event_context *ctx = event->ctx; | 2204 | struct perf_event_context *ctx = event->ctx; |
| 2205 | unsigned long size; | ||
| 2206 | int ret = 0; | 2205 | int ret = 0; |
| 2207 | u64 value; | 2206 | u64 value; |
| 2208 | 2207 | ||
| 2209 | if (!event->attr.sample_period) | 2208 | if (!event->attr.sample_period) |
| 2210 | return -EINVAL; | 2209 | return -EINVAL; |
| 2211 | 2210 | ||
| 2212 | size = copy_from_user(&value, arg, sizeof(value)); | 2211 | if (copy_from_user(&value, arg, sizeof(value))) |
| 2213 | if (size != sizeof(value)) | ||
| 2214 | return -EFAULT; | 2212 | return -EFAULT; |
| 2215 | 2213 | ||
| 2216 | if (!value) | 2214 | if (!value) |
diff --git a/kernel/sched.c b/kernel/sched.c index ed09d4f2a69c..dc85ceb90832 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -3513,9 +3513,9 @@ void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st) | |||
| 3513 | rtime = nsecs_to_cputime(p->se.sum_exec_runtime); | 3513 | rtime = nsecs_to_cputime(p->se.sum_exec_runtime); |
| 3514 | 3514 | ||
| 3515 | if (total) { | 3515 | if (total) { |
| 3516 | u64 temp; | 3516 | u64 temp = rtime; |
| 3517 | 3517 | ||
| 3518 | temp = (u64)(rtime * utime); | 3518 | temp *= utime; |
| 3519 | do_div(temp, total); | 3519 | do_div(temp, total); |
| 3520 | utime = (cputime_t)temp; | 3520 | utime = (cputime_t)temp; |
| 3521 | } else | 3521 | } else |
| @@ -3546,9 +3546,9 @@ void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st) | |||
| 3546 | rtime = nsecs_to_cputime(cputime.sum_exec_runtime); | 3546 | rtime = nsecs_to_cputime(cputime.sum_exec_runtime); |
| 3547 | 3547 | ||
| 3548 | if (total) { | 3548 | if (total) { |
| 3549 | u64 temp; | 3549 | u64 temp = rtime; |
| 3550 | 3550 | ||
| 3551 | temp = (u64)(rtime * cputime.utime); | 3551 | temp *= cputime.utime; |
| 3552 | do_div(temp, total); | 3552 | do_div(temp, total); |
| 3553 | utime = (cputime_t)temp; | 3553 | utime = (cputime_t)temp; |
| 3554 | } else | 3554 | } else |
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index a171138a9402..db3f674ca49d 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
| @@ -3630,7 +3630,7 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu) | |||
| 3630 | if (time_before(now, nohz.next_balance)) | 3630 | if (time_before(now, nohz.next_balance)) |
| 3631 | return 0; | 3631 | return 0; |
| 3632 | 3632 | ||
| 3633 | if (!rq->nr_running) | 3633 | if (rq->idle_at_tick) |
| 3634 | return 0; | 3634 | return 0; |
| 3635 | 3635 | ||
| 3636 | first_pick_cpu = atomic_read(&nohz.first_pick_cpu); | 3636 | first_pick_cpu = atomic_read(&nohz.first_pick_cpu); |
diff --git a/kernel/signal.c b/kernel/signal.c index bded65187780..919562c3d6b7 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
| @@ -2215,6 +2215,14 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from) | |||
| 2215 | #ifdef __ARCH_SI_TRAPNO | 2215 | #ifdef __ARCH_SI_TRAPNO |
| 2216 | err |= __put_user(from->si_trapno, &to->si_trapno); | 2216 | err |= __put_user(from->si_trapno, &to->si_trapno); |
| 2217 | #endif | 2217 | #endif |
| 2218 | #ifdef BUS_MCEERR_AO | ||
| 2219 | /* | ||
| 2220 | * Other callers might not initialize the si_lsb field, | ||
| 2221 | * so check explicitely for the right codes here. | ||
| 2222 | */ | ||
| 2223 | if (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO) | ||
| 2224 | err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb); | ||
| 2225 | #endif | ||
| 2218 | break; | 2226 | break; |
| 2219 | case __SI_CHLD: | 2227 | case __SI_CHLD: |
| 2220 | err |= __put_user(from->si_pid, &to->si_pid); | 2228 | err |= __put_user(from->si_pid, &to->si_pid); |
diff --git a/kernel/smp.c b/kernel/smp.c index 75c970c715d3..ed6aacfcb7ef 100644 --- a/kernel/smp.c +++ b/kernel/smp.c | |||
| @@ -365,9 +365,10 @@ call: | |||
| 365 | EXPORT_SYMBOL_GPL(smp_call_function_any); | 365 | EXPORT_SYMBOL_GPL(smp_call_function_any); |
| 366 | 366 | ||
| 367 | /** | 367 | /** |
| 368 | * __smp_call_function_single(): Run a function on another CPU | 368 | * __smp_call_function_single(): Run a function on a specific CPU |
| 369 | * @cpu: The CPU to run on. | 369 | * @cpu: The CPU to run on. |
| 370 | * @data: Pre-allocated and setup data structure | 370 | * @data: Pre-allocated and setup data structure |
| 371 | * @wait: If true, wait until function has completed on specified CPU. | ||
| 371 | * | 372 | * |
| 372 | * Like smp_call_function_single(), but allow caller to pass in a | 373 | * Like smp_call_function_single(), but allow caller to pass in a |
| 373 | * pre-allocated data structure. Useful for embedding @data inside | 374 | * pre-allocated data structure. Useful for embedding @data inside |
| @@ -376,8 +377,10 @@ EXPORT_SYMBOL_GPL(smp_call_function_any); | |||
| 376 | void __smp_call_function_single(int cpu, struct call_single_data *data, | 377 | void __smp_call_function_single(int cpu, struct call_single_data *data, |
| 377 | int wait) | 378 | int wait) |
| 378 | { | 379 | { |
| 379 | csd_lock(data); | 380 | unsigned int this_cpu; |
| 381 | unsigned long flags; | ||
| 380 | 382 | ||
| 383 | this_cpu = get_cpu(); | ||
| 381 | /* | 384 | /* |
| 382 | * Can deadlock when called with interrupts disabled. | 385 | * Can deadlock when called with interrupts disabled. |
| 383 | * We allow cpu's that are not yet online though, as no one else can | 386 | * We allow cpu's that are not yet online though, as no one else can |
| @@ -387,7 +390,15 @@ void __smp_call_function_single(int cpu, struct call_single_data *data, | |||
| 387 | WARN_ON_ONCE(cpu_online(smp_processor_id()) && wait && irqs_disabled() | 390 | WARN_ON_ONCE(cpu_online(smp_processor_id()) && wait && irqs_disabled() |
| 388 | && !oops_in_progress); | 391 | && !oops_in_progress); |
| 389 | 392 | ||
| 390 | generic_exec_single(cpu, data, wait); | 393 | if (cpu == this_cpu) { |
| 394 | local_irq_save(flags); | ||
| 395 | data->func(data->info); | ||
| 396 | local_irq_restore(flags); | ||
| 397 | } else { | ||
| 398 | csd_lock(data); | ||
| 399 | generic_exec_single(cpu, data, wait); | ||
| 400 | } | ||
| 401 | put_cpu(); | ||
| 391 | } | 402 | } |
| 392 | 403 | ||
| 393 | /** | 404 | /** |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index f88552c6d227..3a45c224770f 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -2485,7 +2485,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int | |||
| 2485 | kbuf[left] = 0; | 2485 | kbuf[left] = 0; |
| 2486 | } | 2486 | } |
| 2487 | 2487 | ||
| 2488 | for (; left && vleft--; i++, min++, max++, first=0) { | 2488 | for (; left && vleft--; i++, first = 0) { |
| 2489 | unsigned long val; | 2489 | unsigned long val; |
| 2490 | 2490 | ||
| 2491 | if (write) { | 2491 | if (write) { |
diff --git a/kernel/sysctl_check.c b/kernel/sysctl_check.c index 04cdcf72c827..10b90d8a03c4 100644 --- a/kernel/sysctl_check.c +++ b/kernel/sysctl_check.c | |||
| @@ -143,15 +143,6 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) | |||
| 143 | if (!table->maxlen) | 143 | if (!table->maxlen) |
| 144 | set_fail(&fail, table, "No maxlen"); | 144 | set_fail(&fail, table, "No maxlen"); |
| 145 | } | 145 | } |
| 146 | if ((table->proc_handler == proc_doulongvec_minmax) || | ||
| 147 | (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) { | ||
| 148 | if (table->maxlen > sizeof (unsigned long)) { | ||
| 149 | if (!table->extra1) | ||
| 150 | set_fail(&fail, table, "No min"); | ||
| 151 | if (!table->extra2) | ||
| 152 | set_fail(&fail, table, "No max"); | ||
| 153 | } | ||
| 154 | } | ||
| 155 | #ifdef CONFIG_PROC_SYSCTL | 146 | #ifdef CONFIG_PROC_SYSCTL |
| 156 | if (table->procname && !table->proc_handler) | 147 | if (table->procname && !table->proc_handler) |
| 157 | set_fail(&fail, table, "No proc_handler"); | 148 | set_fail(&fail, table, "No proc_handler"); |
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 492197e2f86c..bca96377fd4e 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
| @@ -405,7 +405,7 @@ static inline int test_time_stamp(u64 delta) | |||
| 405 | #define BUF_MAX_DATA_SIZE (BUF_PAGE_SIZE - (sizeof(u32) * 2)) | 405 | #define BUF_MAX_DATA_SIZE (BUF_PAGE_SIZE - (sizeof(u32) * 2)) |
| 406 | 406 | ||
| 407 | /* Max number of timestamps that can fit on a page */ | 407 | /* Max number of timestamps that can fit on a page */ |
| 408 | #define RB_TIMESTAMPS_PER_PAGE (BUF_PAGE_SIZE / RB_LEN_TIME_STAMP) | 408 | #define RB_TIMESTAMPS_PER_PAGE (BUF_PAGE_SIZE / RB_LEN_TIME_EXTEND) |
| 409 | 409 | ||
| 410 | int ring_buffer_print_page_header(struct trace_seq *s) | 410 | int ring_buffer_print_page_header(struct trace_seq *s) |
| 411 | { | 411 | { |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 727f24e563ae..f77afd939229 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -1,19 +1,26 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/kernel/workqueue.c | 2 | * kernel/workqueue.c - generic async execution with shared worker pool |
| 3 | * | 3 | * |
| 4 | * Generic mechanism for defining kernel helper threads for running | 4 | * Copyright (C) 2002 Ingo Molnar |
| 5 | * arbitrary tasks in process context. | ||
| 6 | * | 5 | * |
| 7 | * Started by Ingo Molnar, Copyright (C) 2002 | 6 | * Derived from the taskqueue/keventd code by: |
| 7 | * David Woodhouse <dwmw2@infradead.org> | ||
| 8 | * Andrew Morton | ||
| 9 | * Kai Petzke <wpp@marie.physik.tu-berlin.de> | ||
| 10 | * Theodore Ts'o <tytso@mit.edu> | ||
| 8 | * | 11 | * |
| 9 | * Derived from the taskqueue/keventd code by: | 12 | * Made to use alloc_percpu by Christoph Lameter. |
| 10 | * | 13 | * |
| 11 | * David Woodhouse <dwmw2@infradead.org> | 14 | * Copyright (C) 2010 SUSE Linux Products GmbH |
| 12 | * Andrew Morton | 15 | * Copyright (C) 2010 Tejun Heo <tj@kernel.org> |
| 13 | * Kai Petzke <wpp@marie.physik.tu-berlin.de> | ||
| 14 | * Theodore Ts'o <tytso@mit.edu> | ||
| 15 | * | 16 | * |
| 16 | * Made to use alloc_percpu by Christoph Lameter. | 17 | * This is the generic async execution mechanism. Work items as are |
| 18 | * executed in process context. The worker pool is shared and | ||
| 19 | * automatically managed. There is one worker pool for each CPU and | ||
| 20 | * one extra for works which are better served by workers which are | ||
| 21 | * not bound to any specific CPU. | ||
| 22 | * | ||
| 23 | * Please read Documentation/workqueue.txt for details. | ||
| 17 | */ | 24 | */ |
| 18 | 25 | ||
| 19 | #include <linux/module.h> | 26 | #include <linux/module.h> |
| @@ -72,8 +72,8 @@ static const struct bug_entry *module_find_bug(unsigned long bugaddr) | |||
| 72 | return NULL; | 72 | return NULL; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | int module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, | 75 | void module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, |
| 76 | struct module *mod) | 76 | struct module *mod) |
| 77 | { | 77 | { |
| 78 | char *secstrings; | 78 | char *secstrings; |
| 79 | unsigned int i; | 79 | unsigned int i; |
| @@ -97,8 +97,6 @@ int module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, | |||
| 97 | * could potentially lead to deadlock and thus be counter-productive. | 97 | * could potentially lead to deadlock and thus be counter-productive. |
| 98 | */ | 98 | */ |
| 99 | list_add(&mod->bug_list, &module_bug_list); | 99 | list_add(&mod->bug_list, &module_bug_list); |
| 100 | |||
| 101 | return 0; | ||
| 102 | } | 100 | } |
| 103 | 101 | ||
| 104 | void module_bug_cleanup(struct module *mod) | 102 | void module_bug_cleanup(struct module *mod) |
diff --git a/lib/list_sort.c b/lib/list_sort.c index 4b5cb794c38b..a7616fa3162e 100644 --- a/lib/list_sort.c +++ b/lib/list_sort.c | |||
| @@ -70,7 +70,7 @@ static void merge_and_restore_back_links(void *priv, | |||
| 70 | * element comparison is needed, so the client's cmp() | 70 | * element comparison is needed, so the client's cmp() |
| 71 | * routine can invoke cond_resched() periodically. | 71 | * routine can invoke cond_resched() periodically. |
| 72 | */ | 72 | */ |
| 73 | (*cmp)(priv, tail, tail); | 73 | (*cmp)(priv, tail->next, tail->next); |
| 74 | 74 | ||
| 75 | tail->next->prev = tail; | 75 | tail->next->prev = tail; |
| 76 | tail = tail->next; | 76 | tail = tail->next; |
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index c2bf86f470ed..65d420499a61 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
| @@ -30,6 +30,7 @@ EXPORT_SYMBOL_GPL(default_backing_dev_info); | |||
| 30 | 30 | ||
| 31 | struct backing_dev_info noop_backing_dev_info = { | 31 | struct backing_dev_info noop_backing_dev_info = { |
| 32 | .name = "noop", | 32 | .name = "noop", |
| 33 | .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, | ||
| 33 | }; | 34 | }; |
| 34 | EXPORT_SYMBOL_GPL(noop_backing_dev_info); | 35 | EXPORT_SYMBOL_GPL(noop_backing_dev_info); |
| 35 | 36 | ||
| @@ -243,6 +244,7 @@ static int __init default_bdi_init(void) | |||
| 243 | err = bdi_init(&default_backing_dev_info); | 244 | err = bdi_init(&default_backing_dev_info); |
| 244 | if (!err) | 245 | if (!err) |
| 245 | bdi_register(&default_backing_dev_info, NULL, "default"); | 246 | bdi_register(&default_backing_dev_info, NULL, "default"); |
| 247 | err = bdi_init(&noop_backing_dev_info); | ||
| 246 | 248 | ||
| 247 | return err; | 249 | return err; |
| 248 | } | 250 | } |
diff --git a/mm/fremap.c b/mm/fremap.c index 46f5dacf90a2..ec520c7b28df 100644 --- a/mm/fremap.c +++ b/mm/fremap.c | |||
| @@ -125,7 +125,6 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, | |||
| 125 | { | 125 | { |
| 126 | struct mm_struct *mm = current->mm; | 126 | struct mm_struct *mm = current->mm; |
| 127 | struct address_space *mapping; | 127 | struct address_space *mapping; |
| 128 | unsigned long end = start + size; | ||
| 129 | struct vm_area_struct *vma; | 128 | struct vm_area_struct *vma; |
| 130 | int err = -EINVAL; | 129 | int err = -EINVAL; |
| 131 | int has_write_lock = 0; | 130 | int has_write_lock = 0; |
| @@ -142,6 +141,10 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, | |||
| 142 | if (start + size <= start) | 141 | if (start + size <= start) |
| 143 | return err; | 142 | return err; |
| 144 | 143 | ||
| 144 | /* Does pgoff wrap? */ | ||
| 145 | if (pgoff + (size >> PAGE_SHIFT) < pgoff) | ||
| 146 | return err; | ||
| 147 | |||
| 145 | /* Can we represent this offset inside this architecture's pte's? */ | 148 | /* Can we represent this offset inside this architecture's pte's? */ |
| 146 | #if PTE_FILE_MAX_BITS < BITS_PER_LONG | 149 | #if PTE_FILE_MAX_BITS < BITS_PER_LONG |
| 147 | if (pgoff + (size >> PAGE_SHIFT) >= (1UL << PTE_FILE_MAX_BITS)) | 150 | if (pgoff + (size >> PAGE_SHIFT) >= (1UL << PTE_FILE_MAX_BITS)) |
| @@ -168,7 +171,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, | |||
| 168 | if (!(vma->vm_flags & VM_CAN_NONLINEAR)) | 171 | if (!(vma->vm_flags & VM_CAN_NONLINEAR)) |
| 169 | goto out; | 172 | goto out; |
| 170 | 173 | ||
| 171 | if (end <= start || start < vma->vm_start || end > vma->vm_end) | 174 | if (start < vma->vm_start || start + size > vma->vm_end) |
| 172 | goto out; | 175 | goto out; |
| 173 | 176 | ||
| 174 | /* Must set VM_NONLINEAR before any pages are populated. */ | 177 | /* Must set VM_NONLINEAR before any pages are populated. */ |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index cc5be788a39f..c03273807182 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
| @@ -2324,11 +2324,8 @@ retry_avoidcopy: | |||
| 2324 | * and just make the page writable */ | 2324 | * and just make the page writable */ |
| 2325 | avoidcopy = (page_mapcount(old_page) == 1); | 2325 | avoidcopy = (page_mapcount(old_page) == 1); |
| 2326 | if (avoidcopy) { | 2326 | if (avoidcopy) { |
| 2327 | if (!trylock_page(old_page)) { | 2327 | if (PageAnon(old_page)) |
| 2328 | if (PageAnon(old_page)) | 2328 | page_move_anon_rmap(old_page, vma, address); |
| 2329 | page_move_anon_rmap(old_page, vma, address); | ||
| 2330 | } else | ||
| 2331 | unlock_page(old_page); | ||
| 2332 | set_huge_ptep_writable(vma, address, ptep); | 2329 | set_huge_ptep_writable(vma, address, ptep); |
| 2333 | return 0; | 2330 | return 0; |
| 2334 | } | 2331 | } |
| @@ -2404,7 +2401,7 @@ retry_avoidcopy: | |||
| 2404 | set_huge_pte_at(mm, address, ptep, | 2401 | set_huge_pte_at(mm, address, ptep, |
| 2405 | make_huge_pte(vma, new_page, 1)); | 2402 | make_huge_pte(vma, new_page, 1)); |
| 2406 | page_remove_rmap(old_page); | 2403 | page_remove_rmap(old_page); |
| 2407 | hugepage_add_anon_rmap(new_page, vma, address); | 2404 | hugepage_add_new_anon_rmap(new_page, vma, address); |
| 2408 | /* Make the old page be freed below */ | 2405 | /* Make the old page be freed below */ |
| 2409 | new_page = old_page; | 2406 | new_page = old_page; |
| 2410 | mmu_notifier_invalidate_range_end(mm, | 2407 | mmu_notifier_invalidate_range_end(mm, |
| @@ -2631,10 +2628,16 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 2631 | vma, address); | 2628 | vma, address); |
| 2632 | } | 2629 | } |
| 2633 | 2630 | ||
| 2634 | if (!pagecache_page) { | 2631 | /* |
| 2635 | page = pte_page(entry); | 2632 | * hugetlb_cow() requires page locks of pte_page(entry) and |
| 2633 | * pagecache_page, so here we need take the former one | ||
| 2634 | * when page != pagecache_page or !pagecache_page. | ||
| 2635 | * Note that locking order is always pagecache_page -> page, | ||
| 2636 | * so no worry about deadlock. | ||
| 2637 | */ | ||
| 2638 | page = pte_page(entry); | ||
| 2639 | if (page != pagecache_page) | ||
| 2636 | lock_page(page); | 2640 | lock_page(page); |
| 2637 | } | ||
| 2638 | 2641 | ||
| 2639 | spin_lock(&mm->page_table_lock); | 2642 | spin_lock(&mm->page_table_lock); |
| 2640 | /* Check for a racing update before calling hugetlb_cow */ | 2643 | /* Check for a racing update before calling hugetlb_cow */ |
| @@ -2661,9 +2664,8 @@ out_page_table_lock: | |||
| 2661 | if (pagecache_page) { | 2664 | if (pagecache_page) { |
| 2662 | unlock_page(pagecache_page); | 2665 | unlock_page(pagecache_page); |
| 2663 | put_page(pagecache_page); | 2666 | put_page(pagecache_page); |
| 2664 | } else { | ||
| 2665 | unlock_page(page); | ||
| 2666 | } | 2667 | } |
| 2668 | unlock_page(page); | ||
| 2667 | 2669 | ||
| 2668 | out_mutex: | 2670 | out_mutex: |
| 2669 | mutex_unlock(&hugetlb_instantiation_mutex); | 2671 | mutex_unlock(&hugetlb_instantiation_mutex); |
| @@ -712,7 +712,7 @@ static int write_protect_page(struct vm_area_struct *vma, struct page *page, | |||
| 712 | if (!ptep) | 712 | if (!ptep) |
| 713 | goto out; | 713 | goto out; |
| 714 | 714 | ||
| 715 | if (pte_write(*ptep)) { | 715 | if (pte_write(*ptep) || pte_dirty(*ptep)) { |
| 716 | pte_t entry; | 716 | pte_t entry; |
| 717 | 717 | ||
| 718 | swapped = PageSwapCache(page); | 718 | swapped = PageSwapCache(page); |
| @@ -735,7 +735,9 @@ static int write_protect_page(struct vm_area_struct *vma, struct page *page, | |||
| 735 | set_pte_at(mm, addr, ptep, entry); | 735 | set_pte_at(mm, addr, ptep, entry); |
| 736 | goto out_unlock; | 736 | goto out_unlock; |
| 737 | } | 737 | } |
| 738 | entry = pte_wrprotect(entry); | 738 | if (pte_dirty(entry)) |
| 739 | set_page_dirty(page); | ||
| 740 | entry = pte_mkclean(pte_wrprotect(entry)); | ||
| 739 | set_pte_at_notify(mm, addr, ptep, entry); | 741 | set_pte_at_notify(mm, addr, ptep, entry); |
| 740 | } | 742 | } |
| 741 | *orig_pte = *ptep; | 743 | *orig_pte = *ptep; |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3eed583895a6..9be3cf8a5da4 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
| @@ -3587,9 +3587,13 @@ unlock: | |||
| 3587 | 3587 | ||
| 3588 | static void mem_cgroup_threshold(struct mem_cgroup *memcg) | 3588 | static void mem_cgroup_threshold(struct mem_cgroup *memcg) |
| 3589 | { | 3589 | { |
| 3590 | __mem_cgroup_threshold(memcg, false); | 3590 | while (memcg) { |
| 3591 | if (do_swap_account) | 3591 | __mem_cgroup_threshold(memcg, false); |
| 3592 | __mem_cgroup_threshold(memcg, true); | 3592 | if (do_swap_account) |
| 3593 | __mem_cgroup_threshold(memcg, true); | ||
| 3594 | |||
| 3595 | memcg = parent_mem_cgroup(memcg); | ||
| 3596 | } | ||
| 3593 | } | 3597 | } |
| 3594 | 3598 | ||
| 3595 | static int compare_thresholds(const void *a, const void *b) | 3599 | static int compare_thresholds(const void *a, const void *b) |
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 9c26eeca1342..757f6b0accfe 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
| @@ -183,7 +183,7 @@ EXPORT_SYMBOL_GPL(hwpoison_filter); | |||
| 183 | * signal. | 183 | * signal. |
| 184 | */ | 184 | */ |
| 185 | static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno, | 185 | static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno, |
| 186 | unsigned long pfn) | 186 | unsigned long pfn, struct page *page) |
| 187 | { | 187 | { |
| 188 | struct siginfo si; | 188 | struct siginfo si; |
| 189 | int ret; | 189 | int ret; |
| @@ -198,7 +198,7 @@ static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno, | |||
| 198 | #ifdef __ARCH_SI_TRAPNO | 198 | #ifdef __ARCH_SI_TRAPNO |
| 199 | si.si_trapno = trapno; | 199 | si.si_trapno = trapno; |
| 200 | #endif | 200 | #endif |
| 201 | si.si_addr_lsb = PAGE_SHIFT; | 201 | si.si_addr_lsb = compound_order(compound_head(page)) + PAGE_SHIFT; |
| 202 | /* | 202 | /* |
| 203 | * Don't use force here, it's convenient if the signal | 203 | * Don't use force here, it's convenient if the signal |
| 204 | * can be temporarily blocked. | 204 | * can be temporarily blocked. |
| @@ -235,7 +235,7 @@ void shake_page(struct page *p, int access) | |||
| 235 | int nr; | 235 | int nr; |
| 236 | do { | 236 | do { |
| 237 | nr = shrink_slab(1000, GFP_KERNEL, 1000); | 237 | nr = shrink_slab(1000, GFP_KERNEL, 1000); |
| 238 | if (page_count(p) == 0) | 238 | if (page_count(p) == 1) |
| 239 | break; | 239 | break; |
| 240 | } while (nr > 10); | 240 | } while (nr > 10); |
| 241 | } | 241 | } |
| @@ -327,7 +327,7 @@ static void add_to_kill(struct task_struct *tsk, struct page *p, | |||
| 327 | * wrong earlier. | 327 | * wrong earlier. |
| 328 | */ | 328 | */ |
| 329 | static void kill_procs_ao(struct list_head *to_kill, int doit, int trapno, | 329 | static void kill_procs_ao(struct list_head *to_kill, int doit, int trapno, |
| 330 | int fail, unsigned long pfn) | 330 | int fail, struct page *page, unsigned long pfn) |
| 331 | { | 331 | { |
| 332 | struct to_kill *tk, *next; | 332 | struct to_kill *tk, *next; |
| 333 | 333 | ||
| @@ -352,7 +352,7 @@ static void kill_procs_ao(struct list_head *to_kill, int doit, int trapno, | |||
| 352 | * process anyways. | 352 | * process anyways. |
| 353 | */ | 353 | */ |
| 354 | else if (kill_proc_ao(tk->tsk, tk->addr, trapno, | 354 | else if (kill_proc_ao(tk->tsk, tk->addr, trapno, |
| 355 | pfn) < 0) | 355 | pfn, page) < 0) |
| 356 | printk(KERN_ERR | 356 | printk(KERN_ERR |
| 357 | "MCE %#lx: Cannot send advisory machine check signal to %s:%d\n", | 357 | "MCE %#lx: Cannot send advisory machine check signal to %s:%d\n", |
| 358 | pfn, tk->tsk->comm, tk->tsk->pid); | 358 | pfn, tk->tsk->comm, tk->tsk->pid); |
| @@ -928,7 +928,7 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn, | |||
| 928 | * any accesses to the poisoned memory. | 928 | * any accesses to the poisoned memory. |
| 929 | */ | 929 | */ |
| 930 | kill_procs_ao(&tokill, !!PageDirty(hpage), trapno, | 930 | kill_procs_ao(&tokill, !!PageDirty(hpage), trapno, |
| 931 | ret != SWAP_SUCCESS, pfn); | 931 | ret != SWAP_SUCCESS, p, pfn); |
| 932 | 932 | ||
| 933 | return ret; | 933 | return ret; |
| 934 | } | 934 | } |
diff --git a/mm/memory.c b/mm/memory.c index 71b161b73bb5..0e18b4d649ec 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
| @@ -2680,10 +2680,12 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 2680 | delayacct_clear_flag(DELAYACCT_PF_SWAPIN); | 2680 | delayacct_clear_flag(DELAYACCT_PF_SWAPIN); |
| 2681 | 2681 | ||
| 2682 | /* | 2682 | /* |
| 2683 | * Make sure try_to_free_swap didn't release the swapcache | 2683 | * Make sure try_to_free_swap or reuse_swap_page or swapoff did not |
| 2684 | * from under us. The page pin isn't enough to prevent that. | 2684 | * release the swapcache from under us. The page pin, and pte_same |
| 2685 | * test below, are not enough to exclude that. Even if it is still | ||
| 2686 | * swapcache, we need to check that the page's swap has not changed. | ||
| 2685 | */ | 2687 | */ |
| 2686 | if (unlikely(!PageSwapCache(page))) | 2688 | if (unlikely(!PageSwapCache(page) || page_private(page) != entry.val)) |
| 2687 | goto out_page; | 2689 | goto out_page; |
| 2688 | 2690 | ||
| 2689 | if (ksm_might_need_to_copy(page, vma, address)) { | 2691 | if (ksm_might_need_to_copy(page, vma, address)) { |
| @@ -2009,6 +2009,7 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, | |||
| 2009 | removed_exe_file_vma(mm); | 2009 | removed_exe_file_vma(mm); |
| 2010 | fput(new->vm_file); | 2010 | fput(new->vm_file); |
| 2011 | } | 2011 | } |
| 2012 | unlink_anon_vmas(new); | ||
| 2012 | out_free_mpol: | 2013 | out_free_mpol: |
| 2013 | mpol_put(pol); | 2014 | mpol_put(pol); |
| 2014 | out_free_vma: | 2015 | out_free_vma: |
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index fc81cb22869e..4029583a1024 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
| @@ -121,8 +121,8 @@ struct task_struct *find_lock_task_mm(struct task_struct *p) | |||
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | /* return true if the task is not adequate as candidate victim task. */ | 123 | /* return true if the task is not adequate as candidate victim task. */ |
| 124 | static bool oom_unkillable_task(struct task_struct *p, struct mem_cgroup *mem, | 124 | static bool oom_unkillable_task(struct task_struct *p, |
| 125 | const nodemask_t *nodemask) | 125 | const struct mem_cgroup *mem, const nodemask_t *nodemask) |
| 126 | { | 126 | { |
| 127 | if (is_global_init(p)) | 127 | if (is_global_init(p)) |
| 128 | return true; | 128 | return true; |
| @@ -208,8 +208,13 @@ unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, | |||
| 208 | */ | 208 | */ |
| 209 | points += p->signal->oom_score_adj; | 209 | points += p->signal->oom_score_adj; |
| 210 | 210 | ||
| 211 | if (points < 0) | 211 | /* |
| 212 | return 0; | 212 | * Never return 0 for an eligible task that may be killed since it's |
| 213 | * possible that no single user task uses more than 0.1% of memory and | ||
| 214 | * no single admin tasks uses more than 3.0%. | ||
| 215 | */ | ||
| 216 | if (points <= 0) | ||
| 217 | return 1; | ||
| 213 | return (points < 1000) ? points : 1000; | 218 | return (points < 1000) ? points : 1000; |
| 214 | } | 219 | } |
| 215 | 220 | ||
| @@ -339,26 +344,24 @@ static struct task_struct *select_bad_process(unsigned int *ppoints, | |||
| 339 | /** | 344 | /** |
| 340 | * dump_tasks - dump current memory state of all system tasks | 345 | * dump_tasks - dump current memory state of all system tasks |
| 341 | * @mem: current's memory controller, if constrained | 346 | * @mem: current's memory controller, if constrained |
| 347 | * @nodemask: nodemask passed to page allocator for mempolicy ooms | ||
| 342 | * | 348 | * |
| 343 | * Dumps the current memory state of all system tasks, excluding kernel threads. | 349 | * Dumps the current memory state of all eligible tasks. Tasks not in the same |
| 350 | * memcg, not in the same cpuset, or bound to a disjoint set of mempolicy nodes | ||
| 351 | * are not shown. | ||
| 344 | * State information includes task's pid, uid, tgid, vm size, rss, cpu, oom_adj | 352 | * State information includes task's pid, uid, tgid, vm size, rss, cpu, oom_adj |
| 345 | * value, oom_score_adj value, and name. | 353 | * value, oom_score_adj value, and name. |
| 346 | * | 354 | * |
| 347 | * If the actual is non-NULL, only tasks that are a member of the mem_cgroup are | ||
| 348 | * shown. | ||
| 349 | * | ||
| 350 | * Call with tasklist_lock read-locked. | 355 | * Call with tasklist_lock read-locked. |
| 351 | */ | 356 | */ |
| 352 | static void dump_tasks(const struct mem_cgroup *mem) | 357 | static void dump_tasks(const struct mem_cgroup *mem, const nodemask_t *nodemask) |
| 353 | { | 358 | { |
| 354 | struct task_struct *p; | 359 | struct task_struct *p; |
| 355 | struct task_struct *task; | 360 | struct task_struct *task; |
| 356 | 361 | ||
| 357 | pr_info("[ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name\n"); | 362 | pr_info("[ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name\n"); |
| 358 | for_each_process(p) { | 363 | for_each_process(p) { |
| 359 | if (p->flags & PF_KTHREAD) | 364 | if (oom_unkillable_task(p, mem, nodemask)) |
| 360 | continue; | ||
| 361 | if (mem && !task_in_mem_cgroup(p, mem)) | ||
| 362 | continue; | 365 | continue; |
| 363 | 366 | ||
| 364 | task = find_lock_task_mm(p); | 367 | task = find_lock_task_mm(p); |
| @@ -381,7 +384,7 @@ static void dump_tasks(const struct mem_cgroup *mem) | |||
| 381 | } | 384 | } |
| 382 | 385 | ||
| 383 | static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order, | 386 | static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order, |
| 384 | struct mem_cgroup *mem) | 387 | struct mem_cgroup *mem, const nodemask_t *nodemask) |
| 385 | { | 388 | { |
| 386 | task_lock(current); | 389 | task_lock(current); |
| 387 | pr_warning("%s invoked oom-killer: gfp_mask=0x%x, order=%d, " | 390 | pr_warning("%s invoked oom-killer: gfp_mask=0x%x, order=%d, " |
| @@ -394,7 +397,7 @@ static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order, | |||
| 394 | mem_cgroup_print_oom_info(mem, p); | 397 | mem_cgroup_print_oom_info(mem, p); |
| 395 | show_mem(); | 398 | show_mem(); |
| 396 | if (sysctl_oom_dump_tasks) | 399 | if (sysctl_oom_dump_tasks) |
| 397 | dump_tasks(mem); | 400 | dump_tasks(mem, nodemask); |
| 398 | } | 401 | } |
| 399 | 402 | ||
| 400 | #define K(x) ((x) << (PAGE_SHIFT-10)) | 403 | #define K(x) ((x) << (PAGE_SHIFT-10)) |
| @@ -436,7 +439,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, | |||
| 436 | unsigned int victim_points = 0; | 439 | unsigned int victim_points = 0; |
| 437 | 440 | ||
| 438 | if (printk_ratelimit()) | 441 | if (printk_ratelimit()) |
| 439 | dump_header(p, gfp_mask, order, mem); | 442 | dump_header(p, gfp_mask, order, mem, nodemask); |
| 440 | 443 | ||
| 441 | /* | 444 | /* |
| 442 | * If the task is already exiting, don't alarm the sysadmin or kill | 445 | * If the task is already exiting, don't alarm the sysadmin or kill |
| @@ -482,7 +485,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, | |||
| 482 | * Determines whether the kernel must panic because of the panic_on_oom sysctl. | 485 | * Determines whether the kernel must panic because of the panic_on_oom sysctl. |
| 483 | */ | 486 | */ |
| 484 | static void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask, | 487 | static void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask, |
| 485 | int order) | 488 | int order, const nodemask_t *nodemask) |
| 486 | { | 489 | { |
| 487 | if (likely(!sysctl_panic_on_oom)) | 490 | if (likely(!sysctl_panic_on_oom)) |
| 488 | return; | 491 | return; |
| @@ -496,7 +499,7 @@ static void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask, | |||
| 496 | return; | 499 | return; |
| 497 | } | 500 | } |
| 498 | read_lock(&tasklist_lock); | 501 | read_lock(&tasklist_lock); |
| 499 | dump_header(NULL, gfp_mask, order, NULL); | 502 | dump_header(NULL, gfp_mask, order, NULL, nodemask); |
| 500 | read_unlock(&tasklist_lock); | 503 | read_unlock(&tasklist_lock); |
| 501 | panic("Out of memory: %s panic_on_oom is enabled\n", | 504 | panic("Out of memory: %s panic_on_oom is enabled\n", |
| 502 | sysctl_panic_on_oom == 2 ? "compulsory" : "system-wide"); | 505 | sysctl_panic_on_oom == 2 ? "compulsory" : "system-wide"); |
| @@ -509,7 +512,7 @@ void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask) | |||
| 509 | unsigned int points = 0; | 512 | unsigned int points = 0; |
| 510 | struct task_struct *p; | 513 | struct task_struct *p; |
| 511 | 514 | ||
| 512 | check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, 0); | 515 | check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, 0, NULL); |
| 513 | limit = mem_cgroup_get_limit(mem) >> PAGE_SHIFT; | 516 | limit = mem_cgroup_get_limit(mem) >> PAGE_SHIFT; |
| 514 | read_lock(&tasklist_lock); | 517 | read_lock(&tasklist_lock); |
| 515 | retry: | 518 | retry: |
| @@ -641,6 +644,7 @@ static void clear_system_oom(void) | |||
| 641 | void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, | 644 | void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, |
| 642 | int order, nodemask_t *nodemask) | 645 | int order, nodemask_t *nodemask) |
| 643 | { | 646 | { |
| 647 | const nodemask_t *mpol_mask; | ||
| 644 | struct task_struct *p; | 648 | struct task_struct *p; |
| 645 | unsigned long totalpages; | 649 | unsigned long totalpages; |
| 646 | unsigned long freed = 0; | 650 | unsigned long freed = 0; |
| @@ -670,7 +674,8 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, | |||
| 670 | */ | 674 | */ |
| 671 | constraint = constrained_alloc(zonelist, gfp_mask, nodemask, | 675 | constraint = constrained_alloc(zonelist, gfp_mask, nodemask, |
| 672 | &totalpages); | 676 | &totalpages); |
| 673 | check_panic_on_oom(constraint, gfp_mask, order); | 677 | mpol_mask = (constraint == CONSTRAINT_MEMORY_POLICY) ? nodemask : NULL; |
| 678 | check_panic_on_oom(constraint, gfp_mask, order, mpol_mask); | ||
| 674 | 679 | ||
| 675 | read_lock(&tasklist_lock); | 680 | read_lock(&tasklist_lock); |
| 676 | if (sysctl_oom_kill_allocating_task && | 681 | if (sysctl_oom_kill_allocating_task && |
| @@ -688,15 +693,13 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, | |||
| 688 | } | 693 | } |
| 689 | 694 | ||
| 690 | retry: | 695 | retry: |
| 691 | p = select_bad_process(&points, totalpages, NULL, | 696 | p = select_bad_process(&points, totalpages, NULL, mpol_mask); |
| 692 | constraint == CONSTRAINT_MEMORY_POLICY ? nodemask : | ||
| 693 | NULL); | ||
| 694 | if (PTR_ERR(p) == -1UL) | 697 | if (PTR_ERR(p) == -1UL) |
| 695 | goto out; | 698 | goto out; |
| 696 | 699 | ||
| 697 | /* Found nothing?!?! Either we hang forever, or we panic. */ | 700 | /* Found nothing?!?! Either we hang forever, or we panic. */ |
| 698 | if (!p) { | 701 | if (!p) { |
| 699 | dump_header(NULL, gfp_mask, order, NULL); | 702 | dump_header(NULL, gfp_mask, order, NULL, mpol_mask); |
| 700 | read_unlock(&tasklist_lock); | 703 | read_unlock(&tasklist_lock); |
| 701 | panic("Out of memory and no killable processes...\n"); | 704 | panic("Out of memory and no killable processes...\n"); |
| 702 | } | 705 | } |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a8cfa9cc6e86..f12ad1836abe 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -5182,9 +5182,9 @@ void *__init alloc_large_system_hash(const char *tablename, | |||
| 5182 | if (!table) | 5182 | if (!table) |
| 5183 | panic("Failed to allocate %s hash table\n", tablename); | 5183 | panic("Failed to allocate %s hash table\n", tablename); |
| 5184 | 5184 | ||
| 5185 | printk(KERN_INFO "%s hash table entries: %d (order: %d, %lu bytes)\n", | 5185 | printk(KERN_INFO "%s hash table entries: %ld (order: %d, %lu bytes)\n", |
| 5186 | tablename, | 5186 | tablename, |
| 5187 | (1U << log2qty), | 5187 | (1UL << log2qty), |
| 5188 | ilog2(size) - PAGE_SHIFT, | 5188 | ilog2(size) - PAGE_SHIFT, |
| 5189 | size); | 5189 | size); |
| 5190 | 5190 | ||
diff --git a/mm/percpu.c b/mm/percpu.c index 58c572b18b07..c76ef3891e0d 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
| @@ -1401,9 +1401,9 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, | |||
| 1401 | 1401 | ||
| 1402 | if (pcpu_first_unit_cpu == NR_CPUS) | 1402 | if (pcpu_first_unit_cpu == NR_CPUS) |
| 1403 | pcpu_first_unit_cpu = cpu; | 1403 | pcpu_first_unit_cpu = cpu; |
| 1404 | pcpu_last_unit_cpu = cpu; | ||
| 1404 | } | 1405 | } |
| 1405 | } | 1406 | } |
| 1406 | pcpu_last_unit_cpu = cpu; | ||
| 1407 | pcpu_nr_units = unit; | 1407 | pcpu_nr_units = unit; |
| 1408 | 1408 | ||
| 1409 | for_each_possible_cpu(cpu) | 1409 | for_each_possible_cpu(cpu) |
| @@ -381,7 +381,13 @@ vma_address(struct page *page, struct vm_area_struct *vma) | |||
| 381 | unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) | 381 | unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) |
| 382 | { | 382 | { |
| 383 | if (PageAnon(page)) { | 383 | if (PageAnon(page)) { |
| 384 | if (vma->anon_vma->root != page_anon_vma(page)->root) | 384 | struct anon_vma *page__anon_vma = page_anon_vma(page); |
| 385 | /* | ||
| 386 | * Note: swapoff's unuse_vma() is more efficient with this | ||
| 387 | * check, and needs it to match anon_vma when KSM is active. | ||
| 388 | */ | ||
| 389 | if (!vma->anon_vma || !page__anon_vma || | ||
| 390 | vma->anon_vma->root != page__anon_vma->root) | ||
| 385 | return -EFAULT; | 391 | return -EFAULT; |
| 386 | } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { | 392 | } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { |
| 387 | if (!vma->vm_file || | 393 | if (!vma->vm_file || |
| @@ -1564,13 +1570,14 @@ static void __hugepage_set_anon_rmap(struct page *page, | |||
| 1564 | struct vm_area_struct *vma, unsigned long address, int exclusive) | 1570 | struct vm_area_struct *vma, unsigned long address, int exclusive) |
| 1565 | { | 1571 | { |
| 1566 | struct anon_vma *anon_vma = vma->anon_vma; | 1572 | struct anon_vma *anon_vma = vma->anon_vma; |
| 1573 | |||
| 1567 | BUG_ON(!anon_vma); | 1574 | BUG_ON(!anon_vma); |
| 1568 | if (!exclusive) { | 1575 | |
| 1569 | struct anon_vma_chain *avc; | 1576 | if (PageAnon(page)) |
| 1570 | avc = list_entry(vma->anon_vma_chain.prev, | 1577 | return; |
| 1571 | struct anon_vma_chain, same_vma); | 1578 | if (!exclusive) |
| 1572 | anon_vma = avc->anon_vma; | 1579 | anon_vma = anon_vma->root; |
| 1573 | } | 1580 | |
| 1574 | anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON; | 1581 | anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON; |
| 1575 | page->mapping = (struct address_space *) anon_vma; | 1582 | page->mapping = (struct address_space *) anon_vma; |
| 1576 | page->index = linear_page_index(vma, address); | 1583 | page->index = linear_page_index(vma, address); |
| @@ -1581,6 +1588,8 @@ void hugepage_add_anon_rmap(struct page *page, | |||
| 1581 | { | 1588 | { |
| 1582 | struct anon_vma *anon_vma = vma->anon_vma; | 1589 | struct anon_vma *anon_vma = vma->anon_vma; |
| 1583 | int first; | 1590 | int first; |
| 1591 | |||
| 1592 | BUG_ON(!PageLocked(page)); | ||
| 1584 | BUG_ON(!anon_vma); | 1593 | BUG_ON(!anon_vma); |
| 1585 | BUG_ON(address < vma->vm_start || address >= vma->vm_end); | 1594 | BUG_ON(address < vma->vm_start || address >= vma->vm_end); |
| 1586 | first = atomic_inc_and_test(&page->_mapcount); | 1595 | first = atomic_inc_and_test(&page->_mapcount); |
diff --git a/mm/vmscan.c b/mm/vmscan.c index c391c320dbaf..c5dfabf25f11 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
| @@ -1804,12 +1804,11 @@ static void shrink_zone(int priority, struct zone *zone, | |||
| 1804 | * If a zone is deemed to be full of pinned pages then just give it a light | 1804 | * If a zone is deemed to be full of pinned pages then just give it a light |
| 1805 | * scan then give up on it. | 1805 | * scan then give up on it. |
| 1806 | */ | 1806 | */ |
| 1807 | static bool shrink_zones(int priority, struct zonelist *zonelist, | 1807 | static void shrink_zones(int priority, struct zonelist *zonelist, |
| 1808 | struct scan_control *sc) | 1808 | struct scan_control *sc) |
| 1809 | { | 1809 | { |
| 1810 | struct zoneref *z; | 1810 | struct zoneref *z; |
| 1811 | struct zone *zone; | 1811 | struct zone *zone; |
| 1812 | bool all_unreclaimable = true; | ||
| 1813 | 1812 | ||
| 1814 | for_each_zone_zonelist_nodemask(zone, z, zonelist, | 1813 | for_each_zone_zonelist_nodemask(zone, z, zonelist, |
| 1815 | gfp_zone(sc->gfp_mask), sc->nodemask) { | 1814 | gfp_zone(sc->gfp_mask), sc->nodemask) { |
| @@ -1827,8 +1826,38 @@ static bool shrink_zones(int priority, struct zonelist *zonelist, | |||
| 1827 | } | 1826 | } |
| 1828 | 1827 | ||
| 1829 | shrink_zone(priority, zone, sc); | 1828 | shrink_zone(priority, zone, sc); |
| 1830 | all_unreclaimable = false; | ||
| 1831 | } | 1829 | } |
| 1830 | } | ||
| 1831 | |||
| 1832 | static bool zone_reclaimable(struct zone *zone) | ||
| 1833 | { | ||
| 1834 | return zone->pages_scanned < zone_reclaimable_pages(zone) * 6; | ||
| 1835 | } | ||
| 1836 | |||
| 1837 | /* | ||
| 1838 | * As hibernation is going on, kswapd is freezed so that it can't mark | ||
| 1839 | * the zone into all_unreclaimable. It can't handle OOM during hibernation. | ||
| 1840 | * So let's check zone's unreclaimable in direct reclaim as well as kswapd. | ||
| 1841 | */ | ||
| 1842 | static bool all_unreclaimable(struct zonelist *zonelist, | ||
| 1843 | struct scan_control *sc) | ||
| 1844 | { | ||
| 1845 | struct zoneref *z; | ||
| 1846 | struct zone *zone; | ||
| 1847 | bool all_unreclaimable = true; | ||
| 1848 | |||
| 1849 | for_each_zone_zonelist_nodemask(zone, z, zonelist, | ||
| 1850 | gfp_zone(sc->gfp_mask), sc->nodemask) { | ||
| 1851 | if (!populated_zone(zone)) | ||
| 1852 | continue; | ||
| 1853 | if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) | ||
| 1854 | continue; | ||
| 1855 | if (zone_reclaimable(zone)) { | ||
| 1856 | all_unreclaimable = false; | ||
| 1857 | break; | ||
| 1858 | } | ||
| 1859 | } | ||
| 1860 | |||
| 1832 | return all_unreclaimable; | 1861 | return all_unreclaimable; |
| 1833 | } | 1862 | } |
| 1834 | 1863 | ||
| @@ -1852,7 +1881,6 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
| 1852 | struct scan_control *sc) | 1881 | struct scan_control *sc) |
| 1853 | { | 1882 | { |
| 1854 | int priority; | 1883 | int priority; |
| 1855 | bool all_unreclaimable; | ||
| 1856 | unsigned long total_scanned = 0; | 1884 | unsigned long total_scanned = 0; |
| 1857 | struct reclaim_state *reclaim_state = current->reclaim_state; | 1885 | struct reclaim_state *reclaim_state = current->reclaim_state; |
| 1858 | struct zoneref *z; | 1886 | struct zoneref *z; |
| @@ -1869,7 +1897,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
| 1869 | sc->nr_scanned = 0; | 1897 | sc->nr_scanned = 0; |
| 1870 | if (!priority) | 1898 | if (!priority) |
| 1871 | disable_swap_token(); | 1899 | disable_swap_token(); |
| 1872 | all_unreclaimable = shrink_zones(priority, zonelist, sc); | 1900 | shrink_zones(priority, zonelist, sc); |
| 1873 | /* | 1901 | /* |
| 1874 | * Don't shrink slabs when reclaiming memory from | 1902 | * Don't shrink slabs when reclaiming memory from |
| 1875 | * over limit cgroups | 1903 | * over limit cgroups |
| @@ -1931,7 +1959,7 @@ out: | |||
| 1931 | return sc->nr_reclaimed; | 1959 | return sc->nr_reclaimed; |
| 1932 | 1960 | ||
| 1933 | /* top priority shrink_zones still had more to do? don't OOM, then */ | 1961 | /* top priority shrink_zones still had more to do? don't OOM, then */ |
| 1934 | if (scanning_global_lru(sc) && !all_unreclaimable) | 1962 | if (scanning_global_lru(sc) && !all_unreclaimable(zonelist, sc)) |
| 1935 | return 1; | 1963 | return 1; |
| 1936 | 1964 | ||
| 1937 | return 0; | 1965 | return 0; |
| @@ -2197,8 +2225,7 @@ loop_again: | |||
| 2197 | total_scanned += sc.nr_scanned; | 2225 | total_scanned += sc.nr_scanned; |
| 2198 | if (zone->all_unreclaimable) | 2226 | if (zone->all_unreclaimable) |
| 2199 | continue; | 2227 | continue; |
| 2200 | if (nr_slab == 0 && | 2228 | if (nr_slab == 0 && !zone_reclaimable(zone)) |
| 2201 | zone->pages_scanned >= (zone_reclaimable_pages(zone) * 6)) | ||
| 2202 | zone->all_unreclaimable = 1; | 2229 | zone->all_unreclaimable = 1; |
| 2203 | /* | 2230 | /* |
| 2204 | * If we've done a decent amount of scanning and | 2231 | * If we've done a decent amount of scanning and |
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index 01ddb0472f86..0eb96f7e44be 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c | |||
| @@ -24,8 +24,11 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | |||
| 24 | 24 | ||
| 25 | if (vlan_dev) | 25 | if (vlan_dev) |
| 26 | skb->dev = vlan_dev; | 26 | skb->dev = vlan_dev; |
| 27 | else if (vlan_id) | 27 | else if (vlan_id) { |
| 28 | goto drop; | 28 | if (!(skb->dev->flags & IFF_PROMISC)) |
| 29 | goto drop; | ||
| 30 | skb->pkt_type = PACKET_OTHERHOST; | ||
| 31 | } | ||
| 29 | 32 | ||
| 30 | return (polling ? netif_receive_skb(skb) : netif_rx(skb)); | 33 | return (polling ? netif_receive_skb(skb) : netif_rx(skb)); |
| 31 | 34 | ||
| @@ -102,8 +105,11 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp, | |||
| 102 | 105 | ||
| 103 | if (vlan_dev) | 106 | if (vlan_dev) |
| 104 | skb->dev = vlan_dev; | 107 | skb->dev = vlan_dev; |
| 105 | else if (vlan_id) | 108 | else if (vlan_id) { |
| 106 | goto drop; | 109 | if (!(skb->dev->flags & IFF_PROMISC)) |
| 110 | goto drop; | ||
| 111 | skb->pkt_type = PACKET_OTHERHOST; | ||
| 112 | } | ||
| 107 | 113 | ||
| 108 | for (p = napi->gro_list; p; p = p->next) { | 114 | for (p = napi->gro_list; p; p = p->next) { |
| 109 | NAPI_GRO_CB(p)->same_flow = | 115 | NAPI_GRO_CB(p)->same_flow = |
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 0ea20c30466c..17c5ba7551a5 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c | |||
| @@ -426,8 +426,10 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) | |||
| 426 | 426 | ||
| 427 | /* Allocate an fcall for the reply */ | 427 | /* Allocate an fcall for the reply */ |
| 428 | rpl_context = kmalloc(sizeof *rpl_context, GFP_KERNEL); | 428 | rpl_context = kmalloc(sizeof *rpl_context, GFP_KERNEL); |
| 429 | if (!rpl_context) | 429 | if (!rpl_context) { |
| 430 | err = -ENOMEM; | ||
| 430 | goto err_close; | 431 | goto err_close; |
| 432 | } | ||
| 431 | 433 | ||
| 432 | /* | 434 | /* |
| 433 | * If the request has a buffer, steal it, otherwise | 435 | * If the request has a buffer, steal it, otherwise |
| @@ -445,8 +447,8 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) | |||
| 445 | } | 447 | } |
| 446 | rpl_context->rc = req->rc; | 448 | rpl_context->rc = req->rc; |
| 447 | if (!rpl_context->rc) { | 449 | if (!rpl_context->rc) { |
| 448 | kfree(rpl_context); | 450 | err = -ENOMEM; |
| 449 | goto err_close; | 451 | goto err_free2; |
| 450 | } | 452 | } |
| 451 | 453 | ||
| 452 | /* | 454 | /* |
| @@ -458,11 +460,8 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) | |||
| 458 | */ | 460 | */ |
| 459 | if (atomic_inc_return(&rdma->rq_count) <= rdma->rq_depth) { | 461 | if (atomic_inc_return(&rdma->rq_count) <= rdma->rq_depth) { |
| 460 | err = post_recv(client, rpl_context); | 462 | err = post_recv(client, rpl_context); |
| 461 | if (err) { | 463 | if (err) |
| 462 | kfree(rpl_context->rc); | 464 | goto err_free1; |
| 463 | kfree(rpl_context); | ||
| 464 | goto err_close; | ||
| 465 | } | ||
| 466 | } else | 465 | } else |
| 467 | atomic_dec(&rdma->rq_count); | 466 | atomic_dec(&rdma->rq_count); |
| 468 | 467 | ||
| @@ -471,8 +470,10 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) | |||
| 471 | 470 | ||
| 472 | /* Post the request */ | 471 | /* Post the request */ |
| 473 | c = kmalloc(sizeof *c, GFP_KERNEL); | 472 | c = kmalloc(sizeof *c, GFP_KERNEL); |
| 474 | if (!c) | 473 | if (!c) { |
| 475 | goto err_close; | 474 | err = -ENOMEM; |
| 475 | goto err_free1; | ||
| 476 | } | ||
| 476 | c->req = req; | 477 | c->req = req; |
| 477 | 478 | ||
| 478 | c->busa = ib_dma_map_single(rdma->cm_id->device, | 479 | c->busa = ib_dma_map_single(rdma->cm_id->device, |
| @@ -499,9 +500,15 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) | |||
| 499 | return ib_post_send(rdma->qp, &wr, &bad_wr); | 500 | return ib_post_send(rdma->qp, &wr, &bad_wr); |
| 500 | 501 | ||
| 501 | error: | 502 | error: |
| 503 | kfree(c); | ||
| 504 | kfree(rpl_context->rc); | ||
| 505 | kfree(rpl_context); | ||
| 502 | P9_DPRINTK(P9_DEBUG_ERROR, "EIO\n"); | 506 | P9_DPRINTK(P9_DEBUG_ERROR, "EIO\n"); |
| 503 | return -EIO; | 507 | return -EIO; |
| 504 | 508 | err_free1: | |
| 509 | kfree(rpl_context->rc); | ||
| 510 | err_free2: | ||
| 511 | kfree(rpl_context); | ||
| 505 | err_close: | 512 | err_close: |
| 506 | spin_lock_irqsave(&rdma->req_lock, flags); | 513 | spin_lock_irqsave(&rdma->req_lock, flags); |
| 507 | if (rdma->state < P9_RDMA_CLOSING) { | 514 | if (rdma->state < P9_RDMA_CLOSING) { |
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index dcfbe99ff81c..b88515936e4b 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c | |||
| @@ -329,7 +329,8 @@ p9_virtio_create(struct p9_client *client, const char *devname, char *args) | |||
| 329 | 329 | ||
| 330 | mutex_lock(&virtio_9p_lock); | 330 | mutex_lock(&virtio_9p_lock); |
| 331 | list_for_each_entry(chan, &virtio_chan_list, chan_list) { | 331 | list_for_each_entry(chan, &virtio_chan_list, chan_list) { |
| 332 | if (!strncmp(devname, chan->tag, chan->tag_len)) { | 332 | if (!strncmp(devname, chan->tag, chan->tag_len) && |
| 333 | strlen(devname) == chan->tag_len) { | ||
| 333 | if (!chan->inuse) { | 334 | if (!chan->inuse) { |
| 334 | chan->inuse = true; | 335 | chan->inuse = true; |
| 335 | found = 1; | 336 | found = 1; |
diff --git a/net/Kconfig b/net/Kconfig index e330594d3709..e926884c1675 100644 --- a/net/Kconfig +++ b/net/Kconfig | |||
| @@ -217,7 +217,7 @@ source "net/dns_resolver/Kconfig" | |||
| 217 | 217 | ||
| 218 | config RPS | 218 | config RPS |
| 219 | boolean | 219 | boolean |
| 220 | depends on SMP && SYSFS | 220 | depends on SMP && SYSFS && USE_GENERIC_SMP_HELPERS |
| 221 | default y | 221 | default y |
| 222 | 222 | ||
| 223 | menu "Network testing" | 223 | menu "Network testing" |
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 651babdfab38..ad2b232a2055 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
| @@ -399,12 +399,6 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb) | |||
| 399 | unregister_netdev(net_dev); | 399 | unregister_netdev(net_dev); |
| 400 | free_netdev(net_dev); | 400 | free_netdev(net_dev); |
| 401 | } | 401 | } |
| 402 | read_lock_irq(&devs_lock); | ||
| 403 | if (list_empty(&br2684_devs)) { | ||
| 404 | /* last br2684 device */ | ||
| 405 | unregister_atmdevice_notifier(&atm_dev_notifier); | ||
| 406 | } | ||
| 407 | read_unlock_irq(&devs_lock); | ||
| 408 | return; | 402 | return; |
| 409 | } | 403 | } |
| 410 | 404 | ||
| @@ -675,7 +669,6 @@ static int br2684_create(void __user *arg) | |||
| 675 | 669 | ||
| 676 | if (list_empty(&br2684_devs)) { | 670 | if (list_empty(&br2684_devs)) { |
| 677 | /* 1st br2684 device */ | 671 | /* 1st br2684 device */ |
| 678 | register_atmdevice_notifier(&atm_dev_notifier); | ||
| 679 | brdev->number = 1; | 672 | brdev->number = 1; |
| 680 | } else | 673 | } else |
| 681 | brdev->number = BRPRIV(list_entry_brdev(br2684_devs.prev))->number + 1; | 674 | brdev->number = BRPRIV(list_entry_brdev(br2684_devs.prev))->number + 1; |
| @@ -815,6 +808,7 @@ static int __init br2684_init(void) | |||
| 815 | return -ENOMEM; | 808 | return -ENOMEM; |
| 816 | #endif | 809 | #endif |
| 817 | register_atm_ioctl(&br2684_ioctl_ops); | 810 | register_atm_ioctl(&br2684_ioctl_ops); |
| 811 | register_atmdevice_notifier(&atm_dev_notifier); | ||
| 818 | return 0; | 812 | return 0; |
| 819 | } | 813 | } |
| 820 | 814 | ||
| @@ -830,9 +824,7 @@ static void __exit br2684_exit(void) | |||
| 830 | #endif | 824 | #endif |
| 831 | 825 | ||
| 832 | 826 | ||
| 833 | /* if not already empty */ | 827 | unregister_atmdevice_notifier(&atm_dev_notifier); |
| 834 | if (!list_empty(&br2684_devs)) | ||
| 835 | unregister_atmdevice_notifier(&atm_dev_notifier); | ||
| 836 | 828 | ||
| 837 | while (!list_empty(&br2684_devs)) { | 829 | while (!list_empty(&br2684_devs)) { |
| 838 | net_dev = list_entry_brdev(br2684_devs.next); | 830 | net_dev = list_entry_brdev(br2684_devs.next); |
diff --git a/net/atm/mpc.c b/net/atm/mpc.c index 622b471e14e0..74bcc662c3dd 100644 --- a/net/atm/mpc.c +++ b/net/atm/mpc.c | |||
| @@ -778,7 +778,7 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb) | |||
| 778 | eg->packets_rcvd++; | 778 | eg->packets_rcvd++; |
| 779 | mpc->eg_ops->put(eg); | 779 | mpc->eg_ops->put(eg); |
| 780 | 780 | ||
| 781 | memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data)); | 781 | memset(ATM_SKB(new_skb), 0, sizeof(struct atm_skb_data)); |
| 782 | netif_rx(new_skb); | 782 | netif_rx(new_skb); |
| 783 | } | 783 | } |
| 784 | 784 | ||
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index fadf26b4ed7c..0b54b7dd8401 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
| @@ -1441,33 +1441,23 @@ static inline void l2cap_do_send(struct sock *sk, struct sk_buff *skb) | |||
| 1441 | 1441 | ||
| 1442 | static void l2cap_streaming_send(struct sock *sk) | 1442 | static void l2cap_streaming_send(struct sock *sk) |
| 1443 | { | 1443 | { |
| 1444 | struct sk_buff *skb, *tx_skb; | 1444 | struct sk_buff *skb; |
| 1445 | struct l2cap_pinfo *pi = l2cap_pi(sk); | 1445 | struct l2cap_pinfo *pi = l2cap_pi(sk); |
| 1446 | u16 control, fcs; | 1446 | u16 control, fcs; |
| 1447 | 1447 | ||
| 1448 | while ((skb = sk->sk_send_head)) { | 1448 | while ((skb = skb_dequeue(TX_QUEUE(sk)))) { |
| 1449 | tx_skb = skb_clone(skb, GFP_ATOMIC); | 1449 | control = get_unaligned_le16(skb->data + L2CAP_HDR_SIZE); |
| 1450 | |||
| 1451 | control = get_unaligned_le16(tx_skb->data + L2CAP_HDR_SIZE); | ||
| 1452 | control |= pi->next_tx_seq << L2CAP_CTRL_TXSEQ_SHIFT; | 1450 | control |= pi->next_tx_seq << L2CAP_CTRL_TXSEQ_SHIFT; |
| 1453 | put_unaligned_le16(control, tx_skb->data + L2CAP_HDR_SIZE); | 1451 | put_unaligned_le16(control, skb->data + L2CAP_HDR_SIZE); |
| 1454 | 1452 | ||
| 1455 | if (pi->fcs == L2CAP_FCS_CRC16) { | 1453 | if (pi->fcs == L2CAP_FCS_CRC16) { |
| 1456 | fcs = crc16(0, (u8 *)tx_skb->data, tx_skb->len - 2); | 1454 | fcs = crc16(0, (u8 *)skb->data, skb->len - 2); |
| 1457 | put_unaligned_le16(fcs, tx_skb->data + tx_skb->len - 2); | 1455 | put_unaligned_le16(fcs, skb->data + skb->len - 2); |
| 1458 | } | 1456 | } |
| 1459 | 1457 | ||
| 1460 | l2cap_do_send(sk, tx_skb); | 1458 | l2cap_do_send(sk, skb); |
| 1461 | 1459 | ||
| 1462 | pi->next_tx_seq = (pi->next_tx_seq + 1) % 64; | 1460 | pi->next_tx_seq = (pi->next_tx_seq + 1) % 64; |
| 1463 | |||
| 1464 | if (skb_queue_is_last(TX_QUEUE(sk), skb)) | ||
| 1465 | sk->sk_send_head = NULL; | ||
| 1466 | else | ||
| 1467 | sk->sk_send_head = skb_queue_next(TX_QUEUE(sk), skb); | ||
| 1468 | |||
| 1469 | skb = skb_dequeue(TX_QUEUE(sk)); | ||
| 1470 | kfree_skb(skb); | ||
| 1471 | } | 1461 | } |
| 1472 | } | 1462 | } |
| 1473 | 1463 | ||
| @@ -1960,6 +1950,11 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us | |||
| 1960 | 1950 | ||
| 1961 | switch (optname) { | 1951 | switch (optname) { |
| 1962 | case L2CAP_OPTIONS: | 1952 | case L2CAP_OPTIONS: |
| 1953 | if (sk->sk_state == BT_CONNECTED) { | ||
| 1954 | err = -EINVAL; | ||
| 1955 | break; | ||
| 1956 | } | ||
| 1957 | |||
| 1963 | opts.imtu = l2cap_pi(sk)->imtu; | 1958 | opts.imtu = l2cap_pi(sk)->imtu; |
| 1964 | opts.omtu = l2cap_pi(sk)->omtu; | 1959 | opts.omtu = l2cap_pi(sk)->omtu; |
| 1965 | opts.flush_to = l2cap_pi(sk)->flush_to; | 1960 | opts.flush_to = l2cap_pi(sk)->flush_to; |
| @@ -2771,10 +2766,10 @@ static int l2cap_parse_conf_rsp(struct sock *sk, void *rsp, int len, void *data, | |||
| 2771 | case L2CAP_CONF_MTU: | 2766 | case L2CAP_CONF_MTU: |
| 2772 | if (val < L2CAP_DEFAULT_MIN_MTU) { | 2767 | if (val < L2CAP_DEFAULT_MIN_MTU) { |
| 2773 | *result = L2CAP_CONF_UNACCEPT; | 2768 | *result = L2CAP_CONF_UNACCEPT; |
| 2774 | pi->omtu = L2CAP_DEFAULT_MIN_MTU; | 2769 | pi->imtu = L2CAP_DEFAULT_MIN_MTU; |
| 2775 | } else | 2770 | } else |
| 2776 | pi->omtu = val; | 2771 | pi->imtu = val; |
| 2777 | l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, pi->omtu); | 2772 | l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, pi->imtu); |
| 2778 | break; | 2773 | break; |
| 2779 | 2774 | ||
| 2780 | case L2CAP_CONF_FLUSH_TO: | 2775 | case L2CAP_CONF_FLUSH_TO: |
| @@ -3071,6 +3066,17 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd | |||
| 3071 | return 0; | 3066 | return 0; |
| 3072 | } | 3067 | } |
| 3073 | 3068 | ||
| 3069 | static inline void set_default_fcs(struct l2cap_pinfo *pi) | ||
| 3070 | { | ||
| 3071 | /* FCS is enabled only in ERTM or streaming mode, if one or both | ||
| 3072 | * sides request it. | ||
| 3073 | */ | ||
| 3074 | if (pi->mode != L2CAP_MODE_ERTM && pi->mode != L2CAP_MODE_STREAMING) | ||
| 3075 | pi->fcs = L2CAP_FCS_NONE; | ||
| 3076 | else if (!(pi->conf_state & L2CAP_CONF_NO_FCS_RECV)) | ||
| 3077 | pi->fcs = L2CAP_FCS_CRC16; | ||
| 3078 | } | ||
| 3079 | |||
| 3074 | static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u16 cmd_len, u8 *data) | 3080 | static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u16 cmd_len, u8 *data) |
| 3075 | { | 3081 | { |
| 3076 | struct l2cap_conf_req *req = (struct l2cap_conf_req *) data; | 3082 | struct l2cap_conf_req *req = (struct l2cap_conf_req *) data; |
| @@ -3088,14 +3094,8 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr | |||
| 3088 | if (!sk) | 3094 | if (!sk) |
| 3089 | return -ENOENT; | 3095 | return -ENOENT; |
| 3090 | 3096 | ||
| 3091 | if (sk->sk_state != BT_CONFIG) { | 3097 | if (sk->sk_state == BT_DISCONN) |
| 3092 | struct l2cap_cmd_rej rej; | ||
| 3093 | |||
| 3094 | rej.reason = cpu_to_le16(0x0002); | ||
| 3095 | l2cap_send_cmd(conn, cmd->ident, L2CAP_COMMAND_REJ, | ||
| 3096 | sizeof(rej), &rej); | ||
| 3097 | goto unlock; | 3098 | goto unlock; |
| 3098 | } | ||
| 3099 | 3099 | ||
| 3100 | /* Reject if config buffer is too small. */ | 3100 | /* Reject if config buffer is too small. */ |
| 3101 | len = cmd_len - sizeof(*req); | 3101 | len = cmd_len - sizeof(*req); |
| @@ -3135,9 +3135,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr | |||
| 3135 | goto unlock; | 3135 | goto unlock; |
| 3136 | 3136 | ||
| 3137 | if (l2cap_pi(sk)->conf_state & L2CAP_CONF_INPUT_DONE) { | 3137 | if (l2cap_pi(sk)->conf_state & L2CAP_CONF_INPUT_DONE) { |
| 3138 | if (!(l2cap_pi(sk)->conf_state & L2CAP_CONF_NO_FCS_RECV) || | 3138 | set_default_fcs(l2cap_pi(sk)); |
| 3139 | l2cap_pi(sk)->fcs != L2CAP_FCS_NONE) | ||
| 3140 | l2cap_pi(sk)->fcs = L2CAP_FCS_CRC16; | ||
| 3141 | 3139 | ||
| 3142 | sk->sk_state = BT_CONNECTED; | 3140 | sk->sk_state = BT_CONNECTED; |
| 3143 | 3141 | ||
| @@ -3225,9 +3223,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr | |||
| 3225 | l2cap_pi(sk)->conf_state |= L2CAP_CONF_INPUT_DONE; | 3223 | l2cap_pi(sk)->conf_state |= L2CAP_CONF_INPUT_DONE; |
| 3226 | 3224 | ||
| 3227 | if (l2cap_pi(sk)->conf_state & L2CAP_CONF_OUTPUT_DONE) { | 3225 | if (l2cap_pi(sk)->conf_state & L2CAP_CONF_OUTPUT_DONE) { |
| 3228 | if (!(l2cap_pi(sk)->conf_state & L2CAP_CONF_NO_FCS_RECV) || | 3226 | set_default_fcs(l2cap_pi(sk)); |
| 3229 | l2cap_pi(sk)->fcs != L2CAP_FCS_NONE) | ||
| 3230 | l2cap_pi(sk)->fcs = L2CAP_FCS_CRC16; | ||
| 3231 | 3227 | ||
| 3232 | sk->sk_state = BT_CONNECTED; | 3228 | sk->sk_state = BT_CONNECTED; |
| 3233 | l2cap_pi(sk)->next_tx_seq = 0; | 3229 | l2cap_pi(sk)->next_tx_seq = 0; |
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index 44a623275951..194b3a04cfd3 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
| @@ -82,11 +82,14 @@ static void rfcomm_sk_data_ready(struct rfcomm_dlc *d, struct sk_buff *skb) | |||
| 82 | static void rfcomm_sk_state_change(struct rfcomm_dlc *d, int err) | 82 | static void rfcomm_sk_state_change(struct rfcomm_dlc *d, int err) |
| 83 | { | 83 | { |
| 84 | struct sock *sk = d->owner, *parent; | 84 | struct sock *sk = d->owner, *parent; |
| 85 | unsigned long flags; | ||
| 86 | |||
| 85 | if (!sk) | 87 | if (!sk) |
| 86 | return; | 88 | return; |
| 87 | 89 | ||
| 88 | BT_DBG("dlc %p state %ld err %d", d, d->state, err); | 90 | BT_DBG("dlc %p state %ld err %d", d, d->state, err); |
| 89 | 91 | ||
| 92 | local_irq_save(flags); | ||
| 90 | bh_lock_sock(sk); | 93 | bh_lock_sock(sk); |
| 91 | 94 | ||
| 92 | if (err) | 95 | if (err) |
| @@ -108,6 +111,7 @@ static void rfcomm_sk_state_change(struct rfcomm_dlc *d, int err) | |||
| 108 | } | 111 | } |
| 109 | 112 | ||
| 110 | bh_unlock_sock(sk); | 113 | bh_unlock_sock(sk); |
| 114 | local_irq_restore(flags); | ||
| 111 | 115 | ||
| 112 | if (parent && sock_flag(sk, SOCK_ZAPPED)) { | 116 | if (parent && sock_flag(sk, SOCK_ZAPPED)) { |
| 113 | /* We have to drop DLC lock here, otherwise | 117 | /* We have to drop DLC lock here, otherwise |
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index 8ce904786116..4bf28f25f368 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c | |||
| @@ -827,6 +827,7 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr, | |||
| 827 | long timeo; | 827 | long timeo; |
| 828 | int err; | 828 | int err; |
| 829 | int ifindex, headroom, tailroom; | 829 | int ifindex, headroom, tailroom; |
| 830 | unsigned int mtu; | ||
| 830 | struct net_device *dev; | 831 | struct net_device *dev; |
| 831 | 832 | ||
| 832 | lock_sock(sk); | 833 | lock_sock(sk); |
| @@ -896,15 +897,23 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr, | |||
| 896 | cf_sk->sk.sk_state = CAIF_DISCONNECTED; | 897 | cf_sk->sk.sk_state = CAIF_DISCONNECTED; |
| 897 | goto out; | 898 | goto out; |
| 898 | } | 899 | } |
| 899 | dev = dev_get_by_index(sock_net(sk), ifindex); | 900 | |
| 901 | err = -ENODEV; | ||
| 902 | rcu_read_lock(); | ||
| 903 | dev = dev_get_by_index_rcu(sock_net(sk), ifindex); | ||
| 904 | if (!dev) { | ||
| 905 | rcu_read_unlock(); | ||
| 906 | goto out; | ||
| 907 | } | ||
| 900 | cf_sk->headroom = LL_RESERVED_SPACE_EXTRA(dev, headroom); | 908 | cf_sk->headroom = LL_RESERVED_SPACE_EXTRA(dev, headroom); |
| 909 | mtu = dev->mtu; | ||
| 910 | rcu_read_unlock(); | ||
| 911 | |||
| 901 | cf_sk->tailroom = tailroom; | 912 | cf_sk->tailroom = tailroom; |
| 902 | cf_sk->maxframe = dev->mtu - (headroom + tailroom); | 913 | cf_sk->maxframe = mtu - (headroom + tailroom); |
| 903 | dev_put(dev); | ||
| 904 | if (cf_sk->maxframe < 1) { | 914 | if (cf_sk->maxframe < 1) { |
| 905 | pr_warning("CAIF: %s(): CAIF Interface MTU too small (%d)\n", | 915 | pr_warning("CAIF: %s(): CAIF Interface MTU too small (%u)\n", |
| 906 | __func__, dev->mtu); | 916 | __func__, mtu); |
| 907 | err = -ENODEV; | ||
| 908 | goto out; | 917 | goto out; |
| 909 | } | 918 | } |
| 910 | 919 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index b9b22a3c4c8f..660dd41aaaa6 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -4845,7 +4845,7 @@ static void rollback_registered_many(struct list_head *head) | |||
| 4845 | dev = list_first_entry(head, struct net_device, unreg_list); | 4845 | dev = list_first_entry(head, struct net_device, unreg_list); |
| 4846 | call_netdevice_notifiers(NETDEV_UNREGISTER_BATCH, dev); | 4846 | call_netdevice_notifiers(NETDEV_UNREGISTER_BATCH, dev); |
| 4847 | 4847 | ||
| 4848 | synchronize_net(); | 4848 | rcu_barrier(); |
| 4849 | 4849 | ||
| 4850 | list_for_each_entry(dev, head, unreg_list) | 4850 | list_for_each_entry(dev, head, unreg_list) |
| 4851 | dev_put(dev); | 4851 | dev_put(dev); |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 7a85367b3c2f..8451ab481095 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
| @@ -348,7 +348,7 @@ static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev, | |||
| 348 | if (info.cmd == ETHTOOL_GRXCLSRLALL) { | 348 | if (info.cmd == ETHTOOL_GRXCLSRLALL) { |
| 349 | if (info.rule_cnt > 0) { | 349 | if (info.rule_cnt > 0) { |
| 350 | if (info.rule_cnt <= KMALLOC_MAX_SIZE / sizeof(u32)) | 350 | if (info.rule_cnt <= KMALLOC_MAX_SIZE / sizeof(u32)) |
| 351 | rule_buf = kmalloc(info.rule_cnt * sizeof(u32), | 351 | rule_buf = kzalloc(info.rule_cnt * sizeof(u32), |
| 352 | GFP_USER); | 352 | GFP_USER); |
| 353 | if (!rule_buf) | 353 | if (!rule_buf) |
| 354 | return -ENOMEM; | 354 | return -ENOMEM; |
| @@ -397,7 +397,7 @@ static noinline_for_stack int ethtool_get_rxfh_indir(struct net_device *dev, | |||
| 397 | (KMALLOC_MAX_SIZE - sizeof(*indir)) / sizeof(*indir->ring_index)) | 397 | (KMALLOC_MAX_SIZE - sizeof(*indir)) / sizeof(*indir->ring_index)) |
| 398 | return -ENOMEM; | 398 | return -ENOMEM; |
| 399 | full_size = sizeof(*indir) + sizeof(*indir->ring_index) * table_size; | 399 | full_size = sizeof(*indir) + sizeof(*indir->ring_index) * table_size; |
| 400 | indir = kmalloc(full_size, GFP_USER); | 400 | indir = kzalloc(full_size, GFP_USER); |
| 401 | if (!indir) | 401 | if (!indir) |
| 402 | return -ENOMEM; | 402 | return -ENOMEM; |
| 403 | 403 | ||
| @@ -538,7 +538,7 @@ static int ethtool_get_rx_ntuple(struct net_device *dev, void __user *useraddr) | |||
| 538 | 538 | ||
| 539 | gstrings.len = ret; | 539 | gstrings.len = ret; |
| 540 | 540 | ||
| 541 | data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER); | 541 | data = kzalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER); |
| 542 | if (!data) | 542 | if (!data) |
| 543 | return -ENOMEM; | 543 | return -ENOMEM; |
| 544 | 544 | ||
| @@ -775,7 +775,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr) | |||
| 775 | if (regs.len > reglen) | 775 | if (regs.len > reglen) |
| 776 | regs.len = reglen; | 776 | regs.len = reglen; |
| 777 | 777 | ||
| 778 | regbuf = kmalloc(reglen, GFP_USER); | 778 | regbuf = kzalloc(reglen, GFP_USER); |
| 779 | if (!regbuf) | 779 | if (!regbuf) |
| 780 | return -ENOMEM; | 780 | return -ENOMEM; |
| 781 | 781 | ||
diff --git a/net/core/iovec.c b/net/core/iovec.c index 1cd98df412df..e6b133b77ccb 100644 --- a/net/core/iovec.c +++ b/net/core/iovec.c | |||
| @@ -35,9 +35,10 @@ | |||
| 35 | * in any case. | 35 | * in any case. |
| 36 | */ | 36 | */ |
| 37 | 37 | ||
| 38 | int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode) | 38 | long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode) |
| 39 | { | 39 | { |
| 40 | int size, err, ct; | 40 | int size, ct; |
| 41 | long err; | ||
| 41 | 42 | ||
| 42 | if (m->msg_namelen) { | 43 | if (m->msg_namelen) { |
| 43 | if (mode == VERIFY_READ) { | 44 | if (mode == VERIFY_READ) { |
diff --git a/net/core/sock.c b/net/core/sock.c index b05b9b6ddb87..ef30e9d286e7 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
| @@ -1351,9 +1351,9 @@ int sock_i_uid(struct sock *sk) | |||
| 1351 | { | 1351 | { |
| 1352 | int uid; | 1352 | int uid; |
| 1353 | 1353 | ||
| 1354 | read_lock(&sk->sk_callback_lock); | 1354 | read_lock_bh(&sk->sk_callback_lock); |
| 1355 | uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : 0; | 1355 | uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : 0; |
| 1356 | read_unlock(&sk->sk_callback_lock); | 1356 | read_unlock_bh(&sk->sk_callback_lock); |
| 1357 | return uid; | 1357 | return uid; |
| 1358 | } | 1358 | } |
| 1359 | EXPORT_SYMBOL(sock_i_uid); | 1359 | EXPORT_SYMBOL(sock_i_uid); |
| @@ -1362,9 +1362,9 @@ unsigned long sock_i_ino(struct sock *sk) | |||
| 1362 | { | 1362 | { |
| 1363 | unsigned long ino; | 1363 | unsigned long ino; |
| 1364 | 1364 | ||
| 1365 | read_lock(&sk->sk_callback_lock); | 1365 | read_lock_bh(&sk->sk_callback_lock); |
| 1366 | ino = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_ino : 0; | 1366 | ino = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_ino : 0; |
| 1367 | read_unlock(&sk->sk_callback_lock); | 1367 | read_unlock_bh(&sk->sk_callback_lock); |
| 1368 | return ino; | 1368 | return ino; |
| 1369 | } | 1369 | } |
| 1370 | EXPORT_SYMBOL(sock_i_ino); | 1370 | EXPORT_SYMBOL(sock_i_ino); |
diff --git a/net/core/stream.c b/net/core/stream.c index d959e0f41528..f5df85dcd20b 100644 --- a/net/core/stream.c +++ b/net/core/stream.c | |||
| @@ -141,10 +141,10 @@ int sk_stream_wait_memory(struct sock *sk, long *timeo_p) | |||
| 141 | 141 | ||
| 142 | set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); | 142 | set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); |
| 143 | sk->sk_write_pending++; | 143 | sk->sk_write_pending++; |
| 144 | sk_wait_event(sk, ¤t_timeo, !sk->sk_err && | 144 | sk_wait_event(sk, ¤t_timeo, sk->sk_err || |
| 145 | !(sk->sk_shutdown & SEND_SHUTDOWN) && | 145 | (sk->sk_shutdown & SEND_SHUTDOWN) || |
| 146 | sk_stream_memory_free(sk) && | 146 | (sk_stream_memory_free(sk) && |
| 147 | vm_wait); | 147 | !vm_wait)); |
| 148 | sk->sk_write_pending--; | 148 | sk->sk_write_pending--; |
| 149 | 149 | ||
| 150 | if (vm_wait) { | 150 | if (vm_wait) { |
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig index 571f8950ed06..7cd7760144f7 100644 --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig | |||
| @@ -217,6 +217,7 @@ config NET_IPIP | |||
| 217 | 217 | ||
| 218 | config NET_IPGRE | 218 | config NET_IPGRE |
| 219 | tristate "IP: GRE tunnels over IP" | 219 | tristate "IP: GRE tunnels over IP" |
| 220 | depends on IPV6 || IPV6=n | ||
| 220 | help | 221 | help |
| 221 | Tunneling means encapsulating data of one protocol type within | 222 | Tunneling means encapsulating data of one protocol type within |
| 222 | another protocol and sending it over a channel that understands the | 223 | another protocol and sending it over a channel that understands the |
| @@ -412,7 +413,7 @@ config INET_XFRM_MODE_BEET | |||
| 412 | If unsure, say Y. | 413 | If unsure, say Y. |
| 413 | 414 | ||
| 414 | config INET_LRO | 415 | config INET_LRO |
| 415 | bool "Large Receive Offload (ipv4/tcp)" | 416 | tristate "Large Receive Offload (ipv4/tcp)" |
| 416 | default y | 417 | default y |
| 417 | ---help--- | 418 | ---help--- |
| 418 | Support for Large Receive Offload (ipv4/tcp). | 419 | Support for Large Receive Offload (ipv4/tcp). |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index a1ad0e7180d2..2a4bb76f2132 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
| @@ -856,6 +856,18 @@ static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb, | |||
| 856 | igmpv3_clear_delrec(in_dev); | 856 | igmpv3_clear_delrec(in_dev); |
| 857 | } else if (len < 12) { | 857 | } else if (len < 12) { |
| 858 | return; /* ignore bogus packet; freed by caller */ | 858 | return; /* ignore bogus packet; freed by caller */ |
| 859 | } else if (IGMP_V1_SEEN(in_dev)) { | ||
| 860 | /* This is a v3 query with v1 queriers present */ | ||
| 861 | max_delay = IGMP_Query_Response_Interval; | ||
| 862 | group = 0; | ||
| 863 | } else if (IGMP_V2_SEEN(in_dev)) { | ||
| 864 | /* this is a v3 query with v2 queriers present; | ||
| 865 | * Interpretation of the max_delay code is problematic here. | ||
| 866 | * A real v2 host would use ih_code directly, while v3 has a | ||
| 867 | * different encoding. We use the v3 encoding as more likely | ||
| 868 | * to be intended in a v3 query. | ||
| 869 | */ | ||
| 870 | max_delay = IGMPV3_MRC(ih3->code)*(HZ/IGMP_TIMER_SCALE); | ||
| 859 | } else { /* v3 */ | 871 | } else { /* v3 */ |
| 860 | if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) | 872 | if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) |
| 861 | return; | 873 | return; |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 945b20a5ad50..35c93e8b6a46 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
| @@ -45,7 +45,7 @@ | |||
| 45 | #include <net/netns/generic.h> | 45 | #include <net/netns/generic.h> |
| 46 | #include <net/rtnetlink.h> | 46 | #include <net/rtnetlink.h> |
| 47 | 47 | ||
| 48 | #ifdef CONFIG_IPV6 | 48 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
| 49 | #include <net/ipv6.h> | 49 | #include <net/ipv6.h> |
| 50 | #include <net/ip6_fib.h> | 50 | #include <net/ip6_fib.h> |
| 51 | #include <net/ip6_route.h> | 51 | #include <net/ip6_route.h> |
| @@ -699,7 +699,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev | |||
| 699 | if ((dst = rt->rt_gateway) == 0) | 699 | if ((dst = rt->rt_gateway) == 0) |
| 700 | goto tx_error_icmp; | 700 | goto tx_error_icmp; |
| 701 | } | 701 | } |
| 702 | #ifdef CONFIG_IPV6 | 702 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
| 703 | else if (skb->protocol == htons(ETH_P_IPV6)) { | 703 | else if (skb->protocol == htons(ETH_P_IPV6)) { |
| 704 | struct in6_addr *addr6; | 704 | struct in6_addr *addr6; |
| 705 | int addr_type; | 705 | int addr_type; |
| @@ -774,7 +774,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev | |||
| 774 | goto tx_error; | 774 | goto tx_error; |
| 775 | } | 775 | } |
| 776 | } | 776 | } |
| 777 | #ifdef CONFIG_IPV6 | 777 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
| 778 | else if (skb->protocol == htons(ETH_P_IPV6)) { | 778 | else if (skb->protocol == htons(ETH_P_IPV6)) { |
| 779 | struct rt6_info *rt6 = (struct rt6_info *)skb_dst(skb); | 779 | struct rt6_info *rt6 = (struct rt6_info *)skb_dst(skb); |
| 780 | 780 | ||
| @@ -850,7 +850,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev | |||
| 850 | if ((iph->ttl = tiph->ttl) == 0) { | 850 | if ((iph->ttl = tiph->ttl) == 0) { |
| 851 | if (skb->protocol == htons(ETH_P_IP)) | 851 | if (skb->protocol == htons(ETH_P_IP)) |
| 852 | iph->ttl = old_iph->ttl; | 852 | iph->ttl = old_iph->ttl; |
| 853 | #ifdef CONFIG_IPV6 | 853 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
| 854 | else if (skb->protocol == htons(ETH_P_IPV6)) | 854 | else if (skb->protocol == htons(ETH_P_IPV6)) |
| 855 | iph->ttl = ((struct ipv6hdr *)old_iph)->hop_limit; | 855 | iph->ttl = ((struct ipv6hdr *)old_iph)->hop_limit; |
| 856 | #endif | 856 | #endif |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 04b69896df5f..7649d7750075 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
| @@ -488,9 +488,8 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
| 488 | * we can switch to copy when see the first bad fragment. | 488 | * we can switch to copy when see the first bad fragment. |
| 489 | */ | 489 | */ |
| 490 | if (skb_has_frags(skb)) { | 490 | if (skb_has_frags(skb)) { |
| 491 | struct sk_buff *frag; | 491 | struct sk_buff *frag, *frag2; |
| 492 | int first_len = skb_pagelen(skb); | 492 | int first_len = skb_pagelen(skb); |
| 493 | int truesizes = 0; | ||
| 494 | 493 | ||
| 495 | if (first_len - hlen > mtu || | 494 | if (first_len - hlen > mtu || |
| 496 | ((first_len - hlen) & 7) || | 495 | ((first_len - hlen) & 7) || |
| @@ -503,18 +502,18 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
| 503 | if (frag->len > mtu || | 502 | if (frag->len > mtu || |
| 504 | ((frag->len & 7) && frag->next) || | 503 | ((frag->len & 7) && frag->next) || |
| 505 | skb_headroom(frag) < hlen) | 504 | skb_headroom(frag) < hlen) |
| 506 | goto slow_path; | 505 | goto slow_path_clean; |
| 507 | 506 | ||
| 508 | /* Partially cloned skb? */ | 507 | /* Partially cloned skb? */ |
| 509 | if (skb_shared(frag)) | 508 | if (skb_shared(frag)) |
| 510 | goto slow_path; | 509 | goto slow_path_clean; |
| 511 | 510 | ||
| 512 | BUG_ON(frag->sk); | 511 | BUG_ON(frag->sk); |
| 513 | if (skb->sk) { | 512 | if (skb->sk) { |
| 514 | frag->sk = skb->sk; | 513 | frag->sk = skb->sk; |
| 515 | frag->destructor = sock_wfree; | 514 | frag->destructor = sock_wfree; |
| 516 | } | 515 | } |
| 517 | truesizes += frag->truesize; | 516 | skb->truesize -= frag->truesize; |
| 518 | } | 517 | } |
| 519 | 518 | ||
| 520 | /* Everything is OK. Generate! */ | 519 | /* Everything is OK. Generate! */ |
| @@ -524,7 +523,6 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
| 524 | frag = skb_shinfo(skb)->frag_list; | 523 | frag = skb_shinfo(skb)->frag_list; |
| 525 | skb_frag_list_init(skb); | 524 | skb_frag_list_init(skb); |
| 526 | skb->data_len = first_len - skb_headlen(skb); | 525 | skb->data_len = first_len - skb_headlen(skb); |
| 527 | skb->truesize -= truesizes; | ||
| 528 | skb->len = first_len; | 526 | skb->len = first_len; |
| 529 | iph->tot_len = htons(first_len); | 527 | iph->tot_len = htons(first_len); |
| 530 | iph->frag_off = htons(IP_MF); | 528 | iph->frag_off = htons(IP_MF); |
| @@ -576,6 +574,15 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
| 576 | } | 574 | } |
| 577 | IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS); | 575 | IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS); |
| 578 | return err; | 576 | return err; |
| 577 | |||
| 578 | slow_path_clean: | ||
| 579 | skb_walk_frags(skb, frag2) { | ||
| 580 | if (frag2 == frag) | ||
| 581 | break; | ||
| 582 | frag2->sk = NULL; | ||
| 583 | frag2->destructor = NULL; | ||
| 584 | skb->truesize += frag2->truesize; | ||
| 585 | } | ||
| 579 | } | 586 | } |
| 580 | 587 | ||
| 581 | slow_path: | 588 | slow_path: |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 6c40a8c46e79..64b70ad162e3 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
| @@ -1129,6 +1129,9 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname, | |||
| 1129 | case IP_HDRINCL: | 1129 | case IP_HDRINCL: |
| 1130 | val = inet->hdrincl; | 1130 | val = inet->hdrincl; |
| 1131 | break; | 1131 | break; |
| 1132 | case IP_NODEFRAG: | ||
| 1133 | val = inet->nodefrag; | ||
| 1134 | break; | ||
| 1132 | case IP_MTU_DISCOVER: | 1135 | case IP_MTU_DISCOVER: |
| 1133 | val = inet->pmtudisc; | 1136 | val = inet->pmtudisc; |
| 1134 | break; | 1137 | break; |
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c index b254dafaf429..43eec80c0e7c 100644 --- a/net/ipv4/netfilter/ipt_REJECT.c +++ b/net/ipv4/netfilter/ipt_REJECT.c | |||
| @@ -112,6 +112,7 @@ static void send_reset(struct sk_buff *oldskb, int hook) | |||
| 112 | /* ip_route_me_harder expects skb->dst to be set */ | 112 | /* ip_route_me_harder expects skb->dst to be set */ |
| 113 | skb_dst_set_noref(nskb, skb_dst(oldskb)); | 113 | skb_dst_set_noref(nskb, skb_dst(oldskb)); |
| 114 | 114 | ||
| 115 | nskb->protocol = htons(ETH_P_IP); | ||
| 115 | if (ip_route_me_harder(nskb, addr_type)) | 116 | if (ip_route_me_harder(nskb, addr_type)) |
| 116 | goto free_nskb; | 117 | goto free_nskb; |
| 117 | 118 | ||
diff --git a/net/ipv4/netfilter/nf_defrag_ipv4.c b/net/ipv4/netfilter/nf_defrag_ipv4.c index eab8de32f200..f3a9b42b16c6 100644 --- a/net/ipv4/netfilter/nf_defrag_ipv4.c +++ b/net/ipv4/netfilter/nf_defrag_ipv4.c | |||
| @@ -66,9 +66,11 @@ static unsigned int ipv4_conntrack_defrag(unsigned int hooknum, | |||
| 66 | const struct net_device *out, | 66 | const struct net_device *out, |
| 67 | int (*okfn)(struct sk_buff *)) | 67 | int (*okfn)(struct sk_buff *)) |
| 68 | { | 68 | { |
| 69 | struct sock *sk = skb->sk; | ||
| 69 | struct inet_sock *inet = inet_sk(skb->sk); | 70 | struct inet_sock *inet = inet_sk(skb->sk); |
| 70 | 71 | ||
| 71 | if (inet && inet->nodefrag) | 72 | if (sk && (sk->sk_family == PF_INET) && |
| 73 | inet->nodefrag) | ||
| 72 | return NF_ACCEPT; | 74 | return NF_ACCEPT; |
| 73 | 75 | ||
| 74 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 76 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c index 1679e2c0963d..ee5f419d0a56 100644 --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c | |||
| @@ -893,13 +893,15 @@ static void fast_csum(__sum16 *csum, | |||
| 893 | unsigned char s[4]; | 893 | unsigned char s[4]; |
| 894 | 894 | ||
| 895 | if (offset & 1) { | 895 | if (offset & 1) { |
| 896 | s[0] = s[2] = 0; | 896 | s[0] = ~0; |
| 897 | s[1] = ~*optr; | 897 | s[1] = ~*optr; |
| 898 | s[2] = 0; | ||
| 898 | s[3] = *nptr; | 899 | s[3] = *nptr; |
| 899 | } else { | 900 | } else { |
| 900 | s[1] = s[3] = 0; | ||
| 901 | s[0] = ~*optr; | 901 | s[0] = ~*optr; |
| 902 | s[1] = ~0; | ||
| 902 | s[2] = *nptr; | 903 | s[2] = *nptr; |
| 904 | s[3] = 0; | ||
| 903 | } | 905 | } |
| 904 | 906 | ||
| 905 | *csum = csum_fold(csum_partial(s, 4, ~csum_unfold(*csum))); | 907 | *csum = csum_fold(csum_partial(s, 4, ~csum_unfold(*csum))); |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 6298f75d5e93..ac6559cb54f9 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -1231,7 +1231,7 @@ restart: | |||
| 1231 | } | 1231 | } |
| 1232 | 1232 | ||
| 1233 | if (net_ratelimit()) | 1233 | if (net_ratelimit()) |
| 1234 | printk(KERN_WARNING "Neighbour table overflow.\n"); | 1234 | printk(KERN_WARNING "ipv4: Neighbour table overflow.\n"); |
| 1235 | rt_drop(rt); | 1235 | rt_drop(rt); |
| 1236 | return -ENOBUFS; | 1236 | return -ENOBUFS; |
| 1237 | } | 1237 | } |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 3fb1428e526e..f115ea68a4ef 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
| @@ -386,8 +386,6 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait) | |||
| 386 | */ | 386 | */ |
| 387 | 387 | ||
| 388 | mask = 0; | 388 | mask = 0; |
| 389 | if (sk->sk_err) | ||
| 390 | mask = POLLERR; | ||
| 391 | 389 | ||
| 392 | /* | 390 | /* |
| 393 | * POLLHUP is certainly not done right. But poll() doesn't | 391 | * POLLHUP is certainly not done right. But poll() doesn't |
| @@ -457,6 +455,11 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait) | |||
| 457 | if (tp->urg_data & TCP_URG_VALID) | 455 | if (tp->urg_data & TCP_URG_VALID) |
| 458 | mask |= POLLPRI; | 456 | mask |= POLLPRI; |
| 459 | } | 457 | } |
| 458 | /* This barrier is coupled with smp_wmb() in tcp_reset() */ | ||
| 459 | smp_rmb(); | ||
| 460 | if (sk->sk_err) | ||
| 461 | mask |= POLLERR; | ||
| 462 | |||
| 460 | return mask; | 463 | return mask; |
| 461 | } | 464 | } |
| 462 | EXPORT_SYMBOL(tcp_poll); | 465 | EXPORT_SYMBOL(tcp_poll); |
| @@ -940,7 +943,7 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 940 | sg = sk->sk_route_caps & NETIF_F_SG; | 943 | sg = sk->sk_route_caps & NETIF_F_SG; |
| 941 | 944 | ||
| 942 | while (--iovlen >= 0) { | 945 | while (--iovlen >= 0) { |
| 943 | int seglen = iov->iov_len; | 946 | size_t seglen = iov->iov_len; |
| 944 | unsigned char __user *from = iov->iov_base; | 947 | unsigned char __user *from = iov->iov_base; |
| 945 | 948 | ||
| 946 | iov++; | 949 | iov++; |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index e663b78a2ef6..b55f60f6fcbe 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -2545,7 +2545,8 @@ static void tcp_mark_head_lost(struct sock *sk, int packets) | |||
| 2545 | cnt += tcp_skb_pcount(skb); | 2545 | cnt += tcp_skb_pcount(skb); |
| 2546 | 2546 | ||
| 2547 | if (cnt > packets) { | 2547 | if (cnt > packets) { |
| 2548 | if (tcp_is_sack(tp) || (oldcnt >= packets)) | 2548 | if ((tcp_is_sack(tp) && !tcp_is_fack(tp)) || |
| 2549 | (oldcnt >= packets)) | ||
| 2549 | break; | 2550 | break; |
| 2550 | 2551 | ||
| 2551 | mss = skb_shinfo(skb)->gso_size; | 2552 | mss = skb_shinfo(skb)->gso_size; |
| @@ -4048,6 +4049,8 @@ static void tcp_reset(struct sock *sk) | |||
| 4048 | default: | 4049 | default: |
| 4049 | sk->sk_err = ECONNRESET; | 4050 | sk->sk_err = ECONNRESET; |
| 4050 | } | 4051 | } |
| 4052 | /* This barrier is coupled with smp_rmb() in tcp_poll() */ | ||
| 4053 | smp_wmb(); | ||
| 4051 | 4054 | ||
| 4052 | if (!sock_flag(sk, SOCK_DEAD)) | 4055 | if (!sock_flag(sk, SOCK_DEAD)) |
| 4053 | sk->sk_error_report(sk); | 4056 | sk->sk_error_report(sk); |
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index c35b469e851c..74c54b30600f 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
| @@ -135,13 +135,16 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk) | |||
| 135 | 135 | ||
| 136 | /* This function calculates a "timeout" which is equivalent to the timeout of a | 136 | /* This function calculates a "timeout" which is equivalent to the timeout of a |
| 137 | * TCP connection after "boundary" unsuccessful, exponentially backed-off | 137 | * TCP connection after "boundary" unsuccessful, exponentially backed-off |
| 138 | * retransmissions with an initial RTO of TCP_RTO_MIN. | 138 | * retransmissions with an initial RTO of TCP_RTO_MIN or TCP_TIMEOUT_INIT if |
| 139 | * syn_set flag is set. | ||
| 139 | */ | 140 | */ |
| 140 | static bool retransmits_timed_out(struct sock *sk, | 141 | static bool retransmits_timed_out(struct sock *sk, |
| 141 | unsigned int boundary) | 142 | unsigned int boundary, |
| 143 | bool syn_set) | ||
| 142 | { | 144 | { |
| 143 | unsigned int timeout, linear_backoff_thresh; | 145 | unsigned int timeout, linear_backoff_thresh; |
| 144 | unsigned int start_ts; | 146 | unsigned int start_ts; |
| 147 | unsigned int rto_base = syn_set ? TCP_TIMEOUT_INIT : TCP_RTO_MIN; | ||
| 145 | 148 | ||
| 146 | if (!inet_csk(sk)->icsk_retransmits) | 149 | if (!inet_csk(sk)->icsk_retransmits) |
| 147 | return false; | 150 | return false; |
| @@ -151,12 +154,12 @@ static bool retransmits_timed_out(struct sock *sk, | |||
| 151 | else | 154 | else |
| 152 | start_ts = tcp_sk(sk)->retrans_stamp; | 155 | start_ts = tcp_sk(sk)->retrans_stamp; |
| 153 | 156 | ||
| 154 | linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN); | 157 | linear_backoff_thresh = ilog2(TCP_RTO_MAX/rto_base); |
| 155 | 158 | ||
| 156 | if (boundary <= linear_backoff_thresh) | 159 | if (boundary <= linear_backoff_thresh) |
| 157 | timeout = ((2 << boundary) - 1) * TCP_RTO_MIN; | 160 | timeout = ((2 << boundary) - 1) * rto_base; |
| 158 | else | 161 | else |
| 159 | timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN + | 162 | timeout = ((2 << linear_backoff_thresh) - 1) * rto_base + |
| 160 | (boundary - linear_backoff_thresh) * TCP_RTO_MAX; | 163 | (boundary - linear_backoff_thresh) * TCP_RTO_MAX; |
| 161 | 164 | ||
| 162 | return (tcp_time_stamp - start_ts) >= timeout; | 165 | return (tcp_time_stamp - start_ts) >= timeout; |
| @@ -167,14 +170,15 @@ static int tcp_write_timeout(struct sock *sk) | |||
| 167 | { | 170 | { |
| 168 | struct inet_connection_sock *icsk = inet_csk(sk); | 171 | struct inet_connection_sock *icsk = inet_csk(sk); |
| 169 | int retry_until; | 172 | int retry_until; |
| 170 | bool do_reset; | 173 | bool do_reset, syn_set = 0; |
| 171 | 174 | ||
| 172 | if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) { | 175 | if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) { |
| 173 | if (icsk->icsk_retransmits) | 176 | if (icsk->icsk_retransmits) |
| 174 | dst_negative_advice(sk); | 177 | dst_negative_advice(sk); |
| 175 | retry_until = icsk->icsk_syn_retries ? : sysctl_tcp_syn_retries; | 178 | retry_until = icsk->icsk_syn_retries ? : sysctl_tcp_syn_retries; |
| 179 | syn_set = 1; | ||
| 176 | } else { | 180 | } else { |
| 177 | if (retransmits_timed_out(sk, sysctl_tcp_retries1)) { | 181 | if (retransmits_timed_out(sk, sysctl_tcp_retries1, 0)) { |
| 178 | /* Black hole detection */ | 182 | /* Black hole detection */ |
| 179 | tcp_mtu_probing(icsk, sk); | 183 | tcp_mtu_probing(icsk, sk); |
| 180 | 184 | ||
| @@ -187,14 +191,14 @@ static int tcp_write_timeout(struct sock *sk) | |||
| 187 | 191 | ||
| 188 | retry_until = tcp_orphan_retries(sk, alive); | 192 | retry_until = tcp_orphan_retries(sk, alive); |
| 189 | do_reset = alive || | 193 | do_reset = alive || |
| 190 | !retransmits_timed_out(sk, retry_until); | 194 | !retransmits_timed_out(sk, retry_until, 0); |
| 191 | 195 | ||
| 192 | if (tcp_out_of_resources(sk, do_reset)) | 196 | if (tcp_out_of_resources(sk, do_reset)) |
| 193 | return 1; | 197 | return 1; |
| 194 | } | 198 | } |
| 195 | } | 199 | } |
| 196 | 200 | ||
| 197 | if (retransmits_timed_out(sk, retry_until)) { | 201 | if (retransmits_timed_out(sk, retry_until, syn_set)) { |
| 198 | /* Has it gone just too far? */ | 202 | /* Has it gone just too far? */ |
| 199 | tcp_write_err(sk); | 203 | tcp_write_err(sk); |
| 200 | return 1; | 204 | return 1; |
| @@ -436,7 +440,7 @@ out_reset_timer: | |||
| 436 | icsk->icsk_rto = min(icsk->icsk_rto << 1, TCP_RTO_MAX); | 440 | icsk->icsk_rto = min(icsk->icsk_rto << 1, TCP_RTO_MAX); |
| 437 | } | 441 | } |
| 438 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, TCP_RTO_MAX); | 442 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, TCP_RTO_MAX); |
| 439 | if (retransmits_timed_out(sk, sysctl_tcp_retries1 + 1)) | 443 | if (retransmits_timed_out(sk, sysctl_tcp_retries1 + 1, 0)) |
| 440 | __sk_dst_reset(sk); | 444 | __sk_dst_reset(sk); |
| 441 | 445 | ||
| 442 | out:; | 446 | out:; |
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 869078d4eeb9..a580349f0b8a 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c | |||
| @@ -61,7 +61,7 @@ static int xfrm4_get_saddr(struct net *net, | |||
| 61 | 61 | ||
| 62 | static int xfrm4_get_tos(struct flowi *fl) | 62 | static int xfrm4_get_tos(struct flowi *fl) |
| 63 | { | 63 | { |
| 64 | return fl->fl4_tos; | 64 | return IPTOS_RT_MASK & fl->fl4_tos; /* Strip ECN bits */ |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | static int xfrm4_init_path(struct xfrm_dst *path, struct dst_entry *dst, | 67 | static int xfrm4_init_path(struct xfrm_dst *path, struct dst_entry *dst, |
diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c index 1ef1366a0a03..47947624eccc 100644 --- a/net/ipv4/xfrm4_state.c +++ b/net/ipv4/xfrm4_state.c | |||
| @@ -21,21 +21,25 @@ static int xfrm4_init_flags(struct xfrm_state *x) | |||
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | static void | 23 | static void |
| 24 | __xfrm4_init_tempsel(struct xfrm_state *x, struct flowi *fl, | 24 | __xfrm4_init_tempsel(struct xfrm_selector *sel, struct flowi *fl) |
| 25 | struct xfrm_tmpl *tmpl, | 25 | { |
| 26 | xfrm_address_t *daddr, xfrm_address_t *saddr) | 26 | sel->daddr.a4 = fl->fl4_dst; |
| 27 | sel->saddr.a4 = fl->fl4_src; | ||
| 28 | sel->dport = xfrm_flowi_dport(fl); | ||
| 29 | sel->dport_mask = htons(0xffff); | ||
| 30 | sel->sport = xfrm_flowi_sport(fl); | ||
| 31 | sel->sport_mask = htons(0xffff); | ||
| 32 | sel->family = AF_INET; | ||
| 33 | sel->prefixlen_d = 32; | ||
| 34 | sel->prefixlen_s = 32; | ||
| 35 | sel->proto = fl->proto; | ||
| 36 | sel->ifindex = fl->oif; | ||
| 37 | } | ||
| 38 | |||
| 39 | static void | ||
| 40 | xfrm4_init_temprop(struct xfrm_state *x, struct xfrm_tmpl *tmpl, | ||
| 41 | xfrm_address_t *daddr, xfrm_address_t *saddr) | ||
| 27 | { | 42 | { |
| 28 | x->sel.daddr.a4 = fl->fl4_dst; | ||
| 29 | x->sel.saddr.a4 = fl->fl4_src; | ||
| 30 | x->sel.dport = xfrm_flowi_dport(fl); | ||
| 31 | x->sel.dport_mask = htons(0xffff); | ||
| 32 | x->sel.sport = xfrm_flowi_sport(fl); | ||
| 33 | x->sel.sport_mask = htons(0xffff); | ||
| 34 | x->sel.family = AF_INET; | ||
| 35 | x->sel.prefixlen_d = 32; | ||
| 36 | x->sel.prefixlen_s = 32; | ||
| 37 | x->sel.proto = fl->proto; | ||
| 38 | x->sel.ifindex = fl->oif; | ||
| 39 | x->id = tmpl->id; | 43 | x->id = tmpl->id; |
| 40 | if (x->id.daddr.a4 == 0) | 44 | if (x->id.daddr.a4 == 0) |
| 41 | x->id.daddr.a4 = daddr->a4; | 45 | x->id.daddr.a4 = daddr->a4; |
| @@ -70,6 +74,7 @@ static struct xfrm_state_afinfo xfrm4_state_afinfo = { | |||
| 70 | .owner = THIS_MODULE, | 74 | .owner = THIS_MODULE, |
| 71 | .init_flags = xfrm4_init_flags, | 75 | .init_flags = xfrm4_init_flags, |
| 72 | .init_tempsel = __xfrm4_init_tempsel, | 76 | .init_tempsel = __xfrm4_init_tempsel, |
| 77 | .init_temprop = xfrm4_init_temprop, | ||
| 73 | .output = xfrm4_output, | 78 | .output = xfrm4_output, |
| 74 | .extract_input = xfrm4_extract_input, | 79 | .extract_input = xfrm4_extract_input, |
| 75 | .extract_output = xfrm4_extract_output, | 80 | .extract_output = xfrm4_extract_output, |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index ab70a3fbcafa..324fac3b6c16 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
| @@ -4637,10 +4637,12 @@ int __init addrconf_init(void) | |||
| 4637 | if (err < 0) { | 4637 | if (err < 0) { |
| 4638 | printk(KERN_CRIT "IPv6 Addrconf:" | 4638 | printk(KERN_CRIT "IPv6 Addrconf:" |
| 4639 | " cannot initialize default policy table: %d.\n", err); | 4639 | " cannot initialize default policy table: %d.\n", err); |
| 4640 | return err; | 4640 | goto out; |
| 4641 | } | 4641 | } |
| 4642 | 4642 | ||
| 4643 | register_pernet_subsys(&addrconf_ops); | 4643 | err = register_pernet_subsys(&addrconf_ops); |
| 4644 | if (err < 0) | ||
| 4645 | goto out_addrlabel; | ||
| 4644 | 4646 | ||
| 4645 | /* The addrconf netdev notifier requires that loopback_dev | 4647 | /* The addrconf netdev notifier requires that loopback_dev |
| 4646 | * has it's ipv6 private information allocated and setup | 4648 | * has it's ipv6 private information allocated and setup |
| @@ -4692,7 +4694,9 @@ errout: | |||
| 4692 | unregister_netdevice_notifier(&ipv6_dev_notf); | 4694 | unregister_netdevice_notifier(&ipv6_dev_notf); |
| 4693 | errlo: | 4695 | errlo: |
| 4694 | unregister_pernet_subsys(&addrconf_ops); | 4696 | unregister_pernet_subsys(&addrconf_ops); |
| 4695 | 4697 | out_addrlabel: | |
| 4698 | ipv6_addr_label_cleanup(); | ||
| 4699 | out: | ||
| 4696 | return err; | 4700 | return err; |
| 4697 | } | 4701 | } |
| 4698 | 4702 | ||
| @@ -4703,6 +4707,7 @@ void addrconf_cleanup(void) | |||
| 4703 | 4707 | ||
| 4704 | unregister_netdevice_notifier(&ipv6_dev_notf); | 4708 | unregister_netdevice_notifier(&ipv6_dev_notf); |
| 4705 | unregister_pernet_subsys(&addrconf_ops); | 4709 | unregister_pernet_subsys(&addrconf_ops); |
| 4710 | ipv6_addr_label_cleanup(); | ||
| 4706 | 4711 | ||
| 4707 | rtnl_lock(); | 4712 | rtnl_lock(); |
| 4708 | 4713 | ||
diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c index f0e774cea386..8175f802651b 100644 --- a/net/ipv6/addrlabel.c +++ b/net/ipv6/addrlabel.c | |||
| @@ -393,6 +393,11 @@ int __init ipv6_addr_label_init(void) | |||
| 393 | return register_pernet_subsys(&ipv6_addr_label_ops); | 393 | return register_pernet_subsys(&ipv6_addr_label_ops); |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | void ipv6_addr_label_cleanup(void) | ||
| 397 | { | ||
| 398 | unregister_pernet_subsys(&ipv6_addr_label_ops); | ||
| 399 | } | ||
| 400 | |||
| 396 | static const struct nla_policy ifal_policy[IFAL_MAX+1] = { | 401 | static const struct nla_policy ifal_policy[IFAL_MAX+1] = { |
| 397 | [IFAL_ADDRESS] = { .len = sizeof(struct in6_addr), }, | 402 | [IFAL_ADDRESS] = { .len = sizeof(struct in6_addr), }, |
| 398 | [IFAL_LABEL] = { .len = sizeof(u32), }, | 403 | [IFAL_LABEL] = { .len = sizeof(u32), }, |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index d40b330c0ee6..980912ed7a38 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
| @@ -639,7 +639,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
| 639 | 639 | ||
| 640 | if (skb_has_frags(skb)) { | 640 | if (skb_has_frags(skb)) { |
| 641 | int first_len = skb_pagelen(skb); | 641 | int first_len = skb_pagelen(skb); |
| 642 | int truesizes = 0; | 642 | struct sk_buff *frag2; |
| 643 | 643 | ||
| 644 | if (first_len - hlen > mtu || | 644 | if (first_len - hlen > mtu || |
| 645 | ((first_len - hlen) & 7) || | 645 | ((first_len - hlen) & 7) || |
| @@ -651,18 +651,18 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
| 651 | if (frag->len > mtu || | 651 | if (frag->len > mtu || |
| 652 | ((frag->len & 7) && frag->next) || | 652 | ((frag->len & 7) && frag->next) || |
| 653 | skb_headroom(frag) < hlen) | 653 | skb_headroom(frag) < hlen) |
| 654 | goto slow_path; | 654 | goto slow_path_clean; |
| 655 | 655 | ||
| 656 | /* Partially cloned skb? */ | 656 | /* Partially cloned skb? */ |
| 657 | if (skb_shared(frag)) | 657 | if (skb_shared(frag)) |
| 658 | goto slow_path; | 658 | goto slow_path_clean; |
| 659 | 659 | ||
| 660 | BUG_ON(frag->sk); | 660 | BUG_ON(frag->sk); |
| 661 | if (skb->sk) { | 661 | if (skb->sk) { |
| 662 | frag->sk = skb->sk; | 662 | frag->sk = skb->sk; |
| 663 | frag->destructor = sock_wfree; | 663 | frag->destructor = sock_wfree; |
| 664 | truesizes += frag->truesize; | ||
| 665 | } | 664 | } |
| 665 | skb->truesize -= frag->truesize; | ||
| 666 | } | 666 | } |
| 667 | 667 | ||
| 668 | err = 0; | 668 | err = 0; |
| @@ -693,7 +693,6 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
| 693 | 693 | ||
| 694 | first_len = skb_pagelen(skb); | 694 | first_len = skb_pagelen(skb); |
| 695 | skb->data_len = first_len - skb_headlen(skb); | 695 | skb->data_len = first_len - skb_headlen(skb); |
| 696 | skb->truesize -= truesizes; | ||
| 697 | skb->len = first_len; | 696 | skb->len = first_len; |
| 698 | ipv6_hdr(skb)->payload_len = htons(first_len - | 697 | ipv6_hdr(skb)->payload_len = htons(first_len - |
| 699 | sizeof(struct ipv6hdr)); | 698 | sizeof(struct ipv6hdr)); |
| @@ -756,6 +755,15 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
| 756 | IPSTATS_MIB_FRAGFAILS); | 755 | IPSTATS_MIB_FRAGFAILS); |
| 757 | dst_release(&rt->dst); | 756 | dst_release(&rt->dst); |
| 758 | return err; | 757 | return err; |
| 758 | |||
| 759 | slow_path_clean: | ||
| 760 | skb_walk_frags(skb, frag2) { | ||
| 761 | if (frag2 == frag) | ||
| 762 | break; | ||
| 763 | frag2->sk = NULL; | ||
| 764 | frag2->destructor = NULL; | ||
| 765 | skb->truesize += frag2->truesize; | ||
| 766 | } | ||
| 759 | } | 767 | } |
| 760 | 768 | ||
| 761 | slow_path: | 769 | slow_path: |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index d126365ac046..a275c6e1e25c 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
| @@ -670,7 +670,7 @@ static struct rt6_info *rt6_alloc_cow(struct rt6_info *ort, struct in6_addr *dad | |||
| 670 | 670 | ||
| 671 | if (net_ratelimit()) | 671 | if (net_ratelimit()) |
| 672 | printk(KERN_WARNING | 672 | printk(KERN_WARNING |
| 673 | "Neighbour table overflow.\n"); | 673 | "ipv6: Neighbour table overflow.\n"); |
| 674 | dst_free(&rt->dst); | 674 | dst_free(&rt->dst); |
| 675 | return NULL; | 675 | return NULL; |
| 676 | } | 676 | } |
| @@ -1556,14 +1556,13 @@ out: | |||
| 1556 | * i.e. Path MTU discovery | 1556 | * i.e. Path MTU discovery |
| 1557 | */ | 1557 | */ |
| 1558 | 1558 | ||
| 1559 | void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr, | 1559 | static void rt6_do_pmtu_disc(struct in6_addr *daddr, struct in6_addr *saddr, |
| 1560 | struct net_device *dev, u32 pmtu) | 1560 | struct net *net, u32 pmtu, int ifindex) |
| 1561 | { | 1561 | { |
| 1562 | struct rt6_info *rt, *nrt; | 1562 | struct rt6_info *rt, *nrt; |
| 1563 | struct net *net = dev_net(dev); | ||
| 1564 | int allfrag = 0; | 1563 | int allfrag = 0; |
| 1565 | 1564 | ||
| 1566 | rt = rt6_lookup(net, daddr, saddr, dev->ifindex, 0); | 1565 | rt = rt6_lookup(net, daddr, saddr, ifindex, 0); |
| 1567 | if (rt == NULL) | 1566 | if (rt == NULL) |
| 1568 | return; | 1567 | return; |
| 1569 | 1568 | ||
| @@ -1631,6 +1630,27 @@ out: | |||
| 1631 | dst_release(&rt->dst); | 1630 | dst_release(&rt->dst); |
| 1632 | } | 1631 | } |
| 1633 | 1632 | ||
| 1633 | void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr, | ||
| 1634 | struct net_device *dev, u32 pmtu) | ||
| 1635 | { | ||
| 1636 | struct net *net = dev_net(dev); | ||
| 1637 | |||
| 1638 | /* | ||
| 1639 | * RFC 1981 states that a node "MUST reduce the size of the packets it | ||
| 1640 | * is sending along the path" that caused the Packet Too Big message. | ||
| 1641 | * Since it's not possible in the general case to determine which | ||
| 1642 | * interface was used to send the original packet, we update the MTU | ||
| 1643 | * on the interface that will be used to send future packets. We also | ||
| 1644 | * update the MTU on the interface that received the Packet Too Big in | ||
| 1645 | * case the original packet was forced out that interface with | ||
| 1646 | * SO_BINDTODEVICE or similar. This is the next best thing to the | ||
| 1647 | * correct behaviour, which would be to update the MTU on all | ||
| 1648 | * interfaces. | ||
| 1649 | */ | ||
| 1650 | rt6_do_pmtu_disc(daddr, saddr, net, pmtu, 0); | ||
| 1651 | rt6_do_pmtu_disc(daddr, saddr, net, pmtu, dev->ifindex); | ||
| 1652 | } | ||
| 1653 | |||
| 1634 | /* | 1654 | /* |
| 1635 | * Misc support functions | 1655 | * Misc support functions |
| 1636 | */ | 1656 | */ |
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c index f417b77fa0e1..a67575d472a3 100644 --- a/net/ipv6/xfrm6_state.c +++ b/net/ipv6/xfrm6_state.c | |||
| @@ -20,23 +20,27 @@ | |||
| 20 | #include <net/addrconf.h> | 20 | #include <net/addrconf.h> |
| 21 | 21 | ||
| 22 | static void | 22 | static void |
| 23 | __xfrm6_init_tempsel(struct xfrm_state *x, struct flowi *fl, | 23 | __xfrm6_init_tempsel(struct xfrm_selector *sel, struct flowi *fl) |
| 24 | struct xfrm_tmpl *tmpl, | ||
| 25 | xfrm_address_t *daddr, xfrm_address_t *saddr) | ||
| 26 | { | 24 | { |
| 27 | /* Initialize temporary selector matching only | 25 | /* Initialize temporary selector matching only |
| 28 | * to current session. */ | 26 | * to current session. */ |
| 29 | ipv6_addr_copy((struct in6_addr *)&x->sel.daddr, &fl->fl6_dst); | 27 | ipv6_addr_copy((struct in6_addr *)&sel->daddr, &fl->fl6_dst); |
| 30 | ipv6_addr_copy((struct in6_addr *)&x->sel.saddr, &fl->fl6_src); | 28 | ipv6_addr_copy((struct in6_addr *)&sel->saddr, &fl->fl6_src); |
| 31 | x->sel.dport = xfrm_flowi_dport(fl); | 29 | sel->dport = xfrm_flowi_dport(fl); |
| 32 | x->sel.dport_mask = htons(0xffff); | 30 | sel->dport_mask = htons(0xffff); |
| 33 | x->sel.sport = xfrm_flowi_sport(fl); | 31 | sel->sport = xfrm_flowi_sport(fl); |
| 34 | x->sel.sport_mask = htons(0xffff); | 32 | sel->sport_mask = htons(0xffff); |
| 35 | x->sel.family = AF_INET6; | 33 | sel->family = AF_INET6; |
| 36 | x->sel.prefixlen_d = 128; | 34 | sel->prefixlen_d = 128; |
| 37 | x->sel.prefixlen_s = 128; | 35 | sel->prefixlen_s = 128; |
| 38 | x->sel.proto = fl->proto; | 36 | sel->proto = fl->proto; |
| 39 | x->sel.ifindex = fl->oif; | 37 | sel->ifindex = fl->oif; |
| 38 | } | ||
| 39 | |||
| 40 | static void | ||
| 41 | xfrm6_init_temprop(struct xfrm_state *x, struct xfrm_tmpl *tmpl, | ||
| 42 | xfrm_address_t *daddr, xfrm_address_t *saddr) | ||
| 43 | { | ||
| 40 | x->id = tmpl->id; | 44 | x->id = tmpl->id; |
| 41 | if (ipv6_addr_any((struct in6_addr*)&x->id.daddr)) | 45 | if (ipv6_addr_any((struct in6_addr*)&x->id.daddr)) |
| 42 | memcpy(&x->id.daddr, daddr, sizeof(x->sel.daddr)); | 46 | memcpy(&x->id.daddr, daddr, sizeof(x->sel.daddr)); |
| @@ -168,6 +172,7 @@ static struct xfrm_state_afinfo xfrm6_state_afinfo = { | |||
| 168 | .eth_proto = htons(ETH_P_IPV6), | 172 | .eth_proto = htons(ETH_P_IPV6), |
| 169 | .owner = THIS_MODULE, | 173 | .owner = THIS_MODULE, |
| 170 | .init_tempsel = __xfrm6_init_tempsel, | 174 | .init_tempsel = __xfrm6_init_tempsel, |
| 175 | .init_temprop = xfrm6_init_temprop, | ||
| 171 | .tmpl_sort = __xfrm6_tmpl_sort, | 176 | .tmpl_sort = __xfrm6_tmpl_sort, |
| 172 | .state_sort = __xfrm6_state_sort, | 177 | .state_sort = __xfrm6_state_sort, |
| 173 | .output = xfrm6_output, | 178 | .output = xfrm6_output, |
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index 023ba820236f..582612998211 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
| @@ -1024,7 +1024,8 @@ static int llc_ui_setsockopt(struct socket *sock, int level, int optname, | |||
| 1024 | { | 1024 | { |
| 1025 | struct sock *sk = sock->sk; | 1025 | struct sock *sk = sock->sk; |
| 1026 | struct llc_sock *llc = llc_sk(sk); | 1026 | struct llc_sock *llc = llc_sk(sk); |
| 1027 | int rc = -EINVAL, opt; | 1027 | unsigned int opt; |
| 1028 | int rc = -EINVAL; | ||
| 1028 | 1029 | ||
| 1029 | lock_sock(sk); | 1030 | lock_sock(sk); |
| 1030 | if (unlikely(level != SOL_LLC || optlen != sizeof(int))) | 1031 | if (unlikely(level != SOL_LLC || optlen != sizeof(int))) |
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c index e4dae0244d76..cf4aea3ba30f 100644 --- a/net/llc/llc_station.c +++ b/net/llc/llc_station.c | |||
| @@ -689,7 +689,7 @@ static void llc_station_rcv(struct sk_buff *skb) | |||
| 689 | 689 | ||
| 690 | int __init llc_station_init(void) | 690 | int __init llc_station_init(void) |
| 691 | { | 691 | { |
| 692 | u16 rc = -ENOBUFS; | 692 | int rc = -ENOBUFS; |
| 693 | struct sk_buff *skb; | 693 | struct sk_buff *skb; |
| 694 | struct llc_station_state_ev *ev; | 694 | struct llc_station_state_ev *ev; |
| 695 | 695 | ||
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index c893f236acea..8f23401832b7 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
| @@ -175,6 +175,8 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | |||
| 175 | 175 | ||
| 176 | set_bit(HT_AGG_STATE_STOPPING, &tid_tx->state); | 176 | set_bit(HT_AGG_STATE_STOPPING, &tid_tx->state); |
| 177 | 177 | ||
| 178 | del_timer_sync(&tid_tx->addba_resp_timer); | ||
| 179 | |||
| 178 | /* | 180 | /* |
| 179 | * After this packets are no longer handed right through | 181 | * After this packets are no longer handed right through |
| 180 | * to the driver but are put onto tid_tx->pending instead, | 182 | * to the driver but are put onto tid_tx->pending instead, |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index fa0f37e4afe4..28624282c5f3 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -2199,9 +2199,6 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, | |||
| 2199 | struct net_device *prev_dev = NULL; | 2199 | struct net_device *prev_dev = NULL; |
| 2200 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | 2200 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); |
| 2201 | 2201 | ||
| 2202 | if (status->flag & RX_FLAG_INTERNAL_CMTR) | ||
| 2203 | goto out_free_skb; | ||
| 2204 | |||
| 2205 | if (skb_headroom(skb) < sizeof(*rthdr) && | 2202 | if (skb_headroom(skb) < sizeof(*rthdr) && |
| 2206 | pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC)) | 2203 | pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC)) |
| 2207 | goto out_free_skb; | 2204 | goto out_free_skb; |
| @@ -2260,7 +2257,6 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, | |||
| 2260 | } else | 2257 | } else |
| 2261 | goto out_free_skb; | 2258 | goto out_free_skb; |
| 2262 | 2259 | ||
| 2263 | status->flag |= RX_FLAG_INTERNAL_CMTR; | ||
| 2264 | return; | 2260 | return; |
| 2265 | 2261 | ||
| 2266 | out_free_skb: | 2262 | out_free_skb: |
diff --git a/net/mac80211/status.c b/net/mac80211/status.c index 10caec5ea8fa..34da67995d94 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c | |||
| @@ -377,7 +377,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
| 377 | skb2 = skb_clone(skb, GFP_ATOMIC); | 377 | skb2 = skb_clone(skb, GFP_ATOMIC); |
| 378 | if (skb2) { | 378 | if (skb2) { |
| 379 | skb2->dev = prev_dev; | 379 | skb2->dev = prev_dev; |
| 380 | netif_receive_skb(skb2); | 380 | netif_rx(skb2); |
| 381 | } | 381 | } |
| 382 | } | 382 | } |
| 383 | 383 | ||
| @@ -386,7 +386,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
| 386 | } | 386 | } |
| 387 | if (prev_dev) { | 387 | if (prev_dev) { |
| 388 | skb->dev = prev_dev; | 388 | skb->dev = prev_dev; |
| 389 | netif_receive_skb(skb); | 389 | netif_rx(skb); |
| 390 | skb = NULL; | 390 | skb = NULL; |
| 391 | } | 391 | } |
| 392 | rcu_read_unlock(); | 392 | rcu_read_unlock(); |
diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c index 7dcf7a404190..8d9e4c949b96 100644 --- a/net/netfilter/nf_conntrack_extend.c +++ b/net/netfilter/nf_conntrack_extend.c | |||
| @@ -48,15 +48,17 @@ nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, gfp_t gfp) | |||
| 48 | { | 48 | { |
| 49 | unsigned int off, len; | 49 | unsigned int off, len; |
| 50 | struct nf_ct_ext_type *t; | 50 | struct nf_ct_ext_type *t; |
| 51 | size_t alloc_size; | ||
| 51 | 52 | ||
| 52 | rcu_read_lock(); | 53 | rcu_read_lock(); |
| 53 | t = rcu_dereference(nf_ct_ext_types[id]); | 54 | t = rcu_dereference(nf_ct_ext_types[id]); |
| 54 | BUG_ON(t == NULL); | 55 | BUG_ON(t == NULL); |
| 55 | off = ALIGN(sizeof(struct nf_ct_ext), t->align); | 56 | off = ALIGN(sizeof(struct nf_ct_ext), t->align); |
| 56 | len = off + t->len; | 57 | len = off + t->len; |
| 58 | alloc_size = t->alloc_size; | ||
| 57 | rcu_read_unlock(); | 59 | rcu_read_unlock(); |
| 58 | 60 | ||
| 59 | *ext = kzalloc(t->alloc_size, gfp); | 61 | *ext = kzalloc(alloc_size, gfp); |
| 60 | if (!*ext) | 62 | if (!*ext) |
| 61 | return NULL; | 63 | return NULL; |
| 62 | 64 | ||
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c index 53d892210a04..f64de9544866 100644 --- a/net/netfilter/nf_conntrack_sip.c +++ b/net/netfilter/nf_conntrack_sip.c | |||
| @@ -1376,7 +1376,7 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff, | |||
| 1376 | unsigned int msglen, origlen; | 1376 | unsigned int msglen, origlen; |
| 1377 | const char *dptr, *end; | 1377 | const char *dptr, *end; |
| 1378 | s16 diff, tdiff = 0; | 1378 | s16 diff, tdiff = 0; |
| 1379 | int ret; | 1379 | int ret = NF_ACCEPT; |
| 1380 | typeof(nf_nat_sip_seq_adjust_hook) nf_nat_sip_seq_adjust; | 1380 | typeof(nf_nat_sip_seq_adjust_hook) nf_nat_sip_seq_adjust; |
| 1381 | 1381 | ||
| 1382 | if (ctinfo != IP_CT_ESTABLISHED && | 1382 | if (ctinfo != IP_CT_ESTABLISHED && |
diff --git a/net/netfilter/nf_tproxy_core.c b/net/netfilter/nf_tproxy_core.c index 5490fc37c92d..daab8c4a903c 100644 --- a/net/netfilter/nf_tproxy_core.c +++ b/net/netfilter/nf_tproxy_core.c | |||
| @@ -70,7 +70,11 @@ nf_tproxy_destructor(struct sk_buff *skb) | |||
| 70 | int | 70 | int |
| 71 | nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk) | 71 | nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk) |
| 72 | { | 72 | { |
| 73 | if (inet_sk(sk)->transparent) { | 73 | bool transparent = (sk->sk_state == TCP_TIME_WAIT) ? |
| 74 | inet_twsk(sk)->tw_transparent : | ||
| 75 | inet_sk(sk)->transparent; | ||
| 76 | |||
| 77 | if (transparent) { | ||
| 74 | skb_orphan(skb); | 78 | skb_orphan(skb); |
| 75 | skb->sk = sk; | 79 | skb->sk = sk; |
| 76 | skb->destructor = nf_tproxy_destructor; | 80 | skb->destructor = nf_tproxy_destructor; |
diff --git a/net/phonet/pep.c b/net/phonet/pep.c index b2a3ae6cad78..15003021f4f0 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c | |||
| @@ -225,12 +225,13 @@ static void pipe_grant_credits(struct sock *sk) | |||
| 225 | static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb) | 225 | static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb) |
| 226 | { | 226 | { |
| 227 | struct pep_sock *pn = pep_sk(sk); | 227 | struct pep_sock *pn = pep_sk(sk); |
| 228 | struct pnpipehdr *hdr = pnp_hdr(skb); | 228 | struct pnpipehdr *hdr; |
| 229 | int wake = 0; | 229 | int wake = 0; |
| 230 | 230 | ||
| 231 | if (!pskb_may_pull(skb, sizeof(*hdr) + 4)) | 231 | if (!pskb_may_pull(skb, sizeof(*hdr) + 4)) |
| 232 | return -EINVAL; | 232 | return -EINVAL; |
| 233 | 233 | ||
| 234 | hdr = pnp_hdr(skb); | ||
| 234 | if (hdr->data[0] != PN_PEP_TYPE_COMMON) { | 235 | if (hdr->data[0] != PN_PEP_TYPE_COMMON) { |
| 235 | LIMIT_NETDEBUG(KERN_DEBUG"Phonet unknown PEP type: %u\n", | 236 | LIMIT_NETDEBUG(KERN_DEBUG"Phonet unknown PEP type: %u\n", |
| 236 | (unsigned)hdr->data[0]); | 237 | (unsigned)hdr->data[0]); |
diff --git a/net/rds/page.c b/net/rds/page.c index 595a952d4b17..1dfbfea12e9b 100644 --- a/net/rds/page.c +++ b/net/rds/page.c | |||
| @@ -57,30 +57,17 @@ int rds_page_copy_user(struct page *page, unsigned long offset, | |||
| 57 | unsigned long ret; | 57 | unsigned long ret; |
| 58 | void *addr; | 58 | void *addr; |
| 59 | 59 | ||
| 60 | if (to_user) | 60 | addr = kmap(page); |
| 61 | if (to_user) { | ||
| 61 | rds_stats_add(s_copy_to_user, bytes); | 62 | rds_stats_add(s_copy_to_user, bytes); |
| 62 | else | 63 | ret = copy_to_user(ptr, addr + offset, bytes); |
| 64 | } else { | ||
| 63 | rds_stats_add(s_copy_from_user, bytes); | 65 | rds_stats_add(s_copy_from_user, bytes); |
| 64 | 66 | ret = copy_from_user(addr + offset, ptr, bytes); | |
| 65 | addr = kmap_atomic(page, KM_USER0); | ||
| 66 | if (to_user) | ||
| 67 | ret = __copy_to_user_inatomic(ptr, addr + offset, bytes); | ||
| 68 | else | ||
| 69 | ret = __copy_from_user_inatomic(addr + offset, ptr, bytes); | ||
| 70 | kunmap_atomic(addr, KM_USER0); | ||
| 71 | |||
| 72 | if (ret) { | ||
| 73 | addr = kmap(page); | ||
| 74 | if (to_user) | ||
| 75 | ret = copy_to_user(ptr, addr + offset, bytes); | ||
| 76 | else | ||
| 77 | ret = copy_from_user(addr + offset, ptr, bytes); | ||
| 78 | kunmap(page); | ||
| 79 | if (ret) | ||
| 80 | return -EFAULT; | ||
| 81 | } | 67 | } |
| 68 | kunmap(page); | ||
| 82 | 69 | ||
| 83 | return 0; | 70 | return ret ? -EFAULT : 0; |
| 84 | } | 71 | } |
| 85 | EXPORT_SYMBOL_GPL(rds_page_copy_user); | 72 | EXPORT_SYMBOL_GPL(rds_page_copy_user); |
| 86 | 73 | ||
diff --git a/net/rds/tcp_connect.c b/net/rds/tcp_connect.c index c397524c039c..c519939e8da9 100644 --- a/net/rds/tcp_connect.c +++ b/net/rds/tcp_connect.c | |||
| @@ -43,7 +43,7 @@ void rds_tcp_state_change(struct sock *sk) | |||
| 43 | struct rds_connection *conn; | 43 | struct rds_connection *conn; |
| 44 | struct rds_tcp_connection *tc; | 44 | struct rds_tcp_connection *tc; |
| 45 | 45 | ||
| 46 | read_lock(&sk->sk_callback_lock); | 46 | read_lock_bh(&sk->sk_callback_lock); |
| 47 | conn = sk->sk_user_data; | 47 | conn = sk->sk_user_data; |
| 48 | if (conn == NULL) { | 48 | if (conn == NULL) { |
| 49 | state_change = sk->sk_state_change; | 49 | state_change = sk->sk_state_change; |
| @@ -68,7 +68,7 @@ void rds_tcp_state_change(struct sock *sk) | |||
| 68 | break; | 68 | break; |
| 69 | } | 69 | } |
| 70 | out: | 70 | out: |
| 71 | read_unlock(&sk->sk_callback_lock); | 71 | read_unlock_bh(&sk->sk_callback_lock); |
| 72 | state_change(sk); | 72 | state_change(sk); |
| 73 | } | 73 | } |
| 74 | 74 | ||
diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c index 975183fe6950..27844f231d10 100644 --- a/net/rds/tcp_listen.c +++ b/net/rds/tcp_listen.c | |||
| @@ -114,7 +114,7 @@ void rds_tcp_listen_data_ready(struct sock *sk, int bytes) | |||
| 114 | 114 | ||
| 115 | rdsdebug("listen data ready sk %p\n", sk); | 115 | rdsdebug("listen data ready sk %p\n", sk); |
| 116 | 116 | ||
| 117 | read_lock(&sk->sk_callback_lock); | 117 | read_lock_bh(&sk->sk_callback_lock); |
| 118 | ready = sk->sk_user_data; | 118 | ready = sk->sk_user_data; |
| 119 | if (ready == NULL) { /* check for teardown race */ | 119 | if (ready == NULL) { /* check for teardown race */ |
| 120 | ready = sk->sk_data_ready; | 120 | ready = sk->sk_data_ready; |
| @@ -131,7 +131,7 @@ void rds_tcp_listen_data_ready(struct sock *sk, int bytes) | |||
| 131 | queue_work(rds_wq, &rds_tcp_listen_work); | 131 | queue_work(rds_wq, &rds_tcp_listen_work); |
| 132 | 132 | ||
| 133 | out: | 133 | out: |
| 134 | read_unlock(&sk->sk_callback_lock); | 134 | read_unlock_bh(&sk->sk_callback_lock); |
| 135 | ready(sk, bytes); | 135 | ready(sk, bytes); |
| 136 | } | 136 | } |
| 137 | 137 | ||
diff --git a/net/rds/tcp_recv.c b/net/rds/tcp_recv.c index 1aba6878fa5d..e43797404102 100644 --- a/net/rds/tcp_recv.c +++ b/net/rds/tcp_recv.c | |||
| @@ -324,7 +324,7 @@ void rds_tcp_data_ready(struct sock *sk, int bytes) | |||
| 324 | 324 | ||
| 325 | rdsdebug("data ready sk %p bytes %d\n", sk, bytes); | 325 | rdsdebug("data ready sk %p bytes %d\n", sk, bytes); |
| 326 | 326 | ||
| 327 | read_lock(&sk->sk_callback_lock); | 327 | read_lock_bh(&sk->sk_callback_lock); |
| 328 | conn = sk->sk_user_data; | 328 | conn = sk->sk_user_data; |
| 329 | if (conn == NULL) { /* check for teardown race */ | 329 | if (conn == NULL) { /* check for teardown race */ |
| 330 | ready = sk->sk_data_ready; | 330 | ready = sk->sk_data_ready; |
| @@ -338,7 +338,7 @@ void rds_tcp_data_ready(struct sock *sk, int bytes) | |||
| 338 | if (rds_tcp_read_sock(conn, GFP_ATOMIC, KM_SOFTIRQ0) == -ENOMEM) | 338 | if (rds_tcp_read_sock(conn, GFP_ATOMIC, KM_SOFTIRQ0) == -ENOMEM) |
| 339 | queue_delayed_work(rds_wq, &conn->c_recv_w, 0); | 339 | queue_delayed_work(rds_wq, &conn->c_recv_w, 0); |
| 340 | out: | 340 | out: |
| 341 | read_unlock(&sk->sk_callback_lock); | 341 | read_unlock_bh(&sk->sk_callback_lock); |
| 342 | ready(sk, bytes); | 342 | ready(sk, bytes); |
| 343 | } | 343 | } |
| 344 | 344 | ||
diff --git a/net/rds/tcp_send.c b/net/rds/tcp_send.c index a28b895ff0d1..2f012a07d94d 100644 --- a/net/rds/tcp_send.c +++ b/net/rds/tcp_send.c | |||
| @@ -224,7 +224,7 @@ void rds_tcp_write_space(struct sock *sk) | |||
| 224 | struct rds_connection *conn; | 224 | struct rds_connection *conn; |
| 225 | struct rds_tcp_connection *tc; | 225 | struct rds_tcp_connection *tc; |
| 226 | 226 | ||
| 227 | read_lock(&sk->sk_callback_lock); | 227 | read_lock_bh(&sk->sk_callback_lock); |
| 228 | conn = sk->sk_user_data; | 228 | conn = sk->sk_user_data; |
| 229 | if (conn == NULL) { | 229 | if (conn == NULL) { |
| 230 | write_space = sk->sk_write_space; | 230 | write_space = sk->sk_write_space; |
| @@ -244,7 +244,7 @@ void rds_tcp_write_space(struct sock *sk) | |||
| 244 | queue_delayed_work(rds_wq, &conn->c_send_w, 0); | 244 | queue_delayed_work(rds_wq, &conn->c_send_w, 0); |
| 245 | 245 | ||
| 246 | out: | 246 | out: |
| 247 | read_unlock(&sk->sk_callback_lock); | 247 | read_unlock_bh(&sk->sk_callback_lock); |
| 248 | 248 | ||
| 249 | /* | 249 | /* |
| 250 | * write_space is only called when data leaves tcp's send queue if | 250 | * write_space is only called when data leaves tcp's send queue if |
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 8e45e76a95f5..d952e7eac188 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
| @@ -679,7 +679,7 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
| 679 | if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1) | 679 | if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1) |
| 680 | return -EINVAL; | 680 | return -EINVAL; |
| 681 | 681 | ||
| 682 | if (addr->srose_ndigis > ROSE_MAX_DIGIS) | 682 | if ((unsigned int) addr->srose_ndigis > ROSE_MAX_DIGIS) |
| 683 | return -EINVAL; | 683 | return -EINVAL; |
| 684 | 684 | ||
| 685 | if ((dev = rose_dev_get(&addr->srose_addr)) == NULL) { | 685 | if ((dev = rose_dev_get(&addr->srose_addr)) == NULL) { |
| @@ -739,7 +739,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le | |||
| 739 | if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1) | 739 | if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1) |
| 740 | return -EINVAL; | 740 | return -EINVAL; |
| 741 | 741 | ||
| 742 | if (addr->srose_ndigis > ROSE_MAX_DIGIS) | 742 | if ((unsigned int) addr->srose_ndigis > ROSE_MAX_DIGIS) |
| 743 | return -EINVAL; | 743 | return -EINVAL; |
| 744 | 744 | ||
| 745 | /* Source + Destination digis should not exceed ROSE_MAX_DIGIS */ | 745 | /* Source + Destination digis should not exceed ROSE_MAX_DIGIS */ |
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 7416a5c73b2a..b0c2a82178af 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
| @@ -137,7 +137,7 @@ next_knode: | |||
| 137 | int toff = off + key->off + (off2 & key->offmask); | 137 | int toff = off + key->off + (off2 & key->offmask); |
| 138 | __be32 *data, _data; | 138 | __be32 *data, _data; |
| 139 | 139 | ||
| 140 | if (skb_headroom(skb) + toff < 0) | 140 | if (skb_headroom(skb) + toff > INT_MAX) |
| 141 | goto out; | 141 | goto out; |
| 142 | 142 | ||
| 143 | data = skb_header_pointer(skb, toff, 4, &_data); | 143 | data = skb_header_pointer(skb, toff, 4, &_data); |
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index 340662789529..6318e1136b83 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c | |||
| @@ -255,10 +255,6 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, | |||
| 255 | error = -EINVAL; | 255 | error = -EINVAL; |
| 256 | goto err_out; | 256 | goto err_out; |
| 257 | } | 257 | } |
| 258 | if (!list_empty(&flow->list)) { | ||
| 259 | error = -EEXIST; | ||
| 260 | goto err_out; | ||
| 261 | } | ||
| 262 | } else { | 258 | } else { |
| 263 | int i; | 259 | int i; |
| 264 | unsigned long cl; | 260 | unsigned long cl; |
diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 86366390038a..ddbbf7c81fa1 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c | |||
| @@ -543,16 +543,20 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc) | |||
| 543 | id = ntohs(hmacs->hmac_ids[i]); | 543 | id = ntohs(hmacs->hmac_ids[i]); |
| 544 | 544 | ||
| 545 | /* Check the id is in the supported range */ | 545 | /* Check the id is in the supported range */ |
| 546 | if (id > SCTP_AUTH_HMAC_ID_MAX) | 546 | if (id > SCTP_AUTH_HMAC_ID_MAX) { |
| 547 | id = 0; | ||
| 547 | continue; | 548 | continue; |
| 549 | } | ||
| 548 | 550 | ||
| 549 | /* See is we support the id. Supported IDs have name and | 551 | /* See is we support the id. Supported IDs have name and |
| 550 | * length fields set, so that we can allocated and use | 552 | * length fields set, so that we can allocated and use |
| 551 | * them. We can safely just check for name, for without the | 553 | * them. We can safely just check for name, for without the |
| 552 | * name, we can't allocate the TFM. | 554 | * name, we can't allocate the TFM. |
| 553 | */ | 555 | */ |
| 554 | if (!sctp_hmac_list[id].hmac_name) | 556 | if (!sctp_hmac_list[id].hmac_name) { |
| 557 | id = 0; | ||
| 555 | continue; | 558 | continue; |
| 559 | } | ||
| 556 | 560 | ||
| 557 | break; | 561 | break; |
| 558 | } | 562 | } |
diff --git a/net/sctp/output.c b/net/sctp/output.c index a646681f5acd..bcc4590ccaf2 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
| @@ -92,7 +92,6 @@ struct sctp_packet *sctp_packet_config(struct sctp_packet *packet, | |||
| 92 | SCTP_DEBUG_PRINTK("%s: packet:%p vtag:0x%x\n", __func__, | 92 | SCTP_DEBUG_PRINTK("%s: packet:%p vtag:0x%x\n", __func__, |
| 93 | packet, vtag); | 93 | packet, vtag); |
| 94 | 94 | ||
| 95 | sctp_packet_reset(packet); | ||
| 96 | packet->vtag = vtag; | 95 | packet->vtag = vtag; |
| 97 | 96 | ||
| 98 | if (ecn_capable && sctp_packet_empty(packet)) { | 97 | if (ecn_capable && sctp_packet_empty(packet)) { |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index ca44917872d2..fbb70770ad05 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
| @@ -916,6 +916,11 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk, | |||
| 916 | /* Walk through the addrs buffer and count the number of addresses. */ | 916 | /* Walk through the addrs buffer and count the number of addresses. */ |
| 917 | addr_buf = kaddrs; | 917 | addr_buf = kaddrs; |
| 918 | while (walk_size < addrs_size) { | 918 | while (walk_size < addrs_size) { |
| 919 | if (walk_size + sizeof(sa_family_t) > addrs_size) { | ||
| 920 | kfree(kaddrs); | ||
| 921 | return -EINVAL; | ||
| 922 | } | ||
| 923 | |||
| 919 | sa_addr = (struct sockaddr *)addr_buf; | 924 | sa_addr = (struct sockaddr *)addr_buf; |
| 920 | af = sctp_get_af_specific(sa_addr->sa_family); | 925 | af = sctp_get_af_specific(sa_addr->sa_family); |
| 921 | 926 | ||
| @@ -1002,9 +1007,13 @@ static int __sctp_connect(struct sock* sk, | |||
| 1002 | /* Walk through the addrs buffer and count the number of addresses. */ | 1007 | /* Walk through the addrs buffer and count the number of addresses. */ |
| 1003 | addr_buf = kaddrs; | 1008 | addr_buf = kaddrs; |
| 1004 | while (walk_size < addrs_size) { | 1009 | while (walk_size < addrs_size) { |
| 1010 | if (walk_size + sizeof(sa_family_t) > addrs_size) { | ||
| 1011 | err = -EINVAL; | ||
| 1012 | goto out_free; | ||
| 1013 | } | ||
| 1014 | |||
| 1005 | sa_addr = (union sctp_addr *)addr_buf; | 1015 | sa_addr = (union sctp_addr *)addr_buf; |
| 1006 | af = sctp_get_af_specific(sa_addr->sa.sa_family); | 1016 | af = sctp_get_af_specific(sa_addr->sa.sa_family); |
| 1007 | port = ntohs(sa_addr->v4.sin_port); | ||
| 1008 | 1017 | ||
| 1009 | /* If the address family is not supported or if this address | 1018 | /* If the address family is not supported or if this address |
| 1010 | * causes the address buffer to overflow return EINVAL. | 1019 | * causes the address buffer to overflow return EINVAL. |
| @@ -1014,6 +1023,8 @@ static int __sctp_connect(struct sock* sk, | |||
| 1014 | goto out_free; | 1023 | goto out_free; |
| 1015 | } | 1024 | } |
| 1016 | 1025 | ||
| 1026 | port = ntohs(sa_addr->v4.sin_port); | ||
| 1027 | |||
| 1017 | /* Save current address so we can work with it */ | 1028 | /* Save current address so we can work with it */ |
| 1018 | memcpy(&to, sa_addr, af->sockaddr_len); | 1029 | memcpy(&to, sa_addr, af->sockaddr_len); |
| 1019 | 1030 | ||
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index b6309db56226..fe9306bf10cc 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
| @@ -800,7 +800,7 @@ static void xs_udp_data_ready(struct sock *sk, int len) | |||
| 800 | u32 _xid; | 800 | u32 _xid; |
| 801 | __be32 *xp; | 801 | __be32 *xp; |
| 802 | 802 | ||
| 803 | read_lock(&sk->sk_callback_lock); | 803 | read_lock_bh(&sk->sk_callback_lock); |
| 804 | dprintk("RPC: xs_udp_data_ready...\n"); | 804 | dprintk("RPC: xs_udp_data_ready...\n"); |
| 805 | if (!(xprt = xprt_from_sock(sk))) | 805 | if (!(xprt = xprt_from_sock(sk))) |
| 806 | goto out; | 806 | goto out; |
| @@ -852,7 +852,7 @@ static void xs_udp_data_ready(struct sock *sk, int len) | |||
| 852 | dropit: | 852 | dropit: |
| 853 | skb_free_datagram(sk, skb); | 853 | skb_free_datagram(sk, skb); |
| 854 | out: | 854 | out: |
| 855 | read_unlock(&sk->sk_callback_lock); | 855 | read_unlock_bh(&sk->sk_callback_lock); |
| 856 | } | 856 | } |
| 857 | 857 | ||
| 858 | static inline void xs_tcp_read_fraghdr(struct rpc_xprt *xprt, struct xdr_skb_reader *desc) | 858 | static inline void xs_tcp_read_fraghdr(struct rpc_xprt *xprt, struct xdr_skb_reader *desc) |
| @@ -1229,7 +1229,7 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes) | |||
| 1229 | 1229 | ||
| 1230 | dprintk("RPC: xs_tcp_data_ready...\n"); | 1230 | dprintk("RPC: xs_tcp_data_ready...\n"); |
| 1231 | 1231 | ||
| 1232 | read_lock(&sk->sk_callback_lock); | 1232 | read_lock_bh(&sk->sk_callback_lock); |
| 1233 | if (!(xprt = xprt_from_sock(sk))) | 1233 | if (!(xprt = xprt_from_sock(sk))) |
| 1234 | goto out; | 1234 | goto out; |
| 1235 | if (xprt->shutdown) | 1235 | if (xprt->shutdown) |
| @@ -1248,7 +1248,7 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes) | |||
| 1248 | read = tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv); | 1248 | read = tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv); |
| 1249 | } while (read > 0); | 1249 | } while (read > 0); |
| 1250 | out: | 1250 | out: |
| 1251 | read_unlock(&sk->sk_callback_lock); | 1251 | read_unlock_bh(&sk->sk_callback_lock); |
| 1252 | } | 1252 | } |
| 1253 | 1253 | ||
| 1254 | /* | 1254 | /* |
| @@ -1301,7 +1301,7 @@ static void xs_tcp_state_change(struct sock *sk) | |||
| 1301 | { | 1301 | { |
| 1302 | struct rpc_xprt *xprt; | 1302 | struct rpc_xprt *xprt; |
| 1303 | 1303 | ||
| 1304 | read_lock(&sk->sk_callback_lock); | 1304 | read_lock_bh(&sk->sk_callback_lock); |
| 1305 | if (!(xprt = xprt_from_sock(sk))) | 1305 | if (!(xprt = xprt_from_sock(sk))) |
| 1306 | goto out; | 1306 | goto out; |
| 1307 | dprintk("RPC: xs_tcp_state_change client %p...\n", xprt); | 1307 | dprintk("RPC: xs_tcp_state_change client %p...\n", xprt); |
| @@ -1313,7 +1313,7 @@ static void xs_tcp_state_change(struct sock *sk) | |||
| 1313 | 1313 | ||
| 1314 | switch (sk->sk_state) { | 1314 | switch (sk->sk_state) { |
| 1315 | case TCP_ESTABLISHED: | 1315 | case TCP_ESTABLISHED: |
| 1316 | spin_lock_bh(&xprt->transport_lock); | 1316 | spin_lock(&xprt->transport_lock); |
| 1317 | if (!xprt_test_and_set_connected(xprt)) { | 1317 | if (!xprt_test_and_set_connected(xprt)) { |
| 1318 | struct sock_xprt *transport = container_of(xprt, | 1318 | struct sock_xprt *transport = container_of(xprt, |
| 1319 | struct sock_xprt, xprt); | 1319 | struct sock_xprt, xprt); |
| @@ -1327,7 +1327,7 @@ static void xs_tcp_state_change(struct sock *sk) | |||
| 1327 | 1327 | ||
| 1328 | xprt_wake_pending_tasks(xprt, -EAGAIN); | 1328 | xprt_wake_pending_tasks(xprt, -EAGAIN); |
| 1329 | } | 1329 | } |
| 1330 | spin_unlock_bh(&xprt->transport_lock); | 1330 | spin_unlock(&xprt->transport_lock); |
| 1331 | break; | 1331 | break; |
| 1332 | case TCP_FIN_WAIT1: | 1332 | case TCP_FIN_WAIT1: |
| 1333 | /* The client initiated a shutdown of the socket */ | 1333 | /* The client initiated a shutdown of the socket */ |
| @@ -1365,7 +1365,7 @@ static void xs_tcp_state_change(struct sock *sk) | |||
| 1365 | xs_sock_mark_closed(xprt); | 1365 | xs_sock_mark_closed(xprt); |
| 1366 | } | 1366 | } |
| 1367 | out: | 1367 | out: |
| 1368 | read_unlock(&sk->sk_callback_lock); | 1368 | read_unlock_bh(&sk->sk_callback_lock); |
| 1369 | } | 1369 | } |
| 1370 | 1370 | ||
| 1371 | /** | 1371 | /** |
| @@ -1376,7 +1376,7 @@ static void xs_error_report(struct sock *sk) | |||
| 1376 | { | 1376 | { |
| 1377 | struct rpc_xprt *xprt; | 1377 | struct rpc_xprt *xprt; |
| 1378 | 1378 | ||
| 1379 | read_lock(&sk->sk_callback_lock); | 1379 | read_lock_bh(&sk->sk_callback_lock); |
| 1380 | if (!(xprt = xprt_from_sock(sk))) | 1380 | if (!(xprt = xprt_from_sock(sk))) |
| 1381 | goto out; | 1381 | goto out; |
| 1382 | dprintk("RPC: %s client %p...\n" | 1382 | dprintk("RPC: %s client %p...\n" |
| @@ -1384,7 +1384,7 @@ static void xs_error_report(struct sock *sk) | |||
| 1384 | __func__, xprt, sk->sk_err); | 1384 | __func__, xprt, sk->sk_err); |
| 1385 | xprt_wake_pending_tasks(xprt, -EAGAIN); | 1385 | xprt_wake_pending_tasks(xprt, -EAGAIN); |
| 1386 | out: | 1386 | out: |
| 1387 | read_unlock(&sk->sk_callback_lock); | 1387 | read_unlock_bh(&sk->sk_callback_lock); |
| 1388 | } | 1388 | } |
| 1389 | 1389 | ||
| 1390 | static void xs_write_space(struct sock *sk) | 1390 | static void xs_write_space(struct sock *sk) |
| @@ -1416,13 +1416,13 @@ static void xs_write_space(struct sock *sk) | |||
| 1416 | */ | 1416 | */ |
| 1417 | static void xs_udp_write_space(struct sock *sk) | 1417 | static void xs_udp_write_space(struct sock *sk) |
| 1418 | { | 1418 | { |
| 1419 | read_lock(&sk->sk_callback_lock); | 1419 | read_lock_bh(&sk->sk_callback_lock); |
| 1420 | 1420 | ||
| 1421 | /* from net/core/sock.c:sock_def_write_space */ | 1421 | /* from net/core/sock.c:sock_def_write_space */ |
| 1422 | if (sock_writeable(sk)) | 1422 | if (sock_writeable(sk)) |
| 1423 | xs_write_space(sk); | 1423 | xs_write_space(sk); |
| 1424 | 1424 | ||
| 1425 | read_unlock(&sk->sk_callback_lock); | 1425 | read_unlock_bh(&sk->sk_callback_lock); |
| 1426 | } | 1426 | } |
| 1427 | 1427 | ||
| 1428 | /** | 1428 | /** |
| @@ -1437,13 +1437,13 @@ static void xs_udp_write_space(struct sock *sk) | |||
| 1437 | */ | 1437 | */ |
| 1438 | static void xs_tcp_write_space(struct sock *sk) | 1438 | static void xs_tcp_write_space(struct sock *sk) |
| 1439 | { | 1439 | { |
| 1440 | read_lock(&sk->sk_callback_lock); | 1440 | read_lock_bh(&sk->sk_callback_lock); |
| 1441 | 1441 | ||
| 1442 | /* from net/core/stream.c:sk_stream_write_space */ | 1442 | /* from net/core/stream.c:sk_stream_write_space */ |
| 1443 | if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk)) | 1443 | if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk)) |
| 1444 | xs_write_space(sk); | 1444 | xs_write_space(sk); |
| 1445 | 1445 | ||
| 1446 | read_unlock(&sk->sk_callback_lock); | 1446 | read_unlock_bh(&sk->sk_callback_lock); |
| 1447 | } | 1447 | } |
| 1448 | 1448 | ||
| 1449 | static void xs_udp_do_set_buffer_size(struct rpc_xprt *xprt) | 1449 | static void xs_udp_do_set_buffer_size(struct rpc_xprt *xprt) |
diff --git a/net/wireless/wext-priv.c b/net/wireless/wext-priv.c index 3feb28e41c53..674d426a9d24 100644 --- a/net/wireless/wext-priv.c +++ b/net/wireless/wext-priv.c | |||
| @@ -152,7 +152,7 @@ static int ioctl_private_iw_point(struct iw_point *iwp, unsigned int cmd, | |||
| 152 | } else if (!iwp->pointer) | 152 | } else if (!iwp->pointer) |
| 153 | return -EFAULT; | 153 | return -EFAULT; |
| 154 | 154 | ||
| 155 | extra = kmalloc(extra_size, GFP_KERNEL); | 155 | extra = kzalloc(extra_size, GFP_KERNEL); |
| 156 | if (!extra) | 156 | if (!extra) |
| 157 | return -ENOMEM; | 157 | return -ENOMEM; |
| 158 | 158 | ||
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index a3cca0a94346..64f2ae1fdc15 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c | |||
| @@ -101,7 +101,7 @@ resume: | |||
| 101 | err = -EHOSTUNREACH; | 101 | err = -EHOSTUNREACH; |
| 102 | goto error_nolock; | 102 | goto error_nolock; |
| 103 | } | 103 | } |
| 104 | skb_dst_set_noref(skb, dst); | 104 | skb_dst_set(skb, dst_clone(dst)); |
| 105 | x = dst->xfrm; | 105 | x = dst->xfrm; |
| 106 | } while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL)); | 106 | } while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL)); |
| 107 | 107 | ||
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 2b3ed7ad4933..cbab6e1a8c9c 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
| @@ -1175,9 +1175,8 @@ xfrm_tmpl_resolve_one(struct xfrm_policy *policy, struct flowi *fl, | |||
| 1175 | tmpl->mode == XFRM_MODE_BEET) { | 1175 | tmpl->mode == XFRM_MODE_BEET) { |
| 1176 | remote = &tmpl->id.daddr; | 1176 | remote = &tmpl->id.daddr; |
| 1177 | local = &tmpl->saddr; | 1177 | local = &tmpl->saddr; |
| 1178 | family = tmpl->encap_family; | 1178 | if (xfrm_addr_any(local, tmpl->encap_family)) { |
| 1179 | if (xfrm_addr_any(local, family)) { | 1179 | error = xfrm_get_saddr(net, &tmp, remote, tmpl->encap_family); |
| 1180 | error = xfrm_get_saddr(net, &tmp, remote, family); | ||
| 1181 | if (error) | 1180 | if (error) |
| 1182 | goto fail; | 1181 | goto fail; |
| 1183 | local = &tmp; | 1182 | local = &tmp; |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 5208b12fbfb4..eb96ce52f178 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
| @@ -656,15 +656,23 @@ void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si) | |||
| 656 | EXPORT_SYMBOL(xfrm_sad_getinfo); | 656 | EXPORT_SYMBOL(xfrm_sad_getinfo); |
| 657 | 657 | ||
| 658 | static int | 658 | static int |
| 659 | xfrm_init_tempsel(struct xfrm_state *x, struct flowi *fl, | 659 | xfrm_init_tempstate(struct xfrm_state *x, struct flowi *fl, |
| 660 | struct xfrm_tmpl *tmpl, | 660 | struct xfrm_tmpl *tmpl, |
| 661 | xfrm_address_t *daddr, xfrm_address_t *saddr, | 661 | xfrm_address_t *daddr, xfrm_address_t *saddr, |
| 662 | unsigned short family) | 662 | unsigned short family) |
| 663 | { | 663 | { |
| 664 | struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); | 664 | struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); |
| 665 | if (!afinfo) | 665 | if (!afinfo) |
| 666 | return -1; | 666 | return -1; |
| 667 | afinfo->init_tempsel(x, fl, tmpl, daddr, saddr); | 667 | afinfo->init_tempsel(&x->sel, fl); |
| 668 | |||
| 669 | if (family != tmpl->encap_family) { | ||
| 670 | xfrm_state_put_afinfo(afinfo); | ||
| 671 | afinfo = xfrm_state_get_afinfo(tmpl->encap_family); | ||
| 672 | if (!afinfo) | ||
| 673 | return -1; | ||
| 674 | } | ||
| 675 | afinfo->init_temprop(x, tmpl, daddr, saddr); | ||
| 668 | xfrm_state_put_afinfo(afinfo); | 676 | xfrm_state_put_afinfo(afinfo); |
| 669 | return 0; | 677 | return 0; |
| 670 | } | 678 | } |
| @@ -790,37 +798,38 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
| 790 | int error = 0; | 798 | int error = 0; |
| 791 | struct xfrm_state *best = NULL; | 799 | struct xfrm_state *best = NULL; |
| 792 | u32 mark = pol->mark.v & pol->mark.m; | 800 | u32 mark = pol->mark.v & pol->mark.m; |
| 801 | unsigned short encap_family = tmpl->encap_family; | ||
| 793 | 802 | ||
| 794 | to_put = NULL; | 803 | to_put = NULL; |
| 795 | 804 | ||
| 796 | spin_lock_bh(&xfrm_state_lock); | 805 | spin_lock_bh(&xfrm_state_lock); |
| 797 | h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, family); | 806 | h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family); |
| 798 | hlist_for_each_entry(x, entry, net->xfrm.state_bydst+h, bydst) { | 807 | hlist_for_each_entry(x, entry, net->xfrm.state_bydst+h, bydst) { |
| 799 | if (x->props.family == family && | 808 | if (x->props.family == encap_family && |
| 800 | x->props.reqid == tmpl->reqid && | 809 | x->props.reqid == tmpl->reqid && |
| 801 | (mark & x->mark.m) == x->mark.v && | 810 | (mark & x->mark.m) == x->mark.v && |
| 802 | !(x->props.flags & XFRM_STATE_WILDRECV) && | 811 | !(x->props.flags & XFRM_STATE_WILDRECV) && |
| 803 | xfrm_state_addr_check(x, daddr, saddr, family) && | 812 | xfrm_state_addr_check(x, daddr, saddr, encap_family) && |
| 804 | tmpl->mode == x->props.mode && | 813 | tmpl->mode == x->props.mode && |
| 805 | tmpl->id.proto == x->id.proto && | 814 | tmpl->id.proto == x->id.proto && |
| 806 | (tmpl->id.spi == x->id.spi || !tmpl->id.spi)) | 815 | (tmpl->id.spi == x->id.spi || !tmpl->id.spi)) |
| 807 | xfrm_state_look_at(pol, x, fl, family, daddr, saddr, | 816 | xfrm_state_look_at(pol, x, fl, encap_family, daddr, saddr, |
| 808 | &best, &acquire_in_progress, &error); | 817 | &best, &acquire_in_progress, &error); |
| 809 | } | 818 | } |
| 810 | if (best) | 819 | if (best) |
| 811 | goto found; | 820 | goto found; |
| 812 | 821 | ||
| 813 | h_wildcard = xfrm_dst_hash(net, daddr, &saddr_wildcard, tmpl->reqid, family); | 822 | h_wildcard = xfrm_dst_hash(net, daddr, &saddr_wildcard, tmpl->reqid, encap_family); |
| 814 | hlist_for_each_entry(x, entry, net->xfrm.state_bydst+h_wildcard, bydst) { | 823 | hlist_for_each_entry(x, entry, net->xfrm.state_bydst+h_wildcard, bydst) { |
| 815 | if (x->props.family == family && | 824 | if (x->props.family == encap_family && |
| 816 | x->props.reqid == tmpl->reqid && | 825 | x->props.reqid == tmpl->reqid && |
| 817 | (mark & x->mark.m) == x->mark.v && | 826 | (mark & x->mark.m) == x->mark.v && |
| 818 | !(x->props.flags & XFRM_STATE_WILDRECV) && | 827 | !(x->props.flags & XFRM_STATE_WILDRECV) && |
| 819 | xfrm_state_addr_check(x, daddr, saddr, family) && | 828 | xfrm_state_addr_check(x, daddr, saddr, encap_family) && |
| 820 | tmpl->mode == x->props.mode && | 829 | tmpl->mode == x->props.mode && |
| 821 | tmpl->id.proto == x->id.proto && | 830 | tmpl->id.proto == x->id.proto && |
| 822 | (tmpl->id.spi == x->id.spi || !tmpl->id.spi)) | 831 | (tmpl->id.spi == x->id.spi || !tmpl->id.spi)) |
| 823 | xfrm_state_look_at(pol, x, fl, family, daddr, saddr, | 832 | xfrm_state_look_at(pol, x, fl, encap_family, daddr, saddr, |
| 824 | &best, &acquire_in_progress, &error); | 833 | &best, &acquire_in_progress, &error); |
| 825 | } | 834 | } |
| 826 | 835 | ||
| @@ -829,7 +838,7 @@ found: | |||
| 829 | if (!x && !error && !acquire_in_progress) { | 838 | if (!x && !error && !acquire_in_progress) { |
| 830 | if (tmpl->id.spi && | 839 | if (tmpl->id.spi && |
| 831 | (x0 = __xfrm_state_lookup(net, mark, daddr, tmpl->id.spi, | 840 | (x0 = __xfrm_state_lookup(net, mark, daddr, tmpl->id.spi, |
| 832 | tmpl->id.proto, family)) != NULL) { | 841 | tmpl->id.proto, encap_family)) != NULL) { |
| 833 | to_put = x0; | 842 | to_put = x0; |
| 834 | error = -EEXIST; | 843 | error = -EEXIST; |
| 835 | goto out; | 844 | goto out; |
| @@ -839,9 +848,9 @@ found: | |||
| 839 | error = -ENOMEM; | 848 | error = -ENOMEM; |
| 840 | goto out; | 849 | goto out; |
| 841 | } | 850 | } |
| 842 | /* Initialize temporary selector matching only | 851 | /* Initialize temporary state matching only |
| 843 | * to current session. */ | 852 | * to current session. */ |
| 844 | xfrm_init_tempsel(x, fl, tmpl, daddr, saddr, family); | 853 | xfrm_init_tempstate(x, fl, tmpl, daddr, saddr, family); |
| 845 | memcpy(&x->mark, &pol->mark, sizeof(x->mark)); | 854 | memcpy(&x->mark, &pol->mark, sizeof(x->mark)); |
| 846 | 855 | ||
| 847 | error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid); | 856 | error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid); |
| @@ -856,10 +865,10 @@ found: | |||
| 856 | x->km.state = XFRM_STATE_ACQ; | 865 | x->km.state = XFRM_STATE_ACQ; |
| 857 | list_add(&x->km.all, &net->xfrm.state_all); | 866 | list_add(&x->km.all, &net->xfrm.state_all); |
| 858 | hlist_add_head(&x->bydst, net->xfrm.state_bydst+h); | 867 | hlist_add_head(&x->bydst, net->xfrm.state_bydst+h); |
| 859 | h = xfrm_src_hash(net, daddr, saddr, family); | 868 | h = xfrm_src_hash(net, daddr, saddr, encap_family); |
| 860 | hlist_add_head(&x->bysrc, net->xfrm.state_bysrc+h); | 869 | hlist_add_head(&x->bysrc, net->xfrm.state_bysrc+h); |
| 861 | if (x->id.spi) { | 870 | if (x->id.spi) { |
| 862 | h = xfrm_spi_hash(net, &x->id.daddr, x->id.spi, x->id.proto, family); | 871 | h = xfrm_spi_hash(net, &x->id.daddr, x->id.spi, x->id.proto, encap_family); |
| 863 | hlist_add_head(&x->byspi, net->xfrm.state_byspi+h); | 872 | hlist_add_head(&x->byspi, net->xfrm.state_byspi+h); |
| 864 | } | 873 | } |
| 865 | x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires; | 874 | x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires; |
diff --git a/samples/kfifo/dma-example.c b/samples/kfifo/dma-example.c index ee03a4f0b64f..06473791c08a 100644 --- a/samples/kfifo/dma-example.c +++ b/samples/kfifo/dma-example.c | |||
| @@ -24,6 +24,7 @@ static int __init example_init(void) | |||
| 24 | { | 24 | { |
| 25 | int i; | 25 | int i; |
| 26 | unsigned int ret; | 26 | unsigned int ret; |
| 27 | unsigned int nents; | ||
| 27 | struct scatterlist sg[10]; | 28 | struct scatterlist sg[10]; |
| 28 | 29 | ||
| 29 | printk(KERN_INFO "DMA fifo test start\n"); | 30 | printk(KERN_INFO "DMA fifo test start\n"); |
| @@ -61,9 +62,9 @@ static int __init example_init(void) | |||
| 61 | * byte at the beginning, after the kfifo_skip(). | 62 | * byte at the beginning, after the kfifo_skip(). |
| 62 | */ | 63 | */ |
| 63 | sg_init_table(sg, ARRAY_SIZE(sg)); | 64 | sg_init_table(sg, ARRAY_SIZE(sg)); |
| 64 | ret = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE); | 65 | nents = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE); |
| 65 | printk(KERN_INFO "DMA sgl entries: %d\n", ret); | 66 | printk(KERN_INFO "DMA sgl entries: %d\n", nents); |
| 66 | if (!ret) { | 67 | if (!nents) { |
| 67 | /* fifo is full and no sgl was created */ | 68 | /* fifo is full and no sgl was created */ |
| 68 | printk(KERN_WARNING "error kfifo_dma_in_prepare\n"); | 69 | printk(KERN_WARNING "error kfifo_dma_in_prepare\n"); |
| 69 | return -EIO; | 70 | return -EIO; |
| @@ -71,7 +72,7 @@ static int __init example_init(void) | |||
| 71 | 72 | ||
| 72 | /* receive data */ | 73 | /* receive data */ |
| 73 | printk(KERN_INFO "scatterlist for receive:\n"); | 74 | printk(KERN_INFO "scatterlist for receive:\n"); |
| 74 | for (i = 0; i < ARRAY_SIZE(sg); i++) { | 75 | for (i = 0; i < nents; i++) { |
| 75 | printk(KERN_INFO | 76 | printk(KERN_INFO |
| 76 | "sg[%d] -> " | 77 | "sg[%d] -> " |
| 77 | "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n", | 78 | "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n", |
| @@ -91,16 +92,16 @@ static int __init example_init(void) | |||
| 91 | kfifo_dma_in_finish(&fifo, ret); | 92 | kfifo_dma_in_finish(&fifo, ret); |
| 92 | 93 | ||
| 93 | /* Prepare to transmit data, example: 8 bytes */ | 94 | /* Prepare to transmit data, example: 8 bytes */ |
| 94 | ret = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8); | 95 | nents = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8); |
| 95 | printk(KERN_INFO "DMA sgl entries: %d\n", ret); | 96 | printk(KERN_INFO "DMA sgl entries: %d\n", nents); |
| 96 | if (!ret) { | 97 | if (!nents) { |
| 97 | /* no data was available and no sgl was created */ | 98 | /* no data was available and no sgl was created */ |
| 98 | printk(KERN_WARNING "error kfifo_dma_out_prepare\n"); | 99 | printk(KERN_WARNING "error kfifo_dma_out_prepare\n"); |
| 99 | return -EIO; | 100 | return -EIO; |
| 100 | } | 101 | } |
| 101 | 102 | ||
| 102 | printk(KERN_INFO "scatterlist for transmit:\n"); | 103 | printk(KERN_INFO "scatterlist for transmit:\n"); |
| 103 | for (i = 0; i < ARRAY_SIZE(sg); i++) { | 104 | for (i = 0; i < nents; i++) { |
| 104 | printk(KERN_INFO | 105 | printk(KERN_INFO |
| 105 | "sg[%d] -> " | 106 | "sg[%d] -> " |
| 106 | "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n", | 107 | "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n", |
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 5b7c86ea43a1..7ef429cd5cb3 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
| @@ -427,7 +427,7 @@ static void check_conf(struct menu *menu) | |||
| 427 | if (sym->name && !sym_is_choice_value(sym)) { | 427 | if (sym->name && !sym_is_choice_value(sym)) { |
| 428 | printf("CONFIG_%s\n", sym->name); | 428 | printf("CONFIG_%s\n", sym->name); |
| 429 | } | 429 | } |
| 430 | } else { | 430 | } else if (input_mode != oldnoconfig) { |
| 431 | if (!conf_cnt++) | 431 | if (!conf_cnt++) |
| 432 | printf(_("*\n* Restart config...\n*\n")); | 432 | printf(_("*\n* Restart config...\n*\n")); |
| 433 | rootEntry = menu_get_parent_menu(menu); | 433 | rootEntry = menu_get_parent_menu(menu); |
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 6ee2e4fb1481..170459c224a1 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
| @@ -165,7 +165,6 @@ struct menu { | |||
| 165 | struct symbol *sym; | 165 | struct symbol *sym; |
| 166 | struct property *prompt; | 166 | struct property *prompt; |
| 167 | struct expr *dep; | 167 | struct expr *dep; |
| 168 | struct expr *dir_dep; | ||
| 169 | unsigned int flags; | 168 | unsigned int flags; |
| 170 | char *help; | 169 | char *help; |
| 171 | struct file *file; | 170 | struct file *file; |
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 4fb590247f33..edda8b49619d 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c | |||
| @@ -107,7 +107,6 @@ static struct expr *menu_check_dep(struct expr *e) | |||
| 107 | void menu_add_dep(struct expr *dep) | 107 | void menu_add_dep(struct expr *dep) |
| 108 | { | 108 | { |
| 109 | current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep)); | 109 | current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep)); |
| 110 | current_entry->dir_dep = current_entry->dep; | ||
| 111 | } | 110 | } |
| 112 | 111 | ||
| 113 | void menu_set_type(int type) | 112 | void menu_set_type(int type) |
| @@ -291,10 +290,6 @@ void menu_finalize(struct menu *parent) | |||
| 291 | for (menu = parent->list; menu; menu = menu->next) | 290 | for (menu = parent->list; menu; menu = menu->next) |
| 292 | menu_finalize(menu); | 291 | menu_finalize(menu); |
| 293 | } else if (sym) { | 292 | } else if (sym) { |
| 294 | /* ignore inherited dependencies for dir_dep */ | ||
| 295 | sym->dir_dep.expr = expr_transform(expr_copy(parent->dir_dep)); | ||
| 296 | sym->dir_dep.expr = expr_eliminate_dups(sym->dir_dep.expr); | ||
| 297 | |||
| 298 | basedep = parent->prompt ? parent->prompt->visible.expr : NULL; | 293 | basedep = parent->prompt ? parent->prompt->visible.expr : NULL; |
| 299 | basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no); | 294 | basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no); |
| 300 | basedep = expr_eliminate_dups(expr_transform(basedep)); | 295 | basedep = expr_eliminate_dups(expr_transform(basedep)); |
| @@ -325,6 +320,8 @@ void menu_finalize(struct menu *parent) | |||
| 325 | parent->next = last_menu->next; | 320 | parent->next = last_menu->next; |
| 326 | last_menu->next = NULL; | 321 | last_menu->next = NULL; |
| 327 | } | 322 | } |
| 323 | |||
| 324 | sym->dir_dep.expr = parent->dep; | ||
| 328 | } | 325 | } |
| 329 | for (menu = parent->list; menu; menu = menu->next) { | 326 | for (menu = parent->list; menu; menu = menu->next) { |
| 330 | if (sym && sym_is_choice(sym) && | 327 | if (sym && sym_is_choice(sym) && |
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 943712ca6c0a..1f8b305449db 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
| @@ -350,6 +350,7 @@ void sym_calc_value(struct symbol *sym) | |||
| 350 | } | 350 | } |
| 351 | } | 351 | } |
| 352 | calc_newval: | 352 | calc_newval: |
| 353 | #if 0 | ||
| 353 | if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) { | 354 | if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) { |
| 354 | fprintf(stderr, "warning: ("); | 355 | fprintf(stderr, "warning: ("); |
| 355 | expr_fprint(sym->rev_dep.expr, stderr); | 356 | expr_fprint(sym->rev_dep.expr, stderr); |
| @@ -358,6 +359,7 @@ void sym_calc_value(struct symbol *sym) | |||
| 358 | expr_fprint(sym->dir_dep.expr, stderr); | 359 | expr_fprint(sym->dir_dep.expr, stderr); |
| 359 | fprintf(stderr, ")\n"); | 360 | fprintf(stderr, ")\n"); |
| 360 | } | 361 | } |
| 362 | #endif | ||
| 361 | newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri); | 363 | newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri); |
| 362 | } | 364 | } |
| 363 | if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN) | 365 | if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN) |
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index ef43995119a4..c668b447c725 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c | |||
| @@ -1416,15 +1416,19 @@ static char *tomoyo_print_header(struct tomoyo_request_info *r) | |||
| 1416 | const pid_t gpid = task_pid_nr(current); | 1416 | const pid_t gpid = task_pid_nr(current); |
| 1417 | static const int tomoyo_buffer_len = 4096; | 1417 | static const int tomoyo_buffer_len = 4096; |
| 1418 | char *buffer = kmalloc(tomoyo_buffer_len, GFP_NOFS); | 1418 | char *buffer = kmalloc(tomoyo_buffer_len, GFP_NOFS); |
| 1419 | pid_t ppid; | ||
| 1419 | if (!buffer) | 1420 | if (!buffer) |
| 1420 | return NULL; | 1421 | return NULL; |
| 1421 | do_gettimeofday(&tv); | 1422 | do_gettimeofday(&tv); |
| 1423 | rcu_read_lock(); | ||
| 1424 | ppid = task_tgid_vnr(current->real_parent); | ||
| 1425 | rcu_read_unlock(); | ||
| 1422 | snprintf(buffer, tomoyo_buffer_len - 1, | 1426 | snprintf(buffer, tomoyo_buffer_len - 1, |
| 1423 | "#timestamp=%lu profile=%u mode=%s (global-pid=%u)" | 1427 | "#timestamp=%lu profile=%u mode=%s (global-pid=%u)" |
| 1424 | " task={ pid=%u ppid=%u uid=%u gid=%u euid=%u" | 1428 | " task={ pid=%u ppid=%u uid=%u gid=%u euid=%u" |
| 1425 | " egid=%u suid=%u sgid=%u fsuid=%u fsgid=%u }", | 1429 | " egid=%u suid=%u sgid=%u fsuid=%u fsgid=%u }", |
| 1426 | tv.tv_sec, r->profile, tomoyo_mode[r->mode], gpid, | 1430 | tv.tv_sec, r->profile, tomoyo_mode[r->mode], gpid, |
| 1427 | (pid_t) sys_getpid(), (pid_t) sys_getppid(), | 1431 | task_tgid_vnr(current), ppid, |
| 1428 | current_uid(), current_gid(), current_euid(), | 1432 | current_uid(), current_gid(), current_euid(), |
| 1429 | current_egid(), current_suid(), current_sgid(), | 1433 | current_egid(), current_suid(), current_sgid(), |
| 1430 | current_fsuid(), current_fsgid()); | 1434 | current_fsuid(), current_fsgid()); |
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h index 04454cb7b24a..7c66bd898782 100644 --- a/security/tomoyo/common.h +++ b/security/tomoyo/common.h | |||
| @@ -689,9 +689,6 @@ struct tomoyo_profile { | |||
| 689 | 689 | ||
| 690 | /********** Function prototypes. **********/ | 690 | /********** Function prototypes. **********/ |
| 691 | 691 | ||
| 692 | extern asmlinkage long sys_getpid(void); | ||
| 693 | extern asmlinkage long sys_getppid(void); | ||
| 694 | |||
| 695 | /* Check whether the given string starts with the given keyword. */ | 692 | /* Check whether the given string starts with the given keyword. */ |
| 696 | bool tomoyo_str_starts(char **src, const char *find); | 693 | bool tomoyo_str_starts(char **src, const char *find); |
| 697 | /* Get tomoyo_realpath() of current process. */ | 694 | /* Get tomoyo_realpath() of current process. */ |
diff --git a/sound/core/control.c b/sound/core/control.c index 070aab490191..45a818002d99 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | /* max number of user-defined controls */ | 32 | /* max number of user-defined controls */ |
| 33 | #define MAX_USER_CONTROLS 32 | 33 | #define MAX_USER_CONTROLS 32 |
| 34 | #define MAX_CONTROL_COUNT 1028 | ||
| 34 | 35 | ||
| 35 | struct snd_kctl_ioctl { | 36 | struct snd_kctl_ioctl { |
| 36 | struct list_head list; /* list of all ioctls */ | 37 | struct list_head list; /* list of all ioctls */ |
| @@ -195,6 +196,10 @@ static struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control, | |||
| 195 | 196 | ||
| 196 | if (snd_BUG_ON(!control || !control->count)) | 197 | if (snd_BUG_ON(!control || !control->count)) |
| 197 | return NULL; | 198 | return NULL; |
| 199 | |||
| 200 | if (control->count > MAX_CONTROL_COUNT) | ||
| 201 | return NULL; | ||
| 202 | |||
| 198 | kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL); | 203 | kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL); |
| 199 | if (kctl == NULL) { | 204 | if (kctl == NULL) { |
| 200 | snd_printk(KERN_ERR "Cannot allocate control instance\n"); | 205 | snd_printk(KERN_ERR "Cannot allocate control instance\n"); |
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 204af48c5cc1..ac242a377aea 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
| @@ -372,14 +372,17 @@ static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry, | |||
| 372 | struct snd_info_buffer *buffer) | 372 | struct snd_info_buffer *buffer) |
| 373 | { | 373 | { |
| 374 | struct snd_pcm_substream *substream = entry->private_data; | 374 | struct snd_pcm_substream *substream = entry->private_data; |
| 375 | struct snd_pcm_runtime *runtime = substream->runtime; | 375 | struct snd_pcm_runtime *runtime; |
| 376 | |||
| 377 | mutex_lock(&substream->pcm->open_mutex); | ||
| 378 | runtime = substream->runtime; | ||
| 376 | if (!runtime) { | 379 | if (!runtime) { |
| 377 | snd_iprintf(buffer, "closed\n"); | 380 | snd_iprintf(buffer, "closed\n"); |
| 378 | return; | 381 | goto unlock; |
| 379 | } | 382 | } |
| 380 | if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { | 383 | if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { |
| 381 | snd_iprintf(buffer, "no setup\n"); | 384 | snd_iprintf(buffer, "no setup\n"); |
| 382 | return; | 385 | goto unlock; |
| 383 | } | 386 | } |
| 384 | snd_iprintf(buffer, "access: %s\n", snd_pcm_access_name(runtime->access)); | 387 | snd_iprintf(buffer, "access: %s\n", snd_pcm_access_name(runtime->access)); |
| 385 | snd_iprintf(buffer, "format: %s\n", snd_pcm_format_name(runtime->format)); | 388 | snd_iprintf(buffer, "format: %s\n", snd_pcm_format_name(runtime->format)); |
| @@ -398,20 +401,25 @@ static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry, | |||
| 398 | snd_iprintf(buffer, "OSS period frames: %lu\n", (unsigned long)runtime->oss.period_frames); | 401 | snd_iprintf(buffer, "OSS period frames: %lu\n", (unsigned long)runtime->oss.period_frames); |
| 399 | } | 402 | } |
| 400 | #endif | 403 | #endif |
| 404 | unlock: | ||
| 405 | mutex_unlock(&substream->pcm->open_mutex); | ||
| 401 | } | 406 | } |
| 402 | 407 | ||
| 403 | static void snd_pcm_substream_proc_sw_params_read(struct snd_info_entry *entry, | 408 | static void snd_pcm_substream_proc_sw_params_read(struct snd_info_entry *entry, |
| 404 | struct snd_info_buffer *buffer) | 409 | struct snd_info_buffer *buffer) |
| 405 | { | 410 | { |
| 406 | struct snd_pcm_substream *substream = entry->private_data; | 411 | struct snd_pcm_substream *substream = entry->private_data; |
| 407 | struct snd_pcm_runtime *runtime = substream->runtime; | 412 | struct snd_pcm_runtime *runtime; |
| 413 | |||
| 414 | mutex_lock(&substream->pcm->open_mutex); | ||
| 415 | runtime = substream->runtime; | ||
| 408 | if (!runtime) { | 416 | if (!runtime) { |
| 409 | snd_iprintf(buffer, "closed\n"); | 417 | snd_iprintf(buffer, "closed\n"); |
| 410 | return; | 418 | goto unlock; |
| 411 | } | 419 | } |
| 412 | if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { | 420 | if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { |
| 413 | snd_iprintf(buffer, "no setup\n"); | 421 | snd_iprintf(buffer, "no setup\n"); |
| 414 | return; | 422 | goto unlock; |
| 415 | } | 423 | } |
| 416 | snd_iprintf(buffer, "tstamp_mode: %s\n", snd_pcm_tstamp_mode_name(runtime->tstamp_mode)); | 424 | snd_iprintf(buffer, "tstamp_mode: %s\n", snd_pcm_tstamp_mode_name(runtime->tstamp_mode)); |
| 417 | snd_iprintf(buffer, "period_step: %u\n", runtime->period_step); | 425 | snd_iprintf(buffer, "period_step: %u\n", runtime->period_step); |
| @@ -421,24 +429,29 @@ static void snd_pcm_substream_proc_sw_params_read(struct snd_info_entry *entry, | |||
| 421 | snd_iprintf(buffer, "silence_threshold: %lu\n", runtime->silence_threshold); | 429 | snd_iprintf(buffer, "silence_threshold: %lu\n", runtime->silence_threshold); |
| 422 | snd_iprintf(buffer, "silence_size: %lu\n", runtime->silence_size); | 430 | snd_iprintf(buffer, "silence_size: %lu\n", runtime->silence_size); |
| 423 | snd_iprintf(buffer, "boundary: %lu\n", runtime->boundary); | 431 | snd_iprintf(buffer, "boundary: %lu\n", runtime->boundary); |
| 432 | unlock: | ||
| 433 | mutex_unlock(&substream->pcm->open_mutex); | ||
| 424 | } | 434 | } |
| 425 | 435 | ||
| 426 | static void snd_pcm_substream_proc_status_read(struct snd_info_entry *entry, | 436 | static void snd_pcm_substream_proc_status_read(struct snd_info_entry *entry, |
| 427 | struct snd_info_buffer *buffer) | 437 | struct snd_info_buffer *buffer) |
| 428 | { | 438 | { |
| 429 | struct snd_pcm_substream *substream = entry->private_data; | 439 | struct snd_pcm_substream *substream = entry->private_data; |
| 430 | struct snd_pcm_runtime *runtime = substream->runtime; | 440 | struct snd_pcm_runtime *runtime; |
| 431 | struct snd_pcm_status status; | 441 | struct snd_pcm_status status; |
| 432 | int err; | 442 | int err; |
| 443 | |||
| 444 | mutex_lock(&substream->pcm->open_mutex); | ||
| 445 | runtime = substream->runtime; | ||
| 433 | if (!runtime) { | 446 | if (!runtime) { |
| 434 | snd_iprintf(buffer, "closed\n"); | 447 | snd_iprintf(buffer, "closed\n"); |
| 435 | return; | 448 | goto unlock; |
| 436 | } | 449 | } |
| 437 | memset(&status, 0, sizeof(status)); | 450 | memset(&status, 0, sizeof(status)); |
| 438 | err = snd_pcm_status(substream, &status); | 451 | err = snd_pcm_status(substream, &status); |
| 439 | if (err < 0) { | 452 | if (err < 0) { |
| 440 | snd_iprintf(buffer, "error %d\n", err); | 453 | snd_iprintf(buffer, "error %d\n", err); |
| 441 | return; | 454 | goto unlock; |
| 442 | } | 455 | } |
| 443 | snd_iprintf(buffer, "state: %s\n", snd_pcm_state_name(status.state)); | 456 | snd_iprintf(buffer, "state: %s\n", snd_pcm_state_name(status.state)); |
| 444 | snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); | 457 | snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); |
| @@ -452,6 +465,8 @@ static void snd_pcm_substream_proc_status_read(struct snd_info_entry *entry, | |||
| 452 | snd_iprintf(buffer, "-----\n"); | 465 | snd_iprintf(buffer, "-----\n"); |
| 453 | snd_iprintf(buffer, "hw_ptr : %ld\n", runtime->status->hw_ptr); | 466 | snd_iprintf(buffer, "hw_ptr : %ld\n", runtime->status->hw_ptr); |
| 454 | snd_iprintf(buffer, "appl_ptr : %ld\n", runtime->control->appl_ptr); | 467 | snd_iprintf(buffer, "appl_ptr : %ld\n", runtime->control->appl_ptr); |
| 468 | unlock: | ||
| 469 | mutex_unlock(&substream->pcm->open_mutex); | ||
| 455 | } | 470 | } |
| 456 | 471 | ||
| 457 | #ifdef CONFIG_SND_PCM_XRUN_DEBUG | 472 | #ifdef CONFIG_SND_PCM_XRUN_DEBUG |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 134fc6c2e08d..d4eb2ef80784 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
| @@ -1992,6 +1992,8 @@ void snd_pcm_release_substream(struct snd_pcm_substream *substream) | |||
| 1992 | substream->ops->close(substream); | 1992 | substream->ops->close(substream); |
| 1993 | substream->hw_opened = 0; | 1993 | substream->hw_opened = 0; |
| 1994 | } | 1994 | } |
| 1995 | if (pm_qos_request_active(&substream->latency_pm_qos_req)) | ||
| 1996 | pm_qos_remove_request(&substream->latency_pm_qos_req); | ||
| 1995 | if (substream->pcm_release) { | 1997 | if (substream->pcm_release) { |
| 1996 | substream->pcm_release(substream); | 1998 | substream->pcm_release(substream); |
| 1997 | substream->pcm_release = NULL; | 1999 | substream->pcm_release = NULL; |
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index a7868ad4d530..cbbed0db9e56 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
| @@ -535,13 +535,15 @@ static int snd_rawmidi_release(struct inode *inode, struct file *file) | |||
| 535 | { | 535 | { |
| 536 | struct snd_rawmidi_file *rfile; | 536 | struct snd_rawmidi_file *rfile; |
| 537 | struct snd_rawmidi *rmidi; | 537 | struct snd_rawmidi *rmidi; |
| 538 | struct module *module; | ||
| 538 | 539 | ||
| 539 | rfile = file->private_data; | 540 | rfile = file->private_data; |
| 540 | rmidi = rfile->rmidi; | 541 | rmidi = rfile->rmidi; |
| 541 | rawmidi_release_priv(rfile); | 542 | rawmidi_release_priv(rfile); |
| 542 | kfree(rfile); | 543 | kfree(rfile); |
| 544 | module = rmidi->card->module; | ||
| 543 | snd_card_file_remove(rmidi->card, file); | 545 | snd_card_file_remove(rmidi->card, file); |
| 544 | module_put(rmidi->card->module); | 546 | module_put(module); |
| 545 | return 0; | 547 | return 0; |
| 546 | } | 548 | } |
| 547 | 549 | ||
diff --git a/sound/i2c/other/ak4xxx-adda.c b/sound/i2c/other/ak4xxx-adda.c index 1adb8a3c2b62..42d7844ecd0b 100644 --- a/sound/i2c/other/ak4xxx-adda.c +++ b/sound/i2c/other/ak4xxx-adda.c | |||
| @@ -900,7 +900,7 @@ static int proc_init(struct snd_akm4xxx *ak) | |||
| 900 | return 0; | 900 | return 0; |
| 901 | } | 901 | } |
| 902 | #else /* !CONFIG_PROC_FS */ | 902 | #else /* !CONFIG_PROC_FS */ |
| 903 | static int proc_init(struct snd_akm4xxx *ak) {} | 903 | static int proc_init(struct snd_akm4xxx *ak) { return 0; } |
| 904 | #endif | 904 | #endif |
| 905 | 905 | ||
| 906 | int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak) | 906 | int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak) |
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c index 92aa762ffb7e..07f803e6d203 100644 --- a/sound/oss/soundcard.c +++ b/sound/oss/soundcard.c | |||
| @@ -391,11 +391,11 @@ static long sound_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 391 | case SND_DEV_DSP: | 391 | case SND_DEV_DSP: |
| 392 | case SND_DEV_DSP16: | 392 | case SND_DEV_DSP16: |
| 393 | case SND_DEV_AUDIO: | 393 | case SND_DEV_AUDIO: |
| 394 | return audio_ioctl(dev, file, cmd, p); | 394 | ret = audio_ioctl(dev, file, cmd, p); |
| 395 | break; | 395 | break; |
| 396 | 396 | ||
| 397 | case SND_DEV_MIDIN: | 397 | case SND_DEV_MIDIN: |
| 398 | return MIDIbuf_ioctl(dev, file, cmd, p); | 398 | ret = MIDIbuf_ioctl(dev, file, cmd, p); |
| 399 | break; | 399 | break; |
| 400 | 400 | ||
| 401 | } | 401 | } |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 1053fff4bd0a..34940a079051 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
| @@ -126,6 +126,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6}," | |||
| 126 | "{Intel, ICH10}," | 126 | "{Intel, ICH10}," |
| 127 | "{Intel, PCH}," | 127 | "{Intel, PCH}," |
| 128 | "{Intel, CPT}," | 128 | "{Intel, CPT}," |
| 129 | "{Intel, PBG}," | ||
| 129 | "{Intel, SCH}," | 130 | "{Intel, SCH}," |
| 130 | "{ATI, SB450}," | 131 | "{ATI, SB450}," |
| 131 | "{ATI, SB600}," | 132 | "{ATI, SB600}," |
| @@ -2749,6 +2750,8 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { | |||
| 2749 | { PCI_DEVICE(0x8086, 0x3b57), .driver_data = AZX_DRIVER_ICH }, | 2750 | { PCI_DEVICE(0x8086, 0x3b57), .driver_data = AZX_DRIVER_ICH }, |
| 2750 | /* CPT */ | 2751 | /* CPT */ |
| 2751 | { PCI_DEVICE(0x8086, 0x1c20), .driver_data = AZX_DRIVER_PCH }, | 2752 | { PCI_DEVICE(0x8086, 0x1c20), .driver_data = AZX_DRIVER_PCH }, |
| 2753 | /* PBG */ | ||
| 2754 | { PCI_DEVICE(0x8086, 0x1d20), .driver_data = AZX_DRIVER_PCH }, | ||
| 2752 | /* SCH */ | 2755 | /* SCH */ |
| 2753 | { PCI_DEVICE(0x8086, 0x811b), .driver_data = AZX_DRIVER_SCH }, | 2756 | { PCI_DEVICE(0x8086, 0x811b), .driver_data = AZX_DRIVER_SCH }, |
| 2754 | /* ATI SB 450/600 */ | 2757 | /* ATI SB 450/600 */ |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index b697fd2a6f8b..10bbbaf6ebc3 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
| @@ -3641,6 +3641,7 @@ static struct snd_pci_quirk ad1984_cfg_tbl[] = { | |||
| 3641 | /* Lenovo Thinkpad T61/X61 */ | 3641 | /* Lenovo Thinkpad T61/X61 */ |
| 3642 | SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD), | 3642 | SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD), |
| 3643 | SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP), | 3643 | SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP), |
| 3644 | SND_PCI_QUIRK(0x1028, 0x0233, "Dell Latitude E6400", AD1984_DELL_DESKTOP), | ||
| 3644 | {} | 3645 | {} |
| 3645 | }; | 3646 | }; |
| 3646 | 3647 | ||
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 71f9d6475b09..972e7c453b3d 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
| @@ -3092,6 +3092,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
| 3092 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO), | 3092 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO), |
| 3093 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), | 3093 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), |
| 3094 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), | 3094 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), |
| 3095 | SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD), | ||
| 3095 | SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), | 3096 | SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), |
| 3096 | SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), | 3097 | SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), |
| 3097 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), | 3098 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), |
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c index 69b950d527c3..baa108b9d6aa 100644 --- a/sound/pci/hda/patch_nvhdmi.c +++ b/sound/pci/hda/patch_nvhdmi.c | |||
| @@ -84,7 +84,7 @@ static struct hda_verb nvhdmi_basic_init_7x[] = { | |||
| 84 | #else | 84 | #else |
| 85 | /* support all rates and formats */ | 85 | /* support all rates and formats */ |
| 86 | #define SUPPORTED_RATES \ | 86 | #define SUPPORTED_RATES \ |
| 87 | (SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\ | 87 | (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\ |
| 88 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |\ | 88 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |\ |
| 89 | SNDRV_PCM_RATE_192000) | 89 | SNDRV_PCM_RATE_192000) |
| 90 | #define SUPPORTED_MAXBPS 24 | 90 | #define SUPPORTED_MAXBPS 24 |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index bcbf9160ed81..a432e6efd19b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -1594,12 +1594,22 @@ static void alc_auto_parse_digital(struct hda_codec *codec) | |||
| 1594 | } | 1594 | } |
| 1595 | 1595 | ||
| 1596 | if (spec->autocfg.dig_in_pin) { | 1596 | if (spec->autocfg.dig_in_pin) { |
| 1597 | hda_nid_t dig_nid; | 1597 | dig_nid = codec->start_nid; |
| 1598 | err = snd_hda_get_connections(codec, | 1598 | for (i = 0; i < codec->num_nodes; i++, dig_nid++) { |
| 1599 | spec->autocfg.dig_in_pin, | 1599 | unsigned int wcaps = get_wcaps(codec, dig_nid); |
| 1600 | &dig_nid, 1); | 1600 | if (get_wcaps_type(wcaps) != AC_WID_AUD_IN) |
| 1601 | if (err > 0) | 1601 | continue; |
| 1602 | spec->dig_in_nid = dig_nid; | 1602 | if (!(wcaps & AC_WCAP_DIGITAL)) |
| 1603 | continue; | ||
| 1604 | if (!(wcaps & AC_WCAP_CONN_LIST)) | ||
| 1605 | continue; | ||
| 1606 | err = get_connection_index(codec, dig_nid, | ||
| 1607 | spec->autocfg.dig_in_pin); | ||
| 1608 | if (err >= 0) { | ||
| 1609 | spec->dig_in_nid = dig_nid; | ||
| 1610 | break; | ||
| 1611 | } | ||
| 1612 | } | ||
| 1603 | } | 1613 | } |
| 1604 | } | 1614 | } |
| 1605 | 1615 | ||
| @@ -14453,6 +14463,7 @@ static void alc269_auto_init(struct hda_codec *codec) | |||
| 14453 | 14463 | ||
| 14454 | enum { | 14464 | enum { |
| 14455 | ALC269_FIXUP_SONY_VAIO, | 14465 | ALC269_FIXUP_SONY_VAIO, |
| 14466 | ALC269_FIXUP_DELL_M101Z, | ||
| 14456 | }; | 14467 | }; |
| 14457 | 14468 | ||
| 14458 | static const struct hda_verb alc269_sony_vaio_fixup_verbs[] = { | 14469 | static const struct hda_verb alc269_sony_vaio_fixup_verbs[] = { |
| @@ -14464,11 +14475,20 @@ static const struct alc_fixup alc269_fixups[] = { | |||
| 14464 | [ALC269_FIXUP_SONY_VAIO] = { | 14475 | [ALC269_FIXUP_SONY_VAIO] = { |
| 14465 | .verbs = alc269_sony_vaio_fixup_verbs | 14476 | .verbs = alc269_sony_vaio_fixup_verbs |
| 14466 | }, | 14477 | }, |
| 14478 | [ALC269_FIXUP_DELL_M101Z] = { | ||
| 14479 | .verbs = (const struct hda_verb[]) { | ||
| 14480 | /* Enables internal speaker */ | ||
| 14481 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, | ||
| 14482 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, | ||
| 14483 | {} | ||
| 14484 | } | ||
| 14485 | }, | ||
| 14467 | }; | 14486 | }; |
| 14468 | 14487 | ||
| 14469 | static struct snd_pci_quirk alc269_fixup_tbl[] = { | 14488 | static struct snd_pci_quirk alc269_fixup_tbl[] = { |
| 14470 | SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), | 14489 | SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 14471 | SND_PCI_QUIRK(0x104d, 0x9077, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), | 14490 | SND_PCI_QUIRK(0x104d, 0x9077, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 14491 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), | ||
| 14472 | {} | 14492 | {} |
| 14473 | }; | 14493 | }; |
| 14474 | 14494 | ||
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 95148e58026c..c16c5ba0fda0 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
| @@ -1747,6 +1747,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { | |||
| 1747 | "HP dv6", STAC_HP_DV5), | 1747 | "HP dv6", STAC_HP_DV5), |
| 1748 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3061, | 1748 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3061, |
| 1749 | "HP dv6", STAC_HP_DV5), /* HP dv6-1110ax */ | 1749 | "HP dv6", STAC_HP_DV5), /* HP dv6-1110ax */ |
| 1750 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x363e, | ||
| 1751 | "HP DV6", STAC_HP_DV5), | ||
| 1750 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010, | 1752 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010, |
| 1751 | "HP", STAC_HP_DV5), | 1753 | "HP", STAC_HP_DV5), |
| 1752 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, | 1754 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, |
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index 289cb4dacfc7..6c0a11adb2a8 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c | |||
| @@ -543,6 +543,10 @@ static int __devinit get_oxygen_model(struct oxygen *chip, | |||
| 543 | chip->model.suspend = claro_suspend; | 543 | chip->model.suspend = claro_suspend; |
| 544 | chip->model.resume = claro_resume; | 544 | chip->model.resume = claro_resume; |
| 545 | chip->model.set_adc_params = set_ak5385_params; | 545 | chip->model.set_adc_params = set_ak5385_params; |
| 546 | chip->model.device_config = PLAYBACK_0_TO_I2S | | ||
| 547 | PLAYBACK_1_TO_SPDIF | | ||
| 548 | CAPTURE_0_FROM_I2S_2 | | ||
| 549 | CAPTURE_1_FROM_SPDIF; | ||
| 546 | break; | 550 | break; |
| 547 | } | 551 | } |
| 548 | if (id->driver_data == MODEL_MERIDIAN || | 552 | if (id->driver_data == MODEL_MERIDIAN || |
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index b92adef8e81e..d6fa7bfd9aa1 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
| @@ -4609,6 +4609,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne | |||
| 4609 | if (err < 0) | 4609 | if (err < 0) |
| 4610 | return err; | 4610 | return err; |
| 4611 | 4611 | ||
| 4612 | memset(&info, 0, sizeof(info)); | ||
| 4612 | spin_lock_irqsave(&hdsp->lock, flags); | 4613 | spin_lock_irqsave(&hdsp->lock, flags); |
| 4613 | info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp); | 4614 | info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp); |
| 4614 | info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp); | 4615 | info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp); |
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 547b713d7204..0c98ef9156d8 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
| @@ -4127,6 +4127,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file, | |||
| 4127 | 4127 | ||
| 4128 | case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO: | 4128 | case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO: |
| 4129 | 4129 | ||
| 4130 | memset(&info, 0, sizeof(info)); | ||
| 4130 | spin_lock_irq(&hdspm->lock); | 4131 | spin_lock_irq(&hdspm->lock); |
| 4131 | info.pref_sync_ref = hdspm_pref_sync_ref(hdspm); | 4132 | info.pref_sync_ref = hdspm_pref_sync_ref(hdspm); |
| 4132 | info.wordclock_sync_check = hdspm_wc_sync_check(hdspm); | 4133 | info.wordclock_sync_check = hdspm_wc_sync_check(hdspm); |
diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c index 2f12da4da561..581a670e8261 100644 --- a/sound/ppc/snd_ps3.c +++ b/sound/ppc/snd_ps3.c | |||
| @@ -579,7 +579,7 @@ static int snd_ps3_delay_to_bytes(struct snd_pcm_substream *substream, | |||
| 579 | rate * delay_ms / 1000) | 579 | rate * delay_ms / 1000) |
| 580 | * substream->runtime->channels; | 580 | * substream->runtime->channels; |
| 581 | 581 | ||
| 582 | pr_debug(KERN_ERR "%s: time=%d rate=%d bytes=%ld, frames=%d, ret=%d\n", | 582 | pr_debug("%s: time=%d rate=%d bytes=%ld, frames=%d, ret=%d\n", |
| 583 | __func__, | 583 | __func__, |
| 584 | delay_ms, | 584 | delay_ms, |
| 585 | rate, | 585 | rate, |
diff --git a/sound/soc/s3c24xx/s3c-dma.c b/sound/soc/s3c24xx/s3c-dma.c index 1b61c23ff300..f1b1bc4bacfb 100644 --- a/sound/soc/s3c24xx/s3c-dma.c +++ b/sound/soc/s3c24xx/s3c-dma.c | |||
| @@ -94,8 +94,7 @@ static void s3c_dma_enqueue(struct snd_pcm_substream *substream) | |||
| 94 | 94 | ||
| 95 | if ((pos + len) > prtd->dma_end) { | 95 | if ((pos + len) > prtd->dma_end) { |
| 96 | len = prtd->dma_end - pos; | 96 | len = prtd->dma_end - pos; |
| 97 | pr_debug(KERN_DEBUG "%s: corrected dma len %ld\n", | 97 | pr_debug("%s: corrected dma len %ld\n", __func__, len); |
| 98 | __func__, len); | ||
| 99 | } | 98 | } |
| 100 | 99 | ||
| 101 | ret = s3c2410_dma_enqueue(prtd->params->channel, | 100 | ret = s3c2410_dma_enqueue(prtd->params->channel, |
diff --git a/sound/soc/sh/migor.c b/sound/soc/sh/migor.c index b823a5c9b9bc..87e2b7fcbf17 100644 --- a/sound/soc/sh/migor.c +++ b/sound/soc/sh/migor.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/firmware.h> | 12 | #include <linux/firmware.h> |
| 13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 14 | 14 | ||
| 15 | #include <asm/clkdev.h> | ||
| 15 | #include <asm/clock.h> | 16 | #include <asm/clock.h> |
| 16 | 17 | ||
| 17 | #include <cpu/sh7722.h> | 18 | #include <cpu/sh7722.h> |
| @@ -40,12 +41,12 @@ static struct clk_ops siumckb_clk_ops = { | |||
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 42 | static struct clk siumckb_clk = { | 43 | static struct clk siumckb_clk = { |
| 43 | .name = "siumckb_clk", | ||
| 44 | .id = -1, | ||
| 45 | .ops = &siumckb_clk_ops, | 44 | .ops = &siumckb_clk_ops, |
| 46 | .rate = 0, /* initialised at run-time */ | 45 | .rate = 0, /* initialised at run-time */ |
| 47 | }; | 46 | }; |
| 48 | 47 | ||
| 48 | static struct clk_lookup *siumckb_lookup; | ||
| 49 | |||
| 49 | static int migor_hw_params(struct snd_pcm_substream *substream, | 50 | static int migor_hw_params(struct snd_pcm_substream *substream, |
| 50 | struct snd_pcm_hw_params *params) | 51 | struct snd_pcm_hw_params *params) |
| 51 | { | 52 | { |
| @@ -180,6 +181,13 @@ static int __init migor_init(void) | |||
| 180 | if (ret < 0) | 181 | if (ret < 0) |
| 181 | return ret; | 182 | return ret; |
| 182 | 183 | ||
| 184 | siumckb_lookup = clkdev_alloc(&siumckb_clk, "siumckb_clk", NULL); | ||
| 185 | if (!siumckb_lookup) { | ||
| 186 | ret = -ENOMEM; | ||
| 187 | goto eclkdevalloc; | ||
| 188 | } | ||
| 189 | clkdev_add(siumckb_lookup); | ||
| 190 | |||
| 183 | /* Port number used on this machine: port B */ | 191 | /* Port number used on this machine: port B */ |
| 184 | migor_snd_device = platform_device_alloc("soc-audio", 1); | 192 | migor_snd_device = platform_device_alloc("soc-audio", 1); |
| 185 | if (!migor_snd_device) { | 193 | if (!migor_snd_device) { |
| @@ -200,12 +208,15 @@ static int __init migor_init(void) | |||
| 200 | epdevadd: | 208 | epdevadd: |
| 201 | platform_device_put(migor_snd_device); | 209 | platform_device_put(migor_snd_device); |
| 202 | epdevalloc: | 210 | epdevalloc: |
| 211 | clkdev_drop(siumckb_lookup); | ||
| 212 | eclkdevalloc: | ||
| 203 | clk_unregister(&siumckb_clk); | 213 | clk_unregister(&siumckb_clk); |
| 204 | return ret; | 214 | return ret; |
| 205 | } | 215 | } |
| 206 | 216 | ||
| 207 | static void __exit migor_exit(void) | 217 | static void __exit migor_exit(void) |
| 208 | { | 218 | { |
| 219 | clkdev_drop(siumckb_lookup); | ||
| 209 | clk_unregister(&siumckb_clk); | 220 | clk_unregister(&siumckb_clk); |
| 210 | platform_device_unregister(migor_snd_device); | 221 | platform_device_unregister(migor_snd_device); |
| 211 | } | 222 | } |
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index adbc68ce9050..f6b0d2829ea9 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c | |||
| @@ -203,8 +203,9 @@ static int snd_soc_8_16_write(struct snd_soc_codec *codec, unsigned int reg, | |||
| 203 | data[1] = (value >> 8) & 0xff; | 203 | data[1] = (value >> 8) & 0xff; |
| 204 | data[2] = value & 0xff; | 204 | data[2] = value & 0xff; |
| 205 | 205 | ||
| 206 | if (!snd_soc_codec_volatile_register(codec, reg)) | 206 | if (!snd_soc_codec_volatile_register(codec, reg) |
| 207 | reg_cache[reg] = value; | 207 | && reg < codec->reg_cache_size) |
| 208 | reg_cache[reg] = value; | ||
| 208 | 209 | ||
| 209 | if (codec->cache_only) { | 210 | if (codec->cache_only) { |
| 210 | codec->cache_sync = 1; | 211 | codec->cache_sync = 1; |
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 4f1fa77c1feb..1950e19af1cf 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
| @@ -1017,7 +1017,7 @@ builtin-revert.o wt-status.o: wt-status.h | |||
| 1017 | # we compile into subdirectories. if the target directory is not the source directory, they might not exists. So | 1017 | # we compile into subdirectories. if the target directory is not the source directory, they might not exists. So |
| 1018 | # we depend the various files onto their directories. | 1018 | # we depend the various files onto their directories. |
| 1019 | DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h | 1019 | DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h |
| 1020 | $(DIRECTORY_DEPS): $(sort $(dir $(DIRECTORY_DEPS))) | 1020 | $(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_DEPS))) |
| 1021 | # In the second step, we make a rule to actually create these directories | 1021 | # In the second step, we make a rule to actually create these directories |
| 1022 | $(sort $(dir $(DIRECTORY_DEPS))): | 1022 | $(sort $(dir $(DIRECTORY_DEPS))): |
| 1023 | $(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null | 1023 | $(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null |
diff --git a/tools/perf/perf.h b/tools/perf/perf.h index ef7aa0a0c526..95aaf565c704 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h | |||
| @@ -73,6 +73,18 @@ void get_term_dimensions(struct winsize *ws); | |||
| 73 | #define cpu_relax() asm volatile("":::"memory") | 73 | #define cpu_relax() asm volatile("":::"memory") |
| 74 | #endif | 74 | #endif |
| 75 | 75 | ||
| 76 | #ifdef __mips__ | ||
| 77 | #include "../../arch/mips/include/asm/unistd.h" | ||
| 78 | #define rmb() asm volatile( \ | ||
| 79 | ".set mips2\n\t" \ | ||
| 80 | "sync\n\t" \ | ||
| 81 | ".set mips0" \ | ||
| 82 | : /* no output */ \ | ||
| 83 | : /* no input */ \ | ||
| 84 | : "memory") | ||
| 85 | #define cpu_relax() asm volatile("" ::: "memory") | ||
| 86 | #endif | ||
| 87 | |||
| 76 | #include <time.h> | 88 | #include <time.h> |
| 77 | #include <unistd.h> | 89 | #include <unistd.h> |
| 78 | #include <sys/types.h> | 90 | #include <sys/types.h> |
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c index 7ea983acfaea..f7af2fca965d 100644 --- a/tools/perf/util/trace-event-scripting.c +++ b/tools/perf/util/trace-event-scripting.c | |||
| @@ -97,7 +97,7 @@ void setup_python_scripting(void) | |||
| 97 | register_python_scripting(&python_scripting_unsupported_ops); | 97 | register_python_scripting(&python_scripting_unsupported_ops); |
| 98 | } | 98 | } |
| 99 | #else | 99 | #else |
| 100 | struct scripting_ops python_scripting_ops; | 100 | extern struct scripting_ops python_scripting_ops; |
| 101 | 101 | ||
| 102 | void setup_python_scripting(void) | 102 | void setup_python_scripting(void) |
| 103 | { | 103 | { |
| @@ -158,7 +158,7 @@ void setup_perl_scripting(void) | |||
| 158 | register_perl_scripting(&perl_scripting_unsupported_ops); | 158 | register_perl_scripting(&perl_scripting_unsupported_ops); |
| 159 | } | 159 | } |
| 160 | #else | 160 | #else |
| 161 | struct scripting_ops perl_scripting_ops; | 161 | extern struct scripting_ops perl_scripting_ops; |
| 162 | 162 | ||
| 163 | void setup_perl_scripting(void) | 163 | void setup_perl_scripting(void) |
| 164 | { | 164 | { |
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c index dafdf6775d77..6866aa4c41e0 100644 --- a/tools/perf/util/ui/browsers/hists.c +++ b/tools/perf/util/ui/browsers/hists.c | |||
| @@ -773,7 +773,7 @@ int hists__browse(struct hists *self, const char *helpline, const char *ev_name) | |||
| 773 | 773 | ||
| 774 | switch (key) { | 774 | switch (key) { |
| 775 | case 'a': | 775 | case 'a': |
| 776 | if (browser->selection->map == NULL && | 776 | if (browser->selection->map == NULL || |
| 777 | browser->selection->map->dso->annotate_warned) | 777 | browser->selection->map->dso->annotate_warned) |
| 778 | continue; | 778 | continue; |
| 779 | goto do_annotate; | 779 | goto do_annotate; |
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index 66cf65b510b1..c1f1e3c62984 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c | |||
| @@ -218,7 +218,6 @@ kvm_irqfd_assign(struct kvm *kvm, int fd, int gsi) | |||
| 218 | events = file->f_op->poll(file, &irqfd->pt); | 218 | events = file->f_op->poll(file, &irqfd->pt); |
| 219 | 219 | ||
| 220 | list_add_tail(&irqfd->list, &kvm->irqfds.items); | 220 | list_add_tail(&irqfd->list, &kvm->irqfds.items); |
| 221 | spin_unlock_irq(&kvm->irqfds.lock); | ||
| 222 | 221 | ||
| 223 | /* | 222 | /* |
| 224 | * Check if there was an event already pending on the eventfd | 223 | * Check if there was an event already pending on the eventfd |
| @@ -227,6 +226,8 @@ kvm_irqfd_assign(struct kvm *kvm, int fd, int gsi) | |||
| 227 | if (events & POLLIN) | 226 | if (events & POLLIN) |
| 228 | schedule_work(&irqfd->inject); | 227 | schedule_work(&irqfd->inject); |
| 229 | 228 | ||
| 229 | spin_unlock_irq(&kvm->irqfds.lock); | ||
| 230 | |||
| 230 | /* | 231 | /* |
| 231 | * do not drop the file until the irqfd is fully initialized, otherwise | 232 | * do not drop the file until the irqfd is fully initialized, otherwise |
| 232 | * we might race against the POLLHUP | 233 | * we might race against the POLLHUP |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index d4853a54771a..5186e728c53e 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
| @@ -1970,10 +1970,12 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val, | |||
| 1970 | 1970 | ||
| 1971 | asmlinkage void kvm_handle_fault_on_reboot(void) | 1971 | asmlinkage void kvm_handle_fault_on_reboot(void) |
| 1972 | { | 1972 | { |
| 1973 | if (kvm_rebooting) | 1973 | if (kvm_rebooting) { |
| 1974 | /* spin while reset goes on */ | 1974 | /* spin while reset goes on */ |
| 1975 | local_irq_enable(); | ||
| 1975 | while (true) | 1976 | while (true) |
| 1976 | ; | 1977 | ; |
| 1978 | } | ||
| 1977 | /* Fault while not rebooting. We want the trace. */ | 1979 | /* Fault while not rebooting. We want the trace. */ |
| 1978 | BUG(); | 1980 | BUG(); |
| 1979 | } | 1981 | } |
