Commit graph

604332 commits

Author SHA1 Message Date
Linux Build Service Account
c05d4dd4e2 Merge "defconfig: msm: gvm: disable SWAP for LA Guest" 2019-01-08 13:42:49 -08:00
Felipe F. Tonello
66823b1c83 usb: gadget: f_hid: use alloc_ep_req()
Use gadget's framework allocation function instead of directly calling
usb_ep_alloc_request().

Change-Id: I247b0d325f553a1cb363f35def2b1aa4c0385dd0
Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: ba1582f22231821c57534e87b077d84adbc15dbd
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-08 07:53:03 -08:00
E V Ravi
3e21f40771 msm: ais: ispif: Fix invalid type conversion
Due to improper type conversion compilation
issue will be seen. Made change to access the
appropriate type.

Change-Id: I54777fe71a2f29297b439ac26f80b9684222d89a
Signed-off-by: E V Ravi <evenka@codeaurora.org>
2019-01-08 21:11:16 +05:30
Rajasekaran Kalidoss
72c6bb7c2b cnss2: Add cal duration in host capability request
Add cal duration in host capability request as host needs to support
best effort cold calibration.

Change-Id: I2bb162da4db2c72efb7866b665cff2cb5a4863a5
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-01-08 20:27:53 +05:30
Linux Build Service Account
fb8e1d61a2 Merge "drm/msm/sde: support to control layer mixer usage" 2019-01-08 06:06:39 -08:00
Linux Build Service Account
07251f160a Merge "cnss2: Add support for bin format bdf file" 2019-01-08 06:06:38 -08:00
Linux Build Service Account
a79f75f2eb Merge "cfg80211: Updated nl80211_commands to be in sync with upstream" 2019-01-08 06:06:37 -08:00
Linux Build Service Account
97509373bc Merge "drm: msm: sde: kernel needs to monitor bootloader's flush done" 2019-01-08 06:06:36 -08:00
Mohammed Nayeem Ur Rahman
9de27e66a6 msm: adsprpc: Fix memory out of bounds error
Fixes memory out of bound error.

Change-Id: I9cc11b5231ba3654588eadf7a7adca68aff35684
Signed-off-by: Mohammed Nayeem Ur Rahman <mohara@codeaurora.org>
2019-01-08 04:48:11 -08:00
Srinivasarao P
ba3c01d4a2 iommu/iommu-debug: fix buffer overflows in debugfs read functions
The kernel buffer 'ubuf' can overflow while copying data to user
space in debugfs read functions. Fix it by limiting the length of
data to be copied to userspace.

Change-Id: Ibb3d8c4fb637ddc0e63677ec2dff14a4cf8c0c73
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-01-08 02:31:45 -08:00
Srinivas Dasari
cb51fb6ba3 nl80211: Allow SAE Authentication for NL80211_CMD_CONNECT
This commit allows SAE Authentication for NL80211_CMD_CONNECT
interface, provided host driver advertises the support.

Host drivers may offload the SAE authentication to user space
through NL80211_CMD_EXTERNAL_AUTH interface and thus expect
the user space to advertise support to handle offload through
NL80211_ATTR_EXTERNAL_AUTH_SUPPORT in NL80211_CMD_CONNECT
request. Such drivers should reject the connect request on no
offload support from user space.

Signed-off-by: Srinivas Dasari <dasaris@qti.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: 10773a7c09b327d02144c7d181e6544b7015ffc7
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
CRs-Fixed: 2182553
Change-Id: I41b49228e88b32a35323c4dc8fa98e507a8a971d
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-08 15:51:22 +08:00
Srinivas Dasari
d7c122d223 nl80211: Free connkeys on external authentication failure
The failure scenario while processing
NL80211_ATTR_EXTERNAL_AUTH_SUPPORT does not free
the connkeys. This commit addresses the same.

Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: 2f0605a697f4b9f5b1c1571c7ec6a16df4dc2616
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Change-Id: I7aee3db35f617df9f652184a084941e42cf539c7
CRs-Fixed: 2375721
Signed-off-by: Liangwei Dong <liangwei@codeaurora.org>
Signed-off-by: Min Liu <minliu@codeaurora.org>
2019-01-08 15:48:17 +08:00
Srinivas Dasari
30467c7507 cfg80211/nl80211: Optional authentication offload to userspace
This interface allows the host driver to offload the authentication to
user space. This is exclusively defined for host drivers that do not
define separate commands for authentication and association, but rely on
userspace SME (e.g., in wpa_supplicant for the ~WPA_DRIVER_FLAGS_SME
case) for the authentication to happen. This can be used to implement
SAE without full implementation in the kernel/firmware while still being
able to use NL80211_CMD_CONNECT with driver-based BSS selection.

