Commit graph

798893 commits

Author SHA1 Message Date
Hridya Valsaraju
8dd22d7e90 ANDROID: GKI: Bulk ABI update
Leaf changes summary: 3 artifacts changed
Changed leaf types summary: 1 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

2 Added functions:

  [A] 'function snd_usb_substream* find_snd_usb_substream(unsigned int, unsigned int, unsigned int, snd_usb_audio**, void ()*)'
  [A] 'function int snd_usb_enable_audio_stream(snd_usb_substream*, int, bool)'

'struct station_info at cfg80211.h:1385:1' changed:
  type size changed from 1536 to 1600 (in bits)
  2 data member insertions:
    'u32 station_info::rx_mpdu_count', at offset 1504 (in bits) at cfg80211.h:1435:1
    'u32 station_info::fcs_err_count', at offset 1536 (in bits) at cfg80211.h:1436:1
  3 impacted interfaces

Test: build
Bug: 149430094
Signed-off-by: Hridya Valsaraju <hridya@google.com>
Change-Id: Icf934b876e501070fe370228ffaab4b264ccd255
2020-04-14 13:02:51 -07:00
Ankita Bajaj
8766a7247a BACKPORT: nl80211: Add per peer statistics to compute FCS error rate
Add support for drivers to report the total number of MPDUs received
and the number of MPDUs received with an FCS error from a specific
peer. These counters will be incremented only when the TA of the
frame matches the MAC address of the peer irrespective of FCS
error.

It should be noted that the TA field in the frame might be corrupted
when there is an FCS error and TA matching logic would fail in such
cases. Hence, FCS error counter might not be fully accurate, but it can
provide help in detecting bad RX links in significant number of cases.
This FCS error counter without full accuracy can be used, e.g., to
trigger a kick-out of a connected client with a bad link in AP mode to
force such a client to roam to another AP.

Test: build
Bug: 153912588
Signed-off-by: Ankita Bajaj <bankita@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 0d4e14a32dcab9c4bd559d02874120fbb86b1322)
[hridya: resolved minor conflicts]
Signed-off-by: Hridya Valsaraju <hridya@google.com>
Change-Id: I5306d36e6df255efcb130b0de5151bebda67c549
2020-04-14 12:57:22 -07:00
Hridya Valsaraju
6da0c634f8 ANDROID: GKI: sound: usb: Add snd_usb_enable_audio_stream/find_snd_usb_substream
Add functions snd_usb_enable_audio_stream and find_snd_usb_substream
to resolve ABI diff.

Test: build
Bug: 151372815
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Change-Id: I658d525233be3eb657a3b36c81a3920e65e96a40
(cherry picked from commit f055b3843f)
[hridya: only include ABI diff, add EXPORT_SYMBOL_GPL,
add some pointer checks]
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2020-04-14 12:57:13 -07:00
Mark Salyzyn
1c20c327b6 ANDROID: GKI: add dma-buf includes
CRC ABI introduced with
commit ac04f0739d
("ion : Merge ion changes for msm-kona kernel upgrade")
Author: Swathi Sridhar <swatsrid@codeaurora.org>

Resulted in three include files being introduced that alter
the CRC generated for module versions, resulting in what
formerly forward references, now fully known.

Fixes the following CRC problems:
 dma_buf_begin_cpu_access
 dma_buf_end_cpu_access
 dma_buf_fd
 dma_buf_get
 dma_buf_get_flags
 dma_buf_kmap
 dma_buf_kunmap
 dma_buf_put
 dma_buf_attach
 dma_buf_detach
 dma_buf_map_attachment
 dma_buf_unmap_attachment
 dma_buf_export

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 153738240
Change-Id: I3fa65229367e7ce43e1cb1dd14d163e221b03e62
2020-04-14 10:23:15 -07:00
Thara Gopinath
c83082217a ANDROID: GKI: sched: struct fields for Per-Sched-domain over utilization
This commit only changes the struct fields needed to fix ABI
differences.

Bug: 153905799
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
Change-Id: I3f327cff4080096a3e58208dd72c9b7f7913cdb2
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
(cherry picked from commit addef37808728c719d8c095a75bcf81befdacdaf)
[saravanak cherry-picked only the struct differences]
Signed-off-by: Saravana Kannan <saravanak@google.com>
2020-04-14 16:21:16 +00:00
Saravana Kannan
cb2fe03684 ANDROID: GKI: Add vendor fields to root_domain
This is needed for ABI compatibility

Bug: 153905799
Change-Id: Idd802feeb29652e9f575faff8a0770af5697eedb
Signed-off-by: Saravana Kannan <saravanak@google.com>
2020-04-14 16:21:06 +00:00
Saravana Kannan
adeb470374 ANDROID: gki_defconfig: Enable CONFIG_IRQ_TIME_ACCOUNTING
Some vendors use this. So enable it.

Bug: 153905799
Change-Id: Ia7de7437c2921ac6a60d2b3e255146251fb1d4a3
Signed-off-by: Saravana Kannan <saravanak@google.com>
2020-04-14 16:20:46 +00:00
Will McVicker
9f02b3b447 ANDROID: fix allmodconfig build to use the right toolchain
Without these changes, the user will be prompted for config changes.

Signed-off-by: Will McVicker <willmcvicker@google.com>
Bug: 153934356
Test: BUILD_CONFIG=common/build.config.allmodconfig.aarch64 build/build.sh
Change-Id: Ib9ef72b217d1e0d78edf136cfe560058e3126d18
2020-04-14 15:40:56 +00:00
Suren Baghdasaryan
b8b3040a57 ANDROID: GKI: Update ABI
Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 2 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

