View | Details | Raw Unified | Return to bug 61891 | Differences between
and this patch

Collapse All | Expand All

(-)linux-pm/drivers/gpu/drm/radeon/radeon_atpx_handler.c (-2 / +18 lines)
Lines 33-38 static struct radeon_atpx_priv { Link Here
33
	bool atpx_detected;
33
	bool atpx_detected;
34
	/* handle for device - and atpx */
34
	/* handle for device - and atpx */
35
	acpi_handle dhandle;
35
	acpi_handle dhandle;
36
	acpi_handle other_handle;
36
	struct radeon_atpx atpx;
37
	struct radeon_atpx atpx;
37
} radeon_atpx_priv;
38
} radeon_atpx_priv;
38
39
Lines 451-459 static bool radeon_atpx_pci_probe_handle Link Here
451
		return false;
452
		return false;
452
453
453
	status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
454
	status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
454
	if (ACPI_FAILURE(status))
455
	if (ACPI_FAILURE(status)) {
456
		radeon_atpx_priv.other_handle = dhandle;
455
		return false;
457
		return false;
456
458
	}
457
	radeon_atpx_priv.dhandle = dhandle;
459
	radeon_atpx_priv.dhandle = dhandle;
458
	radeon_atpx_priv.atpx.handle = atpx_handle;
460
	radeon_atpx_priv.atpx.handle = atpx_handle;
459
	return true;
461
	return true;
Lines 526-535 static bool radeon_atpx_detect(void) Link Here
526
	}
528
	}
527
529
528
	if (has_atpx && vga_count == 2) {
530
	if (has_atpx && vga_count == 2) {
531
		struct acpi_device *adev = NULL;
532
529
		acpi_get_name(radeon_atpx_priv.atpx.handle, ACPI_FULL_PATHNAME, &buffer);
533
		acpi_get_name(radeon_atpx_priv.atpx.handle, ACPI_FULL_PATHNAME, &buffer);
530
		printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n",
534
		printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n",
531
		       acpi_method_name);
535
		       acpi_method_name);
532
		radeon_atpx_priv.atpx_detected = true;
536
		radeon_atpx_priv.atpx_detected = true;
537
		/*
538
		 * On some systems hotplug events are generated for the device
539
		 * being switched off when ATPX is executed.  They cause ACPI
540
		 * hotplug to trigger and attempt to remove the device from
541
		 * the system, which causes it to break down.  Prevent that from
542
		 * happening by setting the no_hotplug flag for the ACPI device
543
		 * object in question.
544
		 */
545
		acpi_bus_get_device(radeon_atpx_priv.other_handle, &adev);
546
		if (adev)
547
			adev->flags.no_hotplug = true;
548
533
		return true;
549
		return true;
534
	}
550
	}
535
	return false;
551
	return false;
(-)linux-pm/include/acpi/acpi_bus.h (-1 / +2 lines)
Lines 169-175 struct acpi_device_flags { Link Here
169
	u32 ejectable:1;
169
	u32 ejectable:1;
170
	u32 power_manageable:1;
170
	u32 power_manageable:1;
171
	u32 match_driver:1;
171
	u32 match_driver:1;
172
	u32 reserved:27;
172
	u32 no_hotplug:1;
173
	u32 reserved:26;
173
};
174
};
174
175
175
/* File System */
176
/* File System */
(-)linux-pm/drivers/pci/hotplug/acpiphp_glue.c (-3 / +23 lines)
Lines 643-648 static void disable_slot(struct acpiphp_ Link Here
643
	slot->flags &= (~SLOT_ENABLED);
643
	slot->flags &= (~SLOT_ENABLED);
644
}
644
}
645
645
646
static bool acpiphp_no_hotplug(acpi_handle handle)
647
{
648
	struct acpi_device *adev = NULL;
649
650
	acpi_bus_get_device(handle, &adev);
651
	return adev && adev->flags.no_hotplug;
652
}
653
654
static bool slot_no_hotplug(struct acpiphp_slot *slot)
655
{
656
	struct acpiphp_func *func;
657
658
	list_for_each_entry(func, &slot->funcs, sibling)
659
		if (acpiphp_no_hotplug(func_to_handle(func)))
660
			return true;
661
662
	return false;
663
}
646
664
647
/**
665
/**
648
 * get_slot_status - get ACPI slot status
666
 * get_slot_status - get ACPI slot status
Lines 701-707 static void trim_stale_devices(struct pc Link Here
701
		unsigned long long sta;
719
		unsigned long long sta;
702
720
703
		status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
721
		status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
704
		alive = ACPI_SUCCESS(status) && sta == ACPI_STA_ALL;
722
		alive = (ACPI_SUCCESS(status) && sta == ACPI_STA_ALL)
723
			|| acpiphp_no_hotplug(handle);
705
	}
724
	}
706
	if (!alive) {
725
	if (!alive) {
707
		u32 v;
726
		u32 v;
Lines 741-748 static void acpiphp_check_bridge(struct Link Here
741
		struct pci_dev *dev, *tmp;
760
		struct pci_dev *dev, *tmp;
742
761
743
		mutex_lock(&slot->crit_sect);
762
		mutex_lock(&slot->crit_sect);
744
		/* wake up all functions */
763
		if (slot_no_hotplug(slot)) {
745
		if (get_slot_status(slot) == ACPI_STA_ALL) {
764
			; /* do nothing */
765
		} else if (get_slot_status(slot) == ACPI_STA_ALL) {
746
			/* remove stale devices if any */
766
			/* remove stale devices if any */
747
			list_for_each_entry_safe(dev, tmp, &bus->devices,
767
			list_for_each_entry_safe(dev, tmp, &bus->devices,
748
						 bus_list)
768
						 bus_list)

Return to bug 61891