From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z10ba-0006F1-OI for qemu-devel@nongnu.org; Fri, 05 Jun 2015 19:00:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z10bX-0000D9-Ig for qemu-devel@nongnu.org; Fri, 05 Jun 2015 19:00:50 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:37555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z10bX-0000D2-4X for qemu-devel@nongnu.org; Fri, 05 Jun 2015 19:00:47 -0400 Received: by igbsb11 with SMTP id sb11so25189154igb.0 for ; Fri, 05 Jun 2015 16:00:46 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1432814996-13464-1-git-send-email-peter.maydell@linaro.org> <1432814996-13464-4-git-send-email-peter.maydell@linaro.org> From: Peter Maydell Date: Sat, 6 Jun 2015 00:00:26 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 3/5] hw/arm/pxa2xx: Add reset method for pxa2xx_ssp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: "qemu-devel@nongnu.org Developers" , Patch Tracking On 5 June 2015 at 23:57, Peter Crosthwaite wrote: > On Thu, May 28, 2015 at 5:09 AM, Peter Maydell wrote: >> The pxa2xx_ssp device was missing a reset method; add one. >> >> Signed-off-by: Peter Maydell >> --- >> hw/arm/pxa2xx.c | 18 ++++++++++++++++++ >> 1 file changed, 18 insertions(+) >> >> diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c >> index fc77b44..770902f 100644 >> --- a/hw/arm/pxa2xx.c >> +++ b/hw/arm/pxa2xx.c >> @@ -756,6 +756,22 @@ static int pxa2xx_ssp_load(QEMUFile *f, void *opaque, int version_id) >> return 0; >> } >> >> +static void pxa2xx_ssp_reset(DeviceState *d) >> +{ >> + PXA2xxSSPState *s = PXA2XX_SSP(d); >> + >> + s->enable = 0; >> + s->sscr[0] = s->sscr[1] = 0; >> + s->sspsp = 0; >> + s->ssto = 0; >> + s->ssitr = 0; >> + s->sssr = 0; >> + s->sstsa = 0; >> + s->ssrsa = 0; >> + s->ssacd = 0; >> + s->rx_start = s->rx_level = 0; > > Does this need a ssp_int_update to deassert any set interrupts? No, because the thing on the other end of the irq line should also reset itself to an "interrupt deasserted" state. Calling qemu_set_irq or qemu_reset_irq in a reset function is dubious, because you don't know if the device on the other end has (a) already reset itself or (b) not yet reset itself but will do so after you; so the effect on the other device is indeterminate... -- PMM