From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4100BC43140 for ; Thu, 21 Jun 2018 14:54:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA5BD20883 for ; Thu, 21 Jun 2018 14:54:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="wVxjDOdA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA5BD20883 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933247AbeFUOyA (ORCPT ); Thu, 21 Jun 2018 10:54:00 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:48914 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933164AbeFUOx6 (ORCPT ); Thu, 21 Jun 2018 10:53:58 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w5LErjYZ008806; Thu, 21 Jun 2018 09:53:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1529592825; bh=/C0KIrGag6FmRd2jNCwAKtcM9+LjaJvOHqapaZJ11aQ=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=wVxjDOdADMjE/Jd6YIeFd66QBEzRzikZf6HxZFB8ciIbzVvbhAcaYpLv4O8DpJius RHmWk533zpnJQC/YjUh88Kuu51yg7YUuLsml3H3JUYftRYMenzCa6Dk4lQlHwApH7j k5VXdaUZL+texD4xylk65CA6K6mnFRfZQOXKj0Ms= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w5LErjY6023473; Thu, 21 Jun 2018 09:53:45 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 21 Jun 2018 09:53:45 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Thu, 21 Jun 2018 09:53:45 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w5LErfKh002723; Thu, 21 Jun 2018 09:53:42 -0500 Subject: Re: 4.18.0-rc1-next-20180619 boot failed on beagle board x15 To: Samuel Morris CC: Tony Lindgren , Naresh Kamboju , Tejun Heo , , Linux-Next Mailing List , open list , Arnd Bergmann , , Olof Johansson , Tero Kristo , "Rafael J. Wysocki" References: <20180620102904.GC112168@atomide.com> <6c15a753-c4a8-ff89-f5c0-0fd19c817c91@ti.com> From: Roger Quadros Openpgp: preference=signencrypt Autocrypt: addr=rogerq@ti.com; prefer-encrypt=mutual; keydata= xsFNBFT1lPYBEADZlKgOS2lxNkDRlcROza/QPsYrS+V2YAXOd4rO/sshQDt1OgU4E8DD37t0 F4zipBkMVU1nQ6ZSom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Va/pIwIltzf9QOW cgEAEQEAAcLBXwQYAQIACQUCVPWU9gIbDAAKCRDSWmvTvnYwk8niEACcwBAfe1tTSqCCHkRj zgIrt+NPBBfxilf9JXPGTYqfUkrcVfiNqLGFgIDZKjkLfArxiSmpmtKf1O1VYO9XDgADUKJO RvmUQM/l3Q99QC5b8yUyZOsgfSBOsV6DeqiULO30cXH/uEpR2fUcbtyYXHouiF2UNdq/BV5h HBQkGYtTf7K26NPp4wXMS+YsBm2Gbms/wywJh4KgRPP6LuA+UE/7l0xqMD3pBQ/L1KLTqOQY CItcZ0YbEvlrJc25PRkCssHf1J2c2MXV+CRqsibW8UamBmOyzKHVK/CwvIndwBmcciJrOf+4 uxegvXEnwvYPuQ3wvBSkgbJRFNJemnp5KSczANr4R/aA5cEbxhbg7peLv0FdFyTFJXCsKeuO 1gKoKtOLyxRhDocprSuEamaDWDCy3TmX+6nWaBIPYXDFT7IcHT6l6TyZ6IMjkXiHSLhynTIj f2xjSrvKPljIUxcqjhyqWe+coe/Xwbqz69DsK150xoAaoS3rbNlhmalbg15HNTipNDI/k81A fwt7ncjxvjXVJnA2nqPBDIW3mZO/ED0blLrVdaMZjf5LvS+vvsMdH7dHtrAXA50egr74sX0A NO7iW+gkmFYwap531ipMXthHPWbo5x9xfb+a48xA80ePBJLBDyw9X+cOe40+N4Ybiwy5Q2La IwrfNkJOLj3CvocMIw== Message-ID: <5206d66d-56d0-2edc-8dd0-00eedbaac3db@ti.com> Date: Thu, 21 Jun 2018 17:53:41 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-GB Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/06/18 17:31, Samuel Morris wrote: > On Thu, Jun 21, 2018 at 3:58 AM, Roger Quadros wrote: >> +Rafael >> >> On 20/06/18 18:30, Samuel Morris wrote: >>> On Wed, Jun 20, 2018 at 8:58 AM, Roger Quadros wrote: >>>> Tony, >>>> >>>> On 20/06/18 13:29, Tony Lindgren wrote: >>>>> Hi, >>>>> >>>>> * Naresh Kamboju [180620 05:55]: >>>>>> Linux next (4.18.0-rc1-next-20180619) boot failed on beagle board x15. >>>>> >>>>> Bisect points to commit aece27a2f01b ("ata: ahci_platform: allow disabling of >>>>> hotplug to save power"). >>>>> >>>>> Reverting the patch makes things work again. Any ideas what >>>>> might be going wrong here? Things clearly idle but then there >>>>> seems to be some register access with clocks disabled. >>>> >>>> The commit is doing this in probe. >>>> >>>> + pm_runtime_set_active(dev); >>>> pm_runtime_enable(dev); >>>> - pm_runtime_get_sync(dev); >>>> + pm_runtime_forbid(dev); >>>> >>>> On OMAP, the device is not guaranteed to be active at probe and so we can't >>>> say pm_runtime_set_active() and get rid of pm_runtime_get_sync(). >>> >>> Okay, by calling set_active(), I'm preventing the rpm_resume from >>> completing that would normally happen in pm_runtime_forbid(). I assume >>> you mean that there are parent devices that need to be resumed before >> >> Actually, in the OMAP case, the AHCI controller device isn't active when probe is called. >> For other platforms this might not be the case. So we need to be careful here. >> >>> this device may be assumed active. I'm going to try removing the >>> set_active(), then move that clause to the end of >>> ahci_platform_init_host(). The pm_runtime_forbid() is effectively the >>> same as get_sync(), it just also sets the runtime_auto flag to false. >>> I don't think we should be saying the device is active until the host >>> is initialized, so that seems like a better, common place for the >>> pm_runtime init callbacks anyway. How does that sound? >> >> Device active and initialized are different things. If the device is powered up >> and can be accessed it is active, even if it is not yet initialized. >> I don't think we should club the two. >> >> Why do you need to call pm_runtime_set_active() at all in the probe sequence? > > What I meant was, I'm not going to call pm_runtime_set_active() > anymore. The device status would be changed to RPM_ACTIVE at the end > of rpm_resume() in either runtime_get() or runtime_forbid(). It is > expected to be active after those have been called. Calling > set_active() before the runtime_forbid() before was to prevent the > device from actually calling the resume() callbacks, because the host > had not yet been initialized, and resuming the host at that point was > causing hangs. I was hoping that actually doing a runtime_resume() > after the host has been initialized would work, and make all parent > devices happy, though I am turning on a host that's already on and > initialized. It should be just about the same as what was there > before, just runtime_forbid() replacing get_sync(), and all that moved > to the ahci_platform_init_host() function. > > Now that I think about it though, I want all the parent devices > resumed before I resume the current device, and probably before host > initialization, and I suspect that's why you need to call > runtime_get_sync(). Maybe I should just put the > ahci_platform_init_host() in the runtime_resume callback, and only run > it the first time that resume() is called. That would require > modifying all drivers that call ahci_platform_init_host() though. Or, > I could just not call ahci_platform_resume_host() on the first > runtime_resume(). That seems like the simplest solution. How about > that? This approach is quirky and might not work properly on all platforms. As Rafael mentioned, we can't really assume weather the device was active or not during probe. It might be active on some platforms and not on others. We need a way for the driver to figure out what's the actual hardware state and then execute a pm_runtime_get_sync() if it is not active during probe. I don't know how though. DT flag maybe? > >> >> Documentation for pm_runtime_set_active() says, >> "(it is only valid to use this function if 'power.runtime_error' is set >> or 'power.disable_depth' is greater than zero);" >> >>> >>>> >>>> >>>>> >>>>>> Full log of trace please refer this link, >>>>>> https://lkft.validation.linaro.org/scheduler/job/291535#L946 >>>>>> >>>>>> Here is back trace, >>>>>> [ 3.561640] omap_rng 48090000.rng: Random Number Generator ver. 20 >>>>>> [ 3.611949] brd: module loaded >>>>>> [ 3.641298] loop: module loaded >>>>>> [ 3.646435] at24 0-0050: 4096 byte 24c32 EEPROM, writable, 1 bytes/write >>>>>> [ 3.658481] ------------[ cut here ]------------ >>>>>> [ 3.663196] WARNING: CPU: 0 PID: 1 at >>>>>> /srv/oe/build/tmp-rpb-glibc/work-shared/am57xx-evm/kernel-source/drivers/bus/omap_l3_noc.c:147 >>>>>> l3_interrupt_handler+0x27c/0x39c >>>>>> [ 3.678052] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_CFG >>>>>> (Read): Data Access in User mode during Functional access >>>>>> [ 3.689330] Modules linked in: >>>>>> [ 3.692426] CPU: 0 PID: 1 Comm: swapper/0 Not tainted >>>>>> 4.18.0-rc1-next-20180619 #1 >>>>>> [ 3.699952] Hardware name: Generic DRA74X (Flattened Device Tree) >>>>>> [ 3.706099] [] (unwind_backtrace) from [] >>>>>> (show_stack+0x20/0x24) >>>>>> [ 3.713897] [] (show_stack) from [] >>>>>> (dump_stack+0xb0/0xdc) >>>>>> [ 3.721171] [] (dump_stack) from [] (__warn+0x118/0x130) >>>>>> [ 3.728270] [] (__warn) from [] >>>>>> (warn_slowpath_fmt+0x58/0x74) >>>>>> [ 3.735808] [] (warn_slowpath_fmt) from [] >>>>>> (l3_interrupt_handler+0x27c/0x39c) >>>>>> [ 3.744742] [] (l3_interrupt_handler) from [] >>>>>> (__handle_irq_event_percpu+0x90/0x45c) >>>>>> [ 3.754286] [] (__handle_irq_event_percpu) from >>>>>> [] (handle_irq_event_percpu+0x3c/0x8c) >>>>>> [ 3.764001] [] (handle_irq_event_percpu) from >>>>>> [] (handle_irq_event+0x48/0x6c) >>>>>> [ 3.772933] [] (handle_irq_event) from [] >>>>>> (handle_fasteoi_irq+0xb0/0x164) >>>>>> [ 3.781513] [] (handle_fasteoi_irq) from [] >>>>>> (generic_handle_irq+0x34/0x44) >>>>>> [ 3.790183] [] (generic_handle_irq) from [] >>>>>> (__handle_domain_irq+0x6c/0xc4) >>>>>> [ 3.798941] [] (__handle_domain_irq) from [] >>>>>> (gic_handle_irq+0x68/0xac) >>>>>> [ 3.807347] [] (gic_handle_irq) from [] >>>>>> (__irq_svc+0x5c/0x7c) >>>>>> [ 3.814874] Exception stack(0xee179c70 to 0xee179cb8) >>>>>> [ 3.819963] 9c60: fc140000 >>>>>> ee3e2f10 ee3a9810 00000000 >>>>>> [ 3.828189] 9c80: 00000000 ee3e2f10 fc140004 fc140000 ee3a9800 >>>>>> ee3a9810 00000000 ee179cdc >>>>>> [ 3.836414] 9ca0: ee179ce0 ee179cc0 c0c3b364 c0c3b2ec 60000013 ffffffff >>>>>> [ 3.843079] [] (__irq_svc) from [] >>>>>> (ahci_enable_ahci+0x24/0x70) >>>>>> [ 3.850789] [] (ahci_enable_ahci) from [] >>>>>> (ahci_save_initial_config+0x2c/0x388) >>>>>> [ 3.859894] [] (ahci_save_initial_config) from >>>>>> [] (ahci_platform_init_host+0x9c/0x4f4) >>>>>> [ 3.869609] [] (ahci_platform_init_host) from >>>>>> [] (ahci_probe+0xa0/0xc0) >>>>>> [ 3.878018] [] (ahci_probe) from [] >>>>>> (platform_drv_probe+0x58/0xac) >>>>>> [ 3.885989] [] (platform_drv_probe) from [] >>>>>> (driver_probe_device+0x25c/0x338) >>>>>> [ 3.894915] [] (driver_probe_device) from [] >>>>>> (__driver_attach+0xf4/0xf8) >>>>>> [ 3.903411] [] (__driver_attach) from [] >>>>>> (bus_for_each_dev+0x78/0xc4) >>>>>> [ 3.911643] [] (bus_for_each_dev) from [] >>>>>> (driver_attach+0x2c/0x30) >>>>>> [ 3.919696] [] (driver_attach) from [] >>>>>> (bus_add_driver+0x114/0x220) >>>>>> [ 3.927752] [] (bus_add_driver) from [] >>>>>> (driver_register+0x88/0x11c) >>>>>> [ 3.935896] [] (driver_register) from [] >>>>>> (__platform_driver_register+0x50/0x58) >>>>>> [ 3.945003] [] (__platform_driver_register) from >>>>>> [] (ahci_driver_init+0x24/0x28) >>>>>> [ 3.954195] [] (ahci_driver_init) from [] >>>>>> (do_one_initcall+0x9c/0x434) >>>>>> [ 3.962517] [] (do_one_initcall) from [] >>>>>> (kernel_init_freeable+0x3b8/0x53c) >>>>>> [ 3.971276] [] (kernel_init_freeable) from [] >>>>>> (kernel_init+0x18/0x128) >>>>>> [ 3.979597] [] (kernel_init) from [] >>>>>> (ret_from_fork+0x14/0x28) >>>>>> [ 3.987210] Exception stack(0xee179fb0 to 0xee179ff8) >>>>>> [ 3.992298] 9fa0: 00000000 >>>>>> 00000000 00000000 00000000 >>>>>> [ 4.000524] 9fc0: 00000000 00000000 00000000 00000000 00000000 >>>>>> 00000000 00000000 00000000 >>>>>> [ 4.008750] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 >>>>>> [ 4.015405] irq event stamp: 663130 >>>>>> [ 4.018926] hardirqs last enabled at (663129): [] >>>>>> _raw_spin_unlock_irqrestore+0x40/0x6c >>>>>> [ 4.027939] hardirqs last disabled at (663130): [] >>>>>> __irq_svc+0x4c/0x7c >>>>>> [ 4.035384] softirqs last enabled at (661486): [] >>>>>> __do_softirq+0x2a8/0x5e8 >>>>>> [ 4.043262] softirqs last disabled at (661449): [] >>>>>> irq_exit+0x178/0x1a4 >>>>>> [ 4.050826] ---[ end trace 095abac70926448f ]--- >>>>>> >>>>>> Best regards >>>>>> Naresh Kamboju >>>>>> -- >>>>>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in >>>>>> the body of a message to majordomo@vger.kernel.org >>>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html >>>> >>>> -- >>>> cheers, >>>> -roger >>>> >>>> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. >>>> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki >> >> -- >> cheers, >> -roger >> >> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. >> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki -- cheers, -roger Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki