aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rapidio/rio.c
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2013-05-24 18:55:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-24 19:22:50 -0400
commitbc8fcfea18249640f2728c46d70999dcb7e4dc49 (patch)
tree7d24b4132c4dd821c998649f21344bec6f4a3453 /drivers/rapidio/rio.c
parenta11650e11093ed57dca78bf16e7836517c599098 (diff)
rapidio: add enumeration/discovery start from user space
Add RapidIO enumeration/discovery start from user space. User space start allows to defer RapidIO fabric scan until the moment when all participating endpoints are initialized avoiding mandatory synchronized start of all endpoints (which may be challenging in systems with large number of RapidIO endpoints). Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: Li Yang <leoli@freescale.com> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: Andre van Herk <andre.van.herk@Prodrive.nl> Cc: Micha Nelissen <micha.nelissen@Prodrive.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rapidio/rio.c')
-rw-r--r--drivers/rapidio/rio.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index 6e75dda34799..cb1c08996fbb 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -1383,6 +1383,30 @@ EXPORT_SYMBOL_GPL(rio_dma_prep_slave_sg);
1383#endif /* CONFIG_RAPIDIO_DMA_ENGINE */ 1383#endif /* CONFIG_RAPIDIO_DMA_ENGINE */
1384 1384
1385/** 1385/**
1386 * rio_find_mport - find RIO mport by its ID
1387 * @mport_id: number (ID) of mport device
1388 *
1389 * Given a RIO mport number, the desired mport is located
1390 * in the global list of mports. If the mport is found, a pointer to its
1391 * data structure is returned. If no mport is found, %NULL is returned.
1392 */
1393struct rio_mport *rio_find_mport(int mport_id)
1394{
1395 struct rio_mport *port;
1396
1397 mutex_lock(&rio_mport_list_lock);
1398 list_for_each_entry(port, &rio_mports, node) {
1399 if (port->id == mport_id)
1400 goto found;
1401 }
1402 port = NULL;
1403found:
1404 mutex_unlock(&rio_mport_list_lock);
1405
1406 return port;
1407}
1408
1409/**
1386 * rio_register_scan - enumeration/discovery method registration interface 1410 * rio_register_scan - enumeration/discovery method registration interface
1387 * @mport_id: mport device ID for which fabric scan routine has to be set 1411 * @mport_id: mport device ID for which fabric scan routine has to be set
1388 * (RIO_MPORT_ANY = set for all available mports) 1412 * (RIO_MPORT_ANY = set for all available mports)
@@ -1475,7 +1499,7 @@ static void disc_work_handler(struct work_struct *_work)
1475 work = container_of(_work, struct rio_disc_work, work); 1499 work = container_of(_work, struct rio_disc_work, work);
1476 pr_debug("RIO: discovery work for mport %d %s\n", 1500 pr_debug("RIO: discovery work for mport %d %s\n",
1477 work->mport->id, work->mport->name); 1501 work->mport->id, work->mport->name);
1478 work->mport->nscan->discover(work->mport); 1502 work->mport->nscan->discover(work->mport, 0);
1479} 1503}
1480 1504
1481int rio_init_mports(void) 1505int rio_init_mports(void)
@@ -1495,7 +1519,7 @@ int rio_init_mports(void)
1495 list_for_each_entry(port, &rio_mports, node) { 1519 list_for_each_entry(port, &rio_mports, node) {
1496 if (port->host_deviceid >= 0) { 1520 if (port->host_deviceid >= 0) {
1497 if (port->nscan) 1521 if (port->nscan)
1498 port->nscan->enumerate(port); 1522 port->nscan->enumerate(port, 0);
1499 } else 1523 } else
1500 n++; 1524 n++;
1501 } 1525 }