Commit Graph

978631 Commits

Author SHA1 Message Date
Greg Kroah-Hartman
0998ba703e ANDROID: GKI: remove CONFIG_CRC8=y
This is no longer needed, thanks to 4c93988221 ("PCI: qcom: Add
support for configuring BDF to SID mapping for SM8250") which adds a
"select CRC8" to the CONFIG_PCIE_QCOM option.

Fixes: 4c93988221 ("PCI: qcom: Add support for configuring BDF to SID mapping for SM8250")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I739c9e7f152c253e1037eb57aa5fdf6b3d902d5f
2020-12-18 16:56:38 +01:00
Greg Kroah-Hartman
97c7e8a8c3 Merge 489e9fea66 ("Merge tag 'pci-v5.11-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci") into android-mainline
Steps on the way to 5.11-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I704dd7f67aefa8c595d55b403f4dfa46639a126a
2020-12-18 16:32:08 +01:00
Greg Kroah-Hartman
bcf67c66f7 Merge b4ec805464 ("Merge tag 'pm-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm") into android-mainline
Steps on the way to 5.11-rc1.

Fixes merge issues in:
	kernel/sched/cpufreq_schedutil.c

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1e3ee238f6a6e43898a8aac206bec5738518606f
2020-12-18 15:32:45 +01:00
Greg Kroah-Hartman
024e0a28bc Merge b109bc7229 ("Merge tag 'thermal-v5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux") into android-mainline
Steps on the way to 5.11-rc1.

Change-Id: I292f4c045f63dc2fb936d383de8b61212ba25284
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-12-18 15:24:42 +01:00
Greg Kroah-Hartman
ad39a2c85d Revert "ANDROID: Revert "thermal: Make thermal_zone_device_is_enabled() available to core only""
This reverts commit baead118d8 as there
should not be any need for this by any drivers as upstream has moved on
from using this entirely, so no out-of-tree drivers should be using it
either.

Cc: Giuliano Procida <gprocida@google.com>
Cc: Will McVicker <willmcvicker@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ifbfe33b442eb3d64466713cd5cd303b2257ab8b9
2020-12-18 15:23:13 +01:00
Greg Kroah-Hartman
8b882de4c1 Merge ce51c2b7ce ("Merge tag 'mmc-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc") into android-mainline
Steps on the way to 5.11-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2bac328ace91118b026621b8544019c3ca472d88
2020-12-18 15:11:42 +01:00
Greg Kroah-Hartman
ae4d3eeca3 Merge 605ea5aafe ("Merge tag 'spi-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi") into android-mainline
Steps on the way to 5.11-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6c69d551d93dbf3868b56dfb7a5299577bca536d
2020-12-18 15:09:55 +01:00
Greg Kroah-Hartman
80007a72bb Merge 2cffa11e2a ("Merge tag 'irq-core-2020-12-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to 5.11-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3e839d90247415fe012021f7cb274555252e948d
2020-12-18 14:49:53 +01:00
Greg Kroah-Hartman
4196c1dafc Revert "ANDROID: sched: avoid migrating when softint on tgt cpu should be short"
This reverts commit 8d19443b0b as the
softirq code is rewritten in 5.11-rc1 and massive merge conflicts are
happening.

If this change is still needed, please work with upstream to get the
patches accepted so they can then come into this tree automatically.

Bug: 31752786
Bug: 168521633
Cc: John Dias <joaodias@google.com>
Cc: J. Avila <elavila@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6875407b586f505c2045e4cf40682831b4fceac1
2020-12-18 14:43:05 +01:00
Greg Kroah-Hartman
28768780d4 Revert "ANDROID: softirq: defer softirq processing to ksoftirqd if CPU is busy with RT"
This reverts commit 0578248bed as the
softirq code is rewritten in 5.11-rc1 and massive merge conflicts are
happening.

If this change is still needed, please work with upstream to get the
patches accepted so they can then come into this tree automatically.

Bug: 168521633
Cc: Pavankumar Kondeti <pkondeti@codeaurora.org>
Cc: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Cc: J. Avila <elavila@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I421cc2ca29b635d7ac39d52aa486e20cbdd8ca45
2020-12-18 14:42:25 +01:00
Greg Kroah-Hartman
d6592588ed Revert "ANDROID: Revert "Mark HI and TASKLET softirq synchronous""
This reverts commit ea05d25c78  as the
softirq code is rewritten in 5.11-rc1 and massive merge conflicts are
happening.

If this change is still needed, please work with upstream to get the
patches accepted so they can then come into this tree automatically.

Bug: 168521633
Cc: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Cc: J. Avila <elavila@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4ab5adcf06824b0b7d052ea07e8c851c9052fe6b
2020-12-18 14:41:48 +01:00
Greg Kroah-Hartman
c646ea5a5f Revert "ANDROID: Revert "softirq: Let ksoftirqd do its job""
This reverts commit 1bcefd3883  as the
softirq code is rewritten in 5.11-rc1 and massive merge conflicts are
happening.

If this change is still needed, please work with upstream to get the
patches accepted so they can then come into this tree automatically.

Bug: 168521633
Cc: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Cc: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Cc: J. Avila <elavila@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Idb615a68b4e892b1b0391a8511c9338f6202368b
2020-12-18 14:41:05 +01:00
Greg Kroah-Hartman
2cadcbac1a Revert "ANDROID: trace: Add trace points for tasklet entry/exit"
This reverts commit 9889f08de4 as the
softirq code is rewritten in 5.11-rc1 and massive merge conflicts are
happening.

If this change is still needed, please work with upstream to get the
patches accepted so they can then come into this tree automatically.

Bug: 168521633
Cc: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Cc: J. Avila <elavila@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ibd116aef3140df9a896415e521ef4039c74b4819
2020-12-18 14:38:58 +01:00
Greg Kroah-Hartman
44ede8412e Merge 5b200f5789 ("Merge branch 'akpm' (patches from Andrew)") into
android-mainline

Steps on the way to 5.11-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie0812f92e7f8ed8bd3bcf7525008b57ef78e4e01
2020-12-18 14:19:43 +01:00
Jaegeuk Kim
0c64f7a00e Revert "FROMLIST: scsi: ufs: fix livelock on ufshcd_clear_ua_wlun"
This reverts commit 4643b9f16b.

Reason for revert: No need to fix this in mainline, since 5.10-rc1 should have the fix already.

Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I080dd929e04d3a9cd509296b86a760f37690e78e
2020-12-17 22:15:59 +00:00
Prasad Sodagudi
cd1208a52a ANDROID: softirq: Export irq_handler_entry tracepoint
Export irq_handle_entry tracepoint, so that vendor modules
can register probes for this tracepoint.

Bug: 175806230
Change-Id: Ieb276e1938ccf819a847cde37d5a25bfa00efe05
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2020-12-17 13:34:16 -08:00
Prasad Sodagudi
d28d86c3fe ANDROID: sched: Export sched_switch tracepoint symbol
Export sched_switch tracepoint symbol, so that modules
can register probes.

Bug: 175806230
Change-Id: Id114a0aa1760f6e3da0b2b2b814893df5af9fe9d
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2020-12-17 13:33:50 -08:00
Greg Kroah-Hartman
37684c73c1 Merge 3db1a3fa98 ("Merge tag 'staging-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging") into android-mainline
Steps on the way to 5.11-rc1.

drivers/staging/android/ion/ is removed in this commit, but no conflicts
show up here thanks to a1fef199e060 ("ANDROID: delete ION code")

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If9469c05174bcab99e3bbf0933929d0e7c8d6378
2020-12-17 19:17:54 +01:00
Greg Kroah-Hartman
0b2a6b9137 ANDROID: delete ION code
Upstream commit e722a295cf ("staging: ion: remove from the tree")
removes the ION code from the kernel tree, but the version of ION that
is in the ANDROID tree is a bit more complex and different.  To make it
"easier" if someone needs to bring the ION code back, revert it all
here, in this commit, so that when the upstream merge happens, the
deletion is not burried in a merge commit.

Fixes: e722a295cf ("staging: ion: remove from the tree")
Cc: Hridya Valsaraju <hridya@google.com>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ibd9332f5878879579508c947976d943d1fd6023a
2020-12-17 19:16:56 +01:00
Will Deacon
07fd19958f ANDROID: usb: f_accessory: Don't drop NULL reference in acc_disconnect()
If get_acc_dev() fails to obtain a reference to the current device,
acc_disconnect() will attempt to put_acc_dev() with the resulting NULL
pointer, leading to a crash:

 | Unable to handle kernel NULL pointer dereference at virtual address 00000074
 | [...]
 | [<c0abb288>] (acc_disconnect) from [<c0a91a38>] (android_disconnect+0x1c/0x7c)
 | [<c0a91a38>] (android_disconnect) from [<c0a93958>] (usb_gadget_udc_reset+0x10/0x34)
 | [<c0a93958>] (usb_gadget_udc_reset) from [<c0a4a9c4>] (dwc3_gadget_reset_interrupt+0x88/0x4fc)
 | [<c0a4a9c4>] (dwc3_gadget_reset_interrupt) from [<c0a491f8>] (dwc3_process_event_buf+0x60/0x3e4)
 | [<c0a491f8>] (dwc3_process_event_buf) from [<c0a49180>] (dwc3_thread_interrupt+0x24/0x3c)
 | [<c0a49180>] (dwc3_thread_interrupt) from [<c02b3404>] (irq_thread_fn+0x1c/0x58)
 | [<c02b3404>] (irq_thread_fn) from [<c02b326c>] (irq_thread+0x1ec/0x2f4)
 | [<c02b326c>] (irq_thread) from [<c0260804>] (kthread+0x1a8/0x1ac)
 | [<c0260804>] (kthread) from [<c0200138>] (ret_from_fork+0x14/0x3c)

Follow the pattern used elsewhere, and return early if we fail to obtain
a reference.

Bug: 173789633
Reported-by: YongQin Liu <yongqin.liu@linaro.org>
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I37a2bff5bc1b6b8269788d08191181763bf0e896
2020-12-17 17:21:45 +00:00
Matthias Maennich
237011c53a ANDROID: build.config.common: allow overriding of HERMETIC_TOOLCHAIN
This is required at the moment to be set by build_abi.sh.

Bug: 175681515
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: I2657652c3fd3755fe2cee7a9a9ab01989a0bc8f3
2020-12-17 15:11:02 +00:00
Greg Kroah-Hartman
b1e6a98547 Merge 2911ed9f47 ("Merge tag 'char-misc-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc") into android-mailine
Steps on the way to 5.11-rc1

Fix up merge issues in:
	drivers/android/binder_internal.h
	drivers/android/binder.c

Cc: Alistair Strachan <astrachan@google.com>
Cc: Todd Kjos <tkjos@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I34ac6b6a8028b0e63d419c66448ac1382711ec5e
2020-12-17 12:56:04 +01:00
Greg Kroah-Hartman
f98aec4981 Merge 7240153a9b ("Merge tag 'driver-core-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core") into android-mainline
Steps on the way to 5.11-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I648c688c488be8f9ff241e52756b90deef30c6fc
2020-12-17 12:16:57 +01:00
Greg Kroah-Hartman
543db7de4d Merge 157f809894 ("Merge tag 'tty-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty") into android-mainline
Steps on the way to 5.11-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I093d0aba7624b44f38c74e724b4673babe17a2f6
2020-12-17 12:16:13 +01:00
Greg Kroah-Hartman
be1f7c11fa Merge 0cee54c890 ("Merge tag 'usb-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb") into android-mainline
Steps on the way to 5.11-rc1.

Fixes conflicts in:
	drivers/usb/gadget/function/f_midi.c
	include/linux/usb/tcpm.h

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id2782fa00e2977acd699d6c5a83cad31666d444b
2020-12-17 12:10:36 +01:00
Greg Kroah-Hartman
92262fb865 Merge c367caf1a3 ("Merge tag 'sound-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound") into android-mainline
Steps on the way to 5.11-rc1

Change-Id: I5f307b33ac4a93b8322a45810bdb534c1bb90220
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-12-17 10:20:20 +01:00
Greg Kroah-Hartman
47b04badb4 Revert "ANDROID: sound: usb: Add vendor's hooking interface"
This reverts commit 1eb185541d.

USB offload will end up coming back in a much different way in future
releases, not in a sound-specific manner, but rather in a USB-specific
way.  So revert this change for now, it is no longer needed and is
causing merge issues.

Bug: 156315379
Cc: JaeHun Jung <jh0801.jung@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia65be0092d6b9ce395634cf3a01808188e06e379
2020-12-17 10:18:56 +01:00
Greg Kroah-Hartman
bfb0e0737a Revert "ANDROID: sound: usb: Add helper APIs to enable audio stream"
This reverts commit 3f60546293.

Random new apis added to the tree and never sent upstream in 4 years are
not a good thing to leave around.  Combine that with massive merge
issues with upstream changes, and I think it's finally time to remove
these as I doubt anyone really needs them anymore.

Bug: 140989596
Cc: Hemant Kumar <hemantk@codeaurora.org>
Cc: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I108c2a20091694848e4fa8d20aa15d3e75079fee
2020-12-17 10:12:03 +01:00
Greg Kroah-Hartman
6b30baa9aa Merge d635a69dd4 ("Merge tag 'net-next-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next") into android-mainline
Steps on the way to 5.11-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ife05d3664090a485044181eb67397692083962b7
2020-12-17 09:26:34 +01:00
Greg Kroah-Hartman
f1ee68a8f6 Revert "Revert "security,lockdown,selinux: implement SELinux lockdown""
This reverts commit d9cb255af3 as it
causes merge issues with upstream selinux changes, and really should be
fixed by now...

Bug: 148822198
Signed-off-by: Alistair Delva <adelva@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I30a54f07119d429bf95518844c8bd2e94606a2e0
2020-12-17 09:21:11 +01:00
Greg Kroah-Hartman
8c3b398d8c Merge ac73e3dc8a ("Merge branch 'akpm' (patches from Andrew)") into android-mainline
Steps on the way to 5.11-rc1

Change-Id: I23957617a1e123aa05d3c1d48ea24e6acd131bdd
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-12-17 07:57:30 +01:00
Greg Kroah-Hartman
e6c166040a Revert "ANDROID: cma: redirect page allocation to CMA"
This reverts commit 7ff00a49a2 as it
causes conflicts with other mm changes that are coming in 5.11-rc1.

Bug: 158645321
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Heesub Shin <heesub.shin@samsung.com>
Cc: Vinayak Menon <vinmenon@codeaurora.org>
Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5adda72755d9487e45ccb8bf1a0481399e5c3163
2020-12-17 07:55:47 +01:00
Greg Kroah-Hartman
650cf88cea Revert "ANDROID: mm: add cma pcp list"
This reverts commit 3d7ab504ec as it
causes conflicts with other mm changes that are coming in 5.11-rc1.

Bug: 158645321
Cc: Liam Mark <lmark@codeaurora.org>
Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I189786d1b3e1470eed157a7978b904dee273c72d
2020-12-17 07:55:12 +01:00
Jaegeuk Kim
4643b9f16b FROMLIST: scsi: ufs: fix livelock on ufshcd_clear_ua_wlun
This fixes the below livelock which is caused by calling a scsi command before
ufshcd_scsi_unblock_requests() in ufshcd_ungate_work().

Workqueue: ufs_clk_gating_0 ufshcd_ungate_work
Call trace:
 __switch_to+0x298/0x2bc
 __schedule+0x59c/0x760
 schedule+0xac/0xf0
 schedule_timeout+0x44/0x1b4
 io_schedule_timeout+0x44/0x68
 wait_for_common_io+0x7c/0x100
 wait_for_completion_io+0x14/0x20
 blk_execute_rq+0x94/0xd0
 __scsi_execute+0x100/0x1c0
 ufshcd_clear_ua_wlun+0x124/0x1c8
 ufshcd_host_reset_and_restore+0x1d0/0x2cc
 ufshcd_link_recovery+0xac/0x134
 ufshcd_uic_hibern8_exit+0x1e8/0x1f0
 ufshcd_ungate_work+0xac/0x130
 process_one_work+0x270/0x47c
 worker_thread+0x27c/0x4d8
 kthread+0x13c/0x320
 ret_from_fork+0x10/0x18

Bug: 175231713
Bug: 175391270
Bug: 171886785
Link: https://lore.kernel.org/linux-scsi/20201216190225.2769012-1-jaegeuk@kernel.org/T/#u
Fixes: f2da571038 ("FROMLIST: scsi: ufs: clear uac for RPMB after ufshcd resets")
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ic88d9746b9881e98d7a870b8a80fc37daefeee28
2020-12-16 22:54:50 +00:00
Greg Kroah-Hartman
cbc135c55e Merge 148842c98a ("Merge tag 'x86-apic-2020-12-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to 5.11-rc1

Resolves merge issue in :
	include/linux/sched.h

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9d5af6793ed59d1c4fd23e91cc41864c4a6cf277
2020-12-16 20:42:42 +01:00
Alistair Delva
03c69872d6 ANDROID: GKI: Unhide VIRTIO_DMA_SHARED_BUFFER
So downstream boards can select it. It is needed by some virtio drivers
like virtio-gpu. We can't put this in init/Kconfig.gki because we don't
want to enable VIRTIO options in GKI if they can be tristate.

Bug: 175707513
Change-Id: Ic8f7b0aa0ed6e9c74cda08d96eb30507d6886275
Signed-off-by: Alistair Delva <adelva@google.com>
2020-12-16 18:38:35 +00:00
Rob Clark
4561e208b5 FROMLIST: drm/msm: Fix WARN_ON() splat in _free_object()
[  192.062000] ------------[ cut here ]------------
[  192.062498] WARNING: CPU: 3 PID: 2039 at drivers/gpu/drm/msm/msm_gem.c:381 put_iova_vmas+0x94/0xa0 [msm]
[  192.062870] Modules linked in: snd_hrtimer snd_seq snd_seq_device rfcomm algif_hash algif_skcipher af_alg bnep xt_CHECKSUM nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_counter xt_tcpudp nft_compat cpufreq_powersave cpufreq_conservative q6asm_dai q6routing q6afe_dai q6adm bridge q6afe q6asm q6dsp_common q6core stp llc nf_tables libcrc32c nfnetlink snd_soc_wsa881x regmap_sdw soundwire_qcom gpio_wcd934x snd_soc_wcd934x wcd934x regmap_slimbus venus_enc venus_dec apr videobuf2_dma_sg qrtr_smd uvcvideo videobuf2_vmalloc videobuf2_memops ath10k_snoc ath10k_core hci_uart btqca btbcm mac80211 bluetooth snd_soc_sdm845 ath snd_soc_rt5663 snd_soc_qcom_common snd_soc_rl6231 soundwire_bus ecdh_generic ecc qcom_spmi_adc5 venus_core qcom_pon qcom_spmi_temp_alarm qcom_vadc_common v4l2_mem2mem videobuf2_v4l2 cfg80211 videobuf2_common hid_multitouch reset_qcom_pdc qcrypto qcom_rng rfkill qcom_q6v5_mss libarc4 libdes qrtr ns qcom_wdt socinfo slim_qcom_ngd_ctrl
[  192.065739]  pdr_interface qcom_q6v5_pas slimbus qcom_pil_info qcom_q6v5 qcom_sysmon qcom_common qcom_glink_smem qmi_helpers rmtfs_mem tcp_bbr sch_fq fuse ip_tables x_tables ipv6 crc_ccitt ti_sn65dsi86 i2c_hid msm mdt_loader llcc_qcom rtc_pm8xxx ocmem drm_kms_helper crct10dif_ce phy_qcom_qusb2 i2c_qcom_geni panel_simple drm pwm_bl
[  192.066066] CPU: 3 PID: 2039 Comm: gnome-shell Tainted: G        W         5.10.0-rc7-next-20201208 #1
[  192.066068] Hardware name: LENOVO 81JL/LNVNB161216, BIOS 9UCN33WW(V2.06) 06/ 4/2019
[  192.066072] pstate: 40400005 (nZcv daif +PAN -UAO -TCO BTYPE=--)
[  192.066099] pc : put_iova_vmas+0x94/0xa0 [msm]
[  192.066262] lr : put_iova_vmas+0x1c/0xa0 [msm]
[  192.066403] sp : ffff800019efbbb0
[  192.066405] x29: ffff800019efbbb0 x28: ffff800019efbd88
[  192.066411] x27: 0000000000000000 x26: ffff109582efa400
[  192.066417] x25: 0000000000000009 x24: 000000000000012b
[  192.066422] x23: ffff109582efa438 x22: ffff109582efa450
[  192.066427] x21: ffff109582efa528 x20: ffff1095cbd4f200
[  192.066432] x19: ffff1095cbd4f200 x18: 0000000000000000
[  192.066438] x17: 0000000000000000 x16: ffffc26c200ca750
[  192.066727] x15: 0000000000000000 x14: 0000000000000000
[  192.066741] x13: ffff1096fb8c9100 x12: 0000000000000002
[  192.066754] x11: ffffffffffffffff x10: 0000000000000002
[  192.067046] x9 : 0000000000000001 x8 : 0000000000000a36
[  192.067060] x7 : ffff4e2ad9f11000 x6 : ffffc26c216d4000
[  192.067212] x5 : ffffc26c2022661c x4 : ffff1095c2b98000
[  192.067367] x3 : ffff1095cbd4f300 x2 : 0000000000000000
[  192.067380] x1 : ffff1095c2b98000 x0 : 0000000000000000
[  192.067667] Call trace:
[  192.067734]  put_iova_vmas+0x94/0xa0 [msm]
[  192.068078]  msm_gem_free_object+0xb4/0x110 [msm]
[  192.068399]  drm_gem_object_free+0x1c/0x30 [drm]
[  192.068717]  drm_gem_object_handle_put_unlocked+0xf0/0xf8 [drm]
[  192.069032]  drm_gem_object_release_handle+0x6c/0x88 [drm]
[  192.069349]  drm_gem_handle_delete+0x68/0xc0 [drm]
[  192.069666]  drm_gem_close_ioctl+0x30/0x48 [drm]
[  192.069984]  drm_ioctl_kernel+0xc0/0x110 [drm]
[  192.070303]  drm_ioctl+0x210/0x440 [drm]
[  192.070588]  __arm64_sys_ioctl+0xa8/0xf0
[  192.070599]  el0_svc_common.constprop.0+0x74/0x190
[  192.070608]  do_el0_svc+0x24/0x90
[  192.070618]  el0_svc+0x14/0x20
[  192.070903]  el0_sync_handler+0xb0/0xb8
[  192.070911]  el0_sync+0x174/0x180
[  192.070918] ---[ end trace bee6b12a899001a3 ]---
[  192.072140] ------------[ cut here ]------------

Fixes: 9b73bde39c ("drm/msm: Fix use-after-free in msm_gem with carveout")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Iskren Chernev <iskren.chernev@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Link: https://lore.kernel.org/linux-arm-msm/20201210174028.2060883-1-robdclark@gmail.com/
Change-Id: I9cdca64718f03352a45a5b1a2d5ef19e3de3e971
2020-12-16 16:43:43 +00:00
Will Deacon
2b2acb8f40 ANDROID: usb: f_accessory: Avoid bitfields for shared variables
Using bitfields for shared variables is a "bad idea", as they require
a non-atomic read-modify-write to be generated by the compiler, which can
cause updates to unrelated bits in the same word to disappear.

Ensure the 'online' and 'disconnected' members of 'struct acc_dev' are
placed in separate variables by declaring them each as 'int'.

Bug: 173789633
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ia6031d82a764e83b2cc3502fbe5fb273511da752
2020-12-16 14:31:12 +00:00
Will Deacon
e7152730c9 ANDROID: usb: f_accessory: Cancel any pending work before teardown
Tearing down and freeing the 'acc_dev' structure when there is
potentially asynchronous work queued involving its member fields is
likely to lead to use-after-free issues.

Cancel any pending work before freeing the structure.

Bug: 173789633
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I68a91274aea18034637b738d558d043ac74fadf4
2020-12-16 14:30:45 +00:00
Will Deacon
f4e1525cde ANDROID: usb: f_accessory: Don't corrupt global state on double registration
If acc_setup() is called when there is already an allocated instance,
misc_register() will fail but the error path leaves a dangling pointer
to freed memory in the global 'acc_dev' state.

Fix this by ensuring that the refcount is zero before we start, and then
using a cmpxchg() from NULL to serialise any concurrent initialisers.

Bug: 173789633
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I2c26289dcce7dbc493964516c49b05d04aaa6839
2020-12-16 14:30:26 +00:00
Will Deacon
dafa1fd624 ANDROID: usb: f_accessory: Fix teardown ordering in acc_release()
acc_release() attempts to synchronise with acc_open() using an atomic
'open_excl' member in 'struct acc_dev'. Unfortunately, acc_release()
prematurely resets this atomic variable to zero, meaning there is a
potential race on 'dev->disconnected':

acc_open()				acc_release()
						atomic_xchg(open_excl), 0)
	atomic_xchg(open_excl, 1)
	dev->disconnected = 0;			dev->disconnected = 1;

Fix the race by ensuring that the 'disconnected' field is written
before clearing 'open_excl' in acc_release().

Bug: 173789633
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ib9a21f2305f6d70de3e760da62dbfdd66889200a
2020-12-16 14:29:13 +00:00
Will Deacon
ee4706c18f ANDROID: usb: f_accessory: Add refcounting to global 'acc_dev'
Add refcounting to track the lifetime of the global 'acc_dev' structure,
as the underlying function directories can be removed while references
still exist to the dev node.

Bug: 173789633
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I248408e890d01167706c329146d63b64a6456df6
2020-12-16 14:28:39 +00:00
Will Deacon
93c1a17ca9 ANDROID: usb: f_accessory: Wrap '_acc_dev' in get()/put() accessors
The '_acc_dev' global variable is a fancy use-after-free factory. Wrap
it in some get()/put() functions in preparation for introducing some
refcounting.

Bug: 173789633
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I4c839627648c209341a81efa0c001c8d71b878d4
2020-12-16 14:27:10 +00:00
Will Deacon
72fce5a313 ANDROID: usb: f_accessory: Remove useless assignment
acc_alloc_inst() assigns to a local 'dev' variable, but then never uses
it. Remove the redundant assignment, and the local variable along with
it.

Bug: 173789633
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ide9c2e89fb12b846eb8739b302d1b742fc7eb6b5
2020-12-16 14:26:01 +00:00
Will Deacon
d28e9f5181 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
2020-12-16 14:25:25 +00:00
Will Deacon
6a9c657bdc 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
2020-12-16 14:24:57 +00:00
Quentin Perret
0dd08d5801 Merge adb35e8dc9 ("Merge tag 'sched-core-2020-12-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Now that CPU pause is gone, this is a lot more manageable. The
remaining conflicts were caused mostly by vendor hooks and Android-specific
tweaks to the EAS topology code, but easily fixable by hand.

Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I3665a2d78cb0b8eca6ba5110e90dc7f72030805e
2020-12-16 09:09:52 +00:00
Quentin Perret
52172897b4 Revert "ANDROID: stop_machine: stop_one_cpu_async"
This reverts commit d9f0cedbaf.

CPU Pause causes major merge conflicts with the 5.11 scheduler changes
(migrate-disable specifically), so lets revert Pause temporarily as it
is not needed urgently in android-mainline.

Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: Id67cdac65b5084a89a4117019cfb95800472809c
2020-12-16 09:08:23 +00:00
Quentin Perret
e560954645 Revert "ANDROID: sched/rt: cpu_active_mask intersection"
This reverts commit b05fe6b580.

CPU Pause causes major merge conflicts with the 5.11 scheduler changes
(migrate-disable specifically), so lets revert Pause temporarily as it
is not needed urgently in android-mainline.

Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: Ib6b8b3a803fe4035acd0d70fbf448280e4e930cb
2020-12-16 09:08:23 +00:00
Quentin Perret
33f7ae250c Revert "ANDROID: sched/fair: update_max_interval() active_mask dependant"
This reverts commit 75d6951cf8.

CPU Pause causes major merge conflicts with the 5.11 scheduler changes
(migrate-disable specifically), so lets revert Pause temporarily as it
is not needed urgently in android-mainline.

Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I05b0288ae67b72f9a4151f41fad1546e4f7ba1f7
2020-12-16 09:08:23 +00:00