Host driver sends NL80211_CMD_EXTERNAL_AUTH event to start/abort
authentication to the port on which connect is triggered and status
of authentication is further indicated by user space to host
driver through the same command response interface.

User space entities advertise this capability through the
NL80211_ATTR_EXTERNAL_AUTH_SUPP flag in the NL80211_CMD_CONNECT request.
Host drivers shall look at this capability to offload the authentication.

Signed-off-by: Srinivas Dasari <dasaris@qti.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
[add socket connection ownership check]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: 40cbfa90218bc570a7959b436b9d48a18c361041
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
CRs-Fixed: 2182553
Change-Id: Id925dd82d9a9c719b32aac2de75b6ad001f1a958
[dasaris@codeaurora.org: merging with msm-specific changes]
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-08 15:33:03 +08:00
Venkata Rao Kakani
3e0203a3f5 defconfig: msm: gvm: disable SWAP for LA Guest
Remove CONFIG_SWAP and its dependency for LA Guest
to avoid extra logging on memory pressure.

Change-Id: I6843bde1867aaf20db2fda5bb7ad640dc0ec7c7c
Signed-off-by: Venkata Rao Kakani <vkakani@codeaurora.org>
2019-01-07 22:48:52 -08:00
Jayachandran Sreekumaran
2bf8ef1af3 cnss2: Add cnss usb API to check the target status
Add new cnss usb API to check to check whether the target
is up or down. Remove invoking pld_remove callback function
in usb disconnect.

Change-Id: I0e873737a27f9941db1dae54636ef55ba4d05288
Signed-off-by: Jayachandran Sreekumaran <jsreekum@codeaurora.org>
2019-01-08 11:54:01 +05:30
Jayachandran Sreekumaran
1030466da5 cnss2: Add support for bin format bdf file
As genoa supports bdf file only in bin format, add support for the same.

Change-Id: I55db0480a259379c4ee2dac76f587d3fdf497090
Signed-off-by: Jayachandran Sreekumaran <jsreekum@codeaurora.org>
2019-01-08 10:44:05 +05:30
Darshan Kumsi Srinivasa
5ac717112b msm: vidc: ignore processing responses in invalid state
No need to process response messages from video hardware
after device went into invalid state. Processing responses
may result in use-after-free memory fault because client
might free all the resources after error.

Change-Id: I3bfb26e5aa52aba33b7b62cda7820dcbc5fe033f
Signed-off-by: Darshan Kumsi Srinivasa <darssr@codeaurora.org>
2019-01-06 23:03:07 -08:00
Srinivas Dasari
38476b581e cfg80211: Updated nl80211_commands to be in sync with upstream
Update nl80211_commands to be in sync with upstream.
This is needed to add new commands.

Change-Id: Ib6b71e3f66560b035377c7bc0c115490b04f5c4f
CRs-Fixed: 2182553
Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org>
2019-01-04 14:59:11 +08:00
Linux Build Service Account
8e1e1a68b5 Merge "usb: gadget: f_hid: use free_ep_req()" 2019-01-03 07:43:38 -08:00
Linux Build Service Account
c9c3923eb4 Merge "Merge android-4.4.169 (dfca92b) into msm-4.4" 2019-01-03 07:43:35 -08:00
Linux Build Service Account
f6f86a701c Merge "msm: early_domain: return directly if early domain disabled" 2019-01-02 22:29:03 -08:00
Felipe F. Tonello
bd63c75aa4 usb: gadget: f_hid: use free_ep_req()
We should always use free_ep_req() when allocating requests with
alloc_ep_req().

