Commit graph

571131 commits

Author SHA1 Message Date
Abhijeet Dharmapurikar
c62a2d77f2 qcom-charger: add qnovo driver
Qnovo hardware module controls battery charging pulses. Pulse
characteristics are programmed via sysfs files, this driver
translates those values to register values and writes to appropriate
registers.

CRs-Fixed: 1018090
Change-Id: I2573f719f4b2c2fa9a169659a65433fb834ea74e
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-06-15 16:10:14 -07:00
Harry Yang
addadeb7da ARM: dts: msm: enable charging in msmcobalt
Enable charging by default, but disable it for CDP, RUMI and SIM.

CRs-Fixed: 1024022
Change-Id: Ie713f020201cafe6d815c7da5e87ea1566ac36ad
Signed-off-by: Harry Yang <harryy@codeaurora.org>
2016-06-14 14:45:12 -07:00
Sureshnaidu Laveti
f0c5be8a96 msm: sensor: Add support for downloading OIS coefficient and framework
Add OIS framework and coefficient download in OIS driver.

Change-Id: Iff8e1c0367d13bb0d89946d81fb79427b6ef070e
Signed-off-by: Sureshnaidu Laveti <lsuresh@codeaurora.org>
2016-06-14 14:45:00 -07:00
Stephen Oglesby
4e9f522a76 ASoC: wcd9335: Infinite loop when routing DMIC for handset ANC
When routing DMIC input to ANC block for handset ANC usecase,
codec driver enters an infinite loop attempting to determine
the stream sample rate. Additionally since the noise DMIC is
configured prior to the rest of the usecase, we cannot deterine
the stream sample rate to configure the ANC block for half-rate.
Therefore revert that logic and let ANC block be configured
according to the device tree.

CRs-fixed: 997662
Change-Id: I311ad8f158b0be6e9d6481512860f9fac10afc1f
Signed-off-by: Stephen Oglesby <soglesby@codeaurora.org>
2016-06-14 14:44:43 -07:00
Arun Menon
85b2e6c6a4 msm: vidc: Fix Low latency step size
Low latency step size was inadvertently removed
by a previous commit. Fix the error.

CRs-Fixed: 1027653
Change-Id: I843f35ee08159c59aaee7df4a23dfb4ae9c6b689
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
2016-06-14 14:44:31 -07:00
Subash Abhinov Kasiviswanathan
423baa4afd defconfig: arm64: msmcortex: Add defconfigs for IPSec data calls
Add the DUMMY network interface and the crypto modules needed
for tunneling in advanced data call scenarios.

ECHAINIV is the default algorithm for CBC which is needed for
setting up a tunnel using XFRM state. Dummy network device is used
to route the IPv6 tunneled traffic when there is no IPv6 route
present on a wireless device. The default route in the dummy
interface routing table will route egress packets.

CRs-Fixed: 1024966
Change-Id: I4706b353e63b044368ea54a8ed74d61dc44dc95c
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-06-14 14:44:19 -07:00
Stephen Oglesby
9fca33dfb6 ASoC: wcd9335: Adjust DMIC clock based on sample rate
Currently DMIC clock is set at 4.8MHz for all sampling rates. For
optimal power, sampling rates <=48KHz should be set to 2.4MHz.

CRs-fixed: 971183
Change-Id: If3076f017d476cfb57fa22b75cc74ed615c8882e
Signed-off-by: Stephen Oglesby <soglesby@codeaurora.org>
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-06-14 14:44:04 -07:00
Dhanalakshmi Siddani
f47eab663e ASoC: msm: qdsp6v2: do not set cmd_interrupt flag in eos for gapless
cmd_interrupt flag is set during first stream's stop in gapless playback
but it is not reset after receiving eos ack. This interrupts second
stream partial drain and eos is sent to client, which leads to session
close causing audio mute. Do not set cmd_interrupt during gapless
transition to fix the issue as no one is waiting for eos.

CRs-Fixed: 1012546
Change-Id: Ibcbdde0ea59ff80a798de0b894c2239899260860
Signed-off-by: Dhanalakshmi Siddani <dsiddani@codeaurora.org>
2016-06-14 14:43:53 -07:00
Yeleswarapu Nagaradhesh
2e3808f57f ASoC: wcd-mbhc: disable moisture detection for NC Jack
Moisture detection is needed only for NO jack type.
So disable moisture detection feature for NC Jack.

