From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Ben Collins <bcollins@ubuntu.com>
Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH 03/19] ieee1394: fix cosmetic problem in speed probe
Date: Mon, 3 Jul 2006 00:58:01 +0200 (CEST) [thread overview]
Message-ID: <tkrat.e00aa2fc2df8d106@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.8d67352567e525c1@s5r6.in-berlin.de>
If ieee1394.h::IEEE1394_SPEED_MAX is bigger than the actual speed of an
1394b host adapter and the speed to another 1394b node was probed, a
bigger speed than actually used was kept in host->speed[n]. The only
resulting problem so far was sbp2 displaying bogus values in the syslog,
e.g. S3200 for actual S800 connections if IEEE1394_SPEED_MAX was S3200.
But other high-level drivers which access this field could get into more
trouble. (Eth1394 is the only other in-tree driver which does so. It
seems it is not affected.)
Nodemgr now clips this value according to the host adapter's link speed.
A pointer expression in nodemgr_check_speed is also changed for clarity.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
Index: linux/drivers/ieee1394/nodemgr.c
===================================================================
--- linux.orig/drivers/ieee1394/nodemgr.c 2006-07-02 12:02:06.000000000 +0200
+++ linux/drivers/ieee1394/nodemgr.c 2006-07-02 12:10:49.000000000 +0200
@@ -71,7 +71,7 @@ static int nodemgr_check_speed(struct no
u8 i, *speed, old_speed, good_speed;
int ret;
- speed = ci->host->speed + NODEID_TO_NODE(ci->nodeid);
+ speed = &(ci->host->speed[NODEID_TO_NODE(ci->nodeid)]);
old_speed = *speed;
good_speed = IEEE1394_SPEED_MAX + 1;
@@ -1251,6 +1251,7 @@ static void nodemgr_node_scan_one(struct
octlet_t guid;
struct csr1212_csr *csr;
struct nodemgr_csr_info *ci;
+ u8 *speed;
ci = kmalloc(sizeof(*ci), GFP_KERNEL);
if (!ci)
@@ -1259,8 +1260,12 @@ static void nodemgr_node_scan_one(struct
ci->host = host;
ci->nodeid = nodeid;
ci->generation = generation;
- ci->speed_unverified =
- host->speed[NODEID_TO_NODE(nodeid)] > IEEE1394_SPEED_100;
+
+ /* Prepare for speed probe which occurs when reading the ROM */
+ speed = &(host->speed[NODEID_TO_NODE(nodeid)]);
+ if (*speed > host->csr.lnk_spd)
+ *speed = host->csr.lnk_spd;
+ ci->speed_unverified = *speed > IEEE1394_SPEED_100;
/* We need to detect when the ConfigROM's generation has changed,
* so we only update the node's info when it needs to be. */
@@ -1300,8 +1305,6 @@ static void nodemgr_node_scan_one(struct
nodemgr_create_node(guid, csr, hi, nodeid, generation);
else
nodemgr_update_node(ne, csr, hi, nodeid, generation);
-
- return;
}
next prev parent reply other threads:[~2006-07-02 22:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-02 22:53 [PATCH 00/19] ieee1394: misc updates Stefan Richter
2006-07-02 22:54 ` [PATCH 01/19] ieee1394: sbp2: enable auto spin-up for Maxtor disks Stefan Richter
2006-07-02 22:56 ` [PATCH 02/19] ieee1394: fix calculation of csr->expire Stefan Richter
2006-07-02 22:58 ` Stefan Richter [this message]
2006-07-02 22:59 ` [PATCH 04/19] ieee1394: skip dummy loop in build_speed_map Stefan Richter
2006-07-02 23:00 ` [PATCH 05/19] ieee1394: replace __inline__ by inline Stefan Richter
2006-07-02 23:02 ` [PATCH 06/19] ieee1394: coding style and comment fixes in midlayer header files Stefan Richter
2006-07-02 23:04 ` [PATCH 07/19] ieee1394: update #include directives " Stefan Richter
2006-07-02 23:05 ` [PATCH 08/19] ieee1394: remove redundant code from ieee1394_hotplug.h Stefan Richter
2006-07-02 23:06 ` [PATCH 09/19] ieee1394: remove unused macros HPSB_PANIC and HPSB_TRACE Stefan Richter
2006-07-02 23:07 ` [PATCH 10/19] ieee1394: clean up declarations of hpsb_*_config_rom Stefan Richter
2006-07-02 23:08 ` [PATCH 11/19] ieee1394: dv1394: sem2mutex conversion Stefan Richter
2006-07-02 23:20 ` [PATCH 12/19] ieee1394: raw1394: remove redundant counting semaphore Stefan Richter
2006-07-02 23:21 ` [PATCH 13/19] ieee1394: nodemgr: remove unnecessary includes Stefan Richter
2006-07-02 23:22 ` [PATCH 14/19] ieee1394: nodemgr: do not spawn kernel_thread for sysfs rescan Stefan Richter
2006-07-02 23:23 ` [PATCH 15/19] ieee1394: nodemgr: make module parameter ignore_drivers writable Stefan Richter
2006-07-02 23:25 ` [PATCH 16/19] ieee1394: nodemgr: switch to kthread api, replace reset semaphore Stefan Richter
2006-07-02 23:26 ` [PATCH 17/19] ieee1394: nodemgr: convert nodemgr_serialize semaphore to mutex Stefan Richter
2006-07-02 23:29 ` [PATCH 18/19] ieee1394: fix kerneldoc of hpsb_alloc_host Stefan Richter
2006-07-02 23:34 ` [PATCH 18a/19 2.6.17-mm5] " Stefan Richter
2006-07-02 23:31 ` [PATCH 19/19] ieee1394: shrink tlabel pools, remove tpool semaphores Stefan Richter
2006-07-03 16:05 ` [PATCH 00/19] ieee1394: misc updates Ben Collins
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.e00aa2fc2df8d106@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=bcollins@ubuntu.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
Powered by JetHome