Change-Id: Ifa23bf08baf00eb6a1516726de7655901a532cdc
Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 14794d7133d0f16b4901207a489f04e4e700166a
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-02 20:42:24 -08:00
Linux Build Service Account
d7d90ad099 Merge "usb: gadget: f_hid: add dev to configfs" 2019-01-02 14:29:14 -08:00
Linux Build Service Account
dfc6e6a8ab Merge "dwc3: gadget: Take copy of dwc->gadget_driver before releasing lock" 2019-01-02 05:43:27 -08:00
Ajay Agarwal
82cf88b5b8 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: Icead0b5f37b822e08f1c0714e62b275db60174a3
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-01-01 20:42:23 -08:00
Linux Build Service Account
37481e48e5 Merge "Revert "rtc: alarm: Add power-on alarm feature"" 2019-01-01 07:05:39 -08:00
Linux Build Service Account
ed4ee6a29b Merge "msm: ais: Update request from kernel to lk" 2019-01-01 07:05:38 -08:00
Linux Build Service Account
b55df81c1b Merge "usb: diag_ipc_bridge: Fix kref_put handling in case of transfers" 2018-12-30 19:52:40 -08:00
Linux Build Service Account
b9e4e9fecc Merge "defconfig: msm: Enable earlydomain handoff support" 2018-12-29 20:51:35 -08:00
Linux Build Service Account
252c2feee7 Merge "usb: gadget: f_uac1: Add support for UAC1 function" 2018-12-29 20:51:26 -08:00
Mao Jinlong
5e0025e766 Revert "rtc: alarm: Add power-on alarm feature"
This reverts commit 2e1a4aefef66db901f9a906b79e30187f10dbecb.

Power off alarm is not set via alarmtimer now. Remove the changes
of power off alarm's previous design.

Change-Id: I0f60bec0d94c93c4f2a89ae86a1b0a0d04aa9e48
Signed-off-by: Mao Jinlong <jinlmao@codeaurora.org>
2018-12-27 18:22:40 +05:30
Andy Sun
ba1897c15b msm: early_domain: return directly if early domain disabled
If early_domain_enabled is false, ed_core_data won't be allocated memory,
accessing early_domain_request will cause kernel Oops.

Change-Id: I8a64c574141a7647e699710b566cc5997d372478
Signed-off-by: Andy Sun <bins@codeaurora.org>
2018-12-27 15:32:41 +08:00
Felipe F. Tonello
556e8bd7bb usb: gadget: remove useless parameter in alloc_ep_req()
The default_length parameter of alloc_ep_req was not really necessary
and gadget drivers would almost always create an inline function to pass
the same value to len and default_len.

This patch removes that parameter and updates all calls to alloc_ep_req() to
use the new API.

Change-Id: Idfe0e0fde8faf5f713a8368d29a4bd155208ffa2
Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: aadbe812463f8af1751debb0eaaeec8a778d7ff1
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[ajaya@codeaurora.org: fix merge conflicts]
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2018-12-27 12:01:50 +05:30
Johannes Berg
9b20776b05 usb: gadget: f_hid: add dev to configfs
Even if the /dev/hidg* chardev is automatically created, one
has to guess which one belongs to which function. In the case
of multiple HID functions, or maybe even multiple peripherals,
this becomes difficult.

Add the dev (with major and minor number) to configfs to allow
looking up (or even creating) the right device node for each
function. This file is read-only.

Change-Id: If11a531a4b65cbcfb5c5456712c5f965fd4eb4c2
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: ed6fe1f50f0c0fdea674dfa739af50011034bdfa
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2018-12-27 11:32:24 +05:30
Linux Build Service Account
86bc01ea1b Merge "usb: gadget: u_audio: Check return value from config_ep_by_speed()" 2018-12-26 02:52:51 -08:00
Linux Build Service Account
f1af8c5dc7 Merge "usb: gadget: u_audio: protect stream runtime fields with stream spinlock" 2018-12-26 02:52:50 -08:00
Linux Build Service Account
391be96e91 Merge "usb: gadget: u_audio: remove caching of stream buffer parameters" 2018-12-26 02:52:46 -08:00
Ajay Agarwal
45fbfdcafb usb: diag_ipc_bridge: Fix kref_put handling in case of transfers
Currently the driver puts kref in the read/write completion
callback irrespective of whether the transaction was successful
or not. This is fine for diag transfers because the read/write
function is not waiting for completion.
But in case of IPC transfers, the read/write function waits for
completion. If the transfer fails for some reason, then it will
do a kref_put as well, along with the completion callback. This
leads to double put of kref counter leading to null pointer
dereference from diag_bridge_disconnect(on cable disconnect).
Fix this by doing kref_put in the completion callback only if the
URB is submitted successfully. Else do it from the error handling
in read/write functions.

