patch sysfs-store-sysfs-inode-nrs-in-s_ino-to-avoid-readdir-oopses.patch queued to -stable tree
This is a note to let you know that we have just queued up the patch titled Subject: sysfs: store sysfs inode nrs in s_ino to avoid readdir oopses to the 2.6.21-stable tree. Its filename is sysfs-store-sysfs-inode-nrs-in-s_ino-to-avoid-readdir-oopses.patch A git repo of this tree can be found at http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary >From [EMAIL PROTECTED] Mon May 21 19:34:01 2007 From: Eric Sandeen <[EMAIL PROTECTED]> Date: Mon, 21 May 2007 21:32:40 -0500 Subject: sysfs: store sysfs inode nrs in s_ino to avoid readdir oopses To: Eric Sandeen <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED], Andrew Morton <[EMAIL PROTECTED]>, Tejun Heo <[EMAIL PROTECTED]>, Linux Kernel Mailing List , Maneesh Soni <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Backport of ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc1/2.6.22-rc1-mm1/broken-out/gregkh-driver-sysfs-allocate-inode-number-using-ida.patch For regular files in sysfs, sysfs_readdir wants to traverse sysfs_dirent->s_dentry->d_inode->i_ino to get to the inode number. But, the dentry can be reclaimed under memory pressure, and there is no synchronization with readdir. This patch follows Tejun's scheme of allocating and storing an inode number in the new s_ino member of a sysfs_dirent, when dirents are created, and retrieving it from there for readdir, so that the pointer chain doesn't have to be traversed. Tejun's upstream patch uses a new-ish "ida" allocator which brings along some extra complexity; this -stable patch has a brain-dead incrementing counter which does not guarantee uniqueness, but because sysfs doesn't hash inodes as iunique expects, uniqueness wasn't guaranteed today anyway. Signed-off-by: Eric Sandeen <[EMAIL PROTECTED]> Cc: Tejun Heo <[EMAIL PROTECTED]> Cc: Maneesh Soni <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- linux-2.6.21.orig/fs/sysfs/dir.c +++ linux-2.6.21/fs/sysfs/dir.c @@ -30,6 +30,14 @@ static struct dentry_operations sysfs_de .d_iput = sysfs_d_iput, }; +static unsigned int sysfs_inode_counter; +ino_t sysfs_get_inum(void) +{ + if (unlikely(sysfs_inode_counter < 3)) + sysfs_inode_counter = 3; + return sysfs_inode_counter++; +} + /* * Allocates a new sysfs_dirent and links it to the parent sysfs_dirent */ @@ -41,6 +49,7 @@ static struct sysfs_dirent * __sysfs_new if (!sd) return NULL; + sd->s_ino = sysfs_get_inum(); atomic_set(&sd->s_count, 1); atomic_set(&sd->s_event, 1); INIT_LIST_HEAD(&sd->s_children); @@ -509,7 +518,7 @@ static int sysfs_readdir(struct file * f switch (i) { case 0: - ino = dentry->d_inode->i_ino; + ino = parent_sd->s_ino; if (filldir(dirent, ".", 1, i, ino, DT_DIR) < 0) break; filp->f_pos++; @@ -538,10 +547,7 @@ static int sysfs_readdir(struct file * f name = sysfs_get_name(next); len = strlen(name); - if (next->s_dentry) - ino = next->s_dentry->d_inode->i_ino; - else - ino = iunique(sysfs_sb, 2); + ino = next->s_ino; if (filldir(dirent, name, len, filp->f_pos, ino, dt_type(next)) < 0) Index: linux-2.6.21/fs/sysfs/inode.c === --- linux-2.6.21.orig/fs/sysfs/inode.c +++ linux-2.6.21/fs/sysfs/inode.c @@ -140,6 +140,7 @@ struct inode * sysfs_new_inode(mode_t mo inode->i_mapping->a_ops = &sysfs_aops; inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info; inode->i_op = &sysfs_inode_operations; + inode->i_ino = sd->s_ino; lockdep_set_class(&inode->i_mutex, &sysfs_inode_imutex_key); if (sd->s_iattr) { Index: linux-2.6.21/fs/sysfs/mount.c === --- linux-2.6.21.orig/fs/sysfs/mount.c +++ linux-2.6.21/fs/sysfs/mount.c @@ -33,6 +33,7 @@ static struct sysfs_dirent sysfs_root = .s_element = NULL, .s_type = SYSFS_ROOT, .s_iattr= NULL, + .s_ino = 1, }; static void sysfs_clear_inode(struct inode *inode) Index: linux-2.6.21/fs/sysfs/sysfs.h === --- linux-2.6.21.orig/
patch usb-hub.c-loops-forever-on-resume-from-ram-due-to-bluetooth.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: USB: hub.c loops forever on resume from ram due to bluetooth to my gregkh-2.6 tree. Its filename is usb-hub.c-loops-forever-on-resume-from-ram-due-to-bluetooth.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Mon May 14 16:48:14 2007 From: Mark Lord <[EMAIL PROTECTED]> Date: Mon, 14 May 2007 19:48:02 -0400 Subject: USB: hub.c loops forever on resume from ram due to bluetooth To: Greg KH <[EMAIL PROTECTED]> Cc: Linux Kernel , Andrew Morton <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> Okay, found it. The root cause here was a missing CONFIG_USB_SUSPEND=y, which means the hci_usb device never got marked as USB_STATE_SUSPENDED, which then caused the loop to go on forever. The system works fine now with CONFIG_USB_SUSPEND=y in the .config. Here's the patch to prevent future lockups for this or other causes. I no longer need it, but it does still seem a good idea. Signed-off-by: Mark Lord <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/core/hub.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -403,9 +403,10 @@ static void hub_tt_kevent (struct work_s struct usb_hub *hub = container_of(work, struct usb_hub, tt.kevent); unsigned long flags; + int limit = 100; spin_lock_irqsave (&hub->tt.lock, flags); - while (!list_empty (&hub->tt.clear_list)) { + while (--limit && !list_empty (&hub->tt.clear_list)) { struct list_head*temp; struct usb_tt_clear *clear; struct usb_device *hdev = hub->hdev; Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are usb/usb-hub.c-loops-forever-on-resume-from-ram-due-to-bluetooth.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch usb-sisusbvga-fix-bug-and-build-warnings.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: USB: sisusbvga: Fix bug and build warnings to my gregkh-2.6 tree. Its filename is usb-sisusbvga-fix-bug-and-build-warnings.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Sun Sep 2 12:54:28 2007 From: Satyam Sharma <[EMAIL PROTECTED]> Date: Mon, 3 Sep 2007 01:37:31 +0530 (IST) Subject: USB: sisusbvga: Fix bug and build warnings To: Linux Kernel Mailing List Cc: Thomas Winischhofer <[EMAIL PROTECTED]>, Greg Kroah-Hartman <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> drivers/usb/misc/sisusbvga/sisusb.c: In function usb_sisusb_init: drivers/usb/misc/sisusbvga/sisusb.c:3321: warning: unused variable sisusb drivers/usb/misc/sisusbvga/sisusb.c:3320: warning: unused variable retval are trivially solved by getting rid of the unused variables. drivers/usb/misc/sisusbvga/sisusb.c: In function sisusb_open drivers/usb/misc/sisusbvga/sisusb.c:2444: warning: sisusb is used uninitialized in this function is a genuine bug (which will cause oops). We cannot use "sisusb" in error path for (!interface), because sisusb will itself be derived from "interface" later. Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/misc/sisusbvga/sisusb.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -2440,10 +2440,8 @@ sisusb_open(struct inode *inode, struct struct usb_interface *interface; int subminor = iminor(inode); - if (!(interface = usb_find_interface(&sisusb_driver, subminor))) { - dev_err(&sisusb->sisusb_dev->dev, "Failed to find interface\n"); + if (!(interface = usb_find_interface(&sisusb_driver, subminor))) return -ENODEV; - } if (!(sisusb = usb_get_intfdata(interface))) return -ENODEV; Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/sysfs-remove-first-pass-at-shadow-directory-support.patch driver/sysfs-introduce-sysfs_rename_mutex.patch driver/sysfs-cosmetic-changes-in-sysfs_lookup.patch driver/sysfs-make-sysfs_add-remove_one-call-link-unlink_sibling-implictly.patch driver/sysfs-make-sysfs_add_one-automatically-check-for-duplicate-entry.patch driver/sysfs-make-sysfs_addrm_finish-return-void.patch driver/sysfs-simplify-sysfs_rename_dir.patch driver/sysfs-kill-sysfs_flag_removed.patch driver/sysfs-remove-s_dentry.patch driver/sysfs-fix-i_mutex-locking-in-sysfs_get_dentry.patch driver/sysfs-in-sysfs_lookup-don-t-open-code-sysfs_find_dirent.patch driver/sysfs-make-sysfs_mount-static.patch driver/sysfs-move-all-of-inode-initialization-into-sysfs_init_inode.patch driver/sysfs-remove-sysfs_instantiate.patch driver/sysfs-rewrite-rename-in-terms-of-sysfs-dirents.patch driver/sysfs-rewrite-sysfs_drop_dentry.patch driver/sysfs-rewrite-sysfs_move_dir-in-terms-of-sysfs-dirents.patch driver/sysfs-simplify-readdir.patch driver/sysfs-simply-sysfs_get_dentry.patch driver/sysfs-use-kill_anon_super.patch usb/usb-drivers-usb-serial-bus.c-fix-incompatible-pointer-type-warning.patch usb/usb-sisusbvga-fix-bug-and-build-warnings.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch kobject-drop-child-parent-ref-at-unregistration.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: Kobject: drop child->parent ref at unregistration to my gregkh-2.6 tree. Its filename is kobject-drop-child-parent-ref-at-unregistration.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Thu Nov 29 13:12:08 2007 From: Alan Stern <[EMAIL PROTECTED]> Date: Mon, 19 Nov 2007 10:53:40 -0500 (EST) Subject: Kobject: drop child->parent ref at unregistration To: Greg KH <[EMAIL PROTECTED]>, Kay Sievers <[EMAIL PROTECTED]> Cc: Kernel development list Message-ID: <[EMAIL PROTECTED]> This patch (as1015) reverts changes that were made to the driver core about four years ago. The intent back then was to avoid certain kinds of invalid memory accesses by leaving kernel objects allocated as long as any of their children were still allocated. The original and correct approach was to wait only as long as any children were still _registered_; that's what this patch reinstates. This fixes a problem in the SCSI core made visible by the class_device to regular device conversion: A reference loop (scsi_device holds reference to request_queue, which is the child of a gendisk, which is the child of the scsi_device) prevents the data structures from being released, even though they are deregistered okay. It's possible that this change will cause a few bugs to surface, things that have been hidden for several years. They can be fixed easily enough by having the child device take an explicit reference to the parent whenever needed. Signed-off-by: Alan Stern <[EMAIL PROTECTED]> Cc: Kay Sievers <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- lib/kobject.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/lib/kobject.c +++ b/lib/kobject.c @@ -149,12 +149,16 @@ void kobject_init(struct kobject * kobj) static void unlink(struct kobject * kobj) { + struct kobject *parent = kobj->parent; + if (kobj->kset) { spin_lock(&kobj->kset->list_lock); list_del_init(&kobj->entry); spin_unlock(&kobj->kset->list_lock); } + kobj->parent = NULL; kobject_put(kobj); + kobject_put(parent); } /** @@ -208,7 +212,6 @@ int kobject_add(struct kobject * kobj) if (error) { /* unlink does the kobject_put() for us */ unlink(kobj); - kobject_put(parent); /* be noisy on error issues */ if (error == -EEXIST) @@ -463,7 +466,6 @@ void kobject_cleanup(struct kobject * ko { struct kobj_type * t = get_ktype(kobj); struct kset * s = kobj->kset; - struct kobject * parent = kobj->parent; const char *name = kobj->k_name; pr_debug("kobject: '%s' (%p): %s\n", @@ -477,7 +479,6 @@ void kobject_cleanup(struct kobject * ko } if (s) kset_put(s); - kobject_put(parent); } static void kobject_release(struct kref *kref) Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/pm-acquire-device-locks-prior-to-suspending.patch driver/create-sys-...-power-when-config_pm-is-set.patch driver/driver-core-fix-race-in-__device_release_driver.patch driver/driver-core-fix-class-glue-dir-cleanup-logic.patch driver/kobject-drop-child-parent-ref-at-unregistration.patch usb/usb-add-support-for-an-older-firmware-revision-for-the-nikon-d200.patch usb/usb-fix-priority-mistakes-in-drivers-usb-core-hub.c.patch usb/usb-fix-signr-comment-in-usbdevice_fs.h.patch usb/usb-mailing-lists-have-changed.patch usb/usb-power-management-documenation-update.patch usb/usb-hcd-avoid-duplicate-local_irq_disable.patch usb/usb-usb-mon-mon_bin.c-cleanups.patch usb/usb-keep-track-of-whether-interface-sysfs-files-exist.patch usb/usb-uevent-environment-key-fix.patch usb/usb-autosuspend-for-cdc-acm.patch usb/usb-fix-up-ehci-startup-synchronization.patch usb/usb-usb-storage-new-lockable-subclass-0x07.patch usb/usb-don-t-change-hc-power-state-for-a-freeze.patch usb/usb-dummy_hcd-don-t-register-drivers-on-the-platform-bus.patch usb/usb-force-handover-port-to-companion-when-hub_port_connect_change-fails.patch usb/usb-make-ksuspend_usbd-thread-non-freezable.patch usb/usb-usb-storage-unusual_devs-entry-for-jetflash-ts1gjf2a.patch usb/usb-storage-always-set-the-allow_restart-flag.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch add-documentation-for-fair_user_sched-sysfs-files.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: Add Documentation for FAIR_USER_SCHED sysfs files to my gregkh-2.6 tree. Its filename is add-documentation-for-fair_user_sched-sysfs-files.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Tue Dec 11 21:51:17 2007 From: Dhaval Giani <[EMAIL PROTECTED]> Date: Wed, 12 Dec 2007 11:18:59 +0530 Subject: Add Documentation for FAIR_USER_SCHED sysfs files To: Greg KH <[EMAIL PROTECTED]> Cc: lkml , Ingo Molnar <[EMAIL PROTECTED]>, Andrew Morton <[EMAIL PROTECTED]>, Srivatsa Vaddagiri <[EMAIL PROTECTED]>, Balbir Singh <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline This patch adds documentation about /sys/kernel/uids//cpu_share to Documentation/ABI. Signed-off-by: Dhaval Giani <[EMAIL PROTECTED]> Cc: Ingo Molnar <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- Documentation/ABI/testing/sysfs-kernel-uids | 14 ++ 1 file changed, 14 insertions(+) --- /dev/null +++ b/Documentation/ABI/testing/sysfs-kernel-uids @@ -0,0 +1,14 @@ +What: /sys/kernel/uids//cpu_shares +Date: December 2007 +Contact: Dhaval Giani <[EMAIL PROTECTED]> + Srivatsa Vaddagiri <[EMAIL PROTECTED]> +Description: + The /sys/kernel/uids//cpu_shares tunable is used + to set the cpu bandwidth a user is allowed. This is a + propotional value. What that means is that if there + are two users logged in, each with an equal number of + shares, then they will get equal CPU bandwidth. Another + example would be, if User A has shares = 1024 and user + B has shares = 2048, User B will get twice the CPU + bandwidth user A will. For more details refer + Documentation/sched-design-CFS.txt Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/struct-user_info-sysfs.patch driver/add-documentation-for-fair_user_sched-sysfs-files.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pm-acquire-device-locks-on-suspend.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PM: Acquire device locks on suspend to my gregkh-2.6 tree. Its filename is pm-acquire-device-locks-on-suspend.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Fri Jan 18 16:29:07 2008 From: "Rafael J. Wysocki" <[EMAIL PROTECTED]> Date: Sat, 12 Jan 2008 20:40:46 +0100 Subject: PM: Acquire device locks on suspend To: Greg KH <[EMAIL PROTECTED]> Cc: Alan Stern <[EMAIL PROTECTED]>, Len Brown <[EMAIL PROTECTED]>, Ingo Molnar <[EMAIL PROTECTED]>, ACPI Devel Maling List <[EMAIL PROTECTED]>, pm list <[EMAIL PROTECTED]>, LKML , Johannes Berg <[EMAIL PROTECTED]>, Andrew Morton <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline From: Rafael J. Wysocki <[EMAIL PROTECTED]> This patch reorganizes the way suspend and resume notifications are sent to drivers. The major changes are that now the PM core acquires every device semaphore before calling the methods, and calls to device_add() during suspends will fail, while calls to device_del() during suspends will block. It also provides a way to safely remove a suspended device with the help of the PM core, by using the device_pm_schedule_removal() callback introduced specifically for this purpose, and updates two drivers (msr and cpuid) that need to use it. Signed-off-by: Alan Stern <[EMAIL PROTECTED]> Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- arch/x86/kernel/cpuid.c|6 arch/x86/kernel/msr.c |6 drivers/base/core.c| 65 + drivers/base/power/main.c | 504 + drivers/base/power/power.h | 12 + include/linux/device.h |8 6 files changed, 414 insertions(+), 187 deletions(-) --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c @@ -157,15 +157,15 @@ static int __cpuinit cpuid_class_cpu_cal switch (action) { case CPU_UP_PREPARE: - case CPU_UP_PREPARE_FROZEN: err = cpuid_device_create(cpu); break; case CPU_UP_CANCELED: - case CPU_UP_CANCELED_FROZEN: case CPU_DEAD: - case CPU_DEAD_FROZEN: cpuid_device_destroy(cpu); break; + case CPU_UP_CANCELED_FROZEN: + destroy_suspended_device(cpuid_class, MKDEV(CPUID_MAJOR, cpu)); + break; } return err ? NOTIFY_BAD : NOTIFY_OK; } --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c @@ -155,15 +155,15 @@ static int __cpuinit msr_class_cpu_callb switch (action) { case CPU_UP_PREPARE: - case CPU_UP_PREPARE_FROZEN: err = msr_device_create(cpu); break; case CPU_UP_CANCELED: - case CPU_UP_CANCELED_FROZEN: case CPU_DEAD: - case CPU_DEAD_FROZEN: msr_device_destroy(cpu); break; + case CPU_UP_CANCELED_FROZEN: + destroy_suspended_device(msr_class, MKDEV(MSR_MAJOR, cpu)); + break; } return err ? NOTIFY_BAD : NOTIFY_OK; } --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -726,11 +726,20 @@ int device_add(struct device *dev) { struct device *parent = NULL; struct class_interface *class_intf; - int error = -EINVAL; + int error; + + error = pm_sleep_lock(); + if (error) { + dev_warn(dev, "Suspicious %s during suspend\n", __FUNCTION__); + dump_stack(); + return error; + } dev = get_device(dev); - if (!dev || !strlen(dev->bus_id)) + if (!dev || !strlen(dev->bus_id)) { + error = -EINVAL; goto Error; + } pr_debug("DEV: registering device: ID = '%s'\n", dev->bus_id); @@ -795,6 +804,7 @@ int device_add(struct device *dev) } Done: put_device(dev); + pm_sleep_unlock(); return error; BusError: device_pm_remove(dev); @@ -905,6 +915,7 @@ void device_del(struct device * dev) struct device * parent = dev->parent; struct class_interface *class_intf; + device_pm_remove(dev); if (parent) klist_del(&dev->knode_parent); if (MAJOR(dev->devt)) @@ -981,7 +992,6 @@ void device_del(struct device * dev) if (dev->bus) blocking_notifier_call_chain(&dev->bus->bus_notifier, BUS_NOTIFY_DEL_DEVICE, dev); - device_pm_remove(dev); kobject_uevent(&dev->kobj, KOBJ_REMOVE); kobject_del(&dev->kobj); if (parent) @@ -1156,14 +1166,11 @@ error: EXPO
patch driver-core-constify-the-name-passed-to-platform_device_register_simple.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: Driver Core: constify the name passed to platform_device_register_simple to my gregkh-2.6 tree. Its filename is driver-core-constify-the-name-passed-to-platform_device_register_simple.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Fri Jan 18 17:28:36 2008 From: Stephen Rothwell <[EMAIL PROTECTED]> Date: Fri, 11 Jan 2008 17:24:53 +1100 Subject: Driver Core: constify the name passed to platform_device_register_simple To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED], LKML Message-ID: <[EMAIL PROTECTED]> This name is just passed to platform_device_alloc which has its parameter declared const. Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/platform.c |2 +- include/linux/platform_device.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -360,7 +360,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregi * the Linux driver model. In particular, when such drivers are built * as modules, they can't be "hotplugged". */ -struct platform_device *platform_device_register_simple(char *name, int id, +struct platform_device *platform_device_register_simple(const char *name, int id, struct resource *res, unsigned int num) { struct platform_device *pdev; --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -35,7 +35,7 @@ extern struct resource *platform_get_res extern int platform_get_irq_byname(struct platform_device *, char *); extern int platform_add_devices(struct platform_device **, int); -extern struct platform_device *platform_device_register_simple(char *, int id, +extern struct platform_device *platform_device_register_simple(const char *, int id, struct resource *, unsigned int); extern struct platform_device *platform_device_alloc(const char *name, int id); Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are bad/battery-class-driver.patch driver/driver-core-constify-the-name-passed-to-platform_device_register_simple.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch xen-fix-register_vcpu_info.patch queued to -stable tree
This is a note to let you know that we have just queued up the patch titled Subject: xen: fix incorrect vcpu_register_vcpu_info hypercall argument to the 2.6.23-stable tree. Its filename is xen-fix-register_vcpu_info.patch A git repo of this tree can be found at http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary >From [EMAIL PROTECTED] Fri Oct 12 14:33:49 2007 From: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Date: Fri, 12 Oct 2007 14:11:40 -0700 Subject: xen: fix incorrect vcpu_register_vcpu_info hypercall argument To: LKML Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], Mark Williamson <[EMAIL PROTECTED]>, Morten Bøgeskov <[EMAIL PROTECTED]>, Chris Wright <[EMAIL PROTECTED]>, Andi Kleen <[EMAIL PROTECTED]>, Andrew Morton <[EMAIL PROTECTED]>, Keir Fraser <[EMAIL PROTECTED]>, Stable Kernel <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline; filename=xen-fix-register_vcpu_info.patch From: Jeremy Fitzhardinge <[EMAIL PROTECTED]> patch e3d2697669abbe26c08dc9b95e2a71c634d096ed in mainline. The kernel's copy of struct vcpu_register_vcpu_info was out of date, at best causing the hypercall to fail and the guest kernel to fall back to the old mechanism, or worse, causing random memory corruption. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Cc: Stable Kernel <[EMAIL PROTECTED]> Cc: Morten =?utf-8?q?B=C3=B8geskov?= <[EMAIL PROTECTED]> Cc: Mark Williamson <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- arch/i386/xen/enlighten.c|2 +- include/xen/interface/vcpu.h |5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) --- a/arch/i386/xen/enlighten.c +++ b/arch/i386/xen/enlighten.c @@ -116,7 +116,7 @@ static void __init xen_vcpu_setup(int cp info.mfn = virt_to_mfn(vcpup); info.offset = offset_in_page(vcpup); - printk(KERN_DEBUG "trying to map vcpu_info %d at %p, mfn %x, offset %d\n", + printk(KERN_DEBUG "trying to map vcpu_info %d at %p, mfn %llx, offset %d\n", cpu, vcpup, info.mfn, info.offset); /* Check to see if the hypervisor will put the vcpu_info --- a/include/xen/interface/vcpu.h +++ b/include/xen/interface/vcpu.h @@ -160,8 +160,9 @@ struct vcpu_set_singleshot_timer { */ #define VCPUOP_register_vcpu_info 10 /* arg == struct vcpu_info */ struct vcpu_register_vcpu_info { -uint32_t mfn; /* mfn of page to place vcpu_info */ -uint32_t offset;/* offset within page */ +uint64_t mfn;/* mfn of page to place vcpu_info */ +uint32_t offset; /* offset within page */ +uint32_t rsvd; /* unused */ }; #endif /* __XEN_PUBLIC_VCPU_H__ */ Patches currently in stable-queue which might be from [EMAIL PROTECTED] are queue-2.6.23/xen-handle-lazy-cr3-on-unpin.patch queue-2.6.23/xen-multicall-callbacks.patch queue-2.6.23/xen-fix-register_vcpu_info.patch queue-2.6.23/xen-xfs-unmap.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch xen-handle-lazy-cr3-on-unpin.patch queued to -stable tree
This is a note to let you know that we have just queued up the patch titled Subject: xen: deal with stale cr3 values when unpinning pagetables to the 2.6.23-stable tree. Its filename is xen-handle-lazy-cr3-on-unpin.patch A git repo of this tree can be found at http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary >From [EMAIL PROTECTED] Fri Oct 12 14:33:57 2007 From: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Date: Fri, 12 Oct 2007 14:11:37 -0700 Subject: xen: deal with stale cr3 values when unpinning pagetables To: LKML Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], Chris Wright <[EMAIL PROTECTED]>, Andi Kleen <[EMAIL PROTECTED]>, Andrew Morton <[EMAIL PROTECTED]>, Keir Fraser <[EMAIL PROTECTED]>, Stable Kernel <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline; filename=xen-handle-lazy-cr3-on-unpin.patch From: Jeremy Fitzhardinge <[EMAIL PROTECTED]> patch 9f79991d4186089e228274196413572cc000143b in mainline. When a pagetable is no longer in use, it must be unpinned so that its pages can be freed. However, this is only possible if there are no stray uses of the pagetable. The code currently deals with all the usual cases, but there's a rare case where a vcpu is changing cr3, but is doing so lazily, and the change hasn't actually happened by the time the pagetable is unpinned, even though it appears to have been completed. This change adds a second per-cpu cr3 variable - xen_current_cr3 - which tracks the actual state of the vcpu cr3. It is only updated once the actual hypercall to set cr3 has been completed. Other processors wishing to unpin a pagetable can check other vcpu's xen_current_cr3 values to see if any cross-cpu IPIs are needed to clean things up. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- arch/i386/xen/enlighten.c | 55 +++--- arch/i386/xen/mmu.c | 29 +--- arch/i386/xen/xen-ops.h |1 3 files changed, 65 insertions(+), 20 deletions(-) --- a/arch/i386/xen/enlighten.c +++ b/arch/i386/xen/enlighten.c @@ -56,7 +56,23 @@ DEFINE_PER_CPU(enum paravirt_lazy_mode, DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info); -DEFINE_PER_CPU(unsigned long, xen_cr3); + +/* + * Note about cr3 (pagetable base) values: + * + * xen_cr3 contains the current logical cr3 value; it contains the + * last set cr3. This may not be the current effective cr3, because + * its update may be being lazily deferred. However, a vcpu looking + * at its own cr3 can use this value knowing that it everything will + * be self-consistent. + * + * xen_current_cr3 contains the actual vcpu cr3; it is set once the + * hypercall to set the vcpu cr3 is complete (so it may be a little + * out of date, but it will never be set early). If one vcpu is + * looking at another vcpu's cr3 value, it should use this variable. + */ +DEFINE_PER_CPU(unsigned long, xen_cr3); /* cr3 stored as physaddr */ +DEFINE_PER_CPU(unsigned long, xen_current_cr3); /* actual vcpu cr3 */ struct start_info *xen_start_info; EXPORT_SYMBOL_GPL(xen_start_info); @@ -632,32 +648,36 @@ static unsigned long xen_read_cr3(void) return x86_read_percpu(xen_cr3); } +static void set_current_cr3(void *v) +{ + x86_write_percpu(xen_current_cr3, (unsigned long)v); +} + static void xen_write_cr3(unsigned long cr3) { + struct mmuext_op *op; + struct multicall_space mcs; + unsigned long mfn = pfn_to_mfn(PFN_DOWN(cr3)); + BUG_ON(preemptible()); - if (cr3 == x86_read_percpu(xen_cr3)) { - /* just a simple tlb flush */ - xen_flush_tlb(); - return; - } + mcs = xen_mc_entry(sizeof(*op)); /* disables interrupts */ + /* Update while interrupts are disabled, so its atomic with + respect to ipis */ x86_write_percpu(xen_cr3, cr3); + op = mcs.args; + op->cmd = MMUEXT_NEW_BASEPTR; + op->arg1.mfn = mfn; - { - struct mmuext_op *op; - struct multicall_space mcs = xen_mc_entry(sizeof(*op)); - unsigned long mfn = pfn_to_mfn(PFN_DOWN(cr3)); - - op = mcs.args; - op->cmd = MMUEXT_NEW_BASEPTR; - op->arg1.mfn = mfn; + MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF); - MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF); + /* Update xen_update_cr3 once the batch has actually + been submitted. */ + xen_mc_callback(set_current_cr3, (void *)cr3); - xen_mc_issue(PARAVIRT_LAZY_CPU); - } + xen_mc_issue(PARAVIRT_LAZY_CPU); /* interrupts restored */ } /* Early in boot, while setting up the initial pagetable, assume @@ -1113,6 +1133,7 @@ asmlinkage void __init xen_start_kernel( /* keep using Xen gdt for now;
patch xen-multicall-callbacks.patch queued to -stable tree
This is a note to let you know that we have just queued up the patch titled Subject: xen: add batch completion callbacks to the 2.6.23-stable tree. Its filename is xen-multicall-callbacks.patch A git repo of this tree can be found at http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary >From [EMAIL PROTECTED] Fri Oct 12 14:33:42 2007 From: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Date: Fri, 12 Oct 2007 14:11:36 -0700 Subject: xen: add batch completion callbacks To: LKML Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], Chris Wright <[EMAIL PROTECTED]>, Andi Kleen <[EMAIL PROTECTED]>, Andrew Morton <[EMAIL PROTECTED]>, Keir Fraser <[EMAIL PROTECTED]>, Stable Kernel <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline; filename=xen-multicall-callbacks.patch From: Jeremy Fitzhardinge <[EMAIL PROTECTED]> patch 91e0c5f3dad47838cb2ecc1865ce789a0b7182b1 in mainline. This adds a mechanism to register a callback function to be called once a batch of hypercalls has been issued. This is typically used to unlock things which must remain locked until the hypercall has taken place. Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- arch/i386/xen/multicalls.c | 29 ++--- arch/i386/xen/multicalls.h |3 +++ 2 files changed, 29 insertions(+), 3 deletions(-) --- a/arch/i386/xen/multicalls.c +++ b/arch/i386/xen/multicalls.c @@ -32,7 +32,11 @@ struct mc_buffer { struct multicall_entry entries[MC_BATCH]; u64 args[MC_ARGS]; - unsigned mcidx, argidx; + struct callback { + void (*fn)(void *); + void *data; + } callbacks[MC_BATCH]; + unsigned mcidx, argidx, cbidx; }; static DEFINE_PER_CPU(struct mc_buffer, mc_buffer); @@ -43,6 +47,7 @@ void xen_mc_flush(void) struct mc_buffer *b = &__get_cpu_var(mc_buffer); int ret = 0; unsigned long flags; + int i; BUG_ON(preemptible()); @@ -51,8 +56,6 @@ void xen_mc_flush(void) local_irq_save(flags); if (b->mcidx) { - int i; - if (HYPERVISOR_multicall(b->entries, b->mcidx) != 0) BUG(); for (i = 0; i < b->mcidx; i++) @@ -65,6 +68,13 @@ void xen_mc_flush(void) local_irq_restore(flags); + for(i = 0; i < b->cbidx; i++) { + struct callback *cb = &b->callbacks[i]; + + (*cb->fn)(cb->data); + } + b->cbidx = 0; + BUG_ON(ret); } @@ -88,3 +98,16 @@ struct multicall_space __xen_mc_entry(si return ret; } + +void xen_mc_callback(void (*fn)(void *), void *data) +{ + struct mc_buffer *b = &__get_cpu_var(mc_buffer); + struct callback *cb; + + if (b->cbidx == MC_BATCH) + xen_mc_flush(); + + cb = &b->callbacks[b->cbidx++]; + cb->fn = fn; + cb->data = data; +} --- a/arch/i386/xen/multicalls.h +++ b/arch/i386/xen/multicalls.h @@ -42,4 +42,7 @@ static inline void xen_mc_issue(unsigned local_irq_restore(x86_read_percpu(xen_mc_irq_flags)); } +/* Set up a callback to be called when the current batch is flushed */ +void xen_mc_callback(void (*fn)(void *), void *data); + #endif /* _XEN_MULTICALLS_H */ Patches currently in stable-queue which might be from [EMAIL PROTECTED] are queue-2.6.23/xen-handle-lazy-cr3-on-unpin.patch queue-2.6.23/xen-multicall-callbacks.patch queue-2.6.23/xen-fix-register_vcpu_info.patch queue-2.6.23/xen-xfs-unmap.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch xen-xfs-unmap.patch queued to -stable tree
This is a note to let you know that we have just queued up the patch titled Subject: xfs: eagerly remove vmap mappings to avoid upsetting Xen to the 2.6.23-stable tree. Its filename is xen-xfs-unmap.patch A git repo of this tree can be found at http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary >From [EMAIL PROTECTED] Fri Oct 12 14:33:36 2007 From: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Date: Fri, 12 Oct 2007 14:11:42 -0700 Subject: xfs: eagerly remove vmap mappings to avoid upsetting Xen To: LKML Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], Mark Williamson <[EMAIL PROTECTED]>, XFS masters <[EMAIL PROTECTED]>, Chris Wright <[EMAIL PROTECTED]>, Andi Kleen <[EMAIL PROTECTED]>, Morten Bøgeskov <[EMAIL PROTECTED]>, Andrew Morton <[EMAIL PROTECTED]>, Keir Fraser <[EMAIL PROTECTED]>, Stable kernel <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline; filename=xen-xfs-unmap.patch From: Jeremy Fitzhardinge <[EMAIL PROTECTED]> patch ace2e92e193126711cb3a83a3752b2c5b8396950 in mainline. XFS leaves stray mappings around when it vmaps memory to make it virtually contigious. This upsets Xen if one of those pages is being recycled into a pagetable, since it finds an extra writable mapping of the page. This patch solves the problem in a brute force way, by making XFS always eagerly unmap its mappings. [ Stable: This works around a bug in 2.6.23. We may come up with a better solution for mainline, but this seems like a low-impact fix for the stable kernel. ] Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Cc: XFS masters <[EMAIL PROTECTED]> Cc: Morten =?utf-8?q?B=C3=B8geskov?= <[EMAIL PROTECTED]> Cc: Mark Williamson <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- fs/xfs/linux-2.6/xfs_buf.c | 13 + 1 file changed, 13 insertions(+) --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c @@ -187,6 +187,19 @@ free_address( { a_list_t*aentry; +#ifdef CONFIG_XEN + /* +* Xen needs to be able to make sure it can get an exclusive +* RO mapping of pages it wants to turn into a pagetable. If +* a newly allocated page is also still being vmap()ed by xfs, +* it will cause pagetable construction to fail. This is a +* quick workaround to always eagerly unmap pages so that Xen +* is happy. +*/ + vunmap(addr); + return; +#endif + aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT); if (likely(aentry)) { spin_lock(&as_lock); Patches currently in stable-queue which might be from [EMAIL PROTECTED] are queue-2.6.23/xen-handle-lazy-cr3-on-unpin.patch queue-2.6.23/xen-multicall-callbacks.patch queue-2.6.23/xen-fix-register_vcpu_info.patch queue-2.6.23/xen-xfs-unmap.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch uml-fix-kernel-vs-libc-symbols-clash.patch queued to -stable tree
This is a note to let you know that we have just queued up the patch titled Subject: UML - Fix kernel vs libc symbols clash to the 2.6.23-stable tree. Its filename is uml-fix-kernel-vs-libc-symbols-clash.patch A git repo of this tree can be found at http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary >From [EMAIL PROTECTED] Thu Nov 1 12:54:06 2007 From: Jeff Dike <[EMAIL PROTECTED]> Date: Thu, 1 Nov 2007 15:53:26 -0400 Subject: UML - Fix kernel vs libc symbols clash To: [EMAIL PROTECTED] Cc: LKML , uml-devel <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline From: Jeff Dike <[EMAIL PROTECTED]> commit 818f6ef407b448cef63294b9d0f6f8a2af9cb817 in mainline. uml: fix an IPV6 libc vs kernel symbol clash On some systems, with IPV6 configured, there is a clash between the kernel's in6addr_any and the one in libc. This is handled in the usual (gross) way of defining the kernel symbol out of the way on the gcc command line. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- arch/um/Makefile |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -60,7 +60,8 @@ SYS_DIR := $(ARCH_DIR)/include/sysdep-$ CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ - -Din6addr_loopback=kernel_in6addr_loopback + -Din6addr_loopback=kernel_in6addr_loopback \ + -Din6addr_any=kernel_in6addr_any AFLAGS += $(ARCH_INCLUDE) Patches currently in stable-queue which might be from [EMAIL PROTECTED] are queue-2.6.23/uml-stop-using-libc-asm-page.h.patch queue-2.6.23/uml-fix-kernel-vs-libc-symbols-clash.patch queue-2.6.23/uml-stop-using-libc-asm-user.h.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch uml-kill-subprocesses-on-exit.patch queued to -stable tree
This is a note to let you know that we have just queued up the patch titled Subject: UML - kill subprocesses on exit to the 2.6.23-stable tree. Its filename is uml-kill-subprocesses-on-exit.patch A git repo of this tree can be found at http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary >From [EMAIL PROTECTED] Thu Nov 1 12:54:06 2007 From: Lepton Wu <[EMAIL PROTECTED]> Date: Thu, 1 Nov 2007 15:53:27 -0400 Subject: UML - kill subprocesses on exit To: [EMAIL PROTECTED] Cc: LKML , uml-devel <[EMAIL PROTECTED]>, Lepton Wu <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline From: Lepton Wu <[EMAIL PROTECTED]> commit a24864a1d52a97e345a6bd4862a057f98364d098 uml: definitively kill subprocesses on panic In a stock 2.6.22.6 kernel, poweroff a user mode linux guest (2.6.22.6 running in skas0 mode) will halt the host linux. I think the reason is the kernel thread abort because of a bug. Then the sys_reboot in process of user mode linux guest is not trapped by the user mode linux kernel and is executed by host. I think it is better to make sure all of our children process to quit when user mode linux kernel abort. [ jdike - the kernel process needs to ignore SIGTERM, plus the waitpid/kill loop is needed to make sure that all of our children are dead before the kernel exits ] Signed-off-by: Lepton Wu <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- arch/um/os-Linux/skas/process.c |2 +- arch/um/os-Linux/util.c | 38 ++ 2 files changed, 39 insertions(+), 1 deletion(-) --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c @@ -182,7 +182,7 @@ static int userspace_tramp(void *stack) ptrace(PTRACE_TRACEME, 0, 0, 0); - init_new_thread_signals(); + signal(SIGTERM, SIG_DFL); err = set_interval(1); if(err) panic("userspace_tramp - setting timer failed, errno = %d\n", --- a/arch/um/os-Linux/util.c +++ b/arch/um/os-Linux/util.c @@ -105,6 +105,44 @@ int setjmp_wrapper(void (*proc)(void *, void os_dump_core(void) { + int pid; + signal(SIGSEGV, SIG_DFL); + + /* +* We are about to SIGTERM this entire process group to ensure that +* nothing is around to run after the kernel exits. The +* kernel wants to abort, not die through SIGTERM, so we +* ignore it here. +*/ + + signal(SIGTERM, SIG_IGN); + kill(0, SIGTERM); + /* +* Most of the other processes associated with this UML are +* likely sTopped, so give them a SIGCONT so they see the +* SIGTERM. +*/ + kill(0, SIGCONT); + + /* +* Now, having sent signals to everyone but us, make sure they +* die by ptrace. Processes can survive what's been done to +* them so far - the mechanism I understand is receiving a +* SIGSEGV and segfaulting immediately upon return. There is +* always a SIGSEGV pending, and (I'm guessing) signals are +* processed in numeric order so the SIGTERM (signal 15 vs +* SIGSEGV being signal 11) is never handled. +* +* Run a waitpid loop until we get some kind of error. +* Hopefully, it's ECHILD, but there's not a lot we can do if +* it's something else. Tell os_kill_ptraced_process not to +* wait for the child to report its death because there's +* nothing reasonable to do if that fails. +*/ + + while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) + os_kill_ptraced_process(pid, 0); + abort(); } Patches currently in stable-queue which might be from [EMAIL PROTECTED] are queue-2.6.23/uml-kill-subprocesses-on-exit.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch uml-stop-using-libc-asm-page.h.patch queued to -stable tree
This is a note to let you know that we have just queued up the patch titled Subject: UML - Stop using libc asm/page.h to the 2.6.23-stable tree. Its filename is uml-stop-using-libc-asm-page.h.patch A git repo of this tree can be found at http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary >From [EMAIL PROTECTED] Thu Nov 1 12:53:55 2007 From: Jeff Dike <[EMAIL PROTECTED]> Date: Thu, 1 Nov 2007 15:53:25 -0400 Subject: UML - Stop using libc asm/page.h To: [EMAIL PROTECTED] Cc: LKML , uml-devel <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline From: Jeff Dike <[EMAIL PROTECTED]> commit 71f926f2ea61994470a53c9e11d3ef993197cada in mainline. uml: stop using libc asm/page.h Remove includes of asm/page.h from libc code. This header seems to be disappearing, and UML doesn't make much use of it anyway. The one use, PAGE_SHIFT in stub.h, is handled by copying the constant from the kernel side of the house in common_offsets.h. [ jdike - added arch/um/kernel/skas/clone.c for -stable ] Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- arch/um/include/common-offsets.h |1 + arch/um/include/sysdep-i386/stub.h |3 +-- arch/um/kernel/skas/clone.c|1 - arch/um/os-Linux/main.c|1 - arch/um/os-Linux/skas/mem.c|1 - arch/um/os-Linux/start_up.c|1 - arch/um/os-Linux/tt.c |1 - 7 files changed, 2 insertions(+), 7 deletions(-) --- a/arch/um/include/common-offsets.h +++ b/arch/um/include/common-offsets.h @@ -10,6 +10,7 @@ OFFSET(HOST_TASK_PID, task_struct, pid); DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE); DEFINE(UM_KERN_PAGE_MASK, PAGE_MASK); +DEFINE(UM_KERN_PAGE_SHIFT, PAGE_SHIFT); DEFINE(UM_NSEC_PER_SEC, NSEC_PER_SEC); DEFINE_STR(UM_KERN_EMERG, KERN_EMERG); --- a/arch/um/include/sysdep-i386/stub.h +++ b/arch/um/include/sysdep-i386/stub.h @@ -9,7 +9,6 @@ #include #include #include -#include #include "stub-data.h" #include "kern_constants.h" #include "uml-config.h" @@ -19,7 +18,7 @@ extern void stub_clone_handler(void); #define STUB_SYSCALL_RET EAX #define STUB_MMAP_NR __NR_mmap2 -#define MMAP_OFFSET(o) ((o) >> PAGE_SHIFT) +#define MMAP_OFFSET(o) ((o) >> UM_KERN_PAGE_SHIFT) static inline long stub_syscall0(long syscall) { --- a/arch/um/kernel/skas/clone.c +++ b/arch/um/kernel/skas/clone.c @@ -3,7 +3,6 @@ #include #include #include -#include #include "ptrace_user.h" #include "skas.h" #include "stub-data.h" --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -12,7 +12,6 @@ #include #include #include -#include #include "kern_util.h" #include "as-layout.h" #include "mem_user.h" --- a/arch/um/os-Linux/skas/mem.c +++ b/arch/um/os-Linux/skas/mem.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include "mem_user.h" #include "mem.h" --- a/arch/um/os-Linux/start_up.c +++ b/arch/um/os-Linux/start_up.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include "kern_util.h" #include "user.h" --- a/arch/um/os-Linux/tt.c +++ b/arch/um/os-Linux/tt.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "kern_util.h" #include "user.h" #include "signal_kern.h" Patches currently in stable-queue which might be from [EMAIL PROTECTED] are queue-2.6.23/uml-stop-using-libc-asm-page.h.patch queue-2.6.23/uml-fix-kernel-vs-libc-symbols-clash.patch queue-2.6.23/uml-stop-using-libc-asm-user.h.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch uml-stop-using-libc-asm-user.h.patch queued to -stable tree
This is a note to let you know that we have just queued up the patch titled Subject: UML - stop using libc asm/user.h to the 2.6.23-stable tree. Its filename is uml-stop-using-libc-asm-user.h.patch A git repo of this tree can be found at http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary >From [EMAIL PROTECTED] Thu Nov 1 12:54:17 2007 From: Jeff Dike <[EMAIL PROTECTED]> Date: Thu, 1 Nov 2007 15:53:26 -0400 Subject: UML - stop using libc asm/user.h To: [EMAIL PROTECTED] Cc: LKML , uml-devel <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline From: Jeff Dike <[EMAIL PROTECTED]> commit 189872f968def833727b6bfef83ebd7440c538e6 in mainline. uml: don't use glibc asm/user.h Stop including asm/user.h from libc - it seems to be disappearing from distros. It's replaced with sys/user.h which defines user_fpregs_struct and user_fpxregs_struct instead of user_i387_struct and struct user_fxsr_struct on i386. As a bonus, on x86_64, I get to dump some stupid typedefs which were needed in order to get asm/user.h to compile. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- arch/um/sys-i386/user-offsets.c |6 +++--- arch/um/sys-x86_64/user-offsets.c |9 + 2 files changed, 4 insertions(+), 11 deletions(-) --- a/arch/um/sys-i386/user-offsets.c +++ b/arch/um/sys-i386/user-offsets.c @@ -2,9 +2,9 @@ #include #include #include +#include #include #include -#include #define DEFINE(sym, val) \ asm volatile("\n->" #sym " %0 " #val : : "i" (val)) @@ -48,8 +48,8 @@ void foo(void) OFFSET(HOST_SC_FP_ST, _fpstate, _st); OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env); - DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_i387_struct)); - DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fxsr_struct)); + DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_fpregs_struct)); + DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fpxregs_struct)); DEFINE(HOST_IP, EIP); DEFINE(HOST_SP, UESP); --- a/arch/um/sys-x86_64/user-offsets.c +++ b/arch/um/sys-x86_64/user-offsets.c @@ -3,17 +3,10 @@ #include #include #include +#include #define __FRAME_OFFSETS #include #include -/* For some reason, x86_64 defines u64 and u32 only in , which I - * refuse to include here, even though they're used throughout the headers. - * These are used in asm/user.h, and that include can't be avoided because of - * the sizeof(struct user_regs_struct) below. - */ -typedef __u64 u64; -typedef __u32 u32; -#include #define DEFINE(sym, val) \ asm volatile("\n->" #sym " %0 " #val : : "i" (val)) Patches currently in stable-queue which might be from [EMAIL PROTECTED] are queue-2.6.23/uml-stop-using-libc-asm-page.h.patch queue-2.6.23/uml-fix-kernel-vs-libc-symbols-clash.patch queue-2.6.23/uml-stop-using-libc-asm-user.h.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pci-fix-bus-resource-assignment-on-32-bits-with-64b-resources.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: Fix bus resource assignment on 32 bits with 64b resources to my gregkh-2.6 tree. Its filename is pci-fix-bus-resource-assignment-on-32-bits-with-64b-resources.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Sun Dec 9 22:32:23 2007 From: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Date: Mon, 10 Dec 2007 17:32:15 +1100 Subject: PCI: Fix bus resource assignment on 32 bits with 64b resources To: Greg Kroah-Hartman <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED], <[EMAIL PROTECTED]>, Message-ID: <[EMAIL PROTECTED]> The current pci_assign_unassigned_resources() code doesn't work properly on 32 bits platforms with 64 bits resources. The main reason is the use of unsigned long in various places instead of resource_size_t. This fixes it, along with some tricks to avoid casting to 64 bits on platforms that don't need it in every printk around. This is a pre-requisite for making powerpc use the generic code instead of its own half-useful implementation. Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/setup-bus.c | 64 ++-- include/linux/pci.h |4 +-- 2 files changed, 42 insertions(+), 26 deletions(-) --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -89,8 +89,9 @@ void pci_setup_cardbus(struct pci_bus *b * The IO resource is allocated a range twice as large as it * would normally need. This allows us to set both IO regs. */ - printk(" IO window: %08lx-%08lx\n", - region.start, region.end); + printk(KERN_INFO " IO window: 0x%08lx-0x%08lx\n", + (unsigned long)region.start, + (unsigned long)region.end); pci_write_config_dword(bridge, PCI_CB_IO_BASE_0, region.start); pci_write_config_dword(bridge, PCI_CB_IO_LIMIT_0, @@ -99,8 +100,9 @@ void pci_setup_cardbus(struct pci_bus *b pcibios_resource_to_bus(bridge, ®ion, bus->resource[1]); if (bus->resource[1]->flags & IORESOURCE_IO) { - printk(" IO window: %08lx-%08lx\n", - region.start, region.end); + printk(KERN_INFO " IO window: 0x%08lx-0x%08lx\n", + (unsigned long)region.start, + (unsigned long)region.end); pci_write_config_dword(bridge, PCI_CB_IO_BASE_1, region.start); pci_write_config_dword(bridge, PCI_CB_IO_LIMIT_1, @@ -109,8 +111,9 @@ void pci_setup_cardbus(struct pci_bus *b pcibios_resource_to_bus(bridge, ®ion, bus->resource[2]); if (bus->resource[2]->flags & IORESOURCE_MEM) { - printk(" PREFETCH window: %08lx-%08lx\n", - region.start, region.end); + printk(KERN_INFO " PREFETCH window: 0x%08lx-0x%08lx\n", + (unsigned long)region.start, + (unsigned long)region.end); pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_0, region.start); pci_write_config_dword(bridge, PCI_CB_MEMORY_LIMIT_0, @@ -119,8 +122,9 @@ void pci_setup_cardbus(struct pci_bus *b pcibios_resource_to_bus(bridge, ®ion, bus->resource[3]); if (bus->resource[3]->flags & IORESOURCE_MEM) { - printk(" MEM window: %08lx-%08lx\n", - region.start, region.end); + printk(KERN_INFO " MEM window: 0x%08lx-0x%08lx\n", + (unsigned long)region.start, + (unsigned long)region.end); pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_1, region.start); pci_write_config_dword(bridge, PCI_CB_MEMORY_LIMIT_1, @@ -145,7 +149,7 @@ pci_setup_bridge(struct pci_bus *bus) { struct pci_dev *bridge = bus->self; struct pci_bus_region region; - u32 l, io_upper16; + u32 l, bu, lu, io_upper16; DBG(KERN_INFO "PCI: Bridge: %s\n", pci_name(bridge)); @@ -159,7 +163,8 @@ pci_setup_bridge(struct pci_bus *bus) /* Set up upper 16 bits of I/O base/limit. */ io_upper16 = (region.end & 0x) | (region.start >> 16); DBG(KERN_INFO " IO window: %04lx-%04lx\n", - region.start, region.end); + (unsigned long)region.start, +
patch pci-fix-warning-in-setup-res.c-on-32-bit-platforms-with-64-bit-resources.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: Fix warning in setup-res.c on 32-bit platforms with 64-bit resources to my gregkh-2.6 tree. Its filename is pci-fix-warning-in-setup-res.c-on-32-bit-platforms-with-64-bit-resources.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Sun Dec 9 22:32:23 2007 From: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Date: Mon, 10 Dec 2007 17:32:16 +1100 Subject: PCI: Fix warning in setup-res.c on 32-bit platforms with 64-bit resources To: Greg Kroah-Hartman <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED], <[EMAIL PROTECTED]>, Message-ID: <[EMAIL PROTECTED]> This adds appropriate casts to avoid a warning and print the correct values in pr_debug. Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/setup-res.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -51,10 +51,12 @@ pci_update_resource(struct pci_dev *dev, pcibios_resource_to_bus(dev, ®ion, res); - pr_debug(" got res [%llx:%llx] bus [%lx:%lx] flags %lx for " + pr_debug(" got res [%llx:%llx] bus [%llx:%llx] flags %lx for " "BAR %d of %s\n", (unsigned long long)res->start, (unsigned long long)res->end, -region.start, region.end, res->flags, resno, pci_name(dev)); +(unsigned long long)region.start, +(unsigned long long)region.end, +(unsigned long)res->flags, resno, pci_name(dev)); new = region.start | (res->flags & PCI_REGION_FLAG_MASK); if (res->flags & IORESOURCE_IO) Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are bad/battery-class-driver.patch driver/adb-convert-from-class_device-to-device.patch driver/kobject-convert-hvc_console-to-use-kref-not-kobject.patch driver/kobject-convert-hvcs-to-use-kref-not-kobject.patch driver/kobject-convert-icom-to-use-kref-not-kobject.patch pci/pci-fix-bus-resource-assignment-on-32-bits-with-64b-resources.patch pci/pci-fix-warning-in-setup-res.c-on-32-bit-platforms-with-64-bit-resources.patch usb/usb-remove-ohci-useless-masking-unmasking-of-wdh-interrupt.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pci-add-pci_enable_device_-io-mem-intefaces.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: Add pci_enable_device_{io,mem} intefaces to my gregkh-2.6 tree. Its filename is pci-add-pci_enable_device_-io-mem-intefaces.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Wed Dec 19 20:30:44 2007 From: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Date: Thu, 20 Dec 2007 15:28:08 +1100 Subject: PCI: Add pci_enable_device_{io,mem} intefaces To: Greg Kroah-Hartman <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED], , <[EMAIL PROTECTED]>, Alan Cox <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>, Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> The pci_enable_device_bars() interface isn't well suited to PCI because you can't actually enable/disable BARs individually on a device. So for example, if a device has 2 memory BARs 0 and 1, and one of them (let's say 1) has not been successfully allocated by the firmware or the kernel, then enabling memory decoding shouldn't be permitted for the entire device since it will decode whatever random address is still in that BAR 1. So a device must be either fully enabled for IO, for Memory, or for both. Not on a per-BAR basis. This provides two new functions, pci_enable_device_io() and pci_enable_device_mem() to replace pci_enable_device_bars(). The implementation internally builds a BAR mask in order to be able to use existing arch infrastructure. Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Acked-by: Ivan Kokshaysky <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/pci.c | 49 - include/linux/pci.h |2 ++ 2 files changed, 50 insertions(+), 1 deletion(-) --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -764,6 +764,51 @@ pci_enable_device_bars(struct pci_dev *d return err; } +static int __pci_enable_device_flags(struct pci_dev *dev, +resource_size_t flags) +{ + int err; + int i, bars = 0; + + if (atomic_add_return(1, &dev->enable_cnt) > 1) + return 0; /* already enabled */ + + for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) + if (dev->resource[i].flags & flags) + bars |= (1 << i); + + err = do_pci_enable_device(dev, bars); + if (err < 0) + atomic_dec(&dev->enable_cnt); + return err; +} + +/** + * pci_enable_device_io - Initialize a device for use with IO space + * @dev: PCI device to be initialized + * + * Initialize device before it's used by a driver. Ask low-level code + * to enable I/O resources. Wake up the device if it was suspended. + * Beware, this function can fail. + */ +int pci_enable_device_io(struct pci_dev *dev) +{ + return __pci_enable_device_flags(dev, IORESOURCE_IO); +} + +/** + * pci_enable_device_mem - Initialize a device for use with Memory space + * @dev: PCI device to be initialized + * + * Initialize device before it's used by a driver. Ask low-level code + * to enable Memory resources. Wake up the device if it was suspended. + * Beware, this function can fail. + */ +int pci_enable_device_mem(struct pci_dev *dev) +{ + return __pci_enable_device_flags(dev, IORESOURCE_MEM); +} + /** * pci_enable_device - Initialize device before it's used by a driver. * @dev: PCI device to be initialized @@ -777,7 +822,7 @@ pci_enable_device_bars(struct pci_dev *d */ int pci_enable_device(struct pci_dev *dev) { - return pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1); + return __pci_enable_device_flags(dev, IORESOURCE_MEM | IORESOURCE_IO); } /* @@ -1651,6 +1696,8 @@ device_initcall(pci_init); EXPORT_SYMBOL(pci_reenable_device); EXPORT_SYMBOL(pci_enable_device_bars); +EXPORT_SYMBOL(pci_enable_device_io); +EXPORT_SYMBOL(pci_enable_device_mem); EXPORT_SYMBOL(pci_enable_device); EXPORT_SYMBOL(pcim_enable_device); EXPORT_SYMBOL(pcim_pin_device); --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -544,6 +544,8 @@ static inline int pci_write_config_dword int __must_check pci_enable_device(struct pci_dev *dev); int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); +int __must_check pci_enable_device_io(struct pci_dev *dev); +int __must_check pci_enable_device_mem(struct pci_dev *dev); int __must_check pci_reenable_device(struct pci_dev *); int __must_check pcim_enable_device(struct pci_dev *pdev); void pcim_pin_device(struct pci_dev *pdev); Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are bad/battery-class-driver.patch driver/adb-convert-from-class_device-to-device.patch driver/kobject-convert-hvc_console-to-use-kre
patch pci-correctly-initialize-a-structure-for-pcie_save_pcix_state.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: correctly initialize a structure for pcie_save_pcix_state() to my gregkh-2.6 tree. Its filename is pci-correctly-initialize-a-structure-for-pcie_save_pcix_state.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Mon Dec 17 18:02:37 2007 From: Shaohua Li <[EMAIL PROTECTED]> Date: Tue, 18 Dec 2007 09:56:56 +0800 Subject: PCI: correctly initialize a structure for pcie_save_pcix_state() To: lkml Cc: Andrew Morton <[EMAIL PROTECTED]>, Greg KH <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> save_state->cap_nr should be correctly set, otherwise we can't find the saved cap at resume. Signed-off-by: Shaohua Li <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/pci.c |2 ++ 1 file changed, 2 insertions(+) --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -587,6 +587,7 @@ static int pci_save_pcie_state(struct pc pci_read_config_word(dev, pos + PCI_EXP_LNKCTL, &cap[i++]); pci_read_config_word(dev, pos + PCI_EXP_SLTCTL, &cap[i++]); pci_read_config_word(dev, pos + PCI_EXP_RTCTL, &cap[i++]); + save_state->cap_nr = PCI_CAP_ID_EXP; pci_add_saved_cap(dev, save_state); return 0; } @@ -630,6 +631,7 @@ static int pci_save_pcix_state(struct pc cap = (u16 *)&save_state->data[0]; pci_read_config_word(dev, pos + PCI_X_CMD, &cap[i++]); + save_state->cap_nr = PCI_CAP_ID_PCIX; pci_add_saved_cap(dev, save_state); return 0; } Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/kobject-change-drivers-cpuidle-sysfs.c-to-use-kobject_init_and_add.patch pci/pcie-port-driver-correctly-detect-native-pme-feature.patch pci/pcie-utilize-pcie-transaction-pending-bit.patch pci/pci-add-pci-quirk-function-for-some-chipsets.patch pci/pci-avoid-save-the-same-type-of-cap-multiple-times.patch pci/pci-correctly-initialize-a-structure-for-pcie_save_pcix_state.patch pci/pci-fix-typo-in-pci_save_pcix_state.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pci-remove-pci_enable_device_bars.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: Remove pci_enable_device_bars() to my gregkh-2.6 tree. Its filename is pci-remove-pci_enable_device_bars.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Wed Dec 19 20:30:57 2007 From: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Date: Thu, 20 Dec 2007 15:28:10 +1100 Subject: PCI: Remove pci_enable_device_bars() To: Greg Kroah-Hartman <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED], , <[EMAIL PROTECTED]>, Alan Cox <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>, Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Now that all in-tree users are gone, this removes pci_enable_device_bars() completely. Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/pci.c | 24 include/linux/pci.h |1 - 2 files changed, 25 deletions(-) --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -741,29 +741,6 @@ int pci_reenable_device(struct pci_dev * return 0; } -/** - * pci_enable_device_bars - Initialize some of a device for use - * @dev: PCI device to be initialized - * @bars: bitmask of BAR's that must be configured - * - * Initialize device before it's used by a driver. Ask low-level code - * to enable selected I/O and memory resources. Wake up the device if it - * was suspended. Beware, this function can fail. - */ -int -pci_enable_device_bars(struct pci_dev *dev, int bars) -{ - int err; - - if (atomic_add_return(1, &dev->enable_cnt) > 1) - return 0; /* already enabled */ - - err = do_pci_enable_device(dev, bars); - if (err < 0) - atomic_dec(&dev->enable_cnt); - return err; -} - static int __pci_enable_device_flags(struct pci_dev *dev, resource_size_t flags) { @@ -1695,7 +1672,6 @@ early_param("pci", pci_setup); device_initcall(pci_init); EXPORT_SYMBOL(pci_reenable_device); -EXPORT_SYMBOL(pci_enable_device_bars); EXPORT_SYMBOL(pci_enable_device_io); EXPORT_SYMBOL(pci_enable_device_mem); EXPORT_SYMBOL(pci_enable_device); --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -543,7 +543,6 @@ static inline int pci_write_config_dword } int __must_check pci_enable_device(struct pci_dev *dev); -int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); int __must_check pci_enable_device_io(struct pci_dev *dev); int __must_check pci_enable_device_mem(struct pci_dev *dev); int __must_check pci_reenable_device(struct pci_dev *); Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are bad/battery-class-driver.patch driver/adb-convert-from-class_device-to-device.patch driver/kobject-convert-hvc_console-to-use-kref-not-kobject.patch driver/kobject-convert-hvcs-to-use-kref-not-kobject.patch driver/kobject-convert-icom-to-use-kref-not-kobject.patch pci/pci-fix-bus-resource-assignment-on-32-bits-with-64b-resources.patch pci/pci-fix-warning-in-setup-res.c-on-32-bit-platforms-with-64-bit-resources.patch pci/pci-add-pci_enable_device_-io-mem-intefaces.patch pci/pci-remove-pci_enable_device_bars.patch pci/pci-remove-users-of-pci_enable_device_bars.patch usb/usb-remove-ohci-useless-masking-unmasking-of-wdh-interrupt.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pci-remove-users-of-pci_enable_device_bars.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: Remove users of pci_enable_device_bars() to my gregkh-2.6 tree. Its filename is pci-remove-users-of-pci_enable_device_bars.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Wed Dec 19 20:30:44 2007 From: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Date: Thu, 20 Dec 2007 15:28:09 +1100 Subject: PCI: Remove users of pci_enable_device_bars() To: Greg Kroah-Hartman <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED], , <[EMAIL PROTECTED]>, Alan Cox <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>, Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> This patch converts users of pci_enable_device_bars() to the new pci_enable_device_{io,mem} interface. The new API fits nicely, except maybe for the QLA case where a bit of code re-organization might be a good idea but I prefer sticking to the simple patch as I don't have hardware to test on. I'll also need some feedback on the cs5520 change. Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/ata/pata_cs5520.c |2 +- drivers/i2c/busses/scx200_acb.c |2 +- drivers/ide/pci/cs5520.c| 10 -- drivers/ide/setup-pci.c |6 -- drivers/scsi/lpfc/lpfc_init.c |3 +-- drivers/scsi/qla2xxx/qla_os.c | 12 +--- 6 files changed, 24 insertions(+), 11 deletions(-) --- a/drivers/ata/pata_cs5520.c +++ b/drivers/ata/pata_cs5520.c @@ -229,7 +229,7 @@ static int __devinit cs5520_init_one(str return -ENOMEM; /* Perform set up for DMA */ - if (pci_enable_device_bars(pdev, 1<<2)) { + if (pci_enable_device_io(pdev)) { printk(KERN_ERR DRV_NAME ": unable to configure BAR2.\n"); return -ENODEV; } --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c @@ -492,7 +492,7 @@ static __init int scx200_create_pci(cons iface->pdev = pdev; iface->bar = bar; - rc = pci_enable_device_bars(iface->pdev, 1 << iface->bar); + rc = pci_enable_device_io(iface->pdev); if (rc) goto errout_free; --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c @@ -160,8 +160,14 @@ static int __devinit cs5520_init_one(str ide_setup_pci_noise(dev, d); /* We must not grab the entire device, it has 'ISA' space in its - BARS too and we will freak out other bits of the kernel */ - if (pci_enable_device_bars(dev, 1<<2)) { +* BARS too and we will freak out other bits of the kernel +* +* pci_enable_device_bars() is going away. I replaced it with +* IO only enable for now but I'll need confirmation this is +* allright for that device. If not, it will need some kind of +* quirk. --BenH. +*/ + if (pci_enable_device_io(dev)) { printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name); return -ENODEV; } --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -236,7 +236,9 @@ EXPORT_SYMBOL_GPL(ide_setup_pci_noise); * @d: IDE port info * * Enable the IDE PCI device. We attempt to enable the device in full - * but if that fails then we only need BAR4 so we will enable that. + * but if that fails then we only need IO space. The PCI code should + * have setup the proper resources for us already for controllers in + * legacy mode. * * Returns zero on success or an error code */ @@ -246,7 +248,7 @@ static int ide_pci_enable(struct pci_dev int ret; if (pci_enable_device(dev)) { - ret = pci_enable_device_bars(dev, 1 << 4); + ret = pci_enable_device_io(dev); if (ret < 0) { printk(KERN_WARNING "%s: (ide_setup_pci_device:) " "Could not enable device.\n", d->name); --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -2100,10 +2100,9 @@ static pci_ers_result_t lpfc_io_slot_res struct Scsi_Host *shost = pci_get_drvdata(pdev); struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; struct lpfc_sli *psli = &phba->sli; - int bars = pci_select_bars(pdev, IORESOURCE_MEM); dev_printk(KERN_INFO, &pdev->dev, "recovering from a slot reset.\n"); - if (pci_enable_device_bars(pdev, bars)) { + if (pci_enable_device_mem(pdev)) { printk(KERN_ERR "lpfc: Cannot re-enable " "PCI device after reset.\n");
patch kobject-two-typo-fixes.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: kobject: two typo fixes to my gregkh-2.6 tree. Its filename is kobject-two-typo-fixes.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Mon Nov 26 15:12:16 2007 From: Johannes Berg <[EMAIL PROTECTED]> Date: Mon, 05 Nov 2007 13:59:11 +0100 Subject: kobject: two typo fixes To: [EMAIL PROTECTED] Cc: Greg KH <[EMAIL PROTECTED]>, Linux Kernel list Message-ID: <[EMAIL PROTECTED]> This fixes two typos from commit 34358c26a2c96b2a068dc44e0ac602106a466bce. Signed-off-by: Johannes Berg <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- lib/kobject.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/lib/kobject.c +++ b/lib/kobject.c @@ -377,8 +377,8 @@ int kobject_rename(struct kobject * kobj struct kobject *temp_kobj; temp_kobj = kset_find_obj(kobj->kset, new_name); if (temp_kobj) { - printk(KERN_WARNING "kobject '%s' can not be renamed " - "to '%s' as '%s' is already in existance.\n", + printk(KERN_WARNING "kobject '%s' cannot be renamed " + "to '%s' as '%s' is already in existence.\n", kobject_name(kobj), new_name, new_name); kobject_put(temp_kobj); return -EINVAL; Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/kobject-two-typo-fixes.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch driver-core-fix-race-in-__device_release_driver.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: Driver core: fix race in __device_release_driver to my gregkh-2.6 tree. Its filename is driver-core-fix-race-in-__device_release_driver.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Mon Nov 26 22:49:20 2007 From: Alan Stern <[EMAIL PROTECTED]> Date: Fri, 16 Nov 2007 11:57:28 -0500 (EST) Subject: Driver core: fix race in __device_release_driver To: Greg KH <[EMAIL PROTECTED]>, David Woodhouse <[EMAIL PROTECTED]> Cc: USB development list <[EMAIL PROTECTED]>, Kernel development list Message-ID: <[EMAIL PROTECTED]> This patch (as1013) was suggested by David Woodhouse; it fixes a race in the driver core. If a device is unregistered at the same time as its driver is unloaded, the driver's code pages may be unmapped while the remove method is still running. The calls to get_driver() and put_driver() were intended to prevent this, but they don't work if the driver's module count has already dropped to 0. Instead, the patch keeps the device on the driver's list until after the remove method has returned. This forces the necessary synchronization to occur. Signed-off-by: Alan Stern <[EMAIL PROTECTED]> Signed-off-by: David Woodhouse <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/dd.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -289,11 +289,10 @@ static void __device_release_driver(stru { struct device_driver * drv; - drv = get_driver(dev->driver); + drv = dev->driver; if (drv) { driver_sysfs_remove(dev); sysfs_remove_link(&dev->kobj, "driver"); - klist_remove(&dev->knode_driver); if (dev->bus) blocking_notifier_call_chain(&dev->bus->p->bus_notifier, @@ -306,7 +305,7 @@ static void __device_release_driver(stru drv->remove(dev); devres_release_all(dev); dev->driver = NULL; - put_driver(drv); + klist_remove(&dev->knode_driver); } } Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/pm-acquire-device-locks-prior-to-suspending.patch driver/create-sys-...-power-when-config_pm-is-set.patch driver/driver-core-fix-race-in-__device_release_driver.patch usb/usb-add-support-for-an-older-firmware-revision-for-the-nikon-d200.patch usb/usb-fix-priority-mistakes-in-drivers-usb-core-hub.c.patch usb/usb-fix-signr-comment-in-usbdevice_fs.h.patch usb/usb-mailing-lists-have-changed.patch usb/usb-power-management-documenation-update.patch usb/usb-hcd-avoid-duplicate-local_irq_disable.patch usb/usb-usb-mon-mon_bin.c-cleanups.patch usb/usb-keep-track-of-whether-interface-sysfs-files-exist.patch usb/usb-uevent-environment-key-fix.patch usb/usb-autosuspend-for-cdc-acm.patch usb/usb-fix-up-ehci-startup-synchronization.patch usb/usb-usb-storage-new-lockable-subclass-0x07.patch usb/usb-don-t-change-hc-power-state-for-a-freeze.patch usb/usb-dummy_hcd-don-t-register-drivers-on-the-platform-bus.patch usb/usb-force-handover-port-to-companion-when-hub_port_connect_change-fails.patch usb/usb-make-ksuspend_usbd-thread-non-freezable.patch usb/usb-usb-storage-unusual_devs-entry-for-jetflash-ts1gjf2a.patch usb/usb-storage-always-set-the-allow_restart-flag.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pci-pcie-aspm-support.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: PCIE ASPM support to my gregkh-2.6 tree. Its filename is pci-pcie-aspm-support.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Fri Jan 25 10:10:52 2008 From: Shaohua Li <[EMAIL PROTECTED]> Date: Thu, 24 Jan 2008 10:21:57 +0800 Subject: PCI: PCIE ASPM support To: Greg KH <[EMAIL PROTECTED]> Cc: lkml , linux-pci <[EMAIL PROTECTED]>, "Pallipadi, Venkatesh" <[EMAIL PROTECTED]>, "Kok, Auke" <[EMAIL PROTECTED]>, Matthew Wilcox <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> PCI Express ASPM defines a protocol for PCI Express components in the D0 state to reduce Link power by placing their Links into a low power state and instructing the other end of the Link to do likewise. This capability allows hardware-autonomous, dynamic Link power reduction beyond what is achievable by software-only controlled power management. However, The device should be configured by software appropriately. Enabling ASPM will save power, but will introduce device latency. This patch adds ASPM support in Linux. It introduces a global policy for ASPM, a sysfs file /sys/module/pcie_aspm/parameters/policy can control it. The interface can be used as a boot option too. Currently we have below setting: -default, BIOS default setting -powersave, highest power saving mode, enable all available ASPM state and clock power management -performance, highest performance, disable ASPM and clock power management By default, the 'default' policy is used currently. In my test, power difference between powersave mode and performance mode is about 1.3w in a system with 3 PCIE links. Signed-off-by: Shaohua Li <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/pci-sysfs.c |5 drivers/pci/pci.c |4 drivers/pci/pcie/Kconfig | 20 + drivers/pci/pcie/Makefile |3 drivers/pci/pcie/aspm.c | 802 ++ drivers/pci/probe.c |5 drivers/pci/remove.c |4 include/linux/aspm.h | 44 ++ include/linux/pci.h |5 include/linux/pci_regs.h |8 10 files changed, 900 insertions(+) --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "pci.h" static int sysfs_initialized; /* = 0 */ @@ -681,6 +682,8 @@ int __must_check pci_create_sysfs_dev_fi if (pcibios_add_platform_entries(pdev)) goto err_rom_file; + pcie_aspm_create_sysfs_dev_files(pdev); + return 0; err_rom_file: @@ -710,6 +713,8 @@ void pci_remove_sysfs_dev_files(struct p if (!sysfs_initialized) return; + pcie_aspm_remove_sysfs_dev_files(pdev); + if (pdev->cfg_size < 4096) sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr); else --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -18,6 +18,7 @@ #include #include #include +#include #include/* isa_dma_bridge_buggy */ #include "pci.h" @@ -519,6 +520,9 @@ pci_set_power_state(struct pci_dev *dev, if (need_restore) pci_restore_bars(dev); + if (dev->bus->self) + pcie_aspm_pm_state_change(dev->bus->self); + return 0; } --- a/drivers/pci/pcie/Kconfig +++ b/drivers/pci/pcie/Kconfig @@ -26,3 +26,23 @@ config HOTPLUG_PCI_PCIE When in doubt, say N. source "drivers/pci/pcie/aer/Kconfig" + +# +# PCI Express ASPM +# +config PCIEASPM + bool "PCI Express ASPM support(Experimental)" + depends on PCI && EXPERIMENTAL + default y + help + This enables PCI Express ASPM (Active State Power Management) and + Clock Power Management. ASPM supports state L0/L0s/L1. + + When in doubt, say N. +config PCIEASPM_DEBUG + bool "Debug PCI Express ASPM" + depends on PCIEASPM + default n + help + This enables PCI Express ASPM debug support. It will add per-device + interface to control ASPM. --- a/drivers/pci/pcie/Makefile +++ b/drivers/pci/pcie/Makefile @@ -2,6 +2,9 @@ # Makefile for PCI-Express PORT Driver # +# Build PCI Express ASPM if needed +obj-$(CONFIG_PCIEASPM) += aspm.o + pcieportdrv-y := portdrv_core.o portdrv_pci.o portdrv_bus.o obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o --- /dev/null +++ b/drivers/pci/pcie/aspm.c @@ -0,0 +1,802 @@ +/* + * File: drivers/pci/pcie/aspm.c + * Enabling PCIE link L0s/L1 state and Clock Power Management + * + * Copyright (C) 2007 Intel + * Copyright (C) Zhang Yanmin ([EMAIL PROTECTED]) + * Copyright (C) Shaohua Li
patch pm-export-device_pm_schedule_removal.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PM: Export device_pm_schedule_removal to my gregkh-2.6 tree. Its filename is pm-export-device_pm_schedule_removal.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Mon Jan 28 08:57:01 2008 From: "Rafael J. Wysocki" <[EMAIL PROTECTED]> Date: Fri, 25 Jan 2008 01:30:25 +0100 Subject: PM: Export device_pm_schedule_removal To: Andrew Morton <[EMAIL PROTECTED]> Cc: Michael Buesch <[EMAIL PROTECTED]>, pm list <[EMAIL PROTECTED]>, Alan Stern <[EMAIL PROTECTED]>, Len Brown <[EMAIL PROTECTED]>, LKML , Pavel Machek <[EMAIL PROTECTED]>, [EMAIL PROTECTED], Alessandro Rubini <[EMAIL PROTECTED]>, Richard Purdie <[EMAIL PROTECTED]>, Greg KH <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline From: Rafael J. Wysocki <[EMAIL PROTECTED]> Move the declaration of device_pm_schedule_removal() to device.h and make it exported, as it will be used directly by some drivers for unregistering device objects during suspend/resume cycles in a safe way. Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]> Acked-by: Pavel Machek <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/power/main.c |1 + drivers/base/power/power.h |1 - include/linux/device.h |6 ++ 3 files changed, 7 insertions(+), 1 deletion(-) --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -129,6 +129,7 @@ void device_pm_schedule_removal(struct d list_move_tail(&dev->power.entry, &dpm_destroy); mutex_unlock(&dpm_list_mtx); } +EXPORT_SYMBOL_GPL(device_pm_schedule_removal); /** * pm_sleep_lock - mutual exclusion for registration and suspend --- a/drivers/base/power/power.h +++ b/drivers/base/power/power.h @@ -13,7 +13,6 @@ static inline struct device *to_device(s extern void device_pm_add(struct device *); extern void device_pm_remove(struct device *); -extern void device_pm_schedule_removal(struct device *); extern int pm_sleep_lock(void); extern void pm_sleep_unlock(void); --- a/include/linux/device.h +++ b/include/linux/device.h @@ -534,11 +534,17 @@ extern struct device *device_create(stru extern void device_destroy(struct class *cls, dev_t devt); #ifdef CONFIG_PM_SLEEP extern void destroy_suspended_device(struct class *cls, dev_t devt); +extern void device_pm_schedule_removal(struct device *); #else /* !CONFIG_PM_SLEEP */ static inline void destroy_suspended_device(struct class *cls, dev_t devt) { device_destroy(cls, devt); } + +static inline void device_pm_schedule_removal(struct device *dev) +{ + device_unregister(dev); +} #endif /* !CONFIG_PM_SLEEP */ /* Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/pm-export-device_pm_schedule_removal.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch kconfig-oldconfig-shall-not-set-symbols-if-it-does-not-need-to.patch queued to -stable tree
This is a note to let you know that we have just queued up the patch titled Subject: kconfig: oldconfig shall not set symbols if it does not need to to the 2.6.22-stable tree. Its filename is kconfig-oldconfig-shall-not-set-symbols-if-it-does-not-need-to.patch A git repo of this tree can be found at http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary >From [EMAIL PROTECTED] Fri Aug 31 23:28:28 2007 From: Sam Ravnborg <[EMAIL PROTECTED]> Date: Sat, 1 Sep 2007 08:29:40 +0200 Subject: kconfig: oldconfig shall not set symbols if it does not need to To: Linus Torvalds <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Cc: Roman Zippel <[EMAIL PROTECTED]>, Hugh Dickins <[EMAIL PROTECTED]>, LKML Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline From: Roman Zippel <[EMAIL PROTECTED]> commit f82f3f9422d4da1eeec6f6cf3e64c6c34c4fe19b in mainline. Avoid setting the value if the symbol doesn't need to be changed or can't be changed. Later choices may change the dependencies and thus the possible input range. make oldconfig from a 2.6.22 .config with CONFIG_HOTPLUG_CPU not set was in some configurations setting CONFIG_HOTPLUG_CPU=y without asking, even when there was no actual requirement for CONFIG_HOTPLUG_CPU. This was triggered by SUSPEND_SMP that does a select HOTPLUG_CPU. Signed-off-by: Roman Zippel <[EMAIL PROTECTED]> Tested-by: Hugh Dickins <[EMAIL PROTECTED]> Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- linux-2.6.orig/scripts/kconfig/conf.c +++ linux-2.6/scripts/kconfig/conf.c @@ -72,7 +72,7 @@ static void check_stdin(void) } } -static void conf_askvalue(struct symbol *sym, const char *def) +static int conf_askvalue(struct symbol *sym, const char *def) { enum symbol_type type = sym_get_type(sym); tristate val; @@ -87,7 +87,7 @@ static void conf_askvalue(struct symbol printf("%s\n", def); line[0] = '\n'; line[1] = 0; - return; + return 0; } switch (input_mode) { @@ -97,23 +97,23 @@ static void conf_askvalue(struct symbol case set_random: if (sym_has_value(sym)) { printf("%s\n", def); - return; + return 0; } break; case ask_new: case ask_silent: if (sym_has_value(sym)) { printf("%s\n", def); - return; + return 0; } check_stdin(); case ask_all: fflush(stdout); fgets(line, 128, stdin); - return; + return 1; case set_default: printf("%s\n", def); - return; + return 1; default: break; } @@ -123,7 +123,7 @@ static void conf_askvalue(struct symbol case S_HEX: case S_STRING: printf("%s\n", def); - return; + return 1; default: ; } @@ -174,6 +174,7 @@ static void conf_askvalue(struct symbol break; } printf("%s", line); + return 1; } int conf_string(struct menu *menu) @@ -187,7 +188,8 @@ int conf_string(struct menu *menu) def = sym_get_string_value(sym); if (sym_get_string_value(sym)) printf("[%s] ", def); - conf_askvalue(sym, def); + if (!conf_askvalue(sym, def)) + return 0; switch (line[0]) { case '\n': break; @@ -240,7 +242,8 @@ static int conf_sym(struct menu *menu) if (menu_has_help(menu)) printf("/?"); printf("] "); - conf_askvalue(sym, sym_get_string_value(sym)); + if (!conf_askvalue(sym, sym_get_string_value(sym))) + return 0; strip(line); switch (line[0]) { ___ stable mailing list [EMAIL PROTECTED] http://linux.kernel.org/mailman/listinfo/stable Patches currently in stable-queue which might be from [EMAIL PROTECTED] are queue-2.6.22/kconfig-oldconfig-shall-not-set-symbols-if-it-does-not-need-to.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch mtd-makefile-fix-for-mtdsuper.patch queued to -stable tree
This is a note to let you know that we have just queued up the patch titled Subject: MTD: Makefile fix for mtdsuper to the 2.6.22-stable tree. Its filename is mtd-makefile-fix-for-mtdsuper.patch A git repo of this tree can be found at http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary >From [EMAIL PROTECTED] Tue Sep 4 15:57:55 2007 From: Satyam Sharma <[EMAIL PROTECTED]> Date: Wed, 5 Sep 2007 04:40:52 +0530 (IST) Subject: MTD: Makefile fix for mtdsuper To: Jason Lunz <[EMAIL PROTECTED]> Cc: David Woodhouse <[EMAIL PROTECTED]>, lkml , Stable Branch <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> From: Satyam Sharma <[EMAIL PROTECTED]> commit bec494775600b1cd7c144d31a09e1f46df9c6324 in mainline. We want drivers/mtd/{mtdcore, mtdsuper, mtdpart}.c to be built and linked into the same mtd.ko module. Fix the Makefile to ensure this, and remove duplicate MODULE_ declarations in mtdpart.c, as mtdcore.c already has them. Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]> Signed-off-by: David Woodhouse <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- a/drivers/mtd/Makefile +++ b/drivers/mtd/Makefile @@ -3,9 +3,9 @@ # # Core functionality. +obj-$(CONFIG_MTD) += mtd.o mtd-y := mtdcore.o mtdsuper.o mtd-$(CONFIG_MTD_PARTITIONS) += mtdpart.o -obj-$(CONFIG_MTD) += $(mtd-y) obj-$(CONFIG_MTD_CONCAT) += mtdconcat.o obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 9c62368..6174a97 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -560,7 +560,3 @@ int parse_mtd_partitions(struct mtd_info *master, const char **types, EXPORT_SYMBOL_GPL(parse_mtd_partitions); EXPORT_SYMBOL_GPL(register_mtd_parser); EXPORT_SYMBOL_GPL(deregister_mtd_parser); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Nicolas Pitre <[EMAIL PROTECTED]>"); -MODULE_DESCRIPTION("Generic support for partitioning of MTD devices"); ___ stable mailing list [EMAIL PROTECTED] http://linux.kernel.org/mailman/listinfo/stable Patches currently in stable-queue which might be from [EMAIL PROTECTED] are queue-2.6.22/mtd-makefile-fix-for-mtdsuper.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch usb-avoid-redundant-cast-of-kmalloc-return-value-in-oti-6858-driver.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: usb: avoid redundant cast of kmalloc() return value in OTi-6858 driver to my gregkh-2.6 tree. Its filename is usb-avoid-redundant-cast-of-kmalloc-return-value-in-oti-6858-driver.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Thu Aug 23 17:38:13 2007 From: Jesper Juhl <[EMAIL PROTECTED]> Date: Fri, 24 Aug 2007 02:35:14 +0200 Subject: usb: avoid redundant cast of kmalloc() return value in OTi-6858 driver To: Linux Kernel Mailing List Cc: Greg Kroah-Hartman <[EMAIL PROTECTED]>, Jesper Juhl <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline In drivers/usb/serial/oti6858.c::pl2303_buf_alloc() the return value of kmalloc() is being cast to "struct pl2303_buf *", but that need not be done here since kmalloc() returns "void *". Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/serial/oti6858.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c @@ -1144,7 +1144,7 @@ static struct pl2303_buf *pl2303_buf_all if (size == 0) return NULL; - pb = (struct pl2303_buf *)kmalloc(sizeof(struct pl2303_buf), GFP_KERNEL); + pb = kmalloc(sizeof(struct pl2303_buf), GFP_KERNEL); if (pb == NULL) return NULL; Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are bad/speakup-kconfig-fix.patch usb/usb-clean-up-duplicate-includes-in-drivers-usb.patch usb/usb-avoid-redundant-cast-of-kmalloc-return-value-in-oti-6858-driver.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch driver-core-revert-device-link-creation-check.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: driver core: revert "device" link creation check to my gregkh-2.6 tree. Its filename is driver-core-revert-device-link-creation-check.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Wed Jul 25 00:58:00 2007 From: Cornelia Huck <[EMAIL PROTECTED]> Date: Wed, 25 Jul 2007 09:58:08 +0200 Subject: driver core: revert "device" link creation check To: "Kay Sievers" <[EMAIL PROTECTED]> Cc: "Simon Arlott" <[EMAIL PROTECTED]>, "Greg KH" <[EMAIL PROTECTED]>, "Linux Kernel Mailing List" Message-ID: <[EMAIL PROTECTED]> From: Cornelia Huck <[EMAIL PROTECTED]> driver core: revert "device" link creation check Commit 2ee97caf0a6602f749ddbfdb1449e383e1212707 introduced an extra check on when to create the "device" symlink. Unfortunately, this breaks input, so let's revert to the old behaviour. Signed-off-by: Cornelia Huck <[EMAIL PROTECTED]> Acked-by: Kay Sievers <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/core.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -692,8 +692,7 @@ static int device_add_class_symlinks(str if (error) goto out_subsys; } - /* only bus-device parents get a "device"-link */ - if (dev->parent && dev->parent->bus) { + if (dev->parent) { error = sysfs_create_link(&dev->kobj, &dev->parent->kobj, "device"); if (error) Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/kobject-fix-link-error-when-config_hotplug-is-disabled.patch driver/driver-core-revert-device-link-creation-check.patch driver/kobject-update-documentation.patch driver/kset-kernel-doc-cleanups.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch kernel-doc-fixes-for-pci-and-drivers-base.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: kernel-doc fixes for PCI and drivers/base/ to my gregkh-2.6 tree. Its filename is kernel-doc-fixes-for-pci-and-drivers-base.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Mon Jul 23 21:38:12 2007 From: Randy Dunlap <[EMAIL PROTECTED]> Date: Mon, 23 Jul 2007 21:42:11 -0700 Subject: kernel-doc fixes for PCI and drivers/base/ To: lkml Cc: gregkh <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> From: Randy Dunlap <[EMAIL PROTECTED]> Fix undocumented function parameters in PCI and drivers/base. Warning(linux-2.6.23-rc1//drivers/pci/pci.c:1526): No description found for parameter 'rq' Warning(linux-2.6.23-rc1//drivers/base/firmware_class.c:245): No description found for parameter 'bin_attr' Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/firmware_class.c |1 + drivers/pci/pci.c |2 +- 2 files changed, 2 insertions(+), 1 deletion(-) --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -232,6 +232,7 @@ fw_realloc_buffer(struct firmware_priv * /** * firmware_data_write - write method for firmware * @kobj: kobject for the device + * @bin_attr: bin_attr structure * @buffer: buffer being written * @offset: buffer offset for write in total data store area * @count: buffer size --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1517,7 +1517,7 @@ EXPORT_SYMBOL(pcie_get_readrq); /** * pcie_set_readrq - set PCI Express maximum memory read request * @dev: PCI device to query - * @count: maximum memory read count in bytes + * @rq: maximum memory read count in bytes *valid values are 128, 256, 512, 1024, 2048, 4096 * * If possible sets maximum read byte count Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/fix-doc-sysfs-rules-typos.patch driver/kernel-doc-fixes-for-pci-and-drivers-base.patch driver/kset-kernel-doc-cleanups.patch pci/pci-document-pci_iomap.patch usb/usb-usb.h-kernel-doc-additions.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch usb-clean-up-duplicate-includes-in-drivers-usb.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: USB: Clean up duplicate includes in drivers/usb/ to my gregkh-2.6 tree. Its filename is usb-clean-up-duplicate-includes-in-drivers-usb.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Sat Jul 21 08:03:57 2007 From: Jesper Juhl <[EMAIL PROTECTED]> Date: Sat, 21 Jul 2007 17:02:59 +0200 Subject: USB: Clean up duplicate includes in drivers/usb/ To: Linux Kernel Mailing List Cc: Andrew Morton <[EMAIL PROTECTED]>, Jesper Juhl <[EMAIL PROTECTED]>, Greg Kroah-Hartman <[EMAIL PROTECTED]>, [EMAIL PROTECTED], [EMAIL PROTECTED], Tony Olech <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline This patch cleans up duplicate includes in drivers/usb/ Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/host/u132-hcd.c |1 - 1 file changed, 1 deletion(-) --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are bad/speakup-kconfig-fix.patch driver/howto-adjust-translation-header-of-japanese-stable_api_nonsense.txt.patch usb/usb-clean-up-duplicate-includes-in-drivers-usb.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch usb-fix-bug-sleeping-function-called-from-invalid-context-at-home-jeremy-hg-xen-paravirt-linux-drivers-usb-core-urb.c-524-in_atomic-1-irqs_disabled-0.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: USB: fix BUG: sleeping function called from invalid context at /home/jeremy/hg/xen/paravirt/linux/drivers/usb/core/urb.c:524, in_atomic():1, irqs_disabled():0 to my gregkh-2.6 tree. Its filename is usb-fix-bug-sleeping-function-called-from-invalid-context-at-home-jeremy-hg-xen-paravirt-linux-drivers-usb-core-urb.c-524-in_atomic-1-irqs_disabled-0.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Tue Jul 24 06:11:50 2007 From: Oliver Neukum <[EMAIL PROTECTED]> Date: Tue, 24 Jul 2007 15:13:42 +0200 Subject: USB: fix BUG: sleeping function called from invalid context at /home/jeremy/hg/xen/paravirt/linux/drivers/usb/core/urb.c:524, in_atomic():1, irqs_disabled():0 To: Alan Stern <[EMAIL PROTECTED]> Cc: Jeremy Fitzhardinge <[EMAIL PROTECTED]>, Kevin Lloyd <[EMAIL PROTECTED]>, Greg KH <[EMAIL PROTECTED]>, Linux Kernel Mailing List , USB development list <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline Clearly there's a bug in drivers/usb/serial/usb-serial.c:usb_serial_put(). It shouldn't call kref_put() while holding a spinlock. Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/serial/usb-serial.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -60,19 +60,19 @@ static struct usb_driver usb_serial_driv static int debug; static struct usb_serial *serial_table[SERIAL_TTY_MINORS]; /* initially all NULL */ -static spinlock_t table_lock; +static DEFINE_MUTEX(table_lock); static LIST_HEAD(usb_serial_driver_list); struct usb_serial *usb_serial_get_by_index(unsigned index) { struct usb_serial *serial; - spin_lock(&table_lock); + mutex_lock(&table_lock); serial = serial_table[index]; if (serial) kref_get(&serial->kref); - spin_unlock(&table_lock); + mutex_unlock(&table_lock); return serial; } @@ -84,7 +84,7 @@ static struct usb_serial *get_free_seria dbg("%s %d", __FUNCTION__, num_ports); *minor = 0; - spin_lock(&table_lock); + mutex_lock(&table_lock); for (i = 0; i < SERIAL_TTY_MINORS; ++i) { if (serial_table[i]) continue; @@ -106,10 +106,10 @@ static struct usb_serial *get_free_seria serial_table[i] = serial; serial->port[j++]->number = i; } - spin_unlock(&table_lock); + mutex_unlock(&table_lock); return serial; } - spin_unlock(&table_lock); + mutex_unlock(&table_lock); return NULL; } @@ -172,9 +172,9 @@ static void destroy_serial(struct kref * void usb_serial_put(struct usb_serial *serial) { - spin_lock(&table_lock); + mutex_lock(&table_lock); kref_put(&serial->kref, destroy_serial); - spin_unlock(&table_lock); + mutex_unlock(&table_lock); } /* @@ -1129,7 +1129,6 @@ static int __init usb_serial_init(void) return -ENOMEM; /* Initialize our global data */ - spin_lock_init(&table_lock); for (i = 0; i < SERIAL_TTY_MINORS; ++i) { serial_table[i] = NULL; } Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are usb/usb-fix-bug-sleeping-function-called-from-invalid-context-at-home-jeremy-hg-xen-paravirt-linux-drivers-usb-core-urb.c-524-in_atomic-1-irqs_disabled-0.patch usb/usb-nikon-d50-is-an-unusual-device.patch usb/usb-yet-another-quirky-device.patch usb/usb-more-quirky-devices.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch usb-usbserial-fix-potential-deadlock-between-write-and-irq.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: USB: usbserial - fix potential deadlock between write() and IRQ to my gregkh-2.6 tree. Its filename is usb-usbserial-fix-potential-deadlock-between-write-and-irq.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Wed Oct 24 14:28:04 2007 From: Jiri Kosina <[EMAIL PROTECTED]> Date: Sat, 20 Oct 2007 00:05:19 +0200 (CEST) Subject: USB: usbserial - fix potential deadlock between write() and IRQ To: Larry Finger <[EMAIL PROTECTED]> Cc: LKML , Greg Kroah-Hartman <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> From: Jiri Kosina <[EMAIL PROTECTED]> USB: usbserial - fix potential deadlock between write() and IRQ usb_serial_generic_write() doesn't disable interrupts when taking port->lock, and could therefore deadlock with usb_serial_generic_read_bulk_callback() being called from interrupt, taking the same lock. Fix it. Signed-off-by: Jiri Kosina <[EMAIL PROTECTED]> Acked-by: Larry Finger <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/serial/generic.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -208,14 +208,15 @@ int usb_serial_generic_write(struct usb_ /* only do something if we have a bulk out endpoint */ if (serial->num_bulk_out) { - spin_lock_bh(&port->lock); + unsigned long flags; + spin_lock_irqsave(&port->lock, flags); if (port->write_urb_busy) { - spin_unlock_bh(&port->lock); + spin_unlock_irqrestore(&port->lock, flags); dbg("%s - already writing", __FUNCTION__); return 0; } port->write_urb_busy = 1; - spin_unlock_bh(&port->lock); + spin_unlock_irqrestore(&port->lock, flags); count = (count > port->bulk_out_size) ? port->bulk_out_size : count; Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are usb/usb-usbserial-fix-potential-deadlock-between-write-and-irq.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch usb-u132-hcd.c-fix-a-warning-when-config_pm-n.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: USB: u132-hcd.c - Fix a warning when CONFIG_PM=n to my gregkh-2.6 tree. Its filename is usb-u132-hcd.c-fix-a-warning-when-config_pm-n.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Thu Aug 2 18:39:02 2007 From: Gabriel C <[EMAIL PROTECTED]> Date: Mon, 30 Jul 2007 12:57:03 +0200 Subject: USB: u132-hcd.c - Fix a warning when CONFIG_PM=n To: Linux Kernel Mailing List Cc: [EMAIL PROTECTED], [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> I noticed this warning with CONFING_PM=n ... drivers/usb/host/u132-hcd.c:1525: warning: 'port_power' defined but not used ... Signed-off-by: Gabriel Craciunescu <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/host/u132-hcd.c |3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c @@ -1519,12 +1519,15 @@ static void u132_hcd_endp_work_scheduler } } } +#ifdef CONFIG_PM static void port_power(struct u132 *u132, int pn, int is_on) { u132->port[pn].power = is_on; } +#endif + static void u132_power(struct u132 *u132, int is_on) { struct usb_hcd *hcd = u132_to_hcd(u132) Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are usb/usb-u132-hcd.c-fix-a-warning-when-config_pm-n.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "hrtimer: Provide clock_was_set_delayed()" has been added to the 3.4-stable tree
This is a note to let you know that I've just added the patch titled hrtimer: Provide clock_was_set_delayed() to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: hrtimer-provide-clock_was_set_delayed.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 14:22:23 2012 From: John Stultz Date: Tue, 17 Jul 2012 02:39:50 -0400 Subject: hrtimer: Provide clock_was_set_delayed() To: sta...@vger.kernel.org Cc: John Stultz , Thomas Gleixner , Prarit Bhargava , Linux Kernel Message-ID: <1342507196-54327-2-git-send-email-johns...@us.ibm.com> From: John Stultz This is a backport of f55a6faa384304c89cfef162768e88374d3312cb clock_was_set() cannot be called from hard interrupt context because it calls on_each_cpu(). For fixing the widely reported leap seconds issue it is necessary to call it from hard interrupt context, i.e. the timer tick code, which does the timekeeping updates. Provide a new function which denotes it in the hrtimer cpu base structure of the cpu on which it is called and raise the hrtimer softirq. We then execute the clock_was_set() notificiation from softirq context in run_hrtimer_softirq(). The hrtimer softirq is rarely used, so polling the flag there is not a performance issue. [ tglx: Made it depend on CONFIG_HIGH_RES_TIMERS. We really should get rid of all this ifdeffery ASAP ] Signed-off-by: John Stultz Reported-by: Jan Engelhardt Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Link: http://lkml.kernel.org/r/1341960205-56738-2-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- include/linux/hrtimer.h |9 - kernel/hrtimer.c| 20 2 files changed, 28 insertions(+), 1 deletion(-) --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -165,6 +165,7 @@ enum hrtimer_base_type { * @lock: lock protecting the base and associated clock bases * and timers * @active_bases: Bitfield to mark bases with active timers + * @clock_was_set: Indicates that clock was set from irq context. * @expires_next: absolute time of the next event which was scheduled * via clock_set_next_event() * @hres_active: State of high resolution mode @@ -177,7 +178,8 @@ enum hrtimer_base_type { */ struct hrtimer_cpu_base { raw_spinlock_t lock; - unsigned long active_bases; + unsigned intactive_bases; + unsigned intclock_was_set; #ifdef CONFIG_HIGH_RES_TIMERS ktime_t expires_next; int hres_active; @@ -286,6 +288,8 @@ extern void hrtimer_peek_ahead_timers(vo # define MONOTONIC_RES_NSECHIGH_RES_NSEC # define KTIME_MONOTONIC_RES KTIME_HIGH_RES +extern void clock_was_set_delayed(void); + #else # define MONOTONIC_RES_NSECLOW_RES_NSEC @@ -306,6 +310,9 @@ static inline int hrtimer_is_hres_active { return 0; } + +static inline void clock_was_set_delayed(void) { } + #endif extern void clock_was_set(void); --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -717,6 +717,19 @@ static int hrtimer_switch_to_hres(void) return 1; } +/* + * Called from timekeeping code to reprogramm the hrtimer interrupt + * device. If called from the timer interrupt context we defer it to + * softirq context. + */ +void clock_was_set_delayed(void) +{ + struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); + + cpu_base->clock_was_set = 1; + __raise_softirq_irqoff(HRTIMER_SOFTIRQ); +} + #else static inline int hrtimer_hres_active(void) { return 0; } @@ -1395,6 +1408,13 @@ void hrtimer_peek_ahead_timers(void) static void run_hrtimer_softirq(struct softirq_action *h) { + struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); + + if (cpu_base->clock_was_set) { + cpu_base->clock_was_set = 0; + clock_was_set(); + } + hrtimer_peek_ahead_timers(); } Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.4/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.4/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.4/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.4/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.4/hrtimer-provide-clock_was_set_delayed.patch queue-3.4/timekeeping-provide-hrtimer-update-function.patch queue-3.4/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch -- To u
Patch "hrtimers: Move lock held region in hrtimer_interrupt()" has been added to the 3.4-stable tree
This is a note to let you know that I've just added the patch titled hrtimers: Move lock held region in hrtimer_interrupt() to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 14:27:06 2012 From: John Stultz Date: Tue, 17 Jul 2012 02:39:53 -0400 Subject: hrtimers: Move lock held region in hrtimer_interrupt() To: sta...@vger.kernel.org Cc: Thomas Gleixner , John Stultz , Prarit Bhargava , Linux Kernel Message-ID: <1342507196-54327-5-git-send-email-johns...@us.ibm.com> From: Thomas Gleixner This is a backport of 196951e91262fccda81147d2bcf7fdab08668b40 We need to update the base offsets from this code and we need to do that under base->lock. Move the lock held region around the ktime_get() calls. The ktime_get() calls are going to be replaced with a function which gets the time and the offsets atomically. Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Signed-off-by: John Stultz Link: http://lkml.kernel.org/r/1341960205-56738-6-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/hrtimer.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1263,11 +1263,10 @@ void hrtimer_interrupt(struct clock_even cpu_base->nr_events++; dev->next_event.tv64 = KTIME_MAX; + raw_spin_lock(&cpu_base->lock); entry_time = now = ktime_get(); retry: expires_next.tv64 = KTIME_MAX; - - raw_spin_lock(&cpu_base->lock); /* * We set expires_next to KTIME_MAX here with cpu_base->lock * held to prevent that a timer is enqueued in our queue via @@ -1344,6 +1343,7 @@ retry: * interrupt routine. We give it 3 attempts to avoid * overreacting on some spurious event. */ + raw_spin_lock(&cpu_base->lock); now = ktime_get(); cpu_base->nr_retries++; if (++retries < 3) @@ -1356,6 +1356,7 @@ retry: */ cpu_base->nr_hangs++; cpu_base->hang_detected = 1; + raw_spin_unlock(&cpu_base->lock); delta = ktime_sub(now, entry_time); if (delta.tv64 > cpu_base->max_hang_time.tv64) cpu_base->max_hang_time = delta; Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.4/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.4/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.4/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.4/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.4/hrtimer-provide-clock_was_set_delayed.patch queue-3.4/timekeeping-provide-hrtimer-update-function.patch queue-3.4/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "timekeeping: Fix leapsecond triggered load spike issue" has been added to the 3.4-stable tree
This is a note to let you know that I've just added the patch titled timekeeping: Fix leapsecond triggered load spike issue to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: timekeeping-fix-leapsecond-triggered-load-spike-issue.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 14:22:56 2012 From: John Stultz Date: Tue, 17 Jul 2012 02:39:51 -0400 Subject: timekeeping: Fix leapsecond triggered load spike issue To: sta...@vger.kernel.org Cc: John Stultz , Thomas Gleixner , Prarit Bhargava , Linux Kernel Message-ID: <1342507196-54327-3-git-send-email-johns...@us.ibm.com> From: John Stultz This is a backport of 4873fa070ae84a4115f0b3c9dfabc224f1bc7c51 The timekeeping code misses an update of the hrtimer subsystem after a leap second happened. Due to that timers based on CLOCK_REALTIME are either expiring a second early or late depending on whether a leap second has been inserted or deleted until an operation is initiated which causes that update. Unless the update happens by some other means this discrepancy between the timekeeping and the hrtimer data stays forever and timers are expired either early or late. The reported immediate workaround - $ data -s "`date`" - is causing a call to clock_was_set() which updates the hrtimer data structures. See: http://www.sheeri.com/content/mysql-and-leap-second-high-cpu-and-fix Add the missing clock_was_set() call to update_wall_time() in case of a leap second event. The actual update is deferred to softirq context as the necessary smp function call cannot be invoked from hard interrupt context. Signed-off-by: John Stultz Reported-by: Jan Engelhardt Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Link: http://lkml.kernel.org/r/1341960205-56738-3-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/time/timekeeping.c |4 1 file changed, 4 insertions(+) --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -965,6 +965,8 @@ static cycle_t logarithmic_accumulation( leap = second_overflow(timekeeper.xtime.tv_sec); timekeeper.xtime.tv_sec += leap; timekeeper.wall_to_monotonic.tv_sec -= leap; + if (leap) + clock_was_set_delayed(); } /* Accumulate raw time */ @@ -1081,6 +1083,8 @@ static void update_wall_time(void) leap = second_overflow(timekeeper.xtime.tv_sec); timekeeper.xtime.tv_sec += leap; timekeeper.wall_to_monotonic.tv_sec -= leap; + if (leap) + clock_was_set_delayed(); } timekeeping_update(false); Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.4/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.4/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.4/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.4/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.4/hrtimer-provide-clock_was_set_delayed.patch queue-3.4/timekeeping-provide-hrtimer-update-function.patch queue-3.4/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "timekeeping: Add missing update call in timekeeping_resume()" has been added to the 3.4-stable tree
This is a note to let you know that I've just added the patch titled timekeeping: Add missing update call in timekeeping_resume() to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: timekeeping-add-missing-update-call-in-timekeeping_resume.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 14:27:38 2012 From: John Stultz Date: Tue, 17 Jul 2012 02:39:56 -0400 Subject: timekeeping: Add missing update call in timekeeping_resume() To: sta...@vger.kernel.org Cc: Thomas Gleixner , LKML , Linux PM list , John Stultz , Ingo Molnar , Peter Zijlstra , Prarit Bhargava , Linus Torvalds Message-ID: <1342507196-54327-8-git-send-email-johns...@us.ibm.com> From: Thomas Gleixner This is a backport of 3e997130bd2e8c6f5aaa49d6e3161d4d29b43ab0 The leap second rework unearthed another issue of inconsistent data. On timekeeping_resume() the timekeeper data is updated, but nothing calls timekeeping_update(), so now the update code in the timer interrupt sees stale values. This has been the case before those changes, but then the timer interrupt was using stale data as well so this went unnoticed for quite some time. Add the missing update call, so all the data is consistent everywhere. Reported-by: Andreas Schwab Reported-and-tested-by: "Rafael J. Wysocki" Reported-and-tested-by: Martin Steigerwald Cc: John Stultz Cc: Ingo Molnar Cc: Peter Zijlstra , Cc: Prarit Bhargava Signed-off-by: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Linus Torvalds Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/time/timekeeping.c |1 + 1 file changed, 1 insertion(+) --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -719,6 +719,7 @@ static void timekeeping_resume(void) timekeeper.clock->cycle_last = timekeeper.clock->read(timekeeper.clock); timekeeper.ntp_error = 0; timekeeping_suspended = 0; + timekeeping_update(false); write_sequnlock_irqrestore(&timekeeper.lock, flags); touch_softlockup_watchdog(); Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.4/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.4/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.4/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.4/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.4/hrtimer-provide-clock_was_set_delayed.patch queue-3.4/timekeeping-provide-hrtimer-update-function.patch queue-3.4/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "timekeeping: Maintain ktime_t based offsets for hrtimers" has been added to the 3.4-stable tree
This is a note to let you know that I've just added the patch titled timekeeping: Maintain ktime_t based offsets for hrtimers to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 14:23:18 2012 From: John Stultz Date: Tue, 17 Jul 2012 02:39:52 -0400 Subject: timekeeping: Maintain ktime_t based offsets for hrtimers To: sta...@vger.kernel.org Cc: Thomas Gleixner , John Stultz , Prarit Bhargava , Linux Kernel Message-ID: <1342507196-54327-4-git-send-email-johns...@us.ibm.com> From: Thomas Gleixner This is a backport of 5b9fe759a678e05be4937ddf03d50e950207c1c0 We need to update the hrtimer clock offsets from the hrtimer interrupt context. To avoid conversions from timespec to ktime_t maintain a ktime_t based representation of those offsets in the timekeeper. This puts the conversion overhead into the code which updates the underlying offsets and provides fast accessible values in the hrtimer interrupt. Signed-off-by: Thomas Gleixner Signed-off-by: John Stultz Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Link: http://lkml.kernel.org/r/1341960205-56738-4-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/time/timekeeping.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -70,6 +70,12 @@ struct timekeeper { /* The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. */ struct timespec raw_time; + /* Offset clock monotonic -> clock realtime */ + ktime_t offs_real; + + /* Offset clock monotonic -> clock boottime */ + ktime_t offs_boot; + /* Seqlock for all timekeeper values */ seqlock_t lock; }; @@ -172,6 +178,14 @@ static inline s64 timekeeping_get_ns_raw return clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift); } +static void update_rt_offset(void) +{ + struct timespec tmp, *wtm = &timekeeper.wall_to_monotonic; + + set_normalized_timespec(&tmp, -wtm->tv_sec, -wtm->tv_nsec); + timekeeper.offs_real = timespec_to_ktime(tmp); +} + /* must hold write on timekeeper.lock */ static void timekeeping_update(bool clearntp) { @@ -179,6 +193,7 @@ static void timekeeping_update(bool clea timekeeper.ntp_error = 0; ntp_clear(); } + update_rt_offset(); update_vsyscall(&timekeeper.xtime, &timekeeper.wall_to_monotonic, timekeeper.clock, timekeeper.mult); } @@ -606,6 +621,7 @@ void __init timekeeping_init(void) } set_normalized_timespec(&timekeeper.wall_to_monotonic, -boot.tv_sec, -boot.tv_nsec); + update_rt_offset(); timekeeper.total_sleep_time.tv_sec = 0; timekeeper.total_sleep_time.tv_nsec = 0; write_sequnlock_irqrestore(&timekeeper.lock, flags); @@ -614,6 +630,12 @@ void __init timekeeping_init(void) /* time in seconds when suspend began */ static struct timespec timekeeping_suspend_time; +static void update_sleep_time(struct timespec t) +{ + timekeeper.total_sleep_time = t; + timekeeper.offs_boot = timespec_to_ktime(t); +} + /** * __timekeeping_inject_sleeptime - Internal function to add sleep interval * @delta: pointer to a timespec delta value @@ -632,8 +654,7 @@ static void __timekeeping_inject_sleepti timekeeper.xtime = timespec_add(timekeeper.xtime, *delta); timekeeper.wall_to_monotonic = timespec_sub(timekeeper.wall_to_monotonic, *delta); - timekeeper.total_sleep_time = timespec_add( - timekeeper.total_sleep_time, *delta); + update_sleep_time(timespec_add(timekeeper.total_sleep_time, *delta)); } Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.4/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.4/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.4/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.4/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.4/hrtimer-provide-clock_was_set_delayed.patch queue-3.4/timekeeping-provide-hrtimer-update-function.patch queue-3.4/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kerne
Patch "timekeeping: Provide hrtimer update function" has been added to the 3.4-stable tree
This is a note to let you know that I've just added the patch titled timekeeping: Provide hrtimer update function to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: timekeeping-provide-hrtimer-update-function.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 14:27:23 2012 From: John Stultz Date: Tue, 17 Jul 2012 02:39:54 -0400 Subject: timekeeping: Provide hrtimer update function To: sta...@vger.kernel.org Cc: Thomas Gleixner , John Stultz , Prarit Bhargava , Linux Kernel Message-ID: <1342507196-54327-6-git-send-email-johns...@us.ibm.com> From: Thomas Gleixner This is a backport of f6c06abfb3972ad4914cef57d8348fcb2932bc3b To finally fix the infamous leap second issue and other race windows caused by functions which change the offsets between the various time bases (CLOCK_MONOTONIC, CLOCK_REALTIME and CLOCK_BOOTTIME) we need a function which atomically gets the current monotonic time and updates the offsets of CLOCK_REALTIME and CLOCK_BOOTTIME with minimalistic overhead. The previous patch which provides ktime_t offsets allows us to make this function almost as cheap as ktime_get() which is going to be replaced in hrtimer_interrupt(). Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Signed-off-by: John Stultz Link: http://lkml.kernel.org/r/1341960205-56738-7-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- include/linux/hrtimer.h |1 + kernel/time/timekeeping.c | 34 ++ 2 files changed, 35 insertions(+) --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -327,6 +327,7 @@ extern ktime_t ktime_get(void); extern ktime_t ktime_get_real(void); extern ktime_t ktime_get_boottime(void); extern ktime_t ktime_get_monotonic_offset(void); +extern ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot); DECLARE_PER_CPU(struct tick_device, tick_cpu_device); --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1273,6 +1273,40 @@ void get_xtime_and_monotonic_and_sleep_o } while (read_seqretry(&timekeeper.lock, seq)); } +#ifdef CONFIG_HIGH_RES_TIMERS +/** + * ktime_get_update_offsets - hrtimer helper + * @offs_real: pointer to storage for monotonic -> realtime offset + * @offs_boot: pointer to storage for monotonic -> boottime offset + * + * Returns current monotonic time and updates the offsets + * Called from hrtimer_interupt() or retrigger_next_event() + */ +ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot) +{ + ktime_t now; + unsigned int seq; + u64 secs, nsecs; + + do { + seq = read_seqbegin(&timekeeper.lock); + + secs = timekeeper.xtime.tv_sec; + nsecs = timekeeper.xtime.tv_nsec; + nsecs += timekeeping_get_ns(); + /* If arch requires, add in gettimeoffset() */ + nsecs += arch_gettimeoffset(); + + *offs_real = timekeeper.offs_real; + *offs_boot = timekeeper.offs_boot; + } while (read_seqretry(&timekeeper.lock, seq)); + + now = ktime_add_ns(ktime_set(secs, 0), nsecs); + now = ktime_sub(now, *offs_real); + return now; +} +#endif + /** * ktime_get_monotonic_offset() - get wall_to_monotonic in ktime_t format */ Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.4/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.4/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.4/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.4/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.4/hrtimer-provide-clock_was_set_delayed.patch queue-3.4/timekeeping-provide-hrtimer-update-function.patch queue-3.4/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "hrtimer: Update hrtimer base offsets each hrtimer_interrupt" has been added to the 3.4-stable tree
This is a note to let you know that I've just added the patch titled hrtimer: Update hrtimer base offsets each hrtimer_interrupt to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 14:28:09 2012 From: John Stultz Date: Tue, 17 Jul 2012 02:39:55 -0400 Subject: hrtimer: Update hrtimer base offsets each hrtimer_interrupt To: sta...@vger.kernel.org Cc: John Stultz , Thomas Gleixner , Prarit Bhargava , Linux Kernel Message-ID: <1342507196-54327-7-git-send-email-johns...@us.ibm.com> From: John Stultz This is a backport of 5baefd6d84163443215f4a99f6a20f054ef11236 The update of the hrtimer base offsets on all cpus cannot be made atomically from the timekeeper.lock held and interrupt disabled region as smp function calls are not allowed there. clock_was_set(), which enforces the update on all cpus, is called either from preemptible process context in case of do_settimeofday() or from the softirq context when the offset modification happened in the timer interrupt itself due to a leap second. In both cases there is a race window for an hrtimer interrupt between dropping timekeeper lock, enabling interrupts and clock_was_set() issuing the updates. Any interrupt which arrives in that window will see the new time but operate on stale offsets. So we need to make sure that an hrtimer interrupt always sees a consistent state of time and offsets. ktime_get_update_offsets() allows us to get the current monotonic time and update the per cpu hrtimer base offsets from hrtimer_interrupt() to capture a consistent state of monotonic time and the offsets. The function replaces the existing ktime_get() calls in hrtimer_interrupt(). The overhead of the new function vs. ktime_get() is minimal as it just adds two store operations. This ensures that any changes to realtime or boottime offsets are noticed and stored into the per-cpu hrtimer base structures, prior to any hrtimer expiration and guarantees that timers are not expired early. Signed-off-by: John Stultz Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Link: http://lkml.kernel.org/r/1341960205-56738-8-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/hrtimer.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -657,6 +657,14 @@ static inline int hrtimer_enqueue_reprog return 0; } +static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) +{ + ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; + ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset; + + return ktime_get_update_offsets(offs_real, offs_boot); +} + /* * Retrigger next event is called after clock was set * @@ -665,22 +673,12 @@ static inline int hrtimer_enqueue_reprog static void retrigger_next_event(void *arg) { struct hrtimer_cpu_base *base = &__get_cpu_var(hrtimer_bases); - struct timespec realtime_offset, xtim, wtm, sleep; if (!hrtimer_hres_active()) return; - /* Optimized out for !HIGH_RES */ - get_xtime_and_monotonic_and_sleep_offset(&xtim, &wtm, &sleep); - set_normalized_timespec(&realtime_offset, -wtm.tv_sec, -wtm.tv_nsec); - - /* Adjust CLOCK_REALTIME offset */ raw_spin_lock(&base->lock); - base->clock_base[HRTIMER_BASE_REALTIME].offset = - timespec_to_ktime(realtime_offset); - base->clock_base[HRTIMER_BASE_BOOTTIME].offset = - timespec_to_ktime(sleep); - + hrtimer_update_base(base); hrtimer_force_reprogram(base, 0); raw_spin_unlock(&base->lock); } @@ -710,7 +708,6 @@ static int hrtimer_switch_to_hres(void) base->clock_base[i].resolution = KTIME_HIGH_RES; tick_setup_sched_timer(); - /* "Retrigger" the interrupt to get things going */ retrigger_next_event(NULL); local_irq_restore(flags); @@ -1264,7 +1261,7 @@ void hrtimer_interrupt(struct clock_even dev->next_event.tv64 = KTIME_MAX; raw_spin_lock(&cpu_base->lock); - entry_time = now = ktime_get(); + entry_time = now = hrtimer_update_base(cpu_base); retry: expires_next.tv64 = KTIME_MAX; /* @@ -1342,9 +1339,12 @@ retry: * We need to prevent that we loop forever in the hrtimer * interrupt routine. We give it 3 attempts to avoid * overreacting on some spurious event. +* +*
Patch "hrtimer: Provide clock_was_set_delayed()" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled hrtimer: Provide clock_was_set_delayed() to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: hrtimer-provide-clock_was_set_delayed.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 15:25:04 2012 From: John Stultz Date: Tue, 17 Jul 2012 13:33:52 -0400 Subject: hrtimer: Provide clock_was_set_delayed() To: sta...@vger.kernel.org Cc: John Stultz , Thomas Gleixner , Prarit Bhargava , Linux Kernel Message-ID: <1342546438-17534-6-git-send-email-johns...@us.ibm.com> From: John Stultz This is a backport of f55a6faa384304c89cfef162768e88374d3312cb clock_was_set() cannot be called from hard interrupt context because it calls on_each_cpu(). For fixing the widely reported leap seconds issue it is necessary to call it from hard interrupt context, i.e. the timer tick code, which does the timekeeping updates. Provide a new function which denotes it in the hrtimer cpu base structure of the cpu on which it is called and raise the hrtimer softirq. We then execute the clock_was_set() notificiation from softirq context in run_hrtimer_softirq(). The hrtimer softirq is rarely used, so polling the flag there is not a performance issue. [ tglx: Made it depend on CONFIG_HIGH_RES_TIMERS. We really should get rid of all this ifdeffery ASAP ] Signed-off-by: John Stultz Reported-by: Jan Engelhardt Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Link: http://lkml.kernel.org/r/1341960205-56738-2-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- include/linux/hrtimer.h |9 - kernel/hrtimer.c| 20 2 files changed, 28 insertions(+), 1 deletion(-) --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -165,6 +165,7 @@ enum hrtimer_base_type { * @lock: lock protecting the base and associated clock bases * and timers * @active_bases: Bitfield to mark bases with active timers + * @clock_was_set: Indicates that clock was set from irq context. * @expires_next: absolute time of the next event which was scheduled * via clock_set_next_event() * @hres_active: State of high resolution mode @@ -177,7 +178,8 @@ enum hrtimer_base_type { */ struct hrtimer_cpu_base { raw_spinlock_t lock; - unsigned long active_bases; + unsigned intactive_bases; + unsigned intclock_was_set; #ifdef CONFIG_HIGH_RES_TIMERS ktime_t expires_next; int hres_active; @@ -286,6 +288,8 @@ extern void hrtimer_peek_ahead_timers(vo # define MONOTONIC_RES_NSECHIGH_RES_NSEC # define KTIME_MONOTONIC_RES KTIME_HIGH_RES +extern void clock_was_set_delayed(void); + #else # define MONOTONIC_RES_NSECLOW_RES_NSEC @@ -306,6 +310,9 @@ static inline int hrtimer_is_hres_active { return 0; } + +static inline void clock_was_set_delayed(void) { } + #endif extern void clock_was_set(void); --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -717,6 +717,19 @@ static int hrtimer_switch_to_hres(void) return 1; } +/* + * Called from timekeeping code to reprogramm the hrtimer interrupt + * device. If called from the timer interrupt context we defer it to + * softirq context. + */ +void clock_was_set_delayed(void) +{ + struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); + + cpu_base->clock_was_set = 1; + __raise_softirq_irqoff(HRTIMER_SOFTIRQ); +} + #else static inline int hrtimer_hres_active(void) { return 0; } @@ -1395,6 +1408,13 @@ void hrtimer_peek_ahead_timers(void) static void run_hrtimer_softirq(struct softirq_action *h) { + struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); + + if (cpu_base->clock_was_set) { + cpu_base->clock_was_set = 0; + clock_was_set(); + } + hrtimer_peek_ahead_timers(); } Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.0/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.0/time-move-common-updates-to-a-function.patch queue-3.0/timekeeping-fix-clock_monotonic-inconsistency-during-leapsecond.patch queue-3.0/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.0/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.0/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.0/hrtimer-provide-clock_was_set_delayed.patch queu
Patch "timekeeping: Add missing update call in timekeeping_resume()" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled timekeeping: Add missing update call in timekeeping_resume() to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: timekeeping-add-missing-update-call-in-timekeeping_resume.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 15:27:16 2012 From: John Stultz Date: Tue, 17 Jul 2012 13:33:58 -0400 Subject: timekeeping: Add missing update call in timekeeping_resume() To: sta...@vger.kernel.org Cc: Thomas Gleixner , LKML , Linux PM list , John Stultz , Ingo Molnar , Peter Zijlstra , Prarit Bhargava , Linus Torvalds Message-ID: <1342546438-17534-12-git-send-email-johns...@us.ibm.com> From: Thomas Gleixner This is a backport of 3e997130bd2e8c6f5aaa49d6e3161d4d29b43ab0 The leap second rework unearthed another issue of inconsistent data. On timekeeping_resume() the timekeeper data is updated, but nothing calls timekeeping_update(), so now the update code in the timer interrupt sees stale values. This has been the case before those changes, but then the timer interrupt was using stale data as well so this went unnoticed for quite some time. Add the missing update call, so all the data is consistent everywhere. Reported-by: Andreas Schwab Reported-and-tested-by: "Rafael J. Wysocki" Reported-and-tested-by: Martin Steigerwald Cc: John Stultz Cc: Ingo Molnar Cc: Peter Zijlstra , Cc: Prarit Bhargava Signed-off-by: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Linus Torvalds Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/time/timekeeping.c |1 + 1 file changed, 1 insertion(+) --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -693,6 +693,7 @@ static void timekeeping_resume(void) timekeeper.clock->cycle_last = timekeeper.clock->read(timekeeper.clock); timekeeper.ntp_error = 0; timekeeping_suspended = 0; + timekeeping_update(false); write_sequnlock_irqrestore(&xtime_lock, flags); touch_softlockup_watchdog(); Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.0/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.0/time-move-common-updates-to-a-function.patch queue-3.0/timekeeping-fix-clock_monotonic-inconsistency-during-leapsecond.patch queue-3.0/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.0/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.0/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.0/hrtimer-provide-clock_was_set_delayed.patch queue-3.0/ntp-fix-leap-second-hrtimer-livelock.patch queue-3.0/timekeeping-provide-hrtimer-update-function.patch queue-3.0/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch queue-3.0/ntp-correct-tai-offset-during-leap-second.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "timekeeping: Maintain ktime_t based offsets for hrtimers" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled timekeeping: Maintain ktime_t based offsets for hrtimers to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 15:26:11 2012 From: John Stultz Date: Tue, 17 Jul 2012 13:33:54 -0400 Subject: timekeeping: Maintain ktime_t based offsets for hrtimers To: sta...@vger.kernel.org Cc: Thomas Gleixner , John Stultz , Prarit Bhargava , Linux Kernel Message-ID: <1342546438-17534-8-git-send-email-johns...@us.ibm.com> From: Thomas Gleixner This is a backport of 5b9fe759a678e05be4937ddf03d50e950207c1c0 We need to update the hrtimer clock offsets from the hrtimer interrupt context. To avoid conversions from timespec to ktime_t maintain a ktime_t based representation of those offsets in the timekeeper. This puts the conversion overhead into the code which updates the underlying offsets and provides fast accessible values in the hrtimer interrupt. Signed-off-by: Thomas Gleixner Signed-off-by: John Stultz Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Link: http://lkml.kernel.org/r/1341960205-56738-4-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/time/timekeeping.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -161,18 +161,34 @@ static struct timespec xtime __attribute static struct timespec wall_to_monotonic __attribute__ ((aligned (16))); static struct timespec total_sleep_time; +/* Offset clock monotonic -> clock realtime */ +static ktime_t offs_real; + +/* Offset clock monotonic -> clock boottime */ +static ktime_t offs_boot; + /* * The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. */ static struct timespec raw_time; /* must hold write on xtime_lock */ +static void update_rt_offset(void) +{ + struct timespec tmp, *wtm = &wall_to_monotonic; + + set_normalized_timespec(&tmp, -wtm->tv_sec, -wtm->tv_nsec); + offs_real = timespec_to_ktime(tmp); +} + +/* must hold write on xtime_lock */ static void timekeeping_update(bool clearntp) { if (clearntp) { timekeeper.ntp_error = 0; ntp_clear(); } + update_rt_offset(); update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, timekeeper.mult); } @@ -587,6 +603,7 @@ void __init timekeeping_init(void) } set_normalized_timespec(&wall_to_monotonic, -boot.tv_sec, -boot.tv_nsec); + update_rt_offset(); total_sleep_time.tv_sec = 0; total_sleep_time.tv_nsec = 0; write_sequnlock_irqrestore(&xtime_lock, flags); @@ -595,6 +612,12 @@ void __init timekeeping_init(void) /* time in seconds when suspend began */ static struct timespec timekeeping_suspend_time; +static void update_sleep_time(struct timespec t) +{ + total_sleep_time = t; + offs_boot = timespec_to_ktime(t); +} + /** * __timekeeping_inject_sleeptime - Internal function to add sleep interval * @delta: pointer to a timespec delta value @@ -606,7 +629,7 @@ static void __timekeeping_inject_sleepti { xtime = timespec_add(xtime, *delta); wall_to_monotonic = timespec_sub(wall_to_monotonic, *delta); - total_sleep_time = timespec_add(total_sleep_time, *delta); + update_sleep_time(timespec_add(total_sleep_time, *delta)); } Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.0/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.0/time-move-common-updates-to-a-function.patch queue-3.0/timekeeping-fix-clock_monotonic-inconsistency-during-leapsecond.patch queue-3.0/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.0/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.0/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.0/hrtimer-provide-clock_was_set_delayed.patch queue-3.0/ntp-fix-leap-second-hrtimer-livelock.patch queue-3.0/timekeeping-provide-hrtimer-update-function.patch queue-3.0/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch queue-3.0/ntp-correct-tai-offset-during-leap-second.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "timekeeping: Fix leapsecond triggered load spike issue" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled timekeeping: Fix leapsecond triggered load spike issue to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: timekeeping-fix-leapsecond-triggered-load-spike-issue.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 15:25:50 2012 From: John Stultz Date: Tue, 17 Jul 2012 13:33:53 -0400 Subject: timekeeping: Fix leapsecond triggered load spike issue To: sta...@vger.kernel.org Cc: John Stultz , Thomas Gleixner , Prarit Bhargava , Linux Kernel Message-ID: <1342546438-17534-7-git-send-email-johns...@us.ibm.com> From: John Stultz This is a backport of 4873fa070ae84a4115f0b3c9dfabc224f1bc7c51 The timekeeping code misses an update of the hrtimer subsystem after a leap second happened. Due to that timers based on CLOCK_REALTIME are either expiring a second early or late depending on whether a leap second has been inserted or deleted until an operation is initiated which causes that update. Unless the update happens by some other means this discrepancy between the timekeeping and the hrtimer data stays forever and timers are expired either early or late. The reported immediate workaround - $ data -s "`date`" - is causing a call to clock_was_set() which updates the hrtimer data structures. See: http://www.sheeri.com/content/mysql-and-leap-second-high-cpu-and-fix Add the missing clock_was_set() call to update_wall_time() in case of a leap second event. The actual update is deferred to softirq context as the necessary smp function call cannot be invoked from hard interrupt context. Signed-off-by: John Stultz Reported-by: Jan Engelhardt Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Link: http://lkml.kernel.org/r/1341960205-56738-3-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/time/timekeeping.c |4 1 file changed, 4 insertions(+) --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -827,6 +827,8 @@ static cycle_t logarithmic_accumulation( leap = second_overflow(xtime.tv_sec); xtime.tv_sec += leap; wall_to_monotonic.tv_sec -= leap; + if (leap) + clock_was_set_delayed(); } /* Accumulate raw time */ @@ -938,6 +940,8 @@ static void update_wall_time(void) leap = second_overflow(xtime.tv_sec); xtime.tv_sec += leap; wall_to_monotonic.tv_sec -= leap; + if (leap) + clock_was_set_delayed(); } timekeeping_update(false); Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.0/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.0/time-move-common-updates-to-a-function.patch queue-3.0/timekeeping-fix-clock_monotonic-inconsistency-during-leapsecond.patch queue-3.0/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.0/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.0/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.0/hrtimer-provide-clock_was_set_delayed.patch queue-3.0/ntp-fix-leap-second-hrtimer-livelock.patch queue-3.0/timekeeping-provide-hrtimer-update-function.patch queue-3.0/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch queue-3.0/ntp-correct-tai-offset-during-leap-second.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "time: Move common updates to a function" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled time: Move common updates to a function to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: time-move-common-updates-to-a-function.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 15:24:46 2012 From: John Stultz Date: Tue, 17 Jul 2012 13:33:51 -0400 Subject: time: Move common updates to a function To: sta...@vger.kernel.org Cc: Thomas Gleixner , Eric Dumazet , Richard Cochran , Prarit Bhargava , Linux Kernel , John Stultz Message-ID: <1342546438-17534-5-git-send-email-johns...@us.ibm.com> From: Thomas Gleixner This is a backport of cc06268c6a87db156af2daed6e96a936b955cc82 While not a bugfix itself, it allows following fixes to backport in a more straightforward manner. CC: Thomas Gleixner CC: Eric Dumazet CC: Richard Cochran Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/time/timekeeping.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -166,6 +166,19 @@ static struct timespec total_sleep_time; */ static struct timespec raw_time; +/* must hold write on xtime_lock */ +static void timekeeping_update(bool clearntp) +{ + if (clearntp) { + timekeeper.ntp_error = 0; + ntp_clear(); + } + update_vsyscall(&xtime, &wall_to_monotonic, +timekeeper.clock, timekeeper.mult); +} + + + /* flag for if timekeeping is suspended */ int __read_mostly timekeeping_suspended; @@ -366,11 +379,7 @@ int do_settimeofday(const struct timespe xtime = *tv; - timekeeper.ntp_error = 0; - ntp_clear(); - - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, - timekeeper.mult); + timekeeping_update(true); write_sequnlock_irqrestore(&xtime_lock, flags); @@ -403,11 +412,7 @@ int timekeeping_inject_offset(struct tim xtime = timespec_add(xtime, *ts); wall_to_monotonic = timespec_sub(wall_to_monotonic, *ts); - timekeeper.ntp_error = 0; - ntp_clear(); - - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, - timekeeper.mult); + timekeeping_update(true); write_sequnlock_irqrestore(&xtime_lock, flags); @@ -630,10 +635,7 @@ void timekeeping_inject_sleeptime(struct __timekeeping_inject_sleeptime(delta); - timekeeper.ntp_error = 0; - ntp_clear(); - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, - timekeeper.mult); + timekeeping_update(true); write_sequnlock_irqrestore(&xtime_lock, flags); @@ -938,9 +940,7 @@ static void update_wall_time(void) wall_to_monotonic.tv_sec -= leap; } - /* check to see if there is a new clocksource to use */ - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, - timekeeper.mult); + timekeeping_update(false); } /** Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.0/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.0/time-move-common-updates-to-a-function.patch queue-3.0/timekeeping-fix-clock_monotonic-inconsistency-during-leapsecond.patch queue-3.0/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.0/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.0/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.0/hrtimer-provide-clock_was_set_delayed.patch queue-3.0/ntp-fix-leap-second-hrtimer-livelock.patch queue-3.0/timekeeping-provide-hrtimer-update-function.patch queue-3.0/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch queue-3.0/ntp-correct-tai-offset-during-leap-second.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "hrtimers: Move lock held region in hrtimer_interrupt()" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled hrtimers: Move lock held region in hrtimer_interrupt() to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 15:26:26 2012 From: John Stultz Date: Tue, 17 Jul 2012 13:33:55 -0400 Subject: hrtimers: Move lock held region in hrtimer_interrupt() To: sta...@vger.kernel.org Cc: Thomas Gleixner , John Stultz , Prarit Bhargava , Linux Kernel Message-ID: <1342546438-17534-9-git-send-email-johns...@us.ibm.com> From: Thomas Gleixner This is a backport of 196951e91262fccda81147d2bcf7fdab08668b40 We need to update the base offsets from this code and we need to do that under base->lock. Move the lock held region around the ktime_get() calls. The ktime_get() calls are going to be replaced with a function which gets the time and the offsets atomically. Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Signed-off-by: John Stultz Link: http://lkml.kernel.org/r/1341960205-56738-6-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/hrtimer.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1263,11 +1263,10 @@ void hrtimer_interrupt(struct clock_even cpu_base->nr_events++; dev->next_event.tv64 = KTIME_MAX; + raw_spin_lock(&cpu_base->lock); entry_time = now = ktime_get(); retry: expires_next.tv64 = KTIME_MAX; - - raw_spin_lock(&cpu_base->lock); /* * We set expires_next to KTIME_MAX here with cpu_base->lock * held to prevent that a timer is enqueued in our queue via @@ -1344,6 +1343,7 @@ retry: * interrupt routine. We give it 3 attempts to avoid * overreacting on some spurious event. */ + raw_spin_lock(&cpu_base->lock); now = ktime_get(); cpu_base->nr_retries++; if (++retries < 3) @@ -1356,6 +1356,7 @@ retry: */ cpu_base->nr_hangs++; cpu_base->hang_detected = 1; + raw_spin_unlock(&cpu_base->lock); delta = ktime_sub(now, entry_time); if (delta.tv64 > cpu_base->max_hang_time.tv64) cpu_base->max_hang_time = delta; Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.0/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.0/time-move-common-updates-to-a-function.patch queue-3.0/timekeeping-fix-clock_monotonic-inconsistency-during-leapsecond.patch queue-3.0/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.0/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.0/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.0/hrtimer-provide-clock_was_set_delayed.patch queue-3.0/ntp-fix-leap-second-hrtimer-livelock.patch queue-3.0/timekeeping-provide-hrtimer-update-function.patch queue-3.0/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch queue-3.0/ntp-correct-tai-offset-during-leap-second.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "hrtimer: Update hrtimer base offsets each hrtimer_interrupt" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled hrtimer: Update hrtimer base offsets each hrtimer_interrupt to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 15:26:57 2012 From: John Stultz Date: Tue, 17 Jul 2012 13:33:57 -0400 Subject: hrtimer: Update hrtimer base offsets each hrtimer_interrupt To: sta...@vger.kernel.org Cc: John Stultz , Thomas Gleixner , Prarit Bhargava , Linux Kernel Message-ID: <1342546438-17534-11-git-send-email-johns...@us.ibm.com> From: John Stultz This is a backport of 5baefd6d84163443215f4a99f6a20f054ef11236 The update of the hrtimer base offsets on all cpus cannot be made atomically from the timekeeper.lock held and interrupt disabled region as smp function calls are not allowed there. clock_was_set(), which enforces the update on all cpus, is called either from preemptible process context in case of do_settimeofday() or from the softirq context when the offset modification happened in the timer interrupt itself due to a leap second. In both cases there is a race window for an hrtimer interrupt between dropping timekeeper lock, enabling interrupts and clock_was_set() issuing the updates. Any interrupt which arrives in that window will see the new time but operate on stale offsets. So we need to make sure that an hrtimer interrupt always sees a consistent state of time and offsets. ktime_get_update_offsets() allows us to get the current monotonic time and update the per cpu hrtimer base offsets from hrtimer_interrupt() to capture a consistent state of monotonic time and the offsets. The function replaces the existing ktime_get() calls in hrtimer_interrupt(). The overhead of the new function vs. ktime_get() is minimal as it just adds two store operations. This ensures that any changes to realtime or boottime offsets are noticed and stored into the per-cpu hrtimer base structures, prior to any hrtimer expiration and guarantees that timers are not expired early. Signed-off-by: John Stultz Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Link: http://lkml.kernel.org/r/1341960205-56738-8-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/hrtimer.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -657,6 +657,14 @@ static inline int hrtimer_enqueue_reprog return 0; } +static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) +{ + ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; + ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset; + + return ktime_get_update_offsets(offs_real, offs_boot); +} + /* * Retrigger next event is called after clock was set * @@ -665,22 +673,12 @@ static inline int hrtimer_enqueue_reprog static void retrigger_next_event(void *arg) { struct hrtimer_cpu_base *base = &__get_cpu_var(hrtimer_bases); - struct timespec realtime_offset, xtim, wtm, sleep; if (!hrtimer_hres_active()) return; - /* Optimized out for !HIGH_RES */ - get_xtime_and_monotonic_and_sleep_offset(&xtim, &wtm, &sleep); - set_normalized_timespec(&realtime_offset, -wtm.tv_sec, -wtm.tv_nsec); - - /* Adjust CLOCK_REALTIME offset */ raw_spin_lock(&base->lock); - base->clock_base[HRTIMER_BASE_REALTIME].offset = - timespec_to_ktime(realtime_offset); - base->clock_base[HRTIMER_BASE_BOOTTIME].offset = - timespec_to_ktime(sleep); - + hrtimer_update_base(base); hrtimer_force_reprogram(base, 0); raw_spin_unlock(&base->lock); } @@ -710,7 +708,6 @@ static int hrtimer_switch_to_hres(void) base->clock_base[i].resolution = KTIME_HIGH_RES; tick_setup_sched_timer(); - /* "Retrigger" the interrupt to get things going */ retrigger_next_event(NULL); local_irq_restore(flags); @@ -1264,7 +1261,7 @@ void hrtimer_interrupt(struct clock_even dev->next_event.tv64 = KTIME_MAX; raw_spin_lock(&cpu_base->lock); - entry_time = now = ktime_get(); + entry_time = now = hrtimer_update_base(cpu_base); retry: expires_next.tv64 = KTIME_MAX; /* @@ -1342,9 +1339,12 @@ retry: * We need to prevent that we loop forever in the hrtimer * interrupt routine. We give it 3 attempts to avoid * overreacting on some spurious event. +* +*
Patch "timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: timekeeping-fix-clock_monotonic-inconsistency-during-leapsecond.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 15:24:29 2012 From: John Stultz Date: Tue, 17 Jul 2012 13:33:50 -0400 Subject: timekeeping: Fix CLOCK_MONOTONIC inconsistency during leapsecond To: sta...@vger.kernel.org Cc: John Stultz , Thomas Gleixner , Prarit Bhargava , Linux Kernel , John Stultz Message-ID: <1342546438-17534-4-git-send-email-johns...@us.ibm.com> From: John Stultz This is a backport of fad0c66c4bb836d57a5f125ecd38bed653ca863a which resolves a bug the previous commit. Commit 6b43ae8a61 (ntp: Fix leap-second hrtimer livelock) broke the leapsecond update of CLOCK_MONOTONIC. The missing leapsecond update to wall_to_monotonic causes discontinuities in CLOCK_MONOTONIC. Adjust wall_to_monotonic when NTP inserted a leapsecond. Reported-by: Richard Cochran Signed-off-by: John Stultz Tested-by: Richard Cochran Link: http://lkml.kernel.org/r/1338400497-12420-1-git-send-email-john.stu...@linaro.org Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/time/timekeeping.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -824,6 +824,7 @@ static cycle_t logarithmic_accumulation( xtime.tv_sec++; leap = second_overflow(xtime.tv_sec); xtime.tv_sec += leap; + wall_to_monotonic.tv_sec -= leap; } /* Accumulate raw time */ @@ -934,7 +935,7 @@ static void update_wall_time(void) xtime.tv_sec++; leap = second_overflow(xtime.tv_sec); xtime.tv_sec += leap; - + wall_to_monotonic.tv_sec -= leap; } /* check to see if there is a new clocksource to use */ Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.0/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.0/time-move-common-updates-to-a-function.patch queue-3.0/timekeeping-fix-clock_monotonic-inconsistency-during-leapsecond.patch queue-3.0/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.0/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.0/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.0/hrtimer-provide-clock_was_set_delayed.patch queue-3.0/ntp-fix-leap-second-hrtimer-livelock.patch queue-3.0/timekeeping-provide-hrtimer-update-function.patch queue-3.0/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch queue-3.0/ntp-correct-tai-offset-during-leap-second.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "timekeeping: Provide hrtimer update function" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled timekeeping: Provide hrtimer update function to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: timekeeping-provide-hrtimer-update-function.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 15:26:41 2012 From: John Stultz Date: Tue, 17 Jul 2012 13:33:56 -0400 Subject: timekeeping: Provide hrtimer update function To: sta...@vger.kernel.org Cc: Thomas Gleixner , John Stultz , Prarit Bhargava , Linux Kernel Message-ID: <1342546438-17534-10-git-send-email-johns...@us.ibm.com> From: Thomas Gleixner This is a backport of f6c06abfb3972ad4914cef57d8348fcb2932bc3b To finally fix the infamous leap second issue and other race windows caused by functions which change the offsets between the various time bases (CLOCK_MONOTONIC, CLOCK_REALTIME and CLOCK_BOOTTIME) we need a function which atomically gets the current monotonic time and updates the offsets of CLOCK_REALTIME and CLOCK_BOOTTIME with minimalistic overhead. The previous patch which provides ktime_t offsets allows us to make this function almost as cheap as ktime_get() which is going to be replaced in hrtimer_interrupt(). Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra Acked-by: Prarit Bhargava Signed-off-by: John Stultz Link: http://lkml.kernel.org/r/1341960205-56738-7-git-send-email-johns...@us.ibm.com Signed-off-by: Thomas Gleixner Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- include/linux/hrtimer.h |1 + kernel/time/timekeeping.c | 34 ++ 2 files changed, 35 insertions(+) --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -327,6 +327,7 @@ extern ktime_t ktime_get(void); extern ktime_t ktime_get_real(void); extern ktime_t ktime_get_boottime(void); extern ktime_t ktime_get_monotonic_offset(void); +extern ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot); DECLARE_PER_CPU(struct tick_device, tick_cpu_device); --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1126,6 +1126,40 @@ void get_xtime_and_monotonic_and_sleep_o } while (read_seqretry(&xtime_lock, seq)); } +#ifdef CONFIG_HIGH_RES_TIMERS +/** + * ktime_get_update_offsets - hrtimer helper + * @real: pointer to storage for monotonic -> realtime offset + * @_boot: pointer to storage for monotonic -> boottime offset + * + * Returns current monotonic time and updates the offsets + * Called from hrtimer_interupt() or retrigger_next_event() + */ +ktime_t ktime_get_update_offsets(ktime_t *real, ktime_t *boot) +{ + ktime_t now; + unsigned int seq; + u64 secs, nsecs; + + do { + seq = read_seqbegin(&xtime_lock); + + secs = xtime.tv_sec; + nsecs = xtime.tv_nsec; + nsecs += timekeeping_get_ns(); + /* If arch requires, add in gettimeoffset() */ + nsecs += arch_gettimeoffset(); + + *real = offs_real; + *boot = offs_boot; + } while (read_seqretry(&xtime_lock, seq)); + + now = ktime_add_ns(ktime_set(secs, 0), nsecs); + now = ktime_sub(now, *real); + return now; +} +#endif + /** * ktime_get_monotonic_offset() - get wall_to_monotonic in ktime_t format */ Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.0/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.0/time-move-common-updates-to-a-function.patch queue-3.0/timekeeping-fix-clock_monotonic-inconsistency-during-leapsecond.patch queue-3.0/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.0/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.0/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.0/hrtimer-provide-clock_was_set_delayed.patch queue-3.0/ntp-fix-leap-second-hrtimer-livelock.patch queue-3.0/timekeeping-provide-hrtimer-update-function.patch queue-3.0/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch queue-3.0/ntp-correct-tai-offset-during-leap-second.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "ntp: Fix leap-second hrtimer livelock" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled ntp: Fix leap-second hrtimer livelock to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ntp-fix-leap-second-hrtimer-livelock.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 15:23:32 2012 From: John Stultz Date: Tue, 17 Jul 2012 13:33:48 -0400 Subject: ntp: Fix leap-second hrtimer livelock To: sta...@vger.kernel.org Cc: John Stultz , Sasha Levin , Thomas Gleixner , Prarit Bhargava , Linux Kernel Message-ID: <1342546438-17534-2-git-send-email-johns...@us.ibm.com> From: John Stultz This is a backport of 6b43ae8a619d17c4935c3320d2ef9e92bdeed05d This should have been backported when it was commited, but I mistook the problem as requiring the ntp_lock changes that landed in 3.4 in order for it to occur. Unfortunately the same issue can happen (with only one cpu) as follows: do_adjtimex() write_seqlock_irq(&xtime_lock); process_adjtimex_modes() process_adj_status() ntp_start_leap_timer() hrtimer_start() hrtimer_reprogram() tick_program_event() clockevents_program_event() ktime_get() seq = req_seqbegin(xtime_lock); [DEADLOCK] This deadlock will no always occur, as it requires the leap_timer to force a hrtimer_reprogram which only happens if its set and there's no sooner timer to expire. NOTE: This patch, being faithful to the original commit, introduces a bug (we don't update wall_to_monotonic), which will be resovled by backporting a following fix. Original commit message below: Since commit 7dffa3c673fbcf835cd7be80bb4aec8ad3f51168 the ntp subsystem has used an hrtimer for triggering the leapsecond adjustment. However, this can cause a potential livelock. Thomas diagnosed this as the following pattern: CPU 0CPU 1 do_adjtimex() spin_lock_irq(&ntp_lock); process_adjtimex_modes();timer_interrupt() process_adj_status();do_timer() ntp_start_leap_timer(); write_lock(&xtime_lock); hrtimer_start(); update_wall_time(); hrtimer_reprogram();ntp_tick_length() tick_program_event() spin_lock(&ntp_lock); clockevents_program_event() ktime_get() seq = req_seqbegin(xtime_lock); This patch tries to avoid the problem by reverting back to not using an hrtimer to inject leapseconds, and instead we handle the leapsecond processing in the second_overflow() function. The downside to this change is that on systems that support highres timers, the leap second processing will occur on a HZ tick boundary, (ie: ~1-10ms, depending on HZ) after the leap second instead of possibly sooner (~34us in my tests w/ x86_64 lapic). This patch applies on top of tip/timers/core. CC: Sasha Levin CC: Thomas Gleixner Reported-by: Sasha Levin Diagnoised-by: Thomas Gleixner Tested-by: Sasha Levin Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- include/linux/timex.h |2 kernel/time/ntp.c | 122 +++--- kernel/time/timekeeping.c | 18 ++ 3 files changed, 48 insertions(+), 94 deletions(-) --- a/include/linux/timex.h +++ b/include/linux/timex.h @@ -266,7 +266,7 @@ static inline int ntp_synced(void) /* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */ extern u64 tick_length; -extern void second_overflow(void); +extern int second_overflow(unsigned long secs); extern void update_ntp_one_tick(void); extern int do_adjtimex(struct timex *); extern void hardpps(const struct timespec *, const struct timespec *); --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -31,8 +31,6 @@ unsigned long tick_nsec; u64tick_length; static u64 tick_length_base; -static struct hrtimer leap_timer; - #define MAX_TICKADJ500LL /* usecs */ #define MAX_TICKADJ_SCALED \ (((MAX_TICKADJ * NSEC_PER_USEC) << NTP_SCALE_SHIFT) / NTP_INTERVAL_FREQ) @@ -350,60 +348,60 @@ void ntp_clear(void) } /* - * Leap second processing. If in leap-insert state at the end of the - * day, the system clock is set back one second; if in leap-delete - * state, the system clock is set ahead one second. + * this routine handles the overflow of the microsecond field + * + * The tricky bits of code to handle the accurate clock support + * were provided by Dave Mills (mi...@udel.edu) of NTP fame. + * They were o
Patch "ntp: Correct TAI offset during leap second" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled ntp: Correct TAI offset during leap second to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ntp-correct-tai-offset-during-leap-second.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From johns...@us.ibm.com Tue Jul 17 15:24:12 2012 From: John Stultz Date: Tue, 17 Jul 2012 13:33:49 -0400 Subject: ntp: Correct TAI offset during leap second To: sta...@vger.kernel.org Cc: Richard Cochran , Prarit Bhargava , Thomas Gleixner , Linux Kernel , John Stultz Message-ID: <1342546438-17534-3-git-send-email-johns...@us.ibm.com> From: Richard Cochran This is a backport of dd48d708ff3e917f6d6b6c2b696c3f18c019feed When repeating a UTC time value during a leap second (when the UTC time should be 23:59:60), the TAI timescale should not stop. The kernel NTP code increments the TAI offset one second too late. This patch fixes the issue by incrementing the offset during the leap second itself. Signed-off-by: Richard Cochran Cc: Prarit Bhargava Cc: Thomas Gleixner Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- kernel/time/ntp.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -378,6 +378,7 @@ int second_overflow(unsigned long secs) if (secs % 86400 == 0) { leap = -1; time_state = TIME_OOP; + time_tai++; printk(KERN_NOTICE "Clock: inserting leap second 23:59:60 UTC\n"); } @@ -392,7 +393,6 @@ int second_overflow(unsigned long secs) } break; case TIME_OOP: - time_tai++; time_state = TIME_WAIT; break; Patches currently in stable-queue which might be from johns...@us.ibm.com are queue-3.0/timekeeping-fix-leapsecond-triggered-load-spike-issue.patch queue-3.0/time-move-common-updates-to-a-function.patch queue-3.0/timekeeping-fix-clock_monotonic-inconsistency-during-leapsecond.patch queue-3.0/hrtimer-update-hrtimer-base-offsets-each-hrtimer_interrupt.patch queue-3.0/timekeeping-add-missing-update-call-in-timekeeping_resume.patch queue-3.0/hrtimers-move-lock-held-region-in-hrtimer_interrupt.patch queue-3.0/hrtimer-provide-clock_was_set_delayed.patch queue-3.0/ntp-fix-leap-second-hrtimer-livelock.patch queue-3.0/timekeeping-provide-hrtimer-update-function.patch queue-3.0/timekeeping-maintain-ktime_t-based-offsets-for-hrtimers.patch queue-3.0/ntp-correct-tai-offset-during-leap-second.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: About function __create_file in debugfs
On Sat, Sep 08, 2012 at 05:41:05PM +0800, Jianpeng Ma wrote: > Hi: > At present,i used blktrace to trace block io.But i always met error, > the message like: > >BLKTRACESETUP(2) /dev/sdc failed: 2/No such file or directory > >Thread 0 failed open /sys/kernel/debug/block/(null)/trace0: 2/No such file > >or directory > >Thread 2 failed open /sys/kernel/debug/block/(null)/trace2: 2/No such file > >or directory > >Thread 3 failed open /sys/kernel/debug/block/(null)/trace3: 2/No such file > >or directory > > >Thread 1 failed open /sys/kernel/debug/block/(null)/trace1: 2/No such file > >or directory > >FAILED to start thread on CPU 0: 1/Operation not permitted > >FAILED to start thread on CPU 1: 1/Operation not permitted > >FAILED to start thread on CPU 2: 1/Operation not permitted > >FAILED to start thread on CPU 3: 1/Operation not permitted > > But those isn't important. I add some message in kernel and found the reason > is inode already existed. > But the function __create_file dosen't return correctly errno.So blktrace > tool can't print correctly message. > I think func __create_file should return correctly message(ERR_PTR(error)) > not NULL. Patches are always welcome :) greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2 1/3] w1: mxc_w1: Adapt the clock name to the new clock framework
On Sun, Nov 18, 2012 at 11:56:13PM -0200, Fabio Estevam wrote: > Hi Sascha, > > On Wed, Oct 3, 2012 at 4:28 AM, Evgeniy Polyakov wrote: > > On Tue, Oct 02, 2012 at 10:04:19PM -0300, Fabio Estevam > > (feste...@gmail.com) wrote: > >> > I have no objections per se, but I'm hardly an expert in imx clock > >> > framework :) > >> > > >> > Since it is only one patch in set of 3, I suppose it will be pushed > >> > through different tree than w1. Feel free to add my ack. > >> > > >> > Acked-by: Evgeniy Polyakov > >> > >> Could this series go via your tree? > > > > Please send it to Greg (added to CC), but I would like someone who knows > > this platform (and not only w1 bits, which look good) to acknowledge > > changes, > > feel free to add mine. > > Could you please ack this series? > > Greg, > > Should I re-send the patches with Evgeniy and Sascha's acks? Please do so, so that I can apply them to my tree. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] onewire: w1-gpio: add ext_pullup_enable pin in platform data
On Sun, Aug 05, 2012 at 06:18:01PM +0200, Daniel Mack wrote: > On 01.08.2012 18:57, Ville Syrjälä wrote: > > On Tue, Jul 31, 2012 at 08:19:06AM +0200, Daniel Mack wrote: > >> On 31.07.2012 02:59, Ville Syrjälä wrote: > >>> On Mon, Jul 30, 2012 at 10:12:39PM +0400, Evgeniy Polyakov wrote: > Hi > > Sorry for long delay > [resend with fixed Greg's address :)] > > On Wed, Jul 25, 2012 at 10:54:29PM +0200, Daniel Mack (zon...@gmail.com) > wrote: > > In the process of porting boards to devicetree implemenation, we should > > keep information about external circuitry where they belong - the > > individual drivers. > > > > This patch adds a way to specify a GPIO to drive the (optional) external > > pull-up logic, rather than using a function pointer for that. > > I do not object against this patch, but I have rather limited knowledge > about gpio driver. Patch looks good, feel free to add my > Acked-by: Evgeniy Polyakov > > Greg, please pull it into your tree, if Ville does not object. > >>> > >>> No objections from me. > >> > >> I take this as an Acked-by:? > > > > Sure, why not :) > > > > Acked-by: Ville Syrjälä > > > > Greg, could you queue up these two patches somewhere? Yes, I now have them, thanks. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch driver-core-update-some-prototypes-in-platform.txt.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: Driver core: Update some prototypes in platform.txt to my gregkh-2.6 tree. Its filename is driver-core-update-some-prototypes-in-platform.txt.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Sat Feb 2 12:50:36 2008 From: Stephen Rothwell <[EMAIL PROTECTED]> Date: Sat, 2 Feb 2008 22:15:07 +1100 Subject: Driver core: Update some prototypes in platform.txt To: Greg Kroah-Hartman <[EMAIL PROTECTED]> Cc: LKML Message-ID: <[EMAIL PROTECTED]> Just make these match the actual code. Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- Documentation/driver-model/platform.txt |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/Documentation/driver-model/platform.txt +++ b/Documentation/driver-model/platform.txt @@ -122,15 +122,15 @@ None the less, there are some APIs to su using these calls except with such hotplug-deficient drivers. struct platform_device *platform_device_alloc( - char *name, unsigned id); + const char *name, int id); You can use platform_device_alloc() to dynamically allocate a device, which you will then initialize with resources and platform_device_register(). A better solution is usually: struct platform_device *platform_device_register_simple( - char *name, unsigned id, - struct resource *res, unsigned nres); + const char *name, int id, + struct resource *res, unsigned int nres); You can use platform_device_register_simple() as a one-step call to allocate and register a device. Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are bad/battery-class-driver.patch driver/ppc-fix-powerpc-vio_find_name-to-not-use-devices_subsys.patch driver/driver-core-update-some-prototypes-in-platform.txt.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch usb-ftdi_sio.c-add-missing.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: USB: ftdi_sio.c add missing '|' to my gregkh-2.6 tree. Its filename is usb-ftdi_sio.c-add-missing.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Thu Feb 7 10:05:29 2008 From: Roel Kluin <[EMAIL PROTECTED]> Date: Thu, 07 Feb 2008 01:06:07 +0100 Subject: USB: ftdi_sio.c add missing '|' To: Greg KH <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], lkml Message-ID: <[EMAIL PROTECTED]> add missing '|' Signed-off-by: Roel Kluin <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/serial/ftdi_sio.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -394,7 +394,7 @@ static const char *ftdi_chip_name[] = { /* End TIOCMIWAIT */ #define FTDI_IMPL_ASYNC_FLAGS = ( ASYNC_SPD_HI | ASYNC_SPD_VHI \ - ASYNC_SPD_CUST | ASYNC_SPD_SHI | ASYNC_SPD_WARP ) + | ASYNC_SPD_CUST | ASYNC_SPD_SHI | ASYNC_SPD_WARP ) /* function prototypes for a FTDI serial converter */ static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id); Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are usb/usb-ftdi_sio.c-add-missing.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch debugfs-fix-sparse-warnings.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: debugfs: fix sparse warnings to my gregkh-2.6 tree. Its filename is debugfs-fix-sparse-warnings.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Wed Feb 13 17:08:21 2008 From: Harvey Harrison <[EMAIL PROTECTED]> Date: Wed, 13 Feb 2008 17:08:16 -0800 Subject: debugfs: fix sparse warnings To: Greg KH <[EMAIL PROTECTED]>, Andrew Morton <[EMAIL PROTECTED]> Cc: LKML Message-ID: <[EMAIL PROTECTED]> extern does not belong in C files, move declaration to linux/debugfs.h fs/debugfs/file.c:42:30: warning: symbol 'debugfs_file_operations' was not declared. Should it be static? fs/debugfs/file.c:54:31: warning: symbol 'debugfs_link_operations' was not declared. Should it be static? Signed-off-by: Harvey Harrison <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- fs/debugfs/inode.c |4 include/linux/debugfs.h |5 + 2 files changed, 5 insertions(+), 4 deletions(-) --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -29,10 +29,6 @@ #define DEBUGFS_MAGIC 0x64626720 -/* declared over in file.c */ -extern struct file_operations debugfs_file_operations; -extern struct inode_operations debugfs_link_operations; - static struct vfsmount *debugfs_mount; static int debugfs_mount_count; --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h @@ -27,6 +27,11 @@ struct debugfs_blob_wrapper { }; #if defined(CONFIG_DEBUG_FS) + +/* declared over in file.c */ +extern const struct file_operations debugfs_file_operations; +extern const struct inode_operations debugfs_link_operations; + struct dentry *debugfs_create_file(const char *name, mode_t mode, struct dentry *parent, void *data, const struct file_operations *fops); Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/debugfs-fix-sparse-warnings.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch driver-core-register_memory-unregister_memory-clean-ups-and-bugfix.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: driver core: register_memory/unregister_memory clean ups and bugfix to my gregkh-2.6 tree. Its filename is driver-core-register_memory-unregister_memory-clean-ups-and-bugfix.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Mon Feb 11 09:20:30 2008 From: Badari Pulavarty <[EMAIL PROTECTED]> Date: Mon, 11 Feb 2008 09:23:18 -0800 Subject: driver core: register_memory/unregister_memory clean ups and bugfix To: Andrew Morton <[EMAIL PROTECTED]>, lkml Cc: Greg KH <[EMAIL PROTECTED]>, [EMAIL PROTECTED], linux-mm <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> register_memory()/unregister_memory() never gets called with "root". unregister_memory() is accessing kobject_name of the object just freed up. Since no one uses the code, lets take the code out. And also, make register_memory() static. Another bug fix - before calling unregister_memory() remove_memory_block() gets a ref on kobject. unregister_memory() need to drop that ref before calling sysdev_unregister(). Signed-off-by: Badari Pulavarty <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/memory.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -62,8 +62,8 @@ void unregister_memory_notifier(struct n /* * register_memory - Setup a sysfs device for a memory block */ -int register_memory(struct memory_block *memory, struct mem_section *section, - struct node *root) +static +int register_memory(struct memory_block *memory, struct mem_section *section) { int error; @@ -71,26 +71,18 @@ int register_memory(struct memory_block memory->sysdev.id = __section_nr(section); error = sysdev_register(&memory->sysdev); - - if (root && !error) - error = sysfs_create_link(&root->sysdev.kobj, - &memory->sysdev.kobj, - kobject_name(&memory->sysdev.kobj)); - return error; } static void -unregister_memory(struct memory_block *memory, struct mem_section *section, - struct node *root) +unregister_memory(struct memory_block *memory, struct mem_section *section) { BUG_ON(memory->sysdev.cls != &memory_sysdev_class); BUG_ON(memory->sysdev.id != __section_nr(section)); + /* drop the ref. we got in remove_memory_block() */ + kobject_put(&memory->sysdev.kobj); sysdev_unregister(&memory->sysdev); - if (root) - sysfs_remove_link(&root->sysdev.kobj, - kobject_name(&memory->sysdev.kobj)); } /* @@ -345,7 +337,7 @@ static int add_memory_block(unsigned lon mutex_init(&mem->state_mutex); mem->phys_device = phys_device; - ret = register_memory(mem, section, NULL); + ret = register_memory(mem, section); if (!ret) ret = mem_create_simple_file(mem, phys_index); if (!ret) @@ -396,7 +388,7 @@ int remove_memory_block(unsigned long no mem_remove_simple_file(mem, phys_index); mem_remove_simple_file(mem, state); mem_remove_simple_file(mem, phys_device); - unregister_memory(mem, section, NULL); + unregister_memory(mem, section); return 0; } Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/driver-core-register_memory-unregister_memory-clean-ups-and-bugfix.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch usb-usbatm-convert-heavy-init-dances-to-kthread-api.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: USB: usbatm: convert heavy init dances to kthread API to my gregkh-2.6 tree. Its filename is usb-usbatm-convert-heavy-init-dances-to-kthread-api.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Mon Feb 11 04:29:00 2008 From: Pavel Emelyanov <[EMAIL PROTECTED]> Date: Mon, 11 Feb 2008 15:26:09 +0300 Subject: USB: usbatm: convert heavy init dances to kthread API To: Andrew Morton <[EMAIL PROTECTED]> Cc: Duncan Sands <[EMAIL PROTECTED]>, Linux Kernel Mailing List , [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> This is an attempt to kill two birds with one stone. First, we kill one more user of kernel_thread, which is scheduled for removal. Second - we kill one of the last users of kill_proc - the function which is also to be removed, because it uses a pid_t which is not safe now. Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]> Signed-off-by: Duncan Sands <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/atm/usbatm.c | 25 ++--- drivers/usb/atm/usbatm.h |2 +- 2 files changed, 15 insertions(+), 12 deletions(-) --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c @@ -80,6 +80,7 @@ #include #include #include +#include #ifdef VERBOSE_DEBUG static int usbatm_print_packet(const unsigned char *data, int len); @@ -1014,10 +1015,7 @@ static int usbatm_do_heavy_init(void *ar struct usbatm_data *instance = arg; int ret; - daemonize(instance->driver->driver_name); allow_signal(SIGTERM); - instance->thread_pid = current->pid; - complete(&instance->thread_started); ret = instance->driver->heavy_init(instance, instance->usb_intf); @@ -1026,7 +1024,7 @@ static int usbatm_do_heavy_init(void *ar ret = usbatm_atm_init(instance); mutex_lock(&instance->serialize); - instance->thread_pid = -1; + instance->thread = NULL; mutex_unlock(&instance->serialize); complete_and_exit(&instance->thread_exited, ret); @@ -1034,13 +1032,18 @@ static int usbatm_do_heavy_init(void *ar static int usbatm_heavy_init(struct usbatm_data *instance) { - int ret = kernel_thread(usbatm_do_heavy_init, instance, CLONE_FS | CLONE_FILES); + struct task_struct *t; - if (ret < 0) { - usb_err(instance, "%s: failed to create kernel_thread (%d)!\n", __func__, ret); - return ret; + t = kthread_create(usbatm_do_heavy_init, instance, + instance->driver->driver_name); + if (IS_ERR(t)) { + usb_err(instance, "%s: failed to create kernel_thread (%ld)!\n", + __func__, PTR_ERR(t)); + return PTR_ERR(t); } + instance->thread = t; + wake_up_process(t); wait_for_completion(&instance->thread_started); return 0; @@ -1124,7 +1127,7 @@ int usbatm_usb_probe(struct usb_interfac kref_init(&instance->refcount); /* dropped in usbatm_usb_disconnect */ mutex_init(&instance->serialize); - instance->thread_pid = -1; + instance->thread = NULL; init_completion(&instance->thread_started); init_completion(&instance->thread_exited); @@ -1287,8 +1290,8 @@ void usbatm_usb_disconnect(struct usb_in mutex_lock(&instance->serialize); instance->disconnected = 1; - if (instance->thread_pid >= 0) - kill_proc(instance->thread_pid, SIGTERM, 1); + if (instance->thread != NULL) + send_sig(SIGTERM, instance->thread, 1); mutex_unlock(&instance->serialize); wait_for_completion(&instance->thread_exited); --- a/drivers/usb/atm/usbatm.h +++ b/drivers/usb/atm/usbatm.h @@ -176,7 +176,7 @@ struct usbatm_data { int disconnected; /* heavy init */ - int thread_pid; + struct task_struct *thread; struct completion thread_started; struct completion thread_exited; Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are usb/usb-usbatm-convert-heavy-init-dances-to-kthread-api.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch driver-core-fix-kernel-doc-function-parameters.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: [PATCH] driver-core: fix kernel-doc function parameters to my gregkh-2.6 tree. Its filename is driver-core-fix-kernel-doc-function-parameters.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Mon Feb 18 13:09:55 2008 From: Randy Dunlap <[EMAIL PROTECTED]> Date: Mon, 18 Feb 2008 13:09:03 -0800 Subject: [PATCH] driver-core: fix kernel-doc function parameters To: lkml Cc: gregkh <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> From: Randy Dunlap <[EMAIL PROTECTED]> Fix drivers/base/ missing kernel-doc parameters: Warning(linux-2.6.24-git12//drivers/base/driver.c:133): No description found for parameter 'drv' Warning(linux-2.6.24-git12//drivers/base/driver.c:133): No description found for parameter 'kobj' Warning(linux-2.6.24-git12//drivers/base/driver.c:133): No description found for parameter 'fmt' Warning(linux-2.6.24-git12//drivers/base/power/main.c:530): No description found for parameter 'state' Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/driver.c |3 +++ drivers/base/power/main.c |1 + 2 files changed, 4 insertions(+) --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -120,6 +120,9 @@ EXPORT_SYMBOL_GPL(driver_remove_file); /** * driver_add_kobj - add a kobject below the specified driver + * @drv: requesting device driver + * @kobj: kobject to add below this driver + * @fmt: format string that names the kobject * * You really don't want to do this, this is only here due to one looney * iseries driver, go poke those developers if you are annoyed about --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -523,6 +523,7 @@ static void lock_all_devices(void) /** * device_suspend - Save state and stop all devices in system. + * @state: new power management state * * Prevent new devices from being registered, then lock all devices * and suspend them. Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/driver-core-fix-kernel-doc-function-parameters.patch pci/pci-kernel-doc-fix-pci-acpi-warning.patch usb/usb-convert-usb.h-struct-usb_device-to-kernel-doc.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pm-remove-unbalanced-mutex_unlock-from-dpm_resume.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PM: Remove unbalanced mutex_unlock() from dpm_resume() to my gregkh-2.6 tree. Its filename is pm-remove-unbalanced-mutex_unlock-from-dpm_resume.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Wed Feb 20 12:56:19 2008 From: "Rafael J. Wysocki" <[EMAIL PROTECTED]> Date: Wed, 20 Feb 2008 02:01:41 +0100 Subject: PM: Remove unbalanced mutex_unlock() from dpm_resume() To: Greg KH <[EMAIL PROTECTED]> Cc: ACPI Devel Maling List <[EMAIL PROTECTED]>, Alan Stern <[EMAIL PROTECTED]>, Len Brown <[EMAIL PROTECTED]>, "Linux-pm mailing list" <[EMAIL PROTECTED]>, LKML , Pavel Machek <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline From: Rafael J. Wysocki <[EMAIL PROTECTED]> Remove an unnecessary unlocking of dpm_list_mtx in the error path in drivers/base/power/main.c:dpm_suspend() . Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]> Acked-by: Alan Stern <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/power/main.c |1 - 1 file changed, 1 deletion(-) --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -479,7 +479,6 @@ static int dpm_suspend(pm_message_t stat mutex_lock(&dpm_list_mtx); if (list_empty(&dev->power.entry)) list_add(&dev->power.entry, &dpm_locked); - mutex_unlock(&dpm_list_mtx); break; } mutex_lock(&dpm_list_mtx); Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/driver-core-pm-make-suspend_device-static.patch driver/pm-remove-unbalanced-mutex_unlock-from-dpm_resume.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pci-remove-parisc-consumer-of-the-pci-global_list.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: remove parisc consumer of the pci global_list to my gregkh-2.6 tree. Its filename is pci-remove-parisc-consumer-of-the-pci-global_list.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Wed Feb 20 14:22:51 2008 From: James Bottomley <[EMAIL PROTECTED]> Date: Wed, 20 Feb 2008 15:14:24 -0600 Subject: PCI: remove parisc consumer of the pci global_list To: Greg KH <[EMAIL PROTECTED]> Cc: Parisc List <[EMAIL PROTECTED]>, linux-kernel Message-ID: <[EMAIL PROTECTED]> Remove the parisc usage of the global_list, as it's not needed anymore. Signed-off-by: James Bottomley <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/parisc/dino.c |1 - 1 file changed, 1 deletion(-) --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -496,7 +496,6 @@ dino_card_setup(struct pci_bus *bus, voi list_for_each_safe(ln, tmp_ln, &bus->devices) { struct pci_dev *dev = pci_dev_b(ln); - list_del(&dev->global_list); list_del(&dev->bus_list); } Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are pci/pci-remove-parisc-consumer-of-the-pci-global_list.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch firmware-move-firmware_class-from-documentation-to-samples.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: firmware: move firmware_class from Documentation/ to samples/ to my gregkh-2.6 tree. Its filename is firmware-move-firmware_class-from-documentation-to-samples.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Wed Feb 20 14:33:28 2008 From: Randy Dunlap <[EMAIL PROTECTED]> Date: Wed, 20 Feb 2008 13:20:50 -0800 Subject: firmware: move firmware_class from Documentation/ to samples/ To: Greg KH <[EMAIL PROTECTED]> Cc: lkml , akpm <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> From: Randy Dunlap <[EMAIL PROTECTED]> Move the firmware_class sample drivers to samples/ so that they are buildable and can be maintained. Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]> Acked-by: Marcel Holtmann <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- Documentation/firmware_class/firmware_sample_driver.c | 115 - Documentation/firmware_class/firmware_sample_firmware_class.c | 207 -- samples/firmware_class/firmware_sample_driver.c | 115 + samples/firmware_class/firmware_sample_firmware_class.c | 207 ++ 4 files changed, 322 insertions(+), 322 deletions(-) --- a/Documentation/firmware_class/firmware_sample_driver.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * firmware_sample_driver.c - - * - * Copyright (c) 2003 Manuel Estrada Sainz - * - * Sample code on how to use request_firmware() from drivers. - * - */ - -#include -#include -#include -#include -#include - -#include "linux/firmware.h" - -static struct device ghost_device = { - .bus_id= "ghost0", -}; - - -static void sample_firmware_load(char *firmware, int size) -{ - u8 buf[size+1]; - memcpy(buf, firmware, size); - buf[size] = '\0'; - printk(KERN_INFO "firmware_sample_driver: firmware: %s\n", buf); -} - -static void sample_probe_default(void) -{ - /* uses the default method to get the firmware */ -const struct firmware *fw_entry; - printk(KERN_INFO "firmware_sample_driver: a ghost device got inserted :)\n"); - -if(request_firmware(&fw_entry, "sample_driver_fw", &ghost_device)!=0) - { - printk(KERN_ERR - "firmware_sample_driver: Firmware not available\n"); - return; - } - - sample_firmware_load(fw_entry->data, fw_entry->size); - - release_firmware(fw_entry); - - /* finish setting up the device */ -} -static void sample_probe_specific(void) -{ - /* Uses some specific hotplug support to get the firmware from -* userspace directly into the hardware, or via some sysfs file */ - - /* NOTE: This currently doesn't work */ - - printk(KERN_INFO "firmware_sample_driver: a ghost device got inserted :)\n"); - -if(request_firmware(NULL, "sample_driver_fw", &ghost_device)!=0) - { - printk(KERN_ERR - "firmware_sample_driver: Firmware load failed\n"); - return; - } - - /* request_firmware blocks until userspace finished, so at -* this point the firmware should be already in the device */ - - /* finish setting up the device */ -} -static void sample_probe_async_cont(const struct firmware *fw, void *context) -{ - if(!fw){ - printk(KERN_ERR - "firmware_sample_driver: firmware load failed\n"); - return; - } - - printk(KERN_INFO "firmware_sample_driver: device pointer \"%s\"\n", - (char *)context); - sample_firmware_load(fw->data, fw->size); -} -static void sample_probe_async(void) -{ - /* Let's say that I can't sleep */ - int error; - error = request_firmware_nowait (THIS_MODULE, FW_ACTION_NOHOTPLUG, -"sample_driver_fw", &ghost_device, -"my device pointer", -sample_probe_async_cont); - if(error){ - printk(KERN_ERR - "firmware_sample_driver:" - " request_firmware_nowait failed\n"); - } -} - -static int sample_init(void) -{ - device_initialize(&ghost_device); - /* since there is no real hardware insertion I just call the -* sample probe functions here */ - sample_probe_specific(); - sample_probe_default(); - sample_probe_async(); - return 0; -} -static void __exit sample_exit(void) -{ -} - -module_init (sample_init); -module_exit (sample_exit); - -MODUL
patch power_state-remove-it-from-driver-core.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: power_state: remove it from driver core to my gregkh-2.6 tree. Its filename is power_state-remove-it-from-driver-core.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Thu Feb 21 13:36:22 2008 From: Pavel Machek <[EMAIL PROTECTED]> Date: Thu, 21 Feb 2008 13:58:10 +0100 Subject: power_state: remove it from driver core To: kernel list , Linux-pm mailing list <[EMAIL PROTECTED]>, "Rafael J. Wysocki" <[EMAIL PROTECTED]>, Greg KH <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline power_state is scheduled for removal, and it is used only for debug prints by driver core. Remove it. Signed-off-by: Pavel Machek <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/power/main.c |5 - 1 file changed, 5 deletions(-) --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -419,11 +419,6 @@ static int suspend_device(struct device { int error = 0; - if (dev->power.power_state.event) { - dev_dbg(dev, "PM: suspend %d-->%d\n", - dev->power.power_state.event, state.event); - } - if (dev->class && dev->class->suspend) { suspend_device_dbg(dev, state, "class "); error = dev->class->suspend(dev, state); Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/driver-core-pm-make-suspend_device-static.patch driver/pm-remove-unbalanced-mutex_unlock-from-dpm_resume.patch driver/power_state-remove-it-from-driver-core.patch usb/power_state-remove-it-from-usb.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch power_state-remove-it-from-usb.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: power_state: remove it from usb to my gregkh-2.6 tree. Its filename is power_state-remove-it-from-usb.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Thu Feb 21 13:36:03 2008 From: Pavel Machek <[EMAIL PROTECTED]> Date: Thu, 21 Feb 2008 14:01:45 +0100 Subject: power_state: remove it from usb To: kernel list , Linux-pm mailing list <[EMAIL PROTECTED]>, Greg KH <[EMAIL PROTECTED]>, [EMAIL PROTECTED], [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline power_state is scheduled for removal, and it is used only write-only by USB. Remove it. Signed-off-by: Pavel Machek <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/core/driver.c |3 --- drivers/usb/core/hcd-pci.c |5 - drivers/usb/core/usb.h |2 -- 3 files changed, 10 deletions(-) --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -794,8 +794,6 @@ static int usb_suspend_device(struct usb done: dev_vdbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); - if (status == 0) - udev->dev.power.power_state.event = msg.event; return status; } @@ -826,7 +824,6 @@ static int usb_resume_device(struct usb_ dev_vdbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); if (status == 0) { udev->autoresume_disabled = 0; - udev->dev.power.power_state.event = PM_EVENT_ON; } return status; } --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c @@ -73,7 +73,6 @@ int usb_hcd_pci_probe(struct pci_dev *de if (pci_enable_device(dev) < 0) return -ENODEV; dev->current_state = PCI_D0; - dev->dev.power.power_state = PMSG_ON; if (!dev->irq) { dev_err(&dev->dev, @@ -302,8 +301,6 @@ int usb_hcd_pci_suspend(struct pci_dev * done: if (retval == 0) { - dev->dev.power.power_state = PMSG_SUSPEND; - #ifdef CONFIG_PPC_PMAC /* Disable ASIC clocks for USB */ if (machine_is(powermac)) { @@ -406,8 +403,6 @@ int usb_hcd_pci_resume(struct pci_dev *d pci_set_master(dev); pci_restore_state(dev); - dev->dev.power.power_state = PMSG_ON; - clear_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); if (hcd->driver->resume) { --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -114,13 +114,11 @@ static inline int is_usb_device_driver(s static inline void mark_active(struct usb_interface *f) { f->is_active = 1; - f->dev.power.power_state.event = PM_EVENT_ON; } static inline void mark_quiesced(struct usb_interface *f) { f->is_active = 0; - f->dev.power.power_state.event = PM_EVENT_SUSPEND; } static inline int is_active(const struct usb_interface *f) Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/driver-core-pm-make-suspend_device-static.patch driver/pm-remove-unbalanced-mutex_unlock-from-dpm_resume.patch driver/power_state-remove-it-from-driver-core.patch usb/power_state-remove-it-from-usb.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pci-cleanup-return-values-fix.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: Fix regression in pci_enable_device_bars to my gregkh-2.6 tree. Its filename is pci-cleanup-return-values-fix.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/driver-link-device-and-class.patch pci/pci-cleanup-return-values-fix.patch usb/usb-gadget-centrialize-numbers.patch usb/usb-storage-fix-something.patch usb/usb-storage-rearrange-stuff.patch usb/usb-storage-01.patch usb/usb-storage-02.patch usb/usb-storage-03.patch usb/usb-storage-05.patch usb/usb-remove-URB_ASYNC_UNLINK.patch >From [EMAIL PROTECTED] Wed Aug 10 12:21:39 2005 Date: Wed, 10 Aug 2005 15:18:44 -0400 (EDT) From: Alan Stern <[EMAIL PROTECTED]> To: Greg KH <[EMAIL PROTECTED]> cc: Kernel development list Subject: PCI: Fix regression in pci_enable_device_bars Message-ID: <[EMAIL PROTECTED]> This patch (as552) fixes yet another small problem recently added. If an attempt to put a PCI device back into D0 fails because the device doesn't support PCI PM, it shouldn't count as error. Without this patch the UHCI controllers on my Intel motherboard don't work. Signed-off-by: Alan Stern <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/pci.c |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) --- gregkh-2.6.orig/drivers/pci/pci.c 2005-08-10 14:23:35.0 -0700 +++ gregkh-2.6/drivers/pci/pci.c2005-08-10 14:35:39.0 -0700 @@ -441,7 +441,7 @@ int err; err = pci_set_power_state(dev, PCI_D0); - if (err) + if (err < 0 && err != -EIO) return err; err = pcibios_enable_device(dev, bars); if (err < 0) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch i2c-ds1337-12-24-mode-fix.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: I2C: ds1337 - fix 12/24 hour mode bug to my gregkh-2.6 tree. Its filename is i2c-ds1337-12-24-mode-fix.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are devfs/devfs-remove-devfs-tape.patch devfs/devfs-die-die-die.patch devfs/devfs-remove-devfs_mk_symlink.patch devfs/devfs-remove-devfs_mk_bdev.patch devfs/devfs-remove-devfs_mk_dir.patch devfs/devfs-scrub-partitions.patch devfs/devfs-scrub-init.patch devfs/devfs-remove-devfs_mk_cdev.patch devfs/devfs-remove-devfs_remove.patch devfs/devfs-remove-devfs_fs_kernel.h.patch devfs/devfs-remove-misc-devfs_name.patch devfs/devfs-remove-genhd-devfs_name.patch devfs/devfs-remove-videodev-devfs_name.patch devfs/devfs-remove-serial-devfs_name.patch devfs/devfs-remove-ide-devfs_name.patch devfs/devfs-remove-line-devfs_name.patch devfs/devfs-remove-scsi-devfs_name.patch devfs/devfs-remove-tty-devfs_name.patch devfs/devfs-remove-usb-mode.patch devfs/devfs-tty_driver_no_devfs.patch devfs/devfs-minor-cleanups.patch devfs/devfs-remove-documentation.patch devfs/ndevfs.patch driver/securityfs.patch driver/driver-sample.sh.patch gregkh/gregkh-debugfs_example.patch gregkh/gregkh-kobject-warn.patch gregkh/gregkh-laptop-sysrq.patch gregkh/gregkh-usb-hacking.patch gregkh/gregkh-usb-minors.patch i2c/i2c-max6875-documentation-update.patch i2c/i2c-max6875-simplify.patch i2c/i2c-mpc-restore-code-removed.patch i2c/i2c-hwmon-class-01.patch i2c/i2c-hwmon-class-02.patch i2c/i2c-hwmon-class-03.patch i2c/i2c-missing-space.patch i2c/i2c-ds1337-12-24-mode-fix.patch i2c/i2c-nforce2-cleanup.patch pci/pci-acpi-mcfg-04.patch >From [EMAIL PROTECTED] Mon Jul 25 10:41:08 2005 Date: Mon, 25 Jul 2005 10:24:36 +0200 To: Greg KH <[EMAIL PROTECTED]> Cc: James Chapman <[EMAIL PROTECTED]>, LKML Subject: I2C: ds1337 - fix 12/24 hour mode bug Message-ID: <[EMAIL PROTECTED]> From: Ladislav Michl <[EMAIL PROTECTED]> DS1339 manual, page 6, chapter Date and time operation: The DS1339 can be run in either 12-hour or 24-hour mode. Bit 6 of the hours register is defined as the 12-hour or 24-hour mode-select bit. When high, the 12-hour mode is selected. Patch below makes ds1337 driver work as documented in manual. Signed-off-by: Ladislav Michl <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/i2c/chips/ds1337.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) --- gregkh-2.6.orig/drivers/i2c/chips/ds1337.c 2005-07-13 09:45:05.0 -0700 +++ gregkh-2.6/drivers/i2c/chips/ds1337.c 2005-07-26 15:02:26.0 -0700 @@ -165,7 +165,7 @@ buf[0] = 0; /* reg offset */ buf[1] = BIN2BCD(dt->tm_sec); buf[2] = BIN2BCD(dt->tm_min); - buf[3] = BIN2BCD(dt->tm_hour) | (1 << 6); + buf[3] = BIN2BCD(dt->tm_hour); buf[4] = BIN2BCD(dt->tm_wday) + 1; buf[5] = BIN2BCD(dt->tm_mday); buf[6] = BIN2BCD(dt->tm_mon) + 1; @@ -344,9 +344,9 @@ /* Ensure that device is set in 24-hour mode */ val = i2c_smbus_read_byte_data(client, DS1337_REG_HOUR); - if ((val >= 0) && (val & (1 << 6)) == 0) + if ((val >= 0) && (val & (1 << 6))) i2c_smbus_write_byte_data(client, DS1337_REG_HOUR, - val | (1 << 6)); + val & 0x3f); } static int ds1337_detach_client(struct i2c_client *client) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch i2c-hwmon-split-09.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: I2C: Separate non-i2c hwmon drivers from i2c-core (9/9) to my gregkh-2.6 tree. Its filename is i2c-hwmon-split-09.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are i2c/i2c-max6875-documentation-update.patch i2c/i2c-max6875-simplify.patch i2c/i2c-hwmon-class-01.patch i2c/i2c-hwmon-class-02.patch i2c/i2c-hwmon-class-03.patch i2c/i2c-missing-space.patch i2c/i2c-nforce2-cleanup.patch i2c/i2c-hwmon-split-01.patch i2c/i2c-hwmon-split-02.patch i2c/i2c-hwmon-split-03.patch i2c/i2c-hwmon-split-04.patch i2c/i2c-hwmon-split-05.patch i2c/i2c-hwmon-split-06.patch i2c/i2c-hwmon-split-07.patch i2c/i2c-hwmon-split-08.patch i2c/i2c-hwmon-split-09.patch >From [EMAIL PROTECTED] Tue Jul 19 18:12:04 2005 Date: Wed, 20 Jul 2005 00:09:03 +0200 From: Jean Delvare <[EMAIL PROTECTED]> To: LKML , LM Sensors <[EMAIL PROTECTED]> Cc: Greg KH <[EMAIL PROTECTED]> Subject: I2C: Separate non-i2c hwmon drivers from i2c-core (9/9) Message-Id: <[EMAIL PROTECTED]> Move the definitions of i2c_is_isa_client and i2c_is_isa_adapter from i2c.h to i2c-isa.h. Only hybrid drivers still need them. Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- include/linux/i2c-isa.h |7 +++ include/linux/i2c.h |7 --- 2 files changed, 7 insertions(+), 7 deletions(-) --- gregkh-2.6.orig/include/linux/i2c-isa.h 2005-07-26 15:14:08.0 -0700 +++ gregkh-2.6/include/linux/i2c-isa.h 2005-07-26 15:16:51.0 -0700 @@ -26,4 +26,11 @@ extern int i2c_isa_add_driver(struct i2c_driver *driver); extern int i2c_isa_del_driver(struct i2c_driver *driver); +/* Detect whether we are on the isa bus. This is only useful to hybrid + (i2c+isa) drivers. */ +#define i2c_is_isa_client(clientptr) \ +((clientptr)->adapter->algo->id == I2C_ALGO_ISA) +#define i2c_is_isa_adapter(adapptr) \ +((adapptr)->algo->id == I2C_ALGO_ISA) + #endif /* _LINUX_I2C_ISA_H */ --- gregkh-2.6.orig/include/linux/i2c.h 2005-07-26 15:16:45.0 -0700 +++ gregkh-2.6/include/linux/i2c.h 2005-07-26 15:16:51.0 -0700 @@ -575,11 +575,4 @@ .force =force, \ } -/* Detect whether we are on the isa bus. If this returns true, all i2c - access will fail! */ -#define i2c_is_isa_client(clientptr) \ -((clientptr)->adapter->algo->id == I2C_ALGO_ISA) -#define i2c_is_isa_adapter(adapptr) \ -((adapptr)->algo->id == I2C_ALGO_ISA) - #endif /* _LINUX_I2C_H */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch i2c-hwmon-split-05.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: I2C: Separate non-i2c hwmon drivers from i2c-core (5/9) to my gregkh-2.6 tree. Its filename is i2c-hwmon-split-05.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are i2c/i2c-max6875-documentation-update.patch i2c/i2c-max6875-simplify.patch i2c/i2c-hwmon-class-01.patch i2c/i2c-hwmon-class-02.patch i2c/i2c-hwmon-class-03.patch i2c/i2c-missing-space.patch i2c/i2c-nforce2-cleanup.patch i2c/i2c-hwmon-split-01.patch i2c/i2c-hwmon-split-02.patch i2c/i2c-hwmon-split-03.patch i2c/i2c-hwmon-split-04.patch i2c/i2c-hwmon-split-05.patch i2c/i2c-hwmon-split-06.patch i2c/i2c-hwmon-split-07.patch i2c/i2c-hwmon-split-08.patch i2c/i2c-hwmon-split-09.patch >From [EMAIL PROTECTED] Tue Jul 19 18:00:07 2005 Date: Tue, 19 Jul 2005 23:56:35 +0200 From: Jean Delvare <[EMAIL PROTECTED]> To: LKML , LM Sensors <[EMAIL PROTECTED]> Cc: Greg KH <[EMAIL PROTECTED]> Subject: I2C: Separate non-i2c hwmon drivers from i2c-core (5/9) Message-Id: <[EMAIL PROTECTED]> Call the ISA chip drivers detection function directly instead of relying on i2c_detect. The net effect is that address lists won't be handled anymore, but they were mostly useless in the ISA case anyway (pc87360, smsc47m1, smsc47b397 had already dropped them). We don't need to handle multiple devices, all we may need is a way to force a given address instead of the original one (some drivers already do: sis5595, via686a, w83627hf), and, for drivers supporting multiple chips, a way to force one given kind. All this may be added later on demand, but I actually don't think there will be much demand. Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/hwmon/it87.c | 16 ++ drivers/hwmon/lm78.c | 11 -- drivers/hwmon/pc87360.c| 38 -- drivers/hwmon/sis5595.c| 41 - drivers/hwmon/smsc47b397.c | 48 +++- drivers/hwmon/smsc47m1.c | 42 -- drivers/hwmon/via686a.c| 41 +++-- drivers/hwmon/w83627ehf.c | 35 drivers/hwmon/w83627hf.c | 49 +++-- drivers/hwmon/w83781d.c| 12 +-- 10 files changed, 98 insertions(+), 235 deletions(-) --- gregkh-2.6.orig/drivers/hwmon/pc87360.c 2005-07-26 15:14:08.0 -0700 +++ gregkh-2.6/drivers/hwmon/pc87360.c 2005-07-26 15:16:29.0 -0700 @@ -39,25 +39,17 @@ #include #include #include -#include #include #include #include #include -static unsigned short normal_i2c[] = { I2C_CLIENT_END }; -static unsigned int normal_isa[] = { 0, I2C_CLIENT_ISA_END }; -static struct i2c_force_data forces[] = {{ NULL }}; static u8 devid; -static unsigned int extra_isa[3]; +static unsigned short address; +static unsigned short extra_isa[3]; static u8 confreg[4]; enum chips { any_chip, pc87360, pc87363, pc87364, pc87365, pc87366 }; -static struct i2c_address_data addr_data = { - .normal_i2c = normal_i2c, - .normal_isa = normal_isa, - .forces = forces, -}; static int init = 1; module_param(init, int, 0); @@ -228,8 +220,7 @@ * Functions declaration */ -static int pc87360_attach_adapter(struct i2c_adapter *adapter); -static int pc87360_detect(struct i2c_adapter *adapter, int address, int kind); +static int pc87360_detect(struct i2c_adapter *adapter); static int pc87360_detach_client(struct i2c_client *client); static int pc87360_read_value(struct pc87360_data *data, u8 ldi, u8 bank, @@ -246,8 +237,7 @@ static struct i2c_driver pc87360_driver = { .owner = THIS_MODULE, .name = "pc87360", - .flags = I2C_DF_NOTIFY, - .attach_adapter = pc87360_attach_adapter, + .attach_adapter = pc87360_detect, .detach_client = pc87360_detach_client, }; @@ -636,12 +626,7 @@ * Device detection, registration and update */ -static int pc87360_attach_adapter(struct i2c_adapter *adapter) -{ - return i2c_detect(adapter, &addr_data, pc87360_detect); -} - -static int pc87360_find(int sioaddr, u8 *devid, int *address) +static int pc87360_find(int sioaddr, u8 *devid, unsigned short *addresses) { u16 val; int i; @@ -687,7 +672,7 @@ continue; } - address[i] = val; + addresses[i] = val; if (i==0) { /* Fans */ confreg[0] = superio_inb(sioaddr, 0xF0); @@ -731,9 +716,7 @@ return 0; } -/* We don't really care about the address. - Read from extra_isa
patch i2c-hwmon-split-08.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: I2C: Separate non-i2c hwmon drivers from i2c-core (8/9) to my gregkh-2.6 tree. Its filename is i2c-hwmon-split-08.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are i2c/i2c-max6875-documentation-update.patch i2c/i2c-max6875-simplify.patch i2c/i2c-hwmon-class-01.patch i2c/i2c-hwmon-class-02.patch i2c/i2c-hwmon-class-03.patch i2c/i2c-missing-space.patch i2c/i2c-nforce2-cleanup.patch i2c/i2c-hwmon-split-01.patch i2c/i2c-hwmon-split-02.patch i2c/i2c-hwmon-split-03.patch i2c/i2c-hwmon-split-04.patch i2c/i2c-hwmon-split-05.patch i2c/i2c-hwmon-split-06.patch i2c/i2c-hwmon-split-07.patch i2c/i2c-hwmon-split-08.patch i2c/i2c-hwmon-split-09.patch >From [EMAIL PROTECTED] Tue Jul 19 18:06:45 2005 Date: Wed, 20 Jul 2005 00:05:33 +0200 From: Jean Delvare <[EMAIL PROTECTED]> To: LKML , LM Sensors <[EMAIL PROTECTED]> Cc: Greg KH <[EMAIL PROTECTED]> Subject: I2C: Separate non-i2c hwmon drivers from i2c-core (8/9) Message-Id: <[EMAIL PROTECTED]> Kill all uses of i2c_is_isa_adapter except for the hybrid drivers (it87, lm78, w83781d). The i2c-isa adapter not being registered with the i2c core anymore, drivers don't have to fear being erroneously attached to it. Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- Documentation/i2c/writing-clients | 11 +-- drivers/hwmon/adm1021.c |9 - drivers/hwmon/asb100.c|8 drivers/hwmon/lm75.c | 10 -- drivers/hwmon/lm85.c |5 - 5 files changed, 5 insertions(+), 38 deletions(-) --- gregkh-2.6.orig/Documentation/i2c/writing-clients 2005-07-26 15:16:45.0 -0700 +++ gregkh-2.6/Documentation/i2c/writing-clients2005-07-26 15:16:46.0 -0700 @@ -315,11 +315,10 @@ const char *type_name = ""; int is_isa = i2c_is_isa_adapter(adapter); -if (is_isa) { +/* Do this only if the chip can additionally be found on the ISA bus + (hybrid chip). */ - /* If this client can't be on the ISA bus at all, we can stop now - (call `goto ERROR0'). But for kicks, we will assume it is all - right. */ +if (is_isa) { /* Discard immediately if this ISA range is already used */ if (check_region(address,FOO_EXTENT)) @@ -495,10 +494,10 @@ return err; } -/* SENSORS ONLY START */ +/* HYBRID SENSORS CHIP ONLY START */ if i2c_is_isa_client(client) release_region(client->addr,LM78_EXTENT); -/* SENSORS ONLY END */ +/* HYBRID SENSORS CHIP ONLY END */ kfree(client); /* Frees client data too, if allocated at the same time */ return 0; --- gregkh-2.6.orig/drivers/hwmon/adm1021.c 2005-07-26 15:16:45.0 -0700 +++ gregkh-2.6/drivers/hwmon/adm1021.c 2005-07-26 15:16:46.0 -0700 @@ -198,15 +198,6 @@ int err = 0; const char *type_name = ""; - /* Make sure we aren't probing the ISA bus!! This is just a safety check - at this moment; i2c_detect really won't call us. */ -#ifdef DEBUG - if (i2c_is_isa_adapter(adapter)) { - dev_dbg(&adapter->dev, "adm1021_detect called for an ISA bus adapter?!?\n"); - return 0; - } -#endif - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) goto error0; --- gregkh-2.6.orig/drivers/hwmon/asb100.c 2005-07-26 15:16:45.0 -0700 +++ gregkh-2.6/drivers/hwmon/asb100.c 2005-07-26 15:16:46.0 -0700 @@ -714,14 +714,6 @@ struct i2c_client *new_client; struct asb100_data *data; - /* asb100 is SMBus only */ - if (i2c_is_isa_adapter(adapter)) { - pr_debug("asb100.o: detect failed, " - "cannot attach to legacy adapter!\n"); - err = -ENODEV; - goto ERROR0; - } - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { pr_debug("asb100.o: detect failed, " "smbus byte data not supported!\n"); --- gregkh-2.6.orig/drivers/hwmon/lm75.c2005-07-26 15:16:45.0 -0700 +++ gregkh-2.6/drivers/hwmon/lm75.c 2005-07-26 15:16:46.0 -0700 @@ -121,16 +121,6 @@ int err = 0; const char *name = ""; - /* Make sure we aren't probing the ISA bus!! This is just a safety check - at this moment; i2c_detect really won't call us. */ -#ifdef DEBUG - if (i2c_is_isa_adapter(adapter)) { - dev_dbg(&adapter->dev, - "lm75_detect called for an ISA bus adapter?!?\n"); -
patch driver-core-suppress-uevents-via-filter.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: Driver core: suppress uevents via filter to my gregkh-2.6 tree. Its filename is driver-core-suppress-uevents-via-filter.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Thu Mar 29 02:10:23 2007 From: Cornelia Huck <[EMAIL PROTECTED]> Date: Thu, 29 Mar 2007 11:12:11 +0200 Subject: Driver core: suppress uevents via filter To: linux-kernel <[EMAIL PROTECTED]> Cc: Andrew Morton <[EMAIL PROTECTED]>, Greg K-H <[EMAIL PROTECTED]>, Kay Sievers <[EMAIL PROTECTED]>, Eric Rannaud <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> From: Cornelia Huck <[EMAIL PROTECTED]> Suppress uevents for devices if uevent_suppress is set via dev_uevent_filter(). This makes the driver core suppress all device uevents, not just the add event in device_add(). Signed-off-by: Cornelia Huck <[EMAIL PROTECTED]> Cc: Kay Sievers <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/core.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -120,6 +120,8 @@ static int dev_uevent_filter(struct kset if (ktype == &ktype_device) { struct device *dev = to_dev(kobj); + if (dev->uevent_suppress) + return 0; if (dev->bus) return 1; if (dev->class) @@ -675,8 +677,7 @@ int device_add(struct device *dev) goto PMError; if ((error = bus_add_device(dev))) goto BusError; - if (!dev->uevent_suppress) - kobject_uevent(&dev->kobj, KOBJ_ADD); + kobject_uevent(&dev->kobj, KOBJ_ADD); bus_attach_device(dev); if (parent) klist_add_tail(&dev->knode_parent, &parent->klist_children); Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch driver-core-switch-firmware_class-to-uevent_suppress.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: Driver core: switch firmware_class to uevent_suppress. to my gregkh-2.6 tree. Its filename is driver-core-switch-firmware_class-to-uevent_suppress.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Thu Mar 29 02:10:23 2007 From: Cornelia Huck <[EMAIL PROTECTED]> Date: Thu, 29 Mar 2007 11:12:14 +0200 Subject: Driver core: switch firmware_class to uevent_suppress. To: linux-kernel <[EMAIL PROTECTED]> Cc: Andrew Morton <[EMAIL PROTECTED]>, Greg K-H <[EMAIL PROTECTED]>, Manuel Estrada Sainz <[EMAIL PROTECTED]>, Eric Rannaud <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> From: Cornelia Huck <[EMAIL PROTECTED]> Use uevent_suppress instead of returning an error code in firmware_uevent(). Get rid of the now unneeded FW_STATUS_READY and FW_STATUS_READY_NOHOTPLUG. Signed-off-by: Cornelia Huck <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/firmware_class.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -31,8 +31,6 @@ enum { FW_STATUS_LOADING, FW_STATUS_DONE, FW_STATUS_ABORT, - FW_STATUS_READY, - FW_STATUS_READY_NOHOTPLUG, }; static int loading_timeout = 60; /* In seconds */ @@ -96,9 +94,6 @@ static int firmware_uevent(struct device struct firmware_priv *fw_priv = dev_get_drvdata(dev); int i = 0, len = 0; - if (!test_bit(FW_STATUS_READY, &fw_priv->status)) - return -ENODEV; - if (add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len, "FIRMWARE=%s", fw_priv->fw_id)) return -ENOMEM; @@ -333,6 +328,7 @@ static int fw_register_device(struct dev f_dev->parent = device; f_dev->class = &firmware_class; dev_set_drvdata(f_dev, fw_priv); + f_dev->uevent_suppress = 1; retval = device_register(f_dev); if (retval) { printk(KERN_ERR "%s: device_register failed\n", @@ -382,9 +378,7 @@ static int fw_setup_device(struct firmwa } if (uevent) -set_bit(FW_STATUS_READY, &fw_priv->status); -else -set_bit(FW_STATUS_READY_NOHOTPLUG, &fw_priv->status); + f_dev->uevent_suppress = 0; *dev_p = f_dev; goto out; Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pci-add-debug-information-to-resource-collision-message.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: add debug information to resource collision message to my gregkh-2.6 tree. Its filename is pci-add-debug-information-to-resource-collision-message.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Tue Apr 10 07:26:01 2007 From: Chuck Ebbert <[EMAIL PROTECTED]> Date: Tue, 10 Apr 2007 10:25:44 -0400 Subject: PCI: add debug information to resource collision message To: Greg KH <[EMAIL PROTECTED]> Cc: linux-kernel <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> Add more information to PCI resource collision message to help with debugging. Signed-off-by: Chuck Ebbert <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- arch/i386/pci/i386.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/i386/pci/i386.c +++ b/arch/i386/pci/i386.c @@ -246,8 +246,8 @@ int pcibios_enable_resources(struct pci_ continue; if (!r->start && r->end) { printk(KERN_ERR "PCI: Device %s not available " - "because of resource collisions\n", - pci_name(dev)); + "because of resource %d collisions\n", + pci_name(dev), idx); return -EINVAL; } if (r->flags & IORESOURCE_IO) Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are pci/pci-add-debug-information-to-resource-collision-message.patch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch msi-safer-state-caching.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: msi: Safer state caching. to my gregkh-2.6 tree. Its filename is msi-safer-state-caching.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Thu Mar 8 12:05:21 2007 From: Eric W. Biederman <[EMAIL PROTECTED]> Date: Thu, 08 Mar 2007 13:04:57 -0700 Subject: msi: Safer state caching. To: Andrew Morton <[EMAIL PROTECTED]>, Linus Torvalds <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]>, "Kok, Auke" <[EMAIL PROTECTED]>, Ingo Molnar <[EMAIL PROTECTED]>, "Michael S. Tsirkin" <[EMAIL PROTECTED]>, Pavel Machek <[EMAIL PROTECTED]>, Jens Axboe <[EMAIL PROTECTED]>, Adrian Bunk <[EMAIL PROTECTED]>, Linux Kernel Mailing List , Thomas Gleixner <[EMAIL PROTECTED]>, [EMAIL PROTECTED], Michal Piotrowski <[EMAIL PROTECTED]>, Greg Kroah-Hartman <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> From: Eric W. Biederman <[EMAIL PROTECTED]> There are two ways pci_save_state and pci_restore_state are used. As helper functions during suspend/resume, and as helper functions around a hardware reset event. When used as helper functions around a hardware reset event there is no reason to believe the calls will be paired, nor is there a good reason to believe that if we restore the msi state from before the reset that it will match the current msi state. Since arch code may change the msi message without going through the driver, drivers currently do not have enough information to even know when to call pci_save_state to ensure they will have msi state in sync with the other kernel irq reception data structures. It turns out the solution is straight forward, cache the state in the existing msi data structures (not the magic pci saved things) and have the msi code update the cached state each time we write to the hardware. This means we never need to read the hardware to figure out what the hardware state should be. By modifying the caching in this manner we get to remove our save_state routines and only need to provide restore_state routines. The only fields that were at all tricky to regenerate were the msi and msi-x control registers and the way we regenerate them currently is a bit dependent upon assumptions on how we use the allow msi registers to be configured and used making the code a little bit brittle. If we ever change what cases we allow or how we configure the msi bits we can address the fragility then. Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/msi.c| 150 +++ drivers/pci/pci.c|2 drivers/pci/pci.h|2 include/linux/msi.h |8 -- include/linux/pci_regs.h |1 5 files changed, 29 insertions(+), 134 deletions(-) --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -100,6 +100,7 @@ static void msi_set_mask_bit(unsigned in BUG(); break; } + entry->msi_attrib.masked = !!flag; } void read_msi_msg(unsigned int irq, struct msi_msg *msg) @@ -179,6 +180,7 @@ void write_msi_msg(unsigned int irq, str default: BUG(); } + entry->msg = *msg; } void mask_msi_irq(unsigned int irq) @@ -225,164 +227,60 @@ static struct msi_desc* alloc_msi_entry( } #ifdef CONFIG_PM -static int __pci_save_msi_state(struct pci_dev *dev) -{ - int pos, i = 0; - u16 control; - struct pci_cap_saved_state *save_state; - u32 *cap; - - if (!dev->msi_enabled) - return 0; - - pos = pci_find_capability(dev, PCI_CAP_ID_MSI); - if (pos <= 0) - return 0; - - save_state = kzalloc(sizeof(struct pci_cap_saved_state) + sizeof(u32) * 5, - GFP_KERNEL); - if (!save_state) { - printk(KERN_ERR "Out of memory in pci_save_msi_state\n"); - return -ENOMEM; - } - cap = &save_state->data[0]; - - pci_read_config_dword(dev, pos, &cap[i++]); - control = cap[0] >> 16; - pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, &cap[i++]); - if (control & PCI_MSI_FLAGS_64BIT) { - pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, &cap[i++]); - pci_read_config_dword(dev, pos + PCI_MSI_DATA_64, &cap[i++]); - } else - pci_read_config_dword(dev, pos + PCI_MSI_DATA_32, &cap[i++]); - if (control & PCI_MSI_FLAGS_MASKBIT) - pci_read_config_dword(dev, pos + PCI_MSI_MASK_BIT, &cap[i++]); - save_state->cap_nr = PCI_CAP_ID_MSI; - pci_add_saved_cap(dev, save_state);
patch pci-repair-pci_save-restore_state-so-we-can-restore-one-save-many-times.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: pci: Repair pci_save/restore_state so we can restore one save many times. to my gregkh-2.6 tree. Its filename is pci-repair-pci_save-restore_state-so-we-can-restore-one-save-many-times.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Thu Mar 8 12:06:39 2007 From: Eric W. Biederman <[EMAIL PROTECTED]> Date: Thu, 08 Mar 2007 13:06:13 -0700 Subject: pci: Repair pci_save/restore_state so we can restore one save many times. To: Andrew Morton <[EMAIL PROTECTED]>, Linus Torvalds <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]>, "Kok, Auke" <[EMAIL PROTECTED]>, Ingo Molnar <[EMAIL PROTECTED]>, "Michael S. Tsirkin" <[EMAIL PROTECTED]>, Pavel Machek <[EMAIL PROTECTED]>, Jens Axboe <[EMAIL PROTECTED]>, Adrian Bunk <[EMAIL PROTECTED]>, Linux Kernel Mailing List , Thomas Gleixner <[EMAIL PROTECTED]>, [EMAIL PROTECTED], Michal Piotrowski <[EMAIL PROTECTED]>, Greg Kroah-Hartman <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> From: Eric W. Biederman <[EMAIL PROTECTED]> Because we do not reserve space for the pci-x and pci-e state in struct pci dev we need to dynamically allocate it. However because we need to support restore being called multiple times after a single save it is never safe to free the buffers we have allocated to hold the state. So this patch modifies the save routines to first check to see if we have already allocated a state buffer before allocating a new one. Then the restore routines are modified to not free the state after restoring it. Simple and it fixes some subtle error path handling bugs, that are hard to test for. Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/pci.c | 12 ++-- include/linux/pci.h |5 - 2 files changed, 6 insertions(+), 11 deletions(-) --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -551,7 +551,9 @@ static int pci_save_pcie_state(struct pc if (pos <= 0) return 0; - save_state = kzalloc(sizeof(*save_state) + sizeof(u16) * 4, GFP_KERNEL); + save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP); + if (!save_state) + save_state = kzalloc(sizeof(*save_state) + sizeof(u16) * 4, GFP_KERNEL); if (!save_state) { dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); return -ENOMEM; @@ -582,8 +584,6 @@ static void pci_restore_pcie_state(struc pci_write_config_word(dev, pos + PCI_EXP_LNKCTL, cap[i++]); pci_write_config_word(dev, pos + PCI_EXP_SLTCTL, cap[i++]); pci_write_config_word(dev, pos + PCI_EXP_RTCTL, cap[i++]); - pci_remove_saved_cap(save_state); - kfree(save_state); } @@ -597,7 +597,9 @@ static int pci_save_pcix_state(struct pc if (pos <= 0) return 0; - save_state = kzalloc(sizeof(*save_state) + sizeof(u16), GFP_KERNEL); + save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP); + if (!save_state) + save_state = kzalloc(sizeof(*save_state) + sizeof(u16), GFP_KERNEL); if (!save_state) { dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); return -ENOMEM; @@ -622,8 +624,6 @@ static void pci_restore_pcix_state(struc cap = (u16 *)&save_state->data[0]; pci_write_config_word(dev, pos + PCI_X_CMD, cap[i++]); - pci_remove_saved_cap(save_state); - kfree(save_state); } --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -222,11 +222,6 @@ static inline void pci_add_saved_cap(str hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); } -static inline void pci_remove_saved_cap(struct pci_cap_saved_state *cap) -{ - hlist_del(&cap->next); -} - /* * For PCI devices, the region numbers are assigned this way: * Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch platform-reorder-platform_device_del.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: platform: reorder platform_device_del to my gregkh-2.6 tree. Its filename is platform-reorder-platform_device_del.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Tue Feb 20 13:55:29 2007 From: Jean Delvare <[EMAIL PROTECTED]> Date: Tue, 20 Feb 2007 22:55:06 +0100 Subject: platform: reorder platform_device_del To: "Dmitry Torokhov" <[EMAIL PROTECTED]> Cc: "Greg Kroah-Hartman" <[EMAIL PROTECTED]>, LKML Message-ID: <[EMAIL PROTECTED]> In platform_device_del(), we currently delete the device resources first, then we delete the device itself. This causes a (minor) bug to occur when one unregisters a platform device before unregistering its platform driver, and the driver is requesting (in .probe()) and releasing (in .remove()) a resource of the device. The device resources are already gone by the time the driver gets the chance to release the resources it had been requesting, causing an error like: Trying to free nonexistent resource <0295-0296> If the platform driver is unregistered first, the problem doesn't occur, as the driver will have the opportunity to release the resources it had requested before the device resources themselves are released. It's a bit odd that unregistering the driver first or the device first doesn't lead to the same result. So I believe that we should delete the device first in platform_device_del(). I've searched the git history and found that it used to be the case before 2.6.8, but was changed here: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git;a=commitdiff;h=96ef7b3689936ee1e64b711511342026a8ce459c > 2004/07/14 16:09:44-07:00 dtor_core > [PATCH] Driver core: Fix OOPS in device_platform_unregister > > Driver core: platform_device_unregister should release resources first > and only then call device_unregister, otherwise if there > are no more references to the device it will be freed and > the fucntion will try to access freed memory. However we now have an explicit call to put_device() at the end of platform_device_unregister() so I guess the original problem no longer exists and it is safe to revert that change. Signed-off-by: Jean Delvare <[EMAIL PROTECTED]> Cc: Dmitry Torokhov <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/base/platform.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) --- gregkh-2.6.orig/drivers/base/platform.c +++ gregkh-2.6/drivers/base/platform.c @@ -292,20 +292,22 @@ EXPORT_SYMBOL_GPL(platform_device_add); * @pdev: platform device we're removing * * Note that this function will also release all memory- and port-based - * resources owned by the device (@dev->resource). + * resources owned by the device (@dev->resource). This function + * must _only_ be externally called in error cases. All other usage + * is a bug. */ void platform_device_del(struct platform_device *pdev) { int i; if (pdev) { + device_del(&pdev->dev); + for (i = 0; i < pdev->num_resources; i++) { struct resource *r = &pdev->resource[i]; if (r->flags & (IORESOURCE_MEM|IORESOURCE_IO)) release_resource(r); } - - device_del(&pdev->dev); } } EXPORT_SYMBOL_GPL(platform_device_del); Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pci-fix-section-mismatch-warning.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: pci: fix section mismatch warning to my gregkh-2.6 tree. Its filename is pci-fix-section-mismatch-warning.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Fri Mar 2 15:06:44 2007 From: Sam Ravnborg <[EMAIL PROTECTED]> Date: Fri, 2 Mar 2007 23:59:04 +0100 Subject: pci: fix section mismatch warning To: Greg KH <[EMAIL PROTECTED]> Cc: LKML Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline drivers/pci/search.c caused following section mismatch warning (if compiled with CONFIG_HOTPLUG=n): WARNING: drivers/pci/built-in.o - Section mismatch: reference to .init.text: from .text.pci_find_bus after 'pci_find_bus' (at offset 0x24) This was due to pci_find_bus() calling a function marked __devinit. Fix was to remove the __devinit from the offending function. Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/search.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- gregkh-2.6.orig/drivers/pci/search.c +++ gregkh-2.6/drivers/pci/search.c @@ -15,7 +15,7 @@ DECLARE_RWSEM(pci_bus_sem); -static struct pci_bus * __devinit +static struct pci_bus * pci_do_find_bus(struct pci_bus* bus, unsigned char busnr) { struct pci_bus* child; Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
patch pci-rework-documentation-pci.txt.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: rework Documentation/pci.txt to my gregkh-2.6 tree. Its filename is pci-rework-documentation-pci.txt.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Fri Jan 5 22:50:51 2007 From: Grant Grundler <[EMAIL PROTECTED]> Date: Mon, 25 Dec 2006 01:06:35 -0700 Subject: PCI: rework Documentation/pci.txt To: Andrew Morton <[EMAIL PROTECTED]> Cc: Greg KH <[EMAIL PROTECTED]>, Hidetoshi Seto <[EMAIL PROTECTED]>, Linux Kernel list , [EMAIL PROTECTED], Kenji Kaneshige <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Content-Disposition: inline Rewrite Documentation/pci.txt: o restructure document to match how API is used when writing init code. o update to reflect changes in struct pci_driver function pointers. o removed language on "new style vs old style" device discovery. "Old style" is now deprecated. Don't use it. Left description in to document existing driver behaviors. o add section "Legacy I/O Port free driver" by Kenji Kaneshige http://lkml.org/lkml/2006/11/22/25 (renamed to "pci_enable_device_bars() and Legacy I/O Port space") o add "MMIO space and write posting" section to help avoid common pitfall when converting drivers from IO Port space to MMIO space. Orignally posted http://lkml.org/lkml/2006/2/27/24 o many typo/grammer/spelling corrections from Randy Dunlap o two more spelling corrections from Stephan Richter o fix CodingStyle as per Randy Dunlap Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- Documentation/pci.txt | 714 ++---- 1 file changed, 555 insertions(+), 159 deletions(-) --- gregkh-2.6.orig/Documentation/pci.txt +++ gregkh-2.6/Documentation/pci.txt @@ -1,142 +1,231 @@ -How To Write Linux PCI Drivers - by Martin Mares <[EMAIL PROTECTED]> on 07-Feb-2000 + How To Write Linux PCI Drivers + + by Martin Mares <[EMAIL PROTECTED]> on 07-Feb-2000 + updated by Grant Grundler <[EMAIL PROTECTED]> on 23-Dec-2006 -The world of PCI is vast and it's full of (mostly unpleasant) surprises. -Different PCI devices have different requirements and different bugs -- -because of this, the PCI support layer in Linux kernel is not as trivial -as one would wish. This short pamphlet tries to help all potential driver -authors find their way through the deep forests of PCI handling. +The world of PCI is vast and full of (mostly unpleasant) surprises. +Since each CPU architecture implements different chip-sets and PCI devices +have different requirements (erm, "features"), the result is the PCI support +in the Linux kernel is not as trivial as one would wish. This short paper +tries to introduce all potential driver authors to Linux APIs for +PCI device drivers. + +A more complete resource is the third edition of "Linux Device Drivers" +by Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman. +LDD3 is available for free (under Creative Commons License) from: + + http://lwn.net/Kernel/LDD3/ + +However, keep in mind that all documents are subject to "bit rot". +Refer to the source code if things are not working as described here. + +Please send questions/comments/patches about Linux PCI API to the +"Linux PCI" <[EMAIL PROTECTED]> mailing list. + 0. Structure of PCI drivers ~~~ -There exist two kinds of PCI drivers: new-style ones (which leave most of -probing for devices to the PCI layer and support online insertion and removal -of devices [thus supporting PCI, hot-pluggable PCI and CardBus in a single -driver]) and old-style ones which just do all the probing themselves. Unless -you have a very good reason to do so, please don't use the old way of probing -in any new code. After the driver finds the devices it wishes to operate -on (either the old or the new way), it needs to perform the following steps: +PCI drivers "discover" PCI devices in a system via pci_register_driver(). +Actually, it's the other way around. When the PCI generic code discovers +a new device, the driver with a matching "description" will be notified. +Details on this below. + +pci_register_driver() leaves most of the probing for devices to +the PCI layer and supports online insertion/removal of devices [thus +supporting hot-pluggable PCI, CardBus, and Express-Card in a single driver]. +pci_register_driver() call requires passing in a table of function +pointers and thus dictates the high level structure of a driver. + +Once th
patch pci-increment-pos-before-looking-for-the-next-cap-in-__pci_find_next_ht_cap.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: PCI: increment pos before looking for the next cap in __pci_find_next_ht_cap to my gregkh-2.6 tree. Its filename is pci-increment-pos-before-looking-for-the-next-cap-in-__pci_find_next_ht_cap.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From [EMAIL PROTECTED] Fri Jan 5 15:01:21 2007 From: Brice Goglin <[EMAIL PROTECTED]> Date: Fri, 05 Jan 2007 23:52:14 +0100 Subject: PCI: increment pos before looking for the next cap in __pci_find_next_ht_cap To: Greg KH <[EMAIL PROTECTED]>, Michael Ellerman <[EMAIL PROTECTED]> Cc: LKML Message-ID: <[EMAIL PROTECTED]> While testing 2.6.20-rc3 on a machine with some CK804 chipsets, we noticed that quirk_nvidia_ck804_msi_ht_cap() was not detecting HT MSI capabilities anymore. It is actually caused by the MSI mapping on the root chipset being the 2nd HT capability in the chain. pci_find_ht_capability() does not seem to find anything but the first HT cap correctly, because it forgets to increment the position before looking for the next cap. The following patch seems to fix it. At least, this prooves that having a ttl is good idea since the machine would have been stucked in an infinite loop if we didn't have a ttl :) Signed-off-by: Brice Goglin <[EMAIL PROTECTED]> Signed-off-by: Andrew J. Gallatin <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/pci/pci.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- gregkh-2.6.orig/drivers/pci/pci.c +++ gregkh-2.6/drivers/pci/pci.c @@ -254,7 +254,8 @@ static int __pci_find_next_ht_cap(struct if ((cap & mask) == ht_cap) return pos; - pos = __pci_find_next_cap_ttl(dev->bus, dev->devfn, pos, + pos = __pci_find_next_cap_ttl(dev->bus, dev->devfn, + pos + PCI_CAP_LIST_NEXT, PCI_CAP_ID_HT, &ttl); } Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 16/16] hold bus_mutex in netlink and search
On Wed, Jan 15, 2014 at 03:10:57PM -0600, David Fries wrote: > That's 1 through 14, and 16. Patch 15 was in my tree from another developer, > "drivers/w1/masters/w1-gpio.c: add strong pullup emulation" > and wasn't included in what I submitted. Should I repost the series > in sequence? Please resend what hasn't been taken. It will have to wait for after 3.14-rc1 as my trees are closed at the moment until that comes out. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "ftrace: Move ftrace_filter_lseek out of CONFIG_DYNAMIC_FTRACE section" has been added to the 3.4-stable tree
This is a note to let you know that I've just added the patch titled ftrace: Move ftrace_filter_lseek out of CONFIG_DYNAMIC_FTRACE section to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ftrace-move-ftrace_filter_lseek-out-of-config_dynamic_ftrace-section.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From lize...@huawei.com Mon Jun 10 14:15:51 2013 From: Li Zefan Date: Fri, 7 Jun 2013 17:02:08 +0800 Subject: ftrace: Move ftrace_filter_lseek out of CONFIG_DYNAMIC_FTRACE section To: Greg Kroah-Hartman Cc: Namhyung Kim , Steven Rostedt , Frederic Weisbecker , Ingo Molnar , LKML , stable Message-ID: <51b1a190.4060...@huawei.com> From: Steven Rostedt commit 7f49ef69db6bbf756c0abca7e9b65b32e999eec8 upstream. As ftrace_filter_lseek is now used with ftrace_pid_fops, it needs to be moved out of the #ifdef CONFIG_DYNAMIC_FTRACE section as the ftrace_pid_fops is defined when DYNAMIC_FTRACE is not. Signed-off-by: Steven Rostedt Cc: Namhyung Kim [ lizf: adjust context ] Signed-off-by: Li Zefan Signed-off-by: Greg Kroah-Hartman --- include/linux/ftrace.h |3 ++- kernel/trace/ftrace.c | 28 ++-- 2 files changed, 16 insertions(+), 15 deletions(-) --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -299,7 +299,6 @@ ssize_t ftrace_filter_write(struct file size_t cnt, loff_t *ppos); ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, size_t cnt, loff_t *ppos); -loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int origin); int ftrace_regex_release(struct inode *inode, struct file *file); void __init @@ -420,6 +419,8 @@ static inline int ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } #endif /* CONFIG_DYNAMIC_FTRACE */ +loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int whence); + /* totally disable ftrace - can not re-enable after this */ void ftrace_kill(void); --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -999,6 +999,19 @@ static __init void ftrace_profile_debugf static struct pid * const ftrace_swapper_pid = &init_struct_pid; +loff_t +ftrace_filter_lseek(struct file *file, loff_t offset, int whence) +{ + loff_t ret; + + if (file->f_mode & FMODE_READ) + ret = seq_lseek(file, offset, whence); + else + file->f_pos = ret = 1; + + return ret; +} + #ifdef CONFIG_DYNAMIC_FTRACE #ifndef CONFIG_FTRACE_MCOUNT_RECORD @@ -2541,7 +2554,7 @@ static void ftrace_filter_reset(struct f * routine, you can use ftrace_filter_write() for the write * routine if @flag has FTRACE_ITER_FILTER set, or * ftrace_notrace_write() if @flag has FTRACE_ITER_NOTRACE set. - * ftrace_regex_lseek() should be used as the lseek routine, and + * ftrace_filter_lseek() should be used as the lseek routine, and * release must call ftrace_regex_release(). */ int @@ -2625,19 +2638,6 @@ ftrace_notrace_open(struct inode *inode, inode, file); } -loff_t -ftrace_filter_lseek(struct file *file, loff_t offset, int origin) -{ - loff_t ret; - - if (file->f_mode & FMODE_READ) - ret = seq_lseek(file, offset, origin); - else - file->f_pos = ret = 1; - - return ret; -} - static int ftrace_match(char *str, char *regex, int len, int type) { int matched = 0; Patches currently in stable-queue which might be from lize...@huawei.com are queue-3.4/tracing-fix-possible-null-pointer-dereferences.patch queue-3.4/ftrace-move-ftrace_filter_lseek-out-of-config_dynamic_ftrace-section.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "tracing: Fix possible NULL pointer dereferences" has been added to the 3.4-stable tree
This is a note to let you know that I've just added the patch titled tracing: Fix possible NULL pointer dereferences to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: tracing-fix-possible-null-pointer-dereferences.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From lize...@huawei.com Mon Jun 10 14:15:28 2013 From: Namhyung Kim Date: Fri, 7 Jun 2013 17:01:16 +0800 Subject: tracing: Fix possible NULL pointer dereferences To: Greg Kroah-Hartman Cc: Namhyung Kim , Steven Rostedt , Frederic Weisbecker , Ingo Molnar , LKML , stable Message-ID: <51b1a15c.5040...@huawei.com> From: Namhyung Kim commit 6a76f8c0ab19f215af2a3442870eeb5f0e81998d upstream. Currently set_ftrace_pid and set_graph_function files use seq_lseek for their fops. However seq_open() is called only for FMODE_READ in the fops->open() so that if an user tries to seek one of those file when she open it for writing, it sees NULL seq_file and then panic. It can be easily reproduced with following command: $ cd /sys/kernel/debug/tracing $ echo 1234 | sudo tee -a set_ftrace_pid In this example, GNU coreutils' tee opens the file with fopen(, "a") and then the fopen() internally calls lseek(). Link: http://lkml.kernel.org/r/1365663302-2170-1-git-send-email-namhy...@kernel.org Signed-off-by: Namhyung Kim Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Namhyung Kim Signed-off-by: Steven Rostedt [ lizf: adjust context ] Signed-off-by: Li Zefan Signed-off-by: Greg Kroah-Hartman --- include/linux/ftrace.h |2 +- kernel/trace/ftrace.c | 10 +- kernel/trace/trace_stack.c |2 +- 3 files changed, 7 insertions(+), 7 deletions(-) --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -299,7 +299,7 @@ ssize_t ftrace_filter_write(struct file size_t cnt, loff_t *ppos); ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, size_t cnt, loff_t *ppos); -loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin); +loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int origin); int ftrace_regex_release(struct inode *inode, struct file *file); void __init --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -2626,7 +2626,7 @@ ftrace_notrace_open(struct inode *inode, } loff_t -ftrace_regex_lseek(struct file *file, loff_t offset, int origin) +ftrace_filter_lseek(struct file *file, loff_t offset, int origin) { loff_t ret; @@ -3445,7 +3445,7 @@ static const struct file_operations ftra .open = ftrace_filter_open, .read = seq_read, .write = ftrace_filter_write, - .llseek = ftrace_regex_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_regex_release, }; @@ -3453,7 +3453,7 @@ static const struct file_operations ftra .open = ftrace_notrace_open, .read = seq_read, .write = ftrace_notrace_write, - .llseek = ftrace_regex_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_regex_release, }; @@ -3659,8 +3659,8 @@ static const struct file_operations ftra .open = ftrace_graph_open, .read = seq_read, .write = ftrace_graph_write, + .llseek = ftrace_filter_lseek, .release= ftrace_graph_release, - .llseek = seq_lseek, }; #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ @@ -4261,7 +4261,7 @@ static const struct file_operations ftra .open = ftrace_pid_open, .write = ftrace_pid_write, .read = seq_read, - .llseek = seq_lseek, + .llseek = ftrace_filter_lseek, .release= ftrace_pid_release, }; --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c @@ -384,7 +384,7 @@ static const struct file_operations stac .open = stack_trace_filter_open, .read = seq_read, .write = ftrace_filter_write, - .llseek = ftrace_regex_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_regex_release, }; Patches currently in stable-queue which might be from namhyung@lge.com are queue-3.4/tracing-fix-possible-null-pointer-dereferences.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "ftrace: Move ftrace_filter_lseek out of CONFIG_DYNAMIC_FTRACE section" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled ftrace: Move ftrace_filter_lseek out of CONFIG_DYNAMIC_FTRACE section to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ftrace-move-ftrace_filter_lseek-out-of-config_dynamic_ftrace-section.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From lize...@huawei.com Mon Jun 10 14:16:48 2013 From: Li Zefan Date: Fri, 7 Jun 2013 17:01:04 +0800 Subject: ftrace: Move ftrace_filter_lseek out of CONFIG_DYNAMIC_FTRACE section To: Greg Kroah-Hartman Cc: Namhyung Kim , Frederic Weisbecker , Steven Rostedt , Ingo Molnar , LKML , stable Message-ID: <51b1a150.6030...@huawei.com> From: Steven Rostedt commit 7f49ef69db6bbf756c0abca7e9b65b32e999eec8 upstream. As ftrace_filter_lseek is now used with ftrace_pid_fops, it needs to be moved out of the #ifdef CONFIG_DYNAMIC_FTRACE section as the ftrace_pid_fops is defined when DYNAMIC_FTRACE is not. Signed-off-by: Steven Rostedt Cc: Namhyung Kim [ lizf: adjust context ] Signed-off-by: Li Zefan Signed-off-by: Greg Kroah-Hartman --- kernel/trace/ftrace.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -933,6 +933,19 @@ static __init void ftrace_profile_debugf static struct pid * const ftrace_swapper_pid = &init_struct_pid; +static loff_t +ftrace_filter_lseek(struct file *file, loff_t offset, int whence) +{ + loff_t ret; + + if (file->f_mode & FMODE_READ) + ret = seq_lseek(file, offset, whence); + else + file->f_pos = ret = 1; + + return ret; +} + #ifdef CONFIG_DYNAMIC_FTRACE #ifndef CONFIG_FTRACE_MCOUNT_RECORD @@ -2299,19 +2312,6 @@ ftrace_notrace_open(struct inode *inode, inode, file); } -static loff_t -ftrace_filter_lseek(struct file *file, loff_t offset, int origin) -{ - loff_t ret; - - if (file->f_mode & FMODE_READ) - ret = seq_lseek(file, offset, origin); - else - file->f_pos = ret = 1; - - return ret; -} - static int ftrace_match(char *str, char *regex, int len, int type) { int matched = 0; Patches currently in stable-queue which might be from lize...@huawei.com are queue-3.0/tracing-fix-possible-null-pointer-dereferences.patch queue-3.0/ftrace-move-ftrace_filter_lseek-out-of-config_dynamic_ftrace-section.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "tracing: Fix possible NULL pointer dereferences" has been added to the 3.0-stable tree
This is a note to let you know that I've just added the patch titled tracing: Fix possible NULL pointer dereferences to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: tracing-fix-possible-null-pointer-dereferences.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From lize...@huawei.com Mon Jun 10 14:16:36 2013 From: Li Zefan Date: Fri, 7 Jun 2013 17:00:33 +0800 Subject: tracing: Fix possible NULL pointer dereferences To: Greg Kroah-Hartman Cc: Namhyung Kim , Frederic Weisbecker , Steven Rostedt , Ingo Molnar , LKML , stable Message-ID: <51b1a131.9090...@huawei.com> From: Namhyung Kim commit 6a76f8c0ab19f215af2a3442870eeb5f0e81998d upstream. Currently set_ftrace_pid and set_graph_function files use seq_lseek for their fops. However seq_open() is called only for FMODE_READ in the fops->open() so that if an user tries to seek one of those file when she open it for writing, it sees NULL seq_file and then panic. It can be easily reproduced with following command: $ cd /sys/kernel/debug/tracing $ echo 1234 | sudo tee -a set_ftrace_pid In this example, GNU coreutils' tee opens the file with fopen(, "a") and then the fopen() internally calls lseek(). Link: http://lkml.kernel.org/r/1365663302-2170-1-git-send-email-namhy...@kernel.org Signed-off-by: Namhyung Kim Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Namhyung Kim Signed-off-by: Steven Rostedt [ lizf: adjust context ] Signed-off-by: Li Zefan Signed-off-by: Greg Kroah-Hartman --- kernel/trace/ftrace.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -2300,7 +2300,7 @@ ftrace_notrace_open(struct inode *inode, } static loff_t -ftrace_regex_lseek(struct file *file, loff_t offset, int origin) +ftrace_filter_lseek(struct file *file, loff_t offset, int origin) { loff_t ret; @@ -3118,7 +3118,7 @@ static const struct file_operations ftra .open = ftrace_filter_open, .read = seq_read, .write = ftrace_filter_write, - .llseek = ftrace_regex_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_regex_release, }; @@ -3126,7 +3126,7 @@ static const struct file_operations ftra .open = ftrace_notrace_open, .read = seq_read, .write = ftrace_notrace_write, - .llseek = ftrace_regex_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_regex_release, }; @@ -3335,8 +3335,8 @@ static const struct file_operations ftra .open = ftrace_graph_open, .read = seq_read, .write = ftrace_graph_write, + .llseek = ftrace_filter_lseek, .release= ftrace_graph_release, - .llseek = seq_lseek, }; #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ @@ -3822,7 +3822,7 @@ static const struct file_operations ftra .open = ftrace_pid_open, .write = ftrace_pid_write, .read = seq_read, - .llseek = seq_lseek, + .llseek = ftrace_filter_lseek, .release= ftrace_pid_release, }; Patches currently in stable-queue which might be from lize...@huawei.com are queue-3.0/tracing-fix-possible-null-pointer-dereferences.patch queue-3.0/ftrace-move-ftrace_filter_lseek-out-of-config_dynamic_ftrace-section.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/1] w1: fix oops when w1_search is called from netlink connector
On Mon, Mar 04, 2013 at 12:54:52AM +0400, Evgeniy Polyakov wrote: > Hi > > Marcin, thanks a lot for the fix, I have to sorry I'm not on this bug yet :( > Sven confirmed patch fixes it, Greg please pull it into your tree. Ok, will do once 3.9-rc1 is out. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "ARC: gdbserver breakage in Big-Endian configuration #1" has been added to the 3.10-stable tree
This is a note to let you know that I've just added the patch titled ARC: gdbserver breakage in Big-Endian configuration #1 to the 3.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arc-gdbserver-breakage-in-big-endian-configuration-1.patch and it can be found in the queue-3.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From vineet.gup...@synopsys.com Thu Aug 22 15:32:58 2013 From: Vineet Gupta Date: Tue, 20 Aug 2013 13:38:10 +0530 Subject: ARC: gdbserver breakage in Big-Endian configuration #1 To: Cc: , , , , Vineet Gupta Message-ID: <1376986091-30241-2-git-send-email-vgu...@synopsys.com> From: Vineet Gupta [Based on mainline commit 502a0c775c7f0a: "ARC: pt_regs update #5"] gdbserver needs @stop_pc, served by ptrace, but fetched from pt_regs differently, based on in_brkpt_traps(), which in turn relies on additional machine state in pt_regs->event bitfield. unsigned long orig_r8:16, event:16; For big endian config, this macro was returning false, despite being in breakpoint Trap exception, causing wrong @stop_pc to be returned to gdb. Issue #1: In BE, @event above is at offset 2 in word, while a STW insn at offset 0 was used to update it. Resort to using ST insn which updates the half-word at right location. Issue #2: The union involving bitfields causes all the members to be laid out at offset 0. So with fix #1 above, ASM was now updating at offset 2, "C" code was still referencing at offset 0. Fixed by wrapping bitfield in a struct. Reported-by: Noam Camus Tested-by: Anton Kolesov Signed-off-by: Vineet Gupta Signed-off-by: Greg Kroah-Hartman --- arch/arc/include/asm/ptrace.h |2 ++ arch/arc/kernel/entry.S |4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) --- a/arch/arc/include/asm/ptrace.h +++ b/arch/arc/include/asm/ptrace.h @@ -52,12 +52,14 @@ struct pt_regs { /*to distinguish bet excp, syscall, irq */ union { + struct { #ifdef CONFIG_CPU_BIG_ENDIAN /* so that assembly code is same for LE/BE */ unsigned long orig_r8:16, event:16; #else unsigned long event:16, orig_r8:16; #endif + }; long orig_r8_word; }; }; --- a/arch/arc/kernel/entry.S +++ b/arch/arc/kernel/entry.S @@ -498,7 +498,7 @@ tracesys_exit: trap_with_param: ; stop_pc info by gdb needs this info - stw orig_r8_IS_BRKPT, [sp, PT_orig_r8] + st orig_r8_IS_BRKPT, [sp, PT_orig_r8] mov r0, r12 lr r1, [efa] @@ -723,7 +723,7 @@ not_exception: ; things to what they were, before returning from L2 context ; - ldw r9, [sp, PT_orig_r8] ; get orig_r8 to make sure it is + ld r9, [sp, PT_orig_r8] ; get orig_r8 to make sure it is brne r9, orig_r8_IS_IRQ2, 149f ; infact a L2 ISR ret path ld r9, [sp, PT_status32] ; get statu32_l2 (saved in pt_regs) Patches currently in stable-queue which might be from vineet.gup...@synopsys.com are queue-3.10/arc-gdbserver-breakage-in-big-endian-configuration-1.patch queue-3.10/arc-gdbserver-breakage-in-big-endian-configuration-2.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "ARC: gdbserver breakage in Big-Endian configuration #2" has been added to the 3.10-stable tree
This is a note to let you know that I've just added the patch titled ARC: gdbserver breakage in Big-Endian configuration #2 to the 3.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arc-gdbserver-breakage-in-big-endian-configuration-2.patch and it can be found in the queue-3.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From vineet.gup...@synopsys.com Thu Aug 22 15:33:34 2013 From: Vineet Gupta Date: Tue, 20 Aug 2013 13:38:11 +0530 Subject: ARC: gdbserver breakage in Big-Endian configuration #2 To: Cc: , , , , Vineet Gupta Message-ID: <1376986091-30241-3-git-send-email-vgu...@synopsys.com> From: Vineet Gupta [Based on mainline commit 352c1d95e3220d0: "ARC: stop using pt_regs->orig_r8"] Stop using orig_r8 as it could get clobbered by ST in trap_with_param, and further it is semantically not needed either. Signed-off-by: Vineet Gupta Signed-off-by: Greg Kroah-Hartman --- arch/arc/include/asm/syscall.h |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/arch/arc/include/asm/syscall.h +++ b/arch/arc/include/asm/syscall.h @@ -18,7 +18,7 @@ static inline long syscall_get_nr(struct task_struct *task, struct pt_regs *regs) { if (user_mode(regs) && in_syscall(regs)) - return regs->orig_r8; + return regs->r8; else return -1; } @@ -26,8 +26,7 @@ syscall_get_nr(struct task_struct *task, static inline void syscall_rollback(struct task_struct *task, struct pt_regs *regs) { - /* XXX: I can't fathom how pt_regs->r8 will be clobbered ? */ - regs->r8 = regs->orig_r8; + regs->r0 = regs->orig_r0; } static inline long Patches currently in stable-queue which might be from vineet.gup...@synopsys.com are queue-3.10/arc-gdbserver-breakage-in-big-endian-configuration-1.patch queue-3.10/arc-gdbserver-breakage-in-big-endian-configuration-2.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] w1: replace strict_strtol() with kstrtol()
On Tue, Jul 23, 2013 at 12:00:44AM +0400, Evgeniy Polyakov wrote: > Hi everyone > > 19.07.2013, 11:16, "Jingoo Han" : > > The usage of strict_strtol() is not preferred, because > > strict_strtol() is obsolete. Thus, kstrtol() should be > > used. > > Looks good to me, although I do not really see the difference > Greg, please pull into your tree or suggest appropriate. > > Acked-by: Evgeniy Polyakov Can someone resend this, I don't seem to be able to find it... thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Staging: comedi: check the return value of kobject_set_name
On Wed, Jul 09, 2014 at 08:24:06AM +0400, Anton Protopopov wrote: > 2014-06-09 14:01 GMT+04:00 Ian Abbott : > > On 2014-06-07 14:56, Anton Protopopov wrote: > >> > >> Added a check of the return value of the kobject_set_name function. > >> > >> Signed-off-by: Anton Protopopov > >> --- > >> drivers/staging/comedi/comedi_fops.c | 9 - > >> 1 file changed, 8 insertions(+), 1 deletion(-) > > > > > > Reviewed-by: Ian Abbott > > This patch was lost, I guess? I don't seem to have it anymore in my inbox, please resend. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Staging: comedi: check the return value of kobject_set_name
On Wed, Jul 09, 2014 at 08:48:53AM +0400, Anton Protopopov wrote: > > > 09.07.2014 08:28, gregkh пишет: > > On Wed, Jul 09, 2014 at 08:24:06AM +0400, Anton Protopopov wrote: > >> 2014-06-09 14:01 GMT+04:00 Ian Abbott : > >>> On 2014-06-07 14:56, Anton Protopopov wrote: > >>>> > >>>> Added a check of the return value of the kobject_set_name function. > >>>> > >>>> Signed-off-by: Anton Protopopov > >>>> --- > >>>> drivers/staging/comedi/comedi_fops.c | 9 - > >>>> 1 file changed, 8 insertions(+), 1 deletion(-) > >>> > >>> > >>> Reviewed-by: Ian Abbott > >> > >> This patch was lost, I guess? > > > > I don't seem to have it anymore in my inbox, please resend. > > > > greg k-h > > > > > Added a check of the return value of the kobject_set_name function. > > Signed-off-by: Anton Protopopov > --- > drivers/staging/comedi/comedi_fops.c | 9 - > 1 file changed, 8 insertions(+), 1 deletion(-) Please send in a format I can apply in (i.e. I don't have to edit the changelog by hand...) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Open-ended task In kernel
On Tue, Jul 29, 2014 at 12:46:46PM +0530, sanjeev sharma wrote: > Hello All, > > I have started recently in contributing into Linux kernel and submitted > patches > in staging directory and now I want to do outside staging directory specially > in main kernel and driver part.Do we have anything in Linux kernel i.e some > specific areas which I can looked upon.I think we should have some list of > open-point where people can contribute. > > If anyone has some information,please share on mailing list so that I can > focus > myself in correct direction. Yes, I know lots of "open ended" tasks in the kernel. But just because I, or someone else, writes them down doesn't mean that you will want to do them, or be sucessful at them. My suggestion always is, "Find something that bothers you, fix it, and go from there." And if you can't find a problem with the kernel on your machine, then you really aren't looking hard enough. Best of luck, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: revised driver: w1_ds2406
On Thu, Jun 19, 2014 at 09:29:26PM +0400, Evgeniy Polyakov wrote: > Hi Scott > > I've added Greg to copy. > > 18.06.2014, 00:42, "Scott Alfter" : > > Some preliminary work at making use of this driver led me to implement > > CRC-16 checks on read and write to deal with the occasional glitchiness of > > the 1-Wire bus. The revised driver (attached) returns an I/O error if the > > CRC check fails. When reading the chip's state, either you get a valid > > indication or you get an I/O error. When changing its state, either the > > change is successful or an I/O error is returned. > > > > This patch supersedes the patch I had previously submitted. > > > > Signed-off-by: Scott Alfter > > Greg, this patch looks good, please pull it into your tree. > If you already applied previous ds2406, let us know. I didn't, I'll take this one instead, thanks. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] drivers/w1/w1_int.c: Fix style errors.
On Sat, May 31, 2014 at 04:25:21PM +0400, Evgeniy Polyakov wrote: > Hi Thomas > > 31.05.2014, 03:11, "Thomas Wood" : > > Replace spaces at beginning of the string with tabs, and replace foo * bar > > with foo *bar in a pointer declaration. > > > > Signed-off-by: Thomas Wood > > Looks good, thank you. > Greg, please pull it into your tree or suggest appropriate. > > Acked-by: Evgeniy Polyakov Thanks, I'll take this after 3.16-rc1 is out. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Qualcomm "All Rights Reserved" in Linux staging
On Sat, Jul 05, 2014 at 12:05:48AM +0200, Paul Bolle wrote: > On Fri, 2014-07-04 at 21:20 +, Mathieu Desnoyers wrote: > > grep -r "Qualcomm" . |grep -i "rights" > > ./drivers/staging/ft1000/ft1000-usb/ft1000_usb.c: * CopyRight (C) 2007 > > Qualcomm Inc. All Rights Reserved. > > ./drivers/staging/ft1000/ft1000-usb/ft1000_download.c:* CopyRight (C) 2007 > > Qualcomm Inc. All Rights Reserved. > > ./drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:/* CopyRight (C) 2007 > > Qualcomm Inc. All Rights Reserved. > > That's actually a common pattern: > $ git grep -i "Copyright.*All Rights Reserved" v3.16-rc3 | wc -l > 5203 Yeah, I used to be "worried" about that as well, turns out it means nothing :) It's the license of the code that is the issue, not the copyright line, which all lawyers tell me now shouldn't even be in a file, as it, again, means nothing. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/4] MAINTAINERS: Add an entry for USB/IP driver
On Wed, Aug 20, 2014 at 12:44:45PM +0530, sanjeev sharma wrote: > Hello Valentina, > > I have started looking into USB IP Project and this look's very interesting > and > Do we have anything left in this Project apart from reviewing user-land > protocol ? What do you mean by this? Does the code not work properly for you? confused, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "MIPS: Fix forgotten preempt_enable() when CPU has inclusive" has been added to the 3.10-stable tree
This is a note to let you know that I've just added the patch titled MIPS: Fix forgotten preempt_enable() when CPU has inclusive to the 3.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mips-fix-forgotten-preempt_enable-when-cpu-has-inclusive.patch and it can be found in the queue-3.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From 5596b0b245fb9d2cefb5023b11061050351c1398 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Wed, 2 Oct 2013 15:03:03 +0900 Subject: MIPS: Fix forgotten preempt_enable() when CPU has inclusive pcaches From: Yoichi Yuasa commit 5596b0b245fb9d2cefb5023b11061050351c1398 upstream. [1.904000] BUG: scheduling while atomic: swapper/1/0x0002 [1.908000] Modules linked in: [1.916000] CPU: 0 PID: 1 Comm: swapper Not tainted 3.12.0-rc2-lemote-los.git-5318619-dirty #1 [1.92] Stack : 31aac000 810d 0052 802730a4 0001 810cdf90 810d 8068b968 806f5537 810cdf90 98009f0782e8 0001 8072 806b 98009f078000 98009f29 805f312c 98009f05b5d8 80233518 98009f05b5e8 80274b7c 98009f078000 8068b968 98009f05b520 805f2f6c 8070 8070 806fc758 8070 8020be98 806fceb0 805f2f6c ... [2.028000] Call Trace: [2.032000] [] show_stack+0x80/0x98 [2.036000] [] __schedule_bug+0x44/0x6c [2.04] [] __schedule+0x518/0x5b0 [2.044000] [] schedule_timeout+0x128/0x1f0 [2.048000] [] msleep+0x3c/0x60 [2.052000] [] do_probe+0x238/0x3a8 [2.056000] [] ide_probe_port+0x340/0x7e8 [2.06] [] ide_host_register+0x2d0/0x7a8 [2.064000] [] ide_pci_init_two+0x4e4/0x790 [2.068000] [] amd74xx_probe+0x148/0x2c8 [2.072000] [] pci_device_probe+0xc4/0x130 [2.076000] [] driver_probe_device+0x98/0x270 [2.08] [] __driver_attach+0xe0/0xe8 [2.084000] [] bus_for_each_dev+0x78/0xe0 [2.088000] [] bus_add_driver+0x230/0x310 [2.092000] [] driver_register+0x84/0x158 [2.096000] [] do_one_initcall+0x104/0x160 Signed-off-by: Yoichi Yuasa Reported-by: Aaro Koskinen Tested-by: Aaro Koskinen Cc: linux-m...@linux-mips.org Cc: Linux Kernel Mailing List Patchwork: https://patchwork.linux-mips.org/patch/5941/ Signed-off-by: Ralf Baechle Cc: Alexandre Oliva Signed-off-by: Greg Kroah-Hartman --- arch/mips/mm/c-r4k.c |2 ++ 1 file changed, 2 insertions(+) --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c @@ -608,6 +608,7 @@ static void r4k_dma_cache_wback_inv(unsi r4k_blast_scache(); else blast_scache_range(addr, addr + size); + preempt_enable(); __sync(); return; } @@ -649,6 +650,7 @@ static void r4k_dma_cache_inv(unsigned l */ blast_inv_scache_range(addr, addr + size); } + preempt_enable(); __sync(); return; } Patches currently in stable-queue which might be from yu...@linux-mips.org are queue-3.10/mips-fix-forgotten-preempt_enable-when-cpu-has-inclusive.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "clk: at91: usb: fix determine_rate prototype" has been added to the 3.19-stable tree
This is a note to let you know that I've just added the patch titled clk: at91: usb: fix determine_rate prototype to the 3.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: clk-at91-usb-fix-determine_rate-prototype.patch and it can be found in the queue-3.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From boris.brezil...@free-electrons.com Fri May 8 13:05:22 2015 From: Boris Brezillon Date: Thu, 7 May 2015 11:56:44 +0200 To: Luis Henriques Subject: clk: at91: usb: fix determine_rate prototype Cc: Tyler Baker , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , torva...@linux-foundation.org, Andrew Morton , li...@roeck-us.net, shuah...@samsung.com, sta...@vger.kernel.org, Mike Turquette Message-ID: <20150507115644.1ef29d2e@bbrezillon> From: Boris Brezillon Commit c67881fc890916206e723329e774391c6ed354ce is a backport of 0b67c43ce36a9964f1d5e3f973ee19eefd3f9f8f upstream commit, fixing a bug on clk rate change propagation. But in 4.0 ->determine_rate() prototype has changed, thus introducing a prototype mismatch when applying it on 3.19. Signed-off-by: Boris Brezillon Signed-off-by: Greg Kroah-Hartman --- drivers/clk/at91/clk-usb.c |2 -- 1 file changed, 2 deletions(-) --- a/drivers/clk/at91/clk-usb.c +++ b/drivers/clk/at91/clk-usb.c @@ -58,8 +58,6 @@ static unsigned long at91sam9x5_clk_usb_ static long at91sam9x5_clk_usb_determine_rate(struct clk_hw *hw, unsigned long rate, - unsigned long min_rate, - unsigned long max_rate, unsigned long *best_parent_rate, struct clk_hw **best_parent_hw) { Patches currently in stable-queue which might be from boris.brezil...@free-electrons.com are queue-3.19/clk-at91-usb-fix-determine_rate-prototype.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Patch "arm: armv7: perf: fix armv7 ref-cycles error" has been added to the 3.16-stable tree
This is a note to let you know that I've just added the patch titled arm: armv7: perf: fix armv7 ref-cycles error to the 3.16-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arm-armv7-perf-fix-armv7-ref-cycles-error.patch and it can be found in the queue-3.16 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From zhangzhiqiang.zh...@huawei.com Fri Oct 3 13:04:46 2014 From: zhangzhiqiang Date: Fri, 26 Sep 2014 15:44:22 +0800 Subject: arm: armv7: perf: fix armv7 ref-cycles error To: , , , , Message-ID: <54251956.6010...@huawei.com> From: Zhiqiang Zhang ref-cycles event is specially to Intel core, but can still used in arm architecture with the wrong return value with 3.10 stable. this patch fix the bug and make it return NOT SUPPORTED distinctly. In upstream this bug has been fixed by other way, which changes more than one file and more than 1000 lines. the primary commit is 6b7658ec8a100b608e59e3cde353434db51f5be0. besides we can not simply cherry-pick. Signed-off-by: Zhiqiang Zhang Cc: Mark Rutland Cc: Christopher Covington Signed-off-by: Greg Kroah-Hartman --- arch/arm/kernel/perf_event_v7.c |5 + 1 file changed, 5 insertions(+) --- a/arch/arm/kernel/perf_event_v7.c +++ b/arch/arm/kernel/perf_event_v7.c @@ -157,6 +157,7 @@ static const unsigned armv7_a8_perf_map[ [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = ARMV7_A8_PERFCTR_STALL_ISIDE, [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = HW_OP_UNSUPPORTED, + [PERF_COUNT_HW_REF_CPU_CYCLES] = HW_OP_UNSUPPORTED, }; static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] @@ -281,6 +282,7 @@ static const unsigned armv7_a9_perf_map[ [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = ARMV7_A9_PERFCTR_STALL_ICACHE, [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = ARMV7_A9_PERFCTR_STALL_DISPATCH, + [PERF_COUNT_HW_REF_CPU_CYCLES] = HW_OP_UNSUPPORTED, }; static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] @@ -405,6 +407,7 @@ static const unsigned armv7_a5_perf_map[ [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = HW_OP_UNSUPPORTED, [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = HW_OP_UNSUPPORTED, + [PERF_COUNT_HW_REF_CPU_CYCLES] = HW_OP_UNSUPPORTED, }; static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] @@ -527,6 +530,7 @@ static const unsigned armv7_a15_perf_map [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_BUS_CYCLES, [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = HW_OP_UNSUPPORTED, [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = HW_OP_UNSUPPORTED, + [PERF_COUNT_HW_REF_CPU_CYCLES] = HW_OP_UNSUPPORTED, }; static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] @@ -651,6 +655,7 @@ static const unsigned armv7_a7_perf_map[ [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_BUS_CYCLES, [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = HW_OP_UNSUPPORTED, [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = HW_OP_UNSUPPORTED, + [PERF_COUNT_HW_REF_CPU_CYCLES] = HW_OP_UNSUPPORTED, }; static const unsigned armv7_a7_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] Patches currently in stable-queue which might be from zhangzhiqiang.zh...@huawei.com are queue-3.16/arm-armv7-perf-fix-armv7-ref-cycles-error.patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] staging:iio: moved platform_data into include/linux/iio
A: No. Q: Should I include quotations after my reply? http://daringfireball.net/2007/07/on_top On Wed, Aug 20, 2014 at 12:32:52PM +0530, sanjeev sharma wrote: > Hi, > > I have only moved some header files because other header files are already > present there and these are only pending files which is not moved outside the > staging directory. > > @Greg:What is your though on this ? Lars-Peter is correct, don't "leak" files from staging. Take the time to work on fixing up these drivers correctly so they can be moved out of staging instead of just doing simple file moves which do nothing. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/