CRs-Fixed: 1012001
Change-Id: I93f72f18145ddef6a0caf2c59a9af5f23e6e20a3
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
2016-06-14 14:43:39 -07:00
Prashanth Bhatta
08d6ac2e67 icnss: Add statistics to know driver status
Add statistics to know driver status which in turn helps in
debugging issues.

Change-Id: I68fa6f510d55822b01c2ea5062d4876c4420c5f7
CRs-fixed: 1026135
Signed-off-by: Prashanth Bhatta <bhattap@codeaurora.org>
2016-06-14 14:43:26 -07:00
Manoj Prabhu B
07ab290b8a diag: dci: Fix possible race condition during SSR
This patch fixes the possible race condition
because of the stray dci_mutex unlock statements.

CRs-Fixed: 1027461
Change-Id: I10f3c6d1e2d3c6e71be04e3206273aad7971a6b5
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2016-06-13 19:06:29 -07:00
Sahitya Tummala
1eccf8da48 mmc: core: Fix the timing related checks in partial_init
If the card (which is a eMMC 5.1 complaint card) is scaled down
to HS200, then the current logic in partial_init doesn't invoke
tuning due to these invalid checks.

Change-Id: I1e5cbb6a2dfff129acdb27e27ea090d58197f41c
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-06-13 19:06:28 -07:00
Sahitya Tummala
31c3678a62 mmc: cmdq_hci: disable CDR in CQ mode
The CDR is supposed to be enabled only for read commands but
since there is no way it can be done in CQ, disable it completely
in CQ mode.

The CDR gets enabled by default whenever tuning is done in legacy
mode. Hence, make sure to disable it when CQ is enabled or when
CQ is unhalted.

Also note that CDR plays a role only in these bus speed modes -
HS200 and HS400 with enhanced strobe disabled.

Change-Id: Ie3917ac9b573dfef514f82e5073d1c480cd9a71d
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-06-13 19:06:27 -07:00
Sahitya Tummala
876f792092 mmc: sdhci: update sdhci_cmdq_set_transfer_params()
Add the functionality to disable CDR to
sdhci_cmdq_set_transfer_params() so that CQ driver can
use it appropriately.

Change-Id: I5182b48523e7f9511265fa557433b88224318a23
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-06-13 19:06:26 -07:00
Sahitya Tummala
b3ab0db2c7 mmc: mmc: fix issue with clock scaling in HS200 mode
The scaling logic for HS400 is triggered when the card timing
mode is HS400 or when the clock rate is MMC_HS200_MAX_DTR. But
this is the same rate used in HS200 mode as well. Due to this,
in HS200 mode also, the card enters into the scaling logic meant
for HS400 which is not correct.

Correct this logic by checking the card timing in addition to the
clock rate in HS400 clock scaling logic.

Change-Id: If6261c0e42178d331184ac605c192d48a76e1e29
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-06-13 19:06:26 -07:00
Sahitya Tummala
ecce69193d mmc: sdhci-msm: use PIO for tuning commands
There are issues with ADMA when used with ICE enabled for tuning
commands. As a workaround, use PIO mode for these commands by
enabling quirk SDHCI_QUIRK2_USE_PIO_FOR_EMMC_TUNING .

Change-Id: I8dbec823938525af90fb990db1bb4b325ee23cba
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-06-13 19:06:25 -07:00
Sahitya Tummala
f8fb46ff55 mmc: sdhci: Add new quirk to use PIO for eMMC tuning commands
Some controllers have an issue using ADMA for tuning commands.
Add a quirk - SDHCI_QUIRK2_USE_PIO_FOR_EMMC_TUNING to use PIO
mode for tuning commands on those host controllers.

Change-Id: Id9625167d7e235fb3a20a6193889c1654b5c0cd8
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-06-13 19:06:24 -07:00
Sahitya Tummala
7b9f9abcda mmc: sdhci-msm: enable quirk to define non standard tuning
Some controllers need SW to compare the data received
from the card for a tuning command. Enable this quirk -
SDHCI_QUIRK2_NON_STANDARD_TUNING for sdhci msm host
controller.

