Commit graph

883,466 commits

Author SHA1 Message Date
Will Deacon
82262d09f1 ANDROID: usb: f_accessory: Remove useless non-debug prints
Remove some useless print statements, as they can trivially be used to
spam the console and don't report anything meaningful.

Bug: 173789633
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I28052010fc3ec033a2c99efeb3f6c919d54d75c2
Signed-off-by: Giuliano Procida <gprocida@google.com>
2021-01-06 09:21:16 +00:00
Will Deacon
4df304a4df ANDROID: usb: f_accessory: Remove stale comments
Neither acc_gadget_bind() nor acc_gadget_register_driver() exist, so
remove the stale comments that refer to them.

Bug: 173789633
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: If396ba3bcac3ca59c48e5a5faa0a8520534ed625
Signed-off-by: Giuliano Procida <gprocida@google.com>
2021-01-06 09:21:16 +00:00
Vijayavardhan Vennapusa
a917582672 ANDROID: USB: f_accessory: Check dev pointer before decoding ctrl request
In case of poweroff charging mode, accessory function instance
is not created and due to this, _acc_dev will be NULL. If target
is connected to Accessory dock in poweroff charging mode, there
is a chance dev pointer is accessed, which is NULL. Hence add a
check before processing control request and return error if it is
NULL.

Bug: 141002587
Change-Id: I4f1deb9d764b8c0bd1d7837cbc43a2933167f568
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Giuliano Procida <gprocida@google.com>
2021-01-06 09:21:16 +00:00
Roman Kiryanov
d61ede24cb ANDROID: Update abi_gki_aarch64_goldfish
Fixes `virtio_wifi: Unknown symbol ieee80211_tx_status_ext (err -2)`

build/abi/extract_symbols out/android11-5.4/dist/ --whitelist common/android/abi_gki_aarch64_goldfish

Bug: 176831960
Test: none
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I07671dd29079588cad5e3984427a8ca0ad389e9a
2021-01-05 16:39:01 -08:00
Saravana Kannan
c29fbd7cd7 UPSTREAM: driver core: Fix lockdep warning on wfs_lock
There's a potential deadlock with the following cycle:
wfs_lock --> device_links_lock --> kn->count

Fix this by simply dropping the lock around a list_empty() check that's
just exported to a sysfs file. The sysfs file output is an instantaneous
check anyway and the lock doesn't really add any protection.

Lockdep log:

[   48.808132]
[   48.808132] the existing dependency chain (in reverse order) is:
[   48.809069]
[   48.809069] -> #2 (kn->count){++++}:
[   48.809707]        __kernfs_remove.llvm.7860393000964815146+0x2d4/0x460
[   48.810537]        kernfs_remove_by_name_ns+0x54/0x9c
[   48.811171]        sysfs_remove_file_ns+0x18/0x24
[   48.811762]        device_del+0x2b8/0x5a8
[   48.812269]        __device_link_del+0x98/0xb8
[   48.812829]        device_links_driver_bound+0x210/0x2d8
[   48.813496]        driver_bound+0x44/0xf8
[   48.814000]        really_probe+0x340/0x6e0
[   48.814526]        driver_probe_device+0xb8/0x100
[   48.815117]        device_driver_attach+0x78/0xb8
[   48.815708]        __driver_attach+0xe0/0x194
[   48.816255]        bus_for_each_dev+0xa8/0x11c
[   48.816816]        driver_attach+0x24/0x30
[   48.817331]        bus_add_driver+0x100/0x1e0
[   48.817880]        driver_register+0x78/0x114
[   48.818427]        __platform_driver_register+0x44/0x50
[   48.819089]        0xffffffdbb3227038
[   48.819551]        do_one_initcall+0xd8/0x1e0
[   48.820099]        do_init_module+0xd8/0x298
[   48.820636]        load_module+0x3afc/0x44c8
[   48.821173]        __arm64_sys_finit_module+0xbc/0xf0
[   48.821807]        el0_svc_common+0xbc/0x1d0
[   48.822344]        el0_svc_handler+0x74/0x98
[   48.822882]        el0_svc+0x8/0xc
[   48.823310]
[   48.823310] -> #1 (device_links_lock){+.+.}:
[   48.824036]        __mutex_lock_common+0xe0/0xe44
[   48.824626]        mutex_lock_nested+0x28/0x34
[   48.825185]        device_link_add+0xd4/0x4ec
[   48.825734]        of_link_to_suppliers+0x158/0x204
[   48.826347]        of_fwnode_add_links+0x50/0x64
[   48.826928]        device_link_add_missing_supplier_links+0x90/0x11c
[   48.827725]        fw_devlink_resume+0x58/0x130
[   48.828296]        of_platform_default_populate_init+0xb4/0xd0
[   48.829030]        do_one_initcall+0xd8/0x1e0
[   48.829578]        do_initcall_level+0xb8/0xcc
[   48.830137]        do_basic_setup+0x60/0x7c
[   48.830662]        kernel_init_freeable+0x128/0x1ac
[   48.831275]        kernel_init+0x18/0x29c
[   48.831781]        ret_from_fork+0x10/0x18
[   48.832297]
[   48.832297] -> #0 (wfs_lock){+.+.}:
[   48.832922]        __lock_acquire+0xe04/0x2e20
[   48.833480]        lock_acquire+0xbc/0xec
[   48.833984]        __mutex_lock_common+0xe0/0xe44
[   48.834577]        mutex_lock_nested+0x28/0x34
[   48.835136]        waiting_for_supplier_show+0x3c/0x98
[   48.835781]        dev_attr_show+0x48/0xb4
[   48.836295]        sysfs_kf_seq_show+0xe8/0x184
[   48.836864]        kernfs_seq_show+0x48/0x8c
[   48.837401]        seq_read+0x1c8/0x600
[   48.837884]        kernfs_fop_read+0x68/0x204
[   48.838431]        __vfs_read+0x60/0x214
[   48.838925]        vfs_read+0xbc/0x15c
[   48.839397]        ksys_read+0x78/0xe4
[   48.839869]        __arm64_sys_read+0x1c/0x28
[   48.840416]        el0_svc_common+0xbc/0x1d0
[   48.840953]        el0_svc_handler+0x74/0x98
[   48.841490]        el0_svc+0x8/0xc
[   48.841917]
[   48.841917] other info that might help us debug this:
[   48.841917]
[   48.842920] Chain exists of:
[   48.842920]   wfs_lock --> device_links_lock --> kn->count
[   48.842920]
[   48.844152]  Possible unsafe locking scenario:
[   48.844152]
[   48.844895]        CPU0                    CPU1
[   48.845463]        ----                    ----
[   48.846032]   lock(kn->count);
[   48.846417]                                lock(device_links_lock);
[   48.847203]                                lock(kn->count);
[   48.847902]   lock(wfs_lock);
[   48.848276]
[   48.848276]  *** DEADLOCK ***

