Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp915486oof; Tue, 25 Sep 2018 06:19:31 -0700 (PDT) X-Google-Smtp-Source: ACcGV60+QC3oSp5w8oyNxjuls1yFKwCgTwpjX+ku2B9XGMOk/3SHVD06PDQQ/JPDzwKr/RB4e7Jc X-Received: by 2002:a62:384c:: with SMTP id f73-v6mr1158786pfa.242.1537881571196; Tue, 25 Sep 2018 06:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537881571; cv=none; d=google.com; s=arc-20160816; b=jjWV6X0kSlTSjkhw6LeQcIvuXUuYMI8fqJEpTMz2CnD2/E6kUJlFotM0e8BppprcIJ PkEZKv2+JLMUawudF80xDdnt0xqqKBC9sUeKMz8Du2GaqGOeM96QLAiiXxgA8a49KXZe xJkYxg1QtziXIqUep/aaEYLsFg+tl7qYa7Xqiu2fkN2ux7rh2RKrtlvOiiYttSXf3pbm lLlYZTqeg8m74ZRubALalDxUbktfUsLwe7r6wiNG0q1BG2NohibXiY+vHKLewv01Itai 7KSb7kj1RWYURg03GlwclzDt87bw/iqFIyanRoDxLIhOHfOpEqapd8t22EDAU47+ovfx z/2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=TjK4Ru+hV6Srl0bHR4C5qt0uCP+0lPN/gjobmhtpxz8=; b=drdKGnKeuzqL2oPhceypk2fbIEypzVmmaQzwmTtoQ7LNPhc+80DuSkKBBNaAWq3nIC 2/L1WYfTCbxKfJEuGexJB28mDNVCP7FlcHWxfwdMAd8lo/HDplVZCOqJ10GwfFQTlsnj 67jU1QrGSH8zIviqPCqINuPQDfvbTB19TS15KI75PHgYwuNEXpk45TnKtL8lpDF8k20x g4xIaupXQfbzkGdaTgxx+Rwj3pV6c5bJa+3hyiJzWGN/p7MmS8k+UbKtIZYPvN24/kKa E/ee8TjPV7K+cAhO0deb0tfkoobP3w81v+Em8vXXHJxG6wCYF+GygY2jdLEkwAzKoCqx 082Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r130-v6si2243227pgr.456.2018.09.25.06.19.15; Tue, 25 Sep 2018 06:19:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729115AbeIYTZN (ORCPT + 99 others); Tue, 25 Sep 2018 15:25:13 -0400 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:32620 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728272AbeIYTZM (ORCPT ); Tue, 25 Sep 2018 15:25:12 -0400 X-IronPort-AV: E=Sophos;i="5.54,302,1534834800"; d="scan'208";a="18387805" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Sep 2018 06:17:42 -0700 Received: from localhost (10.10.76.4) by chn-sv-exch04.mchp-main.com (10.10.76.105) with Microsoft SMTP Server id 14.3.352.0; Tue, 25 Sep 2018 06:17:40 -0700 Date: Tue, 25 Sep 2018 15:17:39 +0200 From: Ludovic Desroches To: Eugen Hristev CC: , , , , , Maxime Ripard Subject: Re: [PATCH v2 1/2] iio: adc: at91: fix acking DRDY irq on simple conversions Message-ID: <20180925131739.2nuoelhqmkszamqo@M43218.corp.atmel.com> Mail-Followup-To: Eugen Hristev , jic23@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, nicolas.ferre@microchip.com, Maxime Ripard References: <1537775504-7981-1-git-send-email-eugen.hristev@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1537775504-7981-1-git-send-email-eugen.hristev@microchip.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 24, 2018 at 10:51:43AM +0300, Eugen Hristev wrote: > When doing simple conversions, the driver did not acknowledge the DRDY irq. > If this irq status is not acked, it will be left pending, and as soon as a > trigger is enabled, the irq handler will be called, it doesn't know why > this status has occurred because no channel is pending, and then it will go > int a irq loop and board will hang. > To avoid this situation, read the LCDR after a raw conversion is done. > > Fixes 0e589d5fb ("ARM: AT91: IIO: Add AT91 ADC driver.") > Cc: Maxime Ripard > Signed-off-by: Eugen Hristev Acked-by: Ludovic Desroches > --- > Hello Jonathan, > > I moved this LCDR read/acknowledge into the IRQ handler after the conversion > value is being read. > Sorry about the noise to stable@vger, removed from message. > > Thanks, > Eugen > > drivers/iio/adc/at91_adc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c > index 44b5168..e3be88e 100644 > --- a/drivers/iio/adc/at91_adc.c > +++ b/drivers/iio/adc/at91_adc.c > @@ -279,6 +279,8 @@ static void handle_adc_eoc_trigger(int irq, struct iio_dev *idev) > iio_trigger_poll(idev->trig); > } else { > st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb)); > + /* Needed to ACK the DRDY interruption */ > + at91_adc_readl(st, AT91_ADC_LCDR); > st->done = true; > wake_up_interruptible(&st->wq_data_avail); > } > -- > 2.7.4 >