Commit graph

571240 commits

Author SHA1 Message Date
Venkat Gopalakrishnan
1324b67285 ARM: dts: msm: enable UFS PM QoS for msmcobalt
Set latency values for PM QoS voting to 70us.
These values should be revisited in case LPM latencies change.

Change-Id: Ib37534eaf15ad76abb800fe3917f9c0a832bd30a
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-15 16:12:06 -07:00
Venkat Gopalakrishnan
a8de60e7e7 scsi: ufs-qcom: Fix null pointer dereference
Validate the existence of pm qos groups before accessing them,
to fix null pointer dereference.

Change-Id: Iddb96afac87cf3e7a1cc48f04b3c550e81bdae4b
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-15 16:11:54 -07:00
Ritesh Harjani
9e6175fca8 mmc: sdhci: Fix command response INDEX/END bit error handling
In addition to patch 71fcbda0fcddd0 (mmc: sdhci: fix command response
CRC error handling), cmd INDEX and END bit error also needs
to handle the same way as in mentioned patch.

So adding cmd index and end bit error case to it.

Change-Id: I6671bb51259515acb0733ce65be8084716d3bfbf
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2016-06-15 16:11:43 -07:00
Russell King
88e55dd551 mmc: sdhci: fix command response CRC error handling
When we get a response CRC error on a command, it means that the
response we received back from the card was not correct.  It does not
mean that the card did not receive the command correctly.  If the
command is one which initiates a data transfer, the card can enter the
data transfer state, and start sending data.

Moreover, if the request contained a data phase, we do not clean this
up, and this results in the driver triggering DMA API debug warnings,
and also creates a race condition in the driver, between running the
finish_tasklet and the data transfer interrupts, which can trigger a
"Got data interrupt" state dump.

Fix this by handing a response CRC error slightly differently: record
the failure of the data initiating command, but allow the remainder of
the request to be processed normally.  This is safe as core MMC checks
the status of all commands and data transfer phases of the request.

If the card does not initiate a data transfer, then we should time out
according to the data transfer parameters.

Change-Id: I73ac950f096fa2e81f29ecb40bdd01153c05891f
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
[ Fix missing parenthesis around bitwise-AND expression, and tweak subject ]
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org # v4.5+
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Git-commit: 71fcbda0fcddd0896c4982a484f6c8aa802d28b1
Git-repo: git://git.linaro.org/people/ulf.hansson/mmc.git
[riteshh@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-06-15 16:11:31 -07:00
Asutosh Das
21de67ad10 mmc: core: Add deferred resume support to CQ
Defer the resume of the device until a request actually
arrives, thus mandating the use of the device.

CRs-fixed: 987918
Change-Id: I41cf8908dd0f129c54b941c318e938ad7e9d36c9
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2016-06-15 16:11:20 -07:00
Dmitry Shmidt
f88fc3eaa6 mmc: Fix pm_notifier obeying deferred resume
Do not resume if deferred resume is enabled.
Only resume when a request is received.

Change-Id: I1eae7dffec97d34b066bb5738c84a7e5a82f68d7
Git-commit: ac9ac6f26904c94e8aec47cab6936dd241c2eb66
Git-repo: git://git-android.quicinc.com/kernel/msm-3.10
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
[asutoshd@codeaurora.org: merge conflicts resolved]
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2016-06-15 16:11:05 -07:00
San Mehat
7eac9a6d85 mmc: core: Add deferred bus resume policy.
A card driver can now specify that the underlying bus should *not*
auto-resume with the rest of the system. This is useful for reducing resume
latency as well as saving power when the card driver is not using the
bus. In the future, we'll add support for manual suspend

Change-Id: I077d7dc9311ff12e6e16de631abeac965c8facd9
Signed-off-by: San Mehat <san@google.com>
Git-commit: b44e6c88fc57e08562ff6b4fd68ba89cc2aa21bc
Git-repo: git://git-android.quicinc.com/kernel/msm-3.10
[asutoshd@codeaurora.org: merge conflicts resolved and
similar changes were updated in a different file; due to
changes in kernel version]
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-15 16:10:52 -07:00
Abhijeet Dharmapurikar
99f872cfe2 qcom-charger: enable qnovo bit in the qpnp-smb2 driver
The charger peripheral has a bit to control Qnovo pulse engine.
Enable it.

CRs-Fixed: 1018090
Change-Id: I2ddea8adf1aa9d999cc2fd3fd4f0e0f830147d4c
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-06-15 16:10:41 -07:00
Abhijeet Dharmapurikar
c85ea8dac9 ARM: dts: msm: add QPNP QNOVO charger device to PMICOBALT
Qnovo device is a pulse engine which works with the smb2 charger device
to charge the battery using pulses. It also provides diagnostic voltage
and current measurements at various points in the pulse train.

CRs-Fixed: 1018090
Change-Id: Ie947cc2c74550c98f64dd028c728afa57723c70f
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-06-15 16:10:26 -07:00
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