Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 845836 Details for
Bug 1047276
vgaswitcheroo not working on kernel 3.12
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch from https://lkml.org/lkml/2013/12/31/162 changed for kernel 3.12.6
linux-3.12.fc20-vgaswitcheroofix.patch (text/plain), 6.57 KB, created by
lapseofreason0
on 2014-01-05 21:56:36 UTC
(
hide
)
Description:
patch from https://lkml.org/lkml/2013/12/31/162 changed for kernel 3.12.6
Filename:
MIME Type:
Creator:
lapseofreason0
Created:
2014-01-05 21:56:36 UTC
Size:
6.57 KB
patch
obsolete
>diff -uNrp kernel-3.12.fc20.orig/linux-3.12.6-300.fc20.x86_64/drivers/acpi/bus.c kernel-3.12.fc20.new/linux-3.12.6-300.fc20.x86_64/drivers/acpi/bus.c >--- linux-3.12.6-300.fc20.x86_64/drivers/acpi/bus.c 2014-01-05 21:02:16.409717949 +0100 >+++ linux-3.12.6-300.fc20.x86_64/drivers/acpi/bus.c 2014-01-05 21:08:37.612615579 +0100 >@@ -156,6 +156,16 @@ int acpi_bus_get_private_data(acpi_handl > } > EXPORT_SYMBOL(acpi_bus_get_private_data); > >+void acpi_bus_no_hotplug(acpi_handle handle) >+{ >+ struct acpi_device *adev = NULL; >+ >+ acpi_bus_get_device(handle, &adev); >+ if (adev) >+ adev->flags.no_hotplug = true; >+} >+EXPORT_SYMBOL_GPL(acpi_bus_no_hotplug); >+ > static void acpi_print_osc_error(acpi_handle handle, > struct acpi_osc_context *context, char *error) > { >diff -uNrp kernel-3.12.fc20.orig/linux-3.12.6-300.fc20.x86_64/drivers/gpu/drm/nouveau/nouveau_acpi.c kernel-3.12.fc20.new/linux-3.12.6-300.fc20.x86_64/drivers/gpu/drm/nouveau/nouveau_acpi.c >--- linux-3.12.6-300.fc20.x86_64/drivers/gpu/drm/nouveau/nouveau_acpi.c 2014-01-05 21:02:15.060724686 +0100 >+++ linux-3.12.6-300.fc20.x86_64/drivers/gpu/drm/nouveau/nouveau_acpi.c 2014-01-05 21:34:29.695421895 +0100 >@@ -51,6 +51,7 @@ static struct nouveau_dsm_priv { > bool dsm_detected; > bool optimus_detected; > acpi_handle dhandle; >+ acpi_handle other_handle; > acpi_handle rom_handle; > } nouveau_dsm_priv; > >@@ -263,6 +264,7 @@ static int nouveau_dsm_pci_probe(struct > > status = acpi_get_handle(dhandle, "_DSM", &nvidia_handle); > if (ACPI_FAILURE(status)) { >+ nouveau_dsm_priv.other_handle = dhandle; > return false; > } > >@@ -331,6 +333,16 @@ static bool nouveau_dsm_detect(void) > printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n", > acpi_method_name); > nouveau_dsm_priv.dsm_detected = true; >+ /* >+ * On some systems hotplug events are generated for the device >+ * being switched off when _DSM is executed. They cause ACPI >+ * hotplug to trigger and attempt to remove the device from >+ * the system, which causes it to break down. Prevent that from >+ * happening by setting the no_hotplug flag for the involved >+ * ACPI device objects. >+ */ >+ acpi_bus_no_hotplug(nouveau_dsm_priv.dhandle); >+ acpi_bus_no_hotplug(nouveau_dsm_priv.other_handle); > ret = true; > } > >diff -uNrp kernel-3.12.fc20.orig/linux-3.12.6-300.fc20.x86_64/drivers/gpu/drm/radeon/radeon_atpx_handler.c kernel-3.12.fc20.new/linux-3.12.6-300.fc20.x86_64/drivers/gpu/drm/radeon/radeon_atpx_handler.c >--- linux-3.12.6-300.fc20.x86_64/drivers/gpu/drm/radeon/radeon_atpx_handler.c 2014-01-05 21:02:14.323728247 +0100 >+++ linux-3.12.6-300.fc20.x86_64/drivers/gpu/drm/radeon/radeon_atpx_handler.c 2014-01-05 21:08:37.610615602 +0100 >@@ -34,6 +34,7 @@ static struct radeon_atpx_priv { > bool atpx_detected; > /* handle for device - and atpx */ > acpi_handle dhandle; >+ acpi_handle other_handle; > struct radeon_atpx atpx; > } radeon_atpx_priv; > >@@ -448,9 +449,10 @@ static bool radeon_atpx_pci_probe_handle > return false; > > status = acpi_get_handle(dhandle, "ATPX", &atpx_handle); >- if (ACPI_FAILURE(status)) >+ if (ACPI_FAILURE(status)) { >+ radeon_atpx_priv.other_handle = dhandle; > return false; >- >+ } > radeon_atpx_priv.dhandle = dhandle; > radeon_atpx_priv.atpx.handle = atpx_handle; > return true; >@@ -527,6 +529,16 @@ static bool radeon_atpx_detect(void) > printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n", > acpi_method_name); > radeon_atpx_priv.atpx_detected = true; >+ /* >+ * On some systems hotplug events are generated for the device >+ * being switched off when ATPX is executed. They cause ACPI >+ * hotplug to trigger and attempt to remove the device from >+ * the system, which causes it to break down. Prevent that from >+ * happening by setting the no_hotplug flag for the involved >+ * ACPI device objects. >+ */ >+ acpi_bus_no_hotplug(radeon_atpx_priv.dhandle); >+ acpi_bus_no_hotplug(radeon_atpx_priv.other_handle); > return true; > } > return false; >diff -uNrp kernel-3.12.fc20.orig/linux-3.12.6-300.fc20.x86_64/drivers/pci/hotplug/acpiphp_glue.c kernel-3.12.fc20.new/linux-3.12.6-300.fc20.x86_64/drivers/pci/hotplug/acpiphp_glue.c >--- linux-3.12.6-300.fc20.x86_64/drivers/pci/hotplug/acpiphp_glue.c 2014-01-05 21:02:15.161724186 +0100 >+++ linux-3.12.6-300.fc20.x86_64/drivers/pci/hotplug/acpiphp_glue.c 2014-01-05 21:08:37.611615590 +0100 >@@ -643,6 +643,24 @@ static void disable_slot(struct acpiphp_ > slot->flags &= (~SLOT_ENABLED); > } > >+static bool acpiphp_no_hotplug(acpi_handle handle) >+{ >+ struct acpi_device *adev = NULL; >+ >+ acpi_bus_get_device(handle, &adev); >+ return adev && adev->flags.no_hotplug; >+} >+ >+static bool slot_no_hotplug(struct acpiphp_slot *slot) >+{ >+ struct acpiphp_func *func; >+ >+ list_for_each_entry(func, &slot->funcs, sibling) >+ if (acpiphp_no_hotplug(func_to_handle(func))) >+ return true; >+ >+ return false; >+} > > /** > * get_slot_status - get ACPI slot status >@@ -701,7 +719,8 @@ static void trim_stale_devices(struct pc > unsigned long long sta; > > status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); >- alive = ACPI_SUCCESS(status) && sta == ACPI_STA_ALL; >+ alive = (ACPI_SUCCESS(status) && sta == ACPI_STA_ALL) >+ || acpiphp_no_hotplug(handle); > } > if (!alive) { > u32 v; >@@ -741,8 +760,9 @@ static void acpiphp_check_bridge(struct > struct pci_dev *dev, *tmp; > > mutex_lock(&slot->crit_sect); >- /* wake up all functions */ >- if (get_slot_status(slot) == ACPI_STA_ALL) { >+ if (slot_no_hotplug(slot)) { >+ ; /* do nothing */ >+ } else if (get_slot_status(slot) == ACPI_STA_ALL) { > /* remove stale devices if any */ > list_for_each_entry_safe(dev, tmp, &bus->devices, > bus_list) >diff -uNrp kernel-3.12.fc20.orig/linux-3.12.6-300.fc20.x86_64/include/acpi/acpi_bus.h kernel-3.12.fc20.new/linux-3.12.6-300.fc20.x86_64/include/acpi/acpi_bus.h >--- linux-3.12.6-300.fc20.x86_64/include/acpi/acpi_bus.h 2014-01-05 21:02:19.754700264 +0100 >+++ linux-3.12.6-300.fc20.x86_64/include/acpi/acpi_bus.h 2014-01-05 21:08:37.611615590 +0100 >@@ -169,7 +169,8 @@ struct acpi_device_flags { > u32 ejectable:1; > u32 power_manageable:1; > u32 match_driver:1; >- u32 reserved:27; >+ u32 no_hotplug:1; >+ u32 reserved:26; > }; > > /* File System */ >@@ -357,6 +358,7 @@ extern struct kobject *acpi_kobj; > extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); > void acpi_bus_private_data_handler(acpi_handle, void *); > int acpi_bus_get_private_data(acpi_handle, void **); >+void acpi_bus_no_hotplug(acpi_handle handle); > extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); > extern int register_acpi_notifier(struct notifier_block *); > extern int unregister_acpi_notifier(struct notifier_block *);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1047276
: 845836