Commit graph

894,770 commits

Author SHA1 Message Date
Monika Singh
595a9a1296 crypto: Fix possible stack out of bound error
Adding fix to check the upper limit on the length
of the destination array while copying elements
from source address to avoid stack out of bound error.

Change-Id: I39d5768fa97f9d269cfb101a389bb771d13c7538
Signed-off-by: Monika Singh <monising@codeaurora.org>
2021-02-01 23:46:33 +05:30
Minghao Zhang
f4fda140fd max31760: Maxim Fan Controller Driver
This adds support for MAX31760 Fan Controller.
Fan is enabled and its speed can be controlled.

Change-Id: Ie716b8558ebbd357f85d2484eaa66121eb09f52d
Signed-off-by: Minghao Zhang <minghao@codeaurora.org>
2021-02-01 21:18:09 +08:00
Charan Teja Reddy
0c803ec17b soc: qcom: memoffline: use a freezable unbounded workqueue for migration
Use freezable unbounded workqueue for reverse migration of the pages in
the system. This helps in avoiding the watchdog timeouts while executing
the suspend2idle usecases which expectation is to finish in 14secs.

Also, add the support to know if there are any pending requests for
reverse migration to take better decissions from userspace.

Change-Id: Iada770799936c4d6110310e48f96a6f1dc4725cf
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
2021-02-01 16:25:11 +05:30
Utkarsh Saxena
1dd7764c9e kernel: changes to enable tcpdump in sfe
The change includes passing the packet structure to the sfe module
which includes functional pointer to tpacket_rcv needed for tcpdump
log collection.

Change-Id: Icab7663dac3f7b8681386b96945b7e170a4325f3
Acked-by: Rishav LNU <rna@qti.qualcomm.com>
Signed-off-by: Utkarsh Saxena <usaxena@codeaurora.org>
2021-02-01 15:11:25 +05:30
Veera Vegivada
c78606cca1 interconnect: qcom: Add OSM L3 support on SM6150
Add Operating State Manager (OSM) L3 interconnect provider support on
SM6150 SoCs.

Change-Id: Ibab0245a83eb6cb16b6f5c589bbc516a0a771064
Signed-off-by: Veera Vegivada <vvegivad@codeaurora.org>
2021-01-31 16:35:30 -08:00
Veera Vegivada
868395310d interconnect: qcom: Add SM6150 interconnect provider driver
Introduce QTI SM6150 specific provider driver using the
interconnect framework.

Change-Id: I165027f5e8b087c02715765ed1a53b7708c02f04
Signed-off-by: Veera Vegivada <vvegivad@codeaurora.org>
2021-01-31 16:35:19 -08:00
Naman Padhiar
6d6e598fac icnss2: Add support to enable IO Coherency
Add support to enable IO Coherency based on DT property.

Change-Id: I8de1b1cb6603c6852fe0f02b8b22806ad550bc48
Signed-off-by: Naman Padhiar <npadhiar@codeaurora.org>
2021-01-30 13:15:16 +05:30
Chris Lew
4b705a8072 net: qrtr: haven: Rearrange init order
Doorbells can be received immediately after registering. Ensure the
qrtr endpoint has been registered and initialized before enabling the
rx doorbell.

The tx doorbell should be done before registering the endpoint since
the qrtr core logic can attempt to send immediately after registration.

Change-Id: Ice332b4a053ea6e78bfded1e3625d8c527917e7b
Signed-off-by: Chris Lew <clew@codeaurora.org>
2021-01-29 14:29:53 -08:00
Subbaraman Narayanamurthy
d37101dfc3 power: supply: qpnp-qg: Fix some error logs
When battery_id is set to a value for which there exists no
battery profile, QG driver prints error logs frequently as
some properties doesn't exist.

[ 4305.969087] QG-K: qg_get_charge_counter: Failed to get FCC for charge-counter rc=-19
[ 4305.969123] QG-K: qg_iio_read_raw: Couldn't read IIO channel 73, rc = -19
[ 4305.976657] QG-K: qg_iio_read_raw: Couldn't read IIO channel 83, rc = -19
[ 4305.989355] QG-K: qg_iio_read_raw: Couldn't read IIO channel 84, rc = -19

Fix this by changing pr_err() to pr_err_ratelimited(). While at
it, change a pr_err() to pr_debug(). Also fix an error log to
correct that the error is for reading IIO channel and not for a
property.

