Minigbm uses dumb ioctls when the virtio gpu is in 2D mode. This
changes allows those calls to pass the permission checks in
drm_ioctl_permit().
Bug: b/123764798
Test: booted cuttlefish on drm stack w/o 3d
Change-Id: I872ba8f6d0a284127178dd60f8a2048e5e7397fb
Signed-off-by: Jason Macnak <natsu@google.com>
Signed-off-by: Alistair Delva <adelva@google.com>
/proc/uid_time_in_state has no data on cuttlefish because its cpu
frequency tables are empty. Because time in state & concurrent time
accounting are intertwined this causes the
/proc/uid_concurrent_{policy,active}_time files to also not contain
any data.
Add a minimal, fake cpufreq driver that creates a freq table with 2
frequencies per policy, to allow testing time in state functionality.
Test: all 3 proc files show reasonable data on cuttlefish
Test: log shows no errors from bad /proc/uid_time_in_state format
Bug: 139763108
Bug: 140796321
Bug: 141206930
Change-Id: I8c7fe1007a80c21a9bcba9455bf837947cf42963
Signed-off-by: Connor O'Brien <connoro@google.com>
Add hidden configs to GKI_HACKS_to_fIX so they are
enabled for loadable media modules build out-of-tree
Bug: 142892658
Test: Built for arm64/x86_64. Boot on cuttlefish
Change-Id: I137a89f69822332324a1f4a3a1150be9cd66709d
Signed-off-by: Todd Kjos <tkjos@google.com>
Force SPMI_MSM_PMIC_ARB off and enable FORTIFY_SOURCE for GKI
Bug: 142896904
Bug: 134087016
Test: Build/Boot on cuttlefish
Change-Id: Ib6e501f1efee2349d750010a53572dddcb5457c5
Signed-off-by: Todd Kjos <tkjos@google.com>
This reverts commit e78f95acac.
This adds back the original
commit c603a309cc ("x86/mm: Identify the end of the kernel area to be reserved")
Bug: 138463564
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: Ia01a9b914beebf392a670f8b8238ebceeb361a1d
We've been building mainline x86_64 with LLD for months now, and don't
plan to upgrade Android's binutils to work around issues upstream
related to:
commit c603a309cc ("x86/mm: Identify the end of the kernel area to be reserved")
Bug: 138463564
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ic52f7f374c494e5d39efb758a7739ebd33799f49
Change adds support for jack switch types supported
by platform.
This change also squashes the below changes-
include: increase allowed SW INPUT device ID from 15 to 32
Increase the Input device SW ID from 15 to 32. This is needed
to accommodate more input devices.
Bug: 142489397
Change-Id: If77f8b37b4db72ada2b5d8a3095265eef90ab62b
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: Meng Wang <mwang@codeaurora.org>
Parameter fragments and fragment_size are type of u32. U32_MAX is
the correct check.
CRs-Fixed: 1014726
Bug: 142489397
Change-Id: Ia6d4755408646ac4a75724f3c6f2177651875da3
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
Signed-off-by: Meng Wang <mwang@codeaurora.org>
IOMMU drivers that can be compiled as modules need to use
some of the IOMMU core functions, so expose them.
Change-Id: I84004fdcd7eee3f56d08db76c3b0421990179810
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Bug: 140290589
Link: https://patchwork.kernel.org/patch/10948413/
IOMMU drivers that can be compiled as modules may
want to use pci_for_each_dma_alias() and pci_request_acs(),
so export those functions.
Change-Id: I8fab4075d151cc3d07a6594685895a189565bb3d
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Bug: 140290589
Link: https://patchwork.kernel.org/patch/10948411/
Copy reserved fields along with other fields in v4l2_plane
for userspace clients and drivers to use reserved fields
when required.
Bug: 143160749
Change-Id: I0c7e7485961ab50188cda6ae81998473500bb07b
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
The of_devlink feature creates device links between devices based on
the common device tree bindings listed in their device node. This
allows improved probe ordering and also makes sure the sync_state()
calls to the device drivers come only after all the consumers of a
device have probed successfully.
Enable this by default on Android since this is required to ease
modularization efforts for GKI.
Bug: 143308885
Signed-off-by: Saravana Kannan <saravanak@google.com>
Change-Id: I57c44e74e35d829ae2ae3145dc241ccf348f2eea
When creating device links to proxy the sync_state() needs of child
dependencies, create SYNC_STATE_ONLY device links so that children
dependencies don't block probing of the parent.
Also, differentiate between missing suppliers of parent device vs
missing suppliers of child devices so that driver core doesn't block
parent device probing when only child supplier dependencies are missing.
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 142657042
Change-Id: Ifc63e36f6af6f48ec77215d0a2a609ff768e0fcb
When add_links() still has suppliers that it needs to link to in the
future, this patch allows it to differentiate between suppliers that are
needed for probing vs suppliers are needed for sync_state() correctness.
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 142657042
Change-Id: If8b2a11dc6d815287c9242aea0ee1c26ef316d96
Before this change, if a device is waiting on suppliers, it's assumed
that all those suppliers are needed for the device to probe
successfully. This change allows marking a devices as waiting only on
optional suppliers. This allows a device to wait on suppliers (and link
to them as soon as they are available) without preventing the device
from being probed.
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 142657042
Change-Id: I86a764b67804ed889f17c55632e25d46a72912a8
Parent devices might need to create "proxy" device links from themselves
to supplier devices to make sure the supplier devices don't get a
sync_state() before the child consumer devices get a chance to add
device links to the supplier devices.
However, the parent device has no real dependency on the supplier device
and probing, suspend/resume or runtime PM don't need to be affected by
the supplier device. To capture these cases, create a SYNC_STATE_ONLY
device link flag that only affects sync_state() behavior and doesn't
affect probing, suspend/resume or runtime PM.
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 142657042
Change-Id: Ie709d3b6cd07ac9e09d1473fc0e0a21a8146a1dc
Some GPIOs are marked as wakeup capable and are routed to another
interrupt controller that is an always-domain and can detect interrupts
even most of the SoC is powered off. The wakeup interrupt controller
wakes up the GIC and replays the interrupt at the GIC.
Setup the TLMM irqchip in hierarchy with the wakeup interrupt controller
and ensure the wakeup GPIOs are handled correctly.
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
BUG: 141169320
TEST: Build and boot
Change-Id: Ic37caf65e5d384234d8197d27b3d62cefa2bea7f
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://patchwork.kernel.org/patch/11145345
Add irqchip calls to set/get interrupt state from the parent interrupt
controller. When GPIOs are renabled as interrupt lines, it is desirable
to clear the interrupt state at the GIC. This avoids any unwanted
interrupt as a result of stale pending state recorded when the line was
used as a GPIO.
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
[updated commit text]
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
BUG: 141169320
TEST: Build and boot
Change-Id: Ie0042161727f2c8b1ebe0dd2165cbc4f20612f30
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://patchwork.kernel.org/patch/11145349
On certain QTI chipsets some GPIOs are direct-connect interrupts to the
GIC to be used as regular interrupt lines. When the GPIOs are not used
for interrupt generation the interrupt line is disabled. But disabling
the interrupt at GIC does not prevent the interrupt to be reported as
pending at GIC_ISPEND. Later, when drivers call enable_irq() on the
interrupt, an unwanted interrupt occurs.
Introduce get and set methods for irqchip's parent to clear it's pending
irq state. This then can be invoked by the GPIO interrupt controller on
the parents in it hierarchy to clear the interrupt before enabling the
interrupt.
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
[updated commit text and minor code fixes]
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
BUG: 141169320
TEST: Build and boot
Change-Id: I8c849f89bebca892fc8a5c94f1ca9492f2a9d49c
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://patchwork.kernel.org/patch/11145351
GPIOs that can be configured as wakeup are routed to the PDC wakeup
interrupt controller and from there to the GIC interrupt controller. On
some QCOM SoCs, the interface to the GIC for wakeup capable GPIOs have
additional hardware registers that need to be configured as well to
match the trigger type of the GPIO. This register interfaces the PDC to
the GIC and therefore updated from the PDC driver.
Typically, the firmware intializes the interface registers for the
wakeup capable GPIOs with commonly used GPIO trigger type, but it is
possible that a platform may want to use the GPIO differently. So, in
addition to configuring the PDC, configure the interface registers as
well.
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
BUG: 141169320
TEST: Build and boot
Change-Id: I73250a04f67549dbf75c40b3672b6b1b78ff8adb
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://patchwork.kernel.org/patch/11145353
In addition to configuring the PDC, additional registers that interface
the GIC have to be configured to match the GPIO type. The registers on
some QCOM SoCs are access restricted, while on other SoCs are not. They
SoCs with access restriction to these SPI registers need to be written
from the firmware using the SCM interface. Add a flag to indicate if the
register is to be written using SCM interface.
Cc: devicetree@vger.kernel.org
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Reviewed-by: Rob Herring <robh@kernel.org>
BUG: 141169320
TEST: Build and boot
Change-Id: I0f6dfc11fc4df4b0744b7c9372eaf4c7be3a82d6
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://patchwork.kernel.org/patch/11145355
Introduce a new domain for wakeup capable GPIOs. The domain can be
requested using the bus token DOMAIN_BUS_WAKEUP. In the following
patches, we will specify PDC as the wakeup-parent for the TLMM GPIO
irqchip. Requesting a wakeup GPIO will setup the GPIO and the
corresponding PDC interrupt as its parent.
Co-developed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
BUG: 141169320
TEST: Build and boot
Change-Id: Iaec0f39c86776d3f8cebe869c4ccaaba541c7ad5
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://patchwork.kernel.org/patch/11145357
When an interrupt is to be serviced, the convention is to mask the
interrupt at the chip and unmask after servicing the interrupt. Enabling
and disabling the interrupt at the PDC irqchip causes an interrupt storm
due to the way dual edge interrupts are handled in hardware.
Skip configuring the PDC when the IRQ is masked and unmasked, instead
use the irq_enable/irq_disable callbacks to toggle the IRQ_ENABLE
register at the PDC. The PDC's IRQ_ENABLE register is only used during
the monitoring mode when the system is asleep and is not needed for
active mode detection.
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
BUG: 141169320
TEST: Build and boot
Change-Id: Ia5827a509bfb47aaa18ed0ea8f61c74f643fa91f
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://patchwork.kernel.org/patch/11145361
Newer SoCs have increased the number of interrupts routed to the PDC
interrupt controller. Update the definition of max PDC interrupts.
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
BUG: 141169320
TEST: Build and boot
Change-Id: I97f548fcd42a5fef63b8f8cbea9470e83f5e8e3e
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://patchwork.kernel.org/patch/11145363
A single controller can handle normal interrupts and wake-up interrupts
independently, with a different numbering space. It is thus crucial to
allow the driver for such a controller discriminate between the two.
A simple way to do so is to tag the wake-up irqdomain with a "bus token"
that indicates the wake-up domain. This slightly abuses the notion of
bus, but also radically simplifies the design of such a driver. Between
two evils, we choose the least damaging.
Suggested-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
BUG: 141169320
TEST: Build and boot
Change-Id: I0fd6ccc288d1aa840d88392e5f57197c1e8d1afb
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://patchwork.kernel.org/patch/11145365
This is only valid in repo checkouts and caused issues when rebasing on
top. Hence drop it for now until a better solution can be found.
Change-Id: If06560c131a57f2e6d82966f9adf3ca628b2468a
Signed-off-by: Matthias Maennich <maennich@google.com>
Use the fscrypt key removal notifier chain to make sdcardfs evict its
dentries when an fscrypt key is about to be removed. This is needed for
the FS_IOC_REMOVE_ENCRYPTION_KEY ioctl to properly "lock" the encrypted
files underneath sdcardfs when an Android user is stopped.
Test: pm create-user 10
am start-user 10
find /data/media/10/ # filenames are in plaintext form
am stop-user 10
find /data/media/10/ # filenames are in ciphertext form
(But currently the kernel and vold still warn about other files
still being open, due to b/140762419)
Bug: 120446149
Bug: 142275883
Change-Id: I83b451a2bc40c72fcd01d24aa5c34ad8de427534
Signed-off-by: Eric Biggers <ebiggers@google.com>
Add a notifier chain so that sdcardfs can evict its dentries when an
fscrypt key is about to be removed. This is needed for the
FS_IOC_REMOVE_ENCRYPTION_KEY ioctl to properly "lock" the encrypted
files underneath sdcardfs when an Android user is stopped.
This is meant to be a temporary patch carried as part of the sdcardfs
patchset until either we stop using sdcardfs, we get sdcardfs upstream,
or we find a way to provide what sdcardfs needs while also benefitting a
user upstream.
Bug: 120446149
Bug: 142275883
Test: see I83b451a2bc40c72fcd01d24aa5c34ad8de427534
Change-Id: Iec79775a71057d05a371d77da4a6541cb8e09cb7
Signed-off-by: Eric Biggers <ebiggers@google.com>
It causes BUG because remove_proc_entry may sleep while holding spinlock.
BUG: scheduling while atomic: ip6tables-resto/887/0x00000202
[<c0f03f00>] (wait_for_completion) from [<c031b8c8>] (proc_entry_rundown+0x74/0xd0)
[<c031b854>] (proc_entry_rundown) from [<c03225c4>] (remove_proc_entry+0xc0/0x18c)
[<c0322504>] (remove_proc_entry) from [<c0d656e0>] (quota_mt2_destroy+0x88/0xa8)
[<c0d65658>] (quota_mt2_destroy) from [<c0e405f0>] (cleanup_entry+0x6c/0xf0)
[<c0e40584>] (cleanup_entry) from [<c0e41400>] (do_replace.constprop.2+0x314/0x438)
[<c0e410ec>] (do_replace.constprop.2) from [<c0e41640>] (do_ip6t_set_ctl+0x11c/0x238)
[<c0e41524>] (do_ip6t_set_ctl) from [<c0d2e7ec>] (nf_setsockopt+0xd4/0xf0)
[<c0d2e718>] (nf_setsockopt) from [<c0e16bb8>] (ipv6_setsockopt+0x90/0xb8)
[<c0e16b28>] (ipv6_setsockopt) from [<c0e1e908>] (rawv6_setsockopt+0x54/0x22c)
[<c0e1e8b4>] (rawv6_setsockopt) from [<c0cb48dc>] (sock_common_setsockopt+0x28/0x30)
[<c0cb48b4>] (sock_common_setsockopt) from [<c0cb3ac8>] (SyS_setsockopt+0xb8/0x110)
[<c0cb3a10>] (SyS_setsockopt) from [<c01094e0>] (ret_fast_syscall+0x0/0x48)
This is a fix for an Android specific feature which was imported
from unofficial upstream (xtables-addons), which also has the same issue:
https://sourceforge.net/p/xtables-addons/xtables-addons/ci/master/tree/extensions/xt_quota2.c#l235
After this change the proc entry may now be removed later, when we're already
adding another one, potentially with the same name, this will simply
fail during creation, see error path for this at:
https://sourceforge.net/p/xtables-addons/xtables-addons/ci/master/tree/extensions/xt_quota2.c#l179
Bug: 143092160
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: DongJoo Kim <micomx@gmail.com>
Change-Id: I3ff3883738353785f5792c5f06bf6b72985c4c68
SND_PCM_ELD is used by DRM drivers for HDMI audio,
so add it to the HIDDEN_DRM configs.
Bug: 142268770
Change-Id: I914beef34b2cf5174da76a5d1a4d443117f1b687
Signed-off-by: John Stultz <john.stultz@linaro.org>
Re-add "x86/uaccess: Dont leak the AC flag into __put_user() argument evaluation"
This reverts commit 2c7164851e.
Bug: 120440614
Bug: 132629930
Signed-off-by: Ram Muthiah <rammuthiah@google.com>
Change-Id: I74ea8dcb2f5c3661dc1657eb53872375aa9e6753
Re-add "x86/uaccess: Don't leak the AC flag into __put_user() value evaluation"
This reverts commit a4bd9e975e.
Bug: 120440614
Bug: 132629930
Signed-off-by: Ram Muthiah <rammuthiah@google.com>
Change-Id: Iebfe5df8e2e09b6eeeaae343ec6deeda7f45c975
This reverts commit e070355664, reversing
changes made to 8808cf8cbc.
Introducing symbol-namespaces into the kernel has caused issues with
respect to the ABI checker. Hence, revert the changes until a valid
fix is available. The revert was done based off of 5.4-rc1.
Change-Id: I529ced269661f457ce667a76eb383843002f0a7d
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>