Reported-by: Cheng-Jui.Wang@mediatek.com
Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20201104205431.3795207-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 171536500
(cherry picked from commit 7008e58c63bc8468e8d16154e25d780198b3ecfc)
Change-Id: Icb98a270d6ff07bcc81a2162ac00493fae6fafe6
2021-01-05 23:13:30 +00:00
Jeehong Kim
f85485b301 ANDROID: ABI: update allowed list for galaxy
Leaf changes summary: 3 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 2 Added variables

1 Added function:

  [A] 'function int tracepoint_probe_unregister(tracepoint*, void*, void*)'

2 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_wq_lockup_pool'
  [A] 'rq runqueues'

Bug: 175649831

Signed-off-by: Jeehong Kim <jhez.kim@samsung.com>
Change-Id: I2e0c8591188e68f82bfbe97acba02aee875f9621
2021-01-04 01:25:39 +00:00
Will Deacon
a9911f2a9a UPSTREAM: arm64: pgtable: Fix pte_accessible()
pte_accessible() is used by ptep_clear_flush() to figure out whether TLB
invalidation is necessary when unmapping pages for reclaim. Although our
implementation is correct according to the architecture, returning true
only for valid, young ptes in the absence of racing page-table
modifications, this is in fact flawed due to lazy invalidation of old
ptes in ptep_clear_flush_young() where we elide the expensive DSB
instruction for completing the TLB invalidation.

Rather than penalise the aging path, adjust pte_accessible() to return
true for any valid pte, even if the access flag is cleared.

Bug: 176475096
Change-Id: Ifd7919b4e9b790a94802b0115f93a9a260757036
Cc: <stable@vger.kernel.org>
Fixes: 76c714be0e ("arm64: pgtable: implement pte_accessible()")
Reported-by: Yu Zhao <yuzhao@google.com>
Acked-by: Yu Zhao <yuzhao@google.com>
Reviewed-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20201120143557.6715-2-will@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
(cherry picked from commit 07509e10dcc77627f8b6a57381e878fe269958d3)
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-12-29 10:00:50 -08:00
Zhiqiang Tu
032e643834 ANDROID: ABI: Update allowed list for QCOM
Leaf changes summary: 0 artifact changed
Changed leaf types summary: 0 leaf type 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