Change-Id: I936409d4ffafd664c571976d17ec4baf1b8de218
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2021-01-29 14:25:15 -08:00
Chris Lew
daa0f471a9 net: neuron: channel: Move waitq init
Initialize the waitq before registering with the doorbell framework to
prevent uninitialized variable access.

Change-Id: Icb902b829a6af52716713b18891e4e35c0c2a620
Signed-off-by: Chris Lew <clew@codeaurora.org>
2021-01-29 13:15:21 -08:00
Michael Adisumarta
b2340800e8 msm_rmnet.h: Add new ioctl to add any number of parameters of any size
This also includes new extended ingress-egress ioctls for configuring
system pipe.

Change-Id: I96f3d57037f32e1f904737439cacc8026f7cdb1f
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
2021-01-29 12:19:36 -08:00
Kamal Agrawal
f8d51faf58 msm: kgsl: Avoid slumber if interrupt is pending
As part of slumber sequence, there is a hardware idle validation
which checks for GPU idle. However, it is possible that GPU is idle
but the interrupt is yet to be processed. Fix it by checking for
pending interrupt.

Change-Id: Ia3aef2827fc48bfad382e2369d8477aa67b163d9
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>
2021-01-29 22:07:42 +05:30
Thomas Gleixner
904fb159c9 UPSTREAM: futex: Handle faults correctly for PI futexes
commit 34b1a1ce1458f50ef27c54e28eb9b1947012907a upstream

fixup_pi_state_owner() tries to ensure that the state of the rtmutex,
pi_state and the user space value related to the PI futex are consistent
before returning to user space. In case that the user space value update
faults and the fault cannot be resolved by faulting the page in via
fault_in_user_writeable() the function returns with -EFAULT and leaves
the rtmutex and pi_state owner state inconsistent.

A subsequent futex_unlock_pi() operates on the inconsistent pi_state and
releases the rtmutex despite not owning it which can corrupt the RB tree of
the rtmutex and cause a subsequent kernel stack use after free.

It was suggested to loop forever in fixup_pi_state_owner() if the fault
cannot be resolved, but that results in runaway tasks which is especially
undesired when the problem happens due to a programming error and not due
to malice.

As the user space value cannot be fixed up, the proper solution is to make
the rtmutex and the pi_state consistent so both have the same owner. This
leaves the user space value out of sync. Any subsequent operation on the
futex will fail because the 10th rule of PI futexes (pi_state owner and
user space value are consistent) has been violated.

As a consequence this removes the inept attempts of 'fixing' the situation
in case that the current task owns the rtmutex when returning with an
unresolvable fault by unlocking the rtmutex which left pi_state::owner and
rtmutex::owner out of sync in a different and only slightly less dangerous
way.

Fixes: 1b7558e457 ("futexes: fix fault handling in futex_lock_pi")
Reported-by: gzobqq@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 34b1a1ce1458f50ef27c54e28eb9b1947012907a)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iabd44dad5d4b8385b8a20e44d18308708cc3b701
2021-01-29 13:16:10 +01:00
Thomas Gleixner
dddad86240 UPSTREAM: futex: Simplify fixup_pi_state_owner()
commit f2dac39d93987f7de1e20b3988c8685523247ae2 upstream

Too many gotos already and an upcoming fix would make it even more
unreadable.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f2dac39d93987f7de1e20b3988c8685523247ae2)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5a97587c0f696d4f4b849f7f106990a5587fa402
2021-01-29 13:16:01 +01:00
Thomas Gleixner
d245cfa173 UPSTREAM: futex: Use pi_state_update_owner() in put_pi_state()
commit 6ccc84f917d33312eb2846bd7b567639f585ad6d upstream

No point in open coding it. This way it gains the extra sanity checks.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6ccc84f917d33312eb2846bd7b567639f585ad6d)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic34513518cd4996b3eb4cb82b669d727be522597
2021-01-29 13:15:51 +01:00
Thomas Gleixner
cfe591bb90 UPSTREAM: rtmutex: Remove unused argument from rt_mutex_proxy_unlock()
commit 2156ac1934166d6deb6cd0f6ffc4c1076ec63697 upstream

