mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, damien_benoist@yahoo.com,
	Dave Young <hidave.darkstar@gmail.com>
Subject: [patch 1/3] ieee1394: regression in 2.6.25: updates should happen before probes
Date: Sat, 16 Aug 2008 13:36:47 +0200 (CEST)	[thread overview]
Message-ID: <tkrat.bdb066b22ec930a0@s5r6.in-berlin.de> (raw)
In-Reply-To: <48A6BA6F.2030000@s5r6.in-berlin.de>

Regression since commit 73cf60232ef16e1f8a64defa97214a1722db1e6c,
"ieee1394: use class iteration api":  The two loops for (1.) driver
updates and (2.) driver probes were replaced by a single loop with
bogus needs_probe checks.  Hence updates and probes were now intermixed,
and especially sbp2 updates (reconnects) held up longer than necessary.

While we fix it, change the needs_probe flag to bool type for clarity.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---

I will make sure that this goes into -stable too.

Dave, I won't Cc you on patch 2/3 and 3/3 of this series because they
are not related to the loop regression.

 drivers/ieee1394/nodemgr.c |   14 ++++++++------
 drivers/ieee1394/nodemgr.h |    2 +-
 2 files changed, 9 insertions(+), 7 deletions(-)

Index: linux/drivers/ieee1394/nodemgr.c
===================================================================
--- linux.orig/drivers/ieee1394/nodemgr.c
+++ linux/drivers/ieee1394/nodemgr.c
@@ -843,7 +843,7 @@ static struct node_entry *nodemgr_create
 	ne->host = host;
 	ne->nodeid = nodeid;
 	ne->generation = generation;
-	ne->needs_probe = 1;
+	ne->needs_probe = true;
 
 	ne->guid = guid;
 	ne->guid_vendor_id = (guid >> 40) & 0xffffff;
@@ -1141,7 +1141,7 @@ static void nodemgr_process_root_directo
 	struct csr1212_keyval *kv, *vendor_name_kv = NULL;
 	u8 last_key_id = 0;
 
-	ne->needs_probe = 0;
+	ne->needs_probe = false;
 
 	csr1212_for_each_dir_entry(ne->csr, kv, ne->csr->root_kv, dentry) {
 		switch (kv->key.id) {
@@ -1292,7 +1292,7 @@ static void nodemgr_update_node(struct n
 		nodemgr_update_bus_options(ne);
 
 		/* Mark the node as new, so it gets re-probed */
-		ne->needs_probe = 1;
+		ne->needs_probe = true;
 	} else {
 		/* old cache is valid, so update its generation */
 		struct nodemgr_csr_info *ci = ne->csr->private;
@@ -1560,6 +1560,7 @@ static void nodemgr_probe_ne(struct host
 struct probe_param {
 	struct host_info *hi;
 	int generation;
+	bool probe_now;
 };
 
 static int __nodemgr_node_probe(struct device *dev, void *data)
@@ -1568,9 +1569,7 @@ static int __nodemgr_node_probe(struct d
 	struct node_entry *ne;
 
 	ne = container_of(dev, struct node_entry, node_dev);
-	if (!ne->needs_probe)
-		nodemgr_probe_ne(param->hi, ne, param->generation);
-	if (ne->needs_probe)
+	if (ne->needs_probe == param->probe_now)
 		nodemgr_probe_ne(param->hi, ne, param->generation);
 	return 0;
 }
@@ -1591,6 +1590,9 @@ static void nodemgr_node_probe(struct ho
 	 * while probes are time-consuming. (Well, those probes need some
 	 * improvement...) */
 
+	param.probe_now = false;
+	class_for_each_device(&nodemgr_ne_class, &param, __nodemgr_node_probe);
+	param.probe_now = true;
 	class_for_each_device(&nodemgr_ne_class, &param, __nodemgr_node_probe);
 
 	/* If we had a bus reset while we were scanning the bus, it is
Index: linux/drivers/ieee1394/nodemgr.h
===================================================================
--- linux.orig/drivers/ieee1394/nodemgr.h
+++ linux/drivers/ieee1394/nodemgr.h
@@ -97,7 +97,7 @@ struct node_entry {
 	struct hpsb_host *host;		/* Host this node is attached to */
 	nodeid_t nodeid;		/* NodeID */
 	struct bus_options busopt;	/* Bus Options */
-	int needs_probe;
+	bool needs_probe;
 	unsigned int generation;	/* Synced with hpsb generation */
 
 	/* The following is read from the config rom */

-- 
Stefan Richter
-=====-==--- =--- =----
http://arcgraph.de/sr/


       reply	other threads:[~2008-08-16 11:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <994096.81924.qm@web50505.mail.re2.yahoo.com>
     [not found] ` <48A5A80A.90506@s5r6.in-berlin.de>
     [not found]   ` <48A6BA6F.2030000@s5r6.in-berlin.de>
2008-08-16 11:36     ` Stefan Richter [this message]
2008-08-16 11:38       ` [patch 2/3] ieee1394: don't drop nodes during bus reset series Stefan Richter
2008-08-16 11:39         ` [patch 3/3] ieee1394: sbp2: let nodemgr retry node updates " Stefan Richter
2008-08-19 19:28         ` [patch 2/3] ieee1394: don't drop nodes " Stefan Richter
2008-08-19 19:29           ` [patch 1/2] ieee1394: nodemgr clean up class iterators Stefan Richter
2008-08-19 19:30             ` [patch 2/2] ieee1394: survive a few seconds connection loss Stefan Richter
2008-10-10 17:13               ` [patch amendment] " Stefan Richter

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=tkrat.bdb066b22ec930a0@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=damien_benoist@yahoo.com \
    --cc=hidave.darkstar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.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

all inboxes | Powered by JetHome®