Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3474865imu; Sun, 11 Nov 2018 15:57:44 -0800 (PST) X-Google-Smtp-Source: AJdET5fqIUoSarOoZOY8SPP5VPsDBkUB7bgghPhv3Xot8zUUGaRpqsCAOOrcpUgjs2OWUF6qtCn7 X-Received: by 2002:a63:f959:: with SMTP id q25mr6522688pgk.315.1541980664110; Sun, 11 Nov 2018 15:57:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980664; cv=none; d=google.com; s=arc-20160816; b=sYq93m90eDPaqsQvG1mxCdCMS2EVAXvMxKn0j14WcNkrEdWhUTJnjnBFvGm1g6nw8h NfLt4FqaXUSlqOlomYv9RktYrZ3mWigNkmAEFkv2T82zzMWhyu6bS/hPRsqj96VjxUOr ZnYIoZ1jDgNxX+3j7GFDToiO8UQYCOVW9QdXwzEmrXmR8TtxnsjPq+6tS+9fuZe3zMnZ QH0/NAuwtm190urAxZiJpIlR+mSlV45DUibtJHKGvR3+NqfpfkPJdOAJIe5hRcSUSaBl TzUQkry51Xgcm54lHnAHObmJt3W/4R8q3KPgKPr0i27ZdrlfjeMa6kjBMLsyY8G5Q8Ju SQ3w== 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=kcSEXZ5EnViGX/Nhy8lcleccIyeTm5NMpQD30huJu4U=; b=HkaPmyveG+78Cg2hhLbKmWBn8MHm3V62X0Z6fTV12hE3f8FPj4iWN5Ly6D/0WlJa4L EdMIlWFht93Vwbr+MBWxvXusPR2tXF6Pm+FycTom/4lbJGrtZU4IrvE0NQjmlKOEFUW2 b/q1joR5L3MpoIusWaDfUlzk3XBCIbYAIGJW6mt/9CJmDSRbQj+nzjnauDOvaWTR7lou 6nKykkVcGy/KAojaKXFKlyAkwbECLpqT+oVxIXhvZpzykboYv2mjgR4o6O8ecYcZGl2e jACAD8bKgta2+4D0F4aEBpUGYrM27cu4skXGaCF5Eg3ZtbhF0ap8yfPxsgt/bLwfocEQ MtaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vkiqYGwh; 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 w2si13719961pgs.264.2018.11.11.15.57.29; Sun, 11 Nov 2018 15:57:44 -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=vkiqYGwh; 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 S1732738AbeKLJqQ (ORCPT + 99 others); Mon, 12 Nov 2018 04:46:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:34210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732616AbeKLISP (ORCPT ); Mon, 12 Nov 2018 03:18:15 -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 3C95521527; Sun, 11 Nov 2018 22:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975300; bh=1YTc+KnSsoSual+Vp4qPA+gR7YkoiiheZzySi1wMFXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vkiqYGwh8HEGB1b8Nzx1t+0kPepKJ/vt5JVcV0eGYejxiYs8gkY6lGr0At3L2YN+4 DnP4TiP5Z28dUTja/535rsVEOYib1GG01otHIK1ESZZY8/9EU2p/FPCA8vwl+7j8dW p0nkBXypIITDLrY3e+J0o/bzDeBOkJdILFGYrWbU= 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.19 260/361] iio: adc: at91: fix acking DRDY irq on simple conversions Date: Sun, 11 Nov 2018 14:20:07 -0800 Message-Id: <20181111221653.926564515@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@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.19-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); }