Nothing uses the argument. Remove it as preparation to use
pi_state_update_owner().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2156ac1934166d6deb6cd0f6ffc4c1076ec63697)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I126088d93c5f05db654e508dfd4195e5c1696164
2021-01-29 13:15:42 +01:00
Thomas Gleixner
a60fba3000 UPSTREAM: futex: Provide and use pi_state_update_owner()
commit c5cade200ab9a2a3be9e7f32a752c8d86b502ec7 upstream

Updating pi_state::owner is done at several places with the same
code. Provide a function for it and use that at the obvious places.

This is also a preparation for a bug fix to avoid yet another copy of the
same code or alternatively introducing a completely unpenetratable mess of
gotos.

Originally-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c5cade200ab9a2a3be9e7f32a752c8d86b502ec7)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I17a67806a035338a55b27eea673d707fc4d8c529
2021-01-29 13:15:27 +01:00
Thomas Gleixner
97500641e2 UPSTREAM: futex: Replace pointless printk in fixup_owner()
commit 04b79c55201f02ffd675e1231d731365e335c307 upstream

If that unexpected case of inconsistent arguments ever happens then the
futex state is left completely inconsistent and the printk is not really
helpful. Replace it with a warning and make the state consistent.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 04b79c55201f02ffd675e1231d731365e335c307)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I32bd64130d9414f65155ecd80646d01eb4374a60
2021-01-29 13:15:18 +01:00
Thomas Gleixner
3a0f91fd81 UPSTREAM: futex: Ensure the correct return value from futex_lock_pi()
commit 12bb3f7f1b03d5913b3f9d4236a488aa7774dfe9 upstream

In case that futex_lock_pi() was aborted by a signal or a timeout and the
task returned without acquiring the rtmutex, but is the designated owner of
the futex due to a concurrent futex_unlock_pi() fixup_owner() is invoked to
establish consistent state. In that case it invokes fixup_pi_state_owner()
which in turn tries to acquire the rtmutex again. If that succeeds then it
does not propagate this success to fixup_owner() and futex_lock_pi()
returns -EINTR or -ETIMEOUT despite having the futex locked.

Return success from fixup_pi_state_owner() in all cases where the current
task owns the rtmutex and therefore the futex and propagate it correctly
through fixup_owner(). Fixup the other callsite which does not expect a
positive return value.

Fixes: c1e2f0eaf0 ("futex: Avoid violating the 10th rule of futex")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 12bb3f7f1b03d5913b3f9d4236a488aa7774dfe9)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6dfb7407620fdf8293edbfbe54463f0c8ff63a57
2021-01-29 13:15:05 +01:00
Wang Hai
19193ef53a UPSTREAM: Revert "mm/slub: fix a memory leak in sysfs_slab_add()"
commit 757fed1d0898b893d7daa84183947c70f27632f3 upstream.

This reverts commit dde3c6b72a16c2db826f54b2d49bdea26c3534a2.

syzbot report a double-free bug. The following case can cause this bug.

 - mm/slab_common.c: create_cache(): if the __kmem_cache_create() fails,
   it does:

	out_free_cache:
		kmem_cache_free(kmem_cache, s);

 - but __kmem_cache_create() - at least for slub() - will have done

	sysfs_slab_add(s)
		-> sysfs_create_group() .. fails ..
		-> kobject_del(&s->kobj); .. which frees s ...

We can't remove the kmem_cache_free() in create_cache(), because other
error cases of __kmem_cache_create() do not free this.

So, revert the commit dde3c6b72a16 ("mm/slub: fix a memory leak in
sysfs_slab_add()") to fix this.

Reported-by: syzbot+d0bd96b4696c1ef67991@syzkaller.appspotmail.com
Fixes: dde3c6b72a16 ("mm/slub: fix a memory leak in sysfs_slab_add()")
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 757fed1d0898b893d7daa84183947c70f27632f3)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3743749e527dddde63620ac16a0db66c475ac404
2021-01-29 13:15:03 +01:00
Dan Carpenter
364ec3d27d UPSTREAM: futex: Don't enable IRQs unconditionally in put_pi_state()
commit 1e106aa3509b86738769775969822ffc1ec21bf4 upstream.

The exit_pi_state_list() function calls put_pi_state() with IRQs disabled
and is not expecting that IRQs will be enabled inside the function.

Use the _irqsave() variant so that IRQs are restored to the original state
instead of being enabled unconditionally.