'struct pglist_data at mmzone.h:639:1' changed:
  type size changed from 31232 to 30208 (in bits)
  there are data member changes:
    'zone pglist_data::node_zones[2]' size changed from 25600 to 24576 (in bits) (by -1024 bits)
    'zonelist pglist_data::node_zonelists[1]' offset changed from 25600 to 24576 (in bits) (by -1024 bits)
    'int pglist_data::nr_zones' offset changed from 25984 to 24960 (in bits) (by -1024 bits)
    'unsigned long int pglist_data::node_start_pfn' offset changed from 26048 to 25024 (in bits) (by -1024 bits)
    'unsigned long int pglist_data::node_present_pages' offset changed from 26112 to 25088 (in bits) (by -1024 bits)
    'unsigned long int pglist_data::node_spanned_pages' offset changed from 26176 to 25152 (in bits) (by -1024 bits)
    'int pglist_data::node_id' offset changed from 26240 to 25216 (in bits) (by -1024 bits)
    'wait_queue_head_t pglist_data::kswapd_wait' offset changed from 26304 to 25280 (in bits) (by -1024 bits)
    'wait_queue_head_t pglist_data::pfmemalloc_wait' offset changed from 26496 to 25472 (in bits) (by -1024 bits)
    'task_struct* pglist_data::kswapd' offset changed from 26688 to 25664 (in bits) (by -1024 bits)
    'int pglist_data::kswapd_order' offset changed from 26752 to 25728 (in bits) (by -1024 bits)
    'zone_type pglist_data::kswapd_classzone_idx' offset changed from 26784 to 25760 (in bits) (by -1024 bits)
    'int pglist_data::kswapd_failures' offset changed from 26816 to 25792 (in bits) (by -1024 bits)
    'int pglist_data::kcompactd_max_order' offset changed from 26848 to 25824 (in bits) (by -1024 bits)
    'zone_type pglist_data::kcompactd_classzone_idx' offset changed from 26880 to 25856 (in bits) (by -1024 bits)
    'wait_queue_head_t pglist_data::kcompactd_wait' offset changed from 26944 to 25920 (in bits) (by -1024 bits)
    'task_struct* pglist_data::kcompactd' offset changed from 27136 to 26112 (in bits) (by -1024 bits)
    'unsigned long int pglist_data::totalreserve_pages' offset changed from 27200 to 26176 (in bits) (by -1024 bits)
    'zone_padding pglist_data::_pad1_' offset changed from 27648 to 26624 (in bits) (by -1024 bits)
    'spinlock_t pglist_data::lru_lock' offset changed from 27648 to 26624 (in bits) (by -1024 bits)
    'lruvec pglist_data::lruvec' offset changed from 27712 to 26688 (in bits) (by -1024 bits)
    'unsigned long int pglist_data::flags' offset changed from 28800 to 27776 (in bits) (by -1024 bits)
    'zone_padding pglist_data::_pad2_' offset changed from 29184 to 28160 (in bits) (by -1024 bits)
    'per_cpu_nodestat* pglist_data::per_cpu_nodestats' offset changed from 29184 to 28160 (in bits) (by -1024 bits)
    'atomic_long_t pglist_data::vm_stat[30]' offset changed from 29248 to 28224 (in bits) (by -1024 bits)
  548 impacted interfaces

'struct zone at mmzone.h:367:1' changed:
  type size changed from 12800 to 12288 (in bits)
  3 data member deletions:
    'unsigned long int zone::watermark_boost', at offset 192 (in bits) at mmzone.h:372:1
    'unsigned long int zone::compact_init_migrate_pfn', at offset 11520 (in bits) at mmzone.h:498:1
    'unsigned long int zone::compact_init_free_pfn', at offset 11584 (in bits) at mmzone.h:499:1
  there are data member changes:
    'unsigned long int zone::nr_reserved_highatomic' offset changed from 256 to 192 (in bits) (by -64 bits)
    'long int zone::lowmem_reserve[2]' offset changed from 320 to 256 (in bits) (by -64 bits)
    'pglist_data* zone::zone_pgdat' offset changed from 448 to 384 (in bits) (by -64 bits)
    'per_cpu_pageset* zone::pageset' offset changed from 512 to 448 (in bits) (by -64 bits)
    'bool zone::cma_alloc' offset changed from 576 to 512 (in bits) (by -64 bits)
    'unsigned long int zone::zone_start_pfn' offset changed from 640 to 576 (in bits) (by -64 bits)
    'unsigned long int zone::managed_pages' offset changed from 704 to 640 (in bits) (by -64 bits)
    'unsigned long int zone::spanned_pages' offset changed from 768 to 704 (in bits) (by -64 bits)
    'unsigned long int zone::present_pages' offset changed from 832 to 768 (in bits) (by -64 bits)
    'const char* zone::name' offset changed from 896 to 832 (in bits) (by -64 bits)
    'unsigned long int zone::nr_isolate_pageblock' offset changed from 960 to 896 (in bits) (by -64 bits)
    'int zone::initialized' offset changed from 1024 to 960 (in bits) (by -64 bits)
    'zone_padding zone::_pad1_' offset changed from 1536 to 1024 (in bits) (by -512 bits)
    'free_area zone::free_area[11]' offset changed from 1536 to 1024 (in bits) (by -512 bits)
    'unsigned long int zone::flags' offset changed from 10688 to 10176 (in bits) (by -512 bits)
    'spinlock_t zone::lock' offset changed from 10752 to 10240 (in bits) (by -512 bits)
    'zone_padding zone::_pad2_' offset changed from 11264 to 10752 (in bits) (by -512 bits)
    'unsigned long int zone::percpu_drift_mark' offset changed from 11264 to 10752 (in bits) (by -512 bits)
    'unsigned long int zone::compact_cached_free_pfn' offset changed from 11328 to 10816 (in bits) (by -512 bits)
    'unsigned long int zone::compact_cached_migrate_pfn[2]' offset changed from 11392 to 10880 (in bits) (by -512 bits)
    'unsigned int zone::compact_considered' offset changed from 11648 to 11008 (in bits) (by -640 bits)
    'unsigned int zone::compact_defer_shift' offset changed from 11680 to 11040 (in bits) (by -640 bits)
    'int zone::compact_order_failed' offset changed from 11712 to 11072 (in bits) (by -640 bits)
    'bool zone::compact_blockskip_flush' offset changed from 11744 to 11104 (in bits) (by -640 bits)
    'bool zone::contiguous' offset changed from 11752 to 11112 (in bits) (by -640 bits)
    'zone_padding zone::_pad3_' offset changed from 11776 to 11264 (in bits) (by -512 bits)
    'atomic_long_t zone::vm_stat[14]' offset changed from 11776 to 11264 (in bits) (by -512 bits)
    'atomic_long_t zone::vm_numa_stat[]' offset changed from 12672 to 12160 (in bits) (by -512 bits)
  548 impacted interfaces

Bug: 140544941
Test: build and boot
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I85847dc52c3e002f8978d020d1e4ccf8a638d5ba
Signed-off-by: Martin Liu <liumartin@google.com>
2020-04-14 19:39:12 +08:00
Mark Salyzyn
82d4e597c4 Revert "UPSTREAM: mm, page_alloc: spread allocations across zones before introducing fragmentation"
This reverts commit 8ad4b225e8.

Reason for revert: revert customized code
Bug: 140544941
Test: boot
Signed-off-by: Minchan Kim <minchan@google.com>
Signed-off-by: Martin Liu <liumartin@google.com>
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I340fb8af98b3f6e033fd5463b082fbca43abe941
2020-04-14 19:36:13 +08:00
Mark Salyzyn
5e86f20f4f Revert "UPSTREAM: mm: use alloc_flags to record if kswapd can wake"
This reverts commit 112ced56ce.

Reason for revert: revert customized code
Bug: 140544941
Test: boot
Signed-off-by: Minchan Kim <minchan@google.com>
Signed-off-by: Martin Liu <liumartin@google.com>
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I400cabb69dc9e24ea5d84f677315dbb3bfd34e45
2020-04-14 19:35:59 +08:00
Mark Salyzyn
fbc355c16d Revert "BACKPORT: mm: move zone watermark accesses behind an accessor"
This reverts commit acfb1c608b.

