This change updates the macro definitions to
increase the range on the logs, events and messages.
Change-Id: I8410462b17c5741fb03239377fed18c5f6034b90
CRs-Fixed: 994733
Signed-off-by: Chris Lew <clew@codeaurora.org>
Due to a known PMIC HW bug, hard reset or PR swap may result in
the charger notifying a CC disconnect event in sink mode, in which
case the handler ignores it given these conditions. However, this
closely resembles the case of a non-PD capable source getting
physically disconnected as well. Consisdering the most probable
case of this happening is disconnecting from an SDP while hard
reset was just issued (and will fail), this workaround is currently
racy if repeated plugin/plugout is performed as the timeout to
detect failed hard reset takes a few seconds.
For now, until a HW fix is available, optimize this legacy case
by allowing the disconnect to go through if the detected charger
type is SDP. Also fix the SINK_WAIT_CAP_TIME timeout as it was
incorrectly multiplied by 3 during testing and was not removed.
This will significantly reduce the amount of time for max failed
hard reset attempts for non-PD && non-SDP cases and should decrease
the window for racing with an actual disconnect.
Change-Id: Ic57a369ed1e194ab512b4b86ce4d216df46b5f46
Signed-off-by: Jack Pham <jackp@codeaurora.org>
The user space clients sometimes open the device before the underlying
transport available which results in open error and cause multiple re-tries
from the clients. This leads to excessive logging of open error messages.
Register for link state notification and block the client open until link
available or user define timer expires.
CRs-Fixed: 1018542
Change-Id: I4e56982700f3444f96e1100c0ce272d36d3423a5
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
During parallel migration race conditions are seen in remote open
and local open ack function.
Edge based lock is introduced to avoid any race condition during
simultaneous migration. Edge lock is shared across multiple
transport of same edge and is stored in a global list.
CRs-Fixed: 1010920
Change-Id: I2b988d2a6112add06fa433c4b1deeec0b6e6bb58
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
Add support for gpio keys on msmcobalt CDP and MTP.
CDP and MTP use pmcobalt gpios 6, 7 and 8 for volume up,
camera snapshot and camera focus respectively. CDP
additionally supports home key through pmcobalt gpio 5.
Change-Id: I31f3ed15e8cf02046cfcc8d9c062522065bb022c
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Use the correct bus governor for Venus VMEM.
Change-Id: I9abc6352732c189e90cefaa3eb4161ea6d103529
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Update MPM interrupt mapping to bypass some of the interrupts as per the
HW specification.
Change-Id: Ib6f218989616b038adb7a001cbc6302924041aa1
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
Adding pm_notify to allow the following:
1. Check if suspend is allowed in an earlier stage to prevent
starting the suspend procedure in case it is not allowed
2. Notify the platform driver on the suspend request
Change-Id: Iddacd9b54304b47263647942e1e6784eefb9a6d2
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: e34dc6475a7b25d1aec5de8652a321672904c686
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
Signed-off-by: Maya Erez <merez@codeaurora.org>
In case we fail to map one of the TSO SKB fragments, we need to
clear all the mapped descriptors, from swhead to swhead+descs_used-1.
Change the desc index calculation to
i = (swhead + descs_used - 1) % vring->size;
to prevent unmpping of (swhead + descs_used) descriptor that wasn't
mapped.
Change-Id: I81b99522ada809fa375c6b6887f8ea0e6482fba3
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: a1526f7eafa434f756579e2bc784b7605f96bf3e
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
Signed-off-by: Maya Erez <merez@codeaurora.org>
napi_synchronize is called before releasing the vring, with the
assumption that setting txdata->enabled to 0 will prevent handling
of this vring in the next scheduled napi.
To guarantee this assumption, a memory barrier is added after disabling
the txdata.
In addition, as the ctx is zeroed in wil_tx_complete after this
descriptor is handled (protected by wmb), ctx needs to be checked
before releasing this descriptor in wil_vring_free.
Change-Id: I7af20f1db39b7e4c5ac2956fc655f120eb61e002
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: 34b8886e502a62d1355ccc0420044aa2749a24cd
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
Signed-off-by: Maya Erez <merez@codeaurora.org>
add memory barrier after allocating new rx descriptors, before
updating the hwtail.
This will guarantee that all writes to descriptors (shared memory)
are done before committing them to HW.
Change-Id: If7c91c31b490b0762d23df21db7c30652b0817d4
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: ab6d7cc3eab4093caf91ba8b27590c4080d7d01c
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
Signed-off-by: Maya Erez <merez@codeaurora.org>
There are 2 possible race conditions, both are solved by addition of
memory barrier:
1. wil_tx_complete reads the swhead to determine if the vring is
empty. In case the swhead was updated before the descriptor update
was performed in __wil_tx_vring/__wil_tx_vring_tso, the completion
loop will not end and as the DU bit may still be set from a previous
run, this skb can be handled as completed before it was sent, which
will lead to double free of the same SKB.
2. __wil_tx_vring/__wil_tx_vring_tso calculate the number of available
descriptors according to the swtail. In case the swtail is updated
before memset of ctx to zero is completed, we can handle this
descriptor while later on ctx is zeroed.
Change-Id: Ia6584de897c366032251033aa8e03c54e9d899bb
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: eb26cff148f5449972121e46e403f549d71f6f49
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
Signed-off-by: Maya Erez <merez@codeaurora.org>
Currently burst value is set to zero for superspeed in mtp driver.
MTP throughput can be improved by setting max burst value to non
zero value in superspeed mode. Hence set max burst value to two
for both IN and OUT bulk endpoints in superspeed mode.
Change-Id: Ib78b8fec5d1ab934f4d4ec80b7e008149707ce0f
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Convert print messages to IPC logging facilities. This
will allow for easier debugging from crash dumps as
well as from debugfs. The print calls are converted to
macros which also print to the console for flexibility.
Change-Id: I6238b0434936fcff562d7a049e5e9d13794f9cdc
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Some platforms might not support auto hibern8 even though the
controller exposes this capability. Add a quirk to disable
auto hibern8 for such platforms.
Change-Id: I4a027f89deddff4735df45da9cffbfb1849af5f4
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
This patch fixes the possible corruption of the
dci client entries log mask during deinit of dci
entries.
CRs-Fixed: 1021816
Change-Id: I7741eca6ac07cd4393fc373e796570066da7cce6
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
Make turbo voting threshold lower to 1000Mbps to account for CPE
use case.
Change-Id: I5d02d3df7b69e30243a0b44ddf36a894ad739d59
CRs-Fixed: 872263
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
QCOM UFS host controller v3.0.0 supports hw gating of clocks, use
the hw ctl clock variants of ufs clocks to enable that support.
Change-Id: I9597507419e59884c44429c8c34f7469fa5192cb
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
QCOM UFS host controller v3.0.0 supports running at much lower
frequencies that allow SVS2. Update the UFS clock supported
table with new min frequencies.
Change-Id: I11d941f239ccd1978089194fa269e143fc640d36
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
QCOM UFS host controller v3.0.0 supports SVS2 voltage scaling mode
that allows lowest power consumption in HS G1. The link must be put
in hibern8 state before configuring the PHY to enter SVS2 mode.
The voltage can be reduced after this to SVS2 level.
Make the necessary change to support this on the qcom ufs variant.
Change-Id: Iba2ebe38c4ec1422931f2a696d9e5ca01b11a987
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Each ufs controller variant can work with various gear speeds that
can be supported at a low voltage corner. Add an ops function to
query the gear supported to scale down.
Also make the hibern8 entry/exit function non static as the variant
drivers might need to call hibern8 entry/exit when scaling down to
a lower gear.
Change-Id: I50008a892c8c21a4a3361998d76a2f8cbc2995bb
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
phy-qcom-ufs-qmp-v3 supports SVS2 voltage scaling mode that
allows lowest power consumption in HS G1. The PHY must be put
in hibern8 state before configuring the PHY to enter SVS2 mode.
The voltage can be reduced after this to SVS2 level.
This change exposes an API that allows the UFS driver to
configure the PHY to enter SVS2 mode.
Change-Id: I2ef01d98603840289c436e14bf3df54a2ab9198b
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
QCOM UFS controller version 3.0.0 supports the auto hibern8
feature as defined by the UFS HCI v2.0 specification.
Make necessary changes to enable this during host controller
initialization.
Change-Id: I5a048629dade92fe79631ba30d3b3e280a77d4e6
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
UFS HCI v2.0 specification adds support for auto hibern8.
Add support to enable this in the ufs host controller driver.
Change-Id: I57e5be8eae4b2cf70a2a9d9c81c9a54a24e03e71
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Currently the pmic votables need a device to be created.
Votables should be able to work on device less code. Remove
the need for device and instead use a void pointer to be passed
back to the callback.
CRs-Fixed: 1018090
Change-Id: If5dafbcc0d88596332b794ad5b6fdc1f9ff98a45
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
The default value was introduced to prevent crashes on the clients
where it couldn't handle situations when there were no voters.
The default value led to many complicated scenarios in the votable
implementation.
Remove the concept of default value and return error when
there are no votes. Update all the clients to handle error values
from votables. Also invoke the callback to inform about no active
voters.
CRs-Fixed: 1018090
Change-Id: I81f5974f81a697f3698bc58df1d3ed59fa2579a7
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Currently the pmic-voter api assumes that the clients are represented
as unique integers. Using strings instead of integers adds flexibility.
- It enables the votable to be shared across multiple drivers without
having a common client enum
- Debug prints become more useful
While at it
- remove the use of num_clients in the apis. All of them default to
NUM_CLIENTS.
- Create a list of all the votables, this allows for searching for a
specific votable.
- Error if a votable is already created with the same name earlier.
- Add debug prints about current clients and effective results
- Remove passing in last_client and last_client_id in the callback. These
parameters go unused in all the usecases.
- Since clients are assigned sequentially and that they cannot
unregister from a votable (clients can only disable their votes, but
they cannot remove themselves), a null string in the client string
array means there are no more clients. Use this to speed up result
calculation by stopping at the id with a null string.
- Refactor the vote() implementation. Currently the SET_ANY case flows
differently than MIN or MAX, make them uniform.
- Create an api to call the callback without casting new votes.
CRs-Fixed: 1018090
Change-Id: I8e2bc3366ec12e8485e4be86ee56ba5e4d113c3c
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Add a new gcc_gpu_iref_clk that the graphics driver can control
as needed. The default state of the clock is ON; so having this
control will mean saving current.
CRs-Fixed: 1024948
Change-Id: I562bb546f49b1605f20fb7d705f40584d190230b
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Update the LMH interrupt information for msmcobalt. This interrupt will
be generated when LMH hardware does mitigation.
Change-Id: If6fdebb36d7108b2ac9b5f3c8a787d305505545c
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
LMH DCVSh driver receives interrupt from hardware whenever there is a
new mitigation frequency decision is made in hardware.
Add ftrace event to print the hardware mitigation frequency value from
driver.
Change-Id: Ib357ee3c3a461613bfd1268ec8f98973c2982c10
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
msmcobalt only has two AD hardware block, this change corrects
the offsets in the dts file.
CRs-Fixed: 1023377
Change-Id: Ifa797703da0ac846167651c7ed03a6710ba41867
Signed-off-by: Ping Li <pingli@codeaurora.org>
Enable HDMI RX for 8996, otherwise soundcard
will not get registered for the flavors which
supports HDMI.
CRs-Fixed: 1023892
Change-Id: I0d2442c7b3d156ad919626a6015f0fbbf2116c3f
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
In multi-rect configuration both the pipes should fetch or should
be in solidfill configuration. The change ensures that when switching
between multi-rect to normal configuration with solid fill
enable/disable the multi-rect mode properly.
CRs-Fixed:1025380
Change-Id: I02fc72583fcd9bc27156ce717b52ef17e16313d5
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
Updating the hw_params before setting initial position
for VCM type actuator.
CRs-Fixed: 987939
Change-Id: I1b1f1801eb0578644b2e954a3a3ade17b3f2a1fd
Signed-off-by: Tanvi Aggarwal <tanvia@codeaurora.org>
Hanjun Guo has reported that a CMA stress test causes broken accounting of
CMA and free pages:
> Before the test, I got:
> -bash-4.3# cat /proc/meminfo | grep Cma
> CmaTotal: 204800 kB
> CmaFree: 195044 kB
>
>
> After running the test:
> -bash-4.3# cat /proc/meminfo | grep Cma
> CmaTotal: 204800 kB
> CmaFree: 6602584 kB
>
> So the freed CMA memory is more than total..
>
> Also the the MemFree is more than mem total:
>
> -bash-4.3# cat /proc/meminfo
> MemTotal: 16342016 kB
> MemFree: 22367268 kB
> MemAvailable: 22370528 kB
Laura Abbott has confirmed the issue and suspected the freepage accounting
rewrite around 3.18/4.0 by Joonsoo Kim. Joonsoo had a theory that this is
caused by unexpected merging between MIGRATE_ISOLATE and MIGRATE_CMA
pageblocks:
> CMA isolates MAX_ORDER aligned blocks, but, during the process,
> partialy isolated block exists. If MAX_ORDER is 11 and
> pageblock_order is 9, two pageblocks make up MAX_ORDER
> aligned block and I can think following scenario because pageblock
> (un)isolation would be done one by one.
>
> (each character means one pageblock. 'C', 'I' means MIGRATE_CMA,
> MIGRATE_ISOLATE, respectively.
>
> CC -> IC -> II (Isolation)
> II -> CI -> CC (Un-isolation)
>
> If some pages are freed at this intermediate state such as IC or CI,
> that page could be merged to the other page that is resident on
> different type of pageblock and it will cause wrong freepage count.
This was supposed to be prevented by CMA operating on MAX_ORDER blocks, but
since it doesn't hold the zone->lock between pageblocks, a race window does
exist.
It's also likely that unexpected merging can occur between MIGRATE_ISOLATE
and non-CMA pageblocks. This should be prevented in __free_one_page() since
commit 3c605096d3 ("mm/page_alloc: restrict max order of merging on isolated
pageblock"). However, we only check the migratetype of the pageblock where
buddy merging has been initiated, not the migratetype of the buddy pageblock
(or group of pageblocks) which can be MIGRATE_ISOLATE.
Joonsoo has suggested checking for buddy migratetype as part of
page_is_buddy(), but that would add extra checks in allocator hotpath and
bloat-o-meter has shown significant code bloat (the function is inline).
This patch reduces the bloat at some expense of more complicated code. The
buddy-merging while-loop in __free_one_page() is initially bounded to
pageblock_border and without any migratetype checks. The checks are placed
outside, bumping the max_order if merging is allowed, and returning to the
while-loop with a statement which can't be possibly considered harmful.
This fixes the accounting bug and also removes the arguably weird state in the
original commit 3c605096d3 where buddies could be left unmerged.
Fixes: 3c605096d3 ("mm/page_alloc: restrict max order of merging on isolated pageblock")
Link: https://lkml.org/lkml/2016/3/2/280
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Hanjun Guo <guohanjun@huawei.com>
Tested-by: Hanjun Guo <guohanjun@huawei.com>
Acked-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Debugged-by: Laura Abbott <labbott@redhat.com>
Debugged-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> [3.18+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Change-Id: I768a9c4886aa3fe2e827aba682f67bac2dba6f71
Git-commit: d9dddbf556674bf125ecd925b24e43a5cf2a568a
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
[vinemenon@codeaurora.org: fix trivial merge conflicts]
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Remove qos-bypass flags in fab definitions to enable QoS configuration
to allow proper priority of master ports on buses across SoC,
add relevant clock handles to allow access to config registers.
CRs-Fixed: 1006333
Change-Id: If72eed62e28ccaafa2e0fb6186ec88571b4e657a
Signed-off-by: David Dai <daidavid1@codeaurora.org>
When is_hdr_proc_ctx is true, offset_entry might be not allocated.
Dereference this pointer only when is_hdr_proc_ctx is false.
CRs-Fixed: 1021964
Change-Id: I191c4709e79d1b13e3f6fd31c5e738d3c2094bc7
Signed-off-by: Amir Levy <alevy@codeaurora.org>
Set alignment for ADSP ION DMA buffer to 4 MB which is the
minimum alignment supported.
Change-Id: I67fef3fc65b24febef070ca9f896036f38a87fb9
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
Dummy CoreSight source devices can be used to configure trace path for
devices that are configured by other subsystems.
Change-Id: Ieae3c1f9fce6a753821c898bcda7cd67a6b04c20
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
Add dummy device for WCSS TPDM. This device can be used to configure
WCSS trace path.
Change-Id: I5d08f4f4db00affd5f7a9e6709714d862d42c6ef
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
Support new format of rpm messaging to reduce response time of rpm
acking and increasing the number of messages that the rpm fifo can
process.
RPM message
====================
Old format:
uint32_t service_type;
uint32_t request_len;
uint32_t msg_id;
enum msm_rpm_set set;
uint32_t resource_type;
uint32_t resource_id;
uint32_t data_len;
New format:
unsigned request_hdr;
unsigned msg_id;
unsigned resource_type;
unsigned request_details;
RPM ACK message
====================
Old format:
uint32_t req;
uint32_t req_len;
uint32_t rsc_id;
uint32_t msg_len;
uint32_t id_ack;
New format:
unsigned request_hdr;
uint32_t id_ack;
CRs-fixed: 993338
Change-Id: I85cb0223ce45de2712c20a3a0edffe2a84b80f01
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
Disable GPU Turbo power level on pre-production msm8998 platform,
due to early productions issues majority if chips do no support
Turbo.
CRs-Fixed: 973565
Change-Id: I4b52c7bfb3713ffd4a5bcb2aacd134d69d1dbcd4
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
Increase the size of snapshot static region to 1MB in the
device tree file for a5x targets which have preemption enabled.
This increase is needed to accommodate preemption records and
preemption history records. This overrides the snapshot size
specified in the driver code.
CRs-Fixed: 999360
Change-Id: I2cd27481cc0fb189e35ea44709fe27ad0884fcfd
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Update function drivers mtp and accessory to operate
in super speed. The burst capability is not enabled for now.
Change-Id: Ie95cbfc9444c56c8268b70e2916713190699c71a
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Queuing a request on a disabled endpoint during composition switch leads
to prime failure. Hence return -EINVAL if a request is queued on a disabled
endpoint.
Also, in f_mtp, block queuing a request in OUT ep in receive_file_work, if
the device state is STATE_OFFLINE.
Change-Id: I0e706d5280a2460baf6ab05dbf97a09c59b642fb
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Currently if USB composition switch happens while file transfer is
happening either from/to device, ep_queue fails and sets device state
to ERROR even if device state is already set to OFFLINE in function
disable call.
As part of ioctl call, if the state is not offline, moving the device
state to READY and returning the error. Since the device state is marked
as READY, the next write call tries to queue the request to hardware and
is blocked and due to this, userspace is not calling the release function.
Hence next mtp open fails even after cable reconnection.
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Change-Id: Ia8cbd1cd8c81b90389900b83744b2bed89068db5
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
If the Host sends CANCEL request when an OUT request is queued,
the mtp_driver should dequeue the request and report the userspace about
the request CANCELLATION. As the mtp_read doesn't wakeup from the thread
which is expecting for the read completion, wakeup the thread using the
state change which occurs as a part of CANCEL request.
Also, when the request is dequeued and so mtp receives read completion
status as error, it moves the state to ERROR. Due to this the application
is not reported about the request cancellation for the next IN(mtp_write)
transfer as the state is not updated from STATE_ERROR to STATE_CANCELED.
So mtp_write proceeds queueing the IN requests for the corresponding sync
which are not processed by the Host and so the transfers initiated later
are observed as error in the HOST side.
So dequeue the OUT(mtp_read) request, if the driver receives a REQ_CANCEL
prior to read completion on mtp_read & update the state to STATE_CANCELED.
Change-Id: I2cd9780f8b3e0ce541472c4d25c8294f11a45d76
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>