Subject: Re: port-alpha/36628: cdhdtape image panics with memory management
To: None <port-alpha-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: netbsd-bugs
Date: 07/16/2007 15:20:03
The following reply was made to PR port-alpha/36628; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: ChristophFranzen@gmx.net
Cc: gnats-bugs@NetBSD.org, port-alpha-maintainer@NetBSD.org,
	tsutsui@ceres.dti.ne.jp
Subject: Re: port-alpha/36628: cdhdtape image panics with memory management
	 trap on Jensen
Date: Tue, 17 Jul 2007 00:17:51 +0900

 ChristophFranzen@gmx.net wrote:
 
 > This one is better, but now looks to me a lot like the bug around 
 > version 1.6 (lpt port issue). I found something in the archives; 
 > Jason Thorpe apparently had fixed something like that in/before 1.6:
 > http://mail-index.netbsd.org/port-alpha/2002/06/26/0003.html
 > I wonder why it has come back, or is this a different issue?
 
 Looks Jason had a fix at that time but he had not committed it.
 
 With a quick glance, lpt at jensenio uses a real eisa interrupt,
 so I guess reverting lpt_jensenio.c rev 1.2 is enough.
 
 Could you try this one?
 http://www.ceres.dti.ne.jp/~tsutsui/netbsd/cdhdtape-20070716.gz
 
 Index: jensenio/lpt_jensenio.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/alpha/jensenio/lpt_jensenio.c,v
 retrieving revision 1.5
 diff -u -r1.5 lpt_jensenio.c
 --- jensenio/lpt_jensenio.c	2 Oct 2002 04:06:38 -0000	1.5
 +++ jensenio/lpt_jensenio.c	16 Jul 2007 15:11:02 -0000
 @@ -71,8 +71,7 @@
  	struct lpt_softc sc_lpt;	/* real "lpt" softc */
  
  	/* Jensen-specific goo. */
 -	char	sc_vecstr[8];
 -	struct evcnt sc_ev_intr;
 +	void	*sc_ih;			/* interrupt handler */
  };
  
  int	lpt_jensenio_match(struct device *, struct cfdata *, void *);
 @@ -81,8 +80,6 @@
  CFATTACH_DECL(lpt_jensenio, sizeof(struct lpt_jensenio_softc),
      lpt_jensenio_match, lpt_jensenio_attach, NULL, NULL);
  
 -void	lpt_jensenio_intr(void *, u_long);
 -
  int
  lpt_jensenio_match(struct device *parent, struct cfdata *match, void *aux)
  {
 @@ -101,6 +98,7 @@
  	struct lpt_jensenio_softc *jsc = (void *)self;
  	struct lpt_softc *sc = &jsc->sc_lpt;
  	struct jensenio_attach_args *ja = aux;
 +	const char *intrstr;
  
  	sc->sc_iot = ja->ja_iot;
  
 @@ -114,20 +112,16 @@
  
  	lpt_attach_subr(sc);
  
 -	scb_set(ja->ja_irq[0], lpt_jensenio_intr, sc);
 -	printf("%s: interrupting at vector 0x%x\n",
 -	    sc->sc_dev.dv_xname, ja->ja_irq[0]);
 -
 -	sprintf(jsc->sc_vecstr, "0x%x", ja->ja_irq[0]);
 -	evcnt_attach_dynamic(&jsc->sc_ev_intr, EVCNT_TYPE_INTR,
 -	    NULL, "vector", jsc->sc_vecstr);
 -}
 -
 -void
 -lpt_jensenio_intr(void *arg, u_long vec)
 -{
 -	struct lpt_jensenio_softc *jsc = arg;
 -
 -	jsc->sc_ev_intr.ev_count++;
 -	(void) lptintr(&jsc->sc_lpt);
 +	intrstr = eisa_intr_string(ja->ja_ec, ja->ja_irq[0]);
 +	jsc->sc_ih = eisa_intr_establish(ja->ja_ec, ja->ja_irq[0],
 +	    IST_EDGE, IPL_TTY, lptintr, sc);
 +	if (jsc->sc_ih == NULL) {
 +		printf("%s: unable to establish interrupt",
 +		    sc->sc_dev.dv_xname);
 +		if (intrstr != NULL)
 +			printf(" at %s", intrstr);
 +		printf("\n");
 +		return;
 +	}
 +	printf("%s: interrupting at %s\n", sc->sc_dev.dv_xname, intrstr);
  }
 
 
 ---
 Izumi Tsutsui