From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPMGH-0004zQ-Oa for qemu-devel@nongnu.org; Sun, 16 Mar 2014 21:22:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPMGD-0001V9-1s for qemu-devel@nongnu.org; Sun, 16 Mar 2014 21:22:41 -0400 Received: from [222.73.24.84] (port=41801 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPMGC-0001T3-J3 for qemu-devel@nongnu.org; Sun, 16 Mar 2014 21:22:36 -0400 Message-ID: <1395019021.2364.2.camel@localhost> From: Li Guang Date: Mon, 17 Mar 2014 09:17:01 +0800 In-Reply-To: <1394888493-20487-3-git-send-email-b.galvani@gmail.com> References: <1394888493-20487-1-git-send-email-b.galvani@gmail.com> <1394888493-20487-3-git-send-email-b.galvani@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PATCH v3 2/7] allwinner-a10-pic: fix behaviour of pending register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Beniamino Galvani Cc: Peter Maydell , Peter Crosthwaite , qemu-devel@nongnu.org =E5=9C=A8 2014-03-15=E5=85=AD=E7=9A=84 14:01 +0100=EF=BC=8CBeniamino Galvan= i=E5=86=99=E9=81=93=EF=BC=9A > The pending register is read-only and the value returned upon a read > reflects the state of irq input pins (interrupts are level triggered). > This patch implements such behaviour. >=20 > Signed-off-by: Beniamino Galvani Reviewed-by: Li Guang > --- > hw/intc/allwinner-a10-pic.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/intc/allwinner-a10-pic.c b/hw/intc/allwinner-a10-pic.c > index 00f3c11..0924d98 100644 > --- a/hw/intc/allwinner-a10-pic.c > +++ b/hw/intc/allwinner-a10-pic.c > @@ -49,6 +49,8 @@ static void aw_a10_pic_set_irq(void *opaque, int irq, i= nt level) > =20 > if (level) { > set_bit(irq % 32, (void *)&s->irq_pending[irq / 32]); > + } else { > + clear_bit(irq % 32, (void *)&s->irq_pending[irq / 32]); > } > aw_a10_pic_update(s); > } > @@ -102,7 +104,11 @@ static void aw_a10_pic_write(void *opaque, hwaddr of= fset, uint64_t value, > s->nmi =3D value; > break; > case AW_A10_PIC_IRQ_PENDING ... AW_A10_PIC_IRQ_PENDING + 8: > - s->irq_pending[index] &=3D ~value; > + /* > + * The register is read-only; nevertheless, Linux (including > + * the version originally shipped by Allwinner) pretends to > + * write to the register. Just ignore it. > + */ > break; > case AW_A10_PIC_FIQ_PENDING ... AW_A10_PIC_FIQ_PENDING + 8: > s->fiq_pending[index] &=3D ~value;