Commit graph

889,574 commits

Author SHA1 Message Date
Shashank Babu Chinta Venkata
a163768151 haven: touch: add IRQ label for trusted touch
Add IRQ label for irq lend framework for enabling
trusted touch usecase.

Change-Id: I6bc3fa5aaa8fd3a348fe9cf9883997e0138ed638
Signed-off-by: Shashank Babu Chinta Venkata <sbchin@codeaurora.org>
2020-06-02 08:18:16 -07:00
Raghavendra Kakarla
691718eeb0 drivers: soc: qcom: handle system sleep activities
When all the CPUs in the Apps processor subsystem
are powered off, the system may also reduce its
bandwidth and shared resource requirements.

The resource requests are sent through the SMD
from APSS subsystem. The sleep requests also need
to be written to the rpm to save power. This driver
handles the last few steps when entering system sleep.

When notified, the next wakeup timer value is written
to the MPM to be setup in the always-on domain timer.

Change-Id: Iab9e38d602d4f84e506471ec0864d2c6fb550b42
Signed-off-by: Raghavendra Kakarla <rkakarla@codeaurora.org>
2020-06-02 08:03:33 -07:00
Raghavendra Kakarla
5f6b8a2b36 drivers: irqchip: Add support to make mpm as module
To make the mpm driver as module driver, register the
mpm driver to platform bus driver and create the
both gic and gpio irq domains in its probe function.
Also add the support for mpm pin to gic irq number
translation to send irq info to its parent gic domain.

Also add the select and match function support to gpio
chip domain to differentiate it from gic interrupt domain.

Change-Id: I433f3a5b895d0ca074bae986ad5154892d7a31c4
Signed-off-by: Raghavendra Kakarla <rkakarla@codeaurora.org>
2020-06-02 08:03:23 -07:00
Raghavendra Kakarla
67371f6ddc drivers: irqchip: mpm: Add QTI SoC interrupt controller
Add the mpm as the wakeup capable interrupt controller.

Change-Id: Ibd437ecd4efe4db134a0a026404f9b3170685db5
Signed-off-by: Raghavendra Kakarla <rkakarla@codeaurora.org>
2020-06-02 08:03:11 -07:00
Raghavendra Kakarla
308c399692 defconfig: Enable RPM_SMD driver for Holi
Enable RPM-SMD driver to APSS-RPM communication.

Change-Id: I988a99a3ac3b5016808826fa945d996d18af2ce0
Signed-off-by: Raghavendra Kakarla <rkakarla@codeaurora.org>
2020-06-02 08:02:58 -07:00
Sharath Chandra Vurukala
b0549b997c config: Enable TOS and DSCP target support
Enable TOS and DSCP target support for Lahaina target

Change-Id: If6fedcf2fdac65c8b572872c74eea7f7b9c68962
Signed-off-by: Sharath Chandra Vurukala <sharathv@codeaurora.org>
2020-06-02 18:33:04 +05:30
Andrey Konovalov
90087296b3 FROMGIT: USB: dummy-hcd: use configurable endpoint naming scheme
(This commit should go into mainline in 5.8.)

USB gadget subsystem uses the following naming convention for UDC
endpoints:

- "ep-a" names for fully configurable endpoints (address, direction and
  transfer type can be changed);

- "ep1in", "ep12out-bulk" names for fixed function endpoints (fixed
  address, direction and/or transfer type).

Dummy UDC endpoints are capable of full configuration, but named using
the second scheme.

