Commit graph

604301 commits

Author SHA1 Message Date
Swetha Chikkaboraiah
6cf7c009ef ARM: dts: msm: msm8996-mtp bringup changes
Changes done to bringup msm8996 on 4.4 kernel.

Change-Id: Ie0629dddeed2ef861e3b15f47015a7a8fb482ba7
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
2019-01-17 00:59:37 -08:00
Amar Singhal
fdf0731fd5 msm: wlan: Remove DSRC channels for US
DSRC channels are not required when SRD channels are enabled. Therefore
remove them.

Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
Change-Id: I1b2937c45d43d31c5689c7c4d134fcfb9a265b0e
CRs-Fixed: 2174850
2019-01-16 16:42:03 +05:30
Amar Singhal
7cc2cf22bf msm: wlan: Add support for UNI-III ETSI sub-band
Per the EU STD. ETSI EN 300 440, sub-band 5725-5875 is
allowed in EU at reduced power of 25 mW. Add the sub-band to
the EU countries that support this sub-band.

CRs-Fixed: 2141740
Change-Id: I0a43e99c4357527f607110faecddd9d0fd444fc6
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
Signed-off-by: Rajeev Kumar Sirasanagandla <rsirasan@codeaurora.org>
2019-01-16 16:18:43 +05:30
Yiming Cao
eb84e2653d msm: vidc: Support interlaced clips playback
Add a new event to configure if allow to trigger
port reconfig event for scan type change for
UBWC interlaced video playback

Change-Id: Ie20d6a006a82511b18ea0a6fe8de0cf43d6a0582
Signed-off-by: Yiming Cao <cyiming@codeaurora.org>
2019-01-13 19:13:23 -08:00
Linux Build Service Account
b1b5065335 Merge "defconfig: msm: Enable USB HID driver on MSM8996 Auto" 2019-01-12 23:48:04 -08:00
Linux Build Service Account
ac0b1cb2c7 Merge "nl80211: Fix external_auth check for offloaded authentication" 2019-01-11 00:58:12 -08:00
Linux Build Service Account
8b15253b89 Merge "cnss2: Add QCN7605 device ID for elf ramdump" 2019-01-11 00:58:12 -08:00
Ajay Agarwal
63af97f02b defconfig: msm: Enable USB HID driver on MSM8996 Auto
Enable USB HID function driver on MSM8996 Auto target to support
HID over USB.

Change-Id: Iea1b04b88a6a0af816ef9f45f67875ece8d68657
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-10 21:03:40 -08:00
Ajay Agarwal
e5f5ba3002 usb: gadget: f_hid: Add support for HID function
Add support for the HID function with the configfs framework.

Change-Id: I4da589aa453f892bf26cf16ce1a80426100ac02d
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-10 21:03:34 -08:00
Abdulhadi Mohamed
fda16fc183 usb: gadget: f_hid: {GET,SET} PROTOCOL Support
The current f_hid driver doesn't handle GET_PROCOTOL and
SET_PROCOTOL requests, which are required to operate HID
gadgets in BOOT mode. This patch implements this feature for
devices that have the same implementation for REPORT and BOOT mode
so that these devices are recognized by older BIOSes.

Change-Id: I2279d9083bf9093f5a96c16df5d7ae48d11fd503
Signed-off-by: Abdulhadi Mohamed <abdulahhadi2@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: b3c4ec71ec413c2e5bfb028bdf1737af07f1fde0
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-10 21:03:30 -08:00
Krzysztof Opasiak
b3b13a88db usb: gadget: f_hid: fix: Don't access hidg->req without spinlock held
hidg->req should be accessed only with write_spinlock held as it is
set to NULL when we get disabled by host.

Change-Id: Ic933da63cc2e7087b8e68398499d367fae328499
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 25cd9721c2b16ee0d775e36ec3af31f392003f80
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-10 21:03:25 -08:00
Matthew Wilcox
d160ea3368 idr: add ida_is_empty
Two of the USB Gadgets were poking around in the internals of struct ida
in order to determine if it is empty.  Add the appropriate abstraction.

