On Thu, Jan 07, 2016 at 10:19:55PM +0100, Mark Kettenis wrote:
> The sensible default polarity is active-low for level-triggered
> interrupts whereas it is active-high for edge-triggered ones.  We do
> this correctly when the BIOS explicitly tells us that it wants
> defaults.  But we also should do it when the BIOS gives us no
> information.  Fortunately this is easy.
> 
> jcs@ needs this for his i2c touchpad stuff.
> 
> ok?

makes sense. no objections. Probably needs a fair bit of testing.

-ml

> 
> 
> Index: i386/i386/ioapic.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/i386/i386/ioapic.c,v
> retrieving revision 1.37
> diff -u -p -r1.37 ioapic.c
> --- i386/i386/ioapic.c        8 Sep 2015 07:12:56 -0000       1.37
> +++ i386/i386/ioapic.c        7 Jan 2016 21:01:57 -0000
> @@ -448,7 +448,7 @@ apic_set_redir(struct ioapic_softc *sc, 
>                       redlo |= IOAPIC_REDLO_LEVEL;
>               else
>                       redlo &= ~IOAPIC_REDLO_LEVEL;
> -             if (map != NULL && ((map->flags & 3) == MPS_INTPO_DEF)) {
> +             if (map == NULL || ((map->flags & 3) == MPS_INTPO_DEF)) {
>                       if (pp->ip_type == IST_LEVEL)
>                               redlo |= IOAPIC_REDLO_ACTLO;
>                       else
> Index: amd64/amd64/ioapic.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/amd64/amd64/ioapic.c,v
> retrieving revision 1.23
> diff -u -p -r1.23 ioapic.c
> --- amd64/amd64/ioapic.c      14 Mar 2015 03:38:46 -0000      1.23
> +++ amd64/amd64/ioapic.c      7 Jan 2016 21:01:57 -0000
> @@ -429,7 +429,7 @@ apic_set_redir(struct ioapic_softc *sc, 
>                       redlo |= IOAPIC_REDLO_LEVEL;
>               else
>                       redlo &= ~IOAPIC_REDLO_LEVEL;
> -             if (map != NULL && ((map->flags & 3) == MPS_INTPO_DEF)) {
> +             if (map == NULL || ((map->flags & 3) == MPS_INTPO_DEF)) {
>                       if (pp->ip_type == IST_LEVEL)
>                               redlo |= IOAPIC_REDLO_ACTLO;
>                       else
> 

Reply via email to