Bug: 176306856
Change-Id: I52e0bbea0f41d97ca4241f6309babfad7dac82f8
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2020-12-28 14:20:02 +00:00
jian.gong
8038bc2bb9 ANDROID: ABI: add symbols of __dynamic_netdev_dbg to unisoc
Add symbols of __dynamic_netdev_dbg to unisoc,
and updates the ABI representation accordingly.

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function void __dynamic_netdev_dbg(_ddebug*, const net_device*, const char*, ...)'

Bug: 160255258
Change-Id: I357d2f430fbe76f061fbc85919eaba9f95ce7e2e
Signed-off-by: jian.gong <jian.gong@unisoc.com>
2020-12-24 19:43:37 +08:00
Chanho Park
662e2b3ab8 ANDROID: ABI: add allowed GKI symbol for Exynosauto SoC
This patch adds below two symbols to GKI allowed symbol list.

- pcie_get_mps: get PCI Express maximum payload size for PCIe EP and RC
- platform_find_device_by_driver: To find a platform device which are
matched with exynos DRM driver

Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 0 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 int pcie_get_mps(pci_dev*)'
  [A] 'function device* platform_find_device_by_driver(device*, const device_driver*)'

Bug: 176138611
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: Ib06675b7431f247071f873fa8e44a7e5b90e764a
2020-12-22 17:16:35 +00:00
Chanho Park
64eade86ae ANDROID: ABI: update allowed list for exynosauto SoC
This patch is for updating GKI allowed symbol list without adding any
new symbol. Next patch will introduce newly added symbols for Exynosauto
SoC GKI vendor modules. To avoid unnecessary symbols, this patch also
adds "preserved by --additions-only" even though we don't need them
anymore.

Bug: 176138611
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: I9fa9eb313ef1e2aeb8c853bae1c8cde18cdd9188
2020-12-22 17:16:18 +00:00
jian.gong
cf6a51d18b ANDROID: ABI: add symbols of gpiod_get to unisoc
Add symbols of gpiod_get to unisoc,
and updates the ABI representation accordingly.

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function gpio_desc* gpiod_get(device*, const char*, gpiod_flags)'

Bug: 160255258
Change-Id: I899fc91f196d8c31a2fa9adeb626ba08478bf39c
Signed-off-by: jian.gong <jian.gong@unisoc.com>
2020-12-22 16:55:41 +00:00
Macpaul Lin
9885e7fec0 ANDROID: usb: gadget: f_accessory: fix CTS test stuck
f_accessory: fix CTS test stuck since CTS 9.0.
 - Refine acc_read() process.

The data length that user (test program) wants to read is different
from they really requested. This will cause the test flow stuck on the
2nd or the 3rd transfers in accessory test.
(By connecting 2 phones with CtsVerifier.apk and
CtsVerifierUSBCompanion.apk installed.)

Bug: 174729307

Change-Id: I5367c8075ed37534e8bed94b60cc79135ae5aebc
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
2020-12-21 18:59:01 +08:00
Chanho Park
be72a6b8ee ANDROID: ABI: add allowed list for Exynosauto SoC
This patch is the first trial to upload GKI symbol list for running
android as VM on type1 hypervisor. Unlike traditional device driver,
para-virtualized drivers for hypervisor tend to use more core symbols.

- ioremap_cache: to skip cached mapping for io remap

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function void* ioremap_cache(long long unsigned int, unsigned long int)'

Bug: 175289068
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: Ia3f0073065ad2da481cce10dd882d7de093b1de3
2020-12-16 13:29:57 +09:00
Chanho Park
ae8d097e36 ANDROID: ABI: update allowed list for exynosauto SoC
This patch is for updating GKI allowed symbol list without adding a new
symbol. Next patch will introduce newly added symbols for Exynosauto
SoC GKI vendor modules.

Bug: 175289068
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: I035373ee8f980cd5c03c967d5d2b684150e7fc74
2020-12-16 13:08:18 +09:00
J. Avila
ed5c049cad ANDROID: sched: Export sched_setattr_nocheck
This symbol is needed for certain vendor modules which cannot rely on
only the sysfs interface for uclamp alone.

Bug: 170697030
Signed-off-by: J. Avila <elavila@google.com>
Change-Id: Ic904ade83a45d259cfc95501e6b81e6c5a0e90a0
(cherry picked from commit 0edac9cb95fb2fa292a4b25ac77b125cde28b674)
2020-12-15 19:05:06 +00:00
Charan Teja Reddy
e0b1644a47 BACKPORT: dmabuf: fix NULL pointer dereference in dma_buf_release()
NULL pointer dereference is observed while exporting the dmabuf but
failed to allocate the 'struct file' which results into the dropping
of the allocated dentry corresponding to this file in the dmabuf fs,
which is ending up in dma_buf_release() and accessing the
uninitialzed dentry->d_fsdata.

    Call stack on 5.4 is below:
    dma_buf_release+0x2c/0x254 drivers/dma-buf/dma-buf.c:88
    __dentry_kill+0x294/0x31c fs/dcache.c:584
    dentry_kill fs/dcache.c:673 [inline]
    dput+0x250/0x380 fs/dcache.c:859
    path_put+0x24/0x40 fs/namei.c:485
    alloc_file_pseudo+0x1a4/0x200
    fs/file_table.c:235
    dma_buf_getfile drivers/dma-buf/dma-buf.c:473 [inline]
    dma_buf_export+0x25c/0x3ec
    drivers/dma-buf/dma-buf.c:585

