summaryrefslogtreecommitdiff
path: root/drivers/acpi
AgeCommit message (Collapse)Author
2016-08-30ACPI / tables: fix acpi_parse_entries_array() so it traverses all subtablesAl Stone
The acpi_parse_entries_array() function currently returns the very first time there is any error found by one of the callback functions, or if one of the callbacks returns a non-zero value. However, the ACPI subtables being traversed could still have valid entries that could be used by one of the callback functions. And, if the comments are correct, that is what should happen -- always traverse all of the subtables, calling as many of the callbacks as possible. This patch makes the function consistent with its description so that it will properly invoke all callbacks for all matching entries, for all subtables, instead of stopping abruptly as it does today. This does change the semantics of using acpi_parse_entries_array(). In examining all users of the function, none of them rely on the current behavior; that is, there appears to be no assumption that either all subtables are traversed and all callbacks invoked, or that the function will return immediately on any error from a callback. Each callback operates independently. Hence, there should be no functional change due to this change in semantics. Future patches being prepared will rely on this new behavior; indeed, they were written assuming the acpi_parse_entries_array() function operated as its comments describe. For example, a callback that counts the number of subtables of a specific type can now be assured that as many subtables as possible have been enumerated. Signed-off-by: Al Stone <ahs3@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / tables: fix incorrect counts returned by acpi_parse_entries_array()Al Stone
The static function acpi_parse_entries_array() is provided an array of type struct acpi_subtable_proc that has a callback function and a count. The count should reflect how many times the callback has been called. However, the current code only increments the 0th element of the array, regardless of the number of entries in the array, or which callback has been invoked. The result is that we know the total number of callbacks made but we cannot determine which callbacks were made, nor how often. The fix is to index into the array of structs and increment the proper counts. There is one place in the x86 code for acpi_parse_madt_lapic_entries() where the counts for each callback are used. If no LAPICs *and* no X2APICs are found, an ENODEV is supposed to be returned; as it stands, the count of X2APICs will always be zero, regardless of what is in the MADT. Should there be no LAPICs, ENODEV will be returned in error, if there are X2APICs in the MADT. Otherwise, there are no other functional consequences of the count being done as it currently is; all other uses simply check that the return value from acpi_parse_entries_array() or passed back via its callers is either non-zero, an error, or in one case just ignored. In future patches, I will also need these counts to be correct; I need to count the number of instances of subtables of certain types within the MADT to determine whether or not an ACPI IORT is required or not, and report when it is not present when it should be. Signed-off-by: Al Stone <ahs3@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / LPSS: Provide build-in properties of the UARTHeikki Krogerus
The UART driver, dw8250.c, needs some details regarding the Designware UART. For ACPI enumerated devices the values are hard-coded, but since the driver also reads the values from device properties, providing them with build-in properties. This allows us to later remove the hard-coded values from the driver. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / APD: Provide build-in properties of the UARTHeikki Krogerus
The UART driver, dw8250.c, needs some details regarding the Designware UART. For ACPI enumerated devices the values are hard-coded, but since the driver also reads the values from device properties, providing them with build-in properties. This allows us to later remove the hard-coded values from the driver. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / button: Fix an issue in button.lid_init_state=ignore modeLv Zheng
On most platforms, _LID returning value, lid open/close events are all reliable, but there are exceptions. Some AML tables report wrong initial lid state [1], and some of them never report lid open state [2]. The usage model on such buggy platforms is: 1. The initial lid state returned from _LID is not reliable; 2. The lid open event is not reliable; 3. The lid close event is always reliable, used by the platform firmware to trigger OSPM power saving operations. This usage model is not compliant to the Linux SW_LID model as the Linux userspace is very strict to the reliability of the open events. In order not to trigger issues on such buggy platforms, the ACPI button driver currently implements a lid_init_state=open quirk to send additional "open" event after resuming. However, this is still not sufficient because: 1. Some special usage models (e.x., the dark resume scenario) cannot be supported by this mode. 2. If a "close" event is not used to trigger "suspend", then the subsequent "close" events cannot be seen by the userspace. So we need to stop sending the additional "open" event and switch the driver to lid_init_state=ignore mode and make sure the platform triggered events can be reliably delivered to the userspace. The userspace programs then can be changed to not to be strict to the "open" events on such buggy platforms. Why will the subsequent "close" events be lost? This is because the input layer automatically filters redundant events for switch events. Thus given that the buggy AML tables do not guarantee paired "open"/"close" events, the ACPI button driver currently is not able to guarantee that the platform triggered reliable events can be always be seen by the userspace via SW_LID. This patch adds a mechanism to insert lid events as a compensation for the platform triggered ones to form a complete event switches in order to make sure that the platform triggered events can always be reliably delivered to the userspace. This essentially guarantees that the platform triggered reliable "close" events will always be relibly delivered to the userspace. However this mechanism is not suitable for lid_init_state=open/method as it should not send the complement switch event for the unreliable initial lid state notification. 2 unreliable events can trigger unexpected behavior. Thus this patch only implements this mechanism for lid_init_state=ignore. Known issues: 1. Possible alternative approach This approach is based on the fact that Linux requires a switch event type for LID events. Another approach is to use key event type to implement ACPI lid events. With SW event type, since ACPI button driver inserts wrong lid events, there could be a potential issue that an "open" event issued from some AML update methods could result in a wrong "close" event to be delivered to the userspace. While using KEY event type, there is no such problem. However there may not be such a kind of real case, and if there is such a case, it is worked around in this patch as the complement switch event is only generated for "close" event in order to deliver the reliable "close" event to the userspace. Link: https://bugzilla.kernel.org/show_bug.cgi?id=89211 # [1] Link: https://bugzilla.kernel.org/show_bug.cgi?id=106151 # [1] Link: https://bugzilla.kernel.org/show_bug.cgi?id=106941 # [2] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / CPPC: check for error bit in PCC status fieldPrakash, Prashanth
PCC status field exposes an error bit(2) to indicate any errors during the execution of last comamnd. This patch checks the error bit before notifying success/failure to the cpufreq driver. Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / CPPC: move all PCC related information into pcc_dataPrakash, Prashanth
There are several global variables in cppc driver that are related to PCC channel used for CPPC. This patch collects all such information into a single consolidated structure(cppc_pcc_data). Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / CPPC: add sysfs support to compute delivered performanceAshwin Chaugule
The CPPC tables contain entries for per CPU feedback counters which allows us to compute the delivered performance over a given interval of time. The math for delivered performance per the CPPCv5.0+ spec is: reference perf * delta(delivered perf ctr)/delta(ref perf ctr) Maintaining deltas of the counters in the kernel is messy, as it depends on when the reads are triggered. (e.g. via the cpufreq ->get() interface). Also the ->get() interace only returns one value, so cant return raw values. So instead, leave it to userspace to keep track of raw values and do its math for CPUs it cares about. delivered and reference perf counters are exposed via the same sysfs file to avoid the potential "skid", if these values are read individually from userspace. Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / CPPC: set a non-zero value for transition_latencyPrakash, Prashanth
Compute the expected transition latency for frequency transitions using the values from the PCCT tables when the desired perf register is in PCC. Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Reviewed-by: Alexey Klimov <alexey.klimov@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / CPPC: support for batching CPPC requestsPrakash, Prashanth
CPPC defined in section 8.4.7 of ACPI 6.0 specification suggests "To amortize the cost of PCC transactions, OSPM should read or write all PCC registers via a single read or write command when possible" This patch enables opportunistic batching of frequency transition requests whenever the request happen to overlap in time. Currently the access to pcc is serialized by a spin lock which does not scale well as we increase the number of cores in the system. This patch improves the scalability by allowing the differnt CPU cores to update PCC subspace in parallel and by batching requests which will reduce the certain types of operation(checking command completion bit, ringing doorbell) by a significant margin. Profiling shows significant improvement in the overall effeciency to service freq. transition requests. With this patch we observe close to 30% of the frequency transition requests being batched with other requests while running apache bench on a ARM platform with 6 independent domains(or sets of related cpus). Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / CPPC: acquire pcc_lock only while accessing PCC subspacePrakash, Prashanth
We need to acquire pcc_lock only when we are accessing registers that are in the PCC subspsace. Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / CPPC: restructure read/writes for efficient sys mapped reg opsAshwin Chaugule
For cases where sys mapped CPC registers need to be accessed frequently, it helps immensly to pre-map them rather than map and unmap for each operation. e.g. case where feedback counters are sys mem map registers. Restructure cpc_read/write and the cpc_regs structure to allow pre-mapping the system addresses and unmap them when the CPU exits. Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org> Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / battery: Add sysfs representation after checking _BSTCarlos Garnacho
Thus move sysfs_add_battery() after acpi_battery_get_state(), which doesn't require the power_supply. Prevents possible hanged tasks if acpi_battery_get_state() fails consistently (and takes a long time in doing so) when called inside acpi_battery_add(). In this situation the battery module first calls sysfs_add_battery(), which creates a power_supply, which spawns an async power_supply_deferred_register_work() task, which shall try to hold the parent battery device mutex (being already held) so this register work is set up after device initialization. If initialization takes long enough the thread will be eventually run and try to hold the mutex before acpi_battery_add() had the chance to finish. Eventually the 5 retries in acpi_battery_update_retry() fail, the error state is propagated, and results in sysfs_remove_battery() being called within the error handling paths of acpi_battery_add(), and the power_supply tear down too. This triggers a cancel_delayed_work_sync() of the deferred_register_work task, which ends up in schedule(). The end result is that the deferred task is blocked trying to acquire the parent device mutex, which is not released because the thread doing initialization (and failure handling) went to sleep awaiting for the deferred task to be cancelled. The hanged tasks look like this: INFO: task kworker/u8:0:6 blocked for more than 120 seconds. ... Call Trace: [<ffffffff815daec5>] schedule+0x35/0x80 [<ffffffff815dda3c>] schedule_timeout+0x1ec/0x250 [<ffffffff810a0572>] ? check_preempt_curr+0x52/0x90 [<ffffffff810a05c9>] ? ttwu_do_wakeup+0x19/0xe0 [<ffffffff815db915>] wait_for_common+0xc5/0x190 [<ffffffff810a1500>] ? wake_up_q+0x70/0x70 [<ffffffff815db9fd>] wait_for_completion+0x1d/0x20 [<ffffffff8108ffb1>] flush_work+0x111/0x1c0 [<ffffffff8108dfe0>] ? flush_workqueue_prep_pwqs+0x1a0/0x1a0 [<ffffffff810909af>] __cancel_work_timer+0x9f/0x1d0 [<ffffffff81090b13>] cancel_delayed_work_sync+0x13/0x20 [<ffffffff8147ac67>] power_supply_unregister+0x37/0xc0 [<ffffffffa058b03d>] sysfs_remove_battery+0x3d/0x52 [battery] [<ffffffffa058bf3a>] acpi_battery_add+0x112/0x181 [battery] [<ffffffff81366db6>] acpi_device_probe+0x54/0x19b [<ffffffff81427e9c>] driver_probe_device+0x22c/0x440 [<ffffffff81428181>] __driver_attach+0xd1/0xf0 [<ffffffff814280b0>] ? driver_probe_device+0x440/0x440 [<ffffffff8142591c>] bus_for_each_dev+0x6c/0xc0 [<ffffffff8142758e>] driver_attach+0x1e/0x20 [<ffffffff81426fc3>] bus_add_driver+0x1c3/0x280 [<ffffffff81428b00>] driver_register+0x60/0xe0 [<ffffffff81366c80>] acpi_bus_register_driver+0x3b/0x43 [<ffffffffa0591040>] acpi_battery_init_async+0x1c/0x1e [battery] [<ffffffff81099268>] async_run_entry_fn+0x48/0x150 [<ffffffff81090d09>] process_one_work+0x1e9/0x440 [<ffffffff81090fab>] worker_thread+0x4b/0x4f0 [<ffffffff81090f60>] ? process_one_work+0x440/0x440 [<ffffffff81096b58>] kthread+0xd8/0xf0 [<ffffffff815de97f>] ret_from_fork+0x1f/0x40 [<ffffffff81096a80>] ? kthread_worker_fn+0x180/0x180 INFO: task kworker/u8:4:282 blocked for more than 120 seconds. ... Call Trace: [<ffffffff810ad745>] ? put_prev_entity+0x35/0x8b0 [<ffffffff815daec5>] schedule+0x35/0x80 [<ffffffff815db14e>] schedule_preempt_disabled+0xe/0x10 [<ffffffff815dc533>] __mutex_lock_slowpath+0xb3/0x120 [<ffffffff815dc5bf>] mutex_lock+0x1f/0x30 [<ffffffff8147a59b>] power_supply_deferred_register_work+0x2b/0x50 [<ffffffff81090d09>] process_one_work+0x1e9/0x440 [<ffffffff81090fab>] worker_thread+0x4b/0x4f0 [<ffffffff81090f60>] ? process_one_work+0x440/0x440 [<ffffffff81090f60>] ? process_one_work+0x440/0x440 [<ffffffff81096b58>] kthread+0xd8/0xf0 [<ffffffff815de97f>] ret_from_fork+0x1f/0x40 [<ffffffff81096a80>] ? kthread_worker_fn+0x180/0x180 Making sysfs_add_battery() the last operation here means that the power_supply won't be created yet when the acpi_add_battery() failure handling happens, the deferred task won't even spawn, and sysfs_remove_battery will just skip over the NULL battery->bat. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / EC: Enable event freeze mode to improve event handling for suspend ↵Lv Zheng
process This patch enables the event freeze mode, flushing the EC event handling in .suspend() callback. This feature is experimental, if it is bisected out to be the cause of the real issues, please report the issues to the kernel bugzilla for further root causing and improvement. This mode eliminates useless _Qxx handling during the power saving operations, thus can help to tune the power saving operations faster. Tests show that this mode can efficiently block flooding _Qxx during the suspend process and tune the speed of the suspend faster. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Tested-by: Todd E Brandt <todd.e.brandt@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / EC: Add PM operations to improve event handling for suspend processLv Zheng
In the original EC driver, though the event handling is not explicitly stopped, the EC driver is actually not able to handle events during the noirq stage as the EC driver is not prepared to handle the EC events in the polling mode. So if there is no advance_transaction() triggered, the EC driver couldn't notice the EC events. However, do we actually need to handle EC events during suspend/resume stage? EC events are mostly useless for the suspend/resume period (key strokes and battery/thermal updates, etc.,), and the useful ones (lid close, power/sleep button press) should have already been delivered to the OSPM to trigger the power saving operations. Thus this patch implements acpi_ec_disable_event() to be a reverse call of acpi_ec_enable_event(), with which, the EC driver is able to stop handling the EC events in a position before entering the noirq stage. Since there are actually 2 choices for us: 1. implement event handling in polling mode; 2. stop event handling before entering noirq stage. And this patch only implements the second choice using .suspend() callback. Thus this is experimental (first choice is better? or different hook position is better?). This patch finally keeps the old behavior by default and prepares a boot parameter to enable this feature. The differences of the event handling availability between the old behavior (this patch is not applied) and the new behavior (this patch is applied) are as follows: !FreezeEvents FreezeEvents before suspend Y Y suspend before EC Y Y suspend after EC Y N suspend_late Y N suspend_noirq Y (actually N) N resume_noirq Y (actually N) N resume_late Y (actually N) N resume before EC Y (actually N) N resume after EC Y Y after resume Y Y Where "actually N" means if there is no EC transactions, the EC driver is actually not able to notice the pending events. We can see that FreezeEvents is the only approach now can actually flush the EC event handling with both query commands and _Qxx evaluations flushed, other modes can only flush the EC event handling with only query commands flushed, _Qxx evaluations occurred after stopping the EC driver may end up failure due to the failure of the EC transaction carried out in the _Qxx control methods. We also can see that this feature should be able to trigger some platform notifications later than resuming other drivers. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Tested-by: Todd E Brandt <todd.e.brandt@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / EC: Add PM operations to improve event handling for resume processLv Zheng
This patch makes 2 changes: 1. Restore old behavior Originally, EC driver stops handling both events and transactions in acpi_ec_block_transactions(), and restarts to handle transactions in acpi_ec_unblock_transactions_early(), restarts to handle both events and transactions in acpi_ec_unblock_transactions(). While currently, EC driver still stops handling both events and transactions in acpi_ec_block_transactions(), but restarts to handle both events and transactions in acpi_ec_unblock_transactions_early(). This patch tries to restore the old behavior by dropping __acpi_ec_enable_event() from acpi_unblock_transactions_early(). 2. Improve old behavior However this still cannot fix the real issue as both of the acpi_ec_unblock_xxx() functions are invoked in the noirq stage. Since the EC driver actually doesn't implement the event handling in the polling mode, re-enabling the event handling too early in the noirq stage could result in the problem that if there is no triggering source causing advance_transaction() to be invoked, pending SCI_EVT cannot be detected by the EC driver and _Qxx cannot be triggered. It actually makes sense to restart the event handling in any point during resuming after the noirq stage. Just like the boot stage where the event handling is enabled in .add(), this patch further moves acpi_ec_enable_event() to .resume(). After doing that, the following 2 functions can be combined: acpi_ec_unblock_transactions_early()/acpi_ec_unblock_transactions(). The differences of the event handling availability between the old behavior (this patch isn't applied) and the new behavior (this patch is applied) are as follows: !Applied Applied before suspend Y Y suspend before EC Y Y suspend after EC Y Y suspend_late Y Y suspend_noirq Y (actually N) Y (actually N) resume_noirq Y (actually N) Y (actually N) resume_late Y (actually N) Y (actually N) resume before EC Y (actually N) Y (actually N) resume after EC Y (actually N) Y after resume Y (actually N) Y Where "actually N" means if there is no triggering source, the EC driver is actually not able to notice the pending SCI_EVT occurred in the noirq stage. So we can clearly see that this patch has improved the situation. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Tested-by: Todd E Brandt <todd.e.brandt@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / EC: Fix an issue that SCI_EVT cannot be detected after event is enabledLv Zheng
After enabling the EC event handling, Linux is still in the noirq stage, if there is no triggering source (EC transaction, GPE STS status), advance_transaction() will not be invoked and SCI_EVT cannot be detected. This patch adds one more triggering source after enabling the EC event handling to poll the pending SCI_EVT. Known issues: 1. Still no SCI_EVT triggering source There could still be no SCI_EVT triggering source after handling the first SCI_EVT (polled by this patch if any). Because after handling the first SCI_EVT, Linux could still be in noirq stage and there could still be no further triggering source in this stage. Then the second SCI_EVT indicated during this stage still cannot be detected by the EC driver. With this improvement applied, it is then possible to move acpi_ec_enable_event() out of the noirq stage to fix this issue (if the first SCI_EVT is handled out of the noirq stage, the follow-up SCI_EVTs should be able to trigger IRQs). Signed-off-by: Lv Zheng <lv.zheng@intel.com> Tested-by: Todd E Brandt <todd.e.brandt@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / EC: Add EC_FLAGS_QUERY_ENABLED to reveal a hidden logicLv Zheng
There is a hidden logic in the EC driver: 1. During boot, EC_FLAGS_QUERY_PENDING is responsible for blocking event handling; 2. During suspend, EC_FLAGS_STARTED is responsible for blocking event handling. This patch uses a new EC_FLAGS_QUERY_ENABLED flag to make this hidden logic explicit and have code cleaned up. No functional change. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Tested-by: Todd E Brandt <todd.e.brandt@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-30ACPI / bus: Make acpi_get_first_physical_node() publicLukas Wunner
Following the fwnode of a device is currently a one-way road: We provide ACPI_COMPANION() to obtain the fwnode but there's no (public) method to do the reverse. Granted, there may be multiple physical_nodes, but often the first one in the list is sufficient. A handy function to obtain it was introduced with commit 3b95bd160547 ("ACPI: introduce a function to find the first physical device"), but currently it's only available internally. We're about to add an EFI Device Path parser which needs this function. Consider the following device path: ACPI(PNP0A03,0)/PCI(28,2)/PCI(0,0) The PCI root is encoded as an ACPI device in the path, so the parser has to find the corresponding ACPI device, then find its physical node, find the PCI bridge in slot 1c (decimal 28), function 2 below it and finally find the PCI device in slot 0, function 0. To this end, make acpi_get_first_physical_node() public. Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-17ACPI / APD: Add device HID for Vulcan SPI controllerKamlakant Patel
Add device HID for SPI controller on Broadcom Vulcan ARM64. The default frequency for SPI on Vulcan is 133MHz. Signed-off-by: Kamlakant Patel <kamlakant.patel@broadcom.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-17ACPI / EC: Add PM operations for suspend/resume noirq stageLv Zheng
It is reported that on some platforms, resume speed is not fast. The cause is: in noirq stage, EC driver is working in polling mode, and each state machine advancement requires a context switch. The context switch is not necessary to the EC driver's polling mode. This patch implements PM hooks to automatically switch the driver to/from the busy polling mode to eliminate the overhead caused by the context switch. This finally contributes to the tuning result: acpi_pm_finish() execution time is improved from 192ms to 6ms. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Reported-and-tested-by: Todd E Brandt <todd.e.brandt@linux.intel.com> [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-17ACPI / sysfs: Use new GPE masking mechanism in GPE interfaceLv Zheng
Now GPE can be masked via the new acpi_mask_gpe() API and this patch modifies /sys/firmware/acpi/interrupts/gpexx to use this new facility. Writes "mask/unmask" to this file now invokes acpi_mask_gpe(). Reads from this file now returns new "EN/STS" when the corresponding GPE hardware register's EN/STS bits are flagged, and new "masked/unmasked" attribute to indicate the status of the masking mechanism. Signed-off-by: Lv Zheng <lv.zheng@intel.com> [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Applications: Fix a potential issue that help messages may be dumped ↵Lv Zheng
to acpi_gbl_debug_file ACPICA commit d1b7372c7eb89cdba3d3c239fb07e2fdc5abf880 This is a regression fix, restoring usage macro to its original implementation. There is an issue for usage macros, if an command line option changed acpi_gbl_debug_file, then the follow up usage message may be errornously dumped to the debug file. This is just a bug in theory, because currently acpi_gbl_debug_file can only be modified by acpibin and acpiexec. And this will not trigger such issue because: 1. For acpibin, acpi_gbl_debug_file will be modified by "-t" option and the program exits after processing this option without dumping help message or other error options. 2. For acpiexec, acpi_gbl_debug_file will only be modified by the open command, which happens after parsing the command line options, so no help message will be dumped into the debug file. But maintaining this logic is difficult, so this patch modifies acpi_os_printf() into printf() for usage macros so that the help messages are ensured to be dumped to the stdout. Lv Zheng. Link: https://github.com/acpica/acpica/commit/d1b7372c Link: https://bugs.acpica.org/show_bug.cgi?id=1142 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Clib: Eliminate acpi_os_XXXFile()/acpi_log_error and link clibrary ↵Lv Zheng
fxxx()/errno/perror() instead ACPICA commit 189429fb7d06cdb89043ae32d615faf553467f1d This patch follows new ACPICA design, eliminates old portable OSLs, and implements fopen/fread/fwrite/fclose/fseek/ftell for GNU EFI environment. This patch also eliminates acpi_log_error(), convering them into fprintf(stderr)/perror(). Lv Zheng. Link: https://github.com/acpica/acpica/commit/189429fb Link: https://bugs.acpica.org/show_bug.cgi?id=1302 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Clib: Add -nostdinc support for EFI layerLv Zheng
ACPICA commit d261d40ea168f8e4c4e3986de720b8651c4aba1c This patch adds sprintf()/snprintf()/vsnprintf()/printf()/vfprintf() support for OSPMs that have ACPI_USE_SYSTEM_CLIBRARY defined but do not have ACPI_USE_STANDARD_HEADERS defined. -iwithprefix include is required to include <stdarg.h> which contains compiler specific implementation of vargs when -nostdinc is specified. -fno-builtin is required for GCC to avoid optimization performed printf(). This optimization cannot be automatically disabled by specifying -nostdlib. Please refer to the first link below for the details. However, the build option changes do not affect Linux kernel builds and are not included. Lv Zheng. Link: http://www.ciselant.de/projects/gcc_printf/gcc_printf.html Link: https://github.com/acpica/acpica/commit/d261d40e Link: https://bugs.acpica.org/show_bug.cgi?id=1302 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: MSVC9: Fix <sys/stat.h> inclusion order issueLv Zheng
ACPICA commit 9bb265c2afb9910e46f820d6759648580edabd09 When /Za is specified, headers of some Windows SDKs contain bugs breaking VC builds, and MSVC9's default SDK is one of such header-buggy library. In order to solve this issue, many VC developers stop using /Za. However we've been asked to have this fixed without removing /Za. In MSVC9 default SDK, this issue can be fixed by restricting <sys/stat.h> to be the last standard file included by every source file in the projects. This patch thus moves <sys/stat.h> inclusion to "acapps.h", so that this issue can be fixed by ensuring that "acapps.h" is always the last standard file included by all of the ACPICA source files. This is in fact also a useful cleanup because applications can only include one header (e.x., acpidump.h) instead of including acapps.h separately. Lv Zheng. Except some harmless header inclusion re-ordering, Linux kernel is not affected by this change. Link: https://github.com/acpica/acpica/commit/9bb265c2 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Clib/EFI: Fix wrong order of standard integer types/IO handlesLv Zheng
ACPICA commit 7f9b359b7c78c69b07f62eb2d58f710c351fd75d EFI header should use standard C library stuffs (integer types and IO handles) rather than implementing such standard stuffs. This patch fixes this issue by: 1. Implementing standard integer types for ACPI_USE_STANDARD_HADERS=n; 2. Defining EFI types using standard integer types and standard IO handles; 3. Tuning header inclusion order and environment definition order; 4. Removing wrong standard header inclusion from ACPICA core files; 5. Moving several application headers from acpidump.h to acenv.h. This patch corrects some of them. Lv Zheng. Except some harmless header inclusion re-ordering, Linux kernel is not affected by this change. Link: https://github.com/acpica/acpica/commit/7f9b359b Link: https://bugs.acpica.org/show_bug.cgi?id=1300 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: OSL: Add correct acpi_gbl_debug_timeout export to allow acpiexec to linkLv Zheng
ACPICA commit 408198c8c9786f9f104ee925020c3ab1701906e4 The acpi_gbl_debug_timeout which is used by acpiexec -et option now is only implemented in oswinxf.c and used for WIN32 builds. This makes it very difficult to remember that we need to add this variable to other os specific layer files in order for linking. This patch makes it a global option dependent on ACPI_APPLICATION so that it can always be linked by the applications. Lv Zheng. Link: https://github.com/acpica/acpica/commit/408198c8 Link: https://bugs.acpica.org/show_bug.cgi?id=1295 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Debugger: Fix wrong inclusions in dbfileio.cLv Zheng
ACPICA commit 649eb441fbef21965d10a1aca6ff41dcf23f8e05 dbfileio.c implements debugger functionalities that can only be used by the application layer debugger (acpiexec), thus it should always include <acapps.h> and thus shouldn't include <stdio.h> separately. Lv Zheng. Link: https://github.com/acpica/acpica/commit/649eb441 Link: https://bugs.acpica.org/show_bug.cgi?id=1292 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: FADT support cleanupBob Moore
ACPICA commit 34ccd43af3fd1870fddfac0617dd0ba706963558 Remove all vestiges of the version 2 FADT which never was included in the ACPI specification. This enabled significant cleanup of both the data table compiler and the disassembler. Added many clarification comments to associate each FADT version with the version of the ACPI spec where it was originally defined. Link: https://github.com/acpica/acpica/commit/34ccd43a Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Events: Introduce acpi_mask_gpe() to implement GPE masking mechanismLv Zheng
ACPICA commit 23a417ca406a527e7ae1710893e59a8b6db30e14 There is a facility in Linux, developers can control the enabling/disabling of a GPE via /sys/firmware/acpi/interrupts/gpexx. This is mainly for debugging purposes. But many users expect to use this facility to implement quirks to mask a specific GPE when there is a gap in Linux causing this GPE to flood. This is not working correctly because currently this facility invokes enabling/disabling counting based GPE driver APIs: acpi_enable_gpe()/acpi_disable_gpe() and the GPE drivers can still affect the count to mess up the GPE masking purposes. However, most of the IRQ chip designs allow masking/unmasking IRQs via a masking bit which is different from the enabled bit to achieve the same purpose. But the GPE hardware doesn't contain such a feature, this brings the trouble. In this patch, we introduce a software mechanism to implement the GPE masking feature, and acpi_mask_gpe() are provided to the OSPMs to mask/unmask GPEs in the above mentioned situation instead of acpi_enable_gpe()/acpi_disable_gpe(). ACPICA BZ 1102. Lv Zheng. Link: https://github.com/acpica/acpica/commit/23a417ca Link: https://bugs.acpica.org/show_bug.cgi?id=1102 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Use os_allocate_zeroedBob Moore
ACPICA commit 2b896c59e53243c95600f2a3f7e1fd02c044cb37 Eliminates an unnecessary memset. Suggested-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Link: https://github.com/acpica/acpica/commit/2b896c59 Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Divergence: Port declarators back to ACPICALv Zheng
ACPICA commit c160cae765412f5736cf88a9ebcc6138aa761a48 Linux uses asmlinkage and sparse macros to mark function symbols. This leads to the divergences between the Linux and the ACPICA. This patch ports such declarators back to ACPICA. Lv Zheng. Link: https://github.com/acpica/acpica/commit/c160cae7 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Simplify configuration for "Max Loops" system parameterBob Moore
ACPICA commit 857c510d70e18eecc275dd3087807a18bae8aa51 Allow for static configuration of this parameter. It is used to abort out of infinite loops caused by non-response from hardware. Link: https://github.com/acpica/acpica/commit/857c510d Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Disassembler: Add option to emit embedded External operators/opcodesBob Moore
ACPICA commit 152a8ca2c7fc877d6aff0f9d0965184ef2ddce5c Opcode 0x15 was added in ACPI 6.0 for disassemblers. The disassembler by default does not emit the actual opcodes, they are used internally. Option added for internal debugging only. This patch doesn't affect Linux kernel as disassembler is not in the Linux kernel. Link: https://github.com/acpica/acpica/commit/152a8ca2 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Debugger: Extend some max line lengthsBob Moore
ACPICA commit 622063bae684490191c8e8b10bf18e86d0ab4ebf Fix a couple of arbitrarily small output line lengths. Link: https://github.com/acpica/acpica/commit/622063ba Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Utilities: Introduce facility to allow Linux to set correct logging ↵Lv Zheng
levels ACPICA commit 58c9e7b83ae35247e430c39363f55b6f70fa04a2 It is reported that the logging level of the ACPICA messages are not correct in the Linux kernel. This patch fixes this issue. Lv Zheng. Link: https://github.com/acpica/acpica/commit/58c9e7b8 Link: https://bugzilla.kernel.org/show_bug.cgi?id=117461 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Interpreter: Remove temporary code for External() opcodeBob Moore
ACPICA commit f2d349f8a11efc0f438ad6903564f3a6755dc6b9 The interpreter should never see this opcode (it is used by disassemblers), so the final implementation is to return an error. Link: https://github.com/acpica/acpica/commit/f2d349f8 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Fix deconstification warnings (-Wcast-qual) with ↵Jung-uk Kim
acpi_ns_root_initialize(). ACPICA commit 8b3b57c9d11d9c322e09cb06bedac7aa783458fd Link: https://github.com/acpica/acpica/commit/8b3b57c9 Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-13ACPICA: Fix deconstification warnings (-Wcast-qual) with function traces.Jung-uk Kim
ACPICA commit f722da0372261331b74d3ac67645bba912a21643 Link: https://github.com/acpica/acpica/commit/f722da03 Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-08libnvdimm, nd_blk: mask off reserved status bitsRoss Zwisler
The "NVDIMM Block Window Driver Writer's Guide": http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf ...defines the layout of the block window status register. For the July 2016 version of the spec linked to above, this happens in Figure 4 on page 26. The only bits defined in this spec are bits 31, 5, 4, 2, 1 and 0. The rest of the bits in the status register are reserved, and there is a warning following the diagram that says: Note: The driver cannot assume the value of the RESERVED bits in the status register are zero. These reserved bits need to be masked off, and the driver must avoid checking the state of those bits. This change ensures that for hardware implementations that set these reserved bits in the status register, the driver won't incorrectly fail the block I/Os. Cc: <stable@vger.kernel.org> #v4.2+ Reviewed-by: Lee, Chun-Yi <jlee@suse.com> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2016-08-06Merge tag 'acpi-extra-4.8-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "Two more fixes in ACPI drivers, one in the ACPI EC driver (stable-candidate) and one in the ACPI button driver. Specifics: - An ACPI EC driver fix from the 4.3 cycle may cause the ACPICA's method reentrancy limit to be exceeded for a _Qxx method due to a large number of concurrent EC operations, so prevent that from happening by moving the EC handling into a separate workqueue with a limit on the number of concurrently executed work items (Lv Zheng) - Fix the cleanup code in the ACPI button driver that forgets to clear two variables on exit which causes an error to occur on the next attmpt to load the driver (Benjamin Tissoires)" * tag 'acpi-extra-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / EC: Work around method reentrancy limit in ACPICA for _Qxx ACPI / button: remove pointer to old lid_sysfs on unbind
2016-08-05Merge branches 'acpi-ec' and 'acpi-button'Rafael J. Wysocki
* acpi-ec: ACPI / EC: Work around method reentrancy limit in ACPICA for _Qxx * acpi-button: ACPI / button: remove pointer to old lid_sysfs on unbind
2016-08-05Merge tag 'rtc-4.8' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "RTC for 4.8 Cleanups: - huge cleanup of rtc-generic and char/genrtc this allowed to cleanup rtc-cmos, rtc-sh, rtc-m68k, rtc-powerpc and rtc-parisc - move mn10300 to rtc-cmos Subsystem: - fix wakealarms after hibernate - multiples fixes for rctest - simplify implementations of .read_alarm New drivers: - Maxim MAX6916 Drivers: - ds1307: fix weekday - m41t80: add wakeup support - pcf85063: add support for PCF85063A variant - rv8803: extend i2c fix and other fixes - s35390a: fix alarm reading, this fixes instant reboot after shutdown for QNAP TS-41x - s3c: clock fixes" * tag 'rtc-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (65 commits) rtc: rv8803: Clear V1F when setting the time rtc: rv8803: Stop the clock while setting the time rtc: rv8803: Always apply the I²C workaround rtc: rv8803: Fix read day of week rtc: rv8803: Remove the check for valid time rtc: rv8803: Kconfig: Indicate rx8900 support rtc: asm9260: remove .owner field for driver rtc: at91sam9: Fix missing spin_lock_init() rtc: m41t80: add suspend handlers for alarm IRQ rtc: m41t80: make it a real error message rtc: pcf85063: Add support for the PCF85063A device rtc: pcf85063: fix year range rtc: hym8563: in .read_alarm set .tm_sec to 0 to signal minute accuracy rtc: explicitly set tm_sec = 0 for drivers with minute accurancy rtc: s3c: Add s3c_rtc_{enable/disable}_clk in s3c_rtc_setfreq() rtc: s3c: Remove unnecessary call to disable already disabled clock rtc: abx80x: use devm_add_action_or_reset() rtc: m41t80: use devm_add_action_or_reset() rtc: fix a typo and reduce three empty lines to one rtc: s35390a: improve two comments in .set_alarm ...
2016-08-04ACPI / EC: Work around method reentrancy limit in ACPICA for _QxxLv Zheng
A regression is caused by the following commit: Commit: 02b771b64b73226052d6e731a0987db3b47281e9 Subject: ACPI / EC: Fix an issue caused by the serialized _Qxx evaluations In this commit, using system workqueue causes that the maximum parallel executions of _Qxx can exceed 255. This violates the method reentrancy limit in ACPICA and generates the following error log: ACPI Error: Method reached maximum reentrancy limit (255) (20150818/dsmethod-341) This patch creates a seperate workqueue and limits the number of parallel _Qxx evaluations down to a configurable value (can be tuned against number of online CPUs). Since EC events are handled after driver probe, we can create the workqueue in acpi_ec_init(). Fixes: 02b771b64b73 (ACPI / EC: Fix an issue caused by the serialized _Qxx evaluations) Link: https://bugzilla.kernel.org/show_bug.cgi?id=135691 Cc: 4.3+ <stable@vger.kernel.org> # 4.3+ Reported-and-tested-by: Helen Buus <ubuntu@hbuus.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-03Merge branch 'akpm' (patches from Andrew)Linus Torvalds
Merge yet more updates from Andrew Morton: - the rest of ocfs2 - various hotfixes, mainly MM - quite a bit of misc stuff - drivers, fork, exec, signals, etc. - printk updates - firmware - checkpatch - nilfs2 - more kexec stuff than usual - rapidio updates - w1 things * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (111 commits) ipc: delete "nr_ipc_ns" kcov: allow more fine-grained coverage instrumentation init/Kconfig: add clarification for out-of-tree modules config: add android config fragments init/Kconfig: ban CONFIG_LOCALVERSION_AUTO with allmodconfig relay: add global mode support for buffer-only channels init: allow blacklisting of module_init functions w1:omap_hdq: fix regression w1: add helper macro module_w1_family w1: remove need for ida and use PLATFORM_DEVID_AUTO rapidio/switches: add driver for IDT gen3 switches powerpc/fsl_rio: apply changes for RIO spec rev 3 rapidio: modify for rev.3 specification changes rapidio: change inbound window size type to u64 rapidio/idt_gen2: fix locking warning rapidio: fix error handling in mbox request/release functions rapidio/tsi721_dma: advance queue processing from transfer submit call rapidio/tsi721: add messaging mbox selector parameter rapidio/tsi721: add PCIe MRRS override parameter rapidio/tsi721_dma: add channel mask and queue size parameters ...
2016-08-02ACPI / button: remove pointer to old lid_sysfs on unbindBenjamin Tissoires
When we removed the procfs dir on error or if the driver is unbound, the two variables acpi_lid_dir and acpi_button_dir were not reset. On the next rebind, those static variables were not null and we couldn't re-register the device again. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-08-02treewide: replace obsolete _refok by __refFabian Frederick
There was only one use of __initdata_refok and __exit_refok __init_refok was used 46 times against 82 for __ref. Those definitions are obsolete since commit 312b1485fb50 ("Introduce new section reference annotations tags: __ref, __refdata, __refconst") This patch removes the following compatibility definitions and replaces them treewide. /* compatibility defines */ #define __init_refok __ref #define __initdata_refok __refdata #define __exit_refok __ref I can also provide separate patches if necessary. (One patch per tree and check in 1 month or 2 to remove old definitions) [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/1466796271-3043-1-git-send-email-fabf@skynet.be Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Ingo Molnar <mingo@redhat.com> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-08-02Merge tag 'pci-v4.8-changes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI updates from Bjorn Helgaas: "Highlights: - ARM64 support for ACPI host bridges - new drivers for Axis ARTPEC-6 and Marvell Aardvark - new pci_alloc_irq_vectors() interface for MSI-X, MSI, legacy INTx - pci_resource_to_user() cleanup (more to come) Detailed summary: Enumeration: - Move ecam.h to linux/include/pci-ecam.h (Jayachandran C) - Add parent device field to ECAM struct pci_config_window (Jayachandran C) - Add generic MCFG table handling (Tomasz Nowicki) - Refactor pci_bus_assign_domain_nr() for CONFIG_PCI_DOMAINS_GENERIC (Tomasz Nowicki) - Factor DT-specific pci_bus_find_domain_nr() code out (Tomasz Nowicki) Resource management: - Add devm_request_pci_bus_resources() (Bjorn Helgaas) - Unify pci_resource_to_user() declarations (Bjorn Helgaas) - Implement pci_resource_to_user() with pcibios_resource_to_bus() (microblaze, powerpc, sparc) (Bjorn Helgaas) - Request host bridge window resources (designware, iproc, rcar, xgene, xilinx, xilinx-nwl) (Bjorn Helgaas) - Make PCI I/O space optional on ARM32 (Bjorn Helgaas) - Ignore write combining when mapping I/O port space (Bjorn Helgaas) - Claim bus resources on MIPS PCI_PROBE_ONLY set-ups (Bjorn Helgaas) - Remove unicore32 pci=firmware command line parameter handling (Bjorn Helgaas) - Support I/O resources when parsing host bridge resources (Jayachandran C) - Add helpers to request/release memory and I/O regions (Johannes Thumshirn) - Use pci_(request|release)_mem_regions (NVMe, lpfc, GenWQE, ethernet/intel, alx) (Johannes Thumshirn) - Extend pci=resource_alignment to specify device/vendor IDs (Koehrer Mathias (ETAS/ESW5)) - Add generic pci_bus_claim_resources() (Lorenzo Pieralisi) - Claim bus resources on ARM32 PCI_PROBE_ONLY set-ups (Lorenzo Pieralisi) - Remove ARM32 and ARM64 arch-specific pcibios_enable_device() (Lorenzo Pieralisi) - Add pci_unmap_iospace() to unmap I/O resources (Sinan Kaya) - Remove powerpc __pci_mmap_set_pgprot() (Yinghai Lu) PCI device hotplug: - Allow additional bus numbers for hotplug bridges (Keith Busch) - Ignore interrupts during D3cold (Lukas Wunner) Power management: - Enforce type casting for pci_power_t (Andy Shevchenko) - Don't clear d3cold_allowed for PCIe ports (Mika Westerberg) - Put PCIe ports into D3 during suspend (Mika Westerberg) - Power on bridges before scanning new devices (Mika Westerberg) - Runtime resume bridge before rescan (Mika Westerberg) - Add runtime PM support for PCIe ports (Mika Westerberg) - Remove redundant check of pcie_set_clkpm (Shawn Lin) Virtualization: - Add function 1 DMA alias quirk for Marvell 88SE9182 (Aaron Sierra) - Add DMA alias quirk for Adaptec 3805 (Alex Williamson) - Mark Atheros AR9485 and QCA9882 to avoid bus reset (Chris Blake) - Add ACS quirk for Solarflare SFC9220 (Edward Cree) MSI: - Fix PCI_MSI dependencies (Arnd Bergmann) - Add pci_msix_desc_addr() helper (Christoph Hellwig) - Switch msix_program_entries() to use pci_msix_desc_addr() (Christoph Hellwig) - Make the "entries" argument to pci_enable_msix() optional (Christoph Hellwig) - Provide sensible IRQ vector alloc/free routines (Christoph Hellwig) - Spread interrupt vectors in pci_alloc_irq_vectors() (Christoph Hellwig) Error Handling: - Bind DPC to Root Ports as well as Downstream Ports (Keith Busch) - Remove DPC tristate module option (Keith Busch) - Convert Downstream Port Containment driver to use devm_* functions (Mika Westerberg) Generic host bridge driver: - Select IRQ_DOMAIN (Arnd Bergmann) - Claim bus resources on PCI_PROBE_ONLY set-ups (Lorenzo Pieralisi) ACPI host bridge driver: - Add ARM64 acpi_pci_bus_find_domain_nr() (Tomasz Nowicki) - Add ARM64 ACPI support for legacy IRQs parsing and consolidation with DT code (Tomasz Nowicki) - Implement ARM64 AML accessors for PCI_Config region (Tomasz Nowicki) - Support ARM64 ACPI-based PCI host controller (Tomasz Nowicki) Altera host bridge driver: - Check link status before retrain link (Ley Foon Tan) - Poll for link up status after retraining the link (Ley Foon Tan) Axis ARTPEC-6 host bridge driver: - Add PCI_MSI_IRQ_DOMAIN dependency (Arnd Bergmann) - Add DT binding for Axis ARTPEC-6 PCIe controller (Niklas Cassel) - Add Axis ARTPEC-6 PCIe controller driver (Niklas Cassel) Intel VMD host bridge driver: - Use lock save/restore in interrupt enable path (Jon Derrick) - Select device dma ops to override (Keith Busch) - Initialize list item in IRQ disable (Keith Busch) - Use x86_vector_domain as parent domain (Keith Busch) - Separate MSI and MSI-X vector sharing (Keith Busch) Marvell Aardvark host bridge driver: - Add DT binding for the Aardvark PCIe controller (Thomas Petazzoni) - Add Aardvark PCI host controller driver (Thomas Petazzoni) - Add Aardvark PCIe support for Armada 3700 (Thomas Petazzoni) Microsoft Hyper-V host bridge driver: - Fix interrupt cleanup path (Cathy Avery) - Don't leak buffer in hv_pci_onchannelcallback() (Vitaly Kuznetsov) - Handle all pending messages in hv_pci_onchannelcallback() (Vitaly Kuznetsov) NVIDIA Tegra host bridge driver: - Program PADS_REFCLK_CFG* always, not just on legacy SoCs (Stephen Warren) - Program PADS_REFCLK_CFG* registers with per-SoC values (Stephen Warren) - Use lower-case hex consistently for register definitions (Thierry Reding) - Use generic pci_remap_iospace() rather than ARM32-specific one (Thierry Reding) - Stop setting pcibios_min_mem (Thierry Reding) Renesas R-Car host bridge driver: - Drop gen2 dummy I/O port region (Bjorn Helgaas) TI DRA7xx host bridge driver: - Fix return value in case of error (Christophe JAILLET) Xilinx AXI host bridge driver: - Fix return value in case of error (Christophe JAILLET) Miscellaneous: - Make bus_attr_resource_alignment static (Ben Dooks) - Include <asm/dma.h> for isa_dma_bridge_buggy (Ben Dooks) - MAINTAINERS: Add file patterns for PCI device tree bindings (Geert Uytterhoeven) - Make host bridge drivers explicitly non-modular (Paul Gortmaker)" * tag 'pci-v4.8-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (125 commits) PCI: xgene: Make explicitly non-modular PCI: thunder-pem: Make explicitly non-modular PCI: thunder-ecam: Make explicitly non-modular PCI: tegra: Make explicitly non-modular PCI: rcar-gen2: Make explicitly non-modular PCI: rcar: Make explicitly non-modular PCI: mvebu: Make explicitly non-modular PCI: layerscape: Make explicitly non-modular PCI: keystone: Make explicitly non-modular PCI: hisi: Make explicitly non-modular PCI: generic: Make explicitly non-modular PCI: designware-plat: Make it explicitly non-modular PCI: artpec6: Make explicitly non-modular PCI: armada8k: Make explicitly non-modular PCI: artpec: Add PCI_MSI_IRQ_DOMAIN dependency PCI: Add ACS quirk for Solarflare SFC9220 arm64: dts: marvell: Add Aardvark PCIe support for Armada 3700 PCI: aardvark: Add Aardvark PCI host controller driver dt-bindings: add DT binding for the Aardvark PCIe controller PCI: tegra: Program PADS_REFCLK_CFG* registers with per-SoC values ...
2016-08-01Merge branch 'pci/msi-affinity' into nextBjorn Helgaas
Conflicts: drivers/nvme/host/pci.c