Change-Id: I48338e05940ee795953a3323d4d08b5c5c1e2fcc
Link: http://lkml.kernel.org/r/1480369871-5271-63-git-send-email-mawilcox@linuxonhyperv.com
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Konstantin Khlebnikov <koct9i@gmail.com>
Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-commit: 99c494077e2d4282a17120a772eecc00ec3004cc
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-10 21:03:00 -08:00
Janusz Dziedzic
6f3ba887e4 usb: gadget: f_hid add super speed support
Add super speed descriptors to f_hid.

Change-Id: I81f9c89963218d27c37f2a25e71245f2ee81a388
Signed-off-by: Janusz Dziedzic <januszx.dziedzic@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: dbf499cf720a0096acea7641492d9edeffc25d10
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[ajaya@codeaurora.org: drop changes for SSP descriptors]
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-10 21:02:54 -08:00
Krzysztof Opasiak
825084cdc1 usb: gadget: f_hid: fix: Move IN request allocation to set_alt()
commit 749494b6bdbbaf0899aa1c62a1ad74cd747bce47 upstream.

Since commit: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()")
we cannot allocate any requests in bind() as we check if we should
align request buffer based on endpoint descriptor which is assigned
in set_alt().

Allocating request in bind() function causes a NULL pointer
dereference.

This commit moves allocation of IN request from bind() to set_alt()
to prevent this issue.

Change-Id: I02a832bfd3008efb041450156da11e62f1ec8e5c
Fixes: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()")
Cc: stable@vger.kernel.org
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 8dd5c0c47332c67a04830e3842d4d6282f1824fd
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-10 21:02:47 -08:00
Linux Build Service Account
f9e5993dff Merge "drm/msm/sde: add panel stacking support" 2019-01-10 15:59:45 -08:00
Linux Build Service Account
363d4a457d Merge "drm/msm/sde: add shared display support" 2019-01-10 15:59:44 -08:00
Linux Build Service Account
8e9ed04da3 Merge "usb: gadget: f_hid: Use spinlock instead of mutex" 2019-01-10 07:27:56 -08:00
Linux Build Service Account
17c6aaf2ae Merge "cfg80211: indicate support for external authentication" 2019-01-10 07:27:55 -08:00
Rajasekaran Kalidoss
b8d62600fc cnss2: Add QCN7605 device ID for elf ramdump
For QCN7605 device ID, the collected dump
segments are not dumped to /dev/ramdump_QCN7605.
Device ID of QCN7605 needs to be added to the
ramdump path.

Change-Id: Ib3931f13f99f9c219f4a0e64b5bc92fb2f0b3902
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-01-10 07:10:25 -08:00
Xiaowen Wu
7894acdb9a drm/msm/sde: add panel stacking support
To support transparent panel stacking, application will pass non-panel-
stacking buffer roi to kernel and let kernel to extend to panel-stacking
size.  A special flag is defined on source config for this purpose.

Change-Id: I59eb290f0f7b92744972391d7db743e2da12300b
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
2019-01-10 01:32:38 -08:00
Linux Build Service Account
076faf0b2f Merge "msm: ais: ispif: Fix invalid type conversion" 2019-01-09 23:23:11 -08:00
Krzysztof Opasiak
601c68d342 usb: gadget: f_hid: Use spinlock instead of mutex
commit 33e4c1a9987a1fc3b42c3b534100b5b006d55c61 upstream.

As IN request has to be allocated in set_alt() and released in
disable() we cannot use mutex to protect it as we cannot sleep
in those funcitons. Let's replace this mutex with a spinlock.

Change-Id: I44c16823165b25c6d8d7e1697de75e373226272a
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 6d0511ed15db30965f8a3be8f0733bb6efd2b95e
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 23:14:36 -08:00
Rahul Sharma
7079e398af drm/msm/sde: add shared display support
Add support to shared display for panel stacking and split screen
application.

The current DRM framework only allows one atomic commit for
each display, this change will create virtual display pipelines
based on the physical display pipeline, and each virtual display
can support independent async atomic commit.

With the change user mode application can setup and update
display on each virtual display and share the same physical port.
No mode switch is allowed on virtual display. When all virtual
displays are powered off,  the physical display will also power off.

Change-Id: Ibf9a7dd1a96c59b6db9891d826cb4f11b409696c
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
2019-01-09 20:55:04 -08:00
Srinivas Dasari
682aa32d09 nl80211: Fix external_auth check for offloaded authentication
Unfortunately removal of the ext_feature flag in the last revision of
the patch ended up negating the comparison and prevented the command
from being processed (either nl80211_external_auth() or
rdev_external_auth() returns -EOPNOTSUPP). Fix this by adding back the
lost '!'.