Change-Id: Id6f6230520db1ad018c883cb639fe66b4b86c70c
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-06-13 19:06:23 -07:00
Sahitya Tummala
021c0723ab mmc: sdhci: add a quirk to define non standard tuning
Some controllers need SW to compare the data received
from the card for a tuning command. Add a quirk for
such non standard controllers so that they can read
the data from the controller using ADMA/PIO and do the
tuning sequence from SW to determine the appropriate phase.

Change-Id: I15edfdf0442e3ac678c70df29482b3304cf1215a
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-06-13 19:06:23 -07:00
Sahitya Tummala
e692b64f84 mmc: sdhci: Implement set_transfer_params() cmdq host op
This is needed to set the dma mode for CQ transfers. The dma mode
may be changed by the commands sent in legacy mode (like tuning
which uses FIFO mode).

Change-Id: Idaa2cb0c7712846f6827272caefc112b127ef818
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-06-13 19:06:22 -07:00
Sahitya Tummala
d199adf139 mmc: cmdq_hci: add set_transfer_params() to CQ unhalt
Some of the transfer parameters like DMA mode will be changed
only when CQ is in HALT state to send some legacy commands like
tuning etc.

Also, fix a typo with set_transfer_params() host op.

Change-Id: I3a9856e0d60ce6a9cc1727cd8ccd10ef33bb707c
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-06-13 19:06:21 -07:00
Sahitya Tummala
970129b06d mmc: cmdq_hci: set block size as part of CQ unhalt process
Data CRC errors are observed for the data commands that are
sent immediately after tuning in HS200 mode with CQ enabled but
in HALT state. This is because tuning commands change the block
size to 128 bytes from the default 512 bytes.

Change-Id: I9657b16954b54c491fa19f9d82d9141edf45e0ef
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-06-13 19:06:21 -07:00
Asutosh Das
20e43d0532 mmc: core: fix reading the bkops status from card
The bkops status is indicated by the bit 0 and 1 of the
246th byte of the ext_csd register.
The current code doesn't ignore the rest of the byte.

Fix this by extracting the bit 0 and 1 only
for the current bkops urgency.

The exception level is defined by the least significant
nibble of 54th byte in the ext_csd register. The current
code doesn't ignore the rest of the byte.

Fix this by extracting the nibble(LSB) for exception status.

Change-Id: Ic90fe26a676ae7dd2063e17bc3771db83605f4dc
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-06-13 19:06:20 -07:00
Ritesh Harjani
240bee3ffd mmc: mmc: Add clk_hold/release pair before caching host->ios
We need to add mmc_host_clk_hold/release pair before caching
host->ios. Since it may so happen that the clks are gated
while caching and thus in next CMD5 awake, changing clk back to
cached_ios->clk might give NOC error.

Change-Id: I32b8c1bbbd67b4daadaa85c3c01beab8ff1b7cb2
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2016-06-13 19:06:19 -07:00
Pavan Anamula
3c7b269a36 drivers: mmc: fix issue raised by source code analyzer tool
Fix the below reported issues by source code analyzer.

1) Pointer 'ext_csd' returned from call to function 'mmc_get_ext_csd'
may be NULL and will be dereferenced at ext_csd[EXT_CSD_CMDQ] in
mmc_test_awake_ext_csd(), causing NUll pointer derefernce.

2) Array 'sdhci_slot' of size 2 may use index value(s) -1 as below,
when ret = 0.

	sdhci_slot[ret-1] = msm_host;

3) Variable 'host->lock' locked ,And was not unlocked when below
condition occurs in sdhci_irq().

	if (!mmc_card_and_host_support_async_int(host->mmc))
		return IRQ_NONE;

CRs-Fixed: 1000387
Change-Id: Iec6ecef1bf940e720c871be58b265394904f0cf1
Signed-off-by: Pavan Anamula <pavana@codeaurora.org>
2016-06-13 19:06:18 -07:00
Sayali Lokhande
9ed18dec09 Revert "mmc: sdhci: Panic after dumping SDHC registers"
This reverts 'commit d49beb9a2a71 ("mmc: sdhci: Panic
after SDHC registers")'. As CMDQ is quite stable now,
removing a BUG_ON which was added internally to crash
system on error.

Change-Id: Ie0c11743fb781e765c926e3408b87eaf94dc2eb6
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-06-13 19:06:18 -07:00
Asutosh Das
aff06730c3 mmc: core: modify scaling up/down sequence
The scaling down sequence requires the clock to be set
after selecting the corresponding bus-speed mode in the
controller.
The scaling up to HS400 requires the timing and clock to
be set to legacy.

