Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329229
b: refs/heads/master
c: 35202f7
h: refs/heads/master
i:
  329227: d385903
v: v3
  • Loading branch information
Peter Hurley authored and Stefan Richter committed Sep 28, 2012
1 parent 5199271 commit 8acbceb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52439d605d6604c15954281a1d2831471dbd024c
refs/heads/master: 35202f7d8420fff586b372422a2419affeaba8ef
20 changes: 11 additions & 9 deletions trunk/drivers/firewire/core-transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/rculist.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/string.h>
Expand Down Expand Up @@ -489,7 +490,7 @@ static struct fw_address_handler *lookup_overlapping_address_handler(
{
struct fw_address_handler *handler;

list_for_each_entry(handler, list, link) {
list_for_each_entry_rcu(handler, list, link) {
if (handler->offset < offset + length &&
offset < handler->offset + handler->length)
return handler;
Expand All @@ -510,7 +511,7 @@ static struct fw_address_handler *lookup_enclosing_address_handler(
{
struct fw_address_handler *handler;

list_for_each_entry(handler, list, link) {
list_for_each_entry_rcu(handler, list, link) {
if (is_enclosing_handler(handler, offset, length))
return handler;
}
Expand Down Expand Up @@ -588,7 +589,7 @@ int fw_core_add_address_handler(struct fw_address_handler *handler,
if (other != NULL) {
handler->offset += other->length;
} else {
list_add_tail(&handler->link, &address_handler_list);
list_add_tail_rcu(&handler->link, &address_handler_list);
ret = 0;
break;
}
Expand All @@ -609,8 +610,9 @@ EXPORT_SYMBOL(fw_core_add_address_handler);
void fw_core_remove_address_handler(struct fw_address_handler *handler)
{
spin_lock_bh(&address_handler_lock);
list_del(&handler->link);
list_del_rcu(&handler->link);
spin_unlock_bh(&address_handler_lock);
synchronize_rcu();
}
EXPORT_SYMBOL(fw_core_remove_address_handler);

Expand Down Expand Up @@ -844,7 +846,7 @@ static void handle_exclusive_region_request(struct fw_card *card,
if (tcode == TCODE_LOCK_REQUEST)
tcode = 0x10 + HEADER_GET_EXTENDED_TCODE(p->header[3]);

spin_lock_bh(&address_handler_lock);
rcu_read_lock();
handler = lookup_enclosing_address_handler(&address_handler_list,
offset, request->length);
if (handler)
Expand All @@ -853,7 +855,7 @@ static void handle_exclusive_region_request(struct fw_card *card,
p->generation, offset,
request->data, request->length,
handler->callback_data);
spin_unlock_bh(&address_handler_lock);
rcu_read_unlock();

if (!handler)
fw_send_response(card, request, RCODE_ADDRESS_ERROR);
Expand Down Expand Up @@ -886,8 +888,8 @@ static void handle_fcp_region_request(struct fw_card *card,
return;
}

spin_lock_bh(&address_handler_lock);
list_for_each_entry(handler, &address_handler_list, link) {
rcu_read_lock();
list_for_each_entry_rcu(handler, &address_handler_list, link) {
if (is_enclosing_handler(handler, offset, request->length))
handler->address_callback(card, NULL, tcode,
destination, source,
Expand All @@ -896,7 +898,7 @@ static void handle_fcp_region_request(struct fw_card *card,
request->length,
handler->callback_data);
}
spin_unlock_bh(&address_handler_lock);
rcu_read_unlock();

fw_send_response(card, request, RCODE_COMPLETE);
}
Expand Down

0 comments on commit 8acbceb

Please sign in to comment.