This patch changes the names of generic Dummy UDC endpoints to "ep-aout",
"ep-bin", etc., to advertise that they have configurable addresses and
transfer types (except that Dummy UDC doesn't support ISO transfers), but
fixed direction.

This is required for Raw Gadget (and perhaps for some other drivers),
that reasons about whether an endpoint has configurable address based
on its name.

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Bug: 147413187
(cherry picked from commit eccba1edeebf0cf4525a680e1585ccf97dfc4c87
 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Change-Id: I8dea71a6bc0eaff9880148972f7bbd4aabfdf149
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2020-06-02 10:59:38 +00:00
Yuanfang Zhang
7867be23f0 soc: qcom: dcc: avoid memory access violation
When *ppos + len is overflow, shrink len to max readable size
of SRAM.

Change-Id: I7c35433d384eb596a3f84b7ce13652f58166b40a
Signed-off-by: Yuanfang Zhang <zhangyuanfang@codeaurora.org>
2020-06-02 02:05:14 -07:00
Greg Kroah-Hartman
20b83be407 ANDROID: GKI: enable a bunch of HID config options =y
A bunch of HID config options are recommented to be =y in the default
android configuration, and vendors are using them, so enable them in the
GKI kernels as well to reduce the abi footprint.

The options enabled are:
	CONFIG_HID_WACOM
	CONFIG_HID_LOGITECH
	CONFIG_HID_LOGITECH_DJ
	CONFIG_HID_ROCCAT
	CONFIG_HID_PRODIKEYS
	CONFIG_HID_PICOLCD
	CONFIG_HID_UCLOGIC
	CONFIG_HID_WIIMOTE

Bug: 157965270
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Idc8eae67ec81b5dd925c09db2f3600633c55d0c4
2020-06-02 10:50:45 +02:00
Andrey Konovalov
f7a0ee1aab UPSTREAM: usb: raw-gadget: fix null-ptr-deref when reenabling endpoints
Currently we preassign gadget endpoints to raw-gadget endpoints during
initialization. Fix resetting this assignment in raw_ioctl_ep_disable(),
otherwise we will get null-ptr-derefs when an endpoint is reenabled.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Bug: 147413187
(cherry picked from commit da39b5ee40bc00ae3edb4ae4e205b10bc52f980e)
Change-Id: I6809cfdeeadf5fda4071a2f088cd525a1640872d
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2020-06-02 06:37:34 +00:00
Andrey Konovalov
01871d260b UPSTREAM: usb: raw-gadget: documentation updates
Mention the issue with fixed UDC addresses.

Links external examples and test suite.

Add more implmenetation details and potential improvements.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Bug: 147413187
(cherry picked from commit 61d2658db48af0c563d126cccc5c1105137b1ec9)
Change-Id: I99ec38c7fc69aba4e9019a320b740843dd262a48
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2020-06-02 06:37:15 +00:00
Andrey Konovalov
5261cfe10a UPSTREAM: usb: raw-gadget: support stalling/halting/wedging endpoints
Raw Gadget is currently unable to stall/halt/wedge gadget endpoints,
which is required for proper emulation of certain USB classes.

This patch adds a few more ioctls:

- USB_RAW_IOCTL_EP0_STALL allows to stall control endpoint #0 when
  there's a pending setup request for it.
- USB_RAW_IOCTL_SET/CLEAR_HALT/WEDGE allow to set/clear halt/wedge status
  on non-control non-isochronous endpoints.

Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface")
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Bug: 147413187
(cherry picked from commit c61769bd4777a922952aed0d042a2572e5bd9b74)
Change-Id: If3bb63894ff9fec4cc59b5ff04c6caf2898c9600
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2020-06-02 06:36:58 +00:00
Andrey Konovalov
6f6bff3e02 UPSTREAM: usb: raw-gadget: fix gadget endpoint selection
Currently automatic gadget endpoint selection based on required features
doesn't work. Raw Gadget tries iterating over the list of available
endpoints and finding one that has the right direction and transfer type.
Unfortunately selecting arbitrary gadget endpoints (even if they satisfy
feature requirements) doesn't work, as (depending on the UDC driver) they
might have fixed addresses, and one also needs to provide matching
endpoint addresses in the descriptors sent to the host.

The composite framework deals with this by assigning endpoint addresses
in usb_ep_autoconfig() before enumeration starts. This approach won't work
with Raw Gadget as the endpoints are supposed to be enabled after a
set_configuration/set_interface request from the host, so it's too late to
patch the endpoint descriptors that had already been sent to the host.

For Raw Gadget we take another approach. Similarly to GadgetFS, we allow
the user to make the decision as to which gadget endpoints to use.

This patch adds another Raw Gadget ioctl USB_RAW_IOCTL_EPS_INFO that
exposes information about all non-control endpoints that a currently
connected UDC has. This information includes endpoints addresses, as well
as their capabilities and limits to allow the user to choose the most
fitting gadget endpoint.

The USB_RAW_IOCTL_EP_ENABLE ioctl is updated to use the proper endpoint
validation routine usb_gadget_ep_match_desc().

These changes affect the portability of the gadgets that use Raw Gadget
when running on different UDCs. Nevertheless, as long as the user relies
on the information provided by USB_RAW_IOCTL_EPS_INFO to dynamically
choose endpoint addresses, UDC-agnostic gadgets can still be written with
Raw Gadget.

Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface")
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Bug: 147413187
(cherry picked from commit 97df5e5758f7d1dd0ca97e3210696818fc45bdb3)
Change-Id: I8f3c7e36f8af03038fb48343a18e296ce1498977
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2020-06-02 06:36:42 +00:00
Andrey Konovalov
db424a691a UPSTREAM: usb: raw-gadget: improve uapi headers comments
Fix typo "trasferred" => "transferred".

Don't call USB requests URBs.

Fix comment style.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Bug: 147413187
(cherry picked from commit 17ff3b72e742192f11e3136174ac4eafb50e38d4)
Change-Id: Idd35454a469266d1921096293f4c3c6a51ea034f
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2020-06-02 06:36:32 +00:00
Andrey Konovalov
bbe8b95725 UPSTREAM: usb: raw-gadget: fix return value of ep read ioctls
They must return the number of bytes transferred during the data stage.

Fixes: 068fbff4f860 ("usb: raw-gadget: Fix copy_to/from_user() checks")
Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface")
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Bug: 147413187
(cherry picked from commit 6e507644209b4a043363e165855a3a3050c4d40e)
Change-Id: I16f2ab1d881a2313bd1ec6b77aa0229fe08fe25b
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2020-06-02 06:36:20 +00:00
Andrey Konovalov
30d554f1ba UPSTREAM: usb: raw-gadget: fix raw_event_queue_fetch locking
If queue->size check in raw_event_queue_fetch() fails (which normally
shouldn't happen, that check is a fail-safe), the function returns
without reenabling interrupts. This patch fixes that issue, along with
propagating the cause of failure to the function caller.

Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Link: https://lore.kernel.org/r/9f7ce7a1472cfb9447f6c5a494186fa1f2670f6f.1586270396.git.andreyknvl@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 147413187
(cherry picked from commit fdd10499de0dbcd2cdfe8108ed162bb00fe6f276)
Change-Id: I602a9c9f8d9c441af9e67d472c00d6fde515c57d
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2020-06-02 06:36:04 +00:00
Dan Carpenter
47d3f93ccc UPSTREAM: usb: raw-gadget: Fix copy_to/from_user() checks
The copy_to/from_user() functions return the number of bytes remaining
but we want to return negative error codes.  I changed a couple checks
in raw_ioctl_ep_read() and raw_ioctl_ep0_read() to show that we still
we returning zero on error.

Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Link: https://lore.kernel.org/r/20200406145119.GG68494@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 147413187
(cherry picked from commit 068fbff4f860c620c8e36641c1da9a165abad24e)
Change-Id: I771f2c18000e47dd053408b28cbc4c4abb532f67
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
2020-06-02 06:35:56 +00:00
Abir Ghosh
896b76e681 qbt: Add support for touch events from input framework
Add changes to get touch events from input framework
and perform AoI and radius filtering. AoI info is passed
by userspace  using ioctl.

Change-Id: Iabedc175d06f123d540d64806cbfb2ce31c3acfe
Signed-off-by: Abir Ghosh <abirg@codeaurora.org>
2020-06-02 11:06:48 +05:30
himta ram
ebee7a4691 radio: RTC6226: remove the V4L2_CAP_DEVICE_CAPS cap as device_caps
V4l2 framewrok warn that Drivers must not change device_caps.
There is a device cap mismatch when querying device capabilities
for rtc6226 driver compared to cap filled at probe time.
Remove the V4L2_CAP_DEVICE_CAPS cap as device_caps during rtc6226
driver probe.

CRs-Fixed: 2691794
Change-Id: Ice3c0cbbf583762a500647f4a54f68f92d6586bb
Signed-off-by: himta ram <hram@codeaurora.org>
2020-06-01 21:56:21 -07:00
Naveen Yadav
7a0971c78d cpufreq: qcom: Set the register for GT Limits Management interrupt
Set the GT_IRQ_CLR bit of EPSS_INTR_CLEAR register to generate the EPSS
hardware GT interrupt when LMH throttle occurs.

Change-Id: I1ba6faf1a28f2d8d06c8d91f3046bb064263cb67
Signed-off-by: Naveen Yadav <naveenky@codeaurora.org>
2020-06-02 09:21:07 +05:30
Prakruthi Deepak Heragu
64e68fd529 aarch64: ABI: Update abi snapshot for enabling CFI in enforcement mode
Update the ABI snapshot as well as the whitelist when CFI_PERMISSIVE
flag is turned off to put CFI in enforcing mode.

Change-Id: If5fcff638231ae5bc081ea018134edde804b6c78
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
2020-06-01 17:21:29 -07:00
Himateja Reddy
674eb6f800 msm: adsprpc: use persistent header buffers
Add IOCTL support for userspace to request kernel to enable
optimizations to reduce RPC overhead. This change specifically
enables the use of persistent header buffers, allocated during
process setup time and mapped on DSP in one call. Try using
persistent headers for RPC calls and fall back to allocating a new
buffer if all buffers are in use already.

Change-Id: If106679947adfaabb08055f3ad909711bc891656
Acked-by: Thyagarajan Venkatanarayanan <venkatan@qti.qualcomm.com>
Signed-off-by: Himateja Reddy <hmreddy@codeaurora.org>
2020-06-01 16:10:29 -07:00
George Shen
d2241c8215 msm: cvp: Support new HFI FLUSH MSG value
Change is to support both deprecated FLUSH MSG value and new
value in kernel before new HFI FLUSH MSG value released.

Change-Id: I376bb58f6f9625e692a814836f276c9c98c164d4
Signed-off-by: George Shen <sqiao@codeaurora.org>
2020-06-01 15:33:31 -07:00
Harshdeep Dhatt
f44d1a49b9 msm: kgsl: Fix gpu boot ab vote
The ab is in megabytes and ddr_table is in kilobytes. So do
the conversion to fix the first ab vote out of slumber.

Also fix the ib vote units for the very first gmu boot.

Change-Id: I57efd80fa2de8262842475e02a363e0436a7b0f2
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2020-06-01 15:37:54 -06:00
Todd Kjos
877b6a928b ANDROID: GKI: update abi definitions after enabling PCIEPORTBUS
CONFIG_PCIEPORTBUS has been turned on which affected KMI.

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 1 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

'struct pci_dev at pci.h:292:1' changed:
  type size changed from 19776 to 19840 (in bits)
  2 data member insertions:
    'unsigned int pci_dev::ltr_path', at offset 31 (in bits) at pci.h:364:1
    'pcie_link_state* pci_dev::link_state', at offset 1216 (in bits) at pci.h:363:1
  there are data member changes:
    'unsigned int pci_dev::eetlp_prefix_path' offset changed from 31 to 30 (in bits) (by -1 bits)
    'pci_channel_state_t pci_dev::error_state' offset changed from 1216 to 1312 (in bits) (by +96 bits)
    'device pci_dev::dev' offset changed from 1280 to 1344 (in bits) (by +64 bits)
    'int pci_dev::cfg_size' offset changed from 8384 to 8448 (in bits) (by +64 bits)
    'unsigned int pci_dev::irq' offset changed from 8416 to 8480 (in bits) (by +64 bits)
    'resource pci_dev::resource[11]' offset changed from 8448 to 8512 (in bits) (by +64 bits)
    'bool pci_dev::match_driver' offset changed from 16896 to 16960 (in bits) (by +64 bits)
    'unsigned int pci_dev::reset_fn' offset changed from 16896 to 16960 (in bits) (by +64 bits)
    'pci_dev_flags_t pci_dev::dev_flags' offset changed from 16944 to 17008 (in bits) (by +64 bits)
    'atomic_t pci_dev::enable_cnt' offset changed from 16960 to 17024 (in bits) (by +64 bits)
    'u32 pci_dev::saved_config_space[16]' offset changed from 16992 to 17056 (in bits) (by +64 bits)
    'hlist_head pci_dev::saved_cap_space' offset changed from 17536 to 17600 (in bits) (by +64 bits)
    'bin_attribute* pci_dev::rom_attr' offset changed from 17600 to 17664 (in bits) (by +64 bits)
    'int pci_dev::rom_attr_enabled' offset changed from 17664 to 17728 (in bits) (by +64 bits)
    'bin_attribute* pci_dev::res_attr[11]' offset changed from 17728 to 17792 (in bits) (by +64 bits)
    'bin_attribute* pci_dev::res_attr_wc[11]' offset changed from 18432 to 18496 (in bits) (by +64 bits)
    'const attribute_group** pci_dev::msi_irq_groups' offset changed from 19136 to 19200 (in bits) (by +64 bits)
    'pci_vpd* pci_dev::vpd' offset changed from 19200 to 19264 (in bits) (by +64 bits)
    'phys_addr_t pci_dev::rom' offset changed from 19264 to 19328 (in bits) (by +64 bits)
    'size_t pci_dev::romlen' offset changed from 19328 to 19392 (in bits) (by +64 bits)
    'char* pci_dev::driver_override' offset changed from 19392 to 19456 (in bits) (by +64 bits)
    'unsigned long int pci_dev::priv_flags' offset changed from 19456 to 19520 (in bits) (by +64 bits)
    'u64 pci_dev::android_kabi_reserved1' offset changed from 19520 to 19584 (in bits) (by +64 bits)
    'u64 pci_dev::android_kabi_reserved2' offset changed from 19584 to 19648 (in bits) (by +64 bits)
    'u64 pci_dev::android_kabi_reserved3' offset changed from 19648 to 19712 (in bits) (by +64 bits)
    'u64 pci_dev::android_kabi_reserved4' offset changed from 19712 to 19776 (in bits) (by +64 bits)
  89 impacted interfaces:
    function int __pci_register_driver(pci_driver*, module*, const char*)
    function int blk_mq_pci_map_queues(blk_mq_queue_map*, pci_dev*, int)
    function pci_host_bridge* devm_pci_alloc_host_bridge(device*, size_t)
    function int dw_pcie_host_init(pcie_port*)
    function void dw_pcie_msi_init(pcie_port*)
    function void dw_pcie_setup_rc(pcie_port*)
    function int dw_pcie_wait_for_link(dw_pcie*)
    function int of_irq_parse_and_map_pci(const pci_dev*, u8, u8)
    function int pci_alloc_irq_vectors_affinity(pci_dev*, unsigned int, unsigned int, unsigned int, irq_affinity*)
    function int pci_assign_resource(pci_dev*, int)
    function void pci_assign_unassigned_bus_resources(pci_bus*)
    function void pci_bus_add_devices(const pci_bus*)
    function bool pci_check_and_mask_intx(pci_dev*)
    function bool pci_check_and_unmask_intx(pci_dev*)
    function void pci_clear_master(pci_dev*)
    function void pci_clear_mwi(pci_dev*)
    function u8 pci_common_swizzle(pci_dev*, u8*)
    function void pci_d3cold_disable(pci_dev*)
    function pci_dev* pci_dev_get(pci_dev*)
    function void pci_dev_put(pci_dev*)
    function bool pci_device_is_present(pci_dev*)
    function void pci_disable_device(pci_dev*)
    function void pci_disable_msi(pci_dev*)
    function void pci_disable_msix(pci_dev*)
    function int pci_enable_device(pci_dev*)
    function int pci_enable_device_mem(pci_dev*)
    function int pci_enable_msi(pci_dev*)
    function int pci_enable_msix_range(pci_dev*, msix_entry*, int, int)
    function int pci_enable_wake(pci_dev*, pci_power_t, bool)
    function pci_bus* pci_find_bus(int, int)
    function int pci_find_capability(pci_dev*, int)
    function int pci_find_ext_capability(pci_dev*, int)
    function int pci_find_next_capability(pci_dev*, u8, int)
    function pci_dev* pci_find_pcie_root_port(pci_dev*)
    function void pci_free_irq(pci_dev*, unsigned int, void*)
    function void pci_free_irq_vectors(pci_dev*)
    function pci_dev* pci_get_device(unsigned int, unsigned int, pci_dev*)
    function pci_dev* pci_get_slot(pci_bus*, unsigned int)
    function void pci_intx(pci_dev*, int)
    function void* pci_iomap(pci_dev*, int, unsigned long int)
    function void* pci_iomap_range(pci_dev*, int, unsigned long int, unsigned long int)
    function void* pci_ioremap_bar(pci_dev*, int)
    function void* pci_ioremap_wc_bar(pci_dev*, int)
    function const cpumask* pci_irq_get_affinity(pci_dev*, int)
    function int pci_irq_vector(pci_dev*, unsigned int)
    function int pci_load_and_free_saved_state(pci_dev*, pci_saved_state**)
    function int pci_load_saved_state(pci_dev*, pci_saved_state*)
    function const pci_device_id* pci_match_id(const pci_device_id*, pci_dev*)
    function int pci_msi_vec_count(pci_dev*)
    function int pci_read_config_byte(const pci_dev*, int, u8*)
    function int pci_read_config_dword(const pci_dev*, int, u32*)
    function int pci_read_config_word(const pci_dev*, int, u16*)
    function void pci_release_region(pci_dev*, int)
    function void pci_release_regions(pci_dev*)
    function void pci_release_selected_regions(pci_dev*, int)
    function int pci_request_irq(pci_dev*, unsigned int, irq_handler_t, irq_handler_t, void*, const char*, ...)
    function int pci_request_region(pci_dev*, int, const char*)
    function int pci_request_regions(pci_dev*, const char*)
    function int pci_request_selected_regions(pci_dev*, int, const char*)
    function unsigned int pci_rescan_bus(pci_bus*)
    function int pci_reset_function(pci_dev*)
    function void pci_restore_state(pci_dev*)
    function int pci_save_state(pci_dev*)
    function unsigned int pci_scan_child_bus(pci_bus*)
    function int pci_scan_root_bus_bridge(pci_host_bridge*)
    function int pci_select_bars(pci_dev*, unsigned long int)
    function void pci_set_master(pci_dev*)
    function int pci_set_mwi(pci_dev*)
    function int pci_set_power_state(pci_dev*, pci_power_t)
    function void pci_stop_and_remove_bus_device(pci_dev*)
    function pci_saved_state* pci_store_saved_state(pci_dev*)
    function void pci_unregister_driver(pci_driver*)
    function void pci_walk_bus(pci_bus*, int (pci_dev*, void*)*, void*)
    function int pci_write_config_byte(const pci_dev*, int, u8)
    function int pci_write_config_dword(const pci_dev*, int, u32)
    function int pci_write_config_word(const pci_dev*, int, u16)
    function void pcie_bus_configure_settings(pci_bus*)
    function int pcie_capability_read_dword(pci_dev*, int, u32*)
    function int pcie_capability_read_word(pci_dev*, int, u16*)
    function int pcim_enable_device(pci_dev*)
    function int pcim_iomap_regions(pci_dev*, int, const char*)
    function void* const* pcim_iomap_table(pci_dev*)
    function const snd_pci_quirk* snd_pci_quirk_lookup(pci_dev*, const snd_pci_quirk*)
    function void usb_asmedia_modifyflowcontrol(pci_dev*)
    function void usb_disable_xhci_ports(pci_dev*)
    function void usb_enable_intel_xhci_ports(pci_dev*)
    function int usb_hcd_pci_probe(pci_dev*, const pci_device_id*)
    function void usb_hcd_pci_remove(pci_dev*)
    function void usb_hcd_pci_shutdown(pci_dev*)

Bug: 153142844
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Ib617699e379cc27c0f5830161a8b2b41819d1196
2020-06-01 20:16:16 +00:00
Alistair Delva
63355962d8 Revert "ANDROID: gki_defconfig: Drop CONFIG_PCIEPORTBUS"
This reverts commit c6ca683891.

Reason for revert: restore pcieportbus for 5.4 dev

Bug: 153142844
Bug: 154539208
Change-Id: I0e0aaa45c74627292ca5a7e0ccf57e52edf48953
Signed-off-by: Alistair Delva <adelva@google.com>
Signed-off-by: Todd Kjos <tkjos@google.com>
2020-06-01 20:15:54 +00:00
Raghavendra Rao Ananta
dbc45f4c7c tty: hvc_console, fix crashes on parallel open/close
hvc_open sets tty->driver_data to NULL when open fails at some point.
Typically, the failure happens in hp->ops->notifier_add(). If there is
a racing process which tries to open such mangled tty, which was not
closed yet, the process will crash in hvc_open as tty->driver_data is
NULL.

All this happens because close wants to know whether open failed or not.
But ->open should not NULL this and other tty fields for ->close to be
happy. ->open should call tty_port_set_initialized(true) and close
should check by tty_port_initialized() instead. So do this properly in
this driver.

So this patch removes these from ->open:
* tty_port_tty_set(&hp->port, NULL). This happens on last close.
* tty->driver_data = NULL. Dtto.
* tty_port_put(&hp->port). This happens in shutdown and until now, this
  must have been causing a reference underflow, if I am not missing
  something.

Change-Id: Ie67e9bc9038a282a22f7a7baf7a4588549416725
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: stable <stable@vger.kernel.org>
Reported-and-tested-by: Raghavendra <rananta@codeaurora.org>
Link: https://lore.kernel.org/r/20200526145632.13879-1-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 24eb2377f977fe06d84fca558f891f95bc28a449
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2020-06-01 11:29:58 -07:00
Mohammed Nayeem Ur Rahman
8a580a4265 msm: adsprpc: Fix error code for invalid ioctl
Change error code returned to ENOTTY for invalid ioctl. Also,
limit the number of debug messages printed for non ion buffers
based on size.

Change-Id: Iabbb7a2482b4b5d00a039e90fe7636eba5ca0447
Acked-by: Deepika Singh <dsi@qti.qualcomm.com>
Signed-off-by: Mohammed Nayeem Ur Rahman <mohara@codeaurora.org>
2020-06-01 16:59:13 +05:30
Hu Wang
0ba1177569 defconfig: lahaina: Enable linux bridge
Enable linux bridge on QGKI builds to support multi-AP bridge mode.

Change-Id: Idd424e41544766e9c30293dd58ad7954988f05a9
Signed-off-by: Hu Wang <huw@codeaurora.org>
Signed-off-by: Liangwei Dong <liangwei@codeaurora.org>
2020-06-01 15:54:46 +08:00
Pratham Pratap
51f6ca5f35 Revert "usb: dwc3: gadget: Enable SUSPEND event after CONNECT DONE"
This reverts commit 74cc257a62210a7fc69cd095ecd48a364621bb7a.

Instead, enable the SUSPEND event interrupt on enable_irq as part
of gadget start to be inline with USB specification.

Change-Id: I4c2d6e48a2276b480e112ee203a18a6865f15408
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
2020-05-31 23:13:44 -07:00
Pradeep P V K
523ab0ecc0 block, bfq: fix use-after-free in bfq_idle_slice_timer_body
In bfq_idle_slice_timer func, bfqq = bfqd->in_service_queue is
not in bfqd-lock critical section. The bfqq, which is not
equal to NULL in bfq_idle_slice_timer, may be freed after passing
to bfq_idle_slice_timer_body. So we will access the freed memory.

In addition, considering the bfqq may be in race, we should
firstly check whether bfqq is in service before doing something
on it in bfq_idle_slice_timer_body func. If the bfqq in race is
not in service, it means the bfqq has been expired through
__bfq_bfqq_expire func, and wait_request flags has been cleared in
__bfq_bfqd_reset_in_service func. So we do not need to re-clear the
wait_request of bfqq which is not in service.

KASAN log is given as follows:
[13058.354613] ==============================================================
[13058.354640] BUG: KASAN: use-after-free in bfq_idle_slice_timer+0xac/0x290
[13058.354644] Read of size 8 at addr ffffa02cf3e63f78 by task fork13/19767
[13058.354646]
[13058.354655] CPU: 96 PID: 19767 Comm: fork13
[13058.354661] Call trace:
[13058.354667]  dump_backtrace+0x0/0x310
[13058.354672]  show_stack+0x28/0x38
[13058.354681]  dump_stack+0xd8/0x108
[13058.354687]  print_address_description+0x68/0x2d0
[13058.354690]  kasan_report+0x124/0x2e0
[13058.354697]  __asan_load8+0x88/0xb0
[13058.354702]  bfq_idle_slice_timer+0xac/0x290
[13058.354707]  __hrtimer_run_queues+0x298/0x8b8
[13058.354710]  hrtimer_interrupt+0x1b8/0x678
[13058.354716]  arch_timer_handler_phys+0x4c/0x78
[13058.354722]  handle_percpu_devid_irq+0xf0/0x558
[13058.354731]  generic_handle_irq+0x50/0x70
[13058.354735]  __handle_domain_irq+0x94/0x110
[13058.354739]  gic_handle_irq+0x8c/0x1b0
[13058.354742]  el1_irq+0xb8/0x140
[13058.354748]  do_wp_page+0x260/0xe28
[13058.354752]  __handle_mm_fault+0x8ec/0x9b0
[13058.354756]  handle_mm_fault+0x280/0x460
[13058.354762]  do_page_fault+0x3ec/0x890
[13058.354765]  do_mem_abort+0xc0/0x1b0
[13058.354768]  el0_da+0x24/0x28
[13058.354770]
[13058.354773] Allocated by task 19731:
[13058.354780]  kasan_kmalloc+0xe0/0x190
[13058.354784]  kasan_slab_alloc+0x14/0x20
[13058.354788]  kmem_cache_alloc_node+0x130/0x440
[13058.354793]  bfq_get_queue+0x138/0x858
[13058.354797]  bfq_get_bfqq_handle_split+0xd4/0x328
[13058.354801]  bfq_init_rq+0x1f4/0x1180
[13058.354806]  bfq_insert_requests+0x264/0x1c98
[13058.354811]  blk_mq_sched_insert_requests+0x1c4/0x488
[13058.354818]  blk_mq_flush_plug_list+0x2d4/0x6e0
[13058.354826]  blk_flush_plug_list+0x230/0x548
[13058.354830]  blk_finish_plug+0x60/0x80
[13058.354838]  read_pages+0xec/0x2c0
[13058.354842]  __do_page_cache_readahead+0x374/0x438
[13058.354846]  ondemand_readahead+0x24c/0x6b0
[13058.354851]  page_cache_sync_readahead+0x17c/0x2f8
[13058.354858]  generic_file_buffered_read+0x588/0xc58
[13058.354862]  generic_file_read_iter+0x1b4/0x278
[13058.354965]  ext4_file_read_iter+0xa8/0x1d8 [ext4]
[13058.354972]  __vfs_read+0x238/0x320
[13058.354976]  vfs_read+0xbc/0x1c0
[13058.354980]  ksys_read+0xdc/0x1b8
[13058.354984]  __arm64_sys_read+0x50/0x60
[13058.354990]  el0_svc_common+0xb4/0x1d8
[13058.354994]  el0_svc_handler+0x50/0xa8
[13058.354998]  el0_svc+0x8/0xc
[13058.354999]
[13058.355001] Freed by task 19731:
[13058.355007]  __kasan_slab_free+0x120/0x228
[13058.355010]  kasan_slab_free+0x10/0x18
[13058.355014]  kmem_cache_free+0x288/0x3f0
[13058.355018]  bfq_put_queue+0x134/0x208
[13058.355022]  bfq_exit_icq_bfqq+0x164/0x348
[13058.355026]  bfq_exit_icq+0x28/0x40
[13058.355030]  ioc_exit_icq+0xa0/0x150
[13058.355035]  put_io_context_active+0x250/0x438
[13058.355038]  exit_io_context+0xd0/0x138
[13058.355045]  do_exit+0x734/0xc58
[13058.355050]  do_group_exit+0x78/0x220
[13058.355054]  __wake_up_parent+0x0/0x50
[13058.355058]  el0_svc_common+0xb4/0x1d8
[13058.355062]  el0_svc_handler+0x50/0xa8
[13058.355066]  el0_svc+0x8/0xc.

Change-Id: I510c704a6f2324741d70db33f0350e14642fe92f
Acked-by: Paolo Valente <paolo.valente@linaro.org>
Reported-by: Wang Wang <wangwang2@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Feilong Lin <linfeilong@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Git-commit: 2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block
Signed-off-by: Pradeep P V K <ppvk@codeaurora.org>
2020-05-31 22:25:00 -07:00
qctecmdr
bf4eaa44f7 Merge "regulator: core: avoid deadlock in QTI addition to regulator_unregister()" 2020-05-31 02:33:19 -07:00
qctecmdr
10cbadfc18 Merge "net: qrtr: Allocate workqueue before kernel_bind" 2020-05-31 02:33:18 -07:00
qctecmdr
325fc4d843 Merge "memory_dump: resolve the issue of configuring core_reg_numer" 2020-05-31 02:33:18 -07:00
qctecmdr
51b9ea9e84 Merge "mhi: core: Enable both time synchronization methods to co-exist" 2020-05-31 02:33:18 -07:00
qctecmdr
b7180d867f Merge "soc: qcom: spcom: add channel name for each txn_id print" 2020-05-31 02:33:17 -07:00
qctecmdr
9d0c2bcade Merge "msm: cvp: stop session queue when session closed" 2020-05-31 02:33:16 -07:00
qctecmdr
24999171d7 Merge "arm64: defconfig: Enable config to add QTI specific code" 2020-05-31 02:33:16 -07:00
qctecmdr
57e93d279c Merge "arm64: defconfig: Disable CONFIG_CFI_PERMISSIVE flag" 2020-05-31 02:33:16 -07:00
George Shen
297ef03399 msm: cvp: Fix a CVP SSR deadlock
When CVP SSR is triggred by debug node, CVP is still working,
such as sending HFI MSG back to kernel driver. While kernel
driver handles HFI MSG, there is dealock in acquiring CVP
core mutex and device mutex. They are also acquired by SSR handler.

Change-Id: I28060312f8f239dfa3ac36c5bb8c7a5b720abdc2
Signed-off-by: George Shen <sqiao@codeaurora.org>
2020-05-30 16:40:49 -07:00
Chao Yu
b897923179 f2fs: fix wrong discard space
Under heavy fsstress, we may triggle panic while issuing discard,
because __check_sit_bitmap() detects that discard command may earse
valid data blocks, the root cause is as below race stack described,
since we removed lock when flushing quota data, quota data writeback
may race with write_checkpoint(), so that it causes inconsistency in
between cached discard entry and segment bitmap.

- f2fs_write_checkpoint
 - block_operations
  - set_sbi_flag(sbi, SBI_QUOTA_SKIP_FLUSH)
 - f2fs_flush_sit_entries
  - add_discard_addrs
   - __set_bit_le(i, (void *)de->discard_map);
						- f2fs_write_data_pages
						 - f2fs_write_single_data_page
						   : inode is quota one, cp_rwsem won't be locked
						  - f2fs_do_write_data_page
						   - f2fs_allocate_data_block
						    - f2fs_wait_discard_bio
						      : discard entry has not been added yet.
						    - update_sit_entry
 - f2fs_clear_prefree_segments
  - f2fs_issue_discard
  : add discard entry

In order to fix this, this patch uses node_write to serialize
f2fs_allocate_data_block and checkpoint.

Fixes: 435cbab95e39 ("f2fs: fix quota_sync failure due to f2fs_lock_op")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-05-30 08:50:12 -07:00
Chao Yu
777612eb60 f2fs: compress: don't compress any datas after cp stop
While compressed data writeback, we need to drop dirty pages like we did
for non-compressed pages if cp stops, however it's not needed to compress
any data in such case, so let's detect cp stop condition in
cluster_may_compress() to avoid redundant compressing and let following
f2fs_write_raw_pages() drops dirty pages correctly.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-05-30 08:50:12 -07:00
Chao Yu
8c741ec029 f2fs: remove unneeded return value of __insert_discard_tree()
We never use return value of __insert_discard_tree(), so remove it.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-05-30 08:50:11 -07:00
Chao Yu
0e30fd6028 f2fs: fix wrong value of tracepoint parameter
In f2fs_lookup(), we should set @err correctly before printing it
in tracepoint.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-05-30 08:50:11 -07:00
Daeho Jeong
df6ac796c9 f2fs: protect new segment allocation in expand_inode_data
Found a new segemnt allocation without f2fs_lock_op() in
expand_inode_data(). So, when we do fallocate() for a pinned file
and trigger checkpoint very frequently and simultaneously. F2FS gets
stuck in the below code of do_checkpoint() forever.

  f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO);
  /* Wait for all dirty meta pages to be submitted for IO */
                                                <= if fallocate() here,
  f2fs_wait_on_all_pages(sbi, F2FS_DIRTY_META); <= it'll wait forever.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-05-30 08:50:10 -07:00
Chengguang Xu
56968fb1c0 f2fs: code cleanup by removing ifdef macro surrounding
Define f2fs_listxattr and to NULL when CONFIG_F2FS_FS_XATTR is not
enabled, then we can remove many ugly ifdef macros in the code.

Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-05-30 08:50:10 -07:00
Jan Kara
83af290d09 writeback: Avoid skipping inode writeback
Inode's i_io_list list head is used to attach inode to several different
lists - wb->{b_dirty, b_dirty_time, b_io, b_more_io}. When flush worker
prepares a list of inodes to writeback e.g. for sync(2), it moves inodes
to b_io list. Thus it is critical for sync(2) data integrity guarantees
that inode is not requeued to any other writeback list when inode is
queued for processing by flush worker. That's the reason why
writeback_single_inode() does not touch i_io_list (unless the inode is
completely clean) and why __mark_inode_dirty() does not touch i_io_list
if I_SYNC flag is set.

However there are two flaws in the current logic:

1) When inode has only I_DIRTY_TIME set but it is already queued in b_io
list due to sync(2), concurrent __mark_inode_dirty(inode, I_DIRTY_SYNC)
can still move inode back to b_dirty list resulting in skipping
writeback of inode time stamps during sync(2).

2) When inode is on b_dirty_time list and writeback_single_inode() races
with __mark_inode_dirty() like:

