Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: Fix sun4u execute bit check in TSB I-TLB load.
  sparc: Fix incorrect comparison in of_bus_ambapp_match()
  sparc64: Sync of_create_pci_dev() with drivers/pci/probe.c changes.
  sparc64: Tighten checks in kstack_valid().
  • Loading branch information
Linus Torvalds committed Feb 20, 2010
2 parents 65d76fc + 1f47464 commit 83bdd24
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions arch/sparc/kernel/kstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ static inline bool kstack_valid(struct thread_info *tp, unsigned long sp)
{
unsigned long base = (unsigned long) tp;

/* Stack pointer must be 16-byte aligned. */
if (sp & (16UL - 1))
return false;

if (sp >= (base + sizeof(struct thread_info)) &&
sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
return true;
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/of_device_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static unsigned long of_bus_sbus_get_flags(const u32 *addr, unsigned long flags)

static int of_bus_ambapp_match(struct device_node *np)
{
return !strcmp(np->name, "ambapp");
return !strcmp(np->type, "ambapp");
}

static void of_bus_ambapp_count_cells(struct device_node *child,
Expand Down
7 changes: 7 additions & 0 deletions arch/sparc/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
struct pci_bus *bus, int devfn)
{
struct dev_archdata *sd;
struct pci_slot *slot;
struct of_device *op;
struct pci_dev *dev;
const char *type;
Expand Down Expand Up @@ -286,6 +287,11 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
dev->dev.bus = &pci_bus_type;
dev->devfn = devfn;
dev->multifunction = 0; /* maybe a lie? */
set_pcie_port_type(dev);

list_for_each_entry(slot, &dev->bus->slots, list)
if (PCI_SLOT(dev->devfn) == slot->number)
dev->slot = slot;

dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff);
dev->device = of_getintprop_default(node, "device-id", 0xffff);
Expand Down Expand Up @@ -322,6 +328,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,

dev->current_state = 4; /* unknown power state */
dev->error_state = pci_channel_io_normal;
dev->dma_mask = 0xffffffff;

if (!strcmp(node->name, "pci")) {
/* a PCI-PCI bridge */
Expand Down
6 changes: 4 additions & 2 deletions arch/sparc/kernel/tsb.S
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,12 @@ tsb_dtlb_load:

tsb_itlb_load:
/* Executable bit must be set. */
661: andcc %g5, _PAGE_EXEC_4U, %g0
.section .sun4v_1insn_patch, "ax"
661: sethi %hi(_PAGE_EXEC_4U), %g4
andcc %g5, %g4, %g0
.section .sun4v_2insn_patch, "ax"
.word 661b
andcc %g5, _PAGE_EXEC_4V, %g0
nop
.previous

be,pn %xcc, tsb_do_fault
Expand Down

0 comments on commit 83bdd24

Please sign in to comment.