Skip to content

Commit 8feed3e

Browse files
committed
Merge branch 'parisc-5.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc updates from Helge Deller: "The most important changes in this patch set are: - DMA-related cleanups for parisc with the aim to move anything not required by drivers out of <asm/dma-mapping.h>, by Christoph Hellwig - Switch to memblock_alloc(), by Mike Rapoport - Makefile cleanups by Masahiro Yamada - Switch to bust_spinlocks(), by Sergey Senozhatsky - Improved initial SMP affinity selection for IRQs - Added IPI- and rescheduling interrupts in /proc/interrupts output" * 'parisc-5.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: (21 commits) parisc: use memblock_alloc() instead of custom get_memblock() parisc: Add constants for various PDC firmware calls parisc: Add constant for PDC_PAT_COMPLEX firmware call parisc: Show machine product number during boot parisc: Add constants for PDC_RELOCATE PDC call parisc: Add PDC_CRASH_PREP PDC function number parisc: Use F_EXTEND() macro in iosapic code parisc: remove the HBA_DATA macro parisc/lba_pci: use container_of in LBA_DEV parisc/dino: use container_of in DINO_DEV parisc: properly type the return value of parisc_walk_tree parisc: properly type the iommu field in struct pci_hba_data parisc: turn GET_IOC into an inline function parisc: move internal implementation details out of <asm/dma-mapping.h> parisc: don't include <asm/cacheflush.h> in <asm/dma-mapping.h> parisc: remove meaningless ccflags-y in arch/parisc/boot/Makefile parisc: replace oops_in_progress manipulation with bust_spinlocks() parisc: Improve initial IRQ to CPU assignment parisc: Count IPI function call interrupts parisc: Show rescheduling interrupts on SMP machines only ...
2 parents 3591b19 + 6a52800 commit 8feed3e

22 files changed

Lines changed: 197 additions & 131 deletions

File tree

‎arch/parisc/boot/Makefile‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
# Makefile for the linux parisc-specific parts of the boot image creator.
33
#
44

5-
COMPILE_VERSION := __linux_compile_version_id__`hostname | \
6-
tr -c '[0-9A-Za-z]' '_'`__`date | \
7-
tr -c '[0-9A-Za-z]' '_'`_t
8-
9-
ccflags-y := -DCOMPILE_VERSION=$(COMPILE_VERSION) -gstabs -I.
10-
115
targets := image
126
targets += bzImage
137
subdir- := compressed

‎arch/parisc/include/asm/dma-mapping.h‎

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef _PARISC_DMA_MAPPING_H
33
#define _PARISC_DMA_MAPPING_H
44

5-
#include <asm/cacheflush.h>
6-
75
/*
86
** We need to support 4 different coherent dma models with one binary:
97
**
@@ -28,48 +26,4 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
2826
return hppa_dma_ops;
2927
}
3028

31-
static inline void *
32-
parisc_walk_tree(struct device *dev)
33-
{
34-
struct device *otherdev;
35-
if(likely(dev->platform_data != NULL))
36-
return dev->platform_data;
37-
/* OK, just traverse the bus to find it */
38-
for(otherdev = dev->parent; otherdev;
39-
otherdev = otherdev->parent) {
40-
if(otherdev->platform_data) {
41-
dev->platform_data = otherdev->platform_data;
42-
break;
43-
}
44-
}
45-
return dev->platform_data;
46-
}
47-
48-
#define GET_IOC(dev) ({ \
49-
void *__pdata = parisc_walk_tree(dev); \
50-
__pdata ? HBA_DATA(__pdata)->iommu : NULL; \
51-
})
52-
53-
#ifdef CONFIG_IOMMU_CCIO
54-
struct parisc_device;
55-
struct ioc;
56-
void * ccio_get_iommu(const struct parisc_device *dev);
57-
int ccio_request_resource(const struct parisc_device *dev,
58-
struct resource *res);
59-
int ccio_allocate_resource(const struct parisc_device *dev,
60-
struct resource *res, unsigned long size,
61-
unsigned long min, unsigned long max, unsigned long align);
62-
#else /* !CONFIG_IOMMU_CCIO */
63-
#define ccio_get_iommu(dev) NULL
64-
#define ccio_request_resource(dev, res) insert_resource(&iomem_resource, res)
65-
#define ccio_allocate_resource(dev, res, size, min, max, align) \
66-
allocate_resource(&iomem_resource, res, size, min, max, \
67-
align, NULL, NULL)
68-
#endif /* !CONFIG_IOMMU_CCIO */
69-
70-
#ifdef CONFIG_IOMMU_SBA
71-
struct parisc_device;
72-
void * sba_get_iommu(struct parisc_device *dev);
73-
#endif
74-
7529
#endif

‎arch/parisc/include/asm/hardirq.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ typedef struct {
2222
unsigned int irq_stack_usage;
2323
#ifdef CONFIG_SMP
2424
unsigned int irq_resched_count;
25+
unsigned int irq_call_count;
2526
#endif
2627
unsigned int irq_unaligned_count;
2728
unsigned int irq_fpassist_count;

‎arch/parisc/include/asm/pci.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct pci_hba_data {
5656
#define DINO_MAX_LMMIO_RESOURCES 3
5757

5858
unsigned long lmmio_space_offset; /* CPU view - PCI view */
59-
void * iommu; /* IOMMU this device is under */
59+
struct ioc *iommu; /* IOMMU this device is under */
6060
/* REVISIT - spinlock to protect resources? */
6161

6262
#define HBA_NAME_SIZE 16
@@ -66,8 +66,6 @@ struct pci_hba_data {
6666
char gmmio_name[HBA_NAME_SIZE];
6767
};
6868

69-
#define HBA_DATA(d) ((struct pci_hba_data *) (d))
70-
7169
/*
7270
** We support 2^16 I/O ports per HBA. These are set up in the form
7371
** 0xbbxxxx, where bb is the bus number and xxxx is the I/O port

‎arch/parisc/include/asm/pdc.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ int pdc_model_sysmodel(char *name);
4444
int pdc_model_cpuid(unsigned long *cpu_id);
4545
int pdc_model_versions(unsigned long *versions, int id);
4646
int pdc_model_capabilities(unsigned long *capabilities);
47+
int pdc_model_platform_info(char *orig_prod_num, char *current_prod_num, char *serial_no);
4748
int pdc_cache_info(struct pdc_cache_info *cache);
4849
int pdc_spaceid_bits(unsigned long *space_bits);
4950
#ifndef CONFIG_PA20

‎arch/parisc/include/asm/pdcpat.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767
#define PDC_PAT_CHASSIS_READ_LOG 1L /* Read Log Entry */
6868

6969

70+
/* PDC PAT COMPLEX */
71+
72+
#define PDC_PAT_COMPLEX 66L
73+
7074
/* PDC PAT CPU -- CPU configuration within the protection domain */
7175

7276
#define PDC_PAT_CPU 67L

‎arch/parisc/include/uapi/asm/pdc.h‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
#define PDC_MODEL_NVA_UNSUPPORTED (3 << 4)
6161
#define PDC_MODEL_GET_BOOT__OP 8 /* returns boot test options */
6262
#define PDC_MODEL_SET_BOOT__OP 9 /* set boot test options */
63+
#define PDC_MODEL_GET_PLATFORM_INFO 10 /* returns platform info */
64+
#define PDC_MODEL_GET_INSTALL_KERNEL 11 /* returns kernel for installation */
6365

6466
#define PA89_INSTRUCTION_SET 0x4 /* capabilities returned */
6567
#define PA90_INSTRUCTION_SET 0x8
@@ -99,7 +101,7 @@
99101
#define PDC_TOD 9 /* time-of-day clock (TOD) */
100102
#define PDC_TOD_READ 0 /* read TOD */
101103
#define PDC_TOD_WRITE 1 /* write TOD */
102-
104+
#define PDC_TOD_CALIBRATE 2 /* calibrate timers */
103105

104106
#define PDC_STABLE 10 /* stable storage (sprockets) */
105107
#define PDC_STABLE_READ 0
@@ -109,15 +111,22 @@
109111
#define PDC_STABLE_INITIALIZE 4
110112

111113
#define PDC_NVOLATILE 11 /* often not implemented */
114+
#define PDC_NVOLATILE_READ 0
115+
#define PDC_NVOLATILE_WRITE 1
116+
#define PDC_NVOLATILE_RETURN_SIZE 2
117+
#define PDC_NVOLATILE_VERIFY_CONTENTS 3
118+
#define PDC_NVOLATILE_INITIALIZE 4
112119

113120
#define PDC_ADD_VALID 12 /* Memory validation PDC call */
114121
#define PDC_ADD_VALID_VERIFY 0 /* Make PDC_ADD_VALID verify region */
115122

123+
#define PDC_DEBUG 14 /* Obsolete */
124+
116125
#define PDC_INSTR 15 /* get instr to invoke PDCE_CHECK() */
117126

118127
#define PDC_PROC 16 /* (sprockets) */
119128

120-
#define PDC_CONFIG 16 /* (sprockets) */
129+
#define PDC_CONFIG 17 /* (sprockets) */
121130
#define PDC_CONFIG_DECONFIG 0
122131
#define PDC_CONFIG_DRECONFIG 1
123132
#define PDC_CONFIG_DRETURN_CONFIG 2
@@ -167,6 +176,15 @@
167176
#define PDC_SOFT_POWER_INFO 0 /* return info about the soft power switch */
168177
#define PDC_SOFT_POWER_ENABLE 1 /* enable/disable soft power switch */
169178

179+
#define PDC_ALLOC 24 /* allocate static storage for PDC & IODC */
180+
181+
#define PDC_CRASH_PREP 25 /* Prepare system for crash dump */
182+
#define PDC_CRASH_DUMP 0 /* Do platform specific preparations for dump */
183+
#define PDC_CRASH_LOG_CEC_ERROR 1 /* Dump hardware registers */
184+
185+
#define PDC_SCSI_PARMS 26 /* Get and set SCSI parameters */
186+
#define PDC_SCSI_GET_PARMS 0 /* Get SCSI parameters for I/O device */
187+
#define PDC_SCSI_SET_PARMS 1 /* Set SCSI parameters for I/O device */
170188

171189
/* HVERSION dependent */
172190

@@ -260,6 +278,10 @@
260278
#define PDC_PCI_READ_MON_TYPE 15
261279
#define PDC_PCI_WRITE_MON_TYPE 16
262280

281+
#define PDC_RELOCATE 149 /* (sprockets) */
282+
#define PDC_RELOCATE_GET_RELOCINFO 0
283+
#define PDC_RELOCATE_CHECKSUM 1
284+
#define PDC_RELOCATE_RELOCATE 2
263285

264286
/* Get SCSI Interface Card info: SDTR, SCSI ID, mode (SE vs LVD) */
265287
#define PDC_INITIATOR 163

‎arch/parisc/kernel/firmware.c‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,30 @@ int pdc_model_capabilities(unsigned long *capabilities)
568568
return retval;
569569
}
570570

571+
/**
572+
* pdc_model_platform_info - Returns machine product and serial number.
573+
* @orig_prod_num: Return buffer for original product number.
574+
* @current_prod_num: Return buffer for current product number.
575+
* @serial_no: Return buffer for serial number.
576+
*
577+
* Returns strings containing the original and current product numbers and the
578+
* serial number of the system.
579+
*/
580+
int pdc_model_platform_info(char *orig_prod_num, char *current_prod_num,
581+
char *serial_no)
582+
{
583+
int retval;
584+
unsigned long flags;
585+
586+
spin_lock_irqsave(&pdc_lock, flags);
587+
retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_GET_PLATFORM_INFO,
588+
__pa(orig_prod_num), __pa(current_prod_num), __pa(serial_no));
589+
convert_to_wide(pdc_result);
590+
spin_unlock_irqrestore(&pdc_lock, flags);
591+
592+
return retval;
593+
}
594+
571595
/**
572596
* pdc_cache_info - Return cache and TLB information.
573597
* @cache_info: The return buffer.

‎arch/parisc/kernel/irq.c‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ int cpu_check_affinity(struct irq_data *d, const struct cpumask *dest)
117117
return -EINVAL;
118118

119119
/* whatever mask they set, we just allow one CPU */
120-
cpu_dest = cpumask_first_and(dest, cpu_online_mask);
120+
cpu_dest = cpumask_next_and(d->irq & (num_online_cpus()-1),
121+
dest, cpu_online_mask);
122+
if (cpu_dest >= nr_cpu_ids)
123+
cpu_dest = cpumask_first_and(dest, cpu_online_mask);
121124

