Skip to content

Commit 0587402

Browse files
committed
Merge tag 'sparc-for-7.2-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/alarsson/linux-sparc
Pull sparc updates from Andreas Larsson: - Align sparc to other archs by providing ucontext.h wrapper - Fix buffer underflow in led driver - Export mcount for clang and disable compat when using lld for linking - API choice improvement for sysfs code for vio - Fix build warnings and notification of missing prototype - Remove dead code and dead configs * tag 'sparc-for-7.2-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/alarsson/linux-sparc: sparc: Remove remaining defconfig references to the pktcdvd driver sparc: led: avoid trimming a newline from empty writes sparc: Export mcount for Clang-built modules sparc: Disable compat support with LLD sparc: Avoid -Wunused-but-set-parameter in clear_user_page() sparc: add _mcount() prototype sparc64: uprobes: add missing break sparc: remove unused SERIAL_CONSOLE config option sparc32: remove deadwood swift_flush_tlb_page() debug code sparc: uapi: Add ucontext.h sparc: vio: use sysfs_emit in sysfs show functions
2 parents 6535a84 + 5b2a3b1 commit 0587402

10 files changed

Lines changed: 16 additions & 60 deletions

File tree

arch/sparc/Kconfig

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -326,30 +326,6 @@ config SPARC_LED
326326
by reading /proc/led and its blinking mode can be changed
327327
via writes to /proc/led
328328

329-
config SERIAL_CONSOLE
330-
bool
331-
depends on SPARC32
332-
default y
333-
help
334-
If you say Y here, it will be possible to use a serial port as the
335-
system console (the system console is the device which receives all
336-
kernel messages and warnings and which allows logins in single user
337-
mode). This could be useful if some terminal or printer is connected
338-
to that serial port.
339-
340-
Even if you say Y here, the currently visible virtual console
341-
(/dev/tty0) will still be used as the system console by default, but
342-
you can alter that using a kernel command line option such as
343-
"console=ttyS1". (Try "man bootparam" or see the documentation of
344-
your boot loader (silo) about how to pass options to the kernel at
345-
boot time.)
346-
347-
If you don't have a graphics card installed and you say Y here, the
348-
kernel will automatically use the first serial line, /dev/ttyS0, as
349-
system console.
350-
351-
If unsure, say N.
352-
353329
config SPARC_LEON
354330
bool "Sparc Leon processor family"
355331
depends on SPARC32
@@ -473,6 +449,7 @@ endmenu
473449
config COMPAT
474450
bool
475451
depends on SPARC64
452+
depends on !LD_IS_LLD
476453
default y
477454
select HAVE_UID16
478455
select ARCH_WANT_OLD_COMPAT_IPC

arch/sparc/configs/sparc64_defconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ CONFIG_CONNECTOR=m
6060
CONFIG_BLK_DEV_LOOP=m
6161
CONFIG_BLK_DEV_CRYPTOLOOP=m
6262
CONFIG_BLK_DEV_NBD=m
63-
CONFIG_CDROM_PKTCDVD=m
64-
CONFIG_CDROM_PKTCDVD_WCACHE=y
6563
CONFIG_ATA_OVER_ETH=m
6664
CONFIG_SUNVDC=m
6765
CONFIG_ATA=y

arch/sparc/include/asm/asm-prototypes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ void *memcpy(void *dest, const void *src, size_t n);
2525
void *memset(void *s, int c, size_t n);
2626
typedef int TItype __attribute__((mode(TI)));
2727
TItype __multi3(TItype a, TItype b);
28+
void _mcount(void);
29+
void mcount(void);
2830

2931
s64 __ashldi3(s64, int);
3032
s64 __lshrdi3(s64, int);

arch/sparc/include/asm/page_32.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
#define clear_user_page(addr, vaddr, page) \
2121
do { clear_page(addr); \
2222
sparc_flush_page_to_ram(page); \
23+
(void)(vaddr); \
2324
} while (0)
2425
#define copy_user_page(to, from, vaddr, page) \
2526
do { copy_page(to, from); \
2627
sparc_flush_page_to_ram(page); \
28+
(void)(vaddr); \
2729
} while (0)
2830