Fix this by checking for the valid pointer in the dentry->d_fsdata.

cherry picked from commit 19a508bd1ad8e444de86873bf2f2b2ab8edd6552

Bug: 175512919

Link: https://patchwork.freedesktop.org/patch/391319/
Change-Id: I3856a387d1902fd2b39b016e81283f082089131c
Cc: <stable@vger.kernel.org> [5.7+]
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Chao Hao <chao.hao@mediatek.com>
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
2020-12-14 16:30:03 +00:00
Sudarshan Rajagopalan
5d835560a3 ANDROID: mm/memblock: export memblock_end_of_DRAM
Export memblock_end_of_DRAM() so that module drivers can know
the physical end address of memory blocks that system booted with.

Bug: 174547201
Change-Id: Ib0c90b736f16d1abbf47d4f3288443c35f9e17b4
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
2020-12-14 06:29:58 +00:00
kaliu
35042a2a91 ANDROID: ABI: Update allowed list for QCOM
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function int pci_dev_present(const pci_device_id*)'

Bug: 175266632
Change-Id: I9dc7e1c258ccdc907e5584bf66ed9d2c39038941
Signed-off-by: Kai Liu <kaliu@codeaurora.org>
Signed-off-by: kaliu <kaliu@codeaurora.org>
2020-12-11 20:54:49 +00:00
Wei Wang
bf9fcff8a8 ANDROID: x86: configs: gki: add missing CONFIG_BLK_CGROUP
Bug: 175265928
Test: Build
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I4902ceee5b533f918e70d37073cb4eb47d35a544
2020-12-11 17:04:27 +00:00
Zhiqiang Tu
9c7d617b7c ANDROID: ABI: Update allowed list for QCOM
Leaf changes summary: 0 artifact changed
Changed leaf types summary: 0 leaf type 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

Bug: 175333697
Change-Id: I03fa6c2d6f71d266ee2352728bf7858b673d2215
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2020-12-11 13:03:00 +00:00
Suren Baghdasaryan
c797384edc ANDROID: kthread: break dependency between worker->lock and task_struct->pi_lock
A number of kthread-related functions indirectly take task_struct->pi_lock
while holding worker->lock in the call chain like this:
    spin_lock(&worker->lock)
    kthread_insert_work
    wake_up_process
    try_to_wake_up
    raw_spin_lock_irqsave(&p->pi_lock, flags)

This lock dependency exists whenever kthread_insert_work is called either
directly or indirectly via __kthread_queue_delayed_work in the following
functions:
    kthread_queue_work
    kthread_delayed_work_timer_fn
    kthread_queue_delayed_work
    kthread_flush_work
    kthread_mod_delayed_work

This creates possibilities for circular dependencies like the one reported
at [1]. Break this lock dependency by moving task wakeup after worker->lock
has been released.

[1]: https://lore.kernel.org/lkml/CAJuCfpG4NkhpQvZjgXZ_3gm6Hf1QgN_eUOQ8iX9Cv1k9whLwSQ@mail.gmail.com

Reported-by: Ke Wang <ke.wang@unisoc.com>
Reported-by: Shakeel Butt <shakeelb@google.com>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>

Link: https://lkml.org/lkml/2020/5/4/1148
Cherry picked instead of commit 461daba06bdcb9c7a3f92b9bbd110e1f7d093ffc
as an alternative solution for the lockdep error that does not break KMI.
Bug: 174875976
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I2478847f66c85dca953846cd77955928d690c97c
2020-12-08 11:48:06 -08:00
Liangcai Fan
9c7cbdf8b4 ANDROID: ABI: add symbols of drm_atomic_helper_setup_commit to unisoc
Add symbols of drm_atomic_helper_setup_commit to unisoc,
and updates the ABI representation accordingly.

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function int drm_atomic_helper_setup_commit(drm_atomic_state*, bool)'

Bug: 160255258
Change-Id: Ia100f1498be053838c9c741aacd1f87a0984ddb9
Signed-off-by: Liangcai Fan <liangcai.fan@unisoc.com>
2020-12-08 09:45:12 +08:00
Jeehong Kim
70f2e8159d ANDROID: ABI: update allowed list for galaxy
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function void cfg80211_sched_scan_stopped_rtnl(wiphy*, u64)'

