LKML Archive on
help / color / mirror / Atom feed
From: John Rose <>
To: Jan-Bernd Themann <>
Cc: Jeff Garzik <>,
	Christoph Raisch <>,
	Jan-Bernd Themann <>,
	linux-kernel <>,
	linux-ppc <>,
	Marcus Eder <>, Thomas Klein <>,, netdev <>,
	Nathan Fontenot <>
Subject: Re: [PATCH 2.6.21-rc1] ehea: dynamic add / remove port
Date: Wed, 14 Feb 2007 16:25:06 -0600	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>


A few high level comments, then some really insignificant ones.

First, is there a reason why we shouldn't have a sysfs entry/kobject for
each logical port?  How is it possible to determine, from the adapter
sysfs directory, the current number of ports for that adapter?  A port
sysfs directory could include attributes like the OF path to the port,
the state of the port, etc etc.

Second, the probe and remove functions do not communicate whether an add
or remove was successful.  Combine this with the lack of port
information in the adapter sysfs directory, and the userspace tool has
no way of verifying a dynamic add/remove.

+		dn_log_port_id = (u32*)get_property(eth_dn, "ibm,hea-port-no",
+						    NULL);
+		if (!dn_log_port_id) {
+			ehea_error("bad device node: dn_log_port_id=%p",
+				   dn_log_port_id);

Wouldn't this print NULL every time for dn_log_port_id?  Would the OF
path for eth_dn make for a more useful error msg?

+		ehea_info("%s -> logial port id #%d",

Spelling :)

 	if (port_setup_ok)
-		ret = 0;	/* At least some ports are setup correctly */
+		return 0;	/* At least some ports are setup correctly */
-		ret = -EINVAL;
+		return -EINVAL;

The else is unnecessary.

 static int __devexit ehea_remove(struct ibmebus_dev *dev)
 	struct ehea_adapter *adapter = dev->;
 	u64 hret;
 	int i;
-	for (i = 0; i < adapter->num_ports; i++)
+	for (i = 0; i < EHEA_MAX_PORTS; i++)
 		if (adapter->port[i]) {
 			adapter->port[i] = NULL;

Else break?


  reply	other threads:[~2007-02-14 22:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-14 14:36 Jan-Bernd Themann
2007-02-14 22:25 ` John Rose [this message]
2007-02-15 17:04   ` John Rose
2007-02-16 15:06   ` Jan-Bernd Themann
2007-02-16 15:51     ` John Rose

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 2.6.21-rc1] ehea: dynamic add / remove port' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).