Fixes: 153fbd1226 ("futex: Fix more put_pi_state() vs. exit_pi_state_list() races")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20201106085205.GA1159983@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2192d905df)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I10bc011b54ffc6d66c0a499ecebfa5b2d96d58ce
2021-01-29 13:13:00 +01:00
Mike Galbraith
6f8f2dc71c UPSTREAM: futex: Handle transient "ownerless" rtmutex state correctly
commit 9f5d1c336a10c0d24e83e40b4c1b9539f7dba627 upstream.

Gratian managed to trigger the BUG_ON(!newowner) in fixup_pi_state_owner().
This is one possible chain of events leading to this:

Task Prio       Operation
T1   120	lock(F)
T2   120	lock(F)   -> blocks (top waiter)
T3   50 (RT)	lock(F)   -> boosts T1 and blocks (new top waiter)
XX   		timeout/  -> wakes T2
		signal
T1   50		unlock(F) -> wakes T3 (rtmutex->owner == NULL, waiter bit is set)
T2   120	cleanup   -> try_to_take_mutex() fails because T3 is the top waiter
     			     and the lower priority T2 cannot steal the lock.
     			  -> fixup_pi_state_owner() sees newowner == NULL -> BUG_ON()

The comment states that this is invalid and rt_mutex_real_owner() must
return a non NULL owner when the trylock failed, but in case of a queued
and woken up waiter rt_mutex_real_owner() == NULL is a valid transient
state. The higher priority waiter has simply not yet managed to take over
the rtmutex.

The BUG_ON() is therefore wrong and this is just another retry condition in
fixup_pi_state_owner().

Drop the locks, so that T3 can make progress, and then try the fixup again.

Gratian provided a great analysis, traces and a reproducer. The analysis is
to the point, but it confused the hell out of that tglx dude who had to
page in all the futex horrors again. Condensed version is above.

[ tglx: Wrote comment and changelog ]

Fixes: c1e2f0eaf0 ("futex: Avoid violating the 10th rule of futex")
Reported-by: Gratian Crisan <gratian.crisan@ni.com>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/87a6w6x7bb.fsf@ni.com
Link: https://lore.kernel.org/r/87sg9pkvf7.fsf@nanos.tec.linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2716e78a64)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9ab0878641624448cacb1951506b5accb4c92a00
2021-01-29 13:12:13 +01:00
Mateusz Nosek
4fe499637b UPSTREAM: futex: Fix incorrect should_fail_futex() handling
[ Upstream commit 921c7ebd1337d1a46783d7e15a850e12aed2eaa0 ]

If should_futex_fail() returns true in futex_wake_pi(), then the 'ret'
variable is set to -EFAULT and then immediately overwritten. So the failure
injection is non-functional.

Fix it by actually leaving the function and returning -EFAULT.

The Fixes tag is kinda blury because the initial commit which introduced
failure injection was already sloppy, but the below mentioned commit broke
it completely.

[ tglx: Massaged changelog ]

Fixes: 6b4f4bc9cb ("locking/futex: Allow low-level atomic operations to return -EAGAIN")
Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20200927000858.24219-1-mateusznosek0@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 2db7590371)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I22198b7a65630cb5649f3e889810783b147bfada
2021-01-29 13:12:05 +01:00
Ravi Joshi
39893ddd65 WLAN subsystem: Sysctl support for key TCP/IP parameters
It has been observed that default values for some of key tcp/ip
parameters are affecting the tput/performance of the system. Hence
extending configuration capabilities to TCP/Ip stack through
sysctl interface.

Change-Id: I4287e9103769535f43e0934bac08435a524ee6a4
CRs-Fixed: 507581
Signed-off-by: Ravi Joshi <ravij@codeaurora.org>
Signed-off-by: Ganesh Babu Kumaravel <kganesh@codeaurora.org>
Signed-off-by: Mohit Khanna <mkhannaqca@codeaurora.org>
Signed-off-by: Manjunathappa Prakash <prakashpm@codeaurora.org>
Signed-off-by: Sandeep Singh <sandsing@codeaurora.org>
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
2021-01-29 16:50:05 +05:30
Pratham Pratap
9bbf449b96 usb: dwc3: Clear err_evt_seen flag on disconnect
Currently err_evt_seen flag is cleared only while clearing
run/stop. Consider a case where err_evt_seen flag is set and
controller is swtiching from peripheral mode to host mode.
Now, from dwc3_gadget_pullup driver will bail out since the
flag is set. Also since softconnect flag is not set run_stop
will not get cleared from vbus_session(0), leaving the err
evt_seen flag set. If any interrupt is generated then driver
will bail out from interrupt handler without processing the
interrupt, which can lead to irq storm. Fix this by clearing
the err_evt_seen flag in disconnect and also add a judgement
in pullup so that driver can proceed with clearing run/stop
if softconnect is cleared, even with the err_evt_seen flag is
set.

