Commit Graph

1163383 Commits

Author SHA1 Message Date
Bartosz Golaszewski
a88673be7e UPSTREAM: tty: serial: qcom-geni-serial: refactor qcom_geni_serial_send_chunk_fifo()
Shuffle the code a bit, drop unneeded variables, make types of others
more consistent and use uart_xmit_advance() instead of handling
tail->xmit manually.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20221229155030.418800-11-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I733a8ca4653d2e942b00f40d5106004f86af9ba1
(cherry picked from commit bd7955840c)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:22:38 +00:00
Douglas Anderson
94076b81a1 UPSTREAM: soc: qcom: geni-se: add GP_LENGTH/IRQ_EN_SET/IRQ_EN_CLEAR registers
For UART devices the M_GP_LENGTH is the TX word count. For other
devices this is the transaction word count.

For UART devices the S_GP_LENGTH is the RX word count.

The IRQ_EN set/clear registers allow you to set or clear bits in the
IRQ_EN register without needing a read-modify-write.

Acked-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20240610152420.v4.1.Ife7ced506aef1be3158712aa3ff34a006b973559@changeid
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20240906131336.23625-4-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I092594fffc83cdbf753c56d733da9b13ddfe0cc0
(cherry picked from commit b03ffc76b83c1a7d058454efbcf1bf0e345ef1c2)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:22:38 +00:00
Douglas Anderson
a137aa79a6 UPSTREAM: soc: qcom: geni-se: Add M_TX_FIFO_NOT_EMPTY bit definition
According to the docs I have, bit 21 of the status register is
asserted when the FIFO is _not_ empty. Add the definition.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240112150307.1.I7dc0993c1e758a1efedd651e7e1670deb1b430fb@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I1372fe15b0d8b8ee302dccbc81f832be15a93ee5
(cherry picked from commit 486676116f4852d4198690c2c98af060cd96ab83)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-23 06:22:38 +00:00
Peter Wang
1790581f0a FROMLIST: ufs: core: requeue aborted request
After the SQ cleanup fix, the CQ will receive a response with
the corresponding tag marked as OCS: ABORTED. To align with
the behavior of Legacy SDB mode, the handling of OCS: ABORTED
has been changed to match that of OCS_INVALID_COMMAND_STATUS
(SDB), with both returning a SCSI result of DID_REQUEUE.

Furthermore, the workaround implemented before the SQ cleanup
fix can be removed.

Bug: 373785306
Fixes: ab248643d3 ("scsi: ufs: core: Add error handling for MCQ mode")
Change-Id: Id1d51f2921a519aa5d2a83b7fc70e17a45fb26b9
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/all/20241001091917.6917-3-peter.wang@mediatek.com/
2024-10-22 22:07:40 +00:00
Peter Wang
51903b71f0 FROMLIST: ufs: core: fix the issue of ICU failure
When setting the ICU bit without using read-modify-write,
SQRTCy will restart SQ again and receive an RTC return
error code 2 (Failure - SQ not stopped).

Additionally, the error log has been modified so that
this type of error can be observed.

Bug: 373785306
Fixes: ab248643d3 ("scsi: ufs: core: Add error handling for MCQ mode")
Change-Id: I46fca8eaeaa17c622349b26f97fc100aa182dea2
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/all/20241001091917.6917-2-peter.wang@mediatek.com/
2024-10-22 22:07:40 +00:00
Kever Yang
00f19bd9ed ANDROID: GKI: Add symbol for rockchip pci remove
INFO: 1 function symbol(s) added
  'void dw_pcie_host_deinit(struct dw_pcie_rp*)'

Bug: 300024866
Change-Id: I0d3d9bafcf1eb3cbbe2764c8fa030d63af5a7d3f
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2024-10-22 09:43:10 +08:00
Mrinmay Sarkar
5e1f4bb11f ANDROID: abi_gki_aarch64_qcom: Add pci_ecam_map_bus and pci_host_common_probe
Update abi_gki_aarch64_qcom with symbols needed for QCOM PCIe usecase.

2 function symbol(s) added
  'void* pci_ecam_map_bus(struct pci_bus*, unsigned int, int)'
  'int pci_host_common_probe(struct platform_device*)'

