Commit 679395fdaa68de39aaf2ddf7298b504fed9622d3

Authored by Alexandre Bounine
Committed by Linus Torvalds
1 parent 7a88d62862

rapidio: use default route value for CPS switches

Fix to use correct default value for routing table entries.

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: Thomas Moll <thomas.moll@sysgo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 10 additions and 8 deletions Side-by-side Diff

drivers/rapidio/switches/idtcps.c
... ... @@ -15,7 +15,8 @@
15 15 #include <linux/rio_ids.h>
16 16 #include "../rio.h"
17 17  
18   -#define CPS_NO_ROUTE 0xdf
  18 +#define CPS_DEFAULT_ROUTE 0xde
  19 +#define CPS_NO_ROUTE 0xdf
19 20  
20 21 #define IDTCPS_RIO_DOMAIN 0xf20020
21 22  
... ... @@ -53,10 +54,11 @@
53 54 rio_mport_read_config_32(mport, destid, hopcount,
54 55 RIO_STD_RTE_CONF_PORT_SEL_CSR, &result);
55 56  
56   - if (CPS_NO_ROUTE == (u8)result)
57   - result = RIO_INVALID_ROUTE;
58   -
59   - *route_port = (u8)result;
  57 + if (CPS_DEFAULT_ROUTE == (u8)result ||
  58 + CPS_NO_ROUTE == (u8)result)
  59 + *route_port = RIO_INVALID_ROUTE;
  60 + else
  61 + *route_port = (u8)result;
60 62 }
61 63  
62 64 return 0;
... ... @@ -74,9 +76,9 @@
74 76 RIO_STD_RTE_CONF_DESTID_SEL_CSR, i);
75 77 rio_mport_write_config_32(mport, destid, hopcount,
76 78 RIO_STD_RTE_CONF_PORT_SEL_CSR,
77   - (RIO_INVALID_ROUTE << 24) |
78   - (RIO_INVALID_ROUTE << 16) |
79   - (RIO_INVALID_ROUTE << 8) | RIO_INVALID_ROUTE);
  79 + (CPS_DEFAULT_ROUTE << 24) |
  80 + (CPS_DEFAULT_ROUTE << 16) |
  81 + (CPS_DEFAULT_ROUTE << 8) | CPS_DEFAULT_ROUTE);
80 82 i += 4;
81 83 }
82 84 }