Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26433
b: refs/heads/master
c: cf10560
h: refs/heads/master
i:
  26431: c05d126
v: v3
  • Loading branch information
Linus Torvalds committed May 2, 2006
1 parent 4bf3b53 commit deeebe7
Show file tree
Hide file tree
Showing 47 changed files with 633 additions and 370 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6f0413e10b76440fb82efebc63120f3b6d42adb
refs/heads/master: cf105601df49ba0ea5ac04a6154c6c1442994c74
5 changes: 4 additions & 1 deletion trunk/arch/i386/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
{
struct acpi_table_madt *madt = NULL;

if (!phys_addr || !size || !cpu_has_apic)
if (!phys_addr || !size)
return -EINVAL;

madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size);
Expand Down Expand Up @@ -1151,6 +1151,9 @@ int __init acpi_boot_init(void)

acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);

if (!cpu_has_apic)
return -ENODEV;

/*
* set sci_int and PM timer address
*/
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/i386/kernel/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,10 +757,6 @@ static int __init apic_set_verbosity(char *str)
apic_verbosity = APIC_DEBUG;
else if (strcmp("verbose", str) == 0)
apic_verbosity = APIC_VERBOSE;
else
printk(KERN_WARNING "APIC Verbosity level %s not recognised"
" use apic=verbose or apic=debug\n", str);

return 1;
}

Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/i386/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,10 @@ efi_memory_present_wrapper(unsigned long start, unsigned long end, void *arg)
* not-overlapping, which is the case
*/
int __init
e820_all_mapped(unsigned long start, unsigned long end, unsigned type)
e820_all_mapped(unsigned long s, unsigned long e, unsigned type)
{
u64 start = s;
u64 end = e;
int i;
for (i = 0; i < e820.nr_map; i++) {
struct e820entry *ei = &e820.map[i];
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/i386/kernel/timers/timer_tsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
{
struct cpufreq_freqs *freq = data;

if (val != CPUFREQ_RESUMECHANGE)
if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
write_seqlock_irq(&xtime_lock);
if (!ref_freq) {
if (!freq->old){
Expand Down Expand Up @@ -312,7 +312,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
}

end:
if (val != CPUFREQ_RESUMECHANGE)
if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
write_sequnlock_irq(&xtime_lock);

return 0;
Expand Down
18 changes: 18 additions & 0 deletions trunk/arch/powerpc/kernel/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,31 @@ static void register_nodes(void)
}
}
}

int sysfs_add_device_to_node(struct sys_device *dev, int nid)
{
struct node *node = &node_devices[nid];
return sysfs_create_link(&node->sysdev.kobj, &dev->kobj,
kobject_name(&dev->kobj));
}

void sysfs_remove_device_from_node(struct sys_device *dev, int nid)
{
struct node *node = &node_devices[nid];
sysfs_remove_link(&node->sysdev.kobj, kobject_name(&dev->kobj));
}

#else
static void register_nodes(void)
{
return;
}

#endif

EXPORT_SYMBOL_GPL(sysfs_add_device_to_node);
EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node);