Bug: 374011847
Change-Id: I566c615134e79a67eb12158acb38ee88f3878a3b
Signed-off-by: Mrinmay Sarkar <quic_msarkar@quicinc.com>
2024-10-21 13:49:41 +00:00
yipeng xiang
72f51dd698 ANDROID: abi_gki_aarch64_honor: whitelist symbols added for skip memcg reclaim by priority
White list the __tracepoint_android_vh_should_memcg_bypass symbol.

1 function symbol(s) added
  'int __traceiter_android_vh_should_memcg_bypass(void*, struct mem_cgroup*, int, bool*)'

1 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_should_memcg_bypass'

Bug: 369921205
Change-Id: I13ae1efde783bb440fa0cbab5b436d522d58d2a2
Signed-off-by: yipeng xiang <yipengxiang@honor.corp-partner.google.com>
2024-10-21 12:30:03 +00:00
yipeng xiang
f2b3f5888f ANDROID: mm: add vendor hook to skip memcg reclaim by priority
Add vendor hook to determine whether a memcg should be recalimed.
Avoid import memcg file pages are frequently reclaimed.

Bug: 369921205
Change-Id: Iac4abcf3a59a9c26ef9895a8f0d35aa6b6c26776
Signed-off-by: yipeng xiang <yipengxiang@honor.corp-partner.google.com>
2024-10-21 12:30:03 +00:00
Fuad Tabba
add3d68602 ANDROID: KVM: arm64: Don't run a protected VCPU if it isn't runnable
Don't run a protected VCPU in pKVM if it isn't in a runnable PSCI
state. For protected VMs, the PSCI state is the reference state
for whether they are runnable or not.

Bug: 278749606
Bug: 373638114
Reported-by: Dmytro Maluka <dmaluka@google.com>
Change-Id: I17cc60852aa45225e65fe810f9b196e3afe88a70
Signed-off-by: Fuad Tabba <tabba@google.com>
2024-10-21 10:10:41 +00:00
Lianqin Hu
1fe91f863a ANDROID: usb: Optimization the transfer rate of accessory mode in USB3.2 mode
BmAttributes controls the maximum number of streams supported by the endpoint.
streaming is a data transmission mode that allows multiple data packets
to be sent simultaneously in one transmission cycle.

Set bmAttributes to 16, bulk endpoint with more than 65536 streams,
can effectively improve data throughput.

Modify bmAttributes to 16.
The 5Gbps peak rate increases from 350MB/s to 400MB/s.
The 10Gbps peak rate is increased from 500MB/s to 600MB/s.

Bug: 373314134

Change-Id: I4b6c9554ff39a7b2222461e1949825dd6148c006
Signed-off-by: Lianqin Hu <hulianqin@vivo.corp-partner.google.com>
Signed-off-by: Lianqin Hu <hulianqin@vivo.com>
2024-10-18 20:46:52 +00:00
Vijaya Krishna Nivarthi
299cc91948 UPSTREAM: spi: spi-geni-qcom: Select FIFO mode for chip select
Spi geni driver switches between FIFO and DMA modes based on xfer length.
FIFO mode relies on M_CMD_DONE_EN interrupt for completion while DMA mode
relies on XX_DMA_DONE.
During dynamic switching, if FIFO mode is chosen, FIFO related interrupts
are enabled and DMA related interrupts are disabled. And viceversa.
Chip select shares M_CMD_DONE_EN interrupt with FIFO to check completion.
Now, if a chip select operation is preceded by a DMA xfer, M_CMD_DONE_EN
interrupt would have been disabled and hence it will never receive one
resulting in timeout.

For chip select, in addition to setting the xfer mode to FIFO,
select_mode() to FIFO so that required interrupts are enabled.

Fixes: e5f0dfa78a ("spi: spi-geni-qcom: Add support for SE DMA mode")
Suggested-by: Praveen Talari <quic_ptalari@quicinc.com
Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com
Reviewed-by: Douglas Anderson <dianders@chromium.org
Link: https://lore.kernel.org/r/1683626496-9685-1-git-send-email-quic_vnivarth@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org

