Commit graph

873,060 commits

Author SHA1 Message Date
Subbaraman Narayanamurthy
ff2fb11b08 spmi: spmi-pmic-arb: Fix hw_irq overflow
Currently, when handling the SPMI summary interrupt, the hw_irq
number is calculated based on SID, Peripheral ID, IRQ index and
APID. This is then passed to irq_find_mapping() to see if a
mapping exists for this hw_irq and if available, invoke the
interrupt handler. Since the IRQ index uses an "int" type, hw_irq
which is of unsigned long data type can take a large value when
SID has its MSB set to 1 and the type conversion happens. Because
of this, irq_find_mapping() returns 0 as there is no mapping
for this hw_irq. This ends up invoking cleanup_irq() as if
the interrupt is spurious whereas it is actually a valid
interrupt. Fix this by using the proper data type (u32) for id.

CRs-Fixed: 2357600
Change-Id: I451e33d61e063d3a9381c2b43767946117a5bbb9
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2019-11-01 14:20:32 -07:00
Yimin Peng
ac4ae512b2 spmi: pmic-arb: support updating interrupt type flags
Have the qpnpint_irq_set_type function clear unwanted high/low
trigger bits when updating the interrupt flags.

Change-Id: Ie55d6178ea94350ecf8c79714cb863ea63d76ea6
Signed-off-by: Yimin Peng <yiminp@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2019-11-01 14:20:31 -07:00
David Collins
e4f7eef56d spmi: spmi-pmic-arb: increase SPMI transaction timeout delay
Increase the SPMI transaction timeout delay from 100 us to
1000 us in order to account for the slower execution time
found on some simulator targets.

Change-Id: I5805fa77131336e56db35ae7948012e072c15746
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-11-01 14:20:29 -07:00
David Collins
0cf5f1b07b spmi: spmi-pmic-arb: block access for invalid PMIC arbiter v5 SPMI writes
The system crashes due to an access permission violation when
writing to a PMIC peripheral which is not owned by the current
ee.  Add a check for PMIC arbiter version 5 for such invalid
write requests and return an error instead of crashing the
system.

Change-Id: If601a8c737f10be2a7d1e894f7285cf0de4eb4a5
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-11-01 14:20:28 -07:00
David Collins
27abf44b3c spmi: spmi-pmic-arb: correct duplicate APID to PPID mapping logic
Correct the way that duplicate PPID mappings are handled for PMIC
arbiter v5.  The final APID mapped to a given PPID should be the
one which has write owner = APPS EE, if it exists, or if not
that, then the first APID mapped to the PPID, if it exists.

Change-Id: I387e25d5e0d29434a6191faaf887db1e1a90243d
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-11-01 14:20:20 -07:00
Ashay Jaiswal
12684b27b8 spmi-pmic-arb: add support to dispatch interrupt based on IRQ status
Current implementation of SPMI arbiter dispatches interrupt based on the
Arbiter's accumulator status, in some cases the accumulator status may
remain zero and the interrupt remains un-handled. Add logic to dispatch
interrupts based Arbiter's IRQ status if the accumulator status is zero.

Change-Id: I068f5c7d33758063878721d7cce1308fa803e3bd
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-11-01 14:18:11 -07:00
David Collins
1783d5b87c spmi: spmi-pmic-arb: check apid against limits before calling irq handler
Check that the apid for an SPMI interrupt falls between the
min_apid and max_apid that can be handled by the APPS processor
before invoking the per-apid interrupt handler:
periph_interrupt().

This avoids an access violation in rare cases where the status
bit is set for an interrupt that is not owned by the APPS
processor.

Change-Id: Ib74cb4ae7be9849f0243659bb4c1435340e1e087
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-11-01 14:15:25 -07:00
Subbaraman Narayanamurthy
3d5821adf6 spmi: pmic-arb: do not ack and clear peripheral interrupts in cleanup_irq
Currently, cleanup_irq() is invoked when a peripheral's interrupt
fires and there is no mapping present in the interrupt domain of
spmi interrupt controller.

The cleanup_irq clears the arbiter bit, clears the pmic interrupt
and disables it at the pmic in that order. The last disable in
cleanup_irq races with request_irq() in that it stomps over the
enable issued by request_irq. Fix this by not writing to the pmic
in cleanup_irq. The latched bit will be left set in the pmic,
which will not send us more interrupts even if the enable bit
stays enabled.

When a client wants to request an interrupt, use the activate
callback on the irq_domain to clear latched bit. This ensures
that the latched, if set due to the above changes in cleanup_irq
or when the bootloader leaves it set, gets cleaned up, paving way
for upcoming interrupts to trigger.

