diff options
author | Alexandre Bounine <alexandre.bounine@idt.com> | 2012-10-04 20:16:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:05:22 -0400 |
commit | 005842efd1ac8ef455ebd28a8c713944863edc5a (patch) | |
tree | 9aea8b929ab5efc237d699cc36a4bed6adb51ad4 /drivers/rapidio/rio-scan.c | |
parent | a7071efc20567f4b6c454ff93ca80daf51bf93e9 (diff) |
rapidio: run discovery as an asynchronous process
Modify mport initialization routine to run the RapidIO discovery process
asynchronously. This allows to have an arbitrary order of enumerating and
discovering ports in systems with multiple RapidIO controllers without
creating a deadlock situation if enumerator port is registered after a
discovering one.
Making netID matching to mportID ensures consistent net ID assignment in
multiport RapidIO systems with asynchronous discovery process (global
counter implementation is affected by race between threads).
[akpm@linux-foundation.org: tweak code layput]
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rapidio/rio-scan.c')
-rw-r--r-- | drivers/rapidio/rio-scan.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c index 8b7c4bce7a4a..745670f535e8 100644 --- a/drivers/rapidio/rio-scan.c +++ b/drivers/rapidio/rio-scan.c | |||
@@ -44,7 +44,6 @@ static void rio_init_em(struct rio_dev *rdev); | |||
44 | DEFINE_SPINLOCK(rio_global_list_lock); | 44 | DEFINE_SPINLOCK(rio_global_list_lock); |
45 | 45 | ||
46 | static int next_destid = 0; | 46 | static int next_destid = 0; |
47 | static int next_net = 0; | ||
48 | static int next_comptag = 1; | 47 | static int next_comptag = 1; |
49 | 48 | ||
50 | static int rio_mport_phys_table[] = { | 49 | static int rio_mport_phys_table[] = { |
@@ -1062,7 +1061,7 @@ static struct rio_net __devinit *rio_alloc_net(struct rio_mport *port) | |||
1062 | INIT_LIST_HEAD(&net->mports); | 1061 | INIT_LIST_HEAD(&net->mports); |
1063 | list_add_tail(&port->nnode, &net->mports); | 1062 | list_add_tail(&port->nnode, &net->mports); |
1064 | net->hport = port; | 1063 | net->hport = port; |
1065 | net->id = next_net++; | 1064 | net->id = port->id; |
1066 | } | 1065 | } |
1067 | return net; | 1066 | return net; |
1068 | } | 1067 | } |