From patchwork Thu Aug 27 13:38:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 7084961 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A7394BEEC1 for ; Thu, 27 Aug 2015 13:42:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C48C320992 for ; Thu, 27 Aug 2015 13:42:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D097E2098D for ; Thu, 27 Aug 2015 13:42:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZUxOr-0003CH-0M; Thu, 27 Aug 2015 13:39:29 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZUxOo-0003AL-JE for linux-arm-kernel@lists.infradead.org; Thu, 27 Aug 2015 13:39:27 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t7RDcoeO016514; Thu, 27 Aug 2015 08:38:50 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t7RDcodO006228; Thu, 27 Aug 2015 08:38:50 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Thu, 27 Aug 2015 08:38:50 -0500 Received: from [172.22.232.213] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t7RDcmXv004082; Thu, 27 Aug 2015 08:38:49 -0500 Message-ID: <55DF12E7.10802@ti.com> Date: Thu, 27 Aug 2015 16:38:47 +0300 From: Grygorii Strashko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Tony Lindgren Subject: Re: [PATCH] ARM: OMAP2+: omap-device: remove omap_device_late_init call completely References: <1440611890-4935-1-git-send-email-grygorii.strashko@ti.com> <20150826181006.GT4215@atomide.com> In-Reply-To: <20150826181006.GT4215@atomide.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150827_063926_834125_630F9AF3 X-CRM114-Status: GOOD ( 20.72 ) X-Spam-Score: -8.3 (--------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux@arm.linux.org.uk, Keerthy , nsekhar@ti.com, balbi@ti.com, t-kristo@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 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 Hi Tony, On 08/26/2015 09:10 PM, Tony Lindgren wrote: > * Grygorii Strashko [150826 11:01]: >> Now Kernel fails to boot 50% of times (form build to build) with >> RT-patchset applied due to the following race - on late boot >> stages deferred_probe_work_func races with omap_device_late_ini >> >> late_initcall >> - deferred_probe_initcal() tries to re-probe all pending driver's probe. >> [In general, It's NOT expected to probe any other built-in drivers after >> deferred_probe_initcal() is finished, because most of >> late_initcall_sync/late_initcall functions expected that all driver >> or probed or deferred already.] >> >> - later on, some driver is probing in this case It's could cpsw.c >> (but could be any other drivers) >> cpsw_init >> - platform_driver_register >> - really_probe >> - driver_bound >> - driver_deferred_probe_trigger >> and boot proceed. >> So, at this moment we have deferred_probe_work_func scheduled. >> >> late_initcall_sync >> - omap_device_late_init >> - omap_device_idle >> >> CPU1 CPU2 >> - deferred_probe_work_func >> - really_probe >> - omap_hsmmc_probe >> - pm_runtime_get_sync >> late_initcall_sync >> - omap_device_late_init >> if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) { >> if (od->_state == OMAP_DEVICE_STATE_ENABLED) { >> - omap_device_idle [ops - IP is disabled, ] >> - [fail] >> - pm_runtime_put_sync >> - omap_hsmmc_runtime_suspend [ooops!] > > OK idling of unclaimed devices should not happen for deferred probe, > it should only happen when there's no driver and no probing happening. > >> Lets remove just remove omap_device_late_init completely as suggested >> by Tero Kristo: >> >> "How about remove omap_device_late_init call completely. I don't think >> it does anything useful at the moment; none of the omap devices get >> enabled outside runtime_pm, so there should be no need to explicitly >> disable the devices." > > I think this is still needed from PM point of view as otherwise we > don't idle any devices that don't have a driver available. Or am I > missing something? > > To me it seems the bug is relying on the BUS_NOTIFY_BOUND_DRIVER is > not set in the deferred probe case. > What do you think about below alternative? Tested-by: Keerthy diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index 4cb8fd9..72ebc4c 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -901,7 +901,8 @@ static int __init omap_device_late_idle(struct device *dev, void *data) if (od->hwmods[i]->flags & HWMOD_INIT_NO_IDLE) return 0; - if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) { + if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER && + od->_driver_status != BUS_NOTIFY_BIND_DRIVER) { if (od->_state == OMAP_DEVICE_STATE_ENABLED) { dev_warn(dev, "%s: enabled but no driver. Idling\n", __func__);