Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* 2.2.3: SCSI CDROM kernel panic
@ 1999-03-19 20:42 Nils Faerber
  1999-03-26 21:31 ` Nikita Schmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Nils Faerber @ 1999-03-19 20:42 UTC (permalink / raw)
  To: axp-list

Hello!
Maybe this has been asked before but I just have overseen it because I did
not have that problem ... anyway:
  I just compiled and install kernel 2.2.3 and noticed that insmodding the
SCSI cdrom driver causes my machine to crash immediately with a kernel
panic! In case of interest I can try to figure out where it burns. In case
this probelm is already solved could someone please tell the solution to me
(again)?
Thanks!
CU
  nils

-- 
Nils Faerber (Linux Nils)        eMail: nils@unix-ag.org
Student of computer science      http://www.si.unix-ag.org/~nils/
Unix user group, University of Siegen, Germany

Siegen ... the arctic rain forest!
--


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 2.2.3: SCSI CDROM kernel panic
  1999-03-19 20:42 2.2.3: SCSI CDROM kernel panic Nils Faerber
@ 1999-03-26 21:31 ` Nikita Schmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Nikita Schmidt @ 1999-03-26 21:31 UTC (permalink / raw)
  To: axp-list

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

On Friday, 19 Mar, Nils Faerber wrote:
>   I just compiled and install kernel 2.2.3 and noticed that insmodding the
> SCSI cdrom driver causes my machine to crash immediately with a kernel
> panic!

I found that as well.  It looks like a bug in recenly changed semaphore.h.
I came up with a patch that seems to fix it (although formally may
produce faulty code as well...) - see attached.

The problem is in the inline asm, which references a global symbol, thus
using gp, assuming it has been provided by the function's entry code.
The patch fixes only the 'up' function, which causes problems in
sr_ioctl.c, but several other functions from semaphore.h need similar
treatment as well.

I think Richard Henderson, who I believe wrote that code in semaphore.h,
can think of a better solution.

Nikita

[-- Attachment #2: semaphore.diff --]
[-- Type: text/plain, Size: 926 bytes --]

--- linux-2.2.4/include/asm-alpha/semaphore.h.orig	Fri Mar 26 20:26:59 1999
+++ linux-2.2.4/include/asm-alpha/semaphore.h	Fri Mar 26 21:03:08 1999
@@ -167,25 +167,27 @@
 	   it's return address in $28.  The pv is loaded as usual.
 	   The gp is clobbered (in the module case) as usual.  */
 
+	register void *pv __asm__ ("$27") = __up_wakeup;
+
 	__asm__ __volatile__ (
 		"/* semaphore up operation */\n"
 		"	mb\n"
-		"1:	ldl_l	$27,%0\n"
-		"	addl	$27,1,$27\n"
-		"	mov	$27,$28\n"
+		"1:	ldl_l	$24,%0\n"
+		"	addl	$24,1,$24\n"
+		"	mov	$24,$28\n"
 		"	stl_c	$28,%0\n"
 		"	beq	$28,2f\n"
 		"	mb\n"
-		"	ble	$27,3f\n"
+		"	ble	$24,3f\n"
 		"4:\n"
 		".section .text2,\"ax\"\n"
 		"2:	br	1b\n"
 		"3:	lda	$24,%0\n"
-		"	jsr	$28,__up_wakeup\n"
+		"	jsr	$28,(%1),__up_wakeup\n"
 		"	ldgp	$29,0($28)\n"
 		"	br	4b\n"
 		".previous"
-		: : "m"(sem->count)
+		: : "m"(sem->count), "r"(pv)
 		: "$24", "$27", "$28", "memory");
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-03-26 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-19 20:42 2.2.3: SCSI CDROM kernel panic Nils Faerber
1999-03-26 21:31 ` Nikita Schmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox