diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-06 13:16:20 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-06 13:16:20 -0700 |
| commit | fa375c129442ef224c4fc20f2eb1563a9d1eb0fb (patch) | |
| tree | f548e2065e25e2556fa7fefbbf0e31b98d8b1294 | |
| parent | bf55670de5a5934374946e00e633bcd6c7cb2c17 (diff) | |
| download | patches-fa375c129442ef224c4fc20f2eb1563a9d1eb0fb.tar.gz | |
version sync
| -rw-r--r-- | driver-core/driver-core-remove-config_sysfs_deprecated.patch | 8 | ||||
| -rw-r--r-- | series | 32 | ||||
| -rw-r--r-- | tty/serial-mmio32-support-for-8250_early.c.patch | 2 | ||||
| -rw-r--r-- | tty/tty-implement-btm-as-mutex-instead-of-bkl.patch | 6 | ||||
| -rw-r--r-- | tty/tty-introduce-wait_event_interruptible_tty.patch | 2 | ||||
| -rw-r--r-- | tty/tty-make-vt-s-have-a-tty_port.patch | 4 | ||||
| -rw-r--r-- | tty/tty-move-the-vt_tty-field-from-the-vc_data-into-the-standard-tty_port.patch | 6 | ||||
| -rw-r--r-- | tty/tty-remove-tty_lock_nested.patch | 2 | ||||
| -rw-r--r-- | tty/tty-replace-bkl-with-a-new-tty_lock.patch | 2 | ||||
| -rw-r--r-- | tty/vc-locking-clean-up.patch | 6 | ||||
| -rw-r--r-- | tty/vt-clean-up-the-code-use-kernel-library.patch | 6 | ||||
| -rw-r--r-- | tty/vt-console-try-harder-to-print-output-when-panicing.patch | 16 | ||||
| -rw-r--r-- | usb/pci-change-device-runtime-pm-settings-for-probe-and-remove-do-not-send.patch | 160 |
13 files changed, 31 insertions, 221 deletions
diff --git a/driver-core/driver-core-remove-config_sysfs_deprecated.patch b/driver-core/driver-core-remove-config_sysfs_deprecated.patch index 91e8477cd2ca8a..5e13422d568400 100644 --- a/driver-core/driver-core-remove-config_sysfs_deprecated.patch +++ b/driver-core/driver-core-remove-config_sysfs_deprecated.patch @@ -318,7 +318,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> sysfs_remove_link(&dev->kobj, "subsystem"); } -@@ -1613,41 +1496,23 @@ int device_rename(struct device *dev, ch +@@ -1613,41 +1496,23 @@ int device_rename(struct device *dev, co pr_debug("device: '%s': %s: renaming to '%s'\n", dev_name(dev), __func__, new_name); @@ -404,7 +404,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> /** --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c -@@ -406,9 +406,7 @@ struct Scsi_Host *scsi_host_alloc(struct +@@ -411,9 +411,7 @@ struct Scsi_Host *scsi_host_alloc(struct device_initialize(&shost->shost_gendev); dev_set_name(&shost->shost_gendev, "host%d", shost->host_no); @@ -428,7 +428,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> starget->channel = channel; --- a/fs/partitions/check.c +++ b/fs/partitions/check.c -@@ -500,14 +500,14 @@ void register_disk(struct gendisk *disk) +@@ -499,14 +499,14 @@ void register_disk(struct gendisk *disk) if (device_add(ddev)) return; @@ -445,7 +445,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj); disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); -@@ -724,8 +724,6 @@ void del_gendisk(struct gendisk *disk) +@@ -723,8 +723,6 @@ void del_gendisk(struct gendisk *disk) kobject_put(disk->part0.holder_dir); kobject_put(disk->slave_dir); disk->driverfs_dev = NULL; @@ -28,38 +28,9 @@ gregkh/gkh-version.patch ############################################# # Driver core patches for after 2.6.35 is out ############################################# -driver-core/uio-remove-irqf_disabled-flag-from-uio_pdrv_genirq.c.patch -driver-core/uio-remove-irqf_disabled-from-uio_sercos3.c.patch -driver-core/uio-remove-irqf_disabled-flag-from-uio_cif.c.patch -driver-core/hotplug-support-kernel-hotplug-sysctl-variable-when-config_net.patch -driver-core/driver-core-internal-struct-dma_coherent_mem-change-type-of-a-member.patch -driver-core/driver-core-drop-__must_check-from-bus_for_each_drv.patch -driver-core/firmware-loader-use-statically-initialized-data-attribute.patch -driver-core/firmware-loader-embed-device-into-firmware_priv-structure.patch -driver-core/driver-core-use-kmemdup-in-platform_device_add_resources.patch -driver-core/driver-core-reduce-duplicated-code-for-platform_device-creation.patch -driver-core/driver-core-move-platform-device-creation-helpers-to-.init.text-if-module-n.patch -driver-core/firmware-update-hotplug-script-remove-sysfs-files.patch -driver-core/sysfs-sysfs_chmod_file-s-attr-can-be-const.patch -driver-core/dmi-id-fix-a-memory-leak-in-dmi_id_init-error-path.patch -driver-core/dcdbas-remove-a-redundant-smi_data_buf_free-in-dcdbas_exit.patch -driver-core/sysfs-fix-discrepancies-between-implementation-and-documentation.patch -driver-core/sysfs-fix-one-more-signature-discrepancy-between-sysfs-implementation-and-docs.patch -driver-core/debugfs-no-longer-needs-to-depend-on-sysfs.patch -driver-core/driver-core-fix-memory-leak-one-one-error-path-in-bus_register.patch -driver-core/driver-core-add-bus_notify_bind_driver.patch -driver-core/cgroupfs-create-sys-fs-cgroup-to-mount-cgroupfs-on.patch - -driver-core/scsi-remove-owner-field-from-attribute-initialization-in-lpfc-driver.patch -driver-core/scsi-remove-owner-field-from-attribute-initialization-in-arcmsr-driver.patch -driver-core/leds-remove-owner-field-from-attribute-initialization-in-bd2802-driver.patch -driver-core/regulator-remove-owner-field-from-attribute-initialization-in-regulator-core-driver.patch -driver-core/powerpc-pci-remove-owner-field-from-attribute-initialization-in-pci-bridge-init.patch -driver-core/sysfs-remove-owner-field-from-sysfs-struct-attribute.patch -driver-core/driver-core-device_rename-s-new_name-can-be-const.patch # can we really drop it? (nope, not yet...) -#driver-core/driver-core-remove-config_sysfs_deprecated.patch +driver-core/driver-core-remove-config_sysfs_deprecated.patch ##################################### # TTY patches for after 2.6.35 is out @@ -195,7 +166,6 @@ usb/usb-add-do_wakeup-parameter-for-pci-hcd-suspend.patch usb/usb-controller-resume-should-check-the-root-hub.patch usb/usb-fix-race-between-root-hub-wakeup-controller-suspend.patch usb/usb-uhci-add-support-for-intel-s-wakeup-flags.patch -usb/pci-change-device-runtime-pm-settings-for-probe-and-remove-do-not-send.patch usb/usb-add-runtime-pm-for-pci-based-host-controllers.patch usb/usb-usblp-fixed-switch-brace-whitespace-and-spacing-coding-style-issues.patch usb/usb-drivers-usb-makefile-conditionally-descend-to-early.patch diff --git a/tty/serial-mmio32-support-for-8250_early.c.patch b/tty/serial-mmio32-support-for-8250_early.c.patch index b7adeb909112da..818bf9f1a875db 100644 --- a/tty/serial-mmio32-support-for-8250_early.c.patch +++ b/tty/serial-mmio32-support-for-8250_early.c.patch @@ -27,7 +27,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -687,8 +687,11 @@ and is between 256 and 4096 characters. +@@ -688,8 +688,11 @@ and is between 256 and 4096 characters. earlycon= [KNL] Output early console device and options. uart[8250],io,<addr>[,options] uart[8250],mmio,<addr>[,options] diff --git a/tty/tty-implement-btm-as-mutex-instead-of-bkl.patch b/tty/tty-implement-btm-as-mutex-instead-of-bkl.patch index ea976092596d69..6185d77a518790 100644 --- a/tty/tty-implement-btm-as-mutex-instead-of-bkl.patch +++ b/tty/tty-implement-btm-as-mutex-instead-of-bkl.patch @@ -95,7 +95,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +EXPORT_SYMBOL(tty_unlock); --- a/include/linux/tty.h +++ b/include/linux/tty.h -@@ -575,7 +575,14 @@ extern int vt_ioctl(struct tty_struct *t +@@ -578,7 +578,14 @@ extern int vt_ioctl(struct tty_struct *t extern long vt_compat_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg); @@ -110,7 +110,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> static inline void tty_lock(void) __acquires(kernel_lock) { #ifdef CONFIG_LOCK_KERNEL -@@ -589,6 +596,7 @@ static inline void tty_unlock(void) __re +@@ -592,6 +599,7 @@ static inline void tty_unlock(void) __re unlock_kernel(); } #define tty_locked() (kernel_locked()) @@ -120,7 +120,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> * wait_event_interruptible_tty -- wait for a condition with the tty lock held --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug -@@ -427,6 +427,16 @@ config RT_MUTEX_TESTER +@@ -438,6 +438,16 @@ config RT_MUTEX_TESTER help This option enables a rt-mutex tester. diff --git a/tty/tty-introduce-wait_event_interruptible_tty.patch b/tty/tty-introduce-wait_event_interruptible_tty.patch index 589911f42bf028..45b86edc31debb 100644 --- a/tty/tty-introduce-wait_event_interruptible_tty.patch +++ b/tty/tty-introduce-wait_event_interruptible_tty.patch @@ -155,7 +155,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> return ((info->flags & ASYNC_HUP_NOTIFY) ? --- a/include/linux/tty.h +++ b/include/linux/tty.h -@@ -604,5 +604,47 @@ static inline void tty_unlock(void) __re +@@ -607,5 +607,47 @@ static inline void tty_unlock(void) __re } #define tty_locked() (kernel_locked()) diff --git a/tty/tty-make-vt-s-have-a-tty_port.patch b/tty/tty-make-vt-s-have-a-tty_port.patch index a2dfcc2caf8268..02c92b34479340 100644 --- a/tty/tty-make-vt-s-have-a-tty_port.patch +++ b/tty/tty-make-vt-s-have-a-tty_port.patch @@ -24,7 +24,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- a/drivers/char/vt.c +++ b/drivers/char/vt.c -@@ -777,6 +777,7 @@ int vc_allocate(unsigned int currcons) / +@@ -783,6 +783,7 @@ int vc_allocate(unsigned int currcons) / if (!vc) return -ENOMEM; vc_cons[currcons].d = vc; @@ -32,7 +32,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); visual_init(vc, currcons, 1); if (!*vc->vc_uni_pagedir_loc) -@@ -2914,6 +2915,7 @@ static int __init con_init(void) +@@ -2920,6 +2921,7 @@ static int __init con_init(void) for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) { vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), GFP_NOWAIT); INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); diff --git a/tty/tty-move-the-vt_tty-field-from-the-vc_data-into-the-standard-tty_port.patch b/tty/tty-move-the-vt_tty-field-from-the-vc_data-into-the-standard-tty_port.patch index db74155d7ef2af..e0d26b9195d5e9 100644 --- a/tty/tty-move-the-vt_tty-field-from-the-vc_data-into-the-standard-tty_port.patch +++ b/tty/tty-move-the-vt_tty-field-from-the-vc_data-into-the-standard-tty_port.patch @@ -72,7 +72,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> /* No driver data? Strange. Okay we fix it then. */ --- a/drivers/char/vt.c +++ b/drivers/char/vt.c -@@ -966,12 +966,12 @@ static int vc_do_resize(struct tty_struc +@@ -972,12 +972,12 @@ static int vc_do_resize(struct tty_struc * Resize a virtual console as seen from the console end of things. We * use the common vc_do_resize methods to update the structures. The * caller must hold the console sem to protect console internals and @@ -87,7 +87,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } /** -@@ -2800,12 +2800,12 @@ static int con_open(struct tty_struct *t +@@ -2806,12 +2806,12 @@ static int con_open(struct tty_struct *t struct vc_data *vc = vc_cons[currcons].d; /* Still being freed */ @@ -102,7 +102,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if (!tty->winsize.ws_row && !tty->winsize.ws_col) { tty->winsize.ws_row = vc_cons[currcons].d->vc_rows; -@@ -2833,7 +2833,7 @@ static void con_shutdown(struct tty_stru +@@ -2839,7 +2839,7 @@ static void con_shutdown(struct tty_stru struct vc_data *vc = tty->driver_data; BUG_ON(vc == NULL); acquire_console_sem(); diff --git a/tty/tty-remove-tty_lock_nested.patch b/tty/tty-remove-tty_lock_nested.patch index 43e79d5bfed07e..498b435bb99ffe 100644 --- a/tty/tty-remove-tty_lock_nested.patch +++ b/tty/tty-remove-tty_lock_nested.patch @@ -195,7 +195,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> extern void tty_vhangup_self(void); extern void tty_unhangup(struct file *filp); extern int tty_hung_up_p(struct file *filp); -@@ -575,21 +576,6 @@ extern long vt_compat_ioctl(struct tty_s +@@ -578,21 +579,6 @@ extern long vt_compat_ioctl(struct tty_s unsigned int cmd, unsigned long arg); /* functions for preparation of BKL removal */ diff --git a/tty/tty-replace-bkl-with-a-new-tty_lock.patch b/tty/tty-replace-bkl-with-a-new-tty_lock.patch index 9aef3cce457208..20228d048eb191 100644 --- a/tty/tty-replace-bkl-with-a-new-tty_lock.patch +++ b/tty/tty-replace-bkl-with-a-new-tty_lock.patch @@ -1003,7 +1003,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> #include <asm/system.h> -@@ -573,5 +574,35 @@ extern int vt_ioctl(struct tty_struct *t +@@ -576,5 +577,35 @@ extern int vt_ioctl(struct tty_struct *t extern long vt_compat_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg); diff --git a/tty/vc-locking-clean-up.patch b/tty/vc-locking-clean-up.patch index 3d3b26c0e0ed81..723cda5a30002f 100644 --- a/tty/vc-locking-clean-up.patch +++ b/tty/vc-locking-clean-up.patch @@ -49,7 +49,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } --- a/drivers/char/vt.c +++ b/drivers/char/vt.c -@@ -281,8 +281,12 @@ static inline unsigned short *screenpos( +@@ -287,8 +287,12 @@ static inline unsigned short *screenpos( return p; } @@ -62,7 +62,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> scrollback_delta += lines; schedule_console_callback(); } -@@ -2609,8 +2613,6 @@ int tioclinux(struct tty_struct *tty, un +@@ -2615,8 +2619,6 @@ int tioclinux(struct tty_struct *tty, un return -EFAULT; ret = 0; @@ -71,7 +71,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> switch (type) { case TIOCL_SETSEL: -@@ -2685,7 +2687,6 @@ int tioclinux(struct tty_struct *tty, un +@@ -2691,7 +2693,6 @@ int tioclinux(struct tty_struct *tty, un ret = -EINVAL; break; } diff --git a/tty/vt-clean-up-the-code-use-kernel-library.patch b/tty/vt-clean-up-the-code-use-kernel-library.patch index ebdb7353978d2b..6937d9cc1ffd20 100644 --- a/tty/vt-clean-up-the-code-use-kernel-library.patch +++ b/tty/vt-clean-up-the-code-use-kernel-library.patch @@ -20,15 +20,15 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- a/drivers/char/vt.c +++ b/drivers/char/vt.c -@@ -104,6 +104,7 @@ - #include <linux/io.h> +@@ -105,6 +105,7 @@ #include <asm/system.h> #include <linux/uaccess.h> + #include <linux/kdb.h> +#include <linux/ctype.h> #define MAX_NR_CON_DRIVER 16 -@@ -1789,8 +1790,8 @@ static void do_con_trol(struct tty_struc +@@ -1795,8 +1796,8 @@ static void do_con_trol(struct tty_struc vc->vc_state = ESnormal; return; case ESpalette: diff --git a/tty/vt-console-try-harder-to-print-output-when-panicing.patch b/tty/vt-console-try-harder-to-print-output-when-panicing.patch index a49fd99fd922f2..b962db5e8dcf34 100644 --- a/tty/vt-console-try-harder-to-print-output-when-panicing.patch +++ b/tty/vt-console-try-harder-to-print-output-when-panicing.patch @@ -42,7 +42,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- a/drivers/char/vt.c +++ b/drivers/char/vt.c -@@ -699,7 +699,10 @@ void redraw_screen(struct vc_data *vc, i +@@ -705,7 +705,10 @@ void redraw_screen(struct vc_data *vc, i update_attr(vc); clear_buffer_attributes(vc); } @@ -54,7 +54,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> do_update_region(vc, vc->vc_origin, vc->vc_screenbuf_size / 2); } set_cursor(vc); -@@ -737,6 +740,7 @@ static void visual_init(struct vc_data * +@@ -743,6 +746,7 @@ static void visual_init(struct vc_data * vc->vc_hi_font_mask = 0; vc->vc_complement_mask = 0; vc->vc_can_do_color = 0; @@ -62,7 +62,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> vc->vc_sw->con_init(vc, init); if (!vc->vc_complement_mask) vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800; -@@ -2499,7 +2503,7 @@ static void vt_console_print(struct cons +@@ -2505,7 +2509,7 @@ static void vt_console_print(struct cons goto quit; } @@ -71,7 +71,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> goto quit; /* undraw cursor first */ -@@ -3704,7 +3708,8 @@ void do_unblank_screen(int leaving_gfx) +@@ -3782,7 +3786,8 @@ void do_unblank_screen(int leaving_gfx) return; } vc = vc_cons[fg_console].d; @@ -81,7 +81,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> return; /* but leave console_blanked != 0 */ if (blankinterval) { -@@ -3713,7 +3718,7 @@ void do_unblank_screen(int leaving_gfx) +@@ -3791,7 +3796,7 @@ void do_unblank_screen(int leaving_gfx) } console_blanked = 0; @@ -92,7 +92,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if (console_blank_hook) --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c -@@ -128,7 +128,7 @@ static int intelfb_create(struct intel_f +@@ -130,7 +130,7 @@ static int intelfb_create(struct intel_f strcpy(info->fix.id, "inteldrmfb"); @@ -101,7 +101,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> info->fbops = &intelfb_ops; /* setup aperture base/size for vesafb takeover */ -@@ -146,8 +146,6 @@ static int intelfb_create(struct intel_f +@@ -148,8 +148,6 @@ static int intelfb_create(struct intel_f info->fix.smem_start = dev->mode_config.fb_base + obj_priv->gtt_offset; info->fix.smem_len = size; @@ -163,7 +163,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- a/include/linux/fb.h +++ b/include/linux/fb.h -@@ -812,6 +812,10 @@ struct fb_tile_ops { +@@ -825,6 +825,10 @@ struct fb_tile_ops { */ #define FBINFO_BE_MATH 0x100000 diff --git a/usb/pci-change-device-runtime-pm-settings-for-probe-and-remove-do-not-send.patch b/usb/pci-change-device-runtime-pm-settings-for-probe-and-remove-do-not-send.patch deleted file mode 100644 index 33cad51817144d..00000000000000 --- a/usb/pci-change-device-runtime-pm-settings-for-probe-and-remove-do-not-send.patch +++ /dev/null @@ -1,160 +0,0 @@ -From stern@rowland.harvard.edu Wed Jul 7 14:56:24 2010 -From: Alan Stern <stern@rowland.harvard.edu> -Date: Fri, 25 Jun 2010 15:18:32 -0400 (EDT) -Subject: PCI: change device runtime PM settings for probe and remove - DO NOT SEND -To: Greg KH <greg@kroah.com> -Message-ID: <Pine.LNX.4.44L0.1006251516110.1322-100000@iolanthe.rowland.org> - -DO NOT SEND TO LINUS, is going through the linux-pci tree. - -This patch (as1388) changes the way the PCI core handles runtime PM -settings when probing or unbinding drivers. Now the core will make -sure the device is enabled for runtime PM, with a usage count >= 1, -when a driver is probed. It does the same when calling a driver's -remove method. - -If the driver wants to use runtime PM, all it has to do is call -pm_runtime_pu_noidle() near the end of its probe routine (to cancel -the core's usage increment) and pm_runtime_get_noresume() near the -start of its remove routine (to restore the usage count). It does not -need to mess around with setting the runtime state to enabled, -disabled, active, or suspended. - -The patch updates e1000e and r8169, the only PCI drivers that already -use the existing runtime PM interface. - -Signed-off-by: Alan Stern <stern@rowland.harvard.edu> -Acked-by: Rafael J. Wysocki <rjw@sisk.pl> - ---- - drivers/net/e1000e/netdev.c | 16 ++++------------ - drivers/net/r8169.c | 16 ++++------------ - drivers/pci/pci-driver.c | 30 ++++++++++++++++++++++++++++-- - 3 files changed, 36 insertions(+), 26 deletions(-) - ---- a/drivers/net/e1000e/netdev.c -+++ b/drivers/net/e1000e/netdev.c -@@ -5825,11 +5825,8 @@ static int __devinit e1000_probe(struct - - e1000_print_device_info(adapter); - -- if (pci_dev_run_wake(pdev)) { -- pm_runtime_set_active(&pdev->dev); -- pm_runtime_enable(&pdev->dev); -- } -- pm_schedule_suspend(&pdev->dev, MSEC_PER_SEC); -+ if (pci_dev_run_wake(pdev)) -+ pm_runtime_put_noidle(&pdev->dev); - - return 0; - -@@ -5875,8 +5872,6 @@ static void __devexit e1000_remove(struc - struct e1000_adapter *adapter = netdev_priv(netdev); - bool down = test_bit(__E1000_DOWN, &adapter->state); - -- pm_runtime_get_sync(&pdev->dev); -- - /* - * flush_scheduled work may reschedule our watchdog task, so - * explicitly disable watchdog tasks from being rescheduled -@@ -5901,11 +5896,8 @@ static void __devexit e1000_remove(struc - clear_bit(__E1000_DOWN, &adapter->state); - unregister_netdev(netdev); - -- if (pci_dev_run_wake(pdev)) { -- pm_runtime_disable(&pdev->dev); -- pm_runtime_set_suspended(&pdev->dev); -- } -- pm_runtime_put_noidle(&pdev->dev); -+ if (pci_dev_run_wake(pdev)) -+ pm_runtime_get_noresume(&pdev->dev); - - /* - * Release control of h/w to f/w. If f/w is AMT enabled, this ---- a/drivers/net/r8169.c -+++ b/drivers/net/r8169.c -@@ -3219,11 +3219,8 @@ rtl8169_init_one(struct pci_dev *pdev, c - - device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL); - -- if (pci_dev_run_wake(pdev)) { -- pm_runtime_set_active(&pdev->dev); -- pm_runtime_enable(&pdev->dev); -- } -- pm_runtime_idle(&pdev->dev); -+ if (pci_dev_run_wake(pdev)) -+ pm_runtime_put_noidle(&pdev->dev); - - out: - return rc; -@@ -3246,17 +3243,12 @@ static void __devexit rtl8169_remove_one - struct net_device *dev = pci_get_drvdata(pdev); - struct rtl8169_private *tp = netdev_priv(dev); - -- pm_runtime_get_sync(&pdev->dev); -- - flush_scheduled_work(); - - unregister_netdev(dev); - -- if (pci_dev_run_wake(pdev)) { -- pm_runtime_disable(&pdev->dev); -- pm_runtime_set_suspended(&pdev->dev); -- } -- pm_runtime_put_noidle(&pdev->dev); -+ if (pci_dev_run_wake(pdev)) -+ pm_runtime_get_noresume(&pdev->dev); - - /* restore original MAC address */ - rtl_rar_set(tp, dev->perm_addr); ---- a/drivers/pci/pci-driver.c -+++ b/drivers/pci/pci-driver.c -@@ -289,8 +289,26 @@ struct drv_dev_and_id { - static long local_pci_probe(void *_ddi) - { - struct drv_dev_and_id *ddi = _ddi; -+ struct device *dev = &ddi->dev->dev; -+ int rc; - -- return ddi->drv->probe(ddi->dev, ddi->id); -+ /* Unbound PCI devices are always set to disabled and suspended. -+ * During probe, the device is set to enabled and active and the -+ * usage count is incremented. If the driver supports runtime PM, -+ * it should call pm_runtime_put_noidle() in its probe routine and -+ * pm_runtime_get_noresume() in its remove routine. -+ */ -+ pm_runtime_get_noresume(dev); -+ pm_runtime_set_active(dev); -+ pm_runtime_enable(dev); -+ -+ rc = ddi->drv->probe(ddi->dev, ddi->id); -+ if (rc) { -+ pm_runtime_disable(dev); -+ pm_runtime_set_suspended(dev); -+ pm_runtime_put_noidle(dev); -+ } -+ return rc; - } - - static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev, -@@ -369,11 +387,19 @@ static int pci_device_remove(struct devi - struct pci_driver * drv = pci_dev->driver; - - if (drv) { -- if (drv->remove) -+ if (drv->remove) { -+ pm_runtime_get_sync(dev); - drv->remove(pci_dev); -+ pm_runtime_put_noidle(dev); -+ } - pci_dev->driver = NULL; - } - -+ /* Undo the runtime PM settings in local_pci_probe() */ -+ pm_runtime_disable(dev); -+ pm_runtime_set_suspended(dev); -+ pm_runtime_put_noidle(dev); -+ - /* - * If the device is still on, set the power state as "unknown", - * since it might change by the next time we load the driver. |
