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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 3650AC43603 for ; Mon, 16 Dec 2019 03:16:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 054F020717 for ; Mon, 16 Dec 2019 03:16:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbfLPDQl (ORCPT ); Sun, 15 Dec 2019 22:16:41 -0500 Received: from muru.com ([72.249.23.125]:48414 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbfLPDQl (ORCPT ); Sun, 15 Dec 2019 22:16:41 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 9F7B380C5; Mon, 16 Dec 2019 03:17:19 +0000 (UTC) Date: Sun, 15 Dec 2019 19:16:37 -0800 From: Tony Lindgren To: Andreas Kemnade Cc: Evgeniy Polyakov , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, Adam Ford , "Andrew F . Davis" , "H . Nikolaus Schaller" , Vignesh R Subject: Re: [PATCH] w1: omap-hdq: Simplify driver with PM runtime autosuspend Message-ID: <20191216031637.GM35479@atomide.com> References: <20191215173817.47918-1-tony@atomide.com> <20191215230331.645b9064@aktux> <20191216030948.GL35479@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191216030948.GL35479@atomide.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tony Lindgren [191216 03:10]: > Hi, > > * Andreas Kemnade [191215 22:04]: > > On Sun, 15 Dec 2019 09:38:17 -0800 > > If I remember correctly this thing is critical to get the hwmod out of > > reset but I need to examine that again: > > Thanks for testing, yes that's what I thought might cause it > too, but nope :) > > We currently disable interrupts for some reason after > the first read. That won't play with runtime PM autosuspend > at all as we never enable them again until the device has > idled. Can you try the following additional patch on top? And we should probably do the following too to make sure the mode is initialized before we call runtime PM. Regards, Tony 8< ------------------- diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c --- a/drivers/w1/masters/omap_hdq.c +++ b/drivers/w1/masters/omap_hdq.c @@ -565,6 +565,15 @@ static int omap_hdq_probe(struct platform_device *pdev) mutex_init(&hdq_data->hdq_mutex); + ret = of_property_read_string(pdev->dev.of_node, "ti,mode", &mode); + if (ret < 0 || !strcmp(mode, "hdq")) { + hdq_data->mode = 0; + omap_w1_master.search = omap_w1_search_bus; + } else { + hdq_data->mode = 1; + omap_w1_master.triplet = omap_w1_triplet; + } + pm_runtime_enable(&pdev->dev); pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_set_autosuspend_delay(&pdev->dev, 300); @@ -599,15 +608,6 @@ static int omap_hdq_probe(struct platform_device *pdev) pm_runtime_mark_last_busy(&pdev->dev); pm_runtime_put_autosuspend(&pdev->dev); - ret = of_property_read_string(pdev->dev.of_node, "ti,mode", &mode); - if (ret < 0 || !strcmp(mode, "hdq")) { - hdq_data->mode = 0; - omap_w1_master.search = omap_w1_search_bus; - } else { - hdq_data->mode = 1; - omap_w1_master.triplet = omap_w1_triplet; - } - omap_w1_master.data = hdq_data; ret = w1_add_master_device(&omap_w1_master);