Reason for revert: revert customized code
Bug: 140544941
Test: boot
Signed-off-by: Minchan Kim <minchan@google.com>
Signed-off-by: Martin Liu <liumartin@google.com>
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I4988ddf1fc24579d4fc478de1de6e45b870f7bcd
2020-04-14 19:35:44 +08:00
Mark Salyzyn
35be952ae0 Revert "BACKPORT: mm: reclaim small amounts of memory when an external fragmentation event occurs"
This reverts commit 5cbbeadd5a.

Reason for revert: revert customized code
Bug: 140544941
Test: boot
Signed-off-by: Minchan Kim <minchan@google.com>
Signed-off-by: Martin Liu <liumartin@google.com>
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I65735f27f6a44a112957bcec07e2f63f2d8ccff6
2020-04-14 19:35:27 +08:00
Mark Salyzyn
776eba0172 Revert "BACKPORT: mm, compaction: be selective about what pageblocks to clear skip hints"
This reverts commit fd9c71c06b.

Reason for revert: revert customized code
Bug: 140544941
Test: boot
Signed-off-by: Minchan Kim <minchan@google.com>
Signed-off-by: Martin Liu <liumartin@google.com>
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I58d978c6f74f8a1a04b17fa6d3890ddc4f1988c0
2020-04-14 19:35:13 +08:00
Will McVicker
56ebfff5eb ANDROID: GKI: panic: add vendor callback function in panic()
Each vendor might want to implement some debug code when the kernel
panics. So, add a vendor_panic_cb callback for vendors to implement.

Bug: 149258398
Test: compile
Change-Id: I7a374b0089f72c2511db6fe3b8cdd18f41a1eb6c
Signed-off-by: Saravana Kannan <saravanak@google.com>
(cherry picked from commit 911d9c70c2c50b0383ed0b652bb84ca8832e4a2b)
Signed-off-by: Will McVicker <willmcvicker@google.com>
[willmcvicker: only pulled in the ABI diffs]
2020-04-14 05:24:52 +00:00
Jean-Francois Dagenais
7de8e1e424 UPSTREAM: GKI: thermal: make device_register's type argument const
...because it can be, the buffer is strlcpy'd into a local buffer in a
thermal struct member.

Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
(cherry picked from commit f991de53a8abef21fae3e31967cb4f6a75c070b5)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 153738240
Change-Id: I3c9f18f4459890cc2ebcbf9bc6f9e6e3da339dfb
2020-04-13 17:46:47 -07:00
TeYuan Wang
47862b5635 ANDROID: GKI: add base.h include to match MODULE_VERSIONS
Partial cherry picked from
commit 6c1ddabbd1d51b8f1704c682fa0c7a8695cbad12
("thermal: Create softlink by name for thermal_zone and cooling device")

Bug: 139859938
Bug: 118439547
Test: tz and cdev softlink can be created at
sys/devices/virtual/thermal and sys/class/thermal.
Signed-off-by: TeYuan Wang <kamewang@google.com>
Signed-off-by: davidchao <davidchao@google.com>
(cherry picked from commit 6c1ddabbd1d51b8f1704c682fa0c7a8695cbad12)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 153738240
Change-Id: Ic2d265dcec4caba228b4e86dc1163c13952d8d3b
2020-04-13 17:46:33 -07:00
Will McVicker
fd2ab11899 ANDROID: update the ABI based on the new whitelist
Leaf changes summary: 13 artifacts changed
Changed leaf types summary: 8 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 5 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

Signed-off-by: Will McVicker <willmcvicker@google.com>
Bug: 153886473
Test: compile
Change-Id: Iccfb858ca7257af5885d3a81c9bf291b1a4279f3
2020-04-13 23:34:07 +00:00
lucaswei
51c2add6cc ANDROID: GKI: fdt: export symbols required by modules
Export these symbols for modularized drivers.
  of_fdt_get_ddrrank
  of_fdt_get_ddrhbb

Bug: 153905290
Bug: 151601060
Bug: 151568484
Test: compile
Change-Id: I3a20d333ed4b6450d3721d6ae191fc31be2033ed
Signed-off-by: lucaswei <lucaswei@google.com>
(cherry picked from commit b2c6888bdfbb768bdb40cdccd1a972548997e940)
Signed-off-by: Will McVicker <willmcvicker@google.com>
2020-04-13 23:33:52 +00:00
Kaushal Kumar
643e14cfa2 ANDROID: GKI: drivers: of: Add APIs to find DDR device rank, HBB
Add APIs to find the DDR device rank and Highest
Bank Bit (HBB) information from their respective
memory nodes.

Bug: 153905290
Test: compile
Change-Id: Iae94efc681daf2cf0a531dceb8d2acdcf3484388
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
(cherry picked from commit 789ad9a7a8)
Signed-off-by: Will McVicker <willmcvicker@google.com>
2020-04-13 16:30:04 -07:00
Will McVicker
e941a5081c ANDROID: GKI: security: Add mmap export symbols for modules
Bug: 141876853
Test: compile

Change-Id: I6a5f5c2b71f3450a86c9ab20239df51519abf649
Signed-off-by: Will McVicker <willmcvicker@google.com>
(cherry picked from commit 3758a400cf70e5389267bd27b0bb86761b6c3241)
2020-04-13 16:30:04 -07:00
Rick Adams
b3bae00cda ANDROID: GKI: arch: add stub symbols for boot_reason and cold_boot
These symbols are needed by some vendor drivers. So add stubs symbols to
please those drivers.

Bug: 153902877
Test: compile
Signed-off-by: Rick Adams <rgadams@codeaurora.org>
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Signed-off-by: David Collins <collinsd@codeaurora.org>
[willmcvicker: Squashed the following commits but only took ABI diffs:
  f699c92b61 msm: 8x55: put reason for boot in procfs from SMEM
  ee67650037 sysctl: add cold_boot sysctl entry
  de98b0ac25 sysctl: add boot_reason and cold_boot sysctl entries for arm64]
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I1c3eb7bcf9fb2ccae870a3fb4b9e31138609cf46
2020-04-13 16:29:59 -07:00
Hemant Kumar
5b6a5354d0 ANDROID: GKI: USB: Fix ABI diff for struct usb_bus
Adds new member skip_resume to struct usb_bus to resolve ABI diff.
This patch also adds the capability to skip device resume during
system resume. It allows xHC to remain in low power mode and not
resume the bus when system wide resume happens.
Instead, the controller comes out of low power mode only
when usb device issues a remote wakeup or if there is
host initiated bus resume.

Test: build
Bug: 153445212
Change-Id: I96cdcb9e3642906b4afa08d9bde07e123d9b3977
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
(cherry picked from commit 567a7ba0cc)
[hridya: partial cherry-pick]
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2020-04-13 22:13:50 +00:00
Hridya Valsaraju
632093eced ANDROID: GKI: USB: Resolve ABI diff for usb_gadget and usb_gadget_ops
Also, adds function usb_gsi_ep_op and resolves ABI diff for
struct usb_ep_ops by adding new member gsi_ep_ops. Also
resolves ABI diff for struct usb_request by adding member udc_priv.

Test: build
Bug: 153676200
Change-Id: I04a59f7a2670fb80afa5822b79ea488bc94abdfe
(cherry picked from commit 6252350019)
[hridya: EXPORT_SYMBOL -> EXPORT_SYMBOL_GPL, cherry-picked only the ABI
diff, added some null pointer checks and documentation]
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2020-04-13 22:13:38 +00:00
Mark Salyzyn
2ebf287bf7 ANDROID: GKI: add hidden V4L2_MEM2MEM_DEV
Solve ABI issue with struct v4l2_fh

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 151246806
Bug: 153738240
Bug: 151399858
Change-Id: I9671a692b1b8450ff2f6266cc9dde9e6fb0c9297
2020-04-13 21:58:26 +00:00
Mark Salyzyn
ab463cee83 ANDROID: GKI: enable VIDEO_V4L2_SUBDEV_API
ABI resolution for a series of v4l2 functions.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 153738240
Change-Id: I90dff74d8ec85857e6fc31dfbc83a2e737ac13d6
2020-04-13 21:58:13 +00:00
Will McVicker
0a2394dc5a ANDROID: GKI: export symbols from abi_gki_aarch64_qcom_whitelist
Run the script,
  $ ../build/gki/add_EXPORT_SYMBOL_GPL < abi_gki_aarch64_qcom_whitelist

This will export all the required symbols that are in this kernel.

Signed-off-by: Will McVicker <willmcvicker@google.com>
Bug: 153886473
Test: compile
Change-Id: I703509d75104cd86f472481346e3efbd235121ab
2020-04-13 21:36:41 +00:00
Will McVicker
6baa77a312 ANDROID: Update the whitelist for qcom SoCs
Mainly removes debug symbols and adds CFI symbols.

Signed-off-by: Will McVicker <willmcvicker@google.com>
Bug: 153886473
Change-Id: I2e10f9e63ba4a733429769b99af3307a78c6537b
2020-04-13 21:36:32 +00:00
Paul Lawrence
580b23c95a ANDROID: Incremental fs: Fix compound page usercopy crash
Bug: 153560805
Test: incfs_test passes on qemu and Pixel 4
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I1b55341e4e4247a74f3f539b9d190fef0ca409b8
2020-04-13 20:45:20 +00:00
Paul Lawrence
06a024d4b9 ANDROID: Incremental fs: Clean up incfs_test build process
Bug: 153557975
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I57eef43a5d003e3d89a4c872d21e36376bc580a1
2020-04-13 20:45:13 +00:00
Yurii Zubrytskyi
5e6feacb2a ANDROID: Incremental fs: make remount log buffer change atomic
Read log buffer can have multiple threads doing any of these
operations simultaneously:
- Polling for changes
- Reading log records
- Adding new log records
- Updating log buffer size, or enabling/disabling it completely

As we don't control the userspace, and it turns out that they
all currently originate from different processes, code needs to
be safe against parallel access to a read buffer and a request
for reallocating it.

This CL add an r/w spinlock to protect the buffer and its size.
Each remount takes the write lock, while everything else takes
a read lock. Remount makes sure it doesn't take too long by
preallocating and precalculating all updates, while other
operations don't care much about their critical section size -
they all can still run together.

Bug: 152633648
Test: manual remount + reading
Signed-off-by: Yurii Zubrytskyi <zyy@google.com>
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I7271b4cb89f1ae2cbee6e5b073758f344c4ba66a
2020-04-13 20:45:05 +00:00
Paul Lawrence
5128381d88 ANDROID: Incremental fs: Optimize get_filled_block
This led to a 20x speed improvement on QEMU. 512 is somewhat
arbitrary - most of the gains are already there reading 64 records
at a time, but since the record size is 10 bytes, 512 is just over
a page and seems a good choice.

Bug: 153170997
Test: incfs_test passes. Adding logging to incfs_get_filled_blocks
	to measure performance shows a 20x improvement
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ifb2da77cfd8c9d653c7047ba1eb7f39d795fa1c2
2020-04-13 20:44:56 +00:00
Paul Lawrence
23f5b7c508 ANDROID: Incremental fs: Fix mislabeled __user ptrs
Found by sparse

Bug: 153174547
Test: make C=2 fs/incfs/incrementalfs.ko no errors, incfs_test pass
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I9ff4f4f35975fe09936724488b96cd8bdeeb719e
2020-04-13 20:44:48 +00:00
Yurii Zubrytskyi
114b043125 ANDROID: Incremental fs: Use 64-bit int for file_size when writing hash blocks
Bug: 153210803
Test: manual
Change-Id: Iafc888dbe906cd37e5b28dc2814f52aace175c0f
Signed-off-by: Yurii Zubrytskyi <zyy@google.com>
2020-04-13 20:44:40 +00:00
Jaegeuk Kim
714629517b Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-4.19.y' into android-4.19 (v5.7-rc1)
* aosp/upstream-f2fs-stable-linux-4.19.y:
  f2fs: keep inline_data when compression conversion
  f2fs: fix to disable compression on directory
  f2fs: add missing CONFIG_F2FS_FS_COMPRESSION
  f2fs: switch discard_policy.timeout to bool type
  f2fs: fix to verify tpage before releasing in f2fs_free_dic()
  f2fs: show compression in statx
  f2fs: clean up dic->tpages assignment
  f2fs: compress: support zstd compress algorithm
  f2fs: compress: add .{init,destroy}_decompress_ctx callback
  f2fs: compress: fix to call missing destroy_compress_ctx()
  f2fs: change default compression algorithm
  f2fs: clean up {cic,dic}.ref handling
  f2fs: fix to use f2fs_readpage_limit() in f2fs_read_multi_pages()
  f2fs: xattr.h: Make stub helpers inline
  f2fs: fix to avoid double unlock
  f2fs: fix potential .flags overflow on 32bit architecture
  f2fs: fix NULL pointer dereference in f2fs_verity_work()
  f2fs: fix to clear PG_error if fsverity failed
  f2fs: don't call fscrypt_get_encryption_info() explicitly in f2fs_tmpfile()
  f2fs: don't trigger data flush in foreground operation
  f2fs: fix NULL pointer dereference in f2fs_write_begin()
  f2fs: clean up f2fs_may_encrypt()
  f2fs: fix to avoid potential deadlock
  f2fs: don't change inode status under page lock
  f2fs: fix potential deadlock on compressed quota file
  f2fs: delete DIO read lock
  f2fs: don't mark compressed inode dirty during f2fs_iget()
  f2fs: fix to account compressed blocks in f2fs_compressed_blocks()
  f2fs: xattr.h: Replace zero-length array with flexible-array member
  f2fs: fix to update f2fs_super_block fields under sb_lock
  f2fs: Add a new CP flag to help fsck fix resize SPO issues
  f2fs: Fix mount failure due to SPO after a successful online resize FS
  f2fs: use kmem_cache pool during inline xattr lookups
  f2fs: skip migration only when BG_GC is called
  f2fs: fix to show tracepoint correctly
  f2fs: avoid __GFP_NOFAIL in f2fs_bio_alloc
  f2fs: introduce F2FS_IOC_GET_COMPRESS_BLOCKS
  f2fs: fix to avoid triggering IO in write path
  f2fs: add prefix for f2fs slab cache name
  f2fs: introduce DEFAULT_IO_TIMEOUT
  f2fs: skip GC when section is full
  f2fs: add migration count iff migration happens
  f2fs: clean up bggc mount option
  f2fs: clean up lfs/adaptive mount option
  f2fs: fix to show norecovery mount option
  f2fs: clean up parameter of macro XATTR_SIZE()
  f2fs: clean up codes with {f2fs_,}data_blkaddr()
  f2fs: show mounted time
  f2fs: Use scnprintf() for avoiding potential buffer overflow
  f2fs: allow to clear F2FS_COMPR_FL flag
  f2fs: fix to check dirty pages during compressed inode conversion
  f2fs: fix to account compressed inode correctly
  f2fs: fix wrong check on F2FS_IOC_FSSETXATTR
  f2fs: fix to avoid use-after-free in f2fs_write_multi_pages()
  f2fs: fix to avoid using uninitialized variable
  f2fs: fix inconsistent comments
  f2fs: remove i_sem lock coverage in f2fs_setxattr()
  f2fs: cover last_disk_size update with spinlock
  f2fs: fix to check i_compr_blocks correctly
  f2fs: fix to avoid potential deadlock
  f2fs: add missing function name in kernel message
  f2fs: recycle unused compress_data.chksum feild
  f2fs: fix to avoid NULL pointer dereference
  f2fs: fix leaking uninitialized memory in compressed clusters
  f2fs: fix the panic in do_checkpoint()
  f2fs: fix to wait all node page writeback
  mm/swapfile.c: move inode_lock out of claim_swapfile
  fscrypt: don't evict dirty inodes after removing key

 Conflicts:
	fs/f2fs/file.c

