[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20061206234942.79d6db01.akpm@osdl.org>
Date: Wed, 6 Dec 2006 23:49:42 -0800
From: Andrew Morton <akpm@...l.org>
To: Linus Torvalds <torvalds@...l.org>,
David Howells <dhowells@...hat.com>,
"Maciej W. Rozycki" <macro@...ux-mips.org>,
Roland Dreier <rdreier@...co.com>,
Andy Fleming <afleming@...escale.com>,
Ben Collins <ben.collins@...ntu.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Jeff Garzik <jeff@...zik.org>
Subject: Re: [PATCH] Export current_is_keventd() for libphy
On Wed, 6 Dec 2006 22:42:07 -0800
Andrew Morton <akpm@...l.org> wrote:
> But I wouldn't want to think about an implementation as long as we have
> that WORK_STRUCT_NOAUTOREL horror in there. Can we just nuke that? Only
> three drivers need it and I bet they can be modified to use the usual
> mechanisms.
I guess I don't understand exactly what problem the noautorel stuff is
trying to solve. It _seems_ to me that in all cases we can simply stuff
the old `data' field in alongside the controlling work_struct or
delayed_work which wants to operate on it.
Bridge is the simple case..
diff -puN net/bridge/br_private.h~bridge-avoid-using-noautorel-workqueues net/bridge/br_private.h
--- a/net/bridge/br_private.h~bridge-avoid-using-noautorel-workqueues
+++ a/net/bridge/br_private.h
@@ -83,6 +83,7 @@ struct net_bridge_port
struct timer_list message_age_timer;
struct kobject kobj;
struct delayed_work carrier_check;
+ struct net_device *carrier_check_dev;
struct rcu_head rcu;
};
diff -puN net/bridge/br_if.c~bridge-avoid-using-noautorel-workqueues net/bridge/br_if.c
--- a/net/bridge/br_if.c~bridge-avoid-using-noautorel-workqueues
+++ a/net/bridge/br_if.c
@@ -83,14 +83,11 @@ static void port_carrier_check(struct wo
struct net_device *dev;
struct net_bridge *br;
- dev = container_of(work, struct net_bridge_port,
- carrier_check.work)->dev;
- work_release(work);
-
+ p = container_of(work, struct net_bridge_port, carrier_check.work);
+ dev = p->carrier_check_dev;
rtnl_lock();
- p = dev->br_port;
- if (!p)
- goto done;
+ if (!dev->br_port)
+ goto done; /* Can this happen? */
br = p->br;
if (netif_carrier_ok(dev))
@@ -280,7 +277,8 @@ static struct net_bridge_port *new_nbp(s
p->port_no = index;
br_init_port(p);
p->state = BR_STATE_DISABLED;
- INIT_DELAYED_WORK_NAR(&p->carrier_check, port_carrier_check);
+ p->carrier_check_dev = dev;
+ INIT_DELAYED_WORK(&p->carrier_check, port_carrier_check);
br_stp_port_timer_init(p);
kobject_init(&p->kobj);
_
What am I missing?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists