From: Greg Kroah-Hartman Date: Tue, 8 Jan 2013 18:26:57 +0000 (-0800) Subject: 3.7-stable patches X-Git-Tag: v3.0.58~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61951bdcf73802dcb51c7b1d73296f7af7b0e1c6;p=thirdparty%2Fkernel%2Fstable-queue.git 3.7-stable patches added patches: acpi-do-acpisleep-dmi-check-when-config_acpi_sleep-is-set.patch acpi-scan-do-not-use-dummy-hid-for-system-bus-acpi-nodes.patch alsa-hda-add-mute-led-for-hp-pavilion-17-realtek-codec.patch alsa-hda-add-stereo-dmic-fixup-for-acer-aspire-one-522.patch alsa-hda-always-turn-on-pins-for-hdmi-dp.patch alsa-hda-fix-pin-configuration-of-hp-pavilion-dv7.patch alsa-hda-fix-the-wrong-pincaps-set-in-alc861vd-dallas-hp-fixup.patch alsa-hda-move-runtime-pm-check-to-runtime_idle-callback.patch alsa-usb-audio-avoid-autopm-calls-after-disconnection.patch alsa-usb-audio-fix-missing-autopm-for-midi-input.patch libata-restore-acpi-disable-functionality.patch mm-fix-calculation-of-dirtyable-memory.patch mm-fix-pagehead-when-config_pageflags_extended.patch mm-highmem-export-kmap_to_page-for-modules.patch p54usb-add-usb-id-for-t-com-sinus-154-data-ii.patch p54usb-add-usbids-for-two-more-p54usb-devices.patch qmi_wwan-cdc_ether-add-dell-wireless-5800-novatel-e362-usb-ids.patch rtlwifi-fix-incorrect-use-of-usb_alloc_coherent-with-usb_control_msg.patch tmpfs-mempolicy-fix-proc-mounts-corrupting-memory.patch usb-chipidea-fix-use-after-free-bug.patch usb-gadget-midi-free-hs-descriptors.patch usb-gadget-network-fix-bind-error-path.patch usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch usb-gadget-tcm_usb_gadget-null-terminate-the-fs-descriptor-list.patch usb-gadget-uvc-fix-error-path-in-uvc_function_bind.patch virtio-9p-correctly-pass-physical-address-to-userspace-for-high-pages.patch virtio-force-vring-descriptors-to-be-allocated-from-lowmem.patch x86-8042-enable-a20-using-kbc-to-fix-s3-resume-on-some-msi-laptops.patch --- diff --git a/queue-3.7/acpi-do-acpisleep-dmi-check-when-config_acpi_sleep-is-set.patch b/queue-3.7/acpi-do-acpisleep-dmi-check-when-config_acpi_sleep-is-set.patch new file mode 100644 index 00000000000..03cba8a2ed1 --- /dev/null +++ b/queue-3.7/acpi-do-acpisleep-dmi-check-when-config_acpi_sleep-is-set.patch @@ -0,0 +1,409 @@ +From 0ac1b1d7b7424cd6f129b5454b504b3cae746f0e Mon Sep 17 00:00:00 2001 +From: Zhang Rui +Date: Fri, 30 Nov 2012 12:57:03 +0100 +Subject: ACPI: do acpisleep dmi check when CONFIG_ACPI_SLEEP is set + +From: Zhang Rui + +commit 0ac1b1d7b7424cd6f129b5454b504b3cae746f0e upstream. + +The current acpisleep DMI checks only run when CONFIG_SUSPEND is set. +And this may break hibernation on some platforms when CONFIG_SUSPEND +is cleared. + +Move acpisleep DMI check into #ifdef CONFIG_ACPI_SLEEP instead. + +[rjw: Added acpi_sleep_dmi_check() and rebased on top of earlier + patches adding entries to acpisleep_dmi_table[].] +References: https://bugzilla.kernel.org/show_bug.cgi?id=45921 +Signed-off-by: Zhang Rui +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/sleep.c | 348 +++++++++++++++++++++++++-------------------------- + 1 file changed, 177 insertions(+), 171 deletions(-) + +--- a/drivers/acpi/sleep.c ++++ b/drivers/acpi/sleep.c +@@ -109,6 +109,180 @@ void __init acpi_old_suspend_ordering(vo + old_suspend_ordering = true; + } + ++static int __init init_old_suspend_ordering(const struct dmi_system_id *d) ++{ ++ acpi_old_suspend_ordering(); ++ return 0; ++} ++ ++static int __init init_nvs_nosave(const struct dmi_system_id *d) ++{ ++ acpi_nvs_nosave(); ++ return 0; ++} ++ ++static struct dmi_system_id __initdata acpisleep_dmi_table[] = { ++ { ++ .callback = init_old_suspend_ordering, ++ .ident = "Abit KN9 (nForce4 variant)", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"), ++ DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"), ++ }, ++ }, ++ { ++ .callback = init_old_suspend_ordering, ++ .ident = "HP xw4600 Workstation", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"), ++ }, ++ }, ++ { ++ .callback = init_old_suspend_ordering, ++ .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."), ++ DMI_MATCH(DMI_BOARD_NAME, "M2N8L"), ++ }, ++ }, ++ { ++ .callback = init_old_suspend_ordering, ++ .ident = "Panasonic CF51-2L", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, ++ "Matsushita Electric Industrial Co.,Ltd."), ++ DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Sony Vaio VGN-FW21E", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21E"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Sony Vaio VPCEB17FX", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB17FX"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Sony Vaio VGN-SR11M", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Everex StepNote Series", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Sony Vaio VPCEB1Z1E", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Sony Vaio VGN-NW130D", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NW130D"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Sony Vaio VPCCW29FX", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "VPCCW29FX"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Averatec AV1020-ED2", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "AVERATEC"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "1000 Series"), ++ }, ++ }, ++ { ++ .callback = init_old_suspend_ordering, ++ .ident = "Asus A8N-SLI DELUXE", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), ++ DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI DELUXE"), ++ }, ++ }, ++ { ++ .callback = init_old_suspend_ordering, ++ .ident = "Asus A8N-SLI Premium", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), ++ DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI Premium"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Sony Vaio VGN-SR26GN_P", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR26GN_P"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Sony Vaio VPCEB1S1E", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1S1E"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Sony Vaio VGN-FW520F", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW520F"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Asus K54C", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "K54C"), ++ }, ++ }, ++ { ++ .callback = init_nvs_nosave, ++ .ident = "Asus K54HR", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"), ++ }, ++ }, ++ {}, ++}; ++ ++static void acpi_sleep_dmi_check(void) ++{ ++ dmi_check_system(acpisleep_dmi_table); ++} ++ + /** + * acpi_pm_freeze - Disable the GPEs and suspend EC transactions. + */ +@@ -224,6 +398,7 @@ static void acpi_pm_end(void) + } + #else /* !CONFIG_ACPI_SLEEP */ + #define acpi_target_sleep_state ACPI_STATE_S0 ++static inline void acpi_sleep_dmi_check(void) {} + #endif /* CONFIG_ACPI_SLEEP */ + + #ifdef CONFIG_SUSPEND +@@ -382,175 +557,6 @@ static const struct platform_suspend_ops + .end = acpi_pm_end, + .recover = acpi_pm_finish, + }; +- +-static int __init init_old_suspend_ordering(const struct dmi_system_id *d) +-{ +- old_suspend_ordering = true; +- return 0; +-} +- +-static int __init init_nvs_nosave(const struct dmi_system_id *d) +-{ +- acpi_nvs_nosave(); +- return 0; +-} +- +-static struct dmi_system_id __initdata acpisleep_dmi_table[] = { +- { +- .callback = init_old_suspend_ordering, +- .ident = "Abit KN9 (nForce4 variant)", +- .matches = { +- DMI_MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"), +- DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"), +- }, +- }, +- { +- .callback = init_old_suspend_ordering, +- .ident = "HP xw4600 Workstation", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"), +- }, +- }, +- { +- .callback = init_old_suspend_ordering, +- .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)", +- .matches = { +- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."), +- DMI_MATCH(DMI_BOARD_NAME, "M2N8L"), +- }, +- }, +- { +- .callback = init_old_suspend_ordering, +- .ident = "Panasonic CF51-2L", +- .matches = { +- DMI_MATCH(DMI_BOARD_VENDOR, +- "Matsushita Electric Industrial Co.,Ltd."), +- DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Sony Vaio VGN-FW21E", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), +- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21E"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Sony Vaio VPCEB17FX", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), +- DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB17FX"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Sony Vaio VGN-SR11M", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), +- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Everex StepNote Series", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Sony Vaio VPCEB1Z1E", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), +- DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Sony Vaio VGN-NW130D", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), +- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NW130D"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Sony Vaio VPCCW29FX", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), +- DMI_MATCH(DMI_PRODUCT_NAME, "VPCCW29FX"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Averatec AV1020-ED2", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "AVERATEC"), +- DMI_MATCH(DMI_PRODUCT_NAME, "1000 Series"), +- }, +- }, +- { +- .callback = init_old_suspend_ordering, +- .ident = "Asus A8N-SLI DELUXE", +- .matches = { +- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), +- DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI DELUXE"), +- }, +- }, +- { +- .callback = init_old_suspend_ordering, +- .ident = "Asus A8N-SLI Premium", +- .matches = { +- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), +- DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI Premium"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Sony Vaio VGN-SR26GN_P", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), +- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR26GN_P"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Sony Vaio VPCEB1S1E", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), +- DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1S1E"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Sony Vaio VGN-FW520F", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), +- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW520F"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Asus K54C", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "K54C"), +- }, +- }, +- { +- .callback = init_nvs_nosave, +- .ident = "Asus K54HR", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"), +- }, +- }, +- {}, +-}; + #endif /* CONFIG_SUSPEND */ + + #ifdef CONFIG_HIBERNATION +@@ -881,13 +887,13 @@ int __init acpi_sleep_init(void) + u8 type_a, type_b; + #ifdef CONFIG_SUSPEND + int i = 0; +- +- dmi_check_system(acpisleep_dmi_table); + #endif + + if (acpi_disabled) + return 0; + ++ acpi_sleep_dmi_check(); ++ + sleep_states[ACPI_STATE_S0] = 1; + printk(KERN_INFO PREFIX "(supports S0"); + diff --git a/queue-3.7/acpi-scan-do-not-use-dummy-hid-for-system-bus-acpi-nodes.patch b/queue-3.7/acpi-scan-do-not-use-dummy-hid-for-system-bus-acpi-nodes.patch new file mode 100644 index 00000000000..d6193ffe2c5 --- /dev/null +++ b/queue-3.7/acpi-scan-do-not-use-dummy-hid-for-system-bus-acpi-nodes.patch @@ -0,0 +1,33 @@ +From 4f5f64cf0cc916220aaa055992e31195470cfe37 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Fri, 4 Jan 2013 23:00:54 +0100 +Subject: ACPI / scan: Do not use dummy HID for system bus ACPI nodes + +From: "Rafael J. Wysocki" + +commit 4f5f64cf0cc916220aaa055992e31195470cfe37 upstream. + +At one point acpi_device_set_id() checks if acpi_device_hid(device) +returns NULL, but that never happens, so system bus devices with an +empty list of PNP IDs are given the dummy HID ("device") instead of +the "system bus HID" ("LNXSYBUS"). Fix the code to use the right +check. + +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/scan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -1227,7 +1227,7 @@ static void acpi_device_set_id(struct ac + acpi_add_id(device, ACPI_DOCK_HID); + else if (!acpi_ibm_smbus_match(device)) + acpi_add_id(device, ACPI_SMBUS_IBM_HID); +- else if (!acpi_device_hid(device) && ++ else if (list_empty(&device->pnp.ids) && + ACPI_IS_ROOT_DEVICE(device->parent)) { + acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */ + strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME); diff --git a/queue-3.7/alsa-hda-add-mute-led-for-hp-pavilion-17-realtek-codec.patch b/queue-3.7/alsa-hda-add-mute-led-for-hp-pavilion-17-realtek-codec.patch new file mode 100644 index 00000000000..a3ed74e48fe --- /dev/null +++ b/queue-3.7/alsa-hda-add-mute-led-for-hp-pavilion-17-realtek-codec.patch @@ -0,0 +1,85 @@ +From 6d3cd5d444223c41eabb70dccff14fae4e8cb8b1 Mon Sep 17 00:00:00 2001 +From: David Henningsson +Date: Mon, 7 Jan 2013 12:03:47 +0100 +Subject: ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec) + +From: David Henningsson + +commit 6d3cd5d444223c41eabb70dccff14fae4e8cb8b1 upstream. + +The mute LED is in this case connected to the Mic1 VREF. + +The machine also exposes the following string in BIOS: +"HP_Mute_LED_0_A", so if more machines are coming, it probably +makes sense to try to do something more generic, like for the +IDT codec. + +BugLink: https://bugs.launchpad.net/bugs/1096789 +Signed-off-by: David Henningsson +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -5986,6 +5986,30 @@ static void alc269_fixup_quanta_mute(str + spec->automute_hook = alc269_quanta_automute; + } + ++/* update mute-LED according to the speaker mute state via mic1 VREF pin */ ++static void alc269_fixup_mic1_mute_hook(void *private_data, int enabled) ++{ ++ struct hda_codec *codec = private_data; ++ unsigned int pinval = AC_PINCTL_IN_EN + (enabled ? ++ AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80); ++ snd_hda_set_pin_ctl_cache(codec, 0x18, pinval); ++} ++ ++static void alc269_fixup_mic1_mute(struct hda_codec *codec, ++ const struct alc_fixup *fix, int action) ++{ ++ struct alc_spec *spec = codec->spec; ++ switch (action) { ++ case ALC_FIXUP_ACT_BUILD: ++ spec->vmaster_mute.hook = alc269_fixup_mic1_mute_hook; ++ snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, true); ++ /* fallthru */ ++ case ALC_FIXUP_ACT_INIT: ++ snd_hda_sync_vmaster_hook(&spec->vmaster_mute); ++ break; ++ } ++} ++ + /* update mute-LED according to the speaker mute state via mic2 VREF pin */ + static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled) + { +@@ -6027,6 +6051,7 @@ enum { + ALC269_FIXUP_DMIC, + ALC269VB_FIXUP_AMIC, + ALC269VB_FIXUP_DMIC, ++ ALC269_FIXUP_MIC1_MUTE_LED, + ALC269_FIXUP_MIC2_MUTE_LED, + ALC269_FIXUP_INV_DMIC, + ALC269_FIXUP_LENOVO_DOCK, +@@ -6153,6 +6178,10 @@ static const struct alc_fixup alc269_fix + { } + }, + }, ++ [ALC269_FIXUP_MIC1_MUTE_LED] = { ++ .type = ALC_FIXUP_FUNC, ++ .v.func = alc269_fixup_mic1_mute, ++ }, + [ALC269_FIXUP_MIC2_MUTE_LED] = { + .type = ALC_FIXUP_FUNC, + .v.func = alc269_fixup_mic2_mute, +@@ -6181,6 +6210,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), + SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), + SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED), ++ SND_PCI_QUIRK(0x103c, 0x1972, "HP Pavilion 17", ALC269_FIXUP_MIC1_MUTE_LED), + SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC), + SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC), + SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), diff --git a/queue-3.7/alsa-hda-add-stereo-dmic-fixup-for-acer-aspire-one-522.patch b/queue-3.7/alsa-hda-add-stereo-dmic-fixup-for-acer-aspire-one-522.patch new file mode 100644 index 00000000000..45f628e67e1 --- /dev/null +++ b/queue-3.7/alsa-hda-add-stereo-dmic-fixup-for-acer-aspire-one-522.patch @@ -0,0 +1,31 @@ +From 63a077e27648b4043b1ca1b4e29f0c42d99616b6 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 12 Dec 2012 12:10:01 +0100 +Subject: ALSA: hda - Add stereo-dmic fixup for Acer Aspire One 522 + +From: Takashi Iwai + +commit 63a077e27648b4043b1ca1b4e29f0c42d99616b6 upstream. + +Acer Aspire One 522 has the infamous digital mic unit that needs the +phase inversion fixup for stereo. + +Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=715737 + +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_conexant.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_conexant.c ++++ b/sound/pci/hda/patch_conexant.c +@@ -4453,6 +4453,7 @@ static const struct snd_pci_quirk cxt505 + }; + + static const struct snd_pci_quirk cxt5066_fixups[] = { ++ SND_PCI_QUIRK(0x1025, 0x0543, "Acer Aspire One 522", CXT_FIXUP_STEREO_DMIC), + SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), + SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo T410", CXT_PINCFG_LENOVO_TP410), + SND_PCI_QUIRK(0x17aa, 0x215f, "Lenovo T510", CXT_PINCFG_LENOVO_TP410), diff --git a/queue-3.7/alsa-hda-always-turn-on-pins-for-hdmi-dp.patch b/queue-3.7/alsa-hda-always-turn-on-pins-for-hdmi-dp.patch new file mode 100644 index 00000000000..b2e1a1371a1 --- /dev/null +++ b/queue-3.7/alsa-hda-always-turn-on-pins-for-hdmi-dp.patch @@ -0,0 +1,81 @@ +From 6169b673618bf0b2518ce413b54925782a603f06 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 14 Dec 2012 10:22:35 +0100 +Subject: ALSA: hda - Always turn on pins for HDMI/DP + +From: Takashi Iwai + +commit 6169b673618bf0b2518ce413b54925782a603f06 upstream. + +We've seen the broken HDMI *video* output on some machines with GM965, +and the debugging session pointed that the culprit is the disabled +audio output pins. Toggling these pins dynamically on demand caused +flickering of HDMI TV. + +This patch changes the behavior to keep the pin ON constantly. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51421 + +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_hdmi.c | 18 ++++-------------- + 1 file changed, 4 insertions(+), 14 deletions(-) + +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -431,9 +431,11 @@ static void hdmi_init_pin(struct hda_cod + if (get_wcaps(codec, pin_nid) & AC_WCAP_OUT_AMP) + snd_hda_codec_write(codec, pin_nid, 0, + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); +- /* Disable pin out until stream is active*/ ++ /* Enable pin out: some machines with GM965 gets broken output when ++ * the pin is disabled or changed while using with HDMI ++ */ + snd_hda_codec_write(codec, pin_nid, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, 0); ++ AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); + } + + static int hdmi_get_channel_count(struct hda_codec *codec, hda_nid_t cvt_nid) +@@ -1338,7 +1340,6 @@ static int generic_hdmi_playback_pcm_pre + struct hdmi_spec *spec = codec->spec; + int pin_idx = hinfo_to_pin_index(spec, hinfo); + hda_nid_t pin_nid = spec->pins[pin_idx].pin_nid; +- int pinctl; + bool non_pcm; + + non_pcm = check_non_pcm_per_cvt(codec, cvt_nid); +@@ -1347,11 +1348,6 @@ static int generic_hdmi_playback_pcm_pre + + hdmi_setup_audio_infoframe(codec, pin_idx, non_pcm, substream); + +- pinctl = snd_hda_codec_read(codec, pin_nid, 0, +- AC_VERB_GET_PIN_WIDGET_CONTROL, 0); +- snd_hda_codec_write(codec, pin_nid, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl | PIN_OUT); +- + return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format); + } + +@@ -1371,7 +1367,6 @@ static int hdmi_pcm_close(struct hda_pcm + int cvt_idx, pin_idx; + struct hdmi_spec_per_cvt *per_cvt; + struct hdmi_spec_per_pin *per_pin; +- int pinctl; + + if (hinfo->nid) { + cvt_idx = cvt_nid_to_cvt_index(spec, hinfo->nid); +@@ -1388,11 +1383,6 @@ static int hdmi_pcm_close(struct hda_pcm + return -EINVAL; + per_pin = &spec->pins[pin_idx]; + +- pinctl = snd_hda_codec_read(codec, per_pin->pin_nid, 0, +- AC_VERB_GET_PIN_WIDGET_CONTROL, 0); +- snd_hda_codec_write(codec, per_pin->pin_nid, 0, +- AC_VERB_SET_PIN_WIDGET_CONTROL, +- pinctl & ~PIN_OUT); + snd_hda_spdif_ctls_unassign(codec, pin_idx); + per_pin->chmap_set = false; + memset(per_pin->chmap, 0, sizeof(per_pin->chmap)); diff --git a/queue-3.7/alsa-hda-fix-pin-configuration-of-hp-pavilion-dv7.patch b/queue-3.7/alsa-hda-fix-pin-configuration-of-hp-pavilion-dv7.patch new file mode 100644 index 00000000000..af2fa4ddf5e --- /dev/null +++ b/queue-3.7/alsa-hda-fix-pin-configuration-of-hp-pavilion-dv7.patch @@ -0,0 +1,31 @@ +From 8ae5865ec77c22462c736846a0679947a6953548 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 13 Dec 2012 14:33:42 +0100 +Subject: ALSA: hda - Fix pin configuration of HP Pavilion dv7 + +From: Takashi Iwai + +commit 8ae5865ec77c22462c736846a0679947a6953548 upstream. + +Fix the quirk entry for HP Pavilion dv7 in order to make the bass +speaker working. + +Reported-and-tested-by: Tomas Pospisek +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_sigmatel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -1724,7 +1724,7 @@ static const struct snd_pci_quirk stac92 + SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1658, + "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), + SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1659, +- "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), ++ "HP Pavilion dv7", STAC_HP_DV7_4000), + SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x165A, + "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), + SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x165B, diff --git a/queue-3.7/alsa-hda-fix-the-wrong-pincaps-set-in-alc861vd-dallas-hp-fixup.patch b/queue-3.7/alsa-hda-fix-the-wrong-pincaps-set-in-alc861vd-dallas-hp-fixup.patch new file mode 100644 index 00000000000..eccb0e4c101 --- /dev/null +++ b/queue-3.7/alsa-hda-fix-the-wrong-pincaps-set-in-alc861vd-dallas-hp-fixup.patch @@ -0,0 +1,35 @@ +From b78562b10fa66175e30b76073e32a0ad8d92aa83 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 17 Dec 2012 20:06:49 +0100 +Subject: ALSA: hda - Fix the wrong pincaps set in ALC861VD dallas/hp fixup + +From: Takashi Iwai + +commit b78562b10fa66175e30b76073e32a0ad8d92aa83 upstream. + +The workaround to force VREF50 for dallas/hp model with ALC861VD +was introduced in commit 8fdcb6fe4204bdb4c6991652717ab5063751414e, +but it contained wrong pincap override bits. + +This patch fixes to exclude VREF80 pincap bit correctly. + +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -6535,8 +6535,8 @@ static void alc861vd_fixup_dallas(struct + const struct alc_fixup *fix, int action) + { + if (action == ALC_FIXUP_ACT_PRE_PROBE) { +- snd_hda_override_pin_caps(codec, 0x18, 0x00001714); +- snd_hda_override_pin_caps(codec, 0x19, 0x0000171c); ++ snd_hda_override_pin_caps(codec, 0x18, 0x00000734); ++ snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); + } + } + diff --git a/queue-3.7/alsa-hda-move-runtime-pm-check-to-runtime_idle-callback.patch b/queue-3.7/alsa-hda-move-runtime-pm-check-to-runtime_idle-callback.patch new file mode 100644 index 00000000000..a05761f1382 --- /dev/null +++ b/queue-3.7/alsa-hda-move-runtime-pm-check-to-runtime_idle-callback.patch @@ -0,0 +1,63 @@ +From 6eb827d23577a4efec2b10a9c4cc9ded268a1d1c Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 12 Dec 2012 11:50:12 +0100 +Subject: ALSA: hda - Move runtime PM check to runtime_idle callback + +From: Takashi Iwai + +commit 6eb827d23577a4efec2b10a9c4cc9ded268a1d1c upstream. + +The runtime_idle callback is the right place to check the suspend +capability, but currently we do it wrongly in the runtime_suspend +callback. This leads to a kernel error message like: + pci_pm_runtime_suspend(): azx_runtime_suspend+0x0/0x50 [snd_hda_intel] returns -11 +and the runtime PM core would even repeat the attempts. + +Reported-and-tested-by: Borislav Petkov +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_intel.c | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -2557,10 +2557,6 @@ static int azx_runtime_suspend(struct de + struct snd_card *card = dev_get_drvdata(dev); + struct azx *chip = card->private_data; + +- if (!power_save_controller || +- !(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) +- return -EAGAIN; +- + azx_stop_chip(chip); + azx_clear_irq_pending(chip); + return 0; +@@ -2575,12 +2571,25 @@ static int azx_runtime_resume(struct dev + azx_init_chip(chip, 1); + return 0; + } ++ ++static int azx_runtime_idle(struct device *dev) ++{ ++ struct snd_card *card = dev_get_drvdata(dev); ++ struct azx *chip = card->private_data; ++ ++ if (!power_save_controller || ++ !(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) ++ return -EBUSY; ++ ++ return 0; ++} ++ + #endif /* CONFIG_PM_RUNTIME */ + + #ifdef CONFIG_PM + static const struct dev_pm_ops azx_pm = { + SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume) +- SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, NULL) ++ SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle) + }; + + #define AZX_PM_OPS &azx_pm diff --git a/queue-3.7/alsa-usb-audio-avoid-autopm-calls-after-disconnection.patch b/queue-3.7/alsa-usb-audio-avoid-autopm-calls-after-disconnection.patch new file mode 100644 index 00000000000..23f6ac6718d --- /dev/null +++ b/queue-3.7/alsa-usb-audio-avoid-autopm-calls-after-disconnection.patch @@ -0,0 +1,104 @@ +From 59866da9e4ae54819e3c4e0a8f426bdb0c2ef993 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 3 Dec 2012 11:12:46 +0100 +Subject: ALSA: usb-audio: Avoid autopm calls after disconnection + +From: Takashi Iwai + +commit 59866da9e4ae54819e3c4e0a8f426bdb0c2ef993 upstream. + +Add a similar protection against the disconnection race and the +invalid use of usb instance after disconnection, as well as we've done +for the USB audio PCM. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51201 + +Reviewd-by: Clemens Ladisch +Tested-by: Clemens Ladisch +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/midi.c | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +--- a/sound/usb/midi.c ++++ b/sound/usb/midi.c +@@ -116,6 +116,7 @@ struct snd_usb_midi { + struct list_head list; + struct timer_list error_timer; + spinlock_t disc_lock; ++ struct rw_semaphore disc_rwsem; + struct mutex mutex; + u32 usb_id; + int next_midi_device; +@@ -1038,6 +1039,12 @@ static void substream_open(struct snd_ra + struct snd_usb_midi* umidi = substream->rmidi->private_data; + struct snd_kcontrol *ctl; + ++ down_read(&umidi->disc_rwsem); ++ if (umidi->disconnected) { ++ up_read(&umidi->disc_rwsem); ++ return; ++ } ++ + mutex_lock(&umidi->mutex); + if (open) { + if (umidi->opened++ == 0 && umidi->roland_load_ctl) { +@@ -1056,6 +1063,7 @@ static void substream_open(struct snd_ra + } + } + mutex_unlock(&umidi->mutex); ++ up_read(&umidi->disc_rwsem); + } + + static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream) +@@ -1076,8 +1084,15 @@ static int snd_usbmidi_output_open(struc + snd_BUG(); + return -ENXIO; + } ++ ++ down_read(&umidi->disc_rwsem); ++ if (umidi->disconnected) { ++ up_read(&umidi->disc_rwsem); ++ return -ENODEV; ++ } + err = usb_autopm_get_interface(umidi->iface); + port->autopm_reference = err >= 0; ++ up_read(&umidi->disc_rwsem); + if (err < 0 && err != -EACCES) + return -EIO; + substream->runtime->private_data = port; +@@ -1092,8 +1107,10 @@ static int snd_usbmidi_output_close(stru + struct usbmidi_out_port *port = substream->runtime->private_data; + + substream_open(substream, 0); +- if (port->autopm_reference) ++ down_read(&umidi->disc_rwsem); ++ if (!umidi->disconnected && port->autopm_reference) + usb_autopm_put_interface(umidi->iface); ++ up_read(&umidi->disc_rwsem); + return 0; + } + +@@ -1403,9 +1420,12 @@ void snd_usbmidi_disconnect(struct list_ + * a timer may submit an URB. To reliably break the cycle + * a flag under lock must be used + */ ++ down_write(&umidi->disc_rwsem); + spin_lock_irq(&umidi->disc_lock); + umidi->disconnected = 1; + spin_unlock_irq(&umidi->disc_lock); ++ up_write(&umidi->disc_rwsem); ++ + for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { + struct snd_usb_midi_endpoint* ep = &umidi->endpoints[i]; + if (ep->out) +@@ -2117,6 +2137,7 @@ int snd_usbmidi_create(struct snd_card * + umidi->usb_protocol_ops = &snd_usbmidi_standard_ops; + init_timer(&umidi->error_timer); + spin_lock_init(&umidi->disc_lock); ++ init_rwsem(&umidi->disc_rwsem); + mutex_init(&umidi->mutex); + umidi->usb_id = USB_ID(le16_to_cpu(umidi->dev->descriptor.idVendor), + le16_to_cpu(umidi->dev->descriptor.idProduct)); diff --git a/queue-3.7/alsa-usb-audio-fix-missing-autopm-for-midi-input.patch b/queue-3.7/alsa-usb-audio-fix-missing-autopm-for-midi-input.patch new file mode 100644 index 00000000000..38d9c4d1300 --- /dev/null +++ b/queue-3.7/alsa-usb-audio-fix-missing-autopm-for-midi-input.patch @@ -0,0 +1,220 @@ +From f5f165418cabf2218eb466c0e94693b8b1aee88b Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 3 Dec 2012 11:30:50 +0100 +Subject: ALSA: usb-audio: Fix missing autopm for MIDI input + +From: Takashi Iwai + +commit f5f165418cabf2218eb466c0e94693b8b1aee88b upstream. + +The commit [88a8516a: ALSA: usbaudio: implement USB autosuspend] added +the support of autopm for USB MIDI output, but it didn't take the MIDI +input into account. + +This patch adds the following for fixing the autopm: +- Manage the URB start at the first MIDI input stream open, instead of + the time of instance creation +- Move autopm code to the common substream_open() +- Make snd_usbmidi_input_start/_stop() more robust and add the running + state check + +Reviewd-by: Clemens Ladisch +Tested-by: Clemens Ladisch +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/midi.c | 88 ++++++++++++++++++++++++++++--------------------------- + 1 file changed, 46 insertions(+), 42 deletions(-) + +--- a/sound/usb/midi.c ++++ b/sound/usb/midi.c +@@ -126,8 +126,10 @@ struct snd_usb_midi { + struct snd_usb_midi_in_endpoint *in; + } endpoints[MIDI_MAX_ENDPOINTS]; + unsigned long input_triggered; +- unsigned int opened; ++ bool autopm_reference; ++ unsigned int opened[2]; + unsigned char disconnected; ++ unsigned char input_running; + + struct snd_kcontrol *roland_load_ctl; + }; +@@ -149,7 +151,6 @@ struct snd_usb_midi_out_endpoint { + struct snd_usb_midi_out_endpoint* ep; + struct snd_rawmidi_substream *substream; + int active; +- bool autopm_reference; + uint8_t cable; /* cable number << 4 */ + uint8_t state; + #define STATE_UNKNOWN 0 +@@ -1034,36 +1035,58 @@ static void update_roland_altsetting(str + snd_usbmidi_input_start(&umidi->list); + } + +-static void substream_open(struct snd_rawmidi_substream *substream, int open) ++static int substream_open(struct snd_rawmidi_substream *substream, int dir, ++ int open) + { + struct snd_usb_midi* umidi = substream->rmidi->private_data; + struct snd_kcontrol *ctl; ++ int err; + + down_read(&umidi->disc_rwsem); + if (umidi->disconnected) { + up_read(&umidi->disc_rwsem); +- return; ++ return open ? -ENODEV : 0; + } + + mutex_lock(&umidi->mutex); + if (open) { +- if (umidi->opened++ == 0 && umidi->roland_load_ctl) { +- ctl = umidi->roland_load_ctl; +- ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE; +- snd_ctl_notify(umidi->card, ++ if (!umidi->opened[0] && !umidi->opened[1]) { ++ err = usb_autopm_get_interface(umidi->iface); ++ umidi->autopm_reference = err >= 0; ++ if (err < 0 && err != -EACCES) { ++ mutex_unlock(&umidi->mutex); ++ up_read(&umidi->disc_rwsem); ++ return -EIO; ++ } ++ if (umidi->roland_load_ctl) { ++ ctl = umidi->roland_load_ctl; ++ ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE; ++ snd_ctl_notify(umidi->card, + SNDRV_CTL_EVENT_MASK_INFO, &ctl->id); +- update_roland_altsetting(umidi); ++ update_roland_altsetting(umidi); ++ } + } ++ umidi->opened[dir]++; ++ if (umidi->opened[1]) ++ snd_usbmidi_input_start(&umidi->list); + } else { +- if (--umidi->opened == 0 && umidi->roland_load_ctl) { +- ctl = umidi->roland_load_ctl; +- ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; +- snd_ctl_notify(umidi->card, ++ umidi->opened[dir]--; ++ if (!umidi->opened[1]) ++ snd_usbmidi_input_stop(&umidi->list); ++ if (!umidi->opened[0] && !umidi->opened[1]) { ++ if (umidi->roland_load_ctl) { ++ ctl = umidi->roland_load_ctl; ++ ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; ++ snd_ctl_notify(umidi->card, + SNDRV_CTL_EVENT_MASK_INFO, &ctl->id); ++ } ++ if (umidi->autopm_reference) ++ usb_autopm_put_interface(umidi->iface); + } + } + mutex_unlock(&umidi->mutex); + up_read(&umidi->disc_rwsem); ++ return 0; + } + + static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream) +@@ -1071,7 +1094,6 @@ static int snd_usbmidi_output_open(struc + struct snd_usb_midi* umidi = substream->rmidi->private_data; + struct usbmidi_out_port* port = NULL; + int i, j; +- int err; + + for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) + if (umidi->endpoints[i].out) +@@ -1085,33 +1107,14 @@ static int snd_usbmidi_output_open(struc + return -ENXIO; + } + +- down_read(&umidi->disc_rwsem); +- if (umidi->disconnected) { +- up_read(&umidi->disc_rwsem); +- return -ENODEV; +- } +- err = usb_autopm_get_interface(umidi->iface); +- port->autopm_reference = err >= 0; +- up_read(&umidi->disc_rwsem); +- if (err < 0 && err != -EACCES) +- return -EIO; + substream->runtime->private_data = port; + port->state = STATE_UNKNOWN; +- substream_open(substream, 1); +- return 0; ++ return substream_open(substream, 0, 1); + } + + static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream) + { +- struct snd_usb_midi* umidi = substream->rmidi->private_data; +- struct usbmidi_out_port *port = substream->runtime->private_data; +- +- substream_open(substream, 0); +- down_read(&umidi->disc_rwsem); +- if (!umidi->disconnected && port->autopm_reference) +- usb_autopm_put_interface(umidi->iface); +- up_read(&umidi->disc_rwsem); +- return 0; ++ return substream_open(substream, 0, 0); + } + + static void snd_usbmidi_output_trigger(struct snd_rawmidi_substream *substream, int up) +@@ -1164,14 +1167,12 @@ static void snd_usbmidi_output_drain(str + + static int snd_usbmidi_input_open(struct snd_rawmidi_substream *substream) + { +- substream_open(substream, 1); +- return 0; ++ return substream_open(substream, 1, 1); + } + + static int snd_usbmidi_input_close(struct snd_rawmidi_substream *substream) + { +- substream_open(substream, 0); +- return 0; ++ return substream_open(substream, 1, 0); + } + + static void snd_usbmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) +@@ -2080,12 +2081,15 @@ void snd_usbmidi_input_stop(struct list_ + unsigned int i, j; + + umidi = list_entry(p, struct snd_usb_midi, list); ++ if (!umidi->input_running) ++ return; + for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { + struct snd_usb_midi_endpoint* ep = &umidi->endpoints[i]; + if (ep->in) + for (j = 0; j < INPUT_URBS; ++j) + usb_kill_urb(ep->in->urbs[j]); + } ++ umidi->input_running = 0; + } + + static void snd_usbmidi_input_start_ep(struct snd_usb_midi_in_endpoint* ep) +@@ -2110,8 +2114,11 @@ void snd_usbmidi_input_start(struct list + int i; + + umidi = list_entry(p, struct snd_usb_midi, list); ++ if (umidi->input_running || !umidi->opened[1]) ++ return; + for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) + snd_usbmidi_input_start_ep(umidi->endpoints[i].in); ++ umidi->input_running = 1; + } + + /* +@@ -2250,9 +2257,6 @@ int snd_usbmidi_create(struct snd_card * + } + + list_add_tail(&umidi->list, midi_list); +- +- for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) +- snd_usbmidi_input_start_ep(umidi->endpoints[i].in); + return 0; + } + diff --git a/queue-3.7/libata-restore-acpi-disable-functionality.patch b/queue-3.7/libata-restore-acpi-disable-functionality.patch new file mode 100644 index 00000000000..a9fe0765a88 --- /dev/null +++ b/queue-3.7/libata-restore-acpi-disable-functionality.patch @@ -0,0 +1,66 @@ +From 0d0cdb028f9d9771e2b346038707734121f906e3 Mon Sep 17 00:00:00 2001 +From: Aaron Lu +Date: Mon, 26 Nov 2012 13:55:25 +0800 +Subject: libata: restore acpi disable functionality + +From: Aaron Lu + +commit 0d0cdb028f9d9771e2b346038707734121f906e3 upstream. + +Commit 66fa7f215 "libata-acpi: improve ACPI disabling" introdcued the +behaviour of disabling ATA ACPI if ata_acpi_on_devcfg failed the 2nd +time, but commit 30dcf76ac dropped this behaviour and this caused +problem for Dimitris Damigos, where his laptop can not resume correctly. + +The bugzilla page for it is: +https://bugzilla.kernel.org/show_bug.cgi?id=49331 + +The problem is, ata_dev_push_id will fail the 2nd time it is invoked, +and due to disabling ACPI code is dropped, ata_acpi_on_devcfg which +calls ata_dev_push_id will keep failing and eventually made the device +disabled. + +This patch restores the original behaviour, if acpi failed the 2nd time, +disable acpi functionality for the device(and we do not event need to +add a debug message for this as it is still there ;-). + +Reported-by: Dimitris Damigos +Signed-off-by: Aaron Lu +Signed-off-by: Jeff Garzik +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/libata-acpi.c | 4 ++++ + include/linux/libata.h | 1 + + 2 files changed, 5 insertions(+) + +--- a/drivers/ata/libata-acpi.c ++++ b/drivers/ata/libata-acpi.c +@@ -76,6 +76,9 @@ acpi_handle ata_dev_acpi_handle(struct a + acpi_integer adr; + struct ata_port *ap = dev->link->ap; + ++ if (dev->flags & ATA_DFLAG_ACPI_DISABLED) ++ return NULL; ++ + if (ap->flags & ATA_FLAG_ACPI_SATA) { + if (!sata_pmp_attached(ap)) + adr = SATA_ADR(ap->port_no, NO_PORT_MULT); +@@ -945,6 +948,7 @@ int ata_acpi_on_devcfg(struct ata_device + return rc; + } + ++ dev->flags |= ATA_DFLAG_ACPI_DISABLED; + ata_dev_warn(dev, "ACPI: failed the second time, disabled\n"); + + /* We can safely continue if no _GTF command has been executed +--- a/include/linux/libata.h ++++ b/include/linux/libata.h +@@ -163,6 +163,7 @@ enum { + + ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */ + ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */ ++ ATA_DFLAG_ACPI_DISABLED = (1 << 28), /* ACPI for the device is disabled */ + + ATA_DEV_UNKNOWN = 0, /* unknown device */ + ATA_DEV_ATA = 1, /* ATA device */ diff --git a/queue-3.7/mm-fix-calculation-of-dirtyable-memory.patch b/queue-3.7/mm-fix-calculation-of-dirtyable-memory.patch new file mode 100644 index 00000000000..f1f7f41085a --- /dev/null +++ b/queue-3.7/mm-fix-calculation-of-dirtyable-memory.patch @@ -0,0 +1,83 @@ +From c8b74c2f6604923de91f8aa6539f8bb934736754 Mon Sep 17 00:00:00 2001 +From: Sonny Rao +Date: Thu, 20 Dec 2012 15:05:07 -0800 +Subject: mm: fix calculation of dirtyable memory + +From: Sonny Rao + +commit c8b74c2f6604923de91f8aa6539f8bb934736754 upstream. + +The system uses global_dirtyable_memory() to calculate number of +dirtyable pages/pages that can be allocated to the page cache. A bug +causes an underflow thus making the page count look like a big unsigned +number. This in turn confuses the dirty writeback throttling to +aggressively write back pages as they become dirty (usually 1 page at a +time). This generally only affects systems with highmem because the +underflowed count gets subtracted from the global count of dirtyable +memory. + +The problem was introduced with v3.2-4896-gab8fabd + +Fix is to ensure we don't get an underflowed total of either highmem or +global dirtyable memory. + +Signed-off-by: Sonny Rao +Signed-off-by: Puneet Kumar +Acked-by: Johannes Weiner +Tested-by: Damien Wyart +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/page-writeback.c | 25 ++++++++++++++++++++----- + 1 file changed, 20 insertions(+), 5 deletions(-) + +--- a/mm/page-writeback.c ++++ b/mm/page-writeback.c +@@ -201,6 +201,18 @@ static unsigned long highmem_dirtyable_m + zone_reclaimable_pages(z) - z->dirty_balance_reserve; + } + /* ++ * Unreclaimable memory (kernel memory or anonymous memory ++ * without swap) can bring down the dirtyable pages below ++ * the zone's dirty balance reserve and the above calculation ++ * will underflow. However we still want to add in nodes ++ * which are below threshold (negative values) to get a more ++ * accurate calculation but make sure that the total never ++ * underflows. ++ */ ++ if ((long)x < 0) ++ x = 0; ++ ++ /* + * Make sure that the number of highmem pages is never larger + * than the number of the total dirtyable memory. This can only + * occur in very strange VM situations but we want to make sure +@@ -222,8 +234,8 @@ static unsigned long global_dirtyable_me + { + unsigned long x; + +- x = global_page_state(NR_FREE_PAGES) + global_reclaimable_pages() - +- dirty_balance_reserve; ++ x = global_page_state(NR_FREE_PAGES) + global_reclaimable_pages(); ++ x -= min(x, dirty_balance_reserve); + + if (!vm_highmem_is_dirtyable) + x -= highmem_dirtyable_memory(x); +@@ -290,9 +302,12 @@ static unsigned long zone_dirtyable_memo + * highmem zone can hold its share of dirty pages, so we don't + * care about vm_highmem_is_dirtyable here. + */ +- return zone_page_state(zone, NR_FREE_PAGES) + +- zone_reclaimable_pages(zone) - +- zone->dirty_balance_reserve; ++ unsigned long nr_pages = zone_page_state(zone, NR_FREE_PAGES) + ++ zone_reclaimable_pages(zone); ++ ++ /* don't allow this to underflow */ ++ nr_pages -= min(nr_pages, zone->dirty_balance_reserve); ++ return nr_pages; + } + + /** diff --git a/queue-3.7/mm-fix-pagehead-when-config_pageflags_extended.patch b/queue-3.7/mm-fix-pagehead-when-config_pageflags_extended.patch new file mode 100644 index 00000000000..45300f70d0d --- /dev/null +++ b/queue-3.7/mm-fix-pagehead-when-config_pageflags_extended.patch @@ -0,0 +1,63 @@ +From ad4b3fb7ff9940bcdb1e4cd62bd189d10fa636ba Mon Sep 17 00:00:00 2001 +From: Christoffer Dall +Date: Fri, 21 Dec 2012 13:03:50 -0500 +Subject: mm: Fix PageHead when !CONFIG_PAGEFLAGS_EXTENDED + +From: Christoffer Dall + +commit ad4b3fb7ff9940bcdb1e4cd62bd189d10fa636ba upstream. + +Unfortunately with !CONFIG_PAGEFLAGS_EXTENDED, (!PageHead) is false, and +(PageHead) is true, for tail pages. If this is indeed the intended +behavior, which I doubt because it breaks cache cleaning on some ARM +systems, then the nomenclature is highly problematic. + +This patch makes sure PageHead is only true for head pages and PageTail +is only true for tail pages, and neither is true for non-compound pages. + +[ This buglet seems ancient - seems to have been introduced back in Apr + 2008 in commit 6a1e7f777f61: "pageflags: convert to the use of new + macros". And the reason nobody noticed is because the PageHead() + tests are almost all about just sanity-checking, and only used on + pages that are actual page heads. The fact that the old code returned + true for tail pages too was thus not really noticeable. - Linus ] + +Signed-off-by: Christoffer Dall +Acked-by: Andrea Arcangeli +Cc: Andrew Morton +Cc: Will Deacon +Cc: Steve Capper +Cc: Christoph Lameter +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/page-flags.h | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/include/linux/page-flags.h ++++ b/include/linux/page-flags.h +@@ -362,7 +362,7 @@ static inline void ClearPageCompound(str + * pages on the LRU and/or pagecache. + */ + TESTPAGEFLAG(Compound, compound) +-__PAGEFLAG(Head, compound) ++__SETPAGEFLAG(Head, compound) __CLEARPAGEFLAG(Head, compound) + + /* + * PG_reclaim is used in combination with PG_compound to mark the +@@ -374,8 +374,14 @@ __PAGEFLAG(Head, compound) + * PG_compound & PG_reclaim => Tail page + * PG_compound & ~PG_reclaim => Head page + */ ++#define PG_head_mask ((1L << PG_compound)) + #define PG_head_tail_mask ((1L << PG_compound) | (1L << PG_reclaim)) + ++static inline int PageHead(struct page *page) ++{ ++ return ((page->flags & PG_head_tail_mask) == PG_head_mask); ++} ++ + static inline int PageTail(struct page *page) + { + return ((page->flags & PG_head_tail_mask) == PG_head_tail_mask); diff --git a/queue-3.7/mm-highmem-export-kmap_to_page-for-modules.patch b/queue-3.7/mm-highmem-export-kmap_to_page-for-modules.patch new file mode 100644 index 00000000000..ff305d82951 --- /dev/null +++ b/queue-3.7/mm-highmem-export-kmap_to_page-for-modules.patch @@ -0,0 +1,34 @@ +From f0263d2d222e9e25f2587e51a9dc58c6fb2a9352 Mon Sep 17 00:00:00 2001 +From: Will Deacon +Date: Fri, 19 Oct 2012 14:03:31 +0100 +Subject: mm: highmem: export kmap_to_page for modules + +From: Will Deacon + +commit f0263d2d222e9e25f2587e51a9dc58c6fb2a9352 upstream. + +Some virtio device drivers (9p) need to translate high virtual addresses +to physical addresses, which are inserted into the virtqueue for +processing by userspace. + +This patch exports the kmap_to_page symbol, so that the affected drivers +can be compiled as modules. + +Signed-off-by: Will Deacon +Signed-off-by: Rusty Russell +Signed-off-by: Greg Kroah-Hartman + +--- + mm/highmem.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/mm/highmem.c ++++ b/mm/highmem.c +@@ -105,6 +105,7 @@ struct page *kmap_to_page(void *vaddr) + + return virt_to_page(addr); + } ++EXPORT_SYMBOL(kmap_to_page); + + static void flush_all_zero_pkmaps(void) + { diff --git a/queue-3.7/p54usb-add-usb-id-for-t-com-sinus-154-data-ii.patch b/queue-3.7/p54usb-add-usb-id-for-t-com-sinus-154-data-ii.patch new file mode 100644 index 00000000000..bde0970c924 --- /dev/null +++ b/queue-3.7/p54usb-add-usb-id-for-t-com-sinus-154-data-ii.patch @@ -0,0 +1,30 @@ +From 3194b7fcdf6caea338b5d2c72d76fed80437649c Mon Sep 17 00:00:00 2001 +From: Tomasz Guszkowski +Date: Sat, 22 Dec 2012 18:30:01 +0100 +Subject: p54usb: add USB ID for T-Com Sinus 154 data II + +From: Tomasz Guszkowski + +commit 3194b7fcdf6caea338b5d2c72d76fed80437649c upstream. + +Added USB ID for T-Com Sinus 154 data II. + +Signed-off-by: Tomasz Guszkowski +Acked-by: Christian Lamparter +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/p54/p54usb.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/p54/p54usb.c ++++ b/drivers/net/wireless/p54/p54usb.c +@@ -82,6 +82,7 @@ static struct usb_device_id p54u_table[] + {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */ + {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ + {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ ++ {USB_DEVICE(0x083a, 0x4503)}, /* T-Com Sinus 154 data II */ + {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ + {USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */ + {USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */ diff --git a/queue-3.7/p54usb-add-usbids-for-two-more-p54usb-devices.patch b/queue-3.7/p54usb-add-usbids-for-two-more-p54usb-devices.patch new file mode 100644 index 00000000000..56bf21af576 --- /dev/null +++ b/queue-3.7/p54usb-add-usbids-for-two-more-p54usb-devices.patch @@ -0,0 +1,55 @@ +From 4010fe21a315b4223c25376714c6a2b61b722e5c Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 27 Dec 2012 15:18:20 +0100 +Subject: p54usb: add USBIDs for two more p54usb devices + +From: Christian Lamparter + +commit 4010fe21a315b4223c25376714c6a2b61b722e5c upstream. + +This patch adds USBIDs for: + - DrayTek Vigor 530 + - Zoom 4410a + +It also adds a note about Gemtek WUBI-100GW +and SparkLAN WL-682 USBID conflict [WUBI-100GW +is a ISL3886+NET2280 (LM86 firmare) solution, +whereas WL-682 is a ISL3887 (LM87 firmware)] +device. + +Source: + +Signed-off-by: Christian Lamparter +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/p54/p54usb.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/wireless/p54/p54usb.c ++++ b/drivers/net/wireless/p54/p54usb.c +@@ -47,6 +47,7 @@ static struct usb_device_id p54u_table[] + {USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */ + {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */ + {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */ ++ {USB_DEVICE(0x0675, 0x0530)}, /* DrayTek Vigor 530 */ + {USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */ + {USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */ + {USB_DEVICE(0x07aa, 0x001c)}, /* Corega CG-WLUSB2GT */ +@@ -82,6 +83,7 @@ static struct usb_device_id p54u_table[] + {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */ + {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ + {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ ++ {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */ + {USB_DEVICE(0x083a, 0x4503)}, /* T-Com Sinus 154 data II */ + {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ + {USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */ +@@ -102,6 +104,7 @@ static struct usb_device_id p54u_table[] + {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */ + {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */ + {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ ++ /* {USB_DEVICE(0x15a9, 0x0002)}, * Also SparkLAN WL-682 with 3887 */ + {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ + {USB_DEVICE(0x1740, 0x1000)}, /* Senao NUB-350 */ + {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ diff --git a/queue-3.7/qmi_wwan-cdc_ether-add-dell-wireless-5800-novatel-e362-usb-ids.patch b/queue-3.7/qmi_wwan-cdc_ether-add-dell-wireless-5800-novatel-e362-usb-ids.patch new file mode 100644 index 00000000000..6f1bd75542b --- /dev/null +++ b/queue-3.7/qmi_wwan-cdc_ether-add-dell-wireless-5800-novatel-e362-usb-ids.patch @@ -0,0 +1,73 @@ +From 0370acd4d4d2595a11b0b0a793acb506e19b9d4c Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Mon, 17 Dec 2012 08:17:41 +0000 +Subject: qmi_wwan/cdc_ether: add Dell Wireless 5800 (Novatel E362) USB IDs + +From: Dan Williams + +commit 0370acd4d4d2595a11b0b0a793acb506e19b9d4c upstream. + +Signed-off-by: Dan Williams +Acked-by: Bjørn Mork +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/usb/cdc_ether.c | 15 +++++++++++++++ + drivers/net/usb/qmi_wwan.c | 14 ++++++++++++++ + 2 files changed, 29 insertions(+) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -487,6 +487,7 @@ static const struct driver_info wwan_inf + #define HUAWEI_VENDOR_ID 0x12D1 + #define NOVATEL_VENDOR_ID 0x1410 + #define ZTE_VENDOR_ID 0x19D2 ++#define DELL_VENDOR_ID 0x413C + + static const struct usb_device_id products [] = { + /* +@@ -618,6 +619,20 @@ static const struct usb_device_id produc + .driver_info = 0, + }, + ++/* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */ ++{ ++ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x8195, USB_CLASS_COMM, ++ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), ++ .driver_info = 0, ++}, ++ ++/* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */ ++{ ++ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x8196, USB_CLASS_COMM, ++ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), ++ .driver_info = 0, ++}, ++ + /* + * WHITELIST!!! + * +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -383,6 +383,20 @@ static const struct usb_device_id produc + USB_CDC_PROTO_NONE), + .driver_info = (unsigned long)&qmi_wwan_info, + }, ++ { /* Dell Wireless 5800 (Novatel E362) */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8195, ++ USB_CLASS_COMM, ++ USB_CDC_SUBCLASS_ETHERNET, ++ USB_CDC_PROTO_NONE), ++ .driver_info = (unsigned long)&qmi_wwan_info, ++ }, ++ { /* Dell Wireless 5800 V2 (Novatel E362) */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8196, ++ USB_CLASS_COMM, ++ USB_CDC_SUBCLASS_ETHERNET, ++ USB_CDC_PROTO_NONE), ++ .driver_info = (unsigned long)&qmi_wwan_info, ++ }, + + /* 3. Combined interface devices matching on interface number */ + {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */ diff --git a/queue-3.7/rtlwifi-fix-incorrect-use-of-usb_alloc_coherent-with-usb_control_msg.patch b/queue-3.7/rtlwifi-fix-incorrect-use-of-usb_alloc_coherent-with-usb_control_msg.patch new file mode 100644 index 00000000000..7ddf9e9509e --- /dev/null +++ b/queue-3.7/rtlwifi-fix-incorrect-use-of-usb_alloc_coherent-with-usb_control_msg.patch @@ -0,0 +1,47 @@ +From 4c3de5920c486b8eefa6187ee6a181864c161100 Mon Sep 17 00:00:00 2001 +From: Jussi Kivilinna +Date: Thu, 20 Dec 2012 16:24:43 +0200 +Subject: rtlwifi: fix incorrect use of usb_alloc_coherent with usb_control_msg + +From: Jussi Kivilinna + +commit 4c3de5920c486b8eefa6187ee6a181864c161100 upstream. + +Incorrect use of usb_alloc_coherent memory as input buffer to usb_control_msg +can cause problems in arch DMA code, for example kernel BUG at +'arch/arm/include/asm/dma-mapping.h:321' on ARM (linux-3.4). + +Change _usb_writeN_sync use kmalloc'd buffer instead. + +Signed-off-by: Jussi Kivilinna +Acked-by: Larry Finger +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/rtlwifi/usb.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/drivers/net/wireless/rtlwifi/usb.c ++++ b/drivers/net/wireless/rtlwifi/usb.c +@@ -210,17 +210,16 @@ static void _usb_writeN_sync(struct rtl_ + u16 index = REALTEK_USB_VENQT_CMD_IDX; + int pipe = usb_sndctrlpipe(udev, 0); /* write_out */ + u8 *buffer; +- dma_addr_t dma_addr; + +- wvalue = (u16)(addr&0x0000ffff); +- buffer = usb_alloc_coherent(udev, (size_t)len, GFP_ATOMIC, &dma_addr); ++ wvalue = (u16)(addr & 0x0000ffff); ++ buffer = kmalloc(len, GFP_ATOMIC); + if (!buffer) + return; + memcpy(buffer, data, len); + usb_control_msg(udev, pipe, request, reqtype, wvalue, + index, buffer, len, 50); + +- usb_free_coherent(udev, (size_t)len, buffer, dma_addr); ++ kfree(buffer); + } + + static void _rtl_usb_io_handler_init(struct device *dev, diff --git a/queue-3.7/series b/queue-3.7/series index dfc8af7f7be..89a954fa39d 100644 --- a/queue-3.7/series +++ b/queue-3.7/series @@ -8,3 +8,31 @@ sgi-xp-handle-non-fatal-traps.patch exec-do-not-leave-bprm-interp-on-stack.patch arm64-make-dirty-ptes-read-only.patch arm64-signal-push-the-unwinding-prologue-on-the-signal-stack.patch +x86-8042-enable-a20-using-kbc-to-fix-s3-resume-on-some-msi-laptops.patch +mm-highmem-export-kmap_to_page-for-modules.patch +virtio-9p-correctly-pass-physical-address-to-userspace-for-high-pages.patch +virtio-force-vring-descriptors-to-be-allocated-from-lowmem.patch +mm-fix-calculation-of-dirtyable-memory.patch +mm-fix-pagehead-when-config_pageflags_extended.patch +tmpfs-mempolicy-fix-proc-mounts-corrupting-memory.patch +alsa-usb-audio-avoid-autopm-calls-after-disconnection.patch +alsa-usb-audio-fix-missing-autopm-for-midi-input.patch +alsa-hda-move-runtime-pm-check-to-runtime_idle-callback.patch +alsa-hda-add-stereo-dmic-fixup-for-acer-aspire-one-522.patch +alsa-hda-always-turn-on-pins-for-hdmi-dp.patch +alsa-hda-fix-the-wrong-pincaps-set-in-alc861vd-dallas-hp-fixup.patch +alsa-hda-fix-pin-configuration-of-hp-pavilion-dv7.patch +alsa-hda-add-mute-led-for-hp-pavilion-17-realtek-codec.patch +qmi_wwan-cdc_ether-add-dell-wireless-5800-novatel-e362-usb-ids.patch +rtlwifi-fix-incorrect-use-of-usb_alloc_coherent-with-usb_control_msg.patch +p54usb-add-usb-id-for-t-com-sinus-154-data-ii.patch +p54usb-add-usbids-for-two-more-p54usb-devices.patch +usb-chipidea-fix-use-after-free-bug.patch +usb-gadget-midi-free-hs-descriptors.patch +usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch +usb-gadget-tcm_usb_gadget-null-terminate-the-fs-descriptor-list.patch +usb-gadget-uvc-fix-error-path-in-uvc_function_bind.patch +usb-gadget-network-fix-bind-error-path.patch +acpi-do-acpisleep-dmi-check-when-config_acpi_sleep-is-set.patch +libata-restore-acpi-disable-functionality.patch +acpi-scan-do-not-use-dummy-hid-for-system-bus-acpi-nodes.patch diff --git a/queue-3.7/tmpfs-mempolicy-fix-proc-mounts-corrupting-memory.patch b/queue-3.7/tmpfs-mempolicy-fix-proc-mounts-corrupting-memory.patch new file mode 100644 index 00000000000..5ccd97bed1e --- /dev/null +++ b/queue-3.7/tmpfs-mempolicy-fix-proc-mounts-corrupting-memory.patch @@ -0,0 +1,172 @@ +From f2a07f40dbc603c15f8b06e6ec7f768af67b424f Mon Sep 17 00:00:00 2001 +From: Hugh Dickins +Date: Wed, 2 Jan 2013 02:01:33 -0800 +Subject: tmpfs mempolicy: fix /proc/mounts corrupting memory + +From: Hugh Dickins + +commit f2a07f40dbc603c15f8b06e6ec7f768af67b424f upstream. + +Recently I suggested using "mount -o remount,mpol=local /tmp" in NUMA +mempolicy testing. Very nasty. Reading /proc/mounts, /proc/pid/mounts +or /proc/pid/mountinfo may then corrupt one bit of kernel memory, often +in a page table (causing "Bad swap" or "Bad page map" warning or "Bad +pagetable" oops), sometimes in a vm_area_struct or rbnode or somewhere +worse. "mpol=prefer" and "mpol=prefer:Node" are equally toxic. + +Recent NUMA enhancements are not to blame: this dates back to 2.6.35, +when commit e17f74af351c "mempolicy: don't call mpol_set_nodemask() when +no_context" skipped mpol_parse_str()'s call to mpol_set_nodemask(), +which used to initialize v.preferred_node, or set MPOL_F_LOCAL in flags. +With slab poisoning, you can then rely on mpol_to_str() to set the bit +for node 0x6b6b, probably in the next page above the caller's stack. + +mpol_parse_str() is only called from shmem_parse_options(): no_context +is always true, so call it unused for now, and remove !no_context code. +Set v.nodes or v.preferred_node or MPOL_F_LOCAL as mpol_to_str() might +expect. Then mpol_to_str() can ignore its no_context argument also, +the mpol being appropriately initialized whether contextualized or not. +Rename its no_context unused too, and let subsequent patch remove them +(that's not needed for stable backporting, which would involve rejects). + +I don't understand why MPOL_LOCAL is described as a pseudo-policy: +it's a reasonable policy which suffers from a confusing implementation +in terms of MPOL_PREFERRED with MPOL_F_LOCAL. I believe this would be +much more robust if MPOL_LOCAL were recognized in switch statements +throughout, MPOL_F_LOCAL deleted, and MPOL_PREFERRED use the (possibly +empty) nodes mask like everyone else, instead of its preferred_node +variant (I presume an optimization from the days before MPOL_LOCAL). +But that would take me too long to get right and fully tested. + +Signed-off-by: Hugh Dickins +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/mempolicy.c | 64 +++++++++++++++++++++++---------------------------------- + 1 file changed, 26 insertions(+), 38 deletions(-) + +--- a/mm/mempolicy.c ++++ b/mm/mempolicy.c +@@ -2372,8 +2372,7 @@ void numa_default_policy(void) + */ + + /* +- * "local" is pseudo-policy: MPOL_PREFERRED with MPOL_F_LOCAL flag +- * Used only for mpol_parse_str() and mpol_to_str() ++ * "local" is implemented internally by MPOL_PREFERRED with MPOL_F_LOCAL flag. + */ + #define MPOL_LOCAL MPOL_MAX + static const char * const policy_modes[] = +@@ -2388,28 +2387,21 @@ static const char * const policy_modes[] + + #ifdef CONFIG_TMPFS + /** +- * mpol_parse_str - parse string to mempolicy ++ * mpol_parse_str - parse string to mempolicy, for tmpfs mpol mount option. + * @str: string containing mempolicy to parse + * @mpol: pointer to struct mempolicy pointer, returned on success. +- * @no_context: flag whether to "contextualize" the mempolicy ++ * @unused: redundant argument, to be removed later. + * + * Format of input: + * [=][:] + * +- * if @no_context is true, save the input nodemask in w.user_nodemask in +- * the returned mempolicy. This will be used to "clone" the mempolicy in +- * a specific context [cpuset] at a later time. Used to parse tmpfs mpol +- * mount option. Note that if 'static' or 'relative' mode flags were +- * specified, the input nodemask will already have been saved. Saving +- * it again is redundant, but safe. +- * + * On success, returns 0, else 1 + */ +-int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) ++int mpol_parse_str(char *str, struct mempolicy **mpol, int unused) + { + struct mempolicy *new = NULL; + unsigned short mode; +- unsigned short uninitialized_var(mode_flags); ++ unsigned short mode_flags; + nodemask_t nodes; + char *nodelist = strchr(str, ':'); + char *flags = strchr(str, '='); +@@ -2497,24 +2489,23 @@ int mpol_parse_str(char *str, struct mem + if (IS_ERR(new)) + goto out; + +- if (no_context) { +- /* save for contextualization */ +- new->w.user_nodemask = nodes; +- } else { +- int ret; +- NODEMASK_SCRATCH(scratch); +- if (scratch) { +- task_lock(current); +- ret = mpol_set_nodemask(new, &nodes, scratch); +- task_unlock(current); +- } else +- ret = -ENOMEM; +- NODEMASK_SCRATCH_FREE(scratch); +- if (ret) { +- mpol_put(new); +- goto out; +- } +- } ++ /* ++ * Save nodes for mpol_to_str() to show the tmpfs mount options ++ * for /proc/mounts, /proc/pid/mounts and /proc/pid/mountinfo. ++ */ ++ if (mode != MPOL_PREFERRED) ++ new->v.nodes = nodes; ++ else if (nodelist) ++ new->v.preferred_node = first_node(nodes); ++ else ++ new->flags |= MPOL_F_LOCAL; ++ ++ /* ++ * Save nodes for contextualization: this will be used to "clone" ++ * the mempolicy in a specific context [cpuset] at a later time. ++ */ ++ new->w.user_nodemask = nodes; ++ + err = 0; + + out: +@@ -2534,13 +2525,13 @@ out: + * @buffer: to contain formatted mempolicy string + * @maxlen: length of @buffer + * @pol: pointer to mempolicy to be formatted +- * @no_context: "context free" mempolicy - use nodemask in w.user_nodemask ++ * @unused: redundant argument, to be removed later. + * + * Convert a mempolicy into a string. + * Returns the number of characters in buffer (if positive) + * or an error (negative) + */ +-int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int no_context) ++int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int unused) + { + char *p = buffer; + int l; +@@ -2566,7 +2557,7 @@ int mpol_to_str(char *buffer, int maxlen + case MPOL_PREFERRED: + nodes_clear(nodes); + if (flags & MPOL_F_LOCAL) +- mode = MPOL_LOCAL; /* pseudo-policy */ ++ mode = MPOL_LOCAL; + else + node_set(pol->v.preferred_node, nodes); + break; +@@ -2574,10 +2565,7 @@ int mpol_to_str(char *buffer, int maxlen + case MPOL_BIND: + /* Fall through */ + case MPOL_INTERLEAVE: +- if (no_context) +- nodes = pol->w.user_nodemask; +- else +- nodes = pol->v.nodes; ++ nodes = pol->v.nodes; + break; + + default: diff --git a/queue-3.7/usb-chipidea-fix-use-after-free-bug.patch b/queue-3.7/usb-chipidea-fix-use-after-free-bug.patch new file mode 100644 index 00000000000..68764cc49a3 --- /dev/null +++ b/queue-3.7/usb-chipidea-fix-use-after-free-bug.patch @@ -0,0 +1,36 @@ +From 98c35534420d3147553bd3071a5fc63cd56de5b1 Mon Sep 17 00:00:00 2001 +From: Lothar Waßmann +Date: Thu, 22 Nov 2012 10:11:25 +0100 +Subject: USB: chipidea: fix use after free bug + +From: Lothar Waßmann + +commit 98c35534420d3147553bd3071a5fc63cd56de5b1 upstream. + +The pointer to a platform_device struct must not be dereferenced after +the device has been unregistered. + +This bug produces a crash when unloading the ci13xxx kernel module +compiled with CONFIG_PAGE_POISONING enabled. + +Signed-off-by: Lothar Waßmann +Acked-by: Alexander Shishkin +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/chipidea/core.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/chipidea/core.c ++++ b/drivers/usb/chipidea/core.c +@@ -385,8 +385,9 @@ EXPORT_SYMBOL_GPL(ci13xxx_add_device); + + void ci13xxx_remove_device(struct platform_device *pdev) + { ++ int id = pdev->id; + platform_device_unregister(pdev); +- ida_simple_remove(&ci_ida, pdev->id); ++ ida_simple_remove(&ci_ida, id); + } + EXPORT_SYMBOL_GPL(ci13xxx_remove_device); + diff --git a/queue-3.7/usb-gadget-midi-free-hs-descriptors.patch b/queue-3.7/usb-gadget-midi-free-hs-descriptors.patch new file mode 100644 index 00000000000..97858997955 --- /dev/null +++ b/queue-3.7/usb-gadget-midi-free-hs-descriptors.patch @@ -0,0 +1,30 @@ +From d185039f7982eb82cf8d03b6fb6689587ca5af24 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 22 Oct 2012 22:15:02 +0200 +Subject: usb: gadget: midi: free hs descriptors + +From: Sebastian Andrzej Siewior + +commit d185039f7982eb82cf8d03b6fb6689587ca5af24 upstream. + +The HS descriptors are only created if HS is supported by the UDC but we +never free them. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/f_midi.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/gadget/f_midi.c ++++ b/drivers/usb/gadget/f_midi.c +@@ -415,6 +415,7 @@ static void f_midi_unbind(struct usb_con + midi->id = NULL; + + usb_free_descriptors(f->descriptors); ++ usb_free_descriptors(f->hs_descriptors); + kfree(midi); + } + diff --git a/queue-3.7/usb-gadget-network-fix-bind-error-path.patch b/queue-3.7/usb-gadget-network-fix-bind-error-path.patch new file mode 100644 index 00000000000..a0c1b209768 --- /dev/null +++ b/queue-3.7/usb-gadget-network-fix-bind-error-path.patch @@ -0,0 +1,98 @@ +From e79cc615a9bb44da72c499ccfa2c9c4bbea3aa84 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 22 Oct 2012 22:15:00 +0200 +Subject: usb: gadget: network: fix bind() error path + +From: Sebastian Andrzej Siewior + +commit e79cc615a9bb44da72c499ccfa2c9c4bbea3aa84 upstream. + +I think this is wrong since 72c973dd ("usb: gadget: add +usb_endpoint_descriptor to struct usb_ep"). If we fail to allocate an ep +or bail out early we shouldn't check for the descriptor which is +assigned at ep_enable() time. + +Signed-off-by: Sebastian Andrzej Siewior +Cc: Tatyana Brokhman +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/f_ecm.c | 4 ++-- + drivers/usb/gadget/f_eem.c | 5 ++--- + drivers/usb/gadget/f_ncm.c | 4 ++-- + drivers/usb/gadget/f_rndis.c | 4 ++-- + drivers/usb/gadget/f_subset.c | 4 ++-- + 5 files changed, 10 insertions(+), 11 deletions(-) + +--- a/drivers/usb/gadget/f_ecm.c ++++ b/drivers/usb/gadget/f_ecm.c +@@ -808,9 +808,9 @@ fail: + /* we might as well release our claims on endpoints */ + if (ecm->notify) + ecm->notify->driver_data = NULL; +- if (ecm->port.out_ep->desc) ++ if (ecm->port.out_ep) + ecm->port.out_ep->driver_data = NULL; +- if (ecm->port.in_ep->desc) ++ if (ecm->port.in_ep) + ecm->port.in_ep->driver_data = NULL; + + ERROR(cdev, "%s: can't bind, err %d\n", f->name, status); +--- a/drivers/usb/gadget/f_eem.c ++++ b/drivers/usb/gadget/f_eem.c +@@ -319,10 +319,9 @@ fail: + if (f->hs_descriptors) + usb_free_descriptors(f->hs_descriptors); + +- /* we might as well release our claims on endpoints */ +- if (eem->port.out_ep->desc) ++ if (eem->port.out_ep) + eem->port.out_ep->driver_data = NULL; +- if (eem->port.in_ep->desc) ++ if (eem->port.in_ep) + eem->port.in_ep->driver_data = NULL; + + ERROR(cdev, "%s: can't bind, err %d\n", f->name, status); +--- a/drivers/usb/gadget/f_ncm.c ++++ b/drivers/usb/gadget/f_ncm.c +@@ -1259,9 +1259,9 @@ fail: + /* we might as well release our claims on endpoints */ + if (ncm->notify) + ncm->notify->driver_data = NULL; +- if (ncm->port.out_ep->desc) ++ if (ncm->port.out_ep) + ncm->port.out_ep->driver_data = NULL; +- if (ncm->port.in_ep->desc) ++ if (ncm->port.in_ep) + ncm->port.in_ep->driver_data = NULL; + + ERROR(cdev, "%s: can't bind, err %d\n", f->name, status); +--- a/drivers/usb/gadget/f_rndis.c ++++ b/drivers/usb/gadget/f_rndis.c +@@ -803,9 +803,9 @@ fail: + /* we might as well release our claims on endpoints */ + if (rndis->notify) + rndis->notify->driver_data = NULL; +- if (rndis->port.out_ep->desc) ++ if (rndis->port.out_ep) + rndis->port.out_ep->driver_data = NULL; +- if (rndis->port.in_ep->desc) ++ if (rndis->port.in_ep) + rndis->port.in_ep->driver_data = NULL; + + ERROR(cdev, "%s: can't bind, err %d\n", f->name, status); +--- a/drivers/usb/gadget/f_subset.c ++++ b/drivers/usb/gadget/f_subset.c +@@ -370,9 +370,9 @@ fail: + usb_free_descriptors(f->hs_descriptors); + + /* we might as well release our claims on endpoints */ +- if (geth->port.out_ep->desc) ++ if (geth->port.out_ep) + geth->port.out_ep->driver_data = NULL; +- if (geth->port.in_ep->desc) ++ if (geth->port.in_ep) + geth->port.in_ep->driver_data = NULL; + + ERROR(cdev, "%s: can't bind, err %d\n", f->name, status); diff --git a/queue-3.7/usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch b/queue-3.7/usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch new file mode 100644 index 00000000000..99cccd5a088 --- /dev/null +++ b/queue-3.7/usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch @@ -0,0 +1,48 @@ +From d0eca719dd11ad0619e8dd6a1f3eceb95b0216dd Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 22 Oct 2012 22:15:04 +0200 +Subject: usb: gadget: phonet: free requests in pn_bind()'s error path + +From: Sebastian Andrzej Siewior + +commit d0eca719dd11ad0619e8dd6a1f3eceb95b0216dd upstream. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/f_phonet.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/usb/gadget/f_phonet.c ++++ b/drivers/usb/gadget/f_phonet.c +@@ -531,7 +531,7 @@ int pn_bind(struct usb_configuration *c, + + req = usb_ep_alloc_request(fp->out_ep, GFP_KERNEL); + if (!req) +- goto err; ++ goto err_req; + + req->complete = pn_rx_complete; + fp->out_reqv[i] = req; +@@ -540,14 +540,18 @@ int pn_bind(struct usb_configuration *c, + /* Outgoing USB requests */ + fp->in_req = usb_ep_alloc_request(fp->in_ep, GFP_KERNEL); + if (!fp->in_req) +- goto err; ++ goto err_req; + + INFO(cdev, "USB CDC Phonet function\n"); + INFO(cdev, "using %s, OUT %s, IN %s\n", cdev->gadget->name, + fp->out_ep->name, fp->in_ep->name); + return 0; + ++err_req: ++ for (i = 0; i < phonet_rxq_size && fp->out_reqv[i]; i++) ++ usb_ep_free_request(fp->out_ep, fp->out_reqv[i]); + err: ++ + if (fp->out_ep) + fp->out_ep->driver_data = NULL; + if (fp->in_ep) diff --git a/queue-3.7/usb-gadget-tcm_usb_gadget-null-terminate-the-fs-descriptor-list.patch b/queue-3.7/usb-gadget-tcm_usb_gadget-null-terminate-the-fs-descriptor-list.patch new file mode 100644 index 00000000000..e647beb1e55 --- /dev/null +++ b/queue-3.7/usb-gadget-tcm_usb_gadget-null-terminate-the-fs-descriptor-list.patch @@ -0,0 +1,33 @@ +From fad8deb274edcef1c8ca38946338f5f4f8126fe2 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 22 Oct 2012 22:14:56 +0200 +Subject: usb: gadget: tcm_usb_gadget: NULL terminate the FS descriptor list + +From: Sebastian Andrzej Siewior + +commit fad8deb274edcef1c8ca38946338f5f4f8126fe2 upstream. + +The descriptor list for FS speed was not NULL terminated. This patch +fixes this. + +While here one of the twe two bAlternateSetting assignments for the BOT +interface. Both assign 0, one is enough. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/tcm_usb_gadget.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/gadget/tcm_usb_gadget.c ++++ b/drivers/usb/gadget/tcm_usb_gadget.c +@@ -2139,6 +2139,7 @@ static struct usb_descriptor_header *uas + (struct usb_descriptor_header *) &uasp_status_pipe_desc, + (struct usb_descriptor_header *) &uasp_fs_cmd_desc, + (struct usb_descriptor_header *) &uasp_cmd_pipe_desc, ++ NULL, + }; + + static struct usb_descriptor_header *uasp_hs_function_desc[] = { diff --git a/queue-3.7/usb-gadget-uvc-fix-error-path-in-uvc_function_bind.patch b/queue-3.7/usb-gadget-uvc-fix-error-path-in-uvc_function_bind.patch new file mode 100644 index 00000000000..b9e1083a37c --- /dev/null +++ b/queue-3.7/usb-gadget-uvc-fix-error-path-in-uvc_function_bind.patch @@ -0,0 +1,96 @@ +From 0f9df939385527049c8062a099fbfa1479fe7ce0 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 22 Oct 2012 22:15:05 +0200 +Subject: usb: gadget: uvc: fix error path in uvc_function_bind() + +From: Sebastian Andrzej Siewior + +commit 0f9df939385527049c8062a099fbfa1479fe7ce0 upstream. + +The "video->minor = -1" assigment is done in V4L2 by +video_register_device() so it is removed here. +Now. uvc_function_bind() calls in error case uvc_function_unbind() for +cleanup. The problem is that uvc_function_unbind() frees the uvc struct +and uvc_bind_config() does as well in error case of usb_add_function(). +Removing kfree() in usb_add_function() would make the patch smaller but +it would look odd because the new allocated memory is not cleaned up. +However it is not guaranteed that if we call usb_add_function() we also +get to the bind function. +Therefore the patch extracts the conditional cleanup from +uvc_function_unbind() applies to uvc_function_bind(). +uvc_function_unbind() now contains only the complete cleanup which is +required once everything has been registrated. + +Signed-off-by: Sebastian Andrzej Siewior +Cc: Laurent Pinchart +Cc: Bhupesh Sharma +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/f_uvc.c | 39 +++++++++++++++++++++------------------ + 1 file changed, 21 insertions(+), 18 deletions(-) + +--- a/drivers/usb/gadget/f_uvc.c ++++ b/drivers/usb/gadget/f_uvc.c +@@ -417,7 +417,6 @@ uvc_register_video(struct uvc_device *uv + return -ENOMEM; + + video->parent = &cdev->gadget->dev; +- video->minor = -1; + video->fops = &uvc_v4l2_fops; + video->release = video_device_release; + strncpy(video->name, cdev->gadget->name, sizeof(video->name)); +@@ -577,23 +576,12 @@ uvc_function_unbind(struct usb_configura + + INFO(cdev, "uvc_function_unbind\n"); + +- if (uvc->vdev) { +- if (uvc->vdev->minor == -1) +- video_device_release(uvc->vdev); +- else +- video_unregister_device(uvc->vdev); +- uvc->vdev = NULL; +- } +- +- if (uvc->control_ep) +- uvc->control_ep->driver_data = NULL; +- if (uvc->video.ep) +- uvc->video.ep->driver_data = NULL; ++ video_unregister_device(uvc->vdev); ++ uvc->control_ep->driver_data = NULL; ++ uvc->video.ep->driver_data = NULL; + +- if (uvc->control_req) { +- usb_ep_free_request(cdev->gadget->ep0, uvc->control_req); +- kfree(uvc->control_buf); +- } ++ usb_ep_free_request(cdev->gadget->ep0, uvc->control_req); ++ kfree(uvc->control_buf); + + kfree(f->descriptors); + kfree(f->hs_descriptors); +@@ -740,7 +728,22 @@ uvc_function_bind(struct usb_configurati + return 0; + + error: +- uvc_function_unbind(c, f); ++ if (uvc->vdev) ++ video_device_release(uvc->vdev); ++ ++ if (uvc->control_ep) ++ uvc->control_ep->driver_data = NULL; ++ if (uvc->video.ep) ++ uvc->video.ep->driver_data = NULL; ++ ++ if (uvc->control_req) { ++ usb_ep_free_request(cdev->gadget->ep0, uvc->control_req); ++ kfree(uvc->control_buf); ++ } ++ ++ kfree(f->descriptors); ++ kfree(f->hs_descriptors); ++ kfree(f->ss_descriptors); + return ret; + } + diff --git a/queue-3.7/virtio-9p-correctly-pass-physical-address-to-userspace-for-high-pages.patch b/queue-3.7/virtio-9p-correctly-pass-physical-address-to-userspace-for-high-pages.patch new file mode 100644 index 00000000000..5a444804a63 --- /dev/null +++ b/queue-3.7/virtio-9p-correctly-pass-physical-address-to-userspace-for-high-pages.patch @@ -0,0 +1,46 @@ +From b9cdc88df8e63e81c723b82c286fc97f5d0dc325 Mon Sep 17 00:00:00 2001 +From: Will Deacon +Date: Fri, 19 Oct 2012 14:03:32 +0100 +Subject: virtio: 9p: correctly pass physical address to userspace for high pages + +From: Will Deacon + +commit b9cdc88df8e63e81c723b82c286fc97f5d0dc325 upstream. + +When using a virtio transport, the 9p net device may pass the physical +address of a kernel buffer to userspace via a scatterlist inside a +virtqueue. If the kernel buffer is mapped outside of the linear mapping +(e.g. highmem), then virt_to_page will return a bogus value and we will +populate the scatterlist with junk. + +This patch uses kmap_to_page when populating the page array for a kernel +buffer. + +Signed-off-by: Will Deacon +Cc: Sasha Levin +Signed-off-by: Rusty Russell +Signed-off-by: Greg Kroah-Hartman + +--- + net/9p/trans_virtio.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/net/9p/trans_virtio.c ++++ b/net/9p/trans_virtio.c +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -325,7 +326,7 @@ static int p9_get_mapped_pages(struct vi + int count = nr_pages; + while (nr_pages) { + s = rest_of_page(data); +- pages[index++] = virt_to_page(data); ++ pages[index++] = kmap_to_page(data); + data += s; + nr_pages--; + } diff --git a/queue-3.7/virtio-force-vring-descriptors-to-be-allocated-from-lowmem.patch b/queue-3.7/virtio-force-vring-descriptors-to-be-allocated-from-lowmem.patch new file mode 100644 index 00000000000..2deb6859ae7 --- /dev/null +++ b/queue-3.7/virtio-force-vring-descriptors-to-be-allocated-from-lowmem.patch @@ -0,0 +1,45 @@ +From b92b1b89a33c172c075edccf6afb0edc41d851fd Mon Sep 17 00:00:00 2001 +From: Will Deacon +Date: Fri, 19 Oct 2012 14:03:33 +0100 +Subject: virtio: force vring descriptors to be allocated from lowmem + +From: Will Deacon + +commit b92b1b89a33c172c075edccf6afb0edc41d851fd upstream. + +Virtio devices may attempt to add descriptors to a virtqueue from atomic +context using GFP_ATOMIC allocation. This is problematic because such +allocations can fall outside of the lowmem mapping, causing virt_to_phys +to report bogus physical addresses which are subsequently passed to +userspace via the buffers for the virtual device. + +This patch masks out __GFP_HIGH and __GFP_HIGHMEM from the requested +flags when allocating descriptors for a virtqueue. If an atomic +allocation is requested and later fails, we will return -ENOSPC which +will be handled by the driver. + +Signed-off-by: Will Deacon +Cc: Sasha Levin +Signed-off-by: Rusty Russell +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/virtio/virtio_ring.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/virtio/virtio_ring.c ++++ b/drivers/virtio/virtio_ring.c +@@ -135,6 +135,13 @@ static int vring_add_indirect(struct vri + unsigned head; + int i; + ++ /* ++ * We require lowmem mappings for the descriptors because ++ * otherwise virt_to_phys will give us bogus addresses in the ++ * virtqueue. ++ */ ++ gfp &= ~(__GFP_HIGHMEM | __GFP_HIGH); ++ + desc = kmalloc((out + in) * sizeof(struct vring_desc), gfp); + if (!desc) + return -ENOMEM; diff --git a/queue-3.7/x86-8042-enable-a20-using-kbc-to-fix-s3-resume-on-some-msi-laptops.patch b/queue-3.7/x86-8042-enable-a20-using-kbc-to-fix-s3-resume-on-some-msi-laptops.patch new file mode 100644 index 00000000000..a4da853ef05 --- /dev/null +++ b/queue-3.7/x86-8042-enable-a20-using-kbc-to-fix-s3-resume-on-some-msi-laptops.patch @@ -0,0 +1,55 @@ +From ad68652412276f68ad4fe3e1ecf5ee6880876783 Mon Sep 17 00:00:00 2001 +From: Ondrej Zary +Date: Tue, 11 Dec 2012 22:18:05 +0100 +Subject: x86, 8042: Enable A20 using KBC to fix S3 resume on some MSI laptops + +From: Ondrej Zary + +commit ad68652412276f68ad4fe3e1ecf5ee6880876783 upstream. + +Some MSI laptop BIOSes are broken - INT 15h code uses port 92h to enable A20 +line but resume code assumes that KBC was used. +The laptop will not resume from S3 otherwise but powers off after a while +and then powers on again stuck with a blank screen. + +Fix it by enabling A20 using KBC in i8042_platform_init for x86. + +Fixes https://bugzilla.kernel.org/show_bug.cgi?id=12878 + +Signed-off-by: Ondrej Zary +Cc: Dmitry Torokhov +Cc: Alan Cox +Cc: Rafael J. Wysocki +Link: http://lkml.kernel.org/r/201212112218.06551.linux@rainbow-software.org +Signed-off-by: H. Peter Anvin +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/serio/i8042-x86ia64io.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/input/serio/i8042-x86ia64io.h ++++ b/drivers/input/serio/i8042-x86ia64io.h +@@ -921,6 +921,7 @@ static int __init i8042_platform_init(vo + int retval; + + #ifdef CONFIG_X86 ++ u8 a20_on = 0xdf; + /* Just return if pre-detection shows no i8042 controller exist */ + if (!x86_platform.i8042_detect()) + return -ENODEV; +@@ -960,6 +961,14 @@ static int __init i8042_platform_init(vo + + if (dmi_check_system(i8042_dmi_dritek_table)) + i8042_dritek = true; ++ ++ /* ++ * A20 was already enabled during early kernel init. But some buggy ++ * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to ++ * resume from S3. So we do it here and hope that nothing breaks. ++ */ ++ i8042_command(&a20_on, 0x10d1); ++ i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */ + #endif /* CONFIG_X86 */ + + return retval;