Skip to content

Commit f91ce35

Browse files
committed
ACPIPHP / radeon / nouveau: Remove acpi_bus_no_hotplug()
Revert parts of f244d8b ("ACPIPHP / radeon / nouveau: Fix VGA switcheroo problem related to hotplug"). A previous commit 5493b31f0b55 ("PCI: Add pci_ignore_hotplug() to ignore hotplug events for a device") added equivalent functionality implemented in a different way for both acpiphp and pciehp. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Dave Airlie <airlied@redhat.com> Acked-by: Rajat Jain <rajatxjain@gmail.com>
1 parent b440bde commit f91ce35

4 files changed

Lines changed: 5 additions & 41 deletions

File tree

‎drivers/acpi/bus.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,6 @@ void acpi_bus_detach_private_data(acpi_handle handle)
177177
}
178178
EXPORT_SYMBOL_GPL(acpi_bus_detach_private_data);
179179

180-
void acpi_bus_no_hotplug(acpi_handle handle)
181-
{
182-
struct acpi_device *adev = NULL;
183-
184-
acpi_bus_get_device(handle, &adev);
185-
if (adev)
186-
adev->flags.no_hotplug = true;
187-
}
188-
EXPORT_SYMBOL_GPL(acpi_bus_no_hotplug);
189-
190180
static void acpi_print_osc_error(acpi_handle handle,
191181
struct acpi_osc_context *context, char *error)
192182
{

‎drivers/gpu/drm/nouveau/nouveau_acpi.c‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ static struct nouveau_dsm_priv {
4646
bool dsm_detected;
4747
bool optimus_detected;
4848
acpi_handle dhandle;
49-
acpi_handle other_handle;
5049
acpi_handle rom_handle;
5150
} nouveau_dsm_priv;
5251

@@ -222,10 +221,9 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev)
222221
if (!dhandle)
223222
return false;
224223

225-
if (!acpi_has_method(dhandle, "_DSM")) {
226-
nouveau_dsm_priv.other_handle = dhandle;
224+
if (!acpi_has_method(dhandle, "_DSM"))
227225
return false;
228-
}
226+
229227
if (acpi_check_dsm(dhandle, nouveau_dsm_muid, 0x00000102,
230228
1 << NOUVEAU_DSM_POWER))
231229
retval |= NOUVEAU_DSM_HAS_MUX;
@@ -301,16 +299,6 @@ static bool nouveau_dsm_detect(void)
301299
printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n",
302300
acpi_method_name);
303301
nouveau_dsm_priv.dsm_detected = true;
304-
/*
305-
* On some systems hotplug events are generated for the device
306-
* being switched off when _DSM is executed. They cause ACPI
307-
* hotplug to trigger and attempt to remove the device from
308-
* the system, which causes it to break down. Prevent that from
309-
* happening by setting the no_hotplug flag for the involved
310-
* ACPI device objects.
311-
*/
312-
acpi_bus_no_hotplug(nouveau_dsm_priv.dhandle);
313-
acpi_bus_no_hotplug(nouveau_dsm_priv.other_handle);
314302
ret = true;
315303
}
316304

‎drivers/gpu/drm/radeon/radeon_atpx_handler.c‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ static struct radeon_atpx_priv {
3333
bool atpx_detected;
3434
/* handle for device - and atpx */
3535
acpi_handle dhandle;
36-
acpi_handle other_handle;
3736
struct radeon_atpx atpx;
3837
} radeon_atpx_priv;
3938

@@ -453,10 +452,9 @@ static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev)
453452
return false;
454453

455454
status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
456-
if (ACPI_FAILURE(status)) {
457-
radeon_atpx_priv.other_handle = dhandle;
455+
if (ACPI_FAILURE(status))
458456
return false;
459-
}
457+
460458
radeon_atpx_priv.dhandle = dhandle;
461459
radeon_atpx_priv.atpx.handle = atpx_handle;
462460
return true;
@@ -540,16 +538,6 @@ static bool radeon_atpx_detect(void)
540538
printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n",
541539
acpi_method_name);
542540
radeon_atpx_priv.atpx_detected = true;
543-
/*
544-
* On some systems hotplug events are generated for the device
545-
* being switched off when ATPX is executed. They cause ACPI
546-
* hotplug to trigger and attempt to remove the device from
547-
* the system, which causes it to break down. Prevent that from
548-
* happening by setting the no_hotplug flag for the involved
549-
* ACPI device objects.
550-
*/
551-
acpi_bus_no_hotplug(radeon_atpx_priv.dhandle);
552-
acpi_bus_no_hotplug(radeon_atpx_priv.other_handle);
553541
return true;
554542
}
555543
return false;

‎include/acpi/acpi_bus.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,9 @@ struct acpi_device_flags {
204204
u32 match_driver:1;
205205
u32 initialized:1;
206206
u32 visited:1;
207-
u32 no_hotplug:1;
208207
u32 hotplug_notify:1;
209208
u32 is_dock_station:1;
210-
u32 reserved:22;
209+
u32 reserved:23;
211210
};
212211

213212
/* File System */
@@ -412,7 +411,6 @@ void acpi_bus_private_data_handler(acpi_handle, void *);
412411
int acpi_bus_get_private_data(acpi_handle, void **);
413412
int acpi_bus_attach_private_data(acpi_handle, void *);
414413
void acpi_bus_detach_private_data(acpi_handle);
415-
void acpi_bus_no_hotplug(acpi_handle handle);
416414
extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32);
417415
extern int register_acpi_notifier(struct notifier_block *);
418416
extern int unregister_acpi_notifier(struct notifier_block *);

0 commit comments

Comments
 (0)