02 Dec, 2006

32 commits

  • Provide a function device_move() to move a device to a new parent device. Add
    auxilliary functions kobject_move() and sysfs_move_dir().
    kobject_move() generates a new uevent of type KOBJ_MOVE, containing the
    previous path (DEVPATH_OLD) in addition to the usual values. For this, a new
    interface kobject_uevent_env() is created that allows to add further
    environmental data to the uevent at the kobject layer.

    Signed-off-by: Cornelia Huck
    Acked-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Cornelia Huck
     
  • This patch makes the needlessly global setup_parent() static.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Greg Kroah-Hartman

    Adrian Bunk
     
  • Introduce device_find_child() to match device_for_each_child().

    Signed-off-by: Cornelia Huck
    Signed-off-by: Greg Kroah-Hartman

    Cornelia Huck
     
  • since most of the files in sysfs are text files,
    it would be nice, if the "store" function called
    during sysfs_write_file() gets a zero terminated
    string / data.
    The current implementation seems not to ensure this.
    (But only if it is the first time the zeroed buffer
    page is allocated.)

    So the buffer can be scanned by sscanf() easily,
    for example.

    This patch simply sets a \0 char behind the
    data in buffer->page.

    Signed-off-by: Thomas Maier
    Signed-off-by: Greg Kroah-Hartman

    Thomas Maier
     
  • Take return value of sysfs_create_group() into account. That function got
    called in case of CPU_ONLINE notification. Since callbacks are not allowed
    to fail on CPU_ONLINE notification do the sysfs group creation on
    CPU_UP_PREPARE notification.

    Also remember if creation succeeded in a bitmask. So it's possible to know
    whether it's legal to call sysfs_remove_group or not.

    In addition some other minor stuff:

    - since CPU_UP_PREPARE might fail add CPU_UP_CANCELED handling as well.
    - use hotcpu_notifier instead of register_hotcpu_notifier.
    - #ifdef code that isn't needed in the !CONFIG_HOTPLUG_CPU case.

    Signed-off-by: Heiko Carstens
    Acked-by: Cornelia Huck
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Heiko Carstens
     
  • Move the call to platform_notify_remove() to after the call to
    bus_remove_device(), where it belongs. It's bogus to notify the platform
    of removal while drivers are still attached to the device and possibly
    still operating since the platform might use this callback to tear down
    some resources used by the driver (ACPI bits, iommu table, ...)

    Signed-off-by: Benjamin Herrenschmidt
    Cc: "Brown, Len"
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Herrenschmidt
     
  • Change ACPI to use dev_archdata instead of firmware_data

    This patch changes ACPI to use the new dev_archdata on i386, x86_64
    and ia64 (is there any other arch using ACPI ?) to store it's
    acpi_handle.

    It also removes the firmware_data field from struct device as this
    was the only user.

    Only build-tested on x86

    Signed-off-by: Benjamin Herrenschmidt
    Cc: Len Brown
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Herrenschmidt
     
  • Add arch specific dev_archdata to struct device

    Adds an arch specific struct dev_arch to struct device. This enables
    architecture to add specific fields to every device in the system, like
    DMA operation pointers, NUMA node ID, firmware specific data, etc...

    Signed-off-by: Benjamin Herrenschmidt
    Acked-by: Andi Kleen
    Acked-By: David Howells
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Herrenschmidt
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    It also makes the struct sound_card to show up as a "real" device
    where all the different sound class devices are placed as childs
    and different card attribute files can hang off of. /sys/class/sound is
    still a flat directory, but the symlink targets of all devices belonging
    to the same card, point the the /sys/devices tree below the new card
    device object.

    Thanks to Kay for the updates to this patch.

    Signed-off-by: Kay Sievers
    Acked-by: Jaroslav Kysela
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • As class_device is going away eventually...

    Cc: Jean Delvare
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    Also fixes up the isdn drivers that were putting something in the class
    device's directory.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This also ment that some of the misc drivers had to also be fixed
    up as they were assuming the device was a class_device.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Turn off class symlinks CONFIG_SYSFS_DEPRECATED is enabled.

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • Disable the PHYSDEV* uevent variables if CONFIG_SYSFS_DEPRECATED is
    enabled.

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • Turn off device symlinks CONFIG_SYSFS_DEPRECATED is enabled.

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • Turn off the bus symlinks if CONFIG_SYSFS_DEPRECATED is enabled

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • If CONFIG_SYSFS_DEPRECATED is enabled, old versions of udev will work
    properly with devices that are associated with a class.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Provide a way to support older versions of udev that are shipped in
    older distros. If this option is disabled, it will also turn off the
    compatible symlinks in sysfs that older programs might rely on.

    When in doubt, or if running a distro older than 2006, say Yes here.

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • It doesn't need to be global or in device.h

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Create the "driver" link before the child device may be created by
    the probing logic. This makes it possible for userspace (udev), to
    determine the driver property of the parent device, at the time the
    child device is created.

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • I finally did as you suggested and added the notifier to the struct
    bus_type itself. There are still problems to be expected is something
    attaches to a bus type where the code can hook in different struct
    device sub-classes (which is imho a big bogosity but I won't even try to
    argue that case now) but it will solve nicely a number of issues I've
    had so far.

    That also means that clients interested in registering for such
    notifications have to do it before devices are added and after bus types
    are registered. Fortunately, most bus types that matter for the various
    usage scenarios I have in mind are registerd at postcore_initcall time,
    which means I have a really nice spot at arch_initcall time to add my
    notifiers.

    There are 4 notifications provided. Device being added (before hooked to
    the bus) and removed (failure of previous case or after being unhooked
    from the bus), along with driver being bound to a device and about to be
    unbound.

    The usage I have for these are:

    - The 2 first ones are used to maintain a struct device_ext that is
    hooked to struct device.firmware_data. This structure contains for now a
    pointer to the Open Firmware node related to the device (if any), the
    NUMA node ID (for quick access to it) and the DMA operations pointers &
    iommu table instance for DMA to/from this device. For bus types I own
    (like IBM VIO or EBUS), I just maintain that structure directly from the
    bus code when creating the devices. But for bus types managed by generic
    code like PCI or platform (actually, of_platform which is a variation of
    platform linked to Open Firmware device-tree), I need this notifier.

    - The other two ones have a completely different usage scenario. I have
    cases where multiple devices and their drivers depend on each other. For
    example, the IBM EMAC network driver needs to attach to a MAL DMA engine
    which is a separate device, and a PHY interface which is also a separate
    device. They are all of_platform_device's (well, about to be with my
    upcoming patches) but there is no say in what precise order the core
    will "probe" them and instanciate the various modules. The solution I
    found for that is to have the drivers for emac to use multithread_probe,
    and wait for a driver to be bound to the target MAL and PHY control
    devices (the device-tree contains reference to the MAL and PHY interface
    nodes, which I can then match to of_platform_devices). Right now, I've
    been polling, but with that notifier, I can more cleanly wait (with a
    timeout of course).

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Herrenschmidt
     

