From owner-freebsd-bugs Wed Aug 25 14:50:11 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 04BE315CB7 for ; Wed, 25 Aug 1999 14:50:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id OAA32718; Wed, 25 Aug 1999 14:50:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (Postfix) with SMTP id F362115385 for ; Wed, 25 Aug 1999 14:49:31 -0700 (PDT) (envelope-from jeremyp@gsmx07.alcatel.com.au) Received: by border.alcanet.com.au id <40323>; Thu, 26 Aug 1999 07:46:15 +1000 Message-Id: <99Aug26.074615est.40323@border.alcanet.com.au> Date: Thu, 26 Aug 1999 07:47:22 +1000 From: Peter Jeremy Reply-To: peter.jeremy@alcatel.com.au To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/13382: Only 1 parallel port supported if pps enabled Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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