/* Only valid if CPU is present. */
static ssize_t show_physical_id(struct sys_device *dev, char *buf)
{
Expand Down
32 changes: 27 additions & 5 deletions trunk/arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static int *of_get_associativity(struct device_node *dev)
/* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa
* info is found.
*/
static int of_node_to_nid(struct device_node *device)
static int of_node_to_nid_single(struct device_node *device)
{
int nid = -1;
unsigned int *tmp;
Expand All @@ -216,6 +216,28 @@ static int of_node_to_nid(struct device_node *device)
return nid;
}

/* Walk the device tree upwards, looking for an associativity id */
int of_node_to_nid(struct device_node *device)
{
struct device_node *tmp;
int nid = -1;

of_node_get(device);
while (device) {
nid = of_node_to_nid_single(device);
if (nid != -1)
break;

tmp = device;
device = of_get_parent(tmp);
of_node_put(tmp);
}
of_node_put(device);

return nid;
}
EXPORT_SYMBOL_GPL(of_node_to_nid);

/*
* In theory, the "ibm,associativity" property may contain multiple
* associativity lists because a resource may be multiply connected
Expand Down Expand Up @@ -300,7 +322,7 @@ static int __cpuinit numa_setup_cpu(unsigned long lcpu)
goto out;
}

nid = of_node_to_nid(cpu);
nid = of_node_to_nid_single(cpu);

if (nid < 0 || !node_online(nid))
nid = any_online_node(NODE_MASK_ALL);
Expand Down Expand Up @@ -393,7 +415,7 @@ static int __init parse_numa_properties(void)

cpu = find_cpu_node(i);
BUG_ON(!cpu);
nid = of_node_to_nid(cpu);
nid = of_node_to_nid_single(cpu);
of_node_put(cpu);

/*
Expand Down Expand Up @@ -437,7 +459,7 @@ static int __init parse_numa_properties(void)
* have associativity properties. If none, then
* everything goes to default_nid.
*/
nid = of_node_to_nid(memory);
nid = of_node_to_nid_single(memory);
if (nid < 0)
nid = default_nid;
node_set_online(nid);
Expand Down Expand Up @@ -776,7 +798,7 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
ha_new_range:
start = read_n_cells(n_mem_addr_cells, &memcell_buf);
size = read_n_cells(n_mem_size_cells, &memcell_buf);
nid = of_node_to_nid(memory);
nid = of_node_to_nid_single(memory);

/* Domains not present at boot default to 0 */
if (nid < 0 || !node_online(nid))
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/platforms/cell/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ config SPU_FS

config SPUFS_MMAP
bool
depends on SPU_FS && SPARSEMEM && !PPC_64K_PAGES
depends on SPU_FS && SPARSEMEM
select MEMORY_HOTPLUG
default y

endmenu
78 changes: 3 additions & 75 deletions trunk/arch/powerpc/platforms/cell/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <linux/console.h>
#include <linux/mutex.h>
#include <linux/memory_hotplug.h>

#include <asm/mmu.h>
#include <asm/processor.h>
Expand All @@ -46,6 +48,7 @@
#include <asm/cputable.h>
#include <asm/ppc-pci.h>
#include <asm/irq.h>
#include <asm/spu.h>

#include "interrupt.h"
#include "iommu.h"
Expand All @@ -69,77 +72,6 @@ static void cell_show_cpuinfo(struct seq_file *m)
of_node_put(root);
}

#ifdef CONFIG_SPARSEMEM
static int __init find_spu_node_id(struct device_node *spe)
{
unsigned int *id;
#ifdef CONFIG_NUMA
struct device_node *cpu;
cpu = spe->parent->parent;
id = (unsigned int *)get_property(cpu, "node-id", NULL);
#else
id = NULL;
#endif
return id ? *id : 0;
}

static void __init cell_spuprop_present(struct device_node *spe,
const char *prop, int early)
{
struct address_prop {
unsigned long address;
unsigned int len;
} __attribute__((packed)) *p;
int proplen;

unsigned long start_pfn, end_pfn, pfn;
int node_id;

p = (void*)get_property(spe, prop, &proplen);
WARN_ON(proplen != sizeof (*p));

node_id = find_spu_node_id(spe);

start_pfn = p->address >> PAGE_SHIFT;
end_pfn = (p->address + p->len + PAGE_SIZE - 1) >> PAGE_SHIFT;

/* We need to call memory_present *before* the call to sparse_init,
but we can initialize the page structs only *after* that call.
Thus, we're being called twice. */
if (early)
memory_present(node_id, start_pfn, end_pfn);
else {
/* As the pages backing SPU LS and I/O are outside the range
of regular memory, their page structs were not initialized
by free_area_init. Do it here instead. */
for (pfn = start_pfn; pfn < end_pfn; pfn++) {
struct page *page = pfn_to_page(pfn);
set_page_links(page, ZONE_DMA, node_id, pfn);
init_page_count(page);
reset_page_mapcount(page);
SetPageReserved(page);
INIT_LIST_HEAD(&page->lru);
}
}
}

static void __init cell_spumem_init(int early)
{
struct device_node *node;
for (node = of_find_node_by_type(NULL, "spe");
node; node = of_find_node_by_type(node, "spe")) {
cell_spuprop_present(node, "local-store", early);
cell_spuprop_present(node, "problem", early);
cell_spuprop_present(node, "priv1", early);
cell_spuprop_present(node, "priv2", early);
}
}
#else
static void __init cell_spumem_init(int early)
{
}
#endif

static void cell_progress(char *s, unsigned short hex)
{
printk("*** %04x : %s\n", hex, s ? s : "");
Expand Down Expand Up @@ -172,8 +104,6 @@ static void __init cell_setup_arch(void)
#endif

mmio_nvram_init();

cell_spumem_init(0);
}

/*
Expand All @@ -189,8 +119,6 @@ static void __init cell_init_early(void)

ppc64_interrupt_controller = IC_CELL_PIC;

cell_spumem_init(1);

DBG(" <- cell_init_early()\n");
}

Expand Down
Loading

0 comments on commit deeebe7

Please sign in to comment.