Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3430125imu; Sun, 11 Nov 2018 14:56:18 -0800 (PST) X-Google-Smtp-Source: AJdET5elm6cc8wd//wa58Aslet5XJ8YDSSNqAUegmxsN40miJaqW1XhHDg+QD9Twb+VMnEct+Xw9 X-Received: by 2002:a62:4816:: with SMTP id v22-v6mr17538717pfa.233.1541976978590; Sun, 11 Nov 2018 14:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541976978; cv=none; d=google.com; s=arc-20160816; b=x8yVbUAn7bWbCpVM8NoIA/gzItLPkLqdVac5IxycArvtJqUN36+WqWRgzgPq4XOtEi yy5RhZwz/mZMKnqzNbjMwWUIKmPMaOnTS/4cFRiD3MLUgs1SZuoVkGcbIBPUV70N6TD/ WyVt6rx8X5HDHJmWeM01/tFFM/63jooBg1uKIjhC/EenMLzXwTb3coGWQP8nxk7/PIIm RPD0rsiT82ta87QodohZWs2cbl+YfnunF7SxtC6MslOrJHDvhWa1sZAug73wLnKSbTuw AOgPhTI8/RIo5ZUBMNIFtwvCyGrrVADSmpzjAF21rS60/f2BFH4p8HtWywN39tExMs23 luxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uE2gEAY/KLQKdxrbX24IhOVI5oFUP/yjdXoG9LNvZXo=; b=zn49xCioxutRdoHNccip4GN6MSaUWM5inNZyxDVIID33y/pB6yGbdr0z/SJZ5a3E97 8B5Uwi7o/11XxjOR8lnVVUdx8TrqssdrrwfUJa0AOViJ+Gn9IYXgqBtFKURovSJbYE6m vXsqD44zNs3Mkv25ZeUyyz1NF+VicdJMAockR7OFudGgt/lZp5UsA+f8B1bAY71Esj1D bcaDV9Y0M6XK39IqUcv4PnA/2Xmb2TfLG+oLd23P+NzitlXV/pFyxw3XhD/51hlLj6ro 4kufJJbHyBEKNWck7y56gaFKpuwHDCxIE1kuIQ3zNL8/VhOBrADiyShZu3bTc2OPqsb1 KK1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZyWL68OT; 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 s11-v6si14882244pgh.511.2018.11.11.14.56.04; Sun, 11 Nov 2018 14:56:18 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=ZyWL68OT; 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 S2403992AbeKLIpp (ORCPT + 99 others); Mon, 12 Nov 2018 03:45:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:54620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403928AbeKLIWy (ORCPT ); Mon, 12 Nov 2018 03:22:54 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 434CE223C6; Sun, 11 Nov 2018 22:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975577; bh=/b0wKblQwdoPzxYIm0U7dOyrKvcnqKfLHzOfT6sfox4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZyWL68OTtY+qlVVUyT2QX8ifvVuhMj/PnlXfTLXzApsmgXaCiXirIwlrlfw4SZ87Z q3uhrNYXnDbVF27jyoeec2t+tgg5IDQIbK9+zup7LysUMS2+m2nE67Ptutggj/S9jK EtnbORD17v1YVancNw/HGmFEGFojLdoUun/sOgvI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxime Ripard , Eugen Hristev , Ludovic Desroches , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 4.14 161/222] iio: adc: at91: fix acking DRDY irq on simple conversions Date: Sun, 11 Nov 2018 14:24:18 -0800 Message-Id: <20181111221701.694468576@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eugen Hristev commit bc1b45326223e7e890053cf6266357adfa61942d upstream. 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 Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/at91_adc.c | 2 ++ 1 file changed, 2 insertions(+) --- 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 i 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); }