Fixes: 40cbfa90218b ("cfg80211/nl80211: Optional authentication offload to userspace")

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: db8d93a7a355121d49777c059afbca23c53c8628
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
CRs-Fixed: 2210017
Change-Id: I41f7c25d68a5060d7b5e24fb5bd164e063311ed0
Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org>
Signed-off-by: Jiachao Wu <jiacwu@codeaurora.org>
Signed-off-by: Min Liu <minliu@codeaurora.org>
2019-01-10 11:16:59 +08:00
Srinivas Dasari
3d2a81a626 cfg80211: indicate support for external authentication
Define macro to indicate backport support for
external authentication where authentication can be
offloaded to userspace in specific cases such as SAE.

Change-Id: Ib253b303e82f583f61bc13d14c8d491d5ea2af15
CRs-Fixed: 2182553
Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org>
Signed-off-by: Jiachao Wu <jiacwu@codeaurora.org>
Signed-off-by: Min Liu <minliu@codeaurora.org>
2019-01-10 11:14:54 +08:00
Linux Build Service Account
6cc6df43ed Merge "usb: gadget: f_hid: fix: Free out requests" 2019-01-09 16:22:30 -08:00
Linux Build Service Account
45286c6557 Merge "ARM64: dts: gvm: Enable USB2 pass through for LA Guest" 2019-01-09 16:22:28 -08:00
Linux Build Service Account
977d9e3afe Merge "defconfig: msm: Enable UAC1 driver on 8996 Auto" 2019-01-09 16:22:09 -08:00
Linux Build Service Account
cdd53d2de8 Merge "usb: gadget: f_uac1: Add support for UAC1 function" 2019-01-09 16:22:05 -08:00
Linux Build Service Account
c2161416e7 Merge "cnss2: Add cnss usb API to check the target status" 2019-01-09 08:54:50 -08:00
Krzysztof Opasiak
712a014d96 usb: gadget: f_hid: fix: Free out requests
commit 20d2ca955bd09639c7b01db5761d157c297aea0a upstream.

Requests for out endpoint are allocated in bind() function
but never released.

This commit ensures that all pending requests are released
when we disable out endpoint.

Change-Id: Ifeab1eff6223e6380b7a1f6db6900ca33ade9de1
Fixes: 99c5150058 ("usb: gadget: hidg: register OUT INT endpoint for SET_REPORT")
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: b6092a57150c1641dffb6bfeebbe2cbde7275d1f
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 05:56:22 -08:00
Venkata Rao Kakani
7dc5c37c6e ARM64: dts: gvm: Enable USB2 pass through for LA Guest
Enable USB2.0 pass through in LA Guest along with its
dependencies.

Change-Id: I8fdf27e850f030d2f98b1c9651d5eae340613f70
Signed-off-by: Venkata Rao Kakani <vkakani@codeaurora.org>
2019-01-09 01:28:55 -08:00
Linux Build Service Account
c059ef285c Merge "nl80211: Allow SAE Authentication for NL80211_CMD_CONNECT" 2019-01-08 21:26:05 -08:00
Linux Build Service Account
ff179ae004 Merge "cfg80211/nl80211: Optional authentication offload to userspace" 2019-01-08 21:26:04 -08:00
Linux Build Service Account
cd4e8fc6f9 Merge "cnss2: Add cal duration in host capability request" 2019-01-08 21:26:03 -08:00
Linux Build Service Account
1f45a4ba6c Merge "usb: gadget: f_hid: use alloc_ep_req()" 2019-01-08 21:26:02 -08:00
Ajay Agarwal
82ed284fd3 defconfig: msm: Enable UAC1 driver on 8996 Auto
Enable UAC1 function driver on 8996 Auto target to support
audio over USB with virtual ALSA card creation.

Change-Id: If4c95e5b7955245d749ace95d56f4b4d8dc292e8
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:17:01 +05:30
Ajay Agarwal
7b33db7c8e usb: gadget: f_uac1: Add support for UAC1 function
Add support for the UAC1 function with the configfs framework
along with following other changes:
 - Add dynamic updation of AudioStreaming interface numbers in
   the AudioControl interface descriptor.
 - Add superspeed support.
 - Stop playback on func disable so that pending request's
   completion is called before request has been freed in unbind.
 - Fix minor compilation issue.

