Received: from eggs.gnu.org ([2001:4830:134:3::10]:51384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ae6E1-0004Gs-Gw for qemu-devel@nongnu.org; Thu, 10 Mar 2016 14:26:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ae6Dw-0001e8-5n for qemu-devel@nongnu.org; Thu, 10 Mar 2016 14:26:21 -0500 Received: from zose-mta05.web4all.fr ([185.49.20.50]:60177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ae6Dw-0001cm-01 for qemu-devel@nongnu.org; Thu, 10 Mar 2016 14:26:16 -0500 References: From: Jean-Christophe DUBOIS Message-ID: <56E1CA55.5030509@tribudubois.net> Date: Thu, 10 Mar 2016 20:26:13 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 10/12] i.MX: Add the Freescale SPI Controller List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Peter Crosthwaite Le 10/03/2016 11:31, Peter Maydell a =C3=A9crit : > On 2 March 2016 at 05:27, Jean-Christophe Dubois = wrote: >> Signed-off-by: Jean-Christophe Dubois >> --- >> >> + >> +static void imx_spi_reset(DeviceState *dev) >> +{ >> + IMXSPIState *s =3D IMX_SPI(dev); >> + int i; >> + >> + DPRINTF("\n"); >> + >> + memset(s->regs, 0, sizeof(s->regs)); >> + >> + s->regs[ECSPI_STATREG] =3D 0x00000003; >> + >> + imx_spi_rxfifo_reset(s); >> + imx_spi_txfifo_reset(s); >> + >> + imx_spi_update_irq(s); >> + >> + s->burst_length =3D 0; >> + >> + for (i =3D 0; i < 4; i++) { >> + qemu_set_irq(s->cs_lines[i], 0); >> + } > Calling qemu_set_irq() from a reset function is generally > a bad idea. Could I assume that all irq lines are set automatically to 0 on reset? > >> +} > Otherwise > Reviewed-by: Peter Maydell > > thanks > -- PMM >