···3939#include <asm/parisc-device.h>40404141/* See comments in include/asm-parisc/pci.h */4242-struct hppa_dma_ops *hppa_dma_ops;4242+struct hppa_dma_ops *hppa_dma_ops __read_mostly;4343EXPORT_SYMBOL(hppa_dma_ops);44444545static struct device root = {···515515 (iodc_data[5] << 8) | iodc_data[6];516516 dev->hpa.name = parisc_pathname(dev);517517 dev->hpa.start = hpa;518518- if (hpa == 0xf4000000 || hpa == 0xf6000000 ||519519- hpa == 0xf8000000 || hpa == 0xfa000000) {518518+ /* This is awkward. The STI spec says that gfx devices may occupy519519+ * 32MB or 64MB. Unfortunately, we don't know how to tell whether520520+ * it's the former or the latter. Assumptions either way can hurt us.521521+ */522522+ if (hpa == 0xf4000000 || hpa == 0xf8000000) {523523+ dev->hpa.end = hpa + 0x03ffffff;524524+ } else if (hpa == 0xf6000000 || hpa == 0xfa000000) {520525 dev->hpa.end = hpa + 0x01ffffff;521526 } else {522527 dev->hpa.end = hpa + 0xfff;···839834840835 if (dev->num_addrs) {841836 int k;842842- printk(", additional addresses: ");837837+ printk(", additional addresses: ");843838 for (k = 0; k < dev->num_addrs; k++)844839 printk("0x%lx ", dev->addr[k]);845840 }
+1-1
arch/parisc/kernel/firmware.c
···80808181/* Firmware needs to be initially set to narrow to determine the 8282 * actual firmware width. */8383-int parisc_narrow_firmware = 1;8383+int parisc_narrow_firmware __read_mostly = 1;8484#endif85858686/* On most currently-supported platforms, IODC I/O calls are 32-bit calls
···3838*/3939#undef DEBUG_PAT40404141-int pdc_type = PDC_TYPE_ILLEGAL;4141+int pdc_type __read_mostly = PDC_TYPE_ILLEGAL;42424343void __init setup_pdc(void)4444{···120120 * pdc info is bad in this case).121121 */122122123123- if ( ((start & (PAGE_SIZE - 1)) != 0)124124- || ((pages4k & ((1UL << PDC_PAGE_ADJ_SHIFT) - 1)) != 0) ) {123123+ if (unlikely( ((start & (PAGE_SIZE - 1)) != 0)124124+ || ((pages4k & ((1UL << PDC_PAGE_ADJ_SHIFT) - 1)) != 0) )) {125125126126 panic("Memory range doesn't align with page size!\n");127127 }
+3-3
arch/parisc/kernel/pci-dma.c
···3333#include <asm/uaccess.h>3434#include <asm/tlbflush.h> /* for purge_tlb_*() macros */35353636-static struct proc_dir_entry * proc_gsc_root = NULL;3636+static struct proc_dir_entry * proc_gsc_root __read_mostly = NULL;3737static int pcxl_proc_info(char *buffer, char **start, off_t offset, int length);3838-static unsigned long pcxl_used_bytes = 0;3939-static unsigned long pcxl_used_pages = 0;3838+static unsigned long pcxl_used_bytes __read_mostly = 0;3939+static unsigned long pcxl_used_pages __read_mostly = 0;40404141extern unsigned long pcxl_dma_start; /* Start of pcxl dma mapping area */4242static spinlock_t pcxl_res_lock;
+7-6
arch/parisc/kernel/pdc_chassis.c
···3030#include <linux/kernel.h>3131#include <linux/reboot.h>3232#include <linux/notifier.h>3333+#include <linux/cache.h>33343435#include <asm/pdc_chassis.h>3536#include <asm/processor.h>···393840394140#ifdef CONFIG_PDC_CHASSIS4242-static int pdc_chassis_old = 0; 4343-static unsigned int pdc_chassis_enabled = 1;4141+static int pdc_chassis_old __read_mostly = 0; 4242+static unsigned int pdc_chassis_enabled __read_mostly = 1;444345444645/**···133132{134133#ifdef CONFIG_PDC_CHASSIS135134 int handle = 0;136136- if (pdc_chassis_enabled) {135135+ if (likely(pdc_chassis_enabled)) {137136 DPRINTK(KERN_DEBUG "%s: parisc_pdc_chassis_init()\n", __FILE__);138137139138 /* Let see if we have something to handle... */···143142 printk(KERN_INFO "Enabling PDC_PAT chassis codes support.\n");144143 handle = 1;145144 }146146- else if (pdc_chassis_old) {145145+ else if (unlikely(pdc_chassis_old)) {147146 printk(KERN_INFO "Enabling old style chassis LED panel support.\n");148147 handle = 1;149148 }···179178 /* Maybe we should do that in an other way ? */180179 int retval = 0;181180#ifdef CONFIG_PDC_CHASSIS182182- if (pdc_chassis_enabled) {181181+ if (likely(pdc_chassis_enabled)) {183182184183 DPRINTK(KERN_DEBUG "%s: pdc_chassis_send_status(%d)\n", __FILE__, message);185184···215214 }216215 } else retval = -1;217216#else218218- if (pdc_chassis_old) {217217+ if (unlikely(pdc_chassis_old)) {219218 switch (message) {220219 case PDC_CHASSIS_DIRECT_BSTART:221220 case PDC_CHASSIS_DIRECT_BCOMPLETE:
+3-3
arch/parisc/kernel/perf.c
···6666 uint8_t write_control;6767};68686969-static int perf_processor_interface = UNKNOWN_INTF;7070-static int perf_enabled = 0;6969+static int perf_processor_interface __read_mostly = UNKNOWN_INTF;7070+static int perf_enabled __read_mostly = 0;7171static spinlock_t perf_lock;7272-struct parisc_device *cpu_device = NULL;7272+struct parisc_device *cpu_device __read_mostly = NULL;73737474/* RDRs to write for PCX-W */7575static int perf_rdrs_W[] =
+1-1
arch/parisc/kernel/process.c
···5454#include <asm/uaccess.h>5555#include <asm/unwind.h>56565757-static int hlt_counter;5757+static int hlt_counter __read_mostly;58585959/*6060 * Power off function, if any
···3939#include <asm/atomic.h>4040#include <asm/current.h>4141#include <asm/delay.h>4242-#include <asm/pgalloc.h> /* for flush_tlb_all() proto/macro */4242+#include <asm/tlbflush.h>43434444#include <asm/io.h>4545#include <asm/irq.h> /* for CPU_IRQ_REGION and friends */···58585959volatile struct task_struct *smp_init_current_idle_task;60606161-static volatile int cpu_now_booting = 0; /* track which CPU is booting */6161+static volatile int cpu_now_booting __read_mostly = 0; /* track which CPU is booting */62626363-static int parisc_max_cpus = 1;6363+static int parisc_max_cpus __read_mostly = 1;64646565/* online cpus are ones that we've managed to bring up completely6666 * possible cpus are all valid cpu ···7171 * empty in the beginning.7272 */73737474-cpumask_t cpu_online_map = CPU_MASK_NONE; /* Bitmap of online CPUs */7575-cpumask_t cpu_possible_map = CPU_MASK_ALL; /* Bitmap of Present CPUs */7474+cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE; /* Bitmap of online CPUs */7575+cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; /* Bitmap of Present CPUs */76767777EXPORT_SYMBOL(cpu_online_map);7878EXPORT_SYMBOL(cpu_possible_map);···406406 * as we want to ensure all TLB's flushed before proceeding.407407 */408408409409-extern void flush_tlb_all_local(void);410410-411409void412410smp_flush_tlb_all(void)413411{414414- on_each_cpu((void (*)(void *))flush_tlb_all_local, NULL, 1, 1);412412+ on_each_cpu(flush_tlb_all_local, NULL, 1, 1);415413}416414417415···485487#endif486488487489 flush_cache_all_local(); /* start with known state */488488- flush_tlb_all_local();490490+ flush_tlb_all_local(NULL);489491490492 local_irq_enable(); /* Interrupts have been off until now */491493
+2-2
arch/parisc/kernel/time.c
···3636/* xtime and wall_jiffies keep wall-clock time */3737extern unsigned long wall_jiffies;38383939-static long clocktick; /* timer cycles per tick */4040-static long halftick;3939+static long clocktick __read_mostly; /* timer cycles per tick */4040+static long halftick __read_mostly;41414242#ifdef CONFIG_SMP4343extern void smp_do_timer(struct pt_regs *regs);
+2-1
arch/parisc/kernel/topology.c
···2020#include <linux/init.h>2121#include <linux/smp.h>2222#include <linux/cpu.h>2323+#include <linux/cache.h>23242424-static struct cpu cpu_devices[NR_CPUS];2525+static struct cpu cpu_devices[NR_CPUS] __read_mostly;25262627static int __init topology_init(void)2728{
···3535 * we can call unwind_init as early in the bootup process as 3636 * possible (before the slab allocator is initialized)3737 */3838-static struct unwind_table kernel_unwind_table;3838+static struct unwind_table kernel_unwind_table __read_mostly;3939static LIST_HEAD(unwind_tables);40404141static inline const struct unwind_table_entry *
+6-9
arch/parisc/kernel/vmlinux.lds.S
···6868 RODATA69697070 /* writeable */7171- . = ALIGN(4096); /* Make sure this is paged aligned so7171+ . = ALIGN(4096); /* Make sure this is page aligned so7272 that we can properly leave these7373 as writable */7474 data_start = .;···104104 /* PA-RISC locks requires 16-byte alignment */105105 . = ALIGN(16);106106 .data.lock_aligned : { *(.data.lock_aligned) }107107+108108+ /* rarely changed data like cpu maps */109109+ . = ALIGN(16);110110+ .data.read_mostly : { *(.data.read_mostly) }107111108112 _edata = .; /* End of data section */109113···198194#endif199195 }200196201201- /* Stabs debugging sections. */202202- .stab 0 : { *(.stab) }203203- .stabstr 0 : { *(.stabstr) }204204- .stab.excl 0 : { *(.stab.excl) }205205- .stab.exclstr 0 : { *(.stab.exclstr) }206206- .stab.index 0 : { *(.stab.index) }207207- .stab.indexstr 0 : { *(.stab.indexstr) }208208- .comment 0 : { *(.comment) }197197+ STABS_DEBUG209198 .note 0 : { *(.note) } 210199211200}
+18-11
arch/parisc/mm/init.c
···3636extern char __init_begin, __init_end;37373838#ifdef CONFIG_DISCONTIGMEM3939-struct node_map_data node_data[MAX_NUMNODES];4040-bootmem_data_t bmem_data[MAX_NUMNODES];4141-unsigned char pfnnid_map[PFNNID_MAP_MAX];3939+struct node_map_data node_data[MAX_NUMNODES] __read_mostly;4040+bootmem_data_t bmem_data[MAX_NUMNODES] __read_mostly;4141+unsigned char pfnnid_map[PFNNID_MAP_MAX] __read_mostly;4242#endif43434444static struct resource data_resource = {···5858 .flags = IORESOURCE_BUSY | IORESOURCE_MEM,5959};60606161-static struct resource sysram_resources[MAX_PHYSMEM_RANGES];6161+static struct resource sysram_resources[MAX_PHYSMEM_RANGES] __read_mostly;62626363/* The following array is initialized from the firmware specific6464 * information retrieved in kernel/inventory.c.6565 */66666767-physmem_range_t pmem_ranges[MAX_PHYSMEM_RANGES];6868-int npmem_ranges;6767+physmem_range_t pmem_ranges[MAX_PHYSMEM_RANGES] __read_mostly;6868+int npmem_ranges __read_mostly;69697070#ifdef __LP64__7171#define MAX_MEM (~0UL)···7373#define MAX_MEM (3584U*1024U*1024U)7474#endif /* !__LP64__ */75757676-static unsigned long mem_limit = MAX_MEM;7676+static unsigned long mem_limit __read_mostly = MAX_MEM;77777878static void __init mem_limit_func(void)7979{···300300 max_pfn = start_pfn + npages;301301 }302302303303+ /* IOMMU is always used to access "high mem" on those boxes304304+ * that can support enough mem that a PCI device couldn't305305+ * directly DMA to any physical addresses.306306+ * ISA DMA support will need to revisit this.307307+ */308308+ max_low_pfn = max_pfn;309309+303310 if ((bootmap_pfn - bootmap_start_pfn) != bootmap_pages) {304311 printk(KERN_WARNING "WARNING! bootmap sizing is messed up!\n");305312 BUG();···438431#define SET_MAP_OFFSET(x) ((void *)(((unsigned long)(x) + VM_MAP_OFFSET) \439432 & ~(VM_MAP_OFFSET-1)))440433441441-void *vmalloc_start;434434+void *vmalloc_start __read_mostly;442435EXPORT_SYMBOL(vmalloc_start);443436444437#ifdef CONFIG_PA11445445-unsigned long pcxl_dma_start;438438+unsigned long pcxl_dma_start __read_mostly;446439#endif447440448441void __init mem_init(void)···482475 return 0;483476}484477485485-unsigned long *empty_zero_page;478478+unsigned long *empty_zero_page __read_mostly;486479487480void show_mem(void)488481{···1005998void flush_tlb_all(void)1006999{10071000 spin_lock(&sid_lock);10081008- flush_tlb_all_local();10011001+ flush_tlb_all_local(NULL);10091002 recycle_sids();10101003 spin_unlock(&sid_lock);10111004}
+63-37
arch/parisc/mm/ioremap.c
···11/*22 * arch/parisc/mm/ioremap.c33 *44- * Re-map IO memory to kernel address space so that we can access it.55- * This is needed for high PCI addresses that aren't mapped in the66- * 640k-1MB IO memory area on PC's77- *84 * (C) Copyright 1995 1996 Linus Torvalds95 * (C) Copyright 2001 Helge Deller <deller@gmx.de>66+ * (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org>107 */118129#include <linux/vmalloc.h>···1114#include <linux/module.h>1215#include <asm/io.h>1316#include <asm/pgalloc.h>1717+#include <asm/tlbflush.h>1818+#include <asm/cacheflush.h>14191515-static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,1616- unsigned long phys_addr, unsigned long flags)2020+static inline void 2121+remap_area_pte(pte_t *pte, unsigned long address, unsigned long size,2222+ unsigned long phys_addr, unsigned long flags)1723{1818- unsigned long end;2424+ unsigned long end, pfn;2525+ pgprot_t pgprot = __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY |2626+ _PAGE_ACCESSED | flags);19272028 address &= ~PMD_MASK;2929+2130 end = address + size;2231 if (end > PMD_SIZE)2332 end = PMD_SIZE;2424- if (address >= end)2525- BUG();3333+3434+ BUG_ON(address >= end);3535+3636+ pfn = phys_addr >> PAGE_SHIFT;2637 do {2727- if (!pte_none(*pte)) {2828- printk(KERN_ERR "remap_area_pte: page already exists\n");2929- BUG();3030- }3131- set_pte(pte, mk_pte_phys(phys_addr, __pgprot(_PAGE_PRESENT | _PAGE_RW | 3232- _PAGE_DIRTY | _PAGE_ACCESSED | flags)));3838+ BUG_ON(!pte_none(*pte));3939+4040+ set_pte(pte, pfn_pte(pfn, pgprot));4141+3342 address += PAGE_SIZE;3434- phys_addr += PAGE_SIZE;4343+ pfn++;3544 pte++;3645 } while (address && (address < end));3746}38473939-static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,4040- unsigned long phys_addr, unsigned long flags)4848+static inline int 4949+remap_area_pmd(pmd_t *pmd, unsigned long address, unsigned long size,5050+ unsigned long phys_addr, unsigned long flags)4151{4252 unsigned long end;43534454 address &= ~PGDIR_MASK;5555+4556 end = address + size;4657 if (end > PGDIR_SIZE)4758 end = PGDIR_SIZE;5959+6060+ BUG_ON(address >= end);6161+4862 phys_addr -= address;4949- if (address >= end)5050- BUG();5163 do {5252- pte_t * pte = pte_alloc_kernel(pmd, address);6464+ pte_t *pte = pte_alloc_kernel(pmd, address);5365 if (!pte)5466 return -ENOMEM;5555- remap_area_pte(pte, address, end - address, address + phys_addr, flags);6767+6868+ remap_area_pte(pte, address, end - address, 6969+ address + phys_addr, flags);7070+5671 address = (address + PMD_SIZE) & PMD_MASK;5772 pmd++;5873 } while (address && (address < end));7474+5975 return 0;6076}61776262-#if (USE_HPPA_IOREMAP)6363-static int remap_area_pages(unsigned long address, unsigned long phys_addr,6464- unsigned long size, unsigned long flags)7878+#if USE_HPPA_IOREMAP7979+static int 8080+remap_area_pages(unsigned long address, unsigned long phys_addr,8181+ unsigned long size, unsigned long flags)6582{6666- int error;6767- pgd_t * dir;8383+ pgd_t *dir;8484+ int error = 0;6885 unsigned long end = address + size;69868787+ BUG_ON(address >= end);8888+7089 phys_addr -= address;7171- dir = pgd_offset(&init_mm, address);9090+ dir = pgd_offset_k(address);9191+7292 flush_cache_all();7373- if (address >= end)7474- BUG();9393+7594 do {9595+ pud_t *pud;7696 pmd_t *pmd;7777- pmd = pmd_alloc(&init_mm, dir, address);9797+7898 error = -ENOMEM;9999+ pud = pud_alloc(&init_mm, dir, address);100100+ if (!pud)101101+ break;102102+103103+ pmd = pmd_alloc(&init_mm, pud, address);79104 if (!pmd)80105 break;106106+81107 if (remap_area_pmd(pmd, address, end - address,8282- phys_addr + address, flags))108108+ phys_addr + address, flags))83109 break;110110+84111 error = 0;85112 address = (address + PGDIR_SIZE) & PGDIR_MASK;86113 dir++;87114 } while (address && (address < end));115115+88116 flush_tlb_all();117117+89118 return error;90119}91120#endif /* USE_HPPA_IOREMAP */···146123147124/*148125 * Remap an arbitrary physical address space into the kernel virtual149149- * address space. Needed when the kernel wants to access high addresses150150- * directly.126126+ * address space.151127 *152128 * NOTE! We need to allow non-page-aligned mappings too: we will obviously153129 * have to convert them into an offset in a page-aligned mapping, but the···170148#endif171149172150#else173173- void * addr;174174- struct vm_struct * area;151151+ void *addr;152152+ struct vm_struct *area;175153 unsigned long offset, last_addr;176154177155 /* Don't allow wraparound or zero size */···189167 t_addr = __va(phys_addr);190168 t_end = t_addr + (size - 1);191169192192- for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++)170170+ for (page = virt_to_page(t_addr); 171171+ page <= virt_to_page(t_end); page++) {193172 if(!PageReserved(page))194173 return NULL;174174+ }195175 }196176197177 /*···209185 area = get_vm_area(size, VM_IOREMAP);210186 if (!area)211187 return NULL;188188+212189 addr = area->addr;213190 if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) {214191 vfree(addr);215192 return NULL;216193 }194194+217195 return (void __iomem *) (offset + (char *)addr);218196#endif219197}
+23-7
drivers/parisc/dino.c
···8383** bus number for each dino.8484*/85858686-#define is_card_dino(id) ((id)->hw_type == HPHW_A_DMA)8686+#define is_card_dino(id) ((id)->hw_type == HPHW_A_DMA)8787+#define is_cujo(id) ((id)->hversion == 0x682)87888889#define DINO_IAR0 0x0048990#define DINO_IODC_ADDR 0x008···125124126125#define DINO_IRQS 11 /* bits 0-10 are architected */127126#define DINO_IRR_MASK 0x5ff /* only 10 bits are implemented */127127+#define DINO_LOCAL_IRQS (DINO_IRQS+1)128128129129#define DINO_MASK_IRQ(x) (1<<(x))130130···148146 unsigned long txn_addr; /* EIR addr to generate interrupt */ 149147 u32 txn_data; /* EIR data assign to each dino */ 150148 u32 imr; /* IRQ's which are enabled */ 151151- int global_irq[12]; /* map IMR bit to global irq */149149+ int global_irq[DINO_LOCAL_IRQS]; /* map IMR bit to global irq */152150#ifdef DINO_DEBUG153151 unsigned int dino_irr0; /* save most recent IRQ line stat */154152#endif···299297static void dino_disable_irq(unsigned int irq)300298{301299 struct dino_device *dino_dev = irq_desc[irq].handler_data;302302- int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, irq);300300+ int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS);303301304302 DBG(KERN_WARNING "%s(0x%p, %d)\n", __FUNCTION__, dino_dev, irq);305303···311309static void dino_enable_irq(unsigned int irq)312310{313311 struct dino_device *dino_dev = irq_desc[irq].handler_data;314314- int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, irq);312312+ int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS);315313 u32 tmp;316314317315 DBG(KERN_WARNING "%s(0x%p, %d)\n", __FUNCTION__, dino_dev, irq);···436434437435 dino_assign_irq(dino, irq, &dev->irq);438436}437437+438438+439439+/*440440+ * Cirrus 6832 Cardbus reports wrong irq on RDI Tadpole PARISC Laptop (deller@gmx.de)441441+ * (the irqs are off-by-one, not sure yet if this is a cirrus, dino-hardware or dino-driver problem...)442442+ */443443+static void __devinit quirk_cirrus_cardbus(struct pci_dev *dev)444444+{445445+ u8 new_irq = dev->irq - 1;446446+ printk(KERN_INFO "PCI: Cirrus Cardbus IRQ fixup for %s, from %d to %d\n",447447+ pci_name(dev), dev->irq, new_irq);448448+ dev->irq = new_irq;449449+}450450+DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_6832, quirk_cirrus_cardbus );451451+439452440453static void __init441454dino_bios_init(void)···683666 printk(KERN_WARNING "Device %s has unassigned IRQ\n", pci_name(dev));684667#endif685668 } else {686686-687669 /* Adjust INT_LINE for that busses region */688670 dino_assign_irq(dino_dev, dev->irq, &dev->irq);689671 }···888872889873 /* allocate I/O Port resource region */890874 res = &dino_dev->hba.io_space;891891- if (dev->id.hversion == 0x680 || is_card_dino(&dev->id)) {875875+ if (!is_cujo(&dev->id)) {892876 res->name = "Dino I/O Port";893877 } else {894878 res->name = "Cujo I/O Port";···943927 if (is_card_dino(&dev->id)) {944928 version = "3.x (card mode)";945929 } else {946946- if(dev->id.hversion == 0x680) {930930+ if (!is_cujo(&dev->id)) {947931 if (dev->id.hversion_rev < 4) {948932 version = dino_vers[dev->id.hversion_rev];949933 }
+2-2
drivers/parisc/eisa.c
···57575858static DEFINE_SPINLOCK(eisa_irq_lock);59596060-void __iomem *eisa_eeprom_addr;6060+void __iomem *eisa_eeprom_addr __read_mostly;61616262/* We can only have one EISA adapter in the system because neither6363 * implementation can be flexed.···141141 * in the furure. 142142 */143143/* irq 13,8,2,1,0 must be edge */144144-static unsigned int eisa_irq_level; /* default to edge triggered */144144+static unsigned int eisa_irq_level __read_mostly; /* default to edge triggered */145145146146147147/* called by free irq */
···150150 * 151151 */152152153153-static unsigned long lasi_power_off_hpa;153153+static unsigned long lasi_power_off_hpa __read_mostly;154154155155static void lasi_power_off(void)156156{
+91-24
drivers/parisc/lba_pci.c
···167167168168/* non-postable I/O port space, densely packed */169169#define LBA_PORT_BASE (PCI_F_EXTEND | 0xfee00000UL)170170-static void __iomem *astro_iop_base;170170+static void __iomem *astro_iop_base __read_mostly;171171172172#define ELROY_HVERS 0x782173173#define MERCURY_HVERS 0x783···695695 }696696 }697697}698698-#else699699-#define lba_claim_dev_resources(dev)700700-#endif701698699699+700700+/*701701+ * truncate_pat_collision: Deal with overlaps or outright collisions702702+ * between PAT PDC reported ranges.703703+ *704704+ * Broken PA8800 firmware will report lmmio range that705705+ * overlaps with CPU HPA. Just truncate the lmmio range.706706+ *707707+ * BEWARE: conflicts with this lmmio range may be an708708+ * elmmio range which is pointing down another rope.709709+ *710710+ * FIXME: only deals with one collision per range...theoretically we711711+ * could have several. Supporting more than one collision will get messy.712712+ */713713+static unsigned long714714+truncate_pat_collision(struct resource *root, struct resource *new)715715+{716716+ unsigned long start = new->start;717717+ unsigned long end = new->end;718718+ struct resource *tmp = root->child;719719+720720+ if (end <= start || start < root->start || !tmp)721721+ return 0;722722+723723+ /* find first overlap */724724+ while (tmp && tmp->end < start)725725+ tmp = tmp->sibling;726726+727727+ /* no entries overlap */728728+ if (!tmp) return 0;729729+730730+ /* found one that starts behind the new one731731+ ** Don't need to do anything.732732+ */733733+ if (tmp->start >= end) return 0;734734+735735+ if (tmp->start <= start) {736736+ /* "front" of new one overlaps */737737+ new->start = tmp->end + 1;738738+739739+ if (tmp->end >= end) {740740+ /* AACCKK! totally overlaps! drop this range. */741741+ return 1;742742+ }743743+ } 744744+745745+ if (tmp->end < end ) {746746+ /* "end" of new one overlaps */747747+ new->end = tmp->start - 1;748748+ }749749+750750+ printk(KERN_WARNING "LBA: Truncating lmmio_space [%lx/%lx] "751751+ "to [%lx,%lx]\n",752752+ start, end,753753+ new->start, new->end );754754+755755+ return 0; /* truncation successful */756756+}757757+758758+#else759759+#define lba_claim_dev_resources(dev) do { } while (0)760760+#define truncate_pat_collision(r,n) (0)761761+#endif702762703763/*704764** The algorithm is generic code.···807747 lba_dump_res(&ioport_resource, 2);808748 BUG();809749 }750750+ /* advertize Host bridge resources to PCI bus */751751+ bus->resource[0] = &(ldev->hba.io_space);752752+ i = 1;810753811754 if (ldev->hba.elmmio_space.start) {812755 err = request_resource(&iomem_resource,···823760824761 /* lba_dump_res(&iomem_resource, 2); */825762 /* BUG(); */826826- }763763+ } else764764+ bus->resource[i++] = &(ldev->hba.elmmio_space);827765 }828766829829- err = request_resource(&iomem_resource, &(ldev->hba.lmmio_space));830830- if (err < 0) {831831- /* FIXME overlaps with elmmio will fail here.832832- * Need to prune (or disable) the distributed range.833833- *834834- * BEWARE: conflicts with this lmmio range may be835835- * elmmio range which is pointing down another rope.836836- */837767838838- printk("FAILED: lba_fixup_bus() request for "768768+ /* Overlaps with elmmio can (and should) fail here.769769+ * We will prune (or ignore) the distributed range.770770+ *771771+ * FIXME: SBA code should register all elmmio ranges first.772772+ * that would take care of elmmio ranges routed773773+ * to a different rope (already discovered) from774774+ * getting registered *after* LBA code has already775775+ * registered it's distributed lmmio range.776776+ */777777+ if (truncate_pat_collision(&iomem_resource,778778+ &(ldev->hba.lmmio_space))) {779779+780780+ printk(KERN_WARNING "LBA: lmmio_space [%lx/%lx] duplicate!\n",781781+ ldev->hba.lmmio_space.start,782782+ ldev->hba.lmmio_space.end);783783+ } else {784784+ err = request_resource(&iomem_resource, &(ldev->hba.lmmio_space));785785+ if (err < 0) {786786+ printk(KERN_ERR "FAILED: lba_fixup_bus() request for "839787 "lmmio_space [%lx/%lx]\n",840788 ldev->hba.lmmio_space.start,841789 ldev->hba.lmmio_space.end);842842- /* lba_dump_res(&iomem_resource, 2); */790790+ } else791791+ bus->resource[i++] = &(ldev->hba.lmmio_space);843792 }844793845794#ifdef CONFIG_64BIT···866791 lba_dump_res(&iomem_resource, 2);867792 BUG();868793 }794794+ bus->resource[i++] = &(ldev->hba.gmmio_space);869795 }870796#endif871797872872- /* advertize Host bridge resources to PCI bus */873873- bus->resource[0] = &(ldev->hba.io_space);874874- bus->resource[1] = &(ldev->hba.lmmio_space);875875- i=2;876876- if (ldev->hba.elmmio_space.start)877877- bus->resource[i++] = &(ldev->hba.elmmio_space);878878- if (ldev->hba.gmmio_space.start)879879- bus->resource[i++] = &(ldev->hba.gmmio_space);880880-881798 }882799883800 list_for_each(ln, &bus->devices) {
+9-9
drivers/parisc/led.c
···33 *44 * (c) Copyright 2000 Red Hat Software55 * (c) Copyright 2000 Helge Deller <hdeller@redhat.com>66- * (c) Copyright 2001-2004 Helge Deller <deller@gmx.de>66+ * (c) Copyright 2001-2005 Helge Deller <deller@gmx.de>77 * (c) Copyright 2001 Randolph Chung <tausq@debian.org>88 *99 * This program is free software; you can redistribute it and/or modify···5656 relatively large amount of CPU time, some of the calculations can be 5757 turned off with the following variables (controlled via procfs) */58585959-static int led_type = -1;5959+static int led_type __read_mostly = -1;6060static unsigned char lastleds; /* LED state from most recent update */6161-static unsigned int led_heartbeat = 1;6262-static unsigned int led_diskio = 1;6363-static unsigned int led_lanrxtx = 1;6464-static char lcd_text[32];6565-static char lcd_text_default[32];6161+static unsigned int led_heartbeat __read_mostly = 1;6262+static unsigned int led_diskio __read_mostly = 1;6363+static unsigned int led_lanrxtx __read_mostly = 1;6464+static char lcd_text[32] __read_mostly;6565+static char lcd_text_default[32] __read_mostly;666667676868static struct workqueue_struct *led_wq;···108108/* lcd_info is pre-initialized to the values needed to program KittyHawk LCD's 109109 * HP seems to have used Sharp/Hitachi HD44780 LCDs most of the time. */110110static struct pdc_chassis_lcd_info_ret_block111111-lcd_info __attribute__((aligned(8))) =111111+lcd_info __attribute__((aligned(8))) __read_mostly =112112{113113 .model = DISPLAY_MODEL_LCD,114114 .lcd_width = 16,···144144device_initcall(start_task);145145146146/* ptr to LCD/LED-specific function */147147-static void (*led_func_ptr) (unsigned char);147147+static void (*led_func_ptr) (unsigned char) __read_mostly;148148149149#ifdef CONFIG_PROC_FS150150static int led_proc_read(char *page, char **start, off_t off, int count,
+32-12
drivers/parisc/pdc_stable.c
···5656#include <asm/uaccess.h>5757#include <asm/hardware.h>58585959-#define PDCS_VERSION "0.09"5959+#define PDCS_VERSION "0.10"60606161#define PDCS_ADDR_PPRI 0x006262#define PDCS_ADDR_OSID 0x40···7070MODULE_LICENSE("GPL");7171MODULE_VERSION(PDCS_VERSION);72727373-static unsigned long pdcs_size = 0;7373+static unsigned long pdcs_size __read_mostly;74747575/* This struct defines what we need to deal with a parisc pdc path entry */7676struct pdcspath_entry {···194194 return -EIO;195195 }196196197197- entry->ready = 1;197197+ /* kobject is already registered */198198+ entry->ready = 2;198199199200 DPRINTK("%s: device: 0x%p\n", __func__, entry->dev);200201···654653{655654 unsigned short i;656655 struct pdcspath_entry *entry;656656+ int err;657657658658 for (i = 0; (entry = pdcspath_entries[i]); i++) {659659 if (pdcspath_fetch(entry) < 0)660660 continue;661661662662- kobject_set_name(&entry->kobj, "%s", entry->name);662662+ if ((err = kobject_set_name(&entry->kobj, "%s", entry->name)))663663+ return err;663664 kobj_set_kset_s(entry, paths_subsys);664664- kobject_register(&entry->kobj);665665-665665+ if ((err = kobject_register(&entry->kobj)))666666+ return err;667667+668668+ /* kobject is now registered */669669+ entry->ready = 2;670670+666671 if (!entry->dev)667672 continue;668673···682675/**683676 * pdcs_unregister_pathentries - Routine called when unregistering the module.684677 */685685-static inline void __exit678678+static inline void686679pdcs_unregister_pathentries(void)687680{688681 unsigned short i;689682 struct pdcspath_entry *entry;690683691684 for (i = 0; (entry = pdcspath_entries[i]); i++)692692- if (entry->ready)685685+ if (entry->ready >= 2)693686 kobject_unregister(&entry->kobj); 694687}695688···711704712705 /* For now we'll register the pdc subsys within this driver */713706 if ((rc = firmware_register(&pdc_subsys)))714714- return rc;707707+ goto fail_firmreg;715708716709 /* Don't forget the info entry */717710 for (i = 0; (attr = pdcs_subsys_attrs[i]) && !error; i++)···720713721714 /* register the paths subsys as a subsystem of pdc subsys */722715 kset_set_kset_s(&paths_subsys, pdc_subsys);723723- subsystem_register(&paths_subsys);716716+ if ((rc= subsystem_register(&paths_subsys)))717717+ goto fail_subsysreg;724718725719 /* now we create all "files" for the paths subsys */726726- pdcs_register_pathentries();720720+ if ((rc = pdcs_register_pathentries()))721721+ goto fail_pdcsreg;722722+723723+ return rc;727724728728- return 0;725725+fail_pdcsreg:726726+ pdcs_unregister_pathentries();727727+ subsystem_unregister(&paths_subsys);728728+729729+fail_subsysreg:730730+ firmware_unregister(&pdc_subsys);731731+732732+fail_firmreg:733733+ printk(KERN_INFO "PDC Stable Storage bailing out\n");734734+ return rc;729735}730736731737static void __exit
+6-6
drivers/parisc/power.c
···22 * linux/arch/parisc/kernel/power.c33 * HP PARISC soft power switch support driver44 *55- * Copyright (c) 2001-2002 Helge Deller <deller@gmx.de>55+ * Copyright (c) 2001-2005 Helge Deller <deller@gmx.de>66 * All rights reserved.77 *88 *···102102103103static void poweroff(void)104104{105105- static int powering_off;105105+ static int powering_off __read_mostly;106106107107 if (powering_off)108108 return;···113113114114115115/* local time-counter for shutdown */116116-static int shutdown_timer;116116+static int shutdown_timer __read_mostly;117117118118/* check, give feedback and start shutdown after one second */119119static void process_shutdown(void)···139139DECLARE_TASKLET_DISABLED(power_tasklet, NULL, 0);140140141141/* soft power switch enabled/disabled */142142-int pwrsw_enabled = 1;142142+int pwrsw_enabled __read_mostly = 1;143143144144/*145145 * On gecko style machines (e.g. 712/xx and 715/xx) ···149149 */150150static void gecko_tasklet_func(unsigned long unused)151151{152152- if (!pwrsw_enabled)152152+ if (unlikely(!pwrsw_enabled))153153 return;154154155155 if (__getDIAG(25) & 0x80000000) {···173173{174174 unsigned long current_status;175175176176- if (!pwrsw_enabled)176176+ if (unlikely(!pwrsw_enabled))177177 return;178178179179 current_status = gsc_readl(soft_power_reg);
···12361236 }1237123712381238 /* Set the HPA of harmony */12391239- harmony.hpa = (struct harmony_hpa *)dev->hpa;12391239+ harmony.hpa = (struct harmony_hpa *)dev->hpa.start;12401240 harmony.dev = dev;1241124112421242 /* Grab the ID and revision from the device */···1250125012511251 printk(KERN_INFO "Lasi Harmony Audio driver " HARMONY_VERSION ", "12521252 "h/w id %i, rev. %i at 0x%lx, IRQ %i\n",12531253- id, rev, dev->hpa, harmony.dev->irq);12531253+ id, rev, dev->hpa.start, harmony.dev->irq);1254125412551255 /* Make sure the control bit isn't set, although I don't think it 12561256 ever is. */