Change-Id: Ib30fa735314c57b9543f89e18d1fb419ed5a2b9d
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:17:01 +05:30
Hemant Kumar
250bb0182b usb: gadget: u_audio: Check return value from config_ep_by_speed()
In case config_ep_by_speed() returns error, endpoint descriptors
would not get populated. This results into NULL pointer dereference
when ep desc is accessed later. Fix this by bailing out set_alt if
config_ep_by_speed() API returns error.

Change-Id: I581d5e9fa7f3610e96e2e3705ab7e095a93a2a59
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:17:01 +05:30
Vladimir Zapolskiy
7490518aee usb: gadget: u_audio: protect stream runtime fields with stream spinlock
The change protects almost the whole body of u_audio_iso_complete()
function by PCM stream lock, this is mainly sufficient to avoid a race
between USB request completion and stream termination, the change
prevents a possibility of invalid memory access in interrupt context
by memcpy():

    Unable to handle kernel paging request at virtual address 00004e80
    pgd = c0004000
    [00004e80] *pgd=00000000
    Internal error: Oops: 817 [#1] PREEMPT SMP ARM
    CPU: 0 PID: 3 Comm: ksoftirqd/0 Tainted: G         C   3.14.54+ #117
    task: da180b80 ti: da192000 task.ti: da192000
    PC is at memcpy+0x50/0x330
    LR is at 0xcdd92b0e
    pc : [<c029ef30>]    lr : [<cdd92b0e>]    psr: 20000193
    sp : da193ce4  ip : dd86ae26  fp : 0000b180
    r10: daf81680  r9 : 00000000  r8 : d58a01ea
    r7 : 2c0b43e4  r6 : acdfb08b  r5 : 01a271cf  r4 : 87389377
    r3 : 69469782  r2 : 00000020  r1 : daf82fe0  r0 : 00004e80
    Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
    Control: 10c5387d  Table: 2b70804a  DAC: 00000015
    Process ksoftirqd/0 (pid: 3, stack limit = 0xda192238)

Also added a check for potential !runtime condition, commonly it is
done by PCM_RUNTIME_CHECK(substream) in the beginning, however this
does not completely prevent from oopses in u_audio_iso_complete(),
because the proper protection scheme must be implemented in PCM
library functions.

An example of *not fixed* oops due to substream->runtime->*
dereference by snd_pcm_running(substream) from
snd_pcm_period_elapsed(), where substream->runtime is gone while
waiting the substream lock:

    Unable to handle kernel paging request at virtual address 6b6b6b6b
    pgd = db7e4000
    [6b6b6b6b] *pgd=00000000
    CPU: 0 PID: 193 Comm: klogd Tainted: G         C   3.14.54+ #118
    task: db5ac500 ti: db60c000 task.ti: db60c000
    PC is at snd_pcm_period_elapsed+0x48/0xd8 [snd_pcm]
    LR is at snd_pcm_period_elapsed+0x40/0xd8 [snd_pcm]
    pc : [<>]    lr : [<>]    psr: 60000193
    Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
    Control: 10c5387d  Table: 2b7e404a  DAC: 00000015
    Process klogd (pid: 193, stack limit = 0xdb60c238)
    [<>] (snd_pcm_period_elapsed [snd_pcm]) from [<>] (udc_irq+0x500/0xbbc)
    [<>] (udc_irq) from [<>] (ci_irq+0x280/0x304)
    [<>] (ci_irq) from [<>] (handle_irq_event_percpu+0xa4/0x40c)
    [<>] (handle_irq_event_percpu) from [<>] (handle_irq_event+0x3c/0x5c)
    [<>] (handle_irq_event) from [<>] (handle_fasteoi_irq+0xc4/0x110)
    [<>] (handle_fasteoi_irq) from [<>] (generic_handle_irq+0x20/0x30)
    [<>] (generic_handle_irq) from [<>] (handle_IRQ+0x80/0xc0)
    [<>] (handle_IRQ) from [<>] (gic_handle_irq+0x3c/0x60)
    [<>] (gic_handle_irq) from [<>] (__irq_svc+0x44/0x78)

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
[erosca: W/o this patch, with minimal instrumentation [1], I can
         consistently reproduce BUG: KASAN: use-after-free [2]]

[1] Instrumentation to reproduce issue [2]:
 diff --git a/drivers/usb/gadget/function/u_audio.c b/drivers/usb/gadget/function/u_audio.c
 index a72295c953bb..bd0b308024fe 100644
 --- a/drivers/usb/gadget/function/u_audio.c
 +++ b/drivers/usb/gadget/function/u_audio.c
 @@ -16,6 +16,7 @@
  #include <sound/core.h>
  #include <sound/pcm.h>
  #include <sound/pcm_params.h>
 +#include <linux/delay.h>

  #include "u_audio.h"

 @@ -147,6 +148,8 @@ static void u_audio_iso_complete(struct usb_ep *ep, struct usb_request *req)

 	spin_unlock_irqrestore(&prm->lock, flags);

 +	udelay(500); //delay here to increase probability of parallel activities
 +
 	/* Pack USB load in ALSA ring buffer */
 	pending = prm->dma_bytes - hw_ptr;

[2] After applying [1], below BUG occurs on Rcar-H3-Salvator-X board:
==================================================================
BUG: KASAN: use-after-free in u_audio_iso_complete+0x24c/0x520 [u_audio]
Read of size 8 at addr ffff8006cafcc248 by task swapper/0/0

CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        WC      4.14.47+ #160
Hardware name: Renesas Salvator-X board based on r8a7795 ES2.0+ (DT)
Call trace:
[<ffff2000080925ac>] dump_backtrace+0x0/0x364
[<ffff200008092924>] show_stack+0x14/0x1c
[<ffff200008f8dbcc>] dump_stack+0x108/0x174
[<ffff2000083c71b8>] print_address_description+0x7c/0x32c
[<ffff2000083c78e8>] kasan_report+0x324/0x354
[<ffff2000083c6114>] __asan_load8+0x24/0x94
[<ffff2000021d1b34>] u_audio_iso_complete+0x24c/0x520 [u_audio]
[<ffff20000152fe50>] usb_gadget_giveback_request+0x480/0x4d0 [udc_core]
[<ffff200001860ab8>] usbhsg_queue_done+0x100/0x130 [renesas_usbhs]
[<ffff20000185f814>] usbhsf_pkt_handler+0x1a4/0x298 [renesas_usbhs]
[<ffff20000185fb38>] usbhsf_irq_ready+0x128/0x178 [renesas_usbhs]
[<ffff200001859cc8>] usbhs_interrupt+0x440/0x490 [renesas_usbhs]
[<ffff2000081a0288>] __handle_irq_event_percpu+0x594/0xa58
[<ffff2000081a07d0>] handle_irq_event_percpu+0x84/0x12c
[<ffff2000081a0928>] handle_irq_event+0xb0/0x10c
[<ffff2000081a8384>] handle_fasteoi_irq+0x1e0/0x2ec
[<ffff20000819e5f8>] generic_handle_irq+0x2c/0x44
[<ffff20000819f0d0>] __handle_domain_irq+0x190/0x194
[<ffff20000808177c>] gic_handle_irq+0x80/0xac
Exception stack(0xffff200009e97c80 to 0xffff200009e97dc0)
7c80: 0000000000000000 0000000000000000 0000000000000003 ffff200008179298
7ca0: ffff20000ae1c180 dfff200000000000 0000000000000000 ffff2000081f9a88
7cc0: ffff200009eb5960 ffff200009e97cf0 0000000000001600 ffff0400041b064b
7ce0: 0000000000000000 0000000000000002 0000000200000001 0000000000000001
7d00: ffff20000842197c 0000ffff958c4970 0000000000000000 ffff8006da0d5b80
7d20: ffff8006d4678498 0000000000000000 000000126bde0a8b ffff8006d4678480
7d40: 0000000000000000 000000126bdbea64 ffff200008fd0000 ffff8006fffff980
7d60: 00000000495f0018 ffff200009e97dc0 ffff200008b6c4ec ffff200009e97dc0
7d80: ffff200008b6c4f0 0000000020000145 ffff8006da0d5b80 ffff8006d4678498
7da0: ffffffffffffffff ffff8006d4678498 ffff200009e97dc0 ffff200008b6c4f0
[<ffff200008084034>] el1_irq+0xb4/0x12c
[<ffff200008b6c4f0>] cpuidle_enter_state+0x818/0x844
[<ffff200008b6c59c>] cpuidle_enter+0x18/0x20
[<ffff20000815f2e4>] call_cpuidle+0x98/0x9c
[<ffff20000815f674>] do_idle+0x214/0x264
[<ffff20000815facc>] cpu_startup_entry+0x20/0x24
[<ffff200008fb09d8>] rest_init+0x30c/0x320
[<ffff2000095f1338>] start_kernel+0x570/0x5b0
---<-snip->---

Change-Id: I33211f495489b3c5cf58289c132a08daeece1941
Fixes: 132fcb4608 ("usb: gadget: Add Audio Class 2.0 Driver")
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 56bc61587daadef67712068f251c4ef2e3932d94
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:17:00 +05:30
Vladimir Zapolskiy
2d4d3f270b usb: gadget: u_audio: remove cached period bytes value
Substream period size potentially can be changed in runtime, however
this is not accounted in the data copying routine, the change replaces
the cached value with an actual value from substream runtime.

As a side effect the change also removes a potential division by zero
in u_audio_iso_complete() function, if there is a race with
uac_pcm_hw_free(), which sets prm->period_size to 0.

Change-Id: Id9e5dc114d61976582a96b1ba1758078057dcb89
Fixes: 132fcb4608 ("usb: gadget: Add Audio Class 2.0 Driver")
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 773e53d50e227b0c03d0bb434c1636f6c49c75b2
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:17:00 +05:30
Vladimir Zapolskiy
5e79fd6f76 usb: gadget: u_audio: remove caching of stream buffer parameters
There is no necessity to copy PCM stream ring buffer area and size
properties to UAC private data structure, these values can be got
from substream itself.

The change gives more control on substream and avoid stale caching.

Change-Id: I91a2276b8eeb8f4961c06254240986301af30099
Fixes: 132fcb4608 ("usb: gadget: Add Audio Class 2.0 Driver")
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 96afb54ece0ee903d23a7ac04ddc461413b972c4
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:16:59 +05:30
Joshua Frkuska
f30d9c4d16 usb: gadget: u_audio: update hw_ptr in iso_complete after data copied
In u_audio_iso_complete, the runtime hw_ptr is updated before the
data is actually copied over to/from the buffer/dma area. When
ALSA uses this hw_ptr, the data may not actually be available to
be used. This causes trash/stale audio to play/record. This
patch updates the hw_ptr after the data has been copied to avoid
this.

Change-Id: Ia2dffdbb6fd1c9412e0b7c5cd483bfb0fe032943
Fixes: 132fcb4608 ("usb: gadget: Add Audio Class 2.0 Driver")
Signed-off-by: Joshua Frkuska <joshua_frkuska@mentor.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 6b37bd78d30c890e575a1bda22978d1d2a233362
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:16:59 +05:30
Eugeniu Rosca
13d7ef745d usb: gadget: u_audio: fix pcm/card naming in g_audio_setup()
Fix below smatch (v0.5.0-4443-g69e9094e11c1) warnings:
drivers/usb/gadget/function/u_audio.c:607 g_audio_setup() warn: strcpy() 'pcm_name' of unknown size might be too large for 'pcm->name'
drivers/usb/gadget/function/u_audio.c:614 g_audio_setup() warn: strcpy() 'card_name' of unknown size might be too large for 'card->driver'
drivers/usb/gadget/function/u_audio.c:615 g_audio_setup() warn: strcpy() 'card_name' of unknown size might be too large for 'card->shortname'

Below commits performed a similar 's/strcpy/strlcpy/' rework:
* v2.6.31 commit 8372d4980f ("ALSA: ctxfi - Fix PCM device naming")
* v4.14 commit 003d3e70dbeb ("ALSA: ad1848: fix format string overflow warning")
* v4.14 commit 6d8b04de87e1 ("ALSA: cs423x: fix format string overflow warning")

Change-Id: Iac2273d900d4e39b7ad208e53b178cf1f4dbd745
Fixes: eb9fecb9e69b ("usb: gadget: f_uac2: split out audio core")
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: dfa042fa310caa475667b8c38d852f14439e0b01
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:16:59 +05:30
Bhumika Goyal
49c1106510 usb: gadget: make snd_pcm_hardware const
Make this const as it is only used during a copy operation.
Done using Coccinelle.

Change-Id: I91203bd925841c0795289590aca5252eaeb289ea
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 2ab3c34c9c75331143d67042e826bdcde4d6ab37
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:16:58 +05:30
Arvind Yadav
9585c49d93 usb: gadget: f_uac2: constify snd_pcm_ops structures
snd_pcm_ops are not supposed to change at runtime. All functions
working with snd_pcm_ops provided by <sound/pcm.h> work with
const snd_pcm_ops. So mark the non-const structs as const.

Change-Id: I8cc1c08b952cdc8974368301d784a60294bd7561
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 640c0be81b9c33485559e716d914252228361b1c
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:16:58 +05:30
Ruslan Bilovol
ee164f3bfa usb: gadget: f_uac1: endianness fixes.
As per USB spec, multiple-bytes fields are stored
in little-endian order. Use CPU<->LE helpers for
such fields.

Change-Id: I140bc507340d011cbeec53afeee8458280f72992
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 42370b821168e6730ec4c7d988aeadc1260c7b4d
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:16:58 +05:30
Ruslan Bilovol
c762b9b837 usb: gadget: add f_uac1 variant based on a new u_audio api
This patch adds a new function 'f_uac1'
(f_uac1 with virtual "ALSA card") that
uses recently created u_audio API. Comparing
to legacy f_uac1 function implementation it
doesn't require any real Audio codec to be
present on the device. In f_uac1 audio
streams are simply sinked to and sourced
from a virtual ALSA sound card created
using u_audio API.

Legacy f_uac1 approach is to write audio
samples directly to existing ALSA sound
card

f_uac1 approach is more generic/flexible
one - create an ALSA sound card that
represents USB Audio function and allows to
be used by userspace application that
may choose to do whatever it wants with the
data received from the USB Host and choose
to provide whatever it wants as audio data
to the USB Host.

f_uac1 also has capture support (gadget->host)
thanks to easy implementation via u_audio.
By default, capture interface has 48000kHz/2ch
configuration, same as playback channel has.

f_uac1 descriptors naming convention
uses f_uac2 driver naming convention that
makes it more common and meaningful.

Comparing to f_uac1_legacy, the f_uac1 doesn't
have volume/mute functionality. This is because
the f_uac1 volume/mute feature unit was dummy
implementation since that driver creation (2009)
and never had any real volume control or mute
functionality, so there is no any difference
here.

Since f_uac1 functionality, exposed
interface to userspace (virtual ALSA card),
input parameters are so different comparing
to f_uac1_legacy, that there is no any
reason to keep them in the same file/module,
and separate function was created.

g_audio can be built using one of existing
UAC functions (f_uac1, f_uac1_legacy or f_uac2)

Change-Id: Ie47604cd098e9abc51c38a25132249933e190e4c
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 0591bc2360152f851e29246884805bb77a2c3b9d
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[ajaya@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:16:57 +05:30
Ruslan Bilovol
e067bbe140 usb: gadget: function: make current f_uac1 implementation legacy
Before introducing new f_uac1 function (with virtual
ALSA card) make current implementation legacy.

This includes renaming of existing files, some
variables, config options and documentation

Change-Id: I0e67a74a84416e6325725fc4b7d907d3c89a70e1
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: d355339eecd986648420e05f8c958fbc78dbb382
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[ajaya@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:16:57 +05:30
Ruslan Bilovol
d97c071258 usb: gadget: f_uac2: split out audio core
Abstract the peripheral side ALSA sound card code from
the f_uac2 function into a component that can be called
by various functions, so the various flavors can be split
apart and selectively reused.

Visible changes:
 - add uac_params structure to pass audio paramteres for
   g_audio_setup
 - make ALSA sound card's name configurable
 - add [in/out]_ep_maxpsize
 - allocate snd_uac_chip structure during g_audio_setup
 - add u_audio_[start/stop]_[capture/playback] functions

Change-Id: I412ed3afca008300800ee61a774e1f23900e8ed6
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: eb9fecb9e69b0be8c267c55b0bb52a08e8fb6bee
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-09 10:16:56 +05:30