Bug: 370629635
Change-Id: Icd72416f413abc7fd67ac69c1a56251d9b2b4149
(cherry picked from commit 4c329f5da7)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-17 19:22:25 +00:00
Will Deacon
b490c66749 ANDROID: KVM: arm64: Don't skip accounting when memcache top-up fails
If topup_hyp_memcache() fails mid-way through a memcache top-up, we
should still account for the pages that were successfully added.

Don't skip accounting when topup_hyp_memcache() fails.

Bug: 373813803
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I2ffcfbe45452600994f5b69b73ea2bd00d64aeae
2024-10-17 17:02:24 +00:00
Will Deacon
1181501872 ANDROID: KVM: arm64: Fix accounting when VM creation fails
When VM creation fails part-way through __pkvm_create_hyp_vm(), we end
up destroying the partial state by calling pkvm_destroy_hyp_vm()
before the memory accounting metadata has been updated. Consequently,
we underflow the 'protected_hyp_mem' counter and run into the following
warning:

 18446744073709518848B of donations to the nVHE hyp are missing

Rework the accounting updates so that the per-VM structures are
accounted immediately after initialising the VM, with the vCPU memory
being accounted one-by-one as they are initialised.

Bug: 373813803
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: If4ae9816df009ca2a74aff5964676465c25fe6dc
2024-10-17 17:02:24 +00:00
Uwe Kleine-König
8baadbac00 UPSTREAM: spi: geni-qcom: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230303172041.2103336-30-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

Bug: 370629635
Change-Id: I604c1be770a2413f9370befef1acbbcb05b5191d
(cherry picked from commit d0b52f6539)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-17 13:21:07 +05:30
Vijaya Krishna Nivarthi
5ab05b86ef UPSTREAM: spi: spi-geni-qcom: Add support for SE DMA mode
SE DMA mode can be used for larger transfers and FIFO mode
for smaller transfers.

Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/1670509544-15977-1-git-send-email-quic_vnivarth@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>

Bug: 370629635
Change-Id: I912aa601420a92599b7aaad0f3e4ad5555bdef88
(cherry picked from commit e5f0dfa78a)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-17 11:03:41 +05:30
Praveen Talari
271bd223dd UPSTREAM: soc: qcom: geni-se: Add SPI Device mode support for GENI based QuPv3
Add device mode supported registers and masks.

Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
Reviewed-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Link: https://lore.kernel.org/r/20230714042203.14251-2-quic_ptalari@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>

Bug: 370629635
Change-Id: Ibfa810a93d0058912f827a76be9bd1fdacf88443
(cherry picked from commit 59bbe86bb2)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-17 10:58:26 +05:30
Bartosz Golaszewski
27021bed80 UPSTREAM: tty: serial: qcom-geni-serial: split out the FIFO tx code
qcom_geni_serial_handle_tx() is pretty big, let's move the code that
handles the actual writing of data to a separate function which makes
sense in preparation for introducing a dma variant of handle_tx().

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20221229155030.418800-10-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: Id456ba7c9a15ea7e05f4dc18f50d03390dbffda1
(cherry picked from commit d420fb491c)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 22:43:45 +00:00
Bartosz Golaszewski
ad717604be UPSTREAM: tty: serial: qcom-geni-serial: remove unneeded tabs
Remove redundant indentation in struct member assignment.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20221229155030.418800-9-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I00241ff179f7e91367af3362c1324d9b55750f0a
(cherry picked from commit 3931b8fdec)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 22:43:45 +00:00
Bartosz Golaszewski
ad37632534 UPSTREAM: tty: serial: qcom-geni-serial: refactor qcom_geni_serial_isr()
Simplify the conditions in qcom_geni_serial_isr() and fix indentation.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20221229155030.418800-8-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: Idd2f22b9a0ca3e9393c6c91d539127dbcad84609
(cherry picked from commit fe6a00e8fc)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 22:43:45 +00:00
Bartosz Golaszewski
1f0775355f UPSTREAM: tty: serial: qcom-geni-serial: remove stray newlines
Remove stray newlines around #ifdefs for consistency with the rest
of the driver code.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20221229155030.418800-7-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: Id9bffc3e9154545ecdd92ed64d2da7589804d2b8
(cherry picked from commit 2f853f83f4)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 22:43:45 +00:00
Bartosz Golaszewski
59cbbd0b09 UPSTREAM: tty: serial: qcom-geni-serial: improve the to_dev_port() macro
The member we want to resolve in struct qcom_geni_serial_port is called
uport so we don't need an additional redundant parameter in this macro.

