diff options
-rw-r--r-- | drivers/acpi/acpi_ipmi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/acpi/acpi_ipmi.c b/drivers/acpi/acpi_ipmi.c index 7397135702db..87307baeafab 100644 --- a/drivers/acpi/acpi_ipmi.c +++ b/drivers/acpi/acpi_ipmi.c | |||
@@ -228,11 +228,14 @@ static void ipmi_flush_tx_msg(struct acpi_ipmi_device *ipmi) | |||
228 | struct acpi_ipmi_msg *tx_msg, *temp; | 228 | struct acpi_ipmi_msg *tx_msg, *temp; |
229 | int count = HZ / 10; | 229 | int count = HZ / 10; |
230 | struct pnp_dev *pnp_dev = ipmi->pnp_dev; | 230 | struct pnp_dev *pnp_dev = ipmi->pnp_dev; |
231 | unsigned long flags; | ||
231 | 232 | ||
233 | spin_lock_irqsave(&ipmi->tx_msg_lock, flags); | ||
232 | list_for_each_entry_safe(tx_msg, temp, &ipmi->tx_msg_list, head) { | 234 | list_for_each_entry_safe(tx_msg, temp, &ipmi->tx_msg_list, head) { |
233 | /* wake up the sleep thread on the Tx msg */ | 235 | /* wake up the sleep thread on the Tx msg */ |
234 | complete(&tx_msg->tx_complete); | 236 | complete(&tx_msg->tx_complete); |
235 | } | 237 | } |
238 | spin_unlock_irqrestore(&ipmi->tx_msg_lock, flags); | ||
236 | 239 | ||
237 | /* wait for about 100ms to flush the tx message list */ | 240 | /* wait for about 100ms to flush the tx message list */ |
238 | while (count--) { | 241 | while (count--) { |
@@ -266,11 +269,10 @@ static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data) | |||
266 | } | 269 | } |
267 | } | 270 | } |
268 | 271 | ||
269 | spin_unlock_irqrestore(&ipmi_device->tx_msg_lock, flags); | ||
270 | if (!msg_found) { | 272 | if (!msg_found) { |
271 | dev_warn(&pnp_dev->dev, "Unexpected response (msg id %ld) is " | 273 | dev_warn(&pnp_dev->dev, "Unexpected response (msg id %ld) is " |
272 | "returned.\n", msg->msgid); | 274 | "returned.\n", msg->msgid); |
273 | goto out_msg; | 275 | goto out_lock; |
274 | } | 276 | } |
275 | 277 | ||
276 | /* copy the response data to Rx_data buffer */ | 278 | /* copy the response data to Rx_data buffer */ |
@@ -284,6 +286,8 @@ static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data) | |||
284 | tx_msg->msg_done = 1; | 286 | tx_msg->msg_done = 1; |
285 | } | 287 | } |
286 | complete(&tx_msg->tx_complete); | 288 | complete(&tx_msg->tx_complete); |
289 | out_lock: | ||
290 | spin_unlock_irqrestore(&ipmi_device->tx_msg_lock, flags); | ||
287 | out_msg: | 291 | out_msg: |
288 | ipmi_free_recv_msg(msg); | 292 | ipmi_free_recv_msg(msg); |
289 | }; | 293 | }; |