[lkml]   [2006]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    SubjectRe: [PATCH] Export current_is_keventd() for libphy
    On Wed, 6 Dec 2006 22:42:07 -0800
    Andrew Morton <> 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,
    - work_release(work);
    + p = container_of(work, struct net_bridge_port,;
    + dev = p->carrier_check_dev;
    - 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;
    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);


    What am I missing?
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2006-12-07 08:53    [W:0.023 / U:9.176 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site