Skip to content

Commit 4bf841e

Browse files
Thomas Bogendoerferpaulburton
authored andcommitted
MIPS: SGI-IP27: get rid of compact node ids
Node ids don't need to be contiguous in Linux, so the concept to use compact node ids to make them contiguous isn't needed at all. This patchset therefore removes it. Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: James Hogan <jhogan@kernel.org> Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org
1 parent 46a73e9 commit 4bf841e

20 files changed

Lines changed: 81 additions & 212 deletions

‎arch/mips/include/asm/mach-ip27/mmzone.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <asm/sn/arch.h>
77
#include <asm/sn/hub.h>
88

9-
#define pa_to_nid(addr) NASID_TO_COMPACT_NODEID(NASID_GET(addr))
9+
#define pa_to_nid(addr) NASID_GET(addr)
1010

1111
struct hub_data {
1212
kern_vars_t kern_vars;

‎arch/mips/include/asm/mach-ip27/topology.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
#include <asm/mmzone.h>
88

99
struct cpuinfo_ip27 {
10-
cnodeid_t p_nodeid; /* my node ID in compact-id-space */
1110
nasid_t p_nasid; /* my node ID in numa-as-id-space */
1211
unsigned char p_slice; /* Physical position on node board */
1312
};
1413

1514
extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
1615

17-
#define cpu_to_node(cpu) (sn_cpu_info[(cpu)].p_nodeid)
16+
#define cpu_to_node(cpu) (cputonasid(cpu))
1817
#define cpumask_of_node(node) ((node) == -1 ? \
1918
cpu_all_mask : \
2019
&hub_data(node)->h_cpus)

‎arch/mips/include/asm/sn/agent.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#if defined(CONFIG_SGI_IP27)
2828
#define HUB_NIC_ADDR(_cpuid) \
29-
REMOTE_HUB_ADDR(COMPACT_TO_NASID_NODEID(cpu_to_node(_cpuid)), \
29+
REMOTE_HUB_ADDR(cpu_to_node(_cpuid), \
3030
MD_MLAN_CTL)
3131
#endif
3232

‎arch/mips/include/asm/sn/arch.h‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,11 @@
2121
#define cputoslice(cpu) (sn_cpu_info[(cpu)].p_slice)
2222

2323
#define INVALID_NASID (nasid_t)-1
24-
#define INVALID_CNODEID (cnodeid_t)-1
2524
#define INVALID_PNODEID (pnodeid_t)-1
2625
#define INVALID_MODULE (moduleid_t)-1
2726
#define INVALID_PARTID (partid_t)-1
2827

2928
extern nasid_t get_nasid(void);
30-
extern cnodeid_t get_cpu_cnode(cpuid_t);
3129
extern int get_cpu_slice(cpuid_t);
3230

33-
/*
34-
* NO ONE should access these arrays directly. The only reason we refer to
35-
* them here is to avoid the procedure call that would be required in the
36-
* macros below. (Really want private data members here :-)
37-
*/
38-
extern cnodeid_t nasid_to_compact_node[MAX_NASIDS];
39-
extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES];
40-
41-
/*
42-
* These macros are used by various parts of the kernel to convert
43-
* between the three different kinds of node numbering. At least some
44-
* of them may change to procedure calls in the future, but the macros
45-
* will continue to work. Don't use the arrays above directly.
46-
*/
47-
48-
extern cnodeid_t cpuid_to_compact_node[MAXCPUS];
49-
50-
#define NASID_TO_COMPACT_NODEID(nnode) (nasid_to_compact_node[nnode])
51-
#define COMPACT_TO_NASID_NODEID(cnode) (compact_to_nasid_node[cnode])
52-
#define CPUID_TO_COMPACT_NODEID(cpu) (cpuid_to_compact_node[(cpu)])
53-
5431
#endif /* _ASM_SN_ARCH_H */

‎arch/mips/include/asm/sn/hub.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include <asm/xtalk/xtalk.h>
1111