Change-Id: I50645cac757293dd0b1df9afb356281b2922401b
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2018-12-26 16:00:07 +05:30
Vivek Kumar
74746264e5 defconfig: msm: Enable earlydomain handoff support
Enable early domain handoff support for msm-auto
perf defconfig

Change-Id: I4364928a05299367906996d01782ea7fced099ba
Signed-off-by: Vivek Kumar <vivekuma@codeaurora.org>
2018-12-24 03:50:28 -08:00
Srinivasarao P
52be7fe1fa Merge android-4.4.169 (dfca92b) into msm-4.4
* refs/heads/tmp-dfca92b
  Linux 4.4.169
  ALSA: isa/wavefront: prevent some out of bound writes
  rtc: snvs: Add timeouts to avoid kernel lockups
  rtc: snvs: add a missing write sync
  i2c: scmi: Fix probe error on devices with an empty SMB0001 ACPI device node
  i2c: axxia: properly handle master timeout
  cifs: In Kconfig CONFIG_CIFS_POSIX needs depends on legacy (insecure cifs)
  ARM: 8814/1: mm: improve/fix ARM v7_dma_inv_range() unaligned address handling
  mv88e6060: disable hardware level MAC learning
  libata: whitelist all SAMSUNG MZ7KM* solid-state disks
  Input: omap-keypad - fix keyboard debounce configuration
  clk: mmp: Off by one in mmp_clk_add()
  ide: pmac: add of_node_put()
  drivers/tty: add missing of_node_put()
  drivers/sbus/char: add of_node_put()
  sbus: char: add of_node_put()
  SUNRPC: Fix a potential race in xprt_connect()
  bonding: fix 802.3ad state sent to partner when unbinding slave
  ARC: io.h: Implement reads{x}()/writes{x}()
  drm/msm: Grab a vblank reference when waiting for commit_done
  x86/earlyprintk/efi: Fix infinite loop on some screen widths
  scsi: vmw_pscsi: Rearrange code to avoid multiple calls to free_irq during unload
  scsi: libiscsi: Fix NULL pointer dereference in iscsi_eh_session_reset
  mac80211_hwsim: fix module init error paths for netlink
  mac80211: Fix condition validating WMM IE
  mac80211: don't WARN on bad WMM parameters from buggy APs
  f2fs: fix a panic caused by NULL flush_cmd_control
  Revert "drm/rockchip: Allow driver to be shutdown on reboot/kexec"
  powerpc/msi: Fix NULL pointer access in teardown code
  tracing: Fix memory leak of instance function hash filters
  tracing: Fix memory leak in set_trigger_filter()
  MMC: OMAP: fix broken MMC on OMAP15XX/OMAP5910/OMAP310
  aio: fix spectre gadget in lookup_ioctx
  pinctrl: sunxi: a83t: Fix IRQ offset typo for PH11
  powerpc/boot: Fix random libfdt related build errors
  timer/debug: Change /proc/timer_list from 0444 to 0400
  lib/interval_tree_test.c: allow users to limit scope of endpoint
  lib/rbtree-test: lower default params
  lib/rbtree_test.c: make input module parameters
  lib/interval_tree_test.c: allow full tree search
  lib/interval_tree_test.c: make test options module parameters
  ANDROID: Revert fs/squashfs back to linux-4.4.y

Conflicts:
	drivers/gpu/drm/msm/msm_atomic.c

