Received: by 10.213.65.68 with SMTP id h4csp3613409imn; Tue, 3 Apr 2018 07:58:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Si42I9LGSMPEcpcRQ4WTCjPmm8FVpJLvqbLjTaAmIDx1mxoAIzhgenLYoBrSAClhkPoqy X-Received: by 10.99.191.65 with SMTP id i1mr9349235pgo.269.1522767496355; Tue, 03 Apr 2018 07:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522767496; cv=none; d=google.com; s=arc-20160816; b=DO2bGdDfrrPucVLztGzPJ+ETZ8o44t+DUujoPqWG2sVt0BSfnDwlhNXYosTTo0DBTD hrdmVWGm2yy0ayhXTv8hJkSfsnmJ9/CCPxN4YtGHXSOW2f31JbF6L36DeeZEZg2Ec7p9 /GBmMKi9qmeTtzIOEDyZsYZO8CqYz4THbVGlNJwyXO34f2g6tb31UP2tk9X6D5MIitJq 3CS6gCpjA9P03/4VylqJUvoGuKKXqABzowR9tTNetFKtAfo+EWrDf7Ra3kahtuMTycti 4if9dll4GTuvCDFFSsxUuemNf6o1qNiyGxAvh8mmZlsqoBDZ47MX/bQTNBziD1rknmwr 6rDA== 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:message-id:subject:cc :to:from:date:arc-authentication-results; bh=sa1CLM1QOJbkA9eKSLCaIT9buTUaOpVjGKHCZ6nF3S8=; b=O0sOImixP1/v1R3nNXUWpNM2YERg+NOQbQOGBCl9jzqeYhNPueF616R+2QL9luh/oQ 4XqB8RuwVBlFMJEeGbgoGP6aJq2bTSbC13YkiinAFtPTL2/+PjpkD42ZjWt4Af/mthmE dkjRJ90vpWrCqPedhehK8k0gGAQr5pb8zMbSiFQSsz9DBS/veDdbnw3CZyLIQTD38lUy DhW5eDQB8/jdVpVftOYZfDhTZR8SbVZpBfPYCSGxYGhJJBhCRTt+q8bIpaeS10jtikag Avr22OsCRG05ci5IutvG9GzIEP5OytBpfmwfAiCZspml0NoI0nD7D/s/gDBykj3JJB1s Dr8Q== 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 a7-v6si3008006plp.22.2018.04.03.07.58.02; Tue, 03 Apr 2018 07:58:16 -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 S1751488AbeDCO44 (ORCPT + 99 others); Tue, 3 Apr 2018 10:56:56 -0400 Received: from mail.bootlin.com ([62.4.15.54]:50576 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbeDCO4y (ORCPT ); Tue, 3 Apr 2018 10:56:54 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 1982520787; Tue, 3 Apr 2018 16:56:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id D4F1B20713; Tue, 3 Apr 2018 16:56:42 +0200 (CEST) Date: Tue, 3 Apr 2018 16:56:42 +0200 From: Alexandre Belloni To: Bryan O'Donoghue Cc: linux-kernel@vger.kernel.org, a.zummo@towertech.it, Pan Bian , Guy Shapiro , Stefan Agner , Frank Li , Shawn Guo , linux-rtc@vger.kernel.org, "# v3 . 16+" Subject: Re: [RESEND] [PATCH] rtc: snvs: Fix usage of snvs_rtc_enable Message-ID: <20180403145642.GA6444@piout.net> References: <1522264445-2398-1-git-send-email-pure.logic@nexus-software.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522264445-2398-1-git-send-email-pure.logic@nexus-software.ie> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/03/2018 20:14:05+0100, Bryan O'Donoghue wrote: > commit 179a502f8c46 ("rtc: snvs: add Freescale rtc-snvs driver") introduces > the SNVS RTC driver with a function snvs_rtc_enable(). > > snvs_rtc_enable() can return an error on the enable path however this > driver does not currently trap that failure on the probe() path and > consequently if enabling the RTC fails we encounter a later error spinning > forever in rtc_write_sync_lp(). > > [ 36.093481] [] (__irq_svc) from [] (_raw_spin_unlock_irqrestore+0x34/0x44) > [ 36.102122] [] (_raw_spin_unlock_irqrestore) from [] (regmap_read+0x4c/0x5c) > [ 36.110938] [] (regmap_read) from [] (rtc_write_sync_lp+0x6c/0x98) > [ 36.118881] [] (rtc_write_sync_lp) from [] (snvs_rtc_alarm_irq_enable+0x40/0x4c) > [ 36.128041] [] (snvs_rtc_alarm_irq_enable) from [] (rtc_timer_do_work+0xd8/0x1a8) > [ 36.137291] [] (rtc_timer_do_work) from [] (process_one_work+0x28c/0x76c) > [ 36.145840] [] (process_one_work) from [] (worker_thread+0x34/0x58c) > [ 36.153961] [] (worker_thread) from [] (kthread+0x138/0x150) > [ 36.161388] [] (kthread) from [] (ret_from_fork+0x14/0x20) > [ 36.168635] rcu_sched kthread starved for 2602 jiffies! g496 c495 f0x2 RCU_GP_WAIT_FQS(3) ->state=0x0 ->cpu=0 > [ 36.178564] rcu_sched R running task 0 8 2 0x00000000 > [ 36.185664] [] (__schedule) from [] (schedule+0x3c/0xa0) > [ 36.192739] [] (schedule) from [] (schedule_timeout+0x78/0x4e0) > [ 36.200422] [] (schedule_timeout) from [] (rcu_gp_kthread+0x648/0x1864) > [ 36.208800] [] (rcu_gp_kthread) from [] (kthread+0x138/0x150) > [ 36.216309] [] (kthread) from [] (ret_from_fork+0x14/0x20) > > This patch fixes by parsing the result of rtc_write_sync_lp() and > propagating both in the probe and elsewhere. If the RTC doesn't start we > don't proceed loading the driver and don't get into this loop mess later > on. > > Fixes: 179a502f8c46 ("rtc: snvs: add Freescale rtc-snvs driver") > > Signed-off-by: Bryan O'Donoghue > Cc: a.zummo@towertech.it > Cc: alexandre.belloni@free-electrons.com > Cc: Pan Bian > Cc: Guy Shapiro > Cc: Stefan Agner > Cc: Frank Li > Cc: Shawn Guo > Cc: linux-rtc@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: # v3.16+ > --- > drivers/rtc/rtc-snvs.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > Applied, thanks. -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com