diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-08 09:19:41 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-08 09:19:41 -0800 |
commit | 504fd0599cf27df6292a9fa3e3c8c346c28528dc (patch) | |
tree | d997614fd7c3eb26a828d27d017d070a2c71cf2e | |
parent | 8a8ed9d4d05b886e8916b7ecd7ba322180a22b3c (diff) | |
download | patches-504fd0599cf27df6292a9fa3e3c8c346c28528dc.tar.gz |
hv patch
-rw-r--r-- | series | 13 | ||||
-rw-r--r-- | staging.current/staging-hv-fix-smp-problems-in-the-hyperv-core-code.patch | 243 | ||||
-rw-r--r-- | usb/usb-retain-usb-device-power-wakeup-setting-across-reconfiguration.patch | 69 | ||||
-rw-r--r-- | version | 2 |
4 files changed, 321 insertions, 6 deletions
@@ -24,6 +24,7 @@ usb.current/usb-serial-fix-usb-serial-fix-kfifo_len-locking.patch # Staging patches for 2.6.33 ################################# staging.current/staging-asus_oled-fix-oops-in-2.6.32.2.patch +staging.current/staging-hv-fix-smp-problems-in-the-hyperv-core-code.patch ##################################################################### @@ -35,11 +36,11 @@ staging.current/staging-asus_oled-fix-oops-in-2.6.32.2.patch ############################################# driver-core/kobject-example-spelling-fixes.patch driver-core/kset-example-spelling-fixes.patch -driver.core/driver-core-add-platform_create_bundle-helper.patch -driver.core/driver-core-make-platform_device_id-table-const.patch -driver.core/sysdev-pass-attribute-in-sysdev_class-attributes-show-store.patch -driver.core/sysdev-convert-node-driver-class-attributes-to-be-data-driven.patch -driver.core/sysdev-convert-cpu-driver-sysdev-class-attributes.patch +driver-core/driver-core-add-platform_create_bundle-helper.patch +driver-core/driver-core-make-platform_device_id-table-const.patch +driver-core/sysdev-pass-attribute-in-sysdev_class-attributes-show-store.patch +driver-core/sysdev-convert-node-driver-class-attributes-to-be-data-driven.patch +driver-core/sysdev-convert-cpu-driver-sysdev-class-attributes.patch ##################################### # TTY patches for after 2.6.33 is out @@ -131,6 +132,7 @@ usb/usb-musb-remove-some-of-the-never-defined-defines.patch usb/usbmon-add-bus-number-to-text-api.patch usb/usb-cdc_acm-add-support-for-pblua-console-port.patch usb/usb-cdc_acm-silence-it-is-not-a-modem.-error-for-pblua-devices.patch +usb/usb-retain-usb-device-power-wakeup-setting-across-reconfiguration.patch @@ -239,3 +241,4 @@ staging/staging-batman-adv-remove-compat.h.patch staging/staging-batman-adv-dont-deactivate-aggregation-on-wrong-input.patch + diff --git a/staging.current/staging-hv-fix-smp-problems-in-the-hyperv-core-code.patch b/staging.current/staging-hv-fix-smp-problems-in-the-hyperv-core-code.patch new file mode 100644 index 00000000000000..c6ed0a62049e88 --- /dev/null +++ b/staging.current/staging-hv-fix-smp-problems-in-the-hyperv-core-code.patch @@ -0,0 +1,243 @@ +From foo@baz Fri Jan 8 09:06:40 PST 2010 +Date: Fri, 08 Jan 2010 09:06:40 -0800 +From: Greg Kroah-Hartman <gregkh@suse.de> +Subject: Staging: hv: fix smp problems in the hyperv core code + +This fixes a number of SMP problems that were in the hyperv core code. + +Patch originally written by K. Y. Srinivasan <ksrinivasan@novell.com> +but forward ported to the latest in-kernel code and tweaked slightly by +me. + +Novell, Inc. hereby disclaims all copyright in any derivative work +copyright associated with this patch. + +Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com> +Cc: Hank Janssen <hjanssen@microsoft.com> +Cc: Haiyang Zhang <haiyangz@microsoft.com>. +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + + drivers/staging/hv/Hv.c | 50 ++++++++++++++++++++++----------------------- + drivers/staging/hv/Hv.h | 6 ++--- + drivers/staging/hv/Vmbus.c | 12 ++++++---- + 3 files changed, 35 insertions(+), 33 deletions(-) + +--- a/drivers/staging/hv/Hv.c ++++ b/drivers/staging/hv/Hv.c +@@ -386,7 +386,7 @@ u16 HvSignalEvent(void) + * retrieve the initialized message and event pages. Otherwise, we create and + * initialize the message and event pages. + */ +-int HvSynicInit(u32 irqVector) ++void HvSynicInit(void *irqarg) + { + u64 version; + union hv_synic_simp simp; +@@ -394,13 +394,14 @@ int HvSynicInit(u32 irqVector) + union hv_synic_sint sharedSint; + union hv_synic_scontrol sctrl; + u64 guestID; +- int ret = 0; ++ u32 irqVector = *((u32 *)(irqarg)); ++ int cpu = smp_processor_id(); + + DPRINT_ENTER(VMBUS); + + if (!gHvContext.HypercallPage) { + DPRINT_EXIT(VMBUS); +- return ret; ++ return; + } + + /* Check the version */ +@@ -425,27 +426,27 @@ int HvSynicInit(u32 irqVector) + */ + rdmsrl(HV_X64_MSR_GUEST_OS_ID, guestID); + if (guestID == HV_LINUX_GUEST_ID) { +- gHvContext.synICMessagePage[0] = ++ gHvContext.synICMessagePage[cpu] = + phys_to_virt(simp.BaseSimpGpa << PAGE_SHIFT); +- gHvContext.synICEventPage[0] = ++ gHvContext.synICEventPage[cpu] = + phys_to_virt(siefp.BaseSiefpGpa << PAGE_SHIFT); + } else { + DPRINT_ERR(VMBUS, "unknown guest id!!"); + goto Cleanup; + } + DPRINT_DBG(VMBUS, "MAPPED: Simp: %p, Sifep: %p", +- gHvContext.synICMessagePage[0], +- gHvContext.synICEventPage[0]); ++ gHvContext.synICMessagePage[cpu], ++ gHvContext.synICEventPage[cpu]); + } else { +- gHvContext.synICMessagePage[0] = osd_PageAlloc(1); +- if (gHvContext.synICMessagePage[0] == NULL) { ++ gHvContext.synICMessagePage[cpu] = (void *)get_zeroed_page(GFP_ATOMIC); ++ if (gHvContext.synICMessagePage[cpu] == NULL) { + DPRINT_ERR(VMBUS, + "unable to allocate SYNIC message page!!"); + goto Cleanup; + } + +- gHvContext.synICEventPage[0] = osd_PageAlloc(1); +- if (gHvContext.synICEventPage[0] == NULL) { ++ gHvContext.synICEventPage[cpu] = (void *)get_zeroed_page(GFP_ATOMIC); ++ if (gHvContext.synICEventPage[cpu] == NULL) { + DPRINT_ERR(VMBUS, + "unable to allocate SYNIC event page!!"); + goto Cleanup; +@@ -454,7 +455,7 @@ int HvSynicInit(u32 irqVector) + /* Setup the Synic's message page */ + rdmsrl(HV_X64_MSR_SIMP, simp.AsUINT64); + simp.SimpEnabled = 1; +- simp.BaseSimpGpa = virt_to_phys(gHvContext.synICMessagePage[0]) ++ simp.BaseSimpGpa = virt_to_phys(gHvContext.synICMessagePage[cpu]) + >> PAGE_SHIFT; + + DPRINT_DBG(VMBUS, "HV_X64_MSR_SIMP msr set to: %llx", +@@ -465,7 +466,7 @@ int HvSynicInit(u32 irqVector) + /* Setup the Synic's event page */ + rdmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64); + siefp.SiefpEnabled = 1; +- siefp.BaseSiefpGpa = virt_to_phys(gHvContext.synICEventPage[0]) ++ siefp.BaseSiefpGpa = virt_to_phys(gHvContext.synICEventPage[cpu]) + >> PAGE_SHIFT; + + DPRINT_DBG(VMBUS, "HV_X64_MSR_SIEFP msr set to: %llx", +@@ -501,32 +502,30 @@ int HvSynicInit(u32 irqVector) + + DPRINT_EXIT(VMBUS); + +- return ret; ++ return; + + Cleanup: +- ret = -1; +- + if (gHvContext.GuestId == HV_LINUX_GUEST_ID) { +- if (gHvContext.synICEventPage[0]) +- osd_PageFree(gHvContext.synICEventPage[0], 1); ++ if (gHvContext.synICEventPage[cpu]) ++ osd_PageFree(gHvContext.synICEventPage[cpu], 1); + +- if (gHvContext.synICMessagePage[0]) +- osd_PageFree(gHvContext.synICMessagePage[0], 1); ++ if (gHvContext.synICMessagePage[cpu]) ++ osd_PageFree(gHvContext.synICMessagePage[cpu], 1); + } + + DPRINT_EXIT(VMBUS); +- +- return ret; ++ return; + } + + /** + * HvSynicCleanup - Cleanup routine for HvSynicInit(). + */ +-void HvSynicCleanup(void) ++void HvSynicCleanup(void *arg) + { + union hv_synic_sint sharedSint; + union hv_synic_simp simp; + union hv_synic_siefp siefp; ++ int cpu = smp_processor_id(); + + DPRINT_ENTER(VMBUS); + +@@ -539,6 +538,7 @@ void HvSynicCleanup(void) + + sharedSint.Masked = 1; + ++ /* Need to correctly cleanup in the case of SMP!!! */ + /* Disable the interrupt */ + wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.AsUINT64); + +@@ -560,8 +560,8 @@ void HvSynicCleanup(void) + + wrmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64); + +- osd_PageFree(gHvContext.synICMessagePage[0], 1); +- osd_PageFree(gHvContext.synICEventPage[0], 1); ++ osd_PageFree(gHvContext.synICMessagePage[cpu], 1); ++ osd_PageFree(gHvContext.synICEventPage[cpu], 1); + } + + DPRINT_EXIT(VMBUS); +--- a/drivers/staging/hv/Hv.h ++++ b/drivers/staging/hv/Hv.h +@@ -93,7 +93,7 @@ static const struct hv_guid VMBUS_SERVIC + }, + }; + +-#define MAX_NUM_CPUS 1 ++#define MAX_NUM_CPUS 32 + + + struct hv_input_signal_event_buffer { +@@ -137,8 +137,8 @@ extern u16 HvPostMessage(union hv_connec + + extern u16 HvSignalEvent(void); + +-extern int HvSynicInit(u32 irqVector); ++extern void HvSynicInit(void *irqarg); + +-extern void HvSynicCleanup(void); ++extern void HvSynicCleanup(void *arg); + + #endif /* __HV_H__ */ +--- a/drivers/staging/hv/Vmbus.c ++++ b/drivers/staging/hv/Vmbus.c +@@ -129,7 +129,7 @@ static int VmbusOnDeviceAdd(struct hv_de + + /* strcpy(dev->name, "vmbus"); */ + /* SynIC setup... */ +- ret = HvSynicInit(*irqvector); ++ on_each_cpu(HvSynicInit, (void *)irqvector, 1); + + /* Connect to VMBus in the root partition */ + ret = VmbusConnect(); +@@ -150,7 +150,7 @@ static int VmbusOnDeviceRemove(struct hv + DPRINT_ENTER(VMBUS); + VmbusChannelReleaseUnattachedChannels(); + VmbusDisconnect(); +- HvSynicCleanup(); ++ on_each_cpu(HvSynicCleanup, NULL, 1); + DPRINT_EXIT(VMBUS); + + return ret; +@@ -173,7 +173,8 @@ static void VmbusOnCleanup(struct hv_dri + */ + static void VmbusOnMsgDPC(struct hv_driver *drv) + { +- void *page_addr = gHvContext.synICMessagePage[0]; ++ int cpu = smp_processor_id(); ++ void *page_addr = gHvContext.synICMessagePage[cpu]; + struct hv_message *msg = (struct hv_message *)page_addr + + VMBUS_MESSAGE_SINT; + struct hv_message *copied; +@@ -230,11 +231,12 @@ static void VmbusOnEventDPC(struct hv_dr + static int VmbusOnISR(struct hv_driver *drv) + { + int ret = 0; ++ int cpu = smp_processor_id(); + void *page_addr; + struct hv_message *msg; + union hv_synic_event_flags *event; + +- page_addr = gHvContext.synICMessagePage[0]; ++ page_addr = gHvContext.synICMessagePage[cpu]; + msg = (struct hv_message *)page_addr + VMBUS_MESSAGE_SINT; + + DPRINT_ENTER(VMBUS); +@@ -248,7 +250,7 @@ static int VmbusOnISR(struct hv_driver * + } + + /* TODO: Check if there are events to be process */ +- page_addr = gHvContext.synICEventPage[0]; ++ page_addr = gHvContext.synICEventPage[cpu]; + event = (union hv_synic_event_flags *)page_addr + VMBUS_MESSAGE_SINT; + + /* Since we are a child, we only need to check bit 0 */ diff --git a/usb/usb-retain-usb-device-power-wakeup-setting-across-reconfiguration.patch b/usb/usb-retain-usb-device-power-wakeup-setting-across-reconfiguration.patch new file mode 100644 index 00000000000000..df35fe557e067d --- /dev/null +++ b/usb/usb-retain-usb-device-power-wakeup-setting-across-reconfiguration.patch @@ -0,0 +1,69 @@ +From ddstreet@ieee.org Thu Jan 7 15:58:12 2010 +From: Dan Streetman <ddstreet@ieee.org> +Date: Wed, 6 Jan 2010 09:56:53 -0500 +Subject: USB: retain USB device power/wakeup setting across reconfiguration +To: linux-usb@vger.kernel.org +Cc: Dan Streetman <ddstreet@ieee.org>, David Brownell <dbrownell@users.sourceforge.net>, Alan Stern <stern@rowland.harvard.edu>, Greg KH <greg@kroah.com> +Message-ID: <1262789813-7411-1-git-send-email-ddstreet@ieee.org> + + +Currently a non-root-hub USB device's wakeup settings are initialized when the +device is set to a configured state using device_init_wakeup(), but this is not +correct as wakeup is split into "capable" (can_wakeup) and "enabled" +(should_wakeup). The settings should be initialized instead in the device +initialization (usb_new_device) with the "capable" setting disabled and the +"enabled" setting enabled. The "capable" setting should be set based on the +device being configured or unconfigured, and "enabled" setting set based on +the sysfs power/wakeup control. + +This patch retains the sysfs power/wakeup setting of a non-root-hub USB device +over a USB device re-configuration, which can happen (for example) after a +suspend/resume cycle. + +Signed-off-by: Dan Streetman <ddstreet@ieee.org> +Cc: David Brownell <dbrownell@users.sourceforge.net> +Cc: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/core/hub.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -1448,11 +1448,11 @@ void usb_set_device_state(struct usb_dev + || new_state == USB_STATE_SUSPENDED) + ; /* No change to wakeup settings */ + else if (new_state == USB_STATE_CONFIGURED) +- device_init_wakeup(&udev->dev, ++ device_set_wakeup_capable(&udev->dev, + (udev->actconfig->desc.bmAttributes + & USB_CONFIG_ATT_WAKEUP)); + else +- device_init_wakeup(&udev->dev, 0); ++ device_set_wakeup_capable(&udev->dev, 0); + } + if (udev->state == USB_STATE_SUSPENDED && + new_state != USB_STATE_SUSPENDED) +@@ -1799,10 +1799,18 @@ int usb_new_device(struct usb_device *ud + { + int err; + +- /* Increment the parent's count of unsuspended children */ +- if (udev->parent) ++ if (udev->parent) { ++ /* Increment the parent's count of unsuspended children */ + usb_autoresume_device(udev->parent); + ++ /* Initialize non-root-hub device wakeup to disabled; ++ * device (un)configuration controls wakeup capable ++ * sysfs power/wakeup controls wakeup enabled/disabled ++ */ ++ device_init_wakeup(&udev->dev, 0); ++ device_set_wakeup_enable(&udev->dev, 1); ++ } ++ + usb_detect_quirks(udev); + err = usb_enumerate_device(udev); /* Read descriptors */ + if (err < 0) @@ -1 +1 @@ -2.6.33-rc2 +2.6.33-rc3 |