Without the above configuration, bus-width switch fails,
further leading to CRC errors.

Change-Id: If502f28e19924264dfb99d76f6881d3167f56a05
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Pavan Anamula <pavana@codeaurora.org>
2016-06-13 19:06:17 -07:00
Srinivas Ramana
e6855ed3fe arm: cpu: read all address cells in dt for cpuid
For v8/arm64 platforms the number of address-cells can be 2.
If the same device tree is used on 32-bit platforms,it is
currently reading only one cell of 32-bits.

Fix this by reading both cells for getting the hwid.

Change-Id: Id281b6b8ac3c9312848c39e11019284f970caced
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
2016-06-13 19:06:16 -07:00
Abhijit Kulkarni
5f47a78399 msm: mdss: add validation for dest scaler count
User space can send the commit message with the dest scaler
structure populated and dest scaler count as 0, this would
cause null pointer access, this change adds validation for both
the fields.

Change-Id: I7a4ad3188f7a19427c096a596a502debdc2aac55
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2016-06-13 19:06:16 -07:00
Vinayak Menon
0b8c4c2cee mm: fix cma accounting in zone_watermark_ok
Some cases were reported on 3.18 where atomic unmovable allocations
of order 2 fails, but kswapd does not wakeup. And in such cases it
was seen that, when zone_watermark_ok check is  performed to decide
whether to wake up kswapd, there were lot of CMA pages of order 2 and
above. This makes the watermark check succeed resulting in kswapd not
being woken up. But since these atomic unmovable allocations can't come
from CMA region, further atomic allocations keeps failing, without
kswapd trying to reclaim. Usually concurrent movable allocations result
in reclaim and improves the situtation, but the case reported was from
a network test which was resulting in only atomic skb allocations being
attempted. On 3.18 this was fixed by adding a cma free page counter and
accouting the cma free pages properly in watermark calculations.

Later this issue was indirectly fixed by the commit "mm, page_alloc:
only enforce watermarks for order-0 allocations".

But the commit "mm: add cma pcp list" brought the problem back because
it includes MIGRATE_CMA within MIGRATE_PCPTYPES, and thus watermark
check erroneously returns success for !ALLOC_CMA by finding free pages
in cma free list.

Change-Id: Id0e48b5c2f9deea93c5875c10d5ec72bd360df5f
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-06-13 19:06:15 -07:00
Stephen Oglesby
c6b893143d ASoC: msmcobalt: Create pinctrl entries for ground/mic swap GPIO
The GPIO to control the gound/mic swap switch is now on the Apps
processor. Create new entirees in pinctrl device tree to enable
headsets with swapped ground/mic poles.

CRs-fixed: 1019254
Change-Id: Ie57950e0fb979807ef95cf21046c97617e286ed0
Signed-off-by: Stephen Oglesby <soglesby@codeaurora.org>
2016-06-13 19:06:14 -07:00
Stephen Oglesby
bbcb775829 ASoC: msmcobalt: Switch ground/mic swap GPIO control to pinctrl
Switch to swap ground and mic headset poles is controlled by a
GPIO on the Apps processor instead of the PMIC, and therefore
software logic must change to use pinctrl APIs

CRs-fixed: 1019254
Change-Id: Ibccddc82b18614ddbe6ef9c9720b3de1ce00163e
Signed-off-by: Stephen Oglesby <soglesby@codeaurora.org>
2016-06-13 16:18:31 -07:00
Mayank Rana
402fc23f0c usb: hcd: Fix double free with bandwidth_mutex on cable disconnect
Roothub's (udev->dev) can  be asynchronously suspended due to
power.async_suspend is set to true i.e. at time of system suspend and
resume, these devices' (usb1 and usb2) kobject count is decremented
and incremented respectively. hcd_release() API expects that shared_hcd
is being released first before hcd. Due to additional reference count
at time of system resume, it results into hcd_release() is called
first with hcd (primary) and then shared_hcd. With this,
usb_hcd_is_primary_hcd() API is returning true for both hcd and
shared_hcd which results into double free of bandwidth_mutex. Fix this
issue by identifying hcd to release bandwidth_mutex without depending
on which order hcd_release() is called with hcd and share_hcd.

