diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-11-24 13:34:40 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-11-24 13:34:40 -0500 |
commit | 8bd142c01648cdb33e9bcafa0448ba2c20ed814c (patch) | |
tree | 9197c60d3f9d4036f38f281a183e94750ceea1d7 /drivers/acpi | |
parent | d792abacaf1a1a8dfea353fab699b97fa6251c2a (diff) | |
parent | fbb4574ce9a37e15a9872860bf202f2be5bdf6c4 (diff) |
Merge tag 'kvm-arm-for-v4.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master
KVM/ARM Fixes for v4.4-rc3.
Includes some timer fixes, properly unmapping PTEs, an errata fix, and two
tweaks to the EL2 panic code.
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/cppc_acpi.c | 2 | ||||
-rw-r--r-- | drivers/acpi/ec.c | 2 | ||||
-rw-r--r-- | drivers/acpi/sbshc.c | 48 |
3 files changed, 9 insertions, 43 deletions
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 3c083d2cc434..6730f965b379 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c | |||
@@ -304,7 +304,7 @@ EXPORT_SYMBOL_GPL(acpi_get_psd_map); | |||
304 | 304 | ||
305 | static int register_pcc_channel(int pcc_subspace_idx) | 305 | static int register_pcc_channel(int pcc_subspace_idx) |
306 | { | 306 | { |
307 | struct acpi_pcct_subspace *cppc_ss; | 307 | struct acpi_pcct_hw_reduced *cppc_ss; |
308 | unsigned int len; | 308 | unsigned int len; |
309 | 309 | ||
310 | if (pcc_subspace_idx >= 0) { | 310 | if (pcc_subspace_idx >= 0) { |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index f61a7c834540..b420fb46669d 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -1103,7 +1103,7 @@ static int acpi_ec_query(struct acpi_ec *ec, u8 *data) | |||
1103 | } | 1103 | } |
1104 | 1104 | ||
1105 | err_exit: | 1105 | err_exit: |
1106 | if (result && q) | 1106 | if (result) |
1107 | acpi_ec_delete_query(q); | 1107 | acpi_ec_delete_query(q); |
1108 | if (data) | 1108 | if (data) |
1109 | *data = value; | 1109 | *data = value; |
diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c index bf034f8b7c1a..2fa8304171e0 100644 --- a/drivers/acpi/sbshc.c +++ b/drivers/acpi/sbshc.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/dmi.h> | ||
18 | #include "sbshc.h" | 17 | #include "sbshc.h" |
19 | 18 | ||
20 | #define PREFIX "ACPI: " | 19 | #define PREFIX "ACPI: " |
@@ -30,6 +29,7 @@ struct acpi_smb_hc { | |||
30 | u8 query_bit; | 29 | u8 query_bit; |
31 | smbus_alarm_callback callback; | 30 | smbus_alarm_callback callback; |
32 | void *context; | 31 | void *context; |
32 | bool done; | ||
33 | }; | 33 | }; |
34 | 34 | ||
35 | static int acpi_smbus_hc_add(struct acpi_device *device); | 35 | static int acpi_smbus_hc_add(struct acpi_device *device); |
@@ -88,8 +88,6 @@ enum acpi_smb_offset { | |||
88 | ACPI_SMB_ALARM_DATA = 0x26, /* 2 bytes alarm data */ | 88 | ACPI_SMB_ALARM_DATA = 0x26, /* 2 bytes alarm data */ |
89 | }; | 89 | }; |
90 | 90 | ||
91 | static bool macbook; | ||
92 | |||
93 | static inline int smb_hc_read(struct acpi_smb_hc *hc, u8 address, u8 *data) | 91 | static inline int smb_hc_read(struct acpi_smb_hc *hc, u8 address, u8 *data) |
94 | { | 92 | { |
95 | return ec_read(hc->offset + address, data); | 93 | return ec_read(hc->offset + address, data); |
@@ -100,27 +98,11 @@ static inline int smb_hc_write(struct acpi_smb_hc *hc, u8 address, u8 data) | |||
100 | return ec_write(hc->offset + address, data); | 98 | return ec_write(hc->offset + address, data); |
101 | } | 99 | } |
102 | 100 | ||
103 | static inline int smb_check_done(struct acpi_smb_hc *hc) | ||
104 | { | ||
105 | union acpi_smb_status status = {.raw = 0}; | ||
106 | smb_hc_read(hc, ACPI_SMB_STATUS, &status.raw); | ||
107 | return status.fields.done && (status.fields.status == SMBUS_OK); | ||
108 | } | ||
109 | |||
110 | static int wait_transaction_complete(struct acpi_smb_hc *hc, int timeout) | 101 | static int wait_transaction_complete(struct acpi_smb_hc *hc, int timeout) |
111 | { | 102 | { |
112 | if (wait_event_timeout(hc->wait, smb_check_done(hc), | 103 | if (wait_event_timeout(hc->wait, hc->done, msecs_to_jiffies(timeout))) |
113 | msecs_to_jiffies(timeout))) | ||
114 | return 0; | 104 | return 0; |
115 | /* | 105 | return -ETIME; |
116 | * After the timeout happens, OS will try to check the status of SMbus. | ||
117 | * If the status is what OS expected, it will be regarded as the bogus | ||
118 | * timeout. | ||
119 | */ | ||
120 | if (smb_check_done(hc)) | ||
121 | return 0; | ||
122 | else | ||
123 | return -ETIME; | ||
124 | } | 106 | } |
125 | 107 | ||
126 | static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol, | 108 | static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol, |
@@ -135,8 +117,7 @@ static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol, | |||
135 | } | 117 | } |
136 | 118 | ||
137 | mutex_lock(&hc->lock); | 119 | mutex_lock(&hc->lock); |
138 | if (macbook) | 120 | hc->done = false; |
139 | udelay(5); | ||
140 | if (smb_hc_read(hc, ACPI_SMB_PROTOCOL, &temp)) | 121 | if (smb_hc_read(hc, ACPI_SMB_PROTOCOL, &temp)) |
141 | goto end; | 122 | goto end; |
142 | if (temp) { | 123 | if (temp) { |
@@ -235,8 +216,10 @@ static int smbus_alarm(void *context) | |||
235 | if (smb_hc_read(hc, ACPI_SMB_STATUS, &status.raw)) | 216 | if (smb_hc_read(hc, ACPI_SMB_STATUS, &status.raw)) |
236 | return 0; | 217 | return 0; |
237 | /* Check if it is only a completion notify */ | 218 | /* Check if it is only a completion notify */ |
238 | if (status.fields.done) | 219 | if (status.fields.done && status.fields.status == SMBUS_OK) { |
220 | hc->done = true; | ||
239 | wake_up(&hc->wait); | 221 | wake_up(&hc->wait); |
222 | } | ||
240 | if (!status.fields.alarm) | 223 | if (!status.fields.alarm) |
241 | return 0; | 224 | return 0; |
242 | mutex_lock(&hc->lock); | 225 | mutex_lock(&hc->lock); |
@@ -262,29 +245,12 @@ extern int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit, | |||
262 | acpi_handle handle, acpi_ec_query_func func, | 245 | acpi_handle handle, acpi_ec_query_func func, |
263 | void *data); | 246 | void *data); |
264 | 247 | ||
265 | static int macbook_dmi_match(const struct dmi_system_id *d) | ||
266 | { | ||
267 | pr_debug("Detected MacBook, enabling workaround\n"); | ||
268 | macbook = true; | ||
269 | return 0; | ||
270 | } | ||
271 | |||
272 | static struct dmi_system_id acpi_smbus_dmi_table[] = { | ||
273 | { macbook_dmi_match, "Apple MacBook", { | ||
274 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), | ||
275 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBook") }, | ||
276 | }, | ||
277 | { }, | ||
278 | }; | ||
279 | |||
280 | static int acpi_smbus_hc_add(struct acpi_device *device) | 248 | static int acpi_smbus_hc_add(struct acpi_device *device) |
281 | { | 249 | { |
282 | int status; | 250 | int status; |
283 | unsigned long long val; | 251 | unsigned long long val; |
284 | struct acpi_smb_hc *hc; | 252 | struct acpi_smb_hc *hc; |
285 | 253 | ||
286 | dmi_check_system(acpi_smbus_dmi_table); | ||
287 | |||
288 | if (!device) | 254 | if (!device) |
289 | return -EINVAL; | 255 | return -EINVAL; |
290 | 256 | ||