While at it: turn the macro into a static inline function.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20221229155030.418800-6-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: Ia1a89518e92925764573ff2f30836384bf7bfbf7
(cherry picked from commit 00ce7c6e86)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 20:56:40 +00:00
Bartosz Golaszewski
f4eec633c0 UPSTREAM: tty: serial: qcom-geni-serial: align #define values
Keep the #define symbols aligned for better readability.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20221229155030.418800-5-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I70a55f560269d0d9deec4bf499ee75d07065d030
(cherry picked from commit 6cde11dbf4)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 20:56:40 +00:00
Bartosz Golaszewski
b92a6c8545 UPSTREAM: tty: serial: qcom-geni-serial: remove unused symbols
Drop all unused symbols from the driver.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20221229155030.418800-4-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I855656c04c69602c8dfc391424ba4b395f08d91e
(cherry picked from commit 68c6bd92c8)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 20:56:40 +00:00
Bartosz Golaszewski
6e6cda8f06 UPSTREAM: tty: serial: qcom-geni-serial: drop unneeded forward definitions
If we shuffle the code a bit, we can drop all forward definitions of
various static functions.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20221229155030.418800-3-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: If741a90295960d502af58641c4db61ab14b1dabe
(cherry picked from commit d0fabb0dc1)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 20:56:40 +00:00
Bartosz Golaszewski
d75a50763e UPSTREAM: tty: serial: qcom-geni-serial: stop operations in progress at shutdown
We don't stop transmissions in progress at shutdown. This is fine with
FIFO SE mode but with DMA (support for which we'll introduce later) it
causes trouble so fix it now.

Fixes: e83766334f ("tty: serial: qcom_geni_serial: No need to stop tx/rx on UART shutdown")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20221229155030.418800-2-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 370629635
Change-Id: I8ca4171bf25b530e7fc4bb91fad93358d753b746
(cherry picked from commit d8aca2f968)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 20:56:40 +00:00
Charan Teja Kalla
481220c5b9 ANDROID: abi_gki_aarch64_qcom: whitelist mm symbols
Whitelist the below symbols:
lru_gen_caps
unpack_shadow

Compiler o/p:
INFO: 1 function symbol(s) added
  'void unpack_shadow(void*, int*, pg_data_t**, unsigned long*, bool*)'

1 variable symbol(s) added
  'struct static_key_true lru_gen_caps[3]'

Bug: 369964379
Change-Id: I419c6273bfe2e4ce533e2c344d347683059822d5
Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
2024-10-16 19:52:42 +00:00
Charan Teja Kalla
e697302b05 ANDROID: mm: export lru_gen_caps
lru_gen_caps is exported to allow for lru_gen_enabled() to be used.

Bug: 369964379
Change-Id: Ic0a79eb19fd8da0232db1a63263be4184d960b4a
Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
2024-10-16 19:52:42 +00:00
Charan Teja Kalla
1a3bbc1910 ANDROID: mm: export unpack_shadow
The commit 56526cf94076("ANDROID: mm: swap: export and whitelist
get_shadow_from_swap_cache") exports the api to get the shadow entry
from the swap cache which is then used to check if this entry can be
further pushed down to slower devices.

At present, we are manually extracting the information from this shadow
entry using the same macros being used by unpack_shadow(). Instead
export this function.

Bug: 369964379
Change-Id: Id044add31434d234e4a6136f192c11ab20ad0985
Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
2024-10-16 19:52:42 +00:00
Jinjie Ruan
a6266110c1 UPSTREAM: i2c: qcom-geni: Use IRQF_NO_AUTOEN flag in request_irq()
disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable when request IRQ.

Fixes: 37692de5d5 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: <stable@vger.kernel.org> # v4.19+
Acked-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

Bug: 370629635
Change-Id: Ifeed53c2672c0b934dfbcd19f4aba3512a20d14f
(cherry picked from commit e2c85d85a05f16af2223fcc0195ff50a7938b372)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Andi Shyti
c24feb930a UPSTREAM: i2c: qcom-geni: Use goto for clearer exit path
Refactor the code by using goto statements to reduce duplication
and make the exit path clearer.

Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

Bug: 370629635
Change-Id: I6e7152bd47d76bc7dd0eb98ffd7906eb52b91478
(cherry picked from commit 23cc961a08591976eb17ca8552a602425b1a780d)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Andi Shyti
80c036f7f2 UPSTREAM: i2c: qcom-geni: Add missing geni_icc_disable in geni_i2c_runtime_resume
Add the missing geni_icc_disable() call before returning in the
geni_i2c_runtime_resume() function.

Commit 9ba48db9f77c ("i2c: qcom-geni: Add missing
geni_icc_disable in geni_i2c_runtime_resume") by Gaosheng missed
disabling the interconnect in one case.

Fixes: bf225ed357 ("i2c: i2c-qcom-geni: Add interconnect support")
Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
Cc: stable@vger.kernel.org # v5.9+
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

Bug: 370629635
Change-Id: I572d96cd5f29e9e1adac5c0b99c00792222fc4f0
(cherry picked from commit 4e91fa1ef3ce6290b4c598e54b5eb6cf134fbec8)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Gaosheng Cui
688cbb4cee UPSTREAM: i2c: qcom-geni: Add missing geni_icc_disable in geni_i2c_runtime_resume
Add the missing geni_icc_disable() before return in
geni_i2c_runtime_resume().

Fixes: bf225ed357 ("i2c: i2c-qcom-geni: Add interconnect support")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

Bug: 370629635
Change-Id: I63fc78059b3d90309131d19ecd86f8e1091c0970
(cherry picked from commit 9ba48db9f77ce0001dbb882476fa46e092feb695)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Gaosheng Cui
aff2261bb1 UPSTREAM: i2c: qcom-geni: Add missing clk_disable_unprepare in geni_i2c_runtime_resume
Add the missing clk_disable_unprepare() before return in
geni_i2c_runtime_resume().

Fixes: 14d02fbadb ("i2c: qcom-geni: add desc struct to prepare support for I2C Master Hub variant")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

Bug: 370629635
Change-Id: I37ee2eab599292d459a78dfea8642569365c564b
(cherry picked from commit b93d16bee557302d4e588375ececd833cc048acc)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Wolfram Sang
371a327f3d UPSTREAM: i2c: qcom-geni: use 'time_left' variable with wait_for_completion_timeout()
There is a confusing pattern in the kernel to use a variable named 'timeout' to
store the result of wait_for_completion_timeout() causing patterns like:

	timeout = wait_for_completion_timeout(...)
	if (!timeout) return -ETIMEDOUT;

with all kinds of permutations. Use 'time_left' as a variable to make the code
self explaining.

Fix to the proper variable type 'unsigned long' while here.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

Bug: 370629635
Change-Id: Idfddb7efcc4fb0aeceb7972316415afab815faca
(cherry picked from commit f9288ff67a8f4bc2645d32a512d4b30f73f956d5)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Wolfram Sang
c756c6b094 UPSTREAM: i2c: qcom-geni: remove printout on handled timeouts
I2C and SMBus timeouts are not something the user needs to be informed
about on controller level. The client driver may know if that really is
a problem and give more detailed information to the user. The controller
should just pass this information upwards. Remove the printout.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

Bug: 370629635
Change-Id: Ie1390ae6031913154eb152517f2f4e5147c5fe87
(cherry picked from commit 6d128e73c7820356a3481024166b9f3dc3aee99c)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Yang Yingliang
fa329140c1 UPSTREAM: i2c: qcom-geni: fix missing clk_disable_unprepare() and geni_se_resources_off()
Add missing clk_disable_unprepare() and geni_se_resources_off() in the error
path in geni_i2c_probe().

Fixes: 14d02fbadb ("i2c: qcom-geni: add desc struct to prepare support for I2C Master Hub variant")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

Bug: 370629635
Change-Id: I914d5fa381478dfe0dbcf98b1245b411e5a4a84a
(cherry picked from commit 043465b66506e8c647cdd38a2db1f2ee0f369a1b)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Yangtao Li
8fd3f0784d UPSTREAM: i2c: qcom-geni: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

Bug: 370629635
Change-Id: I7d5087c66ff6c9799cb43190156b6149c89c0bbd
(cherry picked from commit 02ebc01dde)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Uwe Kleine-König
02b20eb4bc UPSTREAM: i2c: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Alain Volmat <alain.volmat@foss.st.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Jochen Friedrich <jochen@scram.de>
Acked-by: Peter Rosin <peda@axentia.se>
Acked-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Asmaa Mnebhi <asnaa@nvidia.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Chris Pringle <chris.pringle@phabrix.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Tali Perry <tali.perry@nuvoton.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

Bug: 370629635
Change-Id: I47c4e41ec0dc6dd719fd4416219875116bcf94e6
(cherry picked from commit e190a0c389)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Yang Yingliang
a650b9fb29 UPSTREAM: i2c: qcom-geni: change i2c_master_hub to static
i2c_master_hub is only used in i2c-qcom-geni.c now,
change it to static.

Fixes: cacd9643ec ("i2c: qcom-geni: add support for I2C Master Hub variant")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

Bug: 370629635
Change-Id: If191b6b205f111c9b54590859438c75235e2bd0a
(cherry picked from commit 597688792c)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Neil Armstrong
aa4151b832 UPSTREAM: i2c: qcom-geni: add support for I2C Master Hub variant
The I2C Master Hub is a stripped down version of the GENI Serial Engine
QUP Wrapper Controller but only supporting I2C serial engines without
DMA support.

Add the I2C Master Hub serial engine compatible along the specific
requirements in a new desc struct passed through the device match data.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

Bug: 370629635
Change-Id: I161a19650cd69595e0829411a2dd12a58de23615
(cherry picked from commit cacd9643ec)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Neil Armstrong
47d1f8edd6 UPSTREAM: i2c: qcom-geni: add desc struct to prepare support for I2C Master Hub variant
The I2C Master Hub is a stripped down version of the GENI Serial Engine
QUP Wrapper Controller but only supporting I2C serial engines without
DMA support.

Those I2C serial engines variants have some requirements:
- a separate "core" clock
- doesn't support DMA, thus no memory interconnect path
- fixed FIFO size not discoverable in the HW_PARAM_0 register

Add a desc struct specifying all those requirements which will be used in
a next change when adding the I2C Master Hub serial engine compatible.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

Bug: 370629635
Change-Id: I9f007f3f4f435e59e41849d357fe0ed72b81c63d
(cherry picked from commit 14d02fbadb)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-16 19:38:37 +00:00
Veerendranath Jakkam
752034bc87 UPSTREAM: wifi: cfg80211: fix reporting failed MLO links status with cfg80211_connect_done
Individual MLO links connection status is not copied to
EVENT_CONNECT_RESULT data while processing the connect response
information in cfg80211_connect_done(). Due to this failed links
are wrongly indicated with success status in EVENT_CONNECT_RESULT.

To fix this, copy the individual MLO links status to the
EVENT_CONNECT_RESULT data.

Bug: 254441685
Fixes: 53ad07e982 ("wifi: cfg80211: support reporting failed links")
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Reviewed-by: Carlos Llamas <cmllamas@google.com>
Link: https://patch.msgid.link/20240724125327.3495874-1-quic_vjakkam@quicinc.com
[commit message editorial changes]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit baeaabf970b9a90999f62ae27edf63f6cb86c023)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I0a1aacb180914e8d5509eab44aa27bd82272bbf7
2024-10-15 14:12:46 +01:00
Manivannan Sadhasivam
40c204b003 UPSTREAM: scsi: ufs: core: Do not set link to OFF state while waking up from hibernation
UFS link is just put into hibern8 state during the 'freeze' process of the
hibernation. Afterwards, the system may get powered down. But that doesn't
matter during wakeup. Because during wakeup from hibernation, UFS link is
again put into hibern8 state by the restore kernel and then the control is
handed over to the to image kernel.

So in both the places, UFS link is never turned OFF. But
ufshcd_system_restore() just assumes that the link will be in OFF state and
sets the link state accordingly. And this breaks hibernation wakeup:

[ 2445.371335] phy phy-1d87000.phy.3: phy_power_on was called before phy_init
[ 2445.427883] ufshcd-qcom 1d84000.ufshc: Controller enable failed
[ 2445.427890] ufshcd-qcom 1d84000.ufshc: ufshcd_host_reset_and_restore: Host init failed -5
[ 2445.427906] ufs_device_wlun 0:0:0:49488: ufshcd_wl_resume failed: -5
[ 2445.427918] ufs_device_wlun 0:0:0:49488: PM: dpm_run_callback(): scsi_bus_restore returns -5
[ 2445.427973] ufs_device_wlun 0:0:0:49488: PM: failed to restore async: error -5

So fix the issue by removing the code that sets the link to OFF state.

Bug: 254441685
Cc: Anjana Hari <quic_ahari@quicinc.com>
Cc: stable@vger.kernel.org # 6.3
Fixes: 88441a8d35 ("scsi: ufs: core: Add hibernation callbacks")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20240718170659.201647-1-manivannan.sadhasivam@linaro.org
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ac6efb12ca64156f4a94e964acdb96ee7d59630d)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ie855c205e39a182050f2080929977e4246eb49e1
2024-10-15 14:12:46 +01:00
Yu Zhao
2589c7fa08 UPSTREAM: mm/mglru: fix overshooting shrinker memory
set_initial_priority() tries to jump-start global reclaim by estimating
the priority based on cold/hot LRU pages.  The estimation does not account
for shrinker objects, and it cannot do so because their sizes can be in
different units other than page.

If shrinker objects are the majority, e.g., on TrueNAS SCALE 24.04.0 where
ZFS ARC can use almost all system memory, set_initial_priority() can
vastly underestimate how much memory ARC shrinker can evict and assign
extreme low values to scan_control->priority, resulting in overshoots of
shrinker objects.

To reproduce the problem, using TrueNAS SCALE 24.04.0 with 32GB DRAM, a
test ZFS pool and the following commands:

  fio --name=mglru.file --numjobs=36 --ioengine=io_uring \
      --directory=/root/test-zfs-pool/ --size=1024m --buffered=1 \
      --rw=randread --random_distribution=random \
      --time_based --runtime=1h &

  for ((i = 0; i < 20; i++))
  do
    sleep 120
    fio --name=mglru.anon --numjobs=16 --ioengine=mmap \
      --filename=/dev/zero --size=1024m --fadvise_hint=0 \
      --rw=randrw --random_distribution=random \
      --time_based --runtime=1m
  done

To fix the problem:
1. Cap scan_control->priority at or above DEF_PRIORITY/2, to prevent
   the jump-start from being overly aggressive.
2. Account for the progress from mm_account_reclaimed_pages(), to
   prevent kswapd_shrink_node() from raising the priority
   unnecessarily.

Bug: 254441685
Link: https://lkml.kernel.org/r/20240711191957.939105-2-yuzhao@google.com
Fixes: e4dde56cd2 ("mm: multi-gen LRU: per-node lru_gen_folio lists")
Signed-off-by: Yu Zhao <yuzhao@google.com>
Reported-by: Alexander Motin <mav@ixsystems.com>
Cc: Wei Xu <weixugc@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 3f74e6bd3b84a8b6bb3cc51609c89e5b9d58eed7)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I4ae651a8f945c7115da48205dbfea04e66032a68
2024-10-15 14:12:46 +01:00
Willem de Bruijn
4d8187d2c8 UPSTREAM: gso: fix udp gso fraglist segmentation after pull from frag_list
Detect gso fraglist skbs with corrupted geometry (see below) and
pass these to skb_segment instead of skb_segment_list, as the first
can segment them correctly.