Bug: 174544020

Signed-off-by: Jeehong Kim <jhez.kim@samsung.com>
Change-Id: Ic339635ea45cdf164417cd6f790ba3df896f50ab
2020-12-07 06:37:03 +00:00
Marc Zyngier
e7eb07515d UPSTREAM: HID: core: Correctly handle ReportSize being zero
commit bce1305c0ece3dc549663605e567655dd701752c upstream.

It appears that a ReportSize value of zero is legal, even if a bit
non-sensical. Most of the HID code seems to handle that gracefully,
except when computing the total size in bytes. When fed as input to
memset, this leads to some funky outcomes.

Detect the corner case and correctly compute the size.

Cc: stable@vger.kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit bce1305c0ece3dc549663605e567655dd701752c)
Change-Id: I5ab5febc22b8d5d8c5d398c3ff93f73cb3c90e05
Signed-off-by: Todd Kjos <tkjos@google.com>
2020-12-04 23:36:51 +00:00
Marc Zyngier
bdf78f318d UPSTREAM: HID: core: Sanitize event code and type when mapping input
commit 35556bed836f8dc07ac55f69c8d17dce3e7f0e25 upstream.

When calling into hid_map_usage(), the passed event code is
blindly stored as is, even if it doesn't fit in the associated bitmap.

This event code can come from a variety of sources, including devices
masquerading as input devices, only a bit more "programmable".

Instead of taking the event code at face value, check that it actually
fits the corresponding bitmap, and if it doesn't:
- spit out a warning so that we know which device is acting up
- NULLify the bitmap pointer so that we catch unexpected uses

Code paths that can make use of untrusted inputs can now check
that the mapping was indeed correct and bail out if not.

Cc: stable@vger.kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 35556bed836f8dc07ac55f69c8d17dce3e7f0e25)
Change-Id: Ie4dc11f43ed1eae2d09feaf9cff17d6d16cf9987
Signed-off-by: Todd Kjos <tkjos@google.com>
2020-12-04 23:13:47 +00:00
Matthias Maennich
cd02993624 FROMLIST: scripts: merge_config: add strict mode to fail upon any redefinition
When merging configuration fragments, it might be of interest to
identify mismatches (redefinitions) programmatically. Hence add the
option -s (strict mode) to instruct merge_config.sh to bail out in
case any redefinition has been detected.

With strict mode, warnings are emitted as before, but the script
terminates with rc=1. If -y is set to define "builtin having
precedence over modules", fragments are still allowed to set =m (while
the base config has =y). Strict mode will tolerate that as demotions
from =y to =m are ignored when setting -y.

