0bbc1fa
diff -up kbd-2.0.4/docs/man/man8/kbdrate.8.orig kbd-2.0.4/docs/man/man8/kbdrate.8
0bbc1fa
--- kbd-2.0.4/docs/man/man8/kbdrate.8.orig	2017-01-11 11:04:50.114831348 +0100
0bbc1fa
+++ kbd-2.0.4/docs/man/man8/kbdrate.8	2017-01-11 11:05:35.619851252 +0100
a975bce
@@ -22,7 +22,7 @@ Using
a975bce
 without any options will reset the repeat rate to 10.9 characters per second (cps)
a975bce
 and the delay to 250 milliseconds (ms) for Intel- and M68K-based systems.
a975bce
 These are the IBM defaults. On SPARC-based systems it will reset the repeat rate
a975bce
-to 5 cps and the delay to 200 ms.
a975bce
+to 20 cps and the delay to 200 ms.
de177d9
 
a975bce
 .SH OPTIONS
a975bce
 .TP
0bbc1fa
diff -up kbd-2.0.4/src/kbdrate.c.orig kbd-2.0.4/src/kbdrate.c
0bbc1fa
--- kbd-2.0.4/src/kbdrate.c.orig	2017-01-11 11:05:10.226840148 +0100
0bbc1fa
+++ kbd-2.0.4/src/kbdrate.c	2017-01-11 11:05:56.832860537 +0100
0bbc1fa
@@ -111,9 +111,12 @@ static int valid_delays[] = { 250, 500,
de177d9
 static int
0bbc1fa
 KDKBDREP_ioctl_ok(double rate, int delay, int silent)
0bbc1fa
 {
de177d9
+#if defined(KDKBDREP) && !defined(__sparc__)
a975bce
 	/*
a975bce
 	 * This ioctl is defined in <linux/kd.h> but is not
a975bce
 	 * implemented anywhere - must be in some m68k patches.
c22c104
+	 * We cannot blindly try unimplemented ioctls on sparc64 -
c22c104
+	 * the 32<->64bit transition layer does not like it.
a975bce
 	 * Since 2.4.9 also on i386.
c22c104
 	 */
a975bce
 	struct my_kbd_repeat kbdrep_s;
0bbc1fa
@@ -176,6 +179,9 @@ KDKBDREP_ioctl_ok(double rate, int delay
0bbc1fa
 		       rate, kbdrep_s.delay);
de177d9
 
0bbc1fa
 	return 1; /* success! */
de177d9
+#else /* no KDKBDREP or __sparc__ */
c22c104
+	return 0;
de177d9
+#endif /* KDKBDREP */
de177d9
 }
de177d9
 
c22c104
 #ifndef KIOCSRATE
0bbc1fa
@@ -226,7 +232,7 @@ sigalrmhandler(int sig __attribute__((un
0bbc1fa
 int main(int argc, char **argv)
0bbc1fa
 {
de177d9
 #ifdef __sparc__
0bbc1fa
-	double rate = 5.0; /* Default rate */
0bbc1fa
+	double rate = 20.0; /* Default rate */
0bbc1fa
 	int delay   = 200; /* Default delay */
de177d9
 #else
0bbc1fa
 	double rate = 10.9; /* Default rate */
0bbc1fa
@@ -275,8 +281,9 @@ int main(int argc, char **argv)
0bbc1fa
 	if (KIOCSRATE_ioctl_ok(rate, delay, silent)) /* sparc? */
f6d95db
 		return 0;
de177d9
 
f6d95db
-	/* The ioport way */
c22c104
+	/* The ioport way - will crash on sparc */
de177d9
 
de177d9
+#ifndef __sparc__
de177d9
 	for (i = 0; i < RATE_COUNT; i++)
de177d9
 		if (rate * 10 >= valid_rates[i]) {
de177d9
 			value &= 0x60;
0bbc1fa
@@ -333,5 +340,6 @@ int main(int argc, char **argv)
0bbc1fa
 		       valid_rates[value & 0x1f] / 10.0,
0bbc1fa
 		       valid_delays[(value & 0x60) >> 5]);
de177d9
 
de177d9
+#endif
f6d95db
 	return EXIT_SUCCESS;
de177d9
 }