linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Andreas Kemnade <andreas@kemnade.info>
Cc: Evgeniy Polyakov <zbr@ioremap.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	Adam Ford <aford173@gmail.com>, "Andrew F . Davis" <afd@ti.com>,
	"H . Nikolaus Schaller" <hns@goldelico.com>,
	Vignesh R <vigneshr@ti.com>
Subject: Re: [PATCH] w1: omap-hdq: Simplify driver with PM runtime autosuspend
Date: Sun, 15 Dec 2019 19:16:37 -0800	[thread overview]
Message-ID: <20191216031637.GM35479@atomide.com> (raw)
In-Reply-To: <20191216030948.GL35479@atomide.com>

* Tony Lindgren <tony@atomide.com> [191216 03:10]:
> Hi,
> 
> * Andreas Kemnade <andreas@kemnade.info> [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);

  reply	other threads:[~2019-12-16  3:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-15 17:38 [PATCH] w1: omap-hdq: Simplify driver with PM runtime autosuspend Tony Lindgren
2019-12-15 19:33 ` Andreas Kemnade
2019-12-15 22:03 ` Andreas Kemnade
2019-12-16  3:09   ` Tony Lindgren
2019-12-16  3:16     ` Tony Lindgren [this message]
2019-12-16 12:05       ` Andreas Kemnade
2019-12-16 13:57         ` Adam Ford
2019-12-16 14:58           ` Tony Lindgren
2019-12-16 11:17 ` Adam Ford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191216031637.GM35479@atomide.com \
    --to=tony@atomide.com \
    --cc=afd@ti.com \
    --cc=aford173@gmail.com \
    --cc=andreas@kemnade.info \
    --cc=gregkh@linuxfoundation.org \
    --cc=hns@goldelico.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=vigneshr@ti.com \
    --cc=zbr@ioremap.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).