Bug: 174454795
Link: https://lore.kernel.org/linux-kbuild/20201202151238.3776616-1-maennich@google.com/
Cc: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: Ib982a87811956e48b718a15680f06474a39dc19d
(cherry picked from commit 32164038495558fbc6d47f36033bac3014f53b8e)
2020-12-03 07:16:08 +00:00
Sami Tolvanen
559c23e691 ANDROID: vmlinux.lds.h: merge compound literal sections
After LLVM rG9e33c096476a ("[ELF] Keep orphan section names
(.rodata.foo .text.foo) unchanged if !hasSectionsCommand"), LLD splits
compound literals to separate sections with -fdata-sections, which
it always enables with LTO. Merge these sections to allow LLVM to be
upgraded.

Bug: 174047799
Change-Id: I858c5fcc48283d5528c1d3e2b2d7a3c72f9e03d6
Link: https://github.com/ClangBuiltLinux/linux/issues/958
Suggested-by: Danny Lin <danny@kdrag0n.dev>
Suggested-by: Fangrui Song <maskray@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2020-12-02 16:39:51 +00:00
Narendra Muppalla
16d99ebeaf ANDROID: ABI: Update allowed list for QCOM
Leaf changes summary: 0 artifact changed
Changed leaf types summary: 0 leaf type 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

Bug: 174461333
Change-Id: If0033c24aca5a9cfb755a0f30ee1ca54815f516d
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
2020-12-01 10:59:17 -08:00
Narendra Muppalla
f4f92f0001 ANDROID: ABI: Update allowed list for QCOM
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function drm_crtc* drm_crtc_from_index(drm_device*, int)'

Bug: 174476670
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Change-Id: Ice526ba5c386d91b2eccf8b48dadb553b816aaa8
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
2020-11-30 10:59:54 -08:00
Archana Sriram
edd53a943b ANDROID: ABI: update allowed list for QCOM
Update the android/abi_gki_aarch64_qcom with recent symbol additions.

Simple change and no need to update the .xml file, as no new symbol
addition.

Bug: 174275677
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>
Change-Id: Ic96fc5d11ab8d21fadbf85658e374e06dde14d0f
2020-11-26 13:58:16 +00:00
Chanho Park
f25343b5e3 ANDROID: GKI: add allowed list for Exynosauto SoC
This patch adds GKI symbol list for Exynosauto SoC. We need to add
below 2 functions to GKI allowed symbol list.

snd_pcm_release_substream
- It's necessary from suspend/resume callback to clean current pcm stream.

unmap_kernel_range
- To unmap which are allocated by map_vm_area

Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 0 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 void snd_pcm_release_substream(snd_pcm_substream*)'
  [A] 'function void unmap_kernel_range(unsigned long int, unsigned long int)'

Bug: 174288561
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: I71058d55bbe10f2ec075e4c2c40291e5357b13a7
2020-11-26 19:37:27 +09:00
Chanho Park
1bd1ff5c96 ANDROID: GKI: update allowed list for Exynosauto SoC
This patch adds to update GKI symbol list for Exynosauto SoC since
adding some drivers as GKI vendor modules.. To review the allowed list
easily, this patch does not include any newly additions of GKI symbols.

Bug: 174288561
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: Iac4910d0c43a07e24e5e4069e3d2f1b3378fce2b
2020-11-26 19:05:44 +09:00
Weilun Du
4271ad6e8a BACKPORT: mac80211_hwsim: add frame transmission support over virtio
This allows communication with external entities.

It also required fixing up the netlink policy, since NLA_UNSPEC
attributes are no longer accepted.

Signed-off-by: Erel Geron <erelx.geron@intel.com>
[port to backports, inline the ID, use 29 as the ID as requested,
 drop != NULL checks, reduce ifdefs]
Link: https://lore.kernel.org/r/20200305143212.c6e4c87d225b.I7ce60bf143e863dcdf0fb8040aab7168ba549b99@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

(cherry picked from commit 5d44fe7c9808c56e136e59147bd932f5491520f1)
Bug: 173808904
Signed-off-by: Weilun Du <wdu@google.com>
Change-Id: I6097464f47460c2383e941594c88637446a77dd5
2020-11-23 17:45:44 +00:00
Liangcai Fan
8e3c3ebe1d ANDROID: ABI: add symbols of sprd_ion.ko and snd-soc-sprd-codec-sc2730.ko to unisoc
Add symbols of sprd_ion.ko and snd-soc-sprd-codec-sc2730.ko to unisoc,
and updates the ABI representation accordingly.

Leaf changes summary: 5 artifacts changed
Changed leaf types summary: 0 leaf type 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

5 Added functions:

  [A] 'function int __kfifo_from_user_r(__kfifo*, void*, unsigned long int, unsigned int*, size_t)'
  [A] 'function int __kfifo_to_user_r(__kfifo*, void*, unsigned long int, unsigned int*, size_t)'
  [A] 'function unsigned int dapm_kcontrol_get_value(const snd_kcontrol*)'
  [A] 'function void* memset32(uint32_t*, uint32_t, size_t)'
  [A] 'function unsigned int snd_pcm_rate_bit_to_rate(unsigned int)'

Bug: 160255258
Change-Id: Id5d8384d4309b43dae6ccf3b8208cf46da7b6781
Signed-off-by: Liangcai Fan <liangcai.fan@unisoc.com>
2020-11-23 15:29:29 +08:00
Neeraj Soni
274fdbe87f ANDROID: ABI: Update allowed list for QCOM
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function bool bio_crypt_should_process(request*)'

Bug: 173684180
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
Change-Id: I0c4b63609d08a11aa6ca38c7afc3327832f31894
2020-11-19 16:56:18 +00:00
hajun.sung
5b622f9fc0 ANDROID: GKI: Update abi_gki_aarch64_exynos
Leaf changes summary: 0 artifact changed
Changed leaf types summary: 0 leaf type 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

Added pci_find_ext_capability symbol

Bug: 173187552
Change-Id: I419ab952f69f1da2b1867ab743da3830238a1912
Signed-off-by: hajun.sung <hajun.sung@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-11-19 16:48:13 +00:00
Martin Wu
fa50448d97 ANDROID: GKI: enable CONFIG_SUN4I_TIMER
Allwinner's SoC timer driver (timer-sun4i.c) has to be built-in rather
than modularized for the following limitations in linux timer framework:
1. tick broadcast installed by insmod cannot switch to oneshot mode
   correctly
2. cpus cannot enter cpuidle state due to the issue above.
3. rcu warnings will appear if we forcibly re-enable tick-broadcast
   for each cpu when new tick broadcast device is installed by insmod
   (timer-sun4i.c in our case)

Bug: 173667601
Change-Id: If077db348c027ec02549e25eee3e17c2cc429644
Signed-off-by: Martin Wu <wuyan@allwinnertech.com>
2020-11-19 05:51:03 +00:00
Connor O'Brien
034d5a95c1 ANDROID: uid_sys_stats: report uid_cputime stats in microseconds
A porting error in commit 0ae8088521d9 ("ANDROID: uid_cputime: Adds
accounting for the cputimes per uid.") caused
/proc/uid_cputime/show_uid_stat to report times in milliseconds
instead of microseconds. Restore the expected behavior.

Bug: 133273154
Bug: 146339763
Signed-off-by: Ed Savage-Jones <edward.savage-jones@sony.com>
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I203919d1d44b300dab91810b16626a6950b063f8
(cherry picked from commit 305d5c197508b80a8dec0ab506de309e5d85fd26)
2020-11-18 23:33:46 +00:00
Sudarsan Ramesh
068c7df5db ANDROID: ABI: Update allowed list for QCOM
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function bool drm_edid_is_valid(edid*)'

Bug: 173583550
Change-Id: I64a212304a4988257c370206adb34c8cfe4a0ab5
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
2020-11-18 20:06:03 +00:00
Ionela Voinescu
b7b866b3aa UPSTREAM: Documentation: arm64: document support for the AMU extension
The activity monitors extension is an optional extension introduced
by the ARMv8.4 CPU architecture.

Add initial documentation for the AMUv1 extension:
 - arm64/amu.txt: AMUv1 documentation
 - arm64/booting.txt: system registers initialisation

Bug: 172781912
Change-Id: I1a892d7aa98ff545a3fe326f5a827337f41ddf19
Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 6abde90881a5ea3a383c0959fdd7f575f95db4b3)
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
2020-11-18 17:58:21 +00:00
Ionela Voinescu
57ab64893e UPSTREAM: arm64/kvm: disable access to AMU registers from kvm guests
Access to the AMU counters should be disabled by default in kvm guests,
as information from the counters might reveal activity in other guests
or activity on the host.

Therefore, disable access to AMU registers from EL0 and EL1 in kvm
guests by:
 - Hiding the presence of the extension in the feature register
   (SYS_ID_AA64PFR0_EL1) on the VCPU.
 - Disabling access to the AMU registers before switching to the guest.
 - Trapping accesses and injecting an undefined instruction into the
   guest.

Bug: 172781912
Change-Id: Ie8048574431dfe00e9d8f59ecbcf51b4c1167000
Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
Cc: James Morse <james.morse@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 4fcdf106a4330bb5c2306a1efbb3af3b7c0db537)
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
2020-11-18 17:57:57 +00:00
Ionela Voinescu
0611858d57 UPSTREAM: arm64: trap to EL1 accesses to AMU counters from EL0
The activity monitors extension is an optional extension introduced
by the ARMv8.4 CPU architecture. In order to access the activity
monitors counters safely, if desired, the kernel should detect the
presence of the extension through the feature register, and mediate
the access.