Change-Id: Iecec05c300fb06c0bcdd44a797795e854ea0d0fd
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2018-12-24 12:23:20 +05:30
Greg Kroah-Hartman
dfca92bab2 This is the 4.4.169 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlwc5iIACgkQONu9yGCS
 aT4Kdg//Xy9eokX2hEZClTe9tuLtA4o6gSxbgx2R0Td+vhGoR4Wf8ve+nlpmQrMx
 TBcdTkCjKO2LIC8sz2aPeOKUTOoApxITfC9fkMjdrBXJkQF4xLC3vIpDajRXB7vM
 kHpO/Co9aVQbPiRp06NCQtOmY6RT0kCgpVSvmcgtf0++IeNeksIstSONarFdpUZX
 MpfuSrCeajRe15WzoZkXAMD9gWknls9iAXF9Ka8kaC5huypkX9NpPjpBUXmWNWul
 yIxLV2Ex/dyFjhRJF7K0nilN9XjRRSUMCg4VrI/4A23f3jrxOHHRDpNnKOPWnraZ
 3jn+4EgGEX+4Bq9OTQyG45vOHD8sIGWHJDtUQtqFSPidxvMKeNYYYIUy8DYXeo5x
 oZATvFcuogA9UNQJOXQbq7Br8BK1fzxtAuIDgGHf5OTYq9sOzRJfDirFKOWsMjQJ
 jKAQuLehwP08moVq2YFKhrFHLi0YjBvrzkbVLdale0ECKnKkowixFQJmEcXI5PGy
 DtF0Z4JvPIxnBFm/EAeCEMemRCDtgWDkmKrPPiqebyKc6Q27PS/dyjea1ASek2tY
 GyOt+pmLqPO7JotH+B3ON+bs6yo/id5yRvySB9Z9CI7ern+COR/UP0ALe7zvtprp
 81rLa0+0wG5vMhmH0496RaR0xZ0YkNRc5DzHsN0nYuAdpdKeQ1k=
 =HEpx
 -----END PGP SIGNATURE-----

Merge 4.4.169 into android-4.4

Changes in 4.4.169
	lib/interval_tree_test.c: make test options module parameters
	lib/interval_tree_test.c: allow full tree search
	lib/rbtree_test.c: make input module parameters
	lib/rbtree-test: lower default params
	lib/interval_tree_test.c: allow users to limit scope of endpoint
	timer/debug: Change /proc/timer_list from 0444 to 0400
	powerpc/boot: Fix random libfdt related build errors
	pinctrl: sunxi: a83t: Fix IRQ offset typo for PH11
	aio: fix spectre gadget in lookup_ioctx
	MMC: OMAP: fix broken MMC on OMAP15XX/OMAP5910/OMAP310
	tracing: Fix memory leak in set_trigger_filter()
	tracing: Fix memory leak of instance function hash filters
	powerpc/msi: Fix NULL pointer access in teardown code
	Revert "drm/rockchip: Allow driver to be shutdown on reboot/kexec"
	f2fs: fix a panic caused by NULL flush_cmd_control
	mac80211: don't WARN on bad WMM parameters from buggy APs
	mac80211: Fix condition validating WMM IE
	mac80211_hwsim: fix module init error paths for netlink
	scsi: libiscsi: Fix NULL pointer dereference in iscsi_eh_session_reset
	scsi: vmw_pscsi: Rearrange code to avoid multiple calls to free_irq during unload
	x86/earlyprintk/efi: Fix infinite loop on some screen widths
	drm/msm: Grab a vblank reference when waiting for commit_done
	ARC: io.h: Implement reads{x}()/writes{x}()
	bonding: fix 802.3ad state sent to partner when unbinding slave
	SUNRPC: Fix a potential race in xprt_connect()
	sbus: char: add of_node_put()
	drivers/sbus/char: add of_node_put()
	drivers/tty: add missing of_node_put()
	ide: pmac: add of_node_put()
	clk: mmp: Off by one in mmp_clk_add()
	Input: omap-keypad - fix keyboard debounce configuration
	libata: whitelist all SAMSUNG MZ7KM* solid-state disks
	mv88e6060: disable hardware level MAC learning
	ARM: 8814/1: mm: improve/fix ARM v7_dma_inv_range() unaligned address handling
	cifs: In Kconfig CONFIG_CIFS_POSIX needs depends on legacy (insecure cifs)
	i2c: axxia: properly handle master timeout
	i2c: scmi: Fix probe error on devices with an empty SMB0001 ACPI device node
	rtc: snvs: add a missing write sync
	rtc: snvs: Add timeouts to avoid kernel lockups
	ALSA: isa/wavefront: prevent some out of bound writes
	Linux 4.4.169