Bug: 151226003
Change-Id: I86ee3579255cf2f37cf1a1d00ee4af90e973242a
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2020-04-13 15:24:19 +00:00
Greg Kroah-Hartman
2d2af525a7 This is the 4.19.115 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl6USBUACgkQONu9yGCS
 aT6dNxAA1BJKHbO1TOMTYi21N8XNbMOOblVxrLDe+Y2nEj2KIqiehlsoreV34F/g
 IswNAuA3JXp7pU53RIKsTIWvx9CvNit55sJ1eKWTfFZGCotsBWH9Xzeh9Ao1wURG
 vhE5tX8PUwEzZ/sFphVmVvv5oUkQyHYKpEosyVOqL5eIQe5E430PxB/xvz4I0Vyq
 HHiXmrNekXi5kY156k1RqLQ/RhKMFPNi7swm1uFKLS1qrcIlQzgq5MFk5l59oEMo
 xob25EeeddVa/4roNSVk9IZGZjXpRPsvRM8kxjSXn2KVz1aO8TgYXF1RyWeNthsZ
 VXf6XkasSh3bwMX6imhV1fGmepG3OvSZg0k2EvRTpcY84kFlIrC1l2YuOHrCETgL
 GkptUtGK0a2FEiyBK/0nxvf2E6iaoT4NeTYlyTkL8iOgJ+xMvuSzCpFfQjfkOjGz
 h3AD+Twqu7lqY54nOvyAkA94joEFzVuzSoYCABAImFq4kvu4khhWBXTmkqUf47aI
 1O3m4bMEMLDBRwiBpRsu5c0C+ghHHQtOWTH/UjyOI1aGEKFZyBe5CHYmRo2W9tDg
 rrlymg1iVMR1o9pvzzRroCokKCzBSirEWKxyyMIFWko5xQvTvae5fTIaAWlvBGjP
 oH3eIPDWw1ZD1WxiSGzM2Wx4AyumZ1y3pnOHV3uUnYb3cM0l9g8=
 =bfll
 -----END PGP SIGNATURE-----

Merge 4.19.115 into android-4.19

Changes in 4.19.115
	ipv4: fix a RCU-list lock in fib_triestat_seq_show
	net, ip_tunnel: fix interface lookup with no key
	sctp: fix refcount bug in sctp_wfree
	sctp: fix possibly using a bad saddr with a given dst
	nvme-rdma: Avoid double freeing of async event data
	drm/amd/display: Add link_rate quirk for Apple 15" MBP 2017
	drm/bochs: downgrade pci_request_region failure from error to warning
	initramfs: restore default compression behavior
	drm/amdgpu: fix typo for vcn1 idle check
	tools/power turbostat: Fix gcc build warnings
	tools/power turbostat: Fix missing SYS_LPI counter on some Chromebooks
	drm/etnaviv: replace MMU flush marker with flush sequence
	media: rc: IR signal for Panasonic air conditioner too long
	misc: rtsx: set correct pcr_ops for rts522A
	misc: pci_endpoint_test: Fix to support > 10 pci-endpoint-test devices
	misc: pci_endpoint_test: Avoid using module parameter to determine irqtype
	coresight: do not use the BIT() macro in the UAPI header
	mei: me: add cedar fork device ids
	extcon: axp288: Add wakeup support
	power: supply: axp288_charger: Add special handling for HP Pavilion x2 10
	ALSA: hda/ca0132 - Add Recon3Di quirk to handle integrated sound on EVGA X99 Classified motherboard
	rxrpc: Fix sendmsg(MSG_WAITALL) handling
	net: Fix Tx hash bound checking
	padata: always acquire cpu_hotplug_lock before pinst->lock
	bitops: protect variables in set_mask_bits() macro
	include/linux/notifier.h: SRCU: fix ctags
	mm: mempolicy: require at least one nodeid for MPOL_PREFERRED
	ipv6: don't auto-add link-local address to lag ports
	net: dsa: bcm_sf2: Do not register slave MDIO bus with OF
	net: dsa: bcm_sf2: Ensure correct sub-node is parsed
	net: phy: micrel: kszphy_resume(): add delay after genphy_resume() before accessing PHY registers
	net: stmmac: dwmac1000: fix out-of-bounds mac address reg setting
	slcan: Don't transmit uninitialized stack data in padding
	mlxsw: spectrum_flower: Do not stop at FLOW_ACTION_VLAN_MANGLE
	random: always use batched entropy for get_random_u{32,64}
	usb: dwc3: gadget: Wrap around when skip TRBs
	tools/accounting/getdelays.c: fix netlink attribute length
	hwrng: imx-rngc - fix an error path
	ASoC: jz4740-i2s: Fix divider written at incorrect offset in register
	IB/hfi1: Call kobject_put() when kobject_init_and_add() fails
	IB/hfi1: Fix memory leaks in sysfs registration and unregistration
	ceph: remove the extra slashes in the server path
	ceph: canonicalize server path in place
	RDMA/ucma: Put a lock around every call to the rdma_cm layer
	RDMA/cma: Teach lockdep about the order of rtnl and lock
	Bluetooth: RFCOMM: fix ODEBUG bug in rfcomm_dev_ioctl
	RDMA/cm: Update num_paths in cma_resolve_iboe_route error flow
	fbcon: fix null-ptr-deref in fbcon_switch
	clk: qcom: rcg: Return failure for RCG update
	drm/msm: stop abusing dma_map/unmap for cache
	arm64: Fix size of __early_cpu_boot_status
	rpmsg: glink: Remove chunk size word align warning
	usb: dwc3: don't set gadget->is_otg flag
	drm_dp_mst_topology: fix broken drm_dp_sideband_parse_remote_dpcd_read()
	drm/msm: Use the correct dma_sync calls in msm_gem
	Linux 4.19.115

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Idc17d8aa387491167efc60df0a9764b82e4344da
2020-04-13 13:09:17 +02:00
Greg Kroah-Hartman
6dd0e32665 Linux 4.19.115 2020-04-13 10:45:17 +02:00
Rob Clark
39718d086d drm/msm: Use the correct dma_sync calls in msm_gem
commit 3de433c5b38af49a5fc7602721e2ab5d39f1e69c upstream.