Therefore, disable direct accesses to activity monitors counters
from EL0 (userspace) and trap them to EL1 (kernel).

To be noted that the ARM64_AMU_EXTN kernel config does not have an
effect on this code. Given that the amuserenr_el0 resets to an
UNKNOWN value, setting the trap of EL0 accesses to EL1 is always
attempted for safety and security considerations. Therefore firmware
should still ensure accesses to AMU registers are not trapped in
EL2/EL3 as this code cannot be bypassed if the CPU implements the
Activity Monitors Unit.

Bug: 172781912
Change-Id: I231595cd2d1e36bfc6abd24559c9c3d13e7eab03
Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
Reviewed-by: James Morse <james.morse@arm.com>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Steve Capper <steve.capper@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 87a1f063464afd934f0f22aac710ca65bef77af3)
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
2020-11-18 17:57:38 +00:00
Ionela Voinescu
30bf0431f1 BACKPORT: arm64: add support for the AMU extension v1
The activity monitors extension is an optional extension introduced
by the ARMv8.4 CPU architecture. This implements basic support for
version 1 of the activity monitors architecture, AMUv1.

This support includes:
- Extension detection on each CPU (boot, secondary, hotplugged)
- Register interface for AMU aarch64 registers

Bug: 172781912
Change-Id: I8fa585dd992213d8042e6f9ddec2cb3bcefade05
Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 2c9d45b43c39e26fd2a73f2203321cdaee98b58b)
[neeraju: Resolved minor conflicts in Kconfig, cpucaps.h, cpufeature.h]
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
2020-11-18 17:57:23 +00:00
Chenggang Wang
1221294815 UPSTREAM: block: fix get_max_io_size()
commit e4b469c66f3cbb81c2e94d31123d7bcdf3c1dabd upstream.