Change-Id: Ic1bde8f64625c7787feb8e7411b15e70a2f76981
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2018-12-21 14:28:48 +01:00
Greg Kroah-Hartman
ba0da581b4 Linux 4.4.169 2018-12-21 14:09:54 +01:00
Dan Carpenter
76feba7d21 ALSA: isa/wavefront: prevent some out of bound writes
[ Upstream commit 84d7a4470dbac0dd9389050100b54a1625d04264 ]

"header->number" can be up to USHRT_MAX and it comes from the ioctl so
it needs to be capped.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:09:54 +01:00
Trent Piepho
e3f904b939 rtc: snvs: Add timeouts to avoid kernel lockups
[ Upstream commit cd7f3a249dbed2858e6c2f30e5be7f1f7a709ee2 ]

In order to read correctly from asynchronously updated RTC registers,
it's necessary to read repeatedly until their values do not change from
read to read.  It's also necessary to wait for three RTC clock ticks for
certain operations.  There are no timeouts in this code and these
operations could possibly loop forever.

To avoid kernel hangs, put in timeouts.

The iMX7d can be configured to stop the SRTC on a tamper event, which
will lockup the kernel inside this driver as described above.

These hangs can happen when running under qemu, which doesn't emulate
the SNVS RTC, though currently the driver will refuse to load on qemu
due to a timeout in the driver probe method.

It could also happen if the SRTC block where somehow placed into reset
or the slow speed clock that drives the SRTC counter (but not the CPU)
were to stop.

The symptoms on a two core iMX7d are a work queue hang on
rtc_timer_do_work(), which eventually blocks a systemd fsnotify
operation that triggers a work queue flush, causing systemd to hang and
thus causing all services that should be started by systemd, like a
console getty, to fail to start or stop.

Also optimize the wait code to wait less.  It only needs to wait for the
clock to advance three ticks, not to see it change three times.

Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Signed-off-by: Trent Piepho <tpiepho@impinj.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:09:53 +01:00
Guy Shapiro
4178875d9c rtc: snvs: add a missing write sync
[ Upstream commit 7bb633b1a9812a6b9f3e49d0cf17f60a633914e5 ]

The clear of the LPTA_EN flag should be synced before writing to the
alarm register. Omitting this synchronization creates a race when
trying to change existing alarm.

Signed-off-by: Guy Shapiro <guy.shapiro@mobi-wize.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:09:53 +01:00
Hans de Goede
02979d43b3 i2c: scmi: Fix probe error on devices with an empty SMB0001 ACPI device node
[ Upstream commit 0544ee4b1ad574aec3b6379af5f5cdee42840971 ]

Some AMD based HP laptops have a SMB0001 ACPI device node which does not
define any methods.

This leads to the following error in dmesg:

[    5.222731] cmi: probe of SMB0001:00 failed with error -5

This commit makes acpi_smbus_cmi_add() return -ENODEV instead in this case
silencing the error. In case of a failure of the i2c_add_adapter() call
this commit now propagates the error from that call instead of -EIO.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:09:53 +01:00
Adamski, Krzysztof (Nokia - PL/Wroclaw)
a84f9b11ef i2c: axxia: properly handle master timeout
[ Upstream commit 6c7f25cae54b840302e4f1b371dbf318fbf09ab2 ]

According to Intel (R) Axxia TM Lionfish Communication Processor
Peripheral Subsystem Hardware Reference Manual, the AXXIA I2C module
have a programmable Master Wait Timer, which among others, checks the
time between commands send in manual mode. When a timeout (25ms) passes,
TSS bit is set in Master Interrupt Status register and a Stop command is
issued by the hardware.