Valid SKB_GSO_FRAGLIST skbs
- consist of two or more segments
- the head_skb holds the protocol headers plus first gso_size
- one or more frag_list skbs hold exactly one segment
- all but the last must be gso_size

Optional datapath hooks such as NAT and BPF (bpf_skb_pull_data) can
modify these skbs, breaking these invariants.

In extreme cases they pull all data into skb linear. For UDP, this
causes a NULL ptr deref in __udpv4_gso_segment_list_csum at
udp_hdr(seg->next)->dest.

Detect invalid geometry due to pull, by checking head_skb size.
Don't just drop, as this may blackhole a destination. Convert to be
able to pass to regular skb_segment.

Link: https://lore.kernel.org/netdev/20240428142913.18666-1-shiming.cheng@mediatek.com/
Fixes: 9fd1ff5d2a ("udp: Support UDP fraglist GRO/GSO.")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20241001171752.107580-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Bug: 373245346
Bug: 333849117
Change-Id: I5a317e002f149cf9d399dce9bf87cd649a24da19
(cherry picked from commit a1e40ac5b5e9077fe1f7ae0eb88034db0f9ae1ab)
Signed-off-by: Lena Wang <lena.wang@mediatek.corp-partner.google.com>
(cherry picked from commit 42c2d1ea7c1bf984372f0ca1711d91165cbb87a6)
(cherry picked from commit 7376b8e51c4ddaa8e36b2b33d6ac3392135183b1)
2024-10-14 17:27:09 +00:00
Vijaya Krishna Nivarthi
b11f74b6c1 UPSTREAM: soc: qcom: geni-se: Do not bother about enable/disable of interrupts in secondary sequencer
The select_fifo/dma_mode() functions in geni driver enable/disable
interrupts (secondary included) conditionally for non-uart modes, while
uart is supposed to manage this internally.
However, only uart uses secondary IRQs while spi, i2c do not care about
these at all making their enablement (or disablement) totally unnecessary
for these protos.
Similarly, select_gpi_mode() also does disable s_irq and its useless again.

