Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1594841imd; Sun, 4 Nov 2018 06:02:15 -0800 (PST) X-Google-Smtp-Source: AJdET5d9P3lpLf8388nxngRKszTH8akb/4BdMKKGGERy+2yab0sGzkHOqOZx5OimPC/TbqkR0UTw X-Received: by 2002:a17:902:66e5:: with SMTP id e92-v6mr18173924plk.92.1541340135549; Sun, 04 Nov 2018 06:02:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541340135; cv=none; d=google.com; s=arc-20160816; b=bd5Y7xTA9SYPnLxOsc7+UAuo+HeVcy2l1RlSp+DwcVfUaq+z4j9jFTNlCHHto5BOft hylEhYcxz9ad+866rHxje3dSZ/fP9eKVVt1Tpm5znwWLdTddLWJLwRQD5X4Pxp97IpDH h+7CRUFtXbLpdkHTrG1/ukH2TMGr8V+/smQJsGKRzZM1LTPny+YqUxSdgdKspLEaj0aC zjNapDfnhP2Pft5/ZD3Nt53G+BEo6GgxtueYOoFLzBlvbtTNAlCuuKywMz1wO1/QT2Uc FYd/FRGhvuY1L2k84m+Z3glTZlMmj4GwMx/UNDDP+yp0HOcGLqGH0IuPGVjZXmj5gI32 8dAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=R9SiVtV6gaaTxZLx+PammaI4oCQ5BjnAomm8lEOS/Fs=; b=K2BwDQ1gYJxtIP/l5NdiYXAkps2N7T/7Yt7kKEuHZWLjPE45r31wUGPkhz3h+i7K2h fc6WL3xblVlV3sDJdSZ9AD3MJ4u3pEyhZOSb4zra9BHefxDR5SlZByGzx+lUlQMgYXNH noyhzOJ328xva+eJy7yqMicBexYj8Z3z012JE5DG2cqPswncx0Fsa76vAGKW/8eTOBIw Swp8h/x0VCNQh+r80u0QvN6lrUHD2B3aVchU/ui1LVpDSrwIlSuVTZNhXm1Rp+uAaYeX ve0xUgza1bVyjs9iePz9SrrL/yB/aa8+iTvSgV/X4z9h62ONZeKfvhJtvZ1Ac97MtQXc MH6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nVn1n04W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1-v6si26528409pgw.151.2018.11.04.06.02.00; Sun, 04 Nov 2018 06:02:15 -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=nVn1n04W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731303AbeKDXIs (ORCPT + 99 others); Sun, 4 Nov 2018 18:08:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:47838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731227AbeKDXIq (ORCPT ); Sun, 4 Nov 2018 18:08:46 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8DB37204FD; Sun, 4 Nov 2018 13:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541339622; bh=S27SFL//+105Erfzxsyb0PhmYYoK3E3ZmtOj1BDvYzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nVn1n04WhLn6smLe10oCWquQJXW4Lu2qkfxk2oZx866CSj/XHe4/OzUDHr5Cz5jRw AfdKaJq/IqvnVIaR639B4/5S17Ehc2ahlzBYcCn9rmTz2zuKYQHulAiTQDlJACOso/ qB+ge0+ocK36EONkRIeCUKK1geLRU7TnfYJHfKPw= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Eugen Hristev , Maxime Ripard , Stable@vger.kernel.org, Jonathan Cameron , Sasha Levin Subject: [PATCH AUTOSEL 4.14 16/30] iio: adc: at91: fix acking DRDY irq on simple conversions Date: Sun, 4 Nov 2018 08:53:11 -0500 Message-Id: <20181104135325.88524-16-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181104135325.88524-1-sashal@kernel.org> References: <20181104135325.88524-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eugen Hristev [ Upstream commit bc1b45326223e7e890053cf6266357adfa61942d ] 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: Sasha Levin --- 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 3f6fef0bb067..cd686179aa92 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c @@ -281,6 +281,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.17.1