A previous commit aligning splits to physical block sizes inadvertently
modified one return case such that that it now returns 0 length splits
when the number of sectors doesn't exceed the physical offset. This
later hits a BUG in bio_split(). Restore the previous working behavior.

Bug: 173583534
Fixes: 9cc5169cd4 ("block: Improve physical block alignment of split
bios")
Reported-by: Eric Deal <eric.deal@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 173583534
(cherry picked from commit f09dbec9c0)
Signed-off-by: Chenggang Wang <wangchenggang@vivo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5f4708059f106b6ded162cbe096e45bae7a7fca4
2020-11-18 15:26:38 +00:00
Deeksha Gupta
37201331c4 ANDROID: ABI: Update allowed list for QCOM
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function void cfg80211_stop_iface(wiphy*, wireless_dev*, gfp_t)'

Bug: 173561495
Signed-off-by: Deeksha Gupta <deegupta@codeaurora.org>
Change-Id: I8197af49fd23443631b8845859f88e6bfa363ad1
2020-11-18 14:47:25 +00:00
Chris Ye
6d9ab208c5 FROMGIT: Input: Add devices for HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE
Kernel 5.4 introduces HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE, devices
need to be set explicitly with this flag.

Bug: 170072925
Bug: 170126889
Tests: atest android.hardware.input.cts.tests

(cherry picked from commit f59ee399de4a8ca4d7d19cdcabb4b63e94867f09
https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-5.10/upstream-fixes)

Signed-off-by: Chris Ye <lzye@google.com>
Change-Id: I65742e96babc59adde0ab32656850ef4f164ac3e
2020-11-18 11:20:53 +00:00
Chanho Park
09b63a9447 ANDROID: GKI: add allowed list for Exynosauto SoC
This patch adds GKI symbol list for Exynosauto SoC. We need to add
below 10 functions and most of symbols are required by PCIe
EP(End point) driver.

Leaf changes summary: 10 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 10 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

10 Added functions:

  [A] 'function uint32_t drm_of_crtc_port_mask(drm_device*, device_node*)'
  [A] 'function int dw_pcie_ep_init(dw_pcie_ep*)'
  [A] 'function u32 dw_pcie_read_dbi(dw_pcie*, u32, size_t)'
  [A] 'function void dw_pcie_write_dbi(dw_pcie*, u32, size_t, u32)'
  [A] 'function void pci_epc_clear_bar(pci_epc*, u8, pci_epf_bar*)'
  [A] 'function int pci_epc_map_addr(pci_epc*, u8, phys_addr_t, u64, size_t)'
  [A] 'function void* pci_epc_mem_alloc_addr(pci_epc*, phys_addr_t*, size_t)'
  [A] 'function void pci_epc_mem_free_addr(pci_epc*, phys_addr_t, void*, size_t)'
  [A] 'function int pci_epc_set_bar(pci_epc*, u8, pci_epf_bar*)'
  [A] 'function void pci_epc_unmap_addr(pci_epc*, u8, phys_addr_t)'

Bug: 173340486
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: I7411118d2112f10f09405acc1a1461e06ccd9883
2020-11-18 02:15:51 +00:00
Chanho Park
83e8d7513c ANDROID: GKI: update allowed list for Exynosauto SoC
This patch adds to update GKI symbol list for Exynosauto SoC. To review
the allowed list easily, this patch does not include any newly additions
of GKI symbols.

Bug: 173340486
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Change-Id: I6854f5e813845840b4db052282a92f59c6864cc0
2020-11-18 02:15:24 +00:00
Baolin Wang
4e20d65b72 UPSTREAM: mfd: sprd: Add wakeup capability for PMIC IRQ
When changing to use suspend-to-idle to save power, the PMIC irq can not
wakeup the system due to lack of wakeup capability, which will cause
the sub-irqs (such as power key) of the PMIC can not wake up the system.
Thus we can add the wakeup capability for PMIC irq to solve this issue,
as well as removing the IRQF_NO_SUSPEND flag to allow PMIC irq to be
a wakeup source.

Reported-by: Chunyan Zhang <zhang.lyra@gmail.com>
Signed-off-by: Baolin Wang <baolin.wang7@gmail.com>
Tested-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Bug: 173341055
(cherry picked from commit a75bfc824a2d33f57ebdc003bfe6b7a9e11e9cb9)
Signed-off-by: Chunyan Zhang <zhang.lyra@gmail.com>
Change-Id: Ibe5f907b96d59e8b02e8e4838fc8b3cde5f4f35e
2020-11-18 02:12:45 +00:00