Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rapidio: fix default routing initialization

Fix switch initialization to ensure that all switches have default routing
disabled. This guarantees that no unexpected RapidIO packets arrive to
the default port set by reset and there is no default routing destination
until it is properly configured by software.

This update also unifies handling of unmapped destinations by tsi57x, IDT
Gen1 and IDT Gen2 switches.

Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Thomas Moll <thomas.moll@sysgo.com>
Cc: <stable@kernel.org> [2.6.37+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alexandre Bounine and committed by
Linus Torvalds
0bf2461f a085963a

+21
+9
drivers/rapidio/switches/idt_gen2.c
··· 95 95 else 96 96 table++; 97 97 98 + if (route_port == RIO_INVALID_ROUTE) 99 + route_port = IDT_DEFAULT_ROUTE; 100 + 98 101 rio_mport_write_config_32(mport, destid, hopcount, 99 102 LOCAL_RTE_CONF_DESTID_SEL, table); 100 103 ··· 413 410 rdev->rswitch->em_init = idtg2_em_init; 414 411 rdev->rswitch->em_handle = idtg2_em_handler; 415 412 rdev->rswitch->sw_sysfs = idtg2_sysfs; 413 + 414 + if (do_enum) { 415 + /* Ensure that default routing is disabled on startup */ 416 + rio_write_config_32(rdev, 417 + RIO_STD_RTE_DEFAULT_PORT, IDT_NO_ROUTE); 418 + } 416 419 417 420 return 0; 418 421 }
+6
drivers/rapidio/switches/idtcps.c
··· 26 26 { 27 27 u32 result; 28 28 29 + if (route_port == RIO_INVALID_ROUTE) 30 + route_port = CPS_DEFAULT_ROUTE; 31 + 29 32 if (table == RIO_GLOBAL_TABLE) { 30 33 rio_mport_write_config_32(mport, destid, hopcount, 31 34 RIO_STD_RTE_CONF_DESTID_SEL_CSR, route_destid); ··· 133 130 /* set TVAL = ~50us */ 134 131 rio_write_config_32(rdev, 135 132 rdev->phys_efptr + RIO_PORT_LINKTO_CTL_CSR, 0x8e << 8); 133 + /* Ensure that default routing is disabled on startup */ 134 + rio_write_config_32(rdev, 135 + RIO_STD_RTE_DEFAULT_PORT, CPS_NO_ROUTE); 136 136 } 137 137 138 138 return 0;
+6
drivers/rapidio/switches/tsi57x.c
··· 303 303 rdev->rswitch->em_init = tsi57x_em_init; 304 304 rdev->rswitch->em_handle = tsi57x_em_handler; 305 305 306 + if (do_enum) { 307 + /* Ensure that default routing is disabled on startup */ 308 + rio_write_config_32(rdev, RIO_STD_RTE_DEFAULT_PORT, 309 + RIO_INVALID_ROUTE); 310 + } 311 + 306 312 return 0; 307 313 } 308 314