msm: qdsp6v2: Allow 320K AAC encoding

 * DSP supports this swimmingly.

Change-Id: I11696dd49253c5a310b32c0bfe1a878009597b24
PM / devfreq: governor_bw_hwmon: Add suspend/resume support

Some devfreq devices using this governor might need suspend/resume support.
When suspended, those devices won't need any bandwidth votes and there is
no point in monitoring their bandwidth either.

Therefore, upon suspend, vote for zero bandwidth and stop the HW monitor.
Upon resume, vote for the previous bandwidth and start the HW monitor.

Change-Id: I318449995d714959f0ebfe91961bc23fa8edbd04
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>

PM / devfreq: devbw: Add suspend/resume APIs

Absence of traffic is guaranteed when the device sitting behind a devbw
device is suspended. In such cases, it is a waste of power to make non-zero
bandwidth votes or to scale the devbw device. So, provide APIs to
suspend/resume the devbw device as needed.

Change-Id: Id58072aec7a9710eb917f248d9b9bd08d3a1ec6a
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
msm: clock-krait-8974: Add support to read SVS PVS bin

On some targets, the PVS table is split into SVS freq table and
the turbo freq table. Add the support to read the SVS PVS bin and
construct the complete PVS table.

Change-Id: I5a30d295efa8d0cf0a74747f29c39ca5c3faa3d4
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
sched: fix race between try_to_wake_up() and move_task()

Until a task's state has been seen as interruptible/uninterruptible
and it is no longer on_cpu, it is possible that the task may move
to another CPU (load balancing may cause this). Here is an example
where the race condition results in incorrect operation:

- cpu 0 calls put_prev_task on task A, task A's state is TASK_RUNNING
- cpu 0 runs task B, which attempts to wake up A
- cpu 0 begins try_to_wake_up(), recording src_cpu for task A as cpu 0
- cpu 1 then pulls task A (perhaps due to idle balance)
- cpu 1 runs task A, which then sleeps, becoming INTERRUPTIBLE
- cpu 0 continues in try_to_wake_up(), thinking task A's previous
  cpu is 0, where it is actually 1
- if select_task_rq returns cpu 0, task A will be woken up on cpu 0
  without properly updating its cpu to 0 in set_task_cpu()

Change-Id: I870f7ffefe30ba2aae1114fd5e66d1a73e6a54fb
CRs-Fixed: 665958
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
net/l2tp: don't fall back on UDP [get|set]sockopt

The l2tp [get|set]sockopt() code has fallen back to the UDP functions
for socket option levels != SOL_PPPOL2TP since day one, but that has
never actually worked, since the l2tp socket isn't an inet socket.

As David Miller points out:

  "If we wanted this to work, it'd have to look up the tunnel and then
   use tunnel->sk, but I wonder how useful that would be"

Since this can never have worked so nobody could possibly have depended
on that functionality, just remove the broken code and return -EINVAL.

Change-Id: Ia6c09487e92d1ee4e8d1d22a6273034b22272a2f
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: James Chapman <jchapman@katalix.com>
Acked-by: David Miller <davem@davemloft.net>
Cc: Phil Turnbull <phil.turnbull@oracle.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
usb: gadget: mass_storage: added sysfs entry for cdrom to LUNs

This patch adds a "cdrom" sysfs entry for each mass_storage LUN, just
like "ro" sysfs entry. This allows switching between USB and CD-ROM
emulation without reinserting the module or recompiling the kernel.

Change-Id: Idf83c74815b1ad370428ab9d3e5503d5f7bcd3b6
usb: gadget: f_accessory: Enabled Zero Length Packet (ZLP) for acc_write

Accessory connected to Android Device requires
Zero Length Packet (ZLP) to be written when data
transferred out from the Android device are multiples
of wMaxPacketSize (64bytes (Full-Speed) / 512bytes (High-Speed))
to end the transfer.

Change-Id: Ib2c2c0ab98ef9afa10e74a720142deca5c0ed476
Signed-off-by: Anson Jacob <ansonkuzhumbil@gmail.com>
i2c_qup: Fix for unhandled IRQ

I2C qup driver handle scenario where runtime
PM is not enabled and enables clocks explicitly.
But it checks runtime PM suspended state in ISR
routine before processing further which can lead to issue
of unhandled valid IRQ sometimes because I2C client
can initiate transaction very early after system
resume and runtime PM is not enabled.

Add atomic flag to synchronize between active transaction
request when clocks are enabled and ISR.

CRs-Fixed: 670480
Change-Id: I175bc29a7b5b6e713ab6ec28deb34b2b0d23fa8a
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
  ASoC: msm: qdsp6v2: Add SEC_I2S_RX port as EC reference

  SECONDARY_I2S_RX as EC reference port is needed for msm8x10.
  Add support to enable SEC_I2S_RX as EC reference port.

  CRs-Fixed: 646310

Change-Id: Ie114dd29afc16ff324388743377fb5c755f4ad7b
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
ASoC: msm: fix the target crash due to the NULL pointer dereference

During the close of the FE, the mclk is disabled which accesses the
codec drv data.
In case if the tapan codec was not initialized, then close sequence
will result in the null pointer dereference.
Fix by adding a null check before accessing the codec data structure.

CRs-Fixed: 635065
Change-Id: I0678826d073a69b99a05a5b628920be89d210519
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
diag: Add status functionality to Diag over STM command

The Diag over STM command has been enhanced to include a
status capability. Add this functionality to Diag over
STM processing.

Also, the command code for Diag over STM has changed. Make
modifications to support the newly assigned command code.

Change-Id: Ifa371e6d91a2520b0e5d7e672b610a1b8b4991eb
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
diag: Remove invalid check for payload

Call back data type does support commands which is less than
4 bytes in size. This patch removes the unnecessary check for
the call back data type.

Change-Id: Ie70196d8dd0b0b3d023bc2505fbb1cb3e582a1af
CRs-fixed: 623552
Signed-off-by: Katish Paran <kparan@codeaurora.org>
diag: Change format used for printing pointers

Currently, when printing a pointer address the format does not
take advantage of using the pointer conversion specifier. Make
changes to use the pointer conversion specifier.

Change-Id: I27fd10c33952de9e44066c15256c7f29df6c4dd8
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Update defconfig, fix freq