tty: serial: Use "no_log" readl/writel variants in hsl_read/write

hsl_read and hsl_write both directly call ioread32/iowrite32, which
leads to either a __raw_readl or __raw_writel call. These
readl/writel call are logged to the register trace buffer (RTB) by
default and generate a very large amount of output. This patch
directly calls __raw_readl_no_log and __raw_writel_no_log in
hsl_read and hsl_write to avoid logging these events to the RTB.

Signed-off-by: David Garibaldi <dgaribal@codeaurora.org>
Change-Id: Id3ed11182ba1aa0be1263d193a1671ad36237d33
Revert "msm: camera: Fix various small issues in sensor driver"

This reverts commit 0e0b0609cb9090c3f5a5bce589d178b1840e3928.
msm: camera: Fix VFE IOMMU page faults

To avoid VFE IOMMU page faults in case of
vfe write masters bus overflows, enable
bus overflow override flag to allow
non overflowing write masters to continue
thier operation.

Change-Id: I9452acac2b70786217b3d65029e1b68cee2fdf3e
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
msm: camera: Check length of cmd_len to zero in isp driver

Validate the length of cmd_len not to be zero
in ISP driver which is from a userspace argument.

Change-Id: I3238cd7426c5315e49c5ac7b453156e0b3d48ec0
CRs-Fixed: 548804
Signed-off-by: Hariram Purushothaman <hpurus@codeaurora.org>
msm: camera: Prevent camera suspend while active

Prevent camera from getting suspended from external
sources while the camera is active

Change-Id: Iaf3ebe8bb3ea568fb76bdcadacfe1923a872ce73
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
msm: camera: Cleanup msm generic buf queue handling

Clean-up the msm camera generic buff queue when all
client closes the handle and also provide init-deinit
ioctl for cpp to open-close the buff mngr handle.

Change-Id: Ie484174e0ffaee02e85c9c9cda8ac26103aaddd0
CRs-Fixed: 582261
Signed-off-by: Hariram Purushothaman <hpurus@codeaurora.org>
msm: camera: Non-busy polling and timeout when stopping ISPIF.

Previously a busy loop used to wait for ISPIF stop on frame
boundary. This was bad not only for busy polling, but
because if sensor has stopped streaming for some reason, the ISPIF
will never stop thus making the loop endless.
The new solution uses readl_poll_timeout macro, polling once in
millisecond for maximum of 500 milliseconds (which corresponds to
2FPS - minimum supported frame rate). If polling times out, driver
reports the error to the user space for appropriate recovery.

Change-Id: I14e9825e2c8b67bab7a2e13fa0b0ef4710456805
Signed-off-by: Petar Sivenov <psiven@codeaurora.org>
msm: camera: Fix ispif stop frame boundary timeout issue

Previously a 500ms timeout set for stop frame boundary.
But sometimes when doing snapshot with large linecount may make
the frame rate drop to 1fps. Set the timeout to 1s to avoid camera
crash.

Change-Id: Id51fb3eb58300df20e792bdab9702af7c4e18943
Signed-off-by: Ju He <juhe@codeaurora.org>
arm/dt: msm8974: Change I2C clock for main and sub camera separately

Change I2C clock for main and sub camera separately

Change-Id: Ifdd8d2458f1d47d13bed978e29ffbb23757bf860
Signed-off-by: Vasko Kalanoski <vaskok@codeaurora.org>
msm: camera2: Validate frame during timeout in cpp driver

During long stability stress runs, invalid frames are encountered
in timeout processing. When frame acknowledgement is delayed by
firmware due to various reasons the timeout handler could hit
frame that are already processed. Hence adding NULL condition
check to avoid invalid frame access.

Change-Id: Icaa5e630d5190a7bf0a4e07a95d08e116cb304db
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
camera_v2: jpeg: Use buf_cmd.offset for v2p size calculation

Start using buf_cmd.offset when calculating the memory map
size for v2p. This is needed to enable ION input buffer support
for JPEG decoding.The input buffer has a header before the actual
bitstream.

Signed-off-by: Kamen Kirov <kkirov@codeaurora.org>
Change-Id: If9bdcefe3628bd21c9e76916e4d7e3dc3cc39447
msm: actuator: fix to prevent kernel heap buffer overflow

fix to prevent kernel heap buffer overflow allows user
controlled data to be written to the heap via the
msm_camera actuator IOCTLs

Change-Id: I4458831e28e0081fb2f5ae55506be866100e1b4f
Signed-off-by: Vasko Kalanoski <vaskok@codeaurora.org>
msm: actuator: fix to prevent untrusted pointer to lead DoS

fix to prevent untrusted userspace pointer in actuator kernel
driver to lead DoS

Change-Id: I1b64270deb494530d268539e7b420be5ec79b658
Signed-off-by: Vasko Kalanoski <vaskok@codeaurora.org>
msm: camera: Fix for invalid kernel memory access

Adjust the length of the command based on command type
to avoid invalid memory access in ISP driver.

Change-Id: Ie1c23b45426f9598dba3ad1ee91e6598e8232134
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
camera_v2: Changes for dual JPEG encoding

1. Set driver state to MSM_JPEG_INIT after session done.
2. When doing reset,perform it to all JPEG hw modules.

Signed-off-by: Kamen Kirov <kkirov@codeaurora.org>
Change-Id: Id6320f47a7c2eeef8eb6911d2c222b85ed3971b1
msm: camera: fix signal error for function msm_post_event

Fix msm_post_event timeout error due to signal,
if return ERESTARTSYS, will re-call wait_event_interruptible_timeout.

Change-Id: I37b8f71564528dea1c436769adcead80bbc1ed3a
Signed-off-by: chiz <chiz@codeaurora.org>
Signed-off-by: yuyang <yuyang@codeaurora.org>
msm: camera2: cpp: Added protection for Timeout processing.

The timeout processing can be triggered due to delayed
tasklet processing. This change serialize timeout processing
with tasklet.

Change-Id: I4b79d8616406a5570727854479224d96b98b79c5
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
msm: Fixing the Green frame issue in Raw snapshot

After Taking the Raw snapshot we should wait for the
Completion

CRS-Fixed: 530862
Change-Id: I6af0681a29dd478d3ff50af1ea31757c0f3b2e7e
Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>
msm: camera2: Enhance processed divert in cpp driver.

The processed divert frames from cpp driver can be queued back
to free queue or queued in done queue. This change enhances
cpp driver to support both modes of operation.

Change-Id: I2ec08bd9c25fdb1db089d974c935e97898840e39
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
msm:cpp: Check number of buffers before allocate stream_info

Number of buffers used by cpp is defined by user space. In
case this number is ZERO the allocated memory space will be
pointed by ZERO_SIZE_PTR. Referencing ZERO_SIZE_PTR, causes
same type of behavior as referencing the NULL pointer

Change-Id: I42665225c7d055cda6749198c35e94c1442c6d3e
Signed-off-by: Iliya Varadzhakov <ivarad@codeaurora.org>