Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Aug 1999 07:47:22 +1000
From:      Peter Jeremy <jeremyp@gsmx07.alcatel.com.au>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   kern/13382: Only 1 parallel port supported if pps enabled
Message-ID:  <99Aug26.074615est.40323@border.alcanet.com.au>

next in thread | raw e-mail | index | archive | help

>Number:         13382
>Category:       kern
>Synopsis:       Only 1 parallel port supported if pps enabled
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 25 14:50:02 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Peter Jeremy
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
Alcatel Australia Limited
>Environment:

	486DX2-50 running 3.2-RELEASE (cvs RELENG_3_2_0_RELEASE) with
	4 parallel ports.  The relevant code hasn't changed in
	RELENG_3, but appears to be fixed in -CURRENT (as a side-effect
	of phk's cdevsw update).

>Description:

	When multiple parallel ports (ppc) are enabled in a kernel,
	and device pps is enabled, the kernel panics `page not
	present' trying to dereference *softc[npps] in ppsprobe().

	This is because only 1 PPS device is configured (pps.c
	dimensions softc to NPPS, which config sets to 1 because it
	only sees pps0), but it will be proved for each ppc
	configured.  The other ppbus devices are kludged to support
	8 ppc devices.

	(And as a side issue, it would be nide to be able to tie
	the ppbus devices to specific ppc devices - eg you're
	unlikely to actually have more than one vpo or pps, and
	they're likely to be fixed on different ports, which
	are unlikely to be used for eg lpt or plip).

>How-To-Repeat:

	Create a kernel config file including the following.  Compile,
	install and reboot.  

device		ppc0	at isa? port "IO_LPT1" tty irq 7
device		ppc1	at isa? port "IO_LPT2" tty irq 5
device		ppc2	at isa? port 0x26c tty irq 12
device		ppc3	at isa? port 0x268 tty irq 15

controller	ppbus0
device		lpt0	at ppbus?
device		plip0	at ppbus?
device		ppi0	at ppbus?
device		pps0	at ppbus?


>Fix:
	
	The following patch brings pps.c into line with the other
	ppbus devices.

Index: pps.c
===================================================================
RCS file: /home/CVSROOT/src/sys/dev/ppbus/pps.c,v
retrieving revision 1.12.2.1
diff -u -r1.12.2.1 pps.c
--- pps.c	1999/03/22 13:09:34	1.12.2.1
+++ pps.c	1999/08/25 21:26:35
@@ -32,13 +32,15 @@
 
 #define PPS_NAME	"lppps"		/* our official name */
 
-static struct pps_data {
+struct pps_data {
 	int	pps_unit;
 	struct	ppb_device pps_dev;	
 	struct	pps_state pps;
-} *softc[NPPS];
+};
 
-static int npps;
+#define MAXPPS		8		/* XXX not much better! */
+static int		npps = 0;
+static struct pps_data	*softc[MAXPPS];
 
 /*
  * Make ourselves visible as a ppbus driver

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99Aug26.074615est.40323>