122125
return cpu_dest;
123126
}
@@ -175,10 +178,16 @@ int arch_show_interrupts(struct seq_file *p, int prec)
175178
# endif
176179
#endif
177180
#ifdef CONFIG_SMP
178-
seq_printf(p, "%*s: ", prec, "RES");
179-
for_each_online_cpu(j)
180-
seq_printf(p, "%10u ", irq_stats(j)->irq_resched_count);
181-
seq_puts(p, " Rescheduling interrupts\n");
181+
if (num_online_cpus() > 1) {
182+
seq_printf(p, "%*s: ", prec, "RES");
183+
for_each_online_cpu(j)
184+
seq_printf(p, "%10u ", irq_stats(j)->irq_resched_count);
185+
seq_puts(p, " Rescheduling interrupts\n");
186+
seq_printf(p, "%*s: ", prec, "CAL");
187+
for_each_online_cpu(j)
188+
seq_printf(p, "%10u ", irq_stats(j)->irq_call_count);
189+
seq_puts(p, " Function call interrupts\n");
190+
}
182191
#endif
183192
seq_printf(p, "%*s: ", prec, "UAH");
184193
for_each_online_cpu(j)

‎arch/parisc/kernel/processor.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ static int __init processor_probe(struct parisc_device *dev)
242242
void __init collect_boot_cpu_data(void)
243243
{
244244
unsigned long cr16_seed;
245+
char orig_prod_num[64], current_prod_num[64], serial_no[64];
245246

246247
memset(&boot_cpu_data, 0, sizeof(boot_cpu_data));
247248

@@ -301,6 +302,14 @@ void __init collect_boot_cpu_data(void)
301302
_parisc_requires_coherency = (boot_cpu_data.cpu_type == mako) ||
302303
(boot_cpu_data.cpu_type == mako2);
303304
#endif
305+
306+
if (pdc_model_platform_info(orig_prod_num, current_prod_num, serial_no) == PDC_OK) {
307+
printk(KERN_INFO "product %s, original product %s, S/N: %s\n",
308+
current_prod_num, orig_prod_num, serial_no);
309+
add_device_randomness(orig_prod_num, strlen(orig_prod_num));
310+
add_device_randomness(current_prod_num, strlen(current_prod_num));
311+
add_device_randomness(serial_no, strlen(serial_no));
312+
}
304313
}
305314

306315

0 commit comments

Comments
 (0)