From patchwork Mon Feb 3 11:25:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris BREZILLON X-Patchwork-Id: 3568951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 55DF39F2F5 for ; Mon, 3 Feb 2014 11:27:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97443201E9 for ; Mon, 3 Feb 2014 11:27:34 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A66A3201D5 for ; Mon, 3 Feb 2014 11:27:33 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WAHff-0005i5-9H; Mon, 03 Feb 2014 11:26:35 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WAHfS-0006Ar-8k; Mon, 03 Feb 2014 11:26:22 +0000 Received: from 17.mo3.mail-out.ovh.net ([87.98.178.58] helo=mo3.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WAHfA-00066Y-1n for linux-arm-kernel@lists.infradead.org; Mon, 03 Feb 2014 11:26:06 +0000 Received: from mail628.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo3.mail-out.ovh.net (Postfix) with SMTP id 75330FFB569 for ; Mon, 3 Feb 2014 12:25:35 +0100 (CET) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 3 Feb 2014 13:25:44 +0200 Received: from unknown (HELO bbrezillon-laptop.int.overkiz.com) (b.brezillon@overkiz.com@80.245.18.66) by ns0.ovh.net with SMTP; 3 Feb 2014 13:25:42 +0200 From: Boris BREZILLON To: Mike Turquette Subject: [PATCH 1/3] clk: at91: fix programmable clk irq handling Date: Mon, 3 Feb 2014 12:25:28 +0100 Message-Id: <1391426731-9392-2-git-send-email-b.brezillon@overkiz.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1391426731-9392-1-git-send-email-b.brezillon@overkiz.com> References: <1391426731-9392-1-git-send-email-b.brezillon@overkiz.com> X-Ovh-Tracer-Id: 8986088632964577309 X-Ovh-Remote: 80.245.18.66 () X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejtddrieelucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejtddrieelucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140203_062604_248076_62CA0AC6 X-CRM114-Status: GOOD ( 11.77 ) X-Spam-Score: -1.9 (-) Cc: Nicolas Ferre , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Boris BREZILLON X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The prog irq is a level irq reflecting the prog clk status. As a result the irq line will stay high when the prog clk is ready and the system will hang. Disable the irq when it is handled to avoid this problem. Signed-off-by: Boris BREZILLON Acked-by: Nicolas Ferre --- drivers/clk/at91/clk-programmable.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c index fd792b2..02f62a0 100644 --- a/drivers/clk/at91/clk-programmable.c +++ b/drivers/clk/at91/clk-programmable.c @@ -55,6 +55,7 @@ static irqreturn_t clk_programmable_irq_handler(int irq, void *dev_id) struct clk_programmable *prog = (struct clk_programmable *)dev_id; wake_up(&prog->wait); + disable_irq_nosync(prog->irq); return IRQ_HANDLED; } @@ -74,8 +75,10 @@ static int clk_programmable_prepare(struct clk_hw *hw) pmc_write(pmc, AT91_PMC_PCKR(id), tmp); - while (!(pmc_read(pmc, AT91_PMC_SR) & mask)) + while (!(pmc_read(pmc, AT91_PMC_SR) & mask)) { + enable_irq(prog->irq); wait_event(prog->wait, pmc_read(pmc, AT91_PMC_SR) & mask); + } return 0; }