diff options
224 files changed, 1314 insertions, 1256 deletions
diff --git a/Documentation/ABI/stable/sysfs-bus-usb b/Documentation/ABI/stable/sysfs-bus-usb index 2be603c52a24..a6b685724740 100644 --- a/Documentation/ABI/stable/sysfs-bus-usb +++ b/Documentation/ABI/stable/sysfs-bus-usb | |||
| @@ -37,8 +37,8 @@ Description: | |||
| 37 | that the USB device has been connected to the machine. This | 37 | that the USB device has been connected to the machine. This |
| 38 | file is read-only. | 38 | file is read-only. |
| 39 | Users: | 39 | Users: |
| 40 | PowerTOP <power@bughost.org> | 40 | PowerTOP <powertop@lists.01.org> |
| 41 | http://www.lesswatts.org/projects/powertop/ | 41 | https://01.org/powertop/ |
| 42 | 42 | ||
| 43 | What: /sys/bus/usb/device/.../power/active_duration | 43 | What: /sys/bus/usb/device/.../power/active_duration |
| 44 | Date: January 2008 | 44 | Date: January 2008 |
| @@ -57,8 +57,8 @@ Description: | |||
| 57 | will give an integer percentage. Note that this does not | 57 | will give an integer percentage. Note that this does not |
| 58 | account for counter wrap. | 58 | account for counter wrap. |
| 59 | Users: | 59 | Users: |
| 60 | PowerTOP <power@bughost.org> | 60 | PowerTOP <powertop@lists.01.org> |
| 61 | http://www.lesswatts.org/projects/powertop/ | 61 | https://01.org/powertop/ |
| 62 | 62 | ||
| 63 | What: /sys/bus/usb/devices/<busnum>-<port[.port]>...:<config num>-<interface num>/supports_autosuspend | 63 | What: /sys/bus/usb/devices/<busnum>-<port[.port]>...:<config num>-<interface num>/supports_autosuspend |
| 64 | Date: January 2008 | 64 | Date: January 2008 |
diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power index 9d43e7670841..efe449bdf811 100644 --- a/Documentation/ABI/testing/sysfs-devices-power +++ b/Documentation/ABI/testing/sysfs-devices-power | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | What: /sys/devices/.../power/ | 1 | What: /sys/devices/.../power/ |
| 2 | Date: January 2009 | 2 | Date: January 2009 |
| 3 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 3 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 4 | Description: | 4 | Description: |
| 5 | The /sys/devices/.../power directory contains attributes | 5 | The /sys/devices/.../power directory contains attributes |
| 6 | allowing the user space to check and modify some power | 6 | allowing the user space to check and modify some power |
| @@ -8,7 +8,7 @@ Description: | |||
| 8 | 8 | ||
| 9 | What: /sys/devices/.../power/wakeup | 9 | What: /sys/devices/.../power/wakeup |
| 10 | Date: January 2009 | 10 | Date: January 2009 |
| 11 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 11 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 12 | Description: | 12 | Description: |
| 13 | The /sys/devices/.../power/wakeup attribute allows the user | 13 | The /sys/devices/.../power/wakeup attribute allows the user |
| 14 | space to check if the device is enabled to wake up the system | 14 | space to check if the device is enabled to wake up the system |
| @@ -34,7 +34,7 @@ Description: | |||
| 34 | 34 | ||
| 35 | What: /sys/devices/.../power/control | 35 | What: /sys/devices/.../power/control |
| 36 | Date: January 2009 | 36 | Date: January 2009 |
| 37 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 37 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 38 | Description: | 38 | Description: |
| 39 | The /sys/devices/.../power/control attribute allows the user | 39 | The /sys/devices/.../power/control attribute allows the user |
| 40 | space to control the run-time power management of the device. | 40 | space to control the run-time power management of the device. |
| @@ -53,7 +53,7 @@ Description: | |||
| 53 | 53 | ||
| 54 | What: /sys/devices/.../power/async | 54 | What: /sys/devices/.../power/async |
| 55 | Date: January 2009 | 55 | Date: January 2009 |
| 56 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 56 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 57 | Description: | 57 | Description: |
| 58 | The /sys/devices/.../async attribute allows the user space to | 58 | The /sys/devices/.../async attribute allows the user space to |
| 59 | enable or diasble the device's suspend and resume callbacks to | 59 | enable or diasble the device's suspend and resume callbacks to |
| @@ -79,7 +79,7 @@ Description: | |||
| 79 | 79 | ||
| 80 | What: /sys/devices/.../power/wakeup_count | 80 | What: /sys/devices/.../power/wakeup_count |
| 81 | Date: September 2010 | 81 | Date: September 2010 |
| 82 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 82 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 83 | Description: | 83 | Description: |
| 84 | The /sys/devices/.../wakeup_count attribute contains the number | 84 | The /sys/devices/.../wakeup_count attribute contains the number |
| 85 | of signaled wakeup events associated with the device. This | 85 | of signaled wakeup events associated with the device. This |
| @@ -88,7 +88,7 @@ Description: | |||
| 88 | 88 | ||
| 89 | What: /sys/devices/.../power/wakeup_active_count | 89 | What: /sys/devices/.../power/wakeup_active_count |
| 90 | Date: September 2010 | 90 | Date: September 2010 |
| 91 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 91 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 92 | Description: | 92 | Description: |
| 93 | The /sys/devices/.../wakeup_active_count attribute contains the | 93 | The /sys/devices/.../wakeup_active_count attribute contains the |
| 94 | number of times the processing of wakeup events associated with | 94 | number of times the processing of wakeup events associated with |
| @@ -98,7 +98,7 @@ Description: | |||
| 98 | 98 | ||
| 99 | What: /sys/devices/.../power/wakeup_abort_count | 99 | What: /sys/devices/.../power/wakeup_abort_count |
| 100 | Date: February 2012 | 100 | Date: February 2012 |
| 101 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 101 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 102 | Description: | 102 | Description: |
| 103 | The /sys/devices/.../wakeup_abort_count attribute contains the | 103 | The /sys/devices/.../wakeup_abort_count attribute contains the |
| 104 | number of times the processing of a wakeup event associated with | 104 | number of times the processing of a wakeup event associated with |
| @@ -109,7 +109,7 @@ Description: | |||
| 109 | 109 | ||
| 110 | What: /sys/devices/.../power/wakeup_expire_count | 110 | What: /sys/devices/.../power/wakeup_expire_count |
| 111 | Date: February 2012 | 111 | Date: February 2012 |
| 112 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 112 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 113 | Description: | 113 | Description: |
| 114 | The /sys/devices/.../wakeup_expire_count attribute contains the | 114 | The /sys/devices/.../wakeup_expire_count attribute contains the |
| 115 | number of times a wakeup event associated with the device has | 115 | number of times a wakeup event associated with the device has |
| @@ -119,7 +119,7 @@ Description: | |||
| 119 | 119 | ||
| 120 | What: /sys/devices/.../power/wakeup_active | 120 | What: /sys/devices/.../power/wakeup_active |
| 121 | Date: September 2010 | 121 | Date: September 2010 |
| 122 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 122 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 123 | Description: | 123 | Description: |
| 124 | The /sys/devices/.../wakeup_active attribute contains either 1, | 124 | The /sys/devices/.../wakeup_active attribute contains either 1, |
| 125 | or 0, depending on whether or not a wakeup event associated with | 125 | or 0, depending on whether or not a wakeup event associated with |
| @@ -129,7 +129,7 @@ Description: | |||
| 129 | 129 | ||
| 130 | What: /sys/devices/.../power/wakeup_total_time_ms | 130 | What: /sys/devices/.../power/wakeup_total_time_ms |
| 131 | Date: September 2010 | 131 | Date: September 2010 |
| 132 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 132 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 133 | Description: | 133 | Description: |
| 134 | The /sys/devices/.../wakeup_total_time_ms attribute contains | 134 | The /sys/devices/.../wakeup_total_time_ms attribute contains |
| 135 | the total time of processing wakeup events associated with the | 135 | the total time of processing wakeup events associated with the |
| @@ -139,7 +139,7 @@ Description: | |||
| 139 | 139 | ||
| 140 | What: /sys/devices/.../power/wakeup_max_time_ms | 140 | What: /sys/devices/.../power/wakeup_max_time_ms |
| 141 | Date: September 2010 | 141 | Date: September 2010 |
| 142 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 142 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 143 | Description: | 143 | Description: |
| 144 | The /sys/devices/.../wakeup_max_time_ms attribute contains | 144 | The /sys/devices/.../wakeup_max_time_ms attribute contains |
| 145 | the maximum time of processing a single wakeup event associated | 145 | the maximum time of processing a single wakeup event associated |
| @@ -149,7 +149,7 @@ Description: | |||
| 149 | 149 | ||
| 150 | What: /sys/devices/.../power/wakeup_last_time_ms | 150 | What: /sys/devices/.../power/wakeup_last_time_ms |
| 151 | Date: September 2010 | 151 | Date: September 2010 |
| 152 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 152 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 153 | Description: | 153 | Description: |
| 154 | The /sys/devices/.../wakeup_last_time_ms attribute contains | 154 | The /sys/devices/.../wakeup_last_time_ms attribute contains |
| 155 | the value of the monotonic clock corresponding to the time of | 155 | the value of the monotonic clock corresponding to the time of |
| @@ -160,7 +160,7 @@ Description: | |||
| 160 | 160 | ||
| 161 | What: /sys/devices/.../power/wakeup_prevent_sleep_time_ms | 161 | What: /sys/devices/.../power/wakeup_prevent_sleep_time_ms |
| 162 | Date: February 2012 | 162 | Date: February 2012 |
| 163 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 163 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 164 | Description: | 164 | Description: |
| 165 | The /sys/devices/.../wakeup_prevent_sleep_time_ms attribute | 165 | The /sys/devices/.../wakeup_prevent_sleep_time_ms attribute |
| 166 | contains the total time the device has been preventing | 166 | contains the total time the device has been preventing |
| @@ -189,7 +189,7 @@ Description: | |||
| 189 | 189 | ||
| 190 | What: /sys/devices/.../power/pm_qos_latency_us | 190 | What: /sys/devices/.../power/pm_qos_latency_us |
| 191 | Date: March 2012 | 191 | Date: March 2012 |
| 192 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 192 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 193 | Description: | 193 | Description: |
| 194 | The /sys/devices/.../power/pm_qos_resume_latency_us attribute | 194 | The /sys/devices/.../power/pm_qos_resume_latency_us attribute |
| 195 | contains the PM QoS resume latency limit for the given device, | 195 | contains the PM QoS resume latency limit for the given device, |
| @@ -207,7 +207,7 @@ Description: | |||
| 207 | 207 | ||
| 208 | What: /sys/devices/.../power/pm_qos_no_power_off | 208 | What: /sys/devices/.../power/pm_qos_no_power_off |
| 209 | Date: September 2012 | 209 | Date: September 2012 |
| 210 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 210 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 211 | Description: | 211 | Description: |
| 212 | The /sys/devices/.../power/pm_qos_no_power_off attribute | 212 | The /sys/devices/.../power/pm_qos_no_power_off attribute |
| 213 | is used for manipulating the PM QoS "no power off" flag. If | 213 | is used for manipulating the PM QoS "no power off" flag. If |
| @@ -222,7 +222,7 @@ Description: | |||
| 222 | 222 | ||
| 223 | What: /sys/devices/.../power/pm_qos_remote_wakeup | 223 | What: /sys/devices/.../power/pm_qos_remote_wakeup |
| 224 | Date: September 2012 | 224 | Date: September 2012 |
| 225 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 225 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 226 | Description: | 226 | Description: |
| 227 | The /sys/devices/.../power/pm_qos_remote_wakeup attribute | 227 | The /sys/devices/.../power/pm_qos_remote_wakeup attribute |
| 228 | is used for manipulating the PM QoS "remote wakeup required" | 228 | is used for manipulating the PM QoS "remote wakeup required" |
diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/testing/sysfs-power index 217772615d02..205a73878441 100644 --- a/Documentation/ABI/testing/sysfs-power +++ b/Documentation/ABI/testing/sysfs-power | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | What: /sys/power/ | 1 | What: /sys/power/ |
| 2 | Date: August 2006 | 2 | Date: August 2006 |
| 3 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 3 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 4 | Description: | 4 | Description: |
| 5 | The /sys/power directory will contain files that will | 5 | The /sys/power directory will contain files that will |
| 6 | provide a unified interface to the power management | 6 | provide a unified interface to the power management |
| @@ -8,7 +8,7 @@ Description: | |||
| 8 | 8 | ||
| 9 | What: /sys/power/state | 9 | What: /sys/power/state |
| 10 | Date: August 2006 | 10 | Date: August 2006 |
| 11 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 11 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 12 | Description: | 12 | Description: |
| 13 | The /sys/power/state file controls the system power state. | 13 | The /sys/power/state file controls the system power state. |
| 14 | Reading from this file returns what states are supported, | 14 | Reading from this file returns what states are supported, |
| @@ -22,7 +22,7 @@ Description: | |||
| 22 | 22 | ||
| 23 | What: /sys/power/disk | 23 | What: /sys/power/disk |
| 24 | Date: September 2006 | 24 | Date: September 2006 |
| 25 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 25 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 26 | Description: | 26 | Description: |
| 27 | The /sys/power/disk file controls the operating mode of the | 27 | The /sys/power/disk file controls the operating mode of the |
| 28 | suspend-to-disk mechanism. Reading from this file returns | 28 | suspend-to-disk mechanism. Reading from this file returns |
| @@ -67,7 +67,7 @@ Description: | |||
| 67 | 67 | ||
| 68 | What: /sys/power/image_size | 68 | What: /sys/power/image_size |
| 69 | Date: August 2006 | 69 | Date: August 2006 |
| 70 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 70 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 71 | Description: | 71 | Description: |
| 72 | The /sys/power/image_size file controls the size of the image | 72 | The /sys/power/image_size file controls the size of the image |
| 73 | created by the suspend-to-disk mechanism. It can be written a | 73 | created by the suspend-to-disk mechanism. It can be written a |
| @@ -84,7 +84,7 @@ Description: | |||
| 84 | 84 | ||
| 85 | What: /sys/power/pm_trace | 85 | What: /sys/power/pm_trace |
| 86 | Date: August 2006 | 86 | Date: August 2006 |
| 87 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 87 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 88 | Description: | 88 | Description: |
| 89 | The /sys/power/pm_trace file controls the code which saves the | 89 | The /sys/power/pm_trace file controls the code which saves the |
| 90 | last PM event point in the RTC across reboots, so that you can | 90 | last PM event point in the RTC across reboots, so that you can |
| @@ -133,7 +133,7 @@ Description: | |||
| 133 | 133 | ||
| 134 | What: /sys/power/pm_async | 134 | What: /sys/power/pm_async |
| 135 | Date: January 2009 | 135 | Date: January 2009 |
| 136 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 136 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 137 | Description: | 137 | Description: |
| 138 | The /sys/power/pm_async file controls the switch allowing the | 138 | The /sys/power/pm_async file controls the switch allowing the |
| 139 | user space to enable or disable asynchronous suspend and resume | 139 | user space to enable or disable asynchronous suspend and resume |
| @@ -146,7 +146,7 @@ Description: | |||
| 146 | 146 | ||
| 147 | What: /sys/power/wakeup_count | 147 | What: /sys/power/wakeup_count |
| 148 | Date: July 2010 | 148 | Date: July 2010 |
| 149 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 149 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 150 | Description: | 150 | Description: |
| 151 | The /sys/power/wakeup_count file allows user space to put the | 151 | The /sys/power/wakeup_count file allows user space to put the |
| 152 | system into a sleep state while taking into account the | 152 | system into a sleep state while taking into account the |
| @@ -161,7 +161,7 @@ Description: | |||
| 161 | 161 | ||
| 162 | What: /sys/power/reserved_size | 162 | What: /sys/power/reserved_size |
| 163 | Date: May 2011 | 163 | Date: May 2011 |
| 164 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 164 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 165 | Description: | 165 | Description: |
| 166 | The /sys/power/reserved_size file allows user space to control | 166 | The /sys/power/reserved_size file allows user space to control |
| 167 | the amount of memory reserved for allocations made by device | 167 | the amount of memory reserved for allocations made by device |
| @@ -175,7 +175,7 @@ Description: | |||
| 175 | 175 | ||
| 176 | What: /sys/power/autosleep | 176 | What: /sys/power/autosleep |
| 177 | Date: April 2012 | 177 | Date: April 2012 |
| 178 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 178 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 179 | Description: | 179 | Description: |
| 180 | The /sys/power/autosleep file can be written one of the strings | 180 | The /sys/power/autosleep file can be written one of the strings |
| 181 | returned by reads from /sys/power/state. If that happens, a | 181 | returned by reads from /sys/power/state. If that happens, a |
| @@ -192,7 +192,7 @@ Description: | |||
| 192 | 192 | ||
| 193 | What: /sys/power/wake_lock | 193 | What: /sys/power/wake_lock |
| 194 | Date: February 2012 | 194 | Date: February 2012 |
| 195 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 195 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 196 | Description: | 196 | Description: |
| 197 | The /sys/power/wake_lock file allows user space to create | 197 | The /sys/power/wake_lock file allows user space to create |
| 198 | wakeup source objects and activate them on demand (if one of | 198 | wakeup source objects and activate them on demand (if one of |
| @@ -219,7 +219,7 @@ Description: | |||
| 219 | 219 | ||
| 220 | What: /sys/power/wake_unlock | 220 | What: /sys/power/wake_unlock |
| 221 | Date: February 2012 | 221 | Date: February 2012 |
| 222 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 222 | Contact: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 223 | Description: | 223 | Description: |
| 224 | The /sys/power/wake_unlock file allows user space to deactivate | 224 | The /sys/power/wake_unlock file allows user space to deactivate |
| 225 | wakeup sources created with the help of /sys/power/wake_lock. | 225 | wakeup sources created with the help of /sys/power/wake_lock. |
diff --git a/Documentation/acpi/dsdt-override.txt b/Documentation/acpi/dsdt-override.txt index febbb1ba4d23..784841caa6e6 100644 --- a/Documentation/acpi/dsdt-override.txt +++ b/Documentation/acpi/dsdt-override.txt | |||
| @@ -4,4 +4,4 @@ CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel. | |||
| 4 | 4 | ||
| 5 | When to use this method is described in detail on the | 5 | When to use this method is described in detail on the |
| 6 | Linux/ACPI home page: | 6 | Linux/ACPI home page: |
| 7 | http://www.lesswatts.org/projects/acpi/overridingDSDT.php | 7 | https://01.org/linux-acpi/documentation/overriding-dsdt |
diff --git a/Documentation/devicetree/bindings/memory.txt b/Documentation/devicetree/bindings/memory.txt deleted file mode 100644 index eb2469365593..000000000000 --- a/Documentation/devicetree/bindings/memory.txt +++ /dev/null | |||
| @@ -1,168 +0,0 @@ | |||
| 1 | *** Memory binding *** | ||
| 2 | |||
| 3 | The /memory node provides basic information about the address and size | ||
| 4 | of the physical memory. This node is usually filled or updated by the | ||
| 5 | bootloader, depending on the actual memory configuration of the given | ||
| 6 | hardware. | ||
| 7 | |||
| 8 | The memory layout is described by the following node: | ||
| 9 | |||
| 10 | / { | ||
| 11 | #address-cells = <(n)>; | ||
| 12 | #size-cells = <(m)>; | ||
| 13 | memory { | ||
| 14 | device_type = "memory"; | ||
| 15 | reg = <(baseaddr1) (size1) | ||
| 16 | (baseaddr2) (size2) | ||
| 17 | ... | ||
| 18 | (baseaddrN) (sizeN)>; | ||
| 19 | }; | ||
| 20 | ... | ||
| 21 | }; | ||
| 22 | |||
| 23 | A memory node follows the typical device tree rules for "reg" property: | ||
| 24 | n: number of cells used to store base address value | ||
| 25 | m: number of cells used to store size value | ||
| 26 | baseaddrX: defines a base address of the defined memory bank | ||
| 27 | sizeX: the size of the defined memory bank | ||
| 28 | |||
| 29 | |||
| 30 | More than one memory bank can be defined. | ||
| 31 | |||
| 32 | |||
| 33 | *** Reserved memory regions *** | ||
| 34 | |||
| 35 | In /memory/reserved-memory node one can create child nodes describing | ||
| 36 | particular reserved (excluded from normal use) memory regions. Such | ||
| 37 | memory regions are usually designed for the special usage by various | ||
| 38 | device drivers. A good example are contiguous memory allocations or | ||
| 39 | memory sharing with other operating system on the same hardware board. | ||
| 40 | Those special memory regions might depend on the board configuration and | ||
| 41 | devices used on the target system. | ||
| 42 | |||
| 43 | Parameters for each memory region can be encoded into the device tree | ||
| 44 | with the following convention: | ||
| 45 | |||
| 46 | [(label):] (name) { | ||
| 47 | compatible = "linux,contiguous-memory-region", "reserved-memory-region"; | ||
| 48 | reg = <(address) (size)>; | ||
| 49 | (linux,default-contiguous-region); | ||
| 50 | }; | ||
| 51 | |||
| 52 | compatible: one or more of: | ||
| 53 | - "linux,contiguous-memory-region" - enables binding of this | ||
| 54 | region to Contiguous Memory Allocator (special region for | ||
| 55 | contiguous memory allocations, shared with movable system | ||
| 56 | memory, Linux kernel-specific). | ||
| 57 | - "reserved-memory-region" - compatibility is defined, given | ||
| 58 | region is assigned for exclusive usage for by the respective | ||
| 59 | devices. | ||
| 60 | |||
| 61 | reg: standard property defining the base address and size of | ||
| 62 | the memory region | ||
| 63 | |||
| 64 | linux,default-contiguous-region: property indicating that the region | ||
| 65 | is the default region for all contiguous memory | ||
| 66 | allocations, Linux specific (optional) | ||
| 67 | |||
| 68 | It is optional to specify the base address, so if one wants to use | ||
| 69 | autoconfiguration of the base address, '0' can be specified as a base | ||
| 70 | address in the 'reg' property. | ||
| 71 | |||
| 72 | The /memory/reserved-memory node must contain the same #address-cells | ||
| 73 | and #size-cells value as the root node. | ||
| 74 | |||
| 75 | |||
| 76 | *** Device node's properties *** | ||
| 77 | |||
| 78 | Once regions in the /memory/reserved-memory node have been defined, they | ||
| 79 | may be referenced by other device nodes. Bindings that wish to reference | ||
| 80 | memory regions should explicitly document their use of the following | ||
| 81 | property: | ||
| 82 | |||
| 83 | memory-region = <&phandle_to_defined_region>; | ||
| 84 | |||
| 85 | This property indicates that the device driver should use the memory | ||
| 86 | region pointed by the given phandle. | ||
| 87 | |||
| 88 | |||
| 89 | *** Example *** | ||
| 90 | |||
| 91 | This example defines a memory consisting of 4 memory banks. 3 contiguous | ||
| 92 | regions are defined for Linux kernel, one default of all device drivers | ||
| 93 | (named contig_mem, placed at 0x72000000, 64MiB), one dedicated to the | ||
| 94 | framebuffer device (labelled display_mem, placed at 0x78000000, 8MiB) | ||
| 95 | and one for multimedia processing (labelled multimedia_mem, placed at | ||
| 96 | 0x77000000, 64MiB). 'display_mem' region is then assigned to fb@12300000 | ||
| 97 | device for DMA memory allocations (Linux kernel drivers will use CMA is | ||
| 98 | available or dma-exclusive usage otherwise). 'multimedia_mem' is | ||
| 99 | assigned to scaler@12500000 and codec@12600000 devices for contiguous | ||
| 100 | memory allocations when CMA driver is enabled. | ||
| 101 | |||
| 102 | The reason for creating a separate region for framebuffer device is to | ||
| 103 | match the framebuffer base address to the one configured by bootloader, | ||
| 104 | so once Linux kernel drivers starts no glitches on the displayed boot | ||
| 105 | logo appears. Scaller and codec drivers should share the memory | ||
| 106 | allocations. | ||
| 107 | |||
| 108 | / { | ||
| 109 | #address-cells = <1>; | ||
| 110 | #size-cells = <1>; | ||
| 111 | |||
| 112 | /* ... */ | ||
| 113 | |||
| 114 | memory { | ||
| 115 | reg = <0x40000000 0x10000000 | ||
| 116 | 0x50000000 0x10000000 | ||
| 117 | 0x60000000 0x10000000 | ||
| 118 | 0x70000000 0x10000000>; | ||
| 119 | |||
| 120 | reserved-memory { | ||
| 121 | #address-cells = <1>; | ||
| 122 | #size-cells = <1>; | ||
| 123 | |||
| 124 | /* | ||
| 125 | * global autoconfigured region for contiguous allocations | ||
| 126 | * (used only with Contiguous Memory Allocator) | ||
| 127 | */ | ||
| 128 | contig_region@0 { | ||
| 129 | compatible = "linux,contiguous-memory-region"; | ||
| 130 | reg = <0x0 0x4000000>; | ||
| 131 | linux,default-contiguous-region; | ||
| 132 | }; | ||
| 133 | |||
| 134 | /* | ||
| 135 | * special region for framebuffer | ||
| 136 | */ | ||
| 137 | display_region: region@78000000 { | ||
| 138 | compatible = "linux,contiguous-memory-region", "reserved-memory-region"; | ||
| 139 | reg = <0x78000000 0x800000>; | ||
| 140 | }; | ||
| 141 | |||
| 142 | /* | ||
| 143 | * special region for multimedia processing devices | ||
| 144 | */ | ||
| 145 | multimedia_region: region@77000000 { | ||
| 146 | compatible = "linux,contiguous-memory-region"; | ||
| 147 | reg = <0x77000000 0x4000000>; | ||
| 148 | }; | ||
| 149 | }; | ||
| 150 | }; | ||
| 151 | |||
| 152 | /* ... */ | ||
| 153 | |||
| 154 | fb0: fb@12300000 { | ||
| 155 | status = "okay"; | ||
| 156 | memory-region = <&display_region>; | ||
| 157 | }; | ||
| 158 | |||
| 159 | scaler: scaler@12500000 { | ||
| 160 | status = "okay"; | ||
| 161 | memory-region = <&multimedia_region>; | ||
| 162 | }; | ||
| 163 | |||
| 164 | codec: codec@12600000 { | ||
| 165 | status = "okay"; | ||
| 166 | memory-region = <&multimedia_region>; | ||
| 167 | }; | ||
| 168 | }; | ||
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index f911e3656209..85c362d8ea34 100644 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ b/Documentation/sound/alsa/HD-Audio-Models.txt | |||
| @@ -28,6 +28,7 @@ ALC269/270/275/276/28x/29x | |||
| 28 | alc269-dmic Enable ALC269(VA) digital mic workaround | 28 | alc269-dmic Enable ALC269(VA) digital mic workaround |
| 29 | alc271-dmic Enable ALC271X digital mic workaround | 29 | alc271-dmic Enable ALC271X digital mic workaround |
| 30 | inv-dmic Inverted internal mic workaround | 30 | inv-dmic Inverted internal mic workaround |
| 31 | headset-mic Indicates a combined headset (headphone+mic) jack | ||
| 31 | lenovo-dock Enables docking station I/O for some Lenovos | 32 | lenovo-dock Enables docking station I/O for some Lenovos |
| 32 | dell-headset-multi Headset jack, which can also be used as mic-in | 33 | dell-headset-multi Headset jack, which can also be used as mic-in |
| 33 | dell-headset-dock Headset jack (without mic-in), and also dock I/O | 34 | dell-headset-dock Headset jack (without mic-in), and also dock I/O |
diff --git a/MAINTAINERS b/MAINTAINERS index 8a0cbf3cf2c8..a7c34ef3509d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -237,11 +237,11 @@ F: drivers/platform/x86/acer-wmi.c | |||
| 237 | 237 | ||
| 238 | ACPI | 238 | ACPI |
| 239 | M: Len Brown <lenb@kernel.org> | 239 | M: Len Brown <lenb@kernel.org> |
| 240 | M: Rafael J. Wysocki <rjw@sisk.pl> | 240 | M: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 241 | L: linux-acpi@vger.kernel.org | 241 | L: linux-acpi@vger.kernel.org |
| 242 | W: http://www.lesswatts.org/projects/acpi/ | 242 | W: https://01.org/linux-acpi |
| 243 | Q: http://patchwork.kernel.org/project/linux-acpi/list/ | 243 | Q: https://patchwork.kernel.org/project/linux-acpi/list/ |
| 244 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux | 244 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm |
| 245 | S: Supported | 245 | S: Supported |
| 246 | F: drivers/acpi/ | 246 | F: drivers/acpi/ |
| 247 | F: drivers/pnp/pnpacpi/ | 247 | F: drivers/pnp/pnpacpi/ |
| @@ -256,21 +256,21 @@ F: drivers/pci/*/*/*acpi* | |||
| 256 | ACPI FAN DRIVER | 256 | ACPI FAN DRIVER |
| 257 | M: Zhang Rui <rui.zhang@intel.com> | 257 | M: Zhang Rui <rui.zhang@intel.com> |
| 258 | L: linux-acpi@vger.kernel.org | 258 | L: linux-acpi@vger.kernel.org |
| 259 | W: http://www.lesswatts.org/projects/acpi/ | 259 | W: https://01.org/linux-acpi |
| 260 | S: Supported | 260 | S: Supported |
| 261 | F: drivers/acpi/fan.c | 261 | F: drivers/acpi/fan.c |
| 262 | 262 | ||
| 263 | ACPI THERMAL DRIVER | 263 | ACPI THERMAL DRIVER |
| 264 | M: Zhang Rui <rui.zhang@intel.com> | 264 | M: Zhang Rui <rui.zhang@intel.com> |
| 265 | L: linux-acpi@vger.kernel.org | 265 | L: linux-acpi@vger.kernel.org |
| 266 | W: http://www.lesswatts.org/projects/acpi/ | 266 | W: https://01.org/linux-acpi |
| 267 | S: Supported | 267 | S: Supported |
| 268 | F: drivers/acpi/*thermal* | 268 | F: drivers/acpi/*thermal* |
| 269 | 269 | ||
| 270 | ACPI VIDEO DRIVER | 270 | ACPI VIDEO DRIVER |
| 271 | M: Zhang Rui <rui.zhang@intel.com> | 271 | M: Zhang Rui <rui.zhang@intel.com> |
| 272 | L: linux-acpi@vger.kernel.org | 272 | L: linux-acpi@vger.kernel.org |
| 273 | W: http://www.lesswatts.org/projects/acpi/ | 273 | W: https://01.org/linux-acpi |
| 274 | S: Supported | 274 | S: Supported |
| 275 | F: drivers/acpi/video.c | 275 | F: drivers/acpi/video.c |
| 276 | 276 | ||
| @@ -2300,7 +2300,7 @@ S: Maintained | |||
| 2300 | F: drivers/net/ethernet/ti/cpmac.c | 2300 | F: drivers/net/ethernet/ti/cpmac.c |
| 2301 | 2301 | ||
| 2302 | CPU FREQUENCY DRIVERS | 2302 | CPU FREQUENCY DRIVERS |
| 2303 | M: Rafael J. Wysocki <rjw@sisk.pl> | 2303 | M: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 2304 | M: Viresh Kumar <viresh.kumar@linaro.org> | 2304 | M: Viresh Kumar <viresh.kumar@linaro.org> |
| 2305 | L: cpufreq@vger.kernel.org | 2305 | L: cpufreq@vger.kernel.org |
| 2306 | L: linux-pm@vger.kernel.org | 2306 | L: linux-pm@vger.kernel.org |
| @@ -2331,7 +2331,7 @@ S: Maintained | |||
| 2331 | F: drivers/cpuidle/cpuidle-big_little.c | 2331 | F: drivers/cpuidle/cpuidle-big_little.c |
| 2332 | 2332 | ||
| 2333 | CPUIDLE DRIVERS | 2333 | CPUIDLE DRIVERS |
| 2334 | M: Rafael J. Wysocki <rjw@sisk.pl> | 2334 | M: Rafael J. Wysocki <rjw@rjwysocki.net> |
| 2335 | M: Daniel Lezcano <daniel.lezcano@linaro.org> | 2335 | M: Daniel Lezcano <daniel.lezcano@linaro.org> |
| 2336 | L: linux-pm@vger.kernel.org | 2336 | L: linux-pm@vger.kernel.org |
| 2337 | S: Maintained | 2337 | S: Maintained |
| @@ -3553,7 +3553,7 @@ F: fs/freevxfs/ | |||
| 3553 | 3553 | ||
| 3554 | FREEZER | 3554 | FREEZER |
| 3555 | M: Pavel Machek <pavel@ucw.cz> | 3555 | M: Pavel Machek <pavel@ucw.cz> |
| 3556 | M: "Rafael J. Wysocki" <rjw@sisk.pl> | 3556 | M: "Rafael J. Wysocki" <rjw@rjwysocki.net> |
| 3557 | L: linux-pm@vger.kernel.org | 3557 | L: linux-pm@vger.kernel.org |
| 3558 | S: Supported | 3558 | S: Supported |
| 3559 | F: Documentation/power/freezing-of-tasks.txt | 3559 | F: Documentation/power/freezing-of-tasks.txt |
| @@ -3624,6 +3624,12 @@ L: linux-scsi@vger.kernel.org | |||
| 3624 | S: Odd Fixes (e.g., new signatures) | 3624 | S: Odd Fixes (e.g., new signatures) |
| 3625 | F: drivers/scsi/fdomain.* | 3625 | F: drivers/scsi/fdomain.* |
| 3626 | 3626 | ||
| 3627 | GCOV BASED KERNEL PROFILING | ||
| 3628 | M: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> | ||
| 3629 | S: Maintained | ||
| 3630 | F: kernel/gcov/ | ||
| 3631 | F: Documentation/gcov.txt | ||
| 3632 | |||
| 3627 | GDT SCSI DISK ARRAY CONTROLLER DRIVER | 3633 | GDT SCSI DISK ARRAY CONTROLLER DRIVER |
| 3628 | M: Achim Leubner <achim_leubner@adaptec.com> | 3634 | M: Achim Leubner <achim_leubner@adaptec.com> |
| 3629 | L: linux-scsi@vger.kernel.org | 3635 | L: linux-scsi@vger.kernel.org |
| @@ -3889,7 +3895,7 @@ F: drivers/video/hgafb.c | |||
| 3889 | 3895 | ||
| 3890 | HIBERNATION (aka Software Suspend, aka swsusp) | 3896 | HIBERNATION (aka Software Suspend, aka swsusp) |
| 3891 | M: Pavel Machek <pavel@ucw.cz> | 3897 | M: Pavel Machek <pavel@ucw.cz> |
| 3892 | M: "Rafael J. Wysocki" <rjw@sisk.pl> | 3898 | M: "Rafael J. Wysocki" <rjw@rjwysocki.net> |
| 3893 | L: linux-pm@vger.kernel.org | 3899 | L: linux-pm@vger.kernel.org |
| 3894 | S: Supported | 3900 | S: Supported |
| 3895 | F: arch/x86/power/ | 3901 | F: arch/x86/power/ |
| @@ -4339,7 +4345,7 @@ F: drivers/video/i810/ | |||
| 4339 | INTEL MENLOW THERMAL DRIVER | 4345 | INTEL MENLOW THERMAL DRIVER |
| 4340 | M: Sujith Thomas <sujith.thomas@intel.com> | 4346 | M: Sujith Thomas <sujith.thomas@intel.com> |
| 4341 | L: platform-driver-x86@vger.kernel.org | 4347 | L: platform-driver-x86@vger.kernel.org |
| 4342 | W: http://www.lesswatts.org/projects/acpi/ | 4348 | W: https://01.org/linux-acpi |
| 4343 | S: Supported | 4349 | S: Supported |
| 4344 | F: drivers/platform/x86/intel_menlow.c | 4350 | F: drivers/platform/x86/intel_menlow.c |
| 4345 | 4351 | ||
| @@ -8095,7 +8101,7 @@ F: drivers/sh/ | |||
| 8095 | SUSPEND TO RAM | 8101 | SUSPEND TO RAM |
| 8096 | M: Len Brown <len.brown@intel.com> | 8102 | M: Len Brown <len.brown@intel.com> |
| 8097 | M: Pavel Machek <pavel@ucw.cz> | 8103 | M: Pavel Machek <pavel@ucw.cz> |
| 8098 | M: "Rafael J. Wysocki" <rjw@sisk.pl> | 8104 | M: "Rafael J. Wysocki" <rjw@rjwysocki.net> |
| 8099 | L: linux-pm@vger.kernel.org | 8105 | L: linux-pm@vger.kernel.org |
| 8100 | S: Supported | 8106 | S: Supported |
| 8101 | F: Documentation/power/ | 8107 | F: Documentation/power/ |
| @@ -1,7 +1,7 @@ | |||
| 1 | VERSION = 3 | 1 | VERSION = 3 |
| 2 | PATCHLEVEL = 12 | 2 | PATCHLEVEL = 12 |
| 3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
| 4 | EXTRAVERSION = -rc4 | 4 | EXTRAVERSION = -rc5 |
| 5 | NAME = One Giant Leap for Frogkind | 5 | NAME = One Giant Leap for Frogkind |
| 6 | 6 | ||
| 7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arc/kernel/ptrace.c b/arch/arc/kernel/ptrace.c index 333238564b67..5d76706139dd 100644 --- a/arch/arc/kernel/ptrace.c +++ b/arch/arc/kernel/ptrace.c | |||
| @@ -102,7 +102,7 @@ static int genregs_set(struct task_struct *target, | |||
| 102 | REG_IGNORE_ONE(pad2); | 102 | REG_IGNORE_ONE(pad2); |
| 103 | REG_IN_CHUNK(callee, efa, cregs); /* callee_regs[r25..r13] */ | 103 | REG_IN_CHUNK(callee, efa, cregs); /* callee_regs[r25..r13] */ |
| 104 | REG_IGNORE_ONE(efa); /* efa update invalid */ | 104 | REG_IGNORE_ONE(efa); /* efa update invalid */ |
| 105 | REG_IN_ONE(stop_pc, &ptregs->ret); /* stop_pc: PC update */ | 105 | REG_IGNORE_ONE(stop_pc); /* PC updated via @ret */ |
| 106 | 106 | ||
| 107 | return ret; | 107 | return ret; |
| 108 | } | 108 | } |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index a37a50f575a2..db50b626be98 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
| @@ -296,10 +296,15 @@ archprepare: | |||
| 296 | # Convert bzImage to zImage | 296 | # Convert bzImage to zImage |
| 297 | bzImage: zImage | 297 | bzImage: zImage |
| 298 | 298 | ||
| 299 | zImage Image xipImage bootpImage uImage: vmlinux | 299 | BOOT_TARGETS = zImage Image xipImage bootpImage uImage |
| 300 | INSTALL_TARGETS = zinstall uinstall install | ||
| 301 | |||
| 302 | PHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS) | ||
| 303 | |||
| 304 | $(BOOT_TARGETS): vmlinux | ||
| 300 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ | 305 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ |
| 301 | 306 | ||
| 302 | zinstall uinstall install: vmlinux | 307 | $(INSTALL_TARGETS): |
| 303 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ | 308 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ |
| 304 | 309 | ||
| 305 | %.dtb: | scripts | 310 | %.dtb: | scripts |
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index 84aa2caf07ed..ec2f8065f955 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile | |||
| @@ -95,24 +95,24 @@ initrd: | |||
| 95 | @test "$(INITRD)" != "" || \ | 95 | @test "$(INITRD)" != "" || \ |
| 96 | (echo You must specify INITRD; exit -1) | 96 | (echo You must specify INITRD; exit -1) |
| 97 | 97 | ||
| 98 | install: $(obj)/Image | 98 | install: |
| 99 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ | 99 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
| 100 | $(obj)/Image System.map "$(INSTALL_PATH)" | 100 | $(obj)/Image System.map "$(INSTALL_PATH)" |
| 101 | 101 | ||
| 102 | zinstall: $(obj)/zImage | 102 | zinstall: |
| 103 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ | 103 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
| 104 | $(obj)/zImage System.map "$(INSTALL_PATH)" | 104 | $(obj)/zImage System.map "$(INSTALL_PATH)" |
| 105 | 105 | ||
| 106 | uinstall: $(obj)/uImage | 106 | uinstall: |
| 107 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ | 107 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
| 108 | $(obj)/uImage System.map "$(INSTALL_PATH)" | 108 | $(obj)/uImage System.map "$(INSTALL_PATH)" |
| 109 | 109 | ||
| 110 | zi: | 110 | zi: |
| 111 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ | 111 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
| 112 | $(obj)/zImage System.map "$(INSTALL_PATH)" | 112 | $(obj)/zImage System.map "$(INSTALL_PATH)" |
| 113 | 113 | ||
| 114 | i: | 114 | i: |
| 115 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ | 115 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
| 116 | $(obj)/Image System.map "$(INSTALL_PATH)" | 116 | $(obj)/Image System.map "$(INSTALL_PATH)" |
| 117 | 117 | ||
| 118 | subdir- := bootp compressed dts | 118 | subdir- := bootp compressed dts |
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index 7d7cc777ff7b..bbac42a78ce5 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi | |||
| @@ -96,6 +96,11 @@ | |||
| 96 | <1 14 0xf08>, | 96 | <1 14 0xf08>, |
| 97 | <1 11 0xf08>, | 97 | <1 11 0xf08>, |
| 98 | <1 10 0xf08>; | 98 | <1 10 0xf08>; |
| 99 | /* Unfortunately we need this since some versions of U-Boot | ||
| 100 | * on Exynos don't set the CNTFRQ register, so we need the | ||
| 101 | * value from DT. | ||
| 102 | */ | ||
| 103 | clock-frequency = <24000000>; | ||
| 99 | }; | 104 | }; |
| 100 | 105 | ||
| 101 | mct@101C0000 { | 106 | mct@101C0000 { |
diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts index 0c514dc8460c..2816bf612672 100644 --- a/arch/arm/boot/dts/omap3-beagle-xm.dts +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | / { | 12 | / { |
| 13 | model = "TI OMAP3 BeagleBoard xM"; | 13 | model = "TI OMAP3 BeagleBoard xM"; |
| 14 | compatible = "ti,omap3-beagle-xm", "ti,omap3-beagle", "ti,omap3"; | 14 | compatible = "ti,omap3-beagle-xm", "ti,omap36xx", "ti,omap3"; |
| 15 | 15 | ||
| 16 | cpus { | 16 | cpus { |
| 17 | cpu@0 { | 17 | cpu@0 { |
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index 7d95cda1fae4..b41bd57f4328 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi | |||
| @@ -108,7 +108,7 @@ | |||
| 108 | #address-cells = <1>; | 108 | #address-cells = <1>; |
| 109 | #size-cells = <0>; | 109 | #size-cells = <0>; |
| 110 | pinctrl-single,register-width = <16>; | 110 | pinctrl-single,register-width = <16>; |
| 111 | pinctrl-single,function-mask = <0x7f1f>; | 111 | pinctrl-single,function-mask = <0xff1f>; |
| 112 | }; | 112 | }; |
| 113 | 113 | ||
| 114 | omap3_pmx_wkup: pinmux@0x48002a00 { | 114 | omap3_pmx_wkup: pinmux@0x48002a00 { |
| @@ -117,7 +117,7 @@ | |||
| 117 | #address-cells = <1>; | 117 | #address-cells = <1>; |
| 118 | #size-cells = <0>; | 118 | #size-cells = <0>; |
| 119 | pinctrl-single,register-width = <16>; | 119 | pinctrl-single,register-width = <16>; |
| 120 | pinctrl-single,function-mask = <0x7f1f>; | 120 | pinctrl-single,function-mask = <0xff1f>; |
| 121 | }; | 121 | }; |
| 122 | 122 | ||
| 123 | gpio1: gpio@48310000 { | 123 | gpio1: gpio@48310000 { |
diff --git a/arch/arm/boot/install.sh b/arch/arm/boot/install.sh index 06ea7d42ce8e..2a45092a40e3 100644 --- a/arch/arm/boot/install.sh +++ b/arch/arm/boot/install.sh | |||
| @@ -20,6 +20,20 @@ | |||
| 20 | # $4 - default install path (blank if root directory) | 20 | # $4 - default install path (blank if root directory) |
| 21 | # | 21 | # |
| 22 | 22 | ||
| 23 | verify () { | ||
| 24 | if [ ! -f "$1" ]; then | ||
| 25 | echo "" 1>&2 | ||
| 26 | echo " *** Missing file: $1" 1>&2 | ||
| 27 | echo ' *** You need to run "make" before "make install".' 1>&2 | ||
| 28 | echo "" 1>&2 | ||
| 29 | exit 1 | ||
| 30 | fi | ||
| 31 | } | ||
| 32 | |||
| 33 | # Make sure the files actually exist | ||
| 34 | verify "$2" | ||
| 35 | verify "$3" | ||
| 36 | |||
| 23 | # User may have a custom install script | 37 | # User may have a custom install script |
| 24 | if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi | 38 | if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi |
| 25 | if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi | 39 | if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi |
diff --git a/arch/arm/common/mcpm_entry.c b/arch/arm/common/mcpm_entry.c index 370236dd1a03..990250965f2c 100644 --- a/arch/arm/common/mcpm_entry.c +++ b/arch/arm/common/mcpm_entry.c | |||
| @@ -51,7 +51,8 @@ void mcpm_cpu_power_down(void) | |||
| 51 | { | 51 | { |
| 52 | phys_reset_t phys_reset; | 52 | phys_reset_t phys_reset; |
| 53 | 53 | ||
| 54 | BUG_ON(!platform_ops); | 54 | if (WARN_ON_ONCE(!platform_ops || !platform_ops->power_down)) |
| 55 | return; | ||
| 55 | BUG_ON(!irqs_disabled()); | 56 | BUG_ON(!irqs_disabled()); |
| 56 | 57 | ||
| 57 | /* | 58 | /* |
| @@ -93,7 +94,8 @@ void mcpm_cpu_suspend(u64 expected_residency) | |||
| 93 | { | 94 | { |
| 94 | phys_reset_t phys_reset; | 95 | phys_reset_t phys_reset; |
| 95 | 96 | ||
| 96 | BUG_ON(!platform_ops); | 97 | if (WARN_ON_ONCE(!platform_ops || !platform_ops->suspend)) |
| 98 | return; | ||
| 97 | BUG_ON(!irqs_disabled()); | 99 | BUG_ON(!irqs_disabled()); |
| 98 | 100 | ||
| 99 | /* Very similar to mcpm_cpu_power_down() */ | 101 | /* Very similar to mcpm_cpu_power_down() */ |
diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c index d56c932580eb..025f6ce38596 100644 --- a/arch/arm/common/sharpsl_param.c +++ b/arch/arm/common/sharpsl_param.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
| 17 | #include <asm/mach/sharpsl_param.h> | 17 | #include <asm/mach/sharpsl_param.h> |
| 18 | #include <asm/memory.h> | ||
| 18 | 19 | ||
| 19 | /* | 20 | /* |
| 20 | * Certain hardware parameters determined at the time of device manufacture, | 21 | * Certain hardware parameters determined at the time of device manufacture, |
| @@ -25,8 +26,10 @@ | |||
| 25 | */ | 26 | */ |
| 26 | #ifdef CONFIG_ARCH_SA1100 | 27 | #ifdef CONFIG_ARCH_SA1100 |
| 27 | #define PARAM_BASE 0xe8ffc000 | 28 | #define PARAM_BASE 0xe8ffc000 |
| 29 | #define param_start(x) (void *)(x) | ||
| 28 | #else | 30 | #else |
| 29 | #define PARAM_BASE 0xa0000a00 | 31 | #define PARAM_BASE 0xa0000a00 |
| 32 | #define param_start(x) __va(x) | ||
| 30 | #endif | 33 | #endif |
| 31 | #define MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a ) | 34 | #define MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a ) |
| 32 | 35 | ||
| @@ -41,7 +44,7 @@ EXPORT_SYMBOL(sharpsl_param); | |||
| 41 | 44 | ||
| 42 | void sharpsl_save_param(void) | 45 | void sharpsl_save_param(void) |
| 43 | { | 46 | { |
| 44 | memcpy(&sharpsl_param, (void *)PARAM_BASE, sizeof(struct sharpsl_param_info)); | 47 | memcpy(&sharpsl_param, param_start(PARAM_BASE), sizeof(struct sharpsl_param_info)); |
| 45 | 48 | ||
| 46 | if (sharpsl_param.comadj_keyword != COMADJ_MAGIC) | 49 | if (sharpsl_param.comadj_keyword != COMADJ_MAGIC) |
| 47 | sharpsl_param.comadj=-1; | 50 | sharpsl_param.comadj=-1; |
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index d3db39860b9c..59ceae8f3c95 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild | |||
| @@ -31,5 +31,4 @@ generic-y += termbits.h | |||
| 31 | generic-y += termios.h | 31 | generic-y += termios.h |
| 32 | generic-y += timex.h | 32 | generic-y += timex.h |
| 33 | generic-y += trace_clock.h | 33 | generic-y += trace_clock.h |
| 34 | generic-y += types.h | ||
| 35 | generic-y += unaligned.h | 34 | generic-y += unaligned.h |
diff --git a/arch/arm/include/asm/jump_label.h b/arch/arm/include/asm/jump_label.h index bfc198c75913..863c892b4aaa 100644 --- a/arch/arm/include/asm/jump_label.h +++ b/arch/arm/include/asm/jump_label.h | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | static __always_inline bool arch_static_branch(struct static_key *key) | 17 | static __always_inline bool arch_static_branch(struct static_key *key) |
| 18 | { | 18 | { |
| 19 | asm goto("1:\n\t" | 19 | asm_volatile_goto("1:\n\t" |
| 20 | JUMP_LABEL_NOP "\n\t" | 20 | JUMP_LABEL_NOP "\n\t" |
| 21 | ".pushsection __jump_table, \"aw\"\n\t" | 21 | ".pushsection __jump_table, \"aw\"\n\t" |
| 22 | ".word 1b, %l[l_yes], %c0\n\t" | 22 | ".word 1b, %l[l_yes], %c0\n\t" |
diff --git a/arch/arm/include/asm/mcpm.h b/arch/arm/include/asm/mcpm.h index 0f7b7620e9a5..fc82a88f5b69 100644 --- a/arch/arm/include/asm/mcpm.h +++ b/arch/arm/include/asm/mcpm.h | |||
| @@ -76,8 +76,11 @@ int mcpm_cpu_power_up(unsigned int cpu, unsigned int cluster); | |||
| 76 | * | 76 | * |
| 77 | * This must be called with interrupts disabled. | 77 | * This must be called with interrupts disabled. |
| 78 | * | 78 | * |
| 79 | * This does not return. Re-entry in the kernel is expected via | 79 | * On success this does not return. Re-entry in the kernel is expected |
| 80 | * mcpm_entry_point. | 80 | * via mcpm_entry_point. |
| 81 | * | ||
| 82 | * This will return if mcpm_platform_register() has not been called | ||
| 83 | * previously in which case the caller should take appropriate action. | ||
| 81 | */ | 84 | */ |
| 82 | void mcpm_cpu_power_down(void); | 85 | void mcpm_cpu_power_down(void); |
| 83 | 86 | ||
| @@ -98,8 +101,11 @@ void mcpm_cpu_power_down(void); | |||
| 98 | * | 101 | * |
| 99 | * This must be called with interrupts disabled. | 102 | * This must be called with interrupts disabled. |
| 100 | * | 103 | * |
| 101 | * This does not return. Re-entry in the kernel is expected via | 104 | * On success this does not return. Re-entry in the kernel is expected |
| 102 | * mcpm_entry_point. | 105 | * via mcpm_entry_point. |
| 106 | * | ||
| 107 | * This will return if mcpm_platform_register() has not been called | ||
| 108 | * previously in which case the caller should take appropriate action. | ||
| 103 | */ | 109 | */ |
| 104 | void mcpm_cpu_suspend(u64 expected_residency); | 110 | void mcpm_cpu_suspend(u64 expected_residency); |
| 105 | 111 | ||
diff --git a/arch/arm/include/asm/syscall.h b/arch/arm/include/asm/syscall.h index f1d96d4e8092..73ddd7239b33 100644 --- a/arch/arm/include/asm/syscall.h +++ b/arch/arm/include/asm/syscall.h | |||
| @@ -57,6 +57,9 @@ static inline void syscall_get_arguments(struct task_struct *task, | |||
| 57 | unsigned int i, unsigned int n, | 57 | unsigned int i, unsigned int n, |
| 58 | unsigned long *args) | 58 | unsigned long *args) |
| 59 | { | 59 | { |
| 60 | if (n == 0) | ||
| 61 | return; | ||
| 62 | |||
| 60 | if (i + n > SYSCALL_MAX_ARGS) { | 63 | if (i + n > SYSCALL_MAX_ARGS) { |
| 61 | unsigned long *args_bad = args + SYSCALL_MAX_ARGS - i; | 64 | unsigned long *args_bad = args + SYSCALL_MAX_ARGS - i; |
| 62 | unsigned int n_bad = n + i - SYSCALL_MAX_ARGS; | 65 | unsigned int n_bad = n + i - SYSCALL_MAX_ARGS; |
| @@ -81,6 +84,9 @@ static inline void syscall_set_arguments(struct task_struct *task, | |||
| 81 | unsigned int i, unsigned int n, | 84 | unsigned int i, unsigned int n, |
| 82 | const unsigned long *args) | 85 | const unsigned long *args) |
| 83 | { | 86 | { |
| 87 | if (n == 0) | ||
| 88 | return; | ||
| 89 | |||
| 84 | if (i + n > SYSCALL_MAX_ARGS) { | 90 | if (i + n > SYSCALL_MAX_ARGS) { |
| 85 | pr_warning("%s called with max args %d, handling only %d\n", | 91 | pr_warning("%s called with max args %d, handling only %d\n", |
| 86 | __func__, i + n, SYSCALL_MAX_ARGS); | 92 | __func__, i + n, SYSCALL_MAX_ARGS); |
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 2c7cc1e03473..476de57dcef2 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
| @@ -487,7 +487,26 @@ __fixup_smp: | |||
| 487 | mrc p15, 0, r0, c0, c0, 5 @ read MPIDR | 487 | mrc p15, 0, r0, c0, c0, 5 @ read MPIDR |
| 488 | and r0, r0, #0xc0000000 @ multiprocessing extensions and | 488 | and r0, r0, #0xc0000000 @ multiprocessing extensions and |
| 489 | teq r0, #0x80000000 @ not part of a uniprocessor system? | 489 | teq r0, #0x80000000 @ not part of a uniprocessor system? |
| 490 | moveq pc, lr @ yes, assume SMP | 490 | bne __fixup_smp_on_up @ no, assume UP |
| 491 | |||
| 492 | @ Core indicates it is SMP. Check for Aegis SOC where a single | ||
| 493 | @ Cortex-A9 CPU is present but SMP operations fault. | ||
| 494 | mov r4, #0x41000000 | ||
| 495 | orr r4, r4, #0x0000c000 | ||
| 496 | orr r4, r4, #0x00000090 | ||
| 497 | teq r3, r4 @ Check for ARM Cortex-A9 | ||
| 498 | movne pc, lr @ Not ARM Cortex-A9, | ||
| 499 | |||
| 500 | @ If a future SoC *does* use 0x0 as the PERIPH_BASE, then the | ||
| 501 | @ below address check will need to be #ifdef'd or equivalent | ||
| 502 | @ for the Aegis platform. | ||
| 503 | mrc p15, 4, r0, c15, c0 @ get SCU base address | ||
| 504 | teq r0, #0x0 @ '0' on actual UP A9 hardware | ||
| 505 | beq __fixup_smp_on_up @ So its an A9 UP | ||
| 506 | ldr r0, [r0, #4] @ read SCU Config | ||
| 507 | and r0, r0, #0x3 @ number of CPUs | ||
| 508 | teq r0, #0x0 @ is 1? | ||
| 509 | movne pc, lr | ||
| 491 | 510 | ||
| 492 | __fixup_smp_on_up: | 511 | __fixup_smp_on_up: |
| 493 | adr r0, 1f | 512 | adr r0, 1f |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 39c78387ddec..87162e1b94a5 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
| @@ -129,6 +129,24 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") | |||
| 129 | .restart = omap3xxx_restart, | 129 | .restart = omap3xxx_restart, |
| 130 | MACHINE_END | 130 | MACHINE_END |
| 131 | 131 | ||
| 132 | static const char *omap36xx_boards_compat[] __initdata = { | ||
| 133 | "ti,omap36xx", | ||
| 134 | NULL, | ||
| 135 | }; | ||
| 136 | |||
| 137 | DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)") | ||
| 138 | .reserve = omap_reserve, | ||
| 139 | .map_io = omap3_map_io, | ||
| 140 | .init_early = omap3630_init_early, | ||
| 141 | .init_irq = omap_intc_of_init, | ||
| 142 | .handle_irq = omap3_intc_handle_irq, | ||
| 143 | .init_machine = omap_generic_init, | ||
| 144 | .init_late = omap3_init_late, | ||
| 145 | .init_time = omap3_sync32k_timer_init, | ||
| 146 | .dt_compat = omap36xx_boards_compat, | ||
| 147 | .restart = omap3xxx_restart, | ||
| 148 | MACHINE_END | ||
| 149 | |||
| 132 | static const char *omap3_gp_boards_compat[] __initdata = { | 150 | static const char *omap3_gp_boards_compat[] __initdata = { |
| 133 | "ti,omap3-beagle", | 151 | "ti,omap3-beagle", |
| 134 | "timll,omap3-devkit8000", | 152 | "timll,omap3-devkit8000", |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index c3270c0f1fce..f6fe388af989 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
| @@ -167,38 +167,47 @@ static struct lp55xx_led_config rx51_lp5523_led_config[] = { | |||
| 167 | .name = "lp5523:kb1", | 167 | .name = "lp5523:kb1", |
| 168 | .chan_nr = 0, | 168 | .chan_nr = 0, |
| 169 | .led_current = 50, | 169 | .led_current = 50, |
| 170 | .max_current = 100, | ||
| 170 | }, { | 171 | }, { |
| 171 | .name = "lp5523:kb2", | 172 | .name = "lp5523:kb2", |
| 172 | .chan_nr = 1, | 173 | .chan_nr = 1, |
| 173 | .led_current = 50, | 174 | .led_current = 50, |
| 175 | .max_current = 100, | ||
| 174 | }, { | 176 | }, { |
| 175 | .name = "lp5523:kb3", | 177 | .name = "lp5523:kb3", |
| 176 | .chan_nr = 2, | 178 | .chan_nr = 2, |
| 177 | .led_current = 50, | 179 | .led_current = 50, |
| 180 | .max_current = 100, | ||
| 178 | }, { | 181 | }, { |
| 179 | .name = "lp5523:kb4", | 182 | .name = "lp5523:kb4", |
| 180 | .chan_nr = 3, | 183 | .chan_nr = 3, |
| 181 | .led_current = 50, | 184 | .led_current = 50, |
| 185 | .max_current = 100, | ||
| 182 | }, { | 186 | }, { |
| 183 | .name = "lp5523:b", | 187 | .name = "lp5523:b", |
| 184 | .chan_nr = 4, | 188 | .chan_nr = 4, |
| 185 | .led_current = 50, | 189 | .led_current = 50, |
| 190 | .max_current = 100, | ||
| 186 | }, { | 191 | }, { |
| 187 | .name = "lp5523:g", | 192 | .name = "lp5523:g", |
| 188 | .chan_nr = 5, | 193 | .chan_nr = 5, |
| 189 | .led_current = 50, | 194 | .led_current = 50, |
| 195 | .max_current = 100, | ||
| 190 | }, { | 196 | }, { |
| 191 | .name = "lp5523:r", | 197 | .name = "lp5523:r", |
| 192 | .chan_nr = 6, | 198 | .chan_nr = 6, |
| 193 | .led_current = 50, | 199 | .led_current = 50, |
| 200 | .max_current = 100, | ||
| 194 | }, { | 201 | }, { |
| 195 | .name = "lp5523:kb5", | 202 | .name = "lp5523:kb5", |
| 196 | .chan_nr = 7, | 203 | .chan_nr = 7, |
| 197 | .led_current = 50, | 204 | .led_current = 50, |
| 205 | .max_current = 100, | ||
| 198 | }, { | 206 | }, { |
| 199 | .name = "lp5523:kb6", | 207 | .name = "lp5523:kb6", |
| 200 | .chan_nr = 8, | 208 | .chan_nr = 8, |
| 201 | .led_current = 50, | 209 | .led_current = 50, |
| 210 | .max_current = 100, | ||
| 202 | } | 211 | } |
| 203 | }; | 212 | }; |
| 204 | 213 | ||
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c index 64b5a8346982..8b6876c98ce1 100644 --- a/arch/arm/mach-omap2/gpmc-onenand.c +++ b/arch/arm/mach-omap2/gpmc-onenand.c | |||
| @@ -272,9 +272,19 @@ static int omap2_onenand_setup_async(void __iomem *onenand_base) | |||
| 272 | struct gpmc_timings t; | 272 | struct gpmc_timings t; |
| 273 | int ret; | 273 | int ret; |
| 274 | 274 | ||
| 275 | if (gpmc_onenand_data->of_node) | 275 | if (gpmc_onenand_data->of_node) { |
| 276 | gpmc_read_settings_dt(gpmc_onenand_data->of_node, | 276 | gpmc_read_settings_dt(gpmc_onenand_data->of_node, |
| 277 | &onenand_async); | 277 | &onenand_async); |
| 278 | if (onenand_async.sync_read || onenand_async.sync_write) { | ||
| 279 | if (onenand_async.sync_write) | ||
| 280 | gpmc_onenand_data->flags |= | ||
| 281 | ONENAND_SYNC_READWRITE; | ||
| 282 | else | ||
| 283 | gpmc_onenand_data->flags |= ONENAND_SYNC_READ; | ||
| 284 | onenand_async.sync_read = false; | ||
| 285 | onenand_async.sync_write = false; | ||
| 286 | } | ||
| 287 | } | ||
| 278 | 288 | ||
| 279 | omap2_onenand_set_async_mode(onenand_base); | 289 | omap2_onenand_set_async_mode(onenand_base); |
| 280 | 290 | ||
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h index 5d2080ef7923..16f78a990d04 100644 --- a/arch/arm/mach-omap2/mux.h +++ b/arch/arm/mach-omap2/mux.h | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | #define OMAP_PULL_UP (1 << 4) | 28 | #define OMAP_PULL_UP (1 << 4) |
| 29 | #define OMAP_ALTELECTRICALSEL (1 << 5) | 29 | #define OMAP_ALTELECTRICALSEL (1 << 5) |
| 30 | 30 | ||
| 31 | /* 34xx specific mux bit defines */ | 31 | /* omap3/4/5 specific mux bit defines */ |
| 32 | #define OMAP_INPUT_EN (1 << 8) | 32 | #define OMAP_INPUT_EN (1 << 8) |
| 33 | #define OMAP_OFF_EN (1 << 9) | 33 | #define OMAP_OFF_EN (1 << 9) |
| 34 | #define OMAP_OFFOUT_EN (1 << 10) | 34 | #define OMAP_OFFOUT_EN (1 << 10) |
| @@ -36,8 +36,6 @@ | |||
| 36 | #define OMAP_OFF_PULL_EN (1 << 12) | 36 | #define OMAP_OFF_PULL_EN (1 << 12) |
| 37 | #define OMAP_OFF_PULL_UP (1 << 13) | 37 | #define OMAP_OFF_PULL_UP (1 << 13) |
| 38 | #define OMAP_WAKEUP_EN (1 << 14) | 38 | #define OMAP_WAKEUP_EN (1 << 14) |
| 39 | |||
| 40 | /* 44xx specific mux bit defines */ | ||
| 41 | #define OMAP_WAKEUP_EVENT (1 << 15) | 39 | #define OMAP_WAKEUP_EVENT (1 << 15) |
| 42 | 40 | ||
| 43 | /* Active pin states */ | 41 | /* Active pin states */ |
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index fa74a0625da1..ead48fa5715e 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
| @@ -628,7 +628,7 @@ void __init omap4_local_timer_init(void) | |||
| 628 | #endif /* CONFIG_HAVE_ARM_TWD */ | 628 | #endif /* CONFIG_HAVE_ARM_TWD */ |
| 629 | #endif /* CONFIG_ARCH_OMAP4 */ | 629 | #endif /* CONFIG_ARCH_OMAP4 */ |
| 630 | 630 | ||
| 631 | #ifdef CONFIG_SOC_OMAP5 | 631 | #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX) |
| 632 | void __init omap5_realtime_timer_init(void) | 632 | void __init omap5_realtime_timer_init(void) |
| 633 | { | 633 | { |
| 634 | omap4_sync32k_timer_init(); | 634 | omap4_sync32k_timer_init(); |
| @@ -636,7 +636,7 @@ void __init omap5_realtime_timer_init(void) | |||
| 636 | 636 | ||
| 637 | clocksource_of_init(); | 637 | clocksource_of_init(); |
| 638 | } | 638 | } |
| 639 | #endif /* CONFIG_SOC_OMAP5 */ | 639 | #endif /* CONFIG_SOC_OMAP5 || CONFIG_SOC_DRA7XX */ |
| 640 | 640 | ||
| 641 | /** | 641 | /** |
| 642 | * omap_timer_init - build and register timer device with an | 642 | * omap_timer_init - build and register timer device with an |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index f5e1a8471714..1272ed202dde 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
| @@ -1232,7 +1232,8 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size) | |||
| 1232 | break; | 1232 | break; |
| 1233 | 1233 | ||
| 1234 | len = (j - i) << PAGE_SHIFT; | 1234 | len = (j - i) << PAGE_SHIFT; |
| 1235 | ret = iommu_map(mapping->domain, iova, phys, len, 0); | 1235 | ret = iommu_map(mapping->domain, iova, phys, len, |
| 1236 | IOMMU_READ|IOMMU_WRITE); | ||
| 1236 | if (ret < 0) | 1237 | if (ret < 0) |
| 1237 | goto fail; | 1238 | goto fail; |
| 1238 | iova += len; | 1239 | iova += len; |
| @@ -1431,6 +1432,27 @@ static int arm_iommu_get_sgtable(struct device *dev, struct sg_table *sgt, | |||
| 1431 | GFP_KERNEL); | 1432 | GFP_KERNEL); |
| 1432 | } | 1433 | } |
| 1433 | 1434 | ||
| 1435 | static int __dma_direction_to_prot(enum dma_data_direction dir) | ||
| 1436 | { | ||
| 1437 | int prot; | ||
| 1438 | |||
| 1439 | switch (dir) { | ||
| 1440 | case DMA_BIDIRECTIONAL: | ||
| 1441 | prot = IOMMU_READ | IOMMU_WRITE; | ||
| 1442 | break; | ||
| 1443 | case DMA_TO_DEVICE: | ||
| 1444 | prot = IOMMU_READ; | ||
| 1445 | break; | ||
| 1446 | case DMA_FROM_DEVICE: | ||
| 1447 | prot = IOMMU_WRITE; | ||
| 1448 | break; | ||
| 1449 | default: | ||
| 1450 | prot = 0; | ||
| 1451 | } | ||
| 1452 | |||
| 1453 | return prot; | ||
| 1454 | } | ||
| 1455 | |||
| 1434 | /* | 1456 | /* |
| 1435 | * Map a part of the scatter-gather list into contiguous io address space | 1457 | * Map a part of the scatter-gather list into contiguous io address space |
| 1436 | */ | 1458 | */ |
| @@ -1444,6 +1466,7 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg, | |||
| 1444 | int ret = 0; | 1466 | int ret = 0; |
| 1445 | unsigned int count; | 1467 | unsigned int count; |
| 1446 | struct scatterlist *s; | 1468 | struct scatterlist *s; |
| 1469 | int prot; | ||
| 1447 | 1470 | ||
| 1448 | size = PAGE_ALIGN(size); | 1471 | size = PAGE_ALIGN(size); |
| 1449 | *handle = DMA_ERROR_CODE; | 1472 | *handle = DMA_ERROR_CODE; |
| @@ -1460,7 +1483,9 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg, | |||
| 1460 | !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) | 1483 | !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) |
| 1461 | __dma_page_cpu_to_dev(sg_page(s), s->offset, s->length, dir); | 1484 | __dma_page_cpu_to_dev(sg_page(s), s->offset, s->length, dir); |
| 1462 | 1485 | ||
| 1463 | ret = iommu_map(mapping->domain, iova, phys, len, 0); | 1486 | prot = __dma_direction_to_prot(dir); |
| 1487 | |||
| 1488 | ret = iommu_map(mapping->domain, iova, phys, len, prot); | ||
| 1464 | if (ret < 0) | 1489 | if (ret < 0) |
| 1465 | goto fail; | 1490 | goto fail; |
| 1466 | count += len >> PAGE_SHIFT; | 1491 | count += len >> PAGE_SHIFT; |
| @@ -1665,19 +1690,7 @@ static dma_addr_t arm_coherent_iommu_map_page(struct device *dev, struct page *p | |||
| 1665 | if (dma_addr == DMA_ERROR_CODE) | 1690 | if (dma_addr == DMA_ERROR_CODE) |
| 1666 | return dma_addr; | 1691 | return dma_addr; |
| 1667 | 1692 | ||
| 1668 | switch (dir) { | 1693 | prot = __dma_direction_to_prot(dir); |
| 1669 | case DMA_BIDIRECTIONAL: | ||
| 1670 | prot = IOMMU_READ | IOMMU_WRITE; | ||
| 1671 | break; | ||
| 1672 | case DMA_TO_DEVICE: | ||
| 1673 | prot = IOMMU_READ; | ||
| 1674 | break; | ||
| 1675 | case DMA_FROM_DEVICE: | ||
| 1676 | prot = IOMMU_WRITE; | ||
| 1677 | break; | ||
| 1678 | default: | ||
| 1679 | prot = 0; | ||
| 1680 | } | ||
| 1681 | 1694 | ||
| 1682 | ret = iommu_map(mapping->domain, dma_addr, page_to_phys(page), len, prot); | 1695 | ret = iommu_map(mapping->domain, dma_addr, page_to_phys(page), len, prot); |
| 1683 | if (ret < 0) | 1696 | if (ret < 0) |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index febaee7ca57b..18ec4c504abf 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/nodemask.h> | 17 | #include <linux/nodemask.h> |
| 18 | #include <linux/initrd.h> | 18 | #include <linux/initrd.h> |
| 19 | #include <linux/of_fdt.h> | 19 | #include <linux/of_fdt.h> |
| 20 | #include <linux/of_reserved_mem.h> | ||
| 21 | #include <linux/highmem.h> | 20 | #include <linux/highmem.h> |
| 22 | #include <linux/gfp.h> | 21 | #include <linux/gfp.h> |
| 23 | #include <linux/memblock.h> | 22 | #include <linux/memblock.h> |
| @@ -379,8 +378,6 @@ void __init arm_memblock_init(struct meminfo *mi, | |||
| 379 | if (mdesc->reserve) | 378 | if (mdesc->reserve) |
| 380 | mdesc->reserve(); | 379 | mdesc->reserve(); |
| 381 | 380 | ||
| 382 | early_init_dt_scan_reserved_mem(); | ||
| 383 | |||
| 384 | /* | 381 | /* |
| 385 | * reserve memory for DMA contigouos allocations, | 382 | * reserve memory for DMA contigouos allocations, |
| 386 | * must come from DMA area inside low memory | 383 | * must come from DMA area inside low memory |
diff --git a/arch/mips/include/asm/jump_label.h b/arch/mips/include/asm/jump_label.h index 4d6d77ed9b9d..e194f957ca8c 100644 --- a/arch/mips/include/asm/jump_label.h +++ b/arch/mips/include/asm/jump_label.h | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | static __always_inline bool arch_static_branch(struct static_key *key) | 23 | static __always_inline bool arch_static_branch(struct static_key *key) |
| 24 | { | 24 | { |
| 25 | asm goto("1:\tnop\n\t" | 25 | asm_volatile_goto("1:\tnop\n\t" |
| 26 | "nop\n\t" | 26 | "nop\n\t" |
| 27 | ".pushsection __jump_table, \"aw\"\n\t" | 27 | ".pushsection __jump_table, \"aw\"\n\t" |
| 28 | WORD_INSN " 1b, %l[l_yes], %0\n\t" | 28 | WORD_INSN " 1b, %l[l_yes], %0\n\t" |
diff --git a/arch/mips/kernel/octeon_switch.S b/arch/mips/kernel/octeon_switch.S index 4204d76af854..029e002a4ea0 100644 --- a/arch/mips/kernel/octeon_switch.S +++ b/arch/mips/kernel/octeon_switch.S | |||
| @@ -73,7 +73,7 @@ | |||
| 73 | 3: | 73 | 3: |
| 74 | 74 | ||
| 75 | #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) | 75 | #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) |
| 76 | PTR_L t8, __stack_chk_guard | 76 | PTR_LA t8, __stack_chk_guard |
| 77 | LONG_L t9, TASK_STACK_CANARY(a1) | 77 | LONG_L t9, TASK_STACK_CANARY(a1) |
| 78 | LONG_S t9, 0(t8) | 78 | LONG_S t9, 0(t8) |
| 79 | #endif | 79 | #endif |
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S index 38af83f84c4a..20b7b040e76f 100644 --- a/arch/mips/kernel/r2300_switch.S +++ b/arch/mips/kernel/r2300_switch.S | |||
| @@ -67,7 +67,7 @@ LEAF(resume) | |||
| 67 | 1: | 67 | 1: |
| 68 | 68 | ||
| 69 | #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) | 69 | #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) |
| 70 | PTR_L t8, __stack_chk_guard | 70 | PTR_LA t8, __stack_chk_guard |
| 71 | LONG_L t9, TASK_STACK_CANARY(a1) | 71 | LONG_L t9, TASK_STACK_CANARY(a1) |
| 72 | LONG_S t9, 0(t8) | 72 | LONG_S t9, 0(t8) |
| 73 | #endif | 73 | #endif |
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S index 921238a6bd26..078de5eaca8f 100644 --- a/arch/mips/kernel/r4k_switch.S +++ b/arch/mips/kernel/r4k_switch.S | |||
| @@ -69,7 +69,7 @@ | |||
| 69 | 1: | 69 | 1: |
| 70 | 70 | ||
| 71 | #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) | 71 | #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) |
| 72 | PTR_L t8, __stack_chk_guard | 72 | PTR_LA t8, __stack_chk_guard |
| 73 | LONG_L t9, TASK_STACK_CANARY(a1) | 73 | LONG_L t9, TASK_STACK_CANARY(a1) |
| 74 | LONG_S t9, 0(t8) | 74 | LONG_S t9, 0(t8) |
| 75 | #endif | 75 | #endif |
diff --git a/arch/parisc/include/asm/traps.h b/arch/parisc/include/asm/traps.h index 1945f995f2df..4736020ba5ea 100644 --- a/arch/parisc/include/asm/traps.h +++ b/arch/parisc/include/asm/traps.h | |||
| @@ -6,7 +6,7 @@ struct pt_regs; | |||
| 6 | 6 | ||
| 7 | /* traps.c */ | 7 | /* traps.c */ |
| 8 | void parisc_terminate(char *msg, struct pt_regs *regs, | 8 | void parisc_terminate(char *msg, struct pt_regs *regs, |
| 9 | int code, unsigned long offset); | 9 | int code, unsigned long offset) __noreturn __cold; |
| 10 | 10 | ||
| 11 | /* mm/fault.c */ | 11 | /* mm/fault.c */ |
| 12 | void do_page_fault(struct pt_regs *regs, unsigned long code, | 12 | void do_page_fault(struct pt_regs *regs, unsigned long code, |
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index c035673209f7..b521c0adf4ec 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c | |||
| @@ -602,6 +602,7 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long | |||
| 602 | __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn)); | 602 | __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn)); |
| 603 | } | 603 | } |
| 604 | } | 604 | } |
| 605 | EXPORT_SYMBOL_GPL(flush_cache_page); | ||
| 605 | 606 | ||
| 606 | #ifdef CONFIG_PARISC_TMPALIAS | 607 | #ifdef CONFIG_PARISC_TMPALIAS |
| 607 | 608 | ||
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 8a252f2d6c08..2b96602e812f 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c | |||
| @@ -72,7 +72,6 @@ enum ipi_message_type { | |||
| 72 | IPI_NOP=0, | 72 | IPI_NOP=0, |
| 73 | IPI_RESCHEDULE=1, | 73 | IPI_RESCHEDULE=1, |
| 74 | IPI_CALL_FUNC, | 74 | IPI_CALL_FUNC, |
| 75 | IPI_CALL_FUNC_SINGLE, | ||
| 76 | IPI_CPU_START, | 75 | IPI_CPU_START, |
| 77 | IPI_CPU_STOP, | 76 | IPI_CPU_STOP, |
| 78 | IPI_CPU_TEST | 77 | IPI_CPU_TEST |
| @@ -164,11 +163,6 @@ ipi_interrupt(int irq, void *dev_id) | |||
| 164 | generic_smp_call_function_interrupt(); | 163 | generic_smp_call_function_interrupt(); |
| 165 | break; | 164 | break; |
| 166 | 165 | ||
| 167 | case IPI_CALL_FUNC_SINGLE: | ||
| 168 | smp_debug(100, KERN_DEBUG "CPU%d IPI_CALL_FUNC_SINGLE\n", this_cpu); | ||
| 169 | generic_smp_call_function_single_interrupt(); | ||
| 170 | break; | ||
| 171 | |||
| 172 | case IPI_CPU_START: | 166 | case IPI_CPU_START: |
| 173 | smp_debug(100, KERN_DEBUG "CPU%d IPI_CPU_START\n", this_cpu); | 167 | smp_debug(100, KERN_DEBUG "CPU%d IPI_CPU_START\n", this_cpu); |
| 174 | break; | 168 | break; |
| @@ -260,7 +254,7 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask) | |||
| 260 | 254 | ||
| 261 | void arch_send_call_function_single_ipi(int cpu) | 255 | void arch_send_call_function_single_ipi(int cpu) |
| 262 | { | 256 | { |
| 263 | send_IPI_single(cpu, IPI_CALL_FUNC_SINGLE); | 257 | send_IPI_single(cpu, IPI_CALL_FUNC); |
| 264 | } | 258 | } |
| 265 | 259 | ||
| 266 | /* | 260 | /* |
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 04e47c6a4562..1cd1d0c83b6d 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c | |||
| @@ -291,11 +291,6 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err) | |||
| 291 | do_exit(SIGSEGV); | 291 | do_exit(SIGSEGV); |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | int syscall_ipi(int (*syscall) (struct pt_regs *), struct pt_regs *regs) | ||
| 295 | { | ||
| 296 | return syscall(regs); | ||
| 297 | } | ||
| 298 | |||
| 299 | /* gdb uses break 4,8 */ | 294 | /* gdb uses break 4,8 */ |
| 300 | #define GDB_BREAK_INSN 0x10004 | 295 | #define GDB_BREAK_INSN 0x10004 |
| 301 | static void handle_gdb_break(struct pt_regs *regs, int wot) | 296 | static void handle_gdb_break(struct pt_regs *regs, int wot) |
| @@ -805,14 +800,14 @@ void notrace handle_interruption(int code, struct pt_regs *regs) | |||
| 805 | else { | 800 | else { |
| 806 | 801 | ||
| 807 | /* | 802 | /* |
| 808 | * The kernel should never fault on its own address space. | 803 | * The kernel should never fault on its own address space, |
| 804 | * unless pagefault_disable() was called before. | ||
| 809 | */ | 805 | */ |
| 810 | 806 | ||
| 811 | if (fault_space == 0) | 807 | if (fault_space == 0 && !in_atomic()) |
| 812 | { | 808 | { |
| 813 | pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC); | 809 | pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC); |
| 814 | parisc_terminate("Kernel Fault", regs, code, fault_address); | 810 | parisc_terminate("Kernel Fault", regs, code, fault_address); |
| 815 | |||
| 816 | } | 811 | } |
| 817 | } | 812 | } |
| 818 | 813 | ||
diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c index ac4370b1ca40..b5507ec06b84 100644 --- a/arch/parisc/lib/memcpy.c +++ b/arch/parisc/lib/memcpy.c | |||
| @@ -56,7 +56,7 @@ | |||
| 56 | #ifdef __KERNEL__ | 56 | #ifdef __KERNEL__ |
| 57 | #include <linux/module.h> | 57 | #include <linux/module.h> |
| 58 | #include <linux/compiler.h> | 58 | #include <linux/compiler.h> |
| 59 | #include <asm/uaccess.h> | 59 | #include <linux/uaccess.h> |
| 60 | #define s_space "%%sr1" | 60 | #define s_space "%%sr1" |
| 61 | #define d_space "%%sr2" | 61 | #define d_space "%%sr2" |
| 62 | #else | 62 | #else |
| @@ -524,4 +524,17 @@ EXPORT_SYMBOL(copy_to_user); | |||
| 524 | EXPORT_SYMBOL(copy_from_user); | 524 | EXPORT_SYMBOL(copy_from_user); |
| 525 | EXPORT_SYMBOL(copy_in_user); | 525 | EXPORT_SYMBOL(copy_in_user); |
| 526 | EXPORT_SYMBOL(memcpy); | 526 | EXPORT_SYMBOL(memcpy); |
| 527 | |||
| 528 | long probe_kernel_read(void *dst, const void *src, size_t size) | ||
| 529 | { | ||
| 530 | unsigned long addr = (unsigned long)src; | ||
| 531 | |||
| 532 | if (size < 0 || addr < PAGE_SIZE) | ||
| 533 | return -EFAULT; | ||
| 534 | |||
| 535 | /* check for I/O space F_EXTEND(0xfff00000) access as well? */ | ||
| 536 | |||
| 537 | return __probe_kernel_read(dst, src, size); | ||
| 538 | } | ||
| 539 | |||
| 527 | #endif | 540 | #endif |
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index 00c0ed333a3d..0293588d5b8c 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c | |||
| @@ -171,20 +171,25 @@ void do_page_fault(struct pt_regs *regs, unsigned long code, | |||
| 171 | unsigned long address) | 171 | unsigned long address) |
| 172 | { | 172 | { |
| 173 | struct vm_area_struct *vma, *prev_vma; | 173 | struct vm_area_struct *vma, *prev_vma; |
| 174 | struct task_struct *tsk = current; | 174 | struct task_struct *tsk; |
| 175 | struct mm_struct *mm = tsk->mm; | 175 | struct mm_struct *mm; |
| 176 | unsigned long acc_type; | 176 | unsigned long acc_type; |
| 177 | int fault; | 177 | int fault; |
| 178 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; | 178 | unsigned int flags; |
| 179 | 179 | ||
| 180 | if (in_atomic() || !mm) | 180 | if (in_atomic()) |
| 181 | goto no_context; | 181 | goto no_context; |
| 182 | 182 | ||
| 183 | tsk = current; | ||
| 184 | mm = tsk->mm; | ||
| 185 | if (!mm) | ||
| 186 | goto no_context; | ||
| 187 | |||
| 188 | flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; | ||
| 183 | if (user_mode(regs)) | 189 | if (user_mode(regs)) |
| 184 | flags |= FAULT_FLAG_USER; | 190 | flags |= FAULT_FLAG_USER; |
| 185 | 191 | ||
| 186 | acc_type = parisc_acctyp(code, regs->iir); | 192 | acc_type = parisc_acctyp(code, regs->iir); |
| 187 | |||
| 188 | if (acc_type & VM_WRITE) | 193 | if (acc_type & VM_WRITE) |
| 189 | flags |= FAULT_FLAG_WRITE; | 194 | flags |= FAULT_FLAG_WRITE; |
| 190 | retry: | 195 | retry: |
diff --git a/arch/powerpc/include/asm/jump_label.h b/arch/powerpc/include/asm/jump_label.h index ae098c438f00..f016bb699b5f 100644 --- a/arch/powerpc/include/asm/jump_label.h +++ b/arch/powerpc/include/asm/jump_label.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | static __always_inline bool arch_static_branch(struct static_key *key) | 20 | static __always_inline bool arch_static_branch(struct static_key *key) |
| 21 | { | 21 | { |
| 22 | asm goto("1:\n\t" | 22 | asm_volatile_goto("1:\n\t" |
| 23 | "nop\n\t" | 23 | "nop\n\t" |
| 24 | ".pushsection __jump_table, \"aw\"\n\t" | 24 | ".pushsection __jump_table, \"aw\"\n\t" |
| 25 | JUMP_ENTRY_TYPE "1b, %l[l_yes], %c0\n\t" | 25 | JUMP_ENTRY_TYPE "1b, %l[l_yes], %c0\n\t" |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 57d286a78f86..c7cb8c232d2f 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
| @@ -495,14 +495,15 @@ void __do_irq(struct pt_regs *regs) | |||
| 495 | void do_IRQ(struct pt_regs *regs) | 495 | void do_IRQ(struct pt_regs *regs) |
| 496 | { | 496 | { |
| 497 | struct pt_regs *old_regs = set_irq_regs(regs); | 497 | struct pt_regs *old_regs = set_irq_regs(regs); |
| 498 | struct thread_info *curtp, *irqtp; | 498 | struct thread_info *curtp, *irqtp, *sirqtp; |
| 499 | 499 | ||
| 500 | /* Switch to the irq stack to handle this */ | 500 | /* Switch to the irq stack to handle this */ |
| 501 | curtp = current_thread_info(); | 501 | curtp = current_thread_info(); |
| 502 | irqtp = hardirq_ctx[raw_smp_processor_id()]; | 502 | irqtp = hardirq_ctx[raw_smp_processor_id()]; |
| 503 | sirqtp = softirq_ctx[raw_smp_processor_id()]; | ||
| 503 | 504 | ||
| 504 | /* Already there ? */ | 505 | /* Already there ? */ |
| 505 | if (unlikely(curtp == irqtp)) { | 506 | if (unlikely(curtp == irqtp || curtp == sirqtp)) { |
| 506 | __do_irq(regs); | 507 | __do_irq(regs); |
| 507 | set_irq_regs(old_regs); | 508 | set_irq_regs(old_regs); |
| 508 | return; | 509 | return; |
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index 294b7af28cdd..c71103b8a748 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S | |||
| @@ -1066,7 +1066,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206) | |||
| 1066 | BEGIN_FTR_SECTION | 1066 | BEGIN_FTR_SECTION |
| 1067 | mfspr r8, SPRN_DSCR | 1067 | mfspr r8, SPRN_DSCR |
| 1068 | ld r7, HSTATE_DSCR(r13) | 1068 | ld r7, HSTATE_DSCR(r13) |
| 1069 | std r8, VCPU_DSCR(r7) | 1069 | std r8, VCPU_DSCR(r9) |
| 1070 | mtspr SPRN_DSCR, r7 | 1070 | mtspr SPRN_DSCR, r7 |
| 1071 | END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206) | 1071 | END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206) |
| 1072 | 1072 | ||
diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c index 1c6a9d729df4..c65593abae8e 100644 --- a/arch/powerpc/kvm/e500_mmu_host.c +++ b/arch/powerpc/kvm/e500_mmu_host.c | |||
| @@ -332,6 +332,13 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, | |||
| 332 | unsigned long hva; | 332 | unsigned long hva; |
| 333 | int pfnmap = 0; | 333 | int pfnmap = 0; |
| 334 | int tsize = BOOK3E_PAGESZ_4K; | 334 | int tsize = BOOK3E_PAGESZ_4K; |
| 335 | int ret = 0; | ||
| 336 | unsigned long mmu_seq; | ||
| 337 | struct kvm *kvm = vcpu_e500->vcpu.kvm; | ||
| 338 | |||
| 339 | /* used to check for invalidations in progress */ | ||
| 340 | mmu_seq = kvm->mmu_notifier_seq; | ||
| 341 | smp_rmb(); | ||
| 335 | 342 | ||
| 336 | /* | 343 | /* |
| 337 | * Translate guest physical to true physical, acquiring | 344 | * Translate guest physical to true physical, acquiring |
| @@ -449,6 +456,12 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, | |||
| 449 | gvaddr &= ~((tsize_pages << PAGE_SHIFT) - 1); | 456 | gvaddr &= ~((tsize_pages << PAGE_SHIFT) - 1); |
| 450 | } | 457 | } |
| 451 | 458 | ||
| 459 | spin_lock(&kvm->mmu_lock); | ||
| 460 | if (mmu_notifier_retry(kvm, mmu_seq)) { | ||
| 461 | ret = -EAGAIN; | ||
| 462 | goto out; | ||
| 463 | } | ||
| 464 | |||
| 452 | kvmppc_e500_ref_setup(ref, gtlbe, pfn); | 465 | kvmppc_e500_ref_setup(ref, gtlbe, pfn); |
| 453 | 466 | ||
| 454 | kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize, | 467 | kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize, |
| @@ -457,10 +470,13 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, | |||
| 457 | /* Clear i-cache for new pages */ | 470 | /* Clear i-cache for new pages */ |
| 458 | kvmppc_mmu_flush_icache(pfn); | 471 | kvmppc_mmu_flush_icache(pfn); |
| 459 | 472 | ||
| 473 | out: | ||
| 474 | spin_unlock(&kvm->mmu_lock); | ||
| 475 | |||
| 460 | /* Drop refcount on page, so that mmu notifiers can clear it */ | 476 | /* Drop refcount on page, so that mmu notifiers can clear it */ |
| 461 | kvm_release_pfn_clean(pfn); | 477 | kvm_release_pfn_clean(pfn); |
| 462 | 478 | ||
| 463 | return 0; | 479 | return ret; |
| 464 | } | 480 | } |
| 465 | 481 | ||
| 466 | /* XXX only map the one-one case, for now use TLB0 */ | 482 | /* XXX only map the one-one case, for now use TLB0 */ |
diff --git a/arch/s390/include/asm/jump_label.h b/arch/s390/include/asm/jump_label.h index 6c32190dc73e..346b1c85ffb4 100644 --- a/arch/s390/include/asm/jump_label.h +++ b/arch/s390/include/asm/jump_label.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | static __always_inline bool arch_static_branch(struct static_key *key) | 16 | static __always_inline bool arch_static_branch(struct static_key *key) |
| 17 | { | 17 | { |
| 18 | asm goto("0: brcl 0,0\n" | 18 | asm_volatile_goto("0: brcl 0,0\n" |
| 19 | ".pushsection __jump_table, \"aw\"\n" | 19 | ".pushsection __jump_table, \"aw\"\n" |
| 20 | ASM_ALIGN "\n" | 20 | ASM_ALIGN "\n" |
| 21 | ASM_PTR " 0b, %l[label], %0\n" | 21 | ASM_PTR " 0b, %l[label], %0\n" |
diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c index c84f33d51f7b..7dd21720e5b0 100644 --- a/arch/s390/kernel/crash_dump.c +++ b/arch/s390/kernel/crash_dump.c | |||
| @@ -40,28 +40,26 @@ static inline void *load_real_addr(void *addr) | |||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | /* | 42 | /* |
| 43 | * Copy up to one page to vmalloc or real memory | 43 | * Copy real to virtual or real memory |
| 44 | */ | 44 | */ |
| 45 | static ssize_t copy_page_real(void *buf, void *src, size_t csize) | 45 | static int copy_from_realmem(void *dest, void *src, size_t count) |
| 46 | { | 46 | { |
| 47 | size_t size; | 47 | unsigned long size; |
| 48 | int rc; | ||
| 48 | 49 | ||
| 49 | if (is_vmalloc_addr(buf)) { | 50 | if (!count) |
| 50 | BUG_ON(csize >= PAGE_SIZE); | 51 | return 0; |
| 51 | /* If buf is not page aligned, copy first part */ | 52 | if (!is_vmalloc_or_module_addr(dest)) |
| 52 | size = min(roundup(__pa(buf), PAGE_SIZE) - __pa(buf), csize); | 53 | return memcpy_real(dest, src, count); |
| 53 | if (size) { | 54 | do { |
| 54 | if (memcpy_real(load_real_addr(buf), src, size)) | 55 | size = min(count, PAGE_SIZE - (__pa(dest) & ~PAGE_MASK)); |
| 55 | return -EFAULT; | 56 | if (memcpy_real(load_real_addr(dest), src, size)) |
| 56 | buf += size; | 57 | return -EFAULT; |
| 57 | src += size; | 58 | count -= size; |
| 58 | } | 59 | dest += size; |
| 59 | /* Copy second part */ | 60 | src += size; |
| 60 | size = csize - size; | 61 | } while (count); |
| 61 | return (size) ? memcpy_real(load_real_addr(buf), src, size) : 0; | 62 | return 0; |
| 62 | } else { | ||
| 63 | return memcpy_real(buf, src, csize); | ||
| 64 | } | ||
| 65 | } | 63 | } |
| 66 | 64 | ||
| 67 | /* | 65 | /* |
| @@ -114,7 +112,7 @@ static ssize_t copy_oldmem_page_kdump(char *buf, size_t csize, | |||
| 114 | rc = copy_to_user_real((void __force __user *) buf, | 112 | rc = copy_to_user_real((void __force __user *) buf, |
| 115 | (void *) src, csize); | 113 | (void *) src, csize); |
| 116 | else | 114 | else |
| 117 | rc = copy_page_real(buf, (void *) src, csize); | 115 | rc = copy_from_realmem(buf, (void *) src, csize); |
| 118 | return (rc == 0) ? rc : csize; | 116 | return (rc == 0) ? rc : csize; |
| 119 | } | 117 | } |
| 120 | 118 | ||
| @@ -210,7 +208,7 @@ int copy_from_oldmem(void *dest, void *src, size_t count) | |||
| 210 | if (OLDMEM_BASE) { | 208 | if (OLDMEM_BASE) { |
| 211 | if ((unsigned long) src < OLDMEM_SIZE) { | 209 | if ((unsigned long) src < OLDMEM_SIZE) { |
| 212 | copied = min(count, OLDMEM_SIZE - (unsigned long) src); | 210 | copied = min(count, OLDMEM_SIZE - (unsigned long) src); |
| 213 | rc = memcpy_real(dest, src + OLDMEM_BASE, copied); | 211 | rc = copy_from_realmem(dest, src + OLDMEM_BASE, copied); |
| 214 | if (rc) | 212 | if (rc) |
| 215 | return rc; | 213 | return rc; |
| 216 | } | 214 | } |
| @@ -223,7 +221,7 @@ int copy_from_oldmem(void *dest, void *src, size_t count) | |||
| 223 | return rc; | 221 | return rc; |
| 224 | } | 222 | } |
| 225 | } | 223 | } |
| 226 | return memcpy_real(dest + copied, src + copied, count - copied); | 224 | return copy_from_realmem(dest + copied, src + copied, count - copied); |
| 227 | } | 225 | } |
| 228 | 226 | ||
| 229 | /* | 227 | /* |
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index cc30d1fb000c..0dc2b6d0a1ec 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S | |||
| @@ -266,6 +266,7 @@ sysc_sigpending: | |||
| 266 | tm __TI_flags+3(%r12),_TIF_SYSCALL | 266 | tm __TI_flags+3(%r12),_TIF_SYSCALL |
| 267 | jno sysc_return | 267 | jno sysc_return |
| 268 | lm %r2,%r7,__PT_R2(%r11) # load svc arguments | 268 | lm %r2,%r7,__PT_R2(%r11) # load svc arguments |
| 269 | l %r10,__TI_sysc_table(%r12) # 31 bit system call table | ||
| 269 | xr %r8,%r8 # svc 0 returns -ENOSYS | 270 | xr %r8,%r8 # svc 0 returns -ENOSYS |
| 270 | clc __PT_INT_CODE+2(2,%r11),BASED(.Lnr_syscalls+2) | 271 | clc __PT_INT_CODE+2(2,%r11),BASED(.Lnr_syscalls+2) |
| 271 | jnl sysc_nr_ok # invalid svc number -> do svc 0 | 272 | jnl sysc_nr_ok # invalid svc number -> do svc 0 |
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S index 2b2188b97c6a..e5b43c97a834 100644 --- a/arch/s390/kernel/entry64.S +++ b/arch/s390/kernel/entry64.S | |||
| @@ -297,6 +297,7 @@ sysc_sigpending: | |||
| 297 | tm __TI_flags+7(%r12),_TIF_SYSCALL | 297 | tm __TI_flags+7(%r12),_TIF_SYSCALL |
| 298 | jno sysc_return | 298 | jno sysc_return |
| 299 | lmg %r2,%r7,__PT_R2(%r11) # load svc arguments | 299 | lmg %r2,%r7,__PT_R2(%r11) # load svc arguments |
| 300 | lg %r10,__TI_sysc_table(%r12) # address of system call table | ||
| 300 | lghi %r8,0 # svc 0 returns -ENOSYS | 301 | lghi %r8,0 # svc 0 returns -ENOSYS |
| 301 | llgh %r1,__PT_INT_CODE+2(%r11) # load new svc number | 302 | llgh %r1,__PT_INT_CODE+2(%r11) # load new svc number |
| 302 | cghi %r1,NR_syscalls | 303 | cghi %r1,NR_syscalls |
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index 0ce9fb245034..d86e64eddb42 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c | |||
| @@ -67,6 +67,11 @@ static int __kprobes is_prohibited_opcode(kprobe_opcode_t *insn) | |||
| 67 | case 0xac: /* stnsm */ | 67 | case 0xac: /* stnsm */ |
| 68 | case 0xad: /* stosm */ | 68 | case 0xad: /* stosm */ |
| 69 | return -EINVAL; | 69 | return -EINVAL; |
| 70 | case 0xc6: | ||
| 71 | switch (insn[0] & 0x0f) { | ||
| 72 | case 0x00: /* exrl */ | ||
| 73 | return -EINVAL; | ||
| 74 | } | ||
| 70 | } | 75 | } |
| 71 | switch (insn[0]) { | 76 | switch (insn[0]) { |
| 72 | case 0x0101: /* pr */ | 77 | case 0x0101: /* pr */ |
| @@ -180,7 +185,6 @@ static int __kprobes is_insn_relative_long(kprobe_opcode_t *insn) | |||
| 180 | break; | 185 | break; |
| 181 | case 0xc6: | 186 | case 0xc6: |
| 182 | switch (insn[0] & 0x0f) { | 187 | switch (insn[0] & 0x0f) { |
| 183 | case 0x00: /* exrl */ | ||
| 184 | case 0x02: /* pfdrl */ | 188 | case 0x02: /* pfdrl */ |
| 185 | case 0x04: /* cghrl */ | 189 | case 0x04: /* cghrl */ |
| 186 | case 0x05: /* chrl */ | 190 | case 0x05: /* chrl */ |
diff --git a/arch/sparc/include/asm/jump_label.h b/arch/sparc/include/asm/jump_label.h index 5080d16a832f..ec2e2e2aba7d 100644 --- a/arch/sparc/include/asm/jump_label.h +++ b/arch/sparc/include/asm/jump_label.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | static __always_inline bool arch_static_branch(struct static_key *key) | 10 | static __always_inline bool arch_static_branch(struct static_key *key) |
| 11 | { | 11 | { |
| 12 | asm goto("1:\n\t" | 12 | asm_volatile_goto("1:\n\t" |
| 13 | "nop\n\t" | 13 | "nop\n\t" |
| 14 | "nop\n\t" | 14 | "nop\n\t" |
| 15 | ".pushsection __jump_table, \"aw\"\n\t" | 15 | ".pushsection __jump_table, \"aw\"\n\t" |
diff --git a/arch/tile/include/asm/atomic.h b/arch/tile/include/asm/atomic.h index d385eaadece7..709798460763 100644 --- a/arch/tile/include/asm/atomic.h +++ b/arch/tile/include/asm/atomic.h | |||
| @@ -166,7 +166,7 @@ static inline int atomic_cmpxchg(atomic_t *v, int o, int n) | |||
| 166 | * | 166 | * |
| 167 | * Atomically sets @v to @i and returns old @v | 167 | * Atomically sets @v to @i and returns old @v |
| 168 | */ | 168 | */ |
| 169 | static inline u64 atomic64_xchg(atomic64_t *v, u64 n) | 169 | static inline long long atomic64_xchg(atomic64_t *v, long long n) |
| 170 | { | 170 | { |
| 171 | return xchg64(&v->counter, n); | 171 | return xchg64(&v->counter, n); |
| 172 | } | 172 | } |
| @@ -180,7 +180,8 @@ static inline u64 atomic64_xchg(atomic64_t *v, u64 n) | |||
| 180 | * Atomically checks if @v holds @o and replaces it with @n if so. | 180 | * Atomically checks if @v holds @o and replaces it with @n if so. |
| 181 | * Returns the old value at @v. | 181 | * Returns the old value at @v. |
| 182 | */ | 182 | */ |
| 183 | static inline u64 atomic64_cmpxchg(atomic64_t *v, u64 o, u64 n) | 183 | static inline long long atomic64_cmpxchg(atomic64_t *v, long long o, |
| 184 | long long n) | ||
| 184 | { | 185 | { |
| 185 | return cmpxchg64(&v->counter, o, n); | 186 | return cmpxchg64(&v->counter, o, n); |
| 186 | } | 187 | } |
diff --git a/arch/tile/include/asm/atomic_32.h b/arch/tile/include/asm/atomic_32.h index 0d0395b1b152..1ad4a1f7d42b 100644 --- a/arch/tile/include/asm/atomic_32.h +++ b/arch/tile/include/asm/atomic_32.h | |||
| @@ -80,7 +80,7 @@ static inline void atomic_set(atomic_t *v, int n) | |||
| 80 | /* A 64bit atomic type */ | 80 | /* A 64bit atomic type */ |
| 81 | 81 | ||
| 82 | typedef struct { | 82 | typedef struct { |
| 83 | u64 __aligned(8) counter; | 83 | long long counter; |
| 84 | } atomic64_t; | 84 | } atomic64_t; |
| 85 | 85 | ||
| 86 | #define ATOMIC64_INIT(val) { (val) } | 86 | #define ATOMIC64_INIT(val) { (val) } |
| @@ -91,14 +91,14 @@ typedef struct { | |||
| 91 | * | 91 | * |
| 92 | * Atomically reads the value of @v. | 92 | * Atomically reads the value of @v. |
| 93 | */ | 93 | */ |
| 94 | static inline u64 atomic64_read(const atomic64_t *v) | 94 | static inline long long atomic64_read(const atomic64_t *v) |
| 95 | { | 95 | { |
| 96 | /* | 96 | /* |
| 97 | * Requires an atomic op to read both 32-bit parts consistently. | 97 | * Requires an atomic op to read both 32-bit parts consistently. |
| 98 | * Casting away const is safe since the atomic support routines | 98 | * Casting away const is safe since the atomic support routines |
| 99 | * do not write to memory if the value has not been modified. | 99 | * do not write to memory if the value has not been modified. |
| 100 | */ | 100 | */ |
| 101 | return _atomic64_xchg_add((u64 *)&v->counter, 0); | 101 | return _atomic64_xchg_add((long long *)&v->counter, 0); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | /** | 104 | /** |
| @@ -108,7 +108,7 @@ static inline u64 atomic64_read(const atomic64_t *v) | |||
| 108 | * | 108 | * |
| 109 | * Atomically adds @i to @v. | 109 | * Atomically adds @i to @v. |
| 110 | */ | 110 | */ |
| 111 | static inline void atomic64_add(u64 i, atomic64_t *v) | 111 | static inline void atomic64_add(long long i, atomic64_t *v) |
| 112 | { | 112 | { |
| 113 | _atomic64_xchg_add(&v->counter, i); | 113 | _atomic64_xchg_add(&v->counter, i); |
| 114 | } | 114 | } |
| @@ -120,7 +120,7 @@ static inline void atomic64_add(u64 i, atomic64_t *v) | |||
| 120 | * | 120 | * |
| 121 | * Atomically adds @i to @v and returns @i + @v | 121 | * Atomically adds @i to @v and returns @i + @v |
| 122 | */ | 122 | */ |
| 123 | static inline u64 atomic64_add_return(u64 i, atomic64_t *v) | 123 | static inline long long atomic64_add_return(long long i, atomic64_t *v) |
| 124 | { | 124 | { |
| 125 | smp_mb(); /* barrier for proper semantics */ | 125 | smp_mb(); /* barrier for proper semantics */ |
| 126 | return _atomic64_xchg_add(&v->counter, i) + i; | 126 | return _atomic64_xchg_add(&v->counter, i) + i; |
| @@ -135,7 +135,8 @@ static inline u64 atomic64_add_return(u64 i, atomic64_t *v) | |||
| 135 | * Atomically adds @a to @v, so long as @v was not already @u. | 135 | * Atomically adds @a to @v, so long as @v was not already @u. |
| 136 | * Returns non-zero if @v was not @u, and zero otherwise. | 136 | * Returns non-zero if @v was not @u, and zero otherwise. |
| 137 | */ | 137 | */ |
| 138 | static inline u64 atomic64_add_unless(atomic64_t *v, u64 a, u64 u) | 138 | static inline long long atomic64_add_unless(atomic64_t *v, long long a, |
| 139 | long long u) | ||
| 139 | { | 140 | { |
| 140 | smp_mb(); /* barrier for proper semantics */ | 141 | smp_mb(); /* barrier for proper semantics */ |
| 141 | return _atomic64_xchg_add_unless(&v->counter, a, u) != u; | 142 | return _atomic64_xchg_add_unless(&v->counter, a, u) != u; |
| @@ -151,7 +152,7 @@ static inline u64 atomic64_add_unless(atomic64_t *v, u64 a, u64 u) | |||
| 151 | * atomic64_set() can't be just a raw store, since it would be lost if it | 152 | * atomic64_set() can't be just a raw store, since it would be lost if it |
| 152 | * fell between the load and store of one of the other atomic ops. | 153 | * fell between the load and store of one of the other atomic ops. |
| 153 | */ | 154 | */ |
| 154 | static inline void atomic64_set(atomic64_t *v, u64 n) | 155 | static inline void atomic64_set(atomic64_t *v, long long n) |
| 155 | { | 156 | { |
| 156 | _atomic64_xchg(&v->counter, n); | 157 | _atomic64_xchg(&v->counter, n); |
| 157 | } | 158 | } |
| @@ -236,11 +237,13 @@ extern struct __get_user __atomic_xchg_add_unless(volatile int *p, | |||
| 236 | extern struct __get_user __atomic_or(volatile int *p, int *lock, int n); | 237 | extern struct __get_user __atomic_or(volatile int *p, int *lock, int n); |
| 237 | extern struct __get_user __atomic_andn(volatile int *p, int *lock, int n); | 238 | extern struct __get_user __atomic_andn(volatile int *p, int *lock, int n); |
| 238 | extern struct __get_user __atomic_xor(volatile int *p, int *lock, int n); | 239 | extern struct __get_user __atomic_xor(volatile int *p, int *lock, int n); |
| 239 | extern u64 __atomic64_cmpxchg(volatile u64 *p, int *lock, u64 o, u64 n); | 240 | extern long long __atomic64_cmpxchg(volatile long long *p, int *lock, |
| 240 | extern u64 __atomic64_xchg(volatile u64 *p, int *lock, u64 n); | 241 | long long o, long long n); |
| 241 | extern u64 __atomic64_xchg_add(volatile u64 *p, int *lock, u64 n); | 242 | extern long long __atomic64_xchg(volatile long long *p, int *lock, long long n); |
| 242 | extern u64 __atomic64_xchg_add_unless(volatile u64 *p, | 243 | extern long long __atomic64_xchg_add(volatile long long *p, int *lock, |
| 243 | int *lock, u64 o, u64 n); | 244 | long long n); |
| 245 | extern long long __atomic64_xchg_add_unless(volatile long long *p, | ||
| 246 | int *lock, long long o, long long n); | ||
| 244 | 247 | ||
| 245 | /* Return failure from the atomic wrappers. */ | 248 | /* Return failure from the atomic wrappers. */ |
| 246 | struct __get_user __atomic_bad_address(int __user *addr); | 249 | struct __get_user __atomic_bad_address(int __user *addr); |
diff --git a/arch/tile/include/asm/cmpxchg.h b/arch/tile/include/asm/cmpxchg.h index 4001d5eab4bb..0ccda3c425be 100644 --- a/arch/tile/include/asm/cmpxchg.h +++ b/arch/tile/include/asm/cmpxchg.h | |||
| @@ -35,10 +35,10 @@ int _atomic_xchg(int *ptr, int n); | |||
| 35 | int _atomic_xchg_add(int *v, int i); | 35 | int _atomic_xchg_add(int *v, int i); |
| 36 | int _atomic_xchg_add_unless(int *v, int a, int u); | 36 | int _atomic_xchg_add_unless(int *v, int a, int u); |
| 37 | int _atomic_cmpxchg(int *ptr, int o, int n); | 37 | int _atomic_cmpxchg(int *ptr, int o, int n); |
| 38 | u64 _atomic64_xchg(u64 *v, u64 n); | 38 | long long _atomic64_xchg(long long *v, long long n); |
| 39 | u64 _atomic64_xchg_add(u64 *v, u64 i); | 39 | long long _atomic64_xchg_add(long long *v, long long i); |
| 40 | u64 _atomic64_xchg_add_unless(u64 *v, u64 a, u64 u); | 40 | long long _atomic64_xchg_add_unless(long long *v, long long a, long long u); |
| 41 | u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n); | 41 | long long _atomic64_cmpxchg(long long *v, long long o, long long n); |
| 42 | 42 | ||
| 43 | #define xchg(ptr, n) \ | 43 | #define xchg(ptr, n) \ |
| 44 | ({ \ | 44 | ({ \ |
| @@ -53,7 +53,8 @@ u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n); | |||
| 53 | if (sizeof(*(ptr)) != 4) \ | 53 | if (sizeof(*(ptr)) != 4) \ |
| 54 | __cmpxchg_called_with_bad_pointer(); \ | 54 | __cmpxchg_called_with_bad_pointer(); \ |
| 55 | smp_mb(); \ | 55 | smp_mb(); \ |
| 56 | (typeof(*(ptr)))_atomic_cmpxchg((int *)ptr, (int)o, (int)n); \ | 56 | (typeof(*(ptr)))_atomic_cmpxchg((int *)ptr, (int)o, \ |
| 57 | (int)n); \ | ||
| 57 | }) | 58 | }) |
| 58 | 59 | ||
| 59 | #define xchg64(ptr, n) \ | 60 | #define xchg64(ptr, n) \ |
| @@ -61,7 +62,8 @@ u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n); | |||
| 61 | if (sizeof(*(ptr)) != 8) \ | 62 | if (sizeof(*(ptr)) != 8) \ |
| 62 | __xchg_called_with_bad_pointer(); \ | 63 | __xchg_called_with_bad_pointer(); \ |
| 63 | smp_mb(); \ | 64 | smp_mb(); \ |
| 64 | (typeof(*(ptr)))_atomic64_xchg((u64 *)(ptr), (u64)(n)); \ | 65 | (typeof(*(ptr)))_atomic64_xchg((long long *)(ptr), \ |
| 66 | (long long)(n)); \ | ||
| 65 | }) | 67 | }) |
| 66 | 68 | ||
| 67 | #define cmpxchg64(ptr, o, n) \ | 69 | #define cmpxchg64(ptr, o, n) \ |
| @@ -69,7 +71,8 @@ u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n); | |||
| 69 | if (sizeof(*(ptr)) != 8) \ | 71 | if (sizeof(*(ptr)) != 8) \ |
| 70 | __cmpxchg_called_with_bad_pointer(); \ | 72 | __cmpxchg_called_with_bad_pointer(); \ |
| 71 | smp_mb(); \ | 73 | smp_mb(); \ |
| 72 | (typeof(*(ptr)))_atomic64_cmpxchg((u64 *)ptr, (u64)o, (u64)n); \ | 74 | (typeof(*(ptr)))_atomic64_cmpxchg((long long *)ptr, \ |
| 75 | (long long)o, (long long)n); \ | ||
| 73 | }) | 76 | }) |
| 74 | 77 | ||
| 75 | #else | 78 | #else |
| @@ -81,10 +84,11 @@ u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n); | |||
| 81 | switch (sizeof(*(ptr))) { \ | 84 | switch (sizeof(*(ptr))) { \ |
| 82 | case 4: \ | 85 | case 4: \ |
| 83 | __x = (typeof(__x))(unsigned long) \ | 86 | __x = (typeof(__x))(unsigned long) \ |
| 84 | __insn_exch4((ptr), (u32)(unsigned long)(n)); \ | 87 | __insn_exch4((ptr), \ |
| 88 | (u32)(unsigned long)(n)); \ | ||
| 85 | break; \ | 89 | break; \ |
| 86 | case 8: \ | 90 | case 8: \ |
| 87 | __x = (typeof(__x)) \ | 91 | __x = (typeof(__x)) \ |
| 88 | __insn_exch((ptr), (unsigned long)(n)); \ | 92 | __insn_exch((ptr), (unsigned long)(n)); \ |
| 89 | break; \ | 93 | break; \ |
| 90 | default: \ | 94 | default: \ |
| @@ -103,10 +107,12 @@ u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n); | |||
| 103 | switch (sizeof(*(ptr))) { \ | 107 | switch (sizeof(*(ptr))) { \ |
| 104 | case 4: \ | 108 | case 4: \ |
| 105 | __x = (typeof(__x))(unsigned long) \ | 109 | __x = (typeof(__x))(unsigned long) \ |
| 106 | __insn_cmpexch4((ptr), (u32)(unsigned long)(n)); \ | 110 | __insn_cmpexch4((ptr), \ |
| 111 | (u32)(unsigned long)(n)); \ | ||
| 107 | break; \ | 112 | break; \ |
| 108 | case 8: \ | 113 | case 8: \ |
| 109 | __x = (typeof(__x))__insn_cmpexch((ptr), (u64)(n)); \ | 114 | __x = (typeof(__x))__insn_cmpexch((ptr), \ |
| 115 | (long long)(n)); \ | ||
| 110 | break; \ | 116 | break; \ |
| 111 | default: \ | 117 | default: \ |
| 112 | __cmpxchg_called_with_bad_pointer(); \ | 118 | __cmpxchg_called_with_bad_pointer(); \ |
diff --git a/arch/tile/include/asm/percpu.h b/arch/tile/include/asm/percpu.h index 63294f5a8efb..4f7ae39fa202 100644 --- a/arch/tile/include/asm/percpu.h +++ b/arch/tile/include/asm/percpu.h | |||
| @@ -15,9 +15,37 @@ | |||
| 15 | #ifndef _ASM_TILE_PERCPU_H | 15 | #ifndef _ASM_TILE_PERCPU_H |
| 16 | #define _ASM_TILE_PERCPU_H | 16 | #define _ASM_TILE_PERCPU_H |
| 17 | 17 | ||
| 18 | register unsigned long __my_cpu_offset __asm__("tp"); | 18 | register unsigned long my_cpu_offset_reg asm("tp"); |
| 19 | #define __my_cpu_offset __my_cpu_offset | 19 | |
| 20 | #define set_my_cpu_offset(tp) (__my_cpu_offset = (tp)) | 20 | #ifdef CONFIG_PREEMPT |
| 21 | /* | ||
| 22 | * For full preemption, we can't just use the register variable | ||
| 23 | * directly, since we need barrier() to hazard against it, causing the | ||
| 24 | * compiler to reload anything computed from a previous "tp" value. | ||
| 25 | * But we also don't want to use volatile asm, since we'd like the | ||
| 26 | * compiler to be able to cache the value across multiple percpu reads. | ||
| 27 | * So we use a fake stack read as a hazard against barrier(). | ||
| 28 | * The 'U' constraint is like 'm' but disallows postincrement. | ||
| 29 | */ | ||
| 30 | static inline unsigned long __my_cpu_offset(void) | ||
| 31 | { | ||
| 32 | unsigned long tp; | ||
| 33 | register unsigned long *sp asm("sp"); | ||
| 34 | asm("move %0, tp" : "=r" (tp) : "U" (*sp)); | ||
| 35 | return tp; | ||
| 36 | } | ||
| 37 | #define __my_cpu_offset __my_cpu_offset() | ||
| 38 | #else | ||
| 39 | /* | ||
| 40 | * We don't need to hazard against barrier() since "tp" doesn't ever | ||
| 41 | * change with PREEMPT_NONE, and with PREEMPT_VOLUNTARY it only | ||
| 42 | * changes at function call points, at which we are already re-reading | ||
| 43 | * the value of "tp" due to "my_cpu_offset_reg" being a global variable. | ||
| 44 | */ | ||
| 45 | #define __my_cpu_offset my_cpu_offset_reg | ||
| 46 | #endif | ||
| 47 | |||
| 48 | #define set_my_cpu_offset(tp) (my_cpu_offset_reg = (tp)) | ||
| 21 | 49 | ||
| 22 | #include <asm-generic/percpu.h> | 50 | #include <asm-generic/percpu.h> |
| 23 | 51 | ||
diff --git a/arch/tile/kernel/hardwall.c b/arch/tile/kernel/hardwall.c index df27a1fd94a3..531f4c365351 100644 --- a/arch/tile/kernel/hardwall.c +++ b/arch/tile/kernel/hardwall.c | |||
| @@ -66,7 +66,7 @@ static struct hardwall_type hardwall_types[] = { | |||
| 66 | 0, | 66 | 0, |
| 67 | "udn", | 67 | "udn", |
| 68 | LIST_HEAD_INIT(hardwall_types[HARDWALL_UDN].list), | 68 | LIST_HEAD_INIT(hardwall_types[HARDWALL_UDN].list), |
| 69 | __SPIN_LOCK_INITIALIZER(hardwall_types[HARDWALL_UDN].lock), | 69 | __SPIN_LOCK_UNLOCKED(hardwall_types[HARDWALL_UDN].lock), |
| 70 | NULL | 70 | NULL |
| 71 | }, | 71 | }, |
| 72 | #ifndef __tilepro__ | 72 | #ifndef __tilepro__ |
| @@ -77,7 +77,7 @@ static struct hardwall_type hardwall_types[] = { | |||
| 77 | 1, /* disabled pending hypervisor support */ | 77 | 1, /* disabled pending hypervisor support */ |
| 78 | "idn", | 78 | "idn", |
| 79 | LIST_HEAD_INIT(hardwall_types[HARDWALL_IDN].list), | 79 | LIST_HEAD_INIT(hardwall_types[HARDWALL_IDN].list), |
| 80 | __SPIN_LOCK_INITIALIZER(hardwall_types[HARDWALL_IDN].lock), | 80 | __SPIN_LOCK_UNLOCKED(hardwall_types[HARDWALL_IDN].lock), |
| 81 | NULL | 81 | NULL |
| 82 | }, | 82 | }, |
| 83 | { /* access to user-space IPI */ | 83 | { /* access to user-space IPI */ |
| @@ -87,7 +87,7 @@ static struct hardwall_type hardwall_types[] = { | |||
| 87 | 0, | 87 | 0, |
| 88 | "ipi", | 88 | "ipi", |
| 89 | LIST_HEAD_INIT(hardwall_types[HARDWALL_IPI].list), | 89 | LIST_HEAD_INIT(hardwall_types[HARDWALL_IPI].list), |
| 90 | __SPIN_LOCK_INITIALIZER(hardwall_types[HARDWALL_IPI].lock), | 90 | __SPIN_LOCK_UNLOCKED(hardwall_types[HARDWALL_IPI].lock), |
| 91 | NULL | 91 | NULL |
| 92 | }, | 92 | }, |
| 93 | #endif | 93 | #endif |
diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S index 088d5c141e68..2cbe6d5dd6b0 100644 --- a/arch/tile/kernel/intvec_32.S +++ b/arch/tile/kernel/intvec_32.S | |||
| @@ -815,6 +815,9 @@ STD_ENTRY(interrupt_return) | |||
| 815 | } | 815 | } |
| 816 | bzt r28, 1f | 816 | bzt r28, 1f |
| 817 | bnz r29, 1f | 817 | bnz r29, 1f |
| 818 | /* Disable interrupts explicitly for preemption. */ | ||
| 819 | IRQ_DISABLE(r20,r21) | ||
| 820 | TRACE_IRQS_OFF | ||
| 818 | jal preempt_schedule_irq | 821 | jal preempt_schedule_irq |
| 819 | FEEDBACK_REENTER(interrupt_return) | 822 | FEEDBACK_REENTER(interrupt_return) |
| 820 | 1: | 823 | 1: |
diff --git a/arch/tile/kernel/intvec_64.S b/arch/tile/kernel/intvec_64.S index ec755d3f3734..b8fc497f2437 100644 --- a/arch/tile/kernel/intvec_64.S +++ b/arch/tile/kernel/intvec_64.S | |||
| @@ -841,6 +841,9 @@ STD_ENTRY(interrupt_return) | |||
| 841 | } | 841 | } |
| 842 | beqzt r28, 1f | 842 | beqzt r28, 1f |
| 843 | bnez r29, 1f | 843 | bnez r29, 1f |
| 844 | /* Disable interrupts explicitly for preemption. */ | ||
| 845 | IRQ_DISABLE(r20,r21) | ||
| 846 | TRACE_IRQS_OFF | ||
| 844 | jal preempt_schedule_irq | 847 | jal preempt_schedule_irq |
| 845 | FEEDBACK_REENTER(interrupt_return) | 848 | FEEDBACK_REENTER(interrupt_return) |
| 846 | 1: | 849 | 1: |
diff --git a/arch/tile/kernel/stack.c b/arch/tile/kernel/stack.c index 362284af3afd..c93977a62116 100644 --- a/arch/tile/kernel/stack.c +++ b/arch/tile/kernel/stack.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/mmzone.h> | 23 | #include <linux/mmzone.h> |
| 24 | #include <linux/dcache.h> | 24 | #include <linux/dcache.h> |
| 25 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
| 26 | #include <linux/string.h> | ||
| 26 | #include <asm/backtrace.h> | 27 | #include <asm/backtrace.h> |
| 27 | #include <asm/page.h> | 28 | #include <asm/page.h> |
| 28 | #include <asm/ucontext.h> | 29 | #include <asm/ucontext.h> |
| @@ -332,21 +333,18 @@ static void describe_addr(struct KBacktraceIterator *kbt, | |||
| 332 | } | 333 | } |
| 333 | 334 | ||
| 334 | if (vma->vm_file) { | 335 | if (vma->vm_file) { |
| 335 | char *s; | ||
| 336 | p = d_path(&vma->vm_file->f_path, buf, bufsize); | 336 | p = d_path(&vma->vm_file->f_path, buf, bufsize); |
| 337 | if (IS_ERR(p)) | 337 | if (IS_ERR(p)) |
| 338 | p = "?"; | 338 | p = "?"; |
| 339 | s = strrchr(p, '/'); | 339 | name = kbasename(p); |
| 340 | if (s) | ||
| 341 | p = s+1; | ||
| 342 | } else { | 340 | } else { |
| 343 | p = "anon"; | 341 | name = "anon"; |
| 344 | } | 342 | } |
| 345 | 343 | ||
| 346 | /* Generate a string description of the vma info. */ | 344 | /* Generate a string description of the vma info. */ |
| 347 | namelen = strlen(p); | 345 | namelen = strlen(name); |
| 348 | remaining = (bufsize - 1) - namelen; | 346 | remaining = (bufsize - 1) - namelen; |
| 349 | memmove(buf, p, namelen); | 347 | memmove(buf, name, namelen); |
| 350 | snprintf(buf + namelen, remaining, "[%lx+%lx] ", | 348 | snprintf(buf + namelen, remaining, "[%lx+%lx] ", |
| 351 | vma->vm_start, vma->vm_end - vma->vm_start); | 349 | vma->vm_start, vma->vm_end - vma->vm_start); |
| 352 | } | 350 | } |
diff --git a/arch/tile/lib/atomic_32.c b/arch/tile/lib/atomic_32.c index 759efa337be8..c89b211fd9e7 100644 --- a/arch/tile/lib/atomic_32.c +++ b/arch/tile/lib/atomic_32.c | |||
| @@ -107,19 +107,19 @@ unsigned long _atomic_xor(volatile unsigned long *p, unsigned long mask) | |||
| 107 | EXPORT_SYMBOL(_atomic_xor); | 107 | EXPORT_SYMBOL(_atomic_xor); |
| 108 | 108 | ||
| 109 | 109 | ||
| 110 | u64 _atomic64_xchg(u64 *v, u64 n) | 110 | long long _atomic64_xchg(long long *v, long long n) |
| 111 | { | 111 | { |
| 112 | return __atomic64_xchg(v, __atomic_setup(v), n); | 112 | return __atomic64_xchg(v, __atomic_setup(v), n); |
| 113 | } | 113 | } |
| 114 | EXPORT_SYMBOL(_atomic64_xchg); | 114 | EXPORT_SYMBOL(_atomic64_xchg); |
| 115 | 115 | ||
| 116 | u64 _atomic64_xchg_add(u64 *v, u64 i) | 116 | long long _atomic64_xchg_add(long long *v, long long i) |
| 117 | { | 117 | { |
| 118 | return __atomic64_xchg_add(v, __atomic_setup(v), i); | 118 | return __atomic64_xchg_add(v, __atomic_setup(v), i); |
| 119 | } | 119 | } |
| 120 | EXPORT_SYMBOL(_atomic64_xchg_add); | 120 | EXPORT_SYMBOL(_atomic64_xchg_add); |
| 121 | 121 | ||
| 122 | u64 _atomic64_xchg_add_unless(u64 *v, u64 a, u64 u) | 122 | long long _atomic64_xchg_add_unless(long long *v, long long a, long long u) |
| 123 | { | 123 | { |
| 124 | /* | 124 | /* |
| 125 | * Note: argument order is switched here since it is easier | 125 | * Note: argument order is switched here since it is easier |
| @@ -130,7 +130,7 @@ u64 _atomic64_xchg_add_unless(u64 *v, u64 a, u64 u) | |||
| 130 | } | 130 | } |
| 131 | EXPORT_SYMBOL(_atomic64_xchg_add_unless); | 131 | EXPORT_SYMBOL(_atomic64_xchg_add_unless); |
| 132 | 132 | ||
| 133 | u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n) | 133 | long long _atomic64_cmpxchg(long long *v, long long o, long long n) |
| 134 | { | 134 | { |
| 135 | return __atomic64_cmpxchg(v, __atomic_setup(v), o, n); | 135 | return __atomic64_cmpxchg(v, __atomic_setup(v), o, n); |
| 136 | } | 136 | } |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index ee2fb9d37745..145d703227bf 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -860,7 +860,7 @@ source "kernel/Kconfig.preempt" | |||
| 860 | 860 | ||
| 861 | config X86_UP_APIC | 861 | config X86_UP_APIC |
| 862 | bool "Local APIC support on uniprocessors" | 862 | bool "Local APIC support on uniprocessors" |
| 863 | depends on X86_32 && !SMP && !X86_32_NON_STANDARD | 863 | depends on X86_32 && !SMP && !X86_32_NON_STANDARD && !PCI_MSI |
| 864 | ---help--- | 864 | ---help--- |
| 865 | A local APIC (Advanced Programmable Interrupt Controller) is an | 865 | A local APIC (Advanced Programmable Interrupt Controller) is an |
| 866 | integrated interrupt controller in the CPU. If you have a single-CPU | 866 | integrated interrupt controller in the CPU. If you have a single-CPU |
| @@ -885,11 +885,11 @@ config X86_UP_IOAPIC | |||
| 885 | 885 | ||
| 886 | config X86_LOCAL_APIC | 886 | config X86_LOCAL_APIC |
| 887 | def_bool y | 887 | def_bool y |
| 888 | depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC | 888 | depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || PCI_MSI |
| 889 | 889 | ||
| 890 | config X86_IO_APIC | 890 | config X86_IO_APIC |
| 891 | def_bool y | 891 | def_bool y |
| 892 | depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC | 892 | depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI |
| 893 | 893 | ||
| 894 | config X86_VISWS_APIC | 894 | config X86_VISWS_APIC |
| 895 | def_bool y | 895 | def_bool y |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index d3f5c63078d8..89270b4318db 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
| @@ -374,7 +374,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) | |||
| 374 | * Catch too early usage of this before alternatives | 374 | * Catch too early usage of this before alternatives |
| 375 | * have run. | 375 | * have run. |
| 376 | */ | 376 | */ |
| 377 | asm goto("1: jmp %l[t_warn]\n" | 377 | asm_volatile_goto("1: jmp %l[t_warn]\n" |
| 378 | "2:\n" | 378 | "2:\n" |
| 379 | ".section .altinstructions,\"a\"\n" | 379 | ".section .altinstructions,\"a\"\n" |
| 380 | " .long 1b - .\n" | 380 | " .long 1b - .\n" |
| @@ -388,7 +388,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) | |||
| 388 | 388 | ||
| 389 | #endif | 389 | #endif |
| 390 | 390 | ||
| 391 | asm goto("1: jmp %l[t_no]\n" | 391 | asm_volatile_goto("1: jmp %l[t_no]\n" |
| 392 | "2:\n" | 392 | "2:\n" |
| 393 | ".section .altinstructions,\"a\"\n" | 393 | ".section .altinstructions,\"a\"\n" |
| 394 | " .long 1b - .\n" | 394 | " .long 1b - .\n" |
| @@ -453,7 +453,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit) | |||
| 453 | * have. Thus, we force the jump to the widest, 4-byte, signed relative | 453 | * have. Thus, we force the jump to the widest, 4-byte, signed relative |
| 454 | * offset even though the last would often fit in less bytes. | 454 | * offset even though the last would often fit in less bytes. |
| 455 | */ | 455 | */ |
| 456 | asm goto("1: .byte 0xe9\n .long %l[t_dynamic] - 2f\n" | 456 | asm_volatile_goto("1: .byte 0xe9\n .long %l[t_dynamic] - 2f\n" |
| 457 | "2:\n" | 457 | "2:\n" |
| 458 | ".section .altinstructions,\"a\"\n" | 458 | ".section .altinstructions,\"a\"\n" |
| 459 | " .long 1b - .\n" /* src offset */ | 459 | " .long 1b - .\n" /* src offset */ |
diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h index 64507f35800c..6a2cefb4395a 100644 --- a/arch/x86/include/asm/jump_label.h +++ b/arch/x86/include/asm/jump_label.h | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | static __always_inline bool arch_static_branch(struct static_key *key) | 19 | static __always_inline bool arch_static_branch(struct static_key *key) |
| 20 | { | 20 | { |
| 21 | asm goto("1:" | 21 | asm_volatile_goto("1:" |
| 22 | ".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t" | 22 | ".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t" |
| 23 | ".pushsection __jump_table, \"aw\" \n\t" | 23 | ".pushsection __jump_table, \"aw\" \n\t" |
| 24 | _ASM_ALIGN "\n\t" | 24 | _ASM_ALIGN "\n\t" |
diff --git a/arch/x86/include/asm/mutex_64.h b/arch/x86/include/asm/mutex_64.h index e7e6751648ed..07537a44216e 100644 --- a/arch/x86/include/asm/mutex_64.h +++ b/arch/x86/include/asm/mutex_64.h | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | static inline void __mutex_fastpath_lock(atomic_t *v, | 20 | static inline void __mutex_fastpath_lock(atomic_t *v, |
| 21 | void (*fail_fn)(atomic_t *)) | 21 | void (*fail_fn)(atomic_t *)) |
| 22 | { | 22 | { |
| 23 | asm volatile goto(LOCK_PREFIX " decl %0\n" | 23 | asm_volatile_goto(LOCK_PREFIX " decl %0\n" |
| 24 | " jns %l[exit]\n" | 24 | " jns %l[exit]\n" |
| 25 | : : "m" (v->counter) | 25 | : : "m" (v->counter) |
| 26 | : "memory", "cc" | 26 | : "memory", "cc" |
| @@ -75,7 +75,7 @@ static inline int __mutex_fastpath_lock_retval(atomic_t *count) | |||
| 75 | static inline void __mutex_fastpath_unlock(atomic_t *v, | 75 | static inline void __mutex_fastpath_unlock(atomic_t *v, |
| 76 | void (*fail_fn)(atomic_t *)) | 76 | void (*fail_fn)(atomic_t *)) |
| 77 | { | 77 | { |
| 78 | asm volatile goto(LOCK_PREFIX " incl %0\n" | 78 | asm_volatile_goto(LOCK_PREFIX " incl %0\n" |
| 79 | " jg %l[exit]\n" | 79 | " jg %l[exit]\n" |
| 80 | : : "m" (v->counter) | 80 | : : "m" (v->counter) |
| 81 | : "memory", "cc" | 81 | : "memory", "cc" |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 897783b3302a..9d8449158cf9 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
| @@ -1888,10 +1888,7 @@ void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now) | |||
| 1888 | userpg->cap_user_rdpmc = x86_pmu.attr_rdpmc; | 1888 | userpg->cap_user_rdpmc = x86_pmu.attr_rdpmc; |
| 1889 | userpg->pmc_width = x86_pmu.cntval_bits; | 1889 | userpg->pmc_width = x86_pmu.cntval_bits; |
| 1890 | 1890 | ||
| 1891 | if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) | 1891 | if (!sched_clock_stable) |
| 1892 | return; | ||
| 1893 | |||
| 1894 | if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) | ||
| 1895 | return; | 1892 | return; |
| 1896 | 1893 | ||
| 1897 | userpg->cap_user_time = 1; | 1894 | userpg->cap_user_time = 1; |
| @@ -1899,10 +1896,8 @@ void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now) | |||
| 1899 | userpg->time_shift = CYC2NS_SCALE_FACTOR; | 1896 | userpg->time_shift = CYC2NS_SCALE_FACTOR; |
| 1900 | userpg->time_offset = this_cpu_read(cyc2ns_offset) - now; | 1897 | userpg->time_offset = this_cpu_read(cyc2ns_offset) - now; |
| 1901 | 1898 | ||
| 1902 | if (sched_clock_stable && !check_tsc_disabled()) { | 1899 | userpg->cap_user_time_zero = 1; |
| 1903 | userpg->cap_user_time_zero = 1; | 1900 | userpg->time_zero = this_cpu_read(cyc2ns_offset); |
| 1904 | userpg->time_zero = this_cpu_read(cyc2ns_offset); | ||
| 1905 | } | ||
| 1906 | } | 1901 | } |
| 1907 | 1902 | ||
| 1908 | /* | 1903 | /* |
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 697b93af02dd..a0e2a8a80c94 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c | |||
| @@ -775,11 +775,22 @@ void __init kvm_spinlock_init(void) | |||
| 775 | if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) | 775 | if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) |
| 776 | return; | 776 | return; |
| 777 | 777 | ||
| 778 | printk(KERN_INFO "KVM setup paravirtual spinlock\n"); | 778 | pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(kvm_lock_spinning); |
| 779 | pv_lock_ops.unlock_kick = kvm_unlock_kick; | ||
| 780 | } | ||
| 781 | |||
| 782 | static __init int kvm_spinlock_init_jump(void) | ||
| 783 | { | ||
| 784 | if (!kvm_para_available()) | ||
| 785 | return 0; | ||
| 786 | if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) | ||
| 787 | return 0; | ||
| 779 | 788 | ||
| 780 | static_key_slow_inc(¶virt_ticketlocks_enabled); | 789 | static_key_slow_inc(¶virt_ticketlocks_enabled); |
| 790 | printk(KERN_INFO "KVM setup paravirtual spinlock\n"); | ||
| 781 | 791 | ||
| 782 | pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(kvm_lock_spinning); | 792 | return 0; |
| 783 | pv_lock_ops.unlock_kick = kvm_unlock_kick; | ||
| 784 | } | 793 | } |
| 794 | early_initcall(kvm_spinlock_init_jump); | ||
| 795 | |||
| 785 | #endif /* CONFIG_PARAVIRT_SPINLOCKS */ | 796 | #endif /* CONFIG_PARAVIRT_SPINLOCKS */ |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index e643e744e4d8..7e920bff99a3 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
| @@ -326,6 +326,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
| 326 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"), | 326 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"), |
| 327 | }, | 327 | }, |
| 328 | }, | 328 | }, |
| 329 | { /* Handle problems with rebooting on the Latitude E5410. */ | ||
| 330 | .callback = set_pci_reboot, | ||
| 331 | .ident = "Dell Latitude E5410", | ||
| 332 | .matches = { | ||
| 333 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
| 334 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5410"), | ||
| 335 | }, | ||
| 336 | }, | ||
| 329 | { /* Handle problems with rebooting on the Latitude E5420. */ | 337 | { /* Handle problems with rebooting on the Latitude E5420. */ |
| 330 | .callback = set_pci_reboot, | 338 | .callback = set_pci_reboot, |
| 331 | .ident = "Dell Latitude E5420", | 339 | .ident = "Dell Latitude E5420", |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 3b8e7459dd4d..2b2fce1b2009 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
| @@ -3255,25 +3255,29 @@ static void vmx_decache_cr4_guest_bits(struct kvm_vcpu *vcpu) | |||
| 3255 | 3255 | ||
| 3256 | static void ept_load_pdptrs(struct kvm_vcpu *vcpu) | 3256 | static void ept_load_pdptrs(struct kvm_vcpu *vcpu) |
| 3257 | { | 3257 | { |
| 3258 | struct kvm_mmu *mmu = vcpu->arch.walk_mmu; | ||
| 3259 | |||
| 3258 | if (!test_bit(VCPU_EXREG_PDPTR, | 3260 | if (!test_bit(VCPU_EXREG_PDPTR, |
| 3259 | (unsigned long *)&vcpu->arch.regs_dirty)) | 3261 | (unsigned long *)&vcpu->arch.regs_dirty)) |
| 3260 | return; | 3262 | return; |
| 3261 | 3263 | ||
| 3262 | if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) { | 3264 | if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) { |
| 3263 | vmcs_write64(GUEST_PDPTR0, vcpu->arch.mmu.pdptrs[0]); | 3265 | vmcs_write64(GUEST_PDPTR0, mmu->pdptrs[0]); |
| 3264 | vmcs_write64(GUEST_PDPTR1, vcpu->arch.mmu.pdptrs[1]); | 3266 | vmcs_write64(GUEST_PDPTR1, mmu->pdptrs[1]); |
| 3265 | vmcs_write64(GUEST_PDPTR2, vcpu->arch.mmu.pdptrs[2]); | 3267 | vmcs_write64(GUEST_PDPTR2, mmu->pdptrs[2]); |
| 3266 | vmcs_write64(GUEST_PDPTR3, vcpu->arch.mmu.pdptrs[3]); | 3268 | vmcs_write64(GUEST_PDPTR3, mmu->pdptrs[3]); |
| 3267 | } | 3269 | } |
| 3268 | } | 3270 | } |
| 3269 | 3271 | ||
| 3270 | static void ept_save_pdptrs(struct kvm_vcpu *vcpu) | 3272 | static void ept_save_pdptrs(struct kvm_vcpu *vcpu) |
| 3271 | { | 3273 | { |
| 3274 | struct kvm_mmu *mmu = vcpu->arch.walk_mmu; | ||
| 3275 | |||
| 3272 | if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) { | 3276 | if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) { |
| 3273 | vcpu->arch.mmu.pdptrs[0] = vmcs_read64(GUEST_PDPTR0); | 3277 | mmu->pdptrs[0] = vmcs_read64(GUEST_PDPTR0); |
| 3274 | vcpu->arch.mmu.pdptrs[1] = vmcs_read64(GUEST_PDPTR1); | 3278 | mmu->pdptrs[1] = vmcs_read64(GUEST_PDPTR1); |
| 3275 | vcpu->arch.mmu.pdptrs[2] = vmcs_read64(GUEST_PDPTR2); | 3279 | mmu->pdptrs[2] = vmcs_read64(GUEST_PDPTR2); |
| 3276 | vcpu->arch.mmu.pdptrs[3] = vmcs_read64(GUEST_PDPTR3); | 3280 | mmu->pdptrs[3] = vmcs_read64(GUEST_PDPTR3); |
| 3277 | } | 3281 | } |
| 3278 | 3282 | ||
| 3279 | __set_bit(VCPU_EXREG_PDPTR, | 3283 | __set_bit(VCPU_EXREG_PDPTR, |
| @@ -7777,10 +7781,6 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) | |||
| 7777 | vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1); | 7781 | vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1); |
| 7778 | vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2); | 7782 | vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2); |
| 7779 | vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3); | 7783 | vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3); |
| 7780 | __clear_bit(VCPU_EXREG_PDPTR, | ||
| 7781 | (unsigned long *)&vcpu->arch.regs_avail); | ||
| 7782 | __clear_bit(VCPU_EXREG_PDPTR, | ||
| 7783 | (unsigned long *)&vcpu->arch.regs_dirty); | ||
| 7784 | } | 7784 | } |
| 7785 | 7785 | ||
| 7786 | kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->guest_rsp); | 7786 | kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->guest_rsp); |
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index d1e4777b4e75..31d04758b76f 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
| @@ -278,6 +278,15 @@ static void __init xen_smp_prepare_boot_cpu(void) | |||
| 278 | old memory can be recycled */ | 278 | old memory can be recycled */ |
| 279 | make_lowmem_page_readwrite(xen_initial_gdt); | 279 | make_lowmem_page_readwrite(xen_initial_gdt); |
| 280 | 280 | ||
| 281 | #ifdef CONFIG_X86_32 | ||
| 282 | /* | ||
| 283 | * Xen starts us with XEN_FLAT_RING1_DS, but linux code | ||
| 284 | * expects __USER_DS | ||
| 285 | */ | ||
| 286 | loadsegment(ds, __USER_DS); | ||
| 287 | loadsegment(es, __USER_DS); | ||
| 288 | #endif | ||
| 289 | |||
| 281 | xen_filter_cpu_maps(); | 290 | xen_filter_cpu_maps(); |
| 282 | xen_setup_vcpu_info_placement(); | 291 | xen_setup_vcpu_info_placement(); |
| 283 | } | 292 | } |
diff --git a/block/partitions/efi.c b/block/partitions/efi.c index 1eb09ee5311b..a8287b49d062 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c | |||
| @@ -222,11 +222,16 @@ check_hybrid: | |||
| 222 | * the disk size. | 222 | * the disk size. |
| 223 | * | 223 | * |
| 224 | * Hybrid MBRs do not necessarily comply with this. | 224 | * Hybrid MBRs do not necessarily comply with this. |
| 225 | * | ||
| 226 | * Consider a bad value here to be a warning to support dd'ing | ||
| 227 | * an image from a smaller disk to a larger disk. | ||
| 225 | */ | 228 | */ |
| 226 | if (ret == GPT_MBR_PROTECTIVE) { | 229 | if (ret == GPT_MBR_PROTECTIVE) { |
| 227 | sz = le32_to_cpu(mbr->partition_record[part].size_in_lba); | 230 | sz = le32_to_cpu(mbr->partition_record[part].size_in_lba); |
| 228 | if (sz != (uint32_t) total_sectors - 1 && sz != 0xFFFFFFFF) | 231 | if (sz != (uint32_t) total_sectors - 1 && sz != 0xFFFFFFFF) |
| 229 | ret = 0; | 232 | pr_debug("GPT: mbr size in lba (%u) different than whole disk (%u).\n", |
| 233 | sz, min_t(uint32_t, | ||
| 234 | total_sectors - 1, 0xFFFFFFFF)); | ||
| 230 | } | 235 | } |
| 231 | done: | 236 | done: |
| 232 | return ret; | 237 | return ret; |
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 22327e6a7236..5ea5c32609ac 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
| @@ -24,7 +24,7 @@ menuconfig ACPI | |||
| 24 | are configured, ACPI is used. | 24 | are configured, ACPI is used. |
| 25 | 25 | ||
| 26 | The project home page for the Linux ACPI subsystem is here: | 26 | The project home page for the Linux ACPI subsystem is here: |
| 27 | <http://www.lesswatts.org/projects/acpi/> | 27 | <https://01.org/linux-acpi> |
| 28 | 28 | ||
| 29 | Linux support for ACPI is based on Intel Corporation's ACPI | 29 | Linux support for ACPI is based on Intel Corporation's ACPI |
| 30 | Component Architecture (ACPI CA). For more information on the | 30 | Component Architecture (ACPI CA). For more information on the |
diff --git a/drivers/char/random.c b/drivers/char/random.c index 7737b5bd26af..7a744d391756 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
| @@ -640,7 +640,7 @@ struct timer_rand_state { | |||
| 640 | */ | 640 | */ |
| 641 | void add_device_randomness(const void *buf, unsigned int size) | 641 | void add_device_randomness(const void *buf, unsigned int size) |
| 642 | { | 642 | { |
| 643 | unsigned long time = get_cycles() ^ jiffies; | 643 | unsigned long time = random_get_entropy() ^ jiffies; |
| 644 | 644 | ||
| 645 | mix_pool_bytes(&input_pool, buf, size, NULL); | 645 | mix_pool_bytes(&input_pool, buf, size, NULL); |
| 646 | mix_pool_bytes(&input_pool, &time, sizeof(time), NULL); | 646 | mix_pool_bytes(&input_pool, &time, sizeof(time), NULL); |
| @@ -677,7 +677,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num) | |||
| 677 | goto out; | 677 | goto out; |
| 678 | 678 | ||
| 679 | sample.jiffies = jiffies; | 679 | sample.jiffies = jiffies; |
| 680 | sample.cycles = get_cycles(); | 680 | sample.cycles = random_get_entropy(); |
| 681 | sample.num = num; | 681 | sample.num = num; |
| 682 | mix_pool_bytes(&input_pool, &sample, sizeof(sample), NULL); | 682 | mix_pool_bytes(&input_pool, &sample, sizeof(sample), NULL); |
| 683 | 683 | ||
| @@ -744,7 +744,7 @@ void add_interrupt_randomness(int irq, int irq_flags) | |||
| 744 | struct fast_pool *fast_pool = &__get_cpu_var(irq_randomness); | 744 | struct fast_pool *fast_pool = &__get_cpu_var(irq_randomness); |
| 745 | struct pt_regs *regs = get_irq_regs(); | 745 | struct pt_regs *regs = get_irq_regs(); |
| 746 | unsigned long now = jiffies; | 746 | unsigned long now = jiffies; |
| 747 | __u32 input[4], cycles = get_cycles(); | 747 | __u32 input[4], cycles = random_get_entropy(); |
| 748 | 748 | ||
| 749 | input[0] = cycles ^ jiffies; | 749 | input[0] = cycles ^ jiffies; |
| 750 | input[1] = irq; | 750 | input[1] = irq; |
| @@ -1459,12 +1459,11 @@ struct ctl_table random_table[] = { | |||
| 1459 | 1459 | ||
| 1460 | static u32 random_int_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned; | 1460 | static u32 random_int_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned; |
| 1461 | 1461 | ||
| 1462 | static int __init random_int_secret_init(void) | 1462 | int random_int_secret_init(void) |
| 1463 | { | 1463 | { |
| 1464 | get_random_bytes(random_int_secret, sizeof(random_int_secret)); | 1464 | get_random_bytes(random_int_secret, sizeof(random_int_secret)); |
| 1465 | return 0; | 1465 | return 0; |
| 1466 | } | 1466 | } |
| 1467 | late_initcall(random_int_secret_init); | ||
| 1468 | 1467 | ||
| 1469 | /* | 1468 | /* |
| 1470 | * Get a random word for internal kernel use only. Similar to urandom but | 1469 | * Get a random word for internal kernel use only. Similar to urandom but |
| @@ -1483,7 +1482,7 @@ unsigned int get_random_int(void) | |||
| 1483 | 1482 | ||
| 1484 | hash = get_cpu_var(get_random_int_hash); | 1483 | hash = get_cpu_var(get_random_int_hash); |
| 1485 | 1484 | ||
| 1486 | hash[0] += current->pid + jiffies + get_cycles(); | 1485 | hash[0] += current->pid + jiffies + random_get_entropy(); |
| 1487 | md5_transform(hash, random_int_secret); | 1486 | md5_transform(hash, random_int_secret); |
| 1488 | ret = hash[0]; | 1487 | ret = hash[0]; |
| 1489 | put_cpu_var(get_random_int_hash); | 1488 | put_cpu_var(get_random_int_hash); |
diff --git a/drivers/char/tpm/xen-tpmfront.c b/drivers/char/tpm/xen-tpmfront.c index 06189e55b4e5..94c280d36e8b 100644 --- a/drivers/char/tpm/xen-tpmfront.c +++ b/drivers/char/tpm/xen-tpmfront.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
| 11 | #include <linux/err.h> | 11 | #include <linux/err.h> |
| 12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
| 13 | #include <xen/xen.h> | ||
| 13 | #include <xen/events.h> | 14 | #include <xen/events.h> |
| 14 | #include <xen/interface/io/tpmif.h> | 15 | #include <xen/interface/io/tpmif.h> |
| 15 | #include <xen/grant_table.h> | 16 | #include <xen/grant_table.h> |
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 098a8da450f0..3519111c566b 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c | |||
| @@ -306,6 +306,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg( | |||
| 306 | EDMA_SLOT_ANY); | 306 | EDMA_SLOT_ANY); |
| 307 | if (echan->slot[i] < 0) { | 307 | if (echan->slot[i] < 0) { |
| 308 | dev_err(dev, "Failed to allocate slot\n"); | 308 | dev_err(dev, "Failed to allocate slot\n"); |
| 309 | kfree(edesc); | ||
| 309 | return NULL; | 310 | return NULL; |
| 310 | } | 311 | } |
| 311 | } | 312 | } |
diff --git a/drivers/dma/sh/rcar-hpbdma.c b/drivers/dma/sh/rcar-hpbdma.c index 45a520281ce1..ebad84591a6e 100644 --- a/drivers/dma/sh/rcar-hpbdma.c +++ b/drivers/dma/sh/rcar-hpbdma.c | |||
| @@ -93,6 +93,7 @@ struct hpb_dmae_chan { | |||
| 93 | void __iomem *base; | 93 | void __iomem *base; |
| 94 | const struct hpb_dmae_slave_config *cfg; | 94 | const struct hpb_dmae_slave_config *cfg; |
| 95 | char dev_id[16]; /* unique name per DMAC of channel */ | 95 | char dev_id[16]; /* unique name per DMAC of channel */ |
| 96 | dma_addr_t slave_addr; | ||
| 96 | }; | 97 | }; |
| 97 | 98 | ||
| 98 | struct hpb_dmae_device { | 99 | struct hpb_dmae_device { |
| @@ -432,7 +433,6 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan, | |||
| 432 | hpb_chan->xfer_mode = XFER_DOUBLE; | 433 | hpb_chan->xfer_mode = XFER_DOUBLE; |
| 433 | } else { | 434 | } else { |
| 434 | dev_err(hpb_chan->shdma_chan.dev, "DCR setting error"); | 435 | dev_err(hpb_chan->shdma_chan.dev, "DCR setting error"); |
| 435 | shdma_free_irq(&hpb_chan->shdma_chan); | ||
| 436 | return -EINVAL; | 436 | return -EINVAL; |
| 437 | } | 437 | } |
| 438 | 438 | ||
| @@ -446,7 +446,8 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan, | |||
| 446 | return 0; | 446 | return 0; |
| 447 | } | 447 | } |
| 448 | 448 | ||
| 449 | static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try) | 449 | static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, |
| 450 | dma_addr_t slave_addr, bool try) | ||
| 450 | { | 451 | { |
| 451 | struct hpb_dmae_chan *chan = to_chan(schan); | 452 | struct hpb_dmae_chan *chan = to_chan(schan); |
| 452 | const struct hpb_dmae_slave_config *sc = | 453 | const struct hpb_dmae_slave_config *sc = |
| @@ -457,6 +458,7 @@ static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try) | |||
| 457 | if (try) | 458 | if (try) |
| 458 | return 0; | 459 | return 0; |
| 459 | chan->cfg = sc; | 460 | chan->cfg = sc; |
| 461 | chan->slave_addr = slave_addr ? : sc->addr; | ||
| 460 | return hpb_dmae_alloc_chan_resources(chan, sc); | 462 | return hpb_dmae_alloc_chan_resources(chan, sc); |
| 461 | } | 463 | } |
| 462 | 464 | ||
| @@ -468,7 +470,7 @@ static dma_addr_t hpb_dmae_slave_addr(struct shdma_chan *schan) | |||
| 468 | { | 470 | { |
| 469 | struct hpb_dmae_chan *chan = to_chan(schan); | 471 | struct hpb_dmae_chan *chan = to_chan(schan); |
| 470 | 472 | ||
| 471 | return chan->cfg->addr; | 473 | return chan->slave_addr; |
| 472 | } | 474 | } |
| 473 | 475 | ||
| 474 | static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i) | 476 | static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i) |
| @@ -614,7 +616,6 @@ static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev) | |||
| 614 | shdma_for_each_chan(schan, &hpbdev->shdma_dev, i) { | 616 | shdma_for_each_chan(schan, &hpbdev->shdma_dev, i) { |
| 615 | BUG_ON(!schan); | 617 | BUG_ON(!schan); |
| 616 | 618 | ||
| 617 | shdma_free_irq(schan); | ||
| 618 | shdma_chan_remove(schan); | 619 | shdma_chan_remove(schan); |
| 619 | } | 620 | } |
| 620 | dma_dev->chancnt = 0; | 621 | dma_dev->chancnt = 0; |
diff --git a/drivers/gpio/gpio-lynxpoint.c b/drivers/gpio/gpio-lynxpoint.c index 2d9ca6055e5e..41b5913ddabe 100644 --- a/drivers/gpio/gpio-lynxpoint.c +++ b/drivers/gpio/gpio-lynxpoint.c | |||
| @@ -248,14 +248,15 @@ static void lp_gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
| 248 | struct lp_gpio *lg = irq_data_get_irq_handler_data(data); | 248 | struct lp_gpio *lg = irq_data_get_irq_handler_data(data); |
| 249 | struct irq_chip *chip = irq_data_get_irq_chip(data); | 249 | struct irq_chip *chip = irq_data_get_irq_chip(data); |
| 250 | u32 base, pin, mask; | 250 | u32 base, pin, mask; |
| 251 | unsigned long reg, pending; | 251 | unsigned long reg, ena, pending; |
| 252 | unsigned virq; | 252 | unsigned virq; |
| 253 | 253 | ||
| 254 | /* check from GPIO controller which pin triggered the interrupt */ | 254 | /* check from GPIO controller which pin triggered the interrupt */ |
| 255 | for (base = 0; base < lg->chip.ngpio; base += 32) { | 255 | for (base = 0; base < lg->chip.ngpio; base += 32) { |
| 256 | reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); | 256 | reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); |
| 257 | ena = lp_gpio_reg(&lg->chip, base, LP_INT_ENABLE); | ||
| 257 | 258 | ||
| 258 | while ((pending = inl(reg))) { | 259 | while ((pending = (inl(reg) & inl(ena)))) { |
| 259 | pin = __ffs(pending); | 260 | pin = __ffs(pending); |
| 260 | mask = BIT(pin); | 261 | mask = BIT(pin); |
| 261 | /* Clear before handling so we don't lose an edge */ | 262 | /* Clear before handling so we don't lose an edge */ |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 86ef3461ec06..0dee0e0c247a 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
| @@ -136,7 +136,7 @@ static struct gpio_desc *gpio_to_desc(unsigned gpio) | |||
| 136 | */ | 136 | */ |
| 137 | static int desc_to_gpio(const struct gpio_desc *desc) | 137 | static int desc_to_gpio(const struct gpio_desc *desc) |
| 138 | { | 138 | { |
| 139 | return desc->chip->base + gpio_chip_hwgpio(desc); | 139 | return desc - &gpio_desc[0]; |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | 142 | ||
| @@ -1398,7 +1398,7 @@ static int gpiod_request(struct gpio_desc *desc, const char *label) | |||
| 1398 | int status = -EPROBE_DEFER; | 1398 | int status = -EPROBE_DEFER; |
| 1399 | unsigned long flags; | 1399 | unsigned long flags; |
| 1400 | 1400 | ||
| 1401 | if (!desc || !desc->chip) { | 1401 | if (!desc) { |
| 1402 | pr_warn("%s: invalid GPIO\n", __func__); | 1402 | pr_warn("%s: invalid GPIO\n", __func__); |
| 1403 | return -EINVAL; | 1403 | return -EINVAL; |
| 1404 | } | 1404 | } |
| @@ -1406,6 +1406,8 @@ static int gpiod_request(struct gpio_desc *desc, const char *label) | |||
| 1406 | spin_lock_irqsave(&gpio_lock, flags); | 1406 | spin_lock_irqsave(&gpio_lock, flags); |
| 1407 | 1407 | ||
| 1408 | chip = desc->chip; | 1408 | chip = desc->chip; |
| 1409 | if (chip == NULL) | ||
| 1410 | goto done; | ||
| 1409 | 1411 | ||
| 1410 | if (!try_module_get(chip->owner)) | 1412 | if (!try_module_get(chip->owner)) |
| 1411 | goto done; | 1413 | goto done; |
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 1688ff500513..830f7501cb4d 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
| @@ -2925,6 +2925,8 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb) | |||
| 2925 | /* Speaker Allocation Data Block */ | 2925 | /* Speaker Allocation Data Block */ |
| 2926 | if (dbl == 3) { | 2926 | if (dbl == 3) { |
| 2927 | *sadb = kmalloc(dbl, GFP_KERNEL); | 2927 | *sadb = kmalloc(dbl, GFP_KERNEL); |
| 2928 | if (!*sadb) | ||
| 2929 | return -ENOMEM; | ||
| 2928 | memcpy(*sadb, &db[1], dbl); | 2930 | memcpy(*sadb, &db[1], dbl); |
| 2929 | count = dbl; | 2931 | count = dbl; |
| 2930 | break; | 2932 | break; |
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index f6f6cc7fc133..3d13ca6e257f 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
| @@ -416,14 +416,6 @@ static void drm_fb_helper_dpms(struct fb_info *info, int dpms_mode) | |||
| 416 | return; | 416 | return; |
| 417 | 417 | ||
| 418 | /* | 418 | /* |
| 419 | * fbdev->blank can be called from irq context in case of a panic. | ||
| 420 | * Since we already have our own special panic handler which will | ||
| 421 | * restore the fbdev console mode completely, just bail out early. | ||
| 422 | */ | ||
| 423 | if (oops_in_progress) | ||
| 424 | return; | ||
| 425 | |||
| 426 | /* | ||
| 427 | * For each CRTC in this fb, turn the connectors on/off. | 419 | * For each CRTC in this fb, turn the connectors on/off. |
| 428 | */ | 420 | */ |
| 429 | drm_modeset_lock_all(dev); | 421 | drm_modeset_lock_all(dev); |
diff --git a/drivers/gpu/drm/gma500/gtt.c b/drivers/gpu/drm/gma500/gtt.c index 92babac362ec..2db731f00930 100644 --- a/drivers/gpu/drm/gma500/gtt.c +++ b/drivers/gpu/drm/gma500/gtt.c | |||
| @@ -204,6 +204,7 @@ static int psb_gtt_attach_pages(struct gtt_range *gt) | |||
| 204 | if (IS_ERR(pages)) | 204 | if (IS_ERR(pages)) |
| 205 | return PTR_ERR(pages); | 205 | return PTR_ERR(pages); |
| 206 | 206 | ||
| 207 | gt->npage = gt->gem.size / PAGE_SIZE; | ||
| 207 | gt->pages = pages; | 208 | gt->pages = pages; |
| 208 | 209 | ||
| 209 | return 0; | 210 | return 0; |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index c27a21034a5e..d5c784d48671 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
| @@ -1290,12 +1290,9 @@ static int i915_load_modeset_init(struct drm_device *dev) | |||
| 1290 | * then we do not take part in VGA arbitration and the | 1290 | * then we do not take part in VGA arbitration and the |
| 1291 | * vga_client_register() fails with -ENODEV. | 1291 | * vga_client_register() fails with -ENODEV. |
| 1292 | */ | 1292 | */ |
| 1293 | if (!HAS_PCH_SPLIT(dev)) { | 1293 | ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode); |
| 1294 | ret = vga_client_register(dev->pdev, dev, NULL, | 1294 | if (ret && ret != -ENODEV) |
| 1295 | i915_vga_set_decode); | 1295 | goto out; |
| 1296 | if (ret && ret != -ENODEV) | ||
| 1297 | goto out; | ||
| 1298 | } | ||
| 1299 | 1296 | ||
| 1300 | intel_register_dsm_handler(); | 1297 | intel_register_dsm_handler(); |
| 1301 | 1298 | ||
| @@ -1351,12 +1348,6 @@ static int i915_load_modeset_init(struct drm_device *dev) | |||
| 1351 | */ | 1348 | */ |
| 1352 | intel_fbdev_initial_config(dev); | 1349 | intel_fbdev_initial_config(dev); |
| 1353 | 1350 | ||
| 1354 | /* | ||
| 1355 | * Must do this after fbcon init so that | ||
| 1356 | * vgacon_save_screen() works during the handover. | ||
| 1357 | */ | ||
| 1358 | i915_disable_vga_mem(dev); | ||
| 1359 | |||
| 1360 | /* Only enable hotplug handling once the fbdev is fully set up. */ | 1351 | /* Only enable hotplug handling once the fbdev is fully set up. */ |
| 1361 | dev_priv->enable_hotplug_processing = true; | 1352 | dev_priv->enable_hotplug_processing = true; |
| 1362 | 1353 | ||
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index c159e1a6810f..38f96f65d87a 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
| @@ -3881,6 +3881,9 @@ | |||
| 3881 | #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG 0x9030 | 3881 | #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG 0x9030 |
| 3882 | #define GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB (1<<11) | 3882 | #define GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB (1<<11) |
| 3883 | 3883 | ||
| 3884 | #define HSW_SCRATCH1 0xb038 | ||
| 3885 | #define HSW_SCRATCH1_L3_DATA_ATOMICS_DISABLE (1<<27) | ||
| 3886 | |||
| 3884 | #define HSW_FUSE_STRAP 0x42014 | 3887 | #define HSW_FUSE_STRAP 0x42014 |
| 3885 | #define HSW_CDCLK_LIMIT (1 << 24) | 3888 | #define HSW_CDCLK_LIMIT (1 << 24) |
| 3886 | 3889 | ||
| @@ -4728,6 +4731,9 @@ | |||
| 4728 | #define GEN7_ROW_CHICKEN2_GT2 0xf4f4 | 4731 | #define GEN7_ROW_CHICKEN2_GT2 0xf4f4 |
| 4729 | #define DOP_CLOCK_GATING_DISABLE (1<<0) | 4732 | #define DOP_CLOCK_GATING_DISABLE (1<<0) |
| 4730 | 4733 | ||
| 4734 | #define HSW_ROW_CHICKEN3 0xe49c | ||
| 4735 | #define HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE (1 << 6) | ||
| 4736 | |||
| 4731 | #define G4X_AUD_VID_DID (dev_priv->info->display_mmio_offset + 0x62020) | 4737 | #define G4X_AUD_VID_DID (dev_priv->info->display_mmio_offset + 0x62020) |
| 4732 | #define INTEL_AUDIO_DEVCL 0x808629FB | 4738 | #define INTEL_AUDIO_DEVCL 0x808629FB |
| 4733 | #define INTEL_AUDIO_DEVBLC 0x80862801 | 4739 | #define INTEL_AUDIO_DEVBLC 0x80862801 |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e5822e79f912..581fb4b2f766 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -3941,8 +3941,6 @@ static void intel_connector_check_state(struct intel_connector *connector) | |||
| 3941 | * consider. */ | 3941 | * consider. */ |
| 3942 | void intel_connector_dpms(struct drm_connector *connector, int mode) | 3942 | void intel_connector_dpms(struct drm_connector *connector, int mode) |
| 3943 | { | 3943 | { |
| 3944 | struct intel_encoder *encoder = intel_attached_encoder(connector); | ||
| 3945 | |||
| 3946 | /* All the simple cases only support two dpms states. */ | 3944 | /* All the simple cases only support two dpms states. */ |
| 3947 | if (mode != DRM_MODE_DPMS_ON) | 3945 | if (mode != DRM_MODE_DPMS_ON) |
| 3948 | mode = DRM_MODE_DPMS_OFF; | 3946 | mode = DRM_MODE_DPMS_OFF; |
| @@ -3953,10 +3951,8 @@ void intel_connector_dpms(struct drm_connector *connector, int mode) | |||
| 3953 | connector->dpms = mode; | 3951 | connector->dpms = mode; |
| 3954 | 3952 | ||
| 3955 | /* Only need to change hw state when actually enabled */ | 3953 | /* Only need to change hw state when actually enabled */ |
| 3956 | if (encoder->base.crtc) | 3954 | if (connector->encoder) |
| 3957 | intel_encoder_dpms(encoder, mode); | 3955 | intel_encoder_dpms(to_intel_encoder(connector->encoder), mode); |
| 3958 | else | ||
| 3959 | WARN_ON(encoder->connectors_active != false); | ||
| 3960 | 3956 | ||
| 3961 | intel_modeset_check_state(connector->dev); | 3957 | intel_modeset_check_state(connector->dev); |
| 3962 | } | 3958 | } |
| @@ -10049,33 +10045,6 @@ static void i915_disable_vga(struct drm_device *dev) | |||
| 10049 | POSTING_READ(vga_reg); | 10045 | POSTING_READ(vga_reg); |
| 10050 | } | 10046 | } |
| 10051 | 10047 | ||
| 10052 | static void i915_enable_vga_mem(struct drm_device *dev) | ||
| 10053 | { | ||
| 10054 | /* Enable VGA memory on Intel HD */ | ||
| 10055 | if (HAS_PCH_SPLIT(dev)) { | ||
| 10056 | vga_get_uninterruptible(dev->pdev, VGA_RSRC_LEGACY_IO); | ||
| 10057 | outb(inb(VGA_MSR_READ) | VGA_MSR_MEM_EN, VGA_MSR_WRITE); | ||
| 10058 | vga_set_legacy_decoding(dev->pdev, VGA_RSRC_LEGACY_IO | | ||
| 10059 | VGA_RSRC_LEGACY_MEM | | ||
| 10060 | VGA_RSRC_NORMAL_IO | | ||
| 10061 | VGA_RSRC_NORMAL_MEM); | ||
| 10062 | vga_put(dev->pdev, VGA_RSRC_LEGACY_IO); | ||
| 10063 | } | ||
| 10064 | } | ||
| 10065 | |||
| 10066 | void i915_disable_vga_mem(struct drm_device *dev) | ||
| 10067 | { | ||
| 10068 | /* Disable VGA memory on Intel HD */ | ||
| 10069 | if (HAS_PCH_SPLIT(dev)) { | ||
| 10070 | vga_get_uninterruptible(dev->pdev, VGA_RSRC_LEGACY_IO); | ||
| 10071 | outb(inb(VGA_MSR_READ) & ~VGA_MSR_MEM_EN, VGA_MSR_WRITE); | ||
| 10072 | vga_set_legacy_decoding(dev->pdev, VGA_RSRC_LEGACY_IO | | ||
| 10073 | VGA_RSRC_NORMAL_IO | | ||
| 10074 | VGA_RSRC_NORMAL_MEM); | ||
| 10075 | vga_put(dev->pdev, VGA_RSRC_LEGACY_IO); | ||
| 10076 | } | ||
| 10077 | } | ||
| 10078 | |||
| 10079 | void intel_modeset_init_hw(struct drm_device *dev) | 10048 | void intel_modeset_init_hw(struct drm_device *dev) |
| 10080 | { | 10049 | { |
| 10081 | intel_init_power_well(dev); | 10050 | intel_init_power_well(dev); |
| @@ -10354,7 +10323,6 @@ void i915_redisable_vga(struct drm_device *dev) | |||
| 10354 | if (I915_READ(vga_reg) != VGA_DISP_DISABLE) { | 10323 | if (I915_READ(vga_reg) != VGA_DISP_DISABLE) { |
| 10355 | DRM_DEBUG_KMS("Something enabled VGA plane, disabling it\n"); | 10324 | DRM_DEBUG_KMS("Something enabled VGA plane, disabling it\n"); |
| 10356 | i915_disable_vga(dev); | 10325 | i915_disable_vga(dev); |
| 10357 | i915_disable_vga_mem(dev); | ||
| 10358 | } | 10326 | } |
| 10359 | } | 10327 | } |
| 10360 | 10328 | ||
| @@ -10568,8 +10536,6 @@ void intel_modeset_cleanup(struct drm_device *dev) | |||
| 10568 | 10536 | ||
| 10569 | intel_disable_fbc(dev); | 10537 | intel_disable_fbc(dev); |
| 10570 | 10538 | ||
| 10571 | i915_enable_vga_mem(dev); | ||
| 10572 | |||
| 10573 | intel_disable_gt_powersave(dev); | 10539 | intel_disable_gt_powersave(dev); |
| 10574 | 10540 | ||
| 10575 | ironlake_teardown_rc6(dev); | 10541 | ironlake_teardown_rc6(dev); |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 79c14e298ba6..2c555f91bfae 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -1467,7 +1467,7 @@ static void intel_edp_psr_setup(struct intel_dp *intel_dp) | |||
| 1467 | 1467 | ||
| 1468 | /* Avoid continuous PSR exit by masking memup and hpd */ | 1468 | /* Avoid continuous PSR exit by masking memup and hpd */ |
| 1469 | I915_WRITE(EDP_PSR_DEBUG_CTL, EDP_PSR_DEBUG_MASK_MEMUP | | 1469 | I915_WRITE(EDP_PSR_DEBUG_CTL, EDP_PSR_DEBUG_MASK_MEMUP | |
| 1470 | EDP_PSR_DEBUG_MASK_HPD); | 1470 | EDP_PSR_DEBUG_MASK_HPD | EDP_PSR_DEBUG_MASK_LPSP); |
| 1471 | 1471 | ||
| 1472 | intel_dp->psr_setup_done = true; | 1472 | intel_dp->psr_setup_done = true; |
| 1473 | } | 1473 | } |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 28cae80495e2..9b7b68fd5d47 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
| @@ -793,6 +793,5 @@ extern void hsw_pc8_disable_interrupts(struct drm_device *dev); | |||
| 793 | extern void hsw_pc8_restore_interrupts(struct drm_device *dev); | 793 | extern void hsw_pc8_restore_interrupts(struct drm_device *dev); |
| 794 | extern void intel_aux_display_runtime_get(struct drm_i915_private *dev_priv); | 794 | extern void intel_aux_display_runtime_get(struct drm_i915_private *dev_priv); |
| 795 | extern void intel_aux_display_runtime_put(struct drm_i915_private *dev_priv); | 795 | extern void intel_aux_display_runtime_put(struct drm_i915_private *dev_priv); |
| 796 | extern void i915_disable_vga_mem(struct drm_device *dev); | ||
| 797 | 796 | ||
| 798 | #endif /* __INTEL_DRV_H__ */ | 797 | #endif /* __INTEL_DRV_H__ */ |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index dd176b7296c1..f4c5e95b2d6f 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
| @@ -3864,8 +3864,6 @@ static void valleyview_enable_rps(struct drm_device *dev) | |||
| 3864 | dev_priv->rps.rpe_delay), | 3864 | dev_priv->rps.rpe_delay), |
| 3865 | dev_priv->rps.rpe_delay); | 3865 | dev_priv->rps.rpe_delay); |
| 3866 | 3866 | ||
| 3867 | INIT_DELAYED_WORK(&dev_priv->rps.vlv_work, vlv_rps_timer_work); | ||
| 3868 | |||
| 3869 | valleyview_set_rps(dev_priv->dev, dev_priv->rps.rpe_delay); | 3867 | valleyview_set_rps(dev_priv->dev, dev_priv->rps.rpe_delay); |
| 3870 | 3868 | ||
| 3871 | gen6_enable_rps_interrupts(dev); | 3869 | gen6_enable_rps_interrupts(dev); |
| @@ -4955,6 +4953,11 @@ static void haswell_init_clock_gating(struct drm_device *dev) | |||
| 4955 | I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER, | 4953 | I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER, |
| 4956 | GEN7_WA_L3_CHICKEN_MODE); | 4954 | GEN7_WA_L3_CHICKEN_MODE); |
| 4957 | 4955 | ||
| 4956 | /* L3 caching of data atomics doesn't work -- disable it. */ | ||
| 4957 | I915_WRITE(HSW_SCRATCH1, HSW_SCRATCH1_L3_DATA_ATOMICS_DISABLE); | ||
| 4958 | I915_WRITE(HSW_ROW_CHICKEN3, | ||
| 4959 | _MASKED_BIT_ENABLE(HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE)); | ||
| 4960 | |||
| 4958 | /* This is required by WaCatErrorRejectionIssue:hsw */ | 4961 | /* This is required by WaCatErrorRejectionIssue:hsw */ |
| 4959 | I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG, | 4962 | I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG, |
| 4960 | I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) | | 4963 | I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) | |
| @@ -5681,5 +5684,7 @@ void intel_pm_init(struct drm_device *dev) | |||
| 5681 | 5684 | ||
| 5682 | INIT_DELAYED_WORK(&dev_priv->rps.delayed_resume_work, | 5685 | INIT_DELAYED_WORK(&dev_priv->rps.delayed_resume_work, |
| 5683 | intel_gen6_powersave_work); | 5686 | intel_gen6_powersave_work); |
| 5687 | |||
| 5688 | INIT_DELAYED_WORK(&dev_priv->rps.vlv_work, vlv_rps_timer_work); | ||
| 5684 | } | 5689 | } |
| 5685 | 5690 | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/mc/base.c b/drivers/gpu/drm/nouveau/core/subdev/mc/base.c index 37712a6df923..e290cfa4acee 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/mc/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/mc/base.c | |||
| @@ -113,7 +113,7 @@ nouveau_mc_create_(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 113 | pmc->use_msi = false; | 113 | pmc->use_msi = false; |
| 114 | break; | 114 | break; |
| 115 | default: | 115 | default: |
| 116 | pmc->use_msi = nouveau_boolopt(device->cfgopt, "NvMSI", true); | 116 | pmc->use_msi = nouveau_boolopt(device->cfgopt, "NvMSI", false); |
| 117 | if (pmc->use_msi) { | 117 | if (pmc->use_msi) { |
| 118 | pmc->use_msi = pci_enable_msi(device->pdev) == 0; | 118 | pmc->use_msi = pci_enable_msi(device->pdev) == 0; |
| 119 | if (pmc->use_msi) { | 119 | if (pmc->use_msi) { |
diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c index b162e98a2953..9b6950d9b3c0 100644 --- a/drivers/gpu/drm/radeon/btc_dpm.c +++ b/drivers/gpu/drm/radeon/btc_dpm.c | |||
| @@ -1930,7 +1930,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev, | |||
| 1930 | } | 1930 | } |
| 1931 | j++; | 1931 | j++; |
| 1932 | 1932 | ||
| 1933 | if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE) | 1933 | if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE) |
| 1934 | return -EINVAL; | 1934 | return -EINVAL; |
| 1935 | 1935 | ||
| 1936 | tmp = RREG32(MC_PMG_CMD_MRS); | 1936 | tmp = RREG32(MC_PMG_CMD_MRS); |
| @@ -1945,7 +1945,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev, | |||
| 1945 | } | 1945 | } |
| 1946 | j++; | 1946 | j++; |
| 1947 | 1947 | ||
| 1948 | if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE) | 1948 | if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE) |
| 1949 | return -EINVAL; | 1949 | return -EINVAL; |
| 1950 | break; | 1950 | break; |
| 1951 | case MC_SEQ_RESERVE_M >> 2: | 1951 | case MC_SEQ_RESERVE_M >> 2: |
| @@ -1959,7 +1959,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev, | |||
| 1959 | } | 1959 | } |
| 1960 | j++; | 1960 | j++; |
| 1961 | 1961 | ||
| 1962 | if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE) | 1962 | if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE) |
| 1963 | return -EINVAL; | 1963 | return -EINVAL; |
| 1964 | break; | 1964 | break; |
| 1965 | default: | 1965 | default: |
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index d02fd1c045d5..b874ccdf52f7 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c | |||
| @@ -77,6 +77,8 @@ static void cik_pcie_gen3_enable(struct radeon_device *rdev); | |||
| 77 | static void cik_program_aspm(struct radeon_device *rdev); | 77 | static void cik_program_aspm(struct radeon_device *rdev); |
| 78 | static void cik_init_pg(struct radeon_device *rdev); | 78 | static void cik_init_pg(struct radeon_device *rdev); |
| 79 | static void cik_init_cg(struct radeon_device *rdev); | 79 | static void cik_init_cg(struct radeon_device *rdev); |
| 80 | static void cik_fini_pg(struct radeon_device *rdev); | ||
| 81 | static void cik_fini_cg(struct radeon_device *rdev); | ||
| 80 | static void cik_enable_gui_idle_interrupt(struct radeon_device *rdev, | 82 | static void cik_enable_gui_idle_interrupt(struct radeon_device *rdev, |
| 81 | bool enable); | 83 | bool enable); |
| 82 | 84 | ||
| @@ -4185,6 +4187,10 @@ static void cik_gpu_soft_reset(struct radeon_device *rdev, u32 reset_mask) | |||
| 4185 | dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", | 4187 | dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", |
| 4186 | RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS)); | 4188 | RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS)); |
| 4187 | 4189 | ||
| 4190 | /* disable CG/PG */ | ||
| 4191 | cik_fini_pg(rdev); | ||
| 4192 | cik_fini_cg(rdev); | ||
| 4193 | |||
| 4188 | /* stop the rlc */ | 4194 | /* stop the rlc */ |
| 4189 | cik_rlc_stop(rdev); | 4195 | cik_rlc_stop(rdev); |
| 4190 | 4196 | ||
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 555164e270a7..b5c67a99dda9 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
| @@ -3131,7 +3131,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev) | |||
| 3131 | rdev->config.evergreen.sx_max_export_size = 256; | 3131 | rdev->config.evergreen.sx_max_export_size = 256; |
| 3132 | rdev->config.evergreen.sx_max_export_pos_size = 64; | 3132 | rdev->config.evergreen.sx_max_export_pos_size = 64; |
| 3133 | rdev->config.evergreen.sx_max_export_smx_size = 192; | 3133 | rdev->config.evergreen.sx_max_export_smx_size = 192; |
| 3134 | rdev->config.evergreen.max_hw_contexts = 8; | 3134 | rdev->config.evergreen.max_hw_contexts = 4; |
| 3135 | rdev->config.evergreen.sq_num_cf_insts = 2; | 3135 | rdev->config.evergreen.sq_num_cf_insts = 2; |
| 3136 | 3136 | ||
| 3137 | rdev->config.evergreen.sc_prim_fifo_size = 0x40; | 3137 | rdev->config.evergreen.sc_prim_fifo_size = 0x40; |
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c index f71ce390aebe..f815c20640bd 100644 --- a/drivers/gpu/drm/radeon/evergreen_hdmi.c +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c | |||
| @@ -288,8 +288,7 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode | |||
| 288 | /* fglrx clears sth in AFMT_AUDIO_PACKET_CONTROL2 here */ | 288 | /* fglrx clears sth in AFMT_AUDIO_PACKET_CONTROL2 here */ |
| 289 | 289 | ||
| 290 | WREG32(HDMI_ACR_PACKET_CONTROL + offset, | 290 | WREG32(HDMI_ACR_PACKET_CONTROL + offset, |
| 291 | HDMI_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */ | 291 | HDMI_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */ |
| 292 | HDMI_ACR_SOURCE); /* select SW CTS value */ | ||
| 293 | 292 | ||
| 294 | evergreen_hdmi_update_ACR(encoder, mode->clock); | 293 | evergreen_hdmi_update_ACR(encoder, mode->clock); |
| 295 | 294 | ||
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h index 8768fd6a1e27..4f6d2962767d 100644 --- a/drivers/gpu/drm/radeon/evergreend.h +++ b/drivers/gpu/drm/radeon/evergreend.h | |||
| @@ -1501,7 +1501,7 @@ | |||
| 1501 | * 6. COMMAND [29:22] | BYTE_COUNT [20:0] | 1501 | * 6. COMMAND [29:22] | BYTE_COUNT [20:0] |
| 1502 | */ | 1502 | */ |
| 1503 | # define PACKET3_CP_DMA_DST_SEL(x) ((x) << 20) | 1503 | # define PACKET3_CP_DMA_DST_SEL(x) ((x) << 20) |
| 1504 | /* 0 - SRC_ADDR | 1504 | /* 0 - DST_ADDR |
| 1505 | * 1 - GDS | 1505 | * 1 - GDS |
| 1506 | */ | 1506 | */ |
| 1507 | # define PACKET3_CP_DMA_ENGINE(x) ((x) << 27) | 1507 | # define PACKET3_CP_DMA_ENGINE(x) ((x) << 27) |
| @@ -1516,7 +1516,7 @@ | |||
| 1516 | # define PACKET3_CP_DMA_CP_SYNC (1 << 31) | 1516 | # define PACKET3_CP_DMA_CP_SYNC (1 << 31) |
| 1517 | /* COMMAND */ | 1517 | /* COMMAND */ |
| 1518 | # define PACKET3_CP_DMA_DIS_WC (1 << 21) | 1518 | # define PACKET3_CP_DMA_DIS_WC (1 << 21) |
| 1519 | # define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 23) | 1519 | # define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22) |
| 1520 | /* 0 - none | 1520 | /* 0 - none |
| 1521 | * 1 - 8 in 16 | 1521 | * 1 - 8 in 16 |
| 1522 | * 2 - 8 in 32 | 1522 | * 2 - 8 in 32 |
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c index b0fa6002af3e..5b729319f27b 100644 --- a/drivers/gpu/drm/radeon/r600_hdmi.c +++ b/drivers/gpu/drm/radeon/r600_hdmi.c | |||
| @@ -57,15 +57,15 @@ enum r600_hdmi_iec_status_bits { | |||
| 57 | static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = { | 57 | static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = { |
| 58 | /* 32kHz 44.1kHz 48kHz */ | 58 | /* 32kHz 44.1kHz 48kHz */ |
| 59 | /* Clock N CTS N CTS N CTS */ | 59 | /* Clock N CTS N CTS N CTS */ |
| 60 | { 25174, 4576, 28125, 7007, 31250, 6864, 28125 }, /* 25,20/1.001 MHz */ | 60 | { 25175, 4576, 28125, 7007, 31250, 6864, 28125 }, /* 25,20/1.001 MHz */ |
| 61 | { 25200, 4096, 25200, 6272, 28000, 6144, 25200 }, /* 25.20 MHz */ | 61 | { 25200, 4096, 25200, 6272, 28000, 6144, 25200 }, /* 25.20 MHz */ |
| 62 | { 27000, 4096, 27000, 6272, 30000, 6144, 27000 }, /* 27.00 MHz */ | 62 | { 27000, 4096, 27000, 6272, 30000, 6144, 27000 }, /* 27.00 MHz */ |
| 63 | { 27027, 4096, 27027, 6272, 30030, 6144, 27027 }, /* 27.00*1.001 MHz */ | 63 | { 27027, 4096, 27027, 6272, 30030, 6144, 27027 }, /* 27.00*1.001 MHz */ |
| 64 | { 54000, 4096, 54000, 6272, 60000, 6144, 54000 }, /* 54.00 MHz */ | 64 | { 54000, 4096, 54000, 6272, 60000, 6144, 54000 }, /* 54.00 MHz */ |
| 65 | { 54054, 4096, 54054, 6272, 60060, 6144, 54054 }, /* 54.00*1.001 MHz */ | 65 | { 54054, 4096, 54054, 6272, 60060, 6144, 54054 }, /* 54.00*1.001 MHz */ |
| 66 | { 74175, 11648, 210937, 17836, 234375, 11648, 140625 }, /* 74.25/1.001 MHz */ | 66 | { 74176, 11648, 210937, 17836, 234375, 11648, 140625 }, /* 74.25/1.001 MHz */ |
| 67 | { 74250, 4096, 74250, 6272, 82500, 6144, 74250 }, /* 74.25 MHz */ | 67 | { 74250, 4096, 74250, 6272, 82500, 6144, 74250 }, /* 74.25 MHz */ |
| 68 | { 148351, 11648, 421875, 8918, 234375, 5824, 140625 }, /* 148.50/1.001 MHz */ | 68 | { 148352, 11648, 421875, 8918, 234375, 5824, 140625 }, /* 148.50/1.001 MHz */ |
| 69 | { 148500, 4096, 148500, 6272, 165000, 6144, 148500 }, /* 148.50 MHz */ | 69 | { 148500, 4096, 148500, 6272, 165000, 6144, 148500 }, /* 148.50 MHz */ |
| 70 | { 0, 4096, 0, 6272, 0, 6144, 0 } /* Other */ | 70 | { 0, 4096, 0, 6272, 0, 6144, 0 } /* Other */ |
| 71 | }; | 71 | }; |
| @@ -75,8 +75,15 @@ static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = { | |||
| 75 | */ | 75 | */ |
| 76 | static void r600_hdmi_calc_cts(uint32_t clock, int *CTS, int N, int freq) | 76 | static void r600_hdmi_calc_cts(uint32_t clock, int *CTS, int N, int freq) |
| 77 | { | 77 | { |
| 78 | if (*CTS == 0) | 78 | u64 n; |
| 79 | *CTS = clock * N / (128 * freq) * 1000; | 79 | u32 d; |
| 80 | |||
| 81 | if (*CTS == 0) { | ||
| 82 | n = (u64)clock * (u64)N * 1000ULL; | ||
| 83 | d = 128 * freq; | ||
| 84 | do_div(n, d); | ||
| 85 | *CTS = n; | ||
| 86 | } | ||
| 80 | DRM_DEBUG("Using ACR timing N=%d CTS=%d for frequency %d\n", | 87 | DRM_DEBUG("Using ACR timing N=%d CTS=%d for frequency %d\n", |
| 81 | N, *CTS, freq); | 88 | N, *CTS, freq); |
| 82 | } | 89 | } |
| @@ -444,8 +451,8 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod | |||
| 444 | } | 451 | } |
| 445 | 452 | ||
| 446 | WREG32(HDMI0_ACR_PACKET_CONTROL + offset, | 453 | WREG32(HDMI0_ACR_PACKET_CONTROL + offset, |
| 447 | HDMI0_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */ | 454 | HDMI0_ACR_SOURCE | /* select SW CTS value - XXX verify that hw CTS works on all families */ |
| 448 | HDMI0_ACR_SOURCE); /* select SW CTS value */ | 455 | HDMI0_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */ |
| 449 | 456 | ||
| 450 | WREG32(HDMI0_VBI_PACKET_CONTROL + offset, | 457 | WREG32(HDMI0_VBI_PACKET_CONTROL + offset, |
| 451 | HDMI0_NULL_SEND | /* send null packets when required */ | 458 | HDMI0_NULL_SEND | /* send null packets when required */ |
diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h index e673fe26ea84..7b3c7b5932c5 100644 --- a/drivers/gpu/drm/radeon/r600d.h +++ b/drivers/gpu/drm/radeon/r600d.h | |||
| @@ -1523,7 +1523,7 @@ | |||
| 1523 | */ | 1523 | */ |
| 1524 | # define PACKET3_CP_DMA_CP_SYNC (1 << 31) | 1524 | # define PACKET3_CP_DMA_CP_SYNC (1 << 31) |
| 1525 | /* COMMAND */ | 1525 | /* COMMAND */ |
| 1526 | # define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 23) | 1526 | # define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22) |
| 1527 | /* 0 - none | 1527 | /* 0 - none |
| 1528 | * 1 - 8 in 16 | 1528 | * 1 - 8 in 16 |
| 1529 | * 2 - 8 in 32 | 1529 | * 2 - 8 in 32 |
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index ac07ad1d4f8c..4f6b7fc7ad3c 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
| @@ -945,6 +945,8 @@ void radeon_dpm_enable_uvd(struct radeon_device *rdev, bool enable) | |||
| 945 | if (enable) { | 945 | if (enable) { |
| 946 | mutex_lock(&rdev->pm.mutex); | 946 | mutex_lock(&rdev->pm.mutex); |
| 947 | rdev->pm.dpm.uvd_active = true; | 947 | rdev->pm.dpm.uvd_active = true; |
| 948 | /* disable this for now */ | ||
| 949 | #if 0 | ||
| 948 | if ((rdev->pm.dpm.sd == 1) && (rdev->pm.dpm.hd == 0)) | 950 | if ((rdev->pm.dpm.sd == 1) && (rdev->pm.dpm.hd == 0)) |
| 949 | dpm_state = POWER_STATE_TYPE_INTERNAL_UVD_SD; | 951 | dpm_state = POWER_STATE_TYPE_INTERNAL_UVD_SD; |
| 950 | else if ((rdev->pm.dpm.sd == 2) && (rdev->pm.dpm.hd == 0)) | 952 | else if ((rdev->pm.dpm.sd == 2) && (rdev->pm.dpm.hd == 0)) |
| @@ -954,6 +956,7 @@ void radeon_dpm_enable_uvd(struct radeon_device *rdev, bool enable) | |||
| 954 | else if ((rdev->pm.dpm.sd == 0) && (rdev->pm.dpm.hd == 2)) | 956 | else if ((rdev->pm.dpm.sd == 0) && (rdev->pm.dpm.hd == 2)) |
| 955 | dpm_state = POWER_STATE_TYPE_INTERNAL_UVD_HD2; | 957 | dpm_state = POWER_STATE_TYPE_INTERNAL_UVD_HD2; |
| 956 | else | 958 | else |
| 959 | #endif | ||
| 957 | dpm_state = POWER_STATE_TYPE_INTERNAL_UVD; | 960 | dpm_state = POWER_STATE_TYPE_INTERNAL_UVD; |
| 958 | rdev->pm.dpm.state = dpm_state; | 961 | rdev->pm.dpm.state = dpm_state; |
| 959 | mutex_unlock(&rdev->pm.mutex); | 962 | mutex_unlock(&rdev->pm.mutex); |
diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c index f4d6bcee9006..12e8099a0823 100644 --- a/drivers/gpu/drm/radeon/radeon_test.c +++ b/drivers/gpu/drm/radeon/radeon_test.c | |||
| @@ -36,8 +36,8 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag) | |||
| 36 | struct radeon_bo *vram_obj = NULL; | 36 | struct radeon_bo *vram_obj = NULL; |
| 37 | struct radeon_bo **gtt_obj = NULL; | 37 | struct radeon_bo **gtt_obj = NULL; |
| 38 | uint64_t gtt_addr, vram_addr; | 38 | uint64_t gtt_addr, vram_addr; |
| 39 | unsigned i, n, size; | 39 | unsigned n, size; |
| 40 | int r, ring; | 40 | int i, r, ring; |
| 41 | 41 | ||
| 42 | switch (flag) { | 42 | switch (flag) { |
| 43 | case RADEON_TEST_COPY_DMA: | 43 | case RADEON_TEST_COPY_DMA: |
diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c index a0f11856ddde..4f2e73f79638 100644 --- a/drivers/gpu/drm/radeon/radeon_uvd.c +++ b/drivers/gpu/drm/radeon/radeon_uvd.c | |||
| @@ -798,7 +798,8 @@ void radeon_uvd_note_usage(struct radeon_device *rdev) | |||
| 798 | (rdev->pm.dpm.hd != hd)) { | 798 | (rdev->pm.dpm.hd != hd)) { |
| 799 | rdev->pm.dpm.sd = sd; | 799 | rdev->pm.dpm.sd = sd; |
| 800 | rdev->pm.dpm.hd = hd; | 800 | rdev->pm.dpm.hd = hd; |
| 801 | streams_changed = true; | 801 | /* disable this for now */ |
| 802 | /*streams_changed = true;*/ | ||
| 802 | } | 803 | } |
| 803 | } | 804 | } |
| 804 | 805 | ||
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index c354c1094967..d4652af425b8 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
| @@ -85,6 +85,9 @@ extern void si_dma_vm_set_page(struct radeon_device *rdev, | |||
| 85 | uint32_t incr, uint32_t flags); | 85 | uint32_t incr, uint32_t flags); |
| 86 | static void si_enable_gui_idle_interrupt(struct radeon_device *rdev, | 86 | static void si_enable_gui_idle_interrupt(struct radeon_device *rdev, |
| 87 | bool enable); | 87 | bool enable); |
| 88 | static void si_fini_pg(struct radeon_device *rdev); | ||
| 89 | static void si_fini_cg(struct radeon_device *rdev); | ||
| 90 | static void si_rlc_stop(struct radeon_device *rdev); | ||
| 88 | 91 | ||
| 89 | static const u32 verde_rlc_save_restore_register_list[] = | 92 | static const u32 verde_rlc_save_restore_register_list[] = |
| 90 | { | 93 | { |
| @@ -3608,6 +3611,13 @@ static void si_gpu_soft_reset(struct radeon_device *rdev, u32 reset_mask) | |||
| 3608 | dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", | 3611 | dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", |
| 3609 | RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS)); | 3612 | RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS)); |
| 3610 | 3613 | ||
| 3614 | /* disable PG/CG */ | ||
| 3615 | si_fini_pg(rdev); | ||
| 3616 | si_fini_cg(rdev); | ||
| 3617 | |||
| 3618 | /* stop the rlc */ | ||
| 3619 | si_rlc_stop(rdev); | ||
| 3620 | |||
| 3611 | /* Disable CP parsing/prefetching */ | 3621 | /* Disable CP parsing/prefetching */ |
| 3612 | WREG32(CP_ME_CNTL, CP_ME_HALT | CP_PFP_HALT | CP_CE_HALT); | 3622 | WREG32(CP_ME_CNTL, CP_ME_HALT | CP_PFP_HALT | CP_CE_HALT); |
| 3613 | 3623 | ||
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c index 9ace28702c76..2332aa1bf93c 100644 --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c | |||
| @@ -5208,7 +5208,7 @@ static int si_set_mc_special_registers(struct radeon_device *rdev, | |||
| 5208 | table->mc_reg_table_entry[k].mc_data[j] |= 0x100; | 5208 | table->mc_reg_table_entry[k].mc_data[j] |= 0x100; |
| 5209 | } | 5209 | } |
| 5210 | j++; | 5210 | j++; |
| 5211 | if (j > SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE) | 5211 | if (j >= SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE) |
| 5212 | return -EINVAL; | 5212 | return -EINVAL; |
| 5213 | 5213 | ||
| 5214 | if (!pi->mem_gddr5) { | 5214 | if (!pi->mem_gddr5) { |
| @@ -5218,7 +5218,7 @@ static int si_set_mc_special_registers(struct radeon_device *rdev, | |||
| 5218 | table->mc_reg_table_entry[k].mc_data[j] = | 5218 | table->mc_reg_table_entry[k].mc_data[j] = |
| 5219 | (table->mc_reg_table_entry[k].mc_data[i] & 0xffff0000) >> 16; | 5219 | (table->mc_reg_table_entry[k].mc_data[i] & 0xffff0000) >> 16; |
| 5220 | j++; | 5220 | j++; |
| 5221 | if (j > SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE) | 5221 | if (j >= SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE) |
| 5222 | return -EINVAL; | 5222 | return -EINVAL; |
| 5223 | } | 5223 | } |
| 5224 | break; | 5224 | break; |
| @@ -5231,7 +5231,7 @@ static int si_set_mc_special_registers(struct radeon_device *rdev, | |||
| 5231 | (temp_reg & 0xffff0000) | | 5231 | (temp_reg & 0xffff0000) | |
| 5232 | (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff); | 5232 | (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff); |
| 5233 | j++; | 5233 | j++; |
| 5234 | if (j > SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE) | 5234 | if (j >= SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE) |
| 5235 | return -EINVAL; | 5235 | return -EINVAL; |
| 5236 | break; | 5236 | break; |
| 5237 | default: | 5237 | default: |
diff --git a/drivers/gpu/drm/radeon/sid.h b/drivers/gpu/drm/radeon/sid.h index 52d2ab6b67a0..7e2e0ea66a00 100644 --- a/drivers/gpu/drm/radeon/sid.h +++ b/drivers/gpu/drm/radeon/sid.h | |||
| @@ -1553,7 +1553,7 @@ | |||
| 1553 | * 6. COMMAND [30:21] | BYTE_COUNT [20:0] | 1553 | * 6. COMMAND [30:21] | BYTE_COUNT [20:0] |
| 1554 | */ | 1554 | */ |
| 1555 | # define PACKET3_CP_DMA_DST_SEL(x) ((x) << 20) | 1555 | # define PACKET3_CP_DMA_DST_SEL(x) ((x) << 20) |
| 1556 | /* 0 - SRC_ADDR | 1556 | /* 0 - DST_ADDR |
| 1557 | * 1 - GDS | 1557 | * 1 - GDS |
| 1558 | */ | 1558 | */ |
| 1559 | # define PACKET3_CP_DMA_ENGINE(x) ((x) << 27) | 1559 | # define PACKET3_CP_DMA_ENGINE(x) ((x) << 27) |
| @@ -1568,7 +1568,7 @@ | |||
| 1568 | # define PACKET3_CP_DMA_CP_SYNC (1 << 31) | 1568 | # define PACKET3_CP_DMA_CP_SYNC (1 << 31) |
| 1569 | /* COMMAND */ | 1569 | /* COMMAND */ |
| 1570 | # define PACKET3_CP_DMA_DIS_WC (1 << 21) | 1570 | # define PACKET3_CP_DMA_DIS_WC (1 << 21) |
| 1571 | # define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 23) | 1571 | # define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22) |
| 1572 | /* 0 - none | 1572 | /* 0 - none |
| 1573 | * 1 - 8 in 16 | 1573 | * 1 - 8 in 16 |
| 1574 | * 2 - 8 in 32 | 1574 | * 2 - 8 in 32 |
diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c index 7f998bf1cc9d..9364129ba292 100644 --- a/drivers/gpu/drm/radeon/trinity_dpm.c +++ b/drivers/gpu/drm/radeon/trinity_dpm.c | |||
| @@ -1868,7 +1868,7 @@ int trinity_dpm_init(struct radeon_device *rdev) | |||
| 1868 | for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) | 1868 | for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) |
| 1869 | pi->at[i] = TRINITY_AT_DFLT; | 1869 | pi->at[i] = TRINITY_AT_DFLT; |
| 1870 | 1870 | ||
| 1871 | pi->enable_bapm = true; | 1871 | pi->enable_bapm = false; |
| 1872 | pi->enable_nbps_policy = true; | 1872 | pi->enable_nbps_policy = true; |
| 1873 | pi->enable_sclk_ds = true; | 1873 | pi->enable_sclk_ds = true; |
| 1874 | pi->enable_gfx_power_gating = true; | 1874 | pi->enable_gfx_power_gating = true; |
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 71b70e3a7a71..c91d547191dd 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
| @@ -241,6 +241,7 @@ config HID_HOLTEK | |||
| 241 | - Sharkoon Drakonia / Perixx MX-2000 gaming mice | 241 | - Sharkoon Drakonia / Perixx MX-2000 gaming mice |
| 242 | - Tracer Sniper TRM-503 / NOVA Gaming Slider X200 / | 242 | - Tracer Sniper TRM-503 / NOVA Gaming Slider X200 / |
| 243 | Zalman ZM-GM1 | 243 | Zalman ZM-GM1 |
| 244 | - SHARKOON DarkGlider Gaming mouse | ||
| 244 | 245 | ||
| 245 | config HOLTEK_FF | 246 | config HOLTEK_FF |
| 246 | bool "Holtek On Line Grip force feedback support" | 247 | bool "Holtek On Line Grip force feedback support" |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index b8470b1a10fe..5a8c01112a23 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
| @@ -1715,6 +1715,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
| 1715 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) }, | 1715 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) }, |
| 1716 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A) }, | 1716 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A) }, |
| 1717 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) }, | 1717 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) }, |
| 1718 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) }, | ||
| 1718 | { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_580) }, | 1719 | { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_580) }, |
| 1719 | { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) }, | 1720 | { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) }, |
| 1720 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, | 1721 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, |
diff --git a/drivers/hid/hid-holtek-mouse.c b/drivers/hid/hid-holtek-mouse.c index 7e6db3cf46f9..e696566cde46 100644 --- a/drivers/hid/hid-holtek-mouse.c +++ b/drivers/hid/hid-holtek-mouse.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | * - USB ID 04d9:a067, sold as Sharkoon Drakonia and Perixx MX-2000 | 27 | * - USB ID 04d9:a067, sold as Sharkoon Drakonia and Perixx MX-2000 |
| 28 | * - USB ID 04d9:a04a, sold as Tracer Sniper TRM-503, NOVA Gaming Slider X200 | 28 | * - USB ID 04d9:a04a, sold as Tracer Sniper TRM-503, NOVA Gaming Slider X200 |
| 29 | * and Zalman ZM-GM1 | 29 | * and Zalman ZM-GM1 |
| 30 | * - USB ID 04d9:a081, sold as SHARKOON DarkGlider Gaming mouse | ||
| 30 | */ | 31 | */ |
| 31 | 32 | ||
| 32 | static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, | 33 | static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
| @@ -46,6 +47,7 @@ static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
| 46 | } | 47 | } |
| 47 | break; | 48 | break; |
| 48 | case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A: | 49 | case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A: |
| 50 | case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081: | ||
| 49 | if (*rsize >= 113 && rdesc[106] == 0xff && rdesc[107] == 0x7f | 51 | if (*rsize >= 113 && rdesc[106] == 0xff && rdesc[107] == 0x7f |
| 50 | && rdesc[111] == 0xff && rdesc[112] == 0x7f) { | 52 | && rdesc[111] == 0xff && rdesc[112] == 0x7f) { |
| 51 | hid_info(hdev, "Fixing up report descriptor\n"); | 53 | hid_info(hdev, "Fixing up report descriptor\n"); |
| @@ -63,6 +65,8 @@ static const struct hid_device_id holtek_mouse_devices[] = { | |||
| 63 | USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) }, | 65 | USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) }, |
| 64 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, | 66 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, |
| 65 | USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A) }, | 67 | USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A) }, |
| 68 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, | ||
| 69 | USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) }, | ||
| 66 | { } | 70 | { } |
| 67 | }; | 71 | }; |
| 68 | MODULE_DEVICE_TABLE(hid, holtek_mouse_devices); | 72 | MODULE_DEVICE_TABLE(hid, holtek_mouse_devices); |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index e60e8d530697..9cbc7ab07dfa 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
| @@ -450,6 +450,7 @@ | |||
| 450 | #define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD 0xa055 | 450 | #define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD 0xa055 |
| 451 | #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067 0xa067 | 451 | #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067 0xa067 |
| 452 | #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A 0xa04a | 452 | #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A 0xa04a |
| 453 | #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081 0xa081 | ||
| 453 | 454 | ||
| 454 | #define USB_VENDOR_ID_IMATION 0x0718 | 455 | #define USB_VENDOR_ID_IMATION 0x0718 |
| 455 | #define USB_DEVICE_ID_DISC_STAKKA 0xd000 | 456 | #define USB_DEVICE_ID_DISC_STAKKA 0xd000 |
diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index 602c188e9d86..6101816a7ddd 100644 --- a/drivers/hid/hid-roccat-kone.c +++ b/drivers/hid/hid-roccat-kone.c | |||
| @@ -382,7 +382,7 @@ static ssize_t kone_sysfs_write_profilex(struct file *fp, | |||
| 382 | } | 382 | } |
| 383 | #define PROFILE_ATTR(number) \ | 383 | #define PROFILE_ATTR(number) \ |
| 384 | static struct bin_attribute bin_attr_profile##number = { \ | 384 | static struct bin_attribute bin_attr_profile##number = { \ |
| 385 | .attr = { .name = "profile##number", .mode = 0660 }, \ | 385 | .attr = { .name = "profile" #number, .mode = 0660 }, \ |
| 386 | .size = sizeof(struct kone_profile), \ | 386 | .size = sizeof(struct kone_profile), \ |
| 387 | .read = kone_sysfs_read_profilex, \ | 387 | .read = kone_sysfs_read_profilex, \ |
| 388 | .write = kone_sysfs_write_profilex, \ | 388 | .write = kone_sysfs_write_profilex, \ |
diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index 5ddf605b6b89..5e99fcdc71b9 100644 --- a/drivers/hid/hid-roccat-koneplus.c +++ b/drivers/hid/hid-roccat-koneplus.c | |||
| @@ -229,13 +229,13 @@ static ssize_t koneplus_sysfs_read_profilex_buttons(struct file *fp, | |||
| 229 | 229 | ||
| 230 | #define PROFILE_ATTR(number) \ | 230 | #define PROFILE_ATTR(number) \ |
| 231 | static struct bin_attribute bin_attr_profile##number##_settings = { \ | 231 | static struct bin_attribute bin_attr_profile##number##_settings = { \ |
| 232 | .attr = { .name = "profile##number##_settings", .mode = 0440 }, \ | 232 | .attr = { .name = "profile" #number "_settings", .mode = 0440 }, \ |
| 233 | .size = KONEPLUS_SIZE_PROFILE_SETTINGS, \ | 233 | .size = KONEPLUS_SIZE_PROFILE_SETTINGS, \ |
| 234 | .read = koneplus_sysfs_read_profilex_settings, \ | 234 | .read = koneplus_sysfs_read_profilex_settings, \ |
| 235 | .private = &profile_numbers[number-1], \ | 235 | .private = &profile_numbers[number-1], \ |
| 236 | }; \ | 236 | }; \ |
| 237 | static struct bin_attribute bin_attr_profile##number##_buttons = { \ | 237 | static struct bin_attribute bin_attr_profile##number##_buttons = { \ |
| 238 | .attr = { .name = "profile##number##_buttons", .mode = 0440 }, \ | 238 | .attr = { .name = "profile" #number "_buttons", .mode = 0440 }, \ |
| 239 | .size = KONEPLUS_SIZE_PROFILE_BUTTONS, \ | 239 | .size = KONEPLUS_SIZE_PROFILE_BUTTONS, \ |
| 240 | .read = koneplus_sysfs_read_profilex_buttons, \ | 240 | .read = koneplus_sysfs_read_profilex_buttons, \ |
| 241 | .private = &profile_numbers[number-1], \ | 241 | .private = &profile_numbers[number-1], \ |
diff --git a/drivers/hid/hid-roccat-kovaplus.c b/drivers/hid/hid-roccat-kovaplus.c index 515bc03136c0..0c8e1ef0b67d 100644 --- a/drivers/hid/hid-roccat-kovaplus.c +++ b/drivers/hid/hid-roccat-kovaplus.c | |||
| @@ -257,13 +257,13 @@ static ssize_t kovaplus_sysfs_read_profilex_buttons(struct file *fp, | |||
| 257 | 257 | ||
| 258 | #define PROFILE_ATTR(number) \ | 258 | #define PROFILE_ATTR(number) \ |
| 259 | static struct bin_attribute bin_attr_profile##number##_settings = { \ | 259 | static struct bin_attribute bin_attr_profile##number##_settings = { \ |
| 260 | .attr = { .name = "profile##number##_settings", .mode = 0440 }, \ | 260 | .attr = { .name = "profile" #number "_settings", .mode = 0440 }, \ |
| 261 | .size = KOVAPLUS_SIZE_PROFILE_SETTINGS, \ | 261 | .size = KOVAPLUS_SIZE_PROFILE_SETTINGS, \ |
| 262 | .read = kovaplus_sysfs_read_profilex_settings, \ | 262 | .read = kovaplus_sysfs_read_profilex_settings, \ |
| 263 | .private = &profile_numbers[number-1], \ | 263 | .private = &profile_numbers[number-1], \ |
| 264 | }; \ | 264 | }; \ |
| 265 | static struct bin_attribute bin_attr_profile##number##_buttons = { \ | 265 | static struct bin_attribute bin_attr_profile##number##_buttons = { \ |
| 266 | .attr = { .name = "profile##number##_buttons", .mode = 0440 }, \ | 266 | .attr = { .name = "profile" #number "_buttons", .mode = 0440 }, \ |
| 267 | .size = KOVAPLUS_SIZE_PROFILE_BUTTONS, \ | 267 | .size = KOVAPLUS_SIZE_PROFILE_BUTTONS, \ |
| 268 | .read = kovaplus_sysfs_read_profilex_buttons, \ | 268 | .read = kovaplus_sysfs_read_profilex_buttons, \ |
| 269 | .private = &profile_numbers[number-1], \ | 269 | .private = &profile_numbers[number-1], \ |
diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c index 5a6dbbeee790..1a07e07d99a0 100644 --- a/drivers/hid/hid-roccat-pyra.c +++ b/drivers/hid/hid-roccat-pyra.c | |||
| @@ -225,13 +225,13 @@ static ssize_t pyra_sysfs_read_profilex_buttons(struct file *fp, | |||
| 225 | 225 | ||
| 226 | #define PROFILE_ATTR(number) \ | 226 | #define PROFILE_ATTR(number) \ |
| 227 | static struct bin_attribute bin_attr_profile##number##_settings = { \ | 227 | static struct bin_attribute bin_attr_profile##number##_settings = { \ |
| 228 | .attr = { .name = "profile##number##_settings", .mode = 0440 }, \ | 228 | .attr = { .name = "profile" #number "_settings", .mode = 0440 }, \ |
| 229 | .size = PYRA_SIZE_PROFILE_SETTINGS, \ | 229 | .size = PYRA_SIZE_PROFILE_SETTINGS, \ |
| 230 | .read = pyra_sysfs_read_profilex_settings, \ | 230 | .read = pyra_sysfs_read_profilex_settings, \ |
| 231 | .private = &profile_numbers[number-1], \ | 231 | .private = &profile_numbers[number-1], \ |
| 232 | }; \ | 232 | }; \ |
| 233 | static struct bin_attribute bin_attr_profile##number##_buttons = { \ | 233 | static struct bin_attribute bin_attr_profile##number##_buttons = { \ |
| 234 | .attr = { .name = "profile##number##_buttons", .mode = 0440 }, \ | 234 | .attr = { .name = "profile" #number "_buttons", .mode = 0440 }, \ |
| 235 | .size = PYRA_SIZE_PROFILE_BUTTONS, \ | 235 | .size = PYRA_SIZE_PROFILE_BUTTONS, \ |
| 236 | .read = pyra_sysfs_read_profilex_buttons, \ | 236 | .read = pyra_sysfs_read_profilex_buttons, \ |
| 237 | .private = &profile_numbers[number-1], \ | 237 | .private = &profile_numbers[number-1], \ |
diff --git a/drivers/hid/hid-wiimote-modules.c b/drivers/hid/hid-wiimote-modules.c index 2e7d644dba18..71adf9e60b13 100644 --- a/drivers/hid/hid-wiimote-modules.c +++ b/drivers/hid/hid-wiimote-modules.c | |||
| @@ -119,12 +119,22 @@ static const struct wiimod_ops wiimod_keys = { | |||
| 119 | * the rumble motor, this flag shouldn't be set. | 119 | * the rumble motor, this flag shouldn't be set. |
| 120 | */ | 120 | */ |
| 121 | 121 | ||
| 122 | /* used by wiimod_rumble and wiipro_rumble */ | ||
| 123 | static void wiimod_rumble_worker(struct work_struct *work) | ||
| 124 | { | ||
| 125 | struct wiimote_data *wdata = container_of(work, struct wiimote_data, | ||
| 126 | rumble_worker); | ||
| 127 | |||
| 128 | spin_lock_irq(&wdata->state.lock); | ||
| 129 | wiiproto_req_rumble(wdata, wdata->state.cache_rumble); | ||
| 130 | spin_unlock_irq(&wdata->state.lock); | ||
| 131 | } | ||
| 132 | |||
| 122 | static int wiimod_rumble_play(struct input_dev *dev, void *data, | 133 | static int wiimod_rumble_play(struct input_dev *dev, void *data, |
| 123 | struct ff_effect *eff) | 134 | struct ff_effect *eff) |
| 124 | { | 135 | { |
| 125 | struct wiimote_data *wdata = input_get_drvdata(dev); | 136 | struct wiimote_data *wdata = input_get_drvdata(dev); |
| 126 | __u8 value; | 137 | __u8 value; |
| 127 | unsigned long flags; | ||
| 128 | 138 | ||
| 129 | /* | 139 | /* |
| 130 | * The wiimote supports only a single rumble motor so if any magnitude | 140 | * The wiimote supports only a single rumble motor so if any magnitude |
| @@ -137,9 +147,10 @@ static int wiimod_rumble_play(struct input_dev *dev, void *data, | |||
| 137 | else | 147 | else |
| 138 | value = 0; | 148 | value = 0; |
| 139 | 149 | ||
| 140 | spin_lock_irqsave(&wdata->state.lock, flags); | 150 | /* Locking state.lock here might deadlock with input_event() calls. |
| 141 | wiiproto_req_rumble(wdata, value); | 151 | * schedule_work acts as barrier. Merging multiple changes is fine. */ |
| 142 | spin_unlock_irqrestore(&wdata->state.lock, flags); | 152 | wdata->state.cache_rumble = value; |
| 153 | schedule_work(&wdata->rumble_worker); | ||
| 143 | 154 | ||
| 144 | return 0; | 155 | return 0; |
| 145 | } | 156 | } |
| @@ -147,6 +158,8 @@ static int wiimod_rumble_play(struct input_dev *dev, void *data, | |||
| 147 | static int wiimod_rumble_probe(const struct wiimod_ops *ops, | 158 | static int wiimod_rumble_probe(const struct wiimod_ops *ops, |
| 148 | struct wiimote_data *wdata) | 159 | struct wiimote_data *wdata) |
| 149 | { | 160 | { |
| 161 | INIT_WORK(&wdata->rumble_worker, wiimod_rumble_worker); | ||
| 162 | |||
| 150 | set_bit(FF_RUMBLE, wdata->input->ffbit); | 163 | set_bit(FF_RUMBLE, wdata->input->ffbit); |
| 151 | if (input_ff_create_memless(wdata->input, NULL, wiimod_rumble_play)) | 164 | if (input_ff_create_memless(wdata->input, NULL, wiimod_rumble_play)) |
| 152 | return -ENOMEM; | 165 | return -ENOMEM; |
| @@ -159,6 +172,8 @@ static void wiimod_rumble_remove(const struct wiimod_ops *ops, | |||
| 159 | { | 172 | { |
| 160 | unsigned long flags; | 173 | unsigned long flags; |
| 161 | 174 | ||
| 175 | cancel_work_sync(&wdata->rumble_worker); | ||
| 176 | |||
| 162 | spin_lock_irqsave(&wdata->state.lock, flags); | 177 | spin_lock_irqsave(&wdata->state.lock, flags); |
| 163 | wiiproto_req_rumble(wdata, 0); | 178 | wiiproto_req_rumble(wdata, 0); |
| 164 | spin_unlock_irqrestore(&wdata->state.lock, flags); | 179 | spin_unlock_irqrestore(&wdata->state.lock, flags); |
| @@ -1731,7 +1746,6 @@ static int wiimod_pro_play(struct input_dev *dev, void *data, | |||
| 1731 | { | 1746 | { |
| 1732 | struct wiimote_data *wdata = input_get_drvdata(dev); | 1747 | struct wiimote_data *wdata = input_get_drvdata(dev); |
| 1733 | __u8 value; | 1748 | __u8 value; |
| 1734 | unsigned long flags; | ||
| 1735 | 1749 | ||
| 1736 | /* | 1750 | /* |
| 1737 | * The wiimote supports only a single rumble motor so if any magnitude | 1751 | * The wiimote supports only a single rumble motor so if any magnitude |
| @@ -1744,9 +1758,10 @@ static int wiimod_pro_play(struct input_dev *dev, void *data, | |||
| 1744 | else | 1758 | else |
| 1745 | value = 0; | 1759 | value = 0; |
| 1746 | 1760 | ||
| 1747 | spin_lock_irqsave(&wdata->state.lock, flags); | 1761 | /* Locking state.lock here might deadlock with input_event() calls. |
| 1748 | wiiproto_req_rumble(wdata, value); | 1762 | * schedule_work acts as barrier. Merging multiple changes is fine. */ |
| 1749 | spin_unlock_irqrestore(&wdata->state.lock, flags); | 1763 | wdata->state.cache_rumble = value; |
| 1764 | schedule_work(&wdata->rumble_worker); | ||
| 1750 | 1765 | ||
| 1751 | return 0; | 1766 | return 0; |
| 1752 | } | 1767 | } |
| @@ -1756,6 +1771,8 @@ static int wiimod_pro_probe(const struct wiimod_ops *ops, | |||
| 1756 | { | 1771 | { |
| 1757 | int ret, i; | 1772 | int ret, i; |
| 1758 | 1773 | ||
| 1774 | INIT_WORK(&wdata->rumble_worker, wiimod_rumble_worker); | ||
| 1775 | |||
| 1759 | wdata->extension.input = input_allocate_device(); | 1776 | wdata->extension.input = input_allocate_device(); |
| 1760 | if (!wdata->extension.input) | 1777 | if (!wdata->extension.input) |
| 1761 | return -ENOMEM; | 1778 | return -ENOMEM; |
| @@ -1817,12 +1834,13 @@ static void wiimod_pro_remove(const struct wiimod_ops *ops, | |||
| 1817 | if (!wdata->extension.input) | 1834 | if (!wdata->extension.input) |
| 1818 | return; | 1835 | return; |
| 1819 | 1836 | ||
| 1837 | input_unregister_device(wdata->extension.input); | ||
| 1838 | wdata->extension.input = NULL; | ||
| 1839 | cancel_work_sync(&wdata->rumble_worker); | ||
| 1840 | |||
| 1820 | spin_lock_irqsave(&wdata->state.lock, flags); | 1841 | spin_lock_irqsave(&wdata->state.lock, flags); |
| 1821 | wiiproto_req_rumble(wdata, 0); | 1842 | wiiproto_req_rumble(wdata, 0); |
| 1822 | spin_unlock_irqrestore(&wdata->state.lock, flags); | 1843 | spin_unlock_irqrestore(&wdata->state.lock, flags); |
| 1823 | |||
| 1824 | input_unregister_device(wdata->extension.input); | ||
| 1825 | wdata->extension.input = NULL; | ||
| 1826 | } | 1844 | } |
| 1827 | 1845 | ||
| 1828 | static const struct wiimod_ops wiimod_pro = { | 1846 | static const struct wiimod_ops wiimod_pro = { |
diff --git a/drivers/hid/hid-wiimote.h b/drivers/hid/hid-wiimote.h index f1474f372c0b..75db0c400037 100644 --- a/drivers/hid/hid-wiimote.h +++ b/drivers/hid/hid-wiimote.h | |||
| @@ -133,13 +133,15 @@ struct wiimote_state { | |||
| 133 | __u8 *cmd_read_buf; | 133 | __u8 *cmd_read_buf; |
| 134 | __u8 cmd_read_size; | 134 | __u8 cmd_read_size; |
| 135 | 135 | ||
| 136 | /* calibration data */ | 136 | /* calibration/cache data */ |
| 137 | __u16 calib_bboard[4][3]; | 137 | __u16 calib_bboard[4][3]; |
| 138 | __u8 cache_rumble; | ||
| 138 | }; | 139 | }; |
| 139 | 140 | ||
| 140 | struct wiimote_data { | 141 | struct wiimote_data { |
| 141 | struct hid_device *hdev; | 142 | struct hid_device *hdev; |
| 142 | struct input_dev *input; | 143 | struct input_dev *input; |
| 144 | struct work_struct rumble_worker; | ||
| 143 | struct led_classdev *leds[4]; | 145 | struct led_classdev *leds[4]; |
| 144 | struct input_dev *accel; | 146 | struct input_dev *accel; |
| 145 | struct input_dev *ir; | 147 | struct input_dev *ir; |
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index 8918dd12bb69..6a6dd5cd7833 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c | |||
| @@ -308,18 +308,25 @@ static int hidraw_fasync(int fd, struct file *file, int on) | |||
| 308 | static void drop_ref(struct hidraw *hidraw, int exists_bit) | 308 | static void drop_ref(struct hidraw *hidraw, int exists_bit) |
| 309 | { | 309 | { |
| 310 | if (exists_bit) { | 310 | if (exists_bit) { |
| 311 | hid_hw_close(hidraw->hid); | ||
| 312 | hidraw->exist = 0; | 311 | hidraw->exist = 0; |
| 313 | if (hidraw->open) | 312 | if (hidraw->open) { |
| 313 | hid_hw_close(hidraw->hid); | ||
| 314 | wake_up_interruptible(&hidraw->wait); | 314 | wake_up_interruptible(&hidraw->wait); |
| 315 | } | ||
| 315 | } else { | 316 | } else { |
| 316 | --hidraw->open; | 317 | --hidraw->open; |
| 317 | } | 318 | } |
| 318 | 319 | if (!hidraw->open) { | |
| 319 | if (!hidraw->open && !hidraw->exist) { | 320 | if (!hidraw->exist) { |
| 320 | device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor)); | 321 | device_destroy(hidraw_class, |
| 321 | hidraw_table[hidraw->minor] = NULL; | 322 | MKDEV(hidraw_major, hidraw->minor)); |
| 322 | kfree(hidraw); | 323 | hidraw_table[hidraw->minor] = NULL; |
| 324 | kfree(hidraw); | ||
| 325 | } else { | ||
| 326 | /* close device for last reader */ | ||
| 327 | hid_hw_power(hidraw->hid, PM_HINT_NORMAL); | ||
| 328 | hid_hw_close(hidraw->hid); | ||
| 329 | } | ||
| 323 | } | 330 | } |
| 324 | } | 331 | } |
| 325 | 332 | ||
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 5bf2fb785844..93b00d76374c 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c | |||
| @@ -615,7 +615,7 @@ static const struct file_operations uhid_fops = { | |||
| 615 | 615 | ||
| 616 | static struct miscdevice uhid_misc = { | 616 | static struct miscdevice uhid_misc = { |
| 617 | .fops = &uhid_fops, | 617 | .fops = &uhid_fops, |
| 618 | .minor = MISC_DYNAMIC_MINOR, | 618 | .minor = UHID_MINOR, |
| 619 | .name = UHID_NAME, | 619 | .name = UHID_NAME, |
| 620 | }; | 620 | }; |
| 621 | 621 | ||
| @@ -634,4 +634,5 @@ module_exit(uhid_exit); | |||
| 634 | MODULE_LICENSE("GPL"); | 634 | MODULE_LICENSE("GPL"); |
| 635 | MODULE_AUTHOR("David Herrmann <dh.herrmann@gmail.com>"); | 635 | MODULE_AUTHOR("David Herrmann <dh.herrmann@gmail.com>"); |
| 636 | MODULE_DESCRIPTION("User-space I/O driver support for HID subsystem"); | 636 | MODULE_DESCRIPTION("User-space I/O driver support for HID subsystem"); |
| 637 | MODULE_ALIAS_MISCDEV(UHID_MINOR); | ||
| 637 | MODULE_ALIAS("devname:" UHID_NAME); | 638 | MODULE_ALIAS("devname:" UHID_NAME); |
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index 98814d12a604..3288f13d2d87 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
| @@ -230,6 +230,7 @@ static int send_argument(const char *key) | |||
| 230 | 230 | ||
| 231 | static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) | 231 | static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) |
| 232 | { | 232 | { |
| 233 | u8 status, data = 0; | ||
| 233 | int i; | 234 | int i; |
| 234 | 235 | ||
| 235 | if (send_command(cmd) || send_argument(key)) { | 236 | if (send_command(cmd) || send_argument(key)) { |
| @@ -237,6 +238,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) | |||
| 237 | return -EIO; | 238 | return -EIO; |
| 238 | } | 239 | } |
| 239 | 240 | ||
| 241 | /* This has no effect on newer (2012) SMCs */ | ||
| 240 | if (send_byte(len, APPLESMC_DATA_PORT)) { | 242 | if (send_byte(len, APPLESMC_DATA_PORT)) { |
| 241 | pr_warn("%.4s: read len fail\n", key); | 243 | pr_warn("%.4s: read len fail\n", key); |
| 242 | return -EIO; | 244 | return -EIO; |
| @@ -250,6 +252,17 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) | |||
| 250 | buffer[i] = inb(APPLESMC_DATA_PORT); | 252 | buffer[i] = inb(APPLESMC_DATA_PORT); |
| 251 | } | 253 | } |
| 252 | 254 | ||
| 255 | /* Read the data port until bit0 is cleared */ | ||
| 256 | for (i = 0; i < 16; i++) { | ||
| 257 | udelay(APPLESMC_MIN_WAIT); | ||
| 258 | status = inb(APPLESMC_CMD_PORT); | ||
| 259 | if (!(status & 0x01)) | ||
| 260 | break; | ||
| 261 | data = inb(APPLESMC_DATA_PORT); | ||
| 262 | } | ||
| 263 | if (i) | ||
| 264 | pr_warn("flushed %d bytes, last value is: %d\n", i, data); | ||
| 265 | |||
| 253 | return 0; | 266 | return 0; |
| 254 | } | 267 | } |
| 255 | 268 | ||
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 4c1b60539a25..0aa01136f8d9 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c | |||
| @@ -270,7 +270,8 @@ static SIMPLE_DEV_PM_OPS(dw_i2c_dev_pm_ops, dw_i2c_suspend, dw_i2c_resume); | |||
| 270 | MODULE_ALIAS("platform:i2c_designware"); | 270 | MODULE_ALIAS("platform:i2c_designware"); |
| 271 | 271 | ||
| 272 | static struct platform_driver dw_i2c_driver = { | 272 | static struct platform_driver dw_i2c_driver = { |
| 273 | .remove = dw_i2c_remove, | 273 | .probe = dw_i2c_probe, |
| 274 | .remove = dw_i2c_remove, | ||
| 274 | .driver = { | 275 | .driver = { |
| 275 | .name = "i2c_designware", | 276 | .name = "i2c_designware", |
| 276 | .owner = THIS_MODULE, | 277 | .owner = THIS_MODULE, |
| @@ -282,7 +283,7 @@ static struct platform_driver dw_i2c_driver = { | |||
| 282 | 283 | ||
| 283 | static int __init dw_i2c_init_driver(void) | 284 | static int __init dw_i2c_init_driver(void) |
| 284 | { | 285 | { |
| 285 | return platform_driver_probe(&dw_i2c_driver, dw_i2c_probe); | 286 | return platform_driver_register(&dw_i2c_driver); |
| 286 | } | 287 | } |
| 287 | subsys_initcall(dw_i2c_init_driver); | 288 | subsys_initcall(dw_i2c_init_driver); |
| 288 | 289 | ||
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index ccf46656bdad..1d7efa3169cd 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c | |||
| @@ -365,7 +365,7 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx) | |||
| 365 | clk_disable_unprepare(i2c_imx->clk); | 365 | clk_disable_unprepare(i2c_imx->clk); |
| 366 | } | 366 | } |
| 367 | 367 | ||
| 368 | static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, | 368 | static void i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, |
| 369 | unsigned int rate) | 369 | unsigned int rate) |
| 370 | { | 370 | { |
| 371 | struct imx_i2c_clk_pair *i2c_clk_div = i2c_imx->hwdata->clk_div; | 371 | struct imx_i2c_clk_pair *i2c_clk_div = i2c_imx->hwdata->clk_div; |
| @@ -589,7 +589,7 @@ static struct i2c_algorithm i2c_imx_algo = { | |||
| 589 | .functionality = i2c_imx_func, | 589 | .functionality = i2c_imx_func, |
| 590 | }; | 590 | }; |
| 591 | 591 | ||
| 592 | static int __init i2c_imx_probe(struct platform_device *pdev) | 592 | static int i2c_imx_probe(struct platform_device *pdev) |
| 593 | { | 593 | { |
| 594 | const struct of_device_id *of_id = of_match_device(i2c_imx_dt_ids, | 594 | const struct of_device_id *of_id = of_match_device(i2c_imx_dt_ids, |
| 595 | &pdev->dev); | 595 | &pdev->dev); |
| @@ -697,7 +697,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev) | |||
| 697 | return 0; /* Return OK */ | 697 | return 0; /* Return OK */ |
| 698 | } | 698 | } |
| 699 | 699 | ||
| 700 | static int __exit i2c_imx_remove(struct platform_device *pdev) | 700 | static int i2c_imx_remove(struct platform_device *pdev) |
| 701 | { | 701 | { |
| 702 | struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev); | 702 | struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev); |
| 703 | 703 | ||
| @@ -715,7 +715,8 @@ static int __exit i2c_imx_remove(struct platform_device *pdev) | |||
| 715 | } | 715 | } |
| 716 | 716 | ||
| 717 | static struct platform_driver i2c_imx_driver = { | 717 | static struct platform_driver i2c_imx_driver = { |
| 718 | .remove = __exit_p(i2c_imx_remove), | 718 | .probe = i2c_imx_probe, |
| 719 | .remove = i2c_imx_remove, | ||
| 719 | .driver = { | 720 | .driver = { |
| 720 | .name = DRIVER_NAME, | 721 | .name = DRIVER_NAME, |
| 721 | .owner = THIS_MODULE, | 722 | .owner = THIS_MODULE, |
| @@ -726,7 +727,7 @@ static struct platform_driver i2c_imx_driver = { | |||
| 726 | 727 | ||
| 727 | static int __init i2c_adap_imx_init(void) | 728 | static int __init i2c_adap_imx_init(void) |
| 728 | { | 729 | { |
| 729 | return platform_driver_probe(&i2c_imx_driver, i2c_imx_probe); | 730 | return platform_driver_register(&i2c_imx_driver); |
| 730 | } | 731 | } |
| 731 | subsys_initcall(i2c_adap_imx_init); | 732 | subsys_initcall(i2c_adap_imx_init); |
| 732 | 733 | ||
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index f4a01675fa71..b7c857774708 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c | |||
| @@ -780,12 +780,13 @@ static struct platform_driver mxs_i2c_driver = { | |||
| 780 | .owner = THIS_MODULE, | 780 | .owner = THIS_MODULE, |
| 781 | .of_match_table = mxs_i2c_dt_ids, | 781 | .of_match_table = mxs_i2c_dt_ids, |
| 782 | }, | 782 | }, |
| 783 | .probe = mxs_i2c_probe, | ||
| 783 | .remove = mxs_i2c_remove, | 784 | .remove = mxs_i2c_remove, |
| 784 | }; | 785 | }; |
| 785 | 786 | ||
| 786 | static int __init mxs_i2c_init(void) | 787 | static int __init mxs_i2c_init(void) |
| 787 | { | 788 | { |
| 788 | return platform_driver_probe(&mxs_i2c_driver, mxs_i2c_probe); | 789 | return platform_driver_register(&mxs_i2c_driver); |
| 789 | } | 790 | } |
| 790 | subsys_initcall(mxs_i2c_init); | 791 | subsys_initcall(mxs_i2c_init); |
| 791 | 792 | ||
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 6d8308d5dc4e..9967a6f9c2ff 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
| @@ -939,6 +939,9 @@ omap_i2c_isr_thread(int this_irq, void *dev_id) | |||
| 939 | /* | 939 | /* |
| 940 | * ProDB0017052: Clear ARDY bit twice | 940 | * ProDB0017052: Clear ARDY bit twice |
| 941 | */ | 941 | */ |
| 942 | if (stat & OMAP_I2C_STAT_ARDY) | ||
| 943 | omap_i2c_ack_stat(dev, OMAP_I2C_STAT_ARDY); | ||
| 944 | |||
| 942 | if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | | 945 | if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | |
| 943 | OMAP_I2C_STAT_AL)) { | 946 | OMAP_I2C_STAT_AL)) { |
| 944 | omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_RRDY | | 947 | omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_RRDY | |
diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c index f8f6f2e552db..04a17b9b38bb 100644 --- a/drivers/i2c/busses/i2c-stu300.c +++ b/drivers/i2c/busses/i2c-stu300.c | |||
| @@ -859,8 +859,7 @@ static const struct i2c_algorithm stu300_algo = { | |||
| 859 | .functionality = stu300_func, | 859 | .functionality = stu300_func, |
| 860 | }; | 860 | }; |
| 861 | 861 | ||
| 862 | static int __init | 862 | static int stu300_probe(struct platform_device *pdev) |
| 863 | stu300_probe(struct platform_device *pdev) | ||
| 864 | { | 863 | { |
| 865 | struct stu300_dev *dev; | 864 | struct stu300_dev *dev; |
| 866 | struct i2c_adapter *adap; | 865 | struct i2c_adapter *adap; |
| @@ -966,8 +965,7 @@ static SIMPLE_DEV_PM_OPS(stu300_pm, stu300_suspend, stu300_resume); | |||
| 966 | #define STU300_I2C_PM NULL | 965 | #define STU300_I2C_PM NULL |
| 967 | #endif | 966 | #endif |
| 968 | 967 | ||
| 969 | static int __exit | 968 | static int stu300_remove(struct platform_device *pdev) |
| 970 | stu300_remove(struct platform_device *pdev) | ||
| 971 | { | 969 | { |
| 972 | struct stu300_dev *dev = platform_get_drvdata(pdev); | 970 | struct stu300_dev *dev = platform_get_drvdata(pdev); |
| 973 | 971 | ||
| @@ -989,13 +987,14 @@ static struct platform_driver stu300_i2c_driver = { | |||
| 989 | .pm = STU300_I2C_PM, | 987 | .pm = STU300_I2C_PM, |
| 990 | .of_match_table = stu300_dt_match, | 988 | .of_match_table = stu300_dt_match, |
| 991 | }, | 989 | }, |
| 992 | .remove = __exit_p(stu300_remove), | 990 | .probe = stu300_probe, |
| 991 | .remove = stu300_remove, | ||
| 993 | 992 | ||
| 994 | }; | 993 | }; |
| 995 | 994 | ||
| 996 | static int __init stu300_init(void) | 995 | static int __init stu300_init(void) |
| 997 | { | 996 | { |
| 998 | return platform_driver_probe(&stu300_i2c_driver, stu300_probe); | 997 | return platform_driver_register(&stu300_i2c_driver); |
| 999 | } | 998 | } |
| 1000 | 999 | ||
| 1001 | static void __exit stu300_exit(void) | 1000 | static void __exit stu300_exit(void) |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 29d3f045a2bf..3be58f89ac77 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
| @@ -1134,6 +1134,9 @@ static void acpi_i2c_register_devices(struct i2c_adapter *adap) | |||
| 1134 | acpi_handle handle; | 1134 | acpi_handle handle; |
| 1135 | acpi_status status; | 1135 | acpi_status status; |
| 1136 | 1136 | ||
| 1137 | if (!adap->dev.parent) | ||
| 1138 | return; | ||
| 1139 | |||
| 1137 | handle = ACPI_HANDLE(adap->dev.parent); | 1140 | handle = ACPI_HANDLE(adap->dev.parent); |
| 1138 | if (!handle) | 1141 | if (!handle) |
| 1139 | return; | 1142 | return; |
diff --git a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c index 74b41ae690f3..928656e241dd 100644 --- a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c +++ b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c | |||
| @@ -200,7 +200,7 @@ static int i2c_arbitrator_probe(struct platform_device *pdev) | |||
| 200 | arb->parent = of_find_i2c_adapter_by_node(parent_np); | 200 | arb->parent = of_find_i2c_adapter_by_node(parent_np); |
| 201 | if (!arb->parent) { | 201 | if (!arb->parent) { |
| 202 | dev_err(dev, "Cannot find parent bus\n"); | 202 | dev_err(dev, "Cannot find parent bus\n"); |
| 203 | return -EINVAL; | 203 | return -EPROBE_DEFER; |
| 204 | } | 204 | } |
| 205 | 205 | ||
| 206 | /* Actually add the mux adapter */ | 206 | /* Actually add the mux adapter */ |
diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c index 5d4a99ba743e..a764da777f08 100644 --- a/drivers/i2c/muxes/i2c-mux-gpio.c +++ b/drivers/i2c/muxes/i2c-mux-gpio.c | |||
| @@ -66,7 +66,7 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, | |||
| 66 | struct device_node *adapter_np, *child; | 66 | struct device_node *adapter_np, *child; |
| 67 | struct i2c_adapter *adapter; | 67 | struct i2c_adapter *adapter; |
| 68 | unsigned *values, *gpios; | 68 | unsigned *values, *gpios; |
| 69 | int i = 0; | 69 | int i = 0, ret; |
| 70 | 70 | ||
| 71 | if (!np) | 71 | if (!np) |
| 72 | return -ENODEV; | 72 | return -ENODEV; |
| @@ -79,7 +79,7 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, | |||
| 79 | adapter = of_find_i2c_adapter_by_node(adapter_np); | 79 | adapter = of_find_i2c_adapter_by_node(adapter_np); |
| 80 | if (!adapter) { | 80 | if (!adapter) { |
| 81 | dev_err(&pdev->dev, "Cannot find parent bus\n"); | 81 | dev_err(&pdev->dev, "Cannot find parent bus\n"); |
| 82 | return -ENODEV; | 82 | return -EPROBE_DEFER; |
| 83 | } | 83 | } |
| 84 | mux->data.parent = i2c_adapter_id(adapter); | 84 | mux->data.parent = i2c_adapter_id(adapter); |
| 85 | put_device(&adapter->dev); | 85 | put_device(&adapter->dev); |
| @@ -116,8 +116,12 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, | |||
| 116 | return -ENOMEM; | 116 | return -ENOMEM; |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | for (i = 0; i < mux->data.n_gpios; i++) | 119 | for (i = 0; i < mux->data.n_gpios; i++) { |
| 120 | gpios[i] = of_get_named_gpio(np, "mux-gpios", i); | 120 | ret = of_get_named_gpio(np, "mux-gpios", i); |
| 121 | if (ret < 0) | ||
| 122 | return ret; | ||
| 123 | gpios[i] = ret; | ||
| 124 | } | ||
| 121 | 125 | ||
| 122 | mux->data.gpios = gpios; | 126 | mux->data.gpios = gpios; |
| 123 | 127 | ||
| @@ -177,7 +181,7 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev) | |||
| 177 | if (!parent) { | 181 | if (!parent) { |
| 178 | dev_err(&pdev->dev, "Parent adapter (%d) not found\n", | 182 | dev_err(&pdev->dev, "Parent adapter (%d) not found\n", |
| 179 | mux->data.parent); | 183 | mux->data.parent); |
| 180 | return -ENODEV; | 184 | return -EPROBE_DEFER; |
| 181 | } | 185 | } |
| 182 | 186 | ||
| 183 | mux->parent = parent; | 187 | mux->parent = parent; |
diff --git a/drivers/i2c/muxes/i2c-mux-pinctrl.c b/drivers/i2c/muxes/i2c-mux-pinctrl.c index 69a91732ae65..68a37157377d 100644 --- a/drivers/i2c/muxes/i2c-mux-pinctrl.c +++ b/drivers/i2c/muxes/i2c-mux-pinctrl.c | |||
| @@ -113,7 +113,7 @@ static int i2c_mux_pinctrl_parse_dt(struct i2c_mux_pinctrl *mux, | |||
| 113 | adapter = of_find_i2c_adapter_by_node(adapter_np); | 113 | adapter = of_find_i2c_adapter_by_node(adapter_np); |
| 114 | if (!adapter) { | 114 | if (!adapter) { |
| 115 | dev_err(mux->dev, "Cannot find parent bus\n"); | 115 | dev_err(mux->dev, "Cannot find parent bus\n"); |
| 116 | return -ENODEV; | 116 | return -EPROBE_DEFER; |
| 117 | } | 117 | } |
| 118 | mux->pdata->parent_bus_num = i2c_adapter_id(adapter); | 118 | mux->pdata->parent_bus_num = i2c_adapter_id(adapter); |
| 119 | put_device(&adapter->dev); | 119 | put_device(&adapter->dev); |
| @@ -211,7 +211,7 @@ static int i2c_mux_pinctrl_probe(struct platform_device *pdev) | |||
| 211 | if (!mux->parent) { | 211 | if (!mux->parent) { |
| 212 | dev_err(&pdev->dev, "Parent adapter (%d) not found\n", | 212 | dev_err(&pdev->dev, "Parent adapter (%d) not found\n", |
| 213 | mux->pdata->parent_bus_num); | 213 | mux->pdata->parent_bus_num); |
| 214 | ret = -ENODEV; | 214 | ret = -EPROBE_DEFER; |
| 215 | goto err; | 215 | goto err; |
| 216 | } | 216 | } |
| 217 | 217 | ||
diff --git a/drivers/infiniband/hw/amso1100/c2_ae.c b/drivers/infiniband/hw/amso1100/c2_ae.c index d5d1929753e4..cedda25232be 100644 --- a/drivers/infiniband/hw/amso1100/c2_ae.c +++ b/drivers/infiniband/hw/amso1100/c2_ae.c | |||
| @@ -141,7 +141,7 @@ static const char *to_qp_state_str(int state) | |||
| 141 | return "C2_QP_STATE_ERROR"; | 141 | return "C2_QP_STATE_ERROR"; |
| 142 | default: | 142 | default: |
| 143 | return "<invalid QP state>"; | 143 | return "<invalid QP state>"; |
| 144 | }; | 144 | } |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | void c2_ae_event(struct c2_dev *c2dev, u32 mq_index) | 147 | void c2_ae_event(struct c2_dev *c2dev, u32 mq_index) |
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 3f831de9a4d8..b1a6cb3a2809 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
| @@ -164,6 +164,7 @@ int mlx5_vector2eqn(struct mlx5_ib_dev *dev, int vector, int *eqn, int *irqn) | |||
| 164 | static int alloc_comp_eqs(struct mlx5_ib_dev *dev) | 164 | static int alloc_comp_eqs(struct mlx5_ib_dev *dev) |
| 165 | { | 165 | { |
| 166 | struct mlx5_eq_table *table = &dev->mdev.priv.eq_table; | 166 | struct mlx5_eq_table *table = &dev->mdev.priv.eq_table; |
| 167 | char name[MLX5_MAX_EQ_NAME]; | ||
| 167 | struct mlx5_eq *eq, *n; | 168 | struct mlx5_eq *eq, *n; |
| 168 | int ncomp_vec; | 169 | int ncomp_vec; |
| 169 | int nent; | 170 | int nent; |
| @@ -180,11 +181,10 @@ static int alloc_comp_eqs(struct mlx5_ib_dev *dev) | |||
| 180 | goto clean; | 181 | goto clean; |
| 181 | } | 182 | } |
| 182 | 183 | ||
| 183 | snprintf(eq->name, MLX5_MAX_EQ_NAME, "mlx5_comp%d", i); | 184 | snprintf(name, MLX5_MAX_EQ_NAME, "mlx5_comp%d", i); |
| 184 | err = mlx5_create_map_eq(&dev->mdev, eq, | 185 | err = mlx5_create_map_eq(&dev->mdev, eq, |
| 185 | i + MLX5_EQ_VEC_COMP_BASE, nent, 0, | 186 | i + MLX5_EQ_VEC_COMP_BASE, nent, 0, |
| 186 | eq->name, | 187 | name, &dev->mdev.priv.uuari.uars[0]); |
| 187 | &dev->mdev.priv.uuari.uars[0]); | ||
| 188 | if (err) { | 188 | if (err) { |
| 189 | kfree(eq); | 189 | kfree(eq); |
| 190 | goto clean; | 190 | goto clean; |
| @@ -301,9 +301,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, | |||
| 301 | props->max_srq_sge = max_rq_sg - 1; | 301 | props->max_srq_sge = max_rq_sg - 1; |
| 302 | props->max_fast_reg_page_list_len = (unsigned int)-1; | 302 | props->max_fast_reg_page_list_len = (unsigned int)-1; |
| 303 | props->local_ca_ack_delay = dev->mdev.caps.local_ca_ack_delay; | 303 | props->local_ca_ack_delay = dev->mdev.caps.local_ca_ack_delay; |
| 304 | props->atomic_cap = dev->mdev.caps.flags & MLX5_DEV_CAP_FLAG_ATOMIC ? | 304 | props->atomic_cap = IB_ATOMIC_NONE; |
| 305 | IB_ATOMIC_HCA : IB_ATOMIC_NONE; | 305 | props->masked_atomic_cap = IB_ATOMIC_NONE; |
| 306 | props->masked_atomic_cap = IB_ATOMIC_HCA; | ||
| 307 | props->max_pkeys = be16_to_cpup((__be16 *)(out_mad->data + 28)); | 306 | props->max_pkeys = be16_to_cpup((__be16 *)(out_mad->data + 28)); |
| 308 | props->max_mcast_grp = 1 << dev->mdev.caps.log_max_mcg; | 307 | props->max_mcast_grp = 1 << dev->mdev.caps.log_max_mcg; |
| 309 | props->max_mcast_qp_attach = dev->mdev.caps.max_qp_mcg; | 308 | props->max_mcast_qp_attach = dev->mdev.caps.max_qp_mcg; |
| @@ -1006,6 +1005,11 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, enum mlx5_dev_event event, | |||
| 1006 | ibev.device = &ibdev->ib_dev; | 1005 | ibev.device = &ibdev->ib_dev; |
| 1007 | ibev.element.port_num = port; | 1006 | ibev.element.port_num = port; |
| 1008 | 1007 | ||
| 1008 | if (port < 1 || port > ibdev->num_ports) { | ||
| 1009 | mlx5_ib_warn(ibdev, "warning: event on port %d\n", port); | ||
| 1010 | return; | ||
| 1011 | } | ||
| 1012 | |||
| 1009 | if (ibdev->ib_active) | 1013 | if (ibdev->ib_active) |
| 1010 | ib_dispatch_event(&ibev); | 1014 | ib_dispatch_event(&ibev); |
| 1011 | } | 1015 | } |
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index bd41df95b6f0..3453580b1eb2 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c | |||
| @@ -42,6 +42,10 @@ enum { | |||
| 42 | DEF_CACHE_SIZE = 10, | 42 | DEF_CACHE_SIZE = 10, |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | enum { | ||
| 46 | MLX5_UMR_ALIGN = 2048 | ||
| 47 | }; | ||
| 48 | |||
| 45 | static __be64 *mr_align(__be64 *ptr, int align) | 49 | static __be64 *mr_align(__be64 *ptr, int align) |
| 46 | { | 50 | { |
| 47 | unsigned long mask = align - 1; | 51 | unsigned long mask = align - 1; |
| @@ -61,13 +65,11 @@ static int order2idx(struct mlx5_ib_dev *dev, int order) | |||
| 61 | 65 | ||
| 62 | static int add_keys(struct mlx5_ib_dev *dev, int c, int num) | 66 | static int add_keys(struct mlx5_ib_dev *dev, int c, int num) |
| 63 | { | 67 | { |
| 64 | struct device *ddev = dev->ib_dev.dma_device; | ||
| 65 | struct mlx5_mr_cache *cache = &dev->cache; | 68 | struct mlx5_mr_cache *cache = &dev->cache; |
| 66 | struct mlx5_cache_ent *ent = &cache->ent[c]; | 69 | struct mlx5_cache_ent *ent = &cache->ent[c]; |
| 67 | struct mlx5_create_mkey_mbox_in *in; | 70 | struct mlx5_create_mkey_mbox_in *in; |
| 68 | struct mlx5_ib_mr *mr; | 71 | struct mlx5_ib_mr *mr; |
| 69 | int npages = 1 << ent->order; | 72 | int npages = 1 << ent->order; |
| 70 | int size = sizeof(u64) * npages; | ||
| 71 | int err = 0; | 73 | int err = 0; |
| 72 | int i; | 74 | int i; |
| 73 | 75 | ||
| @@ -83,21 +85,6 @@ static int add_keys(struct mlx5_ib_dev *dev, int c, int num) | |||
| 83 | } | 85 | } |
| 84 | mr->order = ent->order; | 86 | mr->order = ent->order; |
| 85 | mr->umred = 1; | 87 | mr->umred = 1; |
| 86 | mr->pas = kmalloc(size + 0x3f, GFP_KERNEL); | ||
| 87 | if (!mr->pas) { | ||
| 88 | kfree(mr); | ||
| 89 | err = -ENOMEM; | ||
| 90 | goto out; | ||
| 91 | } | ||
| 92 | mr->dma = dma_map_single(ddev, mr_align(mr->pas, 0x40), size, | ||
| 93 | DMA_TO_DEVICE); | ||
| 94 | if (dma_mapping_error(ddev, mr->dma)) { | ||
| 95 | kfree(mr->pas); | ||
| 96 | kfree(mr); | ||
| 97 | err = -ENOMEM; | ||
| 98 | goto out; | ||
| 99 | } | ||
| 100 | |||
| 101 | in->seg.status = 1 << 6; | 88 | in->seg.status = 1 << 6; |
| 102 | in->seg.xlt_oct_size = cpu_to_be32((npages + 1) / 2); | 89 | in->seg.xlt_oct_size = cpu_to_be32((npages + 1) / 2); |
| 103 | in->seg.qpn_mkey7_0 = cpu_to_be32(0xffffff << 8); | 90 | in->seg.qpn_mkey7_0 = cpu_to_be32(0xffffff << 8); |
| @@ -108,8 +95,6 @@ static int add_keys(struct mlx5_ib_dev *dev, int c, int num) | |||
| 108 | sizeof(*in)); | 95 | sizeof(*in)); |
| 109 | if (err) { | 96 | if (err) { |
| 110 | mlx5_ib_warn(dev, "create mkey failed %d\n", err); | 97 | mlx5_ib_warn(dev, "create mkey failed %d\n", err); |
| 111 | dma_unmap_single(ddev, mr->dma, size, DMA_TO_DEVICE); | ||
| 112 | kfree(mr->pas); | ||
| 113 | kfree(mr); | 98 | kfree(mr); |
| 114 | goto out; | 99 | goto out; |
| 115 | } | 100 | } |
| @@ -129,11 +114,9 @@ out: | |||
| 129 | 114 | ||
| 130 | static void remove_keys(struct mlx5_ib_dev *dev, int c, int num) | 115 | static void remove_keys(struct mlx5_ib_dev *dev, int c, int num) |
| 131 | { | 116 | { |
| 132 | struct device *ddev = dev->ib_dev.dma_device; | ||
| 133 | struct mlx5_mr_cache *cache = &dev->cache; | 117 | struct mlx5_mr_cache *cache = &dev->cache; |
| 134 | struct mlx5_cache_ent *ent = &cache->ent[c]; | 118 | struct mlx5_cache_ent *ent = &cache->ent[c]; |
| 135 | struct mlx5_ib_mr *mr; | 119 | struct mlx5_ib_mr *mr; |
| 136 | int size; | ||
| 137 | int err; | 120 | int err; |
| 138 | int i; | 121 | int i; |
| 139 | 122 | ||
| @@ -149,14 +132,10 @@ static void remove_keys(struct mlx5_ib_dev *dev, int c, int num) | |||
| 149 | ent->size--; | 132 | ent->size--; |
| 150 | spin_unlock(&ent->lock); | 133 | spin_unlock(&ent->lock); |
| 151 | err = mlx5_core_destroy_mkey(&dev->mdev, &mr->mmr); | 134 | err = mlx5_core_destroy_mkey(&dev->mdev, &mr->mmr); |
| 152 | if (err) { | 135 | if (err) |
| 153 | mlx5_ib_warn(dev, "failed destroy mkey\n"); | 136 | mlx5_ib_warn(dev, "failed destroy mkey\n"); |
| 154 | } else { | 137 | else |
| 155 | size = ALIGN(sizeof(u64) * (1 << mr->order), 0x40); | ||
| 156 | dma_unmap_single(ddev, mr->dma, size, DMA_TO_DEVICE); | ||
| 157 | kfree(mr->pas); | ||
| 158 | kfree(mr); | 138 | kfree(mr); |
| 159 | } | ||
| 160 | } | 139 | } |
| 161 | } | 140 | } |
| 162 | 141 | ||
| @@ -408,13 +387,12 @@ static void free_cached_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr) | |||
| 408 | 387 | ||
| 409 | static void clean_keys(struct mlx5_ib_dev *dev, int c) | 388 | static void clean_keys(struct mlx5_ib_dev *dev, int c) |
| 410 | { | 389 | { |
| 411 | struct device *ddev = dev->ib_dev.dma_device; | ||
| 412 | struct mlx5_mr_cache *cache = &dev->cache; | 390 | struct mlx5_mr_cache *cache = &dev->cache; |
| 413 | struct mlx5_cache_ent *ent = &cache->ent[c]; | 391 | struct mlx5_cache_ent *ent = &cache->ent[c]; |
| 414 | struct mlx5_ib_mr *mr; | 392 | struct mlx5_ib_mr *mr; |
| 415 | int size; | ||
| 416 | int err; | 393 | int err; |
| 417 | 394 | ||
| 395 | cancel_delayed_work(&ent->dwork); | ||
| 418 | while (1) { | 396 | while (1) { |
| 419 | spin_lock(&ent->lock); | 397 | spin_lock(&ent->lock); |
| 420 | if (list_empty(&ent->head)) { | 398 | if (list_empty(&ent->head)) { |
| @@ -427,14 +405,10 @@ static void clean_keys(struct mlx5_ib_dev *dev, int c) | |||
| 427 | ent->size--; | 405 | ent->size--; |
| 428 | spin_unlock(&ent->lock); | 406 | spin_unlock(&ent->lock); |
| 429 | err = mlx5_core_destroy_mkey(&dev->mdev, &mr->mmr); | 407 | err = mlx5_core_destroy_mkey(&dev->mdev, &mr->mmr); |
| 430 | if (err) { | 408 | if (err) |
| 431 | mlx5_ib_warn(dev, "failed destroy mkey\n"); | 409 | mlx5_ib_warn(dev, "failed destroy mkey\n"); |
| 432 | } else { | 410 | else |
| 433 | size = ALIGN(sizeof(u64) * (1 << mr->order), 0x40); | ||
| 434 | dma_unmap_single(ddev, mr->dma, size, DMA_TO_DEVICE); | ||
| 435 | kfree(mr->pas); | ||
| 436 | kfree(mr); | 411 | kfree(mr); |
| 437 | } | ||
| 438 | } | 412 | } |
| 439 | } | 413 | } |
| 440 | 414 | ||
| @@ -540,13 +514,15 @@ int mlx5_mr_cache_cleanup(struct mlx5_ib_dev *dev) | |||
| 540 | int i; | 514 | int i; |
| 541 | 515 | ||
| 542 | dev->cache.stopped = 1; | 516 | dev->cache.stopped = 1; |
| 543 | destroy_workqueue(dev->cache.wq); | 517 | flush_workqueue(dev->cache.wq); |
| 544 | 518 | ||
| 545 | mlx5_mr_cache_debugfs_cleanup(dev); | 519 | mlx5_mr_cache_debugfs_cleanup(dev); |
| 546 | 520 | ||
| 547 | for (i = 0; i < MAX_MR_CACHE_ENTRIES; i++) | 521 | for (i = 0; i < MAX_MR_CACHE_ENTRIES; i++) |
| 548 | clean_keys(dev, i); | 522 | clean_keys(dev, i); |
| 549 | 523 | ||
| 524 | destroy_workqueue(dev->cache.wq); | ||
| 525 | |||
| 550 | return 0; | 526 | return 0; |
| 551 | } | 527 | } |
| 552 | 528 | ||
| @@ -675,10 +651,12 @@ static struct mlx5_ib_mr *reg_umr(struct ib_pd *pd, struct ib_umem *umem, | |||
| 675 | int page_shift, int order, int access_flags) | 651 | int page_shift, int order, int access_flags) |
| 676 | { | 652 | { |
| 677 | struct mlx5_ib_dev *dev = to_mdev(pd->device); | 653 | struct mlx5_ib_dev *dev = to_mdev(pd->device); |
| 654 | struct device *ddev = dev->ib_dev.dma_device; | ||
| 678 | struct umr_common *umrc = &dev->umrc; | 655 | struct umr_common *umrc = &dev->umrc; |
| 679 | struct ib_send_wr wr, *bad; | 656 | struct ib_send_wr wr, *bad; |
| 680 | struct mlx5_ib_mr *mr; | 657 | struct mlx5_ib_mr *mr; |
| 681 | struct ib_sge sg; | 658 | struct ib_sge sg; |
| 659 | int size = sizeof(u64) * npages; | ||
| 682 | int err; | 660 | int err; |
| 683 | int i; | 661 | int i; |
| 684 | 662 | ||
| @@ -697,7 +675,22 @@ static struct mlx5_ib_mr *reg_umr(struct ib_pd *pd, struct ib_umem *umem, | |||
| 697 | if (!mr) | 675 | if (!mr) |
| 698 | return ERR_PTR(-EAGAIN); | 676 | return ERR_PTR(-EAGAIN); |
| 699 | 677 | ||
| 700 | mlx5_ib_populate_pas(dev, umem, page_shift, mr_align(mr->pas, 0x40), 1); | 678 | mr->pas = kmalloc(size + MLX5_UMR_ALIGN - 1, GFP_KERNEL); |
| 679 | if (!mr->pas) { | ||
| 680 | err = -ENOMEM; | ||
| 681 | goto error; | ||
| 682 | } | ||
| 683 | |||
| 684 | mlx5_ib_populate_pas(dev, umem, page_shift, | ||
| 685 | mr_align(mr->pas, MLX5_UMR_ALIGN), 1); | ||
| 686 | |||
| 687 | mr->dma = dma_map_single(ddev, mr_align(mr->pas, MLX5_UMR_ALIGN), size, | ||
| 688 | DMA_TO_DEVICE); | ||
| 689 | if (dma_mapping_error(ddev, mr->dma)) { | ||
| 690 | kfree(mr->pas); | ||
| 691 | err = -ENOMEM; | ||
| 692 | goto error; | ||
| 693 | } | ||
| 701 | 694 | ||
| 702 | memset(&wr, 0, sizeof(wr)); | 695 | memset(&wr, 0, sizeof(wr)); |
| 703 | wr.wr_id = (u64)(unsigned long)mr; | 696 | wr.wr_id = (u64)(unsigned long)mr; |
| @@ -718,6 +711,9 @@ static struct mlx5_ib_mr *reg_umr(struct ib_pd *pd, struct ib_umem *umem, | |||
| 718 | wait_for_completion(&mr->done); | 711 | wait_for_completion(&mr->done); |
| 719 | up(&umrc->sem); | 712 | up(&umrc->sem); |
| 720 | 713 | ||
| 714 | dma_unmap_single(ddev, mr->dma, size, DMA_TO_DEVICE); | ||
| 715 | kfree(mr->pas); | ||
| 716 | |||
| 721 | if (mr->status != IB_WC_SUCCESS) { | 717 | if (mr->status != IB_WC_SUCCESS) { |
| 722 | mlx5_ib_warn(dev, "reg umr failed\n"); | 718 | mlx5_ib_warn(dev, "reg umr failed\n"); |
| 723 | err = -EFAULT; | 719 | err = -EFAULT; |
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 045f8cdbd303..5659ea880741 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c | |||
| @@ -203,7 +203,7 @@ static int sq_overhead(enum ib_qp_type qp_type) | |||
| 203 | 203 | ||
| 204 | switch (qp_type) { | 204 | switch (qp_type) { |
| 205 | case IB_QPT_XRC_INI: | 205 | case IB_QPT_XRC_INI: |
| 206 | size = sizeof(struct mlx5_wqe_xrc_seg); | 206 | size += sizeof(struct mlx5_wqe_xrc_seg); |
| 207 | /* fall through */ | 207 | /* fall through */ |
| 208 | case IB_QPT_RC: | 208 | case IB_QPT_RC: |
| 209 | size += sizeof(struct mlx5_wqe_ctrl_seg) + | 209 | size += sizeof(struct mlx5_wqe_ctrl_seg) + |
| @@ -211,20 +211,23 @@ static int sq_overhead(enum ib_qp_type qp_type) | |||
| 211 | sizeof(struct mlx5_wqe_raddr_seg); | 211 | sizeof(struct mlx5_wqe_raddr_seg); |
| 212 | break; | 212 | break; |
| 213 | 213 | ||
| 214 | case IB_QPT_XRC_TGT: | ||
| 215 | return 0; | ||
| 216 | |||
| 214 | case IB_QPT_UC: | 217 | case IB_QPT_UC: |
| 215 | size = sizeof(struct mlx5_wqe_ctrl_seg) + | 218 | size += sizeof(struct mlx5_wqe_ctrl_seg) + |
| 216 | sizeof(struct mlx5_wqe_raddr_seg); | 219 | sizeof(struct mlx5_wqe_raddr_seg); |
| 217 | break; | 220 | break; |
| 218 | 221 | ||
| 219 | case IB_QPT_UD: | 222 | case IB_QPT_UD: |
| 220 | case IB_QPT_SMI: | 223 | case IB_QPT_SMI: |
| 221 | case IB_QPT_GSI: | 224 | case IB_QPT_GSI: |
| 222 | size = sizeof(struct mlx5_wqe_ctrl_seg) + | 225 | size += sizeof(struct mlx5_wqe_ctrl_seg) + |
| 223 | sizeof(struct mlx5_wqe_datagram_seg); | 226 | sizeof(struct mlx5_wqe_datagram_seg); |
| 224 | break; | 227 | break; |
| 225 | 228 | ||
| 226 | case MLX5_IB_QPT_REG_UMR: | 229 | case MLX5_IB_QPT_REG_UMR: |
| 227 | size = sizeof(struct mlx5_wqe_ctrl_seg) + | 230 | size += sizeof(struct mlx5_wqe_ctrl_seg) + |
| 228 | sizeof(struct mlx5_wqe_umr_ctrl_seg) + | 231 | sizeof(struct mlx5_wqe_umr_ctrl_seg) + |
| 229 | sizeof(struct mlx5_mkey_seg); | 232 | sizeof(struct mlx5_mkey_seg); |
| 230 | break; | 233 | break; |
| @@ -270,7 +273,8 @@ static int calc_sq_size(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr, | |||
| 270 | return wqe_size; | 273 | return wqe_size; |
| 271 | 274 | ||
| 272 | if (wqe_size > dev->mdev.caps.max_sq_desc_sz) { | 275 | if (wqe_size > dev->mdev.caps.max_sq_desc_sz) { |
| 273 | mlx5_ib_dbg(dev, "\n"); | 276 | mlx5_ib_dbg(dev, "wqe_size(%d) > max_sq_desc_sz(%d)\n", |
| 277 | wqe_size, dev->mdev.caps.max_sq_desc_sz); | ||
| 274 | return -EINVAL; | 278 | return -EINVAL; |
| 275 | } | 279 | } |
| 276 | 280 | ||
| @@ -280,9 +284,15 @@ static int calc_sq_size(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr, | |||
| 280 | 284 | ||
| 281 | wq_size = roundup_pow_of_two(attr->cap.max_send_wr * wqe_size); | 285 | wq_size = roundup_pow_of_two(attr->cap.max_send_wr * wqe_size); |
| 282 | qp->sq.wqe_cnt = wq_size / MLX5_SEND_WQE_BB; | 286 | qp->sq.wqe_cnt = wq_size / MLX5_SEND_WQE_BB; |
| 287 | if (qp->sq.wqe_cnt > dev->mdev.caps.max_wqes) { | ||
| 288 | mlx5_ib_dbg(dev, "wqe count(%d) exceeds limits(%d)\n", | ||
| 289 | qp->sq.wqe_cnt, dev->mdev.caps.max_wqes); | ||
| 290 | return -ENOMEM; | ||
| 291 | } | ||
| 283 | qp->sq.wqe_shift = ilog2(MLX5_SEND_WQE_BB); | 292 | qp->sq.wqe_shift = ilog2(MLX5_SEND_WQE_BB); |
| 284 | qp->sq.max_gs = attr->cap.max_send_sge; | 293 | qp->sq.max_gs = attr->cap.max_send_sge; |
| 285 | qp->sq.max_post = 1 << ilog2(wq_size / wqe_size); | 294 | qp->sq.max_post = wq_size / wqe_size; |
| 295 | attr->cap.max_send_wr = qp->sq.max_post; | ||
| 286 | 296 | ||
| 287 | return wq_size; | 297 | return wq_size; |
| 288 | } | 298 | } |
| @@ -1280,6 +1290,11 @@ static enum mlx5_qp_optpar opt_mask[MLX5_QP_NUM_STATE][MLX5_QP_NUM_STATE][MLX5_Q | |||
| 1280 | MLX5_QP_OPTPAR_Q_KEY, | 1290 | MLX5_QP_OPTPAR_Q_KEY, |
| 1281 | [MLX5_QP_ST_MLX] = MLX5_QP_OPTPAR_PKEY_INDEX | | 1291 | [MLX5_QP_ST_MLX] = MLX5_QP_OPTPAR_PKEY_INDEX | |
| 1282 | MLX5_QP_OPTPAR_Q_KEY, | 1292 | MLX5_QP_OPTPAR_Q_KEY, |
| 1293 | [MLX5_QP_ST_XRC] = MLX5_QP_OPTPAR_ALT_ADDR_PATH | | ||
| 1294 | MLX5_QP_OPTPAR_RRE | | ||
| 1295 | MLX5_QP_OPTPAR_RAE | | ||
| 1296 | MLX5_QP_OPTPAR_RWE | | ||
| 1297 | MLX5_QP_OPTPAR_PKEY_INDEX, | ||
| 1283 | }, | 1298 | }, |
| 1284 | }, | 1299 | }, |
| 1285 | [MLX5_QP_STATE_RTR] = { | 1300 | [MLX5_QP_STATE_RTR] = { |
| @@ -1314,6 +1329,11 @@ static enum mlx5_qp_optpar opt_mask[MLX5_QP_NUM_STATE][MLX5_QP_NUM_STATE][MLX5_Q | |||
| 1314 | [MLX5_QP_STATE_RTS] = { | 1329 | [MLX5_QP_STATE_RTS] = { |
| 1315 | [MLX5_QP_ST_UD] = MLX5_QP_OPTPAR_Q_KEY, | 1330 | [MLX5_QP_ST_UD] = MLX5_QP_OPTPAR_Q_KEY, |
| 1316 | [MLX5_QP_ST_MLX] = MLX5_QP_OPTPAR_Q_KEY, | 1331 | [MLX5_QP_ST_MLX] = MLX5_QP_OPTPAR_Q_KEY, |
| 1332 | [MLX5_QP_ST_UC] = MLX5_QP_OPTPAR_RWE, | ||
| 1333 | [MLX5_QP_ST_RC] = MLX5_QP_OPTPAR_RNR_TIMEOUT | | ||
| 1334 | MLX5_QP_OPTPAR_RWE | | ||
| 1335 | MLX5_QP_OPTPAR_RAE | | ||
| 1336 | MLX5_QP_OPTPAR_RRE, | ||
| 1317 | }, | 1337 | }, |
| 1318 | }, | 1338 | }, |
| 1319 | }; | 1339 | }; |
| @@ -1651,29 +1671,6 @@ static __always_inline void set_raddr_seg(struct mlx5_wqe_raddr_seg *rseg, | |||
| 1651 | rseg->reserved = 0; | 1671 | rseg->reserved = 0; |
| 1652 | } | 1672 | } |
| 1653 | 1673 | ||
| 1654 | static void set_atomic_seg(struct mlx5_wqe_atomic_seg *aseg, struct ib_send_wr *wr) | ||
| 1655 | { | ||
| 1656 | if (wr->opcode == IB_WR_ATOMIC_CMP_AND_SWP) { | ||
| 1657 | aseg->swap_add = cpu_to_be64(wr->wr.atomic.swap); | ||
| 1658 | aseg->compare = cpu_to_be64(wr->wr.atomic.compare_add); | ||
| 1659 | } else if (wr->opcode == IB_WR_MASKED_ATOMIC_FETCH_AND_ADD) { | ||
| 1660 | aseg->swap_add = cpu_to_be64(wr->wr.atomic.compare_add); | ||
| 1661 | aseg->compare = cpu_to_be64(wr->wr.atomic.compare_add_mask); | ||
| 1662 | } else { | ||
| 1663 | aseg->swap_add = cpu_to_be64(wr->wr.atomic.compare_add); | ||
| 1664 | aseg->compare = 0; | ||
| 1665 | } | ||
| 1666 | } | ||
| 1667 | |||
| 1668 | static void set_masked_atomic_seg(struct mlx5_wqe_masked_atomic_seg *aseg, | ||
| 1669 | struct ib_send_wr *wr) | ||
| 1670 | { | ||
| 1671 | aseg->swap_add = cpu_to_be64(wr->wr.atomic.swap); | ||
| 1672 | aseg->swap_add_mask = cpu_to_be64(wr->wr.atomic.swap_mask); | ||
| 1673 | aseg->compare = cpu_to_be64(wr->wr.atomic.compare_add); | ||
| 1674 | aseg->compare_mask = cpu_to_be64(wr->wr.atomic.compare_add_mask); | ||
| 1675 | } | ||
| 1676 | |||
| 1677 | static void set_datagram_seg(struct mlx5_wqe_datagram_seg *dseg, | 1674 | static void set_datagram_seg(struct mlx5_wqe_datagram_seg *dseg, |
| 1678 | struct ib_send_wr *wr) | 1675 | struct ib_send_wr *wr) |
| 1679 | { | 1676 | { |
| @@ -2063,28 +2060,11 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 2063 | 2060 | ||
| 2064 | case IB_WR_ATOMIC_CMP_AND_SWP: | 2061 | case IB_WR_ATOMIC_CMP_AND_SWP: |
| 2065 | case IB_WR_ATOMIC_FETCH_AND_ADD: | 2062 | case IB_WR_ATOMIC_FETCH_AND_ADD: |
| 2066 | set_raddr_seg(seg, wr->wr.atomic.remote_addr, | ||
| 2067 | wr->wr.atomic.rkey); | ||
| 2068 | seg += sizeof(struct mlx5_wqe_raddr_seg); | ||
| 2069 | |||
| 2070 | set_atomic_seg(seg, wr); | ||
| 2071 | seg += sizeof(struct mlx5_wqe_atomic_seg); | ||
| 2072 | |||
| 2073 | size += (sizeof(struct mlx5_wqe_raddr_seg) + | ||
| 2074 | sizeof(struct mlx5_wqe_atomic_seg)) / 16; | ||
| 2075 | break; | ||
| 2076 | |||
| 2077 | case IB_WR_MASKED_ATOMIC_CMP_AND_SWP: | 2063 | case IB_WR_MASKED_ATOMIC_CMP_AND_SWP: |
| 2078 | set_raddr_seg(seg, wr->wr.atomic.remote_addr, | 2064 | mlx5_ib_warn(dev, "Atomic operations are not supported yet\n"); |
| 2079 | wr->wr.atomic.rkey); | 2065 | err = -ENOSYS; |
| 2080 | seg += sizeof(struct mlx5_wqe_raddr_seg); | 2066 | *bad_wr = wr; |
| 2081 | 2067 | goto out; | |
| 2082 | set_masked_atomic_seg(seg, wr); | ||
| 2083 | seg += sizeof(struct mlx5_wqe_masked_atomic_seg); | ||
| 2084 | |||
| 2085 | size += (sizeof(struct mlx5_wqe_raddr_seg) + | ||
| 2086 | sizeof(struct mlx5_wqe_masked_atomic_seg)) / 16; | ||
| 2087 | break; | ||
| 2088 | 2068 | ||
| 2089 | case IB_WR_LOCAL_INV: | 2069 | case IB_WR_LOCAL_INV: |
| 2090 | next_fence = MLX5_FENCE_MODE_INITIATOR_SMALL; | 2070 | next_fence = MLX5_FENCE_MODE_INITIATOR_SMALL; |
diff --git a/drivers/infiniband/hw/mlx5/srq.c b/drivers/infiniband/hw/mlx5/srq.c index 84d297afd6a9..0aa478bc291a 100644 --- a/drivers/infiniband/hw/mlx5/srq.c +++ b/drivers/infiniband/hw/mlx5/srq.c | |||
| @@ -295,7 +295,7 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd, | |||
| 295 | mlx5_vfree(in); | 295 | mlx5_vfree(in); |
| 296 | if (err) { | 296 | if (err) { |
| 297 | mlx5_ib_dbg(dev, "create SRQ failed, err %d\n", err); | 297 | mlx5_ib_dbg(dev, "create SRQ failed, err %d\n", err); |
| 298 | goto err_srq; | 298 | goto err_usr_kern_srq; |
| 299 | } | 299 | } |
| 300 | 300 | ||
| 301 | mlx5_ib_dbg(dev, "create SRQ with srqn 0x%x\n", srq->msrq.srqn); | 301 | mlx5_ib_dbg(dev, "create SRQ with srqn 0x%x\n", srq->msrq.srqn); |
| @@ -316,6 +316,8 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd, | |||
| 316 | 316 | ||
| 317 | err_core: | 317 | err_core: |
| 318 | mlx5_core_destroy_srq(&dev->mdev, &srq->msrq); | 318 | mlx5_core_destroy_srq(&dev->mdev, &srq->msrq); |
| 319 | |||
| 320 | err_usr_kern_srq: | ||
| 319 | if (pd->uobject) | 321 | if (pd->uobject) |
| 320 | destroy_srq_user(pd, srq); | 322 | destroy_srq_user(pd, srq); |
| 321 | else | 323 | else |
diff --git a/drivers/infiniband/hw/mthca/mthca_eq.c b/drivers/infiniband/hw/mthca/mthca_eq.c index 7c9d35f39d75..690201738993 100644 --- a/drivers/infiniband/hw/mthca/mthca_eq.c +++ b/drivers/infiniband/hw/mthca/mthca_eq.c | |||
| @@ -357,7 +357,7 @@ static int mthca_eq_int(struct mthca_dev *dev, struct mthca_eq *eq) | |||
| 357 | mthca_warn(dev, "Unhandled event %02x(%02x) on EQ %d\n", | 357 | mthca_warn(dev, "Unhandled event %02x(%02x) on EQ %d\n", |
| 358 | eqe->type, eqe->subtype, eq->eqn); | 358 | eqe->type, eqe->subtype, eq->eqn); |
| 359 | break; | 359 | break; |
| 360 | }; | 360 | } |
| 361 | 361 | ||
| 362 | set_eqe_hw(eqe); | 362 | set_eqe_hw(eqe); |
| 363 | ++eq->cons_index; | 363 | ++eq->cons_index; |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index 4ed8235d2d36..50219ab2279d 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c | |||
| @@ -150,7 +150,7 @@ enum ib_qp_state get_ibqp_state(enum ocrdma_qp_state qps) | |||
| 150 | return IB_QPS_SQE; | 150 | return IB_QPS_SQE; |
| 151 | case OCRDMA_QPS_ERR: | 151 | case OCRDMA_QPS_ERR: |
| 152 | return IB_QPS_ERR; | 152 | return IB_QPS_ERR; |
| 153 | }; | 153 | } |
| 154 | return IB_QPS_ERR; | 154 | return IB_QPS_ERR; |
| 155 | } | 155 | } |
| 156 | 156 | ||
| @@ -171,7 +171,7 @@ static enum ocrdma_qp_state get_ocrdma_qp_state(enum ib_qp_state qps) | |||
| 171 | return OCRDMA_QPS_SQE; | 171 | return OCRDMA_QPS_SQE; |
| 172 | case IB_QPS_ERR: | 172 | case IB_QPS_ERR: |
| 173 | return OCRDMA_QPS_ERR; | 173 | return OCRDMA_QPS_ERR; |
| 174 | }; | 174 | } |
| 175 | return OCRDMA_QPS_ERR; | 175 | return OCRDMA_QPS_ERR; |
| 176 | } | 176 | } |
| 177 | 177 | ||
| @@ -1982,7 +1982,7 @@ int ocrdma_mbx_create_qp(struct ocrdma_qp *qp, struct ib_qp_init_attr *attrs, | |||
| 1982 | break; | 1982 | break; |
| 1983 | default: | 1983 | default: |
| 1984 | return -EINVAL; | 1984 | return -EINVAL; |
| 1985 | }; | 1985 | } |
| 1986 | 1986 | ||
| 1987 | cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_CREATE_QP, sizeof(*cmd)); | 1987 | cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_CREATE_QP, sizeof(*cmd)); |
| 1988 | if (!cmd) | 1988 | if (!cmd) |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 56e004940f18..0ce7674621ea 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c | |||
| @@ -531,7 +531,7 @@ static void ocrdma_event_handler(struct ocrdma_dev *dev, u32 event) | |||
| 531 | case BE_DEV_DOWN: | 531 | case BE_DEV_DOWN: |
| 532 | ocrdma_close(dev); | 532 | ocrdma_close(dev); |
| 533 | break; | 533 | break; |
| 534 | }; | 534 | } |
| 535 | } | 535 | } |
| 536 | 536 | ||
| 537 | static struct ocrdma_driver ocrdma_drv = { | 537 | static struct ocrdma_driver ocrdma_drv = { |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 6e982bb43c31..69f1d1221a6b 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | |||
| @@ -141,7 +141,7 @@ static inline void get_link_speed_and_width(struct ocrdma_dev *dev, | |||
| 141 | /* Unsupported */ | 141 | /* Unsupported */ |
| 142 | *ib_speed = IB_SPEED_SDR; | 142 | *ib_speed = IB_SPEED_SDR; |
| 143 | *ib_width = IB_WIDTH_1X; | 143 | *ib_width = IB_WIDTH_1X; |
| 144 | }; | 144 | } |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | 147 | ||
| @@ -2331,7 +2331,7 @@ static enum ib_wc_status ocrdma_to_ibwc_err(u16 status) | |||
| 2331 | default: | 2331 | default: |
| 2332 | ibwc_status = IB_WC_GENERAL_ERR; | 2332 | ibwc_status = IB_WC_GENERAL_ERR; |
| 2333 | break; | 2333 | break; |
| 2334 | }; | 2334 | } |
| 2335 | return ibwc_status; | 2335 | return ibwc_status; |
| 2336 | } | 2336 | } |
| 2337 | 2337 | ||
| @@ -2370,7 +2370,7 @@ static void ocrdma_update_wc(struct ocrdma_qp *qp, struct ib_wc *ibwc, | |||
| 2370 | pr_err("%s() invalid opcode received = 0x%x\n", | 2370 | pr_err("%s() invalid opcode received = 0x%x\n", |
| 2371 | __func__, hdr->cw & OCRDMA_WQE_OPCODE_MASK); | 2371 | __func__, hdr->cw & OCRDMA_WQE_OPCODE_MASK); |
| 2372 | break; | 2372 | break; |
| 2373 | }; | 2373 | } |
| 2374 | } | 2374 | } |
| 2375 | 2375 | ||
| 2376 | static void ocrdma_set_cqe_status_flushed(struct ocrdma_qp *qp, | 2376 | static void ocrdma_set_cqe_status_flushed(struct ocrdma_qp *qp, |
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index fe302e33f72e..c880ebaf1553 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig | |||
| @@ -52,7 +52,7 @@ config AMD_IOMMU | |||
| 52 | select PCI_PRI | 52 | select PCI_PRI |
| 53 | select PCI_PASID | 53 | select PCI_PASID |
| 54 | select IOMMU_API | 54 | select IOMMU_API |
| 55 | depends on X86_64 && PCI && ACPI && X86_IO_APIC | 55 | depends on X86_64 && PCI && ACPI |
| 56 | ---help--- | 56 | ---help--- |
| 57 | With this option you can enable support for AMD IOMMU hardware in | 57 | With this option you can enable support for AMD IOMMU hardware in |
| 58 | your system. An IOMMU is a hardware component which provides | 58 | your system. An IOMMU is a hardware component which provides |
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 71eb233b9ace..b6a74bcbb08f 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c | |||
| @@ -996,6 +996,7 @@ static void request_write(struct cached_dev *dc, struct search *s) | |||
| 996 | closure_bio_submit(bio, cl, s->d); | 996 | closure_bio_submit(bio, cl, s->d); |
| 997 | } else { | 997 | } else { |
| 998 | bch_writeback_add(dc); | 998 | bch_writeback_add(dc); |
| 999 | s->op.cache_bio = bio; | ||
| 999 | 1000 | ||
| 1000 | if (bio->bi_rw & REQ_FLUSH) { | 1001 | if (bio->bi_rw & REQ_FLUSH) { |
| 1001 | /* Also need to send a flush to the backing device */ | 1002 | /* Also need to send a flush to the backing device */ |
| @@ -1008,8 +1009,6 @@ static void request_write(struct cached_dev *dc, struct search *s) | |||
| 1008 | flush->bi_private = cl; | 1009 | flush->bi_private = cl; |
| 1009 | 1010 | ||
| 1010 | closure_bio_submit(flush, cl, s->d); | 1011 | closure_bio_submit(flush, cl, s->d); |
| 1011 | } else { | ||
| 1012 | s->op.cache_bio = bio; | ||
| 1013 | } | 1012 | } |
| 1014 | } | 1013 | } |
| 1015 | out: | 1014 | out: |
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index 4caa8e6d59d7..2d2b1b7588d7 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c | |||
| @@ -269,6 +269,14 @@ static chunk_t area_location(struct pstore *ps, chunk_t area) | |||
| 269 | return NUM_SNAPSHOT_HDR_CHUNKS + ((ps->exceptions_per_area + 1) * area); | 269 | return NUM_SNAPSHOT_HDR_CHUNKS + ((ps->exceptions_per_area + 1) * area); |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | static void skip_metadata(struct pstore *ps) | ||
| 273 | { | ||
| 274 | uint32_t stride = ps->exceptions_per_area + 1; | ||
| 275 | chunk_t next_free = ps->next_free; | ||
| 276 | if (sector_div(next_free, stride) == NUM_SNAPSHOT_HDR_CHUNKS) | ||
| 277 | ps->next_free++; | ||
| 278 | } | ||
| 279 | |||
| 272 | /* | 280 | /* |
| 273 | * Read or write a metadata area. Remembering to skip the first | 281 | * Read or write a metadata area. Remembering to skip the first |
| 274 | * chunk which holds the header. | 282 | * chunk which holds the header. |
| @@ -502,6 +510,8 @@ static int read_exceptions(struct pstore *ps, | |||
| 502 | 510 | ||
| 503 | ps->current_area--; | 511 | ps->current_area--; |
| 504 | 512 | ||
| 513 | skip_metadata(ps); | ||
| 514 | |||
| 505 | return 0; | 515 | return 0; |
| 506 | } | 516 | } |
| 507 | 517 | ||
| @@ -616,8 +626,6 @@ static int persistent_prepare_exception(struct dm_exception_store *store, | |||
| 616 | struct dm_exception *e) | 626 | struct dm_exception *e) |
| 617 | { | 627 | { |
| 618 | struct pstore *ps = get_info(store); | 628 | struct pstore *ps = get_info(store); |
| 619 | uint32_t stride; | ||
| 620 | chunk_t next_free; | ||
| 621 | sector_t size = get_dev_size(dm_snap_cow(store->snap)->bdev); | 629 | sector_t size = get_dev_size(dm_snap_cow(store->snap)->bdev); |
| 622 | 630 | ||
| 623 | /* Is there enough room ? */ | 631 | /* Is there enough room ? */ |
| @@ -630,10 +638,8 @@ static int persistent_prepare_exception(struct dm_exception_store *store, | |||
| 630 | * Move onto the next free pending, making sure to take | 638 | * Move onto the next free pending, making sure to take |
| 631 | * into account the location of the metadata chunks. | 639 | * into account the location of the metadata chunks. |
| 632 | */ | 640 | */ |
| 633 | stride = (ps->exceptions_per_area + 1); | 641 | ps->next_free++; |
| 634 | next_free = ++ps->next_free; | 642 | skip_metadata(ps); |
| 635 | if (sector_div(next_free, stride) == 1) | ||
| 636 | ps->next_free++; | ||
| 637 | 643 | ||
| 638 | atomic_inc(&ps->pending_count); | 644 | atomic_inc(&ps->pending_count); |
| 639 | return 0; | 645 | return 0; |
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 26b14f9fcac6..6bc9618af094 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c | |||
| @@ -168,12 +168,25 @@ static inline int write_disable(struct m25p *flash) | |||
| 168 | */ | 168 | */ |
| 169 | static inline int set_4byte(struct m25p *flash, u32 jedec_id, int enable) | 169 | static inline int set_4byte(struct m25p *flash, u32 jedec_id, int enable) |
| 170 | { | 170 | { |
| 171 | int status; | ||
| 172 | bool need_wren = false; | ||
| 173 | |||
| 171 | switch (JEDEC_MFR(jedec_id)) { | 174 | switch (JEDEC_MFR(jedec_id)) { |
| 172 | case CFI_MFR_MACRONIX: | ||
| 173 | case CFI_MFR_ST: /* Micron, actually */ | 175 | case CFI_MFR_ST: /* Micron, actually */ |
| 176 | /* Some Micron need WREN command; all will accept it */ | ||
| 177 | need_wren = true; | ||
| 178 | case CFI_MFR_MACRONIX: | ||
| 174 | case 0xEF /* winbond */: | 179 | case 0xEF /* winbond */: |
| 180 | if (need_wren) | ||
| 181 | write_enable(flash); | ||
| 182 | |||
| 175 | flash->command[0] = enable ? OPCODE_EN4B : OPCODE_EX4B; | 183 | flash->command[0] = enable ? OPCODE_EN4B : OPCODE_EX4B; |
| 176 | return spi_write(flash->spi, flash->command, 1); | 184 | status = spi_write(flash->spi, flash->command, 1); |
| 185 | |||
| 186 | if (need_wren) | ||
| 187 | write_disable(flash); | ||
| 188 | |||
| 189 | return status; | ||
| 177 | default: | 190 | default: |
| 178 | /* Spansion style */ | 191 | /* Spansion style */ |
| 179 | flash->command[0] = OPCODE_BRWR; | 192 | flash->command[0] = OPCODE_BRWR; |
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 7ed4841327f2..d340b2f198c6 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
| @@ -2869,10 +2869,8 @@ static int nand_flash_detect_ext_param_page(struct mtd_info *mtd, | |||
| 2869 | 2869 | ||
| 2870 | len = le16_to_cpu(p->ext_param_page_length) * 16; | 2870 | len = le16_to_cpu(p->ext_param_page_length) * 16; |
| 2871 | ep = kmalloc(len, GFP_KERNEL); | 2871 | ep = kmalloc(len, GFP_KERNEL); |
| 2872 | if (!ep) { | 2872 | if (!ep) |
| 2873 | ret = -ENOMEM; | 2873 | return -ENOMEM; |
| 2874 | goto ext_out; | ||
| 2875 | } | ||
| 2876 | 2874 | ||
| 2877 | /* Send our own NAND_CMD_PARAM. */ | 2875 | /* Send our own NAND_CMD_PARAM. */ |
| 2878 | chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1); | 2876 | chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1); |
| @@ -2920,7 +2918,7 @@ static int nand_flash_detect_ext_param_page(struct mtd_info *mtd, | |||
| 2920 | } | 2918 | } |
| 2921 | 2919 | ||
| 2922 | pr_info("ONFI extended param page detected.\n"); | 2920 | pr_info("ONFI extended param page detected.\n"); |
| 2923 | return 0; | 2921 | ret = 0; |
| 2924 | 2922 | ||
| 2925 | ext_out: | 2923 | ext_out: |
| 2926 | kfree(ep); | 2924 | kfree(ep); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 5472cbd34028..6ca30739625f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c | |||
| @@ -180,28 +180,32 @@ static int verify_block_sig(struct mlx5_cmd_prot_block *block) | |||
| 180 | return 0; | 180 | return 0; |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | static void calc_block_sig(struct mlx5_cmd_prot_block *block, u8 token) | 183 | static void calc_block_sig(struct mlx5_cmd_prot_block *block, u8 token, |
| 184 | int csum) | ||
| 184 | { | 185 | { |
| 185 | block->token = token; | 186 | block->token = token; |
| 186 | block->ctrl_sig = ~xor8_buf(block->rsvd0, sizeof(*block) - sizeof(block->data) - 2); | 187 | if (csum) { |
| 187 | block->sig = ~xor8_buf(block, sizeof(*block) - 1); | 188 | block->ctrl_sig = ~xor8_buf(block->rsvd0, sizeof(*block) - |
| 189 | sizeof(block->data) - 2); | ||
| 190 | block->sig = ~xor8_buf(block, sizeof(*block) - 1); | ||
| 191 | } | ||
| 188 | } | 192 | } |
| 189 | 193 | ||
| 190 | static void calc_chain_sig(struct mlx5_cmd_msg *msg, u8 token) | 194 | static void calc_chain_sig(struct mlx5_cmd_msg *msg, u8 token, int csum) |
| 191 | { | 195 | { |
| 192 | struct mlx5_cmd_mailbox *next = msg->next; | 196 | struct mlx5_cmd_mailbox *next = msg->next; |
| 193 | 197 | ||
| 194 | while (next) { | 198 | while (next) { |
| 195 | calc_block_sig(next->buf, token); | 199 | calc_block_sig(next->buf, token, csum); |
| 196 | next = next->next; | 200 | next = next->next; |
| 197 | } | 201 | } |
| 198 | } | 202 | } |
| 199 | 203 | ||
| 200 | static void set_signature(struct mlx5_cmd_work_ent *ent) | 204 | static void set_signature(struct mlx5_cmd_work_ent *ent, int csum) |
| 201 | { | 205 | { |
| 202 | ent->lay->sig = ~xor8_buf(ent->lay, sizeof(*ent->lay)); | 206 | ent->lay->sig = ~xor8_buf(ent->lay, sizeof(*ent->lay)); |
| 203 | calc_chain_sig(ent->in, ent->token); | 207 | calc_chain_sig(ent->in, ent->token, csum); |
| 204 | calc_chain_sig(ent->out, ent->token); | 208 | calc_chain_sig(ent->out, ent->token, csum); |
| 205 | } | 209 | } |
| 206 | 210 | ||
| 207 | static void poll_timeout(struct mlx5_cmd_work_ent *ent) | 211 | static void poll_timeout(struct mlx5_cmd_work_ent *ent) |
| @@ -539,8 +543,7 @@ static void cmd_work_handler(struct work_struct *work) | |||
| 539 | lay->type = MLX5_PCI_CMD_XPORT; | 543 | lay->type = MLX5_PCI_CMD_XPORT; |
| 540 | lay->token = ent->token; | 544 | lay->token = ent->token; |
| 541 | lay->status_own = CMD_OWNER_HW; | 545 | lay->status_own = CMD_OWNER_HW; |
| 542 | if (!cmd->checksum_disabled) | 546 | set_signature(ent, !cmd->checksum_disabled); |
| 543 | set_signature(ent); | ||
| 544 | dump_command(dev, ent, 1); | 547 | dump_command(dev, ent, 1); |
| 545 | ktime_get_ts(&ent->ts1); | 548 | ktime_get_ts(&ent->ts1); |
| 546 | 549 | ||
| @@ -773,8 +776,6 @@ static int mlx5_copy_from_msg(void *to, struct mlx5_cmd_msg *from, int size) | |||
| 773 | 776 | ||
| 774 | copy = min_t(int, size, MLX5_CMD_DATA_BLOCK_SIZE); | 777 | copy = min_t(int, size, MLX5_CMD_DATA_BLOCK_SIZE); |
| 775 | block = next->buf; | 778 | block = next->buf; |
| 776 | if (xor8_buf(block, sizeof(*block)) != 0xff) | ||
| 777 | return -EINVAL; | ||
| 778 | 779 | ||
| 779 | memcpy(to, block->data, copy); | 780 | memcpy(to, block->data, copy); |
| 780 | to += copy; | 781 | to += copy; |
| @@ -1361,6 +1362,7 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) | |||
| 1361 | goto err_map; | 1362 | goto err_map; |
| 1362 | } | 1363 | } |
| 1363 | 1364 | ||
| 1365 | cmd->checksum_disabled = 1; | ||
| 1364 | cmd->max_reg_cmds = (1 << cmd->log_sz) - 1; | 1366 | cmd->max_reg_cmds = (1 << cmd->log_sz) - 1; |
| 1365 | cmd->bitmask = (1 << cmd->max_reg_cmds) - 1; | 1367 | cmd->bitmask = (1 << cmd->max_reg_cmds) - 1; |
| 1366 | 1368 | ||
| @@ -1510,7 +1512,7 @@ int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr) | |||
| 1510 | case MLX5_CMD_STAT_BAD_SYS_STATE_ERR: return -EIO; | 1512 | case MLX5_CMD_STAT_BAD_SYS_STATE_ERR: return -EIO; |
| 1511 | case MLX5_CMD_STAT_BAD_RES_ERR: return -EINVAL; | 1513 | case MLX5_CMD_STAT_BAD_RES_ERR: return -EINVAL; |
| 1512 | case MLX5_CMD_STAT_RES_BUSY: return -EBUSY; | 1514 | case MLX5_CMD_STAT_RES_BUSY: return -EBUSY; |
| 1513 | case MLX5_CMD_STAT_LIM_ERR: return -EINVAL; | 1515 | case MLX5_CMD_STAT_LIM_ERR: return -ENOMEM; |
| 1514 | case MLX5_CMD_STAT_BAD_RES_STATE_ERR: return -EINVAL; | 1516 | case MLX5_CMD_STAT_BAD_RES_STATE_ERR: return -EINVAL; |
| 1515 | case MLX5_CMD_STAT_IX_ERR: return -EINVAL; | 1517 | case MLX5_CMD_STAT_IX_ERR: return -EINVAL; |
| 1516 | case MLX5_CMD_STAT_NO_RES_ERR: return -EAGAIN; | 1518 | case MLX5_CMD_STAT_NO_RES_ERR: return -EAGAIN; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index 443cc4d7b024..2231d93cc7ad 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c | |||
| @@ -366,9 +366,11 @@ int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, | |||
| 366 | goto err_in; | 366 | goto err_in; |
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | snprintf(eq->name, MLX5_MAX_EQ_NAME, "%s@pci:%s", | ||
| 370 | name, pci_name(dev->pdev)); | ||
| 369 | eq->eqn = out.eq_number; | 371 | eq->eqn = out.eq_number; |
| 370 | err = request_irq(table->msix_arr[vecidx].vector, mlx5_msix_handler, 0, | 372 | err = request_irq(table->msix_arr[vecidx].vector, mlx5_msix_handler, 0, |
| 371 | name, eq); | 373 | eq->name, eq); |
| 372 | if (err) | 374 | if (err) |
| 373 | goto err_eq; | 375 | goto err_eq; |
| 374 | 376 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index b47739b0b5f6..bc0f5fb66e24 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c | |||
| @@ -165,9 +165,7 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) | |||
| 165 | struct mlx5_cmd_set_hca_cap_mbox_in *set_ctx = NULL; | 165 | struct mlx5_cmd_set_hca_cap_mbox_in *set_ctx = NULL; |
| 166 | struct mlx5_cmd_query_hca_cap_mbox_in query_ctx; | 166 | struct mlx5_cmd_query_hca_cap_mbox_in query_ctx; |
| 167 | struct mlx5_cmd_set_hca_cap_mbox_out set_out; | 167 | struct mlx5_cmd_set_hca_cap_mbox_out set_out; |
| 168 | struct mlx5_profile *prof = dev->profile; | ||
| 169 | u64 flags; | 168 | u64 flags; |
| 170 | int csum = 1; | ||
| 171 | int err; | 169 | int err; |
| 172 | 170 | ||
| 173 | memset(&query_ctx, 0, sizeof(query_ctx)); | 171 | memset(&query_ctx, 0, sizeof(query_ctx)); |
| @@ -197,20 +195,14 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) | |||
| 197 | memcpy(&set_ctx->hca_cap, &query_out->hca_cap, | 195 | memcpy(&set_ctx->hca_cap, &query_out->hca_cap, |
| 198 | sizeof(set_ctx->hca_cap)); | 196 | sizeof(set_ctx->hca_cap)); |
| 199 | 197 | ||
| 200 | if (prof->mask & MLX5_PROF_MASK_CMDIF_CSUM) { | ||
| 201 | csum = !!prof->cmdif_csum; | ||
| 202 | flags = be64_to_cpu(set_ctx->hca_cap.flags); | ||
| 203 | if (csum) | ||
| 204 | flags |= MLX5_DEV_CAP_FLAG_CMDIF_CSUM; | ||
| 205 | else | ||
| 206 | flags &= ~MLX5_DEV_CAP_FLAG_CMDIF_CSUM; | ||
| 207 | |||
| 208 | set_ctx->hca_cap.flags = cpu_to_be64(flags); | ||
| 209 | } | ||
| 210 | |||
| 211 | if (dev->profile->mask & MLX5_PROF_MASK_QP_SIZE) | 198 | if (dev->profile->mask & MLX5_PROF_MASK_QP_SIZE) |
| 212 | set_ctx->hca_cap.log_max_qp = dev->profile->log_max_qp; | 199 | set_ctx->hca_cap.log_max_qp = dev->profile->log_max_qp; |
| 213 | 200 | ||
| 201 | flags = be64_to_cpu(query_out->hca_cap.flags); | ||
| 202 | /* disable checksum */ | ||
| 203 | flags &= ~MLX5_DEV_CAP_FLAG_CMDIF_CSUM; | ||
| 204 | |||
| 205 | set_ctx->hca_cap.flags = cpu_to_be64(flags); | ||
| 214 | memset(&set_out, 0, sizeof(set_out)); | 206 | memset(&set_out, 0, sizeof(set_out)); |
| 215 | set_ctx->hca_cap.log_uar_page_sz = cpu_to_be16(PAGE_SHIFT - 12); | 207 | set_ctx->hca_cap.log_uar_page_sz = cpu_to_be16(PAGE_SHIFT - 12); |
| 216 | set_ctx->hdr.opcode = cpu_to_be16(MLX5_CMD_OP_SET_HCA_CAP); | 208 | set_ctx->hdr.opcode = cpu_to_be16(MLX5_CMD_OP_SET_HCA_CAP); |
| @@ -225,9 +217,6 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) | |||
| 225 | if (err) | 217 | if (err) |
| 226 | goto query_ex; | 218 | goto query_ex; |
| 227 | 219 | ||
| 228 | if (!csum) | ||
| 229 | dev->cmd.checksum_disabled = 1; | ||
| 230 | |||
| 231 | query_ex: | 220 | query_ex: |
| 232 | kfree(query_out); | 221 | kfree(query_out); |
| 233 | kfree(set_ctx); | 222 | kfree(set_ctx); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c index 3a2408d44820..7b12acf210f8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | |||
| @@ -90,6 +90,10 @@ struct mlx5_manage_pages_outbox { | |||
| 90 | __be64 pas[0]; | 90 | __be64 pas[0]; |
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| 93 | enum { | ||
| 94 | MAX_RECLAIM_TIME_MSECS = 5000, | ||
| 95 | }; | ||
| 96 | |||
| 93 | static int insert_page(struct mlx5_core_dev *dev, u64 addr, struct page *page, u16 func_id) | 97 | static int insert_page(struct mlx5_core_dev *dev, u64 addr, struct page *page, u16 func_id) |
| 94 | { | 98 | { |
| 95 | struct rb_root *root = &dev->priv.page_root; | 99 | struct rb_root *root = &dev->priv.page_root; |
| @@ -279,6 +283,9 @@ static int reclaim_pages(struct mlx5_core_dev *dev, u32 func_id, int npages, | |||
| 279 | int err; | 283 | int err; |
| 280 | int i; | 284 | int i; |
| 281 | 285 | ||
| 286 | if (nclaimed) | ||
| 287 | *nclaimed = 0; | ||
| 288 | |||
| 282 | memset(&in, 0, sizeof(in)); | 289 | memset(&in, 0, sizeof(in)); |
| 283 | outlen = sizeof(*out) + npages * sizeof(out->pas[0]); | 290 | outlen = sizeof(*out) + npages * sizeof(out->pas[0]); |
| 284 | out = mlx5_vzalloc(outlen); | 291 | out = mlx5_vzalloc(outlen); |
| @@ -388,20 +395,25 @@ static int optimal_reclaimed_pages(void) | |||
| 388 | 395 | ||
| 389 | int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev) | 396 | int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev) |
| 390 | { | 397 | { |
| 391 | unsigned long end = jiffies + msecs_to_jiffies(5000); | 398 | unsigned long end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); |
| 392 | struct fw_page *fwp; | 399 | struct fw_page *fwp; |
| 393 | struct rb_node *p; | 400 | struct rb_node *p; |
| 401 | int nclaimed = 0; | ||
| 394 | int err; | 402 | int err; |
| 395 | 403 | ||
| 396 | do { | 404 | do { |
| 397 | p = rb_first(&dev->priv.page_root); | 405 | p = rb_first(&dev->priv.page_root); |
| 398 | if (p) { | 406 | if (p) { |
| 399 | fwp = rb_entry(p, struct fw_page, rb_node); | 407 | fwp = rb_entry(p, struct fw_page, rb_node); |
| 400 | err = reclaim_pages(dev, fwp->func_id, optimal_reclaimed_pages(), NULL); | 408 | err = reclaim_pages(dev, fwp->func_id, |
| 409 | optimal_reclaimed_pages(), | ||
| 410 | &nclaimed); | ||
| 401 | if (err) { | 411 | if (err) { |
| 402 | mlx5_core_warn(dev, "failed reclaiming pages (%d)\n", err); | 412 | mlx5_core_warn(dev, "failed reclaiming pages (%d)\n", err); |
| 403 | return err; | 413 | return err; |
| 404 | } | 414 | } |
| 415 | if (nclaimed) | ||
| 416 | end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); | ||
| 405 | } | 417 | } |
| 406 | if (time_after(jiffies, end)) { | 418 | if (time_after(jiffies, end)) { |
| 407 | mlx5_core_warn(dev, "FW did not return all pages. giving up...\n"); | 419 | mlx5_core_warn(dev, "FW did not return all pages. giving up...\n"); |
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index 9d2009a9004d..78cc76053328 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig | |||
| @@ -74,10 +74,4 @@ config OF_MTD | |||
| 74 | depends on MTD | 74 | depends on MTD |
| 75 | def_bool y | 75 | def_bool y |
| 76 | 76 | ||
| 77 | config OF_RESERVED_MEM | ||
| 78 | depends on OF_FLATTREE && (DMA_CMA || (HAVE_GENERIC_DMA_COHERENT && HAVE_MEMBLOCK)) | ||
| 79 | def_bool y | ||
| 80 | help | ||
| 81 | Initialization code for DMA reserved memory | ||
| 82 | |||
| 83 | endmenu # OF | 77 | endmenu # OF |
diff --git a/drivers/of/Makefile b/drivers/of/Makefile index ed9660adad77..efd05102c405 100644 --- a/drivers/of/Makefile +++ b/drivers/of/Makefile | |||
| @@ -9,4 +9,3 @@ obj-$(CONFIG_OF_MDIO) += of_mdio.o | |||
| 9 | obj-$(CONFIG_OF_PCI) += of_pci.o | 9 | obj-$(CONFIG_OF_PCI) += of_pci.o |
| 10 | obj-$(CONFIG_OF_PCI_IRQ) += of_pci_irq.o | 10 | obj-$(CONFIG_OF_PCI_IRQ) += of_pci_irq.o |
| 11 | obj-$(CONFIG_OF_MTD) += of_mtd.o | 11 | obj-$(CONFIG_OF_MTD) += of_mtd.o |
| 12 | obj-$(CONFIG_OF_RESERVED_MEM) += of_reserved_mem.o | ||
diff --git a/drivers/of/base.c b/drivers/of/base.c index 865d3f66c86b..7d4c70f859e3 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
| @@ -303,10 +303,8 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) | |||
| 303 | struct device_node *cpun, *cpus; | 303 | struct device_node *cpun, *cpus; |
| 304 | 304 | ||
| 305 | cpus = of_find_node_by_path("/cpus"); | 305 | cpus = of_find_node_by_path("/cpus"); |
| 306 | if (!cpus) { | 306 | if (!cpus) |
| 307 | pr_warn("Missing cpus node, bailing out\n"); | ||
| 308 | return NULL; | 307 | return NULL; |
| 309 | } | ||
| 310 | 308 | ||
| 311 | for_each_child_of_node(cpus, cpun) { | 309 | for_each_child_of_node(cpus, cpun) { |
| 312 | if (of_node_cmp(cpun->type, "cpu")) | 310 | if (of_node_cmp(cpun->type, "cpu")) |
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 229dd9d69e18..a4fa9ad31b8f 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
| 19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
| 20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
| 21 | #include <linux/random.h> | ||
| 22 | 21 | ||
| 23 | #include <asm/setup.h> /* for COMMAND_LINE_SIZE */ | 22 | #include <asm/setup.h> /* for COMMAND_LINE_SIZE */ |
| 24 | #ifdef CONFIG_PPC | 23 | #ifdef CONFIG_PPC |
| @@ -803,14 +802,3 @@ void __init unflatten_device_tree(void) | |||
| 803 | } | 802 | } |
| 804 | 803 | ||
| 805 | #endif /* CONFIG_OF_EARLY_FLATTREE */ | 804 | #endif /* CONFIG_OF_EARLY_FLATTREE */ |
| 806 | |||
| 807 | /* Feed entire flattened device tree into the random pool */ | ||
| 808 | static int __init add_fdt_randomness(void) | ||
| 809 | { | ||
| 810 | if (initial_boot_params) | ||
| 811 | add_device_randomness(initial_boot_params, | ||
| 812 | be32_to_cpu(initial_boot_params->totalsize)); | ||
| 813 | |||
| 814 | return 0; | ||
| 815 | } | ||
| 816 | core_initcall(add_fdt_randomness); | ||
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c deleted file mode 100644 index 0fe40c7d6904..000000000000 --- a/drivers/of/of_reserved_mem.c +++ /dev/null | |||
| @@ -1,173 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Device tree based initialization code for reserved memory. | ||
| 3 | * | ||
| 4 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | ||
| 5 | * http://www.samsung.com | ||
| 6 | * Author: Marek Szyprowski <m.szyprowski@samsung.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License as | ||
| 10 | * published by the Free Software Foundation; either version 2 of the | ||
| 11 | * License or (at your optional) any later version of the license. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/memblock.h> | ||
| 15 | #include <linux/err.h> | ||
| 16 | #include <linux/of.h> | ||
| 17 | #include <linux/of_fdt.h> | ||
| 18 | #include <linux/of_platform.h> | ||
| 19 | #include <linux/mm.h> | ||
| 20 | #include <linux/sizes.h> | ||
| 21 | #include <linux/mm_types.h> | ||
| 22 | #include <linux/dma-contiguous.h> | ||
| 23 | #include <linux/dma-mapping.h> | ||
| 24 | #include <linux/of_reserved_mem.h> | ||
| 25 | |||
| 26 | #define MAX_RESERVED_REGIONS 16 | ||
| 27 | struct reserved_mem { | ||
| 28 | phys_addr_t base; | ||
| 29 | unsigned long size; | ||
| 30 | struct cma *cma; | ||
| 31 | char name[32]; | ||
| 32 | }; | ||
| 33 | static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS]; | ||
| 34 | static int reserved_mem_count; | ||
| 35 | |||
| 36 | static int __init fdt_scan_reserved_mem(unsigned long node, const char *uname, | ||
| 37 | int depth, void *data) | ||
| 38 | { | ||
| 39 | struct reserved_mem *rmem = &reserved_mem[reserved_mem_count]; | ||
| 40 | phys_addr_t base, size; | ||
| 41 | int is_cma, is_reserved; | ||
| 42 | unsigned long len; | ||
| 43 | const char *status; | ||
| 44 | __be32 *prop; | ||
| 45 | |||
| 46 | is_cma = IS_ENABLED(CONFIG_DMA_CMA) && | ||
| 47 | of_flat_dt_is_compatible(node, "linux,contiguous-memory-region"); | ||
| 48 | is_reserved = of_flat_dt_is_compatible(node, "reserved-memory-region"); | ||
| 49 | |||
| 50 | if (!is_reserved && !is_cma) { | ||
| 51 | /* ignore node and scan next one */ | ||
| 52 | return 0; | ||
| 53 | } | ||
| 54 | |||
| 55 | status = of_get_flat_dt_prop(node, "status", &len); | ||
| 56 | if (status && strcmp(status, "okay") != 0) { | ||
| 57 | /* ignore disabled node nad scan next one */ | ||
| 58 | return 0; | ||
| 59 | } | ||
| 60 | |||
| 61 | prop = of_get_flat_dt_prop(node, "reg", &len); | ||
| 62 | if (!prop || (len < (dt_root_size_cells + dt_root_addr_cells) * | ||
| 63 | sizeof(__be32))) { | ||
| 64 | pr_err("Reserved mem: node %s, incorrect \"reg\" property\n", | ||
| 65 | uname); | ||
| 66 | /* ignore node and scan next one */ | ||
| 67 | return 0; | ||
| 68 | } | ||
| 69 | base = dt_mem_next_cell(dt_root_addr_cells, &prop); | ||
| 70 | size = dt_mem_next_cell(dt_root_size_cells, &prop); | ||
| 71 | |||
| 72 | if (!size) { | ||
| 73 | /* ignore node and scan next one */ | ||
| 74 | return 0; | ||
| 75 | } | ||
| 76 | |||
| 77 | pr_info("Reserved mem: found %s, memory base %lx, size %ld MiB\n", | ||
| 78 | uname, (unsigned long)base, (unsigned long)size / SZ_1M); | ||
| 79 | |||
| 80 | if (reserved_mem_count == ARRAY_SIZE(reserved_mem)) | ||
| 81 | return -ENOSPC; | ||
| 82 | |||
| 83 | rmem->base = base; | ||
| 84 | rmem->size = size; | ||
| 85 | strlcpy(rmem->name, uname, sizeof(rmem->name)); | ||
| 86 | |||
| 87 | if (is_cma) { | ||
| 88 | struct cma *cma; | ||
| 89 | if (dma_contiguous_reserve_area(size, base, 0, &cma) == 0) { | ||
| 90 | rmem->cma = cma; | ||
| 91 | reserved_mem_count++; | ||
| 92 | if (of_get_flat_dt_prop(node, | ||
| 93 | "linux,default-contiguous-region", | ||
| 94 | NULL)) | ||
| 95 | dma_contiguous_set_default(cma); | ||
| 96 | } | ||
| 97 | } else if (is_reserved) { | ||
| 98 | if (memblock_remove(base, size) == 0) | ||
| 99 | reserved_mem_count++; | ||
| 100 | else | ||
| 101 | pr_err("Failed to reserve memory for %s\n", uname); | ||
| 102 | } | ||
| 103 | |||
| 104 | return 0; | ||
| 105 | } | ||
| 106 | |||
| 107 | static struct reserved_mem *get_dma_memory_region(struct device *dev) | ||
| 108 | { | ||
| 109 | struct device_node *node; | ||
| 110 | const char *name; | ||
| 111 | int i; | ||
| 112 | |||
| 113 | node = of_parse_phandle(dev->of_node, "memory-region", 0); | ||
| 114 | if (!node) | ||
| 115 | return NULL; | ||
| 116 | |||
| 117 | name = kbasename(node->full_name); | ||
| 118 | for (i = 0; i < reserved_mem_count; i++) | ||
| 119 | if (strcmp(name, reserved_mem[i].name) == 0) | ||
| 120 | return &reserved_mem[i]; | ||
| 121 | return NULL; | ||
| 122 | } | ||
| 123 | |||
| 124 | /** | ||
| 125 | * of_reserved_mem_device_init() - assign reserved memory region to given device | ||
| 126 | * | ||
| 127 | * This function assign memory region pointed by "memory-region" device tree | ||
| 128 | * property to the given device. | ||
| 129 | */ | ||
| 130 | void of_reserved_mem_device_init(struct device *dev) | ||
| 131 | { | ||
| 132 | struct reserved_mem *region = get_dma_memory_region(dev); | ||
| 133 | if (!region) | ||
| 134 | return; | ||
| 135 | |||
| 136 | if (region->cma) { | ||
| 137 | dev_set_cma_area(dev, region->cma); | ||
| 138 | pr_info("Assigned CMA %s to %s device\n", region->name, | ||
| 139 | dev_name(dev)); | ||
| 140 | } else { | ||
| 141 | if (dma_declare_coherent_memory(dev, region->base, region->base, | ||
| 142 | region->size, DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE) != 0) | ||
| 143 | pr_info("Declared reserved memory %s to %s device\n", | ||
| 144 | region->name, dev_name(dev)); | ||
| 145 | } | ||
| 146 | } | ||
| 147 | |||
| 148 | /** | ||
| 149 | * of_reserved_mem_device_release() - release reserved memory device structures | ||
| 150 | * | ||
| 151 | * This function releases structures allocated for memory region handling for | ||
| 152 | * the given device. | ||
| 153 | */ | ||
| 154 | void of_reserved_mem_device_release(struct device *dev) | ||
| 155 | { | ||
| 156 | struct reserved_mem *region = get_dma_memory_region(dev); | ||
| 157 | if (!region && !region->cma) | ||
| 158 | dma_release_declared_memory(dev); | ||
| 159 | } | ||
| 160 | |||
| 161 | /** | ||
| 162 | * early_init_dt_scan_reserved_mem() - create reserved memory regions | ||
| 163 | * | ||
| 164 | * This function grabs memory from early allocator for device exclusive use | ||
| 165 | * defined in device tree structures. It should be called by arch specific code | ||
| 166 | * once the early allocator (memblock) has been activated and all other | ||
| 167 | * subsystems have already allocated/reserved memory. | ||
| 168 | */ | ||
| 169 | void __init early_init_dt_scan_reserved_mem(void) | ||
| 170 | { | ||
| 171 | of_scan_flat_dt_by_path("/memory/reserved-memory", | ||
| 172 | fdt_scan_reserved_mem, NULL); | ||
| 173 | } | ||
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 9b439ac63d8e..f6dcde220821 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/of_device.h> | 21 | #include <linux/of_device.h> |
| 22 | #include <linux/of_irq.h> | 22 | #include <linux/of_irq.h> |
| 23 | #include <linux/of_platform.h> | 23 | #include <linux/of_platform.h> |
| 24 | #include <linux/of_reserved_mem.h> | ||
| 25 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
| 26 | 25 | ||
| 27 | const struct of_device_id of_default_bus_match_table[] = { | 26 | const struct of_device_id of_default_bus_match_table[] = { |
| @@ -219,8 +218,6 @@ static struct platform_device *of_platform_device_create_pdata( | |||
| 219 | dev->dev.bus = &platform_bus_type; | 218 | dev->dev.bus = &platform_bus_type; |
| 220 | dev->dev.platform_data = platform_data; | 219 | dev->dev.platform_data = platform_data; |
| 221 | 220 | ||
| 222 | of_reserved_mem_device_init(&dev->dev); | ||
| 223 | |||
| 224 | /* We do not fill the DMA ops for platform devices by default. | 221 | /* We do not fill the DMA ops for platform devices by default. |
| 225 | * This is currently the responsibility of the platform code | 222 | * This is currently the responsibility of the platform code |
| 226 | * to do such, possibly using a device notifier | 223 | * to do such, possibly using a device notifier |
| @@ -228,7 +225,6 @@ static struct platform_device *of_platform_device_create_pdata( | |||
| 228 | 225 | ||
| 229 | if (of_device_add(dev) != 0) { | 226 | if (of_device_add(dev) != 0) { |
| 230 | platform_device_put(dev); | 227 | platform_device_put(dev); |
| 231 | of_reserved_mem_device_release(&dev->dev); | ||
| 232 | return NULL; | 228 | return NULL; |
| 233 | } | 229 | } |
| 234 | 230 | ||
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 0b7d23b4ad95..be12fbfcae10 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
| @@ -994,14 +994,16 @@ void acpiphp_enumerate_slots(struct pci_bus *bus) | |||
| 994 | 994 | ||
| 995 | /* | 995 | /* |
| 996 | * This bridge should have been registered as a hotplug function | 996 | * This bridge should have been registered as a hotplug function |
| 997 | * under its parent, so the context has to be there. If not, we | 997 | * under its parent, so the context should be there, unless the |
| 998 | * are in deep goo. | 998 | * parent is going to be handled by pciehp, in which case this |
| 999 | * bridge is not interesting to us either. | ||
| 999 | */ | 1000 | */ |
| 1000 | mutex_lock(&acpiphp_context_lock); | 1001 | mutex_lock(&acpiphp_context_lock); |
| 1001 | context = acpiphp_get_context(handle); | 1002 | context = acpiphp_get_context(handle); |
| 1002 | if (WARN_ON(!context)) { | 1003 | if (!context) { |
| 1003 | mutex_unlock(&acpiphp_context_lock); | 1004 | mutex_unlock(&acpiphp_context_lock); |
| 1004 | put_device(&bus->dev); | 1005 | put_device(&bus->dev); |
| 1006 | pci_dev_put(bridge->pci_dev); | ||
| 1005 | kfree(bridge); | 1007 | kfree(bridge); |
| 1006 | return; | 1008 | return; |
| 1007 | } | 1009 | } |
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c index 8cd34bf644b3..77df9cb00688 100644 --- a/drivers/s390/char/sclp_cmd.c +++ b/drivers/s390/char/sclp_cmd.c | |||
| @@ -145,9 +145,11 @@ bool __init sclp_has_linemode(void) | |||
| 145 | 145 | ||
| 146 | if (sccb->header.response_code != 0x20) | 146 | if (sccb->header.response_code != 0x20) |
| 147 | return 0; | 147 | return 0; |
| 148 | if (sccb->sclp_send_mask & (EVTYP_MSG_MASK | EVTYP_PMSGCMD_MASK)) | 148 | if (!(sccb->sclp_send_mask & (EVTYP_OPCMD_MASK | EVTYP_PMSGCMD_MASK))) |
| 149 | return 1; | 149 | return 0; |
| 150 | return 0; | 150 | if (!(sccb->sclp_receive_mask & (EVTYP_MSG_MASK | EVTYP_PMSGCMD_MASK))) |
| 151 | return 0; | ||
| 152 | return 1; | ||
| 151 | } | 153 | } |
| 152 | 154 | ||
| 153 | bool __init sclp_has_vt220(void) | 155 | bool __init sclp_has_vt220(void) |
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c index a0f47c83fd62..3f4ca4e09a4c 100644 --- a/drivers/s390/char/tty3270.c +++ b/drivers/s390/char/tty3270.c | |||
| @@ -810,7 +810,7 @@ static void tty3270_resize_work(struct work_struct *work) | |||
| 810 | struct winsize ws; | 810 | struct winsize ws; |
| 811 | 811 | ||
| 812 | screen = tty3270_alloc_screen(tp->n_rows, tp->n_cols); | 812 | screen = tty3270_alloc_screen(tp->n_rows, tp->n_cols); |
| 813 | if (!screen) | 813 | if (IS_ERR(screen)) |
| 814 | return; | 814 | return; |
| 815 | /* Switch to new output size */ | 815 | /* Switch to new output size */ |
| 816 | spin_lock_bh(&tp->view.lock); | 816 | spin_lock_bh(&tp->view.lock); |
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index fd7cc566095a..d4ac60b4a56e 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c | |||
| @@ -1583,7 +1583,7 @@ static int atmel_spi_probe(struct platform_device *pdev) | |||
| 1583 | /* Initialize the hardware */ | 1583 | /* Initialize the hardware */ |
| 1584 | ret = clk_prepare_enable(clk); | 1584 | ret = clk_prepare_enable(clk); |
| 1585 | if (ret) | 1585 | if (ret) |
| 1586 | goto out_unmap_regs; | 1586 | goto out_free_irq; |
| 1587 | spi_writel(as, CR, SPI_BIT(SWRST)); | 1587 | spi_writel(as, CR, SPI_BIT(SWRST)); |
| 1588 | spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */ | 1588 | spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */ |
| 1589 | if (as->caps.has_wdrbt) { | 1589 | if (as->caps.has_wdrbt) { |
| @@ -1614,6 +1614,7 @@ out_free_dma: | |||
| 1614 | spi_writel(as, CR, SPI_BIT(SWRST)); | 1614 | spi_writel(as, CR, SPI_BIT(SWRST)); |
| 1615 | spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */ | 1615 | spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */ |
| 1616 | clk_disable_unprepare(clk); | 1616 | clk_disable_unprepare(clk); |
| 1617 | out_free_irq: | ||
| 1617 | free_irq(irq, master); | 1618 | free_irq(irq, master); |
| 1618 | out_unmap_regs: | 1619 | out_unmap_regs: |
| 1619 | iounmap(as->regs); | 1620 | iounmap(as->regs); |
diff --git a/drivers/spi/spi-clps711x.c b/drivers/spi/spi-clps711x.c index 5655acf55bfe..6416798828e7 100644 --- a/drivers/spi/spi-clps711x.c +++ b/drivers/spi/spi-clps711x.c | |||
| @@ -226,7 +226,6 @@ static int spi_clps711x_probe(struct platform_device *pdev) | |||
| 226 | dev_name(&pdev->dev), hw); | 226 | dev_name(&pdev->dev), hw); |
| 227 | if (ret) { | 227 | if (ret) { |
| 228 | dev_err(&pdev->dev, "Can't request IRQ\n"); | 228 | dev_err(&pdev->dev, "Can't request IRQ\n"); |
| 229 | clk_put(hw->spi_clk); | ||
| 230 | goto clk_out; | 229 | goto clk_out; |
| 231 | } | 230 | } |
| 232 | 231 | ||
| @@ -247,7 +246,6 @@ err_out: | |||
| 247 | gpio_free(hw->chipselect[i]); | 246 | gpio_free(hw->chipselect[i]); |
| 248 | 247 | ||
| 249 | spi_master_put(master); | 248 | spi_master_put(master); |
| 250 | kfree(master); | ||
| 251 | 249 | ||
| 252 | return ret; | 250 | return ret; |
| 253 | } | 251 | } |
| @@ -263,7 +261,6 @@ static int spi_clps711x_remove(struct platform_device *pdev) | |||
| 263 | gpio_free(hw->chipselect[i]); | 261 | gpio_free(hw->chipselect[i]); |
| 264 | 262 | ||
| 265 | spi_unregister_master(master); | 263 | spi_unregister_master(master); |
| 266 | kfree(master); | ||
| 267 | 264 | ||
| 268 | return 0; | 265 | return 0; |
| 269 | } | 266 | } |
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 6cd07d13ecab..4e44575bd87a 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c | |||
| @@ -476,15 +476,9 @@ static int dspi_probe(struct platform_device *pdev) | |||
| 476 | master->bus_num = bus_num; | 476 | master->bus_num = bus_num; |
| 477 | 477 | ||
| 478 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 478 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 479 | if (!res) { | ||
| 480 | dev_err(&pdev->dev, "can't get platform resource\n"); | ||
| 481 | ret = -EINVAL; | ||
| 482 | goto out_master_put; | ||
| 483 | } | ||
| 484 | |||
| 485 | dspi->base = devm_ioremap_resource(&pdev->dev, res); | 479 | dspi->base = devm_ioremap_resource(&pdev->dev, res); |
| 486 | if (!dspi->base) { | 480 | if (IS_ERR(dspi->base)) { |
| 487 | ret = -EINVAL; | 481 | ret = PTR_ERR(dspi->base); |
| 488 | goto out_master_put; | 482 | goto out_master_put; |
| 489 | } | 483 | } |
| 490 | 484 | ||
diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index dbc5e999a1f5..6adf4e35816d 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c | |||
| @@ -522,8 +522,10 @@ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr, | |||
| 522 | psc_num = master->bus_num; | 522 | psc_num = master->bus_num; |
| 523 | snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num); | 523 | snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num); |
| 524 | clk = devm_clk_get(dev, clk_name); | 524 | clk = devm_clk_get(dev, clk_name); |
| 525 | if (IS_ERR(clk)) | 525 | if (IS_ERR(clk)) { |
| 526 | ret = PTR_ERR(clk); | ||
| 526 | goto free_irq; | 527 | goto free_irq; |
| 528 | } | ||
| 527 | ret = clk_prepare_enable(clk); | 529 | ret = clk_prepare_enable(clk); |
| 528 | if (ret) | 530 | if (ret) |
| 529 | goto free_irq; | 531 | goto free_irq; |
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 2eb06ee0b326..c1a50674c1e3 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c | |||
| @@ -546,8 +546,17 @@ static irqreturn_t ssp_int(int irq, void *dev_id) | |||
| 546 | if (pm_runtime_suspended(&drv_data->pdev->dev)) | 546 | if (pm_runtime_suspended(&drv_data->pdev->dev)) |
| 547 | return IRQ_NONE; | 547 | return IRQ_NONE; |
| 548 | 548 | ||
| 549 | sccr1_reg = read_SSCR1(reg); | 549 | /* |
| 550 | * If the device is not yet in RPM suspended state and we get an | ||
| 551 | * interrupt that is meant for another device, check if status bits | ||
| 552 | * are all set to one. That means that the device is already | ||
| 553 | * powered off. | ||
| 554 | */ | ||
| 550 | status = read_SSSR(reg); | 555 | status = read_SSSR(reg); |
| 556 | if (status == ~0) | ||
| 557 | return IRQ_NONE; | ||
| 558 | |||
| 559 | sccr1_reg = read_SSCR1(reg); | ||
| 551 | 560 | ||
| 552 | /* Ignore possible writes if we don't need to write */ | 561 | /* Ignore possible writes if we don't need to write */ |
| 553 | if (!(sccr1_reg & SSCR1_TIE)) | 562 | if (!(sccr1_reg & SSCR1_TIE)) |
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 512b8893893b..a80376dc3a10 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c | |||
| @@ -1428,6 +1428,8 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) | |||
| 1428 | S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN, | 1428 | S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN, |
| 1429 | sdd->regs + S3C64XX_SPI_INT_EN); | 1429 | sdd->regs + S3C64XX_SPI_INT_EN); |
| 1430 | 1430 | ||
| 1431 | pm_runtime_enable(&pdev->dev); | ||
| 1432 | |||
| 1431 | if (spi_register_master(master)) { | 1433 | if (spi_register_master(master)) { |
| 1432 | dev_err(&pdev->dev, "cannot register SPI master\n"); | 1434 | dev_err(&pdev->dev, "cannot register SPI master\n"); |
| 1433 | ret = -EBUSY; | 1435 | ret = -EBUSY; |
| @@ -1440,8 +1442,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) | |||
| 1440 | mem_res, | 1442 | mem_res, |
| 1441 | sdd->rx_dma.dmach, sdd->tx_dma.dmach); | 1443 | sdd->rx_dma.dmach, sdd->tx_dma.dmach); |
| 1442 | 1444 | ||
| 1443 | pm_runtime_enable(&pdev->dev); | ||
| 1444 | |||
| 1445 | return 0; | 1445 | return 0; |
| 1446 | 1446 | ||
| 1447 | err3: | 1447 | err3: |
diff --git a/drivers/spi/spi-sh-hspi.c b/drivers/spi/spi-sh-hspi.c index 0b68cb592fa4..e488a90a98b8 100644 --- a/drivers/spi/spi-sh-hspi.c +++ b/drivers/spi/spi-sh-hspi.c | |||
| @@ -296,6 +296,8 @@ static int hspi_probe(struct platform_device *pdev) | |||
| 296 | goto error1; | 296 | goto error1; |
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | pm_runtime_enable(&pdev->dev); | ||
| 300 | |||
| 299 | master->num_chipselect = 1; | 301 | master->num_chipselect = 1; |
| 300 | master->bus_num = pdev->id; | 302 | master->bus_num = pdev->id; |
| 301 | master->setup = hspi_setup; | 303 | master->setup = hspi_setup; |
| @@ -309,8 +311,6 @@ static int hspi_probe(struct platform_device *pdev) | |||
| 309 | goto error1; | 311 | goto error1; |
| 310 | } | 312 | } |
| 311 | 313 | ||
| 312 | pm_runtime_enable(&pdev->dev); | ||
| 313 | |||
| 314 | return 0; | 314 | return 0; |
| 315 | 315 | ||
| 316 | error1: | 316 | error1: |
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index a9807dea3887..4fb7a8f83c8a 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c | |||
| @@ -545,6 +545,8 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, | |||
| 545 | long npage; | 545 | long npage; |
| 546 | int ret = 0, prot = 0; | 546 | int ret = 0, prot = 0; |
| 547 | uint64_t mask; | 547 | uint64_t mask; |
| 548 | struct vfio_dma *dma = NULL; | ||
| 549 | unsigned long pfn; | ||
| 548 | 550 | ||
| 549 | end = map->iova + map->size; | 551 | end = map->iova + map->size; |
| 550 | 552 | ||
| @@ -587,8 +589,6 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, | |||
| 587 | } | 589 | } |
| 588 | 590 | ||
| 589 | for (iova = map->iova; iova < end; iova += size, vaddr += size) { | 591 | for (iova = map->iova; iova < end; iova += size, vaddr += size) { |
| 590 | struct vfio_dma *dma = NULL; | ||
| 591 | unsigned long pfn; | ||
| 592 | long i; | 592 | long i; |
| 593 | 593 | ||
| 594 | /* Pin a contiguous chunk of memory */ | 594 | /* Pin a contiguous chunk of memory */ |
| @@ -597,16 +597,15 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, | |||
| 597 | if (npage <= 0) { | 597 | if (npage <= 0) { |
| 598 | WARN_ON(!npage); | 598 | WARN_ON(!npage); |
| 599 | ret = (int)npage; | 599 | ret = (int)npage; |
| 600 | break; | 600 | goto out; |
| 601 | } | 601 | } |
| 602 | 602 | ||
| 603 | /* Verify pages are not already mapped */ | 603 | /* Verify pages are not already mapped */ |
| 604 | for (i = 0; i < npage; i++) { | 604 | for (i = 0; i < npage; i++) { |
| 605 | if (iommu_iova_to_phys(iommu->domain, | 605 | if (iommu_iova_to_phys(iommu->domain, |
| 606 | iova + (i << PAGE_SHIFT))) { | 606 | iova + (i << PAGE_SHIFT))) { |
| 607 | vfio_unpin_pages(pfn, npage, prot, true); | ||
| 608 | ret = -EBUSY; | 607 | ret = -EBUSY; |
| 609 | break; | 608 | goto out_unpin; |
| 610 | } | 609 | } |
| 611 | } | 610 | } |
| 612 | 611 | ||
| @@ -616,8 +615,7 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, | |||
| 616 | if (ret) { | 615 | if (ret) { |
| 617 | if (ret != -EBUSY || | 616 | if (ret != -EBUSY || |
| 618 | map_try_harder(iommu, iova, pfn, npage, prot)) { | 617 | map_try_harder(iommu, iova, pfn, npage, prot)) { |
| 619 | vfio_unpin_pages(pfn, npage, prot, true); | 618 | goto out_unpin; |
| 620 | break; | ||
| 621 | } | 619 | } |
| 622 | } | 620 | } |
| 623 | 621 | ||
| @@ -672,9 +670,8 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, | |||
| 672 | dma = kzalloc(sizeof(*dma), GFP_KERNEL); | 670 | dma = kzalloc(sizeof(*dma), GFP_KERNEL); |
| 673 | if (!dma) { | 671 | if (!dma) { |
| 674 | iommu_unmap(iommu->domain, iova, size); | 672 | iommu_unmap(iommu->domain, iova, size); |
| 675 | vfio_unpin_pages(pfn, npage, prot, true); | ||
| 676 | ret = -ENOMEM; | 673 | ret = -ENOMEM; |
| 677 | break; | 674 | goto out_unpin; |
| 678 | } | 675 | } |
| 679 | 676 | ||
| 680 | dma->size = size; | 677 | dma->size = size; |
| @@ -685,16 +682,21 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, | |||
| 685 | } | 682 | } |
| 686 | } | 683 | } |
| 687 | 684 | ||
| 688 | if (ret) { | 685 | WARN_ON(ret); |
| 689 | struct vfio_dma *tmp; | 686 | mutex_unlock(&iommu->lock); |
| 690 | iova = map->iova; | 687 | return ret; |
| 691 | size = map->size; | 688 | |
| 692 | while ((tmp = vfio_find_dma(iommu, iova, size))) { | 689 | out_unpin: |
| 693 | int r = vfio_remove_dma_overlap(iommu, iova, | 690 | vfio_unpin_pages(pfn, npage, prot, true); |
| 694 | &size, tmp); | 691 | |
| 695 | if (WARN_ON(r || !size)) | 692 | out: |
| 696 | break; | 693 | iova = map->iova; |
| 697 | } | 694 | size = map->size; |
| 695 | while ((dma = vfio_find_dma(iommu, iova, size))) { | ||
| 696 | int r = vfio_remove_dma_overlap(iommu, iova, | ||
| 697 | &size, dma); | ||
| 698 | if (WARN_ON(r || !size)) | ||
| 699 | break; | ||
| 698 | } | 700 | } |
| 699 | 701 | ||
| 700 | mutex_unlock(&iommu->lock); | 702 | mutex_unlock(&iommu->lock); |
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 5be5e3d14f79..19f3c3fc65f4 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
| @@ -802,6 +802,12 @@ static int hpwdt_init_one(struct pci_dev *dev, | |||
| 802 | return -ENODEV; | 802 | return -ENODEV; |
| 803 | } | 803 | } |
| 804 | 804 | ||
| 805 | /* | ||
| 806 | * Ignore all auxilary iLO devices with the following PCI ID | ||
| 807 | */ | ||
| 808 | if (dev->subsystem_device == 0x1979) | ||
| 809 | return -ENODEV; | ||
| 810 | |||
| 805 | if (pci_enable_device(dev)) { | 811 | if (pci_enable_device(dev)) { |
| 806 | dev_warn(&dev->dev, | 812 | dev_warn(&dev->dev, |
| 807 | "Not possible to enable PCI Device: 0x%x:0x%x.\n", | 813 | "Not possible to enable PCI Device: 0x%x:0x%x.\n", |
diff --git a/drivers/watchdog/kempld_wdt.c b/drivers/watchdog/kempld_wdt.c index 491419e0772a..5c3d4df63e68 100644 --- a/drivers/watchdog/kempld_wdt.c +++ b/drivers/watchdog/kempld_wdt.c | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | #define KEMPLD_WDT_STAGE_TIMEOUT(x) (0x1b + (x) * 4) | 35 | #define KEMPLD_WDT_STAGE_TIMEOUT(x) (0x1b + (x) * 4) |
| 36 | #define KEMPLD_WDT_STAGE_CFG(x) (0x18 + (x)) | 36 | #define KEMPLD_WDT_STAGE_CFG(x) (0x18 + (x)) |
| 37 | #define STAGE_CFG_GET_PRESCALER(x) (((x) & 0x30) >> 4) | 37 | #define STAGE_CFG_GET_PRESCALER(x) (((x) & 0x30) >> 4) |
| 38 | #define STAGE_CFG_SET_PRESCALER(x) (((x) & 0x30) << 4) | 38 | #define STAGE_CFG_SET_PRESCALER(x) (((x) & 0x3) << 4) |
| 39 | #define STAGE_CFG_PRESCALER_MASK 0x30 | 39 | #define STAGE_CFG_PRESCALER_MASK 0x30 |
| 40 | #define STAGE_CFG_ACTION_MASK 0x7 | 40 | #define STAGE_CFG_ACTION_MASK 0x7 |
| 41 | #define STAGE_CFG_ASSERT (1 << 3) | 41 | #define STAGE_CFG_ASSERT (1 << 3) |
diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c index 1f94b42764aa..f6caa77151c7 100644 --- a/drivers/watchdog/sunxi_wdt.c +++ b/drivers/watchdog/sunxi_wdt.c | |||
| @@ -146,7 +146,7 @@ static const struct watchdog_ops sunxi_wdt_ops = { | |||
| 146 | .set_timeout = sunxi_wdt_set_timeout, | 146 | .set_timeout = sunxi_wdt_set_timeout, |
| 147 | }; | 147 | }; |
| 148 | 148 | ||
| 149 | static int __init sunxi_wdt_probe(struct platform_device *pdev) | 149 | static int sunxi_wdt_probe(struct platform_device *pdev) |
| 150 | { | 150 | { |
| 151 | struct sunxi_wdt_dev *sunxi_wdt; | 151 | struct sunxi_wdt_dev *sunxi_wdt; |
| 152 | struct resource *res; | 152 | struct resource *res; |
| @@ -187,7 +187,7 @@ static int __init sunxi_wdt_probe(struct platform_device *pdev) | |||
| 187 | return 0; | 187 | return 0; |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | static int __exit sunxi_wdt_remove(struct platform_device *pdev) | 190 | static int sunxi_wdt_remove(struct platform_device *pdev) |
| 191 | { | 191 | { |
| 192 | struct sunxi_wdt_dev *sunxi_wdt = platform_get_drvdata(pdev); | 192 | struct sunxi_wdt_dev *sunxi_wdt = platform_get_drvdata(pdev); |
| 193 | 193 | ||
diff --git a/drivers/watchdog/ts72xx_wdt.c b/drivers/watchdog/ts72xx_wdt.c index 42913f131dc2..c9b0c627fe7e 100644 --- a/drivers/watchdog/ts72xx_wdt.c +++ b/drivers/watchdog/ts72xx_wdt.c | |||
| @@ -310,7 +310,8 @@ static long ts72xx_wdt_ioctl(struct file *file, unsigned int cmd, | |||
| 310 | 310 | ||
| 311 | case WDIOC_GETSTATUS: | 311 | case WDIOC_GETSTATUS: |
| 312 | case WDIOC_GETBOOTSTATUS: | 312 | case WDIOC_GETBOOTSTATUS: |
| 313 | return put_user(0, p); | 313 | error = put_user(0, p); |
| 314 | break; | ||
| 314 | 315 | ||
| 315 | case WDIOC_KEEPALIVE: | 316 | case WDIOC_KEEPALIVE: |
| 316 | ts72xx_wdt_kick(wdt); | 317 | ts72xx_wdt_kick(wdt); |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 4ae17ed13b32..62176ad89846 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
| @@ -1561,8 +1561,9 @@ int btrfs_insert_fs_root(struct btrfs_fs_info *fs_info, | |||
| 1561 | return ret; | 1561 | return ret; |
| 1562 | } | 1562 | } |
| 1563 | 1563 | ||
| 1564 | struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info, | 1564 | struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info, |
| 1565 | struct btrfs_key *location) | 1565 | struct btrfs_key *location, |
| 1566 | bool check_ref) | ||
| 1566 | { | 1567 | { |
| 1567 | struct btrfs_root *root; | 1568 | struct btrfs_root *root; |
| 1568 | int ret; | 1569 | int ret; |
| @@ -1586,7 +1587,7 @@ struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info, | |||
| 1586 | again: | 1587 | again: |
| 1587 | root = btrfs_lookup_fs_root(fs_info, location->objectid); | 1588 | root = btrfs_lookup_fs_root(fs_info, location->objectid); |
| 1588 | if (root) { | 1589 | if (root) { |
| 1589 | if (btrfs_root_refs(&root->root_item) == 0) | 1590 | if (check_ref && btrfs_root_refs(&root->root_item) == 0) |
| 1590 | return ERR_PTR(-ENOENT); | 1591 | return ERR_PTR(-ENOENT); |
| 1591 | return root; | 1592 | return root; |
| 1592 | } | 1593 | } |
| @@ -1595,7 +1596,7 @@ again: | |||
| 1595 | if (IS_ERR(root)) | 1596 | if (IS_ERR(root)) |
| 1596 | return root; | 1597 | return root; |
| 1597 | 1598 | ||
| 1598 | if (btrfs_root_refs(&root->root_item) == 0) { | 1599 | if (check_ref && btrfs_root_refs(&root->root_item) == 0) { |
| 1599 | ret = -ENOENT; | 1600 | ret = -ENOENT; |
| 1600 | goto fail; | 1601 | goto fail; |
| 1601 | } | 1602 | } |
diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h index b71acd6e1e5b..5ce2a7da8b11 100644 --- a/fs/btrfs/disk-io.h +++ b/fs/btrfs/disk-io.h | |||
| @@ -68,8 +68,17 @@ struct btrfs_root *btrfs_read_fs_root(struct btrfs_root *tree_root, | |||
| 68 | int btrfs_init_fs_root(struct btrfs_root *root); | 68 | int btrfs_init_fs_root(struct btrfs_root *root); |
| 69 | int btrfs_insert_fs_root(struct btrfs_fs_info *fs_info, | 69 | int btrfs_insert_fs_root(struct btrfs_fs_info *fs_info, |
| 70 | struct btrfs_root *root); | 70 | struct btrfs_root *root); |
| 71 | struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info, | 71 | |
| 72 | struct btrfs_key *location); | 72 | struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info, |
| 73 | struct btrfs_key *key, | ||
| 74 | bool check_ref); | ||
| 75 | static inline struct btrfs_root * | ||
| 76 | btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info, | ||
| 77 | struct btrfs_key *location) | ||
| 78 | { | ||
| 79 | return btrfs_get_fs_root(fs_info, location, true); | ||
| 80 | } | ||
| 81 | |||
| 73 | int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info); | 82 | int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info); |
| 74 | void btrfs_btree_balance_dirty(struct btrfs_root *root); | 83 | void btrfs_btree_balance_dirty(struct btrfs_root *root); |
| 75 | void btrfs_btree_balance_dirty_nodelay(struct btrfs_root *root); | 84 | void btrfs_btree_balance_dirty_nodelay(struct btrfs_root *root); |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 22bda32acb89..51731b76900d 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
| @@ -1490,10 +1490,8 @@ static noinline u64 find_delalloc_range(struct extent_io_tree *tree, | |||
| 1490 | cur_start = state->end + 1; | 1490 | cur_start = state->end + 1; |
| 1491 | node = rb_next(node); | 1491 | node = rb_next(node); |
| 1492 | total_bytes += state->end - state->start + 1; | 1492 | total_bytes += state->end - state->start + 1; |
| 1493 | if (total_bytes >= max_bytes) { | 1493 | if (total_bytes >= max_bytes) |
| 1494 | *end = *start + max_bytes - 1; | ||
| 1495 | break; | 1494 | break; |
| 1496 | } | ||
| 1497 | if (!node) | 1495 | if (!node) |
| 1498 | break; | 1496 | break; |
| 1499 | } | 1497 | } |
| @@ -1635,10 +1633,9 @@ again: | |||
| 1635 | 1633 | ||
| 1636 | /* | 1634 | /* |
| 1637 | * make sure to limit the number of pages we try to lock down | 1635 | * make sure to limit the number of pages we try to lock down |
| 1638 | * if we're looping. | ||
| 1639 | */ | 1636 | */ |
| 1640 | if (delalloc_end + 1 - delalloc_start > max_bytes && loops) | 1637 | if (delalloc_end + 1 - delalloc_start > max_bytes) |
| 1641 | delalloc_end = delalloc_start + PAGE_CACHE_SIZE - 1; | 1638 | delalloc_end = delalloc_start + max_bytes - 1; |
| 1642 | 1639 | ||
| 1643 | /* step two, lock all the pages after the page that has start */ | 1640 | /* step two, lock all the pages after the page that has start */ |
| 1644 | ret = lock_delalloc_pages(inode, locked_page, | 1641 | ret = lock_delalloc_pages(inode, locked_page, |
| @@ -1649,8 +1646,7 @@ again: | |||
| 1649 | */ | 1646 | */ |
| 1650 | free_extent_state(cached_state); | 1647 | free_extent_state(cached_state); |
| 1651 | if (!loops) { | 1648 | if (!loops) { |
| 1652 | unsigned long offset = (*start) & (PAGE_CACHE_SIZE - 1); | 1649 | max_bytes = PAGE_CACHE_SIZE; |
| 1653 | max_bytes = PAGE_CACHE_SIZE - offset; | ||
| 1654 | loops = 1; | 1650 | loops = 1; |
| 1655 | goto again; | 1651 | goto again; |
| 1656 | } else { | 1652 | } else { |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 22ebc13b6c99..b0ef7b07b1b3 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
| @@ -7986,7 +7986,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
| 7986 | 7986 | ||
| 7987 | 7987 | ||
| 7988 | /* check for collisions, even if the name isn't there */ | 7988 | /* check for collisions, even if the name isn't there */ |
| 7989 | ret = btrfs_check_dir_item_collision(root, new_dir->i_ino, | 7989 | ret = btrfs_check_dir_item_collision(dest, new_dir->i_ino, |
| 7990 | new_dentry->d_name.name, | 7990 | new_dentry->d_name.name, |
| 7991 | new_dentry->d_name.len); | 7991 | new_dentry->d_name.len); |
| 7992 | 7992 | ||
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index a5a26320503f..4a355726151e 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
| @@ -588,7 +588,7 @@ static struct btrfs_root *read_fs_root(struct btrfs_fs_info *fs_info, | |||
| 588 | else | 588 | else |
| 589 | key.offset = (u64)-1; | 589 | key.offset = (u64)-1; |
| 590 | 590 | ||
| 591 | return btrfs_read_fs_root_no_name(fs_info, &key); | 591 | return btrfs_get_fs_root(fs_info, &key, false); |
| 592 | } | 592 | } |
| 593 | 593 | ||
| 594 | #ifdef BTRFS_COMPAT_EXTENT_TREE_V0 | 594 | #ifdef BTRFS_COMPAT_EXTENT_TREE_V0 |
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index 0b1f4ef8db98..ec71ea44d2b4 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c | |||
| @@ -299,11 +299,6 @@ int btrfs_find_orphan_roots(struct btrfs_root *tree_root) | |||
| 299 | continue; | 299 | continue; |
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | if (btrfs_root_refs(&root->root_item) == 0) { | ||
| 303 | btrfs_add_dead_root(root); | ||
| 304 | continue; | ||
| 305 | } | ||
| 306 | |||
| 307 | err = btrfs_init_fs_root(root); | 302 | err = btrfs_init_fs_root(root); |
| 308 | if (err) { | 303 | if (err) { |
| 309 | btrfs_free_fs_root(root); | 304 | btrfs_free_fs_root(root); |
| @@ -318,6 +313,9 @@ int btrfs_find_orphan_roots(struct btrfs_root *tree_root) | |||
| 318 | btrfs_free_fs_root(root); | 313 | btrfs_free_fs_root(root); |
| 319 | break; | 314 | break; |
| 320 | } | 315 | } |
| 316 | |||
| 317 | if (btrfs_root_refs(&root->root_item) == 0) | ||
| 318 | btrfs_add_dead_root(root); | ||
| 321 | } | 319 | } |
| 322 | 320 | ||
| 323 | btrfs_free_path(path); | 321 | btrfs_free_path(path); |
diff --git a/fs/buffer.c b/fs/buffer.c index 4d7433534f5c..6024877335ca 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
| @@ -1005,9 +1005,19 @@ grow_dev_page(struct block_device *bdev, sector_t block, | |||
| 1005 | struct buffer_head *bh; | 1005 | struct buffer_head *bh; |
| 1006 | sector_t end_block; | 1006 | sector_t end_block; |
| 1007 | int ret = 0; /* Will call free_more_memory() */ | 1007 | int ret = 0; /* Will call free_more_memory() */ |
| 1008 | gfp_t gfp_mask; | ||
| 1008 | 1009 | ||
| 1009 | page = find_or_create_page(inode->i_mapping, index, | 1010 | gfp_mask = mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS; |
| 1010 | (mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS)|__GFP_MOVABLE); | 1011 | gfp_mask |= __GFP_MOVABLE; |
| 1012 | /* | ||
| 1013 | * XXX: __getblk_slow() can not really deal with failure and | ||
| 1014 | * will endlessly loop on improvised global reclaim. Prefer | ||
| 1015 | * looping in the allocator rather than here, at least that | ||
| 1016 | * code knows what it's doing. | ||
| 1017 | */ | ||
| 1018 | gfp_mask |= __GFP_NOFAIL; | ||
| 1019 | |||
| 1020 | page = find_or_create_page(inode->i_mapping, index, gfp_mask); | ||
| 1011 | if (!page) | 1021 | if (!page) |
| 1012 | return ret; | 1022 | return ret; |
| 1013 | 1023 | ||
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 1194b1f0f839..f8cde46de9cd 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
| @@ -1783,7 +1783,7 @@ retry: | |||
| 1783 | d_tmpfile(dentry, inode); | 1783 | d_tmpfile(dentry, inode); |
| 1784 | err = ext3_orphan_add(handle, inode); | 1784 | err = ext3_orphan_add(handle, inode); |
| 1785 | if (err) | 1785 | if (err) |
| 1786 | goto err_drop_inode; | 1786 | goto err_unlock_inode; |
| 1787 | mark_inode_dirty(inode); | 1787 | mark_inode_dirty(inode); |
| 1788 | unlock_new_inode(inode); | 1788 | unlock_new_inode(inode); |
| 1789 | } | 1789 | } |
| @@ -1791,10 +1791,9 @@ retry: | |||
| 1791 | if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries)) | 1791 | if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries)) |
| 1792 | goto retry; | 1792 | goto retry; |
| 1793 | return err; | 1793 | return err; |
| 1794 | err_drop_inode: | 1794 | err_unlock_inode: |
| 1795 | ext3_journal_stop(handle); | 1795 | ext3_journal_stop(handle); |
| 1796 | unlock_new_inode(inode); | 1796 | unlock_new_inode(inode); |
| 1797 | iput(inode); | ||
| 1798 | return err; | 1797 | return err; |
| 1799 | } | 1798 | } |
| 1800 | 1799 | ||
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 0d424d7ac02b..e274e9c1171f 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
| @@ -2563,7 +2563,7 @@ retry: | |||
| 2563 | break; | 2563 | break; |
| 2564 | } | 2564 | } |
| 2565 | blk_finish_plug(&plug); | 2565 | blk_finish_plug(&plug); |
| 2566 | if (!ret && !cycled) { | 2566 | if (!ret && !cycled && wbc->nr_to_write > 0) { |
| 2567 | cycled = 1; | 2567 | cycled = 1; |
| 2568 | mpd.last_page = writeback_index - 1; | 2568 | mpd.last_page = writeback_index - 1; |
| 2569 | mpd.first_page = 0; | 2569 | mpd.first_page = 0; |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 1bec5a5c1e45..5a0408d7b114 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
| @@ -2319,7 +2319,7 @@ retry: | |||
| 2319 | d_tmpfile(dentry, inode); | 2319 | d_tmpfile(dentry, inode); |
| 2320 | err = ext4_orphan_add(handle, inode); | 2320 | err = ext4_orphan_add(handle, inode); |
| 2321 | if (err) | 2321 | if (err) |
| 2322 | goto err_drop_inode; | 2322 | goto err_unlock_inode; |
| 2323 | mark_inode_dirty(inode); | 2323 | mark_inode_dirty(inode); |
| 2324 | unlock_new_inode(inode); | 2324 | unlock_new_inode(inode); |
| 2325 | } | 2325 | } |
| @@ -2328,10 +2328,9 @@ retry: | |||
| 2328 | if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) | 2328 | if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) |
| 2329 | goto retry; | 2329 | goto retry; |
| 2330 | return err; | 2330 | return err; |
| 2331 | err_drop_inode: | 2331 | err_unlock_inode: |
| 2332 | ext4_journal_stop(handle); | 2332 | ext4_journal_stop(handle); |
| 2333 | unlock_new_inode(inode); | 2333 | unlock_new_inode(inode); |
| 2334 | iput(inode); | ||
| 2335 | return err; | 2334 | return err; |
| 2336 | } | 2335 | } |
| 2337 | 2336 | ||
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index c081e34f717f..03e9bebba198 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
| @@ -1350,6 +1350,8 @@ retry: | |||
| 1350 | s_min_extra_isize) { | 1350 | s_min_extra_isize) { |
| 1351 | tried_min_extra_isize++; | 1351 | tried_min_extra_isize++; |
| 1352 | new_extra_isize = s_min_extra_isize; | 1352 | new_extra_isize = s_min_extra_isize; |
| 1353 | kfree(is); is = NULL; | ||
| 1354 | kfree(bs); bs = NULL; | ||
| 1353 | goto retry; | 1355 | goto retry; |
| 1354 | } | 1356 | } |
| 1355 | error = -1; | 1357 | error = -1; |
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 9f8ef9b7674d..8eaa1ba793fc 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
| @@ -288,10 +288,14 @@ static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma) | |||
| 288 | static unsigned long proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr, unsigned long len, unsigned long pgoff, unsigned long flags) | 288 | static unsigned long proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr, unsigned long len, unsigned long pgoff, unsigned long flags) |
| 289 | { | 289 | { |
| 290 | struct proc_dir_entry *pde = PDE(file_inode(file)); | 290 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
| 291 | int rv = -EIO; | 291 | unsigned long rv = -EIO; |
| 292 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 292 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long) = NULL; |
| 293 | if (use_pde(pde)) { | 293 | if (use_pde(pde)) { |
| 294 | get_unmapped_area = pde->proc_fops->get_unmapped_area; | 294 | #ifdef CONFIG_MMU |
| 295 | get_unmapped_area = current->mm->get_unmapped_area; | ||
| 296 | #endif | ||
| 297 | if (pde->proc_fops->get_unmapped_area) | ||
| 298 | get_unmapped_area = pde->proc_fops->get_unmapped_area; | ||
| 295 | if (get_unmapped_area) | 299 | if (get_unmapped_area) |
| 296 | rv = get_unmapped_area(file, orig_addr, len, pgoff, flags); | 300 | rv = get_unmapped_area(file, orig_addr, len, pgoff, flags); |
| 297 | unuse_pde(pde); | 301 | unuse_pde(pde); |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 7366e9d63cee..390bdab01c3c 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
| @@ -941,6 +941,8 @@ static void pte_to_pagemap_entry(pagemap_entry_t *pme, struct pagemapread *pm, | |||
| 941 | frame = pte_pfn(pte); | 941 | frame = pte_pfn(pte); |
| 942 | flags = PM_PRESENT; | 942 | flags = PM_PRESENT; |
| 943 | page = vm_normal_page(vma, addr, pte); | 943 | page = vm_normal_page(vma, addr, pte); |
| 944 | if (pte_soft_dirty(pte)) | ||
| 945 | flags2 |= __PM_SOFT_DIRTY; | ||
| 944 | } else if (is_swap_pte(pte)) { | 946 | } else if (is_swap_pte(pte)) { |
| 945 | swp_entry_t entry; | 947 | swp_entry_t entry; |
| 946 | if (pte_swp_soft_dirty(pte)) | 948 | if (pte_swp_soft_dirty(pte)) |
| @@ -960,7 +962,7 @@ static void pte_to_pagemap_entry(pagemap_entry_t *pme, struct pagemapread *pm, | |||
| 960 | 962 | ||
| 961 | if (page && !PageAnon(page)) | 963 | if (page && !PageAnon(page)) |
| 962 | flags |= PM_FILE; | 964 | flags |= PM_FILE; |
| 963 | if ((vma->vm_flags & VM_SOFTDIRTY) || pte_soft_dirty(pte)) | 965 | if ((vma->vm_flags & VM_SOFTDIRTY)) |
| 964 | flags2 |= __PM_SOFT_DIRTY; | 966 | flags2 |= __PM_SOFT_DIRTY; |
| 965 | 967 | ||
| 966 | *pme = make_pme(PM_PFRAME(frame) | PM_STATUS2(pm->v2, flags2) | flags); | 968 | *pme = make_pme(PM_PFRAME(frame) | PM_STATUS2(pm->v2, flags2) | flags); |
diff --git a/fs/statfs.c b/fs/statfs.c index c219e733f553..083dc0ac9140 100644 --- a/fs/statfs.c +++ b/fs/statfs.c | |||
| @@ -94,7 +94,7 @@ retry: | |||
| 94 | 94 | ||
| 95 | int fd_statfs(int fd, struct kstatfs *st) | 95 | int fd_statfs(int fd, struct kstatfs *st) |
| 96 | { | 96 | { |
| 97 | struct fd f = fdget(fd); | 97 | struct fd f = fdget_raw(fd); |
| 98 | int error = -EBADF; | 98 | int error = -EBADF; |
| 99 | if (f.file) { | 99 | if (f.file) { |
| 100 | error = vfs_statfs(&f.file->f_path, st); | 100 | error = vfs_statfs(&f.file->f_path, st); |
diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h index edbd250809cb..bed35e36fd27 100644 --- a/include/dt-bindings/pinctrl/omap.h +++ b/include/dt-bindings/pinctrl/omap.h | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | #define PULL_UP (1 << 4) | 23 | #define PULL_UP (1 << 4) |
| 24 | #define ALTELECTRICALSEL (1 << 5) | 24 | #define ALTELECTRICALSEL (1 << 5) |
| 25 | 25 | ||
| 26 | /* 34xx specific mux bit defines */ | 26 | /* omap3/4/5 specific mux bit defines */ |
| 27 | #define INPUT_EN (1 << 8) | 27 | #define INPUT_EN (1 << 8) |
| 28 | #define OFF_EN (1 << 9) | 28 | #define OFF_EN (1 << 9) |
| 29 | #define OFFOUT_EN (1 << 10) | 29 | #define OFFOUT_EN (1 << 10) |
| @@ -31,8 +31,6 @@ | |||
| 31 | #define OFF_PULL_EN (1 << 12) | 31 | #define OFF_PULL_EN (1 << 12) |
| 32 | #define OFF_PULL_UP (1 << 13) | 32 | #define OFF_PULL_UP (1 << 13) |
| 33 | #define WAKEUP_EN (1 << 14) | 33 | #define WAKEUP_EN (1 << 14) |
| 34 | |||
| 35 | /* 44xx specific mux bit defines */ | ||
| 36 | #define WAKEUP_EVENT (1 << 15) | 34 | #define WAKEUP_EVENT (1 << 15) |
| 37 | 35 | ||
| 38 | /* Active pin states */ | 36 | /* Active pin states */ |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 842de225055f..ded429966c1f 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
| @@ -65,6 +65,21 @@ | |||
| 65 | #define __visible __attribute__((externally_visible)) | 65 | #define __visible __attribute__((externally_visible)) |
| 66 | #endif | 66 | #endif |
| 67 | 67 | ||
| 68 | /* | ||
| 69 | * GCC 'asm goto' miscompiles certain code sequences: | ||
| 70 | * | ||
| 71 | * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 | ||
| 72 | * | ||
| 73 | * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. | ||
| 74 | * Fixed in GCC 4.8.2 and later versions. | ||
| 75 | * | ||
| 76 | * (asm goto is automatically volatile - the naming reflects this.) | ||
| 77 | */ | ||
| 78 | #if GCC_VERSION <= 40801 | ||
| 79 | # define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) | ||
| 80 | #else | ||
| 81 | # define asm_volatile_goto(x...) do { asm goto(x); } while (0) | ||
| 82 | #endif | ||
| 68 | 83 | ||
| 69 | #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP | 84 | #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP |
| 70 | #if GCC_VERSION >= 40400 | 85 | #if GCC_VERSION >= 40400 |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index ecc82b37c4cc..b3e7a667e03c 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -137,47 +137,24 @@ extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, | |||
| 137 | extern void mem_cgroup_replace_page_cache(struct page *oldpage, | 137 | extern void mem_cgroup_replace_page_cache(struct page *oldpage, |
| 138 | struct page *newpage); | 138 | struct page *newpage); |
| 139 | 139 | ||
| 140 | /** | 140 | static inline void mem_cgroup_oom_enable(void) |
| 141 | * mem_cgroup_toggle_oom - toggle the memcg OOM killer for the current task | ||
| 142 | * @new: true to enable, false to disable | ||
| 143 | * | ||
| 144 | * Toggle whether a failed memcg charge should invoke the OOM killer | ||
| 145 | * or just return -ENOMEM. Returns the previous toggle state. | ||
| 146 | * | ||
| 147 | * NOTE: Any path that enables the OOM killer before charging must | ||
| 148 | * call mem_cgroup_oom_synchronize() afterward to finalize the | ||
| 149 | * OOM handling and clean up. | ||
| 150 | */ | ||
| 151 | static inline bool mem_cgroup_toggle_oom(bool new) | ||
| 152 | { | 141 | { |
| 153 | bool old; | 142 | WARN_ON(current->memcg_oom.may_oom); |
| 154 | 143 | current->memcg_oom.may_oom = 1; | |
| 155 | old = current->memcg_oom.may_oom; | ||
| 156 | current->memcg_oom.may_oom = new; | ||
| 157 | |||
| 158 | return old; | ||
| 159 | } | 144 | } |
| 160 | 145 | ||
| 161 | static inline void mem_cgroup_enable_oom(void) | 146 | static inline void mem_cgroup_oom_disable(void) |
| 162 | { | 147 | { |
| 163 | bool old = mem_cgroup_toggle_oom(true); | 148 | WARN_ON(!current->memcg_oom.may_oom); |
| 164 | 149 | current->memcg_oom.may_oom = 0; | |
| 165 | WARN_ON(old == true); | ||
| 166 | } | ||
| 167 | |||
| 168 | static inline void mem_cgroup_disable_oom(void) | ||
| 169 | { | ||
| 170 | bool old = mem_cgroup_toggle_oom(false); | ||
| 171 | |||
| 172 | WARN_ON(old == false); | ||
| 173 | } | 150 | } |
| 174 | 151 | ||
| 175 | static inline bool task_in_memcg_oom(struct task_struct *p) | 152 | static inline bool task_in_memcg_oom(struct task_struct *p) |
| 176 | { | 153 | { |
| 177 | return p->memcg_oom.in_memcg_oom; | 154 | return p->memcg_oom.memcg; |
| 178 | } | 155 | } |
| 179 | 156 | ||
| 180 | bool mem_cgroup_oom_synchronize(void); | 157 | bool mem_cgroup_oom_synchronize(bool wait); |
| 181 | 158 | ||
| 182 | #ifdef CONFIG_MEMCG_SWAP | 159 | #ifdef CONFIG_MEMCG_SWAP |
| 183 | extern int do_swap_account; | 160 | extern int do_swap_account; |
| @@ -402,16 +379,11 @@ static inline void mem_cgroup_end_update_page_stat(struct page *page, | |||
| 402 | { | 379 | { |
| 403 | } | 380 | } |
| 404 | 381 | ||
| 405 | static inline bool mem_cgroup_toggle_oom(bool new) | 382 | static inline void mem_cgroup_oom_enable(void) |
| 406 | { | ||
| 407 | return false; | ||
| 408 | } | ||
| 409 | |||
| 410 | static inline void mem_cgroup_enable_oom(void) | ||
| 411 | { | 383 | { |
| 412 | } | 384 | } |
| 413 | 385 | ||
| 414 | static inline void mem_cgroup_disable_oom(void) | 386 | static inline void mem_cgroup_oom_disable(void) |
| 415 | { | 387 | { |
| 416 | } | 388 | } |
| 417 | 389 | ||
| @@ -420,7 +392,7 @@ static inline bool task_in_memcg_oom(struct task_struct *p) | |||
| 420 | return false; | 392 | return false; |
| 421 | } | 393 | } |
| 422 | 394 | ||
| 423 | static inline bool mem_cgroup_oom_synchronize(void) | 395 | static inline bool mem_cgroup_oom_synchronize(bool wait) |
| 424 | { | 396 | { |
| 425 | return false; | 397 | return false; |
| 426 | } | 398 | } |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 09c2300ddb37..cb358355ef43 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
| @@ -45,6 +45,7 @@ | |||
| 45 | #define MAPPER_CTRL_MINOR 236 | 45 | #define MAPPER_CTRL_MINOR 236 |
| 46 | #define LOOP_CTRL_MINOR 237 | 46 | #define LOOP_CTRL_MINOR 237 |
| 47 | #define VHOST_NET_MINOR 238 | 47 | #define VHOST_NET_MINOR 238 |
| 48 | #define UHID_MINOR 239 | ||
| 48 | #define MISC_DYNAMIC_MINOR 255 | 49 | #define MISC_DYNAMIC_MINOR 255 |
| 49 | 50 | ||
| 50 | struct device; | 51 | struct device; |
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index 68029b30c3dc..5eb4e31af22b 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h | |||
| @@ -181,7 +181,7 @@ enum { | |||
| 181 | MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39, | 181 | MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39, |
| 182 | MLX5_DEV_CAP_FLAG_SIG_HAND_OVER = 1LL << 40, | 182 | MLX5_DEV_CAP_FLAG_SIG_HAND_OVER = 1LL << 40, |
| 183 | MLX5_DEV_CAP_FLAG_DCT = 1LL << 41, | 183 | MLX5_DEV_CAP_FLAG_DCT = 1LL << 41, |
| 184 | MLX5_DEV_CAP_FLAG_CMDIF_CSUM = 1LL << 46, | 184 | MLX5_DEV_CAP_FLAG_CMDIF_CSUM = 3LL << 46, |
| 185 | }; | 185 | }; |
| 186 | 186 | ||
| 187 | enum { | 187 | enum { |
| @@ -417,7 +417,7 @@ struct mlx5_init_seg { | |||
| 417 | struct health_buffer health; | 417 | struct health_buffer health; |
| 418 | __be32 rsvd2[884]; | 418 | __be32 rsvd2[884]; |
| 419 | __be32 health_counter; | 419 | __be32 health_counter; |
| 420 | __be32 rsvd3[1023]; | 420 | __be32 rsvd3[1019]; |
| 421 | __be64 ieee1588_clk; | 421 | __be64 ieee1588_clk; |
| 422 | __be32 ieee1588_clk_type; | 422 | __be32 ieee1588_clk_type; |
| 423 | __be32 clr_intx; | 423 | __be32 clr_intx; |
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 8888381fc150..6b8c496572c8 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h | |||
| @@ -82,7 +82,7 @@ enum { | |||
| 82 | }; | 82 | }; |
| 83 | 83 | ||
| 84 | enum { | 84 | enum { |
| 85 | MLX5_MAX_EQ_NAME = 20 | 85 | MLX5_MAX_EQ_NAME = 32 |
| 86 | }; | 86 | }; |
| 87 | 87 | ||
| 88 | enum { | 88 | enum { |
| @@ -747,8 +747,7 @@ static inline u32 mlx5_idx_to_mkey(u32 mkey_idx) | |||
| 747 | 747 | ||
| 748 | enum { | 748 | enum { |
| 749 | MLX5_PROF_MASK_QP_SIZE = (u64)1 << 0, | 749 | MLX5_PROF_MASK_QP_SIZE = (u64)1 << 0, |
| 750 | MLX5_PROF_MASK_CMDIF_CSUM = (u64)1 << 1, | 750 | MLX5_PROF_MASK_MR_CACHE = (u64)1 << 1, |
| 751 | MLX5_PROF_MASK_MR_CACHE = (u64)1 << 2, | ||
| 752 | }; | 751 | }; |
| 753 | 752 | ||
| 754 | enum { | 753 | enum { |
| @@ -758,7 +757,6 @@ enum { | |||
| 758 | struct mlx5_profile { | 757 | struct mlx5_profile { |
| 759 | u64 mask; | 758 | u64 mask; |
| 760 | u32 log_max_qp; | 759 | u32 log_max_qp; |
| 761 | int cmdif_csum; | ||
| 762 | struct { | 760 | struct { |
| 763 | int size; | 761 | int size; |
| 764 | int limit; | 762 | int limit; |
diff --git a/include/linux/of_reserved_mem.h b/include/linux/of_reserved_mem.h deleted file mode 100644 index c84128255814..000000000000 --- a/include/linux/of_reserved_mem.h +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | #ifndef __OF_RESERVED_MEM_H | ||
| 2 | #define __OF_RESERVED_MEM_H | ||
| 3 | |||
| 4 | #ifdef CONFIG_OF_RESERVED_MEM | ||
| 5 | void of_reserved_mem_device_init(struct device *dev); | ||
| 6 | void of_reserved_mem_device_release(struct device *dev); | ||
| 7 | void early_init_dt_scan_reserved_mem(void); | ||
| 8 | #else | ||
| 9 | static inline void of_reserved_mem_device_init(struct device *dev) { } | ||
| 10 | static inline void of_reserved_mem_device_release(struct device *dev) { } | ||
| 11 | static inline void early_init_dt_scan_reserved_mem(void) { } | ||
| 12 | #endif | ||
| 13 | |||
| 14 | #endif /* __OF_RESERVED_MEM_H */ | ||
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 866e85c5eb94..c8ba627c1d60 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -294,9 +294,31 @@ struct ring_buffer; | |||
| 294 | */ | 294 | */ |
| 295 | struct perf_event { | 295 | struct perf_event { |
| 296 | #ifdef CONFIG_PERF_EVENTS | 296 | #ifdef CONFIG_PERF_EVENTS |
| 297 | struct list_head group_entry; | 297 | /* |
| 298 | * entry onto perf_event_context::event_list; | ||
| 299 | * modifications require ctx->lock | ||
| 300 | * RCU safe iterations. | ||
| 301 | */ | ||
| 298 | struct list_head event_entry; | 302 | struct list_head event_entry; |
| 303 | |||
| 304 | /* | ||
| 305 | * XXX: group_entry and sibling_list should be mutually exclusive; | ||
| 306 | * either you're a sibling on a group, or you're the group leader. | ||
| 307 | * Rework the code to always use the same list element. | ||
| 308 | * | ||
| 309 | * Locked for modification by both ctx->mutex and ctx->lock; holding | ||
| 310 | * either sufficies for read. | ||
| 311 | */ | ||
| 312 | struct list_head group_entry; | ||
| 299 | struct list_head sibling_list; | 313 | struct list_head sibling_list; |
| 314 | |||
| 315 | /* | ||
| 316 | * We need storage to track the entries in perf_pmu_migrate_context; we | ||
| 317 | * cannot use the event_entry because of RCU and we want to keep the | ||
| 318 | * group in tact which avoids us using the other two entries. | ||
| 319 | */ | ||
| 320 | struct list_head migrate_entry; | ||
| 321 | |||
| 300 | struct hlist_node hlist_entry; | 322 | struct hlist_node hlist_entry; |
| 301 | int nr_siblings; | 323 | int nr_siblings; |
| 302 | int group_flags; | 324 | int group_flags; |
diff --git a/include/linux/random.h b/include/linux/random.h index 3b9377d6b7a5..6312dd9ba449 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
| @@ -17,6 +17,7 @@ extern void add_interrupt_randomness(int irq, int irq_flags); | |||
| 17 | extern void get_random_bytes(void *buf, int nbytes); | 17 | extern void get_random_bytes(void *buf, int nbytes); |
| 18 | extern void get_random_bytes_arch(void *buf, int nbytes); | 18 | extern void get_random_bytes_arch(void *buf, int nbytes); |
| 19 | void generate_random_uuid(unsigned char uuid_out[16]); | 19 | void generate_random_uuid(unsigned char uuid_out[16]); |
| 20 | extern int random_int_secret_init(void); | ||
| 20 | 21 | ||
| 21 | #ifndef MODULE | 22 | #ifndef MODULE |
| 22 | extern const struct file_operations random_fops, urandom_fops; | 23 | extern const struct file_operations random_fops, urandom_fops; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 6682da36b293..e27baeeda3f4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1394,11 +1394,10 @@ struct task_struct { | |||
| 1394 | } memcg_batch; | 1394 | } memcg_batch; |
| 1395 | unsigned int memcg_kmem_skip_account; | 1395 | unsigned int memcg_kmem_skip_account; |
| 1396 | struct memcg_oom_info { | 1396 | struct memcg_oom_info { |
| 1397 | struct mem_cgroup *memcg; | ||
| 1398 | gfp_t gfp_mask; | ||
| 1399 | int order; | ||
| 1397 | unsigned int may_oom:1; | 1400 | unsigned int may_oom:1; |
| 1398 | unsigned int in_memcg_oom:1; | ||
| 1399 | unsigned int oom_locked:1; | ||
| 1400 | int wakeups; | ||
| 1401 | struct mem_cgroup *wait_on_memcg; | ||
| 1402 | } memcg_oom; | 1401 | } memcg_oom; |
| 1403 | #endif | 1402 | #endif |
| 1404 | #ifdef CONFIG_UPROBES | 1403 | #ifdef CONFIG_UPROBES |
diff --git a/include/linux/timex.h b/include/linux/timex.h index dd3edd7dfc94..9d3f1a5b6178 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
| @@ -64,6 +64,20 @@ | |||
| 64 | 64 | ||
| 65 | #include <asm/timex.h> | 65 | #include <asm/timex.h> |
| 66 | 66 | ||
| 67 | #ifndef random_get_entropy | ||
| 68 | /* | ||
| 69 | * The random_get_entropy() function is used by the /dev/random driver | ||
| 70 | * in order to extract entropy via the relative unpredictability of | ||
| 71 | * when an interrupt takes places versus a high speed, fine-grained | ||
| 72 | * timing source or cycle counter. Since it will be occurred on every | ||
| 73 | * single interrupt, it must have a very low cost/overhead. | ||
| 74 | * | ||
| 75 | * By default we use get_cycles() for this purpose, but individual | ||
| 76 | * architectures may override this in their asm/timex.h header file. | ||
| 77 | */ | ||
| 78 | #define random_get_entropy() get_cycles() | ||
| 79 | #endif | ||
| 80 | |||
| 67 | /* | 81 | /* |
| 68 | * SHIFT_PLL is used as a dampening factor to define how much we | 82 | * SHIFT_PLL is used as a dampening factor to define how much we |
| 69 | * adjust the frequency correction for a given offset in PLL mode. | 83 | * adjust the frequency correction for a given offset in PLL mode. |
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h index 80cf8173a65b..2c02f3a8d2ba 100644 --- a/include/linux/vgaarb.h +++ b/include/linux/vgaarb.h | |||
| @@ -65,15 +65,8 @@ struct pci_dev; | |||
| 65 | * out of the arbitration process (and can be safe to take | 65 | * out of the arbitration process (and can be safe to take |
| 66 | * interrupts at any time. | 66 | * interrupts at any time. |
| 67 | */ | 67 | */ |
| 68 | #if defined(CONFIG_VGA_ARB) | ||
| 69 | extern void vga_set_legacy_decoding(struct pci_dev *pdev, | 68 | extern void vga_set_legacy_decoding(struct pci_dev *pdev, |
| 70 | unsigned int decodes); | 69 | unsigned int decodes); |
| 71 | #else | ||
| 72 | static inline void vga_set_legacy_decoding(struct pci_dev *pdev, | ||
| 73 | unsigned int decodes) | ||
| 74 | { | ||
| 75 | } | ||
| 76 | #endif | ||
| 77 | 70 | ||
| 78 | /** | 71 | /** |
| 79 | * vga_get - acquire & locks VGA resources | 72 | * vga_get - acquire & locks VGA resources |
diff --git a/init/main.c b/init/main.c index af310afbef28..63d3e8f2970c 100644 --- a/init/main.c +++ b/init/main.c | |||
| @@ -76,6 +76,7 @@ | |||
| 76 | #include <linux/elevator.h> | 76 | #include <linux/elevator.h> |
| 77 | #include <linux/sched_clock.h> | 77 | #include <linux/sched_clock.h> |
| 78 | #include <linux/context_tracking.h> | 78 | #include <linux/context_tracking.h> |
| 79 | #include <linux/random.h> | ||
| 79 | 80 | ||
| 80 | #include <asm/io.h> | 81 | #include <asm/io.h> |
| 81 | #include <asm/bugs.h> | 82 | #include <asm/bugs.h> |
| @@ -780,6 +781,7 @@ static void __init do_basic_setup(void) | |||
| 780 | do_ctors(); | 781 | do_ctors(); |
| 781 | usermodehelper_enable(); | 782 | usermodehelper_enable(); |
| 782 | do_initcalls(); | 783 | do_initcalls(); |
| 784 | random_int_secret_init(); | ||
| 783 | } | 785 | } |
| 784 | 786 | ||
| 785 | static void __init do_pre_smp_initcalls(void) | 787 | static void __init do_pre_smp_initcalls(void) |
| @@ -1282,6 +1282,12 @@ static int semctl_setval(struct ipc_namespace *ns, int semid, int semnum, | |||
| 1282 | 1282 | ||
| 1283 | sem_lock(sma, NULL, -1); | 1283 | sem_lock(sma, NULL, -1); |
| 1284 | 1284 | ||
| 1285 | if (sma->sem_perm.deleted) { | ||
| 1286 | sem_unlock(sma, -1); | ||
| 1287 | rcu_read_unlock(); | ||
| 1288 | return -EIDRM; | ||
| 1289 | } | ||
| 1290 | |||
| 1285 | curr = &sma->sem_base[semnum]; | 1291 | curr = &sma->sem_base[semnum]; |
| 1286 | 1292 | ||
| 1287 | ipc_assert_locked_object(&sma->sem_perm); | 1293 | ipc_assert_locked_object(&sma->sem_perm); |
| @@ -1336,12 +1342,14 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, | |||
| 1336 | int i; | 1342 | int i; |
| 1337 | 1343 | ||
| 1338 | sem_lock(sma, NULL, -1); | 1344 | sem_lock(sma, NULL, -1); |
| 1345 | if (sma->sem_perm.deleted) { | ||
| 1346 | err = -EIDRM; | ||
| 1347 | goto out_unlock; | ||
| 1348 | } | ||
| 1339 | if(nsems > SEMMSL_FAST) { | 1349 | if(nsems > SEMMSL_FAST) { |
| 1340 | if (!ipc_rcu_getref(sma)) { | 1350 | if (!ipc_rcu_getref(sma)) { |
| 1341 | sem_unlock(sma, -1); | ||
| 1342 | rcu_read_unlock(); | ||
| 1343 | err = -EIDRM; | 1351 | err = -EIDRM; |
| 1344 | goto out_free; | 1352 | goto out_unlock; |
| 1345 | } | 1353 | } |
| 1346 | sem_unlock(sma, -1); | 1354 | sem_unlock(sma, -1); |
| 1347 | rcu_read_unlock(); | 1355 | rcu_read_unlock(); |
| @@ -1354,10 +1362,8 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, | |||
| 1354 | rcu_read_lock(); | 1362 | rcu_read_lock(); |
| 1355 | sem_lock_and_putref(sma); | 1363 | sem_lock_and_putref(sma); |
| 1356 | if (sma->sem_perm.deleted) { | 1364 | if (sma->sem_perm.deleted) { |
| 1357 | sem_unlock(sma, -1); | ||
| 1358 | rcu_read_unlock(); | ||
| 1359 | err = -EIDRM; | 1365 | err = -EIDRM; |
| 1360 | goto out_free; | 1366 | goto out_unlock; |
| 1361 | } | 1367 | } |
| 1362 | } | 1368 | } |
| 1363 | for (i = 0; i < sma->sem_nsems; i++) | 1369 | for (i = 0; i < sma->sem_nsems; i++) |
| @@ -1375,8 +1381,8 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, | |||
| 1375 | struct sem_undo *un; | 1381 | struct sem_undo *un; |
| 1376 | 1382 | ||
| 1377 | if (!ipc_rcu_getref(sma)) { | 1383 | if (!ipc_rcu_getref(sma)) { |
| 1378 | rcu_read_unlock(); | 1384 | err = -EIDRM; |
| 1379 | return -EIDRM; | 1385 | goto out_rcu_wakeup; |
| 1380 | } | 1386 | } |
| 1381 | rcu_read_unlock(); | 1387 | rcu_read_unlock(); |
| 1382 | 1388 | ||
| @@ -1404,10 +1410,8 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, | |||
| 1404 | rcu_read_lock(); | 1410 | rcu_read_lock(); |
| 1405 | sem_lock_and_putref(sma); | 1411 | sem_lock_and_putref(sma); |
| 1406 | if (sma->sem_perm.deleted) { | 1412 | if (sma->sem_perm.deleted) { |
| 1407 | sem_unlock(sma, -1); | ||
| 1408 | rcu_read_unlock(); | ||
| 1409 | err = -EIDRM; | 1413 | err = -EIDRM; |
| 1410 | goto out_free; | 1414 | goto out_unlock; |
| 1411 | } | 1415 | } |
| 1412 | 1416 | ||
| 1413 | for (i = 0; i < nsems; i++) | 1417 | for (i = 0; i < nsems; i++) |
| @@ -1431,6 +1435,10 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, | |||
| 1431 | goto out_rcu_wakeup; | 1435 | goto out_rcu_wakeup; |
| 1432 | 1436 | ||
| 1433 | sem_lock(sma, NULL, -1); | 1437 | sem_lock(sma, NULL, -1); |
| 1438 | if (sma->sem_perm.deleted) { | ||
| 1439 | err = -EIDRM; | ||
| 1440 | goto out_unlock; | ||
| 1441 | } | ||
| 1434 | curr = &sma->sem_base[semnum]; | 1442 | curr = &sma->sem_base[semnum]; |
| 1435 | 1443 | ||
| 1436 | switch (cmd) { | 1444 | switch (cmd) { |
| @@ -1836,6 +1844,10 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, | |||
| 1836 | if (error) | 1844 | if (error) |
| 1837 | goto out_rcu_wakeup; | 1845 | goto out_rcu_wakeup; |
| 1838 | 1846 | ||
| 1847 | error = -EIDRM; | ||
| 1848 | locknum = sem_lock(sma, sops, nsops); | ||
| 1849 | if (sma->sem_perm.deleted) | ||
| 1850 | goto out_unlock_free; | ||
| 1839 | /* | 1851 | /* |
| 1840 | * semid identifiers are not unique - find_alloc_undo may have | 1852 | * semid identifiers are not unique - find_alloc_undo may have |
| 1841 | * allocated an undo structure, it was invalidated by an RMID | 1853 | * allocated an undo structure, it was invalidated by an RMID |
| @@ -1843,8 +1855,6 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, | |||
| 1843 | * This case can be detected checking un->semid. The existence of | 1855 | * This case can be detected checking un->semid. The existence of |
| 1844 | * "un" itself is guaranteed by rcu. | 1856 | * "un" itself is guaranteed by rcu. |
| 1845 | */ | 1857 | */ |
| 1846 | error = -EIDRM; | ||
| 1847 | locknum = sem_lock(sma, sops, nsops); | ||
| 1848 | if (un && un->semid == -1) | 1858 | if (un && un->semid == -1) |
| 1849 | goto out_unlock_free; | 1859 | goto out_unlock_free; |
| 1850 | 1860 | ||
| @@ -2057,6 +2067,12 @@ void exit_sem(struct task_struct *tsk) | |||
| 2057 | } | 2067 | } |
| 2058 | 2068 | ||
| 2059 | sem_lock(sma, NULL, -1); | 2069 | sem_lock(sma, NULL, -1); |
| 2070 | /* exit_sem raced with IPC_RMID, nothing to do */ | ||
| 2071 | if (sma->sem_perm.deleted) { | ||
| 2072 | sem_unlock(sma, -1); | ||
| 2073 | rcu_read_unlock(); | ||
| 2074 | continue; | ||
| 2075 | } | ||
| 2060 | un = __lookup_undo(ulp, semid); | 2076 | un = __lookup_undo(ulp, semid); |
| 2061 | if (un == NULL) { | 2077 | if (un == NULL) { |
| 2062 | /* exit_sem raced with IPC_RMID+semget() that created | 2078 | /* exit_sem raced with IPC_RMID+semget() that created |
diff --git a/ipc/util.c b/ipc/util.c index fdb8ae740775..7684f41bce76 100644 --- a/ipc/util.c +++ b/ipc/util.c | |||
| @@ -17,12 +17,27 @@ | |||
| 17 | * Pavel Emelianov <xemul@openvz.org> | 17 | * Pavel Emelianov <xemul@openvz.org> |
| 18 | * | 18 | * |
| 19 | * General sysv ipc locking scheme: | 19 | * General sysv ipc locking scheme: |
| 20 | * when doing ipc id lookups, take the ids->rwsem | 20 | * rcu_read_lock() |
| 21 | * rcu_read_lock() | 21 | * obtain the ipc object (kern_ipc_perm) by looking up the id in an idr |
| 22 | * obtain the ipc object (kern_ipc_perm) | 22 | * tree. |
| 23 | * perform security, capabilities, auditing and permission checks, etc. | 23 | * - perform initial checks (capabilities, auditing and permission, |
| 24 | * acquire the ipc lock (kern_ipc_perm.lock) throught ipc_lock_object() | 24 | * etc). |
| 25 | * perform data updates (ie: SET, RMID, LOCK/UNLOCK commands) | 25 | * - perform read-only operations, such as STAT, INFO commands. |
| 26 | * acquire the ipc lock (kern_ipc_perm.lock) through | ||
| 27 | * ipc_lock_object() | ||
| 28 | * - perform data updates, such as SET, RMID commands and | ||
| 29 | * mechanism-specific operations (semop/semtimedop, | ||
| 30 | * msgsnd/msgrcv, shmat/shmdt). | ||
| 31 | * drop the ipc lock, through ipc_unlock_object(). | ||
| 32 | * rcu_read_unlock() | ||
| 33 | * | ||
| 34 | * The ids->rwsem must be taken when: | ||
| 35 | * - creating, removing and iterating the existing entries in ipc | ||
| 36 | * identifier sets. | ||
| 37 | * - iterating through files under /proc/sysvipc/ | ||
| 38 | * | ||
| 39 | * Note that sems have a special fast path that avoids kern_ipc_perm.lock - | ||
| 40 | * see sem_lock(). | ||
| 26 | */ | 41 | */ |
| 27 | 42 | ||
| 28 | #include <linux/mm.h> | 43 | #include <linux/mm.h> |
diff --git a/kernel/events/core.c b/kernel/events/core.c index cb4238e85b38..d49a9d29334c 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
| @@ -7234,15 +7234,15 @@ void perf_pmu_migrate_context(struct pmu *pmu, int src_cpu, int dst_cpu) | |||
| 7234 | perf_remove_from_context(event); | 7234 | perf_remove_from_context(event); |
| 7235 | unaccount_event_cpu(event, src_cpu); | 7235 | unaccount_event_cpu(event, src_cpu); |
| 7236 | put_ctx(src_ctx); | 7236 | put_ctx(src_ctx); |
| 7237 | list_add(&event->event_entry, &events); | 7237 | list_add(&event->migrate_entry, &events); |
| 7238 | } | 7238 | } |
| 7239 | mutex_unlock(&src_ctx->mutex); | 7239 | mutex_unlock(&src_ctx->mutex); |
| 7240 | 7240 | ||
| 7241 | synchronize_rcu(); | 7241 | synchronize_rcu(); |
| 7242 | 7242 | ||
| 7243 | mutex_lock(&dst_ctx->mutex); | 7243 | mutex_lock(&dst_ctx->mutex); |
| 7244 | list_for_each_entry_safe(event, tmp, &events, event_entry) { | 7244 | list_for_each_entry_safe(event, tmp, &events, migrate_entry) { |
| 7245 | list_del(&event->event_entry); | 7245 | list_del(&event->migrate_entry); |
| 7246 | if (event->state >= PERF_EVENT_STATE_OFF) | 7246 | if (event->state >= PERF_EVENT_STATE_OFF) |
| 7247 | event->state = PERF_EVENT_STATE_INACTIVE; | 7247 | event->state = PERF_EVENT_STATE_INACTIVE; |
| 7248 | account_event_cpu(event, dst_cpu); | 7248 | account_event_cpu(event, dst_cpu); |
diff --git a/lib/kobject.c b/lib/kobject.c index 669bf190d4fb..084f7b18d0c0 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
| @@ -592,7 +592,7 @@ static void kobject_release(struct kref *kref) | |||
| 592 | { | 592 | { |
| 593 | struct kobject *kobj = container_of(kref, struct kobject, kref); | 593 | struct kobject *kobj = container_of(kref, struct kobject, kref); |
| 594 | #ifdef CONFIG_DEBUG_KOBJECT_RELEASE | 594 | #ifdef CONFIG_DEBUG_KOBJECT_RELEASE |
| 595 | pr_debug("kobject: '%s' (%p): %s, parent %p (delayed)\n", | 595 | pr_info("kobject: '%s' (%p): %s, parent %p (delayed)\n", |
| 596 | kobject_name(kobj), kobj, __func__, kobj->parent); | 596 | kobject_name(kobj), kobj, __func__, kobj->parent); |
| 597 | INIT_DELAYED_WORK(&kobj->release, kobject_delayed_cleanup); | 597 | INIT_DELAYED_WORK(&kobj->release, kobject_delayed_cleanup); |
| 598 | schedule_delayed_work(&kobj->release, HZ); | 598 | schedule_delayed_work(&kobj->release, HZ); |
diff --git a/lib/percpu-refcount.c b/lib/percpu-refcount.c index 7deeb6297a48..1a53d497a8c5 100644 --- a/lib/percpu-refcount.c +++ b/lib/percpu-refcount.c | |||
| @@ -53,6 +53,7 @@ int percpu_ref_init(struct percpu_ref *ref, percpu_ref_func_t *release) | |||
| 53 | ref->release = release; | 53 | ref->release = release; |
| 54 | return 0; | 54 | return 0; |
| 55 | } | 55 | } |
| 56 | EXPORT_SYMBOL_GPL(percpu_ref_init); | ||
| 56 | 57 | ||
| 57 | /** | 58 | /** |
| 58 | * percpu_ref_cancel_init - cancel percpu_ref_init() | 59 | * percpu_ref_cancel_init - cancel percpu_ref_init() |
| @@ -84,6 +85,7 @@ void percpu_ref_cancel_init(struct percpu_ref *ref) | |||
| 84 | free_percpu(ref->pcpu_count); | 85 | free_percpu(ref->pcpu_count); |
| 85 | } | 86 | } |
| 86 | } | 87 | } |
| 88 | EXPORT_SYMBOL_GPL(percpu_ref_cancel_init); | ||
| 87 | 89 | ||
| 88 | static void percpu_ref_kill_rcu(struct rcu_head *rcu) | 90 | static void percpu_ref_kill_rcu(struct rcu_head *rcu) |
| 89 | { | 91 | { |
| @@ -156,3 +158,4 @@ void percpu_ref_kill_and_confirm(struct percpu_ref *ref, | |||
| 156 | 158 | ||
| 157 | call_rcu_sched(&ref->rcu, percpu_ref_kill_rcu); | 159 | call_rcu_sched(&ref->rcu, percpu_ref_kill_rcu); |
| 158 | } | 160 | } |
| 161 | EXPORT_SYMBOL_GPL(percpu_ref_kill_and_confirm); | ||
diff --git a/mm/filemap.c b/mm/filemap.c index 1e6aec4a2d2e..ae4846ff4849 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
| @@ -1616,7 +1616,6 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
| 1616 | struct inode *inode = mapping->host; | 1616 | struct inode *inode = mapping->host; |
| 1617 | pgoff_t offset = vmf->pgoff; | 1617 | pgoff_t offset = vmf->pgoff; |
| 1618 | struct page *page; | 1618 | struct page *page; |
| 1619 | bool memcg_oom; | ||
| 1620 | pgoff_t size; | 1619 | pgoff_t size; |
| 1621 | int ret = 0; | 1620 | int ret = 0; |
| 1622 | 1621 | ||
| @@ -1625,11 +1624,7 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
| 1625 | return VM_FAULT_SIGBUS; | 1624 | return VM_FAULT_SIGBUS; |
| 1626 | 1625 | ||
| 1627 | /* | 1626 | /* |
| 1628 | * Do we have something in the page cache already? Either | 1627 | * Do we have something in the page cache already? |
| 1629 | * way, try readahead, but disable the memcg OOM killer for it | ||
| 1630 | * as readahead is optional and no errors are propagated up | ||
| 1631 | * the fault stack. The OOM killer is enabled while trying to | ||
| 1632 | * instantiate the faulting page individually below. | ||
| 1633 | */ | 1628 | */ |
| 1634 | page = find_get_page(mapping, offset); | 1629 | page = find_get_page(mapping, offset); |
| 1635 | if (likely(page) && !(vmf->flags & FAULT_FLAG_TRIED)) { | 1630 | if (likely(page) && !(vmf->flags & FAULT_FLAG_TRIED)) { |
| @@ -1637,14 +1632,10 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
| 1637 | * We found the page, so try async readahead before | 1632 | * We found the page, so try async readahead before |
| 1638 | * waiting for the lock. | 1633 | * waiting for the lock. |
| 1639 | */ | 1634 | */ |
| 1640 | memcg_oom = mem_cgroup_toggle_oom(false); | ||
| 1641 | do_async_mmap_readahead(vma, ra, file, page, offset); | 1635 | do_async_mmap_readahead(vma, ra, file, page, offset); |
| 1642 | mem_cgroup_toggle_oom(memcg_oom); | ||
| 1643 | } else if (!page) { | 1636 | } else if (!page) { |
| 1644 | /* No page in the page cache at all */ | 1637 | /* No page in the page cache at all */ |
| 1645 | memcg_oom = mem_cgroup_toggle_oom(false); | ||
| 1646 | do_sync_mmap_readahead(vma, ra, file, offset); | 1638 | do_sync_mmap_readahead(vma, ra, file, offset); |
| 1647 | mem_cgroup_toggle_oom(memcg_oom); | ||
| 1648 | count_vm_event(PGMAJFAULT); | 1639 | count_vm_event(PGMAJFAULT); |
| 1649 | mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT); | 1640 | mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT); |
| 1650 | ret = VM_FAULT_MAJOR; | 1641 | ret = VM_FAULT_MAJOR; |
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 7489884682d8..610e3df2768a 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
| @@ -2697,6 +2697,7 @@ void __split_huge_page_pmd(struct vm_area_struct *vma, unsigned long address, | |||
| 2697 | 2697 | ||
| 2698 | mmun_start = haddr; | 2698 | mmun_start = haddr; |
| 2699 | mmun_end = haddr + HPAGE_PMD_SIZE; | 2699 | mmun_end = haddr + HPAGE_PMD_SIZE; |
| 2700 | again: | ||
| 2700 | mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end); | 2701 | mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end); |
| 2701 | spin_lock(&mm->page_table_lock); | 2702 | spin_lock(&mm->page_table_lock); |
| 2702 | if (unlikely(!pmd_trans_huge(*pmd))) { | 2703 | if (unlikely(!pmd_trans_huge(*pmd))) { |
| @@ -2719,7 +2720,14 @@ void __split_huge_page_pmd(struct vm_area_struct *vma, unsigned long address, | |||
| 2719 | split_huge_page(page); | 2720 | split_huge_page(page); |
| 2720 | 2721 | ||
| 2721 | put_page(page); | 2722 | put_page(page); |
| 2722 | BUG_ON(pmd_trans_huge(*pmd)); | 2723 | |
| 2724 | /* | ||
| 2725 | * We don't always have down_write of mmap_sem here: a racing | ||
| 2726 | * do_huge_pmd_wp_page() might have copied-on-write to another | ||
| 2727 | * huge page before our split_huge_page() got the anon_vma lock. | ||
| 2728 | */ | ||
| 2729 | if (unlikely(pmd_trans_huge(*pmd))) | ||
| 2730 | goto again; | ||
| 2723 | } | 2731 | } |
| 2724 | 2732 | ||
| 2725 | void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address, | 2733 | void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address, |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index b49579c7f2a5..0b7656e804d1 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
| @@ -653,6 +653,7 @@ static void free_huge_page(struct page *page) | |||
| 653 | BUG_ON(page_count(page)); | 653 | BUG_ON(page_count(page)); |
| 654 | BUG_ON(page_mapcount(page)); | 654 | BUG_ON(page_mapcount(page)); |
| 655 | restore_reserve = PagePrivate(page); | 655 | restore_reserve = PagePrivate(page); |
| 656 | ClearPagePrivate(page); | ||
| 656 | 657 | ||
| 657 | spin_lock(&hugetlb_lock); | 658 | spin_lock(&hugetlb_lock); |
| 658 | hugetlb_cgroup_uncharge_page(hstate_index(h), | 659 | hugetlb_cgroup_uncharge_page(hstate_index(h), |
| @@ -695,8 +696,22 @@ static void prep_compound_gigantic_page(struct page *page, unsigned long order) | |||
| 695 | /* we rely on prep_new_huge_page to set the destructor */ | 696 | /* we rely on prep_new_huge_page to set the destructor */ |
| 696 | set_compound_order(page, order); | 697 | set_compound_order(page, order); |
| 697 | __SetPageHead(page); | 698 | __SetPageHead(page); |
| 699 | __ClearPageReserved(page); | ||
| 698 | for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) { | 700 | for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) { |
| 699 | __SetPageTail(p); | 701 | __SetPageTail(p); |
| 702 | /* | ||
| 703 | * For gigantic hugepages allocated through bootmem at | ||
| 704 | * boot, it's safer to be consistent with the not-gigantic | ||
| 705 | * hugepages and clear the PG_reserved bit from all tail pages | ||
| 706 | * too. Otherwse drivers using get_user_pages() to access tail | ||
| 707 | * pages may get the reference counting wrong if they see | ||
| 708 | * PG_reserved set on a tail page (despite the head page not | ||
| 709 | * having PG_reserved set). Enforcing this consistency between | ||
| 710 | * head and tail pages allows drivers to optimize away a check | ||
| 711 | * on the head page when they need know if put_page() is needed | ||
| 712 | * after get_user_pages(). | ||
| 713 | */ | ||
| 714 | __ClearPageReserved(p); | ||
| 700 | set_page_count(p, 0); | 715 | set_page_count(p, 0); |
| 701 | p->first_page = page; | 716 | p->first_page = page; |
| 702 | } | 717 | } |
| @@ -1329,9 +1344,9 @@ static void __init gather_bootmem_prealloc(void) | |||
| 1329 | #else | 1344 | #else |
| 1330 | page = virt_to_page(m); | 1345 | page = virt_to_page(m); |
| 1331 | #endif | 1346 | #endif |
| 1332 | __ClearPageReserved(page); | ||
| 1333 | WARN_ON(page_count(page) != 1); | 1347 | WARN_ON(page_count(page) != 1); |
| 1334 | prep_compound_huge_page(page, h->order); | 1348 | prep_compound_huge_page(page, h->order); |
| 1349 | WARN_ON(PageReserved(page)); | ||
| 1335 | prep_new_huge_page(h, page, page_to_nid(page)); | 1350 | prep_new_huge_page(h, page, page_to_nid(page)); |
| 1336 | /* | 1351 | /* |
| 1337 | * If we had gigantic hugepages allocated at boot time, we need | 1352 | * If we had gigantic hugepages allocated at boot time, we need |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 1c52ddbc839b..34d3ca9572d6 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
| @@ -866,6 +866,7 @@ static unsigned long mem_cgroup_read_events(struct mem_cgroup *memcg, | |||
| 866 | unsigned long val = 0; | 866 | unsigned long val = 0; |
| 867 | int cpu; | 867 | int cpu; |
| 868 | 868 | ||
| 869 | get_online_cpus(); | ||
| 869 | for_each_online_cpu(cpu) | 870 | for_each_online_cpu(cpu) |
| 870 | val += per_cpu(memcg->stat->events[idx], cpu); | 871 | val += per_cpu(memcg->stat->events[idx], cpu); |
| 871 | #ifdef CONFIG_HOTPLUG_CPU | 872 | #ifdef CONFIG_HOTPLUG_CPU |
| @@ -873,6 +874,7 @@ static unsigned long mem_cgroup_read_events(struct mem_cgroup *memcg, | |||
| 873 | val += memcg->nocpu_base.events[idx]; | 874 | val += memcg->nocpu_base.events[idx]; |
| 874 | spin_unlock(&memcg->pcp_counter_lock); | 875 | spin_unlock(&memcg->pcp_counter_lock); |
| 875 | #endif | 876 | #endif |
| 877 | put_online_cpus(); | ||
| 876 | return val; | 878 | return val; |
| 877 | } | 879 | } |
| 878 | 880 | ||
| @@ -2159,110 +2161,59 @@ static void memcg_oom_recover(struct mem_cgroup *memcg) | |||
| 2159 | memcg_wakeup_oom(memcg); | 2161 | memcg_wakeup_oom(memcg); |
| 2160 | } | 2162 | } |
| 2161 | 2163 | ||
| 2162 | /* | ||
| 2163 | * try to call OOM killer | ||
| 2164 | */ | ||
| 2165 | static void mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int order) | 2164 | static void mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int order) |
| 2166 | { | 2165 | { |
| 2167 | bool locked; | ||
| 2168 | int wakeups; | ||
| 2169 | |||
| 2170 | if (!current->memcg_oom.may_oom) | 2166 | if (!current->memcg_oom.may_oom) |
| 2171 | return; | 2167 | return; |
| 2172 | |||
| 2173 | current->memcg_oom.in_memcg_oom = 1; | ||
| 2174 | |||
| 2175 | /* | 2168 | /* |
| 2176 | * As with any blocking lock, a contender needs to start | 2169 | * We are in the middle of the charge context here, so we |
| 2177 | * listening for wakeups before attempting the trylock, | 2170 | * don't want to block when potentially sitting on a callstack |
| 2178 | * otherwise it can miss the wakeup from the unlock and sleep | 2171 | * that holds all kinds of filesystem and mm locks. |
| 2179 | * indefinitely. This is just open-coded because our locking | 2172 | * |
| 2180 | * is so particular to memcg hierarchies. | 2173 | * Also, the caller may handle a failed allocation gracefully |
| 2174 | * (like optional page cache readahead) and so an OOM killer | ||
| 2175 | * invocation might not even be necessary. | ||
| 2176 | * | ||
| 2177 | * That's why we don't do anything here except remember the | ||
| 2178 | * OOM context and then deal with it at the end of the page | ||
| 2179 | * fault when the stack is unwound, the locks are released, | ||
| 2180 | * and when we know whether the fault was overall successful. | ||
| 2181 | */ | 2181 | */ |
| 2182 | wakeups = atomic_read(&memcg->oom_wakeups); | 2182 | css_get(&memcg->css); |
| 2183 | mem_cgroup_mark_under_oom(memcg); | 2183 | current->memcg_oom.memcg = memcg; |
| 2184 | 2184 | current->memcg_oom.gfp_mask = mask; | |
| 2185 | locked = mem_cgroup_oom_trylock(memcg); | 2185 | current->memcg_oom.order = order; |
| 2186 | |||
| 2187 | if (locked) | ||
| 2188 | mem_cgroup_oom_notify(memcg); | ||
| 2189 | |||
| 2190 | if (locked && !memcg->oom_kill_disable) { | ||
| 2191 | mem_cgroup_unmark_under_oom(memcg); | ||
| 2192 | mem_cgroup_out_of_memory(memcg, mask, order); | ||
| 2193 | mem_cgroup_oom_unlock(memcg); | ||
| 2194 | /* | ||
| 2195 | * There is no guarantee that an OOM-lock contender | ||
| 2196 | * sees the wakeups triggered by the OOM kill | ||
| 2197 | * uncharges. Wake any sleepers explicitely. | ||
| 2198 | */ | ||
| 2199 | memcg_oom_recover(memcg); | ||
| 2200 | } else { | ||
| 2201 | /* | ||
| 2202 | * A system call can just return -ENOMEM, but if this | ||
| 2203 | * is a page fault and somebody else is handling the | ||
| 2204 | * OOM already, we need to sleep on the OOM waitqueue | ||
| 2205 | * for this memcg until the situation is resolved. | ||
| 2206 | * Which can take some time because it might be | ||
| 2207 | * handled by a userspace task. | ||
| 2208 | * | ||
| 2209 | * However, this is the charge context, which means | ||
| 2210 | * that we may sit on a large call stack and hold | ||
| 2211 | * various filesystem locks, the mmap_sem etc. and we | ||
| 2212 | * don't want the OOM handler to deadlock on them | ||
| 2213 | * while we sit here and wait. Store the current OOM | ||
| 2214 | * context in the task_struct, then return -ENOMEM. | ||
| 2215 | * At the end of the page fault handler, with the | ||
| 2216 | * stack unwound, pagefault_out_of_memory() will check | ||
| 2217 | * back with us by calling | ||
| 2218 | * mem_cgroup_oom_synchronize(), possibly putting the | ||
| 2219 | * task to sleep. | ||
| 2220 | */ | ||
| 2221 | current->memcg_oom.oom_locked = locked; | ||
| 2222 | current->memcg_oom.wakeups = wakeups; | ||
| 2223 | css_get(&memcg->css); | ||
| 2224 | current->memcg_oom.wait_on_memcg = memcg; | ||
| 2225 | } | ||
| 2226 | } | 2186 | } |
| 2227 | 2187 | ||
| 2228 | /** | 2188 | /** |
| 2229 | * mem_cgroup_oom_synchronize - complete memcg OOM handling | 2189 | * mem_cgroup_oom_synchronize - complete memcg OOM handling |
| 2190 | * @handle: actually kill/wait or just clean up the OOM state | ||
| 2230 | * | 2191 | * |
| 2231 | * This has to be called at the end of a page fault if the the memcg | 2192 | * This has to be called at the end of a page fault if the memcg OOM |
| 2232 | * OOM handler was enabled and the fault is returning %VM_FAULT_OOM. | 2193 | * handler was enabled. |
| 2233 | * | 2194 | * |
| 2234 | * Memcg supports userspace OOM handling, so failed allocations must | 2195 | * Memcg supports userspace OOM handling where failed allocations must |
| 2235 | * sleep on a waitqueue until the userspace task resolves the | 2196 | * sleep on a waitqueue until the userspace task resolves the |
| 2236 | * situation. Sleeping directly in the charge context with all kinds | 2197 | * situation. Sleeping directly in the charge context with all kinds |
| 2237 | * of locks held is not a good idea, instead we remember an OOM state | 2198 | * of locks held is not a good idea, instead we remember an OOM state |
| 2238 | * in the task and mem_cgroup_oom_synchronize() has to be called at | 2199 | * in the task and mem_cgroup_oom_synchronize() has to be called at |
| 2239 | * the end of the page fault to put the task to sleep and clean up the | 2200 | * the end of the page fault to complete the OOM handling. |
| 2240 | * OOM state. | ||
| 2241 | * | 2201 | * |
| 2242 | * Returns %true if an ongoing memcg OOM situation was detected and | 2202 | * Returns %true if an ongoing memcg OOM situation was detected and |
| 2243 | * finalized, %false otherwise. | 2203 | * completed, %false otherwise. |
| 2244 | */ | 2204 | */ |
| 2245 | bool mem_cgroup_oom_synchronize(void) | 2205 | bool mem_cgroup_oom_synchronize(bool handle) |
| 2246 | { | 2206 | { |
| 2207 | struct mem_cgroup *memcg = current->memcg_oom.memcg; | ||
| 2247 | struct oom_wait_info owait; | 2208 | struct oom_wait_info owait; |
| 2248 | struct mem_cgroup *memcg; | 2209 | bool locked; |
| 2249 | 2210 | ||
| 2250 | /* OOM is global, do not handle */ | 2211 | /* OOM is global, do not handle */ |
| 2251 | if (!current->memcg_oom.in_memcg_oom) | ||
| 2252 | return false; | ||
| 2253 | |||
| 2254 | /* | ||
| 2255 | * We invoked the OOM killer but there is a chance that a kill | ||
| 2256 | * did not free up any charges. Everybody else might already | ||
| 2257 | * be sleeping, so restart the fault and keep the rampage | ||
| 2258 | * going until some charges are released. | ||
| 2259 | */ | ||
| 2260 | memcg = current->memcg_oom.wait_on_memcg; | ||
| 2261 | if (!memcg) | 2212 | if (!memcg) |
| 2262 | goto out; | 2213 | return false; |
| 2263 | 2214 | ||
| 2264 | if (test_thread_flag(TIF_MEMDIE) || fatal_signal_pending(current)) | 2215 | if (!handle) |
| 2265 | goto out_memcg; | 2216 | goto cleanup; |
| 2266 | 2217 | ||
| 2267 | owait.memcg = memcg; | 2218 | owait.memcg = memcg; |
| 2268 | owait.wait.flags = 0; | 2219 | owait.wait.flags = 0; |
| @@ -2271,13 +2222,25 @@ bool mem_cgroup_oom_synchronize(void) | |||
| 2271 | INIT_LIST_HEAD(&owait.wait.task_list); | 2222 | INIT_LIST_HEAD(&owait.wait.task_list); |
| 2272 | 2223 | ||
| 2273 | prepare_to_wait(&memcg_oom_waitq, &owait.wait, TASK_KILLABLE); | 2224 | prepare_to_wait(&memcg_oom_waitq, &owait.wait, TASK_KILLABLE); |
| 2274 | /* Only sleep if we didn't miss any wakeups since OOM */ | 2225 | mem_cgroup_mark_under_oom(memcg); |
| 2275 | if (atomic_read(&memcg->oom_wakeups) == current->memcg_oom.wakeups) | 2226 | |
| 2227 | locked = mem_cgroup_oom_trylock(memcg); | ||
| 2228 | |||
| 2229 | if (locked) | ||
| 2230 | mem_cgroup_oom_notify(memcg); | ||
| 2231 | |||
| 2232 | if (locked && !memcg->oom_kill_disable) { | ||
| 2233 | mem_cgroup_unmark_under_oom(memcg); | ||
| 2234 | finish_wait(&memcg_oom_waitq, &owait.wait); | ||
| 2235 | mem_cgroup_out_of_memory(memcg, current->memcg_oom.gfp_mask, | ||
| 2236 | current->memcg_oom.order); | ||
| 2237 | } else { | ||
| 2276 | schedule(); | 2238 | schedule(); |
| 2277 | finish_wait(&memcg_oom_waitq, &owait.wait); | 2239 | mem_cgroup_unmark_under_oom(memcg); |
| 2278 | out_memcg: | 2240 | finish_wait(&memcg_oom_waitq, &owait.wait); |
| 2279 | mem_cgroup_unmark_under_oom(memcg); | 2241 | } |
| 2280 | if (current->memcg_oom.oom_locked) { | 2242 | |
| 2243 | if (locked) { | ||
| 2281 | mem_cgroup_oom_unlock(memcg); | 2244 | mem_cgroup_oom_unlock(memcg); |
| 2282 | /* | 2245 | /* |
| 2283 | * There is no guarantee that an OOM-lock contender | 2246 | * There is no guarantee that an OOM-lock contender |
| @@ -2286,10 +2249,9 @@ out_memcg: | |||
| 2286 | */ | 2249 | */ |
| 2287 | memcg_oom_recover(memcg); | 2250 | memcg_oom_recover(memcg); |
| 2288 | } | 2251 | } |
| 2252 | cleanup: | ||
| 2253 | current->memcg_oom.memcg = NULL; | ||
| 2289 | css_put(&memcg->css); | 2254 | css_put(&memcg->css); |
| 2290 | current->memcg_oom.wait_on_memcg = NULL; | ||
| 2291 | out: | ||
| 2292 | current->memcg_oom.in_memcg_oom = 0; | ||
| 2293 | return true; | 2255 | return true; |
| 2294 | } | 2256 | } |
| 2295 | 2257 | ||
| @@ -2703,6 +2665,9 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm, | |||
| 2703 | || fatal_signal_pending(current))) | 2665 | || fatal_signal_pending(current))) |
| 2704 | goto bypass; | 2666 | goto bypass; |
| 2705 | 2667 | ||
| 2668 | if (unlikely(task_in_memcg_oom(current))) | ||
| 2669 | goto bypass; | ||
| 2670 | |||
| 2706 | /* | 2671 | /* |
| 2707 | * We always charge the cgroup the mm_struct belongs to. | 2672 | * We always charge the cgroup the mm_struct belongs to. |
| 2708 | * The mm_struct's mem_cgroup changes on task migration if the | 2673 | * The mm_struct's mem_cgroup changes on task migration if the |
| @@ -2801,6 +2766,8 @@ done: | |||
| 2801 | return 0; | 2766 | return 0; |
| 2802 | nomem: | 2767 | nomem: |
| 2803 | *ptr = NULL; | 2768 | *ptr = NULL; |
| 2769 | if (gfp_mask & __GFP_NOFAIL) | ||
| 2770 | return 0; | ||
| 2804 | return -ENOMEM; | 2771 | return -ENOMEM; |
| 2805 | bypass: | 2772 | bypass: |
| 2806 | *ptr = root_mem_cgroup; | 2773 | *ptr = root_mem_cgroup; |
diff --git a/mm/memory.c b/mm/memory.c index ca0003947115..1311f26497e6 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
| @@ -837,6 +837,8 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, | |||
| 837 | */ | 837 | */ |
| 838 | make_migration_entry_read(&entry); | 838 | make_migration_entry_read(&entry); |
| 839 | pte = swp_entry_to_pte(entry); | 839 | pte = swp_entry_to_pte(entry); |
| 840 | if (pte_swp_soft_dirty(*src_pte)) | ||
| 841 | pte = pte_swp_mksoft_dirty(pte); | ||
| 840 | set_pte_at(src_mm, addr, src_pte, pte); | 842 | set_pte_at(src_mm, addr, src_pte, pte); |
| 841 | } | 843 | } |
| 842 | } | 844 | } |
| @@ -3863,15 +3865,21 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 3863 | * space. Kernel faults are handled more gracefully. | 3865 | * space. Kernel faults are handled more gracefully. |
| 3864 | */ | 3866 | */ |
| 3865 | if (flags & FAULT_FLAG_USER) | 3867 | if (flags & FAULT_FLAG_USER) |
| 3866 | mem_cgroup_enable_oom(); | 3868 | mem_cgroup_oom_enable(); |
| 3867 | 3869 | ||
| 3868 | ret = __handle_mm_fault(mm, vma, address, flags); | 3870 | ret = __handle_mm_fault(mm, vma, address, flags); |
| 3869 | 3871 | ||
| 3870 | if (flags & FAULT_FLAG_USER) | 3872 | if (flags & FAULT_FLAG_USER) { |
| 3871 | mem_cgroup_disable_oom(); | 3873 | mem_cgroup_oom_disable(); |
| 3872 | 3874 | /* | |
| 3873 | if (WARN_ON(task_in_memcg_oom(current) && !(ret & VM_FAULT_OOM))) | 3875 | * The task may have entered a memcg OOM situation but |
| 3874 | mem_cgroup_oom_synchronize(); | 3876 | * if the allocation error was handled gracefully (no |
| 3877 | * VM_FAULT_OOM), there is no need to kill anything. | ||
| 3878 | * Just clean up the OOM state peacefully. | ||
| 3879 | */ | ||
| 3880 | if (task_in_memcg_oom(current) && !(ret & VM_FAULT_OOM)) | ||
| 3881 | mem_cgroup_oom_synchronize(false); | ||
| 3882 | } | ||
| 3875 | 3883 | ||
| 3876 | return ret; | 3884 | return ret; |
| 3877 | } | 3885 | } |
diff --git a/mm/migrate.c b/mm/migrate.c index a26bccd44ccb..7a7325ee1d08 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
| @@ -161,6 +161,8 @@ static int remove_migration_pte(struct page *new, struct vm_area_struct *vma, | |||
| 161 | 161 | ||
| 162 | get_page(new); | 162 | get_page(new); |
| 163 | pte = pte_mkold(mk_pte(new, vma->vm_page_prot)); | 163 | pte = pte_mkold(mk_pte(new, vma->vm_page_prot)); |
| 164 | if (pte_swp_soft_dirty(*ptep)) | ||
| 165 | pte = pte_mksoft_dirty(pte); | ||
| 164 | if (is_write_migration_entry(entry)) | 166 | if (is_write_migration_entry(entry)) |
| 165 | pte = pte_mkwrite(pte); | 167 | pte = pte_mkwrite(pte); |
| 166 | #ifdef CONFIG_HUGETLB_PAGE | 168 | #ifdef CONFIG_HUGETLB_PAGE |
diff --git a/mm/mprotect.c b/mm/mprotect.c index 94722a4d6b43..a3af058f68e4 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c | |||
| @@ -94,13 +94,16 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd, | |||
| 94 | swp_entry_t entry = pte_to_swp_entry(oldpte); | 94 | swp_entry_t entry = pte_to_swp_entry(oldpte); |
| 95 | 95 | ||
| 96 | if (is_write_migration_entry(entry)) { | 96 | if (is_write_migration_entry(entry)) { |
| 97 | pte_t newpte; | ||
| 97 | /* | 98 | /* |
| 98 | * A protection check is difficult so | 99 | * A protection check is difficult so |
| 99 | * just be safe and disable write | 100 | * just be safe and disable write |
| 100 | */ | 101 | */ |
| 101 | make_migration_entry_read(&entry); | 102 | make_migration_entry_read(&entry); |
| 102 | set_pte_at(mm, addr, pte, | 103 | newpte = swp_entry_to_pte(entry); |
| 103 | swp_entry_to_pte(entry)); | 104 | if (pte_swp_soft_dirty(oldpte)) |
| 105 | newpte = pte_swp_mksoft_dirty(newpte); | ||
| 106 | set_pte_at(mm, addr, pte, newpte); | ||
| 104 | } | 107 | } |
| 105 | pages++; | 108 | pages++; |
| 106 | } | 109 | } |
diff --git a/mm/mremap.c b/mm/mremap.c index 91b13d6a16d4..0843feb66f3d 100644 --- a/mm/mremap.c +++ b/mm/mremap.c | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
| 26 | #include <asm/cacheflush.h> | 26 | #include <asm/cacheflush.h> |
| 27 | #include <asm/tlbflush.h> | 27 | #include <asm/tlbflush.h> |
| 28 | #include <asm/pgalloc.h> | ||
| 29 | 28 | ||
| 30 | #include "internal.h" | 29 | #include "internal.h" |
| 31 | 30 | ||
| @@ -63,10 +62,8 @@ static pmd_t *alloc_new_pmd(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 63 | return NULL; | 62 | return NULL; |
| 64 | 63 | ||
| 65 | pmd = pmd_alloc(mm, pud, addr); | 64 | pmd = pmd_alloc(mm, pud, addr); |
| 66 | if (!pmd) { | 65 | if (!pmd) |
| 67 | pud_free(mm, pud); | ||
| 68 | return NULL; | 66 | return NULL; |
| 69 | } | ||
| 70 | 67 | ||
| 71 | VM_BUG_ON(pmd_trans_huge(*pmd)); | 68 | VM_BUG_ON(pmd_trans_huge(*pmd)); |
| 72 | 69 | ||
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 314e9d274381..6738c47f1f72 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
| @@ -680,7 +680,7 @@ void pagefault_out_of_memory(void) | |||
| 680 | { | 680 | { |
| 681 | struct zonelist *zonelist; | 681 | struct zonelist *zonelist; |
| 682 | 682 | ||
| 683 | if (mem_cgroup_oom_synchronize()) | 683 | if (mem_cgroup_oom_synchronize(true)) |
| 684 | return; | 684 | return; |
| 685 | 685 | ||
| 686 | zonelist = node_zonelist(first_online_node, GFP_KERNEL); | 686 | zonelist = node_zonelist(first_online_node, GFP_KERNEL); |
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index f5236f804aa6..63807583d8e8 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
| @@ -1210,11 +1210,11 @@ static unsigned long dirty_poll_interval(unsigned long dirty, | |||
| 1210 | return 1; | 1210 | return 1; |
| 1211 | } | 1211 | } |
| 1212 | 1212 | ||
| 1213 | static long bdi_max_pause(struct backing_dev_info *bdi, | 1213 | static unsigned long bdi_max_pause(struct backing_dev_info *bdi, |
| 1214 | unsigned long bdi_dirty) | 1214 | unsigned long bdi_dirty) |
| 1215 | { | 1215 | { |
| 1216 | long bw = bdi->avg_write_bandwidth; | 1216 | unsigned long bw = bdi->avg_write_bandwidth; |
| 1217 | long t; | 1217 | unsigned long t; |
| 1218 | 1218 | ||
| 1219 | /* | 1219 | /* |
| 1220 | * Limit pause time for small memory systems. If sleeping for too long | 1220 | * Limit pause time for small memory systems. If sleeping for too long |
| @@ -1226,7 +1226,7 @@ static long bdi_max_pause(struct backing_dev_info *bdi, | |||
| 1226 | t = bdi_dirty / (1 + bw / roundup_pow_of_two(1 + HZ / 8)); | 1226 | t = bdi_dirty / (1 + bw / roundup_pow_of_two(1 + HZ / 8)); |
| 1227 | t++; | 1227 | t++; |
| 1228 | 1228 | ||
| 1229 | return min_t(long, t, MAX_PAUSE); | 1229 | return min_t(unsigned long, t, MAX_PAUSE); |
| 1230 | } | 1230 | } |
| 1231 | 1231 | ||
| 1232 | static long bdi_min_pause(struct backing_dev_info *bdi, | 1232 | static long bdi_min_pause(struct backing_dev_info *bdi, |
diff --git a/mm/slab_common.c b/mm/slab_common.c index a3443278ce3a..e2e98af703ea 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c | |||
| @@ -56,6 +56,7 @@ static int kmem_cache_sanity_check(struct mem_cgroup *memcg, const char *name, | |||
| 56 | continue; | 56 | continue; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | #if !defined(CONFIG_SLUB) || !defined(CONFIG_SLUB_DEBUG_ON) | ||
| 59 | /* | 60 | /* |
| 60 | * For simplicity, we won't check this in the list of memcg | 61 | * For simplicity, we won't check this in the list of memcg |
| 61 | * caches. We have control over memcg naming, and if there | 62 | * caches. We have control over memcg naming, and if there |
| @@ -69,6 +70,7 @@ static int kmem_cache_sanity_check(struct mem_cgroup *memcg, const char *name, | |||
| 69 | s = NULL; | 70 | s = NULL; |
| 70 | return -EINVAL; | 71 | return -EINVAL; |
| 71 | } | 72 | } |
| 73 | #endif | ||
| 72 | } | 74 | } |
| 73 | 75 | ||
| 74 | WARN_ON(strchr(name, ' ')); /* It confuses parsers */ | 76 | WARN_ON(strchr(name, ' ')); /* It confuses parsers */ |
diff --git a/mm/swapfile.c b/mm/swapfile.c index 3963fc24fcc1..de7c904e52e5 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
| @@ -1824,6 +1824,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) | |||
| 1824 | struct filename *pathname; | 1824 | struct filename *pathname; |
| 1825 | int i, type, prev; | 1825 | int i, type, prev; |
| 1826 | int err; | 1826 | int err; |
| 1827 | unsigned int old_block_size; | ||
| 1827 | 1828 | ||
| 1828 | if (!capable(CAP_SYS_ADMIN)) | 1829 | if (!capable(CAP_SYS_ADMIN)) |
| 1829 | return -EPERM; | 1830 | return -EPERM; |
| @@ -1914,6 +1915,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) | |||
| 1914 | } | 1915 | } |
| 1915 | 1916 | ||
| 1916 | swap_file = p->swap_file; | 1917 | swap_file = p->swap_file; |
| 1918 | old_block_size = p->old_block_size; | ||
| 1917 | p->swap_file = NULL; | 1919 | p->swap_file = NULL; |
| 1918 | p->max = 0; | 1920 | p->max = 0; |
| 1919 | swap_map = p->swap_map; | 1921 | swap_map = p->swap_map; |
| @@ -1938,7 +1940,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) | |||
| 1938 | inode = mapping->host; | 1940 | inode = mapping->host; |
| 1939 | if (S_ISBLK(inode->i_mode)) { | 1941 | if (S_ISBLK(inode->i_mode)) { |
| 1940 | struct block_device *bdev = I_BDEV(inode); | 1942 | struct block_device *bdev = I_BDEV(inode); |
| 1941 | set_blocksize(bdev, p->old_block_size); | 1943 | set_blocksize(bdev, old_block_size); |
| 1942 | blkdev_put(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL); | 1944 | blkdev_put(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL); |
| 1943 | } else { | 1945 | } else { |
| 1944 | mutex_lock(&inode->i_mutex); | 1946 | mutex_lock(&inode->i_mutex); |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 53f2f82f83ae..eea668d9cff6 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
| @@ -211,6 +211,7 @@ void unregister_shrinker(struct shrinker *shrinker) | |||
| 211 | down_write(&shrinker_rwsem); | 211 | down_write(&shrinker_rwsem); |
| 212 | list_del(&shrinker->list); | 212 | list_del(&shrinker->list); |
| 213 | up_write(&shrinker_rwsem); | 213 | up_write(&shrinker_rwsem); |
| 214 | kfree(shrinker->nr_deferred); | ||
| 214 | } | 215 | } |
| 215 | EXPORT_SYMBOL(unregister_shrinker); | 216 | EXPORT_SYMBOL(unregister_shrinker); |
| 216 | 217 | ||
diff --git a/mm/zswap.c b/mm/zswap.c index 841e35f1db22..d93510c6aa2d 100644 --- a/mm/zswap.c +++ b/mm/zswap.c | |||
| @@ -804,6 +804,10 @@ static void zswap_frontswap_invalidate_area(unsigned type) | |||
| 804 | } | 804 | } |
| 805 | tree->rbroot = RB_ROOT; | 805 | tree->rbroot = RB_ROOT; |
| 806 | spin_unlock(&tree->lock); | 806 | spin_unlock(&tree->lock); |
| 807 | |||
| 808 | zbud_destroy_pool(tree->pool); | ||
| 809 | kfree(tree); | ||
| 810 | zswap_trees[type] = NULL; | ||
| 807 | } | 811 | } |
| 808 | 812 | ||
| 809 | static struct zbud_ops zswap_zbud_ops = { | 813 | static struct zbud_ops zswap_zbud_ops = { |
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 95c2b2689a03..7db9954f1af2 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c | |||
| @@ -580,15 +580,13 @@ static struct aa_namespace *__next_namespace(struct aa_namespace *root, | |||
| 580 | 580 | ||
| 581 | /* check if the next ns is a sibling, parent, gp, .. */ | 581 | /* check if the next ns is a sibling, parent, gp, .. */ |
| 582 | parent = ns->parent; | 582 | parent = ns->parent; |
| 583 | while (parent) { | 583 | while (ns != root) { |
| 584 | mutex_unlock(&ns->lock); | 584 | mutex_unlock(&ns->lock); |
| 585 | next = list_entry_next(ns, base.list); | 585 | next = list_entry_next(ns, base.list); |
| 586 | if (!list_entry_is_head(next, &parent->sub_ns, base.list)) { | 586 | if (!list_entry_is_head(next, &parent->sub_ns, base.list)) { |
| 587 | mutex_lock(&next->lock); | 587 | mutex_lock(&next->lock); |
| 588 | return next; | 588 | return next; |
| 589 | } | 589 | } |
| 590 | if (parent == root) | ||
| 591 | return NULL; | ||
| 592 | ns = parent; | 590 | ns = parent; |
| 593 | parent = parent->parent; | 591 | parent = parent->parent; |
| 594 | } | 592 | } |
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 345bec07a27d..705c2879d3a9 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c | |||
| @@ -610,6 +610,7 @@ void aa_free_profile(struct aa_profile *profile) | |||
| 610 | aa_put_dfa(profile->policy.dfa); | 610 | aa_put_dfa(profile->policy.dfa); |
| 611 | aa_put_replacedby(profile->replacedby); | 611 | aa_put_replacedby(profile->replacedby); |
| 612 | 612 | ||
| 613 | kzfree(profile->hash); | ||
| 613 | kzfree(profile); | 614 | kzfree(profile); |
| 614 | } | 615 | } |
| 615 | 616 | ||
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index ac41e9cdc976..26ad4f0aade3 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
| @@ -3531,7 +3531,7 @@ static int create_capture_mixers(struct hda_codec *codec) | |||
| 3531 | if (!multi) | 3531 | if (!multi) |
| 3532 | err = create_single_cap_vol_ctl(codec, n, vol, sw, | 3532 | err = create_single_cap_vol_ctl(codec, n, vol, sw, |
| 3533 | inv_dmic); | 3533 | inv_dmic); |
| 3534 | else if (!multi_cap_vol) | 3534 | else if (!multi_cap_vol && !inv_dmic) |
| 3535 | err = create_bind_cap_vol_ctl(codec, n, vol, sw); | 3535 | err = create_bind_cap_vol_ctl(codec, n, vol, sw); |
| 3536 | else | 3536 | else |
| 3537 | err = create_multi_cap_vol_ctl(codec); | 3537 | err = create_multi_cap_vol_ctl(codec); |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 7ea0245fc6bd..50173d412ac5 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
| @@ -937,6 +937,14 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, | |||
| 937 | } | 937 | } |
| 938 | 938 | ||
| 939 | /* | 939 | /* |
| 940 | * always configure channel mapping, it may have been changed by the | ||
| 941 | * user in the meantime | ||
| 942 | */ | ||
| 943 | hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca, | ||
| 944 | channels, per_pin->chmap, | ||
| 945 | per_pin->chmap_set); | ||
| 946 | |||
| 947 | /* | ||
| 940 | * sizeof(ai) is used instead of sizeof(*hdmi_ai) or | 948 | * sizeof(ai) is used instead of sizeof(*hdmi_ai) or |
| 941 | * sizeof(*dp_ai) to avoid partial match/update problems when | 949 | * sizeof(*dp_ai) to avoid partial match/update problems when |
| 942 | * the user switches between HDMI/DP monitors. | 950 | * the user switches between HDMI/DP monitors. |
| @@ -947,20 +955,10 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, | |||
| 947 | "pin=%d channels=%d\n", | 955 | "pin=%d channels=%d\n", |
| 948 | pin_nid, | 956 | pin_nid, |
| 949 | channels); | 957 | channels); |
| 950 | hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca, | ||
| 951 | channels, per_pin->chmap, | ||
| 952 | per_pin->chmap_set); | ||
| 953 | hdmi_stop_infoframe_trans(codec, pin_nid); | 958 | hdmi_stop_infoframe_trans(codec, pin_nid); |
| 954 | hdmi_fill_audio_infoframe(codec, pin_nid, | 959 | hdmi_fill_audio_infoframe(codec, pin_nid, |
| 955 | ai.bytes, sizeof(ai)); | 960 | ai.bytes, sizeof(ai)); |
| 956 | hdmi_start_infoframe_trans(codec, pin_nid); | 961 | hdmi_start_infoframe_trans(codec, pin_nid); |
| 957 | } else { | ||
| 958 | /* For non-pcm audio switch, setup new channel mapping | ||
| 959 | * accordingly */ | ||
| 960 | if (per_pin->non_pcm != non_pcm) | ||
| 961 | hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca, | ||
| 962 | channels, per_pin->chmap, | ||
| 963 | per_pin->chmap_set); | ||
| 964 | } | 962 | } |
| 965 | 963 | ||
| 966 | per_pin->non_pcm = non_pcm; | 964 | per_pin->non_pcm = non_pcm; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 0e303b99a47c..bf313bea7085 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -2819,6 +2819,15 @@ static void alc269_fixup_hweq(struct hda_codec *codec, | |||
| 2819 | alc_write_coef_idx(codec, 0x1e, coef | 0x80); | 2819 | alc_write_coef_idx(codec, 0x1e, coef | 0x80); |
| 2820 | } | 2820 | } |
| 2821 | 2821 | ||
| 2822 | static void alc269_fixup_headset_mic(struct hda_codec *codec, | ||
| 2823 | const struct hda_fixup *fix, int action) | ||
| 2824 | { | ||
| 2825 | struct alc_spec *spec = codec->spec; | ||
| 2826 | |||
| 2827 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | ||
| 2828 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | ||
| 2829 | } | ||
| 2830 | |||
| 2822 | static void alc271_fixup_dmic(struct hda_codec *codec, | 2831 | static void alc271_fixup_dmic(struct hda_codec *codec, |
| 2823 | const struct hda_fixup *fix, int action) | 2832 | const struct hda_fixup *fix, int action) |
| 2824 | { | 2833 | { |
| @@ -3496,6 +3505,15 @@ static void alc282_fixup_asus_tx300(struct hda_codec *codec, | |||
| 3496 | } | 3505 | } |
| 3497 | } | 3506 | } |
| 3498 | 3507 | ||
| 3508 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, | ||
| 3509 | const struct hda_fixup *fix, int action) | ||
| 3510 | { | ||
| 3511 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | ||
| 3512 | /* Remove DAC node 0x03, as it seems to be | ||
| 3513 | giving mono output */ | ||
| 3514 | snd_hda_override_wcaps(codec, 0x03, 0); | ||
| 3515 | } | ||
| 3516 | |||
| 3499 | enum { | 3517 | enum { |
| 3500 | ALC269_FIXUP_SONY_VAIO, | 3518 | ALC269_FIXUP_SONY_VAIO, |
| 3501 | ALC275_FIXUP_SONY_VAIO_GPIO2, | 3519 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
| @@ -3507,6 +3525,7 @@ enum { | |||
| 3507 | ALC271_FIXUP_DMIC, | 3525 | ALC271_FIXUP_DMIC, |
| 3508 | ALC269_FIXUP_PCM_44K, | 3526 | ALC269_FIXUP_PCM_44K, |
| 3509 | ALC269_FIXUP_STEREO_DMIC, | 3527 | ALC269_FIXUP_STEREO_DMIC, |
| 3528 | ALC269_FIXUP_HEADSET_MIC, | ||
| 3510 | ALC269_FIXUP_QUANTA_MUTE, | 3529 | ALC269_FIXUP_QUANTA_MUTE, |
| 3511 | ALC269_FIXUP_LIFEBOOK, | 3530 | ALC269_FIXUP_LIFEBOOK, |
| 3512 | ALC269_FIXUP_AMIC, | 3531 | ALC269_FIXUP_AMIC, |
| @@ -3519,9 +3538,11 @@ enum { | |||
| 3519 | ALC269_FIXUP_HP_GPIO_LED, | 3538 | ALC269_FIXUP_HP_GPIO_LED, |
| 3520 | ALC269_FIXUP_INV_DMIC, | 3539 | ALC269_FIXUP_INV_DMIC, |
| 3521 | ALC269_FIXUP_LENOVO_DOCK, | 3540 | ALC269_FIXUP_LENOVO_DOCK, |
| 3541 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, | ||
| 3522 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, | 3542 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
| 3523 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | 3543 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
| 3524 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, | 3544 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
| 3545 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, | ||
| 3525 | ALC269_FIXUP_HEADSET_MODE, | 3546 | ALC269_FIXUP_HEADSET_MODE, |
| 3526 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, | 3547 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, |
| 3527 | ALC269_FIXUP_ASUS_X101_FUNC, | 3548 | ALC269_FIXUP_ASUS_X101_FUNC, |
| @@ -3535,6 +3556,7 @@ enum { | |||
| 3535 | ALC283_FIXUP_CHROME_BOOK, | 3556 | ALC283_FIXUP_CHROME_BOOK, |
| 3536 | ALC282_FIXUP_ASUS_TX300, | 3557 | ALC282_FIXUP_ASUS_TX300, |
| 3537 | ALC283_FIXUP_INT_MIC, | 3558 | ALC283_FIXUP_INT_MIC, |
| 3559 | ALC290_FIXUP_MONO_SPEAKERS, | ||
| 3538 | }; | 3560 | }; |
| 3539 | 3561 | ||
| 3540 | static const struct hda_fixup alc269_fixups[] = { | 3562 | static const struct hda_fixup alc269_fixups[] = { |
| @@ -3603,6 +3625,10 @@ static const struct hda_fixup alc269_fixups[] = { | |||
| 3603 | .type = HDA_FIXUP_FUNC, | 3625 | .type = HDA_FIXUP_FUNC, |
| 3604 | .v.func = alc269_fixup_stereo_dmic, | 3626 | .v.func = alc269_fixup_stereo_dmic, |
| 3605 | }, | 3627 | }, |
| 3628 | [ALC269_FIXUP_HEADSET_MIC] = { | ||
| 3629 | .type = HDA_FIXUP_FUNC, | ||
| 3630 | .v.func = alc269_fixup_headset_mic, | ||
| 3631 | }, | ||
| 3606 | [ALC269_FIXUP_QUANTA_MUTE] = { | 3632 | [ALC269_FIXUP_QUANTA_MUTE] = { |
| 3607 | .type = HDA_FIXUP_FUNC, | 3633 | .type = HDA_FIXUP_FUNC, |
| 3608 | .v.func = alc269_fixup_quanta_mute, | 3634 | .v.func = alc269_fixup_quanta_mute, |
| @@ -3712,6 +3738,15 @@ static const struct hda_fixup alc269_fixups[] = { | |||
| 3712 | .chained = true, | 3738 | .chained = true, |
| 3713 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | 3739 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
| 3714 | }, | 3740 | }, |
| 3741 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { | ||
| 3742 | .type = HDA_FIXUP_PINS, | ||
| 3743 | .v.pins = (const struct hda_pintbl[]) { | ||
| 3744 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | ||
| 3745 | { } | ||
| 3746 | }, | ||
| 3747 | .chained = true, | ||
| 3748 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | ||
| 3749 | }, | ||
| 3715 | [ALC269_FIXUP_HEADSET_MODE] = { | 3750 | [ALC269_FIXUP_HEADSET_MODE] = { |
| 3716 | .type = HDA_FIXUP_FUNC, | 3751 | .type = HDA_FIXUP_FUNC, |
| 3717 | .v.func = alc_fixup_headset_mode, | 3752 | .v.func = alc_fixup_headset_mode, |
| @@ -3720,6 +3755,15 @@ static const struct hda_fixup alc269_fixups[] = { | |||
| 3720 | .type = HDA_FIXUP_FUNC, | 3755 | .type = HDA_FIXUP_FUNC, |
| 3721 | .v.func = alc_fixup_headset_mode_no_hp_mic, | 3756 | .v.func = alc_fixup_headset_mode_no_hp_mic, |
| 3722 | }, | 3757 | }, |
| 3758 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { | ||
| 3759 | .type = HDA_FIXUP_PINS, | ||
| 3760 | .v.pins = (const struct hda_pintbl[]) { | ||
| 3761 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | ||
| 3762 | { } | ||
| 3763 | }, | ||
| 3764 | .chained = true, | ||
| 3765 | .chain_id = ALC269_FIXUP_HEADSET_MIC | ||
| 3766 | }, | ||
| 3723 | [ALC269_FIXUP_ASUS_X101_FUNC] = { | 3767 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
| 3724 | .type = HDA_FIXUP_FUNC, | 3768 | .type = HDA_FIXUP_FUNC, |
| 3725 | .v.func = alc269_fixup_x101_headset_mic, | 3769 | .v.func = alc269_fixup_x101_headset_mic, |
| @@ -3804,6 +3848,12 @@ static const struct hda_fixup alc269_fixups[] = { | |||
| 3804 | .chained = true, | 3848 | .chained = true, |
| 3805 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST | 3849 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST |
| 3806 | }, | 3850 | }, |
| 3851 | [ALC290_FIXUP_MONO_SPEAKERS] = { | ||
| 3852 | .type = HDA_FIXUP_FUNC, | ||
| 3853 | .v.func = alc290_fixup_mono_speakers, | ||
| 3854 | .chained = true, | ||
| 3855 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, | ||
| 3856 | }, | ||
| 3807 | }; | 3857 | }; |
| 3808 | 3858 | ||
| 3809 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { | 3859 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
| @@ -3845,6 +3895,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
| 3845 | SND_PCI_QUIRK(0x1028, 0x0608, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | 3895 | SND_PCI_QUIRK(0x1028, 0x0608, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 3846 | SND_PCI_QUIRK(0x1028, 0x0609, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | 3896 | SND_PCI_QUIRK(0x1028, 0x0609, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 3847 | SND_PCI_QUIRK(0x1028, 0x0613, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | 3897 | SND_PCI_QUIRK(0x1028, 0x0613, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
| 3898 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_MONO_SPEAKERS), | ||
| 3848 | SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), | 3899 | SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), |
| 3849 | SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), | 3900 | SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), |
| 3850 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), | 3901 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
| @@ -3867,6 +3918,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
| 3867 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), | 3918 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
| 3868 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), | 3919 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |
| 3869 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), | 3920 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
| 3921 | SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), | ||
| 3870 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), | 3922 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
| 3871 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | 3923 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
| 3872 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | 3924 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), |
| @@ -3952,6 +4004,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { | |||
| 3952 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, | 4004 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
| 3953 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, | 4005 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, |
| 3954 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, | 4006 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
| 4007 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, | ||
| 3955 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, | 4008 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
| 3956 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, | 4009 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
| 3957 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, | 4010 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
| @@ -4569,6 +4622,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { | |||
| 4569 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | 4622 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 4570 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | 4623 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
| 4571 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), | 4624 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
| 4625 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_ASUS_MODE4), | ||
| 4572 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), | 4626 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
| 4573 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), | 4627 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
| 4574 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), | 4628 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 4f255dfee450..f59a321a6d6a 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
| @@ -4845,6 +4845,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne | |||
| 4845 | if ((err = hdsp_get_iobox_version(hdsp)) < 0) | 4845 | if ((err = hdsp_get_iobox_version(hdsp)) < 0) |
| 4846 | return err; | 4846 | return err; |
| 4847 | } | 4847 | } |
| 4848 | memset(&hdsp_version, 0, sizeof(hdsp_version)); | ||
| 4848 | hdsp_version.io_type = hdsp->io_type; | 4849 | hdsp_version.io_type = hdsp->io_type; |
| 4849 | hdsp_version.firmware_rev = hdsp->firmware_rev; | 4850 | hdsp_version.firmware_rev = hdsp->firmware_rev; |
| 4850 | if ((err = copy_to_user(argp, &hdsp_version, sizeof(hdsp_version)))) | 4851 | if ((err = copy_to_user(argp, &hdsp_version, sizeof(hdsp_version)))) |
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index d0323a693ba2..999550bbad40 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
| @@ -262,7 +262,9 @@ static int usb_stream_hwdep_mmap(struct snd_hwdep *hw, | |||
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | area->vm_ops = &usb_stream_hwdep_vm_ops; | 264 | area->vm_ops = &usb_stream_hwdep_vm_ops; |
| 265 | area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; | 265 | area->vm_flags |= VM_DONTDUMP; |
| 266 | if (!read) | ||
| 267 | area->vm_flags |= VM_DONTEXPAND; | ||
| 266 | area->vm_private_data = us122l; | 268 | area->vm_private_data = us122l; |
| 267 | atomic_inc(&us122l->mmap_count); | 269 | atomic_inc(&us122l->mmap_count); |
| 268 | out: | 270 | out: |
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index 63fb5219f0f8..6234a51625b1 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c | |||
| @@ -299,19 +299,6 @@ static void usX2Y_error_urb_status(struct usX2Ydev *usX2Y, | |||
| 299 | usX2Y_clients_stop(usX2Y); | 299 | usX2Y_clients_stop(usX2Y); |
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | static void usX2Y_error_sequence(struct usX2Ydev *usX2Y, | ||
| 303 | struct snd_usX2Y_substream *subs, struct urb *urb) | ||
| 304 | { | ||
| 305 | snd_printk(KERN_ERR | ||
| 306 | "Sequence Error!(hcd_frame=%i ep=%i%s;wait=%i,frame=%i).\n" | ||
| 307 | "Most probably some urb of usb-frame %i is still missing.\n" | ||
| 308 | "Cause could be too long delays in usb-hcd interrupt handling.\n", | ||
| 309 | usb_get_current_frame_number(usX2Y->dev), | ||
| 310 | subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out", | ||
| 311 | usX2Y->wait_iso_frame, urb->start_frame, usX2Y->wait_iso_frame); | ||
| 312 | usX2Y_clients_stop(usX2Y); | ||
| 313 | } | ||
| 314 | |||
| 315 | static void i_usX2Y_urb_complete(struct urb *urb) | 302 | static void i_usX2Y_urb_complete(struct urb *urb) |
| 316 | { | 303 | { |
| 317 | struct snd_usX2Y_substream *subs = urb->context; | 304 | struct snd_usX2Y_substream *subs = urb->context; |
| @@ -328,12 +315,9 @@ static void i_usX2Y_urb_complete(struct urb *urb) | |||
| 328 | usX2Y_error_urb_status(usX2Y, subs, urb); | 315 | usX2Y_error_urb_status(usX2Y, subs, urb); |
| 329 | return; | 316 | return; |
| 330 | } | 317 | } |
| 331 | if (likely((urb->start_frame & 0xFFFF) == (usX2Y->wait_iso_frame & 0xFFFF))) | 318 | |
| 332 | subs->completed_urb = urb; | 319 | subs->completed_urb = urb; |
| 333 | else { | 320 | |
| 334 | usX2Y_error_sequence(usX2Y, subs, urb); | ||
| 335 | return; | ||
| 336 | } | ||
| 337 | { | 321 | { |
| 338 | struct snd_usX2Y_substream *capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE], | 322 | struct snd_usX2Y_substream *capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE], |
| 339 | *playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; | 323 | *playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; |
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index f2a1acdc4d83..814d0e887c62 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c | |||
| @@ -244,13 +244,8 @@ static void i_usX2Y_usbpcm_urb_complete(struct urb *urb) | |||
| 244 | usX2Y_error_urb_status(usX2Y, subs, urb); | 244 | usX2Y_error_urb_status(usX2Y, subs, urb); |
| 245 | return; | 245 | return; |
| 246 | } | 246 | } |
| 247 | if (likely((urb->start_frame & 0xFFFF) == (usX2Y->wait_iso_frame & 0xFFFF))) | ||
| 248 | subs->completed_urb = urb; | ||
| 249 | else { | ||
| 250 | usX2Y_error_sequence(usX2Y, subs, urb); | ||
| 251 | return; | ||
| 252 | } | ||
| 253 | 247 | ||
| 248 | subs->completed_urb = urb; | ||
| 254 | capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; | 249 | capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; |
| 255 | capsubs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; | 250 | capsubs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; |
| 256 | playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; | 251 | playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; |
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 3a0ff7fb71b6..64c043b7a438 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
| @@ -770,6 +770,7 @@ check: $(OUTPUT)common-cmds.h | |||
| 770 | install-bin: all | 770 | install-bin: all |
| 771 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' | 771 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' |
| 772 | $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)' | 772 | $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)' |
| 773 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' | ||
| 773 | $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' | 774 | $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' |
| 774 | ifndef NO_LIBPERL | 775 | ifndef NO_LIBPERL |
| 775 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace' | 776 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace' |
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index f686d5ff594e..5098f144b92d 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
| @@ -457,6 +457,7 @@ static int __run_perf_stat(int argc, const char **argv) | |||
| 457 | perror("failed to prepare workload"); | 457 | perror("failed to prepare workload"); |
| 458 | return -1; | 458 | return -1; |
| 459 | } | 459 | } |
| 460 | child_pid = evsel_list->workload.pid; | ||
| 460 | } | 461 | } |
| 461 | 462 | ||
| 462 | if (group) | 463 | if (group) |
diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak index d5a8dd44945f..f79305739ecc 100644 --- a/tools/perf/config/feature-tests.mak +++ b/tools/perf/config/feature-tests.mak | |||
| @@ -219,7 +219,7 @@ define SOURCE_LIBAUDIT | |||
| 219 | 219 | ||
| 220 | int main(void) | 220 | int main(void) |
| 221 | { | 221 | { |
| 222 | printf(\"error message: %s\n\", audit_errno_to_name(0)); | 222 | printf(\"error message: %s\", audit_errno_to_name(0)); |
| 223 | return audit_open(); | 223 | return audit_open(); |
| 224 | } | 224 | } |
| 225 | endef | 225 | endef |
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c index e23bde19d590..7defd77105d0 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c | |||
| @@ -426,7 +426,7 @@ static int __die_search_func_cb(Dwarf_Die *fn_die, void *data) | |||
| 426 | * @die_mem: a buffer for result DIE | 426 | * @die_mem: a buffer for result DIE |
| 427 | * | 427 | * |
| 428 | * Search a non-inlined function DIE which includes @addr. Stores the | 428 | * Search a non-inlined function DIE which includes @addr. Stores the |
| 429 | * DIE to @die_mem and returns it if found. Returns NULl if failed. | 429 | * DIE to @die_mem and returns it if found. Returns NULL if failed. |
| 430 | */ | 430 | */ |
| 431 | Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr, | 431 | Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr, |
| 432 | Dwarf_Die *die_mem) | 432 | Dwarf_Die *die_mem) |
| @@ -454,15 +454,32 @@ static int __die_find_inline_cb(Dwarf_Die *die_mem, void *data) | |||
| 454 | } | 454 | } |
| 455 | 455 | ||
| 456 | /** | 456 | /** |
| 457 | * die_find_top_inlinefunc - Search the top inlined function at given address | ||
| 458 | * @sp_die: a subprogram DIE which including @addr | ||
| 459 | * @addr: target address | ||
| 460 | * @die_mem: a buffer for result DIE | ||
| 461 | * | ||
| 462 | * Search an inlined function DIE which includes @addr. Stores the | ||
| 463 | * DIE to @die_mem and returns it if found. Returns NULL if failed. | ||
| 464 | * Even if several inlined functions are expanded recursively, this | ||
| 465 | * doesn't trace it down, and returns the topmost one. | ||
| 466 | */ | ||
| 467 | Dwarf_Die *die_find_top_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, | ||
| 468 | Dwarf_Die *die_mem) | ||
| 469 | { | ||
| 470 | return die_find_child(sp_die, __die_find_inline_cb, &addr, die_mem); | ||
| 471 | } | ||
| 472 | |||
| 473 | /** | ||
| 457 | * die_find_inlinefunc - Search an inlined function at given address | 474 | * die_find_inlinefunc - Search an inlined function at given address |
| 458 | * @cu_die: a CU DIE which including @addr | 475 | * @sp_die: a subprogram DIE which including @addr |
| 459 | * @addr: target address | 476 | * @addr: target address |
| 460 | * @die_mem: a buffer for result DIE | 477 | * @die_mem: a buffer for result DIE |
| 461 | * | 478 | * |
| 462 | * Search an inlined function DIE which includes @addr. Stores the | 479 | * Search an inlined function DIE which includes @addr. Stores the |
| 463 | * DIE to @die_mem and returns it if found. Returns NULl if failed. | 480 | * DIE to @die_mem and returns it if found. Returns NULL if failed. |
| 464 | * If several inlined functions are expanded recursively, this trace | 481 | * If several inlined functions are expanded recursively, this trace |
| 465 | * it and returns deepest one. | 482 | * it down and returns deepest one. |
| 466 | */ | 483 | */ |
| 467 | Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, | 484 | Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, |
| 468 | Dwarf_Die *die_mem) | 485 | Dwarf_Die *die_mem) |
diff --git a/tools/perf/util/dwarf-aux.h b/tools/perf/util/dwarf-aux.h index 8658d41697d2..b4fe90c6cb2d 100644 --- a/tools/perf/util/dwarf-aux.h +++ b/tools/perf/util/dwarf-aux.h | |||
| @@ -79,7 +79,11 @@ extern Dwarf_Die *die_find_child(Dwarf_Die *rt_die, | |||
| 79 | extern Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr, | 79 | extern Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr, |
| 80 | Dwarf_Die *die_mem); | 80 | Dwarf_Die *die_mem); |
| 81 | 81 | ||
| 82 | /* Search an inlined function including given address */ | 82 | /* Search the top inlined function including given address */ |
| 83 | extern Dwarf_Die *die_find_top_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, | ||
| 84 | Dwarf_Die *die_mem); | ||
| 85 | |||
| 86 | /* Search the deepest inlined function including given address */ | ||
| 83 | extern Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, | 87 | extern Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, |
| 84 | Dwarf_Die *die_mem); | 88 | Dwarf_Die *die_mem); |
| 85 | 89 | ||
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index ce69901176d8..c3e5a3b817ab 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
| @@ -2768,6 +2768,18 @@ int perf_session__read_header(struct perf_session *session) | |||
| 2768 | if (perf_file_header__read(&f_header, header, fd) < 0) | 2768 | if (perf_file_header__read(&f_header, header, fd) < 0) |
| 2769 | return -EINVAL; | 2769 | return -EINVAL; |
| 2770 | 2770 | ||
| 2771 | /* | ||
| 2772 | * Sanity check that perf.data was written cleanly; data size is | ||
| 2773 | * initialized to 0 and updated only if the on_exit function is run. | ||
| 2774 | * If data size is still 0 then the file contains only partial | ||
| 2775 | * information. Just warn user and process it as much as it can. | ||
| 2776 | */ | ||
| 2777 | if (f_header.data.size == 0) { | ||
| 2778 | pr_warning("WARNING: The %s file's data size field is 0 which is unexpected.\n" | ||
| 2779 | "Was the 'perf record' command properly terminated?\n", | ||
| 2780 | session->filename); | ||
| 2781 | } | ||
| 2782 | |||
| 2771 | nr_attrs = f_header.attrs.size / f_header.attr_size; | 2783 | nr_attrs = f_header.attrs.size / f_header.attr_size; |
| 2772 | lseek(fd, f_header.attrs.offset, SEEK_SET); | 2784 | lseek(fd, f_header.attrs.offset, SEEK_SET); |
| 2773 | 2785 | ||
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 371476cb8ddc..c09e0a9fdf4c 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c | |||
| @@ -1327,8 +1327,8 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr, | |||
| 1327 | struct perf_probe_point *ppt) | 1327 | struct perf_probe_point *ppt) |
| 1328 | { | 1328 | { |
| 1329 | Dwarf_Die cudie, spdie, indie; | 1329 | Dwarf_Die cudie, spdie, indie; |
| 1330 | Dwarf_Addr _addr, baseaddr; | 1330 | Dwarf_Addr _addr = 0, baseaddr = 0; |
| 1331 | const char *fname = NULL, *func = NULL, *tmp; | 1331 | const char *fname = NULL, *func = NULL, *basefunc = NULL, *tmp; |
| 1332 | int baseline = 0, lineno = 0, ret = 0; | 1332 | int baseline = 0, lineno = 0, ret = 0; |
| 1333 | 1333 | ||
| 1334 | /* Adjust address with bias */ | 1334 | /* Adjust address with bias */ |
| @@ -1349,27 +1349,36 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr, | |||
| 1349 | /* Find a corresponding function (name, baseline and baseaddr) */ | 1349 | /* Find a corresponding function (name, baseline and baseaddr) */ |
| 1350 | if (die_find_realfunc(&cudie, (Dwarf_Addr)addr, &spdie)) { | 1350 | if (die_find_realfunc(&cudie, (Dwarf_Addr)addr, &spdie)) { |
| 1351 | /* Get function entry information */ | 1351 | /* Get function entry information */ |
| 1352 | tmp = dwarf_diename(&spdie); | 1352 | func = basefunc = dwarf_diename(&spdie); |
| 1353 | if (!tmp || | 1353 | if (!func || |
| 1354 | dwarf_entrypc(&spdie, &baseaddr) != 0 || | 1354 | dwarf_entrypc(&spdie, &baseaddr) != 0 || |
| 1355 | dwarf_decl_line(&spdie, &baseline) != 0) | 1355 | dwarf_decl_line(&spdie, &baseline) != 0) { |
| 1356 | lineno = 0; | ||
| 1356 | goto post; | 1357 | goto post; |
| 1357 | func = tmp; | 1358 | } |
| 1358 | 1359 | ||
| 1359 | if (addr == (unsigned long)baseaddr) | 1360 | if (addr == (unsigned long)baseaddr) { |
| 1360 | /* Function entry - Relative line number is 0 */ | 1361 | /* Function entry - Relative line number is 0 */ |
| 1361 | lineno = baseline; | 1362 | lineno = baseline; |
| 1362 | else if (die_find_inlinefunc(&spdie, (Dwarf_Addr)addr, | 1363 | fname = dwarf_decl_file(&spdie); |
| 1363 | &indie)) { | 1364 | goto post; |
| 1365 | } | ||
| 1366 | |||
| 1367 | /* Track down the inline functions step by step */ | ||
| 1368 | while (die_find_top_inlinefunc(&spdie, (Dwarf_Addr)addr, | ||
| 1369 | &indie)) { | ||
| 1370 | /* There is an inline function */ | ||
| 1364 | if (dwarf_entrypc(&indie, &_addr) == 0 && | 1371 | if (dwarf_entrypc(&indie, &_addr) == 0 && |
| 1365 | _addr == addr) | 1372 | _addr == addr) { |
| 1366 | /* | 1373 | /* |
| 1367 | * addr is at an inline function entry. | 1374 | * addr is at an inline function entry. |
| 1368 | * In this case, lineno should be the call-site | 1375 | * In this case, lineno should be the call-site |
| 1369 | * line number. | 1376 | * line number. (overwrite lineinfo) |
| 1370 | */ | 1377 | */ |
| 1371 | lineno = die_get_call_lineno(&indie); | 1378 | lineno = die_get_call_lineno(&indie); |
| 1372 | else { | 1379 | fname = die_get_call_file(&indie); |
| 1380 | break; | ||
| 1381 | } else { | ||
| 1373 | /* | 1382 | /* |
| 1374 | * addr is in an inline function body. | 1383 | * addr is in an inline function body. |
| 1375 | * Since lineno points one of the lines | 1384 | * Since lineno points one of the lines |
| @@ -1377,19 +1386,27 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr, | |||
| 1377 | * be the entry line of the inline function. | 1386 | * be the entry line of the inline function. |
| 1378 | */ | 1387 | */ |
| 1379 | tmp = dwarf_diename(&indie); | 1388 | tmp = dwarf_diename(&indie); |
| 1380 | if (tmp && | 1389 | if (!tmp || |
| 1381 | dwarf_decl_line(&spdie, &baseline) == 0) | 1390 | dwarf_decl_line(&indie, &baseline) != 0) |
| 1382 | func = tmp; | 1391 | break; |
| 1392 | func = tmp; | ||
| 1393 | spdie = indie; | ||
| 1383 | } | 1394 | } |
| 1384 | } | 1395 | } |
| 1396 | /* Verify the lineno and baseline are in a same file */ | ||
| 1397 | tmp = dwarf_decl_file(&spdie); | ||
| 1398 | if (!tmp || strcmp(tmp, fname) != 0) | ||
| 1399 | lineno = 0; | ||
| 1385 | } | 1400 | } |
| 1386 | 1401 | ||
| 1387 | post: | 1402 | post: |
| 1388 | /* Make a relative line number or an offset */ | 1403 | /* Make a relative line number or an offset */ |
| 1389 | if (lineno) | 1404 | if (lineno) |
| 1390 | ppt->line = lineno - baseline; | 1405 | ppt->line = lineno - baseline; |
| 1391 | else if (func) | 1406 | else if (basefunc) { |
| 1392 | ppt->offset = addr - (unsigned long)baseaddr; | 1407 | ppt->offset = addr - (unsigned long)baseaddr; |
| 1408 | func = basefunc; | ||
| 1409 | } | ||
| 1393 | 1410 | ||
| 1394 | /* Duplicate strings */ | 1411 | /* Duplicate strings */ |
| 1395 | if (func) { | 1412 | if (func) { |
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 70ffa41518f3..568b750c01f6 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
| @@ -256,6 +256,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool) | |||
| 256 | tool->sample = process_event_sample_stub; | 256 | tool->sample = process_event_sample_stub; |
| 257 | if (tool->mmap == NULL) | 257 | if (tool->mmap == NULL) |
| 258 | tool->mmap = process_event_stub; | 258 | tool->mmap = process_event_stub; |
| 259 | if (tool->mmap2 == NULL) | ||
| 260 | tool->mmap2 = process_event_stub; | ||
| 259 | if (tool->comm == NULL) | 261 | if (tool->comm == NULL) |
| 260 | tool->comm = process_event_stub; | 262 | tool->comm = process_event_stub; |
| 261 | if (tool->fork == NULL) | 263 | if (tool->fork == NULL) |
| @@ -1310,7 +1312,7 @@ int __perf_session__process_events(struct perf_session *session, | |||
| 1310 | file_offset = page_offset; | 1312 | file_offset = page_offset; |
| 1311 | head = data_offset - page_offset; | 1313 | head = data_offset - page_offset; |
| 1312 | 1314 | ||
| 1313 | if (data_offset + data_size < file_size) | 1315 | if (data_size && (data_offset + data_size < file_size)) |
| 1314 | file_size = data_offset + data_size; | 1316 | file_size = data_offset + data_size; |
| 1315 | 1317 | ||
| 1316 | progress_next = file_size / 16; | 1318 | progress_next = file_size / 16; |
diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c index 4fa655d68a81..41bd85559d4b 100644 --- a/tools/testing/selftests/timers/posix_timers.c +++ b/tools/testing/selftests/timers/posix_timers.c | |||
| @@ -151,7 +151,7 @@ static int check_timer_create(int which) | |||
| 151 | fflush(stdout); | 151 | fflush(stdout); |
| 152 | 152 | ||
| 153 | done = 0; | 153 | done = 0; |
| 154 | timer_create(which, NULL, &id); | 154 | err = timer_create(which, NULL, &id); |
| 155 | if (err < 0) { | 155 | if (err < 0) { |
| 156 | perror("Can't create timer\n"); | 156 | perror("Can't create timer\n"); |
| 157 | return -1; | 157 | return -1; |