[subject was: drm/msm: shake fist angrily at dma-mapping]

So, using dma_sync_* for our cache needs works out w/ dma iommu ops, but
it falls appart with dma direct ops.  The problem is that, depending on
display generation, we can have either set of dma ops (mdp4 and dpu have
iommu wired to mdss node, which maps to toplevel drm device, but mdp5
has iommu wired up to the mdp sub-node within mdss).

Fixes this splat on mdp5 devices:

   Unable to handle kernel paging request at virtual address ffffffff80000000
   Mem abort info:
     ESR = 0x96000144
     Exception class = DABT (current EL), IL = 32 bits
     SET = 0, FnV = 0
     EA = 0, S1PTW = 0
   Data abort info:
     ISV = 0, ISS = 0x00000144
     CM = 1, WnR = 1
   swapper pgtable: 4k pages, 48-bit VAs, pgdp=00000000810e4000
   [ffffffff80000000] pgd=0000000000000000
   Internal error: Oops: 96000144 [#1] SMP
   Modules linked in: btqcomsmd btqca bluetooth cfg80211 ecdh_generic ecc rfkill libarc4 panel_simple msm wcnss_ctrl qrtr_smd drm_kms_helper venus_enc venus_dec videobuf2_dma_sg videobuf2_memops drm venus_core ipv6 qrtr qcom_wcnss_pil v4l2_mem2mem qcom_sysmon videobuf2_v4l2 qmi_helpers videobuf2_common crct10dif_ce mdt_loader qcom_common videodev qcom_glink_smem remoteproc bmc150_accel_i2c bmc150_magn_i2c bmc150_accel_core bmc150_magn snd_soc_lpass_apq8016 snd_soc_msm8916_analog mms114 mc nf_defrag_ipv6 snd_soc_lpass_cpu snd_soc_apq8016_sbc industrialio_triggered_buffer kfifo_buf snd_soc_lpass_platform snd_soc_msm8916_digital drm_panel_orientation_quirks
   CPU: 2 PID: 33 Comm: kworker/2:1 Not tainted 5.3.0-rc2 #1
   Hardware name: Samsung Galaxy A5U (EUR) (DT)
   Workqueue: events deferred_probe_work_func
   pstate: 80000005 (Nzcv daif -PAN -UAO)
   pc : __clean_dcache_area_poc+0x20/0x38
   lr : arch_sync_dma_for_device+0x28/0x30
   sp : ffff0000115736a0
   x29: ffff0000115736a0 x28: 0000000000000001
   x27: ffff800074830800 x26: ffff000011478000
   x25: 0000000000000000 x24: 0000000000000001
   x23: ffff000011478a98 x22: ffff800009fd1c10
   x21: 0000000000000001 x20: ffff800075ad0a00
   x19: 0000000000000000 x18: ffff0000112b2000
   x17: 0000000000000000 x16: 0000000000000000
   x15: 00000000fffffff0 x14: ffff000011455d70
   x13: 0000000000000000 x12: 0000000000000028
   x11: 0000000000000001 x10: ffff00001106c000
   x9 : ffff7e0001d6b380 x8 : 0000000000001000
   x7 : ffff7e0001d6b380 x6 : ffff7e0001d6b382
   x5 : 0000000000000000 x4 : 0000000000001000
   x3 : 000000000000003f x2 : 0000000000000040
   x1 : ffffffff80001000 x0 : ffffffff80000000
   Call trace:
    __clean_dcache_area_poc+0x20/0x38
    dma_direct_sync_sg_for_device+0xb8/0xe8
    get_pages+0x22c/0x250 [msm]
    msm_gem_get_and_pin_iova+0xdc/0x168 [msm]
    ...

Fixes the combination of two patches:

Fixes: 0036bc73ccbe (drm/msm: stop abusing dma_map/unmap for cache)
Fixes: 449fa54d6815 (dma-direct: correct the physical addr in dma_direct_sync_sg_for_cpu/device)
Tested-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Rob Clark <robdclark@chromium.org>
[seanpaul changed subject to something more desriptive]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190730214633.17820-1-robdclark@gmail.com
Cc: nobuhiro1.iwamatsu@toshiba.co.jp
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:17 +02:00
Hans Verkuil
329ef07f7f drm_dp_mst_topology: fix broken drm_dp_sideband_parse_remote_dpcd_read()
commit a4c30a4861c54af78c4eb8b7855524c1a96d9f80 upstream.

When parsing the reply of a DP_REMOTE_DPCD_READ DPCD command the
result is wrong due to a missing idx increment.

This was never noticed since DP_REMOTE_DPCD_READ is currently not
used, but if you enable it, then it is all wrong.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/e72ddac2-1dc0-100a-d816-9ac98ac009dd@xs4all.nl
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:17 +02:00
Roger Quadros
b0434aaec7 usb: dwc3: don't set gadget->is_otg flag
commit c09b73cfac2a9317f1104169045c519c6021aa1d upstream.

This reverts
commit 6a4290cc28 ("usb: dwc3: gadget: set the OTG flag in dwc3 gadget driver.")

We don't yet support any of the OTG mechanisms (HNP/SRP/ADP)
and are not setting gadget->otg_caps, so don't set gadget->is_otg
flag.

If we do then we end up publishing a OTG1.0 descriptor in
the gadget descriptor which causes device enumeration to fail
if we are connected to a host with CONFIG_USB_OTG enabled.

Host side log without this patch

[   96.720453] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[   96.901391] usb 1-1: Dual-Role OTG device on non-HNP port
[   96.907552] usb 1-1: set a_alt_hnp_support failed: -32
[   97.060447] usb 1-1: new high-speed USB device number 3 using xhci-hcd
[   97.241378] usb 1-1: Dual-Role OTG device on non-HNP port
[   97.247536] usb 1-1: set a_alt_hnp_support failed: -32
[   97.253606] usb usb1-port1: attempt power cycle
[   97.960449] usb 1-1: new high-speed USB device number 4 using xhci-hcd
[   98.141383] usb 1-1: Dual-Role OTG device on non-HNP port
[   98.147540] usb 1-1: set a_alt_hnp_support failed: -32
[   98.300453] usb 1-1: new high-speed USB device number 5 using xhci-hcd
[   98.481391] usb 1-1: Dual-Role OTG device on non-HNP port
[   98.487545] usb 1-1: set a_alt_hnp_support failed: -32
[   98.493532] usb usb1-port1: unable to enumerate USB device

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:16 +02:00
Chris Lew
7abfe9914d rpmsg: glink: Remove chunk size word align warning
commit f0beb4ba9b185d497c8efe7b349363700092aee0 upstream.

It is possible for the chunk sizes coming from the non RPM remote procs
to not be word aligned. Remove the alignment warning and continue to
read from the FIFO so execution is not stalled.

Signed-off-by: Chris Lew <clew@codeaurora.org>
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:16 +02:00
Arun KS
31f7497ca5 arm64: Fix size of __early_cpu_boot_status
commit 61cf61d81e326163ce1557ceccfca76e11d0e57c upstream.

__early_cpu_boot_status is of type long. Use quad
assembler directive to allocate proper size.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Arun KS <arunks@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:16 +02:00
Rob Clark
9c23e00804 drm/msm: stop abusing dma_map/unmap for cache
commit 0036bc73ccbe7e600a3468bf8e8879b122252274 upstream.

Recently splats like this started showing up:

   WARNING: CPU: 4 PID: 251 at drivers/iommu/dma-iommu.c:451 __iommu_dma_unmap+0xb8/0xc0
   Modules linked in: ath10k_snoc ath10k_core fuse msm ath mac80211 uvcvideo cfg80211 videobuf2_vmalloc videobuf2_memops vide
   CPU: 4 PID: 251 Comm: kworker/u16:4 Tainted: G        W         5.2.0-rc5-next-20190619+ #2317
   Hardware name: LENOVO 81JL/LNVNB161216, BIOS 9UCN23WW(V1.06) 10/25/2018
   Workqueue: msm msm_gem_free_work [msm]
   pstate: 80c00005 (Nzcv daif +PAN +UAO)
   pc : __iommu_dma_unmap+0xb8/0xc0
   lr : __iommu_dma_unmap+0x54/0xc0
   sp : ffff0000119abce0
   x29: ffff0000119abce0 x28: 0000000000000000
   x27: ffff8001f9946648 x26: ffff8001ec271068
   x25: 0000000000000000 x24: ffff8001ea3580a8
   x23: ffff8001f95ba010 x22: ffff80018e83ba88
   x21: ffff8001e548f000 x20: fffffffffffff000
   x19: 0000000000001000 x18: 00000000c00001fe
   x17: 0000000000000000 x16: 0000000000000000
   x15: ffff000015b70068 x14: 0000000000000005
   x13: 0003142cc1be1768 x12: 0000000000000001
   x11: ffff8001f6de9100 x10: 0000000000000009
   x9 : ffff000015b78000 x8 : 0000000000000000
   x7 : 0000000000000001 x6 : fffffffffffff000
   x5 : 0000000000000fff x4 : ffff00001065dbc8
   x3 : 000000000000000d x2 : 0000000000001000
   x1 : fffffffffffff000 x0 : 0000000000000000
   Call trace:
    __iommu_dma_unmap+0xb8/0xc0
    iommu_dma_unmap_sg+0x98/0xb8
    put_pages+0x5c/0xf0 [msm]
    msm_gem_free_work+0x10c/0x150 [msm]
    process_one_work+0x1e0/0x330
    worker_thread+0x40/0x438
    kthread+0x12c/0x130
    ret_from_fork+0x10/0x18
   ---[ end trace afc0dc5ab81a06bf ]---

Not quite sure what triggered that, but we really shouldn't be abusing
dma_{map,unmap}_sg() for cache maint.

Cc: Stephen Boyd <sboyd@kernel.org>
Tested-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190630124735.27786-1-robdclark@gmail.com
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:15 +02:00
Taniya Das
aa586e25e2 clk: qcom: rcg: Return failure for RCG update
commit 21ea4b62e1f3dc258001a68da98c9663a9dbd6c7 upstream.

In case of update config failure, return -EBUSY, so that consumers could
handle the failure gracefully.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
Link: https://lkml.kernel.org/r/1557339895-21952-2-git-send-email-tdas@codeaurora.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:15 +02:00
Qiujun Huang
e9944eb667 fbcon: fix null-ptr-deref in fbcon_switch
commit b139f8b00db4a8ea75a4174346eafa48041aa489 upstream.

Set logo_shown to FBCON_LOGO_CANSHOW when the vc was deallocated.

syzkaller report: https://lkml.org/lkml/2020/3/27/403
general protection fault, probably for non-canonical address
0xdffffc000000006c: 0000 [#1] SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000360-0x0000000000000367]
RIP: 0010:fbcon_switch+0x28f/0x1740
drivers/video/fbdev/core/fbcon.c:2260

Call Trace:
redraw_screen+0x2a8/0x770 drivers/tty/vt/vt.c:1008
vc_do_resize+0xfe7/0x1360 drivers/tty/vt/vt.c:1295
fbcon_init+0x1221/0x1ab0 drivers/video/fbdev/core/fbcon.c:1219
visual_init+0x305/0x5c0 drivers/tty/vt/vt.c:1062
do_bind_con_driver+0x536/0x890 drivers/tty/vt/vt.c:3542
do_take_over_console+0x453/0x5b0 drivers/tty/vt/vt.c:4122
do_fbcon_takeover+0x10b/0x210 drivers/video/fbdev/core/fbcon.c:588
fbcon_fb_registered+0x26b/0x340 drivers/video/fbdev/core/fbcon.c:3259
do_register_framebuffer drivers/video/fbdev/core/fbmem.c:1664 [inline]
register_framebuffer+0x56e/0x980 drivers/video/fbdev/core/fbmem.c:1832
dlfb_usb_probe.cold+0x1743/0x1ba3 drivers/video/fbdev/udlfb.c:1735
usb_probe_interface+0x310/0x800 drivers/usb/core/driver.c:374

accessing vc_cons[logo_shown].d->vc_top causes the bug.

Reported-by: syzbot+732528bae351682f1f27@syzkaller.appspotmail.com
Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200329085647.25133-1-hqjagain@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:14 +02:00
Avihai Horon
e2db80e0a7 RDMA/cm: Update num_paths in cma_resolve_iboe_route error flow
commit 987914ab841e2ec281a35b54348ab109b4c0bb4e upstream.

After a successful allocation of path_rec, num_paths is set to 1, but any
error after such allocation will leave num_paths uncleared.

This causes to de-referencing a NULL pointer later on. Hence, num_paths
needs to be set back to 0 if such an error occurs.

The following crash from syzkaller revealed it.

  kasan: CONFIG_KASAN_INLINE enabled
  kasan: GPF could be caused by NULL-ptr deref or user memory access
  general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN PTI
  CPU: 0 PID: 357 Comm: syz-executor060 Not tainted 4.18.0+ #311
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
  rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/2014
  RIP: 0010:ib_copy_path_rec_to_user+0x94/0x3e0
  Code: f1 f1 f1 f1 c7 40 0c 00 00 f4 f4 65 48 8b 04 25 28 00 00 00 48 89
  45 c8 31 c0 e8 d7 60 24 ff 48 8d 7b 4c 48 89 f8 48 c1 e8 03 <42> 0f b6
  14 30 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85
  RSP: 0018:ffff88006586f980 EFLAGS: 00010207
  RAX: 0000000000000009 RBX: 0000000000000000 RCX: 1ffff1000d5fe475
  RDX: ffff8800621e17c0 RSI: ffffffff820d45f9 RDI: 000000000000004c
  RBP: ffff88006586fa50 R08: ffffed000cb0df73 R09: ffffed000cb0df72
  R10: ffff88006586fa70 R11: ffffed000cb0df73 R12: 1ffff1000cb0df30
  R13: ffff88006586fae8 R14: dffffc0000000000 R15: ffff88006aff2200
  FS: 00000000016fc880(0000) GS:ffff88006d000000(0000)
  knlGS:0000000000000000
  CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000020000040 CR3: 0000000063fec000 CR4: 00000000000006b0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  Call Trace:
  ? ib_copy_path_rec_from_user+0xcc0/0xcc0
  ? __mutex_unlock_slowpath+0xfc/0x670
  ? wait_for_completion+0x3b0/0x3b0
  ? ucma_query_route+0x818/0xc60
  ucma_query_route+0x818/0xc60
  ? ucma_listen+0x1b0/0x1b0
  ? sched_clock_cpu+0x18/0x1d0
  ? sched_clock_cpu+0x18/0x1d0
  ? ucma_listen+0x1b0/0x1b0
  ? ucma_write+0x292/0x460
  ucma_write+0x292/0x460
  ? ucma_close_id+0x60/0x60
  ? sched_clock_cpu+0x18/0x1d0
  ? sched_clock_cpu+0x18/0x1d0
  __vfs_write+0xf7/0x620
  ? ucma_close_id+0x60/0x60
  ? kernel_read+0x110/0x110
  ? time_hardirqs_on+0x19/0x580
  ? lock_acquire+0x18b/0x3a0
  ? finish_task_switch+0xf3/0x5d0
  ? _raw_spin_unlock_irq+0x29/0x40
  ? _raw_spin_unlock_irq+0x29/0x40
  ? finish_task_switch+0x1be/0x5d0
  ? __switch_to_asm+0x34/0x70
  ? __switch_to_asm+0x40/0x70
  ? security_file_permission+0x172/0x1e0
  vfs_write+0x192/0x460
  ksys_write+0xc6/0x1a0
  ? __ia32_sys_read+0xb0/0xb0
  ? entry_SYSCALL_64_after_hwframe+0x3e/0xbe
  ? do_syscall_64+0x1d/0x470
  do_syscall_64+0x9e/0x470
  entry_SYSCALL_64_after_hwframe+0x49/0xbe

Fixes: 3c86aa70bf ("RDMA/cm: Add RDMA CM support for IBoE devices")
Link: https://lore.kernel.org/r/20200318101741.47211-1-leon@kernel.org
Signed-off-by: Avihai Horon <avihaih@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:14 +02:00
Qiujun Huang
78a4ad2860 Bluetooth: RFCOMM: fix ODEBUG bug in rfcomm_dev_ioctl
commit 71811cac8532b2387b3414f7cd8fe9e497482864 upstream.

Needn't call 'rfcomm_dlc_put' here, because 'rfcomm_dlc_exists' didn't
increase dlc->refcnt.

Reported-by: syzbot+4496e82090657320efc6@syzkaller.appspotmail.com
Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
Suggested-by: Hillf Danton <hdanton@sina.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:14 +02:00
Jason Gunthorpe
ee433d1cde RDMA/cma: Teach lockdep about the order of rtnl and lock
commit 32ac9e4399b12d3e54d312a0e0e30ed5cd19bd4e upstream.

This lock ordering only happens when bonding is enabled and a certain
bonding related event fires. However, since it can happen this is a global
restriction on lock ordering.

Teach lockdep about the order directly and unconditionally so bugs here
are found quickly.

See https://syzkaller.appspot.com/bug?extid=55de90ab5f44172b0c90

Link: https://lore.kernel.org/r/20200227203651.GA27185@ziepe.ca
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:13 +02:00
Jason Gunthorpe
abc4ea7f13 RDMA/ucma: Put a lock around every call to the rdma_cm layer
commit 7c11910783a1ea17e88777552ef146cace607b3c upstream.

The rdma_cm must be used single threaded.

This appears to be a bug in the design, as it does have lots of locking
that seems like it should allow concurrency. However, when it is all said
and done every single place that uses the cma_exch() scheme is broken, and
all the unlocked reads from the ucma of the cm_id data are wrong too.

syzkaller has been finding endless bugs related to this.

Fixing this in any elegant way is some enormous amount of work. Take a
very big hammer and put a mutex around everything to do with the
ucma_context at the top of every syscall.

Fixes: 7521663857 ("RDMA/cma: Export rdma cm interface to userspace")
Link: https://lore.kernel.org/r/20200218210432.GA31966@ziepe.ca
Reported-by: syzbot+adb15cf8c2798e4e0db4@syzkaller.appspotmail.com
Reported-by: syzbot+e5579222b6a3edd96522@syzkaller.appspotmail.com
Reported-by: syzbot+4b628fcc748474003457@syzkaller.appspotmail.com
Reported-by: syzbot+29ee8f76017ce6cf03da@syzkaller.appspotmail.com
Reported-by: syzbot+6956235342b7317ec564@syzkaller.appspotmail.com
Reported-by: syzbot+b358909d8d01556b790b@syzkaller.appspotmail.com
Reported-by: syzbot+6b46b135602a3f3ac99e@syzkaller.appspotmail.com
Reported-by: syzbot+8458d13b13562abf6b77@syzkaller.appspotmail.com
Reported-by: syzbot+bd034f3fdc0402e942ed@syzkaller.appspotmail.com
Reported-by: syzbot+c92378b32760a4eef756@syzkaller.appspotmail.com
Reported-by: syzbot+68b44a1597636e0b342c@syzkaller.appspotmail.com
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:12 +02:00
Ilya Dryomov
4eeddc6229 ceph: canonicalize server path in place
commit b27a939e8376a3f1ed09b9c33ef44d20f18ec3d0 upstream.

syzbot reported that 4fbc0c711b24 ("ceph: remove the extra slashes in
the server path") had caused a regression where an allocation could be
done under a spinlock -- compare_mount_options() is called by sget_fc()
with sb_lock held.

We don't really need the supplied server path, so canonicalize it
in place and compare it directly.  To make this work, the leading
slash is kept around and the logic in ceph_real_mount() to skip it
is restored.  CEPH_MSG_CLIENT_SESSION now reports the same (i.e.
canonicalized) path, with the leading slash of course.

Fixes: 4fbc0c711b24 ("ceph: remove the extra slashes in the server path")
Reported-by: syzbot+98704a51af8e3d9425a9@syzkaller.appspotmail.com
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:12 +02:00