The axxia_i2c_xfer(), does not properly handle this situation, however.
For each message a separate axxia_i2c_xfer_msg() is called and this
function incorrectly assumes that any interrupt might happen only when
waiting for completion. This is mostly correct but there is one
exception - a master timeout can trigger if enough time has passed
between individual transfers. It will, by definition, happen between
transfers when the interrupts are disabled by the code. If that happens,
the hardware issues Stop command.

The interrupt indicating timeout will not be triggered as soon as we
enable them since the Master Interrupt Status is cleared when master
mode is entered again (which happens before enabling irqs) meaning this
error is lost and the transfer is continued even though the Stop was
issued on the bus. The subsequent operations completes without error but
a bogus value (0xFF in case of read) is read as the client device is
confused because aborted transfer. No error is returned from
master_xfer() making caller believe that a valid value was read.

To fix the problem, the TSS bit (indicating timeout) in Master Interrupt
Status register is checked before each transfer. If it is set, there was
a timeout before this transfer and (as described above) the hardware
already issued Stop command so the transaction should be aborted thus
-ETIMEOUT is returned from the master_xfer() callback. In order to be
sure no timeout was issued we can't just read the status just before
starting new transaction as there will always be a small window of time
(few CPU cycles at best) where this might still happen. For this reason
we have to temporally disable the timer before checking for TSS bit.
Disabling it will, however, clear the TSS bit so in order to preserve
that information, we have to read it in ISR so we have to ensure that
the TSS interrupt is not masked between transfers of one transaction.
There is no need to call bus recovery or controller reinitialization if
that happens so it's skipped.

Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:09:53 +01:00
Steve French
60da90b224 cifs: In Kconfig CONFIG_CIFS_POSIX needs depends on legacy (insecure cifs)
[ Upstream commit 6e785302dad32228819d8066e5376acd15d0e6ba ]

Missing a dependency.  Shouldn't show cifs posix extensions
in Kconfig if CONFIG_CIFS_ALLOW_INSECURE_DIALECTS (ie SMB1
protocol) is disabled.

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:09:53 +01:00
Chris Cole
fa5d9b585e ARM: 8814/1: mm: improve/fix ARM v7_dma_inv_range() unaligned address handling
[ Upstream commit a1208f6a822ac29933e772ef1f637c5d67838da9 ]

This patch addresses possible memory corruption when
v7_dma_inv_range(start_address, end_address) address parameters are not
aligned to whole cache lines. This function issues "invalidate" cache
management operations to all cache lines from start_address (inclusive)
to end_address (exclusive). When start_address and/or end_address are
not aligned, the start and/or end cache lines are first issued "clean &
invalidate" operation. The assumption is this is done to ensure that any
dirty data addresses outside the address range (but part of the first or
last cache lines) are cleaned/flushed so that data is not lost, which
could happen if just an invalidate is issued.

The problem is that these first/last partial cache lines are issued
"clean & invalidate" and then "invalidate". This second "invalidate" is
not required and worse can cause "lost" writes to addresses outside the
address range but part of the cache line. If another component writes to
its part of the cache line between the "clean & invalidate" and
"invalidate" operations, the write can get lost. This fix is to remove
the extra "invalidate" operation when unaligned addressed are used.

A kernel module is available that has a stress test to reproduce the
issue and a unit test of the updated v7_dma_inv_range(). It can be
downloaded from
http://ftp.sageembedded.com/outgoing/linux/cache-test-20181107.tgz.

v7_dma_inv_range() is call by dmac_[un]map_area(addr, len, direction)
when the direction is DMA_FROM_DEVICE. One can (I believe) successfully
argue that DMA from a device to main memory should use buffers aligned
to cache line size, because the "clean & invalidate" might overwrite
data that the device just wrote using DMA. But if a driver does use
unaligned buffers, at least this fix will prevent memory corruption
outside the buffer.

Signed-off-by: Chris Cole <chris@sageembedded.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:09:53 +01:00
Anderson Luiz Alves
59654d5916 mv88e6060: disable hardware level MAC learning
[ Upstream commit a74515604a7b171f2702bdcbd1e231225fb456d0 ]

Disable hardware level MAC learning because it breaks station roaming.
When enabled it drops all frames that arrive from a MAC address
that is on a different port at learning table.

Signed-off-by: Anderson Luiz Alves <alacn1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:09:53 +01:00