writeback_single_inode()		__mark_inode_dirty(inode, I_DIRTY_PAGES)
  inode->i_state |= I_SYNC
  __writeback_single_inode()
					  inode->i_state |= I_DIRTY_PAGES;
					  if (inode->i_state & I_SYNC)
					    bail
  if (!(inode->i_state & I_DIRTY_ALL))
  - not true so nothing done

We end up with I_DIRTY_PAGES inode on b_dirty_time list and thus
standard background writeback will not writeback this inode leading to
possible dirty throttling stalls etc. (thanks to Martijn Coenen for this
analysis).

Fix these problems by tracking whether inode is queued in b_io or
b_more_io lists in a new I_SYNC_QUEUED flag. When this flag is set, we
know flush worker has queued inode and we should not touch i_io_list.
On the other hand we also know that once flush worker is done with the
inode it will requeue the inode to appropriate dirty list. When
I_SYNC_QUEUED is not set, __mark_inode_dirty() can (and must) move inode
to appropriate dirty list.

Reported-by: Martijn Coenen <maco@android.com>
Fixes: 0ae45f63d4 ("vfs: add support for a lazytime mount option")
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
2020-05-30 08:50:07 -07:00
qctecmdr
af2d4f76fd Merge "pwm: qti-lpg: Read tick duration via device tree" 2020-05-30 04:42:14 -07:00
qctecmdr
9ee4a9e6ec Merge "PM / devfreq: icc: add support for L3 BW devices" 2020-05-30 04:42:14 -07:00
qctecmdr
af28a1662f Merge "clk: qcom: clk-alpha-pll: Add support for Lucid EVO PLL print registers" 2020-05-30 04:42:13 -07:00