With this, there is a possibility of unwanted triggering of
interrupt right after the latched bit is cleared - the interrupt
may be left enabled too. To avoid that, clear the enable first
followed by clearing the latched bit in the activate callback.

Change-Id: If126d6f6cdf6c944ca513c53a71a91e225ee63e2
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
[collinsd@codeaurora.org: fix merge conflict]
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-11-01 14:08:58 -07:00
Abhijeet Dharmapurikar
84d765b0da spmi: pmic_arb: add a print in cleanup_irq
The cleanup_irq() was meant to clear and mask interrupts that were
left enabled in the hardware but there was no interrupt handler
registered for it. Add an error print when it gets invoked.

Change-Id: Iccf0daadeb82b0fca29829424439ac225e2b3b88
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-11-01 14:03:59 -07:00
Abhijeet Dharmapurikar
4c8cc75386 spmi: pmic-arb: instantiate spmi_devices at arch_initcall
The spmi arbiter device spawns spmi_devices which in turn spawn
platform_devices for pmic peripherals.

Move the arbiter's driver init to arch_initcall so that the subsequent
devices it spawns get instantiated earlier.

Change-Id: Ib96937f274745549ee86f758673aab4db97acbaf
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
[collinsd@codeaurora.org: added module exit function]
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-11-01 13:55:22 -07:00
Patrick Daly
f4031a6aa1 spmi: pmic-arb: Use asynchronous probe
A spmi controller may have many child devices, which together may take
a signifigant amount of time to register and probe. Reduce this effect
by probing asynchronously.

After:
[    0.277217] calling__software_resume+0x0/0x24c_@_1
Before:
[    0.319295] calling__software_resume+0x0/0x24c_@_1

Change-Id: I95704a2ae7aae98e23dc9f29c7d023867d60388d
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
2019-11-01 11:11:12 -07:00
qctecmdr
727f8a7022 Merge "clk: dt-bindings: gcc: Add USB PIPE clocks" 2019-11-01 10:09:03 -07:00
qctecmdr
6eaa9bf7dd Merge "techpack: Fix uapi headers_install" 2019-11-01 08:40:50 -07:00
qctecmdr
76af7ae5db Merge "i2c: i2c-msm-geni: Add I2C GENI driver snapshot" 2019-11-01 07:55:53 -07:00
qctecmdr
07714cda66 Merge "dmaengine: gpi: add GPI dmaengine driver snapshot" 2019-11-01 06:58:21 -07:00
qctecmdr
8745f6ecc5 Merge "clk: qcom: clk-alpha-pll: Remove zonda pll set rate delay" 2019-11-01 05:19:13 -07:00
qctecmdr
8e4b26ff82 Merge "media: v4l2-core: Enable VIDIOC_DQBUF ioctl functionality" 2019-11-01 04:27:18 -07:00
qctecmdr
8e02afb87a Merge "clk: qcom: clk-alpha-pll: Add support for controlling zonda5lpe PLL" 2019-11-01 03:52:02 -07:00
qctecmdr
b2f9ea926a Merge "arm64: defconfig: Enable global synx driver" 2019-11-01 02:57:25 -07:00
qctecmdr
8db7ec54b8 Merge "usb: gadget: Add support for usb runtime pm APIs" 2019-10-31 22:12:21 -07:00
qctecmdr
4091569308 Merge "cnss2: Switch to new genl structure" 2019-10-31 21:28:51 -07:00
qctecmdr
c7e8b77730 Merge "usb: gadget: rndis: Add packet filter handling for hw accelerated path" 2019-10-31 20:49:49 -07:00
qctecmdr
ad5d02f552 Merge "USB: rndis: Honor dl_max_packet_size value sent by host" 2019-10-31 20:07:48 -07:00
qctecmdr
5d1673603d Merge "usb: gadget: rndis: Add new rndis parameters" 2019-10-31 19:21:32 -07:00
qctecmdr
706ab1d034 Merge "usb: gadget: Add support for rndis flow control callback" 2019-10-31 18:40:50 -07:00
qctecmdr
7b8d417d82 Merge "usb: Add support for rndis uplink aggregation" 2019-10-31 17:49:56 -07:00
qctecmdr
3df179a516 Merge "usb: dwc3-msm: Allow xo_clk to be optional" 2019-10-31 16:59:16 -07:00
qctecmdr
6ad49b177f Merge "ion: Assume in-kernel clients for prefetch and drain" 2019-10-31 16:17:38 -07:00
qctecmdr
bba34cd529 Merge "usb: dwc3-msm: Get usb power_supply from device tree" 2019-10-31 15:32:40 -07:00
qctecmdr
b49d4cf260 Merge "usb: dwc3-msm: Add usb_ep_autoconfig_by_name" 2019-10-31 14:44:59 -07:00
qctecmdr
8a9739baf5 Merge "cnss_genl: Use new structure for genl" 2019-10-31 13:49:24 -07:00
qctecmdr
8db00d553d Merge "serial: msm-geni-serial: Remove usage of wakeup_source_init API" 2019-10-31 12:58:22 -07:00
qctecmdr
d63fbd0841 Merge "drivers: pinctrl: msm: Add fwnode when setting up hireachy" 2019-10-31 12:15:33 -07:00
Vivek Aknurwar
ee3bb8c044 clk: dt-bindings: gcc: Add USB PIPE clocks
Update header file for usb pipe clock constants.