2931
/* The following structure is used to hold the physical
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+
3+
#include <asm/uctx.h>

arch/sparc/kernel/led.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static ssize_t led_proc_write(struct file *file, const char __user *buffer,
7878
return PTR_ERR(buf);
7979

8080
/* work around \n when echo'ing into proc */
81-
if (buf[count - 1] == '\n')
81+
if (count > 0 && buf[count - 1] == '\n')
8282
buf[count - 1] = '\0';
8383

8484
/* before we change anything we want to stop any running timers,

arch/sparc/kernel/uprobes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ int arch_uprobe_exception_notify(struct notifier_block *self,
280280
case DIE_SSTEP:
281281
if (uprobe_post_sstep_notifier(args->regs))
282282
ret = NOTIFY_STOP;
283+
break;
283284

284285
default:
285286
break;

arch/sparc/kernel/vio.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/kernel.h>
1414
#include <linux/slab.h>
1515
#include <linux/string.h>
16+
#include <linux/sysfs.h>
1617
#include <linux/irq.h>
1718
#include <linux/export.h>
1819
#include <linux/init.h>
@@ -121,15 +122,15 @@ static ssize_t devspec_show(struct device *dev,
121122
else if (!strcmp(vdev->type, "vdc-port"))
122123
str = "vdisk";
123124

124-
return sprintf(buf, "%s\n", str);
125+
return sysfs_emit(buf, "%s\n", str);
125126
}
126127
static DEVICE_ATTR_RO(devspec);
127128

128129
static ssize_t type_show(struct device *dev,
129130
struct device_attribute *attr, char *buf)
130131
{
131132
struct vio_dev *vdev = to_vio_dev(dev);
132-
return sprintf(buf, "%s\n", vdev->type);
133+
return sysfs_emit(buf, "%s\n", vdev->type);
133134
}
134135
static DEVICE_ATTR_RO(type);
135136

@@ -138,7 +139,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
138139
{
139140
const struct vio_dev *vdev = to_vio_dev(dev);
140141

141-
return sprintf(buf, "vio:T%sS%s\n", vdev->type, vdev->compat);
142+
return sysfs_emit(buf, "vio:T%sS%s\n", vdev->type, vdev->compat);
142143
}
143144
static DEVICE_ATTR_RO(modalias);
144145

@@ -192,7 +193,7 @@ show_pciobppath_attr(struct device *dev, struct device_attribute *attr,
192193
vdev = to_vio_dev(dev);
193194
dp = vdev->dp;
194195

195-
return scnprintf(buf, PAGE_SIZE, "%pOF\n", dp);
196+
return sysfs_emit(buf, "%pOF\n", dp);
196197
}
197198

198199
static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH,

arch/sparc/lib/mcount.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
EXPORT_SYMBOL(_mcount)
2222
.globl mcount
2323
.type mcount,#function
24+
EXPORT_SYMBOL(mcount)
2425
_mcount:
2526
mcount:
2627
#ifdef CONFIG_FUNCTION_TRACER

arch/sparc/mm/srmmu.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -581,35 +581,6 @@ extern void swift_flush_tlb_range(struct vm_area_struct *vma,
581581
unsigned long start, unsigned long end);
582582
extern void swift_flush_tlb_page(struct vm_area_struct *vma, unsigned long page);
583583

584-
#if 0 /* P3: deadwood to debug precise flushes on Swift. */
585-
void swift_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
586-
{
587-
int cctx, ctx1;
588-
589-
page &= PAGE_MASK;
590-
if ((ctx1 = vma->vm_mm->context) != -1) {
591-
cctx = srmmu_get_context();
592-
/* Is context # ever different from current context? P3 */
593-
if (cctx != ctx1) {
594-
printk("flush ctx %02x curr %02x\n", ctx1, cctx);
595-
srmmu_set_context(ctx1);
596-
swift_flush_page(page);
597-
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
598-
"r" (page), "i" (ASI_M_FLUSH_PROBE));
599-
srmmu_set_context(cctx);
600-
} else {
601-
/* Rm. prot. bits from virt. c. */
602-
/* swift_flush_cache_all(); */
603-
/* swift_flush_cache_page(vma, page); */
604-
swift_flush_page(page);
605-
606-
__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
607-
"r" (page), "i" (ASI_M_FLUSH_PROBE));
608-
/* same as above: srmmu_flush_tlb_page() */
609-
}
610-
}
611-
}
612-
#endif
613584

614585
/*
615586
* The following are all MBUS based SRMMU modules, and therefore could

0 commit comments

Comments
 (0)