Change-Id: Ib7026dca8b4e76e943832419b19cef180ca96171
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
2021-01-29 16:07:00 +05:30
Archit Saxena
256f833781 defconfig: Add PIL config to defconfig fragment
Add PIL related config to monaco config fragment.

Change-Id: Ie91fef05193280fec15c906f23a3e9e4268808c4
Signed-off-by: Archit Saxena <archsaxe@codeaurora.org>
2021-01-29 02:16:08 -08:00
Rohith Kollalsi
f98fb1fc9e usb: dwc3: Set current accordingly based on type of charger detection
For ADSP based charger detection set the current for all
charger types as it will again be handled on ADSP side.
Other wise set current only for SDP charger which is usb
based charger. For NON ADSP based charger detection if
'iio-channel-names' is passed in the device tree, charger
detection is done through iio channel or else it is
done by power_supply_get_property.

Change-Id: I17e65448459318ad26b7a2c36742296afa5f0adf
Signed-off-by: Rohith Kollalsi <rkollals@codeaurora.org>
2021-01-29 14:47:38 +05:30
Prakash Gupta
c802bb3a23 iommu: arm-smmu: optimize arch write sync delay
With ARM_SMMU_POWER_ALWAYS_ON enabled, clocks are always on. There arch
write sync is not required. Move arch write sync post checking for clock
refcount.
Arch write sync takes longer due to virtualized global register read. Use
non virtuazlied global register to reduce read latency.

Change-Id: Ic497c7ba75cc8ba2ed804f2c987e0c595487ce40
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
2021-01-29 12:30:08 +05:30
Sarthak Garg
31a5504f56 mmc: host: sdhci-msm: Don't clear IO_PAD_PWR_SWITCH when faking 3V support
Don't clear io pad power switch setting when 3V support is faked.
This bit has to be cleared for allowing IO pad to switch to 3V when
Vccq is really configured to 3V. But in case of faking 3V where we
configure Vccq to 1.8V only, we shouldn't clear this bit.

Change-Id: I15c7e3f49703c3ac31d59d7d4bfbd81f3c2dc028
Signed-off-by: Sarthak Garg <sartgarg@codeaurora.org>
2021-01-29 11:25:24 +05:30
Kiran Gunda
4b00f2a819 backlight: qcom-spmi-wled: Change the SYNC toggle sequence
Change the ILED_SYNC and MOD_SYNC write sequence from 0 to 1
instead of 1 to 0 as per HW recommendation.

Change-Id: I93f4491cd1fd59ba5839c458157265c2d75315f9
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
2021-01-28 21:46:58 -08:00
Ashish Chavan
eb525daa25 qcom: step-chg-jeita: Add support for jeita fcc scaling
The current design of sw-jeita handling requires some predefined
steps to be added for jeita step charge, These steps need to be
tuned and updated appropriately on every platform to get the best
charge time. Add support for auto jeita fcc scaling which
when enabled auto-scales the FCC depending upon the granularity
of increase in battery temperature.

Change-Id: Ida1c9b62f1a94e32de5e74ecb75c5c0b5d47548d
Signed-off-by: Ashish Chavan <ashichav@codeaurora.org>
2021-01-29 10:46:29 +05:30
Lijuan Gao
f946f55ca9 defconfig: Add SPMI config for sdxnightjar perf build
Add SPMI config for sdxnightjar.

Change-Id: Ic825b5d3012d123782d8b7c7faaea27053df01b1
Signed-off-by: Lijuan Gao <lijuang@codeaurora.org>
2021-01-29 10:09:35 +08:00
Mayank Rana
2daf8ebe5c usb: composite: Don't override -EAGAIN return value
usb_gadget_func_wakeup() API calls USB DWC3 controller function
wakeup API. This API shall return different error value as below:
1. -EAGAIN if USB controller is into low power mode,
2. -EOPNOTSUPP if function wakeup is not supported,
3. -ETIMEDOUT or -EINVAL if USB dwc3 controller is failing to invoke
wakeup notification.
-EAGAIN return value is used by USB function driver to retry USB
function wakeup on receiving resume callback once USB bus is resumed.
Hence don't override -EAGAIN return value.

