If CONFIG_IOMMU_DEBUG_TRACKING=y, a deadlock will occur if userspace
writes to the debugfs file "attach":
-001|context_switch(inline)
-001|__schedule()
-002|__preempt_count_sub(inline)
-002|schedule()
-003|schedule_timeout()
-004|do_wait_for_common(inline)
-004|__wait_for_common(inline)
-004|wait_for_common()
-005|wait_for_completion()
-006|__synchronize_srcu()
-007|synchronize_srcu()
-008|debugfs_remove_recursive()
-009|iommu_debug_detach_device()
-010|__iommu_detach_device()
-011|__iommu_group_for_each_dev(inline)
-011|__iommu_detach_group()
-012|iommu_detach_device()
-013|iommu_debug_device_profiling()
-014|iommu_debug_device_show()
-015|seq_read()
-016|full_proxy_read()
-017|__vfs_read()
-018|vfs_read()
Since the files in the attachment directory are rarely used, remove
them. Update the data saved by this config option to work properly
with iommu groups.
Change-Id: I3f0f1d0836f37412915ce3e78d8aefe92dc8d096
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
[lmark@codeaurora.org: deadlock is not an issue on this branch
but this change is backported because there are security benefits
from removing the iommu debugfs attachments nodes, such as removing
register access.]
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Add Writeable registers list for Digital codec and soundwire codec
regmap config to avoid invalid register access during reg_cache_sync.
Ensure digital codec clock is enabled before regcache sync to avoid
AHB access errors.Modify mutex use to avoid clock disabling during
regmap register access.
Change-Id: I8ab84f80298e01d145395f1347352afe5cfbcc9e
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
The current touch panel driver uses bit 5 in major hardware version to
decide panel used between 800S and 800H.
By setting the bit to 1 means 800S used while to 0 means 800H.
Change-Id: Ibec2678a985b1db385c648884377a7b2ef6df795
Signed-off-by: Jiangen Jiao <jiangenj@codeaurora.org>
pm660_ldo10 supplies power for multiple consumers including UFS.
The load from UFS is invisible for the regulator before the driver
voted it. Any other light load consumers would vote its load and
force the regulator entering into LPM mode which cause OCP triggered.
Add proxy voter for pm660_ldo10 to track this existing UFS load.
Change-Id: I32759025e0349858eaafb6a3b062a6c64314ccfe
Signed-off-by: Yingwei Zhao <cyizhao@codeaurora.org>
Currently the interrupt trigger type is configured as NONE. This
causes a level handler to be assigned to these interrupts.
However, all of them are edge triggered interrupts with varying
falling/rising/both edge flavors. Update the device tree to
use their correct trigger types thereby preventing missed interrupt
storms because of incorrect handler types.
CRs-Fixed: 2005675
Change-Id: Ic50aeecda34d671e84bdfd7868aad050feb2ea3c
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Make HDMI device as the interrupt parent of CEC device, so add
the new IRQ domain in HDMI driver dealing with the necessary
IRQ mapping.
Change-Id: Id935da1d1e488ccee01b831b9f085a83d67268f2
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Keep first instance name as f_audiosource and change name
for next intance as per number of instance.
Change-Id: I9888d10e1faceff16f950f20ac42261417f1d8e8
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
On some ADP board, after writing CCI command to sensor, msm_cci_wait
timeout issue happens sometimes during b2b stress testing.
All the error cases indicate needing 510 msec to get completion from irq,
so change the timeout value from 500 msec to 600 msec.
CRs-fixed: 2052210
Change-Id: Ie70a86de6b2d7eab823ad700be5ee748a3f5e800
Signed-off-by: Andy Sun <bins@codeaurora.org>
Update QoS settings for A508 VBIF based on recommendation.
VBIF_GATE_OFF_WRREQ_EN register needs to be programmed by SW.
Change-Id: I7d41c8350ad09c595f288bd2a2b45fc2abef15f8
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
Without clock-cntl-support setting, some of ispif clocks will be
enabled without set rate.
Have to add clock-cntl-support to let clock-control setting in device
node to take care of which ones should init rate.
Change-Id: I836cf1578f198d7370e347336f334e9929b57994
Signed-off-by: Andy Sun <bins@codeaurora.org>
Assign address of buf_info into ioctl_ptr.
Previously we were copying first 8 bytes of buf_info (content)
into ioctl_ptr. Which is dereferenced and written later causing
kernel overwrite vulnerability.
CRs-fixed: 2013631
Change-Id: Ia27dafe003c2c4d7a59dc2976bee2cfc15978403
Signed-off-by: Terence Ho <terenceh@codeaurora.org>
Signed-off-by: Andy Sun <bins@codeaurora.org>
The digital and analogue voltages could vary on different platforms
and update the same for automotive ADP board.
Change-Id: I2b6874f8bcc5c6e780cece82014a969812b683fa
Signed-off-by: Terence Ho <terenceh@codeaurora.org>
Signed-off-by: Andy Sun <bins@codeaurora.org>
Enable ais build for automotive platforms.
Change-Id: If24cf52e35aacd167081712516d2d0cf18a6e283
Signed-off-by: Terence Ho <terenceh@codeaurora.org>
Signed-off-by: Andy Sun <bins@codeaurora.org>
Poll messages that are used to allocate a logical address should
use the same initiator as the destination. Instead, it expected that
the initiator was 0xf which is not according to the standard.
This also had consequences for the message checks in cec_transmit_msg_fh
that incorrectly rejected poll messages with the same initiator and
destination.
Change-Id: I01b5d4fef7caa370b0f4fb154360495a7dce5332
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 42980da2eb7eb9695d8efc0c0ef145cbbb993b2c
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Due to an incorrect condition the last_la used for the initial attempt at
claiming a logical address could be wrong.
The last_la wasn't converted to a mask when ANDing with type2mask, so that
test was broken.
Change-Id: I3d0f3f6bea3045808333cfde55ecd677e7799ce2
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f9f96fc10c09ca16e336854c08bc1563eed97985
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
This race was discovered by running cec-compliance -A with the cec module debug
parameter set to 2: suddenly the test would fail.
It turns out that this happens when the test configures the adapter in
non-blocking mode, then it waits for the CEC_EVENT_STATE_CHANGE event and once
the event is received it unconfigures the adapter.
What happened was that the unconfigure was executed while the configure was
still transmitting the Report Features and Report Physical Address messages.
This messed up the internal state of the cec_adapter.
The fix is to transmit those messages with the adap->lock mutex held (this will
just queue them up in the internal transmit queue, and not actually transmit
anything yet). Only unlock the mutex once everything is done. The main thread
will dequeue the messages from the internal transmit queue and transmit them
one by one, unless an unconfigure was done, and in that case any messages are
just dropped.
Change-Id: I554811aa51e6781e6f9141d59f38d7c540ed5b10
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f60f35609f89ef4fee73776bc1ef697923251995
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
It's only a small function and this makes it easier to switch to
transmitting the message with adap->lock held in the next patch.
Change-Id: Ic5c134e40abbb7d3b4d008c4dcf703852c2d7b0f
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: d3d64bc7408f1ff0b0ff8354056e2a48eda5886d
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The fill function just fills in the cec_msg struct, it doesn't transmit
the message. This is now done explicitly.
This makes it possible to switch to transmitting this message with adap->lock
held.
Change-Id: I161f021c2a2959bdafac38f54e5b232ae4e57188
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 52bc30fda9622f492427d484bd4dd8ee42cc4667
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The loop that sets the unused logical addresses to INVALID should be
done before 'configured' is set to true. This ensures that cec_log_addrs
is consistent before it will be used.
Change-Id: I90608740aa37869dadcb068c93896be2cb77697e
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 7af26f889eb67db272021a939f7d4a57e96dd961
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
This is a 2.0 only message, so it should return Feature Abort if the
adapter is configured for CEC version 1.4.
Right now it does nothing, which means that the sender will time out.
Change-Id: I6bdf5e08e075cf071b7f5e0b3996bc111d1f89a7
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: a24f56d47930492c94ef6875bf45adf7607ca1a4
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
When a pending message was canceled (e.g. due to a timeout), then the
old tx_status info was overwritten instead of ORed. The same happened
with the tx_error_cnt field. So just modify them instead of overwriting
them.
Change-Id: Id1c8a7910e6a9966f8a9ffc679845005f78e0e30
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 120476123646ba3619c90db7bcbc6f8eea53c990
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
In the (very) small print of the REPORT_CURRENT_LATENCY message there is a
line that says that the last byte of the message (audio out delay) is only
present if the 'audio out compensated' value is 3.
I missed this, and so if this message was sent with a total length of 6 (i.e.
without the audio out delay byte), then it was rejected by the framework
since a minimum length of 7 was expected.
Fix this minimum length check and update the wrappers in cec-funcs.h to do
the right thing based on the message length.
Change-Id: I123cc5fc2b6baca8cb2910bc687489329e81ca73
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f3854973f196baad5be6b62d8f5ea24b0346b63f
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The cec_allocate_adapter function doesn't need the parent device, only the
cec_register_adapter function needs it.
Drop the cec_devnode parent field, since devnode.dev.parent can be used
instead.
This change makes the framework consistent with other frameworks where the
parent device is not used until the device is registered.
Conflicts:
Documentation/media/kapi/cec-core.rst
drivers/media/i2c/adv7511.c
drivers/media/i2c/adv7604.c
drivers/media/i2c/adv7842.c
drivers/media/platform/vivid/vivid-cec.c
drivers/media/platform/vivid/vivid-cec.h
drivers/media/platform/vivid/vivid-core.c
drivers/media/usb/pulse8-cec/pulse8-cec.c
drivers/staging/media/s5p-cec/s5p_cec.c
drivers/staging/media/st-cec/stih-cec.c
Change-Id: Id7a687308c4d3f2bc63ed2e8a55229b4e71fd8ed
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f51e80804f084de269954d875c0892b081b7df3c
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
[rayz@codeaurora.org: make some changes to fix the cherry-pick conflicts: (1)
discard the CEC documentation change. (2) discard the CEC adapter driver
changes for other vendors.]
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Some CEC adapters will receive messages that they initiated. Add a
check that will ignore such messages.
Most hardware behaves correctly in this respect, but I have seen
adapters that don't, so just filter this out in the framework.
Change-Id: I5f5f361ef9135445382764659280583fa1cbe10c
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 3f98da9636029486b86eb63f0b57b91dcbd880b0
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Make sure the TX counters are zeroed in the cec_msg struct.
Non-zero TX counters make no sense when a message is received,
and applications should not see non-zero values here.
Change-Id: I36309acfe19b42b672d7b2051adf5cf514123cba
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 8991a63d1a8a01938932319c8b98f5a3420a0bb2
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
An inner for-loop reused the outer loop variable. This was
only noticeable with CEC adapters supporting more than one
logical address.
Change-Id: Ib5cd7c3130b544a991bbc188a762e330ddee2eba
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: a161bef04286e1344cd469098213a972af8fa7d6
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The CEC_MSG_FL_REPLY_TO_FOLLOWERS message flag only makes sense for transmitted
messages where you want to wait for the reply.
Clear the flag in all other cases.
Change-Id: Icb52984770fe442416a8e46dff717b0849a7bdb4
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 7ae2a888eedd5a6b03849614eddd55f31793eeae
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The last open issues have been addressed, so it is time to move
this out of staging and into the mainline and to move the public
cec headers to include/uapi/linux.
Conflicts:
Documentation/media/Makefile
drivers/media/i2c/Kconfig
drivers/media/platform/vivid/Kconfig
drivers/staging/media/Makefile
drivers/staging/media/pulse8-cec/Kconfig
drivers/staging/media/s5p-cec/Kconfig
drivers/staging/media/st-cec/Kconfig
Change-Id: Ie46e780a7d29d773dbb9bd642059695eb580e8ad
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: 0dbacebede1e4e44bf500f94d692fad05eb2c293
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
[rayz@codeaurora.org: make some modifications to the original patch to fix
the cherry-pick conflicts. (1) discard the changes in Documentation. (2)
discard the CEC adapter driver changes for other vendors because they are
not needed.]
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
CDC-Only CEC devices are CEC devices that can only handle CDC messages,
all other messages are ignored.
Add a flag to signal that this is a CDC-Only device and act accordingly.
Also add helper functions to identify if a CEC device is configured as a
CDC-Only device, a second TV, a switch or a processor, since these variations
cannot be determined by the logical address alone.
Change-Id: I9b814a5da3bca913d784bfe5fc508cdf06a5fea4
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: a69a168a1bd470cb8a8c5f2ff4b54463de615226
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
The CEC_MSG_INITIATE_ARC message is special since it is the ONLY
CEC message that accepts two possible valid replies:
CEC_MSG_REPORT_ARC_INITIATED and CEC_MSG_REPORT_ARC_TERMINATED.
So if the transmitted message is CEC_MSG_INITIATE_ARC and the remote
side replied with CEC_MSG_REPORT_ARC_INITIATED or CEC_MSG_REPORT_ARC_TERMINATED,
then a msg->reply value of CEC_MSG_REPORT_ARC_INITIATED or
CEC_MSG_REPORT_ARC_TERMINATED will match either reply.
I thought about either adding a second reply2 field, but that's ugly
for all other messages that have only one reply, and what if in the
future a new message is added that can have three replies?
Another option would be to add a cec_msg flag, but really, the combination
of CEC_MSG_REPORT_ARC_INITIATED and a reply value of one of the two
possible replies already functions as a flag.
Another advantage of this approach is that it is safe to re-use a
cec_msg struct. No need to zero a flags field or a reply2 field.
So since this really is an exception in the CEC specification, I
decided to implement it as an exception as well.
Change-Id: I844a263703d2d2e56dd1922579910ba35c2d70bf
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f5580d8d6fd07a569e468fca51f435aa5b122fc4
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
[rayz@codeaurora.org: remove documents in the original patch to fix conflicts]
Signed-off-by: Ray Zhang <rayz@codeaurora.org>