CRs-Fixed: 955531
Change-Id: I6bfcfd54525fa6472bd848d4c112fff0c9462355
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-06-13 16:18:16 -07:00
Venkat Gopalakrishnan
83d6783854 mmc: core: Add NULL check for host->card
Make sure the card is present before enabling/disabling clock scaling,
to prevent NULL pointer access.

Change-Id: I1d683c4202ce34edeb6cb36d9713e226bb6f43d7
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-13 16:18:05 -07:00
Sahitya Tummala
07a520f6aa mmc: sdhci-msm: Don't enable MMC_CAP2_FULL_PWR_CYCLE
The commit '6e2df8c0e' incorrectly sets this capability.
This needs to be set only if the host is capable of disabling
both vcc and vccq. For SDHCI MSM host controllers only vcc
is disabled during suspend. Hence, remove this capability
for MSM hosts.

Change-Id: I69f9dacaa042e9f9a0bc4ed886f97c5c4a3b9791
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2016-06-13 16:17:53 -07:00
Phani Kumar Uppalapati
48fb96241b soundwire: Fix NULL pointer dereference
Fix NULL pointer dereference in soundwire master controller
driver.

CRs-fixed: 1018329
Change-Id: I716401adda144ac0c03520f747694eaa50ea8e51
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-06-13 16:17:41 -07:00
Viraja Kommaraju
e373447761 ASoC: wcd9330: Fix MCLK enable/disable issue in wcd9330 driver
In wcd9330 driver, external clk enable callback function
is passed with argument as true always, instead of passing
the arguments from caller. This is leading to mclk users
count to increase without check.

CRs-fixed: 1013573
Change-Id: I113657c91dd5eb00791535dc78b7cdad1db5c4aa
Signed-off-by: Viraja Kommaraju <virajak@codeaurora.org>
2016-06-13 16:17:28 -07:00
Phani Kumar Uppalapati
139941fc1e ASoC: wcd9335: Avoid TX mute during voice call on headset
If long button is pressed to end the voice call, the button
click suppression block within wcd9335 hardware does not
release IN2_P causing TX mute for the next voice call session.
Avoid TX mute by force release IN2_P during every voice call
start.

CRs-fixed: 1013280
Change-Id: I5af41bef6db6af14d53018caef1f7fd9b00fc136
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-06-13 16:17:17 -07:00
Sudheer Papothi
3642616f39 ASoC: msm: Add 48KHz sample rate support for CPE CPU DAI
Voice recognition engine can support 48KHz sampling rate. Change
enables 48KHz support for CPE(Codec Processing Engine) CPU
DAI(Digital Audio Interface).

CRs-fixed: 1022917
Change-Id: I6e1bd314af1311af73704bdfd9cdc5d2cb849557
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2016-06-13 16:17:05 -07:00
Surendar karka
0a1b166b0b drivers: mfd: Set ANC gain register as volatile
ANC register values are not correct, so add ANC0,
ANC1 registers to volatile register list.

CRs-Fixed: 1017287
Change-Id: I40e12b9ce8d6751c0a6dc0bd3c780b92c499b7dc
Signed-off-by: Surendar karka <sukark@codeaurora.org>
2016-06-13 16:16:55 -07:00
Vijayavardhan Vennapusa
e3f1df3ed2 USB: f_mtp: Don't reset string id during function_unbind
Currently MTP driver is resetting string id during unbind, when
cable is disconnected. Due to this, composite driver might run out
of string ids, when it tries to allocate string id during next
composition switch to MTP. This results in composition switch failure
when MTP is selected and eventually causing USB enumeration failure.
Fix this by not resetting string id and allocate it once only.

Change-Id: Ieacdc8dd76bc45638002eb749ff87aa95f496fa3
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2016-06-10 15:15:23 -07:00
ChandanaKishori Chiluveru
8b910ce20e usb: gadget: f_mtp: Fix mtp enumeration failure issue
If cable is disconnected while send_file work is in progress,
Endpoints will be disabled and state will be marked as OFFLINE.
As a part of endpoint disable pending requests will be retire out
with -ECONNRESET error. Due to this we will modify the device state
as ERROR in completion callback. If the state is not offline then
we will mark the device state to ready in send_file_work. This results
in mtp driver to not returning any error for next mtp_write operation
and mtp release will not be called.

Hence fix this issue by adding a proper check in completions to not
moving device state to ERROR in case of disconnect.