Also replace -ENOTSUPP with -EOPNOTSUPP which is error code used by
gagdet framework.

Change-Id: I5f392a7b31c169eacc3503191f6e03a72dd95238
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2021-01-28 14:49:54 -08:00
Mayank Rana
c7eaee00aa dwc3: gadget: Resume USB bus unconditionally for USB super speed and above
dwc3_gadget_wakeup() API is called for remote wakeup in high speed as
well function remote wakeup context in super speed if USB is into low
power mode. For USB func remote wakeup context, bring USB out of lower
power mode and resume USB bus unconditionally.

Change-Id: I98d015bb0040bcd31b90a464ca25b3e600587a9c
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2021-01-28 14:20:26 -08:00
Sarannya S
7a5463e159 net: qrtr: Revert lock sock changes in qrtr_recvmsg
lock_sock got wrongly added in qrtr_recvmsg as part of the
patch "net: qrtr: print error case for qrtr receive".
Reverting lock_sock and release_sock in qrtr_recvmsg.

Change-Id: I7f9639405a67e2201a848277145bac57c88f6567
Signed-off-by: Sarannya S <sarannya@codeaurora.org>
2021-01-28 21:46:14 +05:30
Venkata Rao Kakani
9330da939c drivers: soc: rename block device nodes
Rename block driver enables the renaming of block dev
nodes assigned by generic driver.

Change-Id: I40f966717683efb9800dcb34ed851f95cb22e3c8
Signed-off-by: Venkata Rao Kakani <vkakani@codeaurora.org>
2021-01-28 19:58:16 +05:30
Sandeep Singh
984c51ea4f cnss2: Add code to send qdss mode and sysfs interface for qdss
Add code to send qdss mode request and sysfs interface for
qdss_start, qdss_stop and qdss_config_download.

Change-Id: Ic4a8eff0ce870aa433308440db7283d7012ac940
Signed-off-by: Sandeep Singh <sandsing@codeaurora.org>
2021-01-28 19:35:44 +05:30
Dundi Raviteja
e7ff49b2f4 icnss2: Use correct pointer to access icnss_priv state
Server arrive may come before initializing penv which
causes possible NULL pointer dereference.

To address this, use function argument priv instead of
global variable penv.

Change-Id: I1355074614b4f30fff1c021db53654b4c844135c
Signed-off-by: Dundi Raviteja <dundi@codeaurora.org>
2021-01-28 18:25:14 +05:30
Ashish Chavan
e76f8318ec power: supply: qcom: Add support to make SMBLITE charger GKI compliant
SMBLITE charger drivers and their helper files use several power supply
properties on msm-4.19 which cannot be supported on msm-5.4 due to the
need for GKI compliance. Add support for main charger to register
as an IIO device with individual channels under it corresponding to
missing power supply properties from msm-4.19.

Change-Id: I397ed52d2fa822c7f93616090e15b109435d9657
Signed-off-by: Ashish Chavan <ashichav@codeaurora.org>
2021-01-28 18:21:30 +05:30
Dundi Raviteja
008264e782 defconfig: Add CNSS_UTILS config for monaco
Add CNSS_UTILS config for monaco.

Change-Id: If111027646370a8170872d67289a6db446ca703c
Signed-off-by: Dundi Raviteja <dundi@codeaurora.org>
2021-01-28 18:18:42 +05:30
Pavankumar Kondeti
5b3db45955 sched/walt: Move scheduler techpack to kernel
The scheduler techpack sources are moved to kernel to ease
the development.

The weak symbol definitions for WALT functions are no longer
required to cover the case of compiling kernel without syncing
the scheduler techpack. So remove all the weak symbol references.

Change-Id: Ief85bccd3dceaf60dda44aef9893b4138dc63380
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2021-01-28 17:23:24 +05:30
Hareesh Gundu
587764ea8b msm: kgsl: Add GBIF L2 CGC control with A6x CGC
GBIF L2 CGC is not covered in UCHE CGC control.
Hence handle GBIF L2 CGC settings separately.