Drop enabling/disabling secondary IRQs.
This doesn't solve any observed problem but only gets rid of code pieces
that are not required.

Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/1686742087-30731-1-git-send-email-quic_vnivarth@quicinc.com

Bug: 370629635
Change-Id: Id35fae83b7628cf583e4cdd6307862da08d07a9c
(cherry picked from commit 5d85ea2c87)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-14 17:22:48 +00:00
Vijaya Krishna Nivarthi
f9d2a8a3bf UPSTREAM: soc: qcom: geni-se: Add interfaces geni_se_tx_init_dma() and geni_se_rx_init_dma()
The geni_se_xx_dma_prep() interfaces necessarily do DMA mapping before
initiating DMA transfers. This is not suitable for spi where framework
is expected to handle map/unmap.

Expose new interfaces geni_se_xx_init_dma() which do only DMA transfer.

Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/1684325894-30252-2-git-send-email-quic_vnivarth@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>

Bug: 370629635
Change-Id: I14cc6034fe404cd0777482965c98c30456547d57
(cherry picked from commit 6d6e575949)
Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
2024-10-14 17:22:48 +00:00
Gabriel Krisman Bertazi
8097478ae8 UPSTREAM: unicode: Don't special case ignorable code points
We don't need to handle them separately. Instead, just let them
decompose/casefold to themselves.

Change-Id: I01c3f2c98ae4d84269586cec09f18239cbee0abb
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
(cherry picked from commit 5c26d2f1d3f5e4be3e196526bead29ecb139cf91)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2024-10-14 10:04:19 +00:00
Chao Yu
d41d398db6 BACKPORT: f2fs: fix to handle segment allocation failure correctly
If CONFIG_F2FS_CHECK_FS is off, and for very rare corner case that
we run out of free segment, we should not panic kernel, instead,
let's handle such error correctly in its caller.

Signed-off-by: Chao Yu <chao@kernel.org>
Tested-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Change-Id: I4e7d90895d82687ae6ec6b64b2de222f1ee2ee9e
Bug: 361829529
(cherry picked from commit 7d009e048d7cfcc21d400f2aba4c8bacbdebbd47)
Signed-off-by: Daeho Jeong <daehojeong@google.com>
2024-10-11 18:08:33 +00:00