summaryrefslogtreecommitdiffstats
path: root/drivers/mailbox
AgeCommit message (Collapse)Author
2016-07-28mailbox: Fix format and type mismatches in Broadcom PDC driverRob Rice
Fix format and type mismatches in a couple debug prints in the Broadcom PDC driver. Use %pad for dma_addr_t and %pa for resource_size_t. Signed-off-by: Rob Rice <rob.rice@broadcom.com> Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-07-28mailbox: Add Broadcom PDC mailbox driverRob Rice
The Broadcom PDC mailbox driver is a mailbox controller that manages data transfers to and from one or more offload engines. Signed-off-by: Rob Rice <rob.rice@broadcom.com> Reviewed-by: Scott Branden <scott.branden@broadcom.com> Reviewed-by: Ray Jui <ray.jui@broadcom.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-06-24mailbox: pl320: remove __raw IOBen Dooks
The use of __raw IO accesors is not endian safe and should be used sparingly. The relaxed variants should be as lightweight and also are endian safe. Note, this has not been run-time tested. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-06-12mailbox: mailbox-test: set tdev->signal to NULL after freeingSudeep Holla
tdev->signal is not set NULL after it's freed. This will cause random exceptions when the stale pointer is accessed after tdev->signal is freed. Also, since tdev->signal allocation is skipped the next time it's written, this leads to continuous fault finally leading to the total death of the system. Fixes: d1c2f87c9a8f ("mailbox: mailbox-test: Prevent memory leak") Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-05-08mailbox: Fix devm_ioremap_resource error detection codeAmitoj Kaur Chawla
devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure. The Coccinelle semantic patch used to make this change is as follows: @@ expression e,e1; statement S; @@ *e = devm_ioremap_resource(...); if (!e1) S Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-26mailbox/omap: kill omap_mbox_{save/restore}_ctx() functionsSuman Anna
The omap_mbox_save_ctx() and omap_mbox_restore_ctx() API were previously provided to OMAP mailbox clients to save and restore the mailbox context during system suspend/resume. The save and restore functionality is now implemented through System PM driver callbacks, and there is no need for these functions, so kill these API. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-26mailbox/omap: check for any unread messages during suspendSuman Anna
The OMAP mailbox driver is used by clients to communicate with remote processors in general. The mailbox clients are expected to have stopped communicating with these remote processors during a system suspend. The OMAP mailbox fifos are expected to not have any messages as such. Add a check for any pending unprocessed messages in the suspend callback, to detect any communication protocol issues of the mailbox clients. The system suspend is aborted if any messages are found. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-26mailbox/omap: add support for suspend/resumeSuman Anna
Support has been added to the OMAP mailbox driver to allow it to work across a system suspend/resume. The OMAP mailbox driver requires only the interrupt configuration registers to be saved and restored, and this is done in the suspend/resume callbacks. The registers need to be saved only if there are active clients at the time of suspend. The enabling and disabling of the mailbox clocks is done automatically by the omap_device layer. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-26mailbox/omap: store mailbox interrupt type in omap_mbox_deviceSuman Anna
The interrupt type used for identifying the layout of the interrupt configuration registers between OMAP4+ SoCs and older SoCs is stored only in the sub-mailbox structures for easier access. Store this type in the the omap_mbox_device structure as well along with the other global variables. This is being done to facilitate the context save and restore of appropriate registers during system suspend/resume. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-26mailbox/omap: add blank lines after declarationsSuman Anna
Fix couple of checkpatch warnings of the type, "WARNING: Missing a blank line after declarations" Also, fixed a warning about a space after a typecast while at this. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-26mailbox/omap: remove FSF mailing address paragraphSuman Anna
Remove the paragraph about writing to the Free Software Foundation's mailing address from the GPL license header as this address can change. This fixes the corresponding checkpatch warning. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-26mailbox/omap: use variable name for sizeof() operatorSuman Anna
Fix the code formatting to use the kernel preferred style of using the actual variables to determize the size using the sizeof() operator. This fixes the corresponding checkpatch warning as well. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-26mailbox/omap: drop legacy platform device supportSuman Anna
OMAP mailbox devices can no longer be created in legacy non-DT mode, all the relevant code has been cleaned up. The OMAP mailbox driver will only support devices created from DT going forward, so drop the legacy platform device support from the driver. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-14Merge branch 'mailbox-devel' of ↵Linus Torvalds
git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox fixes from Jussi Brar: "Misc fixes: mailbox-test driver: - prevent memory leak and another cosmetic change mailbox: - change the returned error code Xgene driver: - return -ENOMEM instead of PTR_ERR for failed devm_kzalloc" * 'mailbox-devel' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: Stop using ENOSYS for anything other than unimplemented syscalls mailbox: mailbox-test: Prevent memory leak mailbox: mailbox-test: Use more consistent format for calling copy_from_user() mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc
2016-04-12mailbox: Stop using ENOSYS for anything other than unimplemented syscallsLee Jones
In accordance with e15f431fe2d5 ("errno.h: Improve ENOSYS's comment") and 91c9afaf97ee ("checkpatch.pl: new instances of ENOSYS are errors") we're converting from the old meaning of: ENOSYS "Function not implemented" to a more standard EINVAL. Reported-by: Seraphin Bonnaffe <seraphin.bonnaffe@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-12mailbox: mailbox-test: Prevent memory leakLee Jones
If we set the Signal twice or more, without using it as part of a message, memory will be re-allocated and the pointer over-written. Prevent this potential leak by only allocating memory when there isn't any already. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-12mailbox: mailbox-test: Use more consistent format for calling copy_from_user()Lee Jones
While we're at it, ensure copy-to location is NULL'ed in the error path. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-08Merge branches 'pm-cpufreq', 'pm-cpuidle' and 'acpi-cppc'Rafael J. Wysocki
* pm-cpufreq: cpufreq: dt: Drop stale comment cpufreq: intel_pstate: Documenation for structures cpufreq: intel_pstate: fix inconsistency in setting policy limits intel_pstate: Avoid extra invocation of intel_pstate_sample() intel_pstate: Do not set utilization update hook too early * pm-cpuidle: intel_idle: Add KBL support intel_idle: Add SKX support intel_idle: Clean up all registered devices on exit. intel_idle: Propagate hot plug errors. intel_idle: Don't overreact to a cpuidle registration failure. intel_idle: Setup the timer broadcast only on successful driver load. intel_idle: Avoid a double free of the per-CPU data. intel_idle: Fix dangling registration on error path. intel_idle: Fix deallocation order on the driver exit path. intel_idle: Remove redundant initialization calls. intel_idle: Fix a helper function's return value. intel_idle: remove useless return from void function. * acpi-cppc: mailbox: pcc: Don't access an unmapped memory address space
2016-04-08mailbox: xgene-slimpro: Fix wrong test for devm_kzallocAxel Lin
devm_kzalloc() returns NULL on failure. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-07mailbox: pcc: Don't access an unmapped memory address spaceShanker Donthineni
The acpi_pcc_probe() may end up accessing memory outside of the PCCT table space causing the kernel panic(). Increment the pcct_entry pointer after parsing 'HW-reduced Communications Subspace' to fix the problem. This change also enables the parsing of subtable at index 0. Signed-off-by: Shanker Donthineni <shankerd@codeaurora.org> Acked-by: Ashwin Chaugule <ashwin.chaugule@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-03-23Merge branch 'mailbox-for-next' of ↵Linus Torvalds
git://git.linaro.org/landing-teams/working/fujitsu/integration Pull more mailbox updates from Jassi Brar: "Device tree bindings and driver for TI's Message-Manager controller. Due to some last minute cosmetic changes, the driver was not included in the first pull request, otherwise the driver has been reviewed twice" * 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: Introduce TI message manager driver Documentation: dt: mailbox: Add TI Message Manager
2016-03-21mailbox: Introduce TI message manager driverNishanth Menon
Support for TI Message Manager Module. This hardware block manages a bunch of hardware queues meant for communication between processor entities. Clients sitting on top of this would manage the required protocol for communicating with the counterpart entities. For more details on TI Message Manager hardware block, see documentation that will is available here: http://www.ti.com/lit/ug/spruhy8/spruhy8.pdf Chapter 8.1(Message Manager) Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-03-20Merge branch 'mailbox-for-next' of ↵Linus Torvalds
git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox updates from Jassi Brar: - mailbox bindings and drivers for * APM X-Gene * Hisilicon Hi6220 * Rockchip RK3368 platforms - minor fixes to the above three drivers. - misc cleanups of mailbox-test driver. * 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: rockchip: avoid 64-bit division mailbox: rockchip: Add Rockchip mailbox driver dt-bindings: rockchip-mailbox: Add mailbox controller document on Rockchip SoCs mailbox/xgene-slimpro: Checking for IS_ERR instead of NULL mailbox: Hi6220: add mailbox driver dt-bindings: mailbox: Document Hi6220 mailbox driver mailbox: mailbox-test: add support for separate tx/rx buffer with single channel mailbox: mailbox-test: use print_hex_dump_bytes to allow dynamic printk mailbox: mailbox-test: fix the compatible string mailbox: mailbox-test: rename driver as generic test driver Documentation: mailbox: Add APM X-Gene SLIMpro mailbox dts documentation mailbox: Add support for APM X-Gene platform mailbox driver
2016-03-16mailbox: rockchip: avoid 64-bit divisionArnd Bergmann
The newly added rockchip mailbox driver causes a bug in the ARM allyesconfig build because of a division of a resource_size_t variable that may be 64 bit wide: drivers/mailbox/built-in.o: In function `rockchip_mbox_probe': :(.text+0x6614): undefined reference to `__aeabi_uldivmod' This adds a cast to size_t, which turns it into a 32-bit division in this case. This is safe because we know that we cannot possibly map a resource that is longer than what a pointer contains, and in practice it will be very short instead. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-03-14Merge branches 'acpi-processor' and 'acpi-cppc'Rafael J. Wysocki
* acpi-processor: ACPI / sleep: move acpi_processor_sleep to sleep.c ACPI / processor : add support for ACPI0010 processor container ACPI / processor_idle: replace PREFIX with pr_fmt * acpi-cppc: ACPI / CPPC: use MRTT/MPAR to decide if/when a req can be sent ACPI / CPPC: replace writeX/readX to PCC with relaxed version mailbox: pcc: optimized pcc_send_data ACPI / CPPC: optimized cpc_read and cpc_write ACPI / CPPC: Optimize PCC Read Write operations
2016-03-11mailbox: rockchip: Add Rockchip mailbox driverCaesar Wang
This driver is found on RK3368 SoCs. The Mailbox module is a simple APB peripheral that allows both the Cortex-A53 MCU system to communicate by writing operation to generate interrupt. The registers are accessible by both CPU via APB interface. The Mailbox has the following main features: 1) Support dual-core system: Cortex-A53 and MCU. 2) Support APB interface. 3) Support four mailbox elements, each element includes one data word, one command word register and one flag bit that can represent one interrupt. 4) Four interrupts to Cortex-A53. 5) Four interrupts to MCU. 6) Provide 32 lock registers for software to use to indicate whether mailbox is occupied. [Jassi: Removed unused variable buf_base] Signed-off-by: Caesar Wang <wxt@rock-chips.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-03-09mailbox: pcc: optimized pcc_send_dataPrakash, Prashanth
pcc_send_data() can be invoked during the execution of performance critical code as in cppc_cpufreq driver. With acpi_* APIs, the doorbell register accessed in pcc_send_data() if present in system memory will be searched (in cached virt to phys addr mapping), mapped, read/written and then unmapped. These operations take significant amount of time. This patch maps the performance critical doorbell register during init and then reads/writes to it directly using the mapped virtual address. This patch + similar changes to CPPC acpi driver reduce the time per freq. transition from around 200us to about 20us for the CPPC cpufreq driver Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Acked-by: Ashwin Chaugule <ashwin.chaugule@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-03-04mailbox/xgene-slimpro: Checking for IS_ERR instead of NULLDan Carpenter
devm_ioremap() returns NULL, it never returns an ERR_PTR. Fixes: f700e84f417b ('mailbox: Add support for APM X-Gene platform mailbox driver') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-03-04mailbox: Hi6220: add mailbox driverLeo Yan
Add driver for Hi6220 mailbox, the mailbox communicates with MCU; for sending data, it can support two methods for low level implementation: one is to use interrupt as acknowledge, another is automatic mode which without any acknowledge. These two methods have been supported in the driver. For receiving data, it will depend on the interrupt to notify the channel has incoming message. Now mailbox driver is used to send message to MCU to control dynamic voltage and frequency scaling for CPU, GPU and DDR. Signed-off-by: Leo Yan <leo.yan@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-03-04mailbox: mailbox-test: add support for separate tx/rx buffer with single channelSudeep Holla
This patch adds support for different MMIO region for Tx and Rx paths. If only one region is specified, it's assumed to be shared between Rx and Tx, thereby retaining backward compatibility. Also in order to support single channel dealing with both Tx and Rx with dedicated MMIO regions, Tx channel itself is assigned to Rx if MMIO regions are different and Rx is not specified. Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-03-04mailbox: mailbox-test: use print_hex_dump_bytes to allow dynamic printkSudeep Holla
Reduce the logging from info to debug. Also use print_hex_dump_bytes instead as it has support for dynamic printk providing options to conditionally enable/disable these logs. Cc: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-03-04mailbox: mailbox-test: fix the compatible stringSudeep Holla
Underscores are usually forbidden in the compatible strings. So lets remove it before the first users of this is seen. Acked-by: Rob Herring <robh@kernel.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-03-04mailbox: mailbox-test: rename driver as generic test driverSudeep Holla
This mailbox-test driver was designed to be generic, so let's remove ST tag on it and make it generic. Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-02-15mailbox: Add support for APM X-Gene platform mailbox driverDuc Dang
X-Gene mailbox controller provides 8 mailbox channels, with each channel has a dedicated interrupt line. Signed-off-by: Feng Kan <fkan@apm.com> Signed-off-by: Duc Dang <dhdang@apm.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-02-02mailbox: Fix dependencies for !HAS_IOMEM archsRichard Weinberger
Not every arch has io memory. So, unbreak the build by fixing the dependencies. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-02-02mailbox: pcc: fix channel calculation in get_pcc_channel()Alexey Klimov
This patch fixes the calculation of pcc_chan for non-zero id. After the compiler ignores the (unsigned long) cast the pcc_mbox_channels pointer is type-cast and then the type-cast offset is added which results in address outside of the range leading to the kernel crashing. We might add braces and make it: pcc_chan = (struct mbox_chan *) ((unsigned long) pcc_mbox_channels + (id * sizeof(*pcc_chan))); but let's go with array approach here and use id as index. Tested on Juno board. Signed-off-by: Alexey Klimov <alexey.klimov@arm.com> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Acked-by: Ashwin Chaugule <ashwin.chaugule@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2015-11-30mailbox: constify mbox_chan_ops structureJulia Lawall
This mbox_chan_ops structure is never modified, so declare it as const, like all the other mbox_chan_ops structures. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2015-11-04mailbox: mailbox-test: avoid reading iomem twiceJassi Brar
Don't pass mmio region as source to print_hex_dump() and then again to memcpy_fromio(). Do it once and give print_hex_dump() the buffer we just read the data in. Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2015-10-27mailbox: Off by one in mbox_test_message_read()Dan Carpenter
We need to leave space for the NUL char. Fixes: 8ea4484d0c2b ('mailbox: Add generic mechanism for testing Mailbox Controllers') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
2015-10-23mailbox/omap: Add ti,mbox-send-noirq quirk to fix AM33xx CPU IdleDave Gerlach
The mailbox framework controls the transmission queue and requires either its controller implementations or clients to run the state machine for the Tx queue. The OMAP mailbox controller uses a Tx-ready interrupt as the equivalent of a Tx-done interrupt to run this Tx queue state-machine. The WkupM3 processor on AM33xx and AM43xx SoCs is used to offload certain PM tasks, like doing the necessary operations for Device PM suspend/resume or for entering lower c-states during cpuidle. The CPUIdle on AM33xx requires the messages to be sent without having to trigger the Tx-ready interrupts, as the interrupt would immediately terminate the CPUIdle operation. Support for this has been added by introducing a DT quirk, "ti,mbox-send-noirq" and using it to modify the normal OMAP mailbox controller behavior on the sub-mailboxes used to communicate with the WkupM3 remote processor. This also requires the wkup_m3_ipc driver to adjust its mailbox usage logic to run the Tx state machine. NOTE: - AM43xx does not communicate with WkupM3 for CPU Idle, so is not affected by this behavior. But, it uses the same IPC driver for PM suspend/resume functionality, so requires the quirk as well, because of changes to the common wkup_m3_ipc driver. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> [s-anna@ti.com: revise logic and update comments/patch description] Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2015-10-23mailbox: mailbox-test: Correctly repair Sparse warningsLee Jones
Kbuild test robot reported some Sparse warnings to the tune of: sparse: incorrect type in argument 6 (different address spaces) expected void const *buf got void [noderef] <asn:2>*mmio This was due to passing variables tagged with the Sparse cookie '__iomem' through into memcpy() and print_hex_dump() without adequate protection or casting. These issues were fixed in a previous patch suppressing the warnings, but the issue is indeed still present. This patch fixes the warnings in the correct way, i.e. by using the purposely authored memcpy_{from,to}io() derivatives in the memcpy() case and casting the memory address to (void *) and forcing Sparse to ignore to ignore it in the print_hex_dump() case [NB: This is also what the memcpy() derivatives do]. Reported-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2015-10-17mailbox: Fix a couple of trivial static checker issuesLee Jones
This patch deals with a few spelling, white space and type warnings reported by Intel's Kbuild Test Robot. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2015-10-17mailbox: Add generic mechanism for testing Mailbox ControllersLee Jones
This particular Client implementation uses shared memory in order to pass messages between Mailbox users; however, it can be easily hacked to support any type of Controller. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2015-10-17mailbox: Add support for ST's Mailbox IPLee Jones
ST's platforms currently support a maximum of 5 Mailboxes, one for each of the supported co-processors situated on the platform. Each Mailbox is divided up into 4 instances which consist of 32 channels. Messages are passed between the application and co-processors using shared memory areas. It is the Client's responsibility to manage these areas. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2015-10-16PCC: fix dereference of ERR_PTRSudip Mukherjee
get_pcc_channel() does not return NULL on error it returns the error code in ERR_PTR, but we have been checking it for NULL. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
2015-09-05Merge branch 'mailbox-for-next' of ↵Linus Torvalds
git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox updates from Jassi Brar: "Mainly we move from jiffy based timer to HRTIMER for finer control over polling. Then a controller reduces its polling period from 10 to 1ms" * 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: arm_mhu: reduce txpoll_period from 10ms to 1 ms mailbox: switch to hrtimer for tx_complete polling mailbox: Drop owner assignment from platform_driver
2015-09-01Merge tag 'pm+acpi-4.3-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management and ACPI updates from Rafael Wysocki: "From the number of commits perspective, the biggest items are ACPICA and cpufreq changes with the latter taking the lead (over 50 commits). On the cpufreq front, there are many cleanups and minor fixes in the core and governors, driver updates etc. We also have a new cpufreq driver for Mediatek MT8173 chips. ACPICA mostly updates its debug infrastructure and adds a number of fixes and cleanups for a good measure. The Operating Performance Points (OPP) framework is updated with new DT bindings and support for them among other things. We have a few updates of the generic power domains framework and a reorganization of the ACPI device enumeration code and bus type operations. And a lot of fixes and cleanups all over. Included is one branch from the MFD tree as it contains some PM-related driver core and ACPI PM changes a few other commits are based on. Specifics: - ACPICA update to upstream revision 20150818 including method tracing extensions to allow more in-depth AML debugging in the kernel and a number of assorted fixes and cleanups (Bob Moore, Lv Zheng, Markus Elfring). - ACPI sysfs code updates and a documentation update related to AML method tracing (Lv Zheng). - ACPI EC driver fix related to serialized evaluations of _Qxx methods and ACPI tools updates allowing the EC userspace tool to be built from the kernel source (Lv Zheng). - ACPI processor driver updates preparing it for future introduction of CPPC support and ACPI PCC mailbox driver updates (Ashwin Chaugule). - ACPI interrupts enumeration fix for a regression related to the handling of IRQ attribute conflicts between MADT and the ACPI namespace (Jiang Liu). - Fixes related to ACPI device PM (Mika Westerberg, Srinidhi Kasagar). - ACPI device registration code reorganization to separate the sysfs-related code and bus type operations from the rest (Rafael J Wysocki). - Assorted cleanups in the ACPI core (Jarkko Nikula, Mathias Krause, Andy Shevchenko, Rafael J Wysocki, Nicolas Iooss). - ACPI cpufreq driver and ia64 cpufreq driver fixes and cleanups (Pan Xinhui, Rafael J Wysocki). - cpufreq core cleanups on top of the previous changes allowing it to preseve its sysfs directories over system suspend/resume (Viresh Kumar, Rafael J Wysocki, Sebastian Andrzej Siewior). - cpufreq fixes and cleanups related to governors (Viresh Kumar). - cpufreq updates (core and the cpufreq-dt driver) related to the turbo/boost mode support (Viresh Kumar, Bartlomiej Zolnierkiewicz). - New DT bindings for Operating Performance Points (OPP), support for them in the OPP framework and in the cpufreq-dt driver plus related OPP framework fixes and cleanups (Viresh Kumar). - cpufreq powernv driver updates (Shilpasri G Bhat). - New cpufreq driver for Mediatek MT8173 (Pi-Cheng Chen). - Assorted cpufreq driver (speedstep-lib, sfi, integrator) cleanups and fixes (Abhilash Jindal, Andrzej Hajda, Cristian Ardelean). - intel_pstate driver updates including Skylake-S support, support for enabling HW P-states per CPU and an additional vendor bypass list entry (Kristen Carlson Accardi, Chen Yu, Ethan Zhao). - cpuidle core fixes related to the handling of coupled idle states (Xunlei Pang). - intel_idle driver updates including Skylake Client support and support for freeze-mode-specific idle states (Len Brown). - Driver core updates related to power management (Andy Shevchenko, Rafael J Wysocki). - Generic power domains framework fixes and cleanups (Jon Hunter, Geert Uytterhoeven, Rajendra Nayak, Ulf Hansson). - Device PM QoS framework update to allow the latency tolerance setting to be exposed to user space via sysfs (Mika Westerberg). - devfreq support for PPMUv2 in Exynos5433 and a fix for an incorrect exynos-ppmu DT binding (Chanwoo Choi, Javier Martinez Canillas). - System sleep support updates (Alan Stern, Len Brown, SungEun Kim). - rockchip-io AVS support updates (Heiko Stuebner). - PM core clocks support fixup (Colin Ian King). - Power capping RAPL driver update including support for Skylake H/S and Broadwell-H (Radivoje Jovanovic, Seiichi Ikarashi). - Generic device properties framework fixes related to the handling of static (driver-provided) property sets (Andy Shevchenko). - turbostat and cpupower updates (Len Brown, Shilpasri G Bhat, Shreyas B Prabhu)" * tag 'pm+acpi-4.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (180 commits) cpufreq: speedstep-lib: Use monotonic clock cpufreq: powernv: Increase the verbosity of OCC console messages cpufreq: sfi: use kmemdup rather than duplicating its implementation cpufreq: drop !cpufreq_driver check from cpufreq_parse_governor() cpufreq: rename cpufreq_real_policy as cpufreq_user_policy cpufreq: remove redundant 'policy' field from user_policy cpufreq: remove redundant 'governor' field from user_policy cpufreq: update user_policy.* on success cpufreq: use memcpy() to copy policy cpufreq: remove redundant CPUFREQ_INCOMPATIBLE notifier event cpufreq: mediatek: Add MT8173 cpufreq driver dt-bindings: mediatek: Add MT8173 CPU DVFS clock bindings PM / Domains: Fix typo in description of genpd_dev_pm_detach() PM / Domains: Remove unusable governor dummies PM / Domains: Make pm_genpd_init() available to modules PM / domains: Align column headers and data in pm_genpd_summary output powercap / RAPL: disable the 2nd power limit properly tools: cpupower: Fix error when running cpupower monitor PM / OPP: Drop unlikely before IS_ERR(_OR_NULL) PM / OPP: Fix static checker warning (broken 64bit big endian systems) ...
2015-08-26PCC: Disable compilation by defaultAshwin Chaugule
PCC is made selectable only by clients which use it. e.g. CPPC Default it to disabled so that it is not included accidentally on platforms which dont use it. Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org> Reviewed-by: Al Stone <al.stone@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-08-25PCC: Initialize PCC Mailbox earlier at bootAshwin Chaugule
This change initializes the PCC Mailbox earlier than the ACPI processor driver. This enables drivers introduced in follow up patches (e.g. CPPC) to be probed via the ACPI processor driver interface. The CPPC probe requires the PCC channel to be initialized for it to query each CPUs performance capabilities. Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org> Reviewed-by: Al Stone <al.stone@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-08-10mailbox: arm_mhu: reduce txpoll_period from 10ms to 1 msSudeep Holla
Since the mailbox core users hrtimers now, it can handle much higher resolutions. We can reduce the txpoll_period to 1 ms as the transmit usually takes just few microseconds. Reported-and-suggested-by: Juri Lelli <Juri.Lelli@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>