Change-Id: I9f33b2a868a81a68c5957990f737a3eeab7cd6fc
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2021-01-28 11:59:35 +05:30
Yuanfang Zhang
8a1f01074d defconfig: enable memory dump on sdxlemur
Enable memory dump feature for sdxlemur.

Change-Id: Iad8e4ade707119e83f8f9e1eb6ec9522a91a60a2
Signed-off-by: Yuanfang Zhang <zhangyuanfang@codeaurora.org>
2021-01-28 14:24:44 +08:00
Hemant Kumar
b3295b2c12 usb: gadget: f_gsi: Handle IPA remote wakeup notification properly
Upon bus suspend when IPA requests for usb remote wake up, it is not
allowing enough time for the host to wakeup from U3. IPA is continuously
trying to wakeup the host and eventually resets the bus. Fix this issue
by adding a flag to check the status of usb remote wakeup and ignores
the request from IPA if it is in progress.

Change-Id: Id55928b7f5d3ae7f282a3b8db44949d396db0ddd
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2021-01-27 18:15:34 -08:00
Hui Li
8cfdcd8bb8 ARM64: defconfig: enable kgsl driver
Enable kgsl driver on gen3auto.

Change-Id: I64c591822c0abca40e8030442ebb662fae997ccd
Signed-off-by: Hui Li <hul@codeaurora.org>
2021-01-28 10:13:36 +08:00
Asish Bhattacharya
cad87396a9 defconfig: Disable upstream SOUNDWIRE driver for sdxnightjar
we need to enable out of kernel compilation of SOUNDWIRE
bus driver.

Change-Id: I3275eba112b44701071595e45d11c3d6cff0ee2e
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2021-01-28 02:01:28 +05:30
Mahesh Kumar Sharma
669c9af027 Bluetooth: Add conditional check before requesting gpio
Add a condition check before calling gpio_request in order
to avoid non-fatal panic.

Change-Id: Id77b99b0a7c119efb75e50c85ec185895dd8c031
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
2021-01-27 10:17:46 -08:00
Chinmay Agarwal
eff30f44eb neighbour: Prevent a dead entry from updating gc_list
Following race condition was detected:
<CPU A, t0> - neigh_flush_dev() is under execution and calls
neigh_mark_dead(n) marking the neighbour entry 'n' as dead.

<CPU B, t1> - Executing: __netif_receive_skb() ->
__netif_receive_skb_core() -> arp_rcv() -> arp_process().arp_process()
calls __neigh_lookup() which takes a reference on neighbour entry 'n'.

<CPU A, t2> - Moves further along neigh_flush_dev() and calls
neigh_cleanup_and_release(n), but since reference count increased in t2,
'n' couldn't be destroyed.

<CPU B, t3> - Moves further along, arp_process() and calls
neigh_update()-> __neigh_update() -> neigh_update_gc_list(), which adds
the neighbour entry back in gc_list(neigh_mark_dead(), removed it
earlier in t0 from gc_list)

<CPU B, t4> - arp_process() finally calls neigh_release(n), destroying
the neighbour entry.

This leads to 'n' still being part of gc_list, but the actual
neighbour structure has been freed.

The situation can be prevented from happening if we disallow a dead
entry to have any possibility of updating gc_list. This is what the
patch intends to achieve.

Change-Id: Ic8d4870586e09a8f6b6ebd190e815a18f49a269e
Fixes: 9c29a2f55e ("neighbor: Fix locking order for gc_list changes")
Signed-off-by: Chinmay Agarwal <chinagar@codeaurora.org>
2021-01-27 22:50:51 +05:30
Odelu Kukatla
f621f0e827 interconnect: qcom: Enable QoS for Yupik
Enable QoS for the master ports on Yupik with predefined
values for priority and urgency.

Change-Id: I37c3e8e53322cc5e60cced60990333480d158f46
Signed-off-by: Odelu Kukatla <okukatla@codeaurora.org>
2021-01-27 09:16:18 -08:00
Veera Vegivada
f4186977bb arm64: defconfig: Enable clock controllers for SM6150
Enable CAMCC, DISPCC, GCC, GPUCC, SCC, VIDEOCC,
DEBUGCC, AOPCC and CPUFREQ for SM6150.

Change-Id: I52aca1092633886eaec3b9c3c7cb31f623c45343
Signed-off-by: Veera Vegivada <vvegivad@codeaurora.org>
2021-01-27 20:28:19 +05:30