30 Nov, 2006

5 commits


29 Nov, 2006

3 commits

  • * master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
    [NET]: Fix MAX_HEADER setting.
    [NETFILTER]: ipt_REJECT: fix memory corruption
    [NETFILTER]: conntrack: fix refcount leak when finding expectation
    [NETFILTER]: ctnetlink: fix reference count leak
    [NETFILTER]: nf_conntrack: fix the race on assign helper to new conntrack
    [NETFILTER]: nfctnetlink: assign helper to newly created conntrack

    Linus Torvalds
     
  • MAX_HEADER is either set to LL_MAX_HEADER or LL_MAX_HEADER + 48, and
    this is controlled by a set of CONFIG_* ifdef tests.

    It is trying to use LL_MAX_HEADER + 48 when any of the tunnels are
    enabled which set hard_header_len like this:

    dev->hard_header_len = LL_MAX_HEADER + sizeof(struct xxx);

    The correct set of tunnel drivers which do this are:

    ipip
    ip_gre
    ip6_tunnel
    sit

    so make the ifdef test match.

    Noticed by Patrick McHardy and with help from Herbert Xu.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • On devices with hard_header_len > LL_MAX_HEADER ip_route_me_harder()
    reallocates the skb, leading to memory corruption when using the stale
    tcph pointer to update the checksum.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy