NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-evbarm/56420: panic: kernel diagnostic assertion "ipl > ci->ci_cpl" failed:



The following reply was made to PR port-evbarm/56420; it has been noted by GNATS.

From: Michael Cheponis <michael.cheponis%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: port-evbarm-maintainer%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, 
	netbsd-bugs%netbsd.org@localhost, mac%culver.net@localhost
Subject: Re: port-evbarm/56420: panic: kernel diagnostic assertion "ipl >
 ci->ci_cpl" failed:
Date: Sun, 3 Oct 2021 22:53:59 -0700

 --0000000000002fb34e05cd808c51
 Content-Type: text/plain; charset="UTF-8"
 
 I'm now running with this patch.  Will update should another crash occur.
 
 -Mike
 
 On Sat, Oct 2, 2021 at 2:45 PM Nick Hudson <nick.hudson%gmx.co.uk@localhost> wrote:
 
 > The following reply was made to PR port-evbarm/56420; it has been noted by
 > GNATS.
 >
 > From: Nick Hudson <nick.hudson%gmx.co.uk@localhost>
 > To: gnats-bugs%netbsd.org@localhost, port-evbarm-maintainer%netbsd.org@localhost,
 >  gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
 > Cc:
 > Subject: Re: port-evbarm/56420: panic: kernel diagnostic assertion "ipl >
 >  ci->ci_cpl" failed:
 > Date: Sat, 2 Oct 2021 22:00:07 +0100
 >
 >  This is a multi-part message in MIME format.
 >  --------------4E32A988B14E023BF3AFE3CD
 >  Content-Type: text/plain; charset=utf-8; format=flowed
 >  Content-Transfer-Encoding: 7bit
 >
 >  On 29/09/2021 06:50, mac%culver.net@localhost wrote:
 >  >> Number:         56420
 >  >> Category:       port-evbarm
 >  >> Synopsis:       when system is idle,  panic: kernel diagnostic
 > assertion "ipl > ci->ci_cpl" failed: file "/src/sys/arch/arm/cortex/gic.c",
 > line 381 ipl 7 cpl 7 hw-ipl 0x90
 >
 >  Please try this patch
 >
 >  Thanks,
 >  Nick
 >
 >
 >  --------------4E32A988B14E023BF3AFE3CD
 >  Content-Type: text/x-patch; charset=UTF-8;
 >   name="pr56420.diff"
 >  Content-Transfer-Encoding: quoted-printable
 >  Content-Disposition: attachment;
 >   filename="pr56420.diff"
 >
 >  Index: sys/arch/arm/cortex/gic.c
 >  =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 >  =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 >  =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 >  RCS file: /cvsroot/src/sys/arch/arm/cortex/gic.c,v
 >  retrieving revision 1.50
 >  diff -u -p -r1.50 gic.c
 >  =2D-- sys/arch/arm/cortex/gic.c        26 Sep 2021 13:38:50 -0000
 > 1.50
 >  +++ sys/arch/arm/cortex/gic.c  2 Oct 2021 20:57:52 -0000
 >  @@ -331,9 +331,17 @@ armgic_irq_handler(void *tf)
 >
 >         ci->ci_data.cpu_nintr++;
 >
 >  -      if (ci->ci_hwpl !=3D old_ipl) {
 >  +      /*
 >  +       * Raise ci_hwpl (and PMR) to ci_cpl and IAR will tell us if the
 >  +       * interrupt that got us here can have its handler run or not.
 >  +       */
 >  +      if (ci->ci_hwpl <=3D old_ipl) {
 >                 ci->ci_hwpl =3D old_ipl;
 >                 gicc_write(sc, GICC_PMR, armgic_ipl_to_priority(old_ipl));
 >  +              /*
 >  +               * we'll get no interrupts when PMR is IPL_HIGH, so bail
 >  +               * early.
 >  +               */
 >                 if (old_ipl =3D=3D IPL_HIGH) {
 >                         return;
 >                 }
 >  @@ -373,11 +381,13 @@ armgic_irq_handler(void *tf)
 >                  *
 >                  * However, if are just raising ipl, we can just update
 > ci_cpl.
 >                  */
 >  +
 >  +              /* Surely we can KASSERT(ipl < ci->ci_cpl); */
 >                 const int ipl =3D is->is_ipl;
 >                 if (__predict_false(ipl < ci->ci_cpl)) {
 >                         pic_do_pending_ints(I32_bit, ipl, tf);
 >                         KASSERT(ci->ci_cpl =3D=3D ipl);
 >  -              } else {
 >  +              } else if (ci->ci_cpl !=3D ipl) {
 >                         KASSERTMSG(ipl > ci->ci_cpl, "ipl %d cpl %d hw-ipl
 > %#x",
 >                             ipl, ci->ci_cpl,
 >                             gicc_read(sc, GICC_PMR));
 >
 >
 >  --------------4E32A988B14E023BF3AFE3CD--
 >
 >
 
 --0000000000002fb34e05cd808c51
 Content-Type: text/html; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable
 
 <div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,he=
 lvetica,sans-serif;font-size:small">I&#39;m now running with this patch.=C2=
 =A0 Will update should another crash occur.</div><div class=3D"gmail_defaul=
 t" style=3D"font-family:arial,helvetica,sans-serif;font-size:small"><br></d=
 iv><div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-s=
 erif;font-size:small">-Mike</div></div><br><div class=3D"gmail_quote"><div =
 dir=3D"ltr" class=3D"gmail_attr">On Sat, Oct 2, 2021 at 2:45 PM Nick Hudson=
  &lt;<a href=3D"mailto:nick.hudson%gmx.co.uk@localhost";>nick.hudson%gmx.co.uk@localhost</a>&gt;=
  wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The foll=
 owing reply was made to PR port-evbarm/56420; it has been noted by GNATS.<b=
 r>
 <br>
 From: Nick Hudson &lt;<a href=3D"mailto:nick.hudson%gmx.co.uk@localhost"; target=3D"_b=
 lank">nick.hudson%gmx.co.uk@localhost</a>&gt;<br>
 To: <a href=3D"mailto:gnats-bugs%netbsd.org@localhost"; target=3D"_blank">gnats-bugs@n=
 etbsd.org</a>, <a href=3D"mailto:port-evbarm-maintainer%netbsd.org@localhost"; target=
 =3D"_blank">port-evbarm-maintainer%netbsd.org@localhost</a>,<br>
 =C2=A0<a href=3D"mailto:gnats-admin%netbsd.org@localhost"; target=3D"_blank">gnats-adm=
 in%netbsd.org@localhost</a>, <a href=3D"mailto:netbsd-bugs%netbsd.org@localhost"; target=3D"_bla=
 nk">netbsd-bugs%netbsd.org@localhost</a><br>
 Cc: <br>
 Subject: Re: port-evbarm/56420: panic: kernel diagnostic assertion &quot;ip=
 l &gt;<br>
 =C2=A0ci-&gt;ci_cpl&quot; failed:<br>
 Date: Sat, 2 Oct 2021 22:00:07 +0100<br>
 <br>
 =C2=A0This is a multi-part message in MIME format.<br>
 =C2=A0--------------4E32A988B14E023BF3AFE3CD<br>
 =C2=A0Content-Type: text/plain; charset=3Dutf-8; format=3Dflowed<br>
 =C2=A0Content-Transfer-Encoding: 7bit<br>
 <br>
 =C2=A0On 29/09/2021 06:50, <a href=3D"mailto:mac%culver.net@localhost"; target=3D"_bla=
 nk">mac%culver.net@localhost</a> wrote:<br>
 =C2=A0&gt;&gt; Number:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A056420<br>
 =C2=A0&gt;&gt; Category:=C2=A0 =C2=A0 =C2=A0 =C2=A0port-evbarm<br>
 =C2=A0&gt;&gt; Synopsis:=C2=A0 =C2=A0 =C2=A0 =C2=A0when system is idle,=C2=
 =A0 panic: kernel diagnostic assertion &quot;ipl &gt; ci-&gt;ci_cpl&quot; f=
 ailed: file &quot;/src/sys/arch/arm/cortex/gic.c&quot;, line 381 ipl 7 cpl =
 7 hw-ipl 0x90<br>
 <br>
 =C2=A0Please try this patch<br>
 <br>
 =C2=A0Thanks,<br>
 =C2=A0Nick<br>
 <br>
 <br>
 =C2=A0--------------4E32A988B14E023BF3AFE3CD<br>
 =C2=A0Content-Type: text/x-patch; charset=3DUTF-8;<br>
 =C2=A0 name=3D&quot;pr56420.diff&quot;<br>
 =C2=A0Content-Transfer-Encoding: quoted-printable<br>
 =C2=A0Content-Disposition: attachment;<br>
 =C2=A0 filename=3D&quot;pr56420.diff&quot;<br>
 <br>
 =C2=A0Index: sys/arch/arm/cortex/gic.c<br>
 =C2=A0=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3=
 D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D<br>
 =C2=A0=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3=
 D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D<br>
 =C2=A0=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3=
 D=3D3D=3D3D=3D3D=3D3D=3D3D<br>
 =C2=A0RCS file: /cvsroot/src/sys/arch/arm/cortex/gic.c,v<br>
 =C2=A0retrieving revision 1.50<br>
 =C2=A0diff -u -p -r1.50 gic.c<br>
 =C2=A0=3D2D-- sys/arch/arm/cortex/gic.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 26 Sep 2=
 021 13:38:50 -0000=C2=A0 =C2=A0 =C2=A0 1.50<br>
 =C2=A0+++ sys/arch/arm/cortex/gic.c=C2=A0 2 Oct 2021 20:57:52 -0000<br>
 =C2=A0@@ -331,9 +331,17 @@ armgic_irq_handler(void *tf)<br>
 <br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ci-&gt;ci_data.cpu_nintr++;<br>
 <br>
 =C2=A0-=C2=A0 =C2=A0 =C2=A0 if (ci-&gt;ci_hwpl !=3D3D old_ipl) {<br>
 =C2=A0+=C2=A0 =C2=A0 =C2=A0 /*<br>
 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0* Raise ci_hwpl (and PMR) to ci_cpl and I=
 AR will tell us if the<br>
 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0* interrupt that got us here can have its=
  handler run or not.<br>
 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
 =C2=A0+=C2=A0 =C2=A0 =C2=A0 if (ci-&gt;ci_hwpl &lt;=3D3D old_ipl) {<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ci-&gt;ci_hwpl =3D3=
 D old_ipl;<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gicc_write(sc, GICC=
 _PMR, armgic_ipl_to_priority(old_ipl));<br>
 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*<br>
 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* we&#39;ll g=
 et no interrupts when PMR is IPL_HIGH, so bail<br>
 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* early.<br>
 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (old_ipl =3D3D=
 =3D3D IPL_HIGH) {<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
 =A0 =C2=A0 return;<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
 =C2=A0@@ -373,11 +381,13 @@ armgic_irq_handler(void *tf)<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* However, if=
  are just raising ipl, we can just update ci_cpl.<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>
 =C2=A0+<br>
 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Surely we can KA=
 SSERT(ipl &lt; ci-&gt;ci_cpl); */<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 const int ipl =3D3D=
  is-&gt;is_ipl;<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (__predict_false=
 (ipl &lt; ci-&gt;ci_cpl)) {<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
 =A0 =C2=A0 pic_do_pending_ints(I32_bit, ipl, tf);<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
 =A0 =C2=A0 KASSERT(ci-&gt;ci_cpl =3D3D=3D3D ipl);<br>
 =C2=A0-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else {<br>
 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else if (ci-&gt;c=
 i_cpl !=3D3D ipl) {<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
 =A0 =C2=A0 KASSERTMSG(ipl &gt; ci-&gt;ci_cpl, &quot;ipl %d cpl %d hw-ipl %#=
 x&quot;,<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
 =A0 =C2=A0 =C2=A0 =C2=A0 ipl, ci-&gt;ci_cpl,<br>
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
 =A0 =C2=A0 =C2=A0 =C2=A0 gicc_read(sc, GICC_PMR));<br>
 <br>
 <br>
 =C2=A0--------------4E32A988B14E023BF3AFE3CD--<br>
 <br>
 </blockquote></div>
 
 --0000000000002fb34e05cd808c51--
 



Home | Main Index | Thread Index | Old Index