Change-Id: I459339210549e3f42c6ac0e578f6e9ffb5c5d1df
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
2019-10-30 16:38:23 -07:00
Vivek Aknurwar
009694fac6 clk: qcom: clk-alpha-pll: Remove zonda pll set rate delay
Remove zonda pll set rate delay as it deemed unnecessary.

Change-Id: I0f2e564a7b979c0a11b751ca2eaf952a8b11591d
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
2019-10-30 16:34:38 -07:00
Vivek Aknurwar
f1e212735a clk: qcom: clk-alpha-pll: Add support for controlling zonda5lpe PLL
Add programming sequence support for managing the zonda 5lpe
PLL.

Change-Id: I6eaef174c42ff148503d37bdbe9ebbabd7f65238
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
2019-10-30 16:34:38 -07:00
Sumukh Hallymysore Ravindra
125cc7f8df arm64: defconfig: Enable global synx driver
Enable global synx driver for Lahaina.

Change-Id: I0564cdf69c9e5756bb18bfc78bfddb1ecc933145
Signed-off-by: Sumukh Hallymysore Ravindra <shallymy@codeaurora.org>
2019-10-30 08:51:20 -07:00
qctecmdr
3817fdb8ea Merge "ASoC: msm: qdsp6v2: Get path delay support in compress path" 2019-10-30 06:31:57 -07:00
qctecmdr
b57987c390 Merge "scsi: ufs: Fix compiler warning" 2019-10-30 05:43:08 -07:00
qctecmdr
8a43707391 Merge "arm64: defconfig: Enable shmbridge driver" 2019-10-30 04:30:54 -07:00
qctecmdr
69b59e60a9 Merge "shmbridge: GKI change for shmbridge" 2019-10-30 03:37:40 -07:00
qctecmdr
26acd07108 Merge "cnss_prealloc: Use new API to print stack trace" 2019-10-30 02:52:35 -07:00
Prudhvi Yarlagadda
07ee3ac09c serial: msm-geni-serial: Remove usage of wakeup_source_init API
Remove usage of wakeup_source_init API as the support for this
API is removed in wakeup.c file. Instead use wakeup_source_register
and wakeup_source_unregister APIs.

Change-Id: I0d7f759e6bf0388c713f7ffc4f157e61a25278be
Signed-off-by: Prudhvi Yarlagadda <pyarlaga@codeaurora.org>
2019-10-30 14:37:18 +05:30
qctecmdr
d905a441da Merge "usb: dwc3: Enable PHY deep low power mode in L1 suspend" 2019-10-30 02:02:19 -07:00
qctecmdr
a967b13c53 Merge "ion: msm: Add support for ION heaps to implement prefetch and drain" 2019-10-29 23:58:33 -07:00
qctecmdr
52de9f7d6a Merge "usb: dwc3: Add DWC3 MSM driver" 2019-10-29 23:11:35 -07:00
Maulik Shah
2735656c73 drivers: pinctrl: msm: Add fwnode when setting up hireachy
Setup fwnode when adding parent domain in hireachy. This is
required by gpiolib.

Change-Id: I5e63320fb874fb05f548bf55e9fd8409de2095d0
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
2019-10-30 10:20:52 +05:30
qctecmdr
405efd471f Merge "defconfig: enable power drivers for lahaina" 2019-10-29 21:36:57 -07:00
qctecmdr
f0d641f06a Merge "of: reserved-memory: Bypass rmem initialization check for carveouts" 2019-10-29 20:52:01 -07:00
qctecmdr
c5f936a25c Merge "cpuidle: lpm-levels: Update functions to static" 2019-10-29 20:13:15 -07:00