Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'parisc-for-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull parisc updates from Helge Deller:

- Fix device reference leak in error path

- Check if system provides a 64-bit free running platform counter

- Minor fixes in debug code

* tag 'parisc-for-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
parisc: lba_pci: Add debug code to show IO and PA ranges
parisc: Detect 64-bit free running platform counter
parisc: Fix minor printk issues in iosapic debug code
parisc: Enhance debug code for PAT firmware
parisc: Add PDC PAT call to get free running 64-bit counter
parisc: Fix module path output in qemu tables
parisc: Export model name for MPE/ix
parisc: Prevent interrupts during reboot
parisc: Print hardware IDs as 4 digit hex strings
parisc: kernel: replace kfree() with put_device() in create_tree_node()

+104 -29
+5 -2
arch/parisc/include/asm/pdcpat.h
··· 179 179 #define PDC_PAT_PD 74L /* Protection Domain Info */ 180 180 #define PDC_PAT_PD_GET_ADDR_MAP 0L /* Get Address Map */ 181 181 #define PDC_PAT_PD_GET_PDC_INTERF_REV 1L /* Get PDC Interface Revisions */ 182 + #define PDC_PAT_PD_GET_PLATFORM_COUNTER 10L /* Get 64-bit free running counter */ 182 183 183 184 #define PDC_PAT_CAPABILITY_BIT_PDC_SERIALIZE (1UL << 0) 184 185 #define PDC_PAT_CAPABILITY_BIT_PDC_POLLING (1UL << 1) ··· 374 373 unsigned long count, unsigned long offset); 375 374 extern int pdc_pat_pd_get_pdc_revisions(unsigned long *legacy_rev, 376 375 unsigned long *pat_rev, unsigned long *pdc_cap); 376 + extern int pdc_pat_pd_get_platform_counter(uint64_t **addr, 377 + unsigned long *freq, unsigned long *uniq); 377 378 378 - extern int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *val); 379 - extern int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val); 379 + extern int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *val); 380 + extern int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val); 380 381 381 382 extern int pdc_pat_mem_pdt_info(struct pdc_pat_mem_retinfo *rinfo); 382 383 extern int pdc_pat_mem_pdt_cell_info(struct pdc_pat_mem_cell_pdt_retinfo *rinfo,
+8 -4
arch/parisc/kernel/drivers.c
··· 435 435 dev->dev.dma_mask = &dev->dma_mask; 436 436 dev->dev.coherent_dma_mask = dev->dma_mask; 437 437 if (device_register(&dev->dev)) { 438 - kfree(dev); 438 + put_device(&dev->dev); 439 439 return NULL; 440 440 } 441 441 ··· 916 916 { 917 917 int num; 918 918 unsigned long *p; 919 + char name_mpe[80]; 919 920 920 921 pr_info("--- cut here ---\n"); 921 922 pr_info("/* AUTO-GENERATED HEADER FILE FOR SEABIOS FIRMWARE */\n"); 922 923 pr_cont("/* generated with Linux kernel */\n"); 923 924 pr_cont("/* search for PARISC_QEMU_MACHINE_HEADER in Linux */\n\n"); 924 925 925 - pr_info("#define PARISC_MODEL \"%s\"\n\n", 926 + pr_info("#define PARISC_MODEL \"%s\"\n", 926 927 boot_cpu_data.pdc.sys_model_name); 928 + strcpy(name_mpe, boot_cpu_data.pdc.sys_model_name); 929 + pdc_model_sysmodel(OS_ID_MPEXL, name_mpe); 930 + pr_info("#define PARISC_MODEL_MPE \"%s\"\n\n", name_mpe); 927 931 928 932 #define p ((unsigned long *)&boot_cpu_data.pdc.model) 929 933 pr_info("#define PARISC_PDC_MODEL 0x%lx, 0x%lx, 0x%lx, " ··· 1040 1036 "mod_path_hpa_%08lx = {\n", hpa); 1041 1037 pr_cont("\t.path = { "); 1042 1038 pr_cont(".flags = 0x%x, ", mod_path.path.flags); 1043 - pr_cont(".bc = { 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x }, ", 1039 + pr_cont(".bc = { 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x }, ", 1044 1040 (unsigned char)mod_path.path.bc[0], 1045 1041 (unsigned char)mod_path.path.bc[1], 1046 1042 (unsigned char)mod_path.path.bc[2], 1047 1043 (unsigned char)mod_path.path.bc[3], 1048 1044 (unsigned char)mod_path.path.bc[4], 1049 1045 (unsigned char)mod_path.path.bc[5]); 1050 - pr_cont(".mod = 0x%x }\n", mod_path.path.mod); 1046 + pr_cont(".mod = 0x%02x }\n", (unsigned char)mod_path.path.mod); 1051 1047 pr_cont("};\n"); 1052 1048 1053 1049 pr_info("static struct pdc_iodc iodc_data_hpa_%08lx = {\n", hpa);
+26 -1
arch/parisc/kernel/firmware.c
··· 1643 1643 return retval; 1644 1644 } 1645 1645 1646 + /** 1647 + * pdc_pat_pd_get_platform_counter - Retrieve address of free-running 64-bit counter. 1648 + * @addr: The address of the 64-bit counter. 1649 + * @freq: The frequency of the counter, or -1 if unknown. 1650 + * @unique: Although monotonic growing, may it return the same number twice? 1651 + * 1652 + */ 1653 + int pdc_pat_pd_get_platform_counter(uint64_t **addr, 1654 + unsigned long *freq, unsigned long *unique) 1655 + { 1656 + int retval; 1657 + unsigned long flags; 1658 + 1659 + spin_lock_irqsave(&pdc_lock, flags); 1660 + retval = mem_pdc_call(PDC_PAT_PD, PDC_PAT_PD_GET_PLATFORM_COUNTER, 1661 + __pa(pdc_result)); 1662 + if (retval == PDC_OK) { 1663 + *addr = (uint64_t *)pdc_result[0]; 1664 + *freq = pdc_result[1]; 1665 + *unique = pdc_result[2]; 1666 + } 1667 + spin_unlock_irqrestore(&pdc_lock, flags); 1668 + 1669 + return retval; 1670 + } 1646 1671 1647 1672 /** 1648 1673 * pdc_pat_io_pci_cfg_read - Read PCI configuration space. 1649 1674 * @pci_addr: PCI configuration space address for which the read request is being made. 1650 - * @pci_size: Size of read in bytes. Valid values are 1, 2, and 4. 1675 + * @pci_size: Size of read in bytes. Valid values are 1, 2, and 4. 1651 1676 * @mem_addr: Pointer to return memory buffer. 1652 1677 * 1653 1678 */
+13
arch/parisc/kernel/inventory.c
··· 207 207 return status; 208 208 } 209 209 210 + #ifdef DEBUG_PAT 211 + pr_debug("PAT INDEX: %lu: cba 0x%lx, " 212 + "mod_info 0x%lx, mod_location 0x%lx, " 213 + "mod: 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx " 214 + "0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n", 215 + mod_index + 1, pa_pdc_cell->cba, 216 + pa_pdc_cell->mod_info, pa_pdc_cell->mod_location, 217 + pa_pdc_cell->mod[0], pa_pdc_cell->mod[1], pa_pdc_cell->mod[2], 218 + pa_pdc_cell->mod[3], pa_pdc_cell->mod[4], pa_pdc_cell->mod[5], 219 + pa_pdc_cell->mod[6], pa_pdc_cell->mod[7], pa_pdc_cell->mod[8], 220 + pa_pdc_cell->mod[9], pa_pdc_cell->mod[10], pa_pdc_cell->mod[11]); 221 + #endif 222 + 210 223 temp = pa_pdc_cell->cba; 211 224 dev = alloc_pa_dev(PAT_GET_CBA(temp), &(pa_pdc_cell->mod_path)); 212 225 if (!dev) {
+3
arch/parisc/kernel/process.c
··· 85 85 #endif 86 86 /* set up a new led state on systems shipped with a LED State panel */ 87 87 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_SHUTDOWN); 88 + 89 + /* prevent interrupts during reboot */ 90 + set_eiem(0); 88 91 89 92 /* "Normal" system reset */ 90 93 pdc_do_reset();
+13 -13
arch/parisc/kernel/processor.c
··· 3 3 * Initial setup-routines for HP 9000 based hardware. 4 4 * 5 5 * Copyright (C) 1991, 1992, 1995 Linus Torvalds 6 - * Modifications for PA-RISC (C) 1999-2008 Helge Deller <deller@gmx.de> 6 + * Modifications for PA-RISC (C) 1999-2026 Helge Deller <deller@gmx.de> 7 7 * Modifications copyright 1999 SuSE GmbH (Philipp Rumpf) 8 8 * Modifications copyright 2000 Martin K. Petersen <mkp@mkp.net> 9 9 * Modifications copyright 2000 Philipp Rumpf <prumpf@tux.org> ··· 41 41 DEFINE_PER_CPU(struct cpuinfo_parisc, cpu_data); 42 42 43 43 /* 44 - ** PARISC CPU driver - claim "device" and initialize CPU data structures. 44 + ** PARISC CPU driver - claim "device" and initialize CPU data structures. 45 45 ** 46 46 ** Consolidate per CPU initialization into (mostly) one module. 47 47 ** Monarch CPU will initialize boot_cpu_data which shouldn't ··· 74 74 * processor_probe - Determine if processor driver should claim this device. 75 75 * @dev: The device which has been found. 76 76 * 77 - * Determine if processor driver should claim this chip (return 0) or not 78 - * (return 1). If so, initialize the chip and tell other partners in crime 77 + * Determine if processor driver should claim this chip (return 0) or not 78 + * (return 1). If so, initialize the chip and tell other partners in crime 79 79 * they have work to do. 80 80 */ 81 81 static int __init processor_probe(struct parisc_device *dev) ··· 207 207 } 208 208 #endif 209 209 210 - /* 210 + /* 211 211 * Bring this CPU up now! (ignore bootstrap cpuid == 0) 212 212 */ 213 213 #ifdef CONFIG_SMP ··· 241 241 /* get CPU-Model Information... */ 242 242 #define p ((unsigned long *)&boot_cpu_data.pdc.model) 243 243 if (pdc_model_info(&boot_cpu_data.pdc.model) == PDC_OK) { 244 - printk(KERN_INFO 245 - "model %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", 246 - p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9]); 244 + pr_info("model 0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx " 245 + "0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx\n", 246 + p[0], p[1], p[2], p[3], p[4], 247 + p[5], p[6], p[7], p[8], p[9]); 247 248 248 249 add_device_randomness(&boot_cpu_data.pdc.model, 249 250 sizeof(boot_cpu_data.pdc.model)); ··· 252 251 #undef p 253 252 254 253 if (pdc_model_versions(&boot_cpu_data.pdc.versions, 0) == PDC_OK) { 255 - printk(KERN_INFO "vers %08lx\n", 256 - boot_cpu_data.pdc.versions); 254 + pr_info("vers 0x%04lx\n", boot_cpu_data.pdc.versions); 257 255 258 256 add_device_randomness(&boot_cpu_data.pdc.versions, 259 257 sizeof(boot_cpu_data.pdc.versions)); 260 258 } 261 259 262 260 if (pdc_model_cpuid(&boot_cpu_data.pdc.cpuid) == PDC_OK) { 263 - printk(KERN_INFO "CPUID vers %ld rev %ld (0x%08lx)\n", 261 + pr_info("CPUID vers %ld rev %ld (0x%04lx)\n", 264 262 (boot_cpu_data.pdc.cpuid >> 5) & 127, 265 263 boot_cpu_data.pdc.cpuid & 31, 266 264 boot_cpu_data.pdc.cpuid); ··· 437 437 boot_cpu_data.pdc.sys_model_name, 438 438 cpu_name); 439 439 440 - seq_printf(m, "hversion\t: 0x%08x\n" 441 - "sversion\t: 0x%08x\n", 440 + seq_printf(m, "hversion\t: 0x%04x\n" 441 + "sversion\t: 0x%04x\n", 442 442 boot_cpu_data.hversion, 443 443 boot_cpu_data.sversion ); 444 444
+20
arch/parisc/kernel/time.c
··· 16 16 #include <linux/rtc.h> 17 17 #include <linux/platform_device.h> 18 18 #include <asm/processor.h> 19 + #include <asm/pdcpat.h> 19 20 20 21 static u64 cr16_clock_freq; 21 22 static unsigned long clocktick; ··· 98 97 cd->event_handler = parisc_event_handler; 99 98 100 99 clockevents_config_and_register(cd, cr16_clock_freq, min_delta, max_delta); 100 + } 101 + 102 + static void parisc_find_64bit_counter(void) 103 + { 104 + #ifdef CONFIG_64BIT 105 + uint64_t *pclock; 106 + unsigned long freq, unique; 107 + int ret; 108 + 109 + ret = pdc_pat_pd_get_platform_counter(&pclock, &freq, &unique); 110 + if (ret == PDC_OK) 111 + pr_info("64-bit counter found at %px, freq: %lu, unique: %lu\n", 112 + pclock, freq, unique); 113 + else 114 + pr_info("64-bit counter not found.\n"); 115 + #endif 101 116 } 102 117 103 118 unsigned long notrace profile_pc(struct pt_regs *regs) ··· 229 212 sched_clock_register(read_cr16_sched_clock, BITS_PER_LONG, cr16_clock_freq); 230 213 231 214 parisc_clockevent_init(); 215 + 216 + /* check for free-running 64-bit platform counter */ 217 + parisc_find_64bit_counter(); 232 218 233 219 /* register at clocksource framework */ 234 220 clocksource_register_hz(&clocksource_cr16, cr16_clock_freq);
+12 -9
drivers/parisc/iosapic.c
··· 262 262 263 263 if (is_pdc_pat()) { 264 264 /* Use pat pdc routine to get interrupt routing table size */ 265 - DBG("calling get_irt_size (cell %ld)\n", cell_num); 266 265 status = pdc_pat_get_irt_size(&num_entries, cell_num); 267 - DBG("get_irt_size: %ld\n", status); 266 + DBG("calling get_irt_size (cell %ld) ", cell_num); 267 + DBG("returned %ld, entries: %lu\n", status, num_entries); 268 268 269 269 BUG_ON(status != PDC_OK); 270 270 BUG_ON(num_entries == 0); ··· 327 327 int i; 328 328 329 329 printk(MODULE_NAME " Interrupt Routing Table (cell %ld)\n", cell_num); 330 - printk(MODULE_NAME " start = 0x%p num_entries %ld entry_size %d\n", 330 + printk(MODULE_NAME " start = 0x%px num_entries %ld entry_size %d\n", 331 331 table, 332 332 num_entries, 333 333 (int) sizeof(struct irt_entry)); ··· 455 455 pci_read_config_byte(pcidev, PCI_INTERRUPT_PIN, &intr_pin); 456 456 457 457 DBG_IRT("iosapic_xlate_pin(%s) SLOT %d pin %d\n", 458 - pcidev->slot_name, PCI_SLOT(pcidev->devfn), intr_pin); 458 + pci_name(pcidev), PCI_SLOT(pcidev->devfn), intr_pin); 459 459 460 460 if (intr_pin == 0) { 461 461 /* The device does NOT support/use IRQ lines. */ ··· 508 508 } else { 509 509 intr_slot = PCI_SLOT(pcidev->devfn); 510 510 } 511 - DBG_IRT("iosapic_xlate_pin: bus %d slot %d pin %d\n", 511 + DBG_IRT("iosapic_xlate_pin: bus %lld slot %d pin %d\n", 512 512 pcidev->bus->busn_res.start, intr_slot, intr_pin); 513 513 514 514 return irt_find_irqline(isi, intr_slot, intr_pin); ··· 733 733 pci_name(pcidev)); 734 734 return -1; 735 735 } 736 - DBG_IRT("iosapic_fixup_irq(): irte %p %x %x %x %x %x %x %x %x\n", 736 + DBG_IRT("iosapic_fixup_irq(): irte %px %02x %02x %02x %02x %02x %02x %02x %04llx\n", 737 737 irte, 738 738 irte->entry_type, 739 739 irte->entry_length, ··· 742 742 irte->src_bus_id, 743 743 irte->src_seg_id, 744 744 irte->dest_iosapic_intin, 745 - (u32) irte->dest_iosapic_addr); 745 + irte->dest_iosapic_addr); 746 746 isi_line = irte->dest_iosapic_intin; 747 747 748 748 /* get vector info for this input line */ 749 749 vi = isi->isi_vector + isi_line; 750 - DBG_IRT("iosapic_fixup_irq: line %d vi 0x%p\n", isi_line, vi); 750 + DBG_IRT("iosapic_fixup_irq: line %d vi 0x%px\n", isi_line, vi); 751 751 752 752 /* If this IRQ line has already been setup, skip it */ 753 753 if (vi->irte) ··· 772 772 /* enable_irq() will use txn_* to program IRdT */ 773 773 vi->txn_addr = txn_alloc_addr(vi->txn_irq); 774 774 vi->txn_data = txn_alloc_data(vi->txn_irq); 775 + DBG_IRT("iosapic_fixup_irq() TXN: 0x%lx 0x%x\n", 776 + vi->txn_addr, vi->txn_data); 775 777 776 778 vi->eoi_addr = isi->addr + IOSAPIC_REG_EOI; 777 779 vi->eoi_data = cpu_to_le32(vi->txn_data); ··· 833 831 834 832 /* get vector info for this input line */ 835 833 vi = isi->isi_vector + intin; 836 - DBG_IRT("iosapic_serial_irq: line %d vi 0x%p\n", iosapic_intin, vi); 834 + DBG_IRT("iosapic_serial_irq: line %d vi 0x%p\n", intin, vi); 837 835 838 836 /* If this IRQ line has already been setup, skip it */ 839 837 if (vi->irte) ··· 925 923 isi->isi_hpa = hpa; 926 924 isi->isi_version = iosapic_rd_version(isi); 927 925 isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1; 926 + DBG_IRT("iosapic_register: num vectors = %d\n", isi->isi_num_vectors); 928 927 929 928 vip = isi->isi_vector = kcalloc(isi->isi_num_vectors, 930 929 sizeof(struct vector_info), GFP_KERNEL);
+4
drivers/parisc/lba_pci.c
··· 1066 1066 1067 1067 p = (void *) &(pa_pdc_cell->mod[2+i*3]); 1068 1068 io = (void *) &(io_pdc_cell->mod[2+i*3]); 1069 + DBG_PAT("PA #%d : TYPE 0x%08lx, start 0x%08lx, end 0x%08lx\n", 1070 + i, p->type, p->start, p->end); 1071 + DBG_PAT("IO #%d : TYPE 0x%08lx, start 0x%08lx, end 0x%08lx\n", 1072 + i, io->type, io->start, io->end); 1069 1073 1070 1074 /* Convert the PAT range data to PCI "struct resource" */ 1071 1075 switch(p->type & 0xff) {