- 02 6月, 2013 2 次提交
-
-
由 Rafael J. Wysocki 提交于
As indicated by comments in mm/memory_hotplug.c:remove_memory(), if CONFIG_MEMCG is set, it may not be possible to offline all of the memory blocks held by one module (FRU) in one pass (because one of them may be used by the others to store page cgroup in that case and that block has to be offlined before the other ones). To handle that arguably corner case, add a second pass of companion device offlining to acpi_scan_hot_remove() and make it ignore errors returned in the first pass (and make it skip the second pass if the first one is successful). Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NToshi Kani <toshi.kani@hp.com>
-
由 Rafael J. Wysocki 提交于
The ACPI processor driver was the only user of the removal_type field in struct acpi_device, but it doesn't use that field any more after recent changes. Thus, removal_type has no more users, so drop it along with the associated data type. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NToshi Kani <toshi.kani@hp.com>
-
- 12 5月, 2013 2 次提交
-
-
由 Rafael J. Wysocki 提交于
Split the ACPI processor driver into two parts, one that is non-modular, resides in the ACPI core and handles the enumeration and hotplug of processors and one that implements the rest of the existing processor driver functionality. The non-modular part uses an ACPI scan handler object to enumerate processors on the basis of information provided by the ACPI namespace and to hook up with the common ACPI hotplug infrastructure. It also populates the ACPI handle of each processor device having a corresponding object in the ACPI namespace, which allows the driver proper to bind to those devices, and makes the driver bind to them if it is readily available (i.e. loaded) when the scan handler's .attach() routine is running. There are a few reasons to make this change. First, switching the ACPI processor driver to using the common ACPI hotplug infrastructure reduces code duplication and size considerably, even though a new file is created along with a header comment etc. Second, since the common hotplug code attempts to offline devices before starting the (non-reversible) removal procedure, it will abort (and possibly roll back) hot-remove operations involving processors if cpu_down() returns an error code for one of them instead of continuing them blindly (if /sys/firmware/acpi/hotplug/force_remove is unset). That is a more desirable behavior than what the current code does. Finally, the separation of the scan/hotplug part from the driver proper makes it possible to simplify the driver's .remove() routine, because it doesn't need to worry about the possible cleanup related to processor removal any more (the scan/hotplug part is responsible for that now) and can handle device removal and driver removal symmetricaly (i.e. as appropriate). Some user-visible changes in sysfs are made (for example, the 'sysdev' link from the ACPI device node to the processor device's directory is gone and a 'physical_node' link is present instead and a corresponding 'firmware_node' is present in the processor device's directory, the processor driver is now visible under /sys/bus/cpu/drivers/ and bound to the processor device), but that shouldn't affect the functionality that users care about (frequency scaling, C-states and thermal management). Tested on my venerable Toshiba Portege R500. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: NToshi Kani <toshi.kani@hp.com>
-
由 Rafael J. Wysocki 提交于
Modify the generic ACPI hotplug code to be able to check if devices scheduled for hot-removal may be gracefully removed from the system using the device offline/online mechanism introduced previously. Namely, make acpi_scan_hot_remove() handling device hot-removal call device_offline() for all physical companions of the ACPI device nodes involved in the operation and check the results. If any of the device_offline() calls fails, the function will not progress to the removal phase (which cannot be aborted), unless its (new) force argument is set (in case of a failing offline it will put the devices offlined by it back online). In support of 'forced' device hot-removal, add a new sysfs attribute 'force_remove' that will reside under /sys/firmware/acpi/hotplug/. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: NToshi Kani <toshi.kani@hp.com>
-
- 13 4月, 2013 1 次提交
-
-
由 Jiang Liu 提交于
Currently the pci_slot driver doesn't update PCI slot devices when PCI device hotplug event happens, which may cause memory leak and returning stale information to user. Now the pci_slot driver has been changed as built-in driver, so invoke PCI slot enumeration and destroy routines directly from the PCI core. And remove ACPI PCI sub-driver related code because it isn't needed any more. [bhelgas: removed "extern" from function declarations] Signed-off-by: NJiang Liu <jiang.liu@huawei.com> Signed-off-by: NYijing Wang <wangyijing@huawei.com> Signed-off-by: NBjorn Helgaas <bhelgaas@google.com> Reviewed-by: NYinghai Lu <yinghai@kernel.org> Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Toshi Kani <toshi.kani@hp.com>
-
- 25 3月, 2013 5 次提交
-
-
由 Toshi Kani 提交于
ACPI spec states that the OS evaluates _STA after calling _EJ0 in order to verify if eject was successful. Added a check to verify if the enabled bit of the status value is cleared after _EJ0. Note, the present bit is not checked since some FW implementations do not clear the present bit until the hardware is physically removed. Signed-off-by: NToshi Kani <toshi.kani@hp.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Toshi Kani 提交于
When the kernel calls _OSC with OSC_SB_HOTPLUG_OST_SUPPORT bit set at boot-time, the OS is responsible for calling _OST for ACPI hotplug events. However, when hotplug.enabled attribute is unset for ACPI scan drivers, their notify handlers are removed and _OST is not called for ACPI hotplug events as a result. This patch keeps the notify handler of ACPI scan drivers, acpi_hotplug_notify_cb(), installed regardless of the state of hotplug.enabled. The notify handler then checks if hotplug.enabled is set for the associated scan handler. If unset, the notify handler calls _OST with a proper error code. The patch also eliminates ACPI namespace walk when hotplug.enabled is changed via sysfs. Signed-off-by: NToshi Kani <toshi.kani@hp.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Toshi Kani 提交于
When installing/removing a notify handler to/from an ACPI device object, ACPI core tries to match its associated scan handler to see if it supports hotplug. However, the matching logic of the notify handler is different from the matching logic of attaching a scan handler to an ACPI device object. This patch updates the matching logic of the notify handlers to be consistent with the attach handling. Signed-off-by: NToshi Kani <toshi.kani@hp.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Toshi Kani 提交于
This patch introduces acpi_set_pnp_ids() and acpi_free_pnp_ids(), which are updated from acpi_device_set_id() and acpi_free_ids(), to setup and free acpi_device_pnp for a given acpi_handle. They can be called without acpi_device. Signed-off-by: NToshi Kani <toshi.kani@hp.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Toshi Kani 提交于
This patch updates the internal operations of acpi_device_set_id() to setup acpi_device_pnp without using acpi_device. There is no functional change to acpi_device_set_id() in this patch. acpi_pnp_type is added to acpi_device_pnp, so that PNPID type is self-contained within acpi_device_pnp. acpi_add_id(), acpi_bay_match(), acpi_dock_match(), acpi_ibm_smbus_match() and acpi_is_video_device() are changed to take acpi_handle as an argument, instead of acpi_device. Signed-off-by: NToshi Kani <toshi.kani@hp.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 22 3月, 2013 1 次提交
-
-
由 Rafael J. Wysocki 提交于
Devices on the Intel Lynxpoint Low Power Subsystem (LPSS) have some common features that aren't shared with any other platform devices, including the clock and LTR (Latency Tolerance Reporting) registers. It is better to handle those features in common code than to bother device drivers with doing that (I/O functionality-wise the LPSS devices are generally compatible with other devices that don't have those special registers and may be handled by the same drivers). The clock registers of the LPSS devices are now taken care of by the special clk-x86-lpss driver, but the MMIO mappings used for accessing those registers can also be used for accessing the LTR registers on those devices (LTR support for the Lynxpoint LPSS is going to be added by a subsequent patch). Thus it is convenient to add a special ACPI scan handler for the Lynxpoint LPSS devices that will create the MMIO mappings for accessing the clock (and LTR in the future) registers and will register the LPSS devices' clocks, so the clk-x86-lpss driver will only need to take care of the main Lynxpoint LPSS clock. Introduce a special ACPI scan handler for Intel Lynxpoint LPSS devices as described above. This also reduces overhead related to browsing the ACPI namespace in search of the LPSS devices before the registration of their clocks, removes some LPSS-specific (and somewhat ugly) code from acpi_platform.c and shrinks the overall code size slightly. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NMike Turquette <mturquette@linaro.org>
-
- 04 3月, 2013 5 次提交
-
-
由 Rafael J. Wysocki 提交于
Make the ACPI memory hotplug driver use struct acpi_scan_handler for representing the object used to set up ACPI memory hotplug functionality and to remove hotplug memory ranges and data structures used by the driver before unregistering ACPI device nodes representing memory. Register the new struct acpi_scan_handler object with the help of acpi_scan_add_handler_with_hotplug() to allow user space to manipulate the attributes of the memory hotplug profile. This results in a significant reduction of the drvier's code size and removes some ACPI hotplug code duplication. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NToshi Kani <toshi.kani@hp.com> Tested-by: NToshi Kani <toshi.kani@hp.com>
-
由 Rafael J. Wysocki 提交于
Introduce user space interface for manipulating hotplug profiles associated with ACPI scan handlers. The interface consists of sysfs directories under /sys/firmware/acpi/hotplug/, one for each hotplug profile, containing an attribute allowing user space to manipulate the enabled field of the corresponding profile. Namely, switching the enabled attribute from '0' to '1' will cause the common hotplug notify handler to be installed for all ACPI namespace objects representing devices matching the scan handler associated with the given hotplug profile (and analogously for the converse switch). Drivers willing to use the new user space interface should add their ACPI scan handlers with the help of new funtion acpi_scan_add_handler_with_hotplug(). Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NToshi Kani <toshi.kani@hp.com> Tested-by: NToshi Kani <toshi.kani@hp.com>
-
由 Rafael J. Wysocki 提交于
Introduce new helper routine acpi_scan_handler_matching() for checking if the given ACPI scan handler matches a given device ID and rework acpi_scan_match_handler() to use the new routine (that routine will also be useful for other purposes in the future). Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Acked-by: NToshi Kani <toshi.kani@hp.com> Tested-by: NToshi Kani <toshi.kani@hp.com>
-
由 Rafael J. Wysocki 提交于
Multiple drivers handling hotplug-capable ACPI device nodes install notify handlers covering the same types of events in a very similar way. Moreover, those handlers are installed in separate namespace walks, although that really should be done during namespace scans carried out by acpi_bus_scan(). This leads to substantial code duplication, unnecessary overhead and behavior that is hard to follow. For this reason, introduce common code in drivers/acpi/scan.c for handling hotplug-related notification and carrying out device insertion and eject operations in a generic fashion, such that it may be used by all of the relevant drivers in the future. To cover the existing differences between those drivers introduce struct acpi_hotplug_profile for representing collections of hotplug settings associated with different ACPI scan handlers that can be used by the drivers to make the common code reflect their current behavior. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NToshi Kani <toshi.kani@hp.com> Tested-by: NToshi Kani <toshi.kani@hp.com>
-
由 Rafael J. Wysocki 提交于
Introduce helper routine acpi_scan_match_handler() that will find the ACPI scan handler matching a given device ID, if there is one, and rework acpi_scan_attach_handler() to use the new routine (that routine will also be useful for other purposes going forward). Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Acked-by: NToshi Kani <toshi.kani@hp.com> Tested-by: NToshi Kani <toshi.kani@hp.com>
-
- 24 2月, 2013 1 次提交
-
-
由 Rafael J. Wysocki 提交于
Commit d2e5f0c1 (ACPI / PCI: Rework the setup and cleanup of device wakeup) moved the initial disabling of system wakeup for PCI devices into a place where it can actually work and that exposed a hidden old issue with crap^Wunusual system designs where the same power resources are used for both wakeup power and device power control at run time. Namely, say there is one power resource such that the ACPI power state D0 of a PCI device depends on that power resource (i.e. the device is in D0 when that power resource is "on") and it is used as a wakeup power resource for the same device. Then, calling acpi_pci_sleep_wake(pci_dev, false) for the device in question will cause the reference counter of that power resource to drop to 0, which in turn will cause it to be turned off. As a result, the device will go into D3cold at that point, although it should have stayed in D0. As it turns out, that happens to USB controllers on some laptops and USB becomes unusable on those machines as a result, which is a major regression from v3.8. To fix this problem, (1) increment the reference counters of wakup power resources during their initialization if they are "on" initially, (2) prevent acpi_disable_wakeup_device_power() from decrementing the reference counters of wakeup power resources that were not enabled for wakeup power previously, and (3) prevent acpi_enable_wakeup_device_power() from incrementing the reference counters of wakeup power resources that already are enabled for wakeup power. In addition to that, if it is impossible to determine the initial states of wakeup power resources, avoid enabling wakeup for devices whose wakeup power depends on those power resources. Reported-by: NDave Jones <davej@redhat.com> Reported-by: NFabio Baltieri <fabio.baltieri@linaro.org> Tested-by: NFabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 16 2月, 2013 1 次提交
-
-
由 Jiang Liu 提交于
As discussed in thread at https://patchwork.kernel.org/patch/1946851/, there's no value in supporting CONFIG_ACPI_PCI_SLOT=m any more. So change Kconfig and code to only support building pci_slot as built-in driver. Signed-off-by: NJiang Liu <jiang.liu@huawei.com> Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
-
- 13 2月, 2013 8 次提交
-
-
由 Rafael J. Wysocki 提交于
This changeset is aimed at fixing a few different but related problems in the ACPI hotplug infrastructure. First of all, since notify handlers may be run in parallel with acpi_bus_scan(), acpi_bus_trim() and acpi_bus_hot_remove_device() and some of them are installed for ACPI handles that have no struct acpi_device objects attached (i.e. before those objects are created), those notify handlers have to take acpi_scan_lock to prevent races from taking place (e.g. a struct acpi_device is found to be present for the given ACPI handle, but right after that it is removed by acpi_bus_trim() running in parallel to the given notify handler). Moreover, since some of them call acpi_bus_scan() and acpi_bus_trim(), this leads to the conclusion that acpi_scan_lock should be acquired by the callers of these two funtions rather by these functions themselves. For these reasons, make all notify handlers that can handle device addition and eject events take acpi_scan_lock and remove the acpi_scan_lock locking from acpi_bus_scan() and acpi_bus_trim(). Accordingly, update all of their users to make sure that they are always called under acpi_scan_lock. Furthermore, since eject operations are carried out asynchronously with respect to the notify events that trigger them, with the help of acpi_bus_hot_remove_device(), even if notify handlers take the ACPI scan lock, it still is possible that, for example, acpi_bus_trim() will run between acpi_bus_hot_remove_device() and the notify handler that scheduled its execution and that acpi_bus_trim() will remove the device node passed to acpi_bus_hot_remove_device() for ejection. In that case, the struct acpi_device object obtained by acpi_bus_hot_remove_device() will be invalid and not-so-funny things will ensue. To protect agaist that, make the users of acpi_bus_hot_remove_device() run get_device() on ACPI device node objects that are about to be passed to it and make acpi_bus_hot_remove_device() run put_device() on them and check if their ACPI handles are not NULL (make acpi_device_unregister() clear the device nodes' ACPI handles for that check to work). Finally, observe that acpi_os_hotplug_execute() actually can fail, in which case its caller ought to free memory allocated for the context object to prevent leaks from happening. It also needs to run put_device() on the device node that it ran get_device() on previously in that case. Modify the code accordingly. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYinghai Lu <yinghai@kernel.org>
-
由 Rafael J. Wysocki 提交于
In order to drop reference counts of all power resources used by an ACPI device node being removed, acpi_device_unregister() calls acpi_power_transition(device, ACPI_STATE_D3_COLD), which effectively transitions the device node into D3cold if it uses any power resources. However, for some device nodes it may not be appropriate to remove power from them entirely before putting them into D3hot before. On the other hand, executing _PS3 for devices that don't use power resources before removing them shouldn't really hurt. In fact, that is done by acpi_bus_hot_remove_device(), but this is not the right place to do it, because the bus trimming may have caused power to be removed from the device node in question already before. For these reasons, make acpi_device_unregister() carry out full power-off transition for all device nodes supporting that and remove the direct evaluation of _PS3 from acpi_bus_hot_remove_device(). Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Rafael J. Wysocki 提交于
The ACPI scan lock has been introduced to prevent acpi_bus_scan() and acpi_bus_trim() from running in parallel with each other for overlapping ACPI namespace scopes. However, it is not sufficient to do that, because if acpi_bus_scan() is run (for an overlapping namespace scope) right after the acpi_bus_trim() in acpi_bus_hot_remove_device(), the subsequent eject will remove devices without removing the corresponding struct acpi_device objects (and possibly companion "physical" device objects). Therefore acpi_bus_hot_remove_device() has to acquire the scan lock before carrying out the bus trimming and hold it through the evaluation of _EJ0, so make that happen. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NToshi Kani <toshi.kani@hp.com>
-
由 Rafael J. Wysocki 提交于
Make the ACPI container driver use struct acpi_scan_handler for representing the object used to initialize ACPI containers and remove the ACPI driver structure used previously and the data structures created by it, since in fact they were not used for any purpose. This simplifies the code and reduces the kernel's memory footprint by avoiding the registration of a struct device_driver object with the driver core and creation of its sysfs directory which is unnecessary. In addition to that, make the namespace walk callback used for installing the notify handlers for ACPI containers more straightforward. This change includes fixes from Toshi Kani. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYinghai Lu <yinghai@kernel.org> Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Tested-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Reviewed-by: NToshi Kani <toshi.kani@hp.com> Tested-by: NToshi Kani <toshi.kani@hp.com>
-
由 Rafael J. Wysocki 提交于
Since the FORCE_EJECT symbol is never defined, the #ifndef FORCE_EJECT in acpi_eject_store() is always true, so drop it. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Tested-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Reviewed-by: NToshi Kani <toshi.kani@hp.com> Tested-by: NToshi Kani <toshi.kani@hp.com>
-
由 Toshi Kani 提交于
When acpi_device_install_notify_handler() failed in acpi_device_probe(), it calls acpi_drv->ops.remove() and fails the probe. However, the ACPI driver is left bound to the acpi_device. Fix it by clearing the driver and driver_data fields. Signed-off-by: NToshi Kani <toshi.kani@hp.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Toshi Kani 提交于
Changed sysfs eject, acpi_eject_store(), so that it doesn't return error codes for devices nodes with ACPI scan handlers attached and no ACPI drivers. [rjw: Changelog] Signed-off-by: NToshi Kani <toshi.kani@hp.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Rafael J. Wysocki 提交于
The IDs of ACPI device nodes stored in their pnp.ids member arrays are sorted by decreasing priority (i.e. the highest-priority ID is the first entry). This means that when matching scan handlers to device nodes, the namespace scanning code should walk the list of scan handlers for each device node ID instead of walking the list of device node IDs for each handler (the latter causes the first handler matching any of the device node IDs to be chosen, although there may be another handler matching an ID of a higher priority which should be preferred). Make the code follow this observation. This change has been suggested and justified by Toshi Kani. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NToshi Kani <toshi.kani@hp.com>
-
- 02 2月, 2013 1 次提交
-
-
由 Rafael J. Wysocki 提交于
In general, for ACPI device power management to work, the initial power states of devices must be known (otherwise, we wouldn't be able to keep track of power resources, for example). Hence, if it is impossible to determine the initial ACPI power states of some devices, they can't be regarded as power-manageable using ACPI. For this reason, modify acpi_bus_get_power_flags() to clear the power_manageable flag if acpi_bus_init_power() fails and add some extra fallback code to acpi_bus_init_power() to cover broken BIOSes that provide _PS0/_PS3 without _PSC for some devices. Verified to work on my HP nx6325 that has this problem. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: NPeter Wu <lekensteyn@gmail.com>
-
- 01 2月, 2013 2 次提交
-
-
由 Rafael J. Wysocki 提交于
Make acpi_bus_get_parent() more straightforward and remove an unnecessary local variable ret from it. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Acked-by: NYinghai Lu <yinghai@kernel.org> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
-
由 Rafael J. Wysocki 提交于
Since acpi_bus_get_device() returns int and not acpi_status, change acpi_match_device() so that it doesn't apply ACPI_FAILURE() to the return value of acpi_bus_get_device(). Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Acked-by: NYinghai Lu <yinghai@kernel.org> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
-
- 30 1月, 2013 3 次提交
-
-
由 Rafael J. Wysocki 提交于
Currently, the ACPI namespace scanning code creates platform device objects for ACPI device nodes whose IDs match the contents of the acpi_platform_device_ids[] table. However, this adds a superfluous special case into acpi_bus_device_attach() and makes it more difficult to follow than it has to be. It also will make it more difficult to implement removal code for those platform device objects in the future. For the above reasons, introduce a struct acpi_scan_handler object for creating platform devices and move the code related to that from acpi_bus_device_attach() to the .attach() callback of that object. Also move the acpi_platform_device_ids[] table to acpi_platform.c. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYinghai Lu <yinghai@kernel.org> Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Acked-by: NToshi Kani <toshi.kani@hp.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
-
由 Rafael J. Wysocki 提交于
Make the ACPI PCI IRQ link driver use struct acpi_scan_handler for representing the object used to set up ACPI interrupt links and to remove data structures used for this purpose before unregistering the corresponding ACPI device nodes. This simplifies the code slightly and reduces the kernel's memory footprint by avoiding the registration of a struct device_driver object with the driver core and creation of its sysfs directory which is unnecessary. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYinghai Lu <yinghai@kernel.org> Acked-by: NToshi Kani <toshi.kani@hp.com>
-
由 Rafael J. Wysocki 提交于
Introduce struct acpi_scan_handler for representing objects that will do configuration tasks depending on ACPI device nodes' hardware IDs (HIDs). Currently, those tasks are done either directly by the ACPI namespace scanning code or by ACPI device drivers designed specifically for this purpose. None of the above is desirable, however, because doing that directly in the namespace scanning code makes that code overly complicated and difficult to follow and doing that in "special" device drivers leads to a great deal of confusion about their role and to confusing interactions with the driver core (for example, sysfs directories are created for those drivers, but they are completely unnecessary and only increase the kernel's memory footprint in vain). Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYinghai Lu <yinghai@kernel.org> Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Acked-by: NToshi Kani <toshi.kani@hp.com>
-
- 29 1月, 2013 1 次提交
-
-
由 Rafael J. Wysocki 提交于
Make acpi_bus_scan_fixed() use device_attach() directly to attach drivers, if any, to the fixed devices in analogy with how acpi_bus_scan() works, which allows the last argument of acpi_add_single_object() to be dropped and the manipulation of the flags.match_driver bit to be moved to acpi_init_device_object() and acpi_device_add_finalize(). After these changes all of the functions for the initialization and registration of struct acpi_device objects work in the same way for all of them. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYinghai Lu <yinghai@kernel.org>
-
- 28 1月, 2013 1 次提交
-
-
由 Rafael J. Wysocki 提交于
There is no guarantee that acpi_bus_scan() and acpi_bus_trim() will not be run in parallel for the same scope of the ACPI namespace, which may lead to a great deal of confusion, so introduce a new mutex to prevent that from happening. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYinghai Lu <yinghai@kernel.org>
-
- 26 1月, 2013 3 次提交
-
-
由 Rafael J. Wysocki 提交于
The second argument of ACPI driver .remove() operation is only used by the ACPI processor driver and the value passed to that driver through it is always available from the given struct acpi_device object's removal_type field. For this reason, the second ACPI driver .remove() argument is in fact useless, so drop it. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: NJiang Liu <jiang.liu@huawei.com> Acked-by: NToshi Kani <toshi.kani@hp.com> Acked-by: NYinghai Lu <yinghai@kernel.org>
-
由 Rafael J. Wysocki 提交于
Since acpi_bus_trim() cannot fail, change its definition to a void function, so that its callers don't check the return value in vain and update the callers. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NYinghai Lu <yinghai@kernel.org> Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Acked-by: NToshi Kani <toshi.kani@hp.com>
-
由 Yinghai Lu 提交于
The acpiphp driver is confusing because it contains partial support for PCI host bridge hotplug as well as support for hotplug of PCI devices. This patch moves the host bridge hot-add support to pci_root.c and adds hot-remove support in pci_root.c. How to test it: if sci_emu patch is applied, find out root bus number to ACPI root name mapping from dmesg or /sys. To remove root bus: echo "\_SB.PCIB 3" > /sys/kernel/debug/acpi/sci_notify To add back root bus: echo "\_SB.PCIB 1" > /sys/kernel/debug/acpi/sci_notify Signed-off-by: NYinghai Lu <yinghai@kernel.org> Signed-off-by: NBjorn Helgaas <bhelgaas@google.com> Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 24 1月, 2013 3 次提交
-
-
由 Rafael J. Wysocki 提交于
Since ACPI power resources are going to be used more extensively on new hardware platforms, it becomes necessary for user space (powertop in particular) to observe some properties of those resources for diagnostics purposes. For this reason, expose the current status of each ACPI power resource to user space via sysfs by adding a new resource_in_use attribute to the sysfs directory representing the given power resource. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Rafael J. Wysocki 提交于
Make it possible to retrieve the current power state of a device with ACPI power management from user space via sysfs by adding two new attributes, power_state and real_power_state, to the sysfs directory associated with the struct acpi_device object representing the device's ACPI node. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Rafael J. Wysocki 提交于
ACPI core adds sysfs device files after the given devices have been registered with device_register(), which is not appropriate, because it may lead to race conditions with user space tools using those files. Fix the problem by delaying the KOBJ_ADD uevent for ACPI devices until after all of the devices' sysfs files have been created. This also fixes a use-after-free in acpi_device_unregister(). Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-