Change-Id: Idb4e075c89bdf94790a321bc464d30eba546eeaa
Signed-off-by: ChandanaKishori Chiluveru <cchilu@codeaurora.org>
2016-06-10 15:15:10 -07:00
Hemant Kumar
0a9a9f3fe1 usb: gadget: f_mtp: Change the icon to camera for PTP composition
The existing code shows the phone icon in 'My Computer' of windows host,
for PTP composition.
Create a new Extended Configuration Descriptor for PTP composition and
update the compatibleID to display a camera icon for PTP composition.

Change-Id: If286c5b80874a95be0b5ecc533d0e5c7a14f39d3
Signed-off-by: Azhar Shaikh <azhars@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-06-10 15:14:33 -07:00
Hemant Kumar
79dc83a8cb usb: gadget: f_mtp: Add support to capture time taken with vfs_write/read
This change captures time taken by each vfs_read() and vfs_write() call
made from USB MTP gadget driver where data size is equal to USB request
buffer size. It provides debugfs entry to get this information for 100
such call and resetting the same.

How-To use:
To get stats:
cat /sys/kernel/debug/usb_mtp/status
To reset stats:
echo 0 > /sys/kernel/debug/usb_mtp/status

Change-Id: I252e830568704e9e557660c1ae0f7597823e4b17
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-06-10 15:14:24 -07:00
Hemant Kumar
9f9acf870f usb: gadget: f_mtp: Fix issue of NULL pointer access in mtp_read
MTP usb device node created as a part of mtp function init call.
Userspace can read/write to MTP device using this node. If MTP is
not enabled in the composition and trying to read mtp_usb dev node
from the userspace leading to null pointer access in mtp_read.

Do not access ep OUT maxpacket size in mtp_read. First block on mtp_read
until the state become online which doesn't wakeup from the thread and
expecting for the read completion or state change which occurs as
a part of set_alt.

Change-Id: Icbee5fe7ae2c02b2bca185a0dc7587eb4940058a
Signed-off-by: ChandanaKishori Chiluveru <cchilu@codeaurora.org>
Signed-off-by: Azhar Shaikh <azhars@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-06-10 15:14:12 -07:00
Hemant Kumar
ff1259b38e USB: gadget: Implement COMPAT_IOCTL for ioctls
32-bit userspace calling into 64-bit kernel
cause different ioctl codes to get generated.
The different ioctl code gets generated
because sizeof is used on mtp and accessory
structures which is different for 32/64
compilation. Because of this, 64-bit kernel
can never execute the right ioctl command.

Implement compat_ioctl to handle such
execution environment.

Change-Id: I26cc10986e28a28eab6f3c65f28f4d2b808112d9
Signed-off-by: Sujeet Kumar <ksujeet@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-06-10 15:14:01 -07:00
Hemant Kumar
78ece44dc6 USB: gadget: f_mtp: Fix bug in receive_file work
If cable is disconnected while receive_file work is in progress,
there is a case where mtp driver returns -ECANCELLED instead of
-EIO. This results in mtp server thread not getting disconnect
notification and mtp release will not be called. Due to this, mtp
server will not start mtp connection after next USB connection.

Change-Id: I909bebe0d22c19329cebb0a4a76424e08c82328c
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-06-10 15:13:49 -07:00
Hemant Kumar
fa1ac1406a USB: gadget: mtp: Fix bug in freeing memory on allocation failure
Current driver code doesn't handle the memory allocation failure
correctly and ends up leaking memory and trying to free
unallocated one.

Change-Id: I7e3527b7e08ccfe566d85e3009d8a015d8daa707
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-06-10 15:13:37 -07:00
Gaurav Singhal
917e41ac91 NFC: Error handling correction in probe
Error handling check added in probe function and
memory cleanup in remove function.

Change-Id: Ic8f02dcc89e716ec88b711496d1e43754b95968d
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
2016-06-10 15:13:25 -07:00
Shubhraprakash Das
87574457d0 msm: camera: isp: Enable write master for stats
In vfe 48 version the stats write masters have to be enabled
in addition to enabling the stats module. Add code to do this.
Also, the stop of write master was not programmed correctly, fix
this.

CRs-Fixed: 999619
Change-Id: Ic5b38b038508802b0b5779dc5d54ec6772f24b65
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2016-06-10 15:13:13 -07:00