From cfa0652c4eb4ca37f88fcdd7d871cf98d9d98c0e Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 7 May 2007 21:51:41 -0700 Subject: [SPARC64] PCI: Use common routine to fetch PBM properties. Namely bus-range and ino-bitmap. This allows us also to eliminate pci_controller_info's pci_{first,last}_busno fields as only the pbm ones are used now. Signed-off-by: David S. Miller --- include/asm-sparc64/pbm.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index c008cecca149..43b7270ec02e 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h @@ -145,8 +145,6 @@ struct pci_controller_info { /* Now things for the actual PCI bus probes. */ struct pci_ops *pci_ops; - unsigned int pci_first_busno; - unsigned int pci_last_busno; }; #endif /* !(__SPARC64_PBM_H) */ -- cgit v1.2.3 From 5a4a3e592d0d66653297049373caa7ac5b4febe0 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 7 May 2007 21:54:28 -0700 Subject: [SPARC64] PCI: Kill PROM_PCIRNG_MAX and PROM_PCIIMAP_MAX. They are totally unused. Signed-off-by: David S. Miller --- include/asm-sparc64/pbm.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index 43b7270ec02e..c8868babc4fe 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h @@ -36,12 +36,6 @@ extern void pci_iommu_table_init(struct iommu *iommu, int tsbsize, u32 dma_offse #define PCI_STC_FLUSHFLAG_SET(STC) \ (*((STC)->strbuf_flushflag) != 0UL) -/* There can be quite a few ranges and interrupt maps on a PCI - * segment. Thus... - */ -#define PROM_PCIRNG_MAX 64 -#define PROM_PCIIMAP_MAX 64 - struct pci_controller_info; struct pci_pbm_info { -- cgit v1.2.3 From 34768bc8329194b14e42ee408a84edfa40059046 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 7 May 2007 23:06:27 -0700 Subject: [SPARC64] PCI: Use root list of pbm's instead of pci_controller_info's The idea is to move more and more things into the pbm, with the eventual goal of eliminating the pci_controller_info entirely as there really isn't any need for it. This stage of the transformations requires some reworking of the PCI error interrupt handling. It might be tricky to get rid of the pci_controller_info parenting for a few reasons: 1) When we get an uncorrectable or correctable error we want to interrogate the IOMMU and streaming cache of both PBMs for error status. These errors come from the UPA front-end which is shared between the two PBM PCI bus segments. Historically speaking this is why I choose the datastructure hierarchy of pci_controller_info-->pci_pbm_info 2) The probing does a portid/devhandle match to look for the 'other' pbm, but this is entirely an artifact and can be eliminated trivially. What we could do to solve #1 is to have a "buddy" pointer from one pbm to another. Signed-off-by: David S. Miller --- include/asm-sparc64/pbm.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index c8868babc4fe..cc0e2677773f 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h @@ -39,6 +39,8 @@ extern void pci_iommu_table_init(struct iommu *iommu, int tsbsize, u32 dma_offse struct pci_controller_info; struct pci_pbm_info { + struct pci_pbm_info *next; + /* PCI controller we sit under. */ struct pci_controller_info *parent; @@ -113,12 +115,10 @@ struct pci_pbm_info { unsigned int pci_first_busno; unsigned int pci_last_busno; struct pci_bus *pci_bus; + void (*scan_bus)(struct pci_pbm_info *); }; struct pci_controller_info { - /* List of all PCI controllers. */ - struct pci_controller_info *next; - /* Each controller gets a unique index, used mostly for * error logging purposes. */ @@ -129,8 +129,6 @@ struct pci_controller_info { struct pci_pbm_info pbm_B; /* Operations which are controller specific. */ - void (*scan_bus)(struct pci_controller_info *); - #ifdef CONFIG_PCI_MSI int (*setup_msi_irq)(unsigned int *virt_irq_p, struct pci_dev *pdev, struct msi_desc *entry); -- cgit v1.2.3 From f1cd8de2c951e206b57fd76aff279cf13ea25815 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 7 May 2007 23:24:05 -0700 Subject: [SPARC64]: Move pci_ops into pci_pbm_info. Signed-off-by: David S. Miller --- include/asm-sparc64/pbm.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index cc0e2677773f..1f4de53dcd03 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h @@ -116,6 +116,7 @@ struct pci_pbm_info { unsigned int pci_last_busno; struct pci_bus *pci_bus; void (*scan_bus)(struct pci_pbm_info *); + struct pci_ops *pci_ops; }; struct pci_controller_info { @@ -134,9 +135,6 @@ struct pci_controller_info { struct msi_desc *entry); void (*teardown_msi_irq)(unsigned int virt_irq, struct pci_dev *pdev); #endif - - /* Now things for the actual PCI bus probes. */ - struct pci_ops *pci_ops; }; #endif /* !(__SPARC64_PBM_H) */ -- cgit v1.2.3 From e9870c4c0aef94580e28be11a1c6246dcabbe528 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 7 May 2007 23:28:50 -0700 Subject: [SPARC64]: Move {setup,teardown}_msi_irq into pci_pbm_info. Signed-off-by: David S. Miller --- include/asm-sparc64/pbm.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index 1f4de53dcd03..1d5dcfe133a2 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h @@ -103,6 +103,9 @@ struct pci_pbm_info { u32 msi64_len; void *msi_queues; unsigned long *msi_bitmap; + int (*setup_msi_irq)(unsigned int *virt_irq_p, struct pci_dev *pdev, + struct msi_desc *entry); + void (*teardown_msi_irq)(unsigned int virt_irq, struct pci_dev *pdev); #endif /* !(CONFIG_PCI_MSI) */ /* This PBM's streaming buffer. */ @@ -128,13 +131,6 @@ struct pci_controller_info { /* The PCI bus modules controlled by us. */ struct pci_pbm_info pbm_A; struct pci_pbm_info pbm_B; - - /* Operations which are controller specific. */ -#ifdef CONFIG_PCI_MSI - int (*setup_msi_irq)(unsigned int *virt_irq_p, struct pci_dev *pdev, - struct msi_desc *entry); - void (*teardown_msi_irq)(unsigned int virt_irq, struct pci_dev *pdev); -#endif }; #endif /* !(__SPARC64_PBM_H) */ -- cgit v1.2.3 From 6c108f1299754877bb5f73ccac5621eb603b97eb Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 7 May 2007 23:49:01 -0700 Subject: [SPARC64]: Move index info pci_pbm_info. Signed-off-by: David S. Miller --- include/asm-sparc64/pbm.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index 1d5dcfe133a2..d99e0468c7e4 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h @@ -40,6 +40,7 @@ struct pci_controller_info; struct pci_pbm_info { struct pci_pbm_info *next; + int index; /* PCI controller we sit under. */ struct pci_controller_info *parent; @@ -123,11 +124,6 @@ struct pci_pbm_info { }; struct pci_controller_info { - /* Each controller gets a unique index, used mostly for - * error logging purposes. - */ - int index; - /* The PCI bus modules controlled by us. */ struct pci_pbm_info pbm_A; struct pci_pbm_info pbm_B; -- cgit v1.2.3 From c57c2ffb153a99769a15a2ff1729371ddee5601a Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 8 May 2007 00:43:56 -0700 Subject: [SPARC64]: Kill asm-sparc64/pbm.h Everything it contains can be hidden in pci_impl.h Signed-off-by: David S. Miller --- include/asm-sparc64/pbm.h | 132 ---------------------------------------------- 1 file changed, 132 deletions(-) delete mode 100644 include/asm-sparc64/pbm.h (limited to 'include') diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h deleted file mode 100644 index d99e0468c7e4..000000000000 --- a/include/asm-sparc64/pbm.h +++ /dev/null @@ -1,132 +0,0 @@ -/* pbm.h: UltraSparc PCI controller software state. - * - * Copyright (C) 1997, 1998, 1999, 2007 David S. Miller (davem@davemloft.net) - */ - -#ifndef __SPARC64_PBM_H -#define __SPARC64_PBM_H - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -/* The abstraction used here is that there are PCI controllers, - * each with one (Sabre) or two (PSYCHO/SCHIZO) PCI bus modules - * underneath. Each PCI bus module uses an IOMMU (shared by both - * PBMs of a controller, or per-PBM), and if a streaming buffer - * is present, each PCI bus module has it's own. (ie. the IOMMU - * might be shared between PBMs, the STC is never shared) - * Furthermore, each PCI bus module controls it's own autonomous - * PCI bus. - */ - -extern void pci_iommu_table_init(struct iommu *iommu, int tsbsize, u32 dma_offset, u32 dma_addr_mask); - -#define PCI_STC_FLUSHFLAG_INIT(STC) \ - (*((STC)->strbuf_flushflag) = 0UL) -#define PCI_STC_FLUSHFLAG_SET(STC) \ - (*((STC)->strbuf_flushflag) != 0UL) - -struct pci_controller_info; - -struct pci_pbm_info { - struct pci_pbm_info *next; - int index; - - /* PCI controller we sit under. */ - struct pci_controller_info *parent; - - /* Physical address base of controller registers. */ - unsigned long controller_regs; - - /* Physical address base of PBM registers. */ - unsigned long pbm_regs; - - /* Physical address of DMA sync register, if any. */ - unsigned long sync_reg; - - /* Opaque 32-bit system bus Port ID. */ - u32 portid; - - /* Opaque 32-bit handle used for hypervisor calls. */ - u32 devhandle; - - /* Chipset version information. */ - int chip_type; -#define PBM_CHIP_TYPE_SABRE 1 -#define PBM_CHIP_TYPE_PSYCHO 2 -#define PBM_CHIP_TYPE_SCHIZO 3 -#define PBM_CHIP_TYPE_SCHIZO_PLUS 4 -#define PBM_CHIP_TYPE_TOMATILLO 5 - int chip_version; - int chip_revision; - - /* Name used for top-level resources. */ - char *name; - - /* OBP specific information. */ - struct device_node *prom_node; - u64 ino_bitmap; - - /* PBM I/O and Memory space resources. */ - struct resource io_space; - struct resource mem_space; - - /* Base of PCI Config space, can be per-PBM or shared. */ - unsigned long config_space; - - /* State of 66MHz capabilities on this PBM. */ - int is_66mhz_capable; - int all_devs_66mhz; - -#ifdef CONFIG_PCI_MSI - /* MSI info. */ - u32 msiq_num; - u32 msiq_ent_count; - u32 msiq_first; - u32 msiq_first_devino; - u32 msi_num; - u32 msi_first; - u32 msi_data_mask; - u32 msix_data_width; - u64 msi32_start; - u64 msi64_start; - u32 msi32_len; - u32 msi64_len; - void *msi_queues; - unsigned long *msi_bitmap; - int (*setup_msi_irq)(unsigned int *virt_irq_p, struct pci_dev *pdev, - struct msi_desc *entry); - void (*teardown_msi_irq)(unsigned int virt_irq, struct pci_dev *pdev); -#endif /* !(CONFIG_PCI_MSI) */ - - /* This PBM's streaming buffer. */ - struct strbuf stc; - - /* IOMMU state, potentially shared by both PBM segments. */ - struct iommu *iommu; - - /* Now things for the actual PCI bus probes. */ - unsigned int pci_first_busno; - unsigned int pci_last_busno; - struct pci_bus *pci_bus; - void (*scan_bus)(struct pci_pbm_info *); - struct pci_ops *pci_ops; -}; - -struct pci_controller_info { - /* The PCI bus modules controlled by us. */ - struct pci_pbm_info pbm_A; - struct pci_pbm_info pbm_B; -}; - -#endif /* !(__SPARC64_PBM_H) */ -- cgit v1.2.3 From 6c1142602c9c8faedbc1321892a169652a173fc7 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 8 May 2007 17:50:14 -0700 Subject: [SPARC]: Wire up utimensat syscall. Signed-off-by: David S. Miller --- include/asm-sparc/unistd.h | 3 ++- include/asm-sparc64/unistd.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index e43ed1d63a9d..da9bdc5e5526 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h @@ -326,8 +326,9 @@ #define __NR_move_pages 307 #define __NR_getcpu 308 #define __NR_epoll_pwait 309 +#define __NR_utimensat 310 -#define NR_SYSCALLS 310 +#define NR_SYSCALLS 311 #ifdef __KERNEL__ #define __ARCH_WANT_IPC_PARSE_VERSION diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index e2dcb87e0c62..fcd627594f4c 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h @@ -328,8 +328,9 @@ #define __NR_move_pages 307 #define __NR_getcpu 308 #define __NR_epoll_pwait 309 +#define __NR_utimensat 310 -#define NR_SYSCALLS 310 +#define NR_SYSCALLS 311 #ifdef __KERNEL__ /* sysconf options, for SunOS compatibility */ -- cgit v1.2.3 From 127cda1e8cc282de1ca7a9dcc3866841977b9fcc Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 8 May 2007 18:25:14 -0700 Subject: [SPARC64]: Optimize fault kprobe handling just like powerpc. And eliminate DIE_GPF while we're at it. Signed-off-by: David S. Miller --- include/asm-sparc64/kdebug.h | 16 +++++++++++++--- include/asm-sparc64/kprobes.h | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h index f8032e73f384..627e3396a5f0 100644 --- a/include/asm-sparc64/kdebug.h +++ b/include/asm-sparc64/kdebug.h @@ -7,8 +7,19 @@ struct pt_regs; -extern int register_page_fault_notifier(struct notifier_block *); -extern int unregister_page_fault_notifier(struct notifier_block *); +/* + * These are only here because kprobes.c wants them to implement a + * blatant layering violation. Will hopefully go away soon once all + * architectures are updated. + */ +static inline int register_page_fault_notifier(struct notifier_block *nb) +{ + return 0; +} +static inline int unregister_page_fault_notifier(struct notifier_block *nb) +{ + return 0; +} extern void bad_trap(struct pt_regs *, long); @@ -20,7 +31,6 @@ enum die_val { DIE_DIE, DIE_TRAP, DIE_TRAP_TL1, - DIE_GPF, DIE_CALL, DIE_PAGE_FAULT, }; diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h index becc38fa06c5..a331b7b0dff2 100644 --- a/include/asm-sparc64/kprobes.h +++ b/include/asm-sparc64/kprobes.h @@ -43,4 +43,5 @@ struct kprobe_ctlblk { extern int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *data); +extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); #endif /* _SPARC64_KPROBES_H */ -- cgit v1.2.3