rpmsg: omx: return actual user-provided bytes written in write

rpmsg: omx: return actual user-provided bytes written in write

The 'write' system call is expected to return the number of bytes
written back to userspace. The rpmsg omx driver adds a small packet
header when sending a message to the remote processor, and is
currently returning this header length as well in the driver's write
fop function. This results in the write call always returning more
bytes than what the user has requested. The header length is now
left out of the bytes returned back.

Change-Id: I7132001fbc6fb34d01913bb3c30f455626c91658
Signed-off-by: Suman Anna <s-anna@ti.com>
rpmsg: omx: copy_from_user() errors should return -EFAULT

rpmsg: omx: copy_from_user() errors should return -EFAULT

Change-Id: Ib4a2d92dd3b8afa18e60019871cfea2e6b446a4d
Signed-off-by: David Schleef <ds@ti.com>
rpmsg: omx: return ENXIO in rpmsg_omx_write

rpmsg: omx: return ENXIO in rpmsg_omx_write

The error code, ENXIO is used in rpmsg_omx driver to indicate
a terminal error on the remote processor side. This status is
maintained during the recovery of the remote processor, while
the cdev gets reinitialized/recreated.

The rpmsg_omx's write file operation is currently not returning
this error. This has been added now to have it behave in the
same way as the read file operation.

Change-Id: I61d6e6c07aa39208d913da622ed32d809c51d409
Signed-off-by: Vidhoon Viswanathan <vidhoon@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
rpmsg: omx: send disconnect only if omx state is connected

rpmsg: omx: send disconnect only if omx state is connected

The rpmsg_omx driver sends a disconnect message automatically when the
driver's .release is called. This should be done only if a connection
has been established, otherwise just destroy the local end point.

Change-Id: I21b84aa6d91ae0d456f49cbe958f8e64caf691d5
Signed-off-by: Miguel Vadillo <vadillo@ti.com>
fs/fat/dir.c:43: warning: 'de' may be used uninitialized in this function

The complexity of the code flow makes this seem possible.  Initialize
the value to NULL to eliminate the compiler warning.  This only masks
the warning, since if the value were unused, there would still be a
NULL pointer.

Change-Id: I9fc36abace09409853b63e0997328b75ce703769
Signed-off-by: David Brown <davidb@codeaurora.org>
rpmsg: omx: add return values to the pa to da convert function

This patch adds return values to the pa to da conversion function.
This will help in propagation of proper error codes to the calling
functions.

Change-Id: Ie547f7b7e7c51eff4b7998cbd336a61663995708
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
rpmsg: omx: re-work buffer lookup to support contiguous NV12

SGX544 requires Y and UV to be contiguous in SGX virtual address space. This
is done by using single FD for two ion handles.

Change-Id: I33ced876905d74e6293a2c32df0612f01a23d13f
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
rpmsg-omx: tiler_virt2phys called for 1D buffers

While migrating to the new PVR APIs, the changes caused
a the tiler_virt2phys to be bypassed in case it is not
a PVR buffer. This patches fixes the issue

Change-Id: I9a3353053d58a7bc0ef89012de46534fad5f4b88
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Tate Hornbeck <tate.hornbeck@ti.com>
rpmsg-omx: Use ion abstraction to get handle from PVR fd

PVRExportFDToIONHandles was being called directly by rpmsg-omx.
This is now abstracted by ion and drivers should use
omap_ion_fd_to_handles instead.

Change-Id: I2f750887a048eb3d9cd28cdc9c4b08eb3e83e31b
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>

Conflicts:
	drivers/rpmsg/rpmsg_omx.c
rpmsg: omx: implement separate register ioctl for sgx buffers

rpmsg: omx: implement separate register ioctl for sgx buffers

This implements a new register ioctl specifically meant for sgx
buffers. rpmsg_omx clients are expected to call register ioctl
for the specific buffer type (ion or sgx) before sending a buffer
to .write for mapping. The registration allows the rpmsg_omx
driver to hold a reference to the ion buffers making up the sgx
buffer, thereby preventing the buffer(s) to be freed up from
under the remote processor.

The individual imported ion handles are expected to be passed
into the .write call.

When a client no longer expects remote processor to use the buffer,
client should call unregister ioctl. A separate unregister ioctl
for pvr buffers is not created, and the same ion unregister ioctl
is expected to be used for all the ion handles a sgx buffer is
comprised of.

Change-Id: Ib36aab90136627899e98717aeb29bfa637ec09fd
Signed-off-by: Tyler Luu <tluu@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>

Conflicts:
	drivers/rpmsg/rpmsg_omx.c
usb: ehci: fix the host wakeup state machine.

usb: ehci: fix the host wakeup state machine.

Current code enables host clocks and disables immediately
which can have side effects if port status change is not propagated
and clocks are cut, so enable clocks if ports are suspended
in all wakeup paths either from io-pad wakeup or through
bus resume in suspend path.

Change-Id: I5a03fcf46160176289d41cda6574c0c261a13e94
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Ruchika Kharwar <ruchika@ti.com>
mmc: OMAP HSMMC: DDR support added.

OMAP HSMMC updated to support DDR mode

Change-Id: Ifb8643e264216edf514a7e31ec989316700ee322
Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
mmc: Fix bug to enable DDR on MMC

MMC_CAP_UHS_DDR50 is an SD card feature and not
MMC feature. We don't have to check for this flag
to enable DDR on MMC. Checking for MMC_CAP_1.8V_DDR
is sufficient.

Change-Id: I6f44cb1f4dde6fe70cc816a2119c7b2b90944500
Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
cpufreq: Fix broken uevents for cpufreq governor and cpu devices

cyanogens uevent commit when the governor changes was rendered
non-working since kitkat (or so) as the uevent filter function
caused events to be dropped. Now hook into cpufreq_core_init()
and cpufreq_add_dev_interface() to create our basic ksets for
cpufreq and cpu devices. Also, we don't need to set environmental
data, so clean it up a bit.

This commit requires a change in ueventd.rc that add rules for
several files of interest.

Inspired by http://review.cyanogenmod.org/#/c/61579/
Conflicts:
	drivers/cpufreq/cpufreq.c

Conflicts:
	drivers/cpufreq/cpufreq.c
Revert "cpufreq: Fix broken uevents for cpufreq governor and cpu devices"

This reverts commit 6982acc868e57439994f101801fd7889ffd2362f.