Commit 8ad8d24d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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()
parents 6589b3d7 1651d694
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@
#define PDC_PAT_PD		74L         /* Protection Domain Info   */
#define PDC_PAT_PD_GET_ADDR_MAP		0L  /* Get Address Map          */
#define PDC_PAT_PD_GET_PDC_INTERF_REV	1L  /* Get PDC Interface Revisions */
#define PDC_PAT_PD_GET_PLATFORM_COUNTER	10L /* Get 64-bit free running counter */

#define PDC_PAT_CAPABILITY_BIT_PDC_SERIALIZE	(1UL << 0)
#define PDC_PAT_CAPABILITY_BIT_PDC_POLLING	(1UL << 1)
@@ -373,6 +374,8 @@ extern int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr,
		unsigned long count, unsigned long offset);
extern int pdc_pat_pd_get_pdc_revisions(unsigned long *legacy_rev,
		unsigned long *pat_rev, unsigned long *pdc_cap);
extern int pdc_pat_pd_get_platform_counter(uint64_t **addr,
		unsigned long *freq, unsigned long *uniq);

extern int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *val);
extern int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val);
+8 −4
Original line number Diff line number Diff line
@@ -435,7 +435,7 @@ static struct parisc_device * __init create_tree_node(char id,
	dev->dev.dma_mask = &dev->dma_mask;
	dev->dev.coherent_dma_mask = dev->dma_mask;
	if (device_register(&dev->dev)) {
		kfree(dev);
		put_device(&dev->dev);
		return NULL;
	}

@@ -916,14 +916,18 @@ static __init void qemu_header(void)
{
	int num;
	unsigned long *p;
	char name_mpe[80];

	pr_info("--- cut here ---\n");
	pr_info("/* AUTO-GENERATED HEADER FILE FOR SEABIOS FIRMWARE */\n");
	pr_cont("/* generated with Linux kernel */\n");
	pr_cont("/* search for PARISC_QEMU_MACHINE_HEADER in Linux */\n\n");

	pr_info("#define PARISC_MODEL \"%s\"\n\n",
	pr_info("#define PARISC_MODEL     \"%s\"\n",
			boot_cpu_data.pdc.sys_model_name);
	strcpy(name_mpe, boot_cpu_data.pdc.sys_model_name);
	pdc_model_sysmodel(OS_ID_MPEXL, name_mpe);
	pr_info("#define PARISC_MODEL_MPE \"%s\"\n\n", name_mpe);

	#define p ((unsigned long *)&boot_cpu_data.pdc.model)
	pr_info("#define PARISC_PDC_MODEL 0x%lx, 0x%lx, 0x%lx, "
@@ -1036,14 +1040,14 @@ static __init int qemu_print_iodc_data(struct device *lin_dev, void *data)
		"mod_path_hpa_%08lx = {\n", hpa);
	pr_cont("\t.path = { ");
	pr_cont(".flags = 0x%x, ", mod_path.path.flags);
	pr_cont(".bc = { 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x }, ",
	pr_cont(".bc = { 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x }, ",
		(unsigned char)mod_path.path.bc[0],
		(unsigned char)mod_path.path.bc[1],
		(unsigned char)mod_path.path.bc[2],
		(unsigned char)mod_path.path.bc[3],
		(unsigned char)mod_path.path.bc[4],
		(unsigned char)mod_path.path.bc[5]);
	pr_cont(".mod = 0x%x }\n", mod_path.path.mod);
	pr_cont(".mod = 0x%02x }\n", (unsigned char)mod_path.path.mod);
	pr_cont("};\n");

	pr_info("static struct pdc_iodc iodc_data_hpa_%08lx = {\n", hpa);
+26 −1
Original line number Diff line number Diff line
@@ -1643,6 +1643,31 @@ int pdc_pat_pd_get_pdc_revisions(unsigned long *legacy_rev,
	return retval;
}

/**
 * pdc_pat_pd_get_platform_counter - Retrieve address of free-running 64-bit counter.
 * @addr: The address of the 64-bit counter.
 * @freq: The frequency of the counter, or -1 if unknown.
 * @unique: Although monotonic growing, may it return the same number twice?
 *
 */
int pdc_pat_pd_get_platform_counter(uint64_t **addr,
		unsigned long *freq, unsigned long *unique)
{
	int retval;
	unsigned long flags;

	spin_lock_irqsave(&pdc_lock, flags);
	retval = mem_pdc_call(PDC_PAT_PD, PDC_PAT_PD_GET_PLATFORM_COUNTER,
				__pa(pdc_result));
	if (retval == PDC_OK) {
		*addr = (uint64_t *)pdc_result[0];
		*freq = pdc_result[1];
		*unique = pdc_result[2];
	}
	spin_unlock_irqrestore(&pdc_lock, flags);

	return retval;
}

/**
 * pdc_pat_io_pci_cfg_read - Read PCI configuration space.
+13 −0
Original line number Diff line number Diff line
@@ -207,6 +207,19 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
		return status;
	}

#ifdef DEBUG_PAT
	pr_debug("PAT INDEX: %lu: cba 0x%lx, "
		"mod_info 0x%lx, mod_location 0x%lx, "
		"mod: 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx "
		"0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n",
		mod_index + 1, pa_pdc_cell->cba,
		pa_pdc_cell->mod_info, pa_pdc_cell->mod_location,
		pa_pdc_cell->mod[0], pa_pdc_cell->mod[1], pa_pdc_cell->mod[2],
		pa_pdc_cell->mod[3], pa_pdc_cell->mod[4], pa_pdc_cell->mod[5],
		pa_pdc_cell->mod[6], pa_pdc_cell->mod[7], pa_pdc_cell->mod[8],
		pa_pdc_cell->mod[9], pa_pdc_cell->mod[10], pa_pdc_cell->mod[11]);
#endif

	temp = pa_pdc_cell->cba;
	dev = alloc_pa_dev(PAT_GET_CBA(temp), &(pa_pdc_cell->mod_path));
	if (!dev) {
+3 −0
Original line number Diff line number Diff line
@@ -86,6 +86,9 @@ void machine_restart(char *cmd)
	/* set up a new led state on systems shipped with a LED State panel */
	pdc_chassis_send_status(PDC_CHASSIS_DIRECT_SHUTDOWN);

	/* prevent interrupts during reboot */
	set_eiem(0);
	
	/* "Normal" system reset */
	pdc_do_reset();

Loading