Commit Graph

1032 Commits

Author SHA1 Message Date
Jack Pham
c118e1d627 usb: pd: Allow receiving VDM messages during suspend
Add an API to allow a VDM client (e.g. DisplayPort) to indicate
that the system is entering suspend but that an incoming VDM
message is expected. If a VDM is then received, it will bypass
kick_sm() which would otherwise abort the suspend and instead
be handed to the client VDM handler directly.

The flag can be reset either explicitly, if a soft/hard reset
occur, or if a VDM TX is requested, as those situations would
require the state machine to run in the worker thread normally.

Change-Id: I8af7e13abad766f9e4245149da9457f1c62a25d5
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-02-25 11:15:06 -08:00
Ajay Agarwal
08cce56f8d usb: misc: Add snapshot of diag_bridge driver
USB diag host driver will be used to connect diag interface
exposed by Qualcomm devices. This is a snapshot of diag_bridge
driver from kernel msm-3.10 'commit 680769b57a70
("wcnss: Fix buffer overflow in wcnss_prealloc_get")'. Fix
checkpatch failures and minor code improvements.

Change-Id: Ide503c5bf729a7e41de98b12c89e4edc12af61fe
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-02-10 19:45:48 -08:00
Hemant Kumar
23f8fe7c99 usb: xhci: Power up/down SS phy upon bus suspend/resume
In case HS device is connected SS phy needs to be powered
up before bus goes to U3 state. Similarly SS phy needs to be
powered down after bus goes to U0 state. Otherwise remote
wake up is resulting into link does not transition to U0 and
stay into RESUME state.