1212
/* ip27-hubio.c */
13-
extern unsigned long hub_pio_map(cnodeid_t cnode, xwidgetnum_t widget,
13+
extern unsigned long hub_pio_map(nasid_t nasid, xwidgetnum_t widget,
1414
unsigned long xtalk_addr, size_t size);
15-
extern void hub_pio_init(cnodeid_t cnode);
15+
extern void hub_pio_init(nasid_t nasid);
1616

1717
#endif /* __ASM_SN_HUB_H */

‎arch/mips/include/asm/sn/mapped_kernel.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737

3838
#define MAPPED_KERN_RO_TO_PHYS(x) \
3939
((unsigned long)MAPPED_ADDR_RO_TO_PHYS(x) | \
40-
MAPPED_KERN_RO_PHYSBASE(get_compact_nodeid()))
40+
MAPPED_KERN_RO_PHYSBASE(get_nasid()))
4141
#define MAPPED_KERN_RW_TO_PHYS(x) \
4242
((unsigned long)MAPPED_ADDR_RW_TO_PHYS(x) | \
43-
MAPPED_KERN_RW_PHYSBASE(get_compact_nodeid()))
43+
MAPPED_KERN_RW_PHYSBASE(get_nasid()))
4444

4545
#else /* CONFIG_MAPPED_KERNEL */
4646

‎arch/mips/include/asm/sn/sn_private.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
extern nasid_t master_nasid;
88

99
extern void cpu_node_probe(void);
10-
extern cnodeid_t get_compact_nodeid(void);
11-
extern void hub_rtc_init(cnodeid_t);
10+
extern void hub_rtc_init(nasid_t nasid);
1211
extern void cpu_time_init(void);
1312
extern void per_cpu_init(void);
1413
extern void install_cpu_nmi_handler(int slice);
1514
extern void install_ipi(void);
1615
extern void setup_replication_mask(void);
1716
extern void replicate_kernel_text(void);
18-
extern unsigned long node_getfirstfree(cnodeid_t);
17+
extern unsigned long node_getfirstfree(nasid_t nasid);
1918

2019
#endif /* __ASM_SN_SN_PRIVATE_H */

‎arch/mips/include/asm/sn/types.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
typedef unsigned long cpuid_t;
1515
typedef signed short nasid_t; /* node id in numa-as-id space */
16-
typedef signed short cnodeid_t; /* node id in compact-id space */
1716
typedef signed char partid_t; /* partition ID type */
1817
typedef signed short moduleid_t; /* user-visible module number type */
1918

‎arch/mips/pci/pci-xtalk-bridge.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static int bridge_set_affinity(struct irq_data *d, const struct cpumask *mask,
285285
ret = irq_chip_set_affinity_parent(d, mask, force);
286286
if (ret >= 0) {
287287
cpu = cpumask_first_and(mask, cpu_online_mask);
288-
nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu));
288+
nasid = cpu_to_node(cpu);
289289
bridge_write(data->bc, b_int_addr[pin].addr,
290290
(((data->bc->intr_addr >> 30) & 0x30000) |
291291
bit | (nasid << 8)));

‎arch/mips/sgi-ip27/ip27-hubio.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ static int force_fire_and_forget = 1;
2525
* @size: size of the PIO mapping
2626
*
2727
**/
28-
unsigned long hub_pio_map(cnodeid_t cnode, xwidgetnum_t widget,
28+
unsigned long hub_pio_map(nasid_t nasid, xwidgetnum_t widget,
2929
unsigned long xtalk_addr, size_t size)
3030
{
31-
nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode);
3231
unsigned i;
3332

3433
/* use small-window mapping if possible */
@@ -44,7 +43,7 @@ unsigned long hub_pio_map(cnodeid_t cnode, xwidgetnum_t widget,
4443

4544
xtalk_addr &= ~(BWIN_SIZE-1);
4645
for (i = 0; i < HUB_NUM_BIG_WINDOW; i++) {
47-
if (test_and_set_bit(i, hub_data(cnode)->h_bigwin_used))
46+
if (test_and_set_bit(i, hub_data(nasid)->h_bigwin_used))
4847
continue;
4948

5049
/*
@@ -171,13 +170,12 @@ static void hub_set_piomode(nasid_t nasid)
171170
*
172171
* @hub: hubinfo structure for our hub
173172
*/
174-
void hub_pio_init(cnodeid_t cnode)
173+
void hub_pio_init(nasid_t nasid)
175174
{
176-
nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode);
177175
unsigned i;
178176

179177
/* initialize big window piomaps for this hub */
180-
bitmap_zero(hub_data(cnode)->h_bigwin_used, HUB_NUM_BIG_WINDOW);
178+
bitmap_zero(hub_data(nasid)->h_bigwin_used, HUB_NUM_BIG_WINDOW);
181179
for (i = 0; i < HUB_NUM_BIG_WINDOW; i++)
182180
IIO_ITTE_DISABLE(nasid, i);
183181

0 commit comments

Comments
 (0)