diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-02-18 14:42:00 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-02-22 16:36:01 -0500 |
commit | ea102d0ec475e4cd6e74a8b61b45708fbf6b582e (patch) | |
tree | 523c0b5b10e0f0325332daaca74f78454e6f7b8f | |
parent | 90963f1cdb3baffc68321e7c98073bf9e99d2ec7 (diff) |
firewire: core: convert AR-req handler lock from _irqsave to _bh
fw_core_handle_request() is called by the low-level driver in tasklet
context or process context, and fw_core_add/remove_address_handler() is
called by mid- or high-level code in process context. So convert
address_handler_lock accesses from those which disable local IRQs to
ones which just disable local softIRQs.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | drivers/firewire/core-transaction.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index 190bf61533a2..dea2dcc9310d 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c | |||
@@ -565,7 +565,6 @@ int fw_core_add_address_handler(struct fw_address_handler *handler, | |||
565 | const struct fw_address_region *region) | 565 | const struct fw_address_region *region) |
566 | { | 566 | { |
567 | struct fw_address_handler *other; | 567 | struct fw_address_handler *other; |
568 | unsigned long flags; | ||
569 | int ret = -EBUSY; | 568 | int ret = -EBUSY; |
570 | 569 | ||
571 | if (region->start & 0xffff000000000003ULL || | 570 | if (region->start & 0xffff000000000003ULL || |
@@ -575,7 +574,7 @@ int fw_core_add_address_handler(struct fw_address_handler *handler, | |||
575 | handler->length == 0) | 574 | handler->length == 0) |
576 | return -EINVAL; | 575 | return -EINVAL; |
577 | 576 | ||
578 | spin_lock_irqsave(&address_handler_lock, flags); | 577 | spin_lock_bh(&address_handler_lock); |
579 | 578 | ||
580 | handler->offset = region->start; | 579 | handler->offset = region->start; |
581 | while (handler->offset + handler->length <= region->end) { | 580 | while (handler->offset + handler->length <= region->end) { |
@@ -594,7 +593,7 @@ int fw_core_add_address_handler(struct fw_address_handler *handler, | |||
594 | } | 593 | } |
595 | } | 594 | } |
596 | 595 | ||
597 | spin_unlock_irqrestore(&address_handler_lock, flags); | 596 | spin_unlock_bh(&address_handler_lock); |
598 | 597 | ||
599 | return ret; | 598 | return ret; |
600 | } | 599 | } |
@@ -608,11 +607,9 @@ EXPORT_SYMBOL(fw_core_add_address_handler); | |||
608 | */ | 607 | */ |
609 | void fw_core_remove_address_handler(struct fw_address_handler *handler) | 608 | void fw_core_remove_address_handler(struct fw_address_handler *handler) |
610 | { | 609 | { |
611 | unsigned long flags; | 610 | spin_lock_bh(&address_handler_lock); |
612 | |||
613 | spin_lock_irqsave(&address_handler_lock, flags); | ||
614 | list_del(&handler->link); | 611 | list_del(&handler->link); |
615 | spin_unlock_irqrestore(&address_handler_lock, flags); | 612 | spin_unlock_bh(&address_handler_lock); |
616 | } | 613 | } |
617 | EXPORT_SYMBOL(fw_core_remove_address_handler); | 614 | EXPORT_SYMBOL(fw_core_remove_address_handler); |
618 | 615 | ||
@@ -829,7 +826,6 @@ static void handle_exclusive_region_request(struct fw_card *card, | |||
829 | unsigned long long offset) | 826 | unsigned long long offset) |
830 | { | 827 | { |
831 | struct fw_address_handler *handler; | 828 | struct fw_address_handler *handler; |
832 | unsigned long flags; | ||
833 | int tcode, destination, source; | 829 | int tcode, destination, source; |
834 | 830 | ||
835 | destination = HEADER_GET_DESTINATION(p->header[0]); | 831 | destination = HEADER_GET_DESTINATION(p->header[0]); |
@@ -838,7 +834,7 @@ static void handle_exclusive_region_request(struct fw_card *card, | |||
838 | if (tcode == TCODE_LOCK_REQUEST) | 834 | if (tcode == TCODE_LOCK_REQUEST) |
839 | tcode = 0x10 + HEADER_GET_EXTENDED_TCODE(p->header[3]); | 835 | tcode = 0x10 + HEADER_GET_EXTENDED_TCODE(p->header[3]); |
840 | 836 | ||
841 | spin_lock_irqsave(&address_handler_lock, flags); | 837 | spin_lock_bh(&address_handler_lock); |
842 | handler = lookup_enclosing_address_handler(&address_handler_list, | 838 | handler = lookup_enclosing_address_handler(&address_handler_list, |
843 | offset, request->length); | 839 | offset, request->length); |
844 | if (handler) | 840 | if (handler) |
@@ -847,7 +843,7 @@ static void handle_exclusive_region_request(struct fw_card *card, | |||
847 | p->generation, offset, | 843 | p->generation, offset, |
848 | request->data, request->length, | 844 | request->data, request->length, |
849 | handler->callback_data); | 845 | handler->callback_data); |
850 | spin_unlock_irqrestore(&address_handler_lock, flags); | 846 | spin_unlock_bh(&address_handler_lock); |
851 | 847 | ||
852 | if (!handler) | 848 | if (!handler) |
853 | fw_send_response(card, request, RCODE_ADDRESS_ERROR); | 849 | fw_send_response(card, request, RCODE_ADDRESS_ERROR); |
@@ -859,7 +855,6 @@ static void handle_fcp_region_request(struct fw_card *card, | |||
859 | unsigned long long offset) | 855 | unsigned long long offset) |
860 | { | 856 | { |
861 | struct fw_address_handler *handler; | 857 | struct fw_address_handler *handler; |
862 | unsigned long flags; | ||
863 | int tcode, destination, source; | 858 | int tcode, destination, source; |
864 | 859 | ||
865 | if ((offset != (CSR_REGISTER_BASE | CSR_FCP_COMMAND) && | 860 | if ((offset != (CSR_REGISTER_BASE | CSR_FCP_COMMAND) && |
@@ -881,7 +876,7 @@ static void handle_fcp_region_request(struct fw_card *card, | |||
881 | return; | 876 | return; |
882 | } | 877 | } |
883 | 878 | ||
884 | spin_lock_irqsave(&address_handler_lock, flags); | 879 | spin_lock_bh(&address_handler_lock); |
885 | list_for_each_entry(handler, &address_handler_list, link) { | 880 | list_for_each_entry(handler, &address_handler_list, link) { |
886 | if (is_enclosing_handler(handler, offset, request->length)) | 881 | if (is_enclosing_handler(handler, offset, request->length)) |
887 | handler->address_callback(card, NULL, tcode, | 882 | handler->address_callback(card, NULL, tcode, |
@@ -891,7 +886,7 @@ static void handle_fcp_region_request(struct fw_card *card, | |||
891 | request->length, | 886 | request->length, |
892 | handler->callback_data); | 887 | handler->callback_data); |
893 | } | 888 | } |
894 | spin_unlock_irqrestore(&address_handler_lock, flags); | 889 | spin_unlock_bh(&address_handler_lock); |
895 | 890 | ||
896 | fw_send_response(card, request, RCODE_COMPLETE); | 891 | fw_send_response(card, request, RCODE_COMPLETE); |
897 | } | 892 | } |