matthew green | 12 Feb 2011 03:51
Picon
Favicon

re: powerfail interrupt (Re: Netra X1 with WD0 and AcerIDE)


> One solution is to check the machine model when installing the
> interrupt handler. So I would like to commit the following patch if
> anyone have no objection.

please commit.

> -- Takeshi Nakayama
> 
> Index: dev/psycho.c
> ===================================================================
> RCS file: /cvsroot/src/sys/arch/sparc64/dev/psycho.c,v
> retrieving revision 1.101
> diff -u -d -r1.101 psycho.c
> --- dev/psycho.c	10 Jul 2010 10:07:40 -0000	1.101
> +++ dev/psycho.c	11 Feb 2011 22:35:54 -0000
>  <at>  <at>  -299,6 +299,7  <at>  <at> 
>  	int psycho_br[2], n, i;
>  	bus_space_handle_t pci_ctl;
>  	char *model = prom_getpropstring(ma->ma_node, "model");
> +	extern char machine_model[];

eeh:

sparc64/autoconf.c:   OF_getprop(findroot(), "name", machine_model, sizeof machine_model);

>  	aprint_normal("\n");
>  
>  <at>  <at>  -527,10 +528,15  <at>  <at> 
>  		psycho_set_intr(sc, 15, psycho_bus_a,
>  			&sc->sc_regs->pciaerr_int_map,
>  			&sc->sc_regs->pciaerr_clr_int);
> -		psycho_set_intr(sc, 15, psycho_powerfail,
> -			&sc->sc_regs->power_int_map,
> -			&sc->sc_regs->power_clr_int);
> -		psycho_register_power_button(sc);
> +		/*
> +		 * Netra X1 may hang when the powerfail interrupt is enabled.
> +		 */
> +		if (strcmp(machine_model, "SUNW,UltraAX-i2") != 0) {
> +			psycho_set_intr(sc, 15, psycho_powerfail,
> +				&sc->sc_regs->power_int_map,
> +				&sc->sc_regs->power_clr_int);
> +			psycho_register_power_button(sc);
> +		}
>  		if (sc->sc_mode != PSYCHO_MODE_SABRE) {
>  			/* sabre doesn't have these interrupts */
>  			psycho_set_intr(sc, 15, psycho_bus_b,

.mrg.


Gmane