aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Beck <felix.beck@de.ibm.com>2009-09-11 04:28:51 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-09-11 04:29:50 -0400
commit95f1556c35529a162cef50296f3dc7f978852048 (patch)
tree944c4b85251436ab88e49e2192f0b5c75b1a2c9e
parent99b5e2d3d7ae8f5a2dba7a41a02ba7eb25523b3f (diff)
[S390] zcrypt: Use spin_lock_bh in suspend callback
Fix lock dependency warning. inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. bash/1442 [HC0[0]:SC0[0]:HE1:SE1] takes: (&ap_dev->lock){+.?...}, at: [<000003e001280404>] __ap_poll_device+0x40/0x3e8 [ap] {IN-SOFTIRQ-W} state was registered at: [<000000000017f094>] __lock_acquire+0xb78/0x182c [<000000000017fe8e>] lock_acquire+0x146/0x178 [<0000000000549cf2>] _spin_lock+0x5a/0x98 [<000003e001280404>] __ap_poll_device+0x40/0x3e8 [ap] [<000003e001280afe>] ap_poll_all+0xaa/0x1a4 [ap] [<000000000014fa82>] tasklet_action+0xfe/0x1f4 [<0000000000150a56>] __do_softirq+0x116/0x284 [<0000000000111058>] do_softirq+0xe4/0xe8 [<00000000001504ba>] irq_exit+0xba/0xd8 [<00000000003dd04a>] do_IRQ+0x176/0x1fc [<000000000011823c>] io_return+0x0/0x8 [<0000004bfbfd2c0e>] 0x4bfbfd2c0e Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--drivers/s390/crypto/ap_bus.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index ae9ab240c7f1..85785807acbc 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -648,7 +648,9 @@ static int ap_bus_suspend(struct device *dev, pm_message_t state)
648 /* Poll on the device until all requests are finished. */ 648 /* Poll on the device until all requests are finished. */
649 do { 649 do {
650 flags = 0; 650 flags = 0;
651 spin_lock_bh(&ap_dev->lock);
651 __ap_poll_device(ap_dev, &flags); 652 __ap_poll_device(ap_dev, &flags);
653 spin_unlock_bh(&ap_dev->lock);
652 } while ((flags & 1) || (flags & 2)); 654 } while ((flags & 1) || (flags & 2));
653 655
654 ap_device_remove(dev); 656 ap_device_remove(dev);
@@ -1407,14 +1409,12 @@ static void ap_reset(struct ap_device *ap_dev)
1407 1409
1408static int __ap_poll_device(struct ap_device *ap_dev, unsigned long *flags) 1410static int __ap_poll_device(struct ap_device *ap_dev, unsigned long *flags)
1409{ 1411{
1410 spin_lock(&ap_dev->lock);
1411 if (!ap_dev->unregistered) { 1412 if (!ap_dev->unregistered) {
1412 if (ap_poll_queue(ap_dev, flags)) 1413 if (ap_poll_queue(ap_dev, flags))
1413 ap_dev->unregistered = 1; 1414 ap_dev->unregistered = 1;
1414 if (ap_dev->reset == AP_RESET_DO) 1415 if (ap_dev->reset == AP_RESET_DO)
1415 ap_reset(ap_dev); 1416 ap_reset(ap_dev);
1416 } 1417 }
1417 spin_unlock(&ap_dev->lock);
1418 return 0; 1418 return 0;
1419} 1419}
1420 1420
@@ -1441,7 +1441,9 @@ static void ap_poll_all(unsigned long dummy)
1441 flags = 0; 1441 flags = 0;
1442 spin_lock(&ap_device_list_lock); 1442 spin_lock(&ap_device_list_lock);
1443 list_for_each_entry(ap_dev, &ap_device_list, list) { 1443 list_for_each_entry(ap_dev, &ap_device_list, list) {
1444 spin_lock(&ap_dev->lock);
1444 __ap_poll_device(ap_dev, &flags); 1445 __ap_poll_device(ap_dev, &flags);
1446 spin_unlock(&ap_dev->lock);
1445 } 1447 }
1446 spin_unlock(&ap_device_list_lock); 1448 spin_unlock(&ap_device_list_lock);
1447 } while (flags & 1); 1449 } while (flags & 1);
@@ -1487,7 +1489,9 @@ static int ap_poll_thread(void *data)
1487 flags = 0; 1489 flags = 0;
1488 spin_lock_bh(&ap_device_list_lock); 1490 spin_lock_bh(&ap_device_list_lock);
1489 list_for_each_entry(ap_dev, &ap_device_list, list) { 1491 list_for_each_entry(ap_dev, &ap_device_list, list) {
1492 spin_lock(&ap_dev->lock);
1490 __ap_poll_device(ap_dev, &flags); 1493 __ap_poll_device(ap_dev, &flags);
1494 spin_unlock(&ap_dev->lock);
1491 } 1495 }
1492 spin_unlock_bh(&ap_device_list_lock); 1496 spin_unlock_bh(&ap_device_list_lock);
1493 } 1497 }