Change-Id: Ieb328618ffb9cb74a4f4c129e4609e9ec200e55b
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2018-11-01 20:00:30 -07:00
Hemant Kumar
5f5def1a5f usb: phy-msm-ssusb-qmp: Improve msm_ssphy_qmp_powerup API
Workaround implemneted by commit <8182accd6f9c> ("usb: dwc3:
Powerdown the SS PHY while connected to HS device") needs to
be applied and removed when PHY_WAKEUP_WA_EN flag is set.
This allows the API call to become no-op if workaround is
not required in case super speed port is enabled.

Change-Id: I5e4784a1b5af72f6d85d0c6e94ebc717807c655d
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2018-11-01 19:59:09 -07:00
Pratham Pratap
c207232844 usb: phy-msm-ssusb-qmp: Perform USB only reset in USB+DP mode
When USB3 controller stops responding to stop endpoint
command driver performs global phy reset to recover from
error state. During this USB host mode recovery is performed
and global phy reset is done but DP driver is not notified
of this reset which results in unclocked access of DP link
registers. Fix this by replacing phy global reset with USB
only reset to not affect DP PHY when USB is reset in DP+USB
concurrent mode.

Change-Id: I2acde04c99b84293644fdefdceee4bd00a964e7f
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
2018-10-15 17:06:39 -07:00
Hemant Kumar
7d988501a9 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>
2018-09-25 15:47:48 -07:00
Vamsi Krishna Samavedam
8182accd6f usb: dwc3: Powerdown the SS PHY while connected to HS device
SNPS controller can wakeup both HS PHY and SS PHY (for UTMI clock and
PIPE clock) for any xhci command or doorbell rings. This might result
in additional power consumption when only HS device is connected to
root port. To avoid additional power consumption when operating in
high-speed only mode, power down SS PHY.

Change-Id: I35195934c617d7c581976e34da73777bfa13fe6f
Signed-off-by: Vamsi Krishna Samavedam <vskrishn@codeaurora.org>
2018-08-27 13:00:56 -07:00
Chandana Kishori Chiluveru
76b35fa8d9 usb: f_gsi: Report Function Remote Wake capabilities
Add support for sending Function Wake capabilities in
response to GET_STATUS from the host. GET_STATUS addressed
to an Interface allows the device to report if it is capable
of doing a Function Remote Wake. Windows8/10 MBIM hosts request
this information before enabling Suspend in SS mode.

Change-Id: Ic0a6db57b2b46804a82847de511feb433a3dfca6
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>
Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
2018-08-07 12:47:05 +05:30
Sriharsha Allenki
57ea67b717 usb: phy: Enable proper DP DM masks for PHY interrupts
Enable proper DP and DM toggle masks to get PHY wakeup
interrupts on DP/DM state changes in different
bus speeds (FS/HS or LS).
Also make sure that the interrupts are cleared by adding
a delay of 200us to prevent an unwanted interrupt that is
triggered during suspend on peripheral disconnect.


Change-Id: I31b9e50dcc47605fd68b691ed3326136527613ad
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
2018-07-31 19:00:13 +05:30
Sriharsha Allenki
aa64dad633 usb: phy: Add the interrupt programming sequence for HS PHY
Add the programming sequence to enable, disable and
clear PHY HV interrupts that are triggered on HS wakeup
events.

Change-Id: I2c323d24e86885ccb39407794e372eecc15405a5
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
2018-07-27 11:11:51 +05:30
Vijayavardhan Vennapusa
3ae9f41c79 USB: dwc3-msm: Perform DBM config/unconfig under spinlock protection
There is a possibility of dwc3_msm_ep_queue() and msm_ep_unconfig() racing
each other if suspend happens right after configured. This scenario will
result in NOC error if start_xfer command gets queued after
msm_ep_unconfig().  Hence fix the issue by adding spinlock protection for
DBM endpoint configuration and unconfiguration.

Change-Id: I3fd007647370250017c97faebffadb35afb7fc4d
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2018-07-20 14:53:45 -07:00
Vijayavardhan Vennapusa
513c7d651c USB: dwc3-msm: Initialize DBM ep before BAM pipe reset
On new platforms, endpoint clock gating is added for dbm endpoints
with Synopsys USB3.0 controller. This hardware feature requires
initialization of DBM endpoint before BAM pipe reset for bam2bam mode
data transfers working. Hence change sequence such that do DBM endpoint
initialization first followed by BAM pipe reset and do start transfer
as last operation.

CRs-Fixed: 965207
Change-Id: Ib5bfd1a7d258fe336a4c9924850fc9223c1c81f6
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2018-07-20 10:46:12 -07:00
Sriharsha Allenki
31f8a9f89f usb: phy: Add Synopsys High Speed Femto PHY driver
Add Synopsys High Speed 28 nm Femto driver that
can be interfaced with PHY framework.

Change-Id: Ic1fb76fc0087f7f6bd14b5399bde94a98d4e42b2
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
2018-06-08 10:27:01 +05:30
qctecmdr Service
d1514cd853 Merge "Merge remote-tracking branch 'remotes/origin/tmp-eca84e5' into msm-4.14" 2018-06-06 12:26:36 -07:00
Vamsi Krishna Samavedam
51ba5b1e3d usb: dwc3: Notify super speed phy about link training
Notify super speed phy such as qmp phy to start/stop link
training (reset and connection done) so that phy can reset
training sequence buffer when required.

Change-Id: I6c1a07d5d4614d368d57e742569ec537e0212e51
Signed-off-by: Vamsi Krishna Samavedam <vskrishn@codeaurora.org>
2018-06-05 12:55:23 -07:00
Isaac J. Manjarres
f38622d678 Merge remote-tracking branch 'remotes/origin/tmp-6e962a3' into msm-4.14
* remotes/origin/tmp-6e962a3:
  Linux 4.14.44
  rtc: goldfish: Add missing MODULE_LICENSE
  rtc: rp5c01: fix possible race condition
  rtc: tx4939: avoid unintended sign extension on a 24 bit shift
  rtc: m41t80: fix race conditions
  rtc: rk808: fix possible race condition
  rtc: hctosys: Ensure system time doesn't overflow time_t
  rtc: snvs: Fix usage of snvs_rtc_enable
  serial: altera: ensure port->regshift is honored consistently
  serial: 8250: Don't service RX FIFO if interrupts are disabled
  serial: arc_uart: Fix out-of-bounds access through DT alias
  serial: fsl_lpuart: Fix out-of-bounds access through DT alias
  serial: imx: Fix out-of-bounds access through serial port index
  serial: mxs-auart: Fix out-of-bounds access through serial port index
  serial: samsung: Fix out-of-bounds access through serial port index
  serial: sh-sci: Fix out-of-bounds access through DT alias
  serial: xuartps: Fix out-of-bounds access through DT alias
  media: cx25821: prevent out-of-bounds read on array card
  media: vivid: fix incorrect capabilities for radio
  media: vb2: Fix videobuf2 to map correct area
  media: i2c: adv748x: fix HDMI field heights
  media: v4l: vsp1: Fix display stalls when requesting too many inputs
  media: em28xx: Add Hauppauge SoloHD/DualHD bulk models
  media: lgdt3306a: Fix a double kfree on i2c device remove
  media: s3c-camif: fix out-of-bounds array access
  media: cx23885: Set subdev host data to clk_freq pointer
  media: cx23885: Override 888 ImpactVCBe crystal frequency
  media: ov5645: add missing of_node_put() in error path
  media: Don't let tvp5150_get_vbi() go out of vbi_ram_default array
  media: dmxdev: fix error code for invalid ioctls
  clk: samsung: exynos3250: Fix PLL rates
  clk: samsung: exynos5250: Fix PLL rates
  clk: samsung: exynos5433: Fix PLL rates
  clk: samsung: exynos5260: Fix PLL rates
  clk: samsung: exynos7: Fix PLL rates
  clk: samsung: s3c2410: Fix PLL rates
  clk: rockchip: Prevent calculating mmc phase if clock rate is zero
  clk: tegra: Fix pll_u rate configuration
  clk: hisilicon: mark wdt_mux_p[] as const
  clk: Don't show the incorrect clock phase
  clk: rockchip: Fix wrong parent for SDMMC phase clock for rk3228
  ASoC: samsung: i2s: Ensure the RCLK rate is properly determined
  ASoC: topology: create TLV data for dapm widgets
  ASoC: samsung: odroid: Fix 32000 sample rate handling
  ASoC: rockchip: rk3288-hdmi-analog: Select needed codecs
  ASoC: hdmi-codec: Fix module unloading caused kernel crash
  scsi: lpfc: Fix frequency of Release WQE CQEs
  scsi: lpfc: Fix soft lockup in lpfc worker thread during LIP testing
  scsi: lpfc: Fix issue_lip if link is disabled
  scsi: mvsas: fix wrong endianness of sgpio api
  scsi: core: Make SCSI Status CONDITION MET equivalent to GOOD
  scsi: aacraid: Insure command thread is not recursively stopped
  scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled
  scsi: sd: Keep disk read-only when re-reading partition
  scsi: mpt3sas: Do not mark fw_event workqueue as WQ_MEM_RECLAIM
  scsi: qedi: Fix kernel crash during port toggle
  scsi: qla4xxx: skip error recovery in case of register disconnect.
  scsi: aacraid: fix shutdown crash when init fails
  scsi: qedi: Fix truncation of CHAP name and secret
  scsi: storvsc: Increase cmd_per_lun for higher speed devices
  scsi: qla2xxx: Avoid triggering undefined behavior in qla2x00_mbx_completion()
  scsi: mptfusion: Add bounds check in mptctl_hp_targetinfo()
  scsi: sym53c8xx_2: iterator underflow in sym_getsync()
  scsi: bnx2fc: Fix check in SCSI completion handler for timed out request
  scsi: ufs: Enable quirk to ignore sending WRITE_SAME command
  scsi: qla2xxx: Fix memory corruption during hba reset test
  scsi: mpt3sas: fix an out of bound write
  crypto: inside-secure - fix the invalidation step during cra_exit
  crypto: sunxi-ss - Add MODULE_ALIAS to sun4i-ss
  crypto: inside-secure - fix the extra cache computation
  crypto: inside-secure - fix the cache_len computation
  crypto: inside-secure - do not process request if no command was issued
  crypto: ccp - don't disable interrupts while setting up debugfs
  crypto: atmel-aes - fix the keys zeroing on errors
  crypto: inside-secure - wait for the request to complete if in the backlog
  staging: lustre: lmv: correctly iput lmo_root
  staging: ks7010: Use constants from ieee80211_eid instead of literal ints.
  staging: rtl8192u: return -ENOMEM on failed allocation of priv->oldaddr
  staging: fsl-dpaa2/eth: Fix incorrect casts
  staging: lustre: fix bug in osc_enter_cache_try
  staging: bcm2835-audio: Release resources on module_exit()
  xhci: Show what USB release number the xHC supports from protocol capablity
  Bluetooth: btusb: Add device ID for RTL8822BE
  media: em28xx: USB bulk packet size fix
  media: lgdt3306a: Fix module count mismatch on usb unplug
  usb: gadget: composite: fix incorrect handling of OS desc requests
  usb: gadget: udc: change comparison to bitshift when dealing with a mask
  usbip: Correct maximum value of CONFIG_USBIP_VHCI_HC_PORTS
  usb: gadget: ffs: Execute copy_to_user() with USER_DS set
  usb: gadget: ffs: Let setup() return USB_GADGET_DELAYED_STATUS
  usb: dwc2: host: Fix transaction errors in host mode
  usb: dwc2: hcd: Fix host channel halt flow
  usb: dwc2: Fix interval type issue
  xhci: zero usb device slot_id member when disabling and freeing a xhci slot
  usb: dwc3: Makefile: fix link error on randconfig
  usb: dwc3: Update DWC_usb31 GTXFIFOSIZ reg fields
  usb: dwc3: Add SoftReset PHY synchonization delay
  ALSA: usb-audio: Add native DSD support for Luxman DA-06
  Bluetooth: btusb: Add USB ID 7392:a611 for Edimax EW-7611ULB
  net-usb: add qmi_wwan if on lte modem wistron neweb d18q1
  net/usb/qmi_wwan.c: Add USB id for lt4120 modem
  USB: OHCI: Fix NULL dereference in HCDs using HCD_LOCAL_MEM
  usb: host: xhci-plat: revert "usb: host: xhci-plat: enable clk in resume timing"
  ARM: dts: imx7d-sdb: Fix regulator-usb-otg2-vbus node name
  net: usbnet: fix potential deadlock on 32bit hosts
  usb: cdc_acm: prevent race at write to acm while system resumes
  usb: dwc2: Fix dwc2_hsotg_core_init_disconnected()
  usb: gadget: fsl_udc_core: fix ep valid checks
  usb: gadget: core: Fix use-after-free of usb_request
  usb: dwc3: omap: don't miss events during suspend/resume
  usb: dwc3: Undo PHY init if soft reset fails
  usb: gadget: f_uac2: fix bFirstInterface in composite gadget
  x86/kexec: Avoid double free_page() upon do_kexec_load() failure
  hfsplus: stop workqueue when fill_super() failed
  cfg80211: limit wiphy names to 128 bytes
  loop: fix LOOP_GET_STATUS lock imbalance
  loop: don't call into filesystem while holding lo_ctl_mutex
  scsi: zfcp: fix infinite iteration on ERP ready list
  scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()
  scsi: libsas: defer ata device eh commands to libata
  s390: use expoline thunks in the BPF JIT
  s390: extend expoline to BC instructions
  s390: move spectre sysfs attribute code
  s390/kernel: use expoline for indirect branches
  s390/ftrace: use expoline for indirect branches
  s390/lib: use expoline for indirect branches
  s390/crc32-vx: use expoline for indirect branches
  s390: move expoline assembler macros to a header
  s390: add assembler macros for CPU alternatives
  ext2: fix a block leak
  sparc: vio: use put_device() instead of kfree()
  hv_netvsc: Fix net device attach on older Windows hosts
  hv_netvsc: Ensure correct teardown message sequence order
  hv_netvsc: Split netvsc_revoke_buf() and netvsc_teardown_gpadl()
  hv_netvsc: Use Windows version instead of NVSP version on GPAD teardown
  hv_netvsc: common detach logic
  hv_netvsc: change GPAD teardown order on older versions
  hv_netvsc: use RCU to fix concurrent rx and queue changes
  hv_netvsc: disable NAPI before channel close
  hv_netvsc: defer queue selection to VF
  hv_netvsc: fix race in napi poll when rescheduling
  hv_netvsc: cancel subchannel setup before halting device
  hv_netvsc: fix error unwind handling if vmbus_open fails
  hv_netvsc: only wake transmit queue if link is up
  hv_netvsc: avoid retry on send during shutdown
  hv_netvsc: Use the num_online_cpus() for channel limit
  hv_netvsc: empty current transmit aggregation if flow blocked
  hv_netvsc: preserve hw_features on mtu/channels/ringparam changes
  hv_netvsc: netvsc_teardown_gpadl() split
  hv_netvsc: Set tx_table to equal weight after subchannels open
  hv_netvsc: Add initialization of tx_table in netvsc_device_add()
  hv_netvsc: Rename tx_send_table to tx_table
  hv_netvsc: Rename ind_table to rx_table
  hv_netvsc: Fix the real number of queues of non-vRSS cases
  vmxnet3: use DMA memory barriers where required
  vmxnet3: set the DMA mask before the first DMA map operation
  tcp: purge write queue in tcp_connect_init()
  sock_diag: fix use-after-free read in __sk_free
  packet: in packet_snd start writing at link layer allocation
  net: test tailroom before appending to linear skb
  net/smc: check for missing nlattrs in SMC_PNETID messages
  net: sched: red: avoid hashing NULL child
  net/sched: fix refcnt leak in the error path of tcf_vlan_init()
  net/mlx4_core: Fix error handling in mlx4_init_port_info.
  net: Fix a bug in removing queues from XPS map
  ANDROID: proc: fix undefined behavior in proc_uid_base_readdir
  x86: vdso: Fix leaky vdso linker with CC=clang.
  ANDROID: x86_64_cuttlefish_defconfig: Disable ORC unwinder.
  ANDROID: build: cuttlefish: Upgrade clang to newer version.
  ANDROID: build: cuttlefish: Upgrade clang to newer version.
  ANDROID: build: cuttlefish: Fix path to clang.

Conflicts:
	drivers/scsi/sd.c
	drivers/scsi/ufs/ufshcd.c
	drivers/usb/gadget/function/f_fs.c

Change-Id: Iba64240c1ddf00c0ba4531740be132a385bc4f5e
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2018-05-30 17:07:58 -07:00
Greg Kroah-Hartman
6e962a34f1 Merge 4.14.44 into android-4.14
Changes in 4.14.44
	net: Fix a bug in removing queues from XPS map
	net/mlx4_core: Fix error handling in mlx4_init_port_info.
	net/sched: fix refcnt leak in the error path of tcf_vlan_init()
	net: sched: red: avoid hashing NULL child
	net/smc: check for missing nlattrs in SMC_PNETID messages
	net: test tailroom before appending to linear skb
	packet: in packet_snd start writing at link layer allocation
	sock_diag: fix use-after-free read in __sk_free
	tcp: purge write queue in tcp_connect_init()
	vmxnet3: set the DMA mask before the first DMA map operation
	vmxnet3: use DMA memory barriers where required
	hv_netvsc: Fix the real number of queues of non-vRSS cases
	hv_netvsc: Rename ind_table to rx_table
	hv_netvsc: Rename tx_send_table to tx_table
	hv_netvsc: Add initialization of tx_table in netvsc_device_add()
	hv_netvsc: Set tx_table to equal weight after subchannels open
	hv_netvsc: netvsc_teardown_gpadl() split
	hv_netvsc: preserve hw_features on mtu/channels/ringparam changes
	hv_netvsc: empty current transmit aggregation if flow blocked
	hv_netvsc: Use the num_online_cpus() for channel limit
	hv_netvsc: avoid retry on send during shutdown
	hv_netvsc: only wake transmit queue if link is up
	hv_netvsc: fix error unwind handling if vmbus_open fails
	hv_netvsc: cancel subchannel setup before halting device
	hv_netvsc: fix race in napi poll when rescheduling
	hv_netvsc: defer queue selection to VF
	hv_netvsc: disable NAPI before channel close
	hv_netvsc: use RCU to fix concurrent rx and queue changes
	hv_netvsc: change GPAD teardown order on older versions
	hv_netvsc: common detach logic
	hv_netvsc: Use Windows version instead of NVSP version on GPAD teardown
	hv_netvsc: Split netvsc_revoke_buf() and netvsc_teardown_gpadl()
	hv_netvsc: Ensure correct teardown message sequence order
	hv_netvsc: Fix net device attach on older Windows hosts
	sparc: vio: use put_device() instead of kfree()
	ext2: fix a block leak
	s390: add assembler macros for CPU alternatives
	s390: move expoline assembler macros to a header
	s390/crc32-vx: use expoline for indirect branches
	s390/lib: use expoline for indirect branches
	s390/ftrace: use expoline for indirect branches
	s390/kernel: use expoline for indirect branches
	s390: move spectre sysfs attribute code
	s390: extend expoline to BC instructions
	s390: use expoline thunks in the BPF JIT
	scsi: libsas: defer ata device eh commands to libata
	scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()
	scsi: zfcp: fix infinite iteration on ERP ready list
	loop: don't call into filesystem while holding lo_ctl_mutex
	loop: fix LOOP_GET_STATUS lock imbalance
	cfg80211: limit wiphy names to 128 bytes
	hfsplus: stop workqueue when fill_super() failed
	x86/kexec: Avoid double free_page() upon do_kexec_load() failure
	usb: gadget: f_uac2: fix bFirstInterface in composite gadget
	usb: dwc3: Undo PHY init if soft reset fails
	usb: dwc3: omap: don't miss events during suspend/resume
	usb: gadget: core: Fix use-after-free of usb_request
	usb: gadget: fsl_udc_core: fix ep valid checks
	usb: dwc2: Fix dwc2_hsotg_core_init_disconnected()
	usb: cdc_acm: prevent race at write to acm while system resumes
	net: usbnet: fix potential deadlock on 32bit hosts
	ARM: dts: imx7d-sdb: Fix regulator-usb-otg2-vbus node name
	usb: host: xhci-plat: revert "usb: host: xhci-plat: enable clk in resume timing"
	USB: OHCI: Fix NULL dereference in HCDs using HCD_LOCAL_MEM
	net/usb/qmi_wwan.c: Add USB id for lt4120 modem
	net-usb: add qmi_wwan if on lte modem wistron neweb d18q1
	Bluetooth: btusb: Add USB ID 7392:a611 for Edimax EW-7611ULB
	ALSA: usb-audio: Add native DSD support for Luxman DA-06
	usb: dwc3: Add SoftReset PHY synchonization delay
	usb: dwc3: Update DWC_usb31 GTXFIFOSIZ reg fields
	usb: dwc3: Makefile: fix link error on randconfig
	xhci: zero usb device slot_id member when disabling and freeing a xhci slot
	usb: dwc2: Fix interval type issue
	usb: dwc2: hcd: Fix host channel halt flow
	usb: dwc2: host: Fix transaction errors in host mode
	usb: gadget: ffs: Let setup() return USB_GADGET_DELAYED_STATUS
	usb: gadget: ffs: Execute copy_to_user() with USER_DS set
	usbip: Correct maximum value of CONFIG_USBIP_VHCI_HC_PORTS
	usb: gadget: udc: change comparison to bitshift when dealing with a mask
	usb: gadget: composite: fix incorrect handling of OS desc requests
	media: lgdt3306a: Fix module count mismatch on usb unplug
	media: em28xx: USB bulk packet size fix
	Bluetooth: btusb: Add device ID for RTL8822BE
	xhci: Show what USB release number the xHC supports from protocol capablity
	staging: bcm2835-audio: Release resources on module_exit()
	staging: lustre: fix bug in osc_enter_cache_try
	staging: fsl-dpaa2/eth: Fix incorrect casts
	staging: rtl8192u: return -ENOMEM on failed allocation of priv->oldaddr
	staging: ks7010: Use constants from ieee80211_eid instead of literal ints.
	staging: lustre: lmv: correctly iput lmo_root
	crypto: inside-secure - wait for the request to complete if in the backlog
	crypto: atmel-aes - fix the keys zeroing on errors
	crypto: ccp - don't disable interrupts while setting up debugfs
	crypto: inside-secure - do not process request if no command was issued
	crypto: inside-secure - fix the cache_len computation
	crypto: inside-secure - fix the extra cache computation
	crypto: sunxi-ss - Add MODULE_ALIAS to sun4i-ss
	crypto: inside-secure - fix the invalidation step during cra_exit
	scsi: mpt3sas: fix an out of bound write
	scsi: qla2xxx: Fix memory corruption during hba reset test
	scsi: ufs: Enable quirk to ignore sending WRITE_SAME command
	scsi: bnx2fc: Fix check in SCSI completion handler for timed out request
	scsi: sym53c8xx_2: iterator underflow in sym_getsync()
	scsi: mptfusion: Add bounds check in mptctl_hp_targetinfo()
	scsi: qla2xxx: Avoid triggering undefined behavior in qla2x00_mbx_completion()
	scsi: storvsc: Increase cmd_per_lun for higher speed devices
	scsi: qedi: Fix truncation of CHAP name and secret
	scsi: aacraid: fix shutdown crash when init fails
	scsi: qla4xxx: skip error recovery in case of register disconnect.
	scsi: qedi: Fix kernel crash during port toggle
	scsi: mpt3sas: Do not mark fw_event workqueue as WQ_MEM_RECLAIM
	scsi: sd: Keep disk read-only when re-reading partition
	scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled
	scsi: aacraid: Insure command thread is not recursively stopped
	scsi: core: Make SCSI Status CONDITION MET equivalent to GOOD
	scsi: mvsas: fix wrong endianness of sgpio api
	scsi: lpfc: Fix issue_lip if link is disabled
	scsi: lpfc: Fix soft lockup in lpfc worker thread during LIP testing
	scsi: lpfc: Fix frequency of Release WQE CQEs
	ASoC: hdmi-codec: Fix module unloading caused kernel crash
	ASoC: rockchip: rk3288-hdmi-analog: Select needed codecs
	ASoC: samsung: odroid: Fix 32000 sample rate handling
	ASoC: topology: create TLV data for dapm widgets
	ASoC: samsung: i2s: Ensure the RCLK rate is properly determined
	clk: rockchip: Fix wrong parent for SDMMC phase clock for rk3228
	clk: Don't show the incorrect clock phase
	clk: hisilicon: mark wdt_mux_p[] as const
	clk: tegra: Fix pll_u rate configuration
	clk: rockchip: Prevent calculating mmc phase if clock rate is zero
	clk: samsung: s3c2410: Fix PLL rates
	clk: samsung: exynos7: Fix PLL rates
	clk: samsung: exynos5260: Fix PLL rates
	clk: samsung: exynos5433: Fix PLL rates
	clk: samsung: exynos5250: Fix PLL rates
	clk: samsung: exynos3250: Fix PLL rates
	media: dmxdev: fix error code for invalid ioctls
	media: Don't let tvp5150_get_vbi() go out of vbi_ram_default array
	media: ov5645: add missing of_node_put() in error path
	media: cx23885: Override 888 ImpactVCBe crystal frequency
	media: cx23885: Set subdev host data to clk_freq pointer
	media: s3c-camif: fix out-of-bounds array access
	media: lgdt3306a: Fix a double kfree on i2c device remove
	media: em28xx: Add Hauppauge SoloHD/DualHD bulk models
	media: v4l: vsp1: Fix display stalls when requesting too many inputs
	media: i2c: adv748x: fix HDMI field heights
	media: vb2: Fix videobuf2 to map correct area
	media: vivid: fix incorrect capabilities for radio
	media: cx25821: prevent out-of-bounds read on array card
	serial: xuartps: Fix out-of-bounds access through DT alias
	serial: sh-sci: Fix out-of-bounds access through DT alias
	serial: samsung: Fix out-of-bounds access through serial port index
	serial: mxs-auart: Fix out-of-bounds access through serial port index
	serial: imx: Fix out-of-bounds access through serial port index
	serial: fsl_lpuart: Fix out-of-bounds access through DT alias
	serial: arc_uart: Fix out-of-bounds access through DT alias
	serial: 8250: Don't service RX FIFO if interrupts are disabled
	serial: altera: ensure port->regshift is honored consistently
	rtc: snvs: Fix usage of snvs_rtc_enable
	rtc: hctosys: Ensure system time doesn't overflow time_t
	rtc: rk808: fix possible race condition
	rtc: m41t80: fix race conditions
	rtc: tx4939: avoid unintended sign extension on a 24 bit shift
	rtc: rp5c01: fix possible race condition
	rtc: goldfish: Add missing MODULE_LICENSE
	Linux 4.14.44

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2018-05-25 17:23:22 +02:00
Chris Dickens
f3f3442027 usb: gadget: composite: fix incorrect handling of OS desc requests
[ Upstream commit 5d6ae4f0da8a64a185074dabb1b2f8c148efa741 ]

When handling an OS descriptor request, one of the first operations is
to zero out the request buffer using the wLength from the setup packet.
There is no bounds checking, so a wLength > 4096 would clobber memory
adjacent to the request buffer. Fix this by taking the min of wLength
and the request buffer length prior to the memset. While at it, define
the buffer length in a header file so that magic numbers don't appear
throughout the code.

When returning data to the host, the data length should be the min of
the wLength and the valid data we have to return. Currently we are
returning wLength, thus requests for a wLength greater than the amount
of data in the OS descriptor buffer would return invalid (albeit zero'd)
data following the valid descriptor data. Fix this by counting the
number of bytes when constructing the data and using this when
determining the length of the request.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25 16:17:41 +02:00
Hemant Kumar
5d13333ba0 usb: gadget: f_qdss: Add support for mdm qdss channel
Driver needs to pass qdss data received from mdm qdss
bridge driver to host PC. This requires a software data
path using IN endpoint. Bridge driver needs to open
qdss_mdm channel and use exported write() API to pass
the qdss data received from mdm. Driver calls the notify
call back upon write completion.

Change-Id: I4d8ceaed0bf9c85aa17d3f49503cd690917cc117
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2018-04-13 17:46:23 -07:00
Blagovest Kolenichev
24b2e60f51 Merge android-4.14.29 (45c8dbe) into msm-4.14
* refs/heads/tmp-45c8dbe
  Linux 4.14.29
  usb: dwc3: Fix GDBGFIFOSPACE_TYPE values
  USB: gadget: udc: Add missing platform_device_put() on error in bdc_pci_probe()
  scsi: qla2xxx: Fix crashes in qla2x00_probe_one on probe failure
  scsi: qla2xxx: Fix logo flag for qlt_free_session_done()
  scsi: qla2xxx: Fix NULL pointer access for fcport structure
  scsi: qla2xxx: Fix smatch warning in qla25xx_delete_{rsp|req}_que
  btrfs: Fix memory barriers usage with device stats counters
  btrfs: remove spurious WARN_ON(ref->count < 0) in find_parent_nodes
  btrfs: Fix use-after-free when cleaning up fs_devs with a single stale device
  btrfs: alloc_chunk: fix DUP stripe size handling
  btrfs: add missing initialization in btrfs_check_shared
  btrfs: Fix NULL pointer exception in find_bio_stripe
  irqchip/gic-v3-its: Ensure nr_ites >= nr_lpis
  RDMAVT: Fix synchronization around percpu_ref
  fs/aio: Use RCU accessors for kioctx_table->table[]
  fs/aio: Add explicit RCU grace period when freeing kioctx
  lock_parent() needs to recheck if dentry got __dentry_kill'ed under it
  KVM: arm/arm64: vgic: Don't populate multiple LRs with the same vintid
  kvm: arm/arm64: vgic-v3: Tighten synchronization for guests using v2 on v3
  KVM: arm/arm64: Reduce verbosity of KVM init log
  fs: Teach path_connected to handle nfs filesystems with multiple roots.
  drm/amdgpu/dce: Don't turn off DP sink when disconnected
  drm/radeon: fix prime teardown order
  drm/amdgpu: fix prime teardown order
  drm/nouveau/bl: Fix oops on driver unbind
  ALSA: seq: Clear client entry before deleting else at closing
  ALSA: seq: Fix possible UAF in snd_seq_check_queue()
  ALSA: hda - Revert power_save option default value
  ALSA: pcm: Fix UAF in snd_pcm_oss_get_formats()
  parisc: Handle case where flush_cache_range is called with no context
  x86/mm: Fix vmalloc_fault to use pXd_large
  KVM: x86: Fix device passthrough when SME is active
  x86/speculation: Remove Skylake C2 from Speculation Control microcode blacklist
  x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit kernels
  x86/vm86/32: Fix POPF emulation
  selftests/x86/entry_from_vm86: Add test cases for POPF
  selftests/x86: Add tests for the STR and SLDT instructions
  selftests/x86: Add tests for User-Mode Instruction Prevention
  selftests/x86/entry_from_vm86: Exit with 1 if we fail
  x86/cpufeatures: Add Intel PCONFIG cpufeature
  x86/cpufeatures: Add Intel Total Memory Encryption cpufeature
  ANDROID: arm-smccc: fix clang build
  staging: android: ashmem: Fix possible deadlock in ashmem_ioctl
  Linux 4.14.28
  drm/i915/glk: Disable Guc and HuC on GLK
  dmaengine: qcom_hidma: check pending interrupts
  IB/mlx5: revisit -Wmaybe-uninitialized warning
  ima: relax requiring a file signature for new files with zero length
  locking/locktorture: Fix num reader/writer corner cases
  rcutorture/configinit: Fix build directory error message
  ipvlan: add L2 check for packets arriving via virtual devices
  Fix misannotated out-of-line _copy_to_user()
  mmc: mmc_test: Ensure command queue is disabled for testing
  ASoC: nuc900: Fix a loop timeout test
  crypto: caam/qi - use correct print specifier for size_t
  mac80211: remove BUG() when interface type is invalid
  mac80211_hwsim: enforce PS_MANUAL_POLL to be set after PS_ENABLED
  agp/intel: Flush all chipset writes after updating the GGTT
  arm64: dts: renesas: salvator-common: Add EthernetAVB PHY reset
  powerpc/64: Don't trace irqs-off at interrupt return to soft-disabled context
  powerpc/modules: Don't try to restore r2 after a sibling call
  drm/amdkfd: Fix memory leaks in kfd topology
  veth: set peer GSO values
  net: sched: drop qdisc_reset from dev_graft_qdisc
  virtio_net: Disable interrupts if napi_complete_done rescheduled napi
  media: davinci: vpif_capture: add NULL check on devm_kzalloc return value
  media: cpia2: Fix a couple off by one bugs
  dm raid: fix raid set size revalidation
  media: vsp1: Prevent suspending and resuming DRM pipelines
  scsi: dh: add new rdac devices
  scsi: devinfo: apply to HP XP the same flags as Hitachi VSP
  scsi: core: scsi_get_device_flags_keyed(): Always return device flags
  bnxt_en: Don't print "Link speed -1 no longer supported" messages.
  spi: sun6i: disable/unprepare clocks on remove
  tools/usbip: fixes build with musl libc toolchain
  ath10k: fix invalid STS_CAP_OFFSET_MASK
  mwifiex: cfg80211: do not change virtual interface during scan processing
  clk: qcom: msm8916: fix mnd_width for codec_digcodec
  drm/amdgpu:fix virtual dce bug
  iwlwifi: mvm: avoid dumping assert log when device is stopped
  perf annotate: Fix objdump comment parsing for Intel mov dissassembly
  perf annotate: Fix unnecessary memory allocation for s390x
  pinctrl: sh-pfc: r8a7795-es1: Fix MOD_SEL1 bit[25:24] to 0x3 when using STP_ISEN_1_D
  pinctrl: sh-pfc: r8a7791: Add can_clk function
  drm/sun4i: Fix format mask in DE2 driver
  pwm: stmpe: Fix wrong register offset for hwpwm=2 case
  scsi: ses: don't ask for diagnostic pages repeatedly during probe
  drm/amdgpu:fix random missing of FLR NOTIFY
  cpufreq: Fix governor module removal race
  ath10k: update tdls teardown state to target
  iio: health: max30102: Add power enable parameter to get_temp function
  iio: adc: ina2xx: Shift bus voltage register to mask flag bits
  drm/etnaviv: make THERMAL selectable
  power: supply: ab8500_charger: Bail out in case of error in 'ab8500_charger_init_hw_registers()'
  power: supply: ab8500_charger: Fix an error handling path
  leds: pm8058: Silence pointer to integer size warning
  xfrm: Fix xfrm_replay_overflow_offload_esn
  userns: Don't fail follow_automount based on s_user_ns
  mtd: nand: ifc: update bufnum mask for ver >= 2.0.0
  ARM: dts: omap3-n900: Fix the audio CODEC's reset pin
  ARM: dts: am335x-pepper: Fix the audio CODEC's reset pin
  net: thunderx: Set max queue count taking XDP_TX into account
  mtd: nand: fix interpretation of NAND_CMD_NONE in nand_command[_lp]()
  net: xfrm: allow clearing socket xfrm policies.
  rtc: brcmstb-waketimer: fix error handling in brcmstb_waketmr_probe()
  net: ieee802154: adf7242: Fix bug if defined DEBUG
  test_firmware: fix setting old custom fw path back on exit
  crypto: cavium - fix memory leak on info
  crypto: ecc - Fix NULL pointer deref. on no default_rng
  sched: Stop resched_cpu() from sending IPIs to offline CPUs
  sched: Stop switched_to_rt() from sending IPIs to offline CPUs
  USB: ledtrig-usbport: fix of-node leak
  typec: tcpm: fusb302: Resolve out of order messaging events
  staging: rtl8822be: fix missing null check on dev_alloc_skb return
  drm/amdgpu: fix get_max_engine_clock_in_mhz
  ARM: dts: exynos: Correct Trats2 panel reset line
  clk: meson: gxbb: fix wrong clock for SARADC/SANA
  ARM: dts: koelsch: Move cec_clock to root node
  iwlwifi: mvm: rs: don't override the rate history in the search cycle
  HID: elo: clear BTN_LEFT mapping
  HID: multitouch: Only look at non touch fields in first packet of a frame
  video/hdmi: Allow "empty" HDMI infoframes
  dma-buf/fence: Fix lock inversion within dma-fence-array
  drm/edid: set ELD connector type in drm_edid_to_eld()
  Revert "btrfs: use proper endianness accessors for super_copy"
  dm mpath: fix passing integrity data
  earlycon: add reg-offset to physical address before mapping
  serial: core: mark port as initialized in autoconfig
  serial: 8250_pci: Add Brainboxes UC-260 4 port serial device
  usb: dwc3: Fix lock-up on ID change during system suspend/resume
  usb: gadget: f_fs: Fix use-after-free in ffs_fs_kill_sb()
  usb: usbmon: Read text within supplied buffer size
  usb: quirks: add control message delay for 1b1c:1b20
  usbip: vudc: fix null pointer dereference on udc->lock
  USB: storage: Add JMicron bridge 152d:2567 to unusual_devs.h
  staging: android: ashmem: Fix lockdep issue during llseek
  staging: comedi: fix comedi_nsamples_left.
  uas: fix comparison for error code
  tty/serial: atmel: add new version check for usart
  serial: sh-sci: prevent lockup on full TTY buffers
  xhci: fix endpoint context tracer output
  xhci: Fix front USB ports on ASUS PRIME B350M-A
  usb: host: xhci-rcar: add support for r8a77965
  ASoC: rt5651: Fix regcache sync errors on resume
  ASoC: wm_adsp: For TLV controls only register TLV get/set
  ASoC: sgtl5000: Fix suspend/resume
  ASoC: sun4i-i2s: Fix RX slot number of SUN8I
  x86: Treat R_X86_64_PLT32 as R_X86_64_PC32
  net: phy: Restore phy_resume() locking assumption
  net: phy: fix resume handling
  ANDROID: sdcardfs: fix lock issue on 32 bit/SMP architectures

Change-Id: Ida88909c333e059adf42a8794c3b92b1d15252f7
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2018-03-21 10:16:53 -07:00
Greg Kroah-Hartman
267c6efd76 Merge 4.14.28 into android-4.14
Changes in 4.14.28
	net: phy: fix resume handling
	net: phy: Restore phy_resume() locking assumption
	x86: Treat R_X86_64_PLT32 as R_X86_64_PC32
	ASoC: sun4i-i2s: Fix RX slot number of SUN8I
	ASoC: sgtl5000: Fix suspend/resume
	ASoC: wm_adsp: For TLV controls only register TLV get/set
	ASoC: rt5651: Fix regcache sync errors on resume
	usb: host: xhci-rcar: add support for r8a77965
	xhci: Fix front USB ports on ASUS PRIME B350M-A
	xhci: fix endpoint context tracer output
	serial: sh-sci: prevent lockup on full TTY buffers
	tty/serial: atmel: add new version check for usart
	uas: fix comparison for error code
	staging: comedi: fix comedi_nsamples_left.
	staging: android: ashmem: Fix lockdep issue during llseek
	USB: storage: Add JMicron bridge 152d:2567 to unusual_devs.h
	usbip: vudc: fix null pointer dereference on udc->lock
	usb: quirks: add control message delay for 1b1c:1b20
	usb: usbmon: Read text within supplied buffer size
	usb: gadget: f_fs: Fix use-after-free in ffs_fs_kill_sb()
	usb: dwc3: Fix lock-up on ID change during system suspend/resume
	serial: 8250_pci: Add Brainboxes UC-260 4 port serial device
	serial: core: mark port as initialized in autoconfig
	earlycon: add reg-offset to physical address before mapping
	dm mpath: fix passing integrity data
	Revert "btrfs: use proper endianness accessors for super_copy"
	drm/edid: set ELD connector type in drm_edid_to_eld()
	dma-buf/fence: Fix lock inversion within dma-fence-array
	video/hdmi: Allow "empty" HDMI infoframes
	HID: multitouch: Only look at non touch fields in first packet of a frame
	HID: elo: clear BTN_LEFT mapping
	iwlwifi: mvm: rs: don't override the rate history in the search cycle
	ARM: dts: koelsch: Move cec_clock to root node
	clk: meson: gxbb: fix wrong clock for SARADC/SANA
	ARM: dts: exynos: Correct Trats2 panel reset line
	drm/amdgpu: fix get_max_engine_clock_in_mhz
	staging: rtl8822be: fix missing null check on dev_alloc_skb return
	typec: tcpm: fusb302: Resolve out of order messaging events
	USB: ledtrig-usbport: fix of-node leak
	sched: Stop switched_to_rt() from sending IPIs to offline CPUs
	sched: Stop resched_cpu() from sending IPIs to offline CPUs
	crypto: ecc - Fix NULL pointer deref. on no default_rng
	crypto: cavium - fix memory leak on info
	test_firmware: fix setting old custom fw path back on exit
	net: ieee802154: adf7242: Fix bug if defined DEBUG
	rtc: brcmstb-waketimer: fix error handling in brcmstb_waketmr_probe()
	net: xfrm: allow clearing socket xfrm policies.
	mtd: nand: fix interpretation of NAND_CMD_NONE in nand_command[_lp]()
	net: thunderx: Set max queue count taking XDP_TX into account
	ARM: dts: am335x-pepper: Fix the audio CODEC's reset pin
	ARM: dts: omap3-n900: Fix the audio CODEC's reset pin
	mtd: nand: ifc: update bufnum mask for ver >= 2.0.0
	userns: Don't fail follow_automount based on s_user_ns
	xfrm: Fix xfrm_replay_overflow_offload_esn
	leds: pm8058: Silence pointer to integer size warning
	power: supply: ab8500_charger: Fix an error handling path
	power: supply: ab8500_charger: Bail out in case of error in 'ab8500_charger_init_hw_registers()'
	drm/etnaviv: make THERMAL selectable
	iio: adc: ina2xx: Shift bus voltage register to mask flag bits
	iio: health: max30102: Add power enable parameter to get_temp function
	ath10k: update tdls teardown state to target
	cpufreq: Fix governor module removal race
	drm/amdgpu:fix random missing of FLR NOTIFY
	scsi: ses: don't ask for diagnostic pages repeatedly during probe
	pwm: stmpe: Fix wrong register offset for hwpwm=2 case
	drm/sun4i: Fix format mask in DE2 driver
	pinctrl: sh-pfc: r8a7791: Add can_clk function
	pinctrl: sh-pfc: r8a7795-es1: Fix MOD_SEL1 bit[25:24] to 0x3 when using STP_ISEN_1_D
	perf annotate: Fix unnecessary memory allocation for s390x
	perf annotate: Fix objdump comment parsing for Intel mov dissassembly
	iwlwifi: mvm: avoid dumping assert log when device is stopped
	drm/amdgpu:fix virtual dce bug
	clk: qcom: msm8916: fix mnd_width for codec_digcodec
	mwifiex: cfg80211: do not change virtual interface during scan processing
	ath10k: fix invalid STS_CAP_OFFSET_MASK
	tools/usbip: fixes build with musl libc toolchain
	spi: sun6i: disable/unprepare clocks on remove
	bnxt_en: Don't print "Link speed -1 no longer supported" messages.
	scsi: core: scsi_get_device_flags_keyed(): Always return device flags
	scsi: devinfo: apply to HP XP the same flags as Hitachi VSP
	scsi: dh: add new rdac devices
	media: vsp1: Prevent suspending and resuming DRM pipelines
	dm raid: fix raid set size revalidation
	media: cpia2: Fix a couple off by one bugs
	media: davinci: vpif_capture: add NULL check on devm_kzalloc return value
	virtio_net: Disable interrupts if napi_complete_done rescheduled napi
	net: sched: drop qdisc_reset from dev_graft_qdisc
	veth: set peer GSO values
	drm/amdkfd: Fix memory leaks in kfd topology
	powerpc/modules: Don't try to restore r2 after a sibling call
	powerpc/64: Don't trace irqs-off at interrupt return to soft-disabled context
	arm64: dts: renesas: salvator-common: Add EthernetAVB PHY reset
	agp/intel: Flush all chipset writes after updating the GGTT
	mac80211_hwsim: enforce PS_MANUAL_POLL to be set after PS_ENABLED
	mac80211: remove BUG() when interface type is invalid
	crypto: caam/qi - use correct print specifier for size_t
	ASoC: nuc900: Fix a loop timeout test
	mmc: mmc_test: Ensure command queue is disabled for testing
	Fix misannotated out-of-line _copy_to_user()
	ipvlan: add L2 check for packets arriving via virtual devices
	rcutorture/configinit: Fix build directory error message
	locking/locktorture: Fix num reader/writer corner cases
	ima: relax requiring a file signature for new files with zero length
	IB/mlx5: revisit -Wmaybe-uninitialized warning
	dmaengine: qcom_hidma: check pending interrupts
	drm/i915/glk: Disable Guc and HuC on GLK
	Linux 4.14.28

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2018-03-19 09:28:29 +01:00
Danilo Krummrich
42b8dfefbb usb: quirks: add control message delay for 1b1c:1b20
commit cb88a0588717ba6c756cb5972d75766b273a6817 upstream.

Corsair Strafe RGB keyboard does not respond to usb control messages
sometimes and hence generates timeouts.

Commit de3af5bf25 ("usb: quirks: add delay init quirk for Corsair
Strafe RGB keyboard") tried to fix those timeouts by adding
USB_QUIRK_DELAY_INIT.

Unfortunately, even with this quirk timeouts of usb_control_msg()
can still be seen, but with a lower frequency (approx. 1 out of 15):

[   29.103520] usb 1-8: string descriptor 0 read error: -110
[   34.363097] usb 1-8: can't set config #1, error -110

Adding further delays to different locations where usb control
messages are issued just moves the timeouts to other locations,
e.g.:

[   35.400533] usbhid 1-8:1.0: can't add hid device: -110
[   35.401014] usbhid: probe of 1-8:1.0 failed with error -110

The only way to reliably avoid those issues is having a pause after
each usb control message. In approx. 200 boot cycles no more timeouts
were seen.

Addionaly, keep USB_QUIRK_DELAY_INIT as it turned out to be necessary
to have the delay in hub_port_connect() after hub_port_init().

The overall boot time seems not to be influenced by these additional
delays, even on fast machines and lightweight distributions.

Fixes: de3af5bf25 ("usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard")
Cc: stable@vger.kernel.org
Signed-off-by: Danilo Krummrich <danilokrummrich@dk-develop.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19 08:42:46 +01:00
Mayank Rana
42e87d6b40 USB: gsi: Use dma_get_sgtable() to update USB TRB ring and data buffer
IOVA address shall be contiguous in memory but physical address is
not guaranteed to be contiguous when USB SMMU s1 is enabled. Linux IPA
driver needs to use physical address to map it into its own context
bank if IPA SMMU s1 is enabled. Hence this change updates physical and
IOVA address related to USB TRB ring and its data buffer to Linux IPA
driver using dma_get_sgtable() API.

Change-Id: I7caef18903291e9a186dce691b64f387bf7f717e
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2018-03-15 10:40:49 -07:00
Jack Pham
a821ee4968 usb: dwc3: Add QTI MSM platform specific feature and other changes
This change adds the following QTI MSM platform specific features
to the USB DWC3 core & gadget drivers:

- BAM endpoint support
- GSI endpoint support
- low power mode / remote wakeup
- function suspend/wake
- glue layer notifications
- high speed-only fallback
- add additional debug logging

Change-Id: I0f733d05f3f88a4a734d8489b5eb548391ab3af3
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2018-03-05 15:07:46 -08:00
Ajay Agarwal
80723d03bd sound: usb: Add support for parsing AudioControl intf for BADD devices
BADD 3.0 devices support three types of topologies;
Basic I/P, Basic O/P, and BASIC I/P. Accordingly, various
units and terminals have to be parsed which are not
exposed by the device and host must be able to figure
out various class-specific descriptors based on the
profile ID of the device. This patch adds this logic
to build various units and terminals of the AudioControl
interface of a BADD device.

Change-Id: Ib52f884133cdf6e0ec95f49095c14f7d005a5356
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2018-02-15 12:25:33 -08:00
Ajay Agarwal
b9fa3f0878 sound: usb: Add support for parsing AudioStreaming intf for BADD devices
BADD(Basic Audio Device Definition) is a subset of UAC3
specifications. It defines standard profiles which provide
specific attributes of class descriptors. BADD audio device
provides profile id and BADD supporting host will infer
attributes from profile-id.

Currently USB Audio Host driver has support for UAC1
and UAC2 devices. To handle BADD 3.0 devices, AudioControl
and AudioStreaming Interfaces have to be properly parsed.
The Host has to derive all class-specific information based
on the profile ID that the device exposes. Add support for
parsing the AudioStreaming interfaces exposed by the device.

Change-Id: I726bbb735708fe8e395011c7228a73d5f65c092d
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2018-02-15 12:25:18 -08:00
Hemant Kumar
0a1c067c9e usb: Add helper API to issue stop endpoint command
This API is used to issue stop endpoint command on
requested endpoint in order to retire all active TRBs
in the transfer ring.

Change-Id: I312772367a2cd293982a66ea8b75e04a8b1f2fd0
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2018-02-15 12:18:50 -08:00
Hemant Kumar
4039b11fc4 usb: Add support to handle USB SMMU S1 address
Update helper APIs to return physical address as well as
USB SMMU stage 1 address. Physical address is used to map
it to iova for remote processor. S1 address is used by xHC.
Get sg table containing one or mode page sized physical
address corresponding to S1 address for event ring, xfer
ring and xfer buffers using dma_get_sgtable(). Accordingly
update QMI response buffer for XHCI event ring, xfer ring
memory info and xfer buffer.

Change-Id: I6c9ea39d8a87a5bdc5a760d2a1ca85ab3024d985
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2018-02-15 12:16:59 -08:00
Hemant Kumar
b6ef893216 usb: core: Remove helper APIs returning dcba dma address
Since dcba dma address is not required by class driver
therefore remove the API definitions.

Change-Id: I2623cf3bf406ca0d47ea2549b5163d9e9b7351a1
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
[mrana@codeaurora.org: squashed "usb: host: xhci: Remove helper
API retuning dcba dma address"]
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2018-02-15 12:16:30 -08:00
Linux Build Service Account
4e3173f862 Merge "usb: host: xhci: Add helper function to return controller id" 2018-02-15 01:18:34 -08:00
Linux Build Service Account
3bfb3b63fb Merge "sound: usb: Add helper APIs to enable audio stream" 2018-02-13 16:51:36 -08:00
Hemant Kumar
e35d8993aa usb: core: Add helper function to return controller id
Function provides controller id used by a remote entity
to identify which usb controller to program to initiate
data transfer.

Change-Id: Ied396f34496104c139a7910ee86844c124e6803f
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2018-02-12 17:52:48 -08:00
Hemant Kumar
2a7f1eb0c1 usb: xhci: Add helper APIs to return xhci dma addresses
dma address of secondary event ring, transfer ring and
device context base address are required to pass to
remote entity. Remote entity uses these addresses to
program xhci controller registers.

Change-Id: Ie0756d646a396a11b41b93e886bca9aff636ee5d
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2018-02-08 14:53:45 -08:00
Hemant Kumar
de3917346c usb: xhci: Add support for secondary interrupters
Implement APIs to dynamically allocate and free secondary
event rings based upon interrupter number. Also add exported
APIs in usb core layer which allows secondary event ring
management via remote processor entity.

Change-Id: I5ee7d44d6cad8e35e22d3c1a027a1eec5d208585
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2018-02-08 14:45:08 -08:00
Hemant Kumar
e91c2adac9 usb: host: Flush hub workqueue before stopping controller
when xhci platform driver is removed with a usb device
connected there is a possibility of race between xhci
platform driver remove context and device disconnect hub
event work context. This results into

use after free: xhci_mem_clean() called from xhci_plat_remove()
freeing the xhci virtual device when a structure member is
being accessed by xhci_alloc_virt_device() after virtual device
allocation as part of connect hub event.

deadlock: Upon device disconnect if stop endpoint command remains
pending xhci_mem_cleanup() frees xhci virtual device which also
frees up endpoint stop_cmd_timer. udev->dev lock is held until
cancelled urb is not given back to class driver. In a different
context xhci platform remove calls usb_disconnect() on children of
root hub which tries to acquire the same udev->dev lock this results
into a dead lock condition.

Fix issues by making sure hub events are flushed before xhci is
stopped.

Change-Id: I86d414bca17464d1dff3346ec668d8b3efec1652
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2018-02-08 11:23:01 -08:00
Hemant Kumar
e263592b6c usb: composite: Increase ep0 buffer size to 4KB
Maximum QMI packet size is 4KB. As a result with current
ep0 buffer size of 1KB driver is overstepping the buffer
memory when QMI packet of more than 1KB size is received
from usb host.

Change-Id: Id162ed23dfa855fd7e11d43b32627b577c0c2dd4
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2018-01-30 18:03:54 -08:00
Danny Segal
7cd7e29ba3 usb: gadget: add infrastructure support for super-speed function suspend
The USB 3.0 specification defines a new 'Function Suspend' feature.
This feature enables the USB host to put inactive composite device
functions in a suspended state even when the device itself is not
suspended. This patch extends the existing framework of USB gadget
to properly support the 'Function Resume' and 'Function Remote Wakeup'
related features.

Signed-off-by: Danny Segal <dsegal@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>

[jackp@codeaurora.org: also squashed the following commits
usb: gadget: Fix missing function wakeup notification sending on BAM wakeup
usb: gadget: Fix race condition between function wakeup and bus resume
usb: gadget: Resolve recursive spinlock during remote wakeup
usb: composite: don't print the invalid function wakeup failure messages
dwc3: gadget: Replace polling mechanism to go into U0 state
usb: gadget: f_mbim: Queue notification request upon function resume
USB: composite: Hold spinlock before calling usb_func_wakeup_int() API
usb: gadget: Invalidate interface id upon adding function to config
usb: gadget: Fix bug is queuing req upon function suspend ]

Change-Id: I51713eac557eabc7b465d161377c09d4b6afa152
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2018-01-30 18:03:45 -08:00
Hemant Kumar
53d5dc11af usb: gadget: Add support for usb runtime pm APIs
Add usb_gadget_autompm_get* and usb_gadget_autompm_put*
APIs. These APIs are used by function drivers to synchronize
between controller low power mode and function driver specific
tasks which require controller to be active in order to finish
them.

Change-Id: I17a48bd0d313f94e5079e31ed69bb916025c594f
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2018-01-30 18:03:34 -08:00
Jack Pham
89a954ae22 usb: pd: add snapshot of qpnp-pdphy and policy_engine drivers
The qpnp-pdphy driver provides support for the PD PHY peripheral
found on Qualcomm Technologies, Inc. PMICs. This along with
the policy engine provides a protocol stack that supports
USB Power Delivery communication over a Type-C port.

This snapshot is taken as of msm-4.9 commit 11273b09e247
("usb: phy: msm: Remove phy-msm-usb driver"). This includes one
minor fixup to remove use of the extcon mutually_exclusive
field which is no longer visible outside of drivers/extcon.

Change-Id: I0a34076dee8476494dfccfe6fc807247caab8927
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2018-01-16 22:04:03 -08:00
Jack Pham
4a5a4c6dff usb: phy: Add snapshot of QTI USB PHY drivers
This change adds USB HSUSB and USB QMP PHY drivers used
on QTI MSM platforms. This snapshot is taken as of
msm-4.9 commit 11273b09e247 ("usb: phy: msm: Remove
phy-msm-usb driver").

Change-Id: I9f349baa5878f7f2a696dc52f048ead54a831c05
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2018-01-13 10:45:54 -08:00
Greg Kroah-Hartman
5adbbb16a5 Merge 4.14.7 into android-4.14
Changes in 4.14.7
	net: qmi_wwan: add Quectel BG96 2c7c:0296
	net: thunderx: Fix TCP/UDP checksum offload for IPv6 pkts
	net: thunderx: Fix TCP/UDP checksum offload for IPv4 pkts
	net: realtek: r8169: implement set_link_ksettings()
	s390/qeth: fix early exit from error path
	tipc: fix memory leak in tipc_accept_from_sock()
	vhost: fix skb leak in handle_rx()
	rds: Fix NULL pointer dereference in __rds_rdma_map
	sit: update frag_off info
	tcp: add tcp_v4_fill_cb()/tcp_v4_restore_cb()
	packet: fix crash in fanout_demux_rollover()
	net/packet: fix a race in packet_bind() and packet_notifier()
	tcp: remove buggy call to tcp_v6_restore_cb()
	usbnet: fix alignment for frames with no ethernet header
	net: remove hlist_nulls_add_tail_rcu()
	stmmac: reset last TSO segment size after device open
	tcp/dccp: block bh before arming time_wait timer
	s390/qeth: build max size GSO skbs on L2 devices
	s390/qeth: fix thinko in IPv4 multicast address tracking
	s390/qeth: fix GSO throughput regression
	tcp: use IPCB instead of TCP_SKB_CB in inet_exact_dif_match()
	tipc: call tipc_rcv() only if bearer is up in tipc_udp_recv()
	tcp: use current time in tcp_rcv_space_adjust()
	net: sched: cbq: create block for q->link.block
	tap: free skb if flags error
	tcp: when scheduling TLP, time of RTO should account for current ACK
	tun: free skb in early errors
	net: ipv6: Fixup device for anycast routes during copy
	tun: fix rcu_read_lock imbalance in tun_build_skb
	net: accept UFO datagrams from tuntap and packet
	net: openvswitch: datapath: fix data type in queue_gso_packets
	cls_bpf: don't decrement net's refcount when offload fails
	sctp: use right member as the param of list_for_each_entry
	ipmi: Stop timers before cleaning up the module
	usb: gadget: ffs: Forbid usb_ep_alloc_request from sleeping
	fcntl: don't cap l_start and l_end values for F_GETLK64 in compat syscall
	fix kcm_clone()
	KVM: arm/arm64: vgic-its: Preserve the revious read from the pending table
	kbuild: do not call cc-option before KBUILD_CFLAGS initialization
	powerpc/powernv/idle: Round up latency and residency values
	ipvlan: fix ipv6 outbound device
	ide: ide-atapi: fix compile error with defining macro DEBUG
	blk-mq: Avoid that request queue removal can trigger list corruption
	nvmet-rdma: update queue list during ib_device removal
	audit: Allow auditd to set pid to 0 to end auditing
	audit: ensure that 'audit=1' actually enables audit for PID 1
	dm raid: fix panic when attempting to force a raid to sync
	md: free unused memory after bitmap resize
	RDMA/cxgb4: Annotate r2 and stag as __be32
	x86/intel_rdt: Fix potential deadlock during resctrl unmount
	media: dvb-core: always call invoke_release() in fe_free()
	dvb_frontend: don't use-after-free the frontend struct
	Linux 4.14.7

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2018-01-04 13:47:49 +01:00
Runmin Wang
b716d1c640 Merge remote-tracking branch 'remotes/origin/tmp-3afae84' into msm-4.14
* remotes/origin/tmp-3afae84:
  Linux 4.14.7
  dvb_frontend: don't use-after-free the frontend struct
  media: dvb-core: always call invoke_release() in fe_free()
  x86/intel_rdt: Fix potential deadlock during resctrl unmount
  RDMA/cxgb4: Annotate r2 and stag as __be32
  md: free unused memory after bitmap resize
  dm raid: fix panic when attempting to force a raid to sync
  audit: ensure that 'audit=1' actually enables audit for PID 1
  audit: Allow auditd to set pid to 0 to end auditing
  nvmet-rdma: update queue list during ib_device removal
  blk-mq: Avoid that request queue removal can trigger list corruption
  ide: ide-atapi: fix compile error with defining macro DEBUG
  ipvlan: fix ipv6 outbound device
  powerpc/powernv/idle: Round up latency and residency values
  kbuild: do not call cc-option before KBUILD_CFLAGS initialization
  KVM: arm/arm64: vgic-its: Preserve the revious read from the pending table
  fix kcm_clone()
  fcntl: don't cap l_start and l_end values for F_GETLK64 in compat syscall
  usb: gadget: ffs: Forbid usb_ep_alloc_request from sleeping
  ipmi: Stop timers before cleaning up the module
  sctp: use right member as the param of list_for_each_entry
  cls_bpf: don't decrement net's refcount when offload fails
  net: openvswitch: datapath: fix data type in queue_gso_packets
  net: accept UFO datagrams from tuntap and packet
  tun: fix rcu_read_lock imbalance in tun_build_skb
  net: ipv6: Fixup device for anycast routes during copy
  tun: free skb in early errors
  tcp: when scheduling TLP, time of RTO should account for current ACK
  tap: free skb if flags error
  net: sched: cbq: create block for q->link.block
  tcp: use current time in tcp_rcv_space_adjust()
  tipc: call tipc_rcv() only if bearer is up in tipc_udp_recv()
  tcp: use IPCB instead of TCP_SKB_CB in inet_exact_dif_match()
  s390/qeth: fix GSO throughput regression
  s390/qeth: fix thinko in IPv4 multicast address tracking
  s390/qeth: build max size GSO skbs on L2 devices
  tcp/dccp: block bh before arming time_wait timer
  stmmac: reset last TSO segment size after device open
  net: remove hlist_nulls_add_tail_rcu()
  usbnet: fix alignment for frames with no ethernet header
  tcp: remove buggy call to tcp_v6_restore_cb()
  net/packet: fix a race in packet_bind() and packet_notifier()
  packet: fix crash in fanout_demux_rollover()
  tcp: add tcp_v4_fill_cb()/tcp_v4_restore_cb()
  sit: update frag_off info
  rds: Fix NULL pointer dereference in __rds_rdma_map
  vhost: fix skb leak in handle_rx()
  tipc: fix memory leak in tipc_accept_from_sock()
  s390/qeth: fix early exit from error path
  net: realtek: r8169: implement set_link_ksettings()
  net: thunderx: Fix TCP/UDP checksum offload for IPv4 pkts
  net: thunderx: Fix TCP/UDP checksum offload for IPv6 pkts
  net: qmi_wwan: add Quectel BG96 2c7c:0296
  Linux 4.14.6
  afs: Connect up the CB.ProbeUuid
  afs: Fix total-length calculation for multiple-page send
  IB/mlx5: Assign send CQ and recv CQ of UMR QP
  IB/mlx4: Increase maximal message size under UD QP
  bnxt_re: changing the ip address shouldn't affect new connections
  f2fs: fix to clear FI_NO_PREALLOC
  xfrm: Copy policy family in clone_policy
  tls: Use kzalloc for aead_request allocation
  jump_label: Invoke jump_label_test() via early_initcall()
  atm: horizon: Fix irq release error
  kbuild: rpm-pkg: fix jobserver unavailable warning
  mailbox: mailbox-test: don't rely on rx_buffer content to signal data ready
  clk: hi3660: fix incorrect uart3 clock freqency
  clk: uniphier: fix DAPLL2 clock rate of Pro5
  clk: qcom: common: fix legacy board-clock registration
  clk: sunxi-ng: a83t: Fix i2c buses bits
  clk: stm32h7: fix test of clock config
  bpf: fix lockdep splat
  geneve: fix fill_info when link down
  fcntl: don't leak fd reference when fixup_compat_flock fails
  sctp: use the right sk after waking up from wait_buf sleep
  sctp: do not free asoc when it is already dead in sctp_sendmsg
  slub: fix sysfs duplicate filename creation when slub_debug=O
  zsmalloc: calling zs_map_object() from irq is a bug
  sparc64/mm: set fields in deferred pages
  block: wake up all tasks blocked in get_request()
  dt-bindings: usb: fix reg-property port-number range
  xfs: fix forgotten rcu read unlock when skipping inode reclaim
  nfp: fix flower offload metadata flag usage
  nfp: inherit the max_mtu from the PF netdev
  sunrpc: Fix rpc_task_begin trace point
  NFS: Fix a typo in nfs_rename()
  dynamic-debug-howto: fix optional/omitted ending line number to be LARGE instead of 0
  lib/genalloc.c: make the avail variable an atomic_long_t
  pipe: match pipe_max_size data type with procfs
  drivers/rapidio/devices/rio_mport_cdev.c: fix resource leak in error handling path in 'rio_dma_transfer()'
  rsi: fix memory leak on buf and usb_reg_buf
  route: update fnhe_expires for redirect when the fnhe exists
  route: also update fnhe_genid when updating a route cache
  gre6: use log_ecn_error module parameter in ip6_tnl_rcv()
  mac80211_hwsim: Fix memory leak in hwsim_new_radio_nl()
  x86/mpx/selftests: Fix up weird arrays
  apparmor: fix leak of null profile name if profile allocation fails
  powerpc/perf: Fix pmu_count to count only nest imc pmus
  coccinelle: fix parallel build with CHECK=scripts/coccicheck
  kbuild: pkg: use --transform option to prefix paths in tar
  net/smc: use sk_rcvbuf as start for rmb creation
  irqchip/qcom: Fix u32 comparison with value less than zero
  ARM: avoid faulting on qemu
  ARM: BUG if jumping to usermode address in kernel mode
  crypto: talitos - fix ctr-aes-talitos
  crypto: talitos - fix use of sg_link_tbl_len
  crypto: talitos - fix AEAD for sha224 on non sha224 capable chips
  crypto: talitos - fix setkey to check key weakness
  crypto: talitos - fix memory corruption on SEC2
  crypto: talitos - fix AEAD test failures
  IB/core: Only enforce security for InfiniBand
  IB/core: Avoid unnecessary return value check
  bus: arm-ccn: fix module unloading Error: Removing state 147 which has instances left.
  bus: arm-ccn: Fix use of smp_processor_id() in preemptible context
  bus: arm-ccn: Check memory allocation failure
  bus: arm-cci: Fix use of smp_processor_id() in preemptible context
  Revert "ARM: dts: imx53: add srtc node"
  arm64: SW PAN: Update saved ttbr0 value on enter_lazy_tlb
  arm64: SW PAN: Point saved ttbr0 at the zero page when switching to init_mm
  arm64: fpsimd: Prevent registers leaking from dead tasks
  KVM: arm/arm64: vgic-its: Check result of allocation before use
  KVM: arm/arm64: vgic: Preserve the revious read from the pending table
  KVM: arm/arm64: vgic-irqfd: Fix MSI entry allocation
  KVM: arm/arm64: Fix broken GICH_ELRSR big endian conversion
  KVM: VMX: remove I/O port 0x80 bypass on Intel hosts
  arm: KVM: Fix VTTBR_BADDR_MASK BUG_ON off-by-one
  arm64: KVM: fix VTTBR_BADDR_MASK BUG_ON off-by-one
  media: rc: partial revert of "media: rc: per-protocol repeat period"
  media: rc: sir_ir: detect presence of port
  media: dvb: i2c transfers over usb cannot be done from stack
  drm/i915: Fix vblank timestamp/frame counter jumps on gen2
  drm/exynos: gem: Drop NONCONTIG flag for buffers allocated without IOMMU
  drm/bridge: analogix dp: Fix runtime PM state in get_modes() callback
  md/r5cache: move mddev_lock() out of r5c_journal_mode_set()
  kdb: Fix handling of kallsyms_symbol_next() return value
  brcmfmac: change driver unbind order of the sdio function devices
  iwlwifi: mvm: enable RX offloading with TKIP and WEP
  iwlwifi: mvm: fix packet injection
  iwlwifi: add new cards for 9260 and 22000 series
  iwlwifi: mvm: flush queue before deleting ROC
  iwlwifi: mvm: don't use transmit queue hang detection when it is not possible
  iwlwifi: mvm: mark MIC stripped MPDUs
  powerpc/64s: Initialize ISAv3 MMU registers before setting partition table
  Revert "powerpc: Do not call ppc_md.panic in fadump panic notifier"
  KVM: s390: Fix skey emulation permission check
  s390: fix compat system call table
  s390/mm: fix off-by-one bug in 5-level page table handling
  s390: always save and restore all registers on context switch
  smp/hotplug: Move step CPUHP_AP_SMPCFD_DYING to the correct place
  iommu/vt-d: Fix scatterlist offset handling
  ALSA: usb-audio: Add check return value for usb_string()
  ALSA: usb-audio: Fix out-of-bound error
  ALSA: seq: Remove spurious WARN_ON() at timer check
  ALSA: pcm: prevent UAF in snd_pcm_info
  ALSA: hda/realtek - New codec support for ALC257
  btrfs: handle errors while updating refcounts in update_ref_for_cow
  btrfs: fix missing error return in btrfs_drop_snapshot
  KVM: x86: fix APIC page invalidation
  x86/PCI: Make broadcom_postcore_init() check acpi_disabled
  x86/idt: Load idt early in start_secondary
  X.509: fix comparisons of ->pkey_algo
  X.509: reject invalid BIT STRING for subjectPublicKey
  KEYS: reject NULL restriction string when type is specified
  KEYS: add missing permission check for request_key() destination
  ASN.1: check for error from ASN1_OP_END__ACT actions
  ASN.1: fix out-of-bounds read when parsing indefinite length item
  efi/esrt: Use memunmap() instead of kfree() to free the remapping
  efi: Move some sysfs files to be read-only by root
  scsi: libsas: align sata_device's rps_resp on a cacheline
  scsi: use dma_get_cache_alignment() as minimum DMA alignment
  scsi: dma-mapping: always provide dma_get_cache_alignment
  isa: Prevent NULL dereference in isa_bus driver callbacks
  firmware: vpd: Fix platform driver and device registration/unregistration
  firmware: vpd: Tie firmware kobject to device lifetime
  firmware: vpd: Destroy vpd sections in remove function
  firmware: cleanup FIRMWARE_IN_KERNEL message
  hv: kvp: Avoid reading past allocated blocks from KVP file
  Drivers: hv: vmbus: Fix a rescind issue
  pinctrl: armada-37xx: Fix direction_output() callback behavior
  iio: adc: meson-saradc: Meson8 and Meson8b do not have REG11 and REG13
  iio: adc: meson-saradc: initialize the bandgap correctly on older SoCs
  iio: adc: meson-saradc: fix the bit_idx of the adc_en clock
  iio: adc: cpcap: fix incorrect validation
  iio: health: max30102: Temperature should be in milli Celsius
  iio: stm32: fix adc/trigger link error
  virtio: release virtio index when fail to device_register
  can: peak/pcie_fd: fix potential bug in restarting tx queue
  can: usb_8dev: cancel urb on -EPIPE and -EPROTO
  can: esd_usb2: cancel urb on -EPIPE and -EPROTO
  can: ems_usb: cancel urb on -EPIPE and -EPROTO
  can: mcba_usb: cancel urb on -EPROTO
  can: kvaser_usb: cancel urb on -EPIPE and -EPROTO
  can: kvaser_usb: ratelimit errors if incomplete messages are received
  can: kvaser_usb: Fix comparison bug in kvaser_usb_read_bulk_callback()
  can: kvaser_usb: free buf in error paths
  can: ti_hecc: Fix napi poll return value for repoll
  can: flexcan: fix VF610 state transition issue
  can: peak/pci: fix potential bug when probe() fails
  can: mcba_usb: fix device disconnect bug
  usb: f_fs: Force Reserved1=1 in OS_DESC_EXT_COMPAT
  serdev: ttyport: fix tty locking in close
  serdev: ttyport: fix NULL-deref on hangup
  serdev: ttyport: add missing receive_buf sanity checks
  usb: gadget: core: Fix ->udc_set_speed() speed handling
  usb: gadget: udc: renesas_usb3: fix number of the pipes

Change-Id: I47977dc6948f8e5edbcd21770a63242e86adcb3b
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2017-12-19 11:13:17 -08:00
Badhri Jagan Sridharan
236a33857f ANDROID: usb: gadget: configfs: Add usb_function ptr to fi struct
Add a pointer to the usb_function inside the
usb_function_instance structure to service
functions specific setup requests even before
the function gets added to the usb_gadget

Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Change-Id: I6f457006f6c5516cc6986ec2acdf5b1ecf259d0c
2017-12-18 21:11:22 +05:30
Colin Cross
6e22d1ab6d ANDROID: usb: gadget: f_accessory: move userspace interface to uapi
Move the entire contents of linux/usb/f_accessory.h header to uapi,
it only contains a userspace interface.

Change-Id: Ieb5547da449588ae554988a201c0e6b4e3afc531
Signed-off-by: Colin Cross <ccross@android.com>
2017-12-18 21:11:22 +05:30
Mike Lockwood
663e417341 ANDROID: usb: gadget: f_accessory: Add support for HID input devices
Change-Id: I4f1452db32508382df52acdc47c0eb395ae328c7
Signed-off-by: Mike Lockwood <lockwood@google.com>

[AmitP: Folded following android-4.9 commit changes into this patch
        4ce5e656ae74 ("ANDROID: usb: gadget: accessory: Fix section mismatch (again)")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2017-12-18 21:11:22 +05:30
Mike Lockwood
6bfa422c23 ANDROID: usb: gadget: f_accessory: Add ACCESSORY_SET_AUDIO_MODE control request and ioctl
The control request will be used by the host to enable/disable USB audio
and the ioctl will be used by userspace to read the audio mode

Change-Id: I81c38611b588451e80eacdccc417ca6e11c60cab
Signed-off-by: Mike Lockwood <lockwood@google.com>
2017-12-18 21:11:22 +05:30
Benoit Goby
0e8f47b894 ANDROID: usb: gadget: f_accessory: Add Android Accessory function
USB accessory mode allows users to connect USB host hardware
specifically designed for Android-powered devices. The accessories
must adhere to the Android accessory protocol outlined in the
http://accessories.android.com documentation. This allows
Android devices that cannot act as a USB host to still interact with
USB hardware. When an Android device is in USB accessory mode, the
attached Android USB accessory acts as the host, provides power
to the USB bus, and enumerates connected devices.

Change-Id: I67964b50d278f3c0471d47efbb7b0973a3502681
Signed-off-by: Mike Lockwood <lockwood@android.com>

[AmitP: Folded following android-4.9 commit changes into this patch
        ceb2f0aac624 ("ANDROID: usb: gadget: accessory: Fix section mismatch")
        Parts of e27543931009 ("ANDROID: usb: gadget: Fixes and hacks to make android usb gadget compile on 3.8")
        1b07ec751563 ("ANDROID: drivers: usb: gadget: 64-bit related type fixes")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2017-12-18 21:11:22 +05:30
Badhri Jagan Sridharan
ea562f8e63 ANDROID: usb: phy: Dual role sysfs class definition
This CL adds a new class to monitor and change
dual role usb ports from userspace. The usb
phy drivers can register to the dual_role_usb
class and expose the capabilities of the ports.
The phy drivers can decide on whether a specific
attribute can be changed from userspace by
choosing to implement the appropriate callback.

Cherry-picked from
https://android-review.googlesource.com/#/c/167310/

Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Bug: 21615151
Change-Id: Id1c4aaa97e898264d7006381a7badd029b5d9789

[AmitP: Folded following android-4.9 commit changes into this patch
        9a9b1687f974 ("ANDROID: usb: phy: fix dual role sysfs build if kernel modules are supported")
        35667e6f7d57 ("ANDROID: usb: dual-role: make stub functions inline")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2017-12-18 21:11:22 +05:30
Bjørn Mork
bea712a8a5 usbnet: fix alignment for frames with no ethernet header
[ Upstream commit a4abd7a80addb4a9547f7dfc7812566b60ec505c ]

The qmi_wwan minidriver support a 'raw-ip' mode where frames are
received without any ethernet header. This causes alignment issues
because the skbs allocated by usbnet are "IP aligned".

Fix by allowing minidrivers to disable the additional alignment
offset. This is implemented using a per-device flag, since the same
minidriver also supports 'ethernet' mode.

Fixes: 32f7adf633 ("net: qmi_wwan: support "raw IP" mode")
Reported-and-tested-by: Jay Foster <jay@systech.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-17 15:07:56 +01:00
Jack Pham
f5a9357087 usb: gadget: Add snapshot of CCID function driver
This USB CCID function driver will be a transport layer between
the userspace CCID component and the Windows Host. Data and control
commands from the Windows Host will be sent to the userspace
component and vice-versa.

This snapshot is taken as of commit 4f7918fd623f ("usb: f_gsi: Use
required RNDIS IAD descriptors with full speed descriptors").

Registering a misc device is discouraged, particularly when
MISC_DYNAMIC_MINOR is used as there are a limited (64) number
of dynamic minors available and can quickly exhaust. Convert
f_ccid's usage to struct cdev instead and also fix other trivial
checkpatch warnings.

Change-Id: Ie5eeda1550ac30cac47fd3799021598eac550652
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2017-12-13 10:02:37 -08:00