From 8ce7ad780d80d7df119a1985606a7ae9fe6b00ff Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 4 Mar 2018 20:56:22 +0100 Subject: parisc/stifb: Use fb_memset() to avoid sparse warning Signed-off-by: Helge Deller --- drivers/video/fbdev/stifb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c index 6ded5c198998..3c2e4cabc08f 100644 --- a/drivers/video/fbdev/stifb.c +++ b/drivers/video/fbdev/stifb.c @@ -527,7 +527,7 @@ rattlerSetupPlanes(struct stifb_info *fb) fb->id = saved_id; for (y = 0; y < fb->info.var.yres; ++y) - memset(fb->info.screen_base + y * fb->info.fix.line_length, + fb_memset(fb->info.screen_base + y * fb->info.fix.line_length, 0xff, fb->info.var.xres * fb->info.var.bits_per_pixel/8); CRX24_SET_OVLY_MASK(fb); -- cgit v1.2.3 From c92826ef5a23422d36fb3dbe685e9215119eadc7 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 4 Mar 2018 20:57:30 +0100 Subject: parisc/parport_gsc: Use NULL to avoid sparse warning Signed-off-by: Helge Deller --- drivers/parport/parport_gsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index 5f710aaaf3da..190c0a7a1c52 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -256,7 +256,7 @@ struct parport *parport_gsc_probe_port(unsigned long base, } priv->ctr = 0xc; priv->ctr_writable = 0xff; - priv->dma_buf = 0; + priv->dma_buf = NULL; priv->dma_handle = 0; p->base = base; p->base_hi = base_hi; -- cgit v1.2.3 From 2d76978d53afb93de46ae54f722e0e24e9b2a39b Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 4 Mar 2018 20:58:39 +0100 Subject: parisc/led: Fix sparse warnings Annotate user buffer and use NULL to avoid sparse warnings. Signed-off-by: Helge Deller --- drivers/parisc/led.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index ff1a332d76e4..0c6e8b44b4ed 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c @@ -176,7 +176,7 @@ static int led_proc_open(struct inode *inode, struct file *file) } -static ssize_t led_proc_write(struct file *file, const char *buf, +static ssize_t led_proc_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) { void *data = PDE_DATA(file_inode(file)); @@ -250,7 +250,7 @@ static int __init led_create_procfs(void) if (led_type == -1) return -1; - proc_pdc_root = proc_mkdir("pdc", 0); + proc_pdc_root = proc_mkdir("pdc", NULL); if (!proc_pdc_root) return -1; if (!lcd_no_led_support) -- cgit v1.2.3 From 3a67ca192c2b1c67b6bbe940f4746200eb427fae Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 4 Mar 2018 21:00:39 +0100 Subject: parisc/gscps2: Fix sparse warnings Signed-off-by: Helge Deller --- drivers/input/serio/gscps2.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index aa9f29b875de..49d8d53e50b7 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -91,7 +91,7 @@ struct gscps2port { struct parisc_device *padev; struct serio *port; spinlock_t lock; - char *addr; + char __iomem *addr; u8 act, append; /* position in buffer[] */ struct { u8 data; @@ -114,7 +114,7 @@ struct gscps2port { * wait_TBE() - wait for Transmit Buffer Empty */ -static int wait_TBE(char *addr) +static int wait_TBE(char __iomem *addr) { int timeout = 25000; /* device is expected to react within 250 msec */ while (gscps2_readb_status(addr) & GSC_STAT_TBNE) { @@ -146,14 +146,14 @@ static void gscps2_flush(struct gscps2port *ps2port) static inline int gscps2_writeb_output(struct gscps2port *ps2port, u8 data) { unsigned long flags; - char *addr = ps2port->addr; + char __iomem *addr = ps2port->addr; if (!wait_TBE(addr)) { printk(KERN_DEBUG PFX "timeout - could not write byte %#x\n", data); return 0; } - while (gscps2_readb_status(ps2port->addr) & GSC_STAT_RBNE) + while (gscps2_readb_status(addr) & GSC_STAT_RBNE) /* wait */; spin_lock_irqsave(&ps2port->lock, flags); @@ -200,13 +200,12 @@ static void gscps2_enable(struct gscps2port *ps2port, int enable) static void gscps2_reset(struct gscps2port *ps2port) { - char *addr = ps2port->addr; unsigned long flags; /* reset the interface */ spin_lock_irqsave(&ps2port->lock, flags); gscps2_flush(ps2port); - writeb(0xff, addr+GSC_RESET); + writeb(0xff, ps2port->addr + GSC_RESET); gscps2_flush(ps2port); spin_unlock_irqrestore(&ps2port->lock, flags); } -- cgit v1.2.3 From c14b302c44f61dce219e1f4026d3c9248e81fbd2 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sat, 24 Mar 2018 21:00:14 +0100 Subject: parisc: Directly call machine_power_off() in power button driver Signed-off-by: Helge Deller Tested-by: Matt Turner --- drivers/parisc/power.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c index e2a3112f1c98..ebaf6867b457 100644 --- a/drivers/parisc/power.c +++ b/drivers/parisc/power.c @@ -95,8 +95,7 @@ static void process_shutdown(void) /* send kill signal */ if (kill_cad_pid(SIGINT, 1)) { /* just in case killing init process failed */ - if (pm_power_off) - pm_power_off(); + machine_power_off(); } } } -- cgit v1.2.3 From b845f66f78bf42a4ce98e5cfe0e94fab41dd0742 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 25 Mar 2018 14:04:22 +0200 Subject: parisc/pci: Switch LBA PCI bus from Hard Fail to Soft Fail mode Carlo Pisani noticed that his C3600 workstation behaved unstable during heavy I/O on the PCI bus with a VIA VT6421 IDE/SATA PCI card. To avoid such instability, this patch switches the LBA PCI bus from Hard Fail mode into Soft Fail mode. In this mode the bus will return -1UL for timed out MMIO transactions, which is exactly how the x86 (and most other architectures) PCI busses behave. This patch is based on a proposal by Grant Grundler and Kyle McMartin 10 years ago: https://www.spinics.net/lists/linux-parisc/msg01027.html Cc: Carlo Pisani Cc: Kyle McMartin Reviewed-by: Grant Grundler Signed-off-by: Helge Deller --- drivers/parisc/lba_pci.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 41b740aed3a3..69bd98421eb1 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -1403,9 +1403,27 @@ lba_hw_init(struct lba_device *d) WRITE_REG32(stat, d->hba.base_addr + LBA_ERROR_CONFIG); } - /* Set HF mode as the default (vs. -1 mode). */ + + /* + * Hard Fail vs. Soft Fail on PCI "Master Abort". + * + * "Master Abort" means the MMIO transaction timed out - usually due to + * the device not responding to an MMIO read. We would like HF to be + * enabled to find driver problems, though it means the system will + * crash with a HPMC. + * + * In SoftFail mode "~0L" is returned as a result of a timeout on the + * pci bus. This is like how PCI busses on x86 and most other + * architectures behave. In order to increase compatibility with + * existing (x86) PCI hardware and existing Linux drivers we enable + * Soft Faul mode on PA-RISC now too. + */ stat = READ_REG32(d->hba.base_addr + LBA_STAT_CTL); +#if defined(ENABLE_HARDFAIL) WRITE_REG32(stat | HF_ENABLE, d->hba.base_addr + LBA_STAT_CTL); +#else + WRITE_REG32(stat & ~HF_ENABLE, d->hba.base_addr + LBA_STAT_CTL); +#endif /* ** Writing a zero to STAT_CTL.rf (bit 0) will clear reset signal -- cgit v1.2.3